@razorpay/blade 10.23.4 → 11.0.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 +9 -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 +2 -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 +6 -5
- 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 +2 -2
- 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 +9 -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 +2 -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 +6 -5
- 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 +2 -2
- 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 +6005 -6169
- package/build/types/components/index.native.d.ts +4653 -4817
- 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
|
@@ -20,32 +20,32 @@ var getInputBackgroundAndBorderStyles = function getInputBackgroundAndBorderStyl
|
|
|
20
20
|
isTextArea = _ref.isTextArea,
|
|
21
21
|
isDropdownTrigger = _ref.isDropdownTrigger;
|
|
22
22
|
// normal state
|
|
23
|
-
var backgroundColor = theme.colors.
|
|
24
|
-
var borderBottomColor = theme.colors.
|
|
23
|
+
var backgroundColor = theme.colors.interactive.background.gray["default"];
|
|
24
|
+
var borderBottomColor = theme.colors.interactive.background.gray.highlighted;
|
|
25
25
|
|
|
26
26
|
// hoverState
|
|
27
27
|
if (isHovered) {
|
|
28
|
-
backgroundColor = theme.colors.
|
|
28
|
+
backgroundColor = theme.colors.interactive.background.gray.highlighted;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
// focused state
|
|
32
32
|
if (isFocused) {
|
|
33
|
-
backgroundColor = theme.colors.
|
|
33
|
+
backgroundColor = theme.colors.interactive.background.primary.faded;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
// disabled state
|
|
37
37
|
if (isDisabled) {
|
|
38
|
-
backgroundColor = theme.colors.
|
|
39
|
-
borderBottomColor =
|
|
38
|
+
backgroundColor = theme.colors.interactive.background.gray.disabled;
|
|
39
|
+
borderBottomColor = 'transparent';
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
// validation state
|
|
43
43
|
if (validationState === 'error') {
|
|
44
|
-
backgroundColor = theme.colors.
|
|
45
|
-
borderBottomColor = theme.colors.
|
|
44
|
+
backgroundColor = theme.colors.interactive.background.negative.faded;
|
|
45
|
+
borderBottomColor = theme.colors.interactive.background.negative["default"];
|
|
46
46
|
} else if (validationState === 'success') {
|
|
47
|
-
backgroundColor = theme.colors.
|
|
48
|
-
borderBottomColor = theme.colors.
|
|
47
|
+
backgroundColor = theme.colors.interactive.background.positive.faded;
|
|
48
|
+
borderBottomColor = theme.colors.interactive.background.positive["default"];
|
|
49
49
|
}
|
|
50
50
|
return {
|
|
51
51
|
backgroundColor: backgroundColor,
|
|
@@ -104,9 +104,8 @@ var getBaseInputStyles = function getBaseInputStyles(_ref3) {
|
|
|
104
104
|
return _objectSpread(_objectSpread({}, getTextStyles({
|
|
105
105
|
size: 'medium',
|
|
106
106
|
variant: 'body',
|
|
107
|
-
type: isDisabled ? 'placeholder' : 'subtle',
|
|
108
107
|
weight: 'regular',
|
|
109
|
-
|
|
108
|
+
color: isDisabled ? 'surface.text.gray.disabled' : 'surface.text.gray.subtle',
|
|
110
109
|
theme: theme
|
|
111
110
|
})), {}, {
|
|
112
111
|
// take the full available width of parent container for input field
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"baseInputStyles.js","sources":["../../../../../../../src/components/Input/BaseInput/baseInputStyles.ts"],"sourcesContent":["import type { CSSObject } from 'styled-components';\nimport type { BaseInputProps } from './BaseInput';\nimport { getInputVisualsToBeRendered } from './BaseInputVisuals';\nimport { BASEINPUT_DEFAULT_HEIGHT } from './baseInputConfig';\nimport type { Theme } from '~components/BladeProvider';\nimport getTextStyles from '~components/Typography/Text/getTextStyles';\nimport { makeSpace } from '~utils/makeSpace';\nimport { makeBorderSize } from '~utils/makeBorderSize';\nimport { getPlatformType } from '~utils';\n\ntype GetInputStyles = Pick<\n BaseInputProps,\n | 'isDisabled'\n | 'validationState'\n | 'leadingIcon'\n | 'prefix'\n | 'interactionElement'\n | 'suffix'\n | 'trailingIcon'\n | 'textAlign'\n | 'isDropdownTrigger'\n> & {\n isHovered?: boolean;\n isFocused?: boolean;\n isTextArea?: boolean;\n hasTags?: boolean;\n theme: Theme;\n};\n\nexport const getInputBackgroundAndBorderStyles = ({\n theme,\n isHovered,\n isFocused,\n isDisabled,\n validationState,\n isTextArea,\n isDropdownTrigger,\n}: Pick<\n GetInputStyles,\n | 'theme'\n | 'isFocused'\n | 'isDisabled'\n | 'validationState'\n | 'isHovered'\n | 'isTextArea'\n | 'isDropdownTrigger'\n>): CSSObject => {\n // normal state\n let backgroundColor = theme.colors.brand.gray.a50.lowContrast;\n let borderBottomColor = theme.colors.brand.gray.a100.lowContrast;\n\n // hoverState\n if (isHovered) {\n backgroundColor = theme.colors.brand.gray.a100.lowContrast;\n }\n\n // focused state\n if (isFocused) {\n backgroundColor = theme.colors.brand.primary[300];\n }\n\n // disabled state\n if (isDisabled) {\n backgroundColor = theme.colors.brand.gray.a50.lowContrast;\n borderBottomColor = theme.colors.brand.gray[300].lowContrast;\n }\n\n // validation state\n if (validationState === 'error') {\n backgroundColor = theme.colors.feedback.background.negative.lowContrast;\n borderBottomColor = theme.colors.feedback.border.negative.highContrast;\n } else if (validationState === 'success') {\n backgroundColor = theme.colors.feedback.background.positive.lowContrast;\n borderBottomColor = theme.colors.feedback.border.positive.highContrast;\n }\n\n return {\n backgroundColor,\n borderBottomColor,\n borderTopLeftRadius: makeBorderSize(theme.border.radius.small),\n borderTopRightRadius: makeBorderSize(theme.border.radius.small),\n borderBottomWidth: makeBorderSize(theme.border.width.thin),\n borderBottomStyle: 'solid',\n display: 'flex',\n flexDirection: 'row',\n width: '100%',\n alignItems: isTextArea ? 'flex-start' : undefined,\n position: 'relative',\n height: isDropdownTrigger ? 'auto' : undefined,\n };\n};\n\nconst getLeftPadding = ({\n theme,\n isDropdownTrigger,\n hasLeadingIcon,\n hasPrefix,\n}: {\n theme: Theme;\n hasLeadingIcon: boolean;\n hasPrefix: boolean;\n isDropdownTrigger: GetInputStyles['isDropdownTrigger'];\n}): number => {\n if (isDropdownTrigger) {\n return theme.spacing[0];\n }\n\n if (hasLeadingIcon || hasPrefix) {\n return theme.spacing[3];\n }\n\n return theme.spacing[4];\n};\n\nexport const getBaseInputStyles = ({\n theme,\n isDisabled,\n leadingIcon,\n prefix,\n interactionElement,\n suffix,\n trailingIcon,\n textAlign,\n isTextArea,\n hasTags,\n isDropdownTrigger,\n}: GetInputStyles): CSSObject => {\n const {\n hasLeadingIcon,\n hasPrefix,\n hasInteractionElement,\n hasSuffix,\n hasTrailingIcon,\n } = getInputVisualsToBeRendered({\n leadingIcon,\n prefix,\n interactionElement,\n suffix,\n trailingIcon,\n });\n\n const isDropdownWithTags = isDropdownTrigger && hasTags;\n const isReactNative = getPlatformType() === 'react-native';\n\n return {\n ...getTextStyles({\n size: 'medium',\n variant: 'body',\n type: isDisabled ? 'placeholder' : 'subtle',\n weight: 'regular',\n contrast: 'low',\n theme,\n }),\n // take the full available width of parent container for input field\n flex: 1,\n backgroundColor: 'transparent',\n paddingTop: makeSpace(theme.spacing[3]),\n paddingBottom: makeSpace(theme.spacing[3]),\n paddingLeft: makeSpace(getLeftPadding({ theme, isDropdownTrigger, hasLeadingIcon, hasPrefix })),\n paddingRight:\n hasInteractionElement || hasSuffix || hasTrailingIcon\n ? makeSpace(theme.spacing[3])\n : makeSpace(theme.spacing[4]),\n textAlign,\n width: '100%',\n height: isTextArea || isDropdownWithTags ? undefined : makeSpace(BASEINPUT_DEFAULT_HEIGHT),\n minHeight: isDropdownWithTags ? undefined : makeSpace(BASEINPUT_DEFAULT_HEIGHT),\n ...(isReactNative ? {} : { resize: 'none' }),\n };\n};\n"],"names":["getInputBackgroundAndBorderStyles","_ref","theme","isHovered","isFocused","isDisabled","validationState","isTextArea","isDropdownTrigger","backgroundColor","colors","brand","gray","a50","lowContrast","borderBottomColor","a100","primary","feedback","background","negative","border","highContrast","positive","borderTopLeftRadius","makeBorderSize","radius","small","borderTopRightRadius","borderBottomWidth","width","thin","borderBottomStyle","display","flexDirection","alignItems","undefined","position","height","getLeftPadding","_ref2","hasLeadingIcon","hasPrefix","spacing","getBaseInputStyles","_ref3","leadingIcon","prefix","interactionElement","suffix","trailingIcon","textAlign","hasTags","_getInputVisualsToBeR","getInputVisualsToBeRendered","hasInteractionElement","hasSuffix","hasTrailingIcon","isDropdownWithTags","isReactNative","getPlatformType","_objectSpread","getTextStyles","size","variant","type","weight","contrast","flex","paddingTop","makeSpace","paddingBottom","paddingLeft","paddingRight","BASEINPUT_DEFAULT_HEIGHT","minHeight","resize"],"mappings":";;;;;;;;;;;;;IA6BaA,iCAAiC,GAAG,SAApCA,iCAAiCA,CAAAC,IAAA,EAiB7B;AAAA,EAAA,IAhBfC,KAAK,GAAAD,IAAA,CAALC,KAAK;IACLC,SAAS,GAAAF,IAAA,CAATE,SAAS;IACTC,SAAS,GAAA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,SAAS,GAAGkC,SAAS,CAACI,wBAAwB,CAAA;AAAC,GAAA,EAC3Ef,aAAa,GAAG,EAAE,GAAG;AAAEiB,IAAAA,MAAM,EAAE,MAAA;GAAQ,CAAA,CAAA;AAE/C;;;;"}
|
|
1
|
+
{"version":3,"file":"baseInputStyles.js","sources":["../../../../../../../src/components/Input/BaseInput/baseInputStyles.ts"],"sourcesContent":["import type { CSSObject } from 'styled-components';\nimport type { BaseInputProps } from './BaseInput';\nimport { getInputVisualsToBeRendered } from './BaseInputVisuals';\nimport { BASEINPUT_DEFAULT_HEIGHT } from './baseInputConfig';\nimport type { Theme } from '~components/BladeProvider';\nimport getTextStyles from '~components/Typography/Text/getTextStyles';\nimport { makeSpace } from '~utils/makeSpace';\nimport { makeBorderSize } from '~utils/makeBorderSize';\nimport { getPlatformType } from '~utils';\n\ntype GetInputStyles = Pick<\n BaseInputProps,\n | 'isDisabled'\n | 'validationState'\n | 'leadingIcon'\n | 'prefix'\n | 'interactionElement'\n | 'suffix'\n | 'trailingIcon'\n | 'textAlign'\n | 'isDropdownTrigger'\n> & {\n isHovered?: boolean;\n isFocused?: boolean;\n isTextArea?: boolean;\n hasTags?: boolean;\n theme: Theme;\n};\n\nexport const getInputBackgroundAndBorderStyles = ({\n theme,\n isHovered,\n isFocused,\n isDisabled,\n validationState,\n isTextArea,\n isDropdownTrigger,\n}: Pick<\n GetInputStyles,\n | 'theme'\n | 'isFocused'\n | 'isDisabled'\n | 'validationState'\n | 'isHovered'\n | 'isTextArea'\n | 'isDropdownTrigger'\n>): CSSObject => {\n // normal state\n let backgroundColor = theme.colors.interactive.background.gray.default;\n let borderBottomColor = theme.colors.interactive.background.gray.highlighted;\n\n // hoverState\n if (isHovered) {\n backgroundColor = theme.colors.interactive.background.gray.highlighted;\n }\n\n // focused state\n if (isFocused) {\n backgroundColor = theme.colors.interactive.background.primary.faded;\n }\n\n // disabled state\n if (isDisabled) {\n backgroundColor = theme.colors.interactive.background.gray.disabled;\n borderBottomColor = 'transparent';\n }\n\n // validation state\n if (validationState === 'error') {\n backgroundColor = theme.colors.interactive.background.negative.faded;\n borderBottomColor = theme.colors.interactive.background.negative.default;\n } else if (validationState === 'success') {\n backgroundColor = theme.colors.interactive.background.positive.faded;\n borderBottomColor = theme.colors.interactive.background.positive.default;\n }\n\n return {\n backgroundColor,\n borderBottomColor,\n borderTopLeftRadius: makeBorderSize(theme.border.radius.small),\n borderTopRightRadius: makeBorderSize(theme.border.radius.small),\n borderBottomWidth: makeBorderSize(theme.border.width.thin),\n borderBottomStyle: 'solid',\n display: 'flex',\n flexDirection: 'row',\n width: '100%',\n alignItems: isTextArea ? 'flex-start' : undefined,\n position: 'relative',\n height: isDropdownTrigger ? 'auto' : undefined,\n };\n};\n\nconst getLeftPadding = ({\n theme,\n isDropdownTrigger,\n hasLeadingIcon,\n hasPrefix,\n}: {\n theme: Theme;\n hasLeadingIcon: boolean;\n hasPrefix: boolean;\n isDropdownTrigger: GetInputStyles['isDropdownTrigger'];\n}): number => {\n if (isDropdownTrigger) {\n return theme.spacing[0];\n }\n\n if (hasLeadingIcon || hasPrefix) {\n return theme.spacing[3];\n }\n\n return theme.spacing[4];\n};\n\nexport const getBaseInputStyles = ({\n theme,\n isDisabled,\n leadingIcon,\n prefix,\n interactionElement,\n suffix,\n trailingIcon,\n textAlign,\n isTextArea,\n hasTags,\n isDropdownTrigger,\n}: GetInputStyles): CSSObject => {\n const {\n hasLeadingIcon,\n hasPrefix,\n hasInteractionElement,\n hasSuffix,\n hasTrailingIcon,\n } = getInputVisualsToBeRendered({\n leadingIcon,\n prefix,\n interactionElement,\n suffix,\n trailingIcon,\n });\n\n const isDropdownWithTags = isDropdownTrigger && hasTags;\n const isReactNative = getPlatformType() === 'react-native';\n\n return {\n ...getTextStyles({\n size: 'medium',\n variant: 'body',\n weight: 'regular',\n color: isDisabled ? 'surface.text.gray.disabled' : 'surface.text.gray.subtle',\n theme,\n }),\n // take the full available width of parent container for input field\n flex: 1,\n backgroundColor: 'transparent',\n paddingTop: makeSpace(theme.spacing[3]),\n paddingBottom: makeSpace(theme.spacing[3]),\n paddingLeft: makeSpace(getLeftPadding({ theme, isDropdownTrigger, hasLeadingIcon, hasPrefix })),\n paddingRight:\n hasInteractionElement || hasSuffix || hasTrailingIcon\n ? makeSpace(theme.spacing[3])\n : makeSpace(theme.spacing[4]),\n textAlign,\n width: '100%',\n height: isTextArea || isDropdownWithTags ? undefined : makeSpace(BASEINPUT_DEFAULT_HEIGHT),\n minHeight: isDropdownWithTags ? undefined : makeSpace(BASEINPUT_DEFAULT_HEIGHT),\n ...(isReactNative ? {} : { resize: 'none' }),\n };\n};\n"],"names":["getInputBackgroundAndBorderStyles","_ref","theme","isHovered","isFocused","isDisabled","validationState","isTextArea","isDropdownTrigger","backgroundColor","colors","interactive","background","gray","borderBottomColor","highlighted","primary","faded","disabled","negative","positive","borderTopLeftRadius","makeBorderSize","border","radius","small","borderTopRightRadius","borderBottomWidth","width","thin","borderBottomStyle","display","flexDirection","alignItems","undefined","position","height","getLeftPadding","_ref2","hasLeadingIcon","hasPrefix","spacing","getBaseInputStyles","_ref3","leadingIcon","prefix","interactionElement","suffix","trailingIcon","textAlign","hasTags","_getInputVisualsToBeR","getInputVisualsToBeRendered","hasInteractionElement","hasSuffix","hasTrailingIcon","isDropdownWithTags","isReactNative","getPlatformType","_objectSpread","getTextStyles","size","variant","weight","color","flex","paddingTop","makeSpace","paddingBottom","paddingLeft","paddingRight","BASEINPUT_DEFAULT_HEIGHT","minHeight","resize"],"mappings":";;;;;;;;;;;;;IA6BaA,iCAAiC,GAAG,SAApCA,iCAAiCA,CAAAC,IAAA,EAiB7B;AAAA,EAAA,IAhBfC,KAAK,GAAAD,IAAA,CAALC,KAAK;IACLC,SAAS,GAAAF,IAAA,CAATE,SAAS;IACTC,SAAS,GAAAH,IAAA,CAATG,SAAS;IACTC,UAAU,GAAAJ,IAAA,CAAVI,UAAU;IACVC,eAAe,GAAAL,IAAA,CAAfK,eAAe;IACfC,U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DownIcon from '../../Icons/ChevronDownIcon/ChevronDownIcon.js';
|
|
|
5
5
|
import ChevronUpIcon from '../../Icons/ChevronUpIcon/ChevronUpIcon.js';
|
|
6
6
|
|
|
7
7
|
var Chevron = function Chevron(props) {
|
|
8
|
-
var iconColor = "surface.
|
|
8
|
+
var iconColor = "surface.icon.gray.".concat(props.isDisabled ? 'disabled' : 'muted');
|
|
9
9
|
return /*#__PURE__*/jsxs(Fragment, {
|
|
10
10
|
children: [/*#__PURE__*/jsx(ChevronDownIcon, {
|
|
11
11
|
display: props.isOpen ? 'none' : 'flex',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Chevron.js","sources":["../../../../../../../src/components/Input/DropdownInputTriggers/Chevron.tsx"],"sourcesContent":["import React from 'react';\nimport { ChevronDownIcon, ChevronUpIcon } from '~components/Icons';\n\nconst Chevron = (props: { isOpen?: boolean; isDisabled?: boolean }): React.ReactElement => {\n const iconColor = `surface.
|
|
1
|
+
{"version":3,"file":"Chevron.js","sources":["../../../../../../../src/components/Input/DropdownInputTriggers/Chevron.tsx"],"sourcesContent":["import React from 'react';\nimport { ChevronDownIcon, ChevronUpIcon } from '~components/Icons';\n\nconst Chevron = (props: { isOpen?: boolean; isDisabled?: boolean }): React.ReactElement => {\n const iconColor = `surface.icon.gray.${props.isDisabled ? 'disabled' : 'muted'}` as const;\n\n return (\n <>\n <ChevronDownIcon display={props.isOpen ? 'none' : 'flex'} size=\"medium\" color={iconColor} />\n <ChevronUpIcon display={props.isOpen ? 'flex' : 'none'} size=\"medium\" color={iconColor} />\n </>\n );\n};\n\nexport { Chevron };\n"],"names":["Chevron","props","iconColor","concat","isDisabled","_jsxs","_Fragment","children","_jsx","ChevronDownIcon","display","isOpen","size","color","ChevronUpIcon"],"mappings":";;;;;;AAGA,IAAMA,OAAO,GAAG,SAAVA,OAAOA,CAAIC,KAAiD,EAAyB;EACzF,IAAMC,SAAS,GAAAC,oBAAAA,CAAAA,MAAA,CAAwBF,KAAK,CAACG,UAAU,GAAG,UAAU,GAAG,OAAO,CAAW,CAAA;EAEzF,oBACEC,IAAA,CAAAC,QAAA,EAAA;IAAAC,QAAA,EAAA,cACEC,GAAA,CAACC,eAAe,EAAA;AAACC,MAAAA,OAAO,EAAET,KAAK,CAACU,MAAM,GAAG,MAAM,GAAG,MAAO;AAACC,MAAAA,IAAI,EAAC,QAAQ;AAACC,MAAAA,KAAK,EAAEX,SAAAA;AAAU,KAAE,CAAC,eAC5FM,GAAA,CAACM,aAAa,EAAA;AAACJ,MAAAA,OAAO,EAAET,KAAK,CAACU,MAAM,GAAG,MAAM,GAAG,MAAO;AAACC,MAAAA,IAAI,EAAC,QAAQ;AAACC,MAAAA,KAAK,EAAEX,SAAAA;AAAU,KAAE,CAAC,CAAA;AAAA,GAC1F,CAAC,CAAA;AAEP;;;;"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
2
|
-
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
3
2
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
4
|
-
import React__default
|
|
3
|
+
import React__default from 'react';
|
|
5
4
|
import StyledLink from './StyledBaseLink.web.js';
|
|
6
5
|
import getIn from '../../../utils/lodashButBetter/get.js';
|
|
7
6
|
import useInteraction from '../../../utils/useInteraction.js';
|
|
@@ -35,25 +34,26 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
35
34
|
var getColorToken = function getColorToken(_ref) {
|
|
36
35
|
var variant = _ref.variant,
|
|
37
36
|
color = _ref.color,
|
|
38
|
-
element = _ref.element,
|
|
39
37
|
currentInteraction = _ref.currentInteraction,
|
|
40
38
|
isDisabled = _ref.isDisabled,
|
|
41
|
-
|
|
39
|
+
element = _ref.element;
|
|
42
40
|
var state = currentInteraction;
|
|
41
|
+
var map = {
|
|
42
|
+
"default": 'normal',
|
|
43
|
+
hover: 'subtle',
|
|
44
|
+
focus: 'normal',
|
|
45
|
+
disabled: 'disabled'
|
|
46
|
+
};
|
|
43
47
|
if (isDisabled && variant == 'button') {
|
|
44
48
|
state = 'disabled';
|
|
45
49
|
}
|
|
46
|
-
if (
|
|
47
|
-
// visited state is only valid for anchor variant
|
|
48
|
-
state = 'visited';
|
|
49
|
-
}
|
|
50
|
-
if (color && color !== 'default' && state !== 'visited') {
|
|
50
|
+
if (color && color !== 'primary') {
|
|
51
51
|
if (color !== 'white') {
|
|
52
|
-
return "
|
|
52
|
+
return "interactive.".concat(element, ".").concat(color, ".").concat(map[state]);
|
|
53
53
|
}
|
|
54
|
-
return "
|
|
54
|
+
return "interactive.".concat(element, ".staticWhite.").concat(map[state]);
|
|
55
55
|
}
|
|
56
|
-
return "
|
|
56
|
+
return "interactive.".concat(element, ".primary.").concat(map[state]);
|
|
57
57
|
};
|
|
58
58
|
var getProps = function getProps(_ref2) {
|
|
59
59
|
var theme = _ref2.theme,
|
|
@@ -62,7 +62,6 @@ var getProps = function getProps(_ref2) {
|
|
|
62
62
|
children = _ref2.children,
|
|
63
63
|
isDisabled = _ref2.isDisabled,
|
|
64
64
|
color = _ref2.color,
|
|
65
|
-
isVisited = _ref2.isVisited,
|
|
66
65
|
target = _ref2.target,
|
|
67
66
|
size = _ref2.size;
|
|
68
67
|
var isButton = variant === 'button';
|
|
@@ -74,10 +73,10 @@ var getProps = function getProps(_ref2) {
|
|
|
74
73
|
large: 200
|
|
75
74
|
},
|
|
76
75
|
lineHeight: {
|
|
77
|
-
xsmall:
|
|
78
|
-
small:
|
|
76
|
+
xsmall: 25,
|
|
77
|
+
small: 75,
|
|
79
78
|
medium: 100,
|
|
80
|
-
large:
|
|
79
|
+
large: 200
|
|
81
80
|
}
|
|
82
81
|
};
|
|
83
82
|
var props = {
|
|
@@ -88,8 +87,7 @@ var getProps = function getProps(_ref2) {
|
|
|
88
87
|
color: color,
|
|
89
88
|
element: 'icon',
|
|
90
89
|
currentInteraction: currentInteraction,
|
|
91
|
-
isDisabled: isDisabled
|
|
92
|
-
isVisited: isVisited
|
|
90
|
+
isDisabled: isDisabled
|
|
93
91
|
}),
|
|
94
92
|
fontSize: textSizes.fontSize[size],
|
|
95
93
|
lineHeight: textSizes.lineHeight[size],
|
|
@@ -100,10 +98,9 @@ var getProps = function getProps(_ref2) {
|
|
|
100
98
|
color: color,
|
|
101
99
|
element: 'text',
|
|
102
100
|
currentInteraction: currentInteraction,
|
|
103
|
-
isDisabled: isDisabled
|
|
104
|
-
isVisited: isVisited
|
|
101
|
+
isDisabled: isDisabled
|
|
105
102
|
}),
|
|
106
|
-
focusRingColor: getIn(theme.colors, '
|
|
103
|
+
focusRingColor: getIn(theme.colors, 'interactive.background.primary.faded'),
|
|
107
104
|
motionDuration: 'duration.2xquick',
|
|
108
105
|
motionEasing: 'easing.standard.effective',
|
|
109
106
|
cursor: isButton && isDisabled ? 'not-allowed' : 'pointer',
|
|
@@ -129,7 +126,7 @@ var _BaseLink = function _BaseLink(_ref3, ref) {
|
|
|
129
126
|
target = _ref3.target,
|
|
130
127
|
rel = _ref3.rel,
|
|
131
128
|
_ref3$color = _ref3.color,
|
|
132
|
-
color = _ref3$color === void 0 ? '
|
|
129
|
+
color = _ref3$color === void 0 ? 'primary' : _ref3$color,
|
|
133
130
|
accessibilityProps = _ref3.accessibilityProps,
|
|
134
131
|
className = _ref3.className,
|
|
135
132
|
style = _ref3.style,
|
|
@@ -147,10 +144,6 @@ var _BaseLink = function _BaseLink(_ref3, ref) {
|
|
|
147
144
|
onTouchStart = _ref3.onTouchStart,
|
|
148
145
|
onTouchEnd = _ref3.onTouchEnd,
|
|
149
146
|
styledProps = _objectWithoutProperties(_ref3, _excluded);
|
|
150
|
-
var _useState = useState(false),
|
|
151
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
152
|
-
isVisited = _useState2[0],
|
|
153
|
-
setIsVisited = _useState2[1];
|
|
154
147
|
var childrenString = getStringFromReactText(children);
|
|
155
148
|
var _useInteraction = useInteraction(),
|
|
156
149
|
currentInteraction = _useInteraction.currentInteraction,
|
|
@@ -173,7 +166,6 @@ var _BaseLink = function _BaseLink(_ref3, ref) {
|
|
|
173
166
|
children: childrenString,
|
|
174
167
|
isDisabled: isDisabled,
|
|
175
168
|
color: color,
|
|
176
|
-
isVisited: isVisited,
|
|
177
169
|
target: target,
|
|
178
170
|
size: size
|
|
179
171
|
}),
|
|
@@ -194,10 +186,6 @@ var _BaseLink = function _BaseLink(_ref3, ref) {
|
|
|
194
186
|
type = _getProps.type,
|
|
195
187
|
lineHeight = _getProps.lineHeight;
|
|
196
188
|
var handleOnClick = function handleOnClick(event) {
|
|
197
|
-
if (!isVisited && variant === 'anchor') {
|
|
198
|
-
// visited state is only valid for anchor variant
|
|
199
|
-
setIsVisited(true);
|
|
200
|
-
}
|
|
201
189
|
if (onClick) {
|
|
202
190
|
onClick(event);
|
|
203
191
|
}
|
|
@@ -275,7 +263,7 @@ var _BaseLink = function _BaseLink(_ref3, ref) {
|
|
|
275
263
|
fontSize: fontSize,
|
|
276
264
|
lineHeight: lineHeight,
|
|
277
265
|
textAlign: "center",
|
|
278
|
-
fontWeight: "
|
|
266
|
+
fontWeight: "medium",
|
|
279
267
|
children: children
|
|
280
268
|
}), Icon && iconPosition == 'right' ? /*#__PURE__*/jsx(BaseBox, {
|
|
281
269
|
as: asProp,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseLink.js","sources":["../../../../../../../src/components/Link/BaseLink/BaseLink.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/prefer-ts-expect-error */\n/* eslint-disable @typescript-eslint/ban-ts-comment */\nimport type { SyntheticEvent } from 'react';\nimport React, { useState } from 'react';\nimport type { CSSObject } from 'styled-components';\nimport type { GestureResponderEvent } from 'react-native';\nimport StyledBaseLink from './StyledBaseLink';\nimport getIn from '~utils/lodashButBetter/get';\nimport useInteraction from '~utils/useInteraction';\nimport type { IconComponent, IconProps } from '~components/Icons';\nimport type { Theme } from '~components/BladeProvider';\nimport { useTheme } from '~components/BladeProvider';\nimport BaseBox from '~components/Box/BaseBox';\nimport { BaseText } from '~components/Typography/BaseText';\nimport type {\n DotNotationSpacingStringToken,\n StringChildrenType,\n TestID,\n BladeElementRef,\n} from '~utils/types';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport type { Platform } from '~utils';\nimport { isReactNative } from '~utils';\nimport type { LinkActionStates } from '~tokens/theme/theme';\nimport type { DurationString, EasingString, FontSize, Typography } from '~tokens/global';\nimport type { BaseTextProps, BaseTextSizes } from '~components/Typography/BaseText/types';\nimport { getStringFromReactText } from '~src/utils/getStringChildren';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { AccessibilityProps } from '~utils/makeAccessible';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport type { BladeCommonEvents } from '~components/types';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { throwBladeError } from '~utils/logger';\n\ntype BaseLinkCommonProps = {\n color?: 'default' | 'white' | 'positive' | 'negative' | 'notice' | 'information' | 'neutral';\n icon?: IconComponent;\n iconPosition?: 'left' | 'right';\n onClick?: (event: SyntheticEvent) => void;\n onBlur?: Platform.Select<{\n native: (event: GestureResponderEvent) => void;\n web: (event: React.FocusEvent<HTMLButtonElement>) => void;\n }>;\n onMouseLeave?: Platform.Select<{\n native: (event: GestureResponderEvent) => void;\n web: (event: React.MouseEvent<HTMLButtonElement>) => void;\n }>;\n onKeyDown?: Platform.Select<{\n native: (event: GestureResponderEvent) => void;\n web: (event: React.KeyboardEvent<HTMLButtonElement>) => void;\n }>;\n accessibilityProps?: Partial<AccessibilityProps>;\n\n /**\n * Sets the size of the link\n *\n * @default medium\n */\n size?: Extract<BaseTextSizes, 'xsmall' | 'small' | 'medium' | 'large'>;\n /**\n * Defines how far your touch can start away from the link. This is a react-native only prop and has no effect on web.\n */\n hitSlop?:\n | {\n top?: number;\n right?: number;\n bottom?: number;\n left?: number;\n }\n | number;\n /**\n * The title of the link which is displayed as a tooltip. This is a web only prop and has no effect on react-native.\n */\n htmlTitle?: string;\n} & TestID &\n StyledPropsBlade &\n Omit<BladeCommonEvents, 'onBlur' | 'onMouseLeave'>;\n\n/*\n Mandatory children prop when icon is not provided\n*/\ntype BaseLinkWithoutIconProps = BaseLinkCommonProps & {\n icon?: undefined;\n children: StringChildrenType;\n};\n\n/*\n Optional children prop when icon is provided\n*/\ntype BaseLinkWithIconProps = BaseLinkCommonProps & {\n icon: IconComponent;\n children?: StringChildrenType;\n};\n\n/*\n BaseLink Props with or without an icon\n*/\ntype BaseLinkPropsWithOrWithoutIcon = BaseLinkWithIconProps | BaseLinkWithoutIconProps;\n\n/*\n BaseLink Props when variant is anchor\n*/\ntype BaseLinkAnchorVariantProps = BaseLinkPropsWithOrWithoutIcon & {\n variant?: 'anchor';\n href?: string;\n target?: string;\n rel?: string;\n isDisabled?: undefined;\n};\n\n/*\n BaseLink Props when variant is button\n*/\ntype BaseLinkButtonVariantProps = BaseLinkPropsWithOrWithoutIcon & {\n variant?: 'button';\n isDisabled?: boolean;\n href?: undefined;\n target?: undefined;\n rel?: undefined;\n};\n\n/*\n BaseLink Props when variant is anchor or button\n*/\nexport type BaseLinkProps = BaseLinkAnchorVariantProps | BaseLinkButtonVariantProps;\n\ntype BaseLinkStyleProps = {\n as: 'a' | 'button';\n textDecorationLine: 'underline' | 'none';\n iconColor: IconProps['color'];\n iconSize: IconProps['size'];\n iconPadding: DotNotationSpacingStringToken;\n textColor: BaseTextProps['color'];\n focusRingColor: string;\n motionDuration: DurationString;\n motionEasing: EasingString;\n cursor: CSSObject['cursor'];\n disabled: boolean;\n role: 'button' | 'link';\n defaultRel: BaseLinkProps['rel'];\n type?: 'button';\n fontSize: BaseTextProps['fontSize'];\n lineHeight: BaseTextProps['lineHeight'];\n};\n\nconst getColorToken = ({\n variant,\n color,\n element,\n currentInteraction,\n isDisabled,\n isVisited,\n}: {\n variant: BaseLinkProps['variant'];\n color: BaseLinkProps['color'];\n element: 'icon' | 'text';\n currentInteraction: keyof LinkActionStates;\n isDisabled: boolean;\n isVisited: boolean;\n}): IconProps['color'] | BaseTextProps['color'] => {\n let state = currentInteraction;\n if (isDisabled && variant == 'button') {\n state = 'disabled';\n }\n if (isVisited && variant == 'anchor') {\n // visited state is only valid for anchor variant\n state = 'visited';\n }\n\n if (color && color !== 'default' && state !== 'visited') {\n if (color !== 'white') {\n return `feedback.${color}.action.${element}.link.${state}.lowContrast`;\n }\n return `white.action.${element}.link.${state}`;\n }\n return `action.${element}.link.${state}`;\n};\n\nconst getProps = ({\n theme,\n variant,\n currentInteraction,\n children,\n isDisabled,\n color,\n isVisited,\n target,\n size,\n}: {\n theme: Theme;\n variant: NonNullable<BaseLinkProps['variant']>;\n currentInteraction: keyof LinkActionStates;\n children?: string;\n isDisabled: boolean;\n color: BaseLinkProps['color'];\n isVisited: boolean;\n target: BaseLinkProps['target'];\n size: NonNullable<BaseLinkProps['size']>;\n}): BaseLinkStyleProps => {\n const isButton = variant === 'button';\n const textSizes: {\n fontSize: Record<NonNullable<BaseLinkProps['size']>, keyof FontSize>;\n lineHeight: Record<NonNullable<BaseLinkProps['size']>, keyof Typography['lineHeights']>;\n } = {\n fontSize: {\n xsmall: 25,\n small: 75,\n medium: 100,\n large: 200,\n },\n lineHeight: {\n xsmall: 50,\n small: 50,\n medium: 100,\n large: 300,\n },\n };\n\n const props: BaseLinkStyleProps = {\n as: isButton ? 'button' : 'a',\n textDecorationLine: !isButton && currentInteraction !== 'default' ? 'underline' : 'none',\n iconColor: getColorToken({\n variant,\n color,\n element: 'icon',\n currentInteraction,\n isDisabled,\n isVisited,\n }) as IconProps['color'],\n fontSize: textSizes.fontSize[size],\n lineHeight: textSizes.lineHeight[size],\n iconSize: size,\n iconPadding: children?.trim() ? 'spacing.2' : 'spacing.0',\n textColor: getColorToken({\n variant,\n color,\n element: 'text',\n currentInteraction,\n isDisabled,\n isVisited,\n }) as BaseTextProps['color'],\n focusRingColor: getIn(theme.colors, 'brand.primary.400'),\n motionDuration: 'duration.2xquick',\n motionEasing: 'easing.standard.effective',\n cursor: isButton && isDisabled ? 'not-allowed' : 'pointer',\n disabled: isButton && isDisabled,\n role: isButton ? 'button' : 'link',\n defaultRel: target && target === '_blank' ? 'noreferrer noopener' : undefined,\n type: isButton ? 'button' : undefined,\n };\n\n return props;\n};\n\nconst _BaseLink: React.ForwardRefRenderFunction<BladeElementRef, BaseLinkProps> = (\n {\n children,\n icon: Icon,\n iconPosition = 'left',\n isDisabled = false,\n onClick,\n onKeyDown,\n variant = 'anchor',\n href,\n target,\n rel,\n color = 'default',\n accessibilityProps,\n // @ts-expect-error avoiding exposing to public\n className,\n // @ts-expect-error avoiding exposing to public\n style,\n size = 'medium',\n testID,\n hitSlop,\n htmlTitle,\n onBlur,\n onFocus,\n onMouseLeave,\n onMouseMove,\n onPointerDown,\n onPointerEnter,\n onTouchStart,\n onTouchEnd,\n ...styledProps\n },\n ref,\n) => {\n const [isVisited, setIsVisited] = useState(false);\n const childrenString = getStringFromReactText(children);\n const { currentInteraction, setCurrentInteraction, ...syntheticEvents } = useInteraction();\n const { theme } = useTheme();\n if (__DEV__) {\n if (!Icon && !childrenString?.trim()) {\n throwBladeError({\n message: `At least one of icon or text is required to render a link.`,\n moduleName: 'BaseLink',\n });\n }\n }\n const {\n as,\n textDecorationLine,\n iconColor,\n iconPadding,\n iconSize,\n fontSize,\n textColor,\n focusRingColor,\n motionDuration,\n motionEasing,\n cursor,\n disabled,\n role,\n defaultRel,\n type,\n lineHeight,\n } = getProps({\n theme,\n variant,\n currentInteraction,\n children: childrenString,\n isDisabled,\n color,\n isVisited,\n target,\n size,\n });\n\n const handleOnClick = (event: SyntheticEvent): void => {\n if (!isVisited && variant === 'anchor') {\n // visited state is only valid for anchor variant\n setIsVisited(true);\n }\n\n if (onClick) {\n onClick(event);\n }\n };\n\n const asProp = isReactNative() ? undefined : 'span';\n return (\n <StyledBaseLink\n ref={ref as never}\n {...metaAttribute({ name: MetaConstants.Link, testID })}\n accessibilityProps={{\n ...makeAccessible({\n role,\n disabled,\n ...accessibilityProps,\n }),\n }}\n variant={variant}\n as={as}\n href={href}\n target={target}\n rel={rel ?? defaultRel}\n onClick={handleOnClick}\n {...syntheticEvents}\n onBlur={(event: any) => {\n onBlur?.(event);\n syntheticEvents.onBlur();\n }}\n onFocus={(event: any) => {\n onFocus?.(event);\n syntheticEvents.onFocus();\n }}\n onMouseLeave={(event: any) => {\n if (onMouseLeave) {\n onMouseLeave(event);\n }\n syntheticEvents.onMouseLeave();\n }}\n onMouseMove={onMouseMove}\n onPointerDown={onPointerDown}\n onPointerEnter={onPointerEnter}\n onTouchStart={onTouchStart}\n onTouchEnd={onTouchEnd}\n onKeyDown={onKeyDown}\n disabled={disabled}\n type={type}\n cursor={cursor}\n focusRingColor={focusRingColor}\n motionDuration={motionDuration}\n motionEasing={motionEasing}\n setCurrentInteraction={setCurrentInteraction}\n {...getStyledProps(styledProps)}\n // @ts-ignore Because we avoided exposing className to public\n className={className}\n style={style}\n hitSlop={hitSlop}\n title={htmlTitle}\n >\n <BaseBox\n as={asProp}\n display=\"flex\"\n flexDirection=\"row\"\n className=\"content-container\"\n alignItems=\"center\"\n >\n {Icon && iconPosition == 'left' ? (\n <BaseBox as={asProp} paddingRight={iconPadding} display=\"flex\" alignItems=\"center\">\n <Icon color={iconColor} size={iconSize} />\n </BaseBox>\n ) : null}\n <BaseText\n as={asProp}\n textDecorationLine={textDecorationLine}\n color={textColor}\n fontSize={fontSize}\n lineHeight={lineHeight}\n textAlign=\"center\"\n fontWeight=\"bold\"\n >\n {children}\n </BaseText>\n {Icon && iconPosition == 'right' ? (\n <BaseBox as={asProp} paddingLeft={iconPadding} display=\"flex\" alignItems=\"center\">\n <Icon color={iconColor} size={iconSize} />\n </BaseBox>\n ) : null}\n </BaseBox>\n </StyledBaseLink>\n );\n};\n\nconst BaseLink = assignWithoutSideEffects(React.forwardRef(_BaseLink), {\n displayName: 'BaseLink',\n componentId: 'BaseLink',\n});\n\nexport default BaseLink;\n"],"names":["getColorToken","_ref","variant","color","element","currentInteraction","isDisabled","isVisited","state","concat","getProps","_ref2","theme","children","target","size","isButton","textSizes","fontSize","xsmall","small","medium","large","lineHeight","props","as","textDecorationLine","iconColor","iconSize","iconPadding","trim","textColor","focusRingColor","getIn","colors","motionDuration","motionEasing","cursor","disabled","role","defaultRel","undefined","type","_BaseLink","_ref3","ref","Icon","icon","_ref3$iconPosition","iconPosition","_ref3$isDisabled","onClick","onKeyDown","_ref3$variant","href","rel","_ref3$color","accessibilityProps","className","style","_ref3$size","testID","hitSlop","htmlTitle","onBlur","onFocus","onMouseLeave","onMouseMove","onPointerDown","onPointerEnter","onTouchStart","onTouchEnd","styledProps","_objectWithoutProperties","_excluded","_useState","useState","_useState2","_slicedToArray","setIsVisited","childrenString","getStringFromReactText","_useInteraction","useInteraction","setCurrentInteraction","syntheticEvents","_excluded2","_useTheme","useTheme","throwBladeError","message","moduleName","_getProps","handleOnClick","event","asProp","isReactNative","_jsx","StyledBaseLink","_objectSpread","metaAttribute","name","MetaConstants","Link","makeAccessible","getStyledProps","title","_jsxs","BaseBox","display","flexDirection","alignItems","paddingRight","BaseText","textAlign","fontWeight","paddingLeft","BaseLink","assignWithoutSideEffects","React","forwardRef","displayName","componentId"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmJA,IAAMA,aAAa,GAAG,SAAhBA,aAAaA,CAAAC,IAAA,EAcgC;AAAA,EAAA,IAbjDC,OAAO,GAAAD,IAAA,CAAPC,OAAO;IACPC,KAAK,GAAAF,IAAA,CAALE,KAAK;IACLC,OAAO,GAAAH,IAAA,CAAPG,OAAO;IACPC,kBAAkB,GAAAJ,IAAA,CAAlBI,kBAAkB;IAClBC,UAAU,GAAAL,IAAA,CAAVK,UAAU;IACVC,SAAS,GAAAN,IAAA,CAATM,SAAS,CAAA;EAST,IAA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AAA,kBAAkB,EAAEA,kBAAmB;AACvCvB,QAAAA,KAAK,EAAE4B,SAAU;AACjBb,QAAAA,QAAQ,EAAEA,QAAS;AACnBK,QAAAA,UAAU,EAAEA,UAAW;AACvB2F,QAAAA,SAAS,EAAC,QAAQ;AAClBC,QAAAA,UAAU,EAAC,MAAM;AAAAtG,QAAAA,QAAA,EAEhBA,QAAAA;OACO,CAAC,EACViC,IAAI,IAAIG,YAAY,IAAI,OAAO,gBAC9BgD,GAAA,CAACW,OAAO,EAAA;AAACnF,QAAAA,EAAE,EAAEsE,MAAO;AAACqB,QAAAA,WAAW,EAAEvF,WAAY;AAACgF,QAAAA,OAAO,EAAC,MAAM;AAACE,QAAAA,UAAU,EAAC,QAAQ;QAAAlG,QAAA,eAC/EoF,GAAA,CAACnD,IAAI,EAAA;AAAC3C,UAAAA,KAAK,EAAEwB,SAAU;AAACZ,UAAAA,IAAI,EAAEa,QAAAA;SAAW,CAAA;OAClC,CAAC,GACR,IAAI,CAAA;KACD,CAAA;AAAC,GAAA,CACI,CAAC,CAAA;AAErB,CAAC,CAAA;AAEKyF,IAAAA,QAAQ,gBAAGC,wBAAwB,eAACC,cAAK,CAACC,UAAU,CAAC7E,SAAS,CAAC,EAAE;AACrE8E,EAAAA,WAAW,EAAE,UAAU;AACvBC,EAAAA,WAAW,EAAE,UAAA;AACf,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"BaseLink.js","sources":["../../../../../../../src/components/Link/BaseLink/BaseLink.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/prefer-ts-expect-error */\n/* eslint-disable @typescript-eslint/ban-ts-comment */\nimport type { SyntheticEvent } from 'react';\nimport React from 'react';\nimport type { CSSObject } from 'styled-components';\nimport type { GestureResponderEvent } from 'react-native';\nimport StyledBaseLink from './StyledBaseLink';\nimport getIn from '~utils/lodashButBetter/get';\nimport useInteraction from '~utils/useInteraction';\nimport type { IconColors, IconComponent, IconProps } from '~components/Icons';\nimport type { Theme } from '~components/BladeProvider';\nimport { useTheme } from '~components/BladeProvider';\nimport BaseBox from '~components/Box/BaseBox';\nimport { BaseText } from '~components/Typography/BaseText';\nimport type {\n DotNotationSpacingStringToken,\n StringChildrenType,\n TestID,\n BladeElementRef,\n} from '~utils/types';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport type { Platform } from '~utils';\nimport { isReactNative } from '~utils';\nimport type { DurationString, EasingString, FontSize, Typography } from '~tokens/global';\nimport type {\n BaseTextProps,\n BaseTextSizes,\n TextColors,\n} from '~components/Typography/BaseText/types';\nimport { getStringFromReactText } from '~src/utils/getStringChildren';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { AccessibilityProps } from '~utils/makeAccessible';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport type { BladeCommonEvents } from '~components/types';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { throwBladeError } from '~utils/logger';\nimport type { ActionStates } from '~utils/useInteraction';\n\ntype BaseLinkCommonProps = {\n color?: 'primary' | 'white' | 'positive' | 'negative' | 'notice' | 'information' | 'neutral';\n icon?: IconComponent;\n iconPosition?: 'left' | 'right';\n onClick?: (event: SyntheticEvent) => void;\n onBlur?: Platform.Select<{\n native: (event: GestureResponderEvent) => void;\n web: (event: React.FocusEvent<HTMLButtonElement>) => void;\n }>;\n onMouseLeave?: Platform.Select<{\n native: (event: GestureResponderEvent) => void;\n web: (event: React.MouseEvent<HTMLButtonElement>) => void;\n }>;\n onKeyDown?: Platform.Select<{\n native: (event: GestureResponderEvent) => void;\n web: (event: React.KeyboardEvent<HTMLButtonElement>) => void;\n }>;\n accessibilityProps?: Partial<AccessibilityProps>;\n\n /**\n * Sets the size of the link\n *\n * @default medium\n */\n size?: Extract<BaseTextSizes, 'xsmall' | 'small' | 'medium' | 'large'>;\n /**\n * Defines how far your touch can start away from the link. This is a react-native only prop and has no effect on web.\n */\n hitSlop?:\n | {\n top?: number;\n right?: number;\n bottom?: number;\n left?: number;\n }\n | number;\n /**\n * The title of the link which is displayed as a tooltip. This is a web only prop and has no effect on react-native.\n */\n htmlTitle?: string;\n} & TestID &\n StyledPropsBlade &\n Omit<BladeCommonEvents, 'onBlur' | 'onMouseLeave'>;\n\n/*\n Mandatory children prop when icon is not provided\n*/\ntype BaseLinkWithoutIconProps = BaseLinkCommonProps & {\n icon?: undefined;\n children: StringChildrenType;\n};\n\n/*\n Optional children prop when icon is provided\n*/\ntype BaseLinkWithIconProps = BaseLinkCommonProps & {\n icon: IconComponent;\n children?: StringChildrenType;\n};\n\n/*\n BaseLink Props with or without an icon\n*/\ntype BaseLinkPropsWithOrWithoutIcon = BaseLinkWithIconProps | BaseLinkWithoutIconProps;\n\n/*\n BaseLink Props when variant is anchor\n*/\ntype BaseLinkAnchorVariantProps = BaseLinkPropsWithOrWithoutIcon & {\n variant?: 'anchor';\n href?: string;\n target?: string;\n rel?: string;\n isDisabled?: undefined;\n};\n\n/*\n BaseLink Props when variant is button\n*/\ntype BaseLinkButtonVariantProps = BaseLinkPropsWithOrWithoutIcon & {\n variant?: 'button';\n isDisabled?: boolean;\n href?: undefined;\n target?: undefined;\n rel?: undefined;\n};\n\n/*\n BaseLink Props when variant is anchor or button\n*/\nexport type BaseLinkProps = BaseLinkAnchorVariantProps | BaseLinkButtonVariantProps;\n\ntype BaseLinkStyleProps = {\n as: 'a' | 'button';\n textDecorationLine: 'underline' | 'none';\n iconColor: IconProps['color'];\n iconSize: IconProps['size'];\n iconPadding: DotNotationSpacingStringToken;\n textColor: BaseTextProps['color'];\n focusRingColor: string;\n motionDuration: DurationString;\n motionEasing: EasingString;\n cursor: CSSObject['cursor'];\n disabled: boolean;\n role: 'button' | 'link';\n defaultRel: BaseLinkProps['rel'];\n type?: 'button';\n fontSize: BaseTextProps['fontSize'];\n lineHeight: BaseTextProps['lineHeight'];\n};\n\ntype LinkActionStates = ActionStates;\nconst getColorToken = ({\n variant,\n color,\n currentInteraction,\n isDisabled,\n element,\n}: {\n variant: BaseLinkProps['variant'];\n color: BaseLinkProps['color'];\n element: 'icon' | 'text';\n currentInteraction: LinkActionStates;\n isDisabled: boolean;\n}): IconColors | TextColors => {\n let state = currentInteraction;\n const map = {\n default: 'normal',\n hover: 'subtle',\n focus: 'normal',\n disabled: 'disabled',\n } as const;\n\n if (isDisabled && variant == 'button') {\n state = 'disabled';\n }\n\n if (color && color !== 'primary') {\n if (color !== 'white') {\n return `interactive.${element}.${color}.${map[state]}`;\n }\n return `interactive.${element}.staticWhite.${map[state]}`;\n }\n return `interactive.${element}.primary.${map[state]}`;\n};\n\nconst getProps = ({\n theme,\n variant,\n currentInteraction,\n children,\n isDisabled,\n color,\n target,\n size,\n}: {\n theme: Theme;\n variant: NonNullable<BaseLinkProps['variant']>;\n currentInteraction: LinkActionStates;\n children?: string;\n isDisabled: boolean;\n color: BaseLinkProps['color'];\n target: BaseLinkProps['target'];\n size: NonNullable<BaseLinkProps['size']>;\n}): BaseLinkStyleProps => {\n const isButton = variant === 'button';\n const textSizes: {\n fontSize: Record<NonNullable<BaseLinkProps['size']>, keyof FontSize>;\n lineHeight: Record<NonNullable<BaseLinkProps['size']>, keyof Typography['lineHeights']>;\n } = {\n fontSize: {\n xsmall: 25,\n small: 75,\n medium: 100,\n large: 200,\n },\n lineHeight: {\n xsmall: 25,\n small: 75,\n medium: 100,\n large: 200,\n },\n };\n\n const props: BaseLinkStyleProps = {\n as: isButton ? 'button' : 'a',\n textDecorationLine: !isButton && currentInteraction !== 'default' ? 'underline' : 'none',\n iconColor: getColorToken({\n variant,\n color,\n element: 'icon',\n currentInteraction,\n isDisabled,\n }) as IconProps['color'],\n fontSize: textSizes.fontSize[size],\n lineHeight: textSizes.lineHeight[size],\n iconSize: size,\n iconPadding: children?.trim() ? 'spacing.2' : 'spacing.0',\n textColor: getColorToken({\n variant,\n color,\n element: 'text',\n currentInteraction,\n isDisabled,\n }) as BaseTextProps['color'],\n focusRingColor: getIn(theme.colors, 'interactive.background.primary.faded'),\n motionDuration: 'duration.2xquick',\n motionEasing: 'easing.standard.effective',\n cursor: isButton && isDisabled ? 'not-allowed' : 'pointer',\n disabled: isButton && isDisabled,\n role: isButton ? 'button' : 'link',\n defaultRel: target && target === '_blank' ? 'noreferrer noopener' : undefined,\n type: isButton ? 'button' : undefined,\n };\n\n return props;\n};\n\nconst _BaseLink: React.ForwardRefRenderFunction<BladeElementRef, BaseLinkProps> = (\n {\n children,\n icon: Icon,\n iconPosition = 'left',\n isDisabled = false,\n onClick,\n onKeyDown,\n variant = 'anchor',\n href,\n target,\n rel,\n color = 'primary',\n accessibilityProps,\n // @ts-expect-error avoiding exposing to public\n className,\n // @ts-expect-error avoiding exposing to public\n style,\n size = 'medium',\n testID,\n hitSlop,\n htmlTitle,\n onBlur,\n onFocus,\n onMouseLeave,\n onMouseMove,\n onPointerDown,\n onPointerEnter,\n onTouchStart,\n onTouchEnd,\n ...styledProps\n },\n ref,\n) => {\n const childrenString = getStringFromReactText(children);\n const { currentInteraction, setCurrentInteraction, ...syntheticEvents } = useInteraction();\n const { theme } = useTheme();\n if (__DEV__) {\n if (!Icon && !childrenString?.trim()) {\n throwBladeError({\n message: `At least one of icon or text is required to render a link.`,\n moduleName: 'BaseLink',\n });\n }\n }\n const {\n as,\n textDecorationLine,\n iconColor,\n iconPadding,\n iconSize,\n fontSize,\n textColor,\n focusRingColor,\n motionDuration,\n motionEasing,\n cursor,\n disabled,\n role,\n defaultRel,\n type,\n lineHeight,\n } = getProps({\n theme,\n variant,\n currentInteraction,\n children: childrenString,\n isDisabled,\n color,\n target,\n size,\n });\n\n const handleOnClick = (event: SyntheticEvent): void => {\n if (onClick) {\n onClick(event);\n }\n };\n\n const asProp = isReactNative() ? undefined : 'span';\n return (\n <StyledBaseLink\n ref={ref as never}\n {...metaAttribute({ name: MetaConstants.Link, testID })}\n accessibilityProps={{\n ...makeAccessible({\n role,\n disabled,\n ...accessibilityProps,\n }),\n }}\n variant={variant}\n as={as}\n href={href}\n target={target}\n rel={rel ?? defaultRel}\n onClick={handleOnClick}\n {...syntheticEvents}\n onBlur={(event: any) => {\n onBlur?.(event);\n syntheticEvents.onBlur();\n }}\n onFocus={(event: any) => {\n onFocus?.(event);\n syntheticEvents.onFocus();\n }}\n onMouseLeave={(event: any) => {\n if (onMouseLeave) {\n onMouseLeave(event);\n }\n syntheticEvents.onMouseLeave();\n }}\n onMouseMove={onMouseMove}\n onPointerDown={onPointerDown}\n onPointerEnter={onPointerEnter}\n onTouchStart={onTouchStart}\n onTouchEnd={onTouchEnd}\n onKeyDown={onKeyDown}\n disabled={disabled}\n type={type}\n cursor={cursor}\n focusRingColor={focusRingColor}\n motionDuration={motionDuration}\n motionEasing={motionEasing}\n setCurrentInteraction={setCurrentInteraction}\n {...getStyledProps(styledProps)}\n // @ts-ignore Because we avoided exposing className to public\n className={className}\n style={style}\n hitSlop={hitSlop}\n title={htmlTitle}\n >\n <BaseBox\n as={asProp}\n display=\"flex\"\n flexDirection=\"row\"\n className=\"content-container\"\n alignItems=\"center\"\n >\n {Icon && iconPosition == 'left' ? (\n <BaseBox as={asProp} paddingRight={iconPadding} display=\"flex\" alignItems=\"center\">\n <Icon color={iconColor} size={iconSize} />\n </BaseBox>\n ) : null}\n <BaseText\n as={asProp}\n textDecorationLine={textDecorationLine}\n color={textColor}\n fontSize={fontSize}\n lineHeight={lineHeight}\n textAlign=\"center\"\n fontWeight=\"medium\"\n >\n {children}\n </BaseText>\n {Icon && iconPosition == 'right' ? (\n <BaseBox as={asProp} paddingLeft={iconPadding} display=\"flex\" alignItems=\"center\">\n <Icon color={iconColor} size={iconSize} />\n </BaseBox>\n ) : null}\n </BaseBox>\n </StyledBaseLink>\n );\n};\n\nconst BaseLink = assignWithoutSideEffects(React.forwardRef(_BaseLink), {\n displayName: 'BaseLink',\n componentId: 'BaseLink',\n});\n\nexport default BaseLink;\n"],"names":["getColorToken","_ref","variant","color","currentInteraction","isDisabled","element","state","map","hover","focus","disabled","concat","getProps","_ref2","theme","children","target","size","isButton","textSizes","fontSize","xsmall","small","medium","large","lineHeight","props","as","textDecorationLine","iconColor","iconSize","iconPadding","trim","textColor","focusRingColor","getIn","colors","motionDuration","motionEasing","cursor","role","defaultRel","undefined","type","_BaseLink","_ref3","ref","Icon","icon","_ref3$iconPosition","iconPosition","_ref3$isDisabled","onClick","onKeyDown","_ref3$variant","href","rel","_ref3$color","accessibilityProps","className","style","_ref3$size","testID","hitSlop","htmlTitle","onBlur","onFocus","onMouseLeave","onMouseMove","onPointerDown","onPointerEnter","onTouchStart","onTouchEnd","styledProps","_objectWithoutProperties","_excluded","childrenString","getStringFromReactText","_useInteraction","useInteraction","setCurrentInteraction","syntheticEvents","_excluded2","_useTheme","useTheme","throwBladeError","message","moduleName","_getProps","handleOnClick","event","asProp","isReactNative","_jsx","StyledBaseLink","_objectSpread","metaAttribute","name","MetaConstants","Link","makeAccessible","getStyledProps","title","_jsxs","BaseBox","display","flexDirection","alignItems","paddingRight","BaseText","textAlign","fontWeight","paddingLeft","BaseLink","assignWithoutSideEffects","React","forwardRef","displayName","componentId"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwJA,IAAMA,aAAa,GAAG,SAAhBA,aAAaA,CAAAC,IAAA,EAYY;AAAA,EAAA,IAX7BC,OAAO,GAAAD,IAAA,CAAPC,OAAO;IACPC,KAAK,GAAAF,IAAA,CAALE,KAAK;IACLC,kBAAkB,GAAAH,IAAA,CAAlBG,kBAAkB;IAClBC,UAAU,GAAAJ,IAAA,CAAVI,UAAU;IACVC,OAAO,GAAAL,IAAA,CAAPK,OAAO,CAAA;EAQP,IAAIC,KAAK,GAAGH,kBAAkB,CAAA;AAC9B,EAAA,IAAMI,GAAG,GAAG;AACV,IAAA,SAAA,EAAS,QAAQ;AACjBC,IAAAA,KAAK,EAAE,QAAQ;AACfC,IAAAA,KAAK,EAAE,QAAQ;AACfC,IAAAA,QAAQ,EAAE,UAAA;GACF,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CAAC,GACR,IAAI,CAAA;KACD,CAAA;AAAC,GAAA,CACI,CAAC,CAAA;AAErB,CAAC,CAAA;AAEKmF,IAAAA,QAAQ,gBAAGC,wBAAwB,eAACC,cAAK,CAACC,UAAU,CAACxE,SAAS,CAAC,EAAE;AACrEyE,EAAAA,WAAW,EAAE,UAAU;AACvBC,EAAAA,WAAW,EAAE,UAAA;AACf,CAAC;;;;"}
|
|
@@ -23,7 +23,7 @@ var _Link = function _Link(_ref, ref) {
|
|
|
23
23
|
_ref$variant = _ref.variant,
|
|
24
24
|
variant = _ref$variant === void 0 ? 'anchor' : _ref$variant,
|
|
25
25
|
_ref$color = _ref.color,
|
|
26
|
-
color = _ref$color === void 0 ? '
|
|
26
|
+
color = _ref$color === void 0 ? 'primary' : _ref$color,
|
|
27
27
|
href = _ref.href,
|
|
28
28
|
target = _ref.target,
|
|
29
29
|
rel = _ref.rel,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Link.js","sources":["../../../../../../../src/components/Link/Link/Link.tsx"],"sourcesContent":["import type { ReactElement, SyntheticEvent } from 'react';\nimport React from 'react';\nimport type { BaseLinkProps } from '../BaseLink';\nimport { BaseLink } from '../BaseLink';\nimport type { IconComponent } from '~components/Icons';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { StringChildrenType, TestID, BladeElementRef } from '~utils/types';\nimport type { Platform } from '~utils';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport type { BladeCommonEvents } from '~components/types';\n\ntype LinkCommonProps = {\n variant?: 'anchor' | 'button';\n icon?: IconComponent;\n color?: '
|
|
1
|
+
{"version":3,"file":"Link.js","sources":["../../../../../../../src/components/Link/Link/Link.tsx"],"sourcesContent":["import type { ReactElement, SyntheticEvent } from 'react';\nimport React from 'react';\nimport type { BaseLinkProps } from '../BaseLink';\nimport { BaseLink } from '../BaseLink';\nimport type { IconComponent } from '~components/Icons';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { StringChildrenType, TestID, BladeElementRef } from '~utils/types';\nimport type { Platform } from '~utils';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport type { BladeCommonEvents } from '~components/types';\n\ntype LinkCommonProps = {\n variant?: 'anchor' | 'button';\n icon?: IconComponent;\n color?: 'primary' | 'white' | 'neutral';\n iconPosition?: 'left' | 'right';\n isDisabled?: boolean;\n onClick?: (event: SyntheticEvent) => void;\n href?: string;\n target?: string;\n accessibilityLabel?: string;\n\n /**\n * It is exposed for internal usage with tooltip.\n *\n * @private\n */\n 'aria-describedby'?: string;\n\n /**\n * Sets the size of the link\n *\n * @default medium\n */\n size?: BaseLinkProps['size'];\n} & TestID &\n StyledPropsBlade &\n BladeCommonEvents &\n Platform.Select<{\n native: {\n /**\n * Defines how far your touch can start away from the link\n */\n hitSlop?:\n | {\n top?: number;\n right?: number;\n bottom?: number;\n left?: number;\n }\n | number;\n /**\n * This is a web only prop and has no effect on react-native.\n */\n htmlTitle?: undefined;\n };\n web: {\n /**\n * This is a react-native only prop and has no effect on web.\n */\n hitSlop?: undefined;\n /**\n * The title of the link which is displayed as a tooltip.\n */\n htmlTitle?: string;\n };\n }>;\n\n/*\n Mandatory children prop when icon is not provided\n*/\ntype LinkWithoutIconProps = LinkCommonProps & {\n icon?: undefined;\n children: StringChildrenType;\n};\n\n/*\n Optional children prop when icon is provided\n*/\ntype LinkWithIconProps = LinkCommonProps & {\n icon: IconComponent;\n children?: StringChildrenType;\n};\n\n/*\n Link Props with or without an icon\n*/\ntype LinkPropsWithOrWithoutIcon = LinkWithIconProps | LinkWithoutIconProps;\n\n/*\n Link Props when variant is anchor\n*/\ntype LinkAnchorVariantProps = LinkPropsWithOrWithoutIcon & {\n variant?: 'anchor';\n href?: string;\n target?: string;\n rel?: string;\n isDisabled?: undefined;\n};\n\n/*\n Link Props when variant is button\n*/\nexport type LinkButtonVariantProps = LinkPropsWithOrWithoutIcon & {\n variant?: 'button';\n isDisabled?: boolean;\n href?: undefined;\n target?: undefined;\n rel?: undefined;\n};\n\n/*\n Link Props when variant is anchor or button\n*/\nexport type LinkProps = LinkAnchorVariantProps | LinkButtonVariantProps;\n\nconst _Link: React.ForwardRefRenderFunction<BladeElementRef, LinkProps> = (\n {\n children,\n icon,\n iconPosition = 'left',\n isDisabled = false,\n onClick,\n variant = 'anchor',\n color = 'primary',\n href,\n target,\n rel,\n accessibilityLabel,\n size = 'medium',\n testID,\n hitSlop,\n htmlTitle,\n onBlur,\n onFocus,\n onMouseLeave,\n onMouseMove,\n onPointerDown,\n onPointerEnter,\n onTouchStart,\n onTouchEnd,\n ...rest\n },\n ref,\n): ReactElement => {\n return (\n <BaseLink\n {...(icon ? { icon, children } : { children })}\n {...(variant === 'anchor' ? { variant, href, target, rel } : { variant, isDisabled })}\n ref={ref as never}\n iconPosition={iconPosition}\n onClick={onClick}\n accessibilityProps={{ label: accessibilityLabel, describedBy: rest['aria-describedby'] }}\n size={size}\n color={color}\n testID={testID}\n hitSlop={hitSlop}\n htmlTitle={htmlTitle}\n onBlur={onBlur}\n onFocus={onFocus}\n onMouseLeave={onMouseLeave}\n onMouseMove={onMouseMove}\n onPointerDown={onPointerDown}\n onPointerEnter={onPointerEnter}\n onTouchStart={onTouchStart}\n onTouchEnd={onTouchEnd}\n {...getStyledProps(rest)}\n />\n );\n};\n\nconst Link = assignWithoutSideEffects(React.forwardRef(_Link), {\n displayName: 'Link',\n componentId: 'Link',\n});\n\nexport default Link;\n"],"names":["_Link","_ref","ref","children","icon","_ref$iconPosition","iconPosition","_ref$isDisabled","isDisabled","onClick","_ref$variant","variant","_ref$color","color","href","target","rel","accessibilityLabel","_ref$size","size","testID","hitSlop","htmlTitle","onBlur","onFocus","onMouseLeave","onMouseMove","onPointerDown","onPointerEnter","onTouchStart","onTouchEnd","rest","_objectWithoutProperties","_excluded","_jsx","BaseLink","_objectSpread","accessibilityProps","label","describedB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AEA,SAAU;AACrBC,IAAAA,MAAM,EAAEA,MAAO;AACfC,IAAAA,OAAO,EAAEA,OAAQ;AACjBC,IAAAA,YAAY,EAAEA,YAAa;AAC3BC,IAAAA,WAAW,EAAEA,WAAY;AACzBC,IAAAA,aAAa,EAAEA,aAAc;AAC7BC,IAAAA,cAAc,EAAEA,cAAe;AAC/BC,IAAAA,YAAY,EAAEA,YAAa;AAC3BC,IAAAA,UAAU,EAAEA,UAAAA;AAAW,GAAA,EACnBU,cAAc,CAACT,IAAI,CAAC,CACzB,CAAC,CAAA;AAEN,CAAC,CAAA;AAEKU,IAAAA,IAAI,gBAAGC,wBAAwB,eAACC,cAAK,CAACC,UAAU,CAAC5C,KAAK,CAAC,EAAE;AAC7D6C,EAAAA,WAAW,EAAE,MAAM;AACnBC,EAAAA,WAAW,EAAE,MAAA;AACf,CAAC;;;;"}
|
|
@@ -105,9 +105,7 @@ var _List = function _List(_ref3) {
|
|
|
105
105
|
return /*#__PURE__*/jsx(ListProvider, {
|
|
106
106
|
value: listContextValue,
|
|
107
107
|
children: /*#__PURE__*/jsx(BaseBox, _objectSpread(_objectSpread({}, getStyledProps(styledProps)), {}, {
|
|
108
|
-
children: /*#__PURE__*/jsx(ListElement, _objectSpread(_objectSpread(_objectSpread({
|
|
109
|
-
marginTop: level ? undefined : 'spacing.3'
|
|
110
|
-
}, metaAttribute({
|
|
108
|
+
children: /*#__PURE__*/jsx(ListElement, _objectSpread(_objectSpread(_objectSpread({}, metaAttribute({
|
|
111
109
|
name: MetaConstants.List,
|
|
112
110
|
testID: testID
|
|
113
111
|
})), makeAccessible({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"List.js","sources":["../../../../../../src/components/List/List.tsx"],"sourcesContent":["import React, { useMemo } from 'react';\nimport styled from 'styled-components';\nimport { ListProvider, useListContext } from './ListContext';\nimport { UnorderedList } from './UnorderedList';\nimport { OrderedList } from './OrderedList';\nimport type { ListItemProps } from './ListItem';\nimport getIn from '~utils/lodashButBetter/get';\nimport type { IconComponent } from '~components/Icons';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport type { DotNotationSpacingStringToken, TestID } from '~utils/types';\nimport BaseBox from '~components/Box/BaseBox';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { makeSpace } from '~utils/makeSpace';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport { isValidAllowedChildren } from '~utils/isValidAllowedChildren';\nimport { throwBladeError } from '~utils/logger';\n\ntype ListCommonProps = {\n /**\n * ListItem to be rendered for the List.\n *\n */\n children: React.ReactElement<ListItemProps> | React.ReactElement<ListItemProps>[];\n /**\n * Sets the variant to be rendered for the List.\n *\n * @default 'unordered'\n */\n variant?: 'unordered' | 'ordered' | 'ordered-filled';\n /**\n * Sets the size for the List.\n *\n * @default 'medium'\n */\n size?: 'small' | 'medium' | 'large';\n} & TestID &\n StyledPropsBlade;\n\ntype ListWithIconProps = ListCommonProps & {\n variant?: 'unordered';\n icon?: IconComponent;\n};\ntype ListWithoutIconProps = ListCommonProps & {\n variant?: 'ordered' | 'ordered-filled';\n icon?: undefined;\n};\ntype ListProps = ListWithIconProps | ListWithoutIconProps;\n\nconst StyledOrderedList = styled(OrderedList)<{ marginTop?: DotNotationSpacingStringToken }>(\n ({ marginTop, theme }) => ({\n marginTop: marginTop ? makeSpace(getIn(theme, marginTop)) : undefined,\n }),\n);\n\nconst StyledUnorderedList = styled(UnorderedList)<{ marginTop?: DotNotationSpacingStringToken }>(\n ({ marginTop, theme }) => ({\n marginTop: marginTop ? makeSpace(getIn(theme, marginTop)) : undefined,\n }),\n);\n\n/**\n * List Component is used to display a set of related items that are composed of text/links. Each list item begins with a bullet or a number.\n *\n * ## Usage\n *\n * ```tsx\n * <List\n * variant='unordered'\n * size='medium'\n * >\n * <ListItem>\n * Item 1\n * <List>\n * <ListItem>Item 1.1</ListItem>\n * </List>\n * </ListItem>\n * <ListItem>Item 2</ListItem>\n * <List />\n * ```\n */\nconst _List = ({\n variant = 'unordered',\n size,\n children,\n icon,\n testID,\n ...styledProps\n}: ListProps): React.ReactElement => {\n const ListElement = variant === 'unordered' ? StyledUnorderedList : StyledOrderedList;\n const { level, size: listContextSize } = useListContext();\n const listContextValue = useMemo(\n () => ({\n level: level ? level + 1 : 1,\n size: size ?? listContextSize,\n icon,\n variant,\n }),\n [icon, level, listContextSize, size, variant],\n );\n\n const childrenArray = React.Children.toArray(children);\n const childListItems = childrenArray.filter((child) => {\n if (isValidAllowedChildren(child, MetaConstants.ListItem)) {\n return child;\n }\n if (__DEV__) {\n throwBladeError({\n message: 'You can only pass a ListItem as a child to List.',\n moduleName: 'List',\n });\n }\n return null;\n });\n\n return (\n <ListProvider value={listContextValue}>\n <BaseBox {...getStyledProps(styledProps)}>\n <ListElement\n
|
|
1
|
+
{"version":3,"file":"List.js","sources":["../../../../../../src/components/List/List.tsx"],"sourcesContent":["import React, { useMemo } from 'react';\nimport styled from 'styled-components';\nimport { ListProvider, useListContext } from './ListContext';\nimport { UnorderedList } from './UnorderedList';\nimport { OrderedList } from './OrderedList';\nimport type { ListItemProps } from './ListItem';\nimport getIn from '~utils/lodashButBetter/get';\nimport type { IconComponent } from '~components/Icons';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport type { DotNotationSpacingStringToken, TestID } from '~utils/types';\nimport BaseBox from '~components/Box/BaseBox';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { makeSpace } from '~utils/makeSpace';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport { isValidAllowedChildren } from '~utils/isValidAllowedChildren';\nimport { throwBladeError } from '~utils/logger';\n\ntype ListCommonProps = {\n /**\n * ListItem to be rendered for the List.\n *\n */\n children: React.ReactElement<ListItemProps> | React.ReactElement<ListItemProps>[];\n /**\n * Sets the variant to be rendered for the List.\n *\n * @default 'unordered'\n */\n variant?: 'unordered' | 'ordered' | 'ordered-filled';\n /**\n * Sets the size for the List.\n *\n * @default 'medium'\n */\n size?: 'small' | 'medium' | 'large';\n} & TestID &\n StyledPropsBlade;\n\ntype ListWithIconProps = ListCommonProps & {\n variant?: 'unordered';\n icon?: IconComponent;\n};\ntype ListWithoutIconProps = ListCommonProps & {\n variant?: 'ordered' | 'ordered-filled';\n icon?: undefined;\n};\ntype ListProps = ListWithIconProps | ListWithoutIconProps;\n\nconst StyledOrderedList = styled(OrderedList)<{ marginTop?: DotNotationSpacingStringToken }>(\n ({ marginTop, theme }) => ({\n marginTop: marginTop ? makeSpace(getIn(theme, marginTop)) : undefined,\n }),\n);\n\nconst StyledUnorderedList = styled(UnorderedList)<{ marginTop?: DotNotationSpacingStringToken }>(\n ({ marginTop, theme }) => ({\n marginTop: marginTop ? makeSpace(getIn(theme, marginTop)) : undefined,\n }),\n);\n\n/**\n * List Component is used to display a set of related items that are composed of text/links. Each list item begins with a bullet or a number.\n *\n * ## Usage\n *\n * ```tsx\n * <List\n * variant='unordered'\n * size='medium'\n * >\n * <ListItem>\n * Item 1\n * <List>\n * <ListItem>Item 1.1</ListItem>\n * </List>\n * </ListItem>\n * <ListItem>Item 2</ListItem>\n * <List />\n * ```\n */\nconst _List = ({\n variant = 'unordered',\n size,\n children,\n icon,\n testID,\n ...styledProps\n}: ListProps): React.ReactElement => {\n const ListElement = variant === 'unordered' ? StyledUnorderedList : StyledOrderedList;\n const { level, size: listContextSize } = useListContext();\n const listContextValue = useMemo(\n () => ({\n level: level ? level + 1 : 1,\n size: size ?? listContextSize,\n icon,\n variant,\n }),\n [icon, level, listContextSize, size, variant],\n );\n\n const childrenArray = React.Children.toArray(children);\n const childListItems = childrenArray.filter((child) => {\n if (isValidAllowedChildren(child, MetaConstants.ListItem)) {\n return child;\n }\n if (__DEV__) {\n throwBladeError({\n message: 'You can only pass a ListItem as a child to List.',\n moduleName: 'List',\n });\n }\n return null;\n });\n\n return (\n <ListProvider value={listContextValue}>\n <BaseBox {...getStyledProps(styledProps)}>\n <ListElement\n {...metaAttribute({ name: MetaConstants.List, testID })}\n {...makeAccessible({ role: 'list' })} // Role needed for react-native\n >\n {variant === 'unordered'\n ? childListItems\n : childListItems.map(\n (child, index) =>\n React.cloneElement(child as React.ReactElement, { _itemNumber: index + 1 }), // adds _itemNumber for rendering ordered list bullets\n )}\n </ListElement>\n </BaseBox>\n </ListProvider>\n );\n};\n\nconst List = assignWithoutSideEffects(_List, { componentId: MetaConstants.List });\n\nexport { List };\nexport type { ListProps };\n"],"names":["StyledOrderedList","styled","OrderedList","withConfig","displayName","componentId","_ref","marginTop","theme","makeSpace","getIn","undefined","StyledUnorderedList","UnorderedList","_ref2","_List","_ref3","_ref3$variant","variant","size","children","icon","testID","styledProps","_objectWithoutProperties","_excluded","ListElement","_useListContext","useListContext","level","listContextSize","listContextValue","useMemo","childrenArray","React","Children","toArray","childListItems","filter","child","isValidAllowedChildren","MetaConstants","ListItem","throwBladeError","message","moduleName","_jsx","ListProvider","value","BaseBox","_objectSpread","getStyledProps","metaAttribute","name","List","makeAccessible","role","map","index","cloneElement","_itemNumber","assignWithoutSideEffects"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkDA,IAAMA,iBAAiB,gBAAGC,MAAM,CAACC,WAAW,CAAC,CAAAC,UAAA,CAAA;EAAAC,WAAA,EAAA,yBAAA;EAAAC,WAAA,EAAA,UAAA;AAAA,CAAA,CAAA,CAC3C,UAAAC,IAAA,EAAA;AAAA,EAAA,IAAGC,SAAS,GAAAD,IAAA,CAATC,SAAS;IAAEC,KAAK,GAAAF,IAAA,CAALE,KAAK,CAAA;EAAA,OAAQ;AACzBD,IAAAA,SAAS,EAAEA,SAAS,GAAGE,SAAS,CAACC,KAAK,CAACF,KAAK,EAAED,SAAS,CAAC,CAAC,GAAGI,SAAAA;GAC7D,CAAA;AAAA,CAAC,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MAAAA;OAAQ,CAAC,CACnDiC,EAAAA,cAAc,CAAC;AAAEC,QAAAA,IAAI,EAAE,MAAA;AAAO,OAAC,CAAC,CAAA,EAAA,EAAA,EAAA;AAAApC,QAAAA,QAAA,EAEnCF,OAAO,KAAK,WAAW,GACpBmB,cAAc,GACdA,cAAc,CAACoB,GAAG,CAChB,UAAClB,KAAK,EAAEmB,KAAK,EAAA;AAAA,UAAA,oBACXxB,cAAK,CAACyB,YAAY,CAACpB,KAAK,EAAwB;YAAEqB,WAAW,EAAEF,KAAK,GAAG,CAAA;AAAE,WAAC,CAAC,CAAA;SAAE;AACjF,SAAA;OACO,CAAA,CAAA;KACN,CAAA,CAAA;AAAC,GACE,CAAC,CAAA;AAEnB,CAAC,CAAA;;AAED,IAAMJ,IAAI,gBAAGO,wBAAwB,CAAC9C,KAAK,EAAE;EAAEV,WAAW,EAAEoC,aAAa,CAACa,IAAAA;AAAK,CAAC;;;;"}
|
|
@@ -128,7 +128,7 @@ var _ListItem = function _ListItem(_ref3) {
|
|
|
128
128
|
alignSelf: "flex-start",
|
|
129
129
|
children: ItemIcon ? /*#__PURE__*/jsx(ItemIcon, {
|
|
130
130
|
size: size,
|
|
131
|
-
color: "surface.
|
|
131
|
+
color: "surface.icon.gray.muted"
|
|
132
132
|
}) : /*#__PURE__*/jsx(UnorderedItemIcon, {
|
|
133
133
|
level: level
|
|
134
134
|
})
|
|
@@ -143,10 +143,10 @@ var _ListItem = function _ListItem(_ref3) {
|
|
|
143
143
|
alignSelf: "flex-start",
|
|
144
144
|
alignItems: "center",
|
|
145
145
|
borderRadius: variant === 'ordered-filled' ? 'max' : undefined,
|
|
146
|
-
backgroundColor: variant === 'ordered-filled' ? getIn(theme, '
|
|
146
|
+
backgroundColor: variant === 'ordered-filled' ? getIn(theme.colors, 'feedback.background.neutral.subtle') : undefined,
|
|
147
147
|
children: /*#__PURE__*/jsx(Text, {
|
|
148
148
|
variant: "body",
|
|
149
|
-
|
|
149
|
+
color: "surface.text.gray.muted",
|
|
150
150
|
size: variant === 'ordered' ? size : 'xsmall',
|
|
151
151
|
children: "".concat(getOrderedListItemBullet({
|
|
152
152
|
itemNumber: _itemNumber !== null && _itemNumber !== void 0 ? _itemNumber : 1,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListItem.js","sources":["../../../../../../src/components/List/ListItem.tsx"],"sourcesContent":["import styled from 'styled-components';\nimport React from 'react';\nimport { useListContext } from './ListContext';\nimport { UnorderedItemIcon } from './ListItemIcons';\nimport { ListItemElement } from './ListItemElement';\nimport {\n listItemBulletMarginRight,\n listItemBulletMarginTop,\n listItemOrderedBulletBoxSize,\n listItemMarginBottom,\n listItemMarginLeft,\n} from './listTokens';\nimport type { ListProps } from './List';\nimport { getOrderedListItemBullet } from './getOrderedListItemBullet';\nimport getIn from '~utils/lodashButBetter/get';\nimport { Text } from '~components/Typography';\nimport type { IconComponent } from '~components/Icons';\nimport { useTheme } from '~components/BladeProvider';\nimport BaseBox from '~components/Box/BaseBox';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport type { TestID } from '~utils/types';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { getComponentId, isValidAllowedChildren } from '~utils/isValidAllowedChildren';\nimport { getPlatformType } from '~utils/getPlatformType';\nimport { throwBladeError } from '~utils/logger';\n\ntype ListItemProps = {\n /**\n * Children to be rendered for ListItem. This can be a text, ListItemLink or another List.\n *\n */\n children: React.ReactNode;\n /**\n * Icon to be rendered for a ListItem's bullet.\n *\n */\n icon?: IconComponent;\n /**\n * This is a private prop to be used only for internal logic purposes.\n *\n */\n _itemNumber?: undefined;\n} & TestID;\n\nconst StyledListItem = styled(ListItemElement)<{\n level?: number;\n variant: NonNullable<ListProps['variant']>;\n hasIcon: boolean;\n}>(({ level, theme, variant, hasIcon }) => ({\n marginLeft: level\n ? getIn(\n theme,\n listItemMarginLeft[\n `${variant}${variant === 'unordered' && hasIcon ? 'WithIcon' : ''}` as NonNullable<\n ListProps['variant'] | 'unorderedWithIcon'\n >\n ][level],\n )\n : 0,\n}));\n\nconst ListItemContentChildren = ({\n children,\n size,\n}: {\n children: React.ReactNode[];\n size: NonNullable<ListProps['size']>;\n}): React.ReactElement => {\n /* Having a <View><Text>...</Text><View/> inside <Text /> breaks vertical alignment. Issue: https://github.com/facebook/react-native/issues/31955\n As a workaround, we wrap individual strings in their own <Text /> and handle alignment with a parent <View> (BaseBox).\n */\n return getPlatformType() === 'react-native' ? (\n <BaseBox display=\"flex\" flexDirection=\"row\" flexWrap=\"wrap\">\n {children.map((child, index) => {\n if (typeof child === 'string') {\n return (\n <Text key={index} variant=\"body\" size={size}>\n {child}\n </Text>\n );\n }\n return child;\n })}\n </BaseBox>\n ) : (\n <Text variant=\"body\" size={size}>\n {children}\n </Text>\n );\n};\n\nconst _ListItem = ({\n children,\n icon: Icon,\n _itemNumber,\n testID,\n}: ListItemProps): React.ReactElement => {\n const { level, size, icon: ListContextIcon, variant } = useListContext();\n const { theme, platform } = useTheme();\n const ItemIcon = Icon ?? ListContextIcon;\n\n if (__DEV__) {\n if (level && level > 3) {\n throwBladeError({\n message: 'List Nesting is allowed only upto 3 levels.',\n moduleName: 'List',\n });\n }\n }\n\n const childrenArray = React.Children.toArray(children);\n\n // Get children that are not a List component and are valid allowed children\n const validChildItem = childrenArray.filter((child) => {\n if (getComponentId(child) === MetaConstants.List) return null;\n\n if (\n typeof child === 'string' ||\n isValidAllowedChildren(child, MetaConstants.ListItemLink) ||\n isValidAllowedChildren(child, MetaConstants.ListItemText) ||\n isValidAllowedChildren(child, MetaConstants.ListItemCode)\n ) {\n return child;\n } else if (__DEV__) {\n throwBladeError({\n message: `You can only pass a List, ListItemLink, ListItemCode, ListItemText or a string as a child to ListItem.`,\n moduleName: 'ListItem',\n });\n }\n return null;\n });\n // Get child that is a List component\n const childList = childrenArray.filter((child) =>\n getComponentId(child) === MetaConstants.List ? child : null,\n );\n const hasIcon = Boolean(ItemIcon);\n\n return (\n <StyledListItem\n level={level}\n variant={variant}\n hasIcon={hasIcon}\n {...metaAttribute({ name: MetaConstants.ListItem, testID })}\n >\n <BaseBox\n display=\"flex\"\n flexDirection=\"row\"\n alignItems=\"center\"\n marginBottom={listItemMarginBottom}\n >\n {variant === 'unordered' ? (\n <BaseBox\n marginRight={listItemBulletMarginRight[variant]}\n marginTop={\n listItemBulletMarginTop[`${variant}${hasIcon ? 'WithIcon' : ''}`][platform][size]\n }\n display=\"flex\"\n alignSelf=\"flex-start\"\n >\n {ItemIcon ? (\n <ItemIcon size={size} color=\"surface.text.subdued.lowContrast\" />\n ) : (\n <UnorderedItemIcon level={level} />\n )}\n </BaseBox>\n ) : (\n <BaseBox\n width={listItemOrderedBulletBoxSize[variant][platform][size]}\n height={listItemOrderedBulletBoxSize[variant][platform][size]}\n marginRight={listItemBulletMarginRight[variant]}\n marginTop={listItemBulletMarginTop[variant][platform][size]}\n display=\"flex\"\n flexShrink={0}\n justifyContent=\"center\"\n alignSelf=\"flex-start\"\n alignItems=\"center\"\n borderRadius={variant === 'ordered-filled' ? 'max' : undefined}\n backgroundColor={\n variant === 'ordered-filled'\n ? getIn(theme, 'colors.brand.gray.a100.lowContrast')\n : undefined\n }\n >\n <Text variant=\"body\" type=\"subtle\" size={variant === 'ordered' ? size : 'xsmall'}>\n {`${getOrderedListItemBullet({\n itemNumber: _itemNumber ?? 1,\n level: level ?? 1,\n })}${variant === 'ordered' ? '.' : ''}`}\n </Text>\n </BaseBox>\n )}\n <ListItemContentChildren size={size}>{validChildItem}</ListItemContentChildren>\n </BaseBox>\n {childList}\n </StyledListItem>\n );\n};\n\nconst ListItem = assignWithoutSideEffects(_ListItem, { componentId: MetaConstants.ListItem });\n\nexport { ListItem };\nexport type { ListItemProps };\n"],"names":["StyledListItem","styled","ListItemElement","withConfig","displayName","componentId","_ref","level","theme","variant","hasIcon","marginLeft","getIn","listItemMarginLeft","concat","ListItemContentChildren","_ref2","children","size","getPlatformType","_jsx","BaseBox","display","flexDirection","flexWrap","map","child","index","Text","_ListItem","_ref3","Icon","icon","_itemNumber","testID","_useListContext","useListContext","ListContextIcon","_useTheme","useTheme","platform","ItemIcon","throwBladeError","message","moduleName","childrenArray","React","Children","toArray","validChildItem","filter","getComponentId","MetaConstants","List","isValidAllowedChildren","ListItemLink","ListItemText","ListItemCode","childList","Boolean","_jsxs","_objectSpread","metaAttribute","name","ListItem","alignItems","marginBottom","listItemMarginBottom","marginRight","listItemBulletMarginRight","marginTop","listItemBulletMarginTop","alignSelf","color","UnorderedItemIcon","width","listItemOrderedBulletBoxSize","height","flexShrink","justifyContent","borderRadius","undefined","backgroundColor","type","getOrderedListItemBullet","itemNumber","assignWithoutSideEffects"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CA,IAAMA,cAAc,gBAAGC,MAAM,CAACC,eAAe,CAAC,CAAAC,UAAA,CAAA;EAAAC,WAAA,EAAA,0BAAA;EAAAC,WAAA,EAAA,aAAA;AAAA,CAAA,CAAA,CAI3C,UAAAC,IAAA,EAAA;AAAA,EAAA,IAAGC,KAAK,GAAAD,IAAA,CAALC,KAAK;IAAEC,KAAK,GAAAF,IAAA,CAALE,KAAK;IAAEC,OAAO,GAAAH,IAAA,CAAPG,OAAO;IAAEC,OAAO,GAAAJ,IAAA,CAAPI,OAAO,CAAA;EAAA,OAAQ;AAC1CC,IAAAA,UAAU,EAAEJ,KAAK,GACbK,KAAK,CACHJ,KAAK,EACLK,kBAAkB,CAAAC,EAAAA,CAAAA,MAAA,CACbL,OAAO,CAAAK,CAAAA,MAAA,CAAGL,OAAO,KAAK,WAAW,IAAIC,OAAO,GAAG,UAAU,GAAG,EAAE,CAGlE,CAAA,CAACH,KAAK,CACT,CAAC,GACD,CAAA;GACL,CAAA;AAAA,CAAC,CAAC,CAAA;AAEH,IAAMQ,uBAAuB,GAAG,SAA1BA,uBAAuBA,CAAAC,KAAA,EAMH;AAAA,EAAA,IALxBC,QAAQ,GAAAD,KAAA,CAARC,QAAQ;I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AAAA,WAAW,GAAI,CAAC;AAC5B1B,YAAAA,KAAK,EAAEA,KAAK,KAAA,IAAA,IAALA,KAAK,KAAA,KAAA,CAAA,GAALA,KAAK,GAAI,CAAA;WACjB,CAAC,CAAAO,CAAAA,MAAA,CAAGL,OAAO,KAAK,SAAS,GAAG,GAAG,GAAG,EAAE,CAAA;SACjC,CAAA;AAAC,OACA,CACV,eACDW,GAAA,CAACL,uBAAuB,EAAA;AAACG,QAAAA,IAAI,EAAEA,IAAK;AAAAD,QAAAA,QAAA,EAAEgC,cAAAA;AAAc,OAA0B,CAAC,CAAA;KACxE,CAAC,EACTS,SAAS,CAAA;AAAA,GAAA,CACI,CAAC,CAAA;AAErB,CAAC,CAAA;AAED,IAAMM,QAAQ,gBAAGsB,wBAAwB,CAACzD,SAAS,EAAE;EAAExB,WAAW,EAAE+C,aAAa,CAACY,QAAAA;AAAS,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"ListItem.js","sources":["../../../../../../src/components/List/ListItem.tsx"],"sourcesContent":["import styled from 'styled-components';\nimport React from 'react';\nimport { useListContext } from './ListContext';\nimport { UnorderedItemIcon } from './ListItemIcons';\nimport { ListItemElement } from './ListItemElement';\nimport {\n listItemBulletMarginRight,\n listItemBulletMarginTop,\n listItemOrderedBulletBoxSize,\n listItemMarginBottom,\n listItemMarginLeft,\n} from './listTokens';\nimport type { ListProps } from './List';\nimport { getOrderedListItemBullet } from './getOrderedListItemBullet';\nimport getIn from '~utils/lodashButBetter/get';\nimport { Text } from '~components/Typography';\nimport type { IconComponent } from '~components/Icons';\nimport { useTheme } from '~components/BladeProvider';\nimport BaseBox from '~components/Box/BaseBox';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport type { TestID } from '~utils/types';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { getComponentId, isValidAllowedChildren } from '~utils/isValidAllowedChildren';\nimport { getPlatformType } from '~utils/getPlatformType';\nimport { throwBladeError } from '~utils/logger';\n\ntype ListItemProps = {\n /**\n * Children to be rendered for ListItem. This can be a text, ListItemLink or another List.\n *\n */\n children: React.ReactNode;\n /**\n * Icon to be rendered for a ListItem's bullet.\n *\n */\n icon?: IconComponent;\n /**\n * This is a private prop to be used only for internal logic purposes.\n *\n */\n _itemNumber?: undefined;\n} & TestID;\n\nconst StyledListItem = styled(ListItemElement)<{\n level?: number;\n variant: NonNullable<ListProps['variant']>;\n hasIcon: boolean;\n}>(({ level, theme, variant, hasIcon }) => ({\n marginLeft: level\n ? getIn(\n theme,\n listItemMarginLeft[\n `${variant}${variant === 'unordered' && hasIcon ? 'WithIcon' : ''}` as NonNullable<\n ListProps['variant'] | 'unorderedWithIcon'\n >\n ][level],\n )\n : 0,\n}));\n\nconst ListItemContentChildren = ({\n children,\n size,\n}: {\n children: React.ReactNode[];\n size: NonNullable<ListProps['size']>;\n}): React.ReactElement => {\n /* Having a <View><Text>...</Text><View/> inside <Text /> breaks vertical alignment. Issue: https://github.com/facebook/react-native/issues/31955\n As a workaround, we wrap individual strings in their own <Text /> and handle alignment with a parent <View> (BaseBox).\n */\n return getPlatformType() === 'react-native' ? (\n <BaseBox display=\"flex\" flexDirection=\"row\" flexWrap=\"wrap\">\n {children.map((child, index) => {\n if (typeof child === 'string') {\n return (\n <Text key={index} variant=\"body\" size={size}>\n {child}\n </Text>\n );\n }\n return child;\n })}\n </BaseBox>\n ) : (\n <Text variant=\"body\" size={size}>\n {children}\n </Text>\n );\n};\n\nconst _ListItem = ({\n children,\n icon: Icon,\n _itemNumber,\n testID,\n}: ListItemProps): React.ReactElement => {\n const { level, size, icon: ListContextIcon, variant } = useListContext();\n const { theme, platform } = useTheme();\n const ItemIcon = Icon ?? ListContextIcon;\n\n if (__DEV__) {\n if (level && level > 3) {\n throwBladeError({\n message: 'List Nesting is allowed only upto 3 levels.',\n moduleName: 'List',\n });\n }\n }\n\n const childrenArray = React.Children.toArray(children);\n\n // Get children that are not a List component and are valid allowed children\n const validChildItem = childrenArray.filter((child) => {\n if (getComponentId(child) === MetaConstants.List) return null;\n\n if (\n typeof child === 'string' ||\n isValidAllowedChildren(child, MetaConstants.ListItemLink) ||\n isValidAllowedChildren(child, MetaConstants.ListItemText) ||\n isValidAllowedChildren(child, MetaConstants.ListItemCode)\n ) {\n return child;\n } else if (__DEV__) {\n throwBladeError({\n message: `You can only pass a List, ListItemLink, ListItemCode, ListItemText or a string as a child to ListItem.`,\n moduleName: 'ListItem',\n });\n }\n return null;\n });\n // Get child that is a List component\n const childList = childrenArray.filter((child) =>\n getComponentId(child) === MetaConstants.List ? child : null,\n );\n const hasIcon = Boolean(ItemIcon);\n\n return (\n <StyledListItem\n level={level}\n variant={variant}\n hasIcon={hasIcon}\n {...metaAttribute({ name: MetaConstants.ListItem, testID })}\n >\n <BaseBox\n display=\"flex\"\n flexDirection=\"row\"\n alignItems=\"center\"\n marginBottom={listItemMarginBottom}\n >\n {variant === 'unordered' ? (\n <BaseBox\n marginRight={listItemBulletMarginRight[variant]}\n marginTop={\n listItemBulletMarginTop[`${variant}${hasIcon ? 'WithIcon' : ''}`][platform][size]\n }\n display=\"flex\"\n alignSelf=\"flex-start\"\n >\n {ItemIcon ? (\n <ItemIcon size={size} color=\"surface.icon.gray.muted\" />\n ) : (\n <UnorderedItemIcon level={level} />\n )}\n </BaseBox>\n ) : (\n <BaseBox\n width={listItemOrderedBulletBoxSize[variant][platform][size]}\n height={listItemOrderedBulletBoxSize[variant][platform][size]}\n marginRight={listItemBulletMarginRight[variant]}\n marginTop={listItemBulletMarginTop[variant][platform][size]}\n display=\"flex\"\n flexShrink={0}\n justifyContent=\"center\"\n alignSelf=\"flex-start\"\n alignItems=\"center\"\n borderRadius={variant === 'ordered-filled' ? 'max' : undefined}\n backgroundColor={\n variant === 'ordered-filled'\n ? getIn(theme.colors, 'feedback.background.neutral.subtle')\n : undefined\n }\n >\n <Text\n variant=\"body\"\n color=\"surface.text.gray.muted\"\n size={variant === 'ordered' ? size : 'xsmall'}\n >\n {`${getOrderedListItemBullet({\n itemNumber: _itemNumber ?? 1,\n level: level ?? 1,\n })}${variant === 'ordered' ? '.' : ''}`}\n </Text>\n </BaseBox>\n )}\n <ListItemContentChildren size={size}>{validChildItem}</ListItemContentChildren>\n </BaseBox>\n {childList}\n </StyledListItem>\n );\n};\n\nconst ListItem = assignWithoutSideEffects(_ListItem, { componentId: MetaConstants.ListItem });\n\nexport { ListItem };\nexport type { ListItemProps };\n"],"names":["StyledListItem","styled","ListItemElement","withConfig","displayName","componentId","_ref","level","theme","variant","hasIcon","marginLeft","getIn","listItemMarginLeft","concat","ListItemContentChildren","_ref2","children","size","getPlatformType","_jsx","BaseBox","display","flexDirection","flexWrap","map","child","index","Text","_ListItem","_ref3","Icon","icon","_itemNumber","testID","_useListContext","useListContext","ListContextIcon","_useTheme","useTheme","platform","ItemIcon","throwBladeError","message","moduleName","childrenArray","React","Children","toArray","validChildItem","filter","getComponentId","MetaConstants","List","isValidAllowedChildren","ListItemLink","ListItemText","ListItemCode","childList","Boolean","_jsxs","_objectSpread","metaAttribute","name","ListItem","alignItems","marginBottom","listItemMarginBottom","marginRight","listItemBulletMarginRight","marginTop","listItemBulletMarginTop","alignSelf","color","UnorderedItemIcon","width","listItemOrderedBulletBoxSize","height","flexShrink","justifyContent","borderRadius","undefined","backgroundColor","colors","getOrderedListItemBullet","itemNumber","assignWithoutSideEffects"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CA,IAAMA,cAAc,gBAAGC,MAAM,CAACC,eAAe,CAAC,CAAAC,UAAA,CAAA;EAAAC,WAAA,EAAA,0BAAA;EAAAC,WAAA,EAAA,aAAA;AAAA,CAAA,CAAA,CAI3C,UAAAC,IAAA,EAAA;AAAA,EAAA,IAAGC,KAAK,GAAAD,IAAA,CAALC,KAAK;IAAEC,KAAK,GAAAF,IAAA,CAALE,KAAK;IAAEC,OAAO,GAAAH,IAAA,CAAPG,OAAO;IAAEC,OAAO,GAAAJ,IAAA,CAAPI,OAAO,CAAA;EAA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