@transferwise/components 0.0.0-experimental-c239b44 → 0.0.0-experimental-5acc778

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 (64) hide show
  1. package/build/header/Header.js +76 -44
  2. package/build/header/Header.js.map +1 -1
  3. package/build/header/Header.mjs +73 -44
  4. package/build/header/Header.mjs.map +1 -1
  5. package/build/i18n/es.json +2 -0
  6. package/build/i18n/es.json.js +2 -0
  7. package/build/i18n/es.json.js.map +1 -1
  8. package/build/i18n/es.json.mjs +2 -0
  9. package/build/i18n/es.json.mjs.map +1 -1
  10. package/build/index.js +1 -1
  11. package/build/index.mjs +1 -1
  12. package/build/inputs/SelectInput.js +1 -1
  13. package/build/inputs/SelectInput.js.map +1 -1
  14. package/build/inputs/SelectInput.mjs +1 -1
  15. package/build/listItem/IconButton/ListItemIconButton.js +1 -1
  16. package/build/listItem/IconButton/ListItemIconButton.js.map +1 -1
  17. package/build/listItem/IconButton/ListItemIconButton.mjs +1 -1
  18. package/build/listItem/IconButton/ListItemIconButton.mjs.map +1 -1
  19. package/build/listItem/ListItem.js +18 -18
  20. package/build/listItem/ListItem.js.map +1 -1
  21. package/build/listItem/ListItem.mjs +18 -18
  22. package/build/listItem/ListItem.mjs.map +1 -1
  23. package/build/listItem/ListItemContext.js.map +1 -1
  24. package/build/listItem/ListItemContext.mjs.map +1 -1
  25. package/build/main.css +29 -14
  26. package/build/styles/header/Header.css +29 -14
  27. package/build/styles/main.css +29 -14
  28. package/build/title/Title.js +10 -4
  29. package/build/title/Title.js.map +1 -1
  30. package/build/title/Title.mjs +6 -4
  31. package/build/title/Title.mjs.map +1 -1
  32. package/build/types/header/Header.d.ts +27 -11
  33. package/build/types/header/Header.d.ts.map +1 -1
  34. package/build/types/header/index.d.ts +1 -0
  35. package/build/types/header/index.d.ts.map +1 -1
  36. package/build/types/index.d.ts +1 -0
  37. package/build/types/index.d.ts.map +1 -1
  38. package/build/types/listItem/ListItem.d.ts +3 -3
  39. package/build/types/listItem/ListItem.d.ts.map +1 -1
  40. package/build/types/listItem/ListItemContext.d.ts +2 -2
  41. package/build/types/listItem/ListItemContext.d.ts.map +1 -1
  42. package/build/types/title/Title.d.ts +4 -5
  43. package/build/types/title/Title.d.ts.map +1 -1
  44. package/package.json +3 -3
  45. package/src/header/Header.accessibility.docs.mdx +85 -0
  46. package/src/header/Header.css +29 -14
  47. package/src/header/Header.less +24 -9
  48. package/src/header/Header.spec.tsx +68 -50
  49. package/src/header/Header.story.tsx +190 -36
  50. package/src/header/Header.tsx +110 -70
  51. package/src/header/index.ts +1 -0
  52. package/src/i18n/es.json +2 -0
  53. package/src/index.ts +1 -0
  54. package/src/listItem/IconButton/ListItemIconButton.story.tsx +2 -2
  55. package/src/listItem/IconButton/ListItemIconButton.tsx +2 -2
  56. package/src/listItem/ListItem.spec.tsx +279 -221
  57. package/src/listItem/ListItem.tsx +20 -19
  58. package/src/listItem/ListItemContext.tsx +2 -2
  59. package/src/listItem/_stories/ListItem.layout.test.story.tsx +6 -6
  60. package/src/listItem/_stories/ListItem.story.tsx +19 -12
  61. package/src/listItem/_stories/ListItem.variants.test.story.tsx +43 -43
  62. package/src/listItem/test-utils.tsx +1 -1
  63. package/src/main.css +29 -14
  64. package/src/title/Title.tsx +25 -12
@@ -3,7 +3,6 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var clsx = require('clsx');
6
- var Button_resolver = require('../button/Button.resolver.js');
7
6
  require('../common/theme.js');
8
7
  require('../common/direction.js');
9
8
  require('../common/propsValues/control.js');
@@ -24,78 +23,111 @@ require('../common/propsValues/scroll.js');
24
23
  require('../common/propsValues/markdownNodeType.js');
25
24
  require('../common/fileType.js');
26
25
  require('@transferwise/icons');
27
- require('react');
26
+ var React = require('react');
28
27
  require('react-intl');
29
28
  require('../common/closeButton/CloseButton.messages.js');
30
29
  var jsxRuntime = require('react/jsx-runtime');
31
- var Link = require('../link/Link.js');
30
+ var Button_resolver = require('../button/Button.resolver.js');
32
31
  var Title = require('../title/Title.js');
