@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":"StatusIcon.js","sources":["../../src/statusIcon/StatusIcon.tsx"],"sourcesContent":["import { Info, Alert, Cross, Check, ClockBorderless } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport { useIntl } from 'react-intl';\n\nimport { SizeSmall, SizeMedium, SizeLarge, Sentiment, Size, Breakpoint } from '../common';\nimport Circle, { CircleProps } from '../common/circle';\nimport { useMedia } from '../common/hooks/useMedia';\n\nimport messages from './StatusIcon.messages';\n\n/**\n * @deprecated use `16 | 24 | 32 | 40 | 48 | 56 | 72` component instead\n */\ntype LegacySizes = SizeSmall | SizeMedium | SizeLarge;\n\nexport type StatusIconProps = {\n sentiment?: `${Sentiment}`;\n size?: LegacySizes | 16 | 24 | 32 | 40 | 48 | 56 | 72;\n /**\n * Override for the sentiment's-derived, default, accessible\n * name announced by the screen readers. <br />\n * Using `null` will render the icon purely presentational.\n * */\n iconLabel?: string | null;\n};\n\nconst mapLegacySize = {\n [String(Size.SMALL)]: 16,\n [String(Size.MEDIUM)]: 40,\n [String(Size.LARGE)]: 48,\n} satisfies Record<string, CircleProps['size']>;\n\nconst StatusIcon = ({ sentiment = 'neutral', size: sizeProp = 40, iconLabel }: StatusIconProps) => {\n const intl = useIntl();\n\n const iconMetaBySentiment: Record<\n `${Sentiment}`,\n {\n Icon: React.ElementType;\n defaultIconLabel: string;\n }\n > = {\n [Sentiment.NEGATIVE]: {\n Icon: Cross,\n defaultIconLabel: intl.formatMessage(messages.errorLabel),\n },\n [Sentiment.POSITIVE]: {\n Icon: Check,\n defaultIconLabel: intl.formatMessage(messages.successLabel),\n },\n [Sentiment.WARNING]: {\n Icon: Alert,\n defaultIconLabel: intl.formatMessage(messages.warningLabel),\n },\n [Sentiment.PENDING]: {\n Icon: ClockBorderless,\n defaultIconLabel: intl.formatMessage(messages.pendingLabel),\n },\n [Sentiment.NEUTRAL]: {\n Icon: Info,\n defaultIconLabel: intl.formatMessage(messages.informationLabel),\n },\n // deprecated\n [Sentiment.ERROR]: {\n Icon: Cross,\n defaultIconLabel: intl.formatMessage(messages.errorLabel),\n },\n [Sentiment.INFO]: {\n Icon: Info,\n defaultIconLabel: intl.formatMessage(messages.informationLabel),\n },\n [Sentiment.SUCCESS]: {\n Icon: Check,\n defaultIconLabel: intl.formatMessage(messages.successLabel),\n },\n };\n const { Icon, defaultIconLabel } = iconMetaBySentiment[sentiment];\n\n const iconColor = sentiment === 'warning' || sentiment === 'pending' ? 'dark' : 'light';\n const isTinyViewport = useMedia(`(max-width: ${Breakpoint.ZOOM_400}px)`);\n const size = mapLegacySize[sizeProp] ?? sizeProp;\n return (\n <Circle\n as=\"span\"\n size={isTinyViewport && size < 40 ? 32 : size}\n data-testid=\"status-icon\"\n className={clsx('status-circle', sentiment)}\n >\n <Icon\n className={clsx('status-icon', iconColor)}\n title={iconLabel === null ? undefined : iconLabel || defaultIconLabel}\n />\n </Circle>\n );\n};\n\nexport default StatusIcon;\n"],"names":["mapLegacySize","String","Size","SMALL","MEDIUM","LARGE","StatusIcon","sentiment","size","sizeProp","iconLabel","intl","useIntl","iconMetaBySentiment","Sentiment","NEGATIVE","Icon","Cross","defaultIconLabel","formatMessage","messages","errorLabel","POSITIVE","Check","successLabel","WARNING","Alert","warningLabel","PENDING","ClockBorderless","pendingLabel","NEUTRAL","Info","informationLabel","ERROR","INFO","SUCCESS","iconColor","isTinyViewport","useMedia","Breakpoint","ZOOM_400","_jsx","Circle","as","className","clsx","children","title","undefined"],"mappings":"
|
|
1
|
+
{"version":3,"file":"StatusIcon.js","sources":["../../src/statusIcon/StatusIcon.tsx"],"sourcesContent":["import { Info, Alert, Cross, Check, ClockBorderless } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport { useIntl } from 'react-intl';\n\nimport { SizeSmall, SizeMedium, SizeLarge, Sentiment, Size, Breakpoint } from '../common';\nimport Circle, { CircleProps } from '../common/circle';\nimport { useMedia } from '../common/hooks/useMedia';\n\nimport messages from './StatusIcon.messages';\n\n/**\n * @deprecated use `16 | 24 | 32 | 40 | 48 | 56 | 72` component instead\n */\ntype LegacySizes = SizeSmall | SizeMedium | SizeLarge;\n\nexport type StatusIconProps = {\n sentiment?: `${Sentiment}`;\n size?: LegacySizes | 16 | 24 | 32 | 40 | 48 | 56 | 72;\n /**\n * Override for the sentiment's-derived, default, accessible\n * name announced by the screen readers. <br />\n * Using `null` will render the icon purely presentational.\n * */\n iconLabel?: string | null;\n};\n\nconst mapLegacySize = {\n [String(Size.SMALL)]: 16,\n [String(Size.MEDIUM)]: 40,\n [String(Size.LARGE)]: 48,\n} satisfies Record<string, CircleProps['size']>;\n\nconst StatusIcon = ({ sentiment = 'neutral', size: sizeProp = 40, iconLabel }: StatusIconProps) => {\n const intl = useIntl();\n\n const iconMetaBySentiment: Record<\n `${Sentiment}`,\n {\n Icon: React.ElementType;\n defaultIconLabel: string;\n }\n > = {\n [Sentiment.NEGATIVE]: {\n Icon: Cross,\n defaultIconLabel: intl.formatMessage(messages.errorLabel),\n },\n [Sentiment.POSITIVE]: {\n Icon: Check,\n defaultIconLabel: intl.formatMessage(messages.successLabel),\n },\n [Sentiment.WARNING]: {\n Icon: Alert,\n defaultIconLabel: intl.formatMessage(messages.warningLabel),\n },\n [Sentiment.PENDING]: {\n Icon: ClockBorderless,\n defaultIconLabel: intl.formatMessage(messages.pendingLabel),\n },\n [Sentiment.NEUTRAL]: {\n Icon: Info,\n defaultIconLabel: intl.formatMessage(messages.informationLabel),\n },\n // deprecated\n [Sentiment.ERROR]: {\n Icon: Cross,\n defaultIconLabel: intl.formatMessage(messages.errorLabel),\n },\n [Sentiment.INFO]: {\n Icon: Info,\n defaultIconLabel: intl.formatMessage(messages.informationLabel),\n },\n [Sentiment.SUCCESS]: {\n Icon: Check,\n defaultIconLabel: intl.formatMessage(messages.successLabel),\n },\n };\n const { Icon, defaultIconLabel } = iconMetaBySentiment[sentiment];\n\n const iconColor = sentiment === 'warning' || sentiment === 'pending' ? 'dark' : 'light';\n const isTinyViewport = useMedia(`(max-width: ${Breakpoint.ZOOM_400}px)`);\n const size = mapLegacySize[sizeProp] ?? sizeProp;\n return (\n <Circle\n as=\"span\"\n size={isTinyViewport && size < 40 ? 32 : size}\n data-testid=\"status-icon\"\n className={clsx('status-circle', sentiment)}\n >\n <Icon\n className={clsx('status-icon', iconColor)}\n title={iconLabel === null ? undefined : iconLabel || defaultIconLabel}\n />\n </Circle>\n );\n};\n\nexport default StatusIcon;\n"],"names":["mapLegacySize","String","Size","SMALL","MEDIUM","LARGE","StatusIcon","sentiment","size","sizeProp","iconLabel","intl","useIntl","iconMetaBySentiment","Sentiment","NEGATIVE","Icon","Cross","defaultIconLabel","formatMessage","messages","errorLabel","POSITIVE","Check","successLabel","WARNING","Alert","warningLabel","PENDING","ClockBorderless","pendingLabel","NEUTRAL","Info","informationLabel","ERROR","INFO","SUCCESS","iconColor","isTinyViewport","useMedia","Breakpoint","ZOOM_400","_jsx","Circle","as","className","clsx","children","title","undefined"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,MAAMA,aAAa,GAAG;AACpB,EAAA,CAACC,MAAM,CAACC,SAAI,CAACC,KAAK,CAAC,GAAG,EAAE;AACxB,EAAA,CAACF,MAAM,CAACC,SAAI,CAACE,MAAM,CAAC,GAAG,EAAE;AACzB,EAAA,CAACH,MAAM,CAACC,SAAI,CAACG,KAAK,CAAC,GAAG,EAAA;CACuB,CAAA;AAEzCC,MAAAA,UAAU,GAAGA,CAAC;AAAEC,aAAAA,WAAS,GAAG,SAAS;EAAEC,IAAI,EAAEC,QAAQ,GAAG,EAAE;AAAEC,EAAAA,SAAAA;AAAS,CAAmB,KAAI;AAChG,EAAA,MAAMC,IAAI,GAAGC,iBAAO,EAAE,CAAA;AAEtB,EAAA,MAAMC,mBAAmB,GAMrB;IACF,CAACC,mBAAS,CAACC,QAAQ,GAAG;AACpBC,MAAAA,IAAI,EAAEC,WAAK;AACXC,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D,MAAM;IAAER,IAAI;AAAEE,IAAAA,gBAAAA;AAAgB,GAAE,GAAGL,mBAAmB,CAACN,WAAS,CAAC,CAAA;AAEjE,EAAA,MAAM8B,SAAS,GAAG9B,WAAS,KAAK,SAAS,IAAIA,WAAS,KAAK,SAAS,GAAG,MAAM,GAAG,OAAO,CAAA;EACvF,MAAM+B,cAAc,GAAGC,iBAAQ,CAAC,eAAeC,qBAAU,CAACC,QAAQ,CAAA,GAAA,CAAK,CAAC,CAAA;AACxE,EAAA,MAAMjC,IAAI,GAAGR,aAAa,CAACS,QAAQ,CAAC,IAAIA,QAAQ,CAAA;EAChD,oBACEiC,cAAA,CAACC,MAAM,EAAA;AACLC,IAAAA,EAAE,EAAC,MAAM;IACTpC,IAAI,EAAE8B,cAAc,IAAI9B,IAAI,GAAG,EAAE,GAAG,EAAE,GAAGA,IAAK;AAC9C,IAAA,aAAA,EAAY,aAAa;AACzBqC,IAAAA,SAAS,EAAEC,SAAI,CAAC,eAAe,EAAEvC,WAAS,CAAE;IAAAwC,QAAA,eAE5CL,cAAA,CAAC1B,IAAI,EAAA;AACH6B,MAAAA,SAAS,EAAEC,SAAI,CAAC,aAAa,EAAET,SAAS,CAAE;MAC1CW,KAAK,EAAEtC,SAAS,KAAK,IAAI,GAAGuC,SAAS,GAAGvC,SAAS,IAAIQ,gBAAAA;KAEzD,CAAA;AAAA,GAAQ,CAAC,CAAA;AAEb;;;;"}
|
|
@@ -1,13 +1,31 @@
|
|
|
1
1
|
import { Cross, Check, Alert, ClockBorderless, Info } from '@transferwise/icons';
|
|
2
2
|
import { clsx } from 'clsx';
|
|
3
3
|
import { useIntl } from 'react-intl';
|
|
4
|
+
import '../common/theme.mjs';
|
|
5
|
+
import '../common/direction.mjs';
|
|
6
|
+
import '../common/propsValues/control.mjs';
|
|
7
|
+
import { Breakpoint } from '../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 { Sentiment } from '../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 'react';
|
|
24
|
+
import '../common/closeButton/CloseButton.messages.mjs';
|
|
25
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
26
|
import Circle from '../common/circle/Circle.mjs';
|
|
5
27
|
import { useMedia } from '../common/hooks/useMedia.mjs';
|
|
6
28
|
import messages from './StatusIcon.messages.mjs';
|
|
7
|
-
import { jsx } from 'react/jsx-runtime';
|
|
8
|
-
import { Sentiment } from '../common/propsValues/sentiment.mjs';
|
|
9
|
-
import { Breakpoint } from '../common/propsValues/breakpoint.mjs';
|
|
10
|
-
import { Size } from '../common/propsValues/size.mjs';
|
|
11
29
|
|
|
12
30
|
const mapLegacySize = {
|
|
13
31
|
[String(Size.SMALL)]: 16,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatusIcon.mjs","sources":["../../src/statusIcon/StatusIcon.tsx"],"sourcesContent":["import { Info, Alert, Cross, Check, ClockBorderless } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport { useIntl } from 'react-intl';\n\nimport { SizeSmall, SizeMedium, SizeLarge, Sentiment, Size, Breakpoint } from '../common';\nimport Circle, { CircleProps } from '../common/circle';\nimport { useMedia } from '../common/hooks/useMedia';\n\nimport messages from './StatusIcon.messages';\n\n/**\n * @deprecated use `16 | 24 | 32 | 40 | 48 | 56 | 72` component instead\n */\ntype LegacySizes = SizeSmall | SizeMedium | SizeLarge;\n\nexport type StatusIconProps = {\n sentiment?: `${Sentiment}`;\n size?: LegacySizes | 16 | 24 | 32 | 40 | 48 | 56 | 72;\n /**\n * Override for the sentiment's-derived, default, accessible\n * name announced by the screen readers. <br />\n * Using `null` will render the icon purely presentational.\n * */\n iconLabel?: string | null;\n};\n\nconst mapLegacySize = {\n [String(Size.SMALL)]: 16,\n [String(Size.MEDIUM)]: 40,\n [String(Size.LARGE)]: 48,\n} satisfies Record<string, CircleProps['size']>;\n\nconst StatusIcon = ({ sentiment = 'neutral', size: sizeProp = 40, iconLabel }: StatusIconProps) => {\n const intl = useIntl();\n\n const iconMetaBySentiment: Record<\n `${Sentiment}`,\n {\n Icon: React.ElementType;\n defaultIconLabel: string;\n }\n > = {\n [Sentiment.NEGATIVE]: {\n Icon: Cross,\n defaultIconLabel: intl.formatMessage(messages.errorLabel),\n },\n [Sentiment.POSITIVE]: {\n Icon: Check,\n defaultIconLabel: intl.formatMessage(messages.successLabel),\n },\n [Sentiment.WARNING]: {\n Icon: Alert,\n defaultIconLabel: intl.formatMessage(messages.warningLabel),\n },\n [Sentiment.PENDING]: {\n Icon: ClockBorderless,\n defaultIconLabel: intl.formatMessage(messages.pendingLabel),\n },\n [Sentiment.NEUTRAL]: {\n Icon: Info,\n defaultIconLabel: intl.formatMessage(messages.informationLabel),\n },\n // deprecated\n [Sentiment.ERROR]: {\n Icon: Cross,\n defaultIconLabel: intl.formatMessage(messages.errorLabel),\n },\n [Sentiment.INFO]: {\n Icon: Info,\n defaultIconLabel: intl.formatMessage(messages.informationLabel),\n },\n [Sentiment.SUCCESS]: {\n Icon: Check,\n defaultIconLabel: intl.formatMessage(messages.successLabel),\n },\n };\n const { Icon, defaultIconLabel } = iconMetaBySentiment[sentiment];\n\n const iconColor = sentiment === 'warning' || sentiment === 'pending' ? 'dark' : 'light';\n const isTinyViewport = useMedia(`(max-width: ${Breakpoint.ZOOM_400}px)`);\n const size = mapLegacySize[sizeProp] ?? sizeProp;\n return (\n <Circle\n as=\"span\"\n size={isTinyViewport && size < 40 ? 32 : size}\n data-testid=\"status-icon\"\n className={clsx('status-circle', sentiment)}\n >\n <Icon\n className={clsx('status-icon', iconColor)}\n title={iconLabel === null ? undefined : iconLabel || defaultIconLabel}\n />\n </Circle>\n );\n};\n\nexport default StatusIcon;\n"],"names":["mapLegacySize","String","Size","SMALL","MEDIUM","LARGE","StatusIcon","sentiment","size","sizeProp","iconLabel","intl","useIntl","iconMetaBySentiment","Sentiment","NEGATIVE","Icon","Cross","defaultIconLabel","formatMessage","messages","errorLabel","POSITIVE","Check","successLabel","WARNING","Alert","warningLabel","PENDING","ClockBorderless","pendingLabel","NEUTRAL","Info","informationLabel","ERROR","INFO","SUCCESS","iconColor","isTinyViewport","useMedia","Breakpoint","ZOOM_400","_jsx","Circle","as","className","clsx","children","title","undefined"],"mappings":"
|
|
1
|
+
{"version":3,"file":"StatusIcon.mjs","sources":["../../src/statusIcon/StatusIcon.tsx"],"sourcesContent":["import { Info, Alert, Cross, Check, ClockBorderless } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport { useIntl } from 'react-intl';\n\nimport { SizeSmall, SizeMedium, SizeLarge, Sentiment, Size, Breakpoint } from '../common';\nimport Circle, { CircleProps } from '../common/circle';\nimport { useMedia } from '../common/hooks/useMedia';\n\nimport messages from './StatusIcon.messages';\n\n/**\n * @deprecated use `16 | 24 | 32 | 40 | 48 | 56 | 72` component instead\n */\ntype LegacySizes = SizeSmall | SizeMedium | SizeLarge;\n\nexport type StatusIconProps = {\n sentiment?: `${Sentiment}`;\n size?: LegacySizes | 16 | 24 | 32 | 40 | 48 | 56 | 72;\n /**\n * Override for the sentiment's-derived, default, accessible\n * name announced by the screen readers. <br />\n * Using `null` will render the icon purely presentational.\n * */\n iconLabel?: string | null;\n};\n\nconst mapLegacySize = {\n [String(Size.SMALL)]: 16,\n [String(Size.MEDIUM)]: 40,\n [String(Size.LARGE)]: 48,\n} satisfies Record<string, CircleProps['size']>;\n\nconst StatusIcon = ({ sentiment = 'neutral', size: sizeProp = 40, iconLabel }: StatusIconProps) => {\n const intl = useIntl();\n\n const iconMetaBySentiment: Record<\n `${Sentiment}`,\n {\n Icon: React.ElementType;\n defaultIconLabel: string;\n }\n > = {\n [Sentiment.NEGATIVE]: {\n Icon: Cross,\n defaultIconLabel: intl.formatMessage(messages.errorLabel),\n },\n [Sentiment.POSITIVE]: {\n Icon: Check,\n defaultIconLabel: intl.formatMessage(messages.successLabel),\n },\n [Sentiment.WARNING]: {\n Icon: Alert,\n defaultIconLabel: intl.formatMessage(messages.warningLabel),\n },\n [Sentiment.PENDING]: {\n Icon: ClockBorderless,\n defaultIconLabel: intl.formatMessage(messages.pendingLabel),\n },\n [Sentiment.NEUTRAL]: {\n Icon: Info,\n defaultIconLabel: intl.formatMessage(messages.informationLabel),\n },\n // deprecated\n [Sentiment.ERROR]: {\n Icon: Cross,\n defaultIconLabel: intl.formatMessage(messages.errorLabel),\n },\n [Sentiment.INFO]: {\n Icon: Info,\n defaultIconLabel: intl.formatMessage(messages.informationLabel),\n },\n [Sentiment.SUCCESS]: {\n Icon: Check,\n defaultIconLabel: intl.formatMessage(messages.successLabel),\n },\n };\n const { Icon, defaultIconLabel } = iconMetaBySentiment[sentiment];\n\n const iconColor = sentiment === 'warning' || sentiment === 'pending' ? 'dark' : 'light';\n const isTinyViewport = useMedia(`(max-width: ${Breakpoint.ZOOM_400}px)`);\n const size = mapLegacySize[sizeProp] ?? sizeProp;\n return (\n <Circle\n as=\"span\"\n size={isTinyViewport && size < 40 ? 32 : size}\n data-testid=\"status-icon\"\n className={clsx('status-circle', sentiment)}\n >\n <Icon\n className={clsx('status-icon', iconColor)}\n title={iconLabel === null ? undefined : iconLabel || defaultIconLabel}\n />\n </Circle>\n );\n};\n\nexport default StatusIcon;\n"],"names":["mapLegacySize","String","Size","SMALL","MEDIUM","LARGE","StatusIcon","sentiment","size","sizeProp","iconLabel","intl","useIntl","iconMetaBySentiment","Sentiment","NEGATIVE","Icon","Cross","defaultIconLabel","formatMessage","messages","errorLabel","POSITIVE","Check","successLabel","WARNING","Alert","warningLabel","PENDING","ClockBorderless","pendingLabel","NEUTRAL","Info","informationLabel","ERROR","INFO","SUCCESS","iconColor","isTinyViewport","useMedia","Breakpoint","ZOOM_400","_jsx","Circle","as","className","clsx","children","title","undefined"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,MAAMA,aAAa,GAAG;AACpB,EAAA,CAACC,MAAM,CAACC,IAAI,CAACC,KAAK,CAAC,GAAG,EAAE;AACxB,EAAA,CAACF,MAAM,CAACC,IAAI,CAACE,MAAM,CAAC,GAAG,EAAE;AACzB,EAAA,CAACH,MAAM,CAACC,IAAI,CAACG,KAAK,CAAC,GAAG,EAAA;CACuB,CAAA;AAEzCC,MAAAA,UAAU,GAAGA,CAAC;AAAEC,EAAAA,SAAS,GAAG,SAAS;EAAEC,IAAI,EAAEC,QAAQ,GAAG,EAAE;AAAEC,EAAAA,SAAAA;AAAS,CAAmB,KAAI;AAChG,EAAA,MAAMC,IAAI,GAAGC,OAAO,EAAE,CAAA;AAEtB,EAAA,MAAMC,mBAAmB,GAMrB;IACF,CAACC,SAAS,CAACC,QAAQ,GAAG;AACpBC,MAAAA,IAAI,EAAEC,KAAK;AACXC,MAAAA,gBAAgB,EAAEP,IAAI,CAACQ,aAAa,CAACC,QAAQ,CAACC,UAAU,CAAA;KACzD;IACD,CAACP,SAAS,CAACQ,QAAQ,GAAG;AACpBN,MAAAA,IAAI,EAAEO,KAAK;AACXL,MAAAA,gBAAgB,EAAEP,IAAI,CAACQ,aAAa,CAACC,QAAQ,CAACI,YAAY,CAAA;KAC3D;IACD,CAACV,SAAS,CAACW,OAAO,GAAG;AACnBT,MAAAA,IAAI,EAAEU,KAAK;AACXR,MAAAA,gBAAgB,EAAEP,IAAI,CAACQ,a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,QAAQ,CAAA;EAChD,oBACEiC,GAAA,CAACC,MAAM,EAAA;AACLC,IAAAA,EAAE,EAAC,MAAM;IACTpC,IAAI,EAAE8B,cAAc,IAAI9B,IAAI,GAAG,EAAE,GAAG,EAAE,GAAGA,IAAK;AAC9C,IAAA,aAAA,EAAY,aAAa;AACzBqC,IAAAA,SAAS,EAAEC,IAAI,CAAC,eAAe,EAAEvC,SAAS,CAAE;IAAAwC,QAAA,eAE5CL,GAAA,CAAC1B,IAAI,EAAA;AACH6B,MAAAA,SAAS,EAAEC,IAAI,CAAC,aAAa,EAAET,SAAS,CAAE;MAC1CW,KAAK,EAAEtC,SAAS,KAAK,IAAI,GAAGuC,SAAS,GAAGvC,SAAS,IAAIQ,gBAAAA;KAEzD,CAAA;AAAA,GAAQ,CAAC,CAAA;AAEb;;;;"}
|
package/build/stepper/Stepper.js
CHANGED
|
@@ -2,11 +2,33 @@
|
|
|
2
2
|
|
|
3
3
|
var clsx = require('clsx');
|
|
4
4
|
require('react');
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
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
|
+
var position = 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
|
+
require('@transferwise/icons');
|
|
25
|
+
require('react-intl');
|
|
26
|
+
require('../common/closeButton/CloseButton.messages.js');
|
|
7
27
|
var jsxRuntime = require('react/jsx-runtime');
|
|
28
|
+
require('@transferwise/neptune-validation');
|
|
8
29
|
var useDirection = require('../common/hooks/useDirection/useDirection.js');
|
|
9
|
-
var
|
|
30
|
+
var Tooltip = require('../tooltip/Tooltip.js');
|
|
31
|
+
var deviceDetection = require('./deviceDetection.js');
|
|
10
32
|
|
|
11
33
|
function clamp(from, to, value) {
|
|
12
34
|
return Math.max(Math.min(to, value), from);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Stepper.js","sources":["../../src/stepper/Stepper.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport * as React from 'react';\n\nimport { Position } from '../common';\nimport { useDirection } from '../common/hooks';\nimport Tooltip from '../tooltip';\n\nimport { isTouchDevice } from './deviceDetection';\n\nfunction clamp(from: number, to: number, value: number) {\n return Math.max(Math.min(to, value), from);\n}\n\nexport interface Step {\n label: React.ReactNode;\n onClick?: () => void;\n hoverLabel?: React.ReactNode;\n}\n\nexport interface StepperProps {\n steps: readonly Step[];\n activeStep?: number;\n className?: string;\n}\n\n/**\n * This component is considered user-unfriendly and inaccessible on its own and will likely be made internal in the future. Please use `FlowNavigation` instead.\n * @see https://storybook.wise.design/?path=/story/navigation-flownavigation--variants\n */\nconst Stepper = ({ steps, activeStep = 0, className }: StepperProps) => {\n const { isRTL } = useDirection();\n\n if (steps.length === 0) {\n return null;\n }\n\n const activeStepIndex = clamp(0, steps.length - 1, activeStep);\n const stepPercentage = 1 / (steps.length - 1);\n const percentageCompleted = activeStepIndex / (steps.length - 1);\n\n const getProgressWidth = (): string => {\n if (percentageCompleted === 0) {\n return '0px';\n }\n /**\n * Progress bar starts with left/right (depends on rtl) shift `--progress-bar-start-shift` for hiding Progress bar's left and right borders\n * which are used for progress vertical delimiter.\n * When progress is completed, we need to add `--progress-bar-border-width` to the width to allow the right border be outside of the progress area.\n */\n return `calc(${percentageCompleted * 100}% + var(--progress-bar-start-shift) + var(--progress-bar-border-width))`;\n };\n\n const renderStep = (step: Step, index: number) => {\n const active = index === activeStepIndex;\n const clickable = step.onClick && !active;\n\n const labelButton = clickable ? (\n <button\n type=\"button\"\n className=\"btn-unstyled tw-stepper__step-label\"\n onClick={() => clickable && step.onClick?.()}\n >\n <small>{step.label}</small>\n </button>\n ) : (\n <span className=\"tw-stepper__step-label\">{step.label}</span>\n );\n\n return (\n <li\n key={index}\n className={clsx(\n 'hidden-xs',\n 'tw-stepper__step',\n active ? 'np-text-body-default-bold tw-stepper__step--active' : 'np-text-body-default',\n clickable && 'tw-stepper__step--clickable',\n step.hoverLabel && 'tw-stepper__step--has-tooltip',\n )}\n aria-current={active ? 'step' : false}\n style={\n isRTL\n ? { right: `${index * stepPercentage * 100}%` }\n : { left: `${index * stepPercentage * 100}%` }\n }\n >\n {step.hoverLabel && !isTouchDevice() ? (\n <Tooltip position={Position.BOTTOM} label={step.hoverLabel}>\n {labelButton}\n </Tooltip>\n ) : (\n labelButton\n )}\n </li>\n );\n };\n\n return (\n <div className={clsx('tw-stepper', className)}>\n <div className=\"progress\">\n <div className=\"progress-bar\" style={{ width: getProgressWidth() }} />\n </div>\n <ol className=\"tw-stepper-steps p-t-1 m-b-0\">{steps.map(renderStep)}</ol>\n </div>\n );\n};\n\nexport default Stepper;\n"],"names":["clamp","from","to","value","Math","max","min","Stepper","steps","activeStep","className","isRTL","useDirection","length","activeStepIndex","stepPercentage","percentageCompleted","getProgressWidth","renderStep","step","index","active","clickable","onClick","labelButton","_jsx","type","children","label","clsx","hoverLabel","style","right","left","isTouchDevice","Tooltip","position","Position","BOTTOM","_jsxs","width","map"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Stepper.js","sources":["../../src/stepper/Stepper.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport * as React from 'react';\n\nimport { Position } from '../common';\nimport { useDirection } from '../common/hooks';\nimport Tooltip from '../tooltip';\n\nimport { isTouchDevice } from './deviceDetection';\n\nfunction clamp(from: number, to: number, value: number) {\n return Math.max(Math.min(to, value), from);\n}\n\nexport interface Step {\n label: React.ReactNode;\n onClick?: () => void;\n hoverLabel?: React.ReactNode;\n}\n\nexport interface StepperProps {\n steps: readonly Step[];\n activeStep?: number;\n className?: string;\n}\n\n/**\n * This component is considered user-unfriendly and inaccessible on its own and will likely be made internal in the future. Please use `FlowNavigation` instead.\n * @see https://storybook.wise.design/?path=/story/navigation-flownavigation--variants\n */\nconst Stepper = ({ steps, activeStep = 0, className }: StepperProps) => {\n const { isRTL } = useDirection();\n\n if (steps.length === 0) {\n return null;\n }\n\n const activeStepIndex = clamp(0, steps.length - 1, activeStep);\n const stepPercentage = 1 / (steps.length - 1);\n const percentageCompleted = activeStepIndex / (steps.length - 1);\n\n const getProgressWidth = (): string => {\n if (percentageCompleted === 0) {\n return '0px';\n }\n /**\n * Progress bar starts with left/right (depends on rtl) shift `--progress-bar-start-shift` for hiding Progress bar's left and right borders\n * which are used for progress vertical delimiter.\n * When progress is completed, we need to add `--progress-bar-border-width` to the width to allow the right border be outside of the progress area.\n */\n return `calc(${percentageCompleted * 100}% + var(--progress-bar-start-shift) + var(--progress-bar-border-width))`;\n };\n\n const renderStep = (step: Step, index: number) => {\n const active = index === activeStepIndex;\n const clickable = step.onClick && !active;\n\n const labelButton = clickable ? (\n <button\n type=\"button\"\n className=\"btn-unstyled tw-stepper__step-label\"\n onClick={() => clickable && step.onClick?.()}\n >\n <small>{step.label}</small>\n </button>\n ) : (\n <span className=\"tw-stepper__step-label\">{step.label}</span>\n );\n\n return (\n <li\n key={index}\n className={clsx(\n 'hidden-xs',\n 'tw-stepper__step',\n active ? 'np-text-body-default-bold tw-stepper__step--active' : 'np-text-body-default',\n clickable && 'tw-stepper__step--clickable',\n step.hoverLabel && 'tw-stepper__step--has-tooltip',\n )}\n aria-current={active ? 'step' : false}\n style={\n isRTL\n ? { right: `${index * stepPercentage * 100}%` }\n : { left: `${index * stepPercentage * 100}%` }\n }\n >\n {step.hoverLabel && !isTouchDevice() ? (\n <Tooltip position={Position.BOTTOM} label={step.hoverLabel}>\n {labelButton}\n </Tooltip>\n ) : (\n labelButton\n )}\n </li>\n );\n };\n\n return (\n <div className={clsx('tw-stepper', className)}>\n <div className=\"progress\">\n <div className=\"progress-bar\" style={{ width: getProgressWidth() }} />\n </div>\n <ol className=\"tw-stepper-steps p-t-1 m-b-0\">{steps.map(renderStep)}</ol>\n </div>\n );\n};\n\nexport default Stepper;\n"],"names":["clamp","from","to","value","Math","max","min","Stepper","steps","activeStep","className","isRTL","useDirection","length","activeStepIndex","stepPercentage","percentageCompleted","getProgressWidth","renderStep","step","index","active","clickable","onClick","labelButton","_jsx","type","children","label","clsx","hoverLabel","style","right","left","isTouchDevice","Tooltip","position","Position","BOTTOM","_jsxs","width","map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,SAASA,KAAKA,CAACC,IAAY,EAAEC,EAAU,EAAEC,KAAa,EAAA;AACpD,EAAA,OAAOC,IAAI,CAACC,GAAG,CAACD,IAAI,CAACE,GAAG,CAACJ,EAAE,EAAEC,KAAK,CAAC,EAAEF,IAAI,CAAC,CAAA;AAC5C,CAAA;AAcA;;;AAGG;AACGM,MAAAA,OAAO,GAAGA,CAAC;EAAEC,KAAK;AAAEC,EAAAA,UAAU,GAAG,CAAC;AAAEC,EAAAA,SAAAA;AAAS,CAAgB,KAAI;EACrE,MAAM;AAAEC,IAAAA,KAAAA;GAAO,GAAGC,yBAAY,EAAE,CAAA;AAEhC,EAAA,IAAIJ,KAAK,CAACK,MAAM,KAAK,CAAC,EAAE;AACtB,IAAA,OAAO,IAAI,CAAA;AACb,GAAA;AAEA,EAAA,MAAMC,eAAe,GAAGd,KAAK,CAAC,CAAC,EAAEQ,KAAK,CAACK,MAAM,GAAG,CAAC,EAAEJ,UAAU,CAAC,CAAA;EAC9D,MAAMM,cAAc,GAA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|
2
2
|
import 'react';
|
|
3
|
-
import
|
|
4
|
-
import
|
|
3
|
+
import '../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 { Position } from '../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 '@transferwise/icons';
|
|
23
|
+
import 'react-intl';
|
|
24
|
+
import '../common/closeButton/CloseButton.messages.mjs';
|
|
5
25
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
26
|
+
import '@transferwise/neptune-validation';
|
|
6
27
|
import { useDirection } from '../common/hooks/useDirection/useDirection.mjs';
|
|
7
|
-
import
|
|
28
|
+
import Tooltip from '../tooltip/Tooltip.mjs';
|
|
29
|
+
import { isTouchDevice } from './deviceDetection.mjs';
|
|
8
30
|
|
|
9
31
|
function clamp(from, to, value) {
|
|
10
32
|
return Math.max(Math.min(to, value), from);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Stepper.mjs","sources":["../../src/stepper/Stepper.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport * as React from 'react';\n\nimport { Position } from '../common';\nimport { useDirection } from '../common/hooks';\nimport Tooltip from '../tooltip';\n\nimport { isTouchDevice } from './deviceDetection';\n\nfunction clamp(from: number, to: number, value: number) {\n return Math.max(Math.min(to, value), from);\n}\n\nexport interface Step {\n label: React.ReactNode;\n onClick?: () => void;\n hoverLabel?: React.ReactNode;\n}\n\nexport interface StepperProps {\n steps: readonly Step[];\n activeStep?: number;\n className?: string;\n}\n\n/**\n * This component is considered user-unfriendly and inaccessible on its own and will likely be made internal in the future. Please use `FlowNavigation` instead.\n * @see https://storybook.wise.design/?path=/story/navigation-flownavigation--variants\n */\nconst Stepper = ({ steps, activeStep = 0, className }: StepperProps) => {\n const { isRTL } = useDirection();\n\n if (steps.length === 0) {\n return null;\n }\n\n const activeStepIndex = clamp(0, steps.length - 1, activeStep);\n const stepPercentage = 1 / (steps.length - 1);\n const percentageCompleted = activeStepIndex / (steps.length - 1);\n\n const getProgressWidth = (): string => {\n if (percentageCompleted === 0) {\n return '0px';\n }\n /**\n * Progress bar starts with left/right (depends on rtl) shift `--progress-bar-start-shift` for hiding Progress bar's left and right borders\n * which are used for progress vertical delimiter.\n * When progress is completed, we need to add `--progress-bar-border-width` to the width to allow the right border be outside of the progress area.\n */\n return `calc(${percentageCompleted * 100}% + var(--progress-bar-start-shift) + var(--progress-bar-border-width))`;\n };\n\n const renderStep = (step: Step, index: number) => {\n const active = index === activeStepIndex;\n const clickable = step.onClick && !active;\n\n const labelButton = clickable ? (\n <button\n type=\"button\"\n className=\"btn-unstyled tw-stepper__step-label\"\n onClick={() => clickable && step.onClick?.()}\n >\n <small>{step.label}</small>\n </button>\n ) : (\n <span className=\"tw-stepper__step-label\">{step.label}</span>\n );\n\n return (\n <li\n key={index}\n className={clsx(\n 'hidden-xs',\n 'tw-stepper__step',\n active ? 'np-text-body-default-bold tw-stepper__step--active' : 'np-text-body-default',\n clickable && 'tw-stepper__step--clickable',\n step.hoverLabel && 'tw-stepper__step--has-tooltip',\n )}\n aria-current={active ? 'step' : false}\n style={\n isRTL\n ? { right: `${index * stepPercentage * 100}%` }\n : { left: `${index * stepPercentage * 100}%` }\n }\n >\n {step.hoverLabel && !isTouchDevice() ? (\n <Tooltip position={Position.BOTTOM} label={step.hoverLabel}>\n {labelButton}\n </Tooltip>\n ) : (\n labelButton\n )}\n </li>\n );\n };\n\n return (\n <div className={clsx('tw-stepper', className)}>\n <div className=\"progress\">\n <div className=\"progress-bar\" style={{ width: getProgressWidth() }} />\n </div>\n <ol className=\"tw-stepper-steps p-t-1 m-b-0\">{steps.map(renderStep)}</ol>\n </div>\n );\n};\n\nexport default Stepper;\n"],"names":["clamp","from","to","value","Math","max","min","Stepper","steps","activeStep","className","isRTL","useDirection","length","activeStepIndex","stepPercentage","percentageCompleted","getProgressWidth","renderStep","step","index","active","clickable","onClick","labelButton","_jsx","type","children","label","clsx","hoverLabel","style","right","left","isTouchDevice","Tooltip","position","Position","BOTTOM","_jsxs","width","map"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Stepper.mjs","sources":["../../src/stepper/Stepper.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport * as React from 'react';\n\nimport { Position } from '../common';\nimport { useDirection } from '../common/hooks';\nimport Tooltip from '../tooltip';\n\nimport { isTouchDevice } from './deviceDetection';\n\nfunction clamp(from: number, to: number, value: number) {\n return Math.max(Math.min(to, value), from);\n}\n\nexport interface Step {\n label: React.ReactNode;\n onClick?: () => void;\n hoverLabel?: React.ReactNode;\n}\n\nexport interface StepperProps {\n steps: readonly Step[];\n activeStep?: number;\n className?: string;\n}\n\n/**\n * This component is considered user-unfriendly and inaccessible on its own and will likely be made internal in the future. Please use `FlowNavigation` instead.\n * @see https://storybook.wise.design/?path=/story/navigation-flownavigation--variants\n */\nconst Stepper = ({ steps, activeStep = 0, className }: StepperProps) => {\n const { isRTL } = useDirection();\n\n if (steps.length === 0) {\n return null;\n }\n\n const activeStepIndex = clamp(0, steps.length - 1, activeStep);\n const stepPercentage = 1 / (steps.length - 1);\n const percentageCompleted = activeStepIndex / (steps.length - 1);\n\n const getProgressWidth = (): string => {\n if (percentageCompleted === 0) {\n return '0px';\n }\n /**\n * Progress bar starts with left/right (depends on rtl) shift `--progress-bar-start-shift` for hiding Progress bar's left and right borders\n * which are used for progress vertical delimiter.\n * When progress is completed, we need to add `--progress-bar-border-width` to the width to allow the right border be outside of the progress area.\n */\n return `calc(${percentageCompleted * 100}% + var(--progress-bar-start-shift) + var(--progress-bar-border-width))`;\n };\n\n const renderStep = (step: Step, index: number) => {\n const active = index === activeStepIndex;\n const clickable = step.onClick && !active;\n\n const labelButton = clickable ? (\n <button\n type=\"button\"\n className=\"btn-unstyled tw-stepper__step-label\"\n onClick={() => clickable && step.onClick?.()}\n >\n <small>{step.label}</small>\n </button>\n ) : (\n <span className=\"tw-stepper__step-label\">{step.label}</span>\n );\n\n return (\n <li\n key={index}\n className={clsx(\n 'hidden-xs',\n 'tw-stepper__step',\n active ? 'np-text-body-default-bold tw-stepper__step--active' : 'np-text-body-default',\n clickable && 'tw-stepper__step--clickable',\n step.hoverLabel && 'tw-stepper__step--has-tooltip',\n )}\n aria-current={active ? 'step' : false}\n style={\n isRTL\n ? { right: `${index * stepPercentage * 100}%` }\n : { left: `${index * stepPercentage * 100}%` }\n }\n >\n {step.hoverLabel && !isTouchDevice() ? (\n <Tooltip position={Position.BOTTOM} label={step.hoverLabel}>\n {labelButton}\n </Tooltip>\n ) : (\n labelButton\n )}\n </li>\n );\n };\n\n return (\n <div className={clsx('tw-stepper', className)}>\n <div className=\"progress\">\n <div className=\"progress-bar\" style={{ width: getProgressWidth() }} />\n </div>\n <ol className=\"tw-stepper-steps p-t-1 m-b-0\">{steps.map(renderStep)}</ol>\n </div>\n );\n};\n\nexport default Stepper;\n"],"names":["clamp","from","to","value","Math","max","min","Stepper","steps","activeStep","className","isRTL","useDirection","length","activeStepIndex","stepPercentage","percentageCompleted","getProgressWidth","renderStep","step","index","active","clickable","onClick","labelButton","_jsx","type","children","label","clsx","hoverLabel","style","right","left","isTouchDevice","Tooltip","position","Position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WAAAA;AACD,KAAA,EArBIJ,KAsBH,CAAC,CAAA;GAER,CAAA;AAED,EAAA,oBACEmB,IAAA,CAAA,KAAA,EAAA;AAAK7B,IAAAA,SAAS,EAAEmB,IAAI,CAAC,YAAY,EAAEnB,SAAS,CAAE;AAAAiB,IAAAA,QAAA,gBAC5CF,GAAA,CAAA,KAAA,EAAA;AAAKf,MAAAA,SAAS,EAAC,UAAU;AAAAiB,MAAAA,QAAA,eACvBF,GAAA,CAAA,KAAA,EAAA;AAAKf,QAAAA,SAAS,EAAC,cAAc;AAACqB,QAAAA,KAAK,EAAE;UAAES,KAAK,EAAEvB,gBAAgB,EAAE;AAAA,SAAA;OAClE,CAAA;KAAK,CACL,eAAAQ,GAAA,CAAA,IAAA,EAAA;AAAIf,MAAAA,SAAS,EAAC,8BAA8B;AAAAiB,MAAAA,QAAA,EAAEnB,KAAK,CAACiC,GAAG,CAACvB,UAAU,CAAA;AAAC,KAAK,CAC1E,CAAA;AAAA,GAAK,CAAC,CAAA;AAEV;;;;"}
|
|
@@ -3,14 +3,13 @@
|
|
|
3
3
|
function supportsTouchEvents() {
|
|
4
4
|
const onTouchStartIsDefined = typeof window !== 'undefined' && window.ontouchstart !== undefined;
|
|
5
5
|
const maxTouchPointsIsDefined = typeof navigator !== 'undefined' && navigator.maxTouchPoints;
|
|
6
|
-
|
|
7
|
-
return !!(onTouchStartIsDefined || maxTouchPointsIsDefined || documentTouchIsDefined);
|
|
6
|
+
return !!(onTouchStartIsDefined || maxTouchPointsIsDefined);
|
|
8
7
|
}
|
|
9
8
|
function userAgentSuggestsTouchDevice() {
|
|
10
9
|
const sampleTouchDevices = ['android', 'iemobile', 'iphone', 'ipad', 'ipod', 'blackberry', 'bada'];
|
|
11
10
|
const matchString = sampleTouchDevices.map(device => `(${device})`).join('|');
|
|
12
11
|
const regex = new RegExp(matchString, 'gi');
|
|
13
|
-
return typeof navigator !== 'undefined' && !!navigator.userAgent
|
|
12
|
+
return typeof navigator !== 'undefined' && !!regex.test(navigator.userAgent);
|
|
14
13
|
}
|
|
15
14
|
// Important: this is not fool-proof! It gives false positives and negatives, and will be outdated.
|
|
16
15
|
// Only use this for small vanity changes where it still works either way.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deviceDetection.js","sources":["../../src/stepper/deviceDetection.
|
|
1
|
+
{"version":3,"file":"deviceDetection.js","sources":["../../src/stepper/deviceDetection.ts"],"sourcesContent":["function supportsTouchEvents() {\n const onTouchStartIsDefined = typeof window !== 'undefined' && window.ontouchstart !== undefined;\n const maxTouchPointsIsDefined = typeof navigator !== 'undefined' && navigator.maxTouchPoints;\n\n return !!(onTouchStartIsDefined || maxTouchPointsIsDefined);\n}\n\nfunction userAgentSuggestsTouchDevice() {\n const sampleTouchDevices = [\n 'android',\n 'iemobile',\n 'iphone',\n 'ipad',\n 'ipod',\n 'blackberry',\n 'bada',\n ];\n const matchString = sampleTouchDevices.map((device) => `(${device})`).join('|');\n const regex = new RegExp(matchString, 'gi');\n return typeof navigator !== 'undefined' && !!regex.test(navigator.userAgent);\n}\n// Important: this is not fool-proof! It gives false positives and negatives, and will be outdated.\n// Only use this for small vanity changes where it still works either way.\nexport function isTouchDevice() {\n return supportsTouchEvents() || userAgentSuggestsTouchDevice();\n}\n"],"names":["supportsTouchEvents","onTouchStartIsDefined","window","ontouchstart","undefined","maxTouchPointsIsDefined","navigator","maxTouchPoints","userAgentSuggestsTouchDevice","sampleTouchDevices","matchString","map","device","join","regex","RegExp","test","userAgent","isTouchDevice"],"mappings":";;AAAA,SAASA,mBAAmBA,GAAA;EAC1B,MAAMC,qBAAqB,GAAG,OAAOC,MAAM,KAAK,WAAW,IAAIA,MAAM,CAACC,YAAY,KAAKC,SAAS,CAAA;EAChG,MAAMC,uBAAuB,GAAG,OAAOC,SAAS,KAAK,WAAW,IAAIA,SAAS,CAACC,cAAc,CAAA;AAE5F,EAAA,OAAO,CAAC,EAAEN,qBAAqB,IAAII,uBAAuB,CAAC,CAAA;AAC7D,CAAA;AAEA,SAASG,4BAA4BA,GAAA;AACnC,EAAA,MAAMC,kBAAkB,GAAG,CACzB,SAAS,EACT,UAAU,EACV,QAAQ,EACR,MAAM,EACN,MAAM,EACN,YAAY,EACZ,MAAM,CACP,CAAA;AACD,EAAA,MAAMC,WAAW,GAAGD,kBAAkB,CAACE,GAAG,CAAEC,MAAM,IAAK,CAAIA,CAAAA,EAAAA,MAAM,GAAG,CAAC,CAACC,IAAI,CAAC,GAAG,CAAC,CAAA;EAC/E,MAAMC,KAAK,GAAG,IAAIC,MAAM,CAACL,WAAW,EAAE,IAAI,CAAC,CAAA;AAC3C,EAAA,OAAO,OAAOJ,SAAS,KAAK,WAAW,IAAI,CAAC,CAACQ,KAAK,CAACE,IAAI,CAACV,SAAS,CAACW,SAAS,CAAC,CAAA;AAC9E,CAAA;AACA;AACA;SACgBC,aAAaA,GAAA;AAC3B,EAAA,OAAOlB,mBAAmB,EAAE,IAAIQ,4BAA4B,EAAE,CAAA;AAChE;;;;"}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
function supportsTouchEvents() {
|
|
2
2
|
const onTouchStartIsDefined = typeof window !== 'undefined' && window.ontouchstart !== undefined;
|
|
3
3
|
const maxTouchPointsIsDefined = typeof navigator !== 'undefined' && navigator.maxTouchPoints;
|
|
4
|
-
|
|
5
|
-
return !!(onTouchStartIsDefined || maxTouchPointsIsDefined || documentTouchIsDefined);
|
|
4
|
+
return !!(onTouchStartIsDefined || maxTouchPointsIsDefined);
|
|
6
5
|
}
|
|
7
6
|
function userAgentSuggestsTouchDevice() {
|
|
8
7
|
const sampleTouchDevices = ['android', 'iemobile', 'iphone', 'ipad', 'ipod', 'blackberry', 'bada'];
|
|
9
8
|
const matchString = sampleTouchDevices.map(device => `(${device})`).join('|');
|
|
10
9
|
const regex = new RegExp(matchString, 'gi');
|
|
11
|
-
return typeof navigator !== 'undefined' && !!navigator.userAgent
|
|
10
|
+
return typeof navigator !== 'undefined' && !!regex.test(navigator.userAgent);
|
|
12
11
|
}
|
|
13
12
|
// Important: this is not fool-proof! It gives false positives and negatives, and will be outdated.
|
|
14
13
|
// Only use this for small vanity changes where it still works either way.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deviceDetection.mjs","sources":["../../src/stepper/deviceDetection.
|
|
1
|
+
{"version":3,"file":"deviceDetection.mjs","sources":["../../src/stepper/deviceDetection.ts"],"sourcesContent":["function supportsTouchEvents() {\n const onTouchStartIsDefined = typeof window !== 'undefined' && window.ontouchstart !== undefined;\n const maxTouchPointsIsDefined = typeof navigator !== 'undefined' && navigator.maxTouchPoints;\n\n return !!(onTouchStartIsDefined || maxTouchPointsIsDefined);\n}\n\nfunction userAgentSuggestsTouchDevice() {\n const sampleTouchDevices = [\n 'android',\n 'iemobile',\n 'iphone',\n 'ipad',\n 'ipod',\n 'blackberry',\n 'bada',\n ];\n const matchString = sampleTouchDevices.map((device) => `(${device})`).join('|');\n const regex = new RegExp(matchString, 'gi');\n return typeof navigator !== 'undefined' && !!regex.test(navigator.userAgent);\n}\n// Important: this is not fool-proof! It gives false positives and negatives, and will be outdated.\n// Only use this for small vanity changes where it still works either way.\nexport function isTouchDevice() {\n return supportsTouchEvents() || userAgentSuggestsTouchDevice();\n}\n"],"names":["supportsTouchEvents","onTouchStartIsDefined","window","ontouchstart","undefined","maxTouchPointsIsDefined","navigator","maxTouchPoints","userAgentSuggestsTouchDevice","sampleTouchDevices","matchString","map","device","join","regex","RegExp","test","userAgent","isTouchDevice"],"mappings":"AAAA,SAASA,mBAAmBA,GAAA;EAC1B,MAAMC,qBAAqB,GAAG,OAAOC,MAAM,KAAK,WAAW,IAAIA,MAAM,CAACC,YAAY,KAAKC,SAAS,CAAA;EAChG,MAAMC,uBAAuB,GAAG,OAAOC,SAAS,KAAK,WAAW,IAAIA,SAAS,CAACC,cAAc,CAAA;AAE5F,EAAA,OAAO,CAAC,EAAEN,qBAAqB,IAAII,uBAAuB,CAAC,CAAA;AAC7D,CAAA;AAEA,SAASG,4BAA4BA,GAAA;AACnC,EAAA,MAAMC,kBAAkB,GAAG,CACzB,SAAS,EACT,UAAU,EACV,QAAQ,EACR,MAAM,EACN,MAAM,EACN,YAAY,EACZ,MAAM,CACP,CAAA;AACD,EAAA,MAAMC,WAAW,GAAGD,kBAAkB,CAACE,GAAG,CAAEC,MAAM,IAAK,CAAIA,CAAAA,EAAAA,MAAM,GAAG,CAAC,CAACC,IAAI,CAAC,GAAG,CAAC,CAAA;EAC/E,MAAMC,KAAK,GAAG,IAAIC,MAAM,CAACL,WAAW,EAAE,IAAI,CAAC,CAAA;AAC3C,EAAA,OAAO,OAAOJ,SAAS,KAAK,WAAW,IAAI,CAAC,CAACQ,KAAK,CAACE,IAAI,CAACV,SAAS,CAACW,SAAS,CAAC,CAAA;AAC9E,CAAA;AACA;AACA;SACgBC,aAAaA,GAAA;AAC3B,EAAA,OAAOlB,mBAAmB,EAAE,IAAIQ,4BAA4B,EAAE,CAAA;AAChE;;;;"}
|
package/build/sticky/Sticky.js
CHANGED
|
@@ -1,8 +1,31 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
require('../common/theme.js');
|
|
4
|
+
require('../common/direction.js');
|
|
5
|
+
require('../common/propsValues/control.js');
|
|
6
|
+
require('../common/propsValues/breakpoint.js');
|
|
7
|
+
require('../common/propsValues/size.js');
|
|
8
|
+
require('../common/propsValues/typography.js');
|
|
9
|
+
require('../common/propsValues/width.js');
|
|
10
|
+
require('../common/propsValues/type.js');
|
|
11
|
+
require('../common/propsValues/dateMode.js');
|
|
12
|
+
require('../common/propsValues/monthFormat.js');
|
|
5
13
|
var position = require('../common/propsValues/position.js');
|
|
14
|
+
require('../common/propsValues/layouts.js');
|
|
15
|
+
require('../common/propsValues/status.js');
|
|
16
|
+
require('../common/propsValues/sentiment.js');
|
|
17
|
+
require('../common/propsValues/profileType.js');
|
|
18
|
+
require('../common/propsValues/variant.js');
|
|
19
|
+
require('../common/propsValues/scroll.js');
|
|
20
|
+
require('../common/propsValues/markdownNodeType.js');
|
|
21
|
+
require('../common/fileType.js');
|
|
22
|
+
require('@transferwise/icons');
|
|
23
|
+
require('clsx');
|
|
24
|
+
require('react');
|
|
25
|
+
require('react-intl');
|
|
26
|
+
require('../common/closeButton/CloseButton.messages.js');
|
|
27
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
28
|
+
var SlidingPanel = require('../slidingPanel/SlidingPanel.js');
|
|
6
29
|
|
|
7
30
|
const Sticky = ({
|
|
8
31
|
children,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sticky.js","sources":["../../src/sticky/Sticky.tsx"],"sourcesContent":["import { Position } from '../common';\nimport SlidingPanel from '../slidingPanel';\nimport { FunctionComponent } from 'react';\n\nexport interface StickyProps {\n /** Optional prop for children components to be rendered inside the Sticky component. */\n children?: React.ReactNode;\n\n /** Optional props that determines if the Sticky component is open or closed. Default value is `true`. */\n open?: boolean;\n\n /** Optional props that specifies the position of the Sticky component on the screen. Can be either `top` or `bottom`. */\n position?: `${Position.TOP}` | `${Position.BOTTOM}`;\n\n /** Optional prop to specify the ID used for testing */\n testId?: string;\n}\n\n/**\n * ### Sticky Component\n *\n * `<Sticky />` is a component that renders a `<SlidingPanel />` with specified props.\n * It uses the `<SlidingPanel />` component to create a panel that can slide in and out of view,\n * based on the `open` prop. It can be positioned at the top or bottom of the container,\n * as specified by the `position` prop.\n *\n * @component\n * @param {ReactNode} children - Children content.\n * @param {boolean} open - Determines if the Sticky component is open or closed.\n * @param {('top'|'bottom')} position - Specifies the position.\n * @param {string} testId - ID used for testing.\n * @returns {React.JSX.Element} The `SlidingPanel` component with applied props.\n * @example\n * <Button onClick={() => setOpen(!open)}>Open Sticky</Button>\n * <Sticky open={open} position={'bottom'}>\n * <div>\n * <Button onClick={() => setOpen(!open)}>Close Sticky</Button>\n * </div>\n * </Sticky>\n */\nconst Sticky: FunctionComponent<StickyProps> = ({\n children,\n open = true,\n position = Position.BOTTOM,\n testId,\n}: StickyProps) => {\n return (\n <SlidingPanel\n testId={testId}\n open={open}\n position={position}\n slidingPanelPositionFixed\n showSlidingPanelBorder\n >\n {children}\n </SlidingPanel>\n );\n};\n\nexport default Sticky;\n"],"names":["Sticky","children","open","position","Position","BOTTOM","testId","_jsx","SlidingPanel","slidingPanelPositionFixed","showSlidingPanelBorder"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Sticky.js","sources":["../../src/sticky/Sticky.tsx"],"sourcesContent":["import { Position } from '../common';\nimport SlidingPanel from '../slidingPanel';\nimport { FunctionComponent } from 'react';\n\nexport interface StickyProps {\n /** Optional prop for children components to be rendered inside the Sticky component. */\n children?: React.ReactNode;\n\n /** Optional props that determines if the Sticky component is open or closed. Default value is `true`. */\n open?: boolean;\n\n /** Optional props that specifies the position of the Sticky component on the screen. Can be either `top` or `bottom`. */\n position?: `${Position.TOP}` | `${Position.BOTTOM}`;\n\n /** Optional prop to specify the ID used for testing */\n testId?: string;\n}\n\n/**\n * ### Sticky Component\n *\n * `<Sticky />` is a component that renders a `<SlidingPanel />` with specified props.\n * It uses the `<SlidingPanel />` component to create a panel that can slide in and out of view,\n * based on the `open` prop. It can be positioned at the top or bottom of the container,\n * as specified by the `position` prop.\n *\n * @component\n * @param {ReactNode} children - Children content.\n * @param {boolean} open - Determines if the Sticky component is open or closed.\n * @param {('top'|'bottom')} position - Specifies the position.\n * @param {string} testId - ID used for testing.\n * @returns {React.JSX.Element} The `SlidingPanel` component with applied props.\n * @example\n * <Button onClick={() => setOpen(!open)}>Open Sticky</Button>\n * <Sticky open={open} position={'bottom'}>\n * <div>\n * <Button onClick={() => setOpen(!open)}>Close Sticky</Button>\n * </div>\n * </Sticky>\n */\nconst Sticky: FunctionComponent<StickyProps> = ({\n children,\n open = true,\n position = Position.BOTTOM,\n testId,\n}: StickyProps) => {\n return (\n <SlidingPanel\n testId={testId}\n open={open}\n position={position}\n slidingPanelPositionFixed\n showSlidingPanelBorder\n >\n {children}\n </SlidingPanel>\n );\n};\n\nexport default Sticky;\n"],"names":["Sticky","children","open","position","Position","BOTTOM","testId","_jsx","SlidingPanel","slidingPanelPositionFixed","showSlidingPanelBorder"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCMA,MAAAA,MAAM,GAAmCA,CAAC;EAC9CC,QAAQ;AACRC,EAAAA,IAAI,GAAG,IAAI;YACXC,UAAQ,GAAGC,iBAAQ,CAACC,MAAM;AAC1BC,EAAAA,MAAAA;AAAM,CACM,KAAI;EAChB,oBACEC,cAAA,CAACC,oBAAY,EAAA;AACXF,IAAAA,MAAM,EAAEA,MAAO;AACfJ,IAAAA,IAAI,EAAEA,IAAK;AACXC,IAAAA,QAAQ,EAAEA,UAAS;IACnBM,yBAAyB,EAAA,IAAA;IACzBC,sBAAsB,EAAA,IAAA;AAAAT,IAAAA,QAAA,EAErBA,QAAAA;AAAQ,GACG,CAAC,CAAA;AAEnB;;;;"}
|
package/build/sticky/Sticky.mjs
CHANGED
|
@@ -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';
|
|
3
11
|
import { Position } from '../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';
|
|
18
|
+
import '../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 SlidingPanel from '../slidingPanel/SlidingPanel.mjs';
|
|
4
27
|
|
|
5
28
|
const Sticky = ({
|
|
6
29
|
children,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sticky.mjs","sources":["../../src/sticky/Sticky.tsx"],"sourcesContent":["import { Position } from '../common';\nimport SlidingPanel from '../slidingPanel';\nimport { FunctionComponent } from 'react';\n\nexport interface StickyProps {\n /** Optional prop for children components to be rendered inside the Sticky component. */\n children?: React.ReactNode;\n\n /** Optional props that determines if the Sticky component is open or closed. Default value is `true`. */\n open?: boolean;\n\n /** Optional props that specifies the position of the Sticky component on the screen. Can be either `top` or `bottom`. */\n position?: `${Position.TOP}` | `${Position.BOTTOM}`;\n\n /** Optional prop to specify the ID used for testing */\n testId?: string;\n}\n\n/**\n * ### Sticky Component\n *\n * `<Sticky />` is a component that renders a `<SlidingPanel />` with specified props.\n * It uses the `<SlidingPanel />` component to create a panel that can slide in and out of view,\n * based on the `open` prop. It can be positioned at the top or bottom of the container,\n * as specified by the `position` prop.\n *\n * @component\n * @param {ReactNode} children - Children content.\n * @param {boolean} open - Determines if the Sticky component is open or closed.\n * @param {('top'|'bottom')} position - Specifies the position.\n * @param {string} testId - ID used for testing.\n * @returns {React.JSX.Element} The `SlidingPanel` component with applied props.\n * @example\n * <Button onClick={() => setOpen(!open)}>Open Sticky</Button>\n * <Sticky open={open} position={'bottom'}>\n * <div>\n * <Button onClick={() => setOpen(!open)}>Close Sticky</Button>\n * </div>\n * </Sticky>\n */\nconst Sticky: FunctionComponent<StickyProps> = ({\n children,\n open = true,\n position = Position.BOTTOM,\n testId,\n}: StickyProps) => {\n return (\n <SlidingPanel\n testId={testId}\n open={open}\n position={position}\n slidingPanelPositionFixed\n showSlidingPanelBorder\n >\n {children}\n </SlidingPanel>\n );\n};\n\nexport default Sticky;\n"],"names":["Sticky","children","open","position","Position","BOTTOM","testId","_jsx","SlidingPanel","slidingPanelPositionFixed","showSlidingPanelBorder"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Sticky.mjs","sources":["../../src/sticky/Sticky.tsx"],"sourcesContent":["import { Position } from '../common';\nimport SlidingPanel from '../slidingPanel';\nimport { FunctionComponent } from 'react';\n\nexport interface StickyProps {\n /** Optional prop for children components to be rendered inside the Sticky component. */\n children?: React.ReactNode;\n\n /** Optional props that determines if the Sticky component is open or closed. Default value is `true`. */\n open?: boolean;\n\n /** Optional props that specifies the position of the Sticky component on the screen. Can be either `top` or `bottom`. */\n position?: `${Position.TOP}` | `${Position.BOTTOM}`;\n\n /** Optional prop to specify the ID used for testing */\n testId?: string;\n}\n\n/**\n * ### Sticky Component\n *\n * `<Sticky />` is a component that renders a `<SlidingPanel />` with specified props.\n * It uses the `<SlidingPanel />` component to create a panel that can slide in and out of view,\n * based on the `open` prop. It can be positioned at the top or bottom of the container,\n * as specified by the `position` prop.\n *\n * @component\n * @param {ReactNode} children - Children content.\n * @param {boolean} open - Determines if the Sticky component is open or closed.\n * @param {('top'|'bottom')} position - Specifies the position.\n * @param {string} testId - ID used for testing.\n * @returns {React.JSX.Element} The `SlidingPanel` component with applied props.\n * @example\n * <Button onClick={() => setOpen(!open)}>Open Sticky</Button>\n * <Sticky open={open} position={'bottom'}>\n * <div>\n * <Button onClick={() => setOpen(!open)}>Close Sticky</Button>\n * </div>\n * </Sticky>\n */\nconst Sticky: FunctionComponent<StickyProps> = ({\n children,\n open = true,\n position = Position.BOTTOM,\n testId,\n}: StickyProps) => {\n return (\n <SlidingPanel\n testId={testId}\n open={open}\n position={position}\n slidingPanelPositionFixed\n showSlidingPanelBorder\n >\n {children}\n </SlidingPanel>\n );\n};\n\nexport default Sticky;\n"],"names":["Sticky","children","open","position","Position","BOTTOM","testId","_jsx","SlidingPanel","slidingPanelPositionFixed","showSlidingPanelBorder"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCMA,MAAAA,MAAM,GAAmCA,CAAC;EAC9CC,QAAQ;AACRC,EAAAA,IAAI,GAAG,IAAI;EACXC,QAAQ,GAAGC,QAAQ,CAACC,MAAM;AAC1BC,EAAAA,MAAAA;AAAM,CACM,KAAI;EAChB,oBACEC,GAAA,CAACC,YAAY,EAAA;AACXF,IAAAA,MAAM,EAAEA,MAAO;AACfJ,IAAAA,IAAI,EAAEA,IAAK;AACXC,IAAAA,QAAQ,EAAEA,QAAS;IACnBM,yBAAyB,EAAA,IAAA;IACzBC,sBAAsB,EAAA,IAAA;AAAAT,IAAAA,QAAA,EAErBA,QAAAA;AAAQ,GACG,CAAC,CAAA;AAEnB;;;;"}
|
package/build/summary/Summary.js
CHANGED
|
@@ -5,16 +5,32 @@ var clsx = require('clsx');
|
|
|
5
5
|
var React = require('react');
|
|
6
6
|
var reactIntl = require('react-intl');
|
|
7
7
|
var Body = require('../body/Body.js');
|
|
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
|
+
var typography = 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
|
+
var status = require('../common/propsValues/status.js');
|
|
21
|
+
var sentiment = require('../common/propsValues/sentiment.js');
|
|
22
|
+
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');
|
|
27
|
+
require('../common/closeButton/CloseButton.messages.js');
|
|
28
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
8
29
|
require('../info/infoPresentations.js');
|
|
9
30
|
var Info = require('../info/Info.js');
|
|
10
31
|
var StatusIcon = require('../statusIcon/StatusIcon.js');
|
|
11
32
|
var Summary_messages = require('./Summary.messages.js');
|
|
12
33
|
var Action = require('../common/action/Action.js');
|
|
13
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
14
|
-
var sentiment = require('../common/propsValues/sentiment.js');
|
|
15
|
-
var status = require('../common/propsValues/status.js');
|
|
16
|
-
var size = require('../common/propsValues/size.js');
|
|
17
|
-
var typography = require('../common/propsValues/typography.js');
|
|
18
34
|
|
|
19
35
|
/* eslint-disable @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment */
|
|
20
36
|
const BadgeIcons = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Summary.js","sources":["../../src/summary/Summary.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment */\nimport {\n CheckCircleFill as CheckCircleIcon,\n ClockFill as PendingCircleIcon,\n} from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport { ElementType, cloneElement, ReactNode } from 'react';\nimport { useIntl } from 'react-intl';\n\nimport Body from '../body';\nimport {\n Status,\n StatusDone,\n StatusNotDone,\n StatusPending,\n Size,\n Typography,\n Sentiment,\n} from '../common';\nimport Info, { InfoProps } from '../info';\nimport StatusIcon from '../statusIcon';\n\nimport messages from './Summary.messages';\nimport { Action, ActionOptions } from '../common/action/Action';\n\nconst BadgeIcons = {\n [Status.DONE]: CheckCircleIcon,\n [Status.PENDING]: PendingCircleIcon,\n};\n\nconst statusLabels = {\n [Status.NOT_DONE]: 'statusNotDone',\n [Status.DONE]: 'statusDone',\n [Status.PENDING]: 'statusPending',\n};\n\nconst statusMapping = {\n [Status.DONE]: Sentiment.POSITIVE,\n [Status.PENDING]: Sentiment.PENDING,\n};\n\nexport interface Props {\n /**\n * Action displayed at the bottom of the Summary\n */\n action?: ActionOptions;\n /**\n * Decides which html element should wrap the Summary\n */\n as?: ElementType;\n /**\n * Extra classes applied to Summary\n */\n className?: string;\n /**\n * @deprecated please use description instead\n */\n content?: ReactNode;\n /**\n * Summary description\n */\n description?: ReactNode;\n /**\n * @deprecated please use info instead\n */\n help?: {\n content: ReactNode;\n title?: ReactNode;\n };\n /**\n * Infos displayed on help Icon click inside Popover or Modal\n */\n info?: Pick<InfoProps, 'aria-label' | 'content' | 'onClick' | 'presentation' | 'title'>;\n /**\n * @deprecated please use icon instead\n */\n illustration?: ReactNode;\n /**\n * Main Summary Icon\n */\n icon?: ReactNode;\n /**\n * Decides the badge applied to Icon\n */\n status?: StatusNotDone | StatusDone | StatusPending;\n /**\n * Summary title\n */\n title: ReactNode;\n}\n\nconst Summary = ({\n action,\n as: Element = 'div',\n className,\n content = null,\n description = content,\n help,\n icon,\n illustration = null,\n info = help,\n status,\n title,\n}: Props) => {\n const intl = useIntl();\n\n let media = illustration;\n if (icon) {\n // @ts-expect-error if icon is present it has props and size prop\n const iconSize = icon?.props?.size as number;\n\n media =\n iconSize !== 24\n ? // @ts-expect-error we need icon to adjust it's size\n cloneElement(icon, { size: 24 })\n : icon;\n }\n // @ts-expect-error Badge can be null, this is handled in code\n const Badge = status && BadgeIcons[status];\n\n return (\n <Element\n className={clsx('np-summary d-flex align-items-start', className)}\n // @ts-expect-error we check whether `status` is not null before index `statusLabels` and `messages`\n aria-label={status && intl.formatMessage(messages[statusLabels[status]])}\n >\n <div className=\"np-summary__icon\">\n {media}\n {Badge && (\n <div>\n {/* @ts-expect-error it's okey to pass `undefined` into `sentiment` prop */}\n <StatusIcon size={Size.SMALL} sentiment={statusMapping[status]} />\n </div>\n )}\n </div>\n <div className=\"np-summary__body m-l-2\">\n <div className=\"np-summary__title d-flex\">\n <Body\n as=\"span\"\n role=\"heading\"\n aria-level={6}\n type={Typography.BODY_LARGE_BOLD}\n className=\"text-primary m-b-1\"\n >\n {title}\n </Body>\n {info && (\n <Info\n aria-label={info['aria-label']}\n className=\"m-l-1 hidden-xs\"\n content={info.content}\n presentation={info.presentation}\n size={Size.LARGE}\n title={info.title}\n onClick={info.onClick}\n />\n )}\n </div>\n\n {description && (\n <Body\n as=\"span\"\n type={Typography.BODY_DEFAULT}\n className=\"d-block np-summary__description\"\n >\n {description}\n </Body>\n )}\n {action && <Action action={action} className=\"np-summary__action\" />}\n </div>\n {info && (\n <Info\n aria-label={info['aria-label']}\n className=\"m-l-2 hidden-sm hidden-md hidden-lg hidden-xl\"\n content={info.content}\n presentation={info.presentation}\n size={Size.LARGE}\n title={info.title}\n onClick={info.onClick}\n />\n )}\n </Element>\n );\n};\n\nexport default Summary;\n"],"names":["BadgeIcons","Status","DONE","CheckCircleIcon","PENDING","PendingCircleIcon","statusLabels","NOT_DONE","statusMapping","Sentiment","POSITIVE","Summary","action","as","Element","className","content","description","help","icon","illustration","info","status","title","intl","useIntl","media","iconSize","props","size","cloneElement","Badge","_jsxs","clsx","formatMessage","messages","children","_jsx","StatusIcon","Size","SMALL","sentiment","Body","role","type","Typography","BODY_LARGE_BOLD","Info","presentation","LARGE","onClick","BODY_DEFAULT","Action"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Summary.js","sources":["../../src/summary/Summary.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment */\nimport {\n CheckCircleFill as CheckCircleIcon,\n ClockFill as PendingCircleIcon,\n} from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport { ElementType, cloneElement, ReactNode } from 'react';\nimport { useIntl } from 'react-intl';\n\nimport Body from '../body';\nimport {\n Status,\n StatusDone,\n StatusNotDone,\n StatusPending,\n Size,\n Typography,\n Sentiment,\n} from '../common';\nimport Info, { InfoProps } from '../info';\nimport StatusIcon from '../statusIcon';\n\nimport messages from './Summary.messages';\nimport { Action, ActionOptions } from '../common/action/Action';\n\nconst BadgeIcons = {\n [Status.DONE]: CheckCircleIcon,\n [Status.PENDING]: PendingCircleIcon,\n};\n\nconst statusLabels = {\n [Status.NOT_DONE]: 'statusNotDone',\n [Status.DONE]: 'statusDone',\n [Status.PENDING]: 'statusPending',\n};\n\nconst statusMapping = {\n [Status.DONE]: Sentiment.POSITIVE,\n [Status.PENDING]: Sentiment.PENDING,\n};\n\nexport interface Props {\n /**\n * Action displayed at the bottom of the Summary\n */\n action?: ActionOptions;\n /**\n * Decides which html element should wrap the Summary\n */\n as?: ElementType;\n /**\n * Extra classes applied to Summary\n */\n className?: string;\n /**\n * @deprecated please use description instead\n */\n content?: ReactNode;\n /**\n * Summary description\n */\n description?: ReactNode;\n /**\n * @deprecated please use info instead\n */\n help?: {\n content: ReactNode;\n title?: ReactNode;\n };\n /**\n * Infos displayed on help Icon click inside Popover or Modal\n */\n info?: Pick<InfoProps, 'aria-label' | 'content' | 'onClick' | 'presentation' | 'title'>;\n /**\n * @deprecated please use icon instead\n */\n illustration?: ReactNode;\n /**\n * Main Summary Icon\n */\n icon?: ReactNode;\n /**\n * Decides the badge applied to Icon\n */\n status?: StatusNotDone | StatusDone | StatusPending;\n /**\n * Summary title\n */\n title: ReactNode;\n}\n\nconst Summary = ({\n action,\n as: Element = 'div',\n className,\n content = null,\n description = content,\n help,\n icon,\n illustration = null,\n info = help,\n status,\n title,\n}: Props) => {\n const intl = useIntl();\n\n let media = illustration;\n if (icon) {\n // @ts-expect-error if icon is present it has props and size prop\n const iconSize = icon?.props?.size as number;\n\n media =\n iconSize !== 24\n ? // @ts-expect-error we need icon to adjust it's size\n cloneElement(icon, { size: 24 })\n : icon;\n }\n // @ts-expect-error Badge can be null, this is handled in code\n const Badge = status && BadgeIcons[status];\n\n return (\n <Element\n className={clsx('np-summary d-flex align-items-start', className)}\n // @ts-expect-error we check whether `status` is not null before index `statusLabels` and `messages`\n aria-label={status && intl.formatMessage(messages[statusLabels[status]])}\n >\n <div className=\"np-summary__icon\">\n {media}\n {Badge && (\n <div>\n {/* @ts-expect-error it's okey to pass `undefined` into `sentiment` prop */}\n <StatusIcon size={Size.SMALL} sentiment={statusMapping[status]} />\n </div>\n )}\n </div>\n <div className=\"np-summary__body m-l-2\">\n <div className=\"np-summary__title d-flex\">\n <Body\n as=\"span\"\n role=\"heading\"\n aria-level={6}\n type={Typography.BODY_LARGE_BOLD}\n className=\"text-primary m-b-1\"\n >\n {title}\n </Body>\n {info && (\n <Info\n aria-label={info['aria-label']}\n className=\"m-l-1 hidden-xs\"\n content={info.content}\n presentation={info.presentation}\n size={Size.LARGE}\n title={info.title}\n onClick={info.onClick}\n />\n )}\n </div>\n\n {description && (\n <Body\n as=\"span\"\n type={Typography.BODY_DEFAULT}\n className=\"d-block np-summary__description\"\n >\n {description}\n </Body>\n )}\n {action && <Action action={action} className=\"np-summary__action\" />}\n </div>\n {info && (\n <Info\n aria-label={info['aria-label']}\n className=\"m-l-2 hidden-sm hidden-md hidden-lg hidden-xl\"\n content={info.content}\n presentation={info.presentation}\n size={Size.LARGE}\n title={info.title}\n onClick={info.onClick}\n />\n )}\n </Element>\n );\n};\n\nexport default Summary;\n"],"names":["BadgeIcons","Status","DONE","CheckCircleIcon","PENDING","PendingCircleIcon","statusLabels","NOT_DONE","statusMapping","Sentiment","POSITIVE","Summary","action","as","Element","className","content","description","help","icon","illustration","info","status","title","intl","useIntl","media","iconSize","props","size","cloneElement","Badge","_jsxs","clsx","formatMessage","messages","children","_jsx","StatusIcon","Size","SMALL","sentiment","Body","role","type","Typography","BODY_LARGE_BOLD","Info","presentation","LARGE","onClick","BODY_DEFAULT","Action"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAyBA,MAAMA,UAAU,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1B,KAAK,EAAEF,IAAI,CAACE,KAAM;UAClB2B,OAAO,EAAE7B,IAAI,CAAC6B,OAAAA;AAAQ,SACtB,CACH,CAAA;AAAA,OACE,CAEL,EAACjC,WAAW,iBACVoB,cAAA,CAACK,IAAI,EAAA;AACH7B,QAAAA,EAAE,EAAC,MAAM;QACT+B,IAAI,EAAEC,qBAAU,CAACM,YAAa;AAC9BpC,QAAAA,SAAS,EAAC,iCAAiC;AAAAqB,QAAAA,QAAA,EAE1CnB,WAAAA;AAAW,OACR,CACP,EACAL,MAAM,iBAAIyB,cAAA,CAACe,aAAM,EAAA;AAACxC,QAAAA,MAAM,EAAEA,MAAO;AAACG,QAAAA,SAAS,EAAC,oBAAA;AAAoB,QAAG,CAAA;AAAA,KACjE,CACL,EAACM,IAAI,iBACHgB,cAAA,CAACU,IAAI,EAAA;MACH,YAAY1B,EAAAA,IAAI,CAAC,YAAY,CAAE;AAC/BN,MAAAA,SAAS,EAAC,+CAA+C;MACzDC,OAAO,EAAEK,IAAI,CAACL,OAAQ;MACtBgC,YAAY,EAAE3B,IAAI,CAAC2B,YAAa;MAChCnB,IAAI,EAAEU,SAAI,CAACU,KAAM;MACjB1B,KAAK,EAAEF,IAAI,CAACE,KAAM;MAClB2B,OAAO,EAAE7B,IAAI,CAAC6B,OAAAA;AAAQ,KACtB,CACH,CAAA;AAAA,GACM,CAAC,CAAA;AAEd;;;;"}
|
|
@@ -3,16 +3,32 @@ import { clsx } from 'clsx';
|
|
|
3
3
|
import { cloneElement } from 'react';
|
|
4
4
|
import { useIntl } from 'react-intl';
|
|
5
5
|
import Body from '../body/Body.mjs';
|
|
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 { Typography } from '../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 { Status } from '../common/propsValues/status.mjs';
|
|
19
|
+
import { Sentiment } from '../common/propsValues/sentiment.mjs';
|
|
20
|
+
import '../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';
|
|
25
|
+
import '../common/closeButton/CloseButton.messages.mjs';
|
|
26
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
6
27
|
import '../info/infoPresentations.mjs';
|
|
7
28
|
import Info from '../info/Info.mjs';
|
|
8
29
|
import StatusIcon from '../statusIcon/StatusIcon.mjs';
|
|
9
30
|
import messages from './Summary.messages.mjs';
|
|
10
31
|
import { Action } from '../common/action/Action.mjs';
|
|
11
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
12
|
-
import { Sentiment } from '../common/propsValues/sentiment.mjs';
|
|
13
|
-
import { Status } from '../common/propsValues/status.mjs';
|
|
14
|
-
import { Size } from '../common/propsValues/size.mjs';
|
|
15
|
-
import { Typography } from '../common/propsValues/typography.mjs';
|
|
16
32
|
|
|
17
33
|
/* eslint-disable @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment */
|
|
18
34
|
const BadgeIcons = {
|