@transferwise/components 46.105.0 → 46.105.2

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.
Files changed (37) hide show
  1. package/build/header/Header.js +1 -3
  2. package/build/header/Header.js.map +1 -1
  3. package/build/header/Header.mjs +1 -3
  4. package/build/header/Header.mjs.map +1 -1
  5. package/build/i18n/id.json +2 -0
  6. package/build/i18n/id.json.js +2 -0
  7. package/build/i18n/id.json.js.map +1 -1
  8. package/build/i18n/id.json.mjs +2 -0
  9. package/build/i18n/id.json.mjs.map +1 -1
  10. package/build/i18n/nl.json +2 -0
  11. package/build/i18n/nl.json.js +2 -0
  12. package/build/i18n/nl.json.js.map +1 -1
  13. package/build/i18n/nl.json.mjs +2 -0
  14. package/build/i18n/nl.json.mjs.map +1 -1
  15. package/build/main.css +4 -18
  16. package/build/styles/header/Header.css +2 -2
  17. package/build/styles/listItem/ListItem.css +2 -16
  18. package/build/styles/listItem/ListItem.grid.css +0 -8
  19. package/build/styles/main.css +4 -18
  20. package/build/types/header/Header.d.ts +2 -2
  21. package/build/types/header/Header.d.ts.map +1 -1
  22. package/build/types/listItem/_stories/helpers.d.ts.map +1 -1
  23. package/package.json +1 -1
  24. package/src/header/Header.css +2 -2
  25. package/src/header/Header.less +4 -4
  26. package/src/header/Header.story.tsx +1 -51
  27. package/src/header/Header.tests.story.tsx +103 -0
  28. package/src/header/Header.tsx +1 -4
  29. package/src/i18n/id.json +2 -0
  30. package/src/i18n/nl.json +2 -0
  31. package/src/listItem/ListItem.css +2 -16
  32. package/src/listItem/ListItem.grid.css +0 -8
  33. package/src/listItem/ListItem.grid.less +0 -8
  34. package/src/listItem/ListItem.less +16 -22
  35. package/src/listItem/_stories/ListItem.story.tsx +1 -1
  36. package/src/listItem/_stories/helpers.tsx +9 -3
  37. package/src/main.css +4 -18
@@ -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?: () => 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,GAAuE,KACrE;AACF,EAAA,MAAMiB,WAAW,GAAGC,YAAM,CAAoB,IAAI,CAAC;AACnD,EAAA,MAAMC,eAAe,GACnBJ,KAAK,KAAK,OAAO,GAAGK,qBAAU,CAACC,WAAW,GAAGD,qBAAU,CAACE,gBAAgB;AAC1E,EAAA,MAAMC,kBAAkB,GAA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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,qBAAU,CAACC,WAAW,GAAGD,qBAAU,CAACE,gBAAgB;AAC1E,EAAA,MAAMC,aAAa,GAAGC,SAAI,CAAC,WAAW,EAAErB,SAAS,EAAE;IACjD,kBAAkB,EAAEY,KAAK,KAAK;AAC/B,GAAA,CAAC;AAEF,EAAA,MAAMU,WAAW,GAAG;AAClBtB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__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?: () => 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,GAAGC;AAAK,CAAE,EAC1EhB,GAAuE,KACrE;AACF,EAAA,MAAMiB,WAAW,GAAGC,MAAM,CAAoB,IAAI,CAAC;AACnD,EAAA,MAAMC,eAAe,GACnBJ,KAAK,KAAK,OAAO,GAAGK,UAAU,CAACC,WAAW,GAAGD,UAAU,CAACE,gBAAgB;AAC1E,EAAA,M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AAAA,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,KAAK,OAAO,GAAGK,UAAU,CAACC,WAAW,GAAGD,UAAU,CAACE,gBAAgB;AAC1E,EAAA,MAAMC,aAAa,GAAGC,IAAI,CAAC,WAAW,EAAErB,SAAS,EAAE;IACjD,kBAAkB,EAAEY,KAAK,KAAK;AAC/B,GAAA,CAAC;AAEF,EAAA,MAAMU,WAAW,GAAG;A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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;
@@ -2746,10 +2746,6 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
2746
2746
  -o-object-position: bottom left;
