@transferwise/components 46.99.0 → 46.100.1
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 +4 -0
- package/build/accordion/Accordion.js.map +1 -1
- package/build/accordion/Accordion.mjs +4 -0
- package/build/accordion/Accordion.mjs.map +1 -1
- package/build/accordion/AccordionItem/AccordionItem.js +14 -5
- package/build/accordion/AccordionItem/AccordionItem.js.map +1 -1
- package/build/accordion/AccordionItem/AccordionItem.mjs +14 -5
- 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.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.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.mjs.map +1 -1
- package/build/common/colors.js.map +1 -1
- package/build/common/colors.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/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/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 +1 -1
- package/build/common/locale/index.js.map +1 -1
- package/build/common/locale/index.mjs +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/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.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.map +1 -1
- 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.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.map +1 -1
- package/build/dateLookup/dayCalendar/table/DayCalendarTable.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.map +1 -1
- 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.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/index.js +2 -0
- package/build/i18n/index.js.map +1 -1
- package/build/i18n/index.mjs +2 -0
- package/build/i18n/index.mjs.map +1 -1
- package/build/i18n/nl.json.js +81 -0
- package/build/i18n/nl.json.js.map +1 -0
- package/build/i18n/nl.json.mjs +77 -0
- package/build/i18n/nl.json.mjs.map +1 -0
- 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.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/inputs/Input.js.map +1 -1
- package/build/inputs/Input.mjs.map +1 -1
- package/build/inputs/InputGroup.js.map +1 -1
- 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.map +1 -1
- package/build/inputs/SelectInput.mjs.map +1 -1
- package/build/inputs/_BottomSheet.js.map +1 -1
- 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.map +1 -1
- package/build/inputs/_Popover.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.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.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.map +1 -1
- package/build/logo/logo-assets.js.map +1 -1
- package/build/logo/logo-assets.mjs.map +1 -1
- package/build/main.css +16 -16
- package/build/markdown/Markdown.js.map +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.map +1 -1
- 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.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/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/isValidPhoneNumber/isValidPhoneNumber.js.map +1 -1
- package/build/phoneNumberInput/utils/isValidPhoneNumber/isValidPhoneNumber.mjs.map +1 -1
- package/build/phoneNumberInput/utils/longestMatchingPrefix/index.js.map +1 -1
- package/build/phoneNumberInput/utils/longestMatchingPrefix/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.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.map +1 -1
- package/build/promoCard/PromoCardGroup.mjs.map +1 -1
- package/build/promoCard/PromoCardIndicator.js.map +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.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.map +1 -1
- 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/slidingPanel/SlidingPanel.js.map +1 -1
- package/build/slidingPanel/SlidingPanel.mjs.map +1 -1
- package/build/snackbar/Snackbar.js.map +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.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/styles/accordion/Accordion.css +4 -1
- package/build/styles/main.css +16 -16
- package/build/styles/switch/Switch.css +22 -41
- package/build/styles/switchOption/SwitchOption.css +4 -0
- package/build/summary/Summary.js.map +1 -1
- package/build/summary/Summary.mjs.map +1 -1
- package/build/switch/Switch.js +7 -18
- package/build/switch/Switch.js.map +1 -1
- package/build/switch/Switch.mjs +8 -19
- package/build/switch/Switch.mjs.map +1 -1
- package/build/switchOption/SwitchOption.js +1 -0
- package/build/switchOption/SwitchOption.js.map +1 -1
- package/build/switchOption/SwitchOption.mjs +1 -0
- package/build/switchOption/SwitchOption.mjs.map +1 -1
- package/build/table/Table.js.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.map +1 -1
- package/build/tabs/Tabs.mjs.map +1 -1
- package/build/tabs/utils.js.map +1 -1
- package/build/tabs/utils.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.map +1 -1
- package/build/typeahead/Typeahead.mjs.map +1 -1
- package/build/typeahead/typeaheadInput/TypeaheadInput.js.map +1 -1
- 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/accordion/Accordion.d.ts +1 -1
- package/build/types/accordion/Accordion.d.ts.map +1 -1
- package/build/types/accordion/AccordionItem/AccordionItem.d.ts +12 -0
- package/build/types/accordion/AccordionItem/AccordionItem.d.ts.map +1 -1
- package/build/types/common/locale/index.d.ts.map +1 -1
- package/build/types/i18n/index.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/upload/Upload.js.map +1 -1
- 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.map +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.mjs.map +1 -1
- package/build/uploadInput/uploadButton/UploadButton.js.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.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.map +1 -1
- package/build/withNextPortal/withNextPortal.mjs.map +1 -1
- package/package.json +24 -24
- package/src/accordion/Accordion.css +4 -1
- package/src/accordion/Accordion.less +10 -5
- package/src/accordion/Accordion.story.tsx +60 -22
- package/src/accordion/Accordion.tsx +5 -4
- package/src/accordion/AccordionItem/AccordionItem.tsx +25 -4
- package/src/actionButton/ActionButton.story.tsx +0 -1
- package/src/actionOption/ActionOption.story.tsx +0 -1
- package/src/alert/Alert.story.tsx +1 -1
- package/src/avatar/Avatar.spec.tsx +7 -4
- package/src/avatar/Avatar.story.tsx +0 -1
- package/src/avatarLayout/AvatarLayout.story.tsx +0 -3
- package/src/avatarView/AvatarView.story.tsx +0 -6
- package/src/avatarWrapper/AvatarWrapper.story.tsx +0 -1
- package/src/badge/Badge.story.tsx +0 -1
- package/src/body/Body.story.tsx +0 -1
- package/src/button/Button.story.tsx +1 -1
- package/src/button/LegacyButton.story.tsx +1 -1
- package/src/card/Card.story.tsx +0 -1
- package/src/checkbox/Checkbox.story.tsx +0 -1
- package/src/checkboxButton/CheckboxButton.story.tsx +1 -1
- package/src/checkboxOption/CheckboxOption.story.tsx +0 -1
- package/src/chevron/Chevron.story.tsx +0 -1
- package/src/chips/Chips.story.tsx +0 -1
- package/src/circularButton/CircularButton.story.tsx +1 -1
- package/src/common/bottomSheet/BottomSheet.story.tsx +5 -4
- package/src/common/card/Card.story.tsx +0 -1
- package/src/common/circle/Circle.story.tsx +0 -1
- package/src/common/locale/index.spec.ts +1 -1
- package/src/common/locale/index.ts +2 -0
- package/src/criticalBanner/CriticalCommsBanner.story.tsx +0 -1
- package/src/dateInput/DateInput.story.tsx +0 -1
- package/src/divider/Divider.story.tsx +1 -1
- package/src/emphasis/Emphasis.story.tsx +0 -1
- package/src/field/Field.story.tsx +1 -1
- package/src/i18n/index.ts +2 -0
- package/src/iconButton/IconButton.story.tsx +0 -1
- package/src/info/Info.story.tsx +1 -0
- package/src/inputWithDisplayFormat/InputWithDisplayFormat.story.tsx +1 -0
- package/src/inputs/SelectInput.story.tsx +1 -1
- package/src/instructionsList/InstructionsList.story.tsx +0 -1
- package/src/label/Label.story.tsx +0 -1
- package/src/legacylistItem/LegacyListItem.story.tsx +0 -1
- package/src/loader/Loader.story.tsx +0 -1
- package/src/logo/Logo.story.tsx +0 -1
- package/src/main.css +16 -16
- package/src/main.less +1 -0
- package/src/markdown/Markdown.story.tsx +0 -1
- package/src/modal/Modal.story.tsx +11 -6
- package/src/moneyInput/MoneyInput.story.tsx +0 -1
- package/src/navigationOption/NavigationOption.story.tsx +0 -1
- package/src/phoneNumberInput/PhoneNumberInput.story.tsx +0 -1
- package/src/popover/Popover.story.tsx +1 -1
- package/src/primitives/PrimitiveAnchor/stories/PrimitiveAnchor.story.tsx +0 -1
- package/src/primitives/PrimitiveButton/stories/PrimitiveButton.story.tsx +0 -1
- package/src/primitives/PrimitiveButton/stories/PrimitiveButton.tests.story.tsx +0 -1
- package/src/processIndicator/ProcessIndicator.story.tsx +0 -1
- package/src/progressBar/ProgressBar.story.tsx +0 -1
- package/src/promoCard/PromoCard.story.tsx +1 -1
- package/src/promoCard/PromoCardGroup.story.tsx +0 -1
- package/src/statusIcon/StatusIcon.story.tsx +1 -1
- package/src/stepper/Stepper.story.tsx +0 -1
- package/src/sticky/Sticky.story.tsx +1 -1
- package/src/switch/Switch.css +22 -41
- package/src/switch/Switch.less +6 -12
- package/src/switch/Switch.spec.tsx +11 -9
- package/src/switch/Switch.story.tsx +157 -33
- package/src/switch/Switch.tsx +6 -15
- package/src/switchOption/SwitchOption.css +4 -0
- package/src/switchOption/SwitchOption.less +8 -0
- package/src/switchOption/SwitchOption.spec.tsx +4 -5
- package/src/switchOption/SwitchOption.story.tsx +42 -38
- package/src/switchOption/SwitchOption.tsx +1 -0
- package/src/table/Table.story.tsx +0 -1
- package/src/tabs/Tabs.story.tsx +0 -1
- package/src/tooltip/Tooltip.story.tsx +0 -1
- package/src/typeahead/Typeahead.story.tsx +1 -0
- package/src/upload/Upload.story.tsx +1 -1
- package/src/uploadInput/UploadInput.story.tsx +0 -1
- package/src/switch/__snapshots__/Switch.spec.tsx.snap +0 -44
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Stepper.js","sources":["../../src/stepper/Stepper.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport * as React from 'react';\n\nimport { Position } from '../common';\nimport { useDirection } from '../common/hooks';\nimport Tooltip from '../tooltip';\n\nimport { isTouchDevice } from './deviceDetection';\n\nfunction clamp(from: number, to: number, value: number) {\n return Math.max(Math.min(to, value), from);\n}\n\nexport interface Step {\n label: React.ReactNode;\n onClick?: () => void;\n hoverLabel?: React.ReactNode;\n}\n\nexport interface StepperProps {\n steps: readonly Step[];\n activeStep?: number;\n className?: string;\n testId?: string;\n}\n\n/**\n * This component is considered user-unfriendly and inaccessible on its own and will likely be made internal in the future. Please use `FlowNavigation` instead.\n * @see https://storybook.wise.design/?path=/story/navigation-flownavigation--variants\n */\nconst Stepper = ({ steps, activeStep = 0, className, testId }: StepperProps) => {\n const { isRTL } = useDirection();\n\n if (steps.length === 0) {\n return null;\n }\n\n const activeStepIndex = clamp(0, steps.length - 1, activeStep);\n const stepPercentage = 1 / (steps.length - 1);\n const percentageCompleted = activeStepIndex / (steps.length - 1);\n\n const getProgressWidth = (): string => {\n if (percentageCompleted === 0) {\n return '0%';\n }\n /**\n * Progress bar starts with left/right (depends on rtl) shift `--progress-bar-start-shift` for hiding Progress bar's left and right borders\n * which are used for progress vertical delimiter.\n * When progress is completed, we need to add `--progress-bar-border-width` to the width to allow the right border be outside of the progress area.\n */\n return `calc(${percentageCompleted * 100}% + var(--progress-bar-start-shift) + var(--progress-bar-border-width))`;\n };\n\n const renderStep = (step: Step, index: number) => {\n const active = index === activeStepIndex;\n const clickable = step.onClick && !active;\n\n const labelButton = clickable ? (\n <button\n type=\"button\"\n className=\"btn-unstyled tw-stepper__step-label\"\n onClick={() => clickable && step.onClick?.()}\n >\n <small>{step.label}</small>\n </button>\n ) : (\n <span className=\"tw-stepper__step-label\">{step.label}</span>\n );\n\n return (\n <li\n key={index}\n className={clsx(\n 'hidden-xs',\n 'tw-stepper__step',\n active ? 'np-text-body-default-bold tw-stepper__step--active' : 'np-text-body-default',\n clickable && 'tw-stepper__step--clickable',\n step.hoverLabel && 'tw-stepper__step--has-tooltip',\n )}\n aria-current={active ? 'step' : false}\n style={\n isRTL\n ? { right: `${index * stepPercentage * 100}%` }\n : { left: `${index * stepPercentage * 100}%` }\n }\n >\n {step.hoverLabel && !isTouchDevice() ? (\n <Tooltip position={Position.BOTTOM} label={step.hoverLabel}>\n {labelButton}\n </Tooltip>\n ) : (\n labelButton\n )}\n </li>\n );\n };\n\n return (\n <div className={clsx('tw-stepper', className)} data-testid={testId}>\n <div className=\"progress\">\n <div\n className=\"progress-bar\"\n style={{ width: getProgressWidth() }}\n data-testid=\"progress-bar\"\n />\n </div>\n <ol className=\"tw-stepper-steps p-t-1 m-b-0\">{steps.map(renderStep)}</ol>\n </div>\n );\n};\n\nexport default Stepper;\n"],"names":["clamp","from","to","value","Math","max","min","Stepper","steps","activeStep","className","testId","isRTL","useDirection","length","activeStepIndex","stepPercentage","percentageCompleted","getProgressWidth","renderStep","step","index","active","clickable","onClick","labelButton","_jsx","type","children","label","clsx","hoverLabel","style","right","left","isTouchDevice","Tooltip","position","Position","BOTTOM","_jsxs","width","map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,SAASA,KAAKA,CAACC,IAAY,EAAEC,EAAU,EAAEC,KAAa,EAAA;AACpD,EAAA,OAAOC,IAAI,CAACC,GAAG,CAACD,IAAI,CAACE,GAAG,CAACJ,EAAE,EAAEC,KAAK,CAAC,EAAEF,IAAI,CAAC;AAC5C;AAeA;;;AAGG;
|
|
1
|
+
{"version":3,"file":"Stepper.js","sources":["../../src/stepper/Stepper.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport * as React from 'react';\n\nimport { Position } from '../common';\nimport { useDirection } from '../common/hooks';\nimport Tooltip from '../tooltip';\n\nimport { isTouchDevice } from './deviceDetection';\n\nfunction clamp(from: number, to: number, value: number) {\n return Math.max(Math.min(to, value), from);\n}\n\nexport interface Step {\n label: React.ReactNode;\n onClick?: () => void;\n hoverLabel?: React.ReactNode;\n}\n\nexport interface StepperProps {\n steps: readonly Step[];\n activeStep?: number;\n className?: string;\n testId?: string;\n}\n\n/**\n * This component is considered user-unfriendly and inaccessible on its own and will likely be made internal in the future. Please use `FlowNavigation` instead.\n * @see https://storybook.wise.design/?path=/story/navigation-flownavigation--variants\n */\nconst Stepper = ({ steps, activeStep = 0, className, testId }: StepperProps) => {\n const { isRTL } = useDirection();\n\n if (steps.length === 0) {\n return null;\n }\n\n const activeStepIndex = clamp(0, steps.length - 1, activeStep);\n const stepPercentage = 1 / (steps.length - 1);\n const percentageCompleted = activeStepIndex / (steps.length - 1);\n\n const getProgressWidth = (): string => {\n if (percentageCompleted === 0) {\n return '0%';\n }\n /**\n * Progress bar starts with left/right (depends on rtl) shift `--progress-bar-start-shift` for hiding Progress bar's left and right borders\n * which are used for progress vertical delimiter.\n * When progress is completed, we need to add `--progress-bar-border-width` to the width to allow the right border be outside of the progress area.\n */\n return `calc(${percentageCompleted * 100}% + var(--progress-bar-start-shift) + var(--progress-bar-border-width))`;\n };\n\n const renderStep = (step: Step, index: number) => {\n const active = index === activeStepIndex;\n const clickable = step.onClick && !active;\n\n const labelButton = clickable ? (\n <button\n type=\"button\"\n className=\"btn-unstyled tw-stepper__step-label\"\n onClick={() => clickable && step.onClick?.()}\n >\n <small>{step.label}</small>\n </button>\n ) : (\n <span className=\"tw-stepper__step-label\">{step.label}</span>\n );\n\n return (\n <li\n key={index}\n className={clsx(\n 'hidden-xs',\n 'tw-stepper__step',\n active ? 'np-text-body-default-bold tw-stepper__step--active' : 'np-text-body-default',\n clickable && 'tw-stepper__step--clickable',\n step.hoverLabel && 'tw-stepper__step--has-tooltip',\n )}\n aria-current={active ? 'step' : false}\n style={\n isRTL\n ? { right: `${index * stepPercentage * 100}%` }\n : { left: `${index * stepPercentage * 100}%` }\n }\n >\n {step.hoverLabel && !isTouchDevice() ? (\n <Tooltip position={Position.BOTTOM} label={step.hoverLabel}>\n {labelButton}\n </Tooltip>\n ) : (\n labelButton\n )}\n </li>\n );\n };\n\n return (\n <div className={clsx('tw-stepper', className)} data-testid={testId}>\n <div className=\"progress\">\n <div\n className=\"progress-bar\"\n style={{ width: getProgressWidth() }}\n data-testid=\"progress-bar\"\n />\n </div>\n <ol className=\"tw-stepper-steps p-t-1 m-b-0\">{steps.map(renderStep)}</ol>\n </div>\n );\n};\n\nexport default Stepper;\n"],"names":["clamp","from","to","value","Math","max","min","Stepper","steps","activeStep","className","testId","isRTL","useDirection","length","activeStepIndex","stepPercentage","percentageCompleted","getProgressWidth","renderStep","step","index","active","clickable","onClick","labelButton","_jsx","type","children","label","clsx","hoverLabel","style","right","left","isTouchDevice","Tooltip","position","Position","BOTTOM","_jsxs","width","map"],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Stepper.mjs","sources":["../../src/stepper/Stepper.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport * as React from 'react';\n\nimport { Position } from '../common';\nimport { useDirection } from '../common/hooks';\nimport Tooltip from '../tooltip';\n\nimport { isTouchDevice } from './deviceDetection';\n\nfunction clamp(from: number, to: number, value: number) {\n return Math.max(Math.min(to, value), from);\n}\n\nexport interface Step {\n label: React.ReactNode;\n onClick?: () => void;\n hoverLabel?: React.ReactNode;\n}\n\nexport interface StepperProps {\n steps: readonly Step[];\n activeStep?: number;\n className?: string;\n testId?: string;\n}\n\n/**\n * This component is considered user-unfriendly and inaccessible on its own and will likely be made internal in the future. Please use `FlowNavigation` instead.\n * @see https://storybook.wise.design/?path=/story/navigation-flownavigation--variants\n */\nconst Stepper = ({ steps, activeStep = 0, className, testId }: StepperProps) => {\n const { isRTL } = useDirection();\n\n if (steps.length === 0) {\n return null;\n }\n\n const activeStepIndex = clamp(0, steps.length - 1, activeStep);\n const stepPercentage = 1 / (steps.length - 1);\n const percentageCompleted = activeStepIndex / (steps.length - 1);\n\n const getProgressWidth = (): string => {\n if (percentageCompleted === 0) {\n return '0%';\n }\n /**\n * Progress bar starts with left/right (depends on rtl) shift `--progress-bar-start-shift` for hiding Progress bar's left and right borders\n * which are used for progress vertical delimiter.\n * When progress is completed, we need to add `--progress-bar-border-width` to the width to allow the right border be outside of the progress area.\n */\n return `calc(${percentageCompleted * 100}% + var(--progress-bar-start-shift) + var(--progress-bar-border-width))`;\n };\n\n const renderStep = (step: Step, index: number) => {\n const active = index === activeStepIndex;\n const clickable = step.onClick && !active;\n\n const labelButton = clickable ? (\n <button\n type=\"button\"\n className=\"btn-unstyled tw-stepper__step-label\"\n onClick={() => clickable && step.onClick?.()}\n >\n <small>{step.label}</small>\n </button>\n ) : (\n <span className=\"tw-stepper__step-label\">{step.label}</span>\n );\n\n return (\n <li\n key={index}\n className={clsx(\n 'hidden-xs',\n 'tw-stepper__step',\n active ? 'np-text-body-default-bold tw-stepper__step--active' : 'np-text-body-default',\n clickable && 'tw-stepper__step--clickable',\n step.hoverLabel && 'tw-stepper__step--has-tooltip',\n )}\n aria-current={active ? 'step' : false}\n style={\n isRTL\n ? { right: `${index * stepPercentage * 100}%` }\n : { left: `${index * stepPercentage * 100}%` }\n }\n >\n {step.hoverLabel && !isTouchDevice() ? (\n <Tooltip position={Position.BOTTOM} label={step.hoverLabel}>\n {labelButton}\n </Tooltip>\n ) : (\n labelButton\n )}\n </li>\n );\n };\n\n return (\n <div className={clsx('tw-stepper', className)} data-testid={testId}>\n <div className=\"progress\">\n <div\n className=\"progress-bar\"\n style={{ width: getProgressWidth() }}\n data-testid=\"progress-bar\"\n />\n </div>\n <ol className=\"tw-stepper-steps p-t-1 m-b-0\">{steps.map(renderStep)}</ol>\n </div>\n );\n};\n\nexport default Stepper;\n"],"names":["clamp","from","to","value","Math","max","min","Stepper","steps","activeStep","className","testId","isRTL","useDirection","length","activeStepIndex","stepPercentage","percentageCompleted","getProgressWidth","renderStep","step","index","active","clickable","onClick","labelButton","_jsx","type","children","label","clsx","hoverLabel","style","right","left","isTouchDevice","Tooltip","position","Position","BOTTOM","_jsxs","width","map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,SAASA,KAAKA,CAACC,IAAY,EAAEC,EAAU,EAAEC,KAAa,EAAA;AACpD,EAAA,OAAOC,IAAI,CAACC,GAAG,CAACD,IAAI,CAACE,GAAG,CAACJ,EAAE,EAAEC,KAAK,CAAC,EAAEF,IAAI,CAAC;AAC5C;AAeA;;;AAGG;
|
|
1
|
+
{"version":3,"file":"Stepper.mjs","sources":["../../src/stepper/Stepper.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport * as React from 'react';\n\nimport { Position } from '../common';\nimport { useDirection } from '../common/hooks';\nimport Tooltip from '../tooltip';\n\nimport { isTouchDevice } from './deviceDetection';\n\nfunction clamp(from: number, to: number, value: number) {\n return Math.max(Math.min(to, value), from);\n}\n\nexport interface Step {\n label: React.ReactNode;\n onClick?: () => void;\n hoverLabel?: React.ReactNode;\n}\n\nexport interface StepperProps {\n steps: readonly Step[];\n activeStep?: number;\n className?: string;\n testId?: string;\n}\n\n/**\n * This component is considered user-unfriendly and inaccessible on its own and will likely be made internal in the future. Please use `FlowNavigation` instead.\n * @see https://storybook.wise.design/?path=/story/navigation-flownavigation--variants\n */\nconst Stepper = ({ steps, activeStep = 0, className, testId }: StepperProps) => {\n const { isRTL } = useDirection();\n\n if (steps.length === 0) {\n return null;\n }\n\n const activeStepIndex = clamp(0, steps.length - 1, activeStep);\n const stepPercentage = 1 / (steps.length - 1);\n const percentageCompleted = activeStepIndex / (steps.length - 1);\n\n const getProgressWidth = (): string => {\n if (percentageCompleted === 0) {\n return '0%';\n }\n /**\n * Progress bar starts with left/right (depends on rtl) shift `--progress-bar-start-shift` for hiding Progress bar's left and right borders\n * which are used for progress vertical delimiter.\n * When progress is completed, we need to add `--progress-bar-border-width` to the width to allow the right border be outside of the progress area.\n */\n return `calc(${percentageCompleted * 100}% + var(--progress-bar-start-shift) + var(--progress-bar-border-width))`;\n };\n\n const renderStep = (step: Step, index: number) => {\n const active = index === activeStepIndex;\n const clickable = step.onClick && !active;\n\n const labelButton = clickable ? (\n <button\n type=\"button\"\n className=\"btn-unstyled tw-stepper__step-label\"\n onClick={() => clickable && step.onClick?.()}\n >\n <small>{step.label}</small>\n </button>\n ) : (\n <span className=\"tw-stepper__step-label\">{step.label}</span>\n );\n\n return (\n <li\n key={index}\n className={clsx(\n 'hidden-xs',\n 'tw-stepper__step',\n active ? 'np-text-body-default-bold tw-stepper__step--active' : 'np-text-body-default',\n clickable && 'tw-stepper__step--clickable',\n step.hoverLabel && 'tw-stepper__step--has-tooltip',\n )}\n aria-current={active ? 'step' : false}\n style={\n isRTL\n ? { right: `${index * stepPercentage * 100}%` }\n : { left: `${index * stepPercentage * 100}%` }\n }\n >\n {step.hoverLabel && !isTouchDevice() ? (\n <Tooltip position={Position.BOTTOM} label={step.hoverLabel}>\n {labelButton}\n </Tooltip>\n ) : (\n labelButton\n )}\n </li>\n );\n };\n\n return (\n <div className={clsx('tw-stepper', className)} data-testid={testId}>\n <div className=\"progress\">\n <div\n className=\"progress-bar\"\n style={{ width: getProgressWidth() }}\n data-testid=\"progress-bar\"\n />\n </div>\n <ol className=\"tw-stepper-steps p-t-1 m-b-0\">{steps.map(renderStep)}</ol>\n </div>\n );\n};\n\nexport default Stepper;\n"],"names":["clamp","from","to","value","Math","max","min","Stepper","steps","activeStep","className","testId","isRTL","useDirection","length","activeStepIndex","stepPercentage","percentageCompleted","getProgressWidth","renderStep","step","index","active","clickable","onClick","labelButton","_jsx","type","children","label","clsx","hoverLabel","style","right","left","isTouchDevice","Tooltip","position","Position","BOTTOM","_jsxs","width","map"],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deviceDetection.js","sources":["../../src/stepper/deviceDetection.ts"],"sourcesContent":["function supportsTouchEvents() {\n const onTouchStartIsDefined = typeof window !== 'undefined' && window.ontouchstart !== undefined;\n const maxTouchPointsIsDefined = typeof navigator !== 'undefined' && navigator.maxTouchPoints;\n\n return !!(onTouchStartIsDefined || maxTouchPointsIsDefined);\n}\n\nfunction userAgentSuggestsTouchDevice() {\n const sampleTouchDevices = [\n 'android',\n 'iemobile',\n 'iphone',\n 'ipad',\n 'ipod',\n 'blackberry',\n 'bada',\n ];\n const matchString = sampleTouchDevices.map((device) => `(${device})`).join('|');\n const regex = new RegExp(matchString, 'gi');\n return typeof navigator !== 'undefined' && !!regex.test(navigator.userAgent);\n}\n// Important: this is not fool-proof! It gives false positives and negatives, and will be outdated.\n// Only use this for small vanity changes where it still works either way.\nexport function isTouchDevice() {\n return supportsTouchEvents() || userAgentSuggestsTouchDevice();\n}\n"],"names":["supportsTouchEvents","onTouchStartIsDefined","window","ontouchstart","undefined","maxTouchPointsIsDefined","navigator","maxTouchPoints","userAgentSuggestsTouchDevice","sampleTouchDevices","matchString","map","device","join","regex","RegExp","test","userAgent","isTouchDevice"],"mappings":";;AAAA,SAASA,mBAAmBA,GAAA;EAC1B,MAAMC,qBAAqB,GAAG,OAAOC,MAAM,KAAK,WAAW,IAAIA,MAAM,CAACC,YAAY,KAAKC,SAAS;EAChG,MAAMC,uBAAuB,GAAG,OAAOC,SAAS,KAAK,WAAW,IAAIA,SAAS,CAACC,cAAc;AAE5F,EAAA,OAAO,CAAC,EAAEN,qBAAqB,IAAII,uBAAuB,CAAC;AAC7D;AAEA,SAASG,4BAA4BA,GAAA;AACnC,EAAA,MAAMC,kBAAkB,GAAG,CACzB,SAAS,EACT,UAAU,EACV,QAAQ,EACR,MAAM,EACN,MAAM,EACN,YAAY,EACZ,MAAM,CACP;AACD,EAAA,MAAMC,WAAW,GAAGD,kBAAkB,CAACE,GAAG,CAAEC,MAAM,IAAK,
|
|
1
|
+
{"version":3,"file":"deviceDetection.js","sources":["../../src/stepper/deviceDetection.ts"],"sourcesContent":["function supportsTouchEvents() {\n const onTouchStartIsDefined = typeof window !== 'undefined' && window.ontouchstart !== undefined;\n const maxTouchPointsIsDefined = typeof navigator !== 'undefined' && navigator.maxTouchPoints;\n\n return !!(onTouchStartIsDefined || maxTouchPointsIsDefined);\n}\n\nfunction userAgentSuggestsTouchDevice() {\n const sampleTouchDevices = [\n 'android',\n 'iemobile',\n 'iphone',\n 'ipad',\n 'ipod',\n 'blackberry',\n 'bada',\n ];\n const matchString = sampleTouchDevices.map((device) => `(${device})`).join('|');\n const regex = new RegExp(matchString, 'gi');\n return typeof navigator !== 'undefined' && !!regex.test(navigator.userAgent);\n}\n// Important: this is not fool-proof! It gives false positives and negatives, and will be outdated.\n// Only use this for small vanity changes where it still works either way.\nexport function isTouchDevice() {\n return supportsTouchEvents() || userAgentSuggestsTouchDevice();\n}\n"],"names":["supportsTouchEvents","onTouchStartIsDefined","window","ontouchstart","undefined","maxTouchPointsIsDefined","navigator","maxTouchPoints","userAgentSuggestsTouchDevice","sampleTouchDevices","matchString","map","device","join","regex","RegExp","test","userAgent","isTouchDevice"],"mappings":";;AAAA,SAASA,mBAAmBA,GAAA;EAC1B,MAAMC,qBAAqB,GAAG,OAAOC,MAAM,KAAK,WAAW,IAAIA,MAAM,CAACC,YAAY,KAAKC,SAAS;EAChG,MAAMC,uBAAuB,GAAG,OAAOC,SAAS,KAAK,WAAW,IAAIA,SAAS,CAACC,cAAc;AAE5F,EAAA,OAAO,CAAC,EAAEN,qBAAqB,IAAII,uBAAuB,CAAC;AAC7D;AAEA,SAASG,4BAA4BA,GAAA;AACnC,EAAA,MAAMC,kBAAkB,GAAG,CACzB,SAAS,EACT,UAAU,EACV,QAAQ,EACR,MAAM,EACN,MAAM,EACN,YAAY,EACZ,MAAM,CACP;AACD,EAAA,MAAMC,WAAW,GAAGD,kBAAkB,CAACE,GAAG,CAAEC,MAAM,IAAK,CAAA,CAAA,EAAIA,MAAM,GAAG,CAAC,CAACC,IAAI,CAAC,GAAG,CAAC;EAC/E,MAAMC,KAAK,GAAG,IAAIC,MAAM,CAACL,WAAW,EAAE,IAAI,CAAC;AAC3C,EAAA,OAAO,OAAOJ,SAAS,KAAK,WAAW,IAAI,CAAC,CAACQ,KAAK,CAACE,IAAI,CAACV,SAAS,CAACW,SAAS,CAAC;AAC9E;AACA;AACA;SACgBC,aAAaA,GAAA;AAC3B,EAAA,OAAOlB,mBAAmB,EAAE,IAAIQ,4BAA4B,EAAE;AAChE;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deviceDetection.mjs","sources":["../../src/stepper/deviceDetection.ts"],"sourcesContent":["function supportsTouchEvents() {\n const onTouchStartIsDefined = typeof window !== 'undefined' && window.ontouchstart !== undefined;\n const maxTouchPointsIsDefined = typeof navigator !== 'undefined' && navigator.maxTouchPoints;\n\n return !!(onTouchStartIsDefined || maxTouchPointsIsDefined);\n}\n\nfunction userAgentSuggestsTouchDevice() {\n const sampleTouchDevices = [\n 'android',\n 'iemobile',\n 'iphone',\n 'ipad',\n 'ipod',\n 'blackberry',\n 'bada',\n ];\n const matchString = sampleTouchDevices.map((device) => `(${device})`).join('|');\n const regex = new RegExp(matchString, 'gi');\n return typeof navigator !== 'undefined' && !!regex.test(navigator.userAgent);\n}\n// Important: this is not fool-proof! It gives false positives and negatives, and will be outdated.\n// Only use this for small vanity changes where it still works either way.\nexport function isTouchDevice() {\n return supportsTouchEvents() || userAgentSuggestsTouchDevice();\n}\n"],"names":["supportsTouchEvents","onTouchStartIsDefined","window","ontouchstart","undefined","maxTouchPointsIsDefined","navigator","maxTouchPoints","userAgentSuggestsTouchDevice","sampleTouchDevices","matchString","map","device","join","regex","RegExp","test","userAgent","isTouchDevice"],"mappings":"AAAA,SAASA,mBAAmBA,GAAA;EAC1B,MAAMC,qBAAqB,GAAG,OAAOC,MAAM,KAAK,WAAW,IAAIA,MAAM,CAACC,YAAY,KAAKC,SAAS;EAChG,MAAMC,uBAAuB,GAAG,OAAOC,SAAS,KAAK,WAAW,IAAIA,SAAS,CAACC,cAAc;AAE5F,EAAA,OAAO,CAAC,EAAEN,qBAAqB,IAAII,uBAAuB,CAAC;AAC7D;AAEA,SAASG,4BAA4BA,GAAA;AACnC,EAAA,MAAMC,kBAAkB,GAAG,CACzB,SAAS,EACT,UAAU,EACV,QAAQ,EACR,MAAM,EACN,MAAM,EACN,YAAY,EACZ,MAAM,CACP;AACD,EAAA,MAAMC,WAAW,GAAGD,kBAAkB,CAACE,GAAG,CAAEC,MAAM,IAAK,
|
|
1
|
+
{"version":3,"file":"deviceDetection.mjs","sources":["../../src/stepper/deviceDetection.ts"],"sourcesContent":["function supportsTouchEvents() {\n const onTouchStartIsDefined = typeof window !== 'undefined' && window.ontouchstart !== undefined;\n const maxTouchPointsIsDefined = typeof navigator !== 'undefined' && navigator.maxTouchPoints;\n\n return !!(onTouchStartIsDefined || maxTouchPointsIsDefined);\n}\n\nfunction userAgentSuggestsTouchDevice() {\n const sampleTouchDevices = [\n 'android',\n 'iemobile',\n 'iphone',\n 'ipad',\n 'ipod',\n 'blackberry',\n 'bada',\n ];\n const matchString = sampleTouchDevices.map((device) => `(${device})`).join('|');\n const regex = new RegExp(matchString, 'gi');\n return typeof navigator !== 'undefined' && !!regex.test(navigator.userAgent);\n}\n// Important: this is not fool-proof! It gives false positives and negatives, and will be outdated.\n// Only use this for small vanity changes where it still works either way.\nexport function isTouchDevice() {\n return supportsTouchEvents() || userAgentSuggestsTouchDevice();\n}\n"],"names":["supportsTouchEvents","onTouchStartIsDefined","window","ontouchstart","undefined","maxTouchPointsIsDefined","navigator","maxTouchPoints","userAgentSuggestsTouchDevice","sampleTouchDevices","matchString","map","device","join","regex","RegExp","test","userAgent","isTouchDevice"],"mappings":"AAAA,SAASA,mBAAmBA,GAAA;EAC1B,MAAMC,qBAAqB,GAAG,OAAOC,MAAM,KAAK,WAAW,IAAIA,MAAM,CAACC,YAAY,KAAKC,SAAS;EAChG,MAAMC,uBAAuB,GAAG,OAAOC,SAAS,KAAK,WAAW,IAAIA,SAAS,CAACC,cAAc;AAE5F,EAAA,OAAO,CAAC,EAAEN,qBAAqB,IAAII,uBAAuB,CAAC;AAC7D;AAEA,SAASG,4BAA4BA,GAAA;AACnC,EAAA,MAAMC,kBAAkB,GAAG,CACzB,SAAS,EACT,UAAU,EACV,QAAQ,EACR,MAAM,EACN,MAAM,EACN,YAAY,EACZ,MAAM,CACP;AACD,EAAA,MAAMC,WAAW,GAAGD,kBAAkB,CAACE,GAAG,CAAEC,MAAM,IAAK,CAAA,CAAA,EAAIA,MAAM,GAAG,CAAC,CAACC,IAAI,CAAC,GAAG,CAAC;EAC/E,MAAMC,KAAK,GAAG,IAAIC,MAAM,CAACL,WAAW,EAAE,IAAI,CAAC;AAC3C,EAAA,OAAO,OAAOJ,SAAS,KAAK,WAAW,IAAI,CAAC,CAACQ,KAAK,CAACE,IAAI,CAACV,SAAS,CAACW,SAAS,CAAC;AAC9E;AACA;AACA;SACgBC,aAAaA,GAAA;AAC3B,EAAA,OAAOlB,mBAAmB,EAAE,IAAIQ,4BAA4B,EAAE;AAChE;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sticky.js","sources":["../../src/sticky/Sticky.tsx"],"sourcesContent":["import { Position } from '../common';\nimport SlidingPanel from '../slidingPanel';\nimport { FunctionComponent } from 'react';\n\nexport interface StickyProps {\n /** Optional prop for children components to be rendered inside the Sticky component. */\n children?: React.ReactNode;\n\n /** Optional props that determines if the Sticky component is open or closed. Default value is `true`. */\n open?: boolean;\n\n /** Optional props that specifies the position of the Sticky component on the screen. Can be either `top` or `bottom`. */\n position?: `${Position.TOP}` | `${Position.BOTTOM}`;\n\n /** Optional prop to specify the ID used for testing */\n testId?: string;\n}\n\n/**\n * ### Sticky Component\n *\n * `<Sticky />` is a component that renders a `<SlidingPanel />` with specified props.\n * It uses the `<SlidingPanel />` component to create a panel that can slide in and out of view,\n * based on the `open` prop. It can be positioned at the top or bottom of the container,\n * as specified by the `position` prop.\n *\n * @component\n * @param {ReactNode} children - Children content.\n * @param {boolean} open - Determines if the Sticky component is open or closed.\n * @param {('top'|'bottom')} position - Specifies the position.\n * @param {string} testId - ID used for testing.\n * @returns {React.JSX.Element} The `SlidingPanel` component with applied props.\n * @example\n * <Button onClick={() => setOpen(!open)}>Open Sticky</Button>\n * <Sticky open={open} position={'bottom'}>\n * <div>\n * <Button onClick={() => setOpen(!open)}>Close Sticky</Button>\n * </div>\n * </Sticky>\n */\nconst Sticky: FunctionComponent<StickyProps> = ({\n children,\n open = true,\n position = Position.BOTTOM,\n testId,\n}: StickyProps) => {\n return (\n <SlidingPanel\n testId={testId}\n open={open}\n position={position}\n slidingPanelPositionFixed\n showSlidingPanelBorder\n >\n {children}\n </SlidingPanel>\n );\n};\n\nexport default Sticky;\n"],"names":["Sticky","children","open","position","Position","BOTTOM","testId","_jsx","SlidingPanel","slidingPanelPositionFixed","showSlidingPanelBorder"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"Sticky.js","sources":["../../src/sticky/Sticky.tsx"],"sourcesContent":["import { Position } from '../common';\nimport SlidingPanel from '../slidingPanel';\nimport { FunctionComponent } from 'react';\n\nexport interface StickyProps {\n /** Optional prop for children components to be rendered inside the Sticky component. */\n children?: React.ReactNode;\n\n /** Optional props that determines if the Sticky component is open or closed. Default value is `true`. */\n open?: boolean;\n\n /** Optional props that specifies the position of the Sticky component on the screen. Can be either `top` or `bottom`. */\n position?: `${Position.TOP}` | `${Position.BOTTOM}`;\n\n /** Optional prop to specify the ID used for testing */\n testId?: string;\n}\n\n/**\n * ### Sticky Component\n *\n * `<Sticky />` is a component that renders a `<SlidingPanel />` with specified props.\n * It uses the `<SlidingPanel />` component to create a panel that can slide in and out of view,\n * based on the `open` prop. It can be positioned at the top or bottom of the container,\n * as specified by the `position` prop.\n *\n * @component\n * @param {ReactNode} children - Children content.\n * @param {boolean} open - Determines if the Sticky component is open or closed.\n * @param {('top'|'bottom')} position - Specifies the position.\n * @param {string} testId - ID used for testing.\n * @returns {React.JSX.Element} The `SlidingPanel` component with applied props.\n * @example\n * <Button onClick={() => setOpen(!open)}>Open Sticky</Button>\n * <Sticky open={open} position={'bottom'}>\n * <div>\n * <Button onClick={() => setOpen(!open)}>Close Sticky</Button>\n * </div>\n * </Sticky>\n */\nconst Sticky: FunctionComponent<StickyProps> = ({\n children,\n open = true,\n position = Position.BOTTOM,\n testId,\n}: StickyProps) => {\n return (\n <SlidingPanel\n testId={testId}\n open={open}\n position={position}\n slidingPanelPositionFixed\n showSlidingPanelBorder\n >\n {children}\n </SlidingPanel>\n );\n};\n\nexport default Sticky;\n"],"names":["Sticky","children","open","position","Position","BOTTOM","testId","_jsx","SlidingPanel","slidingPanelPositionFixed","showSlidingPanelBorder"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCA,MAAMA,MAAM,GAAmCA,CAAC;EAC9CC,QAAQ;AACRC,EAAAA,IAAI,GAAG,IAAI;YACXC,UAAQ,GAAGC,iBAAQ,CAACC,MAAM;AAC1BC,EAAAA;AAAM,CACM,KAAI;EAChB,oBACEC,cAAA,CAACC,oBAAY,EAAA;AACXF,IAAAA,MAAM,EAAEA,MAAO;AACfJ,IAAAA,IAAI,EAAEA,IAAK;AACXC,IAAAA,QAAQ,EAAEA,UAAS;IACnBM,yBAAyB,EAAA,IAAA;IACzBC,sBAAsB,EAAA,IAAA;AAAAT,IAAAA,QAAA,EAErBA;AAAQ,GACG,CAAC;AAEnB;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sticky.mjs","sources":["../../src/sticky/Sticky.tsx"],"sourcesContent":["import { Position } from '../common';\nimport SlidingPanel from '../slidingPanel';\nimport { FunctionComponent } from 'react';\n\nexport interface StickyProps {\n /** Optional prop for children components to be rendered inside the Sticky component. */\n children?: React.ReactNode;\n\n /** Optional props that determines if the Sticky component is open or closed. Default value is `true`. */\n open?: boolean;\n\n /** Optional props that specifies the position of the Sticky component on the screen. Can be either `top` or `bottom`. */\n position?: `${Position.TOP}` | `${Position.BOTTOM}`;\n\n /** Optional prop to specify the ID used for testing */\n testId?: string;\n}\n\n/**\n * ### Sticky Component\n *\n * `<Sticky />` is a component that renders a `<SlidingPanel />` with specified props.\n * It uses the `<SlidingPanel />` component to create a panel that can slide in and out of view,\n * based on the `open` prop. It can be positioned at the top or bottom of the container,\n * as specified by the `position` prop.\n *\n * @component\n * @param {ReactNode} children - Children content.\n * @param {boolean} open - Determines if the Sticky component is open or closed.\n * @param {('top'|'bottom')} position - Specifies the position.\n * @param {string} testId - ID used for testing.\n * @returns {React.JSX.Element} The `SlidingPanel` component with applied props.\n * @example\n * <Button onClick={() => setOpen(!open)}>Open Sticky</Button>\n * <Sticky open={open} position={'bottom'}>\n * <div>\n * <Button onClick={() => setOpen(!open)}>Close Sticky</Button>\n * </div>\n * </Sticky>\n */\nconst Sticky: FunctionComponent<StickyProps> = ({\n children,\n open = true,\n position = Position.BOTTOM,\n testId,\n}: StickyProps) => {\n return (\n <SlidingPanel\n testId={testId}\n open={open}\n position={position}\n slidingPanelPositionFixed\n showSlidingPanelBorder\n >\n {children}\n </SlidingPanel>\n );\n};\n\nexport default Sticky;\n"],"names":["Sticky","children","open","position","Position","BOTTOM","testId","_jsx","SlidingPanel","slidingPanelPositionFixed","showSlidingPanelBorder"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"Sticky.mjs","sources":["../../src/sticky/Sticky.tsx"],"sourcesContent":["import { Position } from '../common';\nimport SlidingPanel from '../slidingPanel';\nimport { FunctionComponent } from 'react';\n\nexport interface StickyProps {\n /** Optional prop for children components to be rendered inside the Sticky component. */\n children?: React.ReactNode;\n\n /** Optional props that determines if the Sticky component is open or closed. Default value is `true`. */\n open?: boolean;\n\n /** Optional props that specifies the position of the Sticky component on the screen. Can be either `top` or `bottom`. */\n position?: `${Position.TOP}` | `${Position.BOTTOM}`;\n\n /** Optional prop to specify the ID used for testing */\n testId?: string;\n}\n\n/**\n * ### Sticky Component\n *\n * `<Sticky />` is a component that renders a `<SlidingPanel />` with specified props.\n * It uses the `<SlidingPanel />` component to create a panel that can slide in and out of view,\n * based on the `open` prop. It can be positioned at the top or bottom of the container,\n * as specified by the `position` prop.\n *\n * @component\n * @param {ReactNode} children - Children content.\n * @param {boolean} open - Determines if the Sticky component is open or closed.\n * @param {('top'|'bottom')} position - Specifies the position.\n * @param {string} testId - ID used for testing.\n * @returns {React.JSX.Element} The `SlidingPanel` component with applied props.\n * @example\n * <Button onClick={() => setOpen(!open)}>Open Sticky</Button>\n * <Sticky open={open} position={'bottom'}>\n * <div>\n * <Button onClick={() => setOpen(!open)}>Close Sticky</Button>\n * </div>\n * </Sticky>\n */\nconst Sticky: FunctionComponent<StickyProps> = ({\n children,\n open = true,\n position = Position.BOTTOM,\n testId,\n}: StickyProps) => {\n return (\n <SlidingPanel\n testId={testId}\n open={open}\n position={position}\n slidingPanelPositionFixed\n showSlidingPanelBorder\n >\n {children}\n </SlidingPanel>\n );\n};\n\nexport default Sticky;\n"],"names":["Sticky","children","open","position","Position","BOTTOM","testId","_jsx","SlidingPanel","slidingPanelPositionFixed","showSlidingPanelBorder"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCA,MAAMA,MAAM,GAAmCA,CAAC;EAC9CC,QAAQ;AACRC,EAAAA,IAAI,GAAG,IAAI;EACXC,QAAQ,GAAGC,QAAQ,CAACC,MAAM;AAC1BC,EAAAA;AAAM,CACM,KAAI;EAChB,oBACEC,GAAA,CAACC,YAAY,EAAA;AACXF,IAAAA,MAAM,EAAEA,MAAO;AACfJ,IAAAA,IAAI,EAAEA,IAAK;AACXC,IAAAA,QAAQ,EAAEA,QAAS;IACnBM,yBAAyB,EAAA,IAAA;IACzBC,sBAAsB,EAAA,IAAA;AAAAT,IAAAA,QAAA,EAErBA;AAAQ,GACG,CAAC;AAEnB;;;;"}
|
|
@@ -27,10 +27,13 @@
|
|
|
27
27
|
}.np-accordion-item .np-option .np-option__title {
|
|
28
28
|
font-weight: 600;
|
|
29
29
|
font-weight: var(--font-weight-semi-bold);
|
|
30
|
+
}.np-theme-personal .np-accordion-item--with-media .media {
|
|
31
|
+
display: flex;
|
|
32
|
+
align-items: center;
|
|
30
33
|
}.np-theme-personal .np-accordion-item--with-icon .np-accordion-item__content {
|
|
31
34
|
padding: 0 56px 16px;
|
|
32
35
|
padding: 0 var(--size-56) var(--size-16);
|
|
33
|
-
}.np-theme-personal .np-accordion-item .media {
|
|
36
|
+
}.np-theme-personal .np-accordion-item--with-icon .media {
|
|
34
37
|
display: flex;
|
|
35
38
|
align-items: flex-start;
|
|
36
39
|
}.np-theme-personal .np-accordion-item .decision__title {
|
package/build/styles/main.css
CHANGED
|
@@ -72,11 +72,15 @@
|
|
|
72
72
|
font-weight: 600;
|
|
73
73
|
font-weight: var(--font-weight-semi-bold);
|
|
74
74
|
}
|
|
75
|
+
.np-theme-personal .np-accordion-item--with-media .media {
|
|
76
|
+
display: flex;
|
|
77
|
+
align-items: center;
|
|
78
|
+
}
|
|
75
79
|
.np-theme-personal .np-accordion-item--with-icon .np-accordion-item__content {
|
|
76
80
|
padding: 0 56px 16px;
|
|
77
81
|
padding: 0 var(--size-56) var(--size-16);
|
|
78
82
|
}
|
|
79
|
-
.np-theme-personal .np-accordion-item .media {
|
|
83
|
+
.np-theme-personal .np-accordion-item--with-icon .media {
|
|
80
84
|
display: flex;
|
|
81
85
|
align-items: flex-start;
|
|
82
86
|
}
|
|
@@ -5145,6 +5149,8 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
5145
5149
|
margin-top: var(--size-24);
|
|
5146
5150
|
}
|
|
5147
5151
|
.np-switch {
|
|
5152
|
+
all: unset;
|
|
5153
|
+
box-sizing: border-box;
|
|
5148
5154
|
display: inline-flex;
|
|
5149
5155
|
overflow: hidden;
|
|
5150
5156
|
width: 50px;
|
|
@@ -5153,6 +5159,7 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
5153
5159
|
-webkit-user-select: none;
|
|
5154
5160
|
-moz-user-select: none;
|
|
5155
5161
|
user-select: none;
|
|
5162
|
+
cursor: pointer;
|
|
5156
5163
|
}
|
|
5157
5164
|
.np-switch:focus {
|
|
5158
5165
|
outline: none;
|
|
@@ -5185,21 +5192,10 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
5185
5192
|
[dir="rtl"] .np-switch--checked .np-switch--thumb {
|
|
5186
5193
|
transform: translateX(-20px) ;
|
|
5187
5194
|
}
|
|
5188
|
-
.np-switch
|
|
5189
|
-
|
|
5190
|
-
|
|
5191
|
-
|
|
5192
|
-
width: 0;
|
|
5193
|
-
height: 0;
|
|
5194
|
-
opacity: 0;
|
|
5195
|
-
}
|
|
5196
|
-
[dir="rtl"] .np-switch input {
|
|
5197
|
-
right: -100%;
|
|
5198
|
-
left: auto;
|
|
5199
|
-
left: initial;
|
|
5200
|
-
}
|
|
5201
|
-
.np-switch:not([aria-disabled]) {
|
|
5202
|
-
cursor: pointer;
|
|
5195
|
+
.np-switch.disabled {
|
|
5196
|
+
filter: grayscale(1);
|
|
5197
|
+
opacity: 0.45;
|
|
5198
|
+
cursor: not-allowed !important;
|
|
5203
5199
|
}
|
|
5204
5200
|
.np-theme-personal .np-switch {
|
|
5205
5201
|
padding: 1px 2px;
|
|
@@ -5215,6 +5211,10 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
5215
5211
|
background-color: #ffffff;
|
|
5216
5212
|
background-color: var(--color-background-screen);
|
|
5217
5213
|
}
|
|
5214
|
+
.np-switch-option.disabled .np-switch {
|
|
5215
|
+
filter: none;
|
|
5216
|
+
opacity: 1;
|
|
5217
|
+
}
|
|
5218
5218
|
.tabs {
|
|
5219
5219
|
position: relative;
|
|
5220
5220
|
}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
@media (min-width: 768px) {
|
|
2
|
+
}@media (min-width: 768px) {
|
|
3
|
+
}.np-switch {
|
|
4
|
+
all: unset;
|
|
5
|
+
box-sizing: border-box;
|
|
2
6
|
display: inline-flex;
|
|
3
7
|
overflow: hidden;
|
|
4
8
|
width: 50px;
|
|
@@ -7,61 +11,38 @@
|
|
|
7
11
|
-webkit-user-select: none;
|
|
8
12
|
-moz-user-select: none;
|
|
9
13
|
user-select: none;
|
|
10
|
-
|
|
11
|
-
.np-switch:focus {
|
|
14
|
+
cursor: pointer;
|
|
15
|
+
}.np-switch:focus {
|
|
12
16
|
outline: none;
|
|
13
|
-
}
|
|
14
|
-
.np-switch:focus-visible {
|
|
17
|
+
}.np-switch:focus-visible {
|
|
15
18
|
outline: var(--ring-outline-color) solid var(--ring-outline-width);
|
|
16
19
|
outline-offset: var(--ring-outline-offset);
|
|
17
|
-
}
|
|
18
|
-
.np-switch--thumb {
|
|
20
|
+
}.np-switch--thumb {
|
|
19
21
|
display: flex;
|
|
20
22
|
transition: transform cubic-bezier(0, 0.94, 0.62, 1) 350ms;
|
|
21
|
-
}
|
|
22
|
-
.np-switch--thumb .tw-icon {
|
|
23
|
+
}.np-switch--thumb .tw-icon {
|
|
23
24
|
color: #fff;
|
|
24
|
-
}
|
|
25
|
-
.np-switch--unchecked {
|
|
25
|
+
}.np-switch--unchecked {
|
|
26
26
|
background: #c9cbce;
|
|
27
27
|
background: var(--color-interactive-secondary);
|
|
28
|
-
}
|
|
29
|
-
.np-switch--unchecked .switch--thumb {
|
|
28
|
+
}.np-switch--unchecked .switch--thumb {
|
|
30
29
|
transform: translateX(0);
|
|
31
|
-
}
|
|
32
|
-
.np-switch--checked {
|
|
30
|
+
}.np-switch--checked {
|
|
33
31
|
background: #00a2dd;
|
|
34
32
|
background: var(--color-interactive-accent);
|
|
35
|
-
}
|
|
36
|
-
.np-switch--checked .np-switch--thumb {
|
|
33
|
+
}.np-switch--checked .np-switch--thumb {
|
|
37
34
|
transform: translateX(20px) ;
|
|
38
|
-
}
|
|
39
|
-
[dir="rtl"] .np-switch--checked .np-switch--thumb {
|
|
35
|
+
}[dir="rtl"] .np-switch--checked .np-switch--thumb {
|
|
40
36
|
transform: translateX(-20px) ;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
width: 0;
|
|
47
|
-
height: 0;
|
|
48
|
-
opacity: 0;
|
|
49
|
-
}
|
|
50
|
-
[dir="rtl"] .np-switch input {
|
|
51
|
-
right: -100%;
|
|
52
|
-
left: auto;
|
|
53
|
-
left: initial;
|
|
54
|
-
}
|
|
55
|
-
.np-switch:not([aria-disabled]) {
|
|
56
|
-
cursor: pointer;
|
|
57
|
-
}
|
|
58
|
-
.np-theme-personal .np-switch {
|
|
37
|
+
}.np-switch.disabled {
|
|
38
|
+
filter: grayscale(1);
|
|
39
|
+
opacity: 0.45;
|
|
40
|
+
cursor: not-allowed !important;
|
|
41
|
+
}.np-theme-personal .np-switch {
|
|
59
42
|
padding: 1px 2px;
|
|
60
|
-
}
|
|
61
|
-
.np-theme-personal .np-switch--checked {
|
|
43
|
+
}.np-theme-personal .np-switch--checked {
|
|
62
44
|
background: var(--color-interactive-primary);
|
|
63
|
-
}
|
|
64
|
-
.np-theme-personal .np-switch--thumb {
|
|
45
|
+
}.np-theme-personal .np-switch--thumb {
|
|
65
46
|
width: 20px;
|
|
66
47
|
height: 20px;
|
|
67
48
|
margin: 3px;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Summary.js","sources":["../../src/summary/Summary.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment */\nimport {\n CheckCircleFill as CheckCircleIcon,\n ClockFill as PendingCircleIcon,\n} from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport { ElementType, cloneElement, ReactNode } from 'react';\nimport { useIntl } from 'react-intl';\n\nimport Body from '../body';\nimport {\n Status,\n StatusDone,\n StatusNotDone,\n StatusPending,\n Size,\n Typography,\n Sentiment,\n} from '../common';\nimport Info, { InfoProps } from '../info';\nimport StatusIcon from '../statusIcon';\n\nimport messages from './Summary.messages';\nimport Link from '../link';\nimport type { AlertAction } from '../alert';\n\nconst BadgeIcons = {\n [Status.DONE]: CheckCircleIcon,\n [Status.PENDING]: PendingCircleIcon,\n};\n\nconst statusLabels = {\n [Status.NOT_DONE]: 'statusNotDone',\n [Status.DONE]: 'statusDone',\n [Status.PENDING]: 'statusPending',\n};\n\nconst statusMapping = {\n [Status.DONE]: Sentiment.POSITIVE,\n [Status.PENDING]: Sentiment.PENDING,\n};\n\nexport interface Props {\n /**\n * Action displayed at the bottom of the Summary\n */\n action?: AlertAction;\n /**\n * Decides which html element should wrap the Summary\n */\n as?: ElementType;\n /**\n * Extra classes applied to Summary\n */\n className?: string;\n /**\n * @deprecated please use description instead\n */\n content?: ReactNode;\n /**\n * Summary description\n */\n description?: ReactNode;\n /**\n * @deprecated please use info instead\n */\n help?: {\n content: ReactNode;\n title?: ReactNode;\n };\n /**\n * Infos displayed on help Icon click inside Popover or Modal\n */\n info?: Pick<InfoProps, 'aria-label' | 'content' | 'onClick' | 'presentation' | 'title'>;\n /**\n * @deprecated please use icon instead\n */\n illustration?: ReactNode;\n /**\n * Main Summary Icon\n */\n icon?: ReactNode;\n /**\n * Decides the badge applied to Icon\n */\n status?: StatusNotDone | StatusDone | StatusPending;\n /**\n * Summary title\n */\n title: ReactNode;\n}\n\nconst Summary = ({\n action,\n as: Element = 'div',\n className,\n content = null,\n description = content,\n help,\n icon,\n illustration = null,\n info = help,\n status,\n title,\n}: Props) => {\n const intl = useIntl();\n\n let media = illustration;\n if (icon) {\n // @ts-expect-error if icon is present it has props and size prop\n const iconSize = icon?.props?.size as number;\n\n media =\n iconSize !== 24\n ? // @ts-expect-error we need icon to adjust it's size\n cloneElement(icon, { size: 24 })\n : icon;\n }\n // @ts-expect-error Badge can be null, this is handled in code\n const Badge = status && BadgeIcons[status];\n\n return (\n <Element\n className={clsx('np-summary d-flex align-items-start', className)}\n // @ts-expect-error we check whether `status` is not null before index `statusLabels` and `messages`\n aria-label={status && intl.formatMessage(messages[statusLabels[status]])}\n >\n {icon && (\n <div className=\"np-summary__icon\">\n {media}\n {Badge && (\n <div>\n {/* @ts-expect-error it's okey to pass `undefined` into `sentiment` prop */}\n <StatusIcon size={Size.SMALL} sentiment={statusMapping[status]} />\n </div>\n )}\n </div>\n )}\n <div className={`np-summary__body ${icon ? 'm-l-2' : ''}`}>\n <div className=\"np-summary__title d-flex\">\n <Body\n as=\"span\"\n role=\"heading\"\n aria-level={6}\n type={Typography.BODY_LARGE_BOLD}\n className=\"text-primary text-overflow-wrap m-b-1\"\n >\n {title}\n </Body>\n {info && (\n <Info\n aria-label={info['aria-label']}\n className=\"m-l-1 hidden-xs\"\n content={info.content}\n presentation={info.presentation}\n size={Size.LARGE}\n title={info.title}\n onClick={info.onClick}\n />\n )}\n </div>\n\n {description && (\n <Body\n as=\"span\"\n type={Typography.BODY_DEFAULT}\n className={`d-block text-overflow-wrap ${icon ? 'np-summary__description' : 'np-summary__description-icon'}`}\n >\n {description}\n </Body>\n )}\n {action && (\n <Link\n href={action.href}\n target={action.target}\n className=\"np-summary__action\"\n aria-label={action['aria-label']}\n onClick={action.onClick}\n >\n {action.text}\n </Link>\n )}\n </div>\n {info && (\n <Info\n aria-label={info['aria-label']}\n className=\"m-l-2 hidden-sm hidden-md hidden-lg hidden-xl\"\n content={info.content}\n presentation={info.presentation}\n size={Size.LARGE}\n title={info.title}\n onClick={info.onClick}\n />\n )}\n </Element>\n );\n};\n\nexport default Summary;\n"],"names":["BadgeIcons","Status","DONE","CheckCircleIcon","PENDING","PendingCircleIcon","statusLabels","NOT_DONE","statusMapping","Sentiment","POSITIVE","Summary","action","as","Element","className","content","description","help","icon","illustration","info","status","title","intl","useIntl","media","iconSize","props","size","cloneElement","Badge","_jsxs","clsx","formatMessage","messages","children","_jsx","StatusIcon","Size","SMALL","sentiment","Body","role","type","Typography","BODY_LARGE_BOLD","Info","presentation","LARGE","onClick","BODY_DEFAULT","Link","href","target","text"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AA0BA,MAAMA,UAAU,GAAG;AACjB,EAAA,CAACC,aAAM,CAACC,IAAI,GAAGC,qBAAe;EAC9B,CAACF,aAAM,CAACG,OAAO,GAAGC;CACnB;AAED,MAAMC,YAAY,GAAG;AACnB,EAAA,CAACL,aAAM,CAACM,QAAQ,GAAG,eAAe;AAClC,EAAA,CAACN,aAAM,CAACC,IAAI,GAAG,YAAY;EAC3B,CAACD,aAAM,CAACG,OAAO,GAAG;CACnB;AAED,MAAMI,aAAa,GAAG;AACpB,EAAA,CAACP,aAAM,CAACC,IAAI,GAAGO,mBAAS,CAACC,QAAQ;AACjC,EAAA,CAACT,aAAM,CAACG,OAAO,GAAGK,mBAAS,CAACL;CAC7B;
|
|
1
|
+
{"version":3,"file":"Summary.js","sources":["../../src/summary/Summary.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment */\nimport {\n CheckCircleFill as CheckCircleIcon,\n ClockFill as PendingCircleIcon,\n} from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport { ElementType, cloneElement, ReactNode } from 'react';\nimport { useIntl } from 'react-intl';\n\nimport Body from '../body';\nimport {\n Status,\n StatusDone,\n StatusNotDone,\n StatusPending,\n Size,\n Typography,\n Sentiment,\n} from '../common';\nimport Info, { InfoProps } from '../info';\nimport StatusIcon from '../statusIcon';\n\nimport messages from './Summary.messages';\nimport Link from '../link';\nimport type { AlertAction } from '../alert';\n\nconst BadgeIcons = {\n [Status.DONE]: CheckCircleIcon,\n [Status.PENDING]: PendingCircleIcon,\n};\n\nconst statusLabels = {\n [Status.NOT_DONE]: 'statusNotDone',\n [Status.DONE]: 'statusDone',\n [Status.PENDING]: 'statusPending',\n};\n\nconst statusMapping = {\n [Status.DONE]: Sentiment.POSITIVE,\n [Status.PENDING]: Sentiment.PENDING,\n};\n\nexport interface Props {\n /**\n * Action displayed at the bottom of the Summary\n */\n action?: AlertAction;\n /**\n * Decides which html element should wrap the Summary\n */\n as?: ElementType;\n /**\n * Extra classes applied to Summary\n */\n className?: string;\n /**\n * @deprecated please use description instead\n */\n content?: ReactNode;\n /**\n * Summary description\n */\n description?: ReactNode;\n /**\n * @deprecated please use info instead\n */\n help?: {\n content: ReactNode;\n title?: ReactNode;\n };\n /**\n * Infos displayed on help Icon click inside Popover or Modal\n */\n info?: Pick<InfoProps, 'aria-label' | 'content' | 'onClick' | 'presentation' | 'title'>;\n /**\n * @deprecated please use icon instead\n */\n illustration?: ReactNode;\n /**\n * Main Summary Icon\n */\n icon?: ReactNode;\n /**\n * Decides the badge applied to Icon\n */\n status?: StatusNotDone | StatusDone | StatusPending;\n /**\n * Summary title\n */\n title: ReactNode;\n}\n\nconst Summary = ({\n action,\n as: Element = 'div',\n className,\n content = null,\n description = content,\n help,\n icon,\n illustration = null,\n info = help,\n status,\n title,\n}: Props) => {\n const intl = useIntl();\n\n let media = illustration;\n if (icon) {\n // @ts-expect-error if icon is present it has props and size prop\n const iconSize = icon?.props?.size as number;\n\n media =\n iconSize !== 24\n ? // @ts-expect-error we need icon to adjust it's size\n cloneElement(icon, { size: 24 })\n : icon;\n }\n // @ts-expect-error Badge can be null, this is handled in code\n const Badge = status && BadgeIcons[status];\n\n return (\n <Element\n className={clsx('np-summary d-flex align-items-start', className)}\n // @ts-expect-error we check whether `status` is not null before index `statusLabels` and `messages`\n aria-label={status && intl.formatMessage(messages[statusLabels[status]])}\n >\n {icon && (\n <div className=\"np-summary__icon\">\n {media}\n {Badge && (\n <div>\n {/* @ts-expect-error it's okey to pass `undefined` into `sentiment` prop */}\n <StatusIcon size={Size.SMALL} sentiment={statusMapping[status]} />\n </div>\n )}\n </div>\n )}\n <div className={`np-summary__body ${icon ? 'm-l-2' : ''}`}>\n <div className=\"np-summary__title d-flex\">\n <Body\n as=\"span\"\n role=\"heading\"\n aria-level={6}\n type={Typography.BODY_LARGE_BOLD}\n className=\"text-primary text-overflow-wrap m-b-1\"\n >\n {title}\n </Body>\n {info && (\n <Info\n aria-label={info['aria-label']}\n className=\"m-l-1 hidden-xs\"\n content={info.content}\n presentation={info.presentation}\n size={Size.LARGE}\n title={info.title}\n onClick={info.onClick}\n />\n )}\n </div>\n\n {description && (\n <Body\n as=\"span\"\n type={Typography.BODY_DEFAULT}\n className={`d-block text-overflow-wrap ${icon ? 'np-summary__description' : 'np-summary__description-icon'}`}\n >\n {description}\n </Body>\n )}\n {action && (\n <Link\n href={action.href}\n target={action.target}\n className=\"np-summary__action\"\n aria-label={action['aria-label']}\n onClick={action.onClick}\n >\n {action.text}\n </Link>\n )}\n </div>\n {info && (\n <Info\n aria-label={info['aria-label']}\n className=\"m-l-2 hidden-sm hidden-md hidden-lg hidden-xl\"\n content={info.content}\n presentation={info.presentation}\n size={Size.LARGE}\n title={info.title}\n onClick={info.onClick}\n />\n )}\n </Element>\n );\n};\n\nexport default Summary;\n"],"names":["BadgeIcons","Status","DONE","CheckCircleIcon","PENDING","PendingCircleIcon","statusLabels","NOT_DONE","statusMapping","Sentiment","POSITIVE","Summary","action","as","Element","className","content","description","help","icon","illustration","info","status","title","intl","useIntl","media","iconSize","props","size","cloneElement","Badge","_jsxs","clsx","formatMessage","messages","children","_jsx","StatusIcon","Size","SMALL","sentiment","Body","role","type","Typography","BODY_LARGE_BOLD","Info","presentation","LARGE","onClick","BODY_DEFAULT","Link","href","target","text"],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Summary.mjs","sources":["../../src/summary/Summary.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment */\nimport {\n CheckCircleFill as CheckCircleIcon,\n ClockFill as PendingCircleIcon,\n} from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport { ElementType, cloneElement, ReactNode } from 'react';\nimport { useIntl } from 'react-intl';\n\nimport Body from '../body';\nimport {\n Status,\n StatusDone,\n StatusNotDone,\n StatusPending,\n Size,\n Typography,\n Sentiment,\n} from '../common';\nimport Info, { InfoProps } from '../info';\nimport StatusIcon from '../statusIcon';\n\nimport messages from './Summary.messages';\nimport Link from '../link';\nimport type { AlertAction } from '../alert';\n\nconst BadgeIcons = {\n [Status.DONE]: CheckCircleIcon,\n [Status.PENDING]: PendingCircleIcon,\n};\n\nconst statusLabels = {\n [Status.NOT_DONE]: 'statusNotDone',\n [Status.DONE]: 'statusDone',\n [Status.PENDING]: 'statusPending',\n};\n\nconst statusMapping = {\n [Status.DONE]: Sentiment.POSITIVE,\n [Status.PENDING]: Sentiment.PENDING,\n};\n\nexport interface Props {\n /**\n * Action displayed at the bottom of the Summary\n */\n action?: AlertAction;\n /**\n * Decides which html element should wrap the Summary\n */\n as?: ElementType;\n /**\n * Extra classes applied to Summary\n */\n className?: string;\n /**\n * @deprecated please use description instead\n */\n content?: ReactNode;\n /**\n * Summary description\n */\n description?: ReactNode;\n /**\n * @deprecated please use info instead\n */\n help?: {\n content: ReactNode;\n title?: ReactNode;\n };\n /**\n * Infos displayed on help Icon click inside Popover or Modal\n */\n info?: Pick<InfoProps, 'aria-label' | 'content' | 'onClick' | 'presentation' | 'title'>;\n /**\n * @deprecated please use icon instead\n */\n illustration?: ReactNode;\n /**\n * Main Summary Icon\n */\n icon?: ReactNode;\n /**\n * Decides the badge applied to Icon\n */\n status?: StatusNotDone | StatusDone | StatusPending;\n /**\n * Summary title\n */\n title: ReactNode;\n}\n\nconst Summary = ({\n action,\n as: Element = 'div',\n className,\n content = null,\n description = content,\n help,\n icon,\n illustration = null,\n info = help,\n status,\n title,\n}: Props) => {\n const intl = useIntl();\n\n let media = illustration;\n if (icon) {\n // @ts-expect-error if icon is present it has props and size prop\n const iconSize = icon?.props?.size as number;\n\n media =\n iconSize !== 24\n ? // @ts-expect-error we need icon to adjust it's size\n cloneElement(icon, { size: 24 })\n : icon;\n }\n // @ts-expect-error Badge can be null, this is handled in code\n const Badge = status && BadgeIcons[status];\n\n return (\n <Element\n className={clsx('np-summary d-flex align-items-start', className)}\n // @ts-expect-error we check whether `status` is not null before index `statusLabels` and `messages`\n aria-label={status && intl.formatMessage(messages[statusLabels[status]])}\n >\n {icon && (\n <div className=\"np-summary__icon\">\n {media}\n {Badge && (\n <div>\n {/* @ts-expect-error it's okey to pass `undefined` into `sentiment` prop */}\n <StatusIcon size={Size.SMALL} sentiment={statusMapping[status]} />\n </div>\n )}\n </div>\n )}\n <div className={`np-summary__body ${icon ? 'm-l-2' : ''}`}>\n <div className=\"np-summary__title d-flex\">\n <Body\n as=\"span\"\n role=\"heading\"\n aria-level={6}\n type={Typography.BODY_LARGE_BOLD}\n className=\"text-primary text-overflow-wrap m-b-1\"\n >\n {title}\n </Body>\n {info && (\n <Info\n aria-label={info['aria-label']}\n className=\"m-l-1 hidden-xs\"\n content={info.content}\n presentation={info.presentation}\n size={Size.LARGE}\n title={info.title}\n onClick={info.onClick}\n />\n )}\n </div>\n\n {description && (\n <Body\n as=\"span\"\n type={Typography.BODY_DEFAULT}\n className={`d-block text-overflow-wrap ${icon ? 'np-summary__description' : 'np-summary__description-icon'}`}\n >\n {description}\n </Body>\n )}\n {action && (\n <Link\n href={action.href}\n target={action.target}\n className=\"np-summary__action\"\n aria-label={action['aria-label']}\n onClick={action.onClick}\n >\n {action.text}\n </Link>\n )}\n </div>\n {info && (\n <Info\n aria-label={info['aria-label']}\n className=\"m-l-2 hidden-sm hidden-md hidden-lg hidden-xl\"\n content={info.content}\n presentation={info.presentation}\n size={Size.LARGE}\n title={info.title}\n onClick={info.onClick}\n />\n )}\n </Element>\n );\n};\n\nexport default Summary;\n"],"names":["BadgeIcons","Status","DONE","CheckCircleIcon","PENDING","PendingCircleIcon","statusLabels","NOT_DONE","statusMapping","Sentiment","POSITIVE","Summary","action","as","Element","className","content","description","help","icon","illustration","info","status","title","intl","useIntl","media","iconSize","props","size","cloneElement","Badge","_jsxs","clsx","formatMessage","messages","children","_jsx","StatusIcon","Size","SMALL","sentiment","Body","role","type","Typography","BODY_LARGE_BOLD","Info","presentation","LARGE","onClick","BODY_DEFAULT","Link","href","target","text"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AA0BA,MAAMA,UAAU,GAAG;AACjB,EAAA,CAACC,MAAM,CAACC,IAAI,GAAGC,eAAe;EAC9B,CAACF,MAAM,CAACG,OAAO,GAAGC;CACnB;AAED,MAAMC,YAAY,GAAG;AACnB,EAAA,CAACL,MAAM,CAACM,QAAQ,GAAG,eAAe;AAClC,EAAA,CAACN,MAAM,CAACC,IAAI,GAAG,YAAY;EAC3B,CAACD,MAAM,CAACG,OAAO,GAAG;CACnB;AAED,MAAMI,aAAa,GAAG;AACpB,EAAA,CAACP,MAAM,CAACC,IAAI,GAAGO,SAAS,CAACC,QAAQ;AACjC,EAAA,CAACT,MAAM,CAACG,OAAO,GAAGK,SAAS,CAACL;CAC7B;
|
|
1
|
+
{"version":3,"file":"Summary.mjs","sources":["../../src/summary/Summary.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment */\nimport {\n CheckCircleFill as CheckCircleIcon,\n ClockFill as PendingCircleIcon,\n} from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport { ElementType, cloneElement, ReactNode } from 'react';\nimport { useIntl } from 'react-intl';\n\nimport Body from '../body';\nimport {\n Status,\n StatusDone,\n StatusNotDone,\n StatusPending,\n Size,\n Typography,\n Sentiment,\n} from '../common';\nimport Info, { InfoProps } from '../info';\nimport StatusIcon from '../statusIcon';\n\nimport messages from './Summary.messages';\nimport Link from '../link';\nimport type { AlertAction } from '../alert';\n\nconst BadgeIcons = {\n [Status.DONE]: CheckCircleIcon,\n [Status.PENDING]: PendingCircleIcon,\n};\n\nconst statusLabels = {\n [Status.NOT_DONE]: 'statusNotDone',\n [Status.DONE]: 'statusDone',\n [Status.PENDING]: 'statusPending',\n};\n\nconst statusMapping = {\n [Status.DONE]: Sentiment.POSITIVE,\n [Status.PENDING]: Sentiment.PENDING,\n};\n\nexport interface Props {\n /**\n * Action displayed at the bottom of the Summary\n */\n action?: AlertAction;\n /**\n * Decides which html element should wrap the Summary\n */\n as?: ElementType;\n /**\n * Extra classes applied to Summary\n */\n className?: string;\n /**\n * @deprecated please use description instead\n */\n content?: ReactNode;\n /**\n * Summary description\n */\n description?: ReactNode;\n /**\n * @deprecated please use info instead\n */\n help?: {\n content: ReactNode;\n title?: ReactNode;\n };\n /**\n * Infos displayed on help Icon click inside Popover or Modal\n */\n info?: Pick<InfoProps, 'aria-label' | 'content' | 'onClick' | 'presentation' | 'title'>;\n /**\n * @deprecated please use icon instead\n */\n illustration?: ReactNode;\n /**\n * Main Summary Icon\n */\n icon?: ReactNode;\n /**\n * Decides the badge applied to Icon\n */\n status?: StatusNotDone | StatusDone | StatusPending;\n /**\n * Summary title\n */\n title: ReactNode;\n}\n\nconst Summary = ({\n action,\n as: Element = 'div',\n className,\n content = null,\n description = content,\n help,\n icon,\n illustration = null,\n info = help,\n status,\n title,\n}: Props) => {\n const intl = useIntl();\n\n let media = illustration;\n if (icon) {\n // @ts-expect-error if icon is present it has props and size prop\n const iconSize = icon?.props?.size as number;\n\n media =\n iconSize !== 24\n ? // @ts-expect-error we need icon to adjust it's size\n cloneElement(icon, { size: 24 })\n : icon;\n }\n // @ts-expect-error Badge can be null, this is handled in code\n const Badge = status && BadgeIcons[status];\n\n return (\n <Element\n className={clsx('np-summary d-flex align-items-start', className)}\n // @ts-expect-error we check whether `status` is not null before index `statusLabels` and `messages`\n aria-label={status && intl.formatMessage(messages[statusLabels[status]])}\n >\n {icon && (\n <div className=\"np-summary__icon\">\n {media}\n {Badge && (\n <div>\n {/* @ts-expect-error it's okey to pass `undefined` into `sentiment` prop */}\n <StatusIcon size={Size.SMALL} sentiment={statusMapping[status]} />\n </div>\n )}\n </div>\n )}\n <div className={`np-summary__body ${icon ? 'm-l-2' : ''}`}>\n <div className=\"np-summary__title d-flex\">\n <Body\n as=\"span\"\n role=\"heading\"\n aria-level={6}\n type={Typography.BODY_LARGE_BOLD}\n className=\"text-primary text-overflow-wrap m-b-1\"\n >\n {title}\n </Body>\n {info && (\n <Info\n aria-label={info['aria-label']}\n className=\"m-l-1 hidden-xs\"\n content={info.content}\n presentation={info.presentation}\n size={Size.LARGE}\n title={info.title}\n onClick={info.onClick}\n />\n )}\n </div>\n\n {description && (\n <Body\n as=\"span\"\n type={Typography.BODY_DEFAULT}\n className={`d-block text-overflow-wrap ${icon ? 'np-summary__description' : 'np-summary__description-icon'}`}\n >\n {description}\n </Body>\n )}\n {action && (\n <Link\n href={action.href}\n target={action.target}\n className=\"np-summary__action\"\n aria-label={action['aria-label']}\n onClick={action.onClick}\n >\n {action.text}\n </Link>\n )}\n </div>\n {info && (\n <Info\n aria-label={info['aria-label']}\n className=\"m-l-2 hidden-sm hidden-md hidden-lg hidden-xl\"\n content={info.content}\n presentation={info.presentation}\n size={Size.LARGE}\n title={info.title}\n onClick={info.onClick}\n />\n )}\n </Element>\n );\n};\n\nexport default Summary;\n"],"names":["BadgeIcons","Status","DONE","CheckCircleIcon","PENDING","PendingCircleIcon","statusLabels","NOT_DONE","statusMapping","Sentiment","POSITIVE","Summary","action","as","Element","className","content","description","help","icon","illustration","info","status","title","intl","useIntl","media","iconSize","props","size","cloneElement","Badge","_jsxs","clsx","formatMessage","messages","children","_jsx","StatusIcon","Size","SMALL","sentiment","Body","role","type","Typography","BODY_LARGE_BOLD","Info","presentation","LARGE","onClick","BODY_DEFAULT","Link","href","target","text"],"mappings":"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"}
|
package/build/switch/Switch.js
CHANGED
|
@@ -19,36 +19,25 @@ const Switch = props => {
|
|
|
19
19
|
onClick,
|
|
20
20
|
disabled
|
|
21
21
|
} = props;
|
|
22
|
-
const handleKeyDown = event => {
|
|
23
|
-
if (event.key === ' ') {
|
|
24
|
-
event.preventDefault();
|
|
25
|
-
onClick();
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
22
|
const ariaLabelledby = (ariaLabel ? undefined : ariaLabelledbyProp) ?? inputAttributes['aria-labelledby'];
|
|
29
|
-
return /*#__PURE__*/jsxRuntime.
|
|
23
|
+
return /*#__PURE__*/jsxRuntime.jsx("button", {
|
|
30
24
|
className: clsx.clsx('np-switch', {
|
|
31
25
|
'np-switch--unchecked': !checked,
|
|
32
26
|
'np-switch--checked': checked,
|
|
33
27
|
disabled
|
|
34
28
|
}, className),
|
|
35
|
-
|
|
29
|
+
type: "button",
|
|
36
30
|
role: "switch",
|
|
31
|
+
...inputAttributes,
|
|
32
|
+
id: id,
|
|
37
33
|
"aria-checked": checked,
|
|
38
34
|
"aria-label": ariaLabel,
|
|
39
|
-
...inputAttributes,
|
|
40
35
|
"aria-labelledby": ariaLabelledby,
|
|
41
|
-
|
|
42
|
-
"aria-disabled": disabled,
|
|
36
|
+
disabled: disabled,
|
|
43
37
|
onClick: !disabled ? onClick : undefined,
|
|
44
|
-
|
|
45
|
-
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
38
|
+
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
46
39
|
className: "np-switch--thumb"
|
|
47
|
-
})
|
|
48
|
-
type: "checkbox",
|
|
49
|
-
checked: checked,
|
|
50
|
-
readOnly: true
|
|
51
|
-
})]
|
|
40
|
+
})
|
|
52
41
|
});
|
|
53
42
|
};
|
|
54
43
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Switch.js","sources":["../../src/switch/Switch.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport type { KeyboardEventHandler, MouseEvent } from 'react';\n\nimport type { CommonProps } from '../common';\nimport { useInputAttributes } from '../inputs/contexts';\n\nexport type SwitchProps = CommonProps & {\n /**\n * Used to describe the purpose of the switch. To be used if there is no external label (i.e. aria-labelledby is null)\n * @deprecated Use `Field` wrapper or the `aria-labelledby` attribute instead.\n */\n 'aria-label'?: string;\n /** A reference to a label that describes the purpose of the switch. Ignored if aria-label is provided */\n 'aria-labelledby'?: string;\n /** Whether the switch is checked or not */\n checked?: boolean;\n disabled?: boolean;\n /** ID to apply to the switch container */\n id?: string;\n /** Function called when the switch is toggled */\n onClick: (event?: MouseEvent<HTMLSpanElement>) => void;\n};\n\nconst Switch = (props: SwitchProps) => {\n const inputAttributes = useInputAttributes({ nonLabelable: true });\n\n const {\n checked,\n className,\n id = inputAttributes.id,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledbyProp,\n onClick,\n disabled,\n } = props;\n\n const
|
|
1
|
+
{"version":3,"file":"Switch.js","sources":["../../src/switch/Switch.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport type { KeyboardEventHandler, MouseEvent } from 'react';\n\nimport type { CommonProps } from '../common';\nimport { useInputAttributes } from '../inputs/contexts';\n\nexport type SwitchProps = CommonProps & {\n /**\n * Used to describe the purpose of the switch. To be used if there is no external label (i.e. aria-labelledby is null)\n * @deprecated Use `Field` wrapper or the `aria-labelledby` attribute instead.\n */\n 'aria-label'?: string;\n /** A reference to a label that describes the purpose of the switch. Ignored if aria-label is provided */\n 'aria-labelledby'?: string;\n /** Whether the switch is checked or not */\n checked?: boolean;\n disabled?: boolean;\n /** ID to apply to the switch container */\n id?: string;\n /** Function called when the switch is toggled */\n onClick: (event?: MouseEvent<HTMLSpanElement>) => void;\n};\n\nconst Switch = (props: SwitchProps) => {\n const inputAttributes = useInputAttributes({ nonLabelable: true });\n\n const {\n checked,\n className,\n id = inputAttributes.id,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledbyProp,\n onClick,\n disabled,\n } = props;\n\n const ariaLabelledby =\n (ariaLabel ? undefined : ariaLabelledbyProp) ?? inputAttributes['aria-labelledby'];\n\n return (\n <button\n className={clsx(\n 'np-switch',\n {\n 'np-switch--unchecked': !checked,\n 'np-switch--checked': checked,\n disabled,\n },\n className,\n )}\n type=\"button\"\n role=\"switch\"\n {...inputAttributes}\n id={id}\n aria-checked={checked}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby}\n disabled={disabled}\n onClick={!disabled ? onClick : undefined}\n >\n <span className=\"np-switch--thumb\" />\n </button>\n );\n};\n\nexport default Switch;\n"],"names":["Switch","props","inputAttributes","useInputAttributes","nonLabelable","checked","className","id","ariaLabel","ariaLabelledbyProp","onClick","disabled","ariaLabelledby","undefined","_jsx","clsx","type","role","children"],"mappings":";;;;;;;;AAuBA,MAAMA,MAAM,GAAIC,KAAkB,IAAI;EACpC,MAAMC,eAAe,GAAGC,2BAAkB,CAAC;AAAEC,IAAAA,YAAY,EAAE;AAAI,GAAE,CAAC;EAElE,MAAM;IACJC,OAAO;IACPC,SAAS;IACTC,EAAE,GAAGL,eAAe,CAACK,EAAE;AACvB,IAAA,YAAY,EAAEC,SAAS;AACvB,IAAA,iBAAiB,EAAEC,kBAAkB;IACrCC,OAAO;AACPC,IAAAA;AAAQ,GACT,GAAGV,KAAK;AAET,EAAA,MAAMW,cAAc,GAClB,CAACJ,SAAS,GAAGK,SAAS,GAAGJ,kBAAkB,KAAKP,eAAe,CAAC,iBAAiB,CAAC;AAEpF,EAAA,oBACEY,cAAA,CAAA,QAAA,EAAA;AACER,IAAAA,SAAS,EAAES,SAAI,CACb,WAAW,EACX;MACE,sBAAsB,EAAE,CAACV,OAAO;AAChC,MAAA,oBAAoB,EAAEA,OAAO;AAC7BM,MAAAA;KACD,EACDL,SAAS,CACT;AACFU,IAAAA,IAAI,EAAC,QAAQ;AACbC,IAAAA,IAAI,EAAC,QAAQ;AAAA,IAAA,GACTf,eAAe;AACnBK,IAAAA,EAAE,EAAEA,EAAG;AACP,IAAA,cAAA,EAAcF,OAAQ;AACtB,IAAA,YAAA,EAAYG,SAAU;AACtB,IAAA,iBAAA,EAAiBI,cAAe;AAChCD,IAAAA,QAAQ,EAAEA,QAAS;AACnBD,IAAAA,OAAO,EAAE,CAACC,QAAQ,GAAGD,OAAO,GAAGG,SAAU;AAAAK,IAAAA,QAAA,eAEzCJ,cAAA,CAAA,MAAA,EAAA;AAAMR,MAAAA,SAAS,EAAC;KAAkB;AACpC,GAAQ,CAAC;AAEb;;;;"}
|
package/build/switch/Switch.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { clsx } from 'clsx';
|
|
2
2
|
import { useInputAttributes } from '../inputs/contexts.mjs';
|
|
3
|
-
import {
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
4
|
|
|
5
5
|
const Switch = props => {
|
|
6
6
|
const inputAttributes = useInputAttributes({
|
|
@@ -15,36 +15,25 @@ const Switch = props => {
|
|
|
15
15
|
onClick,
|
|
16
16
|
disabled
|
|
17
17
|
} = props;
|
|
18
|
-
const handleKeyDown = event => {
|
|
19
|
-
if (event.key === ' ') {
|
|
20
|
-
event.preventDefault();
|
|
21
|
-
onClick();
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
18
|
const ariaLabelledby = (ariaLabel ? undefined : ariaLabelledbyProp) ?? inputAttributes['aria-labelledby'];
|
|
25
|
-
return /*#__PURE__*/
|
|
19
|
+
return /*#__PURE__*/jsx("button", {
|
|
26
20
|
className: clsx('np-switch', {
|
|
27
21
|
'np-switch--unchecked': !checked,
|
|
28
22
|
'np-switch--checked': checked,
|
|
29
23
|
disabled
|
|
30
24
|
}, className),
|
|
31
|
-
|
|
25
|
+
type: "button",
|
|
32
26
|
role: "switch",
|
|
27
|
+
...inputAttributes,
|
|
28
|
+
id: id,
|
|
33
29
|
"aria-checked": checked,
|
|
34
30
|
"aria-label": ariaLabel,
|
|
35
|
-
...inputAttributes,
|
|
36
31
|
"aria-labelledby": ariaLabelledby,
|
|
37
|
-
|
|
38
|
-
"aria-disabled": disabled,
|
|
32
|
+
disabled: disabled,
|
|
39
33
|
onClick: !disabled ? onClick : undefined,
|
|
40
|
-
|
|
41
|
-
children: [/*#__PURE__*/jsx("span", {
|
|
34
|
+
children: /*#__PURE__*/jsx("span", {
|
|
42
35
|
className: "np-switch--thumb"
|
|
43
|
-
})
|
|
44
|
-
type: "checkbox",
|
|
45
|
-
checked: checked,
|
|
46
|
-
readOnly: true
|
|
47
|
-
})]
|
|
36
|
+
})
|
|
48
37
|
});
|
|
49
38
|
};
|
|
50
39
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Switch.mjs","sources":["../../src/switch/Switch.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport type { KeyboardEventHandler, MouseEvent } from 'react';\n\nimport type { CommonProps } from '../common';\nimport { useInputAttributes } from '../inputs/contexts';\n\nexport type SwitchProps = CommonProps & {\n /**\n * Used to describe the purpose of the switch. To be used if there is no external label (i.e. aria-labelledby is null)\n * @deprecated Use `Field` wrapper or the `aria-labelledby` attribute instead.\n */\n 'aria-label'?: string;\n /** A reference to a label that describes the purpose of the switch. Ignored if aria-label is provided */\n 'aria-labelledby'?: string;\n /** Whether the switch is checked or not */\n checked?: boolean;\n disabled?: boolean;\n /** ID to apply to the switch container */\n id?: string;\n /** Function called when the switch is toggled */\n onClick: (event?: MouseEvent<HTMLSpanElement>) => void;\n};\n\nconst Switch = (props: SwitchProps) => {\n const inputAttributes = useInputAttributes({ nonLabelable: true });\n\n const {\n checked,\n className,\n id = inputAttributes.id,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledbyProp,\n onClick,\n disabled,\n } = props;\n\n const
|
|
1
|
+
{"version":3,"file":"Switch.mjs","sources":["../../src/switch/Switch.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport type { KeyboardEventHandler, MouseEvent } from 'react';\n\nimport type { CommonProps } from '../common';\nimport { useInputAttributes } from '../inputs/contexts';\n\nexport type SwitchProps = CommonProps & {\n /**\n * Used to describe the purpose of the switch. To be used if there is no external label (i.e. aria-labelledby is null)\n * @deprecated Use `Field` wrapper or the `aria-labelledby` attribute instead.\n */\n 'aria-label'?: string;\n /** A reference to a label that describes the purpose of the switch. Ignored if aria-label is provided */\n 'aria-labelledby'?: string;\n /** Whether the switch is checked or not */\n checked?: boolean;\n disabled?: boolean;\n /** ID to apply to the switch container */\n id?: string;\n /** Function called when the switch is toggled */\n onClick: (event?: MouseEvent<HTMLSpanElement>) => void;\n};\n\nconst Switch = (props: SwitchProps) => {\n const inputAttributes = useInputAttributes({ nonLabelable: true });\n\n const {\n checked,\n className,\n id = inputAttributes.id,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledbyProp,\n onClick,\n disabled,\n } = props;\n\n const ariaLabelledby =\n (ariaLabel ? undefined : ariaLabelledbyProp) ?? inputAttributes['aria-labelledby'];\n\n return (\n <button\n className={clsx(\n 'np-switch',\n {\n 'np-switch--unchecked': !checked,\n 'np-switch--checked': checked,\n disabled,\n },\n className,\n )}\n type=\"button\"\n role=\"switch\"\n {...inputAttributes}\n id={id}\n aria-checked={checked}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby}\n disabled={disabled}\n onClick={!disabled ? onClick : undefined}\n >\n <span className=\"np-switch--thumb\" />\n </button>\n );\n};\n\nexport default Switch;\n"],"names":["Switch","props","inputAttributes","useInputAttributes","nonLabelable","checked","className","id","ariaLabel","ariaLabelledbyProp","onClick","disabled","ariaLabelledby","undefined","_jsx","clsx","type","role","children"],"mappings":";;;;AAuBA,MAAMA,MAAM,GAAIC,KAAkB,IAAI;EACpC,MAAMC,eAAe,GAAGC,kBAAkB,CAAC;AAAEC,IAAAA,YAAY,EAAE;AAAI,GAAE,CAAC;EAElE,MAAM;IACJC,OAAO;IACPC,SAAS;IACTC,EAAE,GAAGL,eAAe,CAACK,EAAE;AACvB,IAAA,YAAY,EAAEC,SAAS;AACvB,IAAA,iBAAiB,EAAEC,kBAAkB;IACrCC,OAAO;AACPC,IAAAA;AAAQ,GACT,GAAGV,KAAK;AAET,EAAA,MAAMW,cAAc,GAClB,CAACJ,SAAS,GAAGK,SAAS,GAAGJ,kBAAkB,KAAKP,eAAe,CAAC,iBAAiB,CAAC;AAEpF,EAAA,oBACEY,GAAA,CAAA,QAAA,EAAA;AACER,IAAAA,SAAS,EAAES,IAAI,CACb,WAAW,EACX;MACE,sBAAsB,EAAE,CAACV,OAAO;AAChC,MAAA,oBAAoB,EAAEA,OAAO;AAC7BM,MAAAA;KACD,EACDL,SAAS,CACT;AACFU,IAAAA,IAAI,EAAC,QAAQ;AACbC,IAAAA,IAAI,EAAC,QAAQ;AAAA,IAAA,GACTf,eAAe;AACnBK,IAAAA,EAAE,EAAEA,EAAG;AACP,IAAA,cAAA,EAAcF,OAAQ;AACtB,IAAA,YAAA,EAAYG,SAAU;AACtB,IAAA,iBAAA,EAAiBI,cAAe;AAChCD,IAAAA,QAAQ,EAAEA,QAAS;AACnBD,IAAAA,OAAO,EAAE,CAACC,QAAQ,GAAGD,OAAO,GAAGG,SAAU;AAAAK,IAAAA,QAAA,eAEzCJ,GAAA,CAAA,MAAA,EAAA;AAAMR,MAAAA,SAAS,EAAC;KAAkB;AACpC,GAAQ,CAAC;AAEb;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SwitchOption.js","sources":["../../src/switchOption/SwitchOption.tsx"],"sourcesContent":["import { MouseEvent } from 'react';\n\nimport Option from '../common/Option';\nimport Switch from '../switch';\n\nexport type SwitchOptionProps = {\n checked?: boolean;\n complex?: boolean;\n content?: React.ReactNode;\n disabled?: boolean;\n showMediaCircle?: boolean;\n showMediaAtAllSizes?: boolean;\n isContainerAligned?: boolean;\n id?: string;\n media?: React.ReactNode;\n onChange: (newValue: boolean) => void;\n title: React.ReactNode;\n 'aria-label': string;\n};\n\nconst stopPropagation = (event?: MouseEvent<HTMLSpanElement>) => {\n if (event) {\n event.stopPropagation();\n event.preventDefault();\n event.nativeEvent?.stopImmediatePropagation?.();\n }\n};\n\nconst SwitchOption = ({\n checked,\n complex,\n content,\n disabled,\n id,\n media,\n onChange,\n title,\n showMediaCircle,\n showMediaAtAllSizes,\n isContainerAligned,\n 'aria-label': ariaLabel,\n}: SwitchOptionProps) => {\n const sharedProps = {\n media,\n title,\n content,\n complex,\n disabled,\n showMediaCircle,\n showMediaAtAllSizes,\n isContainerAligned,\n };\n const toggle = (event?: MouseEvent<HTMLSpanElement>) => {\n stopPropagation(event);\n if (disabled) {\n return;\n }\n\n onChange(!checked);\n };\n\n return (\n <Option\n {...sharedProps}\n button={\n <Switch\n id={id}\n checked={checked}\n disabled={disabled}\n aria-label={ariaLabel}\n onClick={toggle}\n />\n }\n onClick={toggle}\n />\n );\n};\n\nexport default SwitchOption;\n"],"names":["stopPropagation","event","preventDefault","nativeEvent","stopImmediatePropagation","SwitchOption","checked","complex","content","disabled","id","media","onChange","title","showMediaCircle","showMediaAtAllSizes","isContainerAligned","ariaLabel","sharedProps","toggle","_jsx","Option","button","Switch","onClick"],"mappings":";;;;;;;;AAoBA,MAAMA,eAAe,GAAIC,KAAmC,IAAI;AAC9D,EAAA,IAAIA,KAAK,EAAE;IACTA,KAAK,CAACD,eAAe,EAAE;IACvBC,KAAK,CAACC,cAAc,EAAE;AACtBD,IAAAA,KAAK,CAACE,WAAW,EAAEC,wBAAwB,IAAI;AACjD;AACF,CAAC;
|
|
1
|
+
{"version":3,"file":"SwitchOption.js","sources":["../../src/switchOption/SwitchOption.tsx"],"sourcesContent":["import { MouseEvent } from 'react';\n\nimport Option from '../common/Option';\nimport Switch from '../switch';\n\nexport type SwitchOptionProps = {\n checked?: boolean;\n complex?: boolean;\n content?: React.ReactNode;\n disabled?: boolean;\n showMediaCircle?: boolean;\n showMediaAtAllSizes?: boolean;\n isContainerAligned?: boolean;\n id?: string;\n media?: React.ReactNode;\n onChange: (newValue: boolean) => void;\n title: React.ReactNode;\n 'aria-label': string;\n};\n\nconst stopPropagation = (event?: MouseEvent<HTMLSpanElement>) => {\n if (event) {\n event.stopPropagation();\n event.preventDefault();\n event.nativeEvent?.stopImmediatePropagation?.();\n }\n};\n\nconst SwitchOption = ({\n checked,\n complex,\n content,\n disabled,\n id,\n media,\n onChange,\n title,\n showMediaCircle,\n showMediaAtAllSizes,\n isContainerAligned,\n 'aria-label': ariaLabel,\n}: SwitchOptionProps) => {\n const sharedProps = {\n media,\n title,\n content,\n complex,\n disabled,\n showMediaCircle,\n showMediaAtAllSizes,\n isContainerAligned,\n };\n const toggle = (event?: MouseEvent<HTMLSpanElement>) => {\n stopPropagation(event);\n if (disabled) {\n return;\n }\n\n onChange(!checked);\n };\n\n return (\n <Option\n {...sharedProps}\n className=\"np-switch-option\"\n button={\n <Switch\n id={id}\n checked={checked}\n disabled={disabled}\n aria-label={ariaLabel}\n onClick={toggle}\n />\n }\n onClick={toggle}\n />\n );\n};\n\nexport default SwitchOption;\n"],"names":["stopPropagation","event","preventDefault","nativeEvent","stopImmediatePropagation","SwitchOption","checked","complex","content","disabled","id","media","onChange","title","showMediaCircle","showMediaAtAllSizes","isContainerAligned","ariaLabel","sharedProps","toggle","_jsx","Option","className","button","Switch","onClick"],"mappings":";;;;;;;;AAoBA,MAAMA,eAAe,GAAIC,KAAmC,IAAI;AAC9D,EAAA,IAAIA,KAAK,EAAE;IACTA,KAAK,CAACD,eAAe,EAAE;IACvBC,KAAK,CAACC,cAAc,EAAE;AACtBD,IAAAA,KAAK,CAACE,WAAW,EAAEC,wBAAwB,IAAI;AACjD,EAAA;AACF,CAAC;AAED,MAAMC,YAAY,GAAGA,CAAC;EACpBC,OAAO;EACPC,OAAO;EACPC,OAAO;EACPC,QAAQ;EACRC,EAAE;EACFC,KAAK;EACLC,QAAQ;EACRC,KAAK;EACLC,eAAe;EACfC,mBAAmB;EACnBC,kBAAkB;AAClB,EAAA,YAAY,EAAEC;AAAS,CACL,KAAI;AACtB,EAAA,MAAMC,WAAW,GAAG;IAClBP,KAAK;IACLE,KAAK;IACLL,OAAO;IACPD,OAAO;IACPE,QAAQ;IACRK,eAAe;IACfC,mBAAmB;AACnBC,IAAAA;GACD;EACD,MAAMG,MAAM,GAAIlB,KAAmC,IAAI;IACrDD,eAAe,CAACC,KAAK,CAAC;AACtB,IAAA,IAAIQ,QAAQ,EAAE;AACZ,MAAA;AACF,IAAA;IAEAG,QAAQ,CAAC,CAACN,OAAO,CAAC;EACpB,CAAC;EAED,oBACEc,cAAA,CAACC,cAAM,EAAA;AAAA,IAAA,GACDH,WAAW;AACfI,IAAAA,SAAS,EAAC,kBAAkB;IAC5BC,MAAM,eACJH,cAAA,CAACI,cAAM,EAAA;AACLd,MAAAA,EAAE,EAAEA,EAAG;AACPJ,MAAAA,OAAO,EAAEA,OAAQ;AACjBG,MAAAA,QAAQ,EAAEA,QAAS;AACnB,MAAA,YAAA,EAAYQ,SAAU;AACtBQ,MAAAA,OAAO,EAAEN;AAAO,KAAA,CAEnB;AACDM,IAAAA,OAAO,EAAEN;AAAO,GAAA,CAChB;AAEN;;;;"}
|