@transferwise/components 0.0.0-experimental-64ea603 → 0.0.0-experimental-840bf87

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 (38) hide show
  1. package/build/header/Header.js +38 -79
  2. package/build/header/Header.js.map +1 -1
  3. package/build/header/Header.mjs +38 -76
  4. package/build/header/Header.mjs.map +1 -1
  5. package/build/index.js +1 -1
  6. package/build/index.mjs +1 -1
  7. package/build/inputs/SelectInput.js +1 -1
  8. package/build/inputs/SelectInput.js.map +1 -1
  9. package/build/inputs/SelectInput.mjs +1 -1
  10. package/build/main.css +11 -28
  11. package/build/selectOption/SelectOption.js +1 -1
  12. package/build/selectOption/SelectOption.js.map +1 -1
  13. package/build/selectOption/SelectOption.mjs +1 -1
  14. package/build/styles/header/Header.css +11 -28
  15. package/build/styles/main.css +11 -28
  16. package/build/title/Title.js +4 -6
  17. package/build/title/Title.js.map +1 -1
  18. package/build/title/Title.mjs +4 -6
  19. package/build/title/Title.mjs.map +1 -1
  20. package/build/types/header/Header.d.ts +11 -28
  21. package/build/types/header/Header.d.ts.map +1 -1
  22. package/build/types/header/index.d.ts +0 -1
  23. package/build/types/header/index.d.ts.map +1 -1
  24. package/build/types/index.d.ts +0 -1
  25. package/build/types/index.d.ts.map +1 -1
  26. package/build/types/title/Title.d.ts +4 -3
  27. package/build/types/title/Title.d.ts.map +1 -1
  28. package/package.json +5 -5
  29. package/src/header/Header.css +11 -28
  30. package/src/header/Header.less +7 -29
  31. package/src/header/Header.spec.tsx +50 -68
  32. package/src/header/Header.story.tsx +39 -184
  33. package/src/header/Header.tsx +69 -123
  34. package/src/header/index.ts +0 -1
  35. package/src/index.ts +0 -1
  36. package/src/main.css +11 -28
  37. package/src/title/Title.tsx +11 -25
  38. package/src/header/Header.accessibility.docs.mdx +0 -85
@@ -3,6 +3,7 @@
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');
6
7
  require('../common/theme.js');
7
8
  require('../common/direction.js');
8
9
  require('../common/propsValues/control.js');
@@ -23,120 +24,78 @@ require('../common/propsValues/scroll.js');
23
24
  require('../common/propsValues/markdownNodeType.js');
24
25
  require('../common/fileType.js');
25
26
  require('@transferwise/icons');
26
- var React = require('react');
27
+ require('react');
27
28
  require('react-intl');
28
29
  require('../common/closeButton/CloseButton.messages.js');
29
30
  var jsxRuntime = require('react/jsx-runtime');
30
31
  var Link = require('../link/Link.js');
31
- var Button_resolver = require('../button/Button.resolver.js');
32
32
  var Title = require('../title/Title.js');
33
33
 
34
- function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
35
-
36
- var React__default = /*#__PURE__*/_interopDefault(React);
37
-
38
- const HeaderAction = /*#__PURE__*/React__default.default.forwardRef(({
34
+ const HeaderAction = ({
39
35
  action
40
- }, ref) => {
41
- const {
42
- 'aria-label': ariaLabel,
43
- text,
44
- onClick
45
- } = action;
36
+ }) => {
37
+ const props = {
38
+ 'aria-label': action['aria-label']
39
+ };
46
40
  if ('href' in action) {
47
- const {
48
- href,
49
- target,
50
- onClick: linkOnClick
51
- } = action;
52
41
  return /*#__PURE__*/jsxRuntime.jsx(Link.default, {
53
- ref: ref,
54
- className: "np-header__link",
55
- href: href,
56
- target: target,
57
- "aria-label": ariaLabel,
58
- onClick: linkOnClick,
59
- children: text
42
+ href: action.href,
43
+ target: action.target,
44
+ onClick: action.onClick,
45
+ ...props,
46
+ children: action.text
60
47
  });
61
48
  }
62
49
  return /*#__PURE__*/jsxRuntime.jsx(Button_resolver.default, {
63
- ref: ref,
64
50
  className: "np-header__button",
65
51
  priority: "tertiary",
66
52
  size: "sm",
67
- "aria-label": ariaLabel,
68
- onClick: onClick,
69
- children: text
53
+ onClick: action.onClick,
54
+ ...props,
55
+ children: action.text
70
56
  });
71
- });
72
- HeaderAction.displayName = 'HeaderAction';
57
+ };
73
58
  /**
74
- * @param {ButtonActionProps | LinkActionProps} [action] - Optional prop to specify the action button or link.
75
- * @param {Heading | 'legend'} [as='h5'] - Optional prop to override the heading element rendered for the title.
76
- * @param {string} title - Required prop to set the title of the section header.
77
- * @param {'group' | 'section'} [level='group'] - Optional prop to specify the level of the section header.
78
- * @param {string} [className]
79
- * @param {string} [testId]
80
59
  *
81
- * @see {@link Header } for further information.
82
- * @see {@link https://storybook.wise.design/?path=/docs/typography-header--docs|Storybook Wise Design}
60
+ * Neptune Web: https://transferwise.github.io/neptune-web/components/content/Header
61
+ *
83
62
  */
