@transferwise/components 46.133.1 → 46.135.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/accordion/AccordionItem/AccordionItem.js +1 -0
- package/build/accordion/AccordionItem/AccordionItem.js.map +1 -1
- package/build/accordion/AccordionItem/AccordionItem.mjs +1 -0
- package/build/accordion/AccordionItem/AccordionItem.mjs.map +1 -1
- package/build/actionButton/ActionButton.js +1 -0
- package/build/actionButton/ActionButton.js.map +1 -1
- package/build/actionButton/ActionButton.mjs +1 -0
- package/build/actionButton/ActionButton.mjs.map +1 -1
- package/build/actionOption/ActionOption.js +1 -0
- package/build/actionOption/ActionOption.js.map +1 -1
- package/build/actionOption/ActionOption.mjs +1 -0
- package/build/actionOption/ActionOption.mjs.map +1 -1
- package/build/alert/Alert.js +1 -0
- package/build/alert/Alert.js.map +1 -1
- package/build/alert/Alert.mjs +1 -0
- package/build/alert/Alert.mjs.map +1 -1
- package/build/alert/inlineMarkdown/InlineMarkdown.js +1 -0
- package/build/alert/inlineMarkdown/InlineMarkdown.js.map +1 -1
- package/build/alert/inlineMarkdown/InlineMarkdown.mjs +1 -0
- package/build/alert/inlineMarkdown/InlineMarkdown.mjs.map +1 -1
- package/build/avatar/Avatar.js +1 -0
- package/build/avatar/Avatar.js.map +1 -1
- package/build/avatar/Avatar.mjs +1 -0
- package/build/avatar/Avatar.mjs.map +1 -1
- package/build/avatarView/AvatarView.js +1 -0
- package/build/avatarView/AvatarView.js.map +1 -1
- package/build/avatarView/AvatarView.mjs +1 -0
- package/build/avatarView/AvatarView.mjs.map +1 -1
- package/build/avatarWrapper/AvatarWrapper.js +1 -0
- package/build/avatarWrapper/AvatarWrapper.js.map +1 -1
- package/build/avatarWrapper/AvatarWrapper.mjs +1 -0
- package/build/avatarWrapper/AvatarWrapper.mjs.map +1 -1
- package/build/badge/Badge.js +1 -0
- package/build/badge/Badge.js.map +1 -1
- package/build/badge/Badge.mjs +1 -0
- package/build/badge/Badge.mjs.map +1 -1
- package/build/button/Button.js +1 -0
- package/build/button/Button.js.map +1 -1
- package/build/button/Button.mjs +1 -0
- package/build/button/Button.mjs.map +1 -1
- package/build/button/LegacyButton.js +1 -0
- package/build/button/LegacyButton.js.map +1 -1
- package/build/button/LegacyButton.mjs +1 -0
- package/build/button/LegacyButton.mjs.map +1 -1
- package/build/button/classMap.js +1 -0
- package/build/button/classMap.js.map +1 -1
- package/build/button/classMap.mjs +1 -0
- package/build/button/classMap.mjs.map +1 -1
- package/build/button/legacyUtils/legacyUtils.js +1 -0
- package/build/button/legacyUtils/legacyUtils.js.map +1 -1
- package/build/button/legacyUtils/legacyUtils.mjs +1 -0
- package/build/button/legacyUtils/legacyUtils.mjs.map +1 -1
- package/build/card/Card.js +1 -0
- package/build/card/Card.js.map +1 -1
- package/build/card/Card.mjs +1 -0
- package/build/card/Card.mjs.map +1 -1
- package/build/checkbox/Checkbox.js +1 -0
- package/build/checkbox/Checkbox.js.map +1 -1
- package/build/checkbox/Checkbox.mjs +1 -0
- package/build/checkbox/Checkbox.mjs.map +1 -1
- package/build/chevron/Chevron.js +1 -0
- package/build/chevron/Chevron.js.map +1 -1
- package/build/chevron/Chevron.mjs +1 -0
- package/build/chevron/Chevron.mjs.map +1 -1
- package/build/chips/Chip.js +1 -0
- package/build/chips/Chip.js.map +1 -1
- package/build/chips/Chip.mjs +1 -0
- package/build/chips/Chip.mjs.map +1 -1
- package/build/circularButton/CircularButton.js +1 -0
- package/build/circularButton/CircularButton.js.map +1 -1
- package/build/circularButton/CircularButton.mjs +1 -0
- package/build/circularButton/CircularButton.mjs.map +1 -1
- package/build/common/locale/index.js +9 -4
- package/build/common/locale/index.js.map +1 -1
- package/build/common/locale/index.mjs +9 -4
- package/build/common/locale/index.mjs.map +1 -1
- package/build/common/panel/Panel.js +1 -0
- package/build/common/panel/Panel.js.map +1 -1
- package/build/common/panel/Panel.mjs +1 -0
- package/build/common/panel/Panel.mjs.map +1 -1
- package/build/common/responsivePanel/ResponsivePanel.js +1 -0
- package/build/common/responsivePanel/ResponsivePanel.js.map +1 -1
- package/build/common/responsivePanel/ResponsivePanel.mjs +1 -0
- package/build/common/responsivePanel/ResponsivePanel.mjs.map +1 -1
- package/build/criticalBanner/CriticalCommsBanner.js +1 -0
- package/build/criticalBanner/CriticalCommsBanner.js.map +1 -1
- package/build/criticalBanner/CriticalCommsBanner.mjs +1 -0
- package/build/criticalBanner/CriticalCommsBanner.mjs.map +1 -1
- package/build/dateInput/DateInput.js +1 -1
- package/build/dateInput/DateInput.mjs +1 -1
- package/build/dateLookup/DateLookup.js +1 -1
- package/build/dateLookup/DateLookup.mjs +1 -1
- package/build/dateLookup/dateHeader/DateHeader.js +1 -0
- package/build/dateLookup/dateHeader/DateHeader.js.map +1 -1
- package/build/dateLookup/dateHeader/DateHeader.mjs +1 -0
- package/build/dateLookup/dateHeader/DateHeader.mjs.map +1 -1
- package/build/decision/Decision.js +1 -0
- package/build/decision/Decision.js.map +1 -1
- package/build/decision/Decision.mjs +1 -0
- package/build/decision/Decision.mjs.map +1 -1
- package/build/definitionList/DefinitionList.js +1 -0
- package/build/definitionList/DefinitionList.js.map +1 -1
- package/build/definitionList/DefinitionList.mjs +1 -0
- package/build/definitionList/DefinitionList.mjs.map +1 -1
- package/build/dimmer/Dimmer.js +1 -0
- package/build/dimmer/Dimmer.js.map +1 -1
- package/build/dimmer/Dimmer.mjs +1 -0
- package/build/dimmer/Dimmer.mjs.map +1 -1
- package/build/display/Display.js +1 -0
- package/build/display/Display.js.map +1 -1
- package/build/display/Display.mjs +1 -0
- package/build/display/Display.mjs.map +1 -1
- package/build/drawer/Drawer.js +1 -0
- package/build/drawer/Drawer.js.map +1 -1
- package/build/drawer/Drawer.mjs +1 -0
- package/build/drawer/Drawer.mjs.map +1 -1
- package/build/expressiveMoneyInput/currencySelector/CurrencySelector.js +4 -3
- package/build/expressiveMoneyInput/currencySelector/CurrencySelector.js.map +1 -1
- package/build/expressiveMoneyInput/currencySelector/CurrencySelector.mjs +4 -3
- package/build/expressiveMoneyInput/currencySelector/CurrencySelector.mjs.map +1 -1
- package/build/field/Field.js +1 -0
- package/build/field/Field.js.map +1 -1
- package/build/field/Field.mjs +1 -0
- package/build/field/Field.mjs.map +1 -1
- package/build/flowNavigation/FlowNavigation.js +1 -0
- package/build/flowNavigation/FlowNavigation.js.map +1 -1
- package/build/flowNavigation/FlowNavigation.mjs +1 -0
- package/build/flowNavigation/FlowNavigation.mjs.map +1 -1
- package/build/header/Header.js +1 -0
- package/build/header/Header.js.map +1 -1
- package/build/header/Header.mjs +1 -0
- package/build/header/Header.mjs.map +1 -1
- package/build/info/Info.js +1 -0
- package/build/info/Info.js.map +1 -1
- package/build/info/Info.mjs +1 -0
- package/build/info/Info.mjs.map +1 -1
- package/build/inlineAlert/InlineAlert.js +1 -0
- package/build/inlineAlert/InlineAlert.js.map +1 -1
- package/build/inlineAlert/InlineAlert.mjs +1 -0
- package/build/inlineAlert/InlineAlert.mjs.map +1 -1
- package/build/inputs/SearchInput.js +1 -0
- package/build/inputs/SearchInput.js.map +1 -1
- package/build/inputs/SearchInput.mjs +1 -0
- package/build/inputs/SearchInput.mjs.map +1 -1
- package/build/instructionsList/InstructionsList.js +1 -0
- package/build/instructionsList/InstructionsList.js.map +1 -1
- package/build/instructionsList/InstructionsList.mjs +1 -0
- package/build/instructionsList/InstructionsList.mjs.map +1 -1
- package/build/link/Link.js +1 -0
- package/build/link/Link.js.map +1 -1
- package/build/link/Link.mjs +1 -0
- package/build/link/Link.mjs.map +1 -1
- package/build/listItem/AdditionalInfo/ListItemAdditionalInfo.js +1 -0
- package/build/listItem/AdditionalInfo/ListItemAdditionalInfo.js.map +1 -1
- package/build/listItem/AdditionalInfo/ListItemAdditionalInfo.mjs +1 -0
- package/build/listItem/AdditionalInfo/ListItemAdditionalInfo.mjs.map +1 -1
- package/build/listItem/ListItem.js +1 -0
- package/build/listItem/ListItem.js.map +1 -1
- package/build/listItem/ListItem.mjs +1 -0
- package/build/listItem/ListItem.mjs.map +1 -1
- package/build/listItem/Prompt/ListItemPrompt.js +1 -0
- package/build/listItem/Prompt/ListItemPrompt.js.map +1 -1
- package/build/listItem/Prompt/ListItemPrompt.mjs +1 -0
- package/build/listItem/Prompt/ListItemPrompt.mjs.map +1 -1
- package/build/loader/Loader.js +1 -0
- package/build/loader/Loader.js.map +1 -1
- package/build/loader/Loader.mjs +1 -0
- package/build/loader/Loader.mjs.map +1 -1
- package/build/main.css +65 -27
- package/build/markdown/Markdown.js +1 -0
- package/build/markdown/Markdown.js.map +1 -1
- package/build/markdown/Markdown.mjs +1 -0
- package/build/markdown/Markdown.mjs.map +1 -1
- package/build/modal/Modal.js +1 -0
- package/build/modal/Modal.js.map +1 -1
- package/build/modal/Modal.mjs +1 -0
- package/build/modal/Modal.mjs.map +1 -1
- 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/navigationOption/NavigationOption.js +1 -0
- package/build/navigationOption/NavigationOption.js.map +1 -1
- package/build/navigationOption/NavigationOption.mjs +1 -0
- package/build/navigationOption/NavigationOption.mjs.map +1 -1
- package/build/nudge/Nudge.js +1 -0
- package/build/nudge/Nudge.js.map +1 -1
- package/build/nudge/Nudge.mjs +1 -0
- package/build/nudge/Nudge.mjs.map +1 -1
- package/build/overlayHeader/OverlayHeader.js +1 -0
- package/build/overlayHeader/OverlayHeader.js.map +1 -1
- package/build/overlayHeader/OverlayHeader.mjs +1 -0
- package/build/overlayHeader/OverlayHeader.mjs.map +1 -1
- package/build/phoneNumberInput/PhoneNumberInput.js +1 -0
- package/build/phoneNumberInput/PhoneNumberInput.js.map +1 -1
- package/build/phoneNumberInput/PhoneNumberInput.mjs +1 -0
- package/build/phoneNumberInput/PhoneNumberInput.mjs.map +1 -1
- package/build/popover/Popover.js +1 -0
- package/build/popover/Popover.js.map +1 -1
- package/build/popover/Popover.mjs +1 -0
- package/build/popover/Popover.mjs.map +1 -1
- package/build/processIndicator/ProcessIndicator.js +1 -0
- package/build/processIndicator/ProcessIndicator.js.map +1 -1
- package/build/processIndicator/ProcessIndicator.mjs +1 -0
- package/build/processIndicator/ProcessIndicator.mjs.map +1 -1
- package/build/progressBar/ProgressBar.js +1 -0
- package/build/progressBar/ProgressBar.js.map +1 -1
- package/build/progressBar/ProgressBar.mjs +1 -0
- package/build/progressBar/ProgressBar.mjs.map +1 -1
- package/build/promoCard/PromoCard.js +1 -0
- package/build/promoCard/PromoCard.js.map +1 -1
- package/build/promoCard/PromoCard.mjs +1 -0
- package/build/promoCard/PromoCard.mjs.map +1 -1
- package/build/promoCard/PromoCardIndicator.js +1 -0
- package/build/promoCard/PromoCardIndicator.js.map +1 -1
- package/build/promoCard/PromoCardIndicator.mjs +1 -0
- package/build/promoCard/PromoCardIndicator.mjs.map +1 -1
- package/build/prompt/ActionPrompt/ActionPrompt.js +1 -0
- package/build/prompt/ActionPrompt/ActionPrompt.js.map +1 -1
- package/build/prompt/ActionPrompt/ActionPrompt.mjs +1 -0
- package/build/prompt/ActionPrompt/ActionPrompt.mjs.map +1 -1
- package/build/prompt/InfoPrompt/InfoPrompt.js +1 -0
- package/build/prompt/InfoPrompt/InfoPrompt.js.map +1 -1
- package/build/prompt/InfoPrompt/InfoPrompt.mjs +1 -0
- package/build/prompt/InfoPrompt/InfoPrompt.mjs.map +1 -1
- package/build/prompt/InlinePrompt/InlinePrompt.js +1 -0
- package/build/prompt/InlinePrompt/InlinePrompt.js.map +1 -1
- package/build/prompt/InlinePrompt/InlinePrompt.mjs +1 -0
- package/build/prompt/InlinePrompt/InlinePrompt.mjs.map +1 -1
- package/build/radio/Radio.js +1 -0
- package/build/radio/Radio.js.map +1 -1
- package/build/radio/Radio.mjs +1 -0
- package/build/radio/Radio.mjs.map +1 -1
- package/build/segmentedControl/SegmentedControl.js +1 -0
- package/build/segmentedControl/SegmentedControl.js.map +1 -1
- package/build/segmentedControl/SegmentedControl.mjs +1 -0
- package/build/segmentedControl/SegmentedControl.mjs.map +1 -1
- package/build/select/Select.js +1 -0
- package/build/select/Select.js.map +1 -1
- package/build/select/Select.mjs +1 -0
- package/build/select/Select.mjs.map +1 -1
- package/build/select/option/Option.js +1 -0
- package/build/select/option/Option.js.map +1 -1
- package/build/select/option/Option.mjs +1 -0
- package/build/select/option/Option.mjs.map +1 -1
- package/build/statusIcon/StatusIcon.js +2 -12
- package/build/statusIcon/StatusIcon.js.map +1 -1
- package/build/statusIcon/StatusIcon.mjs +2 -12
- package/build/statusIcon/StatusIcon.mjs.map +1 -1
- package/build/stepper/Stepper.js +1 -0
- package/build/stepper/Stepper.js.map +1 -1
- package/build/stepper/Stepper.mjs +1 -0
- package/build/stepper/Stepper.mjs.map +1 -1
- package/build/sticky/Sticky.js +1 -0
- package/build/sticky/Sticky.js.map +1 -1
- package/build/sticky/Sticky.mjs +1 -0
- package/build/sticky/Sticky.mjs.map +1 -1
- package/build/styles/css/neptune.css +22 -22
- package/build/styles/less/neptune-tokens.less +4 -4
- package/build/styles/main.css +65 -27
- package/build/styles/props/neptune-tokens.css +2 -2
- package/build/styles/sentimentSurface/SentimentSurface.css +1 -1
- package/build/styles/statusIcon/StatusIcon.css +35 -4
- package/build/styles/styles/less/neptune.css +22 -22
- package/build/summary/Summary.js +1 -0
- package/build/summary/Summary.js.map +1 -1
- package/build/summary/Summary.mjs +1 -0
- package/build/summary/Summary.mjs.map +1 -1
- package/build/table/Table.js +1 -0
- package/build/table/Table.js.map +1 -1
- package/build/table/Table.mjs +1 -0
- package/build/table/Table.mjs.map +1 -1
- package/build/table/TableRow.js +1 -0
- package/build/table/TableRow.js.map +1 -1
- package/build/table/TableRow.mjs +1 -0
- package/build/table/TableRow.mjs.map +1 -1
- package/build/table/TableStatusText.js +1 -0
- package/build/table/TableStatusText.js.map +1 -1
- package/build/table/TableStatusText.mjs +1 -0
- package/build/table/TableStatusText.mjs.map +1 -1
- package/build/tabs/Tabs.js +1 -0
- package/build/tabs/Tabs.js.map +1 -1
- package/build/tabs/Tabs.mjs +1 -0
- package/build/tabs/Tabs.mjs.map +1 -1
- package/build/tile/Tile.js +1 -0
- package/build/tile/Tile.js.map +1 -1
- package/build/tile/Tile.mjs +1 -0
- package/build/tile/Tile.mjs.map +1 -1
- package/build/title/Title.js +1 -0
- package/build/title/Title.js.map +1 -1
- package/build/title/Title.mjs +1 -0
- package/build/title/Title.mjs.map +1 -1
- package/build/tooltip/Tooltip.js +1 -0
- package/build/tooltip/Tooltip.js.map +1 -1
- package/build/tooltip/Tooltip.mjs +1 -0
- package/build/tooltip/Tooltip.mjs.map +1 -1
- package/build/typeahead/Typeahead.js +1 -0
- package/build/typeahead/Typeahead.js.map +1 -1
- package/build/typeahead/Typeahead.mjs +1 -0
- package/build/typeahead/Typeahead.mjs.map +1 -1
- package/build/types/common/locale/index.d.ts +1 -1
- package/build/types/common/locale/index.d.ts.map +1 -1
- package/build/types/expressiveMoneyInput/currencySelector/CurrencySelector.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/build/upload/Upload.js +1 -0
- package/build/upload/Upload.js.map +1 -1
- package/build/upload/Upload.mjs +1 -0
- package/build/upload/Upload.mjs.map +1 -1
- package/build/upload/steps/completeStep/completeStep.js +1 -0
- package/build/upload/steps/completeStep/completeStep.js.map +1 -1
- package/build/upload/steps/completeStep/completeStep.mjs +1 -0
- package/build/upload/steps/completeStep/completeStep.mjs.map +1 -1
- package/build/upload/steps/processingStep/processingStep.js +1 -0
- package/build/upload/steps/processingStep/processingStep.js.map +1 -1
- package/build/upload/steps/processingStep/processingStep.mjs +1 -0
- package/build/upload/steps/processingStep/processingStep.mjs.map +1 -1
- package/build/upload/steps/uploadImageStep/uploadImageStep.js +1 -0
- package/build/upload/steps/uploadImageStep/uploadImageStep.js.map +1 -1
- package/build/upload/steps/uploadImageStep/uploadImageStep.mjs +1 -0
- package/build/upload/steps/uploadImageStep/uploadImageStep.mjs.map +1 -1
- package/build/uploadInput/UploadInput.js +1 -0
- package/build/uploadInput/UploadInput.js.map +1 -1
- package/build/uploadInput/UploadInput.mjs +1 -0
- package/build/uploadInput/UploadInput.mjs.map +1 -1
- package/build/uploadInput/uploadButton/UploadButton.js +1 -0
- package/build/uploadInput/uploadButton/UploadButton.js.map +1 -1
- package/build/uploadInput/uploadButton/UploadButton.mjs +1 -0
- package/build/uploadInput/uploadButton/UploadButton.mjs.map +1 -1
- package/build/uploadInput/uploadButton/defaults.js +1 -0
- package/build/uploadInput/uploadButton/defaults.js.map +1 -1
- package/build/uploadInput/uploadButton/defaults.mjs +1 -0
- package/build/uploadInput/uploadButton/defaults.mjs.map +1 -1
- package/build/uploadInput/uploadItem/UploadItem.js +1 -0
- package/build/uploadInput/uploadItem/UploadItem.js.map +1 -1
- package/build/uploadInput/uploadItem/UploadItem.mjs +1 -0
- package/build/uploadInput/uploadItem/UploadItem.mjs.map +1 -1
- package/build/withDisplayFormat/WithDisplayFormat.js +1 -0
- package/build/withDisplayFormat/WithDisplayFormat.js.map +1 -1
- package/build/withDisplayFormat/WithDisplayFormat.mjs +1 -0
- package/build/withDisplayFormat/WithDisplayFormat.mjs.map +1 -1
- package/package.json +14 -14
- package/src/common/locale/index.test.ts +13 -4
- package/src/common/locale/index.ts +9 -3
- package/src/expressiveMoneyInput/ExpressiveMoneyInput.story.tsx +18 -0
- package/src/expressiveMoneyInput/currencySelector/CurrencySelector.test.tsx +119 -1
- package/src/expressiveMoneyInput/currencySelector/CurrencySelector.tsx +4 -3
- package/src/main.css +65 -27
- 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/styles/less/neptune.css +22 -22
package/src/main.css
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Do not edit directly
|
|
3
|
-
* Generated on
|
|
2
|
+
* Do not edit directly, this file was auto-generated.
|
|
3
|
+
* Generated on Tue, 31 Mar 2026 13:02:10 GMT
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
:root {
|
|
@@ -142,8 +142,8 @@
|
|
|
142
142
|
}
|
|
143
143
|
|
|
144
144
|
/**
|
|
145
|
-
* Do not edit directly
|
|
146
|
-
* Generated on
|
|
145
|
+
* Do not edit directly, this file was auto-generated.
|
|
146
|
+
* Generated on Tue, 31 Mar 2026 13:02:11 GMT
|
|
147
147
|
*/
|
|
148
148
|
|
|
149
149
|
.np-theme-personal {
|
|
@@ -391,8 +391,8 @@
|
|
|
391
391
|
}
|
|
392
392
|
|
|
393
393
|
/**
|
|
394
|
-
* Do not edit directly
|
|
395
|
-
* Generated on
|
|
394
|
+
* Do not edit directly, this file was auto-generated.
|
|
395
|
+
* Generated on Tue, 31 Mar 2026 13:02:11 GMT
|
|
396
396
|
*/
|
|
397
397
|
|
|
398
398
|
.np-theme-personal--forest-green {
|
|
@@ -640,8 +640,8 @@
|
|
|
640
640
|
}
|
|
641
641
|
|
|
642
642
|
/**
|
|
643
|
-
* Do not edit directly
|
|
644
|
-
* Generated on
|
|
643
|
+
* Do not edit directly, this file was auto-generated.
|
|
644
|
+
* Generated on Tue, 31 Mar 2026 13:02:11 GMT
|
|
645
645
|
*/
|
|
646
646
|
|
|
647
647
|
.np-theme-personal--bright-green {
|
|
@@ -889,8 +889,8 @@
|
|
|
889
889
|
}
|
|
890
890
|
|
|
891
891
|
/**
|
|
892
|
-
* Do not edit directly
|
|
893
|
-
* Generated on
|
|
892
|
+
* Do not edit directly, this file was auto-generated.
|
|
893
|
+
* Generated on Tue, 31 Mar 2026 13:02:11 GMT
|
|
894
894
|
*/
|
|
895
895
|
|
|
896
896
|
.np-theme-personal--dark {
|
|
@@ -1138,8 +1138,8 @@
|
|
|
1138
1138
|
}
|
|
1139
1139
|
|
|
1140
1140
|
/**
|
|
1141
|
-
* Do not edit directly
|
|
1142
|
-
* Generated on
|
|
1141
|
+
* Do not edit directly, this file was auto-generated.
|
|
1142
|
+
* Generated on Tue, 31 Mar 2026 13:02:11 GMT
|
|
1143
1143
|
*/
|
|
1144
1144
|
|
|
1145
1145
|
.np-theme-platform {
|
|
@@ -1321,8 +1321,8 @@
|
|
|
1321
1321
|
}
|
|
1322
1322
|
|
|
1323
1323
|
/**
|
|
1324
|
-
* Do not edit directly
|
|
1325
|
-
* Generated on
|
|
1324
|
+
* Do not edit directly, this file was auto-generated.
|
|
1325
|
+
* Generated on Tue, 31 Mar 2026 13:02:11 GMT
|
|
1326
1326
|
*/
|
|
1327
1327
|
|
|
1328
1328
|
.np-theme-platform--forest-green {
|
|
@@ -1504,8 +1504,8 @@
|
|
|
1504
1504
|
}
|
|
1505
1505
|
|
|
1506
1506
|
/**
|
|
1507
|
-
* Do not edit directly
|
|
1508
|
-
* Generated on
|
|
1507
|
+
* Do not edit directly, this file was auto-generated.
|
|
1508
|
+
* Generated on Tue, 31 Mar 2026 13:02:11 GMT
|
|
1509
1509
|
*/
|
|
1510
1510
|
|
|
1511
1511
|
.np-theme-business {
|
|
@@ -1688,8 +1688,8 @@
|
|
|
1688
1688
|
}
|
|
1689
1689
|
|
|
1690
1690
|
/**
|
|
1691
|
-
* Do not edit directly
|
|
1692
|
-
* Generated on
|
|
1691
|
+
* Do not edit directly, this file was auto-generated.
|
|
1692
|
+
* Generated on Tue, 31 Mar 2026 13:02:11 GMT
|
|
1693
1693
|
*/
|
|
1694
1694
|
|
|
1695
1695
|
.np-theme-business--dark {
|
|
@@ -1872,8 +1872,8 @@
|
|
|
1872
1872
|
}
|
|
1873
1873
|
|
|
1874
1874
|
/**
|
|
1875
|
-
* Do not edit directly
|
|
1876
|
-
* Generated on
|
|
1875
|
+
* Do not edit directly, this file was auto-generated.
|
|
1876
|
+
* Generated on Tue, 31 Mar 2026 13:02:11 GMT
|
|
1877
1877
|
*/
|
|
1878
1878
|
|
|
1879
1879
|
.np-theme-business--forest-green {
|
|
@@ -2056,8 +2056,8 @@
|
|
|
2056
2056
|
}
|
|
2057
2057
|
|
|
2058
2058
|
/**
|
|
2059
|
-
* Do not edit directly
|
|
2060
|
-
* Generated on
|
|
2059
|
+
* Do not edit directly, this file was auto-generated.
|
|
2060
|
+
* Generated on Tue, 31 Mar 2026 13:02:11 GMT
|
|
2061
2061
|
*/
|
|
2062
2062
|
|
|
2063
2063
|
.np-theme-business--bright-green {
|
|
@@ -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
|
}
|
|
@@ -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 {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
|
-
import { within, userEvent } from 'storybook/test';
|
|
2
|
+
import { within, userEvent, expect } from 'storybook/test';
|
|
3
3
|
import { Lock } from '@transferwise/icons';
|
|
4
4
|
import { useState } from 'react';
|
|
5
5
|
|
|
@@ -155,6 +155,15 @@ export const BalanceCurrencies: Story = {
|
|
|
155
155
|
},
|
|
156
156
|
};
|
|
157
157
|
|
|
158
|
+
export const WithDecimals: Story = {
|
|
159
|
+
args: {
|
|
160
|
+
currencies: [],
|
|
161
|
+
selectedCurrency: exampleCurrency.eur,
|
|
162
|
+
decimals: 4,
|
|
163
|
+
amount: 1234.1412,
|
|
164
|
+
},
|
|
165
|
+
};
|
|
166
|
+
|
|
158
167
|
export const OpenedInput: Story = {
|
|
159
168
|
...MultipleCurrencies,
|
|
160
169
|
play: async ({ canvasElement }) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
|
-
import { within, fireEvent } from 'storybook/test';
|
|
2
|
+
import { within, userEvent, fireEvent, expect } from 'storybook/test';
|
|
3
3
|
import { allModes } from '../../.storybook/modes';
|
|
4
4
|
import { lorem500 } from '../test-utils';
|
|
5
5
|
import { Field } from '../field/Field';
|
|
@@ -102,3 +102,143 @@ export const SmoothScrollReset: Story = {
|
|
|
102
102
|
},
|
|
103
103
|
},
|
|
104
104
|
};
|
|
105
|
+
|
|
106
|
+
export const WithDecimals: Story = {
|
|
107
|
+
args: {
|
|
108
|
+
currencies: [],
|
|
109
|
+
decimals: 4,
|
|
110
|
+
amount: 1234.5678,
|
|
111
|
+
},
|
|
112
|
+
play: async ({ canvas }) => {
|
|
113
|
+
const input = canvas.getByRole('textbox');
|
|
114
|
+
await expect(input).toHaveValue('1,234.5678');
|
|
115
|
+
await userEvent.clear(input);
|
|
116
|
+
await userEvent.type(input, '99.123456789');
|
|
117
|
+
await userEvent.tab();
|
|
118
|
+
await expect(input).toHaveValue('99.1235');
|
|
119
|
+
},
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
const eur = {
|
|
123
|
+
value: 'EUR',
|
|
124
|
+
label: 'EUR',
|
|
125
|
+
note: 'Euro',
|
|
126
|
+
currency: 'eur',
|
|
127
|
+
} as const;
|
|
128
|
+
|
|
129
|
+
const bhd = {
|
|
130
|
+
value: 'BHD',
|
|
131
|
+
label: 'BHD',
|
|
132
|
+
note: 'Bahraini dinar',
|
|
133
|
+
currency: 'bhd',
|
|
134
|
+
} as const;
|
|
135
|
+
|
|
136
|
+
const jpy = {
|
|
137
|
+
value: 'JPY',
|
|
138
|
+
label: 'JPY',
|
|
139
|
+
note: 'Japanese yen',
|
|
140
|
+
currency: 'jpy',
|
|
141
|
+
} as const;
|
|
142
|
+
|
|
143
|
+
const sharedProps = {
|
|
144
|
+
currencies: [],
|
|
145
|
+
onAmountChange: () => {},
|
|
146
|
+
onCurrencyChange: () => {},
|
|
147
|
+
} as const;
|
|
148
|
+
|
|
149
|
+
function Row({
|
|
150
|
+
label,
|
|
151
|
+
amount,
|
|
152
|
+
currency,
|
|
153
|
+
decimals,
|
|
154
|
+
}: {
|
|
155
|
+
label: string;
|
|
156
|
+
amount: number;
|
|
157
|
+
currency: { value: string; label: string; note: string; currency: string };
|
|
158
|
+
decimals: number;
|
|
159
|
+
}) {
|
|
160
|
+
return (
|
|
161
|
+
<div
|
|
162
|
+
style={{
|
|
163
|
+
display: 'grid',
|
|
164
|
+
gridTemplateColumns: '240px 1fr 1fr',
|
|
165
|
+
gap: 12,
|
|
166
|
+
alignItems: 'center',
|
|
167
|
+
}}
|
|
168
|
+
>
|
|
169
|
+
<Body as="span" style={{ fontSize: 13, color: '#6b7280' }}>
|
|
170
|
+
{label}
|
|
171
|
+
</Body>
|
|
172
|
+
<Field label={`No decimals prop (${currency.value})`}>
|
|
173
|
+
<MoneyInput {...sharedProps} selectedCurrency={currency} amount={amount} />
|
|
174
|
+
</Field>
|
|
175
|
+
<Field label={`decimals={${decimals}} (${currency.value})`}>
|
|
176
|
+
<MoneyInput
|
|
177
|
+
{...sharedProps}
|
|
178
|
+
selectedCurrency={currency}
|
|
179
|
+
amount={amount}
|
|
180
|
+
decimals={decimals}
|
|
181
|
+
/>
|
|
182
|
+
</Field>
|
|
183
|
+
</div>
|
|
184
|
+
);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* Side-by-side comparison of formatAmount (no decimals prop) vs formatNumber (with decimals prop)
|
|
189
|
+
* when decimals matches the currency default. Differences indicate a formatting parity issue.
|
|
190
|
+
*
|
|
191
|
+
* Problem 1: Trailing zero stripping — formatAmount strips ".00" for whole numbers,
|
|
192
|
+
* formatNumber always pads to the requested precision.
|
|
193
|
+
*
|
|
194
|
+
* Problem 2: BHD decimal count — formatAmount renders 2 fractional digits for BHD,
|
|
195
|
+
* but the currencyDecimals map says BHD has 3. formatNumber with decimals=3 shows 3.
|
|
196
|
+
*/
|
|
197
|
+
export const DecimalsFormatParity: Story = {
|
|
198
|
+
render: () => (
|
|
199
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: 16 }}>
|
|
200
|
+
<Body as="p" style={{ fontWeight: 600, marginTop: 8 }}>
|
|
201
|
+
EUR — whole numbers (trailing zero stripping)
|
|
202
|
+
</Body>
|
|
203
|
+
<Row label="amount=0" amount={0} currency={eur} decimals={2} />
|
|
204
|
+
<Row label="amount=1" amount={1} currency={eur} decimals={2} />
|
|
205
|
+
<Row label="amount=42" amount={42} currency={eur} decimals={2} />
|
|
206
|
+
<Row label="amount=100" amount={100} currency={eur} decimals={2} />
|
|
207
|
+
<Row label="amount=1000" amount={1000} currency={eur} decimals={2} />
|
|
208
|
+
<Row label="amount=9999999" amount={9999999} currency={eur} decimals={2} />
|
|
209
|
+
|
|
210
|
+
<Body as="p" style={{ fontWeight: 600, marginTop: 8 }}>
|
|
211
|
+
EUR — fractional amounts (should match)
|
|
212
|
+
</Body>
|
|
213
|
+
<Row label="amount=0.01" amount={0.01} currency={eur} decimals={2} />
|
|
214
|
+
<Row label="amount=0.1" amount={0.1} currency={eur} decimals={2} />
|
|
215
|
+
<Row label="amount=99.9" amount={99.9} currency={eur} decimals={2} />
|
|
216
|
+
<Row label="amount=1234567.89" amount={1234567.89} currency={eur} decimals={2} />
|
|
217
|
+
|
|
218
|
+
<Body as="p" style={{ fontWeight: 600, marginTop: 8 }}>
|
|
219
|
+
BHD — all amounts (formatAmount uses 2 digits, formatNumber uses 3)
|
|
220
|
+
</Body>
|
|
221
|
+
<Row label="amount=0" amount={0} currency={bhd} decimals={3} />
|
|
222
|
+
<Row label="amount=0.001" amount={0.001} currency={bhd} decimals={3} />
|
|
223
|
+
<Row label="amount=0.01" amount={0.01} currency={bhd} decimals={3} />
|
|
224
|
+
<Row label="amount=0.1" amount={0.1} currency={bhd} decimals={3} />
|
|
225
|
+
<Row label="amount=42" amount={42} currency={bhd} decimals={3} />
|
|
226
|
+
<Row label="amount=99.9" amount={99.9} currency={bhd} decimals={3} />
|
|
227
|
+
<Row label="amount=999.99" amount={999.99} currency={bhd} decimals={3} />
|
|
228
|
+
<Row label="amount=1234567.89" amount={1234567.89} currency={bhd} decimals={3} />
|
|
229
|
+
|
|
230
|
+
<Body as="p" style={{ fontWeight: 600, marginTop: 8 }}>
|
|
231
|
+
JPY — zero-decimal currency (should always match)
|
|
232
|
+
</Body>
|
|
233
|
+
<Row label="amount=0" amount={0} currency={jpy} decimals={0} />
|
|
234
|
+
<Row label="amount=1" amount={1} currency={jpy} decimals={0} />
|
|
235
|
+
<Row label="amount=1000" amount={1000} currency={jpy} decimals={0} />
|
|
236
|
+
<Row label="amount=1234567" amount={1234567} currency={jpy} decimals={0} />
|
|
237
|
+
</div>
|
|
238
|
+
),
|
|
239
|
+
parameters: {
|
|
240
|
+
chromatic: {
|
|
241
|
+
disableSnapshot: true,
|
|
242
|
+
},
|
|
243
|
+
},
|
|
244
|
+
};
|
|
@@ -253,6 +253,45 @@ describe('Money Input', () => {
|
|
|
253
253
|
await userEvent.tab();
|
|
254
254
|
expect(input).toHaveValue('1,234,567.65');
|
|
255
255
|
});
|
|
256
|
+
|
|
257
|
+
it('uses custom decimals when specified', async () => {
|
|
258
|
+
customRender({ decimals: 4 });
|
|
259
|
+
const input = getInput();
|
|
260
|
+
await userEvent.clear(input);
|
|
261
|
+
await userEvent.type(input, '1234.56789');
|
|
262
|
+
await userEvent.tab();
|
|
263
|
+
expect(input).toHaveValue('1,234.5679');
|
|
264
|
+
});
|
|
265
|
+
|
|
266
|
+
it('uses custom decimals of 0', async () => {
|
|
267
|
+
customRender({ decimals: 0 });
|
|
268
|
+
const input = getInput();
|
|
269
|
+
await userEvent.clear(input);
|
|
270
|
+
await userEvent.type(input, '1234.56');
|
|
271
|
+
await userEvent.tab();
|
|
272
|
+
expect(input).toHaveValue('1,235');
|
|
273
|
+
});
|
|
274
|
+
|
|
275
|
+
it('ignores custom decimals override for zero-decimal currencies like JPY', async () => {
|
|
276
|
+
const jpyCurrency: CurrencyOptionItem = {
|
|
277
|
+
value: 'JPY',
|
|
278
|
+
label: 'JPY',
|
|
279
|
+
note: 'Japanese yen',
|
|
280
|
+
currency: 'jpy',
|
|
281
|
+
};
|
|
282
|
+
customRender({
|
|
283
|
+
decimals: 4,
|
|
284
|
+
selectedCurrency: jpyCurrency,
|
|
285
|
+
currencies: [jpyCurrency],
|
|
286
|
+
amount: 1234,
|
|
287
|
+
});
|
|
288
|
+
const input = getInput();
|
|
289
|
+
expect(input).toHaveValue('1,234');
|
|
290
|
+
await userEvent.clear(input);
|
|
291
|
+
await userEvent.type(input, '5678.9999');
|
|
292
|
+
await userEvent.tab();
|
|
293
|
+
expect(input).toHaveValue('5,679');
|
|
294
|
+
});
|
|
256
295
|
});
|
|
257
296
|
|
|
258
297
|
it('calls onAmountChange with parsed and formatted value', async () => {
|
|
@@ -263,6 +302,12 @@ describe('Money Input', () => {
|
|
|
263
302
|
expect(initialProps.onAmountChange).toHaveBeenCalledWith(1000.65);
|
|
264
303
|
});
|
|
265
304
|
|
|
305
|
+
it('calls onAmountChange with value rounded to custom decimals', async () => {
|
|
306
|
+
customRender({ decimals: 4, amount: null });
|
|
307
|
+
await userEvent.type(getInput(), '12.34567');
|
|
308
|
+
expect(initialProps.onAmountChange).toHaveBeenCalledWith(12.3457);
|
|
309
|
+
});
|
|
310
|
+
|
|
266
311
|
it('calls onAmountChange when input value is empty', async () => {
|
|
267
312
|
customRender();
|
|
268
313
|
await userEvent.clear(getInput());
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
import Title from '../title';
|
|
25
25
|
|
|
26
26
|
import messages from './MoneyInput.messages';
|
|
27
|
-
import { formatAmount, parseAmount } from './currencyFormatting';
|
|
27
|
+
import { formatAmount, formatNumber, getCurrencyDecimals, parseAmount } from './currencyFormatting';
|
|
28
28
|
import withId from '../withId';
|
|
29
29
|
|
|
30
30
|
export interface CurrencyOptionItem {
|
|
@@ -48,24 +48,34 @@ const formatAmountIfSet = ({
|
|
|
48
48
|
amount,
|
|
49
49
|
currency,
|
|
50
50
|
locale,
|
|
51
|
+
decimals,
|
|
51
52
|
}: {
|
|
52
53
|
amount: number | null | undefined;
|
|
53
54
|
currency: string;
|
|
54
55
|
locale: string;
|
|
56
|
+
decimals?: number;
|
|
55
57
|
}) => {
|
|
56
|
-
|
|
58
|
+
if (typeof amount !== 'number') {
|
|
59
|
+
return '';
|
|
60
|
+
}
|
|
61
|
+
if (decimals != null && getCurrencyDecimals(currency) !== 0) {
|
|
62
|
+
return formatNumber(amount, locale, decimals);
|
|
63
|
+
}
|
|
64
|
+
return formatAmount(amount, currency, locale);
|
|
57
65
|
};
|
|
58
66
|
|
|
59
67
|
const parseNumber = ({
|
|
60
68
|
amount,
|
|
61
69
|
currency,
|
|
62
70
|
locale,
|
|
71
|
+
decimals,
|
|
63
72
|
}: {
|
|
64
73
|
amount: string;
|
|
65
74
|
currency: string;
|
|
66
75
|
locale: string;
|
|
76
|
+
decimals?: number;
|
|
67
77
|
}) => {
|
|
68
|
-
return parseAmount(amount, currency, locale);
|
|
78
|
+
return parseAmount(amount, currency, locale, decimals);
|
|
69
79
|
};
|
|
70
80
|
|
|
71
81
|
const allowedInputKeys = new Set([
|
|
@@ -102,6 +112,12 @@ export interface MoneyInputProps extends WrappedComponentProps {
|
|
|
102
112
|
onCustomAction?: () => void;
|
|
103
113
|
classNames?: Record<string, string>;
|
|
104
114
|
selectProps?: Partial<SelectInputProps<CurrencyOptionItem>>;
|
|
115
|
+
/**
|
|
116
|
+
* Specify the number of decimal places to format the amount. When not specified, the number of
|
|
117
|
+
* decimals is determined by the selected currency (e.g. 2 for EUR, 0 for JPY, 3 for BHD).
|
|
118
|
+
* This override is ignored for zero-decimal currencies (e.g. JPY, KRW, HUF), which always use 0.
|
|
119
|
+
*/
|
|
120
|
+
decimals?: number;
|
|
105
121
|
}
|
|
106
122
|
|
|
107
123
|
export type MoneyInputPropsWithInputAttributes = MoneyInputProps &
|
|
@@ -133,6 +149,7 @@ class MoneyInput extends Component<MoneyInputPropsWithInputAttributes, MoneyInpu
|
|
|
133
149
|
amount: props.amount,
|
|
134
150
|
currency: props.selectedCurrency.currency,
|
|
135
151
|
locale: props.intl.locale,
|
|
152
|
+
decimals: props.decimals,
|
|
136
153
|
}),
|
|
137
154
|
locale: props.intl.locale,
|
|
138
155
|
};
|
|
@@ -147,6 +164,7 @@ class MoneyInput extends Component<MoneyInputPropsWithInputAttributes, MoneyInpu
|
|
|
147
164
|
amount: nextProps.amount,
|
|
148
165
|
currency: nextProps.selectedCurrency.currency,
|
|
149
166
|
locale: nextProps.intl.locale,
|
|
167
|
+
decimals: nextProps.decimals,
|
|
150
168
|
}),
|
|
151
169
|
});
|
|
152
170
|
}
|
|
@@ -174,6 +192,7 @@ class MoneyInput extends Component<MoneyInputPropsWithInputAttributes, MoneyInpu
|
|
|
174
192
|
amount: paste,
|
|
175
193
|
currency: this.props.selectedCurrency.currency,
|
|
176
194
|
locale,
|
|
195
|
+
decimals: this.props.decimals,
|
|
177
196
|
});
|
|
178
197
|
|
|
179
198
|
if (isNumberOrNull(parsed)) {
|
|
@@ -182,6 +201,7 @@ class MoneyInput extends Component<MoneyInputPropsWithInputAttributes, MoneyInpu
|
|
|
182
201
|
amount: parsed,
|
|
183
202
|
currency: this.props.selectedCurrency.currency,
|
|
184
203
|
locale,
|
|
204
|
+
decimals: this.props.decimals,
|
|
185
205
|
}),
|
|
186
206
|
});
|
|
187
207
|
this.props.onAmountChange?.(parsed);
|
|
@@ -201,6 +221,7 @@ class MoneyInput extends Component<MoneyInputPropsWithInputAttributes, MoneyInpu
|
|
|
201
221
|
amount: value,
|
|
202
222
|
currency: this.props.selectedCurrency.currency,
|
|
203
223
|
locale: this.state.locale,
|
|
224
|
+
decimals: this.props.decimals,
|
|
204
225
|
});
|
|
205
226
|
if (isNumberOrNull(parsed)) {
|
|
206
227
|
this.props.onAmountChange?.(parsed);
|
|
@@ -248,6 +269,7 @@ class MoneyInput extends Component<MoneyInputPropsWithInputAttributes, MoneyInpu
|
|
|
248
269
|
amount: previousState.formattedAmount,
|
|
249
270
|
currency: this.props.selectedCurrency.currency,
|
|
250
271
|
locale: previousState.locale,
|
|
272
|
+
decimals: this.props.decimals,
|
|
251
273
|
});
|
|
252
274
|
if (!isNumberOrNull(parsed)) {
|
|
253
275
|
return {
|
|
@@ -259,6 +281,7 @@ class MoneyInput extends Component<MoneyInputPropsWithInputAttributes, MoneyInpu
|
|
|
259
281
|
amount: parsed,
|
|
260
282
|
currency: this.props.selectedCurrency.currency,
|
|
261
283
|
locale: previousState.locale,
|
|
284
|
+
decimals: this.props.decimals,
|
|
262
285
|
}),
|
|
263
286
|
};
|
|
264
287
|
});
|
|
@@ -340,6 +363,7 @@ class MoneyInput extends Component<MoneyInputPropsWithInputAttributes, MoneyInpu
|
|
|
340
363
|
amount: this.props.placeholder,
|
|
341
364
|
currency: this.props.selectedCurrency.currency,
|
|
342
365
|
locale: this.state.locale,
|
|
366
|
+
decimals: this.props.decimals,
|
|
343
367
|
})}
|
|
344
368
|
autoComplete="off"
|
|
345
369
|
aria-describedby={selectedCurrencyElementId}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { formatAmount } from '@transferwise/formatting';
|
|
1
|
+
import { formatAmount, formatNumber } from '@transferwise/formatting';
|
|
2
2
|
|
|
3
3
|
import { DEFAULT_LOCALE } from '../common/locale';
|
|
4
4
|
|
|
5
|
-
export { formatAmount };
|
|
5
|
+
export { formatAmount, formatNumber };
|
|
6
6
|
|
|
7
7
|
// TODO: do not duplicate this between formatting and components
|
|
8
8
|
const currencyDecimals: Record<string, number> = {
|
|
@@ -52,7 +52,7 @@ function getValidLocale(locale: string) {
|
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
function getCurrencyDecimals(currency: string) {
|
|
55
|
+
export function getCurrencyDecimals(currency: string) {
|
|
56
56
|
const upperCaseCurrency = currency.toUpperCase();
|
|
57
57
|
return currencyDecimals[upperCaseCurrency] ?? DEFAULT_CURRENCY_DECIMALS;
|
|
58
58
|
}
|
|
@@ -61,10 +61,16 @@ function getDecimalSeparator(locale: string) {
|
|
|
61
61
|
return isNumberLocaleSupported() ? (1.1).toLocaleString(locale)[1] : '.';
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
export function parseAmount(
|
|
64
|
+
export function parseAmount(
|
|
65
|
+
number: string,
|
|
66
|
+
currency: string,
|
|
67
|
+
locale = DEFAULT_LOCALE,
|
|
68
|
+
decimals?: number,
|
|
69
|
+
) {
|
|
65
70
|
const validLocale = getValidLocale(locale);
|
|
66
71
|
|
|
67
|
-
const
|
|
72
|
+
const currencyDefault = getCurrencyDecimals(currency);
|
|
73
|
+
const precision = currencyDefault === 0 ? 0 : (decimals ?? currencyDefault);
|
|
68
74
|
const groupSeparator = isNumberLocaleSupported() ? (10000).toLocaleString(validLocale)[2] : ',';
|
|
69
75
|
const decimalSeparator = getDecimalSeparator(validLocale);
|
|
70
76
|
const numberWithStandardDecimalSeparator = (number || '')
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
--color-sentiment-interactive-control: #CB272F;
|
|
50
50
|
--color-sentiment-interactive-control-hover: #B8232B;
|
|
51
51
|
--color-sentiment-interactive-control-active: #A72027;
|
|
52
|
-
--color-sentiment-background-surface: #
|
|
52
|
+
--color-sentiment-background-surface: #CB272F;
|
|
53
53
|
--color-sentiment-background-surface-hover: #B8232B;
|
|
54
54
|
--color-sentiment-background-surface-active: #A72027;
|
|
55
55
|
}
|
|
@@ -1,6 +1,37 @@
|
|
|
1
|
-
.
|
|
2
|
-
|
|
1
|
+
.status-circle.negative,
|
|
2
|
+
.status-circle.error {
|
|
3
|
+
background-color: var(--color-sentiment-interactive-primary, var(--color-sentiment-negative));
|
|
3
4
|
}
|
|
4
|
-
.
|
|
5
|
-
|
|
5
|
+
.status-circle.negative .status-icon,
|
|
6
|
+
.status-circle.error .status-icon {
|
|
7
|
+
color: var(--color-sentiment-interactive-control, var(--color-sentiment-negative-secondary));
|
|
8
|
+
}
|
|
9
|
+
.status-circle.positive,
|
|
10
|
+
.status-circle.success {
|
|
11
|
+
background-color: var(--color-sentiment-interactive-primary, var(--color-sentiment-positive));
|
|
12
|
+
}
|
|
13
|
+
.status-circle.positive .status-icon,
|
|
14
|
+
.status-circle.success .status-icon {
|
|
15
|
+
color: var(--color-sentiment-interactive-control, var(--color-sentiment-positive-secondary));
|
|
16
|
+
}
|
|
17
|
+
.status-circle.warning,
|
|
18
|
+
.status-circle.pending {
|
|
19
|
+
background-color: var(--color-sentiment-interactive-primary, var(--color-sentiment-warning));
|
|
20
|
+
}
|
|
21
|
+
.status-circle.warning .status-icon,
|
|
22
|
+
.status-circle.pending .status-icon {
|
|
23
|
+
color: var(--color-sentiment-interactive-control, var(--color-dark));
|
|
24
|
+
}
|
|
25
|
+
.status-circle.neutral,
|
|
26
|
+
.status-circle.info {
|
|
27
|
+
background-color: #5d7079;
|
|
28
|
+
background-color: var(--color-sentiment-interactive-primary, var(--color-content-secondary));
|
|
29
|
+
}
|
|
30
|
+
.status-circle.neutral .status-icon,
|
|
31
|
+
.status-circle.info .status-icon {
|
|
32
|
+
color: var(--color-sentiment-interactive-control, var(--color-contrast-overlay));
|
|
33
|
+
}
|
|
34
|
+
.np-theme-personal--bright-green .status-circle.neutral .status-icon,
|
|
35
|
+
.np-theme-personal--bright-green .status-circle.info .status-icon {
|
|
36
|
+
color: var(--color-sentiment-interactive-control, var(--color-white));
|
|
6
37
|
}
|
|
@@ -1,6 +1,37 @@
|
|
|
1
|
-
.
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
color: var(--color-sentiment-interactive-
|
|
1
|
+
.status-circle {
|
|
2
|
+
&.negative,
|
|
3
|
+
&.error {
|
|
4
|
+
background-color: var(--color-sentiment-interactive-primary, var(--color-sentiment-negative));
|
|
5
|
+
.status-icon {
|
|
6
|
+
color: var(--color-sentiment-interactive-control, var(--color-sentiment-negative-secondary));
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
&.positive,
|
|
11
|
+
&.success {
|
|
12
|
+
background-color: var(--color-sentiment-interactive-primary, var(--color-sentiment-positive));
|
|
13
|
+
.status-icon {
|
|
14
|
+
color: var(--color-sentiment-interactive-control, var(--color-sentiment-positive-secondary));
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
&.warning,
|
|
19
|
+
&.pending {
|
|
20
|
+
background-color: var(--color-sentiment-interactive-primary, var(--color-sentiment-warning));
|
|
21
|
+
.status-icon {
|
|
22
|
+
color: var(--color-sentiment-interactive-control, var(--color-dark));
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&.neutral,
|
|
27
|
+
&.info {
|
|
28
|
+
background-color: var(--color-sentiment-interactive-primary, var(--color-content-secondary));
|
|
29
|
+
.status-icon {
|
|
30
|
+
color: var(--color-sentiment-interactive-control, var(--color-contrast-overlay));
|
|
31
|
+
|
|
32
|
+
.np-theme-personal--bright-green & {
|
|
33
|
+
color: var(--color-sentiment-interactive-control, var(--color-white));
|
|
34
|
+
}
|
|
35
|
+
}
|
|
5
36
|
}
|
|
6
37
|
}
|