@razorpay/blade 12.111.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/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 +1 -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 +1 -1
- package/build/lib/native/components/Dropdown/filterChipSelectInputUtils.js.map +1 -1
- 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/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/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/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 +7 -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/useControlledDropdownInput/useControlledDropdownInput.js +1 -1
- package/build/lib/native/utils/useControlledDropdownInput/useControlledDropdownInput.js.map +1 -1
- 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 +20 -0
- 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/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/FilterChipSelectInput.web.js +20 -12
- 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 +15 -1
- package/build/lib/web/development/components/Dropdown/filterChipSelectInputUtils.js.map +1 -1
- 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/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/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/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 +9 -2
- package/build/lib/web/development/components/index.js.map +1 -1
- 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 +4 -0
- 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/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 +20 -0
- 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/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/FilterChipSelectInput.web.js +20 -12
- 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 +15 -1
- package/build/lib/web/production/components/Dropdown/filterChipSelectInputUtils.js.map +1 -1
- 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/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/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/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 +9 -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 +4 -0
- 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 +557 -18
- package/build/types/components/index.native.d.ts +463 -16
- 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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TreeView.web.js","sources":["../../../../../../src/components/TreeView/TreeView.web.tsx"],"sourcesContent":["import React from 'react';\nimport styled from 'styled-components';\nimport { componentIds } from './componentIds';\nimport type { TreeViewProps, TreeViewNodeType } from './types';\nimport { TreeViewContext } from './useTreeView';\nimport type { TreeViewContextType } from './useTreeView';\nimport {\n getDisplayOverride,\n getBranchSelectionState,\n getSelectedGroups,\n getSelectedLeafValues,\n getSelectionAfterLoad,\n getSelectionOnNodeToggle,\n getTreeViewProperties,\n getVisibleOptionIndices,\n getVisibleValues,\n} from './treeViewUtils';\nimport { TreeViewMountScopeContext, useTreeViewMountScopeRef } from './TreeViewAnimator.web';\nimport { useDropdown } from '~components/Dropdown/useDropdown';\nimport { useBottomSheetContext } from '~components/BottomSheet/BottomSheetContext';\nimport { getBaseListBoxWrapperStyles } from '~components/ActionList/styles/getBaseListBoxWrapperStyles';\nimport BaseBox from '~components/Box/BaseBox';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\nimport { logger, throwBladeError } from '~utils/logger';\nimport { useId } from '~utils/useId';\n\nconst StyledTreeViewListBoxWrapper = styled(BaseBox)((props) => ({\n overflowY: 'auto',\n ...getBaseListBoxWrapperStyles({ theme: props.theme, isInBottomSheet: false }),\n}));\n\nconst _TreeView = ({\n children,\n selectionType,\n value,\n defaultValue,\n onChange,\n name,\n testID,\n ...rest\n}: TreeViewProps): React.ReactElement => {\n const dropdown = useDropdown();\n const { isInBottomSheet } = useBottomSheetContext();\n const isInsideDropdown = dropdown.dropdownBaseId !== '';\n const baseId = useId('treeview');\n\n if (__DEV__ && isInBottomSheet) {\n // §6.9: BottomSheet is explicitly out of scope for TreeView v1\n throwBladeError({\n message: 'TreeView is not supported inside BottomSheet',\n moduleName: 'TreeView',\n });\n }\n\n React.useEffect(() => {\n if (__DEV__ && isInsideDropdown) {\n if (value !== undefined || defaultValue !== undefined || onChange !== undefined) {\n logger({\n type: 'warn',\n moduleName: 'TreeView',\n message:\n 'value, defaultValue, and onChange props of TreeView are ignored inside Dropdown. Use them on the Dropdown trigger (SelectInput / FilterChipSelectInput) instead',\n });\n }\n if (\n selectionType !== undefined &&\n dropdown.selectionType !== undefined &&\n selectionType !== dropdown.selectionType\n ) {\n logger({\n type: 'warn',\n moduleName: 'TreeView',\n message: `selectionType=\"${selectionType}\" on TreeView conflicts with selectionType=\"${dropdown.selectionType}\" on Dropdown. Dropdown's selectionType wins`,\n });\n }\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isInsideDropdown]);\n\n // §2.1 dual-mode rule: inside Dropdown, selection is owned by Dropdown state and its trigger\n const effectiveSelectionType = isInsideDropdown\n ? dropdown.selectionType ?? 'single'\n : selectionType ?? 'single';\n\n const properties = React.useMemo(() => getTreeViewProperties(children), [children]);\n const { orderedNodes, nodeMap, rootValues, options } = properties;\n\n // ---------------- expansion ----------------\n const [uncontrolledExpandedValues, setUncontrolledExpandedValues] = React.useState<Set<string>>(\n () =>\n new Set(\n properties.orderedNodes\n .filter((node) => node.kind === 'item' && node.isBranch && node.defaultIsExpanded)\n .map((node) => node.value),\n ),\n );\n\n const expandedValues = React.useMemo(() => {\n const merged = new Set<string>();\n for (const node of orderedNodes) {\n if (!node.isBranch) {\n continue;\n }\n const isExpanded = node.controlledIsExpanded ?? uncontrolledExpandedValues.has(node.value);\n if (isExpanded) {\n merged.add(node.value);\n }\n }\n return merged;\n }, [orderedNodes, uncontrolledExpandedValues]);\n\n const onNodeExpandToggle = (nodeValue: string): void => {\n const node = nodeMap[nodeValue];\n if (!node?.isBranch || node.isDisabled) {\n return;\n }\n const isExpanded = expandedValues.has(nodeValue);\n if (node.controlledIsExpanded === undefined) {\n setUncontrolledExpandedValues((previous) => {\n const next = new Set(previous);\n if (isExpanded) {\n next.delete(nodeValue);\n } else {\n next.add(nodeValue);\n }\n return next;\n });\n }\n node.onExpandChange?.({ isExpanded: !isExpanded });\n };\n\n // ---------------- selection (standalone: B11 - a Set of selected leaf values) ----------------\n const isControlledSelection = !isInsideDropdown && value !== undefined;\n const [uncontrolledSelectedValues, setUncontrolledSelectedValues] = React.useState<Set<string>>(\n () => new Set(defaultValue ?? []),\n );\n const standaloneSelectedValues = React.useMemo(\n () => (isControlledSelection ? new Set(value) : uncontrolledSelectedValues),\n [isControlledSelection, value, uncontrolledSelectedValues],\n );\n\n // dropdown mode: B11 - no TreeView-owned selection state, everything derives from Dropdown's indices\n const dropdownSelectedValues = React.useMemo(() => {\n const selected = new Set<string>();\n if (!isInsideDropdown) {\n return selected;\n }\n for (const selectedIndex of dropdown.selectedIndices) {\n const optionValue = dropdown.options[selectedIndex]?.value;\n if (optionValue !== undefined) {\n selected.add(optionValue);\n }\n }\n return selected;\n }, [isInsideDropdown, dropdown.selectedIndices, dropdown.options]);\n\n const selectedValuesSet = isInsideDropdown ? dropdownSelectedValues : standaloneSelectedValues;\n\n const emitStandaloneChange = (next: Set<string>): void => {\n if (effectiveSelectionType === 'single') {\n onChange?.({ name, values: [...next], selectedGroups: [] });\n return;\n }\n onChange?.({\n name,\n values: getSelectedLeafValues(orderedNodes, next),\n selectedGroups: getSelectedGroups({ rootValues, nodeMap, selectedValues: next }),\n });\n };\n\n const onNodeSelect = (nodeValue: string): void => {\n const node = nodeMap[nodeValue];\n if (!node || node.isDisabled || node.kind === 'loadMore') {\n return;\n }\n\n // a branch that opted out of selection toggles expansion instead (row click / Enter / Space)\n if (node.isBranch && !node.isSelectable) {\n onNodeExpandToggle(nodeValue);\n return;\n }\n\n let next: Set<string>;\n if (effectiveSelectionType === 'single') {\n // radio semantics (B1) - reselecting the current selection is a no-op\n if (standaloneSelectedValues.has(nodeValue) && standaloneSelectedValues.size === 1) {\n return;\n }\n next = new Set([nodeValue]);\n } else {\n if (node.isBranch && node.selectableLeafValues.length === 0) {\n return;\n }\n next = getSelectionOnNodeToggle({ node, selectedValues: standaloneSelectedValues });\n }\n\n if (!isControlledSelection) {\n setUncontrolledSelectedValues(next);\n }\n emitStandaloneChange(next);\n };\n\n // ---------------- dropdown mode: selection routing (§6.2) ----------------\n const toggleBranchInDropdown = (node: TreeViewNodeType): void => {\n // multiple mode invariant: branch indices never enter selectedIndices\n const leafIndices = node.selectableLeafValues\n .map((leafValue) => nodeMap[leafValue]?.optionIndex ?? -1)\n .filter((optionIndex) => optionIndex >= 0);\n if (leafIndices.length === 0) {\n return;\n }\n const areAllSelected = leafIndices.every((optionIndex) =>\n dropdown.selectedIndices.includes(optionIndex),\n );\n dropdown.selectOptionsBatch(leafIndices, areAllSelected ? 'deselect' : 'select');\n };\n\n const onDropdownNodeClick = (\n event: React.MouseEvent<HTMLButtonElement>,\n clickedValue: string,\n ): void => {\n const node = nodeMap[clickedValue];\n if (!node || node.isDisabled || node.optionIndex < 0) {\n return;\n }\n\n if (node.kind === 'loadMore') {\n options[node.optionIndex].onClickTrigger?.(true);\n dropdown.setActiveIndex(node.optionIndex);\n dropdown.triggererRef.current?.focus();\n return;\n }\n\n // non-selectable branch: toggle expansion, keep the overlay open, never enter selectedIndices\n if (node.isBranch && !node.isSelectable) {\n onNodeExpandToggle(node.value);\n dropdown.setActiveIndex(node.optionIndex);\n dropdown.triggererRef.current?.focus();\n return;\n }\n\n if (effectiveSelectionType === 'multiple' && node.isBranch) {\n toggleBranchInDropdown(node);\n dropdown.setActiveIndex(node.optionIndex);\n dropdown.triggererRef.current?.focus();\n return;\n }\n\n // leaf click (and branch click in single mode) goes through the standard path\n dropdown.onOptionClick(event, node.optionIndex);\n };\n\n // ---------------- registration (§6.1) + uncontrolled remap + B6 inheritance ----------------\n const previousPropertiesRef = React.useRef(properties);\n React.useEffect(() => {\n const previousProperties = previousPropertiesRef.current;\n previousPropertiesRef.current = properties;\n\n if (isInsideDropdown) {\n dropdown.setOptions(options);\n\n if (previousProperties !== properties && !dropdown.isControlled) {\n // indices are positional: when the registered list changes (async children, loadMore),\n // remap uncontrolled selection by value and apply B6 inheritance.\n // Controlled mode re-syncs through useControlledDropdownInput on [value, options] - not duplicated here\n const previousSelectedValues = new Set(\n dropdown.selectedIndices\n .map((selectedIndex) => previousProperties.options[selectedIndex]?.value)\n .filter((optionValue): optionValue is string => optionValue !== undefined),\n );\n const inherited = getSelectionAfterLoad({\n previousNodeMap: previousProperties.nodeMap,\n nodeMap,\n orderedNodes,\n selectedValues: previousSelectedValues,\n });\n const nextIndices = [...inherited]\n .map((selectedValue) => options.findIndex((option) => option.value === selectedValue))\n .filter((optionIndex) => optionIndex >= 0);\n const hasChanged =\n nextIndices.length !== dropdown.selectedIndices.length ||\n nextIndices.some((optionIndex, i) => optionIndex !== dropdown.selectedIndices[i]);\n\n if (hasChanged) {\n dropdown.setSelectedIndices(nextIndices);\n if (inherited.size !== previousSelectedValues.size) {\n // selection actually grew through inheritance - let the trigger fire onChange\n dropdown.setChangeCallbackTriggerer(dropdown.changeCallbackTriggerer + 1);\n }\n }\n }\n return;\n }\n\n // standalone B6 inheritance (uncontrolled multiple selection only;\n // in controlled mode the consumer owns `value` and can react to loads themselves)\n if (\n previousProperties !== properties &&\n !isControlledSelection &&\n effectiveSelectionType === 'multiple'\n ) {\n const inherited = getSelectionAfterLoad({\n previousNodeMap: previousProperties.nodeMap,\n nodeMap,\n orderedNodes,\n selectedValues: uncontrolledSelectedValues,\n });\n if (inherited.size !== uncontrolledSelectedValues.size) {\n setUncontrolledSelectedValues(inherited);\n emitStandaloneChange(inherited);\n }\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [properties]);\n\n // ---------------- dropdown keyboard controller (§6.4) ----------------\n const getNodeAtIndex = (optionIndex: number): TreeViewNodeType | undefined => {\n const optionValue = options[optionIndex]?.value;\n return optionValue === undefined ? undefined : nodeMap[optionValue];\n };\n\n if (isInsideDropdown && dropdown.treeViewControllerRef) {\n // Published during render (not in an effect): the trigger's effects\n // (e.g. useControlledDropdownInput's onChange effect reading getSelectedGroups) run\n // before this component's effects would re-assign the controller, so an effect-based\n // assignment with a cleanup leaves a null window on every commit\n dropdown.treeViewControllerRef.current = {\n getVisibleOptionIndices: () =>\n getVisibleOptionIndices({ orderedNodes, nodeMap, expandedValues }),\n onArrowRightKeydown: (currentActiveIndex) => {\n const node = getNodeAtIndex(currentActiveIndex);\n if (!node?.isBranch) {\n return;\n }\n if (!expandedValues.has(node.value)) {\n onNodeExpandToggle(node.value);\n return;\n }\n // already expanded: move to the first traversable child\n const firstChildIndex = node.childValues\n .map((childValue) => nodeMap[childValue])\n .filter((childNode) => childNode && !childNode.isDisabled)\n .map((childNode) => childNode.optionIndex)\n .find((optionIndex) => optionIndex >= 0);\n if (firstChildIndex !== undefined) {\n dropdown.setActiveIndex(firstChildIndex);\n }\n },\n onArrowLeftKeydown: (currentActiveIndex) => {\n const node = getNodeAtIndex(currentActiveIndex);\n if (!node) {\n return;\n }\n if (node.isBranch && expandedValues.has(node.value)) {\n onNodeExpandToggle(node.value);\n return;\n }\n if (node.parentValue !== null) {\n const parentIndex = nodeMap[node.parentValue]?.optionIndex ?? -1;\n if (parentIndex >= 0) {\n dropdown.setActiveIndex(parentIndex);\n }\n }\n },\n handleOptionSelect: (optionIndex, { key } = {}) => {\n const node = getNodeAtIndex(optionIndex);\n if (!node) {\n return false;\n }\n if (node.kind === 'loadMore') {\n // B7: Enter activates, Space is a no-op\n if (key !== ' ') {\n options[optionIndex].onClickTrigger?.(true);\n }\n return true;\n }\n if (node.isBranch && !node.isSelectable) {\n // non-selectable branch: Enter/Space toggle expansion, never select\n onNodeExpandToggle(node.value);\n options[optionIndex].onClickTrigger?.(false);\n return true;\n }\n if (effectiveSelectionType === 'multiple' && node.isBranch) {\n // §6.2: branch toggle routes through the batch setter - exactly one onChange\n const branchSelected = getBranchSelectionState(node, selectedValuesSet) === 'all';\n toggleBranchInDropdown(node);\n options[optionIndex].onClickTrigger?.(!branchSelected);\n return true;\n }\n // leaf (and branch in single mode): default selectOption path\n return false;\n },\n getSelectedGroups: (selectedIndices) => {\n const selected = new Set(\n selectedIndices\n .map((selectedIndex) => options[selectedIndex]?.value)\n .filter((optionValue): optionValue is string => optionValue !== undefined),\n );\n return getSelectedGroups({ rootValues, nodeMap, selectedValues: selected });\n },\n getDisplayOverride: (selectedIndices) => {\n const selected = new Set(\n selectedIndices\n .map((selectedIndex) => options[selectedIndex]?.value)\n .filter((optionValue): optionValue is string => optionValue !== undefined),\n );\n return getDisplayOverride({ orderedNodes, rootValues, nodeMap, selectedValues: selected });\n },\n };\n }\n\n const treeViewControllerRef = dropdown.treeViewControllerRef;\n React.useEffect(() => {\n return () => {\n if (treeViewControllerRef) {\n treeViewControllerRef.current = null;\n }\n };\n }, [treeViewControllerRef]);\n\n // ---------------- focus management ----------------\n const rowRefs = React.useRef<Record<string, HTMLElement | null>>({});\n const registerRowRef = (nodeValue: string, element: HTMLElement | null): void => {\n rowRefs.current[nodeValue] = element;\n };\n\n const [focusedValue, setFocusedValue] = React.useState<string | null>(null);\n const visibleValues = React.useMemo(\n () => getVisibleValues({ orderedNodes, nodeMap, expandedValues }),\n [orderedNodes, nodeMap, expandedValues],\n );\n // roving tabindex (standalone): the focused row is tabbable, falling back to the first visible row\n const tabbableValue = isInsideDropdown\n ? null\n : focusedValue && visibleValues.includes(focusedValue)\n ? focusedValue\n : visibleValues[0] ?? null;\n\n // dropdown mode: keep the active row scrolled into view (focus stays on the trigger)\n React.useEffect(() => {\n if (!isInsideDropdown || dropdown.activeIndex < 0) {\n return;\n }\n const activeValue = options[dropdown.activeIndex]?.value;\n if (activeValue !== undefined) {\n rowRefs.current[activeValue]?.scrollIntoView?.({ block: 'nearest' });\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [dropdown.activeIndex]);\n\n // ---------------- standalone keyboard map (§5) ----------------\n const handleKeyDown = (event: React.KeyboardEvent<HTMLDivElement>): void => {\n if (isInsideDropdown) {\n return;\n }\n const rowElement = (event.target as HTMLElement).closest?.('[data-tree-node-value]');\n const currentValue = rowElement?.getAttribute('data-tree-node-value');\n if (!currentValue) {\n return;\n }\n const node = nodeMap[currentValue];\n if (!node) {\n return;\n }\n\n const currentVisibleIndex = visibleValues.indexOf(currentValue);\n const focusRow = (nodeValue: string | undefined): void => {\n if (nodeValue !== undefined) {\n rowRefs.current[nodeValue]?.focus();\n setFocusedValue(nodeValue);\n }\n };\n\n switch (event.key) {\n case 'ArrowDown':\n event.preventDefault();\n focusRow(visibleValues[currentVisibleIndex + 1]);\n break;\n case 'ArrowUp':\n event.preventDefault();\n focusRow(visibleValues[currentVisibleIndex - 1]);\n break;\n case 'Home':\n event.preventDefault();\n focusRow(visibleValues[0]);\n break;\n case 'End':\n event.preventDefault();\n focusRow(visibleValues[visibleValues.length - 1]);\n break;\n case 'ArrowRight':\n event.preventDefault();\n if (!node.isBranch) {\n break;\n }\n if (!expandedValues.has(currentValue)) {\n onNodeExpandToggle(currentValue);\n } else {\n focusRow(node.childValues.find((childValue) => visibleValues.includes(childValue)));\n }\n break;\n case 'ArrowLeft':\n event.preventDefault();\n if (node.isBranch && expandedValues.has(currentValue)) {\n onNodeExpandToggle(currentValue);\n } else if (node.parentValue !== null) {\n focusRow(node.parentValue);\n }\n break;\n case 'Enter':\n event.preventDefault();\n if (node.kind === 'loadMore') {\n if (node.optionIndex >= 0) {\n options[node.optionIndex].onClickTrigger?.(true);\n }\n break;\n }\n {\n const isNodeSelected =\n node.isSelectable &&\n (effectiveSelectionType === 'multiple'\n ? node.isBranch\n ? getBranchSelectionState(node, selectedValuesSet) === 'all'\n : selectedValuesSet.has(currentValue)\n : selectedValuesSet.has(currentValue));\n onNodeSelect(currentValue);\n if (node.optionIndex >= 0) {\n options[node.optionIndex].onClickTrigger?.(isNodeSelected);\n }\n }\n break;\n case ' ':\n event.preventDefault();\n // B7: Space is a no-op on LoadMore\n if (node.kind === 'loadMore') {\n break;\n }\n {\n const isNodeSelected =\n node.isSelectable &&\n (effectiveSelectionType === 'multiple'\n ? node.isBranch\n ? getBranchSelectionState(node, selectedValuesSet) === 'all'\n : selectedValuesSet.has(currentValue)\n : selectedValuesSet.has(currentValue));\n onNodeSelect(currentValue);\n if (node.optionIndex >= 0) {\n options[node.optionIndex].onClickTrigger?.(isNodeSelected);\n }\n }\n break;\n default:\n break;\n }\n };\n\n // ---------------- context ----------------\n const contextValue = React.useMemo<TreeViewContextType>(\n () => ({\n selectionType: effectiveSelectionType,\n isInsideDropdown,\n baseId,\n nodeMap,\n selectedValuesSet,\n expandedValues,\n tabbableValue,\n onNodeSelect,\n onNodeExpandToggle,\n onDropdownNodeClick,\n registerRowRef,\n setFocusedValue,\n }),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [\n effectiveSelectionType,\n isInsideDropdown,\n baseId,\n nodeMap,\n selectedValuesSet,\n expandedValues,\n tabbableValue,\n dropdown.selectedIndices,\n dropdown.activeIndex,\n dropdown.isKeydownPressed,\n ],\n );\n\n // root mount scope: rows appended at the root after the initial mount\n // (e.g. through a root-level TreeViewLoadMore) animate their own mount\n const isTreeFirstRenderRef = useTreeViewMountScopeRef();\n\n const treeContent = (\n <div\n id={isInsideDropdown ? `${dropdown.dropdownBaseId}-actionlist` : undefined}\n onKeyDown={handleKeyDown}\n {...makeAccessible({\n role: 'tree',\n multiSelectable: effectiveSelectionType === 'multiple' ? true : undefined,\n labelledBy: isInsideDropdown ? `${dropdown.dropdownBaseId}-label` : undefined,\n })}\n >\n <TreeViewMountScopeContext.Provider value={isTreeFirstRenderRef}>\n {children}\n </TreeViewMountScopeContext.Provider>\n </div>\n );\n\n return (\n <TreeViewContext.Provider value={contextValue}>\n <BaseBox\n {...metaAttribute({ name: MetaConstants.TreeView, testID })}\n {...makeAnalyticsAttribute(rest)}\n >\n {isInsideDropdown ? (\n <StyledTreeViewListBoxWrapper>{treeContent}</StyledTreeViewListBoxWrapper>\n ) : (\n treeContent\n )}\n </BaseBox>\n </TreeViewContext.Provider>\n );\n};\n\n/**\n * ### TreeView\n *\n * Hierarchical list of expandable, selectable items. Works standalone on a page,\n * or inside `Dropdown` (in place of `ActionList`) where selection is controlled\n * through the trigger's `value` / `onChange` (SelectInput, FilterChipSelectInput).\n *\n * #### Usage\n *\n * ```jsx\n * <TreeView selectionType=\"multiple\" onChange={({ values, selectedGroups }) => {}}>\n * <TreeViewItem title=\"India\" value=\"india\">\n * <TreeViewItem title=\"Karnataka\" value=\"karnataka\">\n * <TreeViewItem title=\"Bengaluru\" value=\"bengaluru\" />\n * <TreeViewItem title=\"Mysuru\" value=\"mysuru\" />\n * </TreeViewItem>\n * <TreeViewItem title=\"Goa\" value=\"goa\" />\n * </TreeViewItem>\n * </TreeView>\n * ```\n */\nconst TreeView = assignWithoutSideEffects(_TreeView, {\n componentId: componentIds.TreeView,\n displayName: componentIds.TreeView,\n});\n\nexport { TreeView };\n"],"names":["StyledTreeViewListBoxWrapper","styled","BaseBox","withConfig","displayName","componentId","props","_objectSpread","overflowY","getBaseListBoxWrapperStyles","theme","isInBottomSheet","_TreeView","_ref","_dropdown$selectionTy","_visibleValues$","children","selectionType","value","defaultValue","onChange","name","testID","rest","_objectWithoutProperties","_excluded","dropdown","useDropdown","_useBottomSheetContex","useBottomSheetContext","isInsideDropdown","dropdownBaseId","baseId","useId","throwBladeError","message","moduleName","React","useEffect","undefined","logger","type","concat","effectiveSelectionType","properties","useMemo","getTreeViewProperties","orderedNodes","nodeMap","rootValues","options","_React$useState","useState","Set","filter","node","kind","isBranch","defaultIsExpanded","map","_React$useState2","_slicedToArray","uncontrolledExpandedValues","setUncontrolledExpandedValues","expandedValues","merged","_iterator","_createForOfIteratorHelper","_step","s","n","done","_node$controlledIsExp","isExpanded","controlledIsExpanded","has","add","err","e","f","onNodeExpandToggle","nodeValue","_node$onExpandChange","isDisabled","previous","next","onExpandChange","call","isControlledSelection","_React$useState3","_React$useState4","uncontrolledSelectedValues","setUncontrolledSelectedValues","standaloneSelectedValues","dropdownSelectedValues","selected","_iterator2","selectedIndices","_step2","_dropdown$options$sel","selectedIndex","optionValue","selectedValuesSet","emitStandaloneChange","values","_toConsumableArray","selectedGroups","getSelectedLeafValues","getSelectedGroups","selectedValues","onNodeSelect","isSelectable","size","selectableLeafValues","length","getSelectionOnNodeToggle","toggleBranchInDropdown","leafIndices","leafValue","_nodeMap$leafValue$op","_nodeMap$leafValue","optionIndex","areAllSelected","every","includes","selectOptionsBatch","onDropdownNodeClick","event","clickedValue","_options$node$optionI","_options$node$optionI2","_dropdown$triggererRe","onClickTrigger","setActiveIndex","triggererRef","current","focus","_dropdown$triggererRe2","_dropdown$triggererRe3","onOptionClick","previousPropertiesRef","useRef","previousProperties","setOptions","isControlled","previousSelectedValues","_previousProperties$o","inherited","getSelectionAfterLoad","previousNodeMap","nextIndices","selectedValue","findIndex","option","hasChanged","some","i","setSelectedIndices","setChangeCallbackTriggerer","changeCallbackTriggerer","getNodeAtIndex","_options$optionIndex","treeViewControllerRef","getVisibleOptionIndices","onArrowRightKeydown","currentActiveIndex","firstChildIndex","childValues","childValue","childNode","find","onArrowLeftKeydown","parentValue","_nodeMap$node$parentV","_nodeMap$node$parentV2","parentIndex","handleOptionSelect","_ref2","arguments","key","_options$optionIndex$","_options$optionIndex2","_options$optionIndex$2","_options$optionIndex3","_options$optionIndex$3","_options$optionIndex4","branchSelected","getBranchSelectionState","_options$selectedInde","getDisplayOverride","_options$selectedInde2","rowRefs","registerRowRef","element","_React$useState5","_React$useState6","focusedValue","setFocusedValue","visibleValues","getVisibleValues","tabbableValue","_options$dropdown$act","activeIndex","activeValue","_rowRefs$current$acti","_rowRefs$current$acti2","scrollIntoView","block","handleKeyDown","_closest","_ref3","rowElement","target","closest","currentValue","getAttribute","currentVisibleIndex","indexOf","focusRow","_rowRefs$current$node","preventDefault","_options$node$optionI3","_options$node$optionI4","isNodeSelected","_options$node$optionI5","_options$node$optionI6","_options$node$optionI7","_options$node$optionI8","contextValue","isKeydownPressed","isTreeFirstRenderRef","useTreeViewMountScopeRef","treeContent","_jsx","id","onKeyDown","makeAccessible","role","multiSelectable","labelledBy","TreeViewMountScopeContext","Provider","TreeViewContext","metaAttribute","MetaConstants","TreeView","makeAnalyticsAttribute","assignWithoutSideEffects","componentIds"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,IAAMA,4BAA4B,gBAAGC,MAAM,CAACC,OAAO,CAAC,CAAAC,UAAA,CAAA;EAAAC,WAAA,EAAA,2CAAA;EAAAC,WAAA,EAAA,UAAA;AAAA,CAAA,CAAA,CAAC,UAACC,KAAK,EAAA;AAAA,EAAA,OAAAC,aAAA,CAAA;AACzDC,IAAAA,SAAS,EAAE,MAAA;AAAM,GAAA,EACdC,2BAA2B,CAAC;IAAEC,KAAK,EAAEJ,KAAK,CAACI,KAAK;AAAEC,IAAAA,eAAe,EAAE,KAAA;AAAM,GAAC,CAAC,CAAA,CAAA;AAAA,CAC9E,CAAC,CAAA;AAEH,IAAMC,SAAS,GAAG,SAAZA,SAASA,CAAAC,IAAA,EAS0B;EAAA,IAAAC,qBAAA,EAAAC,eAAA,CAAA;AAAA,EAAA,IARvCC,QAAQ,GAAAH,IAAA,CAARG,QAAQ;IACRC,aAAa,GAAAJ,IAAA,CAAbI,aAAa;IACbC,KAAK,GAAAL,IAAA,CAALK,KAAK;IACLC,YAAY,GAAAN,IAAA,CAAZM,YAAY;IACZC,QAAQ,GAAAP,IAAA,CAARO,QAAQ;IACRC,IAAI,GAAAR,IAAA,CAAJQ,IAAI;IACJC,MAAM,GAAAT,IA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AAAA,MAAM,EAANA,MAAAA;AAAO,KAAC,CAAC,CAAA,EACvDgO,sBAAsB,CAAC/N,IAAI,CAAC,CAAA,EAAA,EAAA,EAAA;AAAAP,MAAAA,QAAA,EAE/Bc,gBAAgB,gBACf2M,GAAA,CAACzO,4BAA4B,EAAA;AAAAgB,QAAAA,QAAA,EAAEwN,WAAAA;AAAW,OAA+B,CAAC,GAE1EA,WAAAA;KAEK,CAAA,CAAA;AAAC,GACc,CAAC,CAAA;AAE/B,CAAC,CAAA;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAMa,QAAQ,gBAAGE,wBAAwB,CAAC3O,SAAS,EAAE;EACnDP,WAAW,EAAEmP,YAAY,CAACH,QAAQ;EAClCjP,WAAW,EAAEoP,YAAY,CAACH,QAAAA;AAC5B,CAAC;;;;"}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
import styled from 'styled-components';
|
|
4
|
+
import '../Box/BaseBox/index.js';
|
|
5
|
+
import '../../utils/index.js';
|
|
6
|
+
import '../../utils/makeMotionTime/index.web.js';
|
|
7
|
+
import { jsx } from 'react/jsx-runtime';
|
|
8
|
+
import { BaseBox } from '../Box/BaseBox/BaseBox.web.js';
|
|
9
|
+
import { makeMotionTime } from '../../utils/makeMotionTime/makeMotionTime.web.js';
|
|
10
|
+
import { castWebType } from '../../utils/platform/castUtils.js';
|
|
11
|
+
|
|
12
|
+
var StyledTreeViewAnimator = /*#__PURE__*/styled(BaseBox).withConfig({
|
|
13
|
+
displayName: "TreeViewAnimatorweb__StyledTreeViewAnimator",
|
|
14
|
+
componentId: "sc-1ssmrrr-0"
|
|
15
|
+
})(function (props) {
|
|
16
|
+
return {
|
|
17
|
+
display: 'grid',
|
|
18
|
+
// B5: animate grid-template-rows (0fr <-> 1fr), never height
|
|
19
|
+
gridTemplateRows: props.isExpanded ? '1fr' : '0fr',
|
|
20
|
+
transition: "grid-template-rows ".concat(makeMotionTime(props.theme.motion.duration.quick), " ").concat(castWebType(props.theme.motion.easing.standard)),
|
|
21
|
+
'& > div': {
|
|
22
|
+
// clipping is only needed while the group is collapsed or moving: a clipping wrapper also
|
|
23
|
+
// cuts off the focus ring of the rows inside it, since the ring is an `outline` painted
|
|
24
|
+
// outside the row's box (getFocusRingStyles)
|
|
25
|
+
overflow: props.isClipped ? 'hidden' : 'visible',
|
|
26
|
+
minHeight: '0px',
|
|
27
|
+
visibility: props.isExpanded ? 'visible' : 'hidden',
|
|
28
|
+
// keep content visible while the collapse animation runs, then hide it (also removes it from AT)
|
|
29
|
+
transition: props.isExpanded ? undefined : "visibility 0s linear ".concat(makeMotionTime(props.theme.motion.duration.quick))
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Tracks whether the wrapper must clip its content.
|
|
36
|
+
*
|
|
37
|
+
* It has to clip while collapsed and while a transition is in flight, and must stop clipping
|
|
38
|
+
* once fully open and idle so the focus ring of rows inside can paint outside their box
|
|
39
|
+
*/
|
|
40
|
+
var useTreeViewAnimatorClip = function useTreeViewAnimatorClip(isOpen) {
|
|
41
|
+
var animatorRef = React__default.useRef(null);
|
|
42
|
+
// a wrapper that mounts already open never transitions, so it starts released
|
|
43
|
+
// and does not wait for a transitionend that will never come
|
|
44
|
+
var _React$useState = React__default.useState(isOpen),
|
|
45
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
46
|
+
isClipReleased = _React$useState2[0],
|
|
47
|
+
setIsClipReleased = _React$useState2[1];
|
|
48
|
+
var previousIsOpenRef = React__default.useRef(isOpen);
|
|
49
|
+
if (previousIsOpenRef.current !== isOpen) {
|
|
50
|
+
previousIsOpenRef.current = isOpen;
|
|
51
|
+
if (isClipReleased) {
|
|
52
|
+
// a transition is starting: re-clip synchronously, so no frame is painted unclipped.
|
|
53
|
+
// Resetting here (rather than at the end of the closing transition) also covers a
|
|
54
|
+
// collapse that gets interrupted by a re-expand and never fires its transitionend
|
|
55
|
+
setIsClipReleased(false);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
var onTransitionEnd = function onTransitionEnd(event) {
|
|
59
|
+
// nested groups animate the same property and transitionend bubbles, so ignore descendants
|
|
60
|
+
if (event.target !== animatorRef.current || event.propertyName !== 'grid-template-rows') {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
setIsClipReleased(isOpen);
|
|
64
|
+
};
|
|
65
|
+
return {
|
|
66
|
+
isClipped: !isClipReleased,
|
|
67
|
+
animatorRef: animatorRef,
|
|
68
|
+
onTransitionEnd: onTransitionEnd
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Marks a "mount scope": the ref is `true` while the scope (the whole tree, or one
|
|
74
|
+
* children group) is doing its very first render, and flips to `false` after mount.
|
|
75
|
+
*
|
|
76
|
+
* A row reading `true` mounted together with its scope (initial tree mount, or a whole
|
|
77
|
+
* async group mounting - the scope's own animation covers it). A row reading `false`
|
|
78
|
+
* was appended into an existing scope later (e.g. through TreeViewLoadMore) and
|
|
79
|
+
* animates its own mount
|
|
80
|
+
*/
|
|
81
|
+
var TreeViewMountScopeContext = /*#__PURE__*/React__default.createContext(null);
|
|
82
|
+
var useTreeViewMountScopeRef = function useTreeViewMountScopeRef() {
|
|
83
|
+
var isScopeFirstRenderRef = React__default.useRef(true);
|
|
84
|
+
React__default.useEffect(function () {
|
|
85
|
+
isScopeFirstRenderRef.current = false;
|
|
86
|
+
}, []);
|
|
87
|
+
return isScopeFirstRenderRef;
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Expand / collapse animation for a branch's children group (B5)
|
|
92
|
+
*
|
|
93
|
+
* Also starts a new mount scope so rows mounting together with the group don't
|
|
94
|
+
* double-animate on top of the group's own mount animation
|
|
95
|
+
*/
|
|
96
|
+
var TreeViewGroupAnimator = function TreeViewGroupAnimator(_ref) {
|
|
97
|
+
var isExpanded = _ref.isExpanded,
|
|
98
|
+
shouldAnimateMount = _ref.shouldAnimateMount,
|
|
99
|
+
children = _ref.children;
|
|
100
|
+
var isScopeFirstRenderRef = useTreeViewMountScopeRef();
|
|
101
|
+
|
|
102
|
+
// B5: when async children arrive while the branch is already expanded, the group mounts
|
|
103
|
+
// directly in the expanded (1fr) state and would paint statically. Mount it collapsed
|
|
104
|
+
// and flip on the next frame so the 0fr -> 1fr transition runs
|
|
105
|
+
var _React$useState3 = React__default.useState(shouldAnimateMount && isExpanded),
|
|
106
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
107
|
+
isMountFramePending = _React$useState4[0],
|
|
108
|
+
setIsMountFramePending = _React$useState4[1];
|
|
109
|
+
React__default.useEffect(function () {
|
|
110
|
+
if (!isMountFramePending) {
|
|
111
|
+
return undefined;
|
|
112
|
+
}
|
|
113
|
+
var animationFrame = requestAnimationFrame(function () {
|
|
114
|
+
return setIsMountFramePending(false);
|
|
115
|
+
});
|
|
116
|
+
return function () {
|
|
117
|
+
return cancelAnimationFrame(animationFrame);
|
|
118
|
+
};
|
|
119
|
+
}, [isMountFramePending]);
|
|
120
|
+
var isOpen = isExpanded && !isMountFramePending;
|
|
121
|
+
var _useTreeViewAnimatorC = useTreeViewAnimatorClip(isOpen),
|
|
122
|
+
isClipped = _useTreeViewAnimatorC.isClipped,
|
|
123
|
+
animatorRef = _useTreeViewAnimatorC.animatorRef,
|
|
124
|
+
onTransitionEnd = _useTreeViewAnimatorC.onTransitionEnd;
|
|
125
|
+
return /*#__PURE__*/jsx(TreeViewMountScopeContext.Provider, {
|
|
126
|
+
value: isScopeFirstRenderRef,
|
|
127
|
+
children: /*#__PURE__*/jsx(StyledTreeViewAnimator, {
|
|
128
|
+
ref: animatorRef,
|
|
129
|
+
isExpanded: isOpen,
|
|
130
|
+
isClipped: isClipped,
|
|
131
|
+
onTransitionEnd: onTransitionEnd,
|
|
132
|
+
children: children
|
|
133
|
+
})
|
|
134
|
+
});
|
|
135
|
+
};
|
|
136
|
+
var AnimatedRowMount = function AnimatedRowMount(_ref2) {
|
|
137
|
+
var children = _ref2.children;
|
|
138
|
+
// same trick as the group animator: mount collapsed (0fr), flip to 1fr on the next frame
|
|
139
|
+
var _React$useState5 = React__default.useState(true),
|
|
140
|
+
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
141
|
+
isMountFramePending = _React$useState6[0],
|
|
142
|
+
setIsMountFramePending = _React$useState6[1];
|
|
143
|
+
React__default.useEffect(function () {
|
|
144
|
+
var animationFrame = requestAnimationFrame(function () {
|
|
145
|
+
return setIsMountFramePending(false);
|
|
146
|
+
});
|
|
147
|
+
return function () {
|
|
148
|
+
return cancelAnimationFrame(animationFrame);
|
|
149
|
+
};
|
|
150
|
+
}, []);
|
|
151
|
+
var isOpen = !isMountFramePending;
|
|
152
|
+
var _useTreeViewAnimatorC2 = useTreeViewAnimatorClip(isOpen),
|
|
153
|
+
isClipped = _useTreeViewAnimatorC2.isClipped,
|
|
154
|
+
animatorRef = _useTreeViewAnimatorC2.animatorRef,
|
|
155
|
+
onTransitionEnd = _useTreeViewAnimatorC2.onTransitionEnd;
|
|
156
|
+
return /*#__PURE__*/jsx(StyledTreeViewAnimator, {
|
|
157
|
+
ref: animatorRef,
|
|
158
|
+
isExpanded: isOpen,
|
|
159
|
+
isClipped: isClipped,
|
|
160
|
+
onTransitionEnd: onTransitionEnd,
|
|
161
|
+
children: children
|
|
162
|
+
});
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Animates a row's own mount when it is appended into an already-mounted scope
|
|
167
|
+
* (e.g. new rows arriving through TreeViewLoadMore). Rows mounting together with
|
|
168
|
+
* their scope render as-is - the scope's animation (if any) covers them
|
|
169
|
+
*/
|
|
170
|
+
var TreeViewRowMountAnimator = function TreeViewRowMountAnimator(_ref3) {
|
|
171
|
+
var children = _ref3.children;
|
|
172
|
+
var scopeRef = React__default.useContext(TreeViewMountScopeContext);
|
|
173
|
+
// captured once on the row's first render: a later flip of the scope ref must not re-wrap the row
|
|
174
|
+
var shouldAnimateMountRef = React__default.useRef(scopeRef ? !scopeRef.current : false);
|
|
175
|
+
if (!shouldAnimateMountRef.current) {
|
|
176
|
+
return children;
|
|
177
|
+
}
|
|
178
|
+
return /*#__PURE__*/jsx(AnimatedRowMount, {
|
|
179
|
+
children: children
|
|
180
|
+
});
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
export { TreeViewGroupAnimator, TreeViewMountScopeContext, TreeViewRowMountAnimator, useTreeViewMountScopeRef };
|
|
184
|
+
//# sourceMappingURL=TreeViewAnimator.web.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TreeViewAnimator.web.js","sources":["../../../../../../src/components/TreeView/TreeViewAnimator.web.tsx"],"sourcesContent":["import React from 'react';\nimport styled from 'styled-components';\nimport BaseBox from '~components/Box/BaseBox';\nimport { castWebType } from '~utils';\nimport { makeMotionTime } from '~utils/makeMotionTime';\n\nconst StyledTreeViewAnimator = styled(BaseBox)<{ isExpanded: boolean; isClipped: boolean }>(\n (props) => ({\n display: 'grid',\n // B5: animate grid-template-rows (0fr <-> 1fr), never height\n gridTemplateRows: props.isExpanded ? '1fr' : '0fr',\n transition: `grid-template-rows ${makeMotionTime(\n props.theme.motion.duration.quick,\n )} ${castWebType(props.theme.motion.easing.standard)}`,\n '& > div': {\n // clipping is only needed while the group is collapsed or moving: a clipping wrapper also\n // cuts off the focus ring of the rows inside it, since the ring is an `outline` painted\n // outside the row's box (getFocusRingStyles)\n overflow: props.isClipped ? 'hidden' : 'visible',\n minHeight: '0px',\n visibility: props.isExpanded ? 'visible' : 'hidden',\n // keep content visible while the collapse animation runs, then hide it (also removes it from AT)\n transition: props.isExpanded\n ? undefined\n : `visibility 0s linear ${makeMotionTime(props.theme.motion.duration.quick)}`,\n },\n }),\n);\n\n/**\n * Tracks whether the wrapper must clip its content.\n *\n * It has to clip while collapsed and while a transition is in flight, and must stop clipping\n * once fully open and idle so the focus ring of rows inside can paint outside their box\n */\nconst useTreeViewAnimatorClip = (\n isOpen: boolean,\n): {\n isClipped: boolean;\n animatorRef: React.RefObject<HTMLDivElement>;\n onTransitionEnd: (event: React.TransitionEvent<HTMLElement>) => void;\n} => {\n const animatorRef = React.useRef<HTMLDivElement>(null);\n // a wrapper that mounts already open never transitions, so it starts released\n // and does not wait for a transitionend that will never come\n const [isClipReleased, setIsClipReleased] = React.useState(isOpen);\n const previousIsOpenRef = React.useRef(isOpen);\n\n if (previousIsOpenRef.current !== isOpen) {\n previousIsOpenRef.current = isOpen;\n if (isClipReleased) {\n // a transition is starting: re-clip synchronously, so no frame is painted unclipped.\n // Resetting here (rather than at the end of the closing transition) also covers a\n // collapse that gets interrupted by a re-expand and never fires its transitionend\n setIsClipReleased(false);\n }\n }\n\n const onTransitionEnd = (event: React.TransitionEvent<HTMLElement>): void => {\n // nested groups animate the same property and transitionend bubbles, so ignore descendants\n if (event.target !== animatorRef.current || event.propertyName !== 'grid-template-rows') {\n return;\n }\n setIsClipReleased(isOpen);\n };\n\n return {\n isClipped: !isClipReleased,\n animatorRef,\n onTransitionEnd,\n };\n};\n\n/**\n * Marks a \"mount scope\": the ref is `true` while the scope (the whole tree, or one\n * children group) is doing its very first render, and flips to `false` after mount.\n *\n * A row reading `true` mounted together with its scope (initial tree mount, or a whole\n * async group mounting - the scope's own animation covers it). A row reading `false`\n * was appended into an existing scope later (e.g. through TreeViewLoadMore) and\n * animates its own mount\n */\nconst TreeViewMountScopeContext = React.createContext<React.MutableRefObject<boolean> | null>(null);\n\nconst useTreeViewMountScopeRef = (): React.MutableRefObject<boolean> => {\n const isScopeFirstRenderRef = React.useRef(true);\n React.useEffect(() => {\n isScopeFirstRenderRef.current = false;\n }, []);\n return isScopeFirstRenderRef;\n};\n\n/**\n * Expand / collapse animation for a branch's children group (B5)\n *\n * Also starts a new mount scope so rows mounting together with the group don't\n * double-animate on top of the group's own mount animation\n */\nconst TreeViewGroupAnimator = ({\n isExpanded,\n shouldAnimateMount,\n children,\n}: {\n isExpanded: boolean;\n shouldAnimateMount: boolean;\n children: React.ReactNode;\n}): React.ReactElement => {\n const isScopeFirstRenderRef = useTreeViewMountScopeRef();\n\n // B5: when async children arrive while the branch is already expanded, the group mounts\n // directly in the expanded (1fr) state and would paint statically. Mount it collapsed\n // and flip on the next frame so the 0fr -> 1fr transition runs\n const [isMountFramePending, setIsMountFramePending] = React.useState(\n shouldAnimateMount && isExpanded,\n );\n React.useEffect(() => {\n if (!isMountFramePending) {\n return undefined;\n }\n const animationFrame = requestAnimationFrame(() => setIsMountFramePending(false));\n return () => cancelAnimationFrame(animationFrame);\n }, [isMountFramePending]);\n\n const isOpen = isExpanded && !isMountFramePending;\n const { isClipped, animatorRef, onTransitionEnd } = useTreeViewAnimatorClip(isOpen);\n\n return (\n <TreeViewMountScopeContext.Provider value={isScopeFirstRenderRef}>\n <StyledTreeViewAnimator\n ref={animatorRef as never}\n isExpanded={isOpen}\n isClipped={isClipped}\n onTransitionEnd={onTransitionEnd}\n >\n {children}\n </StyledTreeViewAnimator>\n </TreeViewMountScopeContext.Provider>\n );\n};\n\nconst AnimatedRowMount = ({ children }: { children: React.ReactNode }): React.ReactElement => {\n // same trick as the group animator: mount collapsed (0fr), flip to 1fr on the next frame\n const [isMountFramePending, setIsMountFramePending] = React.useState(true);\n React.useEffect(() => {\n const animationFrame = requestAnimationFrame(() => setIsMountFramePending(false));\n return () => cancelAnimationFrame(animationFrame);\n }, []);\n\n const isOpen = !isMountFramePending;\n const { isClipped, animatorRef, onTransitionEnd } = useTreeViewAnimatorClip(isOpen);\n\n return (\n <StyledTreeViewAnimator\n ref={animatorRef as never}\n isExpanded={isOpen}\n isClipped={isClipped}\n onTransitionEnd={onTransitionEnd}\n >\n {children}\n </StyledTreeViewAnimator>\n );\n};\n\n/**\n * Animates a row's own mount when it is appended into an already-mounted scope\n * (e.g. new rows arriving through TreeViewLoadMore). Rows mounting together with\n * their scope render as-is - the scope's animation (if any) covers them\n */\nconst TreeViewRowMountAnimator = ({\n children,\n}: {\n children: React.ReactElement;\n}): React.ReactElement => {\n const scopeRef = React.useContext(TreeViewMountScopeContext);\n // captured once on the row's first render: a later flip of the scope ref must not re-wrap the row\n const shouldAnimateMountRef = React.useRef(scopeRef ? !scopeRef.current : false);\n\n if (!shouldAnimateMountRef.current) {\n return children;\n }\n return <AnimatedRowMount>{children}</AnimatedRowMount>;\n};\n\nexport {\n TreeViewGroupAnimator,\n TreeViewRowMountAnimator,\n TreeViewMountScopeContext,\n useTreeViewMountScopeRef,\n};\n"],"names":["StyledTreeViewAnimator","styled","BaseBox","withConfig","displayName","componentId","props","display","gridTemplateRows","isExpanded","transition","concat","makeMotionTime","theme","motion","duration","quick","castWebType","easing","standard","overflow","isClipped","minHeight","visibility","undefined","useTreeViewAnimatorClip","isOpen","animatorRef","React","useRef","_React$useState","useState","_React$useState2","_slicedToArray","isClipReleased","setIsClipReleased","previousIsOpenRef","current","onTransitionEnd","event","target","propertyName","TreeViewMountScopeContext","createContext","useTreeViewMountScopeRef","isScopeFirstRenderRef","useEffect","TreeViewGroupAnimator","_ref","shouldAnimateMount","children","_React$useState3","_React$useState4","isMountFramePending","setIsMountFramePending","animationFrame","requestAnimationFrame","cancelAnimationFrame","_useTreeViewAnimatorC","_jsx","Provider","value","ref","AnimatedRowMount","_ref2","_React$useState5","_React$useState6","_useTreeViewAnimatorC2","TreeViewRowMountAnimator","_ref3","scopeRef","useContext","shouldAnimateMountRef"],"mappings":";;;;;;;;;;;AAMA,IAAMA,sBAAsB,gBAAGC,MAAM,CAACC,OAAO,CAAC,CAAAC,UAAA,CAAA;EAAAC,WAAA,EAAA,6CAAA;EAAAC,WAAA,EAAA,cAAA;AAAA,CAAA,CAAA,CAC5C,UAACC,KAAK,EAAA;EAAA,OAAM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BL,IAAAA,SAAS,EAAEA,SAAU;AACrBiB,IAAAA,eAAe,EAAEA,eAAgB;AAAAY,IAAAA,QAAA,EAEhCA,QAAAA;AAAQ,GACa,CAAC,CAAA;AAE7B,CAAC,CAAA;;AAED;AACA;AACA;AACA;AACA;AACA,IAAMkB,wBAAwB,GAAG,SAA3BA,wBAAwBA,CAAAC,KAAA,EAIJ;AAAA,EAAA,IAHxBnB,QAAQ,GAAAmB,KAAA,CAARnB,QAAQ,CAAA;AAIR,EAAA,IAAMoB,QAAQ,GAAG1C,cAAK,CAAC2C,UAAU,CAAC7B,yBAAyB,CAAC,CAAA;AAC5D;AACA,EAAA,IAAM8B,qBAAqB,GAAG5C,cAAK,CAACC,MAAM,CAACyC,QAAQ,GAAG,CAACA,QAAQ,CAACjC,OAAO,GAAG,KAAK,CAAC,CAAA;AAEhF,EAAA,IAAI,CAACmC,qBAAqB,CAACnC,OAAO,EAAE;AAClC,IAAA,OAAOa,QAAQ,CAAA;AACjB,GAAA;EACA,oBAAOS,GAAA,CAACI,gBAAgB,EAAA;AAAAb,IAAAA,QAAA,EAAEA,QAAAA;AAAQ,GAAmB,CAAC,CAAA;AACxD;;;;"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
2
|
+
import 'react';
|
|
3
|
+
import styled from 'styled-components';
|
|
4
|
+
import '../Box/BaseBox/index.js';
|
|
5
|
+
import '../Icons/index.js';
|
|
6
|
+
import '../Spinner/index.js';
|
|
7
|
+
import '../../tokens/global/index.js';
|
|
8
|
+
import '../../utils/index.js';
|
|
9
|
+
import '../../utils/makeAccessible/index.js';
|
|
10
|
+
import '../../utils/makeMotionTime/index.web.js';
|
|
11
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
12
|
+
import { size } from '../../tokens/global/size.js';
|
|
13
|
+
import { BaseBox } from '../Box/BaseBox/BaseBox.web.js';
|
|
14
|
+
import { makeMotionTime } from '../../utils/makeMotionTime/makeMotionTime.web.js';
|
|
15
|
+
import { castWebType } from '../../utils/platform/castUtils.js';
|
|
16
|
+
import { makeSize } from '../../utils/makeSize/makeSize.js';
|
|
17
|
+
import { makeAccessible } from '../../utils/makeAccessible/makeAccessible.web.js';
|
|
18
|
+
import { Spinner } from '../Spinner/Spinner/Spinner.js';
|
|
19
|
+
import ChevronRightIcon from '../Icons/ChevronRightIcon/ChevronRightIcon.js';
|
|
20
|
+
|
|
21
|
+
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; }
|
|
22
|
+
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; }
|
|
23
|
+
var CHEVRON_GUTTER_SIZE = size[20];
|
|
24
|
+
var StyledChevronRotator = /*#__PURE__*/styled(BaseBox).withConfig({
|
|
25
|
+
displayName: "TreeViewChevronweb__StyledChevronRotator",
|
|
26
|
+
componentId: "sc-18v4kok-0"
|
|
27
|
+
})(function (props) {
|
|
28
|
+
return {
|
|
29
|
+
display: 'flex',
|
|
30
|
+
alignItems: 'center',
|
|
31
|
+
justifyContent: 'center',
|
|
32
|
+
transform: props.isExpanded ? 'rotate(90deg)' : 'rotate(0deg)',
|
|
33
|
+
transition: "transform ".concat(makeMotionTime(props.theme.motion.duration.quick), " ").concat(castWebType(props.theme.motion.easing.standard))
|
|
34
|
+
};
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Internal chevron slot of TreeViewItem: a 20px slot with a 16px chevron
|
|
39
|
+
* (or Spinner while loading). Every row reserves the slot - on leaves it stays empty (B9)
|
|
40
|
+
* so a leaf's content lines up with the content of its branch siblings
|
|
41
|
+
*/
|
|
42
|
+
var TreeViewChevron = function TreeViewChevron(_ref) {
|
|
43
|
+
var state = _ref.state,
|
|
44
|
+
isDisabled = _ref.isDisabled,
|
|
45
|
+
onClick = _ref.onClick;
|
|
46
|
+
var isExpandable = state === 'collapsed' || state === 'expanded';
|
|
47
|
+
return /*#__PURE__*/jsxs(BaseBox, _objectSpread(_objectSpread({
|
|
48
|
+
display: "flex",
|
|
49
|
+
alignItems: "center",
|
|
50
|
+
justifyContent: "center",
|
|
51
|
+
width: makeSize(CHEVRON_GUTTER_SIZE),
|
|
52
|
+
height: makeSize(CHEVRON_GUTTER_SIZE),
|
|
53
|
+
flexShrink: 0,
|
|
54
|
+
onClick: isExpandable && !isDisabled ? castWebType(onClick) : undefined
|
|
55
|
+
// treeitem's aria-expanded carries the expansion semantics; the chevron is decorative
|
|
56
|
+
}, makeAccessible({
|
|
57
|
+
hidden: true
|
|
58
|
+
})), {}, {
|
|
59
|
+
children: [state === 'loading' ? /*#__PURE__*/jsx(Spinner, {
|
|
60
|
+
accessibilityLabel: "Loading",
|
|
61
|
+
size: "medium"
|
|
62
|
+
}) : null, isExpandable ? /*#__PURE__*/jsx(StyledChevronRotator, {
|
|
63
|
+
isExpanded: state === 'expanded',
|
|
64
|
+
children: /*#__PURE__*/jsx(ChevronRightIcon, {
|
|
65
|
+
size: "medium",
|
|
66
|
+
color: isDisabled ? 'interactive.icon.gray.disabled' : 'interactive.icon.gray.muted'
|
|
67
|
+
})
|
|
68
|
+
}) : null]
|
|
69
|
+
}));
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export { CHEVRON_GUTTER_SIZE, TreeViewChevron };
|
|
73
|
+
//# sourceMappingURL=TreeViewChevron.web.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TreeViewChevron.web.js","sources":["../../../../../../src/components/TreeView/TreeViewChevron.web.tsx"],"sourcesContent":["import React from 'react';\nimport styled from 'styled-components';\nimport BaseBox from '~components/Box/BaseBox';\nimport { ChevronRightIcon } from '~components/Icons';\nimport { Spinner } from '~components/Spinner';\nimport { size } from '~tokens/global';\nimport { castWebType, makeSize } from '~utils';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport { makeMotionTime } from '~utils/makeMotionTime';\n\nconst CHEVRON_GUTTER_SIZE = size[20];\n\ntype TreeViewChevronState = 'collapsed' | 'expanded' | 'loading' | 'leaf';\n\ntype TreeViewChevronProps = {\n state: TreeViewChevronState;\n isDisabled?: boolean;\n onClick?: (event: React.MouseEvent<HTMLDivElement>) => void;\n};\n\nconst StyledChevronRotator = styled(BaseBox)<{ isExpanded: boolean }>((props) => ({\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n transform: props.isExpanded ? 'rotate(90deg)' : 'rotate(0deg)',\n transition: `transform ${makeMotionTime(props.theme.motion.duration.quick)} ${castWebType(\n props.theme.motion.easing.standard,\n )}`,\n}));\n\n/**\n * Internal chevron slot of TreeViewItem: a 20px slot with a 16px chevron\n * (or Spinner while loading). Every row reserves the slot - on leaves it stays empty (B9)\n * so a leaf's content lines up with the content of its branch siblings\n */\nconst TreeViewChevron = ({\n state,\n isDisabled,\n onClick,\n}: TreeViewChevronProps): React.ReactElement => {\n const isExpandable = state === 'collapsed' || state === 'expanded';\n\n return (\n <BaseBox\n display=\"flex\"\n alignItems=\"center\"\n justifyContent=\"center\"\n width={makeSize(CHEVRON_GUTTER_SIZE)}\n height={makeSize(CHEVRON_GUTTER_SIZE)}\n flexShrink={0}\n onClick={isExpandable && !isDisabled ? castWebType(onClick) : undefined}\n // treeitem's aria-expanded carries the expansion semantics; the chevron is decorative\n {...makeAccessible({ hidden: true })}\n >\n {state === 'loading' ? <Spinner accessibilityLabel=\"Loading\" size=\"medium\" /> : null}\n {isExpandable ? (\n <StyledChevronRotator isExpanded={state === 'expanded'}>\n <ChevronRightIcon\n size=\"medium\"\n color={isDisabled ? 'interactive.icon.gray.disabled' : 'interactive.icon.gray.muted'}\n />\n </StyledChevronRotator>\n ) : null}\n </BaseBox>\n );\n};\n\nexport { TreeViewChevron, CHEVRON_GUTTER_SIZE };\nexport type { TreeViewChevronState };\n"],"names":["CHEVRON_GUTTER_SIZE","size","StyledChevronRotator","styled","BaseBox","withConfig","displayName","componentId","props","display","alignItems","justifyContent","transform","isExpanded","transition","concat","makeMotionTime","theme","motion","duration","quick","castWebType","easing","standard","TreeViewChevron","_ref","state","isDisabled","onClick","isExpandable","_jsxs","_objectSpread","width","makeSize","height","flexShrink","undefined","makeAccessible","hidden","children","_jsx","Spinner","accessibilityLabel","ChevronRightIcon","color"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAUA,IAAMA,mBAAmB,GAAGC,IAAI,CAAC,EAAE,EAAC;AAUpC,IAAMC,oBAAoB,gBAAGC,MAAM,CAACC,OAAO,CAAC,CAAAC,UAAA,CAAA;EAAAC,WAAA,EAAA,0CAAA;EAAAC,WAAA,EAAA,cAAA;AAAA,CAAA,CAAA,CAA0B,UAACC,KAAK,EAAA;EAAA,OAAM;AAChFC,IAAAA,OAAO,EAAE,MAAM;AACfC,IAAAA,UAAU,EAAE,QAAQ;AACpBC,IAAAA,cAAc,EAAE,QAAQ;AACxBC,IAAAA,SAAS,EAAEJ,KAAK,CAACK,UAAU,GAAG,eAAe,GAAG,cAAc;AAC9DC,IAAAA,UAAU,EAAAC,YAAAA,CAAAA,MAAA,CAAeC,cAAc,CAACR,KAAK,CAACS,KAAK,CAACC,MAAM,CAACC,QAAQ,CAACC,KAAK,CAAC,EAAA,GAAA,CAAA,CAAAL,MAAA,CAAIM,WAAW,CACvFb,KAAK,CAACS,KAAK,CAACC,MAAM,CAACI,MAAM,CAACC,QAC5B,CAAC,CAAA;GACF,CAAA;AAAA,CAAC,CAAC,CAAA;;AAEH;AACA;AACA;AACA;AACA;AACA,IAAMC,eAAe,GAA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