84
- const Header = /*#__PURE__*/React__default.default.forwardRef(({
85
- as = 'h5',
63
+ const Header = ({
64
+ id,
86
65
  action,
87
- className,
88
- testId,
66
+ as = 'h5',
89
67
  title,
90
- level = 'group',
91
- ...props
92
- }, ref) => {
93
- const internalRef = React.useRef(null);
94
- const levelTypography = level === 'section' ? typography.Typography.TITLE_SUBSECTION : typography.Typography.TITLE_GROUP;
95
- const headerClasses = clsx.clsx('np-header', className, {
96
- 'np-header--section': level === 'section',
97
- 'np-header__title': !action || as === 'legend'
98
- });
99
- const commonProps = {
100
- className: headerClasses,
101
- 'data-testid': testId
102
- };
103
- React.useEffect(() => {
104
- if (as === 'legend' && internalRef.current) {
105
- const {
106
- parentElement
107
- } = internalRef.current;
108
- if (!parentElement || parentElement.tagName.toLowerCase() !== 'fieldset') {
109
- console.warn('Legends should be the first child in a fieldset, and this is not possible when including an action');
110
- }
111
- }
112
- }, [as]);
113
- if (!action || as === 'legend') {
68
+ className,
69
+ role = undefined
70
+ }) => {
71
+ if (!action) {
114
72
  return /*#__PURE__*/jsxRuntime.jsx(Title.default, {
115
- ref: internalRef,
116
73
  as: as,
117
- type: levelTypography,
118
- ...commonProps,
119
- ...props,
74
+ id: id,
75
+ role: role,
76
+ type: typography.Typography.TITLE_GROUP,
77
+ className: clsx.clsx('np-header', 'np-header__title', className),
120
78
  children: title
121
79
  });
122
80
  }
123
- const actionRef = /*#__PURE__*/React__default.default.createRef();
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
+ }
124
85
  return /*#__PURE__*/jsxRuntime.jsxs("div", {
125
- ...commonProps,
126
- ...props,
127
- ref: ref,
86
+ className: clsx.clsx('np-header', className),
128
87
  children: [/*#__PURE__*/jsxRuntime.jsx(Title.default, {
129
88
  as: as,
130
- type: levelTypography,
89
+ type: typography.Typography.TITLE_GROUP,
90
+ id: id,
131
91
  className: "np-header__title",
132
92
  children: title
133
93
  }), /*#__PURE__*/jsxRuntime.jsx(HeaderAction, {
134
- ref: actionRef,
135
94
  action: action
136
95
  })]
137
96
  });
138
- });
139
- Header.displayName = 'Header';
97
+ };
140
98
 
99
+ exports.Header = Header;
141
100
  exports.default = Header;
142
101
  //# sourceMappingURL=Header.js.map
