@transferwise/components 0.0.0-experimental-e0993c8 → 0.0.0-experimental-0ffb1f6

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 (107) hide show
  1. package/build/actionOption/ActionOption.js.map +1 -1
  2. package/build/actionOption/ActionOption.mjs.map +1 -1
  3. package/build/checkboxOption/CheckboxOption.js.map +1 -1
  4. package/build/checkboxOption/CheckboxOption.mjs.map +1 -1
  5. package/build/header/Header.js +41 -79
  6. package/build/header/Header.js.map +1 -1
  7. package/build/header/Header.mjs +41 -76
  8. package/build/header/Header.mjs.map +1 -1
  9. package/build/i18n/cs.json +2 -0
  10. package/build/i18n/cs.json.js +2 -0
  11. package/build/i18n/cs.json.js.map +1 -1
  12. package/build/i18n/cs.json.mjs +2 -0
  13. package/build/i18n/cs.json.mjs.map +1 -1
  14. package/build/i18n/th.json +2 -0
  15. package/build/i18n/th.json.js +2 -0
  16. package/build/i18n/th.json.js.map +1 -1
  17. package/build/i18n/th.json.mjs +2 -0
  18. package/build/i18n/th.json.mjs.map +1 -1
  19. package/build/index.js +1 -1
  20. package/build/index.mjs +1 -1
  21. package/build/inputs/SelectInput.js +1 -1
  22. package/build/inputs/SelectInput.js.map +1 -1
  23. package/build/inputs/SelectInput.mjs +1 -1
  24. package/build/legacylistItem/LegacyListItem.js.map +1 -1
  25. package/build/legacylistItem/LegacyListItem.mjs.map +1 -1
  26. package/build/main.css +14 -32
  27. package/build/navigationOption/NavigationOption.js.map +1 -1
  28. package/build/navigationOption/NavigationOption.mjs.map +1 -1
  29. package/build/navigationOptionsList/NavigationOptionsList.js.map +1 -1
  30. package/build/navigationOptionsList/NavigationOptionsList.mjs.map +1 -1
  31. package/build/radioOption/RadioOption.js.map +1 -1
  32. package/build/radioOption/RadioOption.mjs.map +1 -1
  33. package/build/styles/header/Header.css +14 -32
  34. package/build/styles/main.css +14 -32
  35. package/build/summary/Summary.js +8 -0
  36. package/build/summary/Summary.js.map +1 -1
  37. package/build/summary/Summary.mjs +8 -0
  38. package/build/summary/Summary.mjs.map +1 -1
  39. package/build/switchOption/SwitchOption.js +8 -0
  40. package/build/switchOption/SwitchOption.js.map +1 -1
  41. package/build/switchOption/SwitchOption.mjs +8 -0
  42. package/build/switchOption/SwitchOption.mjs.map +1 -1
  43. package/build/title/Title.js +4 -10
  44. package/build/title/Title.js.map +1 -1
  45. package/build/title/Title.mjs +4 -6
  46. package/build/title/Title.mjs.map +1 -1
  47. package/build/types/actionOption/ActionOption.d.ts +8 -0
  48. package/build/types/actionOption/ActionOption.d.ts.map +1 -1
  49. package/build/types/checkboxOption/CheckboxOption.d.ts +8 -0
  50. package/build/types/checkboxOption/CheckboxOption.d.ts.map +1 -1
  51. package/build/types/header/Header.d.ts +11 -28
  52. package/build/types/header/Header.d.ts.map +1 -1
  53. package/build/types/header/index.d.ts +0 -1
  54. package/build/types/header/index.d.ts.map +1 -1
  55. package/build/types/index.d.ts +0 -1
  56. package/build/types/index.d.ts.map +1 -1
  57. package/build/types/legacylistItem/LegacyListItem.d.ts +8 -0
  58. package/build/types/legacylistItem/LegacyListItem.d.ts.map +1 -1
  59. package/build/types/navigationOption/NavigationOption.d.ts +8 -0
  60. package/build/types/navigationOption/NavigationOption.d.ts.map +1 -1
  61. package/build/types/navigationOptionsList/NavigationOptionsList.d.ts +9 -0
  62. package/build/types/navigationOptionsList/NavigationOptionsList.d.ts.map +1 -1
  63. package/build/types/radioOption/RadioOption.d.ts +8 -0
  64. package/build/types/radioOption/RadioOption.d.ts.map +1 -1
  65. package/build/types/summary/Summary.d.ts +8 -0
  66. package/build/types/summary/Summary.d.ts.map +1 -1
  67. package/build/types/switchOption/SwitchOption.d.ts +8 -0
  68. package/build/types/switchOption/SwitchOption.d.ts.map +1 -1
  69. package/build/types/title/Title.d.ts +5 -4
  70. package/build/types/title/Title.d.ts.map +1 -1
  71. package/package.json +1 -1
  72. package/src/actionButton/ActionButton.story.tsx +1 -1
  73. package/src/actionOption/ActionOption.story.tsx +4 -0
  74. package/src/actionOption/ActionOption.tsx +8 -0
  75. package/src/avatar/Avatar.story.tsx +1 -1
  76. package/src/avatarWrapper/AvatarWrapper.story.tsx +1 -1
  77. package/src/badge/Badge.story.tsx +1 -1
  78. package/src/button/Button.story.tsx +1 -1
  79. package/src/button/LegacyButton.story.tsx +1 -1
  80. package/src/checkboxOption/CheckboxOption.story.tsx +4 -0
  81. package/src/checkboxOption/CheckboxOption.tsx +8 -0
  82. package/src/header/Header.css +14 -32
  83. package/src/header/Header.less +9 -28
  84. package/src/header/Header.spec.tsx +50 -68
  85. package/src/header/Header.story.tsx +36 -190
  86. package/src/header/Header.tsx +70 -122
  87. package/src/header/index.ts +0 -1
  88. package/src/i18n/cs.json +2 -0
  89. package/src/i18n/th.json +2 -0
  90. package/src/index.ts +0 -1
  91. package/src/legacylistItem/LegacyListItem.story.tsx +4 -0
  92. package/src/legacylistItem/LegacyListItem.tsx +8 -0
  93. package/src/listItem/_stories/ListItem.story.tsx +1 -1
  94. package/src/main.css +14 -32
  95. package/src/navigationOption/NavigationOption.story.tsx +4 -1
  96. package/src/navigationOption/NavigationOption.tsx +8 -0
  97. package/src/navigationOptionsList/NavigationOptionsList.story.tsx +4 -0
  98. package/src/navigationOptionsList/NavigationOptionsList.tsx +9 -0
  99. package/src/radioOption/RadioOption.story.tsx +4 -0
  100. package/src/radioOption/RadioOption.tsx +8 -0
  101. package/src/select/Select.story.tsx +1 -1
  102. package/src/summary/Summary.story.tsx +4 -0
  103. package/src/summary/Summary.tsx +8 -0
  104. package/src/switchOption/SwitchOption.story.tsx +4 -1
  105. package/src/switchOption/SwitchOption.tsx +8 -0
  106. package/src/title/Title.tsx +12 -25
  107. package/src/header/Header.accessibility.docs.mdx +0 -85