33
32
 
34
- const HeaderAction = ({
33
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
34
+
35
+ var React__default = /*#__PURE__*/_interopDefault(React);
36
+
37
+ const HeaderAction = /*#__PURE__*/React__default.default.forwardRef(({
35
38
  action
36
- }) => {
37
- const props = {
38
- 'aria-label': action['aria-label']
39
- };
40
- if ('href' in action) {
41
- return /*#__PURE__*/jsxRuntime.jsx(Link.default, {
42
- href: action.href,
43
- target: action.target,
44
- onClick: action.onClick,
45
- ...props,
46
- children: action.text
47
- });
48
- }
49
- return /*#__PURE__*/jsxRuntime.jsx(Button_resolver.default, {
50
- className: "np-header__button",
51
- priority: "tertiary",
52
- size: "sm",
39
+ }, ref) => {
40
+ const baseProps = {
41
+ ref,
42
+ className: 'np-header__action-button',
43
+ priority: 'tertiary',
44
+ size: 'sm',
45
+ 'aria-label': action['aria-label'],
53
46
  onClick: action.onClick,
54
- ...props,
55
47
  children: action.text
48
+ };
49
+ const linkProps = 'href' in action ? {
50
+ href: action.href,
51
+ target: action.target,
52
+ as: 'a'
53
+ } : {};
54
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
55
+ className: "np-header__action",
56
+ children: /*#__PURE__*/jsxRuntime.jsx(Button_resolver.default, {
57
+ ...baseProps,
58
+ ...linkProps
59
+ })
56
60
  });
57
- };
61
+ });
62
+ HeaderAction.displayName = 'HeaderAction';
58
63
  /**
64
+ * @param {ButtonActionProps | LinkActionProps} [action] - Optional prop to specify the action button or link.
65
+ * @param {Heading | 'legend'} [as='h5'] - Optional prop to override the heading element rendered for the title.
66
+ * @param {string} title - Required prop to set the title of the section header.
67
+ * @param {'group' | 'section'} [level='group'] - Optional prop to specify the level of the section header.
68
+ * @param {string} [className]
69
+ * @param {string} [testId]
59
70
  *
60
- * Neptune Web: https://transferwise.github.io/neptune-web/components/content/Header
61
- *
71
+ * @see {@link Header } for further information.
72
+ * @see {@link https://storybook.wise.design/?path=/docs/typography-header--docs|Storybook Wise Design}
62
73
  */
63
- const Header = ({
64
- id,
65
- action,
74
+ const Header = /*#__PURE__*/React__default.default.forwardRef(({
66
75
  as = 'h5',
67
- title,
76
+ action,
68
77
  className,
69
- role = undefined
70
- }) => {
78
+ testId,
79
+ title,
80
+ level = 'group',
81
+ ...props
82
+ }, ref) => {
83
+ const internalRef = React.useRef(null);
84
+ const actionRef = React.useRef(null);
85
+ const levelTypography = level === 'group' ? typography.Typography.TITLE_GROUP : typography.Typography.TITLE_SUBSECTION;
86
+ const isLegendOrNoAction = !action || as === 'legend';
87
+ const headerClasses = clsx.clsx('np-header', className, {
88
+ 'np-header--group': level === 'group',
89
+ 'np-header__title': isLegendOrNoAction
90
+ });
91
+ const commonProps = {
92
+ className: headerClasses,
93
+ 'data-testid': testId
94
+ };
95
+ React.useEffect(() => {
96
+ if (as === 'legend' && internalRef.current) {
97
+ const {
98
+ parentElement
99
+ } = internalRef.current;
100
+ if (!parentElement || parentElement.tagName.toLowerCase() !== 'fieldset') {
101
+ console.warn('Legends should be the first child in a fieldset, and this is not possible when including an action');
102
+ }
103
+ }
104
+ }, [as]);
71
105
  if (!action) {
72
106
  return /*#__PURE__*/jsxRuntime.jsx(Title.default, {
107
+ ref: internalRef,
73
108
  as: as,
74
- id: id,
75
- role: role,
76
- type: typography.Typography.TITLE_GROUP,
77
- className: clsx.clsx('np-header', 'np-header__title', className),
109
+ type: levelTypography,
110
+ ...commonProps,
111
+ ...props,
78
112
  children: title
79
113
  });
80
114
  }
81
- if (as === 'legend') {
82
- // eslint-disable-next-line no-console
83
- console.warn('Legends should be the first child in a fieldset, and this is not possible when including an action');
84
- }
85
115
  return /*#__PURE__*/jsxRuntime.jsxs("div", {
86
- className: clsx.clsx('np-header', className),
116
+ ...commonProps,
117
+ ...props,
118
+ ref: ref,
87
119
  children: [/*#__PURE__*/jsxRuntime.jsx(Title.default, {
88
120
  as: as,
89
- type: typography.Typography.TITLE_GROUP,
90
- id: id,
121
+ type: levelTypography,
91
122
  className: "np-header__title",
92
123
  children: title
93
124
  }), /*#__PURE__*/jsxRuntime.jsx(HeaderAction, {
125
+ ref: actionRef,
94
126
  action: action
95
127
  })]
96
128
  });
97
- };
129
+ });
130
+ Header.displayName = 'Header';
98
131
 
