@transferwise/components 0.0.0-experimental-010a0a4 → 0.0.0-experimental-666b489
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/Accordion.js.map +1 -1
- package/build/accordion/Accordion.mjs.map +1 -1
- package/build/accordion/AccordionItem/AccordionItem.js.map +1 -1
- package/build/accordion/AccordionItem/AccordionItem.mjs.map +1 -1
- package/build/actionButton/ActionButton.js.map +1 -1
- package/build/actionButton/ActionButton.mjs.map +1 -1
- package/build/actionOption/ActionOption.js.map +1 -1
- package/build/actionOption/ActionOption.mjs.map +1 -1
- package/build/alert/Alert.js.map +1 -1
- package/build/alert/Alert.mjs.map +1 -1
- package/build/alert/inlineMarkdown/InlineMarkdown.js.map +1 -1
- package/build/alert/inlineMarkdown/InlineMarkdown.mjs.map +1 -1
- package/build/avatar/Avatar.js.map +1 -1
- package/build/avatar/Avatar.mjs.map +1 -1
- package/build/avatar/avatarTypes.js.map +1 -1
- package/build/avatar/avatarTypes.mjs.map +1 -1
- package/build/avatarLayout/AvatarLayout.js.map +1 -1
- package/build/avatarLayout/AvatarLayout.mjs.map +1 -1
- package/build/avatarView/AvatarView.js.map +1 -1
- package/build/avatarView/AvatarView.mjs.map +1 -1
- package/build/avatarView/NotificationDot.js.map +1 -1
- package/build/avatarView/NotificationDot.mjs.map +1 -1
- package/build/avatarWrapper/AvatarWrapper.js.map +1 -1
- package/build/avatarWrapper/AvatarWrapper.mjs.map +1 -1
- package/build/badge/Badge.js.map +1 -1
- package/build/badge/Badge.mjs.map +1 -1
- package/build/badge/BadgeAssets.js.map +1 -1
- package/build/badge/BadgeAssets.mjs.map +1 -1
- package/build/body/Body.js.map +1 -1
- package/build/body/Body.mjs.map +1 -1
- package/build/button/Button.js.map +1 -1
- package/build/button/Button.mjs.map +1 -1
- package/build/button/Button.resolver.js.map +1 -1
- package/build/button/Button.resolver.mjs.map +1 -1
- package/build/button/LegacyButton.js.map +1 -1
- package/build/button/LegacyButton.mjs +1 -1
- package/build/button/LegacyButton.mjs.map +1 -1
- package/build/button/classMap.js.map +1 -1
- package/build/button/classMap.mjs.map +1 -1
- package/build/button/legacyUtils/legacyUtils.js.map +1 -1
- package/build/button/legacyUtils/legacyUtils.mjs.map +1 -1
- package/build/card/Card.js.map +1 -1
- package/build/card/Card.mjs.map +1 -1
- package/build/carousel/Carousel.js.map +1 -1
- package/build/carousel/Carousel.mjs.map +1 -1
- package/build/checkbox/Checkbox.js.map +1 -1
- package/build/checkbox/Checkbox.mjs.map +1 -1
- package/build/checkboxButton/CheckboxButton.js.map +1 -1
- package/build/checkboxButton/CheckboxButton.mjs.map +1 -1
- package/build/checkboxOption/CheckboxOption.js.map +1 -1
- package/build/checkboxOption/CheckboxOption.mjs.map +1 -1
- package/build/chevron/Chevron.js.map +1 -1
- package/build/chevron/Chevron.mjs.map +1 -1
- package/build/chips/Chip.js.map +1 -1
- package/build/chips/Chip.mjs.map +1 -1
- package/build/chips/Chips.js.map +1 -1
- package/build/chips/Chips.messages.js.map +1 -1
- package/build/chips/Chips.messages.mjs.map +1 -1
- package/build/chips/Chips.mjs.map +1 -1
- package/build/circularButton/CircularButton.js.map +1 -1
- package/build/circularButton/CircularButton.mjs.map +1 -1
- package/build/common/DOMOperations/DOMOperations.js.map +1 -1
- package/build/common/DOMOperations/DOMOperations.mjs.map +1 -1
- package/build/common/Option/Option.js.map +1 -1
- package/build/common/Option/Option.mjs.map +1 -1
- package/build/common/RadioButton/RadioButton.js.map +1 -1
- package/build/common/RadioButton/RadioButton.mjs.map +1 -1
- package/build/common/bottomSheet/BottomSheet.js.map +1 -1
- package/build/common/bottomSheet/BottomSheet.mjs.map +1 -1
- package/build/common/card/Card.js.map +1 -1
- package/build/common/card/Card.mjs.map +1 -1
- package/build/common/circle/Circle.js.map +1 -1
- package/build/common/circle/Circle.mjs.map +1 -1
- package/build/common/closeButton/CloseButton.js.map +1 -1
- package/build/common/closeButton/CloseButton.messages.js.map +1 -1
- package/build/common/closeButton/CloseButton.messages.mjs.map +1 -1
- package/build/common/closeButton/CloseButton.mjs.map +1 -1
- package/build/common/colors.js.map +1 -1
- package/build/common/colors.mjs.map +1 -1
- package/build/common/dateUtils/getDateView/getDateView.js.map +1 -1
- package/build/common/dateUtils/getDateView/getDateView.mjs.map +1 -1
- package/build/common/dateUtils/getDayNames/getDayNames.js.map +1 -1
- package/build/common/dateUtils/getDayNames/getDayNames.mjs.map +1 -1
- package/build/common/dateUtils/getFormatForLocale/getFormatForLocale.js.map +1 -1
- package/build/common/dateUtils/getFormatForLocale/getFormatForLocale.mjs.map +1 -1
- package/build/common/dateUtils/getMonthNames/getMonthNames.js.map +1 -1
- package/build/common/dateUtils/getMonthNames/getMonthNames.mjs.map +1 -1
- package/build/common/dateUtils/isDateValid/isDateValid.js.map +1 -1
- package/build/common/dateUtils/isDateValid/isDateValid.mjs.map +1 -1
- package/build/common/dateUtils/isWithinRange/isWithinRange.js.map +1 -1
- package/build/common/dateUtils/isWithinRange/isWithinRange.mjs.map +1 -1
- package/build/common/dateUtils/moveToWithinRange/moveToWithinRange.js.map +1 -1
- package/build/common/dateUtils/moveToWithinRange/moveToWithinRange.mjs.map +1 -1
- package/build/common/deviceDetection/deviceDetection.js.map +1 -1
- package/build/common/deviceDetection/deviceDetection.mjs.map +1 -1
- package/build/common/direction.js.map +1 -1
- package/build/common/direction.mjs.map +1 -1
- package/build/common/domHelpers/documentIosClick.js.map +1 -1
- package/build/common/domHelpers/documentIosClick.mjs.map +1 -1
- package/build/common/fileType.js.map +1 -1
- package/build/common/fileType.mjs.map +1 -1
- package/build/common/flowHeader/FlowHeader.js.map +1 -1
- package/build/common/flowHeader/FlowHeader.mjs.map +1 -1
- package/build/common/focusBoundary/FocusBoundary.js.map +1 -1
- package/build/common/focusBoundary/FocusBoundary.mjs.map +1 -1
- package/build/common/historyNavigator/historyNavigator.js.map +1 -1
- package/build/common/historyNavigator/historyNavigator.mjs.map +1 -1
- package/build/common/hooks/useConditionalListener/useConditionalListener.js.map +1 -1
- package/build/common/hooks/useConditionalListener/useConditionalListener.mjs.map +1 -1
- package/build/common/hooks/useDirection/useDirection.js.map +1 -1
- package/build/common/hooks/useDirection/useDirection.mjs.map +1 -1
- package/build/common/hooks/useEffectEvent.js.map +1 -1
- package/build/common/hooks/useEffectEvent.mjs.map +1 -1
- package/build/common/hooks/useHasIntersected/useHasIntersected.js.map +1 -1
- package/build/common/hooks/useHasIntersected/useHasIntersected.mjs.map +1 -1
- package/build/common/hooks/useLayout/useLayout.js.map +1 -1
- package/build/common/hooks/useLayout/useLayout.mjs.map +1 -1
- package/build/common/hooks/useMedia.js.map +1 -1
- package/build/common/hooks/useMedia.mjs.map +1 -1
- package/build/common/hooks/useResizeObserver.js.map +1 -1
- package/build/common/hooks/useResizeObserver.mjs.map +1 -1
- package/build/common/hooks/useScreenSize.js.map +1 -1
- package/build/common/hooks/useScreenSize.mjs.map +1 -1
- package/build/common/hooks/useVirtualKeyboard.js.map +1 -1
- package/build/common/hooks/useVirtualKeyboard.mjs.map +1 -1
- package/build/common/initials.js.map +1 -1
- package/build/common/initials.mjs.map +1 -1
- package/build/common/locale/index.js.map +1 -1
- package/build/common/locale/index.mjs.map +1 -1
- package/build/common/panel/Panel.js.map +1 -1
- package/build/common/panel/Panel.mjs.map +1 -1
- package/build/common/polymorphicWithOverrides/PolymorphicWithOverrides.js.map +1 -1
- package/build/common/polymorphicWithOverrides/PolymorphicWithOverrides.mjs.map +1 -1
- package/build/common/preventScroll/PreventScroll.js.map +1 -1
- package/build/common/preventScroll/PreventScroll.mjs.map +1 -1
- package/build/common/propsValues/breakpoint.js.map +1 -1
- package/build/common/propsValues/breakpoint.mjs.map +1 -1
- package/build/common/propsValues/control.js.map +1 -1
- package/build/common/propsValues/control.mjs.map +1 -1
- package/build/common/propsValues/dateMode.js.map +1 -1
- package/build/common/propsValues/dateMode.mjs.map +1 -1
- package/build/common/propsValues/layouts.js.map +1 -1
- package/build/common/propsValues/layouts.mjs.map +1 -1
- package/build/common/propsValues/markdownNodeType.js.map +1 -1
- package/build/common/propsValues/markdownNodeType.mjs.map +1 -1
- package/build/common/propsValues/monthFormat.js.map +1 -1
- package/build/common/propsValues/monthFormat.mjs.map +1 -1
- package/build/common/propsValues/position.js.map +1 -1
- package/build/common/propsValues/position.mjs.map +1 -1
- package/build/common/propsValues/profileType.js.map +1 -1
- package/build/common/propsValues/profileType.mjs.map +1 -1
- package/build/common/propsValues/scroll.js.map +1 -1
- package/build/common/propsValues/scroll.mjs.map +1 -1
- package/build/common/propsValues/sentiment.js.map +1 -1
- package/build/common/propsValues/sentiment.mjs.map +1 -1
- package/build/common/propsValues/size.js.map +1 -1
- package/build/common/propsValues/size.mjs.map +1 -1
- package/build/common/propsValues/status.js.map +1 -1
- package/build/common/propsValues/status.mjs.map +1 -1
- package/build/common/propsValues/type.js.map +1 -1
- package/build/common/propsValues/type.mjs.map +1 -1
- package/build/common/propsValues/typography.js.map +1 -1
- package/build/common/propsValues/typography.mjs.map +1 -1
- package/build/common/propsValues/variant.js.map +1 -1
- package/build/common/propsValues/variant.mjs.map +1 -1
- package/build/common/propsValues/width.js.map +1 -1
- package/build/common/propsValues/width.mjs.map +1 -1
- package/build/common/responsivePanel/ResponsivePanel.js.map +1 -1
- package/build/common/responsivePanel/ResponsivePanel.mjs.map +1 -1
- package/build/common/textFormat/formatWithPattern/formatWithPattern.js.map +1 -1
- package/build/common/textFormat/formatWithPattern/formatWithPattern.mjs.map +1 -1
- package/build/common/textFormat/getCursorPositionAfterKeystroke/getCursorPositionAfterKeystroke.js.map +1 -1
- package/build/common/textFormat/getCursorPositionAfterKeystroke/getCursorPositionAfterKeystroke.mjs.map +1 -1
- package/build/common/textFormat/getDistanceToSymbol/getDistanceToSymbol.js.map +1 -1
- package/build/common/textFormat/getDistanceToSymbol/getDistanceToSymbol.mjs.map +1 -1
- package/build/common/textFormat/getSymbolsInPatternWithPosition/getSymbolsInPatternWithPosition.js.map +1 -1
- package/build/common/textFormat/getSymbolsInPatternWithPosition/getSymbolsInPatternWithPosition.mjs.map +1 -1
- package/build/common/textFormat/unformatWithPattern/unformatWithPattern.js.map +1 -1
- package/build/common/textFormat/unformatWithPattern/unformatWithPattern.mjs.map +1 -1
- package/build/common/theme.js.map +1 -1
- package/build/common/theme.mjs.map +1 -1
- package/build/criticalBanner/CriticalCommsBanner.js.map +1 -1
- package/build/criticalBanner/CriticalCommsBanner.mjs.map +1 -1
- package/build/dateInput/DateInput.js.map +1 -1
- package/build/dateInput/DateInput.messages.js.map +1 -1
- package/build/dateInput/DateInput.messages.mjs.map +1 -1
- package/build/dateInput/DateInput.mjs.map +1 -1
- package/build/dateInput/utils/convertToLocalMidnight/convertToLocalMidnight.js.map +1 -1
- package/build/dateInput/utils/convertToLocalMidnight/convertToLocalMidnight.mjs.map +1 -1
- package/build/dateLookup/DateLookup.js +4 -4
- package/build/dateLookup/DateLookup.js.map +1 -1
- package/build/dateLookup/DateLookup.messages.js.map +1 -1
- package/build/dateLookup/DateLookup.messages.mjs.map +1 -1
- package/build/dateLookup/DateLookup.mjs +4 -4
- package/build/dateLookup/DateLookup.mjs.map +1 -1
- package/build/dateLookup/dateHeader/DateHeader.js.map +1 -1
- package/build/dateLookup/dateHeader/DateHeader.mjs.map +1 -1
- package/build/dateLookup/dateTrigger/DateTrigger.js.map +1 -1
- package/build/dateLookup/dateTrigger/DateTrigger.messages.js.map +1 -1
- package/build/dateLookup/dateTrigger/DateTrigger.messages.mjs.map +1 -1
- package/build/dateLookup/dateTrigger/DateTrigger.mjs.map +1 -1
- package/build/dateLookup/dayCalendar/DayCalendar.js.map +1 -1
- package/build/dateLookup/dayCalendar/DayCalendar.mjs.map +1 -1
- package/build/dateLookup/dayCalendar/table/DayCalendarTable.js +3 -3
- package/build/dateLookup/dayCalendar/table/DayCalendarTable.js.map +1 -1
- package/build/dateLookup/dayCalendar/table/DayCalendarTable.mjs +3 -3
- package/build/dateLookup/dayCalendar/table/DayCalendarTable.mjs.map +1 -1
- package/build/dateLookup/getFocusableTime/getFocusableTime.js.map +1 -1
- package/build/dateLookup/getFocusableTime/getFocusableTime.mjs.map +1 -1
- package/build/dateLookup/getStartOfDay/getStartOfDay.js.map +1 -1
- package/build/dateLookup/getStartOfDay/getStartOfDay.mjs.map +1 -1
- package/build/dateLookup/monthCalendar/MonthCalendar.js.map +1 -1
- package/build/dateLookup/monthCalendar/MonthCalendar.mjs.map +1 -1
- package/build/dateLookup/monthCalendar/table/MonthCalendarTable.js.map +1 -1
- package/build/dateLookup/monthCalendar/table/MonthCalendarTable.mjs.map +1 -1
- package/build/dateLookup/tableLink/TableLink.js.map +1 -1
- package/build/dateLookup/tableLink/TableLink.mjs.map +1 -1
- package/build/dateLookup/yearCalendar/YearCalendar.js.map +1 -1
- package/build/dateLookup/yearCalendar/YearCalendar.mjs.map +1 -1
- package/build/dateLookup/yearCalendar/table/YearCalendarTable.js.map +1 -1
- package/build/dateLookup/yearCalendar/table/YearCalendarTable.mjs.map +1 -1
- package/build/decision/Decision.js.map +1 -1
- package/build/decision/Decision.mjs.map +1 -1
- package/build/definitionList/DefinitionList.js.map +1 -1
- package/build/definitionList/DefinitionList.mjs.map +1 -1
- package/build/dimmer/Dimmer.js +67 -41
- package/build/dimmer/Dimmer.js.map +1 -1
- package/build/dimmer/Dimmer.mjs +69 -43
- package/build/dimmer/Dimmer.mjs.map +1 -1
- package/build/dimmer/dimmerManager/DimmerManager.js.map +1 -1
- package/build/dimmer/dimmerManager/DimmerManager.mjs.map +1 -1
- package/build/display/Display.js.map +1 -1
- package/build/display/Display.mjs.map +1 -1
- package/build/divider/Divider.js.map +1 -1
- package/build/divider/Divider.mjs.map +1 -1
- package/build/drawer/Drawer.js.map +1 -1
- package/build/drawer/Drawer.mjs.map +1 -1
- package/build/dropFade/DropFade.js.map +1 -1
- package/build/dropFade/DropFade.mjs.map +1 -1
- package/build/emphasis/Emphasis.js.map +1 -1
- package/build/emphasis/Emphasis.mjs.map +1 -1
- package/build/emphasis/EmphasisHtmlTransformer.js.map +1 -1
- package/build/emphasis/EmphasisHtmlTransformer.mjs.map +1 -1
- package/build/field/Field.js.map +1 -1
- package/build/field/Field.mjs.map +1 -1
- package/build/flowNavigation/FlowNavigation.js.map +1 -1
- package/build/flowNavigation/FlowNavigation.messages.js.map +1 -1
- package/build/flowNavigation/FlowNavigation.messages.mjs.map +1 -1
- package/build/flowNavigation/FlowNavigation.mjs.map +1 -1
- package/build/flowNavigation/animatedLabel/AnimatedLabel.js.map +1 -1
- package/build/flowNavigation/animatedLabel/AnimatedLabel.mjs.map +1 -1
- package/build/header/Header.js.map +1 -1
- package/build/header/Header.mjs.map +1 -1
- package/build/i18n/commonMessages/Button.messages.js.map +1 -1
- package/build/i18n/commonMessages/Button.messages.mjs.map +1 -1
- package/build/i18n/index.js.map +1 -1
- package/build/i18n/index.mjs.map +1 -1
- package/build/iconButton/IconButton.js.map +1 -1
- package/build/iconButton/IconButton.mjs.map +1 -1
- package/build/image/Image.js.map +1 -1
- package/build/image/Image.mjs.map +1 -1
- package/build/info/Info.js.map +1 -1
- package/build/info/Info.messages.js.map +1 -1
- package/build/info/Info.messages.mjs.map +1 -1
- package/build/info/Info.mjs.map +1 -1
- package/build/info/infoPresentations.js.map +1 -1
- package/build/info/infoPresentations.mjs.map +1 -1
- package/build/inlineAlert/InlineAlert.js.map +1 -1
- package/build/inlineAlert/InlineAlert.mjs.map +1 -1
- package/build/inputWithDisplayFormat/InputWithDisplayFormat.js.map +1 -1
- package/build/inputWithDisplayFormat/InputWithDisplayFormat.mjs.map +1 -1
- package/build/inputs/Input.js.map +1 -1
- package/build/inputs/Input.mjs.map +1 -1
- package/build/inputs/InputGroup.js +16 -20
- package/build/inputs/InputGroup.js.map +1 -1
- package/build/inputs/InputGroup.mjs +17 -21
- package/build/inputs/InputGroup.mjs.map +1 -1
- package/build/inputs/SearchInput.js.map +1 -1
- package/build/inputs/SearchInput.mjs.map +1 -1
- package/build/inputs/SelectInput.js +6 -1
- package/build/inputs/SelectInput.js.map +1 -1
- package/build/inputs/SelectInput.messages.js.map +1 -1
- package/build/inputs/SelectInput.messages.mjs.map +1 -1
- package/build/inputs/SelectInput.mjs +6 -1
- package/build/inputs/SelectInput.mjs.map +1 -1
- package/build/inputs/TextArea.js.map +1 -1
- package/build/inputs/TextArea.mjs.map +1 -1
- package/build/inputs/_BottomSheet.js +8 -1
- package/build/inputs/_BottomSheet.js.map +1 -1
- package/build/inputs/_BottomSheet.mjs +9 -2
- package/build/inputs/_BottomSheet.mjs.map +1 -1
- package/build/inputs/_ButtonInput.js.map +1 -1
- package/build/inputs/_ButtonInput.mjs.map +1 -1
- package/build/inputs/_Popover.js +8 -1
- package/build/inputs/_Popover.js.map +1 -1
- package/build/inputs/_Popover.mjs +10 -3
- package/build/inputs/_Popover.mjs.map +1 -1
- package/build/inputs/_common.js.map +1 -1
- package/build/inputs/_common.mjs.map +1 -1
- package/build/inputs/contexts.js.map +1 -1
- package/build/inputs/contexts.mjs.map +1 -1
- package/build/instructionsList/InstructionsList.js.map +1 -1
- package/build/instructionsList/InstructionsList.mjs.map +1 -1
- package/build/label/Label.js.map +1 -1
- package/build/label/Label.messages.js.map +1 -1
- package/build/label/Label.messages.mjs.map +1 -1
- package/build/label/Label.mjs.map +1 -1
- package/build/legacylistItem/LegacyListItem.js.map +1 -1
- package/build/legacylistItem/LegacyListItem.mjs.map +1 -1
- package/build/legacylistItem/List.js.map +1 -1
- package/build/legacylistItem/List.mjs.map +1 -1
- package/build/link/Link.js.map +1 -1
- package/build/link/Link.messages.js.map +1 -1
- package/build/link/Link.messages.mjs.map +1 -1
- package/build/link/Link.mjs.map +1 -1
- package/build/loader/Loader.js.map +1 -1
- package/build/loader/Loader.mjs.map +1 -1
- package/build/logo/Logo.js.map +1 -1
- package/build/logo/Logo.mjs +1 -1
- package/build/logo/Logo.mjs.map +1 -1
- package/build/logo/logo-assets.js.map +1 -1
- package/build/logo/logo-assets.mjs.map +1 -1
- package/build/markdown/Markdown.js +20 -4
- package/build/markdown/Markdown.js.map +1 -1
- package/build/markdown/Markdown.mjs +1 -1
- package/build/markdown/Markdown.mjs.map +1 -1
- package/build/mocks.js.map +1 -1
- package/build/mocks.mjs.map +1 -1
- package/build/modal/Modal.js.map +1 -1
- package/build/modal/Modal.mjs.map +1 -1
- package/build/money/Money.js.map +1 -1
- package/build/money/Money.mjs.map +1 -1
- package/build/moneyInput/MoneyInput.js +2 -2
- package/build/moneyInput/MoneyInput.js.map +1 -1
- package/build/moneyInput/MoneyInput.messages.js.map +1 -1
- package/build/moneyInput/MoneyInput.messages.mjs.map +1 -1
- package/build/moneyInput/MoneyInput.mjs +2 -2
- package/build/moneyInput/MoneyInput.mjs.map +1 -1
- package/build/moneyInput/currencyFormatting.js.map +1 -1
- package/build/moneyInput/currencyFormatting.mjs.map +1 -1
- package/build/navigationOption/NavigationOption.js.map +1 -1
- package/build/navigationOption/NavigationOption.mjs.map +1 -1
- package/build/navigationOptionsList/NavigationOptionsList.js.map +1 -1
- package/build/navigationOptionsList/NavigationOptionsList.mjs.map +1 -1
- package/build/nudge/Nudge.js.map +1 -1
- package/build/nudge/Nudge.mjs.map +1 -1
- package/build/overlayHeader/OverlayHeader.js.map +1 -1
- package/build/overlayHeader/OverlayHeader.mjs.map +1 -1
- package/build/phoneNumberInput/PhoneNumberInput.js.map +1 -1
- package/build/phoneNumberInput/PhoneNumberInput.messages.js.map +1 -1
- package/build/phoneNumberInput/PhoneNumberInput.messages.mjs.map +1 -1
- package/build/phoneNumberInput/PhoneNumberInput.mjs.map +1 -1
- package/build/phoneNumberInput/data/countries.js.map +1 -1
- package/build/phoneNumberInput/data/countries.mjs.map +1 -1
- package/build/phoneNumberInput/utils/cleanNumber/cleanNumber.js.map +1 -1
- package/build/phoneNumberInput/utils/cleanNumber/cleanNumber.mjs.map +1 -1
- package/build/phoneNumberInput/utils/excludeCountries/excludeCountries.js.map +1 -1
- package/build/phoneNumberInput/utils/excludeCountries/excludeCountries.mjs.map +1 -1
- package/build/phoneNumberInput/utils/explodeNumberModel/index.js.map +1 -1
- package/build/phoneNumberInput/utils/explodeNumberModel/index.mjs.map +1 -1
- package/build/phoneNumberInput/utils/findCountryByCode/index.js.map +1 -1
- package/build/phoneNumberInput/utils/findCountryByCode/index.mjs.map +1 -1
- package/build/phoneNumberInput/utils/findCountryByPrefix/index.js.map +1 -1
- package/build/phoneNumberInput/utils/findCountryByPrefix/index.mjs.map +1 -1
- package/build/phoneNumberInput/utils/groupCountriesByPrefix/groupCountriesByPrefix.js.map +1 -1
- package/build/phoneNumberInput/utils/groupCountriesByPrefix/groupCountriesByPrefix.mjs.map +1 -1
- package/build/phoneNumberInput/utils/setDefaultPrefix/index.js.map +1 -1
- package/build/phoneNumberInput/utils/setDefaultPrefix/index.mjs.map +1 -1
- package/build/phoneNumberInput/utils/sortArrayByProperty/sortArrayByProperty.js.map +1 -1
- package/build/phoneNumberInput/utils/sortArrayByProperty/sortArrayByProperty.mjs.map +1 -1
- package/build/popover/Popover.js.map +1 -1
- package/build/popover/Popover.mjs +1 -1
- package/build/popover/Popover.mjs.map +1 -1
- package/build/primitives/PrimitiveAnchor/PrimitiveAnchor.js.map +1 -1
- package/build/primitives/PrimitiveAnchor/PrimitiveAnchor.mjs.map +1 -1
- package/build/primitives/PrimitiveButton/PrimitiveButton.js.map +1 -1
- package/build/primitives/PrimitiveButton/PrimitiveButton.mjs.map +1 -1
- package/build/processIndicator/ProcessIndicator.js.map +1 -1
- package/build/processIndicator/ProcessIndicator.mjs.map +1 -1
- package/build/progress/Progress.js.map +1 -1
- package/build/progress/Progress.mjs.map +1 -1
- package/build/progressBar/ProgressBar.js.map +1 -1
- package/build/progressBar/ProgressBar.mjs.map +1 -1
- package/build/promoCard/PromoCard.js.map +1 -1
- package/build/promoCard/PromoCard.mjs.map +1 -1
- package/build/promoCard/PromoCardContext.js.map +1 -1
- package/build/promoCard/PromoCardContext.mjs.map +1 -1
- package/build/promoCard/PromoCardGroup.js +1 -1
- package/build/promoCard/PromoCardGroup.js.map +1 -1
- package/build/promoCard/PromoCardGroup.mjs +1 -1
- package/build/promoCard/PromoCardGroup.mjs.map +1 -1
- package/build/promoCard/PromoCardIndicator.js.map +1 -1
- package/build/promoCard/PromoCardIndicator.mjs +1 -1
- package/build/promoCard/PromoCardIndicator.mjs.map +1 -1
- package/build/provider/Provider.js.map +1 -1
- package/build/provider/Provider.mjs.map +1 -1
- package/build/provider/direction/DirectionProvider.js.map +1 -1
- package/build/provider/direction/DirectionProvider.mjs.map +1 -1
- package/build/provider/language/LanguageProvider.js.map +1 -1
- package/build/provider/language/LanguageProvider.mjs.map +1 -1
- package/build/provider/overlay/OverlayIdProvider.js.map +1 -1
- package/build/provider/overlay/OverlayIdProvider.mjs +1 -1
- package/build/provider/overlay/OverlayIdProvider.mjs.map +1 -1
- package/build/radio/Radio.js.map +1 -1
- package/build/radio/Radio.mjs.map +1 -1
- package/build/radioGroup/RadioGroup.js.map +1 -1
- package/build/radioGroup/RadioGroup.mjs.map +1 -1
- package/build/radioOption/RadioOption.js.map +1 -1
- package/build/radioOption/RadioOption.mjs.map +1 -1
- package/build/section/Section.js.map +1 -1
- package/build/section/Section.mjs.map +1 -1
- package/build/segmentedControl/SegmentedControl.js.map +1 -1
- package/build/segmentedControl/SegmentedControl.mjs.map +1 -1
- package/build/select/Select.js +14 -22
- package/build/select/Select.js.map +1 -1
- package/build/select/Select.messages.js.map +1 -1
- package/build/select/Select.messages.mjs.map +1 -1
- package/build/select/Select.mjs +14 -22
- package/build/select/Select.mjs.map +1 -1
- package/build/select/option/Option.js.map +1 -1
- package/build/select/option/Option.mjs.map +1 -1
- package/build/select/searchBox/SearchBox.js.map +1 -1
- package/build/select/searchBox/SearchBox.mjs.map +1 -1
- package/build/selectOption/SelectOption.js.map +1 -1
- package/build/selectOption/SelectOption.messages.js.map +1 -1
- package/build/selectOption/SelectOption.messages.mjs.map +1 -1
- package/build/selectOption/SelectOption.mjs +1 -1
- package/build/selectOption/SelectOption.mjs.map +1 -1
- package/build/slidingPanel/SlidingPanel.js.map +1 -1
- package/build/slidingPanel/SlidingPanel.mjs.map +1 -1
- package/build/snackbar/Snackbar.js +1 -1
- package/build/snackbar/Snackbar.js.map +1 -1
- package/build/snackbar/Snackbar.mjs +1 -1
- package/build/snackbar/Snackbar.mjs.map +1 -1
- package/build/snackbar/SnackbarContext.js.map +1 -1
- package/build/snackbar/SnackbarContext.mjs.map +1 -1
- package/build/snackbar/SnackbarProvider.js.map +1 -1
- package/build/snackbar/SnackbarProvider.mjs.map +1 -1
- package/build/snackbar/useSnackbar.js.map +1 -1
- package/build/snackbar/useSnackbar.mjs.map +1 -1
- package/build/statusIcon/StatusIcon.js.map +1 -1
- package/build/statusIcon/StatusIcon.messages.js.map +1 -1
- package/build/statusIcon/StatusIcon.messages.mjs.map +1 -1
- package/build/statusIcon/StatusIcon.mjs +1 -1
- package/build/statusIcon/StatusIcon.mjs.map +1 -1
- package/build/stepper/Stepper.js.map +1 -1
- package/build/stepper/Stepper.mjs.map +1 -1
- package/build/stepper/deviceDetection.js.map +1 -1
- package/build/stepper/deviceDetection.mjs.map +1 -1
- package/build/sticky/Sticky.js.map +1 -1
- package/build/sticky/Sticky.mjs.map +1 -1
- package/build/summary/Summary.js.map +1 -1
- package/build/summary/Summary.messages.js.map +1 -1
- package/build/summary/Summary.messages.mjs.map +1 -1
- package/build/summary/Summary.mjs +1 -1
- package/build/summary/Summary.mjs.map +1 -1
- package/build/switch/Switch.js.map +1 -1
- package/build/switch/Switch.mjs.map +1 -1
- package/build/switchOption/SwitchOption.js.map +1 -1
- package/build/switchOption/SwitchOption.mjs.map +1 -1
- package/build/table/Table.js.map +1 -1
- package/build/table/Table.messages.js.map +1 -1
- package/build/table/Table.messages.mjs.map +1 -1
- package/build/table/Table.mjs.map +1 -1
- package/build/table/TableCell.js.map +1 -1
- package/build/table/TableCell.mjs.map +1 -1
- package/build/table/TableHeader.js.map +1 -1
- package/build/table/TableHeader.mjs.map +1 -1
- package/build/table/TableRow.js.map +1 -1
- package/build/table/TableRow.mjs.map +1 -1
- package/build/table/TableStatusText.js.map +1 -1
- package/build/table/TableStatusText.mjs.map +1 -1
- package/build/tabs/Tab.js.map +1 -1
- package/build/tabs/Tab.mjs.map +1 -1
- package/build/tabs/TabList.js.map +1 -1
- package/build/tabs/TabList.mjs.map +1 -1
- package/build/tabs/TabPanel.js.map +1 -1
- package/build/tabs/TabPanel.mjs.map +1 -1
- package/build/tabs/Tabs.js +3 -3
- package/build/tabs/Tabs.js.map +1 -1
- package/build/tabs/Tabs.mjs +4 -4
- package/build/tabs/Tabs.mjs.map +1 -1
- package/build/tabs/utils.js +1 -1
- package/build/tabs/utils.js.map +1 -1
- package/build/tabs/utils.mjs +1 -1
- package/build/tabs/utils.mjs.map +1 -1
- package/build/textareaWithDisplayFormat/TextareaWithDisplayFormat.js.map +1 -1
- package/build/textareaWithDisplayFormat/TextareaWithDisplayFormat.mjs.map +1 -1
- package/build/tile/Tile.js.map +1 -1
- package/build/tile/Tile.mjs.map +1 -1
- package/build/title/Title.js.map +1 -1
- package/build/title/Title.mjs.map +1 -1
- package/build/tooltip/Tooltip.js.map +1 -1
- package/build/tooltip/Tooltip.mjs.map +1 -1
- package/build/typeahead/Typeahead.js +57 -61
- package/build/typeahead/Typeahead.js.map +1 -1
- package/build/typeahead/Typeahead.messages.js.map +1 -1
- package/build/typeahead/Typeahead.messages.mjs.map +1 -1
- package/build/typeahead/Typeahead.mjs +57 -61
- package/build/typeahead/Typeahead.mjs.map +1 -1
- package/build/typeahead/typeaheadInput/TypeaheadInput.js +2 -2
- package/build/typeahead/typeaheadInput/TypeaheadInput.js.map +1 -1
- package/build/typeahead/typeaheadInput/TypeaheadInput.mjs +2 -2
- package/build/typeahead/typeaheadInput/TypeaheadInput.mjs.map +1 -1
- package/build/typeahead/typeaheadOption/TypeaheadOption.js.map +1 -1
- package/build/typeahead/typeaheadOption/TypeaheadOption.mjs.map +1 -1
- package/build/typeahead/util/highlight.js.map +1 -1
- package/build/typeahead/util/highlight.mjs.map +1 -1
- package/build/types/actionOption/ActionOption.d.ts.map +1 -1
- package/build/types/avatarWrapper/AvatarWrapper.d.ts.map +1 -1
- package/build/types/badge/Badge.d.ts.map +1 -1
- package/build/types/chevron/Chevron.d.ts.map +1 -1
- package/build/types/chips/Chip.d.ts.map +1 -1
- package/build/types/chips/Chips.d.ts.map +1 -1
- package/build/types/circularButton/CircularButton.d.ts.map +1 -1
- package/build/types/common/bottomSheet/BottomSheet.d.ts.map +1 -1
- package/build/types/common/colors.d.ts.map +1 -1
- package/build/types/common/dateUtils/getDateView/getDateView.d.ts.map +1 -1
- package/build/types/common/dateUtils/getMonthNames/getMonthNames.d.ts.map +1 -1
- package/build/types/common/dateUtils/isDateValid/isDateValid.d.ts.map +1 -1
- package/build/types/common/dateUtils/isMonthAndYearFormat/isMonthAndYearFormat.d.ts.map +1 -1
- package/build/types/common/fakeEvents.d.ts.map +1 -1
- package/build/types/common/focusBoundary/FocusBoundary.d.ts.map +1 -1
- package/build/types/common/historyNavigator/historyNavigator.d.ts.map +1 -1
- package/build/types/common/hooks/useConditionalListener/useConditionalListener.d.ts.map +1 -1
- package/build/types/common/hooks/useHasIntersected/useHasIntersected.d.ts.map +1 -1
- package/build/types/common/textFormat/formatWithPattern/formatWithPattern.d.ts.map +1 -1
- package/build/types/common/textFormat/getCountOfSymbolsInSelection/getCountOfSymbolsInSelection.d.ts.map +1 -1
- package/build/types/common/textFormat/getCursorPositionAfterKeystroke/getCursorPositionAfterKeystroke.d.ts.map +1 -1
- package/build/types/common/textFormat/getDistanceToSymbol/getDistanceToSymbol.d.ts.map +1 -1
- package/build/types/common/textFormat/getSymbolsInPatternWithPosition/getSymbolsInPatternWithPosition.d.ts.map +1 -1
- package/build/types/common/textFormat/unformatWithPattern/unformatWithPattern.d.ts.map +1 -1
- package/build/types/common/theme.d.ts.map +1 -1
- package/build/types/dateInput/DateInput.d.ts.map +1 -1
- package/build/types/dateInput/utils/convertToLocalMidnight/convertToLocalMidnight.d.ts.map +1 -1
- package/build/types/dateLookup/DateLookup.d.ts.map +1 -1
- package/build/types/dateLookup/monthCalendar/table/MonthCalendarTable.d.ts.map +1 -1
- package/build/types/dateLookup/tableLink/TableLink.d.ts.map +1 -1
- package/build/types/dateLookup/yearCalendar/table/YearCalendarTable.d.ts.map +1 -1
- package/build/types/decision/Decision.d.ts.map +1 -1
- package/build/types/dimmer/Dimmer.d.ts.map +1 -1
- package/build/types/dropFade/DropFade.d.ts.map +1 -1
- package/build/types/emphasis/Emphasis.d.ts.map +1 -1
- package/build/types/field/Field.d.ts.map +1 -1
- package/build/types/flowNavigation/FlowNavigation.d.ts.map +1 -1
- package/build/types/flowNavigation/animatedLabel/AnimatedLabel.d.ts.map +1 -1
- package/build/types/header/Header.d.ts.map +1 -1
- package/build/types/image/Image.d.ts.map +1 -1
- package/build/types/info/Info.d.ts.map +1 -1
- package/build/types/inputWithDisplayFormat/InputWithDisplayFormat.d.ts.map +1 -1
- package/build/types/inputs/SelectInput.d.ts.map +1 -1
- package/build/types/inputs/_BottomSheet.d.ts.map +1 -1
- package/build/types/inputs/_Popover.d.ts.map +1 -1
- package/build/types/instructionsList/InstructionsList.d.ts.map +1 -1
- package/build/types/link/Link.d.ts.map +1 -1
- package/build/types/loader/Loader.d.ts.map +1 -1
- package/build/types/markdown/Markdown.d.ts.map +1 -1
- package/build/types/modal/Modal.d.ts.map +1 -1
- package/build/types/money/Money.d.ts.map +1 -1
- package/build/types/navigationOptionsList/NavigationOptionsList.d.ts.map +1 -1
- package/build/types/nudge/Nudge.d.ts.map +1 -1
- package/build/types/phoneNumberInput/PhoneNumberInput.d.ts.map +1 -1
- package/build/types/phoneNumberInput/utils/cleanNumber/cleanNumber.d.ts.map +1 -1
- package/build/types/phoneNumberInput/utils/excludeCountries/excludeCountries.d.ts.map +1 -1
- package/build/types/phoneNumberInput/utils/explodeNumberModel/index.d.ts.map +1 -1
- package/build/types/phoneNumberInput/utils/findCountryByCode/index.d.ts.map +1 -1
- package/build/types/phoneNumberInput/utils/findCountryByPrefix/index.d.ts.map +1 -1
- package/build/types/phoneNumberInput/utils/groupCountriesByPrefix/groupCountriesByPrefix.d.ts.map +1 -1
- package/build/types/phoneNumberInput/utils/isStringNumeric/isStringNumeric.d.ts.map +1 -1
- package/build/types/phoneNumberInput/utils/isValidPhoneNumber/isValidPhoneNumber.d.ts.map +1 -1
- package/build/types/phoneNumberInput/utils/longestMatchingPrefix/index.d.ts.map +1 -1
- package/build/types/phoneNumberInput/utils/setDefaultPrefix/index.d.ts.map +1 -1
- package/build/types/progress/Progress.d.ts.map +1 -1
- package/build/types/progressBar/ProgressBar.d.ts.map +1 -1
- package/build/types/provider/direction/DirectionProvider.d.ts.map +1 -1
- package/build/types/provider/language/LanguageProvider.d.ts.map +1 -1
- package/build/types/provider/overlay/OverlayIdProvider.d.ts.map +1 -1
- package/build/types/section/Section.d.ts.map +1 -1
- package/build/types/segmentedControl/SegmentedControl.d.ts.map +1 -1
- package/build/types/statusIcon/StatusIcon.d.ts.map +1 -1
- package/build/types/stepper/Stepper.d.ts.map +1 -1
- package/build/types/summary/Summary.d.ts.map +1 -1
- package/build/types/switch/Switch.d.ts.map +1 -1
- package/build/types/switchOption/SwitchOption.d.ts.map +1 -1
- package/build/types/table/Table.d.ts.map +1 -1
- package/build/types/table/TableCell.d.ts.map +1 -1
- package/build/types/table/TableHeader.d.ts.map +1 -1
- package/build/types/table/TableRow.d.ts.map +1 -1
- package/build/types/table/TableStatusText.d.ts.map +1 -1
- package/build/types/tabs/Tabs.d.ts.map +1 -1
- package/build/types/tabs/utils.d.ts.map +1 -1
- package/build/types/test-utils/story-config.d.ts.map +1 -1
- package/build/types/textareaWithDisplayFormat/TextareaWithDisplayFormat.d.ts.map +1 -1
- package/build/types/tooltip/Tooltip.d.ts.map +1 -1
- package/build/types/upload/Upload.d.ts.map +1 -1
- package/build/types/uploadInput/UploadInput.d.ts.map +1 -1
- package/build/types/uploadInput/uploadButton/getAllowedFileTypes.d.ts.map +1 -1
- package/build/types/utilities/deprecatedProperty/deprecatedProperty.d.ts.map +1 -1
- package/build/types/withDisplayFormat/WithDisplayFormat.d.ts.map +1 -1
- package/build/types/withNextPortal/withNextPortal.d.ts.map +1 -1
- package/build/upload/Upload.js +2 -2
- package/build/upload/Upload.js.map +1 -1
- package/build/upload/Upload.messages.js.map +1 -1
- package/build/upload/Upload.messages.mjs.map +1 -1
- package/build/upload/Upload.mjs +2 -2
- package/build/upload/Upload.mjs.map +1 -1
- package/build/upload/steps/completeStep/completeStep.js.map +1 -1
- package/build/upload/steps/completeStep/completeStep.mjs.map +1 -1
- package/build/upload/steps/processingStep/processingStep.js.map +1 -1
- package/build/upload/steps/processingStep/processingStep.mjs.map +1 -1
- package/build/upload/steps/uploadImageStep/uploadImageStep.js +1 -1
- package/build/upload/steps/uploadImageStep/uploadImageStep.js.map +1 -1
- package/build/upload/steps/uploadImageStep/uploadImageStep.mjs +1 -1
- package/build/upload/steps/uploadImageStep/uploadImageStep.mjs.map +1 -1
- package/build/upload/utils/asyncFileRead/asyncFileRead.js.map +1 -1
- package/build/upload/utils/asyncFileRead/asyncFileRead.mjs.map +1 -1
- package/build/upload/utils/getFileType/getFileType.js.map +1 -1
- package/build/upload/utils/getFileType/getFileType.mjs.map +1 -1
- package/build/upload/utils/isSizeValid/isSizeValid.js.map +1 -1
- package/build/upload/utils/isSizeValid/isSizeValid.mjs.map +1 -1
- package/build/upload/utils/isTypeValid/isTypeValid.js.map +1 -1
- package/build/upload/utils/isTypeValid/isTypeValid.mjs.map +1 -1
- package/build/upload/utils/postData/postData.js.map +1 -1
- package/build/upload/utils/postData/postData.mjs.map +1 -1
- package/build/uploadInput/UploadInput.js.map +1 -1
- package/build/uploadInput/UploadInput.messages.js.map +1 -1
- package/build/uploadInput/UploadInput.messages.mjs.map +1 -1
- package/build/uploadInput/UploadInput.mjs +2 -2
- package/build/uploadInput/UploadInput.mjs.map +1 -1
- package/build/uploadInput/uploadButton/UploadButton.js.map +1 -1
- package/build/uploadInput/uploadButton/UploadButton.messages.js.map +1 -1
- package/build/uploadInput/uploadButton/UploadButton.messages.mjs.map +1 -1
- package/build/uploadInput/uploadButton/UploadButton.mjs.map +1 -1
- package/build/uploadInput/uploadButton/defaults.js.map +1 -1
- package/build/uploadInput/uploadButton/defaults.mjs.map +1 -1
- package/build/uploadInput/uploadButton/getAllowedFileTypes.js.map +1 -1
- package/build/uploadInput/uploadButton/getAllowedFileTypes.mjs.map +1 -1
- package/build/uploadInput/uploadItem/UploadItem.js.map +1 -1
- package/build/uploadInput/uploadItem/UploadItem.messages.js.map +1 -1
- package/build/uploadInput/uploadItem/UploadItem.messages.mjs.map +1 -1
- package/build/uploadInput/uploadItem/UploadItem.mjs.map +1 -1
- package/build/uploadInput/uploadItem/UploadItemLink.js.map +1 -1
- package/build/uploadInput/uploadItem/UploadItemLink.mjs.map +1 -1
- package/build/utilities/cssValueWithUnit.js.map +1 -1
- package/build/utilities/cssValueWithUnit.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.map +1 -1
- package/build/withDisplayFormat/WithDisplayFormat.mjs.map +1 -1
- package/build/withId/withId.js.map +1 -1
- package/build/withId/withId.mjs.map +1 -1
- package/build/withNextPortal/withNextPortal.js +2 -5
- package/build/withNextPortal/withNextPortal.js.map +1 -1
- package/build/withNextPortal/withNextPortal.mjs +2 -5
- package/build/withNextPortal/withNextPortal.mjs.map +1 -1
- package/package.json +55 -55
- package/src/alert/Alert.spec.tsx +2 -4
- package/src/card/Card.story.tsx +4 -2
- package/src/checkbox/Checkbox.story.tsx +3 -2
- package/src/common/bottomSheet/BottomSheet.spec.tsx +3 -6
- package/src/common/bottomSheet/__snapshots__/BottomSheet.spec.tsx.snap +1 -5
- package/src/dateInput/DateInput.story.tsx +2 -2
- package/src/dateInput/DateInput.tests.story.tsx +11 -10
- package/src/dimmer/Dimmer.tsx +72 -44
- package/src/inputWithDisplayFormat/InputWithDisplayFormat.story.tsx +1 -1
- package/src/inputs/SelectInput.tsx +11 -2
- package/src/inputs/_BottomSheet.tsx +9 -3
- package/src/inputs/_Popover.tsx +10 -4
- package/src/markdown/Markdown.tsx +2 -1
- package/src/primitives/PrimitiveAnchor/stories/PrimitiveAnchor.story.tsx +3 -2
- package/src/primitives/PrimitiveButton/stories/PrimitiveButton.story.tsx +3 -2
- package/src/radioGroup/RadioGroup.story.tsx +2 -2
- package/src/typeahead/Typeahead.story.tsx +3 -2
- package/src/upload/Upload.story.tsx +1 -1
- package/src/withNextPortal/withNextPortal.spec.tsx +1 -1
- package/src/withNextPortal/withNextPortal.tsx +1 -10
package/build/dimmer/Dimmer.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var componentsTheming = require('@wise/components-theming');
|
|
5
6
|
var clsx = require('clsx');
|
|
6
7
|
var React = require('react');
|
|
7
8
|
var reactTransitionGroup = require('react-transition-group');
|
|
@@ -59,6 +60,7 @@ const Dimmer = ({
|
|
|
59
60
|
onClose,
|
|
60
61
|
onExited: handleExited
|
|
61
62
|
}) => {
|
|
63
|
+
const [hasNotExited, setHasNotExited] = React.useState(false);
|
|
62
64
|
const dimmerReference = React.useRef(null);
|
|
63
65
|
const closeOnClick = event => {
|
|
64
66
|
if (event.target === dimmerReference.current) {
|
|
@@ -81,11 +83,13 @@ const Dimmer = ({
|
|
|
81
83
|
}
|
|
82
84
|
}, [onClose]);
|
|
83
85
|
const onEnter = () => {
|
|
86
|
+
setHasNotExited(true);
|
|
84
87
|
if (dimmerReference.current) {
|
|
85
88
|
dimmerManager.add(dimmerReference.current);
|
|
86
89
|
}
|
|
87
90
|
};
|
|
88
91
|
const onExited = () => {
|
|
92
|
+
setHasNotExited(false);
|
|
89
93
|
if (dimmerReference.current) {
|
|
90
94
|
dimmerManager.remove(dimmerReference.current);
|
|
91
95
|
}
|
|
@@ -104,54 +108,76 @@ const Dimmer = ({
|
|
|
104
108
|
localReferenceCopy?.removeEventListener('touchmove', handleTouchMove);
|
|
105
109
|
};
|
|
106
110
|
}, [handleKeyDown, open]);
|
|
107
|
-
return /*#__PURE__*/jsxRuntime.jsx(
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
'dimmer--scrollable': scrollable,
|
|
138
|
-
'dimmer--transparent': transparent
|
|
139
|
-
}, className),
|
|
140
|
-
role: "presentation",
|
|
141
|
-
onClick: handleClick,
|
|
111
|
+
return /*#__PURE__*/jsxRuntime.jsx(DimmerWrapper, {
|
|
112
|
+
open: open,
|
|
113
|
+
hasNotExited: hasNotExited,
|
|
114
|
+
children: /*#__PURE__*/jsxRuntime.jsx(reactTransitionGroup.CSSTransition, {
|
|
115
|
+
nodeRef: dimmerReference,
|
|
116
|
+
in: open,
|
|
117
|
+
appear: true
|
|
118
|
+
// Wait for animation to finish before unmount.
|
|
119
|
+
,
|
|
120
|
+
timeout: {
|
|
121
|
+
enter: 0,
|
|
122
|
+
exit: EXIT_ANIMATION
|
|
123
|
+
},
|
|
124
|
+
classNames: {
|
|
125
|
+
enter: clsx.clsx({
|
|
126
|
+
'dimmer--enter-fade': fadeContentOnEnter
|
|
127
|
+
}),
|
|
128
|
+
enterDone: clsx.clsx('dimmer--enter-done', {
|
|
129
|
+
'dimmer--enter-fade': fadeContentOnEnter
|
|
130
|
+
}),
|
|
131
|
+
exit: clsx.clsx('dimmer--exit', {
|
|
132
|
+
'dimmer--exit-fade': fadeContentOnExit
|
|
133
|
+
})
|
|
134
|
+
},
|
|
135
|
+
unmountOnExit: true,
|
|
136
|
+
onEnter: onEnter,
|
|
137
|
+
onExited: onExited,
|
|
138
|
+
children: /*#__PURE__*/jsxRuntime.jsx(DimmerContentWrapper, {
|
|
139
|
+
scrollBody: !transparent,
|
|
140
|
+
children: /*#__PURE__*/jsxRuntime.jsx(FocusBoundary.default, {
|
|
142
141
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
'
|
|
146
|
-
'
|
|
147
|
-
}
|
|
148
|
-
|
|
142
|
+
ref: dimmerReference,
|
|
143
|
+
className: clsx.clsx('dimmer', {
|
|
144
|
+
'dimmer--scrollable': scrollable,
|
|
145
|
+
'dimmer--transparent': transparent
|
|
146
|
+
}, className),
|
|
147
|
+
role: "presentation",
|
|
148
|
+
onClick: handleClick,
|
|
149
|
+
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
150
|
+
className: clsx.clsx('dimmer-content-positioner', contentPosition != null && ['d-flex justify-content-center', {
|
|
151
|
+
'align-items-start': contentPosition === 'top',
|
|
152
|
+
'align-items-center': contentPosition === 'center',
|
|
153
|
+
'align-items-end': contentPosition === 'bottom'
|
|
154
|
+
}]),
|
|
155
|
+
children: children
|
|
156
|
+
})
|
|
149
157
|
})
|
|
150
158
|
})
|
|
151
159
|
})
|
|
152
160
|
})
|
|
153
161
|
});
|
|
154
162
|
};
|
|
163
|
+
const DimmerWrapper = ({
|
|
164
|
+
open,
|
|
165
|
+
hasNotExited,
|
|
166
|
+
children
|
|
167
|
+
}) => {
|
|
168
|
+
const {
|
|
169
|
+
screenMode,
|
|
170
|
+
theme
|
|
171
|
+
} = componentsTheming.useTheme();
|
|
172
|
+
return open || hasNotExited ? /*#__PURE__*/jsxRuntime.jsx(componentsTheming.ThemeProvider, {
|
|
173
|
+
theme: "personal",
|
|
174
|
+
screenMode: theme === 'personal' ? screenMode : 'light',
|
|
175
|
+
isNotRootProvider: true,
|
|
176
|
+
children: children
|
|
177
|
+
}) : /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
178
|
+
children: children
|
|
179
|
+
});
|
|
180
|
+
};
|
|
155
181
|
const DimmerContentWrapper = ({
|
|
156
182
|
children,
|
|
157
183
|
scrollBody
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dimmer.js","sources":["../../src/dimmer/Dimmer.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { MouseEvent, ReactNode, useCallback, useEffect, useRef } from 'react';\nimport { CSSTransition } from 'react-transition-group';\n\nimport {\n addNoScrollClass,\n removeNoScrollClass,\n type CommonProps,\n type PositionBottom,\n type PositionCenter,\n type PositionTop,\n} from '../common';\nimport { isIosDevice } from '../common/deviceDetection';\nimport FocusBoundary from '../common/focusBoundary';\nimport withNextPortal from '../withNextPortal/withNextPortal';\n\nimport DimmerManager from './dimmerManager';\n\nexport const EXIT_ANIMATION = 350;\n\nconst dimmerManager = new DimmerManager();\n\nexport type DimmerProps = CommonProps & {\n children?: ReactNode;\n disableClickToClose?: boolean;\n contentPosition?: PositionTop | PositionCenter | PositionBottom;\n fadeContentOnEnter?: boolean;\n fadeContentOnExit?: boolean;\n open?: boolean;\n scrollable?: boolean;\n transparent?: boolean;\n onClose?: (event: KeyboardEvent | MouseEvent) => void;\n onExited?: () => void;\n};\n\nexport const handleTouchMove = (event: Event) => {\n const isTouchedElementDimmer = (event.target as HTMLDivElement).classList.contains('dimmer');\n\n // disable scroll on iOS devices for Dimmer area\n // this is because of bug in WebKit https://bugs.webkit.org/show_bug.cgi?id=220908\n // note: scrolling still works for children(s) as expected\n if (isIosDevice() && isTouchedElementDimmer) {\n event.stopPropagation();\n event.preventDefault();\n }\n};\n\nconst Dimmer = ({\n children,\n className,\n disableClickToClose = false,\n contentPosition,\n fadeContentOnEnter = false,\n fadeContentOnExit = false,\n open = false,\n scrollable = false,\n transparent = false,\n onClose,\n onExited: handleExited,\n}: DimmerProps) => {\n const dimmerReference = useRef<HTMLDivElement>(null);\n\n const closeOnClick = (event: MouseEvent<HTMLDivElement>) => {\n if (event.target === dimmerReference.current) {\n onClose?.(event);\n }\n };\n\n const handleClick = (event: MouseEvent<HTMLDivElement>) => {\n if (disableClickToClose || !onClose) {\n return;\n }\n\n closeOnClick(event);\n };\n\n const handleKeyDown = useCallback(\n (event: KeyboardEvent) => {\n if (event.key !== 'Escape') {\n return;\n }\n event.stopPropagation();\n\n if (onClose && dimmerReference.current && dimmerManager.isTop(dimmerReference.current)) {\n onClose(event);\n }\n },\n [onClose],\n );\n\n const onEnter = () => {\n if (dimmerReference.current) {\n dimmerManager.add(dimmerReference.current);\n }\n };\n const onExited = () => {\n if (dimmerReference.current) {\n dimmerManager.remove(dimmerReference.current);\n }\n\n handleExited?.();\n };\n\n useEffect(() => {\n const localReferenceCopy = dimmerReference.current;\n\n if (open) {\n document.addEventListener('keydown', handleKeyDown);\n localReferenceCopy?.addEventListener('touchmove', handleTouchMove, { passive: true });\n }\n return () => {\n document.removeEventListener('keydown', handleKeyDown);\n\n localReferenceCopy?.removeEventListener('touchmove', handleTouchMove);\n };\n }, [handleKeyDown, open]);\n\n return (\n <CSSTransition\n nodeRef={dimmerReference}\n in={open}\n appear\n // Wait for animation to finish before unmount.\n timeout={{ enter: 0, exit: EXIT_ANIMATION }}\n classNames={{\n enter: clsx({ 'dimmer--enter-fade': fadeContentOnEnter }),\n enterDone: clsx('dimmer--enter-done', {\n 'dimmer--enter-fade': fadeContentOnEnter,\n }),\n exit: clsx('dimmer--exit', { 'dimmer--exit-fade': fadeContentOnExit }),\n }}\n unmountOnExit\n onEnter={onEnter}\n onExited={onExited}\n >\n <DimmerContentWrapper scrollBody={!transparent}>\n <FocusBoundary>\n <div\n ref={dimmerReference}\n className={clsx(\n 'dimmer',\n { 'dimmer--scrollable': scrollable, 'dimmer--transparent': transparent },\n className,\n )}\n role=\"presentation\"\n onClick={handleClick}\n >\n <div\n className={clsx(\n 'dimmer-content-positioner',\n contentPosition != null && [\n 'd-flex justify-content-center',\n {\n 'align-items-start': contentPosition === 'top',\n 'align-items-center': contentPosition === 'center',\n 'align-items-end': contentPosition === 'bottom',\n },\n ],\n )}\n >\n {children}\n </div>\n </div>\n </FocusBoundary>\n </DimmerContentWrapper>\n </CSSTransition>\n );\n};\n\nexport const DimmerContentWrapper = ({\n children,\n scrollBody,\n}: {\n children: React.ReactElement;\n scrollBody: boolean;\n}) => {\n useEffect(() => {\n if (scrollBody) {\n addNoScrollClass();\n }\n\n return () => {\n if (scrollBody) {\n removeNoScrollClass();\n }\n };\n }, [scrollBody]);\n\n return children;\n};\n\n// Export without the Portal for tests only\nexport { Dimmer };\n\nexport default withNextPortal(Dimmer);\n"],"names":["EXIT_ANIMATION","dimmerManager","DimmerManager","handleTouchMove","event","isTouchedElementDimmer","target","classList","contains","isIosDevice","stopPropagation","preventDefault","Dimmer","children","className","disableClickToClose","contentPosition","fadeContentOnEnter","fadeContentOnExit","open","scrollable","transparent","onClose","onExited","handleExited","dimmerReference","useRef","closeOnClick","current","handleClick","handleKeyDown","useCallback","key","isTop","onEnter","add","remove","useEffect","localReferenceCopy","document","addEventListener","passive","removeEventListener","_jsx","CSSTransition","nodeRef","in","appear","timeout","enter","exit","classNames","clsx","enterDone","unmountOnExit","DimmerContentWrapper","scrollBody","FocusBoundary","ref","role","onClick","addNoScrollClass","removeNoScrollClass","withNextPortal"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBO,MAAMA,cAAc,GAAG,IAAG;AAEjC,MAAMC,aAAa,GAAG,IAAIC,qBAAa,EAAE,CAAA;AAe5BC,MAAAA,eAAe,GAAIC,KAAY,IAAI;EAC9C,MAAMC,sBAAsB,GAAID,KAAK,CAACE,MAAyB,CAACC,SAAS,CAACC,QAAQ,CAAC,QAAQ,CAAC,CAAA;AAE5F;AACA;AACA;AACA,EAA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AAA;KACK,CAAA;AACxB,GAAe,CAAC,CAAA;AAEpB,EAAC;AAEM,MAAM0C,oBAAoB,GAAGA,CAAC;EACnC1C,QAAQ;AACR2C,EAAAA,UAAAA;AAID,CAAA,KAAI;AACHnB,EAAAA,eAAS,CAAC,MAAK;AACb,IAAA,IAAImB,UAAU,EAAE;AACdK,MAAAA,8BAAgB,EAAE,CAAA;AACpB,KAAA;AAEA,IAAA,OAAO,MAAK;AACV,MAAA,IAAIL,UAAU,EAAE;AACdM,QAAAA,iCAAmB,EAAE,CAAA;AACvB,OAAA;KACD,CAAA;AACH,GAAC,EAAE,CAACN,UAAU,CAAC,CAAC,CAAA;AAEhB,EAAA,OAAO3C,QAAQ,CAAA;AACjB,EAAC;AAKD,eAAekD,sBAAc,CAACnD,MAAM,CAAC;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"Dimmer.js","sources":["../../src/dimmer/Dimmer.tsx"],"sourcesContent":["import { ThemeProvider, useTheme } from '@wise/components-theming';\nimport { clsx } from 'clsx';\nimport { MouseEvent, ReactNode, useCallback, useEffect, useRef, useState } from 'react';\nimport { CSSTransition } from 'react-transition-group';\n\nimport {\n addNoScrollClass,\n removeNoScrollClass,\n type CommonProps,\n type PositionBottom,\n type PositionCenter,\n type PositionTop,\n} from '../common';\nimport { isIosDevice } from '../common/deviceDetection';\nimport FocusBoundary from '../common/focusBoundary';\nimport withNextPortal from '../withNextPortal/withNextPortal';\n\nimport DimmerManager from './dimmerManager';\n\nexport const EXIT_ANIMATION = 350;\n\nconst dimmerManager = new DimmerManager();\n\nexport type DimmerProps = CommonProps & {\n children?: ReactNode;\n disableClickToClose?: boolean;\n contentPosition?: PositionTop | PositionCenter | PositionBottom;\n fadeContentOnEnter?: boolean;\n fadeContentOnExit?: boolean;\n open?: boolean;\n scrollable?: boolean;\n transparent?: boolean;\n onClose?: (event: KeyboardEvent | MouseEvent) => void;\n onExited?: () => void;\n};\n\nexport const handleTouchMove = (event: Event) => {\n const isTouchedElementDimmer = (event.target as HTMLDivElement).classList.contains('dimmer');\n\n // disable scroll on iOS devices for Dimmer area\n // this is because of bug in WebKit https://bugs.webkit.org/show_bug.cgi?id=220908\n // note: scrolling still works for children(s) as expected\n if (isIosDevice() && isTouchedElementDimmer) {\n event.stopPropagation();\n event.preventDefault();\n }\n};\n\nconst Dimmer = ({\n children,\n className,\n disableClickToClose = false,\n contentPosition,\n fadeContentOnEnter = false,\n fadeContentOnExit = false,\n open = false,\n scrollable = false,\n transparent = false,\n onClose,\n onExited: handleExited,\n}: DimmerProps) => {\n const [hasNotExited, setHasNotExited] = useState(false);\n const dimmerReference = useRef<HTMLDivElement>(null);\n\n const closeOnClick = (event: MouseEvent<HTMLDivElement>) => {\n if (event.target === dimmerReference.current) {\n onClose?.(event);\n }\n };\n\n const handleClick = (event: MouseEvent<HTMLDivElement>) => {\n if (disableClickToClose || !onClose) {\n return;\n }\n\n closeOnClick(event);\n };\n\n const handleKeyDown = useCallback(\n (event: KeyboardEvent) => {\n if (event.key !== 'Escape') {\n return;\n }\n event.stopPropagation();\n\n if (onClose && dimmerReference.current && dimmerManager.isTop(dimmerReference.current)) {\n onClose(event);\n }\n },\n [onClose],\n );\n\n const onEnter = () => {\n setHasNotExited(true);\n\n if (dimmerReference.current) {\n dimmerManager.add(dimmerReference.current);\n }\n };\n const onExited = () => {\n setHasNotExited(false);\n\n if (dimmerReference.current) {\n dimmerManager.remove(dimmerReference.current);\n }\n\n handleExited?.();\n };\n\n useEffect(() => {\n const localReferenceCopy = dimmerReference.current;\n\n if (open) {\n document.addEventListener('keydown', handleKeyDown);\n localReferenceCopy?.addEventListener('touchmove', handleTouchMove, { passive: true });\n }\n return () => {\n document.removeEventListener('keydown', handleKeyDown);\n\n localReferenceCopy?.removeEventListener('touchmove', handleTouchMove);\n };\n }, [handleKeyDown, open]);\n\n return (\n <DimmerWrapper open={open} hasNotExited={hasNotExited}>\n <CSSTransition\n nodeRef={dimmerReference}\n in={open}\n appear\n // Wait for animation to finish before unmount.\n timeout={{ enter: 0, exit: EXIT_ANIMATION }}\n classNames={{\n enter: clsx({ 'dimmer--enter-fade': fadeContentOnEnter }),\n enterDone: clsx('dimmer--enter-done', {\n 'dimmer--enter-fade': fadeContentOnEnter,\n }),\n exit: clsx('dimmer--exit', { 'dimmer--exit-fade': fadeContentOnExit }),\n }}\n unmountOnExit\n onEnter={onEnter}\n onExited={onExited}\n >\n <DimmerContentWrapper scrollBody={!transparent}>\n <FocusBoundary>\n <div\n ref={dimmerReference}\n className={clsx(\n 'dimmer',\n { 'dimmer--scrollable': scrollable, 'dimmer--transparent': transparent },\n className,\n )}\n role=\"presentation\"\n onClick={handleClick}\n >\n <div\n className={clsx(\n 'dimmer-content-positioner',\n contentPosition != null && [\n 'd-flex justify-content-center',\n {\n 'align-items-start': contentPosition === 'top',\n 'align-items-center': contentPosition === 'center',\n 'align-items-end': contentPosition === 'bottom',\n },\n ],\n )}\n >\n {children}\n </div>\n </div>\n </FocusBoundary>\n </DimmerContentWrapper>\n </CSSTransition>\n </DimmerWrapper>\n );\n};\n\nconst DimmerWrapper: React.ComponentType<{\n open: boolean;\n hasNotExited: boolean;\n children: React.ReactNode;\n}> = ({ open, hasNotExited, children }) => {\n const { screenMode, theme } = useTheme();\n\n return open || hasNotExited ? (\n <ThemeProvider\n theme=\"personal\"\n screenMode={theme === 'personal' ? screenMode : 'light'}\n isNotRootProvider\n >\n {children}\n </ThemeProvider>\n ) : (\n <>{children}</>\n );\n};\n\nexport const DimmerContentWrapper = ({\n children,\n scrollBody,\n}: {\n children: React.ReactElement;\n scrollBody: boolean;\n}) => {\n useEffect(() => {\n if (scrollBody) {\n addNoScrollClass();\n }\n\n return () => {\n if (scrollBody) {\n removeNoScrollClass();\n }\n };\n }, [scrollBody]);\n\n return children;\n};\n\n// Export without the Portal for tests only\nexport { Dimmer };\n\nexport default withNextPortal(Dimmer);\n"],"names":["EXIT_ANIMATION","dimmerManager","DimmerManager","handleTouchMove","event","isTouchedElementDimmer","target","classList","contains","isIosDevice","stopPropagation","preventDefault","Dimmer","children","className","disableClickToClose","contentPosition","fadeContentOnEnter","fadeContentOnExit","open","scrollable","transparent","onClose","onExited","handleExited","hasNotExited","setHasNotExited","useState","dimmerReference","useRef","closeOnClick","current","handleClick","handleKeyDown","useCallback","key","isTop","onEnter","add","remove","useEffect","localReferenceCopy","document","addEventListener","passive","removeEventListener","_jsx","DimmerWrapper","CSSTransition","nodeRef","in","appear","timeout","enter","exit","classNames","clsx","enterDone","unmountOnExit","DimmerContentWrapper","scrollBody","FocusBoundary","ref","role","onClick","screenMode","theme","useTheme","ThemeProvider","isNotRootProvider","_Fragment","addNoScrollClass","removeNoScrollClass","withNextPortal"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBO,MAAMA,cAAc,GAAG;AAE9B,MAAMC,aAAa,GAAG,IAAIC,qBAAa,EAAE;AAe5BC,MAAAA,eAAe,GAAIC,KAAY,IAAI;EAC9C,MAAMC,sBAAsB,GAAID,KAAK,CAACE,MAAyB,CAACC,SAAS,CAACC,QAAQ,CAAC,QAAQ,CAAC;AAE5F;AACA;AACA;AACA,EAAA,IAAIC,2BAAW,EAAE,IAAIJ,sBAAsB,EAAE;IAC3CD,KAAK,CAACM,eAAe,EAAE;IACvBN,KAAK,CAACO,cAAc,EAAE;AACxB;AACF;AAEMC,MAAAA,MAAM,GAAGA,CAAC;EACdC,QAAQ;EACRC,SAAS;AACTC,EAAAA,mBAAmB,GAAG,KAAK;EAC3BC,eAAe;AACfC,EAAAA,kBAAkB,GAAG,KAAK;AAC1BC,EAAAA,iBAAiB,GAAG,KAAK;AACzBC,EAAAA,IAAI,GAAG,KAAK;AACZC,EAAAA,UAAU,GAAG,KAAK;AAClBC,EAAAA,WAAW,GAAG,KAAK;EACnBC,OAAO;AACPC,EAAAA,QAAQ,EAAEC;AAAY,CACV,KAAI;EAChB,MAAM,CAACC,YAAY,EAAEC,eAAe,CAAC,GAAGC,cAAQ,CAAC,KAAK,CAA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EM,MAAM8C,oBAAoB,GAAGA,CAAC;EACnC9C,QAAQ;AACR+C,EAAAA;AAID,CAAA,KAAI;AACHpB,EAAAA,eAAS,CAAC,MAAK;AACb,IAAA,IAAIoB,UAAU,EAAE;AACdW,MAAAA,8BAAgB,EAAE;AACpB;AAEA,IAAA,OAAO,MAAK;AACV,MAAA,IAAIX,UAAU,EAAE;AACdY,QAAAA,iCAAmB,EAAE;AACvB;KACD;AACH,GAAC,EAAE,CAACZ,UAAU,CAAC,CAAC;AAEhB,EAAA,OAAO/C,QAAQ;AACjB;AAKA,eAAe4D,sBAAc,CAAC7D,MAAM,CAAC;;;;;;;;"}
|
package/build/dimmer/Dimmer.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { useTheme, ThemeProvider } from '@wise/components-theming';
|
|
1
2
|
import { clsx } from 'clsx';
|
|
2
|
-
import { useRef, useCallback, useEffect } from 'react';
|
|
3
|
+
import { useState, useRef, useCallback, useEffect } from 'react';
|
|
3
4
|
import { CSSTransition } from 'react-transition-group';
|
|
4
5
|
import { isIosDevice } from '../common/deviceDetection/deviceDetection.mjs';
|
|
5
6
|
import { addNoScrollClass, removeNoScrollClass } from '../common/DOMOperations/DOMOperations.mjs';
|
|
@@ -25,7 +26,7 @@ import '../common/fileType.mjs';
|
|
|
25
26
|
import '@transferwise/icons';
|
|
26
27
|
import 'react-intl';
|
|
27
28
|
import '../common/closeButton/CloseButton.messages.mjs';
|
|
28
|
-
import { jsx } from 'react/jsx-runtime';
|
|
29
|
+
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
29
30
|
import FocusBoundary from '../common/focusBoundary/FocusBoundary.mjs';
|
|
30
31
|
import withNextPortalWrapper from '../withNextPortal/withNextPortal.mjs';
|
|
31
32
|
import DimmerManager from './dimmerManager/DimmerManager.mjs';
|
|
@@ -55,6 +56,7 @@ const Dimmer = ({
|
|
|
55
56
|
onClose,
|
|
56
57
|
onExited: handleExited
|
|
57
58
|
}) => {
|
|
59
|
+
const [hasNotExited, setHasNotExited] = useState(false);
|
|
58
60
|
const dimmerReference = useRef(null);
|
|
59
61
|
const closeOnClick = event => {
|
|
60
62
|
if (event.target === dimmerReference.current) {
|
|
@@ -77,11 +79,13 @@ const Dimmer = ({
|
|
|
77
79
|
}
|
|
78
80
|
}, [onClose]);
|
|
79
81
|
const onEnter = () => {
|
|
82
|
+
setHasNotExited(true);
|
|
80
83
|
if (dimmerReference.current) {
|
|
81
84
|
dimmerManager.add(dimmerReference.current);
|
|
82
85
|
}
|
|
83
86
|
};
|
|
84
87
|
const onExited = () => {
|
|
88
|
+
setHasNotExited(false);
|
|
85
89
|
if (dimmerReference.current) {
|
|
86
90
|
dimmerManager.remove(dimmerReference.current);
|
|
87
91
|
}
|
|
@@ -100,54 +104,76 @@ const Dimmer = ({
|
|
|
100
104
|
localReferenceCopy?.removeEventListener('touchmove', handleTouchMove);
|
|
101
105
|
};
|
|
102
106
|
}, [handleKeyDown, open]);
|
|
103
|
-
return /*#__PURE__*/jsx(
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
'dimmer--scrollable': scrollable,
|
|
134
|
-
'dimmer--transparent': transparent
|
|
135
|
-
}, className),
|
|
136
|
-
role: "presentation",
|
|
137
|
-
onClick: handleClick,
|
|
107
|
+
return /*#__PURE__*/jsx(DimmerWrapper, {
|
|
108
|
+
open: open,
|
|
109
|
+
hasNotExited: hasNotExited,
|
|
110
|
+
children: /*#__PURE__*/jsx(CSSTransition, {
|
|
111
|
+
nodeRef: dimmerReference,
|
|
112
|
+
in: open,
|
|
113
|
+
appear: true
|
|
114
|
+
// Wait for animation to finish before unmount.
|
|
115
|
+
,
|
|
116
|
+
timeout: {
|
|
117
|
+
enter: 0,
|
|
118
|
+
exit: EXIT_ANIMATION
|
|
119
|
+
},
|
|
120
|
+
classNames: {
|
|
121
|
+
enter: clsx({
|
|
122
|
+
'dimmer--enter-fade': fadeContentOnEnter
|
|
123
|
+
}),
|
|
124
|
+
enterDone: clsx('dimmer--enter-done', {
|
|
125
|
+
'dimmer--enter-fade': fadeContentOnEnter
|
|
126
|
+
}),
|
|
127
|
+
exit: clsx('dimmer--exit', {
|
|
128
|
+
'dimmer--exit-fade': fadeContentOnExit
|
|
129
|
+
})
|
|
130
|
+
},
|
|
131
|
+
unmountOnExit: true,
|
|
132
|
+
onEnter: onEnter,
|
|
133
|
+
onExited: onExited,
|
|
134
|
+
children: /*#__PURE__*/jsx(DimmerContentWrapper, {
|
|
135
|
+
scrollBody: !transparent,
|
|
136
|
+
children: /*#__PURE__*/jsx(FocusBoundary, {
|
|
138
137
|
children: /*#__PURE__*/jsx("div", {
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
'
|
|
142
|
-
'
|
|
143
|
-
}
|
|
144
|
-
|
|
138
|
+
ref: dimmerReference,
|
|
139
|
+
className: clsx('dimmer', {
|
|
140
|
+
'dimmer--scrollable': scrollable,
|
|
141
|
+
'dimmer--transparent': transparent
|
|
142
|
+
}, className),
|
|
143
|
+
role: "presentation",
|
|
144
|
+
onClick: handleClick,
|
|
145
|
+
children: /*#__PURE__*/jsx("div", {
|
|
146
|
+
className: clsx('dimmer-content-positioner', contentPosition != null && ['d-flex justify-content-center', {
|
|
147
|
+
'align-items-start': contentPosition === 'top',
|
|
148
|
+
'align-items-center': contentPosition === 'center',
|
|
149
|
+
'align-items-end': contentPosition === 'bottom'
|
|
150
|
+
}]),
|
|
151
|
+
children: children
|
|
152
|
+
})
|
|
145
153
|
})
|
|
146
154
|
})
|
|
147
155
|
})
|
|
148
156
|
})
|
|
149
157
|
});
|
|
150
158
|
};
|
|
159
|
+
const DimmerWrapper = ({
|
|
160
|
+
open,
|
|
161
|
+
hasNotExited,
|
|
162
|
+
children
|
|
163
|
+
}) => {
|
|
164
|
+
const {
|
|
165
|
+
screenMode,
|
|
166
|
+
theme
|
|
167
|
+
} = useTheme();
|
|
168
|
+
return open || hasNotExited ? /*#__PURE__*/jsx(ThemeProvider, {
|
|
169
|
+
theme: "personal",
|
|
170
|
+
screenMode: theme === 'personal' ? screenMode : 'light',
|
|
171
|
+
isNotRootProvider: true,
|
|
172
|
+
children: children
|
|
173
|
+
}) : /*#__PURE__*/jsx(Fragment, {
|
|
174
|
+
children: children
|
|
175
|
+
});
|
|
176
|
+
};
|
|
151
177
|
const DimmerContentWrapper = ({
|
|
152
178
|
children,
|
|
153
179
|
scrollBody
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dimmer.mjs","sources":["../../src/dimmer/Dimmer.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { MouseEvent, ReactNode, useCallback, useEffect, useRef } from 'react';\nimport { CSSTransition } from 'react-transition-group';\n\nimport {\n addNoScrollClass,\n removeNoScrollClass,\n type CommonProps,\n type PositionBottom,\n type PositionCenter,\n type PositionTop,\n} from '../common';\nimport { isIosDevice } from '../common/deviceDetection';\nimport FocusBoundary from '../common/focusBoundary';\nimport withNextPortal from '../withNextPortal/withNextPortal';\n\nimport DimmerManager from './dimmerManager';\n\nexport const EXIT_ANIMATION = 350;\n\nconst dimmerManager = new DimmerManager();\n\nexport type DimmerProps = CommonProps & {\n children?: ReactNode;\n disableClickToClose?: boolean;\n contentPosition?: PositionTop | PositionCenter | PositionBottom;\n fadeContentOnEnter?: boolean;\n fadeContentOnExit?: boolean;\n open?: boolean;\n scrollable?: boolean;\n transparent?: boolean;\n onClose?: (event: KeyboardEvent | MouseEvent) => void;\n onExited?: () => void;\n};\n\nexport const handleTouchMove = (event: Event) => {\n const isTouchedElementDimmer = (event.target as HTMLDivElement).classList.contains('dimmer');\n\n // disable scroll on iOS devices for Dimmer area\n // this is because of bug in WebKit https://bugs.webkit.org/show_bug.cgi?id=220908\n // note: scrolling still works for children(s) as expected\n if (isIosDevice() && isTouchedElementDimmer) {\n event.stopPropagation();\n event.preventDefault();\n }\n};\n\nconst Dimmer = ({\n children,\n className,\n disableClickToClose = false,\n contentPosition,\n fadeContentOnEnter = false,\n fadeContentOnExit = false,\n open = false,\n scrollable = false,\n transparent = false,\n onClose,\n onExited: handleExited,\n}: DimmerProps) => {\n const dimmerReference = useRef<HTMLDivElement>(null);\n\n const closeOnClick = (event: MouseEvent<HTMLDivElement>) => {\n if (event.target === dimmerReference.current) {\n onClose?.(event);\n }\n };\n\n const handleClick = (event: MouseEvent<HTMLDivElement>) => {\n if (disableClickToClose || !onClose) {\n return;\n }\n\n closeOnClick(event);\n };\n\n const handleKeyDown = useCallback(\n (event: KeyboardEvent) => {\n if (event.key !== 'Escape') {\n return;\n }\n event.stopPropagation();\n\n if (onClose && dimmerReference.current && dimmerManager.isTop(dimmerReference.current)) {\n onClose(event);\n }\n },\n [onClose],\n );\n\n const onEnter = () => {\n if (dimmerReference.current) {\n dimmerManager.add(dimmerReference.current);\n }\n };\n const onExited = () => {\n if (dimmerReference.current) {\n dimmerManager.remove(dimmerReference.current);\n }\n\n handleExited?.();\n };\n\n useEffect(() => {\n const localReferenceCopy = dimmerReference.current;\n\n if (open) {\n document.addEventListener('keydown', handleKeyDown);\n localReferenceCopy?.addEventListener('touchmove', handleTouchMove, { passive: true });\n }\n return () => {\n document.removeEventListener('keydown', handleKeyDown);\n\n localReferenceCopy?.removeEventListener('touchmove', handleTouchMove);\n };\n }, [handleKeyDown, open]);\n\n return (\n <CSSTransition\n nodeRef={dimmerReference}\n in={open}\n appear\n // Wait for animation to finish before unmount.\n timeout={{ enter: 0, exit: EXIT_ANIMATION }}\n classNames={{\n enter: clsx({ 'dimmer--enter-fade': fadeContentOnEnter }),\n enterDone: clsx('dimmer--enter-done', {\n 'dimmer--enter-fade': fadeContentOnEnter,\n }),\n exit: clsx('dimmer--exit', { 'dimmer--exit-fade': fadeContentOnExit }),\n }}\n unmountOnExit\n onEnter={onEnter}\n onExited={onExited}\n >\n <DimmerContentWrapper scrollBody={!transparent}>\n <FocusBoundary>\n <div\n ref={dimmerReference}\n className={clsx(\n 'dimmer',\n { 'dimmer--scrollable': scrollable, 'dimmer--transparent': transparent },\n className,\n )}\n role=\"presentation\"\n onClick={handleClick}\n >\n <div\n className={clsx(\n 'dimmer-content-positioner',\n contentPosition != null && [\n 'd-flex justify-content-center',\n {\n 'align-items-start': contentPosition === 'top',\n 'align-items-center': contentPosition === 'center',\n 'align-items-end': contentPosition === 'bottom',\n },\n ],\n )}\n >\n {children}\n </div>\n </div>\n </FocusBoundary>\n </DimmerContentWrapper>\n </CSSTransition>\n );\n};\n\nexport const DimmerContentWrapper = ({\n children,\n scrollBody,\n}: {\n children: React.ReactElement;\n scrollBody: boolean;\n}) => {\n useEffect(() => {\n if (scrollBody) {\n addNoScrollClass();\n }\n\n return () => {\n if (scrollBody) {\n removeNoScrollClass();\n }\n };\n }, [scrollBody]);\n\n return children;\n};\n\n// Export without the Portal for tests only\nexport { Dimmer };\n\nexport default withNextPortal(Dimmer);\n"],"names":["EXIT_ANIMATION","dimmerManager","DimmerManager","handleTouchMove","event","isTouchedElementDimmer","target","classList","contains","isIosDevice","stopPropagation","preventDefault","Dimmer","children","className","disableClickToClose","contentPosition","fadeContentOnEnter","fadeContentOnExit","open","scrollable","transparent","onClose","onExited","handleExited","dimmerReference","useRef","closeOnClick","current","handleClick","handleKeyDown","useCallback","key","isTop","onEnter","add","remove","useEffect","localReferenceCopy","document","addEventListener","passive","removeEventListener","_jsx","CSSTransition","nodeRef","in","appear","timeout","enter","exit","classNames","clsx","enterDone","unmountOnExit","DimmerContentWrapper","scrollBody","FocusBoundary","ref","role","onClick","addNoScrollClass","removeNoSc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A;YACE7B,SAAS,EAAEsC,IAAI,CACb,2BAA2B,EAC3BpC,eAAe,IAAI,IAAI,IAAI,CACzB,+BAA+B,EAC/B;cACE,mBAAmB,EAAEA,eAAe,KAAK,KAAK;cAC9C,oBAAoB,EAAEA,eAAe,KAAK,QAAQ;cAClD,iBAAiB,EAAEA,eAAe,KAAK,QAAA;AACxC,aAAA,CACF,CACD;AAAAH,YAAAA,QAAA,EAEDA,QAAAA;WACE,CAAA;SACF,CAAA;OACQ,CAAA;KACK,CAAA;AACxB,GAAe,CAAC,CAAA;AAEpB,EAAC;AAEM,MAAM0C,oBAAoB,GAAGA,CAAC;EACnC1C,QAAQ;AACR2C,EAAAA,UAAAA;AAID,CAAA,KAAI;AACHnB,EAAAA,SAAS,CAAC,MAAK;AACb,IAAA,IAAImB,UAAU,EAAE;AACdK,MAAAA,gBAAgB,EAAE,CAAA;AACpB,KAAA;AAEA,IAAA,OAAO,MAAK;AACV,MAAA,IAAIL,UAAU,EAAE;AACdM,QAAAA,mBAAmB,EAAE,CAAA;AACvB,OAAA;KACD,CAAA;AACH,GAAC,EAAE,CAACN,UAAU,CAAC,CAAC,CAAA;AAEhB,EAAA,OAAO3C,QAAQ,CAAA;AACjB,EAAC;AAKD,eAAekD,qBAAc,CAACnD,MAAM,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"Dimmer.mjs","sources":["../../src/dimmer/Dimmer.tsx"],"sourcesContent":["import { ThemeProvider, useTheme } from '@wise/components-theming';\nimport { clsx } from 'clsx';\nimport { MouseEvent, ReactNode, useCallback, useEffect, useRef, useState } from 'react';\nimport { CSSTransition } from 'react-transition-group';\n\nimport {\n addNoScrollClass,\n removeNoScrollClass,\n type CommonProps,\n type PositionBottom,\n type PositionCenter,\n type PositionTop,\n} from '../common';\nimport { isIosDevice } from '../common/deviceDetection';\nimport FocusBoundary from '../common/focusBoundary';\nimport withNextPortal from '../withNextPortal/withNextPortal';\n\nimport DimmerManager from './dimmerManager';\n\nexport const EXIT_ANIMATION = 350;\n\nconst dimmerManager = new DimmerManager();\n\nexport type DimmerProps = CommonProps & {\n children?: ReactNode;\n disableClickToClose?: boolean;\n contentPosition?: PositionTop | PositionCenter | PositionBottom;\n fadeContentOnEnter?: boolean;\n fadeContentOnExit?: boolean;\n open?: boolean;\n scrollable?: boolean;\n transparent?: boolean;\n onClose?: (event: KeyboardEvent | MouseEvent) => void;\n onExited?: () => void;\n};\n\nexport const handleTouchMove = (event: Event) => {\n const isTouchedElementDimmer = (event.target as HTMLDivElement).classList.contains('dimmer');\n\n // disable scroll on iOS devices for Dimmer area\n // this is because of bug in WebKit https://bugs.webkit.org/show_bug.cgi?id=220908\n // note: scrolling still works for children(s) as expected\n if (isIosDevice() && isTouchedElementDimmer) {\n event.stopPropagation();\n event.preventDefault();\n }\n};\n\nconst Dimmer = ({\n children,\n className,\n disableClickToClose = false,\n contentPosition,\n fadeContentOnEnter = false,\n fadeContentOnExit = false,\n open = false,\n scrollable = false,\n transparent = false,\n onClose,\n onExited: handleExited,\n}: DimmerProps) => {\n const [hasNotExited, setHasNotExited] = useState(false);\n const dimmerReference = useRef<HTMLDivElement>(null);\n\n const closeOnClick = (event: MouseEvent<HTMLDivElement>) => {\n if (event.target === dimmerReference.current) {\n onClose?.(event);\n }\n };\n\n const handleClick = (event: MouseEvent<HTMLDivElement>) => {\n if (disableClickToClose || !onClose) {\n return;\n }\n\n closeOnClick(event);\n };\n\n const handleKeyDown = useCallback(\n (event: KeyboardEvent) => {\n if (event.key !== 'Escape') {\n return;\n }\n event.stopPropagation();\n\n if (onClose && dimmerReference.current && dimmerManager.isTop(dimmerReference.current)) {\n onClose(event);\n }\n },\n [onClose],\n );\n\n const onEnter = () => {\n setHasNotExited(true);\n\n if (dimmerReference.current) {\n dimmerManager.add(dimmerReference.current);\n }\n };\n const onExited = () => {\n setHasNotExited(false);\n\n if (dimmerReference.current) {\n dimmerManager.remove(dimmerReference.current);\n }\n\n handleExited?.();\n };\n\n useEffect(() => {\n const localReferenceCopy = dimmerReference.current;\n\n if (open) {\n document.addEventListener('keydown', handleKeyDown);\n localReferenceCopy?.addEventListener('touchmove', handleTouchMove, { passive: true });\n }\n return () => {\n document.removeEventListener('keydown', handleKeyDown);\n\n localReferenceCopy?.removeEventListener('touchmove', handleTouchMove);\n };\n }, [handleKeyDown, open]);\n\n return (\n <DimmerWrapper open={open} hasNotExited={hasNotExited}>\n <CSSTransition\n nodeRef={dimmerReference}\n in={open}\n appear\n // Wait for animation to finish before unmount.\n timeout={{ enter: 0, exit: EXIT_ANIMATION }}\n classNames={{\n enter: clsx({ 'dimmer--enter-fade': fadeContentOnEnter }),\n enterDone: clsx('dimmer--enter-done', {\n 'dimmer--enter-fade': fadeContentOnEnter,\n }),\n exit: clsx('dimmer--exit', { 'dimmer--exit-fade': fadeContentOnExit }),\n }}\n unmountOnExit\n onEnter={onEnter}\n onExited={onExited}\n >\n <DimmerContentWrapper scrollBody={!transparent}>\n <FocusBoundary>\n <div\n ref={dimmerReference}\n className={clsx(\n 'dimmer',\n { 'dimmer--scrollable': scrollable, 'dimmer--transparent': transparent },\n className,\n )}\n role=\"presentation\"\n onClick={handleClick}\n >\n <div\n className={clsx(\n 'dimmer-content-positioner',\n contentPosition != null && [\n 'd-flex justify-content-center',\n {\n 'align-items-start': contentPosition === 'top',\n 'align-items-center': contentPosition === 'center',\n 'align-items-end': contentPosition === 'bottom',\n },\n ],\n )}\n >\n {children}\n </div>\n </div>\n </FocusBoundary>\n </DimmerContentWrapper>\n </CSSTransition>\n </DimmerWrapper>\n );\n};\n\nconst DimmerWrapper: React.ComponentType<{\n open: boolean;\n hasNotExited: boolean;\n children: React.ReactNode;\n}> = ({ open, hasNotExited, children }) => {\n const { screenMode, theme } = useTheme();\n\n return open || hasNotExited ? (\n <ThemeProvider\n theme=\"personal\"\n screenMode={theme === 'personal' ? screenMode : 'light'}\n isNotRootProvider\n >\n {children}\n </ThemeProvider>\n ) : (\n <>{children}</>\n );\n};\n\nexport const DimmerContentWrapper = ({\n children,\n scrollBody,\n}: {\n children: React.ReactElement;\n scrollBody: boolean;\n}) => {\n useEffect(() => {\n if (scrollBody) {\n addNoScrollClass();\n }\n\n return () => {\n if (scrollBody) {\n removeNoScrollClass();\n }\n };\n }, [scrollBody]);\n\n return children;\n};\n\n// Export without the Portal for tests only\nexport { Dimmer };\n\nexport default withNextPortal(Dimmer);\n"],"names":["EXIT_ANIMATION","dimmerManager","DimmerManager","handleTouchMove","event","isTouchedElementDimmer","target","classList","contains","isIosDevice","stopPropagation","preventDefault","Dimmer","children","className","disableClickToClose","contentPosition","fadeContentOnEnter","fadeContentOnExit","open","scrollable","transparent","onClose","onExited","handleExited","hasNotExited","setHasNotExited","useState","dimmerReference","useRef","closeOnClick","current","handleClick","handleKeyDown","useCallback","key","isTop","onEnter","add","remove","useEffect","localReferenceCopy","document","addEventListener","passive","removeEventListener","_jsx","DimmerWrapper","CSSTransition","nodeRef","in","appear","timeout","enter","exit","classNames","clsx","enterDone","unmountOnExit","DimmerContentWrapper","scrollBody","FocusBoundary","ref","role","onClick","screenMode","theme","useTheme","ThemeProvider","isNotRootProvider","_Fragment","addNoScrollClass","removeNoScrollClass","withNextPortal"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBO,MAAMA,cAAc,GAAG;AAE9B,MAAMC,aAAa,GAAG,IAAIC,aAAa,EAAE;AAe5BC,MAAAA,eAAe,GAAIC,KAAY,IAAI;EAC9C,MAAMC,sBAAsB,GAAID,KAAK,CAACE,MAAyB,CAACC,SAAS,CAACC,QAAQ,CAAC,QAAQ,CAAC;AAE5F;AACA;AACA;AACA,EAAA,IAAIC,WAAW,EAAE,IAAIJ,sBAAsB,EAAE;IAC3CD,KAAK,CAACM,eAAe,EAAE;IACvBN,KAAK,CAACO,cAAc,EAAE;AACxB;AACF;AAEMC,MAAAA,MAAM,GAAGA,CAAC;EACdC,QAAQ;EACRC,SAAS;AACTC,EAAAA,mBAAmB,GAAG,KAAK;EAC3BC,eAAe;AAC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AAa,EAAA;AACZF,IAAAA,KAAK,EAAC,UAAU;AAChBD,IAAAA,UAAU,EAAEC,KAAK,KAAK,UAAU,GAAGD,UAAU,GAAG,OAAQ;IACxDI,iBAAiB,EAAA,IAAA;AAAAxD,IAAAA,QAAA,EAEhBA;AAAQ,GACI,CAAC,gBAEhBiC,GAAA,CAAAwB,QAAA,EAAA;AAAAzD,IAAAA,QAAA,EAAGA;AAAQ,GAAC,CACb;AACH,CAAC;AAEM,MAAM8C,oBAAoB,GAAGA,CAAC;EACnC9C,QAAQ;AACR+C,EAAAA;AAID,CAAA,KAAI;AACHpB,EAAAA,SAAS,CAAC,MAAK;AACb,IAAA,IAAIoB,UAAU,EAAE;AACdW,MAAAA,gBAAgB,EAAE;AACpB;AAEA,IAAA,OAAO,MAAK;AACV,MAAA,IAAIX,UAAU,EAAE;AACdY,QAAAA,mBAAmB,EAAE;AACvB;KACD;AACH,GAAC,EAAE,CAACZ,UAAU,CAAC,CAAC;AAEhB,EAAA,OAAO/C,QAAQ;AACjB;AAKA,eAAe4D,qBAAc,CAAC7D,MAAM,CAAC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DimmerManager.js","sources":["../../../src/dimmer/dimmerManager/DimmerManager.ts"],"sourcesContent":["/**\n * Dimmer state management inspired by Material UI's ModalManager (https://github.com/mui-org/material-ui)\n */\nexport default class DimmerManager {\n /**\n * Dimmer refs\n */\n private readonly dimmers: Element[];\n\n constructor() {\n this.dimmers = [];\n }\n\n add(dimmer: Element): number {\n let dimmerIndex = this.dimmers.indexOf(dimmer);\n if (dimmerIndex !== -1) {\n return dimmerIndex;\n }\n\n dimmerIndex = this.dimmers.length;\n this.dimmers.push(dimmer);\n return dimmerIndex;\n }\n\n remove(dimmer: Element): number {\n const dimmerIndex = this.dimmers.indexOf(dimmer);\n\n if (dimmerIndex !== -1) {\n this.dimmers.splice(dimmerIndex, 1);\n }\n return dimmerIndex;\n }\n\n isTop(dimmer: Element): boolean {\n return this.dimmers.length > 0 && this.dimmers[this.dimmers.length - 1] === dimmer;\n }\n}\n"],"names":["DimmerManager","dimmers","constructor","add","dimmer","dimmerIndex","indexOf","length","push","remove","splice","isTop"],"mappings":";;;;AAAA;;AAEG;AACW,MAAOA,aAAa,CAAA;AAChC;;AAEG;EACcC,OAAO
|
|
1
|
+
{"version":3,"file":"DimmerManager.js","sources":["../../../src/dimmer/dimmerManager/DimmerManager.ts"],"sourcesContent":["/**\n * Dimmer state management inspired by Material UI's ModalManager (https://github.com/mui-org/material-ui)\n */\nexport default class DimmerManager {\n /**\n * Dimmer refs\n */\n private readonly dimmers: Element[];\n\n constructor() {\n this.dimmers = [];\n }\n\n add(dimmer: Element): number {\n let dimmerIndex = this.dimmers.indexOf(dimmer);\n if (dimmerIndex !== -1) {\n return dimmerIndex;\n }\n\n dimmerIndex = this.dimmers.length;\n this.dimmers.push(dimmer);\n return dimmerIndex;\n }\n\n remove(dimmer: Element): number {\n const dimmerIndex = this.dimmers.indexOf(dimmer);\n\n if (dimmerIndex !== -1) {\n this.dimmers.splice(dimmerIndex, 1);\n }\n return dimmerIndex;\n }\n\n isTop(dimmer: Element): boolean {\n return this.dimmers.length > 0 && this.dimmers[this.dimmers.length - 1] === dimmer;\n }\n}\n"],"names":["DimmerManager","dimmers","constructor","add","dimmer","dimmerIndex","indexOf","length","push","remove","splice","isTop"],"mappings":";;;;AAAA;;AAEG;AACW,MAAOA,aAAa,CAAA;AAChC;;AAEG;EACcC,OAAO;AAExBC,EAAAA,WAAAA,GAAA;IACE,IAAI,CAACD,OAAO,GAAG,EAAE;AACnB;EAEAE,GAAGA,CAACC,MAAe,EAAA;IACjB,IAAIC,WAAW,GAAG,IAAI,CAACJ,OAAO,CAACK,OAAO,CAACF,MAAM,CAAC;AAC9C,IAAA,IAAIC,WAAW,KAAK,EAAE,EAAE;AACtB,MAAA,OAAOA,WAAW;AACpB;AAEAA,IAAAA,WAAW,GAAG,IAAI,CAACJ,OAAO,CAACM,MAAM;AACjC,IAAA,IAAI,CAACN,OAAO,CAACO,IAAI,CAACJ,MAAM,CAAC;AACzB,IAAA,OAAOC,WAAW;AACpB;EAEAI,MAAMA,CAACL,MAAe,EAAA;IACpB,MAAMC,WAAW,GAAG,IAAI,CAACJ,OAAO,CAACK,OAAO,CAACF,MAAM,CAAC;AAEhD,IAAA,IAAIC,WAAW,KAAK,EAAE,EAAE;MACtB,IAAI,CAACJ,OAAO,CAACS,MAAM,CAACL,WAAW,EAAE,CAAC,CAAC;AACrC;AACA,IAAA,OAAOA,WAAW;AACpB;EAEAM,KAAKA,CAACP,MAAe,EAAA;IACnB,OAAO,IAAI,CAACH,OAAO,CAACM,MAAM,GAAG,CAAC,IAAI,IAAI,CAACN,OAAO,CAAC,IAAI,CAACA,OAAO,CAACM,MAAM,GAAG,CAAC,CAAC,KAAKH,MAAM;AACpF;AACD;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DimmerManager.mjs","sources":["../../../src/dimmer/dimmerManager/DimmerManager.ts"],"sourcesContent":["/**\n * Dimmer state management inspired by Material UI's ModalManager (https://github.com/mui-org/material-ui)\n */\nexport default class DimmerManager {\n /**\n * Dimmer refs\n */\n private readonly dimmers: Element[];\n\n constructor() {\n this.dimmers = [];\n }\n\n add(dimmer: Element): number {\n let dimmerIndex = this.dimmers.indexOf(dimmer);\n if (dimmerIndex !== -1) {\n return dimmerIndex;\n }\n\n dimmerIndex = this.dimmers.length;\n this.dimmers.push(dimmer);\n return dimmerIndex;\n }\n\n remove(dimmer: Element): number {\n const dimmerIndex = this.dimmers.indexOf(dimmer);\n\n if (dimmerIndex !== -1) {\n this.dimmers.splice(dimmerIndex, 1);\n }\n return dimmerIndex;\n }\n\n isTop(dimmer: Element): boolean {\n return this.dimmers.length > 0 && this.dimmers[this.dimmers.length - 1] === dimmer;\n }\n}\n"],"names":["DimmerManager","dimmers","constructor","add","dimmer","dimmerIndex","indexOf","length","push","remove","splice","isTop"],"mappings":"AAAA;;AAEG;AACW,MAAOA,aAAa,CAAA;AAChC;;AAEG;EACcC,OAAO
|
|
1
|
+
{"version":3,"file":"DimmerManager.mjs","sources":["../../../src/dimmer/dimmerManager/DimmerManager.ts"],"sourcesContent":["/**\n * Dimmer state management inspired by Material UI's ModalManager (https://github.com/mui-org/material-ui)\n */\nexport default class DimmerManager {\n /**\n * Dimmer refs\n */\n private readonly dimmers: Element[];\n\n constructor() {\n this.dimmers = [];\n }\n\n add(dimmer: Element): number {\n let dimmerIndex = this.dimmers.indexOf(dimmer);\n if (dimmerIndex !== -1) {\n return dimmerIndex;\n }\n\n dimmerIndex = this.dimmers.length;\n this.dimmers.push(dimmer);\n return dimmerIndex;\n }\n\n remove(dimmer: Element): number {\n const dimmerIndex = this.dimmers.indexOf(dimmer);\n\n if (dimmerIndex !== -1) {\n this.dimmers.splice(dimmerIndex, 1);\n }\n return dimmerIndex;\n }\n\n isTop(dimmer: Element): boolean {\n return this.dimmers.length > 0 && this.dimmers[this.dimmers.length - 1] === dimmer;\n }\n}\n"],"names":["DimmerManager","dimmers","constructor","add","dimmer","dimmerIndex","indexOf","length","push","remove","splice","isTop"],"mappings":"AAAA;;AAEG;AACW,MAAOA,aAAa,CAAA;AAChC;;AAEG;EACcC,OAAO;AAExBC,EAAAA,WAAAA,GAAA;IACE,IAAI,CAACD,OAAO,GAAG,EAAE;AACnB;EAEAE,GAAGA,CAACC,MAAe,EAAA;IACjB,IAAIC,WAAW,GAAG,IAAI,CAACJ,OAAO,CAACK,OAAO,CAACF,MAAM,CAAC;AAC9C,IAAA,IAAIC,WAAW,KAAK,EAAE,EAAE;AACtB,MAAA,OAAOA,WAAW;AACpB;AAEAA,IAAAA,WAAW,GAAG,IAAI,CAACJ,OAAO,CAACM,MAAM;AACjC,IAAA,IAAI,CAACN,OAAO,CAACO,IAAI,CAACJ,MAAM,CAAC;AACzB,IAAA,OAAOC,WAAW;AACpB;EAEAI,MAAMA,CAACL,MAAe,EAAA;IACpB,MAAMC,WAAW,GAAG,IAAI,CAACJ,OAAO,CAACK,OAAO,CAACF,MAAM,CAAC;AAEhD,IAAA,IAAIC,WAAW,KAAK,EAAE,EAAE;MACtB,IAAI,CAACJ,OAAO,CAACS,MAAM,CAACL,WAAW,EAAE,CAAC,CAAC;AACrC;AACA,IAAA,OAAOA,WAAW;AACpB;EAEAM,KAAKA,CAACP,MAAe,EAAA;IACnB,OAAO,IAAI,CAACH,OAAO,CAACM,MAAM,GAAG,CAAC,IAAI,IAAI,CAACN,OAAO,CAAC,IAAI,CAACA,OAAO,CAACM,MAAM,GAAG,CAAC,CAAC,KAAKH,MAAM;AACpF;AACD;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Display.js","sources":["../../src/display/Display.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { PropsWithChildren } from 'react';\n\nimport { DisplayTypes, Typography } from '../common';\n\ntype Props = PropsWithChildren<{\n as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';\n id?: string;\n type?: DisplayTypes;\n className?: string;\n}>;\n\nfunction Display({\n as: Heading = 'h1',\n type = Typography.DISPLAY_LARGE,\n children,\n className,\n id,\n}: Props) {\n return (\n <Heading id={id} className={clsx('np-display', `np-text-${type}`, 'text-primary', className)}>\n {children}\n </Heading>\n );\n}\n\nexport default Display;\n"],"names":["Display","as","Heading","type","Typography","DISPLAY_LARGE","children","className","id","_jsx","clsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,SAASA,OAAOA,CAAC;EACfC,EAAE,EAAEC,OAAO,GAAG,IAAI;EAClBC,IAAI,GAAGC,qBAAU,CAACC,aAAa;EAC/BC,QAAQ;EACRC,SAAS;AACTC,EAAAA
|
|
1
|
+
{"version":3,"file":"Display.js","sources":["../../src/display/Display.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { PropsWithChildren } from 'react';\n\nimport { DisplayTypes, Typography } from '../common';\n\ntype Props = PropsWithChildren<{\n as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';\n id?: string;\n type?: DisplayTypes;\n className?: string;\n}>;\n\nfunction Display({\n as: Heading = 'h1',\n type = Typography.DISPLAY_LARGE,\n children,\n className,\n id,\n}: Props) {\n return (\n <Heading id={id} className={clsx('np-display', `np-text-${type}`, 'text-primary', className)}>\n {children}\n </Heading>\n );\n}\n\nexport default Display;\n"],"names":["Display","as","Heading","type","Typography","DISPLAY_LARGE","children","className","id","_jsx","clsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,SAASA,OAAOA,CAAC;EACfC,EAAE,EAAEC,OAAO,GAAG,IAAI;EAClBC,IAAI,GAAGC,qBAAU,CAACC,aAAa;EAC/BC,QAAQ;EACRC,SAAS;AACTC,EAAAA;AACM,CAAA,EAAA;EACN,oBACEC,cAAA,CAACP,OAAO,EAAA;AAACM,IAAAA,EAAE,EAAEA,EAAG;AAACD,IAAAA,SAAS,EAAEG,SAAI,CAAC,YAAY,EAAE,CAAA,QAAA,EAAWP,IAAI,CAAA,CAAE,EAAE,cAAc,EAAEI,SAAS,CAAE;AAAAD,IAAAA,QAAA,EAC1FA;AAAQ,GACF,CAAC;AAEd;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Display.mjs","sources":["../../src/display/Display.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { PropsWithChildren } from 'react';\n\nimport { DisplayTypes, Typography } from '../common';\n\ntype Props = PropsWithChildren<{\n as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';\n id?: string;\n type?: DisplayTypes;\n className?: string;\n}>;\n\nfunction Display({\n as: Heading = 'h1',\n type = Typography.DISPLAY_LARGE,\n children,\n className,\n id,\n}: Props) {\n return (\n <Heading id={id} className={clsx('np-display', `np-text-${type}`, 'text-primary', className)}>\n {children}\n </Heading>\n );\n}\n\nexport default Display;\n"],"names":["Display","as","Heading","type","Typography","DISPLAY_LARGE","children","className","id","_jsx","clsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,SAASA,OAAOA,CAAC;EACfC,EAAE,EAAEC,OAAO,GAAG,IAAI;EAClBC,IAAI,GAAGC,UAAU,CAACC,aAAa;EAC/BC,QAAQ;EACRC,SAAS;AACTC,EAAAA
|
|
1
|
+
{"version":3,"file":"Display.mjs","sources":["../../src/display/Display.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { PropsWithChildren } from 'react';\n\nimport { DisplayTypes, Typography } from '../common';\n\ntype Props = PropsWithChildren<{\n as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';\n id?: string;\n type?: DisplayTypes;\n className?: string;\n}>;\n\nfunction Display({\n as: Heading = 'h1',\n type = Typography.DISPLAY_LARGE,\n children,\n className,\n id,\n}: Props) {\n return (\n <Heading id={id} className={clsx('np-display', `np-text-${type}`, 'text-primary', className)}>\n {children}\n </Heading>\n );\n}\n\nexport default Display;\n"],"names":["Display","as","Heading","type","Typography","DISPLAY_LARGE","children","className","id","_jsx","clsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,SAASA,OAAOA,CAAC;EACfC,EAAE,EAAEC,OAAO,GAAG,IAAI;EAClBC,IAAI,GAAGC,UAAU,CAACC,aAAa;EAC/BC,QAAQ;EACRC,SAAS;AACTC,EAAAA;AACM,CAAA,EAAA;EACN,oBACEC,GAAA,CAACP,OAAO,EAAA;AAACM,IAAAA,EAAE,EAAEA,EAAG;AAACD,IAAAA,SAAS,EAAEG,IAAI,CAAC,YAAY,EAAE,CAAA,QAAA,EAAWP,IAAI,CAAA,CAAE,EAAE,cAAc,EAAEI,SAAS,CAAE;AAAAD,IAAAA,QAAA,EAC1FA;AAAQ,GACF,CAAC;AAEd;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Divider.js","sources":["../../src/divider/Divider.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport React, { FunctionComponent } from 'react';\n\nexport interface DividerProps {\n /**\n * If `true`, renders the Divider as a semantic `<hr>`, providing clear separation to assistive technologies.\n * Otherwise, a non-semantic `<div role=\"presentation\">` is used for purely visual separation.\n * @default false\n */\n isContent?: boolean;\n\n /**\n * Alters the visual style of the divider, accommodating different types\n * of separated content. Accepts `'section'`, `'subsection'`, or `'content'`.\n * @default 'section'\n */\n level?: 'section' | 'subsection' | 'content';\n\n className?: string;\n testId?: string;\n}\n\n/**\n * @param {boolean} [isContent=false] - If `true`, uses a semantic `<hr>` for accessible separation; otherwise uses `<div role=\"presentation\">`.\n * @param {string} [className] - Optional class names for adding custom styling to the divider.\n * @param {string} [testId] - Provides a `data-testid` for testing frameworks.\n * @param {'section' | 'subsection' | 'content'} [level='section'] - Defines the visual style for the divider.\n *\n * @see {@link Divider} for further information.\n * @see {@link https://storybook.wise.design/?path=/docs/layouts-divider--docs|Storybook Wise Design}\n */\nconst Divider: FunctionComponent<DividerProps> = ({\n className,\n isContent = false,\n testId,\n level = 'section',\n ...props\n}) => {\n const levelClass = level && level !== 'section' ? `wds-Divider--${level}` : '';\n\n const commonProps = {\n className: clsx('wds-Divider', levelClass, className),\n 'data-testid': testId,\n };\n\n const divProps = {\n ...commonProps,\n role: 'presentation',\n };\n\n return isContent ? <hr {...commonProps} {...props} /> : <div {...divProps} {...props} />;\n};\n\nexport default Divider;\n"],"names":["Divider","className","isContent","testId","level","props","levelClass","commonProps","clsx","divProps","role","_jsx"],"mappings":";;;;;;;;AA+BMA,MAAAA,OAAO,GAAoCA,CAAC;EAChDC,SAAS;AACTC,EAAAA,SAAS,GAAG,KAAK;EACjBC,MAAM;AACNC,EAAAA,KAAK,GAAG,SAAS;EACjB,GAAGC
|
|
1
|
+
{"version":3,"file":"Divider.js","sources":["../../src/divider/Divider.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport React, { FunctionComponent } from 'react';\n\nexport interface DividerProps {\n /**\n * If `true`, renders the Divider as a semantic `<hr>`, providing clear separation to assistive technologies.\n * Otherwise, a non-semantic `<div role=\"presentation\">` is used for purely visual separation.\n * @default false\n */\n isContent?: boolean;\n\n /**\n * Alters the visual style of the divider, accommodating different types\n * of separated content. Accepts `'section'`, `'subsection'`, or `'content'`.\n * @default 'section'\n */\n level?: 'section' | 'subsection' | 'content';\n\n className?: string;\n testId?: string;\n}\n\n/**\n * @param {boolean} [isContent=false] - If `true`, uses a semantic `<hr>` for accessible separation; otherwise uses `<div role=\"presentation\">`.\n * @param {string} [className] - Optional class names for adding custom styling to the divider.\n * @param {string} [testId] - Provides a `data-testid` for testing frameworks.\n * @param {'section' | 'subsection' | 'content'} [level='section'] - Defines the visual style for the divider.\n *\n * @see {@link Divider} for further information.\n * @see {@link https://storybook.wise.design/?path=/docs/layouts-divider--docs|Storybook Wise Design}\n */\nconst Divider: FunctionComponent<DividerProps> = ({\n className,\n isContent = false,\n testId,\n level = 'section',\n ...props\n}) => {\n const levelClass = level && level !== 'section' ? `wds-Divider--${level}` : '';\n\n const commonProps = {\n className: clsx('wds-Divider', levelClass, className),\n 'data-testid': testId,\n };\n\n const divProps = {\n ...commonProps,\n role: 'presentation',\n };\n\n return isContent ? <hr {...commonProps} {...props} /> : <div {...divProps} {...props} />;\n};\n\nexport default Divider;\n"],"names":["Divider","className","isContent","testId","level","props","levelClass","commonProps","clsx","divProps","role","_jsx"],"mappings":";;;;;;;;AA+BMA,MAAAA,OAAO,GAAoCA,CAAC;EAChDC,SAAS;AACTC,EAAAA,SAAS,GAAG,KAAK;EACjBC,MAAM;AACNC,EAAAA,KAAK,GAAG,SAAS;EACjB,GAAGC;AAAK,CACT,KAAI;AACH,EAAA,MAAMC,UAAU,GAAGF,KAAK,IAAIA,KAAK,KAAK,SAAS,GAAG,CAAgBA,aAAAA,EAAAA,KAAK,CAAE,CAAA,GAAG,EAAE;AAE9E,EAAA,MAAMG,WAAW,GAAG;IAClBN,SAAS,EAAEO,SAAI,CAAC,aAAa,EAAEF,UAAU,EAAEL,SAAS,CAAC;AACrD,IAAA,aAAa,EAAEE;GAChB;AAED,EAAA,MAAMM,QAAQ,GAAG;AACf,IAAA,GAAGF,WAAW;AACdG,IAAAA,IAAI,EAAE;GACP;EAED,OAAOR,SAAS,gBAAGS,cAAA,CAAA,IAAA,EAAA;AAAA,IAAA,GAAQJ,WAAW;IAAA,GAAMF;GAAS,CAAA,gBAAGM,cAAA,CAAA,KAAA,EAAA;AAAA,IAAA,GAASF,QAAQ;IAAA,GAAMJ;AAAK,IAAI;AAC1F;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Divider.mjs","sources":["../../src/divider/Divider.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport React, { FunctionComponent } from 'react';\n\nexport interface DividerProps {\n /**\n * If `true`, renders the Divider as a semantic `<hr>`, providing clear separation to assistive technologies.\n * Otherwise, a non-semantic `<div role=\"presentation\">` is used for purely visual separation.\n * @default false\n */\n isContent?: boolean;\n\n /**\n * Alters the visual style of the divider, accommodating different types\n * of separated content. Accepts `'section'`, `'subsection'`, or `'content'`.\n * @default 'section'\n */\n level?: 'section' | 'subsection' | 'content';\n\n className?: string;\n testId?: string;\n}\n\n/**\n * @param {boolean} [isContent=false] - If `true`, uses a semantic `<hr>` for accessible separation; otherwise uses `<div role=\"presentation\">`.\n * @param {string} [className] - Optional class names for adding custom styling to the divider.\n * @param {string} [testId] - Provides a `data-testid` for testing frameworks.\n * @param {'section' | 'subsection' | 'content'} [level='section'] - Defines the visual style for the divider.\n *\n * @see {@link Divider} for further information.\n * @see {@link https://storybook.wise.design/?path=/docs/layouts-divider--docs|Storybook Wise Design}\n */\nconst Divider: FunctionComponent<DividerProps> = ({\n className,\n isContent = false,\n testId,\n level = 'section',\n ...props\n}) => {\n const levelClass = level && level !== 'section' ? `wds-Divider--${level}` : '';\n\n const commonProps = {\n className: clsx('wds-Divider', levelClass, className),\n 'data-testid': testId,\n };\n\n const divProps = {\n ...commonProps,\n role: 'presentation',\n };\n\n return isContent ? <hr {...commonProps} {...props} /> : <div {...divProps} {...props} />;\n};\n\nexport default Divider;\n"],"names":["Divider","className","isContent","testId","level","props","levelClass","commonProps","clsx","divProps","role","_jsx"],"mappings":";;;;AA+BMA,MAAAA,OAAO,GAAoCA,CAAC;EAChDC,SAAS;AACTC,EAAAA,SAAS,GAAG,KAAK;EACjBC,MAAM;AACNC,EAAAA,KAAK,GAAG,SAAS;EACjB,GAAGC
|
|
1
|
+
{"version":3,"file":"Divider.mjs","sources":["../../src/divider/Divider.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport React, { FunctionComponent } from 'react';\n\nexport interface DividerProps {\n /**\n * If `true`, renders the Divider as a semantic `<hr>`, providing clear separation to assistive technologies.\n * Otherwise, a non-semantic `<div role=\"presentation\">` is used for purely visual separation.\n * @default false\n */\n isContent?: boolean;\n\n /**\n * Alters the visual style of the divider, accommodating different types\n * of separated content. Accepts `'section'`, `'subsection'`, or `'content'`.\n * @default 'section'\n */\n level?: 'section' | 'subsection' | 'content';\n\n className?: string;\n testId?: string;\n}\n\n/**\n * @param {boolean} [isContent=false] - If `true`, uses a semantic `<hr>` for accessible separation; otherwise uses `<div role=\"presentation\">`.\n * @param {string} [className] - Optional class names for adding custom styling to the divider.\n * @param {string} [testId] - Provides a `data-testid` for testing frameworks.\n * @param {'section' | 'subsection' | 'content'} [level='section'] - Defines the visual style for the divider.\n *\n * @see {@link Divider} for further information.\n * @see {@link https://storybook.wise.design/?path=/docs/layouts-divider--docs|Storybook Wise Design}\n */\nconst Divider: FunctionComponent<DividerProps> = ({\n className,\n isContent = false,\n testId,\n level = 'section',\n ...props\n}) => {\n const levelClass = level && level !== 'section' ? `wds-Divider--${level}` : '';\n\n const commonProps = {\n className: clsx('wds-Divider', levelClass, className),\n 'data-testid': testId,\n };\n\n const divProps = {\n ...commonProps,\n role: 'presentation',\n };\n\n return isContent ? <hr {...commonProps} {...props} /> : <div {...divProps} {...props} />;\n};\n\nexport default Divider;\n"],"names":["Divider","className","isContent","testId","level","props","levelClass","commonProps","clsx","divProps","role","_jsx"],"mappings":";;;;AA+BMA,MAAAA,OAAO,GAAoCA,CAAC;EAChDC,SAAS;AACTC,EAAAA,SAAS,GAAG,KAAK;EACjBC,MAAM;AACNC,EAAAA,KAAK,GAAG,SAAS;EACjB,GAAGC;AAAK,CACT,KAAI;AACH,EAAA,MAAMC,UAAU,GAAGF,KAAK,IAAIA,KAAK,KAAK,SAAS,GAAG,CAAgBA,aAAAA,EAAAA,KAAK,CAAE,CAAA,GAAG,EAAE;AAE9E,EAAA,MAAMG,WAAW,GAAG;IAClBN,SAAS,EAAEO,IAAI,CAAC,aAAa,EAAEF,UAAU,EAAEL,SAAS,CAAC;AACrD,IAAA,aAAa,EAAEE;GAChB;AAED,EAAA,MAAMM,QAAQ,GAAG;AACf,IAAA,GAAGF,WAAW;AACdG,IAAAA,IAAI,EAAE;GACP;EAED,OAAOR,SAAS,gBAAGS,GAAA,CAAA,IAAA,EAAA;AAAA,IAAA,GAAQJ,WAAW;IAAA,GAAMF;GAAS,CAAA,gBAAGM,GAAA,CAAA,KAAA,EAAA;AAAA,IAAA,GAASF,QAAQ;IAAA,GAAMJ;AAAK,IAAI;AAC1F;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Drawer.js","sources":["../../src/drawer/Drawer.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { HTMLAttributes, useContext, useId } from 'react';\n\nimport { Position, Typography } from '../common';\nimport { CloseButton } from '../common/closeButton';\nimport { useLayout } from '../common/hooks';\nimport Dimmer from '../dimmer';\nimport { OverlayIdContext } from '../provider/overlay/OverlayIdProvider';\nimport SlidingPanel from '../slidingPanel';\nimport Title from '../title';\nimport { logActionRequiredIf } from '../utilities';\n\nexport type DrawerProps = {\n /** The content to appear in the drawer body. */\n children?: React.ReactNode;\n className?: string;\n /** The content to appear in the drawer footer. */\n footerContent?: React.ReactNode;\n /** The content to appear in the drawer header. */\n headerTitle?: React.ReactNode;\n /** The status of Drawer either open or not. */\n open?: boolean;\n /** The placement of Drawer on the screen either left or right. On mobile it will default to bottom. */\n position?: `${Position.LEFT | Position.RIGHT | Position.BOTTOM}`;\n /** The action to perform on close click. */\n onClose?: (event: KeyboardEvent | React.MouseEvent) => void;\n onUnmount?: () => void;\n} & Pick<HTMLAttributes<HTMLDivElement>, 'role' | 'aria-labelledby'>;\n\nexport default function Drawer({\n children,\n className,\n footerContent,\n headerTitle,\n onClose,\n onUnmount,\n open = false,\n position = 'right',\n role = 'dialog',\n 'aria-labelledby': ariaLabelledBy,\n}: DrawerProps) {\n logActionRequiredIf(\n 'Drawer now expects `onClose`, and will soon make this prop required. Please update your usage to provide it.',\n !onClose,\n );\n\n const { isMobile } = useLayout();\n const titleId = useId();\n\n const overlayId = useContext(OverlayIdContext);\n\n return (\n <Dimmer open={open} onClose={onClose} onExited={onUnmount}>\n <SlidingPanel open={open} position={isMobile ? Position.BOTTOM : position}>\n <div\n id={overlayId}\n role={role}\n aria-modal\n aria-labelledby={ariaLabelledBy || (headerTitle ? titleId : undefined)}\n className={clsx('np-drawer', className)}\n >\n <div\n className={clsx('np-drawer-header', {\n 'np-drawer-header--withborder': headerTitle,\n })}\n >\n {headerTitle && (\n <Title id={titleId} type={Typography.TITLE_BODY}>\n {headerTitle}\n </Title>\n )}\n <CloseButton onClick={onClose} />\n </div>\n {children && <div className={clsx('np-drawer-content')}>{children}</div>}\n {footerContent && <div className={clsx('np-drawer-footer')}>{footerContent}</div>}\n </div>\n </SlidingPanel>\n </Dimmer>\n );\n}\n"],"names":["Drawer","children","className","footerContent","headerTitle","onClose","onUnmount","open","position","role","ariaLabelledBy","logActionRequiredIf","isMobile","useLayout","titleId","useId","overlayId","useContext","OverlayIdContext","_jsx","Dimmer","onExited","SlidingPanel","Position","BOTTOM","_jsxs","id","undefined","clsx","Title","type","Typography","TITLE_BODY","CloseButton","onClick"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BwB,SAAAA,MAAMA,CAAC;EAC7BC,QAAQ;EACRC,SAAS;EACTC,aAAa;EACbC,WAAW;EACXC,OAAO;EACPC,SAAS;AACTC,EAAAA,IAAI,GAAG,KAAK;AACZC,YAAAA,UAAQ,GAAG,OAAO;AAClBC,EAAAA,IAAI,GAAG,QAAQ;AACf,EAAA,iBAAiB,EAAEC
|
|
1
|
+
{"version":3,"file":"Drawer.js","sources":["../../src/drawer/Drawer.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { HTMLAttributes, useContext, useId } from 'react';\n\nimport { Position, Typography } from '../common';\nimport { CloseButton } from '../common/closeButton';\nimport { useLayout } from '../common/hooks';\nimport Dimmer from '../dimmer';\nimport { OverlayIdContext } from '../provider/overlay/OverlayIdProvider';\nimport SlidingPanel from '../slidingPanel';\nimport Title from '../title';\nimport { logActionRequiredIf } from '../utilities';\n\nexport type DrawerProps = {\n /** The content to appear in the drawer body. */\n children?: React.ReactNode;\n className?: string;\n /** The content to appear in the drawer footer. */\n footerContent?: React.ReactNode;\n /** The content to appear in the drawer header. */\n headerTitle?: React.ReactNode;\n /** The status of Drawer either open or not. */\n open?: boolean;\n /** The placement of Drawer on the screen either left or right. On mobile it will default to bottom. */\n position?: `${Position.LEFT | Position.RIGHT | Position.BOTTOM}`;\n /** The action to perform on close click. */\n onClose?: (event: KeyboardEvent | React.MouseEvent) => void;\n onUnmount?: () => void;\n} & Pick<HTMLAttributes<HTMLDivElement>, 'role' | 'aria-labelledby'>;\n\nexport default function Drawer({\n children,\n className,\n footerContent,\n headerTitle,\n onClose,\n onUnmount,\n open = false,\n position = 'right',\n role = 'dialog',\n 'aria-labelledby': ariaLabelledBy,\n}: DrawerProps) {\n logActionRequiredIf(\n 'Drawer now expects `onClose`, and will soon make this prop required. Please update your usage to provide it.',\n !onClose,\n );\n\n const { isMobile } = useLayout();\n const titleId = useId();\n\n const overlayId = useContext(OverlayIdContext);\n\n return (\n <Dimmer open={open} onClose={onClose} onExited={onUnmount}>\n <SlidingPanel open={open} position={isMobile ? Position.BOTTOM : position}>\n <div\n id={overlayId}\n role={role}\n aria-modal\n aria-labelledby={ariaLabelledBy || (headerTitle ? titleId : undefined)}\n className={clsx('np-drawer', className)}\n >\n <div\n className={clsx('np-drawer-header', {\n 'np-drawer-header--withborder': headerTitle,\n })}\n >\n {headerTitle && (\n <Title id={titleId} type={Typography.TITLE_BODY}>\n {headerTitle}\n </Title>\n )}\n <CloseButton onClick={onClose} />\n </div>\n {children && <div className={clsx('np-drawer-content')}>{children}</div>}\n {footerContent && <div className={clsx('np-drawer-footer')}>{footerContent}</div>}\n </div>\n </SlidingPanel>\n </Dimmer>\n );\n}\n"],"names":["Drawer","children","className","footerContent","headerTitle","onClose","onUnmount","open","position","role","ariaLabelledBy","logActionRequiredIf","isMobile","useLayout","titleId","useId","overlayId","useContext","OverlayIdContext","_jsx","Dimmer","onExited","SlidingPanel","Position","BOTTOM","_jsxs","id","undefined","clsx","Title","type","Typography","TITLE_BODY","CloseButton","onClick"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BwB,SAAAA,MAAMA,CAAC;EAC7BC,QAAQ;EACRC,SAAS;EACTC,aAAa;EACbC,WAAW;EACXC,OAAO;EACPC,SAAS;AACTC,EAAAA,IAAI,GAAG,KAAK;AACZC,YAAAA,UAAQ,GAAG,OAAO;AAClBC,EAAAA,IAAI,GAAG,QAAQ;AACf,EAAA,iBAAiB,EAAEC;AACP,CAAA,EAAA;AACZC,EAAAA,qCAAmB,CACjB,8GAA8G,EAC9G,CAACN,OAAO,CACT;EAED,MAAM;AAAEO,IAAAA;GAAU,GAAGC,mBAAS,EAAE;AAChC,EAAA,MAAMC,OAAO,GAAGC,WAAK,EAAE;AAEvB,EAAA,MAAMC,SAAS,GAAGC,gBAAU,CAACC,kCAAgB,CAAC;EAE9C,oBACEC,cAAA,CAACC,cAAM,EAAA;AAACb,IAAAA,IAAI,EAAEA,IAAK;AAACF,IAAAA,OAAO,EAAEA,OAAQ;AAACgB,IAAAA,QAAQ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AC;AAEb;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Drawer.mjs","sources":["../../src/drawer/Drawer.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { HTMLAttributes, useContext, useId } from 'react';\n\nimport { Position, Typography } from '../common';\nimport { CloseButton } from '../common/closeButton';\nimport { useLayout } from '../common/hooks';\nimport Dimmer from '../dimmer';\nimport { OverlayIdContext } from '../provider/overlay/OverlayIdProvider';\nimport SlidingPanel from '../slidingPanel';\nimport Title from '../title';\nimport { logActionRequiredIf } from '../utilities';\n\nexport type DrawerProps = {\n /** The content to appear in the drawer body. */\n children?: React.ReactNode;\n className?: string;\n /** The content to appear in the drawer footer. */\n footerContent?: React.ReactNode;\n /** The content to appear in the drawer header. */\n headerTitle?: React.ReactNode;\n /** The status of Drawer either open or not. */\n open?: boolean;\n /** The placement of Drawer on the screen either left or right. On mobile it will default to bottom. */\n position?: `${Position.LEFT | Position.RIGHT | Position.BOTTOM}`;\n /** The action to perform on close click. */\n onClose?: (event: KeyboardEvent | React.MouseEvent) => void;\n onUnmount?: () => void;\n} & Pick<HTMLAttributes<HTMLDivElement>, 'role' | 'aria-labelledby'>;\n\nexport default function Drawer({\n children,\n className,\n footerContent,\n headerTitle,\n onClose,\n onUnmount,\n open = false,\n position = 'right',\n role = 'dialog',\n 'aria-labelledby': ariaLabelledBy,\n}: DrawerProps) {\n logActionRequiredIf(\n 'Drawer now expects `onClose`, and will soon make this prop required. Please update your usage to provide it.',\n !onClose,\n );\n\n const { isMobile } = useLayout();\n const titleId = useId();\n\n const overlayId = useContext(OverlayIdContext);\n\n return (\n <Dimmer open={open} onClose={onClose} onExited={onUnmount}>\n <SlidingPanel open={open} position={isMobile ? Position.BOTTOM : position}>\n <div\n id={overlayId}\n role={role}\n aria-modal\n aria-labelledby={ariaLabelledBy || (headerTitle ? titleId : undefined)}\n className={clsx('np-drawer', className)}\n >\n <div\n className={clsx('np-drawer-header', {\n 'np-drawer-header--withborder': headerTitle,\n })}\n >\n {headerTitle && (\n <Title id={titleId} type={Typography.TITLE_BODY}>\n {headerTitle}\n </Title>\n )}\n <CloseButton onClick={onClose} />\n </div>\n {children && <div className={clsx('np-drawer-content')}>{children}</div>}\n {footerContent && <div className={clsx('np-drawer-footer')}>{footerContent}</div>}\n </div>\n </SlidingPanel>\n </Dimmer>\n );\n}\n"],"names":["Drawer","children","className","footerContent","headerTitle","onClose","onUnmount","open","position","role","ariaLabelledBy","logActionRequiredIf","isMobile","useLayout","titleId","useId","overlayId","useContext","OverlayIdContext","_jsx","Dimmer","onExited","SlidingPanel","Position","BOTTOM","_jsxs","id","undefined","clsx","Title","type","Typography","TITLE_BODY","CloseButton","onClick"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BwB,SAAAA,MAAMA,CAAC;EAC7BC,QAAQ;EACRC,SAAS;EACTC,aAAa;EACbC,WAAW;EACXC,OAAO;EACPC,SAAS;AACTC,EAAAA,IAAI,GAAG,KAAK;AACZC,EAAAA,QAAQ,GAAG,OAAO;AAClBC,EAAAA,IAAI,GAAG,QAAQ;AACf,EAAA,iBAAiB,EAAEC
|
|
1
|
+
{"version":3,"file":"Drawer.mjs","sources":["../../src/drawer/Drawer.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { HTMLAttributes, useContext, useId } from 'react';\n\nimport { Position, Typography } from '../common';\nimport { CloseButton } from '../common/closeButton';\nimport { useLayout } from '../common/hooks';\nimport Dimmer from '../dimmer';\nimport { OverlayIdContext } from '../provider/overlay/OverlayIdProvider';\nimport SlidingPanel from '../slidingPanel';\nimport Title from '../title';\nimport { logActionRequiredIf } from '../utilities';\n\nexport type DrawerProps = {\n /** The content to appear in the drawer body. */\n children?: React.ReactNode;\n className?: string;\n /** The content to appear in the drawer footer. */\n footerContent?: React.ReactNode;\n /** The content to appear in the drawer header. */\n headerTitle?: React.ReactNode;\n /** The status of Drawer either open or not. */\n open?: boolean;\n /** The placement of Drawer on the screen either left or right. On mobile it will default to bottom. */\n position?: `${Position.LEFT | Position.RIGHT | Position.BOTTOM}`;\n /** The action to perform on close click. */\n onClose?: (event: KeyboardEvent | React.MouseEvent) => void;\n onUnmount?: () => void;\n} & Pick<HTMLAttributes<HTMLDivElement>, 'role' | 'aria-labelledby'>;\n\nexport default function Drawer({\n children,\n className,\n footerContent,\n headerTitle,\n onClose,\n onUnmount,\n open = false,\n position = 'right',\n role = 'dialog',\n 'aria-labelledby': ariaLabelledBy,\n}: DrawerProps) {\n logActionRequiredIf(\n 'Drawer now expects `onClose`, and will soon make this prop required. Please update your usage to provide it.',\n !onClose,\n );\n\n const { isMobile } = useLayout();\n const titleId = useId();\n\n const overlayId = useContext(OverlayIdContext);\n\n return (\n <Dimmer open={open} onClose={onClose} onExited={onUnmount}>\n <SlidingPanel open={open} position={isMobile ? Position.BOTTOM : position}>\n <div\n id={overlayId}\n role={role}\n aria-modal\n aria-labelledby={ariaLabelledBy || (headerTitle ? titleId : undefined)}\n className={clsx('np-drawer', className)}\n >\n <div\n className={clsx('np-drawer-header', {\n 'np-drawer-header--withborder': headerTitle,\n })}\n >\n {headerTitle && (\n <Title id={titleId} type={Typography.TITLE_BODY}>\n {headerTitle}\n </Title>\n )}\n <CloseButton onClick={onClose} />\n </div>\n {children && <div className={clsx('np-drawer-content')}>{children}</div>}\n {footerContent && <div className={clsx('np-drawer-footer')}>{footerContent}</div>}\n </div>\n </SlidingPanel>\n </Dimmer>\n );\n}\n"],"names":["Drawer","children","className","footerContent","headerTitle","onClose","onUnmount","open","position","role","ariaLabelledBy","logActionRequiredIf","isMobile","useLayout","titleId","useId","overlayId","useContext","OverlayIdContext","_jsx","Dimmer","onExited","SlidingPanel","Position","BOTTOM","_jsxs","id","undefined","clsx","Title","type","Typography","TITLE_BODY","CloseButton","onClick"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BwB,SAAAA,MAAMA,CAAC;EAC7BC,QAAQ;EACRC,SAAS;EACTC,aAAa;EACb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YAACgB,IAAI,EAAEC,UAAU,CAACC,UAAW;AAAA/B,YAAAA,QAAA,EAC7CG;AAAW,WACP,CACR,eACDe,GAAA,CAACc,WAAW,EAAA;AAACC,YAAAA,OAAO,EAAE7B;AAAQ,WAChC,CAAA;AAAA,SAAK,CACL,EAACJ,QAAQ,iBAAIkB,GAAA,CAAA,KAAA,EAAA;AAAKjB,UAAAA,SAAS,EAAE0B,IAAI,CAAC,mBAAmB,CAAE;AAAA3B,UAAAA,QAAA,EAAEA;AAAQ,SAAM,CAAC,EACvEE,aAAa,iBAAIgB,GAAA,CAAA,KAAA,EAAA;AAAKjB,UAAAA,SAAS,EAAE0B,IAAI,CAAC,kBAAkB,CAAE;AAAA3B,UAAAA,QAAA,EAAEE;AAAa,SAAM,CAAC;OAC9E;KACO;AAChB,GAAQ,CAAC;AAEb;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropFade.js","sources":["../../src/dropFade/DropFade.tsx"],"sourcesContent":["import React, { useRef, useState, ReactElement } from 'react';\nimport { CSSTransition } from 'react-transition-group';\n\nconst DropFade = ({ children, show }: { children: ReactElement; show: boolean }) => {\n const reference = useRef<HTMLDivElement>(null);\n const [height, setHeight] = useState<number | undefined>(0);\n\n const clonedChild = React.cloneElement(children);\n\n return (\n <CSSTransition\n nodeRef={reference}\n in={show}\n timeout={300}\n classNames=\"np-dropfade\"\n onEntering={() => {\n // Set height so we can animate to the correct height\n setHeight(reference.current?.scrollHeight || 0);\n }}\n // Un-set height, as we don't want to presume it should be that height forever\n onEntered={() => setHeight(undefined)}\n onExit={() => {\n setHeight(reference.current?.scrollHeight || 0);\n }}\n onExiting={() => {\n setHeight(0);\n }}\n >\n <div ref={reference} style={{ height }} className=\"np-dropfade\">\n {clonedChild}\n </div>\n </CSSTransition>\n );\n};\n\nexport default DropFade;\n"],"names":["DropFade","children","show","reference","useRef","height","setHeight","useState","clonedChild","React","cloneElement","_jsx","CSSTransition","nodeRef","in","timeout","classNames","onEntering","current","scrollHeight","onEntered","undefined","onExit","onExiting","ref","style","className"],"mappings":";;;;;;;;;;;;AAGMA,MAAAA,QAAQ,GAAGA,CAAC;EAAEC,QAAQ;AAAEC,EAAAA
|
|
1
|
+
{"version":3,"file":"DropFade.js","sources":["../../src/dropFade/DropFade.tsx"],"sourcesContent":["import React, { useRef, useState, ReactElement } from 'react';\nimport { CSSTransition } from 'react-transition-group';\n\nconst DropFade = ({ children, show }: { children: ReactElement; show: boolean }) => {\n const reference = useRef<HTMLDivElement>(null);\n const [height, setHeight] = useState<number | undefined>(0);\n\n const clonedChild = React.cloneElement(children);\n\n return (\n <CSSTransition\n nodeRef={reference}\n in={show}\n timeout={300}\n classNames=\"np-dropfade\"\n onEntering={() => {\n // Set height so we can animate to the correct height\n setHeight(reference.current?.scrollHeight || 0);\n }}\n // Un-set height, as we don't want to presume it should be that height forever\n onEntered={() => setHeight(undefined)}\n onExit={() => {\n setHeight(reference.current?.scrollHeight || 0);\n }}\n onExiting={() => {\n setHeight(0);\n }}\n >\n <div ref={reference} style={{ height }} className=\"np-dropfade\">\n {clonedChild}\n </div>\n </CSSTransition>\n );\n};\n\nexport default DropFade;\n"],"names":["DropFade","children","show","reference","useRef","height","setHeight","useState","clonedChild","React","cloneElement","_jsx","CSSTransition","nodeRef","in","timeout","classNames","onEntering","current","scrollHeight","onEntered","undefined","onExit","onExiting","ref","style","className"],"mappings":";;;;;;;;;;;;AAGMA,MAAAA,QAAQ,GAAGA,CAAC;EAAEC,QAAQ;AAAEC,EAAAA;AAAiD,CAAA,KAAI;AACjF,EAAA,MAAMC,SAAS,GAAGC,YAAM,CAAiB,IAAI,CAAC;EAC9C,MAAM,CAACC,MAAM,EAAEC,SAAS,CAAC,GAAGC,cAAQ,CAAqB,CAAC,CAAC;AAE3D,EAAA,MAAMC,WAAW,gBAAGC,sBAAK,CAACC,YAAY,CAACT,QAAQ,CAAC;EAEhD,oBACEU,cAAA,CAACC,kCAAa,EAAA;AACZC,IAAAA,OAAO,EAAEV,SAAU;AACnBW,IAAAA,EAAE,EAAEZ,IAAK;AACTa,IAAAA,OAAO,EAAE,GAAI;AACbC,IAAAA,UAAU,EAAC,aAAa;IACxBC,UAAU,EAAEA,MAAK;AACf;MACAX,SAAS,CAACH,SAAS,CAACe,OAAO,EAAEC,YAAY,IAAI,CAAC,CAAC;AACjD;AACA;AAAA;AACAC,IAAAA,SAAS,EAAEA,MAAMd,SAAS,CAACe,SAAS,CAAE;IACtCC,MAAM,EAAEA,MAAK;MACXhB,SAAS,CAACH,SAAS,CAACe,OAAO,EAAEC,YAAY,IAAI,CAAC,CAAC;KAC/C;IACFI,SAAS,EAAEA,MAAK;MACdjB,SAAS,CAAC,CAAC,CAAC;KACZ;AAAAL,IAAAA,QAAA,eAEFU,cAAA,CAAA,KAAA,EAAA;AAAKa,MAAAA,GAAG,EAAErB,SAAU;AAACsB,MAAAA,KAAK,EAAE;AAAEpB,QAAAA;OAAS;AAACqB,MAAAA,SAAS,EAAC,aAAa;AAAAzB,MAAAA,QAAA,EAC5DO;KACE;AACP,GAAe,CAAC;AAEpB;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropFade.mjs","sources":["../../src/dropFade/DropFade.tsx"],"sourcesContent":["import React, { useRef, useState, ReactElement } from 'react';\nimport { CSSTransition } from 'react-transition-group';\n\nconst DropFade = ({ children, show }: { children: ReactElement; show: boolean }) => {\n const reference = useRef<HTMLDivElement>(null);\n const [height, setHeight] = useState<number | undefined>(0);\n\n const clonedChild = React.cloneElement(children);\n\n return (\n <CSSTransition\n nodeRef={reference}\n in={show}\n timeout={300}\n classNames=\"np-dropfade\"\n onEntering={() => {\n // Set height so we can animate to the correct height\n setHeight(reference.current?.scrollHeight || 0);\n }}\n // Un-set height, as we don't want to presume it should be that height forever\n onEntered={() => setHeight(undefined)}\n onExit={() => {\n setHeight(reference.current?.scrollHeight || 0);\n }}\n onExiting={() => {\n setHeight(0);\n }}\n >\n <div ref={reference} style={{ height }} className=\"np-dropfade\">\n {clonedChild}\n </div>\n </CSSTransition>\n );\n};\n\nexport default DropFade;\n"],"names":["DropFade","children","show","reference","useRef","height","setHeight","useState","clonedChild","React","cloneElement","_jsx","CSSTransition","nodeRef","in","timeout","classNames","onEntering","current","scrollHeight","onEntered","undefined","onExit","onExiting","ref","style","className"],"mappings":";;;;AAGMA,MAAAA,QAAQ,GAAGA,CAAC;EAAEC,QAAQ;AAAEC,EAAAA
|
|
1
|
+
{"version":3,"file":"DropFade.mjs","sources":["../../src/dropFade/DropFade.tsx"],"sourcesContent":["import React, { useRef, useState, ReactElement } from 'react';\nimport { CSSTransition } from 'react-transition-group';\n\nconst DropFade = ({ children, show }: { children: ReactElement; show: boolean }) => {\n const reference = useRef<HTMLDivElement>(null);\n const [height, setHeight] = useState<number | undefined>(0);\n\n const clonedChild = React.cloneElement(children);\n\n return (\n <CSSTransition\n nodeRef={reference}\n in={show}\n timeout={300}\n classNames=\"np-dropfade\"\n onEntering={() => {\n // Set height so we can animate to the correct height\n setHeight(reference.current?.scrollHeight || 0);\n }}\n // Un-set height, as we don't want to presume it should be that height forever\n onEntered={() => setHeight(undefined)}\n onExit={() => {\n setHeight(reference.current?.scrollHeight || 0);\n }}\n onExiting={() => {\n setHeight(0);\n }}\n >\n <div ref={reference} style={{ height }} className=\"np-dropfade\">\n {clonedChild}\n </div>\n </CSSTransition>\n );\n};\n\nexport default DropFade;\n"],"names":["DropFade","children","show","reference","useRef","height","setHeight","useState","clonedChild","React","cloneElement","_jsx","CSSTransition","nodeRef","in","timeout","classNames","onEntering","current","scrollHeight","onEntered","undefined","onExit","onExiting","ref","style","className"],"mappings":";;;;AAGMA,MAAAA,QAAQ,GAAGA,CAAC;EAAEC,QAAQ;AAAEC,EAAAA;AAAiD,CAAA,KAAI;AACjF,EAAA,MAAMC,SAAS,GAAGC,MAAM,CAAiB,IAAI,CAAC;EAC9C,MAAM,CAACC,MAAM,EAAEC,SAAS,CAAC,GAAGC,QAAQ,CAAqB,CAAC,CAAC;AAE3D,EAAA,MAAMC,WAAW,gBAAGC,cAAK,CAACC,YAAY,CAACT,QAAQ,CAAC;EAEhD,oBACEU,GAAA,CAACC,aAAa,EAAA;AACZC,IAAAA,OAAO,EAAEV,SAAU;AACnBW,IAAAA,EAAE,EAAEZ,IAAK;AACTa,IAAAA,OAAO,EAAE,GAAI;AACbC,IAAAA,UAAU,EAAC,aAAa;IACxBC,UAAU,EAAEA,MAAK;AACf;MACAX,SAAS,CAACH,SAAS,CAACe,OAAO,EAAEC,YAAY,IAAI,CAAC,CAAC;AACjD;AACA;AAAA;AACAC,IAAAA,SAAS,EAAEA,MAAMd,SAAS,CAACe,SAAS,CAAE;IACtCC,MAAM,EAAEA,MAAK;MACXhB,SAAS,CAACH,SAAS,CAACe,OAAO,EAAEC,YAAY,IAAI,CAAC,CAAC;KAC/C;IACFI,SAAS,EAAEA,MAAK;MACdjB,SAAS,CAAC,CAAC,CAAC;KACZ;AAAAL,IAAAA,QAAA,eAEFU,GAAA,CAAA,KAAA,EAAA;AAAKa,MAAAA,GAAG,EAAErB,SAAU;AAACsB,MAAAA,KAAK,EAAE;AAAEpB,QAAAA;OAAS;AAACqB,MAAAA,SAAS,EAAC,aAAa;AAAAzB,MAAAA,QAAA,EAC5DO;KACE;AACP,GAAe,CAAC;AAEpB;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Emphasis.js","sources":["../../src/emphasis/Emphasis.tsx"],"sourcesContent":["import EmphasisHtmlTransformer from './EmphasisHtmlTransformer';\n\nconst SUPPORTED_TAGS = ['important', 'positive', 'negative', 'warning'];\nconst emphasisHtmlTransformer = new EmphasisHtmlTransformer(SUPPORTED_TAGS);\n\nexport type EmphasisProps = {\n text?: string;\n};\n\nconst Emphasis = ({ text = undefined }: EmphasisProps) => {\n if (!text) {\n return null;\n }\n\n const transformedText = emphasisHtmlTransformer.transform(text);\n // eslint-disable-next-line react/no-danger\n return transformedText ? <span dangerouslySetInnerHTML={{ __html: transformedText }} /> : null;\n};\n\nexport default Emphasis;\n"],"names":["SUPPORTED_TAGS","emphasisHtmlTransformer","EmphasisHtmlTransformer","Emphasis","text","undefined","transformedText","transform","_jsx","dangerouslySetInnerHTML","__html"],"mappings":";;;;;;;AAEA,MAAMA,cAAc,GAAG,CAAC,WAAW,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,CAAC
|
|
1
|
+
{"version":3,"file":"Emphasis.js","sources":["../../src/emphasis/Emphasis.tsx"],"sourcesContent":["import EmphasisHtmlTransformer from './EmphasisHtmlTransformer';\n\nconst SUPPORTED_TAGS = ['important', 'positive', 'negative', 'warning'];\nconst emphasisHtmlTransformer = new EmphasisHtmlTransformer(SUPPORTED_TAGS);\n\nexport type EmphasisProps = {\n text?: string;\n};\n\nconst Emphasis = ({ text = undefined }: EmphasisProps) => {\n if (!text) {\n return null;\n }\n\n const transformedText = emphasisHtmlTransformer.transform(text);\n // eslint-disable-next-line react/no-danger\n return transformedText ? <span dangerouslySetInnerHTML={{ __html: transformedText }} /> : null;\n};\n\nexport default Emphasis;\n"],"names":["SUPPORTED_TAGS","emphasisHtmlTransformer","EmphasisHtmlTransformer","Emphasis","text","undefined","transformedText","transform","_jsx","dangerouslySetInnerHTML","__html"],"mappings":";;;;;;;AAEA,MAAMA,cAAc,GAAG,CAAC,WAAW,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,CAAC;AACvE,MAAMC,uBAAuB,GAAG,IAAIC,+BAAuB,CAACF,cAAc,CAAC;AAMrEG,MAAAA,QAAQ,GAAGA,CAAC;AAAEC,EAAAA,IAAI,GAAGC;AAA0B,CAAA,KAAI;EACvD,IAAI,CAACD,IAAI,EAAE;AACT,IAAA,OAAO,IAAI;AACb;AAEA,EAAA,MAAME,eAAe,GAAGL,uBAAuB,CAACM,SAAS,CAACH,IAAI,CAAC;AAC/D;EACA,OAAOE,eAAe,gBAAGE,cAAA,CAAA,MAAA,EAAA;AAAMC,IAAAA,uBAAuB,EAAE;AAAEC,MAAAA,MAAM,EAAEJ;AAAiB;IAAI,GAAG,IAAI;AAChG;;;;"}
|