@@ -1 +1 @@
1
- {"version":3,"file":"ActionOption.js","sources":["../../src/actionOption/ActionOption.tsx"],"sourcesContent":["import { clsx } from 'clsx';\n\nimport Button from '../button';\nimport {\n AriaLabelProperty,\n CommonProps,\n Priority,\n PriorityPrimary,\n PrioritySecondary,\n PriorityTertiary,\n} from '../common';\nimport Option from '../common/Option';\nimport { ButtonPriority } from '../button/Button.types';\n\ntype ActionOptionPriority =\n | PriorityPrimary\n | PrioritySecondary\n | PriorityTertiary\n | 'secondary-send';\n\nexport type ActionOptionProps = {\n complex?: boolean;\n content?: React.ReactNode;\n disabled?: boolean;\n media?: React.ReactNode;\n showMediaAtAllSizes?: boolean;\n onClick: () => void;\n title: React.ReactNode;\n additionalContent?: React.ReactNode;\n action: React.ReactNode;\n priority?: ActionOptionPriority;\n showMediaCircle?: boolean;\n isContainerAligned?: boolean;\n as?: React.ElementType;\n} & CommonProps &\n AriaLabelProperty;\n\nconst ActionOption = ({\n action,\n priority = Priority.PRIMARY,\n disabled,\n onClick,\n media,\n title,\n content,\n additionalContent,\n complex,\n className,\n showMediaAtAllSizes,\n showMediaCircle,\n isContainerAligned,\n as,\n 'aria-label': ariaLabel,\n}: ActionOptionProps) => {\n const sharedProps = {\n media,\n title,\n content,\n complex,\n disabled,\n showMediaAtAllSizes,\n showMediaCircle,\n className: clsx('tw-action-option', className),\n isContainerAligned,\n additionalContent,\n as,\n };\n\n const getAriaLabel = (): string | undefined => {\n if (ariaLabel) {\n return ariaLabel;\n }\n\n const generatedLabels: string[] = [];\n\n if (typeof title === 'string') {\n generatedLabels.push(title);\n }\n\n if (typeof action === 'string') {\n generatedLabels.push(action);\n }\n\n return generatedLabels.join(', ') || undefined;\n };\n\n const mapPriority = (priority: ActionOptionPriority): ButtonPriority => {\n switch (priority) {\n case 'primary':\n return 'primary';\n case 'secondary':\n return 'secondary-neutral';\n case 'tertiary':\n return 'tertiary';\n case 'secondary-send':\n return 'secondary';\n default:\n return 'primary';\n }\n };\n\n return (\n <Option\n {...sharedProps}\n button={\n <Button\n v2\n size=\"sm\"\n priority={mapPriority(priority)}\n disabled={disabled}\n aria-label={getAriaLabel()}\n onClick={onClick}\n >\n {action}\n </Button>\n }\n />\n );\n};\n\nexport default ActionOption;\n"],"names":["ActionOption","action","priority","Priority","PRIMARY","disabled","onClick","media","title","content","additionalContent","complex","className","showMediaAtAllSizes","showMediaCircle","isContainerAligned","as","ariaLabel","sharedProps","clsx","getAriaLabel","generatedLabels","push","join","undefined","mapPriority","_jsx","Option","button","Button","v2","size","children"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCA,MAAMA,YAAY,GAAGA,CAAC;EACpBC,MAAM;EACNC,QAAQ,GAAGC,gBAAQ,CAACC,OAAO;EAC3BC,QAAQ;EACRC,OAAO;EACPC,KAAK;EACLC,KAAK;EACLC,OAAO;EACPC,iBAAiB;EACjBC,OAAO;EACPC,SAAS;EACTC,mBAAmB;EACnBC,eAAe;EACfC,kBAAkB;EAClBC,EAAE;AACF,EAAA,YAAY,EAAEC;AAAS,CACL,KAAI;AACtB,EAAA,MAAMC,WAAW,GAAG;IAClBX,KAAK;IACLC,KAAK;IACLC,OAAO;IACPE,OAAO;IACPN,QAAQ;IACRQ,mBAAmB;IACnBC,eAAe;AACfF,IAAAA,SAAS,EAAEO,SAAI,CAAC,kBAAkB,EAAEP,SAAS,CAAC;IAC9CG,kBAAkB;IAClBL,iBAAiB;AACjBM,IAAAA;GACD;EAED,MAAMI,YAAY,GAAGA,MAAyB;AAC5C,IAAA,IAAIH,SAAS,EAAE;AACb,MAAA,OAAOA,SAAS;AAClB,IAAA;IAEA,MAAMI,eAAe,GAAa,EAAE;AAEpC,IAAA,IAAI,OAAOb,KAAK,KAAK,QAAQ,EAAE;AAC7Ba,MAAAA,eAAe,CAACC,IAAI,CAACd,KAAK,CAAC;AAC7B,IAAA;AAEA,IAAA,IAAI,OAAOP,MAAM,KAAK,QAAQ,EAAE;AAC9BoB,MAAAA,eAAe,CAACC,IAAI,CAACrB,MAAM,CAAC;AAC9B,IAAA;AAEA,IAAA,OAAOoB,eAAe,CAACE,IAAI,CAAC,IAAI,CAAC,IAAIC,SAAS;EAChD,CAAC;EAED,MAAMC,WAAW,GAAIvB,QAA8B,IAAoB;AACrE,IAAA,QAAQA,QAAQ;AACd,MAAA,KAAK,SAAS;AACZ,QAAA,OAAO,SAAS;AAClB,MAAA,KAAK,WAAW;AACd,QAAA,OAAO,mBAAmB;AAC5B,MAAA,KAAK,UAAU;AACb,QAAA,OAAO,UAAU;AACnB,MAAA,KAAK,gBAAgB;AACnB,QAAA,OAAO,WAAW;AACpB,MAAA;AACE,QAAA,OAAO,SAAS;AACpB;EACF,CAAC;EAED,oBACEwB,cAAA,CAACC,cAAM,EAAA;AAAA,IAAA,GACDT,WAAW;IACfU,MAAM,eACJF,cAAA,CAACG,uBAAM,EAAA;MACLC,EAAE,EAAA,IAAA;AACFC,MAAAA,IAAI,EAAC,IAAI;AACT7B,MAAAA,QAAQ,EAAEuB,WAAW,CAACvB,QAAQ,CAAE;AAChCG,MAAAA,QAAQ,EAAEA,QAAS;MACnB,YAAA,EAAYe,YAAY,EAAG;AAC3Bd,MAAAA,OAAO,EAAEA,OAAQ;AAAA0B,MAAAA,QAAA,EAEhB/B;KACK;AACT,GAAA,CACD;AAEN;;;;"}
1
+ {"version":3,"file":"ActionOption.js","sources":["../../src/actionOption/ActionOption.tsx"],"sourcesContent":["import { clsx } from 'clsx';\n\nimport Button from '../button';\nimport {\n AriaLabelProperty,\n CommonProps,\n Priority,\n PriorityPrimary,\n PrioritySecondary,\n PriorityTertiary,\n} from '../common';\nimport Option from '../common/Option';\nimport { ButtonPriority } from '../button/Button.types';\n\ntype ActionOptionPriority =\n | PriorityPrimary\n | PrioritySecondary\n | PriorityTertiary\n | 'secondary-send';\n\nexport type ActionOptionProps = {\n complex?: boolean;\n content?: React.ReactNode;\n disabled?: boolean;\n media?: React.ReactNode;\n showMediaAtAllSizes?: boolean;\n onClick: () => void;\n title: React.ReactNode;\n additionalContent?: React.ReactNode;\n action: React.ReactNode;\n priority?: ActionOptionPriority;\n showMediaCircle?: boolean;\n isContainerAligned?: boolean;\n as?: React.ElementType;\n} & CommonProps &\n AriaLabelProperty;\n\n/**\n * @deprecated Please use `<ListItem />` instead.\n * @deprecatedSince 46.104.0\n * @see [Source](../listItem/ListItem.tsx)\n * @see [Storybook](https://storybook.wise.design/?path=/docs/content-listitem--docs)\n * @see [Design docs](https://wise.design/components/list-item)\n * @see [Release notes](https://transferwise.atlassian.net/wiki/spaces/DS/pages/3647251055/List+Item+release+notes)\n */\nconst ActionOption = ({\n action,\n priority = Priority.PRIMARY,\n disabled,\n onClick,\n media,\n title,\n content,\n additionalContent,\n complex,\n className,\n showMediaAtAllSizes,\n showMediaCircle,\n isContainerAligned,\n as,\n 'aria-label': ariaLabel,\n}: ActionOptionProps) => {\n const sharedProps = {\n media,\n title,\n content,\n complex,\n disabled,\n showMediaAtAllSizes,\n showMediaCircle,\n className: clsx('tw-action-option', className),\n isContainerAligned,\n additionalContent,\n as,\n };\n\n const getAriaLabel = (): string | undefined => {\n if (ariaLabel) {\n return ariaLabel;\n }\n\n const generatedLabels: string[] = [];\n\n if (typeof title === 'string') {\n generatedLabels.push(title);\n }\n\n if (typeof action === 'string') {\n generatedLabels.push(action);\n }\n\n return generatedLabels.join(', ') || undefined;\n };\n\n const mapPriority = (priority: ActionOptionPriority): ButtonPriority => {\n switch (priority) {\n case 'primary':\n return 'primary';\n case 'secondary':\n return 'secondary-neutral';\n case 'tertiary':\n return 'tertiary';\n case 'secondary-send':\n return 'secondary';\n default:\n return 'primary';\n }\n };\n\n return (\n <Option\n {...sharedProps}\n button={\n <Button\n v2\n size=\"sm\"\n priority={mapPriority(priority)}\n disabled={disabled}\n aria-label={getAriaLabel()}\n onClick={onClick}\n >\n {action}\n </Button>\n }\n />\n );\n};\n\nexport default ActionOption;\n"],"names":["ActionOption","action","priority","Priority","PRIMARY","disabled","onClick","media","title","content","additionalContent","complex","className","showMediaAtAllSizes","showMediaCircle","isContainerAligned","as","ariaLabel","sharedProps","clsx","getAriaLabel","generatedLabels","push","join","undefined","mapPriority","_jsx","Option","button","Button","v2","size","children"],"mappings":";;;;;;;;;;;;;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BAAgB;AACnB,QAAA,OAAO,WAAW;AACpB,MAAA;AACE,QAAA,OAAO,SAAS;AACpB;EACF,CAAC;EAED,oBACEwB,cAAA,CAACC,cAAM,EAAA;AAAA,IAAA,GACDT,WAAW;IACfU,MAAM,eACJF,cAAA,CAACG,uBAAM,EAAA;MACLC,EAAE,EAAA,IAAA;AACFC,MAAAA,IAAI,EAAC,IAAI;AACT7B,MAAAA,QAAQ,EAAEuB,WAAW,CAACvB,QAAQ,CAAE;AAChCG,MAAAA,QAAQ,EAAEA,QAAS;MACnB,YAAA,EAAYe,YAAY,EAAG;AAC3Bd,MAAAA,OAAO,EAAEA,OAAQ;AAAA0B,MAAAA,QAAA,EAEhB/B;KACK;AACT,GAAA,CACD;AAEN;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ActionOption.mjs","sources":["../../src/actionOption/ActionOption.tsx"],"sourcesContent":["import { clsx } from 'clsx';\n\nimport Button from '../button';\nimport {\n AriaLabelProperty,\n CommonProps,\n Priority,\n PriorityPrimary,\n PrioritySecondary,\n PriorityTertiary,\n} from '../common';\nimport Option from '../common/Option';\nimport { ButtonPriority } from '../button/Button.types';\n\ntype ActionOptionPriority =\n | PriorityPrimary\n | PrioritySecondary\n | PriorityTertiary\n | 'secondary-send';\n\nexport type ActionOptionProps = {\n complex?: boolean;\n content?: React.ReactNode;\n disabled?: boolean;\n media?: React.ReactNode;\n showMediaAtAllSizes?: boolean;\n onClick: () => void;\n title: React.ReactNode;\n additionalContent?: React.ReactNode;\n action: React.ReactNode;\n priority?: ActionOptionPriority;\n showMediaCircle?: boolean;\n isContainerAligned?: boolean;\n as?: React.ElementType;\n} & CommonProps &\n AriaLabelProperty;\n\nconst ActionOption = ({\n action,\n priority = Priority.PRIMARY,\n disabled,\n onClick,\n media,\n title,\n content,\n additionalContent,\n complex,\n className,\n showMediaAtAllSizes,\n showMediaCircle,\n isContainerAligned,\n as,\n 'aria-label': ariaLabel,\n}: ActionOptionProps) => {\n const sharedProps = {\n media,\n title,\n content,\n complex,\n disabled,\n showMediaAtAllSizes,\n showMediaCircle,\n className: clsx('tw-action-option', className),\n isContainerAligned,\n additionalContent,\n as,\n };\n\n const getAriaLabel = (): string | undefined => {\n if (ariaLabel) {\n return ariaLabel;\n }\n\n const generatedLabels: string[] = [];\n\n if (typeof title === 'string') {\n generatedLabels.push(title);\n }\n\n if (typeof action === 'string') {\n generatedLabels.push(action);\n }\n\n return generatedLabels.join(', ') || undefined;\n };\n\n const mapPriority = (priority: ActionOptionPriority): ButtonPriority => {\n switch (priority) {\n case 'primary':\n return 'primary';\n case 'secondary':\n return 'secondary-neutral';\n case 'tertiary':\n return 'tertiary';\n case 'secondary-send':\n return 'secondary';\n default:\n return 'primary';\n }\n };\n\n return (\n <Option\n {...sharedProps}\n button={\n <Button\n v2\n size=\"sm\"\n priority={mapPriority(priority)}\n disabled={disabled}\n aria-label={getAriaLabel()}\n onClick={onClick}\n >\n {action}\n </Button>\n }\n />\n );\n};\n\nexport default ActionOption;\n"],"names":["ActionOption","action","priority","Priority","PRIMARY","disabled","onClick","media","title","content","additionalContent","complex","className","showMediaAtAllSizes","showMediaCircle","isContainerAligned","as","ariaLabel","sharedProps","clsx","getAriaLabel","generatedLabels","push","join","undefined","mapPriority","_jsx","Option","button","Button","v2","size","children"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCA,MAAMA,YAAY,GAAGA,CAAC;EACpBC,MAAM;EACNC,QAAQ,GAAGC,QAAQ,CAACC,OAAO;EAC3BC,QAAQ;EACRC,OAAO;EACPC,KAAK;EACLC,KAAK;EACLC,OAAO;EACPC,iBAAiB;EACjBC,OAAO;EACPC,SAAS;EACTC,mBAAmB;EACnBC,eAAe;EACfC,kBAAkB;EAClBC,EAAE;AACF,EAAA,YAAY,EAAEC;AAAS,CACL,KAAI;AACtB,EAAA,MAAMC,WAAW,GAAG;IAClBX,KAAK;IACLC,KAAK;IACLC,OAAO;IACPE,OAAO;IACPN,QAAQ;IACRQ,mBAAm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QAAA,EAEhB/B;KACK;AACT,GAAA,CACD;AAEN;;;;"}
1
+ {"version":3,"file":"ActionOption.mjs","sources":["../../src/actionOption/ActionOption.tsx"],"sourcesContent":["import { clsx } from 'clsx';\n\nimport Button from '../button';\nimport {\n AriaLabelProperty,\n CommonProps,\n Priority,\n PriorityPrimary,\n PrioritySecondary,\n PriorityTertiary,\n} from '../common';\nimport Option from '../common/Option';\nimport { ButtonPriority } from '../button/Button.types';\n\ntype ActionOptionPriority =\n | PriorityPrimary\n | PrioritySecondary\n | PriorityTertiary\n | 'secondary-send';\n\nexport type ActionOptionProps = {\n complex?: boolean;\n content?: React.ReactNode;\n disabled?: boolean;\n media?: React.ReactNode;\n showMediaAtAllSizes?: boolean;\n onClick: () => void;\n title: React.ReactNode;\n additionalContent?: React.ReactNode;\n action: React.ReactNode;\n priority?: ActionOptionPriority;\n showMediaCircle?: boolean;\n isContainerAligned?: boolean;\n as?: React.ElementType;\n} & CommonProps &\n AriaLabelProperty;\n\n/**\n * @deprecated Please use `<ListItem />` instead.\n * @deprecatedSince 46.104.0\n * @see [Source](../listItem/ListItem.tsx)\n * @see [Storybook](https://storybook.wise.design/?path=/docs/content-listitem--docs)\n * @see [Design docs](https://wise.design/components/list-item)\n * @see [Release notes](https://transferwise.atlassian.net/wiki/spaces/DS/pages/3647251055/List+Item+release+notes)\n */\nconst ActionOption = ({\n action,\n priority = Priority.PRIMARY,\n disabled,\n onClick,\n media,\n title,\n content,\n additionalContent,\n complex,\n className,\n showMediaAtAllSizes,\n showMediaCircle,\n isContainerAligned,\n as,\n 'aria-label': ariaLabel,\n}: ActionOptionProps) => {\n const sharedProps = {\n media,\n title,\n content,\n complex,\n disabled,\n showMediaAtAllSizes,\n showMediaCircle,\n className: clsx('tw-action-option', className),\n isContainerAligned,\n additionalContent,\n as,\n };\n\n const getAriaLabel = (): string | undefined => {\n if (ariaLabel) {\n return ariaLabel;\n }\n\n const generatedLabels: string[] = [];\n\n if (typeof title === 'string') {\n generatedLabels.push(title);\n }\n\n if (typeof action === 'string') {\n generatedLabels.push(action);\n }\n\n return generatedLabels.join(', ') || undefined;\n };\n\n const mapPriority = (priority: ActionOptionPriority): ButtonPriority => {\n switch (priority) {\n case 'primary':\n return 'primary';\n case 'secondary':\n return 'secondary-neutral';\n case 'tertiary':\n return 'tertiary';\n case 'secondary-send':\n return 'secondary';\n default:\n return 'primary';\n }\n };\n\n return (\n <Option\n {...sharedProps}\n button={\n <Button\n v2\n size=\"sm\"\n priority={mapPriority(priority)}\n disabled={disabled}\n aria-label={getAriaLabel()}\n onClick={onClick}\n >\n {action}\n </Button>\n }\n />\n );\n};\n\nexport default ActionOption;\n"],"names":["ActionOption","action","priority","Priority","PRIMARY","disabled","onClick","media","title","content","additionalContent","complex","className","showMediaAtAllSizes","showMediaCircle","isContainerAligned","as","ariaLabel","sharedProps","clsx","getAriaLabel","generatedLabels","push","join","undefined","mapPriority","_jsx","Option","button","Button","v2","size","children"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6CA,MAAMA,YAAY,GAAGA,CAAC;EACpBC,MAAM;EACNC,QAAQ,GAAGC,QAAQ,CAACC,OAAO;EAC3BC,QAAQ;EACRC,OAAO;EACPC,KAAK;EACLC,KAAK;EACLC,OAAO;EACPC,iBAAiB;EACjBC,OAAO;EACPC,SAAS;EACTC,mBAAmB;EACnBC,eAAe;EACfC,kBAAkB;EAClBC,EAAE;AACF,EAAA,YAAY,EAAEC;AAAS,CACL,KAAI;AACtB,EAAA,MAAMC,WAAW,GAAG;IAClBX,KAAK;IACLC,KAAK;IACLC,OAAO;IACPE,OAAO;IACPN,QAAQ;IACRQ,mBAAmB;IACnBC,eAAe;AACfF,IAAAA,SAAS,EAAEO,IAAI,CAAC,kBAAkB,EAAEP,SAAS,CAAC;IAC9CG,kBAAkB;IAClBL,iBAAiB;AACjBM,IAAAA;GACD;EAED,MAAMI,YAAY,GAAGA,MAAyB;AAC5C,IAAA,IAAIH,SAAS,EAAE;AACb,MAAA,OAAOA,SAAS;AAClB,IAAA;IAEA,MAAMI,eAAe,GAAa,EAAE;AAEpC,IAAA,IAAI,OAAOb,KAAK,KAAK,QAAQ,EAAE;AAC7Ba,MAAAA,eAAe,CAACC,IAAI,CAACd,KAAK,CAAC;AAC7B,IAAA;AAEA,IAAA,IAAI,OAAOP,MAAM,KAAK,QAAQ,EAAE;AAC9BoB,MAAAA,eAAe,CAACC,IAAI,CAACrB,MAAM,CAAC;AAC9B,IAAA;AAEA,IAAA,OAAOoB,eAAe,CAACE,IAAI,CAAC,IAAI,CAAC,IAAIC,SAAS;EAChD,CAAC;EAED,MAAMC,WAAW,GAAIvB,QAA8B,IAAoB;AACrE,IAAA,QAAQA,QAAQ;AACd,MAAA,KAAK,SAAS;AACZ,QAAA,OAAO,SAAS;AAClB,MAAA,KAAK,WAAW;AACd,QAAA,OAAO,mBAAmB;AAC5B,MAAA,KAAK,UAAU;AACb,QAAA,OAAO,UAAU;AACnB,MAAA,KAAK,gBAAgB;AACnB,QAAA,OAAO,WAAW;AACpB,MAAA;AACE,QAAA,OAAO,SAAS;AACpB;EACF,CAAC;EAED,oBACEwB,GAAA,CAACC,MAAM,EAAA;AAAA,IAAA,GACDT,WAAW;IACfU,MAAM,eACJF,GAAA,CAACG,MAAM,EAAA;MACLC,EAAE,EAAA,IAAA;AACFC,MAAAA,IAAI,EAAC,IAAI;AACT7B,MAAAA,QAAQ,EAAEuB,WAAW,CAACvB,QAAQ,CAAE;AAChCG,MAAAA,QAAQ,EAAEA,QAAS;MACnB,YAAA,EAAYe,YAAY,EAAG;AAC3Bd,MAAAA,OAAO,EAAEA,OAAQ;AAAA0B,MAAAA,QAAA,EAEhB/B;KACK;AACT,GAAA,CACD;AAEN;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"CheckboxOption.js","sources":["../../src/checkboxOption/CheckboxOption.tsx"],"sourcesContent":["import { forwardRef } from 'react';\n\nimport CheckboxButton from '../checkboxButton';\nimport Option from '../common/Option';\nimport { ReferenceType, BaseOptionProps } from '../common/Option/Option';\n\nexport type CheckboxOptionProps = Omit<BaseOptionProps, 'onChange'> & {\n /**\n * The checked state of the checkbox.\n */\n checked?: boolean;\n /**\n * Function to call when the checkbox option is clicked\n */\n onChange?: (value: boolean) => void;\n};\n\nconst CheckboxOption = forwardRef<ReferenceType, CheckboxOptionProps>(\n ({ checked, disabled, onChange, ...rest }, reference) => {\n return (\n <Option\n {...rest}\n ref={reference}\n disabled={disabled}\n button={\n <CheckboxButton\n checked={checked}\n disabled={disabled}\n onChange={() => onChange?.(!checked)}\n />\n }\n />\n );\n },\n);\n\nexport default CheckboxOption;\n"],"names":["CheckboxOption","forwardRef","checked","disabled","onChange","rest","reference","_jsx","Option","ref","button","CheckboxButton"],"mappings":";;;;;;;;;AAiBA,MAAMA,cAAc,gBAAGC,gBAAU,CAC/B,CAAC;EAAEC,OAAO;EAAEC,QAAQ;EAAEC,QAAQ;EAAE,GAAGC;CAAM,EAAEC,SAAS,KAAI;EACtD,oBACEC,cAAA,CAACC,cAAM,EAAA;AAAA,IAAA,GACDH,IAAI;AACRI,IAAAA,GAAG,EAAEH,SAAU;AACfH,IAAAA,QAAQ,EAAEA,QAAS;IACnBO,MAAM,eACJH,cAAA,CAACI,sBAAc,EAAA;AACbT,MAAAA,OAAO,EAAEA,OAAQ;AACjBC,MAAAA,QAAQ,EAAEA,QAAS;AACnBC,MAAAA,QAAQ,EAAEA,MAAMA,QAAQ,GAAG,CAACF,OAAO;KAAE;AAExC,GAAA,CACD;AAEN,CAAC;;;;"}
1
+ {"version":3,"file":"CheckboxOption.js","sources":["../../src/checkboxOption/CheckboxOption.tsx"],"sourcesContent":["import { forwardRef } from 'react';\n\nimport CheckboxButton from '../checkboxButton';\nimport Option from '../common/Option';\nimport { ReferenceType, BaseOptionProps } from '../common/Option/Option';\n\nexport type CheckboxOptionProps = Omit<BaseOptionProps, 'onChange'> & {\n /**\n * The checked state of the checkbox.\n */\n checked?: boolean;\n /**\n * Function to call when the checkbox option is clicked\n */\n onChange?: (value: boolean) => void;\n};\n\n/**\n * @deprecated Please use `<ListItem />` instead.\n * @deprecatedSince 46.104.0\n * @see [Source](../listItem/ListItem.tsx)\n * @see [Storybook](https://storybook.wise.design/?path=/docs/content-listitem--docs)\n * @see [Design docs](https://wise.design/components/list-item)\n * @see [Release notes](https://transferwise.atlassian.net/wiki/spaces/DS/pages/3647251055/List+Item+release+notes)\n */\nconst CheckboxOption = forwardRef<ReferenceType, CheckboxOptionProps>(\n ({ checked, disabled, onChange, ...rest }, reference) => {\n return (\n <Option\n {...rest}\n ref={reference}\n disabled={disabled}\n button={\n <CheckboxButton\n checked={checked}\n disabled={disabled}\n onChange={() => onChange?.(!checked)}\n />\n }\n />\n );\n },\n);\n\nexport default CheckboxOption;\n"],"names":["CheckboxOption","forwardRef","checked","disabled","onChange","rest","reference","_jsx","Option","ref","button","CheckboxButton"],"mappings":";;;;;;;;;AAyBA,MAAMA,cAAc,gBAAGC,gBAAU,CAC/B,CAAC;EAAEC,OAAO;EAAEC,QAAQ;EAAEC,QAAQ;EAAE,GAAGC;CAAM,EAAEC,SAAS,KAAI;EACtD,oBACEC,cAAA,CAACC,cAAM,EAAA;AAAA,IAAA,GACDH,IAAI;AACRI,IAAAA,GAAG,EAAEH,SAAU;AACfH,IAAAA,QAAQ,EAAEA,QAAS;IACnBO,MAAM,eACJH,cAAA,CAACI,sBAAc,EAAA;AACbT,MAAAA,OAAO,EAAEA,OAAQ;AACjBC,MAAAA,QAAQ,EAAEA,QAAS;AACnBC,MAAAA,QAAQ,EAAEA,MAAMA,QAAQ,GAAG,CAACF,OAAO;KAAE;AAExC,GAAA,CACD;AAEN,CAAC;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"CheckboxOption.mjs","sources":["../../src/checkboxOption/CheckboxOption.tsx"],"sourcesContent":["import { forwardRef } from 'react';\n\nimport CheckboxButton from '../checkboxButton';\nimport Option from '../common/Option';\nimport { ReferenceType, BaseOptionProps } from '../common/Option/Option';\n\nexport type CheckboxOptionProps = Omit<BaseOptionProps, 'onChange'> & {\n /**\n * The checked state of the checkbox.\n */\n checked?: boolean;\n /**\n * Function to call when the checkbox option is clicked\n */\n onChange?: (value: boolean) => void;\n};\n\nconst CheckboxOption = forwardRef<ReferenceType, CheckboxOptionProps>(\n ({ checked, disabled, onChange, ...rest }, reference) => {\n return (\n <Option\n {...rest}\n ref={reference}\n disabled={disabled}\n button={\n <CheckboxButton\n checked={checked}\n disabled={disabled}\n onChange={() => onChange?.(!checked)}\n />\n }\n />\n );\n },\n);\n\nexport default CheckboxOption;\n"],"names":["CheckboxOption","forwardRef","checked","disabled","onChange","rest","reference","_jsx","Option","ref","button","CheckboxButton"],"mappings":";;;;;AAiBA,MAAMA,cAAc,gBAAGC,UAAU,CAC/B,CAAC;EAAEC,OAAO;EAAEC,QAAQ;EAAEC,QAAQ;EAAE,GAAGC;CAAM,EAAEC,SAAS,KAAI;EACtD,oBACEC,GAAA,CAACC,MAAM,EAAA;AAAA,IAAA,GACDH,IAAI;AACRI,IAAAA,GAAG,EAAEH,SAAU;AACfH,IAAAA,QAAQ,EAAEA,QAAS;IACnBO,MAAM,eACJH,GAAA,CAACI,cAAc,EAAA;AACbT,MAAAA,OAAO,EAAEA,OAAQ;AACjBC,MAAAA,QAAQ,EAAEA,QAAS;AACnBC,MAAAA,QAAQ,EAAEA,MAAMA,QAAQ,GAAG,CAACF,OAAO;KAAE;AAExC,GAAA,CACD;AAEN,CAAC;;;;"}
1
+ {"version":3,"file":"CheckboxOption.mjs","sources":["../../src/checkboxOption/CheckboxOption.tsx"],"sourcesContent":["import { forwardRef } from 'react';\n\nimport CheckboxButton from '../checkboxButton';\nimport Option from '../common/Option';\nimport { ReferenceType, BaseOptionProps } from '../common/Option/Option';\n\nexport type CheckboxOptionProps = Omit<BaseOptionProps, 'onChange'> & {\n /**\n * The checked state of the checkbox.\n */\n checked?: boolean;\n /**\n * Function to call when the checkbox option is clicked\n */\n onChange?: (value: boolean) => void;\n};\n\n/**\n * @deprecated Please use `<ListItem />` instead.\n * @deprecatedSince 46.104.0\n * @see [Source](../listItem/ListItem.tsx)\n * @see [Storybook](https://storybook.wise.design/?path=/docs/content-listitem--docs)\n * @see [Design docs](https://wise.design/components/list-item)\n * @see [Release notes](https://transferwise.atlassian.net/wiki/spaces/DS/pages/3647251055/List+Item+release+notes)\n */\nconst CheckboxOption = forwardRef<ReferenceType, CheckboxOptionProps>(\n ({ checked, disabled, onChange, ...rest }, reference) => {\n return (\n <Option\n {...rest}\n ref={reference}\n disabled={disabled}\n button={\n <CheckboxButton\n checked={checked}\n disabled={disabled}\n onChange={() => onChange?.(!checked)}\n />\n }\n />\n );\n },\n);\n\nexport default CheckboxOption;\n"],"names":["CheckboxOption","forwardRef","checked","disabled","onChange","rest","reference","_jsx","Option","ref","button","CheckboxButton"],"mappings":";;;;;AAyBA,MAAMA,cAAc,gBAAGC,UAAU,CAC/B,CAAC;EAAEC,OAAO;EAAEC,QAAQ;EAAEC,QAAQ;EAAE,GAAGC;CAAM,EAAEC,SAAS,KAAI;EACtD,oBACEC,GAAA,CAACC,MAAM,EAAA;AAAA,IAAA,GACDH,IAAI;AACRI,IAAAA,GAAG,EAAEH,SAAU;AACfH,IAAAA,QAAQ,EAAEA,QAAS;IACnBO,MAAM,eACJH,GAAA,CAACI,cAAc,EAAA;AACbT,MAAAA,OAAO,EAAEA,OAAQ;AACjBC,MAAAA,QAAQ,EAAEA,QAAS;AACnBC,MAAAA,QAAQ,EAAEA,MAAMA,QAAQ,GAAG,CAACF,OAAO;KAAE;AAExC,GAAA,CACD;AAEN,CAAC;;;;"}
@@ -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,117 +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;
46
- const inner = 'href' in action ? /*#__PURE__*/jsxRuntime.jsx(Link.default, {
47
- ref: ref,
48
- className: "np-header__action-link",
49
- href: action.href,
50
- target: action.target,
51
- "aria-label": action['aria-label'],
52
- onClick: action.onClick,
53
- children: action.text
54
- }) : /*#__PURE__*/jsxRuntime.jsx(Button_resolver.default, {
55
- ref: ref,
56
- className: "np-header__action-button",
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",
57
51
  priority: "tertiary",
58
52
  size: "sm",
59
- "aria-label": action['aria-label'],
60
53
  onClick: action.onClick,
54
+ ...props,
61
55
  children: action.text
62
56
  });
63
- return /*#__PURE__*/jsxRuntime.jsx("div", {
64
- className: "np-header__action",
65
- children: inner
66
- });
67
- });
68
- HeaderAction.displayName = 'HeaderAction';
57
+ };
69
58
  /**
70
- * @param {ButtonActionProps | LinkActionProps} [action] - Optional prop to specify the action button or link.
71
- * @param {Heading | 'legend'} [as='h5'] - Optional prop to override the heading element rendered for the title.
72
- * @param {string} title - Required prop to set the title of the section header.
73
- * @param {'group' | 'section'} [level='group'] - Optional prop to specify the level of the section header.
74
- * @param {string} [className]
75
- * @param {string} [testId]
76
59
  *
77
- * @see {@link Header } for further information.
78
- * @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
+ *
79
62
  */
80
- const Header = /*#__PURE__*/React__default.default.forwardRef(({
81
- as = 'h5',
63
+ const Header = ({
64
+ id,
82
65
  action,
83
- className,
84
- testId,
66
+ as = 'h5',
85
67
  title,
86
- level = 'group',
87
- ...props
88
- }, ref) => {
89
- const internalRef = React.useRef(null);
90
- const actionRef = React.useRef(null);
91
- const levelTypography = level === 'group' ? typography.Typography.TITLE_GROUP : typography.Typography.TITLE_SUBSECTION;
92
- const isLegendOrNoAction = !action || as === 'legend';
93
- const headerClasses = clsx.clsx('np-header', className, {
94
- 'np-header--group': level === 'group',
95
- 'np-header__title': isLegendOrNoAction
96
- });
97
- const commonProps = {
98
- className: headerClasses,
99
- 'data-testid': testId
100
- };
101
- React.useEffect(() => {
102
- if (as === 'legend' && internalRef.current) {
103
- const {
104
- parentElement
105
- } = internalRef.current;
106
- if (!parentElement || parentElement.tagName.toLowerCase() !== 'fieldset') {
107
- console.warn('Legends should be the first child in a fieldset, and this is not possible when including an action');
108
- }
109
- }
110
- }, [as]);
68
+ className,
69
+ role = undefined
70
+ }) => {
111
71
  if (!action) {
112
72
  return /*#__PURE__*/jsxRuntime.jsx(Title.default, {
113
- ref: internalRef,
114
73
  as: as,
115
- type: levelTypography,
116
- ...commonProps,
117
- ...props,
74
+ id: id,
75
+ role: role,
76
+ type: typography.Typography.TITLE_GROUP,
77
+ className: clsx.clsx('np-header', 'np-header__title', className),
118
78
  children: title
119
79
  });
120
80
  }
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
+ }
121
85
  return /*#__PURE__*/jsxRuntime.jsxs("div", {
122
- ...commonProps,
123
- ...props,
124
- ref: ref,
86
+ className: clsx.clsx('np-header', className),
125
87
  children: [/*#__PURE__*/jsxRuntime.jsx(Title.default, {
126
88
  as: as,
127
- type: levelTypography,
89
+ type: typography.Typography.TITLE_GROUP,
90
+ id: id,
128
91
  className: "np-header__title",
129
92
  children: title
130
93
  }), /*#__PURE__*/jsxRuntime.jsx(HeaderAction, {
131
- ref: actionRef,
132
94
  action: action
133
95
  })]
134
96
  });
135
- });
136
- Header.displayName = 'Header';
97
+ };
137
98
 
99
+ exports.Header = Header;
138
100
  exports.default = Header;
139
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 const inner =\n 'href' in action ? (\n <Link\n ref={ref as React.Ref<HTMLAnchorElement>}\n className=\"np-header__action-link\"\n href={action.href}\n target={action.target}\n aria-label={action['aria-label']}\n onClick={action.onClick}\n >\n {action.text}\n </Link>\n ) : (\n <Button\n ref={ref as React.Ref<HTMLButtonElement>}\n className=\"np-header__action-button\"\n priority=\"tertiary\"\n size=\"sm\"\n aria-label={action['aria-label']}\n onClick={action.onClick}\n >\n {action.text}\n </Button>\n );\n\n return <div className=\"np-header__action\">{inner}</div>;\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","ariaLabel","text","onClick","inner","_jsx","Link","className","href","target","children","Button","priority","size","displayName","Header","as","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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoDA,MAAMA,YAAY,gBAAGC,sBAAK,CAACC,UAAU,CACnC,CACE;AAAEC,EAAAA;AAAM,CAAmD,EAC3DC,GAAqD,KACnD;EACF,MAAM;AAAE,IAAA,YAAY,EAAEC,SAAS;IAAEC,IAAI;AAAEC,IAAAA;AAAO,GAAE,GAAGJ,MAAM;EAEzD,MAAMK,KAAK,GACT,MAAM,IAAIL,MAAM,gBACdM,cAAA,CAACC,YAAI,EAAA;AACHN,IAAAA,GAAG,EAAEA,GAAoC;AACzCO,IAAAA,SAAS,EAAC,wBAAwB;IAClCC,IAAI,EAAET,MAAM,CAACS,IAAK;IAClBC,M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,EAAA;AAACI,MAAAA,GAAG,EAAEuB,SAAU;AAACxB,MAAAA,MAAM,EAAEA;AAAO,KAAA,CAC/C;AAAA,GAAK,CAAC;AAEV,CAAC;AAGHgB,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;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,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,113 +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;
38
- const inner = 'href' in action ? /*#__PURE__*/jsx(Link, {
39
- ref: ref,
40
- className: "np-header__action-link",
41
- href: action.href,
42
- target: action.target,
43
- "aria-label": action['aria-label'],
44
- onClick: action.onClick,
45
- children: action.text
46
- }) : /*#__PURE__*/jsx(Button, {
47
- ref: ref,
48
- className: "np-header__action-button",
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",
49
47
  priority: "tertiary",
50
48
  size: "sm",
51
- "aria-label": action['aria-label'],
52
49
  onClick: action.onClick,
50
+ ...props,
53
51
  children: action.text
54
52
  });
55
- return /*#__PURE__*/jsx("div", {
56
- className: "np-header__action",
57
- children: inner
58
- });
59
- });
60
- HeaderAction.displayName = 'HeaderAction';
53
+ };
61
54
  /**
62
- * @param {ButtonActionProps | LinkActionProps} [action] - Optional prop to specify the action button or link.
63
- * @param {Heading | 'legend'} [as='h5'] - Optional prop to override the heading element rendered for the title.
64
- * @param {string} title - Required prop to set the title of the section header.
65
- * @param {'group' | 'section'} [level='group'] - Optional prop to specify the level of the section header.
66
- * @param {string} [className]
67
- * @param {string} [testId]
68
55
  *
69
- * @see {@link Header } for further information.
70
- * @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
+ *
71
58
  */
