@transferwise/components 0.0.0-experimental-5acc778 → 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 +44 -76
  6. package/build/header/Header.js.map +1 -1
  7. package/build/header/Header.mjs +44 -73
  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 -29
  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 -29
  34. package/build/styles/main.css +14 -29
  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 -27
  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 +3 -3
  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 -29
  83. package/src/header/Header.less +9 -24
  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 -110
  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 -29
  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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AAgB;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,mBAAmB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AAA,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,111 +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
- var Button_resolver = require('../button/Button.resolver.js');
31
+ var Link = require('../link/Link.js');
31
32
  var Title = require('../title/Title.js');
32
33
 
33
- function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
34
-
35
- var React__default = /*#__PURE__*/_interopDefault(React);
36
-
37
- const HeaderAction = /*#__PURE__*/React__default.default.forwardRef(({
34
+ const HeaderAction = ({
38
35
  action
39
- }, ref) => {
40
- const baseProps = {
41
- ref,
42
- className: 'np-header__action-button',
43
- priority: 'tertiary',
44
- size: 'sm',
45
- 'aria-label': action['aria-label'],
36
+ }) => {
37
+ const props = {
38
+ 'aria-label': action['aria-label']
39
+ };
40
+ if ('href' in action) {
41
+ return /*#__PURE__*/jsxRuntime.jsx(Link.default, {
42
+ href: action.href,
43
+ target: action.target,
44
+ onClick: action.onClick,
45
+ ...props,
46
+ children: action.text
47
+ });
48
+ }
49
+ return /*#__PURE__*/jsxRuntime.jsx(Button_resolver.default, {
50
+ className: "np-header__button",
51
+ priority: "tertiary",
52
+ size: "sm",
46
53
  onClick: action.onClick,
54
+ ...props,
47
55
  children: action.text
48
- };
49
- const linkProps = 'href' in action ? {
50
- href: action.href,
51
- target: action.target,
52
- as: 'a'
53
- } : {};
54
- return /*#__PURE__*/jsxRuntime.jsx("div", {
55
- className: "np-header__action",
56
- children: /*#__PURE__*/jsxRuntime.jsx(Button_resolver.default, {
57
- ...baseProps,
58
- ...linkProps
59
- })
60
56
  });
61
- });
62
- HeaderAction.displayName = 'HeaderAction';
57
+ };
63
58
  /**
64
- * @param {ButtonActionProps | LinkActionProps} [action] - Optional prop to specify the action button or link.
65
- * @param {Heading | 'legend'} [as='h5'] - Optional prop to override the heading element rendered for the title.
66
- * @param {string} title - Required prop to set the title of the section header.
67
- * @param {'group' | 'section'} [level='group'] - Optional prop to specify the level of the section header.
68
- * @param {string} [className]
69
- * @param {string} [testId]
70
59
  *
71
- * @see {@link Header } for further information.
72
- * @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
+ *
73
62
  */
74
- const Header = /*#__PURE__*/React__default.default.forwardRef(({
75
- as = 'h5',
63
+ const Header = ({
64
+ id,
76
65
  action,
77
- className,
78
- testId,
66
+ as = 'h5',
79
67
  title,
80
- level = 'group',
81
- ...props
82
- }, ref) => {
83
- const internalRef = React.useRef(null);
84
- const actionRef = React.useRef(null);
85
- const levelTypography = level === 'group' ? typography.Typography.TITLE_GROUP : typography.Typography.TITLE_SUBSECTION;
86
- const isLegendOrNoAction = !action || as === 'legend';
87
- const headerClasses = clsx.clsx('np-header', className, {
88
- 'np-header--group': level === 'group',
89
- 'np-header__title': isLegendOrNoAction
90
- });
91
- const commonProps = {
92
- className: headerClasses,
93
- 'data-testid': testId
94
- };
95
- React.useEffect(() => {
96
- if (as === 'legend' && internalRef.current) {
97
- const {
98
- parentElement
99
- } = internalRef.current;
100
- if (!parentElement || parentElement.tagName.toLowerCase() !== 'fieldset') {
101
- console.warn('Legends should be the first child in a fieldset, and this is not possible when including an action');
102
- }
103
- }
104
- }, [as]);
68
+ className,
69
+ role = undefined
70
+ }) => {
105
71
  if (!action) {
106
72
  return /*#__PURE__*/jsxRuntime.jsx(Title.default, {
107
- ref: internalRef,
108
73
  as: as,
109
- type: levelTypography,
110
- ...commonProps,
111
- ...props,
74
+ id: id,
75
+ role: role,
76
+ type: typography.Typography.TITLE_GROUP,
77
+ className: clsx.clsx('np-header', 'np-header__title', className),
112
78
  children: title
113
79
  });
114
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
+ }
115
85
  return /*#__PURE__*/jsxRuntime.jsxs("div", {
116
- ...commonProps,
117
- ...props,
118
- ref: ref,
86
+ className: clsx.clsx('np-header', className),
119
87
  children: [/*#__PURE__*/jsxRuntime.jsx(Title.default, {
120
88
  as: as,
121
- type: levelTypography,
89
+ type: typography.Typography.TITLE_GROUP,
90
+ id: id,
122
91
  className: "np-header__title",
123
92
  children: title
124
93
  }), /*#__PURE__*/jsxRuntime.jsx(HeaderAction, {
125
- ref: actionRef,
126
94
  action: action
127
95
  })]
128
96
  });
129
- });
130
- Header.displayName = 'Header';
97
+ };
131
98
 
99
+ exports.Header = Header;
132
100
  exports.default = Header;
133
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 Button from '../button';\nimport Title from '../title';\nimport React, { useEffect, useRef, FunctionComponent } from 'react';\n\ntype ActionProps = AriaLabelProperty & {\n text: string;\n onClick?: () => void;\n};\n\ntype ButtonActionProps = ActionProps;\ntype LinkActionProps = ActionProps & LinkProps;\n\nexport interface HeaderProps extends CommonProps {\n /**\n * Optional prop to define the action for the header. If the `href` property\n * is provided, a `Link` will be rendered instead of a `Button`.\n */\n action?: ButtonActionProps | LinkActionProps;\n\n /**\n * Option prop to specify DOM render element of the title\n *\n * - When `as=\"legend\"`, the `Header` will render as a `<legend>` element.\n * **Note:** `<legend>` elements must be the first child of a `<fieldset>` to comply with HTML semantics.\n * If this condition is not met, a warning will be logged to the console.\n *\n * - Other valid values include standard heading tags (`h1` to `h6`) or `header`.\n */\n as?: Heading | 'legend' | 'header';\n\n /** Required prop to set the title of the Header. */\n title: string;\n\n /** Optional prop to specify the level of the Header */\n level?: 'section' | 'group';\n\n className?: string;\n testId?: string;\n}\n\n/**\n * Renders a header action which can be either a button or a link.\n *\n * @param {Object} props - The properties object.\n * @param {ButtonActionProps | LinkActionProps} props.action - The action object which can be either a button or a link.\n * @returns {JSX.Element} The rendered header action component.\n */\nconst HeaderAction = React.forwardRef(\n (\n { action }: { action: ButtonActionProps | LinkActionProps },\n ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>,\n ) => {\n const baseProps = {\n ref,\n className: 'np-header__action-button',\n priority: 'tertiary' as const,\n size: 'sm' as const,\n 'aria-label': action['aria-label'],\n onClick: action.onClick,\n children: action.text,\n };\n\n const linkProps =\n 'href' in action ? { href: action.href, target: action.target, as: 'a' as const } : {};\n\n return (\n <div className=\"np-header__action\">\n <Button {...baseProps} {...linkProps} />\n </div>\n );\n },\n);\n\nHeaderAction.displayName = 'HeaderAction';\n\n/**\n * @param {ButtonActionProps | LinkActionProps} [action] - Optional prop to specify the action button or link.\n * @param {Heading | 'legend'} [as='h5'] - Optional prop to override the heading element rendered for the title.\n * @param {string} title - Required prop to set the title of the section header.\n * @param {'group' | 'section'} [level='group'] - Optional prop to specify the level of the section header.\n * @param {string} [className]\n * @param {string} [testId]\n *\n * @see {@link Header } for further information.\n * @see {@link https://storybook.wise.design/?path=/docs/typography-header--docs|Storybook Wise Design}\n */\nconst Header: FunctionComponent<HeaderProps> = React.forwardRef(\n (\n { as = 'h5', action, className, testId, title, level = 'group', ...props },\n ref: React.Ref<HTMLDivElement | HTMLHeadingElement | HTMLLegendElement>,\n ) => {\n const internalRef = useRef<HTMLLegendElement>(null);\n const actionRef = useRef<HTMLButtonElement | HTMLAnchorElement>(null);\n const levelTypography =\n level === 'group' ? Typography.TITLE_GROUP : Typography.TITLE_SUBSECTION;\n const isLegendOrNoAction = !action || as === 'legend';\n const headerClasses = clsx('np-header', className, {\n 'np-header--group': level === 'group',\n 'np-header__title': isLegendOrNoAction,\n });\n\n const commonProps = {\n className: headerClasses,\n 'data-testid': testId,\n };\n\n useEffect(() => {\n if (as === 'legend' && internalRef.current) {\n const { parentElement } = internalRef.current;\n if (!parentElement || parentElement.tagName.toLowerCase() !== 'fieldset') {\n console.warn(\n 'Legends should be the first child in a fieldset, and this is not possible when including an action',\n );\n }\n }\n }, [as]);\n\n if (!action) {\n return (\n <Title ref={internalRef} as={as} type={levelTypography} {...commonProps} {...props}>\n {title}\n </Title>\n );\n }\n\n return (\n <div {...commonProps} {...props} ref={ref as React.Ref<HTMLDivElement>}>\n <Title as={as} type={levelTypography} className=\"np-header__title\">\n {title}\n </Title>\n <HeaderAction ref={actionRef} action={action} />\n </div>\n );\n },\n);\n\nHeader.displayName = 'Header';\n\nexport default Header;\n"],"names":["HeaderAction","React","forwardRef","action","ref","baseProps","className","priority","size","onClick","children","text","linkProps","href","target","as","_jsx","Button","displayName","Header","testId","title","level","props","internalRef","useRef","actionRef","levelTypography","Typography","TITLE_GROUP","TITLE_SUBSECTION","isLegendOrNoAction","headerClasses","clsx","commonProps","useEffect","current","parentElement","tagName","toLowerCase","console","warn","Title","type","_jsxs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkDA,MAAMA,YAAY,gBAAGC,sBAAK,CAACC,UAAU,CACnC,CACE;AAAEC,EAAAA;AAAM,CAAmD,EAC3DC,GAAqD,KACnD;AACF,EAAA,MAAMC,SAAS,GAAG;IAChBD,GAAG;AACHE,IAAAA,SAAS,EAAE,0BAA0B;AACrCC,IAAAA,QAAQ,EAAE,UAAmB;AAC7BC,IAAAA,IAAI,EAAE,IAAa;AACnB,IAAA,YAAY,EAAEL,MAAM,CAAC,YAAY,CAAC;IAClCM,OAAO,EAAEN,MAAM,CAACM,OAAO;IACvBC,QAAQ,EAAEP,MAAM,CAACQ;GAClB;AAED,EAAA,MAAMC,SAAS,GACb,MAAM,IAAIT,MAAM,GAAG;IAAEU,IAAI,EAAEV,MAAM,CAACU,IAAI;IAAEC,MAAM,EAAEX,MAAM,CAACW,MAAM;AAAEC,IAAAA,EAAE,EAAE;GAAc,GAAG,EAAE;AAExF,EAAA,oBACEC,cAAA,CAAA,KAAA,EAAA;AAAKV,IAAAA,SAAS,EAAC,mBAAmB;IAAAI,QAAA,eAChCM,cAAA,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V,oGAAoG,CACrG;AACH,MAAA;AACF,IAAA;AACF,EAAA,CAAC,EAAE,CAAC1B,EAAE,CAAC,CAAC;EAER,IAAI,CAACZ,MAAM,EAAE;IACX,oBACEa,cAAA,CAAC0B,aAAK,EAAA;AAACtC,MAAAA,GAAG,EAAEoB,WAAY;AAACT,MAAAA,EAAE,EAAEA,EAAG;AAAC4B,MAAAA,IAAI,EAAEhB,eAAgB;AAAA,MAAA,GAAKO,WAAW;AAAA,MAAA,GAAMX,KAAK;AAAAb,MAAAA,QAAA,EAC/EW;AAAK,KACD,CAAC;AAEZ,EAAA;AAEA,EAAA,oBACEuB,eAAA,CAAA,KAAA,EAAA;AAAA,IAAA,GAASV,WAAW;AAAA,IAAA,GAAMX,KAAK;AAAEnB,IAAAA,GAAG,EAAEA,GAAiC;IAAAM,QAAA,EAAA,cACrEM,cAAA,CAAC0B,aAAK,EAAA;AAAC3B,MAAAA,EAAE,EAAEA,EAAG;AAAC4B,MAAAA,IAAI,EAAEhB,eAAgB;AAACrB,MAAAA,SAAS,EAAC,kBAAkB;AAAAI,MAAAA,QAAA,EAC/DW;AAAK,KACD,CACP,eAAAL,cAAA,CAAChB,YAAY,EAAA;AAACI,MAAAA,GAAG,EAAEsB,SAAU;AAACvB,MAAAA,MAAM,EAAEA;AAAO,KAAA,CAC/C;AAAA,GAAK,CAAC;AAEV,CAAC;AAGHgB,MAAM,CAACD,WAAW,GAAG,QAAQ;;;;"}
1
+ {"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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AAKhB,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,107 +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
- import Button from '../button/Button.resolver.mjs';
27
+ import Link from '../link/Link.mjs';
27
28
  import Title from '../title/Title.mjs';
28
29
 
29
- const HeaderAction = /*#__PURE__*/React__default.forwardRef(({
30
+ const HeaderAction = ({
30
31
  action
31
- }, ref) => {
32
- const baseProps = {
33
- ref,
34
- className: 'np-header__action-button',
35
- priority: 'tertiary',
36
- size: 'sm',
37
- 'aria-label': action['aria-label'],
32
+ }) => {
33
+ const props = {
34
+ 'aria-label': action['aria-label']
35
+ };
36
+ if ('href' in action) {
37
+ return /*#__PURE__*/jsx(Link, {
38
+ href: action.href,
39
+ target: action.target,
40
+ onClick: action.onClick,
41
+ ...props,
42
+ children: action.text
43
+ });
44
+ }
45
+ return /*#__PURE__*/jsx(Button, {
46
+ className: "np-header__button",
47
+ priority: "tertiary",
48
+ size: "sm",
38
49
  onClick: action.onClick,
50
+ ...props,
39
51
  children: action.text
40
- };
41
- const linkProps = 'href' in action ? {
42
- href: action.href,
43
- target: action.target,
44
- as: 'a'
45
- } : {};
46
- return /*#__PURE__*/jsx("div", {
47
- className: "np-header__action",
48
- children: /*#__PURE__*/jsx(Button, {
49
- ...baseProps,
50
- ...linkProps
51
- })
52
52
  });
53
- });
54
- HeaderAction.displayName = 'HeaderAction';
53
+ };
55
54
  /**
56
- * @param {ButtonActionProps | LinkActionProps} [action] - Optional prop to specify the action button or link.
57
- * @param {Heading | 'legend'} [as='h5'] - Optional prop to override the heading element rendered for the title.
58
- * @param {string} title - Required prop to set the title of the section header.
59
- * @param {'group' | 'section'} [level='group'] - Optional prop to specify the level of the section header.
60
- * @param {string} [className]
61
- * @param {string} [testId]
62
55
  *
63
- * @see {@link Header } for further information.
64
- * @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
+ *
65
58
  */
66
- const Header = /*#__PURE__*/React__default.forwardRef(({
67
- as = 'h5',
59
+ const Header = ({
60
+ id,
68
61
  action,
69
- className,
70
- testId,
62
+ as = 'h5',
71
63
  title,
72
- level = 'group',
73
- ...props
74
- }, ref) => {
75
- const internalRef = useRef(null);
76
- const actionRef = useRef(null);
77
- const levelTypography = level === 'group' ? Typography.TITLE_GROUP : Typography.TITLE_SUBSECTION;
78
- const isLegendOrNoAction = !action || as === 'legend';
79
- const headerClasses = clsx('np-header', className, {
80
- 'np-header--group': level === 'group',
81
- 'np-header__title': isLegendOrNoAction
82
- });
83
- const commonProps = {
84
- className: headerClasses,
85
- 'data-testid': testId
86
- };
87
- useEffect(() => {
88
- if (as === 'legend' && internalRef.current) {
89
- const {
90
- parentElement
91
- } = internalRef.current;
92
- if (!parentElement || parentElement.tagName.toLowerCase() !== 'fieldset') {
93
- console.warn('Legends should be the first child in a fieldset, and this is not possible when including an action');
94
- }
95
- }
96
- }, [as]);
64
+ className,
65
+ role = undefined
66
+ }) => {
97
67
  if (!action) {
98
68
  return /*#__PURE__*/jsx(Title, {
99
- ref: internalRef,
100
69
  as: as,
101
- type: levelTypography,
102
- ...commonProps,
103
- ...props,
70
+ id: id,
71
+ role: role,
72
+ type: Typography.TITLE_GROUP,
73
+ className: clsx('np-header', 'np-header__title', className),
104
74
  children: title
105
75
  });
106
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
+ }
107
81
  return /*#__PURE__*/jsxs("div", {
108
- ...commonProps,
109
- ...props,
110
- ref: ref,
82
+ className: clsx('np-header', className),
111
83
  children: [/*#__PURE__*/jsx(Title, {
112
84
  as: as,
113
- type: levelTypography,
85
+ type: Typography.TITLE_GROUP,
86
+ id: id,
114
87
  className: "np-header__title",
115
88
  children: title
116
89
  }), /*#__PURE__*/jsx(HeaderAction, {
117
- ref: actionRef,
118
90
  action: action
119
91
  })]
120
92
  });
121
- });
122
- Header.displayName = 'Header';
93
+ };
123
94
 
124
- export { Header as default };
95
+ export { Header, Header as default };
125
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 Button from '../button';\nimport Title from '../title';\nimport React, { useEffect, useRef, FunctionComponent } from 'react';\n\ntype ActionProps = AriaLabelProperty & {\n text: string;\n onClick?: () => void;\n};\n\ntype ButtonActionProps = ActionProps;\ntype LinkActionProps = ActionProps & LinkProps;\n\nexport interface HeaderProps extends CommonProps {\n /**\n * Optional prop to define the action for the header. If the `href` property\n * is provided, a `Link` will be rendered instead of a `Button`.\n */\n action?: ButtonActionProps | LinkActionProps;\n\n /**\n * Option prop to specify DOM render element of the title\n *\n * - When `as=\"legend\"`, the `Header` will render as a `<legend>` element.\n * **Note:** `<legend>` elements must be the first child of a `<fieldset>` to comply with HTML semantics.\n * If this condition is not met, a warning will be logged to the console.\n *\n * - Other valid values include standard heading tags (`h1` to `h6`) or `header`.\n */\n as?: Heading | 'legend' | 'header';\n\n /** Required prop to set the title of the Header. */\n title: string;\n\n /** Optional prop to specify the level of the Header */\n level?: 'section' | 'group';\n\n className?: string;\n testId?: string;\n}\n\n/**\n * Renders a header action which can be either a button or a link.\n *\n * @param {Object} props - The properties object.\n * @param {ButtonActionProps | LinkActionProps} props.action - The action object which can be either a button or a link.\n * @returns {JSX.Element} The rendered header action component.\n */\nconst HeaderAction = React.forwardRef(\n (\n { action }: { action: ButtonActionProps | LinkActionProps },\n ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>,\n ) => {\n const baseProps = {\n ref,\n className: 'np-header__action-button',\n priority: 'tertiary' as const,\n size: 'sm' as const,\n 'aria-label': action['aria-label'],\n onClick: action.onClick,\n children: action.text,\n };\n\n const linkProps =\n 'href' in action ? { href: action.href, target: action.target, as: 'a' as const } : {};\n\n return (\n <div className=\"np-header__action\">\n <Button {...baseProps} {...linkProps} />\n </div>\n );\n },\n);\n\nHeaderAction.displayName = 'HeaderAction';\n\n/**\n * @param {ButtonActionProps | LinkActionProps} [action] - Optional prop to specify the action button or link.\n * @param {Heading | 'legend'} [as='h5'] - Optional prop to override the heading element rendered for the title.\n * @param {string} title - Required prop to set the title of the section header.\n * @param {'group' | 'section'} [level='group'] - Optional prop to specify the level of the section header.\n * @param {string} [className]\n * @param {string} [testId]\n *\n * @see {@link Header } for further information.\n * @see {@link https://storybook.wise.design/?path=/docs/typography-header--docs|Storybook Wise Design}\n */\nconst Header: FunctionComponent<HeaderProps> = React.forwardRef(\n (\n { as = 'h5', action, className, testId, title, level = 'group', ...props },\n ref: React.Ref<HTMLDivElement | HTMLHeadingElement | HTMLLegendElement>,\n ) => {\n const internalRef = useRef<HTMLLegendElement>(null);\n const actionRef = useRef<HTMLButtonElement | HTMLAnchorElement>(null);\n const levelTypography =\n level === 'group' ? Typography.TITLE_GROUP : Typography.TITLE_SUBSECTION;\n const isLegendOrNoAction = !action || as === 'legend';\n const headerClasses = clsx('np-header', className, {\n 'np-header--group': level === 'group',\n 'np-header__title': isLegendOrNoAction,\n });\n\n const commonProps = {\n className: headerClasses,\n 'data-testid': testId,\n };\n\n useEffect(() => {\n if (as === 'legend' && internalRef.current) {\n const { parentElement } = internalRef.current;\n if (!parentElement || parentElement.tagName.toLowerCase() !== 'fieldset') {\n console.warn(\n 'Legends should be the first child in a fieldset, and this is not possible when including an action',\n );\n }\n }\n }, [as]);\n\n if (!action) {\n return (\n <Title ref={internalRef} as={as} type={levelTypography} {...commonProps} {...props}>\n {title}\n </Title>\n );\n }\n\n return (\n <div {...commonProps} {...props} ref={ref as React.Ref<HTMLDivElement>}>\n <Title as={as} type={levelTypography} className=\"np-header__title\">\n {title}\n </Title>\n <HeaderAction ref={actionRef} action={action} />\n </div>\n );\n },\n);\n\nHeader.displayName = 'Header';\n\nexport default Header;\n"],"names":["HeaderAction","React","forwardRef","action","ref","baseProps","className","priority","size","onClick","children","text","linkProps","href","target","as","_jsx","Button","displayName","Header","testId","title","level","props","internalRef","useRef","actionRef","levelTypography","Typography","TITLE_GROUP","TITLE_SUBSECTION","isLegendOrNoAction","headerClasses","clsx","commonProps","useEffect","current","parentElement","tagName","toLowerCase","console","warn","Title","type","_jsxs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkDA,MAAMA,YAAY,gBAAGC,cAAK,CAACC,UAAU,CACnC,CACE;AAAEC,EAAAA;AAAM,CAAmD,EAC3DC,GAAqD,KACnD;AACF,EAAA,MAAMC,SAAS,GAAG;IAChBD,GAAG;AACHE,IAAAA,SAAS,EAAE,0BAA0B;AACrCC,IAAAA,QAAQ,EAAE,UAAmB;AAC7BC,IAAAA,IAAI,EAAE,IAAa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AK,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","warn","_jsxs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,MAAMA,YAAY,GAAGA,CAAC;AAAEC,EAAAA;AAAM,CAAmD,KAAI;AACnF,EAAA,MAAMC,KAAK,GAAG;IACZ,YAAY,EAAED,MAAM,CAAC,YAAY;GAClC;EAED,IAAI,MAAM,IAAIA,MAAM,EAAE;IACpB,oBACEE,GAAA,CAACC,IAAI,EAAA;MAACC,IAAI,EAAEJ,MAAM,CAACI,IAAK;MAACC,MAAM,EAAEL,MAAM,CAACK,MAAO;MAACC,OAAO,EAAEN,MAAM,CAACM,OAAQ;AAAA,MAAA,GAAKL,KAAK;MAAAM,QAAA,EAC/EP,MAAM,CAACQ;AAAI,KACR,CAAC;AAEX,EAAA;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;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,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;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,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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -45,6 +45,7 @@ var th = {
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 @@ var th = {
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",