@razorpay/blade 12.110.0 → 12.119.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/spark/colorama-center-gradient-map-dark.jpg +0 -0
- package/assets/spark/colorama-gradient-map-dark.png +0 -0
- package/build/lib/native/components/AnimateInteractions/AnimateInteractions.native.js +5 -5
- package/build/lib/native/components/AnimateInteractions/AnimateInteractions.native.js.map +1 -1
- package/build/lib/native/components/AnimateInteractions/AnimateInteractionsProvider.js +6 -0
- package/build/lib/native/components/AnimateInteractions/AnimateInteractionsProvider.js.map +1 -0
- package/build/lib/native/components/BaseMotion/BaseMotion.native.js +22 -0
- package/build/lib/native/components/BaseMotion/BaseMotion.native.js.map +1 -0
- package/build/lib/native/components/BaseMotion/baseMotionInterpreter.native.js +11 -0
- package/build/lib/native/components/BaseMotion/baseMotionInterpreter.native.js.map +1 -0
- package/build/lib/native/components/BaseMotion/baseMotionUtils.js +4 -0
- package/build/lib/native/components/BaseMotion/baseMotionUtils.js.map +1 -0
- package/build/lib/native/components/BaseMotion/index.js +3 -0
- package/build/lib/native/components/BaseMotion/index.js.map +1 -0
- package/build/lib/native/components/BaseMotion/types.js +2 -0
- package/build/lib/native/components/BaseMotion/types.js.map +1 -0
- package/build/lib/native/components/Button/BaseButton/BaseButton.js +3 -3
- package/build/lib/native/components/Button/BaseButton/BaseButton.js.map +1 -1
- package/build/lib/native/components/Button/BaseButton/buttonTokens.js +1 -1
- package/build/lib/native/components/Button/BaseButton/buttonTokens.js.map +1 -1
- package/build/lib/native/components/Charts/AreaChart/AreaChart.native.js +2 -1
- package/build/lib/native/components/Charts/AreaChart/AreaChart.native.js.map +1 -1
- package/build/lib/native/components/Charts/CommonChartComponents/CommonChartComponents.native.js +2 -2
- package/build/lib/native/components/Charts/CommonChartComponents/CommonChartComponents.native.js.map +1 -1
- package/build/lib/native/components/Charts/CommonChartComponents/index.js +1 -1
- package/build/lib/native/components/Charts/CommonChartComponents/tokens.js +2 -2
- package/build/lib/native/components/Charts/CommonChartComponents/tokens.js.map +1 -1
- package/build/lib/native/components/Charts/LineChart/LineChart.native.js +4 -2
- package/build/lib/native/components/Charts/LineChart/LineChart.native.js.map +1 -1
- package/build/lib/native/components/Charts/utils/nullBridgeUtils.js +4 -0
- package/build/lib/native/components/Charts/utils/nullBridgeUtils.js.map +1 -0
- package/build/lib/native/components/Charts/utils/referenceBandUtils.js +6 -0
- package/build/lib/native/components/Charts/utils/referenceBandUtils.js.map +1 -0
- package/build/lib/native/components/CounterInput/CounterInput.native.js +3 -2
- package/build/lib/native/components/CounterInput/CounterInput.native.js.map +1 -1
- package/build/lib/native/components/CounterInput/token.js +2 -2
- package/build/lib/native/components/CounterInput/token.js.map +1 -1
- package/build/lib/native/components/DatePicker/Calendar.native.js +2 -2
- package/build/lib/native/components/DatePicker/Calendar.native.js.map +1 -1
- package/build/lib/native/components/DatePicker/utils.js +2 -2
- package/build/lib/native/components/DatePicker/utils.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/FilterChipSelectInput.native.js +2 -1
- package/build/lib/native/components/Dropdown/FilterChipSelectInput.native.js.map +1 -1
- package/build/lib/native/components/Dropdown/dropdownUtils.js +1 -1
- package/build/lib/native/components/Dropdown/dropdownUtils.js.map +1 -1
- package/build/lib/native/components/Dropdown/filterChipSelectInputUtils.js +4 -0
- package/build/lib/native/components/Dropdown/filterChipSelectInputUtils.js.map +1 -0
- package/build/lib/native/components/Dropdown/useDropdown.js +1 -1
- package/build/lib/native/components/Dropdown/useDropdown.js.map +1 -1
- package/build/lib/native/components/Fade/Fade.native.js +7 -5
- package/build/lib/native/components/Fade/Fade.native.js.map +1 -1
- package/build/lib/native/components/FilterChip/BaseFilterChip.native.js +2 -2
- package/build/lib/native/components/FilterChip/BaseFilterChip.native.js.map +1 -1
- package/build/lib/native/components/FloatingActionButton/FloatingActionButton.js +14 -0
- package/build/lib/native/components/FloatingActionButton/FloatingActionButton.js.map +1 -0
- package/build/lib/native/components/FloatingActionButton/FloatingActionButtonContainer.native.js +20 -0
- package/build/lib/native/components/FloatingActionButton/FloatingActionButtonContainer.native.js.map +1 -0
- package/build/lib/native/components/FloatingActionButton/index.js +2 -0
- package/build/lib/native/components/FloatingActionButton/index.js.map +1 -0
- package/build/lib/native/components/GenUI/GenUIContext.native.js +2 -2
- package/build/lib/native/components/GenUI/GenUIContext.native.js.map +1 -1
- package/build/lib/native/components/GenUI/index.js +1 -1
- package/build/lib/native/components/Icons/BookmarkFilledIcon/BookmarkFilledIcon.js +14 -0
- package/build/lib/native/components/Icons/BookmarkFilledIcon/BookmarkFilledIcon.js.map +1 -0
- package/build/lib/native/components/Icons/BookmarkFilledIcon/index.js +2 -0
- package/build/lib/native/components/Icons/BookmarkFilledIcon/index.js.map +1 -0
- package/build/lib/native/components/Icons/index.js +1 -0
- package/build/lib/native/components/Icons/index.js.map +1 -1
- package/build/lib/native/components/Input/BaseInput/StyledBaseInput.native.js +1 -1
- package/build/lib/native/components/Input/BaseInput/StyledBaseInput.native.js.map +1 -1
- package/build/lib/native/components/Input/OTPInput/OTPInput.js +1 -1
- package/build/lib/native/components/Input/OTPInput/OTPInput.js.map +1 -1
- package/build/lib/native/components/Morph/Morph.native.js +9 -5
- package/build/lib/native/components/Morph/Morph.native.js.map +1 -1
- package/build/lib/native/components/Move/Move.native.js +8 -5
- package/build/lib/native/components/Move/Move.native.js.map +1 -1
- package/build/lib/native/components/Scale/Scale.native.js +7 -5
- package/build/lib/native/components/Scale/Scale.native.js.map +1 -1
- package/build/lib/native/components/SegmentedControl/SegmentedControl.native.js +27 -0
- package/build/lib/native/components/SegmentedControl/SegmentedControl.native.js.map +1 -0
- package/build/lib/native/components/SegmentedControl/SegmentedControlContext.js +8 -0
- package/build/lib/native/components/SegmentedControl/SegmentedControlContext.js.map +1 -0
- package/build/lib/native/components/SegmentedControl/SegmentedControlItem.native.js +18 -0
- package/build/lib/native/components/SegmentedControl/SegmentedControlItem.native.js.map +1 -0
- package/build/lib/native/components/SegmentedControl/index.js +3 -0
- package/build/lib/native/components/SegmentedControl/index.js.map +1 -0
- package/build/lib/native/components/SegmentedControl/segmentedControlTokens.js +4 -0
- package/build/lib/native/components/SegmentedControl/segmentedControlTokens.js.map +1 -0
- package/build/lib/native/components/Slide/Slide.native.js +7 -5
- package/build/lib/native/components/Slide/Slide.native.js.map +1 -1
- package/build/lib/native/components/Spark/RzpGlass/utils.native.js +1 -1
- package/build/lib/native/components/Spark/RzpGlass/utils.native.js.map +1 -1
- package/build/lib/native/components/Stagger/Stagger.native.js +10 -5
- package/build/lib/native/components/Stagger/Stagger.native.js.map +1 -1
- package/build/lib/native/components/Stagger/StaggerProvider.js +6 -0
- package/build/lib/native/components/Stagger/StaggerProvider.js.map +1 -0
- package/build/lib/native/components/TreeView/TreeView.native.js +4 -0
- package/build/lib/native/components/TreeView/TreeView.native.js.map +1 -0
- package/build/lib/native/components/TreeView/index.native.js +2 -0
- package/build/lib/native/components/TreeView/index.native.js.map +1 -0
- package/build/lib/native/components/index.js +10 -2
- package/build/lib/native/components/index.js.map +1 -1
- package/build/lib/native/tokens/global/colors.js +1 -1
- package/build/lib/native/tokens/global/colors.js.map +1 -1
- package/build/lib/native/tokens/index.js +1 -0
- package/build/lib/native/tokens/index.js.map +1 -1
- package/build/lib/native/tokens/theme/bladeNeutralTheme.js +15 -0
- package/build/lib/native/tokens/theme/bladeNeutralTheme.js.map +1 -0
- package/build/lib/native/tokens/theme/bladeTheme.js +1 -1
- package/build/lib/native/tokens/theme/bladeTheme.js.map +1 -1
- package/build/lib/native/tokens/theme/index.js +1 -0
- package/build/lib/native/tokens/theme/index.js.map +1 -1
- package/build/lib/native/tokens/theme/theme.js.map +1 -1
- package/build/lib/native/utils/componentZIndices.js +1 -1
- package/build/lib/native/utils/componentZIndices.js.map +1 -1
- package/build/lib/native/utils/metaAttribute/metaConstants.js +1 -1
- package/build/lib/native/utils/metaAttribute/metaConstants.js.map +1 -1
- package/build/lib/native/utils/msToSeconds.js +4 -0
- package/build/lib/native/utils/msToSeconds.js.map +1 -0
- package/build/lib/native/utils/useControlledDropdownInput/useControlledDropdownInput.js +1 -1
- package/build/lib/native/utils/useControlledDropdownInput/useControlledDropdownInput.js.map +1 -1
- package/build/lib/web/development/_virtual/flatten.js +1 -1
- package/build/lib/web/development/_virtual/flatten3.js +1 -1
- package/build/lib/web/development/components/AnimateInteractions/AnimateInteractions.web.js +1 -1
- package/build/lib/web/development/components/AnimateInteractions/AnimateInteractionsProvider.js +2 -1
- package/build/lib/web/development/components/AnimateInteractions/AnimateInteractionsProvider.js.map +1 -1
- package/build/lib/web/development/components/AnimateInteractions/{useFocusWithin.js → useFocusWithin.web.js} +1 -1
- package/build/lib/web/development/components/AnimateInteractions/useFocusWithin.web.js.map +1 -0
- package/build/lib/web/development/components/Button/BaseButton/BaseButton.js +124 -73
- package/build/lib/web/development/components/Button/BaseButton/BaseButton.js.map +1 -1
- package/build/lib/web/development/components/Button/BaseButton/buttonTokens.js +68 -2
- package/build/lib/web/development/components/Button/BaseButton/buttonTokens.js.map +1 -1
- package/build/lib/web/development/components/Charts/AreaChart/AreaChart.web.js +206 -18
- package/build/lib/web/development/components/Charts/AreaChart/AreaChart.web.js.map +1 -1
- package/build/lib/web/development/components/Charts/CommonChartComponents/CommonChartComponents.web.js +159 -43
- package/build/lib/web/development/components/Charts/CommonChartComponents/CommonChartComponents.web.js.map +1 -1
- package/build/lib/web/development/components/Charts/CommonChartComponents/index.js +1 -1
- package/build/lib/web/development/components/Charts/CommonChartComponents/tokens.js +15 -2
- package/build/lib/web/development/components/Charts/CommonChartComponents/tokens.js.map +1 -1
- package/build/lib/web/development/components/Charts/LineChart/LineChart.web.js +272 -15
- package/build/lib/web/development/components/Charts/LineChart/LineChart.web.js.map +1 -1
- package/build/lib/web/development/components/Charts/LineChart/useReferenceBand.js +195 -0
- package/build/lib/web/development/components/Charts/LineChart/useReferenceBand.js.map +1 -0
- package/build/lib/web/development/components/Charts/utils/nullBridgeUtils.js +175 -0
- package/build/lib/web/development/components/Charts/utils/nullBridgeUtils.js.map +1 -0
- package/build/lib/web/development/components/Charts/utils/referenceBandUtils.js +66 -0
- package/build/lib/web/development/components/Charts/utils/referenceBandUtils.js.map +1 -0
- package/build/lib/web/development/components/CounterInput/CounterInput.web.js +29 -5
- package/build/lib/web/development/components/CounterInput/CounterInput.web.js.map +1 -1
- package/build/lib/web/development/components/CounterInput/StyledCounterInput.js +20 -4
- package/build/lib/web/development/components/CounterInput/StyledCounterInput.js.map +1 -1
- package/build/lib/web/development/components/CounterInput/token.js +6 -1
- package/build/lib/web/development/components/CounterInput/token.js.map +1 -1
- package/build/lib/web/development/components/DatePicker/BaseDatePicker.web.js +28 -1
- package/build/lib/web/development/components/DatePicker/BaseDatePicker.web.js.map +1 -1
- package/build/lib/web/development/components/DatePicker/Calendar.web.js +9 -2
- package/build/lib/web/development/components/DatePicker/Calendar.web.js.map +1 -1
- package/build/lib/web/development/components/DatePicker/FilterChipDatePicker/DatePickerFilterChip.web.js +4 -1
- package/build/lib/web/development/components/DatePicker/FilterChipDatePicker/DatePickerFilterChip.web.js.map +1 -1
- package/build/lib/web/development/components/DatePicker/utils.js +21 -1
- package/build/lib/web/development/components/DatePicker/utils.js.map +1 -1
- package/build/lib/web/development/components/Dropdown/Dropdown.js +4 -1
- package/build/lib/web/development/components/Dropdown/Dropdown.js.map +1 -1
- package/build/lib/web/development/components/Dropdown/FilterChipGroup.web.js +40 -5
- package/build/lib/web/development/components/Dropdown/FilterChipGroup.web.js.map +1 -1
- package/build/lib/web/development/components/Dropdown/FilterChipSelectInput.web.js +30 -32
- package/build/lib/web/development/components/Dropdown/FilterChipSelectInput.web.js.map +1 -1
- package/build/lib/web/development/components/Dropdown/dropdownUtils.js +28 -2
- package/build/lib/web/development/components/Dropdown/dropdownUtils.js.map +1 -1
- package/build/lib/web/development/components/Dropdown/filterChipSelectInputUtils.js +60 -0
- package/build/lib/web/development/components/Dropdown/filterChipSelectInputUtils.js.map +1 -0
- package/build/lib/web/development/components/Dropdown/useDropdown.js +91 -5
- package/build/lib/web/development/components/Dropdown/useDropdown.js.map +1 -1
- package/build/lib/web/development/components/FilterChip/BaseFilterChip.web.js +35 -11
- package/build/lib/web/development/components/FilterChip/BaseFilterChip.web.js.map +1 -1
- package/build/lib/web/development/components/FloatingActionButton/FloatingActionButton.js +126 -0
- package/build/lib/web/development/components/FloatingActionButton/FloatingActionButton.js.map +1 -0
- package/build/lib/web/development/components/FloatingActionButton/FloatingActionButtonContainer.web.js +45 -0
- package/build/lib/web/development/components/FloatingActionButton/FloatingActionButtonContainer.web.js.map +1 -0
- package/build/lib/web/development/components/FloatingActionButton/index.js +2 -0
- package/build/lib/web/development/components/FloatingActionButton/index.js.map +1 -0
- package/build/lib/web/development/components/GenUI/GenUIComponents.web.js.map +1 -1
- package/build/lib/web/development/components/GenUI/GenUIContext.web.js +9 -1
- package/build/lib/web/development/components/GenUI/GenUIContext.web.js.map +1 -1
- package/build/lib/web/development/components/GenUI/GenUIProvider.web.js +17 -0
- package/build/lib/web/development/components/GenUI/GenUIProvider.web.js.map +1 -1
- package/build/lib/web/development/components/GenUI/GenUISchemaRenderer.web.js +31 -6
- package/build/lib/web/development/components/GenUI/GenUISchemaRenderer.web.js.map +1 -1
- package/build/lib/web/development/components/GenUI/index.js +1 -1
- package/build/lib/web/development/components/Icons/BookmarkFilledIcon/BookmarkFilledIcon.js +44 -0
- package/build/lib/web/development/components/Icons/BookmarkFilledIcon/BookmarkFilledIcon.js.map +1 -0
- package/build/lib/web/development/components/Icons/BookmarkFilledIcon/index.js +2 -0
- package/build/lib/web/development/components/Icons/BookmarkFilledIcon/index.js.map +1 -0
- package/build/lib/web/development/components/Icons/index.js +1 -0
- package/build/lib/web/development/components/Icons/index.js.map +1 -1
- package/build/lib/web/development/components/Input/OTPInput/OTPInput.js +3 -0
- package/build/lib/web/development/components/Input/OTPInput/OTPInput.js.map +1 -1
- package/build/lib/web/development/components/PopupArrow/PopupArrow.web.js +7 -1
- package/build/lib/web/development/components/PopupArrow/PopupArrow.web.js.map +1 -1
- package/build/lib/web/development/components/RollingText/RollingText.web.js +27 -20
- package/build/lib/web/development/components/RollingText/RollingText.web.js.map +1 -1
- package/build/lib/web/development/components/SegmentedControl/SegmentedControl.web.js +196 -0
- package/build/lib/web/development/components/SegmentedControl/SegmentedControl.web.js.map +1 -0
- package/build/lib/web/development/components/SegmentedControl/SegmentedControlContext.js +18 -0
- package/build/lib/web/development/components/SegmentedControl/SegmentedControlContext.js.map +1 -0
- package/build/lib/web/development/components/SegmentedControl/SegmentedControlIndicator.web.js +109 -0
- package/build/lib/web/development/components/SegmentedControl/SegmentedControlIndicator.web.js.map +1 -0
- package/build/lib/web/development/components/SegmentedControl/SegmentedControlItem.web.js +170 -0
- package/build/lib/web/development/components/SegmentedControl/SegmentedControlItem.web.js.map +1 -0
- package/build/lib/web/development/components/SegmentedControl/index.js +3 -0
- package/build/lib/web/development/components/SegmentedControl/index.js.map +1 -0
- package/build/lib/web/development/components/SegmentedControl/segmentedControlTokens.js +53 -0
- package/build/lib/web/development/components/SegmentedControl/segmentedControlTokens.js.map +1 -0
- package/build/lib/web/development/components/Spark/RzpGlass/RzpGlass.js +16 -7
- package/build/lib/web/development/components/Spark/RzpGlass/RzpGlass.js.map +1 -1
- package/build/lib/web/development/components/Spark/RzpGlass/RzpGlassMount.js +24 -6
- package/build/lib/web/development/components/Spark/RzpGlass/RzpGlassMount.js.map +1 -1
- package/build/lib/web/development/components/Spark/RzpGlass/presets.js +30 -1
- package/build/lib/web/development/components/Spark/RzpGlass/presets.js.map +1 -1
- package/build/lib/web/development/components/Spark/RzpGlass/rzpGlassShader.js +1 -1
- package/build/lib/web/development/components/Spark/RzpGlass/rzpGlassShader.js.map +1 -1
- package/build/lib/web/development/components/Spark/RzpGlass/utils.js +26 -10
- package/build/lib/web/development/components/Spark/RzpGlass/utils.js.map +1 -1
- package/build/lib/web/development/components/SpotlightPopoverTour/Tour.web.js +31 -18
- package/build/lib/web/development/components/SpotlightPopoverTour/Tour.web.js.map +1 -1
- package/build/lib/web/development/components/SpotlightPopoverTour/TourMask.web.js +14 -3
- package/build/lib/web/development/components/SpotlightPopoverTour/TourMask.web.js.map +1 -1
- package/build/lib/web/development/components/SpotlightPopoverTour/TourPopover.web.js +23 -4
- package/build/lib/web/development/components/SpotlightPopoverTour/TourPopover.web.js.map +1 -1
- package/build/lib/web/development/components/SpotlightPopoverTour/utils.js +58 -1
- package/build/lib/web/development/components/SpotlightPopoverTour/utils.js.map +1 -1
- package/build/lib/web/development/components/Stagger/StaggerProvider.js.map +1 -1
- package/build/lib/web/development/components/TreeView/StyledTreeViewRow.web.js +41 -0
- package/build/lib/web/development/components/TreeView/StyledTreeViewRow.web.js.map +1 -0
- package/build/lib/web/development/components/TreeView/TreeView.web.js +696 -0
- package/build/lib/web/development/components/TreeView/TreeView.web.js.map +1 -0
- package/build/lib/web/development/components/TreeView/TreeViewAnimator.web.js +184 -0
- package/build/lib/web/development/components/TreeView/TreeViewAnimator.web.js.map +1 -0
- package/build/lib/web/development/components/TreeView/TreeViewChevron.web.js +73 -0
- package/build/lib/web/development/components/TreeView/TreeViewChevron.web.js.map +1 -0
- package/build/lib/web/development/components/TreeView/TreeViewItem.web.js +295 -0
- package/build/lib/web/development/components/TreeView/TreeViewItem.web.js.map +1 -0
- package/build/lib/web/development/components/TreeView/TreeViewLoadMore.web.js +173 -0
- package/build/lib/web/development/components/TreeView/TreeViewLoadMore.web.js.map +1 -0
- package/build/lib/web/development/components/TreeView/componentIds.js +8 -0
- package/build/lib/web/development/components/TreeView/componentIds.js.map +1 -0
- package/build/lib/web/development/components/TreeView/index.web.js +4 -0
- package/build/lib/web/development/components/TreeView/index.web.js.map +1 -0
- package/build/lib/web/development/components/TreeView/treeViewUtils.js +475 -0
- package/build/lib/web/development/components/TreeView/treeViewUtils.js.map +1 -0
- package/build/lib/web/development/components/TreeView/useTreeView.js +24 -0
- package/build/lib/web/development/components/TreeView/useTreeView.js.map +1 -0
- package/build/lib/web/development/components/index.js +12 -2
- package/build/lib/web/development/components/index.js.map +1 -1
- package/build/lib/web/development/node_modules/es-toolkit/dist/array/flatten.js +1 -1
- package/build/lib/web/development/node_modules/es-toolkit/dist/compat/array/flatten.js +1 -1
- package/build/lib/web/development/node_modules/es-toolkit/dist/compat/array/sortBy.js +2 -2
- package/build/lib/web/development/node_modules/es-toolkit/dist/compat/object/omit.js +2 -2
- package/build/lib/web/development/tokens/global/colors.js +2 -2
- package/build/lib/web/development/tokens/global/colors.js.map +1 -1
- package/build/lib/web/development/tokens/index.js +1 -0
- package/build/lib/web/development/tokens/index.js.map +1 -1
- package/build/lib/web/development/tokens/theme/bladeNeutralTheme.js +1439 -0
- package/build/lib/web/development/tokens/theme/bladeNeutralTheme.js.map +1 -0
- package/build/lib/web/development/tokens/theme/bladeTheme.js +48 -12
- package/build/lib/web/development/tokens/theme/bladeTheme.js.map +1 -1
- package/build/lib/web/development/tokens/theme/index.js +1 -0
- package/build/lib/web/development/tokens/theme/index.js.map +1 -1
- package/build/lib/web/development/tokens/theme/theme.js.map +1 -1
- package/build/lib/web/development/utils/componentZIndices.js +2 -0
- package/build/lib/web/development/utils/componentZIndices.js.map +1 -1
- package/build/lib/web/development/utils/metaAttribute/metaConstants.js +7 -1
- package/build/lib/web/development/utils/metaAttribute/metaConstants.js.map +1 -1
- package/build/lib/web/development/utils/useControlledDropdownInput/useControlledDropdownInput.js +12 -4
- package/build/lib/web/development/utils/useControlledDropdownInput/useControlledDropdownInput.js.map +1 -1
- package/build/lib/web/development/utils/useTruncationTitle/useTruncationTitle.web.js +2 -2
- package/build/lib/web/development/utils/useTruncationTitle/useTruncationTitle.web.js.map +1 -1
- package/build/lib/web/production/_virtual/flatten.js +1 -1
- package/build/lib/web/production/_virtual/flatten3.js +1 -1
- package/build/lib/web/production/components/AnimateInteractions/AnimateInteractions.web.js +1 -1
- package/build/lib/web/production/components/AnimateInteractions/AnimateInteractionsProvider.js +2 -1
- package/build/lib/web/production/components/AnimateInteractions/AnimateInteractionsProvider.js.map +1 -1
- package/build/lib/web/production/components/AnimateInteractions/{useFocusWithin.js → useFocusWithin.web.js} +1 -1
- package/build/lib/web/production/components/AnimateInteractions/useFocusWithin.web.js.map +1 -0
- package/build/lib/web/production/components/Button/BaseButton/BaseButton.js +124 -73
- package/build/lib/web/production/components/Button/BaseButton/BaseButton.js.map +1 -1
- package/build/lib/web/production/components/Button/BaseButton/buttonTokens.js +68 -2
- package/build/lib/web/production/components/Button/BaseButton/buttonTokens.js.map +1 -1
- package/build/lib/web/production/components/Charts/AreaChart/AreaChart.web.js +206 -18
- package/build/lib/web/production/components/Charts/AreaChart/AreaChart.web.js.map +1 -1
- package/build/lib/web/production/components/Charts/CommonChartComponents/CommonChartComponents.web.js +159 -43
- package/build/lib/web/production/components/Charts/CommonChartComponents/CommonChartComponents.web.js.map +1 -1
- package/build/lib/web/production/components/Charts/CommonChartComponents/index.js +1 -1
- package/build/lib/web/production/components/Charts/CommonChartComponents/tokens.js +15 -2
- package/build/lib/web/production/components/Charts/CommonChartComponents/tokens.js.map +1 -1
- package/build/lib/web/production/components/Charts/LineChart/LineChart.web.js +272 -15
- package/build/lib/web/production/components/Charts/LineChart/LineChart.web.js.map +1 -1
- package/build/lib/web/production/components/Charts/LineChart/useReferenceBand.js +195 -0
- package/build/lib/web/production/components/Charts/LineChart/useReferenceBand.js.map +1 -0
- package/build/lib/web/production/components/Charts/utils/nullBridgeUtils.js +175 -0
- package/build/lib/web/production/components/Charts/utils/nullBridgeUtils.js.map +1 -0
- package/build/lib/web/production/components/Charts/utils/referenceBandUtils.js +66 -0
- package/build/lib/web/production/components/Charts/utils/referenceBandUtils.js.map +1 -0
- package/build/lib/web/production/components/CounterInput/CounterInput.web.js +29 -5
- package/build/lib/web/production/components/CounterInput/CounterInput.web.js.map +1 -1
- package/build/lib/web/production/components/CounterInput/StyledCounterInput.js +20 -4
- package/build/lib/web/production/components/CounterInput/StyledCounterInput.js.map +1 -1
- package/build/lib/web/production/components/CounterInput/token.js +6 -1
- package/build/lib/web/production/components/CounterInput/token.js.map +1 -1
- package/build/lib/web/production/components/DatePicker/BaseDatePicker.web.js +28 -1
- package/build/lib/web/production/components/DatePicker/BaseDatePicker.web.js.map +1 -1
- package/build/lib/web/production/components/DatePicker/Calendar.web.js +9 -2
- package/build/lib/web/production/components/DatePicker/Calendar.web.js.map +1 -1
- package/build/lib/web/production/components/DatePicker/FilterChipDatePicker/DatePickerFilterChip.web.js +4 -1
- package/build/lib/web/production/components/DatePicker/FilterChipDatePicker/DatePickerFilterChip.web.js.map +1 -1
- package/build/lib/web/production/components/DatePicker/utils.js +21 -1
- package/build/lib/web/production/components/DatePicker/utils.js.map +1 -1
- package/build/lib/web/production/components/Dropdown/Dropdown.js +4 -1
- package/build/lib/web/production/components/Dropdown/Dropdown.js.map +1 -1
- package/build/lib/web/production/components/Dropdown/FilterChipGroup.web.js +40 -5
- package/build/lib/web/production/components/Dropdown/FilterChipGroup.web.js.map +1 -1
- package/build/lib/web/production/components/Dropdown/FilterChipSelectInput.web.js +30 -32
- package/build/lib/web/production/components/Dropdown/FilterChipSelectInput.web.js.map +1 -1
- package/build/lib/web/production/components/Dropdown/dropdownUtils.js +28 -2
- package/build/lib/web/production/components/Dropdown/dropdownUtils.js.map +1 -1
- package/build/lib/web/production/components/Dropdown/filterChipSelectInputUtils.js +60 -0
- package/build/lib/web/production/components/Dropdown/filterChipSelectInputUtils.js.map +1 -0
- package/build/lib/web/production/components/Dropdown/useDropdown.js +91 -5
- package/build/lib/web/production/components/Dropdown/useDropdown.js.map +1 -1
- package/build/lib/web/production/components/FilterChip/BaseFilterChip.web.js +35 -11
- package/build/lib/web/production/components/FilterChip/BaseFilterChip.web.js.map +1 -1
- package/build/lib/web/production/components/FloatingActionButton/FloatingActionButton.js +126 -0
- package/build/lib/web/production/components/FloatingActionButton/FloatingActionButton.js.map +1 -0
- package/build/lib/web/production/components/FloatingActionButton/FloatingActionButtonContainer.web.js +45 -0
- package/build/lib/web/production/components/FloatingActionButton/FloatingActionButtonContainer.web.js.map +1 -0
- package/build/lib/web/production/components/FloatingActionButton/index.js +2 -0
- package/build/lib/web/production/components/FloatingActionButton/index.js.map +1 -0
- package/build/lib/web/production/components/GenUI/GenUIComponents.web.js.map +1 -1
- package/build/lib/web/production/components/GenUI/GenUIContext.web.js +9 -1
- package/build/lib/web/production/components/GenUI/GenUIContext.web.js.map +1 -1
- package/build/lib/web/production/components/GenUI/GenUIProvider.web.js +17 -0
- package/build/lib/web/production/components/GenUI/GenUIProvider.web.js.map +1 -1
- package/build/lib/web/production/components/GenUI/GenUISchemaRenderer.web.js +31 -6
- package/build/lib/web/production/components/GenUI/GenUISchemaRenderer.web.js.map +1 -1
- package/build/lib/web/production/components/GenUI/index.js +1 -1
- package/build/lib/web/production/components/Icons/BookmarkFilledIcon/BookmarkFilledIcon.js +44 -0
- package/build/lib/web/production/components/Icons/BookmarkFilledIcon/BookmarkFilledIcon.js.map +1 -0
- package/build/lib/web/production/components/Icons/BookmarkFilledIcon/index.js +2 -0
- package/build/lib/web/production/components/Icons/BookmarkFilledIcon/index.js.map +1 -0
- package/build/lib/web/production/components/Icons/index.js +1 -0
- package/build/lib/web/production/components/Icons/index.js.map +1 -1
- package/build/lib/web/production/components/Input/OTPInput/OTPInput.js +3 -0
- package/build/lib/web/production/components/Input/OTPInput/OTPInput.js.map +1 -1
- package/build/lib/web/production/components/PopupArrow/PopupArrow.web.js +7 -1
- package/build/lib/web/production/components/PopupArrow/PopupArrow.web.js.map +1 -1
- package/build/lib/web/production/components/RollingText/RollingText.web.js +27 -20
- package/build/lib/web/production/components/RollingText/RollingText.web.js.map +1 -1
- package/build/lib/web/production/components/SegmentedControl/SegmentedControl.web.js +196 -0
- package/build/lib/web/production/components/SegmentedControl/SegmentedControl.web.js.map +1 -0
- package/build/lib/web/production/components/SegmentedControl/SegmentedControlContext.js +18 -0
- package/build/lib/web/production/components/SegmentedControl/SegmentedControlContext.js.map +1 -0
- package/build/lib/web/production/components/SegmentedControl/SegmentedControlIndicator.web.js +109 -0
- package/build/lib/web/production/components/SegmentedControl/SegmentedControlIndicator.web.js.map +1 -0
- package/build/lib/web/production/components/SegmentedControl/SegmentedControlItem.web.js +170 -0
- package/build/lib/web/production/components/SegmentedControl/SegmentedControlItem.web.js.map +1 -0
- package/build/lib/web/production/components/SegmentedControl/index.js +3 -0
- package/build/lib/web/production/components/SegmentedControl/index.js.map +1 -0
- package/build/lib/web/production/components/SegmentedControl/segmentedControlTokens.js +53 -0
- package/build/lib/web/production/components/SegmentedControl/segmentedControlTokens.js.map +1 -0
- package/build/lib/web/production/components/Spark/RzpGlass/RzpGlass.js +16 -7
- package/build/lib/web/production/components/Spark/RzpGlass/RzpGlass.js.map +1 -1
- package/build/lib/web/production/components/Spark/RzpGlass/RzpGlassMount.js +24 -6
- package/build/lib/web/production/components/Spark/RzpGlass/RzpGlassMount.js.map +1 -1
- package/build/lib/web/production/components/Spark/RzpGlass/presets.js +30 -1
- package/build/lib/web/production/components/Spark/RzpGlass/presets.js.map +1 -1
- package/build/lib/web/production/components/Spark/RzpGlass/rzpGlassShader.js +1 -1
- package/build/lib/web/production/components/Spark/RzpGlass/rzpGlassShader.js.map +1 -1
- package/build/lib/web/production/components/Spark/RzpGlass/utils.js +26 -10
- package/build/lib/web/production/components/Spark/RzpGlass/utils.js.map +1 -1
- package/build/lib/web/production/components/SpotlightPopoverTour/Tour.web.js +31 -18
- package/build/lib/web/production/components/SpotlightPopoverTour/Tour.web.js.map +1 -1
- package/build/lib/web/production/components/SpotlightPopoverTour/TourMask.web.js +14 -3
- package/build/lib/web/production/components/SpotlightPopoverTour/TourMask.web.js.map +1 -1
- package/build/lib/web/production/components/SpotlightPopoverTour/TourPopover.web.js +23 -4
- package/build/lib/web/production/components/SpotlightPopoverTour/TourPopover.web.js.map +1 -1
- package/build/lib/web/production/components/SpotlightPopoverTour/utils.js +58 -1
- package/build/lib/web/production/components/SpotlightPopoverTour/utils.js.map +1 -1
- package/build/lib/web/production/components/Stagger/StaggerProvider.js.map +1 -1
- package/build/lib/web/production/components/TreeView/StyledTreeViewRow.web.js +41 -0
- package/build/lib/web/production/components/TreeView/StyledTreeViewRow.web.js.map +1 -0
- package/build/lib/web/production/components/TreeView/TreeView.web.js +696 -0
- package/build/lib/web/production/components/TreeView/TreeView.web.js.map +1 -0
- package/build/lib/web/production/components/TreeView/TreeViewAnimator.web.js +184 -0
- package/build/lib/web/production/components/TreeView/TreeViewAnimator.web.js.map +1 -0
- package/build/lib/web/production/components/TreeView/TreeViewChevron.web.js +73 -0
- package/build/lib/web/production/components/TreeView/TreeViewChevron.web.js.map +1 -0
- package/build/lib/web/production/components/TreeView/TreeViewItem.web.js +295 -0
- package/build/lib/web/production/components/TreeView/TreeViewItem.web.js.map +1 -0
- package/build/lib/web/production/components/TreeView/TreeViewLoadMore.web.js +173 -0
- package/build/lib/web/production/components/TreeView/TreeViewLoadMore.web.js.map +1 -0
- package/build/lib/web/production/components/TreeView/componentIds.js +8 -0
- package/build/lib/web/production/components/TreeView/componentIds.js.map +1 -0
- package/build/lib/web/production/components/TreeView/index.web.js +4 -0
- package/build/lib/web/production/components/TreeView/index.web.js.map +1 -0
- package/build/lib/web/production/components/TreeView/treeViewUtils.js +475 -0
- package/build/lib/web/production/components/TreeView/treeViewUtils.js.map +1 -0
- package/build/lib/web/production/components/TreeView/useTreeView.js +24 -0
- package/build/lib/web/production/components/TreeView/useTreeView.js.map +1 -0
- package/build/lib/web/production/components/index.js +12 -2
- package/build/lib/web/production/components/index.js.map +1 -1
- package/build/lib/web/production/node_modules/es-toolkit/dist/array/flatten.js +1 -1
- package/build/lib/web/production/node_modules/es-toolkit/dist/compat/array/flatten.js +1 -1
- package/build/lib/web/production/node_modules/es-toolkit/dist/compat/array/sortBy.js +2 -2
- package/build/lib/web/production/node_modules/es-toolkit/dist/compat/object/omit.js +2 -2
- package/build/lib/web/production/tokens/global/colors.js +2 -2
- package/build/lib/web/production/tokens/global/colors.js.map +1 -1
- package/build/lib/web/production/tokens/index.js +1 -0
- package/build/lib/web/production/tokens/index.js.map +1 -1
- package/build/lib/web/production/tokens/theme/bladeNeutralTheme.js +1439 -0
- package/build/lib/web/production/tokens/theme/bladeNeutralTheme.js.map +1 -0
- package/build/lib/web/production/tokens/theme/bladeTheme.js +48 -12
- package/build/lib/web/production/tokens/theme/bladeTheme.js.map +1 -1
- package/build/lib/web/production/tokens/theme/index.js +1 -0
- package/build/lib/web/production/tokens/theme/index.js.map +1 -1
- package/build/lib/web/production/tokens/theme/theme.js.map +1 -1
- package/build/lib/web/production/utils/componentZIndices.js +2 -0
- package/build/lib/web/production/utils/componentZIndices.js.map +1 -1
- package/build/lib/web/production/utils/metaAttribute/metaConstants.js +7 -1
- package/build/lib/web/production/utils/metaAttribute/metaConstants.js.map +1 -1
- package/build/lib/web/production/utils/useControlledDropdownInput/useControlledDropdownInput.js +12 -4
- package/build/lib/web/production/utils/useControlledDropdownInput/useControlledDropdownInput.js.map +1 -1
- package/build/lib/web/production/utils/useTruncationTitle/useTruncationTitle.web.js +2 -2
- package/build/lib/web/production/utils/useTruncationTitle/useTruncationTitle.web.js.map +1 -1
- package/build/types/components/index.d.ts +794 -25
- package/build/types/components/index.native.d.ts +872 -29
- package/build/types/tokens/index.d.ts +11 -4
- package/build/types/tokens/index.native.d.ts +11 -4
- package/build/types/utils/index.d.ts +8 -3
- package/build/types/utils/index.native.d.ts +8 -3
- package/package.json +2 -2
- package/build/lib/web/development/components/AnimateInteractions/useFocusWithin.js.map +0 -1
- package/build/lib/web/production/components/AnimateInteractions/useFocusWithin.js.map +0 -1
|
@@ -13,9 +13,20 @@ import { isReactNative } from '../../utils/platform/isReactNative.js';
|
|
|
13
13
|
var _excluded = ["isOpen", "setIsOpen", "close", "selectedIndices", "setSelectedIndices", "activeIndex", "setActiveIndex", "activeTagIndex", "setActiveTagIndex", "visibleTagsCountRef", "isKeydownPressed", "setIsKeydownPressed", "options", "selectionType", "changeCallbackTriggerer", "setChangeCallbackTriggerer", "isControlled", "setControlledValueIndices", "filteredValues", "dropdownTriggerer"];
|
|
14
14
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
15
15
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
16
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
17
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
18
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
16
19
|
|
|
17
20
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
18
21
|
var noop = function noop() {};
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Controller published by TreeView when it is rendered as Dropdown overlay content.
|
|
25
|
+
*
|
|
26
|
+
* All tree-specific behaviour inside Dropdown is gated on this being present, so
|
|
27
|
+
* ActionList (and any other overlay content) paths stay behaviourally identical
|
|
28
|
+
*/
|
|
29
|
+
|
|
19
30
|
var DropdownContext = /*#__PURE__*/React__default.createContext({
|
|
20
31
|
isOpen: false,
|
|
21
32
|
setIsOpen: noop,
|
|
@@ -62,6 +73,9 @@ var DropdownContext = /*#__PURE__*/React__default.createContext({
|
|
|
62
73
|
},
|
|
63
74
|
triggererWrapperRef: {
|
|
64
75
|
current: null
|
|
76
|
+
},
|
|
77
|
+
treeViewControllerRef: {
|
|
78
|
+
current: null
|
|
65
79
|
}
|
|
66
80
|
});
|
|
67
81
|
var searchTimeout;
|
|
@@ -73,6 +87,7 @@ var searchString = '';
|
|
|
73
87
|
*
|
|
74
88
|
*/
|
|
75
89
|
var useDropdown = function useDropdown() {
|
|
90
|
+
var _rest$treeViewControl6;
|
|
76
91
|
var _React$useContext = React__default.useContext(DropdownContext),
|
|
77
92
|
isOpen = _React$useContext.isOpen,
|
|
78
93
|
setIsOpen = _React$useContext.setIsOpen,
|
|
@@ -149,6 +164,44 @@ var useDropdown = function useDropdown() {
|
|
|
149
164
|
return isSelected;
|
|
150
165
|
};
|
|
151
166
|
|
|
167
|
+
/**
|
|
168
|
+
* Marks multiple indices as selected / deselected in a single state update and
|
|
169
|
+
* bumps the change callback triggerer exactly once.
|
|
170
|
+
*
|
|
171
|
+
* Used by TreeView for branch cascade toggles (one branch toggle mutates many leaf
|
|
172
|
+
* indices but must fire a single `onChange`). Routes through the same controlled /
|
|
173
|
+
* uncontrolled fork as `selectOption`. ActionList does not use this
|
|
174
|
+
*/
|
|
175
|
+
var selectOptionsBatch = function selectOptionsBatch(indices, action) {
|
|
176
|
+
if (indices.length === 0) {
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
var updatedIndices;
|
|
180
|
+
if (action === 'select') {
|
|
181
|
+
updatedIndices = _toConsumableArray(selectedIndices);
|
|
182
|
+
var _iterator = _createForOfIteratorHelper(indices),
|
|
183
|
+
_step;
|
|
184
|
+
try {
|
|
185
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
186
|
+
var _index = _step.value;
|
|
187
|
+
if (_index >= 0 && _index <= options.length - 1 && !updatedIndices.includes(_index)) {
|
|
188
|
+
updatedIndices.push(_index);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
} catch (err) {
|
|
192
|
+
_iterator.e(err);
|
|
193
|
+
} finally {
|
|
194
|
+
_iterator.f();
|
|
195
|
+
}
|
|
196
|
+
} else {
|
|
197
|
+
updatedIndices = selectedIndices.filter(function (selectedIndex) {
|
|
198
|
+
return !indices.includes(selectedIndex);
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
setIndices(updatedIndices);
|
|
202
|
+
setChangeCallbackTriggerer(changeCallbackTriggerer + 1);
|
|
203
|
+
};
|
|
204
|
+
|
|
152
205
|
/**
|
|
153
206
|
* Click listener for combobox (or any triggerer of the dropdown)
|
|
154
207
|
*/
|
|
@@ -164,11 +217,23 @@ var useDropdown = function useDropdown() {
|
|
|
164
217
|
* Function that we call when we want to move focus from one option to other
|
|
165
218
|
*/
|
|
166
219
|
var onOptionChange = function onOptionChange(actionType, index) {
|
|
220
|
+
var _rest$treeViewControl;
|
|
167
221
|
setActiveTagIndex(-1);
|
|
168
222
|
var newIndex = index !== null && index !== void 0 ? index : activeIndex;
|
|
169
223
|
var updatedIndex;
|
|
170
224
|
var hasAutoComplete = rest.hasAutoCompleteInHeader || dropdownTriggerer === dropdownComponentIds.triggers.AutoComplete;
|
|
171
|
-
|
|
225
|
+
var treeViewController = (_rest$treeViewControl = rest.treeViewControllerRef) === null || _rest$treeViewControl === void 0 ? void 0 : _rest$treeViewControl.current;
|
|
226
|
+
if (treeViewController) {
|
|
227
|
+
var _visibleIndexes$getUp;
|
|
228
|
+
// When overlay content is a TreeView, traversal skips rows hidden under collapsed
|
|
229
|
+
// branches (indices stay stable across expand / collapse, only traversal changes)
|
|
230
|
+
var visibleIndexes = treeViewController.getVisibleOptionIndices();
|
|
231
|
+
updatedIndex = (_visibleIndexes$getUp = visibleIndexes[getUpdatedIndex({
|
|
232
|
+
currentIndex: visibleIndexes.indexOf(newIndex),
|
|
233
|
+
maxIndex: visibleIndexes.length - 1,
|
|
234
|
+
actionType: actionType
|
|
235
|
+
})]) !== null && _visibleIndexes$getUp !== void 0 ? _visibleIndexes$getUp : newIndex;
|
|
236
|
+
} else if (hasAutoComplete && filteredValues.length > 0) {
|
|
172
237
|
// When its autocomplete, we don't loop over all options. We only loop on filtered options
|
|
173
238
|
|
|
174
239
|
var filteredIndexes = filteredValues.map(function (filteredValue) {
|
|
@@ -274,23 +339,43 @@ var useDropdown = function useDropdown() {
|
|
|
274
339
|
}
|
|
275
340
|
var actionType = getActionFromKey(e.event, isOpen, dropdownTriggerer);
|
|
276
341
|
if (actionType) {
|
|
342
|
+
var _rest$treeViewControl3;
|
|
277
343
|
performAction(actionType, e, {
|
|
278
344
|
setIsOpen: setIsOpen,
|
|
279
345
|
close: close,
|
|
280
346
|
onOptionChange: onOptionChange,
|
|
281
347
|
onComboType: onComboType,
|
|
282
|
-
selectCurrentOption: function selectCurrentOption() {
|
|
283
|
-
var _options$activeIndex$, _options$activeIndex;
|
|
348
|
+
selectCurrentOption: function selectCurrentOption(event) {
|
|
349
|
+
var _rest$treeViewControl2, _options$activeIndex$, _options$activeIndex;
|
|
284
350
|
if (activeIndex < 0) {
|
|
285
351
|
return;
|
|
286
352
|
}
|
|
353
|
+
|
|
354
|
+
// TreeView handles branch cascade toggles and load-more rows itself
|
|
355
|
+
var treeViewController = (_rest$treeViewControl2 = rest.treeViewControllerRef) === null || _rest$treeViewControl2 === void 0 ? void 0 : _rest$treeViewControl2.current;
|
|
356
|
+
if (treeViewController !== null && treeViewController !== void 0 && treeViewController.handleOptionSelect(activeIndex, {
|
|
357
|
+
key: event === null || event === void 0 ? void 0 : event.key
|
|
358
|
+
})) {
|
|
359
|
+
return;
|
|
360
|
+
}
|
|
287
361
|
var isSelected = selectOption(activeIndex);
|
|
288
362
|
if (rest.hasFooterAction && !isReactNative()) {
|
|
289
363
|
var _rest$triggererRef$cu2;
|
|
290
364
|
(_rest$triggererRef$cu2 = rest.triggererRef.current) === null || _rest$triggererRef$cu2 === void 0 || _rest$triggererRef$cu2.focus();
|
|
291
365
|
}
|
|
292
366
|
(_options$activeIndex$ = (_options$activeIndex = options[activeIndex]).onClickTrigger) === null || _options$activeIndex$ === void 0 || _options$activeIndex$.call(_options$activeIndex, isSelected);
|
|
293
|
-
}
|
|
367
|
+
},
|
|
368
|
+
// present only when overlay content is a TreeView; undefined keeps
|
|
369
|
+
// ArrowLeft / ArrowRight behaviour unchanged for every other content
|
|
370
|
+
onTreeExpandCollapse: (_rest$treeViewControl3 = rest.treeViewControllerRef) !== null && _rest$treeViewControl3 !== void 0 && _rest$treeViewControl3.current ? function (action) {
|
|
371
|
+
if (action === 'Expand') {
|
|
372
|
+
var _rest$treeViewControl4;
|
|
373
|
+
(_rest$treeViewControl4 = rest.treeViewControllerRef.current) === null || _rest$treeViewControl4 === void 0 || _rest$treeViewControl4.onArrowRightKeydown(activeIndex);
|
|
374
|
+
} else {
|
|
375
|
+
var _rest$treeViewControl5;
|
|
376
|
+
(_rest$treeViewControl5 = rest.treeViewControllerRef.current) === null || _rest$treeViewControl5 === void 0 || _rest$treeViewControl5.onArrowLeftKeydown(activeIndex);
|
|
377
|
+
}
|
|
378
|
+
} : undefined
|
|
294
379
|
});
|
|
295
380
|
}
|
|
296
381
|
};
|
|
@@ -302,6 +387,7 @@ var useDropdown = function useDropdown() {
|
|
|
302
387
|
setSelectedIndices: setSelectedIndices,
|
|
303
388
|
filteredValues: filteredValues,
|
|
304
389
|
removeOption: removeOption,
|
|
390
|
+
selectOptionsBatch: selectOptionsBatch,
|
|
305
391
|
setControlledValueIndices: setControlledValueIndices,
|
|
306
392
|
onTriggerClick: onTriggerClick,
|
|
307
393
|
onTriggerKeydown: onTriggerKeydown,
|
|
@@ -318,7 +404,7 @@ var useDropdown = function useDropdown() {
|
|
|
318
404
|
isControlled: isControlled,
|
|
319
405
|
options: options,
|
|
320
406
|
value: makeInputValue(selectedIndices, options),
|
|
321
|
-
displayValue: makeInputDisplayValue(selectedIndices, options),
|
|
407
|
+
displayValue: makeInputDisplayValue(selectedIndices, options, (_rest$treeViewControl6 = rest.treeViewControllerRef) === null || _rest$treeViewControl6 === void 0 || (_rest$treeViewControl6 = _rest$treeViewControl6.current) === null || _rest$treeViewControl6 === void 0 ? void 0 : _rest$treeViewControl6.getDisplayOverride(selectedIndices)),
|
|
322
408
|
selectionType: selectionType,
|
|
323
409
|
dropdownTriggerer: dropdownTriggerer
|
|
324
410
|
}, rest);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDropdown.js","sources":["../../../../../../src/components/Dropdown/useDropdown.ts"],"sourcesContent":["import React from 'react';\n\nimport {\n ensureScrollVisiblity,\n getActionFromKey,\n getIndexByLetter,\n getUpdatedIndex,\n makeInputDisplayValue,\n makeInputValue,\n performAction,\n} from './dropdownUtils';\nimport type { SelectActionsType } from './dropdownUtils';\nimport type { DropdownProps } from './types';\n\nimport { dropdownComponentIds } from './dropdownComponentIds';\nimport type { FormInputHandleOnKeyDownEvent } from '~components/Form/FormTypes';\nimport { isReactNative, isBrowser } from '~utils';\nimport type { ContainerElementType } from '~utils/types';\nimport { fireNativeEvent } from '~utils/fireNativeEvent';\n\n// eslint-disable-next-line @typescript-eslint/no-empty-function\nconst noop = (): void => {};\n\ntype OptionsType = {\n title: string;\n value: string;\n onClickTrigger?: (isSelected: boolean) => void;\n}[];\n\ntype DropdownContextType = {\n isOpen: boolean;\n setIsOpen: (isOpen: boolean) => void;\n close: () => void;\n /**\n * contains the indexes of selected items\n */\n selectedIndices: number[];\n setSelectedIndices: (value: number[]) => void;\n /**\n * contains the indexes of selected items during controlled selection\n */\n controlledValueIndices: number[];\n setControlledValueIndices: (value: number[]) => void;\n /**\n * contains information about all the options inside actionlist\n */\n options: OptionsType;\n setOptions: (value: OptionsType) => void;\n\n /**\n * Filtered values for AutoComplete Inputs\n */\n filteredValues: string[];\n setFilteredValues: (values: string[]) => void;\n\n /** Currently active (focussed) index */\n activeIndex: number;\n setActiveIndex: (value: number) => void;\n\n /** Currently active (focussed) tag */\n activeTagIndex: number;\n setActiveTagIndex: (value: number) => void;\n\n /**\n * Sometimes we want to ignore the blur event to keep dropdown open but not ignore the blur animation from selectinput\n * E.g. When someone clicks on Footer, we just want to ignore the blur event and not the blur animation\n */\n shouldIgnoreBlurAnimation: boolean;\n setShouldIgnoreBlurAnimation: (value: boolean) => void;\n /** Tells you if keyboard was used. Its false by default and turns into true when keydown is called */\n isKeydownPressed: boolean;\n setIsKeydownPressed: (value: boolean) => void;\n /** common baseId which is prepended to multiple other ids inside this dropdown */\n dropdownBaseId: string;\n /** Which element has triggered the dropdown */\n dropdownTriggerer?:\n | 'SelectInput'\n | 'DropdownButton'\n | 'DropdownIconButton'\n | 'AutoComplete'\n | 'DropdownLink'\n | 'SearchInput'\n | 'FilterChipSelectInput'\n | 'InputDropdownButton';\n\n /** ref of triggerer. Used to call focus in certain places */\n triggererRef: React.MutableRefObject<HTMLButtonElement | null>;\n headerAutoCompleteRef: React.MutableRefObject<HTMLButtonElement | null>;\n triggererWrapperRef: React.MutableRefObject<ContainerElementType | null>;\n actionListItemRef: React.RefObject<HTMLDivElement | null>;\n isTagDismissedRef: React.RefObject<{ value: boolean } | null>;\n visibleTagsCountRef: React.RefObject<{ value: number } | null>;\n\n selectionType?: DropdownProps['selectionType'];\n /** whether footer has an action item.\n * certain a11y behaviour changes happen here\n * E.g. tabbing moves focus to that action instead of outside\n */\n hasFooterAction: boolean;\n setHasFooterAction: (value: boolean) => void;\n\n /**\n * Apart from dropdownTriggerer prop, we also set this boolean because in BottomSheetHeader and DropdownHeader, the trigger can be Select but they can also have autocomplete inside of header\n */\n hasAutoCompleteInHeader: boolean;\n setHasAutoCompleteInHeader: (value: boolean) => void;\n\n /**\n * A value that can be used in dependency array to know when Dropdown value is changed.\n *\n * E.g.\n * ```ts\n * useEffect(() => {\n * console.log('Uncontrolled value change');\n * }, [changeCallbackTriggerer])\n * ```\n */\n changeCallbackTriggerer: number;\n setChangeCallbackTriggerer: (changeCallbackTriggerer: number) => void;\n\n /**\n * true when SelectInput has `value` prop (when it is controlled)\n */\n isControlled: boolean;\n setIsControlled: (isControlled: boolean) => void;\n};\n\nconst DropdownContext = React.createContext<DropdownContextType>({\n isOpen: false,\n setIsOpen: noop,\n close: noop,\n selectedIndices: [],\n setSelectedIndices: noop,\n controlledValueIndices: [],\n setControlledValueIndices: noop,\n options: [],\n setOptions: noop,\n filteredValues: [],\n setFilteredValues: noop,\n activeIndex: -1,\n setActiveIndex: noop,\n activeTagIndex: -1,\n setActiveTagIndex: noop,\n shouldIgnoreBlurAnimation: false,\n setShouldIgnoreBlurAnimation: noop,\n hasFooterAction: false,\n setHasFooterAction: noop,\n hasAutoCompleteInHeader: false,\n setHasAutoCompleteInHeader: noop,\n isKeydownPressed: false,\n setIsKeydownPressed: noop,\n changeCallbackTriggerer: 0,\n setChangeCallbackTriggerer: noop,\n isControlled: false,\n setIsControlled: noop,\n dropdownBaseId: '',\n actionListItemRef: {\n current: null,\n },\n triggererRef: {\n current: null,\n },\n headerAutoCompleteRef: {\n current: null,\n },\n isTagDismissedRef: {\n current: null,\n },\n visibleTagsCountRef: {\n current: null,\n },\n triggererWrapperRef: {\n current: null,\n },\n});\n\nlet searchTimeout: number;\nlet searchString = '';\n\ntype UseDropdownReturnValue = DropdownContextType & {\n /**\n * Click event on combobox. Toggles the dropdown\n */\n onTriggerClick: () => void;\n\n /**\n * Keydown event of combobox. Handles most of the keyboard accessibility of dropdown\n */\n onTriggerKeydown: FormInputHandleOnKeyDownEvent | undefined;\n\n /**\n * Handles the click even on option.\n *\n * Contains the logic that selects the option, moves the focus, etc\n */\n onOptionClick: (\n e: React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLInputElement>,\n index: number,\n ) => void;\n\n /**\n * Removes the option with given optionsIndex\n */\n removeOption: (index: number) => void;\n\n /**\n * value that is used during form submissions\n */\n value: string;\n /**\n * This is the value that is displayed inside select after selection\n */\n displayValue: string;\n};\n\n/**\n * Handles almost all the functionality of dropdown.\n *\n * Returns the values from DropdownContext along with some helper functions and event handlers\n *\n */\nconst useDropdown = (): UseDropdownReturnValue => {\n const {\n isOpen,\n setIsOpen,\n close,\n selectedIndices,\n setSelectedIndices,\n activeIndex,\n setActiveIndex,\n activeTagIndex,\n setActiveTagIndex,\n visibleTagsCountRef,\n isKeydownPressed,\n setIsKeydownPressed,\n options,\n selectionType,\n changeCallbackTriggerer,\n setChangeCallbackTriggerer,\n isControlled,\n setControlledValueIndices,\n filteredValues,\n dropdownTriggerer,\n ...rest\n } = React.useContext(DropdownContext);\n\n type SelectOptionType = (\n index: number,\n properties?: {\n closeOnSelection?: boolean;\n },\n ) => boolean;\n\n const setIndices = (indices: number[]): void => {\n if (isControlled) {\n setControlledValueIndices(indices);\n } else {\n setSelectedIndices(indices);\n }\n };\n\n const removeOption = (index: number): void => {\n // remove existing item\n const existingItemIndex = selectedIndices.indexOf(index);\n if (existingItemIndex < 0) {\n return;\n }\n\n setIndices([\n ...selectedIndices.slice(0, existingItemIndex),\n ...selectedIndices.slice(existingItemIndex + 1),\n ]);\n };\n\n /**\n * Marks the given index as selected.\n *\n * In single select, it also closes the menu.\n * In multiselect, it keeps the menu open for more selections\n */\n const selectOption: SelectOptionType = (\n index,\n properties = {\n closeOnSelection: true,\n },\n ) => {\n let isSelected = false;\n\n if (index < 0 || index > options.length - 1) {\n return isSelected;\n }\n\n if (selectionType === 'multiple') {\n if (selectedIndices.includes(index)) {\n removeOption(index);\n isSelected = false;\n } else {\n setIndices([...selectedIndices, index]);\n isSelected = true;\n }\n } else {\n setIndices([index]);\n isSelected = true;\n }\n\n // Triggers `onChange` on SelectInput\n setChangeCallbackTriggerer(changeCallbackTriggerer + 1);\n\n if (activeIndex !== index) {\n setActiveIndex(index);\n }\n\n if (properties?.closeOnSelection && selectionType !== 'multiple') {\n close();\n }\n\n return isSelected;\n };\n\n /**\n * Click listener for combobox (or any triggerer of the dropdown)\n */\n const onTriggerClick = (): void => {\n if (isOpen) {\n close();\n } else {\n setIsOpen(true);\n }\n };\n\n /**\n * Function that we call when we want to move focus from one option to other\n */\n const onOptionChange = (actionType: SelectActionsType, index?: number): void => {\n setActiveTagIndex(-1);\n const newIndex = index ?? activeIndex;\n let updatedIndex: number;\n const hasAutoComplete =\n rest.hasAutoCompleteInHeader ||\n dropdownTriggerer === dropdownComponentIds.triggers.AutoComplete;\n if (hasAutoComplete && filteredValues.length > 0) {\n // When its autocomplete, we don't loop over all options. We only loop on filtered options\n\n const filteredIndexes = filteredValues\n .map((filteredValue) => options.findIndex((option) => option.value === filteredValue))\n .sort((a, b) => a - b);\n\n updatedIndex =\n filteredIndexes[\n getUpdatedIndex({\n currentIndex: filteredIndexes.indexOf(newIndex),\n maxIndex: filteredIndexes.length - 1,\n actionType,\n })\n ];\n } else {\n updatedIndex = getUpdatedIndex({\n currentIndex: newIndex,\n maxIndex: options.length - 1,\n actionType,\n });\n }\n setActiveIndex(updatedIndex);\n\n const optionValues = options.map((option) => option.value);\n ensureScrollVisiblity(updatedIndex, rest.actionListItemRef.current, optionValues);\n if (isBrowser()) {\n fireNativeEvent(rest.actionListItemRef as React.RefObject<HTMLElement>, ['change', 'input']);\n }\n };\n\n /**\n * Click handler when user clicks on any particular option.\n *\n * It\n * - changes the option focus\n * - selects that option\n * - moves focus to combobox\n */\n const onOptionClick = (\n e: React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLInputElement>,\n index: number,\n ): void => {\n setIsKeydownPressed(false);\n const actionType = getActionFromKey(e, isOpen, dropdownTriggerer);\n if (typeof actionType === 'number') {\n onOptionChange(actionType, index);\n }\n selectOption(index);\n\n if (!isReactNative()) {\n if (rest.hasAutoCompleteInHeader) {\n // move focus to autocomplete\n rest.headerAutoCompleteRef.current?.focus();\n } else {\n rest.triggererRef.current?.focus();\n }\n }\n };\n\n /**\n * Function we call to handle the typeahead.\n *\n * It takes a letter, stores that letter in searchString (and clears it after timeout) to maintain a word\n *\n * Then searches for that word in options and moves focus there.\n */\n const onComboType = (letter: string, actionType: SelectActionsType): void => {\n // open the listbox if it is closed\n setIsOpen(true);\n\n if (\n rest.hasAutoCompleteInHeader ||\n dropdownTriggerer === dropdownComponentIds.triggers.AutoComplete\n ) {\n return;\n }\n\n if (typeof searchTimeout === 'number') {\n window.clearTimeout(searchTimeout);\n }\n\n searchTimeout = window.setTimeout(() => {\n searchString = '';\n }, 500);\n // eslint-disable-next-line @typescript-eslint/restrict-plus-operands\n searchString = searchString + letter;\n const optionTitles = options.map((option) => option.title);\n const searchIndex = getIndexByLetter(optionTitles, searchString, activeIndex + 1);\n\n // if a match was found, go to it\n if (searchIndex >= 0) {\n onOptionChange(actionType, searchIndex);\n }\n // if no matches, clear the timeout and search string\n else {\n window.clearTimeout(searchTimeout);\n searchString = '';\n }\n };\n\n /**\n * Keydown event of combobox. Handles most of the keyboard accessibility of dropdown\n */\n const onTriggerKeydown = (e: {\n event: React.KeyboardEvent<HTMLInputElement | HTMLButtonElement>;\n }): void => {\n if (!isKeydownPressed && ![' ', 'Enter', 'Escape', 'Meta'].includes(e.event.key)) {\n // When keydown is not already pressed and its not Enter, Space, Command, or Escape key (those are generic keys and we only want to handle arrow keys or home buttons etc)\n setIsKeydownPressed(true);\n }\n\n const actionType = getActionFromKey(e.event, isOpen, dropdownTriggerer);\n\n if (actionType) {\n performAction(actionType, e, {\n setIsOpen,\n close,\n onOptionChange,\n onComboType,\n selectCurrentOption: () => {\n if (activeIndex < 0) {\n return;\n }\n\n const isSelected = selectOption(activeIndex);\n if (rest.hasFooterAction && !isReactNative()) {\n rest.triggererRef.current?.focus();\n }\n\n options[activeIndex].onClickTrigger?.(isSelected);\n },\n });\n }\n };\n\n return {\n isOpen,\n setIsOpen,\n close,\n selectedIndices,\n setSelectedIndices,\n filteredValues,\n removeOption,\n setControlledValueIndices,\n onTriggerClick,\n onTriggerKeydown,\n onOptionClick,\n activeIndex,\n setActiveIndex,\n activeTagIndex,\n setActiveTagIndex,\n visibleTagsCountRef,\n isKeydownPressed,\n setIsKeydownPressed,\n changeCallbackTriggerer,\n setChangeCallbackTriggerer,\n isControlled,\n options,\n value: makeInputValue(selectedIndices, options),\n displayValue: makeInputDisplayValue(selectedIndices, options),\n selectionType,\n dropdownTriggerer,\n ...rest,\n };\n};\n\nexport type { DropdownContextType, OptionsType };\nexport { useDropdown, DropdownContext };\n"],"names":["noop","DropdownContext","React","createContext","isOpen","setIsOpen","close","selectedIndices","setSelectedIndices","controlledValueIndices","setControlledValueIndices","options","setOptions","filteredValues","setFilteredValues","activeIndex","setActiveIndex","activeTagIndex","setActiveTagIndex","shouldIgnoreBlurAnimation","setShouldIgnoreBlurAnimation","hasFooterAction","setHasFooterAction","hasAutoCompleteInHeader","setHasAutoCompleteInHeader","isKeydownPressed","setIsKeydownPressed","changeCallbackTriggerer","setChangeCallbackTriggerer","isControlled","setIsControlled","dropdownBaseId","actionListItemRef","current","triggererRef","headerAutoCompleteRef","isTagDismissedRef","visibleTagsCountRef","triggererWrapperRef","searchTimeout","searchString","useDropdown","_React$useContext","useContext","selectionType","dropdownTriggerer","rest","_objectWithoutProperties","_excluded","setIndices","indices","removeOption","index","existingItemIndex","indexOf","concat","_toConsumableArray","slice","selectOption","properties","arguments","length","undefined","closeOnSelection","isSelected","includes","onTriggerClick","onOptionChange","actionType","newIndex","updatedIndex","hasAutoComplete","dropdownComponentIds","triggers","AutoComplete","filteredIndexes","map","filteredValue","findIndex","option","value","sort","a","b","getUpdatedIndex","currentIndex","maxIndex","optionValues","ensureScrollVisiblity","isBrowser","fireNativeEvent","onOptionClick","e","getActionFromKey","isReactNative","_rest$headerAutoCompl","focus","_rest$triggererRef$cu","onComboType","letter","window","clearTimeout","setTimeout","optionTitles","title","searchIndex","getIndexByLetter","onTriggerKeydown","event","key","performAction","selectCurrentOption","_options$activeIndex$","_options$activeIndex","_rest$triggererRef$cu2","onClickTrigger","call","_objectSpread","makeInputValue","displayValue","makeInputDisplayValue"],"mappings":";;;;;;;;;;;;;;;;AAoBA;AACA,IAAMA,IAAI,GAAG,SAAPA,IAAIA,GAAe,EAAE,CAAA;AA0G3B,IAAMC,eAAe,gBAAGC,cAAK,CAACC,aAAa,CAAsB;AAC/DC,EAAAA,MAAM,EAAE,KAAK;AACbC,EAAAA,SAAS,EAAEL,IAAI;AACfM,EAAAA,KAAK,EAAEN,IAAI;AACXO,EAAAA,eAAe,EAAE,EAAE;AACnBC,EAAAA,kBAAkB,EAAER,IAAI;AACxBS,EAAAA,sBAAsB,EAAE,EAAE;AAC1BC,EAAAA,yBAAyB,EAAEV,IAAI;AAC/BW,EAAAA,OAAO,EAAE,EAAE;AACXC,EAAAA,UAAU,EAAEZ,IAAI;AAChBa,EAAAA,cAAc,EAAE,EAAE;AAClBC,EAAAA,iBAAiB,EAAEd,IAAI;EACvBe,WAAW,EAAE,CAAC,CAAC;AACfC,EAAAA,cAAc,EAAEhB,IAAI;EACpBiB,cAAc,EAAE,CAAC,CAAC;AAClBC,EAAAA,iBAAiB,EAAElB,IAAI;AACvBmB,EAAAA,yBAAyB,EAAE,KAAK;AAChCC,EAAAA,4BAA4B,EAAEpB,IAAI;AAClCqB,EAAAA,eAAe,EAAE,KAAK;AACtBC,EAAAA,kBAAkB,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EAAhBA,gBAAgB;AAChBC,IAAAA,mBAAmB,EAAnBA,mBAAmB;AACnBC,IAAAA,uBAAuB,EAAvBA,uBAAuB;AACvBC,IAAAA,0BAA0B,EAA1BA,0BAA0B;AAC1BC,IAAAA,YAAY,EAAZA,YAAY;AACZlB,IAAAA,OAAO,EAAPA,OAAO;AACPqE,IAAAA,KAAK,EAAEsC,cAAc,CAAC/G,eAAe,EAAEI,OAAO,CAAC;AAC/C4G,IAAAA,YAAY,EAAEC,qBAAqB,CAACjH,eAAe,EAAEI,OAAO,CAAC;AAC7DiC,IAAAA,aAAa,EAAbA,aAAa;AACbC,IAAAA,iBAAiB,EAAjBA,iBAAAA;AAAiB,GAAA,EACdC,IAAI,CAAA,CAAA;AAEX;;;;"}
|
|
1
|
+
{"version":3,"file":"useDropdown.js","sources":["../../../../../../src/components/Dropdown/useDropdown.ts"],"sourcesContent":["import React from 'react';\n\nimport {\n ensureScrollVisiblity,\n getActionFromKey,\n getIndexByLetter,\n getUpdatedIndex,\n makeInputDisplayValue,\n makeInputValue,\n performAction,\n} from './dropdownUtils';\nimport type { SelectActionsType } from './dropdownUtils';\nimport type { DropdownProps } from './types';\n\nimport { dropdownComponentIds } from './dropdownComponentIds';\nimport type { FormInputHandleOnKeyDownEvent } from '~components/Form/FormTypes';\nimport { isReactNative, isBrowser } from '~utils';\nimport type { ContainerElementType } from '~utils/types';\nimport { fireNativeEvent } from '~utils/fireNativeEvent';\n\n// eslint-disable-next-line @typescript-eslint/no-empty-function\nconst noop = (): void => {};\n\ntype OptionsType = {\n title: string;\n value: string;\n onClickTrigger?: (isSelected: boolean) => void;\n}[];\n\n/**\n * Controller published by TreeView when it is rendered as Dropdown overlay content.\n *\n * All tree-specific behaviour inside Dropdown is gated on this being present, so\n * ActionList (and any other overlay content) paths stay behaviourally identical\n */\ntype TreeViewDropdownControllerType = {\n /**\n * Option indices of rows that are currently traversable (not hidden under a collapsed branch).\n * Used for visibility-aware keyboard traversal (same idea as AutoComplete's filteredValues)\n */\n getVisibleOptionIndices: () => number[];\n /**\n * ArrowRight: expand the active collapsed branch, or move to its first child\n */\n onArrowRightKeydown: (activeIndex: number) => void;\n /**\n * ArrowLeft: collapse the active expanded branch, or move to its parent\n */\n onArrowLeftKeydown: (activeIndex: number) => void;\n /**\n * Returns true when the tree handled the selection itself\n * (branch cascade toggle in multiple selection / load-more activation).\n * Returning false falls through to the default selectOption path\n */\n handleOptionSelect: (index: number, properties?: { key?: string }) => boolean;\n /**\n * Values of the topmost fully-selected branches, included in the trigger's onChange payload\n */\n getSelectedGroups: (selectedIndices: number[]) => string[];\n /**\n * Smallest describing set for the trigger display (D5)\n */\n getDisplayOverride: (selectedIndices: number[]) => { label: string; count: number } | undefined;\n};\n\ntype DropdownContextType = {\n isOpen: boolean;\n setIsOpen: (isOpen: boolean) => void;\n close: () => void;\n /**\n * contains the indexes of selected items\n */\n selectedIndices: number[];\n setSelectedIndices: (value: number[]) => void;\n /**\n * contains the indexes of selected items during controlled selection\n */\n controlledValueIndices: number[];\n setControlledValueIndices: (value: number[]) => void;\n /**\n * contains information about all the options inside actionlist\n */\n options: OptionsType;\n setOptions: (value: OptionsType) => void;\n\n /**\n * Filtered values for AutoComplete Inputs\n */\n filteredValues: string[];\n setFilteredValues: (values: string[]) => void;\n\n /** Currently active (focussed) index */\n activeIndex: number;\n setActiveIndex: (value: number) => void;\n\n /** Currently active (focussed) tag */\n activeTagIndex: number;\n setActiveTagIndex: (value: number) => void;\n\n /**\n * Sometimes we want to ignore the blur event to keep dropdown open but not ignore the blur animation from selectinput\n * E.g. When someone clicks on Footer, we just want to ignore the blur event and not the blur animation\n */\n shouldIgnoreBlurAnimation: boolean;\n setShouldIgnoreBlurAnimation: (value: boolean) => void;\n /** Tells you if keyboard was used. Its false by default and turns into true when keydown is called */\n isKeydownPressed: boolean;\n setIsKeydownPressed: (value: boolean) => void;\n /** common baseId which is prepended to multiple other ids inside this dropdown */\n dropdownBaseId: string;\n /** Which element has triggered the dropdown */\n dropdownTriggerer?:\n | 'SelectInput'\n | 'DropdownButton'\n | 'DropdownIconButton'\n | 'AutoComplete'\n | 'DropdownLink'\n | 'SearchInput'\n | 'FilterChipSelectInput'\n | 'InputDropdownButton';\n\n /** ref of triggerer. Used to call focus in certain places */\n triggererRef: React.MutableRefObject<HTMLButtonElement | null>;\n headerAutoCompleteRef: React.MutableRefObject<HTMLButtonElement | null>;\n triggererWrapperRef: React.MutableRefObject<ContainerElementType | null>;\n actionListItemRef: React.RefObject<HTMLDivElement | null>;\n isTagDismissedRef: React.RefObject<{ value: boolean } | null>;\n visibleTagsCountRef: React.RefObject<{ value: number } | null>;\n\n selectionType?: DropdownProps['selectionType'];\n /** whether footer has an action item.\n * certain a11y behaviour changes happen here\n * E.g. tabbing moves focus to that action instead of outside\n */\n hasFooterAction: boolean;\n setHasFooterAction: (value: boolean) => void;\n\n /**\n * Apart from dropdownTriggerer prop, we also set this boolean because in BottomSheetHeader and DropdownHeader, the trigger can be Select but they can also have autocomplete inside of header\n */\n hasAutoCompleteInHeader: boolean;\n setHasAutoCompleteInHeader: (value: boolean) => void;\n\n /**\n * A value that can be used in dependency array to know when Dropdown value is changed.\n *\n * E.g.\n * ```ts\n * useEffect(() => {\n * console.log('Uncontrolled value change');\n * }, [changeCallbackTriggerer])\n * ```\n */\n changeCallbackTriggerer: number;\n setChangeCallbackTriggerer: (changeCallbackTriggerer: number) => void;\n\n /**\n * true when SelectInput has `value` prop (when it is controlled)\n */\n isControlled: boolean;\n setIsControlled: (isControlled: boolean) => void;\n\n /**\n * Set by TreeView when it is rendered as the overlay content. null for every other\n * overlay content (ActionList, Menu, custom slots)\n */\n treeViewControllerRef: React.MutableRefObject<TreeViewDropdownControllerType | null>;\n};\n\nconst DropdownContext = React.createContext<DropdownContextType>({\n isOpen: false,\n setIsOpen: noop,\n close: noop,\n selectedIndices: [],\n setSelectedIndices: noop,\n controlledValueIndices: [],\n setControlledValueIndices: noop,\n options: [],\n setOptions: noop,\n filteredValues: [],\n setFilteredValues: noop,\n activeIndex: -1,\n setActiveIndex: noop,\n activeTagIndex: -1,\n setActiveTagIndex: noop,\n shouldIgnoreBlurAnimation: false,\n setShouldIgnoreBlurAnimation: noop,\n hasFooterAction: false,\n setHasFooterAction: noop,\n hasAutoCompleteInHeader: false,\n setHasAutoCompleteInHeader: noop,\n isKeydownPressed: false,\n setIsKeydownPressed: noop,\n changeCallbackTriggerer: 0,\n setChangeCallbackTriggerer: noop,\n isControlled: false,\n setIsControlled: noop,\n dropdownBaseId: '',\n actionListItemRef: {\n current: null,\n },\n triggererRef: {\n current: null,\n },\n headerAutoCompleteRef: {\n current: null,\n },\n isTagDismissedRef: {\n current: null,\n },\n visibleTagsCountRef: {\n current: null,\n },\n triggererWrapperRef: {\n current: null,\n },\n treeViewControllerRef: {\n current: null,\n },\n});\n\nlet searchTimeout: number;\nlet searchString = '';\n\ntype UseDropdownReturnValue = DropdownContextType & {\n /**\n * Click event on combobox. Toggles the dropdown\n */\n onTriggerClick: () => void;\n\n /**\n * Keydown event of combobox. Handles most of the keyboard accessibility of dropdown\n */\n onTriggerKeydown: FormInputHandleOnKeyDownEvent | undefined;\n\n /**\n * Handles the click even on option.\n *\n * Contains the logic that selects the option, moves the focus, etc\n */\n onOptionClick: (\n e: React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLInputElement>,\n index: number,\n ) => void;\n\n /**\n * Removes the option with given optionsIndex\n */\n removeOption: (index: number) => void;\n\n /**\n * Selects / deselects multiple options in one state update with a single onChange.\n * Used by TreeView branch cascade toggles\n */\n selectOptionsBatch: (indices: number[], action: 'select' | 'deselect') => void;\n\n /**\n * value that is used during form submissions\n */\n value: string;\n /**\n * This is the value that is displayed inside select after selection\n */\n displayValue: string;\n};\n\n/**\n * Handles almost all the functionality of dropdown.\n *\n * Returns the values from DropdownContext along with some helper functions and event handlers\n *\n */\nconst useDropdown = (): UseDropdownReturnValue => {\n const {\n isOpen,\n setIsOpen,\n close,\n selectedIndices,\n setSelectedIndices,\n activeIndex,\n setActiveIndex,\n activeTagIndex,\n setActiveTagIndex,\n visibleTagsCountRef,\n isKeydownPressed,\n setIsKeydownPressed,\n options,\n selectionType,\n changeCallbackTriggerer,\n setChangeCallbackTriggerer,\n isControlled,\n setControlledValueIndices,\n filteredValues,\n dropdownTriggerer,\n ...rest\n } = React.useContext(DropdownContext);\n\n type SelectOptionType = (\n index: number,\n properties?: {\n closeOnSelection?: boolean;\n },\n ) => boolean;\n\n const setIndices = (indices: number[]): void => {\n if (isControlled) {\n setControlledValueIndices(indices);\n } else {\n setSelectedIndices(indices);\n }\n };\n\n const removeOption = (index: number): void => {\n // remove existing item\n const existingItemIndex = selectedIndices.indexOf(index);\n if (existingItemIndex < 0) {\n return;\n }\n\n setIndices([\n ...selectedIndices.slice(0, existingItemIndex),\n ...selectedIndices.slice(existingItemIndex + 1),\n ]);\n };\n\n /**\n * Marks the given index as selected.\n *\n * In single select, it also closes the menu.\n * In multiselect, it keeps the menu open for more selections\n */\n const selectOption: SelectOptionType = (\n index,\n properties = {\n closeOnSelection: true,\n },\n ) => {\n let isSelected = false;\n\n if (index < 0 || index > options.length - 1) {\n return isSelected;\n }\n\n if (selectionType === 'multiple') {\n if (selectedIndices.includes(index)) {\n removeOption(index);\n isSelected = false;\n } else {\n setIndices([...selectedIndices, index]);\n isSelected = true;\n }\n } else {\n setIndices([index]);\n isSelected = true;\n }\n\n // Triggers `onChange` on SelectInput\n setChangeCallbackTriggerer(changeCallbackTriggerer + 1);\n\n if (activeIndex !== index) {\n setActiveIndex(index);\n }\n\n if (properties?.closeOnSelection && selectionType !== 'multiple') {\n close();\n }\n\n return isSelected;\n };\n\n /**\n * Marks multiple indices as selected / deselected in a single state update and\n * bumps the change callback triggerer exactly once.\n *\n * Used by TreeView for branch cascade toggles (one branch toggle mutates many leaf\n * indices but must fire a single `onChange`). Routes through the same controlled /\n * uncontrolled fork as `selectOption`. ActionList does not use this\n */\n const selectOptionsBatch = (indices: number[], action: 'select' | 'deselect'): void => {\n if (indices.length === 0) {\n return;\n }\n\n let updatedIndices: number[];\n if (action === 'select') {\n updatedIndices = [...selectedIndices];\n for (const index of indices) {\n if (index >= 0 && index <= options.length - 1 && !updatedIndices.includes(index)) {\n updatedIndices.push(index);\n }\n }\n } else {\n updatedIndices = selectedIndices.filter((selectedIndex) => !indices.includes(selectedIndex));\n }\n\n setIndices(updatedIndices);\n setChangeCallbackTriggerer(changeCallbackTriggerer + 1);\n };\n\n /**\n * Click listener for combobox (or any triggerer of the dropdown)\n */\n const onTriggerClick = (): void => {\n if (isOpen) {\n close();\n } else {\n setIsOpen(true);\n }\n };\n\n /**\n * Function that we call when we want to move focus from one option to other\n */\n const onOptionChange = (actionType: SelectActionsType, index?: number): void => {\n setActiveTagIndex(-1);\n const newIndex = index ?? activeIndex;\n let updatedIndex: number;\n const hasAutoComplete =\n rest.hasAutoCompleteInHeader ||\n dropdownTriggerer === dropdownComponentIds.triggers.AutoComplete;\n const treeViewController = rest.treeViewControllerRef?.current;\n if (treeViewController) {\n // When overlay content is a TreeView, traversal skips rows hidden under collapsed\n // branches (indices stay stable across expand / collapse, only traversal changes)\n const visibleIndexes = treeViewController.getVisibleOptionIndices();\n updatedIndex =\n visibleIndexes[\n getUpdatedIndex({\n currentIndex: visibleIndexes.indexOf(newIndex),\n maxIndex: visibleIndexes.length - 1,\n actionType,\n })\n ] ?? newIndex;\n } else if (hasAutoComplete && filteredValues.length > 0) {\n // When its autocomplete, we don't loop over all options. We only loop on filtered options\n\n const filteredIndexes = filteredValues\n .map((filteredValue) => options.findIndex((option) => option.value === filteredValue))\n .sort((a, b) => a - b);\n\n updatedIndex =\n filteredIndexes[\n getUpdatedIndex({\n currentIndex: filteredIndexes.indexOf(newIndex),\n maxIndex: filteredIndexes.length - 1,\n actionType,\n })\n ];\n } else {\n updatedIndex = getUpdatedIndex({\n currentIndex: newIndex,\n maxIndex: options.length - 1,\n actionType,\n });\n }\n setActiveIndex(updatedIndex);\n\n const optionValues = options.map((option) => option.value);\n ensureScrollVisiblity(updatedIndex, rest.actionListItemRef.current, optionValues);\n if (isBrowser()) {\n fireNativeEvent(rest.actionListItemRef as React.RefObject<HTMLElement>, ['change', 'input']);\n }\n };\n\n /**\n * Click handler when user clicks on any particular option.\n *\n * It\n * - changes the option focus\n * - selects that option\n * - moves focus to combobox\n */\n const onOptionClick = (\n e: React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLInputElement>,\n index: number,\n ): void => {\n setIsKeydownPressed(false);\n const actionType = getActionFromKey(e, isOpen, dropdownTriggerer);\n if (typeof actionType === 'number') {\n onOptionChange(actionType, index);\n }\n selectOption(index);\n\n if (!isReactNative()) {\n if (rest.hasAutoCompleteInHeader) {\n // move focus to autocomplete\n rest.headerAutoCompleteRef.current?.focus();\n } else {\n rest.triggererRef.current?.focus();\n }\n }\n };\n\n /**\n * Function we call to handle the typeahead.\n *\n * It takes a letter, stores that letter in searchString (and clears it after timeout) to maintain a word\n *\n * Then searches for that word in options and moves focus there.\n */\n const onComboType = (letter: string, actionType: SelectActionsType): void => {\n // open the listbox if it is closed\n setIsOpen(true);\n\n if (\n rest.hasAutoCompleteInHeader ||\n dropdownTriggerer === dropdownComponentIds.triggers.AutoComplete\n ) {\n return;\n }\n\n if (typeof searchTimeout === 'number') {\n window.clearTimeout(searchTimeout);\n }\n\n searchTimeout = window.setTimeout(() => {\n searchString = '';\n }, 500);\n // eslint-disable-next-line @typescript-eslint/restrict-plus-operands\n searchString = searchString + letter;\n const optionTitles = options.map((option) => option.title);\n const searchIndex = getIndexByLetter(optionTitles, searchString, activeIndex + 1);\n\n // if a match was found, go to it\n if (searchIndex >= 0) {\n onOptionChange(actionType, searchIndex);\n }\n // if no matches, clear the timeout and search string\n else {\n window.clearTimeout(searchTimeout);\n searchString = '';\n }\n };\n\n /**\n * Keydown event of combobox. Handles most of the keyboard accessibility of dropdown\n */\n const onTriggerKeydown = (e: {\n event: React.KeyboardEvent<HTMLInputElement | HTMLButtonElement>;\n }): void => {\n if (!isKeydownPressed && ![' ', 'Enter', 'Escape', 'Meta'].includes(e.event.key)) {\n // When keydown is not already pressed and its not Enter, Space, Command, or Escape key (those are generic keys and we only want to handle arrow keys or home buttons etc)\n setIsKeydownPressed(true);\n }\n\n const actionType = getActionFromKey(e.event, isOpen, dropdownTriggerer);\n\n if (actionType) {\n performAction(actionType, e, {\n setIsOpen,\n close,\n onOptionChange,\n onComboType,\n selectCurrentOption: (event) => {\n if (activeIndex < 0) {\n return;\n }\n\n // TreeView handles branch cascade toggles and load-more rows itself\n const treeViewController = rest.treeViewControllerRef?.current;\n if (treeViewController?.handleOptionSelect(activeIndex, { key: event?.key })) {\n return;\n }\n\n const isSelected = selectOption(activeIndex);\n if (rest.hasFooterAction && !isReactNative()) {\n rest.triggererRef.current?.focus();\n }\n\n options[activeIndex].onClickTrigger?.(isSelected);\n },\n // present only when overlay content is a TreeView; undefined keeps\n // ArrowLeft / ArrowRight behaviour unchanged for every other content\n onTreeExpandCollapse: rest.treeViewControllerRef?.current\n ? (action) => {\n if (action === 'Expand') {\n rest.treeViewControllerRef.current?.onArrowRightKeydown(activeIndex);\n } else {\n rest.treeViewControllerRef.current?.onArrowLeftKeydown(activeIndex);\n }\n }\n : undefined,\n });\n }\n };\n\n return {\n isOpen,\n setIsOpen,\n close,\n selectedIndices,\n setSelectedIndices,\n filteredValues,\n removeOption,\n selectOptionsBatch,\n setControlledValueIndices,\n onTriggerClick,\n onTriggerKeydown,\n onOptionClick,\n activeIndex,\n setActiveIndex,\n activeTagIndex,\n setActiveTagIndex,\n visibleTagsCountRef,\n isKeydownPressed,\n setIsKeydownPressed,\n changeCallbackTriggerer,\n setChangeCallbackTriggerer,\n isControlled,\n options,\n value: makeInputValue(selectedIndices, options),\n displayValue: makeInputDisplayValue(\n selectedIndices,\n options,\n rest.treeViewControllerRef?.current?.getDisplayOverride(selectedIndices),\n ),\n selectionType,\n dropdownTriggerer,\n ...rest,\n };\n};\n\nexport type { DropdownContextType, OptionsType, TreeViewDropdownControllerType };\nexport { useDropdown, DropdownContext };\n"],"names":["noop","DropdownContext","React","createContext","isOpen","setIsOpen","close","selectedIndices","setSelectedIndices","controlledValueIndices","setControlledValueIndices","options","setOptions","filteredValues","setFilteredValues","activeIndex","setActiveIndex","activeTagIndex","setActiveTagIndex","shouldIgnoreBlurAnimation","setShouldIgnoreBlurAnimation","hasFooterAction","setHasFooterAction","hasAutoCompleteInHeader","setHasAutoCompleteInHeader","isKeydownPressed","setIsKeydownPressed","changeCallbackTriggerer","setChangeCallbackTriggerer","isControlled","setIsControlled","dropdownBaseId","actionListItemRef","current","triggererRef","headerAutoCompleteRef","isTagDismissedRef","visibleTagsCountRef","triggererWrapperRef","treeViewControllerRef","searchTimeout","searchString","useDropdown","_rest$treeViewControl6","_React$useContext","useContext","selectionType","dropdownTriggerer","rest","_objectWithoutProperties","_excluded","setIndices","indices","removeOption","index","existingItemIndex","indexOf","concat","_toConsumableArray","slice","selectOption","properties","arguments","length","undefined","closeOnSelection","isSelected","includes","selectOptionsBatch","action","updatedIndices","_iterator","_createForOfIteratorHelper","_step","s","n","done","value","push","err","e","f","filter","selectedIndex","onTriggerClick","onOptionChange","actionType","_rest$treeViewControl","newIndex","updatedIndex","hasAutoComplete","dropdownComponentIds","triggers","AutoComplete","treeViewController","_visibleIndexes$getUp","visibleIndexes","getVisibleOptionIndices","getUpdatedIndex","currentIndex","maxIndex","filteredIndexes","map","filteredValue","findIndex","option","sort","a","b","optionValues","ensureScrollVisiblity","isBrowser","fireNativeEvent","onOptionClick","getActionFromKey","isReactNative","_rest$headerAutoCompl","focus","_rest$triggererRef$cu","onComboType","letter","window","clearTimeout","setTimeout","optionTitles","title","searchIndex","getIndexByLetter","onTriggerKeydown","event","key","_rest$treeViewControl3","performAction","selectCurrentOption","_rest$treeViewControl2","_options$activeIndex$","_options$activeIndex","handleOptionSelect","_rest$triggererRef$cu2","onClickTrigger","call","onTreeExpandCollapse","_rest$treeViewControl4","onArrowRightKeydown","_rest$treeViewControl5","on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BA,iBAAAA;AAAiB,GAAA,EACdC,IAAI,CAAA,CAAA;AAEX;;;;"}
|
|
@@ -21,9 +21,9 @@ import { getFocusRingStyles } from '../../utils/getFocusRingStyles/getFocusRingS
|
|
|
21
21
|
import { makeSpace } from '../../utils/makeSpace/makeSpace.js';
|
|
22
22
|
import { BaseBox } from '../Box/BaseBox/BaseBox.web.js';
|
|
23
23
|
import { makeBorderSize } from '../../utils/makeBorderSize/makeBorderSize.js';
|
|
24
|
+
import { Text } from '../Typography/Text/Text.js';
|
|
24
25
|
import { Box } from '../Box/Box.js';
|
|
25
26
|
import { Counter } from '../Counter/Counter.js';
|
|
26
|
-
import { Text } from '../Typography/Text/Text.js';
|
|
27
27
|
import { makeAccessible } from '../../utils/makeAccessible/makeAccessible.web.js';
|
|
28
28
|
import { getStyledProps } from '../Box/styledProps/getStyledProps.js';
|
|
29
29
|
import { makeAnalyticsAttribute } from '../../utils/makeAnalyticsAttribute/makeAnalyticsAttribute.js';
|
|
@@ -34,7 +34,7 @@ import CloseIcon from '../Icons/CloseIcon/CloseIcon.js';
|
|
|
34
34
|
import { assignWithoutSideEffects } from '../../utils/assignWithoutSideEffects/assignWithoutSideEffects.js';
|
|
35
35
|
import { MetaConstants } from '../../utils/metaAttribute/metaConstants.js';
|
|
36
36
|
|
|
37
|
-
var _excluded = ["value", "onClearButtonClick", "label", "isDisabled", "selectionType", "onClick", "onKeyDown", "accessibilityProps", "id"];
|
|
37
|
+
var _excluded = ["value", "onClearButtonClick", "label", "isDisabled", "selectionType", "showClearButton", "onClick", "onKeyDown", "accessibilityProps", "id"];
|
|
38
38
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
39
39
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
40
40
|
var getInteractiveFilterItemStyles = function getInteractiveFilterItemStyles(_ref) {
|
|
@@ -83,15 +83,17 @@ var StyledFilterTrigger = /*#__PURE__*/styled.button.withConfig({
|
|
|
83
83
|
componentId: "sc-7fl0tf-1"
|
|
84
84
|
})(function (_ref3) {
|
|
85
85
|
var theme = _ref3.theme,
|
|
86
|
-
$
|
|
86
|
+
$hasClearButton = _ref3.$hasClearButton;
|
|
87
87
|
var spacing = theme.spacing;
|
|
88
88
|
return _objectSpread({
|
|
89
89
|
backgroundColor: theme.colors.transparent,
|
|
90
|
-
|
|
90
|
+
// When a clear button follows the trigger its right corners butt against the divider,
|
|
91
|
+
// so they're squared off. Without a clear button the trigger is a self-contained pill.
|
|
92
|
+
borderRadius: $hasClearButton ? theme.border.radius.none : theme.border.radius.small,
|
|
91
93
|
borderTopLeftRadius: theme.border.radius.small,
|
|
92
94
|
borderBottomLeftRadius: theme.border.radius.small,
|
|
93
95
|
paddingLeft: makeSpace(spacing[4]),
|
|
94
|
-
paddingRight: $
|
|
96
|
+
paddingRight: $hasClearButton ? makeSpace(spacing[2]) : makeSpace(spacing[3]),
|
|
95
97
|
gap: makeSpace(spacing[2])
|
|
96
98
|
}, getInteractiveFilterItemStyles({
|
|
97
99
|
theme: theme
|
|
@@ -115,12 +117,31 @@ var StyledFilterCloseButton = /*#__PURE__*/styled.button.withConfig({
|
|
|
115
117
|
}));
|
|
116
118
|
});
|
|
117
119
|
var renderValue = function renderValue(selectionType, value, isDisabled) {
|
|
118
|
-
|
|
120
|
+
var valueColor = isDisabled ? 'interactive.text.gray.disabled' : 'interactive.text.gray.normal';
|
|
121
|
+
|
|
122
|
+
// For multiple selection: when a single option is selected we show its name (no redundant
|
|
123
|
+
// "1" counter); once more than one is selected we collapse to a compact counter.
|
|
124
|
+
// Use an explicit type guard so a non-array value (e.g. a plain string returned by
|
|
125
|
+
// getFilterChipDisplayValue) never enters the array branch where .length would be
|
|
126
|
+
// misinterpreted as character count.
|
|
127
|
+
if (selectionType === 'multiple') {
|
|
128
|
+
var valueArray = Array.isArray(value) ? value : value != null ? [value] : [];
|
|
129
|
+
if (valueArray.length === 1) {
|
|
130
|
+
var _valueArray$;
|
|
131
|
+
return /*#__PURE__*/jsx(Text, {
|
|
132
|
+
as: "span",
|
|
133
|
+
size: "small",
|
|
134
|
+
weight: "medium",
|
|
135
|
+
color: valueColor,
|
|
136
|
+
truncateAfterLines: 1,
|
|
137
|
+
children: String((_valueArray$ = valueArray[0]) !== null && _valueArray$ !== void 0 ? _valueArray$ : '')
|
|
138
|
+
});
|
|
139
|
+
}
|
|
119
140
|
return /*#__PURE__*/jsx(Box, {
|
|
120
141
|
display: "flex",
|
|
121
142
|
alignItems: "center",
|
|
122
143
|
children: /*#__PURE__*/jsx(Counter, {
|
|
123
|
-
value:
|
|
144
|
+
value: valueArray.length,
|
|
124
145
|
color: "neutral",
|
|
125
146
|
size: "small"
|
|
126
147
|
})
|
|
@@ -130,8 +151,8 @@ var renderValue = function renderValue(selectionType, value, isDisabled) {
|
|
|
130
151
|
as: "span",
|
|
131
152
|
size: "small",
|
|
132
153
|
weight: "medium",
|
|
133
|
-
color:
|
|
134
|
-
children: value
|
|
154
|
+
color: valueColor,
|
|
155
|
+
children: value != null ? String(value) : ''
|
|
135
156
|
});
|
|
136
157
|
};
|
|
137
158
|
var _BaseFilterChip = function _BaseFilterChip(_ref5, ref) {
|
|
@@ -142,18 +163,21 @@ var _BaseFilterChip = function _BaseFilterChip(_ref5, ref) {
|
|
|
142
163
|
isDisabled = _ref5.isDisabled,
|
|
143
164
|
_ref5$selectionType = _ref5.selectionType,
|
|
144
165
|
selectionType = _ref5$selectionType === void 0 ? 'single' : _ref5$selectionType,
|
|
166
|
+
_ref5$showClearButton = _ref5.showClearButton,
|
|
167
|
+
showClearButton = _ref5$showClearButton === void 0 ? true : _ref5$showClearButton,
|
|
145
168
|
_onClick = _ref5.onClick,
|
|
146
169
|
_onKeyDown = _ref5.onKeyDown,
|
|
147
170
|
accessibilityProps = _ref5.accessibilityProps,
|
|
148
171
|
id = _ref5.id,
|
|
149
172
|
rest = _objectWithoutProperties(_ref5, _excluded);
|
|
150
173
|
var isSelected = selectionType === 'multiple' ? Array.isArray(value) && value.length > 0 : !!value;
|
|
174
|
+
var shouldShowClearButton = isSelected && showClearButton;
|
|
151
175
|
return /*#__PURE__*/jsxs(StyledFilterChip, {
|
|
152
176
|
$isDisabled: isDisabled,
|
|
153
177
|
$isSelected: isSelected,
|
|
154
178
|
ref: ref,
|
|
155
179
|
children: [/*#__PURE__*/jsxs(StyledFilterTrigger, _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
156
|
-
$
|
|
180
|
+
$hasClearButton: shouldShowClearButton,
|
|
157
181
|
disabled: isDisabled,
|
|
158
182
|
id: id,
|
|
159
183
|
onClick: function onClick(e) {
|
|
@@ -191,7 +215,7 @@ var _BaseFilterChip = function _BaseFilterChip(_ref5, ref) {
|
|
|
191
215
|
color: "interactive.icon.gray.muted"
|
|
192
216
|
})
|
|
193
217
|
})]
|
|
194
|
-
})),
|
|
218
|
+
})), shouldShowClearButton ? /*#__PURE__*/jsxs(Fragment, {
|
|
195
219
|
children: [/*#__PURE__*/jsx(Divider, {
|
|
196
220
|
orientation: "vertical",
|
|
197
221
|
variant: isDisabled ? 'muted' : 'subtle'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseFilterChip.web.js","sources":["../../../../../../src/components/FilterChip/BaseFilterChip.web.tsx"],"sourcesContent":["import React from 'react';\nimport type { CSSObject } from 'styled-components';\nimport styled from 'styled-components';\nimport { FILTER_CHIP_HEIGHT } from './tokens';\nimport type { BaseFilterChipProps } from './types';\nimport { makeBorderSize, makeSpace } from '~utils';\nimport type { Theme } from '~components/BladeProvider';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport type { BladeElementRef } from '~utils/types';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\nimport { Box } from '~components/Box';\nimport BaseBox from '~components/Box/BaseBox';\nimport { Counter } from '~components/Counter';\nimport { Divider } from '~components/Divider';\nimport { ChevronDownIcon, CloseIcon } from '~components/Icons';\nimport { Text } from '~components/Typography';\nimport { getFocusRingStyles } from '~utils/getFocusRingStyles';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\n\nconst getInteractiveFilterItemStyles = ({ theme }: { theme: Theme }): CSSObject => {\n return {\n display: 'flex',\n height: '100%',\n alignItems: 'center',\n border: 'none',\n cursor: 'pointer',\n color: 'currentcolor',\n '&:not([disabled]):hover': {\n backgroundColor: theme.colors.interactive.background.gray.faded,\n },\n '&[disabled]': {\n cursor: 'not-allowed',\n },\n '&:focus-visible': {\n ...getFocusRingStyles({ theme }),\n outlineOffset: makeSpace(theme.spacing[1]),\n },\n };\n};\n\nconst StyledFilterChip = styled(BaseBox)<{ $isSelected?: boolean; $isDisabled?: boolean }>(\n ({ theme, $isDisabled, $isSelected }) => {\n return {\n borderWidth: makeBorderSize(theme.border.width.thin),\n borderColor: theme.colors.interactive.border.gray[$isDisabled ? 'disabled' : 'faded'],\n height: FILTER_CHIP_HEIGHT,\n borderRadius: theme.border.radius.small,\n display: 'flex',\n borderStyle: $isSelected ? 'solid' : 'dashed',\n backgroundColor: theme.colors.surface.background.gray.intense,\n color: theme.colors.interactive.text.gray[$isDisabled ? 'disabled' : 'muted'],\n width: 'fit-content',\n };\n },\n);\n\nconst StyledFilterTrigger = styled.button<{ $isSelected?: boolean }>(({ theme, $isSelected }) => {\n const { spacing } = theme;\n return {\n backgroundColor: theme.colors.transparent,\n borderRadius: $isSelected ? theme.border.radius.none : theme.border.radius.small,\n borderTopLeftRadius: theme.border.radius.small,\n borderBottomLeftRadius: theme.border.radius.small,\n paddingLeft: makeSpace(spacing[4]),\n paddingRight: $isSelected ? makeSpace(spacing[2]) : makeSpace(spacing[3]),\n gap: makeSpace(spacing[2]),\n ...getInteractiveFilterItemStyles({ theme }),\n };\n});\n\nconst StyledFilterCloseButton = styled.button(({ theme }) => {\n return {\n backgroundColor: theme.colors.transparent,\n borderTopRightRadius: theme.border.radius.small,\n borderBottomRightRadius: theme.border.radius.small,\n paddingLeft: makeSpace(theme.spacing[2] + theme.spacing[1]),\n paddingRight: makeSpace(theme.spacing[2] + theme.spacing[1]),\n justifyContent: 'center',\n alignItems: 'center',\n ...getInteractiveFilterItemStyles({ theme }),\n };\n});\n\nconst renderValue = (\n selectionType: BaseFilterChipProps['selectionType'],\n value: BaseFilterChipProps['value'],\n isDisabled?: boolean,\n): React.ReactElement => {\n if (selectionType === 'multiple' && Array.isArray(value)) {\n return (\n <Box display=\"flex\" alignItems=\"center\">\n <Counter value={value.length} color=\"neutral\" size=\"small\" />\n </Box>\n );\n }\n\n return (\n <Text\n as=\"span\"\n size=\"small\"\n weight=\"medium\"\n color={isDisabled ? 'interactive.text.gray.disabled' : 'interactive.text.gray.normal'}\n >\n {value}\n </Text>\n );\n};\n\nconst _BaseFilterChip: React.ForwardRefRenderFunction<BladeElementRef, BaseFilterChipProps> = (\n {\n value,\n onClearButtonClick,\n label,\n isDisabled,\n selectionType = 'single',\n onClick,\n onKeyDown,\n accessibilityProps,\n id,\n ...rest\n }: BaseFilterChipProps,\n ref: React.Ref<BladeElementRef>,\n): React.ReactElement => {\n const isSelected =\n selectionType === 'multiple' ? Array.isArray(value) && value.length > 0 : !!value;\n\n return (\n <StyledFilterChip\n $isDisabled={isDisabled}\n $isSelected={isSelected}\n ref={ref as React.Ref<HTMLDivElement>}\n >\n <StyledFilterTrigger\n $isSelected={isSelected}\n disabled={isDisabled}\n id={id}\n onClick={(e) => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onClick?.(e as any);\n }}\n onKeyDown={(e) => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onKeyDown?.(e as any);\n }}\n {...makeAccessible({\n ...accessibilityProps,\n role: accessibilityProps?.role ?? 'button',\n })}\n {...getStyledProps(rest)}\n {...makeAnalyticsAttribute(rest)}\n {...metaAttribute({ name: 'filter-chip-trigger', testID: rest.testID })}\n >\n <Box display=\"flex\" gap=\"spacing.2\" whiteSpace=\"nowrap\" alignItems=\"center\">\n <Text\n size=\"small\"\n weight=\"medium\"\n color=\"interactive.text.gray.subtle\"\n truncateAfterLines={1}\n >\n {label}\n {isSelected ? ':' : null}\n </Text>\n {isSelected ? renderValue(selectionType, value, isDisabled) : null}\n </Box>\n <Box display=\"flex\" alignItems=\"center\" paddingRight=\"spacing.1\">\n <ChevronDownIcon size=\"small\" color=\"interactive.icon.gray.muted\" />\n </Box>\n </StyledFilterTrigger>\n {isSelected ? (\n <>\n <Divider orientation=\"vertical\" variant={isDisabled ? 'muted' : 'subtle'} />\n <StyledFilterCloseButton\n aria-label={`Clear ${label} value`}\n // value can never be undefined because when it's undefined the button itself doesn't render/\n onClick={() => onClearButtonClick?.({ value: value ?? '' })}\n disabled={isDisabled}\n {...metaAttribute({ name: 'filter-chip-close-button' })}\n >\n <CloseIcon size=\"small\" color=\"interactive.icon.gray.muted\" />\n </StyledFilterCloseButton>\n </>\n ) : null}\n </StyledFilterChip>\n );\n};\n\nconst BaseFilterChip = assignWithoutSideEffects(React.forwardRef(_BaseFilterChip), {\n componentId: MetaConstants.BaseFilterChip,\n});\n\nexport { BaseFilterChip };\n"],"names":["getInteractiveFilterItemStyles","_ref","theme","display","height","alignItems","border","cursor","color","backgroundColor","colors","interactive","background","gray","faded","_objectSpread","getFocusRingStyles","outlineOffset","makeSpace","spacing","StyledFilterChip","styled","BaseBox","withConfig","displayName","componentId","_ref2","$isDisabled","$isSelected","borderWidth","makeBorderSize","width","thin","borderColor","FILTER_CHIP_HEIGHT","borderRadius","radius","small","borderStyle","surface","intense","text","StyledFilterTrigger","button","_ref3","transparent","none","borderTopLeftRadius","borderBottomLeftRadius","paddingLeft","paddingRight","gap","StyledFilterCloseButton","_ref4","borderTopRightRadius","borderBottomRightRadius","justifyContent","renderValue","selectionType","value","isDisabled","Array","isArray","_jsx","Box","children","Counter","length","size","Text","as","weight","_BaseFilterChip","_ref5","ref","_accessibilityProps$r","onClearButtonClick","label","_ref5$selectionType","onClick","onKeyDown","accessibilityProps","id","rest","_objectWithoutProperties","_excluded","isSelected","_jsxs","disabled","e","makeAccessible","role","getStyledProps","makeAnalyticsAttribute","metaAttribute","name","testID","whiteSpace","truncateAfterLines","ChevronDownIcon","_Fragment","Divider","orientation","variant","concat","CloseIcon","BaseFilterChip","assignWithoutSideEffects","React","forwardRef","MetaConstants"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBA,IAAMA,8BAA8B,GAAG,SAAjCA,8BAA8BA,CAAAC,IAAA,EAA+C;AAAA,EAAA,IAAzCC,KAAK,GAAAD,IAAA,CAALC,KAAK,CAAA;EAC7C,OAAO;AACLC,IAAAA,OAAO,EAAE,MAAM;AACfC,IAAAA,MAAM,EAAE,MAAM;AACdC,IAAAA,UAAU,EAAE,QAAQ;AACpBC,IAAAA,MAAM,EAAE,MAAM;AACdC,IAAAA,MAAM,EAAE,SAAS;AACjBC,IAAAA,KAAK,EAAE,cAAc;AACrB,IAAA,yBAAyB,EAAE;MACzBC,eAAe,EAAEP,KAAK,CAACQ,MAAM,CAACC,WAAW,CAACC,UAAU,CAACC,IAAI,CAACC,KAAAA;KAC3D;AACD,IAAA,aAAa,EAAE;AACbP,MAAAA,MAAM,EAAE,aAAA;KACT;AACD,IAAA,iBAAiB,EAAAQ,aAAA,CAAAA,aAAA,CAAA,EAAA,EACZC,kBAAkB,CAAC;AAAEd,MAAAA,KAAK,EAALA,KAAAA;AAAM,KA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CAAA,GAAA,KAAA,CAAA,GAAlBA,kBAAkB,CAAG;AAAEjB,YAAAA,KAAK,EAAEA,KAAK,KAAA,IAAA,IAALA,KAAK,KAAA,KAAA,CAAA,GAALA,KAAK,GAAI,EAAA;AAAG,WAAC,CAAC,CAAA;SAAC;AAC5D6B,QAAAA,QAAQ,EAAE5B,UAAAA;AAAW,OAAA,EACjBkC,aAAa,CAAC;AAAEC,QAAAA,IAAI,EAAE,0BAAA;AAA2B,OAAC,CAAC,CAAA,EAAA,EAAA,EAAA;QAAA9B,QAAA,eAEvDF,GAAA,CAAC0C,SAAS,EAAA;AAACrC,UAAAA,IAAI,EAAC,OAAO;AAAC5D,UAAAA,KAAK,EAAC,6BAAA;SAA+B,CAAA;AAAC,OAAA,CACvC,CAAC,CAAA;KAC1B,CAAC,GACD,IAAI,CAAA;AAAA,GACQ,CAAC,CAAA;AAEvB,CAAC,CAAA;AAEKkG,IAAAA,cAAc,gBAAGC,wBAAwB,cAACC,cAAK,CAACC,UAAU,CAACrC,eAAe,CAAC,EAAE;EACjF/C,WAAW,EAAEqF,aAAa,CAACJ,cAAAA;AAC7B,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"BaseFilterChip.web.js","sources":["../../../../../../src/components/FilterChip/BaseFilterChip.web.tsx"],"sourcesContent":["import React from 'react';\nimport type { CSSObject } from 'styled-components';\nimport styled from 'styled-components';\nimport { FILTER_CHIP_HEIGHT } from './tokens';\nimport type { BaseFilterChipProps } from './types';\nimport { makeBorderSize, makeSpace } from '~utils';\nimport type { Theme } from '~components/BladeProvider';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport type { BladeElementRef } from '~utils/types';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\nimport { Box } from '~components/Box';\nimport BaseBox from '~components/Box/BaseBox';\nimport { Counter } from '~components/Counter';\nimport { Divider } from '~components/Divider';\nimport { ChevronDownIcon, CloseIcon } from '~components/Icons';\nimport { Text } from '~components/Typography';\nimport { getFocusRingStyles } from '~utils/getFocusRingStyles';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\n\nconst getInteractiveFilterItemStyles = ({ theme }: { theme: Theme }): CSSObject => {\n return {\n display: 'flex',\n height: '100%',\n alignItems: 'center',\n border: 'none',\n cursor: 'pointer',\n color: 'currentcolor',\n '&:not([disabled]):hover': {\n backgroundColor: theme.colors.interactive.background.gray.faded,\n },\n '&[disabled]': {\n cursor: 'not-allowed',\n },\n '&:focus-visible': {\n ...getFocusRingStyles({ theme }),\n outlineOffset: makeSpace(theme.spacing[1]),\n },\n };\n};\n\nconst StyledFilterChip = styled(BaseBox)<{ $isSelected?: boolean; $isDisabled?: boolean }>(\n ({ theme, $isDisabled, $isSelected }) => {\n return {\n borderWidth: makeBorderSize(theme.border.width.thin),\n borderColor: theme.colors.interactive.border.gray[$isDisabled ? 'disabled' : 'faded'],\n height: FILTER_CHIP_HEIGHT,\n borderRadius: theme.border.radius.small,\n display: 'flex',\n borderStyle: $isSelected ? 'solid' : 'dashed',\n backgroundColor: theme.colors.surface.background.gray.intense,\n color: theme.colors.interactive.text.gray[$isDisabled ? 'disabled' : 'muted'],\n width: 'fit-content',\n };\n },\n);\n\nconst StyledFilterTrigger = styled.button<{ $hasClearButton?: boolean }>(\n ({ theme, $hasClearButton }) => {\n const { spacing } = theme;\n return {\n backgroundColor: theme.colors.transparent,\n // When a clear button follows the trigger its right corners butt against the divider,\n // so they're squared off. Without a clear button the trigger is a self-contained pill.\n borderRadius: $hasClearButton ? theme.border.radius.none : theme.border.radius.small,\n borderTopLeftRadius: theme.border.radius.small,\n borderBottomLeftRadius: theme.border.radius.small,\n paddingLeft: makeSpace(spacing[4]),\n paddingRight: $hasClearButton ? makeSpace(spacing[2]) : makeSpace(spacing[3]),\n gap: makeSpace(spacing[2]),\n ...getInteractiveFilterItemStyles({ theme }),\n };\n },\n);\n\nconst StyledFilterCloseButton = styled.button(({ theme }) => {\n return {\n backgroundColor: theme.colors.transparent,\n borderTopRightRadius: theme.border.radius.small,\n borderBottomRightRadius: theme.border.radius.small,\n paddingLeft: makeSpace(theme.spacing[2] + theme.spacing[1]),\n paddingRight: makeSpace(theme.spacing[2] + theme.spacing[1]),\n justifyContent: 'center',\n alignItems: 'center',\n ...getInteractiveFilterItemStyles({ theme }),\n };\n});\n\nconst renderValue = (\n selectionType: BaseFilterChipProps['selectionType'],\n value: BaseFilterChipProps['value'],\n isDisabled?: boolean,\n): React.ReactElement => {\n const valueColor = isDisabled ? 'interactive.text.gray.disabled' : 'interactive.text.gray.normal';\n\n // For multiple selection: when a single option is selected we show its name (no redundant\n // \"1\" counter); once more than one is selected we collapse to a compact counter.\n // Use an explicit type guard so a non-array value (e.g. a plain string returned by\n // getFilterChipDisplayValue) never enters the array branch where .length would be\n // misinterpreted as character count.\n if (selectionType === 'multiple') {\n const valueArray = Array.isArray(value) ? value : value != null ? [value] : [];\n if (valueArray.length === 1) {\n return (\n <Text as=\"span\" size=\"small\" weight=\"medium\" color={valueColor} truncateAfterLines={1}>\n {String(valueArray[0] ?? '')}\n </Text>\n );\n }\n return (\n <Box display=\"flex\" alignItems=\"center\">\n <Counter value={valueArray.length} color=\"neutral\" size=\"small\" />\n </Box>\n );\n }\n\n return (\n <Text as=\"span\" size=\"small\" weight=\"medium\" color={valueColor}>\n {value != null ? String(value) : ''}\n </Text>\n );\n};\n\nconst _BaseFilterChip: React.ForwardRefRenderFunction<BladeElementRef, BaseFilterChipProps> = (\n {\n value,\n onClearButtonClick,\n label,\n isDisabled,\n selectionType = 'single',\n showClearButton = true,\n onClick,\n onKeyDown,\n accessibilityProps,\n id,\n ...rest\n }: BaseFilterChipProps,\n ref: React.Ref<BladeElementRef>,\n): React.ReactElement => {\n const isSelected =\n selectionType === 'multiple' ? Array.isArray(value) && value.length > 0 : !!value;\n const shouldShowClearButton = isSelected && showClearButton;\n\n return (\n <StyledFilterChip\n $isDisabled={isDisabled}\n $isSelected={isSelected}\n ref={ref as React.Ref<HTMLDivElement>}\n >\n <StyledFilterTrigger\n $hasClearButton={shouldShowClearButton}\n disabled={isDisabled}\n id={id}\n onClick={(e) => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onClick?.(e as any);\n }}\n onKeyDown={(e) => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onKeyDown?.(e as any);\n }}\n {...makeAccessible({\n ...accessibilityProps,\n role: accessibilityProps?.role ?? 'button',\n })}\n {...getStyledProps(rest)}\n {...makeAnalyticsAttribute(rest)}\n {...metaAttribute({ name: 'filter-chip-trigger', testID: rest.testID })}\n >\n <Box display=\"flex\" gap=\"spacing.2\" whiteSpace=\"nowrap\" alignItems=\"center\">\n <Text\n size=\"small\"\n weight=\"medium\"\n color=\"interactive.text.gray.subtle\"\n truncateAfterLines={1}\n >\n {label}\n {isSelected ? ':' : null}\n </Text>\n {isSelected ? renderValue(selectionType, value, isDisabled) : null}\n </Box>\n <Box display=\"flex\" alignItems=\"center\" paddingRight=\"spacing.1\">\n <ChevronDownIcon size=\"small\" color=\"interactive.icon.gray.muted\" />\n </Box>\n </StyledFilterTrigger>\n {shouldShowClearButton ? (\n <>\n <Divider orientation=\"vertical\" variant={isDisabled ? 'muted' : 'subtle'} />\n <StyledFilterCloseButton\n aria-label={`Clear ${label} value`}\n // value can never be undefined because when it's undefined the button itself doesn't render/\n onClick={() => onClearButtonClick?.({ value: value ?? '' })}\n disabled={isDisabled}\n {...metaAttribute({ name: 'filter-chip-close-button' })}\n >\n <CloseIcon size=\"small\" color=\"interactive.icon.gray.muted\" />\n </StyledFilterCloseButton>\n </>\n ) : null}\n </StyledFilterChip>\n );\n};\n\nconst BaseFilterChip = assignWithoutSideEffects(React.forwardRef(_BaseFilterChip), {\n componentId: MetaConstants.BaseFilterChip,\n});\n\nexport { BaseFilterChip };\n"],"names":["getInteractiveFilterItemStyles","_ref","theme","display","height","alignItems","border","cursor","color","backgroundColor","colors","interactive","background","gray","faded","_objectSpread","getFocusRingStyles","outlineOffset","makeSpace","spacing","StyledFilterChip","styled","BaseBox","withConfig","displayName","componentId","_ref2","$isDisabled","$isSelected","borderWidth","makeBorderSize","width","thin","borderColor","FILTER_CHIP_HEIGHT","borderRadius","radius","small","borderStyle","surface","intense","text","StyledFilterTrigger","button","_ref3","$hasClearButton","transparent","none","borderTopLeftRadius","borderBottomLeftRadius","paddingLeft","paddingRight","gap","StyledFilterCloseButton","_ref4","borderTopRightRadius","borderBottomRightRadius","justifyContent","renderValue","selectionType","value","isDisabled","valueColor","valueArray","Array","isArray","length","_valueArray$","_jsx","Text","as","size","weight","truncateAfterLines","children","String","Box","Counter","_BaseFilterChip","_ref5","ref","_accessibilityProps$r","onClearButtonClick","label","_ref5$selectionType","_ref5$showClearButton","showClearButton","onClick","onKeyDown","accessibilityProps","id","rest","_objectWithoutProperties","_excluded","isSelected","shouldShowClearButton","_jsxs","disabled","e","makeAccessible","role","getStyledProps","makeAnalyticsAttribute","metaAttribute","name","testID","whiteSpace","ChevronDownIcon","_Fragment","Divider","orientation","variant","concat","CloseIcon","BaseFilterChip","assignWithoutSideEffects","React","forwardRef","MetaConstants"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBA,IAAMA,8BAA8B,GAAG,SAAjCA,8BAA8BA,CAAAC,IAAA,EAA+C;AAAA,EAAA,IAAzCC,KAAK,GAAAD,IAAA,CAALC,KAAK,CAAA;EAC7C,OAAO;AACLC,IAAAA,OAAO,EAAE,MAAM;AACfC,IAAAA,MAAM,EAAE,MAAM;AACdC,IAAAA,UAAU,EAAE,QAAQ;AACpBC,IAAAA,MAAM,EAAE,MAAM;AACdC,IAAAA,MAAM,EAAE,SAAS;AACjBC,IAAAA,KAAK,EAAE,cAAc;AACrB,IAAA,yBAAyB,EAAE;MACzBC,eAAe,EAAEP,KAAK,CAACQ,MAAM,CAACC,WAAW,CAACC,UAAU,CAACC,IAAI,CAACC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