72
- const Header = /*#__PURE__*/React__default.forwardRef(({
73
- as = 'h5',
59
+ const Header = ({
60
+ id,
74
61
  action,
75
- className,
76
- testId,
62
+ as = 'h5',
77
63
  title,
78
- level = 'group',
79
- ...props
80
- }, ref) => {
81
- const internalRef = useRef(null);
82
- const actionRef = useRef(null);
83
- const levelTypography = level === 'group' ? Typography.TITLE_GROUP : Typography.TITLE_SUBSECTION;
84
- const isLegendOrNoAction = !action || as === 'legend';
85
- const headerClasses = clsx('np-header', className, {
86
- 'np-header--group': level === 'group',
87
- 'np-header__title': isLegendOrNoAction
88
- });
89
- const commonProps = {
90
- className: headerClasses,
91
- 'data-testid': testId
92
- };
93
- useEffect(() => {
94
- if (as === 'legend' && internalRef.current) {
95
- const {
96
- parentElement
97
- } = internalRef.current;
98
- if (!parentElement || parentElement.tagName.toLowerCase() !== 'fieldset') {
99
- console.warn('Legends should be the first child in a fieldset, and this is not possible when including an action');
100
- }
101
- }
102
- }, [as]);
64
+ className,
65
+ role = undefined
66
+ }) => {
103
67
  if (!action) {
104
68
  return /*#__PURE__*/jsx(Title, {
105
- ref: internalRef,
106
69
  as: as,
107
- type: levelTypography,
108
- ...commonProps,
109
- ...props,
70
+ id: id,
71
+ role: role,
72
+ type: Typography.TITLE_GROUP,
73
+ className: clsx('np-header', 'np-header__title', className),
110
74
  children: title
111
75
  });
112
76
  }
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
+ }
113
81
  return /*#__PURE__*/jsxs("div", {
114
- ...commonProps,
115
- ...props,
116
- ref: ref,
82
+ className: clsx('np-header', className),
117
83
  children: [/*#__PURE__*/jsx(Title, {
118
84
  as: as,
119
- type: levelTypography,
85
+ type: Typography.TITLE_GROUP,
86
+ id: id,
120
87
  className: "np-header__title",
121
88
  children: title
122
89
  }), /*#__PURE__*/jsx(HeaderAction, {
123
- ref: actionRef,
124
90
  action: action
125
91
  })]
126
92
  });
127
- });
128
- Header.displayName = 'Header';
93
+ };
129
94
 
