@razorpay/blade 12.110.0 → 12.119.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/spark/colorama-center-gradient-map-dark.jpg +0 -0
- package/assets/spark/colorama-gradient-map-dark.png +0 -0
- package/build/lib/native/components/AnimateInteractions/AnimateInteractions.native.js +5 -5
- package/build/lib/native/components/AnimateInteractions/AnimateInteractions.native.js.map +1 -1
- package/build/lib/native/components/AnimateInteractions/AnimateInteractionsProvider.js +6 -0
- package/build/lib/native/components/AnimateInteractions/AnimateInteractionsProvider.js.map +1 -0
- package/build/lib/native/components/BaseMotion/BaseMotion.native.js +22 -0
- package/build/lib/native/components/BaseMotion/BaseMotion.native.js.map +1 -0
- package/build/lib/native/components/BaseMotion/baseMotionInterpreter.native.js +11 -0
- package/build/lib/native/components/BaseMotion/baseMotionInterpreter.native.js.map +1 -0
- package/build/lib/native/components/BaseMotion/baseMotionUtils.js +4 -0
- package/build/lib/native/components/BaseMotion/baseMotionUtils.js.map +1 -0
- package/build/lib/native/components/BaseMotion/index.js +3 -0
- package/build/lib/native/components/BaseMotion/index.js.map +1 -0
- package/build/lib/native/components/BaseMotion/types.js +2 -0
- package/build/lib/native/components/BaseMotion/types.js.map +1 -0
- package/build/lib/native/components/Button/BaseButton/BaseButton.js +3 -3
- package/build/lib/native/components/Button/BaseButton/BaseButton.js.map +1 -1
- package/build/lib/native/components/Button/BaseButton/buttonTokens.js +1 -1
- package/build/lib/native/components/Button/BaseButton/buttonTokens.js.map +1 -1
- package/build/lib/native/components/Charts/AreaChart/AreaChart.native.js +2 -1
- package/build/lib/native/components/Charts/AreaChart/AreaChart.native.js.map +1 -1
- package/build/lib/native/components/Charts/CommonChartComponents/CommonChartComponents.native.js +2 -2
- package/build/lib/native/components/Charts/CommonChartComponents/CommonChartComponents.native.js.map +1 -1
- package/build/lib/native/components/Charts/CommonChartComponents/index.js +1 -1
- package/build/lib/native/components/Charts/CommonChartComponents/tokens.js +2 -2
- package/build/lib/native/components/Charts/CommonChartComponents/tokens.js.map +1 -1
- package/build/lib/native/components/Charts/LineChart/LineChart.native.js +4 -2
- package/build/lib/native/components/Charts/LineChart/LineChart.native.js.map +1 -1
- package/build/lib/native/components/Charts/utils/nullBridgeUtils.js +4 -0
- package/build/lib/native/components/Charts/utils/nullBridgeUtils.js.map +1 -0
- package/build/lib/native/components/Charts/utils/referenceBandUtils.js +6 -0
- package/build/lib/native/components/Charts/utils/referenceBandUtils.js.map +1 -0
- package/build/lib/native/components/CounterInput/CounterInput.native.js +3 -2
- package/build/lib/native/components/CounterInput/CounterInput.native.js.map +1 -1
- package/build/lib/native/components/CounterInput/token.js +2 -2
- package/build/lib/native/components/CounterInput/token.js.map +1 -1
- package/build/lib/native/components/DatePicker/Calendar.native.js +2 -2
- package/build/lib/native/components/DatePicker/Calendar.native.js.map +1 -1
- package/build/lib/native/components/DatePicker/utils.js +2 -2
- package/build/lib/native/components/DatePicker/utils.js.map +1 -1
- package/build/lib/native/components/Dropdown/Dropdown.js +1 -1
- package/build/lib/native/components/Dropdown/Dropdown.js.map +1 -1
- package/build/lib/native/components/Dropdown/FilterChipSelectInput.native.js +2 -1
- package/build/lib/native/components/Dropdown/FilterChipSelectInput.native.js.map +1 -1
- package/build/lib/native/components/Dropdown/dropdownUtils.js +1 -1
- package/build/lib/native/components/Dropdown/dropdownUtils.js.map +1 -1
- package/build/lib/native/components/Dropdown/filterChipSelectInputUtils.js +4 -0
- package/build/lib/native/components/Dropdown/filterChipSelectInputUtils.js.map +1 -0
- package/build/lib/native/components/Dropdown/useDropdown.js +1 -1
- package/build/lib/native/components/Dropdown/useDropdown.js.map +1 -1
- package/build/lib/native/components/Fade/Fade.native.js +7 -5
- package/build/lib/native/components/Fade/Fade.native.js.map +1 -1
- package/build/lib/native/components/FilterChip/BaseFilterChip.native.js +2 -2
- package/build/lib/native/components/FilterChip/BaseFilterChip.native.js.map +1 -1
- package/build/lib/native/components/FloatingActionButton/FloatingActionButton.js +14 -0
- package/build/lib/native/components/FloatingActionButton/FloatingActionButton.js.map +1 -0
- package/build/lib/native/components/FloatingActionButton/FloatingActionButtonContainer.native.js +20 -0
- package/build/lib/native/components/FloatingActionButton/FloatingActionButtonContainer.native.js.map +1 -0
- package/build/lib/native/components/FloatingActionButton/index.js +2 -0
- package/build/lib/native/components/FloatingActionButton/index.js.map +1 -0
- package/build/lib/native/components/GenUI/GenUIContext.native.js +2 -2
- package/build/lib/native/components/GenUI/GenUIContext.native.js.map +1 -1
- package/build/lib/native/components/GenUI/index.js +1 -1
- package/build/lib/native/components/Icons/BookmarkFilledIcon/BookmarkFilledIcon.js +14 -0
- package/build/lib/native/components/Icons/BookmarkFilledIcon/BookmarkFilledIcon.js.map +1 -0
- package/build/lib/native/components/Icons/BookmarkFilledIcon/index.js +2 -0
- package/build/lib/native/components/Icons/BookmarkFilledIcon/index.js.map +1 -0
- package/build/lib/native/components/Icons/index.js +1 -0
- package/build/lib/native/components/Icons/index.js.map +1 -1
- package/build/lib/native/components/Input/BaseInput/StyledBaseInput.native.js +1 -1
- package/build/lib/native/components/Input/BaseInput/StyledBaseInput.native.js.map +1 -1
- package/build/lib/native/components/Input/OTPInput/OTPInput.js +1 -1
- package/build/lib/native/components/Input/OTPInput/OTPInput.js.map +1 -1
- package/build/lib/native/components/Morph/Morph.native.js +9 -5
- package/build/lib/native/components/Morph/Morph.native.js.map +1 -1
- package/build/lib/native/components/Move/Move.native.js +8 -5
- package/build/lib/native/components/Move/Move.native.js.map +1 -1
- package/build/lib/native/components/Scale/Scale.native.js +7 -5
- package/build/lib/native/components/Scale/Scale.native.js.map +1 -1
- package/build/lib/native/components/SegmentedControl/SegmentedControl.native.js +27 -0
- package/build/lib/native/components/SegmentedControl/SegmentedControl.native.js.map +1 -0
- package/build/lib/native/components/SegmentedControl/SegmentedControlContext.js +8 -0
- package/build/lib/native/components/SegmentedControl/SegmentedControlContext.js.map +1 -0
- package/build/lib/native/components/SegmentedControl/SegmentedControlItem.native.js +18 -0
- package/build/lib/native/components/SegmentedControl/SegmentedControlItem.native.js.map +1 -0
- package/build/lib/native/components/SegmentedControl/index.js +3 -0
- package/build/lib/native/components/SegmentedControl/index.js.map +1 -0
- package/build/lib/native/components/SegmentedControl/segmentedControlTokens.js +4 -0
- package/build/lib/native/components/SegmentedControl/segmentedControlTokens.js.map +1 -0
- package/build/lib/native/components/Slide/Slide.native.js +7 -5
- package/build/lib/native/components/Slide/Slide.native.js.map +1 -1
- package/build/lib/native/components/Spark/RzpGlass/utils.native.js +1 -1
- package/build/lib/native/components/Spark/RzpGlass/utils.native.js.map +1 -1
- package/build/lib/native/components/Stagger/Stagger.native.js +10 -5
- package/build/lib/native/components/Stagger/Stagger.native.js.map +1 -1
- package/build/lib/native/components/Stagger/StaggerProvider.js +6 -0
- package/build/lib/native/components/Stagger/StaggerProvider.js.map +1 -0
- package/build/lib/native/components/TreeView/TreeView.native.js +4 -0
- package/build/lib/native/components/TreeView/TreeView.native.js.map +1 -0
- package/build/lib/native/components/TreeView/index.native.js +2 -0
- package/build/lib/native/components/TreeView/index.native.js.map +1 -0
- package/build/lib/native/components/index.js +10 -2
- package/build/lib/native/components/index.js.map +1 -1
- package/build/lib/native/tokens/global/colors.js +1 -1
- package/build/lib/native/tokens/global/colors.js.map +1 -1
- package/build/lib/native/tokens/index.js +1 -0
- package/build/lib/native/tokens/index.js.map +1 -1
- package/build/lib/native/tokens/theme/bladeNeutralTheme.js +15 -0
- package/build/lib/native/tokens/theme/bladeNeutralTheme.js.map +1 -0
- package/build/lib/native/tokens/theme/bladeTheme.js +1 -1
- package/build/lib/native/tokens/theme/bladeTheme.js.map +1 -1
- package/build/lib/native/tokens/theme/index.js +1 -0
- package/build/lib/native/tokens/theme/index.js.map +1 -1
- package/build/lib/native/tokens/theme/theme.js.map +1 -1
- package/build/lib/native/utils/componentZIndices.js +1 -1
- package/build/lib/native/utils/componentZIndices.js.map +1 -1
- package/build/lib/native/utils/metaAttribute/metaConstants.js +1 -1
- package/build/lib/native/utils/metaAttribute/metaConstants.js.map +1 -1
- package/build/lib/native/utils/msToSeconds.js +4 -0
- package/build/lib/native/utils/msToSeconds.js.map +1 -0
- package/build/lib/native/utils/useControlledDropdownInput/useControlledDropdownInput.js +1 -1
- package/build/lib/native/utils/useControlledDropdownInput/useControlledDropdownInput.js.map +1 -1
- package/build/lib/web/development/_virtual/flatten.js +1 -1
- package/build/lib/web/development/_virtual/flatten3.js +1 -1
- package/build/lib/web/development/components/AnimateInteractions/AnimateInteractions.web.js +1 -1
- package/build/lib/web/development/components/AnimateInteractions/AnimateInteractionsProvider.js +2 -1
- package/build/lib/web/development/components/AnimateInteractions/AnimateInteractionsProvider.js.map +1 -1
- package/build/lib/web/development/components/AnimateInteractions/{useFocusWithin.js → useFocusWithin.web.js} +1 -1
- package/build/lib/web/development/components/AnimateInteractions/useFocusWithin.web.js.map +1 -0
- package/build/lib/web/development/components/Button/BaseButton/BaseButton.js +124 -73
- package/build/lib/web/development/components/Button/BaseButton/BaseButton.js.map +1 -1
- package/build/lib/web/development/components/Button/BaseButton/buttonTokens.js +68 -2
- package/build/lib/web/development/components/Button/BaseButton/buttonTokens.js.map +1 -1
- package/build/lib/web/development/components/Charts/AreaChart/AreaChart.web.js +206 -18
- package/build/lib/web/development/components/Charts/AreaChart/AreaChart.web.js.map +1 -1
- package/build/lib/web/development/components/Charts/CommonChartComponents/CommonChartComponents.web.js +159 -43
- package/build/lib/web/development/components/Charts/CommonChartComponents/CommonChartComponents.web.js.map +1 -1
- package/build/lib/web/development/components/Charts/CommonChartComponents/index.js +1 -1
- package/build/lib/web/development/components/Charts/CommonChartComponents/tokens.js +15 -2
- package/build/lib/web/development/components/Charts/CommonChartComponents/tokens.js.map +1 -1
- package/build/lib/web/development/components/Charts/LineChart/LineChart.web.js +272 -15
- package/build/lib/web/development/components/Charts/LineChart/LineChart.web.js.map +1 -1
- package/build/lib/web/development/components/Charts/LineChart/useReferenceBand.js +195 -0
- package/build/lib/web/development/components/Charts/LineChart/useReferenceBand.js.map +1 -0
- package/build/lib/web/development/components/Charts/utils/nullBridgeUtils.js +175 -0
- package/build/lib/web/development/components/Charts/utils/nullBridgeUtils.js.map +1 -0
- package/build/lib/web/development/components/Charts/utils/referenceBandUtils.js +66 -0
- package/build/lib/web/development/components/Charts/utils/referenceBandUtils.js.map +1 -0
- package/build/lib/web/development/components/CounterInput/CounterInput.web.js +29 -5
- package/build/lib/web/development/components/CounterInput/CounterInput.web.js.map +1 -1
- package/build/lib/web/development/components/CounterInput/StyledCounterInput.js +20 -4
- package/build/lib/web/development/components/CounterInput/StyledCounterInput.js.map +1 -1
- package/build/lib/web/development/components/CounterInput/token.js +6 -1
- package/build/lib/web/development/components/CounterInput/token.js.map +1 -1
- package/build/lib/web/development/components/DatePicker/BaseDatePicker.web.js +28 -1
- package/build/lib/web/development/components/DatePicker/BaseDatePicker.web.js.map +1 -1
- package/build/lib/web/development/components/DatePicker/Calendar.web.js +9 -2
- package/build/lib/web/development/components/DatePicker/Calendar.web.js.map +1 -1
- package/build/lib/web/development/components/DatePicker/FilterChipDatePicker/DatePickerFilterChip.web.js +4 -1
- package/build/lib/web/development/components/DatePicker/FilterChipDatePicker/DatePickerFilterChip.web.js.map +1 -1
- package/build/lib/web/development/components/DatePicker/utils.js +21 -1
- package/build/lib/web/development/components/DatePicker/utils.js.map +1 -1
- package/build/lib/web/development/components/Dropdown/Dropdown.js +4 -1
- package/build/lib/web/development/components/Dropdown/Dropdown.js.map +1 -1
- package/build/lib/web/development/components/Dropdown/FilterChipGroup.web.js +40 -5
- package/build/lib/web/development/components/Dropdown/FilterChipGroup.web.js.map +1 -1
- package/build/lib/web/development/components/Dropdown/FilterChipSelectInput.web.js +30 -32
- package/build/lib/web/development/components/Dropdown/FilterChipSelectInput.web.js.map +1 -1
- package/build/lib/web/development/components/Dropdown/dropdownUtils.js +28 -2
- package/build/lib/web/development/components/Dropdown/dropdownUtils.js.map +1 -1
- package/build/lib/web/development/components/Dropdown/filterChipSelectInputUtils.js +60 -0
- package/build/lib/web/development/components/Dropdown/filterChipSelectInputUtils.js.map +1 -0
- package/build/lib/web/development/components/Dropdown/useDropdown.js +91 -5
- package/build/lib/web/development/components/Dropdown/useDropdown.js.map +1 -1
- package/build/lib/web/development/components/FilterChip/BaseFilterChip.web.js +35 -11
- package/build/lib/web/development/components/FilterChip/BaseFilterChip.web.js.map +1 -1
- package/build/lib/web/development/components/FloatingActionButton/FloatingActionButton.js +126 -0
- package/build/lib/web/development/components/FloatingActionButton/FloatingActionButton.js.map +1 -0
- package/build/lib/web/development/components/FloatingActionButton/FloatingActionButtonContainer.web.js +45 -0
- package/build/lib/web/development/components/FloatingActionButton/FloatingActionButtonContainer.web.js.map +1 -0
- package/build/lib/web/development/components/FloatingActionButton/index.js +2 -0
- package/build/lib/web/development/components/FloatingActionButton/index.js.map +1 -0
- package/build/lib/web/development/components/GenUI/GenUIComponents.web.js.map +1 -1
- package/build/lib/web/development/components/GenUI/GenUIContext.web.js +9 -1
- package/build/lib/web/development/components/GenUI/GenUIContext.web.js.map +1 -1
- package/build/lib/web/development/components/GenUI/GenUIProvider.web.js +17 -0
- package/build/lib/web/development/components/GenUI/GenUIProvider.web.js.map +1 -1
- package/build/lib/web/development/components/GenUI/GenUISchemaRenderer.web.js +31 -6
- package/build/lib/web/development/components/GenUI/GenUISchemaRenderer.web.js.map +1 -1
- package/build/lib/web/development/components/GenUI/index.js +1 -1
- package/build/lib/web/development/components/Icons/BookmarkFilledIcon/BookmarkFilledIcon.js +44 -0
- package/build/lib/web/development/components/Icons/BookmarkFilledIcon/BookmarkFilledIcon.js.map +1 -0
- package/build/lib/web/development/components/Icons/BookmarkFilledIcon/index.js +2 -0
- package/build/lib/web/development/components/Icons/BookmarkFilledIcon/index.js.map +1 -0
- package/build/lib/web/development/components/Icons/index.js +1 -0
- package/build/lib/web/development/components/Icons/index.js.map +1 -1
- package/build/lib/web/development/components/Input/OTPInput/OTPInput.js +3 -0
- package/build/lib/web/development/components/Input/OTPInput/OTPInput.js.map +1 -1
- package/build/lib/web/development/components/PopupArrow/PopupArrow.web.js +7 -1
- package/build/lib/web/development/components/PopupArrow/PopupArrow.web.js.map +1 -1
- package/build/lib/web/development/components/RollingText/RollingText.web.js +27 -20
- package/build/lib/web/development/components/RollingText/RollingText.web.js.map +1 -1
- package/build/lib/web/development/components/SegmentedControl/SegmentedControl.web.js +196 -0
- package/build/lib/web/development/components/SegmentedControl/SegmentedControl.web.js.map +1 -0
- package/build/lib/web/development/components/SegmentedControl/SegmentedControlContext.js +18 -0
- package/build/lib/web/development/components/SegmentedControl/SegmentedControlContext.js.map +1 -0
- package/build/lib/web/development/components/SegmentedControl/SegmentedControlIndicator.web.js +109 -0
- package/build/lib/web/development/components/SegmentedControl/SegmentedControlIndicator.web.js.map +1 -0
- package/build/lib/web/development/components/SegmentedControl/SegmentedControlItem.web.js +170 -0
- package/build/lib/web/development/components/SegmentedControl/SegmentedControlItem.web.js.map +1 -0
- package/build/lib/web/development/components/SegmentedControl/index.js +3 -0
- package/build/lib/web/development/components/SegmentedControl/index.js.map +1 -0
- package/build/lib/web/development/components/SegmentedControl/segmentedControlTokens.js +53 -0
- package/build/lib/web/development/components/SegmentedControl/segmentedControlTokens.js.map +1 -0
- package/build/lib/web/development/components/Spark/RzpGlass/RzpGlass.js +16 -7
- package/build/lib/web/development/components/Spark/RzpGlass/RzpGlass.js.map +1 -1
- package/build/lib/web/development/components/Spark/RzpGlass/RzpGlassMount.js +24 -6
- package/build/lib/web/development/components/Spark/RzpGlass/RzpGlassMount.js.map +1 -1
- package/build/lib/web/development/components/Spark/RzpGlass/presets.js +30 -1
- package/build/lib/web/development/components/Spark/RzpGlass/presets.js.map +1 -1
- package/build/lib/web/development/components/Spark/RzpGlass/rzpGlassShader.js +1 -1
- package/build/lib/web/development/components/Spark/RzpGlass/rzpGlassShader.js.map +1 -1
- package/build/lib/web/development/components/Spark/RzpGlass/utils.js +26 -10
- package/build/lib/web/development/components/Spark/RzpGlass/utils.js.map +1 -1
- package/build/lib/web/development/components/SpotlightPopoverTour/Tour.web.js +31 -18
- package/build/lib/web/development/components/SpotlightPopoverTour/Tour.web.js.map +1 -1
- package/build/lib/web/development/components/SpotlightPopoverTour/TourMask.web.js +14 -3
- package/build/lib/web/development/components/SpotlightPopoverTour/TourMask.web.js.map +1 -1
- package/build/lib/web/development/components/SpotlightPopoverTour/TourPopover.web.js +23 -4
- package/build/lib/web/development/components/SpotlightPopoverTour/TourPopover.web.js.map +1 -1
- package/build/lib/web/development/components/SpotlightPopoverTour/utils.js +58 -1
- package/build/lib/web/development/components/SpotlightPopoverTour/utils.js.map +1 -1
- package/build/lib/web/development/components/Stagger/StaggerProvider.js.map +1 -1
- package/build/lib/web/development/components/TreeView/StyledTreeViewRow.web.js +41 -0
- package/build/lib/web/development/components/TreeView/StyledTreeViewRow.web.js.map +1 -0
- package/build/lib/web/development/components/TreeView/TreeView.web.js +696 -0
- package/build/lib/web/development/components/TreeView/TreeView.web.js.map +1 -0
- package/build/lib/web/development/components/TreeView/TreeViewAnimator.web.js +184 -0
- package/build/lib/web/development/components/TreeView/TreeViewAnimator.web.js.map +1 -0
- package/build/lib/web/development/components/TreeView/TreeViewChevron.web.js +73 -0
- package/build/lib/web/development/components/TreeView/TreeViewChevron.web.js.map +1 -0
- package/build/lib/web/development/components/TreeView/TreeViewItem.web.js +295 -0
- package/build/lib/web/development/components/TreeView/TreeViewItem.web.js.map +1 -0
- package/build/lib/web/development/components/TreeView/TreeViewLoadMore.web.js +173 -0
- package/build/lib/web/development/components/TreeView/TreeViewLoadMore.web.js.map +1 -0
- package/build/lib/web/development/components/TreeView/componentIds.js +8 -0
- package/build/lib/web/development/components/TreeView/componentIds.js.map +1 -0
- package/build/lib/web/development/components/TreeView/index.web.js +4 -0
- package/build/lib/web/development/components/TreeView/index.web.js.map +1 -0
- package/build/lib/web/development/components/TreeView/treeViewUtils.js +475 -0
- package/build/lib/web/development/components/TreeView/treeViewUtils.js.map +1 -0
- package/build/lib/web/development/components/TreeView/useTreeView.js +24 -0
- package/build/lib/web/development/components/TreeView/useTreeView.js.map +1 -0
- package/build/lib/web/development/components/index.js +12 -2
- package/build/lib/web/development/components/index.js.map +1 -1
- package/build/lib/web/development/node_modules/es-toolkit/dist/array/flatten.js +1 -1
- package/build/lib/web/development/node_modules/es-toolkit/dist/compat/array/flatten.js +1 -1
- package/build/lib/web/development/node_modules/es-toolkit/dist/compat/array/sortBy.js +2 -2
- package/build/lib/web/development/node_modules/es-toolkit/dist/compat/object/omit.js +2 -2
- package/build/lib/web/development/tokens/global/colors.js +2 -2
- package/build/lib/web/development/tokens/global/colors.js.map +1 -1
- package/build/lib/web/development/tokens/index.js +1 -0
- package/build/lib/web/development/tokens/index.js.map +1 -1
- package/build/lib/web/development/tokens/theme/bladeNeutralTheme.js +1439 -0
- package/build/lib/web/development/tokens/theme/bladeNeutralTheme.js.map +1 -0
- package/build/lib/web/development/tokens/theme/bladeTheme.js +48 -12
- package/build/lib/web/development/tokens/theme/bladeTheme.js.map +1 -1
- package/build/lib/web/development/tokens/theme/index.js +1 -0
- package/build/lib/web/development/tokens/theme/index.js.map +1 -1
- package/build/lib/web/development/tokens/theme/theme.js.map +1 -1
- package/build/lib/web/development/utils/componentZIndices.js +2 -0
- package/build/lib/web/development/utils/componentZIndices.js.map +1 -1
- package/build/lib/web/development/utils/metaAttribute/metaConstants.js +7 -1
- package/build/lib/web/development/utils/metaAttribute/metaConstants.js.map +1 -1
- package/build/lib/web/development/utils/useControlledDropdownInput/useControlledDropdownInput.js +12 -4
- package/build/lib/web/development/utils/useControlledDropdownInput/useControlledDropdownInput.js.map +1 -1
- package/build/lib/web/development/utils/useTruncationTitle/useTruncationTitle.web.js +2 -2
- package/build/lib/web/development/utils/useTruncationTitle/useTruncationTitle.web.js.map +1 -1
- package/build/lib/web/production/_virtual/flatten.js +1 -1
- package/build/lib/web/production/_virtual/flatten3.js +1 -1
- package/build/lib/web/production/components/AnimateInteractions/AnimateInteractions.web.js +1 -1
- package/build/lib/web/production/components/AnimateInteractions/AnimateInteractionsProvider.js +2 -1
- package/build/lib/web/production/components/AnimateInteractions/AnimateInteractionsProvider.js.map +1 -1
- package/build/lib/web/production/components/AnimateInteractions/{useFocusWithin.js → useFocusWithin.web.js} +1 -1
- package/build/lib/web/production/components/AnimateInteractions/useFocusWithin.web.js.map +1 -0
- package/build/lib/web/production/components/Button/BaseButton/BaseButton.js +124 -73
- package/build/lib/web/production/components/Button/BaseButton/BaseButton.js.map +1 -1
- package/build/lib/web/production/components/Button/BaseButton/buttonTokens.js +68 -2
- package/build/lib/web/production/components/Button/BaseButton/buttonTokens.js.map +1 -1
- package/build/lib/web/production/components/Charts/AreaChart/AreaChart.web.js +206 -18
- package/build/lib/web/production/components/Charts/AreaChart/AreaChart.web.js.map +1 -1
- package/build/lib/web/production/components/Charts/CommonChartComponents/CommonChartComponents.web.js +159 -43
- package/build/lib/web/production/components/Charts/CommonChartComponents/CommonChartComponents.web.js.map +1 -1
- package/build/lib/web/production/components/Charts/CommonChartComponents/index.js +1 -1
- package/build/lib/web/production/components/Charts/CommonChartComponents/tokens.js +15 -2
- package/build/lib/web/production/components/Charts/CommonChartComponents/tokens.js.map +1 -1
- package/build/lib/web/production/components/Charts/LineChart/LineChart.web.js +272 -15
- package/build/lib/web/production/components/Charts/LineChart/LineChart.web.js.map +1 -1
- package/build/lib/web/production/components/Charts/LineChart/useReferenceBand.js +195 -0
- package/build/lib/web/production/components/Charts/LineChart/useReferenceBand.js.map +1 -0
- package/build/lib/web/production/components/Charts/utils/nullBridgeUtils.js +175 -0
- package/build/lib/web/production/components/Charts/utils/nullBridgeUtils.js.map +1 -0
- package/build/lib/web/production/components/Charts/utils/referenceBandUtils.js +66 -0
- package/build/lib/web/production/components/Charts/utils/referenceBandUtils.js.map +1 -0
- package/build/lib/web/production/components/CounterInput/CounterInput.web.js +29 -5
- package/build/lib/web/production/components/CounterInput/CounterInput.web.js.map +1 -1
- package/build/lib/web/production/components/CounterInput/StyledCounterInput.js +20 -4
- package/build/lib/web/production/components/CounterInput/StyledCounterInput.js.map +1 -1
- package/build/lib/web/production/components/CounterInput/token.js +6 -1
- package/build/lib/web/production/components/CounterInput/token.js.map +1 -1
- package/build/lib/web/production/components/DatePicker/BaseDatePicker.web.js +28 -1
- package/build/lib/web/production/components/DatePicker/BaseDatePicker.web.js.map +1 -1
- package/build/lib/web/production/components/DatePicker/Calendar.web.js +9 -2
- package/build/lib/web/production/components/DatePicker/Calendar.web.js.map +1 -1
- package/build/lib/web/production/components/DatePicker/FilterChipDatePicker/DatePickerFilterChip.web.js +4 -1
- package/build/lib/web/production/components/DatePicker/FilterChipDatePicker/DatePickerFilterChip.web.js.map +1 -1
- package/build/lib/web/production/components/DatePicker/utils.js +21 -1
- package/build/lib/web/production/components/DatePicker/utils.js.map +1 -1
- package/build/lib/web/production/components/Dropdown/Dropdown.js +4 -1
- package/build/lib/web/production/components/Dropdown/Dropdown.js.map +1 -1
- package/build/lib/web/production/components/Dropdown/FilterChipGroup.web.js +40 -5
- package/build/lib/web/production/components/Dropdown/FilterChipGroup.web.js.map +1 -1
- package/build/lib/web/production/components/Dropdown/FilterChipSelectInput.web.js +30 -32
- package/build/lib/web/production/components/Dropdown/FilterChipSelectInput.web.js.map +1 -1
- package/build/lib/web/production/components/Dropdown/dropdownUtils.js +28 -2
- package/build/lib/web/production/components/Dropdown/dropdownUtils.js.map +1 -1
- package/build/lib/web/production/components/Dropdown/filterChipSelectInputUtils.js +60 -0
- package/build/lib/web/production/components/Dropdown/filterChipSelectInputUtils.js.map +1 -0
- package/build/lib/web/production/components/Dropdown/useDropdown.js +91 -5
- package/build/lib/web/production/components/Dropdown/useDropdown.js.map +1 -1
- package/build/lib/web/production/components/FilterChip/BaseFilterChip.web.js +35 -11
- package/build/lib/web/production/components/FilterChip/BaseFilterChip.web.js.map +1 -1
- package/build/lib/web/production/components/FloatingActionButton/FloatingActionButton.js +126 -0
- package/build/lib/web/production/components/FloatingActionButton/FloatingActionButton.js.map +1 -0
- package/build/lib/web/production/components/FloatingActionButton/FloatingActionButtonContainer.web.js +45 -0
- package/build/lib/web/production/components/FloatingActionButton/FloatingActionButtonContainer.web.js.map +1 -0
- package/build/lib/web/production/components/FloatingActionButton/index.js +2 -0
- package/build/lib/web/production/components/FloatingActionButton/index.js.map +1 -0
- package/build/lib/web/production/components/GenUI/GenUIComponents.web.js.map +1 -1
- package/build/lib/web/production/components/GenUI/GenUIContext.web.js +9 -1
- package/build/lib/web/production/components/GenUI/GenUIContext.web.js.map +1 -1
- package/build/lib/web/production/components/GenUI/GenUIProvider.web.js +17 -0
- package/build/lib/web/production/components/GenUI/GenUIProvider.web.js.map +1 -1
- package/build/lib/web/production/components/GenUI/GenUISchemaRenderer.web.js +31 -6
- package/build/lib/web/production/components/GenUI/GenUISchemaRenderer.web.js.map +1 -1
- package/build/lib/web/production/components/GenUI/index.js +1 -1
- package/build/lib/web/production/components/Icons/BookmarkFilledIcon/BookmarkFilledIcon.js +44 -0
- package/build/lib/web/production/components/Icons/BookmarkFilledIcon/BookmarkFilledIcon.js.map +1 -0
- package/build/lib/web/production/components/Icons/BookmarkFilledIcon/index.js +2 -0
- package/build/lib/web/production/components/Icons/BookmarkFilledIcon/index.js.map +1 -0
- package/build/lib/web/production/components/Icons/index.js +1 -0
- package/build/lib/web/production/components/Icons/index.js.map +1 -1
- package/build/lib/web/production/components/Input/OTPInput/OTPInput.js +3 -0
- package/build/lib/web/production/components/Input/OTPInput/OTPInput.js.map +1 -1
- package/build/lib/web/production/components/PopupArrow/PopupArrow.web.js +7 -1
- package/build/lib/web/production/components/PopupArrow/PopupArrow.web.js.map +1 -1
- package/build/lib/web/production/components/RollingText/RollingText.web.js +27 -20
- package/build/lib/web/production/components/RollingText/RollingText.web.js.map +1 -1
- package/build/lib/web/production/components/SegmentedControl/SegmentedControl.web.js +196 -0
- package/build/lib/web/production/components/SegmentedControl/SegmentedControl.web.js.map +1 -0
- package/build/lib/web/production/components/SegmentedControl/SegmentedControlContext.js +18 -0
- package/build/lib/web/production/components/SegmentedControl/SegmentedControlContext.js.map +1 -0
- package/build/lib/web/production/components/SegmentedControl/SegmentedControlIndicator.web.js +109 -0
- package/build/lib/web/production/components/SegmentedControl/SegmentedControlIndicator.web.js.map +1 -0
- package/build/lib/web/production/components/SegmentedControl/SegmentedControlItem.web.js +170 -0
- package/build/lib/web/production/components/SegmentedControl/SegmentedControlItem.web.js.map +1 -0
- package/build/lib/web/production/components/SegmentedControl/index.js +3 -0
- package/build/lib/web/production/components/SegmentedControl/index.js.map +1 -0
- package/build/lib/web/production/components/SegmentedControl/segmentedControlTokens.js +53 -0
- package/build/lib/web/production/components/SegmentedControl/segmentedControlTokens.js.map +1 -0
- package/build/lib/web/production/components/Spark/RzpGlass/RzpGlass.js +16 -7
- package/build/lib/web/production/components/Spark/RzpGlass/RzpGlass.js.map +1 -1
- package/build/lib/web/production/components/Spark/RzpGlass/RzpGlassMount.js +24 -6
- package/build/lib/web/production/components/Spark/RzpGlass/RzpGlassMount.js.map +1 -1
- package/build/lib/web/production/components/Spark/RzpGlass/presets.js +30 -1
- package/build/lib/web/production/components/Spark/RzpGlass/presets.js.map +1 -1
- package/build/lib/web/production/components/Spark/RzpGlass/rzpGlassShader.js +1 -1
- package/build/lib/web/production/components/Spark/RzpGlass/rzpGlassShader.js.map +1 -1
- package/build/lib/web/production/components/Spark/RzpGlass/utils.js +26 -10
- package/build/lib/web/production/components/Spark/RzpGlass/utils.js.map +1 -1
- package/build/lib/web/production/components/SpotlightPopoverTour/Tour.web.js +31 -18
- package/build/lib/web/production/components/SpotlightPopoverTour/Tour.web.js.map +1 -1
- package/build/lib/web/production/components/SpotlightPopoverTour/TourMask.web.js +14 -3
- package/build/lib/web/production/components/SpotlightPopoverTour/TourMask.web.js.map +1 -1
- package/build/lib/web/production/components/SpotlightPopoverTour/TourPopover.web.js +23 -4
- package/build/lib/web/production/components/SpotlightPopoverTour/TourPopover.web.js.map +1 -1
- package/build/lib/web/production/components/SpotlightPopoverTour/utils.js +58 -1
- package/build/lib/web/production/components/SpotlightPopoverTour/utils.js.map +1 -1
- package/build/lib/web/production/components/Stagger/StaggerProvider.js.map +1 -1
- package/build/lib/web/production/components/TreeView/StyledTreeViewRow.web.js +41 -0
- package/build/lib/web/production/components/TreeView/StyledTreeViewRow.web.js.map +1 -0
- package/build/lib/web/production/components/TreeView/TreeView.web.js +696 -0
- package/build/lib/web/production/components/TreeView/TreeView.web.js.map +1 -0
- package/build/lib/web/production/components/TreeView/TreeViewAnimator.web.js +184 -0
- package/build/lib/web/production/components/TreeView/TreeViewAnimator.web.js.map +1 -0
- package/build/lib/web/production/components/TreeView/TreeViewChevron.web.js +73 -0
- package/build/lib/web/production/components/TreeView/TreeViewChevron.web.js.map +1 -0
- package/build/lib/web/production/components/TreeView/TreeViewItem.web.js +295 -0
- package/build/lib/web/production/components/TreeView/TreeViewItem.web.js.map +1 -0
- package/build/lib/web/production/components/TreeView/TreeViewLoadMore.web.js +173 -0
- package/build/lib/web/production/components/TreeView/TreeViewLoadMore.web.js.map +1 -0
- package/build/lib/web/production/components/TreeView/componentIds.js +8 -0
- package/build/lib/web/production/components/TreeView/componentIds.js.map +1 -0
- package/build/lib/web/production/components/TreeView/index.web.js +4 -0
- package/build/lib/web/production/components/TreeView/index.web.js.map +1 -0
- package/build/lib/web/production/components/TreeView/treeViewUtils.js +475 -0
- package/build/lib/web/production/components/TreeView/treeViewUtils.js.map +1 -0
- package/build/lib/web/production/components/TreeView/useTreeView.js +24 -0
- package/build/lib/web/production/components/TreeView/useTreeView.js.map +1 -0
- package/build/lib/web/production/components/index.js +12 -2
- package/build/lib/web/production/components/index.js.map +1 -1
- package/build/lib/web/production/node_modules/es-toolkit/dist/array/flatten.js +1 -1
- package/build/lib/web/production/node_modules/es-toolkit/dist/compat/array/flatten.js +1 -1
- package/build/lib/web/production/node_modules/es-toolkit/dist/compat/array/sortBy.js +2 -2
- package/build/lib/web/production/node_modules/es-toolkit/dist/compat/object/omit.js +2 -2
- package/build/lib/web/production/tokens/global/colors.js +2 -2
- package/build/lib/web/production/tokens/global/colors.js.map +1 -1
- package/build/lib/web/production/tokens/index.js +1 -0
- package/build/lib/web/production/tokens/index.js.map +1 -1
- package/build/lib/web/production/tokens/theme/bladeNeutralTheme.js +1439 -0
- package/build/lib/web/production/tokens/theme/bladeNeutralTheme.js.map +1 -0
- package/build/lib/web/production/tokens/theme/bladeTheme.js +48 -12
- package/build/lib/web/production/tokens/theme/bladeTheme.js.map +1 -1
- package/build/lib/web/production/tokens/theme/index.js +1 -0
- package/build/lib/web/production/tokens/theme/index.js.map +1 -1
- package/build/lib/web/production/tokens/theme/theme.js.map +1 -1
- package/build/lib/web/production/utils/componentZIndices.js +2 -0
- package/build/lib/web/production/utils/componentZIndices.js.map +1 -1
- package/build/lib/web/production/utils/metaAttribute/metaConstants.js +7 -1
- package/build/lib/web/production/utils/metaAttribute/metaConstants.js.map +1 -1
- package/build/lib/web/production/utils/useControlledDropdownInput/useControlledDropdownInput.js +12 -4
- package/build/lib/web/production/utils/useControlledDropdownInput/useControlledDropdownInput.js.map +1 -1
- package/build/lib/web/production/utils/useTruncationTitle/useTruncationTitle.web.js +2 -2
- package/build/lib/web/production/utils/useTruncationTitle/useTruncationTitle.web.js.map +1 -1
- package/build/types/components/index.d.ts +794 -25
- package/build/types/components/index.native.d.ts +872 -29
- package/build/types/tokens/index.d.ts +11 -4
- package/build/types/tokens/index.native.d.ts +11 -4
- package/build/types/utils/index.d.ts +8 -3
- package/build/types/utils/index.native.d.ts +8 -3
- package/package.json +2 -2
- package/build/lib/web/development/components/AnimateInteractions/useFocusWithin.js.map +0 -1
- package/build/lib/web/production/components/AnimateInteractions/useFocusWithin.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseFilterChip.native.js","sources":["../../../../../src/components/FilterChip/BaseFilterChip.native.tsx"],"sourcesContent":["import React from 'react';\nimport { Pressable, StyleSheet, View } from 'react-native';\nimport type { LayoutChangeEvent, GestureResponderEvent } from 'react-native';\nimport styled from 'styled-components/native';\nimport Svg, { Rect } from 'react-native-svg';\nimport type { BaseFilterChipProps } from './types';\nimport { size } from '~tokens/global';\nimport { makeBorderSize } from '~utils';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\nimport { Box } from '~components/Box';\nimport { Counter } from '~components/Counter';\nimport { Divider } from '~components/Divider';\nimport { ChevronDownIcon, CloseIcon } from '~components/Icons';\nimport { Text } from '~components/Typography';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { useTheme } from '~components/BladeProvider';\nimport type { Theme } from '~components/BladeProvider';\n\nconst FILTER_CHIP_HEIGHT_NATIVE = size['28'];\n\n/**\n * React Native's `borderStyle: 'dashed'` combined with `borderRadius` is buggy on iOS —\n * dashes render inconsistently and produce a broken/overlapping artifact near the corners\n * and the right edge. To match web's clean dashed pill, we draw the dashed border ourselves\n * with `react-native-svg` as a rounded `Rect` whose dash pattern divides evenly around the\n * perimeter (so there's no visible seam where the stroke path closes).\n */\nconst DashedBorder = ({\n width,\n height,\n borderRadius,\n strokeWidth,\n color,\n}: {\n width: number;\n height: number;\n borderRadius: number;\n strokeWidth: number;\n color: string;\n}): React.ReactElement | null => {\n if (width <= 0 || height <= 0) {\n return null;\n }\n\n // Inset the stroke by half its width so it sits fully inside the bounds and the\n // right/bottom edges aren't clipped.\n const inset = strokeWidth / 2;\n const rectWidth = width - strokeWidth;\n const rectHeight = height - strokeWidth;\n const radius = Math.max(borderRadius - inset, 0);\n\n // Perimeter of a rounded rectangle = straight edges + the four quarter-circle corners.\n const straightWidth = Math.max(rectWidth - 2 * radius, 0);\n const straightHeight = Math.max(rectHeight - 2 * radius, 0);\n const perimeter = 2 * straightWidth + 2 * straightHeight + 2 * Math.PI * radius;\n\n // Target a small dot-like dash+gap (~4pt) and round to an integer number of segments so\n // the pattern lands exactly on the path's start/end point (no broken dash on the right edge).\n const targetSegment = 4;\n const segmentCount = Math.max(1, Math.round(perimeter / targetSegment));\n const segmentLength = perimeter / segmentCount;\n const dashLength = segmentLength / 2;\n\n return (\n <View style={StyleSheet.absoluteFill} pointerEvents=\"none\">\n <Svg width={width} height={height}>\n <Rect\n x={inset}\n y={inset}\n width={rectWidth}\n height={rectHeight}\n rx={radius}\n ry={radius}\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeDasharray={[dashLength, segmentLength - dashLength]}\n />\n </Svg>\n </View>\n );\n};\n\nconst StyledFilterChip = styled(View)<{\n theme: Theme;\n $isSelected?: boolean;\n $isDisabled?: boolean;\n}>(({ theme, $isDisabled, $isSelected }) => {\n return {\n // When unselected the dashed border is drawn via an SVG overlay (see DashedBorder) so we\n // rely on it entirely: the native border has zero width, keeping the overlay's coordinate\n // space aligned with the border-box and avoiding iOS's buggy dashed+radius render.\n borderWidth: $isSelected ? makeBorderSize(theme.border.width.thin) : 0,\n borderColor: $isSelected\n ? theme.colors.interactive.border.gray[$isDisabled ? 'disabled' : 'faded']\n : 'transparent',\n height: FILTER_CHIP_HEIGHT_NATIVE,\n borderRadius: theme.border.radius.small,\n borderStyle: 'solid',\n backgroundColor: theme.colors.surface.background.gray.intense,\n flexDirection: 'row',\n alignSelf: 'flex-start',\n // The SVG dashed border must not be clipped when unselected; the selected state clips its\n // divider/close button to the rounded corners.\n overflow: $isSelected ? 'hidden' : 'visible',\n };\n});\n\nconst StyledFilterTrigger = styled(Pressable)<{\n theme: Theme;\n $isSelected?: boolean;\n}>(({ theme, $isSelected }) => {\n const { spacing } = theme;\n return {\n backgroundColor: 'transparent',\n borderRadius: $isSelected ? 0 : theme.border.radius.small,\n borderTopLeftRadius: theme.border.radius.small,\n borderBottomLeftRadius: theme.border.radius.small,\n paddingLeft: spacing[4],\n paddingRight: $isSelected ? spacing[2] : spacing[3],\n flexDirection: 'row',\n alignItems: 'center',\n height: '100%',\n gap: spacing[2],\n };\n});\n\nconst StyledFilterCloseButton = styled(Pressable)<{ theme: Theme }>(({ theme }) => {\n return {\n backgroundColor: 'transparent',\n borderTopRightRadius: theme.border.radius.small,\n borderBottomRightRadius: theme.border.radius.small,\n paddingLeft: theme.spacing[2] + theme.spacing[1],\n paddingRight: theme.spacing[2] + theme.spacing[1],\n justifyContent: 'center',\n alignItems: 'center',\n height: '100%',\n };\n});\n\nconst renderValue = (\n selectionType: BaseFilterChipProps['selectionType'],\n value: BaseFilterChipProps['value'],\n isDisabled?: boolean,\n): React.ReactElement => {\n if (selectionType === 'multiple' && Array.isArray(value)) {\n return (\n <Box alignItems=\"center\" flexDirection=\"row\">\n <Counter value={value.length} color=\"neutral\" size=\"small\" />\n </Box>\n );\n }\n\n return (\n <Text\n size=\"small\"\n weight=\"medium\"\n color={isDisabled ? 'interactive.text.gray.disabled' : 'interactive.text.gray.normal'}\n >\n {typeof value === 'string' ? value : ''}\n </Text>\n );\n};\n\nconst _BaseFilterChip: React.ForwardRefRenderFunction<View, BaseFilterChipProps> = (\n {\n value,\n onClearButtonClick,\n label,\n isDisabled,\n selectionType = 'single',\n onClick,\n onKeyDown,\n accessibilityProps,\n id,\n ...rest\n }: BaseFilterChipProps,\n ref: React.Ref<View>,\n): React.ReactElement => {\n const { theme } = useTheme();\n const isSelected =\n selectionType === 'multiple' ? Array.isArray(value) && value.length > 0 : !!value;\n\n const [chipSize, setChipSize] = React.useState({ width: 0, height: 0 });\n const handleLayout = (event: LayoutChangeEvent): void => {\n const { width, height } = event.nativeEvent.layout;\n setChipSize((prev) =>\n prev.width === width && prev.height === height ? prev : { width, height },\n );\n };\n\n return (\n <StyledFilterChip\n $isDisabled={isDisabled}\n $isSelected={isSelected}\n ref={ref}\n onLayout={isSelected ? undefined : handleLayout}\n >\n <StyledFilterTrigger\n $isSelected={isSelected}\n disabled={isDisabled}\n id={id}\n onPress={\n isDisabled\n ? undefined\n : (e: GestureResponderEvent) => {\n onClick?.((e as unknown) as React.MouseEventHandler);\n }\n }\n {...(({\n onKeyDown: isDisabled\n ? undefined\n : (e: GestureResponderEvent) => {\n onKeyDown?.((e as unknown) as React.KeyboardEvent<Element>);\n },\n } as unknown) as Record<string, unknown>)}\n {...makeAccessible({\n ...accessibilityProps,\n role: accessibilityProps?.role ?? 'button',\n })}\n {...makeAnalyticsAttribute(rest)}\n {...metaAttribute({ name: 'filter-chip-trigger', testID: rest.testID })}\n >\n <Box flexDirection=\"row\" gap=\"spacing.2\" alignItems=\"center\">\n <Text\n size=\"small\"\n weight=\"medium\"\n color=\"interactive.text.gray.subtle\"\n truncateAfterLines={1}\n >\n {label}\n {isSelected ? ':' : null}\n </Text>\n {isSelected ? renderValue(selectionType, value, isDisabled) : null}\n </Box>\n <Box flexDirection=\"row\" alignItems=\"center\" paddingRight=\"spacing.1\">\n <ChevronDownIcon size=\"small\" color=\"interactive.icon.gray.muted\" />\n </Box>\n </StyledFilterTrigger>\n {isSelected ? (\n <>\n <Divider orientation=\"vertical\" variant={isDisabled ? 'muted' : 'subtle'} />\n <StyledFilterCloseButton\n {...makeAccessible({ label: `Clear ${label} value`, role: 'button' })}\n // value can never be undefined because when it's undefined the button itself doesn't render\n onPress={isDisabled ? undefined : () => onClearButtonClick?.({ value: value ?? '' })}\n disabled={isDisabled}\n {...metaAttribute({ name: 'filter-chip-close-button' })}\n >\n <CloseIcon size=\"small\" color=\"interactive.icon.gray.muted\" />\n </StyledFilterCloseButton>\n </>\n ) : null}\n {isSelected ? null : (\n <DashedBorder\n width={chipSize.width}\n height={chipSize.height}\n borderRadius={theme.border.radius.small}\n strokeWidth={makeBorderSize(theme.border.width.thin)}\n color={theme.colors.interactive.border.gray[isDisabled ? 'disabled' : 'faded']}\n />\n )}\n </StyledFilterChip>\n );\n};\n\nconst BaseFilterChip = assignWithoutSideEffects(React.forwardRef(_BaseFilterChip), {\n componentId: MetaConstants.BaseFilterChip,\n});\n\nexport { BaseFilterChip };\n"],"names":["this","FILTER_CHIP_HEIGHT_NATIVE","size","DashedBorder","_ref","width","height","borderRadius","strokeWidth","color","inset","rectWidth","rectHeight","radius","Math","max","straightWidth","straightHeight","perimeter","PI","targetSegment","segmentCount","round","segmentLength","dashLength","_jsx","View","style","StyleSheet","absoluteFill","pointerEvents","children","Svg","Rect","x","y","rx","ry","fill","stroke","strokeDasharray","StyledFilterChip","styled","_ref2","theme","$isDisabled","$isSelected","borderWidth","makeBorderSize","border","thin","borderColor","colors","interactive","gray","small","borderStyle","backgroundColor","surface","background","intense","flexDirection","alignSelf","overflow","StyledFilterTrigger","Pressable","_ref3","spacing","borderTopLeftRadius","borderBottomLeftRadius","paddingLeft","paddingRight","alignItems","gap","StyledFilterCloseButton","_ref4","borderTopRightRadius","borderBottomRightRadius","justifyContent","renderValue","selectionType","value","isDisabled","Array","isArray","Box","Counter","length","Text","weight","_BaseFilterChip","_ref5","ref","_accessibilityProps$r","onClearButtonClick","label","_ref5$selectionType","onClick","onKeyDown","accessibilityProps","id","rest","_objectWithoutProperties","_excluded","_useTheme","useTheme","isSelected","_React$useState","React","useState","_React$useState2","_slicedToArray","chipSize","setChipSize","handleLayout","event","_event$nativeEvent$la","nativeEvent","layout","prev","_jsxs","onLayout","undefined","Object","assign","disabled","onPress","e","makeAccessible","role","makeAnalyticsAttribute","metaAttribute","name","testID","truncateAfterLines","ChevronDownIcon","_Fragment","Divider","orientation","variant","CloseIcon","BaseFilterChip","assignWithoutSideEffects","forwardRef","componentId","MetaConstants"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAA,SAAA,CAAA,CAAA,OAAA,CAAA,oBAAA,CAAA,OAAA,CAAA,YAAA,CAAA,eAAA,CAAA,SAAA,CAAA,WAAA,CAAA,oBAAA,CAAA,IAAA,CAAA,CAAA,IAAA,KAAA,CAAAA,SAAA,CAAA,YAAA,CAAA,kGAAA,CAoBA,IAAMC,yBAAyB,CAAGC,IAAI,CAAC,IAAI,CAAC,CAS5C,IAAMC,YAAY,CAAG,SAAf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,IAAI,CACPiG,UAAU,CAAG,IAAI,CAChBjF,GAAA,CAACtB,YAAY,CACXE,CAAAA,KAAK,CAAE2G,QAAQ,CAAC3G,KAAM,CACtBC,MAAM,CAAE0G,QAAQ,CAAC1G,MAAO,CACxBC,YAAY,CAAEqC,KAAK,CAACK,MAAM,CAACpC,MAAM,CAAC0C,KAAM,CACxC/C,WAAW,CAAEwC,cAAc,CAACJ,KAAK,CAACK,MAAM,CAAC5C,KAAK,CAAC6C,IAAI,CAAE,CACrDzC,KAAK,CAAEmC,KAAK,CAACQ,MAAM,CAACC,WAAW,CAACJ,MAAM,CAACK,IAAI,CAAC4B,UAAU,CAAG,UAAU,CAAG,OAAO,CAAE,CAChF,CACF,CAAA,CACe,CAAC,CAEvB,CAAC,CAEK,IAAA2D,cAAc,CAAGC,wBAAwB,CAAClC,cAAK,CAACmC,UAAU,CAACrD,eAAe,CAAC,CAAE,CACjFsD,WAAW,CAAEC,aAAa,CAACJ,cAC7B,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"BaseFilterChip.native.js","sources":["../../../../../src/components/FilterChip/BaseFilterChip.native.tsx"],"sourcesContent":["import React from 'react';\nimport { Pressable, StyleSheet, View } from 'react-native';\nimport type { LayoutChangeEvent, GestureResponderEvent } from 'react-native';\nimport styled from 'styled-components/native';\nimport Svg, { Rect } from 'react-native-svg';\nimport type { BaseFilterChipProps } from './types';\nimport { size } from '~tokens/global';\nimport { makeBorderSize } from '~utils';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\nimport { Box } from '~components/Box';\nimport { Counter } from '~components/Counter';\nimport { Divider } from '~components/Divider';\nimport { ChevronDownIcon, CloseIcon } from '~components/Icons';\nimport { Text } from '~components/Typography';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { useTheme } from '~components/BladeProvider';\nimport type { Theme } from '~components/BladeProvider';\n\nconst FILTER_CHIP_HEIGHT_NATIVE = size['28'];\n\n/**\n * React Native's `borderStyle: 'dashed'` combined with `borderRadius` is buggy on iOS —\n * dashes render inconsistently and produce a broken/overlapping artifact near the corners\n * and the right edge. To match web's clean dashed pill, we draw the dashed border ourselves\n * with `react-native-svg` as a rounded `Rect` whose dash pattern divides evenly around the\n * perimeter (so there's no visible seam where the stroke path closes).\n */\nconst DashedBorder = ({\n width,\n height,\n borderRadius,\n strokeWidth,\n color,\n}: {\n width: number;\n height: number;\n borderRadius: number;\n strokeWidth: number;\n color: string;\n}): React.ReactElement | null => {\n if (width <= 0 || height <= 0) {\n return null;\n }\n\n // Inset the stroke by half its width so it sits fully inside the bounds and the\n // right/bottom edges aren't clipped.\n const inset = strokeWidth / 2;\n const rectWidth = width - strokeWidth;\n const rectHeight = height - strokeWidth;\n const radius = Math.max(borderRadius - inset, 0);\n\n // Perimeter of a rounded rectangle = straight edges + the four quarter-circle corners.\n const straightWidth = Math.max(rectWidth - 2 * radius, 0);\n const straightHeight = Math.max(rectHeight - 2 * radius, 0);\n const perimeter = 2 * straightWidth + 2 * straightHeight + 2 * Math.PI * radius;\n\n // Target a small dot-like dash+gap (~4pt) and round to an integer number of segments so\n // the pattern lands exactly on the path's start/end point (no broken dash on the right edge).\n const targetSegment = 4;\n const segmentCount = Math.max(1, Math.round(perimeter / targetSegment));\n const segmentLength = perimeter / segmentCount;\n const dashLength = segmentLength / 2;\n\n return (\n <View style={StyleSheet.absoluteFill} pointerEvents=\"none\">\n <Svg width={width} height={height}>\n <Rect\n x={inset}\n y={inset}\n width={rectWidth}\n height={rectHeight}\n rx={radius}\n ry={radius}\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeDasharray={[dashLength, segmentLength - dashLength]}\n />\n </Svg>\n </View>\n );\n};\n\nconst StyledFilterChip = styled(View)<{\n theme: Theme;\n $isSelected?: boolean;\n $isDisabled?: boolean;\n}>(({ theme, $isDisabled, $isSelected }) => {\n return {\n // When unselected the dashed border is drawn via an SVG overlay (see DashedBorder) so we\n // rely on it entirely: the native border has zero width, keeping the overlay's coordinate\n // space aligned with the border-box and avoiding iOS's buggy dashed+radius render.\n borderWidth: $isSelected ? makeBorderSize(theme.border.width.thin) : 0,\n borderColor: $isSelected\n ? theme.colors.interactive.border.gray[$isDisabled ? 'disabled' : 'faded']\n : 'transparent',\n height: FILTER_CHIP_HEIGHT_NATIVE,\n borderRadius: theme.border.radius.small,\n borderStyle: 'solid',\n backgroundColor: theme.colors.surface.background.gray.intense,\n flexDirection: 'row',\n alignSelf: 'flex-start',\n // The SVG dashed border must not be clipped when unselected; the selected state clips its\n // divider/close button to the rounded corners.\n overflow: $isSelected ? 'hidden' : 'visible',\n };\n});\n\nconst StyledFilterTrigger = styled(Pressable)<{\n theme: Theme;\n $hasClearButton?: boolean;\n}>(({ theme, $hasClearButton }) => {\n const { spacing } = theme;\n return {\n backgroundColor: 'transparent',\n // When a clear button follows the trigger its right corners butt against the divider,\n // so they're squared off. Without a clear button the trigger is a self-contained pill.\n borderRadius: $hasClearButton ? 0 : theme.border.radius.small,\n borderTopLeftRadius: theme.border.radius.small,\n borderBottomLeftRadius: theme.border.radius.small,\n paddingLeft: spacing[4],\n paddingRight: $hasClearButton ? spacing[2] : spacing[3],\n flexDirection: 'row',\n alignItems: 'center',\n height: '100%',\n gap: spacing[2],\n };\n});\n\nconst StyledFilterCloseButton = styled(Pressable)<{ theme: Theme }>(({ theme }) => {\n return {\n backgroundColor: 'transparent',\n borderTopRightRadius: theme.border.radius.small,\n borderBottomRightRadius: theme.border.radius.small,\n paddingLeft: theme.spacing[2] + theme.spacing[1],\n paddingRight: theme.spacing[2] + theme.spacing[1],\n justifyContent: 'center',\n alignItems: 'center',\n height: '100%',\n };\n});\n\nconst renderValue = (\n selectionType: BaseFilterChipProps['selectionType'],\n value: BaseFilterChipProps['value'],\n isDisabled?: boolean,\n): React.ReactElement => {\n const valueColor = isDisabled ? 'interactive.text.gray.disabled' : 'interactive.text.gray.normal';\n\n // For multiple selection: when a single option is selected we show its name (no redundant\n // \"1\" counter); once more than one is selected we collapse to a compact counter.\n // Use an explicit type guard so a non-array value (e.g. a plain string returned by\n // getFilterChipDisplayValue) never enters the array branch where .length would be\n // misinterpreted as character count.\n if (selectionType === 'multiple') {\n const valueArray = Array.isArray(value) ? value : value != null ? [value] : [];\n if (valueArray.length === 1) {\n return (\n <Text size=\"small\" weight=\"medium\" color={valueColor} truncateAfterLines={1}>\n {String(valueArray[0] ?? '')}\n </Text>\n );\n }\n return (\n <Box alignItems=\"center\" flexDirection=\"row\">\n <Counter value={valueArray.length} color=\"neutral\" size=\"small\" />\n </Box>\n );\n }\n\n return (\n <Text size=\"small\" weight=\"medium\" color={valueColor}>\n {value != null ? String(value) : ''}\n </Text>\n );\n};\n\nconst _BaseFilterChip: React.ForwardRefRenderFunction<View, BaseFilterChipProps> = (\n {\n value,\n onClearButtonClick,\n label,\n isDisabled,\n selectionType = 'single',\n showClearButton = true,\n onClick,\n onKeyDown,\n accessibilityProps,\n id,\n ...rest\n }: BaseFilterChipProps,\n ref: React.Ref<View>,\n): React.ReactElement => {\n const { theme } = useTheme();\n const isSelected =\n selectionType === 'multiple' ? Array.isArray(value) && value.length > 0 : !!value;\n const shouldShowClearButton = isSelected && showClearButton;\n\n const [chipSize, setChipSize] = React.useState({ width: 0, height: 0 });\n const handleLayout = (event: LayoutChangeEvent): void => {\n const { width, height } = event.nativeEvent.layout;\n setChipSize((prev) =>\n prev.width === width && prev.height === height ? prev : { width, height },\n );\n };\n\n return (\n <StyledFilterChip\n $isDisabled={isDisabled}\n $isSelected={isSelected}\n ref={ref}\n onLayout={isSelected ? undefined : handleLayout}\n >\n <StyledFilterTrigger\n $hasClearButton={shouldShowClearButton}\n disabled={isDisabled}\n id={id}\n onPress={\n isDisabled\n ? undefined\n : (e: GestureResponderEvent) => {\n onClick?.((e as unknown) as React.MouseEventHandler);\n }\n }\n {...(({\n onKeyDown: isDisabled\n ? undefined\n : (e: GestureResponderEvent) => {\n onKeyDown?.((e as unknown) as React.KeyboardEvent<Element>);\n },\n } as unknown) as Record<string, unknown>)}\n {...makeAccessible({\n ...accessibilityProps,\n role: accessibilityProps?.role ?? 'button',\n })}\n {...makeAnalyticsAttribute(rest)}\n {...metaAttribute({ name: 'filter-chip-trigger', testID: rest.testID })}\n >\n <Box flexDirection=\"row\" gap=\"spacing.2\" alignItems=\"center\">\n <Text\n size=\"small\"\n weight=\"medium\"\n color=\"interactive.text.gray.subtle\"\n truncateAfterLines={1}\n >\n {label}\n {isSelected ? ':' : null}\n </Text>\n {isSelected ? renderValue(selectionType, value, isDisabled) : null}\n </Box>\n <Box flexDirection=\"row\" alignItems=\"center\" paddingRight=\"spacing.1\">\n <ChevronDownIcon size=\"small\" color=\"interactive.icon.gray.muted\" />\n </Box>\n </StyledFilterTrigger>\n {shouldShowClearButton ? (\n <>\n <Divider orientation=\"vertical\" variant={isDisabled ? 'muted' : 'subtle'} />\n <StyledFilterCloseButton\n {...makeAccessible({ label: `Clear ${label} value`, role: 'button' })}\n // value can never be undefined because when it's undefined the button itself doesn't render\n onPress={isDisabled ? undefined : () => onClearButtonClick?.({ value: value ?? '' })}\n disabled={isDisabled}\n {...metaAttribute({ name: 'filter-chip-close-button' })}\n >\n <CloseIcon size=\"small\" color=\"interactive.icon.gray.muted\" />\n </StyledFilterCloseButton>\n </>\n ) : null}\n {isSelected ? null : (\n <DashedBorder\n width={chipSize.width}\n height={chipSize.height}\n borderRadius={theme.border.radius.small}\n strokeWidth={makeBorderSize(theme.border.width.thin)}\n color={theme.colors.interactive.border.gray[isDisabled ? 'disabled' : 'faded']}\n />\n )}\n </StyledFilterChip>\n );\n};\n\nconst BaseFilterChip = assignWithoutSideEffects(React.forwardRef(_BaseFilterChip), {\n componentId: MetaConstants.BaseFilterChip,\n});\n\nexport { BaseFilterChip };\n"],"names":["FILTER_CHIP_HEIGHT_NATIVE","size","DashedBorder","_ref","width","height","borderRadius","strokeWidth","color","inset","rectWidth","rectHeight","radius","Math","max","straightWidth","straightHeight","perimeter","PI","targetSegment","segmentCount","round","segmentLength","dashLength","_jsx","View","style","StyleSheet","absoluteFill","pointerEvents","children","Svg","Rect","x","y","rx","ry","fill","stroke","strokeDasharray","StyledFilterChip","styled","_ref2","theme","$isDisabled","$isSelected","borderWidth","makeBorderSize","border","thin","borderColor","colors","interactive","gray","small","borderStyle","backgroundColor","surface","background","intense","flexDirection","alignSelf","overflow","StyledFilterTrigger","Pressable","_ref3","$hasClearButton","spacing","borderTopLeftRadius","borderBottomLeftRadius","paddingLeft","paddingRight","alignItems","gap","StyledFilterCloseButton","_ref4","borderTopRightRadius","borderBottomRightRadius","justifyContent","renderValue","selectionType","value","isDisabled","valueColor","valueArray","Array","isArray","length","_valueArray$","Text","weight","truncateAfterLines","String","Box","Counter","_BaseFilterChip","_ref5","ref","_accessibilityProps$r","onClearButtonClick","label","_ref5$selectionType","_ref5$showClearButton","showClearButton","onClick","onKeyDown","accessibilityProps","id","rest","_objectWithoutProperties","_excluded","_useTheme","useTheme","isSelected","shouldShowClearButton","_React$useState","React","useState","_React$useState2","_slicedToArray","chipSize","setChipSize","handleLayout","event","_event$nativeEvent$la","nativeEvent","layout","prev","_jsxs","onLayout","undefined","Object","assign","disabled","onPress","e","makeAccessible","role","makeAnalyticsAttribute","metaAttribute","name","testID","ChevronDownIcon","_Fragment","Divider","orientation","variant","CloseIcon","BaseFilterChip","assignWithoutSideEffects","forwardRef","componentId","MetaConstants"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wRAoBA,IAAMA,yBAAyB,CAAGC,IAAI,CAAC,IAAI,CAAC,CAS5C,IAAMC,YAAY,CAAG,SAAfA,YAAYA,CAAAC,IAAA,CAYe,CAX/B,IAAAC,KAAK,CAAAD,IAAA,CAALC,KAAK,CACLC,MAAM,CAAAF,IAAA,CAANE,MAAM,CACNC,YAAY,CAAAH,IAAA,CAAZG,YAAY,CACZC,WAAW,CAAAJ,IAAA,CA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|
+
import React__default from 'react';
|
|
3
|
+
import { FloatingActionButtonContainer } from './FloatingActionButtonContainer.native.js';
|
|
4
|
+
import '../Button/BaseButton/index.js';
|
|
5
|
+
import { componentZIndices } from '../../utils/componentZIndices.js';
|
|
6
|
+
import '../../utils/assignWithoutSideEffects/index.js';
|
|
7
|
+
import { jsx } from 'react/jsx-runtime';
|
|
8
|
+
import BaseButton from '../Button/BaseButton/BaseButton.js';
|
|
9
|
+
import { assignWithoutSideEffects } from '../../utils/assignWithoutSideEffects/assignWithoutSideEffects.js';
|
|
10
|
+
|
|
11
|
+
var _excluded=["children","icon","color","placement","offset","zIndex","isDisabled","isLoading","href","target","rel","type","accessibilityLabel","onClick","onBlur","onFocus","onMouseLeave","onMouseMove","onMouseDown","onPointerDown","onPointerEnter","onTouchStart","onTouchEnd","testID"];var _this=undefined,_jsxFileName="/home/runner/work/blade/blade/packages/blade/src/components/FloatingActionButton/FloatingActionButton.tsx";var colorToSpinnerColor={primary:'white',black:'white',white:'neutral'};var _FloatingActionButton=function _FloatingActionButton(_ref,ref){var children=_ref.children,icon=_ref.icon,_ref$color=_ref.color,color=_ref$color===void 0?'primary':_ref$color,_ref$placement=_ref.placement,placement=_ref$placement===void 0?'bottom-end':_ref$placement,_ref$offset=_ref.offset,offset=_ref$offset===void 0?'spacing.5':_ref$offset,_ref$zIndex=_ref.zIndex,zIndex=_ref$zIndex===void 0?componentZIndices.fab:_ref$zIndex,_ref$isDisabled=_ref.isDisabled,isDisabled=_ref$isDisabled===void 0?false:_ref$isDisabled,_ref$isLoading=_ref.isLoading,isLoading=_ref$isLoading===void 0?false:_ref$isLoading,href=_ref.href,target=_ref.target,rel=_ref.rel,_ref$type=_ref.type,type=_ref$type===void 0?'button':_ref$type,accessibilityLabel=_ref.accessibilityLabel,onClick=_ref.onClick,onBlur=_ref.onBlur,onFocus=_ref.onFocus,onMouseLeave=_ref.onMouseLeave,onMouseMove=_ref.onMouseMove,onMouseDown=_ref.onMouseDown,onPointerDown=_ref.onPointerDown,onPointerEnter=_ref.onPointerEnter,onTouchStart=_ref.onTouchStart,onTouchEnd=_ref.onTouchEnd,testID=_ref.testID,rest=_objectWithoutProperties(_ref,_excluded);return jsx(FloatingActionButtonContainer,Object.assign({placement:placement,offset:offset,zIndex:zIndex,testID:testID},rest,{children:jsx(BaseButton,{ref:ref,icon:icon,variant:"primary",color:color,size:"large",_borderRadius:"max",_iconSize:"xlarge",_spinnerColor:colorToSpinnerColor[color],accessibilityProps:{label:accessibilityLabel},href:href,target:target,rel:rel,type:type,isDisabled:isDisabled,isLoading:isLoading,onClick:onClick,onBlur:onBlur,onFocus:onFocus,onMouseLeave:onMouseLeave,onMouseMove:onMouseMove,onMouseDown:onMouseDown,onPointerDown:onPointerDown,onPointerEnter:onPointerEnter,onTouchStart:onTouchStart,onTouchEnd:onTouchEnd,children:children})}));};var FloatingActionButton=assignWithoutSideEffects(React__default.forwardRef(_FloatingActionButton),{displayName:'FloatingActionButton',componentId:'FloatingActionButton'});
|
|
12
|
+
|
|
13
|
+
export { FloatingActionButton };
|
|
14
|
+
//# sourceMappingURL=FloatingActionButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FloatingActionButton.js","sources":["../../../../../src/components/FloatingActionButton/FloatingActionButton.tsx"],"sourcesContent":["import React from 'react';\nimport { FloatingActionButtonContainer } from './FloatingActionButtonContainer';\nimport type { FloatingActionButtonProps } from './types';\nimport BaseButton from '~components/Button/BaseButton';\nimport { componentZIndices } from '~utils/componentZIndices';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport type { BladeElementRef } from '~utils/types';\n\n/**\n * The shared spinner map would render a white spinner on the white button, where\n * it is invisible.\n */\nconst colorToSpinnerColor = {\n primary: 'white',\n black: 'white',\n white: 'neutral',\n} as const;\n\n/**\n * ### FloatingActionButton component\n *\n * A persistent, elevated button anchored to the bottom of the viewport, used for the single most important action on a screen.\n *\n * ---\n *\n * #### Usage\n *\n * ```jsx\n * <FloatingActionButton icon={PlusIcon} onClick={() => createPayment()}>\n * Create payment\n * </FloatingActionButton>\n *\n * // icon-only, accessibilityLabel is required\n * <FloatingActionButton\n * icon={PlusIcon}\n * accessibilityLabel=\"Create payment\"\n * onClick={() => createPayment()}\n * />\n * ```\n *\n * Checkout {@link https://blade.razorpay.com/?path=/docs/components-floatingactionbutton--docs FloatingActionButton Documentation}\n */\nconst _FloatingActionButton: React.ForwardRefRenderFunction<\n BladeElementRef,\n FloatingActionButtonProps\n> = (\n {\n children,\n icon,\n color = 'primary',\n placement = 'bottom-end',\n offset = 'spacing.5',\n zIndex = componentZIndices.fab,\n isDisabled = false,\n isLoading = false,\n href,\n target,\n rel,\n type = 'button',\n accessibilityLabel,\n onClick,\n onBlur,\n onFocus,\n onMouseLeave,\n onMouseMove,\n onMouseDown,\n onPointerDown,\n onPointerEnter,\n onTouchStart,\n onTouchEnd,\n testID,\n ...rest\n },\n ref,\n) => {\n return (\n <FloatingActionButtonContainer\n placement={placement}\n offset={offset}\n zIndex={zIndex}\n testID={testID}\n {...rest}\n >\n <BaseButton\n ref={ref}\n icon={icon}\n variant=\"primary\"\n color={color}\n size=\"large\"\n _borderRadius=\"max\"\n _iconSize=\"xlarge\"\n _spinnerColor={colorToSpinnerColor[color]}\n accessibilityProps={{ label: accessibilityLabel }}\n href={href}\n target={target}\n rel={rel}\n type={type}\n isDisabled={isDisabled}\n isLoading={isLoading}\n onClick={onClick}\n onBlur={onBlur}\n onFocus={onFocus}\n onMouseLeave={onMouseLeave}\n onMouseMove={onMouseMove}\n onMouseDown={onMouseDown}\n onPointerDown={onPointerDown}\n onPointerEnter={onPointerEnter}\n onTouchStart={onTouchStart}\n onTouchEnd={onTouchEnd}\n >\n {children}\n </BaseButton>\n </FloatingActionButtonContainer>\n );\n};\n\nconst FloatingActionButton = assignWithoutSideEffects(React.forwardRef(_FloatingActionButton), {\n displayName: 'FloatingActionButton',\n componentId: 'FloatingActionButton',\n});\n\nexport { FloatingActionButton };\n"],"names":["colorToSpinnerColor","primary","black","white","_FloatingActionButton","_ref","ref","children","icon","_ref$color","color","_ref$placement","placement","_ref$offset","offset","_ref$zIndex","zIndex","componentZIndices","fab","_ref$isDisabled","isDisabled","_ref$isLoading","isLoading","href","target","rel","_ref$type","type","accessibilityLabel","onClick","onBlur","onFocus","onMouseLeave","onMouseMove","onMouseDown","onPointerDown","onPointerEnter","onTouchStart","onTouchEnd","testID","rest","_objectWithoutProperties","_excluded","_jsx","FloatingActionButtonContainer","Object","assign","BaseButton","variant","size","_borderRadius","_iconSize","_spinnerColor","accessibilityProps","label","FloatingActionButton","assignWithoutSideEffects","React","forwardRef","displayName","componentId"],"mappings":";;;;;;;;;;8aAYA,IAAMA,mBAAmB,CAAG,CAC1BC,OAAO,CAAE,OAAO,CAChBC,KAAK,CAAE,OAAO,CACdC,KAAK,CAAE,SACT,CAAU,CA0BV,IAAMC,qBAGL,CAAG,SAHEA,qBAGLA,CAAAC,IAAA,CA4BCC,GAAG,CACA,KA3BDC,QAAQ,CAAAF,IAAA,CAARE,QAAQ,CACRC,IAAI,CAAAH,IAAA,CAAJG,IAAI,CAAAC,UAAA,CAAAJ,IAAA,CACJK,KAAK,CAALA,KAAK,CAAAD,UAAA,GAAA,KAAA,CAAA,CAAG,SAAS,CAAAA,UAAA,CAAAE,cAAA,CAAAN,IAAA,CACjBO,SAAS,CAATA,SAAS,CAAAD,cAAA,GAAA,KAAA,CAAA,CAAG,YAAY,CAAAA,cAAA,CAAAE,WAAA,CAAAR,IAAA,CACxBS,MAAM,CAANA,MAAM,CAAAD,WAAA,GAAA,KAAA,CAAA,CAAG,WAAW,CAAAA,WAAA,CAAAE,WAAA,CAAAV,IAAA,CACpBW,MAAM,CAANA,MAAM,CAAAD,WAAA,GAAGE,KAAAA,CAAAA,CAAAA,iBAAiB,CAACC,GAAG,CAAAH,WAAA,CAAAI,eAAA,CAAAd,IAAA,CAC9Be,UAAU,CAAVA,UAAU,CAAAD,eAAA,GAAG,KAAA,CA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AAO,CAAC,SAAS,CACjBtC,KAAK,CAAEA,KAAM,CACbuC,IAAI,CAAC,OAAO,CACZC,aAAa,CAAC,KAAK,CACnBC,SAAS,CAAC,QAAQ,CAClBC,aAAa,CAAEpD,mBAAmB,CAACU,KAAK,CAAE,CAC1C2C,kBAAkB,CAAE,CAAEC,KAAK,CAAE1B,kBAAmB,CAAE,CAClDL,IAAI,CAAEA,IAAK,CACXC,MAAM,CAAEA,MAAO,CACfC,GAAG,CAAEA,GAAI,CACTE,IAAI,CAAEA,IAAK,CACXP,UAAU,CAAEA,UAAW,CACvBE,SAAS,CAAEA,SAAU,CACrBO,OAAO,CAAEA,OAAQ,CACjBC,MAAM,CAAEA,MAAO,CACfC,OAAO,CAAEA,OAAQ,CACjBC,YAAY,CAAEA,YAAa,CAC3BC,WAAW,CAAEA,WAAY,CACzBC,WAAW,CAAEA,WAAY,CACzBC,aAAa,CAAEA,aAAc,CAC7BC,cAAc,CAAEA,cAAe,CAC/BC,YAAY,CAAEA,YAAa,CAC3BC,UAAU,CAAEA,UAAW,CAAA/B,QAAA,CAEtBA,QAAQ,CACC,CAAC,CACgB,CAAA,CAAC,CAEpC,CAAC,CAEK,IAAAgD,oBAAoB,CAAGC,wBAAwB,CAACC,cAAK,CAACC,UAAU,CAACtD,qBAAqB,CAAC,CAAE,CAC7FuD,WAAW,CAAE,sBAAsB,CACnCC,WAAW,CAAE,sBACf,CAAC;;;;"}
|
package/build/lib/native/components/FloatingActionButton/FloatingActionButtonContainer.native.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
2
|
+
import 'react';
|
|
3
|
+
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
4
|
+
import '../Box/BaseBox/index.js';
|
|
5
|
+
import '../Box/styledProps/index.js';
|
|
6
|
+
import '../../utils/makeSpace/index.js';
|
|
7
|
+
import '../../utils/makeAnalyticsAttribute/index.js';
|
|
8
|
+
import '../../utils/metaAttribute/index.js';
|
|
9
|
+
import { jsx } from 'react/jsx-runtime';
|
|
10
|
+
import { BaseBox } from '../Box/BaseBox/BaseBox.native.js';
|
|
11
|
+
import { makeSpace } from '../../utils/makeSpace/makeSpace.js';
|
|
12
|
+
import { metaAttribute } from '../../utils/metaAttribute/metaAttribute.native.js';
|
|
13
|
+
import { MetaConstants } from '../../utils/metaAttribute/metaConstants.js';
|
|
14
|
+
import { makeAnalyticsAttribute } from '../../utils/makeAnalyticsAttribute/makeAnalyticsAttribute.js';
|
|
15
|
+
import { getStyledProps } from '../Box/styledProps/getStyledProps.js';
|
|
16
|
+
|
|
17
|
+
var _excluded=["children","placement","offset","zIndex","testID"];var _this=undefined,_jsxFileName="/home/runner/work/blade/blade/packages/blade/src/components/FloatingActionButton/FloatingActionButtonContainer.native.tsx";var placementToJustifyContent={'bottom-start':'flex-start','bottom-end':'flex-end',bottom:'center'};var FloatingActionButtonContainer=function FloatingActionButtonContainer(_ref){var children=_ref.children,placement=_ref.placement,offset=_ref.offset,zIndex=_ref.zIndex,testID=_ref.testID,rest=_objectWithoutProperties(_ref,_excluded);var insets=useSafeAreaInsets();return jsx(BaseBox,Object.assign({position:"absolute",bottom:makeSpace(insets.bottom),left:"0px",right:"0px",paddingLeft:offset,paddingRight:offset,paddingBottom:offset,display:"flex",flexDirection:"row",justifyContent:placementToJustifyContent[placement],pointerEvents:"box-none",zIndex:zIndex},metaAttribute({testID:testID,name:MetaConstants.FloatingActionButton}),makeAnalyticsAttribute(rest),getStyledProps(rest),{children:jsx(BaseBox,{borderRadius:"max",elevation:"midRaised",children:children})}));};
|
|
18
|
+
|
|
19
|
+
export { FloatingActionButtonContainer };
|
|
20
|
+
//# sourceMappingURL=FloatingActionButtonContainer.native.js.map
|
package/build/lib/native/components/FloatingActionButton/FloatingActionButtonContainer.native.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FloatingActionButtonContainer.native.js","sources":["../../../../../src/components/FloatingActionButton/FloatingActionButtonContainer.native.tsx"],"sourcesContent":["import React from 'react';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\nimport type { FloatingActionButtonContainerProps } from './types';\nimport BaseBox from '~components/Box/BaseBox';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport { makeSpace } from '~utils/makeSpace';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\n\nconst placementToJustifyContent = {\n 'bottom-start': 'flex-start',\n 'bottom-end': 'flex-end',\n bottom: 'center',\n} as const;\n\n/**\n * Anchors the button to the bottom of the screen and owns its drop shadow.\n *\n * React Native has no `position: fixed`, so the button is absolutely positioned\n * and is expected to be mounted inside a filling parent.\n *\n * The positioning is done with a full-width row rather than by setting `left` /\n * `right` directly, because centering would otherwise need a percentage\n * `translateX`, which React Native does not support reliably. The row is\n * `pointerEvents=\"box-none\"` so it does not swallow touches meant for the\n * content behind it, and the drop shadow sits on the inner, button-sized box so\n * it traces the pill rather than the row.\n *\n * The bottom safe-area inset is applied to the row so the `offset` is measured\n * from the top of the home indicator / navigation bar rather than from the\n * physical bottom of the screen.\n */\nconst FloatingActionButtonContainer = ({\n children,\n placement,\n offset,\n zIndex,\n testID,\n ...rest\n}: FloatingActionButtonContainerProps): React.ReactElement => {\n const insets = useSafeAreaInsets();\n\n return (\n <BaseBox\n position=\"absolute\"\n bottom={makeSpace(insets.bottom)}\n left=\"0px\"\n right=\"0px\"\n paddingLeft={offset}\n paddingRight={offset}\n paddingBottom={offset}\n display=\"flex\"\n flexDirection=\"row\"\n justifyContent={placementToJustifyContent[placement]}\n pointerEvents=\"box-none\"\n zIndex={zIndex}\n {...metaAttribute({ testID, name: MetaConstants.FloatingActionButton })}\n {...makeAnalyticsAttribute(rest)}\n {...getStyledProps(rest)}\n >\n <BaseBox borderRadius=\"max\" elevation=\"midRaised\">\n {children}\n </BaseBox>\n </BaseBox>\n );\n};\n\nexport { FloatingActionButtonContainer };\n"],"names":["placementToJustifyContent","bottom","FloatingActionButtonContainer","_ref","children","placement","offset","zIndex","testID","rest","_objectWithoutProperties","_excluded","insets","useSafeAreaInsets","_jsx","BaseBox","Object","assign","position","makeSpace","left","right","paddingLeft","paddingRight","paddingBottom","display","flexDirection","justifyContent","pointerEvents","metaAttribute","name","MetaConstants","FloatingActionButton","makeAnalyticsAttribute","getStyledProps","borderRadius","elevation"],"mappings":";;;;;;;;;;;;;;;;+NASA,IAAMA,yBAAyB,CAAG,CAChC,cAAc,CAAE,YAAY,CAC5B,YAAY,CAAE,UAAU,CACxBC,MAAM,CAAE,QACV,CAAU,CAmBJ,IAAAC,6BAA6B,CAAG,SAAhCA,6BAA6BA,CAAAC,IAAA,CAO2B,CAAA,IAN5DC,QAAQ,CAAAD,IAAA,CAARC,QAAQ,CACRC,SAAS,CAAAF,IAAA,CAATE,SAAS,CACTC,MAAM,CAAAH,IAAA,CAANG,MAAM,CACNC,MAAM,CAAAJ,IAAA,CAANI,MAAM,CACNC,MAAM,CAAAL,IAAA,CAANK,MAAM,CACHC,IAAI,CAAAC,wBAAA,CAAAP,IAAA,CAAAQ,SAAA,CAEP,CAAA,IAAMC,MAAM,CAAGC,iBAAiB,EAAE,CAElC,OACEC,GAAA,CAACC,OAAO,CAAAC,MAAA,CAAAC,MAAA,CAAA,CACNC,QAAQ,CAAC,UAAU,CACnBjB,MAAM,CAAEkB,SAAS,CAACP,MAAM,CAACX,MAAM,CAAE,CACjCmB,IAAI,CAAC,KAAK,CACVC,KAAK,CAAC,KAAK,CACXC,WAAW,CAAEhB,MAAO,CACpBiB,YAAY,CAAEjB,MAAO,CACrBkB,aAAa,CAAElB,MAAO,CACtBmB,OAAO,CAAC,MAAM,CACdC,aAAa,CAAC,KAAK,CACnBC,cAAc,CAAE3B,yBAAyB,CAACK,SAAS,CAAE,CACrDuB,aAAa,CAAC,UAAU,CACxBrB,MAAM,CAAEA,MAAO,CACXsB,CAAAA,aAAa,CAAC,CAAErB,MAAM,CAANA,MAAM,CAAEsB,IAAI,CAAEC,aAAa,CAACC,oBAAqB,CAAC,CAAC,CACnEC,sBAAsB,CAACxB,IAAI,CAAC,CAC5ByB,cAAc,CAACzB,IAAI,CAAC,CAAAL,CAAAA,QAAA,CAExBU,GAAA,CAACC,OAAO,EAACoB,YAAY,CAAC,KAAK,CAACC,SAAS,CAAC,WAAW,CAAAhC,QAAA,CAC9CA,QAAQ,CACF,CAAC,CACH,CAAA,CAAC,CAEd;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -2,7 +2,7 @@ import React__default from 'react';
|
|
|
2
2
|
import '../../utils/logger/index.js';
|
|
3
3
|
import { throwBladeError } from '../../utils/logger/logger.js';
|
|
4
4
|
|
|
5
|
-
var GenUIContext=React__default.createContext(null);var useGenUI=function useGenUI(){throwBladeError({message:'useGenUI is not yet implemented for React Native',moduleName:'useGenUI'});return null;};var useGenUIAction=function useGenUIAction(){throwBladeError({message:'useGenUIAction is not yet implemented for React Native',moduleName:'useGenUIAction'});return undefined;};
|
|
5
|
+
var GenUIContext=React__default.createContext(null);var useGenUI=function useGenUI(){throwBladeError({message:'useGenUI is not yet implemented for React Native',moduleName:'useGenUI'});return null;};var useGenUIAction=function useGenUIAction(){throwBladeError({message:'useGenUIAction is not yet implemented for React Native',moduleName:'useGenUIAction'});return undefined;};var useGenUIComponentActions=function useGenUIComponentActions(){throwBladeError({message:'useGenUIComponentActions is not yet implemented for React Native',moduleName:'useGenUIComponentActions'});return undefined;};
|
|
6
6
|
|
|
7
|
-
export { GenUIContext, useGenUI, useGenUIAction };
|
|
7
|
+
export { GenUIContext, useGenUI, useGenUIAction, useGenUIComponentActions };
|
|
8
8
|
//# sourceMappingURL=GenUIContext.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GenUIContext.native.js","sources":["../../../../../src/components/GenUI/GenUIContext.native.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport React from 'react';\nimport type { GenUIAction } from './types';\nimport { throwBladeError } from '~utils/logger';\n\ntype GenUIContextValue = any;\nconst GenUIContext = React.createContext<GenUIContextValue | null>(null);\n\n/**\n * Hook to access GenUI context\n * @throws Error if used outside GenUIProvider\n */\nconst useGenUI = (): GenUIContextValue => {\n throwBladeError({\n message: 'useGenUI is not yet implemented for React Native',\n moduleName: 'useGenUI',\n });\n return null;\n};\n\n/**\n * Hook to access action click handler (safe version that doesn't throw)\n */\nconst useGenUIAction = (): ((action: GenUIAction) => void) | undefined => {\n throwBladeError({\n message: 'useGenUIAction is not yet implemented for React Native',\n moduleName: 'useGenUIAction',\n });\n return undefined;\n};\n\nexport { GenUIContext, useGenUI, useGenUIAction };\nexport type { GenUIContextValue };\n"],"names":["GenUIContext","React","createContext","useGenUI","throwBladeError","message","moduleName","useGenUIAction","undefined"],"mappings":";;;;AAMM,IAAAA,YAAY,CAAGC,cAAK,CAACC,aAAa,CAA2B,IAAI,EAMjE,IAAAC,QAAQ,CAAG,SAAXA,QAAQA,EAA4B,CACxCC,eAAe,CAAC,CACdC,OAAO,CAAE,kDAAkD,CAC3DC,UAAU,CAAE,UACd,CAAC,CAAC,CACF,
|
|
1
|
+
{"version":3,"file":"GenUIContext.native.js","sources":["../../../../../src/components/GenUI/GenUIContext.native.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport React from 'react';\nimport type { GenUIAction } from './types';\nimport { throwBladeError } from '~utils/logger';\n\ntype GenUIContextValue = any;\nconst GenUIContext = React.createContext<GenUIContextValue | null>(null);\n\n/**\n * Hook to access GenUI context\n * @throws Error if used outside GenUIProvider\n */\nconst useGenUI = (): GenUIContextValue => {\n throwBladeError({\n message: 'useGenUI is not yet implemented for React Native',\n moduleName: 'useGenUI',\n });\n return null;\n};\n\n/**\n * Hook to access action click handler (safe version that doesn't throw)\n */\nconst useGenUIAction = (): ((action: GenUIAction) => void) | undefined => {\n throwBladeError({\n message: 'useGenUIAction is not yet implemented for React Native',\n moduleName: 'useGenUIAction',\n });\n return undefined;\n};\n\n/**\n * Hook to access the consumer-registered action slot registry (safe version that doesn't throw)\n */\nconst useGenUIComponentActions = (): undefined => {\n throwBladeError({\n message: 'useGenUIComponentActions is not yet implemented for React Native',\n moduleName: 'useGenUIComponentActions',\n });\n return undefined;\n};\n\nexport { GenUIContext, useGenUI, useGenUIAction, useGenUIComponentActions };\nexport type { GenUIContextValue };\n"],"names":["GenUIContext","React","createContext","useGenUI","throwBladeError","message","moduleName","useGenUIAction","undefined","useGenUIComponentActions"],"mappings":";;;;AAMM,IAAAA,YAAY,CAAGC,cAAK,CAACC,aAAa,CAA2B,IAAI,EAMjE,IAAAC,QAAQ,CAAG,SAAXA,QAAQA,EAA4B,CACxCC,eAAe,CAAC,CACdC,OAAO,CAAE,kDAAkD,CAC3DC,UAAU,CAAE,UACd,CAAC,CAAC,CACF,OAAO,IAAI,CACb,EAKM,IAAAC,cAAc,CAAG,SAAjBA,cAAcA,EAAsD,CACxEH,eAAe,CAAC,CACdC,OAAO,CAAE,wDAAwD,CACjEC,UAAU,CAAE,gBACd,CAAC,CAAC,CACF,OAAOE,SAAS,CAClB,EAKM,IAAAC,wBAAwB,CAAG,SAA3BA,wBAAwBA,EAAoB,CAChDL,eAAe,CAAC,CACdC,OAAO,CAAE,kEAAkE,CAC3EC,UAAU,CAAE,0BACd,CAAC,CAAC,CACF,OAAOE,SAAS,CAClB;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { GenUIProvider } from './GenUIProvider.native.js';
|
|
2
|
-
export { useGenUI, useGenUIAction } from './GenUIContext.native.js';
|
|
2
|
+
export { useGenUI, useGenUIAction, useGenUIComponentActions } from './GenUIContext.native.js';
|
|
3
3
|
export { GenUISchemaRenderer } from './GenUISchemaRenderer.native.js';
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
2
|
+
import '../_Svg/index.js';
|
|
3
|
+
import '../useIconProps/index.js';
|
|
4
|
+
import '../../../utils/assignWithoutSideEffects/index.js';
|
|
5
|
+
import { jsx } from 'react/jsx-runtime';
|
|
6
|
+
import useIconProps from '../useIconProps/useIconProps.js';
|
|
7
|
+
import Svg from '../_Svg/Svg/Svg.native.js';
|
|
8
|
+
import Path from '../_Svg/Path/Path.native.js';
|
|
9
|
+
import { assignWithoutSideEffects } from '../../../utils/assignWithoutSideEffects/assignWithoutSideEffects.js';
|
|
10
|
+
|
|
11
|
+
var _excluded=["size","color"];var _this=undefined,_jsxFileName="/home/runner/work/blade/blade/packages/blade/src/components/Icons/BookmarkFilledIcon/BookmarkFilledIcon.tsx";var _BookmarkFilledIcon=function _BookmarkFilledIcon(_ref){var size=_ref.size,color=_ref.color,styledProps=_objectWithoutProperties(_ref,_excluded);var _useIconProps=useIconProps({size:size,color:color}),height=_useIconProps.height,width=_useIconProps.width,iconColor=_useIconProps.iconColor;return jsx(Svg,Object.assign({},styledProps,{width:width,height:height,viewBox:"0 0 24 24",fill:"none",children:jsx(Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M4 5C4 3.34315 5.34315 2 7 2H17C18.6569 2 20 3.34315 20 5V21C20 21.3746 19.7907 21.7178 19.4576 21.8892C19.1245 22.0606 18.7236 22.0315 18.4188 21.8137L12 17.2289L5.58124 21.8137C5.27642 22.0315 4.87549 22.0606 4.54242 21.8892C4.20935 21.7178 4 21.3746 4 21V5Z",fill:iconColor})}));};var BookmarkFilledIcon=assignWithoutSideEffects(_BookmarkFilledIcon,{componentId:'BookmarkFilledIcon'});
|
|
12
|
+
|
|
13
|
+
export { BookmarkFilledIcon as default };
|
|
14
|
+
//# sourceMappingURL=BookmarkFilledIcon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BookmarkFilledIcon.js","sources":["../../../../../../src/components/Icons/BookmarkFilledIcon/BookmarkFilledIcon.tsx"],"sourcesContent":["import { Svg, Path } from '../_Svg';\nimport type { IconComponent } from '..';\nimport useIconProps from '../useIconProps';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\n\nconst _BookmarkFilledIcon: IconComponent = ({ size, color, ...styledProps }) => {\n const { height, width, iconColor } = useIconProps({ size, color });\n\n return (\n <Svg {...styledProps} width={width} height={height} viewBox=\"0 0 24 24\" fill=\"none\">\n <Path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M4 5C4 3.34315 5.34315 2 7 2H17C18.6569 2 20 3.34315 20 5V21C20 21.3746 19.7907 21.7178 19.4576 21.8892C19.1245 22.0606 18.7236 22.0315 18.4188 21.8137L12 17.2289L5.58124 21.8137C5.27642 22.0315 4.87549 22.0606 4.54242 21.8892C4.20935 21.7178 4 21.3746 4 21V5Z\"\n fill={iconColor}\n />\n </Svg>\n );\n};\n\nconst BookmarkFilledIcon = assignWithoutSideEffects(_BookmarkFilledIcon, {\n componentId: 'BookmarkFilledIcon',\n});\n\nexport default BookmarkFilledIcon;\n"],"names":["this","_BookmarkFilledIcon","_ref","size","color","styledProps","_objectWithoutProperties","_excluded","_useIconProps","useIconProps","height","width","iconColor","_jsx","Svg","Object","assign","viewBox","fill","children","Path","fillRule","clipRule","d","BookmarkFilledIcon","assignWithoutSideEffects","componentId"],"mappings":";;;;;;;;;;AAAA,IAAA,SAAA,CAAA,CAAA,MAAA,CAAA,OAAA,CAAA,CAAA,IAAA,KAAA,CAAAA,SAAA,CAAA,YAAA,CAAA,6GAAA,CAKA,IAAMC,mBAAkC,CAAG,SAArCA,mBAAkCA,CAAAC,IAAA,CAAwC,CAAA,IAAlCC,IAAI,CAAAD,IAAA,CAAJC,IAAI,CAAEC,KAAK,CAAAF,IAAA,CAALE,KAAK,CAAKC,WAAW,CAAAC,wBAAA,CAAAJ,IAAA,CAAAK,SAAA,CACvE,CAAA,IAAAC,aAAA,CAAqCC,YAAY,CAAC,CAAEN,IAAI,CAAJA,IAAI,CAAEC,KAAK,CAALA,KAAM,CAAC,CAAC,CAA1DM,MAAM,CAAAF,aAAA,CAANE,MAAM,CAAEC,KAAK,CAAAH,aAAA,CAALG,KAAK,CAAEC,SAAS,CAAAJ,aAAA,CAATI,SAAS,CAEhC,OACEC,GAAA,CAACC,GAAG,CAAAC,MAAA,CAAAC,MAAA,CAAA,EAAA,CAAKX,WAAW,CAAA,CAAEM,KAAK,CAAEA,KAAM,CAACD,MAAM,CAAEA,MAAO,CAACO,OAAO,CAAC,WAAW,CAACC,IAAI,CAAC,MAAM,CAAAC,QAAA,CACjFN,GAAA,CAACO,IAAI,CACHC,CAAAA,QAAQ,CAAC,SAAS,CAClBC,QAAQ,CAAC,SAAS,CAClBC,CAAC,CAAC,sQAAsQ,CACxQL,IAAI,CAAEN,SAAU,CACjB,CAAC,CAAA,CACC,CAAC,CAEV,CAAC,CAEK,IAAAY,kBAAkB,CAAGC,wBAAwB,CAACxB,mBAAmB,CAAE,CACvEyB,WAAW,CAAE,oBACf,CAAC;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -66,6 +66,7 @@ import './BillMeIcon/index.js';
|
|
|
66
66
|
import './BluetoothIcon/index.js';
|
|
67
67
|
import './BoldIcon/index.js';
|
|
68
68
|
import './BookIcon/index.js';
|
|
69
|
+
import './BookmarkFilledIcon/index.js';
|
|
69
70
|
import './BookmarkIcon/index.js';
|
|
70
71
|
import './BoxIcon/index.js';
|
|
71
72
|
import './BriefcaseIcon/index.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -19,7 +19,7 @@ import { BaseBox } from '../../Box/BaseBox/BaseBox.native.js';
|
|
|
19
19
|
import { Text } from '../../Typography/Text/Text.js';
|
|
20
20
|
import { assignWithoutSideEffects } from '../../../utils/assignWithoutSideEffects/assignWithoutSideEffects.js';
|
|
21
21
|
|
|
22
|
-
var _excluded=["name","isRequired","isDisabled","maxCharacters","handleOnFocus","handleOnChange","handleOnBlur","handleOnSubmit","handleOnInput","handleOnKeyDown","handleOnClick","keyboardType","keyboardReturnKeyType","autoCompleteSuggestionType","accessibilityProps","currentInteraction","setCurrentInteraction","type","numberOfLines","autoGrowMaxHeight","isTextArea","hasPopup","shouldIgnoreBlurAnimation","autoCapitalize","as","$size","valueSuffix"];var _this=undefined,_jsxFileName="/home/runner/work/blade/blade/packages/blade/src/components/Input/BaseInput/StyledBaseInput.native.tsx";var autoCompleteSuggestionTypeAndroid={none:'off',name:'name',email:'email',username:'username',password:'password',newPassword:'password-new',oneTimeCode:'sms-otp',telephone:'tel',postalCode:'postal-code',countryName:'postal-address-country',creditCardNumber:'cc-number',creditCardCSC:'cc-csc',creditCardExpiry:'cc-exp',creditCardExpiryMonth:'cc-exp-month',creditCardExpiryYear:'cc-exp-year'};var autoCompleteSuggestionTypeIOS={none:'none',name:'name',email:'emailAddress',username:'username',password:'password',newPassword:'newPassword',oneTimeCode:'oneTimeCode',telephone:'telephoneNumber',postalCode:'postalCode',countryName:'countryName',creditCardNumber:'creditCardNumber',creditCardCSC:'none',creditCardExpiry:'none',creditCardExpiryMonth:'none',creditCardExpiryYear:'none'};var KeyboardTypeToNativeValuesMap={text:'default',search:'default',telephone:'phone-pad',email:'email-address',url:'url',decimal:'decimal-pad'};var getInputHeight=function getInputHeight(_ref){var isTextArea=_ref.isTextArea,hasTags=_ref.hasTags,numberOfLines=_ref.numberOfLines,isDropdownTrigger=_ref.isDropdownTrigger,size$1=_ref.size,autoGrowMaxHeight=_ref.autoGrowMaxHeight;if(isTextArea){if(autoGrowMaxHeight){return undefined;}var lines=isDropdownTrigger?1:numberOfLines!=null?numberOfLines:0;return `${baseInputHeight[size$1]*lines}px`;}if(hasTags){return undefined;}return makeSize(size[baseInputHeight[size$1]]);};var getRNInputStyles=function getRNInputStyles(props){var _props$numberOfLines;return Object.assign({},getBaseInputStyles({theme:props.theme,isFocused:props.isFocused,isDisabled:!props.editable,validationState:props.validationState,leadingIcon:props.leadingIcon,prefix:props.prefix,trailingInteractionElement:props.trailingInteractionElement,leadingInteractionElement:props.leadingInteractionElement,suffix:props.suffix,trailingIcon:props.trailingIcon,isTextArea:props.isTextArea,hasTags:props.hasTags,isDropdownTrigger:props.isDropdownTrigger,size:props.$size,padding:props.$padding,valueComponentType:props.valueComponentType,isTableInputCell:props.isTableInputCell}),{lineHeight:Platform.select({android:makeSize(props.theme.typography.lineHeights[100]),ios:undefined}),textAlignVertical:props.isTextArea?'top':'center'},props.isTextArea?{}:{paddingTop:0,paddingBottom:0,height:undefined,minHeight:undefined},props.isTextArea||props.hasTags?Object.assign({height:getInputHeight({isTextArea:props.isTextArea,hasTags:props.hasTags,numberOfLines:props.numberOfLines,isDropdownTrigger:props.isDropdownTrigger,size:props.$size,autoGrowMaxHeight:props.$autoGrowMaxHeight})},props.isTextArea&&props.$autoGrowMaxHeight?{minHeight:`${baseInputHeight[props.$size]*(props.isDropdownTrigger?1:(_props$numberOfLines=props.numberOfLines)!=null?_props$numberOfLines:1)}px`}:{}):{});};var StyledNativeBaseInput=styled.TextInput(function(_ref2){var id=_ref2.id,isFocused=_ref2.isFocused,theme=_ref2.theme,editable=_ref2.editable,validationState=_ref2.validationState,leadingIcon=_ref2.leadingIcon,prefix=_ref2.prefix,trailingInteractionElement=_ref2.trailingInteractionElement,leadingInteractionElement=_ref2.leadingInteractionElement,suffix=_ref2.suffix,trailingIcon=_ref2.trailingIcon,isTextArea=_ref2.isTextArea,numberOfLines=_ref2.numberOfLines,$autoGrowMaxHeight=_ref2.$autoGrowMaxHeight,isDropdownTrigger=_ref2.isDropdownTrigger,hasTags=_ref2.hasTags,$size=_ref2.$size,$padding=_ref2.$padding,isTableInputCell=_ref2.isTableInputCell,valueComponentType=_ref2.valueComponentType;return getRNInputStyles({id:id,isFocused:isFocused,theme:theme,editable:editable,validationState:validationState,leadingIcon:leadingIcon,prefix:prefix,trailingInteractionElement:trailingInteractionElement,leadingInteractionElement:leadingInteractionElement,suffix:suffix,trailingIcon:trailingIcon,isTextArea:isTextArea,numberOfLines:numberOfLines,$autoGrowMaxHeight:$autoGrowMaxHeight,hasTags:hasTags,isDropdownTrigger:isDropdownTrigger,$size:$size,$padding:$padding,valueComponentType:valueComponentType,isTableInputCell:isTableInputCell});});var StyledNativeBaseButton=styled.TouchableOpacity(function(_ref3){var id=_ref3.id,isFocused=_ref3.isFocused,theme=_ref3.theme,editable=_ref3.editable,validationState=_ref3.validationState,leadingIcon=_ref3.leadingIcon,prefix=_ref3.prefix,trailingInteractionElement=_ref3.trailingInteractionElement,leadingInteractionElement=_ref3.leadingInteractionElement,suffix=_ref3.suffix,trailingIcon=_ref3.trailingIcon,isTextArea=_ref3.isTextArea,numberOfLines=_ref3.numberOfLines,$autoGrowMaxHeight=_ref3.$autoGrowMaxHeight,isDropdownTrigger=_ref3.isDropdownTrigger,hasTags=_ref3.hasTags,$size=_ref3.$size,$padding=_ref3.$padding,isTableInputCell=_ref3.isTableInputCell,valueComponentType=_ref3.valueComponentType;return Object.assign({},getRNInputStyles({id:id,isFocused:isFocused,theme:theme,editable:editable,validationState:validationState,leadingIcon:leadingIcon,prefix:prefix,trailingInteractionElement:trailingInteractionElement,leadingInteractionElement:leadingInteractionElement,suffix:suffix,trailingIcon:trailingIcon,isTextArea:isTextArea,numberOfLines:numberOfLines,$autoGrowMaxHeight:$autoGrowMaxHeight,isDropdownTrigger:isDropdownTrigger,hasTags:hasTags,$size:$size,$padding:$padding,valueComponentType:valueComponentType,isTableInputCell:isTableInputCell}));});var _StyledBaseInput=function _StyledBaseInput(_ref4,ref){var _props$textAlign;var name=_ref4.name,isRequired=_ref4.isRequired,isDisabled=_ref4.isDisabled,maxCharacters=_ref4.maxCharacters,handleOnFocus=_ref4.handleOnFocus,handleOnChange=_ref4.handleOnChange,handleOnBlur=_ref4.handleOnBlur,handleOnSubmit=_ref4.handleOnSubmit,handleOnInput=_ref4.handleOnInput,handleOnKeyDown=_ref4.handleOnKeyDown,handleOnClick=_ref4.handleOnClick,_ref4$keyboardType=_ref4.keyboardType,keyboardType=_ref4$keyboardType===void 0?'text':_ref4$keyboardType,keyboardReturnKeyType=_ref4.keyboardReturnKeyType,autoCompleteSuggestionType=_ref4.autoCompleteSuggestionType,accessibilityProps=_ref4.accessibilityProps,currentInteraction=_ref4.currentInteraction,setCurrentInteraction=_ref4.setCurrentInteraction,type=_ref4.type,numberOfLines=_ref4.numberOfLines,autoGrowMaxHeight=_ref4.autoGrowMaxHeight,isTextArea=_ref4.isTextArea,hasPopup=_ref4.hasPopup,shouldIgnoreBlurAnimation=_ref4.shouldIgnoreBlurAnimation,autoCapitalize=_ref4.autoCapitalize,renderAs=_ref4.as,$size=_ref4.$size,valueSuffix=_ref4.valueSuffix,props=_objectWithoutProperties(_ref4,_excluded);var buttonValue=props.value?props.value:props.placeholder;var _useTheme=useTheme(),theme=_useTheme.theme;var isAutoGrowing=Boolean(isTextArea&&autoGrowMaxHeight);var minAutoGrowHeight=baseInputHeight[$size]*(props.isDropdownTrigger?1:numberOfLines!=null?numberOfLines:1);var _React$useState=React__default.useState(minAutoGrowHeight),_React$useState2=_slicedToArray(_React$useState,2),autoGrowHeight=_React$useState2[0],setAutoGrowHeight=_React$useState2[1];React__default.useEffect(function(){if(!isAutoGrowing){return;}setAutoGrowHeight(minAutoGrowHeight);},[isAutoGrowing,minAutoGrowHeight]);var commonProps={onBlur:function onBlur(){if(!shouldIgnoreBlurAnimation){setCurrentInteraction('default');}},isFocused:currentInteraction==='focus'};return renderAs==='button'?jsx(StyledNativeBaseButton,Object.assign({ref:ref,onPress:function onPress(){handleOnClick==null?void 0:handleOnClick({name:name,value:props.value});},onFocus:function onFocus(){handleOnFocus==null?void 0:handleOnFocus({name:name,value:props.value});setCurrentInteraction('focus');},as:undefined,$size:$size},commonProps,props,accessibilityProps,{children:jsxs(BaseBox,{display:"flex",flexDirection:"row",alignItems:"center",gap:"spacing.3",width:"100%",children:[jsx(Text,{color:props.value&&!isDisabled?'interactive.text.gray.normal':'surface.text.gray.disabled',truncateAfterLines:1,textAlign:(_props$textAlign=props.textAlign)!=null?_props$textAlign:'left',size:$size,children:buttonValue}),valueSuffix]})})):jsx(StyledNativeBaseInput,Object.assign({ref:ref,multiline:isTextArea,numberOfLines:numberOfLines,editable:!isDisabled,maxLength:maxCharacters,placeholderTextColor:theme.colors.surface.text.gray.disabled,onFocus:function onFocus(event){handleOnFocus==null?void 0:handleOnFocus({name:name,value:event==null?void 0:event.nativeEvent.text});handleOnClick==null?void 0:handleOnClick({name:name,value:event==null?void 0:event.nativeEvent.text});setCurrentInteraction('focus');},onChangeText:function onChangeText(text){handleOnChange==null?void 0:handleOnChange({name:name,value:text});handleOnInput==null?void 0:handleOnInput({name:name,value:text});},onEndEditing:function onEndEditing(event){return handleOnBlur==null?void 0:handleOnBlur({name:name,value:event==null?void 0:event.nativeEvent.text});},onSubmitEditing:function onSubmitEditing(event){return handleOnSubmit==null?void 0:handleOnSubmit({name:name,value:event==null?void 0:event.nativeEvent.text});},onKeyPress:function onKeyPress(event){handleOnKeyDown==null?void 0:handleOnKeyDown({name:name,key:event==null?void 0:event.nativeEvent.key,event:event});},onContentSizeChange:isAutoGrowing&&autoGrowMaxHeight?function(event){var nextHeight=Math.min(Math.max(event.nativeEvent.contentSize.height,minAutoGrowHeight),autoGrowMaxHeight);setAutoGrowHeight(nextHeight);}:undefined,keyboardType:KeyboardTypeToNativeValuesMap[keyboardType],returnKeyType:keyboardReturnKeyType,autoCompleteType:autoCompleteSuggestionType?autoCompleteSuggestionTypeAndroid[autoCompleteSuggestionType]:undefined,secureTextEntry:type==='password',isTextArea:isTextArea,$autoGrowMaxHeight:isAutoGrowing?autoGrowMaxHeight:undefined,textContentType:autoCompleteSuggestionType?autoCompleteSuggestionTypeIOS[autoCompleteSuggestionType]:undefined,autoCapitalize:autoCapitalize,includeFontPadding:false,$size:$size,scrollEnabled:isAutoGrowing?autoGrowHeight>=autoGrowMaxHeight:undefined},commonProps,props,accessibilityProps,{style:isAutoGrowing?{height:autoGrowHeight,maxHeight:autoGrowMaxHeight}:undefined}));};var StyledBaseInput=assignWithoutSideEffects(React__default.forwardRef(_StyledBaseInput),{displayName:'StyledBaseInput'});
|
|
22
|
+
var _excluded=["name","isRequired","isDisabled","maxCharacters","handleOnFocus","handleOnChange","handleOnBlur","handleOnSubmit","handleOnInput","handleOnKeyDown","handleOnClick","keyboardType","keyboardReturnKeyType","autoCompleteSuggestionType","accessibilityProps","currentInteraction","setCurrentInteraction","type","numberOfLines","autoGrowMaxHeight","isTextArea","hasPopup","shouldIgnoreBlurAnimation","autoCapitalize","as","$size","valueSuffix"];var _this=undefined,_jsxFileName="/home/runner/work/blade/blade/packages/blade/src/components/Input/BaseInput/StyledBaseInput.native.tsx";var autoCompleteSuggestionTypeAndroid={none:'off',name:'name',email:'email',username:'username',password:'password',newPassword:'password-new',oneTimeCode:'sms-otp',telephone:'tel',postalCode:'postal-code',countryName:'postal-address-country',creditCardNumber:'cc-number',creditCardCSC:'cc-csc',creditCardExpiry:'cc-exp',creditCardExpiryMonth:'cc-exp-month',creditCardExpiryYear:'cc-exp-year'};var autoCompleteSuggestionTypeIOS={none:'none',name:'name',email:'emailAddress',username:'username',password:'password',newPassword:'newPassword',oneTimeCode:'oneTimeCode',telephone:'telephoneNumber',postalCode:'postalCode',countryName:'countryName',creditCardNumber:'creditCardNumber',creditCardCSC:'none',creditCardExpiry:'none',creditCardExpiryMonth:'none',creditCardExpiryYear:'none'};var KeyboardTypeToNativeValuesMap={text:'default',search:'default',telephone:'phone-pad',email:'email-address',url:'url',decimal:'decimal-pad'};var getInputHeight=function getInputHeight(_ref){var isTextArea=_ref.isTextArea,hasTags=_ref.hasTags,numberOfLines=_ref.numberOfLines,isDropdownTrigger=_ref.isDropdownTrigger,size$1=_ref.size,autoGrowMaxHeight=_ref.autoGrowMaxHeight;if(isTextArea){if(autoGrowMaxHeight){return undefined;}var lines=isDropdownTrigger?1:numberOfLines!=null?numberOfLines:0;return `${baseInputHeight[size$1]*lines}px`;}if(hasTags){return undefined;}return makeSize(size[baseInputHeight[size$1]]);};var getRNInputStyles=function getRNInputStyles(props){var _props$numberOfLines;return Object.assign({},getBaseInputStyles({theme:props.theme,isFocused:props.isFocused,isDisabled:!props.editable,validationState:props.validationState,leadingIcon:props.leadingIcon,prefix:props.prefix,trailingInteractionElement:props.trailingInteractionElement,leadingInteractionElement:props.leadingInteractionElement,suffix:props.suffix,trailingIcon:props.trailingIcon,isTextArea:props.isTextArea,hasTags:props.hasTags,isDropdownTrigger:props.isDropdownTrigger,size:props.$size,padding:props.$padding,valueComponentType:props.valueComponentType,isTableInputCell:props.isTableInputCell}),{lineHeight:Platform.select({android:makeSize(props.theme.typography.lineHeights[100]),ios:undefined}),textAlignVertical:props.isTextArea?'top':'center'},props.isTextArea?{}:{paddingTop:0,paddingBottom:0,height:undefined,minHeight:undefined},props.isTextArea||props.hasTags?Object.assign({height:getInputHeight({isTextArea:props.isTextArea,hasTags:props.hasTags,numberOfLines:props.numberOfLines,isDropdownTrigger:props.isDropdownTrigger,size:props.$size,autoGrowMaxHeight:props.$autoGrowMaxHeight})},props.isTextArea&&props.$autoGrowMaxHeight?{minHeight:`${baseInputHeight[props.$size]*(props.isDropdownTrigger?1:(_props$numberOfLines=props.numberOfLines)!=null?_props$numberOfLines:1)}px`}:{}):{});};var StyledNativeBaseInput=styled.TextInput(function(_ref2){var id=_ref2.id,isFocused=_ref2.isFocused,theme=_ref2.theme,editable=_ref2.editable,validationState=_ref2.validationState,leadingIcon=_ref2.leadingIcon,prefix=_ref2.prefix,trailingInteractionElement=_ref2.trailingInteractionElement,leadingInteractionElement=_ref2.leadingInteractionElement,suffix=_ref2.suffix,trailingIcon=_ref2.trailingIcon,isTextArea=_ref2.isTextArea,numberOfLines=_ref2.numberOfLines,$autoGrowMaxHeight=_ref2.$autoGrowMaxHeight,isDropdownTrigger=_ref2.isDropdownTrigger,hasTags=_ref2.hasTags,$size=_ref2.$size,$padding=_ref2.$padding,isTableInputCell=_ref2.isTableInputCell,valueComponentType=_ref2.valueComponentType;return getRNInputStyles({id:id,isFocused:isFocused,theme:theme,editable:editable,validationState:validationState,leadingIcon:leadingIcon,prefix:prefix,trailingInteractionElement:trailingInteractionElement,leadingInteractionElement:leadingInteractionElement,suffix:suffix,trailingIcon:trailingIcon,isTextArea:isTextArea,numberOfLines:numberOfLines,$autoGrowMaxHeight:$autoGrowMaxHeight,hasTags:hasTags,isDropdownTrigger:isDropdownTrigger,$size:$size,$padding:$padding,valueComponentType:valueComponentType,isTableInputCell:isTableInputCell});});var StyledNativeBaseButton=styled.TouchableOpacity(function(_ref3){var id=_ref3.id,isFocused=_ref3.isFocused,theme=_ref3.theme,editable=_ref3.editable,validationState=_ref3.validationState,leadingIcon=_ref3.leadingIcon,prefix=_ref3.prefix,trailingInteractionElement=_ref3.trailingInteractionElement,leadingInteractionElement=_ref3.leadingInteractionElement,suffix=_ref3.suffix,trailingIcon=_ref3.trailingIcon,isTextArea=_ref3.isTextArea,numberOfLines=_ref3.numberOfLines,$autoGrowMaxHeight=_ref3.$autoGrowMaxHeight,isDropdownTrigger=_ref3.isDropdownTrigger,hasTags=_ref3.hasTags,$size=_ref3.$size,$padding=_ref3.$padding,isTableInputCell=_ref3.isTableInputCell,valueComponentType=_ref3.valueComponentType;return Object.assign({},getRNInputStyles({id:id,isFocused:isFocused,theme:theme,editable:editable,validationState:validationState,leadingIcon:leadingIcon,prefix:prefix,trailingInteractionElement:trailingInteractionElement,leadingInteractionElement:leadingInteractionElement,suffix:suffix,trailingIcon:trailingIcon,isTextArea:isTextArea,numberOfLines:numberOfLines,$autoGrowMaxHeight:$autoGrowMaxHeight,isDropdownTrigger:isDropdownTrigger,hasTags:hasTags,$size:$size,$padding:$padding,valueComponentType:valueComponentType,isTableInputCell:isTableInputCell}));});var _StyledBaseInput=function _StyledBaseInput(_ref4,ref){var _props$textAlign;var name=_ref4.name,isRequired=_ref4.isRequired,isDisabled=_ref4.isDisabled,maxCharacters=_ref4.maxCharacters,handleOnFocus=_ref4.handleOnFocus,handleOnChange=_ref4.handleOnChange,handleOnBlur=_ref4.handleOnBlur,handleOnSubmit=_ref4.handleOnSubmit,handleOnInput=_ref4.handleOnInput,handleOnKeyDown=_ref4.handleOnKeyDown,handleOnClick=_ref4.handleOnClick,_ref4$keyboardType=_ref4.keyboardType,keyboardType=_ref4$keyboardType===void 0?'text':_ref4$keyboardType,keyboardReturnKeyType=_ref4.keyboardReturnKeyType,autoCompleteSuggestionType=_ref4.autoCompleteSuggestionType,accessibilityProps=_ref4.accessibilityProps,currentInteraction=_ref4.currentInteraction,setCurrentInteraction=_ref4.setCurrentInteraction,type=_ref4.type,numberOfLines=_ref4.numberOfLines,autoGrowMaxHeight=_ref4.autoGrowMaxHeight,isTextArea=_ref4.isTextArea,hasPopup=_ref4.hasPopup,shouldIgnoreBlurAnimation=_ref4.shouldIgnoreBlurAnimation,autoCapitalize=_ref4.autoCapitalize,renderAs=_ref4.as,$size=_ref4.$size,valueSuffix=_ref4.valueSuffix,props=_objectWithoutProperties(_ref4,_excluded);var buttonValue=props.value?props.value:props.placeholder;var _useTheme=useTheme(),theme=_useTheme.theme;var isAutoGrowing=Boolean(isTextArea&&autoGrowMaxHeight);var minAutoGrowHeight=baseInputHeight[$size]*(props.isDropdownTrigger?1:numberOfLines!=null?numberOfLines:1);var _React$useState=React__default.useState(minAutoGrowHeight),_React$useState2=_slicedToArray(_React$useState,2),autoGrowHeight=_React$useState2[0],setAutoGrowHeight=_React$useState2[1];React__default.useEffect(function(){if(!isAutoGrowing){return;}setAutoGrowHeight(minAutoGrowHeight);},[isAutoGrowing,minAutoGrowHeight]);var commonProps={onBlur:function onBlur(){if(!shouldIgnoreBlurAnimation){setCurrentInteraction('default');}},isFocused:currentInteraction==='focus'};return renderAs==='button'?jsx(StyledNativeBaseButton,Object.assign({ref:ref,onPress:function onPress(){handleOnClick==null?void 0:handleOnClick({name:name,value:props.value});},onFocus:function onFocus(){handleOnFocus==null?void 0:handleOnFocus({name:name,value:props.value});setCurrentInteraction('focus');},as:undefined,$size:$size},commonProps,props,accessibilityProps,{children:jsxs(BaseBox,{display:"flex",flexDirection:"row",alignItems:"center",gap:"spacing.3",width:"100%",children:[jsx(Text,{color:props.value&&!isDisabled?'interactive.text.gray.normal':'surface.text.gray.disabled',truncateAfterLines:1,textAlign:(_props$textAlign=props.textAlign)!=null?_props$textAlign:'left',size:$size,children:buttonValue}),valueSuffix]})})):jsx(StyledNativeBaseInput,Object.assign({ref:ref,multiline:isTextArea,numberOfLines:numberOfLines,editable:!isDisabled,maxLength:maxCharacters,placeholderTextColor:theme.colors.surface.text.gray.disabled,onFocus:function onFocus(event){handleOnFocus==null?void 0:handleOnFocus({name:name,value:event==null?void 0:event.nativeEvent.text});handleOnClick==null?void 0:handleOnClick({name:name,value:event==null?void 0:event.nativeEvent.text});setCurrentInteraction('focus');},onChangeText:function onChangeText(text){handleOnChange==null?void 0:handleOnChange({name:name,value:text});handleOnInput==null?void 0:handleOnInput({name:name,value:text});},onEndEditing:function onEndEditing(event){return handleOnBlur==null?void 0:handleOnBlur({name:name,value:event==null?void 0:event.nativeEvent.text});},onSubmitEditing:function onSubmitEditing(event){return handleOnSubmit==null?void 0:handleOnSubmit({name:name,value:event==null?void 0:event.nativeEvent.text});},onKeyPress:function onKeyPress(event){handleOnKeyDown==null?void 0:handleOnKeyDown({name:name,key:event==null?void 0:event.nativeEvent.key,event:event});},onContentSizeChange:isAutoGrowing&&autoGrowMaxHeight?function(event){var nextHeight=Math.min(Math.max(event.nativeEvent.contentSize.height,minAutoGrowHeight),autoGrowMaxHeight);setAutoGrowHeight(nextHeight);}:undefined,keyboardType:KeyboardTypeToNativeValuesMap[keyboardType],returnKeyType:keyboardReturnKeyType,autoComplete:autoCompleteSuggestionType?autoCompleteSuggestionTypeAndroid[autoCompleteSuggestionType]:undefined,secureTextEntry:type==='password',isTextArea:isTextArea,$autoGrowMaxHeight:isAutoGrowing?autoGrowMaxHeight:undefined,textContentType:autoCompleteSuggestionType?autoCompleteSuggestionTypeIOS[autoCompleteSuggestionType]:undefined,autoCapitalize:autoCapitalize,includeFontPadding:false,$size:$size,scrollEnabled:isAutoGrowing?autoGrowHeight>=autoGrowMaxHeight:undefined},commonProps,props,accessibilityProps,{style:isAutoGrowing?{height:autoGrowHeight,maxHeight:autoGrowMaxHeight}:undefined}));};var StyledBaseInput=assignWithoutSideEffects(React__default.forwardRef(_StyledBaseInput),{displayName:'StyledBaseInput'});
|
|
23
23
|
|
|
24
24
|
export { StyledBaseInput };
|
|
25
25
|
//# sourceMappingURL=StyledBaseInput.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StyledBaseInput.native.js","sources":["../../../../../../src/components/Input/BaseInput/StyledBaseInput.native.tsx"],"sourcesContent":["import React from 'react';\nimport styled from 'styled-components/native';\nimport type { CSSObject, ThemeProps, DefaultTheme } from 'styled-components';\nimport type {\n TextInputProps,\n TouchableHighlight,\n TouchableHighlightProps,\n GestureResponderEvent,\n TextInput,\n} from 'react-native';\nimport { Platform as RNPlatform } from 'react-native';\nimport type { BaseInputProps } from './BaseInput';\nimport type { StyledBaseInputProps } from './types';\nimport { getBaseInputStyles } from './baseInputStyles';\nimport { baseInputHeight } from './baseInputTokens';\nimport { Text } from '~components/Typography';\nimport { useTheme } from '~components/BladeProvider';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { size as sizeToken } from '~tokens/global';\nimport { makeSize } from '~utils/makeSize';\nimport type { Platform } from '~utils';\nimport BaseBox from '~components/Box/BaseBox';\n\ntype StyledComponentAutoCompleteAndroid =\n | 'off'\n | 'name'\n | 'cc-csc'\n | 'cc-exp'\n | 'cc-exp-month'\n | 'cc-exp-year'\n | 'cc-number'\n | 'email'\n | 'username'\n | 'password'\n | 'postal-code'\n | 'tel'\n | undefined;\n\nconst autoCompleteSuggestionTypeAndroid = {\n none: 'off',\n name: 'name',\n email: 'email',\n username: 'username',\n password: 'password',\n newPassword: 'password-new',\n oneTimeCode: 'sms-otp',\n telephone: 'tel',\n postalCode: 'postal-code',\n countryName: 'postal-address-country',\n creditCardNumber: 'cc-number',\n creditCardCSC: 'cc-csc',\n creditCardExpiry: 'cc-exp',\n creditCardExpiryMonth: 'cc-exp-month',\n creditCardExpiryYear: 'cc-exp-year',\n} as const;\n\nconst autoCompleteSuggestionTypeIOS = {\n none: 'none',\n name: 'name',\n email: 'emailAddress',\n username: 'username',\n password: 'password',\n newPassword: 'newPassword',\n oneTimeCode: 'oneTimeCode',\n telephone: 'telephoneNumber',\n postalCode: 'postalCode',\n countryName: 'countryName',\n creditCardNumber: 'creditCardNumber',\n creditCardCSC: 'none',\n creditCardExpiry: 'none',\n creditCardExpiryMonth: 'none',\n creditCardExpiryYear: 'none',\n} as const;\n\nconst KeyboardTypeToNativeValuesMap = {\n text: 'default',\n search: 'default',\n telephone: 'phone-pad',\n email: 'email-address',\n url: 'url',\n decimal: 'decimal-pad',\n};\n\ntype StyledComponentInputProps = Omit<\n StyledBaseInputProps,\n 'accessibilityProps' | 'setCurrentInteraction' | 'currentInteraction' | 'autoGrowMaxHeight'\n> & {\n isTextArea?: boolean;\n isFocused: boolean;\n autoCompleteType?: typeof autoCompleteSuggestionTypeAndroid[keyof typeof autoCompleteSuggestionTypeAndroid];\n editable?: boolean;\n onPress?: (event: GestureResponderEvent) => void;\n $size: NonNullable<BaseInputProps['size']>;\n /** Transient — must not forward to native TextInput */\n $autoGrowMaxHeight?: number;\n};\n\nconst getInputHeight = ({\n isTextArea,\n hasTags,\n numberOfLines,\n isDropdownTrigger,\n size,\n autoGrowMaxHeight,\n}: Pick<StyledBaseInputProps, 'hasTags' | 'isTextArea' | 'numberOfLines' | 'isDropdownTrigger'> & {\n size: NonNullable<BaseInputProps['size']>;\n autoGrowMaxHeight?: number;\n}): string | undefined => {\n if (isTextArea) {\n // Auto-grow textareas manage height via inline styles + onContentSizeChange\n if (autoGrowMaxHeight) {\n return undefined;\n }\n const lines = isDropdownTrigger ? 1 : numberOfLines ?? 0;\n return `${baseInputHeight[size] * lines}px`;\n }\n\n if (hasTags) {\n return undefined; // we don't set height on input. We set it on wrapper to properly include tags in overall height\n }\n\n return makeSize(sizeToken[baseInputHeight[size]]);\n};\n\nconst getRNInputStyles = (\n props: StyledComponentInputProps &\n ThemeProps<DefaultTheme> &\n (TextInputProps | TouchableHighlightProps),\n): CSSObject => {\n return {\n ...getBaseInputStyles({\n theme: props.theme,\n isFocused: props.isFocused,\n isDisabled: !props.editable,\n validationState: props.validationState,\n leadingIcon: props.leadingIcon,\n prefix: props.prefix,\n trailingInteractionElement: props.trailingInteractionElement,\n leadingInteractionElement: props.leadingInteractionElement,\n suffix: props.suffix,\n trailingIcon: props.trailingIcon,\n isTextArea: props.isTextArea,\n hasTags: props.hasTags,\n isDropdownTrigger: props.isDropdownTrigger,\n size: props.$size,\n padding: props.$padding,\n valueComponentType: props.valueComponentType,\n isTableInputCell: props.isTableInputCell,\n }),\n lineHeight: RNPlatform.select({\n android: makeSize(props.theme.typography.lineHeights[100]),\n ios: undefined,\n }),\n textAlignVertical: props.isTextArea ? 'top' : 'center',\n ...(props.isTextArea\n ? {}\n : {\n paddingTop: 0,\n paddingBottom: 0,\n height: undefined,\n minHeight: undefined,\n }),\n ...(props.isTextArea || props.hasTags\n ? {\n height: getInputHeight({\n isTextArea: props.isTextArea,\n hasTags: props.hasTags,\n numberOfLines: props.numberOfLines,\n isDropdownTrigger: props.isDropdownTrigger,\n size: props.$size,\n autoGrowMaxHeight: props.$autoGrowMaxHeight,\n }),\n ...(props.isTextArea && props.$autoGrowMaxHeight\n ? {\n minHeight: `${\n baseInputHeight[props.$size] *\n (props.isDropdownTrigger ? 1 : props.numberOfLines ?? 1)\n }px`,\n }\n : {}),\n }\n : {}),\n };\n};\nconst StyledNativeBaseInput = styled.TextInput<StyledComponentInputProps>(\n ({\n id,\n isFocused,\n theme,\n editable,\n validationState,\n leadingIcon,\n prefix,\n trailingInteractionElement,\n leadingInteractionElement,\n suffix,\n trailingIcon,\n isTextArea,\n numberOfLines,\n $autoGrowMaxHeight,\n isDropdownTrigger,\n hasTags,\n $size,\n $padding,\n isTableInputCell,\n valueComponentType,\n }) =>\n getRNInputStyles({\n id,\n isFocused,\n theme,\n editable,\n validationState,\n leadingIcon,\n prefix,\n trailingInteractionElement,\n leadingInteractionElement,\n suffix,\n trailingIcon,\n isTextArea,\n numberOfLines,\n $autoGrowMaxHeight,\n hasTags,\n isDropdownTrigger,\n $size,\n $padding,\n valueComponentType,\n isTableInputCell,\n }),\n);\nconst StyledNativeBaseButton = styled.TouchableOpacity<StyledComponentInputProps>(\n ({\n id,\n isFocused,\n theme,\n editable,\n validationState,\n leadingIcon,\n prefix,\n trailingInteractionElement,\n leadingInteractionElement,\n suffix,\n trailingIcon,\n isTextArea,\n numberOfLines,\n $autoGrowMaxHeight,\n isDropdownTrigger,\n hasTags,\n $size,\n $padding,\n isTableInputCell,\n valueComponentType,\n }) => ({\n ...getRNInputStyles({\n id,\n isFocused,\n theme,\n editable,\n validationState,\n leadingIcon,\n prefix,\n trailingInteractionElement,\n leadingInteractionElement,\n suffix,\n trailingIcon,\n isTextArea,\n numberOfLines,\n $autoGrowMaxHeight,\n isDropdownTrigger,\n hasTags,\n $size,\n $padding,\n valueComponentType,\n isTableInputCell,\n }),\n }),\n);\n\nconst _StyledBaseInput: React.ForwardRefRenderFunction<\n TextInput | TouchableHighlight,\n StyledBaseInputProps\n> = (\n {\n name,\n isRequired,\n isDisabled,\n maxCharacters,\n handleOnFocus,\n handleOnChange,\n handleOnBlur,\n handleOnSubmit,\n handleOnInput,\n handleOnKeyDown,\n handleOnClick,\n keyboardType = 'text',\n keyboardReturnKeyType,\n autoCompleteSuggestionType,\n accessibilityProps,\n currentInteraction,\n setCurrentInteraction,\n type,\n numberOfLines,\n autoGrowMaxHeight,\n isTextArea,\n hasPopup,\n shouldIgnoreBlurAnimation,\n autoCapitalize,\n as: renderAs,\n $size,\n valueSuffix,\n ...props\n },\n ref,\n) => {\n const buttonValue = props.value ? props.value : props.placeholder;\n const { theme } = useTheme();\n // Auto-grow is opt-in (ChatInput only today). Default path must match prior textarea height behavior.\n const isAutoGrowing = Boolean(isTextArea && autoGrowMaxHeight);\n const minAutoGrowHeight =\n baseInputHeight[$size] * (props.isDropdownTrigger ? 1 : numberOfLines ?? 1);\n const [autoGrowHeight, setAutoGrowHeight] = React.useState(minAutoGrowHeight);\n\n React.useEffect(() => {\n if (!isAutoGrowing) {\n return;\n }\n setAutoGrowHeight(minAutoGrowHeight);\n }, [isAutoGrowing, minAutoGrowHeight]);\n\n const commonProps = {\n onBlur: (): void => {\n // In certain cases like SelectInput, we want to ignore the blur animation when option item is clicked.\n // The selectinput should always look like it is in focus otherwise it triggers blur + focus again which can cause flicker\n if (!shouldIgnoreBlurAnimation) {\n setCurrentInteraction('default');\n }\n },\n isFocused: currentInteraction === 'focus',\n };\n\n return renderAs === 'button' ? (\n <StyledNativeBaseButton\n // the types of styled-components for react-native is creating a mess, so there's no other option but to type `ref` as any\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ref={ref as any}\n onPress={(): void => {\n handleOnClick?.({ name, value: props.value });\n }}\n onFocus={(): void => {\n handleOnFocus?.({ name, value: props.value });\n setCurrentInteraction('focus');\n }}\n as={undefined}\n $size={$size}\n {...commonProps}\n {...props}\n {...accessibilityProps}\n >\n <BaseBox display=\"flex\" flexDirection=\"row\" alignItems=\"center\" gap=\"spacing.3\" width=\"100%\">\n <Text\n color={\n props.value && !isDisabled\n ? 'interactive.text.gray.normal'\n : 'surface.text.gray.disabled'\n }\n truncateAfterLines={1}\n textAlign={props.textAlign ?? 'left'}\n size={$size}\n >\n {buttonValue}\n </Text>\n {valueSuffix}\n </BaseBox>\n </StyledNativeBaseButton>\n ) : (\n <StyledNativeBaseInput\n // the types of styled-components for react-native is creating a mess, so there's no other option but to type `ref` as any\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ref={ref as any}\n multiline={isTextArea}\n numberOfLines={numberOfLines}\n editable={!isDisabled}\n maxLength={maxCharacters}\n placeholderTextColor={theme.colors.surface.text.gray.disabled}\n onFocus={(event): void => {\n handleOnFocus?.({ name, value: event?.nativeEvent.text });\n // React Native does not have native onPress event on Input elements so for consistency of API we call it on onFocus which also gets triggered on clicks\n handleOnClick?.({ name, value: event?.nativeEvent.text });\n setCurrentInteraction('focus');\n }}\n onChangeText={(text): void => {\n handleOnChange?.({ name, value: text });\n handleOnInput?.({ name, value: text });\n }}\n onEndEditing={(event): void => handleOnBlur?.({ name, value: event?.nativeEvent.text })}\n onSubmitEditing={(event): void => handleOnSubmit?.({ name, value: event?.nativeEvent.text })}\n onKeyPress={(event): void => {\n handleOnKeyDown?.({\n name,\n key: event?.nativeEvent.key,\n event: (event as unknown) as React.KeyboardEvent<HTMLInputElement>, // TODO: handle platform specific type\n });\n }}\n onContentSizeChange={\n isAutoGrowing && autoGrowMaxHeight\n ? (event): void => {\n const nextHeight = Math.min(\n Math.max(event.nativeEvent.contentSize.height, minAutoGrowHeight),\n autoGrowMaxHeight,\n );\n setAutoGrowHeight(nextHeight);\n }\n : undefined\n }\n // @ts-expect-error styled-components have limited keyboard types('default' | 'email-address' | 'numeric' | 'phone-pad' | 'number-pad' | 'decimal-pad') compared to the actual supported types so ignoring the error.\n // source: https://reactnative.dev/docs/textinput/#keyboardtype\n keyboardType={KeyboardTypeToNativeValuesMap[keyboardType]}\n returnKeyType={keyboardReturnKeyType}\n autoCompleteType={\n autoCompleteSuggestionType\n ? (autoCompleteSuggestionTypeAndroid[\n autoCompleteSuggestionType as Platform.CastNative<\n BaseInputProps['autoCompleteSuggestionType']\n >\n ] as StyledComponentAutoCompleteAndroid)\n : undefined\n }\n secureTextEntry={type === 'password'}\n isTextArea={isTextArea}\n // Transient styled prop — never forwarded to native TextInput\n $autoGrowMaxHeight={isAutoGrowing ? autoGrowMaxHeight : undefined}\n textContentType={\n autoCompleteSuggestionType\n ? autoCompleteSuggestionTypeIOS[\n autoCompleteSuggestionType as Platform.CastNative<\n BaseInputProps['autoCompleteSuggestionType']\n >\n ]\n : undefined\n }\n autoCapitalize={autoCapitalize}\n includeFontPadding={false}\n $size={$size}\n scrollEnabled={isAutoGrowing ? autoGrowHeight >= (autoGrowMaxHeight as number) : undefined}\n {...commonProps}\n {...props}\n {...accessibilityProps}\n style={isAutoGrowing ? { height: autoGrowHeight, maxHeight: autoGrowMaxHeight } : undefined}\n />\n );\n};\n\nconst StyledBaseInput = assignWithoutSideEffects(React.forwardRef(_StyledBaseInput), {\n displayName: 'StyledBaseInput',\n});\n\nexport { StyledBaseInput };\n"],"names":["autoCompleteSuggestionTypeAndroid","none","name","email","username","password","newPassword","oneTimeCode","telephone","postalCode","countryName","creditCardNumber","creditCardCSC","creditCardExpiry","creditCardExpiryMonth","creditCardExpiryYear","autoCompleteSuggestionTypeIOS","KeyboardTypeToNativeValuesMap","text","search","url","decimal","getInputHeight","_ref","isTextArea","hasTags","numberOfLines","isDropdownTrigger","size","autoGrowMaxHeight","undefined","lines","baseInputHeight","makeSize","sizeToken","getRNInputStyles","props","_props$numberOfLines","Object","assign","getBaseInputStyles","theme","isFocused","isDisabled","editable","validationState","leadingIcon","prefix","trailingInteractionElement","leadingInteractionElement","suffix","trailingIcon","$size","padding","$padding","valueComponentType","isTableInputCell","lineHeight","RNPlatform","select","android","typography","lineHeights","ios","textAlignVertical","paddingTop","paddingBottom","height","minHeight","$autoGrowMaxHeight","StyledNativeBaseInput","styled","TextInput","_ref2","id","StyledNativeBaseButton","TouchableOpacity","_ref3","_StyledBaseInput","_ref4","ref","_props$textAlign","isRequired","maxCharacters","handleOnFocus","handleOnChange","handleOnBlur","handleOnSubmit","handleOnInput","handleOnKeyDown","handleOnClick","_ref4$keyboardType","keyboardType","keyboardReturnKeyType","autoCompleteSuggestionType","accessibilityProps","currentInteraction","setCurrentInteraction","type","hasPopup","shouldIgnoreBlurAnimation","autoCapitalize","renderAs","as","valueSuffix","_objectWithoutProperties","_excluded","buttonValue","value","placeholder","_useTheme","useTheme","isAutoGrowing","Boolean","minAutoGrowHeight","_React$useState","React","useState","_React$useState2","_slicedToArray","autoGrowHeight","setAutoGrowHeight","useEffect","commonProps","onBlur","_jsx","onPress","onFocus","children","_jsxs","BaseBox","display","flexDirection","alignItems","gap","width","Text","color","truncateAfterLines","textAlign","multiline","maxLength","placeholderTextColor","colors","surface","gray","disabled","event","nativeEvent","onChangeText","onEndEditing","onSubmitEditing","onKeyPress","key","onContentSizeChange","nextHeight","Math","min","max","contentSize","returnKeyType","autoCompleteType","secureTextEntry","textContentType","includeFontPadding","scrollEnabled","style","maxHeight","StyledBaseInput","assignWithoutSideEffects","forwardRef","displayName"],"mappings":";;;;;;;;;;;;;;;;;;;;;+kBAsCA,IAAMA,iCAAiC,CAAG,CACxCC,IAAI,CAAE,KAAK,CACXC,IAAI,CAAE,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5F,gBAAgB,CAAC,CAAE,CACnF6F,WAAW,CAAE,iBACf,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"StyledBaseInput.native.js","sources":["../../../../../../src/components/Input/BaseInput/StyledBaseInput.native.tsx"],"sourcesContent":["import React from 'react';\nimport styled from 'styled-components/native';\nimport type { CSSObject, ThemeProps, DefaultTheme } from 'styled-components';\nimport type {\n TextInputProps,\n TouchableHighlight,\n TouchableHighlightProps,\n GestureResponderEvent,\n TextInput,\n} from 'react-native';\nimport { Platform as RNPlatform } from 'react-native';\nimport type { BaseInputProps } from './BaseInput';\nimport type { StyledBaseInputProps } from './types';\nimport { getBaseInputStyles } from './baseInputStyles';\nimport { baseInputHeight } from './baseInputTokens';\nimport { Text } from '~components/Typography';\nimport { useTheme } from '~components/BladeProvider';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { size as sizeToken } from '~tokens/global';\nimport { makeSize } from '~utils/makeSize';\nimport type { Platform } from '~utils';\nimport BaseBox from '~components/Box/BaseBox';\n\ntype StyledComponentAutoCompleteAndroid =\n | 'off'\n | 'name'\n | 'cc-csc'\n | 'cc-exp'\n | 'cc-exp-month'\n | 'cc-exp-year'\n | 'cc-number'\n | 'email'\n | 'username'\n | 'password'\n | 'password-new'\n | 'sms-otp'\n | 'postal-code'\n | 'postal-address-country'\n | 'tel'\n | undefined;\n\nconst autoCompleteSuggestionTypeAndroid = {\n none: 'off',\n name: 'name',\n email: 'email',\n username: 'username',\n password: 'password',\n newPassword: 'password-new',\n oneTimeCode: 'sms-otp',\n telephone: 'tel',\n postalCode: 'postal-code',\n countryName: 'postal-address-country',\n creditCardNumber: 'cc-number',\n creditCardCSC: 'cc-csc',\n creditCardExpiry: 'cc-exp',\n creditCardExpiryMonth: 'cc-exp-month',\n creditCardExpiryYear: 'cc-exp-year',\n} as const;\n\nconst autoCompleteSuggestionTypeIOS = {\n none: 'none',\n name: 'name',\n email: 'emailAddress',\n username: 'username',\n password: 'password',\n newPassword: 'newPassword',\n oneTimeCode: 'oneTimeCode',\n telephone: 'telephoneNumber',\n postalCode: 'postalCode',\n countryName: 'countryName',\n creditCardNumber: 'creditCardNumber',\n creditCardCSC: 'none',\n creditCardExpiry: 'none',\n creditCardExpiryMonth: 'none',\n creditCardExpiryYear: 'none',\n} as const;\n\nconst KeyboardTypeToNativeValuesMap = {\n text: 'default',\n search: 'default',\n telephone: 'phone-pad',\n email: 'email-address',\n url: 'url',\n decimal: 'decimal-pad',\n};\n\ntype StyledComponentInputProps = Omit<\n StyledBaseInputProps,\n 'accessibilityProps' | 'setCurrentInteraction' | 'currentInteraction' | 'autoGrowMaxHeight'\n> & {\n isTextArea?: boolean;\n isFocused: boolean;\n autoComplete?: typeof autoCompleteSuggestionTypeAndroid[keyof typeof autoCompleteSuggestionTypeAndroid];\n editable?: boolean;\n onPress?: (event: GestureResponderEvent) => void;\n $size: NonNullable<BaseInputProps['size']>;\n /** Transient — must not forward to native TextInput */\n $autoGrowMaxHeight?: number;\n};\n\nconst getInputHeight = ({\n isTextArea,\n hasTags,\n numberOfLines,\n isDropdownTrigger,\n size,\n autoGrowMaxHeight,\n}: Pick<StyledBaseInputProps, 'hasTags' | 'isTextArea' | 'numberOfLines' | 'isDropdownTrigger'> & {\n size: NonNullable<BaseInputProps['size']>;\n autoGrowMaxHeight?: number;\n}): string | undefined => {\n if (isTextArea) {\n // Auto-grow textareas manage height via inline styles + onContentSizeChange\n if (autoGrowMaxHeight) {\n return undefined;\n }\n const lines = isDropdownTrigger ? 1 : numberOfLines ?? 0;\n return `${baseInputHeight[size] * lines}px`;\n }\n\n if (hasTags) {\n return undefined; // we don't set height on input. We set it on wrapper to properly include tags in overall height\n }\n\n return makeSize(sizeToken[baseInputHeight[size]]);\n};\n\nconst getRNInputStyles = (\n props: StyledComponentInputProps &\n ThemeProps<DefaultTheme> &\n (TextInputProps | TouchableHighlightProps),\n): CSSObject => {\n return {\n ...getBaseInputStyles({\n theme: props.theme,\n isFocused: props.isFocused,\n isDisabled: !props.editable,\n validationState: props.validationState,\n leadingIcon: props.leadingIcon,\n prefix: props.prefix,\n trailingInteractionElement: props.trailingInteractionElement,\n leadingInteractionElement: props.leadingInteractionElement,\n suffix: props.suffix,\n trailingIcon: props.trailingIcon,\n isTextArea: props.isTextArea,\n hasTags: props.hasTags,\n isDropdownTrigger: props.isDropdownTrigger,\n size: props.$size,\n padding: props.$padding,\n valueComponentType: props.valueComponentType,\n isTableInputCell: props.isTableInputCell,\n }),\n lineHeight: RNPlatform.select({\n android: makeSize(props.theme.typography.lineHeights[100]),\n ios: undefined,\n }),\n textAlignVertical: props.isTextArea ? 'top' : 'center',\n ...(props.isTextArea\n ? {}\n : {\n paddingTop: 0,\n paddingBottom: 0,\n height: undefined,\n minHeight: undefined,\n }),\n ...(props.isTextArea || props.hasTags\n ? {\n height: getInputHeight({\n isTextArea: props.isTextArea,\n hasTags: props.hasTags,\n numberOfLines: props.numberOfLines,\n isDropdownTrigger: props.isDropdownTrigger,\n size: props.$size,\n autoGrowMaxHeight: props.$autoGrowMaxHeight,\n }),\n ...(props.isTextArea && props.$autoGrowMaxHeight\n ? {\n minHeight: `${\n baseInputHeight[props.$size] *\n (props.isDropdownTrigger ? 1 : props.numberOfLines ?? 1)\n }px`,\n }\n : {}),\n }\n : {}),\n };\n};\nconst StyledNativeBaseInput = styled.TextInput<StyledComponentInputProps>(\n ({\n id,\n isFocused,\n theme,\n editable,\n validationState,\n leadingIcon,\n prefix,\n trailingInteractionElement,\n leadingInteractionElement,\n suffix,\n trailingIcon,\n isTextArea,\n numberOfLines,\n $autoGrowMaxHeight,\n isDropdownTrigger,\n hasTags,\n $size,\n $padding,\n isTableInputCell,\n valueComponentType,\n }) =>\n getRNInputStyles({\n id,\n isFocused,\n theme,\n editable,\n validationState,\n leadingIcon,\n prefix,\n trailingInteractionElement,\n leadingInteractionElement,\n suffix,\n trailingIcon,\n isTextArea,\n numberOfLines,\n $autoGrowMaxHeight,\n hasTags,\n isDropdownTrigger,\n $size,\n $padding,\n valueComponentType,\n isTableInputCell,\n }),\n);\nconst StyledNativeBaseButton = styled.TouchableOpacity<StyledComponentInputProps>(\n ({\n id,\n isFocused,\n theme,\n editable,\n validationState,\n leadingIcon,\n prefix,\n trailingInteractionElement,\n leadingInteractionElement,\n suffix,\n trailingIcon,\n isTextArea,\n numberOfLines,\n $autoGrowMaxHeight,\n isDropdownTrigger,\n hasTags,\n $size,\n $padding,\n isTableInputCell,\n valueComponentType,\n }) => ({\n ...getRNInputStyles({\n id,\n isFocused,\n theme,\n editable,\n validationState,\n leadingIcon,\n prefix,\n trailingInteractionElement,\n leadingInteractionElement,\n suffix,\n trailingIcon,\n isTextArea,\n numberOfLines,\n $autoGrowMaxHeight,\n isDropdownTrigger,\n hasTags,\n $size,\n $padding,\n valueComponentType,\n isTableInputCell,\n }),\n }),\n);\n\nconst _StyledBaseInput: React.ForwardRefRenderFunction<\n TextInput | TouchableHighlight,\n StyledBaseInputProps\n> = (\n {\n name,\n isRequired,\n isDisabled,\n maxCharacters,\n handleOnFocus,\n handleOnChange,\n handleOnBlur,\n handleOnSubmit,\n handleOnInput,\n handleOnKeyDown,\n handleOnClick,\n keyboardType = 'text',\n keyboardReturnKeyType,\n autoCompleteSuggestionType,\n accessibilityProps,\n currentInteraction,\n setCurrentInteraction,\n type,\n numberOfLines,\n autoGrowMaxHeight,\n isTextArea,\n hasPopup,\n shouldIgnoreBlurAnimation,\n autoCapitalize,\n as: renderAs,\n $size,\n valueSuffix,\n ...props\n },\n ref,\n) => {\n const buttonValue = props.value ? props.value : props.placeholder;\n const { theme } = useTheme();\n // Auto-grow is opt-in (ChatInput only today). Default path must match prior textarea height behavior.\n const isAutoGrowing = Boolean(isTextArea && autoGrowMaxHeight);\n const minAutoGrowHeight =\n baseInputHeight[$size] * (props.isDropdownTrigger ? 1 : numberOfLines ?? 1);\n const [autoGrowHeight, setAutoGrowHeight] = React.useState(minAutoGrowHeight);\n\n React.useEffect(() => {\n if (!isAutoGrowing) {\n return;\n }\n setAutoGrowHeight(minAutoGrowHeight);\n }, [isAutoGrowing, minAutoGrowHeight]);\n\n const commonProps = {\n onBlur: (): void => {\n // In certain cases like SelectInput, we want to ignore the blur animation when option item is clicked.\n // The selectinput should always look like it is in focus otherwise it triggers blur + focus again which can cause flicker\n if (!shouldIgnoreBlurAnimation) {\n setCurrentInteraction('default');\n }\n },\n isFocused: currentInteraction === 'focus',\n };\n\n return renderAs === 'button' ? (\n <StyledNativeBaseButton\n // the types of styled-components for react-native is creating a mess, so there's no other option but to type `ref` as any\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ref={ref as any}\n onPress={(): void => {\n handleOnClick?.({ name, value: props.value });\n }}\n onFocus={(): void => {\n handleOnFocus?.({ name, value: props.value });\n setCurrentInteraction('focus');\n }}\n as={undefined}\n $size={$size}\n {...commonProps}\n {...props}\n {...accessibilityProps}\n >\n <BaseBox display=\"flex\" flexDirection=\"row\" alignItems=\"center\" gap=\"spacing.3\" width=\"100%\">\n <Text\n color={\n props.value && !isDisabled\n ? 'interactive.text.gray.normal'\n : 'surface.text.gray.disabled'\n }\n truncateAfterLines={1}\n textAlign={props.textAlign ?? 'left'}\n size={$size}\n >\n {buttonValue}\n </Text>\n {valueSuffix}\n </BaseBox>\n </StyledNativeBaseButton>\n ) : (\n <StyledNativeBaseInput\n // the types of styled-components for react-native is creating a mess, so there's no other option but to type `ref` as any\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ref={ref as any}\n multiline={isTextArea}\n numberOfLines={numberOfLines}\n editable={!isDisabled}\n maxLength={maxCharacters}\n placeholderTextColor={theme.colors.surface.text.gray.disabled}\n onFocus={(event): void => {\n handleOnFocus?.({ name, value: event?.nativeEvent.text });\n // React Native does not have native onPress event on Input elements so for consistency of API we call it on onFocus which also gets triggered on clicks\n handleOnClick?.({ name, value: event?.nativeEvent.text });\n setCurrentInteraction('focus');\n }}\n onChangeText={(text): void => {\n handleOnChange?.({ name, value: text });\n handleOnInput?.({ name, value: text });\n }}\n onEndEditing={(event): void => handleOnBlur?.({ name, value: event?.nativeEvent.text })}\n onSubmitEditing={(event): void => handleOnSubmit?.({ name, value: event?.nativeEvent.text })}\n onKeyPress={(event): void => {\n handleOnKeyDown?.({\n name,\n key: event?.nativeEvent.key,\n event: (event as unknown) as React.KeyboardEvent<HTMLInputElement>, // TODO: handle platform specific type\n });\n }}\n onContentSizeChange={\n isAutoGrowing && autoGrowMaxHeight\n ? (event): void => {\n const nextHeight = Math.min(\n Math.max(event.nativeEvent.contentSize.height, minAutoGrowHeight),\n autoGrowMaxHeight,\n );\n setAutoGrowHeight(nextHeight);\n }\n : undefined\n }\n // @ts-expect-error styled-components have limited keyboard types('default' | 'email-address' | 'numeric' | 'phone-pad' | 'number-pad' | 'decimal-pad') compared to the actual supported types so ignoring the error.\n // source: https://reactnative.dev/docs/textinput/#keyboardtype\n keyboardType={KeyboardTypeToNativeValuesMap[keyboardType]}\n returnKeyType={keyboardReturnKeyType}\n autoComplete={\n autoCompleteSuggestionType\n ? (autoCompleteSuggestionTypeAndroid[\n autoCompleteSuggestionType as Platform.CastNative<\n BaseInputProps['autoCompleteSuggestionType']\n >\n ] as StyledComponentAutoCompleteAndroid)\n : undefined\n }\n secureTextEntry={type === 'password'}\n isTextArea={isTextArea}\n // Transient styled prop — never forwarded to native TextInput\n $autoGrowMaxHeight={isAutoGrowing ? autoGrowMaxHeight : undefined}\n textContentType={\n autoCompleteSuggestionType\n ? autoCompleteSuggestionTypeIOS[\n autoCompleteSuggestionType as Platform.CastNative<\n BaseInputProps['autoCompleteSuggestionType']\n >\n ]\n : undefined\n }\n autoCapitalize={autoCapitalize}\n includeFontPadding={false}\n $size={$size}\n scrollEnabled={isAutoGrowing ? autoGrowHeight >= (autoGrowMaxHeight as number) : undefined}\n {...commonProps}\n {...props}\n {...accessibilityProps}\n style={isAutoGrowing ? { height: autoGrowHeight, maxHeight: autoGrowMaxHeight } : undefined}\n />\n );\n};\n\nconst StyledBaseInput = assignWithoutSideEffects(React.forwardRef(_StyledBaseInput), {\n displayName: 'StyledBaseInput',\n});\n\nexport { StyledBaseInput };\n"],"names":["autoCompleteSuggestionTypeAndroid","none","name","email","username","password","newPassword","oneTimeCode","telephone","postalCode","countryName","creditCardNumber","creditCardCSC","creditCardExpiry","creditCardExpiryMonth","creditCardExpiryYear","autoCompleteSuggestionTypeIOS","KeyboardTypeToNativeValuesMap","text","search","url","decimal","getInputHeight","_ref","isTextArea","hasTags","numberOfLines","isDropdownTrigger","size","autoGrowMaxHeight","undefined","lines","baseInputHeight","makeSize","sizeToken","getRNInputStyles","props","_props$numberOfLines","Object","assign","getBaseInputStyles","theme","isFocused","isDisabled","editable","validationState","leadingIcon","prefix","trailingInteractionElement","leadingInteractionElement","suffix","trailingIcon","$size","padding","$padding","valueComponentType","isTableInputCell","lineHeight","RNPlatform","select","android","typography","lineHeights","ios","textAlignVertical","paddingTop","paddingBottom","height","minHeight","$autoGrowMaxHeight","StyledNativeBaseInput","styled","TextInput","_ref2","id","StyledNativeBaseButton","TouchableOpacity","_ref3","_StyledBaseInput","_ref4","ref","_props$textAlign","isRequired","maxCharacters","handleOnFocus","handleOnChange","handleOnBlur","handleOnSubmit","handleOnInput","handleOnKeyDown","handleOnClick","_ref4$keyboardType","keyboardType","keyboardReturnKeyType","autoCompleteSuggestionType","accessibilityProps","currentInteraction","setCurrentInteraction","type","hasPopup","shouldIgnoreBlurAnimation","autoCapitalize","renderAs","as","valueSuffix","_objectWithoutProperties","_excluded","buttonValue","value","placeholder","_useTheme","useTheme","isAutoGrowing","Boolean","minAutoGrowHeight","_React$useState","React","useState","_React$useState2","_slicedToArray","autoGrowHeight","setAutoGrowHeight","useEffect","commonProps","onBlur","_jsx","onPress","onFocus","children","_jsxs","BaseBox","display","flexDirection","alignItems","gap","width","Text","color","truncateAfterLines","textAlign","multiline","maxLength","placeholderTextColor","colors","surface","gray","disabled","event","nativeEvent","onChangeText","onEndEditing","onSubmitEditing","onKeyPress","key","onContentSizeChange","nextHeight","Math","min","max","contentSize","returnKeyType","autoComplete","secureTextEntry","textContentType","includeFontPadding","scrollEnabled","style","maxHeight","StyledBaseInput","assignWithoutSideEffects","forwardRef","displayName"],"mappings":";;;;;;;;;;;;;;;;;;;;;+kBAyCA,IAAMA,iCAAiC,CAAG,CACxCC,IAAI,CAAE,KAAK,CACXC,IAAI,CAAE,MAAM,CACZC,KAAK,CAAE,OAAO,CACdC,QAAQ,CAAE,UAAU,CACpBC,QAAQ,CAAE,UAAU,CACpBC,WAAW,CAAE,cAAc,CAC3BC,WAAW,CAAE,SAAS,CACtBC,SAAS,CAAE,KAAK,CAChBC,UAAU,CAAE,aAAa,CACzBC,WAAW,CAAE,wBAAwB,CACrCC,gBAAgB,CAAE,WAAW,CAC7BC,aAAa,CAAE,QAAQ,CACvBC,gBAAgB,CAAE,QAAQ,CAC1BC,qBAAqB,CAAE,cAAc,CACrCC,oBAAoB,CAAE,aACxB,CAAU,CAEV,IAAMC,6BAA6B,CAAG,CACpCf,IAAI,CAAE,MAAM,CACZC,IAAI,CAAE,MAAM,CACZC,KAAK,CAAE,cAAc,CACrBC,QAAQ,CAAE,UAAU,CACpBC,QAAQ,CAAE,UAAU,CACpBC,WAAW,CAAE,aAAa,CAC1BC,WAAW,CAAE,aAAa,CAC1BC,SAAS,CAAE,iBAAiB,CAC5BC,UAAU,CAAE,YAAY,CACxBC,WAAW,CAAE,aAAa,CAC1BC,gBAAgB,CAAE,kBAAkB,CACpCC,aAAa,CAAE,MAAM,CACrBC,gBAAgB,CAAE,MAAM,CACxBC,qBAAqB,CAAE,MAAM,CAC7BC,oBAAoB,CAAE,MACxB,CAAU,CAEV,IAAME,6BAA6B,CAAG,CACpCC,IAAI,CAAE,SAAS,CACfC,MAAM,CAAE,SAAS,CACjBX,SAAS,CAAE,WAAW,CACtBL,KAAK,CAAE,eAAe,CACtBiB,GAAG,CAAE,KAAK,CACVC,OAAO,CAAE,aACX,CAAC,CAgBD,IAAMC,cAAc,CAAG,SAAjBA,cAAc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CAAA,CACtBuE,KAAK,CAAEtD,aAAa,CAAG,CAAE7C,MAAM,CAAEqD,cAAc,CAAE+C,SAAS,CAAE1I,iBAAkB,CAAC,CAAGC,SAAU,CAC7F,CAAA,CACF,CACH,CAAC,CAEK,IAAA0I,eAAe,CAAGC,wBAAwB,CAACrD,cAAK,CAACsD,UAAU,CAAC5F,gBAAgB,CAAC,CAAE,CACnF6F,WAAW,CAAE,iBACf,CAAC;;;;"}
|
|
@@ -23,7 +23,7 @@ import { FormLabel } from '../../Form/FormLabel.js';
|
|
|
23
23
|
import { makeSize } from '../../../utils/makeSize/makeSize.js';
|
|
24
24
|
import { FormHint } from '../../Form/FormHint.js';
|
|
25
25
|
|
|
26
|
-
var _excluded=["autoFocus","errorText","helpText","isDisabled","keyboardReturnKeyType","keyboardType","label","accessibilityLabel","labelPosition","labelSuffix","labelTrailing","name","onChange","onFocus","onBlur","onOTPFilled","otpLength","placeholder","successText","validationState","value","isMasked","autoCompleteSuggestionType","testID","size"];var _this=undefined,_jsxFileName="/home/runner/work/blade/blade/packages/blade/src/components/Input/OTPInput/OTPInput.tsx";var isReactNative=getPlatformType()==='react-native';var otpToArray=function otpToArray(code){var _code$split;return (_code$split=code==null?void 0:code.split(''))!=null?_code$split:Array(6).fill('');};var _OTPInput=function _OTPInput(_ref,incomingRef){var autoFocus=_ref.autoFocus,errorText=_ref.errorText,helpText=_ref.helpText,isDisabled=_ref.isDisabled,keyboardReturnKeyType=_ref.keyboardReturnKeyType,_ref$keyboardType=_ref.keyboardType,keyboardType=_ref$keyboardType===void 0?'decimal':_ref$keyboardType,label=_ref.label,accessibilityLabel=_ref.accessibilityLabel,labelPosition=_ref.labelPosition,labelSuffix=_ref.labelSuffix,labelTrailing=_ref.labelTrailing,name=_ref.name,onChange=_ref.onChange,_onFocus=_ref.onFocus,_onBlur=_ref.onBlur,onOTPFilled=_ref.onOTPFilled,_ref$otpLength=_ref.otpLength,otpLength=_ref$otpLength===void 0?6:_ref$otpLength,placeholder=_ref.placeholder,successText=_ref.successText,validationState=_ref.validationState,inputValue=_ref.value,isMasked=_ref.isMasked,_ref$autoCompleteSugg=_ref.autoCompleteSuggestionType,autoCompleteSuggestionType=_ref$autoCompleteSugg===void 0?'oneTimeCode':_ref$autoCompleteSugg,testID=_ref.testID,_ref$size=_ref.size,size=_ref$size===void 0?'medium':_ref$size,rest=_objectWithoutProperties(_ref,_excluded);var inputRefs=[];var _useState=useState(otpToArray(inputValue)),_useState2=_slicedToArray(_useState,2),otpValue=_useState2[0],setOtpValue=_useState2[1];var _useState3=useState([]),_useState4=_slicedToArray(_useState3,2),inputType=_useState4[0],setInputType=_useState4[1];var isLabelLeftPositioned=labelPosition==='left';var _useFormId=useFormId('otp'),inputId=_useFormId.inputId,helpTextId=_useFormId.helpTextId,errorTextId=_useFormId.errorTextId,successTextId=_useFormId.successTextId;useImperativeHandle(incomingRef,function(){return inputRefs.map(function(ref){return ref.current;});},[inputRefs]);useEffect(function(){if(inputValue&&inputValue.length>=otpLength){onOTPFilled==null?void 0:onOTPFilled({value:inputValue.slice(0,otpLength),name:name});}else if(!inputValue&&otpValue.join('').length>=otpLength){onOTPFilled==null?void 0:onOTPFilled({value:otpValue.slice(0,otpLength).join(''),name:name});}},[otpValue,otpLength,name,inputValue,onOTPFilled]);useEffect(function(){otpValue.forEach(function(otp,index){if(!isEmpty(otp)&&!inputType[index]&&isMasked){var newInputType=Array.from(inputType);newInputType[index]='password';setInputType(newInputType);}if(isEmpty(otp)&&inputType[index]){var _newInputType=Array.from(inputType);_newInputType[index]=undefined;setInputType(_newInputType);}});},[otpValue,inputType,isMasked]);var setOtpValueByIndex=function setOtpValueByIndex(_ref2){var value=_ref2.value,index=_ref2.index;var newOtpValue=Array.from(otpValue);newOtpValue[index]=value;setOtpValue(newOtpValue);return newOtpValue.join('');};var focusOnOtpByIndex=function focusOnOtpByIndex(index){var _inputRefs$index,_inputRefs$index$curr;(_inputRefs$index=inputRefs[index])==null?void 0:(_inputRefs$index$curr=_inputRefs$index.current)==null?void 0:_inputRefs$index$curr.focus();if(!isReactNative){var _inputRefs$index2,_inputRefs$index2$cur;(_inputRefs$index2=inputRefs[index])==null?void 0:(_inputRefs$index2$cur=_inputRefs$index2.current)==null?void 0:_inputRefs$index2$cur.select();}};var handleOnChange=function handleOnChange(_ref3){var value=_ref3.value,currentOtpIndex=_ref3.currentOtpIndex;if(value&&value===' '){return;}if(inputValue&&inputValue.length>0){var newOtpValue=Array.from(inputValue);newOtpValue[currentOtpIndex]=value!=null?value:'';setOtpValue(newOtpValue);onChange==null?void 0:onChange({name:name,value:newOtpValue.join('')});}else if(value&&value.trim().length>1){setOtpValue(Array.from(value));onChange==null?void 0:onChange({name:name,value:value.trim().slice(0,otpLength)});}else if(otpValue[currentOtpIndex]!==(value==null?void 0:value.trim())){var _value$trim;var newValue=setOtpValueByIndex({value:(_value$trim=value==null?void 0:value.trim())!=null?_value$trim:'',index:currentOtpIndex});onChange==null?void 0:onChange({name:name,value:newValue});}};var handleOnInput=function handleOnInput(_ref4){var value=_ref4.value,currentOtpIndex=_ref4.currentOtpIndex;if(value&&value.trim().length===1){focusOnOtpByIndex(++currentOtpIndex);}};var handleOnKeyDown=function handleOnKeyDown(_ref5){var key=_ref5.key,code=_ref5.code,event=_ref5.event,currentOtpIndex=_ref5.currentOtpIndex;if(key==='Backspace'||code==='Backspace'||code==='Delete'||key==='Delete'){event.preventDefault==null?void 0:event.preventDefault();if(otpValue[currentOtpIndex]){handleOnChange({value:'',currentOtpIndex:currentOtpIndex});}else {focusOnOtpByIndex(--currentOtpIndex);handleOnChange({value:'',currentOtpIndex:currentOtpIndex});}}else if(key==='ArrowLeft'||code==='ArrowLeft'){event.preventDefault==null?void 0:event.preventDefault();focusOnOtpByIndex(--currentOtpIndex);}else if(key==='ArrowRight'||code==='ArrowRight'){event.preventDefault==null?void 0:event.preventDefault();focusOnOtpByIndex(++currentOtpIndex);}else if(key===' '||code==='Space'){event.preventDefault==null?void 0:event.preventDefault();}};var getHiddenInput=function getHiddenInput(){if(!isReactNative){var _ref6;return jsx("input",{hidden:true,id:inputId,name:name,value:(_ref6=inputValue!=null?inputValue:otpValue.join(''))!=null?_ref6:'',readOnly:true});}return null;};var getOTPInputFields=function getOTPInputFields(){var inputs=[];var _loop=function _loop(index){var _otpValue$index,_Array$from$index;var currentValue=inputValue?otpToArray(inputValue)[index]||'':otpValue[index]||'';var ref=React__default.createRef();var currentInputType;if(isMasked){currentInputType=inputValue?'password':inputType[index];}inputRefs.push(ref);inputs.push(jsx(BaseBox,{flex:1,marginLeft:index==0?'spacing.0':'spacing.3',children:jsx(BaseInput,Object.assign({autoFocus:autoFocus&&index===0,accessibilityLabel:`${index===0?label||accessibilityLabel:''} character ${index+1}`,label:label,hideLabelText:true,id:`${inputId}-${index}`,textAlign:"center",ref:ref,name:name,value:currentValue,maxCharacters:((_otpValue$index=otpValue[index])==null?void 0:_otpValue$index.length)>0?1:undefined,onChange:function onChange(formEvent){return handleOnChange(Object.assign({},formEvent,{currentOtpIndex:index}));},onFocus:function onFocus(formEvent){return _onFocus==null?void 0:_onFocus(Object.assign({},formEvent,{inputIndex:index}));},onBlur:function onBlur(formEvent){return _onBlur==null?void 0:_onBlur(Object.assign({},formEvent,{inputIndex:index}));},onInput:function onInput(formEvent){return handleOnInput(Object.assign({},formEvent,{currentOtpIndex:index}));},onKeyDown:function onKeyDown(keyboardEvent){return handleOnKeyDown(Object.assign({},keyboardEvent,{currentOtpIndex:index}));},isDisabled:isDisabled,placeholder:(_Array$from$index=Array.from(placeholder!=null?placeholder:'')[index])!=null?_Array$from$index:'',isRequired:true,autoCompleteSuggestionType:autoCompleteSuggestionType,keyboardType:keyboardType,keyboardReturnKeyType:keyboardReturnKeyType,validationState:validationState,successText:successText,errorText:errorText,helpText:helpText,hideFormHint:true,type:currentInputType,size:size,valueComponentType:"heading"},makeAnalyticsAttribute(rest)))},`${inputId}-${index}`));};for(var index=0;index<otpLength;index++){_loop(index);}return inputs;};return jsxs(BaseBox,Object.assign({},metaAttribute({name:MetaConstants.OTPInput,testID:testID}),getStyledProps(rest),{children:[jsxs(BaseBox,{display:"flex",flexDirection:isLabelLeftPositioned?'row':'column',alignItems:isLabelLeftPositioned?'center':undefined,position:"relative",children:[Boolean(label)&&jsx(FormLabel,{as:"label",position:labelPosition,htmlFor:inputId,size:size,labelSuffix:labelSuffix,labelTrailing:labelTrailing,children:label}),jsxs(BaseBox,{display:"flex",flexDirection:"row",children:[getHiddenInput(),getOTPInputFields()]})]}),jsx(BaseBox,{marginLeft:makeSize(isLabelLeftPositioned?136:0),children:jsx(FormHint,{type:getHintType({validationState:validationState,hasHelpText:Boolean(helpText)}),helpText:helpText,errorText:errorText,successText:successText,helpTextId:helpTextId,errorTextId:errorTextId,successTextId:successTextId,size:size})})]}));};var OTPInput=React__default.forwardRef(_OTPInput);
|
|
26
|
+
var _excluded=["autoFocus","errorText","helpText","isDisabled","keyboardReturnKeyType","keyboardType","label","accessibilityLabel","labelPosition","labelSuffix","labelTrailing","name","onChange","onFocus","onBlur","onOTPFilled","otpLength","placeholder","successText","validationState","value","isMasked","autoCompleteSuggestionType","testID","size"];var _this=undefined,_jsxFileName="/home/runner/work/blade/blade/packages/blade/src/components/Input/OTPInput/OTPInput.tsx";var isReactNative=getPlatformType()==='react-native';var otpToArray=function otpToArray(code){var _code$split;return (_code$split=code==null?void 0:code.split(''))!=null?_code$split:Array(6).fill('');};var _OTPInput=function _OTPInput(_ref,incomingRef){var autoFocus=_ref.autoFocus,errorText=_ref.errorText,helpText=_ref.helpText,isDisabled=_ref.isDisabled,keyboardReturnKeyType=_ref.keyboardReturnKeyType,_ref$keyboardType=_ref.keyboardType,keyboardType=_ref$keyboardType===void 0?'decimal':_ref$keyboardType,label=_ref.label,accessibilityLabel=_ref.accessibilityLabel,labelPosition=_ref.labelPosition,labelSuffix=_ref.labelSuffix,labelTrailing=_ref.labelTrailing,name=_ref.name,onChange=_ref.onChange,_onFocus=_ref.onFocus,_onBlur=_ref.onBlur,onOTPFilled=_ref.onOTPFilled,_ref$otpLength=_ref.otpLength,otpLength=_ref$otpLength===void 0?6:_ref$otpLength,placeholder=_ref.placeholder,successText=_ref.successText,validationState=_ref.validationState,inputValue=_ref.value,isMasked=_ref.isMasked,_ref$autoCompleteSugg=_ref.autoCompleteSuggestionType,autoCompleteSuggestionType=_ref$autoCompleteSugg===void 0?'oneTimeCode':_ref$autoCompleteSugg,testID=_ref.testID,_ref$size=_ref.size,size=_ref$size===void 0?'medium':_ref$size,rest=_objectWithoutProperties(_ref,_excluded);var inputRefs=[];var _useState=useState(otpToArray(inputValue)),_useState2=_slicedToArray(_useState,2),otpValue=_useState2[0],setOtpValue=_useState2[1];var _useState3=useState([]),_useState4=_slicedToArray(_useState3,2),inputType=_useState4[0],setInputType=_useState4[1];var isLabelLeftPositioned=labelPosition==='left';var _useFormId=useFormId('otp'),inputId=_useFormId.inputId,helpTextId=_useFormId.helpTextId,errorTextId=_useFormId.errorTextId,successTextId=_useFormId.successTextId;useImperativeHandle(incomingRef,function(){return inputRefs.map(function(ref){return ref.current;});},[inputRefs]);useEffect(function(){if(inputValue&&inputValue.length>=otpLength){onOTPFilled==null?void 0:onOTPFilled({value:inputValue.slice(0,otpLength),name:name});}else if(!inputValue&&otpValue.join('').length>=otpLength){onOTPFilled==null?void 0:onOTPFilled({value:otpValue.slice(0,otpLength).join(''),name:name});}},[otpValue,otpLength,name,inputValue,onOTPFilled]);useEffect(function(){otpValue.forEach(function(otp,index){if(!isEmpty(otp)&&!inputType[index]&&isMasked){var newInputType=Array.from(inputType);newInputType[index]='password';setInputType(newInputType);}if(isEmpty(otp)&&inputType[index]){var _newInputType=Array.from(inputType);_newInputType[index]=undefined;setInputType(_newInputType);}});},[otpValue,inputType,isMasked]);var setOtpValueByIndex=function setOtpValueByIndex(_ref2){var value=_ref2.value,index=_ref2.index;var newOtpValue=Array.from(otpValue);newOtpValue[index]=value;setOtpValue(newOtpValue);return newOtpValue.join('');};var focusOnOtpByIndex=function focusOnOtpByIndex(index){var _inputRefs$index,_inputRefs$index$curr;(_inputRefs$index=inputRefs[index])==null?void 0:(_inputRefs$index$curr=_inputRefs$index.current)==null?void 0:_inputRefs$index$curr.focus();if(!isReactNative){var _inputRefs$index2,_inputRefs$index2$cur;(_inputRefs$index2=inputRefs[index])==null?void 0:(_inputRefs$index2$cur=_inputRefs$index2.current)==null?void 0:_inputRefs$index2$cur.select();}};var handleOnChange=function handleOnChange(_ref3){var value=_ref3.value,currentOtpIndex=_ref3.currentOtpIndex;if(value&&value===' '){return;}if(inputValue&&inputValue.length>0){var newOtpValue=Array.from(inputValue);newOtpValue[currentOtpIndex]=value!=null?value:'';setOtpValue(newOtpValue);onChange==null?void 0:onChange({name:name,value:newOtpValue.join('')});}else if(value&&value.trim().length>1){setOtpValue(Array.from(value));onChange==null?void 0:onChange({name:name,value:value.trim().slice(0,otpLength)});var lastFilledIndex=Math.min(value.trim().length,otpLength)-1;focusOnOtpByIndex(lastFilledIndex);}else if(otpValue[currentOtpIndex]!==(value==null?void 0:value.trim())){var _value$trim;var newValue=setOtpValueByIndex({value:(_value$trim=value==null?void 0:value.trim())!=null?_value$trim:'',index:currentOtpIndex});onChange==null?void 0:onChange({name:name,value:newValue});}};var handleOnInput=function handleOnInput(_ref4){var value=_ref4.value,currentOtpIndex=_ref4.currentOtpIndex;if(value&&value.trim().length===1){focusOnOtpByIndex(++currentOtpIndex);}};var handleOnKeyDown=function handleOnKeyDown(_ref5){var key=_ref5.key,code=_ref5.code,event=_ref5.event,currentOtpIndex=_ref5.currentOtpIndex;if(key==='Backspace'||code==='Backspace'||code==='Delete'||key==='Delete'){event.preventDefault==null?void 0:event.preventDefault();if(otpValue[currentOtpIndex]){handleOnChange({value:'',currentOtpIndex:currentOtpIndex});}else {focusOnOtpByIndex(--currentOtpIndex);handleOnChange({value:'',currentOtpIndex:currentOtpIndex});}}else if(key==='ArrowLeft'||code==='ArrowLeft'){event.preventDefault==null?void 0:event.preventDefault();focusOnOtpByIndex(--currentOtpIndex);}else if(key==='ArrowRight'||code==='ArrowRight'){event.preventDefault==null?void 0:event.preventDefault();focusOnOtpByIndex(++currentOtpIndex);}else if(key===' '||code==='Space'){event.preventDefault==null?void 0:event.preventDefault();}};var getHiddenInput=function getHiddenInput(){if(!isReactNative){var _ref6;return jsx("input",{hidden:true,id:inputId,name:name,value:(_ref6=inputValue!=null?inputValue:otpValue.join(''))!=null?_ref6:'',readOnly:true});}return null;};var getOTPInputFields=function getOTPInputFields(){var inputs=[];var _loop=function _loop(index){var _otpValue$index,_Array$from$index;var currentValue=inputValue?otpToArray(inputValue)[index]||'':otpValue[index]||'';var ref=React__default.createRef();var currentInputType;if(isMasked){currentInputType=inputValue?'password':inputType[index];}inputRefs.push(ref);inputs.push(jsx(BaseBox,{flex:1,marginLeft:index==0?'spacing.0':'spacing.3',children:jsx(BaseInput,Object.assign({autoFocus:autoFocus&&index===0,accessibilityLabel:`${index===0?label||accessibilityLabel:''} character ${index+1}`,label:label,hideLabelText:true,id:`${inputId}-${index}`,textAlign:"center",ref:ref,name:name,value:currentValue,maxCharacters:((_otpValue$index=otpValue[index])==null?void 0:_otpValue$index.length)>0?1:undefined,onChange:function onChange(formEvent){return handleOnChange(Object.assign({},formEvent,{currentOtpIndex:index}));},onFocus:function onFocus(formEvent){return _onFocus==null?void 0:_onFocus(Object.assign({},formEvent,{inputIndex:index}));},onBlur:function onBlur(formEvent){return _onBlur==null?void 0:_onBlur(Object.assign({},formEvent,{inputIndex:index}));},onInput:function onInput(formEvent){return handleOnInput(Object.assign({},formEvent,{currentOtpIndex:index}));},onKeyDown:function onKeyDown(keyboardEvent){return handleOnKeyDown(Object.assign({},keyboardEvent,{currentOtpIndex:index}));},isDisabled:isDisabled,placeholder:(_Array$from$index=Array.from(placeholder!=null?placeholder:'')[index])!=null?_Array$from$index:'',isRequired:true,autoCompleteSuggestionType:autoCompleteSuggestionType,keyboardType:keyboardType,keyboardReturnKeyType:keyboardReturnKeyType,validationState:validationState,successText:successText,errorText:errorText,helpText:helpText,hideFormHint:true,type:currentInputType,size:size,valueComponentType:"heading"},makeAnalyticsAttribute(rest)))},`${inputId}-${index}`));};for(var index=0;index<otpLength;index++){_loop(index);}return inputs;};return jsxs(BaseBox,Object.assign({},metaAttribute({name:MetaConstants.OTPInput,testID:testID}),getStyledProps(rest),{children:[jsxs(BaseBox,{display:"flex",flexDirection:isLabelLeftPositioned?'row':'column',alignItems:isLabelLeftPositioned?'center':undefined,position:"relative",children:[Boolean(label)&&jsx(FormLabel,{as:"label",position:labelPosition,htmlFor:inputId,size:size,labelSuffix:labelSuffix,labelTrailing:labelTrailing,children:label}),jsxs(BaseBox,{display:"flex",flexDirection:"row",children:[getHiddenInput(),getOTPInputFields()]})]}),jsx(BaseBox,{marginLeft:makeSize(isLabelLeftPositioned?136:0),children:jsx(FormHint,{type:getHintType({validationState:validationState,hasHelpText:Boolean(helpText)}),helpText:helpText,errorText:errorText,successText:successText,helpTextId:helpTextId,errorTextId:errorTextId,successTextId:successTextId,size:size})})]}));};var OTPInput=React__default.forwardRef(_OTPInput);
|
|
27
27
|
|
|
28
28
|
export { OTPInput };
|
|
29
29
|
//# sourceMappingURL=OTPInput.js.map
|