@transferwise/components 46.78.0 → 46.79.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 +22 -3
- package/build/accordion/AccordionItem/AccordionItem.js.map +1 -1
- package/build/accordion/AccordionItem/AccordionItem.mjs +22 -3
- package/build/accordion/AccordionItem/AccordionItem.mjs.map +1 -1
- package/build/actionButton/ActionButton.js +22 -1
- package/build/actionButton/ActionButton.js.map +1 -1
- package/build/actionButton/ActionButton.mjs +22 -1
- package/build/actionButton/ActionButton.mjs.map +1 -1
- package/build/actionOption/ActionOption.js +24 -2
- package/build/actionOption/ActionOption.js.map +1 -1
- package/build/actionOption/ActionOption.mjs +24 -2
- package/build/actionOption/ActionOption.mjs.map +1 -1
- package/build/alert/Alert.js +22 -6
- package/build/alert/Alert.js.map +1 -1
- package/build/alert/Alert.mjs +22 -6
- package/build/alert/Alert.mjs.map +1 -1
- package/build/alert/inlineMarkdown/InlineMarkdown.js +25 -2
- package/build/alert/inlineMarkdown/InlineMarkdown.js.map +1 -1
- package/build/alert/inlineMarkdown/InlineMarkdown.mjs +25 -2
- package/build/alert/inlineMarkdown/InlineMarkdown.mjs.map +1 -1
- package/build/avatar/Avatar.js +23 -2
- package/build/avatar/Avatar.js.map +1 -1
- package/build/avatar/Avatar.mjs +23 -2
- package/build/avatar/Avatar.mjs.map +1 -1
- package/build/avatarWrapper/AvatarWrapper.js +23 -3
- package/build/avatarWrapper/AvatarWrapper.js.map +1 -1
- package/build/avatarWrapper/AvatarWrapper.mjs +23 -3
- package/build/avatarWrapper/AvatarWrapper.mjs.map +1 -1
- package/build/badge/Badge.js +23 -2
- package/build/badge/Badge.js.map +1 -1
- package/build/badge/Badge.mjs +23 -2
- package/build/badge/Badge.mjs.map +1 -1
- package/build/button/Button.js +22 -6
- package/build/button/Button.js.map +1 -1
- package/build/button/Button.messages.js.map +1 -1
- package/build/button/Button.messages.mjs.map +1 -1
- package/build/button/Button.mjs +22 -6
- package/build/button/Button.mjs.map +1 -1
- package/build/button/classMap.js +24 -0
- package/build/button/classMap.js.map +1 -1
- package/build/button/classMap.mjs +24 -0
- package/build/button/classMap.mjs.map +1 -1
- package/build/button/legacyUtils/legacyUtils.js +30 -7
- package/build/button/legacyUtils/legacyUtils.js.map +1 -1
- package/build/button/legacyUtils/legacyUtils.mjs +30 -7
- package/build/button/legacyUtils/legacyUtils.mjs.map +1 -1
- package/build/card/Card.js +23 -3
- package/build/card/Card.js.map +1 -1
- package/build/card/Card.mjs +23 -3
- package/build/card/Card.mjs.map +1 -1
- package/build/checkbox/Checkbox.js +23 -1
- package/build/checkbox/Checkbox.js.map +1 -1
- package/build/checkbox/Checkbox.mjs +23 -1
- package/build/checkbox/Checkbox.mjs.map +1 -1
- package/build/checkboxOption/CheckboxOption.js +1 -1
- package/build/checkboxOption/CheckboxOption.mjs +1 -1
- package/build/chevron/Chevron.js +21 -1
- package/build/chevron/Chevron.js.map +1 -1
- package/build/chevron/Chevron.mjs +21 -1
- package/build/chevron/Chevron.mjs.map +1 -1
- package/build/chips/Chip.js +19 -1
- package/build/chips/Chip.js.map +1 -1
- package/build/chips/Chip.mjs +19 -1
- package/build/chips/Chip.mjs.map +1 -1
- package/build/circularButton/CircularButton.js +23 -4
- package/build/circularButton/CircularButton.js.map +1 -1
- package/build/circularButton/CircularButton.mjs +23 -4
- package/build/circularButton/CircularButton.mjs.map +1 -1
- package/build/common/bottomSheet/BottomSheet.js +3 -2
- package/build/common/bottomSheet/BottomSheet.js.map +1 -1
- package/build/common/bottomSheet/BottomSheet.mjs +3 -2
- package/build/common/bottomSheet/BottomSheet.mjs.map +1 -1
- package/build/common/hooks/useHasIntersected/useHasIntersected.js +10 -10
- package/build/common/hooks/useHasIntersected/useHasIntersected.js.map +1 -1
- package/build/common/hooks/useHasIntersected/useHasIntersected.mjs +10 -10
- package/build/common/hooks/useHasIntersected/useHasIntersected.mjs.map +1 -1
- package/build/common/locale/index.js +24 -0
- package/build/common/locale/index.js.map +1 -1
- package/build/common/locale/index.mjs +24 -0
- package/build/common/locale/index.mjs.map +1 -1
- package/build/common/panel/Panel.js +23 -2
- package/build/common/panel/Panel.js.map +1 -1
- package/build/common/panel/Panel.mjs +23 -2
- package/build/common/panel/Panel.mjs.map +1 -1
- package/build/common/responsivePanel/ResponsivePanel.js +27 -3
- package/build/common/responsivePanel/ResponsivePanel.js.map +1 -1
- package/build/common/responsivePanel/ResponsivePanel.mjs +27 -3
- package/build/common/responsivePanel/ResponsivePanel.mjs.map +1 -1
- package/build/criticalBanner/CriticalCommsBanner.js +22 -3
- package/build/criticalBanner/CriticalCommsBanner.js.map +1 -1
- package/build/criticalBanner/CriticalCommsBanner.mjs +22 -3
- package/build/criticalBanner/CriticalCommsBanner.mjs.map +1 -1
- package/build/dateInput/DateInput.js +22 -5
- package/build/dateInput/DateInput.js.map +1 -1
- package/build/dateInput/DateInput.mjs +22 -5
- package/build/dateInput/DateInput.mjs.map +1 -1
- package/build/dateLookup/DateLookup.js +24 -6
- package/build/dateLookup/DateLookup.js.map +1 -1
- package/build/dateLookup/DateLookup.mjs +24 -6
- package/build/dateLookup/DateLookup.mjs.map +1 -1
- package/build/dateLookup/dateHeader/DateHeader.js +26 -5
- package/build/dateLookup/dateHeader/DateHeader.js.map +1 -1
- package/build/dateLookup/dateHeader/DateHeader.mjs +26 -5
- package/build/dateLookup/dateHeader/DateHeader.mjs.map +1 -1
- package/build/dateLookup/dateTrigger/DateTrigger.js +19 -3
- package/build/dateLookup/dateTrigger/DateTrigger.js.map +1 -1
- package/build/dateLookup/dateTrigger/DateTrigger.mjs +19 -3
- package/build/dateLookup/dateTrigger/DateTrigger.mjs.map +1 -1
- package/build/decision/Decision.js +24 -3
- package/build/decision/Decision.js.map +1 -1
- package/build/decision/Decision.mjs +24 -3
- package/build/decision/Decision.mjs.map +1 -1
- package/build/definitionList/DefinitionList.js +23 -1
- package/build/definitionList/DefinitionList.js.map +1 -1
- package/build/definitionList/DefinitionList.mjs +23 -1
- package/build/definitionList/DefinitionList.mjs.map +1 -1
- package/build/dimmer/Dimmer.js +24 -2
- package/build/dimmer/Dimmer.js.map +1 -1
- package/build/dimmer/Dimmer.mjs +24 -2
- package/build/dimmer/Dimmer.mjs.map +1 -1
- package/build/display/Display.js +23 -1
- package/build/display/Display.js.map +1 -1
- package/build/display/Display.mjs +23 -1
- package/build/display/Display.mjs.map +1 -1
- package/build/drawer/Drawer.js +23 -4
- package/build/drawer/Drawer.js.map +1 -1
- package/build/drawer/Drawer.mjs +23 -4
- package/build/drawer/Drawer.mjs.map +1 -1
- package/build/field/Field.js +23 -2
- package/build/field/Field.js.map +1 -1
- package/build/field/Field.mjs +23 -2
- package/build/field/Field.mjs.map +1 -1
- package/build/flowNavigation/FlowNavigation.js +19 -2
- package/build/flowNavigation/FlowNavigation.js.map +1 -1
- package/build/flowNavigation/FlowNavigation.mjs +19 -2
- package/build/flowNavigation/FlowNavigation.mjs.map +1 -1
- package/build/header/Header.js +24 -2
- package/build/header/Header.js.map +1 -1
- package/build/header/Header.mjs +24 -2
- package/build/header/Header.mjs.map +1 -1
- package/build/image/Image.js +4 -1
- package/build/image/Image.js.map +1 -1
- package/build/image/Image.mjs +4 -1
- package/build/image/Image.mjs.map +1 -1
- package/build/index.js +69 -62
- package/build/index.js.map +1 -1
- package/build/index.mjs +27 -20
- package/build/index.mjs.map +1 -1
- package/build/info/Info.js +21 -3
- package/build/info/Info.js.map +1 -1
- package/build/info/Info.mjs +21 -3
- package/build/info/Info.mjs.map +1 -1
- package/build/inlineAlert/InlineAlert.js +24 -3
- package/build/inlineAlert/InlineAlert.js.map +1 -1
- package/build/inlineAlert/InlineAlert.mjs +24 -3
- package/build/inlineAlert/InlineAlert.mjs.map +1 -1
- package/build/inputs/SearchInput.js +23 -2
- package/build/inputs/SearchInput.js.map +1 -1
- package/build/inputs/SearchInput.mjs +23 -2
- package/build/inputs/SearchInput.mjs.map +1 -1
- package/build/instructionsList/InstructionsList.js +22 -1
- package/build/instructionsList/InstructionsList.js.map +1 -1
- package/build/instructionsList/InstructionsList.mjs +22 -1
- package/build/instructionsList/InstructionsList.mjs.map +1 -1
- package/build/loader/Loader.js +22 -1
- package/build/loader/Loader.js.map +1 -1
- package/build/loader/Loader.mjs +22 -1
- package/build/loader/Loader.mjs.map +1 -1
- package/build/markdown/Markdown.js +24 -1
- package/build/markdown/Markdown.js.map +1 -1
- package/build/markdown/Markdown.mjs +24 -1
- package/build/markdown/Markdown.mjs.map +1 -1
- package/build/modal/Modal.js +22 -5
- package/build/modal/Modal.js.map +1 -1
- package/build/modal/Modal.mjs +22 -5
- package/build/modal/Modal.mjs.map +1 -1
- package/build/moneyInput/MoneyInput.js +22 -3
- package/build/moneyInput/MoneyInput.js.map +1 -1
- package/build/moneyInput/MoneyInput.mjs +22 -3
- package/build/moneyInput/MoneyInput.mjs.map +1 -1
- package/build/navigationOption/NavigationOption.js +23 -2
- package/build/navigationOption/NavigationOption.js.map +1 -1
- package/build/navigationOption/NavigationOption.mjs +23 -2
- package/build/navigationOption/NavigationOption.mjs.map +1 -1
- package/build/nudge/Nudge.js +19 -1
- package/build/nudge/Nudge.js.map +1 -1
- package/build/nudge/Nudge.mjs +19 -1
- package/build/nudge/Nudge.mjs.map +1 -1
- package/build/overlayHeader/OverlayHeader.js +19 -1
- package/build/overlayHeader/OverlayHeader.js.map +1 -1
- package/build/overlayHeader/OverlayHeader.mjs +19 -1
- package/build/overlayHeader/OverlayHeader.mjs.map +1 -1
- package/build/phoneNumberInput/PhoneNumberInput.js +23 -2
- package/build/phoneNumberInput/PhoneNumberInput.js.map +1 -1
- package/build/phoneNumberInput/PhoneNumberInput.mjs +23 -2
- package/build/phoneNumberInput/PhoneNumberInput.mjs.map +1 -1
- package/build/popover/Popover.js +24 -4
- package/build/popover/Popover.js.map +1 -1
- package/build/popover/Popover.mjs +24 -4
- package/build/popover/Popover.mjs.map +1 -1
- package/build/processIndicator/ProcessIndicator.js +22 -1
- package/build/processIndicator/ProcessIndicator.js.map +1 -1
- package/build/processIndicator/ProcessIndicator.mjs +22 -1
- package/build/processIndicator/ProcessIndicator.mjs.map +1 -1
- package/build/progressBar/ProgressBar.js +24 -2
- package/build/progressBar/ProgressBar.js.map +1 -1
- package/build/progressBar/ProgressBar.mjs +24 -2
- package/build/progressBar/ProgressBar.mjs.map +1 -1
- package/build/promoCard/PromoCard.js +22 -2
- package/build/promoCard/PromoCard.js.map +1 -1
- package/build/promoCard/PromoCard.mjs +22 -2
- package/build/promoCard/PromoCard.mjs.map +1 -1
- package/build/promoCard/PromoCardIndicator.js +22 -1
- package/build/promoCard/PromoCardIndicator.js.map +1 -1
- package/build/promoCard/PromoCardIndicator.mjs +22 -1
- package/build/promoCard/PromoCardIndicator.mjs.map +1 -1
- package/build/provider/Provider.js +25 -2
- package/build/provider/Provider.js.map +1 -1
- package/build/provider/Provider.mjs +25 -2
- package/build/provider/Provider.mjs.map +1 -1
- package/build/radio/Radio.js +24 -2
- package/build/radio/Radio.js.map +1 -1
- package/build/radio/Radio.mjs +24 -2
- package/build/radio/Radio.mjs.map +1 -1
- package/build/segmentedControl/SegmentedControl.js +22 -1
- package/build/segmentedControl/SegmentedControl.js.map +1 -1
- package/build/segmentedControl/SegmentedControl.mjs +22 -1
- package/build/segmentedControl/SegmentedControl.mjs.map +1 -1
- package/build/select/Select.js +26 -4
- package/build/select/Select.js.map +1 -1
- package/build/select/Select.mjs +26 -4
- package/build/select/Select.mjs.map +1 -1
- package/build/select/option/Option.js +22 -1
- package/build/select/option/Option.js.map +1 -1
- package/build/select/option/Option.mjs +22 -1
- package/build/select/option/Option.mjs.map +1 -1
- package/build/selectOption/SelectOption.js +24 -6
- package/build/selectOption/SelectOption.js.map +1 -1
- package/build/selectOption/SelectOption.mjs +24 -6
- package/build/selectOption/SelectOption.mjs.map +1 -1
- package/build/statusIcon/StatusIcon.js +22 -4
- package/build/statusIcon/StatusIcon.js.map +1 -1
- package/build/statusIcon/StatusIcon.mjs +22 -4
- package/build/statusIcon/StatusIcon.mjs.map +1 -1
- package/build/stepper/Stepper.js +25 -3
- package/build/stepper/Stepper.js.map +1 -1
- package/build/stepper/Stepper.mjs +25 -3
- package/build/stepper/Stepper.mjs.map +1 -1
- package/build/stepper/deviceDetection.js +2 -3
- package/build/stepper/deviceDetection.js.map +1 -1
- package/build/stepper/deviceDetection.mjs +2 -3
- package/build/stepper/deviceDetection.mjs.map +1 -1
- package/build/sticky/Sticky.js +25 -2
- package/build/sticky/Sticky.js.map +1 -1
- package/build/sticky/Sticky.mjs +25 -2
- package/build/sticky/Sticky.mjs.map +1 -1
- package/build/summary/Summary.js +21 -5
- package/build/summary/Summary.js.map +1 -1
- package/build/summary/Summary.mjs +21 -5
- package/build/summary/Summary.mjs.map +1 -1
- package/build/tabs/Tabs.js +23 -3
- package/build/tabs/Tabs.js.map +1 -1
- package/build/tabs/Tabs.mjs +23 -3
- package/build/tabs/Tabs.mjs.map +1 -1
- package/build/tile/Tile.js +24 -2
- package/build/tile/Tile.js.map +1 -1
- package/build/tile/Tile.mjs +24 -2
- package/build/tile/Tile.mjs.map +1 -1
- package/build/title/Title.js +23 -1
- package/build/title/Title.js.map +1 -1
- package/build/title/Title.mjs +23 -1
- package/build/title/Title.mjs.map +1 -1
- package/build/tooltip/Tooltip.js +22 -1
- package/build/tooltip/Tooltip.js.map +1 -1
- package/build/tooltip/Tooltip.mjs +22 -1
- package/build/tooltip/Tooltip.mjs.map +1 -1
- package/build/typeahead/Typeahead.js +22 -4
- package/build/typeahead/Typeahead.js.map +1 -1
- package/build/typeahead/Typeahead.mjs +22 -4
- package/build/typeahead/Typeahead.mjs.map +1 -1
- package/build/types/button/Button.d.ts.map +1 -1
- package/build/types/button/Button.messages.d.ts +7 -7
- package/build/types/button/Button.messages.d.ts.map +1 -1
- package/build/types/button/classMap.d.ts +10 -10
- package/build/types/button/classMap.d.ts.map +1 -1
- package/build/types/button/legacyUtils/index.d.ts +1 -1
- package/build/types/button/legacyUtils/index.d.ts.map +1 -1
- package/build/types/button/legacyUtils/legacyUtils.d.ts +20 -6
- package/build/types/button/legacyUtils/legacyUtils.d.ts.map +1 -1
- package/build/types/checkboxButton/index.d.ts +1 -1
- package/build/types/checkboxButton/index.d.ts.map +1 -1
- package/build/types/common/fakeEvents.d.ts +23 -0
- package/build/types/common/fakeEvents.d.ts.map +1 -0
- package/build/types/common/hooks/index.d.ts +4 -4
- package/build/types/common/hooks/index.d.ts.map +1 -1
- package/build/types/common/hooks/useConditionalListener/index.d.ts +1 -1
- package/build/types/common/hooks/useConditionalListener/index.d.ts.map +1 -1
- package/build/types/common/hooks/useDirection/index.d.ts +1 -1
- package/build/types/common/hooks/useDirection/index.d.ts.map +1 -1
- package/build/types/common/hooks/useHasIntersected/index.d.ts +1 -1
- package/build/types/common/hooks/useHasIntersected/index.d.ts.map +1 -1
- package/build/types/common/hooks/useHasIntersected/useHasIntersected.d.ts +15 -4
- package/build/types/common/hooks/useHasIntersected/useHasIntersected.d.ts.map +1 -1
- package/build/types/common/index.d.ts +28 -28
- package/build/types/common/index.d.ts.map +1 -1
- package/build/types/common/responsivePanel/index.d.ts +1 -1
- package/build/types/common/responsivePanel/index.d.ts.map +1 -1
- package/build/types/index.d.ts +1 -0
- package/build/types/index.d.ts.map +1 -1
- package/build/types/navigationOption/NavigationOption.d.ts +1 -0
- package/build/types/navigationOption/NavigationOption.d.ts.map +1 -1
- package/build/types/stepper/deviceDetection.d.ts +1 -1
- package/build/types/stepper/deviceDetection.d.ts.map +1 -1
- package/build/types/test-utils/style-mock.d.ts +1 -0
- package/build/types/test-utils/style-mock.d.ts.map +1 -0
- package/build/types/utilities/deprecatedProperty/deprecatedProperty.d.ts +8 -6
- package/build/types/utilities/deprecatedProperty/deprecatedProperty.d.ts.map +1 -1
- package/build/types/utilities/deprecatedProperty/index.d.ts +1 -1
- package/build/types/utilities/deprecatedProperty/index.d.ts.map +1 -1
- package/build/types/utilities/index.d.ts +2 -2
- package/build/types/utilities/index.d.ts.map +1 -1
- package/build/types/utilities/logActionRequired.d.ts +2 -2
- package/build/types/utilities/logActionRequired.d.ts.map +1 -1
- package/build/upload/Upload.js +21 -2
- package/build/upload/Upload.js.map +1 -1
- package/build/upload/Upload.mjs +21 -2
- package/build/upload/Upload.mjs.map +1 -1
- package/build/upload/steps/processingStep/processingStep.js +25 -3
- package/build/upload/steps/processingStep/processingStep.js.map +1 -1
- package/build/upload/steps/processingStep/processingStep.mjs +25 -3
- package/build/upload/steps/processingStep/processingStep.mjs.map +1 -1
- package/build/upload/steps/uploadImageStep/uploadImageStep.js +23 -3
- package/build/upload/steps/uploadImageStep/uploadImageStep.js.map +1 -1
- package/build/upload/steps/uploadImageStep/uploadImageStep.mjs +23 -3
- package/build/upload/steps/uploadImageStep/uploadImageStep.mjs.map +1 -1
- package/build/uploadInput/UploadInput.js +22 -3
- package/build/uploadInput/UploadInput.js.map +1 -1
- package/build/uploadInput/UploadInput.mjs +22 -3
- package/build/uploadInput/UploadInput.mjs.map +1 -1
- package/build/uploadInput/uploadButton/UploadButton.js +21 -2
- package/build/uploadInput/uploadButton/UploadButton.js.map +1 -1
- package/build/uploadInput/uploadButton/UploadButton.mjs +21 -2
- package/build/uploadInput/uploadButton/UploadButton.mjs.map +1 -1
- package/build/uploadInput/uploadButton/defaults.js +24 -0
- package/build/uploadInput/uploadButton/defaults.js.map +1 -1
- package/build/uploadInput/uploadButton/defaults.mjs +24 -0
- package/build/uploadInput/uploadButton/defaults.mjs.map +1 -1
- package/build/uploadInput/uploadItem/UploadItem.js +21 -4
- package/build/uploadInput/uploadItem/UploadItem.js.map +1 -1
- package/build/uploadInput/uploadItem/UploadItem.mjs +21 -4
- package/build/uploadInput/uploadItem/UploadItem.mjs.map +1 -1
- package/build/utilities/logActionRequired.js.map +1 -1
- package/build/utilities/logActionRequired.mjs.map +1 -1
- package/build/withDisplayFormat/WithDisplayFormat.js +25 -1
- package/build/withDisplayFormat/WithDisplayFormat.js.map +1 -1
- package/build/withDisplayFormat/WithDisplayFormat.mjs +25 -1
- package/build/withDisplayFormat/WithDisplayFormat.mjs.map +1 -1
- package/package.json +2 -2
- package/src/button/Button.tsx +0 -3
- package/src/button/legacyUtils/legacyUtils.ts +74 -0
- package/src/common/{fakeEvents.js → fakeEvents.ts} +1 -1
- package/src/common/hooks/useHasIntersected/{useHasIntersected.js → useHasIntersected.ts} +20 -11
- package/src/flowNavigation/{FlowNavigation.story.js → FlowNavigation.story.tsx} +34 -16
- package/src/index.ts +1 -0
- package/src/inputWithDisplayFormat/InputWithDisplayFormat.story.tsx +78 -0
- package/src/navigationOption/{NavigationOption.story.js → NavigationOption.story.tsx} +23 -5
- package/src/navigationOption/NavigationOption.tsx +1 -1
- package/src/select/{Select.story.js → Select.story.tsx} +97 -47
- package/src/stepper/{deviceDetection.js → deviceDetection.ts} +2 -6
- package/src/utilities/deprecatedProperty/{deprecatedProperty.spec.js → deprecatedProperty.spec.ts} +7 -13
- package/src/utilities/deprecatedProperty/{deprecatedProperty.js → deprecatedProperty.ts} +23 -4
- package/src/utilities/{logActionRequired.js → logActionRequired.ts} +2 -2
- package/src/button/legacyUtils/legacyUtils.js +0 -54
- package/src/common/requirements.js +0 -440
- package/src/inputWithDisplayFormat/InputWithDisplayFormat.story.js +0 -85
- /package/src/button/{Button.messages.js → Button.messages.ts} +0 -0
- /package/src/button/{classMap.js → classMap.ts} +0 -0
- /package/src/button/legacyUtils/{index.js → index.ts} +0 -0
- /package/src/checkboxButton/{index.js → index.ts} +0 -0
- /package/src/common/hooks/{index.js → index.ts} +0 -0
- /package/src/common/hooks/useConditionalListener/{index.js → index.ts} +0 -0
- /package/src/common/hooks/useDirection/{index.js → index.ts} +0 -0
- /package/src/common/hooks/useHasIntersected/{index.js → index.ts} +0 -0
- /package/src/common/{index.js → index.ts} +0 -0
- /package/src/common/responsivePanel/{index.js → index.ts} +0 -0
- /package/src/test-utils/{style-mock.js → style-mock.ts} +0 -0
- /package/src/utilities/deprecatedProperty/{index.js → index.ts} +0 -0
- /package/src/utilities/{index.js → index.ts} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InlineMarkdown.js","sources":["../../../src/alert/inlineMarkdown/InlineMarkdown.tsx"],"sourcesContent":["import { MarkdownNodeType } from '../../common';\nimport Markdown from '../../markdown';\n\nconst allowList = [MarkdownNodeType.STRONG];\n\nexport interface InlineMarkdownProps {\n children?: string;\n className?: string;\n}\n\nexport default function InlineMarkdown(props: InlineMarkdownProps) {\n return <Markdown {...props} as=\"span\" allowList={allowList} blockList={undefined} />;\n}\n"],"names":["allowList","MarkdownNodeType","STRONG","InlineMarkdown","props","_jsx","Markdown","as","blockList","undefined"],"mappings":"
|
|
1
|
+
{"version":3,"file":"InlineMarkdown.js","sources":["../../../src/alert/inlineMarkdown/InlineMarkdown.tsx"],"sourcesContent":["import { MarkdownNodeType } from '../../common';\nimport Markdown from '../../markdown';\n\nconst allowList = [MarkdownNodeType.STRONG];\n\nexport interface InlineMarkdownProps {\n children?: string;\n className?: string;\n}\n\nexport default function InlineMarkdown(props: InlineMarkdownProps) {\n return <Markdown {...props} as=\"span\" allowList={allowList} blockList={undefined} />;\n}\n"],"names":["allowList","MarkdownNodeType","STRONG","InlineMarkdown","props","_jsx","Markdown","as","blockList","undefined"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,MAAMA,SAAS,GAAG,CAACC,iCAAgB,CAACC,MAAM,CAAC,CAAA;AAOnB,SAAAC,cAAcA,CAACC,KAA0B,EAAA;EAC/D,oBAAOC,cAAA,CAACC,QAAQ,EAAA;AAAA,IAAA,GAAKF,KAAK;AAAEG,IAAAA,EAAE,EAAC,MAAM;AAACP,IAAAA,SAAS,EAAEA,SAAU;AAACQ,IAAAA,SAAS,EAAEC,SAAAA;AAAU,GAAA,CAAG,CAAA;AACtF;;;;"}
|
|
@@ -1,6 +1,29 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import '../../common/theme.mjs';
|
|
2
|
+
import '../../common/direction.mjs';
|
|
3
|
+
import '../../common/propsValues/control.mjs';
|
|
4
|
+
import '../../common/propsValues/breakpoint.mjs';
|
|
5
|
+
import '../../common/propsValues/size.mjs';
|
|
6
|
+
import '../../common/propsValues/typography.mjs';
|
|
7
|
+
import '../../common/propsValues/width.mjs';
|
|
8
|
+
import '../../common/propsValues/type.mjs';
|
|
9
|
+
import '../../common/propsValues/dateMode.mjs';
|
|
10
|
+
import '../../common/propsValues/monthFormat.mjs';
|
|
11
|
+
import '../../common/propsValues/position.mjs';
|
|
12
|
+
import '../../common/propsValues/layouts.mjs';
|
|
13
|
+
import '../../common/propsValues/status.mjs';
|
|
14
|
+
import '../../common/propsValues/sentiment.mjs';
|
|
15
|
+
import '../../common/propsValues/profileType.mjs';
|
|
16
|
+
import '../../common/propsValues/variant.mjs';
|
|
17
|
+
import '../../common/propsValues/scroll.mjs';
|
|
3
18
|
import { MarkdownNodeType } from '../../common/propsValues/markdownNodeType.mjs';
|
|
19
|
+
import '../../common/fileType.mjs';
|
|
20
|
+
import '@transferwise/icons';
|
|
21
|
+
import 'clsx';
|
|
22
|
+
import 'react';
|
|
23
|
+
import 'react-intl';
|
|
24
|
+
import '../../common/closeButton/CloseButton.messages.mjs';
|
|
25
|
+
import { jsx } from 'react/jsx-runtime';
|
|
26
|
+
import Markdown from '../../markdown/Markdown.mjs';
|
|
4
27
|
|
|
5
28
|
const allowList = [MarkdownNodeType.STRONG];
|
|
6
29
|
function InlineMarkdown(props) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InlineMarkdown.mjs","sources":["../../../src/alert/inlineMarkdown/InlineMarkdown.tsx"],"sourcesContent":["import { MarkdownNodeType } from '../../common';\nimport Markdown from '../../markdown';\n\nconst allowList = [MarkdownNodeType.STRONG];\n\nexport interface InlineMarkdownProps {\n children?: string;\n className?: string;\n}\n\nexport default function InlineMarkdown(props: InlineMarkdownProps) {\n return <Markdown {...props} as=\"span\" allowList={allowList} blockList={undefined} />;\n}\n"],"names":["allowList","MarkdownNodeType","STRONG","InlineMarkdown","props","_jsx","Markdown","as","blockList","undefined"],"mappings":"
|
|
1
|
+
{"version":3,"file":"InlineMarkdown.mjs","sources":["../../../src/alert/inlineMarkdown/InlineMarkdown.tsx"],"sourcesContent":["import { MarkdownNodeType } from '../../common';\nimport Markdown from '../../markdown';\n\nconst allowList = [MarkdownNodeType.STRONG];\n\nexport interface InlineMarkdownProps {\n children?: string;\n className?: string;\n}\n\nexport default function InlineMarkdown(props: InlineMarkdownProps) {\n return <Markdown {...props} as=\"span\" allowList={allowList} blockList={undefined} />;\n}\n"],"names":["allowList","MarkdownNodeType","STRONG","InlineMarkdown","props","_jsx","Markdown","as","blockList","undefined"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,MAAMA,SAAS,GAAG,CAACC,gBAAgB,CAACC,MAAM,CAAC,CAAA;AAOnB,SAAAC,cAAcA,CAACC,KAA0B,EAAA;EAC/D,oBAAOC,GAAA,CAACC,QAAQ,EAAA;AAAA,IAAA,GAAKF,KAAK;AAAEG,IAAAA,EAAE,EAAC,MAAM;AAACP,IAAAA,SAAS,EAAEA,SAAU;AAACQ,IAAAA,SAAS,EAAEC,SAAAA;AAAU,GAAA,CAAG,CAAA;AACtF;;;;"}
|
package/build/avatar/Avatar.js
CHANGED
|
@@ -2,9 +2,30 @@
|
|
|
2
2
|
|
|
3
3
|
var clsx = require('clsx');
|
|
4
4
|
var React = require('react');
|
|
5
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
-
var colors = require('../common/colors.js');
|
|
7
5
|
var theme = require('../common/theme.js');
|
|
6
|
+
require('../common/direction.js');
|
|
7
|
+
require('../common/propsValues/control.js');
|
|
8
|
+
require('../common/propsValues/breakpoint.js');
|
|
9
|
+
require('../common/propsValues/size.js');
|
|
10
|
+
require('../common/propsValues/typography.js');
|
|
11
|
+
require('../common/propsValues/width.js');
|
|
12
|
+
require('../common/propsValues/type.js');
|
|
13
|
+
require('../common/propsValues/dateMode.js');
|
|
14
|
+
require('../common/propsValues/monthFormat.js');
|
|
15
|
+
require('../common/propsValues/position.js');
|
|
16
|
+
require('../common/propsValues/layouts.js');
|
|
17
|
+
require('../common/propsValues/status.js');
|
|
18
|
+
require('../common/propsValues/sentiment.js');
|
|
19
|
+
require('../common/propsValues/profileType.js');
|
|
20
|
+
require('../common/propsValues/variant.js');
|
|
21
|
+
require('../common/propsValues/scroll.js');
|
|
22
|
+
require('../common/propsValues/markdownNodeType.js');
|
|
23
|
+
require('../common/fileType.js');
|
|
24
|
+
var colors = require('../common/colors.js');
|
|
25
|
+
require('@transferwise/icons');
|
|
26
|
+
require('react-intl');
|
|
27
|
+
require('../common/closeButton/CloseButton.messages.js');
|
|
28
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
8
29
|
|
|
9
30
|
const backwardsCompatibleSize = size => {
|
|
10
31
|
switch (size) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Avatar.js","sources":["../../src/avatar/Avatar.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useMemo } from 'react';\n\nimport { getBrandColorFromSeed, Theme } from '../common';\n\nimport Circle from '../common/circle';\n\ntype NumericAvatarSize = 24 | 40 | 48 | 56 | 72;\n\ntype LegacyAvatarSize = 'sm' | 'md' | 'lg';\n\nexport type AvatarSize = NumericAvatarSize | LegacyAvatarSize;\n\nexport type AvatarTheme = 'light' | 'dark';\n\nexport type AvatarType = 'thumbnail' | 'icon' | 'emoji' | 'initials';\n\nexport interface AvatarProps {\n backgroundColor?: string;\n backgroundColorSeed?: string;\n children?: React.ReactNode;\n className?: string;\n outlined?: boolean;\n size?: AvatarSize;\n theme?: AvatarTheme;\n type?: AvatarType;\n 'aria-label'?: string;\n}\n\nconst backwardsCompatibleSize = (size: AvatarSize): NumericAvatarSize => {\n switch (size) {\n case 'sm':\n return 24;\n\n case 'md':\n return 48;\n\n case 'lg':\n return 72;\n\n default:\n return size;\n }\n};\n\nconst Avatar: React.FC<AvatarProps> = ({\n backgroundColor = null,\n backgroundColorSeed = null,\n children = null,\n className,\n outlined = false,\n size: sizeFromProps = 48,\n theme = Theme.LIGHT,\n type = 'thumbnail',\n 'aria-label': ariaLabel,\n}) => {\n const backgroundColorFromSeed = useMemo<string | undefined>(\n () =>\n !backgroundColor && backgroundColorSeed\n ? getBrandColorFromSeed(backgroundColorSeed)\n : undefined,\n [backgroundColor, backgroundColorSeed],\n );\n\n const size = backwardsCompatibleSize(sizeFromProps);\n\n return (\n <div\n className={clsx('tw-avatar', className, `tw-avatar--${size}`, `tw-avatar--${type}`, {\n 'tw-avatar--outlined': outlined,\n 'tw-avatar--branded': Boolean(backgroundColorFromSeed),\n 'np-text-title-body': type === 'initials',\n })}\n aria-label={ariaLabel}\n >\n <div\n className=\"tw-avatar__content\"\n style={{\n backgroundColor: backgroundColor || backgroundColorFromSeed,\n }}\n >\n {children}\n </div>\n </div>\n );\n};\n\nexport default Avatar;\n"],"names":["backwardsCompatibleSize","size","Avatar","backgroundColor","backgroundColorSeed","children","className","outlined","sizeFromProps","theme","Theme","LIGHT","type","ariaLabel","backgroundColorFromSeed","useMemo","getBrandColorFromSeed","undefined","_jsx","clsx","Boolean","style"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Avatar.js","sources":["../../src/avatar/Avatar.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useMemo } from 'react';\n\nimport { getBrandColorFromSeed, Theme } from '../common';\n\nimport Circle from '../common/circle';\n\ntype NumericAvatarSize = 24 | 40 | 48 | 56 | 72;\n\ntype LegacyAvatarSize = 'sm' | 'md' | 'lg';\n\nexport type AvatarSize = NumericAvatarSize | LegacyAvatarSize;\n\nexport type AvatarTheme = 'light' | 'dark';\n\nexport type AvatarType = 'thumbnail' | 'icon' | 'emoji' | 'initials';\n\nexport interface AvatarProps {\n backgroundColor?: string;\n backgroundColorSeed?: string;\n children?: React.ReactNode;\n className?: string;\n outlined?: boolean;\n size?: AvatarSize;\n theme?: AvatarTheme;\n type?: AvatarType;\n 'aria-label'?: string;\n}\n\nconst backwardsCompatibleSize = (size: AvatarSize): NumericAvatarSize => {\n switch (size) {\n case 'sm':\n return 24;\n\n case 'md':\n return 48;\n\n case 'lg':\n return 72;\n\n default:\n return size;\n }\n};\n\nconst Avatar: React.FC<AvatarProps> = ({\n backgroundColor = null,\n backgroundColorSeed = null,\n children = null,\n className,\n outlined = false,\n size: sizeFromProps = 48,\n theme = Theme.LIGHT,\n type = 'thumbnail',\n 'aria-label': ariaLabel,\n}) => {\n const backgroundColorFromSeed = useMemo<string | undefined>(\n () =>\n !backgroundColor && backgroundColorSeed\n ? getBrandColorFromSeed(backgroundColorSeed)\n : undefined,\n [backgroundColor, backgroundColorSeed],\n );\n\n const size = backwardsCompatibleSize(sizeFromProps);\n\n return (\n <div\n className={clsx('tw-avatar', className, `tw-avatar--${size}`, `tw-avatar--${type}`, {\n 'tw-avatar--outlined': outlined,\n 'tw-avatar--branded': Boolean(backgroundColorFromSeed),\n 'np-text-title-body': type === 'initials',\n })}\n aria-label={ariaLabel}\n >\n <div\n className=\"tw-avatar__content\"\n style={{\n backgroundColor: backgroundColor || backgroundColorFromSeed,\n }}\n >\n {children}\n </div>\n </div>\n );\n};\n\nexport default Avatar;\n"],"names":["backwardsCompatibleSize","size","Avatar","backgroundColor","backgroundColorSeed","children","className","outlined","sizeFromProps","theme","Theme","LIGHT","type","ariaLabel","backgroundColorFromSeed","useMemo","getBrandColorFromSeed","undefined","_jsx","clsx","Boolean","style"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,MAAMA,uBAAuB,GAAIC,IAAgB,IAAuB;AACtE,EAAA,QAAQA,IAAI;AACV,IAAA,KAAK,IAAI;AACP,MAAA,OAAO,EAAE,CAAA;AAEX,IAAA,KAAK,IAAI;AACP,MAAA,OAAO,EAAE,CAAA;AAEX,IAAA,KAAK,IAAI;AACP,MAAA,OAAO,EAAE,CAAA;AAEX,IAAA;AACE,MAAA,OAAO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AEV;;;;"}
|
package/build/avatar/Avatar.mjs
CHANGED
|
@@ -1,8 +1,29 @@
|
|
|
1
1
|
import { clsx } from 'clsx';
|
|
2
2
|
import { useMemo } from 'react';
|
|
3
|
-
import { jsx } from 'react/jsx-runtime';
|
|
4
|
-
import { getBrandColorFromSeed } from '../common/colors.mjs';
|
|
5
3
|
import { Theme } from '../common/theme.mjs';
|
|
4
|
+
import '../common/direction.mjs';
|
|
5
|
+
import '../common/propsValues/control.mjs';
|
|
6
|
+
import '../common/propsValues/breakpoint.mjs';
|
|
7
|
+
import '../common/propsValues/size.mjs';
|
|
8
|
+
import '../common/propsValues/typography.mjs';
|
|
9
|
+
import '../common/propsValues/width.mjs';
|
|
10
|
+
import '../common/propsValues/type.mjs';
|
|
11
|
+
import '../common/propsValues/dateMode.mjs';
|
|
12
|
+
import '../common/propsValues/monthFormat.mjs';
|
|
13
|
+
import '../common/propsValues/position.mjs';
|
|
14
|
+
import '../common/propsValues/layouts.mjs';
|
|
15
|
+
import '../common/propsValues/status.mjs';
|
|
16
|
+
import '../common/propsValues/sentiment.mjs';
|
|
17
|
+
import '../common/propsValues/profileType.mjs';
|
|
18
|
+
import '../common/propsValues/variant.mjs';
|
|
19
|
+
import '../common/propsValues/scroll.mjs';
|
|
20
|
+
import '../common/propsValues/markdownNodeType.mjs';
|
|
21
|
+
import '../common/fileType.mjs';
|
|
22
|
+
import { getBrandColorFromSeed } from '../common/colors.mjs';
|
|
23
|
+
import '@transferwise/icons';
|
|
24
|
+
import 'react-intl';
|
|
25
|
+
import '../common/closeButton/CloseButton.messages.mjs';
|
|
26
|
+
import { jsx } from 'react/jsx-runtime';
|
|
6
27
|
|
|
7
28
|
const backwardsCompatibleSize = size => {
|
|
8
29
|
switch (size) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Avatar.mjs","sources":["../../src/avatar/Avatar.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useMemo } from 'react';\n\nimport { getBrandColorFromSeed, Theme } from '../common';\n\nimport Circle from '../common/circle';\n\ntype NumericAvatarSize = 24 | 40 | 48 | 56 | 72;\n\ntype LegacyAvatarSize = 'sm' | 'md' | 'lg';\n\nexport type AvatarSize = NumericAvatarSize | LegacyAvatarSize;\n\nexport type AvatarTheme = 'light' | 'dark';\n\nexport type AvatarType = 'thumbnail' | 'icon' | 'emoji' | 'initials';\n\nexport interface AvatarProps {\n backgroundColor?: string;\n backgroundColorSeed?: string;\n children?: React.ReactNode;\n className?: string;\n outlined?: boolean;\n size?: AvatarSize;\n theme?: AvatarTheme;\n type?: AvatarType;\n 'aria-label'?: string;\n}\n\nconst backwardsCompatibleSize = (size: AvatarSize): NumericAvatarSize => {\n switch (size) {\n case 'sm':\n return 24;\n\n case 'md':\n return 48;\n\n case 'lg':\n return 72;\n\n default:\n return size;\n }\n};\n\nconst Avatar: React.FC<AvatarProps> = ({\n backgroundColor = null,\n backgroundColorSeed = null,\n children = null,\n className,\n outlined = false,\n size: sizeFromProps = 48,\n theme = Theme.LIGHT,\n type = 'thumbnail',\n 'aria-label': ariaLabel,\n}) => {\n const backgroundColorFromSeed = useMemo<string | undefined>(\n () =>\n !backgroundColor && backgroundColorSeed\n ? getBrandColorFromSeed(backgroundColorSeed)\n : undefined,\n [backgroundColor, backgroundColorSeed],\n );\n\n const size = backwardsCompatibleSize(sizeFromProps);\n\n return (\n <div\n className={clsx('tw-avatar', className, `tw-avatar--${size}`, `tw-avatar--${type}`, {\n 'tw-avatar--outlined': outlined,\n 'tw-avatar--branded': Boolean(backgroundColorFromSeed),\n 'np-text-title-body': type === 'initials',\n })}\n aria-label={ariaLabel}\n >\n <div\n className=\"tw-avatar__content\"\n style={{\n backgroundColor: backgroundColor || backgroundColorFromSeed,\n }}\n >\n {children}\n </div>\n </div>\n );\n};\n\nexport default Avatar;\n"],"names":["backwardsCompatibleSize","size","Avatar","backgroundColor","backgroundColorSeed","children","className","outlined","sizeFromProps","theme","Theme","LIGHT","type","ariaLabel","backgroundColorFromSeed","useMemo","getBrandColorFromSeed","undefined","_jsx","clsx","Boolean","style"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Avatar.mjs","sources":["../../src/avatar/Avatar.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useMemo } from 'react';\n\nimport { getBrandColorFromSeed, Theme } from '../common';\n\nimport Circle from '../common/circle';\n\ntype NumericAvatarSize = 24 | 40 | 48 | 56 | 72;\n\ntype LegacyAvatarSize = 'sm' | 'md' | 'lg';\n\nexport type AvatarSize = NumericAvatarSize | LegacyAvatarSize;\n\nexport type AvatarTheme = 'light' | 'dark';\n\nexport type AvatarType = 'thumbnail' | 'icon' | 'emoji' | 'initials';\n\nexport interface AvatarProps {\n backgroundColor?: string;\n backgroundColorSeed?: string;\n children?: React.ReactNode;\n className?: string;\n outlined?: boolean;\n size?: AvatarSize;\n theme?: AvatarTheme;\n type?: AvatarType;\n 'aria-label'?: string;\n}\n\nconst backwardsCompatibleSize = (size: AvatarSize): NumericAvatarSize => {\n switch (size) {\n case 'sm':\n return 24;\n\n case 'md':\n return 48;\n\n case 'lg':\n return 72;\n\n default:\n return size;\n }\n};\n\nconst Avatar: React.FC<AvatarProps> = ({\n backgroundColor = null,\n backgroundColorSeed = null,\n children = null,\n className,\n outlined = false,\n size: sizeFromProps = 48,\n theme = Theme.LIGHT,\n type = 'thumbnail',\n 'aria-label': ariaLabel,\n}) => {\n const backgroundColorFromSeed = useMemo<string | undefined>(\n () =>\n !backgroundColor && backgroundColorSeed\n ? getBrandColorFromSeed(backgroundColorSeed)\n : undefined,\n [backgroundColor, backgroundColorSeed],\n );\n\n const size = backwardsCompatibleSize(sizeFromProps);\n\n return (\n <div\n className={clsx('tw-avatar', className, `tw-avatar--${size}`, `tw-avatar--${type}`, {\n 'tw-avatar--outlined': outlined,\n 'tw-avatar--branded': Boolean(backgroundColorFromSeed),\n 'np-text-title-body': type === 'initials',\n })}\n aria-label={ariaLabel}\n >\n <div\n className=\"tw-avatar__content\"\n style={{\n backgroundColor: backgroundColor || backgroundColorFromSeed,\n }}\n >\n {children}\n </div>\n </div>\n );\n};\n\nexport default Avatar;\n"],"names":["backwardsCompatibleSize","size","Avatar","backgroundColor","backgroundColorSeed","children","className","outlined","sizeFromProps","theme","Theme","LIGHT","type","ariaLabel","backgroundColorFromSeed","useMemo","getBrandColorFromSeed","undefined","_jsx","clsx","Boolean","style"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,MAAMA,uBAAuB,GAAIC,IAAgB,IAAuB;AACtE,EAAA,QAAQA,IAAI;AACV,IAAA,KAAK,IAAI;AACP,MAAA,OAAO,EAAE,CAAA;AAEX,IAAA,KAAK,IAAI;AACP,MAAA,OAAO,EAAE,CAAA;AAEX,IAAA,KAAK,IAAI;AACP,MAAA,OAAO,EAAE,CAAA;AAEX,IAAA;AACE,MAAA,OAAOA,IAAI,CAAA;AACf,GAAA;AACF,CAAC,CAAA;AAEKC,MAAAA,MAAM,GAA0BA,CAAC;AACrCC,EAAAA,eAAe,GAAG,IAAI;AACtBC,EAAAA,mBAAmB,GAAG,IAAI;AAC1BC,EAAAA,QAAQ,GAAG,IAAI;EACfC,SAAS;AACTC,EAAAA,QAAQ,GAAG,KAAK;EAChBN,IAAI,EAAEO,aAAa,GAAG,EAAE;EACxBC,KAAK,GAAGC,KAAK,CAACC,KAAK;AACnBC,EAAAA,IAAI,GAAG,WAAW;AAClB,EAAA,YAAY,EAAEC,SAAAA;AAAS,CACxB,KAAI;EACH,MAAMC,uBAAuB,GAAGC,OAAO,CACrC,MACE,CAACZ,eAAe,IAAIC,mBAAmB,GACnCY,qBAAqB,CAACZ,mBAAmB,CAAC,GAC1Ca,SAAS,EACf,CAACd,eAAe,EAAEC,mBAAmB,CAAC,CACvC,CAAA;AAED,EAAA,MAAMH,IAAI,GAAGD,uBAAuB,CAACQ,aAAa,CAAC,CAAA;AAEnD,EAAA,oBACEU,GAAA,CAAA,KAAA,EAAA;AACEZ,IAAAA,SAAS,EAAEa,IAAI,CAAC,WAAW,EAAEb,SAAS,EAAE,CAAcL,WAAAA,EAAAA,IAAI,CAAE,CAAA,EAAE,CAAcW,WAAAA,EAAAA,IAAI,EAAE,EAAE;AAClF,MAAA,qBAAqB,EAAEL,QAAQ;AAC/B,MAAA,oBAAoB,EAAEa,OAAO,CAACN,uBAAuB,CAAC;MACtD,oBAAoB,EAAEF,IAAI,KAAK,UAAA;AAChC,KAAA,CAAE;AACH,IAAA,YAAA,EAAYC,SAAU;AAAAR,IAAAA,QAAA,eAEtBa,GAAA,CAAA,KAAA,EAAA;AACEZ,MAAAA,SAAS,EAAC,oBAAoB;AAC9Be,MAAAA,KAAK,EAAE;QACLlB,eAAe,EAAEA,eAAe,IAAIW,uBAAAA;OACpC;AAAAT,MAAAA,QAAA,EAEDA,QAAAA;KACE,CAAA;AACP,GAAK,CAAC,CAAA;AAEV;;;;"}
|
|
@@ -5,11 +5,31 @@ var React = require('react');
|
|
|
5
5
|
var avatarTypes = require('../avatar/avatarTypes.js');
|
|
6
6
|
var Avatar = require('../avatar/Avatar.js');
|
|
7
7
|
var Badge = require('../badge/Badge.js');
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
require('../common/theme.js');
|
|
9
|
+
require('../common/direction.js');
|
|
10
|
+
require('../common/propsValues/control.js');
|
|
11
|
+
require('../common/propsValues/breakpoint.js');
|
|
12
|
+
var size = require('../common/propsValues/size.js');
|
|
13
|
+
require('../common/propsValues/typography.js');
|
|
14
|
+
require('../common/propsValues/width.js');
|
|
15
|
+
require('../common/propsValues/type.js');
|
|
16
|
+
require('../common/propsValues/dateMode.js');
|
|
17
|
+
require('../common/propsValues/monthFormat.js');
|
|
18
|
+
require('../common/propsValues/position.js');
|
|
19
|
+
require('../common/propsValues/layouts.js');
|
|
20
|
+
require('../common/propsValues/status.js');
|
|
21
|
+
require('../common/propsValues/sentiment.js');
|
|
10
22
|
var profileType = require('../common/propsValues/profileType.js');
|
|
23
|
+
require('../common/propsValues/variant.js');
|
|
24
|
+
require('../common/propsValues/scroll.js');
|
|
25
|
+
require('../common/propsValues/markdownNodeType.js');
|
|
26
|
+
require('../common/fileType.js');
|
|
11
27
|
var initials = require('../common/initials.js');
|
|
12
|
-
|
|
28
|
+
require('clsx');
|
|
29
|
+
require('react-intl');
|
|
30
|
+
require('../common/closeButton/CloseButton.messages.js');
|
|
31
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
32
|
+
var StatusIcon = require('../statusIcon/StatusIcon.js');
|
|
13
33
|
|
|
14
34
|
const OptionalBadge = ({
|
|
15
35
|
url,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AvatarWrapper.js","sources":["../../src/avatarWrapper/AvatarWrapper.tsx"],"sourcesContent":["import { Person as ProfileIcon, Briefcase as BriefcaseIcon } from '@transferwise/icons';\nimport { useState, useEffect } from 'react';\n\nimport Avatar, { AvatarProps, AvatarType } from '../avatar';\nimport Badge, { BadgeProps } from '../badge';\nimport {\n ProfileType,\n ProfileTypePersonal,\n ProfileTypeBusiness,\n Size,\n Sentiment,\n getInitials,\n} from '../common';\nimport StatusIcon from '../statusIcon/StatusIcon';\n\ninterface OptionalBadgeProps extends Omit<BadgeProps, 'badge'> {\n url?: string;\n ariaLabel?: string;\n altText?: string;\n statusIcon?: Sentiment;\n}\n\nconst OptionalBadge = ({\n url,\n altText,\n statusIcon,\n children,\n ariaLabel,\n ...rest\n}: OptionalBadgeProps) => {\n if (url) {\n return (\n <Badge aria-label={ariaLabel} badge={<img src={url} alt={altText} />} {...rest}>\n {children}\n </Badge>\n );\n }\n if (statusIcon) {\n return (\n <Badge\n aria-label={ariaLabel}\n badge={<StatusIcon sentiment={statusIcon} size={Size.SMALL} />}\n {...rest}\n >\n {children}\n </Badge>\n );\n }\n return <>{children}</>;\n};\n\nexport type AvatarWrapperProps = {\n url?: string;\n 'aria-label'?: string;\n profileType?: ProfileTypeBusiness | ProfileTypePersonal;\n profileId?: string;\n name?: string;\n avatarProps?: AvatarProps;\n badgeProps?: BadgeProps;\n} & (\n | {\n badgeUrl: string;\n badgeAltText: string;\n badgeStatusIcon?: never;\n }\n | {\n badgeUrl?: never;\n badgeAltText?: never;\n badgeStatusIcon: Sentiment;\n }\n | {\n badgeUrl?: never;\n badgeAltText?: never;\n badgeStatusIcon?: never;\n }\n);\n\nconst AvatarWrapper = ({\n url,\n 'aria-label': ariaLabel,\n profileType,\n profileId,\n badgeUrl,\n badgeAltText,\n badgeStatusIcon,\n name,\n avatarProps,\n badgeProps,\n}: AvatarWrapperProps) => {\n const [hasImageLoadError, setImageLoadError] = useState(false);\n const isBusinessProfile = profileType === ProfileType.BUSINESS;\n\n // Reset the errored state when url changes\n useEffect(() => setImageLoadError(false), [url]);\n\n const getAvatarProps = () => {\n let updatedAvatarProps = avatarProps;\n if (!badgeUrl && !badgeStatusIcon && ariaLabel) {\n updatedAvatarProps = { ...updatedAvatarProps, 'aria-label': ariaLabel };\n }\n if (url && !hasImageLoadError) {\n return {\n type: AvatarType.THUMBNAIL,\n children: <img src={url} alt=\"\" onError={() => setImageLoadError(true)} />,\n ...updatedAvatarProps,\n };\n }\n if (profileType) {\n return {\n type: AvatarType.ICON,\n children: isBusinessProfile ? <BriefcaseIcon size=\"24\" /> : <ProfileIcon size=\"24\" />,\n ...updatedAvatarProps,\n };\n }\n if (name) {\n return {\n type: AvatarType.INITIALS,\n children: <>{getInitials(name)}</>,\n backgroundColorSeed: profileId?.toString(),\n ...updatedAvatarProps,\n };\n }\n return {\n type: AvatarType.ICON,\n children: <ProfileIcon size=\"24\" />,\n ...updatedAvatarProps,\n };\n };\n\n return (\n <OptionalBadge\n url={badgeUrl}\n ariaLabel={ariaLabel}\n altText={badgeAltText}\n statusIcon={badgeStatusIcon}\n {...badgeProps}\n >\n <Avatar size={Size.MEDIUM} {...getAvatarProps()} />\n </OptionalBadge>\n );\n};\n\nexport default AvatarWrapper;\n"],"names":["OptionalBadge","url","altText","statusIcon","children","ariaLabel","rest","_jsx","Badge","badge","src","alt","StatusIcon","sentiment","size","Size","SMALL","_Fragment","AvatarWrapper","profileType","profileId","badgeUrl","badgeAltText","badgeStatusIcon","name","avatarProps","badgeProps","hasImageLoadError","setImageLoadError","useState","isBusinessProfile","ProfileType","BUSINESS","useEffect","getAvatarProps","updatedAvatarProps","type","AvatarType","THUMBNAIL","onError","ICON","BriefcaseIcon","ProfileIcon","INITIALS","getInitials","backgroundColorSeed","toString","Avatar","MEDIUM"],"mappings":"
|
|
1
|
+
{"version":3,"file":"AvatarWrapper.js","sources":["../../src/avatarWrapper/AvatarWrapper.tsx"],"sourcesContent":["import { Person as ProfileIcon, Briefcase as BriefcaseIcon } from '@transferwise/icons';\nimport { useState, useEffect } from 'react';\n\nimport Avatar, { AvatarProps, AvatarType } from '../avatar';\nimport Badge, { BadgeProps } from '../badge';\nimport {\n ProfileType,\n ProfileTypePersonal,\n ProfileTypeBusiness,\n Size,\n Sentiment,\n getInitials,\n} from '../common';\nimport StatusIcon from '../statusIcon/StatusIcon';\n\ninterface OptionalBadgeProps extends Omit<BadgeProps, 'badge'> {\n url?: string;\n ariaLabel?: string;\n altText?: string;\n statusIcon?: Sentiment;\n}\n\nconst OptionalBadge = ({\n url,\n altText,\n statusIcon,\n children,\n ariaLabel,\n ...rest\n}: OptionalBadgeProps) => {\n if (url) {\n return (\n <Badge aria-label={ariaLabel} badge={<img src={url} alt={altText} />} {...rest}>\n {children}\n </Badge>\n );\n }\n if (statusIcon) {\n return (\n <Badge\n aria-label={ariaLabel}\n badge={<StatusIcon sentiment={statusIcon} size={Size.SMALL} />}\n {...rest}\n >\n {children}\n </Badge>\n );\n }\n return <>{children}</>;\n};\n\nexport type AvatarWrapperProps = {\n url?: string;\n 'aria-label'?: string;\n profileType?: ProfileTypeBusiness | ProfileTypePersonal;\n profileId?: string;\n name?: string;\n avatarProps?: AvatarProps;\n badgeProps?: BadgeProps;\n} & (\n | {\n badgeUrl: string;\n badgeAltText: string;\n badgeStatusIcon?: never;\n }\n | {\n badgeUrl?: never;\n badgeAltText?: never;\n badgeStatusIcon: Sentiment;\n }\n | {\n badgeUrl?: never;\n badgeAltText?: never;\n badgeStatusIcon?: never;\n }\n);\n\nconst AvatarWrapper = ({\n url,\n 'aria-label': ariaLabel,\n profileType,\n profileId,\n badgeUrl,\n badgeAltText,\n badgeStatusIcon,\n name,\n avatarProps,\n badgeProps,\n}: AvatarWrapperProps) => {\n const [hasImageLoadError, setImageLoadError] = useState(false);\n const isBusinessProfile = profileType === ProfileType.BUSINESS;\n\n // Reset the errored state when url changes\n useEffect(() => setImageLoadError(false), [url]);\n\n const getAvatarProps = () => {\n let updatedAvatarProps = avatarProps;\n if (!badgeUrl && !badgeStatusIcon && ariaLabel) {\n updatedAvatarProps = { ...updatedAvatarProps, 'aria-label': ariaLabel };\n }\n if (url && !hasImageLoadError) {\n return {\n type: AvatarType.THUMBNAIL,\n children: <img src={url} alt=\"\" onError={() => setImageLoadError(true)} />,\n ...updatedAvatarProps,\n };\n }\n if (profileType) {\n return {\n type: AvatarType.ICON,\n children: isBusinessProfile ? <BriefcaseIcon size=\"24\" /> : <ProfileIcon size=\"24\" />,\n ...updatedAvatarProps,\n };\n }\n if (name) {\n return {\n type: AvatarType.INITIALS,\n children: <>{getInitials(name)}</>,\n backgroundColorSeed: profileId?.toString(),\n ...updatedAvatarProps,\n };\n }\n return {\n type: AvatarType.ICON,\n children: <ProfileIcon size=\"24\" />,\n ...updatedAvatarProps,\n };\n };\n\n return (\n <OptionalBadge\n url={badgeUrl}\n ariaLabel={ariaLabel}\n altText={badgeAltText}\n statusIcon={badgeStatusIcon}\n {...badgeProps}\n >\n <Avatar size={Size.MEDIUM} {...getAvatarProps()} />\n </OptionalBadge>\n );\n};\n\nexport default AvatarWrapper;\n"],"names":["OptionalBadge","url","altText","statusIcon","children","ariaLabel","rest","_jsx","Badge","badge","src","alt","StatusIcon","sentiment","size","Size","SMALL","_Fragment","AvatarWrapper","profileType","profileId","badgeUrl","badgeAltText","badgeStatusIcon","name","avatarProps","badgeProps","hasImageLoadError","setImageLoadError","useState","isBusinessProfile","ProfileType","BUSINESS","useEffect","getAvatarProps","updatedAvatarProps","type","AvatarType","THUMBNAIL","onError","ICON","BriefcaseIcon","ProfileIcon","INITIALS","getInitials","backgroundColorSeed","toString","Avatar","MEDIUM"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsBA,MAAMA,aAAa,GAAGA,CAAC;EACrBC,GAAG;EACHC,OAAO;EACPC,UAAU;EACVC,QAAQ;EACRC,SAAS;EACT,GAAGC,IAAAA;AAAI,CACY,KAAI;AACvB,EAAA,IAAIL,GAAG,EAAE;IACP,oBACEM,cAAA,CAACC,KAAK,EAAA;AAAC,MAAA,YAAA,EAAYH,SAAU;AAACI,MAAAA,KAAK,eAAEF,cAAA,CAAA,KAAA,EAAA;AAAKG,QAAAA,GAAG,EAAET,GAAI;AAACU,QAAAA,GAAG,EAAET,OAAAA;AAAQ,QAAI;AAAA,MAAA,GAAKI,IAAI;AAAAF,MAAAA,QAAA,EAC3EA,QAAAA;AAAQ,KACJ,CAAC,CAAA;AAEZ,GAAA;AACA,EAAA,IAAID,UAAU,EAAE;IACd,oBACEI,cAAA,CAACC,KAAK,EAAA;AACJ,MAAA,YAAA,EAAYH,SAAU;MACtBI,KAAK,eAAEF,cAAA,CAACK,UAAU,EAAA;AAACC,QAAAA,SAAS,EAAEV,UAAW;QAACW,IAAI,EAAEC,SAAI,CAACC,KAAAA;AAAM,QAAI;AAAA,MAAA,GAC3DV,IAAI;AAAAF,MAAAA,QAAA,EAEPA,QAAAA;AAAQ,KACJ,CAAC,CAAA;AAEZ,GAAA;EACA,oBAAOG,cAAA,CAAAU,mBAAA,EAAA;AAAAb,IAAAA,QAAA,EAAGA,QAAAA;AAAQ,IAAI,CAAA;AACxB,CAAC,CAAA;AA4BKc,MAAAA,aAAa,GAAGA,CAAC;EACrBjB,GAAG;AACH,EAAA,YAAY,EAAEI,SAAS;eACvBc,aAAW;EACXC,SAAS;EACTC,QAAQ;E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AA;AAAI,SAAG,CAAA;QACrF,GAAGqB,kBAAAA;OACJ,CAAA;AACH,KAAA;AACA,IAAA,IAAIX,IAAI,EAAE;MACR,OAAO;QACLY,IAAI,EAAEC,sBAAU,CAACM,QAAQ;QACzBvC,QAAQ,eAAEG,cAAA,CAAAU,mBAAA,EAAA;UAAAb,QAAA,EAAGwC,oBAAW,CAACpB,IAAI,CAAA;AAAC,SAAI,CAAA;AAClCqB,QAAAA,mBAAmB,EAAEzB,SAAS,EAAE0B,QAAQ,EAAE;QAC1C,GAAGX,kBAAAA;OACJ,CAAA;AACH,KAAA;IACA,OAAO;MACLC,IAAI,EAAEC,sBAAU,CAACG,IAAI;MACrBpC,QAAQ,eAAEG,cAAA,CAACmC,YAAW,EAAA;AAAC5B,QAAAA,IAAI,EAAC,IAAA;AAAI,OAAG,CAAA;MACnC,GAAGqB,kBAAAA;KACJ,CAAA;GACF,CAAA;EAED,oBACE5B,cAAA,CAACP,aAAa,EAAA;AACZC,IAAAA,GAAG,EAAEoB,QAAS;AACdhB,IAAAA,SAAS,EAAEA,SAAU;AACrBH,IAAAA,OAAO,EAAEoB,YAAa;AACtBnB,IAAAA,UAAU,EAAEoB,eAAgB;AAAA,IAAA,GACxBG,UAAU;IAAAtB,QAAA,eAEdG,cAAA,CAACwC,MAAM,EAAA;MAACjC,IAAI,EAAEC,SAAI,CAACiC,MAAO;AAAA,MAAA,GAAKd,cAAc,EAAA;KAC/C,CAAA;AAAA,GAAe,CAAC,CAAA;AAEpB;;;;"}
|
|
@@ -3,11 +3,31 @@ import { useState, useEffect } from 'react';
|
|
|
3
3
|
import { AvatarType } from '../avatar/avatarTypes.mjs';
|
|
4
4
|
import Avatar from '../avatar/Avatar.mjs';
|
|
5
5
|
import Badge from '../badge/Badge.mjs';
|
|
6
|
-
import
|
|
7
|
-
import
|
|
6
|
+
import '../common/theme.mjs';
|
|
7
|
+
import '../common/direction.mjs';
|
|
8
|
+
import '../common/propsValues/control.mjs';
|
|
9
|
+
import '../common/propsValues/breakpoint.mjs';
|
|
10
|
+
import { Size } from '../common/propsValues/size.mjs';
|
|
11
|
+
import '../common/propsValues/typography.mjs';
|
|
12
|
+
import '../common/propsValues/width.mjs';
|
|
13
|
+
import '../common/propsValues/type.mjs';
|
|
14
|
+
import '../common/propsValues/dateMode.mjs';
|
|
15
|
+
import '../common/propsValues/monthFormat.mjs';
|
|
16
|
+
import '../common/propsValues/position.mjs';
|
|
17
|
+
import '../common/propsValues/layouts.mjs';
|
|
18
|
+
import '../common/propsValues/status.mjs';
|
|
19
|
+
import '../common/propsValues/sentiment.mjs';
|
|
8
20
|
import { ProfileType } from '../common/propsValues/profileType.mjs';
|
|
21
|
+
import '../common/propsValues/variant.mjs';
|
|
22
|
+
import '../common/propsValues/scroll.mjs';
|
|
23
|
+
import '../common/propsValues/markdownNodeType.mjs';
|
|
24
|
+
import '../common/fileType.mjs';
|
|
9
25
|
import { getInitials } from '../common/initials.mjs';
|
|
10
|
-
import
|
|
26
|
+
import 'clsx';
|
|
27
|
+
import 'react-intl';
|
|
28
|
+
import '../common/closeButton/CloseButton.messages.mjs';
|
|
29
|
+
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
30
|
+
import StatusIcon from '../statusIcon/StatusIcon.mjs';
|
|
11
31
|
|
|
12
32
|
const OptionalBadge = ({
|
|
13
33
|
url,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AvatarWrapper.mjs","sources":["../../src/avatarWrapper/AvatarWrapper.tsx"],"sourcesContent":["import { Person as ProfileIcon, Briefcase as BriefcaseIcon } from '@transferwise/icons';\nimport { useState, useEffect } from 'react';\n\nimport Avatar, { AvatarProps, AvatarType } from '../avatar';\nimport Badge, { BadgeProps } from '../badge';\nimport {\n ProfileType,\n ProfileTypePersonal,\n ProfileTypeBusiness,\n Size,\n Sentiment,\n getInitials,\n} from '../common';\nimport StatusIcon from '../statusIcon/StatusIcon';\n\ninterface OptionalBadgeProps extends Omit<BadgeProps, 'badge'> {\n url?: string;\n ariaLabel?: string;\n altText?: string;\n statusIcon?: Sentiment;\n}\n\nconst OptionalBadge = ({\n url,\n altText,\n statusIcon,\n children,\n ariaLabel,\n ...rest\n}: OptionalBadgeProps) => {\n if (url) {\n return (\n <Badge aria-label={ariaLabel} badge={<img src={url} alt={altText} />} {...rest}>\n {children}\n </Badge>\n );\n }\n if (statusIcon) {\n return (\n <Badge\n aria-label={ariaLabel}\n badge={<StatusIcon sentiment={statusIcon} size={Size.SMALL} />}\n {...rest}\n >\n {children}\n </Badge>\n );\n }\n return <>{children}</>;\n};\n\nexport type AvatarWrapperProps = {\n url?: string;\n 'aria-label'?: string;\n profileType?: ProfileTypeBusiness | ProfileTypePersonal;\n profileId?: string;\n name?: string;\n avatarProps?: AvatarProps;\n badgeProps?: BadgeProps;\n} & (\n | {\n badgeUrl: string;\n badgeAltText: string;\n badgeStatusIcon?: never;\n }\n | {\n badgeUrl?: never;\n badgeAltText?: never;\n badgeStatusIcon: Sentiment;\n }\n | {\n badgeUrl?: never;\n badgeAltText?: never;\n badgeStatusIcon?: never;\n }\n);\n\nconst AvatarWrapper = ({\n url,\n 'aria-label': ariaLabel,\n profileType,\n profileId,\n badgeUrl,\n badgeAltText,\n badgeStatusIcon,\n name,\n avatarProps,\n badgeProps,\n}: AvatarWrapperProps) => {\n const [hasImageLoadError, setImageLoadError] = useState(false);\n const isBusinessProfile = profileType === ProfileType.BUSINESS;\n\n // Reset the errored state when url changes\n useEffect(() => setImageLoadError(false), [url]);\n\n const getAvatarProps = () => {\n let updatedAvatarProps = avatarProps;\n if (!badgeUrl && !badgeStatusIcon && ariaLabel) {\n updatedAvatarProps = { ...updatedAvatarProps, 'aria-label': ariaLabel };\n }\n if (url && !hasImageLoadError) {\n return {\n type: AvatarType.THUMBNAIL,\n children: <img src={url} alt=\"\" onError={() => setImageLoadError(true)} />,\n ...updatedAvatarProps,\n };\n }\n if (profileType) {\n return {\n type: AvatarType.ICON,\n children: isBusinessProfile ? <BriefcaseIcon size=\"24\" /> : <ProfileIcon size=\"24\" />,\n ...updatedAvatarProps,\n };\n }\n if (name) {\n return {\n type: AvatarType.INITIALS,\n children: <>{getInitials(name)}</>,\n backgroundColorSeed: profileId?.toString(),\n ...updatedAvatarProps,\n };\n }\n return {\n type: AvatarType.ICON,\n children: <ProfileIcon size=\"24\" />,\n ...updatedAvatarProps,\n };\n };\n\n return (\n <OptionalBadge\n url={badgeUrl}\n ariaLabel={ariaLabel}\n altText={badgeAltText}\n statusIcon={badgeStatusIcon}\n {...badgeProps}\n >\n <Avatar size={Size.MEDIUM} {...getAvatarProps()} />\n </OptionalBadge>\n );\n};\n\nexport default AvatarWrapper;\n"],"names":["OptionalBadge","url","altText","statusIcon","children","ariaLabel","rest","_jsx","Badge","badge","src","alt","StatusIcon","sentiment","size","Size","SMALL","_Fragment","AvatarWrapper","profileType","profileId","badgeUrl","badgeAltText","badgeStatusIcon","name","avatarProps","badgeProps","hasImageLoadError","setImageLoadError","useState","isBusinessProfile","ProfileType","BUSINESS","useEffect","getAvatarProps","updatedAvatarProps","type","AvatarType","THUMBNAIL","onError","ICON","BriefcaseIcon","ProfileIcon","INITIALS","getInitials","backgroundColorSeed","toString","Avatar","MEDIUM"],"mappings":"
|
|
1
|
+
{"version":3,"file":"AvatarWrapper.mjs","sources":["../../src/avatarWrapper/AvatarWrapper.tsx"],"sourcesContent":["import { Person as ProfileIcon, Briefcase as BriefcaseIcon } from '@transferwise/icons';\nimport { useState, useEffect } from 'react';\n\nimport Avatar, { AvatarProps, AvatarType } from '../avatar';\nimport Badge, { BadgeProps } from '../badge';\nimport {\n ProfileType,\n ProfileTypePersonal,\n ProfileTypeBusiness,\n Size,\n Sentiment,\n getInitials,\n} from '../common';\nimport StatusIcon from '../statusIcon/StatusIcon';\n\ninterface OptionalBadgeProps extends Omit<BadgeProps, 'badge'> {\n url?: string;\n ariaLabel?: string;\n altText?: string;\n statusIcon?: Sentiment;\n}\n\nconst OptionalBadge = ({\n url,\n altText,\n statusIcon,\n children,\n ariaLabel,\n ...rest\n}: OptionalBadgeProps) => {\n if (url) {\n return (\n <Badge aria-label={ariaLabel} badge={<img src={url} alt={altText} />} {...rest}>\n {children}\n </Badge>\n );\n }\n if (statusIcon) {\n return (\n <Badge\n aria-label={ariaLabel}\n badge={<StatusIcon sentiment={statusIcon} size={Size.SMALL} />}\n {...rest}\n >\n {children}\n </Badge>\n );\n }\n return <>{children}</>;\n};\n\nexport type AvatarWrapperProps = {\n url?: string;\n 'aria-label'?: string;\n profileType?: ProfileTypeBusiness | ProfileTypePersonal;\n profileId?: string;\n name?: string;\n avatarProps?: AvatarProps;\n badgeProps?: BadgeProps;\n} & (\n | {\n badgeUrl: string;\n badgeAltText: string;\n badgeStatusIcon?: never;\n }\n | {\n badgeUrl?: never;\n badgeAltText?: never;\n badgeStatusIcon: Sentiment;\n }\n | {\n badgeUrl?: never;\n badgeAltText?: never;\n badgeStatusIcon?: never;\n }\n);\n\nconst AvatarWrapper = ({\n url,\n 'aria-label': ariaLabel,\n profileType,\n profileId,\n badgeUrl,\n badgeAltText,\n badgeStatusIcon,\n name,\n avatarProps,\n badgeProps,\n}: AvatarWrapperProps) => {\n const [hasImageLoadError, setImageLoadError] = useState(false);\n const isBusinessProfile = profileType === ProfileType.BUSINESS;\n\n // Reset the errored state when url changes\n useEffect(() => setImageLoadError(false), [url]);\n\n const getAvatarProps = () => {\n let updatedAvatarProps = avatarProps;\n if (!badgeUrl && !badgeStatusIcon && ariaLabel) {\n updatedAvatarProps = { ...updatedAvatarProps, 'aria-label': ariaLabel };\n }\n if (url && !hasImageLoadError) {\n return {\n type: AvatarType.THUMBNAIL,\n children: <img src={url} alt=\"\" onError={() => setImageLoadError(true)} />,\n ...updatedAvatarProps,\n };\n }\n if (profileType) {\n return {\n type: AvatarType.ICON,\n children: isBusinessProfile ? <BriefcaseIcon size=\"24\" /> : <ProfileIcon size=\"24\" />,\n ...updatedAvatarProps,\n };\n }\n if (name) {\n return {\n type: AvatarType.INITIALS,\n children: <>{getInitials(name)}</>,\n backgroundColorSeed: profileId?.toString(),\n ...updatedAvatarProps,\n };\n }\n return {\n type: AvatarType.ICON,\n children: <ProfileIcon size=\"24\" />,\n ...updatedAvatarProps,\n };\n };\n\n return (\n <OptionalBadge\n url={badgeUrl}\n ariaLabel={ariaLabel}\n altText={badgeAltText}\n statusIcon={badgeStatusIcon}\n {...badgeProps}\n >\n <Avatar size={Size.MEDIUM} {...getAvatarProps()} />\n </OptionalBadge>\n );\n};\n\nexport default AvatarWrapper;\n"],"names":["OptionalBadge","url","altText","statusIcon","children","ariaLabel","rest","_jsx","Badge","badge","src","alt","StatusIcon","sentiment","size","Size","SMALL","_Fragment","AvatarWrapper","profileType","profileId","badgeUrl","badgeAltText","badgeStatusIcon","name","avatarProps","badgeProps","hasImageLoadError","setImageLoadError","useState","isBusinessProfile","ProfileType","BUSINESS","useEffect","getAvatarProps","updatedAvatarProps","type","AvatarType","THUMBNAIL","onError","ICON","BriefcaseIcon","ProfileIcon","INITIALS","getInitials","backgroundColorSeed","toString","Avatar","MEDIUM"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsBA,MAAMA,aAAa,GAAGA,CAAC;EACrBC,GAAG;EACHC,OAAO;EACPC,UAAU;EACVC,QAAQ;EACRC,SAAS;EACT,GAAGC,IAAAA;AAAI,CACY,KAAI;AACvB,EAAA,IAAIL,GAAG,EAAE;IACP,oBACEM,GAAA,CAACC,KAAK,EAAA;AAAC,MAAA,YAAA,EAAYH,SAAU;AAACI,MAAAA,KAAK,eAAEF,GAAA,CAAA,KAAA,EAAA;AAAKG,QAAAA,GAAG,EAAET,GAAI;AAACU,QAAAA,GAAG,EAAET,OAAAA;AAAQ,QAAI;AAAA,MAAA,GAAKI,IAAI;AAAAF,MAAAA,QAAA,EAC3EA,QAAAA;AAAQ,KACJ,CAAC,CAAA;AAEZ,GAAA;AACA,EAAA,IAAID,UAAU,EAAE;IACd,oBACEI,GAAA,CAACC,KAAK,EAAA;AACJ,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G,UAAU;IAAAtB,QAAA,eAEdG,GAAA,CAACwC,MAAM,EAAA;MAACjC,IAAI,EAAEC,IAAI,CAACiC,MAAO;AAAA,MAAA,GAAKd,cAAc,EAAA;KAC/C,CAAA;AAAA,GAAe,CAAC,CAAA;AAEpB;;;;"}
|
package/build/badge/Badge.js
CHANGED
|
@@ -1,9 +1,30 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var clsx = require('clsx');
|
|
4
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
-
var size = require('../common/propsValues/size.js');
|
|
6
4
|
var theme = require('../common/theme.js');
|
|
5
|
+
require('../common/direction.js');
|
|
6
|
+
require('../common/propsValues/control.js');
|
|
7
|
+
require('../common/propsValues/breakpoint.js');
|
|
8
|
+
var size = require('../common/propsValues/size.js');
|
|
9
|
+
require('../common/propsValues/typography.js');
|
|
10
|
+
require('../common/propsValues/width.js');
|
|
11
|
+
require('../common/propsValues/type.js');
|
|
12
|
+
require('../common/propsValues/dateMode.js');
|
|
13
|
+
require('../common/propsValues/monthFormat.js');
|
|
14
|
+
require('../common/propsValues/position.js');
|
|
15
|
+
require('../common/propsValues/layouts.js');
|
|
16
|
+
require('../common/propsValues/status.js');
|
|
17
|
+
require('../common/propsValues/sentiment.js');
|
|
18
|
+
require('../common/propsValues/profileType.js');
|
|
19
|
+
require('../common/propsValues/variant.js');
|
|
20
|
+
require('../common/propsValues/scroll.js');
|
|
21
|
+
require('../common/propsValues/markdownNodeType.js');
|
|
22
|
+
require('../common/fileType.js');
|
|
23
|
+
require('@transferwise/icons');
|
|
24
|
+
require('react');
|
|
25
|
+
require('react-intl');
|
|
26
|
+
require('../common/closeButton/CloseButton.messages.js');
|
|
27
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
7
28
|
|
|
8
29
|
const Badge = ({
|
|
9
30
|
badge,
|
package/build/badge/Badge.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Badge.js","sources":["../../src/badge/Badge.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { ReactNode } from 'react';\n\nimport {\n Size,\n Theme,\n SizeSmall,\n SizeMedium,\n SizeLarge,\n ThemeDark,\n ThemeLight,\n CommonProps,\n} from '../common';\n\n/**\n * @deprecated Use `SizeSmall` or `SizeLarge` instead.\n */\ntype DeprecatedSizes = SizeMedium;\n\nexport type BadgeProps = {\n badge: ReactNode;\n children: ReactNode;\n /**\n * `md` is deprecated, it will fallback to `sm` instead.\n */\n size?: SizeSmall | DeprecatedSizes | SizeLarge;\n border?: ThemeDark | ThemeLight;\n 'aria-label'?: string;\n} & CommonProps;\n\nconst Badge = ({\n badge,\n className = undefined,\n size: sizeProp = Size.SMALL,\n border = Theme.LIGHT,\n 'aria-label': ariaLabel,\n children,\n}: BadgeProps) => {\n // medium is deprecated, so we map it to small\n const size = sizeProp === Size.MEDIUM ? Size.SMALL : sizeProp;\n const classes: string = clsx(\n 'tw-badge',\n {\n [`tw-badge-border-${border}`]: border,\n [`tw-badge-${size}`]: size,\n },\n className,\n );\n\n return (\n <div aria-label={ariaLabel} className={classes}>\n <div className=\"tw-badge__children\">{children}</div>\n <div className=\"tw-badge__content\">{badge}</div>\n </div>\n );\n};\n\nexport default Badge;\n"],"names":["Badge","badge","className","undefined","size","sizeProp","Size","SMALL","border","Theme","LIGHT","ariaLabel","children","MEDIUM","classes","clsx","_jsxs","_jsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Badge.js","sources":["../../src/badge/Badge.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { ReactNode } from 'react';\n\nimport {\n Size,\n Theme,\n SizeSmall,\n SizeMedium,\n SizeLarge,\n ThemeDark,\n ThemeLight,\n CommonProps,\n} from '../common';\n\n/**\n * @deprecated Use `SizeSmall` or `SizeLarge` instead.\n */\ntype DeprecatedSizes = SizeMedium;\n\nexport type BadgeProps = {\n badge: ReactNode;\n children: ReactNode;\n /**\n * `md` is deprecated, it will fallback to `sm` instead.\n */\n size?: SizeSmall | DeprecatedSizes | SizeLarge;\n border?: ThemeDark | ThemeLight;\n 'aria-label'?: string;\n} & CommonProps;\n\nconst Badge = ({\n badge,\n className = undefined,\n size: sizeProp = Size.SMALL,\n border = Theme.LIGHT,\n 'aria-label': ariaLabel,\n children,\n}: BadgeProps) => {\n // medium is deprecated, so we map it to small\n const size = sizeProp === Size.MEDIUM ? Size.SMALL : sizeProp;\n const classes: string = clsx(\n 'tw-badge',\n {\n [`tw-badge-border-${border}`]: border,\n [`tw-badge-${size}`]: size,\n },\n className,\n );\n\n return (\n <div aria-label={ariaLabel} className={classes}>\n <div className=\"tw-badge__children\">{children}</div>\n <div className=\"tw-badge__content\">{badge}</div>\n </div>\n );\n};\n\nexport default Badge;\n"],"names":["Badge","badge","className","undefined","size","sizeProp","Size","SMALL","border","Theme","LIGHT","ariaLabel","children","MEDIUM","classes","clsx","_jsxs","_jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BMA,MAAAA,KAAK,GAAGA,CAAC;EACbC,KAAK;AACLC,EAAAA,SAAS,GAAGC,SAAS;AACrBC,EAAAA,IAAI,EAAEC,QAAQ,GAAGC,SAAI,CAACC,KAAK;EAC3BC,MAAM,GAAGC,WAAK,CAACC,KAAK;AACpB,EAAA,YAAY,EAAEC,SAAS;AACvBC,EAAAA,QAAAA;AAAQ,CACG,KAAI;AACf;AACA,EAAA,MAAMR,MAAI,GAAGC,QAAQ,KAAKC,SAAI,CAACO,MAAM,GAAGP,SAAI,CAACC,KAAK,GAAGF,QAAQ,CAAA;AAC7D,EAAA,MAAMS,OAAO,GAAWC,SAAI,CAC1B,UAAU,EACV;AACE,IAAA,CAAC,CAAmBP,gBAAAA,EAAAA,MAAM,CAAE,CAAA,GAAGA,MAAM;IACrC,CAAC,CAAA,SAAA,EAAYJ,MAAI,CAAA,CAAE,GAAGA,MAAAA;GACvB,EACDF,SAAS,CACV,CAAA;AAED,EAAA,oBACEc,eAAA,CAAA,KAAA,EAAA;AAAK,IAAA,YAAA,EAAYL,SAAU;AAACT,IAAAA,SAAS,EAAEY,OAAQ;AAAAF,IAAAA,QAAA,gBAC7CK,cAAA,CAAA,KAAA,EAAA;AAAKf,MAAAA,SAAS,EAAC,oBAAoB;AAAAU,MAAAA,QAAA,EAAEA,QAAAA;KAAc,CACnD,eAAAK,cAAA,CAAA,KAAA,EAAA;AAAKf,MAAAA,SAAS,EAAC,mBAAmB;AAAAU,MAAAA,QAAA,EAAEX,KAAAA;AAAK,KAAM,CACjD,CAAA;AAAA,GAAK,CAAC,CAAA;AAEV;;;;"}
|
package/build/badge/Badge.mjs
CHANGED
|
@@ -1,7 +1,28 @@
|
|
|
1
1
|
import { clsx } from 'clsx';
|
|
2
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
-
import { Size } from '../common/propsValues/size.mjs';
|
|
4
2
|
import { Theme } from '../common/theme.mjs';
|
|
3
|
+
import '../common/direction.mjs';
|
|
4
|
+
import '../common/propsValues/control.mjs';
|
|
5
|
+
import '../common/propsValues/breakpoint.mjs';
|
|
6
|
+
import { Size } from '../common/propsValues/size.mjs';
|
|
7
|
+
import '../common/propsValues/typography.mjs';
|
|
8
|
+
import '../common/propsValues/width.mjs';
|
|
9
|
+
import '../common/propsValues/type.mjs';
|
|
10
|
+
import '../common/propsValues/dateMode.mjs';
|
|
11
|
+
import '../common/propsValues/monthFormat.mjs';
|
|
12
|
+
import '../common/propsValues/position.mjs';
|
|
13
|
+
import '../common/propsValues/layouts.mjs';
|
|
14
|
+
import '../common/propsValues/status.mjs';
|
|
15
|
+
import '../common/propsValues/sentiment.mjs';
|
|
16
|
+
import '../common/propsValues/profileType.mjs';
|
|
17
|
+
import '../common/propsValues/variant.mjs';
|
|
18
|
+
import '../common/propsValues/scroll.mjs';
|
|
19
|
+
import '../common/propsValues/markdownNodeType.mjs';
|
|
20
|
+
import '../common/fileType.mjs';
|
|
21
|
+
import '@transferwise/icons';
|
|
22
|
+
import 'react';
|
|
23
|
+
import 'react-intl';
|
|
24
|
+
import '../common/closeButton/CloseButton.messages.mjs';
|
|
25
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
5
26
|
|
|
6
27
|
const Badge = ({
|
|
7
28
|
badge,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Badge.mjs","sources":["../../src/badge/Badge.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { ReactNode } from 'react';\n\nimport {\n Size,\n Theme,\n SizeSmall,\n SizeMedium,\n SizeLarge,\n ThemeDark,\n ThemeLight,\n CommonProps,\n} from '../common';\n\n/**\n * @deprecated Use `SizeSmall` or `SizeLarge` instead.\n */\ntype DeprecatedSizes = SizeMedium;\n\nexport type BadgeProps = {\n badge: ReactNode;\n children: ReactNode;\n /**\n * `md` is deprecated, it will fallback to `sm` instead.\n */\n size?: SizeSmall | DeprecatedSizes | SizeLarge;\n border?: ThemeDark | ThemeLight;\n 'aria-label'?: string;\n} & CommonProps;\n\nconst Badge = ({\n badge,\n className = undefined,\n size: sizeProp = Size.SMALL,\n border = Theme.LIGHT,\n 'aria-label': ariaLabel,\n children,\n}: BadgeProps) => {\n // medium is deprecated, so we map it to small\n const size = sizeProp === Size.MEDIUM ? Size.SMALL : sizeProp;\n const classes: string = clsx(\n 'tw-badge',\n {\n [`tw-badge-border-${border}`]: border,\n [`tw-badge-${size}`]: size,\n },\n className,\n );\n\n return (\n <div aria-label={ariaLabel} className={classes}>\n <div className=\"tw-badge__children\">{children}</div>\n <div className=\"tw-badge__content\">{badge}</div>\n </div>\n );\n};\n\nexport default Badge;\n"],"names":["Badge","badge","className","undefined","size","sizeProp","Size","SMALL","border","Theme","LIGHT","ariaLabel","children","MEDIUM","classes","clsx","_jsxs","_jsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Badge.mjs","sources":["../../src/badge/Badge.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { ReactNode } from 'react';\n\nimport {\n Size,\n Theme,\n SizeSmall,\n SizeMedium,\n SizeLarge,\n ThemeDark,\n ThemeLight,\n CommonProps,\n} from '../common';\n\n/**\n * @deprecated Use `SizeSmall` or `SizeLarge` instead.\n */\ntype DeprecatedSizes = SizeMedium;\n\nexport type BadgeProps = {\n badge: ReactNode;\n children: ReactNode;\n /**\n * `md` is deprecated, it will fallback to `sm` instead.\n */\n size?: SizeSmall | DeprecatedSizes | SizeLarge;\n border?: ThemeDark | ThemeLight;\n 'aria-label'?: string;\n} & CommonProps;\n\nconst Badge = ({\n badge,\n className = undefined,\n size: sizeProp = Size.SMALL,\n border = Theme.LIGHT,\n 'aria-label': ariaLabel,\n children,\n}: BadgeProps) => {\n // medium is deprecated, so we map it to small\n const size = sizeProp === Size.MEDIUM ? Size.SMALL : sizeProp;\n const classes: string = clsx(\n 'tw-badge',\n {\n [`tw-badge-border-${border}`]: border,\n [`tw-badge-${size}`]: size,\n },\n className,\n );\n\n return (\n <div aria-label={ariaLabel} className={classes}>\n <div className=\"tw-badge__children\">{children}</div>\n <div className=\"tw-badge__content\">{badge}</div>\n </div>\n );\n};\n\nexport default Badge;\n"],"names":["Badge","badge","className","undefined","size","sizeProp","Size","SMALL","border","Theme","LIGHT","ariaLabel","children","MEDIUM","classes","clsx","_jsxs","_jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA8BMA,MAAAA,KAAK,GAAGA,CAAC;EACbC,KAAK;AACLC,EAAAA,SAAS,GAAGC,SAAS;AACrBC,EAAAA,IAAI,EAAEC,QAAQ,GAAGC,IAAI,CAACC,KAAK;EAC3BC,MAAM,GAAGC,KAAK,CAACC,KAAK;AACpB,EAAA,YAAY,EAAEC,SAAS;AACvBC,EAAAA,QAAAA;AAAQ,CACG,KAAI;AACf;AACA,EAAA,MAAMR,IAAI,GAAGC,QAAQ,KAAKC,IAAI,CAACO,MAAM,GAAGP,IAAI,CAACC,KAAK,GAAGF,QAAQ,CAAA;AAC7D,EAAA,MAAMS,OAAO,GAAWC,IAAI,CAC1B,UAAU,EACV;AACE,IAAA,CAAC,CAAmBP,gBAAAA,EAAAA,MAAM,CAAE,CAAA,GAAGA,MAAM;IACrC,CAAC,CAAA,SAAA,EAAYJ,IAAI,CAAA,CAAE,GAAGA,IAAAA;GACvB,EACDF,SAAS,CACV,CAAA;AAED,EAAA,oBACEc,IAAA,CAAA,KAAA,EAAA;AAAK,IAAA,YAAA,EAAYL,SAAU;AAACT,IAAAA,SAAS,EAAEY,OAAQ;AAAAF,IAAAA,QAAA,gBAC7CK,GAAA,CAAA,KAAA,EAAA;AAAKf,MAAAA,SAAS,EAAC,oBAAoB;AAAAU,MAAAA,QAAA,EAAEA,QAAAA;KAAc,CACnD,eAAAK,GAAA,CAAA,KAAA,EAAA;AAAKf,MAAAA,SAAS,EAAC,mBAAmB;AAAAU,MAAAA,QAAA,EAAEX,KAAAA;AAAK,KAAM,CACjD,CAAA;AAAA,GAAK,CAAC,CAAA;AAEV;;;;"}
|
package/build/button/Button.js
CHANGED
|
@@ -3,13 +3,32 @@
|
|
|
3
3
|
var clsx = require('clsx');
|
|
4
4
|
var React = require('react');
|
|
5
5
|
var reactIntl = require('react-intl');
|
|
6
|
+
require('../common/theme.js');
|
|
7
|
+
require('../common/direction.js');
|
|
8
|
+
var control = require('../common/propsValues/control.js');
|
|
9
|
+
require('../common/propsValues/breakpoint.js');
|
|
10
|
+
var size = require('../common/propsValues/size.js');
|
|
11
|
+
require('../common/propsValues/typography.js');
|
|
12
|
+
require('../common/propsValues/width.js');
|
|
13
|
+
require('../common/propsValues/type.js');
|
|
14
|
+
require('../common/propsValues/dateMode.js');
|
|
15
|
+
require('../common/propsValues/monthFormat.js');
|
|
16
|
+
require('../common/propsValues/position.js');
|
|
17
|
+
require('../common/propsValues/layouts.js');
|
|
18
|
+
require('../common/propsValues/status.js');
|
|
19
|
+
require('../common/propsValues/sentiment.js');
|
|
20
|
+
require('../common/propsValues/profileType.js');
|
|
21
|
+
require('../common/propsValues/variant.js');
|
|
22
|
+
require('../common/propsValues/scroll.js');
|
|
23
|
+
require('../common/propsValues/markdownNodeType.js');
|
|
24
|
+
require('../common/fileType.js');
|
|
25
|
+
require('@transferwise/icons');
|
|
26
|
+
require('../common/closeButton/CloseButton.messages.js');
|
|
27
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
6
28
|
var ProcessIndicator = require('../processIndicator/ProcessIndicator.js');
|
|
7
29
|
var Button_messages = require('./Button.messages.js');
|
|
8
30
|
var classMap = require('./classMap.js');
|
|
9
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
10
31
|
var legacyUtils = require('./legacyUtils/legacyUtils.js');
|
|
11
|
-
var control = require('../common/propsValues/control.js');
|
|
12
|
-
var size = require('../common/propsValues/size.js');
|
|
13
32
|
|
|
14
33
|
const Button = /*#__PURE__*/React.forwardRef(({
|
|
15
34
|
as: component,
|
|
@@ -25,14 +44,11 @@ const Button = /*#__PURE__*/React.forwardRef(({
|
|
|
25
44
|
...rest
|
|
26
45
|
}, reference) => {
|
|
27
46
|
const intl = reactIntl.useIntl();
|
|
28
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
29
47
|
legacyUtils.logDeprecationNotices({
|
|
30
48
|
size: size$1,
|
|
31
49
|
type
|
|
32
50
|
});
|
|
33
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
34
51
|
const newType = legacyUtils.establishNewType(type);
|
|
35
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
36
52
|
const newPriority = legacyUtils.establishNewPriority(priority, type);
|
|
37
53
|
const classes = clsx.clsx(`btn btn-${size$1}`, `np-btn np-btn-${size$1}`, {
|
|
38
54
|
'btn-loading': loading,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","sources":["../../src/button/Button.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { ElementType, forwardRef, MouseEvent } from 'react';\nimport { useIntl } from 'react-intl';\n\nimport {\n Size,\n ControlType,\n Priority,\n ControlTypeAccent,\n ControlTypeNegative,\n ControlTypePositive,\n PriorityPrimary,\n PrioritySecondary,\n PriorityTertiary,\n SizeExtraSmall,\n SizeSmall,\n SizeMedium,\n SizeLarge,\n} from '../common';\nimport ProcessIndicator from '../processIndicator';\n\nimport messages from './Button.messages';\nimport { typeClassMap, priorityClassMap } from './classMap';\nimport { establishNewPriority, establishNewType, logDeprecationNotices } from './legacyUtils';\n\n/** @deprecated */\ntype DeprecatedTypes = 'primary' | 'pay' | 'secondary' | 'danger' | 'link';\n\n/** @deprecated */\ntype DeprecatedSizes = SizeExtraSmall;\n\ntype CommonProps = {\n block?: boolean;\n disabled?: boolean;\n loading?: boolean;\n type?: ControlTypeAccent | ControlTypeNegative | ControlTypePositive | DeprecatedTypes | null;\n priority?: PriorityPrimary | PrioritySecondary | PriorityTertiary | null;\n size?: SizeSmall | SizeMedium | SizeLarge | DeprecatedSizes;\n};\n\ntype ButtonProps = CommonProps &\n Omit<React.ComponentPropsWithRef<'button'>, 'type'> & {\n as?: 'button';\n htmlType?: 'submit' | 'reset' | 'button';\n };\n\ntype AnchorProps = CommonProps &\n Omit<React.ComponentPropsWithRef<'a'>, 'type'> & {\n as?: 'a';\n };\n\nexport type Props = ButtonProps | AnchorProps;\n\ntype ButtonReferenceType = HTMLButtonElement | HTMLAnchorElement;\n\nconst Button = forwardRef<ButtonReferenceType, Props>(\n (\n {\n as: component,\n block = false,\n children,\n className,\n disabled,\n loading = false,\n priority = Priority.PRIMARY,\n size = Size.MEDIUM,\n type = ControlType.ACCENT,\n onClick,\n ...rest\n }: Props,\n reference,\n ) => {\n const intl = useIntl();\n\n
|
|
1
|
+
{"version":3,"file":"Button.js","sources":["../../src/button/Button.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { ElementType, forwardRef, MouseEvent } from 'react';\nimport { useIntl } from 'react-intl';\n\nimport {\n Size,\n ControlType,\n Priority,\n ControlTypeAccent,\n ControlTypeNegative,\n ControlTypePositive,\n PriorityPrimary,\n PrioritySecondary,\n PriorityTertiary,\n SizeExtraSmall,\n SizeSmall,\n SizeMedium,\n SizeLarge,\n} from '../common';\nimport ProcessIndicator from '../processIndicator';\n\nimport messages from './Button.messages';\nimport { typeClassMap, priorityClassMap } from './classMap';\nimport { establishNewPriority, establishNewType, logDeprecationNotices } from './legacyUtils';\n\n/** @deprecated */\ntype DeprecatedTypes = 'primary' | 'pay' | 'secondary' | 'danger' | 'link';\n\n/** @deprecated */\ntype DeprecatedSizes = SizeExtraSmall;\n\ntype CommonProps = {\n block?: boolean;\n disabled?: boolean;\n loading?: boolean;\n type?: ControlTypeAccent | ControlTypeNegative | ControlTypePositive | DeprecatedTypes | null;\n priority?: PriorityPrimary | PrioritySecondary | PriorityTertiary | null;\n size?: SizeSmall | SizeMedium | SizeLarge | DeprecatedSizes;\n};\n\ntype ButtonProps = CommonProps &\n Omit<React.ComponentPropsWithRef<'button'>, 'type'> & {\n as?: 'button';\n htmlType?: 'submit' | 'reset' | 'button';\n };\n\ntype AnchorProps = CommonProps &\n Omit<React.ComponentPropsWithRef<'a'>, 'type'> & {\n as?: 'a';\n };\n\nexport type Props = ButtonProps | AnchorProps;\n\ntype ButtonReferenceType = HTMLButtonElement | HTMLAnchorElement;\n\nconst Button = forwardRef<ButtonReferenceType, Props>(\n (\n {\n as: component,\n block = false,\n children,\n className,\n disabled,\n loading = false,\n priority = Priority.PRIMARY,\n size = Size.MEDIUM,\n type = ControlType.ACCENT,\n onClick,\n ...rest\n }: Props,\n reference,\n ) => {\n const intl = useIntl();\n\n logDeprecationNotices({ size, type });\n\n const newType = establishNewType(type);\n const newPriority = establishNewPriority(priority, type);\n\n const classes = clsx(\n `btn btn-${size}`,\n `np-btn np-btn-${size}`,\n {\n 'btn-loading': loading,\n 'btn-block np-btn-block': block,\n disabled,\n },\n // @ts-expect-error fix when refactor `typeClassMap` to TypeScript\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n typeClassMap[newType],\n // @ts-expect-error fix when refactor `typeClassMap` to TypeScript\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n priorityClassMap[newPriority],\n className,\n );\n\n function processIndicatorSize() {\n return ['sm', 'xs'].includes(size) ? 'xxs' : 'xs';\n }\n\n const Element = (component as ElementType) ?? 'button';\n let props;\n\n if (Element === 'button') {\n const { htmlType = 'button', ...restProps } = rest as ButtonProps;\n props = {\n ...restProps,\n disabled,\n 'aria-disabled': loading,\n type: htmlType,\n };\n } else {\n props = {\n ...rest,\n 'aria-disabled': loading,\n } as AnchorProps;\n }\n\n /**\n * Ensures that the button cannot be activated in loading or disabled mode,\n * when `aria-disabled` might be used over the `disabled` HTML attribute\n */\n const handleClick =\n (handler: Props['onClick']) =>\n (event: MouseEvent<HTMLButtonElement> & MouseEvent<HTMLAnchorElement>) => {\n if (disabled || loading) {\n event.preventDefault();\n } else if (typeof handler === 'function') {\n handler(event);\n }\n };\n\n return (\n <Element\n ref={reference}\n className={classes}\n onClick={handleClick(onClick)}\n {...props}\n aria-live={loading ? 'polite' : 'off'}\n aria-busy={loading}\n aria-label={loading ? intl.formatMessage(messages.loadingAriaLabel) : rest['aria-label']}\n >\n {children}\n {loading && (\n <ProcessIndicator\n size={processIndicatorSize()}\n className=\"btn-loader\"\n data-testid=\"ButtonProgressIndicator\"\n />\n )}\n </Element>\n );\n },\n);\n\nexport default Button;\n"],"names":["Button","forwardRef","as","component","block","children","className","disabled","loading","priority","Priority","PRIMARY","size","Size","MEDIUM","type","ControlType","ACCENT","onClick","rest","reference","intl","useIntl","logDeprecationNotices","newType","establishNewType","newPriority","establishNewPriority","classes","clsx","typeClassMap","priorityClassMap","processIndicatorSize","includes","Element","props","htmlType","restProps","handleClick","handler","event","preventDefault","_jsxs","ref","formatMessage","messages","loadingAriaLabel","_jsx","ProcessIndicator"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuDA,MAAMA,MAAM,gBAAGC,gBAAU,CACvB,CACE;AACEC,EAAAA,EAAE,EAAEC,SAAS;AACbC,E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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.messages.js","sources":["../../src/button/Button.messages.
|
|
1
|
+
{"version":3,"file":"Button.messages.js","sources":["../../src/button/Button.messages.ts"],"sourcesContent":["import { defineMessages } from 'react-intl';\n\nexport default defineMessages({\n loadingAriaLabel: {\n id: 'neptune.Button.loadingAriaLabel',\n defaultMessage: 'loading',\n description: 'Description of button while loading',\n },\n});\n"],"names":["defineMessages","loadingAriaLabel","id"],"mappings":";;;;AAEA,eAAeA,wBAAc,CAAC;AAC5BC,EAAAA,gBAAgB,EAAE;IAChBC,EAAE,EAAA,iCAAA;AAGH,GAAA;AACF,CAAA,CAAC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.messages.mjs","sources":["../../src/button/Button.messages.
|
|
1
|
+
{"version":3,"file":"Button.messages.mjs","sources":["../../src/button/Button.messages.ts"],"sourcesContent":["import { defineMessages } from 'react-intl';\n\nexport default defineMessages({\n loadingAriaLabel: {\n id: 'neptune.Button.loadingAriaLabel',\n defaultMessage: 'loading',\n description: 'Description of button while loading',\n },\n});\n"],"names":["defineMessages","loadingAriaLabel","id"],"mappings":";;AAEA,eAAeA,cAAc,CAAC;AAC5BC,EAAAA,gBAAgB,EAAE;IAChBC,EAAE,EAAA,iCAAA;AAGH,GAAA;AACF,CAAA,CAAC;;;;"}
|
package/build/button/Button.mjs
CHANGED
|
@@ -1,13 +1,32 @@
|
|
|
1
1
|
import { clsx } from 'clsx';
|
|
2
2
|
import { forwardRef } from 'react';
|
|
3
3
|
import { useIntl } from 'react-intl';
|
|
4
|
+
import '../common/theme.mjs';
|
|
5
|
+
import '../common/direction.mjs';
|
|
6
|
+
import { Priority, ControlType } from '../common/propsValues/control.mjs';
|
|
7
|
+
import '../common/propsValues/breakpoint.mjs';
|
|
8
|
+
import { Size } from '../common/propsValues/size.mjs';
|
|
9
|
+
import '../common/propsValues/typography.mjs';
|
|
10
|
+
import '../common/propsValues/width.mjs';
|
|
11
|
+
import '../common/propsValues/type.mjs';
|
|
12
|
+
import '../common/propsValues/dateMode.mjs';
|
|
13
|
+
import '../common/propsValues/monthFormat.mjs';
|
|
14
|
+
import '../common/propsValues/position.mjs';
|
|
15
|
+
import '../common/propsValues/layouts.mjs';
|
|
16
|
+
import '../common/propsValues/status.mjs';
|
|
17
|
+
import '../common/propsValues/sentiment.mjs';
|
|
18
|
+
import '../common/propsValues/profileType.mjs';
|
|
19
|
+
import '../common/propsValues/variant.mjs';
|
|
20
|
+
import '../common/propsValues/scroll.mjs';
|
|
21
|
+
import '../common/propsValues/markdownNodeType.mjs';
|
|
22
|
+
import '../common/fileType.mjs';
|
|
23
|
+
import '@transferwise/icons';
|
|
24
|
+
import '../common/closeButton/CloseButton.messages.mjs';
|
|
25
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
26
|
import ProcessIndicator from '../processIndicator/ProcessIndicator.mjs';
|
|
5
27
|
import messages from './Button.messages.mjs';
|
|
6
28
|
import { typeClassMap, priorityClassMap } from './classMap.mjs';
|
|
7
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
8
29
|
import { logDeprecationNotices, establishNewType, establishNewPriority } from './legacyUtils/legacyUtils.mjs';
|
|
9
|
-
import { Priority, ControlType } from '../common/propsValues/control.mjs';
|
|
10
|
-
import { Size } from '../common/propsValues/size.mjs';
|
|
11
30
|
|
|
12
31
|
const Button = /*#__PURE__*/forwardRef(({
|
|
13
32
|
as: component,
|
|
@@ -23,14 +42,11 @@ const Button = /*#__PURE__*/forwardRef(({
|
|
|
23
42
|
...rest
|
|
24
43
|
}, reference) => {
|
|
25
44
|
const intl = useIntl();
|
|
26
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
27
45
|
logDeprecationNotices({
|
|
28
46
|
size,
|
|
29
47
|
type
|
|
30
48
|
});
|
|
31
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
32
49
|
const newType = establishNewType(type);
|
|
33
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
34
50
|
const newPriority = establishNewPriority(priority, type);
|
|
35
51
|
const classes = clsx(`btn btn-${size}`, `np-btn np-btn-${size}`, {
|
|
36
52
|
'btn-loading': loading,
|