@razorpay/blade 12.111.0 → 12.120.0
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/_virtual/cloneDeep.js +1 -1
- package/build/lib/web/development/_virtual/cloneDeep3.js +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/node_modules/es-toolkit/dist/compat/object/cloneDeep.js +1 -1
- package/build/lib/web/development/node_modules/es-toolkit/dist/compat/predicate/matches.js +2 -2
- package/build/lib/web/development/node_modules/es-toolkit/dist/compat/predicate/matchesProperty.js +2 -2
- package/build/lib/web/development/node_modules/es-toolkit/dist/object/cloneDeep.js +1 -1
- package/build/lib/web/development/tokens/global/colors.js +2 -2
- package/build/lib/web/development/tokens/global/colors.js.map +1 -1
- package/build/lib/web/development/tokens/index.js +1 -0
- package/build/lib/web/development/tokens/index.js.map +1 -1
- package/build/lib/web/development/tokens/theme/bladeNeutralTheme.js +1439 -0
- package/build/lib/web/development/tokens/theme/bladeNeutralTheme.js.map +1 -0
- package/build/lib/web/development/tokens/theme/bladeTheme.js +48 -12
- package/build/lib/web/development/tokens/theme/bladeTheme.js.map +1 -1
- package/build/lib/web/development/tokens/theme/index.js +1 -0
- package/build/lib/web/development/tokens/theme/index.js.map +1 -1
- package/build/lib/web/development/tokens/theme/theme.js.map +1 -1
- package/build/lib/web/development/utils/componentZIndices.js +2 -0
- package/build/lib/web/development/utils/componentZIndices.js.map +1 -1
- package/build/lib/web/development/utils/metaAttribute/metaConstants.js +4 -0
- package/build/lib/web/development/utils/metaAttribute/metaConstants.js.map +1 -1
- package/build/lib/web/development/utils/useControlledDropdownInput/useControlledDropdownInput.js +12 -4
- package/build/lib/web/development/utils/useControlledDropdownInput/useControlledDropdownInput.js.map +1 -1
- package/build/lib/web/development/utils/useTruncationTitle/useTruncationTitle.web.js +2 -2
- package/build/lib/web/development/utils/useTruncationTitle/useTruncationTitle.web.js.map +1 -1
- package/build/lib/web/production/_virtual/flatten.js +1 -1
- package/build/lib/web/production/_virtual/flatten3.js +1 -1
- package/build/lib/web/production/components/Button/BaseButton/BaseButton.js +124 -73
- package/build/lib/web/production/components/Button/BaseButton/BaseButton.js.map +1 -1
- package/build/lib/web/production/components/Button/BaseButton/buttonTokens.js +68 -2
- package/build/lib/web/production/components/Button/BaseButton/buttonTokens.js.map +1 -1
- package/build/lib/web/production/components/Charts/AreaChart/AreaChart.web.js +206 -18
- package/build/lib/web/production/components/Charts/AreaChart/AreaChart.web.js.map +1 -1
- package/build/lib/web/production/components/Charts/CommonChartComponents/CommonChartComponents.web.js +159 -43
- package/build/lib/web/production/components/Charts/CommonChartComponents/CommonChartComponents.web.js.map +1 -1
- package/build/lib/web/production/components/Charts/CommonChartComponents/index.js +1 -1
- package/build/lib/web/production/components/Charts/CommonChartComponents/tokens.js +15 -2
- package/build/lib/web/production/components/Charts/CommonChartComponents/tokens.js.map +1 -1
- package/build/lib/web/production/components/Charts/LineChart/LineChart.web.js +272 -15
- package/build/lib/web/production/components/Charts/LineChart/LineChart.web.js.map +1 -1
- package/build/lib/web/production/components/Charts/LineChart/useReferenceBand.js +195 -0
- package/build/lib/web/production/components/Charts/LineChart/useReferenceBand.js.map +1 -0
- package/build/lib/web/production/components/Charts/utils/nullBridgeUtils.js +175 -0
- package/build/lib/web/production/components/Charts/utils/nullBridgeUtils.js.map +1 -0
- package/build/lib/web/production/components/Charts/utils/referenceBandUtils.js +66 -0
- package/build/lib/web/production/components/Charts/utils/referenceBandUtils.js.map +1 -0
- package/build/lib/web/production/components/CounterInput/CounterInput.web.js +29 -5
- package/build/lib/web/production/components/CounterInput/CounterInput.web.js.map +1 -1
- package/build/lib/web/production/components/CounterInput/StyledCounterInput.js +20 -4
- package/build/lib/web/production/components/CounterInput/StyledCounterInput.js.map +1 -1
- package/build/lib/web/production/components/CounterInput/token.js +6 -1
- package/build/lib/web/production/components/CounterInput/token.js.map +1 -1
- package/build/lib/web/production/components/DatePicker/BaseDatePicker.web.js +20 -0
- package/build/lib/web/production/components/DatePicker/BaseDatePicker.web.js.map +1 -1
- package/build/lib/web/production/components/DatePicker/Calendar.web.js +9 -2
- package/build/lib/web/production/components/DatePicker/Calendar.web.js.map +1 -1
- package/build/lib/web/production/components/DatePicker/utils.js +21 -1
- package/build/lib/web/production/components/DatePicker/utils.js.map +1 -1
- package/build/lib/web/production/components/Dropdown/Dropdown.js +4 -1
- package/build/lib/web/production/components/Dropdown/Dropdown.js.map +1 -1
- package/build/lib/web/production/components/Dropdown/FilterChipSelectInput.web.js +20 -12
- package/build/lib/web/production/components/Dropdown/FilterChipSelectInput.web.js.map +1 -1
- package/build/lib/web/production/components/Dropdown/dropdownUtils.js +28 -2
- package/build/lib/web/production/components/Dropdown/dropdownUtils.js.map +1 -1
- package/build/lib/web/production/components/Dropdown/filterChipSelectInputUtils.js +15 -1
- package/build/lib/web/production/components/Dropdown/filterChipSelectInputUtils.js.map +1 -1
- package/build/lib/web/production/components/Dropdown/useDropdown.js +91 -5
- package/build/lib/web/production/components/Dropdown/useDropdown.js.map +1 -1
- package/build/lib/web/production/components/FloatingActionButton/FloatingActionButton.js +126 -0
- package/build/lib/web/production/components/FloatingActionButton/FloatingActionButton.js.map +1 -0
- package/build/lib/web/production/components/FloatingActionButton/FloatingActionButtonContainer.web.js +45 -0
- package/build/lib/web/production/components/FloatingActionButton/FloatingActionButtonContainer.web.js.map +1 -0
- package/build/lib/web/production/components/FloatingActionButton/index.js +2 -0
- package/build/lib/web/production/components/FloatingActionButton/index.js.map +1 -0
- package/build/lib/web/production/components/GenUI/GenUIComponents.web.js.map +1 -1
- package/build/lib/web/production/components/GenUI/GenUIContext.web.js +9 -1
- package/build/lib/web/production/components/GenUI/GenUIContext.web.js.map +1 -1
- package/build/lib/web/production/components/GenUI/GenUIProvider.web.js +17 -0
- package/build/lib/web/production/components/GenUI/GenUIProvider.web.js.map +1 -1
- package/build/lib/web/production/components/GenUI/GenUISchemaRenderer.web.js +31 -6
- package/build/lib/web/production/components/GenUI/GenUISchemaRenderer.web.js.map +1 -1
- package/build/lib/web/production/components/GenUI/index.js +1 -1
- package/build/lib/web/production/components/Icons/BookmarkFilledIcon/BookmarkFilledIcon.js +44 -0
- package/build/lib/web/production/components/Icons/BookmarkFilledIcon/BookmarkFilledIcon.js.map +1 -0
- package/build/lib/web/production/components/Icons/BookmarkFilledIcon/index.js +2 -0
- package/build/lib/web/production/components/Icons/BookmarkFilledIcon/index.js.map +1 -0
- package/build/lib/web/production/components/Icons/index.js +1 -0
- package/build/lib/web/production/components/Icons/index.js.map +1 -1
- package/build/lib/web/production/components/Input/OTPInput/OTPInput.js +3 -0
- package/build/lib/web/production/components/Input/OTPInput/OTPInput.js.map +1 -1
- package/build/lib/web/production/components/PopupArrow/PopupArrow.web.js +7 -1
- package/build/lib/web/production/components/PopupArrow/PopupArrow.web.js.map +1 -1
- package/build/lib/web/production/components/RollingText/RollingText.web.js +27 -20
- package/build/lib/web/production/components/RollingText/RollingText.web.js.map +1 -1
- package/build/lib/web/production/components/Spark/RzpGlass/RzpGlass.js +16 -7
- package/build/lib/web/production/components/Spark/RzpGlass/RzpGlass.js.map +1 -1
- package/build/lib/web/production/components/Spark/RzpGlass/RzpGlassMount.js +24 -6
- package/build/lib/web/production/components/Spark/RzpGlass/RzpGlassMount.js.map +1 -1
- package/build/lib/web/production/components/Spark/RzpGlass/presets.js +30 -1
- package/build/lib/web/production/components/Spark/RzpGlass/presets.js.map +1 -1
- package/build/lib/web/production/components/Spark/RzpGlass/rzpGlassShader.js +1 -1
- package/build/lib/web/production/components/Spark/RzpGlass/rzpGlassShader.js.map +1 -1
- package/build/lib/web/production/components/Spark/RzpGlass/utils.js +26 -10
- package/build/lib/web/production/components/Spark/RzpGlass/utils.js.map +1 -1
- package/build/lib/web/production/components/SpotlightPopoverTour/Tour.web.js +31 -18
- package/build/lib/web/production/components/SpotlightPopoverTour/Tour.web.js.map +1 -1
- package/build/lib/web/production/components/SpotlightPopoverTour/TourMask.web.js +14 -3
- package/build/lib/web/production/components/SpotlightPopoverTour/TourMask.web.js.map +1 -1
- package/build/lib/web/production/components/SpotlightPopoverTour/TourPopover.web.js +23 -4
- package/build/lib/web/production/components/SpotlightPopoverTour/TourPopover.web.js.map +1 -1
- package/build/lib/web/production/components/SpotlightPopoverTour/utils.js +58 -1
- package/build/lib/web/production/components/SpotlightPopoverTour/utils.js.map +1 -1
- package/build/lib/web/production/components/TreeView/StyledTreeViewRow.web.js +41 -0
- package/build/lib/web/production/components/TreeView/StyledTreeViewRow.web.js.map +1 -0
- package/build/lib/web/production/components/TreeView/TreeView.web.js +696 -0
- package/build/lib/web/production/components/TreeView/TreeView.web.js.map +1 -0
- package/build/lib/web/production/components/TreeView/TreeViewAnimator.web.js +184 -0
- package/build/lib/web/production/components/TreeView/TreeViewAnimator.web.js.map +1 -0
- package/build/lib/web/production/components/TreeView/TreeViewChevron.web.js +73 -0
- package/build/lib/web/production/components/TreeView/TreeViewChevron.web.js.map +1 -0
- package/build/lib/web/production/components/TreeView/TreeViewItem.web.js +295 -0
- package/build/lib/web/production/components/TreeView/TreeViewItem.web.js.map +1 -0
- package/build/lib/web/production/components/TreeView/TreeViewLoadMore.web.js +173 -0
- package/build/lib/web/production/components/TreeView/TreeViewLoadMore.web.js.map +1 -0
- package/build/lib/web/production/components/TreeView/componentIds.js +8 -0
- package/build/lib/web/production/components/TreeView/componentIds.js.map +1 -0
- package/build/lib/web/production/components/TreeView/index.web.js +4 -0
- package/build/lib/web/production/components/TreeView/index.web.js.map +1 -0
- package/build/lib/web/production/components/TreeView/treeViewUtils.js +475 -0
- package/build/lib/web/production/components/TreeView/treeViewUtils.js.map +1 -0
- package/build/lib/web/production/components/TreeView/useTreeView.js +24 -0
- package/build/lib/web/production/components/TreeView/useTreeView.js.map +1 -0
- package/build/lib/web/production/components/index.js +9 -2
- package/build/lib/web/production/components/index.js.map +1 -1
- package/build/lib/web/production/node_modules/es-toolkit/dist/array/flatten.js +1 -1
- package/build/lib/web/production/node_modules/es-toolkit/dist/compat/array/flatten.js +1 -1
- package/build/lib/web/production/node_modules/es-toolkit/dist/compat/array/sortBy.js +2 -2
- package/build/lib/web/production/node_modules/es-toolkit/dist/compat/object/omit.js +2 -2
- package/build/lib/web/production/tokens/global/colors.js +2 -2
- package/build/lib/web/production/tokens/global/colors.js.map +1 -1
- package/build/lib/web/production/tokens/index.js +1 -0
- package/build/lib/web/production/tokens/index.js.map +1 -1
- package/build/lib/web/production/tokens/theme/bladeNeutralTheme.js +1439 -0
- package/build/lib/web/production/tokens/theme/bladeNeutralTheme.js.map +1 -0
- package/build/lib/web/production/tokens/theme/bladeTheme.js +48 -12
- package/build/lib/web/production/tokens/theme/bladeTheme.js.map +1 -1
- package/build/lib/web/production/tokens/theme/index.js +1 -0
- package/build/lib/web/production/tokens/theme/index.js.map +1 -1
- package/build/lib/web/production/tokens/theme/theme.js.map +1 -1
- package/build/lib/web/production/utils/componentZIndices.js +2 -0
- package/build/lib/web/production/utils/componentZIndices.js.map +1 -1
- package/build/lib/web/production/utils/metaAttribute/metaConstants.js +4 -0
- package/build/lib/web/production/utils/metaAttribute/metaConstants.js.map +1 -1
- package/build/lib/web/production/utils/useControlledDropdownInput/useControlledDropdownInput.js +12 -4
- package/build/lib/web/production/utils/useControlledDropdownInput/useControlledDropdownInput.js.map +1 -1
- package/build/lib/web/production/utils/useTruncationTitle/useTruncationTitle.web.js +2 -2
- package/build/lib/web/production/utils/useTruncationTitle/useTruncationTitle.web.js.map +1 -1
- package/build/types/components/index.d.ts +557 -18
- package/build/types/components/index.native.d.ts +463 -16
- package/build/types/tokens/index.d.ts +11 -4
- package/build/types/tokens/index.native.d.ts +11 -4
- package/build/types/utils/index.d.ts +8 -3
- package/build/types/utils/index.native.d.ts +8 -3
- package/package.json +2 -2
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
var monotoneInterpolate=function monotoneInterpolate(xs,ys,xq){var n=xs.length;if(n===0)return 0;if(n===1)return ys[0];var slope=[];for(var i=0;i<n-1;i++){var dx=xs[i+1]-xs[i];slope[i]=dx===0?0:(ys[i+1]-ys[i])/dx;}var tangent=new Array(n);tangent[0]=slope[0];tangent[n-1]=slope[n-2];for(var _i=1;_i<n-1;_i++){var m1=slope[_i-1];var m2=slope[_i];if(m1*m2<=0){tangent[_i]=0;}else {var dx1=xs[_i]-xs[_i-1];var dx2=xs[_i+1]-xs[_i];var common=dx1+dx2;tangent[_i]=3*common/((common+dx2)/m1+(common+dx1)/m2);}}var k=0;while(k<n-2&&xq>xs[k+1])k++;var h=xs[k+1]-xs[k];var t=h===0?0:(xq-xs[k])/h;var t2=t*t;var t3=t2*t;var h00=2*t3-3*t2+1;var h10=t3-2*t2+t;var h01=-2*t3+3*t2;var h11=t3-t2;return h00*ys[k]+h10*h*tangent[k]+h01*ys[k+1]+h11*h*tangent[k+1];};var resolveDataKeyValue=function resolveDataKeyValue(row,dataKey){var path=String(dataKey);if(!path)return undefined;return path.split('.').reduce(function(accumulator,key){if(accumulator&&typeof accumulator==='object'){return accumulator[key];}return undefined;},row);};var getDefinedNumericPoints=function getDefinedNumericPoints(data,dataKey){var indices=[];var values=[];data.forEach(function(row,index){var raw=resolveDataKeyValue(row,dataKey);var numeric=raw===null||raw===undefined?null:Number(raw);if(numeric!==null&&!Number.isNaN(numeric)){indices.push(index);values.push(numeric);}});return {indices:indices,values:values};};var getInteriorGaps=function getInteriorGaps(indices){var gaps=[];for(var i=0;i<indices.length-1;i++){if(indices[i+1]-indices[i]>1){gaps.push({from:i,to:i+1});}}return gaps;};var buildBridgePathData=function buildBridgePathData(anchors,from,to){var xs=anchors.map(function(point){return point.x;});var ys=anchors.map(function(point){return point.y;});var start=anchors[from];var end=anchors[to];var sampleCount=Math.max(2,Math.round(Math.abs(end.x-start.x)/3));var pathData='';for(var step=0;step<=sampleCount;step++){var t=step/sampleCount;var x=start.x+(end.x-start.x)*t;var y=monotoneInterpolate(xs,ys,x);pathData+=`${step===0?'M':'L'}${x},${y} `;}return pathData.trim();};var parsePathAnchors=function parsePathAnchors(pathData){var anchors=[];var commandPattern=/([MLC])([^MLC]*)/g;var match=commandPattern.exec(pathData);while(match!==null){var _match$2$match;var command=match[1];var numbers=((_match$2$match=match[2].match(/-?[\d.]+(?:e-?\d+)?/g))!=null?_match$2$match:[]).map(Number);if(command==='M'||command==='L'){if(numbers.length>=2)anchors.push({x:numbers[0],y:numbers[1]});}else if(command==='C'){if(numbers.length>=6)anchors.push({x:numbers[4],y:numbers[5]});}match=commandPattern.exec(pathData);}return anchors;};
|
|
2
|
+
|
|
3
|
+
export { buildBridgePathData, getDefinedNumericPoints, getInteriorGaps, monotoneInterpolate, parsePathAnchors, resolveDataKeyValue };
|
|
4
|
+
//# sourceMappingURL=nullBridgeUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nullBridgeUtils.js","sources":["../../../../../../src/components/Charts/utils/nullBridgeUtils.ts"],"sourcesContent":["// A dataKey can be a string (possibly dot-nested, e.g. `metrics.sales`), a number,\n// or a function — but the bridge utilities only handle the string/number form, which\n// is what Recharts' path rendering uses. Keeping this local avoids coupling the shared\n// utility to any specific chart component's types.\ntype DataKey = string | number | ((row: Record<string, unknown>) => unknown);\n\n/**\n * Monotone cubic interpolation using a weighted-harmonic tangent formula\n * (`3(dx₁+dx₂) / ((dx₁+2dx₂)/m₁ + (2dx₁+dx₂)/m₂)`). Given the defined points\n * `(xs[i], ys[i])` (xs ascending), it returns the interpolated `y` at `xq`. Used to densely\n * sample the null-bridge onto the real curve so the dashed bridge follows a monotone curve\n * across the gap instead of a straight chord.\n *\n * **Note on curve parity:** this shares its formula with `buildMonotonePath` (native\n * LineChart), so on native LineChart the bridge follows the same curve as the solid line.\n * It is *not* pixel-identical to d3-shape's `curveMonotoneX` (Steffen `slope3`, which Recharts\n * uses on web) nor to `buildMonotone` (native AreaChart, arithmetic-mean + Fritsch–Carlson\n * clip). The bridge endpoints always coincide with the solid anchors, so junctions are\n * continuous; only the interior curvature of the dashed span can differ slightly on web and\n * native AreaChart. Unifying all renderers on d3 `curveMonotoneX` is tracked as a follow-up.\n */\nconst monotoneInterpolate = (xs: number[], ys: number[], xq: number): number => {\n const n = xs.length;\n if (n === 0) return 0;\n if (n === 1) return ys[0];\n\n const slope: number[] = [];\n for (let i = 0; i < n - 1; i++) {\n const dx = xs[i + 1] - xs[i];\n slope[i] = dx === 0 ? 0 : (ys[i + 1] - ys[i]) / dx;\n }\n\n // Tangents at each point — weighted-harmonic formula, matching buildMonotonePath (native\n // LineChart) so the dashed bridge follows the same curve as the solid line on that renderer.\n // (Close to, but not pixel-identical to, d3's curveMonotoneX / Recharts on web.)\n const tangent: number[] = new Array(n);\n tangent[0] = slope[0];\n tangent[n - 1] = slope[n - 2];\n for (let i = 1; i < n - 1; i++) {\n const m1 = slope[i - 1];\n const m2 = slope[i];\n if (m1 * m2 <= 0) {\n tangent[i] = 0;\n } else {\n const dx1 = xs[i] - xs[i - 1];\n const dx2 = xs[i + 1] - xs[i];\n const common = dx1 + dx2;\n tangent[i] = (3 * common) / ((common + dx2) / m1 + (common + dx1) / m2);\n }\n }\n\n // Locate the interval containing xq and evaluate the Hermite basis.\n let k = 0;\n while (k < n - 2 && xq > xs[k + 1]) k++;\n const h = xs[k + 1] - xs[k];\n const t = h === 0 ? 0 : (xq - xs[k]) / h;\n const t2 = t * t;\n const t3 = t2 * t;\n const h00 = 2 * t3 - 3 * t2 + 1;\n const h10 = t3 - 2 * t2 + t;\n const h01 = -2 * t3 + 3 * t2;\n const h11 = t3 - t2;\n\n return h00 * ys[k] + h10 * h * tangent[k] + h01 * ys[k + 1] + h11 * h * tangent[k + 1];\n};\n\n// Resolve a (possibly nested, e.g. `metrics.sales`) dataKey from a data row.\nconst resolveDataKeyValue = (row: Record<string, unknown>, dataKey: DataKey): unknown => {\n const path = String(dataKey);\n if (!path) return undefined;\n return path.split('.').reduce<unknown>((accumulator, key) => {\n if (accumulator && typeof accumulator === 'object') {\n return (accumulator as Record<string, unknown>)[key];\n }\n return undefined;\n }, row);\n};\n\ntype DefinedPoints = { indices: number[]; values: number[] };\n\n// Extract the indices + numeric values of the non-null points for a dataKey.\nconst getDefinedNumericPoints = (\n data: Array<Record<string, unknown>>,\n dataKey: DataKey,\n): DefinedPoints => {\n const indices: number[] = [];\n const values: number[] = [];\n data.forEach((row, index) => {\n const raw = resolveDataKeyValue(row, dataKey);\n const numeric = raw === null || raw === undefined ? null : Number(raw);\n if (numeric !== null && !Number.isNaN(numeric)) {\n indices.push(index);\n values.push(numeric);\n }\n });\n return { indices, values };\n};\n\n// Positions (into the defined-points array) of adjacent defined points that have at least one null\n// point between them, i.e. an interior gap that a null-bridge should span.\nconst getInteriorGaps = (indices: number[]): Array<{ from: number; to: number }> => {\n const gaps: Array<{ from: number; to: number }> = [];\n for (let i = 0; i < indices.length - 1; i++) {\n if (indices[i + 1] - indices[i] > 1) {\n gaps.push({ from: i, to: i + 1 });\n }\n }\n return gaps;\n};\n\n/**\n * Build a dashed null-bridge `d` path (dense polyline) across a single interior gap, sampling the\n * monotone spline through the line's defined anchor points (in pixel space) so the bridge follows\n * the same curve Recharts draws for a solid connect instead of a straight chord.\n */\nconst buildBridgePathData = (anchors: PixelPoint[], from: number, to: number): string => {\n const xs = anchors.map((point) => point.x);\n const ys = anchors.map((point) => point.y);\n const start = anchors[from];\n const end = anchors[to];\n const sampleCount = Math.max(2, Math.round(Math.abs(end.x - start.x) / 3));\n let pathData = '';\n for (let step = 0; step <= sampleCount; step++) {\n const t = step / sampleCount;\n const x = start.x + (end.x - start.x) * t;\n const y = monotoneInterpolate(xs, ys, x);\n pathData += `${step === 0 ? 'M' : 'L'}${x},${y} `;\n }\n return pathData.trim();\n};\n\ntype PixelPoint = { x: number; y: number };\n\n/**\n * Parse the anchor (data) points out of an SVG path `d` string as rendered by Recharts for a line.\n * Handles `M`/`L` (linear) and `C` (monotone/natural cubic) commands — for a cubic the anchor is the\n * final control pair. Restart commands (`M`, from a gapped/`connectNulls={false}` line) contribute\n * their point too, so the result is the ordered list of the line's *defined* data points in pixel\n * space. Used to derive the null-bridge geometry from Recharts' own computed coordinates.\n *\n * **Limitation:** This parser only handles `M`, `L`, and `C` SVG commands. For step-type curves\n * (`type=\"step\"`, `\"stepBefore\"`, `\"stepAfter\"`), d3-shape generates extra `L` commands for\n * intermediate step points (e.g. `curveStepAfter` produces 2n-1 `L`/`M` commands for n defined\n * data points). The anchor count will not match the defined data point count, so the\n * `anchors.length !== indices.length` guard in the calling code will bail out and the dashed\n * bridge will not render. `connectNullsStyle=\"dashed\"` is therefore only supported for\n * `type=\"monotone\"` and `type=\"linear\"`. For step-type lines, use `connectNullsStyle=\"solid\"`\n * (which uses Recharts' native `connectNulls` and is unaffected by this limitation).\n */\nconst parsePathAnchors = (pathData: string): PixelPoint[] => {\n const anchors: PixelPoint[] = [];\n const commandPattern = /([MLC])([^MLC]*)/g;\n let match: RegExpExecArray | null = commandPattern.exec(pathData);\n while (match !== null) {\n const command = match[1];\n const numbers = (match[2].match(/-?[\\d.]+(?:e-?\\d+)?/g) ?? []).map(Number);\n if (command === 'M' || command === 'L') {\n if (numbers.length >= 2) anchors.push({ x: numbers[0], y: numbers[1] });\n } else if (command === 'C') {\n if (numbers.length >= 6) anchors.push({ x: numbers[4], y: numbers[5] });\n }\n match = commandPattern.exec(pathData);\n }\n return anchors;\n};\n\nexport {\n monotoneInterpolate,\n resolveDataKeyValue,\n getDefinedNumericPoints,\n getInteriorGaps,\n parsePathAnchors,\n buildBridgePathData,\n};\nexport type { DefinedPoints, PixelPoint, DataKey };\n"],"names":["monotoneInterpolate","xs","ys","xq","n","length","slope","i","dx","tangent","Array","m1","m2","dx1","dx2","common","k","h","t","t2","t3","h00","h10","h01","h11","resolveDataKeyValue","row","dataKey","path","String","undefined","split","reduce","accumulator","key","getDefinedNumericPoints","data","indices","values","forEach","index","raw","numeric","Number","isNaN","push","getInteriorGaps","gaps","from","to","buildBridgePathData","anchors","map","point","x","y","start","end","sampleCount","Math","max","round","abs","pathData","step","trim","parsePathAnchors","commandPattern","match","exec","_match$2$match","command","numbers"],"mappings":"AAqBM,IAAAA,mBAAmB,CAAG,SAAtBA,mBAAmBA,CAAIC,EAAY,CAAEC,EAAY,CAAEC,EAAU,CAAa,CAC9E,IAAMC,CAAC,CAAGH,EAAE,CAACI,MAAM,CACnB,GAAID,CAAC,GAAK,CAAC,CAAE,QAAQ,CACrB,GAAIA,CAAC,GAAK,CAAC,CAAE,OAAOF,EAAE,CAAC,CAAC,CAAC,CAEzB,IAAMI,KAAe,CAAG,EAAE,CAC1B,IAAK,IAAIC,CAAC,CAAG,CAAC,CAAEA,CAAC,CAAGH,CAAC,CAAG,CAAC,CAAEG,CAAC,EAAE,CAAE,CAC9B,IAAMC,EAAE,CAAGP,EAAE,CAACM,CAAC,CAAG,CAAC,CAAC,CAAGN,EAAE,CAACM,CAAC,CAAC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AAG,EAAE,CAChC,IAAMgB,cAAc,CAAG,mBAAmB,CAC1C,IAAIC,KAA6B,CAAGD,cAAc,CAACE,IAAI,CAACN,QAAQ,CAAC,CACjE,MAAOK,KAAK,GAAK,IAAI,CAAE,CAAAE,IAAAA,cAAA,CACrB,IAAMC,OAAO,CAAGH,KAAK,CAAC,CAAC,CAAC,CACxB,IAAMI,OAAO,CAAG,CAAA,CAAAF,cAAA,CAACF,KAAK,CAAC,CAAC,CAAC,CAACA,KAAK,CAAC,sBAAsB,CAAC,GAAA,IAAA,CAAAE,cAAA,CAAI,EAAE,EAAElB,GAAG,CAACT,MAAM,CAAC,CAC1E,GAAI4B,OAAO,GAAK,GAAG,EAAIA,OAAO,GAAK,GAAG,CAAE,CACtC,GAAIC,OAAO,CAACnE,MAAM,EAAI,CAAC,CAAE8C,OAAO,CAACN,IAAI,CAAC,CAAES,CAAC,CAAEkB,OAAO,CAAC,CAAC,CAAC,CAAEjB,CAAC,CAAEiB,OAAO,CAAC,CAAC,CAAE,CAAC,CAAC,CACzE,CAAC,KAAM,GAAID,OAAO,GAAK,GAAG,CAAE,CAC1B,GAAIC,OAAO,CAACnE,MAAM,EAAI,CAAC,CAAE8C,OAAO,CAACN,IAAI,CAAC,CAAES,CAAC,CAAEkB,OAAO,CAAC,CAAC,CAAC,CAAEjB,CAAC,CAAEiB,OAAO,CAAC,CAAC,CAAE,CAAC,CAAC,CACzE,CACAJ,KAAK,CAAGD,cAAc,CAACE,IAAI,CAACN,QAAQ,CAAC,CACvC,CACA,OAAOZ,OAAO,CAChB;;;;"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { monotoneInterpolate } from './nullBridgeUtils.js';
|
|
2
|
+
|
|
3
|
+
var buildBandAreaPath=function buildBandAreaPath(upper,lower){if(upper.length<2||lower.length<2)return '';var upperXs=upper.map(function(point){return point.x;});var upperYs=upper.map(function(point){return point.y;});var lowerXs=lower.map(function(point){return point.x;});var lowerYs=lower.map(function(point){return point.y;});var startX=upper[0].x;var endX=upper[upper.length-1].x;var sampleCount=Math.max(2,Math.round(Math.abs(endX-startX)/3));var pathData='';for(var step=0;step<=sampleCount;step++){var t=step/sampleCount;var x=startX+(endX-startX)*t;var y=monotoneInterpolate(upperXs,upperYs,x);pathData+=`${step===0?'M':'L'}${x},${y} `;}for(var _step=sampleCount;_step>=0;_step--){var _t=_step/sampleCount;var _x=startX+(endX-startX)*_t;var _y=monotoneInterpolate(lowerXs,lowerYs,_x);pathData+=`L${_x},${_y} `;}pathData+='Z';return pathData.trim();};var sanitizeBandKey=function sanitizeBandKey(dataKey){return dataKey.replace(/[^a-zA-Z0-9_-]/g,'-');};var perLineBandClass=function perLineBandClass(dataKey,edge){return `blade-reference-band-${sanitizeBandKey(dataKey)}-${edge}`;};
|
|
4
|
+
|
|
5
|
+
export { buildBandAreaPath, perLineBandClass, sanitizeBandKey };
|
|
6
|
+
//# sourceMappingURL=referenceBandUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"referenceBandUtils.js","sources":["../../../../../../src/components/Charts/utils/referenceBandUtils.ts"],"sourcesContent":["import { monotoneInterpolate } from './nullBridgeUtils';\nimport type { PixelPoint } from './nullBridgeUtils';\n\n/**\n * Build a closed SVG `d` path for a reference band, given the upper and lower bound points in\n * pixel space (both ordered left→right, x ascending). The top edge is sampled left→right and the\n * bottom edge right→left along the monotone spline through each bound's anchors, so the band's\n * edges follow the same curve the trend line does instead of straight chords, then closed with `Z`.\n *\n * Shared by web (anchors parsed from Recharts' rendered bound curves via `parsePathAnchors`) and\n * native (points computed directly from the chart scales), so the band geometry matches on both.\n */\nconst buildBandAreaPath = (upper: PixelPoint[], lower: PixelPoint[]): string => {\n if (upper.length < 2 || lower.length < 2) return '';\n\n const upperXs = upper.map((point) => point.x);\n const upperYs = upper.map((point) => point.y);\n const lowerXs = lower.map((point) => point.x);\n const lowerYs = lower.map((point) => point.y);\n\n const startX = upper[0].x;\n const endX = upper[upper.length - 1].x;\n const sampleCount = Math.max(2, Math.round(Math.abs(endX - startX) / 3));\n\n let pathData = '';\n // Top edge: left → right along the upper bound.\n for (let step = 0; step <= sampleCount; step++) {\n const t = step / sampleCount;\n const x = startX + (endX - startX) * t;\n const y = monotoneInterpolate(upperXs, upperYs, x);\n pathData += `${step === 0 ? 'M' : 'L'}${x},${y} `;\n }\n // Bottom edge: right → left along the lower bound, then close.\n for (let step = sampleCount; step >= 0; step--) {\n const t = step / sampleCount;\n const x = startX + (endX - startX) * t;\n const y = monotoneInterpolate(lowerXs, lowerYs, x);\n pathData += `L${x},${y} `;\n }\n pathData += 'Z';\n return pathData.trim();\n};\n\n/**\n * Sanitize a dataKey into a CSS-class-safe token (nested keys like `metrics.sales` contain dots,\n * which are invalid in a single className). Shared by the ChartLine bound-line renderer and the\n * reference-band hook so both derive the same className for a given line.\n */\nconst sanitizeBandKey = (dataKey: string): string => dataKey.replace(/[^a-zA-Z0-9_-]/g, '-');\n\n/**\n * className applied to a per-line band's invisible lower/upper bound line, so the reference-band\n * hook can locate the rendered curve in the SVG. Kept in sync between the renderer and the reader.\n */\nconst perLineBandClass = (dataKey: string, edge: 'lower' | 'upper'): string =>\n `blade-reference-band-${sanitizeBandKey(dataKey)}-${edge}`;\n\nexport { buildBandAreaPath, sanitizeBandKey, perLineBandClass };\n"],"names":["buildBandAreaPath","upper","lower","length","upperXs","map","point","x","upperYs","y","lowerXs","lowerYs","startX","endX","sampleCount","Math","max","round","abs","pathData","step","t","monotoneInterpolate","trim","sanitizeBandKey","dataKey","replace","perLineBandClass","edge"],"mappings":";;AAYM,IAAAA,iBAAiB,CAAG,SAApBA,iBAAiBA,CAAIC,KAAmB,CAAEC,KAAmB,CAAa,CAC9E,GAAID,KAAK,CAACE,MAAM,CAAG,CAAC,EAAID,KAAK,CAACC,MAAM,CAAG,CAAC,CAAE,OAAO,EAAE,CAEnD,IAAMC,OAAO,CAAGH,KAAK,CAACI,GAAG,CAAC,SAACC,KAAK,CAAK,CAAA,OAAAA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AAI,EAAE,CAAE,CAC9C,IAAMC,EAAC,CAAGD,KAAI,CAAGN,WAAW,CAC5B,IAAMP,EAAC,CAAGK,MAAM,CAAG,CAACC,IAAI,CAAGD,MAAM,EAAIS,EAAC,CACtC,IAAMZ,EAAC,CAAGa,mBAAmB,CAACZ,OAAO,CAAEC,OAAO,CAAEJ,EAAC,CAAC,CAClDY,QAAQ,EAAI,IAAIZ,EAAC,CAAA,CAAA,EAAIE,EAAC,CAAA,CAAA,CAAG,CAC3B,CACAU,QAAQ,EAAI,GAAG,CACf,OAAOA,QAAQ,CAACI,IAAI,EAAE,CACxB,EAOM,IAAAC,eAAe,CAAG,SAAlBA,eAAeA,CAAIC,OAAe,SAAaA,OAAO,CAACC,OAAO,CAAC,iBAAiB,CAAE,GAAG,CAAC,CAAA,EAMtF,IAAAC,gBAAgB,CAAG,SAAnBA,gBAAgBA,CAAIF,OAAe,CAAEG,IAAuB,SAChE,CAAwBJ,qBAAAA,EAAAA,eAAe,CAACC,OAAO,CAAC,CAAIG,CAAAA,EAAAA,IAAI,EAAE,CAE5D;;;;"}
|
|
@@ -3,13 +3,14 @@ import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProper
|
|
|
3
3
|
import React__default, { useRef, useEffect, useCallback } from 'react';
|
|
4
4
|
import { StyleSheet, Pressable, TextInput } from 'react-native';
|
|
5
5
|
import Animated, { useSharedValue, withTiming, Easing, useAnimatedStyle } from 'react-native-reanimated';
|
|
6
|
-
import { COUNTER_INPUT_TOKEN, COUNTER_INPUT_ICON_SIZE_MAP } from './token.js';
|
|
6
|
+
import { COUNTER_INPUT_TOKEN, COUNTER_INPUT_SIZE_TO_TEXT_SIZE, COUNTER_INPUT_ICON_SIZE_MAP } from './token.js';
|
|
7
7
|
import { CounterInputProvider } from './CounterInputContext.js';
|
|
8
8
|
import '../../utils/metaAttribute/index.js';
|
|
9
9
|
import '../Box/styledProps/index.js';
|
|
10
10
|
import '../../utils/assignWithoutSideEffects/index.js';
|
|
11
11
|
import '../../utils/makeAnalyticsAttribute/index.js';
|
|
12
12
|
import { useControllableState } from '../../utils/useControllable.js';
|
|
13
|
+
import { baseInputCounterInputPaddingTokens } from '../Input/BaseInput/baseInputTokens.js';
|
|
13
14
|
import '../Box/BaseBox/index.js';
|
|
14
15
|
import '../Form/index.js';
|
|
15
16
|
import { useId } from '../../utils/useId.js';
|
|
@@ -31,7 +32,7 @@ import PlusIcon from '../Icons/PlusIcon/PlusIcon.js';
|
|
|
31
32
|
import { ProgressBar } from '../ProgressBar/ProgressBar.js';
|
|
32
33
|
import { assignWithoutSideEffects } from '../../utils/assignWithoutSideEffects/assignWithoutSideEffects.js';
|
|
33
34
|
|
|
34
|
-
var _excluded=["label","accessibilityLabel","labelPosition","name","value","defaultValue","min","max","emphasis","size","isLoading","isDisabled","onChange","onFocus","onBlur","testID"];var _this=undefined,_jsxFileName="/home/runner/work/blade/blade/packages/blade/src/components/CounterInput/CounterInput.native.tsx";var
|
|
35
|
+
var _excluded=["label","accessibilityLabel","labelPosition","name","value","defaultValue","min","max","emphasis","size","isLoading","isDisabled","onChange","onFocus","onBlur","testID"];var _this=undefined,_jsxFileName="/home/runner/work/blade/blade/packages/blade/src/components/CounterInput/CounterInput.native.tsx";var COUNTER_INPUT_NATIVE_DIGIT_WIDTH_RATIO=0.6;var getButtonStyle=function getButtonStyle(type,size){var _COUNTER_INPUT_TOKEN$;var iconPadding=(_COUNTER_INPUT_TOKEN$=COUNTER_INPUT_TOKEN.iconPadding[size])!=null?_COUNTER_INPUT_TOKEN$:COUNTER_INPUT_TOKEN.iconPadding.xsmall;var margin=type==='decrement'?COUNTER_INPUT_TOKEN.decrementIconMargin:COUNTER_INPUT_TOKEN.incrementIconMargin;return {padding:iconPadding,marginTop:margin[0],marginRight:margin[1],marginBottom:margin[2],marginLeft:margin[3],borderRadius:COUNTER_INPUT_TOKEN.buttonBorderRadius[size in COUNTER_INPUT_TOKEN.buttonBorderRadius?size:'xsmall']};};var _CounterInput=React__default.forwardRef(function(_ref,ref){var _internalValue$toStri;var label=_ref.label,accessibilityLabel=_ref.accessibilityLabel,_ref$labelPosition=_ref.labelPosition,labelPosition=_ref$labelPosition===void 0?'top':_ref$labelPosition,name=_ref.name,value=_ref.value,defaultValue=_ref.defaultValue,_ref$min=_ref.min,min=_ref$min===void 0?0:_ref$min,max=_ref.max,_ref$emphasis=_ref.emphasis,emphasis=_ref$emphasis===void 0?'subtle':_ref$emphasis,_ref$size=_ref.size,size=_ref$size===void 0?'medium':_ref$size,_ref$isLoading=_ref.isLoading,isLoading=_ref$isLoading===void 0?false:_ref$isLoading,_ref$isDisabled=_ref.isDisabled,isDisabled=_ref$isDisabled===void 0?false:_ref$isDisabled,_onChange=_ref.onChange,_onFocus=_ref.onFocus,_onBlur=_ref.onBlur,testID=_ref.testID,rest=_objectWithoutProperties(_ref,_excluded);var _useControllableState=useControllableState({value:value,defaultValue:defaultValue,onChange:function onChange(newValue){return _onChange==null?void 0:_onChange({value:newValue});}}),_useControllableState2=_slicedToArray(_useControllableState,2),internalValue=_useControllableState2[0],setInternalValue=_useControllableState2[1];var translateY=useSharedValue(0);var opacity=useSharedValue(1);var lastActionRef=useRef(null);var previousValueRef=useRef(internalValue);var labelId=useId('counter-input-label');var _useTheme=useTheme(),theme=_useTheme.theme;var emphasisTokens=COUNTER_INPUT_TOKEN.emphasis[emphasis];var _isDisabled=isDisabled||isLoading;var duration=theme.motion.duration.quick;useEffect(function(){if(lastActionRef.current&&internalValue!==previousValueRef.current){var startY=lastActionRef.current==='increment'?8:-8;translateY.value=startY;opacity.value=0;translateY.value=withTiming(0,{duration:duration,easing:Easing.out(Easing.ease)});opacity.value=withTiming(1,{duration:duration,easing:Easing.out(Easing.ease)});lastActionRef.current=null;}previousValueRef.current=internalValue;},[internalValue,duration]);var animatedStyle=useAnimatedStyle(function(){return {transform:[{translateY:translateY.value}],opacity:opacity.value};});var handleInputChange=useCallback(function(text){var numericValue=text?parseInt(text,10):min;var validValue=isNaN(numericValue)?min:numericValue;var constrainedValue=validValue;if(constrainedValue<min)constrainedValue=min;if(max!==undefined&&constrainedValue>max)constrainedValue=max;setInternalValue(function(){return constrainedValue;});},[min,max,setInternalValue]);var handleIncrement=useCallback(function(){if(_isDisabled)return;lastActionRef.current='increment';var newValue=(internalValue!=null?internalValue:min)+1;var constrainedValue=max!==undefined?Math.min(newValue,max):newValue;setInternalValue(function(){return constrainedValue;});},[internalValue,min,max,_isDisabled,setInternalValue]);var handleDecrement=useCallback(function(){if(_isDisabled)return;lastActionRef.current='decrement';var newValue=(internalValue!=null?internalValue:min)-1;var constrainedValue=Math.max(newValue,min);setInternalValue(function(){return constrainedValue;});},[internalValue,min,_isDisabled,setInternalValue]);var isDecrementDisabled=_isDisabled||(internalValue!=null?internalValue:min)<=min;var isIncrementDisabled=_isDisabled||max!==undefined&&(internalValue!=null?internalValue:min)>=max;var valueColor=getIn(theme.colors,_isDisabled?emphasisTokens.disabledColor:emphasisTokens.color,'');var _getTextProps=getTextProps({variant:'body',size:COUNTER_INPUT_SIZE_TO_TEXT_SIZE[size],weight:'semibold'}),_getTextProps$fontSiz=_getTextProps.fontSize,fontSizeToken=_getTextProps$fontSiz===void 0?100:_getTextProps$fontSiz;var fontSize=theme.typography.fonts.size[fontSizeToken];var rawCounterValue=internalValue!=null?internalValue:min;var counterValueDigitCount=Math.max(2,String(Math.abs(rawCounterValue)).length)+(rawCounterValue<0?1:0);var counterInputHorizontalPadding=theme.spacing[baseInputCounterInputPaddingTokens.left[size]]+theme.spacing[baseInputCounterInputPaddingTokens.right[size]];var counterInputFieldWidth=counterValueDigitCount*fontSize*COUNTER_INPUT_NATIVE_DIGIT_WIDTH_RATIO+counterInputHorizontalPadding;var containerStyle=StyleSheet.create({box:{minWidth:COUNTER_INPUT_TOKEN.width[size],height:COUNTER_INPUT_TOKEN.height[size],alignSelf:'flex-start'}});var textInputStyle=StyleSheet.create({input:{flex:1,textAlign:'center',textAlignVertical:'center',includeFontPadding:false,padding:0,color:valueColor,fontSize:fontSize,fontFamily:theme.typography.fonts.family.text,fontWeight:'600',fontVariant:['tabular-nums']}});var inputWrapperStyle={flex:1,minWidth:counterInputFieldWidth};var contextValue={size:size,emphasis:emphasis,isDisabled:isDisabled,isLoading:isLoading,color:emphasisTokens.color,disabledTextColor:emphasisTokens.disabledColor,isInsideCounterInput:true};return jsx(CounterInputProvider,{value:contextValue,children:jsx(BaseBox,Object.assign({ref:ref},metaAttribute({name:MetaConstants.CounterInput,testID:testID}),getStyledProps(rest),makeAnalyticsAttribute(rest),{children:jsxs(BaseBox,{display:"flex",flexDirection:"column",children:[label&&jsx(FormLabel,{as:"span",position:"top",id:labelId,size:size,children:label}),jsxs(BaseBox,{display:"flex",alignItems:"center",flexDirection:"column",backgroundColor:isLoading||isDisabled?emphasisTokens.loadingOrDisabledBgColor:emphasisTokens.backgroundColor,style:containerStyle.box,borderRadius:COUNTER_INPUT_TOKEN.containerBorderRadius[size],borderWidth:"thin",borderColor:_isDisabled?emphasisTokens.disabledBorderColor:emphasisTokens.borderColor,children:[jsxs(BaseBox,{display:"flex",alignItems:"center",flexDirection:"row",flex:1,children:[jsx(Pressable,{onPress:handleDecrement,disabled:isDecrementDisabled,style:getButtonStyle('decrement',size),accessibilityLabel:"Decrement value",accessibilityRole:"button",children:jsx(MinusIcon,{size:COUNTER_INPUT_ICON_SIZE_MAP[size],color:isDecrementDisabled?emphasisTokens.disabledIconColor:emphasisTokens.iconColor})}),jsx(Animated.View,{style:[inputWrapperStyle,animatedStyle],children:jsx(TextInput,{value:(_internalValue$toStri=internalValue==null?void 0:internalValue.toString())!=null?_internalValue$toStri:String(min),onChangeText:handleInputChange,onFocus:function onFocus(){return _onFocus==null?void 0:_onFocus({name:name,value:internalValue==null?void 0:internalValue.toString()});},onBlur:function onBlur(){return _onBlur==null?void 0:_onBlur({name:name,value:internalValue==null?void 0:internalValue.toString()});},editable:!_isDisabled,keyboardType:"numeric",style:textInputStyle.input,accessibilityLabel:accessibilityLabel!=null?accessibilityLabel:label,accessibilityRole:"spinbutton"})}),jsx(Pressable,{onPress:handleIncrement,disabled:isIncrementDisabled,style:getButtonStyle('increment',size),accessibilityLabel:"Increment value",accessibilityRole:"button",children:jsx(PlusIcon,{size:COUNTER_INPUT_ICON_SIZE_MAP[size],color:isIncrementDisabled?emphasisTokens.disabledIconColor:emphasisTokens.iconColor})})]}),isLoading&&jsx(BaseBox,{width:"100%",position:"absolute",bottom:"spacing.0",children:jsx(ProgressBar,{color:emphasisTokens.progressBarColor,showPercentage:false,value:1,isIndeterminate:true,_oscillation:true})})]})]})}))});});var CounterInput=assignWithoutSideEffects(_CounterInput,{componentId:MetaConstants.CounterInput});
|
|
35
36
|
|
|
36
37
|
export { CounterInput };
|
|
37
38
|
//# sourceMappingURL=CounterInput.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CounterInput.native.js","sources":["../../../../../src/components/CounterInput/CounterInput.native.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useRef } from 'react';\nimport { Pressable, TextInput, StyleSheet } from 'react-native';\nimport Animated, {\n useAnimatedStyle,\n useSharedValue,\n withTiming,\n Easing,\n} from 'react-native-reanimated';\nimport type { CounterInputProps } from './types';\nimport { COUNTER_INPUT_TOKEN, COUNTER_INPUT_ICON_SIZE_MAP } from './token';\nimport { CounterInputProvider } from './CounterInputContext';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\nimport type { BladeElementRef } from '~utils/types';\nimport { useControllableState } from '~utils/useControllable';\nimport BaseBox from '~components/Box/BaseBox';\nimport { FormLabel } from '~components/Form';\nimport { useId } from '~utils/useId';\nimport { useTheme } from '~components/BladeProvider';\nimport { MinusIcon, PlusIcon } from '~components/Icons';\nimport { ProgressBar } from '~components/ProgressBar';\nimport get from '~utils/lodashButBetter/get';\nimport { getTextProps } from '~components/Typography/Text/Text';\n\nconst COUNTER_INPUT_SIZE_TO_TEXT_SIZE = {\n xsmall: 'small',\n small: 'small',\n medium: 'medium',\n large: 'large',\n} as const;\n\ntype CounterInputSize = NonNullable<CounterInputProps['size']>;\n\nconst getButtonStyle = (\n type: 'decrement' | 'increment',\n size: CounterInputSize,\n): Record<string, number> => {\n const iconPadding =\n COUNTER_INPUT_TOKEN.iconPadding[size as keyof typeof COUNTER_INPUT_TOKEN.iconPadding] ??\n COUNTER_INPUT_TOKEN.iconPadding.xsmall;\n const margin =\n type === 'decrement'\n ? COUNTER_INPUT_TOKEN.decrementIconMargin\n : COUNTER_INPUT_TOKEN.incrementIconMargin;\n return {\n padding: iconPadding,\n marginTop: margin[0],\n marginRight: margin[1],\n marginBottom: margin[2],\n marginLeft: margin[3],\n borderRadius:\n COUNTER_INPUT_TOKEN.buttonBorderRadius[\n (size in COUNTER_INPUT_TOKEN.buttonBorderRadius\n ? size\n : 'xsmall') as keyof typeof COUNTER_INPUT_TOKEN.buttonBorderRadius\n ],\n };\n};\n\nconst _CounterInput = React.forwardRef<BladeElementRef, CounterInputProps>(\n (\n {\n label,\n accessibilityLabel,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n labelPosition = 'top',\n name,\n value,\n defaultValue,\n min = 0,\n max,\n emphasis = 'subtle',\n size = 'medium',\n isLoading = false,\n isDisabled = false,\n onChange,\n onFocus,\n onBlur,\n testID,\n ...rest\n },\n ref,\n ) => {\n const [internalValue, setInternalValue] = useControllableState({\n value,\n defaultValue,\n onChange: (newValue) => onChange?.({ value: newValue }),\n });\n\n const translateY = useSharedValue(0);\n const opacity = useSharedValue(1);\n const lastActionRef = useRef<'increment' | 'decrement' | null>(null);\n const previousValueRef = useRef<number | undefined>(internalValue);\n\n const labelId = useId('counter-input-label');\n const { theme } = useTheme();\n const emphasisTokens = COUNTER_INPUT_TOKEN.emphasis[emphasis];\n const _isDisabled = isDisabled || isLoading;\n\n const duration = theme.motion.duration.quick;\n\n useEffect(() => {\n if (lastActionRef.current && internalValue !== previousValueRef.current) {\n const startY = lastActionRef.current === 'increment' ? 8 : -8;\n translateY.value = startY;\n opacity.value = 0;\n translateY.value = withTiming(0, { duration, easing: Easing.out(Easing.ease) });\n opacity.value = withTiming(1, { duration, easing: Easing.out(Easing.ease) });\n lastActionRef.current = null;\n }\n previousValueRef.current = internalValue;\n }, [internalValue, duration]);\n\n const animatedStyle = useAnimatedStyle(() => ({\n transform: [{ translateY: translateY.value }],\n opacity: opacity.value,\n }));\n\n const handleInputChange = useCallback(\n (text: string) => {\n const numericValue = text ? parseInt(text, 10) : min;\n const validValue = isNaN(numericValue) ? min : numericValue;\n let constrainedValue = validValue;\n if (constrainedValue < min) constrainedValue = min;\n if (max !== undefined && constrainedValue > max) constrainedValue = max;\n setInternalValue(() => constrainedValue);\n },\n [min, max, setInternalValue],\n );\n\n const handleIncrement = useCallback(() => {\n if (_isDisabled) return;\n lastActionRef.current = 'increment';\n const newValue = (internalValue ?? min) + 1;\n const constrainedValue = max !== undefined ? Math.min(newValue, max) : newValue;\n setInternalValue(() => constrainedValue);\n }, [internalValue, min, max, _isDisabled, setInternalValue]);\n\n const handleDecrement = useCallback(() => {\n if (_isDisabled) return;\n lastActionRef.current = 'decrement';\n const newValue = (internalValue ?? min) - 1;\n const constrainedValue = Math.max(newValue, min);\n setInternalValue(() => constrainedValue);\n }, [internalValue, min, _isDisabled, setInternalValue]);\n\n const isDecrementDisabled = _isDisabled || (internalValue ?? min) <= min;\n const isIncrementDisabled = _isDisabled || (max !== undefined && (internalValue ?? min) >= max);\n\n const valueColor = get(\n theme.colors,\n _isDisabled ? emphasisTokens.disabledColor : emphasisTokens.color,\n '',\n ) as string;\n\n const { fontSize: fontSizeToken = 100 } = getTextProps({\n variant: 'body',\n size: COUNTER_INPUT_SIZE_TO_TEXT_SIZE[size],\n weight: 'semibold',\n });\n\n const containerStyle = StyleSheet.create({\n box: {\n width: COUNTER_INPUT_TOKEN.width[size],\n height: COUNTER_INPUT_TOKEN.height[size],\n },\n });\n\n const textInputStyle = StyleSheet.create({\n input: {\n flex: 1,\n textAlign: 'center',\n textAlignVertical: 'center',\n includeFontPadding: false,\n padding: 0,\n color: valueColor,\n fontSize: theme.typography.fonts.size[fontSizeToken],\n fontFamily: theme.typography.fonts.family.text,\n fontWeight: '600',\n },\n });\n\n const contextValue = {\n size,\n emphasis,\n isDisabled,\n isLoading,\n color: emphasisTokens.color,\n disabledTextColor: emphasisTokens.disabledColor,\n isInsideCounterInput: true,\n };\n\n return (\n <CounterInputProvider value={contextValue}>\n <BaseBox\n ref={ref}\n {...metaAttribute({ name: MetaConstants.CounterInput, testID })}\n {...getStyledProps(rest)}\n {...makeAnalyticsAttribute(rest)}\n >\n <BaseBox display=\"flex\" flexDirection=\"column\">\n {label && (\n <FormLabel as=\"span\" position=\"top\" id={labelId} size={size}>\n {label}\n </FormLabel>\n )}\n\n <BaseBox\n display=\"flex\"\n alignItems=\"center\"\n flexDirection=\"column\"\n backgroundColor={\n isLoading || isDisabled\n ? emphasisTokens.loadingOrDisabledBgColor\n : emphasisTokens.backgroundColor\n }\n style={containerStyle.box}\n borderRadius={COUNTER_INPUT_TOKEN.containerBorderRadius[size]}\n borderWidth=\"thin\"\n borderColor={\n _isDisabled ? emphasisTokens.disabledBorderColor : emphasisTokens.borderColor\n }\n >\n <BaseBox display=\"flex\" alignItems=\"center\" flexDirection=\"row\" flex={1}>\n <Pressable\n onPress={handleDecrement}\n disabled={isDecrementDisabled}\n style={getButtonStyle('decrement', size)}\n accessibilityLabel=\"Decrement value\"\n accessibilityRole=\"button\"\n >\n <MinusIcon\n size={COUNTER_INPUT_ICON_SIZE_MAP[size]}\n color={\n isDecrementDisabled\n ? emphasisTokens.disabledIconColor\n : emphasisTokens.iconColor\n }\n />\n </Pressable>\n\n <Animated.View style={[{ flex: 1 }, animatedStyle]}>\n <TextInput\n value={internalValue?.toString() ?? String(min)}\n onChangeText={handleInputChange}\n onFocus={() => onFocus?.({ name, value: internalValue?.toString() })}\n onBlur={() => onBlur?.({ name, value: internalValue?.toString() })}\n editable={!_isDisabled}\n keyboardType=\"numeric\"\n style={textInputStyle.input}\n accessibilityLabel={accessibilityLabel ?? label}\n accessibilityRole=\"spinbutton\"\n />\n </Animated.View>\n\n <Pressable\n onPress={handleIncrement}\n disabled={isIncrementDisabled}\n style={getButtonStyle('increment', size)}\n accessibilityLabel=\"Increment value\"\n accessibilityRole=\"button\"\n >\n <PlusIcon\n size={COUNTER_INPUT_ICON_SIZE_MAP[size]}\n color={\n isIncrementDisabled\n ? emphasisTokens.disabledIconColor\n : emphasisTokens.iconColor\n }\n />\n </Pressable>\n </BaseBox>\n\n {isLoading && (\n <BaseBox width=\"100%\" position=\"absolute\" bottom=\"spacing.0\">\n <ProgressBar\n color={emphasisTokens.progressBarColor}\n showPercentage={false}\n value={1}\n isIndeterminate={true}\n _oscillation={true}\n />\n </BaseBox>\n )}\n </BaseBox>\n </BaseBox>\n </BaseBox>\n </CounterInputProvider>\n );\n },\n);\n\nconst CounterInput = assignWithoutSideEffects(_CounterInput, {\n componentId: MetaConstants.CounterInput,\n});\n\nexport { CounterInput };\n"],"names":["COUNTER_INPUT_SIZE_TO_TEXT_SIZE","xsmall","small","medium","large","getButtonStyle","type","size","_COUNTER_INPUT_TOKEN$","iconPadding","COUNTER_INPUT_TOKEN","margin","decrementIconMargin","incrementIconMargin","padding","marginTop","marginRight","marginBottom","marginLeft","borderRadius","buttonBorderRadius","_CounterInput","React","forwardRef","_ref","ref","_internalValue$toStri","label","accessibilityLabel","_ref$labelPosition","labelPosition","name","value","defaultValue","_ref$min","min","max","_ref$emphasis","emphasis","_ref$size","_ref$isLoading","isLoading","_ref$isDisabled","isDisabled","onChange","onFocus","onBlur","testID","rest","_objectWithoutProperties","_excluded","_useControllableState","useControllableState","newValue","_useControllableState2","_slicedToArray","internalValue","setInternalValue","translateY","useSharedValue","opacity","lastActionRef","useRef","previousValueRef","labelId","useId","_useTheme","useTheme","theme","emphasisTokens","_isDisabled","duration","motion","quick","useEffect","current","startY","withTiming","easing","Easing","out","ease","animatedStyle","useAnimatedStyle","transform","handleInputChange","useCallback","text","numericValue","parseInt","validValue","isNaN","constrainedValue","undefined","handleIncrement","Math","handleDecrement","isDecrementDisabled","isIncrementDisabled","valueColor","get","colors","disabledColor","color","_getTextProps","getTextProps","variant","weight","_getTextProps$fontSiz","fontSize","fontSizeToken","containerStyle","StyleSheet","create","box","width","height","textInputStyle","input","flex","textAlign","textAlignVertical","includeFontPadding","typography","fonts","fontFamily","family","fontWeight","contextValue","disabledTextColor","isInsideCounterInput","_jsx","CounterInputProvider","children","BaseBox","Object","assign","metaAttribute","MetaConstants","CounterInput","getStyledProps","makeAnalyticsAttribute","_jsxs","display","flexDirection","FormLabel","as","position","id","alignItems","backgroundColor","loadingOrDisabledBgColor","style","containerBorderRadius","borderWidth","borderColor","disabledBorderColor","Pressable","onPress","disabled","accessibilityRole","MinusIcon","COUNTER_INPUT_ICON_SIZE_MAP","disabledIconColor","iconColor","Animated","View","TextInput","toString","String","onChangeText","editable","keyboardType","PlusIcon","bottom","ProgressBar","progressBarColor","showPercentage","isIndeterminate","_oscillation","assignWithoutSideEffects","componentId"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6TA0BA,IAAMA,+BAA+B,CAAG,CACtCC,MAAM,CAAE,OAAO,CACfC,KAAK,CAAE,OAAO,CACdC,MAAM,CAAE,QAAQ,CAChBC,KAAK,CAAE,OACT,CAAU,CAIV,IAAMC,cAAc,CAAG,SAAjBA,cAAcA,CAClBC,IAA+B,CAC/BC,IAAsB,CACK,CAAAC,IAAAA,qBAAA,CAC3B,IAAMC,WAAW,CAAA,CAAAD,qBAAA,CACfE,mBAAmB,CAACD,WAAW,CAACF,IAAI,CAAiD,QAAAC,qBAAA,CACrFE,mBAAmB,CAACD,WAAW,CAACR,MAAM,CACxC,IAAMU,MAAM,CACVL,IAAI,GAAK,WAAW,CAChBI,mBAAmB,CA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,OAAO,CAAA,CAACnB,KAAK,CAAC,MAAM,CAACgC,QAAQ,CAAC,UAAU,CAAC2B,MAAM,CAAC,WAAW,CAAAzC,QAAA,CAC1DF,GAAA,CAAC4C,WAAW,CACVxE,CAAAA,KAAK,CAAElC,cAAc,CAAC2G,gBAAiB,CACvCC,cAAc,CAAE,KAAM,CACtBjJ,KAAK,CAAE,CAAE,CACTkJ,eAAe,CAAE,IAAK,CACtBC,YAAY,CAAE,IAAK,CACpB,CAAC,CACK,CACV,CACM,CAAA,CAAC,CACH,CAAA,CAAC,CACH,CAAA,CAAC,CACU,CAAC,CAE3B,CACF,CAAC,CAEK,IAAAxC,YAAY,CAAGyC,wBAAwB,CAAC/J,aAAa,CAAE,CAC3DgK,WAAW,CAAE3C,aAAa,CAACC,YAC7B,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"CounterInput.native.js","sources":["../../../../../src/components/CounterInput/CounterInput.native.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useRef } from 'react';\nimport { Pressable, TextInput, StyleSheet } from 'react-native';\nimport type { TextStyle } from 'react-native';\nimport Animated, {\n useAnimatedStyle,\n useSharedValue,\n withTiming,\n Easing,\n} from 'react-native-reanimated';\nimport type { CounterInputProps } from './types';\nimport {\n COUNTER_INPUT_TOKEN,\n COUNTER_INPUT_ICON_SIZE_MAP,\n COUNTER_INPUT_SIZE_TO_TEXT_SIZE,\n} from './token';\nimport { CounterInputProvider } from './CounterInputContext';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\nimport type { BladeElementRef } from '~utils/types';\nimport { useControllableState } from '~utils/useControllable';\nimport { baseInputCounterInputPaddingTokens } from '~components/Input/BaseInput/baseInputTokens';\nimport BaseBox from '~components/Box/BaseBox';\nimport { FormLabel } from '~components/Form';\nimport { useId } from '~utils/useId';\nimport { useTheme } from '~components/BladeProvider';\nimport { MinusIcon, PlusIcon } from '~components/Icons';\nimport { ProgressBar } from '~components/ProgressBar';\nimport get from '~utils/lodashButBetter/get';\nimport { getTextProps } from '~components/Typography/Text/Text';\n\n// React Native has no ch unit, so approximate Inter's tabular digit width from its font size.\nconst COUNTER_INPUT_NATIVE_DIGIT_WIDTH_RATIO = 0.6;\n\ntype CounterInputSize = NonNullable<CounterInputProps['size']>;\n\nconst getButtonStyle = (\n type: 'decrement' | 'increment',\n size: CounterInputSize,\n): Record<string, number> => {\n const iconPadding =\n COUNTER_INPUT_TOKEN.iconPadding[size as keyof typeof COUNTER_INPUT_TOKEN.iconPadding] ??\n COUNTER_INPUT_TOKEN.iconPadding.xsmall;\n const margin =\n type === 'decrement'\n ? COUNTER_INPUT_TOKEN.decrementIconMargin\n : COUNTER_INPUT_TOKEN.incrementIconMargin;\n return {\n padding: iconPadding,\n marginTop: margin[0],\n marginRight: margin[1],\n marginBottom: margin[2],\n marginLeft: margin[3],\n borderRadius:\n COUNTER_INPUT_TOKEN.buttonBorderRadius[\n (size in COUNTER_INPUT_TOKEN.buttonBorderRadius\n ? size\n : 'xsmall') as keyof typeof COUNTER_INPUT_TOKEN.buttonBorderRadius\n ],\n };\n};\n\nconst _CounterInput = React.forwardRef<BladeElementRef, CounterInputProps>(\n (\n {\n label,\n accessibilityLabel,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n labelPosition = 'top',\n name,\n value,\n defaultValue,\n min = 0,\n max,\n emphasis = 'subtle',\n size = 'medium',\n isLoading = false,\n isDisabled = false,\n onChange,\n onFocus,\n onBlur,\n testID,\n ...rest\n },\n ref,\n ) => {\n const [internalValue, setInternalValue] = useControllableState({\n value,\n defaultValue,\n onChange: (newValue) => onChange?.({ value: newValue }),\n });\n\n const translateY = useSharedValue(0);\n const opacity = useSharedValue(1);\n const lastActionRef = useRef<'increment' | 'decrement' | null>(null);\n const previousValueRef = useRef<number | undefined>(internalValue);\n\n const labelId = useId('counter-input-label');\n const { theme } = useTheme();\n const emphasisTokens = COUNTER_INPUT_TOKEN.emphasis[emphasis];\n const _isDisabled = isDisabled || isLoading;\n\n const duration = theme.motion.duration.quick;\n\n useEffect(() => {\n if (lastActionRef.current && internalValue !== previousValueRef.current) {\n const startY = lastActionRef.current === 'increment' ? 8 : -8;\n translateY.value = startY;\n opacity.value = 0;\n translateY.value = withTiming(0, { duration, easing: Easing.out(Easing.ease) });\n opacity.value = withTiming(1, { duration, easing: Easing.out(Easing.ease) });\n lastActionRef.current = null;\n }\n previousValueRef.current = internalValue;\n }, [internalValue, duration]);\n\n const animatedStyle = useAnimatedStyle(() => ({\n transform: [{ translateY: translateY.value }],\n opacity: opacity.value,\n }));\n\n const handleInputChange = useCallback(\n (text: string) => {\n const numericValue = text ? parseInt(text, 10) : min;\n const validValue = isNaN(numericValue) ? min : numericValue;\n let constrainedValue = validValue;\n if (constrainedValue < min) constrainedValue = min;\n if (max !== undefined && constrainedValue > max) constrainedValue = max;\n setInternalValue(() => constrainedValue);\n },\n [min, max, setInternalValue],\n );\n\n const handleIncrement = useCallback(() => {\n if (_isDisabled) return;\n lastActionRef.current = 'increment';\n const newValue = (internalValue ?? min) + 1;\n const constrainedValue = max !== undefined ? Math.min(newValue, max) : newValue;\n setInternalValue(() => constrainedValue);\n }, [internalValue, min, max, _isDisabled, setInternalValue]);\n\n const handleDecrement = useCallback(() => {\n if (_isDisabled) return;\n lastActionRef.current = 'decrement';\n const newValue = (internalValue ?? min) - 1;\n const constrainedValue = Math.max(newValue, min);\n setInternalValue(() => constrainedValue);\n }, [internalValue, min, _isDisabled, setInternalValue]);\n\n const isDecrementDisabled = _isDisabled || (internalValue ?? min) <= min;\n const isIncrementDisabled = _isDisabled || (max !== undefined && (internalValue ?? min) >= max);\n\n const valueColor = get(\n theme.colors,\n _isDisabled ? emphasisTokens.disabledColor : emphasisTokens.color,\n '',\n ) as string;\n\n const { fontSize: fontSizeToken = 100 } = getTextProps({\n variant: 'body',\n size: COUNTER_INPUT_SIZE_TO_TEXT_SIZE[size],\n weight: 'semibold',\n });\n const fontSize = theme.typography.fonts.size[fontSizeToken];\n const rawCounterValue = internalValue ?? min;\n const counterValueDigitCount =\n Math.max(2, String(Math.abs(rawCounterValue)).length) + (rawCounterValue < 0 ? 1 : 0);\n const counterInputHorizontalPadding =\n theme.spacing[baseInputCounterInputPaddingTokens.left[size]] +\n theme.spacing[baseInputCounterInputPaddingTokens.right[size]];\n const counterInputFieldWidth =\n counterValueDigitCount * fontSize * COUNTER_INPUT_NATIVE_DIGIT_WIDTH_RATIO +\n counterInputHorizontalPadding;\n\n const containerStyle = StyleSheet.create({\n box: {\n minWidth: COUNTER_INPUT_TOKEN.width[size],\n height: COUNTER_INPUT_TOKEN.height[size],\n alignSelf: 'flex-start',\n },\n });\n\n const textInputStyle = StyleSheet.create({\n input: {\n flex: 1,\n textAlign: 'center',\n textAlignVertical: 'center',\n includeFontPadding: false,\n padding: 0,\n color: valueColor,\n fontSize,\n fontFamily: theme.typography.fonts.family.text,\n fontWeight: '600',\n fontVariant: ['tabular-nums'] as TextStyle['fontVariant'],\n },\n });\n\n const inputWrapperStyle = { flex: 1, minWidth: counterInputFieldWidth };\n\n const contextValue = {\n size,\n emphasis,\n isDisabled,\n isLoading,\n color: emphasisTokens.color,\n disabledTextColor: emphasisTokens.disabledColor,\n isInsideCounterInput: true,\n };\n\n return (\n <CounterInputProvider value={contextValue}>\n <BaseBox\n ref={ref}\n {...metaAttribute({ name: MetaConstants.CounterInput, testID })}\n {...getStyledProps(rest)}\n {...makeAnalyticsAttribute(rest)}\n >\n <BaseBox display=\"flex\" flexDirection=\"column\">\n {label && (\n <FormLabel as=\"span\" position=\"top\" id={labelId} size={size}>\n {label}\n </FormLabel>\n )}\n\n <BaseBox\n display=\"flex\"\n alignItems=\"center\"\n flexDirection=\"column\"\n backgroundColor={\n isLoading || isDisabled\n ? emphasisTokens.loadingOrDisabledBgColor\n : emphasisTokens.backgroundColor\n }\n style={containerStyle.box}\n borderRadius={COUNTER_INPUT_TOKEN.containerBorderRadius[size]}\n borderWidth=\"thin\"\n borderColor={\n _isDisabled ? emphasisTokens.disabledBorderColor : emphasisTokens.borderColor\n }\n >\n <BaseBox display=\"flex\" alignItems=\"center\" flexDirection=\"row\" flex={1}>\n <Pressable\n onPress={handleDecrement}\n disabled={isDecrementDisabled}\n style={getButtonStyle('decrement', size)}\n accessibilityLabel=\"Decrement value\"\n accessibilityRole=\"button\"\n >\n <MinusIcon\n size={COUNTER_INPUT_ICON_SIZE_MAP[size]}\n color={\n isDecrementDisabled\n ? emphasisTokens.disabledIconColor\n : emphasisTokens.iconColor\n }\n />\n </Pressable>\n\n <Animated.View style={[inputWrapperStyle, animatedStyle]}>\n <TextInput\n value={internalValue?.toString() ?? String(min)}\n onChangeText={handleInputChange}\n onFocus={() => onFocus?.({ name, value: internalValue?.toString() })}\n onBlur={() => onBlur?.({ name, value: internalValue?.toString() })}\n editable={!_isDisabled}\n keyboardType=\"numeric\"\n style={textInputStyle.input}\n accessibilityLabel={accessibilityLabel ?? label}\n accessibilityRole=\"spinbutton\"\n />\n </Animated.View>\n\n <Pressable\n onPress={handleIncrement}\n disabled={isIncrementDisabled}\n style={getButtonStyle('increment', size)}\n accessibilityLabel=\"Increment value\"\n accessibilityRole=\"button\"\n >\n <PlusIcon\n size={COUNTER_INPUT_ICON_SIZE_MAP[size]}\n color={\n isIncrementDisabled\n ? emphasisTokens.disabledIconColor\n : emphasisTokens.iconColor\n }\n />\n </Pressable>\n </BaseBox>\n\n {isLoading && (\n <BaseBox width=\"100%\" position=\"absolute\" bottom=\"spacing.0\">\n <ProgressBar\n color={emphasisTokens.progressBarColor}\n showPercentage={false}\n value={1}\n isIndeterminate={true}\n _oscillation={true}\n />\n </BaseBox>\n )}\n </BaseBox>\n </BaseBox>\n </BaseBox>\n </CounterInputProvider>\n );\n },\n);\n\nconst CounterInput = assignWithoutSideEffects(_CounterInput, {\n componentId: MetaConstants.CounterInput,\n});\n\nexport { CounterInput };\n"],"names":["COUNTER_INPUT_NATIVE_DIGIT_WIDTH_RATIO","getButtonStyle","type","size","_COUNTER_INPUT_TOKEN$","iconPadding","COUNTER_INPUT_TOKEN","xsmall","margin","decrementIconMargin","incrementIconMargin","padding","marginTop","marginRight","marginBottom","marginLeft","borderRadius","buttonBorderRadius","_CounterInput","React","forwardRef","_ref","ref","_internalValue$toStri","label","accessibilityLabel","_ref$labelPosition","labelPosition","name","value","defaultValue","_ref$min","min","max","_ref$emphasis","emphasis","_ref$size","_ref$isLoading","isLoading","_ref$isDisabled","isDisabled","onChange","onFocus","onBlur","testID","rest","_objectWithoutProperties","_excluded","_useControllableState","useControllableState","newValue","_useControllableState2","_slicedToArray","internalValue","setInternalValue","translateY","useSharedValue","opacity","lastActionRef","useRef","previousValueRef","labelId","useId","_useTheme","useTheme","theme","emphasisTokens","_isDisabled","duration","motion","quick","useEffect","current","startY","withTiming","easing","Easing","out","ease","animatedStyle","useAnimatedStyle","transform","handleInputChange","useCallback","text","numericValue","parseInt","validValue","isNaN","constrainedValue","undefined","handleIncrement","Math","handleDecrement","isDecrementDisabled","isIncrementDisabled","valueColor","get","colors","disabledColor","color","_getTextProps","getTextProps","variant","COUNTER_INPUT_SIZE_TO_TEXT_SIZE","weight","_getTextProps$fontSiz","fontSize","fontSizeToken","typography","fonts","rawCounterValue","counterValueDigitCount","String","abs","length","counterInputHorizontalPadding","spacing","baseInputCounterInputPaddingTokens","left","right","counterInputFieldWidth","containerStyle","StyleSheet","create","box","minWidth","width","height","alignSelf","textInputStyle","input","flex","textAlign","textAlignVertical","includeFontPadding","fontFamily","family","fontWeight","fontVariant","inputWrapperStyle","contextValue","disabledTextColor","isInsideCounterInput","_jsx","CounterInputProvider","children","BaseBox","Object","assign","metaAttribute","MetaConstants","CounterInput","getStyledProps","makeAnalyticsAttribute","_jsxs","display","flexDirection","FormLabel","as","position","id","alignItems","backgroundColor","loadingOrDisabledBgColor","style","containerBorderRadius","borderWidth","borderColor","disabledBorderColor","Pressable","onPress","disabled","accessibilityRole","MinusIcon","COUNTER_INPUT_ICON_SIZE_MAP","disabledIconColor","iconColor","Animated","View","TextInput","toString","onChangeText","editable","keyboardType","PlusIcon","bottom","ProgressBar","progressBarColor","showPercentage","isIndeterminate","_oscillation","assignWithoutSideEffects","componentId"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6TAiCA,IAAMA,sCAAsC,CAAG,GAAG,CAIlD,IAAMC,cAAc,CAAG,SAAjBA,cAAcA,CAClBC,IAA+B,CAC/BC,IAAsB,CACK,CAAA,IAAAC,qBAAA,CAC3B,IAAMC,WAAW,CAAAD,CAAAA,qBAAA,CACfE,mBAAmB,CAACD,WAAW,CAACF,IAAI,CAAiD,QAAAC,qBAAA,CACrFE,mBAAmB,CAACD,WAAW,CAACE,MAAM,CACxC,IAAMC,MAAM,CACVN,IAAI,GAAK,WAAW,CAChBI,mBAAmB,CAACG,mBAAmB,CACvCH,mBAAmB,CAACI,mBAAmB,CAC7C,OAAO,CACLC,OAAO,CAAEN,WAAW,CACpBO,SAAS,CAAEJ,MAAM,CAAC,CAAC,CAAC,CACpBK,WAAW,CAAEL,MAAM,CAAC,CAAC,CAAC,CACtBM,YAAY,CAAEN,MAAM,CAAC,CAAC,CAAC,CACvBO,UAAU,CAAEP,MAAM,CAAC,CAAC,CAAC,CACrBQ,YAAY,CACVV,mBAAmB,CAACW,kBAAkB,CACnCd,IAAI,IAAIG,mBAAmB,CAACW,kBAAkB,CAC3Cd,IAAI,CACJ,QAAQ,CAElB,CAAC,CACH,CAAC,CAED,IAAMe,aAAa,CAAGC,cAAK,CAACC,UAAU,CACpC,SAAAC,IAAA,CAqBEC,GAAG,CACA,CAAAC,IAAAA,qBAAA,KApBDC,KAAK,CAAAH,IAAA,CAALG,KAAK,CACLC,kBAAkB,CAAAJ,IAAA,CAAlBI,kBAAkB,CAAAC,kBAAA,CAAAL,IAAA,CAElBM,aAAa,CAAbA,aAAa,CAAAD,kB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AAC,CACO,CAAC,CAAA,CACL,CAAC,CAET3I,SAAS,EACR0G,GAAA,CAACG,OAAO,EAACpB,KAAK,CAAC,MAAM,CAACiC,QAAQ,CAAC,UAAU,CAAC0B,MAAM,CAAC,WAAW,CAAAxC,QAAA,CAC1DF,GAAA,CAAC2C,WAAW,CAAA,CACVvF,KAAK,CAAElC,cAAc,CAAC0H,gBAAiB,CACvCC,cAAc,CAAE,KAAM,CACtBhK,KAAK,CAAE,CAAE,CACTiK,eAAe,CAAE,IAAK,CACtBC,YAAY,CAAE,IAAK,CACpB,CAAC,CACK,CACV,CACM,CAAA,CAAC,CACH,CAAA,CAAC,EACH,CAAC,CACU,CAAC,CAE3B,CACF,CAAC,CAEK,IAAAvC,YAAY,CAAGwC,wBAAwB,CAAC9K,aAAa,CAAE,CAC3D+K,WAAW,CAAE1C,aAAa,CAACC,YAC7B,CAAC;;;;"}
|
|
@@ -3,7 +3,7 @@ import { size } from '../../tokens/global/size.js';
|
|
|
3
3
|
import { border } from '../../tokens/global/border.js';
|
|
4
4
|
import { spacing } from '../../tokens/global/spacing.js';
|
|
5
5
|
|
|
6
|
-
var COUNTER_INPUT_ICON_SIZE_MAP={xsmall:'small',small:'small',medium:'large',large:'xlarge'};var COUNTER_INPUT_TOKEN={width:{xsmall:size[78],medium:size[94],large:size[122]},height:{xsmall:size[30],medium:size[38],large:size[50]},containerBorderRadius:{xsmall:'small',small:'small',medium:'small',large:'medium'},buttonBorderRadius:{xsmall:border.radius.xsmall,small:border.radius.xsmall,medium:border.radius.xsmall,large:border.radius.small},decrementIconMargin:[spacing[2],spacing[0],spacing[2],spacing[2]],incrementIconMargin:[spacing[2],spacing[2],spacing[2],spacing[0]],iconPadding:{xsmall:spacing[2],medium:spacing[2],large:spacing[3]},emphasis:{subtle:{color:'surface.text.gray.subtle',disabledColor:'surface.text.gray.disabled',iconColor:'interactive.icon.gray.subtle',disabledIconColor:'interactive.icon.gray.disabled',borderColor:'interactive.border.gray.default',disabledBorderColor:'interactive.border.gray.default',backgroundColor:'surface.background.gray.intense',loadingOrDisabledBgColor:'surface.background.gray.subtle',progressBarColor:'neutral'},intense:{color:'interactive.text.primary.subtle',disabledColor:'interactive.text.primary.disabled',iconColor:'interactive.icon.primary.subtle',disabledIconColor:'interactive.icon.primary.disabled',borderColor:'interactive.border.primary.highlighted',disabledBorderColor:'interactive.border.primary.disabled',backgroundColor:'surface.background.gray.intense',loadingOrDisabledBgColor:'surface.background.gray.subtle',progressBarColor:undefined}}};
|
|
6
|
+
var COUNTER_INPUT_ICON_SIZE_MAP={xsmall:'small',small:'small',medium:'large',large:'xlarge'};var COUNTER_INPUT_SIZE_TO_TEXT_SIZE={xsmall:'small',medium:'medium',large:'large'};var COUNTER_INPUT_TOKEN={width:{xsmall:size[78],medium:size[94],large:size[122]},height:{xsmall:size[30],medium:size[38],large:size[50]},containerBorderRadius:{xsmall:'small',small:'small',medium:'small',large:'medium'},buttonBorderRadius:{xsmall:border.radius.xsmall,small:border.radius.xsmall,medium:border.radius.xsmall,large:border.radius.small},decrementIconMargin:[spacing[2],spacing[0],spacing[2],spacing[2]],incrementIconMargin:[spacing[2],spacing[2],spacing[2],spacing[0]],iconPadding:{xsmall:spacing[2],medium:spacing[2],large:spacing[3]},emphasis:{subtle:{color:'surface.text.gray.subtle',disabledColor:'surface.text.gray.disabled',iconColor:'interactive.icon.gray.subtle',disabledIconColor:'interactive.icon.gray.disabled',borderColor:'interactive.border.gray.default',disabledBorderColor:'interactive.border.gray.default',backgroundColor:'surface.background.gray.intense',loadingOrDisabledBgColor:'surface.background.gray.subtle',progressBarColor:'neutral'},intense:{color:'interactive.text.primary.subtle',disabledColor:'interactive.text.primary.disabled',iconColor:'interactive.icon.primary.subtle',disabledIconColor:'interactive.icon.primary.disabled',borderColor:'interactive.border.primary.highlighted',disabledBorderColor:'interactive.border.primary.disabled',backgroundColor:'surface.background.gray.intense',loadingOrDisabledBgColor:'surface.background.gray.subtle',progressBarColor:undefined}}};
|
|
7
7
|
|
|
8
|
-
export { COUNTER_INPUT_ICON_SIZE_MAP, COUNTER_INPUT_TOKEN };
|
|
8
|
+
export { COUNTER_INPUT_ICON_SIZE_MAP, COUNTER_INPUT_SIZE_TO_TEXT_SIZE, COUNTER_INPUT_TOKEN };
|
|
9
9
|
//# sourceMappingURL=token.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token.js","sources":["../../../../../src/components/CounterInput/token.ts"],"sourcesContent":["import { size as sizeTokens, spacing, border } from '~tokens/global';\n\nexport const COUNTER_INPUT_ICON_SIZE_MAP = {\n xsmall: 'small',\n small: 'small',\n medium: 'large',\n large: 'xlarge',\n} as const;\n\nexport const COUNTER_INPUT_TOKEN = {\n width: {\n xsmall: sizeTokens[78],\n medium: sizeTokens[94],\n large: sizeTokens[122],\n },\n height: {\n xsmall: sizeTokens[30],\n medium: sizeTokens[38],\n large: sizeTokens[50],\n },\n\n containerBorderRadius: {\n xsmall: 'small',\n small: 'small',\n medium: 'small',\n large: 'medium',\n },\n buttonBorderRadius: {\n xsmall: border.radius.xsmall,\n small: border.radius.xsmall,\n medium: border.radius.xsmall,\n large: border.radius.small,\n },\n\n decrementIconMargin: [spacing[2], spacing[0], spacing[2], spacing[2]],\n incrementIconMargin: [spacing[2], spacing[2], spacing[2], spacing[0]],\n\n iconPadding: {\n xsmall: spacing[2],\n medium: spacing[2],\n large: spacing[3],\n },\n\n emphasis: {\n subtle: {\n color: 'surface.text.gray.subtle',\n disabledColor: 'surface.text.gray.disabled',\n iconColor: 'interactive.icon.gray.subtle',\n disabledIconColor: 'interactive.icon.gray.disabled',\n borderColor: 'interactive.border.gray.default',\n disabledBorderColor: 'interactive.border.gray.default',\n backgroundColor: 'surface.background.gray.intense',\n loadingOrDisabledBgColor: 'surface.background.gray.subtle',\n progressBarColor: 'neutral',\n },\n intense: {\n color: 'interactive.text.primary.subtle',\n disabledColor: 'interactive.text.primary.disabled',\n iconColor: 'interactive.icon.primary.subtle',\n disabledIconColor: 'interactive.icon.primary.disabled',\n borderColor: 'interactive.border.primary.highlighted',\n disabledBorderColor: 'interactive.border.primary.disabled',\n backgroundColor: 'surface.background.gray.intense',\n loadingOrDisabledBgColor: 'surface.background.gray.subtle',\n progressBarColor: undefined,\n },\n },\n} as const;\n"],"names":["COUNTER_INPUT_ICON_SIZE_MAP","xsmall","small","medium","large","COUNTER_INPUT_TOKEN","width","sizeTokens","height","containerBorderRadius","buttonBorderRadius","border","radius","decrementIconMargin","spacing","incrementIconMargin","iconPadding","emphasis","subtle","color","disabledColor","iconColor","disabledIconColor","borderColor","disabledBorderColor","backgroundColor","loadingOrDisabledBgColor","progressBarColor","intense","undefined"],"mappings":";;;;;AAEa,IAAAA,2BAA2B,CAAG,CACzCC,MAAM,CAAE,OAAO,CACfC,KAAK,CAAE,OAAO,CACdC,MAAM,CAAE,OAAO,CACfC,KAAK,CAAE,QACT,EAEa,IAAAC,mBAAmB,CAAG,CACjCC,KAAK,CAAE,
|
|
1
|
+
{"version":3,"file":"token.js","sources":["../../../../../src/components/CounterInput/token.ts"],"sourcesContent":["import { size as sizeTokens, spacing, border } from '~tokens/global';\n\nexport const COUNTER_INPUT_ICON_SIZE_MAP = {\n xsmall: 'small',\n small: 'small',\n medium: 'large',\n large: 'xlarge',\n} as const;\n\nexport const COUNTER_INPUT_SIZE_TO_TEXT_SIZE = {\n xsmall: 'small',\n medium: 'medium',\n large: 'large',\n} as const;\n\nexport const COUNTER_INPUT_TOKEN = {\n width: {\n xsmall: sizeTokens[78],\n medium: sizeTokens[94],\n large: sizeTokens[122],\n },\n height: {\n xsmall: sizeTokens[30],\n medium: sizeTokens[38],\n large: sizeTokens[50],\n },\n\n containerBorderRadius: {\n xsmall: 'small',\n small: 'small',\n medium: 'small',\n large: 'medium',\n },\n buttonBorderRadius: {\n xsmall: border.radius.xsmall,\n small: border.radius.xsmall,\n medium: border.radius.xsmall,\n large: border.radius.small,\n },\n\n decrementIconMargin: [spacing[2], spacing[0], spacing[2], spacing[2]],\n incrementIconMargin: [spacing[2], spacing[2], spacing[2], spacing[0]],\n\n iconPadding: {\n xsmall: spacing[2],\n medium: spacing[2],\n large: spacing[3],\n },\n\n emphasis: {\n subtle: {\n color: 'surface.text.gray.subtle',\n disabledColor: 'surface.text.gray.disabled',\n iconColor: 'interactive.icon.gray.subtle',\n disabledIconColor: 'interactive.icon.gray.disabled',\n borderColor: 'interactive.border.gray.default',\n disabledBorderColor: 'interactive.border.gray.default',\n backgroundColor: 'surface.background.gray.intense',\n loadingOrDisabledBgColor: 'surface.background.gray.subtle',\n progressBarColor: 'neutral',\n },\n intense: {\n color: 'interactive.text.primary.subtle',\n disabledColor: 'interactive.text.primary.disabled',\n iconColor: 'interactive.icon.primary.subtle',\n disabledIconColor: 'interactive.icon.primary.disabled',\n borderColor: 'interactive.border.primary.highlighted',\n disabledBorderColor: 'interactive.border.primary.disabled',\n backgroundColor: 'surface.background.gray.intense',\n loadingOrDisabledBgColor: 'surface.background.gray.subtle',\n progressBarColor: undefined,\n },\n },\n} as const;\n"],"names":["COUNTER_INPUT_ICON_SIZE_MAP","xsmall","small","medium","large","COUNTER_INPUT_SIZE_TO_TEXT_SIZE","COUNTER_INPUT_TOKEN","width","sizeTokens","height","containerBorderRadius","buttonBorderRadius","border","radius","decrementIconMargin","spacing","incrementIconMargin","iconPadding","emphasis","subtle","color","disabledColor","iconColor","disabledIconColor","borderColor","disabledBorderColor","backgroundColor","loadingOrDisabledBgColor","progressBarColor","intense","undefined"],"mappings":";;;;;AAEa,IAAAA,2BAA2B,CAAG,CACzCC,MAAM,CAAE,OAAO,CACfC,KAAK,CAAE,OAAO,CACdC,MAAM,CAAE,OAAO,CACfC,KAAK,CAAE,QACT,EAEa,IAAAC,+BAA+B,CAAG,CAC7CJ,MAAM,CAAE,OAAO,CACfE,MAAM,CAAE,QAAQ,CAChBC,KAAK,CAAE,OACT,EAEa,IAAAE,mBAAmB,CAAG,CACjCC,KAAK,CAAE,CACLN,MAAM,CAAEO,IAAU,CAAC,E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CAAgC,CACnDC,WAAW,CAAE,iCAAiC,CAC9CC,mBAAmB,CAAE,iCAAiC,CACtDC,eAAe,CAAE,iCAAiC,CAClDC,wBAAwB,CAAE,gCAAgC,CAC1DC,gBAAgB,CAAE,SACpB,CAAC,CACDC,OAAO,CAAE,CACPT,KAAK,CAAE,iCAAiC,CACxCC,aAAa,CAAE,mCAAmC,CAClDC,SAAS,CAAE,iCAAiC,CAC5CC,iBAAiB,CAAE,mCAAmC,CACtDC,WAAW,CAAE,wCAAwC,CACrDC,mBAAmB,CAAE,qCAAqC,CAC1DC,eAAe,CAAE,iCAAiC,CAClDC,wBAAwB,CAAE,gCAAgC,CAC1DC,gBAAgB,CAAEE,SACpB,CACF,CACF;;;;"}
|
|
@@ -6,7 +6,7 @@ import { CalendarHeader } from './CalendarHeader.native.js';
|
|
|
6
6
|
import { DayCell, TodayDot, ListCell } from './CalendarStyles.native.js';
|
|
7
7
|
import { pickerToLevel, levelToPicker } from './constants.js';
|
|
8
8
|
import { shiftTimezone } from './shiftTimezone.js';
|
|
9
|
-
import { convertIntlToDayjsLocale } from './utils.js';
|
|
9
|
+
import { convertIntlToDayjsLocale, clampDateToRange } from './utils.js';
|
|
10
10
|
import '../Box/BaseBox/index.js';
|
|
11
11
|
import '../Typography/index.js';
|
|
12
12
|
import { useControllableState } from '../../utils/useControllable.js';
|
|
@@ -19,7 +19,7 @@ import { BaseBox } from '../Box/BaseBox/BaseBox.native.js';
|
|
|
19
19
|
import { metaAttribute } from '../../utils/metaAttribute/metaAttribute.native.js';
|
|
20
20
|
import { MetaConstants } from '../../utils/metaAttribute/metaConstants.js';
|
|
21
21
|
|
|
22
|
-
var _this=undefined,_jsxFileName="/home/runner/work/blade/blade/packages/blade/src/components/DatePicker/Calendar.native.tsx";var DAY_COLORS={default:'interactive.text.gray.normal',disabled:'interactive.text.gray.disabled',outside:'interactive.text.gray.muted',onSelected:'interactive.text.onPrimary.normal',today:'interactive.text.primary.normal'};var DAY_CELL_STYLE={aspectRatio:1};var DayGridCell=React__default.memo(function(_ref){var dateTime=_ref.dateTime,dayLabel=_ref.dayLabel,accessibilityLabel=_ref.accessibilityLabel,textColor=_ref.textColor,isSelected=_ref.isSelected,isInRange=_ref.isInRange,isFirstInRange=_ref.isFirstInRange,isLastInRange=_ref.isLastInRange,isDisabled=_ref.isDisabled,isToday=_ref.isToday,onDayPress=_ref.onDayPress;return jsxs(DayCell,{style:DAY_CELL_STYLE,isSelected:isSelected,isInRange:isInRange,isFirstInRange:isFirstInRange,isLastInRange:isLastInRange,isDisabled:isDisabled,disabled:isDisabled,accessibilityRole:"button",accessibilityState:{selected:isSelected,disabled:isDisabled},accessibilityLabel:isSelected?`${accessibilityLabel}, selected`:accessibilityLabel,onPress:function onPress(){if(isDisabled)return;onDayPress(dateTime);},children:[jsx(Text,{size:"medium",color:textColor,children:dayLabel}),isToday?jsx(TodayDot,{isSelected:isSelected}):null]});});var Calendar=function Calendar(_ref2){var _i18nState$locale;var _ref2$firstDayOfWeek=_ref2.firstDayOfWeek,firstDayOfWeek=_ref2$firstDayOfWeek===void 0?1:_ref2$firstDayOfWeek,selectionType=_ref2.selectionType,_ref2$defaultPicker=_ref2.defaultPicker,defaultPicker=_ref2$defaultPicker===void 0?'day':_ref2$defaultPicker,picker=_ref2.picker,onPickerChange=_ref2.onPickerChange,minDate=_ref2.minDate,maxDate=_ref2.maxDate,excludeDate=_ref2.excludeDate,showLevelChangeLink=_ref2.showLevelChangeLink,selectedValue=_ref2.selectedValue,__onDayClick=_ref2.__onDayClick,getDayProps=_ref2.getDayProps,getMonthControlProps=_ref2.getMonthControlProps,getYearControlProps=_ref2.getYearControlProps,onMonthSelect=_ref2.onMonthSelect,onYearSelect=_ref2.onYearSelect,onNext=_ref2.onNext,onPrevious=_ref2.onPrevious;var isRange=selectionType==='range';var _useI18nContext=useI18nContext(),i18nState=_useI18nContext.i18nState;var locale=convertIntlToDayjsLocale((_i18nState$locale=i18nState==null?void 0:i18nState.locale)!=null?_i18nState$locale:'en-IN');var _useControllableState=useControllableState({defaultValue:pickerToLevel[defaultPicker],value:picker?pickerToLevel[picker]:undefined,onChange:function onChange(newLevel){onPickerChange==null?void 0:onPickerChange(levelToPicker[newLevel]);}}),_useControllableState2=_slicedToArray(_useControllableState,2),level=_useControllableState2[0],setLevel=_useControllableState2[1];if(__DEV__){if(isRange&&level!=='month'){throwBladeError({message:`Cannot use range DatePicker with pickerType: ${levelToPicker[level]}, Only "day" is supported`,moduleName:'DatePicker'});}}var _React$useState=React__default.useState(null),_React$useState2=_slicedToArray(_React$useState,2),viewDate=_React$useState2[0],setViewDate=_React$useState2[1];var currentDate=React__default.useMemo(function(){if(viewDate){return viewDate;}var isRangeSelection=Array.isArray(selectedValue);if(isRangeSelection&&selectedValue[0]){return selectedValue[0];}if(!isRangeSelection&&selectedValue){return selectedValue;}return shiftTimezone('add',new Date());},[viewDate,selectedValue]);var currentPicker=levelToPicker[level];var onDayClickRef=React__default.useRef(__onDayClick);onDayClickRef.current=__onDayClick;var handleDayPress=React__default.useCallback(function(dateTime){onDayClickRef.current==null?void 0:onDayClickRef.current(new Date(dateTime));},[]);var navigate=function navigate(unit,amount,type){var nextDate=dayjs(currentDate).add(amount,unit).toDate();if(amount>0){onNext==null?void 0:onNext({date:nextDate,type:type});}else {onPrevious==null?void 0:onPrevious({date:nextDate,type:type});}setViewDate(nextDate);};var isDateDisabled=function isDateDisabled(date){var dateObj=date.toDate();if(excludeDate!=null&&excludeDate(dateObj))return true;if(minDate&&date.isBefore(dayjs(minDate),'day'))return true;if(maxDate&&date.isAfter(dayjs(maxDate),'day'))return true;return false;};var monthKey=dayjs(currentDate).format('YYYY-MM');var dayGrid=React__default.useMemo(function(){var monthStart=dayjs(currentDate).startOf('month');var startWeekday=monthStart.day();var offset=(startWeekday-firstDayOfWeek+7)%7;var gridStart=monthStart.subtract(offset,'day');var today=dayjs();var monthIndex=monthStart.month();var weekdays=Array.from({length:7},function(_,i){return dayjs().locale(locale).day((firstDayOfWeek+i)%7).format('ddd');});var cells=Array.from({length:42},function(_,i){var day=gridStart.add(i,'day');return {dateTime:day.valueOf(),dayLabel:day.format('D'),accessibilityLabel:day.locale(locale).format('D MMMM YYYY'),isOutside:day.month()!==monthIndex,isToday:day.isSame(today,'day'),isDisabled:isDateDisabled(day)};});return {weekdays:weekdays,cells:cells};},[monthKey,firstDayOfWeek,locale,minDate,maxDate,excludeDate]);var renderDayGrid=function renderDayGrid(){var weekdays=dayGrid.weekdays,cells=dayGrid.cells;var weeks=Array.from({length:6},function(_,weekIndex){return cells.slice(weekIndex*7,weekIndex*7+7);});return jsxs(BaseBox,{display:"flex",flexDirection:"column",children:[jsx(BaseBox,{display:"flex",flexDirection:"row",marginBottom:"spacing.4",children:weekdays.map(function(weekday,index){return jsx(BaseBox,{flex:1,display:"flex",alignItems:"center",justifyContent:"center",children:jsx(Text,{size:"small",weight:"medium",color:"surface.text.gray.muted",children:weekday})},index);})}),weeks.map(function(week,weekIndex){return jsx(BaseBox,{display:"flex",flexDirection:"row",children:week.map(function(cell){var controlProps=getDayProps(new Date(cell.dateTime));var textColor=DAY_COLORS.default;if(cell.isDisabled){textColor=DAY_COLORS.disabled;}else if(controlProps.selected){textColor=DAY_COLORS.onSelected;}else if(cell.isOutside){textColor=DAY_COLORS.outside;}return jsx(DayGridCell,{dateTime:cell.dateTime,dayLabel:cell.dayLabel,accessibilityLabel:cell.accessibilityLabel,textColor:textColor,isSelected:controlProps.selected,isInRange:controlProps.inRange,isFirstInRange:controlProps.firstInRange,isLastInRange:controlProps.lastInRange,isDisabled:cell.isDisabled,isToday:cell.isToday,onDayPress:handleDayPress},cell.dateTime);})},weekIndex);})]});};var renderMonthGrid=function renderMonthGrid(){var months=Array.from({length:12},function(_,i){return dayjs(currentDate).month(i).startOf('month');});return jsx(BaseBox,{display:"flex",flexDirection:"row",flexWrap:"wrap",children:months.map(function(month){var dateObj=month.toDate();var controlProps=getMonthControlProps(dateObj);var isDisabled=minDate&&month.endOf('month').isBefore(dayjs(minDate),'day')||maxDate&&month.startOf('month').isAfter(dayjs(maxDate),'day')||false;return jsx(ListCell,{isSelected:controlProps.selected,isDisabled:isDisabled,disabled:isDisabled,accessibilityRole:"button",accessibilityState:{selected:controlProps.selected,disabled:isDisabled},accessibilityLabel:controlProps.selected?`${month.locale(locale).format('MMMM YYYY')}, selected`:month.locale(locale).format('MMMM YYYY'),onPress:function onPress(){if(isDisabled)return;onMonthSelect==null?void 0:onMonthSelect(dateObj);setLevel(function(){return 'month';});},children:jsx(Text,{size:"medium",weight:"medium",color:isDisabled?DAY_COLORS.disabled:DAY_COLORS.default,children:month.locale(locale).format('MMM')})},month.format('YYYY-MM'));})});};var renderYearGrid=function renderYearGrid(){var startYearOfDecade=Math.floor(dayjs(currentDate).year()/10)*10;var years=Array.from({length:12},function(_,i){return dayjs(currentDate).year(startYearOfDecade-1+i).startOf('year');});return jsx(BaseBox,{display:"flex",flexDirection:"row",flexWrap:"wrap",children:years.map(function(year){var dateObj=year.toDate();var controlProps=getYearControlProps(dateObj);var isDisabled=minDate&&year.endOf('year').isBefore(dayjs(minDate),'day')||maxDate&&year.startOf('year').isAfter(dayjs(maxDate),'day')||false;return jsx(ListCell,{isSelected:controlProps.selected,isDisabled:isDisabled,disabled:isDisabled,accessibilityRole:"button",accessibilityState:{selected:controlProps.selected,disabled:isDisabled},accessibilityLabel:controlProps.selected?`${year.format('YYYY')}, selected`:year.format('YYYY'),onPress:function onPress(){if(isDisabled)return;onYearSelect==null?void 0:onYearSelect(dateObj);setLevel(function(){return 'year';});},children:jsx(Text,{size:"medium",weight:"medium",color:isDisabled?DAY_COLORS.disabled:DAY_COLORS.default,children:year.format('YYYY')})},year.format('YYYY'));})});};return jsxs(BaseBox,Object.assign({display:"flex",flexDirection:"column",gap:"spacing.7"},metaAttribute({name:MetaConstants.Calendar}),{children:[jsx(CalendarHeader,{date:currentDate,onLevelChange:function onLevelChange(newLevel){return setLevel(function(){return newLevel;});},pickerType:currentPicker,onNextMonth:function onNextMonth(){return navigate('month',1,'month');},onPreviousMonth:function onPreviousMonth(){return navigate('month',-1,'month');},onNextYear:function onNextYear(){return navigate('year',1,'year');},onPreviousYear:function onPreviousYear(){return navigate('year',-1,'year');},onNextDecade:function onNextDecade(){return navigate('year',10,'decade');},onPreviousDecade:function onPreviousDecade(){return navigate('year',-10,'decade');},isRange:isRange,showLevelChangeLink:showLevelChangeLink}),currentPicker==='day'&&renderDayGrid(),currentPicker==='month'&&renderMonthGrid(),currentPicker==='year'&&renderYearGrid()]}));};
|
|
22
|
+
var _this=undefined,_jsxFileName="/home/runner/work/blade/blade/packages/blade/src/components/DatePicker/Calendar.native.tsx";var DAY_COLORS={default:'interactive.text.gray.normal',disabled:'interactive.text.gray.disabled',outside:'interactive.text.gray.muted',onSelected:'interactive.text.onPrimary.normal',today:'interactive.text.primary.normal'};var DAY_CELL_STYLE={aspectRatio:1};var DayGridCell=React__default.memo(function(_ref){var dateTime=_ref.dateTime,dayLabel=_ref.dayLabel,accessibilityLabel=_ref.accessibilityLabel,textColor=_ref.textColor,isSelected=_ref.isSelected,isInRange=_ref.isInRange,isFirstInRange=_ref.isFirstInRange,isLastInRange=_ref.isLastInRange,isDisabled=_ref.isDisabled,isToday=_ref.isToday,onDayPress=_ref.onDayPress;return jsxs(DayCell,{style:DAY_CELL_STYLE,isSelected:isSelected,isInRange:isInRange,isFirstInRange:isFirstInRange,isLastInRange:isLastInRange,isDisabled:isDisabled,disabled:isDisabled,accessibilityRole:"button",accessibilityState:{selected:isSelected,disabled:isDisabled},accessibilityLabel:isSelected?`${accessibilityLabel}, selected`:accessibilityLabel,onPress:function onPress(){if(isDisabled)return;onDayPress(dateTime);},children:[jsx(Text,{size:"medium",color:textColor,children:dayLabel}),isToday?jsx(TodayDot,{isSelected:isSelected}):null]});});var Calendar=function Calendar(_ref2){var _i18nState$locale;var _ref2$firstDayOfWeek=_ref2.firstDayOfWeek,firstDayOfWeek=_ref2$firstDayOfWeek===void 0?1:_ref2$firstDayOfWeek,selectionType=_ref2.selectionType,_ref2$defaultPicker=_ref2.defaultPicker,defaultPicker=_ref2$defaultPicker===void 0?'day':_ref2$defaultPicker,picker=_ref2.picker,onPickerChange=_ref2.onPickerChange,minDate=_ref2.minDate,maxDate=_ref2.maxDate,excludeDate=_ref2.excludeDate,showLevelChangeLink=_ref2.showLevelChangeLink,selectedValue=_ref2.selectedValue,__onDayClick=_ref2.__onDayClick,getDayProps=_ref2.getDayProps,getMonthControlProps=_ref2.getMonthControlProps,getYearControlProps=_ref2.getYearControlProps,onMonthSelect=_ref2.onMonthSelect,onYearSelect=_ref2.onYearSelect,onNext=_ref2.onNext,onPrevious=_ref2.onPrevious;var isRange=selectionType==='range';var _useI18nContext=useI18nContext(),i18nState=_useI18nContext.i18nState;var locale=convertIntlToDayjsLocale((_i18nState$locale=i18nState==null?void 0:i18nState.locale)!=null?_i18nState$locale:'en-IN');var _useControllableState=useControllableState({defaultValue:pickerToLevel[defaultPicker],value:picker?pickerToLevel[picker]:undefined,onChange:function onChange(newLevel){onPickerChange==null?void 0:onPickerChange(levelToPicker[newLevel]);}}),_useControllableState2=_slicedToArray(_useControllableState,2),level=_useControllableState2[0],setLevel=_useControllableState2[1];if(__DEV__){if(isRange&&level!=='month'){throwBladeError({message:`Cannot use range DatePicker with pickerType: ${levelToPicker[level]}, Only "day" is supported`,moduleName:'DatePicker'});}}var _React$useState=React__default.useState(null),_React$useState2=_slicedToArray(_React$useState,2),viewDate=_React$useState2[0],setViewDate=_React$useState2[1];var currentDate=React__default.useMemo(function(){if(viewDate){return viewDate;}var isRangeSelection=Array.isArray(selectedValue);if(isRangeSelection&&selectedValue[0]){return selectedValue[0];}if(!isRangeSelection&&selectedValue){return selectedValue;}return clampDateToRange({date:shiftTimezone('add',new Date()),minDate:minDate,maxDate:maxDate});},[viewDate,selectedValue,minDate,maxDate]);var currentPicker=levelToPicker[level];var onDayClickRef=React__default.useRef(__onDayClick);onDayClickRef.current=__onDayClick;var handleDayPress=React__default.useCallback(function(dateTime){onDayClickRef.current==null?void 0:onDayClickRef.current(new Date(dateTime));},[]);var navigate=function navigate(unit,amount,type){var nextDate=dayjs(currentDate).add(amount,unit).toDate();if(amount>0){onNext==null?void 0:onNext({date:nextDate,type:type});}else {onPrevious==null?void 0:onPrevious({date:nextDate,type:type});}setViewDate(nextDate);};var isDateDisabled=function isDateDisabled(date){var dateObj=date.toDate();if(excludeDate!=null&&excludeDate(dateObj))return true;if(minDate&&date.isBefore(dayjs(minDate),'day'))return true;if(maxDate&&date.isAfter(dayjs(maxDate),'day'))return true;return false;};var monthKey=dayjs(currentDate).format('YYYY-MM');var dayGrid=React__default.useMemo(function(){var monthStart=dayjs(currentDate).startOf('month');var startWeekday=monthStart.day();var offset=(startWeekday-firstDayOfWeek+7)%7;var gridStart=monthStart.subtract(offset,'day');var today=dayjs();var monthIndex=monthStart.month();var weekdays=Array.from({length:7},function(_,i){return dayjs().locale(locale).day((firstDayOfWeek+i)%7).format('ddd');});var cells=Array.from({length:42},function(_,i){var day=gridStart.add(i,'day');return {dateTime:day.valueOf(),dayLabel:day.format('D'),accessibilityLabel:day.locale(locale).format('D MMMM YYYY'),isOutside:day.month()!==monthIndex,isToday:day.isSame(today,'day'),isDisabled:isDateDisabled(day)};});return {weekdays:weekdays,cells:cells};},[monthKey,firstDayOfWeek,locale,minDate,maxDate,excludeDate]);var renderDayGrid=function renderDayGrid(){var weekdays=dayGrid.weekdays,cells=dayGrid.cells;var weeks=Array.from({length:6},function(_,weekIndex){return cells.slice(weekIndex*7,weekIndex*7+7);});return jsxs(BaseBox,{display:"flex",flexDirection:"column",children:[jsx(BaseBox,{display:"flex",flexDirection:"row",marginBottom:"spacing.4",children:weekdays.map(function(weekday,index){return jsx(BaseBox,{flex:1,display:"flex",alignItems:"center",justifyContent:"center",children:jsx(Text,{size:"small",weight:"medium",color:"surface.text.gray.muted",children:weekday})},index);})}),weeks.map(function(week,weekIndex){return jsx(BaseBox,{display:"flex",flexDirection:"row",children:week.map(function(cell){var controlProps=getDayProps(new Date(cell.dateTime));var textColor=DAY_COLORS.default;if(cell.isDisabled){textColor=DAY_COLORS.disabled;}else if(controlProps.selected){textColor=DAY_COLORS.onSelected;}else if(cell.isOutside){textColor=DAY_COLORS.outside;}return jsx(DayGridCell,{dateTime:cell.dateTime,dayLabel:cell.dayLabel,accessibilityLabel:cell.accessibilityLabel,textColor:textColor,isSelected:controlProps.selected,isInRange:controlProps.inRange,isFirstInRange:controlProps.firstInRange,isLastInRange:controlProps.lastInRange,isDisabled:cell.isDisabled,isToday:cell.isToday,onDayPress:handleDayPress},cell.dateTime);})},weekIndex);})]});};var renderMonthGrid=function renderMonthGrid(){var months=Array.from({length:12},function(_,i){return dayjs(currentDate).month(i).startOf('month');});return jsx(BaseBox,{display:"flex",flexDirection:"row",flexWrap:"wrap",children:months.map(function(month){var dateObj=month.toDate();var controlProps=getMonthControlProps(dateObj);var isDisabled=minDate&&month.endOf('month').isBefore(dayjs(minDate),'day')||maxDate&&month.startOf('month').isAfter(dayjs(maxDate),'day')||false;return jsx(ListCell,{isSelected:controlProps.selected,isDisabled:isDisabled,disabled:isDisabled,accessibilityRole:"button",accessibilityState:{selected:controlProps.selected,disabled:isDisabled},accessibilityLabel:controlProps.selected?`${month.locale(locale).format('MMMM YYYY')}, selected`:month.locale(locale).format('MMMM YYYY'),onPress:function onPress(){if(isDisabled)return;onMonthSelect==null?void 0:onMonthSelect(dateObj);setLevel(function(){return 'month';});},children:jsx(Text,{size:"medium",weight:"medium",color:isDisabled?DAY_COLORS.disabled:DAY_COLORS.default,children:month.locale(locale).format('MMM')})},month.format('YYYY-MM'));})});};var renderYearGrid=function renderYearGrid(){var startYearOfDecade=Math.floor(dayjs(currentDate).year()/10)*10;var years=Array.from({length:12},function(_,i){return dayjs(currentDate).year(startYearOfDecade-1+i).startOf('year');});return jsx(BaseBox,{display:"flex",flexDirection:"row",flexWrap:"wrap",children:years.map(function(year){var dateObj=year.toDate();var controlProps=getYearControlProps(dateObj);var isDisabled=minDate&&year.endOf('year').isBefore(dayjs(minDate),'day')||maxDate&&year.startOf('year').isAfter(dayjs(maxDate),'day')||false;return jsx(ListCell,{isSelected:controlProps.selected,isDisabled:isDisabled,disabled:isDisabled,accessibilityRole:"button",accessibilityState:{selected:controlProps.selected,disabled:isDisabled},accessibilityLabel:controlProps.selected?`${year.format('YYYY')}, selected`:year.format('YYYY'),onPress:function onPress(){if(isDisabled)return;onYearSelect==null?void 0:onYearSelect(dateObj);setLevel(function(){return 'year';});},children:jsx(Text,{size:"medium",weight:"medium",color:isDisabled?DAY_COLORS.disabled:DAY_COLORS.default,children:year.format('YYYY')})},year.format('YYYY'));})});};return jsxs(BaseBox,Object.assign({display:"flex",flexDirection:"column",gap:"spacing.7"},metaAttribute({name:MetaConstants.Calendar}),{children:[jsx(CalendarHeader,{date:currentDate,onLevelChange:function onLevelChange(newLevel){return setLevel(function(){return newLevel;});},pickerType:currentPicker,onNextMonth:function onNextMonth(){return navigate('month',1,'month');},onPreviousMonth:function onPreviousMonth(){return navigate('month',-1,'month');},onNextYear:function onNextYear(){return navigate('year',1,'year');},onPreviousYear:function onPreviousYear(){return navigate('year',-1,'year');},onNextDecade:function onNextDecade(){return navigate('year',10,'decade');},onPreviousDecade:function onPreviousDecade(){return navigate('year',-10,'decade');},isRange:isRange,showLevelChangeLink:showLevelChangeLink}),currentPicker==='day'&&renderDayGrid(),currentPicker==='month'&&renderMonthGrid(),currentPicker==='year'&&renderYearGrid()]}));};
|
|
23
23
|
|
|
24
24
|
export { Calendar };
|
|
25
25
|
//# sourceMappingURL=Calendar.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Calendar.native.js","sources":["../../../../../src/components/DatePicker/Calendar.native.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/explicit-function-return-type */\nimport dayjs from 'dayjs';\nimport React from 'react';\nimport { useI18nContext } from '@razorpay/i18nify-react';\nimport type { DayOfWeek } from '@mantine/dates';\nimport type { DateSelectionType, PickerType, DatesRangeValue } from './types';\nimport { CalendarHeader } from './CalendarHeader';\nimport { DayCell, ListCell, TodayDot } from './CalendarStyles.native';\nimport { levelToPicker, pickerToLevel } from './constants';\nimport { shiftTimezone } from './shiftTimezone';\nimport { convertIntlToDayjsLocale } from './utils';\nimport BaseBox from '~components/Box/BaseBox';\nimport { Text } from '~components/Typography';\nimport { useControllableState } from '~utils/useControllable';\nimport { throwBladeError } from '~utils/logger';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\n\ntype CalendarLevel = 'month' | 'year' | 'decade';\ntype NavType = 'month' | 'year' | 'decade';\n\ntype ControlProps = {\n selected: boolean;\n inRange?: boolean;\n firstInRange?: boolean;\n lastInRange?: boolean;\n};\n\n// Native-specific Calendar props. Intentionally separate from shared `CalendarProps`\n// (which is built on `@mantine/dates` DOM types). Only the fields that truly differ\n// on native are redefined here; `firstDayOfWeek` matches the shared `DayOfWeek` type.\ntype CalendarNativeProps<Type extends DateSelectionType> = {\n firstDayOfWeek?: DayOfWeek;\n selectionType?: Type;\n allowSingleDateInRange?: boolean;\n defaultPicker?: PickerType;\n picker?: PickerType;\n onPickerChange?: (picker: PickerType) => void;\n minDate?: Date;\n maxDate?: Date;\n excludeDate?: (date: Date) => boolean;\n showLevelChangeLink?: boolean;\n selectedValue: DatesRangeValue | Date | null;\n // No DOM event on native — date is the only payload.\n __onDayClick?: (date: Date) => void;\n getDayProps: (date: Date) => ControlProps;\n getMonthControlProps: (date: Date) => ControlProps;\n getYearControlProps: (date: Date) => ControlProps;\n onMonthSelect?: (date: Date) => void;\n onYearSelect?: (date: Date) => void;\n onNext?: (data: { date: Date; type: NavType }) => void;\n onPrevious?: (data: { date: Date; type: NavType }) => void;\n};\n\nconst DAY_COLORS = {\n default: 'interactive.text.gray.normal',\n disabled: 'interactive.text.gray.disabled',\n outside: 'interactive.text.gray.muted',\n onSelected: 'interactive.text.onPrimary.normal',\n today: 'interactive.text.primary.normal',\n} as const;\n\n// Hoisted so the same object reference is reused across renders (a new inline\n// `{ aspectRatio: 1 }` on every cell would defeat DayCell memoization).\nconst DAY_CELL_STYLE = { aspectRatio: 1 } as const;\n\ntype DayGridCellProps = {\n dateTime: number;\n dayLabel: string;\n accessibilityLabel: string;\n textColor: string;\n isSelected: boolean;\n isInRange?: boolean;\n isFirstInRange?: boolean;\n isLastInRange?: boolean;\n isDisabled: boolean;\n isToday: boolean;\n onDayPress: (dateTime: number) => void;\n};\n\n/**\n * Memoized single day cell. Tapping a date only changes the selection booleans\n * of the one or two affected cells, so `React.memo` lets every other cell skip\n * re-rendering (and skip the styled-components style recompute + Text render).\n * All props are primitives / a stable callback so the shallow compare is cheap.\n */\nconst DayGridCell = React.memo(\n ({\n dateTime,\n dayLabel,\n accessibilityLabel,\n textColor,\n isSelected,\n isInRange,\n isFirstInRange,\n isLastInRange,\n isDisabled,\n isToday,\n onDayPress,\n }: DayGridCellProps): React.ReactElement => {\n return (\n <DayCell\n style={DAY_CELL_STYLE}\n isSelected={isSelected}\n isInRange={isInRange}\n isFirstInRange={isFirstInRange}\n isLastInRange={isLastInRange}\n isDisabled={isDisabled}\n disabled={isDisabled}\n accessibilityRole=\"button\"\n accessibilityState={{ selected: isSelected, disabled: isDisabled }}\n accessibilityLabel={isSelected ? `${accessibilityLabel}, selected` : accessibilityLabel}\n onPress={() => {\n if (isDisabled) return;\n onDayPress(dateTime);\n }}\n >\n <Text size=\"medium\" color={textColor as never}>\n {dayLabel}\n </Text>\n {isToday ? <TodayDot isSelected={isSelected} /> : null}\n </DayCell>\n );\n },\n);\n\n/**\n * Native calendar. The web version renders `@mantine/dates` `<DatePicker>` (DOM only),\n * so on native the grid is rebuilt by hand with dayjs. Day / month / year levels are\n * supported; range selection visuals are driven by the shared `getControlProps`\n * booleans returned via `getDayProps`. Locale comes from `useI18nContext` (not the\n * web-only `@mantine/dates` `DatesProvider`).\n */\nconst Calendar = <Type extends DateSelectionType>({\n // Monday matches the previous native stub + Razorpay's primary locale (en-IN).\n firstDayOfWeek = 1,\n selectionType,\n defaultPicker = 'day',\n picker,\n onPickerChange,\n minDate,\n maxDate,\n excludeDate,\n showLevelChangeLink,\n selectedValue,\n __onDayClick,\n getDayProps,\n getMonthControlProps,\n getYearControlProps,\n onMonthSelect,\n onYearSelect,\n onNext,\n onPrevious,\n}: CalendarNativeProps<Type>): React.ReactElement => {\n const isRange = selectionType === 'range';\n const { i18nState } = useI18nContext();\n const locale = convertIntlToDayjsLocale(i18nState?.locale ?? 'en-IN');\n\n const [level, setLevel] = useControllableState<CalendarLevel>({\n defaultValue: pickerToLevel[defaultPicker],\n value: picker ? pickerToLevel[picker] : undefined,\n onChange: (newLevel) => {\n onPickerChange?.(levelToPicker[newLevel]);\n },\n });\n\n if (__DEV__) {\n if (isRange && level !== 'month') {\n throwBladeError({\n message: `Cannot use range DatePicker with pickerType: ${levelToPicker[level]}, Only \"day\" is supported`,\n moduleName: 'DatePicker',\n });\n }\n }\n\n const [viewDate, setViewDate] = React.useState<Date | null>(null);\n\n const currentDate = React.useMemo(() => {\n if (viewDate) {\n return viewDate;\n }\n const isRangeSelection = Array.isArray(selectedValue);\n if (isRangeSelection && (selectedValue as DatesRangeValue)[0]) {\n return (selectedValue as DatesRangeValue)[0]!;\n }\n if (!isRangeSelection && selectedValue) {\n return selectedValue;\n }\n return shiftTimezone('add', new Date());\n }, [viewDate, selectedValue]);\n\n const currentPicker = levelToPicker[level] as PickerType;\n\n // Keep a stable day-press handler so memoized `DayGridCell`s don't re-render just\n // because `__onDayClick` (recreated by the parent each render) changed identity.\n const onDayClickRef = React.useRef(__onDayClick);\n onDayClickRef.current = __onDayClick;\n const handleDayPress = React.useCallback((dateTime: number) => {\n onDayClickRef.current?.(new Date(dateTime));\n }, []);\n\n const navigate = (unit: 'month' | 'year', amount: number, type: NavType): void => {\n const nextDate = dayjs(currentDate).add(amount, unit).toDate();\n if (amount > 0) {\n onNext?.({ date: nextDate, type });\n } else {\n onPrevious?.({ date: nextDate, type });\n }\n setViewDate(nextDate);\n };\n\n const isDateDisabled = (date: dayjs.Dayjs): boolean => {\n const dateObj = date.toDate();\n if (excludeDate?.(dateObj)) return true;\n if (minDate && date.isBefore(dayjs(minDate), 'day')) return true;\n if (maxDate && date.isAfter(dayjs(maxDate), 'day')) return true;\n return false;\n };\n\n // Selection-independent day-grid geometry (dates, labels, today/outside/disabled\n // flags, weekday headers). Keyed on the visible month so tapping different days in\n // the same month does NOT rebuild the grid or recreate 42 dayjs objects per render —\n // only the per-cell selection booleans below are recomputed.\n const monthKey = dayjs(currentDate).format('YYYY-MM');\n const dayGrid = React.useMemo(() => {\n const monthStart = dayjs(currentDate).startOf('month');\n const startWeekday = monthStart.day();\n const offset = (startWeekday - firstDayOfWeek + 7) % 7;\n const gridStart = monthStart.subtract(offset, 'day');\n const today = dayjs();\n const monthIndex = monthStart.month();\n\n const weekdays = Array.from({ length: 7 }, (_, i) =>\n dayjs()\n .locale(locale)\n .day((firstDayOfWeek + i) % 7)\n .format('ddd'),\n );\n\n const cells = Array.from({ length: 42 }, (_, i) => {\n const day = gridStart.add(i, 'day');\n return {\n dateTime: day.valueOf(),\n dayLabel: day.format('D'),\n accessibilityLabel: day.locale(locale).format('D MMMM YYYY'),\n isOutside: day.month() !== monthIndex,\n isToday: day.isSame(today, 'day'),\n isDisabled: isDateDisabled(day),\n };\n });\n\n return { weekdays, cells };\n // `monthKey` (not `currentDate`) is the intended dependency — the grid only\n // depends on which month is shown, not the exact selected date.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [monthKey, firstDayOfWeek, locale, minDate, maxDate, excludeDate]);\n\n const renderDayGrid = (): React.ReactElement => {\n const { weekdays, cells } = dayGrid;\n const weeks = Array.from({ length: 6 }, (_, weekIndex) =>\n cells.slice(weekIndex * 7, weekIndex * 7 + 7),\n );\n\n return (\n <BaseBox display=\"flex\" flexDirection=\"column\">\n <BaseBox display=\"flex\" flexDirection=\"row\" marginBottom=\"spacing.4\">\n {weekdays.map((weekday, index) => (\n <BaseBox\n key={index}\n flex={1}\n display=\"flex\"\n alignItems=\"center\"\n justifyContent=\"center\"\n >\n <Text size=\"small\" weight=\"medium\" color=\"surface.text.gray.muted\">\n {weekday}\n </Text>\n </BaseBox>\n ))}\n </BaseBox>\n {weeks.map((week, weekIndex) => (\n <BaseBox key={weekIndex} display=\"flex\" flexDirection=\"row\">\n {week.map((cell) => {\n const controlProps = getDayProps(new Date(cell.dateTime));\n\n // Web parity: the \"today\" cell keeps the DEFAULT number color at rest and\n // only shows the small blue dot beneath (the primary color is applied to the\n // number on :hover, which native has no equivalent of). So `isToday` is\n // intentionally NOT a text-color branch here — see `TodayDot` for the dot.\n let textColor: string = DAY_COLORS.default;\n if (cell.isDisabled) {\n textColor = DAY_COLORS.disabled;\n } else if (controlProps.selected) {\n textColor = DAY_COLORS.onSelected;\n } else if (cell.isOutside) {\n textColor = DAY_COLORS.outside;\n }\n\n return (\n <DayGridCell\n key={cell.dateTime}\n dateTime={cell.dateTime}\n dayLabel={cell.dayLabel}\n accessibilityLabel={cell.accessibilityLabel}\n textColor={textColor}\n isSelected={controlProps.selected}\n isInRange={controlProps.inRange}\n isFirstInRange={controlProps.firstInRange}\n isLastInRange={controlProps.lastInRange}\n isDisabled={cell.isDisabled}\n isToday={cell.isToday}\n onDayPress={handleDayPress}\n />\n );\n })}\n </BaseBox>\n ))}\n </BaseBox>\n );\n };\n\n const renderMonthGrid = (): React.ReactElement => {\n const months = Array.from({ length: 12 }, (_, i) =>\n dayjs(currentDate).month(i).startOf('month'),\n );\n\n return (\n <BaseBox display=\"flex\" flexDirection=\"row\" flexWrap=\"wrap\">\n {months.map((month) => {\n const dateObj = month.toDate();\n const controlProps = getMonthControlProps(dateObj);\n const isDisabled =\n (minDate && month.endOf('month').isBefore(dayjs(minDate), 'day')) ||\n (maxDate && month.startOf('month').isAfter(dayjs(maxDate), 'day')) ||\n false;\n\n return (\n <ListCell\n key={month.format('YYYY-MM')}\n isSelected={controlProps.selected}\n isDisabled={isDisabled}\n disabled={isDisabled}\n accessibilityRole=\"button\"\n accessibilityState={{ selected: controlProps.selected, disabled: isDisabled }}\n accessibilityLabel={\n controlProps.selected\n ? `${month.locale(locale).format('MMMM YYYY')}, selected`\n : month.locale(locale).format('MMMM YYYY')\n }\n onPress={() => {\n if (isDisabled) return;\n onMonthSelect?.(dateObj);\n setLevel(() => 'month');\n }}\n >\n <Text\n size=\"medium\"\n weight=\"medium\"\n color={(isDisabled ? DAY_COLORS.disabled : DAY_COLORS.default) as never}\n >\n {month.locale(locale).format('MMM')}\n </Text>\n </ListCell>\n );\n })}\n </BaseBox>\n );\n };\n\n const renderYearGrid = (): React.ReactElement => {\n const startYearOfDecade = Math.floor(dayjs(currentDate).year() / 10) * 10;\n const years = Array.from({ length: 12 }, (_, i) =>\n dayjs(currentDate)\n .year(startYearOfDecade - 1 + i)\n .startOf('year'),\n );\n\n return (\n <BaseBox display=\"flex\" flexDirection=\"row\" flexWrap=\"wrap\">\n {years.map((year) => {\n const dateObj = year.toDate();\n const controlProps = getYearControlProps(dateObj);\n const isDisabled =\n (minDate && year.endOf('year').isBefore(dayjs(minDate), 'day')) ||\n (maxDate && year.startOf('year').isAfter(dayjs(maxDate), 'day')) ||\n false;\n\n return (\n <ListCell\n key={year.format('YYYY')}\n isSelected={controlProps.selected}\n isDisabled={isDisabled}\n disabled={isDisabled}\n accessibilityRole=\"button\"\n accessibilityState={{ selected: controlProps.selected, disabled: isDisabled }}\n accessibilityLabel={\n controlProps.selected ? `${year.format('YYYY')}, selected` : year.format('YYYY')\n }\n onPress={() => {\n if (isDisabled) return;\n onYearSelect?.(dateObj);\n setLevel(() => 'year');\n }}\n >\n <Text\n size=\"medium\"\n weight=\"medium\"\n color={(isDisabled ? DAY_COLORS.disabled : DAY_COLORS.default) as never}\n >\n {year.format('YYYY')}\n </Text>\n </ListCell>\n );\n })}\n </BaseBox>\n );\n };\n\n return (\n <BaseBox\n display=\"flex\"\n flexDirection=\"column\"\n gap=\"spacing.7\"\n {...metaAttribute({ name: MetaConstants.Calendar })}\n >\n <CalendarHeader\n date={currentDate}\n onLevelChange={(newLevel) => setLevel(() => newLevel as CalendarLevel)}\n pickerType={currentPicker}\n onNextMonth={() => navigate('month', 1, 'month')}\n onPreviousMonth={() => navigate('month', -1, 'month')}\n onNextYear={() => navigate('year', 1, 'year')}\n onPreviousYear={() => navigate('year', -1, 'year')}\n onNextDecade={() => navigate('year', 10, 'decade')}\n onPreviousDecade={() => navigate('year', -10, 'decade')}\n isRange={isRange}\n showLevelChangeLink={showLevelChangeLink}\n />\n {currentPicker === 'day' && renderDayGrid()}\n {currentPicker === 'month' && renderMonthGrid()}\n {currentPicker === 'year' && renderYearGrid()}\n </BaseBox>\n );\n};\n\nexport { Calendar };\n"],"names":["this","DAY_COLORS","default","disabled","outside","onSelected","today","DAY_CELL_STYLE","aspectRatio","DayGridCell","React","memo","_ref","dateTime","dayLabel","accessibilityLabel","textColor","isSelected","isInRange","isFirstInRange","isLastInRange","isDisabled","isToday","onDayPress","_jsxs","DayCell","style","accessibilityRole","accessibilityState","selected","onPress","children","_jsx","Text","size","color","TodayDot","Calendar","_ref2","_i18nState$locale","_ref2$firstDayOfWeek","firstDayOfWeek","selectionType","_ref2$defaultPicker","defaultPicker","picker","onPickerChange","minDate","maxDate","excludeDate","showLevelChangeLink","selectedValue","__onDayClick","getDayProps","getMonthControlProps","getYearControlProps","onMonthSelect","onYearSelect","onNext","onPrevious","isRange","_useI18nContext","useI18nContext","i18nState","locale","convertIntlToDayjsLocale","_useControllableState","useControllableState","defaultValue","pickerToLevel","value","undefined","onChange","newLevel","levelToPicker","_useControllableState2","_slicedToArray","level","setLevel","__DEV__","throwBladeError","message","moduleName","_React$useState","useState","_React$useState2","viewDate","setViewDate","currentDate","useMemo","isRangeSelection","Array","isArray","shiftTimezone","Date","currentPicker","onDayClickRef","useRef","current","handleDayPress","useCallback","navigate","unit","amount","type","nextDate","dayjs","add","toDate","date","isDateDisabled","dateObj","isBefore","isAfter","monthKey","format","dayGrid","monthStart","startOf","startWeekday","day","offset","gridStart","subtract","monthIndex","month","weekdays","from","length","_","i","cells","valueOf","isOutside","isSame","renderDayGrid","weeks","weekIndex","slice","BaseBox","display","flexDirection","marginBottom","map","weekday","index","flex","alignItems","justifyContent","weight","week","cell","controlProps","inRange","firstInRange","lastInRange","renderMonthGrid","months","flexWrap","endOf","ListCell","renderYearGrid","startYearOfDecade","Math","floor","year","years","Object","assign","gap","metaAttribute","name","MetaConstants","CalendarHeader","onLevelChange","pickerType","onNextMonth","onPreviousMonth","onNextYear","onPreviousYear","onNextDecade","onPreviousDecade"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAEA,IAAA,KAAA,CAAAA,SAAA,CAAA,YAAA,CAAA,4FAAA,CAoDA,IAAMC,UAAU,CAAG,CACjBC,OAAO,CAAE,8BAA8B,CACvCC,QAAQ,CAAE,gCAAgC,CAC1CC,OAAO,CAAE,6BAA6B,CACtCC,UAAU,CAAE,mCAAmC,CAC/CC,KAAK,CAAE,iCACT,CAAU,CAIV,IAAMC,cAAc,CAAG,CAAEC,WAAW,CAAE,CAAE,CAAU,CAsBlD,IAAMC,WAAW,CAAGC,cAAK,CAACC,IAAI,CAC5B,SAAAC,IAAA,CAY4C,KAX1CC,QAAQ,CAAAD,IAAA,CAARC,QAAQ,CACRC,QAAQ,CAAAF,IAAA,CAARE,QAAQ,CACRC,kBAAkB,CAAAH,IAAA,CAAlBG,kBAAkB,CAClBC,SAAS,CAAAJ,IAAA,CAATI,SAAS,CACTC,UAAU,CAAAL,IAAA,CAAVK,UAAU,CACVC,SAAS,CAAAN,IAAA,CAATM,SAAS,CACTC,cAAc,CAAAP,IAAA,CAAdO,cAAc,CACdC,aAAa,CAAAR,IAAA,CAAbQ,aAAa,CACbC,UAAU,CAAAT,IAAA,CAAVS,UAAU,CACVC,OAAO,CAAAV,IAAA,CAAPU,OAAO,CACPC,UAAU,CAAAX,IAAA,CAAVW,UAAU,CAEV,OACEC,IAAA,CAAC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CAAE,CAAC,CAAE,MAAM,CAAC,CAAC,CAAA,CAC9C8E,cAAc,CAAE,SAAhBA,cAAcA,EAAA,CAAA,OAAQ9E,QAAQ,CAAC,MAAM,CAAE,CAAC,CAAC,CAAE,MAAM,CAAC,CAAA,CAAC,CACnD+E,YAAY,CAAE,SAAdA,YAAYA,EAAQ,CAAA,OAAA/E,QAAQ,CAAC,MAAM,CAAE,EAAE,CAAE,QAAQ,CAAC,CAAA,CAAC,CACnDgF,gBAAgB,CAAE,SAAlBA,gBAAgBA,EAAQ,CAAA,OAAAhF,QAAQ,CAAC,MAAM,CAAE,CAAC,EAAE,CAAE,QAAQ,CAAC,CAAC,CAAA,CACxDzC,OAAO,CAAEA,OAAQ,CACjBV,mBAAmB,CAAEA,mBAAoB,CAC1C,CAAC,CACD6C,aAAa,GAAK,KAAK,EAAIwC,aAAa,EAAE,CAC1CxC,aAAa,GAAK,OAAO,EAAI6D,eAAe,EAAE,CAC9C7D,aAAa,GAAK,MAAM,EAAIkE,cAAc,EAAE,CAAA,CAAA,CACtC,CAAC,CAEd;;;;"}
|
|
1
|
+
{"version":3,"file":"Calendar.native.js","sources":["../../../../../src/components/DatePicker/Calendar.native.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/explicit-function-return-type */\nimport dayjs from 'dayjs';\nimport React from 'react';\nimport { useI18nContext } from '@razorpay/i18nify-react';\nimport type { DayOfWeek } from '@mantine/dates';\nimport type { DateSelectionType, PickerType, DatesRangeValue } from './types';\nimport { CalendarHeader } from './CalendarHeader';\nimport { DayCell, ListCell, TodayDot } from './CalendarStyles.native';\nimport { levelToPicker, pickerToLevel } from './constants';\nimport { shiftTimezone } from './shiftTimezone';\nimport { convertIntlToDayjsLocale, clampDateToRange } from './utils';\nimport BaseBox from '~components/Box/BaseBox';\nimport { Text } from '~components/Typography';\nimport { useControllableState } from '~utils/useControllable';\nimport { throwBladeError } from '~utils/logger';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\n\ntype CalendarLevel = 'month' | 'year' | 'decade';\ntype NavType = 'month' | 'year' | 'decade';\n\ntype ControlProps = {\n selected: boolean;\n inRange?: boolean;\n firstInRange?: boolean;\n lastInRange?: boolean;\n};\n\n// Native-specific Calendar props. Intentionally separate from shared `CalendarProps`\n// (which is built on `@mantine/dates` DOM types). Only the fields that truly differ\n// on native are redefined here; `firstDayOfWeek` matches the shared `DayOfWeek` type.\ntype CalendarNativeProps<Type extends DateSelectionType> = {\n firstDayOfWeek?: DayOfWeek;\n selectionType?: Type;\n allowSingleDateInRange?: boolean;\n defaultPicker?: PickerType;\n picker?: PickerType;\n onPickerChange?: (picker: PickerType) => void;\n minDate?: Date;\n maxDate?: Date;\n excludeDate?: (date: Date) => boolean;\n showLevelChangeLink?: boolean;\n selectedValue: DatesRangeValue | Date | null;\n // No DOM event on native — date is the only payload.\n __onDayClick?: (date: Date) => void;\n getDayProps: (date: Date) => ControlProps;\n getMonthControlProps: (date: Date) => ControlProps;\n getYearControlProps: (date: Date) => ControlProps;\n onMonthSelect?: (date: Date) => void;\n onYearSelect?: (date: Date) => void;\n onNext?: (data: { date: Date; type: NavType }) => void;\n onPrevious?: (data: { date: Date; type: NavType }) => void;\n};\n\nconst DAY_COLORS = {\n default: 'interactive.text.gray.normal',\n disabled: 'interactive.text.gray.disabled',\n outside: 'interactive.text.gray.muted',\n onSelected: 'interactive.text.onPrimary.normal',\n today: 'interactive.text.primary.normal',\n} as const;\n\n// Hoisted so the same object reference is reused across renders (a new inline\n// `{ aspectRatio: 1 }` on every cell would defeat DayCell memoization).\nconst DAY_CELL_STYLE = { aspectRatio: 1 } as const;\n\ntype DayGridCellProps = {\n dateTime: number;\n dayLabel: string;\n accessibilityLabel: string;\n textColor: string;\n isSelected: boolean;\n isInRange?: boolean;\n isFirstInRange?: boolean;\n isLastInRange?: boolean;\n isDisabled: boolean;\n isToday: boolean;\n onDayPress: (dateTime: number) => void;\n};\n\n/**\n * Memoized single day cell. Tapping a date only changes the selection booleans\n * of the one or two affected cells, so `React.memo` lets every other cell skip\n * re-rendering (and skip the styled-components style recompute + Text render).\n * All props are primitives / a stable callback so the shallow compare is cheap.\n */\nconst DayGridCell = React.memo(\n ({\n dateTime,\n dayLabel,\n accessibilityLabel,\n textColor,\n isSelected,\n isInRange,\n isFirstInRange,\n isLastInRange,\n isDisabled,\n isToday,\n onDayPress,\n }: DayGridCellProps): React.ReactElement => {\n return (\n <DayCell\n style={DAY_CELL_STYLE}\n isSelected={isSelected}\n isInRange={isInRange}\n isFirstInRange={isFirstInRange}\n isLastInRange={isLastInRange}\n isDisabled={isDisabled}\n disabled={isDisabled}\n accessibilityRole=\"button\"\n accessibilityState={{ selected: isSelected, disabled: isDisabled }}\n accessibilityLabel={isSelected ? `${accessibilityLabel}, selected` : accessibilityLabel}\n onPress={() => {\n if (isDisabled) return;\n onDayPress(dateTime);\n }}\n >\n <Text size=\"medium\" color={textColor as never}>\n {dayLabel}\n </Text>\n {isToday ? <TodayDot isSelected={isSelected} /> : null}\n </DayCell>\n );\n },\n);\n\n/**\n * Native calendar. The web version renders `@mantine/dates` `<DatePicker>` (DOM only),\n * so on native the grid is rebuilt by hand with dayjs. Day / month / year levels are\n * supported; range selection visuals are driven by the shared `getControlProps`\n * booleans returned via `getDayProps`. Locale comes from `useI18nContext` (not the\n * web-only `@mantine/dates` `DatesProvider`).\n */\nconst Calendar = <Type extends DateSelectionType>({\n // Monday matches the previous native stub + Razorpay's primary locale (en-IN).\n firstDayOfWeek = 1,\n selectionType,\n defaultPicker = 'day',\n picker,\n onPickerChange,\n minDate,\n maxDate,\n excludeDate,\n showLevelChangeLink,\n selectedValue,\n __onDayClick,\n getDayProps,\n getMonthControlProps,\n getYearControlProps,\n onMonthSelect,\n onYearSelect,\n onNext,\n onPrevious,\n}: CalendarNativeProps<Type>): React.ReactElement => {\n const isRange = selectionType === 'range';\n const { i18nState } = useI18nContext();\n const locale = convertIntlToDayjsLocale(i18nState?.locale ?? 'en-IN');\n\n const [level, setLevel] = useControllableState<CalendarLevel>({\n defaultValue: pickerToLevel[defaultPicker],\n value: picker ? pickerToLevel[picker] : undefined,\n onChange: (newLevel) => {\n onPickerChange?.(levelToPicker[newLevel]);\n },\n });\n\n if (__DEV__) {\n if (isRange && level !== 'month') {\n throwBladeError({\n message: `Cannot use range DatePicker with pickerType: ${levelToPicker[level]}, Only \"day\" is supported`,\n moduleName: 'DatePicker',\n });\n }\n }\n\n const [viewDate, setViewDate] = React.useState<Date | null>(null);\n\n const currentDate = React.useMemo(() => {\n if (viewDate) {\n return viewDate;\n }\n const isRangeSelection = Array.isArray(selectedValue);\n if (isRangeSelection && (selectedValue as DatesRangeValue)[0]) {\n return (selectedValue as DatesRangeValue)[0]!;\n }\n if (!isRangeSelection && selectedValue) {\n return selectedValue;\n }\n // When nothing is selected, open on today's month clamped into the [minDate, maxDate]\n // range so the calendar doesn't land on a month where every date is disabled.\n return clampDateToRange({\n date: shiftTimezone('add', new Date()),\n minDate,\n maxDate,\n });\n }, [viewDate, selectedValue, minDate, maxDate]);\n\n const currentPicker = levelToPicker[level] as PickerType;\n\n // Keep a stable day-press handler so memoized `DayGridCell`s don't re-render just\n // because `__onDayClick` (recreated by the parent each render) changed identity.\n const onDayClickRef = React.useRef(__onDayClick);\n onDayClickRef.current = __onDayClick;\n const handleDayPress = React.useCallback((dateTime: number) => {\n onDayClickRef.current?.(new Date(dateTime));\n }, []);\n\n const navigate = (unit: 'month' | 'year', amount: number, type: NavType): void => {\n const nextDate = dayjs(currentDate).add(amount, unit).toDate();\n if (amount > 0) {\n onNext?.({ date: nextDate, type });\n } else {\n onPrevious?.({ date: nextDate, type });\n }\n setViewDate(nextDate);\n };\n\n const isDateDisabled = (date: dayjs.Dayjs): boolean => {\n const dateObj = date.toDate();\n if (excludeDate?.(dateObj)) return true;\n if (minDate && date.isBefore(dayjs(minDate), 'day')) return true;\n if (maxDate && date.isAfter(dayjs(maxDate), 'day')) return true;\n return false;\n };\n\n // Selection-independent day-grid geometry (dates, labels, today/outside/disabled\n // flags, weekday headers). Keyed on the visible month so tapping different days in\n // the same month does NOT rebuild the grid or recreate 42 dayjs objects per render —\n // only the per-cell selection booleans below are recomputed.\n const monthKey = dayjs(currentDate).format('YYYY-MM');\n const dayGrid = React.useMemo(() => {\n const monthStart = dayjs(currentDate).startOf('month');\n const startWeekday = monthStart.day();\n const offset = (startWeekday - firstDayOfWeek + 7) % 7;\n const gridStart = monthStart.subtract(offset, 'day');\n const today = dayjs();\n const monthIndex = monthStart.month();\n\n const weekdays = Array.from({ length: 7 }, (_, i) =>\n dayjs()\n .locale(locale)\n .day((firstDayOfWeek + i) % 7)\n .format('ddd'),\n );\n\n const cells = Array.from({ length: 42 }, (_, i) => {\n const day = gridStart.add(i, 'day');\n return {\n dateTime: day.valueOf(),\n dayLabel: day.format('D'),\n accessibilityLabel: day.locale(locale).format('D MMMM YYYY'),\n isOutside: day.month() !== monthIndex,\n isToday: day.isSame(today, 'day'),\n isDisabled: isDateDisabled(day),\n };\n });\n\n return { weekdays, cells };\n // `monthKey` (not `currentDate`) is the intended dependency — the grid only\n // depends on which month is shown, not the exact selected date.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [monthKey, firstDayOfWeek, locale, minDate, maxDate, excludeDate]);\n\n const renderDayGrid = (): React.ReactElement => {\n const { weekdays, cells } = dayGrid;\n const weeks = Array.from({ length: 6 }, (_, weekIndex) =>\n cells.slice(weekIndex * 7, weekIndex * 7 + 7),\n );\n\n return (\n <BaseBox display=\"flex\" flexDirection=\"column\">\n <BaseBox display=\"flex\" flexDirection=\"row\" marginBottom=\"spacing.4\">\n {weekdays.map((weekday, index) => (\n <BaseBox\n key={index}\n flex={1}\n display=\"flex\"\n alignItems=\"center\"\n justifyContent=\"center\"\n >\n <Text size=\"small\" weight=\"medium\" color=\"surface.text.gray.muted\">\n {weekday}\n </Text>\n </BaseBox>\n ))}\n </BaseBox>\n {weeks.map((week, weekIndex) => (\n <BaseBox key={weekIndex} display=\"flex\" flexDirection=\"row\">\n {week.map((cell) => {\n const controlProps = getDayProps(new Date(cell.dateTime));\n\n // Web parity: the \"today\" cell keeps the DEFAULT number color at rest and\n // only shows the small blue dot beneath (the primary color is applied to the\n // number on :hover, which native has no equivalent of). So `isToday` is\n // intentionally NOT a text-color branch here — see `TodayDot` for the dot.\n let textColor: string = DAY_COLORS.default;\n if (cell.isDisabled) {\n textColor = DAY_COLORS.disabled;\n } else if (controlProps.selected) {\n textColor = DAY_COLORS.onSelected;\n } else if (cell.isOutside) {\n textColor = DAY_COLORS.outside;\n }\n\n return (\n <DayGridCell\n key={cell.dateTime}\n dateTime={cell.dateTime}\n dayLabel={cell.dayLabel}\n accessibilityLabel={cell.accessibilityLabel}\n textColor={textColor}\n isSelected={controlProps.selected}\n isInRange={controlProps.inRange}\n isFirstInRange={controlProps.firstInRange}\n isLastInRange={controlProps.lastInRange}\n isDisabled={cell.isDisabled}\n isToday={cell.isToday}\n onDayPress={handleDayPress}\n />\n );\n })}\n </BaseBox>\n ))}\n </BaseBox>\n );\n };\n\n const renderMonthGrid = (): React.ReactElement => {\n const months = Array.from({ length: 12 }, (_, i) =>\n dayjs(currentDate).month(i).startOf('month'),\n );\n\n return (\n <BaseBox display=\"flex\" flexDirection=\"row\" flexWrap=\"wrap\">\n {months.map((month) => {\n const dateObj = month.toDate();\n const controlProps = getMonthControlProps(dateObj);\n const isDisabled =\n (minDate && month.endOf('month').isBefore(dayjs(minDate), 'day')) ||\n (maxDate && month.startOf('month').isAfter(dayjs(maxDate), 'day')) ||\n false;\n\n return (\n <ListCell\n key={month.format('YYYY-MM')}\n isSelected={controlProps.selected}\n isDisabled={isDisabled}\n disabled={isDisabled}\n accessibilityRole=\"button\"\n accessibilityState={{ selected: controlProps.selected, disabled: isDisabled }}\n accessibilityLabel={\n controlProps.selected\n ? `${month.locale(locale).format('MMMM YYYY')}, selected`\n : month.locale(locale).format('MMMM YYYY')\n }\n onPress={() => {\n if (isDisabled) return;\n onMonthSelect?.(dateObj);\n setLevel(() => 'month');\n }}\n >\n <Text\n size=\"medium\"\n weight=\"medium\"\n color={(isDisabled ? DAY_COLORS.disabled : DAY_COLORS.default) as never}\n >\n {month.locale(locale).format('MMM')}\n </Text>\n </ListCell>\n );\n })}\n </BaseBox>\n );\n };\n\n const renderYearGrid = (): React.ReactElement => {\n const startYearOfDecade = Math.floor(dayjs(currentDate).year() / 10) * 10;\n const years = Array.from({ length: 12 }, (_, i) =>\n dayjs(currentDate)\n .year(startYearOfDecade - 1 + i)\n .startOf('year'),\n );\n\n return (\n <BaseBox display=\"flex\" flexDirection=\"row\" flexWrap=\"wrap\">\n {years.map((year) => {\n const dateObj = year.toDate();\n const controlProps = getYearControlProps(dateObj);\n const isDisabled =\n (minDate && year.endOf('year').isBefore(dayjs(minDate), 'day')) ||\n (maxDate && year.startOf('year').isAfter(dayjs(maxDate), 'day')) ||\n false;\n\n return (\n <ListCell\n key={year.format('YYYY')}\n isSelected={controlProps.selected}\n isDisabled={isDisabled}\n disabled={isDisabled}\n accessibilityRole=\"button\"\n accessibilityState={{ selected: controlProps.selected, disabled: isDisabled }}\n accessibilityLabel={\n controlProps.selected ? `${year.format('YYYY')}, selected` : year.format('YYYY')\n }\n onPress={() => {\n if (isDisabled) return;\n onYearSelect?.(dateObj);\n setLevel(() => 'year');\n }}\n >\n <Text\n size=\"medium\"\n weight=\"medium\"\n color={(isDisabled ? DAY_COLORS.disabled : DAY_COLORS.default) as never}\n >\n {year.format('YYYY')}\n </Text>\n </ListCell>\n );\n })}\n </BaseBox>\n );\n };\n\n return (\n <BaseBox\n display=\"flex\"\n flexDirection=\"column\"\n gap=\"spacing.7\"\n {...metaAttribute({ name: MetaConstants.Calendar })}\n >\n <CalendarHeader\n date={currentDate}\n onLevelChange={(newLevel) => setLevel(() => newLevel as CalendarLevel)}\n pickerType={currentPicker}\n onNextMonth={() => navigate('month', 1, 'month')}\n onPreviousMonth={() => navigate('month', -1, 'month')}\n onNextYear={() => navigate('year', 1, 'year')}\n onPreviousYear={() => navigate('year', -1, 'year')}\n onNextDecade={() => navigate('year', 10, 'decade')}\n onPreviousDecade={() => navigate('year', -10, 'decade')}\n isRange={isRange}\n showLevelChangeLink={showLevelChangeLink}\n />\n {currentPicker === 'day' && renderDayGrid()}\n {currentPicker === 'month' && renderMonthGrid()}\n {currentPicker === 'year' && renderYearGrid()}\n </BaseBox>\n );\n};\n\nexport { Calendar };\n"],"names":["this","DAY_COLORS","default","disabled","outside","onSelected","today","DAY_CELL_STYLE","aspectRatio","DayGridCell","React","memo","_ref","dateTime","dayLabel","accessibilityLabel","textColor","isSelected","isInRange","isFirstInRange","isLastInRange","isDisabled","isToday","onDayPress","_jsxs","DayCell","style","accessibilityRole","accessibilityState","selected","onPress","children","_jsx","Text","size","color","TodayDot","Calendar","_ref2","_i18nState$locale","_ref2$firstDayOfWeek","firstDayOfWeek","selectionType","_ref2$defaultPicker","defaultPicker","picker","onPickerChange","minDate","maxDate","excludeDate","showLevelChangeLink","selectedValue","__onDayClick","getDayProps","getMonthControlProps","getYearControlProps","onMonthSelect","onYearSelect","onNext","onPrevious","isRange","_useI18nContext","useI18nContext","i18nState","locale","convertIntlToDayjsLocale","_useControllableState","useControllableState","defaultValue","pickerToLevel","value","undefined","onChange","newLevel","levelToPicker","_useControllableState2","_slicedToArray","level","setLevel","__DEV__","throwBladeError","message","moduleName","_React$useState","useState","_React$useState2","viewDate","setViewDate","currentDate","useMemo","isRangeSelection","Array","isArray","clampDateToRange","date","shiftTimezone","Date","currentPicker","onDayClickRef","useRef","current","handleDayPress","useCallback","navigate","unit","amount","type","nextDate","dayjs","add","toDate","isDateDisabled","dateObj","isBefore","isAfter","monthKey","format","dayGrid","monthStart","startOf","startWeekday","day","offset","gridStart","subtract","monthIndex","month","weekdays","from","length","_","i","cells","valueOf","isOutside","isSame","renderDayGrid","weeks","weekIndex","slice","BaseBox","display","flexDirection","marginBottom","map","weekday","index","flex","alignItems","justifyContent","weight","week","cell","controlProps","inRange","firstInRange","lastInRange","renderMonthGrid","months","flexWrap","endOf","ListCell","renderYearGrid","startYearOfDecade","Math","floor","year","years","Object","assign","gap","metaAttribute","name","MetaConstants","CalendarHeader","onLevelChange","pickerType","onNextMonth","onPreviousMonth","onNextYear","onPreviousYear","onNextDecade","onPreviousDecade"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAEA,IAAA,KAAA,CAAAA,SAAA,CAAA,YAAA,CAAA,4FAAA,CAoDA,IAAMC,UAAU,CAAG,CACjBC,OAAO,CAAE,8BAA8B,CACvCC,QAAQ,CAAE,gCAAgC,CAC1CC,OAAO,CAAE,6BAA6B,CACtCC,UAAU,CAAE,mCAAmC,CAC/CC,KAAK,CAAE,iCACT,CAAU,CAIV,IAAMC,cAAc,CAAG,CAAEC,WAAW,CAAE,CAAE,CAAU,CAsBlD,IAAMC,WAAW,CAAGC,cAAK,CAACC,IAAI,CAC5B,SAAAC,IAAA,CAY4C,CAX1C,IAAAC,QAAQ,CAAAD,IAAA,CAARC,QAAQ,CACRC,QAAQ,CAAAF,IAAA,CAARE,QAAQ,CACRC,kBAAkB,CAAAH,IAAA,CAAlBG,kBAAkB,CAClBC,SAAS,CAAAJ,IAAA,CAATI,SAAS,CACTC,UAAU,CAAAL,IAAA,CAAVK,UAAU,CACVC,SAAS,CAAAN,IAAA,CAATM,SAAS,CACTC,cAAc,CAAAP,IAAA,CAAdO,cAAc,CACdC,aAAa,CAAAR,IAAA,CAAbQ,aAAa,CACbC,UAAU,CAAAT,IAAA,CAAVS,UAAU,CACVC,OAAO,CAAAV,IAAA,CAAPU,OAAO,CACPC,UAAU,CAAAX,IAAA,CAAVW,UAAU,CAEV,OACEC,IAAA,CAACC,OAAO,CACNC,CAAAA,KAAK,CAAEnB,cAAe,CACtBU,UAAU,CAAEA,UAAW,CACvBC,SAAS,CAAEA,SAAU,CACrBC,cAAc,CAAEA,cAAe,CAC/BC,aAAa,CAAEA,aAAc,CAC7BC,UAAU,CAAEA,UAAW,CACvBlB,QA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