99
- exports.Header = Header;
100
132
  exports.default = Header;
101
133
  //# sourceMappingURL=Header.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Header.js","sources":["../../src/header/Header.tsx"],"sourcesContent":["import { clsx } from 'clsx';\n\nimport { ActionButtonProps } from '../actionButton/ActionButton';\nimport Button from '../button';\nimport { AriaLabelProperty, CommonProps, Heading, LinkProps, Typography } from '../common';\nimport Link from '../link';\nimport Title from '../title';\nimport { HTMLAttributes } from 'react';\n\ntype ActionProps = AriaLabelProperty & {\n text: string;\n};\n\ntype ButtonActionProps = ActionProps & ActionButtonProps;\n\ntype LinkActionProps = ActionProps & LinkProps;\n\nexport type HeaderProps = CommonProps & {\n /**\n * When the `href` property is provided to the `action`, we will render a `Link` instead of a `ActionButton`.\n */\n action?: ButtonActionProps | LinkActionProps;\n /**\n * Override the heading element rendered for the title, useful to specify the semantics of your header.\n *\n * @default \"h5\"\n */\n as?: Heading | 'legend' | 'header';\n title: string;\n} & Pick<HTMLAttributes<HTMLDivElement>, 'role' | 'id'>;\n\nconst HeaderAction = ({ action }: { action: ButtonActionProps | LinkActionProps }) => {\n const props = {\n 'aria-label': action['aria-label'],\n };\n\n if ('href' in action) {\n return (\n <Link href={action.href} target={action.target} onClick={action.onClick} {...props}>\n {action.text}\n </Link>\n );\n }\n\n return (\n <Button\n className=\"np-header__button\"\n priority=\"tertiary\"\n size=\"sm\"\n onClick={action.onClick}\n {...props}\n >\n {action.text}\n </Button>\n );\n};\n\n/**\n *\n * Neptune Web: https://transferwise.github.io/neptune-web/components/content/Header\n *\n */\nexport const Header = ({\n id,\n action,\n as = 'h5',\n title,\n className,\n role = undefined,\n}: HeaderProps) => {\n if (!action) {\n return (\n <Title\n as={as}\n id={id}\n role={role}\n type={Typography.TITLE_GROUP}\n className={clsx('np-header', 'np-header__title', className)}\n >\n {title}\n </Title>\n );\n }\n\n if (as === 'legend') {\n // eslint-disable-next-line no-console\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 return (\n <div className={clsx('np-header', className)}>\n <Title as={as} type={Typography.TITLE_GROUP} id={id} className=\"np-header__title\">\n {title}\n </Title>\n <HeaderAction action={action} />\n </div>\n );\n};\n\nexport default Header;\n"],"names":["HeaderAction","action","props","_jsx","Link","href","target","onClick","children","text","Button","className","priority","size","Header","id","as","title","role","undefined","Title","type","Typography","TITLE_GROUP","clsx","console","warn","_jsxs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,MAAMA,YAAY,GAAGA,CAAC;AAAEC,EAAAA;AAAM,CAAmD,KAAI;AACnF,EAAA,MAAMC,KAAK,GAAG;IACZ,YAAY,EAAED,MAAM,CAAC,YAAY;GAClC;EAED,IAAI,MAAM,IAAIA,MAAM,EAAE;IACpB,oBACEE,cAAA,CAACC,YAAI,EAAA;MAACC,IAAI,EAAEJ,MAAM,CAACI,IAAK;MAACC,MAAM,EAAEL,MAAM,CAACK,MAAO;MAACC,OAAO,EAAEN,MAAM,CAACM,OAAQ;AAAA,MAAA,GAAKL,KAAK;MAAAM,QAAA,EAC/EP,MAAM,CAACQ;AAAI,KACR,CAAC;AAEX,EAAA;EAEA,oBACEN,cAAA,CAACO,uBAAM,EAAA;AACLC,IAAAA,SAAS,EAAC,mBAAmB;AAC7BC,IAAAA,QAAQ,EAAC,UAAU;AACnBC,IAAAA,IAAI,EAAC,IAAI;IACTN,OAAO,EAAEN,MAAM,CAACM,OAAQ;AAAA,IAAA,GACpBL,KAAK;IAAAM,QAAA,EAERP,MAAM,CAACQ;AAAI,GACN,CAAC;AAEb,CAAC;AAED;;;;AAIG;AACI,MAAMK,MAAM,GAAGA,CAAC;EACrBC,EAAE;EACFd,MAAM;AACNe,EAAAA,EAAE,GAAG,IAAI;EACTC,KAAK;EACLN,SAAS;AACTO,EAAAA,IAAI,GAAGC;AAAS,CACJ,KAAI;EAChB,IAAI,CAAClB,MAAM,EAAE;IACX,oBACEE,cAAA,CAACiB,aAAK,EAAA;AACJJ,MAAAA,EAAE,EAAEA,EAAG;AACPD,MAAAA,EAAE,EAAEA,EAAG;AACPG,MAAAA,IAAI,EAAEA,IAAK;MACXG,IAAI,EAAEC,qBAAU,CAACC,WAAY;MAC7BZ,SAAS,EAAEa,SAAI,CAAC,WAAW,EAAE,kBAAkB,EAAEb,SAAS,CAAE;AAAAH,MAAAA,QAAA,EAE3DS;AAAK,KACD,CAAC;AAEZ,EAAA;EAEA,IAAID,EAAE,KAAK,QAAQ,EAAE;AACnB;AACAS,IAAAA,OAAO,CAACC,IAAI,CACV,oGAAoG,CACrG;AACH,EAAA;AAEA,EAAA,oBACEC,eAAA,CAAA,KAAA,EAAA;AAAKhB,IAAAA,SAAS,EAAEa,SAAI,CAAC,WAAW,EAAEb,SAAS,CAAE;IAAAH,QAAA,EAAA,cAC3CL,cAAA,CAACiB,aAAK,EAAA;AAACJ,MAAAA,EAAE,EAAEA,EAAG;MAACK,IAAI,EAAEC,qBAAU,CAACC,WAAY;AAACR,MAAAA,EAAE,EAAEA,EAAG;AAACJ,MAAAA,SAAS,EAAC,kBAAkB;AAAAH,MAAAA,QAAA,EAC9ES;AAAK,KACD,CACP,eAAAd,cAAA,CAACH,YAAY,EAAA;AAACC,MAAAA,MAAM,EAAEA;AAAO,KAAA,CAC/B;AAAA,GAAK,CAAC;AAEV;;;;;"}
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 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 (\n { action }: { action: ButtonActionProps | LinkActionProps },\n ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>,\n ) => {\n const baseProps = {\n ref,\n className: 'np-header__action-button',\n priority: 'tertiary' as const,\n size: 'sm' as const,\n 'aria-label': action['aria-label'],\n onClick: action.onClick,\n children: action.text,\n };\n\n const linkProps =\n 'href' in action ? { href: action.href, target: action.target, as: 'a' as const } : {};\n\n return (\n <div className=\"np-header__action\">\n <Button {...baseProps} {...linkProps} />\n </div>\n );\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 actionRef = useRef<HTMLButtonElement | HTMLAnchorElement>(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 ref={actionRef} action={action} />\n </div>\n );\n },\n);\n\nHeader.displayName = 'Header';\n\nexport default Header;\n"],"names":["HeaderAction","React","forwardRef","action","ref","baseProps","className","priority","size","onClick","children","text","linkProps","href","target","as","_jsx","Button","displayName","Header","testId","title","level","props","internalRef","useRef","actionRef","levelTypography","Typography","TITLE_GROUP","TITLE_SUBSECTION","isLegendOrNoAction","headerClasses","clsx","commonProps","useEffect","current","parentElement","tagName","toLowerCase","console","warn","Title","type","_jsxs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkDA,MAAMA,YAAY,gBAAGC,sBAAK,CAACC,UAAU,CACnC,CACE;AAAEC,EAAA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SAAS,EAAC,kBAAkB;AAAAI,MAAAA,QAAA,EAC/DW;AAAK,KACD,CACP,eAAAL,cAAA,CAAChB,YAAY,EAAA;AAACI,MAAAA,GAAG,EAAEsB,SAAU;AAACvB,MAAAA,MAAM,EAAEA;AAAO,KAAA,CAC/C;AAAA,GAAK,CAAC;AAEV,CAAC;AAGHgB,MAAM,CAACD,WAAW,GAAG,QAAQ;;;;"}
@@ -1,5 +1,4 @@
1
1
  import { clsx } from 'clsx';
2
- import Button from '../button/Button.resolver.mjs';
3
2
  import '../common/theme.mjs';
4
3
  import '../common/direction.mjs';
5
4
  import '../common/propsValues/control.mjs';
@@ -20,77 +19,107 @@ import '../common/propsValues/scroll.mjs';
20
19
  import '../common/propsValues/markdownNodeType.mjs';
21
20
  import '../common/fileType.mjs';
22
21
  import '@transferwise/icons';
23
- import 'react';
22
+ import React__default, { useRef, useEffect } from 'react';
24
23
  import 'react-intl';
25
24
  import '../common/closeButton/CloseButton.messages.mjs';
26
25
  import { jsx, jsxs } from 'react/jsx-runtime';
27
- import Link from '../link/Link.mjs';
26
+ import Button from '../button/Button.resolver.mjs';
28
27
  import Title from '../title/Title.mjs';
29
28
 
30
- const HeaderAction = ({
29
+ const HeaderAction = /*#__PURE__*/React__default.forwardRef(({
31
30
  action
32
- }) => {
33
- const props = {
34
- 'aria-label': action['aria-label']
35
- };
36
- if ('href' in action) {
37
- return /*#__PURE__*/jsx(Link, {
38
- href: action.href,
39
- target: action.target,
40
- onClick: action.onClick,
41
- ...props,
42
- children: action.text
43
- });
44
- }
45
- return /*#__PURE__*/jsx(Button, {
46
- className: "np-header__button",
47
- priority: "tertiary",
48
- size: "sm",
31
+ }, ref) => {
32
+ const baseProps = {
33
+ ref,
34
+ className: 'np-header__action-button',
35
+ priority: 'tertiary',
36
+ size: 'sm',
37
+ 'aria-label': action['aria-label'],
49
38
  onClick: action.onClick,
50
- ...props,
51
39
  children: action.text
40
+ };
41
+ const linkProps = 'href' in action ? {
42
+ href: action.href,
43
+ target: action.target,
44
+ as: 'a'
45
+ } : {};
46
+ return /*#__PURE__*/jsx("div", {
47
+ className: "np-header__action",
48
+ children: /*#__PURE__*/jsx(Button, {
49
+ ...baseProps,
50
+ ...linkProps
51
+ })
52
52
  });
53
- };
53
+ });
54
+ HeaderAction.displayName = 'HeaderAction';
54
55
  /**
56
+ * @param {ButtonActionProps | LinkActionProps} [action] - Optional prop to specify the action button or link.
57
+ * @param {Heading | 'legend'} [as='h5'] - Optional prop to override the heading element rendered for the title.
58
+ * @param {string} title - Required prop to set the title of the section header.
59
+ * @param {'group' | 'section'} [level='group'] - Optional prop to specify the level of the section header.
60
+ * @param {string} [className]
61
+ * @param {string} [testId]
55
62
  *
56
- * Neptune Web: https://transferwise.github.io/neptune-web/components/content/Header
57
- *
63
+ * @see {@link Header } for further information.
64
+ * @see {@link https://storybook.wise.design/?path=/docs/typography-header--docs|Storybook Wise Design}
58
65
  */
59
- const Header = ({
60
- id,
61
- action,
66
+ const Header = /*#__PURE__*/React__default.forwardRef(({
62
67
  as = 'h5',
63
- title,
68
+ action,
64
69
  className,
65
- role = undefined
66
- }) => {
70
+ testId,
71
+ title,
72
+ level = 'group',
73
+ ...props
74
+ }, ref) => {
75
+ const internalRef = useRef(null);
76
+ const actionRef = useRef(null);
77
+ const levelTypography = level === 'group' ? Typography.TITLE_GROUP : Typography.TITLE_SUBSECTION;
78
+ const isLegendOrNoAction = !action || as === 'legend';
79
+ const headerClasses = clsx('np-header', className, {
80
+ 'np-header--group': level === 'group',
81
+ 'np-header__title': isLegendOrNoAction
82
+ });
83
+ const commonProps = {
84
+ className: headerClasses,
85
+ 'data-testid': testId
86
+ };
87
+ useEffect(() => {
88
+ if (as === 'legend' && internalRef.current) {
89
+ const {
90
+ parentElement
91
+ } = internalRef.current;
92
+ if (!parentElement || parentElement.tagName.toLowerCase() !== 'fieldset') {
93
+ console.warn('Legends should be the first child in a fieldset, and this is not possible when including an action');
94
+ }
95
+ }
96
+ }, [as]);
67
97
  if (!action) {
68
98
  return /*#__PURE__*/jsx(Title, {
99
+ ref: internalRef,
69
100
  as: as,
70
- id: id,
71
- role: role,
72
- type: Typography.TITLE_GROUP,
73
- className: clsx('np-header', 'np-header__title', className),
101
+ type: levelTypography,
102
+ ...commonProps,
103
+ ...props,
74
104
  children: title
75
105
  });
76
106
  }
77
- if (as === 'legend') {
78
- // eslint-disable-next-line no-console
79
- console.warn('Legends should be the first child in a fieldset, and this is not possible when including an action');
80
- }
81
107
  return /*#__PURE__*/jsxs("div", {
82
- className: clsx('np-header', className),
108
+ ...commonProps,
109
+ ...props,
110
+ ref: ref,
83
111
  children: [/*#__PURE__*/jsx(Title, {
84
112
  as: as,
85
- type: Typography.TITLE_GROUP,
86
- id: id,
113
+ type: levelTypography,
87
114
  className: "np-header__title",
88
115
  children: title
89
116
  }), /*#__PURE__*/jsx(HeaderAction, {
117
+ ref: actionRef,
90
118
  action: action
91
119
  })]
92
120
  });
93
- };
121
+ });
122
+ Header.displayName = 'Header';
94
123
 
95
- export { Header, Header as default };
124
+ export { Header as default };
96
125
  //# sourceMappingURL=Header.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Header.mjs","sources":["../../src/header/Header.tsx"],"sourcesContent":["import { clsx } from 'clsx';\n\nimport { ActionButtonProps } from '../actionButton/ActionButton';\nimport Button from '../button';\nimport { AriaLabelProperty, CommonProps, Heading, LinkProps, Typography } from '../common';\nimport Link from '../link';\nimport Title from '../title';\nimport { HTMLAttributes } from 'react';\n\ntype ActionProps = AriaLabelProperty & {\n text: string;\n};\n\ntype ButtonActionProps = ActionProps & ActionButtonProps;\n\ntype LinkActionProps = ActionProps & LinkProps;\n\nexport type HeaderProps = CommonProps & {\n /**\n * When the `href` property is provided to the `action`, we will render a `Link` instead of a `ActionButton`.\n */\n action?: ButtonActionProps | LinkActionProps;\n /**\n * Override the heading element rendered for the title, useful to specify the semantics of your header.\n *\n * @default \"h5\"\n */\n as?: Heading | 'legend' | 'header';\n title: string;\n} & Pick<HTMLAttributes<HTMLDivElement>, 'role' | 'id'>;\n\nconst HeaderAction = ({ action }: { action: ButtonActionProps | LinkActionProps }) => {\n const props = {\n 'aria-label': action['aria-label'],\n };\n\n if ('href' in action) {\n return (\n <Link href={action.href} target={action.target} onClick={action.onClick} {...props}>\n {action.text}\n </Link>\n );\n }\n\n return (\n <Button\n className=\"np-header__button\"\n priority=\"tertiary\"\n size=\"sm\"\n onClick={action.onClick}\n {...props}\n >\n {action.text}\n </Button>\n );\n};\n\n/**\n *\n * Neptune Web: https://transferwise.github.io/neptune-web/components/content/Header\n *\n */\nexport const Header = ({\n id,\n action,\n as = 'h5',\n title,\n className,\n role = undefined,\n}: HeaderProps) => {\n if (!action) {\n return (\n <Title\n as={as}\n id={id}\n role={role}\n type={Typography.TITLE_GROUP}\n className={clsx('np-header', 'np-header__title', className)}\n >\n {title}\n </Title>\n );\n }\n\n if (as === 'legend') {\n // eslint-disable-next-line no-console\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 return (\n <div className={clsx('np-header', className)}>\n <Title as={as} type={Typography.TITLE_GROUP} id={id} className=\"np-header__title\">\n {title}\n </Title>\n <HeaderAction action={action} />\n </div>\n );\n};\n\nexport default Header;\n"],"names":["HeaderAction","action","props","_jsx","Link","href","target","onClick","children","text","Button","className","priority","size","Header","id","as","title","role","undefined","Title","type","Typography","TITLE_GROUP","clsx","console","warn","_jsxs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,MAAMA,YAAY,GAAGA,CAAC;AAAEC,EAAAA;AAAM,CAAmD,KAAI;AACnF,EAAA,MAAMC,KAAK,GAAG;IACZ,YAAY,EAAED,MAAM,CAAC,YAAY;GAClC;EAED,IAAI,MAAM,IAAIA,MAAM,EAAE;IACpB,oBACEE,GAAA,CAACC,IAAI,EAAA;MAACC,IAAI,EAAEJ,MAAM,CAACI,IAAK;MAACC,MAAM,EAAEL,MAAM,CAACK,MAAO;MAACC,OAAO,EAAEN,MA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AE,EAAEA,EAAG;AAACJ,MAAAA,SAAS,EAAC,kBAAkB;AAAAH,MAAAA,QAAA,EAC9ES;AAAK,KACD,CACP,eAAAd,GAAA,CAACH,YAAY,EAAA;AAACC,MAAAA,MAAM,EAAEA;AAAO,KAAA,CAC/B;AAAA,GAAK,CAAC;AAEV;;;;"}
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 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 (\n { action }: { action: ButtonActionProps | LinkActionProps },\n ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>,\n ) => {\n const baseProps = {\n ref,\n className: 'np-header__action-button',\n priority: 'tertiary' as const,\n size: 'sm' as const,\n 'aria-label': action['aria-label'],\n onClick: action.onClick,\n children: action.text,\n };\n\n const linkProps =\n 'href' in action ? { href: action.href, target: action.target, as: 'a' as const } : {};\n\n return (\n <div className=\"np-header__action\">\n <Button {...baseProps} {...linkProps} />\n </div>\n );\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 actionRef = useRef<HTMLButtonElement | HTMLAnchorElement>(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 ref={actionRef} action={action} />\n </div>\n );\n },\n);\n\nHeader.displayName = 'Header';\n\nexport default Header;\n"],"names":["HeaderAction","React","forwardRef","action","ref","baseProps","className","priority","size","onClick","children","text","linkProps","href","target","as","_jsx","Button","displayName","Header","testId","title","level","props","internalRef","useRef","actionRef","levelTypography","Typography","TITLE_GROUP","TITLE_SUBSECTION","isLegendOrNoAction","headerClasses","clsx","commonProps","useEffect","current","parentElement","tagName","toLowerCase","console","warn","Title","type","_jsxs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkDA,MAAMA,YAAY,gBAAGC,cAAK,CAACC,UAAU,CACnC,CACE;AAAEC,EAAAA;AAAM,CAAmD,EAC3DC,GAAqD,KACnD;AACF,EAAA,MAAMC,SAAS,GAAG;IAChBD,GAAG;AACHE,IAAAA,SAAS,EAAE,0BAA0B;AACrCC,IAAAA,QAAQ,EAAE,UAAmB;AAC7BC,IAAAA,IAAI,EAAE,IAAa;AACnB,IAAA,YAAY,EAAEL,MAAM,CAAC,YAAY,CAAC;IAClCM,OAAO,EAAEN,MAAM,CAACM,OAAO;IACvBC,QAAQ,EAAEP,MAAM,CAACQ;GAClB;AAED,EAAA,MAAMC,SAAS,GACb,MAAM,IAAIT,MAAM,GAAG;IAAEU,IAAI,EAAEV,MAAM,CAACU,IAAI;IAAEC,MAAM,EAAEX,MAAM,CAACW,MAAM;AAAEC,IAAAA,EAAE,EAAE;GAAc,GAAG,EAAE;AAExF,EAAA,oBACEC,GAAA,CAAA,KAAA,EAAA;AAAKV,IAAAA,SAAS,EAAC,mBAAmB;IAAAI,QAAA,eAChCM,GAAA,CAACC,MAAM,EAAA;AAAA,MAAA,GAAKZ,SAAS;MAAA,GAAMO;KAAU;AACvC,GAAK,CAAC;AAEV,CAAC,CACF;AAEDZ,YAAY,CAACkB,WAAW,GAAG,cAAc;AAEzC;;;;;;;;;;AAUG;AACH,MAAMC,MAAM,gBAAmClB,cAAK,CAACC,UAAU,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AEA,EAAG;AAAC4B,MAAAA,IAAI,EAAEhB,eAAgB;AAAA,MAAA,GAAKO,WAAW;AAAA,MAAA,GAAMX,KAAK;AAAAb,MAAAA,QAAA,EAC/EW;AAAK,KACD,CAAC;AAEZ,EAAA;AAEA,EAAA,oBACEuB,IAAA,CAAA,KAAA,EAAA;AAAA,IAAA,GAASV,WAAW;AAAA,IAAA,GAAMX,KAAK;AAAEnB,IAAAA,GAAG,EAAEA,GAAiC;IAAAM,QAAA,EAAA,cACrEM,GAAA,CAAC0B,KAAK,EAAA;AAAC3B,MAAAA,EAAE,EAAEA,EAAG;AAAC4B,MAAAA,IAAI,EAAEhB,eAAgB;AAACrB,MAAAA,SAAS,EAAC,kBAAkB;AAAAI,MAAAA,QAAA,EAC/DW;AAAK,KACD,CACP,eAAAL,GAAA,CAAChB,YAAY,EAAA;AAACI,MAAAA,GAAG,EAAEsB,SAAU;AAACvB,MAAAA,MAAM,EAAEA;AAAO,KAAA,CAC/C;AAAA,GAAK,CAAC;AAEV,CAAC;AAGHgB,MAAM,CAACD,WAAW,GAAG,QAAQ;;;;"}
@@ -45,6 +45,7 @@
45
45
  "neptune.Upload.csFailureText": "La carga del archivo ha fallado. Por favor, inténtalo de nuevo",
46
46
  "neptune.Upload.csSuccessText": "¡Se ha subido el archivo!",
47
47
  "neptune.Upload.csTooLargeMessage": "Proporciona un archivo menor de {maxSize} MB",
48
+ "neptune.Upload.csTooLargeNoLimitMessage": "Proporciona un archivo más pequeño",
48
49
  "neptune.Upload.csWrongTypeMessage": "Tipo de archivo no aceptado. Por favor, inténtalo de nuevo con un archivo diferente",
49
50
  "neptune.Upload.psButtonText": "Cancela",
50
51
  "neptune.Upload.psProcessingText": "Subiendo...",
@@ -52,6 +53,7 @@
52
53
  "neptune.Upload.usButtonText": "O selecciona un archivo",
53
54
  "neptune.Upload.usDropMessage": "Arrastra un archivo para subirlo",
54
55
  "neptune.Upload.usPlaceholder": "Arrastra y suelta un archivo de menos de {maxSize} MB",
56
+ "neptune.Upload.usPlaceholderNoLimit": "Arrastra y suelta un archivo",
55
57
  "neptune.UploadButton.allFileTypes": "Todos los tipos de archivos",
56
58
  "neptune.UploadButton.dropFiles": "Arrastra un archivo para subirlo",
57
59
  "neptune.UploadButton.instructions": "{fileTypes}, menor que {size}MB",
@@ -49,6 +49,7 @@ var es = {
49
49
  "neptune.Upload.csFailureText": "La carga del archivo ha fallado. Por favor, inténtalo de nuevo",
50
50
  "neptune.Upload.csSuccessText": "¡Se ha subido el archivo!",
51
51
  "neptune.Upload.csTooLargeMessage": "Proporciona un archivo menor de {maxSize} MB",
52
+ "neptune.Upload.csTooLargeNoLimitMessage": "Proporciona un archivo más pequeño",
52
53
  "neptune.Upload.csWrongTypeMessage": "Tipo de archivo no aceptado. Por favor, inténtalo de nuevo con un archivo diferente",
53
54
  "neptune.Upload.psButtonText": "Cancela",
54
55
  "neptune.Upload.psProcessingText": "Subiendo...",
@@ -56,6 +57,7 @@ var es = {
56
57
  "neptune.Upload.usButtonText": "O selecciona un archivo",
57
58
  "neptune.Upload.usDropMessage": "Arrastra un archivo para subirlo",
58
59
  "neptune.Upload.usPlaceholder": "Arrastra y suelta un archivo de menos de {maxSize} MB",
60
+ "neptune.Upload.usPlaceholderNoLimit": "Arrastra y suelta un archivo",
59
61
  "neptune.UploadButton.allFileTypes": "Todos los tipos de archivos",
60
62
  "neptune.UploadButton.dropFiles": "Arrastra un archivo para subirlo",
61
63
  "neptune.UploadButton.instructions": "{fileTypes}, menor que {size}MB",
@@ -1 +1 @@
1
- {"version":3,"file":"es.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"es.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -45,6 +45,7 @@ var es = {
45
45
  "neptune.Upload.csFailureText": "La carga del archivo ha fallado. Por favor, inténtalo de nuevo",
46
46
  "neptune.Upload.csSuccessText": "¡Se ha subido el archivo!",
47
47
  "neptune.Upload.csTooLargeMessage": "Proporciona un archivo menor de {maxSize} MB",
48
+ "neptune.Upload.csTooLargeNoLimitMessage": "Proporciona un archivo más pequeño",
48
49
  "neptune.Upload.csWrongTypeMessage": "Tipo de archivo no aceptado. Por favor, inténtalo de nuevo con un archivo diferente",
49
50
  "neptune.Upload.psButtonText": "Cancela",
50
51
  "neptune.Upload.psProcessingText": "Subiendo...",
@@ -52,6 +53,7 @@ var es = {
52
53
  "neptune.Upload.usButtonText": "O selecciona un archivo",
53
54
  "neptune.Upload.usDropMessage": "Arrastra un archivo para subirlo",
54
55
  "neptune.Upload.usPlaceholder": "Arrastra y suelta un archivo de menos de {maxSize} MB",
56
+ "neptune.Upload.usPlaceholderNoLimit": "Arrastra y suelta un archivo",
55
57
  "neptune.UploadButton.allFileTypes": "Todos los tipos de archivos",
56
58
  "neptune.UploadButton.dropFiles": "Arrastra un archivo para subirlo",
57
59
  "neptune.UploadButton.instructions": "{fileTypes}, menor que {size}MB",
@@ -1 +1 @@
1
- {"version":3,"file":"es.json.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"es.json.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/build/index.js CHANGED
@@ -200,7 +200,7 @@ exports.DropFade = DropFade.default;
200
200
  exports.Emphasis = Emphasis.default;
201
201
  exports.Field = Field.Field;
202
202
  exports.FlowNavigation = FlowNavigation.default;
203
- exports.Header = Header.Header;
203
+ exports.Header = Header.default;
204
204
  Object.defineProperty(exports, "InfoPresentation", {
205
205
  enumerable: true,
206
206
  get: function () { return infoPresentations.InfoPresentation; }
package/build/index.mjs CHANGED
@@ -45,7 +45,7 @@ export { default as DropFade } from './dropFade/DropFade.mjs';
45
45
  export { default as Emphasis } from './emphasis/Emphasis.mjs';
46
46
  export { Field } from './field/Field.mjs';
47
47
  export { default as FlowNavigation } from './flowNavigation/FlowNavigation.mjs';
48
- export { Header } from './header/Header.mjs';
48
+ export { default as Header } from './header/Header.mjs';
49
49
  export { InfoPresentation } from './info/infoPresentations.mjs';
50
50
  export { default as Info } from './info/Info.mjs';
51
51
  export { default as InlineAlert } from './inlineAlert/InlineAlert.mjs';
@@ -608,7 +608,7 @@ function SelectInputGroupItemView({
608
608
  needle
609
609
  }) {
610
610
  const headerId = React.useId();
611
- const header = /*#__PURE__*/jsxRuntime.jsx(Header.Header, {
611
+ const header = /*#__PURE__*/jsxRuntime.jsx(Header.default, {
612
612
  as: "header",
613
613
  role: "none",
614
614
  id: headerId,