2747
2747
  object-position: bottom left;
2748
2748
  }
2749
- .wds-list-item-gridWrapper.wds-list-item-hasMedia-hasControl .wds-list-item-media {
2750
- margin-bottom: 12px;
2751
- margin-bottom: var(--size-12);
2752
- }
2753
2749
  .wds-list-item-gridWrapper.wds-list-item-hasMedia-hasControl.wds-list-item-hasInfo-hasPrompt {
2754
2750
  grid-template-columns: 1fr auto;
2755
2751
  grid-template-rows: auto auto auto auto;
@@ -2786,10 +2782,6 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
2786
2782
  grid-template-columns: 1fr;
2787
2783
  grid-template-areas: "media" "body" "control";
2788
2784
  }
2789
- .wds-list-item-gridWrapper.wds-list-item-hasMedia-noControl .wds-list-item-media {
2790
- margin-bottom: 12px;
2791
- margin-bottom: var(--size-12);
2792
- }
2793
2785
  .wds-list-item-gridWrapper.wds-list-item-hasMedia-noControl.wds-list-item-hasInfo-hasPrompt {
2794
2786
  grid-template-columns: auto auto;
2795
2787
  grid-template-rows: auto auto auto auto;
@@ -3236,12 +3228,6 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
3236
3228
  outline-offset: var(--ring-outline-offset);
3237
3229
  outline-offset: -1px;
3238
3230
  }
3239
- .wds-list-item-interactive.wds-list-item-spotlight:not(.disabled):not(:disabled):hover {
3240
- background-color: var(--color-background-screen-hover);
3241
- }
3242
- .wds-list-item-interactive.wds-list-item-spotlight:not(.disabled):not(:disabled):active {
3243
- background-color: var(--color-background-screen-active);
3244
- }
3245
3231
  .wds-list-item-interactive.wds-list-item-spotlight:has(.wds-list-item-prompt:hover a, .wds-list-item-prompt:hover button):hover {
3246
3232
  background-color: transparent;
3247
3233
  background-color: initial;
@@ -3382,10 +3368,10 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
3382
3368
  }
3383
3369
  }
3384
3370
  .wds-list-item-spotlight-inactive:not(.disabled):not(:disabled):hover {
3385
- background-color: color-mix(in srgb, var(--color-background-neutral-hover) 25%, transparent);
3371
+ background-color: color-mix(in srgb, var(--color-background-neutral-hover) 35%, transparent);
3386
3372
  }
3387
3373
  .wds-list-item-spotlight-inactive:not(.disabled):not(:disabled):active {
3388
- background-color: color-mix(in srgb, var(--color-background-neutral-active) 25%, transparent);
3374
+ background-color: color-mix(in srgb, var(--color-background-neutral-active) 45%, transparent);
3389
3375
  }
3390
3376
  .wds-list-item .wds-list-item-spotlight__border {
3391
3377
  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;
@@ -102,10 +102,6 @@
102
102
  -o-object-position: bottom left;
103
103
  object-position: bottom left;
104
104
  }
105
- .wds-list-item-gridWrapper.wds-list-item-hasMedia-hasControl .wds-list-item-media {
106
- margin-bottom: 12px;
107
- margin-bottom: var(--size-12);
108
- }
109
105
  .wds-list-item-gridWrapper.wds-list-item-hasMedia-hasControl.wds-list-item-hasInfo-hasPrompt {
110
106
  grid-template-columns: 1fr auto;
111
107
  grid-template-rows: auto auto auto auto;
@@ -142,10 +138,6 @@
142
138
  grid-template-columns: 1fr;
143
139
  grid-template-areas: "media" "body" "control";
144
140
  }
145
- .wds-list-item-gridWrapper.wds-list-item-hasMedia-noControl .wds-list-item-media {
146
- margin-bottom: 12px;
147
- margin-bottom: var(--size-12);
148
- }
149
141
  .wds-list-item-gridWrapper.wds-list-item-hasMedia-noControl.wds-list-item-hasInfo-hasPrompt {
150
142
  grid-template-columns: auto auto;
151
143
  grid-template-rows: auto auto auto auto;
@@ -592,12 +584,6 @@
592
584
  outline-offset: var(--ring-outline-offset);
593
585
  outline-offset: -1px;
594
586
  }
