@transferwise/components 0.0.0-experimental-a41b256 → 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 -78
  2. package/build/header/Header.js.map +1 -1
  3. package/build/header/Header.mjs +38 -75
  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 -17
  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 -17
  15. package/build/styles/main.css +11 -17
  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 -17
  30. package/src/header/Header.less +8 -17
  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 -122
  34. package/src/header/index.ts +0 -1
  35. package/src/index.ts +0 -1
  36. package/src/main.css +11 -17
  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,119 +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
- href: href,
55
- target: target,
56
- "aria-label": ariaLabel,
57
- onClick: linkOnClick,
58
- children: text
42
+ href: action.href,
43
+ target: action.target,
44
+ onClick: action.onClick,
45
+ ...props,
46
+ children: action.text
59
47
  });
60
48
  }
61
49
  return /*#__PURE__*/jsxRuntime.jsx(Button_resolver.default, {
62
- ref: ref,
63
50
  className: "np-header__button",
64
51
  priority: "tertiary",
65
52
  size: "sm",
66
- "aria-label": ariaLabel,
67
- onClick: onClick,
68
- children: text
53
+ onClick: action.onClick,
54
+ ...props,
55
+ children: action.text
69
56
  });
70
- });
71
- HeaderAction.displayName = 'HeaderAction';
57
+ };
72
58
  /**
73
- * @param {ButtonActionProps | LinkActionProps} [action] - Optional prop to specify the action button or link.
74
- * @param {Heading | 'legend'} [as='h5'] - Optional prop to override the heading element rendered for the title.
75
- * @param {string} title - Required prop to set the title of the section header.
76
- * @param {'group' | 'section'} [level='group'] - Optional prop to specify the level of the section header.
77
- * @param {string} [className]
78
- * @param {string} [testId]
79
59
  *
80
- * @see {@link Header } for further information.
81
- * @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
+ *
82
62
  */
83
- const Header = /*#__PURE__*/React__default.default.forwardRef(({
84
- as = 'h5',
63
+ const Header = ({
64
+ id,
85
65
  action,
86
- className,
87
- testId,
66
+ as = 'h5',
88
67
  title,
89
- level = 'group',
90
- ...props
91
- }, ref) => {
92
- const internalRef = React.useRef(null);
93
- const levelTypography = level === 'section' ? typography.Typography.TITLE_SUBSECTION : typography.Typography.TITLE_GROUP;
94
- const headerClasses = clsx.clsx('np-header', className, {
95
- 'np-header--section': level === 'section',
96
- 'np-header__title': !action || as === 'legend'
97
- });
98
- const commonProps = {
99
- className: headerClasses,
100
- 'data-testid': testId
101
- };
102
- React.useEffect(() => {
103
- if (as === 'legend' && internalRef.current) {
104
- const {
105
- parentElement
106
- } = internalRef.current;
107
- if (!parentElement || parentElement.tagName.toLowerCase() !== 'fieldset') {
108
- console.warn('Legends should be the first child in a fieldset, and this is not possible when including an action');
109
- }
110
- }
111
- }, [as]);
112
- if (!action || as === 'legend') {
68
+ className,
69
+ role = undefined
70
+ }) => {
71
+ if (!action) {
113
72
  return /*#__PURE__*/jsxRuntime.jsx(Title.default, {
114
- ref: internalRef,
115
73
  as: as,
116
- type: levelTypography,
117
- ...commonProps,
118
- ...props,
74
+ id: id,
75
+ role: role,
76
+ type: typography.Typography.TITLE_GROUP,
77
+ className: clsx.clsx('np-header', 'np-header__title', className),
119
78
  children: title
120
79
  });
121
80
  }
122
- 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
+ }
123
85
  return /*#__PURE__*/jsxRuntime.jsxs("div", {
124
- ...commonProps,
125
- ...props,
126
- ref: ref,
86
+ className: clsx.clsx('np-header', className),
127
87
  children: [/*#__PURE__*/jsxRuntime.jsx(Title.default, {
128
88
  as: as,
129
- type: levelTypography,
89
+ type: typography.Typography.TITLE_GROUP,
90
+ id: id,
130
91
  className: "np-header__title",
131
92
  children: title
132
93
  }), /*#__PURE__*/jsxRuntime.jsx(HeaderAction, {
133
- ref: actionRef,
134
94
  action: action
135
95
  })]
136
96
  });
137
- });
138
- Header.displayName = 'Header';
97
+ };
139
98
 
99
+ exports.Header = Header;
140
100
  exports.default = Header;
141
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 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","children","Button","className","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;AACHR,MAAAA,GAAG,EAAEA,GAAoC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,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,115 +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
- href: href,
47
- target: target,
48
- "aria-label": ariaLabel,
49
- onClick: linkOnClick,
50
- children: text
38
+ href: action.href,
39
+ target: action.target,
40
+ onClick: action.onClick,
41
+ ...props,
42
+ children: action.text
51
43
  });
52
44
  }
53
45
  return /*#__PURE__*/jsx(Button, {
54
- ref: ref,
55
46
  className: "np-header__button",
56
47
  priority: "tertiary",
57
48
  size: "sm",
58
- "aria-label": ariaLabel,
59
- onClick: onClick,
60
- children: text
49
+ onClick: action.onClick,
50
+ ...props,
51
+ children: action.text
61
52
  });
