@transferwise/components 46.105.1 → 46.105.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -69,10 +69,8 @@ const Header = /*#__PURE__*/React__default.default.forwardRef(({
69
69
  }, ref) => {
70
70
  const internalRef = React.useRef(null);
71
71
  const levelTypography = level === 'group' ? typography.Typography.TITLE_GROUP : typography.Typography.TITLE_SUBSECTION;
72
- const isLegendOrNoAction = !action || as === 'legend';
73
72
  const headerClasses = clsx.clsx('np-header', className, {
74
- 'np-header--group': level === 'group',
75
- 'np-header__title': isLegendOrNoAction
73
+ 'np-header--group': level === 'group'
76
74
  });
77
75
  const commonProps = {
78
76
  className: headerClasses,
@@ -1 +1 @@
1
- {"version":3,"file":"Header.js","sources":["../../src/header/Header.tsx"],"sourcesContent":["import { clsx } from 'clsx';\n\nimport { AriaLabelProperty, CommonProps, Heading, LinkProps, Typography } from '../common';\nimport Button from '../button';\nimport Link from '../link';\nimport Title from '../title';\nimport React, { useEffect, useRef, FunctionComponent } from 'react';\n\ntype ActionProps = AriaLabelProperty & {\n text: string;\n onClick?: (event: React.MouseEvent) => void;\n};\n\ntype ButtonActionProps = ActionProps;\ntype LinkActionProps = ActionProps & LinkProps;\n\nexport interface HeaderProps extends CommonProps {\n /**\n * Optional prop to define the action for the header. If the `href` property\n * is provided, a `Link` will be rendered instead of a `Button`.\n */\n action?: ButtonActionProps | LinkActionProps;\n\n /**\n * Option prop to specify DOM render element of the title\n *\n * - When `as=\"legend\"`, the `Header` will render as a `<legend>` element.\n * **Note:** `<legend>` elements must be the first child of a `<fieldset>` to comply with HTML semantics.\n * If this condition is not met, a warning will be logged to the console.\n *\n * - Other valid values include standard heading tags (`h1` to `h6`) or `header`.\n */\n as?: Heading | 'legend' | 'header';\n\n /** Required prop to set the title of the Header. */\n title: string;\n\n /** Optional prop to specify the level of the Header */\n level?: 'section' | 'group';\n\n className?: string;\n testId?: string;\n}\n\n/**\n * Renders a header action which can be either a button or a link.\n *\n * @param {Object} props - The properties object.\n * @param {ButtonActionProps | LinkActionProps} props.action - The action object which can be either a button or a link.\n * @returns {JSX.Element} The rendered header action component.\n */\nconst HeaderAction = React.forwardRef<\n HTMLButtonElement | HTMLAnchorElement,\n { action: ButtonActionProps | LinkActionProps }\n>(({ action }, ref) => {\n return (\n <Link\n className=\"np-header__action-button\"\n aria-label={action['aria-label']}\n href={'href' in action ? action.href : undefined}\n target={'target' in action ? action.target : undefined}\n onClick={action.onClick}\n >\n {action.text}\n </Link>\n );\n});\n\nHeaderAction.displayName = 'HeaderAction';\n\n/**\n * @param {ButtonActionProps | LinkActionProps} [action] - Optional prop to specify the action button or link.\n * @param {Heading | 'legend'} [as='h5'] - Optional prop to override the heading element rendered for the title.\n * @param {string} title - Required prop to set the title of the section header.\n * @param {'group' | 'section'} [level='group'] - Optional prop to specify the level of the section header.\n * @param {string} [className]\n * @param {string} [testId]\n *\n * @see {@link Header } for further information.\n * @see {@link https://storybook.wise.design/?path=/docs/typography-header--docs|Storybook Wise Design}\n */\nconst Header: FunctionComponent<HeaderProps> = React.forwardRef(\n (\n { as = 'h5', action, className, testId, title, level = 'group', ...props },\n ref: React.Ref<HTMLDivElement | HTMLHeadingElement | HTMLLegendElement>,\n ) => {\n const internalRef = useRef<HTMLLegendElement>(null);\n const levelTypography =\n level === 'group' ? Typography.TITLE_GROUP : Typography.TITLE_SUBSECTION;\n const isLegendOrNoAction = !action || as === 'legend';\n const headerClasses = clsx('np-header', className, {\n 'np-header--group': level === 'group',\n 'np-header__title': isLegendOrNoAction,\n });\n\n const commonProps = {\n className: headerClasses,\n 'data-testid': testId,\n };\n\n useEffect(() => {\n if (as === 'legend' && internalRef.current) {\n const { parentElement } = internalRef.current;\n if (!parentElement || parentElement.tagName.toLowerCase() !== 'fieldset') {\n console.warn(\n 'Legends should be the first child in a fieldset, and this is not possible when including an action',\n );\n }\n }\n }, [as]);\n\n if (!action) {\n return (\n <Title ref={internalRef} as={as} type={levelTypography} {...commonProps} {...props}>\n {title}\n </Title>\n );\n }\n\n return (\n <div {...commonProps} {...props} ref={ref as React.Ref<HTMLDivElement>}>\n <Title as={as} type={levelTypography} className=\"np-header__title\">\n {title}\n </Title>\n <HeaderAction action={action} />\n </div>\n );\n },\n);\n\nHeader.displayName = 'Header';\n\nexport default Header;\n"],"names":["HeaderAction","React","forwardRef","action","ref","_jsx","Link","className","href","undefined","target","onClick","children","text","displayName","Header","as","testId","title","level","props","internalRef","useRef","levelTypography","Typography","TITLE_GROUP","TITLE_SUBSECTION","isLegendOrNoAction","headerClasses","clsx","commonProps","useEffect","current","parentElement","tagName","toLowerCase","console","warn","Title","type","_jsxs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmDA,MAAMA,YAAY,gBAAGC,sBAAK,CAACC,UAAU,CAGnC,CAAC;AAAEC,EAAAA;AAAM,CAAE,EAAEC,GAAG,KAAI;EACpB,oBACEC,cAAA,CAACC,YAAI,EAAA;AACHC,IAAAA,SAAS,EAAC,0BAA0B;IACpC,YAAA,EAAYJ,MAAM,CAAC,YAAY,CAAE;IACjCK,IAAI,EAAE,MAAM,IAAIL,MAAM,GAAGA,MAAM,CAACK,IAAI,GAAGC,SAAU;IACjDC,MAAM,EAAE,QAAQ,IAAIP,MAAM,GAAGA,MAAM,CAACO,MAAM,GAAGD,SAAU;IACvDE,OAAO,EAAER,MAAM,CAACQ,OAAQ;IAAAC,QAAA,EAEvBT,MAAM,CAACU;AAAI,GACR,CAAC;AAEX,CAAC,CAAC;AAEFb,YAAY,CAACc,WAAW,GAAG,cAAc;AAEzC;;;;;;;;;;AAUG;AACH,MAAMC,MAAM,gBAAmCd,sBAAK,CAACC,UAAU,CAC7D,CACE;AAAEc,EAAAA,EAAE,GAAG,IAAI;EAAEb,MAAM;EAAEI,SAAS;EAAEU,MAAM;EAAEC,KAAK;AAAEC,EAAAA,KAAK,GAAG,OAAO;EAAE,GAAGC;AAAK,CAAE,EAC1EhB,GAA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A,IAAA,GAAMV,KAAK;AAAEhB,IAAAA,GAAG,EAAEA,GAAiC;IAAAQ,QAAA,EAAA,cACrEP,cAAA,CAACiC,aAAK,EAAA;AAACtB,MAAAA,EAAE,EAAEA,EAAG;AAACuB,MAAAA,IAAI,EAAEhB,eAAgB;AAAChB,MAAAA,SAAS,EAAC,kBAAkB;AAAAK,MAAAA,QAAA,EAC/DM;AAAK,KACD,CACP,eAAAb,cAAA,CAACL,YAAY,EAAA;AAACG,MAAAA,MAAM,EAAEA;AAAO,KAAA,CAC/B;AAAA,GAAK,CAAC;AAEV,CAAC;AAGHY,MAAM,CAACD,WAAW,GAAG,QAAQ;;;;"}
1
+ {"version":3,"file":"Header.js","sources":["../../src/header/Header.tsx"],"sourcesContent":["import { clsx } from 'clsx';\n\nimport { AriaLabelProperty, CommonProps, Heading, LinkProps, Typography } from '../common';\nimport Link from '../link';\nimport Title from '../title';\nimport React, { useEffect, useRef, FunctionComponent } from 'react';\n\ntype ActionProps = AriaLabelProperty & {\n text: string;\n onClick?: (event: React.MouseEvent) => void;\n};\n\ntype ButtonActionProps = ActionProps;\ntype LinkActionProps = ActionProps & LinkProps;\n\nexport interface HeaderProps extends CommonProps {\n /**\n * Optional prop to define the action for the header. If the `href` property\n * is provided, a `Link` will be rendered instead of a `Button`.\n */\n action?: ButtonActionProps | LinkActionProps;\n\n /**\n * Option prop to specify DOM render element of the title\n *\n * - When `as=\"legend\"`, the `Header` will render as a `<legend>` element.\n * **Note:** `<legend>` elements must be the first child of a `<fieldset>` to comply with HTML semantics.\n * If this condition is not met, a warning will be logged to the console.\n *\n * - Other valid values include standard heading tags (`h1` to `h6`) or `header`.\n */\n as?: Heading | 'legend' | 'header';\n\n /** Required prop to set the title of the Header. */\n title: string;\n\n /** Optional prop to specify the level of the Header */\n level?: 'section' | 'group';\n\n className?: string;\n testId?: string;\n}\n\n/**\n * Renders a header action which can be either a button or a link.\n *\n * @param {Object} props - The properties object.\n * @param {ButtonActionProps | LinkActionProps} props.action - The action object which can be either a button or a link.\n * @returns {JSX.Element} The rendered header action component.\n */\nconst HeaderAction = React.forwardRef<\n HTMLButtonElement | HTMLAnchorElement,\n { action: ButtonActionProps | LinkActionProps }\n>(({ action }, ref) => {\n return (\n <Link\n className=\"np-header__action-button\"\n aria-label={action['aria-label']}\n href={'href' in action ? action.href : undefined}\n target={'target' in action ? action.target : undefined}\n onClick={action.onClick}\n >\n {action.text}\n </Link>\n );\n});\n\nHeaderAction.displayName = 'HeaderAction';\n\n/**\n * @param {ButtonActionProps | LinkActionProps} [action] - Optional prop to specify the action button or link.\n * @param {Heading | 'legend'} [as='h5'] - Optional prop to override the heading element rendered for the title.\n * @param {string} title - Required prop to set the title of the section header.\n * @param {'group' | 'section'} [level='group'] - Optional prop to specify the level of the section header.\n * @param {string} [className]\n * @param {string} [testId]\n *\n * @see {@link Header } for further information.\n * @see {@link https://storybook.wise.design/?path=/docs/typography-header--docs|Storybook Wise Design}\n */\nconst Header: FunctionComponent<HeaderProps> = React.forwardRef(\n (\n { as = 'h5', action, className, testId, title, level = 'group', ...props },\n ref: React.Ref<HTMLDivElement | HTMLHeadingElement | HTMLLegendElement>,\n ) => {\n const internalRef = useRef<HTMLLegendElement>(null);\n const levelTypography =\n level === 'group' ? Typography.TITLE_GROUP : Typography.TITLE_SUBSECTION;\n const headerClasses = clsx('np-header', className, {\n 'np-header--group': level === 'group',\n });\n\n const commonProps = {\n className: headerClasses,\n 'data-testid': testId,\n };\n\n useEffect(() => {\n if (as === 'legend' && internalRef.current) {\n const { parentElement } = internalRef.current;\n if (!parentElement || parentElement.tagName.toLowerCase() !== 'fieldset') {\n console.warn(\n 'Legends should be the first child in a fieldset, and this is not possible when including an action',\n );\n }\n }\n }, [as]);\n\n if (!action) {\n return (\n <Title ref={internalRef} as={as} type={levelTypography} {...commonProps} {...props}>\n {title}\n </Title>\n );\n }\n\n return (\n <div {...commonProps} {...props} ref={ref as React.Ref<HTMLDivElement>}>\n <Title as={as} type={levelTypography} className=\"np-header__title\">\n {title}\n </Title>\n <HeaderAction action={action} />\n </div>\n );\n },\n);\n\nHeader.displayName = 'Header';\n\nexport default Header;\n"],"names":["HeaderAction","React","forwardRef","action","ref","_jsx","Link","className","href","undefined","target","onClick","children","text","displayName","Header","as","testId","title","level","props","internalRef","useRef","levelTypography","Typography","TITLE_GROUP","TITLE_SUBSECTION","headerClasses","clsx","commonProps","useEffect","current","parentElement","tagName","toLowerCase","console","warn","Title","type","_jsxs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkDA,MAAMA,YAAY,gBAAGC,sBAAK,CAACC,UAAU,CAGnC,CAAC;AAAEC,EAAAA;AAAM,CAAE,EAAEC,GAAG,KAAI;EACpB,oBACEC,cAAA,CAACC,YAAI,EAAA;AACHC,IAAAA,SAAS,EAAC,0BAA0B;IACpC,YAAA,EAAYJ,MAAM,CAAC,YAAY,CAAE;IACjCK,IAAI,EAAE,MAAM,IAAIL,MAAM,GAAGA,MAAM,CAACK,IAAI,GAAGC,SAAU;IACjDC,MAAM,EAAE,QAAQ,IAAIP,MAAM,GAAGA,MAAM,CAACO,MAAM,GAAGD,SAAU;IACvDE,OAAO,EAAER,MAAM,CAACQ,OAAQ;IAAAC,QAAA,EAEvBT,MAAM,CAACU;AAAI,GACR,CAAC;AAEX,CAAC,CAAC;AAEFb,YAAY,CAACc,WAAW,GAAG,cAAc;AAEzC;;;;;;;;;;AAUG;AACH,MAAMC,MAAM,gBAAmCd,sBAAK,CAACC,UAAU,CAC7D,CACE;AAAEc,EAAAA,EAAE,GAAG,IAAI;EAAEb,MAAM;EAAEI,SAAS;EAAEU,MAAM;EAAEC,KAAK;AAAEC,EAAAA,KAAK,GAAG,OAAO;EAAE,GAAGC;AAAK,CAAE,EAC1EhB,GAAuE,KACrE;AACF,EAAA,MAAMiB,WAAW,GAAGC,YAAM,CAAoB,IAAI,CAAC;AACnD,EAAA,MAAMC,eAAe,GACnBJ,KAAK,KAAK,OAAO,GAAGK,qBA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;AAAK,KACD,CACP,eAAAb,cAAA,CAACL,YAAY,EAAA;AAACG,MAAAA,MAAM,EAAEA;AAAO,KAAA,CAC/B;AAAA,GAAK,CAAC;AAEV,CAAC;AAGHY,MAAM,CAACD,WAAW,GAAG,QAAQ;;;;"}
@@ -61,10 +61,8 @@ const Header = /*#__PURE__*/React__default.forwardRef(({
61
61
  }, ref) => {
62
62
  const internalRef = useRef(null);
63
63
  const levelTypography = level === 'group' ? Typography.TITLE_GROUP : Typography.TITLE_SUBSECTION;
64
- const isLegendOrNoAction = !action || as === 'legend';
65
64
  const headerClasses = clsx('np-header', className, {
66
- 'np-header--group': level === 'group',
67
- 'np-header__title': isLegendOrNoAction
65
+ 'np-header--group': level === 'group'
68
66
  });
69
67
  const commonProps = {
70
68
  className: headerClasses,
@@ -1 +1 @@
1
- {"version":3,"file":"Header.mjs","sources":["../../src/header/Header.tsx"],"sourcesContent":["import { clsx } from 'clsx';\n\nimport { AriaLabelProperty, CommonProps, Heading, LinkProps, Typography } from '../common';\nimport Button from '../button';\nimport Link from '../link';\nimport Title from '../title';\nimport React, { useEffect, useRef, FunctionComponent } from 'react';\n\ntype ActionProps = AriaLabelProperty & {\n text: string;\n onClick?: (event: React.MouseEvent) => void;\n};\n\ntype ButtonActionProps = ActionProps;\ntype LinkActionProps = ActionProps & LinkProps;\n\nexport interface HeaderProps extends CommonProps {\n /**\n * Optional prop to define the action for the header. If the `href` property\n * is provided, a `Link` will be rendered instead of a `Button`.\n */\n action?: ButtonActionProps | LinkActionProps;\n\n /**\n * Option prop to specify DOM render element of the title\n *\n * - When `as=\"legend\"`, the `Header` will render as a `<legend>` element.\n * **Note:** `<legend>` elements must be the first child of a `<fieldset>` to comply with HTML semantics.\n * If this condition is not met, a warning will be logged to the console.\n *\n * - Other valid values include standard heading tags (`h1` to `h6`) or `header`.\n */\n as?: Heading | 'legend' | 'header';\n\n /** Required prop to set the title of the Header. */\n title: string;\n\n /** Optional prop to specify the level of the Header */\n level?: 'section' | 'group';\n\n className?: string;\n testId?: string;\n}\n\n/**\n * Renders a header action which can be either a button or a link.\n *\n * @param {Object} props - The properties object.\n * @param {ButtonActionProps | LinkActionProps} props.action - The action object which can be either a button or a link.\n * @returns {JSX.Element} The rendered header action component.\n */\nconst HeaderAction = React.forwardRef<\n HTMLButtonElement | HTMLAnchorElement,\n { action: ButtonActionProps | LinkActionProps }\n>(({ action }, ref) => {\n return (\n <Link\n className=\"np-header__action-button\"\n aria-label={action['aria-label']}\n href={'href' in action ? action.href : undefined}\n target={'target' in action ? action.target : undefined}\n onClick={action.onClick}\n >\n {action.text}\n </Link>\n );\n});\n\nHeaderAction.displayName = 'HeaderAction';\n\n/**\n * @param {ButtonActionProps | LinkActionProps} [action] - Optional prop to specify the action button or link.\n * @param {Heading | 'legend'} [as='h5'] - Optional prop to override the heading element rendered for the title.\n * @param {string} title - Required prop to set the title of the section header.\n * @param {'group' | 'section'} [level='group'] - Optional prop to specify the level of the section header.\n * @param {string} [className]\n * @param {string} [testId]\n *\n * @see {@link Header } for further information.\n * @see {@link https://storybook.wise.design/?path=/docs/typography-header--docs|Storybook Wise Design}\n */\nconst Header: FunctionComponent<HeaderProps> = React.forwardRef(\n (\n { as = 'h5', action, className, testId, title, level = 'group', ...props },\n ref: React.Ref<HTMLDivElement | HTMLHeadingElement | HTMLLegendElement>,\n ) => {\n const internalRef = useRef<HTMLLegendElement>(null);\n const levelTypography =\n level === 'group' ? Typography.TITLE_GROUP : Typography.TITLE_SUBSECTION;\n const isLegendOrNoAction = !action || as === 'legend';\n const headerClasses = clsx('np-header', className, {\n 'np-header--group': level === 'group',\n 'np-header__title': isLegendOrNoAction,\n });\n\n const commonProps = {\n className: headerClasses,\n 'data-testid': testId,\n };\n\n useEffect(() => {\n if (as === 'legend' && internalRef.current) {\n const { parentElement } = internalRef.current;\n if (!parentElement || parentElement.tagName.toLowerCase() !== 'fieldset') {\n console.warn(\n 'Legends should be the first child in a fieldset, and this is not possible when including an action',\n );\n }\n }\n }, [as]);\n\n if (!action) {\n return (\n <Title ref={internalRef} as={as} type={levelTypography} {...commonProps} {...props}>\n {title}\n </Title>\n );\n }\n\n return (\n <div {...commonProps} {...props} ref={ref as React.Ref<HTMLDivElement>}>\n <Title as={as} type={levelTypography} className=\"np-header__title\">\n {title}\n </Title>\n <HeaderAction action={action} />\n </div>\n );\n },\n);\n\nHeader.displayName = 'Header';\n\nexport default Header;\n"],"names":["HeaderAction","React","forwardRef","action","ref","_jsx","Link","className","href","undefined","target","onClick","children","text","displayName","Header","as","testId","title","level","props","internalRef","useRef","levelTypography","Typography","TITLE_GROUP","TITLE_SUBSECTION","isLegendOrNoAction","headerClasses","clsx","commonProps","useEffect","current","parentElement","tagName","toLowerCase","console","warn","Title","type","_jsxs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmDA,MAAMA,YAAY,gBAAGC,cAAK,CAACC,UAAU,CAGnC,CAAC;AAAEC,EAAAA;AAAM,CAAE,EAAEC,GAAG,KAAI;EACpB,oBACEC,GAAA,CAACC,IAAI,EAAA;AACHC,IAAAA,SAAS,EAAC,0BAA0B;IACpC,YAAA,EAAYJ,MAAM,CAAC,YAAY,CAAE;IACjCK,IAAI,EAAE,MAAM,IAAIL,MAAM,GAAGA,MAAM,CAACK,IAAI,GAAGC,SAAU;IACjDC,MAAM,EAAE,QAAQ,IAAIP,MAAM,GAAGA,MAAM,CAACO,MAAM,GAAGD,SAAU;IACvDE,OAAO,EAAER,MAAM,CAACQ,OAAQ;IAAAC,QAAA,EAEvBT,MAAM,CAACU;AAAI,GACR,CAAC;AAEX,CAAC,CAAC;AAEFb,YAAY,CAACc,WAAW,GAAG,cAAc;AAEzC;;;;;;;;;;AAUG;AACH,MAAMC,MAAM,gBAAmCd,cAAK,CAACC,UAAU,CAC7D,CACE;AAAEc,EAAAA,EAAE,GAAG,IAAI;EAAEb,MAAM;EAAEI,SAAS;EAAEU,MAAM;EAAEC,KAAK;AAAEC,EAAAA,KAAK,GAAG,OAAO;EAAE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AA;AAAA,IAAA,GAASV,WAAW;AAAA,IAAA,GAAMV,KAAK;AAAEhB,IAAAA,GAAG,EAAEA,GAAiC;IAAAQ,QAAA,EAAA,cACrEP,GAAA,CAACiC,KAAK,EAAA;AAACtB,MAAAA,EAAE,EAAEA,EAAG;AAACuB,MAAAA,IAAI,EAAEhB,eAAgB;AAAChB,MAAAA,SAAS,EAAC,kBAAkB;AAAAK,MAAAA,QAAA,EAC/DM;AAAK,KACD,CACP,eAAAb,GAAA,CAACL,YAAY,EAAA;AAACG,MAAAA,MAAM,EAAEA;AAAO,KAAA,CAC/B;AAAA,GAAK,CAAC;AAEV,CAAC;AAGHY,MAAM,CAACD,WAAW,GAAG,QAAQ;;;;"}
1
+ {"version":3,"file":"Header.mjs","sources":["../../src/header/Header.tsx"],"sourcesContent":["import { clsx } from 'clsx';\n\nimport { AriaLabelProperty, CommonProps, Heading, LinkProps, Typography } from '../common';\nimport Link from '../link';\nimport Title from '../title';\nimport React, { useEffect, useRef, FunctionComponent } from 'react';\n\ntype ActionProps = AriaLabelProperty & {\n text: string;\n onClick?: (event: React.MouseEvent) => void;\n};\n\ntype ButtonActionProps = ActionProps;\ntype LinkActionProps = ActionProps & LinkProps;\n\nexport interface HeaderProps extends CommonProps {\n /**\n * Optional prop to define the action for the header. If the `href` property\n * is provided, a `Link` will be rendered instead of a `Button`.\n */\n action?: ButtonActionProps | LinkActionProps;\n\n /**\n * Option prop to specify DOM render element of the title\n *\n * - When `as=\"legend\"`, the `Header` will render as a `<legend>` element.\n * **Note:** `<legend>` elements must be the first child of a `<fieldset>` to comply with HTML semantics.\n * If this condition is not met, a warning will be logged to the console.\n *\n * - Other valid values include standard heading tags (`h1` to `h6`) or `header`.\n */\n as?: Heading | 'legend' | 'header';\n\n /** Required prop to set the title of the Header. */\n title: string;\n\n /** Optional prop to specify the level of the Header */\n level?: 'section' | 'group';\n\n className?: string;\n testId?: string;\n}\n\n/**\n * Renders a header action which can be either a button or a link.\n *\n * @param {Object} props - The properties object.\n * @param {ButtonActionProps | LinkActionProps} props.action - The action object which can be either a button or a link.\n * @returns {JSX.Element} The rendered header action component.\n */\nconst HeaderAction = React.forwardRef<\n HTMLButtonElement | HTMLAnchorElement,\n { action: ButtonActionProps | LinkActionProps }\n>(({ action }, ref) => {\n return (\n <Link\n className=\"np-header__action-button\"\n aria-label={action['aria-label']}\n href={'href' in action ? action.href : undefined}\n target={'target' in action ? action.target : undefined}\n onClick={action.onClick}\n >\n {action.text}\n </Link>\n );\n});\n\nHeaderAction.displayName = 'HeaderAction';\n\n/**\n * @param {ButtonActionProps | LinkActionProps} [action] - Optional prop to specify the action button or link.\n * @param {Heading | 'legend'} [as='h5'] - Optional prop to override the heading element rendered for the title.\n * @param {string} title - Required prop to set the title of the section header.\n * @param {'group' | 'section'} [level='group'] - Optional prop to specify the level of the section header.\n * @param {string} [className]\n * @param {string} [testId]\n *\n * @see {@link Header } for further information.\n * @see {@link https://storybook.wise.design/?path=/docs/typography-header--docs|Storybook Wise Design}\n */\nconst Header: FunctionComponent<HeaderProps> = React.forwardRef(\n (\n { as = 'h5', action, className, testId, title, level = 'group', ...props },\n ref: React.Ref<HTMLDivElement | HTMLHeadingElement | HTMLLegendElement>,\n ) => {\n const internalRef = useRef<HTMLLegendElement>(null);\n const levelTypography =\n level === 'group' ? Typography.TITLE_GROUP : Typography.TITLE_SUBSECTION;\n const headerClasses = clsx('np-header', className, {\n 'np-header--group': level === 'group',\n });\n\n const commonProps = {\n className: headerClasses,\n 'data-testid': testId,\n };\n\n useEffect(() => {\n if (as === 'legend' && internalRef.current) {\n const { parentElement } = internalRef.current;\n if (!parentElement || parentElement.tagName.toLowerCase() !== 'fieldset') {\n console.warn(\n 'Legends should be the first child in a fieldset, and this is not possible when including an action',\n );\n }\n }\n }, [as]);\n\n if (!action) {\n return (\n <Title ref={internalRef} as={as} type={levelTypography} {...commonProps} {...props}>\n {title}\n </Title>\n );\n }\n\n return (\n <div {...commonProps} {...props} ref={ref as React.Ref<HTMLDivElement>}>\n <Title as={as} type={levelTypography} className=\"np-header__title\">\n {title}\n </Title>\n <HeaderAction action={action} />\n </div>\n );\n },\n);\n\nHeader.displayName = 'Header';\n\nexport default Header;\n"],"names":["HeaderAction","React","forwardRef","action","ref","_jsx","Link","className","href","undefined","target","onClick","children","text","displayName","Header","as","testId","title","level","props","internalRef","useRef","levelTypography","Typography","TITLE_GROUP","TITLE_SUBSECTION","headerClasses","clsx","commonProps","useEffect","current","parentElement","tagName","toLowerCase","console","warn","Title","type","_jsxs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkDA,MAAMA,YAAY,gBAAGC,cAAK,CAACC,UAAU,CAGnC,CAAC;AAAEC,EAAAA;AAAM,CAAE,EAAEC,GAAG,KAAI;EACpB,oBACEC,GAAA,CAACC,IAAI,EAAA;AACHC,IAAAA,SAAS,EAAC,0BAA0B;IACpC,YAAA,EAAYJ,MAAM,CAAC,YAAY,CAAE;IACjCK,IAAI,EAAE,MAAM,IAAIL,MAAM,GAAGA,MAAM,CAACK,IAAI,GAAGC,SAAU;IACjDC,MAAM,EAAE,QAAQ,IAAIP,MAAM,GAAGA,MAAM,CAACO,MAAM,GAAGD,SAAU;IACvDE,OAAO,EAAER,MAAM,CAACQ,OAAQ;IAAAC,QAAA,EAEvBT,MAAM,CAACU;AAAI,GACR,CAAC;AAEX,CAAC,CAAC;AAEFb,YAAY,CAACc,WAAW,GAAG,cAAc;AAEzC;;;;;;;;;;AAUG;AACH,MAAMC,MAAM,gBAAmCd,cAAK,CAACC,UAAU,CAC7D,CACE;AAAEc,EAAAA,EAAE,GAAG,IAAI;EAAEb,MAAM;EAAEI,SAAS;EAAEU,MAAM;EAAEC,KAAK;AAAEC,EAAAA,KAAK,GAAG,OAAO;EAAE,GAAGC;AAAK,CAAE,EAC1EhB,GAAuE,KACrE;AACF,EAAA,MAAMiB,WAAW,GAAGC,MAAM,CAAoB,IAAI,CAAC;AACnD,EAAA,MAAMC,eAAe,GACnBJ,KAAK,K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AAAA,QAAA,EAC/DM;AAAK,KACD,CACP,eAAAb,GAAA,CAACL,YAAY,EAAA;AAACG,MAAAA,MAAM,EAAEA;AAAO,KAAA,CAC/B;AAAA,GAAK,CAAC;AAEV,CAAC;AAGHY,MAAM,CAACD,WAAW,GAAG,QAAQ;;;;"}
@@ -45,6 +45,7 @@
45
45
  "neptune.Upload.csFailureText": "Unggahan gagal. Silakan coba lagi",
46
46
  "neptune.Upload.csSuccessText": "Pengunggahan selesai!",
47
47
  "neptune.Upload.csTooLargeMessage": "Harap berikan file yang lebih kecil dari {maxSize} MB",
48
+ "neptune.Upload.csTooLargeNoLimitMessage": "Harap berikan file yang lebih kecil",
48
49
  "neptune.Upload.csWrongTypeMessage": "Tipe file ini tidak didukung. Mohon coba lagi dengan file yang berbeda",
49
50
  "neptune.Upload.psButtonText": "Batalkan",
50
51
  "neptune.Upload.psProcessingText": "Mengunggah...",
@@ -52,6 +53,7 @@
52
53
  "neptune.Upload.usButtonText": "Atau pilih file",
53
54
  "neptune.Upload.usDropMessage": "Letakkan file untuk mulai mengunggah",
54
55
  "neptune.Upload.usPlaceholder": "Seret dan lepas file yang kurang dari {maxSize} MB",
56
+ "neptune.Upload.usPlaceholderNoLimit": "Seret dan lepaskan file",
55
57
  "neptune.UploadButton.allFileTypes": "Semua jenis file",
56
58
  "neptune.UploadButton.dropFiles": "Lepaskan file untuk mulai mengunggah",
57
59
  "neptune.UploadButton.instructions": "{fileTypes}, kurang dari {size}MB",
@@ -49,6 +49,7 @@ var id = {
49
49
  "neptune.Upload.csFailureText": "Unggahan gagal. Silakan coba lagi",
50
50
  "neptune.Upload.csSuccessText": "Pengunggahan selesai!",
51
51
  "neptune.Upload.csTooLargeMessage": "Harap berikan file yang lebih kecil dari {maxSize} MB",
52
+ "neptune.Upload.csTooLargeNoLimitMessage": "Harap berikan file yang lebih kecil",
52
53
  "neptune.Upload.csWrongTypeMessage": "Tipe file ini tidak didukung. Mohon coba lagi dengan file yang berbeda",
53
54
  "neptune.Upload.psButtonText": "Batalkan",
54
55
  "neptune.Upload.psProcessingText": "Mengunggah...",
@@ -56,6 +57,7 @@ var id = {
56
57
  "neptune.Upload.usButtonText": "Atau pilih file",
57
58
  "neptune.Upload.usDropMessage": "Letakkan file untuk mulai mengunggah",
58
59
  "neptune.Upload.usPlaceholder": "Seret dan lepas file yang kurang dari {maxSize} MB",
60
+ "neptune.Upload.usPlaceholderNoLimit": "Seret dan lepaskan file",
59
61
  "neptune.UploadButton.allFileTypes": "Semua jenis file",
60
62
  "neptune.UploadButton.dropFiles": "Lepaskan file untuk mulai mengunggah",
61
63
  "neptune.UploadButton.instructions": "{fileTypes}, kurang dari {size}MB",
@@ -1 +1 @@
1
- {"version":3,"file":"id.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"id.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -45,6 +45,7 @@ var id = {
45
45
  "neptune.Upload.csFailureText": "Unggahan gagal. Silakan coba lagi",
46
46
  "neptune.Upload.csSuccessText": "Pengunggahan selesai!",
47
47
  "neptune.Upload.csTooLargeMessage": "Harap berikan file yang lebih kecil dari {maxSize} MB",
48
+ "neptune.Upload.csTooLargeNoLimitMessage": "Harap berikan file yang lebih kecil",
48
49
  "neptune.Upload.csWrongTypeMessage": "Tipe file ini tidak didukung. Mohon coba lagi dengan file yang berbeda",
49
50
  "neptune.Upload.psButtonText": "Batalkan",
50
51
  "neptune.Upload.psProcessingText": "Mengunggah...",
@@ -52,6 +53,7 @@ var id = {
52
53
  "neptune.Upload.usButtonText": "Atau pilih file",
53
54
  "neptune.Upload.usDropMessage": "Letakkan file untuk mulai mengunggah",
54
55
  "neptune.Upload.usPlaceholder": "Seret dan lepas file yang kurang dari {maxSize} MB",
56
+ "neptune.Upload.usPlaceholderNoLimit": "Seret dan lepaskan file",
55
57
  "neptune.UploadButton.allFileTypes": "Semua jenis file",
56
58
  "neptune.UploadButton.dropFiles": "Lepaskan file untuk mulai mengunggah",
57
59
  "neptune.UploadButton.instructions": "{fileTypes}, kurang dari {size}MB",
@@ -1 +1 @@
1
- {"version":3,"file":"id.json.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"id.json.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -45,6 +45,7 @@
45
45
  "neptune.Upload.csFailureText": "Uploaden mislukt. Probeer het opnieuw",
46
46
  "neptune.Upload.csSuccessText": "Uploaden voltooid!",
47
47
  "neptune.Upload.csTooLargeMessage": "Upload een bestand kleiner dan {maxSize} MB",
48
+ "neptune.Upload.csTooLargeNoLimitMessage": "Verstrek een kleiner bestand",
48
49
  "neptune.Upload.csWrongTypeMessage": "Het bestandstype wordt niet ondersteund. Probeer het opnieuw met een ander bestand",
49
50
  "neptune.Upload.psButtonText": "Annuleren",
50
51
  "neptune.Upload.psProcessingText": "Uploaden...",
@@ -52,6 +53,7 @@
52
53
  "neptune.Upload.usButtonText": "Of selecteer een bestand",
53
54
  "neptune.Upload.usDropMessage": "Sleep het bestand hierheen om het te uploaden",
54
55
  "neptune.Upload.usPlaceholder": "Sleep een bestand van maximaal {maxSize} MB",
56
+ "neptune.Upload.usPlaceholderNoLimit": "Sleep een bestand hierheen",
55
57
  "neptune.UploadButton.allFileTypes": "Alle bestandstypen",
56
58
  "neptune.UploadButton.dropFiles": "Sleep het bestand hierheen om het te uploaden",
57
59
  "neptune.UploadButton.instructions": "{fileTypes}, kleiner dan {size} MB",
@@ -49,6 +49,7 @@ var nl = {
49
49
  "neptune.Upload.csFailureText": "Uploaden mislukt. Probeer het opnieuw",
50
50
  "neptune.Upload.csSuccessText": "Uploaden voltooid!",
51
51
  "neptune.Upload.csTooLargeMessage": "Upload een bestand kleiner dan {maxSize} MB",
52
+ "neptune.Upload.csTooLargeNoLimitMessage": "Verstrek een kleiner bestand",
52
53
  "neptune.Upload.csWrongTypeMessage": "Het bestandstype wordt niet ondersteund. Probeer het opnieuw met een ander bestand",
53
54
  "neptune.Upload.psButtonText": "Annuleren",
54
55
  "neptune.Upload.psProcessingText": "Uploaden...",
@@ -56,6 +57,7 @@ var nl = {
56
57
  "neptune.Upload.usButtonText": "Of selecteer een bestand",
57
58
  "neptune.Upload.usDropMessage": "Sleep het bestand hierheen om het te uploaden",
58
59
  "neptune.Upload.usPlaceholder": "Sleep een bestand van maximaal {maxSize} MB",
60
+ "neptune.Upload.usPlaceholderNoLimit": "Sleep een bestand hierheen",
59
61
  "neptune.UploadButton.allFileTypes": "Alle bestandstypen",
60
62
  "neptune.UploadButton.dropFiles": "Sleep het bestand hierheen om het te uploaden",
61
63
  "neptune.UploadButton.instructions": "{fileTypes}, kleiner dan {size} MB",
@@ -1 +1 @@
1
- {"version":3,"file":"nl.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"nl.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -45,6 +45,7 @@ var nl = {
45
45
  "neptune.Upload.csFailureText": "Uploaden mislukt. Probeer het opnieuw",
46
46
  "neptune.Upload.csSuccessText": "Uploaden voltooid!",
47
47
  "neptune.Upload.csTooLargeMessage": "Upload een bestand kleiner dan {maxSize} MB",
48
+ "neptune.Upload.csTooLargeNoLimitMessage": "Verstrek een kleiner bestand",
48
49
  "neptune.Upload.csWrongTypeMessage": "Het bestandstype wordt niet ondersteund. Probeer het opnieuw met een ander bestand",
49
50
  "neptune.Upload.psButtonText": "Annuleren",
50
51
  "neptune.Upload.psProcessingText": "Uploaden...",
@@ -52,6 +53,7 @@ var nl = {
52
53
  "neptune.Upload.usButtonText": "Of selecteer een bestand",
53
54
  "neptune.Upload.usDropMessage": "Sleep het bestand hierheen om het te uploaden",
54
55
  "neptune.Upload.usPlaceholder": "Sleep een bestand van maximaal {maxSize} MB",
56
+ "neptune.Upload.usPlaceholderNoLimit": "Sleep een bestand hierheen",
55
57
  "neptune.UploadButton.allFileTypes": "Alle bestandstypen",
56
58
  "neptune.UploadButton.dropFiles": "Sleep het bestand hierheen om het te uploaden",
57
59
  "neptune.UploadButton.instructions": "{fileTypes}, kleiner dan {size} MB",
@@ -1 +1 @@
1
- {"version":3,"file":"nl.json.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"nl.json.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/build/main.css CHANGED
@@ -2454,10 +2454,10 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
2454
2454
  border-bottom: 1px solid rgba(0,0,0,0.10196);
2455
2455
  border-bottom: 1px solid var(--color-border-neutral);
2456
2456
  }
2457
- .np-header__title {
2457
+ .np-header--group,
2458
+ .np-header--group .np-header__title {
2458
2459
  color: #5d7079;
2459
2460
  color: var(--color-content-secondary);
2460
- margin: 0;
2461
2461
  }
2462
2462
  .np-header__action {
2463
2463
  margin: 0;
@@ -3166,8 +3166,6 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
3166
3166
  width: 100%;
3167
3167
  border-radius: 16px;
3168
3168
  border-radius: var(--radius-medium);
3169
- background-color: #ffffff;
3170
- background-color: var(--color-background-screen);
3171
3169
  position: relative;
3172
3170
  padding: 12px 0;
3173
3171
  padding: var(--size-12) 0;
@@ -3228,12 +3226,6 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
3228
3226
  outline-offset: var(--ring-outline-offset);
3229
3227
  outline-offset: -1px;
3230
3228
  }
3231
- .wds-list-item-interactive.wds-list-item-spotlight:not(.disabled):not(:disabled):hover {
3232
- background-color: var(--color-background-screen-hover);
3233
- }
3234
- .wds-list-item-interactive.wds-list-item-spotlight:not(.disabled):not(:disabled):active {
3235
- background-color: var(--color-background-screen-active);
3236
- }
3237
3229
  .wds-list-item-interactive.wds-list-item-spotlight:has(.wds-list-item-prompt:hover a, .wds-list-item-prompt:hover button):hover {
3238
3230
  background-color: transparent;
3239
3231
  background-color: initial;
@@ -3374,10 +3366,10 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
3374
3366
  }
3375
3367
  }
3376
3368
  .wds-list-item-spotlight-inactive:not(.disabled):not(:disabled):hover {
3377
- background-color: color-mix(in srgb, var(--color-background-neutral-hover) 25%, transparent);
3369
+ background-color: color-mix(in srgb, var(--color-background-neutral-hover) 35%, transparent);
3378
3370
  }
3379
3371
  .wds-list-item-spotlight-inactive:not(.disabled):not(:disabled):active {
3380
- background-color: color-mix(in srgb, var(--color-background-neutral-active) 25%, transparent);
3372
+ background-color: color-mix(in srgb, var(--color-background-neutral-active) 45%, transparent);
3381
3373
  }
3382
3374
  .wds-list-item .wds-list-item-spotlight__border {
3383
3375
  position: absolute;
@@ -20,10 +20,10 @@
20
20
  border-bottom: 1px solid rgba(0,0,0,0.10196);
21
21
  border-bottom: 1px solid var(--color-border-neutral);
22
22
  }
23
- .np-header__title {
23
+ .np-header--group,
24
+ .np-header--group .np-header__title {
24
25
  color: #5d7079;
25
26
  color: var(--color-content-secondary);
26
- margin: 0;
27
27
  }
28
28
  .np-header__action {
29
29
  margin: 0;
@@ -522,8 +522,6 @@
522
522
  width: 100%;
523
523
  border-radius: 16px;
524
524
  border-radius: var(--radius-medium);
525
- background-color: #ffffff;
526
- background-color: var(--color-background-screen);
527
525
  position: relative;
528
526
  padding: 12px 0;
529
527
  padding: var(--size-12) 0;
@@ -584,12 +582,6 @@
584
582
  outline-offset: var(--ring-outline-offset);
585
583
  outline-offset: -1px;
586
584
  }
587
- .wds-list-item-interactive.wds-list-item-spotlight:not(.disabled):not(:disabled):hover {
588
- background-color: var(--color-background-screen-hover);
589
- }
590
- .wds-list-item-interactive.wds-list-item-spotlight:not(.disabled):not(:disabled):active {
591
- background-color: var(--color-background-screen-active);
592
- }
593
585
  .wds-list-item-interactive.wds-list-item-spotlight:has(.wds-list-item-prompt:hover a, .wds-list-item-prompt:hover button):hover {
594
586
  background-color: transparent;
595
587
  background-color: initial;
@@ -730,10 +722,10 @@
730
722
  }
731
723
  }
732
724
  .wds-list-item-spotlight-inactive:not(.disabled):not(:disabled):hover {
733
- background-color: color-mix(in srgb, var(--color-background-neutral-hover) 25%, transparent);
725
+ background-color: color-mix(in srgb, var(--color-background-neutral-hover) 35%, transparent);
734
726
  }
735
727
  .wds-list-item-spotlight-inactive:not(.disabled):not(:disabled):active {
736
- background-color: color-mix(in srgb, var(--color-background-neutral-active) 25%, transparent);
728
+ background-color: color-mix(in srgb, var(--color-background-neutral-active) 45%, transparent);
737
729
  }
738
730
  .wds-list-item .wds-list-item-spotlight__border {
739
731
  position: absolute;
@@ -2454,10 +2454,10 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
2454
2454
  border-bottom: 1px solid rgba(0,0,0,0.10196);
2455
2455
  border-bottom: 1px solid var(--color-border-neutral);
2456
2456
  }
2457
- .np-header__title {
2457
+ .np-header--group,
2458
+ .np-header--group .np-header__title {
2458
2459
  color: #5d7079;
2459
2460
  color: var(--color-content-secondary);
2460
- margin: 0;
2461
2461
  }
2462
2462
  .np-header__action {
2463
2463
  margin: 0;
@@ -3166,8 +3166,6 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
3166
3166
  width: 100%;
3167
3167
  border-radius: 16px;
3168
3168
  border-radius: var(--radius-medium);
3169
- background-color: #ffffff;
3170
- background-color: var(--color-background-screen);
3171
3169
  position: relative;
3172
3170
  padding: 12px 0;
3173
3171
  padding: var(--size-12) 0;
@@ -3228,12 +3226,6 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
3228
3226
  outline-offset: var(--ring-outline-offset);
3229
3227
  outline-offset: -1px;
3230
3228
  }
3231
- .wds-list-item-interactive.wds-list-item-spotlight:not(.disabled):not(:disabled):hover {
3232
- background-color: var(--color-background-screen-hover);
3233
- }
3234
- .wds-list-item-interactive.wds-list-item-spotlight:not(.disabled):not(:disabled):active {
3235
- background-color: var(--color-background-screen-active);
3236
- }
3237
3229
  .wds-list-item-interactive.wds-list-item-spotlight:has(.wds-list-item-prompt:hover a, .wds-list-item-prompt:hover button):hover {
3238
3230
  background-color: transparent;
3239
3231
  background-color: initial;
@@ -3374,10 +3366,10 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
3374
3366
  }
3375
3367
  }
3376
3368
  .wds-list-item-spotlight-inactive:not(.disabled):not(:disabled):hover {
3377
- background-color: color-mix(in srgb, var(--color-background-neutral-hover) 25%, transparent);
3369
+ background-color: color-mix(in srgb, var(--color-background-neutral-hover) 35%, transparent);
3378
3370
  }
3379
3371
  .wds-list-item-spotlight-inactive:not(.disabled):not(:disabled):active {
3380
- background-color: color-mix(in srgb, var(--color-background-neutral-active) 25%, transparent);
3372
+ background-color: color-mix(in srgb, var(--color-background-neutral-active) 45%, transparent);
3381
3373
  }
3382
3374
  .wds-list-item .wds-list-item-spotlight__border {
3383
3375
  position: absolute;
@@ -1 +1 @@
1
- {"version":3,"file":"Header.d.ts","sourceRoot":"","sources":["../../../src/header/Header.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,OAAO,EAAE,SAAS,EAAc,MAAM,WAAW,CAAC;AAI3F,OAAO,KAAK,EAAE,EAAqB,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAEpE,KAAK,WAAW,GAAG,iBAAiB,GAAG;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;CAC7C,CAAC;AAEF,KAAK,iBAAiB,GAAG,WAAW,CAAC;AACrC,KAAK,eAAe,GAAG,WAAW,GAAG,SAAS,CAAC;AAE/C,MAAM,WAAW,WAAY,SAAQ,WAAW;IAC9C;;;OAGG;IACH,MAAM,CAAC,EAAE,iBAAiB,GAAG,eAAe,CAAC;IAE7C;;;;;;;;OAQG;IACH,EAAE,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAC;IAEnC,oDAAoD;IACpD,KAAK,EAAE,MAAM,CAAC;IAEd,uDAAuD;IACvD,KAAK,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;IAE5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AA4BD;;;;;;;;;;GAUG;AACH,QAAA,MAAM,MAAM,EAAE,iBAAiB,CAAC,WAAW,CA+C1C,CAAC;AAIF,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"Header.d.ts","sourceRoot":"","sources":["../../../src/header/Header.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,OAAO,EAAE,SAAS,EAAc,MAAM,WAAW,C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;AACH,eAAO,MAAM,eAAe,GACzB,kBAAiB,MAAM,EAAO,MAC9B,iBAAgB,MAAM,EAAO;;;;;;CAG7B,CAAC"}
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../src/listItem/_stories/helpers.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,KAAK,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,CAAC;AAErC;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,GAAI,QAAQ,KAAK,KAAG,KAuBvD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,UAAU,EAAE,SAQxB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,GACzB,kBAAiB,MAAM,EAAO,MAC9B,iBAAgB,MAAM,EAAO;;;;;;CAG7B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@transferwise/components",
3
- "version": "46.105.1",
3
+ "version": "46.105.3",
4
4
  "description": "Neptune React components",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -20,10 +20,10 @@
20
20
  border-bottom: 1px solid rgba(0,0,0,0.10196);
21
21
  border-bottom: 1px solid var(--color-border-neutral);
22
22
  }
23
- .np-header__title {
23
+ .np-header--group,
24
+ .np-header--group .np-header__title {
24
25
  color: #5d7079;
25
26
  color: var(--color-content-secondary);
26
- margin: 0;
27
27
  }
28
28
  .np-header__action {
29
29
  margin: 0;
@@ -11,11 +11,11 @@
11
11
  &--group {
12
12
  align-items: flex-end;
13
13
  border-bottom: 1px solid var(--color-border-neutral);
14
- }
15
14
 
16
- &__title {
17
- color: var(--color-content-secondary);
18
- margin: 0;
15
+ &,
16
+ .np-header__title{
17
+ color: var(--color-content-secondary);
18
+ }
19
19
  }
20
20
 
21
21
  &__action {
@@ -1,6 +1,5 @@
1
1
  import { Meta, StoryObj } from '@storybook/react-webpack5';
2
2
  import Header, { HeaderProps } from './Header';
3
- import { storyConfig } from '../test-utils';
4
3
 
5
4
  const withContainer = (Story: any) => (
6
5
  <div style={{ display: 'flex', justifyContent: 'center' }}>
@@ -28,41 +27,6 @@ const renderHeader = (args: HeaderProps) => {
28
27
  return <Header {...args} />;
29
28
  };
30
29
 
31
- /**
32
- * Helper to generate variants for `AllVariants` story.
33
- */
34
- const renderVariants = () => (
35
- <div
36
- className="header-variants"
37
- style={{ display: 'flex', flexWrap: 'wrap', gap: '16px', maxWidth: '1200px' }}
38
- >
39
- {(['h1', 'h2', 'h3', 'legend'] as const).map((as) => (
40
- <Header key={as} as={as} title={`Header as ${as}`} />
41
- ))}
42
- {(['section', 'group'] as const).map((level) => (
43
- <Header key={level} level={level} title={`Header level ${level}`} />
44
- ))}
45
- <Header
46
- as="h2"
47
- title="Header with Action"
48
- action={{
49
- 'aria-label': 'Action',
50
- text: 'Action',
51
- onClick: () => alert('Action clicked!'),
52
- }}
53
- />
54
- <Header
55
- as="h2"
56
- title="Header with link"
57
- action={{
58
- 'aria-label': 'Action',
59
- text: 'Action',
60
- href: 'https://wise.com',
61
- }}
62
- />
63
- </div>
64
- );
65
-
66
30
  /**
67
31
  * The stories below document the `Header` component, which is used to structure content and convey hierarchy. <br />
68
32
  * For more details, refer to the [design documentation](https://wise.design/components/section-header).
@@ -86,7 +50,7 @@ const meta: Meta<typeof Header> = {
86
50
  as: {
87
51
  type: {
88
52
  name: 'enum',
89
- value: ['h1', 'h2', 'h3', 'legend'],
53
+ value: ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'legend'],
90
54
  },
91
55
  table: {
92
56
  type: {
@@ -191,17 +155,3 @@ export const SectionLevel: Story = {
191
155
  },
192
156
  argTypes: hideControls(['action', 'as', 'className', 'title', 'testId']),
193
157
  };
194
-
195
- /**
196
- * Displays all variants of the `Header` component, including different levels, tags, and actions.
197
- */
198
- export const AllVariants = storyConfig(
199
- {
200
- tags: ['!autodocs'],
201
- parameters: {
202
- padding: '0',
203
- },
204
- render: renderVariants,
205
- },
206
- { variants: ['default', 'dark', 'bright-green', 'forest-green', 'rtl'] },
207
- );
@@ -0,0 +1,103 @@
1
+ import { Meta, StoryObj } from '@storybook/react-webpack5';
2
+ import Header, { type HeaderProps } from './Header';
3
+ import { storyConfig } from '../test-utils';
4
+
5
+ const meta: Meta<typeof Header> = {
6
+ component: Header,
7
+ tags: ['!autodocs'],
8
+ title: 'Typography/Header/tests',
9
+ };
10
+ export default meta;
11
+ type Story = StoryObj<HeaderProps>;
12
+
13
+ const TestComponent = () => (
14
+ <div
15
+ className="p-a-4 text-xs-center font-weight-bold"
16
+ style={{
17
+ backgroundImage: `repeating-linear-gradient(
18
+ -45deg, var(--color-background-neutral),
19
+ var(--color-background-neutral) 10px,
20
+ transparent 10px,
21
+ transparent 20px
22
+ )`,
23
+ }}
24
+ >
25
+ Placeholder component
26
+ </div>
27
+ );
28
+
29
+ const generateLevelStory = (level: HeaderProps['level'], withAction = false) => {
30
+ return {
31
+ render: () => {
32
+ return (
33
+ <>
34
+ {(['legend', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'] as HeaderProps['as'][]).map((tag) => {
35
+ const Wrapper = tag === 'legend' ? 'fieldset' : 'section';
36
+
37
+ return (
38
+ <Wrapper key={tag}>
39
+ <Header
40
+ as={tag}
41
+ level={level}
42
+ title={`Showcasing ${level} level with tag ${tag}`}
43
+ action={withAction ? { text: 'Action', href: '#target' } : undefined}
44
+ />
45
+ <TestComponent />
46
+ </Wrapper>
47
+ );
48
+ })}
49
+ </>
50
+ );
51
+ },
52
+ };
53
+ };
54
+
55
+ /**
56
+ * Helper to generate variants for `AllVariants` story.
57
+ */
58
+ const renderVariants = () => (
59
+ <div
60
+ className="header-variants"
61
+ style={{ display: 'flex', flexWrap: 'wrap', gap: '16px', maxWidth: '1200px' }}
62
+ >
63
+ {(['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'legend'] as const).map((as) => (
64
+ <Header key={as} as={as} title={`Header as ${as}`} />
65
+ ))}
66
+ {(['section', 'group'] as const).map((level) => (
67
+ <Header key={level} level={level} title={`Header level ${level}`} />
68
+ ))}
69
+ <Header
70
+ as="h2"
71
+ title="Header with Action"
72
+ action={{
73
+ 'aria-label': 'Action',
74
+ text: 'Action',
75
+ onClick: () => alert('Action clicked!'),
76
+ }}
77
+ />
78
+ <Header
79
+ as="h2"
80
+ title="Header with link"
81
+ action={{
82
+ 'aria-label': 'Action',
83
+ text: 'Action',
84
+ href: 'https://wise.com',
85
+ }}
86
+ />
87
+ </div>
88
+ );
89
+
90
+ export const GroupTrailingSpace: Story = generateLevelStory('group');
91
+ export const GroupTrailingSpaceWithAction: Story = generateLevelStory('group', true);
92
+ export const SectionTrailingSpace: Story = generateLevelStory('section');
93
+ export const SectionTrailingSpaceWithAction: Story = generateLevelStory('section', true);
94
+
95
+ export const AllVariants = storyConfig(
96
+ {
97
+ parameters: {
98
+ padding: '0',
99
+ },
100
+ render: renderVariants,
101
+ },
102
+ { variants: ['default', 'dark', 'bright-green', 'forest-green', 'rtl'] },
103
+ );
@@ -1,7 +1,6 @@
1
1
  import { clsx } from 'clsx';
2
2
 
3
3
  import { AriaLabelProperty, CommonProps, Heading, LinkProps, Typography } from '../common';
4
- import Button from '../button';
5
4
  import Link from '../link';
6
5
  import Title from '../title';
7
6
  import React, { useEffect, useRef, FunctionComponent } from 'react';
@@ -87,10 +86,8 @@ const Header: FunctionComponent<HeaderProps> = React.forwardRef(
87
86
  const internalRef = useRef<HTMLLegendElement>(null);
88
87
  const levelTypography =
89
88
  level === 'group' ? Typography.TITLE_GROUP : Typography.TITLE_SUBSECTION;
90
- const isLegendOrNoAction = !action || as === 'legend';
91
89
  const headerClasses = clsx('np-header', className, {
92
90
  'np-header--group': level === 'group',
93
- 'np-header__title': isLegendOrNoAction,
94
91
  });
95
92
 
96
93
  const commonProps = {
package/src/i18n/id.json CHANGED
@@ -45,6 +45,7 @@
45
45
  "neptune.Upload.csFailureText": "Unggahan gagal. Silakan coba lagi",
46
46
  "neptune.Upload.csSuccessText": "Pengunggahan selesai!",
47
47
  "neptune.Upload.csTooLargeMessage": "Harap berikan file yang lebih kecil dari {maxSize} MB",
48
+ "neptune.Upload.csTooLargeNoLimitMessage": "Harap berikan file yang lebih kecil",
48
49
  "neptune.Upload.csWrongTypeMessage": "Tipe file ini tidak didukung. Mohon coba lagi dengan file yang berbeda",
49
50
  "neptune.Upload.psButtonText": "Batalkan",
50
51
  "neptune.Upload.psProcessingText": "Mengunggah...",
@@ -52,6 +53,7 @@
52
53
  "neptune.Upload.usButtonText": "Atau pilih file",
53
54
  "neptune.Upload.usDropMessage": "Letakkan file untuk mulai mengunggah",
54
55
  "neptune.Upload.usPlaceholder": "Seret dan lepas file yang kurang dari {maxSize} MB",
56
+ "neptune.Upload.usPlaceholderNoLimit": "Seret dan lepaskan file",
55
57
  "neptune.UploadButton.allFileTypes": "Semua jenis file",
56
58
  "neptune.UploadButton.dropFiles": "Lepaskan file untuk mulai mengunggah",
57
59
  "neptune.UploadButton.instructions": "{fileTypes}, kurang dari {size}MB",
package/src/i18n/nl.json CHANGED
@@ -45,6 +45,7 @@
45
45
  "neptune.Upload.csFailureText": "Uploaden mislukt. Probeer het opnieuw",
46
46
  "neptune.Upload.csSuccessText": "Uploaden voltooid!",
47
47
  "neptune.Upload.csTooLargeMessage": "Upload een bestand kleiner dan {maxSize} MB",
48
+ "neptune.Upload.csTooLargeNoLimitMessage": "Verstrek een kleiner bestand",
48
49
  "neptune.Upload.csWrongTypeMessage": "Het bestandstype wordt niet ondersteund. Probeer het opnieuw met een ander bestand",
49
50
  "neptune.Upload.psButtonText": "Annuleren",
50
51
  "neptune.Upload.psProcessingText": "Uploaden...",
@@ -52,6 +53,7 @@
52
53
  "neptune.Upload.usButtonText": "Of selecteer een bestand",
53
54
  "neptune.Upload.usDropMessage": "Sleep het bestand hierheen om het te uploaden",
54
55
  "neptune.Upload.usPlaceholder": "Sleep een bestand van maximaal {maxSize} MB",
56
+ "neptune.Upload.usPlaceholderNoLimit": "Sleep een bestand hierheen",
55
57
  "neptune.UploadButton.allFileTypes": "Alle bestandstypen",
56
58
  "neptune.UploadButton.dropFiles": "Sleep het bestand hierheen om het te uploaden",
57
59
  "neptune.UploadButton.instructions": "{fileTypes}, kleiner dan {size} MB",
@@ -522,8 +522,6 @@
522
522
  width: 100%;
523
523
  border-radius: 16px;
524
524
  border-radius: var(--radius-medium);
525
- background-color: #ffffff;
526
- background-color: var(--color-background-screen);
527
525
  position: relative;
528
526
  padding: 12px 0;
529
527
  padding: var(--size-12) 0;
@@ -584,12 +582,6 @@
584
582
  outline-offset: var(--ring-outline-offset);
585
583
  outline-offset: -1px;
586
584
  }
587
- .wds-list-item-interactive.wds-list-item-spotlight:not(.disabled):not(:disabled):hover {
588
- background-color: var(--color-background-screen-hover);
589
- }
590
- .wds-list-item-interactive.wds-list-item-spotlight:not(.disabled):not(:disabled):active {
591
- background-color: var(--color-background-screen-active);
592
- }
593
585
  .wds-list-item-interactive.wds-list-item-spotlight:has(.wds-list-item-prompt:hover a, .wds-list-item-prompt:hover button):hover {
594
586
  background-color: transparent;
595
587
  background-color: initial;
@@ -730,10 +722,10 @@
730
722
  }
731
723
  }
732
724
  .wds-list-item-spotlight-inactive:not(.disabled):not(:disabled):hover {
733
- background-color: color-mix(in srgb, var(--color-background-neutral-hover) 25%, transparent);
725
+ background-color: color-mix(in srgb, var(--color-background-neutral-hover) 35%, transparent);
734
726
  }
735
727
  .wds-list-item-spotlight-inactive:not(.disabled):not(:disabled):active {
736
- background-color: color-mix(in srgb, var(--color-background-neutral-active) 25%, transparent);
728
+ background-color: color-mix(in srgb, var(--color-background-neutral-active) 45%, transparent);
737
729
  }
738
730
  .wds-list-item .wds-list-item-spotlight__border {
739
731
  position: absolute;
@@ -6,7 +6,6 @@
6
6
  list-style: none;
7
7
  width: 100%;
8
8
  border-radius: var(--radius-medium);
9
- background-color: var(--color-background-screen);
10
9
  position: relative;
11
10
  padding: var(--size-12) 0;
12
11
  container-type: inline-size;
@@ -80,16 +79,6 @@
80
79
  outline-offset: -1px;
81
80
  }
82
81
 
83
- &:not(.disabled, :disabled) {
84
- &:hover {
85
- background-color: var(--color-background-screen-hover);
86
- }
87
-
88
- &:active {
89
- background-color: var(--color-background-screen-active);
90
- }
91
- }
92
-
93
82
  &:has(.wds-list-item-prompt:hover a, .wds-list-item-prompt:hover button) {
94
83
  &:hover {
95
84
  background-color: unset;
@@ -236,32 +225,36 @@
236
225
  }
237
226
  }
238
227
 
239
-
240
-
241
228
  &-spotlight {
242
229
  padding-left: var(--size-12);
243
230
  padding-right: var(--size-12);
244
231
 
245
232
  &-active {
246
233
  background-color: var(--color-background-neutral);
247
- &:not(.disabled, :disabled):hover {
234
+ &:not(.disabled, :disabled) {
235
+ &:hover {
248
236
  background-color: var(--color-background-neutral-hover);
249
- }
250
- &:not(.disabled, :disabled):active {
237
+ }
238
+ &:active {
251
239
  background-color: var(--color-background-neutral-active);
240
+ }
252
241
  }
253
242
  }
254
243
 
255
244
  &-inactive {
256
- background-color: color-mix(in srgb, var(--color-background-neutral) 25%, transparent);
257
-
258
- &:not(.disabled, :disabled):hover {
259
- background-color: color-mix(in srgb, var(--color-background-neutral-hover) 25%, transparent);
260
- }
261
- &:not(.disabled, :disabled):active {
262
- background-color: color-mix(in srgb, var(--color-background-neutral-active) 25%, transparent);
245
+ background-color: color-mix(in srgb, var(--color-background-neutral) 25%, transparent);
246
+
247
+ &:not(.disabled, :disabled) {
248
+ &:hover {
249
+ background-color: color-mix(in srgb, var(--color-background-neutral-hover) 35%, transparent);
250
+ }
251
+ &:active {
252
+ background-color: color-mix(in srgb, var(--color-background-neutral-active) 45%, transparent);
253
+ }
263
254
  }
264
255
  }
256
+
257
+
265
258
  }
266
259
 
267
260
  .wds-list-item-spotlight__border{
@@ -2,7 +2,15 @@ import { useState } from 'react';
2
2
  import { Title, Subtitle, Description, Stories } from '@storybook/addon-docs/blocks';
3
3
  import { Meta, StoryObj } from '@storybook/react-webpack5';
4
4
  import { action } from 'storybook/actions';
5
- import { InfoCircle, Documents } from '@transferwise/icons';
5
+ import {
6
+ InfoCircle,
7
+ Documents,
8
+ Warning,
9
+ Home,
10
+ Globe,
11
+ People,
12
+ Link as LinkIcon,
13
+ } from '@transferwise/icons';
6
14
  import { lorem10, lorem100, lorem20, lorem5 } from '../../test-utils';
7
15
  import Modal from '../../modal';
8
16
  import Link from '../../link';
@@ -23,7 +31,7 @@ import {
23
31
 
24
32
  export default {
25
33
  component: ListItem,
26
- title: 'Content/ListItem/common scenarios',
34
+ title: 'Content/ListItem/Common Scenarios',
27
35
  tags: ['autodocs'],
28
36
  args: {
29
37
  title: lorem5,
@@ -226,3 +234,112 @@ export const CopyAndPasteWithSnackbar: Story = storySourceWithoutNoise({
226
234
  );
227
235
  },
228
236
  });
237
+
238
+ export const Summary: Story = {
239
+ parameters: {
240
+ docs: {
241
+ canvas: {
242
+ sourceState: 'shown',
243
+ },
244
+ },
245
+ backgrounds: {
246
+ default: 'light',
247
+ values: [
248
+ { name: 'light', value: '#f8f9fa' },
249
+ { name: 'dark', value: '#343a40' },
250
+ ],
251
+ },
252
+ },
253
+ render: () => {
254
+ const listItems = (
255
+ <List>
256
+ <ListItem
257
+ title="System maintenance"
258
+ subtitle="Scheduled downtime notification"
259
+ media={
260
+ <ListItem.AvatarView size={32}>
261
+ <Warning />
262
+ </ListItem.AvatarView>
263
+ }
264
+ control={
265
+ <ListItem.IconButton partiallyInteractive>
266
+ <InfoCircle />
267
+ </ListItem.IconButton>
268
+ }
269
+ />
270
+ <ListItem
271
+ title="One link, one QR code, many uses"
272
+ subtitle="Quick Pay is a unique link and QR code for your business to get paid online and in person."
273
+ media={
274
+ <ListItem.AvatarView size={32}>
275
+ <LinkIcon />
276
+ </ListItem.AvatarView>
277
+ }
278
+ />
279
+ <ListItem
280
+ title="Action required"
281
+ subtitle="Update your payment address"
282
+ media={
283
+ <ListItem.AvatarView size={32}>
284
+ <Home />
285
+ </ListItem.AvatarView>
286
+ }
287
+ additionalInfo={
288
+ <ListItem.AdditionalInfo
289
+ action={{ label: 'Change Address', onClick: () => console.log('hello') }}
290
+ />
291
+ }
292
+ />
293
+ <ListItem
294
+ title="Action required"
295
+ subtitle="Update your payment address"
296
+ media={
297
+ <ListItem.AvatarView size={32}>
298
+ <Home />
299
+ </ListItem.AvatarView>
300
+ }
301
+ additionalInfo={
302
+ <ListItem.AdditionalInfo
303
+ action={{ label: 'Change Address', onClick: () => console.log('hello') }}
304
+ />
305
+ }
306
+ control={
307
+ <ListItem.IconButton partiallyInteractive>
308
+ <InfoCircle />
309
+ </ListItem.IconButton>
310
+ }
311
+ />
312
+ <ListItem
313
+ title="Receive money from around the world"
314
+ media={
315
+ <ListItem.AvatarView size={32}>
316
+ <Globe />
317
+ </ListItem.AvatarView>
318
+ }
319
+ />
320
+ <ListItem
321
+ title="Let customers pay in a currency they trust"
322
+ media={
323
+ <ListItem.AvatarView size={32}>
324
+ <People />
325
+ </ListItem.AvatarView>
326
+ }
327
+ />
328
+ </List>
329
+ );
330
+ return (
331
+ <>
332
+ <div style={{ padding: '24px', width: '450px' }}>{listItems}</div>
333
+ <div
334
+ style={{
335
+ padding: '24px',
336
+ width: '450px',
337
+ backgroundColor: 'var(--color-background-neutral)',
338
+ }}
339
+ >
340
+ {listItems}
341
+ </div>
342
+ </>
343
+ );
344
+ },
345
+ };
@@ -92,7 +92,7 @@ type PreviewStoryArgs = ListItemProps & {
92
92
  };
93
93
 
94
94
  const previewArgGroup = {
95
- category: 'Preview options',
95
+ category: 'Storybook Preview options',
96
96
  type: {
97
97
  summary: undefined,
98
98
  },
@@ -38,9 +38,15 @@ export const storySourceWithoutNoise = (config: Story): Story => {
38
38
  * In order to make preview controls work correctly, we have to refresh the render
39
39
  * by swapping the `key`. This is a workaround for the Storybook's limitation.
40
40
  */
41
- export const withoutKey: Decorator = (Story, { args }) => (
42
- <Story key={args?.disabled ? 'disabled' : 'enabled'} />
43
- );
41
+ export const withoutKey: Decorator = (Story, { args }) => {
42
+ const key = [
43
+ args.previewInteractivity,
44
+ args?.disabled ? 'disabled' : 'enabled',
45
+ args?.inverted ? 'desc' : 'asc',
46
+ ].join('-');
47
+
48
+ return <Story key={key} />;
49
+ };
44
50
 
45
51
  /**
46
52
  * Not all stories need access to all controls as it causes unnecessary UI noise.
package/src/main.css CHANGED
@@ -2454,10 +2454,10 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
2454
2454
  border-bottom: 1px solid rgba(0,0,0,0.10196);
2455
2455
  border-bottom: 1px solid var(--color-border-neutral);
2456
2456
  }
2457
- .np-header__title {
2457
+ .np-header--group,
2458
+ .np-header--group .np-header__title {
2458
2459
  color: #5d7079;
2459
2460
  color: var(--color-content-secondary);
2460
- margin: 0;
2461
2461
  }
2462
2462
  .np-header__action {
2463
2463
  margin: 0;
@@ -3166,8 +3166,6 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
3166
3166
  width: 100%;
3167
3167
  border-radius: 16px;
3168
3168
  border-radius: var(--radius-medium);
3169
- background-color: #ffffff;
3170
- background-color: var(--color-background-screen);
3171
3169
  position: relative;
3172
3170
  padding: 12px 0;
3173
3171
  padding: var(--size-12) 0;
@@ -3228,12 +3226,6 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
3228
3226
  outline-offset: var(--ring-outline-offset);
3229
3227
  outline-offset: -1px;
3230
3228
  }
3231
- .wds-list-item-interactive.wds-list-item-spotlight:not(.disabled):not(:disabled):hover {
3232
- background-color: var(--color-background-screen-hover);
3233
- }
3234
- .wds-list-item-interactive.wds-list-item-spotlight:not(.disabled):not(:disabled):active {
3235
- background-color: var(--color-background-screen-active);
3236
- }
3237
3229
  .wds-list-item-interactive.wds-list-item-spotlight:has(.wds-list-item-prompt:hover a, .wds-list-item-prompt:hover button):hover {
3238
3230
  background-color: transparent;
3239
3231
  background-color: initial;
@@ -3374,10 +3366,10 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
3374
3366
  }
3375
3367
  }
3376
3368
  .wds-list-item-spotlight-inactive:not(.disabled):not(:disabled):hover {
3377
- background-color: color-mix(in srgb, var(--color-background-neutral-hover) 25%, transparent);
3369
+ background-color: color-mix(in srgb, var(--color-background-neutral-hover) 35%, transparent);
3378
3370
  }
3379
3371
  .wds-list-item-spotlight-inactive:not(.disabled):not(:disabled):active {
3380
- background-color: color-mix(in srgb, var(--color-background-neutral-active) 25%, transparent);
3372
+ background-color: color-mix(in srgb, var(--color-background-neutral-active) 45%, transparent);
3381
3373
  }
3382
3374
  .wds-list-item .wds-list-item-spotlight__border {
3383
3375
  position: absolute;