diff --git a/.changeset/nervous-cougars-sparkle.md b/.changeset/nervous-cougars-sparkle.md new file mode 100644 index 00000000..7b2b29d9 --- /dev/null +++ b/.changeset/nervous-cougars-sparkle.md @@ -0,0 +1,7 @@ +--- +'@jpmorganchase/mosaic-components': patch +'@jpmorganchase/mosaic-theme': patch +--- + +Removed overrides for Salt icon color and size. +Mosaic Icon component now uses number for size. diff --git a/packages/components/src/AudioPlayer/index.tsx b/packages/components/src/AudioPlayer/index.tsx index 4c76b25d..2ae8db57 100644 --- a/packages/components/src/AudioPlayer/index.tsx +++ b/packages/components/src/AudioPlayer/index.tsx @@ -136,7 +136,7 @@ export const AudioPlayer: React.FC = ({ src, title, skipDurati
- +
diff --git a/packages/components/src/Callout/index.tsx b/packages/components/src/Callout/index.tsx index 54aab4c6..1b786e74 100644 --- a/packages/components/src/Callout/index.tsx +++ b/packages/components/src/Callout/index.tsx @@ -54,7 +54,7 @@ export const Callout: React.FC = ({ const titleText = titleProp !== undefined ? titleProp : title; return (
- + {titleText}
{children}
diff --git a/packages/components/src/FilterToolbar/FilterDropdown/index.tsx b/packages/components/src/FilterToolbar/FilterDropdown/index.tsx index d012358b..7f80285c 100644 --- a/packages/components/src/FilterToolbar/FilterDropdown/index.tsx +++ b/packages/components/src/FilterToolbar/FilterDropdown/index.tsx @@ -49,7 +49,7 @@ export function FilterDropdown({ source={listItems} triggerComponent={ - + diff --git a/packages/components/src/FilterToolbar/SortDropdown/index.tsx b/packages/components/src/FilterToolbar/SortDropdown/index.tsx index e8ffbb8e..66d07277 100644 --- a/packages/components/src/FilterToolbar/SortDropdown/index.tsx +++ b/packages/components/src/FilterToolbar/SortDropdown/index.tsx @@ -42,7 +42,7 @@ export function FilterSortDropdown({ source={source} triggerComponent={ - + } diff --git a/packages/components/src/Icon/index.tsx b/packages/components/src/Icon/index.tsx index 994a09cd..01cb2d2c 100644 --- a/packages/components/src/Icon/index.tsx +++ b/packages/components/src/Icon/index.tsx @@ -1,17 +1,21 @@ import React from 'react'; import { icons, IconNames } from '@jpmorganchase/mosaic-theme'; -import styles from './styles.css'; - export interface IconProps { /** Additional class name for root class override. */ className?: string; /** Name of the icon */ name: IconNames; /** Size of Icon */ - size?: 'small' | 'medium' | 'large'; + size?: number | 'small' | 'medium' | 'large'; } +const iconSizeMap = { + small: 1, + medium: 2, + large: 3 +}; + const deprecatedIcons = { tick: 'successTick' }; @@ -19,7 +23,7 @@ const deprecatedIcons = { export const Icon: React.FC> = ({ className, name, - size = 'small', + size = 1, ...rest }) => { if (name === 'none') { @@ -37,9 +41,10 @@ export const Icon: React.FC> = ({ throw new Error(`icon ${currentIconName} is not supported`); } const IconComponent = icons[currentIconName]; + const iconSize = typeof size === 'string' ? iconSizeMap[size] : size; return ( - + ); }; diff --git a/packages/components/src/Icon/styles.css.ts b/packages/components/src/Icon/styles.css.ts deleted file mode 100644 index 70971d8a..00000000 --- a/packages/components/src/Icon/styles.css.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { icon } from '@jpmorganchase/mosaic-theme'; - -const styles = { - small: icon.small, - medium: icon.medium, - large: icon.large -}; - -export default styles; diff --git a/packages/components/src/styles.ts b/packages/components/src/styles.ts index 58e1bed9..6b225edf 100644 --- a/packages/components/src/styles.ts +++ b/packages/components/src/styles.ts @@ -23,7 +23,6 @@ import './Grid/styles.css'; import './GridBase/styles.css'; import './HelpLinks/styles.css'; import './Hero/styles.css'; -import './Icon/styles.css'; import './Impact/styles.css'; import './Link/styles.css'; import './LinkText/styles.css'; diff --git a/packages/theme/src/icon/icons.css.ts b/packages/theme/src/icon/icons.css.ts deleted file mode 100644 index 64f0dff2..00000000 --- a/packages/theme/src/icon/icons.css.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { assignVars, styleVariants } from '@vanilla-extract/css'; -import { iconSizeVars } from '../salt'; - -export const icon = styleVariants({ - small: { - vars: assignVars(iconSizeVars, { - size: '1 !important' - }) - }, - medium: { - vars: assignVars(iconSizeVars, { - size: '2 !important' - }) - }, - large: { - vars: assignVars(iconSizeVars, { - size: '3 !important' - }) - } -}); diff --git a/packages/theme/src/icon/index.ts b/packages/theme/src/icon/index.ts index dc6364ac..838008a0 100644 --- a/packages/theme/src/icon/index.ts +++ b/packages/theme/src/icon/index.ts @@ -1,2 +1 @@ -export * from './icons.css'; export * from './icons'; diff --git a/packages/theme/src/salt/salt.css.ts b/packages/theme/src/salt/salt.css.ts index ba62878f..9bcacc68 100644 --- a/packages/theme/src/salt/salt.css.ts +++ b/packages/theme/src/salt/salt.css.ts @@ -24,22 +24,6 @@ createGlobalTheme('.saltAccordionSection', accordionVars, { } }); -export const iconSizeVars = createGlobalThemeContract({ - size: '--saltIcon-size-multiplier' -}); - -createGlobalTheme('.saltIcon', iconSizeVars, { - size: '1' -}); - -export const iconColorVars = createGlobalThemeContract({ - fill: '--saltIcon-color' -}); - -createGlobalTheme('.saltIcon', iconColorVars, { - fill: 'currentColor' -}); - const densities = [ '.salt-density-high', '.salt-density-medium',