Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(design-system,web): Move icons #5677

Merged
merged 9 commits into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion apps/web/src/components/layout/components/v2/HeaderNav.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { ActionIcon, Header } from '@mantine/core';

import { IconHelpOutline, Tooltip } from '@novu/design-system';
import { IconHelpOutline } from '@novu/novui/icons';
import { Tooltip } from '@novu/design-system';
import { IS_DOCKER_HOSTED } from '../../../../config';
import { useBootIntercom } from '../../../../hooks';
import useThemeChange from '../../../../hooks/useThemeChange';
Expand Down
8 changes: 4 additions & 4 deletions apps/web/src/hooks/useThemeChange.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ColorScheme, useMantineColorScheme } from '@mantine/core';
import { IconDarkMode, IconLightMode, IconTonality } from '@novu/design-system';
import { IconOutlineDarkMode, IconOutlineLightMode, IconOutlineTonality } from '@novu/novui/icons';
import { ColorSchemePreferenceEnum, THEME_TITLE_LOOKUP, useLocalThemePreference, useSegment } from '@novu/shared-web';
import { useEffect, useMemo } from 'react';
import { useDebounce } from './useDebounce';
Expand All @@ -8,13 +8,13 @@ type ThemeChange = { colorScheme: ColorScheme; themeStatus: ColorSchemePreferenc

const getThemeIcon = (themeStatus: ColorSchemePreferenceEnum) => {
if (themeStatus === ColorSchemePreferenceEnum.DARK) {
return <IconDarkMode />;
return <IconOutlineDarkMode />;
}
if (themeStatus === ColorSchemePreferenceEnum.LIGHT) {
return <IconLightMode />;
return <IconOutlineLightMode />;
}

return <IconTonality />;
return <IconOutlineTonality />;
};

export default function useThemeChange() {
Expand Down
22 changes: 19 additions & 3 deletions libs/design-system/src/iconsV2/Icon.types.ts
Original file line number Diff line number Diff line change
@@ -1,28 +1,44 @@
import { CSSProperties, SVGAttributes } from 'react';

/** Icon Size in pixels (to be replaced with values directly from Design System) */
/**
* @deprecated Use @novu/novui/icons instead.
* Icon Size in pixels (to be replaced with values directly from Design System)
*/
export type IconSize = '16' | '20' | '24';

/** A temporary type that accepts a typical CSS color until we have our strict Design System types defined */
/**
* @deprecated Use @novu/novui/icons instead.
* A temporary type that accepts a typical CSS color until we have our strict Design System types defined
*/
type UnsafeIconColor = CSSProperties['color'];

/** @deprecated Use @novu/novui/icons instead. */
export interface IIconStyleProps {
/**
*
* @deprecated Use @novu/novui/icons instead.
* Default: '20px'.
*
* The actual display size in pixels.
*/
size?: IconSize;
/**
*
* @deprecated Use @novu/novui/icons instead.
* Default: B60
*
* WARNING: this is only to be used with colors from the design system, and will later be enforced more strictly
*/
color?: UnsafeIconColor;
}

/** @deprecated Use @novu/novui/icons instead. */
export interface IIconProps extends Omit<SVGAttributes<SVGElement>, 'color'>, IIconStyleProps {
/** Description for accessibility. This is mandatory so that we make a11y a priority with icons */
/**
* Description for accessibility. This is mandatory so that we make a11y a priority with icons
*/
title: string;
}

/** @deprecated Use @novu/novui/icons instead. */
export type IconType = (props: IIconProps) => JSX.Element;
Loading
Loading