@razorpay/blade 12.49.3 → 12.49.5
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.map +1 -1
- package/build/lib/native/components/ActionList/ActionList.js.map +1 -1
- package/build/lib/native/components/ActionList/ActionListItem.js.map +1 -1
- package/build/lib/native/components/ActionList/actionListUtils.js.map +1 -1
- package/build/lib/native/components/Alert/Alert.js.map +1 -1
- package/build/lib/native/components/Amount/Amount.js.map +1 -1
- package/build/lib/native/components/Badge/Badge.js.map +1 -1
- package/build/lib/native/components/BaseHeaderFooter/BaseHeader.js.map +1 -1
- package/build/lib/native/components/BladeProvider/useBladeProvider.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/Box/BaseBox/baseBoxStyles.js.map +1 -1
- package/build/lib/native/components/Box/Box.js.map +1 -1
- package/build/lib/native/components/Button/BaseButton/BaseButton.js.map +1 -1
- package/build/lib/native/components/Button/BaseButton/StyledBaseButton.native.js.map +1 -1
- package/build/lib/native/components/Button/BaseButton/buttonTokens.js.map +1 -1
- package/build/lib/native/components/Button/IconButton/StyledIconButton.native.js.map +1 -1
- package/build/lib/native/components/Card/CardContext.js.map +1 -1
- package/build/lib/native/components/Card/CardFooter.js.map +1 -1
- package/build/lib/native/components/Card/CardHeader.js.map +1 -1
- package/build/lib/native/components/Card/CardRoot.native.js.map +1 -1
- package/build/lib/native/components/Card/CardSurface.native.js.map +1 -1
- package/build/lib/native/components/Carousel/Carousel.native.js.map +1 -1
- package/build/lib/native/components/Carousel/CarouselItem.native.js.map +1 -1
- package/build/lib/native/components/Carousel/Indicators/Indicators.js.map +1 -1
- package/build/lib/native/components/Carousel/Indicators/getIndicatorButtonStyles.js.map +1 -1
- package/build/lib/native/components/Checkbox/Checkbox.js.map +1 -1
- package/build/lib/native/components/Checkbox/CheckboxGroup/CheckboxGroup.js.map +1 -1
- package/build/lib/native/components/Checkbox/useCheckbox.js.map +1 -1
- package/build/lib/native/components/Chip/ChipGroup.js.map +1 -1
- package/build/lib/native/components/Chip/chipTokens.js.map +1 -1
- package/build/lib/native/components/Chip/useChipGroup.js.map +1 -1
- package/build/lib/native/components/Collapsible/Collapsible.js.map +1 -1
- package/build/lib/native/components/Collapsible/CollapsibleChevronIcon.native.js.map +1 -1
- package/build/lib/native/components/Collapsible/CollapsibleContext.js.map +1 -1
- package/build/lib/native/components/Counter/Counter.js.map +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/DropdownButton.js +1 -1
- package/build/lib/native/components/Dropdown/DropdownButton.js.map +1 -1
- package/build/lib/native/components/Dropdown/DropdownIconButton.js +1 -1
- package/build/lib/native/components/Dropdown/DropdownIconButton.js.map +1 -1
- package/build/lib/native/components/Dropdown/DropdownLink.js +1 -1
- package/build/lib/native/components/Dropdown/DropdownLink.js.map +1 -1
- package/build/lib/native/components/Dropdown/DropdownOverlay.native.js.map +1 -1
- package/build/lib/native/components/Dropdown/dropdownUtils.js.map +1 -1
- package/build/lib/native/components/Form/useFormId.js.map +1 -1
- package/build/lib/native/components/Input/BaseInput/BaseInput.js +1 -1
- package/build/lib/native/components/Input/BaseInput/BaseInput.js.map +1 -1
- package/build/lib/native/components/Input/BaseInput/StyledBaseInput.native.js.map +1 -1
- package/build/lib/native/components/Input/DropdownInputTriggers/BaseDropdownInputTrigger.js.map +1 -1
- package/build/lib/native/components/Input/DropdownInputTriggers/Chevron.js.map +1 -1
- package/build/lib/native/components/Input/DropdownInputTriggers/SelectInput.js +1 -1
- package/build/lib/native/components/Input/DropdownInputTriggers/SelectInput.js.map +1 -1
- package/build/lib/native/components/Input/OTPInput/OTPInput.js.map +1 -1
- package/build/lib/native/components/Input/TextInput/TextInput.js.map +1 -1
- package/build/lib/native/components/Link/BaseLink/BaseLink.js.map +1 -1
- package/build/lib/native/components/Link/BaseLink/StyledBaseLink.native.js.map +1 -1
- package/build/lib/native/components/List/ListItem.js.map +1 -1
- package/build/lib/native/components/List/getOrderedListItemBullet.js.map +1 -1
- package/build/lib/native/components/Popover/PopoverContext.js.map +1 -1
- package/build/lib/native/components/PopupArrow/PopupArrow.native.js.map +1 -1
- package/build/lib/native/components/ProgressBar/CircularProgressBar.native.js.map +1 -1
- package/build/lib/native/components/ProgressBar/ProgressBar.js.map +1 -1
- package/build/lib/native/components/ProgressBar/ProgressBarFilled.native.js.map +1 -1
- package/build/lib/native/components/ProgressBar/progressBarTokens.js.map +1 -1
- package/build/lib/native/components/Radio/RadioGroup/RadioGroup.js.map +1 -1
- package/build/lib/native/components/Radio/RadioGroup/useRadioGroup.js.map +1 -1
- package/build/lib/native/components/Radio/RadioIcon/RadioIcon.js.map +1 -1
- package/build/lib/native/components/Radio/useRadio.js.map +1 -1
- package/build/lib/native/components/Spinner/BaseSpinner/BaseSpinner.js.map +1 -1
- package/build/lib/native/components/Spinner/BaseSpinner/SpinningBox.native.js.map +1 -1
- package/build/lib/native/components/StepGroup/StepItemMarker.js.map +1 -1
- package/build/lib/native/components/Switch/getTrackStyles.js.map +1 -1
- package/build/lib/native/components/Tabs/SafeSceneMap.native.js.map +1 -1
- package/build/lib/native/components/Tabs/utils.js.map +1 -1
- package/build/lib/native/components/Tag/Tag.js.map +1 -1
- package/build/lib/native/components/Tag/getTagsGroup.js.map +1 -1
- package/build/lib/native/components/Tooltip/TooltipContext.js.map +1 -1
- package/build/lib/native/components/Typography/BaseText/getBaseTextStyles.js.map +1 -1
- package/build/lib/native/components/Typography/Code/Code.js.map +1 -1
- package/build/lib/native/components/Typography/Text/Text.js.map +1 -1
- package/build/lib/native/components/Typography/utils.js.map +1 -1
- package/build/lib/native/components/VisuallyHidden/ScreenReaderStyles.js.map +1 -1
- package/build/lib/native/tokens/global/colors.js.map +1 -1
- package/build/lib/native/tokens/global/elevation/elevation.native.js.map +1 -1
- package/build/lib/native/tokens/theme/bladeTheme.js.map +1 -1
- package/build/lib/native/tokens/theme/createTheme.js.map +1 -1
- package/build/lib/native/utils/getMediaQuery/getMediaQuery.js.map +1 -1
- package/build/lib/native/utils/isPartialMatchObjectKeys/isPartialMatchObjectKeys.js.map +1 -1
- package/build/lib/native/utils/logger/logger.js.map +1 -1
- package/build/lib/native/utils/makeAccessible/makeAccessible.native.js.map +1 -1
- package/build/lib/native/utils/makeBorderSize/makeBorderSize.js.map +1 -1
- package/build/lib/native/utils/makeLetterSpacing/makeLetterSpacing.js.map +1 -1
- package/build/lib/native/utils/makeSize/makeSize.js.map +1 -1
- package/build/lib/native/utils/makeSpace/makeSpace.js.map +1 -1
- package/build/lib/native/utils/makeTypographySize/makeTypographySize.native.js.map +1 -1
- package/build/lib/native/utils/metaAttribute/metaAttribute.native.js.map +1 -1
- package/build/lib/native/utils/useColorScheme/useColorScheme.js.map +1 -1
- package/build/lib/native/utils/useId.js.map +1 -1
- package/build/lib/native/utils/useMergeRefs.js.map +1 -1
- package/build/lib/native/utils/useVerifyAllowedChildren/useVerifyAllowedChildren.js.map +1 -1
- package/build/lib/web/development/components/Accordion/Accordion.js +2 -2
- package/build/lib/web/development/components/Accordion/Accordion.js.map +1 -1
- package/build/lib/web/development/components/ActionList/ActionList.js +1 -1
- package/build/lib/web/development/components/ActionList/ActionList.js.map +1 -1
- package/build/lib/web/development/components/ActionList/ActionListBox.web.js +7 -7
- package/build/lib/web/development/components/ActionList/ActionListBox.web.js.map +1 -1
- package/build/lib/web/development/components/ActionList/ActionListItem.js +4 -4
- package/build/lib/web/development/components/ActionList/ActionListItem.js.map +1 -1
- package/build/lib/web/development/components/ActionList/actionListUtils.js +4 -4
- package/build/lib/web/development/components/ActionList/actionListUtils.js.map +1 -1
- package/build/lib/web/development/components/Amount/Amount.js +2 -2
- package/build/lib/web/development/components/Amount/Amount.js.map +1 -1
- package/build/lib/web/development/components/AnimateInteractions/AnimateInteractions.web.js.map +1 -1
- package/build/lib/web/development/components/AnimateInteractions/useFocusWithin.js +2 -2
- package/build/lib/web/development/components/AnimateInteractions/useFocusWithin.js.map +1 -1
- package/build/lib/web/development/components/Avatar/Avatar.web.js +1 -1
- package/build/lib/web/development/components/Avatar/Avatar.web.js.map +1 -1
- package/build/lib/web/development/components/Badge/Badge.js +1 -1
- package/build/lib/web/development/components/Badge/Badge.js.map +1 -1
- package/build/lib/web/development/components/BaseHeaderFooter/BaseHeader.js +2 -2
- package/build/lib/web/development/components/BaseHeaderFooter/BaseHeader.js.map +1 -1
- package/build/lib/web/development/components/BaseMotion/baseMotionUtils.js +2 -2
- package/build/lib/web/development/components/BaseMotion/baseMotionUtils.js.map +1 -1
- package/build/lib/web/development/components/BladeProvider/useTheme.js.map +1 -1
- package/build/lib/web/development/components/BottomSheet/BottomSheet.web.js +19 -19
- package/build/lib/web/development/components/BottomSheet/BottomSheet.web.js.map +1 -1
- package/build/lib/web/development/components/BottomSheet/BottomSheetBackdrop.web.js.map +1 -1
- package/build/lib/web/development/components/BottomSheet/BottomSheetContext.js.map +1 -1
- package/build/lib/web/development/components/BottomSheet/BottomSheetStack.js.map +1 -1
- package/build/lib/web/development/components/Box/BaseBox/baseBoxStyles.js +27 -27
- package/build/lib/web/development/components/Box/BaseBox/baseBoxStyles.js.map +1 -1
- package/build/lib/web/development/components/Box/Box.js +1 -1
- package/build/lib/web/development/components/Box/Box.js.map +1 -1
- package/build/lib/web/development/components/Button/BaseButton/BaseButton.js +5 -5
- package/build/lib/web/development/components/Button/BaseButton/BaseButton.js.map +1 -1
- package/build/lib/web/development/components/Button/BaseButton/buttonTokens.js.map +1 -1
- package/build/lib/web/development/components/Button/Button/Button.js +2 -2
- package/build/lib/web/development/components/Button/Button/Button.js.map +1 -1
- package/build/lib/web/development/components/Button/IconButton/IconButton.js +1 -1
- package/build/lib/web/development/components/Button/IconButton/IconButton.js.map +1 -1
- package/build/lib/web/development/components/ButtonGroup/ButtonGroup.web.js +1 -1
- package/build/lib/web/development/components/ButtonGroup/ButtonGroup.web.js.map +1 -1
- package/build/lib/web/development/components/Card/Card.js.map +1 -1
- package/build/lib/web/development/components/Card/CardFooter.js +2 -2
- package/build/lib/web/development/components/Card/CardFooter.js.map +1 -1
- package/build/lib/web/development/components/Card/CardRoot.web.js.map +1 -1
- package/build/lib/web/development/components/Carousel/Carousel.web.js +6 -6
- package/build/lib/web/development/components/Carousel/Carousel.web.js.map +1 -1
- package/build/lib/web/development/components/Carousel/CarouselItem.web.js +2 -2
- package/build/lib/web/development/components/Carousel/CarouselItem.web.js.map +1 -1
- package/build/lib/web/development/components/Carousel/Indicators/Indicators.js +1 -1
- package/build/lib/web/development/components/Carousel/Indicators/Indicators.js.map +1 -1
- package/build/lib/web/development/components/ChatMessage/ChatMessage.web.js +1 -1
- package/build/lib/web/development/components/ChatMessage/ChatMessage.web.js.map +1 -1
- package/build/lib/web/development/components/Checkbox/Checkbox.js +5 -5
- package/build/lib/web/development/components/Checkbox/Checkbox.js.map +1 -1
- package/build/lib/web/development/components/Checkbox/CheckboxGroup/useCheckboxGroup.js.map +1 -1
- package/build/lib/web/development/components/Checkbox/useCheckbox.js +1 -1
- package/build/lib/web/development/components/Checkbox/useCheckbox.js.map +1 -1
- package/build/lib/web/development/components/Chip/Chip.js +5 -5
- package/build/lib/web/development/components/Chip/Chip.js.map +1 -1
- package/build/lib/web/development/components/Chip/useChipGroup.js.map +1 -1
- package/build/lib/web/development/components/Collapsible/Collapsible.js +3 -3
- package/build/lib/web/development/components/Collapsible/Collapsible.js.map +1 -1
- package/build/lib/web/development/components/Collapsible/CollapsibleButton.js +1 -1
- package/build/lib/web/development/components/Collapsible/CollapsibleButton.js.map +1 -1
- package/build/lib/web/development/components/Counter/Counter.js +1 -1
- package/build/lib/web/development/components/Counter/Counter.js.map +1 -1
- package/build/lib/web/development/components/DatePicker/BaseDatePicker.web.js +14 -14
- package/build/lib/web/development/components/DatePicker/BaseDatePicker.web.js.map +1 -1
- package/build/lib/web/development/components/DatePicker/Calendar.web.js +7 -7
- package/build/lib/web/development/components/DatePicker/Calendar.web.js.map +1 -1
- package/build/lib/web/development/components/DatePicker/CalendarHeader.web.js.map +1 -1
- package/build/lib/web/development/components/DatePicker/DateInput.web.js +17 -5
- package/build/lib/web/development/components/DatePicker/DateInput.web.js.map +1 -1
- package/build/lib/web/development/components/DatePicker/QuickSelection/PresetDropdown.web.js.map +1 -1
- package/build/lib/web/development/components/DatePicker/QuickSelection/PresetSideBar.web.js.map +1 -1
- package/build/lib/web/development/components/DatePicker/useControlledDates.js +1 -1
- package/build/lib/web/development/components/DatePicker/useControlledDates.js.map +1 -1
- package/build/lib/web/development/components/DatePicker/useDatesState.js +1 -1
- package/build/lib/web/development/components/DatePicker/useDatesState.js.map +1 -1
- package/build/lib/web/development/components/DatePicker/usePopup.js +2 -2
- package/build/lib/web/development/components/DatePicker/usePopup.js.map +1 -1
- package/build/lib/web/development/components/DatePicker/utils.js +191 -23
- package/build/lib/web/development/components/DatePicker/utils.js.map +1 -1
- package/build/lib/web/development/components/Drawer/Drawer.web.js +2 -2
- package/build/lib/web/development/components/Drawer/Drawer.web.js.map +1 -1
- package/build/lib/web/development/components/Drawer/DrawerContext.js.map +1 -1
- package/build/lib/web/development/components/Drawer/DrawerSubcomponents.web.js.map +1 -1
- package/build/lib/web/development/components/Drawer/StackProvider.js.map +1 -1
- package/build/lib/web/development/components/Dropdown/Dropdown.js +28 -28
- package/build/lib/web/development/components/Dropdown/Dropdown.js.map +1 -1
- package/build/lib/web/development/components/Dropdown/DropdownButton.js +4 -4
- package/build/lib/web/development/components/Dropdown/DropdownButton.js.map +1 -1
- package/build/lib/web/development/components/Dropdown/DropdownHeaderFooter.js.map +1 -1
- package/build/lib/web/development/components/Dropdown/DropdownIconButton.js +4 -4
- package/build/lib/web/development/components/Dropdown/DropdownIconButton.js.map +1 -1
- package/build/lib/web/development/components/Dropdown/DropdownLink.js +4 -4
- package/build/lib/web/development/components/Dropdown/DropdownLink.js.map +1 -1
- package/build/lib/web/development/components/Dropdown/DropdownOverlay.web.js +1 -1
- package/build/lib/web/development/components/Dropdown/DropdownOverlay.web.js.map +1 -1
- package/build/lib/web/development/components/Dropdown/FilterChipGroup.web.js +1 -1
- package/build/lib/web/development/components/Dropdown/FilterChipGroup.web.js.map +1 -1
- package/build/lib/web/development/components/Dropdown/FilterChipGroupContext.web.js.map +1 -1
- package/build/lib/web/development/components/Dropdown/FilterChipSelectInput.web.js +7 -7
- package/build/lib/web/development/components/Dropdown/FilterChipSelectInput.web.js.map +1 -1
- package/build/lib/web/development/components/Dropdown/InputDropdownButton.web.js +8 -8
- package/build/lib/web/development/components/Dropdown/InputDropdownButton.web.js.map +1 -1
- package/build/lib/web/development/components/Dropdown/useDropdown.js +4 -4
- package/build/lib/web/development/components/Dropdown/useDropdown.js.map +1 -1
- package/build/lib/web/development/components/EmptyState/EmptyState.web.js +1 -1
- package/build/lib/web/development/components/EmptyState/EmptyState.web.js.map +1 -1
- package/build/lib/web/development/components/FileUpload/FileUpload.web.js +14 -14
- package/build/lib/web/development/components/FileUpload/FileUpload.web.js.map +1 -1
- package/build/lib/web/development/components/FileUpload/FileUploadItem.js +1 -1
- package/build/lib/web/development/components/FileUpload/FileUploadItem.js.map +1 -1
- package/build/lib/web/development/components/FilterChip/BaseFilterChip.web.js +3 -3
- package/build/lib/web/development/components/FilterChip/BaseFilterChip.web.js.map +1 -1
- package/build/lib/web/development/components/Form/FormHint.js.map +1 -1
- package/build/lib/web/development/components/Form/Selector/SelectorInput.web.js +1 -1
- package/build/lib/web/development/components/Form/Selector/SelectorInput.web.js.map +1 -1
- package/build/lib/web/development/components/Indicator/Indicator.js +1 -1
- package/build/lib/web/development/components/Indicator/Indicator.js.map +1 -1
- package/build/lib/web/development/components/InfoGroup/InfoGroup.web.js +6 -6
- package/build/lib/web/development/components/InfoGroup/InfoGroup.web.js.map +1 -1
- package/build/lib/web/development/components/InfoGroup/InfoGroupContext.js.map +1 -1
- package/build/lib/web/development/components/Input/BaseInput/AnimatedBaseInputWrapper.web.js +1 -1
- package/build/lib/web/development/components/Input/BaseInput/AnimatedBaseInputWrapper.web.js.map +1 -1
- package/build/lib/web/development/components/Input/BaseInput/BaseInput.js +110 -110
- package/build/lib/web/development/components/Input/BaseInput/BaseInput.js.map +1 -1
- package/build/lib/web/development/components/Input/BaseInput/BaseInputTagSlot.web.js +8 -8
- package/build/lib/web/development/components/Input/BaseInput/BaseInputTagSlot.web.js.map +1 -1
- package/build/lib/web/development/components/Input/BaseInput/StyledBaseInput.web.js +7 -7
- package/build/lib/web/development/components/Input/BaseInput/StyledBaseInput.web.js.map +1 -1
- package/build/lib/web/development/components/Input/BaseInput/useTaggedInput.js +4 -4
- package/build/lib/web/development/components/Input/BaseInput/useTaggedInput.js.map +1 -1
- package/build/lib/web/development/components/Input/DropdownInputTriggers/AutoComplete.js +8 -8
- package/build/lib/web/development/components/Input/DropdownInputTriggers/AutoComplete.js.map +1 -1
- package/build/lib/web/development/components/Input/DropdownInputTriggers/BaseDropdownInputTrigger.js +4 -4
- package/build/lib/web/development/components/Input/DropdownInputTriggers/BaseDropdownInputTrigger.js.map +1 -1
- package/build/lib/web/development/components/Input/DropdownInputTriggers/SelectInput.js +3 -3
- package/build/lib/web/development/components/Input/DropdownInputTriggers/SelectInput.js.map +1 -1
- package/build/lib/web/development/components/Input/OTPInput/OTPInput.js +14 -14
- package/build/lib/web/development/components/Input/OTPInput/OTPInput.js.map +1 -1
- package/build/lib/web/development/components/Input/PasswordInput/PasswordInput.js +1 -1
- package/build/lib/web/development/components/Input/PasswordInput/PasswordInput.js.map +1 -1
- package/build/lib/web/development/components/Input/PhoneNumberInput/CountrySelector.web.js.map +1 -1
- package/build/lib/web/development/components/Input/PhoneNumberInput/PhoneNumberInput.web.js +5 -5
- package/build/lib/web/development/components/Input/PhoneNumberInput/PhoneNumberInput.web.js.map +1 -1
- package/build/lib/web/development/components/Input/SearchInput/SearchInput.js +5 -5
- package/build/lib/web/development/components/Input/SearchInput/SearchInput.js.map +1 -1
- package/build/lib/web/development/components/Input/TextArea/TextArea.js +7 -7
- package/build/lib/web/development/components/Input/TextArea/TextArea.js.map +1 -1
- package/build/lib/web/development/components/Input/TextInput/TextInput.js +7 -7
- package/build/lib/web/development/components/Input/TextInput/TextInput.js.map +1 -1
- package/build/lib/web/development/components/Input/TextInput/useFormattedInput.js +2 -2
- package/build/lib/web/development/components/Input/TextInput/useFormattedInput.js.map +1 -1
- package/build/lib/web/development/components/InputGroup/InputGroup.web.js +1 -1
- package/build/lib/web/development/components/InputGroup/InputGroup.web.js.map +1 -1
- package/build/lib/web/development/components/Link/BaseLink/BaseLink.js +3 -3
- 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 -1
- package/build/lib/web/development/components/List/List.js.map +1 -1
- package/build/lib/web/development/components/List/getOrderedListItemBullet.js +3 -3
- package/build/lib/web/development/components/List/getOrderedListItemBullet.js.map +1 -1
- package/build/lib/web/development/components/ListView/ListViewFilters.web.js.map +1 -1
- package/build/lib/web/development/components/ListView/ListViewFiltersContext.web.js.map +1 -1
- package/build/lib/web/development/components/LiveAnnouncer/LiveAnnouncer.web.js.map +1 -1
- package/build/lib/web/development/components/Menu/Menu.web.js.map +1 -1
- package/build/lib/web/development/components/Menu/MenuItem.web.js +3 -3
- package/build/lib/web/development/components/Menu/MenuItem.web.js.map +1 -1
- package/build/lib/web/development/components/Menu/useMenu.js.map +1 -1
- package/build/lib/web/development/components/Modal/ModalBackdrop.js.map +1 -1
- package/build/lib/web/development/components/Modal/ModalContext.js.map +1 -1
- package/build/lib/web/development/components/Popover/Popover.web.js.map +1 -1
- package/build/lib/web/development/components/Preview/Preview.web.js +29 -30
- package/build/lib/web/development/components/Preview/Preview.web.js.map +1 -1
- package/build/lib/web/development/components/QuickFilters/QuickFilterGroup/QuickFilterGroup.js.map +1 -1
- package/build/lib/web/development/components/Radio/Radio.js +4 -4
- package/build/lib/web/development/components/Radio/Radio.js.map +1 -1
- package/build/lib/web/development/components/Radio/RadioGroup/useRadioGroup.js +1 -1
- package/build/lib/web/development/components/Radio/RadioGroup/useRadioGroup.js.map +1 -1
- package/build/lib/web/development/components/Radio/useRadio.js +1 -1
- package/build/lib/web/development/components/Radio/useRadio.js.map +1 -1
- package/build/lib/web/development/components/SideNav/SideNav.web.js +19 -19
- package/build/lib/web/development/components/SideNav/SideNav.web.js.map +1 -1
- package/build/lib/web/development/components/SideNav/SideNavItems/SideNavLink.web.js +6 -6
- package/build/lib/web/development/components/SideNav/SideNavItems/SideNavLink.web.js.map +1 -1
- package/build/lib/web/development/components/SideNav/SideNavLevel.web.js.map +1 -1
- package/build/lib/web/development/components/SpotlightPopoverTour/Tour.web.js +7 -7
- package/build/lib/web/development/components/SpotlightPopoverTour/Tour.web.js.map +1 -1
- package/build/lib/web/development/components/SpotlightPopoverTour/TourFooter.web.js +2 -2
- package/build/lib/web/development/components/SpotlightPopoverTour/TourFooter.web.js.map +1 -1
- package/build/lib/web/development/components/SpotlightPopoverTour/TourMask.web.js +1 -1
- package/build/lib/web/development/components/SpotlightPopoverTour/TourMask.web.js.map +1 -1
- package/build/lib/web/development/components/SpotlightPopoverTour/TourPopover.web.js.map +1 -1
- package/build/lib/web/development/components/SpotlightPopoverTour/TourStep.web.js +1 -1
- package/build/lib/web/development/components/SpotlightPopoverTour/TourStep.web.js.map +1 -1
- package/build/lib/web/development/components/StepGroup/StepGroup.web.js +6 -6
- package/build/lib/web/development/components/StepGroup/StepGroup.web.js.map +1 -1
- package/build/lib/web/development/components/StepGroup/StepItem.web.js +1 -1
- package/build/lib/web/development/components/StepGroup/StepItem.web.js.map +1 -1
- package/build/lib/web/development/components/StepGroup/StepLine.web.js +13 -13
- package/build/lib/web/development/components/StepGroup/StepLine.web.js.map +1 -1
- package/build/lib/web/development/components/Switch/Switch.js +1 -1
- package/build/lib/web/development/components/Switch/Switch.js.map +1 -1
- package/build/lib/web/development/components/Table/Table.web.js +10 -10
- package/build/lib/web/development/components/Table/Table.web.js.map +1 -1
- package/build/lib/web/development/components/Table/TableBody.web.js +6 -6
- package/build/lib/web/development/components/Table/TableBody.web.js.map +1 -1
- package/build/lib/web/development/components/Table/TableContext.js.map +1 -1
- package/build/lib/web/development/components/Table/TableHeader.web.js.map +1 -1
- package/build/lib/web/development/components/Table/TablePagination.web.js +2 -2
- package/build/lib/web/development/components/Table/TablePagination.web.js.map +1 -1
- package/build/lib/web/development/components/Table/TableToolbar.web.js.map +1 -1
- package/build/lib/web/development/components/Tabs/TabItem.web.js +2 -2
- package/build/lib/web/development/components/Tabs/TabItem.web.js.map +1 -1
- package/build/lib/web/development/components/Tabs/TabList.web.js +2 -2
- package/build/lib/web/development/components/Tabs/TabList.web.js.map +1 -1
- package/build/lib/web/development/components/Tabs/Tabs.web.js +1 -1
- package/build/lib/web/development/components/Tabs/Tabs.web.js.map +1 -1
- package/build/lib/web/development/components/Tabs/utils.js +2 -2
- package/build/lib/web/development/components/Tabs/utils.js.map +1 -1
- package/build/lib/web/development/components/Tag/AnimatedTag.web.js.map +1 -1
- package/build/lib/web/development/components/Tag/Tag.js.map +1 -1
- package/build/lib/web/development/components/Toast/Toast.web.js +2 -2
- package/build/lib/web/development/components/Toast/Toast.web.js.map +1 -1
- package/build/lib/web/development/components/Toast/ToastContainer.web.js.map +1 -1
- package/build/lib/web/development/components/Tooltip/Tooltip.web.js +1 -1
- package/build/lib/web/development/components/Tooltip/Tooltip.web.js.map +1 -1
- package/build/lib/web/development/components/TopNav/TabNav/TabNavItem.web.js +2 -2
- package/build/lib/web/development/components/TopNav/TabNav/TabNavItem.web.js.map +1 -1
- package/build/lib/web/development/components/TopNav/TabNav/utils.js +2 -2
- package/build/lib/web/development/components/TopNav/TabNav/utils.js.map +1 -1
- package/build/lib/web/development/components/Typography/Text/Text.js +1 -1
- package/build/lib/web/development/components/Typography/Text/Text.js.map +1 -1
- package/build/lib/web/development/tokens/theme/overrideTheme.js +2 -2
- package/build/lib/web/development/tokens/theme/overrideTheme.js.map +1 -1
- package/build/lib/web/development/utils/bladeCoverage.js +9 -10
- package/build/lib/web/development/utils/bladeCoverage.js.map +1 -1
- package/build/lib/web/development/utils/fireNativeEvent/fireNativeEvent.web.js +1 -1
- package/build/lib/web/development/utils/fireNativeEvent/fireNativeEvent.web.js.map +1 -1
- package/build/lib/web/development/utils/hasSameObjectStructure/hasSameObjectStructure.js +6 -6
- package/build/lib/web/development/utils/hasSameObjectStructure/hasSameObjectStructure.js.map +1 -1
- package/build/lib/web/development/utils/isPartialMatchObjectKeys/isPartialMatchObjectKeys.js +3 -3
- package/build/lib/web/development/utils/isPartialMatchObjectKeys/isPartialMatchObjectKeys.js.map +1 -1
- package/build/lib/web/development/utils/isValidAllowedChildren/isValidAllowedChildren.js +2 -2
- package/build/lib/web/development/utils/isValidAllowedChildren/isValidAllowedChildren.js.map +1 -1
- package/build/lib/web/development/utils/lodashButBetter/cloneDeep.js +3 -3
- package/build/lib/web/development/utils/lodashButBetter/get.js +3 -3
- package/build/lib/web/development/utils/useControllable.js +1 -1
- package/build/lib/web/development/utils/useControllable.js.map +1 -1
- package/build/lib/web/development/utils/useControlledDropdownInput/useControlledDropdownInput.js +2 -2
- package/build/lib/web/development/utils/useControlledDropdownInput/useControlledDropdownInput.js.map +1 -1
- package/build/lib/web/development/utils/useScrollLock.js.map +1 -1
- package/build/lib/web/production/components/Accordion/Accordion.js +2 -2
- package/build/lib/web/production/components/Accordion/Accordion.js.map +1 -1
- package/build/lib/web/production/components/ActionList/ActionList.js +1 -1
- package/build/lib/web/production/components/ActionList/ActionList.js.map +1 -1
- package/build/lib/web/production/components/ActionList/ActionListBox.web.js +7 -7
- package/build/lib/web/production/components/ActionList/ActionListBox.web.js.map +1 -1
- package/build/lib/web/production/components/ActionList/ActionListItem.js +4 -4
- package/build/lib/web/production/components/ActionList/ActionListItem.js.map +1 -1
- package/build/lib/web/production/components/ActionList/actionListUtils.js +4 -4
- package/build/lib/web/production/components/ActionList/actionListUtils.js.map +1 -1
- package/build/lib/web/production/components/Amount/Amount.js +2 -2
- package/build/lib/web/production/components/Amount/Amount.js.map +1 -1
- package/build/lib/web/production/components/AnimateInteractions/AnimateInteractions.web.js.map +1 -1
- package/build/lib/web/production/components/AnimateInteractions/useFocusWithin.js +2 -2
- package/build/lib/web/production/components/AnimateInteractions/useFocusWithin.js.map +1 -1
- package/build/lib/web/production/components/Avatar/Avatar.web.js +1 -1
- package/build/lib/web/production/components/Avatar/Avatar.web.js.map +1 -1
- package/build/lib/web/production/components/Badge/Badge.js +1 -1
- package/build/lib/web/production/components/Badge/Badge.js.map +1 -1
- package/build/lib/web/production/components/BaseHeaderFooter/BaseHeader.js +2 -2
- package/build/lib/web/production/components/BaseHeaderFooter/BaseHeader.js.map +1 -1
- package/build/lib/web/production/components/BaseMotion/baseMotionUtils.js +2 -2
- package/build/lib/web/production/components/BaseMotion/baseMotionUtils.js.map +1 -1
- package/build/lib/web/production/components/BladeProvider/useTheme.js.map +1 -1
- package/build/lib/web/production/components/BottomSheet/BottomSheet.web.js +19 -19
- package/build/lib/web/production/components/BottomSheet/BottomSheet.web.js.map +1 -1
- package/build/lib/web/production/components/BottomSheet/BottomSheetBackdrop.web.js.map +1 -1
- package/build/lib/web/production/components/BottomSheet/BottomSheetContext.js.map +1 -1
- package/build/lib/web/production/components/BottomSheet/BottomSheetStack.js.map +1 -1
- package/build/lib/web/production/components/Box/BaseBox/baseBoxStyles.js +27 -27
- package/build/lib/web/production/components/Box/BaseBox/baseBoxStyles.js.map +1 -1
- package/build/lib/web/production/components/Box/Box.js +1 -1
- package/build/lib/web/production/components/Box/Box.js.map +1 -1
- package/build/lib/web/production/components/Button/BaseButton/BaseButton.js +5 -5
- package/build/lib/web/production/components/Button/BaseButton/BaseButton.js.map +1 -1
- package/build/lib/web/production/components/Button/BaseButton/buttonTokens.js.map +1 -1
- package/build/lib/web/production/components/Button/Button/Button.js +2 -2
- package/build/lib/web/production/components/Button/Button/Button.js.map +1 -1
- package/build/lib/web/production/components/Button/IconButton/IconButton.js +1 -1
- package/build/lib/web/production/components/Button/IconButton/IconButton.js.map +1 -1
- package/build/lib/web/production/components/ButtonGroup/ButtonGroup.web.js +1 -1
- package/build/lib/web/production/components/ButtonGroup/ButtonGroup.web.js.map +1 -1
- package/build/lib/web/production/components/Card/Card.js.map +1 -1
- package/build/lib/web/production/components/Card/CardFooter.js +2 -2
- package/build/lib/web/production/components/Card/CardFooter.js.map +1 -1
- package/build/lib/web/production/components/Card/CardRoot.web.js.map +1 -1
- package/build/lib/web/production/components/Carousel/Carousel.web.js +6 -6
- package/build/lib/web/production/components/Carousel/Carousel.web.js.map +1 -1
- package/build/lib/web/production/components/Carousel/CarouselItem.web.js +2 -2
- package/build/lib/web/production/components/Carousel/CarouselItem.web.js.map +1 -1
- package/build/lib/web/production/components/Carousel/Indicators/Indicators.js +1 -1
- package/build/lib/web/production/components/Carousel/Indicators/Indicators.js.map +1 -1
- package/build/lib/web/production/components/ChatMessage/ChatMessage.web.js +1 -1
- package/build/lib/web/production/components/ChatMessage/ChatMessage.web.js.map +1 -1
- package/build/lib/web/production/components/Checkbox/Checkbox.js +5 -5
- package/build/lib/web/production/components/Checkbox/Checkbox.js.map +1 -1
- package/build/lib/web/production/components/Checkbox/CheckboxGroup/useCheckboxGroup.js.map +1 -1
- package/build/lib/web/production/components/Checkbox/useCheckbox.js +1 -1
- package/build/lib/web/production/components/Checkbox/useCheckbox.js.map +1 -1
- package/build/lib/web/production/components/Chip/Chip.js +5 -5
- package/build/lib/web/production/components/Chip/Chip.js.map +1 -1
- package/build/lib/web/production/components/Chip/useChipGroup.js.map +1 -1
- package/build/lib/web/production/components/Collapsible/Collapsible.js +3 -3
- package/build/lib/web/production/components/Collapsible/Collapsible.js.map +1 -1
- package/build/lib/web/production/components/Collapsible/CollapsibleButton.js +1 -1
- package/build/lib/web/production/components/Collapsible/CollapsibleButton.js.map +1 -1
- package/build/lib/web/production/components/Counter/Counter.js +1 -1
- package/build/lib/web/production/components/Counter/Counter.js.map +1 -1
- package/build/lib/web/production/components/DatePicker/BaseDatePicker.web.js +14 -14
- package/build/lib/web/production/components/DatePicker/BaseDatePicker.web.js.map +1 -1
- package/build/lib/web/production/components/DatePicker/Calendar.web.js +7 -7
- package/build/lib/web/production/components/DatePicker/Calendar.web.js.map +1 -1
- package/build/lib/web/production/components/DatePicker/CalendarHeader.web.js.map +1 -1
- package/build/lib/web/production/components/DatePicker/DateInput.web.js +17 -5
- package/build/lib/web/production/components/DatePicker/DateInput.web.js.map +1 -1
- package/build/lib/web/production/components/DatePicker/QuickSelection/PresetDropdown.web.js.map +1 -1
- package/build/lib/web/production/components/DatePicker/QuickSelection/PresetSideBar.web.js.map +1 -1
- package/build/lib/web/production/components/DatePicker/useControlledDates.js +1 -1
- package/build/lib/web/production/components/DatePicker/useControlledDates.js.map +1 -1
- package/build/lib/web/production/components/DatePicker/useDatesState.js +1 -1
- package/build/lib/web/production/components/DatePicker/useDatesState.js.map +1 -1
- package/build/lib/web/production/components/DatePicker/usePopup.js +2 -2
- package/build/lib/web/production/components/DatePicker/usePopup.js.map +1 -1
- package/build/lib/web/production/components/DatePicker/utils.js +191 -23
- package/build/lib/web/production/components/DatePicker/utils.js.map +1 -1
- package/build/lib/web/production/components/Drawer/Drawer.web.js +2 -2
- package/build/lib/web/production/components/Drawer/Drawer.web.js.map +1 -1
- package/build/lib/web/production/components/Drawer/DrawerContext.js.map +1 -1
- package/build/lib/web/production/components/Drawer/DrawerSubcomponents.web.js.map +1 -1
- package/build/lib/web/production/components/Drawer/StackProvider.js.map +1 -1
- package/build/lib/web/production/components/Dropdown/Dropdown.js +28 -28
- package/build/lib/web/production/components/Dropdown/Dropdown.js.map +1 -1
- package/build/lib/web/production/components/Dropdown/DropdownButton.js +4 -4
- package/build/lib/web/production/components/Dropdown/DropdownButton.js.map +1 -1
- package/build/lib/web/production/components/Dropdown/DropdownHeaderFooter.js.map +1 -1
- package/build/lib/web/production/components/Dropdown/DropdownIconButton.js +4 -4
- package/build/lib/web/production/components/Dropdown/DropdownIconButton.js.map +1 -1
- package/build/lib/web/production/components/Dropdown/DropdownLink.js +4 -4
- package/build/lib/web/production/components/Dropdown/DropdownLink.js.map +1 -1
- package/build/lib/web/production/components/Dropdown/DropdownOverlay.web.js +1 -1
- package/build/lib/web/production/components/Dropdown/DropdownOverlay.web.js.map +1 -1
- package/build/lib/web/production/components/Dropdown/FilterChipGroup.web.js +1 -1
- package/build/lib/web/production/components/Dropdown/FilterChipGroup.web.js.map +1 -1
- package/build/lib/web/production/components/Dropdown/FilterChipGroupContext.web.js.map +1 -1
- package/build/lib/web/production/components/Dropdown/FilterChipSelectInput.web.js +7 -7
- package/build/lib/web/production/components/Dropdown/FilterChipSelectInput.web.js.map +1 -1
- package/build/lib/web/production/components/Dropdown/InputDropdownButton.web.js +8 -8
- package/build/lib/web/production/components/Dropdown/InputDropdownButton.web.js.map +1 -1
- package/build/lib/web/production/components/Dropdown/useDropdown.js +4 -4
- package/build/lib/web/production/components/Dropdown/useDropdown.js.map +1 -1
- package/build/lib/web/production/components/EmptyState/EmptyState.web.js +1 -1
- package/build/lib/web/production/components/EmptyState/EmptyState.web.js.map +1 -1
- package/build/lib/web/production/components/FileUpload/FileUpload.web.js +14 -14
- package/build/lib/web/production/components/FileUpload/FileUpload.web.js.map +1 -1
- package/build/lib/web/production/components/FileUpload/FileUploadItem.js +1 -1
- package/build/lib/web/production/components/FileUpload/FileUploadItem.js.map +1 -1
- package/build/lib/web/production/components/FilterChip/BaseFilterChip.web.js +3 -3
- package/build/lib/web/production/components/FilterChip/BaseFilterChip.web.js.map +1 -1
- package/build/lib/web/production/components/Form/FormHint.js.map +1 -1
- package/build/lib/web/production/components/Form/Selector/SelectorInput.web.js +1 -1
- package/build/lib/web/production/components/Form/Selector/SelectorInput.web.js.map +1 -1
- package/build/lib/web/production/components/Indicator/Indicator.js +1 -1
- package/build/lib/web/production/components/Indicator/Indicator.js.map +1 -1
- package/build/lib/web/production/components/InfoGroup/InfoGroup.web.js +6 -6
- package/build/lib/web/production/components/InfoGroup/InfoGroup.web.js.map +1 -1
- package/build/lib/web/production/components/InfoGroup/InfoGroupContext.js.map +1 -1
- package/build/lib/web/production/components/Input/BaseInput/AnimatedBaseInputWrapper.web.js +1 -1
- package/build/lib/web/production/components/Input/BaseInput/AnimatedBaseInputWrapper.web.js.map +1 -1
- package/build/lib/web/production/components/Input/BaseInput/BaseInput.js +110 -110
- package/build/lib/web/production/components/Input/BaseInput/BaseInput.js.map +1 -1
- package/build/lib/web/production/components/Input/BaseInput/BaseInputTagSlot.web.js +8 -8
- package/build/lib/web/production/components/Input/BaseInput/BaseInputTagSlot.web.js.map +1 -1
- package/build/lib/web/production/components/Input/BaseInput/StyledBaseInput.web.js +7 -7
- package/build/lib/web/production/components/Input/BaseInput/StyledBaseInput.web.js.map +1 -1
- package/build/lib/web/production/components/Input/BaseInput/useTaggedInput.js +4 -4
- package/build/lib/web/production/components/Input/BaseInput/useTaggedInput.js.map +1 -1
- package/build/lib/web/production/components/Input/DropdownInputTriggers/AutoComplete.js +8 -8
- package/build/lib/web/production/components/Input/DropdownInputTriggers/AutoComplete.js.map +1 -1
- package/build/lib/web/production/components/Input/DropdownInputTriggers/BaseDropdownInputTrigger.js +4 -4
- package/build/lib/web/production/components/Input/DropdownInputTriggers/BaseDropdownInputTrigger.js.map +1 -1
- package/build/lib/web/production/components/Input/DropdownInputTriggers/SelectInput.js +3 -3
- package/build/lib/web/production/components/Input/DropdownInputTriggers/SelectInput.js.map +1 -1
- package/build/lib/web/production/components/Input/OTPInput/OTPInput.js +14 -14
- package/build/lib/web/production/components/Input/OTPInput/OTPInput.js.map +1 -1
- package/build/lib/web/production/components/Input/PasswordInput/PasswordInput.js +1 -1
- package/build/lib/web/production/components/Input/PasswordInput/PasswordInput.js.map +1 -1
- package/build/lib/web/production/components/Input/PhoneNumberInput/CountrySelector.web.js.map +1 -1
- package/build/lib/web/production/components/Input/PhoneNumberInput/PhoneNumberInput.web.js +5 -5
- package/build/lib/web/production/components/Input/PhoneNumberInput/PhoneNumberInput.web.js.map +1 -1
- package/build/lib/web/production/components/Input/SearchInput/SearchInput.js +5 -5
- package/build/lib/web/production/components/Input/SearchInput/SearchInput.js.map +1 -1
- package/build/lib/web/production/components/Input/TextArea/TextArea.js +7 -7
- package/build/lib/web/production/components/Input/TextArea/TextArea.js.map +1 -1
- package/build/lib/web/production/components/Input/TextInput/TextInput.js +7 -7
- package/build/lib/web/production/components/Input/TextInput/TextInput.js.map +1 -1
- package/build/lib/web/production/components/Input/TextInput/useFormattedInput.js +2 -2
- package/build/lib/web/production/components/Input/TextInput/useFormattedInput.js.map +1 -1
- package/build/lib/web/production/components/InputGroup/InputGroup.web.js +1 -1
- package/build/lib/web/production/components/InputGroup/InputGroup.web.js.map +1 -1
- package/build/lib/web/production/components/Link/BaseLink/BaseLink.js +3 -3
- 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 -1
- package/build/lib/web/production/components/List/List.js.map +1 -1
- package/build/lib/web/production/components/List/getOrderedListItemBullet.js +3 -3
- package/build/lib/web/production/components/List/getOrderedListItemBullet.js.map +1 -1
- package/build/lib/web/production/components/ListView/ListViewFilters.web.js.map +1 -1
- package/build/lib/web/production/components/ListView/ListViewFiltersContext.web.js.map +1 -1
- package/build/lib/web/production/components/LiveAnnouncer/LiveAnnouncer.web.js.map +1 -1
- package/build/lib/web/production/components/Menu/Menu.web.js.map +1 -1
- package/build/lib/web/production/components/Menu/MenuItem.web.js +3 -3
- package/build/lib/web/production/components/Menu/MenuItem.web.js.map +1 -1
- package/build/lib/web/production/components/Menu/useMenu.js.map +1 -1
- package/build/lib/web/production/components/Modal/ModalBackdrop.js.map +1 -1
- package/build/lib/web/production/components/Modal/ModalContext.js.map +1 -1
- package/build/lib/web/production/components/Popover/Popover.web.js.map +1 -1
- package/build/lib/web/production/components/Preview/Preview.web.js +29 -30
- package/build/lib/web/production/components/Preview/Preview.web.js.map +1 -1
- package/build/lib/web/production/components/QuickFilters/QuickFilterGroup/QuickFilterGroup.js.map +1 -1
- package/build/lib/web/production/components/Radio/Radio.js +4 -4
- package/build/lib/web/production/components/Radio/Radio.js.map +1 -1
- package/build/lib/web/production/components/Radio/RadioGroup/useRadioGroup.js +1 -1
- package/build/lib/web/production/components/Radio/RadioGroup/useRadioGroup.js.map +1 -1
- package/build/lib/web/production/components/Radio/useRadio.js +1 -1
- package/build/lib/web/production/components/Radio/useRadio.js.map +1 -1
- package/build/lib/web/production/components/SideNav/SideNav.web.js +19 -19
- package/build/lib/web/production/components/SideNav/SideNav.web.js.map +1 -1
- package/build/lib/web/production/components/SideNav/SideNavItems/SideNavLink.web.js +6 -6
- package/build/lib/web/production/components/SideNav/SideNavItems/SideNavLink.web.js.map +1 -1
- package/build/lib/web/production/components/SideNav/SideNavLevel.web.js.map +1 -1
- package/build/lib/web/production/components/SpotlightPopoverTour/Tour.web.js +7 -7
- package/build/lib/web/production/components/SpotlightPopoverTour/Tour.web.js.map +1 -1
- package/build/lib/web/production/components/SpotlightPopoverTour/TourFooter.web.js +2 -2
- package/build/lib/web/production/components/SpotlightPopoverTour/TourFooter.web.js.map +1 -1
- package/build/lib/web/production/components/SpotlightPopoverTour/TourMask.web.js +1 -1
- package/build/lib/web/production/components/SpotlightPopoverTour/TourMask.web.js.map +1 -1
- package/build/lib/web/production/components/SpotlightPopoverTour/TourPopover.web.js.map +1 -1
- package/build/lib/web/production/components/SpotlightPopoverTour/TourStep.web.js +1 -1
- package/build/lib/web/production/components/SpotlightPopoverTour/TourStep.web.js.map +1 -1
- package/build/lib/web/production/components/StepGroup/StepGroup.web.js +6 -6
- package/build/lib/web/production/components/StepGroup/StepGroup.web.js.map +1 -1
- package/build/lib/web/production/components/StepGroup/StepItem.web.js +1 -1
- package/build/lib/web/production/components/StepGroup/StepItem.web.js.map +1 -1
- package/build/lib/web/production/components/StepGroup/StepLine.web.js +13 -13
- package/build/lib/web/production/components/StepGroup/StepLine.web.js.map +1 -1
- package/build/lib/web/production/components/Switch/Switch.js +1 -1
- package/build/lib/web/production/components/Switch/Switch.js.map +1 -1
- package/build/lib/web/production/components/Table/Table.web.js +10 -10
- package/build/lib/web/production/components/Table/Table.web.js.map +1 -1
- package/build/lib/web/production/components/Table/TableBody.web.js +6 -6
- package/build/lib/web/production/components/Table/TableBody.web.js.map +1 -1
- package/build/lib/web/production/components/Table/TableContext.js.map +1 -1
- package/build/lib/web/production/components/Table/TableHeader.web.js.map +1 -1
- package/build/lib/web/production/components/Table/TablePagination.web.js +2 -2
- package/build/lib/web/production/components/Table/TablePagination.web.js.map +1 -1
- package/build/lib/web/production/components/Table/TableToolbar.web.js.map +1 -1
- package/build/lib/web/production/components/Tabs/TabItem.web.js +2 -2
- package/build/lib/web/production/components/Tabs/TabItem.web.js.map +1 -1
- package/build/lib/web/production/components/Tabs/TabList.web.js +2 -2
- package/build/lib/web/production/components/Tabs/TabList.web.js.map +1 -1
- package/build/lib/web/production/components/Tabs/Tabs.web.js +1 -1
- package/build/lib/web/production/components/Tabs/Tabs.web.js.map +1 -1
- package/build/lib/web/production/components/Tabs/utils.js +2 -2
- package/build/lib/web/production/components/Tabs/utils.js.map +1 -1
- package/build/lib/web/production/components/Tag/AnimatedTag.web.js.map +1 -1
- package/build/lib/web/production/components/Tag/Tag.js.map +1 -1
- package/build/lib/web/production/components/Toast/Toast.web.js +2 -2
- package/build/lib/web/production/components/Toast/Toast.web.js.map +1 -1
- package/build/lib/web/production/components/Toast/ToastContainer.web.js.map +1 -1
- package/build/lib/web/production/components/Tooltip/Tooltip.web.js +1 -1
- package/build/lib/web/production/components/Tooltip/Tooltip.web.js.map +1 -1
- package/build/lib/web/production/components/TopNav/TabNav/TabNavItem.web.js +2 -2
- package/build/lib/web/production/components/TopNav/TabNav/TabNavItem.web.js.map +1 -1
- package/build/lib/web/production/components/TopNav/TabNav/utils.js +2 -2
- package/build/lib/web/production/components/TopNav/TabNav/utils.js.map +1 -1
- package/build/lib/web/production/components/Typography/Text/Text.js +1 -1
- package/build/lib/web/production/components/Typography/Text/Text.js.map +1 -1
- package/build/lib/web/production/tokens/theme/overrideTheme.js +2 -2
- package/build/lib/web/production/tokens/theme/overrideTheme.js.map +1 -1
- package/build/lib/web/production/utils/bladeCoverage.js +9 -10
- package/build/lib/web/production/utils/bladeCoverage.js.map +1 -1
- package/build/lib/web/production/utils/fireNativeEvent/fireNativeEvent.web.js +1 -1
- package/build/lib/web/production/utils/fireNativeEvent/fireNativeEvent.web.js.map +1 -1
- package/build/lib/web/production/utils/hasSameObjectStructure/hasSameObjectStructure.js +6 -6
- package/build/lib/web/production/utils/hasSameObjectStructure/hasSameObjectStructure.js.map +1 -1
- package/build/lib/web/production/utils/isPartialMatchObjectKeys/isPartialMatchObjectKeys.js +3 -3
- package/build/lib/web/production/utils/isPartialMatchObjectKeys/isPartialMatchObjectKeys.js.map +1 -1
- package/build/lib/web/production/utils/isValidAllowedChildren/isValidAllowedChildren.js +2 -2
- package/build/lib/web/production/utils/isValidAllowedChildren/isValidAllowedChildren.js.map +1 -1
- package/build/lib/web/production/utils/lodashButBetter/cloneDeep.js +3 -3
- package/build/lib/web/production/utils/lodashButBetter/get.js +3 -3
- package/build/lib/web/production/utils/useControllable.js +1 -1
- package/build/lib/web/production/utils/useControllable.js.map +1 -1
- package/build/lib/web/production/utils/useControlledDropdownInput/useControlledDropdownInput.js +2 -2
- package/build/lib/web/production/utils/useControlledDropdownInput/useControlledDropdownInput.js.map +1 -1
- package/build/lib/web/production/utils/useScrollLock.js.map +1 -1
- package/package.json +15 -10
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getOrderedListItemBullet.js","sources":["../../../../../src/components/List/getOrderedListItemBullet.ts"],"sourcesContent":["/**\n * Converts number to roman number\n *\n */\nconst romanize = (number: number): string => {\n const romanKeys: Record<string, number> = {\n m: 1000,\n cm: 900,\n d: 500,\n cd: 400,\n c: 100,\n xc: 90,\n l: 50,\n xl: 40,\n x: 10,\n ix: 9,\n v: 5,\n iv: 4,\n i: 1,\n };\n let result = '';\n\n Object.keys(romanKeys).forEach((key) => {\n result += key.repeat(Math.floor(number / romanKeys[key]));\n number %= romanKeys[key];\n });\n\n return result;\n};\n\n/**\n * Converts number to alphabet. After 26 letters, the output will contain 2 alphabets eg) aa, ab, ac,...\n *\n */\nconst alphabetize = (number: number): string => {\n // Decrement the input number since array starts with 0. Eg) 'a' will be at 0th position and not 1st position in the array.\n const indexedNumber = --number;\n const alphabets = 'abcdefghijklmnopqrstuvwxyz';\n const firstAlphabets = indexedNumber >= 26 ? alphabetize(Math.floor(indexedNumber / 26) - 1) : '';\n const lastAlphabet = alphabets[indexedNumber % 26];\n return `${firstAlphabets}${lastAlphabet}`;\n};\n\n/**\n * Get the list item bullet number/roman number/alphabet for the passed level and list item number\n *\n */\nconst getOrderedListItemBullet = ({\n itemNumber,\n level,\n}: {\n itemNumber: number;\n level: number;\n}): string => {\n if (isNaN(itemNumber)) return '';\n switch (level) {\n case 1:\n return `${itemNumber}`;\n case 2:\n return `${alphabetize(itemNumber)}`;\n case 3:\n return `${romanize(itemNumber)}`;\n default:\n return `${itemNumber}`;\n }\n};\n\nexport { getOrderedListItemBullet };\n"],"names":["romanize","number","romanKeys","m","cm","d","cd","c","xc","l","xl","x","ix","v","iv","i","result","Object","keys","forEach","key","repeat","Math","floor","alphabetize","indexedNumber","alphabets","firstAlphabets","lastAlphabet","getOrderedListItemBullet","_ref","itemNumber","level","isNaN"],"mappings":"AAIA,IAAMA,QAAQ,CAAG,SAAXA,QAAQA,CAAIC,MAAc,CAAa,CAC3C,IAAMC,SAAiC,CAAG,CACxCC,CAAC,CAAE,IAAI,CACPC,EAAE,CAAE,GAAG,CACPC,CAAC,CAAE,GAAG,CACNC,EAAE,CAAE,GAAG,CACPC,CAAC,CAAE,GAAG,CACNC,EAAE,CAAE,EAAE,CACNC,CAAC,CAAE,EAAE,CACLC,EAAE,CAAE,EAAE,CACNC,CAAC,CAAE,EAAE,CACLC,EAAE,CAAE,CAAC,CACLC,CAAC,CAAE,CAAC,CACJC,EAAE,CAAE,CAAC,CACLC,CAAC,CAAE,CACL,CAAC,CACD,IAAIC,MAAM,CAAG,EAAE,CAEfC,MAAM,CAACC,IAAI,CAAChB,SAAS,CAAC,CAACiB,OAAO,CAAC,SAACC,GAAG,CAAK,CACtCJ,MAAM,EAAII,GAAG,CAACC,MAAM,CAACC,IAAI,CAACC,KAAK,CAACtB,MAAM,CAAGC,SAAS,CAACkB,GAAG,CAAC,CAAC,CAAC,CACzDnB,MAAM,EAAIC,SAAS,CAACkB,GAAG,CAAC,CAC1B,CAAC,CAAC,CAEF,OAAOJ,MAAM,CACf,CAAC,CAMD,IAAMQ,WAAW,CAAG,SAAdA,WAAWA,CAAIvB,MAAc,CAAa,CAE9C,IAAMwB,aAAa,CAAG,EAAExB,MAAM,CAC9B,IAAMyB,SAAS,CAAG,4BAA4B,CAC9C,IAAMC,cAAc,CAAGF,aAAa,EAAI,EAAE,CAAGD,WAAW,CAACF,IAAI,CAACC,KAAK,CAACE,aAAa,CAAG,EAAE,CAAC,CAAG,CAAC,CAAC,CAAG,EAAE,CACjG,IAAMG,YAAY,CAAGF,SAAS,CAACD,aAAa,CAAG,EAAE,CAAC,CAClD,
|
|
1
|
+
{"version":3,"file":"getOrderedListItemBullet.js","sources":["../../../../../src/components/List/getOrderedListItemBullet.ts"],"sourcesContent":["/**\n * Converts number to roman number\n *\n */\nconst romanize = (number: number): string => {\n const romanKeys: Record<string, number> = {\n m: 1000,\n cm: 900,\n d: 500,\n cd: 400,\n c: 100,\n xc: 90,\n l: 50,\n xl: 40,\n x: 10,\n ix: 9,\n v: 5,\n iv: 4,\n i: 1,\n };\n let result = '';\n\n Object.keys(romanKeys).forEach((key) => {\n result += key.repeat(Math.floor(number / romanKeys[key]));\n number %= romanKeys[key];\n });\n\n return result;\n};\n\n/**\n * Converts number to alphabet. After 26 letters, the output will contain 2 alphabets eg) aa, ab, ac,...\n *\n */\nconst alphabetize = (number: number): string => {\n // Decrement the input number since array starts with 0. Eg) 'a' will be at 0th position and not 1st position in the array.\n const indexedNumber = --number;\n const alphabets = 'abcdefghijklmnopqrstuvwxyz';\n const firstAlphabets = indexedNumber >= 26 ? alphabetize(Math.floor(indexedNumber / 26) - 1) : '';\n const lastAlphabet = alphabets[indexedNumber % 26];\n return `${firstAlphabets}${lastAlphabet}`;\n};\n\n/**\n * Get the list item bullet number/roman number/alphabet for the passed level and list item number\n *\n */\nconst getOrderedListItemBullet = ({\n itemNumber,\n level,\n}: {\n itemNumber: number;\n level: number;\n}): string => {\n if (isNaN(itemNumber)) return '';\n switch (level) {\n case 1:\n return `${itemNumber}`;\n case 2:\n return `${alphabetize(itemNumber)}`;\n case 3:\n return `${romanize(itemNumber)}`;\n default:\n return `${itemNumber}`;\n }\n};\n\nexport { getOrderedListItemBullet };\n"],"names":["romanize","number","romanKeys","m","cm","d","cd","c","xc","l","xl","x","ix","v","iv","i","result","Object","keys","forEach","key","repeat","Math","floor","alphabetize","indexedNumber","alphabets","firstAlphabets","lastAlphabet","getOrderedListItemBullet","_ref","itemNumber","level","isNaN"],"mappings":"AAIA,IAAMA,QAAQ,CAAG,SAAXA,QAAQA,CAAIC,MAAc,CAAa,CAC3C,IAAMC,SAAiC,CAAG,CACxCC,CAAC,CAAE,IAAI,CACPC,EAAE,CAAE,GAAG,CACPC,CAAC,CAAE,GAAG,CACNC,EAAE,CAAE,GAAG,CACPC,CAAC,CAAE,GAAG,CACNC,EAAE,CAAE,EAAE,CACNC,CAAC,CAAE,EAAE,CACLC,EAAE,CAAE,EAAE,CACNC,CAAC,CAAE,EAAE,CACLC,EAAE,CAAE,CAAC,C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AA,QAAQ,CAAC+B,UAAU,CAAC,CAAA,CAAE,CAClC,QACE,OAAO,CAAA,EAAGA,UAAU,CAAA,CAAE,CAC1B,CACF;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PopoverContext.js","sources":["../../../../../src/components/Popover/PopoverContext.ts"],"sourcesContent":["import React from 'react';\nimport { throwBladeError } from '~utils/logger';\n\ntype PopoverContextProps = {\n close: () => void;\n defaultInitialFocusRef: React.RefObject<HTMLElement>;\n titleId?: string;\n} | null;\nconst PopoverContext = React.createContext<PopoverContextProps>(null);\n\nconst usePopoverContext = (): NonNullable<PopoverContextProps> => {\n const context = React.useContext(PopoverContext);\n\n if (__DEV__) {\n if (!context) {\n throwBladeError({\n message: `usePopoverContext must be used within Popover`,\n moduleName: 'Popover',\n });\n }\n }\n\n return context!;\n};\n\nexport { PopoverContext, usePopoverContext };\n"],"names":["PopoverContext","React","createContext","usePopoverContext","context","useContext","__DEV__","throwBladeError","message","moduleName"],"mappings":";;;AAQM,IAAAA,cAAc,CAAGC,cAAK,CAACC,aAAa,CAAsB,IAAI,EAE9D,IAAAC,iBAAiB,CAAG,SAApBA,iBAAiBA,EAA2C,CAChE,IAAMC,OAAO,CAAGH,cAAK,CAACI,UAAU,CAACL,cAAc,CAAC,CAEhD,GAAIM,OAAO,CAAE,CACX,GAAI,CAACF,OAAO,CAAE,CACZG,eAAe,CAAC,CACdC,OAAO,
|
|
1
|
+
{"version":3,"file":"PopoverContext.js","sources":["../../../../../src/components/Popover/PopoverContext.ts"],"sourcesContent":["import React from 'react';\nimport { throwBladeError } from '~utils/logger';\n\ntype PopoverContextProps = {\n close: () => void;\n defaultInitialFocusRef: React.RefObject<HTMLElement>;\n titleId?: string;\n} | null;\nconst PopoverContext = React.createContext<PopoverContextProps>(null);\n\nconst usePopoverContext = (): NonNullable<PopoverContextProps> => {\n const context = React.useContext(PopoverContext);\n\n if (__DEV__) {\n if (!context) {\n throwBladeError({\n message: `usePopoverContext must be used within Popover`,\n moduleName: 'Popover',\n });\n }\n }\n\n return context!;\n};\n\nexport { PopoverContext, usePopoverContext };\n"],"names":["PopoverContext","React","createContext","usePopoverContext","context","useContext","__DEV__","throwBladeError","message","moduleName"],"mappings":";;;AAQM,IAAAA,cAAc,CAAGC,cAAK,CAACC,aAAa,CAAsB,IAAI,EAE9D,IAAAC,iBAAiB,CAAG,SAApBA,iBAAiBA,EAA2C,CAChE,IAAMC,OAAO,CAAGH,cAAK,CAACI,UAAU,CAACL,cAAc,CAAC,CAEhD,GAAIM,OAAO,CAAE,CACX,GAAI,CAACF,OAAO,CAAE,CACZG,eAAe,CAAC,CACdC,OAAO,CAAE,CAAA,6CAAA,CAA+C,CACxDC,UAAU,CAAE,SACd,CAAC,CAAC,CACJ,CACF,CAEA,OAAOL,OAAO,CAChB;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PopupArrow.native.js","sources":["../../../../../src/components/PopupArrow/PopupArrow.native.tsx"],"sourcesContent":["/* eslint-disable react/jsx-no-useless-fragment */\nimport * as React from 'react';\nimport styled from 'styled-components/native';\nimport { View } from 'react-native';\nimport type { CSSObject } from 'styled-components';\nimport type { PopupArrowProps } from './types';\nimport Svg, { Path } from '~components/Icons/_Svg';\nimport { useTheme } from '~components/BladeProvider';\nimport type { SvgProps } from '~components/Icons/_Svg/Svg/types';\nimport { makeSize } from '~utils';\nimport { size } from '~tokens/global';\nimport { logger } from '~utils/logger';\nimport { getFloatingPlacementParts } from '~utils/getFloatingPlacementParts';\n\nconst StyledSvg = styled(Svg)<{ styles?: CSSObject }>(({ styles }) => {\n return styles;\n});\n\n// modified version of FloatingArrow\n// https://github.com/floating-ui/floating-ui/blob/master/packages/react/src/components/FloatingArrow.tsx\nconst PopupArrow = React.forwardRef<SvgProps, PopupArrowProps>(\n ({ context, width, height, fillColor, strokeColor }, ref): React.ReactElement => {\n const { theme } = useTheme();\n\n const {\n placement,\n elements: { floating },\n middlewareData: { arrow },\n } = context;\n const strokeWidth = theme.border.width.thin * 2;\n\n if (__DEV__) {\n if (!ref) {\n logger({\n type: 'warn',\n moduleName: 'PopupArrow',\n message: 'Floating UI: The `ref` prop is required for the `FloatingArrow` component.',\n });\n }\n }\n\n if (!floating) {\n return <></>;\n }\n\n const [side] = getFloatingPlacementParts(placement);\n\n const svgX = width / 2;\n const svgY = 0;\n const dValue =\n 'M0,0' +\n ` H${width}` +\n ` L${width - svgX},${height - svgY}` +\n ` Q${width / 2},${height} ${svgX},${height - svgY}` +\n ' Z';\n\n const staticSide = {\n top: 'bottom',\n right: 'left',\n bottom: 'top',\n left: 'right',\n }[side];\n\n const rotation = {\n top: 0,\n bottom: 180,\n left: -90,\n right: 90,\n }[side];\n\n let newStyles = {};\n if (arrow) {\n const { x, y } = arrow;\n newStyles = {\n width: makeSize(size[20]),\n height: makeSize(size[20]),\n position: 'absolute',\n left: x != null ? `${x}px` : undefined,\n top: y != null ? `${y}px` : undefined,\n // Ensure the static side gets unset when\n // flipping to other placements' axes.\n right: undefined,\n bottom: undefined,\n [staticSide]: `${-width}px`,\n transform: `rotate(${rotation}deg)`,\n };\n }\n\n return (\n <View\n pointerEvents=\"none\"\n collapsable={false}\n style={{ position: 'absolute', left: 0, right: 0, top: 0, bottom: 0 }}\n >\n <StyledSvg\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment, @typescript-eslint/prefer-ts-expect-error\n // @ts-ignore this file is native only\n ref={ref}\n width={`${width}px`}\n height={`${width}px`}\n viewBox={`0 0 ${width} ${width}`}\n styles={newStyles}\n >\n <Path fill=\"none\" stroke={strokeColor} strokeWidth={`${strokeWidth}px`} d={dValue} />\n <Path fill={fillColor} stroke=\"none\" d={dValue} />\n </StyledSvg>\n </View>\n );\n },\n);\n\nexport { PopupArrow };\n"],"names":["StyledSvg","styled","Svg","_ref","styles","PopupArrow","React","forwardRef","_ref2","ref","context","width","height","fillColor","strokeColor","_useTheme","useTheme","theme","placement","floating","elements","arrow","middlewareData","strokeWidth","border","thin","__DEV__","logger","type","moduleName","message","_jsx","_Fragment","_getFloatingPlacement","getFloatingPlacementParts","_getFloatingPlacement2","_slicedToArray","side","svgX","svgY","dValue","staticSide","top","right","bottom","left","rotation","newStyles","x","y","_defineProperty","makeSize","size","position","undefined","View","pointerEvents","collapsable","style","children","_jsxs","viewBox","Path","fill","stroke","d"],"mappings":";;;;;;;;;;;;;;;;;;;;AAcA,IAAMA,SAAS,CAAGC,MAAM,CAACC,GAAG,CAAC,CAAyB,SAAAC,IAAA,CAAgB,CAAb,IAAAC,MAAM,CAAAD,IAAA,CAANC,MAAM,CAC7D,OAAOA,MAAM,CACf,CAAC,CAAC,CAII,IAAAC,UAAU,CAAGC,KAAK,CAACC,UAAU,CACjC,SAAAC,KAAA,CAAqDC,GAAG,CAAyB,KAA9EC,OAAO,CAAAF,KAAA,CAAPE,OAAO,CAAEC,KAAK,CAAAH,KAAA,CAALG,KAAK,CAAEC,MAAM,CAAAJ,KAAA,CAANI,MAAM,CAAEC,SAAS,CAAAL,KAAA,CAATK,SAAS,CAAEC,WAAW,CAAAN,KAAA,CAAXM,WAAW,CAC/C,IAAAC,SAAA,CAAkBC,QAAQ,EAAE,CAApBC,KAAK,CAAAF,SAAA,CAALE,KAAK,CAEb,IACEC,SAAS,CAGPR,OAAO,CAHTQ,SAAS,CACGC,QAAQ,CAElBT,OAAO,CAFTU,QAAQ,CAAID,QAAQ,CACFE,KAAK,CACrBX,OAAO,CADTY,cAAc,CAAID,KAAK,CAEzB,IAAME,WAAW,CAAGN,KAAK,CAACO,MAAM,CAACb,KAAK,CAACc,IAAI,CAAG,CAAC,CAE/C,GAAIC,OAAO,CAAE,CACX,GAAI,CAACjB,GAAG,CAAE,CACRkB,MAAM,CAAC,CACLC,IAAI,CAAE,MAAM,CACZC,UAAU,CAAE,YAAY,CACxBC,OAAO,CAAE,4EACX,CAAC,CAAC,CACJ,CACF,CAEA,GAAI,CAACX,QAAQ,CAAE,CACb,OAAOY,GAAA,CAAAC,QAAA,CAAI,EAAA,CAAC,CACd,CAEA,IAAAC,qBAAA,CAAeC,yBAAyB,CAAChB,SAAS,CAAC,CAAAiB,sBAAA,CAAAC,cAAA,CAAAH,qBAAA,CAA5CI,CAAAA,CAAAA,CAAAA,IAAI,CAAAF,sBAAA,CAAA,CAAA,CAAA,CAEX,IAAMG,IAAI,CAAG3B,KAAK,CAAG,CAAC,CACtB,IAAM4B,IAAI,CAAG,CAAC,CACd,IAAMC,MAAM,CACV,MAAM,
|
|
1
|
+
{"version":3,"file":"PopupArrow.native.js","sources":["../../../../../src/components/PopupArrow/PopupArrow.native.tsx"],"sourcesContent":["/* eslint-disable react/jsx-no-useless-fragment */\nimport * as React from 'react';\nimport styled from 'styled-components/native';\nimport { View } from 'react-native';\nimport type { CSSObject } from 'styled-components';\nimport type { PopupArrowProps } from './types';\nimport Svg, { Path } from '~components/Icons/_Svg';\nimport { useTheme } from '~components/BladeProvider';\nimport type { SvgProps } from '~components/Icons/_Svg/Svg/types';\nimport { makeSize } from '~utils';\nimport { size } from '~tokens/global';\nimport { logger } from '~utils/logger';\nimport { getFloatingPlacementParts } from '~utils/getFloatingPlacementParts';\n\nconst StyledSvg = styled(Svg)<{ styles?: CSSObject }>(({ styles }) => {\n return styles;\n});\n\n// modified version of FloatingArrow\n// https://github.com/floating-ui/floating-ui/blob/master/packages/react/src/components/FloatingArrow.tsx\nconst PopupArrow = React.forwardRef<SvgProps, PopupArrowProps>(\n ({ context, width, height, fillColor, strokeColor }, ref): React.ReactElement => {\n const { theme } = useTheme();\n\n const {\n placement,\n elements: { floating },\n middlewareData: { arrow },\n } = context;\n const strokeWidth = theme.border.width.thin * 2;\n\n if (__DEV__) {\n if (!ref) {\n logger({\n type: 'warn',\n moduleName: 'PopupArrow',\n message: 'Floating UI: The `ref` prop is required for the `FloatingArrow` component.',\n });\n }\n }\n\n if (!floating) {\n return <></>;\n }\n\n const [side] = getFloatingPlacementParts(placement);\n\n const svgX = width / 2;\n const svgY = 0;\n const dValue =\n 'M0,0' +\n ` H${width}` +\n ` L${width - svgX},${height - svgY}` +\n ` Q${width / 2},${height} ${svgX},${height - svgY}` +\n ' Z';\n\n const staticSide = {\n top: 'bottom',\n right: 'left',\n bottom: 'top',\n left: 'right',\n }[side];\n\n const rotation = {\n top: 0,\n bottom: 180,\n left: -90,\n right: 90,\n }[side];\n\n let newStyles = {};\n if (arrow) {\n const { x, y } = arrow;\n newStyles = {\n width: makeSize(size[20]),\n height: makeSize(size[20]),\n position: 'absolute',\n left: x != null ? `${x}px` : undefined,\n top: y != null ? `${y}px` : undefined,\n // Ensure the static side gets unset when\n // flipping to other placements' axes.\n right: undefined,\n bottom: undefined,\n [staticSide]: `${-width}px`,\n transform: `rotate(${rotation}deg)`,\n };\n }\n\n return (\n <View\n pointerEvents=\"none\"\n collapsable={false}\n style={{ position: 'absolute', left: 0, right: 0, top: 0, bottom: 0 }}\n >\n <StyledSvg\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment, @typescript-eslint/prefer-ts-expect-error\n // @ts-ignore this file is native only\n ref={ref}\n width={`${width}px`}\n height={`${width}px`}\n viewBox={`0 0 ${width} ${width}`}\n styles={newStyles}\n >\n <Path fill=\"none\" stroke={strokeColor} strokeWidth={`${strokeWidth}px`} d={dValue} />\n <Path fill={fillColor} stroke=\"none\" d={dValue} />\n </StyledSvg>\n </View>\n );\n },\n);\n\nexport { PopupArrow };\n"],"names":["StyledSvg","styled","Svg","_ref","styles","PopupArrow","React","forwardRef","_ref2","ref","context","width","height","fillColor","strokeColor","_useTheme","useTheme","theme","placement","floating","elements","arrow","middlewareData","strokeWidth","border","thin","__DEV__","logger","type","moduleName","message","_jsx","_Fragment","_getFloatingPlacement","getFloatingPlacementParts","_getFloatingPlacement2","_slicedToArray","side","svgX","svgY","dValue","staticSide","top","right","bottom","left","rotation","newStyles","x","y","_defineProperty","makeSize","size","position","undefined","View","pointerEvents","collapsable","style","children","_jsxs","viewBox","Path","fill","stroke","d"],"mappings":";;;;;;;;;;;;;;;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SAAS,CAAA,CAChBb,UAAU,CAAG,CAAG,EAAA,CAAC9B,KAAK,CAAA,EAAA,CAAI,CAChB,CAAA,WAAA,CAAA,CAAA,OAAA,EAAUmC,QAAQ,CAAA,IAAA,CAAM,CACpC,CACH,CAEA,OACEf,GAAA,CAACwB,IAAI,CAAA,CACHC,aAAa,CAAC,MAAM,CACpBC,WAAW,CAAE,KAAM,CACnBC,KAAK,CAAE,CAAEL,QAAQ,CAAE,UAAU,CAAER,IAAI,CAAE,CAAC,CAAEF,KAAK,CAAE,CAAC,CAAED,GAAG,CAAE,CAAC,CAAEE,MAAM,CAAE,CAAE,CAAE,CAAAe,QAAA,CAEtEC,IAAA,CAAC5D,SAAS,EAGRS,GAAG,CAAEA,GAAI,CACTE,KAAK,CAAE,CAAGA,EAAAA,KAAK,IAAK,CACpBC,MAAM,CAAE,CAAA,EAAGD,KAAK,CAAA,EAAA,CAAK,CACrBkD,OAAO,CAAE,CAAA,IAAA,EAAOlD,KAAK,CAAA,CAAA,EAAIA,KAAK,CAAA,CAAG,CACjCP,MAAM,CAAE2C,SAAU,CAAAY,QAAA,CAAA,CAElB5B,GAAA,CAAC+B,IAAI,CAAA,CAACC,IAAI,CAAC,MAAM,CAACC,MAAM,CAAElD,WAAY,CAACS,WAAW,CAAE,CAAGA,EAAAA,WAAW,CAAK,EAAA,CAAA,CAAC0C,CAAC,CAAEzB,MAAO,CAAE,CAAC,CACrFT,GAAA,CAAC+B,IAAI,CAACC,CAAAA,IAAI,CAAElD,SAAU,CAACmD,MAAM,CAAC,MAAM,CAACC,CAAC,CAAEzB,MAAO,CAAE,CAAC,CACzC,CAAA,CAAC,CACR,CAAC,CAEX,CACF;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CircularProgressBar.native.js","sources":["../../../../../src/components/ProgressBar/CircularProgressBar.native.tsx"],"sourcesContent":["import React, { useEffect } from 'react';\nimport styled from 'styled-components/native';\nimport Animated, {\n cancelAnimation,\n useAnimatedStyle,\n useSharedValue,\n withDelay,\n withRepeat,\n withSequence,\n withTiming,\n} from 'react-native-reanimated';\nimport { Text as SVGText, Circle } from 'react-native-svg';\nimport type { CircularProgressBarFilledProps } from './types';\nimport { circularProgressSizeTokens, getCircularProgressSVGTokens } from './progressBarTokens';\nimport { CircularProgressLabel } from './CircularProgressLabel';\nimport getIn from '~utils/lodashButBetter/get';\nimport BaseBox from '~components/Box/BaseBox';\nimport { makeMotionTime } from '~utils/makeMotionTime';\nimport type { TextProps } from '~components/Typography';\nimport { getTextProps } from '~components/Typography';\nimport { useTheme } from '~components/BladeProvider';\nimport { castNativeType } from '~utils';\nimport { Svg } from '~components/Icons/_Svg';\nimport getBaseTextStyles from '~components/Typography/BaseText/getBaseTextStyles';\n\nconst pulseAnimation = {\n opacityInitial: 1,\n opacityMid: 0.65,\n opacityFinal: 1,\n};\n\nconst StyledSVGText = styled(SVGText)<Pick<TextProps<{ variant: 'body' }>, 'size' | 'weight'>>(\n ({ theme, size, weight }) => {\n const textProps = getTextProps({ variant: 'body', size, weight });\n\n return {\n ...getBaseTextStyles({ theme, ...textProps }),\n strokeWidth: 0,\n fill:\n textProps.color === 'currentColor'\n ? textProps.color\n : getIn(theme.colors, textProps.color!),\n };\n },\n);\n\nconst CircularProgressBarFilled = ({\n progressPercent,\n fillColor,\n backgroundColor,\n size = 'small',\n label,\n showPercentage = true,\n isMeter,\n motionEasing,\n pulseMotionDuration,\n pulseMotionDelay,\n fillMotionDuration,\n}: CircularProgressBarFilledProps): React.ReactElement => {\n const {\n sqSize,\n strokeWidth,\n radius,\n viewBox,\n dashArray,\n dashOffset,\n } = getCircularProgressSVGTokens({ size, progressPercent });\n\n const AnimatedCircle = Animated.createAnimatedComponent(Circle);\n const animatedOpacity = useSharedValue(pulseAnimation.opacityInitial);\n const animatedStrokeDashoffset = useSharedValue(dashOffset);\n const { theme } = useTheme();\n const fillAndPulseEasing = getIn(theme.motion, motionEasing);\n const pulseDuration =\n castNativeType(makeMotionTime(getIn(theme.motion, pulseMotionDuration))) / 2;\n\n // Trigger animation for progress fill\n useEffect(() => {\n const fillDuration = castNativeType(makeMotionTime(getIn(theme.motion, fillMotionDuration)));\n animatedStrokeDashoffset.value = withTiming(dashOffset, {\n duration: fillDuration,\n easing: fillAndPulseEasing,\n });\n return () => {\n cancelAnimation(animatedStrokeDashoffset);\n };\n }, [dashOffset, animatedStrokeDashoffset, fillMotionDuration, theme, fillAndPulseEasing]);\n\n // Trigger pulsating animation\n useEffect(() => {\n const pulsatingAnimationTimingConfig = {\n duration: pulseDuration,\n easing: fillAndPulseEasing,\n };\n if (!isMeter) {\n animatedOpacity.value = withDelay(\n castNativeType(makeMotionTime(getIn(theme.motion, pulseMotionDelay))),\n withRepeat(\n withSequence(\n withTiming(pulseAnimation.opacityMid, pulsatingAnimationTimingConfig),\n withTiming(pulseAnimation.opacityFinal, pulsatingAnimationTimingConfig),\n ),\n -1,\n ),\n );\n }\n\n return () => {\n cancelAnimation(animatedOpacity);\n };\n }, [animatedOpacity, fillAndPulseEasing, pulseDuration, pulseMotionDelay, theme, isMeter]);\n\n const firstIndicatorStyles = useAnimatedStyle(() => {\n return {\n strokeDashoffset: animatedStrokeDashoffset.value,\n opacity: progressPercent < 100 ? animatedOpacity.value : 1,\n };\n });\n\n return (\n <BaseBox display=\"flex\" width=\"fit-content\" alignItems=\"center\">\n <Svg width={String(sqSize)} height={String(sqSize)} viewBox={viewBox}>\n <Circle\n fill=\"none\"\n stroke={backgroundColor}\n cx={String(sqSize / 2)}\n cy={String(sqSize / 2)}\n r={String(radius)}\n strokeWidth={`${strokeWidth}px`}\n />\n\n <AnimatedCircle\n fill=\"none\"\n stroke={fillColor}\n cx={sqSize / 2}\n cy={sqSize / 2}\n r={radius}\n strokeWidth={`${strokeWidth}px`}\n // Start progress marker at 12 O'Clock\n transform={`rotate(-90 ${sqSize / 2} ${sqSize / 2})`}\n strokeDasharray={dashArray}\n strokeDashoffset={dashOffset}\n style={firstIndicatorStyles}\n />\n\n {showPercentage && size !== 'small' && (\n <StyledSVGText\n size={circularProgressSizeTokens[size].percentTextSize}\n weight=\"semibold\"\n x=\"50%\"\n y=\"50%\"\n textAnchor=\"middle\"\n dy=\".5em\"\n >\n {`${progressPercent}%`}\n </StyledSVGText>\n )}\n </Svg>\n\n <CircularProgressLabel\n progressPercent={progressPercent}\n size={size}\n label={label}\n showPercentage={showPercentage}\n />\n </BaseBox>\n );\n};\n\nexport { CircularProgressBarFilled };\n"],"names":["pulseAnimation","opacityInitial","opacityMid","opacityFinal","StyledSVGText","styled","SVGText","_ref","theme","size","weight","textProps","getTextProps","variant","Object","assign","getBaseTextStyles","strokeWidth","fill","color","getIn","colors","CircularProgressBarFilled","_ref2","progressPercent","fillColor","backgroundColor","_ref2$size","label","_ref2$showPercentage","showPercentage","isMeter","motionEasing","pulseMotionDuration","pulseMotionDelay","fillMotionDuration","_getCircularProgressS","getCircularProgressSVGTokens","sqSize","radius","viewBox","dashArray","dashOffset","AnimatedCircle","Animated","createAnimatedComponent","Circle","animatedOpacity","useSharedValue","animatedStrokeDashoffset","_useTheme","useTheme","fillAndPulseEasing","motion","pulseDuration","castNativeType","makeMotionTime","useEffect","fillDuration","value","withTiming","duration","easing","cancelAnimation","pulsatingAnimationTimingConfig","withDelay","withRepeat","withSequence","firstIndicatorStyles","useAnimatedStyle","strokeDashoffset","opacity","_jsxs","BaseBox","display","width","alignItems","children","Svg","String","height","_jsx","stroke","cx","cy","r","transform","strokeDasharray","style","circularProgressSizeTokens","percentTextSize","x","y","textAnchor","dy","CircularProgressLabel"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,IAAMA,cAAc,CAAG,CACrBC,cAAc,CAAE,CAAC,CACjBC,UAAU,CAAE,IAAI,CAChBC,YAAY,CAAE,CAChB,CAAC,CAED,IAAMC,aAAa,CAAGC,MAAM,CAACC,IAAO,CAAC,CACnC,SAAAC,IAAA,CAA6B,CAAA,IAA1BC,KAAK,CAAAD,IAAA,CAALC,KAAK,C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ChC,CAAC,CAAA,CACK,CAAC,CAEd;;;;"}
|
|
1
|
+
{"version":3,"file":"CircularProgressBar.native.js","sources":["../../../../../src/components/ProgressBar/CircularProgressBar.native.tsx"],"sourcesContent":["import React, { useEffect } from 'react';\nimport styled from 'styled-components/native';\nimport Animated, {\n cancelAnimation,\n useAnimatedStyle,\n useSharedValue,\n withDelay,\n withRepeat,\n withSequence,\n withTiming,\n} from 'react-native-reanimated';\nimport { Text as SVGText, Circle } from 'react-native-svg';\nimport type { CircularProgressBarFilledProps } from './types';\nimport { circularProgressSizeTokens, getCircularProgressSVGTokens } from './progressBarTokens';\nimport { CircularProgressLabel } from './CircularProgressLabel';\nimport getIn from '~utils/lodashButBetter/get';\nimport BaseBox from '~components/Box/BaseBox';\nimport { makeMotionTime } from '~utils/makeMotionTime';\nimport type { TextProps } from '~components/Typography';\nimport { getTextProps } from '~components/Typography';\nimport { useTheme } from '~components/BladeProvider';\nimport { castNativeType } from '~utils';\nimport { Svg } from '~components/Icons/_Svg';\nimport getBaseTextStyles from '~components/Typography/BaseText/getBaseTextStyles';\n\nconst pulseAnimation = {\n opacityInitial: 1,\n opacityMid: 0.65,\n opacityFinal: 1,\n};\n\nconst StyledSVGText = styled(SVGText)<Pick<TextProps<{ variant: 'body' }>, 'size' | 'weight'>>(\n ({ theme, size, weight }) => {\n const textProps = getTextProps({ variant: 'body', size, weight });\n\n return {\n ...getBaseTextStyles({ theme, ...textProps }),\n strokeWidth: 0,\n fill:\n textProps.color === 'currentColor'\n ? textProps.color\n : getIn(theme.colors, textProps.color!),\n };\n },\n);\n\nconst CircularProgressBarFilled = ({\n progressPercent,\n fillColor,\n backgroundColor,\n size = 'small',\n label,\n showPercentage = true,\n isMeter,\n motionEasing,\n pulseMotionDuration,\n pulseMotionDelay,\n fillMotionDuration,\n}: CircularProgressBarFilledProps): React.ReactElement => {\n const {\n sqSize,\n strokeWidth,\n radius,\n viewBox,\n dashArray,\n dashOffset,\n } = getCircularProgressSVGTokens({ size, progressPercent });\n\n const AnimatedCircle = Animated.createAnimatedComponent(Circle);\n const animatedOpacity = useSharedValue(pulseAnimation.opacityInitial);\n const animatedStrokeDashoffset = useSharedValue(dashOffset);\n const { theme } = useTheme();\n const fillAndPulseEasing = getIn(theme.motion, motionEasing);\n const pulseDuration =\n castNativeType(makeMotionTime(getIn(theme.motion, pulseMotionDuration))) / 2;\n\n // Trigger animation for progress fill\n useEffect(() => {\n const fillDuration = castNativeType(makeMotionTime(getIn(theme.motion, fillMotionDuration)));\n animatedStrokeDashoffset.value = withTiming(dashOffset, {\n duration: fillDuration,\n easing: fillAndPulseEasing,\n });\n return () => {\n cancelAnimation(animatedStrokeDashoffset);\n };\n }, [dashOffset, animatedStrokeDashoffset, fillMotionDuration, theme, fillAndPulseEasing]);\n\n // Trigger pulsating animation\n useEffect(() => {\n const pulsatingAnimationTimingConfig = {\n duration: pulseDuration,\n easing: fillAndPulseEasing,\n };\n if (!isMeter) {\n animatedOpacity.value = withDelay(\n castNativeType(makeMotionTime(getIn(theme.motion, pulseMotionDelay))),\n withRepeat(\n withSequence(\n withTiming(pulseAnimation.opacityMid, pulsatingAnimationTimingConfig),\n withTiming(pulseAnimation.opacityFinal, pulsatingAnimationTimingConfig),\n ),\n -1,\n ),\n );\n }\n\n return () => {\n cancelAnimation(animatedOpacity);\n };\n }, [animatedOpacity, fillAndPulseEasing, pulseDuration, pulseMotionDelay, theme, isMeter]);\n\n const firstIndicatorStyles = useAnimatedStyle(() => {\n return {\n strokeDashoffset: animatedStrokeDashoffset.value,\n opacity: progressPercent < 100 ? animatedOpacity.value : 1,\n };\n });\n\n return (\n <BaseBox display=\"flex\" width=\"fit-content\" alignItems=\"center\">\n <Svg width={String(sqSize)} height={String(sqSize)} viewBox={viewBox}>\n <Circle\n fill=\"none\"\n stroke={backgroundColor}\n cx={String(sqSize / 2)}\n cy={String(sqSize / 2)}\n r={String(radius)}\n strokeWidth={`${strokeWidth}px`}\n />\n\n <AnimatedCircle\n fill=\"none\"\n stroke={fillColor}\n cx={sqSize / 2}\n cy={sqSize / 2}\n r={radius}\n strokeWidth={`${strokeWidth}px`}\n // Start progress marker at 12 O'Clock\n transform={`rotate(-90 ${sqSize / 2} ${sqSize / 2})`}\n strokeDasharray={dashArray}\n strokeDashoffset={dashOffset}\n style={firstIndicatorStyles}\n />\n\n {showPercentage && size !== 'small' && (\n <StyledSVGText\n size={circularProgressSizeTokens[size].percentTextSize}\n weight=\"semibold\"\n x=\"50%\"\n y=\"50%\"\n textAnchor=\"middle\"\n dy=\".5em\"\n >\n {`${progressPercent}%`}\n </StyledSVGText>\n )}\n </Svg>\n\n <CircularProgressLabel\n progressPercent={progressPercent}\n size={size}\n label={label}\n showPercentage={showPercentage}\n />\n </BaseBox>\n );\n};\n\nexport { CircularProgressBarFilled };\n"],"names":["pulseAnimation","opacityInitial","opacityMid","opacityFinal","StyledSVGText","styled","SVGText","_ref","theme","size","weight","textProps","getTextProps","variant","Object","assign","getBaseTextStyles","strokeWidth","fill","color","getIn","colors","CircularProgressBarFilled","_ref2","progressPercent","fillColor","backgroundColor","_ref2$size","label","_ref2$showPercentage","showPercentage","isMeter","motionEasing","pulseMotionDuration","pulseMotionDelay","fillMotionDuration","_getCircularProgressS","getCircularProgressSVGTokens","sqSize","radius","viewBox","dashArray","dashOffset","AnimatedCircle","Animated","createAnimatedComponent","Circle","animatedOpacity","useSharedValue","animatedStrokeDashoffset","_useTheme","useTheme","fillAndPulseEasing","motion","pulseDuration","castNativeType","makeMotionTime","useEffect","fillDuration","value","withTiming","duration","easing","cancelAnimation","pulsatingAnimationTimingConfig","withDelay","withRepeat","withSequence","firstIndicatorStyles","useAnimatedStyle","strokeDashoffset","opacity","_jsxs","BaseBox","display","width","alignItems","children","Svg","String","height","_jsx","stroke","cx","cy","r","transform","strokeDasharray","style","circularProgressSizeTokens","percentTextSize","x","y","textAnchor","dy","CircularProgressLabel"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,IAAMA,cAAc,CAAG,C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AGrD,eAAe,CAAA,CAAA,CAAG,CACT,CAChB,CAAA,CACE,CAAC,CAENyD,GAAA,CAACc,qBAAqB,CACpBvE,CAAAA,eAAe,CAAEA,eAAgB,CACjCf,IAAI,CAAEA,IAAK,CACXmB,KAAK,CAAEA,KAAM,CACbE,cAAc,CAAEA,cAAe,CAChC,CAAC,CAAA,CACK,CAAC,CAEd;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProgressBar.js","sources":["../../../../../src/components/ProgressBar/ProgressBar.tsx"],"sourcesContent":["import React from 'react';\nimport type { ReactElement, Ref } from 'react';\nimport { ProgressBarFilled } from './ProgressBarFilled';\nimport { CircularProgressBarFilled } from './CircularProgressBar';\nimport clamp from '~utils/lodashButBetter/clamp';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { Text } from '~components/Typography/Text';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport { useId } from '~utils/useId';\nimport { useTheme } from '~components/BladeProvider';\nimport type { BaseBoxProps } from '~components/Box/BaseBox';\nimport BaseBox from '~components/Box/BaseBox';\nimport type { FeedbackColors } from '~tokens/theme/theme';\nimport { size } from '~tokens/global';\nimport type { DataAnalyticsAttribute, BladeElementRef, TestID } from '~utils/types';\nimport { makeSize } from '~utils/makeSize';\nimport type { AccessibilityProps } from '~utils/makeAccessible';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport { throwBladeError } from '~utils/logger';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\n\ntype ProgressBarCommonProps = {\n /**\n * Sets aria-label to help users know what the progress bar is for. Default value is the same as the `label` passed.\n */\n accessibilityLabel?: string;\n /**\n * Sets the color of the progress bar which changes the feedback color.\n */\n color?: FeedbackColors;\n /**\n * Sets the type of the progress bar.\n * @default 'progress'\n */\n type?: 'meter' | 'progress';\n /**\n * Sets the label to be rendered for the progress bar. This value will also be used as default for `accessibilityLabel`.\n */\n label?: string;\n /**\n * Sets the size of the progress bar.\n * Note: 'large' size isn't available when the variant is 'linear'.\n * @default 'small'\n */\n size?: 'small' | 'medium' | 'large';\n /**\n * Sets the progress value of the progress bar.\n * @default 'small'\n */\n value?: number;\n /**\n * Sets the minimum value for the progress bar.\n * @default 0\n */\n min?: number;\n /**\n * Sets the maximum value for the progress bar.\n * @default 100\n */\n max?: number;\n} & TestID &\n DataAnalyticsAttribute &\n StyledPropsBlade;\n\ntype ProgressBarVariant = 'progress' | 'meter' | 'linear' | 'circular';\n\ntype ProgressBarProgressProps = ProgressBarCommonProps & {\n /**\n * Sets the variant to be rendered for the progress bar.\n * @default 'progress'\n */\n variant?: Extract<ProgressBarVariant, 'progress' | 'linear' | 'circular'>;\n /**\n * Sets whether the progress bar is in an indeterminate state.\n * @default false\n */\n isIndeterminate?: boolean;\n /**\n * Sets whether or not to show the progress percentage for the progress bar. Percentage is hidden by default for the `meter` variant.\n * @default true\n */\n showPercentage?: boolean;\n};\n\ntype ProgressBarMeterProps = ProgressBarCommonProps & {\n /**\n * Sets the variant to be rendered for thr progress bar.\n * @default 'progress'\n */\n variant?: Extract<ProgressBarVariant, 'meter' | 'linear' | 'circular'>;\n /**\n * Sets whether the progress bar is in an indeterminate state.\n * @default false\n */\n isIndeterminate?: undefined;\n /**\n * Sets whether or not to show the progress percentage for the progress bar. Percentage is hidden by default for the `meter` variant.\n * @default false\n */\n showPercentage?: undefined;\n};\n\ntype ProgressBarProps = ProgressBarProgressProps | ProgressBarMeterProps;\n\nconst progressBarHeight: Record<NonNullable<ProgressBarProps['size']>, 2 | 4 | 0> = {\n small: size[2],\n medium: size[4],\n // Large size isn't available when variant is 'linear'\n large: size[0],\n};\n\nconst _ProgressBar = (\n {\n accessibilityLabel,\n color,\n type,\n isIndeterminate = false,\n label,\n showPercentage = true,\n size = 'small',\n value = 0,\n variant = 'progress',\n min = 0,\n max = 100,\n testID,\n ...rest\n }: ProgressBarProps,\n ref: Ref<BladeElementRef>,\n): ReactElement => {\n const { theme } = useTheme();\n const progressType = !type && (variant === 'meter' || variant === 'progress') ? variant : type;\n const progressVariant = variant === 'meter' || variant === 'progress' ? 'linear' : variant;\n const id = useId(`${progressType}-${progressVariant}`);\n\n if (__DEV__) {\n if (progressType === 'meter' && isIndeterminate) {\n throwBladeError({\n moduleName: 'ProgressBar',\n message: `Cannot set 'isIndeterminate' when 'type' or 'variant' is 'meter'.`,\n });\n }\n\n if (progressVariant === 'circular' && isIndeterminate) {\n throwBladeError({\n moduleName: 'ProgressBar',\n message: `Cannot set 'isIndeterminate' when 'variant' is 'circular'.`,\n });\n }\n\n if (progressVariant === 'linear' && size === 'large') {\n throwBladeError({\n moduleName: 'ProgressBar',\n message: `Large size isn't available when 'variant' is 'linear'.`,\n });\n }\n\n if (type && (variant === 'progress' || variant === 'meter')) {\n throwBladeError({\n moduleName: 'ProgressBar',\n message: `variant can only be 'linear' or 'circular' when 'type=${type}'.`,\n });\n }\n }\n\n const unfilledBackgroundColor = theme.colors.feedback.background.neutral\n .subtle as BaseBoxProps['backgroundColor'];\n const filledBackgroundColor = color\n ? theme.colors.feedback.background[color].intense\n : theme.colors.surface.background.primary.intense;\n const hasLabel = label && label.trim()?.length > 0;\n const isMeter = progressType === 'meter';\n const isCircular = progressVariant === 'circular';\n const progressValue = clamp(value, min, max);\n const percentageValue = ((progressValue - min) * 100) / (max - min);\n const percentageProgressValue = isMeter\n ? parseFloat(percentageValue.toFixed(1))\n : Math.floor(percentageValue);\n const shouldShowPercentage = showPercentage && !isMeter && !isIndeterminate;\n const accessibilityProps: Pick<\n AccessibilityProps,\n 'role' | 'label' | 'valueMax' | 'valueNow' | 'valueMin' | 'valueText'\n > = {\n role: 'progressbar',\n label: accessibilityLabel ?? label,\n valueNow: percentageProgressValue,\n valueText: `${percentageProgressValue}%`,\n valueMin: min,\n valueMax: max,\n };\n\n if (isMeter) {\n accessibilityProps.role = 'meter';\n accessibilityProps.valueNow = progressValue;\n accessibilityProps.valueText = `${progressValue}`;\n }\n\n if (isIndeterminate) {\n accessibilityProps.valueNow = undefined;\n accessibilityProps.valueMin = undefined;\n accessibilityProps.valueMax = undefined;\n accessibilityProps.valueText = undefined;\n }\n\n return (\n <BaseBox\n ref={ref as never}\n {...getStyledProps(rest)}\n {...metaAttribute({ name: MetaConstants.ProgressBar, testID })}\n {...makeAnalyticsAttribute(rest)}\n >\n <BaseBox display=\"flex\" flexDirection=\"column\" width=\"100%\">\n {!isCircular ? (\n <BaseBox\n display=\"flex\"\n flexDirection=\"row\"\n justifyContent={hasLabel ? 'space-between' : 'flex-end'}\n >\n {hasLabel ? (\n <Text as=\"label\" variant=\"body\" size=\"small\" color=\"surface.text.gray.subtle\">\n {label}\n </Text>\n ) : null}\n {shouldShowPercentage ? (\n <BaseBox marginBottom=\"spacing.2\">\n <Text\n variant=\"body\"\n size=\"small\"\n color=\"surface.text.gray.subtle\"\n >{`${percentageProgressValue}%`}</Text>\n </BaseBox>\n ) : null}\n </BaseBox>\n ) : null}\n\n <BaseBox\n id={id}\n {...makeAccessible({\n role: accessibilityProps.role,\n label: accessibilityProps.label,\n valueNow: accessibilityProps.valueNow,\n valueText: accessibilityProps.valueText,\n valueMin: accessibilityProps.valueMin,\n valueMax: accessibilityProps.valueMax,\n })}\n >\n {isCircular ? (\n <CircularProgressBarFilled\n size={size}\n label={label}\n progressPercent={percentageProgressValue}\n isMeter={isMeter}\n showPercentage={showPercentage}\n backgroundColor={unfilledBackgroundColor as string}\n fillColor={filledBackgroundColor}\n pulseMotionDuration=\"duration.2xgentle\"\n fillMotionDuration=\"duration.2xgentle\"\n pulseMotionDelay=\"delay.long\"\n motionEasing=\"easing.emphasized\"\n />\n ) : (\n <BaseBox\n backgroundColor={unfilledBackgroundColor}\n height={makeSize(progressBarHeight[size])}\n overflow=\"hidden\"\n position=\"relative\"\n >\n <ProgressBarFilled\n backgroundColor={filledBackgroundColor}\n progress={percentageProgressValue}\n fillMotionDuration=\"duration.2xgentle\"\n pulseMotionDuration=\"duration.2xgentle\"\n indeterminateMotionDuration=\"duration.2xgentle\"\n pulseMotionDelay=\"delay.long\"\n motionEasing=\"easing.emphasized\"\n type={progressType}\n isIndeterminate={isIndeterminate}\n />\n </BaseBox>\n )}\n </BaseBox>\n </BaseBox>\n </BaseBox>\n );\n};\n\nconst ProgressBar = React.forwardRef(_ProgressBar);\n\nexport type { ProgressBarProps, ProgressBarVariant };\nexport { ProgressBar };\n"],"names":["progressBarHeight","small","size","medium","large","_ProgressBar","_ref","ref","_label$trim","accessibilityLabel","color","type","_ref$isIndeterminate","isIndeterminate","label","_ref$showPercentage","showPercentage","_ref$size","_ref$value","value","_ref$variant","variant","_ref$min","min","_ref$max","max","testID","rest","_objectWithoutProperties","_excluded","_useTheme","useTheme","theme","progressType","progressVariant","id","useId","__DEV__","throwBladeError","moduleName","message","unfilledBackgroundColor","colors","feedback","background","neutral","subtle","filledBackgroundColor","intense","surface","primary","hasLabel","trim","length","isMeter","isCircular","progressValue","clamp","percentageValue","percentageProgressValue","parseFloat","toFixed","Math","floor","shouldShowPercentage","accessibilityProps","role","valueNow","valueText","valueMin","valueMax","undefined","_jsx","BaseBox","Object","assign","getStyledProps","metaAttribute","name","MetaConstants","ProgressBar","makeAnalyticsAttribute","children","_jsxs","display","flexDirection","width","justifyContent","Text","as","marginBottom","makeAccessible","CircularProgressBarFilled","progressPercent","backgroundColor","fillColor","pulseMotionDuration","fillMotionDuration","pulseMotionDelay","motionEasing","height","makeSize","overflow","position","ProgressBarFilled","progress","indeterminateMotionDuration","React","forwardRef"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;6IAyGA,IAAMA,iBAA2E,CAAG,CAClFC,KAAK,CAAEC,IAAI,CAAC,CAAC,CAAC,CACdC,MAAM,CAAED,IAAI,CAAC,CAAC,CAAC,CAEfE,KAAK,CAAEF,IAAI,CAAC,CAAC,CACf,CAAC,CAED,IAAMG,YAAY,CAAG,SAAfA,YAAYA,CAAAC,IAAA,CAgBhBC,GAAyB,CACR,CAA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,eAAe,CAAEA,eAAgB,CAClC,CAAC,CACK,CACV,CAAA,CACM,CAAC,CAAA,CACH,CAAC,CAAA,CACH,CAAC,CAEd,CAAC,CAEK,IAAAmE,WAAW,CAAG2B,cAAK,CAACC,UAAU,CAACvG,YAAY;;;;"}
|
|
1
|
+
{"version":3,"file":"ProgressBar.js","sources":["../../../../../src/components/ProgressBar/ProgressBar.tsx"],"sourcesContent":["import React from 'react';\nimport type { ReactElement, Ref } from 'react';\nimport { ProgressBarFilled } from './ProgressBarFilled';\nimport { CircularProgressBarFilled } from './CircularProgressBar';\nimport clamp from '~utils/lodashButBetter/clamp';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { Text } from '~components/Typography/Text';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport { useId } from '~utils/useId';\nimport { useTheme } from '~components/BladeProvider';\nimport type { BaseBoxProps } from '~components/Box/BaseBox';\nimport BaseBox from '~components/Box/BaseBox';\nimport type { FeedbackColors } from '~tokens/theme/theme';\nimport { size } from '~tokens/global';\nimport type { DataAnalyticsAttribute, BladeElementRef, TestID } from '~utils/types';\nimport { makeSize } from '~utils/makeSize';\nimport type { AccessibilityProps } from '~utils/makeAccessible';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport { throwBladeError } from '~utils/logger';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\n\ntype ProgressBarCommonProps = {\n /**\n * Sets aria-label to help users know what the progress bar is for. Default value is the same as the `label` passed.\n */\n accessibilityLabel?: string;\n /**\n * Sets the color of the progress bar which changes the feedback color.\n */\n color?: FeedbackColors;\n /**\n * Sets the type of the progress bar.\n * @default 'progress'\n */\n type?: 'meter' | 'progress';\n /**\n * Sets the label to be rendered for the progress bar. This value will also be used as default for `accessibilityLabel`.\n */\n label?: string;\n /**\n * Sets the size of the progress bar.\n * Note: 'large' size isn't available when the variant is 'linear'.\n * @default 'small'\n */\n size?: 'small' | 'medium' | 'large';\n /**\n * Sets the progress value of the progress bar.\n * @default 'small'\n */\n value?: number;\n /**\n * Sets the minimum value for the progress bar.\n * @default 0\n */\n min?: number;\n /**\n * Sets the maximum value for the progress bar.\n * @default 100\n */\n max?: number;\n} & TestID &\n DataAnalyticsAttribute &\n StyledPropsBlade;\n\ntype ProgressBarVariant = 'progress' | 'meter' | 'linear' | 'circular';\n\ntype ProgressBarProgressProps = ProgressBarCommonProps & {\n /**\n * Sets the variant to be rendered for the progress bar.\n * @default 'progress'\n */\n variant?: Extract<ProgressBarVariant, 'progress' | 'linear' | 'circular'>;\n /**\n * Sets whether the progress bar is in an indeterminate state.\n * @default false\n */\n isIndeterminate?: boolean;\n /**\n * Sets whether or not to show the progress percentage for the progress bar. Percentage is hidden by default for the `meter` variant.\n * @default true\n */\n showPercentage?: boolean;\n};\n\ntype ProgressBarMeterProps = ProgressBarCommonProps & {\n /**\n * Sets the variant to be rendered for thr progress bar.\n * @default 'progress'\n */\n variant?: Extract<ProgressBarVariant, 'meter' | 'linear' | 'circular'>;\n /**\n * Sets whether the progress bar is in an indeterminate state.\n * @default false\n */\n isIndeterminate?: undefined;\n /**\n * Sets whether or not to show the progress percentage for the progress bar. Percentage is hidden by default for the `meter` variant.\n * @default false\n */\n showPercentage?: undefined;\n};\n\ntype ProgressBarProps = ProgressBarProgressProps | ProgressBarMeterProps;\n\nconst progressBarHeight: Record<NonNullable<ProgressBarProps['size']>, 2 | 4 | 0> = {\n small: size[2],\n medium: size[4],\n // Large size isn't available when variant is 'linear'\n large: size[0],\n};\n\nconst _ProgressBar = (\n {\n accessibilityLabel,\n color,\n type,\n isIndeterminate = false,\n label,\n showPercentage = true,\n size = 'small',\n value = 0,\n variant = 'progress',\n min = 0,\n max = 100,\n testID,\n ...rest\n }: ProgressBarProps,\n ref: Ref<BladeElementRef>,\n): ReactElement => {\n const { theme } = useTheme();\n const progressType = !type && (variant === 'meter' || variant === 'progress') ? variant : type;\n const progressVariant = variant === 'meter' || variant === 'progress' ? 'linear' : variant;\n const id = useId(`${progressType}-${progressVariant}`);\n\n if (__DEV__) {\n if (progressType === 'meter' && isIndeterminate) {\n throwBladeError({\n moduleName: 'ProgressBar',\n message: `Cannot set 'isIndeterminate' when 'type' or 'variant' is 'meter'.`,\n });\n }\n\n if (progressVariant === 'circular' && isIndeterminate) {\n throwBladeError({\n moduleName: 'ProgressBar',\n message: `Cannot set 'isIndeterminate' when 'variant' is 'circular'.`,\n });\n }\n\n if (progressVariant === 'linear' && size === 'large') {\n throwBladeError({\n moduleName: 'ProgressBar',\n message: `Large size isn't available when 'variant' is 'linear'.`,\n });\n }\n\n if (type && (variant === 'progress' || variant === 'meter')) {\n throwBladeError({\n moduleName: 'ProgressBar',\n message: `variant can only be 'linear' or 'circular' when 'type=${type}'.`,\n });\n }\n }\n\n const unfilledBackgroundColor = theme.colors.feedback.background.neutral\n .subtle as BaseBoxProps['backgroundColor'];\n const filledBackgroundColor = color\n ? theme.colors.feedback.background[color].intense\n : theme.colors.surface.background.primary.intense;\n const hasLabel = label && label.trim()?.length > 0;\n const isMeter = progressType === 'meter';\n const isCircular = progressVariant === 'circular';\n const progressValue = clamp(value, min, max);\n const percentageValue = ((progressValue - min) * 100) / (max - min);\n const percentageProgressValue = isMeter\n ? parseFloat(percentageValue.toFixed(1))\n : Math.floor(percentageValue);\n const shouldShowPercentage = showPercentage && !isMeter && !isIndeterminate;\n const accessibilityProps: Pick<\n AccessibilityProps,\n 'role' | 'label' | 'valueMax' | 'valueNow' | 'valueMin' | 'valueText'\n > = {\n role: 'progressbar',\n label: accessibilityLabel ?? label,\n valueNow: percentageProgressValue,\n valueText: `${percentageProgressValue}%`,\n valueMin: min,\n valueMax: max,\n };\n\n if (isMeter) {\n accessibilityProps.role = 'meter';\n accessibilityProps.valueNow = progressValue;\n accessibilityProps.valueText = `${progressValue}`;\n }\n\n if (isIndeterminate) {\n accessibilityProps.valueNow = undefined;\n accessibilityProps.valueMin = undefined;\n accessibilityProps.valueMax = undefined;\n accessibilityProps.valueText = undefined;\n }\n\n return (\n <BaseBox\n ref={ref as never}\n {...getStyledProps(rest)}\n {...metaAttribute({ name: MetaConstants.ProgressBar, testID })}\n {...makeAnalyticsAttribute(rest)}\n >\n <BaseBox display=\"flex\" flexDirection=\"column\" width=\"100%\">\n {!isCircular ? (\n <BaseBox\n display=\"flex\"\n flexDirection=\"row\"\n justifyContent={hasLabel ? 'space-between' : 'flex-end'}\n >\n {hasLabel ? (\n <Text as=\"label\" variant=\"body\" size=\"small\" color=\"surface.text.gray.subtle\">\n {label}\n </Text>\n ) : null}\n {shouldShowPercentage ? (\n <BaseBox marginBottom=\"spacing.2\">\n <Text\n variant=\"body\"\n size=\"small\"\n color=\"surface.text.gray.subtle\"\n >{`${percentageProgressValue}%`}</Text>\n </BaseBox>\n ) : null}\n </BaseBox>\n ) : null}\n\n <BaseBox\n id={id}\n {...makeAccessible({\n role: accessibilityProps.role,\n label: accessibilityProps.label,\n valueNow: accessibilityProps.valueNow,\n valueText: accessibilityProps.valueText,\n valueMin: accessibilityProps.valueMin,\n valueMax: accessibilityProps.valueMax,\n })}\n >\n {isCircular ? (\n <CircularProgressBarFilled\n size={size}\n label={label}\n progressPercent={percentageProgressValue}\n isMeter={isMeter}\n showPercentage={showPercentage}\n backgroundColor={unfilledBackgroundColor as string}\n fillColor={filledBackgroundColor}\n pulseMotionDuration=\"duration.2xgentle\"\n fillMotionDuration=\"duration.2xgentle\"\n pulseMotionDelay=\"delay.long\"\n motionEasing=\"easing.emphasized\"\n />\n ) : (\n <BaseBox\n backgroundColor={unfilledBackgroundColor}\n height={makeSize(progressBarHeight[size])}\n overflow=\"hidden\"\n position=\"relative\"\n >\n <ProgressBarFilled\n backgroundColor={filledBackgroundColor}\n progress={percentageProgressValue}\n fillMotionDuration=\"duration.2xgentle\"\n pulseMotionDuration=\"duration.2xgentle\"\n indeterminateMotionDuration=\"duration.2xgentle\"\n pulseMotionDelay=\"delay.long\"\n motionEasing=\"easing.emphasized\"\n type={progressType}\n isIndeterminate={isIndeterminate}\n />\n </BaseBox>\n )}\n </BaseBox>\n </BaseBox>\n </BaseBox>\n );\n};\n\nconst ProgressBar = React.forwardRef(_ProgressBar);\n\nexport type { ProgressBarProps, ProgressBarVariant };\nexport { ProgressBar };\n"],"names":["progressBarHeight","small","size","medium","large","_ProgressBar","_ref","ref","_label$trim","accessibilityLabel","color","type","_ref$isIndeterminate","isIndeterminate","label","_ref$showPercentage","showPercentage","_ref$size","_ref$value","value","_ref$variant","variant","_ref$min","min","_ref$max","max","testID","rest","_objectWithoutProperties","_excluded","_useTheme","useTheme","theme","progressType","progressVariant","id","useId","__DEV__","throwBladeError","moduleName","message","unfilledBackgroundColor","colors","feedback","background","neutral","subtle","filledBackgroundColor","intense","surface","primary","hasLabel","trim","length","isMeter","isCircular","progressValue","clamp","percentageValue","percentageProgressValue","parseFloat","toFixed","Math","floor","shouldShowPercentage","accessibilityProps","role","valueNow","valueText","valueMin","valueMax","undefined","_jsx","BaseBox","Object","assign","getStyledProps","metaAttribute","name","MetaConstants","ProgressBar","makeAnalyticsAttribute","children","_jsxs","display","flexDirection","width","justifyContent","Text","as","marginBottom","makeAccessible","CircularProgressBarFilled","progressPercent","backgroundColor","fillColor","pulseMotionDuration","fillMotionDuration","pulseMotionDelay","motionEasing","height","makeSize","overflow","position","ProgressBarFilled","progress","indeterminateMotionDuration","React","forwardRef"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;6IAyGA,IAAMA,iBAA2E,CAAG,CAClFC,KAAK,CAAEC,IAAI,CAAC,CAAC,CAAC,CACdC,MAAM,CAAED,IAAI,CAAC,CAAC,CAAC,CAEfE,KAAK,CAAEF,IAAI,CAAC,CAAC,CACf,CAAC,CAED,IAAMG,YAAY,CAAG,SAAfA,YAAYA,CAAAC,IAAA,CAgBhBC,GAAyB,CACR,CAAAC,IAAAA,WAAA,CAff,IAAAC,kBAAkB,CAAAH,IAAA,CAAlBG,kBAAkB,CAClBC,KAAK,CAAAJ,I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AEd,CAAC,CAEK,IAAAmE,WAAW,CAAG2B,cAAK,CAACC,UAAU,CAACvG,YAAY;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProgressBarFilled.native.js","sources":["../../../../../src/components/ProgressBar/ProgressBarFilled.native.tsx"],"sourcesContent":["import React, { useEffect } from 'react';\nimport styled from 'styled-components';\nimport Animated, {\n cancelAnimation,\n Easing,\n useAnimatedStyle,\n useSharedValue,\n withDelay,\n withRepeat,\n withSequence,\n withTiming,\n} from 'react-native-reanimated';\nimport type { ProgressBarFilledProps } from './types';\nimport { indeterminateAnimation, pulseAnimation } from './progressBarTokens';\nimport getIn from '~utils/lodashButBetter/get';\nimport { useTheme } from '~components/BladeProvider';\nimport { castNativeType } from '~utils';\nimport { makeMotionTime } from '~utils/makeMotionTime';\n\nconst ProgressBarIndeterminateFilledContainer = styled(Animated.View)<\n Pick<ProgressBarFilledProps, 'backgroundColor' | 'progress'>\n>(({ backgroundColor }) => ({\n backgroundColor,\n height: '100%',\n width: indeterminateAnimation.fillWidth,\n position: 'absolute',\n}));\n\nconst ProgressBarDeterminateFilledContainer = styled(Animated.View)<\n Pick<ProgressBarFilledProps, 'backgroundColor' | 'progress'>\n>(({ backgroundColor, progress }) => ({\n backgroundColor,\n height: '100%',\n width: `${progress}%`,\n}));\n\nconst ProgressBarPulseAnimation = styled(Animated.View)({\n backgroundColor: pulseAnimation.backgroundColor,\n opacity: pulseAnimation.opacityInitial,\n width: '100%',\n height: '100%',\n});\n\nconst ProgressBarFilled = ({\n backgroundColor,\n progress,\n fillMotionDuration,\n motionEasing,\n pulseMotionDuration,\n pulseMotionDelay,\n type,\n isIndeterminate,\n indeterminateMotionDuration,\n}: ProgressBarFilledProps): React.ReactElement => {\n const animatedWidth = useSharedValue(progress); // for progress fill animation\n const animatedOpacity = useSharedValue(pulseAnimation.opacityInitial); // for pulse animation\n const animatedScaleX = useSharedValue(indeterminateAnimation.scaleXInitial); // for indeterminate scale animation\n const animatedLeft = useSharedValue(indeterminateAnimation.leftInitial); // for indeterminate slide animation\n\n const { theme } = useTheme();\n const fillAndPulseEasing = getIn(theme.motion, motionEasing);\n const pulseDuration =\n castNativeType(makeMotionTime(getIn(theme.motion, pulseMotionDuration))) / 2; // divided by 2 since we animate it with 2 steps in a sequence\n\n // Trigger animation for progress fill\n useEffect(() => {\n const fillDuration = castNativeType(makeMotionTime(getIn(theme.motion, fillMotionDuration)));\n animatedWidth.value = withTiming(progress, {\n duration: fillDuration,\n easing: fillAndPulseEasing,\n });\n return () => {\n cancelAnimation(animatedWidth);\n };\n }, [progress, animatedWidth, fillMotionDuration, theme, fillAndPulseEasing]);\n\n // Animated styles for progress fill animation\n const progressFillAnimatedStyle = useAnimatedStyle(() => {\n return {\n width: `${animatedWidth.value}%`,\n };\n });\n\n // Trigger animation for indeterminate progress bar\n useEffect(() => {\n if (type === 'progress' && isIndeterminate) {\n const indeterminateDuration = castNativeType(\n makeMotionTime(getIn(theme.motion, indeterminateMotionDuration)),\n );\n const indeterminateEasing = Easing.linear;\n\n // Sliding animation\n animatedLeft.value = withRepeat(\n withTiming(indeterminateAnimation.leftFinal, {\n duration: indeterminateDuration,\n easing: indeterminateEasing,\n }),\n -1,\n );\n\n // Scaling animation\n animatedScaleX.value = withRepeat(\n withSequence(\n withTiming(indeterminateAnimation.scaleXMid, {\n duration: indeterminateDuration / 2, // divided by 2 since we animate it with 2 steps in a sequence\n easing: indeterminateEasing,\n }),\n withTiming(indeterminateAnimation.scaleXFinal, {\n duration: indeterminateDuration / 2, // divided by 2 since we animate it with 2 steps in a sequence\n easing: indeterminateEasing,\n }),\n ),\n -1,\n );\n }\n\n return () => {\n cancelAnimation(animatedLeft);\n cancelAnimation(animatedScaleX);\n };\n }, [animatedLeft, animatedScaleX, indeterminateMotionDuration, isIndeterminate, theme, type]);\n\n // Animated styles for indeterminate animation\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n //@ts-expect-error TS errors originating from reanimated. Should be fixed in future versions. Ref: https://github.com/software-mansion/react-native-reanimated/issues/4840\n const indeterminateAnimatedStyle = useAnimatedStyle(() => {\n return {\n left: animatedLeft.value,\n transform: [{ scaleX: animatedScaleX.value }],\n };\n });\n\n //Trigger pulsating animation\n useEffect(() => {\n const pulsatingAnimationTimingConfig = {\n duration: pulseDuration,\n easing: fillAndPulseEasing,\n };\n if (type === 'progress') {\n animatedOpacity.value = withDelay(\n castNativeType(makeMotionTime(getIn(theme.motion, pulseMotionDelay))),\n withRepeat(\n withSequence(\n withTiming(pulseAnimation.opacityMid, pulsatingAnimationTimingConfig),\n withTiming(pulseAnimation.opacityFinal, pulsatingAnimationTimingConfig),\n ),\n -1,\n ),\n );\n }\n\n return () => {\n cancelAnimation(animatedOpacity);\n };\n }, [animatedOpacity, fillAndPulseEasing, pulseDuration, pulseMotionDelay, theme, type]);\n\n // Animated styles for pulse animation\n const pulseAnimatedStyle = useAnimatedStyle(() => {\n return {\n opacity: animatedOpacity.value,\n };\n });\n\n const ProgressBarFilledContainer = isIndeterminate\n ? ProgressBarIndeterminateFilledContainer\n : ProgressBarDeterminateFilledContainer;\n\n return (\n <ProgressBarFilledContainer\n style={isIndeterminate ? indeterminateAnimatedStyle : progressFillAnimatedStyle}\n backgroundColor={backgroundColor}\n progress={progress}\n >\n <ProgressBarPulseAnimation style={pulseAnimatedStyle} />\n </ProgressBarFilledContainer>\n );\n};\n\nexport type { ProgressBarFilledProps };\nexport { ProgressBarFilled };\n"],"names":["ProgressBarIndeterminateFilledContainer","styled","Animated","View","_ref","backgroundColor","height","width","indeterminateAnimation","fillWidth","position","ProgressBarDeterminateFilledContainer","_ref2","progress","ProgressBarPulseAnimation","pulseAnimation","opacity","opacityInitial","ProgressBarFilled","_ref3","fillMotionDuration","motionEasing","pulseMotionDuration","pulseMotionDelay","type","isIndeterminate","indeterminateMotionDuration","animatedWidth","useSharedValue","animatedOpacity","animatedScaleX","scaleXInitial","animatedLeft","leftInitial","_useTheme","useTheme","theme","fillAndPulseEasing","getIn","motion","pulseDuration","castNativeType","makeMotionTime","useEffect","fillDuration","value","withTiming","duration","easing","cancelAnimation","progressFillAnimatedStyle","useAnimatedStyle","indeterminateDuration","indeterminateEasing","Easing","linear","withRepeat","leftFinal","withSequence","scaleXMid","scaleXFinal","indeterminateAnimatedStyle","left","transform","scaleX","pulsatingAnimationTimingConfig","withDelay","opacityMid","opacityFinal","pulseAnimatedStyle","ProgressBarFilledContainer","_jsx","style","children"],"mappings":";;;;;;;;;;;;;;;AAmBA,IAAMA,uCAAuC,CAAGC,MAAM,CAACC,QAAQ,CAACC,IAAI,CAAC,CAEnE,SAAAC,IAAA,CAAA,CAAA,IAAGC,eAAe,CAAAD,IAAA,CAAfC,eAAe,QAAQ,CAC1BA,eAAe,CAAfA,eAAe,CACfC,MAAM,CAAE,MAAM,CACdC,KAAK,CAAEC,sBAAsB,CAACC,SAAS,CACvCC,QAAQ,CAAE,UACZ,CAAC,CAAC,CAAA,CAAC,CAEH,IAAMC,qCAAqC,CAAGV,MAAM,CAACC,QAAQ,CAACC,IAAI,CAAC,CAEjE,SAAAS,KAAA,CAAA,CAAA,IAAGP,eAAe,CAAAO,KAAA,CAAfP,eAAe,CAAEQ,QAAQ,CAAAD,KAAA,CAARC,QAAQ,QAAQ,CACpCR,eAAe,CAAfA,eAAe,CACfC,MAAM,CAAE,MAAM,CACdC,KAAK,CAAG,GAAEM,QAAS,CAAA,CAAA,CACrB,CAAC,CAAC,CAAA,CAAC,CAEH,IAAMC,yBAAyB,CAAGb,MAAM,CAACC,QAAQ,CAACC,IAAI,CAAC,CAAC,CACtDE,eAAe,CAAEU,cAAc,CAACV,eAAe,CAC/CW,OAAO,CAAED,cAAc,CAACE,cAAc,CACtCV,KAAK,CAAE,MAAM,CACbD,MAAM,CAAE,MACV,CAAC,CAAC,CAEI,IAAAY,iBAAiB,CAAG,SAApBA,iBAAiBA,CAAAC,KAAA,CAU2B,CAThD,IAAAd,eAAe,CAAAc,KAAA,CAAfd,eAAe,CACfQ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AAA,CAACzD,yBAAyB,CAAA,CAAC0D,KAAK,CAAEH,kBAAmB,CAAE,CAAC,CAC9B,CAAC,CAEjC;;;;"}
|
|
1
|
+
{"version":3,"file":"ProgressBarFilled.native.js","sources":["../../../../../src/components/ProgressBar/ProgressBarFilled.native.tsx"],"sourcesContent":["import React, { useEffect } from 'react';\nimport styled from 'styled-components';\nimport Animated, {\n cancelAnimation,\n Easing,\n useAnimatedStyle,\n useSharedValue,\n withDelay,\n withRepeat,\n withSequence,\n withTiming,\n} from 'react-native-reanimated';\nimport type { ProgressBarFilledProps } from './types';\nimport { indeterminateAnimation, pulseAnimation } from './progressBarTokens';\nimport getIn from '~utils/lodashButBetter/get';\nimport { useTheme } from '~components/BladeProvider';\nimport { castNativeType } from '~utils';\nimport { makeMotionTime } from '~utils/makeMotionTime';\n\nconst ProgressBarIndeterminateFilledContainer = styled(Animated.View)<\n Pick<ProgressBarFilledProps, 'backgroundColor' | 'progress'>\n>(({ backgroundColor }) => ({\n backgroundColor,\n height: '100%',\n width: indeterminateAnimation.fillWidth,\n position: 'absolute',\n}));\n\nconst ProgressBarDeterminateFilledContainer = styled(Animated.View)<\n Pick<ProgressBarFilledProps, 'backgroundColor' | 'progress'>\n>(({ backgroundColor, progress }) => ({\n backgroundColor,\n height: '100%',\n width: `${progress}%`,\n}));\n\nconst ProgressBarPulseAnimation = styled(Animated.View)({\n backgroundColor: pulseAnimation.backgroundColor,\n opacity: pulseAnimation.opacityInitial,\n width: '100%',\n height: '100%',\n});\n\nconst ProgressBarFilled = ({\n backgroundColor,\n progress,\n fillMotionDuration,\n motionEasing,\n pulseMotionDuration,\n pulseMotionDelay,\n type,\n isIndeterminate,\n indeterminateMotionDuration,\n}: ProgressBarFilledProps): React.ReactElement => {\n const animatedWidth = useSharedValue(progress); // for progress fill animation\n const animatedOpacity = useSharedValue(pulseAnimation.opacityInitial); // for pulse animation\n const animatedScaleX = useSharedValue(indeterminateAnimation.scaleXInitial); // for indeterminate scale animation\n const animatedLeft = useSharedValue(indeterminateAnimation.leftInitial); // for indeterminate slide animation\n\n const { theme } = useTheme();\n const fillAndPulseEasing = getIn(theme.motion, motionEasing);\n const pulseDuration =\n castNativeType(makeMotionTime(getIn(theme.motion, pulseMotionDuration))) / 2; // divided by 2 since we animate it with 2 steps in a sequence\n\n // Trigger animation for progress fill\n useEffect(() => {\n const fillDuration = castNativeType(makeMotionTime(getIn(theme.motion, fillMotionDuration)));\n animatedWidth.value = withTiming(progress, {\n duration: fillDuration,\n easing: fillAndPulseEasing,\n });\n return () => {\n cancelAnimation(animatedWidth);\n };\n }, [progress, animatedWidth, fillMotionDuration, theme, fillAndPulseEasing]);\n\n // Animated styles for progress fill animation\n const progressFillAnimatedStyle = useAnimatedStyle(() => {\n return {\n width: `${animatedWidth.value}%`,\n };\n });\n\n // Trigger animation for indeterminate progress bar\n useEffect(() => {\n if (type === 'progress' && isIndeterminate) {\n const indeterminateDuration = castNativeType(\n makeMotionTime(getIn(theme.motion, indeterminateMotionDuration)),\n );\n const indeterminateEasing = Easing.linear;\n\n // Sliding animation\n animatedLeft.value = withRepeat(\n withTiming(indeterminateAnimation.leftFinal, {\n duration: indeterminateDuration,\n easing: indeterminateEasing,\n }),\n -1,\n );\n\n // Scaling animation\n animatedScaleX.value = withRepeat(\n withSequence(\n withTiming(indeterminateAnimation.scaleXMid, {\n duration: indeterminateDuration / 2, // divided by 2 since we animate it with 2 steps in a sequence\n easing: indeterminateEasing,\n }),\n withTiming(indeterminateAnimation.scaleXFinal, {\n duration: indeterminateDuration / 2, // divided by 2 since we animate it with 2 steps in a sequence\n easing: indeterminateEasing,\n }),\n ),\n -1,\n );\n }\n\n return () => {\n cancelAnimation(animatedLeft);\n cancelAnimation(animatedScaleX);\n };\n }, [animatedLeft, animatedScaleX, indeterminateMotionDuration, isIndeterminate, theme, type]);\n\n // Animated styles for indeterminate animation\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n //@ts-expect-error TS errors originating from reanimated. Should be fixed in future versions. Ref: https://github.com/software-mansion/react-native-reanimated/issues/4840\n const indeterminateAnimatedStyle = useAnimatedStyle(() => {\n return {\n left: animatedLeft.value,\n transform: [{ scaleX: animatedScaleX.value }],\n };\n });\n\n //Trigger pulsating animation\n useEffect(() => {\n const pulsatingAnimationTimingConfig = {\n duration: pulseDuration,\n easing: fillAndPulseEasing,\n };\n if (type === 'progress') {\n animatedOpacity.value = withDelay(\n castNativeType(makeMotionTime(getIn(theme.motion, pulseMotionDelay))),\n withRepeat(\n withSequence(\n withTiming(pulseAnimation.opacityMid, pulsatingAnimationTimingConfig),\n withTiming(pulseAnimation.opacityFinal, pulsatingAnimationTimingConfig),\n ),\n -1,\n ),\n );\n }\n\n return () => {\n cancelAnimation(animatedOpacity);\n };\n }, [animatedOpacity, fillAndPulseEasing, pulseDuration, pulseMotionDelay, theme, type]);\n\n // Animated styles for pulse animation\n const pulseAnimatedStyle = useAnimatedStyle(() => {\n return {\n opacity: animatedOpacity.value,\n };\n });\n\n const ProgressBarFilledContainer = isIndeterminate\n ? ProgressBarIndeterminateFilledContainer\n : ProgressBarDeterminateFilledContainer;\n\n return (\n <ProgressBarFilledContainer\n style={isIndeterminate ? indeterminateAnimatedStyle : progressFillAnimatedStyle}\n backgroundColor={backgroundColor}\n progress={progress}\n >\n <ProgressBarPulseAnimation style={pulseAnimatedStyle} />\n </ProgressBarFilledContainer>\n );\n};\n\nexport type { ProgressBarFilledProps };\nexport { ProgressBarFilled };\n"],"names":["ProgressBarIndeterminateFilledContainer","styled","Animated","View","_ref","backgroundColor","height","width","indeterminateAnimation","fillWidth","position","ProgressBarDeterminateFilledContainer","_ref2","progress","ProgressBarPulseAnimation","pulseAnimation","opacity","opacityInitial","ProgressBarFilled","_ref3","fillMotionDuration","motionEasing","pulseMotionDuration","pulseMotionDelay","type","isIndeterminate","indeterminateMotionDuration","animatedWidth","useSharedValue","animatedOpacity","animatedScaleX","scaleXInitial","animatedLeft","leftInitial","_useTheme","useTheme","theme","fillAndPulseEasing","getIn","motion","pulseDuration","castNativeType","makeMotionTime","useEffect","fillDuration","value","withTiming","duration","easing","cancelAnimation","progressFillAnimatedStyle","useAnimatedStyle","indeterminateDuration","indeterminateEasing","Easing","linear","withRepeat","leftFinal","withSequence","scaleXMid","scaleXFinal","indeterminateAnimatedStyle","left","transform","scaleX","pulsatingAnimationTimingConfig","withDelay","opacityMid","opacityFinal","pulseAnimatedStyle","ProgressBarFilledContainer","_jsx","style","children"],"mappings":";;;;;;;;;;;;;;;AAmBA,IAAMA,uCAAuC,CAAGC,MAAM,CAACC,QAAQ,CAACC,IAAI,CAAC,CAEnE,SAAAC,IAAA,CAAA,CAAA,IAAGC,eAAe,CAAAD,IAAA,CAAfC,eAAe,QAAQ,CAC1BA,eAAe,CAAfA,eAAe,CACfC,MAAM,CAAE,MAAM,CACdC,KAAK,CAAEC,sBAAsB,CAACC,SAAS,CACvCC,QAAQ,CAAE,UACZ,CAAC,CAAC,CAAA,CAAC,CAEH,IAAMC,qCAAqC,CAAGV,MAAM,CAACC,QAAQ,CAACC,IAAI,CAAC,CAEjE,SAAAS,KAAA,CAAA,CAAA,IAAGP,eAAe,CAAAO,KAAA,CAAfP,eAAe,CAAEQ,QAAQ,CAAAD,KAAA,CAARC,QAAQ,QAAQ,CACpCR,eAAe,CAAfA,eAAe,CACfC,MAAM,CAAE,MAAM,CACdC,KAAK,CAAE,GAAGM,QAAQ,CAAA,CAAA,CACpB,CAAC,CAAC,CAAA,CAAC,CAEH,IAAMC,yBAAyB,CAAGb,MAAM,CAACC,QAAQ,CAACC,IAAI,CAAC,CAAC,CACtDE,eAAe,CAAEU,cAAc,CAACV,eAAe,CAC/CW,OAAO,CAAED,cAAc,CAACE,cAAc,CACtCV,KAAK,CAAE,MAAM,CACbD,MAAM,CAAE,MACV,CAAC,CAAC,CAEI,IAAAY,iBAAiB,CAAG,SAApBA,iBAAiBA,CAAAC,KAAA,CAU2B,CAThD,IAAAd,eAAe,CAAAc,KAAA,CAAfd,eAAe,CACfQ,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AA,CAACzD,yBAAyB,CAAA,CAAC0D,KAAK,CAAEH,kBAAmB,CAAE,CAAC,CAC9B,CAAC,CAEjC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progressBarTokens.js","sources":["../../../../../src/components/ProgressBar/progressBarTokens.ts"],"sourcesContent":["import type { CircularProgressBarFilledProps } from './types';\nimport { size } from '~tokens/global';\n\nconst indeterminateAnimation = {\n scaleXInitial: 1,\n scaleXMid: 5,\n scaleXFinal: 1,\n leftInitial: '-8%',\n leftMid: '50%',\n leftFinal: '103%',\n fillWidth: '5%',\n};\n\nconst pulseAnimation = {\n opacityInitial: 0,\n opacityMid: 0.25,\n opacityFinal: 0,\n backgroundColor: 'white',\n};\n\nconst circularProgressSizeTokens = {\n small: {\n size: size[24],\n strokeWidth: size[3],\n percentTextSize: 'small',\n },\n medium: {\n size: size[48],\n strokeWidth: size[5],\n percentTextSize: 'small',\n },\n large: {\n size: size[72],\n strokeWidth: size[7],\n percentTextSize: 'medium',\n },\n} as const;\n\nconst getCircularProgressSVGTokens = ({\n size,\n progressPercent,\n}: {\n size: NonNullable<CircularProgressBarFilledProps['size']>;\n progressPercent: number;\n}): {\n sqSize: number;\n strokeWidth: number;\n radius: number;\n viewBox: string;\n dashArray: number;\n dashOffset: number;\n} => {\n // Size of the enclosing square\n const sqSize = circularProgressSizeTokens[size].size;\n const strokeWidth = circularProgressSizeTokens[size].strokeWidth;\n\n // SVG centers the stroke width on the radius, subtract out so circle fits in square\n const radius = (sqSize - strokeWidth) / 2;\n // Enclose circle in a circumscribing square\n const viewBox = `0 0 ${sqSize} ${sqSize}`;\n // Arc length at 100% coverage is the circle circumference\n const dashArray = radius * Math.PI * 2;\n // Scale 100% coverage overlay with the actual percent\n const dashOffset = dashArray - (dashArray * progressPercent) / 100;\n\n return {\n sqSize,\n strokeWidth,\n radius,\n viewBox,\n dashArray,\n dashOffset,\n };\n};\n\nexport {\n indeterminateAnimation,\n pulseAnimation,\n circularProgressSizeTokens,\n getCircularProgressSVGTokens,\n};\n"],"names":["indeterminateAnimation","scaleXInitial","scaleXMid","scaleXFinal","leftInitial","leftMid","leftFinal","fillWidth","pulseAnimation","opacityInitial","opacityMid","opacityFinal","backgroundColor","circularProgressSizeTokens","small","size","strokeWidth","percentTextSize","medium","large","getCircularProgressSVGTokens","_ref","progressPercent","sqSize","radius","viewBox","dashArray","Math","PI","dashOffset"],"mappings":";;;;AAGM,IAAAA,sBAAsB,CAAG,CAC7BC,aAAa,CAAE,CAAC,CAChBC,SAAS,CAAE,CAAC,CACZC,WAAW,CAAE,CAAC,CACdC,WAAW,CAAE,KAAK,CAClBC,OAAO,CAAE,KAAK,CACdC,SAAS,CAAE,MAAM,CACjBC,SAAS,CAAE,IACb,EAEM,IAAAC,cAAc,CAAG,CACrBC,cAAc,CAAE,CAAC,CACjBC,UAAU,CAAE,IAAI,CAChBC,YAAY,CAAE,CAAC,CACfC,eAAe,CAAE,OACnB,EAEM,IAAAC,0BAA0B,CAAG,CACjCC,KAAK,CAAE,CACLC,IAAI,CAAEA,IAAI,CAAC,EAAE,CAAC,CACdC,WAAW,CAAED,IAAI,CAAC,CAAC,CAAC,CACpBE,eAAe,CAAE,OACnB,CAAC,CACDC,MAAM,CAAE,CACNH,IAAI,CAAEA,IAAI,CAAC,EAAE,CAAC,CACdC,WAAW,CAAED,IAAI,CAAC,CAAC,CAAC,CACpBE,eAAe,CAAE,OACnB,CAAC,CACDE,KAAK,CAAE,CACLJ,IAAI,CAAEA,IAAI,CAAC,EAAE,CAAC,CACdC,WAAW,CAAED,IAAI,CAAC,CAAC,CAAC,CACpBE,eAAe,CAAE,QACnB,CACF,EAEM,IAAAG,4BAA4B,CAAG,SAA/BA,4BAA4BA,CAAAC,IAAA,CAa7B,CAZH,IAAAN,IAAI,CAAAM,IAAA,CAAJN,IAAI,CACJO,eAAe,CAAAD,IAAA,CAAfC,eAAe,CAaf,IAAMC,MAAM,CAAGV,0BAA0B,CAACE,IAAI,CAAC,CAACA,IAAI,CACpD,IAAMC,WAAW,CAAGH,0BAA0B,CAACE,IAAI,CAAC,CAACC,WAAW,CAGhE,IAAMQ,MAAM,CAAG,CAACD,MAAM,CAAGP,WAAW,EAAI,CAAC,CAEzC,IAAMS,OAAO,
|
|
1
|
+
{"version":3,"file":"progressBarTokens.js","sources":["../../../../../src/components/ProgressBar/progressBarTokens.ts"],"sourcesContent":["import type { CircularProgressBarFilledProps } from './types';\nimport { size } from '~tokens/global';\n\nconst indeterminateAnimation = {\n scaleXInitial: 1,\n scaleXMid: 5,\n scaleXFinal: 1,\n leftInitial: '-8%',\n leftMid: '50%',\n leftFinal: '103%',\n fillWidth: '5%',\n};\n\nconst pulseAnimation = {\n opacityInitial: 0,\n opacityMid: 0.25,\n opacityFinal: 0,\n backgroundColor: 'white',\n};\n\nconst circularProgressSizeTokens = {\n small: {\n size: size[24],\n strokeWidth: size[3],\n percentTextSize: 'small',\n },\n medium: {\n size: size[48],\n strokeWidth: size[5],\n percentTextSize: 'small',\n },\n large: {\n size: size[72],\n strokeWidth: size[7],\n percentTextSize: 'medium',\n },\n} as const;\n\nconst getCircularProgressSVGTokens = ({\n size,\n progressPercent,\n}: {\n size: NonNullable<CircularProgressBarFilledProps['size']>;\n progressPercent: number;\n}): {\n sqSize: number;\n strokeWidth: number;\n radius: number;\n viewBox: string;\n dashArray: number;\n dashOffset: number;\n} => {\n // Size of the enclosing square\n const sqSize = circularProgressSizeTokens[size].size;\n const strokeWidth = circularProgressSizeTokens[size].strokeWidth;\n\n // SVG centers the stroke width on the radius, subtract out so circle fits in square\n const radius = (sqSize - strokeWidth) / 2;\n // Enclose circle in a circumscribing square\n const viewBox = `0 0 ${sqSize} ${sqSize}`;\n // Arc length at 100% coverage is the circle circumference\n const dashArray = radius * Math.PI * 2;\n // Scale 100% coverage overlay with the actual percent\n const dashOffset = dashArray - (dashArray * progressPercent) / 100;\n\n return {\n sqSize,\n strokeWidth,\n radius,\n viewBox,\n dashArray,\n dashOffset,\n };\n};\n\nexport {\n indeterminateAnimation,\n pulseAnimation,\n circularProgressSizeTokens,\n getCircularProgressSVGTokens,\n};\n"],"names":["indeterminateAnimation","scaleXInitial","scaleXMid","scaleXFinal","leftInitial","leftMid","leftFinal","fillWidth","pulseAnimation","opacityInitial","opacityMid","opacityFinal","backgroundColor","circularProgressSizeTokens","small","size","strokeWidth","percentTextSize","medium","large","getCircularProgressSVGTokens","_ref","progressPercent","sqSize","radius","viewBox","dashArray","Math","PI","dashOffset"],"mappings":";;;;AAGM,IAAAA,sBAAsB,CAAG,CAC7BC,aAAa,CAAE,CAAC,CAChBC,SAAS,CAAE,CAAC,CACZC,WAAW,CAAE,CAAC,CACdC,WAAW,CAAE,KAAK,CAClBC,OAAO,CAAE,KAAK,CACdC,SAAS,CAAE,MAAM,CACjBC,SAAS,CAAE,IACb,EAEM,IAAAC,cAAc,CAAG,CACrBC,cAAc,CAAE,CAAC,CACjBC,UAAU,CAAE,IAAI,CAChBC,YAAY,CAAE,CAAC,CACfC,eAAe,CAAE,OACnB,EAEM,IAAAC,0BAA0B,CAAG,CACjCC,KAAK,CAAE,CACLC,IAAI,CAAEA,IAAI,CAAC,EAAE,CAAC,CACdC,WAAW,CAAED,IAAI,CAAC,CAAC,CAAC,CACpBE,eAAe,CAAE,OACnB,CAAC,CACDC,MAAM,CAAE,CACNH,IAAI,CAAEA,IAAI,CAAC,EAAE,CAAC,CACdC,WAAW,CAAED,IAAI,CAAC,CAAC,CAAC,CACpBE,eAAe,CAAE,OACnB,CAAC,CACDE,KAAK,CAAE,CACLJ,IAAI,CAAEA,IAAI,CAAC,EAAE,CAAC,CACdC,WAAW,CAAED,IAAI,CAAC,CAAC,CAAC,CACpBE,eAAe,CAAE,QACnB,CACF,EAEM,IAAAG,4BAA4B,CAAG,SAA/BA,4BAA4BA,CAAAC,IAAA,CAa7B,CAZH,IAAAN,IAAI,CAAAM,IAAA,CAAJN,IAAI,CACJO,eAAe,CAAAD,IAAA,CAAfC,eAAe,CAaf,IAAMC,MAAM,CAAGV,0BAA0B,CAACE,IAAI,CAAC,CAACA,IAAI,CACpD,IAAMC,WAAW,CAAGH,0BAA0B,CAACE,IAAI,CAAC,CAACC,WAAW,CAGhE,IAAMQ,MAAM,CAAG,CAACD,MAAM,CAAGP,WAAW,EAAI,CAAC,CAEzC,IAAMS,OAAO,CAAG,CAAOF,IAAAA,EAAAA,MAAM,CAAIA,CAAAA,EAAAA,MAAM,CAAE,CAAA,CAEzC,IAAMG,SAAS,CAAGF,MAAM,CAAGG,IAAI,CAACC,EAAE,CAAG,CAAC,CAEtC,IAAMC,UAAU,CAAGH,SAAS,CAAIA,SAAS,CAAGJ,eAAe,CAAI,GAAG,CAElE,OAAO,CACLC,MAAM,CAANA,MAAM,CACNP,WAAW,CAAXA,WAAW,CACXQ,MAAM,CAANA,MAAM,CACNC,OAAO,CAAPA,OAAO,CACPC,SAAS,CAATA,SAAS,CACTG,UAAU,CAAVA,UACF,CAAC,CACH;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioGroup.js","sources":["../../../../../../src/components/Radio/RadioGroup/RadioGroup.tsx"],"sourcesContent":["import React from 'react';\nimport { radioSizes } from '../radioTokens';\nimport { RadioGroupProvider } from './RadioContext';\nimport { useRadioGroup } from './useRadioGroup';\nimport BaseBox from '~components/Box/BaseBox';\nimport { FormHint, FormLabel } from '~components/Form';\nimport { SelectorGroupField } from '~components/Form/Selector/SelectorGroupField';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport { useBreakpoint } from '~utils';\nimport { useTheme } from '~components/BladeProvider';\nimport type { DataAnalyticsAttribute, TestID } from '~utils/types';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\n\ntype RadioGroupProps = {\n /**\n * Accepts multiple radios as children\n */\n children: React.ReactNode;\n /**\n * Help text of the radio group\n */\n helpText?: string;\n /**\n * Error text of the radio group\n * Renders when `validationState` is set to 'error'\n *\n * Overrides helpText\n */\n errorText?: string;\n /**\n * Sets the error state of the radioGroup\n * If set to `error` it will render the `errorText` of the group,\n * and propagate `invalid` prop to every radio\n */\n validationState?: 'error' | 'none';\n /**\n * Renders a necessity indicator after radioGroup label\n *\n * If set to `undefined` it renders nothing.\n */\n necessityIndicator?: 'required' | 'optional' | 'none';\n /**\n * Sets the disabled state of the radioGroup\n * If set to `true` it propagate down to all the radios\n *\n * @default false\n */\n isDisabled?: boolean;\n /**\n * Sets the required state of the radioGroup\n * @default false\n */\n isRequired?: boolean;\n /**\n * Renders the label of the radio group\n */\n label?: string;\n /**\n * Sets the position of the label\n *\n * @default 'top'\n */\n labelPosition?: 'top' | 'left';\n /**\n * Initial value of the radio group\n */\n defaultValue?: string;\n /**\n * value of the radio group\n *\n * Use `onChange` to update its value\n */\n value?: string;\n /**\n * The callback invoked when any of the radio's state changes\n */\n onChange?: ({\n name,\n value,\n event,\n }: {\n name: string | undefined;\n value: string;\n event: React.ChangeEvent<HTMLInputElement>;\n }) => void;\n /**\n * The name of the input field in a radio\n * (Useful for form submission).\n */\n name?: string;\n /**\n * Size of the radios\n *\n * @default \"medium\"\n */\n size?: 'small' | 'medium' | 'large';\n\n /**\n * Orientation of the radio group\n *\n * @default 'vertical'\n */\n orientation?: 'vertical' | 'horizontal';\n} & TestID &\n DataAnalyticsAttribute &\n StyledPropsBlade;\n\nconst RadioGroup = ({\n children,\n label,\n helpText,\n isDisabled = false,\n isRequired = false,\n necessityIndicator = 'none',\n labelPosition = 'top',\n validationState = 'none',\n errorText,\n name,\n defaultValue,\n onChange,\n value,\n size = 'medium',\n orientation = 'vertical',\n testID,\n flexWrap = 'nowrap',\n ...rest\n}: RadioGroupProps): React.ReactElement => {\n const { contextValue, ids } = useRadioGroup({\n defaultValue,\n isDisabled,\n isRequired,\n labelPosition,\n name,\n necessityIndicator,\n onChange,\n validationState,\n value,\n size,\n });\n\n const { theme } = useTheme();\n const { matchedDeviceType } = useBreakpoint({ breakpoints: theme.breakpoints });\n const showError = validationState === 'error' && errorText;\n const showHelpText = !showError && helpText;\n const accessibilityText = `${showError ? errorText : ''} ${showHelpText ? helpText : ''}`.trim();\n const gap = radioSizes.group.gap[size][matchedDeviceType];\n\n return (\n <RadioGroupProvider value={contextValue}>\n <BaseBox {...getStyledProps(rest)}>\n <SelectorGroupField\n position={labelPosition}\n labelledBy={ids.labelId}\n accessibilityRole=\"radiogroup\"\n componentName=\"radio-group\"\n testID={testID}\n {...makeAnalyticsAttribute(rest)}\n >\n {label ? (\n <FormLabel\n as=\"span\"\n necessityIndicator={necessityIndicator}\n position={labelPosition}\n id={ids.labelId}\n accessibilityText={accessibilityText && `,${accessibilityText}`}\n size={size}\n >\n {label}\n </FormLabel>\n ) : null}\n <BaseBox>\n <BaseBox\n display=\"flex\"\n flexDirection={orientation === 'vertical' ? 'column' : 'row'}\n gap={gap}\n flexWrap={flexWrap}\n >\n {React.Children.map(children, (child, index) => {\n return <BaseBox key={index}>{child}</BaseBox>;\n })}\n </BaseBox>\n <FormHint\n size={size}\n type={validationState === 'error' ? 'error' : 'help'}\n errorText={errorText}\n helpText={helpText}\n />\n </BaseBox>\n </SelectorGroupField>\n </BaseBox>\n </RadioGroupProvider>\n );\n};\n\nexport type { RadioGroupProps };\nexport { RadioGroup };\n"],"names":["RadioGroup","_ref","children","label","helpText","_ref$isDisabled","isDisabled","_ref$isRequired","isRequired","_ref$necessityIndicat","necessityIndicator","_ref$labelPosition","labelPosition","_ref$validationState","validationState","errorText","name","defaultValue","onChange","value","_ref$size","size","_ref$orientation","orientation","testID","_ref$flexWrap","flexWrap","rest","_objectWithoutProperties","_excluded","_useRadioGroup","useRadioGroup","contextValue","ids","_useTheme","useTheme","theme","_useBreakpoint","useBreakpoint","breakpoints","matchedDeviceType","showError","showHelpText","accessibilityText","trim","gap","radioSizes","group","_jsx","RadioGroupProvider","BaseBox","Object","assign","getStyledProps","_jsxs","SelectorGroupField","position","labelledBy","labelId","accessibilityRole","componentName","makeAnaly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A,QAAS,CAAAxB,QAAA,CAElBiE,cAAK,CAACC,QAAQ,CAACC,GAAG,CAACnE,QAAQ,CAAE,SAACoE,KAAK,CAAEC,KAAK,CAAK,CAC9C,OAAOvB,GAAA,CAACE,OAAO,CAAA,CAAAhD,QAAA,CAAcoE,KAAK,CAAbC,CAAAA,KAAuB,CAAC,CAC/C,CAAC,CAAC,CACK,CAAC,CACVvB,GAAA,CAACwB,QAAQ,CACPnD,CAAAA,IAAI,CAAEA,IAAK,CACXoD,IAAI,CAAE3D,eAAe,GAAK,OAAO,CAAG,OAAO,CAAG,MAAO,CACrDC,SAAS,CAAEA,SAAU,CACrBX,QAAQ,CAAEA,QAAS,CACpB,CAAC,CAAA,CACK,CAAC,CACQ,CAAA,CAAA,CAAC,CACd,CAAA,CAAC,CACQ,CAAC,CAEzB;;;;"}
|
|
1
|
+
{"version":3,"file":"RadioGroup.js","sources":["../../../../../../src/components/Radio/RadioGroup/RadioGroup.tsx"],"sourcesContent":["import React from 'react';\nimport { radioSizes } from '../radioTokens';\nimport { RadioGroupProvider } from './RadioContext';\nimport { useRadioGroup } from './useRadioGroup';\nimport BaseBox from '~components/Box/BaseBox';\nimport { FormHint, FormLabel } from '~components/Form';\nimport { SelectorGroupField } from '~components/Form/Selector/SelectorGroupField';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport { useBreakpoint } from '~utils';\nimport { useTheme } from '~components/BladeProvider';\nimport type { DataAnalyticsAttribute, TestID } from '~utils/types';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\n\ntype RadioGroupProps = {\n /**\n * Accepts multiple radios as children\n */\n children: React.ReactNode;\n /**\n * Help text of the radio group\n */\n helpText?: string;\n /**\n * Error text of the radio group\n * Renders when `validationState` is set to 'error'\n *\n * Overrides helpText\n */\n errorText?: string;\n /**\n * Sets the error state of the radioGroup\n * If set to `error` it will render the `errorText` of the group,\n * and propagate `invalid` prop to every radio\n */\n validationState?: 'error' | 'none';\n /**\n * Renders a necessity indicator after radioGroup label\n *\n * If set to `undefined` it renders nothing.\n */\n necessityIndicator?: 'required' | 'optional' | 'none';\n /**\n * Sets the disabled state of the radioGroup\n * If set to `true` it propagate down to all the radios\n *\n * @default false\n */\n isDisabled?: boolean;\n /**\n * Sets the required state of the radioGroup\n * @default false\n */\n isRequired?: boolean;\n /**\n * Renders the label of the radio group\n */\n label?: string;\n /**\n * Sets the position of the label\n *\n * @default 'top'\n */\n labelPosition?: 'top' | 'left';\n /**\n * Initial value of the radio group\n */\n defaultValue?: string;\n /**\n * value of the radio group\n *\n * Use `onChange` to update its value\n */\n value?: string;\n /**\n * The callback invoked when any of the radio's state changes\n */\n onChange?: ({\n name,\n value,\n event,\n }: {\n name: string | undefined;\n value: string;\n event: React.ChangeEvent<HTMLInputElement>;\n }) => void;\n /**\n * The name of the input field in a radio\n * (Useful for form submission).\n */\n name?: string;\n /**\n * Size of the radios\n *\n * @default \"medium\"\n */\n size?: 'small' | 'medium' | 'large';\n\n /**\n * Orientation of the radio group\n *\n * @default 'vertical'\n */\n orientation?: 'vertical' | 'horizontal';\n} & TestID &\n DataAnalyticsAttribute &\n StyledPropsBlade;\n\nconst RadioGroup = ({\n children,\n label,\n helpText,\n isDisabled = false,\n isRequired = false,\n necessityIndicator = 'none',\n labelPosition = 'top',\n validationState = 'none',\n errorText,\n name,\n defaultValue,\n onChange,\n value,\n size = 'medium',\n orientation = 'vertical',\n testID,\n flexWrap = 'nowrap',\n ...rest\n}: RadioGroupProps): React.ReactElement => {\n const { contextValue, ids } = useRadioGroup({\n defaultValue,\n isDisabled,\n isRequired,\n labelPosition,\n name,\n necessityIndicator,\n onChange,\n validationState,\n value,\n size,\n });\n\n const { theme } = useTheme();\n const { matchedDeviceType } = useBreakpoint({ breakpoints: theme.breakpoints });\n const showError = validationState === 'error' && errorText;\n const showHelpText = !showError && helpText;\n const accessibilityText = `${showError ? errorText : ''} ${showHelpText ? helpText : ''}`.trim();\n const gap = radioSizes.group.gap[size][matchedDeviceType];\n\n return (\n <RadioGroupProvider value={contextValue}>\n <BaseBox {...getStyledProps(rest)}>\n <SelectorGroupField\n position={labelPosition}\n labelledBy={ids.labelId}\n accessibilityRole=\"radiogroup\"\n componentName=\"radio-group\"\n testID={testID}\n {...makeAnalyticsAttribute(rest)}\n >\n {label ? (\n <FormLabel\n as=\"span\"\n necessityIndicator={necessityIndicator}\n position={labelPosition}\n id={ids.labelId}\n accessibilityText={accessibilityText && `,${accessibilityText}`}\n size={size}\n >\n {label}\n </FormLabel>\n ) : null}\n <BaseBox>\n <BaseBox\n display=\"flex\"\n flexDirection={orientation === 'vertical' ? 'column' : 'row'}\n gap={gap}\n flexWrap={flexWrap}\n >\n {React.Children.map(children, (child, index) => {\n return <BaseBox key={index}>{child}</BaseBox>;\n })}\n </BaseBox>\n <FormHint\n size={size}\n type={validationState === 'error' ? 'error' : 'help'}\n errorText={errorText}\n helpText={helpText}\n />\n </BaseBox>\n </SelectorGroupField>\n </BaseBox>\n </RadioGroupProvider>\n );\n};\n\nexport type { RadioGroupProps };\nexport { RadioGroup };\n"],"names":["RadioGroup","_ref","children","label","helpText","_ref$isDisabled","isDisabled","_ref$isRequired","isRequired","_ref$necessityIndicat","necessityIndicator","_ref$labelPosition","labelPosition","_ref$validationState","validationState","errorText","name","defaultValue","onChange","value","_ref$size","size","_ref$orientation","orientation","testID","_ref$flexWrap","flexWrap","rest","_objectWithoutProperties","_excluded","_useRadioGroup","useRadioGroup","contextValue","ids","_useTheme","useTheme","theme","_useBreakpoint","useBreakpoint","breakpoints","matchedDeviceType","showError","showHelpText","accessibilityText","trim","gap","radioSizes","group","_jsx","RadioGroupProvider","BaseBox","Object","assign","getStyledProps","_jsxs","SelectorGroupField","position","labelledBy","labelId","accessibilityRole","componentName","makeAnalyticsAttribute","FormLabel","as","id","display","flexDirection","React","Children","map","child","index","FormHint","type"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAA,SAAA,CAAA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CAAK,CAC9C,OAAOvB,GAAA,CAACE,OAAO,CAAA,CAAAhD,QAAA,CAAcoE,KAAK,CAAbC,CAAAA,KAAuB,CAAC,CAC/C,CAAC,CAAC,CACK,CAAC,CACVvB,GAAA,CAACwB,QAAQ,CACPnD,CAAAA,IAAI,CAAEA,IAAK,CACXoD,IAAI,CAAE3D,eAAe,GAAK,OAAO,CAAG,OAAO,CAAG,MAAO,CACrDC,SAAS,CAAEA,SAAU,CACrBX,QAAQ,CAAEA,QAAS,CACpB,CAAC,CAAA,CACK,CAAC,CACQ,CAAA,CAAA,CAAC,CACd,CAAA,CAAC,CACQ,CAAC,CAEzB;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRadioGroup.js","sources":["../../../../../../src/components/Radio/RadioGroup/useRadioGroup.ts"],"sourcesContent":["import React from 'react';\nimport type { RadioGroupProps } from './RadioGroup';\nimport type { RadioGroupContextType } from './RadioContext';\nimport isUndefined from '~utils/lodashButBetter/isUndefined';\nimport { useControllableState } from '~utils/useControllable';\nimport { useTheme } from '~components/BladeProvider';\nimport { useId } from '~utils/useId';\n\ntype UseRadioGroupProps = Pick<\n RadioGroupProps,\n | 'isDisabled'\n | 'isRequired'\n | 'labelPosition'\n | 'validationState'\n | 'name'\n | 'value'\n | 'defaultValue'\n | 'onChange'\n | 'necessityIndicator'\n | 'size'\n>;\n\nexport type State = {\n value: string;\n setValue(value: string, event: React.ChangeEvent<Element>): void;\n removeValue(): void;\n isChecked(value: string): boolean;\n};\n\ntype UseRadioGroupReturn = {\n state: State;\n contextValue: RadioGroupContextType;\n ids: { labelId: string };\n};\n\nconst useRadioGroup = ({\n value,\n defaultValue,\n isDisabled,\n isRequired,\n labelPosition,\n onChange,\n validationState,\n necessityIndicator,\n name,\n size,\n}: UseRadioGroupProps): UseRadioGroupReturn => {\n const { platform } = useTheme();\n const idBase = useId('radio-group');\n const labelId = `${idBase}-label`;\n const fallbackName = name ?? idBase;\n const [checkedValue, setValue] = useControllableState({\n value,\n defaultValue,\n onChange: (v, event) => {\n onChange?.({ value: v, name: fallbackName, event });\n },\n });\n\n const state = React.useMemo<State>(() => {\n return {\n value: checkedValue,\n setValue(v, event): void {\n if (isDisabled) {\n return;\n }\n\n setValue(() => v, false, event);\n },\n removeValue(): void {\n if (isDisabled) {\n return;\n }\n\n setValue(undefined!);\n },\n isChecked(v: string): boolean {\n if (isUndefined(v) || isUndefined(checkedValue)) return false;\n return checkedValue === v;\n },\n };\n }, [checkedValue, isDisabled, setValue]);\n\n const contextValue = React.useMemo<RadioGroupContextType>(() => {\n return {\n necessityIndicator,\n validationState,\n isDisabled,\n isRequired,\n labelPosition: platform === 'onMobile' ? 'top' : labelPosition,\n name: fallbackName,\n state,\n size,\n };\n }, [\n validationState,\n isDisabled,\n isRequired,\n platform,\n labelPosition,\n state,\n fallbackName,\n necessityIndicator,\n size,\n ]);\n\n return { state, contextValue, ids: { labelId } };\n};\n\nexport { useRadioGroup };\n"],"names":["useRadioGroup","_ref","value","defaultValue","isDisabled","isRequired","labelPosition","onChange","validationState","necessityIndicator","name","size","_useTheme","useTheme","platform","idBase","useId","labelId","fallbackName","_useControllableState","useControllableState","v","event","_useControllableState2","_slicedToArray","checkedValue","setValue","state","React","useMemo","_setValue","_x","_x2","apply","arguments","toString","removeValue","undefined","isChecked","isUndefined","contextValue","ids"],"mappings":";;;;;;;;;;;;;AAmCM,IAAAA,aAAa,CAAG,SAAhBA,aAAaA,CAAAC,IAAA,CAW4B,CAAA,IAV7CC,KAAK,CAAAD,IAAA,CAALC,KAAK,CACLC,YAAY,CAAAF,IAAA,CAAZE,YAAY,CACZC,UAAU,CAAAH,IAAA,CAAVG,UAAU,CACVC,UAAU,CAAAJ,IAAA,CAAVI,UAAU,CACVC,aAAa,CAAAL,IAAA,CAAbK,aAAa,CACbC,SAAQ,CAAAN,IAAA,CAARM,QAAQ,CACRC,eAAe,CAAAP,IAAA,CAAfO,eAAe,CACfC,kBAAkB,CAAAR,IAAA,CAAlBQ,kBAAkB,CAClBC,IAAI,CAAAT,IAAA,CAAJS,IAAI,CACJC,IAAI,CAAAV,IAAA,CAAJU,IAAI,CAEJ,IAAAC,SAAA,CAAqBC,QAAQ,EAAE,CAAvBC,QAAQ,CAAAF,SAAA,CAARE,QAAQ,CAChB,IAAMC,MAAM,CAAGC,KAAK,CAAC,aAAa,CAAC,CACnC,IAAMC,OAAO,
|
|
1
|
+
{"version":3,"file":"useRadioGroup.js","sources":["../../../../../../src/components/Radio/RadioGroup/useRadioGroup.ts"],"sourcesContent":["import React from 'react';\nimport type { RadioGroupProps } from './RadioGroup';\nimport type { RadioGroupContextType } from './RadioContext';\nimport isUndefined from '~utils/lodashButBetter/isUndefined';\nimport { useControllableState } from '~utils/useControllable';\nimport { useTheme } from '~components/BladeProvider';\nimport { useId } from '~utils/useId';\n\ntype UseRadioGroupProps = Pick<\n RadioGroupProps,\n | 'isDisabled'\n | 'isRequired'\n | 'labelPosition'\n | 'validationState'\n | 'name'\n | 'value'\n | 'defaultValue'\n | 'onChange'\n | 'necessityIndicator'\n | 'size'\n>;\n\nexport type State = {\n value: string;\n setValue(value: string, event: React.ChangeEvent<Element>): void;\n removeValue(): void;\n isChecked(value: string): boolean;\n};\n\ntype UseRadioGroupReturn = {\n state: State;\n contextValue: RadioGroupContextType;\n ids: { labelId: string };\n};\n\nconst useRadioGroup = ({\n value,\n defaultValue,\n isDisabled,\n isRequired,\n labelPosition,\n onChange,\n validationState,\n necessityIndicator,\n name,\n size,\n}: UseRadioGroupProps): UseRadioGroupReturn => {\n const { platform } = useTheme();\n const idBase = useId('radio-group');\n const labelId = `${idBase}-label`;\n const fallbackName = name ?? idBase;\n const [checkedValue, setValue] = useControllableState({\n value,\n defaultValue,\n onChange: (v, event) => {\n onChange?.({ value: v, name: fallbackName, event });\n },\n });\n\n const state = React.useMemo<State>(() => {\n return {\n value: checkedValue,\n setValue(v, event): void {\n if (isDisabled) {\n return;\n }\n\n setValue(() => v, false, event);\n },\n removeValue(): void {\n if (isDisabled) {\n return;\n }\n\n setValue(undefined!);\n },\n isChecked(v: string): boolean {\n if (isUndefined(v) || isUndefined(checkedValue)) return false;\n return checkedValue === v;\n },\n };\n }, [checkedValue, isDisabled, setValue]);\n\n const contextValue = React.useMemo<RadioGroupContextType>(() => {\n return {\n necessityIndicator,\n validationState,\n isDisabled,\n isRequired,\n labelPosition: platform === 'onMobile' ? 'top' : labelPosition,\n name: fallbackName,\n state,\n size,\n };\n }, [\n validationState,\n isDisabled,\n isRequired,\n platform,\n labelPosition,\n state,\n fallbackName,\n necessityIndicator,\n size,\n ]);\n\n return { state, contextValue, ids: { labelId } };\n};\n\nexport { useRadioGroup };\n"],"names":["useRadioGroup","_ref","value","defaultValue","isDisabled","isRequired","labelPosition","onChange","validationState","necessityIndicator","name","size","_useTheme","useTheme","platform","idBase","useId","labelId","fallbackName","_useControllableState","useControllableState","v","event","_useControllableState2","_slicedToArray","checkedValue","setValue","state","React","useMemo","_setValue","_x","_x2","apply","arguments","toString","removeValue","undefined","isChecked","isUndefined","contextValue","ids"],"mappings":";;;;;;;;;;;;;AAmCM,IAAAA,aAAa,CAAG,SAAhBA,aAAaA,CAAAC,IAAA,CAW4B,CAAA,IAV7CC,KAAK,CAAAD,IAAA,CAALC,KAAK,CACLC,YAAY,CAAAF,IAAA,CAAZE,YAAY,CACZC,UAAU,CAAAH,IAAA,CAAVG,UAAU,CACVC,UAAU,CAAAJ,IAAA,CAAVI,UAAU,CACVC,aAAa,CAAAL,IAAA,CAAbK,aAAa,CACbC,SAAQ,CAAAN,IAAA,CAARM,QAAQ,CACRC,eAAe,CAAAP,IAAA,CAAfO,eAAe,CACfC,kBAAkB,CAAAR,IAAA,CAAlBQ,kBAAkB,CAClBC,IAAI,CAAAT,IAAA,CAAJS,IAAI,CACJC,IAAI,CAAAV,IAAA,CAAJU,IAAI,CAEJ,IAAAC,SAAA,CAAqBC,QAAQ,EAAE,CAAvBC,QAAQ,CAAAF,SAAA,CAARE,QAAQ,CA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,SAAAA,WAAAA,EAAS,CAClB,GAAIhC,UAAU,CAAE,CACd,OACF,CAEAsB,QAAQ,CAACW,SAAU,CAAC,CACtB,CAAC,CACDC,SAAS,UAAAA,SAACjB,CAAAA,CAAS,CAAW,CAC5B,GAAIkB,WAAW,CAAClB,CAAC,CAAC,EAAIkB,WAAW,CAACd,YAAY,CAAC,CAAE,OAAO,KAAK,CAC7D,OAAOA,YAAY,GAAKJ,CAAC,CAC3B,CACF,CAAC,CACH,CAAC,CAAE,CAACI,YAAY,CAAErB,UAAU,CAAEsB,QAAQ,CAAC,CAAC,CAExC,IAAMc,YAAY,CAAGZ,cAAK,CAACC,OAAO,CAAwB,UAAM,CAC9D,OAAO,CACLpB,kBAAkB,CAAlBA,kBAAkB,CAClBD,eAAe,CAAfA,eAAe,CACfJ,UAAU,CAAVA,UAAU,CACVC,UAAU,CAAVA,UAAU,CACVC,aAAa,CAAEQ,QAAQ,GAAK,UAAU,CAAG,KAAK,CAAGR,aAAa,CAC9DI,IAAI,CAAEQ,YAAY,CAClBS,KAAK,CAALA,KAAK,CACLhB,IAAI,CAAJA,IACF,CAAC,CACH,CAAC,CAAE,CACDH,eAAe,CACfJ,UAAU,CACVC,UAAU,CACVS,QAAQ,CACRR,aAAa,CACbqB,KAAK,CACLT,YAAY,CACZT,kBAAkB,CAClBE,IAAI,CACL,CAAC,CAEF,OAAO,CAAEgB,KAAK,CAALA,KAAK,CAAEa,YAAY,CAAZA,YAAY,CAAEC,GAAG,CAAE,CAAExB,OAAO,CAAPA,OAAQ,CAAE,CAAC,CAClD;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioIcon.js","sources":["../../../../../../src/components/Radio/RadioIcon/RadioIcon.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/explicit-function-return-type */\n/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\nimport React from 'react';\nimport { radioIconColors, radioSizes } from '../radioTokens';\nimport type { RadioProps } from '../Radio';\nimport { RadioIconWrapper } from './RadioIconWrapper';\nimport { Fade } from './Fade';\nimport getIn from '~utils/lodashButBetter/get';\nimport { useTheme } from '~components/BladeProvider';\nimport Svg from '~components/Icons/_Svg';\nimport Circle from '~components/Icons/_Svg/Circle';\nimport { makeSpace } from '~utils/makeSpace';\nimport { metaAttribute } from '~utils/metaAttribute';\n\nexport type RadioIconProps = {\n isDisabled?: boolean;\n isNegative?: boolean;\n isChecked?: boolean;\n} & Required<Pick<RadioProps, 'size'>>;\n\nconst CheckedIcon = ({ color, size }: { color: string; size: RadioIconProps['size'] }) => {\n const width = radioSizes.icon[size].width;\n const height = radioSizes.icon[size].height;\n const radius = radioSizes.icon[size].dotRadius;\n const viewBox = `0 0 ${width} ${height}`;\n const cx = `${width / 2}`;\n const cy = `${height / 2}`;\n\n return (\n <Svg width={makeSpace(width)} height={makeSpace(height)} viewBox={viewBox} fill=\"none\">\n <Circle cx={cx} cy={cy} r={`${radius}`} fill={color} />\n </Svg>\n );\n};\n\nconst RadioIcon = ({ isChecked, isDisabled, isNegative, size }: RadioIconProps) => {\n const { theme } = useTheme();\n\n const checked = Boolean(isChecked);\n const state = checked ? 'checked' : 'unchecked';\n let variant: 'default' | 'disabled' | 'negative' = 'default';\n if (isDisabled) variant = 'disabled';\n if (isNegative) variant = 'negative';\n const dotColorToken = radioIconColors.variants[variant].dot[state];\n const dotColor = getIn(theme, dotColorToken);\n\n return (\n <RadioIconWrapper\n size={size}\n isDisabled={isDisabled}\n isNegative={isNegative}\n isChecked={checked}\n {...metaAttribute({ name: 'radio-icon-wrapper' })}\n >\n <Fade show={checked} styles={{ position: 'absolute', display: 'flex' }}>\n <CheckedIcon size={size} color={dotColor} />\n </Fade>\n </RadioIconWrapper>\n );\n};\n\nexport { RadioIcon };\n"],"names":["CheckedIcon","_ref","color","size","width","radioSizes","icon","height","radius","dotRadius","viewBox","cx","cy","_jsx","Svg","makeSpace","fill","children","Circle","r","RadioIcon","_ref2","isChecked","isDisabled","isNegative","_useTheme","useTheme","theme","checked","Boolean","state","variant","dotColorToken","radioIconColors","variants","dot","dotColor","getIn","RadioIconWrapper","Object","assign","metaAttribute","name","Fade","show","styles","position","display"],"mappings":";;;;;;;;;;;;;;;;;;;AAoBA,IAAMA,WAAW,CAAG,SAAdA,WAAWA,CAAAC,IAAA,CAAyE,CAAA,IAAnEC,KAAK,CAAAD,IAAA,CAALC,KAAK,CAAEC,IAAI,CAAAF,IAAA,CAAJE,IAAI,CAChC,IAAMC,KAAK,CAAGC,UAAU,CAACC,IAAI,CAACH,IAAI,CAAC,CAACC,KAAK,CACzC,IAAMG,MAAM,CAAGF,UAAU,CAACC,IAAI,CAACH,IAAI,CAAC,CAACI,MAAM,CAC3C,IAAMC,MAAM,CAAGH,UAAU,CAACC,IAAI,CAACH,IAAI,CAAC,CAACM,SAAS,CAC9C,IAAMC,OAAO,
|
|
1
|
+
{"version":3,"file":"RadioIcon.js","sources":["../../../../../../src/components/Radio/RadioIcon/RadioIcon.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/explicit-function-return-type */\n/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\nimport React from 'react';\nimport { radioIconColors, radioSizes } from '../radioTokens';\nimport type { RadioProps } from '../Radio';\nimport { RadioIconWrapper } from './RadioIconWrapper';\nimport { Fade } from './Fade';\nimport getIn from '~utils/lodashButBetter/get';\nimport { useTheme } from '~components/BladeProvider';\nimport Svg from '~components/Icons/_Svg';\nimport Circle from '~components/Icons/_Svg/Circle';\nimport { makeSpace } from '~utils/makeSpace';\nimport { metaAttribute } from '~utils/metaAttribute';\n\nexport type RadioIconProps = {\n isDisabled?: boolean;\n isNegative?: boolean;\n isChecked?: boolean;\n} & Required<Pick<RadioProps, 'size'>>;\n\nconst CheckedIcon = ({ color, size }: { color: string; size: RadioIconProps['size'] }) => {\n const width = radioSizes.icon[size].width;\n const height = radioSizes.icon[size].height;\n const radius = radioSizes.icon[size].dotRadius;\n const viewBox = `0 0 ${width} ${height}`;\n const cx = `${width / 2}`;\n const cy = `${height / 2}`;\n\n return (\n <Svg width={makeSpace(width)} height={makeSpace(height)} viewBox={viewBox} fill=\"none\">\n <Circle cx={cx} cy={cy} r={`${radius}`} fill={color} />\n </Svg>\n );\n};\n\nconst RadioIcon = ({ isChecked, isDisabled, isNegative, size }: RadioIconProps) => {\n const { theme } = useTheme();\n\n const checked = Boolean(isChecked);\n const state = checked ? 'checked' : 'unchecked';\n let variant: 'default' | 'disabled' | 'negative' = 'default';\n if (isDisabled) variant = 'disabled';\n if (isNegative) variant = 'negative';\n const dotColorToken = radioIconColors.variants[variant].dot[state];\n const dotColor = getIn(theme, dotColorToken);\n\n return (\n <RadioIconWrapper\n size={size}\n isDisabled={isDisabled}\n isNegative={isNegative}\n isChecked={checked}\n {...metaAttribute({ name: 'radio-icon-wrapper' })}\n >\n <Fade show={checked} styles={{ position: 'absolute', display: 'flex' }}>\n <CheckedIcon size={size} color={dotColor} />\n </Fade>\n </RadioIconWrapper>\n );\n};\n\nexport { RadioIcon };\n"],"names":["CheckedIcon","_ref","color","size","width","radioSizes","icon","height","radius","dotRadius","viewBox","cx","cy","_jsx","Svg","makeSpace","fill","children","Circle","r","RadioIcon","_ref2","isChecked","isDisabled","isNegative","_useTheme","useTheme","theme","checked","Boolean","state","variant","dotColorToken","radioIconColors","variants","dot","dotColor","getIn","RadioIconWrapper","Object","assign","metaAttribute","name","Fade","show","styles","position","display"],"mappings":";;;;;;;;;;;;;;;;;;;AAoBA,IAAMA,WAAW,CAAG,SAAdA,WAAWA,CAAAC,IAAA,CAAyE,CAAA,IAAnEC,KAAK,CAAAD,IAAA,CAALC,KAAK,CAAEC,IAAI,CAAAF,IAAA,CAAJE,IAAI,CAChC,IAAMC,KAAK,CAAGC,UAAU,CAACC,IAAI,CAACH,IAAI,CAAC,CAACC,KAAK,CACzC,IAAMG,MAAM,CAAGF,UAAU,CAACC,IAAI,CAACH,IAAI,CAAC,CAACI,MAAM,CAC3C,IAAMC,MAAM,CAAGH,UAAU,CAAC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G,CAACL,KAAK,CAAC,CAClE,IAAMM,QAAQ,CAAGC,KAAK,CAACV,KAAK,CAAEK,aAAa,CAAC,CAE5C,OACEnB,GAAA,CAACyB,gBAAgB,CAAAC,MAAA,CAAAC,MAAA,CACfrC,CAAAA,IAAI,CAAEA,IAAK,CACXoB,UAAU,CAAEA,UAAW,CACvBC,UAAU,CAAEA,UAAW,CACvBF,SAAS,CAAEM,OAAQ,CAAA,CACfa,aAAa,CAAC,CAAEC,IAAI,CAAE,oBAAqB,CAAC,CAAC,CAAAzB,CAAAA,QAAA,CAEjDJ,GAAA,CAAC8B,IAAI,CAACC,CAAAA,IAAI,CAAEhB,OAAQ,CAACiB,MAAM,CAAE,CAAEC,QAAQ,CAAE,UAAU,CAAEC,OAAO,CAAE,MAAO,CAAE,CAAA9B,QAAA,CACrEJ,GAAA,CAACb,WAAW,CAAA,CAACG,IAAI,CAAEA,IAAK,CAACD,KAAK,CAAEkC,QAAS,CAAE,CAAC,CACxC,CAAC,CAAA,CACS,CAAC,CAEvB;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRadio.js","sources":["../../../../../src/components/Radio/useRadio.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/explicit-function-return-type */\n/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\nimport React from 'react';\nimport type { GestureResponderEvent } from 'react-native';\nimport { useControllableState } from '~utils/useControllable';\nimport { useId } from '~utils/useId';\nimport { getPlatformType } from '~src/utils';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport { throwBladeError } from '~utils/logger';\n\nexport type OnChange = ({\n isChecked,\n event,\n value,\n}: {\n isChecked: boolean;\n event: React.ChangeEvent;\n value?: string;\n}) => void;\n\ntype UseRadioProps = {\n hasError?: boolean;\n /**\n * If `true`, The Radio will be checked. This also makes the Radio controlled\n * Use `onChange` to update its value\n *\n * @default false\n */\n isChecked?: boolean;\n /**\n * If `true`, the Radio will be initially checked. This also makes the Radio uncontrolled\n *\n * @default false\n */\n defaultChecked?: boolean;\n /**\n * The callback invoked when the checked state of the `Radio` changes.\n */\n onChange?: OnChange;\n /**\n * The name of the input field in a Radio\n * (Useful for form submission).\n */\n name?: string;\n /**\n * The value to be used in the Radio input.\n * This is the value that will be returned on form submission.\n */\n value?: string;\n /**\n * If `true`, the Radio will be disabled\n *\n * @default false\n */\n isDisabled?: boolean;\n /**\n * If `true`, the Radio input is marked as required,\n * and `required` attribute will be added\n *\n * @default false\n */\n isRequired?: boolean;\n};\n\nconst useRadio = ({\n isChecked,\n defaultChecked,\n isDisabled,\n isRequired,\n hasError,\n onChange,\n name,\n value,\n}: UseRadioProps) => {\n const inputRef = React.useRef<HTMLInputElement>(null);\n\n const isReactNative = getPlatformType() === 'react-native';\n if (__DEV__) {\n if (isChecked && defaultChecked) {\n throwBladeError({\n message: `Do not provide both 'isChecked' and 'defaultChecked' to useRadio. Consider if you want this component to be controlled or uncontrolled.`,\n moduleName: 'Radio',\n });\n }\n }\n\n const [radioState, setRadioState] = useControllableState({\n value: isChecked,\n defaultValue: defaultChecked ?? false,\n });\n\n const handleOnChange = (event: React.ChangeEvent<HTMLInputElement> | GestureResponderEvent) => {\n if (isDisabled) {\n event.stopPropagation();\n event.preventDefault();\n return;\n }\n\n setRadioState((checked) => {\n // Prevent radio to be unchecked when clicked again\n // Once checked radios don't act as toggle buttons\n if (checked === false) {\n onChange?.({\n isChecked: true,\n event: event as React.ChangeEvent,\n value,\n });\n return true;\n }\n return checked;\n });\n };\n\n const state = {\n isChecked: radioState,\n setChecked: setRadioState,\n };\n\n const idBase = useId('radio');\n const helpTextId = useId(`${idBase}-helptext`);\n\n const accessibilityProps = makeAccessible({\n role: 'radio',\n required: Boolean(isRequired),\n invalid: Boolean(hasError),\n disabled: Boolean(isDisabled),\n checked: radioState,\n describedBy: helpTextId,\n });\n\n if (isReactNative) {\n return {\n state,\n inputProps: {\n onPress: handleOnChange,\n name,\n value,\n ...accessibilityProps,\n },\n };\n }\n\n return {\n state,\n ids: { helpTextId },\n inputProps: {\n ref: inputRef,\n onChange: handleOnChange,\n type: 'radio',\n name,\n value,\n checked: radioState,\n disabled: isDisabled,\n required: isRequired,\n ...accessibilityProps,\n },\n };\n};\n\nexport type InputProps = ReturnType<typeof useRadio>['inputProps'];\n\nexport { useRadio };\n"],"names":["useRadio","_ref","isChecked","defaultChecked","isDisabled","isRequired","hasError","onChange","name","value","inputRef","React","useRef","isReactNative","getPlatformType","__DEV__","throwBladeError","message","moduleName","_useControllableState","useControllableState","defaultValue","_useControllableState2","_slicedToArray","radioState","setRadioState","handleOnChange","event","stopPropagation","preventDefault","checked","state","setChecked","idBase","useId","helpTextId","accessibilityProps","makeAccessible","role","required","Boolean","invalid","disabled","describedBy","inputProps","Object","assign","onPress","ids","ref","type"],"mappings":";;;;;;;;;;AAgEM,IAAAA,QAAQ,CAAG,SAAXA,QAAQA,CAAAC,IAAA,CASO,CARnB,IAAAC,SAAS,CAAAD,IAAA,CAATC,SAAS,CACTC,cAAc,CAAAF,IAAA,CAAdE,cAAc,CACdC,UAAU,CAAAH,IAAA,CAAVG,UAAU,CACVC,UAAU,CAAAJ,IAAA,CAAVI,UAAU,CACVC,QAAQ,CAAAL,IAAA,CAARK,QAAQ,CACRC,QAAQ,CAAAN,IAAA,CAARM,QAAQ,CACRC,IAAI,CAAAP,IAAA,CAAJO,IAAI,CACJC,KAAK,CAAAR,IAAA,CAALQ,KAAK,CAEL,IAAMC,QAAQ,CAAGC,cAAK,CAACC,MAAM,CAAmB,IAAI,CAAC,CAErD,IAAMC,aAAa,CAAGC,eAAe,EAAE,GAAK,cAAc,CAC1D,GAAIC,OAAO,CAAE,CACX,GAAIb,SAAS,EAAIC,cAAc,CAAE,CAC/Ba,eAAe,CAAC,CACdC,OAAO,
|
|
1
|
+
{"version":3,"file":"useRadio.js","sources":["../../../../../src/components/Radio/useRadio.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/explicit-function-return-type */\n/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\nimport React from 'react';\nimport type { GestureResponderEvent } from 'react-native';\nimport { useControllableState } from '~utils/useControllable';\nimport { useId } from '~utils/useId';\nimport { getPlatformType } from '~src/utils';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport { throwBladeError } from '~utils/logger';\n\nexport type OnChange = ({\n isChecked,\n event,\n value,\n}: {\n isChecked: boolean;\n event: React.ChangeEvent;\n value?: string;\n}) => void;\n\ntype UseRadioProps = {\n hasError?: boolean;\n /**\n * If `true`, The Radio will be checked. This also makes the Radio controlled\n * Use `onChange` to update its value\n *\n * @default false\n */\n isChecked?: boolean;\n /**\n * If `true`, the Radio will be initially checked. This also makes the Radio uncontrolled\n *\n * @default false\n */\n defaultChecked?: boolean;\n /**\n * The callback invoked when the checked state of the `Radio` changes.\n */\n onChange?: OnChange;\n /**\n * The name of the input field in a Radio\n * (Useful for form submission).\n */\n name?: string;\n /**\n * The value to be used in the Radio input.\n * This is the value that will be returned on form submission.\n */\n value?: string;\n /**\n * If `true`, the Radio will be disabled\n *\n * @default false\n */\n isDisabled?: boolean;\n /**\n * If `true`, the Radio input is marked as required,\n * and `required` attribute will be added\n *\n * @default false\n */\n isRequired?: boolean;\n};\n\nconst useRadio = ({\n isChecked,\n defaultChecked,\n isDisabled,\n isRequired,\n hasError,\n onChange,\n name,\n value,\n}: UseRadioProps) => {\n const inputRef = React.useRef<HTMLInputElement>(null);\n\n const isReactNative = getPlatformType() === 'react-native';\n if (__DEV__) {\n if (isChecked && defaultChecked) {\n throwBladeError({\n message: `Do not provide both 'isChecked' and 'defaultChecked' to useRadio. Consider if you want this component to be controlled or uncontrolled.`,\n moduleName: 'Radio',\n });\n }\n }\n\n const [radioState, setRadioState] = useControllableState({\n value: isChecked,\n defaultValue: defaultChecked ?? false,\n });\n\n const handleOnChange = (event: React.ChangeEvent<HTMLInputElement> | GestureResponderEvent) => {\n if (isDisabled) {\n event.stopPropagation();\n event.preventDefault();\n return;\n }\n\n setRadioState((checked) => {\n // Prevent radio to be unchecked when clicked again\n // Once checked radios don't act as toggle buttons\n if (checked === false) {\n onChange?.({\n isChecked: true,\n event: event as React.ChangeEvent,\n value,\n });\n return true;\n }\n return checked;\n });\n };\n\n const state = {\n isChecked: radioState,\n setChecked: setRadioState,\n };\n\n const idBase = useId('radio');\n const helpTextId = useId(`${idBase}-helptext`);\n\n const accessibilityProps = makeAccessible({\n role: 'radio',\n required: Boolean(isRequired),\n invalid: Boolean(hasError),\n disabled: Boolean(isDisabled),\n checked: radioState,\n describedBy: helpTextId,\n });\n\n if (isReactNative) {\n return {\n state,\n inputProps: {\n onPress: handleOnChange,\n name,\n value,\n ...accessibilityProps,\n },\n };\n }\n\n return {\n state,\n ids: { helpTextId },\n inputProps: {\n ref: inputRef,\n onChange: handleOnChange,\n type: 'radio',\n name,\n value,\n checked: radioState,\n disabled: isDisabled,\n required: isRequired,\n ...accessibilityProps,\n },\n };\n};\n\nexport type InputProps = ReturnType<typeof useRadio>['inputProps'];\n\nexport { useRadio };\n"],"names":["useRadio","_ref","isChecked","defaultChecked","isDisabled","isRequired","hasError","onChange","name","value","inputRef","React","useRef","isReactNative","getPlatformType","__DEV__","throwBladeError","message","moduleName","_useControllableState","useControllableState","defaultValue","_useControllableState2","_slicedToArray","radioState","setRadioState","handleOnChange","event","stopPropagation","preventDefault","checked","state","setChecked","idBase","useId","helpTextId","accessibilityProps","makeAccessible","role","required","Boolean","invalid","disabled","describedBy","inputProps","Object","assign","onPress","ids","ref","type"],"mappings":";;;;;;;;;;AAgEM,IAAAA,QAAQ,CAAG,SAAXA,QAAQA,CAAAC,IAAA,CASO,CARnB,IAAAC,SAAS,CAAAD,IAAA,CAATC,SAAS,CACTC,cAAc,CAAAF,IAAA,CAAdE,cAAc,CACdC,UAAU,CAAAH,IAAA,CAAVG,UAAU,CACVC,UAAU,CAAAJ,IAAA,CAAVI,UAAU,CACVC,QAAQ,CAAAL,IAAA,CAARK,QAAQ,CACRC,QAAQ,CAAAN,IAAA,CAARM,QAAQ,CACRC,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B,IAAMC,UAAU,CAAGD,KAAK,CAAC,GAAGD,MAAM,CAAA,SAAA,CAAW,CAAC,CAE9C,IAAMG,kBAAkB,CAAGC,cAAc,CAAC,CACxCC,IAAI,CAAE,OAAO,CACbC,QAAQ,CAAEC,OAAO,CAACnC,UAAU,CAAC,CAC7BoC,OAAO,CAAED,OAAO,CAAClC,QAAQ,CAAC,CAC1BoC,QAAQ,CAAEF,OAAO,CAACpC,UAAU,CAAC,CAC7B0B,OAAO,CAAEN,UAAU,CACnBmB,WAAW,CAAER,UACf,CAAC,CAAC,CAEF,GAAItB,aAAa,CAAE,CACjB,OAAO,CACLkB,KAAK,CAALA,KAAK,CACLa,UAAU,CAAAC,MAAA,CAAAC,MAAA,CACRC,CAAAA,OAAO,CAAErB,cAAc,CACvBlB,IAAI,CAAJA,IAAI,CACJC,KAAK,CAALA,KAAK,CAAA,CACF2B,kBAAkB,CAEzB,CAAC,CACH,CAEA,OAAO,CACLL,KAAK,CAALA,KAAK,CACLiB,GAAG,CAAE,CAAEb,UAAU,CAAVA,UAAW,CAAC,CACnBS,UAAU,CAAAC,MAAA,CAAAC,MAAA,EACRG,GAAG,CAAEvC,QAAQ,CACbH,QAAQ,CAAEmB,cAAc,CACxBwB,IAAI,CAAE,OAAO,CACb1C,IAAI,CAAJA,IAAI,CACJC,KAAK,CAALA,KAAK,CACLqB,OAAO,CAAEN,UAAU,CACnBkB,QAAQ,CAAEtC,UAAU,CACpBmC,QAAQ,CAAElC,UAAU,EACjB+B,kBAAkB,CAEzB,CAAC,CACH;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseSpinner.js","sources":["../../../../../../src/components/Spinner/BaseSpinner/BaseSpinner.tsx"],"sourcesContent":["import React from 'react';\nimport { dimensions } from './spinnerTokens';\nimport SpinnerIcon from './SpinnerIcon';\nimport { SpinningBox } from './SpinningBox';\nimport getIn from '~utils/lodashButBetter/get';\nimport type { Theme } from '~components/BladeProvider';\nimport { useTheme } from '~components/BladeProvider';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport type { FeedbackColors } from '~tokens/theme/theme';\nimport BaseBox from '~components/Box/BaseBox';\nimport { Text } from '~components/Typography';\nimport type { BladeElementRef, TestID } from '~utils/types';\nimport { makeSize } from '~utils/makeSize';\nimport { makeAccessible } from '~utils/makeAccessible';\n\ntype BaseSpinnerProps = {\n /**\n * Sets the color of the spinner.\n *\n * @default 'default'\n */\n color?: 'primary' | 'white' | FeedbackColors;\n /**\n * Sets the label of the spinner.\n *\n * @default 'right'\n */\n label?: string;\n /**\n * Sets the label of the spinner.\n *\n */\n labelPosition?: 'right' | 'bottom';\n /**\n * Sets the size of the spinner.\n *\n * @default 'medium'\n */\n size?: 'medium' | 'large' | 'xlarge';\n /**\n * Sets the aria-label for web & accessibilityLabel react-native.\n *\n */\n accessibilityLabel: string;\n} & TestID &\n StyledPropsBlade;\n\nconst getColor = ({ color, theme }: { color: BaseSpinnerProps['color']; theme: Theme }): string => {\n if (color && color === 'white') {\n return getIn(theme.colors, 'interactive.icon.staticWhite.subtle');\n }\n if (color && color !== 'neutral') {\n return getIn(theme.colors, `interactive.icon.${color}.subtle`);\n }\n return getIn(theme.colors, 'interactive.icon.gray.subtle');\n};\n\nconst _BaseSpinner = (\n {\n label,\n labelPosition = 'right',\n accessibilityLabel,\n color = 'neutral',\n size = 'medium',\n testID,\n ...styledProps\n }: BaseSpinnerProps,\n ref: React.Ref<BladeElementRef>,\n): React.ReactElement => {\n const { theme } = useTheme();\n return (\n <BaseBox\n ref={ref as never}\n {...metaAttribute({ name: MetaConstants.Spinner, testID })}\n {...getStyledProps(styledProps)}\n >\n <BaseBox\n display=\"flex\"\n alignItems=\"center\"\n flexDirection={labelPosition === 'right' ? 'row' : 'column'}\n {...makeAccessible({\n label: accessibilityLabel,\n role: 'progressbar',\n })}\n >\n <SpinningBox>\n <SpinnerIcon dimensions={makeSize(dimensions[size])} color={getColor({ color, theme })} />\n </SpinningBox>\n {label && label.trim().length > 0 ? (\n <BaseBox\n marginLeft={labelPosition === 'right' ? 'spacing.3' : 'spacing.0'}\n marginTop={labelPosition === 'bottom' ? 'spacing.3' : 'spacing.0'}\n >\n <Text variant=\"body\" weight=\"regular\" size=\"small\" color=\"surface.text.gray.muted\">\n {label}\n </Text>\n </BaseBox>\n ) : null}\n </BaseBox>\n </BaseBox>\n );\n};\n\nconst BaseSpinner = React.forwardRef(_BaseSpinner);\n\nexport type { BaseSpinnerProps };\nexport { BaseSpinner };\n"],"names":["getColor","_ref","color","theme","getIn","colors","_BaseSpinner","_ref2","ref","label","_ref2$labelPosition","labelPosition","accessibilityLabel","_ref2$color","_ref2$size","size","testID","styledProps","_objectWithoutProperties","_excluded","_useTheme","useTheme","_jsx","BaseBox","Object","assign","metaAttribute","name","MetaConstants","Spinner","getStyledProps","children","_jsxs","display","alignItems","flexDirection","makeAccessible","role","SpinningBox","SpinnerIcon","dimensions","makeSize","trim","length","marginLeft","marginTop","Text","variant","weight","BaseSpinner","React","forwardRef"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;qFAiDA,IAAMA,QAAQ,CAAG,SAAXA,QAAQA,CAAAC,IAAA,CAAqF,CAAA,IAA/EC,KAAK,CAAAD,IAAA,CAALC,KAAK,CAAEC,KAAK,CAAAF,IAAA,CAALE,KAAK,CAC9B,GAAID,KAAK,EAAIA,KAAK,GAAK,OAAO,CAAE,CAC9B,OAAOE,KAAK,CAACD,KAAK,CAACE,MAAM,CAAE,qCAAqC,CAAC,CACnE,CACA,GAAIH,KAAK,EAAIA,KAAK,GAAK,SAAS,CAAE,CAChC,OAAOE,KAAK,CAACD,KAAK,CAACE,MAAM,
|
|
1
|
+
{"version":3,"file":"BaseSpinner.js","sources":["../../../../../../src/components/Spinner/BaseSpinner/BaseSpinner.tsx"],"sourcesContent":["import React from 'react';\nimport { dimensions } from './spinnerTokens';\nimport SpinnerIcon from './SpinnerIcon';\nimport { SpinningBox } from './SpinningBox';\nimport getIn from '~utils/lodashButBetter/get';\nimport type { Theme } from '~components/BladeProvider';\nimport { useTheme } from '~components/BladeProvider';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport type { FeedbackColors } from '~tokens/theme/theme';\nimport BaseBox from '~components/Box/BaseBox';\nimport { Text } from '~components/Typography';\nimport type { BladeElementRef, TestID } from '~utils/types';\nimport { makeSize } from '~utils/makeSize';\nimport { makeAccessible } from '~utils/makeAccessible';\n\ntype BaseSpinnerProps = {\n /**\n * Sets the color of the spinner.\n *\n * @default 'default'\n */\n color?: 'primary' | 'white' | FeedbackColors;\n /**\n * Sets the label of the spinner.\n *\n * @default 'right'\n */\n label?: string;\n /**\n * Sets the label of the spinner.\n *\n */\n labelPosition?: 'right' | 'bottom';\n /**\n * Sets the size of the spinner.\n *\n * @default 'medium'\n */\n size?: 'medium' | 'large' | 'xlarge';\n /**\n * Sets the aria-label for web & accessibilityLabel react-native.\n *\n */\n accessibilityLabel: string;\n} & TestID &\n StyledPropsBlade;\n\nconst getColor = ({ color, theme }: { color: BaseSpinnerProps['color']; theme: Theme }): string => {\n if (color && color === 'white') {\n return getIn(theme.colors, 'interactive.icon.staticWhite.subtle');\n }\n if (color && color !== 'neutral') {\n return getIn(theme.colors, `interactive.icon.${color}.subtle`);\n }\n return getIn(theme.colors, 'interactive.icon.gray.subtle');\n};\n\nconst _BaseSpinner = (\n {\n label,\n labelPosition = 'right',\n accessibilityLabel,\n color = 'neutral',\n size = 'medium',\n testID,\n ...styledProps\n }: BaseSpinnerProps,\n ref: React.Ref<BladeElementRef>,\n): React.ReactElement => {\n const { theme } = useTheme();\n return (\n <BaseBox\n ref={ref as never}\n {...metaAttribute({ name: MetaConstants.Spinner, testID })}\n {...getStyledProps(styledProps)}\n >\n <BaseBox\n display=\"flex\"\n alignItems=\"center\"\n flexDirection={labelPosition === 'right' ? 'row' : 'column'}\n {...makeAccessible({\n label: accessibilityLabel,\n role: 'progressbar',\n })}\n >\n <SpinningBox>\n <SpinnerIcon dimensions={makeSize(dimensions[size])} color={getColor({ color, theme })} />\n </SpinningBox>\n {label && label.trim().length > 0 ? (\n <BaseBox\n marginLeft={labelPosition === 'right' ? 'spacing.3' : 'spacing.0'}\n marginTop={labelPosition === 'bottom' ? 'spacing.3' : 'spacing.0'}\n >\n <Text variant=\"body\" weight=\"regular\" size=\"small\" color=\"surface.text.gray.muted\">\n {label}\n </Text>\n </BaseBox>\n ) : null}\n </BaseBox>\n </BaseBox>\n );\n};\n\nconst BaseSpinner = React.forwardRef(_BaseSpinner);\n\nexport type { BaseSpinnerProps };\nexport { BaseSpinner };\n"],"names":["getColor","_ref","color","theme","getIn","colors","_BaseSpinner","_ref2","ref","label","_ref2$labelPosition","labelPosition","accessibilityLabel","_ref2$color","_ref2$size","size","testID","styledProps","_objectWithoutProperties","_excluded","_useTheme","useTheme","_jsx","BaseBox","Object","assign","metaAttribute","name","MetaConstants","Spinner","getStyledProps","children","_jsxs","display","alignItems","flexDirection","makeAccessible","role","SpinningBox","SpinnerIcon","dimensions","makeSize","trim","length","marginLeft","marginTop","Text","variant","weight","BaseSpinner","React","forwardRef"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;qFAiDA,IAAMA,QAAQ,CAAG,SAAXA,QAAQA,CAAAC,IAAA,CAAqF,CAAA,IAA/EC,KAAK,CAAAD,IAAA,CAALC,KAAK,CAAEC,KAAK,CAAAF,IAAA,CAALE,KAAK,CAC9B,GAAID,KAAK,EAAIA,KAAK,GAAK,OAAO,CAAE,CAC9B,OAAOE,KAAK,CAACD,KAAK,CAACE,MAAM,CAAE,qCAAqC,CAAC,CACnE,CACA,GAAIH,KAAK,EAAIA,KAAK,GAAK,SAAS,CAAE,CAChC,OAAOE,KAAK,CAACD,KAAK,CAACE,MAAM,CAAE,oBAAoBH,KAA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I,CAAE,aACR,CAAC,CAAC,CAAA,CAAAN,QAAA,CAEFT,CAAAA,GAAA,CAACgB,WAAW,CAAAP,CAAAA,QAAA,CACVT,GAAA,CAACiB,WAAW,CAAA,CAACC,UAAU,CAAEC,QAAQ,CAACD,UAAU,CAACzB,IAAI,CAAC,CAAE,CAACb,KAAK,CAAEF,QAAQ,CAAC,CAAEE,KAAK,CAALA,KAAK,CAAEC,KAAK,CAALA,KAAM,CAAC,CAAE,CAAE,CAAC,CAC/E,CAAC,CACbM,KAAK,EAAIA,KAAK,CAACiC,IAAI,EAAE,CAACC,MAAM,CAAG,CAAC,CAC/BrB,GAAA,CAACC,OAAO,CAAA,CACNqB,UAAU,CAAEjC,aAAa,GAAK,OAAO,CAAG,WAAW,CAAG,WAAY,CAClEkC,SAAS,CAAElC,aAAa,GAAK,QAAQ,CAAG,WAAW,CAAG,WAAY,CAAAoB,QAAA,CAElET,GAAA,CAACwB,IAAI,CAACC,CAAAA,OAAO,CAAC,MAAM,CAACC,MAAM,CAAC,SAAS,CAACjC,IAAI,CAAC,OAAO,CAACb,KAAK,CAAC,yBAAyB,CAAA6B,QAAA,CAC/EtB,KAAK,CACF,CAAC,CACA,CAAC,CACR,IAAI,GACD,CAAC,CAAA,CACH,CAAC,CAEd,CAAC,CAEK,IAAAwC,WAAW,CAAGC,cAAK,CAACC,UAAU,CAAC7C,YAAY;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpinningBox.native.js","sources":["../../../../../../src/components/Spinner/BaseSpinner/SpinningBox.native.tsx"],"sourcesContent":["import React from 'react';\nimport type { EasingFactoryFn } from 'react-native-reanimated';\nimport Animated, {\n withTiming,\n cancelAnimation,\n useAnimatedStyle,\n useSharedValue,\n withRepeat,\n} from 'react-native-reanimated';\nimport { motion as spinnerMotion } from './spinnerTokens';\nimport getIn from '~utils/lodashButBetter/get';\nimport { useTheme } from '~components/BladeProvider';\nimport { castNativeType } from '~utils';\nimport BaseBox from '~components/Box/BaseBox';\nimport { makeMotionTime } from '~utils/makeMotionTime';\n\nconst SpinningBox = ({ children }: { children: React.ReactNode }): React.ReactElement => {\n const { theme } = useTheme();\n const duration = castNativeType(makeMotionTime(getIn(theme.motion, spinnerMotion.duration)));\n const easing = getIn(theme.motion, spinnerMotion.easing) as EasingFactoryFn;\n\n const rotation = useSharedValue(0);\n const animatedStyles = useAnimatedStyle(() => {\n return {\n transform: [\n {\n rotateZ: `${rotation.value}deg`,\n },\n ],\n };\n }, [rotation.value]);\n\n React.useEffect(() => {\n rotation.value = withRepeat(\n withTiming(360, {\n duration,\n easing,\n }),\n -1,\n );\n return (): void => {\n cancelAnimation(rotation);\n };\n }, [duration, easing, rotation]);\n\n return (\n <BaseBox alignSelf=\"center\">\n <Animated.View style={animatedStyles}>{children}</Animated.View>\n </BaseBox>\n );\n};\n\nexport { SpinningBox };\n"],"names":["SpinningBox","_ref","children","_useTheme","useTheme","theme","duration","castNativeType","makeMotionTime","getIn","motion","spinnerMotion","easing","rotation","useSharedValue","animatedStyles","useAnimatedStyle","transform","rotateZ","value","React","useEffect","withRepeat","withTiming","cancelAnimation","_jsx","BaseBox","alignSelf","Animated","View","style"],"mappings":";;;;;;;;;;;;;;;;AAgBM,IAAAA,WAAW,CAAG,SAAdA,WAAWA,CAAAC,IAAA,CAAwE,CAAA,IAAlEC,QAAQ,CAAAD,IAAA,CAARC,QAAQ,CAC7B,IAAAC,SAAA,CAAkBC,QAAQ,EAAE,CAApBC,KAAK,CAAAF,SAAA,CAALE,KAAK,CACb,IAAMC,QAAQ,CAAGC,cAAc,CAACC,cAAc,CAACC,KAAK,CAACJ,KAAK,CAACK,MAAM,CAAEC,MAAa,CAACL,QAAQ,CAAC,CAAC,CAAC,CAC5F,IAAMM,MAAM,CAAGH,KAAK,CAACJ,KAAK,CAACK,MAAM,CAAEC,MAAa,CAACC,MAAM,CAAoB,CAE3E,IAAMC,QAAQ,CAAGC,cAAc,CAAC,CAAC,CAAC,CAClC,IAAMC,cAAc,CAAGC,gBAAgB,CAAC,UAAM,CAC5C,OAAO,CACLC,SAAS,CAAE,CACT,CACEC,OAAO,
|
|
1
|
+
{"version":3,"file":"SpinningBox.native.js","sources":["../../../../../../src/components/Spinner/BaseSpinner/SpinningBox.native.tsx"],"sourcesContent":["import React from 'react';\nimport type { EasingFactoryFn } from 'react-native-reanimated';\nimport Animated, {\n withTiming,\n cancelAnimation,\n useAnimatedStyle,\n useSharedValue,\n withRepeat,\n} from 'react-native-reanimated';\nimport { motion as spinnerMotion } from './spinnerTokens';\nimport getIn from '~utils/lodashButBetter/get';\nimport { useTheme } from '~components/BladeProvider';\nimport { castNativeType } from '~utils';\nimport BaseBox from '~components/Box/BaseBox';\nimport { makeMotionTime } from '~utils/makeMotionTime';\n\nconst SpinningBox = ({ children }: { children: React.ReactNode }): React.ReactElement => {\n const { theme } = useTheme();\n const duration = castNativeType(makeMotionTime(getIn(theme.motion, spinnerMotion.duration)));\n const easing = getIn(theme.motion, spinnerMotion.easing) as EasingFactoryFn;\n\n const rotation = useSharedValue(0);\n const animatedStyles = useAnimatedStyle(() => {\n return {\n transform: [\n {\n rotateZ: `${rotation.value}deg`,\n },\n ],\n };\n }, [rotation.value]);\n\n React.useEffect(() => {\n rotation.value = withRepeat(\n withTiming(360, {\n duration,\n easing,\n }),\n -1,\n );\n return (): void => {\n cancelAnimation(rotation);\n };\n }, [duration, easing, rotation]);\n\n return (\n <BaseBox alignSelf=\"center\">\n <Animated.View style={animatedStyles}>{children}</Animated.View>\n </BaseBox>\n );\n};\n\nexport { SpinningBox };\n"],"names":["SpinningBox","_ref","children","_useTheme","useTheme","theme","duration","castNativeType","makeMotionTime","getIn","motion","spinnerMotion","easing","rotation","useSharedValue","animatedStyles","useAnimatedStyle","transform","rotateZ","value","React","useEffect","withRepeat","withTiming","cancelAnimation","_jsx","BaseBox","alignSelf","Animated","View","style"],"mappings":";;;;;;;;;;;;;;;;AAgBM,IAAAA,WAAW,CAAG,SAAdA,WAAWA,CAAAC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ItemMarker.js","sources":["../../../../../src/components/StepGroup/StepItemMarker.tsx"],"sourcesContent":["import { useStepGroup } from './StepGroupContext';\nimport { getMarkerLineSpacings, iconSizeTokens } from './tokens';\nimport type { BaseBoxProps } from '~components/Box/BaseBox';\nimport BaseBox from '~components/Box/BaseBox';\nimport type { IconComponent } from '~components/Icons';\nimport type { IndicatorProps } from '~components/Indicator';\nimport { Indicator } from '~components/Indicator';\nimport { makeSize } from '~utils';\n\ntype MarkerBackgroundCircleProps = {\n color: IndicatorProps['color'];\n size: BaseBoxProps['width'];\n margin: BaseBoxProps['margin'];\n children: BaseBoxProps['children'];\n};\n\nconst MarkerBackgroundCircle = ({\n color,\n size,\n margin,\n children,\n}: MarkerBackgroundCircleProps): React.ReactElement => {\n return (\n <BaseBox\n backgroundColor={\n color === 'primary'\n ? 'surface.background.primary.subtle'\n : `feedback.background.${color}.subtle`\n }\n display=\"flex\"\n alignItems=\"center\"\n justifyContent=\"center\"\n height={size}\n width={size}\n borderRadius=\"round\"\n margin={margin}\n >\n {children}\n </BaseBox>\n );\n};\n\nconst StepItemIndicator = ({ color }: { color: IndicatorProps['color'] }): React.ReactElement => {\n const { size } = useStepGroup();\n const spacingTokens = getMarkerLineSpacings(size);\n\n return (\n <MarkerBackgroundCircle\n color={color}\n size={makeSize(spacingTokens.markerBackgroundSize)}\n margin={makeSize(spacingTokens.markerMargin)}\n >\n <Indicator\n position=\"relative\"\n color={color}\n size={size}\n accessibilityLabel={`${color} indicator`}\n />\n </MarkerBackgroundCircle>\n );\n};\n\ntype StepItemIconProps = {\n icon: IconComponent;\n color: IndicatorProps['color'];\n isDisabled?: boolean;\n};\n\nconst StepItemIcon = ({\n icon: Icon,\n color = 'neutral',\n isDisabled = false,\n}: StepItemIconProps): React.ReactElement => {\n const { size } = useStepGroup();\n const spacingTokens = getMarkerLineSpacings(size);\n\n return (\n <MarkerBackgroundCircle\n color={color}\n size={makeSize(spacingTokens.markerBackgroundSize)}\n margin={makeSize(spacingTokens.markerMargin)}\n >\n <Icon\n size={iconSizeTokens[size]}\n color={\n isDisabled\n ? 'surface.icon.gray.disabled'\n : color === 'primary'\n ? 'surface.icon.primary.normal'\n : `feedback.icon.${color}.intense`\n }\n />\n </MarkerBackgroundCircle>\n );\n};\n\nexport { StepItemIndicator, StepItemIcon };\n"],"names":["MarkerBackgroundCircle","_ref","color","size","margin","children","_jsx","BaseBox","backgroundColor","display","alignItems","justifyContent","height","width","borderRadius","StepItemIndicator","_ref2","_useStepGroup","useStepGroup","spacingTokens","getMarkerLineSpacings","makeSize","markerBackgroundSize","markerMargin","Indicator","position","accessibilityLabel","StepItemIcon","_ref3","Icon","icon","_ref3$color","_ref3$isDisabled","isDisabled","_useStepGroup2","iconSizeTokens"],"mappings":";;;;;;;;;;;AAgBA,IAAMA,sBAAsB,CAAG,SAAzBA,sBAAsBA,CAAAC,IAAA,CAK2B,KAJrDC,KAAK,CAAAD,IAAA,CAALC,KAAK,CACLC,IAAI,CAAAF,IAAA,CAAJE,IAAI,CACJC,MAAM,CAAAH,IAAA,CAANG,MAAM,CACNC,QAAQ,CAAAJ,IAAA,CAARI,QAAQ,CAER,OACEC,GAAA,CAACC,OAAO,CACNC,CAAAA,eAAe,CACbN,KAAK,GAAK,SAAS,CACf,mCAAmC,
|
|
1
|
+
{"version":3,"file":"StepItemMarker.js","sources":["../../../../../src/components/StepGroup/StepItemMarker.tsx"],"sourcesContent":["import { useStepGroup } from './StepGroupContext';\nimport { getMarkerLineSpacings, iconSizeTokens } from './tokens';\nimport type { BaseBoxProps } from '~components/Box/BaseBox';\nimport BaseBox from '~components/Box/BaseBox';\nimport type { IconComponent } from '~components/Icons';\nimport type { IndicatorProps } from '~components/Indicator';\nimport { Indicator } from '~components/Indicator';\nimport { makeSize } from '~utils';\n\ntype MarkerBackgroundCircleProps = {\n color: IndicatorProps['color'];\n size: BaseBoxProps['width'];\n margin: BaseBoxProps['margin'];\n children: BaseBoxProps['children'];\n};\n\nconst MarkerBackgroundCircle = ({\n color,\n size,\n margin,\n children,\n}: MarkerBackgroundCircleProps): React.ReactElement => {\n return (\n <BaseBox\n backgroundColor={\n color === 'primary'\n ? 'surface.background.primary.subtle'\n : `feedback.background.${color}.subtle`\n }\n display=\"flex\"\n alignItems=\"center\"\n justifyContent=\"center\"\n height={size}\n width={size}\n borderRadius=\"round\"\n margin={margin}\n >\n {children}\n </BaseBox>\n );\n};\n\nconst StepItemIndicator = ({ color }: { color: IndicatorProps['color'] }): React.ReactElement => {\n const { size } = useStepGroup();\n const spacingTokens = getMarkerLineSpacings(size);\n\n return (\n <MarkerBackgroundCircle\n color={color}\n size={makeSize(spacingTokens.markerBackgroundSize)}\n margin={makeSize(spacingTokens.markerMargin)}\n >\n <Indicator\n position=\"relative\"\n color={color}\n size={size}\n accessibilityLabel={`${color} indicator`}\n />\n </MarkerBackgroundCircle>\n );\n};\n\ntype StepItemIconProps = {\n icon: IconComponent;\n color: IndicatorProps['color'];\n isDisabled?: boolean;\n};\n\nconst StepItemIcon = ({\n icon: Icon,\n color = 'neutral',\n isDisabled = false,\n}: StepItemIconProps): React.ReactElement => {\n const { size } = useStepGroup();\n const spacingTokens = getMarkerLineSpacings(size);\n\n return (\n <MarkerBackgroundCircle\n color={color}\n size={makeSize(spacingTokens.markerBackgroundSize)}\n margin={makeSize(spacingTokens.markerMargin)}\n >\n <Icon\n size={iconSizeTokens[size]}\n color={\n isDisabled\n ? 'surface.icon.gray.disabled'\n : color === 'primary'\n ? 'surface.icon.primary.normal'\n : `feedback.icon.${color}.intense`\n }\n />\n </MarkerBackgroundCircle>\n );\n};\n\nexport { StepItemIndicator, StepItemIcon };\n"],"names":["MarkerBackgroundCircle","_ref","color","size","margin","children","_jsx","BaseBox","backgroundColor","display","alignItems","justifyContent","height","width","borderRadius","StepItemIndicator","_ref2","_useStepGroup","useStepGroup","spacingTokens","getMarkerLineSpacings","makeSize","markerBackgroundSize","markerMargin","Indicator","position","accessibilityLabel","StepItemIcon","_ref3","Icon","icon","_ref3$color","_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