595
- .wds-list-item-interactive.wds-list-item-spotlight:not(.disabled):not(:disabled):hover {
596
- background-color: var(--color-background-screen-hover);
597
- }
598
- .wds-list-item-interactive.wds-list-item-spotlight:not(.disabled):not(:disabled):active {
599
- background-color: var(--color-background-screen-active);
600
- }
601
587
  .wds-list-item-interactive.wds-list-item-spotlight:has(.wds-list-item-prompt:hover a, .wds-list-item-prompt:hover button):hover {
602
588
  background-color: transparent;
603
589
  background-color: initial;
@@ -738,10 +724,10 @@
738
724
  }
739
725
  }
740
726
  .wds-list-item-spotlight-inactive:not(.disabled):not(:disabled):hover {
741
- background-color: color-mix(in srgb, var(--color-background-neutral-hover) 25%, transparent);
727
+ background-color: color-mix(in srgb, var(--color-background-neutral-hover) 35%, transparent);
742
728
  }
743
729
  .wds-list-item-spotlight-inactive:not(.disabled):not(:disabled):active {
744
- background-color: color-mix(in srgb, var(--color-background-neutral-active) 25%, transparent);
730
+ background-color: color-mix(in srgb, var(--color-background-neutral-active) 45%, transparent);
745
731
  }
746
732
  .wds-list-item .wds-list-item-spotlight__border {
747
733
  position: absolute;
@@ -102,10 +102,6 @@
102
102
  -o-object-position: bottom left;
103
103
  object-position: bottom left;
104
104
  }
105
- .wds-list-item-gridWrapper.wds-list-item-hasMedia-hasControl .wds-list-item-media {
106
- margin-bottom: 12px;
107
- margin-bottom: var(--size-12);
108
- }
109
105
  .wds-list-item-gridWrapper.wds-list-item-hasMedia-hasControl.wds-list-item-hasInfo-hasPrompt {
110
106
  grid-template-columns: 1fr auto;
111
107
  grid-template-rows: auto auto auto auto;
@@ -142,10 +138,6 @@
142
138
  grid-template-columns: 1fr;
143
139
  grid-template-areas: "media" "body" "control";
144
140
  }
145
- .wds-list-item-gridWrapper.wds-list-item-hasMedia-noControl .wds-list-item-media {
146
- margin-bottom: 12px;
147
- margin-bottom: var(--size-12);
148
- }
149
141
  .wds-list-item-gridWrapper.wds-list-item-hasMedia-noControl.wds-list-item-hasInfo-hasPrompt {
150
142
  grid-template-columns: auto auto;
151
143
  grid-template-rows: auto auto auto auto;
@@ -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;
@@ -2746,10 +2746,6 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
2746
2746
  -o-object-position: bottom left;
2747
2747
  object-position: bottom left;
2748
2748
  }
2749
- .wds-list-item-gridWrapper.wds-list-item-hasMedia-hasControl .wds-list-item-media {
2750
- margin-bottom: 12px;
2751
- margin-bottom: var(--size-12);
2752
- }
2753
2749
  .wds-list-item-gridWrapper.wds-list-item-hasMedia-hasControl.wds-list-item-hasInfo-hasPrompt {
2754
2750
  grid-template-columns: 1fr auto;
2755
2751
  grid-template-rows: auto auto auto auto;
@@ -2786,10 +2782,6 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
2786
2782
  grid-template-columns: 1fr;
2787
2783
  grid-template-areas: "media" "body" "control";
2788
2784
  }
2789
- .wds-list-item-gridWrapper.wds-list-item-hasMedia-noControl .wds-list-item-media {
2790
- margin-bottom: 12px;
2791
- margin-bottom: var(--size-12);
2792
- }
2793
2785
  .wds-list-item-gridWrapper.wds-list-item-hasMedia-noControl.wds-list-item-hasInfo-hasPrompt {
2794
2786
  grid-template-columns: auto auto;
2795
2787
  grid-template-rows: auto auto auto auto;
@@ -3236,12 +3228,6 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
3236
3228
  outline-offset: var(--ring-outline-offset);
3237
3229
  outline-offset: -1px;
3238
3230
  }