130
- export { Header as default };
95
+ export { Header, Header as default };
131
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 const inner =\n 'href' in action ? (\n <Link\n ref={ref as React.Ref<HTMLAnchorElement>}\n className=\"np-header__action-link\"\n href={action.href}\n target={action.target}\n aria-label={action['aria-label']}\n onClick={action.onClick}\n >\n {action.text}\n </Link>\n ) : (\n <Button\n ref={ref as React.Ref<HTMLButtonElement>}\n className=\"np-header__action-button\"\n priority=\"tertiary\"\n size=\"sm\"\n aria-label={action['aria-label']}\n onClick={action.onClick}\n >\n {action.text}\n </Button>\n );\n\n return <div className=\"np-header__action\">{inner}</div>;\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","ariaLabel","text","onClick","inner","_jsx","Link","className","href","target","children","Button","priority","size","displayName","Header","as","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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoDA,MAAMA,YAAY,gBAAGC,cAAK,CAACC,UAAU,CACnC,CACE;AAAEC,EAAAA;AAAM,CAAmD,EAC3DC,GAAqD,KACnD;EACF,MAAM;AAAE,IAAA,YAAY,EAAEC,SAAS;IAAEC,IAAI;AAAEC,IAAAA;AAAO,GAAE,GAAGJ,MAAM;EAEzD,MAAMK,KAAK,GACT,MAAM,IAAIL,MAAM,gBACdM,GAAA,CAACC,IAAI,EAAA;AACHN,IAAAA,GAAG,EAAEA,GAAoC;AACzCO,IAAAA,SAAS,EAAC,wBAAwB;IAClCC,IAAI,EAAET,MAAM,CAACS,IAAK;IAClBC,MAAM,EAAEV,MAAM,CAACU,MAAO;IACtB,YAAA,EAAYV,MAAM,CAAC,YAAY,CAAE;IACjCI,OAAO,EAAEJ,MAAM,CAACI,OAAQ;IAAAO,QAAA,EAEvBX,MAAM,CAACG;AAAI,GACR,CAAC,gBAEPG,GAAA,CAACM,MAAM,EAAA;AACLX,IAAAA,GAAG,EAAEA,GAAoC;AACzCO,IAAAA,SAAS,EAAC,0BAA0B;AACpCK,IAAAA,QAAQ,EAAC,UAAU;AACnBC,IAAAA,IAAI,EAAC,IAAI;I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EC,QAAAA;OAAe,GAAGb,WAAW,CAACY,OAAO;AAC7C,MAAA,IAAI,CAACC,aAAa,IAAIA,aAAa,CAACC,OAAO,CAACC,WAAW,EAAE,KAAK,UAAU,EAAE;AACxEC,QAAAA,OAAO,CAACC,IAAI,CACV,oGAAoG,CACrG;AACH,MAAA;AACF,IAAA;AACF,EAAA,CAAC,EAAE,CAACtB,EAAE,CAAC,CAAC;EAER,IAAI,CAACjB,MAAM,EAAE;IACX,oBACEM,GAAA,CAACkC,KAAK,EAAA;AAACvC,MAAAA,GAAG,EAAEqB,WAAY;AAACL,MAAAA,EAAE,EAAEA,EAAG;AAACwB,MAAAA,IAAI,EAAEhB,eAAgB;AAAA,MAAA,GAAKO,WAAW;AAAA,MAAA,GAAMX,KAAK;AAAAV,MAAAA,QAAA,EAC/EQ;AAAK,KACD,CAAC;AAEZ,EAAA;AAEA,EAAA,oBACEuB,IAAA,CAAA,KAAA,EAAA;AAAA,IAAA,GAASV,WAAW;AAAA,IAAA,GAAMX,KAAK;AAAEpB,IAAAA,GAAG,EAAEA,GAAiC;IAAAU,QAAA,EAAA,cACrEL,GAAA,CAACkC,KAAK,EAAA;AAACvB,MAAAA,EAAE,EAAEA,EAAG;AAACwB,MAAAA,IAAI,EAAEhB,eAAgB;AAACjB,MAAAA,SAAS,EAAC,kBAAkB;AAAAG,MAAAA,QAAA,EAC/DQ;AAAK,KACD,CACP,eAAAb,GAAA,CAACT,YAAY,EAAA;AAACI,MAAAA,GAAG,EAAEuB,SAAU;AAACxB,MAAAA,MAAM,EAAEA;AAAO,KAAA,CAC/C;AAAA,GAAK,CAAC;AAEV,CAAC;AAGHgB,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","war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Z,EAAA;EAEA,IAAID,EAAE,KAAK,QAAQ,EAAE;AACnB;AACAS,IAAAA,OAAO,CAACC,IAAI,CACV,oGAAoG,CACrG;AACH,EAAA;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;AAAK,KACD,CACP,eAAAd,GAAA,CAACH,YAAY,EAAA;AAACC,MAAAA,MAAM,EAAEA;AAAO,KAAA,CAC/B;AAAA,GAAK,CAAC;AAEV;;;;"}
@@ -45,6 +45,7 @@
45
45
  "neptune.Upload.csFailureText": "Nahrání se nezdařilo. Zkuste to prosím později",