@@ -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 Link from '../link';\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 * Additionally, the `action` prop is not supported when `as=\"legend\"`.\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 { 'aria-label': ariaLabel, text, onClick } = action;\n\n if ('href' in action) {\n const { href, target, onClick: linkOnClick } = action;\n return (\n <Link\n ref={ref as React.Ref<HTMLAnchorElement>}\n className=\"np-header__link\"\n href={href}\n target={target}\n aria-label={ariaLabel}\n onClick={linkOnClick}\n >\n {text}\n </Link>\n );\n }\n\n return (\n <Button\n ref={ref as React.Ref<HTMLButtonElement>}\n className=\"np-header__button\"\n priority=\"tertiary\"\n size=\"sm\"\n aria-label={ariaLabel}\n onClick={onClick}\n >\n {text}\n </Button>\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 levelTypography =\n level === 'section' ? Typography.TITLE_SUBSECTION : Typography.TITLE_GROUP;\n const headerClasses = clsx('np-header', className, {\n 'np-header--section': level === 'section',\n 'np-header__title': !action || as === 'legend',\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 || as === 'legend') {\n return (\n <Title ref={internalRef} as={as} type={levelTypography} {...commonProps} {...props}>\n {title}\n </Title>\n );\n }\n\n const actionRef = React.createRef<HTMLButtonElement | HTMLAnchorElement>();\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","ariaLabel","text","onClick","href","target","linkOnClick","_jsx","Link","className","children","Button","priority","size","displayName","Header","as","testId","title","level","props","internalRef","useRef","levelTypography","Typography","TITLE_SUBSECTION","TITLE_GROUP","headerClasses","clsx","commonProps","useEffect","current","parentElement","tagName","toLowerCase","console","warn","Title","type","actionRef","createRef","_jsxs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoDA,MAAMA,YAAY,gBAAGC,sBAAK,CAACC,UAAU,CACnC,CACE;AAAEC,EAAAA,MAAAA;AAAM,CAAmD,EAC3DC,GAAqD,KACnD;EACF,MAAM;AAAE,IAAA,YAAY,EAAEC,SAAS;IAAEC,IAAI;AAAEC,IAAAA,OAAAA;AAAO,GAAE,GAAGJ,MAAM,CAAA;EAEzD,IAAI,MAAM,IAAIA,MAAM,EAAE;IACpB,MAAM;MAAEK,IAAI;MAAEC,MAAM;AAAEF,MAAAA,OAAO,EAAEG,WAAAA;AAAW,KAAE,GAAGP,MAAM,CAAA;IACrD,oBACEQ,cAAA,CAACC,YAAI,EAAA;A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kB;AAAAC,MAAAA,QAAA,EAC/DQ,KAAAA;AAAK,KACD,CACP,eAAAX,cAAA,CAACX,YAAY,EAAA;AAACI,MAAAA,GAAG,EAAEuC,SAAU;AAACxC,MAAAA,MAAM,EAAEA,MAAAA;AAAO,KAC/C,CAAA,CAAA;AAAA,GAAK,CAAC,CAAA;AAEV,CAAC,EACF;AAEDgB,MAAM,CAACD,WAAW,GAAG,QAAQ;;;;"}
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,MAAAA;AAAM,CAAmD,KAAI;AACnF,EAAA,MAAMC,KAAK,GAAG;IACZ,YAAY,EAAED,MAAM,CAAC,YAAY,CAAA;GAClC,CAAA;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,IAAAA;AAAI,KACR,CAAC,CAAA;AAEX,GAAA;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,IAAAA;AAAI,GACN,CAAC,CAAA;AAEb,CAAC,CAAA;AAED;;;;AAIG;AACI,MAAMK,MAAM,GAAGA,CAAC;EACrBC,EAAE;EACFd,MAAM;AACNe,EAAAA,EAAE,GAAG,IAAI;EACTC,KAAK;EACLN,SAAS;AACTO,EAAAA,IAAI,GAAGC,SAAAA;AACK,CAAA,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,KAAAA;AAAK,KACD,CAAC,CAAA;AAEZ,GAAA;EAEA,IAAID,EAAE,KAAK,QAAQ,EAAE;AACnB;AACAS,IAAAA,OAAO,CAACC,IAAI,CACV,oGAAoG,CACrG,CAAA;AACH,GAAA;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,KAAAA;AAAK,KACD,CACP,eAAAd,cAAA,CAACH,YAAY,EAAA;AAACC,MAAAA,MAAM,EAAEA,MAAAA;AAAO,KAC/B,CAAA,CAAA;AAAA,GAAK,CAAC,CAAA;AAEV;;;;;"}
@@ -1,4 +1,5 @@
1
1
  import { clsx } from 'clsx';
2
+ import Button from '../button/Button.resolver.mjs';
2
3
  import '../common/theme.mjs';
3
4
  import '../common/direction.mjs';
4
5
  import '../common/propsValues/control.mjs';
@@ -19,116 +20,77 @@ import '../common/propsValues/scroll.mjs';
19
20
  import '../common/propsValues/markdownNodeType.mjs';
20
21
  import '../common/fileType.mjs';
21
22
  import '@transferwise/icons';
22
- import React__default, { useRef, useEffect } from 'react';
23
+ import 'react';
23
24
  import 'react-intl';
24
25
  import '../common/closeButton/CloseButton.messages.mjs';
25
26
  import { jsx, jsxs } from 'react/jsx-runtime';
26
27
  import Link from '../link/Link.mjs';
27
- import Button from '../button/Button.resolver.mjs';
28
28
  import Title from '../title/Title.mjs';
29
29
 
30
- const HeaderAction = /*#__PURE__*/React__default.forwardRef(({
30
+ const HeaderAction = ({
31
31
  action
32
- }, ref) => {
33
- const {
34
- 'aria-label': ariaLabel,
35
- text,
36
- onClick
37
- } = action;
32
+ }) => {
33
+ const props = {
34
+ 'aria-label': action['aria-label']
35
+ };
38
36
  if ('href' in action) {
39
- const {
40
- href,
41
- target,
42
- onClick: linkOnClick
43
- } = action;
44
37
  return /*#__PURE__*/jsx(Link, {
45
- ref: ref,
46
- className: "np-header__link",
47
- href: href,
48
- target: target,
49
- "aria-label": ariaLabel,
50
- onClick: linkOnClick,
51
- children: text
38
+ href: action.href,
39
+ target: action.target,
40
+ onClick: action.onClick,
41
+ ...props,
42
+ children: action.text
52
43
  });
53
44
  }
54
45
  return /*#__PURE__*/jsx(Button, {
55
- ref: ref,
56
46
  className: "np-header__button",
57
47
  priority: "tertiary",
58
48
  size: "sm",
59
- "aria-label": ariaLabel,
60
- onClick: onClick,
61
- children: text
49
+ onClick: action.onClick,
50
+ ...props,
51
+ children: action.text
62
52
  });
63
- });
64
- HeaderAction.displayName = 'HeaderAction';
53
+ };
65
54
  /**
66
- * @param {ButtonActionProps | LinkActionProps} [action] - Optional prop to specify the action button or link.
67
- * @param {Heading | 'legend'} [as='h5'] - Optional prop to override the heading element rendered for the title.
68
- * @param {string} title - Required prop to set the title of the section header.
69
- * @param {'group' | 'section'} [level='group'] - Optional prop to specify the level of the section header.
70
- * @param {string} [className]
71
- * @param {string} [testId]
72
55
  *
73
- * @see {@link Header } for further information.
74
- * @see {@link https://storybook.wise.design/?path=/docs/typography-header--docs|Storybook Wise Design}
56
+ * Neptune Web: https://transferwise.github.io/neptune-web/components/content/Header
57
+ *
75
58
  */
76
- const Header = /*#__PURE__*/React__default.forwardRef(({
77
- as = 'h5',
59
+ const Header = ({
60
+ id,
78
61
  action,
79
- className,
80
- testId,
62
+ as = 'h5',
81
63
  title,
82
- level = 'group',
83
- ...props
84
- }, ref) => {
85
- const internalRef = useRef(null);
86
- const levelTypography = level === 'section' ? Typography.TITLE_SUBSECTION : Typography.TITLE_GROUP;
87
- const headerClasses = clsx('np-header', className, {
88
- 'np-header--section': level === 'section',
89
- 'np-header__title': !action || as === 'legend'
90
- });
91
- const commonProps = {
92
- className: headerClasses,
93
- 'data-testid': testId
94
- };
95
- 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]);
105
- if (!action || as === 'legend') {
64
+ className,
65
+ role = undefined
66
+ }) => {
67
+ if (!action) {
106
68
  return /*#__PURE__*/jsx(Title, {
107
- ref: internalRef,
108
69
  as: as,
109
- type: levelTypography,
110
- ...commonProps,
111
- ...props,
70
+ id: id,
71
+ role: role,
72
+ type: Typography.TITLE_GROUP,
73
+ className: clsx('np-header', 'np-header__title', className),
112
74
  children: title
113
75
  });
114
76
  }
115
- const actionRef = /*#__PURE__*/React__default.createRef();
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
+ }
116
81
  return /*#__PURE__*/jsxs("div", {
117
- ...commonProps,
118
- ...props,
119
- ref: ref,
82
+ className: clsx('np-header', className),
120
83
  children: [/*#__PURE__*/jsx(Title, {
121
84
  as: as,
122
- type: levelTypography,
85
+ type: Typography.TITLE_GROUP,
86
+ id: id,
123
87
  className: "np-header__title",
124
88
  children: title
125
89
  }), /*#__PURE__*/jsx(HeaderAction, {
126
- ref: actionRef,
127
90
  action: action
128
91
  })]
129
92
  });
130
- });
131
- Header.displayName = 'Header';
93
+ };
132
94
 