3239
- .wds-list-item-interactive.wds-list-item-spotlight:not(.disabled):not(:disabled):hover {
3240
- background-color: var(--color-background-screen-hover);
3241
- }
3242
- .wds-list-item-interactive.wds-list-item-spotlight:not(.disabled):not(:disabled):active {
3243
- background-color: var(--color-background-screen-active);
3244
- }
3245
3231
  .wds-list-item-interactive.wds-list-item-spotlight:has(.wds-list-item-prompt:hover a, .wds-list-item-prompt:hover button):hover {
3246
3232
  background-color: transparent;
3247
3233
  background-color: initial;
@@ -3382,10 +3368,10 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
3382
3368
  }
3383
3369
  }
3384
3370
  .wds-list-item-spotlight-inactive:not(.disabled):not(:disabled):hover {
3385
- background-color: color-mix(in srgb, var(--color-background-neutral-hover) 25%, transparent);
3371
+ background-color: color-mix(in srgb, var(--color-background-neutral-hover) 35%, transparent);
3386
3372
  }
3387
3373
  .wds-list-item-spotlight-inactive:not(.disabled):not(:disabled):active {
3388
- background-color: color-mix(in srgb, var(--color-background-neutral-active) 25%, transparent);
3374
+ background-color: color-mix(in srgb, var(--color-background-neutral-active) 45%, transparent);
3389
3375
  }
3390
3376
  .wds-list-item .wds-list-item-spotlight__border {
3391
3377
  position: absolute;
@@ -1,8 +1,8 @@
1
1
  import { AriaLabelProperty, CommonProps, Heading, LinkProps } from '../common';
2
- import { FunctionComponent } from 'react';
2
+ import React, { FunctionComponent } from 'react';
3
3
  type ActionProps = AriaLabelProperty & {
4
4
  text: string;
5
- onClick?: () => void;
5
+ onClick?: (event: React.MouseEvent) => void;
6
6
  };
7
7
  type ButtonActionProps = ActionProps;
8
8
  type LinkActionProps = ActionProps & LinkProps;
@@ -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,OAAc,EAAqB,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAEpE,KAAK,WAAW,GAAG,iBAAiB,GAAG;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CA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E,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,CA6C1C,CAAC;AAIF,eAAe,MAAM,CAAC"}
@@ -1 +1 @@
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,SAExB,CAAC;AAEF;;GAEG;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.0",
3
+ "version": "46.105.2",
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,14 +1,13 @@
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';
8
7
 
9
8
  type ActionProps = AriaLabelProperty & {
10
9
  text: string;
11
- onClick?: () => void;
10
+ onClick?: (event: React.MouseEvent) => void;
12
11
  };
13
12
 
14
13
  type ButtonActionProps = ActionProps;
@@ -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",
@@ -102,10 +102,6 @@
102
102
  -o-object-position: bottom left;
103
103
  object-position: bottom left;
104
104
  }
105
- .wds-list-item-gridWrapper.wds-list-item-hasMedia-hasControl .wds-list-item-media {
106
- margin-bottom: 12px;
107
- margin-bottom: var(--size-12);
108
- }
109
105
  .wds-list-item-gridWrapper.wds-list-item-hasMedia-hasControl.wds-list-item-hasInfo-hasPrompt {
110
106
  grid-template-columns: 1fr auto;
111
107
  grid-template-rows: auto auto auto auto;
@@ -142,10 +138,6 @@
142
138
  grid-template-columns: 1fr;
143
139
  grid-template-areas: "media" "body" "control";
144
140
  }
145
- .wds-list-item-gridWrapper.wds-list-item-hasMedia-noControl .wds-list-item-media {
146
- margin-bottom: 12px;
147
- margin-bottom: var(--size-12);
148
- }
149
141
  .wds-list-item-gridWrapper.wds-list-item-hasMedia-noControl.wds-list-item-hasInfo-hasPrompt {
150
142
  grid-template-columns: auto auto;
151
143
  grid-template-rows: auto auto auto auto;
@@ -592,12 +584,6 @@
592
584
  outline-offset: var(--ring-outline-offset);
593
585
  outline-offset: -1px;
594
586
  }