46
46
  "neptune.Upload.csSuccessText": "Úspěšně nahráno!",
47
47
  "neptune.Upload.csTooLargeMessage": "Nahrajte soubor menší než {maxSize} MB",
48
+ "neptune.Upload.csTooLargeNoLimitMessage": "Nahrajte menší soubor",
48
49
  "neptune.Upload.csWrongTypeMessage": "Tento formát souboru není podporován. Zkuste to znovu s jiným souborem",
49
50
  "neptune.Upload.psButtonText": "Zrušit",
50
51
  "neptune.Upload.psProcessingText": "Načítání...",
@@ -52,6 +53,7 @@
52
53
  "neptune.Upload.usButtonText": "Nebo vyberte soubor",
53
54
  "neptune.Upload.usDropMessage": "Přetáhněte soubor a zahajte nahrávání",
54
55
  "neptune.Upload.usPlaceholder": "Přetáhněte soubor menší než {maxSize} MB",
56
+ "neptune.Upload.usPlaceholderNoLimit": "Přetáhněte soubor",
55
57
  "neptune.UploadButton.allFileTypes": "Všechny typy souborů",
56
58
  "neptune.UploadButton.dropFiles": "Přetáhněte soubor a zahajte nahrávání",
57
59
  "neptune.UploadButton.instructions": "{fileTypes}, menší než {size} MB",
