@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
package/build/lib/web/development/components/SegmentedControl/SegmentedControlIndicator.web.js
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
2
|
+
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
3
|
+
import React__default from 'react';
|
|
4
|
+
import { useSegmentedControlContext } from './SegmentedControlContext.js';
|
|
5
|
+
import { itemBorderRadius } from './segmentedControlTokens.js';
|
|
6
|
+
import '../../utils/index.js';
|
|
7
|
+
import '../BladeProvider/index.js';
|
|
8
|
+
import { useIsomorphicLayoutEffect } from '../../utils/useIsomorphicLayoutEffect.js';
|
|
9
|
+
import { useResize } from '../../utils/useResize.js';
|
|
10
|
+
import '../Box/BaseBox/index.js';
|
|
11
|
+
import { jsx } from 'react/jsx-runtime';
|
|
12
|
+
import useTheme from '../BladeProvider/useTheme.js';
|
|
13
|
+
import { castWebType } from '../../utils/platform/castUtils.js';
|
|
14
|
+
import { makeMotionTime } from '../../utils/makeMotionTime/makeMotionTime.web.js';
|
|
15
|
+
import { makeSpace } from '../../utils/makeSpace/makeSpace.js';
|
|
16
|
+
import { BaseBox } from '../Box/BaseBox/BaseBox.web.js';
|
|
17
|
+
|
|
18
|
+
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; }
|
|
19
|
+
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; }
|
|
20
|
+
var SegmentedControlIndicator = function SegmentedControlIndicator(_ref) {
|
|
21
|
+
var containerRef = _ref.containerRef;
|
|
22
|
+
var _useTheme = useTheme(),
|
|
23
|
+
theme = _useTheme.theme;
|
|
24
|
+
var _useSegmentedControlC = useSegmentedControlContext(),
|
|
25
|
+
selectedValue = _useSegmentedControlC.selectedValue,
|
|
26
|
+
size = _useSegmentedControlC.size,
|
|
27
|
+
itemRefs = _useSegmentedControlC.itemRefs;
|
|
28
|
+
var _React$useState = React__default.useState(false),
|
|
29
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
30
|
+
shouldAnimate = _React$useState2[0],
|
|
31
|
+
setShouldAnimate = _React$useState2[1];
|
|
32
|
+
var _React$useState3 = React__default.useState({
|
|
33
|
+
width: 0,
|
|
34
|
+
height: 0,
|
|
35
|
+
x: 0,
|
|
36
|
+
y: 0
|
|
37
|
+
}),
|
|
38
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
39
|
+
dimensions = _React$useState4[0],
|
|
40
|
+
setDimensions = _React$useState4[1];
|
|
41
|
+
var updateDimensions = React__default.useCallback(function () {
|
|
42
|
+
if (!selectedValue || !itemRefs) return;
|
|
43
|
+
var activeItem = itemRefs.current.get(selectedValue);
|
|
44
|
+
var container = containerRef.current;
|
|
45
|
+
if (!activeItem || !container || activeItem.offsetWidth === 0) return;
|
|
46
|
+
var containerRect = container.getBoundingClientRect();
|
|
47
|
+
var itemRect = activeItem.getBoundingClientRect();
|
|
48
|
+
setDimensions({
|
|
49
|
+
width: activeItem.offsetWidth,
|
|
50
|
+
height: activeItem.offsetHeight,
|
|
51
|
+
x: itemRect.left - containerRect.left,
|
|
52
|
+
y: itemRect.top - containerRect.top
|
|
53
|
+
});
|
|
54
|
+
}, [selectedValue, itemRefs, containerRef]);
|
|
55
|
+
useIsomorphicLayoutEffect(function () {
|
|
56
|
+
if (!selectedValue) return;
|
|
57
|
+
updateDimensions();
|
|
58
|
+
}, [selectedValue, updateDimensions]);
|
|
59
|
+
var updateDimensionsRef = React__default.useRef(updateDimensions);
|
|
60
|
+
updateDimensionsRef.current = updateDimensions;
|
|
61
|
+
React__default.useEffect(function () {
|
|
62
|
+
if ('fonts' in document) {
|
|
63
|
+
try {
|
|
64
|
+
void document.fonts.ready.then(function () {
|
|
65
|
+
updateDimensionsRef.current();
|
|
66
|
+
});
|
|
67
|
+
} catch (_unused) {
|
|
68
|
+
/* empty */
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
// Runs once on mount — document.fonts.ready only needs to be awaited a single time.
|
|
72
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
73
|
+
}, []);
|
|
74
|
+
useResize(containerRef, updateDimensions);
|
|
75
|
+
|
|
76
|
+
// Enable animation only after the first paint with real dimensions.
|
|
77
|
+
// useEffect fires after the browser paints, guaranteeing the initial
|
|
78
|
+
// position is committed before transitions are turned on.
|
|
79
|
+
React__default.useEffect(function () {
|
|
80
|
+
if (dimensions.width > 0) {
|
|
81
|
+
setShouldAnimate(true);
|
|
82
|
+
}
|
|
83
|
+
}, [dimensions.width]);
|
|
84
|
+
|
|
85
|
+
// Nothing to show until dimensions are measured — avoids a 0×0 flash.
|
|
86
|
+
if (!dimensions.width) return null;
|
|
87
|
+
var transitionProps = {
|
|
88
|
+
transitionProperty: 'transform',
|
|
89
|
+
transitionDuration: shouldAnimate ? castWebType(makeMotionTime(theme.motion.duration.moderate)) : '0ms',
|
|
90
|
+
transitionTimingFunction: castWebType(theme.motion.easing.standard)
|
|
91
|
+
};
|
|
92
|
+
var borderRadiusValue = makeSpace(theme.border.radius[itemBorderRadius[size]]);
|
|
93
|
+
return /*#__PURE__*/jsx(BaseBox, {
|
|
94
|
+
pointerEvents: "none",
|
|
95
|
+
position: "absolute",
|
|
96
|
+
left: "0px",
|
|
97
|
+
top: "0px",
|
|
98
|
+
backgroundColor: "surface.background.gray.intense",
|
|
99
|
+
style: _objectSpread(_objectSpread({}, transitionProps), {}, {
|
|
100
|
+
borderRadius: borderRadiusValue,
|
|
101
|
+
width: "".concat(dimensions.width, "px"),
|
|
102
|
+
height: "".concat(dimensions.height, "px"),
|
|
103
|
+
transform: "translate(".concat(dimensions.x, "px, ").concat(dimensions.y, "px)")
|
|
104
|
+
})
|
|
105
|
+
});
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
export { SegmentedControlIndicator };
|
|
109
|
+
//# sourceMappingURL=SegmentedControlIndicator.web.js.map
|
package/build/lib/web/development/components/SegmentedControl/SegmentedControlIndicator.web.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SegmentedControlIndicator.web.js","sources":["../../../../../../src/components/SegmentedControl/SegmentedControlIndicator.web.tsx"],"sourcesContent":["import React from 'react';\nimport { useSegmentedControlContext } from './SegmentedControlContext';\nimport { itemBorderRadius } from './segmentedControlTokens';\nimport { castWebType, makeMotionTime, makeSpace } from '~utils';\nimport { useTheme } from '~components/BladeProvider';\nimport { useIsomorphicLayoutEffect } from '~utils/useIsomorphicLayoutEffect';\nimport { useResize } from '~utils/useResize';\nimport BaseBox from '~components/Box/BaseBox';\n\nconst SegmentedControlIndicator = ({\n containerRef,\n}: {\n containerRef: React.RefObject<HTMLElement | null>;\n}): React.ReactElement | null => {\n const { theme } = useTheme();\n const { selectedValue, size, itemRefs } = useSegmentedControlContext();\n const [shouldAnimate, setShouldAnimate] = React.useState(false);\n const [dimensions, setDimensions] = React.useState({ width: 0, height: 0, x: 0, y: 0 });\n\n const updateDimensions = React.useCallback(() => {\n if (!selectedValue || !itemRefs) return;\n const activeItem = itemRefs.current.get(selectedValue);\n const container = containerRef.current;\n if (!activeItem || !container || activeItem.offsetWidth === 0) return;\n\n const containerRect = container.getBoundingClientRect();\n const itemRect = activeItem.getBoundingClientRect();\n\n setDimensions({\n width: activeItem.offsetWidth,\n height: activeItem.offsetHeight,\n x: itemRect.left - containerRect.left,\n y: itemRect.top - containerRect.top,\n });\n }, [selectedValue, itemRefs, containerRef]);\n\n useIsomorphicLayoutEffect(() => {\n if (!selectedValue) return;\n updateDimensions();\n }, [selectedValue, updateDimensions]);\n\n const updateDimensionsRef = React.useRef(updateDimensions);\n updateDimensionsRef.current = updateDimensions;\n\n React.useEffect(() => {\n if ('fonts' in document) {\n try {\n void document.fonts.ready.then(() => {\n updateDimensionsRef.current();\n });\n } catch {\n /* empty */\n }\n }\n // Runs once on mount — document.fonts.ready only needs to be awaited a single time.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n useResize(containerRef, updateDimensions);\n\n // Enable animation only after the first paint with real dimensions.\n // useEffect fires after the browser paints, guaranteeing the initial\n // position is committed before transitions are turned on.\n React.useEffect(() => {\n if (dimensions.width > 0) {\n setShouldAnimate(true);\n }\n }, [dimensions.width]);\n\n // Nothing to show until dimensions are measured — avoids a 0×0 flash.\n if (!dimensions.width) return null;\n\n const transitionProps = {\n transitionProperty: 'transform',\n transitionDuration: shouldAnimate\n ? castWebType(makeMotionTime(theme.motion.duration.moderate))\n : '0ms',\n transitionTimingFunction: castWebType(theme.motion.easing.standard),\n };\n\n const borderRadiusValue = makeSpace(theme.border.radius[itemBorderRadius[size]]);\n\n return (\n <BaseBox\n pointerEvents=\"none\"\n position=\"absolute\"\n left=\"0px\"\n top=\"0px\"\n backgroundColor=\"surface.background.gray.intense\"\n style={{\n ...transitionProps,\n borderRadius: borderRadiusValue,\n width: `${dimensions.width}px`,\n height: `${dimensions.height}px`,\n transform: `translate(${dimensions.x}px, ${dimensions.y}px)`,\n }}\n />\n );\n};\n\nexport { SegmentedControlIndicator };\n"],"names":["SegmentedControlIndicator","_ref","containerRef","_useTheme","useTheme","theme","_useSegmentedControlC","useSegmentedControlContext","selectedValue","size","itemRefs","_React$useState","React","useState","_React$useState2","_slicedToArray","shouldAnimate","setShouldAnimate","_React$useState3","width","height","x","y","_React$useState4","dimensions","setDimensions","updateDimensions","useCallback","activeItem","current","get","container","offsetWidth","containerRect","getBoundingClientRect","itemRect","offsetHeight","left","top","useIsomorphicLayoutEffect","updateDimensionsRef","useRef","useEffect","document","fonts","ready","then","_unused","useResize","transitionProps","transitionProperty","transitionDuration","castWebType","makeMotionTime","motion","duration","moderate","transitionTimingFunction","easing","standard","borderRadiusValue","makeSpace","border","radius","itemBorderRadius","_jsx","BaseBox","pointerEvents","position","backgroundColor","style","_obj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/BzC,MAAAA,KAAK,KAAAsD,MAAA,CAAKjD,UAAU,CAACL,KAAK,EAAI,IAAA,CAAA;AAC9BC,MAAAA,MAAM,KAAAqD,MAAA,CAAKjD,UAAU,CAACJ,MAAM,EAAI,IAAA,CAAA;MAChCsD,SAAS,EAAA,YAAA,CAAAD,MAAA,CAAejD,UAAU,CAACH,CAAC,EAAA,MAAA,CAAA,CAAAoD,MAAA,CAAOjD,UAAU,CAACF,CAAC,EAAA,KAAA,CAAA;AAAK,KAAA,CAAA;AAC5D,GACH,CAAC,CAAA;AAEN;;;;"}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
2
|
+
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
3
|
+
import React__default from 'react';
|
|
4
|
+
import styled from 'styled-components';
|
|
5
|
+
import { useSegmentedControlContext } from './SegmentedControlContext.js';
|
|
6
|
+
import { itemHeight, paddingY, paddingX, itemBorderRadius, iconSizeMap, textSizeMap } from './segmentedControlTokens.js';
|
|
7
|
+
import '../Typography/index.js';
|
|
8
|
+
import '../../utils/index.js';
|
|
9
|
+
import '../../utils/makeAccessible/index.js';
|
|
10
|
+
import '../../utils/metaAttribute/index.js';
|
|
11
|
+
import '../../utils/makeAnalyticsAttribute/index.js';
|
|
12
|
+
import getIn from '../../utils/lodashButBetter/get.js';
|
|
13
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
14
|
+
import { makeSpace } from '../../utils/makeSpace/makeSpace.js';
|
|
15
|
+
import { castWebType } from '../../utils/platform/castUtils.js';
|
|
16
|
+
import { makeMotionTime } from '../../utils/makeMotionTime/makeMotionTime.web.js';
|
|
17
|
+
import { makeAccessible } from '../../utils/makeAccessible/makeAccessible.web.js';
|
|
18
|
+
import { metaAttribute } from '../../utils/metaAttribute/metaAttribute.web.js';
|
|
19
|
+
import { MetaConstants } from '../../utils/metaAttribute/metaConstants.js';
|
|
20
|
+
import { makeAnalyticsAttribute } from '../../utils/makeAnalyticsAttribute/makeAnalyticsAttribute.js';
|
|
21
|
+
import { Text } from '../Typography/Text/Text.js';
|
|
22
|
+
|
|
23
|
+
var _excluded = ["children", "value", "leading", "isDisabled", "accessibilityLabel", "testID"];
|
|
24
|
+
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; }
|
|
25
|
+
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; }
|
|
26
|
+
var StyledSegmentedControlButton = /*#__PURE__*/styled.button.withConfig({
|
|
27
|
+
displayName: "SegmentedControlItemweb__StyledSegmentedControlButton",
|
|
28
|
+
componentId: "i0wihp-0"
|
|
29
|
+
})(function (_ref) {
|
|
30
|
+
var theme = _ref.theme,
|
|
31
|
+
$size = _ref.$size,
|
|
32
|
+
$isSelected = _ref.$isSelected;
|
|
33
|
+
return {
|
|
34
|
+
appearance: 'none',
|
|
35
|
+
border: 'none',
|
|
36
|
+
cursor: 'pointer',
|
|
37
|
+
display: 'inline-flex',
|
|
38
|
+
alignItems: 'center',
|
|
39
|
+
justifyContent: 'center',
|
|
40
|
+
gap: makeSpace(theme.spacing[3]),
|
|
41
|
+
flex: 1,
|
|
42
|
+
height: makeSpace(itemHeight[$size]),
|
|
43
|
+
paddingTop: makeSpace(getIn(theme, paddingY[$size])),
|
|
44
|
+
paddingBottom: makeSpace(getIn(theme, paddingY[$size])),
|
|
45
|
+
paddingLeft: makeSpace(getIn(theme, paddingX[$size])),
|
|
46
|
+
paddingRight: makeSpace(getIn(theme, paddingX[$size])),
|
|
47
|
+
backgroundColor: 'transparent',
|
|
48
|
+
borderRadius: makeSpace(theme.border.radius[itemBorderRadius[$size]]),
|
|
49
|
+
position: 'relative',
|
|
50
|
+
zIndex: 1,
|
|
51
|
+
transitionProperty: 'background-color',
|
|
52
|
+
transitionTimingFunction: castWebType(theme.motion.easing.standard),
|
|
53
|
+
transitionDuration: castWebType(makeMotionTime(theme.motion.duration.gentle)),
|
|
54
|
+
'&:hover:not(:disabled)': {
|
|
55
|
+
backgroundColor: $isSelected ? 'transparent' : theme.colors.interactive.background.gray["default"]
|
|
56
|
+
},
|
|
57
|
+
'&:focus:not(:focus-visible)': {
|
|
58
|
+
outline: 'none'
|
|
59
|
+
},
|
|
60
|
+
'&:focus-visible': {
|
|
61
|
+
outline: 'none',
|
|
62
|
+
boxShadow: "inset 0px 0px 0px 4px ".concat(theme.colors.surface.border.primary.muted)
|
|
63
|
+
},
|
|
64
|
+
'&:disabled': {
|
|
65
|
+
cursor: 'not-allowed',
|
|
66
|
+
backgroundColor: 'transparent'
|
|
67
|
+
},
|
|
68
|
+
'&:disabled:hover': {
|
|
69
|
+
backgroundColor: 'transparent'
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
});
|
|
73
|
+
var SegmentedControlItem = function SegmentedControlItem(_ref2) {
|
|
74
|
+
var children = _ref2.children,
|
|
75
|
+
value = _ref2.value,
|
|
76
|
+
Leading = _ref2.leading,
|
|
77
|
+
_ref2$isDisabled = _ref2.isDisabled,
|
|
78
|
+
isItemDisabled = _ref2$isDisabled === void 0 ? false : _ref2$isDisabled,
|
|
79
|
+
accessibilityLabel = _ref2.accessibilityLabel,
|
|
80
|
+
testID = _ref2.testID,
|
|
81
|
+
rest = _objectWithoutProperties(_ref2, _excluded);
|
|
82
|
+
var _useSegmentedControlC = useSegmentedControlContext(),
|
|
83
|
+
selectedValue = _useSegmentedControlC.selectedValue,
|
|
84
|
+
setSelectedValue = _useSegmentedControlC.setSelectedValue,
|
|
85
|
+
size = _useSegmentedControlC.size,
|
|
86
|
+
isGroupDisabled = _useSegmentedControlC.isDisabled,
|
|
87
|
+
baseId = _useSegmentedControlC.baseId,
|
|
88
|
+
totalItems = _useSegmentedControlC.totalItems,
|
|
89
|
+
firstEnabledValue = _useSegmentedControlC.firstEnabledValue,
|
|
90
|
+
itemRefs = _useSegmentedControlC.itemRefs;
|
|
91
|
+
var buttonRef = React__default.useRef(null);
|
|
92
|
+
var isSelected = selectedValue === value;
|
|
93
|
+
var isDisabled = isGroupDisabled || isItemDisabled;
|
|
94
|
+
var shouldReceiveFocus = !isDisabled && isSelected || selectedValue === undefined && !isDisabled && value === firstEnabledValue;
|
|
95
|
+
React__default.useEffect(function () {
|
|
96
|
+
if (!itemRefs) return undefined;
|
|
97
|
+
var map = itemRefs.current;
|
|
98
|
+
var node = buttonRef.current;
|
|
99
|
+
if (node) map.set(value, node);
|
|
100
|
+
return function () {
|
|
101
|
+
map["delete"](value);
|
|
102
|
+
};
|
|
103
|
+
}, [value, itemRefs]);
|
|
104
|
+
var handleKeyDown = React__default.useCallback(function (e) {
|
|
105
|
+
var _buttonRef$current;
|
|
106
|
+
var container = (_buttonRef$current = buttonRef.current) === null || _buttonRef$current === void 0 ? void 0 : _buttonRef$current.closest('[role="radiogroup"]');
|
|
107
|
+
if (!container) return;
|
|
108
|
+
var buttons = Array.from(container.querySelectorAll('[role="radio"]:not(:disabled)'));
|
|
109
|
+
var currentIndex = buttons.indexOf(buttonRef.current);
|
|
110
|
+
var nextIndex = -1;
|
|
111
|
+
if (e.key === 'ArrowRight' || e.key === 'ArrowDown') {
|
|
112
|
+
nextIndex = (currentIndex + 1) % buttons.length;
|
|
113
|
+
} else if (e.key === 'ArrowLeft' || e.key === 'ArrowUp') {
|
|
114
|
+
nextIndex = (currentIndex - 1 + buttons.length) % buttons.length;
|
|
115
|
+
} else if (e.key === 'Home') {
|
|
116
|
+
nextIndex = 0;
|
|
117
|
+
} else if (e.key === 'End') {
|
|
118
|
+
nextIndex = buttons.length - 1;
|
|
119
|
+
}
|
|
120
|
+
if (nextIndex >= 0) {
|
|
121
|
+
e.preventDefault();
|
|
122
|
+
var nextEl = buttons[nextIndex];
|
|
123
|
+
nextEl.focus();
|
|
124
|
+
setSelectedValue(function () {
|
|
125
|
+
var _nextEl$dataset$value;
|
|
126
|
+
return (_nextEl$dataset$value = nextEl.dataset.value) !== null && _nextEl$dataset$value !== void 0 ? _nextEl$dataset$value : '';
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
}, [setSelectedValue]);
|
|
130
|
+
var textColor = isDisabled ? 'interactive.text.gray.disabled' : isSelected ? 'interactive.text.gray.normal' : 'interactive.text.gray.muted';
|
|
131
|
+
var iconColor = isDisabled ? 'interactive.icon.gray.disabled' : isSelected ? 'interactive.icon.gray.normal' : 'interactive.icon.gray.muted';
|
|
132
|
+
return /*#__PURE__*/jsxs(StyledSegmentedControlButton, _objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
133
|
+
ref: buttonRef,
|
|
134
|
+
type: "button",
|
|
135
|
+
id: "".concat(baseId, "-").concat(value, "-item"),
|
|
136
|
+
"data-value": value,
|
|
137
|
+
tabIndex: shouldReceiveFocus ? 0 : -1,
|
|
138
|
+
$size: size,
|
|
139
|
+
$isSelected: isSelected,
|
|
140
|
+
disabled: isDisabled,
|
|
141
|
+
onClick: function onClick() {
|
|
142
|
+
setSelectedValue(function () {
|
|
143
|
+
return value;
|
|
144
|
+
});
|
|
145
|
+
},
|
|
146
|
+
onKeyDown: handleKeyDown
|
|
147
|
+
}, makeAccessible({
|
|
148
|
+
role: 'radio',
|
|
149
|
+
checked: isSelected,
|
|
150
|
+
label: accessibilityLabel,
|
|
151
|
+
setSize: totalItems
|
|
152
|
+
})), metaAttribute({
|
|
153
|
+
name: MetaConstants.SegmentedControlItem,
|
|
154
|
+
testID: testID
|
|
155
|
+
})), makeAnalyticsAttribute(rest)), {}, {
|
|
156
|
+
children: [Leading ? /*#__PURE__*/jsx(Leading, {
|
|
157
|
+
size: iconSizeMap[size],
|
|
158
|
+
color: iconColor
|
|
159
|
+
}) : null, children ? /*#__PURE__*/jsx(Text, {
|
|
160
|
+
as: "span",
|
|
161
|
+
color: textColor,
|
|
162
|
+
size: textSizeMap[size],
|
|
163
|
+
weight: "medium",
|
|
164
|
+
children: children
|
|
165
|
+
}) : null]
|
|
166
|
+
}));
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
export { SegmentedControlItem };
|
|
170
|
+
//# sourceMappingURL=SegmentedControlItem.web.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SegmentedControlItem.web.js","sources":["../../../../../../src/components/SegmentedControl/SegmentedControlItem.web.tsx"],"sourcesContent":["import React from 'react';\nimport styled from 'styled-components';\nimport type { SegmentedControlItemProps, SegmentedControlSize } from './types';\nimport { useSegmentedControlContext } from './SegmentedControlContext';\nimport {\n paddingX,\n paddingY,\n textSizeMap,\n iconSizeMap,\n itemBorderRadius,\n itemHeight,\n} from './segmentedControlTokens';\nimport { Text } from '~components/Typography';\nimport { makeSpace, castWebType, makeMotionTime } from '~utils';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\nimport getIn from '~utils/lodashButBetter/get';\n\nconst StyledSegmentedControlButton = styled.button<{\n $size: SegmentedControlSize;\n $isSelected: boolean;\n}>(({ theme, $size, $isSelected }) => ({\n appearance: 'none',\n border: 'none',\n cursor: 'pointer',\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n gap: makeSpace(theme.spacing[3]),\n flex: 1,\n height: makeSpace(itemHeight[$size]),\n\n paddingTop: makeSpace(getIn(theme, paddingY[$size])),\n paddingBottom: makeSpace(getIn(theme, paddingY[$size])),\n paddingLeft: makeSpace(getIn(theme, paddingX[$size])),\n paddingRight: makeSpace(getIn(theme, paddingX[$size])),\n\n backgroundColor: 'transparent',\n borderRadius: makeSpace(theme.border.radius[itemBorderRadius[$size]]),\n\n position: 'relative' as const,\n zIndex: 1,\n\n transitionProperty: 'background-color',\n transitionTimingFunction: castWebType(theme.motion.easing.standard),\n transitionDuration: castWebType(makeMotionTime(theme.motion.duration.gentle)),\n\n '&:hover:not(:disabled)': {\n backgroundColor: $isSelected ? 'transparent' : theme.colors.interactive.background.gray.default,\n },\n\n '&:focus:not(:focus-visible)': {\n outline: 'none',\n },\n\n '&:focus-visible': {\n outline: 'none',\n boxShadow: `inset 0px 0px 0px 4px ${theme.colors.surface.border.primary.muted}`,\n },\n\n '&:disabled': {\n cursor: 'not-allowed',\n backgroundColor: 'transparent',\n },\n '&:disabled:hover': {\n backgroundColor: 'transparent',\n },\n}));\n\nconst SegmentedControlItem = ({\n children,\n value,\n leading: Leading,\n isDisabled: isItemDisabled = false,\n accessibilityLabel,\n testID,\n ...rest\n}: SegmentedControlItemProps): React.ReactElement => {\n const {\n selectedValue,\n setSelectedValue,\n size,\n isDisabled: isGroupDisabled,\n baseId,\n totalItems,\n firstEnabledValue,\n itemRefs,\n } = useSegmentedControlContext();\n\n const buttonRef = React.useRef<HTMLButtonElement>(null);\n const isSelected = selectedValue === value;\n const isDisabled = isGroupDisabled || isItemDisabled;\n\n const shouldReceiveFocus =\n (!isDisabled && isSelected) ||\n (selectedValue === undefined && !isDisabled && value === firstEnabledValue);\n\n React.useEffect(() => {\n if (!itemRefs) return undefined;\n const map = itemRefs.current;\n const node = buttonRef.current;\n if (node) map.set(value, node);\n return () => {\n map.delete(value);\n };\n }, [value, itemRefs]);\n\n const handleKeyDown = React.useCallback(\n (e: React.KeyboardEvent<HTMLButtonElement>) => {\n const container = buttonRef.current?.closest('[role=\"radiogroup\"]');\n if (!container) return;\n\n const buttons = Array.from(\n container.querySelectorAll<HTMLButtonElement>('[role=\"radio\"]:not(:disabled)'),\n );\n const currentIndex = buttons.indexOf(buttonRef.current!);\n let nextIndex = -1;\n\n if (e.key === 'ArrowRight' || e.key === 'ArrowDown') {\n nextIndex = (currentIndex + 1) % buttons.length;\n } else if (e.key === 'ArrowLeft' || e.key === 'ArrowUp') {\n nextIndex = (currentIndex - 1 + buttons.length) % buttons.length;\n } else if (e.key === 'Home') {\n nextIndex = 0;\n } else if (e.key === 'End') {\n nextIndex = buttons.length - 1;\n }\n\n if (nextIndex >= 0) {\n e.preventDefault();\n const nextEl = buttons[nextIndex];\n nextEl.focus();\n setSelectedValue(() => nextEl.dataset.value ?? '');\n }\n },\n [setSelectedValue],\n );\n\n const textColor = isDisabled\n ? 'interactive.text.gray.disabled'\n : isSelected\n ? 'interactive.text.gray.normal'\n : 'interactive.text.gray.muted';\n const iconColor = isDisabled\n ? 'interactive.icon.gray.disabled'\n : isSelected\n ? 'interactive.icon.gray.normal'\n : 'interactive.icon.gray.muted';\n\n return (\n <StyledSegmentedControlButton\n ref={buttonRef}\n type=\"button\"\n id={`${baseId}-${value}-item`}\n data-value={value}\n tabIndex={shouldReceiveFocus ? 0 : -1}\n $size={size}\n $isSelected={isSelected}\n disabled={isDisabled}\n onClick={() => {\n setSelectedValue(() => value);\n }}\n onKeyDown={handleKeyDown}\n {...makeAccessible({\n role: 'radio',\n checked: isSelected,\n label: accessibilityLabel,\n setSize: totalItems,\n })}\n {...metaAttribute({ name: MetaConstants.SegmentedControlItem, testID })}\n {...makeAnalyticsAttribute(rest)}\n >\n {Leading ? <Leading size={iconSizeMap[size]} color={iconColor} /> : null}\n {children ? (\n <Text as=\"span\" color={textColor} size={textSizeMap[size]} weight=\"medium\">\n {children}\n </Text>\n ) : null}\n </StyledSegmentedControlButton>\n );\n};\n\nexport { SegmentedControlItem };\n"],"names":["StyledSegmentedControlButton","styled","button","withConfig","displayName","componentId","_ref","theme","$size","$isSelected","appearance","border","cursor","display","alignItems","justifyContent","gap","makeSpace","spacing","flex","height","itemHeight","paddingTop","getIn","paddingY","paddingBottom","paddingLeft","paddingX","paddingRight","backgroundColor","borderRadius","radius","itemBorderRadius","position","zIndex","transitionProperty","transitionTimingFunction","castWebType","motion","easing","standard","transitionDuration","makeMotionTime","duration","gentle","colors","interactive","background","gray","outline","boxShadow","concat","surface","primary","muted","SegmentedControlItem","_ref2","children","value","Leading","leading","_ref2$isDisabled","isDisabled","isItemDisabled","accessibilityLabel","testID","rest","_objectWithoutProperties","_excluded","_useSegmentedControlC","useSegmentedControlContext","selectedValue","setSelectedValue","size","isGroupDisabled","baseId","totalItems","firstEnabledValue","itemRefs","buttonRef","React","useRef","isSelected","shouldReceiveFocus","undefined","useEffect","map","current","node","set","handleKeyDown","useCallback","e","_buttonRef$current","container","closest","buttons","Array","from","querySelectorAll","currentIndex","indexOf","nextIndex","key","length","preventDefault","nextEl","focus","_nextEl$dataset$value","dataset","textColor","iconColor","_jsxs","_objectSpread","ref","type","id","tabIndex","disabled","onClick","onKeyDown","makeAccessible","role","checked","label","setSize","metaAttribute","name","MetaConstants","makeAnalyticsAttribute","_jsx","iconSizeMap","color","Text","as","textSizeMap","weight"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAmBA,IAAMA,4BAA4B,gBAAGC,MAAM,CAACC,MAAM,CAAAC,UAAA,CAAA;EAAAC,WAAA,EAAA,uDAAA;EAAAC,WAAA,EAAA,UAAA;AAAA,CAAA,CAAA,CAG/C,UAAAC,IAAA,EAAA;AAAA,EAAA,IAAGC,KAAK,GAAAD,IAAA,CAALC,KAAK;IAAEC,KAAK,GAAAF,IAAA,CAALE,KAAK;IAAEC,WAAW,GAAAH,IAAA,CAAXG,WAAW,CAAA;EAAA,OAAQ;AACrCC,IAAAA,UAAU,EAAE,MAAM;AAClBC,IAAAA,MAAM,EAAE,MAAM;AACdC,IAAAA,MAAM,EAAE,SAAS;AACjBC,IAAAA,OAAO,EAAE,aAAa;AACtBC,IAAAA,UAAU,EAAE,QAAQ;AACpBC,IAAAA,cAAc,EAAE,QAAQ;IACxBC,GAAG,EAAEC,SAAS,CAACV,KAAK,C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AT,IAAAA,QAAA,EAE/BE,CAAAA,OAAO,gBAAGuE,GAAA,CAACvE,OAAO,EAAA;AAACc,MAAAA,IAAI,EAAE0D,WAAW,CAAC1D,IAAI,CAAE;AAAC2D,MAAAA,KAAK,EAAErB,SAAAA;KAAY,CAAC,GAAG,IAAI,EACvEtD,QAAQ,gBACPyE,GAAA,CAACG,IAAI,EAAA;AAACC,MAAAA,EAAE,EAAC,MAAM;AAACF,MAAAA,KAAK,EAAEtB,SAAU;AAACrC,MAAAA,IAAI,EAAE8D,WAAW,CAAC9D,IAAI,CAAE;AAAC+D,MAAAA,MAAM,EAAC,QAAQ;AAAA/E,MAAAA,QAAA,EACvEA,QAAAA;KACG,CAAC,GACL,IAAI,CAAA;AAAA,GAAA,CACoB,CAAC,CAAA;AAEnC;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
var paddingY = {
|
|
2
|
+
small: 'spacing.2',
|
|
3
|
+
medium: 'spacing.2',
|
|
4
|
+
large: 'spacing.3'
|
|
5
|
+
};
|
|
6
|
+
var paddingX = {
|
|
7
|
+
small: 'spacing.3',
|
|
8
|
+
medium: 'spacing.3',
|
|
9
|
+
large: 'spacing.3'
|
|
10
|
+
};
|
|
11
|
+
var containerPadding = {
|
|
12
|
+
small: 'spacing.2',
|
|
13
|
+
medium: 'spacing.2',
|
|
14
|
+
large: 'spacing.2'
|
|
15
|
+
};
|
|
16
|
+
var gap = {
|
|
17
|
+
small: 'spacing.1',
|
|
18
|
+
medium: 'spacing.1',
|
|
19
|
+
large: 'spacing.1'
|
|
20
|
+
};
|
|
21
|
+
var containerBorderRadius = {
|
|
22
|
+
small: 'small',
|
|
23
|
+
medium: 'small',
|
|
24
|
+
large: 'medium'
|
|
25
|
+
};
|
|
26
|
+
var itemBorderRadius = {
|
|
27
|
+
small: 'xsmall',
|
|
28
|
+
medium: 'xsmall',
|
|
29
|
+
large: 'small'
|
|
30
|
+
};
|
|
31
|
+
var containerHeight = {
|
|
32
|
+
small: 32,
|
|
33
|
+
medium: 36,
|
|
34
|
+
large: 48
|
|
35
|
+
};
|
|
36
|
+
var itemHeight = {
|
|
37
|
+
small: 24,
|
|
38
|
+
medium: 28,
|
|
39
|
+
large: 40
|
|
40
|
+
};
|
|
41
|
+
var textSizeMap = {
|
|
42
|
+
small: 'small',
|
|
43
|
+
medium: 'medium',
|
|
44
|
+
large: 'large'
|
|
45
|
+
};
|
|
46
|
+
var iconSizeMap = {
|
|
47
|
+
small: 'medium',
|
|
48
|
+
medium: 'medium',
|
|
49
|
+
large: 'large'
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export { containerBorderRadius, containerHeight, containerPadding, gap, iconSizeMap, itemBorderRadius, itemHeight, paddingX, paddingY, textSizeMap };
|
|
53
|
+
//# sourceMappingURL=segmentedControlTokens.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"segmentedControlTokens.js","sources":["../../../../../../src/components/SegmentedControl/segmentedControlTokens.ts"],"sourcesContent":["import type { SegmentedControlSize } from './types';\nimport type { DotNotationSpacingStringToken } from '~utils/types';\n\ntype SizeTokenMap = Record<SegmentedControlSize, DotNotationSpacingStringToken>;\n\nconst paddingY: SizeTokenMap = {\n small: 'spacing.2',\n medium: 'spacing.2',\n large: 'spacing.3',\n};\n\nconst paddingX: SizeTokenMap = {\n small: 'spacing.3',\n medium: 'spacing.3',\n large: 'spacing.3',\n};\n\nconst containerPadding: SizeTokenMap = {\n small: 'spacing.2',\n medium: 'spacing.2',\n large: 'spacing.2',\n};\n\nconst gap: SizeTokenMap = {\n small: 'spacing.1',\n medium: 'spacing.1',\n large: 'spacing.1',\n};\n\nconst containerBorderRadius: Record<SegmentedControlSize, 'small' | 'medium'> = {\n small: 'small',\n medium: 'small',\n large: 'medium',\n};\n\nconst itemBorderRadius: Record<SegmentedControlSize, 'xsmall' | 'small'> = {\n small: 'xsmall',\n medium: 'xsmall',\n large: 'small',\n};\n\nconst containerHeight: Record<SegmentedControlSize, number> = {\n small: 32,\n medium: 36,\n large: 48,\n};\n\nconst itemHeight: Record<SegmentedControlSize, number> = {\n small: 24,\n medium: 28,\n large: 40,\n};\n\nconst textSizeMap: Record<SegmentedControlSize, 'small' | 'medium' | 'large'> = {\n small: 'small',\n medium: 'medium',\n large: 'large',\n};\n\nconst iconSizeMap: Record<SegmentedControlSize, 'small' | 'medium' | 'large'> = {\n small: 'medium',\n medium: 'medium',\n large: 'large',\n};\n\nexport {\n paddingY,\n paddingX,\n containerPadding,\n containerBorderRadius,\n itemBorderRadius,\n containerHeight,\n itemHeight,\n gap,\n textSizeMap,\n iconSizeMap,\n};\n"],"names":["paddingY","small","medium","large","paddingX","containerPadding","gap","containerBorderRadius","itemBorderRadius","containerHeight","itemHeight","textSizeMap","iconSizeMap"],"mappings":"AAKA,IAAMA,QAAsB,GAAG;AAC7BC,EAAAA,KAAK,EAAE,WAAW;AAClBC,EAAAA,MAAM,EAAE,WAAW;AACnBC,EAAAA,KAAK,EAAE,WAAA;AACT,EAAC;AAED,IAAMC,QAAsB,GAAG;AAC7BH,EAAAA,KAAK,EAAE,WAAW;AAClBC,EAAAA,MAAM,EAAE,WAAW;AACnBC,EAAAA,KAAK,EAAE,WAAA;AACT,EAAC;AAED,IAAME,gBAA8B,GAAG;AACrCJ,EAAAA,KAAK,EAAE,WAAW;AAClBC,EAAAA,MAAM,EAAE,WAAW;AACnBC,EAAAA,KAAK,EAAE,WAAA;AACT,EAAC;AAED,IAAMG,GAAiB,GAAG;AACxBL,EAAAA,KAAK,EAAE,WAAW;AAClBC,EAAAA,MAAM,EAAE,WAAW;AACnBC,EAAAA,KAAK,EAAE,WAAA;AACT,EAAC;AAED,IAAMI,qBAAuE,GAAG;AAC9EN,EAAAA,KAAK,EAAE,OAAO;AACdC,EAAAA,MAAM,EAAE,OAAO;AACfC,EAAAA,KAAK,EAAE,QAAA;AACT,EAAC;AAED,IAAMK,gBAAkE,GAAG;AACzEP,EAAAA,KAAK,EAAE,QAAQ;AACfC,EAAAA,MAAM,EAAE,QAAQ;AAChBC,EAAAA,KAAK,EAAE,OAAA;AACT,EAAC;AAED,IAAMM,eAAqD,GAAG;AAC5DR,EAAAA,KAAK,EAAE,EAAE;AACTC,EAAAA,MAAM,EAAE,EAAE;AACVC,EAAAA,KAAK,EAAE,EAAA;AACT,EAAC;AAED,IAAMO,UAAgD,GAAG;AACvDT,EAAAA,KAAK,EAAE,EAAE;AACTC,EAAAA,MAAM,EAAE,EAAE;AACVC,EAAAA,KAAK,EAAE,EAAA;AACT,EAAC;AAED,IAAMQ,WAAuE,GAAG;AAC9EV,EAAAA,KAAK,EAAE,OAAO;AACdC,EAAAA,MAAM,EAAE,QAAQ;AAChBC,EAAAA,KAAK,EAAE,OAAA;AACT,EAAC;AAED,IAAMS,WAAuE,GAAG;AAC9EX,EAAAA,KAAK,EAAE,QAAQ;AACfC,EAAAA,MAAM,EAAE,QAAQ;AAChBC,EAAAA,KAAK,EAAE,OAAA;AACT;;;;"}
|
|
@@ -8,14 +8,16 @@ import { forwardRef, useState, useRef, useEffect } from 'react';
|
|
|
8
8
|
import { RzpGlassMount } from './RzpGlassMount.js';
|
|
9
9
|
import { DEFAULT_CDN_PATH, getDefaultAssets, getPresetAssets, resolveConfig } from './utils.js';
|
|
10
10
|
import { useMergeRefs } from '../../../utils/useMergeRefs.js';
|
|
11
|
+
import '../../BladeProvider/index.js';
|
|
11
12
|
import { jsx } from 'react/jsx-runtime';
|
|
13
|
+
import useTheme from '../../BladeProvider/useTheme.js';
|
|
12
14
|
|
|
13
15
|
var _excluded = ["width", "height", "className", "style", "onLoad", "onError", "assetsPath", "gradientMapCanvas", "gradientMapSrc", "gradientMap2Src", "imageSrc"];
|
|
14
16
|
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
17
|
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
18
|
var FADE_IN_MS = 200;
|
|
17
19
|
var RzpGlass = /*#__PURE__*/forwardRef(function RzpGlass(props, forwardedRef) {
|
|
18
|
-
var _presetAssets$videoSr, _ref, _ref2, _presetAssets$centerG, _configProps$edgeFeat;
|
|
20
|
+
var _presetAssets$videoSr, _ref, _ref2, _presetAssets$centerG, _configProps$edgeFeat, _configProps$specular;
|
|
19
21
|
var _props$width = props.width,
|
|
20
22
|
width = _props$width === void 0 ? '100%' : _props$width,
|
|
21
23
|
_props$height = props.height,
|
|
@@ -31,12 +33,19 @@ var RzpGlass = /*#__PURE__*/forwardRef(function RzpGlass(props, forwardedRef) {
|
|
|
31
33
|
imageSrcProp = props.imageSrc,
|
|
32
34
|
configProps = _objectWithoutProperties(props, _excluded);
|
|
33
35
|
|
|
36
|
+
// Follow Blade's color scheme: in dark mode every preset gets its dark
|
|
37
|
+
// counterpart (dark gradient maps, black background, no bloom, black specular)
|
|
38
|
+
// layered on top. Explicit props still win over the dark overlay.
|
|
39
|
+
var _useTheme = useTheme(),
|
|
40
|
+
colorScheme = _useTheme.colorScheme;
|
|
41
|
+
var isDark = colorScheme === 'dark';
|
|
42
|
+
|
|
34
43
|
// Get default assets based on assetsPath
|
|
35
44
|
var assetsPath = assetsPathProp !== null && assetsPathProp !== void 0 ? assetsPathProp : DEFAULT_CDN_PATH;
|
|
36
45
|
var defaultAssets = getDefaultAssets(assetsPath);
|
|
37
46
|
|
|
38
47
|
// Resolve assets: prop overrides preset, preset overrides default
|
|
39
|
-
var presetAssets = getPresetAssets(props.preset, assetsPath);
|
|
48
|
+
var presetAssets = getPresetAssets(props.preset, assetsPath, isDark);
|
|
40
49
|
var imageSrc = imageSrcProp !== null && imageSrcProp !== void 0 ? imageSrcProp : presetAssets.imageSrc;
|
|
41
50
|
var videoSrc = imageSrc ? undefined : (_presetAssets$videoSr = presetAssets.videoSrc) !== null && _presetAssets$videoSr !== void 0 ? _presetAssets$videoSr : defaultAssets.videoSrc;
|
|
42
51
|
var gradientMapSrc = (_ref = gradientMapSrcProp !== null && gradientMapSrcProp !== void 0 ? gradientMapSrcProp : presetAssets.gradientMapSrc) !== null && _ref !== void 0 ? _ref : defaultAssets.gradientMapSrc;
|
|
@@ -68,7 +77,7 @@ var RzpGlass = /*#__PURE__*/forwardRef(function RzpGlass(props, forwardedRef) {
|
|
|
68
77
|
return _context.abrupt("return");
|
|
69
78
|
case 1:
|
|
70
79
|
_context.prev = 1;
|
|
71
|
-
config = resolveConfig(props, assetsPath);
|
|
80
|
+
config = resolveConfig(props, assetsPath, isDark);
|
|
72
81
|
mountRef.current = new RzpGlassMount(divRef.current, {
|
|
73
82
|
videoSrc: videoSrc,
|
|
74
83
|
imageSrc: imageSrc,
|
|
@@ -121,15 +130,15 @@ var RzpGlass = /*#__PURE__*/forwardRef(function RzpGlass(props, forwardedRef) {
|
|
|
121
130
|
mountRef.current = null;
|
|
122
131
|
setIsInitialized(false);
|
|
123
132
|
};
|
|
124
|
-
}, [assetsPath, videoSrc, imageSrc, gradientMapSrc, gradientMap2Src, centerGradientMapSrc, configProps.preset]);
|
|
133
|
+
}, [assetsPath, videoSrc, imageSrc, gradientMapSrc, gradientMap2Src, centerGradientMapSrc, configProps.preset, isDark]);
|
|
125
134
|
|
|
126
135
|
// Update uniforms when config props change
|
|
127
136
|
useEffect(function () {
|
|
128
137
|
if (isInitialized && mountRef.current) {
|
|
129
|
-
var config = resolveConfig(props, assetsPath);
|
|
138
|
+
var config = resolveConfig(props, assetsPath, isDark);
|
|
130
139
|
mountRef.current.setUniforms(config);
|
|
131
140
|
}
|
|
132
|
-
}, [isInitialized, configProps.preset,
|
|
141
|
+
}, [isInitialized, isDark, configProps.preset,
|
|
133
142
|
// Colorama
|
|
134
143
|
configProps.inputMin, configProps.inputMax, configProps.modifyGamma, configProps.posterizeLevels, configProps.cycleRepetitions, configProps.phaseShift, configProps.cycleSpeed, configProps.wrapMode, configProps.reverse, configProps.blendWithOriginal,
|
|
135
144
|
// Displacement
|
|
@@ -143,7 +152,7 @@ var RzpGlass = /*#__PURE__*/forwardRef(function RzpGlass(props, forwardedRef) {
|
|
|
143
152
|
// Effect toggles
|
|
144
153
|
configProps.enableDisplacement, configProps.enableColorama, configProps.enableBloom, configProps.enableLightSweep,
|
|
145
154
|
// Light
|
|
146
|
-
configProps.lightIntensity, configProps.lightStartFrame,
|
|
155
|
+
configProps.lightIntensity], _toConsumableArray((_configProps$specular = configProps.specularTint) !== null && _configProps$specular !== void 0 ? _configProps$specular : [1, 1, 1]), [configProps.lightStartFrame,
|
|
147
156
|
// Playback
|
|
148
157
|
configProps.paused, configProps.startTime, configProps.endTime, configProps.animateLightIndependently,
|
|
149
158
|
// Cycle animation
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RzpGlass.js","sources":["../../../../../../../src/components/Spark/RzpGlass/RzpGlass.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/explicit-function-return-type */\n/* eslint-disable @typescript-eslint/no-unsafe-argument */\n/* eslint-disable @typescript-eslint/no-unsafe-assignment */\n/* eslint-disable react/react-in-jsx-scope */\n/* eslint-disable react-hooks/exhaustive-deps */\n/* eslint-disable @typescript-eslint/no-implicit-any-catch */\n/* eslint-disable @typescript-eslint/no-shadow */\nimport { forwardRef, useEffect, useRef, useState } from 'react';\nimport { RzpGlassMount } from './RzpGlassMount';\nimport type { RzpGlassProps } from './types';\nimport { DEFAULT_CDN_PATH, getDefaultAssets, getPresetAssets, resolveConfig } from './utils';\nimport { useMergeRefs } from '~utils/useMergeRefs';\n\n// Duration of the component's built-in fade-in transition.\n// The video is kept paused during this window so one-shot animations\n// (e.g. circleSlideUp) don't \"waste\" frames while the canvas is invisible.\nconst FADE_IN_MS = 200;\n\nconst RzpGlass = forwardRef<HTMLDivElement, RzpGlassProps>(function RzpGlass(props, forwardedRef) {\n const {\n width = '100%',\n height = '100%',\n className,\n style,\n onLoad,\n onError,\n assetsPath: assetsPathProp,\n gradientMapCanvas,\n gradientMapSrc: gradientMapSrcProp,\n gradientMap2Src: gradientMap2SrcProp,\n imageSrc: imageSrcProp,\n ...configProps\n } = props;\n\n // Get default assets based on assetsPath\n const assetsPath: string = assetsPathProp ?? DEFAULT_CDN_PATH;\n const defaultAssets = getDefaultAssets(assetsPath);\n\n // Resolve assets: prop overrides preset, preset overrides default\n const presetAssets = getPresetAssets(props.preset, assetsPath);\n const imageSrc = imageSrcProp ?? presetAssets.imageSrc;\n const videoSrc = imageSrc ? undefined : presetAssets.videoSrc ?? defaultAssets.videoSrc;\n const gradientMapSrc =\n gradientMapSrcProp ?? presetAssets.gradientMapSrc ?? defaultAssets.gradientMapSrc;\n const gradientMap2Src =\n gradientMap2SrcProp ?? presetAssets.gradientMap2Src ?? defaultAssets.gradientMap2Src;\n const centerGradientMapSrc =\n presetAssets.centerGradientMapSrc ?? defaultAssets.centerGradientMapSrc;\n\n const [isInitialized, setIsInitialized] = useState(false);\n const [error, setError] = useState<Error | null>(null);\n const divRef = useRef<HTMLDivElement>(null);\n const mountRef = useRef<RzpGlassMount | null>(null);\n\n // Initialize on mount\n useEffect(() => {\n const init = async () => {\n if (!divRef.current || mountRef.current) return;\n\n try {\n const config = resolveConfig(props, assetsPath);\n\n mountRef.current = new RzpGlassMount(\n divRef.current,\n {\n videoSrc,\n imageSrc,\n gradientMapSrc,\n gradientMap2Src,\n centerGradientMapSrc,\n },\n config,\n );\n\n await mountRef.current.loadAssets();\n\n // Pause the video during the CSS fade-in so one-shot animations\n // don't burn frames while the component is still transparent.\n // Only do this when the consumer hasn't explicitly set paused: true.\n const userWantsPaused = config.paused ?? false;\n if (!userWantsPaused) {\n mountRef.current.pause();\n }\n\n setIsInitialized(true); // kicks off the CSS opacity 0 → 1 transition\n\n // After the fade-in completes, resume video and notify the consumer.\n setTimeout(() => {\n if (!mountRef.current) return;\n if (!userWantsPaused) {\n mountRef.current.play();\n }\n onLoad?.();\n }, FADE_IN_MS);\n } catch (err) {\n const error = err instanceof Error ? err : new Error(String(err));\n setError(error);\n onError?.(error);\n }\n };\n\n void init();\n\n return () => {\n mountRef.current?.dispose();\n mountRef.current = null;\n setIsInitialized(false);\n };\n }, [assetsPath, videoSrc, imageSrc, gradientMapSrc, gradientMap2Src, centerGradientMapSrc, configProps.preset]);\n\n // Update uniforms when config props change\n useEffect(() => {\n if (isInitialized && mountRef.current) {\n const config = resolveConfig(props, assetsPath);\n mountRef.current.setUniforms(config);\n }\n }, [\n isInitialized,\n configProps.preset,\n // Colorama\n configProps.inputMin,\n configProps.inputMax,\n configProps.modifyGamma,\n configProps.posterizeLevels,\n configProps.cycleRepetitions,\n configProps.phaseShift,\n configProps.cycleSpeed,\n configProps.wrapMode,\n configProps.reverse,\n configProps.blendWithOriginal,\n // Displacement\n configProps.numSegments,\n configProps.slitAngle,\n configProps.displacementX,\n configProps.displacementY,\n // Center element\n configProps.enableCenterElement,\n configProps.centerAnimDuration,\n // Color correction\n configProps.ccBlackPoint,\n configProps.ccWhitePoint,\n configProps.ccMidtoneGamma,\n configProps.ccGamma,\n configProps.ccContrast,\n // Zoom & Pan\n configProps.zoom,\n configProps.panX,\n configProps.panY,\n // eslint-disable-next-line react-hooks/exhaustive-deps\n ...(configProps.edgeFeather ?? [0, 0, 0, 0]),\n // Effect toggles\n configProps.enableDisplacement,\n configProps.enableColorama,\n configProps.enableBloom,\n configProps.enableLightSweep,\n // Light\n configProps.lightIntensity,\n configProps.lightStartFrame,\n // Playback\n configProps.paused,\n configProps.startTime,\n configProps.endTime,\n configProps.animateLightIndependently,\n // Cycle animation\n configProps.animateCycleReps,\n configProps.cycleRepetitionsStart,\n configProps.cycleRepetitionsEnd,\n configProps.cycleRepetitionsStartFrame,\n configProps.cycleRepetitionsDuration,\n // Gradient map blend\n configProps.gradientMapBlend,\n configProps.gradientMapBlendDuration,\n ]);\n\n // Update gradient map texture when a canvas is provided\n useEffect(() => {\n if (isInitialized && mountRef.current && gradientMapCanvas) {\n mountRef.current.updateGradientMapTexture(gradientMapCanvas);\n }\n }, [isInitialized, gradientMapCanvas]);\n\n const mergedRef = useMergeRefs(forwardedRef, divRef);\n\n // Convert width/height to string if number\n const widthStyle = typeof width === 'number' ? `${width}px` : width;\n const heightStyle = typeof height === 'number' ? `${height}px` : height;\n\n if (error) {\n return (\n <div\n ref={mergedRef}\n className={className}\n style={{\n width: widthStyle,\n height: heightStyle,\n ...style,\n }}\n />\n );\n }\n\n return (\n <div\n ref={mergedRef}\n className={className}\n style={{\n width: widthStyle,\n height: heightStyle,\n position: 'relative',\n overflow: 'hidden',\n backgroundColor: 'transparent',\n transition: `${FADE_IN_MS}ms opacity`,\n ...(isInitialized ? { opacity: 1 } : { opacity: 0 }),\n ...style,\n }}\n />\n );\n});\n\nexport { RzpGlass };\n"],"names":["FADE_IN_MS","RzpGlass","forwardRef","props","forwardedRef","_presetAssets$videoSr","_ref","_ref2","_presetAssets$centerG","_configProps$edgeFeat","_props$width","width","_props$height","height","className","style","onLoad","onError","assetsPathProp","assetsPath","gradientMapCanvas","gradientMapSrcProp","gradientMapSrc","gradientMap2SrcProp","gradientMap2Src","imageSrcProp","imageSrc","configProps","_objectWithoutProperties","_excluded","DEFAULT_CDN_PATH","defaultAssets","getDefaultAssets","presetAssets","getPresetAssets","preset","videoSrc","undefined","centerGradientMapSrc","_useState","useState","_useState2","_slicedToArray","isInitialized","setIsInitialized","_useState3","_useState4","error","setError","divRef","useRef","mountRef","useEffect","init","_ref3","_asyncToGenerator","_regeneratorRuntime","mark","_callee","_config$paused","config","userWantsPaused","_error","_t","wrap","_context","prev","next","current","abrupt","resolveConfig","RzpGlassMount","loadAssets","paused","pause","setTimeout","play","Error","String","stop","apply","arguments","_mountRef$current","dispose","setUniforms","inputMin","inputMax","modifyGamma","posterizeLevels","cycleRepetitions","phaseShift","cycleSpeed","wrapMode","reverse","blendWithOriginal","numSegments","slitAngle","displacementX","displacementY","enableCenterElement","centerAnimDuration","ccBlackPoint","ccWhitePoint","ccMidtoneGamma","ccGamma","ccContrast","zoom","panX","panY","concat","_toConsumableArray","edgeFeather","enableDisplacement","enableColorama","enableBloom","enableLightSweep","lightIntensity","lightStartFrame","startTime","endTime","animateLightIndependently","animateCycleReps","cycleRepetitionsStart","cycleRepetitionsEnd","cycleRepetitionsStartFrame","cycleRepetitionsDuration","gradientMapBlend","gradientMapBlendDuration","updateGradientMapTexture","mergedRef","useMergeRefs","widthStyle","heightStyle","_jsx","ref","_objectSpread","position","overflow","backgroundColor","transition","opacity"],"mappings":";;;;;;;;;;;;;;;AAgBA,IAAMA,UAAU,GAAG,GAAG,CAAA;AAEhBC,IAAAA,QAAQ,gBAAGC,UAAU,CAAgC,SAASD,QAAQA,CAACE,KAAK,EAAEC,YAAY,EAAE;EAAA,IAAAC,qBAAA,EAAAC,IAAA,EAAAC,KAAA,EAAAC,qBAAA,EAAAC,qBAAA,CAAA;AAChG,EAAA,IAAAC,YAAA,GAaIP,KAAK,CAZPQ,KAAK;AAALA,IAAAA,KAAK,GAAAD,YAAA,KAAG,KAAA,CAAA,GAAA,MAAM,GAAAA,YAAA;IAAAE,aAAA,GAYZT,KAAK,CAXPU,MAAM;AAANA,IAAAA,MAAM,GAAAD,aAAA,KAAG,KAAA,CAAA,GAAA,MAAM,GAAAA,aAAA;IACfE,SAAS,GAUPX,KAAK,CAVPW,SAAS;IACTC,KAAK,GASHZ,KAAK,CATPY,KAAK;IACLC,MAAM,GAQJb,KAAK,CARPa,MAAM;IACNC,OAAO,GAOLd,KAAK,CAPPc,OAAO;I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CAAA;AAEN,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"RzpGlass.js","sources":["../../../../../../../src/components/Spark/RzpGlass/RzpGlass.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/explicit-function-return-type */\n/* eslint-disable @typescript-eslint/no-unsafe-argument */\n/* eslint-disable @typescript-eslint/no-unsafe-assignment */\n/* eslint-disable react/react-in-jsx-scope */\n/* eslint-disable react-hooks/exhaustive-deps */\n/* eslint-disable @typescript-eslint/no-implicit-any-catch */\n/* eslint-disable @typescript-eslint/no-shadow */\nimport { forwardRef, useEffect, useRef, useState } from 'react';\nimport { RzpGlassMount } from './RzpGlassMount';\nimport type { RzpGlassProps } from './types';\nimport { DEFAULT_CDN_PATH, getDefaultAssets, getPresetAssets, resolveConfig } from './utils';\nimport { useMergeRefs } from '~utils/useMergeRefs';\nimport { useTheme } from '~components/BladeProvider';\n\n// Duration of the component's built-in fade-in transition.\n// The video is kept paused during this window so one-shot animations\n// (e.g. circleSlideUp) don't \"waste\" frames while the canvas is invisible.\nconst FADE_IN_MS = 200;\n\nconst RzpGlass = forwardRef<HTMLDivElement, RzpGlassProps>(function RzpGlass(props, forwardedRef) {\n const {\n width = '100%',\n height = '100%',\n className,\n style,\n onLoad,\n onError,\n assetsPath: assetsPathProp,\n gradientMapCanvas,\n gradientMapSrc: gradientMapSrcProp,\n gradientMap2Src: gradientMap2SrcProp,\n imageSrc: imageSrcProp,\n ...configProps\n } = props;\n\n // Follow Blade's color scheme: in dark mode every preset gets its dark\n // counterpart (dark gradient maps, black background, no bloom, black specular)\n // layered on top. Explicit props still win over the dark overlay.\n const { colorScheme } = useTheme();\n const isDark = colorScheme === 'dark';\n\n // Get default assets based on assetsPath\n const assetsPath: string = assetsPathProp ?? DEFAULT_CDN_PATH;\n const defaultAssets = getDefaultAssets(assetsPath);\n\n // Resolve assets: prop overrides preset, preset overrides default\n const presetAssets = getPresetAssets(props.preset, assetsPath, isDark);\n const imageSrc = imageSrcProp ?? presetAssets.imageSrc;\n const videoSrc = imageSrc ? undefined : presetAssets.videoSrc ?? defaultAssets.videoSrc;\n const gradientMapSrc =\n gradientMapSrcProp ?? presetAssets.gradientMapSrc ?? defaultAssets.gradientMapSrc;\n const gradientMap2Src =\n gradientMap2SrcProp ?? presetAssets.gradientMap2Src ?? defaultAssets.gradientMap2Src;\n const centerGradientMapSrc =\n presetAssets.centerGradientMapSrc ?? defaultAssets.centerGradientMapSrc;\n\n const [isInitialized, setIsInitialized] = useState(false);\n const [error, setError] = useState<Error | null>(null);\n const divRef = useRef<HTMLDivElement>(null);\n const mountRef = useRef<RzpGlassMount | null>(null);\n\n // Initialize on mount\n useEffect(() => {\n const init = async () => {\n if (!divRef.current || mountRef.current) return;\n\n try {\n const config = resolveConfig(props, assetsPath, isDark);\n\n mountRef.current = new RzpGlassMount(\n divRef.current,\n {\n videoSrc,\n imageSrc,\n gradientMapSrc,\n gradientMap2Src,\n centerGradientMapSrc,\n },\n config,\n );\n\n await mountRef.current.loadAssets();\n\n // Pause the video during the CSS fade-in so one-shot animations\n // don't burn frames while the component is still transparent.\n // Only do this when the consumer hasn't explicitly set paused: true.\n const userWantsPaused = config.paused ?? false;\n if (!userWantsPaused) {\n mountRef.current.pause();\n }\n\n setIsInitialized(true); // kicks off the CSS opacity 0 → 1 transition\n\n // After the fade-in completes, resume video and notify the consumer.\n setTimeout(() => {\n if (!mountRef.current) return;\n if (!userWantsPaused) {\n mountRef.current.play();\n }\n onLoad?.();\n }, FADE_IN_MS);\n } catch (err) {\n const error = err instanceof Error ? err : new Error(String(err));\n setError(error);\n onError?.(error);\n }\n };\n\n void init();\n\n return () => {\n mountRef.current?.dispose();\n mountRef.current = null;\n setIsInitialized(false);\n };\n }, [assetsPath, videoSrc, imageSrc, gradientMapSrc, gradientMap2Src, centerGradientMapSrc, configProps.preset, isDark]);\n\n // Update uniforms when config props change\n useEffect(() => {\n if (isInitialized && mountRef.current) {\n const config = resolveConfig(props, assetsPath, isDark);\n mountRef.current.setUniforms(config);\n }\n }, [\n isInitialized,\n isDark,\n configProps.preset,\n // Colorama\n configProps.inputMin,\n configProps.inputMax,\n configProps.modifyGamma,\n configProps.posterizeLevels,\n configProps.cycleRepetitions,\n configProps.phaseShift,\n configProps.cycleSpeed,\n configProps.wrapMode,\n configProps.reverse,\n configProps.blendWithOriginal,\n // Displacement\n configProps.numSegments,\n configProps.slitAngle,\n configProps.displacementX,\n configProps.displacementY,\n // Center element\n configProps.enableCenterElement,\n configProps.centerAnimDuration,\n // Color correction\n configProps.ccBlackPoint,\n configProps.ccWhitePoint,\n configProps.ccMidtoneGamma,\n configProps.ccGamma,\n configProps.ccContrast,\n // Zoom & Pan\n configProps.zoom,\n configProps.panX,\n configProps.panY,\n // eslint-disable-next-line react-hooks/exhaustive-deps\n ...(configProps.edgeFeather ?? [0, 0, 0, 0]),\n // Effect toggles\n configProps.enableDisplacement,\n configProps.enableColorama,\n configProps.enableBloom,\n configProps.enableLightSweep,\n // Light\n configProps.lightIntensity,\n // eslint-disable-next-line react-hooks/exhaustive-deps\n ...(configProps.specularTint ?? [1, 1, 1]),\n configProps.lightStartFrame,\n // Playback\n configProps.paused,\n configProps.startTime,\n configProps.endTime,\n configProps.animateLightIndependently,\n // Cycle animation\n configProps.animateCycleReps,\n configProps.cycleRepetitionsStart,\n configProps.cycleRepetitionsEnd,\n configProps.cycleRepetitionsStartFrame,\n configProps.cycleRepetitionsDuration,\n // Gradient map blend\n configProps.gradientMapBlend,\n configProps.gradientMapBlendDuration,\n ]);\n\n // Update gradient map texture when a canvas is provided\n useEffect(() => {\n if (isInitialized && mountRef.current && gradientMapCanvas) {\n mountRef.current.updateGradientMapTexture(gradientMapCanvas);\n }\n }, [isInitialized, gradientMapCanvas]);\n\n const mergedRef = useMergeRefs(forwardedRef, divRef);\n\n // Convert width/height to string if number\n const widthStyle = typeof width === 'number' ? `${width}px` : width;\n const heightStyle = typeof height === 'number' ? `${height}px` : height;\n\n if (error) {\n return (\n <div\n ref={mergedRef}\n className={className}\n style={{\n width: widthStyle,\n height: heightStyle,\n ...style,\n }}\n />\n );\n }\n\n return (\n <div\n ref={mergedRef}\n className={className}\n style={{\n width: widthStyle,\n height: heightStyle,\n position: 'relative',\n overflow: 'hidden',\n backgroundColor: 'transparent',\n transition: `${FADE_IN_MS}ms opacity`,\n ...(isInitialized ? { opacity: 1 } : { opacity: 0 }),\n ...style,\n }}\n />\n );\n});\n\nexport { RzpGlass };\n"],"names":["FADE_IN_MS","RzpGlass","forwardRef","props","forwardedRef","_presetAssets$videoSr","_ref","_ref2","_presetAssets$centerG","_configProps$edgeFeat","_configProps$specular","_props$width","width","_props$height","height","className","style","onLoad","onError","assetsPathProp","assetsPath","gradientMapCanvas","gradientMapSrcProp","gradientMapSrc","gradientMap2SrcProp","gradientMap2Src","imageSrcProp","imageSrc","configProps","_objectWithoutProperties","_excluded","_useTheme","useTheme","colorScheme","isDark","DEFAULT_CDN_PATH","defaultAssets","getDefaultAssets","presetAssets","getPresetAssets","preset","videoSrc","undefined","centerGradientMapSrc","_useState","useState","_useState2","_slicedToArray","isInitialized","setIsInitialized","_useState3","_useState4","error","setError","divRef","useRef","mountRef","useEffect","init","_ref3","_asyncToGenerator","_regeneratorRuntime","mark","_callee","_config$paused","config","userWantsPaused","_error","_t","wrap","_context","prev","next","current","abrupt","resolveConfig","RzpGlassMount","loadAssets","paused","pause","setTimeout","play","Error","String","stop","apply","arguments","_mountRef$current","dispose","setUniforms","inputMin","inputMax","modifyGamma","posterizeLevels","cycleRepetitions","phaseShift","cycleSpeed","wrapMode","reverse","blendWithOriginal","numSegments","slitAngle","displacementX","displacementY","enableCenterElement","centerAnimDuration","ccBlackPoint","ccWhitePoint","ccMidtoneGamma","ccGamma","ccContrast","zoom","panX","panY","concat","_toConsumableArray","edgeFeather","enableDisplacement","enableColorama","enableBloom","enableLightSweep","lightIntensity","specularTint","lightStartFrame","startTime","endTime","animateLightIndependently","animateCycleReps","cycleRepetitionsStart","cycleRepetitionsEnd","cycleRepetitionsStartFrame","cycleRepetitionsDuration","gradientMapBlend","gradientMapBlendDuration","updateGradientMapTexture","mergedRef","useMergeRefs","widthStyle","heightStyle","_jsx","ref","_objectSpread","position","overflow","backgroundColor","transition","opacity"],"mappings":";;;;;;;;;;;;;;;;;AAiBA,IAAMA,UAAU,GAAG,GAAG,CAAA;AAEhBC,IAAAA,QAAQ,gBAAGC,UAAU,CAAgC,SAASD,QAAQA,CAACE,KAAK,EAAEC,YAAY,EAAE;EAAA,IAAAC,qBAAA,EAAAC,IAAA,EAAAC,KAAA,EAAAC,qBAAA,EAAAC,qBAAA,EAAAC,qBAAA,CAAA;AAChG,EAAA,IAAAC,YAAA,GAaIR,KAAK,CAZPS,KAAK;AAALA,IAAAA,KAAK,GAAAD,YAAA,KAAG,KAAA,CAAA,GAAA,MAAM,GAAAA,YAAA;IAAAE,aAAA,GAYZV,KAAK,CAXPW,MAAM;AAANA,IAAAA,MAAM,GAAAD,aAAA,KAAG,KAAA,CAAA,GAAA,MAAM,GAAAA,aAAA;IACfE,SAAS,GAUPZ,KAAK,CAVPY,SAAS;IACTC,KAAK,GASHb,KAAK,CATPa,KAAK;IACLC,MAAM,GAQJd,KAAK,CARPc,MAAM;IACNC,OAAO,GAOLf,KAAK,CAPPe,OAAO;IACKC,cAAc,GAMxBhB,KAAK,CANPiB,UAAU;IACVC,iBAAiB,GAKflB,KAAK,CALPkB,iBAAiB;IACDC,kBAAkB,GAIhCnB,KAAK,CAJPoB,cAAc;IACGC,mBAAmB,GAGlCrB,KAAK,CAHPsB,eAAe;IACLC,YAAY,GAEpBvB,KAAK,CAFPwB,QAAQ;AACLC,IAAAA,WAAW,GAAAC,wBAAA,CACZ1B,KAAK,EAAA2B,SAAA,CAAA,CAAA;;AAET;AACA;AACA;AACA,EAAA,IAAAC,SAAA,GAAwBC,QAAQ,EAAE;IAA1BC,WAAW,GAAAF,SAAA,CAAXE,WAAW,CAAA;AACnB,EAAA,IAAMC,MAAM,GAAGD,WAAW,KAAK,MAAM,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