595
- .wds-list-item-interactive.wds-list-item-spotlight:not(.disabled):not(:disabled):hover {
596
- background-color: var(--color-background-screen-hover);
597
- }
598
- .wds-list-item-interactive.wds-list-item-spotlight:not(.disabled):not(:disabled):active {
599
- background-color: var(--color-background-screen-active);
600
- }
601
587
  .wds-list-item-interactive.wds-list-item-spotlight:has(.wds-list-item-prompt:hover a, .wds-list-item-prompt:hover button):hover {
602
588
  background-color: transparent;
603
589
  background-color: initial;
@@ -738,10 +724,10 @@
738
724
  }
739
725
  }
740
726
  .wds-list-item-spotlight-inactive:not(.disabled):not(:disabled):hover {
741
- background-color: color-mix(in srgb, var(--color-background-neutral-hover) 25%, transparent);
727
+ background-color: color-mix(in srgb, var(--color-background-neutral-hover) 35%, transparent);
742
728
  }
743
729
  .wds-list-item-spotlight-inactive:not(.disabled):not(:disabled):active {
744
- background-color: color-mix(in srgb, var(--color-background-neutral-active) 25%, transparent);
730
+ background-color: color-mix(in srgb, var(--color-background-neutral-active) 45%, transparent);
745
731
  }
746
732
  .wds-list-item .wds-list-item-spotlight__border {
747
733
  position: absolute;
@@ -102,10 +102,6 @@
102
102
  -o-object-position: bottom left;
103
103
  object-position: bottom left;
104
104
  }
105
- .wds-list-item-gridWrapper.wds-list-item-hasMedia-hasControl .wds-list-item-media {
106
- margin-bottom: 12px;
107
- margin-bottom: var(--size-12);
108
- }
109
105
  .wds-list-item-gridWrapper.wds-list-item-hasMedia-hasControl.wds-list-item-hasInfo-hasPrompt {
110
106
  grid-template-columns: 1fr auto;
111
107
  grid-template-rows: auto auto auto auto;
@@ -142,10 +138,6 @@
142
138
  grid-template-columns: 1fr;
143
139
  grid-template-areas: "media" "body" "control";
144
140
  }
145
- .wds-list-item-gridWrapper.wds-list-item-hasMedia-noControl .wds-list-item-media {
146
- margin-bottom: 12px;
147
- margin-bottom: var(--size-12);
148
- }
149
141
  .wds-list-item-gridWrapper.wds-list-item-hasMedia-noControl.wds-list-item-hasInfo-hasPrompt {
150
142
  grid-template-columns: auto auto;
151
143
  grid-template-rows: auto auto auto auto;
@@ -159,10 +159,6 @@
159
159
  }
160
160
 