62
- });
63
- HeaderAction.displayName = 'HeaderAction';
53
+ };
64
54
  /**
65
- * @param {ButtonActionProps | LinkActionProps} [action] - Optional prop to specify the action button or link.
66
- * @param {Heading | 'legend'} [as='h5'] - Optional prop to override the heading element rendered for the title.
67
- * @param {string} title - Required prop to set the title of the section header.
68
- * @param {'group' | 'section'} [level='group'] - Optional prop to specify the level of the section header.
69
- * @param {string} [className]
70
- * @param {string} [testId]
71
55
  *
72
- * @see {@link Header } for further information.
73
- * @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
+ *
74
58
  */
75
- const Header = /*#__PURE__*/React__default.forwardRef(({
76
- as = 'h5',
59
+ const Header = ({
60
+ id,
77
61
  action,
78
- className,
79
- testId,
62
+ as = 'h5',
80
63
  title,
81
- level = 'group',
82
- ...props
83
- }, ref) => {
84
- const internalRef = useRef(null);
85
- const levelTypography = level === 'section' ? Typography.TITLE_SUBSECTION : Typography.TITLE_GROUP;
86
- const headerClasses = clsx('np-header', className, {
87
- 'np-header--section': level === 'section',
88
- 'np-header__title': !action || as === 'legend'
89
- });
90
- const commonProps = {
91
- className: headerClasses,
92
- 'data-testid': testId
93
- };
94
- useEffect(() => {
95
- if (as === 'legend' && internalRef.current) {
96
- const {
97
- parentElement
98
- } = internalRef.current;
99
- if (!parentElement || parentElement.tagName.toLowerCase() !== 'fieldset') {
100
- console.warn('Legends should be the first child in a fieldset, and this is not possible when including an action');
101
- }
102
- }
103
- }, [as]);
104
- if (!action || as === 'legend') {
64
+ className,
65
+ role = undefined
66
+ }) => {
67
+ if (!action) {
105
68
  return /*#__PURE__*/jsx(Title, {
106
- ref: internalRef,
107
69
  as: as,
108
- type: levelTypography,
109
- ...commonProps,
110
- ...props,
70
+ id: id,
71
+ role: role,
72
+ type: Typography.TITLE_GROUP,
73
+ className: clsx('np-header', 'np-header__title', className),
111
74
  children: title
112
75
  });
113
76
  }
114
- 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
+ }
115
81
  return /*#__PURE__*/jsxs("div", {
116
- ...commonProps,
117
- ...props,
118
- ref: ref,
82
+ className: clsx('np-header', className),
119
83
  children: [/*#__PURE__*/jsx(Title, {
120
84
  as: as,
121
- type: levelTypography,
85
+ type: Typography.TITLE_GROUP,
86
+ id: id,
122
87
  className: "np-header__title",
123
88
  children: title
124
89
  }), /*#__PURE__*/jsx(HeaderAction, {
125
- ref: actionRef,
126
90
  action: action
127
91
  })]
128
92
  });
129
- });
130
- Header.displayName = 'Header';
93
+ };
131
94
 
132
- export { Header as default };
95
+ export { Header, Header as default };
133
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 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","children","Button","className","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;AACzCI,MAAAA,IAAI,EAAEA,IAAK;AACXC,MAAAA,MAAM,EAAEA,MAAO;AACf,MAAA,YAAA,EAAYJ,SAAU;AACtBE,MAAAA,OAAO,EAAEG,WAAY;AAAAG,MAAAA,QAAA,EAEpBP,IAAAA;AAAI,KACD,CAAC,CAAA;AAEX,GAAA;EAEA,oBACEK,GAAA,CAACG,MAAM,EAAA;AACLV,IAAAA,GAAG,EAAEA,GAAoC;AACzCW,IAAAA,SAAS,EAAC,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CAACC,OAAO,CAACC,WAAW,EAAE,KAAK,UAAU,EAAE;AACxEC,QAAAA,OAAO,CAACC,IAAI,CACV,oGAAoG,CACrG,CAAA;AACH,OAAA;AACF,KAAA;AACF,GAAC,EAAE,CAACpB,EAAE,CAAC,CAAC,CAAA;AAER,EAAA,IAAI,CAACjB,MAAM,IAAIiB,EAAE,KAAK,QAAQ,EAAE;IAC9B,oBACET,GAAA,CAAC8B,KAAK,EAAA;AAACrC,MAAAA,GAAG,EAAEqB,WAAY;AAACL,MAAAA,EAAE,EAAEA,EAAG;AAACsB,MAAAA,IAAI,EAAEf,eAAgB;AAAA,MAAA,GAAKM,WAAW;AAAA,MAAA,GAAMT,KAAK;AAAAX,MAAAA,QAAA,EAC/ES,KAAAA;AAAK,KACD,CAAC,CAAA;AAEZ,GAAA;AAEA,EAAA,MAAMqB,SAAS,gBAAG1C,cAAK,CAAC2C,SAAS,EAAyC,CAAA;AAE1E,EAAA,oBACEC,IAAA,CAAA,KAAA,EAAA;AAAA,IAAA,GAASZ,WAAW;AAAA,IAAA,GAAMT,KAAK;AAAEpB,IAAAA,GAAG,EAAEA,GAAiC;IAAAS,QAAA,EAAA,cACrEF,GAAA,CAAC8B,KAAK,EAAA;AAACrB,MAAAA,EAAE,EAAEA,EAAG;AAACsB,MAAAA,IAAI,EAAEf,eAAgB;AAACZ,MAAAA,SAAS,EAAC,kBAAkB;AAAAF,MAAAA,QAAA,EAC/DS,KAAAA;AAAK,KACD,CACP,eAAAX,GAAA,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.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,