133
- export { Header as default };
95
+ export { Header, Header as default };
134
96
  //# sourceMappingURL=Header.mjs.map
@@ -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 Link from '../link';\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 * Additionally, the `action` prop is not supported when `as=\"legend\"`.\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 { 'aria-label': ariaLabel, text, onClick } = action;\n\n if ('href' in action) {\n const { href, target, onClick: linkOnClick } = action;\n return (\n <Link\n ref={ref as React.Ref<HTMLAnchorElement>}\n className=\"np-header__link\"\n href={href}\n target={target}\n aria-label={ariaLabel}\n onClick={linkOnClick}\n >\n {text}\n </Link>\n );\n }\n\n return (\n <Button\n ref={ref as React.Ref<HTMLButtonElement>}\n className=\"np-header__button\"\n priority=\"tertiary\"\n size=\"sm\"\n aria-label={ariaLabel}\n onClick={onClick}\n >\n {text}\n </Button>\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 levelTypography =\n level === 'section' ? Typography.TITLE_SUBSECTION : Typography.TITLE_GROUP;\n const headerClasses = clsx('np-header', className, {\n 'np-header--section': level === 'section',\n 'np-header__title': !action || as === 'legend',\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 || as === 'legend') {\n return (\n <Title ref={internalRef} as={as} type={levelTypography} {...commonProps} {...props}>\n {title}\n </Title>\n );\n }\n\n const actionRef = React.createRef<HTMLButtonElement | HTMLAnchorElement>();\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","ariaLabel","text","onClick","href","target","linkOnClick","_jsx","Link","className","children","Button","priority","size","displayName","Header","as","testId","title","level","props","internalRef","useRef","levelTypography","Typography","TITLE_SUBSECTION","TITLE_GROUP","headerClasses","clsx","commonProps","useEffect","current","parentElement","tagName","toLowerCase","console","warn","Title","type","actionRef","createRef","_jsxs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoDA,MAAMA,YAAY,gBAAGC,cAAK,CAACC,UAAU,CACnC,CACE;AAAEC,EAAAA,MAAAA;AAAM,CAAmD,EAC3DC,GAAqD,KACnD;EACF,MAAM;AAAE,IAAA,YAAY,EAAEC,SAAS;IAAEC,IAAI;AAAEC,IAAAA,OAAAA;AAAO,GAAE,GAAGJ,MAAM,CAAA;EAEzD,IAAI,MAAM,IAAIA,MAAM,EAAE;IACpB,MAAM;MAAEK,IAAI;MAAEC,MAAM;AAAEF,MAAAA,OAAO,EAAEG,WAAAA;AAAW,KAAE,GAAGP,MAAM,CAAA;IACrD,oBACEQ,GAAA,CAACC,IAAI,EAAA;AACHR,MAAAA,GAAG,EAAEA,GAAoC;AACzCS,MAAAA,SAAS,EAAC,iBAAiB;AAC3BL,MAAAA,IAAI,EAAEA,IAAK;AACXC,MAAAA,MAAM,EAAEA,MAAO;AACf,MAAA,YAAA,EAAYJ,SAAU;AACtBE,MAAAA,OAAO,EAAEG,WAAY;AAAAI,MAAAA,QAAA,EAEpBR,IAA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AACD,WAAW,GAAG,QAAQ;;;;"}
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,MAAAA;AAAM,CAAmD,KAAI;AACnF,EAAA,MAAMC,KAAK,GAAG;IACZ,YAAY,EAAED,MAAM,CAAC,YAAY,CAAA;GAClC,CAAA;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,MAAM,CAACM,OAAQ;AAAA,MAAA,GAAKL,KAAK;MAAAM,QAAA,EAC/EP,MAAM,CAACQ,IAAAA;AAAI,KACR,CAAC,CAAA;AAEX,GAAA;EAEA,oBACEN,GAAA,CAACO,MAAM,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,IAAAA;AAAI,GACN,CAAC,CAAA;AAEb,CAAC,CAAA;AAED;;;;AAIG;AACI,MAAMK,MAAM,GAAGA,CAAC;EACrBC,EAAE;EACFd,MAAM;AACNe,EAAAA,EAAE,GAAG,IAAI;EACTC,KAAK;EACLN,SAAS;AACTO,EAAAA,IAAI,GAAGC,SAAAA;AACK,CAAA,KAAI;EAChB,IAAI,CAAClB,MAAM,EAAE;IACX,oBACEE,GAAA,CAACiB,KAAK,EAAA;AACJJ,MAAAA,EAAE,EAAEA,EAAG;AACPD,MAAAA,EAAE,EAAEA,EAAG;AACPG,MAAAA,IAAI,EAAEA,IAAK;MACXG,IAAI,EAAEC,UAAU,CAACC,WAAY;MAC7BZ,SAAS,EAAEa,IAAI,CAAC,WAAW,EAAE,kBAAkB,EAAEb,SAAS,CAAE;AAAAH,MAAAA,QAAA,EAE3DS,KAAAA;AAAK,KACD,CAAC,CAAA;AAEZ,GAAA;EAEA,IAAID,EAAE,KAAK,QAAQ,EAAE;AACnB;AACAS,IAAAA,OAAO,CAACC,IAAI,CACV,oGAAoG,CACrG,CAAA;AACH,GAAA;AAEA,EAAA,oBACEC,IAAA,CAAA,KAAA,EAAA;AAAKhB,IAAAA,SAAS,EAAEa,IAAI,CAAC,WAAW,EAAEb,SAAS,CAAE;IAAAH,QAAA,EAAA,cAC3CL,GAAA,CAACiB,KAAK,EAAA;AAACJ,MAAAA,EAAE,EAAEA,EAAG;MAACK,IAAI,EAAEC,UAAU,CAACC,WAAY;AAACR,MAAAA,EAAE,EAAEA,EAAG;AAACJ,MAAAA,SAAS,EAAC,kBAAkB;AAAAH,MAAAA,QAAA,EAC9ES,KAAAA;AAAK,KACD,CACP,eAAAd,GAAA,CAACH,YAAY,EAAA;AAACC,MAAAA,MAAM,EAAEA,MAAAA;AAAO,KAC/B,CAAA,CAAA;AAAA,GAAK,CAAC,CAAA;AAEV;;;;"}
package/build/index.js CHANGED
@@ -201,7 +201,7 @@ exports.DropFade = DropFade.default;
201
201
  exports.Emphasis = Emphasis.default;
202
202
  exports.Field = Field.Field;
203
203
  exports.FlowNavigation = FlowNavigation.default;
204
- exports.Header = Header.default;
204
+ exports.Header = Header.Header;
205
205
  Object.defineProperty(exports, "InfoPresentation", {
206
206
  enumerable: true,
207
207
  get: function () { return infoPresentations.InfoPresentation; }
package/build/index.mjs CHANGED
@@ -46,7 +46,7 @@ export { default as DropFade } from './dropFade/DropFade.mjs';
46
46
  export { default as Emphasis } from './emphasis/Emphasis.mjs';
47
47
  export { Field } from './field/Field.mjs';
48
48
  export { default as FlowNavigation } from './flowNavigation/FlowNavigation.mjs';
49
- export { default as Header } from './header/Header.mjs';
49
+ export { Header } from './header/Header.mjs';
50
50
  export { InfoPresentation } from './info/infoPresentations.mjs';
51
51
  export { default as Info } from './info/Info.mjs';
52
52
  export { default as InlineAlert } from './inlineAlert/InlineAlert.mjs';
@@ -603,7 +603,7 @@ function SelectInputGroupItemView({
603
603
  needle
604
604
  }) {
605
605
  const headerId = React.useId();
606
- const header = /*#__PURE__*/jsxRuntime.jsx(Header.default, {
606
+ const header = /*#__PURE__*/jsxRuntime.jsx(Header.Header, {
607
607
  as: "header",
608
608
  role: "none",
609
609
  id: headerId,