161
161
  &.wds-list-item-hasMedia-hasControl {
162
- .wds-list-item-media {
163
- margin-bottom: var(--size-12);
164
- }
165
-
166
162
  &.wds-list-item-hasInfo-hasPrompt {
167
163
  grid-template-columns: 1fr auto;
168
164
  grid-template-rows: auto auto auto auto;
@@ -237,10 +233,6 @@
237
233
  }
238
234
 
239
235
  &.wds-list-item-hasMedia-noControl {
240
- .wds-list-item-media {
241
- margin-bottom: var(--size-12);
242
- }
243
-
244
236
  &.wds-list-item-hasInfo-hasPrompt {
245
237
  grid-template-columns: auto auto;
246
238
  grid-template-rows: auto auto auto auto;
@@ -80,16 +80,6 @@
80
80
  outline-offset: -1px;
81
81
  }
82
82
 
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
83
  &:has(.wds-list-item-prompt:hover a, .wds-list-item-prompt:hover button) {
94
84
  &:hover {
95
85
  background-color: unset;
@@ -236,32 +226,36 @@
236
226
  }
237
227
  }
238
228
 
239
-
240
-
241
229
  &-spotlight {
242
230
  padding-left: var(--size-12);
243
231
  padding-right: var(--size-12);
244
232
 
245
233
  &-active {
246
234
  background-color: var(--color-background-neutral);
247
- &:not(.disabled, :disabled):hover {
235
+ &:not(.disabled, :disabled) {
236
+ &:hover {
248
237
  background-color: var(--color-background-neutral-hover);
249
- }
250
- &:not(.disabled, :disabled):active {
238
+ }
239
+ &:active {
251
240
  background-color: var(--color-background-neutral-active);
241
+ }
252
242
  }
253
243
  }
254
244
 
255
245
  &-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);
246
+ background-color: color-mix(in srgb, var(--color-background-neutral) 25%, transparent);
247
+
248
+ &:not(.disabled, :disabled) {
249
+ &:hover {
250
+ background-color: color-mix(in srgb, var(--color-background-neutral-hover) 35%, transparent);
251
+ }
252
+ &:active {
253
+ background-color: color-mix(in srgb, var(--color-background-neutral-active) 45%, transparent);
254
+ }
263
255
  }
264
256
  }
257
+
258
+
265
259
  }
266
260
 
267
261
  .wds-list-item-spotlight__border{
@@ -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;
@@ -2746,10 +2746,6 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
2746
2746
  -o-object-position: bottom left;
2747
2747
  object-position: bottom left;
2748
2748
  }
2749
- .wds-list-item-gridWrapper.wds-list-item-hasMedia-hasControl .wds-list-item-media {
2750
- margin-bottom: 12px;
2751
- margin-bottom: var(--size-12);
2752
- }
2753
2749
  .wds-list-item-gridWrapper.wds-list-item-hasMedia-hasControl.wds-list-item-hasInfo-hasPrompt {
2754
2750
  grid-template-columns: 1fr auto;
2755
2751
  grid-template-rows: auto auto auto auto;
@@ -2786,10 +2782,6 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
2786
2782
  grid-template-columns: 1fr;
2787
2783
  grid-template-areas: "media" "body" "control";
2788
2784
  }
2789
- .wds-list-item-gridWrapper.wds-list-item-hasMedia-noControl .wds-list-item-media {
2790
- margin-bottom: 12px;
2791
- margin-bottom: var(--size-12);
2792
- }
2793
2785
  .wds-list-item-gridWrapper.wds-list-item-hasMedia-noControl.wds-list-item-hasInfo-hasPrompt {
2794
2786
  grid-template-columns: auto auto;
2795
2787
  grid-template-rows: auto auto auto auto;
@@ -3236,12 +3228,6 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
3236
3228
  outline-offset: var(--ring-outline-offset);
3237
3229
  outline-offset: -1px;
3238
3230
  }
3239
- .wds-list-item-interactive.wds-list-item-spotlight:not(.disabled):not(:disabled):hover {
3240
- background-color: var(--color-background-screen-hover);
3241
- }
3242
- .wds-list-item-interactive.wds-list-item-spotlight:not(.disabled):not(:disabled):active {
3243
- background-color: var(--color-background-screen-active);
3244
- }
3245
3231
  .wds-list-item-interactive.wds-list-item-spotlight:has(.wds-list-item-prompt:hover a, .wds-list-item-prompt:hover button):hover {
3246
3232
  background-color: transparent;
3247
3233
  background-color: initial;
@@ -3382,10 +3368,10 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
3382
3368
  }
3383
3369
  }
3384
3370
  .wds-list-item-spotlight-inactive:not(.disabled):not(:disabled):hover {
3385
- background-color: color-mix(in srgb, var(--color-background-neutral-hover) 25%, transparent);
3371
+ background-color: color-mix(in srgb, var(--color-background-neutral-hover) 35%, transparent);
3386
3372
  }
3387
3373
  .wds-list-item-spotlight-inactive:not(.disabled):not(:disabled):active {
3388
- background-color: color-mix(in srgb, var(--color-background-neutral-active) 25%, transparent);
3374
+ background-color: color-mix(in srgb, var(--color-background-neutral-active) 45%, transparent);
3389
3375
  }
3390
3376
  .wds-list-item .wds-list-item-spotlight__border {
3391
3377
  position: absolute;