@transferwise/components 46.133.0 → 46.134.0
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.
- package/build/chips/Chips.js.map +1 -1
- package/build/chips/Chips.mjs.map +1 -1
- package/build/label/Label.js +1 -1
- package/build/label/Label.js.map +1 -1
- package/build/label/Label.mjs +1 -1
- package/build/label/Label.mjs.map +1 -1
- package/build/logo/Logo.js +6 -0
- package/build/logo/Logo.js.map +1 -1
- package/build/logo/Logo.mjs +6 -0
- package/build/logo/Logo.mjs.map +1 -1
- package/build/main.css +47 -9
- package/build/moneyInput/MoneyInput.js +28 -12
- package/build/moneyInput/MoneyInput.js.map +1 -1
- package/build/moneyInput/MoneyInput.mjs +30 -14
- package/build/moneyInput/MoneyInput.mjs.map +1 -1
- package/build/moneyInput/currencyFormatting.js +8 -2
- package/build/moneyInput/currencyFormatting.js.map +1 -1
- package/build/moneyInput/currencyFormatting.mjs +5 -4
- package/build/moneyInput/currencyFormatting.mjs.map +1 -1
- package/build/statusIcon/StatusIcon.js +1 -12
- package/build/statusIcon/StatusIcon.js.map +1 -1
- package/build/statusIcon/StatusIcon.mjs +1 -12
- package/build/statusIcon/StatusIcon.mjs.map +1 -1
- package/build/styles/listItem/ListItem.css +4 -4
- package/build/styles/listItem/ListItem.grid.css +3 -3
- package/build/styles/main.css +47 -9
- package/build/styles/sentimentSurface/SentimentSurface.css +1 -1
- package/build/styles/statusIcon/StatusIcon.css +35 -4
- package/build/types/chips/Chips.d.ts +1 -1
- package/build/types/chips/Chips.d.ts.map +1 -1
- package/build/types/common/commonProps.d.ts +0 -6
- package/build/types/common/commonProps.d.ts.map +1 -1
- package/build/types/label/Label.d.ts.map +1 -1
- package/build/types/logo/Logo.d.ts +10 -1
- package/build/types/logo/Logo.d.ts.map +1 -1
- package/build/types/moneyInput/MoneyInput.d.ts +6 -0
- package/build/types/moneyInput/MoneyInput.d.ts.map +1 -1
- package/build/types/moneyInput/currencyFormatting.d.ts +4 -3
- package/build/types/moneyInput/currencyFormatting.d.ts.map +1 -1
- package/build/types/statusIcon/StatusIcon.d.ts.map +1 -1
- package/package.json +8 -8
- package/src/button/_stories/Button.story.tsx +15 -5
- package/src/checkboxButton/CheckboxButton.story.tsx +125 -44
- package/src/checkboxButton/CheckboxButton.test.story.tsx +236 -0
- package/src/chips/Chips.story.tsx +141 -102
- package/src/chips/Chips.test.story.tsx +177 -0
- package/src/chips/Chips.tsx +1 -1
- package/src/circularButton/CircularButton.story.tsx +261 -49
- package/src/circularButton/CircularButton.test.story.tsx +192 -2
- package/src/common/commonProps.ts +0 -6
- package/src/iconButton/IconButton.story.tsx +315 -110
- package/src/iconButton/IconButton.test.story.tsx +217 -44
- package/src/label/Label.tsx +1 -2
- package/src/listItem/ListItem.css +4 -4
- package/src/listItem/ListItem.grid.css +3 -3
- package/src/listItem/ListItem.grid.less +5 -3
- package/src/listItem/ListItem.less +1 -1
- package/src/listItem/ListItem.vars.less +2 -2
- package/src/listItem/_stories/ListItem.layout.test.story.tsx +55 -0
- package/src/logo/Logo.story.tsx +181 -21
- package/src/logo/Logo.test.story.tsx +40 -7
- package/src/logo/Logo.tsx +10 -1
- package/src/main.css +47 -9
- package/src/moneyInput/MoneyInput.story.tsx +10 -1
- package/src/moneyInput/MoneyInput.test.story.tsx +141 -1
- package/src/moneyInput/MoneyInput.test.tsx +45 -0
- package/src/moneyInput/MoneyInput.tsx +27 -3
- package/src/moneyInput/currencyFormatting.ts +11 -5
- package/src/sentimentSurface/SentimentSurface.css +1 -1
- package/src/sentimentSurface/SentimentSurface.less +1 -1
- package/src/statusIcon/StatusIcon.css +35 -4
- package/src/statusIcon/StatusIcon.less +35 -4
- package/src/statusIcon/StatusIcon.story.tsx +119 -79
- package/src/statusIcon/StatusIcon.test.story.tsx +125 -0
- package/src/statusIcon/StatusIcon.test.tsx +16 -23
- package/src/statusIcon/StatusIcon.tsx +2 -16
- package/src/switch/Switch.story.tsx +64 -42
- package/src/switch/Switch.test.story.tsx +123 -0
package/build/chips/Chips.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Chips.js","sources":["../../src/chips/Chips.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useIntl } from 'react-intl';\n\nimport { CommonProps, AriaLabelProperty } from '../common';\n\nimport Chip from './Chip';\nimport messages from './Chips.messages';\n\nexport type ChipValue = string | number;\n\nexport type Chip = {\n value: ChipValue;\n label: string;\n};\n\nexport type ChipsProps = CommonProps &\n AriaLabelProperty & {\n /** List of chips with string labels and string/number values */\n chips: readonly Chip[];\n /** Callback which is invoked when a chip is selected or deselected */\n onChange: ({\n isEnabled,\n selectedValue,\n }: {\n isEnabled: boolean;\n selectedValue: ChipValue;\n }) => void;\n /** Used to manage which chips are selected */\n selected: ChipValue | readonly ChipValue[];\n /**
|
|
1
|
+
{"version":3,"file":"Chips.js","sources":["../../src/chips/Chips.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useIntl } from 'react-intl';\n\nimport { CommonProps, AriaLabelProperty } from '../common';\n\nimport Chip from './Chip';\nimport messages from './Chips.messages';\n\nexport type ChipValue = string | number;\n\nexport type Chip = {\n value: ChipValue;\n label: string;\n};\n\nexport type ChipsProps = CommonProps &\n AriaLabelProperty & {\n /** List of chips with string labels and string/number values */\n chips: readonly Chip[];\n /** Callback which is invoked when a chip is selected or deselected */\n onChange: ({\n isEnabled,\n selectedValue,\n }: {\n isEnabled: boolean;\n selectedValue: ChipValue;\n }) => void;\n /** Used to manage which chips are selected */\n selected: ChipValue | readonly ChipValue[];\n /** True turns on Filter-mode, False is Choice */\n multiple?: boolean;\n };\n\nconst Chips = ({\n chips,\n onChange,\n selected,\n 'aria-label': ariaLabel,\n className,\n multiple,\n}: ChipsProps) => {\n const intl = useIntl();\n\n const isSelected = (value: ChipValue) =>\n Array.isArray(selected) ? selected.includes(value) : selected === value;\n\n const handleOnChange = (selectedValue: ChipValue, isCurrentlyEnabled: boolean) => {\n onChange({ isEnabled: !isCurrentlyEnabled, selectedValue });\n };\n\n return (\n <div\n className={clsx('np-chips d-flex', className)}\n aria-label={ariaLabel}\n role={!multiple ? 'radiogroup' : 'group'}\n >\n {chips.map((chip) => {\n const chipSelected = isSelected(chip.value);\n return (\n <Chip\n key={chip.value}\n role={!multiple ? 'radio' : 'checkbox'}\n aria-checked={chipSelected}\n value={chip.value}\n label={chip.label}\n closeButton={{\n 'aria-label': intl.formatMessage(messages.ariaLabel, { choice: chip.label }),\n }}\n className={clsx('text-xs-nowrap', {\n 'np-chip--selected': chipSelected,\n 'p-r-1': multiple && chipSelected,\n })}\n {...(multiple && chipSelected\n ? {\n onRemove: () => handleOnChange(chip.value, chipSelected),\n }\n : {\n onClick: () => handleOnChange(chip.value, chipSelected),\n onKeyPress: () => handleOnChange(chip.value, chipSelected),\n })}\n />\n );\n })}\n </div>\n );\n};\n\nexport default Chips;\n"],"names":["Chips","chips","onChange","selected","ariaLabel","className","multiple","intl","useIntl","isSelected","value","Array","isArray","includes","handleOnChange","selectedValue","isCurrentlyEnabled","isEnabled","_jsx","clsx","role","children","map","chip","chipSelected","Chip","label","closeButton","formatMessage","messages","choice","onRemove","onClick","onKeyPress"],"mappings":";;;;;;;;;;AAiCA,MAAMA,KAAK,GAAGA,CAAC;EACbC,KAAK;EACLC,QAAQ;EACRC,QAAQ;AACR,EAAA,YAAY,EAAEC,SAAS;EACvBC,SAAS;AACTC,EAAAA;AAAQ,CACG,KAAI;AACf,EAAA,MAAMC,IAAI,GAAGC,iBAAO,EAAE;EAEtB,MAAMC,UAAU,GAAIC,KAAgB,IAClCC,KAAK,CAACC,OAAO,CAACT,QAAQ,CAAC,GAAGA,QAAQ,CAACU,QAAQ,CAACH,KAAK,CAAC,GAAGP,QAAQ,KAAKO,KAAK;AAEzE,EAAA,MAAMI,cAAc,GAAGA,CAACC,aAAwB,EAAEC,kBAA2B,KAAI;AAC/Ed,IAAAA,QAAQ,CAAC;MAAEe,SAAS,EAAE,CAACD,kBAAk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C,GACC,CAAC;AAEV;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Chips.mjs","sources":["../../src/chips/Chips.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useIntl } from 'react-intl';\n\nimport { CommonProps, AriaLabelProperty } from '../common';\n\nimport Chip from './Chip';\nimport messages from './Chips.messages';\n\nexport type ChipValue = string | number;\n\nexport type Chip = {\n value: ChipValue;\n label: string;\n};\n\nexport type ChipsProps = CommonProps &\n AriaLabelProperty & {\n /** List of chips with string labels and string/number values */\n chips: readonly Chip[];\n /** Callback which is invoked when a chip is selected or deselected */\n onChange: ({\n isEnabled,\n selectedValue,\n }: {\n isEnabled: boolean;\n selectedValue: ChipValue;\n }) => void;\n /** Used to manage which chips are selected */\n selected: ChipValue | readonly ChipValue[];\n /**
|
|
1
|
+
{"version":3,"file":"Chips.mjs","sources":["../../src/chips/Chips.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useIntl } from 'react-intl';\n\nimport { CommonProps, AriaLabelProperty } from '../common';\n\nimport Chip from './Chip';\nimport messages from './Chips.messages';\n\nexport type ChipValue = string | number;\n\nexport type Chip = {\n value: ChipValue;\n label: string;\n};\n\nexport type ChipsProps = CommonProps &\n AriaLabelProperty & {\n /** List of chips with string labels and string/number values */\n chips: readonly Chip[];\n /** Callback which is invoked when a chip is selected or deselected */\n onChange: ({\n isEnabled,\n selectedValue,\n }: {\n isEnabled: boolean;\n selectedValue: ChipValue;\n }) => void;\n /** Used to manage which chips are selected */\n selected: ChipValue | readonly ChipValue[];\n /** True turns on Filter-mode, False is Choice */\n multiple?: boolean;\n };\n\nconst Chips = ({\n chips,\n onChange,\n selected,\n 'aria-label': ariaLabel,\n className,\n multiple,\n}: ChipsProps) => {\n const intl = useIntl();\n\n const isSelected = (value: ChipValue) =>\n Array.isArray(selected) ? selected.includes(value) : selected === value;\n\n const handleOnChange = (selectedValue: ChipValue, isCurrentlyEnabled: boolean) => {\n onChange({ isEnabled: !isCurrentlyEnabled, selectedValue });\n };\n\n return (\n <div\n className={clsx('np-chips d-flex', className)}\n aria-label={ariaLabel}\n role={!multiple ? 'radiogroup' : 'group'}\n >\n {chips.map((chip) => {\n const chipSelected = isSelected(chip.value);\n return (\n <Chip\n key={chip.value}\n role={!multiple ? 'radio' : 'checkbox'}\n aria-checked={chipSelected}\n value={chip.value}\n label={chip.label}\n closeButton={{\n 'aria-label': intl.formatMessage(messages.ariaLabel, { choice: chip.label }),\n }}\n className={clsx('text-xs-nowrap', {\n 'np-chip--selected': chipSelected,\n 'p-r-1': multiple && chipSelected,\n })}\n {...(multiple && chipSelected\n ? {\n onRemove: () => handleOnChange(chip.value, chipSelected),\n }\n : {\n onClick: () => handleOnChange(chip.value, chipSelected),\n onKeyPress: () => handleOnChange(chip.value, chipSelected),\n })}\n />\n );\n })}\n </div>\n );\n};\n\nexport default Chips;\n"],"names":["Chips","chips","onChange","selected","ariaLabel","className","multiple","intl","useIntl","isSelected","value","Array","isArray","includes","handleOnChange","selectedValue","isCurrentlyEnabled","isEnabled","_jsx","clsx","role","children","map","chip","chipSelected","Chip","label","closeButton","formatMessage","messages","choice","onRemove","onClick","onKeyPress"],"mappings":";;;;;;AAiCA,MAAMA,KAAK,GAAGA,CAAC;EACbC,KAAK;EACLC,QAAQ;EACRC,QAAQ;AACR,EAAA,YAAY,EAAEC,SAAS;EACvBC,SAAS;AACTC,EAAAA;AAAQ,CACG,KAAI;AACf,EAAA,MAAMC,IAAI,GAAGC,OAAO,EAAE;EAEtB,MAAMC,UAAU,GAAIC,KAAgB,IAClCC,KAAK,CAACC,OAAO,CAACT,QAAQ,CAAC,GAAGA,QAAQ,CAACU,QAAQ,CAACH,KAAK,CAAC,GAAGP,QAAQ,KAAKO,KAAK;AAEzE,EAAA,MAAMI,cAAc,GAAGA,CAACC,aAAwB,EAAEC,kBAA2B,KAAI;AAC/Ed,IAAAA,QAAQ,CAAC;MAAEe,SAAS,EAAE,CAACD,kBAAkB;AAAED,MA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;AAEV;;;;"}
|
package/build/label/Label.js
CHANGED
|
@@ -21,7 +21,6 @@ const Label = /*#__PURE__*/React.forwardRef(({
|
|
|
21
21
|
children: children
|
|
22
22
|
});
|
|
23
23
|
});
|
|
24
|
-
Label.displayName = 'Label';
|
|
25
24
|
const Optional = function Optional({
|
|
26
25
|
children,
|
|
27
26
|
className
|
|
@@ -53,6 +52,7 @@ const LabelNamespace = Object.assign(Label, {
|
|
|
53
52
|
Optional,
|
|
54
53
|
Description
|
|
55
54
|
});
|
|
55
|
+
LabelNamespace.displayName = 'Label';
|
|
56
56
|
|
|
57
57
|
exports.Label = LabelNamespace;
|
|
58
58
|
//# sourceMappingURL=Label.js.map
|
package/build/label/Label.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Label.js","sources":["../../src/label/Label.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport messages from './Label.messages';\nimport { useIntl } from 'react-intl';\nimport Body from '../body';\nimport { CommonProps } from '../common';\nimport { forwardRef, PropsWithChildren } from 'react';\n\nexport type LabelProps = {\n id?: string;\n htmlFor?: string;\n className?: string;\n children?: React.ReactNode;\n};\n\n/**\n * Avoid using `<Label>` component directly\n * it's for edge cases when `<Field />` isn't suitable for some reasons.\n *\n * Example:\n * ```\n * <Field label={..} description={..} required={..}>..</Field>\n * ```\n */\nconst Label = forwardRef<HTMLLabelElement, LabelProps>(\n ({ className, children, htmlFor, id }: LabelProps, ref) => {\n return (\n <label\n ref={ref}\n id={id}\n htmlFor={htmlFor}\n className={clsx(\n 'np-label d-flex flex-column np-text-body-default-bold text-primary m-b-0',\n className,\n )}\n >\n {children}\n </label>\n );\n },\n);\n\
|
|
1
|
+
{"version":3,"file":"Label.js","sources":["../../src/label/Label.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport messages from './Label.messages';\nimport { useIntl } from 'react-intl';\nimport Body from '../body';\nimport { CommonProps } from '../common';\nimport { forwardRef, PropsWithChildren } from 'react';\n\nexport type LabelProps = {\n id?: string;\n htmlFor?: string;\n className?: string;\n children?: React.ReactNode;\n};\n\n/**\n * Avoid using `<Label>` component directly\n * it's for edge cases when `<Field />` isn't suitable for some reasons.\n *\n * Example:\n * ```\n * <Field label={..} description={..} required={..}>..</Field>\n * ```\n */\nconst Label = forwardRef<HTMLLabelElement, LabelProps>(\n ({ className, children, htmlFor, id }: LabelProps, ref) => {\n return (\n <label\n ref={ref}\n id={id}\n htmlFor={htmlFor}\n className={clsx(\n 'np-label d-flex flex-column np-text-body-default-bold text-primary m-b-0',\n className,\n )}\n >\n {children}\n </label>\n );\n },\n);\n\nexport type LabelOptionalProps = PropsWithChildren<CommonProps>;\n\nconst Optional = function Optional({ children, className }: LabelOptionalProps) {\n const { formatMessage } = useIntl();\n return (\n <div>\n {children}\n <Body as=\"span\" className={clsx('text-secondary', 'm-l-1', className)}>\n {formatMessage(messages.optionalLabel)}\n </Body>\n </div>\n );\n};\n\nexport type LabelDescriptionProps = PropsWithChildren<CommonProps> & { id?: string };\n\nconst Description = function Description({ id, children, className }: LabelDescriptionProps) {\n return children ? (\n <Body id={id} className={clsx('text-secondary', className)}>\n {children}\n </Body>\n ) : null;\n};\n\n// eslint-disable-next-line functional/immutable-data\nconst LabelNamespace = Object.assign(Label, { Optional, Description });\n\nLabelNamespace.displayName = 'Label';\nexport { LabelNamespace as Label };\n"],"names":["Label","forwardRef","className","children","htmlFor","id","ref","_jsx","clsx","Optional","formatMessage","useIntl","_jsxs","Body","as","messages","optionalLabel","Description","LabelNamespace","Object","assign","displayName"],"mappings":";;;;;;;;;AAuBA,MAAMA,KAAK,gBAAGC,gBAAU,CACtB,CAAC;EAAEC,SAAS;EAAEC,QAAQ;EAAEC,OAAO;AAAEC,EAAAA;CAAgB,EAAEC,GAAG,KAAI;AACxD,EAAA,oBACEC,cAAA,CAAA,OAAA,EAAA;AACED,IAAAA,GAAG,EAAEA,GAAI;AACTD,IAAAA,EAAE,EAAEA,EAAG;AACPD,IAAAA,OAAO,EAA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label';
|
|
23
22
|
const Optional = function Optional({
|
|
24
23
|
children,
|
|
25
24
|
className
|
|
@@ -51,6 +50,7 @@ const LabelNamespace = Object.assign(Label, {
|
|
|
51
50
|
Optional,
|
|
52
51
|
Description
|
|
53
52
|
});
|
|
53
|
+
LabelNamespace.displayName = 'Label';
|
|
54
54
|
|
|
55
55
|
export { LabelNamespace as Label };
|
|
56
56
|
//# sourceMappingURL=Label.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Label.mjs","sources":["../../src/label/Label.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport messages from './Label.messages';\nimport { useIntl } from 'react-intl';\nimport Body from '../body';\nimport { CommonProps } from '../common';\nimport { forwardRef, PropsWithChildren } from 'react';\n\nexport type LabelProps = {\n id?: string;\n htmlFor?: string;\n className?: string;\n children?: React.ReactNode;\n};\n\n/**\n * Avoid using `<Label>` component directly\n * it's for edge cases when `<Field />` isn't suitable for some reasons.\n *\n * Example:\n * ```\n * <Field label={..} description={..} required={..}>..</Field>\n * ```\n */\nconst Label = forwardRef<HTMLLabelElement, LabelProps>(\n ({ className, children, htmlFor, id }: LabelProps, ref) => {\n return (\n <label\n ref={ref}\n id={id}\n htmlFor={htmlFor}\n className={clsx(\n 'np-label d-flex flex-column np-text-body-default-bold text-primary m-b-0',\n className,\n )}\n >\n {children}\n </label>\n );\n },\n);\n\
|
|
1
|
+
{"version":3,"file":"Label.mjs","sources":["../../src/label/Label.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport messages from './Label.messages';\nimport { useIntl } from 'react-intl';\nimport Body from '../body';\nimport { CommonProps } from '../common';\nimport { forwardRef, PropsWithChildren } from 'react';\n\nexport type LabelProps = {\n id?: string;\n htmlFor?: string;\n className?: string;\n children?: React.ReactNode;\n};\n\n/**\n * Avoid using `<Label>` component directly\n * it's for edge cases when `<Field />` isn't suitable for some reasons.\n *\n * Example:\n * ```\n * <Field label={..} description={..} required={..}>..</Field>\n * ```\n */\nconst Label = forwardRef<HTMLLabelElement, LabelProps>(\n ({ className, children, htmlFor, id }: LabelProps, ref) => {\n return (\n <label\n ref={ref}\n id={id}\n htmlFor={htmlFor}\n className={clsx(\n 'np-label d-flex flex-column np-text-body-default-bold text-primary m-b-0',\n className,\n )}\n >\n {children}\n </label>\n );\n },\n);\n\nexport type LabelOptionalProps = PropsWithChildren<CommonProps>;\n\nconst Optional = function Optional({ children, className }: LabelOptionalProps) {\n const { formatMessage } = useIntl();\n return (\n <div>\n {children}\n <Body as=\"span\" className={clsx('text-secondary', 'm-l-1', className)}>\n {formatMessage(messages.optionalLabel)}\n </Body>\n </div>\n );\n};\n\nexport type LabelDescriptionProps = PropsWithChildren<CommonProps> & { id?: string };\n\nconst Description = function Description({ id, children, className }: LabelDescriptionProps) {\n return children ? (\n <Body id={id} className={clsx('text-secondary', className)}>\n {children}\n </Body>\n ) : null;\n};\n\n// eslint-disable-next-line functional/immutable-data\nconst LabelNamespace = Object.assign(Label, { Optional, Description });\n\nLabelNamespace.displayName = 'Label';\nexport { LabelNamespace as Label };\n"],"names":["Label","forwardRef","className","children","htmlFor","id","ref","_jsx","clsx","Optional","formatMessage","useIntl","_jsxs","Body","as","messages","optionalLabel","Description","LabelNamespace","Object","assign","displayName"],"mappings":";;;;;;;AAuBA,MAAMA,KAAK,gBAAGC,UAAU,CACtB,CAAC;EAAEC,SAAS;EAAEC,QAAQ;EAAEC,OAAO;AAAEC,EAAAA;CAAgB,EAAEC,GAAG,KAAI;AACxD,EAAA,oBACEC,GAAA,CAAA,OAAA,EAAA;AACED,IAAAA,GAAG,EAAEA,GAAI;AACTD,IAAAA,EAAE,EAAEA,EAAG;AACPD,IAAAA,OAAO,EAAEA,OAAQ;AACjBF,IAAAA,SAAS,EAAEM,IAAI,CACb,0EAA0E,EAC1EN,SAAS,CACT;AAAAC,IAAAA,QAAA,EAEDA;AAAQ,GACJ,CAAC;AAEZ,CAAC,CACF;AAID,MAAMM,QAAQ,GAAG,SAASA,QAAQA,CAAC;EAAEN,QAAQ;AAAED,EAAAA;AAAS,CAAsB,EAAA;EAC5E,MAAM;AAAEQ,IAAAA;GAAe,GAAGC,OAAO,EAAE;AACnC,EAAA,oBACEC,IAAA,CAAA,KAAA,EAAA;AAAAT,IAAAA,QAAA,EAAA,CACGA,QAAQ,eACTI,GAAA,CAACM,IAAI,EAAA;AAACC,MAAAA,EAAE,EAAC,MAAM;MAACZ,SAAS,EAAEM,IAAI,CAAC,gBAAgB,EAAE,OAAO,EAAEN,SAAS,CAAE;AAAAC,MAAAA,QAAA,EACnEO,aAAa,CAACK,QAAQ,CAACC,aAAa;AAAC,KAClC,CACR;AAAA,GAAK,CAAC;AAEV,CAAC;AAID,MAAMC,WAAW,GAAG,SAASA,WAAWA,CAAC;EAAEZ,EAAE;EAAEF,QAAQ;AAAED,EAAAA;AAAS,CAAyB,EAAA;AACzF,EAAA,OAAOC,QAAQ,gBACbI,GAAA,CAACM,IAAI,EAAA;AAACR,IAAAA,EAAE,EAAEA,EAAG;AAACH,IAAAA,SAAS,EAAEM,IAAI,CAAC,gBAAgB,EAAEN,SAAS,CAAE;AAAAC,IAAAA,QAAA,EACxDA;GACG,CAAC,GACL,IAAI;AACV,CAAC;AAED;AACA,MAAMe,cAAc,GAAGC,MAAM,CAACC,MAAM,CAACpB,KAAK,EAAE;EAAES,QAAQ;AAAEQ,EAAAA;AAAW,CAAE;AAErEC,cAAc,CAACG,WAAW,GAAG,OAAO;;;;"}
|
package/build/logo/Logo.js
CHANGED
|
@@ -29,6 +29,12 @@ const labelByType = {
|
|
|
29
29
|
WISE_BUSINESS: 'Wise Business',
|
|
30
30
|
WISE_PLATFORM: 'Wise Platform'
|
|
31
31
|
};
|
|
32
|
+
/**
|
|
33
|
+
* Renders the Wise wordmark logo. Responsive — shows the flag-only mark on small viewports
|
|
34
|
+
* and the full wordmark on ≥576px (small breakpoint and above).
|
|
35
|
+
*
|
|
36
|
+
* @see {@link https://wise.design/foundations/logo Design Spec}
|
|
37
|
+
*/
|
|
32
38
|
function Logo({
|
|
33
39
|
className,
|
|
34
40
|
inverse,
|
package/build/logo/Logo.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Logo.js","sources":["../../src/logo/Logo.tsx"],"sourcesContent":["import { clsx } from 'clsx';\n\nimport {\n LogoWise,\n LogoWiseInverse,\n LogoWisePlatform,\n LogoWisePlatformInverse,\n LogoFlag,\n LogoFlagInverse,\n LogoFlagPlatform,\n LogoFlagPlatformInverse,\n} from './logo-assets';\n\nconst svgPaths = {\n WISE: LogoWise,\n WISE_BUSINESS: LogoWise,\n WISE_INVERSE: LogoWiseInverse,\n WISE_BUSINESS_INVERSE: LogoWiseInverse,\n WISE_PLATFORM: LogoWisePlatform,\n WISE_PLATFORM_INVERSE: LogoWisePlatformInverse,\n WISE_FLAG: LogoFlag,\n WISE_FLAG_INVERSE: LogoFlagInverse,\n WISE_FLAG_PLATFORM: LogoFlagPlatform,\n WISE_FLAG_PLATFORM_INVERSE: LogoFlagPlatformInverse,\n};\n\nexport enum LogoType {\n WISE = 'WISE',\n WISE_BUSINESS = 'WISE_BUSINESS',\n WISE_PLATFORM = 'WISE_PLATFORM',\n}\n\nexport interface LogoProps {\n /** Extra classes applied to Logo */\n className?: string;\n
|
|
1
|
+
{"version":3,"file":"Logo.js","sources":["../../src/logo/Logo.tsx"],"sourcesContent":["import { clsx } from 'clsx';\n\nimport {\n LogoWise,\n LogoWiseInverse,\n LogoWisePlatform,\n LogoWisePlatformInverse,\n LogoFlag,\n LogoFlagInverse,\n LogoFlagPlatform,\n LogoFlagPlatformInverse,\n} from './logo-assets';\n\nconst svgPaths = {\n WISE: LogoWise,\n WISE_BUSINESS: LogoWise,\n WISE_INVERSE: LogoWiseInverse,\n WISE_BUSINESS_INVERSE: LogoWiseInverse,\n WISE_PLATFORM: LogoWisePlatform,\n WISE_PLATFORM_INVERSE: LogoWisePlatformInverse,\n WISE_FLAG: LogoFlag,\n WISE_FLAG_INVERSE: LogoFlagInverse,\n WISE_FLAG_PLATFORM: LogoFlagPlatform,\n WISE_FLAG_PLATFORM_INVERSE: LogoFlagPlatformInverse,\n};\n\nexport enum LogoType {\n WISE = 'WISE',\n WISE_BUSINESS = 'WISE_BUSINESS',\n WISE_PLATFORM = 'WISE_PLATFORM',\n}\n\nexport interface LogoProps {\n /** Extra classes applied to Logo */\n className?: string;\n /**\n * Renders a light-coloured version suited for dark backgrounds.\n * @default false\n */\n inverse?: boolean;\n /**\n * What type of logo to display\n * @default 'WISE'\n */\n type?: `${LogoType}`;\n}\n\nconst labelByType = {\n WISE: 'Wise',\n WISE_BUSINESS: 'Wise Business',\n WISE_PLATFORM: 'Wise Platform',\n} satisfies Record<`${LogoType}`, string>;\n\n/**\n * Renders the Wise wordmark logo. Responsive — shows the flag-only mark on small viewports\n * and the full wordmark on ≥576px (small breakpoint and above).\n *\n * @see {@link https://wise.design/foundations/logo Design Spec}\n */\nexport default function Logo({ className, inverse, type = 'WISE' }: LogoProps) {\n const LogoSm =\n svgPaths[`WISE_FLAG${type === 'WISE_PLATFORM' ? '_PLATFORM' : ''}${inverse ? '_INVERSE' : ''}`];\n const LogoMd = svgPaths[`${type}${inverse ? '_INVERSE' : ''}`];\n\n return (\n <span aria-label={labelByType[type]} role=\"img\" className={clsx(className, 'np-logo')}>\n <LogoSm className=\"np-logo-svg np-logo-svg--size-sm\" />\n <LogoMd className=\"np-logo-svg np-logo-svg--size-md\" />\n </span>\n );\n}\n"],"names":["svgPaths","WISE","LogoWise","WISE_BUSINESS","WISE_INVERSE","LogoWiseInverse","WISE_BUSINESS_INVERSE","WISE_PLATFORM","LogoWisePlatform","WISE_PLATFORM_INVERSE","LogoWisePlatformInverse","WISE_FLAG","LogoFlag","WISE_FLAG_INVERSE","LogoFlagInverse","WISE_FLAG_PLATFORM","LogoFlagPlatform","WISE_FLAG_PLATFORM_INVERSE","LogoFlagPlatformInverse","LogoType","labelByType","Logo","className","inverse","type","LogoSm","LogoMd","_jsxs","role","cls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AAA,MAAA,EAAA;IAAM,YAAA,EAAYP,WAAW,CAACI,IAAI,CAAE;AAACI,IAAAA,IAAI,EAAC,KAAK;AAACN,IAAAA,SAAS,EAAEO,SAAI,CAACP,SAAS,EAAE,SAAS,CAAE;IAAAQ,QAAA,EAAA,cACpFC,cAAA,CAACN,MAAM,EAAA;AAACH,MAAAA,SAAS,EAAC;AAAkC,KAAA,CACpD,eAAAS,cAAA,CAACL,MAAM,EAAA;AAACJ,MAAAA,SAAS,EAAC;AAAkC,KAAA,CACtD;AAAA,GAAM,CAAC;AAEX;;;;"}
|
package/build/logo/Logo.mjs
CHANGED
|
@@ -25,6 +25,12 @@ const labelByType = {
|
|
|
25
25
|
WISE_BUSINESS: 'Wise Business',
|
|
26
26
|
WISE_PLATFORM: 'Wise Platform'
|
|
27
27
|
};
|
|
28
|
+
/**
|
|
29
|
+
* Renders the Wise wordmark logo. Responsive — shows the flag-only mark on small viewports
|
|
30
|
+
* and the full wordmark on ≥576px (small breakpoint and above).
|
|
31
|
+
*
|
|
32
|
+
* @see {@link https://wise.design/foundations/logo Design Spec}
|
|
33
|
+
*/
|
|
28
34
|
function Logo({
|
|
29
35
|
className,
|
|
30
36
|
inverse,
|
package/build/logo/Logo.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Logo.mjs","sources":["../../src/logo/Logo.tsx"],"sourcesContent":["import { clsx } from 'clsx';\n\nimport {\n LogoWise,\n LogoWiseInverse,\n LogoWisePlatform,\n LogoWisePlatformInverse,\n LogoFlag,\n LogoFlagInverse,\n LogoFlagPlatform,\n LogoFlagPlatformInverse,\n} from './logo-assets';\n\nconst svgPaths = {\n WISE: LogoWise,\n WISE_BUSINESS: LogoWise,\n WISE_INVERSE: LogoWiseInverse,\n WISE_BUSINESS_INVERSE: LogoWiseInverse,\n WISE_PLATFORM: LogoWisePlatform,\n WISE_PLATFORM_INVERSE: LogoWisePlatformInverse,\n WISE_FLAG: LogoFlag,\n WISE_FLAG_INVERSE: LogoFlagInverse,\n WISE_FLAG_PLATFORM: LogoFlagPlatform,\n WISE_FLAG_PLATFORM_INVERSE: LogoFlagPlatformInverse,\n};\n\nexport enum LogoType {\n WISE = 'WISE',\n WISE_BUSINESS = 'WISE_BUSINESS',\n WISE_PLATFORM = 'WISE_PLATFORM',\n}\n\nexport interface LogoProps {\n /** Extra classes applied to Logo */\n className?: string;\n
|
|
1
|
+
{"version":3,"file":"Logo.mjs","sources":["../../src/logo/Logo.tsx"],"sourcesContent":["import { clsx } from 'clsx';\n\nimport {\n LogoWise,\n LogoWiseInverse,\n LogoWisePlatform,\n LogoWisePlatformInverse,\n LogoFlag,\n LogoFlagInverse,\n LogoFlagPlatform,\n LogoFlagPlatformInverse,\n} from './logo-assets';\n\nconst svgPaths = {\n WISE: LogoWise,\n WISE_BUSINESS: LogoWise,\n WISE_INVERSE: LogoWiseInverse,\n WISE_BUSINESS_INVERSE: LogoWiseInverse,\n WISE_PLATFORM: LogoWisePlatform,\n WISE_PLATFORM_INVERSE: LogoWisePlatformInverse,\n WISE_FLAG: LogoFlag,\n WISE_FLAG_INVERSE: LogoFlagInverse,\n WISE_FLAG_PLATFORM: LogoFlagPlatform,\n WISE_FLAG_PLATFORM_INVERSE: LogoFlagPlatformInverse,\n};\n\nexport enum LogoType {\n WISE = 'WISE',\n WISE_BUSINESS = 'WISE_BUSINESS',\n WISE_PLATFORM = 'WISE_PLATFORM',\n}\n\nexport interface LogoProps {\n /** Extra classes applied to Logo */\n className?: string;\n /**\n * Renders a light-coloured version suited for dark backgrounds.\n * @default false\n */\n inverse?: boolean;\n /**\n * What type of logo to display\n * @default 'WISE'\n */\n type?: `${LogoType}`;\n}\n\nconst labelByType = {\n WISE: 'Wise',\n WISE_BUSINESS: 'Wise Business',\n WISE_PLATFORM: 'Wise Platform',\n} satisfies Record<`${LogoType}`, string>;\n\n/**\n * Renders the Wise wordmark logo. Responsive — shows the flag-only mark on small viewports\n * and the full wordmark on ≥576px (small breakpoint and above).\n *\n * @see {@link https://wise.design/foundations/logo Design Spec}\n */\nexport default function Logo({ className, inverse, type = 'WISE' }: LogoProps) {\n const LogoSm =\n svgPaths[`WISE_FLAG${type === 'WISE_PLATFORM' ? '_PLATFORM' : ''}${inverse ? '_INVERSE' : ''}`];\n const LogoMd = svgPaths[`${type}${inverse ? '_INVERSE' : ''}`];\n\n return (\n <span aria-label={labelByType[type]} role=\"img\" className={clsx(className, 'np-logo')}>\n <LogoSm className=\"np-logo-svg np-logo-svg--size-sm\" />\n <LogoMd className=\"np-logo-svg np-logo-svg--size-md\" />\n </span>\n );\n}\n"],"names":["svgPaths","WISE","LogoWise","WISE_BUSINESS","WISE_INVERSE","LogoWiseInverse","WISE_BUSINESS_INVERSE","WISE_PLATFORM","LogoWisePlatform","WISE_PLATFORM_INVERSE","LogoWisePlatformInverse","WISE_FLAG","LogoFlag","WISE_FLAG_INVERSE","LogoFlagInverse","WISE_FLAG_PLATFORM","LogoFlagPlatform","WISE_FLAG_PLATFORM_INVERSE","LogoFlagPlatformInverse","LogoType","labelByType","Logo","className","inverse","type","LogoSm","LogoMd","_jsxs","role","clsx","children","_jsx"],"mappings":";;;;AAaA,MAAMA,QAAQ,GAAG;AACfC,EAAAA,IAAI,EAAEC,QAAQ;AACdC,EAAAA,aAAa,EAAED,QAAQ;AACvBE,EAAAA,YAAY,EAAEC,eAAe;AAC7BC,EAAAA,qBAAqB,EAAED,eAAe;AACtCE,EAAAA,aAAa,EAAEC,gBAAgB;AAC/BC,EAAAA,qBAAqB,EAAEC,uBAAuB;AAC9CC,EAAAA,SAAS,EAAEC,QAAQ;AACnBC,EAAAA,iBAAiB,EAAEC,eAAe;AAClCC,EAAAA,kBAAkB,EAAEC,gBAAgB;AACpCC,EAAAA,0BAA0B,EAAEC;CAC7B;IAEWC;AAAZ,CAAA,UAAYA,QAAQ,EAAA;AAClBA,EAAAA,QAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACbA,EAAAA,QAAA,CAAA,eAAA,CAAA,GAAA,eAA+B;AAC/BA,EAAAA,QAAA,CAAA,eAAA,CAAA,GAAA,eAA+B;AACjC,CAAC,EAJWA,QAAQ,KAARA,QAAQ,GAAA,EAAA,CAAA,CAAA;AAqBpB,MAAMC,WAAW,GAAG;AAClBnB,EAAAA,IAAI,EAAE,MAAM;AACZE,EAAAA,aAAa,EAAE,eAAe;AAC9BI,EAAAA,aAAa,EAAE;CACwB;AAEzC;;;;;AAKG;AACW,SAAUc,IAAIA,CAAC;EAAEC,SAAS;EAAEC,OAAO;AAAEC,EAAAA,IAAI,GAAG;AAAM,CAAa,EAAA;AAC3E,EAAA,MAAMC,MAAM,GACVzB,QAAQ,CAAC,CAAA,SAAA,EAAYwB,IAAI,KAAK,eAAe,GAAG,WAAW,GAAG,EAAE,GAAGD,OAAO,GAAG,UAAU,GAAG,EAAE,EAAE,CAAC;AACjG,EAAA,MAAMG,MAAM,GAAG1B,QAAQ,CAAC,CAAA,EAAGwB,IAAI,CAAA,EAAGD,OAAO,GAAG,UAAU,GAAG,EAAE,EAAE,CAAC;AAE9D,EAAA,oBACEI,IAAA,CAAA,MAAA,EAAA;IAAM,YAAA,EAAYP,WAAW,CAACI,IAAI,CAAE;AAACI,IAAAA,IAAI,EAAC,KAAK;AAACN,IAAAA,SAAS,EAAEO,IAAI,CAACP,SAAS,EAAE,SAAS,CAAE;IAAAQ,QAAA,EAAA,cACpFC,GAAA,CAACN,MAAM,EAAA;AAACH,MAAAA,SAAS,EAAC;AAAkC,KAAA,CACpD,eAAAS,GAAA,CAACL,MAAM,EAAA;AAACJ,MAAAA,SAAS,EAAC;AAAkC,KAAA,CACtD;AAAA,GAAM,CAAC;AAEX;;;;"}
|
package/build/main.css
CHANGED
|
@@ -25824,7 +25824,7 @@ a[data-toggle="tooltip"] {
|
|
|
25824
25824
|
--color-sentiment-interactive-control: #CB272F;
|
|
25825
25825
|
--color-sentiment-interactive-control-hover: #B8232B;
|
|
25826
25826
|
--color-sentiment-interactive-control-active: #A72027;
|
|
25827
|
-
--color-sentiment-background-surface: #
|
|
25827
|
+
--color-sentiment-background-surface: #CB272F;
|
|
25828
25828
|
--color-sentiment-background-surface-hover: #B8232B;
|
|
25829
25829
|
--color-sentiment-background-surface-active: #A72027;
|
|
25830
25830
|
}
|
|
@@ -29430,7 +29430,7 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
|
|
|
29430
29430
|
margin-top: -2px;
|
|
29431
29431
|
}
|
|
29432
29432
|
|
|
29433
|
-
@container (
|
|
29433
|
+
@container (width > 308px) {
|
|
29434
29434
|
.wds-list-item-gridWrapper .wds-list-item-control-wrapper {
|
|
29435
29435
|
height: var(--wds-list-item-control-wrapper-height);
|
|
29436
29436
|
align-content: center;
|
|
@@ -29527,7 +29527,7 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
|
|
|
29527
29527
|
}
|
|
29528
29528
|
}
|
|
29529
29529
|
|
|
29530
|
-
@container (
|
|
29530
|
+
@container (240px < width <= 308px) {
|
|
29531
29531
|
.wds-list-item-gridWrapper .wds-list-item-media-image {
|
|
29532
29532
|
-o-object-position: bottom left;
|
|
29533
29533
|
object-position: bottom left;
|
|
@@ -29659,7 +29659,7 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
|
|
|
29659
29659
|
}
|
|
29660
29660
|
}
|
|
29661
29661
|
|
|
29662
|
-
@container (
|
|
29662
|
+
@container (width <= 240px) {
|
|
29663
29663
|
.wds-list-item-gridWrapper .wds-list-item-control-wrapper {
|
|
29664
29664
|
align-content: start;
|
|
29665
29665
|
}
|
|
@@ -29987,7 +29987,7 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
|
|
|
29987
29987
|
justify-content: center;
|
|
29988
29988
|
}
|
|
29989
29989
|
|
|
29990
|
-
@container (
|
|
29990
|
+
@container (width > 308px) {
|
|
29991
29991
|
.wds-list-item-titles,
|
|
29992
29992
|
.wds-list-item-value {
|
|
29993
29993
|
min-height: 100%;
|
|
@@ -32429,12 +32429,50 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
32429
32429
|
}
|
|
32430
32430
|
}
|
|
32431
32431
|
|
|
32432
|
-
.
|
|
32433
|
-
|
|
32432
|
+
.status-circle.negative,
|
|
32433
|
+
.status-circle.error {
|
|
32434
|
+
background-color: var(--color-sentiment-interactive-primary, var(--color-sentiment-negative));
|
|
32434
32435
|
}
|
|
32435
32436
|
|
|
32436
|
-
.
|
|
32437
|
-
|
|
32437
|
+
.status-circle.negative .status-icon,
|
|
32438
|
+
.status-circle.error .status-icon {
|
|
32439
|
+
color: var(--color-sentiment-interactive-control, var(--color-sentiment-negative-secondary));
|
|
32440
|
+
}
|
|
32441
|
+
|
|
32442
|
+
.status-circle.positive,
|
|
32443
|
+
.status-circle.success {
|
|
32444
|
+
background-color: var(--color-sentiment-interactive-primary, var(--color-sentiment-positive));
|
|
32445
|
+
}
|
|
32446
|
+
|
|
32447
|
+
.status-circle.positive .status-icon,
|
|
32448
|
+
.status-circle.success .status-icon {
|
|
32449
|
+
color: var(--color-sentiment-interactive-control, var(--color-sentiment-positive-secondary));
|
|
32450
|
+
}
|
|
32451
|
+
|
|
32452
|
+
.status-circle.warning,
|
|
32453
|
+
.status-circle.pending {
|
|
32454
|
+
background-color: var(--color-sentiment-interactive-primary, var(--color-sentiment-warning));
|
|
32455
|
+
}
|
|
32456
|
+
|
|
32457
|
+
.status-circle.warning .status-icon,
|
|
32458
|
+
.status-circle.pending .status-icon {
|
|
32459
|
+
color: var(--color-sentiment-interactive-control, var(--color-dark));
|
|
32460
|
+
}
|
|
32461
|
+
|
|
32462
|
+
.status-circle.neutral,
|
|
32463
|
+
.status-circle.info {
|
|
32464
|
+
background-color: #5d7079;
|
|
32465
|
+
background-color: var(--color-sentiment-interactive-primary, var(--color-content-secondary));
|
|
32466
|
+
}
|
|
32467
|
+
|
|
32468
|
+
.status-circle.neutral .status-icon,
|
|
32469
|
+
.status-circle.info .status-icon {
|
|
32470
|
+
color: var(--color-sentiment-interactive-control, var(--color-contrast-overlay));
|
|
32471
|
+
}
|
|
32472
|
+
|
|
32473
|
+
.np-theme-personal--bright-green .status-circle.neutral .status-icon,
|
|
32474
|
+
.np-theme-personal--bright-green .status-circle.info .status-icon {
|
|
32475
|
+
color: var(--color-sentiment-interactive-control, var(--color-white));
|
|
32438
32476
|
}
|
|
32439
32477
|
|
|
32440
32478
|
.tw-stepper {
|
|
@@ -50,16 +50,24 @@ const isNumberOrNull = v => neptuneValidation.isNumber(v) || neptuneValidation.i
|
|
|
50
50
|
const formatAmountIfSet = ({
|
|
51
51
|
amount,
|
|
52
52
|
currency,
|
|
53
|
-
locale
|
|
53
|
+
locale,
|
|
54
|
+
decimals
|
|
54
55
|
}) => {
|
|
55
|
-
|
|
56
|
+
if (typeof amount !== 'number') {
|
|
57
|
+
return '';
|
|
58
|
+
}
|
|
59
|
+
if (decimals != null && currencyFormatting.getCurrencyDecimals(currency) !== 0) {
|
|
60
|
+
return formatting.formatNumber(amount, locale, decimals);
|
|
61
|
+
}
|
|
62
|
+
return formatting.formatAmount(amount, currency, locale);
|
|
56
63
|
};
|
|
57
64
|
const parseNumber = ({
|
|
58
65
|
amount,
|
|
59
66
|
currency,
|
|
60
|
-
locale
|
|
67
|
+
locale,
|
|
68
|
+
decimals
|
|
61
69
|
}) => {
|
|
62
|
-
return currencyFormatting.parseAmount(amount, currency, locale);
|
|
70
|
+
return currencyFormatting.parseAmount(amount, currency, locale, decimals);
|
|
63
71
|
};
|
|
64
72
|
const allowedInputKeys = new Set(['Backspace', 'Delete', ',', '.', 'ArrowDown', 'ArrowUp', 'ArrowLeft', 'ArrowRight', 'Enter', 'Escape', 'Tab']);
|
|
65
73
|
class MoneyInput extends React.Component {
|
|
@@ -76,7 +84,8 @@ class MoneyInput extends React.Component {
|
|
|
76
84
|
formattedAmount: formatAmountIfSet({
|
|
77
85
|
amount: props.amount,
|
|
78
86
|
currency: props.selectedCurrency.currency,
|
|
79
|
-
locale: props.intl.locale
|
|
87
|
+
locale: props.intl.locale,
|
|
88
|
+
decimals: props.decimals
|
|
80
89
|
}),
|
|
81
90
|
locale: props.intl.locale
|
|
82
91
|
};
|
|
@@ -90,7 +99,8 @@ class MoneyInput extends React.Component {
|
|
|
90
99
|
formattedAmount: formatAmountIfSet({
|
|
91
100
|
amount: nextProps.amount,
|
|
92
101
|
currency: nextProps.selectedCurrency.currency,
|
|
93
|
-
locale: nextProps.intl.locale
|
|
102
|
+
locale: nextProps.intl.locale,
|
|
103
|
+
decimals: nextProps.decimals
|
|
94
104
|
})
|
|
95
105
|
});
|
|
96
106
|
}
|
|
@@ -117,14 +127,16 @@ class MoneyInput extends React.Component {
|
|
|
117
127
|
const parsed = neptuneValidation.isEmpty(paste) ? null : parseNumber({
|
|
118
128
|
amount: paste,
|
|
119
129
|
currency: this.props.selectedCurrency.currency,
|
|
120
|
-
locale
|
|
130
|
+
locale,
|
|
131
|
+
decimals: this.props.decimals
|
|
121
132
|
});
|
|
122
133
|
if (isNumberOrNull(parsed)) {
|
|
123
134
|
this.setState({
|
|
124
135
|
formattedAmount: formatAmountIfSet({
|
|
125
136
|
amount: parsed,
|
|
126
137
|
currency: this.props.selectedCurrency.currency,
|
|
127
|
-
locale
|
|
138
|
+
locale,
|
|
139
|
+
decimals: this.props.decimals
|
|
128
140
|
})
|
|
129
141
|
});
|
|
130
142
|
this.props.onAmountChange?.(parsed);
|
|
@@ -141,7 +153,8 @@ class MoneyInput extends React.Component {
|
|
|
141
153
|
const parsed = neptuneValidation.isEmpty(value) ? null : parseNumber({
|
|
142
154
|
amount: value,
|
|
143
155
|
currency: this.props.selectedCurrency.currency,
|
|
144
|
-
locale: this.state.locale
|
|
156
|
+
locale: this.state.locale,
|
|
157
|
+
decimals: this.props.decimals
|
|
145
158
|
});
|
|
146
159
|
if (isNumberOrNull(parsed)) {
|
|
147
160
|
this.props.onAmountChange?.(parsed);
|
|
@@ -181,7 +194,8 @@ class MoneyInput extends React.Component {
|
|
|
181
194
|
const parsed = parseNumber({
|
|
182
195
|
amount: previousState.formattedAmount,
|
|
183
196
|
currency: this.props.selectedCurrency.currency,
|
|
184
|
-
locale: previousState.locale
|
|
197
|
+
locale: previousState.locale,
|
|
198
|
+
decimals: this.props.decimals
|
|
185
199
|
});
|
|
186
200
|
if (!isNumberOrNull(parsed)) {
|
|
187
201
|
return {
|
|
@@ -192,7 +206,8 @@ class MoneyInput extends React.Component {
|
|
|
192
206
|
formattedAmount: formatAmountIfSet({
|
|
193
207
|
amount: parsed,
|
|
194
208
|
currency: this.props.selectedCurrency.currency,
|
|
195
|
-
locale: previousState.locale
|
|
209
|
+
locale: previousState.locale,
|
|
210
|
+
decimals: this.props.decimals
|
|
196
211
|
})
|
|
197
212
|
};
|
|
198
213
|
});
|
|
@@ -257,7 +272,8 @@ class MoneyInput extends React.Component {
|
|
|
257
272
|
placeholder: formatAmountIfSet({
|
|
258
273
|
amount: this.props.placeholder,
|
|
259
274
|
currency: this.props.selectedCurrency.currency,
|
|
260
|
-
locale: this.state.locale
|
|
275
|
+
locale: this.state.locale,
|
|
276
|
+
decimals: this.props.decimals
|
|
261
277
|
}),
|
|
262
278
|
autoComplete: "off",
|
|
263
279
|
"aria-describedby": selectedCurrencyElementId,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MoneyInput.js","sources":["../../src/moneyInput/MoneyInput.tsx"],"sourcesContent":["import { isEmpty, isNumber, isNull } from '@transferwise/neptune-validation';\nimport { Flag } from '@wise/art';\nimport { clsx } from 'clsx';\nimport { Component } from 'react';\nimport { injectIntl, WrappedComponentProps } from 'react-intl';\n\nimport {\n Typography,\n Size,\n SizeLarge,\n SizeMedium,\n SizeSmall,\n getLocaleCurrencyName,\n} from '../common';\nimport { withInputAttributes, WithInputAttributesProps } from '../inputs/contexts';\nimport { Input } from '../inputs/Input';\nimport {\n SelectInput,\n SelectInputItem,\n SelectInputOptionContent,\n SelectInputOptionItem,\n SelectInputProps,\n} from '../inputs/SelectInput';\nimport Title from '../title';\n\nimport messages from './MoneyInput.messages';\nimport { formatAmount, parseAmount } from './currencyFormatting';\nimport withId from '../withId';\n\nexport interface CurrencyOptionItem {\n header?: never;\n value: string;\n label: string;\n currency: string;\n note?: string;\n searchable?: string;\n}\n\nexport interface CurrencyHeaderItem {\n header: string;\n}\n\nexport type CurrencyItem = CurrencyOptionItem | CurrencyHeaderItem;\n\nconst isNumberOrNull = (v: unknown): v is number | null => isNumber(v) || isNull(v);\n\nconst formatAmountIfSet = ({\n amount,\n currency,\n locale,\n}: {\n amount: number | null | undefined;\n currency: string;\n locale: string;\n}) => {\n return typeof amount === 'number' ? formatAmount(amount, currency, locale) : '';\n};\n\nconst parseNumber = ({\n amount,\n currency,\n locale,\n}: {\n amount: string;\n currency: string;\n locale: string;\n}) => {\n return parseAmount(amount, currency, locale);\n};\n\nconst allowedInputKeys = new Set([\n 'Backspace',\n 'Delete',\n ',',\n '.',\n 'ArrowDown',\n 'ArrowUp',\n 'ArrowLeft',\n 'ArrowRight',\n 'Enter',\n 'Escape',\n 'Tab',\n]);\n\nexport interface MoneyInputProps extends WrappedComponentProps {\n id?: string;\n 'aria-labelledby'?: string;\n currencies: readonly CurrencyItem[];\n selectedCurrency: CurrencyOptionItem;\n onCurrencyChange?: (value: CurrencyOptionItem) => void;\n placeholder?: number;\n amount: number | null;\n size?: SizeSmall | SizeMedium | SizeLarge;\n onAmountChange?: (value: number | null) => void;\n addon?: React.ReactNode;\n searchPlaceholder?: string;\n /**\n * Allows the consumer to react to searching, while the search itself is handled internally.\n */\n onSearchChange?: (value: { searchQuery: string; filteredOptions: CurrencyItem[] }) => void;\n customActionLabel?: React.ReactNode;\n onCustomAction?: () => void;\n classNames?: Record<string, string>;\n selectProps?: Partial<SelectInputProps<CurrencyOptionItem>>;\n}\n\nexport type MoneyInputPropsWithInputAttributes = MoneyInputProps &\n Partial<WithInputAttributesProps>;\n\ninterface MoneyInputState {\n searchQuery: string;\n formattedAmount: string;\n locale: string;\n}\n\nclass MoneyInput extends Component<MoneyInputPropsWithInputAttributes, MoneyInputState> {\n declare props: MoneyInputPropsWithInputAttributes &\n Required<Pick<MoneyInputPropsWithInputAttributes, keyof typeof MoneyInput.defaultProps>>;\n\n static defaultProps = {\n size: Size.LARGE,\n classNames: {},\n selectProps: {},\n } satisfies Partial<MoneyInputPropsWithInputAttributes>;\n\n amountFocused = false;\n\n constructor(props: MoneyInputProps) {\n super(props);\n this.state = {\n searchQuery: '',\n formattedAmount: formatAmountIfSet({\n amount: props.amount,\n currency: props.selectedCurrency.currency,\n locale: props.intl.locale,\n }),\n locale: props.intl.locale,\n };\n }\n\n UNSAFE_componentWillReceiveProps(nextProps: MoneyInputProps) {\n this.setState({ locale: nextProps.intl.locale });\n\n if (!this.amountFocused) {\n this.setState({\n formattedAmount: formatAmountIfSet({\n amount: nextProps.amount,\n currency: nextProps.selectedCurrency.currency,\n locale: nextProps.intl.locale,\n }),\n });\n }\n }\n\n isInputAllowedForKeyEvent = (event: React.KeyboardEvent<HTMLInputElement>) => {\n const { metaKey, key, ctrlKey } = event;\n const isNumberKey = isNumber(Number.parseInt(key, 10));\n\n return isNumberKey || metaKey || ctrlKey || allowedInputKeys.has(key);\n };\n\n handleKeyDown: React.KeyboardEventHandler<HTMLInputElement> = (event) => {\n if (!this.isInputAllowedForKeyEvent(event)) {\n event.preventDefault();\n }\n };\n\n handlePaste: React.ClipboardEventHandler<HTMLInputElement> = (event) => {\n const paste = event.clipboardData.getData('text');\n const { locale } = this.state;\n const parsed = isEmpty(paste)\n ? null\n : parseNumber({\n amount: paste,\n currency: this.props.selectedCurrency.currency,\n locale,\n });\n\n if (isNumberOrNull(parsed)) {\n this.setState({\n formattedAmount: formatAmountIfSet({\n amount: parsed,\n currency: this.props.selectedCurrency.currency,\n locale,\n }),\n });\n this.props.onAmountChange?.(parsed);\n }\n\n event.preventDefault();\n };\n\n onAmountChange: React.ChangeEventHandler<HTMLInputElement> = (event) => {\n const { value } = event.target;\n this.setState({\n formattedAmount: value,\n });\n const parsed = isEmpty(value)\n ? null\n : parseNumber({\n amount: value,\n currency: this.props.selectedCurrency.currency,\n locale: this.state.locale,\n });\n if (isNumberOrNull(parsed)) {\n this.props.onAmountChange?.(parsed);\n }\n };\n\n onAmountBlur = () => {\n this.amountFocused = false;\n this.setAmount();\n };\n\n onAmountFocus = () => {\n this.amountFocused = true;\n };\n\n getSelectOptions() {\n const selectOptions = filterCurrenciesForQuery(this.props.currencies, this.state.searchQuery);\n\n const formattedOptions: SelectInputItem<CurrencyOptionItem>[] = [];\n let currentGroupOptions: SelectInputOptionItem<CurrencyOptionItem>[] | undefined;\n\n selectOptions.forEach((item) => {\n if (item.header != null) {\n currentGroupOptions = [];\n formattedOptions.push({\n type: 'group',\n label: item.header,\n options: currentGroupOptions,\n });\n } else {\n (currentGroupOptions ?? formattedOptions).push({\n type: 'option',\n value: item,\n filterMatchers: [item.value, item.label, item.note ?? '', item.searchable ?? ''],\n });\n }\n });\n\n return formattedOptions;\n }\n\n setAmount() {\n this.setState((previousState) => {\n const parsed = parseNumber({\n amount: previousState.formattedAmount,\n currency: this.props.selectedCurrency.currency,\n locale: previousState.locale,\n });\n if (!isNumberOrNull(parsed)) {\n return {\n formattedAmount: previousState.formattedAmount,\n };\n }\n return {\n formattedAmount: formatAmountIfSet({\n amount: parsed,\n currency: this.props.selectedCurrency.currency,\n locale: previousState.locale,\n }),\n };\n });\n }\n\n handleSelectChange = (value: CurrencyOptionItem) => {\n this.handleSearchChange('');\n this.props.onCurrencyChange?.(value);\n };\n\n handleSearchChange = (searchQuery: string) => {\n this.setState({ searchQuery });\n this.props.onSearchChange?.({\n searchQuery,\n filteredOptions: filterCurrenciesForQuery(this.props.currencies, searchQuery),\n });\n };\n\n style = (className: string) => this.props.classNames[className] || className;\n\n render() {\n const {\n inputAttributes,\n id: amountInputId,\n 'aria-labelledby': ariaLabelledByProp,\n selectedCurrency,\n onCurrencyChange,\n size,\n addon,\n selectProps,\n } = this.props;\n const ariaLabelledBy = ariaLabelledByProp ?? inputAttributes?.['aria-labelledby'];\n const selectOptions = this.getSelectOptions();\n\n const hasSingleCurrency = () => {\n if (selectOptions.length !== 0) {\n const firstItem = selectOptions[0];\n\n if (selectOptions.length === 1) {\n if (firstItem.type === 'option') {\n return firstItem.value.currency === selectedCurrency.currency;\n }\n if (firstItem.type === 'group') {\n return (\n firstItem.options.length === 1 &&\n !(this.props.onCustomAction && this.props.customActionLabel)\n );\n }\n }\n } else if (selectedCurrency?.currency) {\n return true;\n }\n\n return false;\n };\n\n const isFixedCurrency = (!this.state.searchQuery && hasSingleCurrency()) || !onCurrencyChange;\n const disabled = !this.props.onAmountChange;\n const selectedCurrencyElementId = `${inputAttributes?.id ?? amountInputId}SelectedCurrency`;\n\n return (\n <fieldset\n aria-invalid={inputAttributes?.['aria-invalid']}\n aria-describedby={inputAttributes?.['aria-describedby']}\n aria-labelledby={inputAttributes?.id ?? amountInputId}\n className={clsx(\n this.style('tw-money-input'),\n this.style('input-group'),\n this.style(`input-group-${size}`),\n )}\n >\n <Input\n id={inputAttributes?.id ?? amountInputId}\n aria-labelledby={ariaLabelledBy}\n value={this.state.formattedAmount}\n inputMode=\"decimal\"\n disabled={disabled}\n placeholder={formatAmountIfSet({\n amount: this.props.placeholder,\n currency: this.props.selectedCurrency.currency,\n locale: this.state.locale,\n })}\n autoComplete=\"off\"\n aria-describedby={selectedCurrencyElementId}\n onKeyDown={this.handleKeyDown}\n onChange={this.onAmountChange}\n onFocus={this.onAmountFocus}\n onBlur={this.onAmountBlur}\n onPaste={this.handlePaste}\n />\n {addon && (\n <span\n className={clsx(\n this.style('input-group-addon'),\n this.style(`input-${size}`),\n disabled ? this.style('disabled') : '',\n )}\n >\n {addon}\n </span>\n )}\n {isFixedCurrency ? (\n <div\n className={clsx(\n this.style('input-group-addon'),\n this.style(`input-${size}`),\n this.style('tw-money-input__fixed-currency'),\n disabled ? this.style('disabled') : '',\n )}\n id={selectedCurrencyElementId}\n >\n {(size === 'lg' || size === 'md') && (\n <span className={clsx(this.style('money-input-currency-flag'), this.style('m-r-2'))}>\n <Flag code={selectedCurrency.currency.toLowerCase()} intrinsicSize={24} />\n </span>\n )}\n <Title\n as=\"span\"\n type={Typography.TITLE_SUBSECTION}\n className={size === 'lg' ? this.style('m-r-1') : ''}\n aria-label={getLocaleCurrencyName(this.props.intl, selectedCurrency.currency)}\n >\n {selectedCurrency.currency.toUpperCase()}\n </Title>\n </div>\n ) : (\n <div\n translate=\"no\"\n className={clsx(\n this.style('input-group-btn'),\n this.style('amount-currency-select-btn'),\n )}\n >\n <SelectInput\n UNSAFE_triggerButtonProps={{\n id: undefined,\n 'aria-labelledby': undefined,\n 'aria-describedby': ariaLabelledBy,\n 'aria-invalid': undefined,\n 'aria-label': this.props.intl.formatMessage(messages.selectCurrencyLabel),\n }}\n id={selectedCurrencyElementId}\n items={selectOptions}\n value={selectedCurrency}\n compareValues=\"currency\"\n renderValue={(currency, withinTrigger) => {\n return (\n <SelectInputOptionContent\n title={\n withinTrigger ? (\n <span\n aria-label={getLocaleCurrencyName(this.props.intl, currency.currency)}\n >\n {currency.currency.toUpperCase()}\n </span>\n ) : (\n currency.label\n )\n }\n note={withinTrigger ? undefined : currency.note}\n icon={<Flag code={currency.currency} intrinsicSize={24} />}\n />\n );\n }}\n renderFooter={\n this.props.onCustomAction\n ? () => (\n // eslint-disable-next-line jsx-a11y/click-events-have-key-events\n <div role=\"button\" tabIndex={0} onClick={this.props.onCustomAction}>\n {this.props.customActionLabel}\n </div>\n )\n : undefined\n }\n placeholder={this.props.intl.formatMessage(messages.selectPlaceholder)}\n filterable\n filterPlaceholder={\n this.props.searchPlaceholder ||\n this.props.intl.formatMessage(messages.searchPlaceholder)\n }\n disabled={disabled}\n size={size}\n onChange={this.handleSelectChange}\n onFilterChange={({ queryNormalized }) => {\n this.handleSearchChange(queryNormalized ?? '');\n }}\n {...selectProps}\n />\n </div>\n )}\n </fieldset>\n );\n }\n}\n\nfunction filterCurrenciesForQuery(\n currencies: readonly CurrencyItem[],\n query: string,\n): CurrencyItem[] {\n if (!query) {\n return [...currencies];\n }\n\n const options = currencies.filter(\n (option): option is CurrencyOptionItem => option.header == null,\n );\n const filteredOptions = removeDuplicateValueOptions(options).filter((option) =>\n currencyOptionFitsQuery(option, query),\n );\n\n return sortOptionsLabelsToFirst(filteredOptions, query);\n}\n\nfunction removeDuplicateValueOptions(options: readonly CurrencyOptionItem[]) {\n const uniqueValues = new Set<string>();\n return options.filter((option) => {\n if (!uniqueValues.has(option.value)) {\n uniqueValues.add(option.value);\n return true;\n }\n return false;\n });\n}\n\nfunction currencyOptionFitsQuery(option: CurrencyOptionItem, query: string) {\n if (!option.value) {\n return false;\n }\n\n return (\n contains(option.label, query) ||\n contains(option.searchable, query) ||\n contains(option.note, query)\n );\n}\n\nfunction contains(property: string | undefined, query: string) {\n return property?.toLowerCase().includes(query.toLowerCase());\n}\n\nfunction sortOptionsLabelsToFirst(options: readonly CurrencyOptionItem[], query: string) {\n return [...options].sort((first, second) => {\n const firstContains = contains(first.label, query);\n const secondContains = contains(second.label, query);\n\n if (firstContains && secondContains) {\n return 0;\n }\n if (firstContains) {\n return -1;\n }\n if (secondContains) {\n return 1;\n }\n return 0;\n });\n}\n\nexport default injectIntl(withId(withInputAttributes(MoneyInput, { nonLabelable: true })));\n"],"names":["isNumberOrNull","v","isNumber","isNull","formatAmountIfSet","amount","currency","locale","formatAmount","parseNumber","parseAmount","allowedInputKeys","Set","MoneyInput","Component","defaultProps","size","Size","LARGE","classNames","selectProps","amountFocused","constructor","props","state","searchQuery","formattedAmount","selectedCurrency","intl","UNSAFE_componentWillReceiveProps","nextProps","setState","isInputAllowedForKeyEvent","event","metaKey","key","ctrlKey","isNumberKey","Number","parseInt","has","handleKeyDown","preventDefault","handlePaste","paste","clipboardData","getData","parsed","isEmpty","onAmountChange","value","target","onAmountBlur","setAmount","onAmountFocus","getSelectOptions","selectOptions","filterCurrenciesForQuery","currencies","formattedOptions","currentGroupOptions","forEach","item","header","push","type","label","options","filterMatchers","note","searchable","previousState","handleSelectChange","handleSearchChange","onCurrencyChange","onSearchChange","filteredOptions","style","className","render","inputAttributes","id","amountInputId","ariaLabelledByProp","addon","ariaLabelledBy","hasSingleCurrency","length","firstItem","onCustomAction","customActionLabel","isFixedCurrency","disabled","selectedCurrencyElementId","_jsxs","clsx","children","_jsx","Input","inputMode","placeholder","autoComplete","onKeyDown","onChange","onFocus","onBlur","onPaste","Flag","code","toLowerCase","intrinsicSize","Title","as","Typography","TITLE_SUBSECTION","getLocaleCurrencyName","toUpperCase","translate","SelectInput","UNSAFE_triggerButtonProps","undefined","formatMessage","messages","selectCurrencyLabel","items","compareValues","renderValue","withinTrigger","SelectInputOptionContent","title","icon","renderFooter","role","tabIndex","onClick","selectPlaceholder","filterable","filterPlaceholder","searchPlaceholder","onFilterChange","queryNormalized","query","filter","option","removeDuplicateValueOptions","currencyOptionFitsQuery","sortOptionsLabelsToFirst","uniqueValues","add","contains","property","includes","sort","first","second","firstContains","secondContains","injectIntl","withId","withInputAttributes","nonLabelable"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CA,MAAMA,cAAc,GAAIC,CAAU,IAAyBC,0BAAQ,CAACD,CAAC,CAAC,IAAIE,wBAAM,CAACF,CAAC,CAAC;AAEnF,MAAMG,iBAAiB,GAAGA,CAAC;EACzBC,MAAM;EACNC,QAAQ;AACRC,EAAAA;AAAM,CAKP,KAAI;AACH,EAAA,OAAO,OAAOF,MAAM,KAAK,QAAQ,GAAGG,uBAAY,CAACH,MAAM,EAAEC,QAAQ,EAAEC,MAAM,CAAC,GAAG,EAAE;AACjF,CAAC;AAED,MAAME,WAAW,GAAGA,CAAC;EACnBJ,MAAM;EACNC,QAAQ;AACRC,EAAAA;AAAM,CAKP,KAAI;AACH,EAAA,OAAOG,8BAAW,CAACL,MAAM,EAAEC,QAAQ,EAAEC,MAAM,CAAC;AAC9C,CAAC;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AC,CAAC;AACJ;AAEA,yBAAeC,oBAAU,CAACC,cAAM,CAACC,4BAAmB,CAAClJ,UAAU,EAAE;AAAEmJ,EAAAA,YAAY,EAAE;AAAI,CAAE,CAAC,CAAC,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"MoneyInput.js","sources":["../../src/moneyInput/MoneyInput.tsx"],"sourcesContent":["import { isEmpty, isNumber, isNull } from '@transferwise/neptune-validation';\nimport { Flag } from '@wise/art';\nimport { clsx } from 'clsx';\nimport { Component } from 'react';\nimport { injectIntl, WrappedComponentProps } from 'react-intl';\n\nimport {\n Typography,\n Size,\n SizeLarge,\n SizeMedium,\n SizeSmall,\n getLocaleCurrencyName,\n} from '../common';\nimport { withInputAttributes, WithInputAttributesProps } from '../inputs/contexts';\nimport { Input } from '../inputs/Input';\nimport {\n SelectInput,\n SelectInputItem,\n SelectInputOptionContent,\n SelectInputOptionItem,\n SelectInputProps,\n} from '../inputs/SelectInput';\nimport Title from '../title';\n\nimport messages from './MoneyInput.messages';\nimport { formatAmount, formatNumber, getCurrencyDecimals, parseAmount } from './currencyFormatting';\nimport withId from '../withId';\n\nexport interface CurrencyOptionItem {\n header?: never;\n value: string;\n label: string;\n currency: string;\n note?: string;\n searchable?: string;\n}\n\nexport interface CurrencyHeaderItem {\n header: string;\n}\n\nexport type CurrencyItem = CurrencyOptionItem | CurrencyHeaderItem;\n\nconst isNumberOrNull = (v: unknown): v is number | null => isNumber(v) || isNull(v);\n\nconst formatAmountIfSet = ({\n amount,\n currency,\n locale,\n decimals,\n}: {\n amount: number | null | undefined;\n currency: string;\n locale: string;\n decimals?: number;\n}) => {\n if (typeof amount !== 'number') {\n return '';\n }\n if (decimals != null && getCurrencyDecimals(currency) !== 0) {\n return formatNumber(amount, locale, decimals);\n }\n return formatAmount(amount, currency, locale);\n};\n\nconst parseNumber = ({\n amount,\n currency,\n locale,\n decimals,\n}: {\n amount: string;\n currency: string;\n locale: string;\n decimals?: number;\n}) => {\n return parseAmount(amount, currency, locale, decimals);\n};\n\nconst allowedInputKeys = new Set([\n 'Backspace',\n 'Delete',\n ',',\n '.',\n 'ArrowDown',\n 'ArrowUp',\n 'ArrowLeft',\n 'ArrowRight',\n 'Enter',\n 'Escape',\n 'Tab',\n]);\n\nexport interface MoneyInputProps extends WrappedComponentProps {\n id?: string;\n 'aria-labelledby'?: string;\n currencies: readonly CurrencyItem[];\n selectedCurrency: CurrencyOptionItem;\n onCurrencyChange?: (value: CurrencyOptionItem) => void;\n placeholder?: number;\n amount: number | null;\n size?: SizeSmall | SizeMedium | SizeLarge;\n onAmountChange?: (value: number | null) => void;\n addon?: React.ReactNode;\n searchPlaceholder?: string;\n /**\n * Allows the consumer to react to searching, while the search itself is handled internally.\n */\n onSearchChange?: (value: { searchQuery: string; filteredOptions: CurrencyItem[] }) => void;\n customActionLabel?: React.ReactNode;\n onCustomAction?: () => void;\n classNames?: Record<string, string>;\n selectProps?: Partial<SelectInputProps<CurrencyOptionItem>>;\n /**\n * Specify the number of decimal places to format the amount. When not specified, the number of\n * decimals is determined by the selected currency (e.g. 2 for EUR, 0 for JPY, 3 for BHD).\n * This override is ignored for zero-decimal currencies (e.g. JPY, KRW, HUF), which always use 0.\n */\n decimals?: number;\n}\n\nexport type MoneyInputPropsWithInputAttributes = MoneyInputProps &\n Partial<WithInputAttributesProps>;\n\ninterface MoneyInputState {\n searchQuery: string;\n formattedAmount: string;\n locale: string;\n}\n\nclass MoneyInput extends Component<MoneyInputPropsWithInputAttributes, MoneyInputState> {\n declare props: MoneyInputPropsWithInputAttributes &\n Required<Pick<MoneyInputPropsWithInputAttributes, keyof typeof MoneyInput.defaultProps>>;\n\n static defaultProps = {\n size: Size.LARGE,\n classNames: {},\n selectProps: {},\n } satisfies Partial<MoneyInputPropsWithInputAttributes>;\n\n amountFocused = false;\n\n constructor(props: MoneyInputProps) {\n super(props);\n this.state = {\n searchQuery: '',\n formattedAmount: formatAmountIfSet({\n amount: props.amount,\n currency: props.selectedCurrency.currency,\n locale: props.intl.locale,\n decimals: props.decimals,\n }),\n locale: props.intl.locale,\n };\n }\n\n UNSAFE_componentWillReceiveProps(nextProps: MoneyInputProps) {\n this.setState({ locale: nextProps.intl.locale });\n\n if (!this.amountFocused) {\n this.setState({\n formattedAmount: formatAmountIfSet({\n amount: nextProps.amount,\n currency: nextProps.selectedCurrency.currency,\n locale: nextProps.intl.locale,\n decimals: nextProps.decimals,\n }),\n });\n }\n }\n\n isInputAllowedForKeyEvent = (event: React.KeyboardEvent<HTMLInputElement>) => {\n const { metaKey, key, ctrlKey } = event;\n const isNumberKey = isNumber(Number.parseInt(key, 10));\n\n return isNumberKey || metaKey || ctrlKey || allowedInputKeys.has(key);\n };\n\n handleKeyDown: React.KeyboardEventHandler<HTMLInputElement> = (event) => {\n if (!this.isInputAllowedForKeyEvent(event)) {\n event.preventDefault();\n }\n };\n\n handlePaste: React.ClipboardEventHandler<HTMLInputElement> = (event) => {\n const paste = event.clipboardData.getData('text');\n const { locale } = this.state;\n const parsed = isEmpty(paste)\n ? null\n : parseNumber({\n amount: paste,\n currency: this.props.selectedCurrency.currency,\n locale,\n decimals: this.props.decimals,\n });\n\n if (isNumberOrNull(parsed)) {\n this.setState({\n formattedAmount: formatAmountIfSet({\n amount: parsed,\n currency: this.props.selectedCurrency.currency,\n locale,\n decimals: this.props.decimals,\n }),\n });\n this.props.onAmountChange?.(parsed);\n }\n\n event.preventDefault();\n };\n\n onAmountChange: React.ChangeEventHandler<HTMLInputElement> = (event) => {\n const { value } = event.target;\n this.setState({\n formattedAmount: value,\n });\n const parsed = isEmpty(value)\n ? null\n : parseNumber({\n amount: value,\n currency: this.props.selectedCurrency.currency,\n locale: this.state.locale,\n decimals: this.props.decimals,\n });\n if (isNumberOrNull(parsed)) {\n this.props.onAmountChange?.(parsed);\n }\n };\n\n onAmountBlur = () => {\n this.amountFocused = false;\n this.setAmount();\n };\n\n onAmountFocus = () => {\n this.amountFocused = true;\n };\n\n getSelectOptions() {\n const selectOptions = filterCurrenciesForQuery(this.props.currencies, this.state.searchQuery);\n\n const formattedOptions: SelectInputItem<CurrencyOptionItem>[] = [];\n let currentGroupOptions: SelectInputOptionItem<CurrencyOptionItem>[] | undefined;\n\n selectOptions.forEach((item) => {\n if (item.header != null) {\n currentGroupOptions = [];\n formattedOptions.push({\n type: 'group',\n label: item.header,\n options: currentGroupOptions,\n });\n } else {\n (currentGroupOptions ?? formattedOptions).push({\n type: 'option',\n value: item,\n filterMatchers: [item.value, item.label, item.note ?? '', item.searchable ?? ''],\n });\n }\n });\n\n return formattedOptions;\n }\n\n setAmount() {\n this.setState((previousState) => {\n const parsed = parseNumber({\n amount: previousState.formattedAmount,\n currency: this.props.selectedCurrency.currency,\n locale: previousState.locale,\n decimals: this.props.decimals,\n });\n if (!isNumberOrNull(parsed)) {\n return {\n formattedAmount: previousState.formattedAmount,\n };\n }\n return {\n formattedAmount: formatAmountIfSet({\n amount: parsed,\n currency: this.props.selectedCurrency.currency,\n locale: previousState.locale,\n decimals: this.props.decimals,\n }),\n };\n });\n }\n\n handleSelectChange = (value: CurrencyOptionItem) => {\n this.handleSearchChange('');\n this.props.onCurrencyChange?.(value);\n };\n\n handleSearchChange = (searchQuery: string) => {\n this.setState({ searchQuery });\n this.props.onSearchChange?.({\n searchQuery,\n filteredOptions: filterCurrenciesForQuery(this.props.currencies, searchQuery),\n });\n };\n\n style = (className: string) => this.props.classNames[className] || className;\n\n render() {\n const {\n inputAttributes,\n id: amountInputId,\n 'aria-labelledby': ariaLabelledByProp,\n selectedCurrency,\n onCurrencyChange,\n size,\n addon,\n selectProps,\n } = this.props;\n const ariaLabelledBy = ariaLabelledByProp ?? inputAttributes?.['aria-labelledby'];\n const selectOptions = this.getSelectOptions();\n\n const hasSingleCurrency = () => {\n if (selectOptions.length !== 0) {\n const firstItem = selectOptions[0];\n\n if (selectOptions.length === 1) {\n if (firstItem.type === 'option') {\n return firstItem.value.currency === selectedCurrency.currency;\n }\n if (firstItem.type === 'group') {\n return (\n firstItem.options.length === 1 &&\n !(this.props.onCustomAction && this.props.customActionLabel)\n );\n }\n }\n } else if (selectedCurrency?.currency) {\n return true;\n }\n\n return false;\n };\n\n const isFixedCurrency = (!this.state.searchQuery && hasSingleCurrency()) || !onCurrencyChange;\n const disabled = !this.props.onAmountChange;\n const selectedCurrencyElementId = `${inputAttributes?.id ?? amountInputId}SelectedCurrency`;\n\n return (\n <fieldset\n aria-invalid={inputAttributes?.['aria-invalid']}\n aria-describedby={inputAttributes?.['aria-describedby']}\n aria-labelledby={inputAttributes?.id ?? amountInputId}\n className={clsx(\n this.style('tw-money-input'),\n this.style('input-group'),\n this.style(`input-group-${size}`),\n )}\n >\n <Input\n id={inputAttributes?.id ?? amountInputId}\n aria-labelledby={ariaLabelledBy}\n value={this.state.formattedAmount}\n inputMode=\"decimal\"\n disabled={disabled}\n placeholder={formatAmountIfSet({\n amount: this.props.placeholder,\n currency: this.props.selectedCurrency.currency,\n locale: this.state.locale,\n decimals: this.props.decimals,\n })}\n autoComplete=\"off\"\n aria-describedby={selectedCurrencyElementId}\n onKeyDown={this.handleKeyDown}\n onChange={this.onAmountChange}\n onFocus={this.onAmountFocus}\n onBlur={this.onAmountBlur}\n onPaste={this.handlePaste}\n />\n {addon && (\n <span\n className={clsx(\n this.style('input-group-addon'),\n this.style(`input-${size}`),\n disabled ? this.style('disabled') : '',\n )}\n >\n {addon}\n </span>\n )}\n {isFixedCurrency ? (\n <div\n className={clsx(\n this.style('input-group-addon'),\n this.style(`input-${size}`),\n this.style('tw-money-input__fixed-currency'),\n disabled ? this.style('disabled') : '',\n )}\n id={selectedCurrencyElementId}\n >\n {(size === 'lg' || size === 'md') && (\n <span className={clsx(this.style('money-input-currency-flag'), this.style('m-r-2'))}>\n <Flag code={selectedCurrency.currency.toLowerCase()} intrinsicSize={24} />\n </span>\n )}\n <Title\n as=\"span\"\n type={Typography.TITLE_SUBSECTION}\n className={size === 'lg' ? this.style('m-r-1') : ''}\n aria-label={getLocaleCurrencyName(this.props.intl, selectedCurrency.currency)}\n >\n {selectedCurrency.currency.toUpperCase()}\n </Title>\n </div>\n ) : (\n <div\n translate=\"no\"\n className={clsx(\n this.style('input-group-btn'),\n this.style('amount-currency-select-btn'),\n )}\n >\n <SelectInput\n UNSAFE_triggerButtonProps={{\n id: undefined,\n 'aria-labelledby': undefined,\n 'aria-describedby': ariaLabelledBy,\n 'aria-invalid': undefined,\n 'aria-label': this.props.intl.formatMessage(messages.selectCurrencyLabel),\n }}\n id={selectedCurrencyElementId}\n items={selectOptions}\n value={selectedCurrency}\n compareValues=\"currency\"\n renderValue={(currency, withinTrigger) => {\n return (\n <SelectInputOptionContent\n title={\n withinTrigger ? (\n <span\n aria-label={getLocaleCurrencyName(this.props.intl, currency.currency)}\n >\n {currency.currency.toUpperCase()}\n </span>\n ) : (\n currency.label\n )\n }\n note={withinTrigger ? undefined : currency.note}\n icon={<Flag code={currency.currency} intrinsicSize={24} />}\n />\n );\n }}\n renderFooter={\n this.props.onCustomAction\n ? () => (\n // eslint-disable-next-line jsx-a11y/click-events-have-key-events\n <div role=\"button\" tabIndex={0} onClick={this.props.onCustomAction}>\n {this.props.customActionLabel}\n </div>\n )\n : undefined\n }\n placeholder={this.props.intl.formatMessage(messages.selectPlaceholder)}\n filterable\n filterPlaceholder={\n this.props.searchPlaceholder ||\n this.props.intl.formatMessage(messages.searchPlaceholder)\n }\n disabled={disabled}\n size={size}\n onChange={this.handleSelectChange}\n onFilterChange={({ queryNormalized }) => {\n this.handleSearchChange(queryNormalized ?? '');\n }}\n {...selectProps}\n />\n </div>\n )}\n </fieldset>\n );\n }\n}\n\nfunction filterCurrenciesForQuery(\n currencies: readonly CurrencyItem[],\n query: string,\n): CurrencyItem[] {\n if (!query) {\n return [...currencies];\n }\n\n const options = currencies.filter(\n (option): option is CurrencyOptionItem => option.header == null,\n );\n const filteredOptions = removeDuplicateValueOptions(options).filter((option) =>\n currencyOptionFitsQuery(option, query),\n );\n\n return sortOptionsLabelsToFirst(filteredOptions, query);\n}\n\nfunction removeDuplicateValueOptions(options: readonly CurrencyOptionItem[]) {\n const uniqueValues = new Set<string>();\n return options.filter((option) => {\n if (!uniqueValues.has(option.value)) {\n uniqueValues.add(option.value);\n return true;\n }\n return false;\n });\n}\n\nfunction currencyOptionFitsQuery(option: CurrencyOptionItem, query: string) {\n if (!option.value) {\n return false;\n }\n\n return (\n contains(option.label, query) ||\n contains(option.searchable, query) ||\n contains(option.note, query)\n );\n}\n\nfunction contains(property: string | undefined, query: string) {\n return property?.toLowerCase().includes(query.toLowerCase());\n}\n\nfunction sortOptionsLabelsToFirst(options: readonly CurrencyOptionItem[], query: string) {\n return [...options].sort((first, second) => {\n const firstContains = contains(first.label, query);\n const secondContains = contains(second.label, query);\n\n if (firstContains && secondContains) {\n return 0;\n }\n if (firstContains) {\n return -1;\n }\n if (secondContains) {\n return 1;\n }\n return 0;\n });\n}\n\nexport default injectIntl(withId(withInputAttributes(MoneyInput, { nonLabelable: true })));\n"],"names":["isNumberOrNull","v","isNumber","isNull","formatAmountIfSet","amount","currency","locale","decimals","getCurrencyDecimals","formatNumber","formatAmount","parseNumber","parseAmount","allowedInputKeys","Set","MoneyInput","Component","defaultProps","size","Size","LARGE","classNames","selectProps","amountFocused","constructor","props","state","searchQuery","formattedAmount","selectedCurrency","intl","UNSAFE_componentWillReceiveProps","nextProps","setState","isInputAllowedForKeyEvent","event","metaKey","key","ctrlKey","isNumberKey","Number","parseInt","has","handleKeyDown","preventDefault","handlePaste","paste","clipboardData","getData","parsed","isEmpty","onAmountChange","value","target","onAmountBlur","setAmount","onAmountFocus","getSelectOptions","selectOptions","filterCurrenciesForQuery","currencies","formattedOptions","currentGroupOptions","forEach","item","header","push","type","label","options","filterMatchers","note","searchable","previousState","handleSelectChange","handleSearchChange","onCurrencyChange","onSearchChange","filteredOptions","style","className","render","inputAttributes","id","amountInputId","ariaLabelledByProp","addon","ariaLabelledBy","hasSingleCurrency","length","firstItem","onCustomAction","customActionLabel","isFixedCurrency","disabled","selectedCurrencyElementId","_jsxs","clsx","children","_jsx","Input","inputMode","placeholder","autoComplete","onKeyDown","onChange","onFocus","onBlur","onPaste","Flag","code","toLowerCase","intrinsicSize","Title","as","Typography","TITLE_SUBSECTION","getLocaleCurrencyName","toUpperCase","translate","SelectInput","UNSAFE_triggerButtonProps","undefined","formatMessage","messages","selectCurrencyLabel","items","compareValues","renderValue","withinTrigger","SelectInputOptionContent","title","icon","renderFooter","role","tabIndex","onClick","selectPlaceholder","filterable","filterPlaceholder","searchPlaceholder","onFilterChange","queryNormalized","query","filter","option","removeDuplicateValueOptions","currencyOptionFitsQuery","sortOptionsLabelsToFirst","uniqueValues","add","contains","property","includes","sort","first","second","firstContains","secondContains","injectIntl","withId","withInputAttributes","nonLabelable"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CA,MAAMA,cAAc,GAAIC,CAAU,IAAyBC,0BAAQ,CAACD,CAAC,CAAC,IAAIE,wBAAM,CAACF,CAAC,CAAC;AAEnF,MAAMG,iBAAiB,GAAGA,CAAC;EACzBC,MAAM;EACNC,QAAQ;EACRC,MAAM;AACNC,EAAAA;AAAQ,CAMT,KAAI;AACH,EAAA,IAAI,OAAOH,MAAM,KAAK,QAAQ,EAAE;AAC9B,IAAA,OAAO,EAAE;AACX,EAAA;EACA,IAAIG,QAAQ,IAAI,IAAI,IAAIC,sCAAmB,CAACH,QAAQ,CAAC,KAAK,CAAC,EAAE;AAC3D,IAAA,OAAOI,uBAAY,CAACL,MAAM,EAAEE,MAAM,EAAEC,QAAQ,CAAC;AAC/C,EAAA;AACA,EAAA,OAAOG,uBAAY,CAACN,MAAM,EAAEC,QAAQ,EAAEC,MAAM,CAAC;AAC/C,CAAC;AAED,MAAMK,WAAW,GAAGA,CAAC;EACnBP,MAAM;EACNC,QAAQ;EACRC,MAAM;AACNC,EAAAA;AAAQ,CAMT,KAAI;EACH,OAAOK,8BAAW,CAACR,MAAM,EAAEC,QAAQ,EAAEC,MAAM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