@@ -49,6 +49,7 @@ var cs = {
49
49
  "neptune.Upload.csFailureText": "Nahrání se nezdařilo. Zkuste to prosím později",
50
50
  "neptune.Upload.csSuccessText": "Úspěšně nahráno!",
51
51
  "neptune.Upload.csTooLargeMessage": "Nahrajte soubor menší než {maxSize} MB",
52
+ "neptune.Upload.csTooLargeNoLimitMessage": "Nahrajte menší soubor",
52
53
  "neptune.Upload.csWrongTypeMessage": "Tento formát souboru není podporován. Zkuste to znovu s jiným souborem",
53
54
  "neptune.Upload.psButtonText": "Zrušit",
54
55
  "neptune.Upload.psProcessingText": "Načítání...",
@@ -56,6 +57,7 @@ var cs = {
56
57
  "neptune.Upload.usButtonText": "Nebo vyberte soubor",
57
58
  "neptune.Upload.usDropMessage": "Přetáhněte soubor a zahajte nahrávání",
58
59
  "neptune.Upload.usPlaceholder": "Přetáhněte soubor menší než {maxSize} MB",
60
+ "neptune.Upload.usPlaceholderNoLimit": "Přetáhněte soubor",
59
61
  "neptune.UploadButton.allFileTypes": "Všechny typy souborů",
60
62
  "neptune.UploadButton.dropFiles": "Přetáhněte soubor a zahajte nahrávání",
61
63
  "neptune.UploadButton.instructions": "{fileTypes}, menší než {size} MB",
@@ -1 +1 @@
1
- {"version":3,"file":"cs.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"cs.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -45,6 +45,7 @@ var cs = {
45
45
  "neptune.Upload.csFailureText": "Nahrání se nezdařilo. Zkuste to prosím později",
46
46
  "neptune.Upload.csSuccessText": "Úspěšně nahráno!",
47
47
  "neptune.Upload.csTooLargeMessage": "Nahrajte soubor menší než {maxSize} MB",
48
+ "neptune.Upload.csTooLargeNoLimitMessage": "Nahrajte menší soubor",
48
49
  "neptune.Upload.csWrongTypeMessage": "Tento formát souboru není podporován. Zkuste to znovu s jiným souborem",
49
50
  "neptune.Upload.psButtonText": "Zrušit",
50
51
  "neptune.Upload.psProcessingText": "Načítání...",
@@ -52,6 +53,7 @@ var cs = {
52
53
  "neptune.Upload.usButtonText": "Nebo vyberte soubor",
53
54
  "neptune.Upload.usDropMessage": "Přetáhněte soubor a zahajte nahrávání",
54
55
  "neptune.Upload.usPlaceholder": "Přetáhněte soubor menší než {maxSize} MB",
56
+ "neptune.Upload.usPlaceholderNoLimit": "Přetáhněte soubor",
55
57
  "neptune.UploadButton.allFileTypes": "Všechny typy souborů",
56
58
  "neptune.UploadButton.dropFiles": "Přetáhněte soubor a zahajte nahrávání",
57
59
  "neptune.UploadButton.instructions": "{fileTypes}, menší než {size} MB",
@@ -1 +1 @@
1
- {"version":3,"file":"cs.json.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"cs.json.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -45,6 +45,7 @@
45
45
  "neptune.Upload.csFailureText": "การอัปโหลดล้มเหลว กรุณาลองอีกครั้ง",
46
46
  "neptune.Upload.csSuccessText": "อัปโหลดเรียบร้อย!",
47
47
  "neptune.Upload.csTooLargeMessage": "กรุณาใช้ไฟล์ที่มีขนาดเล็กกว่า {maxSize} MB",
48
+ "neptune.Upload.csTooLargeNoLimitMessage": "โปรดอัปโหลดไฟล์ที่เล็กลง",
48
49
  "neptune.Upload.csWrongTypeMessage": "ไม่รองรับประเภทไฟล์ โปรดลองอีกครั้งโดยใช้ไฟล์อื่น",
49
50
  "neptune.Upload.psButtonText": "ยกเลิก",
50
51
  "neptune.Upload.psProcessingText": "กำลังอัปโหลด...",
@@ -52,6 +53,7 @@
52
53
  "neptune.Upload.usButtonText": "หรือเลือกไฟล์",
53
54
  "neptune.Upload.usDropMessage": "วางไฟล์เพื่อเริ่มการอัปโหลด",
54
55
  "neptune.Upload.usPlaceholder": "ลากและวางไฟล์ที่น้อยกว่า {maxSize} MB",
56
+ "neptune.Upload.usPlaceholderNoLimit": "ลากและวางไฟล์",
55
57
  "neptune.UploadButton.allFileTypes": "ไฟล์ทุกประเภท",
56
58
  "neptune.UploadButton.dropFiles": "วางไฟล์เพื่อเริ่มการอัปโหลด",
57
59
  "neptune.UploadButton.instructions": "{fileTypes} น้อยกว่า {size} MB",
@@ -49,6 +49,7 @@ var th = {
49
49
  "neptune.Upload.csFailureText": "การอัปโหลดล้มเหลว กรุณาลองอีกครั้ง",
50
50
  "neptune.Upload.csSuccessText": "อัปโหลดเรียบร้อย!",
51
51
  "neptune.Upload.csTooLargeMessage": "กรุณาใช้ไฟล์ที่มีขนาดเล็กกว่า {maxSize} MB",
52
+ "neptune.Upload.csTooLargeNoLimitMessage": "โปรดอัปโหลดไฟล์ที่เล็กลง",
52
53
  "neptune.Upload.csWrongTypeMessage": "ไม่รองรับประเภทไฟล์ โปรดลองอีกครั้งโดยใช้ไฟล์อื่น",
53
54
  "neptune.Upload.psButtonText": "ยกเลิก",
54
55
  "neptune.Upload.psProcessingText": "กำลังอัปโหลด...",
@@ -56,6 +57,7 @@ var th = {
56
57
  "neptune.Upload.usButtonText": "หรือเลือกไฟล์",
57
58
  "neptune.Upload.usDropMessage": "วางไฟล์เพื่อเริ่มการอัปโหลด",
58
59
  "neptune.Upload.usPlaceholder": "ลากและวางไฟล์ที่น้อยกว่า {maxSize} MB",
60
+ "neptune.Upload.usPlaceholderNoLimit": "ลากและวางไฟล์",
59
61
  "neptune.UploadButton.allFileTypes": "ไฟล์ทุกประเภท",
60
62
  "neptune.UploadButton.dropFiles": "วางไฟล์เพื่อเริ่มการอัปโหลด",
61
63
  "neptune.UploadButton.instructions": "{fileTypes} น้อยกว่า {size} MB",
@@ -1 +1 @@
1
- {"version":3,"file":"th.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"th.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}