@razorpay/blade 10.23.5 → 11.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/lib/native/components/Accordion/AccordionButton.native.js +2 -3
- package/build/lib/native/components/Accordion/AccordionButton.native.js.map +1 -1
- package/build/lib/native/components/Accordion/AccordionItem.js +1 -1
- package/build/lib/native/components/Accordion/AccordionItem.js.map +1 -1
- package/build/lib/native/components/Accordion/commonStyles.js +1 -1
- package/build/lib/native/components/Accordion/commonStyles.js.map +1 -1
- package/build/lib/native/components/ActionList/ActionList.js +2 -3
- package/build/lib/native/components/ActionList/ActionList.js.map +1 -1
- package/build/lib/native/components/ActionList/ActionListBox.native.js +4 -1
- package/build/lib/native/components/ActionList/ActionListBox.native.js.map +1 -1
- package/build/lib/native/components/ActionList/ActionListItem.js +1 -2
- package/build/lib/native/components/ActionList/ActionListItem.js.map +1 -1
- package/build/lib/native/components/ActionList/ActionListNoResults.js +1 -1
- package/build/lib/native/components/ActionList/ActionListNoResults.js.map +1 -1
- package/build/lib/native/components/ActionList/actionListUtils.js +1 -1
- package/build/lib/native/components/ActionList/actionListUtils.js.map +1 -1
- package/build/lib/native/components/ActionList/styles/StyledActionListItem.native.js +1 -1
- package/build/lib/native/components/ActionList/styles/StyledActionListItem.native.js.map +1 -1
- package/build/lib/native/components/Alert/Alert.js +1 -3
- package/build/lib/native/components/Alert/Alert.js.map +1 -1
- package/build/lib/native/components/Alert/styles.js +1 -1
- package/build/lib/native/components/Alert/styles.js.map +1 -1
- package/build/lib/native/components/Amount/Amount.js +7 -3
- package/build/lib/native/components/Amount/Amount.js.map +1 -1
- package/build/lib/native/components/Amount/amountTokens.js +2 -2
- package/build/lib/native/components/Amount/amountTokens.js.map +1 -1
- package/build/lib/native/components/Badge/Badge.js +3 -2
- package/build/lib/native/components/Badge/Badge.js.map +1 -1
- package/build/lib/native/components/Badge/badgeTokens.js +4 -2
- package/build/lib/native/components/Badge/badgeTokens.js.map +1 -1
- package/build/lib/native/components/BaseHeaderFooter/BaseHeader.js +1 -2
- package/build/lib/native/components/BaseHeaderFooter/BaseHeader.js.map +1 -1
- package/build/lib/native/components/BottomSheet/BottomSheet.native.js +1 -1
- package/build/lib/native/components/BottomSheet/BottomSheet.native.js.map +1 -1
- package/build/lib/native/components/BottomSheet/BottomSheetBackdrop.native.js +1 -1
- package/build/lib/native/components/BottomSheet/BottomSheetBackdrop.native.js.map +1 -1
- package/build/lib/native/components/BottomSheet/BottomSheetCommon.js +2 -2
- package/build/lib/native/components/BottomSheet/BottomSheetCommon.js.map +1 -1
- package/build/lib/native/components/BottomSheet/BottomSheetFooter.native.js +2 -9
- package/build/lib/native/components/BottomSheet/BottomSheetFooter.native.js.map +1 -1
- package/build/lib/native/components/BottomSheet/getBottomSheetGrabHandleStyles.js +1 -1
- package/build/lib/native/components/BottomSheet/getBottomSheetGrabHandleStyles.js.map +1 -1
- package/build/lib/native/components/Box/BaseBox/baseBoxStyles.js +1 -1
- package/build/lib/native/components/Box/BaseBox/baseBoxStyles.js.map +1 -1
- package/build/lib/native/components/Box/BaseBox/types/propsTypes.js.map +1 -1
- package/build/lib/native/components/Button/BaseButton/BaseButton.js +2 -2
- package/build/lib/native/components/Button/BaseButton/BaseButton.js.map +1 -1
- package/build/lib/native/components/Button/BaseButton/StyledBaseButton.native.js +1 -1
- package/build/lib/native/components/Button/BaseButton/StyledBaseButton.native.js.map +1 -1
- package/build/lib/native/components/Button/BaseButton/buttonTokens.js +2 -2
- package/build/lib/native/components/Button/BaseButton/buttonTokens.js.map +1 -1
- package/build/lib/native/components/Button/BaseButton/getStyledBaseButtonStyles.js +1 -1
- package/build/lib/native/components/Button/BaseButton/getStyledBaseButtonStyles.js.map +1 -1
- package/build/lib/native/components/Button/Button/Button.js +1 -1
- package/build/lib/native/components/Button/Button/Button.js.map +1 -1
- package/build/lib/native/components/Button/IconButton/IconButton.js +1 -1
- package/build/lib/native/components/Button/IconButton/IconButton.js.map +1 -1
- package/build/lib/native/components/Button/IconButton/StyledIconButton.native.js +1 -1
- package/build/lib/native/components/Button/IconButton/StyledIconButton.native.js.map +1 -1
- package/build/lib/native/components/Card/Card.js +1 -1
- package/build/lib/native/components/Card/Card.js.map +1 -1
- package/build/lib/native/components/Card/CardFooter.js +1 -1
- package/build/lib/native/components/Card/CardFooter.js.map +1 -1
- package/build/lib/native/components/Card/CardHeader.js +3 -3
- package/build/lib/native/components/Card/CardHeader.js.map +1 -1
- package/build/lib/native/components/Card/CardRoot.native.js +1 -1
- package/build/lib/native/components/Card/CardRoot.native.js.map +1 -1
- package/build/lib/native/components/Card/CardSurface.native.js +1 -1
- package/build/lib/native/components/Card/CardSurface.native.js.map +1 -1
- package/build/lib/native/components/Carousel/Carousel.native.js +2 -1
- package/build/lib/native/components/Carousel/Carousel.native.js.map +1 -1
- package/build/lib/native/components/Carousel/Indicators/getIndicatorButtonStyles.js +2 -1
- package/build/lib/native/components/Carousel/Indicators/getIndicatorButtonStyles.js.map +1 -1
- package/build/lib/native/components/Carousel/NavigationButton/NavigationButton.js +1 -1
- package/build/lib/native/components/Carousel/NavigationButton/NavigationButton.js.map +1 -1
- package/build/lib/native/components/Carousel/NavigationButton/StyledNavigationButton.native.js +7 -1
- package/build/lib/native/components/Carousel/NavigationButton/StyledNavigationButton.native.js.map +1 -1
- package/build/lib/native/components/Carousel/NavigationButton/getNavigationButtonStyles.js +2 -1
- package/build/lib/native/components/Carousel/NavigationButton/getNavigationButtonStyles.js.map +1 -1
- package/build/lib/native/components/Checkbox/CheckboxIcon/CheckboxIcon.js +1 -1
- package/build/lib/native/components/Checkbox/CheckboxIcon/CheckboxIcon.js.map +1 -1
- package/build/lib/native/components/Checkbox/CheckboxIcon/CheckboxIconWrapperStyles.js +1 -1
- package/build/lib/native/components/Checkbox/CheckboxIcon/CheckboxIconWrapperStyles.js.map +1 -1
- package/build/lib/native/components/Checkbox/checkboxTokens.js +1 -1
- package/build/lib/native/components/Checkbox/checkboxTokens.js.map +1 -1
- package/build/lib/native/components/Chip/AnimatedChip.native.js +1 -1
- package/build/lib/native/components/Chip/AnimatedChip.native.js.map +1 -1
- package/build/lib/native/components/Chip/Chip.js +1 -1
- package/build/lib/native/components/Chip/Chip.js.map +1 -1
- package/build/lib/native/components/Chip/ChipGroup.js +1 -1
- package/build/lib/native/components/Chip/ChipGroup.js.map +1 -1
- package/build/lib/native/components/Chip/chipTokens.js +1 -1
- package/build/lib/native/components/Chip/chipTokens.js.map +1 -1
- package/build/lib/native/components/Chip/getAnimatedChipStyles.js +1 -1
- package/build/lib/native/components/Chip/getAnimatedChipStyles.js.map +1 -1
- package/build/lib/native/components/Chip/useChipGroup.js +1 -1
- package/build/lib/native/components/Chip/useChipGroup.js.map +1 -1
- package/build/lib/native/components/Counter/Counter.js +3 -3
- package/build/lib/native/components/Counter/Counter.js.map +1 -1
- package/build/lib/native/components/Counter/counterTokens.js +2 -2
- package/build/lib/native/components/Counter/counterTokens.js.map +1 -1
- package/build/lib/native/components/Divider/Divider.js +1 -1
- package/build/lib/native/components/Divider/Divider.js.map +1 -1
- package/build/lib/native/components/Dropdown/Dropdown.js +1 -1
- package/build/lib/native/components/Dropdown/Dropdown.js.map +1 -1
- package/build/lib/native/components/Dropdown/StyledDropdownOverlay.js +1 -1
- package/build/lib/native/components/Dropdown/StyledDropdownOverlay.js.map +1 -1
- package/build/lib/native/components/Form/CharacterCounter/CharacterCounter.js +1 -1
- package/build/lib/native/components/Form/CharacterCounter/CharacterCounter.js.map +1 -1
- package/build/lib/native/components/Form/FormHint.js +2 -2
- package/build/lib/native/components/Form/FormHint.js.map +1 -1
- package/build/lib/native/components/Form/FormLabel.js +2 -2
- package/build/lib/native/components/Form/FormLabel.js.map +1 -1
- package/build/lib/native/components/Form/Selector/SelectorSupportText.js +4 -2
- package/build/lib/native/components/Form/Selector/SelectorSupportText.js.map +1 -1
- package/build/lib/native/components/Form/Selector/SelectorTitle.js +2 -2
- package/build/lib/native/components/Form/Selector/SelectorTitle.js.map +1 -1
- package/build/lib/native/components/Icons/useIconProps/useIconProps.js +1 -1
- package/build/lib/native/components/Icons/useIconProps/useIconProps.js.map +1 -1
- package/build/lib/native/components/Indicator/Indicator.js +1 -1
- package/build/lib/native/components/Indicator/Indicator.js.map +1 -1
- package/build/lib/native/components/Input/BaseInput/AnimatedBaseInputWrapper.native.js +1 -1
- package/build/lib/native/components/Input/BaseInput/AnimatedBaseInputWrapper.native.js.map +1 -1
- package/build/lib/native/components/Input/BaseInput/BaseInputAnimatedBorder.native.js +1 -1
- package/build/lib/native/components/Input/BaseInput/BaseInputAnimatedBorder.native.js.map +1 -1
- package/build/lib/native/components/Input/BaseInput/BaseInputTagSlot.native.js +1 -1
- package/build/lib/native/components/Input/BaseInput/BaseInputTagSlot.native.js.map +1 -1
- package/build/lib/native/components/Input/BaseInput/BaseInputVisuals.js +1 -1
- package/build/lib/native/components/Input/BaseInput/BaseInputVisuals.js.map +1 -1
- package/build/lib/native/components/Input/BaseInput/BaseInputWrapper.js.map +1 -1
- package/build/lib/native/components/Input/BaseInput/StyledBaseInput.native.js +1 -1
- package/build/lib/native/components/Input/BaseInput/StyledBaseInput.native.js.map +1 -1
- package/build/lib/native/components/Input/BaseInput/baseInputStyles.js +1 -1
- package/build/lib/native/components/Input/BaseInput/baseInputStyles.js.map +1 -1
- package/build/lib/native/components/Input/DropdownInputTriggers/Chevron.js +1 -1
- package/build/lib/native/components/Input/DropdownInputTriggers/Chevron.js.map +1 -1
- package/build/lib/native/components/Link/BaseLink/BaseLink.js +3 -3
- package/build/lib/native/components/Link/BaseLink/BaseLink.js.map +1 -1
- package/build/lib/native/components/Link/BaseLink/StyledBaseLink.native.js +1 -1
- package/build/lib/native/components/Link/BaseLink/StyledBaseLink.native.js.map +1 -1
- package/build/lib/native/components/Link/Link/Link.js +1 -1
- package/build/lib/native/components/Link/Link/Link.js.map +1 -1
- package/build/lib/native/components/List/List.js +1 -1
- package/build/lib/native/components/List/List.js.map +1 -1
- package/build/lib/native/components/List/ListItem.js +1 -1
- package/build/lib/native/components/List/ListItem.js.map +1 -1
- package/build/lib/native/components/List/ListItemIcons.js +4 -1
- package/build/lib/native/components/List/ListItemIcons.js.map +1 -1
- package/build/lib/native/components/Popover/Popover.native.js +1 -1
- package/build/lib/native/components/Popover/Popover.native.js.map +1 -1
- package/build/lib/native/components/Popover/PopoverContent.js +2 -3
- package/build/lib/native/components/Popover/PopoverContent.js.map +1 -1
- package/build/lib/native/components/Popover/getPopoverContentWrapperStyles.js +1 -1
- package/build/lib/native/components/Popover/getPopoverContentWrapperStyles.js.map +1 -1
- package/build/lib/native/components/ProgressBar/ProgressBar.js +14 -18
- package/build/lib/native/components/ProgressBar/ProgressBar.js.map +1 -1
- package/build/lib/native/components/Radio/Radio.js +1 -1
- package/build/lib/native/components/Radio/Radio.js.map +1 -1
- package/build/lib/native/components/Radio/RadioIcon/RadioIcon.js +1 -1
- package/build/lib/native/components/Radio/RadioIcon/RadioIcon.js.map +1 -1
- package/build/lib/native/components/Radio/RadioIcon/RadioIconWrapperStyles.js +1 -1
- package/build/lib/native/components/Radio/RadioIcon/RadioIconWrapperStyles.js.map +1 -1
- package/build/lib/native/components/Radio/radioTokens.js +1 -1
- package/build/lib/native/components/Radio/radioTokens.js.map +1 -1
- package/build/lib/native/components/Skeleton/PulseAnimation.native.js +1 -2
- package/build/lib/native/components/Skeleton/PulseAnimation.native.js.map +1 -1
- package/build/lib/native/components/Skeleton/Skeleton.js +1 -1
- package/build/lib/native/components/Skeleton/Skeleton.js.map +1 -1
- package/build/lib/native/components/Spinner/BaseSpinner/BaseSpinner.js +1 -1
- package/build/lib/native/components/Spinner/BaseSpinner/BaseSpinner.js.map +1 -1
- package/build/lib/native/components/Spinner/Spinner/Spinner.js +1 -1
- package/build/lib/native/components/Spinner/Spinner/Spinner.js.map +1 -1
- package/build/lib/native/components/Switch/switchTokens.js +1 -1
- package/build/lib/native/components/Switch/switchTokens.js.map +1 -1
- package/build/lib/native/components/Tabs/TabIndicator.native.js +1 -1
- package/build/lib/native/components/Tabs/TabIndicator.native.js.map +1 -1
- package/build/lib/native/components/Tabs/Tabs.native.js +3 -2
- package/build/lib/native/components/Tabs/Tabs.native.js.map +1 -1
- package/build/lib/native/components/Tabs/tabTokens.js +2 -2
- package/build/lib/native/components/Tabs/tabTokens.js.map +1 -1
- package/build/lib/native/components/Tag/Tag.js +1 -1
- package/build/lib/native/components/Tag/Tag.js.map +1 -1
- package/build/lib/native/components/Tooltip/Tooltip.native.js +1 -1
- package/build/lib/native/components/Tooltip/Tooltip.native.js.map +1 -1
- package/build/lib/native/components/Tooltip/TooltipContent.js +1 -1
- package/build/lib/native/components/Tooltip/TooltipContent.js.map +1 -1
- package/build/lib/native/components/Tooltip/getTooltipContentWrapperStyles.js +1 -1
- package/build/lib/native/components/Tooltip/getTooltipContentWrapperStyles.js.map +1 -1
- package/build/lib/native/components/Typography/BaseText/BaseText.native.js +1 -1
- package/build/lib/native/components/Typography/BaseText/BaseText.native.js.map +1 -1
- package/build/lib/native/components/Typography/BaseText/getBaseTextStyles.js +2 -1
- package/build/lib/native/components/Typography/BaseText/getBaseTextStyles.js.map +1 -1
- package/build/lib/native/components/Typography/Code/Code.js +1 -1
- package/build/lib/native/components/Typography/Code/Code.js.map +1 -1
- package/build/lib/native/components/Typography/Display/Display.js +1 -1
- package/build/lib/native/components/Typography/Display/Display.js.map +1 -1
- package/build/lib/native/components/Typography/Heading/Heading.js +1 -2
- package/build/lib/native/components/Typography/Heading/Heading.js.map +1 -1
- package/build/lib/native/components/Typography/Text/Text.js +1 -1
- package/build/lib/native/components/Typography/Text/Text.js.map +1 -1
- package/build/lib/native/components/Typography/Text/getTextStyles.js +1 -1
- package/build/lib/native/components/Typography/Text/getTextStyles.js.map +1 -1
- package/build/lib/native/components/index.js +37 -38
- package/build/lib/native/components/index.js.map +1 -1
- package/build/lib/native/tokens/global/border.js +1 -1
- package/build/lib/native/tokens/global/border.js.map +1 -1
- package/build/lib/native/tokens/global/colors.js +1 -1
- package/build/lib/native/tokens/global/colors.js.map +1 -1
- package/build/lib/native/tokens/global/elevation/elevation.native.js +1 -1
- package/build/lib/native/tokens/global/elevation/elevation.native.js.map +1 -1
- package/build/lib/native/tokens/global/fontFamily/fontFamily.native.js +1 -1
- package/build/lib/native/tokens/global/fontFamily/fontFamily.native.js.map +1 -1
- package/build/lib/native/tokens/global/motion.js.map +1 -1
- package/build/lib/native/tokens/global/opacity.js +1 -1
- package/build/lib/native/tokens/global/opacity.js.map +1 -1
- package/build/lib/native/tokens/global/typography.js +1 -1
- package/build/lib/native/tokens/global/typography.js.map +1 -1
- package/build/lib/native/tokens/index.js +1 -2
- package/build/lib/native/tokens/index.js.map +1 -1
- package/build/lib/native/tokens/theme/bladeTheme.js +13 -0
- package/build/lib/native/tokens/theme/bladeTheme.js.map +1 -0
- package/build/lib/native/tokens/theme/createTheme.js +2 -2
- package/build/lib/native/tokens/theme/createTheme.js.map +1 -1
- package/build/lib/native/tokens/theme/overrideTheme.js +3 -3
- package/build/lib/native/tokens/theme/overrideTheme.js.map +1 -1
- package/build/lib/native/tokens/theme/theme.js.map +1 -1
- package/build/lib/native/utils/getFocusRingStyles/getFocusRingStyles.native.js +4 -0
- package/build/lib/native/utils/getFocusRingStyles/getFocusRingStyles.native.js.map +1 -0
- package/build/lib/native/utils/lodashButBetter/get.js.map +1 -1
- package/build/lib/native/utils/lodashButBetter/isEmpty.js.map +1 -1
- package/build/lib/native/utils/makeLetterSpacing/makeLetterSpacing.js +4 -0
- package/build/lib/native/utils/makeLetterSpacing/makeLetterSpacing.js.map +1 -0
- package/build/lib/native/utils/objectKeysWithType.js +4 -0
- package/build/lib/native/utils/objectKeysWithType.js.map +1 -0
- package/build/lib/native/utils/useInteraction.js +1 -1
- package/build/lib/native/utils/useInteraction.js.map +1 -1
- package/build/lib/web/development/components/Accordion/AccordionButton.web.js +8 -6
- package/build/lib/web/development/components/Accordion/AccordionButton.web.js.map +1 -1
- package/build/lib/web/development/components/Accordion/AccordionItem.js +1 -1
- package/build/lib/web/development/components/Accordion/AccordionItem.js.map +1 -1
- package/build/lib/web/development/components/Accordion/StyledAccordionButton.web.js +10 -11
- package/build/lib/web/development/components/Accordion/StyledAccordionButton.web.js.map +1 -1
- package/build/lib/web/development/components/Accordion/commonStyles.js +3 -6
- package/build/lib/web/development/components/Accordion/commonStyles.js.map +1 -1
- package/build/lib/web/development/components/ActionList/ActionList.js +21 -48
- package/build/lib/web/development/components/ActionList/ActionList.js.map +1 -1
- package/build/lib/web/development/components/ActionList/ActionListItem.js +6 -12
- package/build/lib/web/development/components/ActionList/ActionListItem.js.map +1 -1
- package/build/lib/web/development/components/ActionList/ActionListNoResults.js +3 -3
- package/build/lib/web/development/components/ActionList/ActionListNoResults.js.map +1 -1
- package/build/lib/web/development/components/ActionList/actionListUtils.js +3 -3
- package/build/lib/web/development/components/ActionList/actionListUtils.js.map +1 -1
- package/build/lib/web/development/components/ActionList/index.js +1 -1
- package/build/lib/web/development/components/ActionList/styles/StyledActionListItem.web.js +6 -3
- package/build/lib/web/development/components/ActionList/styles/StyledActionListItem.web.js.map +1 -1
- package/build/lib/web/development/components/Alert/Alert.js +36 -52
- package/build/lib/web/development/components/Alert/Alert.js.map +1 -1
- package/build/lib/web/development/components/Alert/styles.js +3 -7
- package/build/lib/web/development/components/Alert/styles.js.map +1 -1
- package/build/lib/web/development/components/Amount/Amount.js +141 -76
- package/build/lib/web/development/components/Amount/Amount.js.map +1 -1
- package/build/lib/web/development/components/Amount/amountTokens.js +67 -34
- package/build/lib/web/development/components/Amount/amountTokens.js.map +1 -1
- package/build/lib/web/development/components/Badge/Badge.js +26 -35
- package/build/lib/web/development/components/Badge/Badge.js.map +1 -1
- package/build/lib/web/development/components/Badge/badgeTokens.js +7 -5
- package/build/lib/web/development/components/Badge/badgeTokens.js.map +1 -1
- package/build/lib/web/development/components/BaseHeaderFooter/BaseHeader.js +7 -7
- package/build/lib/web/development/components/BaseHeaderFooter/BaseHeader.js.map +1 -1
- package/build/lib/web/development/components/BottomSheet/BottomSheet.web.js +3 -3
- package/build/lib/web/development/components/BottomSheet/BottomSheet.web.js.map +1 -1
- package/build/lib/web/development/components/BottomSheet/BottomSheetBackdrop.web.js +1 -5
- package/build/lib/web/development/components/BottomSheet/BottomSheetBackdrop.web.js.map +1 -1
- package/build/lib/web/development/components/BottomSheet/BottomSheetCommon.js +1 -5
- package/build/lib/web/development/components/BottomSheet/BottomSheetCommon.js.map +1 -1
- package/build/lib/web/development/components/BottomSheet/BottomSheetFooter.web.js +1 -5
- package/build/lib/web/development/components/BottomSheet/BottomSheetFooter.web.js.map +1 -1
- package/build/lib/web/development/components/BottomSheet/getBottomSheetGrabHandleStyles.js +1 -1
- package/build/lib/web/development/components/BottomSheet/getBottomSheetGrabHandleStyles.js.map +1 -1
- package/build/lib/web/development/components/Box/BaseBox/baseBoxStyles.js +15 -4
- package/build/lib/web/development/components/Box/BaseBox/baseBoxStyles.js.map +1 -1
- package/build/lib/web/development/components/Box/BaseBox/getResponsiveValue.web.js.map +1 -1
- package/build/lib/web/development/components/Box/BaseBox/types/propsTypes.js.map +1 -1
- package/build/lib/web/development/components/Button/BaseButton/BaseButton.js +103 -91
- package/build/lib/web/development/components/Button/BaseButton/BaseButton.js.map +1 -1
- package/build/lib/web/development/components/Button/BaseButton/StyledBaseButton.web.js +4 -4
- package/build/lib/web/development/components/Button/BaseButton/StyledBaseButton.web.js.map +1 -1
- package/build/lib/web/development/components/Button/BaseButton/buttonTokens.js +113 -6
- package/build/lib/web/development/components/Button/BaseButton/buttonTokens.js.map +1 -1
- package/build/lib/web/development/components/Button/BaseButton/getStyledBaseButtonStyles.js +2 -1
- package/build/lib/web/development/components/Button/BaseButton/getStyledBaseButtonStyles.js.map +1 -1
- package/build/lib/web/development/components/Button/Button/Button.js +1 -1
- package/build/lib/web/development/components/Button/Button/Button.js.map +1 -1
- package/build/lib/web/development/components/Button/IconButton/IconButton.js +3 -3
- package/build/lib/web/development/components/Button/IconButton/IconButton.js.map +1 -1
- package/build/lib/web/development/components/Button/IconButton/StyledIconButton.web.js +15 -14
- package/build/lib/web/development/components/Button/IconButton/StyledIconButton.web.js.map +1 -1
- package/build/lib/web/development/components/Card/Card.js +8 -5
- package/build/lib/web/development/components/Card/Card.js.map +1 -1
- package/build/lib/web/development/components/Card/CardFooter.js +13 -9
- package/build/lib/web/development/components/Card/CardFooter.js.map +1 -1
- package/build/lib/web/development/components/Card/CardHeader.js +28 -15
- package/build/lib/web/development/components/Card/CardHeader.js.map +1 -1
- package/build/lib/web/development/components/Card/CardRoot.web.js +2 -2
- package/build/lib/web/development/components/Card/CardRoot.web.js.map +1 -1
- package/build/lib/web/development/components/Card/CardSurface.web.js +2 -5
- package/build/lib/web/development/components/Card/CardSurface.web.js.map +1 -1
- package/build/lib/web/development/components/Card/index.js +1 -1
- package/build/lib/web/development/components/Carousel/Carousel.web.js.map +1 -1
- package/build/lib/web/development/components/Carousel/Indicators/getIndicatorButtonStyles.js +9 -9
- package/build/lib/web/development/components/Carousel/Indicators/getIndicatorButtonStyles.js.map +1 -1
- package/build/lib/web/development/components/Carousel/NavigationButton/NavigationButton.js +2 -2
- package/build/lib/web/development/components/Carousel/NavigationButton/NavigationButton.js.map +1 -1
- package/build/lib/web/development/components/Carousel/NavigationButton/getNavigationButtonStyles.js +23 -30
- package/build/lib/web/development/components/Carousel/NavigationButton/getNavigationButtonStyles.js.map +1 -1
- package/build/lib/web/development/components/Checkbox/CheckboxIcon/CheckboxIcon.js +1 -3
- package/build/lib/web/development/components/Checkbox/CheckboxIcon/CheckboxIcon.js.map +1 -1
- package/build/lib/web/development/components/Checkbox/CheckboxIcon/CheckboxIconWrapperStyles.js +2 -2
- package/build/lib/web/development/components/Checkbox/CheckboxIcon/CheckboxIconWrapperStyles.js.map +1 -1
- package/build/lib/web/development/components/Checkbox/checkboxTokens.js +17 -16
- package/build/lib/web/development/components/Checkbox/checkboxTokens.js.map +1 -1
- package/build/lib/web/development/components/Chip/AnimatedChip.web.js +2 -2
- package/build/lib/web/development/components/Chip/AnimatedChip.web.js.map +1 -1
- package/build/lib/web/development/components/Chip/Chip.js +6 -11
- package/build/lib/web/development/components/Chip/Chip.js.map +1 -1
- package/build/lib/web/development/components/Chip/ChipGroup.js +3 -5
- package/build/lib/web/development/components/Chip/ChipGroup.js.map +1 -1
- package/build/lib/web/development/components/Chip/StyledChipWrapper.web.js +2 -2
- package/build/lib/web/development/components/Chip/StyledChipWrapper.web.js.map +1 -1
- package/build/lib/web/development/components/Chip/chipTokens.js +38 -38
- package/build/lib/web/development/components/Chip/chipTokens.js.map +1 -1
- package/build/lib/web/development/components/Chip/getAnimatedChipStyles.js +1 -1
- package/build/lib/web/development/components/Chip/getAnimatedChipStyles.js.map +1 -1
- package/build/lib/web/development/components/Chip/useChipGroup.js +1 -3
- package/build/lib/web/development/components/Chip/useChipGroup.js.map +1 -1
- package/build/lib/web/development/components/Counter/Counter.js +25 -44
- package/build/lib/web/development/components/Counter/Counter.js.map +1 -1
- package/build/lib/web/development/components/Counter/counterTokens.js +5 -5
- package/build/lib/web/development/components/Counter/counterTokens.js.map +1 -1
- package/build/lib/web/development/components/Divider/Divider.js +6 -8
- package/build/lib/web/development/components/Divider/Divider.js.map +1 -1
- package/build/lib/web/development/components/Dropdown/Dropdown.js +1 -5
- package/build/lib/web/development/components/Dropdown/Dropdown.js.map +1 -1
- package/build/lib/web/development/components/Dropdown/StyledDropdownOverlay.js +2 -2
- package/build/lib/web/development/components/Dropdown/StyledDropdownOverlay.js.map +1 -1
- package/build/lib/web/development/components/Form/CharacterCounter/CharacterCounter.js +1 -1
- package/build/lib/web/development/components/Form/CharacterCounter/CharacterCounter.js.map +1 -1
- package/build/lib/web/development/components/Form/FormHint.js +11 -13
- package/build/lib/web/development/components/Form/FormHint.js.map +1 -1
- package/build/lib/web/development/components/Form/FormLabel.js +9 -17
- package/build/lib/web/development/components/Form/FormLabel.js.map +1 -1
- package/build/lib/web/development/components/Form/Selector/SelectorInput.web.js +5 -5
- package/build/lib/web/development/components/Form/Selector/SelectorInput.web.js.map +1 -1
- package/build/lib/web/development/components/Form/Selector/SelectorSupportText.js +16 -11
- package/build/lib/web/development/components/Form/Selector/SelectorSupportText.js.map +1 -1
- package/build/lib/web/development/components/Form/Selector/SelectorTitle.js +5 -16
- package/build/lib/web/development/components/Form/Selector/SelectorTitle.js.map +1 -1
- package/build/lib/web/development/components/Icons/_Svg/Circle/Circle.web.js +4 -2
- package/build/lib/web/development/components/Icons/_Svg/Circle/Circle.web.js.map +1 -1
- package/build/lib/web/development/components/Icons/_Svg/Rect/Rect.web.js +4 -2
- package/build/lib/web/development/components/Icons/_Svg/Rect/Rect.web.js.map +1 -1
- package/build/lib/web/development/components/Icons/_Svg/Svg/Svg.web.js +4 -2
- package/build/lib/web/development/components/Icons/_Svg/Svg/Svg.web.js.map +1 -1
- package/build/lib/web/development/components/Icons/useIconProps/useIconProps.js +1 -1
- package/build/lib/web/development/components/Icons/useIconProps/useIconProps.js.map +1 -1
- package/build/lib/web/development/components/Indicator/Indicator.js +9 -16
- package/build/lib/web/development/components/Indicator/Indicator.js.map +1 -1
- package/build/lib/web/development/components/Input/BaseInput/AnimatedBaseInputWrapper.web.js +3 -3
- package/build/lib/web/development/components/Input/BaseInput/AnimatedBaseInputWrapper.web.js.map +1 -1
- package/build/lib/web/development/components/Input/BaseInput/BaseInputAnimatedBorder.web.js +2 -2
- package/build/lib/web/development/components/Input/BaseInput/BaseInputAnimatedBorder.web.js.map +1 -1
- package/build/lib/web/development/components/Input/BaseInput/BaseInputTagSlot.web.js +4 -1
- package/build/lib/web/development/components/Input/BaseInput/BaseInputTagSlot.web.js.map +1 -1
- package/build/lib/web/development/components/Input/BaseInput/BaseInputVisuals.js +4 -6
- package/build/lib/web/development/components/Input/BaseInput/BaseInputVisuals.js.map +1 -1
- package/build/lib/web/development/components/Input/BaseInput/BaseInputWrapper.js.map +1 -1
- package/build/lib/web/development/components/Input/BaseInput/StyledBaseInput.web.js +3 -4
- package/build/lib/web/development/components/Input/BaseInput/StyledBaseInput.web.js.map +1 -1
- package/build/lib/web/development/components/Input/BaseInput/baseInputStyles.js +11 -12
- package/build/lib/web/development/components/Input/BaseInput/baseInputStyles.js.map +1 -1
- package/build/lib/web/development/components/Input/DropdownInputTriggers/Chevron.js +1 -1
- package/build/lib/web/development/components/Input/DropdownInputTriggers/Chevron.js.map +1 -1
- package/build/lib/web/development/components/Link/BaseLink/BaseLink.js +20 -32
- package/build/lib/web/development/components/Link/BaseLink/BaseLink.js.map +1 -1
- package/build/lib/web/development/components/Link/Link/Link.js +1 -1
- package/build/lib/web/development/components/Link/Link/Link.js.map +1 -1
- package/build/lib/web/development/components/List/List.js +1 -3
- package/build/lib/web/development/components/List/List.js.map +1 -1
- package/build/lib/web/development/components/List/ListItem.js +3 -3
- package/build/lib/web/development/components/List/ListItem.js.map +1 -1
- package/build/lib/web/development/components/List/ListItemIcons.js +11 -7
- package/build/lib/web/development/components/List/ListItemIcons.js.map +1 -1
- package/build/lib/web/development/components/Modal/Modal.web.js +1 -1
- package/build/lib/web/development/components/Modal/Modal.web.js.map +1 -1
- package/build/lib/web/development/components/Modal/ModalBackdrop.js +1 -1
- package/build/lib/web/development/components/Modal/ModalBackdrop.js.map +1 -1
- package/build/lib/web/development/components/Modal/ModalHeader.web.js +1 -5
- package/build/lib/web/development/components/Modal/ModalHeader.web.js.map +1 -1
- package/build/lib/web/development/components/Popover/Popover.web.js +2 -2
- package/build/lib/web/development/components/Popover/Popover.web.js.map +1 -1
- package/build/lib/web/development/components/Popover/PopoverContent.js +4 -5
- package/build/lib/web/development/components/Popover/PopoverContent.js.map +1 -1
- package/build/lib/web/development/components/Popover/PopoverInteractiveWrapper.web.js +5 -5
- package/build/lib/web/development/components/Popover/PopoverInteractiveWrapper.web.js.map +1 -1
- package/build/lib/web/development/components/Popover/getPopoverContentWrapperStyles.js +2 -2
- package/build/lib/web/development/components/Popover/getPopoverContentWrapperStyles.js.map +1 -1
- package/build/lib/web/development/components/ProgressBar/ProgressBar.js +9 -13
- package/build/lib/web/development/components/ProgressBar/ProgressBar.js.map +1 -1
- package/build/lib/web/development/components/Radio/Radio.js +1 -0
- package/build/lib/web/development/components/Radio/Radio.js.map +1 -1
- package/build/lib/web/development/components/Radio/RadioIcon/RadioIcon.js +2 -1
- package/build/lib/web/development/components/Radio/RadioIcon/RadioIcon.js.map +1 -1
- package/build/lib/web/development/components/Radio/RadioIcon/RadioIconWrapperStyles.js +2 -2
- package/build/lib/web/development/components/Radio/RadioIcon/RadioIconWrapperStyles.js.map +1 -1
- package/build/lib/web/development/components/Radio/radioTokens.js +23 -22
- package/build/lib/web/development/components/Radio/radioTokens.js.map +1 -1
- package/build/lib/web/development/components/Skeleton/PulseAnimation.web.js +4 -7
- package/build/lib/web/development/components/Skeleton/PulseAnimation.web.js.map +1 -1
- package/build/lib/web/development/components/Skeleton/Skeleton.js +3 -6
- package/build/lib/web/development/components/Skeleton/Skeleton.js.map +1 -1
- package/build/lib/web/development/components/Spinner/BaseSpinner/BaseSpinner.js +9 -14
- package/build/lib/web/development/components/Spinner/BaseSpinner/BaseSpinner.js.map +1 -1
- package/build/lib/web/development/components/Spinner/Spinner/Spinner.js +2 -5
- package/build/lib/web/development/components/Spinner/Spinner/Spinner.js.map +1 -1
- package/build/lib/web/development/components/SpotlightPopoverTour/TourFooter.web.js +1 -1
- package/build/lib/web/development/components/SpotlightPopoverTour/TourFooter.web.js.map +1 -1
- package/build/lib/web/development/components/SpotlightPopoverTour/TourMask.web.js +2 -2
- package/build/lib/web/development/components/SpotlightPopoverTour/TourMask.web.js.map +1 -1
- package/build/lib/web/development/components/SpotlightPopoverTour/TourPopover.web.js +2 -2
- package/build/lib/web/development/components/SpotlightPopoverTour/TourPopover.web.js.map +1 -1
- package/build/lib/web/development/components/Switch/switchTokens.js +10 -10
- package/build/lib/web/development/components/Switch/switchTokens.js.map +1 -1
- package/build/lib/web/development/components/Table/Table.web.js +17 -9
- package/build/lib/web/development/components/Table/Table.web.js.map +1 -1
- package/build/lib/web/development/components/Table/TableBody.web.js +14 -12
- package/build/lib/web/development/components/Table/TableBody.web.js.map +1 -1
- package/build/lib/web/development/components/Table/TableContext.js +4 -2
- package/build/lib/web/development/components/Table/TableContext.js.map +1 -1
- package/build/lib/web/development/components/Table/TableFooter.web.js +7 -7
- package/build/lib/web/development/components/Table/TableFooter.web.js.map +1 -1
- package/build/lib/web/development/components/Table/TableHeader.web.js +18 -16
- package/build/lib/web/development/components/Table/TableHeader.web.js.map +1 -1
- package/build/lib/web/development/components/Table/TablePagination.web.js +24 -8
- package/build/lib/web/development/components/Table/TablePagination.web.js.map +1 -1
- package/build/lib/web/development/components/Table/TableToolbar.web.js +4 -3
- package/build/lib/web/development/components/Table/TableToolbar.web.js.map +1 -1
- package/build/lib/web/development/components/Table/tokens.js +41 -43
- package/build/lib/web/development/components/Table/tokens.js.map +1 -1
- package/build/lib/web/development/components/Tabs/TabIndicator.web.js +7 -6
- package/build/lib/web/development/components/Tabs/TabIndicator.web.js.map +1 -1
- package/build/lib/web/development/components/Tabs/TabItem.web.js +17 -14
- package/build/lib/web/development/components/Tabs/TabItem.web.js.map +1 -1
- package/build/lib/web/development/components/Tabs/TabList.web.js +7 -5
- package/build/lib/web/development/components/Tabs/TabList.web.js.map +1 -1
- package/build/lib/web/development/components/Tabs/tabTokens.js +38 -41
- package/build/lib/web/development/components/Tabs/tabTokens.js.map +1 -1
- package/build/lib/web/development/components/Tag/Tag.js +7 -5
- package/build/lib/web/development/components/Tag/Tag.js.map +1 -1
- package/build/lib/web/development/components/Tooltip/Tooltip.web.js +6 -13
- package/build/lib/web/development/components/Tooltip/Tooltip.web.js.map +1 -1
- package/build/lib/web/development/components/Tooltip/TooltipContent.js +3 -4
- package/build/lib/web/development/components/Tooltip/TooltipContent.js.map +1 -1
- package/build/lib/web/development/components/Tooltip/getTooltipContentWrapperStyles.js +2 -2
- package/build/lib/web/development/components/Tooltip/getTooltipContentWrapperStyles.js.map +1 -1
- package/build/lib/web/development/components/Typography/BaseText/BaseText.web.js +10 -2
- package/build/lib/web/development/components/Typography/BaseText/BaseText.web.js.map +1 -1
- package/build/lib/web/development/components/Typography/BaseText/getBaseTextStyles.js +10 -2
- package/build/lib/web/development/components/Typography/BaseText/getBaseTextStyles.js.map +1 -1
- package/build/lib/web/development/components/Typography/Code/Code.js +3 -3
- package/build/lib/web/development/components/Typography/Code/Code.js.map +1 -1
- package/build/lib/web/development/components/Typography/Display/Display.js +23 -25
- package/build/lib/web/development/components/Typography/Display/Display.js.map +1 -1
- package/build/lib/web/development/components/Typography/Heading/Heading.js +30 -61
- package/build/lib/web/development/components/Typography/Heading/Heading.js.map +1 -1
- package/build/lib/web/development/components/Typography/Text/Text.js +26 -24
- package/build/lib/web/development/components/Typography/Text/Text.js.map +1 -1
- package/build/lib/web/development/components/Typography/Text/getTextStyles.js +3 -5
- package/build/lib/web/development/components/Typography/Text/getTextStyles.js.map +1 -1
- package/build/lib/web/development/components/Typography/index.js +0 -1
- package/build/lib/web/development/components/Typography/index.js.map +1 -1
- package/build/lib/web/development/components/index.js +56 -57
- package/build/lib/web/development/components/index.js.map +1 -1
- package/build/lib/web/development/tokens/global/border.js +3 -0
- package/build/lib/web/development/tokens/global/border.js.map +1 -1
- package/build/lib/web/development/tokens/global/colors.js +227 -250
- package/build/lib/web/development/tokens/global/colors.js.map +1 -1
- package/build/lib/web/development/tokens/global/elevation/elevation.web.js +6 -6
- package/build/lib/web/development/tokens/global/elevation/elevation.web.js.map +1 -1
- package/build/lib/web/development/tokens/global/fontFamily/fontFamily.web.js +3 -2
- package/build/lib/web/development/tokens/global/fontFamily/fontFamily.web.js.map +1 -1
- package/build/lib/web/development/tokens/global/motion.js.map +1 -1
- package/build/lib/web/development/tokens/global/opacity.js +12 -9
- package/build/lib/web/development/tokens/global/opacity.js.map +1 -1
- package/build/lib/web/development/tokens/global/typography.js +37 -40
- package/build/lib/web/development/tokens/global/typography.js.map +1 -1
- package/build/lib/web/development/tokens/index.js +1 -2
- package/build/lib/web/development/tokens/index.js.map +1 -1
- package/build/lib/web/development/tokens/theme/bladeTheme.js +925 -0
- package/build/lib/web/development/tokens/theme/bladeTheme.js.map +1 -0
- package/build/lib/web/development/tokens/theme/createTheme.js +123 -177
- package/build/lib/web/development/tokens/theme/createTheme.js.map +1 -1
- package/build/lib/web/development/tokens/theme/index.js +1 -2
- package/build/lib/web/development/tokens/theme/index.js.map +1 -1
- package/build/lib/web/development/tokens/theme/overrideTheme.js +4 -4
- package/build/lib/web/development/tokens/theme/overrideTheme.js.map +1 -1
- package/build/lib/web/development/tokens/theme/theme.js +1 -7
- package/build/lib/web/development/tokens/theme/theme.js.map +1 -1
- package/build/lib/web/development/utils/getFocusRingStyles/getFocusRingStyles.web.js +26 -0
- package/build/lib/web/development/utils/getFocusRingStyles/getFocusRingStyles.web.js.map +1 -0
- package/build/lib/web/development/utils/getFocusRingStyles/index.js +2 -0
- package/build/lib/web/development/utils/lodashButBetter/get.js +8 -0
- package/build/lib/web/development/utils/lodashButBetter/get.js.map +1 -1
- package/build/lib/web/development/utils/lodashButBetter/isEmpty.js.map +1 -1
- package/build/lib/web/development/utils/makeLetterSpacing/index.js +2 -0
- package/build/lib/web/development/utils/makeLetterSpacing/makeLetterSpacing.js +7 -0
- package/build/lib/web/development/utils/makeLetterSpacing/makeLetterSpacing.js.map +1 -0
- package/build/lib/web/development/utils/objectKeysWithType.js +7 -0
- package/build/lib/web/development/utils/objectKeysWithType.js.map +1 -0
- package/build/lib/web/development/utils/useInteraction.js +3 -3
- package/build/lib/web/development/utils/useInteraction.js.map +1 -1
- package/build/lib/web/production/components/Accordion/AccordionButton.web.js +8 -6
- package/build/lib/web/production/components/Accordion/AccordionButton.web.js.map +1 -1
- package/build/lib/web/production/components/Accordion/AccordionItem.js +1 -1
- package/build/lib/web/production/components/Accordion/AccordionItem.js.map +1 -1
- package/build/lib/web/production/components/Accordion/StyledAccordionButton.web.js +10 -11
- package/build/lib/web/production/components/Accordion/StyledAccordionButton.web.js.map +1 -1
- package/build/lib/web/production/components/Accordion/commonStyles.js +3 -6
- package/build/lib/web/production/components/Accordion/commonStyles.js.map +1 -1
- package/build/lib/web/production/components/ActionList/ActionList.js +21 -48
- package/build/lib/web/production/components/ActionList/ActionList.js.map +1 -1
- package/build/lib/web/production/components/ActionList/ActionListItem.js +6 -12
- package/build/lib/web/production/components/ActionList/ActionListItem.js.map +1 -1
- package/build/lib/web/production/components/ActionList/ActionListNoResults.js +3 -3
- package/build/lib/web/production/components/ActionList/ActionListNoResults.js.map +1 -1
- package/build/lib/web/production/components/ActionList/actionListUtils.js +3 -3
- package/build/lib/web/production/components/ActionList/actionListUtils.js.map +1 -1
- package/build/lib/web/production/components/ActionList/index.js +1 -1
- package/build/lib/web/production/components/ActionList/styles/StyledActionListItem.web.js +6 -3
- package/build/lib/web/production/components/ActionList/styles/StyledActionListItem.web.js.map +1 -1
- package/build/lib/web/production/components/Alert/Alert.js +36 -52
- package/build/lib/web/production/components/Alert/Alert.js.map +1 -1
- package/build/lib/web/production/components/Alert/styles.js +3 -7
- package/build/lib/web/production/components/Alert/styles.js.map +1 -1
- package/build/lib/web/production/components/Amount/Amount.js +141 -76
- package/build/lib/web/production/components/Amount/Amount.js.map +1 -1
- package/build/lib/web/production/components/Amount/amountTokens.js +67 -34
- package/build/lib/web/production/components/Amount/amountTokens.js.map +1 -1
- package/build/lib/web/production/components/Badge/Badge.js +26 -35
- package/build/lib/web/production/components/Badge/Badge.js.map +1 -1
- package/build/lib/web/production/components/Badge/badgeTokens.js +7 -5
- package/build/lib/web/production/components/Badge/badgeTokens.js.map +1 -1
- package/build/lib/web/production/components/BaseHeaderFooter/BaseHeader.js +7 -7
- package/build/lib/web/production/components/BaseHeaderFooter/BaseHeader.js.map +1 -1
- package/build/lib/web/production/components/BottomSheet/BottomSheet.web.js +3 -3
- package/build/lib/web/production/components/BottomSheet/BottomSheet.web.js.map +1 -1
- package/build/lib/web/production/components/BottomSheet/BottomSheetBackdrop.web.js +1 -5
- package/build/lib/web/production/components/BottomSheet/BottomSheetBackdrop.web.js.map +1 -1
- package/build/lib/web/production/components/BottomSheet/BottomSheetCommon.js +1 -5
- package/build/lib/web/production/components/BottomSheet/BottomSheetCommon.js.map +1 -1
- package/build/lib/web/production/components/BottomSheet/BottomSheetFooter.web.js +1 -5
- package/build/lib/web/production/components/BottomSheet/BottomSheetFooter.web.js.map +1 -1
- package/build/lib/web/production/components/BottomSheet/getBottomSheetGrabHandleStyles.js +1 -1
- package/build/lib/web/production/components/BottomSheet/getBottomSheetGrabHandleStyles.js.map +1 -1
- package/build/lib/web/production/components/Box/BaseBox/baseBoxStyles.js +15 -4
- package/build/lib/web/production/components/Box/BaseBox/baseBoxStyles.js.map +1 -1
- package/build/lib/web/production/components/Box/BaseBox/getResponsiveValue.web.js.map +1 -1
- package/build/lib/web/production/components/Box/BaseBox/types/propsTypes.js.map +1 -1
- package/build/lib/web/production/components/Button/BaseButton/BaseButton.js +103 -91
- package/build/lib/web/production/components/Button/BaseButton/BaseButton.js.map +1 -1
- package/build/lib/web/production/components/Button/BaseButton/StyledBaseButton.web.js +4 -4
- package/build/lib/web/production/components/Button/BaseButton/StyledBaseButton.web.js.map +1 -1
- package/build/lib/web/production/components/Button/BaseButton/buttonTokens.js +113 -6
- package/build/lib/web/production/components/Button/BaseButton/buttonTokens.js.map +1 -1
- package/build/lib/web/production/components/Button/BaseButton/getStyledBaseButtonStyles.js +2 -1
- package/build/lib/web/production/components/Button/BaseButton/getStyledBaseButtonStyles.js.map +1 -1
- package/build/lib/web/production/components/Button/Button/Button.js +1 -1
- package/build/lib/web/production/components/Button/Button/Button.js.map +1 -1
- package/build/lib/web/production/components/Button/IconButton/IconButton.js +3 -3
- package/build/lib/web/production/components/Button/IconButton/IconButton.js.map +1 -1
- package/build/lib/web/production/components/Button/IconButton/StyledIconButton.web.js +15 -14
- package/build/lib/web/production/components/Button/IconButton/StyledIconButton.web.js.map +1 -1
- package/build/lib/web/production/components/Card/Card.js +8 -5
- package/build/lib/web/production/components/Card/Card.js.map +1 -1
- package/build/lib/web/production/components/Card/CardFooter.js +13 -9
- package/build/lib/web/production/components/Card/CardFooter.js.map +1 -1
- package/build/lib/web/production/components/Card/CardHeader.js +28 -15
- package/build/lib/web/production/components/Card/CardHeader.js.map +1 -1
- package/build/lib/web/production/components/Card/CardRoot.web.js +2 -2
- package/build/lib/web/production/components/Card/CardRoot.web.js.map +1 -1
- package/build/lib/web/production/components/Card/CardSurface.web.js +2 -5
- package/build/lib/web/production/components/Card/CardSurface.web.js.map +1 -1
- package/build/lib/web/production/components/Card/index.js +1 -1
- package/build/lib/web/production/components/Carousel/Carousel.web.js.map +1 -1
- package/build/lib/web/production/components/Carousel/Indicators/getIndicatorButtonStyles.js +9 -9
- package/build/lib/web/production/components/Carousel/Indicators/getIndicatorButtonStyles.js.map +1 -1
- package/build/lib/web/production/components/Carousel/NavigationButton/NavigationButton.js +2 -2
- package/build/lib/web/production/components/Carousel/NavigationButton/NavigationButton.js.map +1 -1
- package/build/lib/web/production/components/Carousel/NavigationButton/getNavigationButtonStyles.js +23 -30
- package/build/lib/web/production/components/Carousel/NavigationButton/getNavigationButtonStyles.js.map +1 -1
- package/build/lib/web/production/components/Checkbox/CheckboxIcon/CheckboxIcon.js +1 -3
- package/build/lib/web/production/components/Checkbox/CheckboxIcon/CheckboxIcon.js.map +1 -1
- package/build/lib/web/production/components/Checkbox/CheckboxIcon/CheckboxIconWrapperStyles.js +2 -2
- package/build/lib/web/production/components/Checkbox/CheckboxIcon/CheckboxIconWrapperStyles.js.map +1 -1
- package/build/lib/web/production/components/Checkbox/checkboxTokens.js +17 -16
- package/build/lib/web/production/components/Checkbox/checkboxTokens.js.map +1 -1
- package/build/lib/web/production/components/Chip/AnimatedChip.web.js +2 -2
- package/build/lib/web/production/components/Chip/AnimatedChip.web.js.map +1 -1
- package/build/lib/web/production/components/Chip/Chip.js +6 -11
- package/build/lib/web/production/components/Chip/Chip.js.map +1 -1
- package/build/lib/web/production/components/Chip/ChipGroup.js +3 -5
- package/build/lib/web/production/components/Chip/ChipGroup.js.map +1 -1
- package/build/lib/web/production/components/Chip/StyledChipWrapper.web.js +2 -2
- package/build/lib/web/production/components/Chip/StyledChipWrapper.web.js.map +1 -1
- package/build/lib/web/production/components/Chip/chipTokens.js +38 -38
- package/build/lib/web/production/components/Chip/chipTokens.js.map +1 -1
- package/build/lib/web/production/components/Chip/getAnimatedChipStyles.js +1 -1
- package/build/lib/web/production/components/Chip/getAnimatedChipStyles.js.map +1 -1
- package/build/lib/web/production/components/Chip/useChipGroup.js +1 -3
- package/build/lib/web/production/components/Chip/useChipGroup.js.map +1 -1
- package/build/lib/web/production/components/Counter/Counter.js +25 -44
- package/build/lib/web/production/components/Counter/Counter.js.map +1 -1
- package/build/lib/web/production/components/Counter/counterTokens.js +5 -5
- package/build/lib/web/production/components/Counter/counterTokens.js.map +1 -1
- package/build/lib/web/production/components/Divider/Divider.js +6 -8
- package/build/lib/web/production/components/Divider/Divider.js.map +1 -1
- package/build/lib/web/production/components/Dropdown/Dropdown.js +1 -5
- package/build/lib/web/production/components/Dropdown/Dropdown.js.map +1 -1
- package/build/lib/web/production/components/Dropdown/StyledDropdownOverlay.js +2 -2
- package/build/lib/web/production/components/Dropdown/StyledDropdownOverlay.js.map +1 -1
- package/build/lib/web/production/components/Form/CharacterCounter/CharacterCounter.js +1 -1
- package/build/lib/web/production/components/Form/CharacterCounter/CharacterCounter.js.map +1 -1
- package/build/lib/web/production/components/Form/FormHint.js +11 -13
- package/build/lib/web/production/components/Form/FormHint.js.map +1 -1
- package/build/lib/web/production/components/Form/FormLabel.js +9 -17
- package/build/lib/web/production/components/Form/FormLabel.js.map +1 -1
- package/build/lib/web/production/components/Form/Selector/SelectorInput.web.js +5 -5
- package/build/lib/web/production/components/Form/Selector/SelectorInput.web.js.map +1 -1
- package/build/lib/web/production/components/Form/Selector/SelectorSupportText.js +16 -11
- package/build/lib/web/production/components/Form/Selector/SelectorSupportText.js.map +1 -1
- package/build/lib/web/production/components/Form/Selector/SelectorTitle.js +5 -16
- package/build/lib/web/production/components/Form/Selector/SelectorTitle.js.map +1 -1
- package/build/lib/web/production/components/Icons/_Svg/Circle/Circle.web.js +4 -2
- package/build/lib/web/production/components/Icons/_Svg/Circle/Circle.web.js.map +1 -1
- package/build/lib/web/production/components/Icons/_Svg/Rect/Rect.web.js +4 -2
- package/build/lib/web/production/components/Icons/_Svg/Rect/Rect.web.js.map +1 -1
- package/build/lib/web/production/components/Icons/_Svg/Svg/Svg.web.js +4 -2
- package/build/lib/web/production/components/Icons/_Svg/Svg/Svg.web.js.map +1 -1
- package/build/lib/web/production/components/Icons/useIconProps/useIconProps.js +1 -1
- package/build/lib/web/production/components/Icons/useIconProps/useIconProps.js.map +1 -1
- package/build/lib/web/production/components/Indicator/Indicator.js +9 -16
- package/build/lib/web/production/components/Indicator/Indicator.js.map +1 -1
- package/build/lib/web/production/components/Input/BaseInput/AnimatedBaseInputWrapper.web.js +3 -3
- package/build/lib/web/production/components/Input/BaseInput/AnimatedBaseInputWrapper.web.js.map +1 -1
- package/build/lib/web/production/components/Input/BaseInput/BaseInputAnimatedBorder.web.js +2 -2
- package/build/lib/web/production/components/Input/BaseInput/BaseInputAnimatedBorder.web.js.map +1 -1
- package/build/lib/web/production/components/Input/BaseInput/BaseInputTagSlot.web.js +4 -1
- package/build/lib/web/production/components/Input/BaseInput/BaseInputTagSlot.web.js.map +1 -1
- package/build/lib/web/production/components/Input/BaseInput/BaseInputVisuals.js +4 -6
- package/build/lib/web/production/components/Input/BaseInput/BaseInputVisuals.js.map +1 -1
- package/build/lib/web/production/components/Input/BaseInput/BaseInputWrapper.js.map +1 -1
- package/build/lib/web/production/components/Input/BaseInput/StyledBaseInput.web.js +3 -4
- package/build/lib/web/production/components/Input/BaseInput/StyledBaseInput.web.js.map +1 -1
- package/build/lib/web/production/components/Input/BaseInput/baseInputStyles.js +11 -12
- package/build/lib/web/production/components/Input/BaseInput/baseInputStyles.js.map +1 -1
- package/build/lib/web/production/components/Input/DropdownInputTriggers/Chevron.js +1 -1
- package/build/lib/web/production/components/Input/DropdownInputTriggers/Chevron.js.map +1 -1
- package/build/lib/web/production/components/Link/BaseLink/BaseLink.js +20 -32
- package/build/lib/web/production/components/Link/BaseLink/BaseLink.js.map +1 -1
- package/build/lib/web/production/components/Link/Link/Link.js +1 -1
- package/build/lib/web/production/components/Link/Link/Link.js.map +1 -1
- package/build/lib/web/production/components/List/List.js +1 -3
- package/build/lib/web/production/components/List/List.js.map +1 -1
- package/build/lib/web/production/components/List/ListItem.js +3 -3
- package/build/lib/web/production/components/List/ListItem.js.map +1 -1
- package/build/lib/web/production/components/List/ListItemIcons.js +11 -7
- package/build/lib/web/production/components/List/ListItemIcons.js.map +1 -1
- package/build/lib/web/production/components/Modal/Modal.web.js +1 -1
- package/build/lib/web/production/components/Modal/Modal.web.js.map +1 -1
- package/build/lib/web/production/components/Modal/ModalBackdrop.js +1 -1
- package/build/lib/web/production/components/Modal/ModalBackdrop.js.map +1 -1
- package/build/lib/web/production/components/Modal/ModalHeader.web.js +1 -5
- package/build/lib/web/production/components/Modal/ModalHeader.web.js.map +1 -1
- package/build/lib/web/production/components/Popover/Popover.web.js +2 -2
- package/build/lib/web/production/components/Popover/Popover.web.js.map +1 -1
- package/build/lib/web/production/components/Popover/PopoverContent.js +4 -5
- package/build/lib/web/production/components/Popover/PopoverContent.js.map +1 -1
- package/build/lib/web/production/components/Popover/PopoverInteractiveWrapper.web.js +5 -5
- package/build/lib/web/production/components/Popover/PopoverInteractiveWrapper.web.js.map +1 -1
- package/build/lib/web/production/components/Popover/getPopoverContentWrapperStyles.js +2 -2
- package/build/lib/web/production/components/Popover/getPopoverContentWrapperStyles.js.map +1 -1
- package/build/lib/web/production/components/ProgressBar/ProgressBar.js +9 -13
- package/build/lib/web/production/components/ProgressBar/ProgressBar.js.map +1 -1
- package/build/lib/web/production/components/Radio/Radio.js +1 -0
- package/build/lib/web/production/components/Radio/Radio.js.map +1 -1
- package/build/lib/web/production/components/Radio/RadioIcon/RadioIcon.js +2 -1
- package/build/lib/web/production/components/Radio/RadioIcon/RadioIcon.js.map +1 -1
- package/build/lib/web/production/components/Radio/RadioIcon/RadioIconWrapperStyles.js +2 -2
- package/build/lib/web/production/components/Radio/RadioIcon/RadioIconWrapperStyles.js.map +1 -1
- package/build/lib/web/production/components/Radio/radioTokens.js +23 -22
- package/build/lib/web/production/components/Radio/radioTokens.js.map +1 -1
- package/build/lib/web/production/components/Skeleton/PulseAnimation.web.js +4 -7
- package/build/lib/web/production/components/Skeleton/PulseAnimation.web.js.map +1 -1
- package/build/lib/web/production/components/Skeleton/Skeleton.js +3 -6
- package/build/lib/web/production/components/Skeleton/Skeleton.js.map +1 -1
- package/build/lib/web/production/components/Spinner/BaseSpinner/BaseSpinner.js +9 -14
- package/build/lib/web/production/components/Spinner/BaseSpinner/BaseSpinner.js.map +1 -1
- package/build/lib/web/production/components/Spinner/Spinner/Spinner.js +2 -5
- package/build/lib/web/production/components/Spinner/Spinner/Spinner.js.map +1 -1
- package/build/lib/web/production/components/SpotlightPopoverTour/TourFooter.web.js +1 -1
- package/build/lib/web/production/components/SpotlightPopoverTour/TourFooter.web.js.map +1 -1
- package/build/lib/web/production/components/SpotlightPopoverTour/TourMask.web.js +2 -2
- package/build/lib/web/production/components/SpotlightPopoverTour/TourMask.web.js.map +1 -1
- package/build/lib/web/production/components/SpotlightPopoverTour/TourPopover.web.js +2 -2
- package/build/lib/web/production/components/SpotlightPopoverTour/TourPopover.web.js.map +1 -1
- package/build/lib/web/production/components/Switch/switchTokens.js +10 -10
- package/build/lib/web/production/components/Switch/switchTokens.js.map +1 -1
- package/build/lib/web/production/components/Table/Table.web.js +17 -9
- package/build/lib/web/production/components/Table/Table.web.js.map +1 -1
- package/build/lib/web/production/components/Table/TableBody.web.js +14 -12
- package/build/lib/web/production/components/Table/TableBody.web.js.map +1 -1
- package/build/lib/web/production/components/Table/TableContext.js +4 -2
- package/build/lib/web/production/components/Table/TableContext.js.map +1 -1
- package/build/lib/web/production/components/Table/TableFooter.web.js +7 -7
- package/build/lib/web/production/components/Table/TableFooter.web.js.map +1 -1
- package/build/lib/web/production/components/Table/TableHeader.web.js +18 -16
- package/build/lib/web/production/components/Table/TableHeader.web.js.map +1 -1
- package/build/lib/web/production/components/Table/TablePagination.web.js +24 -8
- package/build/lib/web/production/components/Table/TablePagination.web.js.map +1 -1
- package/build/lib/web/production/components/Table/TableToolbar.web.js +4 -3
- package/build/lib/web/production/components/Table/TableToolbar.web.js.map +1 -1
- package/build/lib/web/production/components/Table/tokens.js +41 -43
- package/build/lib/web/production/components/Table/tokens.js.map +1 -1
- package/build/lib/web/production/components/Tabs/TabIndicator.web.js +7 -6
- package/build/lib/web/production/components/Tabs/TabIndicator.web.js.map +1 -1
- package/build/lib/web/production/components/Tabs/TabItem.web.js +17 -14
- package/build/lib/web/production/components/Tabs/TabItem.web.js.map +1 -1
- package/build/lib/web/production/components/Tabs/TabList.web.js +7 -5
- package/build/lib/web/production/components/Tabs/TabList.web.js.map +1 -1
- package/build/lib/web/production/components/Tabs/tabTokens.js +38 -41
- package/build/lib/web/production/components/Tabs/tabTokens.js.map +1 -1
- package/build/lib/web/production/components/Tag/Tag.js +7 -5
- package/build/lib/web/production/components/Tag/Tag.js.map +1 -1
- package/build/lib/web/production/components/Tooltip/Tooltip.web.js +6 -13
- package/build/lib/web/production/components/Tooltip/Tooltip.web.js.map +1 -1
- package/build/lib/web/production/components/Tooltip/TooltipContent.js +3 -4
- package/build/lib/web/production/components/Tooltip/TooltipContent.js.map +1 -1
- package/build/lib/web/production/components/Tooltip/getTooltipContentWrapperStyles.js +2 -2
- package/build/lib/web/production/components/Tooltip/getTooltipContentWrapperStyles.js.map +1 -1
- package/build/lib/web/production/components/Typography/BaseText/BaseText.web.js +10 -2
- package/build/lib/web/production/components/Typography/BaseText/BaseText.web.js.map +1 -1
- package/build/lib/web/production/components/Typography/BaseText/getBaseTextStyles.js +10 -2
- package/build/lib/web/production/components/Typography/BaseText/getBaseTextStyles.js.map +1 -1
- package/build/lib/web/production/components/Typography/Code/Code.js +3 -3
- package/build/lib/web/production/components/Typography/Code/Code.js.map +1 -1
- package/build/lib/web/production/components/Typography/Display/Display.js +23 -25
- package/build/lib/web/production/components/Typography/Display/Display.js.map +1 -1
- package/build/lib/web/production/components/Typography/Heading/Heading.js +30 -61
- package/build/lib/web/production/components/Typography/Heading/Heading.js.map +1 -1
- package/build/lib/web/production/components/Typography/Text/Text.js +26 -24
- package/build/lib/web/production/components/Typography/Text/Text.js.map +1 -1
- package/build/lib/web/production/components/Typography/Text/getTextStyles.js +3 -5
- package/build/lib/web/production/components/Typography/Text/getTextStyles.js.map +1 -1
- package/build/lib/web/production/components/Typography/index.js +0 -1
- package/build/lib/web/production/components/Typography/index.js.map +1 -1
- package/build/lib/web/production/components/index.js +56 -57
- package/build/lib/web/production/components/index.js.map +1 -1
- package/build/lib/web/production/tokens/global/border.js +3 -0
- package/build/lib/web/production/tokens/global/border.js.map +1 -1
- package/build/lib/web/production/tokens/global/colors.js +227 -250
- package/build/lib/web/production/tokens/global/colors.js.map +1 -1
- package/build/lib/web/production/tokens/global/elevation/elevation.web.js +6 -6
- package/build/lib/web/production/tokens/global/elevation/elevation.web.js.map +1 -1
- package/build/lib/web/production/tokens/global/fontFamily/fontFamily.web.js +3 -2
- package/build/lib/web/production/tokens/global/fontFamily/fontFamily.web.js.map +1 -1
- package/build/lib/web/production/tokens/global/motion.js.map +1 -1
- package/build/lib/web/production/tokens/global/opacity.js +12 -9
- package/build/lib/web/production/tokens/global/opacity.js.map +1 -1
- package/build/lib/web/production/tokens/global/typography.js +37 -40
- package/build/lib/web/production/tokens/global/typography.js.map +1 -1
- package/build/lib/web/production/tokens/index.js +1 -2
- package/build/lib/web/production/tokens/index.js.map +1 -1
- package/build/lib/web/production/tokens/theme/bladeTheme.js +925 -0
- package/build/lib/web/production/tokens/theme/bladeTheme.js.map +1 -0
- package/build/lib/web/production/tokens/theme/createTheme.js +123 -177
- package/build/lib/web/production/tokens/theme/createTheme.js.map +1 -1
- package/build/lib/web/production/tokens/theme/index.js +1 -2
- package/build/lib/web/production/tokens/theme/index.js.map +1 -1
- package/build/lib/web/production/tokens/theme/overrideTheme.js +4 -4
- package/build/lib/web/production/tokens/theme/overrideTheme.js.map +1 -1
- package/build/lib/web/production/tokens/theme/theme.js +1 -7
- package/build/lib/web/production/tokens/theme/theme.js.map +1 -1
- package/build/lib/web/production/utils/getFocusRingStyles/getFocusRingStyles.web.js +26 -0
- package/build/lib/web/production/utils/getFocusRingStyles/getFocusRingStyles.web.js.map +1 -0
- package/build/lib/web/production/utils/getFocusRingStyles/index.js +2 -0
- package/build/lib/web/production/utils/getFocusRingStyles/index.js.map +1 -0
- package/build/lib/web/production/utils/lodashButBetter/get.js +8 -0
- package/build/lib/web/production/utils/lodashButBetter/get.js.map +1 -1
- package/build/lib/web/production/utils/lodashButBetter/isEmpty.js.map +1 -1
- package/build/lib/web/production/utils/makeLetterSpacing/index.js +2 -0
- package/build/lib/web/production/utils/makeLetterSpacing/index.js.map +1 -0
- package/build/lib/web/production/utils/makeLetterSpacing/makeLetterSpacing.js +7 -0
- package/build/lib/web/production/utils/makeLetterSpacing/makeLetterSpacing.js.map +1 -0
- package/build/lib/web/production/utils/objectKeysWithType.js +7 -0
- package/build/lib/web/production/utils/objectKeysWithType.js.map +1 -0
- package/build/lib/web/production/utils/useInteraction.js +3 -3
- package/build/lib/web/production/utils/useInteraction.js.map +1 -1
- package/build/types/components/index.d.ts +6040 -6171
- package/build/types/components/index.native.d.ts +4687 -4818
- package/build/types/tokens/index.d.ts +135 -182
- package/build/types/tokens/index.native.d.ts +135 -182
- package/build/types/utils/index.d.ts +94 -154
- package/build/types/utils/index.native.d.ts +94 -154
- package/codemods/brand-refresh/transformers/__tests__/migrate-actionlist.test.ts +88 -0
- package/codemods/brand-refresh/transformers/__tests__/migrate-amount.test.ts +186 -0
- package/codemods/brand-refresh/transformers/__tests__/migrate-badge.test.ts +32 -0
- package/codemods/brand-refresh/transformers/__tests__/migrate-card.test.ts +180 -0
- package/codemods/brand-refresh/transformers/__tests__/migrate-colors.test.ts +172 -0
- package/codemods/brand-refresh/transformers/__tests__/migrate-contrast-intent-variant.test.ts +206 -0
- package/codemods/brand-refresh/transformers/__tests__/migrate-divider.test.ts +24 -0
- package/codemods/brand-refresh/transformers/__tests__/migrate-dropdown.test.ts +282 -0
- package/codemods/brand-refresh/transformers/__tests__/migrate-table.test.ts +182 -0
- package/codemods/brand-refresh/transformers/__tests__/migrate-typography.test.ts +432 -0
- package/codemods/brand-refresh/transformers/colorTokensMapping.json +624 -0
- package/codemods/brand-refresh/transformers/index.ts +224 -0
- package/codemods/brand-refresh/transformers/migrate-actionlist-and-table.ts +32 -0
- package/codemods/brand-refresh/transformers/migrate-amount.ts +173 -0
- package/codemods/brand-refresh/transformers/migrate-badge.ts +28 -0
- package/codemods/brand-refresh/transformers/migrate-card.ts +43 -0
- package/codemods/brand-refresh/transformers/migrate-contrast-intent-color-props.ts +298 -0
- package/codemods/brand-refresh/transformers/migrate-divider.ts +38 -0
- package/codemods/brand-refresh/transformers/migrate-dropdown.ts +81 -0
- package/codemods/brand-refresh/transformers/migrate-typography.ts +342 -0
- package/codemods/brand-refresh/transformers/utils.ts +7 -0
- package/fonts/blade-fonts-react-native.zip +0 -0
- package/fonts/inter-variable/inter-cyrillic-extra.woff2 +0 -0
- package/fonts/inter-variable/inter-cyrillic.woff2 +0 -0
- package/fonts/inter-variable/inter-greek-extra.woff2 +0 -0
- package/fonts/inter-variable/inter-greek.woff2 +0 -0
- package/fonts/inter-variable/inter-latin-blade-extra.woff2 +0 -0
- package/fonts/inter-variable/inter-latin-blade.woff2 +0 -0
- package/fonts/inter-variable/inter-vietnamese.woff2 +0 -0
- package/fonts/tasa-orbiter.woff2 +0 -0
- package/fonts.css +82 -0
- package/package.json +10 -4
- package/build/css/bankingThemeDarkDesktop.css +0 -751
- package/build/css/bankingThemeDarkMobile.css +0 -751
- package/build/css/bankingThemeLightDesktop.css +0 -751
- package/build/css/bankingThemeLightMobile.css +0 -751
- package/build/css/paymentThemeDarkDesktop.css +0 -751
- package/build/css/paymentThemeDarkMobile.css +0 -751
- package/build/css/paymentThemeLightDesktop.css +0 -751
- package/build/css/paymentThemeLightMobile.css +0 -751
- package/build/lib/native/components/Typography/Title/Title.js +0 -17
- package/build/lib/native/components/Typography/Title/Title.js.map +0 -1
- package/build/lib/native/tokens/theme/bankingTheme.js +0 -12
- package/build/lib/native/tokens/theme/bankingTheme.js.map +0 -1
- package/build/lib/native/tokens/theme/paymentTheme.js +0 -12
- package/build/lib/native/tokens/theme/paymentTheme.js.map +0 -1
- package/build/lib/web/development/components/Typography/Title/Title.js +0 -96
- package/build/lib/web/development/components/Typography/Title/Title.js.map +0 -1
- package/build/lib/web/development/components/Typography/Title/index.js +0 -2
- package/build/lib/web/development/tokens/theme/bankingTheme.js +0 -3086
- package/build/lib/web/development/tokens/theme/bankingTheme.js.map +0 -1
- package/build/lib/web/development/tokens/theme/paymentTheme.js +0 -3086
- package/build/lib/web/development/tokens/theme/paymentTheme.js.map +0 -1
- package/build/lib/web/production/components/Typography/Title/Title.js +0 -96
- package/build/lib/web/production/components/Typography/Title/Title.js.map +0 -1
- package/build/lib/web/production/components/Typography/Title/index.js +0 -2
- package/build/lib/web/production/tokens/theme/bankingTheme.js +0 -3086
- package/build/lib/web/production/tokens/theme/bankingTheme.js.map +0 -1
- package/build/lib/web/production/tokens/theme/paymentTheme.js +0 -3086
- package/build/lib/web/production/tokens/theme/paymentTheme.js.map +0 -1
- /package/build/lib/web/development/{components/Typography/Title → utils/getFocusRingStyles}/index.js.map +0 -0
- /package/build/lib/web/{production/components/Typography/Title → development/utils/makeLetterSpacing}/index.js.map +0 -0
|
@@ -7,7 +7,7 @@ import { isReactNative } from '../../utils/platform/isReactNative.js';
|
|
|
7
7
|
import '../BladeProvider/useTheme.js';
|
|
8
8
|
import { isValidAllowedChildren, getComponentId } from '../../utils/isValidAllowedChildren/isValidAllowedChildren.js';
|
|
9
9
|
|
|
10
|
-
var getActionListSectionPosition=function getActionListSectionPosition(children){var childComponentIdArray=React__default.Children.toArray(children).map(function(child){return getComponentId(child);});var lastActionListSectionIndex=childComponentIdArray.lastIndexOf(componentIds.ActionListSection);var isActionListItemPresentAfterSection=childComponentIdArray.slice(lastActionListSectionIndex).includes(componentIds.ActionListItem);return {isActionListItemPresentAfterSection:isActionListItemPresentAfterSection,lastActionListSectionIndex:lastActionListSectionIndex};};var actionListAllowedChildren=[componentIds.ActionListItem,componentIds.ActionListSection];var getActionListProperties=function getActionListProperties(children){var sectionData=[];var currentSection=null;var actionListOptions=[];var getActionListItemWithId=function getActionListItemWithId(child,hideDivider){if(React__default.isValidElement(child)&&!child.props.isDisabled){actionListOptions.push({title:child.props.title,value:child.props.value,onClickTrigger:function onClickTrigger(value){var _child$props$isSelect;var anchorLink=child.props.href;child.props.onClick==null?void 0:child.props.onClick({name:child.props.value,value:(_child$props$isSelect=child.props.isSelected)!=null?_child$props$isSelect:value});if(anchorLink&&!isReactNative()){var _child$props$target;var target=(_child$props$target=child.props.target)!=null?_child$props$target:'_self';window.open(anchorLink,target);if(window.top){window.top.open(anchorLink,target);}}}});var currentIndex=actionListOptions.length-1;var foundSection=sectionData.find(function(v){return v.title===currentSection;});if(foundSection){foundSection==null?void 0:foundSection.data.push(Object.assign({},child.props,{_index:currentIndex}));}else {sectionData.push({title:currentSection,hideDivider:hideDivider,data:[Object.assign({},child.props,{_index:currentIndex})]});}var clonedChild=React__default.cloneElement(child,{_index:currentIndex});return clonedChild;}return child;};var isActionListItemPresentAfterSection;var lastActionListSectionIndex;if(isReactNative()){var _getActionListSection=getActionListSectionPosition(children);isActionListItemPresentAfterSection=_getActionListSection.isActionListItemPresentAfterSection;lastActionListSectionIndex=_getActionListSection.lastActionListSectionIndex;}var childrenWithId=React__default.Children.map(children,function(child,index){if(React__default.isValidElement(child)){if(isValidAllowedChildren(child,componentIds.ActionListSection)){var shouldHideDivider=index===lastActionListSectionIndex&&!isActionListItemPresentAfterSection;var sectionChildValues=[];return React__default.cloneElement(child,{children:React__default.Children.map(child.props.children,function(childInSection){currentSection=child.props.title;sectionChildValues.push(childInSection.props.value);if(isValidAllowedChildren(childInSection,componentIds.ActionListItem)){return getActionListItemWithId(childInSection,shouldHideDivider);}return childInSection;}),_hideDivider:isReactNative()?shouldHideDivider:undefined,_sectionChildValues:sectionChildValues});}if(isValidAllowedChildren(child,componentIds.ActionListItem)){return getActionListItemWithId(child,true);}if(__DEV__){throwBladeError({message:`Only ${actionListAllowedChildren.join(', ')} supported inside ActionList`,moduleName:'ActionList'});}}return child;});return {sectionData:sectionData,childrenWithId:childrenWithId,actionListOptions:actionListOptions};};var validateActionListItemProps=function validateActionListItemProps(_ref){var leading=_ref.leading,trailing=_ref.trailing,titleSuffix=_ref.titleSuffix;if(__DEV__){React__default.Children.map(trailing,function(child){if(!isValidAllowedChildren(child,componentIds.ActionListItemIcon)&&!isValidAllowedChildren(child,componentIds.ActionListItemText)){throwBladeError({message:`Only ${componentIds.ActionListItemIcon} and ${componentIds.ActionListItemText} are allowed in trailing prop`,moduleName:'ActionListItem'});}});React__default.Children.map(titleSuffix,function(child){if(!isValidAllowedChildren(child,componentIds.ActionListItemBadge)&&!isValidAllowedChildren(child,componentIds.ActionListItemBadgeGroup)){throwBladeError({message:`Only ${componentIds.ActionListItemBadge} and ${componentIds.ActionListItemBadgeGroup} are allowed in titleSuffix prop`,moduleName:'ActionListItem'});}});React__default.Children.map(leading,function(child){if(!isValidAllowedChildren(child,componentIds.ActionListItemIcon)&&!isValidAllowedChildren(child,componentIds.ActionListItemText)&&!isValidAllowedChildren(child,componentIds.ActionListItemAsset)){throwBladeError({message:`Only ${componentIds.ActionListItemIcon}, ${componentIds.ActionListItemAsset}, and ${componentIds.ActionListItemText} are allowed in leading prop`,moduleName:'ActionListItem'});}});}};var getNormalTextColor=function getNormalTextColor(isDisabled){var _ref2=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},isMuted=_ref2.isMuted;if(isDisabled){return '
|
|
10
|
+
var getActionListSectionPosition=function getActionListSectionPosition(children){var childComponentIdArray=React__default.Children.toArray(children).map(function(child){return getComponentId(child);});var lastActionListSectionIndex=childComponentIdArray.lastIndexOf(componentIds.ActionListSection);var isActionListItemPresentAfterSection=childComponentIdArray.slice(lastActionListSectionIndex).includes(componentIds.ActionListItem);return {isActionListItemPresentAfterSection:isActionListItemPresentAfterSection,lastActionListSectionIndex:lastActionListSectionIndex};};var actionListAllowedChildren=[componentIds.ActionListItem,componentIds.ActionListSection];var getActionListProperties=function getActionListProperties(children){var sectionData=[];var currentSection=null;var actionListOptions=[];var getActionListItemWithId=function getActionListItemWithId(child,hideDivider){if(React__default.isValidElement(child)&&!child.props.isDisabled){actionListOptions.push({title:child.props.title,value:child.props.value,onClickTrigger:function onClickTrigger(value){var _child$props$isSelect;var anchorLink=child.props.href;child.props.onClick==null?void 0:child.props.onClick({name:child.props.value,value:(_child$props$isSelect=child.props.isSelected)!=null?_child$props$isSelect:value});if(anchorLink&&!isReactNative()){var _child$props$target;var target=(_child$props$target=child.props.target)!=null?_child$props$target:'_self';window.open(anchorLink,target);if(window.top){window.top.open(anchorLink,target);}}}});var currentIndex=actionListOptions.length-1;var foundSection=sectionData.find(function(v){return v.title===currentSection;});if(foundSection){foundSection==null?void 0:foundSection.data.push(Object.assign({},child.props,{_index:currentIndex}));}else {sectionData.push({title:currentSection,hideDivider:hideDivider,data:[Object.assign({},child.props,{_index:currentIndex})]});}var clonedChild=React__default.cloneElement(child,{_index:currentIndex});return clonedChild;}return child;};var isActionListItemPresentAfterSection;var lastActionListSectionIndex;if(isReactNative()){var _getActionListSection=getActionListSectionPosition(children);isActionListItemPresentAfterSection=_getActionListSection.isActionListItemPresentAfterSection;lastActionListSectionIndex=_getActionListSection.lastActionListSectionIndex;}var childrenWithId=React__default.Children.map(children,function(child,index){if(React__default.isValidElement(child)){if(isValidAllowedChildren(child,componentIds.ActionListSection)){var shouldHideDivider=index===lastActionListSectionIndex&&!isActionListItemPresentAfterSection;var sectionChildValues=[];return React__default.cloneElement(child,{children:React__default.Children.map(child.props.children,function(childInSection){currentSection=child.props.title;sectionChildValues.push(childInSection.props.value);if(isValidAllowedChildren(childInSection,componentIds.ActionListItem)){return getActionListItemWithId(childInSection,shouldHideDivider);}return childInSection;}),_hideDivider:isReactNative()?shouldHideDivider:undefined,_sectionChildValues:sectionChildValues});}if(isValidAllowedChildren(child,componentIds.ActionListItem)){return getActionListItemWithId(child,true);}if(__DEV__){throwBladeError({message:`Only ${actionListAllowedChildren.join(', ')} supported inside ActionList`,moduleName:'ActionList'});}}return child;});return {sectionData:sectionData,childrenWithId:childrenWithId,actionListOptions:actionListOptions};};var validateActionListItemProps=function validateActionListItemProps(_ref){var leading=_ref.leading,trailing=_ref.trailing,titleSuffix=_ref.titleSuffix;if(__DEV__){React__default.Children.map(trailing,function(child){if(!isValidAllowedChildren(child,componentIds.ActionListItemIcon)&&!isValidAllowedChildren(child,componentIds.ActionListItemText)){throwBladeError({message:`Only ${componentIds.ActionListItemIcon} and ${componentIds.ActionListItemText} are allowed in trailing prop`,moduleName:'ActionListItem'});}});React__default.Children.map(titleSuffix,function(child){if(!isValidAllowedChildren(child,componentIds.ActionListItemBadge)&&!isValidAllowedChildren(child,componentIds.ActionListItemBadgeGroup)){throwBladeError({message:`Only ${componentIds.ActionListItemBadge} and ${componentIds.ActionListItemBadgeGroup} are allowed in titleSuffix prop`,moduleName:'ActionListItem'});}});React__default.Children.map(leading,function(child){if(!isValidAllowedChildren(child,componentIds.ActionListItemIcon)&&!isValidAllowedChildren(child,componentIds.ActionListItemText)&&!isValidAllowedChildren(child,componentIds.ActionListItemAsset)){throwBladeError({message:`Only ${componentIds.ActionListItemIcon}, ${componentIds.ActionListItemAsset}, and ${componentIds.ActionListItemText} are allowed in leading prop`,moduleName:'ActionListItem'});}});}};var getNormalTextColor=function getNormalTextColor(isDisabled){var _ref2=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},isMuted=_ref2.isMuted;if(isDisabled){return 'interactive.text.gray.disabled';}if(isMuted){return 'interactive.text.gray.muted';}return 'interactive.text.gray.normal';};
|
|
11
11
|
|
|
12
12
|
export { getActionListProperties, getNormalTextColor, validateActionListItemProps };
|
|
13
13
|
//# sourceMappingURL=actionListUtils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actionListUtils.js","sources":["../../../../../src/components/ActionList/actionListUtils.ts"],"sourcesContent":["import React from 'react';\nimport { componentIds } from './componentIds';\nimport type { ActionListItemProps } from './ActionListItem';\nimport type { OptionsType } from '~components/Dropdown/useDropdown';\nimport { isReactNative } from '~utils';\nimport type { BaseTextProps } from '~components/Typography/BaseText/types';\nimport { getComponentId, isValidAllowedChildren } from '~utils/isValidAllowedChildren';\nimport { throwBladeError } from '~utils/logger';\n\n/**\n * Returns if there is ActionListItem after ActionListSection\n * and an index of last ActionListSection\n *\n * It is used to decide if ActionListSection add divider at the end\n */\nconst getActionListSectionPosition = (\n children: React.ReactNode,\n): {\n isActionListItemPresentAfterSection: boolean;\n lastActionListSectionIndex: number;\n} => {\n // Creating an array of componentIds\n const childComponentIdArray = React.Children.toArray(children).map((child) =>\n getComponentId(child),\n );\n\n // Reading the last `ActionListSection` component's index\n const lastActionListSectionIndex = childComponentIdArray.lastIndexOf(\n componentIds.ActionListSection,\n );\n\n // Checking if there is any `ActionListItem` present after `ActionListSection`\n const isActionListItemPresentAfterSection = childComponentIdArray\n .slice(lastActionListSectionIndex)\n .includes(componentIds.ActionListItem);\n\n return {\n isActionListItemPresentAfterSection,\n lastActionListSectionIndex,\n };\n};\n\nconst actionListAllowedChildren = [componentIds.ActionListItem, componentIds.ActionListSection];\n\nexport type SectionData = {\n title: string;\n hideDivider: boolean;\n data: ActionListItemProps[];\n}[];\n\n/**\n * Loops over action list items and returns different properties from children like option values, header and footer child, etc\n */\nconst getActionListProperties = (\n children: React.ReactNode,\n): {\n sectionData: SectionData;\n childrenWithId?: React.ReactNode[] | null;\n actionListOptions: OptionsType;\n} => {\n const sectionData: SectionData = [];\n let currentSection: string | null = null;\n const actionListOptions: OptionsType = [];\n\n const getActionListItemWithId = (\n child: React.ReactNode,\n hideDivider: boolean,\n ): React.ReactNode => {\n if (React.isValidElement(child) && !child.props.isDisabled) {\n actionListOptions.push({\n title: child.props.title,\n value: child.props.value,\n onClickTrigger: (value) => {\n const anchorLink = child.props.href;\n child.props.onClick?.({\n name: child.props.value,\n value: child.props.isSelected ?? value,\n });\n\n if (anchorLink && !isReactNative()) {\n const target = child.props.target ?? '_self';\n window.open(anchorLink, target);\n if (window.top) {\n window.top.open(anchorLink, target);\n }\n }\n },\n });\n const currentIndex = actionListOptions.length - 1;\n\n const foundSection = sectionData.find((v) => v.title === currentSection);\n // push the item in the appropriate bucket\n if (foundSection) {\n foundSection?.data.push({\n ...child.props,\n _index: currentIndex,\n });\n } else {\n // create a new bucket\n sectionData.push({\n title: currentSection!,\n hideDivider,\n data: [\n {\n ...child.props,\n _index: currentIndex,\n },\n ],\n });\n }\n\n const clonedChild = React.cloneElement(child, {\n // @ts-expect-error: TS doesn't understand the child's props\n _index: currentIndex,\n });\n return clonedChild;\n }\n\n return child;\n };\n\n let isActionListItemPresentAfterSection: boolean;\n // eslint-disable-next-line one-var\n let lastActionListSectionIndex: number;\n\n if (isReactNative()) {\n // We're reading this so that we can decide whether to show the divider or not.\n // If ActionListSection is final item and no ActionListItem is present after that, we hide the divider\n\n // On web, we do it using descendant styling\n ({\n isActionListItemPresentAfterSection,\n lastActionListSectionIndex,\n } = getActionListSectionPosition(children));\n }\n\n // Looping through ActionListItems to add index to them and get an options array for moving focus between items\n const childrenWithId = React.Children.map(children, (child, index) => {\n if (React.isValidElement(child)) {\n if (isValidAllowedChildren(child, componentIds.ActionListSection)) {\n const shouldHideDivider =\n index === lastActionListSectionIndex && !isActionListItemPresentAfterSection;\n const sectionChildValues: string[] = [];\n return React.cloneElement(child, {\n // @ts-expect-error: TS doesn't understand the child's props\n children: React.Children.map(child.props.children, (childInSection) => {\n currentSection = child.props.title;\n sectionChildValues.push(childInSection.props.value);\n if (isValidAllowedChildren(childInSection, componentIds.ActionListItem)) {\n return getActionListItemWithId(childInSection, shouldHideDivider);\n }\n\n return childInSection;\n }),\n // On web, we handle it with descendant styling in css so no need of JS there\n _hideDivider: isReactNative() ? shouldHideDivider : undefined,\n _sectionChildValues: sectionChildValues,\n });\n }\n\n if (isValidAllowedChildren(child, componentIds.ActionListItem)) {\n return getActionListItemWithId(child, true);\n }\n\n if (__DEV__) {\n throwBladeError({\n message: `Only ${actionListAllowedChildren.join(', ')} supported inside ActionList`,\n moduleName: 'ActionList',\n });\n }\n }\n return child;\n });\n\n return {\n sectionData,\n childrenWithId,\n actionListOptions,\n };\n};\n\nconst validateActionListItemProps = ({\n leading,\n trailing,\n titleSuffix,\n}: {\n leading: ActionListItemProps['leading'];\n trailing: ActionListItemProps['trailing'];\n titleSuffix: ActionListItemProps['titleSuffix'];\n}): void => {\n if (__DEV__) {\n React.Children.map(trailing, (child) => {\n if (\n !isValidAllowedChildren(child, componentIds.ActionListItemIcon) &&\n !isValidAllowedChildren(child, componentIds.ActionListItemText)\n ) {\n throwBladeError({\n message: `Only ${componentIds.ActionListItemIcon} and ${componentIds.ActionListItemText} are allowed in trailing prop`,\n moduleName: 'ActionListItem',\n });\n }\n });\n\n React.Children.map(titleSuffix, (child) => {\n if (\n !isValidAllowedChildren(child, componentIds.ActionListItemBadge) &&\n !isValidAllowedChildren(child, componentIds.ActionListItemBadgeGroup)\n ) {\n throwBladeError({\n message: `Only ${componentIds.ActionListItemBadge} and ${componentIds.ActionListItemBadgeGroup} are allowed in titleSuffix prop`,\n moduleName: 'ActionListItem',\n });\n }\n });\n\n React.Children.map(leading, (child) => {\n if (\n !isValidAllowedChildren(child, componentIds.ActionListItemIcon) &&\n !isValidAllowedChildren(child, componentIds.ActionListItemText) &&\n !isValidAllowedChildren(child, componentIds.ActionListItemAsset)\n ) {\n throwBladeError({\n message: `Only ${componentIds.ActionListItemIcon}, ${componentIds.ActionListItemAsset}, and ${componentIds.ActionListItemText} are allowed in leading prop`,\n moduleName: 'ActionListItem',\n });\n }\n });\n }\n};\n\nconst getNormalTextColor = (\n isDisabled: boolean | undefined,\n { isMuted }: { isMuted?: boolean } = {},\n): Extract<\n BaseTextProps['color'],\n | 'surface.text.placeholder.lowContrast'\n | 'surface.text.muted.lowContrast'\n | 'surface.text.normal.lowContrast'\n> => {\n if (isDisabled) {\n return 'surface.text.placeholder.lowContrast';\n }\n\n if (isMuted) {\n return 'surface.text.muted.lowContrast';\n }\n\n return 'surface.text.normal.lowContrast';\n};\n\nexport { getActionListProperties, validateActionListItemProps, getNormalTextColor };\n"],"names":["getActionListSectionPosition","children","childComponentIdArray","React","Children","toArray","map","child","getComponentId","lastActionListSectionIndex","lastIndexOf","componentIds","ActionListSection","isActionListItemPresentAfterSection","slice","includes","ActionListItem","actionListAllowedChildren","getActionListProperties","sectionData","currentSection","actionListOptions","getActionListItemWithId","hideDivider","isValidElement","props","isDisabled","push","title","value","onClickTrigger","_child$props$isSelect","anchorLink","href","onClick","name","isSelected","isReactNative","_child$props$target","target","window","open","top","currentIndex","length","foundSection","find","v","data","Object","assign","_index","clonedChild","cloneElement","_getActionListSection","childrenWithId","index","isValidAllowedChildren","shouldHideDivider","sectionChildValues","childInSection","_hideDivider","undefined","_sectionChildValues","__DEV__","throwBladeError","message","join","moduleName","validateActionListItemProps","_ref","leading","trailing","titleSuffix","ActionListItemIcon","ActionListItemText","ActionListItemBadge","ActionListItemBadgeGroup","ActionListItemAsset","getNormalTextColor","_ref2","arguments","isMuted"],"mappings":";;;;;;;;;AAeA,IAAMA,4BAA4B,CAAG,SAA/BA,4BAA4BA,CAChCC,QAAyB,CAItB,CAEH,IAAMC,qBAAqB,CAAGC,cAAK,CAACC,QAAQ,CAACC,OAAO,CAACJ,QAAQ,CAAC,CAACK,GAAG,CAAC,SAACC,KAAK,CAAA,CAAA,OACvEC,cAAc,C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C/C,CAEA,GAAIwD,OAAO,CAAE,CACX,OAAO,gCAAgC,CACzC,CAEA,OAAO,iCAAiC,CAC1C;;;;"}
|
|
1
|
+
{"version":3,"file":"actionListUtils.js","sources":["../../../../../src/components/ActionList/actionListUtils.ts"],"sourcesContent":["import React from 'react';\nimport { componentIds } from './componentIds';\nimport type { ActionListItemProps } from './ActionListItem';\nimport type { OptionsType } from '~components/Dropdown/useDropdown';\nimport { isReactNative } from '~utils';\nimport type { BaseTextProps } from '~components/Typography/BaseText/types';\nimport { getComponentId, isValidAllowedChildren } from '~utils/isValidAllowedChildren';\nimport { throwBladeError } from '~utils/logger';\n\n/**\n * Returns if there is ActionListItem after ActionListSection\n * and an index of last ActionListSection\n *\n * It is used to decide if ActionListSection add divider at the end\n */\nconst getActionListSectionPosition = (\n children: React.ReactNode,\n): {\n isActionListItemPresentAfterSection: boolean;\n lastActionListSectionIndex: number;\n} => {\n // Creating an array of componentIds\n const childComponentIdArray = React.Children.toArray(children).map((child) =>\n getComponentId(child),\n );\n\n // Reading the last `ActionListSection` component's index\n const lastActionListSectionIndex = childComponentIdArray.lastIndexOf(\n componentIds.ActionListSection,\n );\n\n // Checking if there is any `ActionListItem` present after `ActionListSection`\n const isActionListItemPresentAfterSection = childComponentIdArray\n .slice(lastActionListSectionIndex)\n .includes(componentIds.ActionListItem);\n\n return {\n isActionListItemPresentAfterSection,\n lastActionListSectionIndex,\n };\n};\n\nconst actionListAllowedChildren = [componentIds.ActionListItem, componentIds.ActionListSection];\n\nexport type SectionData = {\n title: string;\n hideDivider: boolean;\n data: ActionListItemProps[];\n}[];\n\n/**\n * Loops over action list items and returns different properties from children like option values, header and footer child, etc\n */\nconst getActionListProperties = (\n children: React.ReactNode,\n): {\n sectionData: SectionData;\n childrenWithId?: React.ReactNode[] | null;\n actionListOptions: OptionsType;\n} => {\n const sectionData: SectionData = [];\n let currentSection: string | null = null;\n const actionListOptions: OptionsType = [];\n\n const getActionListItemWithId = (\n child: React.ReactNode,\n hideDivider: boolean,\n ): React.ReactNode => {\n if (React.isValidElement(child) && !child.props.isDisabled) {\n actionListOptions.push({\n title: child.props.title,\n value: child.props.value,\n onClickTrigger: (value) => {\n const anchorLink = child.props.href;\n child.props.onClick?.({\n name: child.props.value,\n value: child.props.isSelected ?? value,\n });\n\n if (anchorLink && !isReactNative()) {\n const target = child.props.target ?? '_self';\n window.open(anchorLink, target);\n if (window.top) {\n window.top.open(anchorLink, target);\n }\n }\n },\n });\n const currentIndex = actionListOptions.length - 1;\n\n const foundSection = sectionData.find((v) => v.title === currentSection);\n // push the item in the appropriate bucket\n if (foundSection) {\n foundSection?.data.push({\n ...child.props,\n _index: currentIndex,\n });\n } else {\n // create a new bucket\n sectionData.push({\n title: currentSection!,\n hideDivider,\n data: [\n {\n ...child.props,\n _index: currentIndex,\n },\n ],\n });\n }\n\n const clonedChild = React.cloneElement(child, {\n // @ts-expect-error: TS doesn't understand the child's props\n _index: currentIndex,\n });\n return clonedChild;\n }\n\n return child;\n };\n\n let isActionListItemPresentAfterSection: boolean;\n // eslint-disable-next-line one-var\n let lastActionListSectionIndex: number;\n\n if (isReactNative()) {\n // We're reading this so that we can decide whether to show the divider or not.\n // If ActionListSection is final item and no ActionListItem is present after that, we hide the divider\n\n // On web, we do it using descendant styling\n ({\n isActionListItemPresentAfterSection,\n lastActionListSectionIndex,\n } = getActionListSectionPosition(children));\n }\n\n // Looping through ActionListItems to add index to them and get an options array for moving focus between items\n const childrenWithId = React.Children.map(children, (child, index) => {\n if (React.isValidElement(child)) {\n if (isValidAllowedChildren(child, componentIds.ActionListSection)) {\n const shouldHideDivider =\n index === lastActionListSectionIndex && !isActionListItemPresentAfterSection;\n const sectionChildValues: string[] = [];\n return React.cloneElement(child, {\n // @ts-expect-error: TS doesn't understand the child's props\n children: React.Children.map(child.props.children, (childInSection) => {\n currentSection = child.props.title;\n sectionChildValues.push(childInSection.props.value);\n if (isValidAllowedChildren(childInSection, componentIds.ActionListItem)) {\n return getActionListItemWithId(childInSection, shouldHideDivider);\n }\n\n return childInSection;\n }),\n // On web, we handle it with descendant styling in css so no need of JS there\n _hideDivider: isReactNative() ? shouldHideDivider : undefined,\n _sectionChildValues: sectionChildValues,\n });\n }\n\n if (isValidAllowedChildren(child, componentIds.ActionListItem)) {\n return getActionListItemWithId(child, true);\n }\n\n if (__DEV__) {\n throwBladeError({\n message: `Only ${actionListAllowedChildren.join(', ')} supported inside ActionList`,\n moduleName: 'ActionList',\n });\n }\n }\n return child;\n });\n\n return {\n sectionData,\n childrenWithId,\n actionListOptions,\n };\n};\n\nconst validateActionListItemProps = ({\n leading,\n trailing,\n titleSuffix,\n}: {\n leading: ActionListItemProps['leading'];\n trailing: ActionListItemProps['trailing'];\n titleSuffix: ActionListItemProps['titleSuffix'];\n}): void => {\n if (__DEV__) {\n React.Children.map(trailing, (child) => {\n if (\n !isValidAllowedChildren(child, componentIds.ActionListItemIcon) &&\n !isValidAllowedChildren(child, componentIds.ActionListItemText)\n ) {\n throwBladeError({\n message: `Only ${componentIds.ActionListItemIcon} and ${componentIds.ActionListItemText} are allowed in trailing prop`,\n moduleName: 'ActionListItem',\n });\n }\n });\n\n React.Children.map(titleSuffix, (child) => {\n if (\n !isValidAllowedChildren(child, componentIds.ActionListItemBadge) &&\n !isValidAllowedChildren(child, componentIds.ActionListItemBadgeGroup)\n ) {\n throwBladeError({\n message: `Only ${componentIds.ActionListItemBadge} and ${componentIds.ActionListItemBadgeGroup} are allowed in titleSuffix prop`,\n moduleName: 'ActionListItem',\n });\n }\n });\n\n React.Children.map(leading, (child) => {\n if (\n !isValidAllowedChildren(child, componentIds.ActionListItemIcon) &&\n !isValidAllowedChildren(child, componentIds.ActionListItemText) &&\n !isValidAllowedChildren(child, componentIds.ActionListItemAsset)\n ) {\n throwBladeError({\n message: `Only ${componentIds.ActionListItemIcon}, ${componentIds.ActionListItemAsset}, and ${componentIds.ActionListItemText} are allowed in leading prop`,\n moduleName: 'ActionListItem',\n });\n }\n });\n }\n};\n\nconst getNormalTextColor = (\n isDisabled: boolean | undefined,\n { isMuted }: { isMuted?: boolean } = {},\n): Extract<\n BaseTextProps['color'],\n 'interactive.text.gray.disabled' | 'interactive.text.gray.muted' | 'interactive.text.gray.normal'\n> => {\n if (isDisabled) {\n return 'interactive.text.gray.disabled';\n }\n\n if (isMuted) {\n return 'interactive.text.gray.muted';\n }\n\n return 'interactive.text.gray.normal';\n};\n\nexport { getActionListProperties, validateActionListItemProps, getNormalTextColor };\n"],"names":["getActionListSectionPosition","children","childComponentIdArray","React","Children","toArray","map","child","getComponentId","lastActionListSectionIndex","lastIndexOf","componentIds","ActionListSection","isActionListItemPresentAfterSection","slice","includes","ActionListItem","actionListAllowedChildren","getActionListProperties","sectionData","currentSection","actionListOptions","getActionListItemWithId","hideDivider","isValidElement","props","isDisabled","push","title","value","onClickTrigger","_child$props$isSelect","anchorLink","href","onClick","name","isSelected","isReactNative","_child$props$target","target","window","open","top","currentIndex","length","foundSection","find","v","data","Object","assign","_index","clonedChild","cloneElement","_getActionListSection","childrenWithId","index","isValidAllowedChildren","shouldHideDivider","sectionChildValues","childInSection","_hideDivider","undefined","_sectionChildValues","__DEV__","throwBladeError","message","join","moduleName","validateActionListItemProps","_ref","leading","trailing","titleSuffix","ActionListItemIcon","ActionListItemText","ActionListItemBadge","ActionListItemBadgeGroup","ActionListItemAsset","getNormalTextColor","_ref2","arguments","isMuted"],"mappings":";;;;;;;;;AAeA,IAAMA,4BAA4B,CAAG,SAA/BA,4BAA4BA,CAChCC,QAAyB,CAItB,CAEH,IAAMC,qBAAqB,CAAGC,cAAK,CAACC,QAAQ,CAACC,OAAO,CAACJ,QAAQ,CAAC,CAACK,GAAG,CAAC,SAACC,KAAK,CAAA,CAAA,OACvEC,cAAc,CAACD,KAAK,CAAC,CAAA,CACvB,CAAC,CAGD,IAAME,0BAA0B,CAAGP,qBAAqB,CAACQ,WAAW,CAClEC,YAAY,CAACC,iBACf,CAAC,CAGD,IAAMC,mCAAmC,CAAGX,qBAAqB,C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pacity } from 'react-native';
|
|
3
3
|
import { getBaseActionListItemStyles } from './getBaseActionListItemStyles.js';
|
|
4
4
|
|
|
5
|
-
var StyledActionListItem=styled(TouchableOpacity)(function(props){return Object.assign({},getBaseActionListItemStyles(props),{display:props.isVisible?'flex':'none',backgroundColor:props.isSelected&&props.selectionType==='single'?props.theme.colors.
|
|
5
|
+
var StyledActionListItem=styled(TouchableOpacity)(function(props){return Object.assign({},getBaseActionListItemStyles(props),{display:props.isVisible?'flex':'none',backgroundColor:props.isSelected&&props.selectionType==='single'?props.theme.colors.interactive.background.primary.faded:undefined});});
|
|
6
6
|
|
|
7
7
|
export { StyledActionListItem };
|
|
8
8
|
//# sourceMappingURL=StyledActionListItem.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StyledActionListItem.native.js","sources":["../../../../../../src/components/ActionList/styles/StyledActionListItem.native.tsx"],"sourcesContent":["import styled from 'styled-components';\nimport { TouchableOpacity } from 'react-native';\nimport type { StyledActionListItemProps } from './getBaseActionListItemStyles';\nimport { getBaseActionListItemStyles } from './getBaseActionListItemStyles';\n\nconst StyledActionListItem = styled(TouchableOpacity)<StyledActionListItemProps>((props) => {\n return {\n ...getBaseActionListItemStyles(props),\n display: props.isVisible ? 'flex' : 'none',\n // React Native specific styles\n backgroundColor:\n props.isSelected && props.selectionType === 'single'\n ? props.theme.colors.
|
|
1
|
+
{"version":3,"file":"StyledActionListItem.native.js","sources":["../../../../../../src/components/ActionList/styles/StyledActionListItem.native.tsx"],"sourcesContent":["import styled from 'styled-components';\nimport { TouchableOpacity } from 'react-native';\nimport type { StyledActionListItemProps } from './getBaseActionListItemStyles';\nimport { getBaseActionListItemStyles } from './getBaseActionListItemStyles';\n\nconst StyledActionListItem = styled(TouchableOpacity)<StyledActionListItemProps>((props) => {\n return {\n ...getBaseActionListItemStyles(props),\n display: props.isVisible ? 'flex' : 'none',\n // React Native specific styles\n backgroundColor:\n props.isSelected && props.selectionType === 'single'\n ? props.theme.colors.interactive.background.primary.faded\n : undefined,\n };\n});\n\nexport { StyledActionListItem };\n"],"names":["StyledActionListItem","styled","TouchableOpacity","props","Object","assign","getBaseActionListItemStyles","display","isVisible","backgroundColor","isSelected","selectionType","theme","colors","interactive","background","primary","faded","undefined"],"mappings":";;;;AAKM,IAAAA,oBAAoB,CAAGC,MAAM,CAACC,gBAAgB,CAAC,CAA4B,SAACC,KAAK,CAAK,CAC1F,OAAAC,MAAA,CAAAC,MAAA,CACKC,EAAAA,CAAAA,2BAA2B,CAACH,KAAK,CAAC,CACrCI,CAAAA,OAAO,CAAEJ,KAAK,CAACK,SAAS,CAAG,MAAM,CAAG,MAAM,CAE1CC,eAAe,CACbN,KAAK,CAACO,UAAU,EAAIP,KAAK,CAACQ,aAAa,GAAK,QAAQ,CAChDR,KAAK,CAACS,KAAK,CAACC,MAAM,CAACC,WAAW,CAACC,UAAU,CAACC,OAAO,CAACC,KAAK,CACvDC,SAAS,CAEnB,CAAA,CAAA,CAAC;;;;"}
|
|
@@ -14,7 +14,6 @@ import useTheme from '../BladeProvider/useTheme.js';
|
|
|
14
14
|
import 'react-native';
|
|
15
15
|
import { getPlatformType } from '../../utils/getPlatformType/getPlatformType.js';
|
|
16
16
|
import { useBreakpoint } from '../../utils/useBreakpoint/useBreakpoint.js';
|
|
17
|
-
import { throwBladeError } from '../../utils/logger/logger.js';
|
|
18
17
|
import { castNativeType, castWebType } from '../../utils/platform/castUtils.js';
|
|
19
18
|
import '../BottomSheet/BottomSheetStack.js';
|
|
20
19
|
import '../../tokens/global/typography.js';
|
|
@@ -28,14 +27,13 @@ import { getStyledProps } from '../Box/styledProps/getStyledProps.js';
|
|
|
28
27
|
import { IconButton } from '../Button/IconButton/IconButton.js';
|
|
29
28
|
import { BaseBox } from '../Box/BaseBox/BaseBox.native.js';
|
|
30
29
|
import '../Typography/BaseText/BaseText.native.js';
|
|
31
|
-
import { Heading } from '../Typography/Heading/Heading.js';
|
|
32
30
|
import { Text } from '../Typography/Text/Text.js';
|
|
33
31
|
import '../Typography/Code/Code.js';
|
|
34
32
|
import BaseButton from '../Button/BaseButton/BaseButton.js';
|
|
35
33
|
import BaseLink from '../Link/BaseLink/BaseLink.js';
|
|
36
34
|
import { makeAccessible } from '../../utils/makeAccessible/makeAccessible.native.js';
|
|
37
35
|
|
|
38
|
-
var _excluded=["description","title","isDismissible","onDismiss","
|
|
36
|
+
var _excluded=["description","title","isDismissible","onDismiss","emphasis","isFullWidth","color","actions","testID"];var isReactNative=getPlatformType()==='react-native';var CloseButtonWrapper=isReactNative?BaseBox:Fragment;var intentIconMap={positive:CheckCircleIcon,negative:AlertTriangleIcon,information:InfoIcon,neutral:InfoIcon,notice:AlertTriangleIcon$1};var Alert=function Alert(_ref){var description=_ref.description,title=_ref.title,_ref$isDismissible=_ref.isDismissible,isDismissible=_ref$isDismissible===void 0?true:_ref$isDismissible,onDismiss=_ref.onDismiss,_ref$emphasis=_ref.emphasis,emphasis=_ref$emphasis===void 0?'subtle':_ref$emphasis,_ref$isFullWidth=_ref.isFullWidth,isFullWidth=_ref$isFullWidth===void 0?false:_ref$isFullWidth,_ref$color=_ref.color,color=_ref$color===void 0?'neutral':_ref$color,actions=_ref.actions,testID=_ref.testID,styledProps=_objectWithoutProperties(_ref,_excluded);var _useTheme=useTheme(),theme=_useTheme.theme;var _useBreakpoint=useBreakpoint({breakpoints:theme.breakpoints}),matchedDeviceType=_useBreakpoint.matchedDeviceType;var _useState=useState(true),_useState2=_slicedToArray(_useState,2),isVisible=_useState2[0],setIsVisible=_useState2[1];var isDesktop=matchedDeviceType==='desktop';var isMobile=!isDesktop;var Icon=intentIconMap[color];var iconOffset='spacing.1';if(isReactNative){if(isFullWidth&&!title){iconOffset='spacing.1';}else if(!isFullWidth&&!title){iconOffset='spacing.0';}else if(!isFullWidth&&title){iconOffset='spacing.2';}}else if(isMobile){if(!isFullWidth&&title){iconOffset='spacing.2';}else if(isFullWidth&&!title){iconOffset='spacing.2';}}else if(isFullWidth){iconOffset='spacing.1';}var shouldCenterAlign=isFullWidth&&!title;var alignment='flex-start';if(!isFullWidth)alignment='flex-start';if(shouldCenterAlign)alignment='center';var icon=jsx(BaseBox,{display:"flex",alignSelf:alignment,marginTop:iconOffset,children:jsx(Icon,{color:emphasis==='intense'?'surface.icon.staticWhite.normal':`feedback.icon.${color}.${emphasis==='subtle'?'intense':'subtle'}`,size:"medium"})});var textColor=emphasis==='intense'?'surface.text.staticWhite.normal':'surface.text.gray.subtle';var _title=title?jsx(BaseBox,{marginBottom:"spacing.2",children:jsx(Text,{color:textColor,size:"medium",weight:"semibold",children:title})}):null;var _description=jsx(BaseBox,{marginTop:title||isReactNative?'spacing.0':'spacing.1',children:jsx(Text,{color:textColor,size:"small",children:description})});var primaryAction=actions!=null&&actions.primary?jsx(BaseBox,{marginRight:"spacing.5",display:isReactNative?castNativeType('flex'):castWebType('inline-flex'),children:jsx(BaseButton,{size:"small",onClick:actions.primary.onClick,color:emphasis==='intense'?'white':color,variant:"secondary",children:actions.primary.text})}):null;var secondaryActionParams=actions!=null&&actions.secondary?{onClick:actions.secondary.onClick}:null;if(actions!=null&&actions.secondary&&secondaryActionParams&&'href'in actions.secondary){secondaryActionParams.href=actions.secondary.href;secondaryActionParams.target=actions.secondary.target;secondaryActionParams.rel=actions.secondary.rel;}var secondaryAction=actions!=null&&actions.secondary?jsx(BaseBox,{marginRight:"spacing.4",display:isReactNative?'flex':'inline-flex',children:jsx(BaseLink,Object.assign({size:"small",color:emphasis==='intense'?'white':color},secondaryActionParams,{children:actions.secondary.text}))}):null;var showActionsHorizontal=isFullWidth&&isDesktop;var actionsHorizontal=showActionsHorizontal&&(primaryAction||secondaryAction)?jsxs(BaseBox,{flexDirection:"row",alignItems:"center",children:[primaryAction,secondaryAction]}):null;var actionsVertical=!showActionsHorizontal&&(primaryAction||secondaryAction)?jsxs(BaseBox,{marginTop:"spacing.4",flexDirection:"row",alignItems:"center",children:[primaryAction,secondaryAction]}):null;var onClickDismiss=function onClickDismiss(){if(onDismiss){onDismiss();}setIsVisible(false);};var closeButton=isDismissible?jsx(CloseButtonWrapper,{children:jsx(IconButton,{accessibilityLabel:"Dismiss alert",onClick:onClickDismiss,emphasis:emphasis==='intense'?'subtle':'intense',size:"large",icon:CloseIcon})}):null;var a11yProps=makeAccessible(Object.assign({role:isReactNative||color==='negative'||color==='notice'?'alert':'status'},color==='notice'&&{liveRegion:'polite'}));if(!isVisible){return null;}return jsx(BaseBox,Object.assign({},a11yProps,metaAttribute({name:MetaConstants.Alert,testID:testID}),getStyledProps(styledProps),{children:jsxs(StyledAlert,{color:color,emphasis:emphasis,isFullWidth:isFullWidth,isDesktop:isDesktop,textAlign:'left',children:[icon,jsxs(BaseBox,{flex:1,paddingLeft:isFullWidth?'spacing.4':'spacing.3',paddingRight:showActionsHorizontal?'spacing.4':'spacing.2',children:[_title,_description,actionsVertical]}),actionsHorizontal,closeButton]})}));};
|
|
39
37
|
|
|
40
38
|
export { Alert };
|
|
41
39
|
//# sourceMappingURL=Alert.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Alert.js","sources":["../../../../../src/components/Alert/Alert.tsx"],"sourcesContent":["import type { ReactChild, ReactElement } from 'react';\nimport { Fragment, useState } from 'react';\n\nimport { StyledAlert } from './StyledAlert';\nimport {\n AlertOctagonIcon,\n AlertTriangleIcon,\n CheckCircleIcon,\n CloseIcon,\n InfoIcon,\n} from '~components/Icons';\nimport { castNativeType, castWebType, useBreakpoint, getPlatformType } from '~utils';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport { IconButton } from '~components/Button/IconButton';\nimport BaseBox from '~components/Box/BaseBox';\nimport { Heading, Text } from '~components/Typography';\nimport BaseButton from '~components/Button/BaseButton';\nimport { BaseLink } from '~components/Link/BaseLink';\nimport type { ColorContrastTypes, Feedback } from '~tokens/theme/theme';\nimport { useTheme } from '~components/BladeProvider';\nimport type { DotNotationSpacingStringToken, TestID } from '~utils/types';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport { throwBladeError } from '~utils/logger';\n\ntype Nullable<Type> = Type | null;\n\ntype PrimaryAction = {\n text: string;\n onClick: () => void;\n};\n\ntype SecondaryActionButton = {\n text: string;\n onClick: () => void;\n};\n\ntype SecondaryActionLinkButton = {\n text: string;\n href: string;\n onClick?: () => void;\n target?: string;\n /**\n * When `target` is set to `_blank` this is automatically set to `noopener noreferrer`\n */\n rel?: string;\n};\n\ntype SecondaryAction = SecondaryActionButton | SecondaryActionLinkButton;\n\ntype AlertProps = {\n /**\n * Body content, pass text or JSX. Avoid passing components except `Link` to customize the content.\n */\n description: ReactChild;\n\n /**\n * A brief heading\n */\n title?: string;\n\n /**\n * Shows a dismiss button\n *\n * @default true\n */\n isDismissible?: boolean;\n\n /**\n * A callback when the dismiss button is clicked\n */\n onDismiss?: () => void;\n\n /**\n * Can be set to `high` for a more prominent look. Not to be confused with a11y contrast.\n *\n * @default low\n */\n contrast?: ColorContrastTypes;\n\n /**\n * Makes the Alert span the entire container width, instead of the default max width of `584px`.\n * This also makes the alert borderless, useful for creating full bleed layouts.\n *\n * @default false\n */\n isFullWidth?: boolean;\n\n /**\n * This prop is deprecated in favor of the `color` prop.\n *\n * @deprecated Use `color` instead\n * @default neutral\n */\n intent?: Feedback;\n\n /**\n * Sets the color tone\n */\n color?: Feedback;\n\n /**\n * Renders a primary action button and a secondary action link button\n */\n actions?: {\n /**\n * Renders a button (should **always** be present if `secondary` action is being used)\n */\n primary: PrimaryAction;\n\n /**\n * Renders a Link button\n */\n secondary?: SecondaryAction;\n };\n} & TestID &\n StyledPropsBlade;\n\nconst isReactNative = getPlatformType() === 'react-native';\n\n// Need extra wrappers on React Native only for alignment\nconst CloseButtonWrapper = isReactNative ? BaseBox : Fragment;\n\nconst intentIconMap = {\n positive: CheckCircleIcon,\n negative: AlertOctagonIcon,\n information: InfoIcon,\n neutral: InfoIcon,\n notice: AlertTriangleIcon,\n};\n\nconst Alert = ({\n description,\n title,\n isDismissible = true,\n onDismiss,\n contrast = 'low',\n isFullWidth = false,\n // TODO: Remove intent prop in favor of color in the next major release\n intent = 'neutral',\n color,\n actions,\n testID,\n ...styledProps\n}: AlertProps): ReactElement | null => {\n if (__DEV__) {\n if (!actions?.primary && actions?.secondary) {\n throwBladeError({\n message: 'SecondaryAction is allowed only when PrimaryAction is defined.',\n moduleName: 'Alert',\n });\n }\n }\n const { theme } = useTheme();\n const { matchedDeviceType } = useBreakpoint({ breakpoints: theme.breakpoints });\n const isDesktop = matchedDeviceType === 'desktop';\n const isMobile = !isDesktop;\n\n const [isVisible, setIsVisible] = useState(true);\n const contrastType = `${contrast}Contrast` as const;\n const iconSize = isFullWidth ? 'large' : 'medium';\n const textSize = isFullWidth ? 'medium' : 'small';\n const alertColor = color ?? intent;\n\n const Icon = intentIconMap[alertColor];\n let iconOffset: DotNotationSpacingStringToken = 'spacing.1';\n\n // certain special cases below needs special care for near perfect alignment\n if (isReactNative) {\n if (isFullWidth && !title) {\n iconOffset = 'spacing.1';\n } else if (!isFullWidth && !title) {\n iconOffset = 'spacing.0';\n } else if (!isFullWidth && title) {\n iconOffset = 'spacing.2';\n }\n } else if (isMobile) {\n if (!isFullWidth && title) {\n iconOffset = 'spacing.2';\n } else if (isFullWidth && !title) {\n iconOffset = 'spacing.2';\n }\n } else if (isFullWidth) {\n iconOffset = 'spacing.0';\n }\n\n const icon = (\n <BaseBox marginTop={iconOffset} display=\"flex\">\n <Icon color={`feedback.icon.${alertColor}.${contrastType}`} size={iconSize} />\n </BaseBox>\n );\n\n const _title = title ? (\n <BaseBox marginBottom=\"spacing.2\">\n {isFullWidth ? (\n <Heading type=\"subtle\" size=\"small\" contrast={contrast}>\n {title}\n </Heading>\n ) : (\n <Text type=\"subtle\" weight=\"bold\" contrast={contrast}>\n {title}\n </Text>\n )}\n </BaseBox>\n ) : null;\n\n const _description = (\n <BaseBox marginTop={title || isReactNative ? 'spacing.0' : 'spacing.1'}>\n <Text type=\"subtle\" size={textSize} contrast={contrast}>\n {description}\n </Text>\n </BaseBox>\n );\n\n const primaryAction = actions?.primary ? (\n <BaseBox\n marginRight=\"spacing.5\"\n display={isReactNative ? castNativeType('flex') : castWebType('inline-flex')}\n >\n <BaseButton\n size={textSize}\n onClick={actions.primary.onClick}\n color={alertColor}\n variant={contrast === 'high' ? 'primary' : 'secondary'}\n >\n {actions.primary.text}\n </BaseButton>\n </BaseBox>\n ) : null;\n\n const secondaryActionParams: Nullable<Partial<SecondaryActionLinkButton>> = actions?.secondary\n ? {\n onClick: actions.secondary.onClick,\n }\n : null;\n\n /**\n * TS assumes only common properties to be present for `SecondaryAction` union type\n * We add a type guard that checks if href is present on secondary action:\n * - If yes, then TS can assume it to be `SecondaryActionLinkButton` (href being a required property)\n * - If no, then it would be `SecondaryActionButton` (and link properties wouldn't be needed)\n */\n if (actions?.secondary && secondaryActionParams && 'href' in actions.secondary) {\n secondaryActionParams.href = actions.secondary.href;\n secondaryActionParams.target = actions.secondary.target;\n secondaryActionParams.rel = actions.secondary.rel;\n }\n const secondaryAction = actions?.secondary ? (\n <BaseBox\n marginRight=\"spacing.4\"\n display={isReactNative ? castNativeType('flex') : castWebType('inline-flex')}\n >\n <BaseLink\n size={textSize}\n color={contrast === 'high' ? 'white' : alertColor}\n {...secondaryActionParams}\n >\n {actions.secondary.text}\n </BaseLink>\n </BaseBox>\n ) : null;\n\n // For certain cases we wish to render actions inline with text content\n const showActionsHorizontal = isFullWidth && isDesktop;\n\n const actionsHorizontal =\n showActionsHorizontal && (primaryAction || secondaryAction) ? (\n <BaseBox flexDirection=\"row\" alignItems=\"center\">\n {primaryAction}\n {secondaryAction}\n </BaseBox>\n ) : null;\n\n const actionsVertical =\n !showActionsHorizontal && (primaryAction || secondaryAction) ? (\n <BaseBox marginTop=\"spacing.4\" flexDirection=\"row\" alignItems=\"center\">\n {primaryAction}\n {secondaryAction}\n </BaseBox>\n ) : null;\n\n const onClickDismiss = (): void => {\n if (onDismiss) {\n onDismiss();\n }\n setIsVisible(false);\n };\n const closeButton = isDismissible ? (\n <CloseButtonWrapper>\n <IconButton\n accessibilityLabel=\"Dismiss alert\"\n onClick={onClickDismiss}\n contrast={contrast}\n size={iconSize}\n icon={CloseIcon}\n />\n </CloseButtonWrapper>\n ) : null;\n\n const a11yProps = makeAccessible({\n // React Native doesn't has status as role\n role:\n isReactNative || alertColor === 'negative' || alertColor === 'notice' ? 'alert' : 'status',\n // override the implicit live region of role `alert`\n ...(alertColor === 'notice' && { liveRegion: 'polite' }),\n });\n\n if (!isVisible) {\n return null;\n }\n\n return (\n <BaseBox\n {...a11yProps}\n {...metaAttribute({ name: MetaConstants.Alert, testID })}\n {...getStyledProps(styledProps)}\n >\n <StyledAlert\n color={alertColor}\n contrastType={contrastType}\n isFullWidth={isFullWidth}\n isDesktop={isDesktop}\n textAlign={'left' as never}\n >\n {icon}\n <BaseBox\n flex={1}\n paddingLeft={isFullWidth ? 'spacing.4' : 'spacing.3'}\n paddingRight={showActionsHorizontal ? 'spacing.4' : 'spacing.2'}\n >\n {_title}\n {_description}\n {actionsVertical}\n </BaseBox>\n {actionsHorizontal}\n {closeButton}\n </StyledAlert>\n </BaseBox>\n );\n};\n\nexport type { AlertProps };\nexport { Alert };\n"],"names":["isReactNative","getPlatformType","CloseButtonWrapper","BaseBox","Fragment","intentIconMap","positive","CheckCircleIcon","negative","AlertOctagonIcon","information","InfoIcon","neutral","notice","AlertTriangleIcon","Alert","_ref","description","title","_ref$isDismissible","isDismissible","onDismiss","_ref$contrast","contrast","_ref$isFullWidth","isFullWidth","_ref$intent","intent","color","actions","testID","styledProps","_objectWithoutProperties","_excluded","__DEV__","primary","secondary","throwBladeError","message","moduleName","_useTheme","useTheme","theme","_useBreakpoint","useBreakpoint","breakpoints","matchedDeviceType","isDesktop","isMobile","_useState","useState","_useState2","_slicedToArray","isVisible","setIsVisible","contrastType","iconSize","textSize","alertColor","Icon","iconOffset","icon","_jsx","marginTop","display","children","size","_title","marginBottom","Heading","type","Text","weight","_description","primaryAction","marginRight","castNativeType","castWebType","BaseButton","onClick","variant","text","secondaryActionParams","href","target","rel","secondaryAction","BaseLink","Object","assign","showActionsHorizontal","actionsHorizontal","_jsxs","flexDirection","alignItems","actionsVertical","onClickDismiss","closeButton","IconButton","accessibilityLabel","CloseIcon","a11yProps","makeAccessible","role","liveRegion","metaAttribute","name","MetaConstants","getStyledProps","StyledAlert","textAlign","flex","paddingLeft","paddingRight"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAA,SAAA,CAAA,CAAA,aAAA,CAAA,OAAA,CAAA,eAAA,CAAA,WAAA,CAAA,UAAA,CAAA,aAAA,CAAA,QAAA,CAAA,OAAA,CAAA,SAAA,CAAA,QAAA,CAAA,CAsHA,IAAMA,aAAa,CAAGC,eAAe,EAAE,GAAK,cAAc,CAG1D,IAAMC,kBAAkB,CAAGF,aAAa,CAAGG,OAAO,CAAGC,QAAQ,CAE7D,IAAMC,aAAa,CAAG,CACpBC,QAAQ,CAAEC,eAAe,CACzBC,QAAQ,CAAEC,iBAAgB,CAC1BC,WAAW,CAAEC,QAAQ,CACrBC,OAAO,CAAED,QAAQ,CACjBE,MAAM,CAAEC,mBACV,CAAC,CAEK,IAAAC,KAAK,CAAG,SAARA,KAAKA,CAAAC,IAAA,CAa4B,CAZrC,IAAAC,WAAW,CAAAD,IAAA,CAAXC,WAAW,CACXC,KAAK,CAAAF,IAAA,CAALE,KAAK,CAAAC,kBAAA,CAAAH,IAAA,CACLI,aAAa,CAAbA,aAAa,CAAAD,kBAAA,GAAG,KAAA,CAAA,CAAA,IAAI,CAAAA,kBAAA,CACpBE,SAAS,CAAAL,IAAA,CAATK,SAAS,CAAAC,aAAA,CAAAN,IAAA,CACTO,QAAQ,CAARA,QAAQ,CAAAD,aAAA,UAAG,KAAK,CAAAA,aAAA,CAAAE,gBAAA,CAAAR,IAAA,CAChBS,WAAW,CAAXA,W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,SAAS,CAAEA,SAAU,CACrB+D,SAAS,CAAE,MAAgB,CAAA7C,QAAA,CAE1BJ,CAAAA,IAAI,CACL+B,IAAA,CAACzF,OAAO,CAAA,CACN4G,IAAI,CAAE,CAAE,CACRC,WAAW,CAAEvF,WAAW,CAAG,WAAW,CAAG,WAAY,CACrDwF,YAAY,CAAEvB,qBAAqB,CAAG,WAAW,CAAG,WAAY,CAAAzB,QAAA,CAAA,CAE/DE,MAAM,CACNM,YAAY,CACZsB,eAAe,CACT,CAAA,CAAC,CACTJ,iBAAiB,CACjBM,WAAW,CAAA,CACD,CAAC,CAAA,CACP,CAAC,CAEd;;;;"}
|
|
1
|
+
{"version":3,"file":"Alert.js","sources":["../../../../../src/components/Alert/Alert.tsx"],"sourcesContent":["import type { ReactChild, ReactElement } from 'react';\nimport { Fragment, useState } from 'react';\n\nimport { StyledAlert } from './StyledAlert';\nimport {\n AlertOctagonIcon,\n AlertTriangleIcon,\n CheckCircleIcon,\n CloseIcon,\n InfoIcon,\n} from '~components/Icons';\nimport { castNativeType, castWebType, useBreakpoint, getPlatformType } from '~utils';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport { IconButton } from '~components/Button/IconButton';\nimport BaseBox from '~components/Box/BaseBox';\nimport { Text } from '~components/Typography';\nimport BaseButton from '~components/Button/BaseButton';\nimport { BaseLink } from '~components/Link/BaseLink';\nimport type { FeedbackColors, SubtleOrIntense } from '~tokens/theme/theme';\nimport { useTheme } from '~components/BladeProvider';\nimport type { DotNotationSpacingStringToken, TestID } from '~utils/types';\nimport { makeAccessible } from '~utils/makeAccessible';\n\ntype PrimaryAction = {\n text: string;\n onClick: () => void;\n};\n\ntype SecondaryActionButton = {\n text: string;\n onClick: () => void;\n};\n\ntype SecondaryActionLinkButton = {\n text: string;\n href: string;\n onClick?: () => void;\n target?: string;\n /**\n * When `target` is set to `_blank` this is automatically set to `noopener noreferrer`\n */\n rel?: string;\n};\n\ntype SecondaryAction = SecondaryActionButton | SecondaryActionLinkButton;\n\ntype AlertProps = {\n /**\n * Body content, pass text or JSX. Avoid passing components except `Link` to customize the content.\n */\n description: ReactChild;\n\n /**\n * A brief heading\n */\n title?: string;\n\n /**\n * Shows a dismiss button\n *\n * @default true\n */\n isDismissible?: boolean;\n\n /**\n * A callback when the dismiss button is clicked\n */\n onDismiss?: () => void;\n\n /**\n * Can be set to `high` for a more prominent look. Not to be confused with a11y emphasis.\n *\n * @default subtle\n */\n emphasis?: SubtleOrIntense;\n\n /**\n * Makes the Alert span the entire container width, instead of the default max width of `584px`.\n * This also makes the alert borderless, useful for creating full bleed layouts.\n *\n * @default false\n */\n isFullWidth?: boolean;\n\n /**\n * Sets the color tone\n */\n color?: FeedbackColors;\n\n /**\n * Renders a primary action button and a secondary action link button\n */\n actions?: {\n /**\n * Renders a button (should **always** be present if `secondary` action is being used)\n */\n primary?: PrimaryAction;\n /**\n * Renders a Link button\n */\n secondary?: SecondaryAction;\n };\n} & TestID &\n StyledPropsBlade;\n\nconst isReactNative = getPlatformType() === 'react-native';\n\n// Need extra wrappers on React Native only for alignment\nconst CloseButtonWrapper = isReactNative ? BaseBox : Fragment;\n\nconst intentIconMap = {\n positive: CheckCircleIcon,\n negative: AlertOctagonIcon,\n information: InfoIcon,\n neutral: InfoIcon,\n notice: AlertTriangleIcon,\n};\n\nconst Alert = ({\n description,\n title,\n isDismissible = true,\n onDismiss,\n emphasis = 'subtle',\n isFullWidth = false,\n color = 'neutral',\n actions,\n testID,\n ...styledProps\n}: AlertProps): ReactElement | null => {\n const { theme } = useTheme();\n const { matchedDeviceType } = useBreakpoint({ breakpoints: theme.breakpoints });\n const [isVisible, setIsVisible] = useState(true);\n\n const isDesktop = matchedDeviceType === 'desktop';\n const isMobile = !isDesktop;\n\n const Icon = intentIconMap[color];\n let iconOffset: DotNotationSpacingStringToken = 'spacing.1';\n\n // certain special cases below needs special care for near perfect alignment\n if (isReactNative) {\n if (isFullWidth && !title) {\n iconOffset = 'spacing.1';\n } else if (!isFullWidth && !title) {\n iconOffset = 'spacing.0';\n } else if (!isFullWidth && title) {\n iconOffset = 'spacing.2';\n }\n } else if (isMobile) {\n if (!isFullWidth && title) {\n iconOffset = 'spacing.2';\n } else if (isFullWidth && !title) {\n iconOffset = 'spacing.2';\n }\n } else if (isFullWidth) {\n iconOffset = 'spacing.1';\n }\n\n const shouldCenterAlign = isFullWidth && !title;\n let alignment: 'center' | 'flex-start' = 'flex-start';\n if (!isFullWidth) alignment = 'flex-start';\n if (shouldCenterAlign) alignment = 'center';\n\n const icon = (\n <BaseBox display=\"flex\" alignSelf={alignment} marginTop={iconOffset}>\n <Icon\n color={\n emphasis === 'intense'\n ? 'surface.icon.staticWhite.normal'\n : `feedback.icon.${color}.${emphasis === 'subtle' ? 'intense' : 'subtle'}`\n }\n size=\"medium\"\n />\n </BaseBox>\n );\n\n const textColor =\n emphasis === 'intense' ? 'surface.text.staticWhite.normal' : 'surface.text.gray.subtle';\n const _title = title ? (\n <BaseBox marginBottom=\"spacing.2\">\n <Text color={textColor} size=\"medium\" weight=\"semibold\">\n {title}\n </Text>\n </BaseBox>\n ) : null;\n\n const _description = (\n <BaseBox marginTop={title || isReactNative ? 'spacing.0' : 'spacing.1'}>\n <Text color={textColor} size=\"small\">\n {description}\n </Text>\n </BaseBox>\n );\n\n const primaryAction = actions?.primary ? (\n <BaseBox\n marginRight=\"spacing.5\"\n display={isReactNative ? castNativeType('flex') : castWebType('inline-flex')}\n >\n <BaseButton\n size=\"small\"\n onClick={actions.primary.onClick}\n color={emphasis === 'intense' ? 'white' : color}\n variant=\"secondary\"\n >\n {actions.primary.text}\n </BaseButton>\n </BaseBox>\n ) : null;\n\n const secondaryActionParams: Partial<SecondaryActionLinkButton> | null = actions?.secondary\n ? {\n onClick: actions.secondary.onClick,\n }\n : null;\n\n /**\n * TS assumes only common properties to be present for `SecondaryAction` union type\n * We add a type guard that checks if href is present on secondary action:\n * - If yes, then TS can assume it to be `SecondaryActionLinkButton` (href being a required property)\n * - If no, then it would be `SecondaryActionButton` (and link properties wouldn't be needed)\n */\n if (actions?.secondary && secondaryActionParams && 'href' in actions.secondary) {\n secondaryActionParams.href = actions.secondary.href;\n secondaryActionParams.target = actions.secondary.target;\n secondaryActionParams.rel = actions.secondary.rel;\n }\n\n const secondaryAction = actions?.secondary ? (\n <BaseBox marginRight=\"spacing.4\" display={(isReactNative ? 'flex' : 'inline-flex') as never}>\n <BaseLink\n size=\"small\"\n color={emphasis === 'intense' ? 'white' : color}\n {...secondaryActionParams}\n >\n {actions.secondary.text}\n </BaseLink>\n </BaseBox>\n ) : null;\n\n // For certain cases we wish to render actions inline with text content\n const showActionsHorizontal = isFullWidth && isDesktop;\n\n const actionsHorizontal =\n showActionsHorizontal && (primaryAction || secondaryAction) ? (\n <BaseBox flexDirection=\"row\" alignItems=\"center\">\n {primaryAction}\n {secondaryAction}\n </BaseBox>\n ) : null;\n\n const actionsVertical =\n !showActionsHorizontal && (primaryAction || secondaryAction) ? (\n <BaseBox marginTop=\"spacing.4\" flexDirection=\"row\" alignItems=\"center\">\n {primaryAction}\n {secondaryAction}\n </BaseBox>\n ) : null;\n\n const onClickDismiss = (): void => {\n if (onDismiss) {\n onDismiss();\n }\n setIsVisible(false);\n };\n const closeButton = isDismissible ? (\n <CloseButtonWrapper>\n <IconButton\n accessibilityLabel=\"Dismiss alert\"\n onClick={onClickDismiss}\n emphasis={emphasis === 'intense' ? 'subtle' : 'intense'}\n size=\"large\"\n icon={CloseIcon}\n />\n </CloseButtonWrapper>\n ) : null;\n\n const a11yProps = makeAccessible({\n // React Native doesn't has status as role\n role: isReactNative || color === 'negative' || color === 'notice' ? 'alert' : 'status',\n // override the implicit live region of role `alert`\n ...(color === 'notice' && { liveRegion: 'polite' }),\n });\n\n if (!isVisible) {\n return null;\n }\n\n return (\n <BaseBox\n {...a11yProps}\n {...metaAttribute({ name: MetaConstants.Alert, testID })}\n {...getStyledProps(styledProps)}\n >\n <StyledAlert\n color={color}\n emphasis={emphasis}\n isFullWidth={isFullWidth}\n isDesktop={isDesktop}\n textAlign={'left' as never}\n >\n {icon}\n <BaseBox\n flex={1}\n paddingLeft={isFullWidth ? 'spacing.4' : 'spacing.3'}\n paddingRight={showActionsHorizontal ? 'spacing.4' : 'spacing.2'}\n >\n {_title}\n {_description}\n {actionsVertical}\n </BaseBox>\n {actionsHorizontal}\n {closeButton}\n </StyledAlert>\n </BaseBox>\n );\n};\n\nexport type { AlertProps };\nexport { Alert };\n"],"names":["isReactNative","getPlatformType","CloseButtonWrapper","BaseBox","Fragment","intentIconMap","positive","CheckCircleIcon","negative","AlertOctagonIcon","information","InfoIcon","neutral","notice","AlertTriangleIcon","Alert","_ref","description","title","_ref$isDismissible","isDismissible","onDismiss","_ref$emphasis","emphasis","_ref$isFullWidth","isFullWidth","_ref$color","color","actions","testID","styledProps","_objectWithoutProperties","_excluded","_useTheme","useTheme","theme","_useBreakpoint","useBreakpoint","breakpoints","matchedDeviceType","_useState","useState","_useState2","_slicedToArray","isVisible","setIsVisible","isDesktop","isMobile","Icon","iconOffset","shouldCenterAlign","alignment","icon","_jsx","display","alignSelf","marginTop","children","size","textColor","_title","marginBottom","Text","weight","_description","primaryAction","primary","marginRight","castNativeType","castWebType","BaseButton","onClick","variant","text","secondaryActionParams","secondary","href","target","rel","secondaryAction","BaseLink","Object","assign","showActionsHorizontal","actionsHorizontal","_jsxs","flexDirection","alignItems","actionsVertical","onClickDismiss","closeButton","IconButton","accessibilityLabel","CloseIcon","a11yProps","makeAccessible","role","liveRegion","metaAttribute","name","MetaConstants","getStyledProps","StyledAlert","textAlign","flex","paddingLeft","paddingRight"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAA,SAAA,CAAA,CAAA,aAAA,CAAA,OAAA,CAAA,eAAA,CAAA,WAAA,CAAA,UAAA,CAAA,aAAA,CAAA,OAAA,CAAA,SAAA,CAAA,Q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D,SAAS,CAAE,CACd,OAAW,IAAA,CACb,CAEA,OACES,GAAA,CAAClD,OAAO,CAAA8E,MAAA,CAAAC,MAAA,CAAA,EAAA,CACFY,SAAS,CACTI,aAAa,CAAC,CAAEC,IAAI,CAAEC,aAAa,CAACrF,KAAK,CAAEc,MAAM,CAANA,MAAO,CAAC,CAAC,CACpDwE,cAAc,CAACvE,WAAW,CAAC,CAAA2B,CAAAA,QAAA,CAE/B4B,IAAA,CAACiB,WAAW,EACV3E,KAAK,CAAEA,KAAM,CACbJ,QAAQ,CAAEA,QAAS,CACnBE,WAAW,CAAEA,WAAY,CACzBqB,SAAS,CAAEA,SAAU,CACrByD,SAAS,CAAE,MAAgB,CAAA9C,QAAA,CAE1BL,CAAAA,IAAI,CACLiC,IAAA,CAAClF,OAAO,CACNqG,CAAAA,IAAI,CAAE,CAAE,CACRC,WAAW,CAAEhF,WAAW,CAAG,WAAW,CAAG,WAAY,CACrDiF,YAAY,CAAEvB,qBAAqB,CAAG,WAAW,CAAG,WAAY,CAAA1B,QAAA,CAAA,CAE/DG,MAAM,CACNI,YAAY,CACZwB,eAAe,CACT,CAAA,CAAC,CACTJ,iBAAiB,CACjBM,WAAW,CAAA,CACD,CAAC,CAAA,CACP,CAAC,CAEd;;;;"}
|
|
@@ -5,7 +5,7 @@ import '../../tokens/global/typography.js';
|
|
|
5
5
|
import '../../tokens/global/motion.js';
|
|
6
6
|
import { size } from '../../tokens/global/size.js';
|
|
7
7
|
|
|
8
|
-
var MAX_WIDTH=size[584];var getCommonStyles=function getCommonStyles(props){var theme=props.theme,
|
|
8
|
+
var MAX_WIDTH=size[584];var getCommonStyles=function getCommonStyles(props){var theme=props.theme,emphasis=props.emphasis,color=props.color,isFullWidth=props.isFullWidth,isDesktop=props.isDesktop;return {background:theme.colors.feedback.background[color][emphasis],padding:makeSpace(theme.spacing[4]),borderRadius:makeBorderSize(isFullWidth?theme.border.radius.none:theme.border.radius.medium),display:'flex',flexDirection:'row',maxWidth:isFullWidth?'auto':makeSize(MAX_WIDTH),width:isFullWidth?'100%':undefined,alignItems:isFullWidth&&isDesktop?'center':'flex-start',boxSizing:'border-box'};};
|
|
9
9
|
|
|
10
10
|
export { getCommonStyles };
|
|
11
11
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sources":["../../../../../src/components/Alert/styles.ts"],"sourcesContent":["import type { CSSObject, StyledProps } from 'styled-components';\n\nimport type { StyledAlertProps } from './types';\nimport { makeSpace } from '~utils/makeSpace';\nimport { makeSize } from '~utils/makeSize';\nimport { makeBorderSize } from '~utils/makeBorderSize';\nimport { size } from '~tokens/global';\n\nconst MAX_WIDTH = size[584];\n\nexport const getCommonStyles = (props: StyledProps<StyledAlertProps>): CSSObject => {\n const { theme,
|
|
1
|
+
{"version":3,"file":"styles.js","sources":["../../../../../src/components/Alert/styles.ts"],"sourcesContent":["import type { CSSObject, StyledProps } from 'styled-components';\n\nimport type { StyledAlertProps } from './types';\nimport { makeSpace } from '~utils/makeSpace';\nimport { makeSize } from '~utils/makeSize';\nimport { makeBorderSize } from '~utils/makeBorderSize';\nimport { size } from '~tokens/global';\n\nconst MAX_WIDTH = size[584];\n\nexport const getCommonStyles = (props: StyledProps<StyledAlertProps>): CSSObject => {\n const { theme, emphasis, color, isFullWidth, isDesktop } = props;\n\n return {\n background: theme.colors.feedback.background[color][emphasis],\n padding: makeSpace(theme.spacing[4]),\n borderRadius: makeBorderSize(\n isFullWidth ? theme.border.radius.none : theme.border.radius.medium,\n ),\n display: 'flex',\n flexDirection: 'row',\n maxWidth: isFullWidth ? 'auto' : makeSize(MAX_WIDTH),\n width: isFullWidth ? '100%' : undefined,\n alignItems: isFullWidth && isDesktop ? 'center' : 'flex-start',\n boxSizing: 'border-box',\n };\n};\n"],"names":["MAX_WIDTH","size","getCommonStyles","props","theme","emphasis","color","isFullWidth","isDesktop","background","colors","feedback","padding","makeSpace","spacing","borderRadius","makeBorderSize","border","radius","none","medium","display","flexDirection","maxWidth","makeSize","width","undefined","alignItems","boxSizing"],"mappings":";;;;;;;AAQA,IAAMA,SAAS,CAAGC,IAAI,CAAC,GAAG,CAAC,CAEd,IAAAC,eAAe,CAAG,SAAlBA,eAAeA,CAAIC,KAAoC,CAAgB,CAClF,IAAQC,KAAK,CAA8CD,KAAK,CAAxDC,KAAK,CAAEC,QAAQ,CAAoCF,KAAK,CAAjDE,QAAQ,CAAEC,KAAK,CAA6BH,KAAK,CAAvCG,KAAK,CAAEC,WAAW,CAAgBJ,KAAK,CAAhCI,WAAW,CAAEC,SAAS,CAAKL,KAAK,CAAnBK,SAAS,CAEtD,OAAO,CACLC,UAAU,CAAEL,KAAK,CAACM,MAAM,CAACC,QAAQ,CAACF,UAAU,CAACH,KAAK,CAAC,CAACD,QAAQ,CAAC,CAC7DO,OAAO,CAAEC,SAAS,CAACT,KAAK,CAACU,OAAO,CAAC,CAAC,CAAC,CAAC,CACpCC,YAAY,CAAEC,cAAc,CAC1BT,WAAW,CAAGH,KAAK,CAACa,MAAM,CAACC,MAAM,CAACC,IAAI,CAAGf,KAAK,CAACa,MAAM,CAACC,MAAM,CAACE,MAC/D,CAAC,CACDC,OAAO,CAAE,MAAM,CACfC,aAAa,CAAE,KAAK,CACpBC,QAAQ,CAAEhB,WAAW,CAAG,MAAM,CAAGiB,QAAQ,CAACxB,SAAS,CAAC,CACpDyB,KAAK,CAAElB,WAAW,CAAG,MAAM,CAAGmB,SAAS,CACvCC,UAAU,CAAEpB,WAAW,EAAIC,SAAS,CAAG,QAAQ,CAAG,YAAY,CAC9DoB,SAAS,CAAE,YACb,CAAC,CACH;;;;"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
2
2
|
import React__default from 'react';
|
|
3
|
-
import {
|
|
4
|
-
import { BaseText } from '../Typography/BaseText/BaseText.native.js';
|
|
3
|
+
import { currencyIndicatorMapping, subtleFontSizes, normalAmountSizes, amountLineHeights, currencyPositionMapping, getCurrencyAbbreviations } from './amountTokens.js';
|
|
5
4
|
import { BaseBox } from '../Box/BaseBox/BaseBox.native.js';
|
|
6
5
|
import 'react-native';
|
|
7
6
|
import { getPlatformType } from '../../utils/getPlatformType/getPlatformType.js';
|
|
@@ -11,12 +10,17 @@ import '../BladeProvider/useTheme.js';
|
|
|
11
10
|
import { metaAttribute } from '../../utils/metaAttribute/metaAttribute.native.js';
|
|
12
11
|
import { MetaConstants } from '../../utils/metaAttribute/metaConstants.js';
|
|
13
12
|
import { getStyledProps } from '../Box/styledProps/getStyledProps.js';
|
|
13
|
+
import { opacity } from '../../tokens/global/opacity.js';
|
|
14
14
|
import '../../tokens/global/typography.js';
|
|
15
15
|
import '../../tokens/global/motion.js';
|
|
16
16
|
import { assignWithoutSideEffects } from '../../utils/assignWithoutSideEffects/assignWithoutSideEffects.js';
|
|
17
|
+
import { objectKeysWithType } from '../../utils/objectKeysWithType.js';
|
|
18
|
+
import { BaseText } from '../Typography/BaseText/BaseText.native.js';
|
|
17
19
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
20
|
+
import { Text } from '../Typography/Text/Text.js';
|
|
21
|
+
import '../Typography/Code/Code.js';
|
|
18
22
|
|
|
19
|
-
var _excluded=["value","suffix","size","isAffixSubtle","
|
|
23
|
+
var _excluded=["value","suffix","type","size","weight","isAffixSubtle","isStrikethrough","color","currencyIndicator","currency","testID"];var getTextColorProps=function getTextColorProps(_ref){var color=_ref.color;var props={amountValueColor:'surface.text.gray.normal'};if(!color)return props;props.amountValueColor=color;return props;};var AmountValue=function AmountValue(_ref2){var value=_ref2.value,_ref2$size=_ref2.size,size=_ref2$size===void 0?'medium':_ref2$size,_ref2$type=_ref2.type,type=_ref2$type===void 0?'body':_ref2$type,_ref2$weight=_ref2.weight,weight=_ref2$weight===void 0?'regular':_ref2$weight,amountValueColor=_ref2.amountValueColor,isAffixSubtle=_ref2.isAffixSubtle,suffix=_ref2.suffix;var isReactNative=getPlatformType()==='react-native';var affixFontSize=isAffixSubtle?subtleFontSizes[type][size]:normalAmountSizes[type][size];var numberFontFamily=type==='body'?'text':'heading';if(suffix==='decimals'&&isAffixSubtle){var integer=value.split('.')[0];var decimal=value.split('.')[1];var AmountWrapper=isReactNative?Text:React__default.Fragment;return jsxs(AmountWrapper,{children:[jsx(BaseText,{fontSize:normalAmountSizes[type][size],fontWeight:weight,lineHeight:amountLineHeights[type][size],color:amountValueColor,fontFamily:numberFontFamily,as:isReactNative?undefined:'span',children:integer}),jsxs(BaseText,{fontWeight:weight,fontSize:affixFontSize,fontFamily:numberFontFamily,color:amountValueColor,as:isReactNative?undefined:'span',opacity:isAffixSubtle?opacity[8]:1,children:[".",decimal||'00']})]});}return jsx(BaseText,{fontSize:normalAmountSizes[type][size],fontWeight:weight,fontFamily:numberFontFamily,color:amountValueColor,lineHeight:amountLineHeights[type][size],children:value});};var getFlooredFixed=function getFlooredFixed(value,decimalPlaces){var factor=100**decimalPlaces;var roundedValue=Math.floor(value*factor)/factor;return Number(roundedValue.toFixed(decimalPlaces));};var addCommas=function addCommas(amountValue,currency){var decimalPlaces=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var locale=currency==='INR'?'en-IN':'en-US';return amountValue.toLocaleString(locale,{minimumFractionDigits:decimalPlaces});};var getHumanizedAmount=function getHumanizedAmount(_ref3){var value=_ref3.value,currency=_ref3.currency,_ref3$denominationPos=_ref3.denominationPosition,denominationPosition=_ref3$denominationPos===void 0?'right':_ref3$denominationPos;var amountValue=value;var abbreviations=getCurrencyAbbreviations(currency);var abbreviation=abbreviations.find(function(abbr){return amountValue>=abbr.value;});if(abbreviation){amountValue=amountValue/abbreviation.value;var formattedAmountValue=getFlooredFixed(amountValue,2);if(denominationPosition==='right'){return `${addCommas(formattedAmountValue,currency)}${abbreviation.symbol}`;}return `${abbreviation.symbol}${addCommas(formattedAmountValue,currency)}`;}return amountValue.toString();};var formatAmountWithSuffix=function formatAmountWithSuffix(_ref4){var suffix=_ref4.suffix,value=_ref4.value,currency=_ref4.currency,denominationPosition=_ref4.denominationPosition;switch(suffix){case'decimals':{var decimalNumber=getFlooredFixed(value,2);return addCommas(decimalNumber,currency,2);}case'humanize':{return getHumanizedAmount({value:value,currency:currency,denominationPosition:denominationPosition});}case'none':{return addCommas(getFlooredFixed(value,0),currency);}default:return addCommas(getFlooredFixed(value,0),currency);}};var _Amount=function _Amount(_ref5){var value=_ref5.value,_ref5$suffix=_ref5.suffix,suffix=_ref5$suffix===void 0?'decimals':_ref5$suffix,_ref5$type=_ref5.type,type=_ref5$type===void 0?'body':_ref5$type,_ref5$size=_ref5.size,size=_ref5$size===void 0?'medium':_ref5$size,_ref5$weight=_ref5.weight,weight=_ref5$weight===void 0?'regular':_ref5$weight,_ref5$isAffixSubtle=_ref5.isAffixSubtle,isAffixSubtle=_ref5$isAffixSubtle===void 0?true:_ref5$isAffixSubtle,_ref5$isStrikethrough=_ref5.isStrikethrough,isStrikethrough=_ref5$isStrikethrough===void 0?false:_ref5$isStrikethrough,color=_ref5.color,_ref5$currencyIndicat=_ref5.currencyIndicator,currencyIndicator=_ref5$currencyIndicat===void 0?'currency-symbol':_ref5$currencyIndicat,_ref5$currency=_ref5.currency,currency=_ref5$currency===void 0?'INR':_ref5$currency,testID=_ref5.testID,styledProps=_objectWithoutProperties(_ref5,_excluded);if(__DEV__){if(typeof value!=='number'){throwBladeError({message:'`value` prop must be of type `number` for Amount.',moduleName:'Amount'});}if(color==='neutral'){throwBladeError({message:'`neutral` color is not supported.',moduleName:'Amount'});}var bodySizes=objectKeysWithType(normalAmountSizes.body);if((type==='body'||!type)&&!bodySizes.includes(size)){throwBladeError({message:`size="${size}" is not allowed with type="body"`,moduleName:'Amount'});}var displaySizes=objectKeysWithType(normalAmountSizes.display);if(type==='display'&&!displaySizes.includes(size)){throwBladeError({message:`size="${size}" is not allowed with type="display"`,moduleName:'Amount'});}var headingSizes=objectKeysWithType(normalAmountSizes.heading);if(type==='heading'&&!headingSizes.includes(size)){throwBladeError({message:`size="${size}" is not allowed with type="heading"`,moduleName:'Amount'});}}var currencySymbolOrCode=currencyIndicatorMapping[currency][currencyIndicator];var currencyPosition=currencyPositionMapping[currency]||'left';var denominationPosition=currencyPosition==='left'?'right':'left';var renderedValue=formatAmountWithSuffix({suffix:suffix,value:value,currency:currency,denominationPosition:denominationPosition});var _getTextColorProps=getTextColorProps({color:color}),amountValueColor=_getTextColorProps.amountValueColor;var currencyFontSize=isAffixSubtle?subtleFontSizes[type][size]:normalAmountSizes[type][size];var isReactNative=getPlatformType()==='react-native';return jsx(BaseBox,Object.assign({display:isReactNative?'flex':'inline-flex',flexDirection:"row"},metaAttribute({name:MetaConstants.Amount,testID:testID}),getStyledProps(styledProps),{children:jsxs(BaseBox,{display:isReactNative?'flex':'inline-flex',alignItems:"baseline",flexDirection:"row",position:"relative",children:[currencyPosition==='left'&&jsx(BaseText,{marginRight:"spacing.1",fontWeight:weight,fontSize:currencyFontSize,color:amountValueColor,as:isReactNative?undefined:'span',opacity:isAffixSubtle?opacity[8]:1,children:currencySymbolOrCode}),jsx(AmountValue,{value:renderedValue,amountValueColor:amountValueColor,type:type,weight:weight,size:size,isAffixSubtle:isAffixSubtle,suffix:suffix}),currencyPosition==='right'&&jsx(BaseText,{marginLeft:"spacing.1",fontWeight:weight,fontSize:currencyFontSize,color:amountValueColor,as:isReactNative?undefined:'span',opacity:isAffixSubtle?opacity[8]:1,children:currencySymbolOrCode}),isStrikethrough&&jsx(BaseBox,{borderBottomColor:amountValueColor,borderBottomWidth:type==='body'?'thin':'thicker',borderBottomStyle:"solid",position:"absolute",width:"100%",top:"50%"})]})}));};var Amount=assignWithoutSideEffects(_Amount,{displayName:'Amount',componentId:'Amount'});
|
|
20
24
|
|
|
21
25
|
export { Amount, addCommas, formatAmountWithSuffix, getFlooredFixed, getHumanizedAmount };
|
|
22
26
|
//# sourceMappingURL=Amount.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Amount.js","sources":["../../../../../src/components/Amount/Amount.tsx"],"sourcesContent":["import type { ReactElement } from 'react';\nimport React from 'react';\nimport type { Currency } from './amountTokens';\nimport {\n amountFontSizes,\n getCurrencyAbbreviations,\n currencyPrefixMapping,\n affixFontSizes,\n amountLineHeights,\n} from './amountTokens';\nimport { BaseText } from '~components/Typography/BaseText';\nimport type { Feedback } from '~tokens/theme/theme';\nimport type { BaseTextProps } from '~components/Typography/BaseText/types';\nimport BaseBox from '~components/Box/BaseBox';\nimport type { TestID } from '~utils/types';\nimport { getPlatformType } from '~utils';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { throwBladeError } from '~utils/logger';\n\ntype AmountProps = {\n /**\n * The value to be rendered within the component.\n *\n */\n value: number;\n /**\n * Sets the intent of the amount.\n *\n * @default undefined\n */\n intent?: Exclude<Feedback, 'neutral'>;\n /**\n * Sets the size of the amount.\n *\n * @default 'body-medium'\n */\n size?:\n | 'body-medium-bold'\n | 'body-small'\n | 'body-small-bold'\n | 'body-medium'\n | 'body-medium-bold'\n | 'heading-small'\n | 'heading-small-bold'\n | 'heading-large'\n | 'heading-large-bold'\n | 'title-small'\n | 'title-medium';\n /**\n * Indicates what the suffix of amount should be\n *\n * @default 'decimals'\n */\n suffix?: 'decimals' | 'none' | 'humanize';\n /**\n * Makes the prefix symbol and decimal digits small and faded\n *\n * @default true\n */\n isAffixSubtle?: true | false;\n /**\n * Prefix to be shown before the amount value. The prefix can be either a currency symbol or a currency code.\n *\n * @default 'currency-symbol'\n */\n prefix?: 'currency-symbol' | 'currency-code';\n /**\n * The currency of the amount. Note that this component\n * only displays the provided value in the specified currency, it does not perform any currency conversion.\n *\n * @default 'INR'\n * */\n currency?: Currency;\n} & TestID &\n StyledPropsBlade;\n\ntype ColorProps = {\n amountValueColor: BaseTextProps['color'];\n affixColor: BaseTextProps['color'];\n};\n\nconst getTextColorProps = ({ intent }: { intent: AmountProps['intent'] }): ColorProps => {\n const props: ColorProps = {\n amountValueColor: 'surface.text.normal.lowContrast',\n affixColor: 'surface.text.muted.lowContrast',\n };\n if (!intent) return props;\n props.amountValueColor = `feedback.text.${intent}.lowContrast`;\n props.affixColor = `feedback.text.${intent}.lowContrast`;\n return props;\n};\n\ninterface AmountValue extends Omit<AmountProps, 'value'> {\n affixColor: BaseTextProps['color'];\n amountValueColor: BaseTextProps['color'];\n value: string;\n size: Exclude<AmountProps['size'], undefined>;\n}\n\nconst AmountValue = ({\n value,\n size,\n amountValueColor,\n isAffixSubtle,\n suffix,\n affixColor,\n}: AmountValue): ReactElement => {\n const affixFontWeight = isAffixSubtle ? 'regular' : 'bold';\n const isReactNative = getPlatformType() === 'react-native';\n const affixFontSize = isAffixSubtle ? affixFontSizes[size] : amountFontSizes[size];\n const valueForWeight = size.includes('bold') || size.startsWith('title') ? 'bold' : 'regular';\n if (suffix === 'decimals' && isAffixSubtle) {\n const integer = value.split('.')[0];\n const decimal = value.split('.')[1];\n\n // Native does not support alignItems of Text inside a div, insted we need to wrap is in a Text\n const AmountWrapper = getPlatformType() === 'react-native' ? BaseText : React.Fragment;\n\n return (\n <AmountWrapper>\n <BaseText\n fontSize={amountFontSizes[size]}\n fontWeight={valueForWeight}\n lineHeight={amountLineHeights[size]}\n color={amountValueColor}\n as={isReactNative ? undefined : 'span'}\n >\n {integer}.\n </BaseText>\n <BaseText\n marginLeft=\"spacing.1\"\n fontWeight={affixFontWeight}\n fontSize={affixFontSize}\n color={affixColor}\n as={isReactNative ? undefined : 'span'}\n >\n {decimal || '00'}\n </BaseText>\n </AmountWrapper>\n );\n }\n return (\n <BaseText\n fontSize={amountFontSizes[size]}\n fontWeight={valueForWeight}\n color={amountValueColor}\n lineHeight={amountLineHeights[size]}\n >\n {value}\n </BaseText>\n );\n};\n\n// This function rounds a number to a specified number of decimal places\n// and floors the result.\nexport const getFlooredFixed = (value: number, decimalPlaces: number): number => {\n const factor = 100 ** decimalPlaces;\n const roundedValue = Math.floor(value * factor) / factor;\n return Number(roundedValue.toFixed(decimalPlaces));\n};\n\nexport const addCommas = (amountValue: number, currency: Currency, decimalPlaces = 0): string => {\n // If the currency is 'INR', set the locale to 'en-IN' (Indian English).\n // Otherwise, set the locale to 'en-US' (U.S. English).\n const locale = currency === 'INR' ? 'en-IN' : 'en-US';\n return amountValue.toLocaleString(locale, { minimumFractionDigits: decimalPlaces });\n};\n/**\n * This function returns the humanized amount\n * ie: for INR 2000 => 2K\n * for MYR 2000000 => 2M\n */\nexport const getHumanizedAmount = (amountValue: number, currency: Currency): string => {\n const abbreviations = getCurrencyAbbreviations(currency);\n\n const abbreviation = abbreviations.find((abbr) => amountValue >= abbr.value);\n if (abbreviation) {\n amountValue = amountValue / abbreviation.value;\n const formattedAmountValue = getFlooredFixed(amountValue, 2);\n return addCommas(formattedAmountValue, currency) + abbreviation.symbol;\n } else {\n return amountValue.toString();\n }\n};\n\ntype FormatAmountWithSuffixType = {\n suffix: AmountProps['suffix'];\n value: number;\n currency: Currency;\n};\n\nexport const formatAmountWithSuffix = ({\n suffix,\n value,\n currency,\n}: FormatAmountWithSuffixType): string => {\n switch (suffix) {\n case 'decimals': {\n const decimalNumber = getFlooredFixed(value, 2);\n return addCommas(decimalNumber, currency, 2);\n }\n case 'humanize': {\n return getHumanizedAmount(value, currency);\n }\n case 'none': {\n return addCommas(getFlooredFixed(value, 0), currency);\n }\n default:\n return addCommas(getFlooredFixed(value, 0), currency);\n }\n};\n\nconst getCurrencyWeight = (\n isAffixSubtle: NonNullable<AmountProps['isAffixSubtle']>,\n size: NonNullable<AmountProps['size']>,\n): 'bold' | 'regular' => {\n if (isAffixSubtle || size.startsWith('bold')) return 'bold';\n return 'regular';\n};\n\nconst _Amount = ({\n value,\n suffix = 'decimals',\n size = 'body-medium',\n isAffixSubtle = true,\n intent,\n prefix = 'currency-symbol',\n testID,\n currency = 'INR',\n ...styledProps\n}: AmountProps): ReactElement => {\n if (__DEV__) {\n if (typeof value !== 'number') {\n throwBladeError({\n message: '`value` prop must be of type `number` for Amount.',\n moduleName: 'Amount',\n });\n }\n // @ts-expect-error neutral intent should throw error\n if (intent === 'neutral') {\n throwBladeError({\n message: '`neutral` intent is not supported.',\n moduleName: 'Amount',\n });\n }\n }\n\n const currencyPrefix = currencyPrefixMapping[currency][prefix];\n const renderedValue = formatAmountWithSuffix({ suffix, value, currency });\n const { amountValueColor, affixColor } = getTextColorProps({\n intent,\n });\n\n const currencyColor = isAffixSubtle ? affixColor : amountValueColor;\n const currencyFontSize = isAffixSubtle ? affixFontSizes[size] : amountFontSizes[size];\n const currencyWeight = getCurrencyWeight(isAffixSubtle, size);\n const isReactNative = getPlatformType() === 'react-native';\n\n return (\n <BaseBox\n display={(isReactNative ? 'flex' : 'inline-flex') as never}\n {...metaAttribute({ name: MetaConstants.Amount, testID })}\n {...getStyledProps(styledProps)}\n >\n <BaseBox\n display={(isReactNative ? 'flex' : 'inline-flex') as never}\n alignItems=\"baseline\"\n flexDirection=\"row\"\n >\n <BaseText\n marginRight=\"spacing.1\"\n fontWeight={currencyWeight}\n fontSize={currencyFontSize}\n color={currencyColor}\n as={isReactNative ? undefined : 'span'}\n >\n {currencyPrefix}\n </BaseText>\n <AmountValue\n value={renderedValue}\n amountValueColor={amountValueColor}\n size={size}\n isAffixSubtle={isAffixSubtle}\n suffix={suffix}\n affixColor={affixColor}\n />\n </BaseBox>\n </BaseBox>\n );\n};\n\nconst Amount = assignWithoutSideEffects(_Amount, {\n displayName: 'Amount',\n componentId: 'Amount',\n});\n\nexport type { AmountProps };\nexport { Amount };\n"],"names":["getTextColorProps","_ref","intent","props","amountValueColor","affixColor","AmountValue","_ref2","value","size","isAffixSubtle","suffix","affixFontWeight","isReactNative","getPlatformType","affixFontSize","affixFontSizes","amountFontSizes","valueForWeight","includes","startsWith","integer","split","decimal","AmountWrapper","BaseText","React","Fragment","_jsxs","children","fontSize","fontWeight","lineHeight","amountLineHeights","color","as","undefined","_jsx","marginLeft","getFlooredFixed","decimalPlaces","factor","roundedValue","Math","floor","Number","toFixed","addCommas","amountValue","currency","arguments","length","locale","toLocaleString","minimumFractionDigits","getHumanizedAmount","abbreviations","getCurrencyAbbreviations","abbreviation","find","abbr","formattedAmountValue","symbol","toString","formatAmountWithSuffix","_ref3","decimalNumber","getCurrencyWeight","_Amount","_ref4","_ref4$suffix","_ref4$size","_ref4$isAffixSubtle","_ref4$prefix","prefix","testID","_ref4$currency","styledProps","_objectWithoutProperties","_excluded","__DEV__","throwBladeError","message","moduleName","currencyPrefix","currencyPrefixMapping","renderedValue","_getTextColorProps","currencyColor","currencyFontSize","currencyWeight","BaseBox","Object","assign","display","metaAttribute","name","MetaConstants","Amount","getStyledProps","alignItems","flexDirection","marginRight","assignWithoutSideEffects","displayName","componentId"],"mappings":";;;;;;;;;;;;;;;;;;AACA,IAAA,SAAA,CAAA,CAAA,OAAA,CAAA,QAAA,CAAA,MAAA,CAAA,eAAA,CAAA,QAAA,CAAA,QAAA,CAAA,QAAA,CAAA,UAAA,CAAA,CAmFA,IAAMA,iBAAiB,CAAG,SAApBA,iBAAiBA,CAAAC,IAAA,CAAkE,CAA5D,IAAAC,MAAM,CAAAD,IAAA,CAANC,MAAM,CACjC,IAAMC,KAAiB,CAAG,CACxBC,gBAAgB,CAAE,iCAAiC,CACnDC,UAAU,CAAE,gCACd,CAAC,CACD,GAAI,CAACH,MAAM,CAAE,OAAOC,KAAK,CACzBA,KAAK,CAACC,gBAAgB,CAAI,CAAA,cAAA,EAAgBF,MAAO,CAAa,YAAA,CAAA,CAC9DC,KAAK,CAACE,UAAU,CAAI,CAAgBH,cAAAA,EAAAA,MAAO,cAAa,CACxD,OAAOC,KAAK,CACd,CAAC,CASD,IAAMG,WAAW,CAAG,SAAdA,WAAWA,CAAAC,KAAA,CAOgB,KAN/BC,KAAK,CAAAD,KAAA,CAALC,KAAK,CACLC,IAAI,CAAAF,KAA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K,CAAEsD,aAAc,CACrBrD,EAAE,CAAEtB,aAAa,CAAGuB,SAAS,CAAG,MAAO,CAAAP,QAAA,CAEtCuD,cAAc,CACP,CAAC,CACX/C,GAAA,CAAC/B,WAAW,CACVE,CAAAA,KAAK,CAAE8E,aAAc,CACrBlF,gBAAgB,CAAEA,gBAAiB,CACnCK,IAAI,CAAEA,IAAK,CACXC,aAAa,CAAEA,aAAc,CAC7BC,MAAM,CAAEA,MAAO,CACfN,UAAU,CAAEA,UAAW,CACxB,CAAC,CAAA,CACK,CAAC,CAAA,CACH,CAAC,CAEd,CAAC,CAEK,IAAA6F,MAAM,CAAGK,wBAAwB,CAACnC,OAAO,CAAE,CAC/CoC,WAAW,CAAE,QAAQ,CACrBC,WAAW,CAAE,QACf,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"Amount.js","sources":["../../../../../src/components/Amount/Amount.tsx"],"sourcesContent":["import type { ReactElement } from 'react';\nimport React from 'react';\nimport type { AmountTypeProps, Currency } from './amountTokens';\nimport {\n normalAmountSizes,\n getCurrencyAbbreviations,\n currencyIndicatorMapping,\n subtleFontSizes,\n amountLineHeights,\n currencyPositionMapping,\n} from './amountTokens';\nimport type { BaseTextProps } from '~components/Typography/BaseText/types';\nimport BaseBox from '~components/Box/BaseBox';\nimport type { TestID } from '~utils/types';\nimport { getPlatformType } from '~utils';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { throwBladeError } from '~utils/logger';\nimport { objectKeysWithType } from '~utils/objectKeysWithType';\nimport { BaseText } from '~components/Typography/BaseText';\nimport { Text } from '~components/Typography';\nimport { opacity } from '~tokens/global';\nimport type { FontFamily } from '~tokens/global';\n\ntype AmountCommonProps = {\n /**\n * The value to be rendered within the component.\n *\n */\n value: number;\n /**\n * Sets the color of the amount.\n *\n * @default undefined\n */\n color?: BaseTextProps['color'];\n /**\n * Indicates what the suffix of amount should be\n *\n * @default 'decimals'\n */\n suffix?: 'decimals' | 'none' | 'humanize';\n /**\n * Makes the currency indicator(currency symbol/code) and decimal digits small and faded\n *\n * @default true\n */\n isAffixSubtle?: true | false;\n /**\n * Determines the visual representation of the currency, choose between displaying the currency symbol or code.\n *\n * @default 'currency-symbol'\n */\n currencyIndicator?: 'currency-symbol' | 'currency-code';\n /**\n * The currency of the amount. Note that this component\n * only displays the provided value in the specified currency, it does not perform any currency conversion.\n *\n * @default 'INR'\n * */\n currency?: Currency;\n /**\n * If true, the amount text will have a line through it.\n *\n * @default false\n */\n isStrikethrough?: boolean;\n} & TestID &\n StyledPropsBlade;\n\ntype ColorProps = {\n amountValueColor: BaseTextProps['color'];\n};\n\ntype AmountProps = AmountTypeProps & AmountCommonProps;\n\nconst getTextColorProps = ({ color }: { color: AmountProps['color'] }): ColorProps => {\n const props: ColorProps = {\n amountValueColor: 'surface.text.gray.normal',\n };\n if (!color) return props;\n props.amountValueColor = color;\n return props;\n};\n\ninterface AmountValue extends Omit<AmountProps, 'value'> {\n amountValueColor: BaseTextProps['color'];\n value: string;\n size: Exclude<AmountProps['size'], undefined>;\n}\n\nconst AmountValue = ({\n value,\n size = 'medium',\n type = 'body',\n weight = 'regular',\n amountValueColor,\n isAffixSubtle,\n suffix,\n}: AmountValue): ReactElement => {\n const isReactNative = getPlatformType() === 'react-native';\n const affixFontSize = isAffixSubtle ? subtleFontSizes[type][size] : normalAmountSizes[type][size];\n const numberFontFamily: keyof FontFamily = type === 'body' ? 'text' : 'heading';\n if (suffix === 'decimals' && isAffixSubtle) {\n const integer = value.split('.')[0];\n const decimal = value.split('.')[1];\n\n // Native does not support alignItems of Text inside a div, instead we need to wrap is in a Text\n const AmountWrapper = isReactNative ? Text : React.Fragment;\n\n return (\n <AmountWrapper>\n <BaseText\n fontSize={normalAmountSizes[type][size]}\n fontWeight={weight}\n lineHeight={amountLineHeights[type][size]}\n color={amountValueColor}\n fontFamily={numberFontFamily}\n as={isReactNative ? undefined : 'span'}\n >\n {integer}\n </BaseText>\n <BaseText\n fontWeight={weight}\n fontSize={affixFontSize}\n fontFamily={numberFontFamily}\n color={amountValueColor}\n as={isReactNative ? undefined : 'span'}\n opacity={isAffixSubtle ? opacity[8] : 1}\n >\n .{decimal || '00'}\n </BaseText>\n </AmountWrapper>\n );\n }\n return (\n <BaseText\n fontSize={normalAmountSizes[type][size]}\n fontWeight={weight}\n fontFamily={numberFontFamily}\n color={amountValueColor}\n lineHeight={amountLineHeights[type][size]}\n >\n {value}\n </BaseText>\n );\n};\n\n// This function rounds a number to a specified number of decimal places\n// and floors the result.\nexport const getFlooredFixed = (value: number, decimalPlaces: number): number => {\n const factor = 100 ** decimalPlaces;\n const roundedValue = Math.floor(value * factor) / factor;\n return Number(roundedValue.toFixed(decimalPlaces));\n};\n\nexport const addCommas = (amountValue: number, currency: Currency, decimalPlaces = 0): string => {\n // If the currency is 'INR', set the locale to 'en-IN' (Indian English).\n // Otherwise, set the locale to 'en-US' (U.S. English).\n const locale = currency === 'INR' ? 'en-IN' : 'en-US';\n return amountValue.toLocaleString(locale, { minimumFractionDigits: decimalPlaces });\n};\n/**\n * This function returns the humanized amount\n * ie: for INR 2000 => 2K\n * for MYR 2000000 => 2M\n */\nexport const getHumanizedAmount = ({\n value,\n currency,\n denominationPosition = 'right',\n}: {\n value: number;\n currency: Currency;\n denominationPosition?: 'left' | 'right';\n}): string => {\n let amountValue = value;\n const abbreviations = getCurrencyAbbreviations(currency);\n const abbreviation = abbreviations.find((abbr) => amountValue >= abbr.value);\n\n if (abbreviation) {\n amountValue = amountValue / abbreviation.value;\n const formattedAmountValue = getFlooredFixed(amountValue, 2);\n\n if (denominationPosition === 'right') {\n return `${addCommas(formattedAmountValue, currency)}${abbreviation.symbol}`;\n }\n\n return `${abbreviation.symbol}${addCommas(formattedAmountValue, currency)}`;\n }\n\n return amountValue.toString();\n};\n\ntype FormatAmountWithSuffixType = {\n suffix: AmountProps['suffix'];\n value: number;\n currency: Currency;\n denominationPosition?: 'left' | 'right';\n};\n\nexport const formatAmountWithSuffix = ({\n suffix,\n value,\n currency,\n denominationPosition,\n}: FormatAmountWithSuffixType): string => {\n switch (suffix) {\n case 'decimals': {\n const decimalNumber = getFlooredFixed(value, 2);\n return addCommas(decimalNumber, currency, 2);\n }\n case 'humanize': {\n return getHumanizedAmount({ value, currency, denominationPosition });\n }\n case 'none': {\n return addCommas(getFlooredFixed(value, 0), currency);\n }\n default:\n return addCommas(getFlooredFixed(value, 0), currency);\n }\n};\n\nconst _Amount = ({\n value,\n suffix = 'decimals',\n type = 'body',\n size = 'medium',\n weight = 'regular',\n isAffixSubtle = true,\n isStrikethrough = false,\n color,\n currencyIndicator = 'currency-symbol',\n currency = 'INR',\n testID,\n ...styledProps\n}: AmountProps): ReactElement => {\n if (__DEV__) {\n if (typeof value !== 'number') {\n throwBladeError({\n message: '`value` prop must be of type `number` for Amount.',\n moduleName: 'Amount',\n });\n }\n // @ts-expect-error neutral color should throw error\n if (color === 'neutral') {\n throwBladeError({\n message: '`neutral` color is not supported.',\n moduleName: 'Amount',\n });\n }\n\n const bodySizes = objectKeysWithType(normalAmountSizes.body);\n if ((type === 'body' || !type) && !bodySizes.includes(size)) {\n throwBladeError({\n message: `size=\"${size}\" is not allowed with type=\"body\"`,\n moduleName: 'Amount',\n });\n }\n\n const displaySizes = objectKeysWithType(normalAmountSizes.display);\n if (type === 'display' && !displaySizes.includes(size)) {\n throwBladeError({\n message: `size=\"${size}\" is not allowed with type=\"display\"`,\n moduleName: 'Amount',\n });\n }\n\n const headingSizes = objectKeysWithType(normalAmountSizes.heading);\n if (type === 'heading' && !headingSizes.includes(size)) {\n throwBladeError({\n message: `size=\"${size}\" is not allowed with type=\"heading\"`,\n moduleName: 'Amount',\n });\n }\n }\n\n const currencySymbolOrCode = currencyIndicatorMapping[currency][currencyIndicator];\n const currencyPosition = currencyPositionMapping[currency] || 'left';\n const denominationPosition = currencyPosition === 'left' ? 'right' : 'left';\n const renderedValue = formatAmountWithSuffix({ suffix, value, currency, denominationPosition });\n const { amountValueColor } = getTextColorProps({\n color,\n });\n\n const currencyFontSize = isAffixSubtle\n ? subtleFontSizes[type][size]\n : normalAmountSizes[type][size];\n const isReactNative = getPlatformType() === 'react-native';\n\n return (\n <BaseBox\n display={(isReactNative ? 'flex' : 'inline-flex') as never}\n flexDirection=\"row\"\n {...metaAttribute({ name: MetaConstants.Amount, testID })}\n {...getStyledProps(styledProps)}\n >\n <BaseBox\n display={(isReactNative ? 'flex' : 'inline-flex') as never}\n alignItems=\"baseline\"\n flexDirection=\"row\"\n position=\"relative\"\n >\n {currencyPosition === 'left' && (\n <BaseText\n marginRight=\"spacing.1\"\n fontWeight={weight}\n fontSize={currencyFontSize}\n color={amountValueColor}\n as={isReactNative ? undefined : 'span'}\n opacity={isAffixSubtle ? opacity[8] : 1}\n >\n {currencySymbolOrCode}\n </BaseText>\n )}\n <AmountValue\n value={renderedValue}\n amountValueColor={amountValueColor}\n type={type}\n weight={weight}\n size={size}\n isAffixSubtle={isAffixSubtle}\n suffix={suffix}\n />\n {currencyPosition === 'right' && (\n <BaseText\n marginLeft=\"spacing.1\"\n fontWeight={weight}\n fontSize={currencyFontSize}\n color={amountValueColor}\n as={isReactNative ? undefined : 'span'}\n opacity={isAffixSubtle ? opacity[8] : 1}\n >\n {currencySymbolOrCode}\n </BaseText>\n )}\n {isStrikethrough && (\n <BaseBox\n // @ts-expect-error - intentionally setting the border color to the color prop for this hacky strikethrough\n borderBottomColor={amountValueColor}\n borderBottomWidth={type === 'body' ? 'thin' : 'thicker'}\n borderBottomStyle=\"solid\"\n position=\"absolute\"\n width=\"100%\"\n top=\"50%\"\n />\n )}\n </BaseBox>\n </BaseBox>\n );\n};\n\nconst Amount = assignWithoutSideEffects(_Amount, {\n displayName: 'Amount',\n componentId: 'Amount',\n});\n\nexport type { AmountProps };\nexport { Amount };\n"],"names":["getTextColorProps","_ref","color","props","amountValueColor","AmountValue","_ref2","value","_ref2$size","size","_ref2$type","type","_ref2$weight","weight","isAffixSubtle","suffix","isReactNative","getPlatformType","affixFontSize","subtleFontSizes","normalAmountSizes","numberFontFamily","integer","split","decimal","AmountWrapper","Text","React","Fragment","_jsxs","children","_jsx","BaseText","fontSize","fontWeight","lineHeight","amountLineHeights","fontFamily","as","undefined","opacity","getFlooredFixed","decimalPlaces","factor","roundedValue","Math","floor","Number","toFixed","addCommas","amountValue","currency","arguments","length","locale","toLocaleString","minimumFractionDigits","getHumanizedAmount","_ref3","_ref3$denominationPos","denominationPosition","abbreviations","getCurrencyAbbreviations","abbreviation","find","abbr","formattedAmountValue","symbol","toString","formatAmountWithSuffix","_ref4","decimalNumber","_Amount","_ref5","_ref5$suffix","_ref5$type","_ref5$size","_ref5$weight","_ref5$isAffixSubtle","_ref5$isStrikethrough","isStrikethrough","_ref5$currencyIndicat","currencyIndicator","_ref5$currency","testID","styledProps","_objectWithoutProperties","_excluded","__DEV__","throwBladeError","message","moduleName","bodySizes","objectKeysWithType","body","includes","displaySizes","display","headingSizes","heading","currencySymbolOrCode","currencyIndicatorMapping","currencyPosition","currencyPositionMapping","renderedValue","_getTextColorProps","currencyFontSize","BaseBox","Object","assign","flexDirection","metaAttribute","name","MetaConstants","Amount","getStyledProps","alignItems","position","marginRight","marginLeft","borderBottomColor","borderBottomWidth","borderBottomStyle","width","top","assignWithoutSideEffects","displayName","componentId"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AACA,IAAA,SAAA,CAAA,CAAA,OAAA,CAAA,QAAA,CAAA,MAAA,CAAA,MAAA,CAAA,QAAA,CAAA,eAAA,CAAA,iBAAA,CAAA,OAAA,CAAA,mBAAA,CAAA,UAAA,CAAA,QAAA,CAAA,CA6EA,IAAMA,iBAAiB,CAAG,SAApBA,iBAAiBA,CAAAC,IAAA,CAA+D,CAAA,IAAzDC,KAAK,CAAAD,IAAA,CAALC,KAAK,CAChC,IAAMC,KAAiB,CAAG,CACxBC,gBA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AM,CAAEA,MAAO,CACfJ,IAAI,CAAEA,IAAK,CACXK,aAAa,CAAEA,aAAc,CAC7BC,MAAM,CAAEA,MAAO,CAChB,CAAC,CACDuF,gBAAgB,GAAK,OAAO,EAC3BvE,GAAA,CAACC,QAAQ,CAAA,CACPuF,UAAU,CAAC,WAAW,CACtBrF,UAAU,CAAErB,MAAO,CACnBoB,QAAQ,CAAEyE,gBAAiB,CAC3BxG,KAAK,CAAEE,gBAAiB,CACxBkC,EAAE,CAAEtB,aAAa,CAAGuB,SAAS,CAAG,MAAO,CACvCC,OAAO,CAAE1B,aAAa,CAAG0B,OAAO,CAAC,CAAC,CAAC,CAAG,CAAE,CAAAV,QAAA,CAEvCsE,oBAAoB,CACb,CACX,CACApB,eAAe,EACdjD,GAAA,CAAC4E,OAAO,CAAA,CAENa,iBAAiB,CAAEpH,gBAAiB,CACpCqH,iBAAiB,CAAE9G,IAAI,GAAK,MAAM,CAAG,MAAM,CAAG,SAAU,CACxD+G,iBAAiB,CAAC,OAAO,CACzBL,QAAQ,CAAC,UAAU,CACnBM,KAAK,CAAC,MAAM,CACZC,GAAG,CAAC,KAAK,CACV,CACF,CACM,CAAA,CAAC,EACH,CAAC,CAEd,CAAC,CAEK,IAAAV,MAAM,CAAGW,wBAAwB,CAACrD,OAAO,CAAE,CAC/CsD,WAAW,CAAE,QAAQ,CACrBC,WAAW,CAAE,QACf,CAAC;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var
|
|
1
|
+
var normalAmountSizes={body:{xsmall:25,small:75,medium:100,large:200},heading:{small:300,medium:400,large:500,xlarge:600,'2xlarge':700},display:{small:800,medium:900,large:1000,xlarge:1100}};var subtleFontSizes={body:{xsmall:normalAmountSizes.body.xsmall,small:normalAmountSizes.body.xsmall,medium:normalAmountSizes.body.xsmall,large:normalAmountSizes.body.small},heading:{small:normalAmountSizes.body.small,medium:normalAmountSizes.body.medium,large:normalAmountSizes.body.large,xlarge:normalAmountSizes.heading.medium,'2xlarge':normalAmountSizes.heading.large},display:{small:normalAmountSizes.heading.xlarge,medium:normalAmountSizes.heading['2xlarge'],large:normalAmountSizes.heading['2xlarge'],xlarge:normalAmountSizes.display.small}};var amountLineHeights={body:{xsmall:25,small:75,medium:100,large:200},heading:{small:300,medium:400,large:500,xlarge:600,'2xlarge':700},display:{small:800,medium:900,large:1000,xlarge:1100}};var currencyIndicatorMapping={AED:{'currency-symbol':'د.إ','currency-code':'AED'},ALL:{'currency-symbol':'Lek','currency-code':'ALL'},AMD:{'currency-symbol':'֏','currency-code':'AMD'},ARS:{'currency-symbol':'ARS','currency-code':'ARS'},AUD:{'currency-symbol':'A$','currency-code':'AUD'},AWG:{'currency-symbol':'Afl.','currency-code':'AWG'},BBD:{'currency-symbol':'$','currency-code':'BBD'},BDT:{'currency-symbol':'৳','currency-code':'BDT'},BMD:{'currency-symbol':'$','currency-code':'BMD'},BND:{'currency-symbol':'BND','currency-code':'BND'},BOB:{'currency-symbol':'Bs','currency-code':'BOB'},BSD:{'currency-symbol':'B$','currency-code':'BSD'},BWP:{'currency-symbol':'P','currency-code':'BWP'},BZD:{'currency-symbol':'BZ$','currency-code':'BZD'},CAD:{'currency-symbol':'C$','currency-code':'CAD'},CHF:{'currency-symbol':'CHf','currency-code':'CHF'},CNY:{'currency-symbol':'¥','currency-code':'CNY'},COP:{'currency-symbol':'COL$','currency-code':'COP'},CRC:{'currency-symbol':'₡','currency-code':'CRC'},CUP:{'currency-symbol':'$MN','currency-code':'CUP'},CZK:{'currency-symbol':'Kč','currency-code':'CZK'},DKK:{'currency-symbol':'DKK','currency-code':'DKK'},DOP:{'currency-symbol':'RD$','currency-code':'DOP'},DZD:{'currency-symbol':'د.ج','currency-code':'DZD'},EGP:{'currency-symbol':'E£','currency-code':'EGP'},ETB:{'currency-symbol':'ብር','currency-code':'ETB'},EUR:{'currency-symbol':'€','currency-code':'EUR'},FJD:{'currency-symbol':'FJ$','currency-code':'FJD'},GBP:{'currency-symbol':'£','currency-code':'GBP'},GHS:{'currency-symbol':'GH₵','currency-code':'GHS'},GIP:{'currency-symbol':'GIP','currency-code':'GIP'},GMD:{'currency-symbol':'D','currency-code':'GMD'},GTQ:{'currency-symbol':'Q','currency-code':'GTQ'},GYD:{'currency-symbol':'G$','currency-code':'GYD'},HKD:{'currency-symbol':'HK$','currency-code':'HKD'},HNL:{'currency-symbol':'HNL','currency-code':'HNL'},HRK:{'currency-symbol':'kn','currency-code':'HRK'},HTG:{'currency-symbol':'G','currency-code':'HTG'},HUF:{'currency-symbol':'Ft','currency-code':'HUF'},IDR:{'currency-symbol':'Rp','currency-code':'IDR'},ILS:{'currency-symbol':'₪','currency-code':'ILS'},INR:{'currency-symbol':'₹','currency-code':'INR'},JMD:{'currency-symbol':'J$','currency-code':'JMD'},KES:{'currency-symbol':'Ksh','currency-code':'KES'},KGS:{'currency-symbol':'Лв','currency-code':'KGS'},KHR:{'currency-symbol':'៛','currency-code':'KHR'},KYD:{'currency-symbol':'CI$','currency-code':'KYD'},KZT:{'currency-symbol':'₸','currency-code':'KZT'},LAK:{'currency-symbol':'₭','currency-code':'LAK'},LKR:{'currency-symbol':'රු','currency-code':'LKR'},LRD:{'currency-symbol':'L$','currency-code':'LRD'},LSL:{'currency-symbol':'LSL','currency-code':'LSL'},MAD:{'currency-symbol':'د.م.','currency-code':'MAD'},MDL:{'currency-symbol':'MDL','currency-code':'MDL'},MKD:{'currency-symbol':'ден','currency-code':'MKD'},MMK:{'currency-symbol':'MMK','currency-code':'MMK'},MNT:{'currency-symbol':'₮','currency-code':'MNT'},MOP:{'currency-symbol':'MOP$','currency-code':'MOP'},MUR:{'currency-symbol':'₨','currency-code':'MUR'},MVR:{'currency-symbol':'Rf','currency-code':'MVR'},MWK:{'currency-symbol':'MK','currency-code':'MWK'},MXN:{'currency-symbol':'Mex$','currency-code':'MXN'},MYR:{'currency-symbol':'RM','currency-code':'MYR'},NAD:{'currency-symbol':'N$','currency-code':'NAD'},NGN:{'currency-symbol':'₦','currency-code':'NGN'},NIO:{'currency-symbol':'NIO','currency-code':'NIO'},NOK:{'currency-symbol':'NOK','currency-code':'NOK'},NPR:{'currency-symbol':'रू','currency-code':'NPR'},NZD:{'currency-symbol':'NZ$','currency-code':'NZD'},PEN:{'currency-symbol':'S/','currency-code':'PEN'},PGK:{'currency-symbol':'PGK','currency-code':'PGK'},PHP:{'currency-symbol':'₱','currency-code':'PHP'},PKR:{'currency-symbol':'₨','currency-code':'PKR'},QAR:{'currency-symbol':'QR','currency-code':'QAR'},RUB:{'currency-symbol':'₽','currency-code':'RUB'},SAR:{'currency-symbol':'SR','currency-code':'SAR'},SCR:{'currency-symbol':'SRe','currency-code':'SCR'},SEK:{'currency-symbol':'SEK','currency-code':'SEK'},SGD:{'currency-symbol':'S$','currency-code':'SGD'},SLL:{'currency-symbol':'Le','currency-code':'SLL'},SOS:{'currency-symbol':'Sh.so.','currency-code':'SOS'},SSP:{'currency-symbol':'SS£','currency-code':'SSP'},SVC:{'currency-symbol':'₡','currency-code':'SVC'},SZL:{'currency-symbol':'E','currency-code':'SZL'},THB:{'currency-symbol':'฿','currency-code':'THB'},TTD:{'currency-symbol':'TT$','currency-code':'TTD'},TZS:{'currency-symbol':'Sh','currency-code':'TZS'},USD:{'currency-symbol':'$','currency-code':'USD'},UYU:{'currency-symbol':'$U','currency-code':'UYU'},UZS:{'currency-symbol':"so'm",'currency-code':'UZS'},YER:{'currency-symbol':'﷼','currency-code':'YER'},ZAR:{'currency-symbol':'R','currency-code':'ZAR'},KWD:{'currency-symbol':'د.ك','currency-code':'KWD'},BHD:{'currency-symbol':'د.ب.','currency-code':'BHD'},OMR:{'currency-symbol':'ر.ع.','currency-code':'OMR'}};var getCurrencyAbbreviations=function getCurrencyAbbreviations(currency){if(currency==='INR'){return [{value:1e7,symbol:'Cr'},{value:1e5,symbol:'L'},{value:1e3,symbol:'k'}];}return [{value:1e9,symbol:'B'},{value:1e6,symbol:'M'},{value:1e3,symbol:'K'}];};var currencyPositionMapping={DZD:'right',BHD:'right',OMR:'right',KWD:'right'};
|
|
2
2
|
|
|
3
|
-
export {
|
|
3
|
+
export { amountLineHeights, currencyIndicatorMapping, currencyPositionMapping, getCurrencyAbbreviations, normalAmountSizes, subtleFontSizes };
|
|
4
4
|
//# sourceMappingURL=amountTokens.js.map
|