@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buttonTokens.js","sources":["../../../../../../src/components/Button/BaseButton/buttonTokens.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/explicit-function-return-type */\nimport type { BaseButtonProps } from './BaseButton';\nimport type { Theme } from '~components/BladeProvider';\nimport type { IconSize } from '~components/Icons';\nimport type { SpinnerProps } from '~components/Spinner';\nimport type { Size } from '~tokens/global';\nimport { size } from '~tokens/global';\nimport type { FeedbackColors } from '~tokens/theme/theme';\nimport { makeSize } from '~utils';\nimport type { DotNotationToken } from '~utils/lodashButBetter/get';\n\nexport type ButtonMinHeight = Size[28] | Size[32] | Size[36] | Size[48];\n\nexport type ButtonTypography = {\n fonts: {\n size: Record<NonNullable<BaseButtonProps['size']>, keyof Theme['typography']['fonts']['size']>;\n };\n lineHeights: Record<\n NonNullable<BaseButtonProps['size']>,\n keyof Theme['typography']['lineHeights']\n >;\n};\n\nconst backgroundGradient = (color: FeedbackColors | 'primary') => {\n return {\n base: {\n primary: {\n default: `interactive.background.${color}.default`,\n highlighted: `interactive.background.${color}.highlighted`,\n disabled: `interactive.background.${color}.disabled`,\n },\n secondary: {\n default: 'surface.background.gray.intense',\n highlighted: 'surface.background.gray.intense',\n disabled: 'interactive.background.staticWhite.ghost',\n },\n tertiary: {\n default: 'surface.background.gray.intense',\n highlighted: 'surface.background.gray.intense',\n disabled: 'interactive.background.staticWhite.ghost',\n },\n transparent: {\n default: 'transparent',\n highlighted: 'interactive.background.gray.faded',\n disabled: 'interactive.background.gray.disabled',\n },\n },\n white: {\n primary: {\n default: 'interactive.background.staticWhite.default',\n highlighted: 'interactive.background.staticWhite.highlighted',\n disabled: 'interactive.background.staticWhite.disabled',\n },\n secondary: {\n default: 'interactive.background.staticWhite.faded',\n highlighted: 'interactive.background.staticBlack.faded',\n disabled: 'interactive.background.gray.disabled',\n },\n tertiary: {\n default: 'interactive.background.staticWhite.faded',\n highlighted: 'interactive.background.staticBlack.faded',\n disabled: 'interactive.background.gray.disabled',\n },\n },\n } as const;\n};\n\ntype BoxShadowValue = {\n y: number;\n blur: number;\n spread: number;\n color: DotNotationToken<Theme['colors']>;\n};\n\ntype ButtonBoxShadow = BoxShadowValue[];\n\n/**\n * Box-shadow tokens for buttons (includes border + 3D effects)\n * Each shadow is: inset 0 {y}px {blur}px {spread}px {color}\n */\nconst boxShadow = (\n color: FeedbackColors | 'primary',\n): {\n base: Record<\n 'primary' | 'secondary' | 'tertiary' | 'transparent',\n Record<'default' | 'highlighted' | 'disabled', ButtonBoxShadow>\n >;\n white: Record<\n 'primary' | 'secondary' | 'tertiary',\n Record<'default' | 'highlighted' | 'disabled', ButtonBoxShadow>\n >;\n} => {\n return {\n base: {\n primary: {\n default: [\n { y: -1.5, blur: 0, spread: 0, color: `interactive.border.${color}.highlighted` },\n { y: 0, blur: 0, spread: 0.5, color: `interactive.border.${color}.default` },\n { y: 1.5, blur: 0, spread: 0, color: 'interactive.border.staticWhite.faded' },\n { y: -2, blur: 0, spread: 0, color: 'interactive.border.staticWhite.faded' },\n ],\n highlighted: [\n { y: -1.5, blur: 0, spread: 0, color: `interactive.border.${color}.highlighted` },\n { y: 0, blur: 0, spread: 0.5, color: `interactive.border.${color}.highlighted` },\n { y: 1.5, blur: 0, spread: 0, color: 'interactive.border.staticWhite.faded' },\n { y: -2, blur: 0, spread: 0, color: 'interactive.border.staticWhite.faded' },\n ],\n disabled: [],\n },\n secondary: {\n default: [\n { y: -1, blur: 0.5, spread: 0, color: 'interactive.border.staticBlack.fadedHighlighted' },\n { y: 0, blur: 0, spread: 1, color: 'interactive.border.gray.default' },\n { y: -1.5, blur: 0, spread: 0, color: 'interactive.border.gray.default' },\n ],\n highlighted: [\n { y: -1, blur: 0.5, spread: 0, color: 'interactive.border.staticBlack.fadedHighlighted' },\n { y: 0, blur: 0, spread: 1, color: 'interactive.border.gray.highlighted' },\n { y: -1.5, blur: 0, spread: 0, color: 'interactive.border.gray.default' },\n ],\n disabled: [{ y: 0, blur: 0, spread: 1, color: 'interactive.border.gray.disabled' }],\n },\n tertiary: {\n default: [\n { y: -1, blur: 0.5, spread: 0, color: 'interactive.border.staticBlack.fadedHighlighted' },\n { y: 0, blur: 0, spread: 1, color: 'interactive.border.gray.default' },\n { y: -1.5, blur: 0, spread: 0, color: 'interactive.border.gray.default' },\n ],\n highlighted: [\n { y: -1, blur: 0.5, spread: 0, color: 'interactive.border.staticBlack.fadedHighlighted' },\n { y: 0, blur: 0, spread: 1, color: 'interactive.border.gray.highlighted' },\n { y: -1.5, blur: 0, spread: 0, color: 'interactive.border.gray.default' },\n ],\n disabled: [{ y: 0, blur: 0, spread: 1, color: 'interactive.border.gray.disabled' }],\n },\n transparent: {\n default: [],\n highlighted: [],\n disabled: [],\n },\n },\n white: {\n primary: {\n default: [\n { y: -1.5, blur: 0, spread: 0, color: 'interactive.border.staticBlack.fadedHighlighted' },\n { y: 0, blur: 0, spread: 0.5, color: 'interactive.border.staticWhite.default' },\n ],\n highlighted: [\n { y: -1.5, blur: 0, spread: 0, color: 'interactive.border.staticBlack.fadedHighlighted' },\n { y: 0, blur: 0, spread: 0.5, color: 'interactive.border.staticWhite.default' },\n ],\n disabled: [],\n },\n secondary: {\n default: [\n { y: -1.5, blur: 0, spread: 0, color: 'interactive.border.staticBlack.fadedHighlighted' },\n { y: 0, blur: 0, spread: 1, color: 'interactive.border.staticWhite.highlighted' },\n ],\n highlighted: [\n { y: -1.5, blur: 0, spread: 0, color: 'interactive.border.staticBlack.fadedHighlighted' },\n { y: 0, blur: 0, spread: 1, color: 'interactive.border.staticWhite.highlighted' },\n ],\n disabled: [{ y: 0, blur: 0, spread: 1, color: 'interactive.border.staticWhite.disabled' }],\n },\n tertiary: {\n default: [\n { y: -1.5, blur: 0, spread: 0, color: 'interactive.border.staticBlack.fadedHighlighted' },\n { y: 0, blur: 0, spread: 1, color: 'interactive.border.staticWhite.highlighted' },\n ],\n highlighted: [\n { y: -1.5, blur: 0, spread: 0, color: 'interactive.border.staticBlack.fadedHighlighted' },\n { y: 0, blur: 0, spread: 1, color: 'interactive.border.staticWhite.highlighted' },\n ],\n disabled: [{ y: 0, blur: 0, spread: 1, color: 'interactive.border.staticWhite.disabled' }],\n },\n },\n };\n};\n\nconst textColor = (property: 'icon' | 'text') => {\n return {\n base: {\n primary: {\n default: `interactive.${property}.onPrimary.normal`,\n highlighted: `interactive.${property}.onPrimary.normal`,\n disabled: `interactive.${property}.primary.disabled`,\n },\n secondary: {\n default: `interactive.${property}.gray.normal`,\n highlighted: `interactive.${property}.gray.normal`,\n disabled: `interactive.${property}.gray.disabled`,\n },\n tertiary: {\n default: `interactive.${property}.gray.normal`,\n highlighted: `interactive.${property}.gray.normal`,\n disabled: `interactive.${property}.gray.disabled`,\n },\n },\n white: {\n primary: {\n default: `interactive.${property}.staticBlack.muted`,\n highlighted: `interactive.${property}.staticBlack.muted`,\n disabled: `interactive.${property}.staticBlack.disabled`,\n },\n secondary: {\n default: `interactive.${property}.staticWhite.normal`,\n highlighted: `interactive.${property}.staticWhite.normal`,\n disabled: `interactive.${property}.staticWhite.disabled`,\n },\n tertiary: {\n default: `interactive.${property}.staticWhite.normal`,\n highlighted: `interactive.${property}.staticWhite.normal`,\n disabled: `interactive.${property}.staticWhite.disabled`,\n },\n },\n transparent: {\n tertiary: {\n default: property === 'icon' ? 'interactive.icon.gray.muted' : 'surface.text.gray.normal',\n highlighted:\n property === 'icon' ? 'interactive.icon.gray.subtle' : 'surface.text.gray.normal',\n disabled: `interactive.${property}.gray.disabled`,\n },\n },\n\n color: (color: FeedbackColors) => {\n return {\n primary: {\n default: `interactive.${property}.staticWhite.normal`,\n highlighted: `interactive.${property}.staticWhite.normal`,\n disabled: `interactive.${property}.${color}.disabled`,\n },\n secondary: {\n default: `interactive.${property}.${color}.normal`,\n highlighted: `interactive.${property}.${color}.normal`,\n disabled: `interactive.${property}.${color}.disabled`,\n },\n } as const;\n },\n } as const;\n};\n\nconst typography: ButtonTypography = {\n fonts: {\n size: {\n xsmall: 75,\n small: 75,\n medium: 100,\n large: 200,\n },\n },\n lineHeights: {\n xsmall: 75,\n small: 75,\n medium: 100,\n large: 200,\n },\n};\n\nconst minHeight: Record<NonNullable<BaseButtonProps['size']>, ButtonMinHeight> = {\n xsmall: size[28],\n small: size[32],\n medium: size[36],\n large: size[48],\n};\n\nconst buttonPadding: Record<\n NonNullable<BaseButtonProps['size']>,\n Record<'top' | 'bottom' | 'left' | 'right', keyof Theme['spacing']>\n> = {\n xsmall: {\n top: 0,\n bottom: 0,\n left: 3,\n right: 3,\n },\n small: {\n top: 0,\n bottom: 0,\n left: 3,\n right: 3,\n },\n medium: {\n top: 0,\n bottom: 0,\n left: 4,\n right: 4,\n },\n large: {\n top: 0,\n bottom: 0,\n left: 5,\n right: 5,\n },\n};\n\nconst buttonBorderRadius = {\n xsmall: 'small',\n small: 'small',\n medium: 'small',\n large: 'medium',\n} as const;\n\nconst buttonIconOnlyHeightWidth = {\n xsmall: makeSize(size['28']),\n small: makeSize(size['32']),\n medium: makeSize(size['36']),\n large: makeSize(size['48']),\n} as const;\n\nconst buttonSizeToIconSizeMap: Record<NonNullable<BaseButtonProps['size']>, IconSize> = {\n xsmall: 'small',\n small: 'small',\n medium: 'medium',\n large: 'medium',\n};\n\nconst buttonIconOnlySizeToIconSizeMap: Record<NonNullable<BaseButtonProps['size']>, IconSize> = {\n xsmall: 'medium',\n small: 'medium',\n medium: 'medium',\n large: 'medium',\n};\n\nconst buttonSizeToSpinnerSizeMap: Record<\n NonNullable<BaseButtonProps['size']>,\n SpinnerProps['size']\n> = {\n xsmall: 'medium',\n small: 'medium',\n medium: 'medium',\n large: 'large',\n};\n\n/**\n * Spinner color mapping based on button variant and color\n */\nconst spinnerColor = {\n base: {\n primary: 'primary',\n secondary: 'neutral',\n tertiary: 'neutral',\n transparent: 'primary',\n },\n white: {\n primary: 'white',\n secondary: 'white',\n tertiary: 'white',\n },\n positive: {\n primary: 'positive',\n secondary: 'positive',\n },\n negative: {\n primary: 'negative',\n secondary: 'negative',\n },\n notice: {\n primary: 'notice',\n secondary: 'notice',\n },\n information: {\n primary: 'information',\n secondary: 'information',\n },\n neutral: {\n primary: 'neutral',\n secondary: 'neutral',\n },\n} as const;\n\nexport {\n boxShadow,\n backgroundGradient,\n textColor,\n spinnerColor,\n typography,\n minHeight,\n buttonSizeToIconSizeMap,\n buttonIconOnlySizeToIconSizeMap,\n buttonSizeToSpinnerSizeMap,\n buttonPadding,\n buttonIconOnlyHeightWidth,\n buttonBorderRadius,\n};\n\nexport type { ButtonBoxShadow };\n"],"names":["backgroundGradient","color","base","primary","default","highlighted","disabled","secondary","tertiary","transparent","white","boxShadow","y","blur","spread","textColor","property","typography","fonts","size","xsmall","small","medium","large","lineHeights","minHeight","buttonPadding","top","bottom","left","right","buttonBorderRadius","buttonIconOnlyHeightWidth","makeSize","buttonSizeToIconSizeMap","buttonIconOnlySizeToIconSizeMap","buttonSizeToSpinnerSizeMap","spinnerColor","positive","negative","notice","information","neutral"],"mappings":";;;;;AAuBM,IAAAA,kBAAkB,CAAG,SAArBA,kBAAkBA,CAAIC,KAAiC,CAAK,CAChE,OAAO,CACLC,IAAI,CAAE,CACJC,OAAO,CAAE,CACPC,OAAO,CAAE,0BAA0BH,KAAK,CAAA,QAAA,CAAU,CAClDI,WAAW,CAAE,CAA0BJ,uBAAAA,EAAAA,KAAK,CAAc,YAAA,CAAA,CAC1DK,QAAQ,CAAE,CAAA,uBAAA,EAA0BL,KAAK,CAC3C,SAAA,CAAA,CAAC,CACDM,SAAS,CAAE,CACTH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AE,QAAQ,CAChBC,KAAK,CAAE,OACT,EAKM,IAAAc,YAAY,CAAG,CACnBnC,IAAI,CAAE,CACJC,OAAO,CAAE,SAAS,CAClBI,SAAS,CAAE,SAAS,CACpBC,QAAQ,CAAE,SAAS,CACnBC,WAAW,CAAE,SACf,CAAC,CACDC,KAAK,CAAE,CACLP,OAAO,CAAE,OAAO,CAChBI,SAAS,CAAE,OAAO,CAClBC,QAAQ,CAAE,OACZ,CAAC,CACD8B,QAAQ,CAAE,CACRnC,OAAO,CAAE,UAAU,CACnBI,SAAS,CAAE,UACb,CAAC,CACDgC,QAAQ,CAAE,CACRpC,OAAO,CAAE,UAAU,CACnBI,SAAS,CAAE,UACb,CAAC,CACDiC,MAAM,CAAE,CACNrC,OAAO,CAAE,QAAQ,CACjBI,SAAS,CAAE,QACb,CAAC,CACDkC,WAAW,CAAE,CACXtC,OAAO,CAAE,aAAa,CACtBI,SAAS,CAAE,aACb,CAAC,CACDmC,OAAO,CAAE,CACPvC,OAAO,CAAE,SAAS,CAClBI,SAAS,CAAE,SACb,CACF;;;;"}
|
|
1
|
+
{"version":3,"file":"buttonTokens.js","sources":["../../../../../../src/components/Button/BaseButton/buttonTokens.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/explicit-function-return-type */\nimport type { BaseButtonProps } from './BaseButton';\nimport type { Theme } from '~components/BladeProvider';\nimport type { IconSize } from '~components/Icons';\nimport type { SpinnerProps } from '~components/Spinner';\nimport type { Size } from '~tokens/global';\nimport { size } from '~tokens/global';\nimport type { FeedbackColors } from '~tokens/theme/theme';\nimport { makeSize } from '~utils';\nimport type { DotNotationToken } from '~utils/lodashButBetter/get';\n\nexport type ButtonMinHeight = Size[28] | Size[32] | Size[36] | Size[48];\n\nexport type ButtonTypography = {\n fonts: {\n size: Record<NonNullable<BaseButtonProps['size']>, keyof Theme['typography']['fonts']['size']>;\n };\n lineHeights: Record<\n NonNullable<BaseButtonProps['size']>,\n keyof Theme['typography']['lineHeights']\n >;\n};\n\nconst backgroundGradient = (color: FeedbackColors | 'primary') => {\n return {\n base: {\n primary: {\n default: `interactive.background.${color}.default`,\n highlighted: `interactive.background.${color}.highlighted`,\n disabled: `interactive.background.${color}.disabled`,\n },\n secondary: {\n default: 'surface.background.gray.intense',\n highlighted: 'surface.background.gray.intense',\n disabled: 'interactive.background.staticWhite.ghost',\n },\n tertiary: {\n default: 'surface.background.gray.intense',\n highlighted: 'surface.background.gray.intense',\n disabled: 'interactive.background.staticWhite.ghost',\n },\n transparent: {\n default: 'transparent',\n highlighted: 'interactive.background.gray.faded',\n disabled: 'interactive.background.gray.disabled',\n },\n },\n white: {\n primary: {\n default: 'interactive.background.staticWhite.default',\n highlighted: 'interactive.background.staticWhite.highlighted',\n disabled: 'interactive.background.staticWhite.disabled',\n },\n secondary: {\n default: 'interactive.background.staticWhite.faded',\n highlighted: 'interactive.background.staticBlack.faded',\n disabled: 'interactive.background.gray.disabled',\n },\n tertiary: {\n default: 'interactive.background.staticWhite.faded',\n highlighted: 'interactive.background.staticBlack.faded',\n disabled: 'interactive.background.gray.disabled',\n },\n },\n // Only the `primary` emphasis exists in the design for the black color, which\n // is currently used by FloatingActionButton and is not exposed on `Button`.\n black: {\n primary: {\n default: 'interactive.background.staticBlack.default',\n highlighted: 'interactive.background.staticBlack.highlighted',\n disabled: 'interactive.background.staticBlack.fadedHighlighted',\n },\n },\n } as const;\n};\n\ntype BoxShadowValue = {\n y: number;\n blur: number;\n spread: number;\n color: DotNotationToken<Theme['colors']>;\n};\n\ntype ButtonBoxShadow = BoxShadowValue[];\n\n/**\n * Box-shadow tokens for buttons (includes border + 3D effects)\n * Each shadow is: inset 0 {y}px {blur}px {spread}px {color}\n */\nconst boxShadow = (\n color: FeedbackColors | 'primary',\n): {\n base: Record<\n 'primary' | 'secondary' | 'tertiary' | 'transparent',\n Record<'default' | 'highlighted' | 'disabled', ButtonBoxShadow>\n >;\n white: Record<\n 'primary' | 'secondary' | 'tertiary',\n Record<'default' | 'highlighted' | 'disabled', ButtonBoxShadow>\n >;\n black: Record<'primary', Record<'default' | 'highlighted' | 'disabled', ButtonBoxShadow>>;\n} => {\n return {\n base: {\n primary: {\n default: [\n { y: -1.5, blur: 0, spread: 0, color: `interactive.border.${color}.highlighted` },\n { y: 0, blur: 0, spread: 0.5, color: `interactive.border.${color}.default` },\n { y: 1.5, blur: 0, spread: 0, color: 'interactive.border.staticWhite.faded' },\n { y: -2, blur: 0, spread: 0, color: 'interactive.border.staticWhite.faded' },\n ],\n highlighted: [\n { y: -1.5, blur: 0, spread: 0, color: `interactive.border.${color}.highlighted` },\n { y: 0, blur: 0, spread: 0.5, color: `interactive.border.${color}.highlighted` },\n { y: 1.5, blur: 0, spread: 0, color: 'interactive.border.staticWhite.faded' },\n { y: -2, blur: 0, spread: 0, color: 'interactive.border.staticWhite.faded' },\n ],\n disabled: [],\n },\n secondary: {\n default: [\n { y: -1, blur: 0.5, spread: 0, color: 'interactive.border.staticBlack.fadedHighlighted' },\n { y: 0, blur: 0, spread: 1, color: 'interactive.border.gray.default' },\n { y: -1.5, blur: 0, spread: 0, color: 'interactive.border.gray.default' },\n ],\n highlighted: [\n { y: -1, blur: 0.5, spread: 0, color: 'interactive.border.staticBlack.fadedHighlighted' },\n { y: 0, blur: 0, spread: 1, color: 'interactive.border.gray.highlighted' },\n { y: -1.5, blur: 0, spread: 0, color: 'interactive.border.gray.default' },\n ],\n disabled: [{ y: 0, blur: 0, spread: 1, color: 'interactive.border.gray.disabled' }],\n },\n tertiary: {\n default: [\n { y: -1, blur: 0.5, spread: 0, color: 'interactive.border.staticBlack.fadedHighlighted' },\n { y: 0, blur: 0, spread: 1, color: 'interactive.border.gray.default' },\n { y: -1.5, blur: 0, spread: 0, color: 'interactive.border.gray.default' },\n ],\n highlighted: [\n { y: -1, blur: 0.5, spread: 0, color: 'interactive.border.staticBlack.fadedHighlighted' },\n { y: 0, blur: 0, spread: 1, color: 'interactive.border.gray.highlighted' },\n { y: -1.5, blur: 0, spread: 0, color: 'interactive.border.gray.default' },\n ],\n disabled: [{ y: 0, blur: 0, spread: 1, color: 'interactive.border.gray.disabled' }],\n },\n transparent: {\n default: [],\n highlighted: [],\n disabled: [],\n },\n },\n white: {\n primary: {\n default: [\n { y: -1.5, blur: 0, spread: 0, color: 'interactive.border.staticBlack.fadedHighlighted' },\n {\n y: 0,\n blur: 0,\n spread: 0.5,\n color: 'interactive.border.staticBlack.fadedHighlighted',\n },\n ],\n highlighted: [\n { y: -1.5, blur: 0, spread: 0, color: 'interactive.border.staticBlack.fadedHighlighted' },\n {\n y: 0,\n blur: 0,\n spread: 0.5,\n color: 'interactive.border.staticBlack.fadedHighlighted',\n },\n ],\n disabled: [],\n },\n secondary: {\n default: [\n { y: -1.5, blur: 0, spread: 0, color: 'interactive.border.staticBlack.fadedHighlighted' },\n { y: 0, blur: 0, spread: 1, color: 'interactive.border.staticWhite.highlighted' },\n ],\n highlighted: [\n { y: -1.5, blur: 0, spread: 0, color: 'interactive.border.staticBlack.fadedHighlighted' },\n { y: 0, blur: 0, spread: 1, color: 'interactive.border.staticWhite.highlighted' },\n ],\n disabled: [{ y: 0, blur: 0, spread: 1, color: 'interactive.border.staticWhite.disabled' }],\n },\n tertiary: {\n default: [\n { y: -1.5, blur: 0, spread: 0, color: 'interactive.border.staticBlack.fadedHighlighted' },\n { y: 0, blur: 0, spread: 1, color: 'interactive.border.staticWhite.highlighted' },\n ],\n highlighted: [\n { y: -1.5, blur: 0, spread: 0, color: 'interactive.border.staticBlack.fadedHighlighted' },\n { y: 0, blur: 0, spread: 1, color: 'interactive.border.staticWhite.highlighted' },\n ],\n disabled: [{ y: 0, blur: 0, spread: 1, color: 'interactive.border.staticWhite.disabled' }],\n },\n },\n black: {\n primary: {\n default: [\n { y: -1.5, blur: 0, spread: 0, color: 'interactive.border.staticBlack.highlighted' },\n { y: 0, blur: 0, spread: 0.5, color: 'interactive.border.staticBlack.highlighted' },\n { y: 1.5, blur: 0, spread: 0, color: 'interactive.border.staticWhite.fadedHighlighted' },\n { y: -2, blur: 0, spread: 0, color: 'interactive.border.staticWhite.fadedHighlighted' },\n ],\n highlighted: [\n { y: -1.5, blur: 0, spread: 0, color: 'interactive.border.staticBlack.highlighted' },\n { y: 0, blur: 0, spread: 0.5, color: 'interactive.border.staticBlack.highlighted' },\n { y: 1.5, blur: 0, spread: 0, color: 'interactive.border.staticWhite.fadedHighlighted' },\n { y: -2, blur: 0, spread: 0, color: 'interactive.border.staticWhite.fadedHighlighted' },\n ],\n disabled: [],\n },\n },\n };\n};\n\nconst textColor = (property: 'icon' | 'text') => {\n return {\n base: {\n primary: {\n default: `interactive.${property}.onPrimary.normal`,\n highlighted: `interactive.${property}.onPrimary.normal`,\n disabled: `interactive.${property}.primary.disabled`,\n },\n secondary: {\n default: `interactive.${property}.gray.normal`,\n highlighted: `interactive.${property}.gray.normal`,\n disabled: `interactive.${property}.gray.disabled`,\n },\n tertiary: {\n default: `interactive.${property}.gray.normal`,\n highlighted: `interactive.${property}.gray.normal`,\n disabled: `interactive.${property}.gray.disabled`,\n },\n },\n white: {\n primary: {\n default: `interactive.${property}.staticBlack.muted`,\n highlighted: `interactive.${property}.staticBlack.muted`,\n disabled: `interactive.${property}.staticBlack.disabled`,\n },\n secondary: {\n default: `interactive.${property}.staticWhite.normal`,\n highlighted: `interactive.${property}.staticWhite.normal`,\n disabled: `interactive.${property}.staticWhite.disabled`,\n },\n tertiary: {\n default: `interactive.${property}.staticWhite.normal`,\n highlighted: `interactive.${property}.staticWhite.normal`,\n disabled: `interactive.${property}.staticWhite.disabled`,\n },\n },\n black: {\n primary: {\n default: `interactive.${property}.staticWhite.normal`,\n highlighted: `interactive.${property}.staticWhite.normal`,\n disabled: `interactive.${property}.staticWhite.disabled`,\n },\n },\n transparent: {\n tertiary: {\n default: property === 'icon' ? 'interactive.icon.gray.muted' : 'surface.text.gray.normal',\n highlighted:\n property === 'icon' ? 'interactive.icon.gray.subtle' : 'surface.text.gray.normal',\n disabled: `interactive.${property}.gray.disabled`,\n },\n },\n\n color: (color: FeedbackColors) => {\n return {\n primary: {\n default: `interactive.${property}.staticWhite.normal`,\n highlighted: `interactive.${property}.staticWhite.normal`,\n disabled: `interactive.${property}.${color}.disabled`,\n },\n secondary: {\n default: `interactive.${property}.${color}.normal`,\n highlighted: `interactive.${property}.${color}.normal`,\n disabled: `interactive.${property}.${color}.disabled`,\n },\n } as const;\n },\n } as const;\n};\n\nconst typography: ButtonTypography = {\n fonts: {\n size: {\n xsmall: 75,\n small: 75,\n medium: 100,\n large: 200,\n },\n },\n lineHeights: {\n xsmall: 75,\n small: 75,\n medium: 100,\n large: 200,\n },\n};\n\nconst minHeight: Record<NonNullable<BaseButtonProps['size']>, ButtonMinHeight> = {\n xsmall: size[28],\n small: size[32],\n medium: size[36],\n large: size[48],\n};\n\nconst buttonPadding: Record<\n NonNullable<BaseButtonProps['size']>,\n Record<'top' | 'bottom' | 'left' | 'right', keyof Theme['spacing']>\n> = {\n xsmall: {\n top: 0,\n bottom: 0,\n left: 3,\n right: 3,\n },\n small: {\n top: 0,\n bottom: 0,\n left: 3,\n right: 3,\n },\n medium: {\n top: 0,\n bottom: 0,\n left: 4,\n right: 4,\n },\n large: {\n top: 0,\n bottom: 0,\n left: 5,\n right: 5,\n },\n};\n\nconst buttonBorderRadius = {\n xsmall: 'small',\n small: 'small',\n medium: 'small',\n large: 'medium',\n} as const;\n\nconst buttonIconOnlyHeightWidth = {\n xsmall: makeSize(size['28']),\n small: makeSize(size['32']),\n medium: makeSize(size['36']),\n large: makeSize(size['48']),\n} as const;\n\nconst buttonSizeToIconSizeMap: Record<NonNullable<BaseButtonProps['size']>, IconSize> = {\n xsmall: 'small',\n small: 'small',\n medium: 'medium',\n large: 'medium',\n};\n\nconst buttonIconOnlySizeToIconSizeMap: Record<NonNullable<BaseButtonProps['size']>, IconSize> = {\n xsmall: 'medium',\n small: 'medium',\n medium: 'medium',\n large: 'medium',\n};\n\nconst buttonSizeToSpinnerSizeMap: Record<\n NonNullable<BaseButtonProps['size']>,\n SpinnerProps['size']\n> = {\n xsmall: 'medium',\n small: 'medium',\n medium: 'medium',\n large: 'large',\n};\n\n/**\n * Spinner color mapping based on button variant and color\n */\nconst spinnerColor = {\n base: {\n primary: 'primary',\n secondary: 'neutral',\n tertiary: 'neutral',\n transparent: 'primary',\n },\n white: {\n primary: 'white',\n secondary: 'white',\n tertiary: 'white',\n },\n black: {\n primary: 'white',\n },\n positive: {\n primary: 'positive',\n secondary: 'positive',\n },\n negative: {\n primary: 'negative',\n secondary: 'negative',\n },\n notice: {\n primary: 'notice',\n secondary: 'notice',\n },\n information: {\n primary: 'information',\n secondary: 'information',\n },\n neutral: {\n primary: 'neutral',\n secondary: 'neutral',\n },\n} as const;\n\nexport {\n boxShadow,\n backgroundGradient,\n textColor,\n spinnerColor,\n typography,\n minHeight,\n buttonSizeToIconSizeMap,\n buttonIconOnlySizeToIconSizeMap,\n buttonSizeToSpinnerSizeMap,\n buttonPadding,\n buttonIconOnlyHeightWidth,\n buttonBorderRadius,\n};\n\nexport type { ButtonBoxShadow };\n"],"names":["backgroundGradient","color","base","primary","default","highlighted","disabled","secondary","tertiary","transparent","white","black","boxShadow","y","blur","spread","textColor","property","typography","fonts","size","xsmall","small","medium","large","lineHeights","minHeight","buttonPadding","top","bottom","left","right","buttonBorderRadius","buttonIconOnlyHeightWidth","makeSize","buttonSizeToIconSizeMap","buttonIconOnlySizeToIconSizeMap","buttonSizeToSpinnerSizeMap","spinnerColor","positive","negative","notice","information","neutral"],"mappings":";;;;;AAuBM,IAAAA,kBAAkB,CAAG,SAArBA,kBAAkBA,CAAIC,KAAiC,CAAK,CAChE,OAAO,CACLC,IAAI,CAAE,CACJC,OAAO,CAAE,CACPC,OAAO,CAAE,CAAA,uBAAA,EAA0BH,KAAK,CAAU,QAAA,CAAA,CAClDI,WAAW,CAAE,CAA0BJ,uBAAAA,EAAAA,KAAK,cAAc,CAC1DK,QAAQ,CAAE,CAAA,uBAAA,EAA0BL,KAAK,CAAA,SAAA,CA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,CACfC,KAAK,CAAE,OAAO,CACdC,MAAM,CAAE,QAAQ,CAChBC,KAAK,CAAE,QACT,EAEM,IAAAY,+BAAuF,CAAG,CAC9Ff,MAAM,CAAE,QAAQ,CAChBC,KAAK,CAAE,QAAQ,CACfC,MAAM,CAAE,QAAQ,CAChBC,KAAK,CAAE,QACT,EAEM,IAAAa,0BAGL,CAAG,CACFhB,MAAM,CAAE,QAAQ,CAChBC,KAAK,CAAE,QAAQ,CACfC,MAAM,CAAE,QAAQ,CAChBC,KAAK,CAAE,OACT,EAKM,IAAAc,YAAY,CAAG,CACnBpC,IAAI,CAAE,CACJC,OAAO,CAAE,SAAS,CAClBI,SAAS,CAAE,SAAS,CACpBC,QAAQ,CAAE,SAAS,CACnBC,WAAW,CAAE,SACf,CAAC,CACDC,KAAK,CAAE,CACLP,OAAO,CAAE,OAAO,CAChBI,SAAS,CAAE,OAAO,CAClBC,QAAQ,CAAE,OACZ,CAAC,CACDG,KAAK,CAAE,CACLR,OAAO,CAAE,OACX,CAAC,CACDoC,QAAQ,CAAE,CACRpC,OAAO,CAAE,UAAU,CACnBI,SAAS,CAAE,UACb,CAAC,CACDiC,QAAQ,CAAE,CACRrC,OAAO,CAAE,UAAU,CACnBI,SAAS,CAAE,UACb,CAAC,CACDkC,MAAM,CAAE,CACNtC,OAAO,CAAE,QAAQ,CACjBI,SAAS,CAAE,QACb,CAAC,CACDmC,WAAW,CAAE,CACXvC,OAAO,CAAE,aAAa,CACtBI,SAAS,CAAE,aACb,CAAC,CACDoC,OAAO,CAAE,CACPxC,OAAO,CAAE,SAAS,CAClBI,SAAS,CAAE,SACb,CACF;;;;"}
|
|
@@ -6,6 +6,7 @@ import { Rect, Path, G, Circle, Svg, Defs, LinearGradient, Stop, ClipPath, Line,
|
|
|
6
6
|
import { View, Pressable } from 'react-native';
|
|
7
7
|
import Animated, { useAnimatedProps, useSharedValue, withTiming, withDelay } from 'react-native-reanimated';
|
|
8
8
|
import '../utils/index.js';
|
|
9
|
+
import { monotoneInterpolate } from '../utils/nullBridgeUtils.js';
|
|
9
10
|
import '../CommonChartComponents/index.js';
|
|
10
11
|
import { componentIds } from './componentIds.js';
|
|
11
12
|
import '../../BladeProvider/index.js';
|
|
@@ -36,7 +37,7 @@ import { makeAnalyticsAttribute } from '../../../utils/makeAnalyticsAttribute/ma
|
|
|
36
37
|
import { Box } from '../../Box/Box.js';
|
|
37
38
|
import { Text } from '../../Typography/Text/Text.js';
|
|
38
39
|
|
|
39
|
-
var _excluded=["children","colorTheme","data","testID"];var _this=undefined,_jsxFileName="/home/runner/work/blade/blade/packages/blade/src/components/Charts/AreaChart/AreaChart.native.tsx";var PLOT_PADDING={top:16,right:16,bottom:32,left:40};var Y_TICK_COUNT=4;var TICK_FONT_SIZE=10;var AXIS_LABEL_FONT_SIZE=11;var SECONDARY_LABEL_FONT_SIZE=10;var X_AXIS_TITLE_GAP=6;var PRIMARY_TO_SECONDARY_GAP=8;var X_TICK_LABEL_GAP=8;var TICK_LINE_HEIGHT=TICK_FONT_SIZE+2;var MAX_TICK_LABEL_LINES=3;var STROKE_WIDTH=1.5;var AREA_FILL_OPACITY=0.5;var AREA_FILL_OPACITY_DIMMED=0.3;var DOT_RADIUS=3;var ACTIVE_DOT_RADIUS=4.5;var LEGEND_SWATCH_SIZE=12;var TOOLTIP_WIDTH=180;var AnimatedRect=Animated.createAnimatedComponent(Rect);var AnimatedPath=Animated.createAnimatedComponent(Path);var uniqueChartCounter=0;var readChildSlots=function readChildSlots(children){var slots={areas:[],hasXAxis:false,hasYAxis:false,hasGrid:false,legend:{hasLegend:false},referenceLines:[],hasTooltip:false};React__default.Children.forEach(children,function(child){if(!React__default.isValidElement(child))return;var id=getComponentId(child);if(id===componentIds.ChartArea){var _props$type;var props=child.props;if(props.dataKey==null)return;slots.areas.push({dataKey:String(props.dataKey),name:props.name,color:props.color,stackId:props.stackId!=null?String(props.stackId):'1',type:(_props$type=props.type)!=null?_props$type:'monotone',connectNulls:Boolean(props.connectNulls),hide:props.hide,showLegend:props.showLegend!==false,dot:Boolean(props.dot),activeDot:props.activeDot!==false});}else if(id===componentId.chartXAxis){var _props2=child.props;slots.hasXAxis=true;slots.xDataKey=_props2.dataKey;slots.xSecondaryDataKey=_props2.secondaryDataKey;slots.xTickFormatter=_props2.tickFormatter;slots.xInterval=_props2.interval;slots.xLabel=_props2.label;}else if(id===componentId.chartYAxis){var _props3=child.props;slots.hasYAxis=true;slots.yLabel=_props3.label;if(Array.isArray(_props3.domain)&&_props3.domain.length===2){slots.yDomain=[_props3.domain[0],_props3.domain[1]];}if(typeof _props3.tickFormatter==='function'){slots.yTickFormatter=_props3.tickFormatter;}if(typeof _props3.tickCount==='number'){slots.yTickCount=_props3.tickCount;}}else if(id===componentId.chartLegend){var _props4=child.props;slots.legend={hasLegend:true,selectedDataKeys:_props4.selectedDataKeys,defaultSelectedDataKeys:_props4.defaultSelectedDataKeys,onSelectedDataKeysChange:_props4.onSelectedDataKeysChange,layout:_props4.layout,align:_props4.align};}else if(id===componentId.chartCartesianGrid){slots.hasGrid=true;}else if(id===componentId.chartTooltip){slots.hasTooltip=true;var _props5=child.props;if(typeof _props5.formatter==='function'){slots.tooltipFormatter=_props5.formatter;}}else if(id===componentId.chartReferenceLine){var _props6=child.props;if(typeof _props6.y==='number'){slots.referenceLines.push({orientation:'horizontal',value:_props6.y,label:typeof _props6.label==='string'?_props6.label:undefined});}else if(_props6.x!==undefined&&_props6.x!==null){slots.referenceLines.push({orientation:'vertical',value:_props6.x,label:typeof _props6.label==='string'?_props6.label:undefined});}}});return slots;};var niceCeil=function niceCeil(raw){if(raw<=0)return 1;var exponent=Math.floor(Math.log10(raw));var fraction=raw/10**exponent;var niceFraction=fraction<=1?1:fraction<=2?2:fraction<=5?5:10;return niceFraction*10**exponent;};var niceFloor=function niceFloor(raw){if(raw>=0)return 0;var abs=Math.abs(raw);var exponent=Math.floor(Math.log10(abs));var fraction=abs/10**exponent;var niceFraction=fraction<=1?1:fraction<=2?2:fraction<=5?5:10;return -(niceFraction*10**exponent);};var toNullableNumber=function toNullableNumber(raw){if(raw===null||raw===undefined)return null;var value=Number(raw);return Number.isNaN(value)||!isFinite(value)?null:value;};var MISSING_TOOLTIP_VALUE='—';var formatYTick=function formatYTick(value){var abs=Math.abs(value);if(abs>=1000000)return `${(value/1000000).toFixed(abs>=10000000?0:1)}M`;if(abs>=1000)return `${(value/1000).toFixed(abs>=10000?0:1)}K`;return String(value);};var estimateTickLabelWidth=function estimateTickLabelWidth(label,fontSize){return Math.max(1,label.length)*fontSize*0.6+X_TICK_LABEL_GAP;};var wrapLabelToLines=function wrapLabelToLines(label,maxWidth,fontSize){var text=String(label).trim();if(!text)return [''];if(maxWidth<=0)return [text];var maxChars=Math.max(1,Math.floor(maxWidth/(fontSize*0.6)));var words=text.split(/\s+/);var lines=[];var current='';var flush=function flush(){if(current){lines.push(current);current='';}};words.forEach(function(word){var remaining=word;while(remaining.length>maxChars){flush();lines.push(remaining.slice(0,maxChars));remaining=remaining.slice(maxChars);}if(!current){current=remaining;}else if(current.length+1+remaining.length<=maxChars){current=`${current} ${remaining}`;}else {flush();current=remaining;}});flush();if(lines.length>MAX_TICK_LABEL_LINES){var kept=lines.slice(0,MAX_TICK_LABEL_LINES);var lastIndex=MAX_TICK_LABEL_LINES-1;var last=kept[lastIndex];kept[lastIndex]=`${last.slice(0,Math.max(1,maxChars-1))}…`;return kept;}return lines;};var selectNonOverlappingXTickIndices=function selectNonOverlappingXTickIndices(pointCount,widths,xForIndex,forcedStep){if(pointCount<=0)return [];if(pointCount===1)return [0];var rightExtent=function rightExtent(i){return xForIndex(i)+(i===0?widths[i]:widths[i]/2);};var leftExtent=function leftExtent(i){return xForIndex(i)-(i===pointCount-1?widths[i]:widths[i]/2);};var fitsAfter=function fitsAfter(prev,next){return leftExtent(next)>=rightExtent(prev);};if(forcedStep!==undefined){var step=Math.max(1,forcedStep);var indices=[];for(var i=0;i<pointCount;i+=step){indices.push(i);}var _last=pointCount-1;if(indices[indices.length-1]!==_last&&fitsAfter(indices[indices.length-1],_last)){indices.push(_last);}return indices;}var first=0;var last=pointCount-1;var firstLastFit=fitsAfter(first,last);var selected=[first];if(firstLastFit){var _prev=first;for(var _i=1;_i<last;_i++){if(fitsAfter(_prev,_i)&&fitsAfter(_i,last)){selected.push(_i);_prev=_i;}}selected.push(last);return selected;}var prev=first;for(var _i2=1;_i2<pointCount;_i2++){if(fitsAfter(prev,_i2)){selected.push(_i2);prev=_i2;}}return selected;};var buildMonotone=function buildMonotone(pts){var n=pts.length;if(n<2)return '';var xs=pts.map(function(p){return p.x;});var ys=pts.map(function(p){return p.y;});var delta=[];for(var i=0;i<n-1;i++){var dx=xs[i+1]-xs[i];delta.push(dx===0?0:(ys[i+1]-ys[i])/dx);}var m=new Array(n).fill(0);m[0]=delta[0];m[n-1]=delta[n-2];for(var _i3=1;_i3<n-1;_i3++){if(delta[_i3-1]*delta[_i3]<=0){m[_i3]=0;}else {m[_i3]=(delta[_i3-1]+delta[_i3])/2;}}for(var _i4=0;_i4<n-1;_i4++){if(delta[_i4]===0){m[_i4]=0;m[_i4+1]=0;}else {var a=m[_i4]/delta[_i4];var b=m[_i4+1]/delta[_i4];var s=a*a+b*b;if(s>9){var t=3/Math.sqrt(s);m[_i4]=t*a*delta[_i4];m[_i4+1]=t*b*delta[_i4];}}}var d='';for(var _i5=0;_i5<n-1;_i5++){var _dx=xs[_i5+1]-xs[_i5];var cp1x=xs[_i5]+_dx/3;var cp1y=ys[_i5]+m[_i5]*_dx/3;var cp2x=xs[_i5+1]-_dx/3;var cp2y=ys[_i5+1]-m[_i5+1]*_dx/3;d+=` C ${cp1x} ${cp1y} ${cp2x} ${cp2y} ${xs[_i5+1]} ${ys[_i5+1]}`;}return d.trim();};var buildCurve=function buildCurve(pts,type){var n=pts.length;if(n<2)return '';if(type==='monotone')return buildMonotone(pts);var commands=[];for(var i=1;i<n;i++){var prev=pts[i-1];var curr=pts[i];if(type==='linear'){commands.push(`L ${curr.x} ${curr.y}`);}else if(type==='stepAfter'){commands.push(`L ${curr.x} ${prev.y}`);commands.push(`L ${curr.x} ${curr.y}`);}else if(type==='stepBefore'){commands.push(`L ${prev.x} ${curr.y}`);commands.push(`L ${curr.x} ${curr.y}`);}else {var mid=(prev.x+curr.x)/2;commands.push(`L ${mid} ${prev.y}`);commands.push(`L ${mid} ${curr.y}`);commands.push(`L ${curr.x} ${curr.y}`);}}return commands.join(' ');};var AreaSeries=function AreaSeries(_ref){var points=_ref.points,type=_ref.type,connectNulls=_ref.connectNulls,gradientId=_ref.gradientId,strokeColor=_ref.strokeColor,dotColor=_ref.dotColor,showDot=_ref.showDot,showActiveDot=_ref.showActiveDot,activeIndex=_ref.activeIndex,scrubProgress=_ref.scrubProgress,activeRingColor=_ref.activeRingColor;var animatedProps=useAnimatedProps(function(){return {fillOpacity:AREA_FILL_OPACITY-scrubProgress.value*(AREA_FILL_OPACITY-AREA_FILL_OPACITY_DIMMED)};});var segments=[];if(connectNulls){var nonNull=points.filter(function(p){return !p.isNull;});if(nonNull.length)segments.push(nonNull);}else {var current=[];points.forEach(function(p){if(p.isNull){if(current.length)segments.push(current);current=[];}else {current.push(p);}});if(current.length)segments.push(current);}return jsxs(G,{children:[segments.map(function(segment,segIndex){if(segment.length===0)return null;var topPts=segment.map(function(p){return {x:p.x,y:p.yTop};});var basePts=segment.map(function(p){return {x:p.x,y:p.yBase};});var reversedBase=_toConsumableArray(basePts).reverse();var strokeD=`M ${topPts[0].x} ${topPts[0].y} ${buildCurve(topPts,type)}`.trim();var fillD='';if(segment.length>=2){fillD=`M ${topPts[0].x} ${topPts[0].y} ${buildCurve(topPts,type)} `+`L ${reversedBase[0].x} ${reversedBase[0].y} ${buildCurve(reversedBase,type)} Z`;}return jsxs(G,{children:[fillD?jsx(AnimatedPath,{d:fillD,fill:`url(#${gradientId})`,animatedProps:animatedProps}):null,jsx(Path,{d:strokeD,stroke:strokeColor,strokeWidth:STROKE_WIDTH,fill:"none",strokeLinejoin:"round"})]},`segment-${segIndex}`);}),showDot?points.map(function(p,idx){return p.isNull?null:jsx(Circle,{cx:p.x,cy:p.yTop,r:DOT_RADIUS,fill:strokeColor},`dot-${idx}`);}):null,showActiveDot&&activeIndex!==undefined&&points[activeIndex]&&!points[activeIndex].isNull?jsx(Circle,{cx:points[activeIndex].x,cy:points[activeIndex].yTop,r:ACTIVE_DOT_RADIUS,fill:dotColor,stroke:activeRingColor,strokeWidth:2}):null]});};var _ChartArea=function _ChartArea(_props){return null;};var ChartArea=assignWithoutSideEffects(_ChartArea,{componentId:componentIds.ChartArea});var ChartAreaWrapper=function ChartAreaWrapper(_ref2){var _slots$legend$default,_slots$yTickCount,_activeRow$slots$xDat;var children=_ref2.children,_ref2$colorTheme=_ref2.colorTheme,colorTheme=_ref2$colorTheme===void 0?'categorical':_ref2$colorTheme,_ref2$data=_ref2.data,data=_ref2$data===void 0?[]:_ref2$data,testID=_ref2.testID,restProps=_objectWithoutProperties(_ref2,_excluded);var _useTheme=useTheme(),theme=_useTheme.theme,colorScheme=_useTheme.colorScheme;var isDarkMode=colorScheme==='dark';var _useState=useState({width:0,height:0}),_useState2=_slicedToArray(_useState,2),size=_useState2[0],setSize=_useState2[1];var _useState3=useState(undefined),_useState4=_slicedToArray(_useState3,2),activeIndex=_useState4[0],setActiveIndex=_useState4[1];var chartIdRef=useRef(undefined);if(chartIdRef.current===undefined){chartIdRef.current=`area-${uniqueChartCounter++}`;}var chartId=chartIdRef.current;var scrubProgress=useSharedValue(0);useEffect(function(){scrubProgress.value=withTiming(activeIndex!==undefined?1:0,{duration:getIn(theme.motion,'duration.quick')});},[activeIndex]);var onLayout=function onLayout(e){var _e$nativeEvent$layout=e.nativeEvent.layout,width=_e$nativeEvent$layout.width,height=_e$nativeEvent$layout.height;if(width!==size.width||height!==size.height){setSize({width:width,height:height});}};var slots=useMemo(function(){return readChildSlots(children);},[children]);var allAreas=slots.areas;var yAxisWarnedRef=useRef(false);useEffect(function(){if(!__DEV__)return;if(slots.hasYAxis&&!yAxisWarnedRef.current){var unsupported=[];if(slots.yDomain&&!slots.yDomain.every(function(v){return isNumber(Number(v));})){unsupported.push('domain (non-numeric)');}if(unsupported.length>0){yAxisWarnedRef.current=true;logger({type:'warn',moduleName:'ChartAreaWrapper',message:`ChartYAxis prop(s) [${unsupported.join(', ')}] are not fully supported on native. Supported: label, domain (numeric), tickFormatter, tickCount.`});}}},[slots.hasYAxis,slots.yDomain]);var themeColors=useChartsColorTheme({colorTheme:colorTheme,chartName:'area',chartDataIndicators:allAreas.length});var dataColorMapping=useMemo(function(){var mapping={};allAreas.forEach(function(area){mapping[area.dataKey]={colorToken:area.color,isCustomColor:Boolean(area.color)};});assignDataColorMapping(mapping,themeColors);return mapping;},[allAreas,themeColors]);var allDataKeys=useMemo(function(){return Object.keys(dataColorMapping);},[dataColorMapping]);var _useControllableState=useControllableState({value:slots.legend.selectedDataKeys,defaultValue:(_slots$legend$default=slots.legend.defaultSelectedDataKeys)!=null?_slots$legend$default:allDataKeys}),_useControllableState2=_slicedToArray(_useControllableState,2),selectedKeys=_useControllableState2[0],setSelectedKeys=_useControllableState2[1];var handleLegendToggle=function handleLegendToggle(dataKey){var next=selectedKeys.includes(dataKey)?selectedKeys.filter(function(k){return k!==dataKey;}):[].concat(_toConsumableArray(selectedKeys),[dataKey]);setSelectedKeys(function(){return next;});slots.legend.onSelectedDataKeysChange==null?void 0:slots.legend.onSelectedDataKeysChange({dataKey:dataKey,selectedKeysArray:next});};var visibleAreas=useMemo(function(){return allAreas.filter(function(area){return !area.hide&&selectedKeys.includes(area.dataKey);});},[allAreas,selectedKeys]);var secondaryLabelMap=useMemo(function(){if(!slots.xSecondaryDataKey||!(data!=null&&data.length))return undefined;var map={};data.forEach(function(row,index){map[index]=row[slots.xSecondaryDataKey];});return map;},[data,slots.xSecondaryDataKey]);var stackGroups=useMemo(function(){var groupOrder=[];var map=new Map();visibleAreas.forEach(function(area){var key=area.stackId;if(!map.has(key)){map.set(key,[]);groupOrder.push(key);}map.get(key).push(area);});return groupOrder.map(function(key){return {key:key,areas:map.get(key)};});},[visibleAreas]);var _useMemo=useMemo(function(){if(!data.length)return {dataMax:0,dataMin:0};var max=0;var min=0;data.forEach(function(row){stackGroups.forEach(function(group){var sum=group.areas.reduce(function(acc,area){return acc+(Number(row[area.dataKey])||0);},0);if(sum>max)max=sum;if(sum<min)min=sum;});});return {dataMax:max,dataMin:min};},[data,stackGroups]),dataMax=_useMemo.dataMax,dataMin=_useMemo.dataMin;var yMax=slots.yDomain?Number(slots.yDomain[1]):niceCeil(dataMax);var yMin=slots.yDomain?Number(slots.yDomain[0]):dataMin<0?niceFloor(dataMin):0;var yRange=yMax-yMin;var yTickCount=(_slots$yTickCount=slots.yTickCount)!=null?_slots$yTickCount:Y_TICK_COUNT;var yTicks=useMemo(function(){var ticks=[];for(var i=0;i<=yTickCount;i++){ticks.push(yMin+yRange/yTickCount*i);}return ticks;},[yMin,yRange,yTickCount]);var showAxes=slots.hasXAxis||slots.hasYAxis;var hasSecondaryXLabels=Boolean(slots.xSecondaryDataKey);var secondaryRowHeight=hasSecondaryXLabels?SECONDARY_LABEL_FONT_SIZE+PRIMARY_TO_SECONDARY_GAP:0;var xAxisTitleHeight=slots.xLabel?AXIS_LABEL_FONT_SIZE+X_AXIS_TITLE_GAP:0;var count=data.length;var plotWidthForLabels=Math.max(0,size.width-PLOT_PADDING.left-PLOT_PADDING.right);var columnWidth=count>1?plotWidthForLabels/(count-1):plotWidthForLabels;var xLabels=useMemo(function(){return data.map(function(row,index){var _row$slots$xDataKey;var rawLabel=slots.xDataKey?String((_row$slots$xDataKey=row[slots.xDataKey])!=null?_row$slots$xDataKey:''):String(index);return slots.xTickFormatter?slots.xTickFormatter(rawLabel,index):rawLabel;});},[data,slots.xDataKey,slots.xTickFormatter]);var xLabelLines=useMemo(function(){var maxWidth=Math.max(0,columnWidth*0.6-X_TICK_LABEL_GAP);return xLabels.map(function(label){return wrapLabelToLines(label,maxWidth,TICK_FONT_SIZE);});},[xLabels,columnWidth]);var maxXLabelLines=useMemo(function(){return xLabelLines.reduce(function(max,lines){return Math.max(max,lines.length);},1);},[xLabelLines]);var primaryLabelRowHeight=maxXLabelLines*TICK_LINE_HEIGHT;var padding=showAxes?Object.assign({},PLOT_PADDING,{bottom:Math.max(PLOT_PADDING.bottom,primaryLabelRowHeight+4+secondaryRowHeight+xAxisTitleHeight+4)}):{top:0,right:0,bottom:0,left:0};var plotWidth=Math.max(0,size.width-padding.left-padding.right);var plotHeight=Math.max(0,size.height-padding.top-padding.bottom);var pointStep=count>1?plotWidth/(count-1):0;var xAt=function xAt(i){return count>1?i*pointStep:plotWidth/2;};var yAt=function yAt(value){return yRange>0?plotHeight-(value-yMin)/yRange*plotHeight:plotHeight;};var visibleXTickIndices=useMemo(function(){if(count<=0)return [];var widths=xLabelLines.map(function(lines,index){var primaryWidth=lines.reduce(function(max,line){return Math.max(max,estimateTickLabelWidth(line,TICK_FONT_SIZE));},0);var secondary=secondaryLabelMap==null?void 0:secondaryLabelMap[index];var secondaryWidth=secondary!==undefined&&secondary!==null?estimateTickLabelWidth(String(secondary),SECONDARY_LABEL_FONT_SIZE):0;return Math.max(primaryWidth,secondaryWidth);});var forcedStep=slots.xInterval!==undefined?Math.max(1,slots.xInterval+1):undefined;return selectNonOverlappingXTickIndices(count,widths,xAt,forcedStep);},[count,pointStep,plotWidth,xLabelLines,secondaryLabelMap,slots.xInterval]);var visibleXTickIndexSet=useMemo(function(){return new Set(visibleXTickIndices);},[visibleXTickIndices]);var tickColor=getIn(theme.colors,'surface.text.gray.muted');var referenceLabelTextColor=getIn(theme.colors,'surface.text.gray.normal');var axisLineColor=getIn(theme.colors,'surface.border.gray.muted');var gridColor=getIn(theme.colors,'surface.border.gray.subtle');var referenceColor=getIn(theme.colors,'data.background.categorical.gray.intense');var referenceLabelFill=getIn(theme.colors,'surface.background.gray.subtle');var referenceLabelStroke=getIn(theme.colors,'surface.border.gray.muted');var cursorColor=getIn(theme.colors,'surface.border.gray.normal');var activeRingColor=getIn(theme.colors,'surface.background.gray.intense');var areaGeometries=useMemo(function(){var geometries=[];stackGroups.forEach(function(group){var runningBase=new Array(count).fill(0);group.areas.forEach(function(area){var points=data.map(function(row,i){var raw=row[area.dataKey];var isNull=raw===null||raw===undefined||!isNumber(Number(raw));var value=isNull?0:Number(raw);var base=runningBase[i];var top=base+value;runningBase[i]+=value;return {x:xAt(i),yTop:yAt(top),yBase:yAt(base),isNull:isNull};});var mappingEntry=dataColorMapping[area.dataKey];var isCustomColor=Boolean(mappingEntry==null?void 0:mappingEntry.isCustomColor);var strokeToken=isCustomColor?getHighestColorInRange({colorToken:mappingEntry.colorToken}):mappingEntry==null?void 0:mappingEntry.colorToken;var strokeColor=strokeToken?getIn(theme.colors,strokeToken):tickColor;geometries.push({area:area,points:points,gradientId:`${chartId}-grad-${area.dataKey}`,strokeColor:strokeColor});});});return geometries;},[stackGroups,data,count,plotWidth,plotHeight,yMax,yMin,yRange,dataColorMapping,theme.colors]);var revealProgress=useSharedValue(0);var lastRevealKeyRef=useRef(undefined);useEffect(function(){if(count===0||plotWidth<=0){if(count===0){lastRevealKeyRef.current=undefined;}return;}var revealKey=`${count}:${visibleAreas.length}`;if(lastRevealKeyRef.current===revealKey){revealProgress.value=1;return;}lastRevealKeyRef.current=revealKey;revealProgress.value=0;revealProgress.value=withDelay(getIn(theme.motion,'delay.gentle'),withTiming(1,{duration:getIn(theme.motion,'duration.xgentle'),easing:getIn(theme.motion,'easing.entrance')}));},[count,visibleAreas.length,plotWidth]);var clipAnimatedProps=useAnimatedProps(function(){return {width:revealProgress.value*plotWidth};});var indexAtX=function indexAtX(localX){if(count===0)return undefined;var plotX=localX-padding.left;if(count===1)return 0;if(pointStep===0)return 0;var idx=Math.round(plotX/pointStep);return Math.min(count-1,Math.max(0,idx));};var touchStartActiveRef=React__default.useRef(undefined);var touchStartIndexRef=React__default.useRef(undefined);var touchMovedRef=React__default.useRef(false);var becameResponderRef=React__default.useRef(false);var touchStartLocationRef=React__default.useRef(undefined);var SCRUB_MOVE_THRESHOLD=8;var handleTouchStart=function handleTouchStart(e){if(count===0)return;var next=indexAtX(e.nativeEvent.locationX);touchStartActiveRef.current=activeIndex;touchStartIndexRef.current=next;touchMovedRef.current=false;becameResponderRef.current=false;touchStartLocationRef.current={x:e.nativeEvent.locationX,y:e.nativeEvent.locationY};};var handleScrubGrant=function handleScrubGrant(e){if(count===0)return;becameResponderRef.current=true;touchMovedRef.current=true;setActiveIndex(indexAtX(e.nativeEvent.locationX));};var handleScrubMove=function handleScrubMove(e){if(count===0)return;touchMovedRef.current=true;setActiveIndex(indexAtX(e.nativeEvent.locationX));};var handleTouchEnd=function handleTouchEnd(){if(becameResponderRef.current||touchMovedRef.current)return;if(count===0)return;if(touchStartActiveRef.current===touchStartIndexRef.current){setActiveIndex(undefined);}else {setActiveIndex(touchStartIndexRef.current);}};var handleScrubTerminate=function handleScrubTerminate(){touchMovedRef.current=false;becameResponderRef.current=false;};var activeRow=activeIndex!==undefined?data[activeIndex]:undefined;var activeLabelRaw=activeRow&&slots.xDataKey?String((_activeRow$slots$xDat=activeRow[slots.xDataKey])!=null?_activeRow$slots$xDat:activeIndex):undefined;var activeLabel=activeLabelRaw?slots.xTickFormatter?slots.xTickFormatter(activeLabelRaw,activeIndex!=null?activeIndex:0):activeLabelRaw:undefined;var tooltipRows=useMemo(function(){if(!activeRow)return [];return visibleAreas.map(function(area){var _area$name;var rawValue=toNullableNumber(activeRow[area.dataKey]);var mappingEntry=dataColorMapping[area.dataKey];var isCustomColor=Boolean(mappingEntry==null?void 0:mappingEntry.isCustomColor);var swatchToken=isCustomColor?getHighestColorInRange({colorToken:mappingEntry.colorToken}):mappingEntry==null?void 0:mappingEntry.colorToken;var swatchColor=swatchToken?getIn(theme.colors,swatchToken):tickColor;var displayValue=rawValue===null?MISSING_TOOLTIP_VALUE:String(rawValue);var label=(_area$name=area.name)!=null?_area$name:area.dataKey;var formatter=slots.tooltipFormatter;if(formatter){try{var formatted=formatter(rawValue!=null?rawValue:undefined,area.dataKey,undefined,activeIndex,activeRow);if(Array.isArray(formatted)){if(formatted[0]!==undefined&&formatted[0]!==null){displayValue=String(formatted[0]);}if(formatted[1]!==undefined&&formatted[1]!==null){label=String(formatted[1]);}}else if(formatted!==undefined&&formatted!==null){displayValue=String(formatted);}}catch(_unused){}}return {key:area.dataKey,color:swatchColor,displayValue:displayValue,label:label};});},[activeRow,visibleAreas,dataColorMapping,theme.colors,tickColor,slots.tooltipFormatter,activeIndex]);var legendAreas=allAreas.filter(function(area){return area.showLegend;});var tooltipLeft=Math.max(padding.left,Math.min(Math.max(padding.left,size.width-TOOLTIP_WIDTH-padding.right),padding.left+xAt(activeIndex!=null?activeIndex:0)-TOOLTIP_WIDTH/2));return jsx(CommonChartComponentsContext.Provider,{value:{chartName:'area',dataColorMapping:dataColorMapping,secondaryLabelMap:secondaryLabelMap,dataLength:data==null?void 0:data.length,selectedDataKeys:selectedKeys,setSelectedDataKeys:function setSelectedDataKeys(keys){return setSelectedKeys(function(){return keys;});}},children:jsxs(BaseBox,Object.assign({},metaAttribute({name:'chart-area-container',testID:testID}),makeAnalyticsAttribute(restProps),restProps,{width:"100%",height:"100%",display:"flex",flexDirection:"column",children:[jsxs(View,{testID:testID?`${testID}-scrub-surface`:'chart-area-scrub-surface',style:{flex:1,width:'100%'},onLayout:onLayout,onTouchStart:handleTouchStart,onTouchEnd:handleTouchEnd,onMoveShouldSetResponder:function onMoveShouldSetResponder(e){if(count===0)return false;var start=touchStartLocationRef.current;if(!start||!(e!=null&&e.nativeEvent))return false;var dx=Math.abs(e.nativeEvent.locationX-start.x);var dy=Math.abs(e.nativeEvent.locationY-start.y);return dx>=SCRUB_MOVE_THRESHOLD&&dx>dy;},onResponderGrant:handleScrubGrant,onResponderMove:handleScrubMove,onResponderTerminationRequest:function onResponderTerminationRequest(){return true;},onResponderTerminate:handleScrubTerminate,children:[data.length===0?jsx(Box,{flex:1,display:"flex",alignItems:"center",justifyContent:"center",padding:"spacing.6",children:jsx(Text,{size:"small",color:"surface.text.gray.muted",children:"No data to display"})}):size.width>0&&size.height>0?jsxs(Svg,{width:size.width,height:size.height,children:[jsxs(Defs,{children:[areaGeometries.map(function(_ref3){var _mappingEntry$colorTo;var area=_ref3.area,gradientId=_ref3.gradientId;var mappingEntry=dataColorMapping[area.dataKey];var gradientToken=getHighestColorInRange({colorToken:(_mappingEntry$colorTo=mappingEntry==null?void 0:mappingEntry.colorToken)!=null?_mappingEntry$colorTo:'data.background.categorical.blue.moderate',followIntensityMapping:true});var gradientColor=getIn(theme.colors,gradientToken);return jsxs(LinearGradient,{id:gradientId,x1:"0",y1:"0",x2:"0",y2:"1",children:[jsx(Stop,{offset:"5%",stopColor:gradientColor,stopOpacity:isDarkMode?0.28:1}),jsx(Stop,{offset:"95%",stopColor:gradientColor,stopOpacity:isDarkMode?0.12:0.32})]},gradientId);}),jsx(ClipPath,{id:`${chartId}-reveal`,children:jsx(AnimatedRect,{x:0,y:0,width:plotWidth,height:plotHeight,animatedProps:clipAnimatedProps})})]}),jsxs(G,{x:padding.left,y:padding.top,children:[slots.hasGrid&&yTicks.map(function(tick,idx){var y=yAt(tick);return jsx(Line,{x1:0,x2:plotWidth,y1:y,y2:y,stroke:gridColor,strokeWidth:1},`grid-${idx}`);}),slots.hasYAxis&&jsxs(Fragment,{children:[jsx(Line,{x1:0,x2:0,y1:0,y2:plotHeight,stroke:axisLineColor,strokeWidth:1}),yTicks.map(function(tick,idx){var y=yAt(tick);return jsx(Text$1,{x:-6,y:y+TICK_FONT_SIZE/3,fontSize:TICK_FONT_SIZE,fill:tickColor,textAnchor:"end",children:slots.yTickFormatter?slots.yTickFormatter(tick):formatYTick(tick)},`ytick-${idx}`);}),slots.yLabel?jsx(Text$1,{x:-(PLOT_PADDING.left-AXIS_LABEL_FONT_SIZE-4),y:plotHeight/2,fontSize:AXIS_LABEL_FONT_SIZE,fill:tickColor,textAnchor:"middle",transform:`rotate(-90, ${-(PLOT_PADDING.left-AXIS_LABEL_FONT_SIZE-4)}, ${plotHeight/2})`,children:slots.yLabel}):null]}),jsx(G,{clipPath:`url(#${chartId}-reveal)`,children:areaGeometries.map(function(_ref4){var area=_ref4.area,points=_ref4.points,gradientId=_ref4.gradientId,strokeColor=_ref4.strokeColor;return jsx(AreaSeries,{points:points,type:area.type,connectNulls:area.connectNulls,gradientId:gradientId,strokeColor:strokeColor,dotColor:strokeColor,showDot:area.dot,showActiveDot:area.activeDot,activeIndex:activeIndex,scrubProgress:scrubProgress,activeRingColor:activeRingColor},`area-${area.dataKey}`);})}),slots.referenceLines.map(function(line,idx){var REF_LABEL_MAX_WIDTH=200;var chipWidth=line.label?Math.min(REF_LABEL_MAX_WIDTH,Math.max(40,line.label.length*6+16)):0;var chipHeight=30;var truncatedLabel=line.label&&line.label.length*6+16>REF_LABEL_MAX_WIDTH?`${line.label.slice(0,Math.floor((REF_LABEL_MAX_WIDTH-16)/6)-1)}…`:line.label;if(line.orientation==='horizontal'){var _value=Number(line.value);if(_value>yMax||_value<yMin)return null;var y=yAt(_value);return jsxs(G,{children:[jsx(Line,{x1:0,x2:plotWidth,y1:y,y2:y,stroke:referenceColor,strokeWidth:2,strokeDasharray:"4 4"}),line.label?jsxs(Fragment,{children:[jsx(Rect,{x:plotWidth-chipWidth,y:y-chipHeight/2,width:chipWidth,height:chipHeight,rx:theme.border.radius.medium,fill:referenceLabelFill,stroke:referenceLabelStroke,strokeWidth:1}),jsx(Text$1,{x:plotWidth-chipWidth/2,y:y+TICK_FONT_SIZE/3,fontSize:TICK_FONT_SIZE,fontWeight:theme.typography.fonts.weight.medium,fill:referenceLabelTextColor,textAnchor:"middle",children:truncatedLabel})]}):null]},`refline-${idx}`);}var matchIndex=data.findIndex(function(row){return slots.xDataKey&&String(row[slots.xDataKey])===String(line.value);});if(matchIndex<0&&isNumber(Number(line.value))){var numeric=Number(line.value);if(numeric>=0&&numeric<count)matchIndex=numeric;}if(matchIndex<0)return null;var px=xAt(matchIndex);return jsxs(G,{children:[jsx(Line,{x1:px,x2:px,y1:0,y2:plotHeight,stroke:referenceColor,strokeWidth:2,strokeDasharray:"4 4"}),line.label?jsxs(Fragment,{children:[jsx(Rect,{x:Math.max(0,Math.min(px-chipWidth/2,plotWidth-chipWidth)),y:0,width:chipWidth,height:chipHeight,rx:theme.border.radius.medium,fill:referenceLabelFill,stroke:referenceLabelStroke,strokeWidth:1}),jsx(Text$1,{x:Math.max(0,Math.min(px-chipWidth/2,plotWidth-chipWidth))+chipWidth/2,y:chipHeight/2+TICK_FONT_SIZE/3,fontSize:TICK_FONT_SIZE,fontWeight:theme.typography.fonts.weight.medium,fill:referenceLabelTextColor,textAnchor:"middle",children:truncatedLabel})]}):null]},`refline-${idx}`);}),activeIndex!==undefined?jsx(Line,{x1:xAt(activeIndex),x2:xAt(activeIndex),y1:0,y2:plotHeight,stroke:cursorColor,strokeWidth:1}):null,slots.hasXAxis&&jsxs(Fragment,{children:[jsx(Line,{x1:0,x2:plotWidth,y1:plotHeight,y2:plotHeight,stroke:axisLineColor,strokeWidth:1}),data.map(function(row,i){var _xLabelLines$i;if(!visibleXTickIndexSet.has(i))return null;var cx=xAt(i);var lines=(_xLabelLines$i=xLabelLines[i])!=null?_xLabelLines$i:[''];var secondary=secondaryLabelMap==null?void 0:secondaryLabelMap[i];var primaryY=plotHeight+TICK_FONT_SIZE+4;var tickTextAnchor=i===0?'start':i===count-1?'end':'middle';var secondaryY=primaryY+(maxXLabelLines-1)*TICK_LINE_HEIGHT+SECONDARY_LABEL_FONT_SIZE+PRIMARY_TO_SECONDARY_GAP;return jsxs(G,{children:[lines.map(function(line,lineIndex){return jsx(Text$1,{x:cx,y:primaryY+lineIndex*TICK_LINE_HEIGHT,fontSize:TICK_FONT_SIZE,fill:tickColor,textAnchor:tickTextAnchor,children:line},`xtick-${i}-line-${lineIndex}`);}),secondary!==undefined&&secondary!==null?jsx(Text$1,{x:cx,y:secondaryY,fontSize:SECONDARY_LABEL_FONT_SIZE,fill:tickColor,textAnchor:tickTextAnchor,children:String(secondary)}):null]},`xtick-${i}`);})]}),slots.xLabel?jsx(Text$1,{x:plotWidth/2,y:plotHeight+padding.bottom-4,fontSize:AXIS_LABEL_FONT_SIZE,fill:tickColor,textAnchor:"middle",children:slots.xLabel}):null]})]}):null,slots.hasTooltip&&activeIndex!==undefined&&tooltipRows.length>0&&size.width>0?jsxs(View,{pointerEvents:"none",style:{position:'absolute',top:padding.top,left:tooltipLeft,width:TOOLTIP_WIDTH,backgroundColor:theme.colors.surface.icon.staticBlack.normal,borderRadius:theme.border.radius.large,borderWidth:theme.border.width.thin,borderColor:theme.colors.surface.border.gray.muted,paddingHorizontal:theme.spacing[3],paddingVertical:theme.spacing[3],shadowColor:'#000',shadowOpacity:0.24,shadowRadius:12,shadowOffset:{width:0,height:6},elevation:8},children:[activeLabel?jsx(Box,{paddingBottom:"spacing.2",children:jsx(Text,{size:"small",weight:"semibold",color:"surface.text.staticWhite.normal",children:activeLabel})}):null,tooltipRows.map(function(row){return jsxs(Box,{display:"flex",flexDirection:"row",alignItems:"center",paddingY:"spacing.1",children:[jsx(View,{style:{width:8,height:8,borderRadius:2,backgroundColor:row.color,marginRight:theme.spacing[2]}}),jsx(Box,{flex:1,children:jsx(Text,{size:"xsmall",color:"surface.text.staticWhite.normal",children:row.label})}),jsx(Text,{size:"xsmall",weight:"semibold",color:"surface.text.staticWhite.normal",children:row.displayValue})]},row.key);})]}):null]}),slots.legend.hasLegend&&legendAreas.length>0?jsx(View,{style:{flexDirection:slots.legend.layout==='vertical'?'column':'row',flexWrap:slots.legend.layout==='vertical'?'nowrap':'wrap',alignItems:slots.legend.layout==='vertical'?'flex-start':'center',justifyContent:slots.legend.align==='left'?'flex-start':slots.legend.align==='right'?'flex-end':'center',paddingTop:theme.spacing[2]},children:legendAreas.map(function(area){var _area$name2,_area$name3;var mappingEntry=dataColorMapping[area.dataKey];var swatchToken=mappingEntry!=null&&mappingEntry.isCustomColor?getHighestColorInRange({colorToken:mappingEntry.colorToken}):mappingEntry==null?void 0:mappingEntry.colorToken;var swatchColor=swatchToken?getIn(theme.colors,swatchToken):tickColor;var isSelected=selectedKeys.includes(area.dataKey);return jsxs(Pressable,Object.assign({onPress:function onPress(){return handleLegendToggle(area.dataKey);},accessibilityRole:"button",accessibilityLabel:`${(_area$name2=area.name)!=null?_area$name2:area.dataKey}, ${isSelected?'selected':'deselected'}`,style:{flexDirection:'row',alignItems:'center',marginHorizontal:theme.spacing[3],marginVertical:theme.spacing[1],opacity:isSelected?1:0.4}},metaAttribute({name:`chart-legend-item-${area.dataKey}`}),{children:[jsx(View,{style:{width:LEGEND_SWATCH_SIZE,height:LEGEND_SWATCH_SIZE,borderRadius:theme.border.radius['2xsmall'],backgroundColor:swatchColor,marginRight:theme.spacing[2]}}),jsx(Text,{size:"xsmall",color:"surface.text.gray.muted",textDecorationLine:isSelected?'none':'line-through',children:(_area$name3=area.name)!=null?_area$name3:area.dataKey})]}),`legend-${area.dataKey}`);})}):null]}))});};
|
|
40
|
+
var _excluded=["children","colorTheme","data","testID"];var _this=undefined,_jsxFileName="/home/runner/work/blade/blade/packages/blade/src/components/Charts/AreaChart/AreaChart.native.tsx";var PLOT_PADDING={top:16,right:16,bottom:32,left:40};var Y_TICK_COUNT=4;var TICK_FONT_SIZE=10;var AXIS_LABEL_FONT_SIZE=11;var SECONDARY_LABEL_FONT_SIZE=10;var X_AXIS_TITLE_GAP=6;var PRIMARY_TO_SECONDARY_GAP=8;var X_TICK_LABEL_GAP=8;var TICK_LINE_HEIGHT=TICK_FONT_SIZE+2;var MAX_TICK_LABEL_LINES=3;var STROKE_WIDTH=1.5;var AREA_FILL_OPACITY=0.5;var AREA_FILL_OPACITY_DIMMED=0.3;var DOT_RADIUS=3;var ACTIVE_DOT_RADIUS=4.5;var LEGEND_SWATCH_SIZE=12;var TOOLTIP_WIDTH=180;var AnimatedRect=Animated.createAnimatedComponent(Rect);var AnimatedPath=Animated.createAnimatedComponent(Path);var uniqueChartCounter=0;var readChildSlots=function readChildSlots(children){var slots={areas:[],hasXAxis:false,hasYAxis:false,hasGrid:false,legend:{hasLegend:false},referenceLines:[],hasTooltip:false};React__default.Children.forEach(children,function(child){if(!React__default.isValidElement(child))return;var id=getComponentId(child);if(id===componentIds.ChartArea){var _props$type;var props=child.props;if(props.dataKey==null)return;slots.areas.push({dataKey:String(props.dataKey),name:props.name,color:props.color,stackId:props.stackId!=null?String(props.stackId):'1',type:(_props$type=props.type)!=null?_props$type:'monotone',connectNulls:Boolean(props.connectNulls),connectNullsStyle:props.connectNullsStyle==='dashed'?'dashed':'solid',hide:props.hide,showLegend:props.showLegend!==false,dot:Boolean(props.dot),activeDot:props.activeDot!==false});}else if(id===componentId.chartXAxis){var _props2=child.props;slots.hasXAxis=true;slots.xDataKey=_props2.dataKey;slots.xSecondaryDataKey=_props2.secondaryDataKey;slots.xTickFormatter=_props2.tickFormatter;slots.xInterval=_props2.interval;slots.xLabel=_props2.label;}else if(id===componentId.chartYAxis){var _props3=child.props;slots.hasYAxis=true;slots.yLabel=_props3.label;if(Array.isArray(_props3.domain)&&_props3.domain.length===2){slots.yDomain=[_props3.domain[0],_props3.domain[1]];}if(typeof _props3.tickFormatter==='function'){slots.yTickFormatter=_props3.tickFormatter;}if(typeof _props3.tickCount==='number'){slots.yTickCount=_props3.tickCount;}}else if(id===componentId.chartLegend){var _props4=child.props;slots.legend={hasLegend:true,selectedDataKeys:_props4.selectedDataKeys,defaultSelectedDataKeys:_props4.defaultSelectedDataKeys,onSelectedDataKeysChange:_props4.onSelectedDataKeysChange,layout:_props4.layout,align:_props4.align};}else if(id===componentId.chartCartesianGrid){slots.hasGrid=true;}else if(id===componentId.chartTooltip){slots.hasTooltip=true;var _props5=child.props;if(typeof _props5.formatter==='function'){slots.tooltipFormatter=_props5.formatter;}}else if(id===componentId.chartReferenceLine){var _props6=child.props;if(typeof _props6.y==='number'){slots.referenceLines.push({orientation:'horizontal',value:_props6.y,label:typeof _props6.label==='string'?_props6.label:undefined});}else if(_props6.x!==undefined&&_props6.x!==null){slots.referenceLines.push({orientation:'vertical',value:_props6.x,label:typeof _props6.label==='string'?_props6.label:undefined});}}});return slots;};var niceCeil=function niceCeil(raw){if(raw<=0)return 1;var exponent=Math.floor(Math.log10(raw));var fraction=raw/10**exponent;var niceFraction=fraction<=1?1:fraction<=2?2:fraction<=5?5:10;return niceFraction*10**exponent;};var niceFloor=function niceFloor(raw){if(raw>=0)return 0;var abs=Math.abs(raw);var exponent=Math.floor(Math.log10(abs));var fraction=abs/10**exponent;var niceFraction=fraction<=1?1:fraction<=2?2:fraction<=5?5:10;return -(niceFraction*10**exponent);};var toNullableNumber=function toNullableNumber(raw){if(raw===null||raw===undefined)return null;var value=Number(raw);return Number.isNaN(value)||!isFinite(value)?null:value;};var MISSING_TOOLTIP_VALUE='—';var formatYTick=function formatYTick(value){var abs=Math.abs(value);if(abs>=1000000)return `${(value/1000000).toFixed(abs>=10000000?0:1)}M`;if(abs>=1000)return `${(value/1000).toFixed(abs>=10000?0:1)}K`;return String(value);};var estimateTickLabelWidth=function estimateTickLabelWidth(label,fontSize){return Math.max(1,label.length)*fontSize*0.6+X_TICK_LABEL_GAP;};var wrapLabelToLines=function wrapLabelToLines(label,maxWidth,fontSize){var text=String(label).trim();if(!text)return [''];if(maxWidth<=0)return [text];var maxChars=Math.max(1,Math.floor(maxWidth/(fontSize*0.6)));var words=text.split(/\s+/);var lines=[];var current='';var flush=function flush(){if(current){lines.push(current);current='';}};words.forEach(function(word){var remaining=word;while(remaining.length>maxChars){flush();lines.push(remaining.slice(0,maxChars));remaining=remaining.slice(maxChars);}if(!current){current=remaining;}else if(current.length+1+remaining.length<=maxChars){current=`${current} ${remaining}`;}else {flush();current=remaining;}});flush();if(lines.length>MAX_TICK_LABEL_LINES){var kept=lines.slice(0,MAX_TICK_LABEL_LINES);var lastIndex=MAX_TICK_LABEL_LINES-1;var last=kept[lastIndex];kept[lastIndex]=`${last.slice(0,Math.max(1,maxChars-1))}…`;return kept;}return lines;};var selectNonOverlappingXTickIndices=function selectNonOverlappingXTickIndices(pointCount,widths,xForIndex,forcedStep){if(pointCount<=0)return [];if(pointCount===1)return [0];var rightExtent=function rightExtent(i){return xForIndex(i)+(i===0?widths[i]:widths[i]/2);};var leftExtent=function leftExtent(i){return xForIndex(i)-(i===pointCount-1?widths[i]:widths[i]/2);};var fitsAfter=function fitsAfter(prev,next){return leftExtent(next)>=rightExtent(prev);};if(forcedStep!==undefined){var step=Math.max(1,forcedStep);var indices=[];for(var i=0;i<pointCount;i+=step){indices.push(i);}var _last=pointCount-1;if(indices[indices.length-1]!==_last&&fitsAfter(indices[indices.length-1],_last)){indices.push(_last);}return indices;}var first=0;var last=pointCount-1;var firstLastFit=fitsAfter(first,last);var selected=[first];if(firstLastFit){var _prev=first;for(var _i=1;_i<last;_i++){if(fitsAfter(_prev,_i)&&fitsAfter(_i,last)){selected.push(_i);_prev=_i;}}selected.push(last);return selected;}var prev=first;for(var _i2=1;_i2<pointCount;_i2++){if(fitsAfter(prev,_i2)){selected.push(_i2);prev=_i2;}}return selected;};var buildMonotone=function buildMonotone(pts){var n=pts.length;if(n<2)return '';var xs=pts.map(function(p){return p.x;});var ys=pts.map(function(p){return p.y;});var delta=[];for(var i=0;i<n-1;i++){var dx=xs[i+1]-xs[i];delta.push(dx===0?0:(ys[i+1]-ys[i])/dx);}var m=new Array(n).fill(0);m[0]=delta[0];m[n-1]=delta[n-2];for(var _i3=1;_i3<n-1;_i3++){if(delta[_i3-1]*delta[_i3]<=0){m[_i3]=0;}else {m[_i3]=(delta[_i3-1]+delta[_i3])/2;}}for(var _i4=0;_i4<n-1;_i4++){if(delta[_i4]===0){m[_i4]=0;m[_i4+1]=0;}else {var a=m[_i4]/delta[_i4];var b=m[_i4+1]/delta[_i4];var s=a*a+b*b;if(s>9){var t=3/Math.sqrt(s);m[_i4]=t*a*delta[_i4];m[_i4+1]=t*b*delta[_i4];}}}var d='';for(var _i5=0;_i5<n-1;_i5++){var _dx=xs[_i5+1]-xs[_i5];var cp1x=xs[_i5]+_dx/3;var cp1y=ys[_i5]+m[_i5]*_dx/3;var cp2x=xs[_i5+1]-_dx/3;var cp2y=ys[_i5+1]-m[_i5+1]*_dx/3;d+=` C ${cp1x} ${cp1y} ${cp2x} ${cp2y} ${xs[_i5+1]} ${ys[_i5+1]}`;}return d.trim();};var buildCurve=function buildCurve(pts,type){var n=pts.length;if(n<2)return '';if(type==='monotone')return buildMonotone(pts);var commands=[];for(var i=1;i<n;i++){var prev=pts[i-1];var curr=pts[i];if(type==='linear'){commands.push(`L ${curr.x} ${curr.y}`);}else if(type==='stepAfter'){commands.push(`L ${curr.x} ${prev.y}`);commands.push(`L ${curr.x} ${curr.y}`);}else if(type==='stepBefore'){commands.push(`L ${prev.x} ${curr.y}`);commands.push(`L ${curr.x} ${curr.y}`);}else {var mid=(prev.x+curr.x)/2;commands.push(`L ${mid} ${prev.y}`);commands.push(`L ${mid} ${curr.y}`);commands.push(`L ${curr.x} ${curr.y}`);}}return commands.join(' ');};var NULL_BRIDGE_DASHARRAY='5 5';var AreaSeries=function AreaSeries(_ref){var points=_ref.points,type=_ref.type,connectNulls=_ref.connectNulls,connectNullsStyle=_ref.connectNullsStyle,gradientId=_ref.gradientId,strokeColor=_ref.strokeColor,dotColor=_ref.dotColor,showDot=_ref.showDot,showActiveDot=_ref.showActiveDot,activeIndex=_ref.activeIndex,scrubProgress=_ref.scrubProgress,activeRingColor=_ref.activeRingColor;var animatedProps=useAnimatedProps(function(){return {fillOpacity:AREA_FILL_OPACITY-scrubProgress.value*(AREA_FILL_OPACITY-AREA_FILL_OPACITY_DIMMED)};});var isSolidBridge=connectNulls&&connectNullsStyle==='solid';var isDashedBridge=connectNulls&&connectNullsStyle==='dashed';var segments=[];if(isSolidBridge){var nonNull=points.filter(function(p){return !p.isNull;});if(nonNull.length)segments.push(nonNull);}else {var current=[];points.forEach(function(p){if(p.isNull){if(current.length)segments.push(current);current=[];}else {current.push(p);}});if(current.length)segments.push(current);}var bridgePaths=[];if(isDashedBridge&&segments.length>1){var definedTop=points.filter(function(p){return !p.isNull;});var xs=definedTop.map(function(p){return p.x;});var ys=definedTop.map(function(p){return p.yTop;});for(var i=0;i<segments.length-1;i++){var from=segments[i][segments[i].length-1];var to=segments[i+1][0];var sampleCount=Math.max(2,Math.round(Math.abs(to.x-from.x)/3));var bridgeD=`M ${from.x} ${from.yTop}`;for(var step=1;step<=sampleCount;step++){var t=step/sampleCount;var x=from.x+(to.x-from.x)*t;var y=monotoneInterpolate(xs,ys,x);bridgeD+=` L ${x} ${y}`;}bridgePaths.push(bridgeD);}}return jsxs(G,{children:[segments.map(function(segment,segIndex){if(segment.length===0)return null;var topPts=segment.map(function(p){return {x:p.x,y:p.yTop};});var basePts=segment.map(function(p){return {x:p.x,y:p.yBase};});var reversedBase=_toConsumableArray(basePts).reverse();var strokeD=`M ${topPts[0].x} ${topPts[0].y} ${buildCurve(topPts,type)}`.trim();var fillD='';if(segment.length>=2){fillD=`M ${topPts[0].x} ${topPts[0].y} ${buildCurve(topPts,type)} `+`L ${reversedBase[0].x} ${reversedBase[0].y} ${buildCurve(reversedBase,type)} Z`;}return jsxs(G,{children:[fillD?jsx(AnimatedPath,{d:fillD,fill:`url(#${gradientId})`,animatedProps:animatedProps}):null,jsx(Path,{d:strokeD,stroke:strokeColor,strokeWidth:STROKE_WIDTH,fill:"none",strokeLinejoin:"round"})]},`segment-${segIndex}`);}),bridgePaths.map(function(bridgeD,bridgeIndex){return jsx(Path,{testID:"area-null-bridge",d:bridgeD,stroke:strokeColor,strokeWidth:STROKE_WIDTH,strokeDasharray:isDashedBridge?NULL_BRIDGE_DASHARRAY:undefined,fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},`null-bridge-${bridgeIndex}`);}),showDot?points.map(function(p,idx){return p.isNull?null:jsx(Circle,{cx:p.x,cy:p.yTop,r:DOT_RADIUS,fill:strokeColor},`dot-${idx}`);}):null,showActiveDot&&activeIndex!==undefined&&points[activeIndex]&&!points[activeIndex].isNull?jsx(Circle,{cx:points[activeIndex].x,cy:points[activeIndex].yTop,r:ACTIVE_DOT_RADIUS,fill:dotColor,stroke:activeRingColor,strokeWidth:2}):null]});};var _ChartArea=function _ChartArea(_props){return null;};var ChartArea=assignWithoutSideEffects(_ChartArea,{componentId:componentIds.ChartArea});var ChartAreaWrapper=function ChartAreaWrapper(_ref2){var _slots$legend$default,_slots$yTickCount,_activeRow$slots$xDat;var children=_ref2.children,_ref2$colorTheme=_ref2.colorTheme,colorTheme=_ref2$colorTheme===void 0?'categorical':_ref2$colorTheme,_ref2$data=_ref2.data,data=_ref2$data===void 0?[]:_ref2$data,testID=_ref2.testID,restProps=_objectWithoutProperties(_ref2,_excluded);var _useTheme=useTheme(),theme=_useTheme.theme,colorScheme=_useTheme.colorScheme;var isDarkMode=colorScheme==='dark';var _useState=useState({width:0,height:0}),_useState2=_slicedToArray(_useState,2),size=_useState2[0],setSize=_useState2[1];var _useState3=useState(undefined),_useState4=_slicedToArray(_useState3,2),activeIndex=_useState4[0],setActiveIndex=_useState4[1];var chartIdRef=useRef(undefined);if(chartIdRef.current===undefined){chartIdRef.current=`area-${uniqueChartCounter++}`;}var chartId=chartIdRef.current;var scrubProgress=useSharedValue(0);useEffect(function(){scrubProgress.value=withTiming(activeIndex!==undefined?1:0,{duration:getIn(theme.motion,'duration.quick')});},[activeIndex]);var onLayout=function onLayout(e){var _e$nativeEvent$layout=e.nativeEvent.layout,width=_e$nativeEvent$layout.width,height=_e$nativeEvent$layout.height;if(width!==size.width||height!==size.height){setSize({width:width,height:height});}};var slots=useMemo(function(){return readChildSlots(children);},[children]);var allAreas=slots.areas;var yAxisWarnedRef=useRef(false);useEffect(function(){if(!__DEV__)return;if(slots.hasYAxis&&!yAxisWarnedRef.current){var unsupported=[];if(slots.yDomain&&!slots.yDomain.every(function(v){return isNumber(Number(v));})){unsupported.push('domain (non-numeric)');}if(unsupported.length>0){yAxisWarnedRef.current=true;logger({type:'warn',moduleName:'ChartAreaWrapper',message:`ChartYAxis prop(s) [${unsupported.join(', ')}] are not fully supported on native. Supported: label, domain (numeric), tickFormatter, tickCount.`});}}},[slots.hasYAxis,slots.yDomain]);var themeColors=useChartsColorTheme({colorTheme:colorTheme,chartName:'area',chartDataIndicators:allAreas.length});var dataColorMapping=useMemo(function(){var mapping={};allAreas.forEach(function(area){mapping[area.dataKey]={colorToken:area.color,isCustomColor:Boolean(area.color)};});assignDataColorMapping(mapping,themeColors);return mapping;},[allAreas,themeColors]);var allDataKeys=useMemo(function(){return Object.keys(dataColorMapping);},[dataColorMapping]);var _useControllableState=useControllableState({value:slots.legend.selectedDataKeys,defaultValue:(_slots$legend$default=slots.legend.defaultSelectedDataKeys)!=null?_slots$legend$default:allDataKeys}),_useControllableState2=_slicedToArray(_useControllableState,2),selectedKeys=_useControllableState2[0],setSelectedKeys=_useControllableState2[1];var handleLegendToggle=function handleLegendToggle(dataKey){var next=selectedKeys.includes(dataKey)?selectedKeys.filter(function(k){return k!==dataKey;}):[].concat(_toConsumableArray(selectedKeys),[dataKey]);setSelectedKeys(function(){return next;});slots.legend.onSelectedDataKeysChange==null?void 0:slots.legend.onSelectedDataKeysChange({dataKey:dataKey,selectedKeysArray:next});};var visibleAreas=useMemo(function(){return allAreas.filter(function(area){return !area.hide&&selectedKeys.includes(area.dataKey);});},[allAreas,selectedKeys]);var secondaryLabelMap=useMemo(function(){if(!slots.xSecondaryDataKey||!(data!=null&&data.length))return undefined;var map={};data.forEach(function(row,index){map[index]=row[slots.xSecondaryDataKey];});return map;},[data,slots.xSecondaryDataKey]);var stackGroups=useMemo(function(){var groupOrder=[];var map=new Map();visibleAreas.forEach(function(area){var key=area.stackId;if(!map.has(key)){map.set(key,[]);groupOrder.push(key);}map.get(key).push(area);});return groupOrder.map(function(key){return {key:key,areas:map.get(key)};});},[visibleAreas]);var _useMemo=useMemo(function(){if(!data.length)return {dataMax:0,dataMin:0};var max=0;var min=0;data.forEach(function(row){stackGroups.forEach(function(group){var sum=group.areas.reduce(function(acc,area){return acc+(Number(row[area.dataKey])||0);},0);if(sum>max)max=sum;if(sum<min)min=sum;});});return {dataMax:max,dataMin:min};},[data,stackGroups]),dataMax=_useMemo.dataMax,dataMin=_useMemo.dataMin;var yMax=slots.yDomain?Number(slots.yDomain[1]):niceCeil(dataMax);var yMin=slots.yDomain?Number(slots.yDomain[0]):dataMin<0?niceFloor(dataMin):0;var yRange=yMax-yMin;var yTickCount=(_slots$yTickCount=slots.yTickCount)!=null?_slots$yTickCount:Y_TICK_COUNT;var yTicks=useMemo(function(){var ticks=[];for(var i=0;i<=yTickCount;i++){ticks.push(yMin+yRange/yTickCount*i);}return ticks;},[yMin,yRange,yTickCount]);var showAxes=slots.hasXAxis||slots.hasYAxis;var hasSecondaryXLabels=Boolean(slots.xSecondaryDataKey);var secondaryRowHeight=hasSecondaryXLabels?SECONDARY_LABEL_FONT_SIZE+PRIMARY_TO_SECONDARY_GAP:0;var xAxisTitleHeight=slots.xLabel?AXIS_LABEL_FONT_SIZE+X_AXIS_TITLE_GAP:0;var count=data.length;var plotWidthForLabels=Math.max(0,size.width-PLOT_PADDING.left-PLOT_PADDING.right);var columnWidth=count>1?plotWidthForLabels/(count-1):plotWidthForLabels;var xLabels=useMemo(function(){return data.map(function(row,index){var _row$slots$xDataKey;var rawLabel=slots.xDataKey?String((_row$slots$xDataKey=row[slots.xDataKey])!=null?_row$slots$xDataKey:''):String(index);return slots.xTickFormatter?slots.xTickFormatter(rawLabel,index):rawLabel;});},[data,slots.xDataKey,slots.xTickFormatter]);var xLabelLines=useMemo(function(){var maxWidth=Math.max(0,columnWidth*0.6-X_TICK_LABEL_GAP);return xLabels.map(function(label){return wrapLabelToLines(label,maxWidth,TICK_FONT_SIZE);});},[xLabels,columnWidth]);var maxXLabelLines=useMemo(function(){return xLabelLines.reduce(function(max,lines){return Math.max(max,lines.length);},1);},[xLabelLines]);var primaryLabelRowHeight=maxXLabelLines*TICK_LINE_HEIGHT;var padding=showAxes?Object.assign({},PLOT_PADDING,{bottom:Math.max(PLOT_PADDING.bottom,primaryLabelRowHeight+4+secondaryRowHeight+xAxisTitleHeight+4)}):{top:0,right:0,bottom:0,left:0};var plotWidth=Math.max(0,size.width-padding.left-padding.right);var plotHeight=Math.max(0,size.height-padding.top-padding.bottom);var pointStep=count>1?plotWidth/(count-1):0;var xAt=function xAt(i){return count>1?i*pointStep:plotWidth/2;};var yAt=function yAt(value){return yRange>0?plotHeight-(value-yMin)/yRange*plotHeight:plotHeight;};var visibleXTickIndices=useMemo(function(){if(count<=0)return [];var widths=xLabelLines.map(function(lines,index){var primaryWidth=lines.reduce(function(max,line){return Math.max(max,estimateTickLabelWidth(line,TICK_FONT_SIZE));},0);var secondary=secondaryLabelMap==null?void 0:secondaryLabelMap[index];var secondaryWidth=secondary!==undefined&&secondary!==null?estimateTickLabelWidth(String(secondary),SECONDARY_LABEL_FONT_SIZE):0;return Math.max(primaryWidth,secondaryWidth);});var forcedStep=slots.xInterval!==undefined?Math.max(1,slots.xInterval+1):undefined;return selectNonOverlappingXTickIndices(count,widths,xAt,forcedStep);},[count,pointStep,plotWidth,xLabelLines,secondaryLabelMap,slots.xInterval]);var visibleXTickIndexSet=useMemo(function(){return new Set(visibleXTickIndices);},[visibleXTickIndices]);var tickColor=getIn(theme.colors,'surface.text.gray.muted');var referenceLabelTextColor=getIn(theme.colors,'surface.text.gray.normal');var axisLineColor=getIn(theme.colors,'surface.border.gray.muted');var gridColor=getIn(theme.colors,'surface.border.gray.subtle');var referenceColor=getIn(theme.colors,'data.background.categorical.gray.intense');var referenceLabelFill=getIn(theme.colors,'surface.background.gray.subtle');var referenceLabelStroke=getIn(theme.colors,'surface.border.gray.muted');var cursorColor=getIn(theme.colors,'surface.border.gray.normal');var activeRingColor=getIn(theme.colors,'surface.background.gray.intense');var areaGeometries=useMemo(function(){var geometries=[];stackGroups.forEach(function(group){var runningBase=new Array(count).fill(0);group.areas.forEach(function(area){var points=data.map(function(row,i){var raw=row[area.dataKey];var isNull=raw===null||raw===undefined||!isNumber(Number(raw));var value=isNull?0:Number(raw);var base=runningBase[i];var top=base+value;runningBase[i]+=value;return {x:xAt(i),yTop:yAt(top),yBase:yAt(base),isNull:isNull};});var mappingEntry=dataColorMapping[area.dataKey];var isCustomColor=Boolean(mappingEntry==null?void 0:mappingEntry.isCustomColor);var strokeToken=isCustomColor?getHighestColorInRange({colorToken:mappingEntry.colorToken}):mappingEntry==null?void 0:mappingEntry.colorToken;var strokeColor=strokeToken?getIn(theme.colors,strokeToken):tickColor;geometries.push({area:area,points:points,gradientId:`${chartId}-grad-${area.dataKey}`,strokeColor:strokeColor});});});return geometries;},[stackGroups,data,count,plotWidth,plotHeight,yMax,yMin,yRange,dataColorMapping,theme.colors]);var revealProgress=useSharedValue(0);var lastRevealKeyRef=useRef(undefined);useEffect(function(){if(count===0||plotWidth<=0){if(count===0){lastRevealKeyRef.current=undefined;}return;}var revealKey=`${count}:${visibleAreas.length}`;if(lastRevealKeyRef.current===revealKey){revealProgress.value=1;return;}lastRevealKeyRef.current=revealKey;revealProgress.value=0;revealProgress.value=withDelay(getIn(theme.motion,'delay.gentle'),withTiming(1,{duration:getIn(theme.motion,'duration.xgentle'),easing:getIn(theme.motion,'easing.entrance')}));},[count,visibleAreas.length,plotWidth]);var clipAnimatedProps=useAnimatedProps(function(){return {width:revealProgress.value*plotWidth};});var indexAtX=function indexAtX(localX){if(count===0)return undefined;var plotX=localX-padding.left;if(count===1)return 0;if(pointStep===0)return 0;var idx=Math.round(plotX/pointStep);return Math.min(count-1,Math.max(0,idx));};var touchStartActiveRef=React__default.useRef(undefined);var touchStartIndexRef=React__default.useRef(undefined);var touchMovedRef=React__default.useRef(false);var becameResponderRef=React__default.useRef(false);var touchStartLocationRef=React__default.useRef(undefined);var SCRUB_MOVE_THRESHOLD=8;var handleTouchStart=function handleTouchStart(e){if(count===0)return;var next=indexAtX(e.nativeEvent.locationX);touchStartActiveRef.current=activeIndex;touchStartIndexRef.current=next;touchMovedRef.current=false;becameResponderRef.current=false;touchStartLocationRef.current={x:e.nativeEvent.locationX,y:e.nativeEvent.locationY};};var handleScrubGrant=function handleScrubGrant(e){if(count===0)return;becameResponderRef.current=true;touchMovedRef.current=true;setActiveIndex(indexAtX(e.nativeEvent.locationX));};var handleScrubMove=function handleScrubMove(e){if(count===0)return;touchMovedRef.current=true;setActiveIndex(indexAtX(e.nativeEvent.locationX));};var handleTouchEnd=function handleTouchEnd(){if(becameResponderRef.current||touchMovedRef.current)return;if(count===0)return;if(touchStartActiveRef.current===touchStartIndexRef.current){setActiveIndex(undefined);}else {setActiveIndex(touchStartIndexRef.current);}};var handleScrubTerminate=function handleScrubTerminate(){touchMovedRef.current=false;becameResponderRef.current=false;};var activeRow=activeIndex!==undefined?data[activeIndex]:undefined;var activeLabelRaw=activeRow&&slots.xDataKey?String((_activeRow$slots$xDat=activeRow[slots.xDataKey])!=null?_activeRow$slots$xDat:activeIndex):undefined;var activeLabel=activeLabelRaw?slots.xTickFormatter?slots.xTickFormatter(activeLabelRaw,activeIndex!=null?activeIndex:0):activeLabelRaw:undefined;var tooltipRows=useMemo(function(){if(!activeRow)return [];return visibleAreas.map(function(area){var _area$name;var rawValue=toNullableNumber(activeRow[area.dataKey]);var mappingEntry=dataColorMapping[area.dataKey];var isCustomColor=Boolean(mappingEntry==null?void 0:mappingEntry.isCustomColor);var swatchToken=isCustomColor?getHighestColorInRange({colorToken:mappingEntry.colorToken}):mappingEntry==null?void 0:mappingEntry.colorToken;var swatchColor=swatchToken?getIn(theme.colors,swatchToken):tickColor;var displayValue=rawValue===null?MISSING_TOOLTIP_VALUE:String(rawValue);var label=(_area$name=area.name)!=null?_area$name:area.dataKey;var formatter=slots.tooltipFormatter;if(formatter){try{var formatted=formatter(rawValue!=null?rawValue:undefined,area.dataKey,undefined,activeIndex,activeRow);if(Array.isArray(formatted)){if(formatted[0]!==undefined&&formatted[0]!==null){displayValue=String(formatted[0]);}if(formatted[1]!==undefined&&formatted[1]!==null){label=String(formatted[1]);}}else if(formatted!==undefined&&formatted!==null){displayValue=String(formatted);}}catch(_unused){}}return {key:area.dataKey,color:swatchColor,displayValue:displayValue,label:label};});},[activeRow,visibleAreas,dataColorMapping,theme.colors,tickColor,slots.tooltipFormatter,activeIndex]);var legendAreas=allAreas.filter(function(area){return area.showLegend;});var tooltipLeft=Math.max(padding.left,Math.min(Math.max(padding.left,size.width-TOOLTIP_WIDTH-padding.right),padding.left+xAt(activeIndex!=null?activeIndex:0)-TOOLTIP_WIDTH/2));return jsx(CommonChartComponentsContext.Provider,{value:{chartName:'area',dataColorMapping:dataColorMapping,secondaryLabelMap:secondaryLabelMap,dataLength:data==null?void 0:data.length,selectedDataKeys:selectedKeys,setSelectedDataKeys:function setSelectedDataKeys(keys){return setSelectedKeys(function(){return keys;});}},children:jsxs(BaseBox,Object.assign({},metaAttribute({name:'chart-area-container',testID:testID}),makeAnalyticsAttribute(restProps),restProps,{width:"100%",height:"100%",display:"flex",flexDirection:"column",children:[jsxs(View,{testID:testID?`${testID}-scrub-surface`:'chart-area-scrub-surface',style:{flex:1,width:'100%'},onLayout:onLayout,onTouchStart:handleTouchStart,onTouchEnd:handleTouchEnd,onMoveShouldSetResponder:function onMoveShouldSetResponder(e){if(count===0)return false;var start=touchStartLocationRef.current;if(!start||!(e!=null&&e.nativeEvent))return false;var dx=Math.abs(e.nativeEvent.locationX-start.x);var dy=Math.abs(e.nativeEvent.locationY-start.y);return dx>=SCRUB_MOVE_THRESHOLD&&dx>dy;},onResponderGrant:handleScrubGrant,onResponderMove:handleScrubMove,onResponderTerminationRequest:function onResponderTerminationRequest(){return true;},onResponderTerminate:handleScrubTerminate,children:[data.length===0?jsx(Box,{flex:1,display:"flex",alignItems:"center",justifyContent:"center",padding:"spacing.6",children:jsx(Text,{size:"small",color:"surface.text.gray.muted",children:"No data to display"})}):size.width>0&&size.height>0?jsxs(Svg,{width:size.width,height:size.height,children:[jsxs(Defs,{children:[areaGeometries.map(function(_ref3){var _mappingEntry$colorTo;var area=_ref3.area,gradientId=_ref3.gradientId;var mappingEntry=dataColorMapping[area.dataKey];var gradientToken=getHighestColorInRange({colorToken:(_mappingEntry$colorTo=mappingEntry==null?void 0:mappingEntry.colorToken)!=null?_mappingEntry$colorTo:'data.background.categorical.blue.moderate',followIntensityMapping:true});var gradientColor=getIn(theme.colors,gradientToken);return jsxs(LinearGradient,{id:gradientId,x1:"0",y1:"0",x2:"0",y2:"1",children:[jsx(Stop,{offset:"5%",stopColor:gradientColor,stopOpacity:isDarkMode?0.28:1}),jsx(Stop,{offset:"95%",stopColor:gradientColor,stopOpacity:isDarkMode?0.12:0.32})]},gradientId);}),jsx(ClipPath,{id:`${chartId}-reveal`,children:jsx(AnimatedRect,{x:0,y:0,width:plotWidth,height:plotHeight,animatedProps:clipAnimatedProps})})]}),jsxs(G,{x:padding.left,y:padding.top,children:[slots.hasGrid&&yTicks.map(function(tick,idx){var y=yAt(tick);return jsx(Line,{x1:0,x2:plotWidth,y1:y,y2:y,stroke:gridColor,strokeWidth:1},`grid-${idx}`);}),slots.hasYAxis&&jsxs(Fragment,{children:[jsx(Line,{x1:0,x2:0,y1:0,y2:plotHeight,stroke:axisLineColor,strokeWidth:1}),yTicks.map(function(tick,idx){var y=yAt(tick);return jsx(Text$1,{x:-6,y:y+TICK_FONT_SIZE/3,fontSize:TICK_FONT_SIZE,fill:tickColor,textAnchor:"end",children:slots.yTickFormatter?slots.yTickFormatter(tick):formatYTick(tick)},`ytick-${idx}`);}),slots.yLabel?jsx(Text$1,{x:-(PLOT_PADDING.left-AXIS_LABEL_FONT_SIZE-4),y:plotHeight/2,fontSize:AXIS_LABEL_FONT_SIZE,fill:tickColor,textAnchor:"middle",transform:`rotate(-90, ${-(PLOT_PADDING.left-AXIS_LABEL_FONT_SIZE-4)}, ${plotHeight/2})`,children:slots.yLabel}):null]}),jsx(G,{clipPath:`url(#${chartId}-reveal)`,children:areaGeometries.map(function(_ref4){var area=_ref4.area,points=_ref4.points,gradientId=_ref4.gradientId,strokeColor=_ref4.strokeColor;return jsx(AreaSeries,{points:points,type:area.type,connectNulls:area.connectNulls,connectNullsStyle:area.connectNullsStyle,gradientId:gradientId,strokeColor:strokeColor,dotColor:strokeColor,showDot:area.dot,showActiveDot:area.activeDot,activeIndex:activeIndex,scrubProgress:scrubProgress,activeRingColor:activeRingColor},`area-${area.dataKey}`);})}),slots.referenceLines.map(function(line,idx){var REF_LABEL_MAX_WIDTH=200;var chipWidth=line.label?Math.min(REF_LABEL_MAX_WIDTH,Math.max(40,line.label.length*6+16)):0;var chipHeight=30;var truncatedLabel=line.label&&line.label.length*6+16>REF_LABEL_MAX_WIDTH?`${line.label.slice(0,Math.floor((REF_LABEL_MAX_WIDTH-16)/6)-1)}…`:line.label;if(line.orientation==='horizontal'){var _value=Number(line.value);if(_value>yMax||_value<yMin)return null;var y=yAt(_value);return jsxs(G,{children:[jsx(Line,{x1:0,x2:plotWidth,y1:y,y2:y,stroke:referenceColor,strokeWidth:2,strokeDasharray:"4 4"}),line.label?jsxs(Fragment,{children:[jsx(Rect,{x:plotWidth-chipWidth,y:y-chipHeight/2,width:chipWidth,height:chipHeight,rx:theme.border.radius.medium,fill:referenceLabelFill,stroke:referenceLabelStroke,strokeWidth:1}),jsx(Text$1,{x:plotWidth-chipWidth/2,y:y+TICK_FONT_SIZE/3,fontSize:TICK_FONT_SIZE,fontWeight:theme.typography.fonts.weight.medium,fill:referenceLabelTextColor,textAnchor:"middle",children:truncatedLabel})]}):null]},`refline-${idx}`);}var matchIndex=data.findIndex(function(row){return slots.xDataKey&&String(row[slots.xDataKey])===String(line.value);});if(matchIndex<0&&isNumber(Number(line.value))){var numeric=Number(line.value);if(numeric>=0&&numeric<count)matchIndex=numeric;}if(matchIndex<0)return null;var px=xAt(matchIndex);return jsxs(G,{children:[jsx(Line,{x1:px,x2:px,y1:0,y2:plotHeight,stroke:referenceColor,strokeWidth:2,strokeDasharray:"4 4"}),line.label?jsxs(Fragment,{children:[jsx(Rect,{x:Math.max(0,Math.min(px-chipWidth/2,plotWidth-chipWidth)),y:0,width:chipWidth,height:chipHeight,rx:theme.border.radius.medium,fill:referenceLabelFill,stroke:referenceLabelStroke,strokeWidth:1}),jsx(Text$1,{x:Math.max(0,Math.min(px-chipWidth/2,plotWidth-chipWidth))+chipWidth/2,y:chipHeight/2+TICK_FONT_SIZE/3,fontSize:TICK_FONT_SIZE,fontWeight:theme.typography.fonts.weight.medium,fill:referenceLabelTextColor,textAnchor:"middle",children:truncatedLabel})]}):null]},`refline-${idx}`);}),activeIndex!==undefined?jsx(Line,{x1:xAt(activeIndex),x2:xAt(activeIndex),y1:0,y2:plotHeight,stroke:cursorColor,strokeWidth:1}):null,slots.hasXAxis&&jsxs(Fragment,{children:[jsx(Line,{x1:0,x2:plotWidth,y1:plotHeight,y2:plotHeight,stroke:axisLineColor,strokeWidth:1}),data.map(function(row,i){var _xLabelLines$i;if(!visibleXTickIndexSet.has(i))return null;var cx=xAt(i);var lines=(_xLabelLines$i=xLabelLines[i])!=null?_xLabelLines$i:[''];var secondary=secondaryLabelMap==null?void 0:secondaryLabelMap[i];var primaryY=plotHeight+TICK_FONT_SIZE+4;var tickTextAnchor=i===0?'start':i===count-1?'end':'middle';var secondaryY=primaryY+(maxXLabelLines-1)*TICK_LINE_HEIGHT+SECONDARY_LABEL_FONT_SIZE+PRIMARY_TO_SECONDARY_GAP;return jsxs(G,{children:[lines.map(function(line,lineIndex){return jsx(Text$1,{x:cx,y:primaryY+lineIndex*TICK_LINE_HEIGHT,fontSize:TICK_FONT_SIZE,fill:tickColor,textAnchor:tickTextAnchor,children:line},`xtick-${i}-line-${lineIndex}`);}),secondary!==undefined&&secondary!==null?jsx(Text$1,{x:cx,y:secondaryY,fontSize:SECONDARY_LABEL_FONT_SIZE,fill:tickColor,textAnchor:tickTextAnchor,children:String(secondary)}):null]},`xtick-${i}`);})]}),slots.xLabel?jsx(Text$1,{x:plotWidth/2,y:plotHeight+padding.bottom-4,fontSize:AXIS_LABEL_FONT_SIZE,fill:tickColor,textAnchor:"middle",children:slots.xLabel}):null]})]}):null,slots.hasTooltip&&activeIndex!==undefined&&tooltipRows.length>0&&size.width>0?jsxs(View,{pointerEvents:"none",style:{position:'absolute',top:padding.top,left:tooltipLeft,width:TOOLTIP_WIDTH,backgroundColor:theme.colors.surface.icon.staticBlack.normal,borderRadius:theme.border.radius.large,borderWidth:theme.border.width.thin,borderColor:theme.colors.surface.border.gray.muted,paddingHorizontal:theme.spacing[3],paddingVertical:theme.spacing[3],shadowColor:'#000',shadowOpacity:0.24,shadowRadius:12,shadowOffset:{width:0,height:6},elevation:8},children:[activeLabel?jsx(Box,{paddingBottom:"spacing.2",children:jsx(Text,{size:"small",weight:"semibold",color:"surface.text.staticWhite.normal",children:activeLabel})}):null,tooltipRows.map(function(row){return jsxs(Box,{display:"flex",flexDirection:"row",alignItems:"center",paddingY:"spacing.1",children:[jsx(View,{style:{width:8,height:8,borderRadius:2,backgroundColor:row.color,marginRight:theme.spacing[2]}}),jsx(Box,{flex:1,children:jsx(Text,{size:"xsmall",color:"surface.text.staticWhite.normal",children:row.label})}),jsx(Text,{size:"xsmall",weight:"semibold",color:"surface.text.staticWhite.normal",children:row.displayValue})]},row.key);})]}):null]}),slots.legend.hasLegend&&legendAreas.length>0?jsx(View,{style:{flexDirection:slots.legend.layout==='vertical'?'column':'row',flexWrap:slots.legend.layout==='vertical'?'nowrap':'wrap',alignItems:slots.legend.layout==='vertical'?'flex-start':'center',justifyContent:slots.legend.align==='left'?'flex-start':slots.legend.align==='right'?'flex-end':'center',paddingTop:theme.spacing[2]},children:legendAreas.map(function(area){var _area$name2,_area$name3;var mappingEntry=dataColorMapping[area.dataKey];var swatchToken=mappingEntry!=null&&mappingEntry.isCustomColor?getHighestColorInRange({colorToken:mappingEntry.colorToken}):mappingEntry==null?void 0:mappingEntry.colorToken;var swatchColor=swatchToken?getIn(theme.colors,swatchToken):tickColor;var isSelected=selectedKeys.includes(area.dataKey);return jsxs(Pressable,Object.assign({onPress:function onPress(){return handleLegendToggle(area.dataKey);},accessibilityRole:"button",accessibilityLabel:`${(_area$name2=area.name)!=null?_area$name2:area.dataKey}, ${isSelected?'selected':'deselected'}`,style:{flexDirection:'row',alignItems:'center',marginHorizontal:theme.spacing[3],marginVertical:theme.spacing[1],opacity:isSelected?1:0.4}},metaAttribute({name:`chart-legend-item-${area.dataKey}`}),{children:[jsx(View,{style:{width:LEGEND_SWATCH_SIZE,height:LEGEND_SWATCH_SIZE,borderRadius:theme.border.radius['2xsmall'],backgroundColor:swatchColor,marginRight:theme.spacing[2]}}),jsx(Text,{size:"xsmall",color:"surface.text.gray.muted",textDecorationLine:isSelected?'none':'line-through',children:(_area$name3=area.name)!=null?_area$name3:area.dataKey})]}),`legend-${area.dataKey}`);})}):null]}))});};
|
|
40
41
|
|
|
41
42
|
export { ChartArea, ChartAreaWrapper };
|
|
42
43
|
//# sourceMappingURL=AreaChart.native.js.map
|