@razorpay/blade 12.49.4 → 12.49.6
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/build/lib/native/components/Accordion/AccordionButton.native.js.map +1 -1
- package/build/lib/native/components/ActionList/ActionList.js.map +1 -1
- package/build/lib/native/components/ActionList/ActionListItem.js.map +1 -1
- package/build/lib/native/components/ActionList/actionListUtils.js.map +1 -1
- package/build/lib/native/components/Alert/Alert.js.map +1 -1
- package/build/lib/native/components/Amount/Amount.js.map +1 -1
- package/build/lib/native/components/Badge/Badge.js.map +1 -1
- package/build/lib/native/components/BaseHeaderFooter/BaseHeader.js.map +1 -1
- package/build/lib/native/components/BladeProvider/useBladeProvider.js.map +1 -1
- package/build/lib/native/components/BottomSheet/BottomSheet.native.js +1 -1
- package/build/lib/native/components/BottomSheet/BottomSheet.native.js.map +1 -1
- package/build/lib/native/components/Box/BaseBox/baseBoxStyles.js.map +1 -1
- package/build/lib/native/components/Box/Box.js.map +1 -1
- package/build/lib/native/components/Button/BaseButton/BaseButton.js.map +1 -1
- package/build/lib/native/components/Button/BaseButton/StyledBaseButton.native.js.map +1 -1
- package/build/lib/native/components/Button/BaseButton/buttonTokens.js.map +1 -1
- package/build/lib/native/components/Button/IconButton/StyledIconButton.native.js.map +1 -1
- package/build/lib/native/components/Card/CardContext.js.map +1 -1
- package/build/lib/native/components/Card/CardFooter.js.map +1 -1
- package/build/lib/native/components/Card/CardHeader.js.map +1 -1
- package/build/lib/native/components/Card/CardRoot.native.js.map +1 -1
- package/build/lib/native/components/Card/CardSurface.native.js.map +1 -1
- package/build/lib/native/components/Carousel/Carousel.native.js.map +1 -1
- package/build/lib/native/components/Carousel/CarouselItem.native.js.map +1 -1
- package/build/lib/native/components/Carousel/Indicators/Indicators.js.map +1 -1
- package/build/lib/native/components/Carousel/Indicators/getIndicatorButtonStyles.js.map +1 -1
- package/build/lib/native/components/Checkbox/Checkbox.js.map +1 -1
- package/build/lib/native/components/Checkbox/CheckboxGroup/CheckboxGroup.js.map +1 -1
- package/build/lib/native/components/Checkbox/useCheckbox.js.map +1 -1
- package/build/lib/native/components/Chip/ChipGroup.js.map +1 -1
- package/build/lib/native/components/Chip/chipTokens.js.map +1 -1
- package/build/lib/native/components/Chip/useChipGroup.js.map +1 -1
- package/build/lib/native/components/Collapsible/Collapsible.js.map +1 -1
- package/build/lib/native/components/Collapsible/CollapsibleChevronIcon.native.js.map +1 -1
- package/build/lib/native/components/Collapsible/CollapsibleContext.js.map +1 -1
- package/build/lib/native/components/Counter/Counter.js.map +1 -1
- package/build/lib/native/components/Divider/Divider.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/DropdownButton.js +1 -1
- package/build/lib/native/components/Dropdown/DropdownButton.js.map +1 -1
- package/build/lib/native/components/Dropdown/DropdownIconButton.js +1 -1
- package/build/lib/native/components/Dropdown/DropdownIconButton.js.map +1 -1
- package/build/lib/native/components/Dropdown/DropdownLink.js +1 -1
- package/build/lib/native/components/Dropdown/DropdownLink.js.map +1 -1
- package/build/lib/native/components/Dropdown/DropdownOverlay.native.js.map +1 -1
- package/build/lib/native/components/Dropdown/dropdownUtils.js.map +1 -1
- package/build/lib/native/components/Form/useFormId.js.map +1 -1
- package/build/lib/native/components/Input/BaseInput/BaseInput.js +1 -1
- package/build/lib/native/components/Input/BaseInput/BaseInput.js.map +1 -1
- package/build/lib/native/components/Input/BaseInput/StyledBaseInput.native.js.map +1 -1
- package/build/lib/native/components/Input/DropdownInputTriggers/BaseDropdownInputTrigger.js.map +1 -1
- package/build/lib/native/components/Input/DropdownInputTriggers/Chevron.js.map +1 -1
- package/build/lib/native/components/Input/DropdownInputTriggers/SelectInput.js +1 -1
- package/build/lib/native/components/Input/DropdownInputTriggers/SelectInput.js.map +1 -1
- package/build/lib/native/components/Input/OTPInput/OTPInput.js.map +1 -1
- package/build/lib/native/components/Input/TextInput/TextInput.js.map +1 -1
- package/build/lib/native/components/Link/BaseLink/BaseLink.js.map +1 -1
- package/build/lib/native/components/Link/BaseLink/StyledBaseLink.native.js.map +1 -1
- package/build/lib/native/components/List/ListItem.js.map +1 -1
- package/build/lib/native/components/List/getOrderedListItemBullet.js.map +1 -1
- package/build/lib/native/components/Popover/PopoverContext.js.map +1 -1
- package/build/lib/native/components/PopupArrow/PopupArrow.native.js.map +1 -1
- package/build/lib/native/components/ProgressBar/CircularProgressBar.native.js.map +1 -1
- package/build/lib/native/components/ProgressBar/ProgressBar.js.map +1 -1
- package/build/lib/native/components/ProgressBar/ProgressBarFilled.native.js.map +1 -1
- package/build/lib/native/components/ProgressBar/progressBarTokens.js.map +1 -1
- package/build/lib/native/components/Radio/RadioGroup/RadioGroup.js.map +1 -1
- package/build/lib/native/components/Radio/RadioGroup/useRadioGroup.js.map +1 -1
- package/build/lib/native/components/Radio/RadioIcon/RadioIcon.js.map +1 -1
- package/build/lib/native/components/Radio/useRadio.js.map +1 -1
- package/build/lib/native/components/Spinner/BaseSpinner/BaseSpinner.js.map +1 -1
- package/build/lib/native/components/Spinner/BaseSpinner/SpinningBox.native.js.map +1 -1
- package/build/lib/native/components/StepGroup/StepItemMarker.js.map +1 -1
- package/build/lib/native/components/Switch/getTrackStyles.js.map +1 -1
- package/build/lib/native/components/Tabs/SafeSceneMap.native.js.map +1 -1
- package/build/lib/native/components/Tabs/utils.js.map +1 -1
- package/build/lib/native/components/Tag/Tag.js.map +1 -1
- package/build/lib/native/components/Tag/getTagsGroup.js.map +1 -1
- package/build/lib/native/components/Tooltip/TooltipContext.js.map +1 -1
- package/build/lib/native/components/Typography/BaseText/getBaseTextStyles.js.map +1 -1
- package/build/lib/native/components/Typography/Code/Code.js.map +1 -1
- package/build/lib/native/components/Typography/Text/Text.js.map +1 -1
- package/build/lib/native/components/Typography/utils.js.map +1 -1
- package/build/lib/native/components/VisuallyHidden/ScreenReaderStyles.js.map +1 -1
- package/build/lib/native/tokens/global/colors.js.map +1 -1
- package/build/lib/native/tokens/global/elevation/elevation.native.js.map +1 -1
- package/build/lib/native/tokens/theme/bladeTheme.js.map +1 -1
- package/build/lib/native/tokens/theme/createTheme.js.map +1 -1
- package/build/lib/native/utils/getMediaQuery/getMediaQuery.js.map +1 -1
- package/build/lib/native/utils/isPartialMatchObjectKeys/isPartialMatchObjectKeys.js.map +1 -1
- package/build/lib/native/utils/logger/logger.js.map +1 -1
- package/build/lib/native/utils/makeAccessible/makeAccessible.native.js.map +1 -1
- package/build/lib/native/utils/makeBorderSize/makeBorderSize.js.map +1 -1
- package/build/lib/native/utils/makeLetterSpacing/makeLetterSpacing.js.map +1 -1
- package/build/lib/native/utils/makeSize/makeSize.js.map +1 -1
- package/build/lib/native/utils/makeSpace/makeSpace.js.map +1 -1
- package/build/lib/native/utils/makeTypographySize/makeTypographySize.native.js.map +1 -1
- package/build/lib/native/utils/metaAttribute/metaAttribute.native.js.map +1 -1
- package/build/lib/native/utils/useColorScheme/useColorScheme.js.map +1 -1
- package/build/lib/native/utils/useId.js.map +1 -1
- package/build/lib/native/utils/useMergeRefs.js.map +1 -1
- package/build/lib/native/utils/useVerifyAllowedChildren/useVerifyAllowedChildren.js.map +1 -1
- package/build/lib/web/development/components/Accordion/Accordion.js +2 -2
- package/build/lib/web/development/components/Accordion/Accordion.js.map +1 -1
- package/build/lib/web/development/components/ActionList/ActionList.js +1 -1
- package/build/lib/web/development/components/ActionList/ActionList.js.map +1 -1
- package/build/lib/web/development/components/ActionList/ActionListBox.web.js +7 -7
- package/build/lib/web/development/components/ActionList/ActionListBox.web.js.map +1 -1
- package/build/lib/web/development/components/ActionList/ActionListItem.js +4 -4
- package/build/lib/web/development/components/ActionList/ActionListItem.js.map +1 -1
- package/build/lib/web/development/components/ActionList/actionListUtils.js +4 -4
- package/build/lib/web/development/components/ActionList/actionListUtils.js.map +1 -1
- package/build/lib/web/development/components/Amount/Amount.js +2 -2
- package/build/lib/web/development/components/Amount/Amount.js.map +1 -1
- package/build/lib/web/development/components/AnimateInteractions/AnimateInteractions.web.js.map +1 -1
- package/build/lib/web/development/components/AnimateInteractions/useFocusWithin.js +2 -2
- package/build/lib/web/development/components/AnimateInteractions/useFocusWithin.js.map +1 -1
- package/build/lib/web/development/components/Avatar/Avatar.web.js +1 -1
- package/build/lib/web/development/components/Avatar/Avatar.web.js.map +1 -1
- package/build/lib/web/development/components/Badge/Badge.js +1 -1
- package/build/lib/web/development/components/Badge/Badge.js.map +1 -1
- package/build/lib/web/development/components/BaseHeaderFooter/BaseHeader.js +2 -2
- package/build/lib/web/development/components/BaseHeaderFooter/BaseHeader.js.map +1 -1
- package/build/lib/web/development/components/BaseMotion/baseMotionUtils.js +2 -2
- package/build/lib/web/development/components/BaseMotion/baseMotionUtils.js.map +1 -1
- package/build/lib/web/development/components/BladeProvider/useTheme.js.map +1 -1
- package/build/lib/web/development/components/BottomSheet/BottomSheet.web.js +19 -19
- package/build/lib/web/development/components/BottomSheet/BottomSheet.web.js.map +1 -1
- package/build/lib/web/development/components/BottomSheet/BottomSheetBackdrop.web.js.map +1 -1
- package/build/lib/web/development/components/BottomSheet/BottomSheetContext.js.map +1 -1
- package/build/lib/web/development/components/BottomSheet/BottomSheetStack.js.map +1 -1
- package/build/lib/web/development/components/Box/BaseBox/baseBoxStyles.js +27 -27
- package/build/lib/web/development/components/Box/BaseBox/baseBoxStyles.js.map +1 -1
- package/build/lib/web/development/components/Box/Box.js +1 -1
- package/build/lib/web/development/components/Box/Box.js.map +1 -1
- package/build/lib/web/development/components/Button/BaseButton/BaseButton.js +5 -5
- package/build/lib/web/development/components/Button/BaseButton/BaseButton.js.map +1 -1
- package/build/lib/web/development/components/Button/BaseButton/buttonTokens.js.map +1 -1
- package/build/lib/web/development/components/Button/Button/Button.js +2 -2
- package/build/lib/web/development/components/Button/Button/Button.js.map +1 -1
- package/build/lib/web/development/components/Button/IconButton/IconButton.js +1 -1
- package/build/lib/web/development/components/Button/IconButton/IconButton.js.map +1 -1
- package/build/lib/web/development/components/ButtonGroup/ButtonGroup.web.js +1 -1
- package/build/lib/web/development/components/ButtonGroup/ButtonGroup.web.js.map +1 -1
- package/build/lib/web/development/components/Card/Card.js.map +1 -1
- package/build/lib/web/development/components/Card/CardFooter.js +2 -2
- package/build/lib/web/development/components/Card/CardFooter.js.map +1 -1
- package/build/lib/web/development/components/Card/CardRoot.web.js.map +1 -1
- package/build/lib/web/development/components/Carousel/Carousel.web.js +6 -6
- package/build/lib/web/development/components/Carousel/Carousel.web.js.map +1 -1
- package/build/lib/web/development/components/Carousel/CarouselItem.web.js +2 -2
- package/build/lib/web/development/components/Carousel/CarouselItem.web.js.map +1 -1
- package/build/lib/web/development/components/Carousel/Indicators/Indicators.js +1 -1
- package/build/lib/web/development/components/Carousel/Indicators/Indicators.js.map +1 -1
- package/build/lib/web/development/components/ChatMessage/ChatMessage.web.js +1 -1
- package/build/lib/web/development/components/ChatMessage/ChatMessage.web.js.map +1 -1
- package/build/lib/web/development/components/Checkbox/Checkbox.js +5 -5
- package/build/lib/web/development/components/Checkbox/Checkbox.js.map +1 -1
- package/build/lib/web/development/components/Checkbox/CheckboxGroup/useCheckboxGroup.js.map +1 -1
- package/build/lib/web/development/components/Checkbox/useCheckbox.js +1 -1
- package/build/lib/web/development/components/Checkbox/useCheckbox.js.map +1 -1
- package/build/lib/web/development/components/Chip/Chip.js +5 -5
- package/build/lib/web/development/components/Chip/Chip.js.map +1 -1
- package/build/lib/web/development/components/Chip/useChipGroup.js.map +1 -1
- package/build/lib/web/development/components/Collapsible/Collapsible.js +3 -3
- package/build/lib/web/development/components/Collapsible/Collapsible.js.map +1 -1
- package/build/lib/web/development/components/Collapsible/CollapsibleButton.js +1 -1
- package/build/lib/web/development/components/Collapsible/CollapsibleButton.js.map +1 -1
- package/build/lib/web/development/components/Counter/Counter.js +1 -1
- package/build/lib/web/development/components/Counter/Counter.js.map +1 -1
- package/build/lib/web/development/components/DatePicker/BaseDatePicker.web.js +23 -17
- package/build/lib/web/development/components/DatePicker/BaseDatePicker.web.js.map +1 -1
- package/build/lib/web/development/components/DatePicker/Calendar.web.js +7 -7
- package/build/lib/web/development/components/DatePicker/Calendar.web.js.map +1 -1
- package/build/lib/web/development/components/DatePicker/CalendarFooter.web.js +42 -24
- package/build/lib/web/development/components/DatePicker/CalendarFooter.web.js.map +1 -1
- package/build/lib/web/development/components/DatePicker/CalendarHeader.web.js.map +1 -1
- package/build/lib/web/development/components/DatePicker/DateInput.web.js +4 -4
- package/build/lib/web/development/components/DatePicker/DateInput.web.js.map +1 -1
- package/build/lib/web/development/components/DatePicker/QuickSelection/PresetDropdown.web.js.map +1 -1
- package/build/lib/web/development/components/DatePicker/QuickSelection/PresetSideBar.web.js.map +1 -1
- package/build/lib/web/development/components/DatePicker/useControlledDates.js +1 -1
- package/build/lib/web/development/components/DatePicker/useControlledDates.js.map +1 -1
- package/build/lib/web/development/components/DatePicker/useDatesState.js +1 -1
- package/build/lib/web/development/components/DatePicker/useDatesState.js.map +1 -1
- package/build/lib/web/development/components/DatePicker/usePopup.js +2 -2
- package/build/lib/web/development/components/DatePicker/usePopup.js.map +1 -1
- package/build/lib/web/development/components/DatePicker/utils.js +1 -1
- package/build/lib/web/development/components/DatePicker/utils.js.map +1 -1
- package/build/lib/web/development/components/Drawer/Drawer.web.js +2 -2
- package/build/lib/web/development/components/Drawer/Drawer.web.js.map +1 -1
- package/build/lib/web/development/components/Drawer/DrawerContext.js.map +1 -1
- package/build/lib/web/development/components/Drawer/DrawerSubcomponents.web.js.map +1 -1
- package/build/lib/web/development/components/Drawer/StackProvider.js.map +1 -1
- package/build/lib/web/development/components/Dropdown/Dropdown.js +28 -28
- package/build/lib/web/development/components/Dropdown/Dropdown.js.map +1 -1
- package/build/lib/web/development/components/Dropdown/DropdownButton.js +4 -4
- package/build/lib/web/development/components/Dropdown/DropdownButton.js.map +1 -1
- package/build/lib/web/development/components/Dropdown/DropdownHeaderFooter.js.map +1 -1
- package/build/lib/web/development/components/Dropdown/DropdownIconButton.js +4 -4
- package/build/lib/web/development/components/Dropdown/DropdownIconButton.js.map +1 -1
- package/build/lib/web/development/components/Dropdown/DropdownLink.js +4 -4
- package/build/lib/web/development/components/Dropdown/DropdownLink.js.map +1 -1
- package/build/lib/web/development/components/Dropdown/DropdownOverlay.web.js +1 -1
- package/build/lib/web/development/components/Dropdown/DropdownOverlay.web.js.map +1 -1
- package/build/lib/web/development/components/Dropdown/FilterChipGroup.web.js +1 -1
- package/build/lib/web/development/components/Dropdown/FilterChipGroup.web.js.map +1 -1
- package/build/lib/web/development/components/Dropdown/FilterChipGroupContext.web.js.map +1 -1
- package/build/lib/web/development/components/Dropdown/FilterChipSelectInput.web.js +7 -7
- package/build/lib/web/development/components/Dropdown/FilterChipSelectInput.web.js.map +1 -1
- package/build/lib/web/development/components/Dropdown/InputDropdownButton.web.js +8 -8
- package/build/lib/web/development/components/Dropdown/InputDropdownButton.web.js.map +1 -1
- package/build/lib/web/development/components/Dropdown/useDropdown.js +4 -4
- package/build/lib/web/development/components/Dropdown/useDropdown.js.map +1 -1
- package/build/lib/web/development/components/EmptyState/EmptyState.web.js +1 -1
- package/build/lib/web/development/components/EmptyState/EmptyState.web.js.map +1 -1
- package/build/lib/web/development/components/FileUpload/FileUpload.web.js +14 -14
- package/build/lib/web/development/components/FileUpload/FileUpload.web.js.map +1 -1
- package/build/lib/web/development/components/FileUpload/FileUploadItem.js +1 -1
- package/build/lib/web/development/components/FileUpload/FileUploadItem.js.map +1 -1
- package/build/lib/web/development/components/FilterChip/BaseFilterChip.web.js +3 -3
- package/build/lib/web/development/components/FilterChip/BaseFilterChip.web.js.map +1 -1
- package/build/lib/web/development/components/Form/FormHint.js.map +1 -1
- package/build/lib/web/development/components/Form/Selector/SelectorInput.web.js +1 -1
- package/build/lib/web/development/components/Form/Selector/SelectorInput.web.js.map +1 -1
- package/build/lib/web/development/components/Indicator/Indicator.js +1 -1
- package/build/lib/web/development/components/Indicator/Indicator.js.map +1 -1
- package/build/lib/web/development/components/InfoGroup/InfoGroup.web.js +6 -6
- package/build/lib/web/development/components/InfoGroup/InfoGroup.web.js.map +1 -1
- package/build/lib/web/development/components/InfoGroup/InfoGroupContext.js.map +1 -1
- package/build/lib/web/development/components/Input/BaseInput/AnimatedBaseInputWrapper.web.js +1 -1
- package/build/lib/web/development/components/Input/BaseInput/AnimatedBaseInputWrapper.web.js.map +1 -1
- package/build/lib/web/development/components/Input/BaseInput/BaseInput.js +110 -110
- package/build/lib/web/development/components/Input/BaseInput/BaseInput.js.map +1 -1
- package/build/lib/web/development/components/Input/BaseInput/BaseInputTagSlot.web.js +8 -8
- package/build/lib/web/development/components/Input/BaseInput/BaseInputTagSlot.web.js.map +1 -1
- package/build/lib/web/development/components/Input/BaseInput/StyledBaseInput.web.js +7 -7
- package/build/lib/web/development/components/Input/BaseInput/StyledBaseInput.web.js.map +1 -1
- package/build/lib/web/development/components/Input/BaseInput/useTaggedInput.js +4 -4
- package/build/lib/web/development/components/Input/BaseInput/useTaggedInput.js.map +1 -1
- package/build/lib/web/development/components/Input/DropdownInputTriggers/AutoComplete.js +8 -8
- package/build/lib/web/development/components/Input/DropdownInputTriggers/AutoComplete.js.map +1 -1
- package/build/lib/web/development/components/Input/DropdownInputTriggers/BaseDropdownInputTrigger.js +4 -4
- package/build/lib/web/development/components/Input/DropdownInputTriggers/BaseDropdownInputTrigger.js.map +1 -1
- package/build/lib/web/development/components/Input/DropdownInputTriggers/SelectInput.js +3 -3
- package/build/lib/web/development/components/Input/DropdownInputTriggers/SelectInput.js.map +1 -1
- package/build/lib/web/development/components/Input/OTPInput/OTPInput.js +14 -14
- package/build/lib/web/development/components/Input/OTPInput/OTPInput.js.map +1 -1
- package/build/lib/web/development/components/Input/PasswordInput/PasswordInput.js +1 -1
- package/build/lib/web/development/components/Input/PasswordInput/PasswordInput.js.map +1 -1
- package/build/lib/web/development/components/Input/PhoneNumberInput/CountrySelector.web.js.map +1 -1
- package/build/lib/web/development/components/Input/PhoneNumberInput/PhoneNumberInput.web.js +5 -5
- package/build/lib/web/development/components/Input/PhoneNumberInput/PhoneNumberInput.web.js.map +1 -1
- package/build/lib/web/development/components/Input/SearchInput/SearchInput.js +5 -5
- package/build/lib/web/development/components/Input/SearchInput/SearchInput.js.map +1 -1
- package/build/lib/web/development/components/Input/TextArea/TextArea.js +7 -7
- package/build/lib/web/development/components/Input/TextArea/TextArea.js.map +1 -1
- package/build/lib/web/development/components/Input/TextInput/TextInput.js +7 -7
- package/build/lib/web/development/components/Input/TextInput/TextInput.js.map +1 -1
- package/build/lib/web/development/components/Input/TextInput/useFormattedInput.js +2 -2
- package/build/lib/web/development/components/Input/TextInput/useFormattedInput.js.map +1 -1
- package/build/lib/web/development/components/InputGroup/InputGroup.web.js +1 -1
- package/build/lib/web/development/components/InputGroup/InputGroup.web.js.map +1 -1
- package/build/lib/web/development/components/Link/BaseLink/BaseLink.js +3 -3
- package/build/lib/web/development/components/Link/BaseLink/BaseLink.js.map +1 -1
- package/build/lib/web/development/components/Link/Link/Link.js +1 -1
- package/build/lib/web/development/components/Link/Link/Link.js.map +1 -1
- package/build/lib/web/development/components/List/List.js +1 -1
- package/build/lib/web/development/components/List/List.js.map +1 -1
- package/build/lib/web/development/components/List/getOrderedListItemBullet.js +3 -3
- package/build/lib/web/development/components/List/getOrderedListItemBullet.js.map +1 -1
- package/build/lib/web/development/components/ListView/ListViewFilters.web.js.map +1 -1
- package/build/lib/web/development/components/ListView/ListViewFiltersContext.web.js.map +1 -1
- package/build/lib/web/development/components/LiveAnnouncer/LiveAnnouncer.web.js.map +1 -1
- package/build/lib/web/development/components/Menu/Menu.web.js.map +1 -1
- package/build/lib/web/development/components/Menu/MenuItem.web.js +3 -3
- package/build/lib/web/development/components/Menu/MenuItem.web.js.map +1 -1
- package/build/lib/web/development/components/Menu/useMenu.js.map +1 -1
- package/build/lib/web/development/components/Modal/ModalBackdrop.js.map +1 -1
- package/build/lib/web/development/components/Modal/ModalContext.js.map +1 -1
- package/build/lib/web/development/components/Popover/Popover.web.js.map +1 -1
- package/build/lib/web/development/components/Preview/Preview.web.js +29 -30
- package/build/lib/web/development/components/Preview/Preview.web.js.map +1 -1
- package/build/lib/web/development/components/QuickFilters/QuickFilterGroup/QuickFilterGroup.js.map +1 -1
- package/build/lib/web/development/components/Radio/Radio.js +4 -4
- package/build/lib/web/development/components/Radio/Radio.js.map +1 -1
- package/build/lib/web/development/components/Radio/RadioGroup/useRadioGroup.js +1 -1
- package/build/lib/web/development/components/Radio/RadioGroup/useRadioGroup.js.map +1 -1
- package/build/lib/web/development/components/Radio/useRadio.js +1 -1
- package/build/lib/web/development/components/Radio/useRadio.js.map +1 -1
- package/build/lib/web/development/components/SideNav/SideNav.web.js +19 -19
- package/build/lib/web/development/components/SideNav/SideNav.web.js.map +1 -1
- package/build/lib/web/development/components/SideNav/SideNavItems/SideNavLink.web.js +6 -6
- package/build/lib/web/development/components/SideNav/SideNavItems/SideNavLink.web.js.map +1 -1
- package/build/lib/web/development/components/SideNav/SideNavLevel.web.js.map +1 -1
- package/build/lib/web/development/components/SpotlightPopoverTour/Tour.web.js +7 -7
- package/build/lib/web/development/components/SpotlightPopoverTour/Tour.web.js.map +1 -1
- package/build/lib/web/development/components/SpotlightPopoverTour/TourFooter.web.js +2 -2
- package/build/lib/web/development/components/SpotlightPopoverTour/TourFooter.web.js.map +1 -1
- package/build/lib/web/development/components/SpotlightPopoverTour/TourMask.web.js +1 -1
- package/build/lib/web/development/components/SpotlightPopoverTour/TourMask.web.js.map +1 -1
- package/build/lib/web/development/components/SpotlightPopoverTour/TourPopover.web.js.map +1 -1
- package/build/lib/web/development/components/SpotlightPopoverTour/TourStep.web.js +1 -1
- package/build/lib/web/development/components/SpotlightPopoverTour/TourStep.web.js.map +1 -1
- package/build/lib/web/development/components/StepGroup/StepGroup.web.js +6 -6
- package/build/lib/web/development/components/StepGroup/StepGroup.web.js.map +1 -1
- package/build/lib/web/development/components/StepGroup/StepItem.web.js +1 -1
- package/build/lib/web/development/components/StepGroup/StepItem.web.js.map +1 -1
- package/build/lib/web/development/components/StepGroup/StepLine.web.js +13 -13
- package/build/lib/web/development/components/StepGroup/StepLine.web.js.map +1 -1
- package/build/lib/web/development/components/Switch/Switch.js +1 -1
- package/build/lib/web/development/components/Switch/Switch.js.map +1 -1
- package/build/lib/web/development/components/Table/Table.web.js +10 -10
- package/build/lib/web/development/components/Table/Table.web.js.map +1 -1
- package/build/lib/web/development/components/Table/TableBody.web.js +6 -6
- package/build/lib/web/development/components/Table/TableBody.web.js.map +1 -1
- package/build/lib/web/development/components/Table/TableContext.js.map +1 -1
- package/build/lib/web/development/components/Table/TableHeader.web.js.map +1 -1
- package/build/lib/web/development/components/Table/TablePagination.web.js +2 -2
- package/build/lib/web/development/components/Table/TablePagination.web.js.map +1 -1
- package/build/lib/web/development/components/Table/TableToolbar.web.js.map +1 -1
- package/build/lib/web/development/components/Tabs/TabItem.web.js +2 -2
- package/build/lib/web/development/components/Tabs/TabItem.web.js.map +1 -1
- package/build/lib/web/development/components/Tabs/TabList.web.js +2 -2
- package/build/lib/web/development/components/Tabs/TabList.web.js.map +1 -1
- package/build/lib/web/development/components/Tabs/Tabs.web.js +1 -1
- package/build/lib/web/development/components/Tabs/Tabs.web.js.map +1 -1
- package/build/lib/web/development/components/Tabs/utils.js +2 -2
- package/build/lib/web/development/components/Tabs/utils.js.map +1 -1
- package/build/lib/web/development/components/Tag/AnimatedTag.web.js.map +1 -1
- package/build/lib/web/development/components/Tag/Tag.js.map +1 -1
- package/build/lib/web/development/components/Toast/Toast.web.js +2 -2
- package/build/lib/web/development/components/Toast/Toast.web.js.map +1 -1
- package/build/lib/web/development/components/Toast/ToastContainer.web.js.map +1 -1
- package/build/lib/web/development/components/Tooltip/Tooltip.web.js +1 -1
- package/build/lib/web/development/components/Tooltip/Tooltip.web.js.map +1 -1
- package/build/lib/web/development/components/TopNav/TabNav/TabNavItem.web.js +2 -2
- package/build/lib/web/development/components/TopNav/TabNav/TabNavItem.web.js.map +1 -1
- package/build/lib/web/development/components/TopNav/TabNav/utils.js +2 -2
- package/build/lib/web/development/components/TopNav/TabNav/utils.js.map +1 -1
- package/build/lib/web/development/components/Typography/Text/Text.js +1 -1
- package/build/lib/web/development/components/Typography/Text/Text.js.map +1 -1
- package/build/lib/web/development/tokens/theme/overrideTheme.js +2 -2
- package/build/lib/web/development/tokens/theme/overrideTheme.js.map +1 -1
- package/build/lib/web/development/utils/bladeCoverage.js +9 -10
- package/build/lib/web/development/utils/bladeCoverage.js.map +1 -1
- package/build/lib/web/development/utils/fireNativeEvent/fireNativeEvent.web.js +1 -1
- package/build/lib/web/development/utils/fireNativeEvent/fireNativeEvent.web.js.map +1 -1
- package/build/lib/web/development/utils/hasSameObjectStructure/hasSameObjectStructure.js +6 -6
- package/build/lib/web/development/utils/hasSameObjectStructure/hasSameObjectStructure.js.map +1 -1
- package/build/lib/web/development/utils/isPartialMatchObjectKeys/isPartialMatchObjectKeys.js +3 -3
- package/build/lib/web/development/utils/isPartialMatchObjectKeys/isPartialMatchObjectKeys.js.map +1 -1
- package/build/lib/web/development/utils/isValidAllowedChildren/isValidAllowedChildren.js +2 -2
- package/build/lib/web/development/utils/isValidAllowedChildren/isValidAllowedChildren.js.map +1 -1
- package/build/lib/web/development/utils/lodashButBetter/cloneDeep.js +3 -3
- package/build/lib/web/development/utils/lodashButBetter/get.js +3 -3
- package/build/lib/web/development/utils/useControllable.js +1 -1
- package/build/lib/web/development/utils/useControllable.js.map +1 -1
- package/build/lib/web/development/utils/useControlledDropdownInput/useControlledDropdownInput.js +2 -2
- package/build/lib/web/development/utils/useControlledDropdownInput/useControlledDropdownInput.js.map +1 -1
- package/build/lib/web/development/utils/useScrollLock.js.map +1 -1
- package/build/lib/web/production/components/Accordion/Accordion.js +2 -2
- package/build/lib/web/production/components/Accordion/Accordion.js.map +1 -1
- package/build/lib/web/production/components/ActionList/ActionList.js +1 -1
- package/build/lib/web/production/components/ActionList/ActionList.js.map +1 -1
- package/build/lib/web/production/components/ActionList/ActionListBox.web.js +7 -7
- package/build/lib/web/production/components/ActionList/ActionListBox.web.js.map +1 -1
- package/build/lib/web/production/components/ActionList/ActionListItem.js +4 -4
- package/build/lib/web/production/components/ActionList/ActionListItem.js.map +1 -1
- package/build/lib/web/production/components/ActionList/actionListUtils.js +4 -4
- package/build/lib/web/production/components/ActionList/actionListUtils.js.map +1 -1
- package/build/lib/web/production/components/Amount/Amount.js +2 -2
- package/build/lib/web/production/components/Amount/Amount.js.map +1 -1
- package/build/lib/web/production/components/AnimateInteractions/AnimateInteractions.web.js.map +1 -1
- package/build/lib/web/production/components/AnimateInteractions/useFocusWithin.js +2 -2
- package/build/lib/web/production/components/AnimateInteractions/useFocusWithin.js.map +1 -1
- package/build/lib/web/production/components/Avatar/Avatar.web.js +1 -1
- package/build/lib/web/production/components/Avatar/Avatar.web.js.map +1 -1
- package/build/lib/web/production/components/Badge/Badge.js +1 -1
- package/build/lib/web/production/components/Badge/Badge.js.map +1 -1
- package/build/lib/web/production/components/BaseHeaderFooter/BaseHeader.js +2 -2
- package/build/lib/web/production/components/BaseHeaderFooter/BaseHeader.js.map +1 -1
- package/build/lib/web/production/components/BaseMotion/baseMotionUtils.js +2 -2
- package/build/lib/web/production/components/BaseMotion/baseMotionUtils.js.map +1 -1
- package/build/lib/web/production/components/BladeProvider/useTheme.js.map +1 -1
- package/build/lib/web/production/components/BottomSheet/BottomSheet.web.js +19 -19
- package/build/lib/web/production/components/BottomSheet/BottomSheet.web.js.map +1 -1
- package/build/lib/web/production/components/BottomSheet/BottomSheetBackdrop.web.js.map +1 -1
- package/build/lib/web/production/components/BottomSheet/BottomSheetContext.js.map +1 -1
- package/build/lib/web/production/components/BottomSheet/BottomSheetStack.js.map +1 -1
- package/build/lib/web/production/components/Box/BaseBox/baseBoxStyles.js +27 -27
- package/build/lib/web/production/components/Box/BaseBox/baseBoxStyles.js.map +1 -1
- package/build/lib/web/production/components/Box/Box.js +1 -1
- package/build/lib/web/production/components/Box/Box.js.map +1 -1
- package/build/lib/web/production/components/Button/BaseButton/BaseButton.js +5 -5
- package/build/lib/web/production/components/Button/BaseButton/BaseButton.js.map +1 -1
- package/build/lib/web/production/components/Button/BaseButton/buttonTokens.js.map +1 -1
- package/build/lib/web/production/components/Button/Button/Button.js +2 -2
- package/build/lib/web/production/components/Button/Button/Button.js.map +1 -1
- package/build/lib/web/production/components/Button/IconButton/IconButton.js +1 -1
- package/build/lib/web/production/components/Button/IconButton/IconButton.js.map +1 -1
- package/build/lib/web/production/components/ButtonGroup/ButtonGroup.web.js +1 -1
- package/build/lib/web/production/components/ButtonGroup/ButtonGroup.web.js.map +1 -1
- package/build/lib/web/production/components/Card/Card.js.map +1 -1
- package/build/lib/web/production/components/Card/CardFooter.js +2 -2
- package/build/lib/web/production/components/Card/CardFooter.js.map +1 -1
- package/build/lib/web/production/components/Card/CardRoot.web.js.map +1 -1
- package/build/lib/web/production/components/Carousel/Carousel.web.js +6 -6
- package/build/lib/web/production/components/Carousel/Carousel.web.js.map +1 -1
- package/build/lib/web/production/components/Carousel/CarouselItem.web.js +2 -2
- package/build/lib/web/production/components/Carousel/CarouselItem.web.js.map +1 -1
- package/build/lib/web/production/components/Carousel/Indicators/Indicators.js +1 -1
- package/build/lib/web/production/components/Carousel/Indicators/Indicators.js.map +1 -1
- package/build/lib/web/production/components/ChatMessage/ChatMessage.web.js +1 -1
- package/build/lib/web/production/components/ChatMessage/ChatMessage.web.js.map +1 -1
- package/build/lib/web/production/components/Checkbox/Checkbox.js +5 -5
- package/build/lib/web/production/components/Checkbox/Checkbox.js.map +1 -1
- package/build/lib/web/production/components/Checkbox/CheckboxGroup/useCheckboxGroup.js.map +1 -1
- package/build/lib/web/production/components/Checkbox/useCheckbox.js +1 -1
- package/build/lib/web/production/components/Checkbox/useCheckbox.js.map +1 -1
- package/build/lib/web/production/components/Chip/Chip.js +5 -5
- package/build/lib/web/production/components/Chip/Chip.js.map +1 -1
- package/build/lib/web/production/components/Chip/useChipGroup.js.map +1 -1
- package/build/lib/web/production/components/Collapsible/Collapsible.js +3 -3
- package/build/lib/web/production/components/Collapsible/Collapsible.js.map +1 -1
- package/build/lib/web/production/components/Collapsible/CollapsibleButton.js +1 -1
- package/build/lib/web/production/components/Collapsible/CollapsibleButton.js.map +1 -1
- package/build/lib/web/production/components/Counter/Counter.js +1 -1
- package/build/lib/web/production/components/Counter/Counter.js.map +1 -1
- package/build/lib/web/production/components/DatePicker/BaseDatePicker.web.js +23 -17
- package/build/lib/web/production/components/DatePicker/BaseDatePicker.web.js.map +1 -1
- package/build/lib/web/production/components/DatePicker/Calendar.web.js +7 -7
- package/build/lib/web/production/components/DatePicker/Calendar.web.js.map +1 -1
- package/build/lib/web/production/components/DatePicker/CalendarFooter.web.js +42 -24
- package/build/lib/web/production/components/DatePicker/CalendarFooter.web.js.map +1 -1
- package/build/lib/web/production/components/DatePicker/CalendarHeader.web.js.map +1 -1
- package/build/lib/web/production/components/DatePicker/DateInput.web.js +4 -4
- package/build/lib/web/production/components/DatePicker/DateInput.web.js.map +1 -1
- package/build/lib/web/production/components/DatePicker/QuickSelection/PresetDropdown.web.js.map +1 -1
- package/build/lib/web/production/components/DatePicker/QuickSelection/PresetSideBar.web.js.map +1 -1
- package/build/lib/web/production/components/DatePicker/useControlledDates.js +1 -1
- package/build/lib/web/production/components/DatePicker/useControlledDates.js.map +1 -1
- package/build/lib/web/production/components/DatePicker/useDatesState.js +1 -1
- package/build/lib/web/production/components/DatePicker/useDatesState.js.map +1 -1
- package/build/lib/web/production/components/DatePicker/usePopup.js +2 -2
- package/build/lib/web/production/components/DatePicker/usePopup.js.map +1 -1
- package/build/lib/web/production/components/DatePicker/utils.js +1 -1
- package/build/lib/web/production/components/DatePicker/utils.js.map +1 -1
- package/build/lib/web/production/components/Drawer/Drawer.web.js +2 -2
- package/build/lib/web/production/components/Drawer/Drawer.web.js.map +1 -1
- package/build/lib/web/production/components/Drawer/DrawerContext.js.map +1 -1
- package/build/lib/web/production/components/Drawer/DrawerSubcomponents.web.js.map +1 -1
- package/build/lib/web/production/components/Drawer/StackProvider.js.map +1 -1
- package/build/lib/web/production/components/Dropdown/Dropdown.js +28 -28
- package/build/lib/web/production/components/Dropdown/Dropdown.js.map +1 -1
- package/build/lib/web/production/components/Dropdown/DropdownButton.js +4 -4
- package/build/lib/web/production/components/Dropdown/DropdownButton.js.map +1 -1
- package/build/lib/web/production/components/Dropdown/DropdownHeaderFooter.js.map +1 -1
- package/build/lib/web/production/components/Dropdown/DropdownIconButton.js +4 -4
- package/build/lib/web/production/components/Dropdown/DropdownIconButton.js.map +1 -1
- package/build/lib/web/production/components/Dropdown/DropdownLink.js +4 -4
- package/build/lib/web/production/components/Dropdown/DropdownLink.js.map +1 -1
- package/build/lib/web/production/components/Dropdown/DropdownOverlay.web.js +1 -1
- package/build/lib/web/production/components/Dropdown/DropdownOverlay.web.js.map +1 -1
- package/build/lib/web/production/components/Dropdown/FilterChipGroup.web.js +1 -1
- package/build/lib/web/production/components/Dropdown/FilterChipGroup.web.js.map +1 -1
- package/build/lib/web/production/components/Dropdown/FilterChipGroupContext.web.js.map +1 -1
- package/build/lib/web/production/components/Dropdown/FilterChipSelectInput.web.js +7 -7
- package/build/lib/web/production/components/Dropdown/FilterChipSelectInput.web.js.map +1 -1
- package/build/lib/web/production/components/Dropdown/InputDropdownButton.web.js +8 -8
- package/build/lib/web/production/components/Dropdown/InputDropdownButton.web.js.map +1 -1
- package/build/lib/web/production/components/Dropdown/useDropdown.js +4 -4
- package/build/lib/web/production/components/Dropdown/useDropdown.js.map +1 -1
- package/build/lib/web/production/components/EmptyState/EmptyState.web.js +1 -1
- package/build/lib/web/production/components/EmptyState/EmptyState.web.js.map +1 -1
- package/build/lib/web/production/components/FileUpload/FileUpload.web.js +14 -14
- package/build/lib/web/production/components/FileUpload/FileUpload.web.js.map +1 -1
- package/build/lib/web/production/components/FileUpload/FileUploadItem.js +1 -1
- package/build/lib/web/production/components/FileUpload/FileUploadItem.js.map +1 -1
- package/build/lib/web/production/components/FilterChip/BaseFilterChip.web.js +3 -3
- package/build/lib/web/production/components/FilterChip/BaseFilterChip.web.js.map +1 -1
- package/build/lib/web/production/components/Form/FormHint.js.map +1 -1
- package/build/lib/web/production/components/Form/Selector/SelectorInput.web.js +1 -1
- package/build/lib/web/production/components/Form/Selector/SelectorInput.web.js.map +1 -1
- package/build/lib/web/production/components/Indicator/Indicator.js +1 -1
- package/build/lib/web/production/components/Indicator/Indicator.js.map +1 -1
- package/build/lib/web/production/components/InfoGroup/InfoGroup.web.js +6 -6
- package/build/lib/web/production/components/InfoGroup/InfoGroup.web.js.map +1 -1
- package/build/lib/web/production/components/InfoGroup/InfoGroupContext.js.map +1 -1
- package/build/lib/web/production/components/Input/BaseInput/AnimatedBaseInputWrapper.web.js +1 -1
- package/build/lib/web/production/components/Input/BaseInput/AnimatedBaseInputWrapper.web.js.map +1 -1
- package/build/lib/web/production/components/Input/BaseInput/BaseInput.js +110 -110
- package/build/lib/web/production/components/Input/BaseInput/BaseInput.js.map +1 -1
- package/build/lib/web/production/components/Input/BaseInput/BaseInputTagSlot.web.js +8 -8
- package/build/lib/web/production/components/Input/BaseInput/BaseInputTagSlot.web.js.map +1 -1
- package/build/lib/web/production/components/Input/BaseInput/StyledBaseInput.web.js +7 -7
- package/build/lib/web/production/components/Input/BaseInput/StyledBaseInput.web.js.map +1 -1
- package/build/lib/web/production/components/Input/BaseInput/useTaggedInput.js +4 -4
- package/build/lib/web/production/components/Input/BaseInput/useTaggedInput.js.map +1 -1
- package/build/lib/web/production/components/Input/DropdownInputTriggers/AutoComplete.js +8 -8
- package/build/lib/web/production/components/Input/DropdownInputTriggers/AutoComplete.js.map +1 -1
- package/build/lib/web/production/components/Input/DropdownInputTriggers/BaseDropdownInputTrigger.js +4 -4
- package/build/lib/web/production/components/Input/DropdownInputTriggers/BaseDropdownInputTrigger.js.map +1 -1
- package/build/lib/web/production/components/Input/DropdownInputTriggers/SelectInput.js +3 -3
- package/build/lib/web/production/components/Input/DropdownInputTriggers/SelectInput.js.map +1 -1
- package/build/lib/web/production/components/Input/OTPInput/OTPInput.js +14 -14
- package/build/lib/web/production/components/Input/OTPInput/OTPInput.js.map +1 -1
- package/build/lib/web/production/components/Input/PasswordInput/PasswordInput.js +1 -1
- package/build/lib/web/production/components/Input/PasswordInput/PasswordInput.js.map +1 -1
- package/build/lib/web/production/components/Input/PhoneNumberInput/CountrySelector.web.js.map +1 -1
- package/build/lib/web/production/components/Input/PhoneNumberInput/PhoneNumberInput.web.js +5 -5
- package/build/lib/web/production/components/Input/PhoneNumberInput/PhoneNumberInput.web.js.map +1 -1
- package/build/lib/web/production/components/Input/SearchInput/SearchInput.js +5 -5
- package/build/lib/web/production/components/Input/SearchInput/SearchInput.js.map +1 -1
- package/build/lib/web/production/components/Input/TextArea/TextArea.js +7 -7
- package/build/lib/web/production/components/Input/TextArea/TextArea.js.map +1 -1
- package/build/lib/web/production/components/Input/TextInput/TextInput.js +7 -7
- package/build/lib/web/production/components/Input/TextInput/TextInput.js.map +1 -1
- package/build/lib/web/production/components/Input/TextInput/useFormattedInput.js +2 -2
- package/build/lib/web/production/components/Input/TextInput/useFormattedInput.js.map +1 -1
- package/build/lib/web/production/components/InputGroup/InputGroup.web.js +1 -1
- package/build/lib/web/production/components/InputGroup/InputGroup.web.js.map +1 -1
- package/build/lib/web/production/components/Link/BaseLink/BaseLink.js +3 -3
- package/build/lib/web/production/components/Link/BaseLink/BaseLink.js.map +1 -1
- package/build/lib/web/production/components/Link/Link/Link.js +1 -1
- package/build/lib/web/production/components/Link/Link/Link.js.map +1 -1
- package/build/lib/web/production/components/List/List.js +1 -1
- package/build/lib/web/production/components/List/List.js.map +1 -1
- package/build/lib/web/production/components/List/getOrderedListItemBullet.js +3 -3
- package/build/lib/web/production/components/List/getOrderedListItemBullet.js.map +1 -1
- package/build/lib/web/production/components/ListView/ListViewFilters.web.js.map +1 -1
- package/build/lib/web/production/components/ListView/ListViewFiltersContext.web.js.map +1 -1
- package/build/lib/web/production/components/LiveAnnouncer/LiveAnnouncer.web.js.map +1 -1
- package/build/lib/web/production/components/Menu/Menu.web.js.map +1 -1
- package/build/lib/web/production/components/Menu/MenuItem.web.js +3 -3
- package/build/lib/web/production/components/Menu/MenuItem.web.js.map +1 -1
- package/build/lib/web/production/components/Menu/useMenu.js.map +1 -1
- package/build/lib/web/production/components/Modal/ModalBackdrop.js.map +1 -1
- package/build/lib/web/production/components/Modal/ModalContext.js.map +1 -1
- package/build/lib/web/production/components/Popover/Popover.web.js.map +1 -1
- package/build/lib/web/production/components/Preview/Preview.web.js +29 -30
- package/build/lib/web/production/components/Preview/Preview.web.js.map +1 -1
- package/build/lib/web/production/components/QuickFilters/QuickFilterGroup/QuickFilterGroup.js.map +1 -1
- package/build/lib/web/production/components/Radio/Radio.js +4 -4
- package/build/lib/web/production/components/Radio/Radio.js.map +1 -1
- package/build/lib/web/production/components/Radio/RadioGroup/useRadioGroup.js +1 -1
- package/build/lib/web/production/components/Radio/RadioGroup/useRadioGroup.js.map +1 -1
- package/build/lib/web/production/components/Radio/useRadio.js +1 -1
- package/build/lib/web/production/components/Radio/useRadio.js.map +1 -1
- package/build/lib/web/production/components/SideNav/SideNav.web.js +19 -19
- package/build/lib/web/production/components/SideNav/SideNav.web.js.map +1 -1
- package/build/lib/web/production/components/SideNav/SideNavItems/SideNavLink.web.js +6 -6
- package/build/lib/web/production/components/SideNav/SideNavItems/SideNavLink.web.js.map +1 -1
- package/build/lib/web/production/components/SideNav/SideNavLevel.web.js.map +1 -1
- package/build/lib/web/production/components/SpotlightPopoverTour/Tour.web.js +7 -7
- package/build/lib/web/production/components/SpotlightPopoverTour/Tour.web.js.map +1 -1
- package/build/lib/web/production/components/SpotlightPopoverTour/TourFooter.web.js +2 -2
- package/build/lib/web/production/components/SpotlightPopoverTour/TourFooter.web.js.map +1 -1
- package/build/lib/web/production/components/SpotlightPopoverTour/TourMask.web.js +1 -1
- package/build/lib/web/production/components/SpotlightPopoverTour/TourMask.web.js.map +1 -1
- package/build/lib/web/production/components/SpotlightPopoverTour/TourPopover.web.js.map +1 -1
- package/build/lib/web/production/components/SpotlightPopoverTour/TourStep.web.js +1 -1
- package/build/lib/web/production/components/SpotlightPopoverTour/TourStep.web.js.map +1 -1
- package/build/lib/web/production/components/StepGroup/StepGroup.web.js +6 -6
- package/build/lib/web/production/components/StepGroup/StepGroup.web.js.map +1 -1
- package/build/lib/web/production/components/StepGroup/StepItem.web.js +1 -1
- package/build/lib/web/production/components/StepGroup/StepItem.web.js.map +1 -1
- package/build/lib/web/production/components/StepGroup/StepLine.web.js +13 -13
- package/build/lib/web/production/components/StepGroup/StepLine.web.js.map +1 -1
- package/build/lib/web/production/components/Switch/Switch.js +1 -1
- package/build/lib/web/production/components/Switch/Switch.js.map +1 -1
- package/build/lib/web/production/components/Table/Table.web.js +10 -10
- package/build/lib/web/production/components/Table/Table.web.js.map +1 -1
- package/build/lib/web/production/components/Table/TableBody.web.js +6 -6
- package/build/lib/web/production/components/Table/TableBody.web.js.map +1 -1
- package/build/lib/web/production/components/Table/TableContext.js.map +1 -1
- package/build/lib/web/production/components/Table/TableHeader.web.js.map +1 -1
- package/build/lib/web/production/components/Table/TablePagination.web.js +2 -2
- package/build/lib/web/production/components/Table/TablePagination.web.js.map +1 -1
- package/build/lib/web/production/components/Table/TableToolbar.web.js.map +1 -1
- package/build/lib/web/production/components/Tabs/TabItem.web.js +2 -2
- package/build/lib/web/production/components/Tabs/TabItem.web.js.map +1 -1
- package/build/lib/web/production/components/Tabs/TabList.web.js +2 -2
- package/build/lib/web/production/components/Tabs/TabList.web.js.map +1 -1
- package/build/lib/web/production/components/Tabs/Tabs.web.js +1 -1
- package/build/lib/web/production/components/Tabs/Tabs.web.js.map +1 -1
- package/build/lib/web/production/components/Tabs/utils.js +2 -2
- package/build/lib/web/production/components/Tabs/utils.js.map +1 -1
- package/build/lib/web/production/components/Tag/AnimatedTag.web.js.map +1 -1
- package/build/lib/web/production/components/Tag/Tag.js.map +1 -1
- package/build/lib/web/production/components/Toast/Toast.web.js +2 -2
- package/build/lib/web/production/components/Toast/Toast.web.js.map +1 -1
- package/build/lib/web/production/components/Toast/ToastContainer.web.js.map +1 -1
- package/build/lib/web/production/components/Tooltip/Tooltip.web.js +1 -1
- package/build/lib/web/production/components/Tooltip/Tooltip.web.js.map +1 -1
- package/build/lib/web/production/components/TopNav/TabNav/TabNavItem.web.js +2 -2
- package/build/lib/web/production/components/TopNav/TabNav/TabNavItem.web.js.map +1 -1
- package/build/lib/web/production/components/TopNav/TabNav/utils.js +2 -2
- package/build/lib/web/production/components/TopNav/TabNav/utils.js.map +1 -1
- package/build/lib/web/production/components/Typography/Text/Text.js +1 -1
- package/build/lib/web/production/components/Typography/Text/Text.js.map +1 -1
- package/build/lib/web/production/tokens/theme/overrideTheme.js +2 -2
- package/build/lib/web/production/tokens/theme/overrideTheme.js.map +1 -1
- package/build/lib/web/production/utils/bladeCoverage.js +9 -10
- package/build/lib/web/production/utils/bladeCoverage.js.map +1 -1
- package/build/lib/web/production/utils/fireNativeEvent/fireNativeEvent.web.js +1 -1
- package/build/lib/web/production/utils/fireNativeEvent/fireNativeEvent.web.js.map +1 -1
- package/build/lib/web/production/utils/hasSameObjectStructure/hasSameObjectStructure.js +6 -6
- package/build/lib/web/production/utils/hasSameObjectStructure/hasSameObjectStructure.js.map +1 -1
- package/build/lib/web/production/utils/isPartialMatchObjectKeys/isPartialMatchObjectKeys.js +3 -3
- package/build/lib/web/production/utils/isPartialMatchObjectKeys/isPartialMatchObjectKeys.js.map +1 -1
- package/build/lib/web/production/utils/isValidAllowedChildren/isValidAllowedChildren.js +2 -2
- package/build/lib/web/production/utils/isValidAllowedChildren/isValidAllowedChildren.js.map +1 -1
- package/build/lib/web/production/utils/lodashButBetter/cloneDeep.js +3 -3
- package/build/lib/web/production/utils/lodashButBetter/get.js +3 -3
- package/build/lib/web/production/utils/useControllable.js +1 -1
- package/build/lib/web/production/utils/useControllable.js.map +1 -1
- package/build/lib/web/production/utils/useControlledDropdownInput/useControlledDropdownInput.js +2 -2
- package/build/lib/web/production/utils/useControlledDropdownInput/useControlledDropdownInput.js.map +1 -1
- package/build/lib/web/production/utils/useScrollLock.js.map +1 -1
- package/build/types/components/index.d.ts +5 -0
- package/build/types/components/index.native.d.ts +5 -0
- package/package.json +15 -10
|
@@ -106,13 +106,13 @@ var _OTPInput = function _OTPInput(_ref, incomingRef) {
|
|
|
106
106
|
// Effect for calling `onOTPFilled` callback
|
|
107
107
|
if (inputValue && inputValue.length >= otpLength) {
|
|
108
108
|
// callback for when the OTPInput is controlled and inputValue reaches the same or greater length as the otpLength
|
|
109
|
-
onOTPFilled === null || onOTPFilled === void 0
|
|
109
|
+
onOTPFilled === null || onOTPFilled === void 0 || onOTPFilled({
|
|
110
110
|
value: inputValue.slice(0, otpLength),
|
|
111
111
|
name: name
|
|
112
112
|
});
|
|
113
113
|
} else if (!inputValue && otpValue.join('').length >= otpLength) {
|
|
114
114
|
// callback for when the OTPInput is uncontrolled and otpValue stored in state reaches the same or greater length as the otpLength
|
|
115
|
-
onOTPFilled === null || onOTPFilled === void 0
|
|
115
|
+
onOTPFilled === null || onOTPFilled === void 0 || onOTPFilled({
|
|
116
116
|
value: otpValue.slice(0, otpLength).join(''),
|
|
117
117
|
name: name
|
|
118
118
|
});
|
|
@@ -160,12 +160,12 @@ var _OTPInput = function _OTPInput(_ref, incomingRef) {
|
|
|
160
160
|
* @param {number} index the index of the otp input to be focused
|
|
161
161
|
*/
|
|
162
162
|
var focusOnOtpByIndex = function focusOnOtpByIndex(index) {
|
|
163
|
-
var _inputRefs$index
|
|
164
|
-
(_inputRefs$index = inputRefs[index]) === null || _inputRefs$index === void 0
|
|
163
|
+
var _inputRefs$index;
|
|
164
|
+
(_inputRefs$index = inputRefs[index]) === null || _inputRefs$index === void 0 || (_inputRefs$index = _inputRefs$index.current) === null || _inputRefs$index === void 0 || _inputRefs$index.focus();
|
|
165
165
|
if (!isReactNative) {
|
|
166
|
-
var _inputRefs$index2
|
|
166
|
+
var _inputRefs$index2;
|
|
167
167
|
// React Native doesn't support imperatively selecting the value of input
|
|
168
|
-
(_inputRefs$index2 = inputRefs[index]) === null || _inputRefs$index2 === void 0
|
|
168
|
+
(_inputRefs$index2 = inputRefs[index]) === null || _inputRefs$index2 === void 0 || (_inputRefs$index2 = _inputRefs$index2.current) === null || _inputRefs$index2 === void 0 || _inputRefs$index2.select();
|
|
169
169
|
}
|
|
170
170
|
};
|
|
171
171
|
var handleOnChange = function handleOnChange(_ref3) {
|
|
@@ -181,7 +181,7 @@ var _OTPInput = function _OTPInput(_ref, incomingRef) {
|
|
|
181
181
|
var newOtpValue = Array.from(inputValue);
|
|
182
182
|
newOtpValue[currentOtpIndex] = value !== null && value !== void 0 ? value : '';
|
|
183
183
|
setOtpValue(newOtpValue);
|
|
184
|
-
onChange === null || onChange === void 0
|
|
184
|
+
onChange === null || onChange === void 0 || onChange({
|
|
185
185
|
name: name,
|
|
186
186
|
value: newOtpValue.join('')
|
|
187
187
|
});
|
|
@@ -189,7 +189,7 @@ var _OTPInput = function _OTPInput(_ref, incomingRef) {
|
|
|
189
189
|
// When the entered value is more that 1 character (when value is pasted), set the otpValue to the newly received value.
|
|
190
190
|
// Could have used `onPaste` for web to achieve this but 1. React Native doesn't support onPaste and 2. Safari's autofill on web doesn't trigger onPaste
|
|
191
191
|
setOtpValue(Array.from(value));
|
|
192
|
-
onChange === null || onChange === void 0
|
|
192
|
+
onChange === null || onChange === void 0 || onChange({
|
|
193
193
|
name: name,
|
|
194
194
|
value: value.trim().slice(0, otpLength)
|
|
195
195
|
});
|
|
@@ -201,7 +201,7 @@ var _OTPInput = function _OTPInput(_ref, incomingRef) {
|
|
|
201
201
|
value: (_value$trim = value === null || value === void 0 ? void 0 : value.trim()) !== null && _value$trim !== void 0 ? _value$trim : '',
|
|
202
202
|
index: currentOtpIndex
|
|
203
203
|
});
|
|
204
|
-
onChange === null || onChange === void 0
|
|
204
|
+
onChange === null || onChange === void 0 || onChange({
|
|
205
205
|
name: name,
|
|
206
206
|
value: newValue
|
|
207
207
|
});
|
|
@@ -222,7 +222,7 @@ var _OTPInput = function _OTPInput(_ref, incomingRef) {
|
|
|
222
222
|
currentOtpIndex = _ref5.currentOtpIndex;
|
|
223
223
|
if (key === 'Backspace' || code === 'Backspace' || code === 'Delete' || key === 'Delete') {
|
|
224
224
|
var _event$preventDefault;
|
|
225
|
-
(_event$preventDefault = event.preventDefault) === null || _event$preventDefault === void 0
|
|
225
|
+
(_event$preventDefault = event.preventDefault) === null || _event$preventDefault === void 0 || _event$preventDefault.call(event);
|
|
226
226
|
if (otpValue[currentOtpIndex]) {
|
|
227
227
|
// Clear the value at the current index if value exists
|
|
228
228
|
handleOnChange({
|
|
@@ -240,15 +240,15 @@ var _OTPInput = function _OTPInput(_ref, incomingRef) {
|
|
|
240
240
|
}
|
|
241
241
|
} else if (key === 'ArrowLeft' || code === 'ArrowLeft') {
|
|
242
242
|
var _event$preventDefault2;
|
|
243
|
-
(_event$preventDefault2 = event.preventDefault) === null || _event$preventDefault2 === void 0
|
|
243
|
+
(_event$preventDefault2 = event.preventDefault) === null || _event$preventDefault2 === void 0 || _event$preventDefault2.call(event);
|
|
244
244
|
focusOnOtpByIndex(--currentOtpIndex);
|
|
245
245
|
} else if (key === 'ArrowRight' || code === 'ArrowRight') {
|
|
246
246
|
var _event$preventDefault3;
|
|
247
|
-
(_event$preventDefault3 = event.preventDefault) === null || _event$preventDefault3 === void 0
|
|
247
|
+
(_event$preventDefault3 = event.preventDefault) === null || _event$preventDefault3 === void 0 || _event$preventDefault3.call(event);
|
|
248
248
|
focusOnOtpByIndex(++currentOtpIndex);
|
|
249
249
|
} else if (key === ' ' || code === 'Space') {
|
|
250
250
|
var _event$preventDefault4;
|
|
251
|
-
(_event$preventDefault4 = event.preventDefault) === null || _event$preventDefault4 === void 0
|
|
251
|
+
(_event$preventDefault4 = event.preventDefault) === null || _event$preventDefault4 === void 0 || _event$preventDefault4.call(event);
|
|
252
252
|
}
|
|
253
253
|
};
|
|
254
254
|
var getHiddenInput = function getHiddenInput() {
|
|
@@ -277,7 +277,7 @@ var _OTPInput = function _OTPInput(_ref, incomingRef) {
|
|
|
277
277
|
currentInputType = inputValue ? 'password' : inputType[index];
|
|
278
278
|
}
|
|
279
279
|
inputRefs.push(ref);
|
|
280
|
-
inputs.push(
|
|
280
|
+
inputs.push(/*#__PURE__*/jsx(BaseBox, {
|
|
281
281
|
flex: 1,
|
|
282
282
|
marginLeft: index == 0 ? 'spacing.0' : 'spacing.3',
|
|
283
283
|
children: /*#__PURE__*/jsx(BaseInput
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OTPInput.js","sources":["../../../../../../../src/components/Input/OTPInput/OTPInput.tsx"],"sourcesContent":["import React, { useEffect, useImperativeHandle, useState } from 'react';\nimport type { BaseInputProps } from '../BaseInput';\nimport { BaseInput } from '../BaseInput';\nimport { getHintType } from '../BaseInput/BaseInput';\nimport isEmpty from '~utils/lodashButBetter/isEmpty';\nimport type { FormInputOnEvent } from '~components/Form';\nimport { FormHint, FormLabel } from '~components/Form';\nimport { useFormId } from '~components/Form/useFormId';\nimport type { FormInputOnKeyDownEvent } from '~components/Form/FormTypes';\nimport BaseBox from '~components/Box/BaseBox';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport { getPlatformType } from '~utils';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { makeSize } from '~utils/makeSize';\nimport type { DataAnalyticsAttribute } from '~utils/types';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\n\ntype FormInputOnEventWithIndex = ({\n name,\n value,\n inputIndex,\n}: {\n name?: string;\n value?: string;\n inputIndex: number;\n}) => void;\n\nexport type OTPInputCommonProps = Pick<\n BaseInputProps,\n | 'label'\n | 'accessibilityLabel'\n | 'labelPosition'\n | 'labelSuffix'\n | 'labelTrailing'\n | 'validationState'\n | 'helpText'\n | 'errorText'\n | 'successText'\n | 'name'\n | 'onChange'\n | 'value'\n | 'isDisabled'\n | 'autoFocus'\n | 'keyboardReturnKeyType'\n | 'keyboardType'\n | 'placeholder'\n | 'testID'\n | 'size'\n | keyof DataAnalyticsAttribute\n> & {\n /**\n * Determines the number of input fields to show for the OTP\n * @default 6\n */\n otpLength?: 4 | 6;\n /**\n * The callback function to be invoked when all the values of the OTPInput are filled\n */\n onOTPFilled?: FormInputOnEvent;\n /**\n * Masks input characters in all the fields\n */\n isMasked?: boolean;\n /**\n * Determines what autoComplete suggestion type to show. Defaults to `oneTimeCode`.\n *\n * It's not recommended to turn this off in favor of otp input practices.\n *\n *\n * Internally it'll render platform specific attributes:\n *\n * - web: `autocomplete`\n * - iOS: `textContentType`\n * - android: `autoComplete`\n *\n */\n autoCompleteSuggestionType?: Extract<\n BaseInputProps['autoCompleteSuggestionType'],\n 'none' | 'oneTimeCode'\n >;\n /**\n * The callback function to be invoked when one of the input fields gets focus\n */\n onFocus?: FormInputOnEventWithIndex;\n /**\n * The callback function to be invoked when one of the input fields is blurred\n */\n onBlur?: FormInputOnEventWithIndex;\n} & StyledPropsBlade;\n\n/*\n Mandatory accessibilityLabel prop when label is not provided\n*/\ntype OTPInputPropsWithA11yLabel = {\n /**\n * Label to be shown for the input field\n */\n label?: undefined;\n /**\n * Accessibility label for the input\n */\n accessibilityLabel: string;\n};\n\n/*\n Optional accessibilityLabel prop when label is provided\n*/\ntype OTPInputPropsWithLabel = {\n /**\n * Label to be shown for the input field\n */\n label: string;\n /**\n * Accessibility label for the input\n */\n accessibilityLabel?: string;\n};\n\ntype OTPInputProps = (OTPInputPropsWithA11yLabel | OTPInputPropsWithLabel) & OTPInputCommonProps;\n\nconst isReactNative = getPlatformType() === 'react-native';\n\n/**\n * Converts a string value of otp to array if passed otherwise returns an array of 6 empty strings\n */\nconst otpToArray = (code?: string): string[] => code?.split('') ?? Array(6).fill('');\n\n/**\n * OTPInput component can be used for accepting OTPs sent to users for authentication/verification purposes.\n *\n * ## Usage\n *\n * ```tsx\n * <OTPInput\n * label=\"Enter OTP\"\n * name=\"otpInput\"\n * onChange={({ name, value }): void => console.log({ name, value })}\n * onOTPFilled={({ name, value }): void => console.log({ name, value })}\n * />\n * ```\n */\nconst _OTPInput: React.ForwardRefRenderFunction<HTMLInputElement[], OTPInputProps> = (\n {\n autoFocus,\n errorText,\n helpText,\n isDisabled,\n keyboardReturnKeyType,\n keyboardType = 'decimal',\n label,\n accessibilityLabel,\n labelPosition,\n labelSuffix,\n labelTrailing,\n name,\n onChange,\n onFocus,\n onBlur,\n onOTPFilled,\n otpLength = 6,\n placeholder,\n successText,\n validationState,\n value: inputValue,\n isMasked,\n autoCompleteSuggestionType = 'oneTimeCode',\n testID,\n size = 'medium',\n ...rest\n },\n incomingRef,\n) => {\n const inputRefs: React.RefObject<HTMLInputElement>[] = [];\n const [otpValue, setOtpValue] = useState<string[]>(otpToArray(inputValue));\n const [inputType, setInputType] = useState<('password' | undefined)[]>([]);\n const isLabelLeftPositioned = labelPosition === 'left';\n const { inputId, helpTextId, errorTextId, successTextId } = useFormId('otp');\n\n useImperativeHandle(\n incomingRef,\n () => {\n return inputRefs.map((ref) => ref.current!);\n },\n [inputRefs],\n );\n\n useEffect(() => {\n // Effect for calling `onOTPFilled` callback\n if (inputValue && inputValue.length >= otpLength) {\n // callback for when the OTPInput is controlled and inputValue reaches the same or greater length as the otpLength\n onOTPFilled?.({ value: inputValue.slice(0, otpLength), name });\n } else if (!inputValue && otpValue.join('').length >= otpLength) {\n // callback for when the OTPInput is uncontrolled and otpValue stored in state reaches the same or greater length as the otpLength\n onOTPFilled?.({ value: otpValue.slice(0, otpLength).join(''), name });\n }\n }, [otpValue, otpLength, name, inputValue, onOTPFilled]);\n\n useEffect(() => {\n /* We want to disable the password managers for OTPInput when isMasked is set.\n The issue with only setting autocomplete='off' is that its not an enforcement but a suggestion to the browser to follow.\n This workaround unsets type on first render and sets it to `password` only once a value is entered by the user.\n */\n otpValue.forEach((otp, index) => {\n // Set inputType as 'password' only when a value is entered when isMasked is set\n if (!isEmpty(otp) && !inputType[index] && isMasked) {\n const newInputType = Array.from(inputType);\n newInputType[index] = 'password';\n setInputType(newInputType);\n }\n // Cleanup the inputType array whenever the value is empty but inputType[index] is set\n if (isEmpty(otp) && inputType[index]) {\n const newInputType = Array.from(inputType);\n newInputType[index] = undefined;\n setInputType(newInputType);\n }\n });\n }, [otpValue, inputType, isMasked]);\n\n /**\n * Changes the value of the otp at a given index and updates the otpValue stored in state\n *\n * @param {{ value: string; index: number }} { value, index }\n * @returns {string} updated otpValue\n */\n const setOtpValueByIndex = ({ value, index }: { value: string; index: number }): string => {\n const newOtpValue = Array.from(otpValue);\n newOtpValue[index] = value;\n setOtpValue(newOtpValue);\n return newOtpValue.join('');\n };\n\n /**\n * Sets focus to the desired otp input by index\n *\n * @param {number} index the index of the otp input to be focused\n */\n const focusOnOtpByIndex = (index: number): void => {\n inputRefs[index]?.current?.focus();\n if (!isReactNative) {\n // React Native doesn't support imperatively selecting the value of input\n inputRefs[index]?.current?.select();\n }\n };\n\n const handleOnChange = ({\n value,\n currentOtpIndex,\n }: {\n value?: string;\n currentOtpIndex: number;\n }): void => {\n if (value && value === ' ') {\n // React native doesn't support `event.preventDefault()` hence have to add this check to ensure that empty space is not allowed\n return;\n }\n if (inputValue && inputValue.length > 0) {\n // When OTPInput is controlled, set the otpValue as the consumer passed `inputValue` and append the value on current index based on user's input.\n // User's input will not reflect on the otp but will trigger `onChange` callback with the user's input appended so that the consumer can take appropriate action.\n const newOtpValue = Array.from(inputValue);\n newOtpValue[currentOtpIndex] = value ?? '';\n setOtpValue(newOtpValue);\n onChange?.({ name, value: newOtpValue.join('') });\n } else if (value && value.trim().length > 1) {\n // When the entered value is more that 1 character (when value is pasted), set the otpValue to the newly received value.\n // Could have used `onPaste` for web to achieve this but 1. React Native doesn't support onPaste and 2. Safari's autofill on web doesn't trigger onPaste\n setOtpValue(Array.from(value));\n onChange?.({ name, value: value.trim().slice(0, otpLength) });\n } else if (otpValue[currentOtpIndex] !== value?.trim()) {\n // Set the value at the current index to the entered value\n // only as long as its not the same as the already existing value (this prevents `onChange` being triggered unnecessarily)\n const newValue = setOtpValueByIndex({\n value: value?.trim() ?? '',\n index: currentOtpIndex,\n });\n onChange?.({ name, value: newValue });\n }\n };\n\n const handleOnInput = ({\n value,\n currentOtpIndex,\n }: {\n value?: string;\n currentOtpIndex: number;\n }): void => {\n // Moves focus to next input whenever a value is entered in the current input\n if (value && value.trim().length === 1) {\n focusOnOtpByIndex(++currentOtpIndex);\n }\n };\n\n const handleOnKeyDown = ({\n key,\n code,\n event,\n currentOtpIndex,\n }: FormInputOnKeyDownEvent & { currentOtpIndex: number }): void => {\n if (key === 'Backspace' || code === 'Backspace' || code === 'Delete' || key === 'Delete') {\n event.preventDefault?.();\n if (otpValue[currentOtpIndex]) {\n // Clear the value at the current index if value exists\n handleOnChange({ value: '', currentOtpIndex });\n } else {\n // Move focus to the previous input if the current input is empty\n // and clear the value at the new active (previous) index\n focusOnOtpByIndex(--currentOtpIndex);\n handleOnChange({ value: '', currentOtpIndex });\n }\n } else if (key === 'ArrowLeft' || code === 'ArrowLeft') {\n event.preventDefault?.();\n focusOnOtpByIndex(--currentOtpIndex);\n } else if (key === 'ArrowRight' || code === 'ArrowRight') {\n event.preventDefault?.();\n focusOnOtpByIndex(++currentOtpIndex);\n } else if (key === ' ' || code === 'Space') {\n event.preventDefault?.();\n }\n };\n\n const getHiddenInput = (): React.ReactNode => {\n if (!isReactNative) {\n return (\n <input\n hidden={true}\n id={inputId}\n name={name}\n value={inputValue ?? otpValue.join('') ?? ''}\n readOnly\n />\n );\n }\n return null;\n };\n\n const getOTPInputFields = (): React.ReactNode => {\n const inputs = [];\n for (let index = 0; index < otpLength; index++) {\n const currentValue = inputValue ? otpToArray(inputValue)[index] || '' : otpValue[index] || '';\n const ref = React.createRef<HTMLInputElement>();\n // if an inputValue is passed (controlled) and isMasked is set, inputType will always be password\n let currentInputType: 'password' | undefined;\n if (isMasked) {\n // if inputValue is passed (controlled component) then the inputType will always be password\n currentInputType = inputValue ? 'password' : inputType[index];\n }\n inputRefs.push(ref);\n inputs.push(\n <BaseBox\n flex={1}\n marginLeft={index == 0 ? 'spacing.0' : 'spacing.3'}\n key={`${inputId}-${index}`}\n >\n <BaseInput\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus={autoFocus && index === 0}\n accessibilityLabel={`${index === 0 ? label || accessibilityLabel : ''} character ${\n index + 1\n }`}\n label={label}\n hideLabelText={true}\n id={`${inputId}-${index}`}\n textAlign=\"center\"\n ref={ref as never}\n name={name}\n value={currentValue}\n maxCharacters={otpValue[index]?.length > 0 ? 1 : undefined}\n onChange={(formEvent) => handleOnChange({ ...formEvent, currentOtpIndex: index })}\n onFocus={(formEvent) => onFocus?.({ ...formEvent, inputIndex: index })}\n onBlur={(formEvent) => onBlur?.({ ...formEvent, inputIndex: index })}\n onInput={(formEvent) => handleOnInput({ ...formEvent, currentOtpIndex: index })}\n onKeyDown={(keyboardEvent) =>\n handleOnKeyDown({ ...keyboardEvent, currentOtpIndex: index })\n }\n isDisabled={isDisabled}\n placeholder={Array.from(placeholder ?? '')[index] ?? ''}\n isRequired={true}\n autoCompleteSuggestionType={autoCompleteSuggestionType}\n keyboardType={keyboardType}\n keyboardReturnKeyType={keyboardReturnKeyType}\n validationState={validationState}\n successText={successText}\n errorText={errorText}\n helpText={helpText}\n hideFormHint={true}\n type={currentInputType}\n size={size}\n valueComponentType=\"heading\"\n {...makeAnalyticsAttribute(rest)}\n />\n </BaseBox>,\n );\n }\n return inputs;\n };\n\n return (\n <BaseBox {...metaAttribute({ name: MetaConstants.OTPInput, testID })} {...getStyledProps(rest)}>\n <BaseBox\n display=\"flex\"\n flexDirection={isLabelLeftPositioned ? 'row' : 'column'}\n alignItems={isLabelLeftPositioned ? 'center' : undefined}\n position=\"relative\"\n >\n {Boolean(label) && (\n <FormLabel\n as=\"label\"\n position={labelPosition}\n htmlFor={inputId}\n size={size}\n labelSuffix={labelSuffix}\n labelTrailing={labelTrailing}\n >\n {label}\n </FormLabel>\n )}\n <BaseBox display=\"flex\" flexDirection=\"row\">\n {getHiddenInput()}\n {getOTPInputFields()}\n </BaseBox>\n </BaseBox>\n {/* the magic number 136 is basically max-width of label i.e 120 and then right margin i.e 16 which is the spacing between label and input field */}\n {/*Refer `BaseInput`'s implementation of FormHint which uses similar logic */}\n <BaseBox marginLeft={makeSize(isLabelLeftPositioned ? 136 : 0)}>\n <FormHint\n type={getHintType({ validationState, hasHelpText: Boolean(helpText) })}\n helpText={helpText}\n errorText={errorText}\n successText={successText}\n helpTextId={helpTextId}\n errorTextId={errorTextId}\n successTextId={successTextId}\n size={size}\n />\n </BaseBox>\n </BaseBox>\n );\n};\n\nconst OTPInput = React.forwardRef<HTMLInputElement[], OTPInputProps>(_OTPInput);\n\nexport type { OTPInputProps };\nexport { OTPInput };\n"],"names":["isReactNative","getPlatformType","otpToArray","code","_code$split","split","Array","fill","_OTPInput","_ref","incomingRef","autoFocus","errorText","helpText","isDisabled","keyboardReturnKeyType","_ref$keyboardType","keyboardType","label","accessibilityLabel","labelPosition","labelSuffix","labelTrailing","name","onChange","onFocus","onBlur","onOTPFilled","_ref$otpLength","otpLength","placeholder","successText","validationState","inputValue","value","isMasked","_ref$autoCompleteSugg","autoCompleteSuggestionType","testID","_ref$size","size","rest","_objectWithoutProperties","_excluded","inputRefs","_useState","useState","_useState2","_slicedToArray","otpValue","setOtpValue","_useState3","_useState4","inputType","setInputType","isLabelLeftPositioned","_useFormId","useFormId","inputId","helpTextId","errorTextId","successTextId","useImperativeHandle","map","ref","current","useEffect","length","slice","join","forEach","otp","index","isEmpty","newInputType","from","undefined","setOtpValueByIndex","_ref2","newOtpValue","focusOnOtpByIndex","_inputRefs$index","_inputRefs$index$curr","focus","_inputRefs$index2","_inputRefs$index2$cur","select","handleOnChange","_ref3","currentOtpIndex","trim","_value$trim","newValue","handleOnInput","_ref4","handleOnKeyDown","_ref5","key","event","_event$preventDefault","preventDefault","call","_event$preventDefault2","_event$preventDefault3","_event$preventDefault4","getHiddenInput","_ref6","_jsx","hidden","id","readOnly","getOTPInputFields","inputs","_loop","_otpValue$index","_Array$from$index","currentValue","React","createRef","currentInputType","push","BaseBox","flex","marginLeft","children","BaseInput","_objectSpread","concat","hideLabelText","textAlign","maxCharacters","formEvent","inputIndex","onInput","onKeyDown","keyboardEvent","isRequired","hideFormHint","type","valueComponentType","makeAnalyticsAttribute","_jsxs","metaAttribute","MetaConstants","OTPInput","getStyledProps","display","flexDirection","alignItems","position","Boolean","FormLabel","as","htmlFor","makeSize","FormHint","getHintType","hasHelpText","forwardRef"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyHA,IAAMA,aAAa,GAAGC,eAAe,EAAE,KAAK,cAAc,CAAA;;AAE1D;AACA;AACA;AACA,IAAMC,UAAU,GAAG,SAAbA,UAAUA,CAAIC,IAAa,EAAA;AAAA,EAAA,IAAAC,WAAA,CAAA;EAAA,OAAAA,CAAAA,WAAA,GAAeD,IAAI,KAAJA,IAAAA,IAAAA,IAAI,uBAAJA,IAAI,CAAEE,KAAK,CAAC,EAAE,CAAC,cAAAD,WAAA,KAAA,KAAA,CAAA,GAAAA,WAAA,GAAIE,KAAK,CAAC,CAAC,CAAC,CAACC,IAAI,CAAC,EAAE,CAAC,CAAA;AAAA,CAAA,CAAA;;AAEpF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAMC,SAA4E,GAAG,SAA/EA,SAA4EA,CAAAC,IAAA,EA6BhFC,WAAW,EACR;AAAA,EAAA,IA5BDC,SAAS,GAAAF,IAAA,CAATE,SAAS;IACTC,SAAS,GAAAH,IAAA,CAATG,SAAS;IACTC,QAAQ,GAAAJ,IAAA,CAARI,QAAQ;IACRC,UAAU,GAAAL,IAAA,CAAVK,UAAU;IACVC,qBAAqB,GAAAN,IAAA,CAArBM,qBAAqB;IAAAC,iBAAA,GAAAP,IAAA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C,MAAM;AAACC,QAAAA,aAAa,EAAC,KAAK;AAAAvB,QAAAA,QAAA,GACxCnB,cAAc,EAAE,EAChBM,iBAAiB,EAAE,CAAA;AAAA,OACb,CAAC,CAAA;AAAA,KACH,CAAC,eAGVJ,GAAA,CAACc,OAAO,EAAA;MAACE,UAAU,EAAE+B,QAAQ,CAACnG,qBAAqB,GAAG,GAAG,GAAG,CAAC,CAAE;MAAAqE,QAAA,eAC7DjB,GAAA,CAACgD,QAAQ,EAAA;QACPjB,IAAI,EAAEkB,WAAW,CAAC;AAAE5H,UAAAA,eAAe,EAAfA,eAAe;UAAE6H,WAAW,EAAEP,OAAO,CAACzI,QAAQ,CAAA;AAAE,SAAC,CAAE;AACvEA,QAAAA,QAAQ,EAAEA,QAAS;AACnBD,QAAAA,SAAS,EAAEA,SAAU;AACrBmB,QAAAA,WAAW,EAAEA,WAAY;AACzB4B,QAAAA,UAAU,EAAEA,UAAW;AACvBC,QAAAA,WAAW,EAAEA,WAAY;AACzBC,QAAAA,aAAa,EAAEA,aAAc;AAC7BrB,QAAAA,IAAI,EAAEA,IAAAA;OACP,CAAA;AAAC,KACK,CAAC,CAAA;AAAA,GAAA,CACH,CAAC,CAAA;AAEd,CAAC,CAAA;AAED,IAAMwG,QAAQ,gBAAG3B,cAAK,CAACyC,UAAU,CAAoCtJ,SAAS;;;;"}
|
|
1
|
+
{"version":3,"file":"OTPInput.js","sources":["../../../../../../../src/components/Input/OTPInput/OTPInput.tsx"],"sourcesContent":["import React, { useEffect, useImperativeHandle, useState } from 'react';\nimport type { BaseInputProps } from '../BaseInput';\nimport { BaseInput } from '../BaseInput';\nimport { getHintType } from '../BaseInput/BaseInput';\nimport isEmpty from '~utils/lodashButBetter/isEmpty';\nimport type { FormInputOnEvent } from '~components/Form';\nimport { FormHint, FormLabel } from '~components/Form';\nimport { useFormId } from '~components/Form/useFormId';\nimport type { FormInputOnKeyDownEvent } from '~components/Form/FormTypes';\nimport BaseBox from '~components/Box/BaseBox';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport { getPlatformType } from '~utils';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { makeSize } from '~utils/makeSize';\nimport type { DataAnalyticsAttribute } from '~utils/types';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\n\ntype FormInputOnEventWithIndex = ({\n name,\n value,\n inputIndex,\n}: {\n name?: string;\n value?: string;\n inputIndex: number;\n}) => void;\n\nexport type OTPInputCommonProps = Pick<\n BaseInputProps,\n | 'label'\n | 'accessibilityLabel'\n | 'labelPosition'\n | 'labelSuffix'\n | 'labelTrailing'\n | 'validationState'\n | 'helpText'\n | 'errorText'\n | 'successText'\n | 'name'\n | 'onChange'\n | 'value'\n | 'isDisabled'\n | 'autoFocus'\n | 'keyboardReturnKeyType'\n | 'keyboardType'\n | 'placeholder'\n | 'testID'\n | 'size'\n | keyof DataAnalyticsAttribute\n> & {\n /**\n * Determines the number of input fields to show for the OTP\n * @default 6\n */\n otpLength?: 4 | 6;\n /**\n * The callback function to be invoked when all the values of the OTPInput are filled\n */\n onOTPFilled?: FormInputOnEvent;\n /**\n * Masks input characters in all the fields\n */\n isMasked?: boolean;\n /**\n * Determines what autoComplete suggestion type to show. Defaults to `oneTimeCode`.\n *\n * It's not recommended to turn this off in favor of otp input practices.\n *\n *\n * Internally it'll render platform specific attributes:\n *\n * - web: `autocomplete`\n * - iOS: `textContentType`\n * - android: `autoComplete`\n *\n */\n autoCompleteSuggestionType?: Extract<\n BaseInputProps['autoCompleteSuggestionType'],\n 'none' | 'oneTimeCode'\n >;\n /**\n * The callback function to be invoked when one of the input fields gets focus\n */\n onFocus?: FormInputOnEventWithIndex;\n /**\n * The callback function to be invoked when one of the input fields is blurred\n */\n onBlur?: FormInputOnEventWithIndex;\n} & StyledPropsBlade;\n\n/*\n Mandatory accessibilityLabel prop when label is not provided\n*/\ntype OTPInputPropsWithA11yLabel = {\n /**\n * Label to be shown for the input field\n */\n label?: undefined;\n /**\n * Accessibility label for the input\n */\n accessibilityLabel: string;\n};\n\n/*\n Optional accessibilityLabel prop when label is provided\n*/\ntype OTPInputPropsWithLabel = {\n /**\n * Label to be shown for the input field\n */\n label: string;\n /**\n * Accessibility label for the input\n */\n accessibilityLabel?: string;\n};\n\ntype OTPInputProps = (OTPInputPropsWithA11yLabel | OTPInputPropsWithLabel) & OTPInputCommonProps;\n\nconst isReactNative = getPlatformType() === 'react-native';\n\n/**\n * Converts a string value of otp to array if passed otherwise returns an array of 6 empty strings\n */\nconst otpToArray = (code?: string): string[] => code?.split('') ?? Array(6).fill('');\n\n/**\n * OTPInput component can be used for accepting OTPs sent to users for authentication/verification purposes.\n *\n * ## Usage\n *\n * ```tsx\n * <OTPInput\n * label=\"Enter OTP\"\n * name=\"otpInput\"\n * onChange={({ name, value }): void => console.log({ name, value })}\n * onOTPFilled={({ name, value }): void => console.log({ name, value })}\n * />\n * ```\n */\nconst _OTPInput: React.ForwardRefRenderFunction<HTMLInputElement[], OTPInputProps> = (\n {\n autoFocus,\n errorText,\n helpText,\n isDisabled,\n keyboardReturnKeyType,\n keyboardType = 'decimal',\n label,\n accessibilityLabel,\n labelPosition,\n labelSuffix,\n labelTrailing,\n name,\n onChange,\n onFocus,\n onBlur,\n onOTPFilled,\n otpLength = 6,\n placeholder,\n successText,\n validationState,\n value: inputValue,\n isMasked,\n autoCompleteSuggestionType = 'oneTimeCode',\n testID,\n size = 'medium',\n ...rest\n },\n incomingRef,\n) => {\n const inputRefs: React.RefObject<HTMLInputElement>[] = [];\n const [otpValue, setOtpValue] = useState<string[]>(otpToArray(inputValue));\n const [inputType, setInputType] = useState<('password' | undefined)[]>([]);\n const isLabelLeftPositioned = labelPosition === 'left';\n const { inputId, helpTextId, errorTextId, successTextId } = useFormId('otp');\n\n useImperativeHandle(\n incomingRef,\n () => {\n return inputRefs.map((ref) => ref.current!);\n },\n [inputRefs],\n );\n\n useEffect(() => {\n // Effect for calling `onOTPFilled` callback\n if (inputValue && inputValue.length >= otpLength) {\n // callback for when the OTPInput is controlled and inputValue reaches the same or greater length as the otpLength\n onOTPFilled?.({ value: inputValue.slice(0, otpLength), name });\n } else if (!inputValue && otpValue.join('').length >= otpLength) {\n // callback for when the OTPInput is uncontrolled and otpValue stored in state reaches the same or greater length as the otpLength\n onOTPFilled?.({ value: otpValue.slice(0, otpLength).join(''), name });\n }\n }, [otpValue, otpLength, name, inputValue, onOTPFilled]);\n\n useEffect(() => {\n /* We want to disable the password managers for OTPInput when isMasked is set.\n The issue with only setting autocomplete='off' is that its not an enforcement but a suggestion to the browser to follow.\n This workaround unsets type on first render and sets it to `password` only once a value is entered by the user.\n */\n otpValue.forEach((otp, index) => {\n // Set inputType as 'password' only when a value is entered when isMasked is set\n if (!isEmpty(otp) && !inputType[index] && isMasked) {\n const newInputType = Array.from(inputType);\n newInputType[index] = 'password';\n setInputType(newInputType);\n }\n // Cleanup the inputType array whenever the value is empty but inputType[index] is set\n if (isEmpty(otp) && inputType[index]) {\n const newInputType = Array.from(inputType);\n newInputType[index] = undefined;\n setInputType(newInputType);\n }\n });\n }, [otpValue, inputType, isMasked]);\n\n /**\n * Changes the value of the otp at a given index and updates the otpValue stored in state\n *\n * @param {{ value: string; index: number }} { value, index }\n * @returns {string} updated otpValue\n */\n const setOtpValueByIndex = ({ value, index }: { value: string; index: number }): string => {\n const newOtpValue = Array.from(otpValue);\n newOtpValue[index] = value;\n setOtpValue(newOtpValue);\n return newOtpValue.join('');\n };\n\n /**\n * Sets focus to the desired otp input by index\n *\n * @param {number} index the index of the otp input to be focused\n */\n const focusOnOtpByIndex = (index: number): void => {\n inputRefs[index]?.current?.focus();\n if (!isReactNative) {\n // React Native doesn't support imperatively selecting the value of input\n inputRefs[index]?.current?.select();\n }\n };\n\n const handleOnChange = ({\n value,\n currentOtpIndex,\n }: {\n value?: string;\n currentOtpIndex: number;\n }): void => {\n if (value && value === ' ') {\n // React native doesn't support `event.preventDefault()` hence have to add this check to ensure that empty space is not allowed\n return;\n }\n if (inputValue && inputValue.length > 0) {\n // When OTPInput is controlled, set the otpValue as the consumer passed `inputValue` and append the value on current index based on user's input.\n // User's input will not reflect on the otp but will trigger `onChange` callback with the user's input appended so that the consumer can take appropriate action.\n const newOtpValue = Array.from(inputValue);\n newOtpValue[currentOtpIndex] = value ?? '';\n setOtpValue(newOtpValue);\n onChange?.({ name, value: newOtpValue.join('') });\n } else if (value && value.trim().length > 1) {\n // When the entered value is more that 1 character (when value is pasted), set the otpValue to the newly received value.\n // Could have used `onPaste` for web to achieve this but 1. React Native doesn't support onPaste and 2. Safari's autofill on web doesn't trigger onPaste\n setOtpValue(Array.from(value));\n onChange?.({ name, value: value.trim().slice(0, otpLength) });\n } else if (otpValue[currentOtpIndex] !== value?.trim()) {\n // Set the value at the current index to the entered value\n // only as long as its not the same as the already existing value (this prevents `onChange` being triggered unnecessarily)\n const newValue = setOtpValueByIndex({\n value: value?.trim() ?? '',\n index: currentOtpIndex,\n });\n onChange?.({ name, value: newValue });\n }\n };\n\n const handleOnInput = ({\n value,\n currentOtpIndex,\n }: {\n value?: string;\n currentOtpIndex: number;\n }): void => {\n // Moves focus to next input whenever a value is entered in the current input\n if (value && value.trim().length === 1) {\n focusOnOtpByIndex(++currentOtpIndex);\n }\n };\n\n const handleOnKeyDown = ({\n key,\n code,\n event,\n currentOtpIndex,\n }: FormInputOnKeyDownEvent & { currentOtpIndex: number }): void => {\n if (key === 'Backspace' || code === 'Backspace' || code === 'Delete' || key === 'Delete') {\n event.preventDefault?.();\n if (otpValue[currentOtpIndex]) {\n // Clear the value at the current index if value exists\n handleOnChange({ value: '', currentOtpIndex });\n } else {\n // Move focus to the previous input if the current input is empty\n // and clear the value at the new active (previous) index\n focusOnOtpByIndex(--currentOtpIndex);\n handleOnChange({ value: '', currentOtpIndex });\n }\n } else if (key === 'ArrowLeft' || code === 'ArrowLeft') {\n event.preventDefault?.();\n focusOnOtpByIndex(--currentOtpIndex);\n } else if (key === 'ArrowRight' || code === 'ArrowRight') {\n event.preventDefault?.();\n focusOnOtpByIndex(++currentOtpIndex);\n } else if (key === ' ' || code === 'Space') {\n event.preventDefault?.();\n }\n };\n\n const getHiddenInput = (): React.ReactNode => {\n if (!isReactNative) {\n return (\n <input\n hidden={true}\n id={inputId}\n name={name}\n value={inputValue ?? otpValue.join('') ?? ''}\n readOnly\n />\n );\n }\n return null;\n };\n\n const getOTPInputFields = (): React.ReactNode => {\n const inputs = [];\n for (let index = 0; index < otpLength; index++) {\n const currentValue = inputValue ? otpToArray(inputValue)[index] || '' : otpValue[index] || '';\n const ref = React.createRef<HTMLInputElement>();\n // if an inputValue is passed (controlled) and isMasked is set, inputType will always be password\n let currentInputType: 'password' | undefined;\n if (isMasked) {\n // if inputValue is passed (controlled component) then the inputType will always be password\n currentInputType = inputValue ? 'password' : inputType[index];\n }\n inputRefs.push(ref);\n inputs.push(\n <BaseBox\n flex={1}\n marginLeft={index == 0 ? 'spacing.0' : 'spacing.3'}\n key={`${inputId}-${index}`}\n >\n <BaseInput\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus={autoFocus && index === 0}\n accessibilityLabel={`${index === 0 ? label || accessibilityLabel : ''} character ${\n index + 1\n }`}\n label={label}\n hideLabelText={true}\n id={`${inputId}-${index}`}\n textAlign=\"center\"\n ref={ref as never}\n name={name}\n value={currentValue}\n maxCharacters={otpValue[index]?.length > 0 ? 1 : undefined}\n onChange={(formEvent) => handleOnChange({ ...formEvent, currentOtpIndex: index })}\n onFocus={(formEvent) => onFocus?.({ ...formEvent, inputIndex: index })}\n onBlur={(formEvent) => onBlur?.({ ...formEvent, inputIndex: index })}\n onInput={(formEvent) => handleOnInput({ ...formEvent, currentOtpIndex: index })}\n onKeyDown={(keyboardEvent) =>\n handleOnKeyDown({ ...keyboardEvent, currentOtpIndex: index })\n }\n isDisabled={isDisabled}\n placeholder={Array.from(placeholder ?? '')[index] ?? ''}\n isRequired={true}\n autoCompleteSuggestionType={autoCompleteSuggestionType}\n keyboardType={keyboardType}\n keyboardReturnKeyType={keyboardReturnKeyType}\n validationState={validationState}\n successText={successText}\n errorText={errorText}\n helpText={helpText}\n hideFormHint={true}\n type={currentInputType}\n size={size}\n valueComponentType=\"heading\"\n {...makeAnalyticsAttribute(rest)}\n />\n </BaseBox>,\n );\n }\n return inputs;\n };\n\n return (\n <BaseBox {...metaAttribute({ name: MetaConstants.OTPInput, testID })} {...getStyledProps(rest)}>\n <BaseBox\n display=\"flex\"\n flexDirection={isLabelLeftPositioned ? 'row' : 'column'}\n alignItems={isLabelLeftPositioned ? 'center' : undefined}\n position=\"relative\"\n >\n {Boolean(label) && (\n <FormLabel\n as=\"label\"\n position={labelPosition}\n htmlFor={inputId}\n size={size}\n labelSuffix={labelSuffix}\n labelTrailing={labelTrailing}\n >\n {label}\n </FormLabel>\n )}\n <BaseBox display=\"flex\" flexDirection=\"row\">\n {getHiddenInput()}\n {getOTPInputFields()}\n </BaseBox>\n </BaseBox>\n {/* the magic number 136 is basically max-width of label i.e 120 and then right margin i.e 16 which is the spacing between label and input field */}\n {/*Refer `BaseInput`'s implementation of FormHint which uses similar logic */}\n <BaseBox marginLeft={makeSize(isLabelLeftPositioned ? 136 : 0)}>\n <FormHint\n type={getHintType({ validationState, hasHelpText: Boolean(helpText) })}\n helpText={helpText}\n errorText={errorText}\n successText={successText}\n helpTextId={helpTextId}\n errorTextId={errorTextId}\n successTextId={successTextId}\n size={size}\n />\n </BaseBox>\n </BaseBox>\n );\n};\n\nconst OTPInput = React.forwardRef<HTMLInputElement[], OTPInputProps>(_OTPInput);\n\nexport type { OTPInputProps };\nexport { OTPInput };\n"],"names":["isReactNative","getPlatformType","otpToArray","code","_code$split","split","Array","fill","_OTPInput","_ref","incomingRef","autoFocus","errorText","helpText","isDisabled","keyboardReturnKeyType","_ref$keyboardType","keyboardType","label","accessibilityLabel","labelPosition","labelSuffix","labelTrailing","name","onChange","onFocus","onBlur","onOTPFilled","_ref$otpLength","otpLength","placeholder","successText","validationState","inputValue","value","isMasked","_ref$autoCompleteSugg","autoCompleteSuggestionType","testID","_ref$size","size","rest","_objectWithoutProperties","_excluded","inputRefs","_useState","useState","_useState2","_slicedToArray","otpValue","setOtpValue","_useState3","_useState4","inputType","setInputType","isLabelLeftPositioned","_useFormId","useFormId","inputId","helpTextId","errorTextId","successTextId","useImperativeHandle","map","ref","current","useEffect","length","slice","join","forEach","otp","index","isEmpty","newInputType","from","undefined","setOtpValueByIndex","_ref2","newOtpValue","focusOnOtpByIndex","_inputRefs$index","focus","_inputRefs$index2","select","handleOnChange","_ref3","currentOtpIndex","trim","_value$trim","newValue","handleOnInput","_ref4","handleOnKeyDown","_ref5","key","event","_event$preventDefault","preventDefault","call","_event$preventDefault2","_event$preventDefault3","_event$preventDefault4","getHiddenInput","_ref6","_jsx","hidden","id","readOnly","getOTPInputFields","inputs","_loop","_otpValue$index","_Array$from$index","currentValue","React","createRef","currentInputType","push","BaseBox","flex","marginLeft","children","BaseInput","_objectSpread","concat","hideLabelText","textAlign","maxCharacters","formEvent","inputIndex","onInput","onKeyDown","keyboardEvent","isRequired","hideFormHint","type","valueComponentType","makeAnalyticsAttribute","_jsxs","metaAttribute","MetaConstants","OTPInput","getStyledProps","display","flexDirection","alignItems","position","Boolean","FormLabel","as","htmlFor","makeSize","FormHint","getHintType","hasHelpText","forwardRef"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyHA,IAAMA,aAAa,GAAGC,eAAe,EAAE,KAAK,cAAc,CAAA;;AAE1D;AACA;AACA;AACA,IAAMC,UAAU,GAAG,SAAbA,UAAUA,CAAIC,IAAa,EAAA;AAAA,EAAA,IAAAC,WAAA,CAAA;EAAA,OAAAA,CAAAA,WAAA,GAAeD,IAAI,KAAJA,IAAAA,IAAAA,IAAI,uBAAJA,IAAI,CAAEE,KAAK,CAAC,EAAE,CAAC,cAAAD,WAAA,KAAA,KAAA,CAAA,GAAAA,WAAA,GAAIE,KAAK,CAAC,CAAC,CAAC,CAAC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AE7F,OAAQ;AACjBlB,QAAAA,IAAI,EAAEA,IAAK;AACXnB,QAAAA,WAAW,EAAEA,WAAY;AACzBC,QAAAA,aAAa,EAAEA,aAAc;AAAAoG,QAAAA,QAAA,EAE5BxG,KAAAA;AAAK,OACG,CACZ,eACDyH,IAAA,CAACpB,OAAO,EAAA;AAACyB,QAAAA,OAAO,EAAC,MAAM;AAACC,QAAAA,aAAa,EAAC,KAAK;AAAAvB,QAAAA,QAAA,GACxCnB,cAAc,EAAE,EAChBM,iBAAiB,EAAE,CAAA;AAAA,OACb,CAAC,CAAA;AAAA,KACH,CAAC,eAGVJ,GAAA,CAACc,OAAO,EAAA;MAACE,UAAU,EAAE+B,QAAQ,CAACjG,qBAAqB,GAAG,GAAG,GAAG,CAAC,CAAE;MAAAmE,QAAA,eAC7DjB,GAAA,CAACgD,QAAQ,EAAA;QACPjB,IAAI,EAAEkB,WAAW,CAAC;AAAE1H,UAAAA,eAAe,EAAfA,eAAe;UAAE2H,WAAW,EAAEP,OAAO,CAACvI,QAAQ,CAAA;AAAE,SAAC,CAAE;AACvEA,QAAAA,QAAQ,EAAEA,QAAS;AACnBD,QAAAA,SAAS,EAAEA,SAAU;AACrBmB,QAAAA,WAAW,EAAEA,WAAY;AACzB4B,QAAAA,UAAU,EAAEA,UAAW;AACvBC,QAAAA,WAAW,EAAEA,WAAY;AACzBC,QAAAA,aAAa,EAAEA,aAAc;AAC7BrB,QAAAA,IAAI,EAAEA,IAAAA;OACP,CAAA;AAAC,KACK,CAAC,CAAA;AAAA,GAAA,CACH,CAAC,CAAA;AAEd,CAAC,CAAA;AAED,IAAMsG,QAAQ,gBAAG3B,cAAK,CAACyC,UAAU,CAAoCpJ,SAAS;;;;"}
|
|
@@ -133,7 +133,7 @@ var _PasswordInput = function _PasswordInput(_ref, ref) {
|
|
|
133
133
|
};
|
|
134
134
|
|
|
135
135
|
// nosemgrep
|
|
136
|
-
var PasswordInput = /*#__PURE__*/assignWithoutSideEffects(
|
|
136
|
+
var PasswordInput = /*#__PURE__*/assignWithoutSideEffects(/*#__PURE__*/React__default.forwardRef(_PasswordInput), {
|
|
137
137
|
displayName: 'PasswordInput'
|
|
138
138
|
});
|
|
139
139
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PasswordInput.js","sources":["../../../../../../../src/components/Input/PasswordInput/PasswordInput.tsx"],"sourcesContent":["import React from 'react';\nimport type { BaseInputProps } from '../BaseInput';\nimport { BaseInput } from '../BaseInput';\nimport { EyeIcon, EyeOffIcon } from '~components/Icons';\nimport BaseBox from '~components/Box/BaseBox';\nimport { CharacterCounter } from '~components/Form/CharacterCounter';\nimport { IconButton } from '~components/Button/IconButton';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { MetaConstants } from '~utils/metaAttribute';\nimport type { DataAnalyticsAttribute, BladeElementRef } from '~utils/types';\n\ntype PasswordInputExtraProps = {\n /**\n * Shows a reveal button to toggle password visibility\n *\n * @default true\n */\n showRevealButton?: boolean;\n\n /**\n * Displays asterisk (`*`) when `isRequired` is enabled\n *\n * @default none\n */\n necessityIndicator?: Exclude<BaseInputProps['necessityIndicator'], 'optional'>;\n\n /**\n * Determines what autoComplete suggestion type to show. Defaults to using platform heuristics.\n *\n * It's not recommended to turn this off in favor of safe password practices.\n * Providing `password` or `newPassword` is more informative to the platform for browser autofill or password managers.\n *\n * **Note**: Using `newPassword` on iOS has some [known issue](https://github.com/facebook/react-native/issues/21911) on React Native\n *\n * Internally it'll render platform specific attributes:\n *\n * - web: `autocomplete`\n * - iOS: `textContentType`\n * - android: `autoComplete`\n *\n */\n autoCompleteSuggestionType?: Extract<\n BaseInputProps['autoCompleteSuggestionType'],\n 'none' | 'password' | 'newPassword'\n >;\n};\n\ntype PasswordInputCommonProps = Pick<\n BaseInputProps,\n | 'label'\n | 'accessibilityLabel'\n | 'labelPosition'\n | 'labelSuffix'\n | 'labelTrailing'\n | 'maxCharacters'\n | 'validationState'\n | 'errorText'\n | 'successText'\n | 'helpText'\n | 'isDisabled'\n | 'defaultValue'\n | 'placeholder'\n | 'isRequired'\n | 'value'\n | 'onChange'\n | 'onBlur'\n | 'onSubmit'\n | 'onFocus'\n | 'name'\n | 'autoFocus'\n | 'keyboardReturnKeyType'\n | 'autoCompleteSuggestionType'\n | 'testID'\n | 'size'\n | keyof DataAnalyticsAttribute\n> &\n PasswordInputExtraProps &\n StyledPropsBlade;\n\n/*\n Mandatory accessibilityLabel prop when label is not provided\n*/\ntype PasswordInputPropsWithA11yLabel = {\n /**\n * Label to be shown for the input field\n */\n label?: undefined;\n /**\n * Accessibility label for the input\n */\n accessibilityLabel: string;\n};\n\n/*\n Optional accessibilityLabel prop when label is provided\n*/\ntype PasswordInputPropsWithLabel = {\n /**\n * Label to be shown for the input field\n */\n label: string;\n /**\n * Accessibility label for the input\n */\n accessibilityLabel?: string;\n};\n\ntype PasswordInputProps = (PasswordInputPropsWithA11yLabel | PasswordInputPropsWithLabel) &\n PasswordInputCommonProps;\n\nconst _PasswordInput: React.ForwardRefRenderFunction<BladeElementRef, PasswordInputProps> = (\n {\n label,\n accessibilityLabel,\n labelPosition = 'top',\n showRevealButton = true,\n maxCharacters,\n validationState,\n errorText,\n successText,\n helpText,\n isDisabled = false,\n defaultValue,\n placeholder,\n isRequired = false,\n necessityIndicator = 'none',\n value,\n onChange,\n onFocus,\n onBlur,\n onSubmit,\n name,\n autoFocus = false,\n keyboardReturnKeyType = 'done',\n autoCompleteSuggestionType,\n testID,\n size = 'medium',\n labelSuffix,\n labelTrailing,\n ...rest\n },\n ref,\n) => {\n const [isRevealed, setIsRevealed] = React.useState(false);\n const isEnabled = !isDisabled;\n\n // If input is disabled reveal button shouldn't be present and input should be masked\n const isRevealedAndEnabled = isRevealed && isEnabled;\n\n const toggleIsRevealed = (): void => setIsRevealed((revealed) => !revealed);\n const iconAccessibilityLabel = isRevealedAndEnabled ? 'Hide password' : 'Show password';\n const type = isRevealedAndEnabled ? 'text' : 'password';\n\n const revealButtonIcon = isRevealedAndEnabled ? EyeOffIcon : EyeIcon;\n const revealButton =\n showRevealButton && !isDisabled ? (\n <IconButton\n size=\"medium\"\n icon={revealButtonIcon}\n onClick={toggleIsRevealed}\n accessibilityLabel={iconAccessibilityLabel}\n />\n ) : null;\n\n const trailingFooterSlot = (value?: string): React.ReactNode =>\n maxCharacters ? (\n <BaseBox marginTop=\"spacing.2\" marginRight=\"spacing.1\">\n <CharacterCounter currentCount={value?.length ?? 0} maxCount={maxCharacters} />\n </BaseBox>\n ) : null;\n\n return (\n <BaseInput\n ref={ref}\n componentName={MetaConstants.PasswordInput}\n id=\"password-field\"\n label={label as string}\n accessibilityLabel={accessibilityLabel}\n hideLabelText={!Boolean(label)}\n labelPosition={labelPosition}\n type={type}\n labelSuffix={labelSuffix}\n labelTrailing={labelTrailing}\n trailingInteractionElement={revealButton}\n trailingFooterSlot={trailingFooterSlot}\n maxCharacters={maxCharacters}\n validationState={validationState}\n errorText={errorText}\n successText={successText}\n helpText={helpText}\n isDisabled={isDisabled}\n defaultValue={defaultValue}\n placeholder={placeholder}\n isRequired={isRequired}\n necessityIndicator={necessityIndicator}\n value={value}\n onChange={onChange}\n onBlur={onBlur}\n onSubmit={onSubmit}\n onFocus={onFocus}\n name={name}\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus={autoFocus}\n autoCompleteSuggestionType={autoCompleteSuggestionType}\n keyboardReturnKeyType={keyboardReturnKeyType}\n autoCapitalize=\"none\"\n testID={testID}\n size={size}\n {...rest}\n />\n );\n};\n\n// nosemgrep\nconst PasswordInput = assignWithoutSideEffects(React.forwardRef(_PasswordInput), {\n displayName: 'PasswordInput',\n});\n\nexport type { PasswordInputProps };\nexport { PasswordInput };\n"],"names":["_PasswordInput","_ref","ref","label","accessibilityLabel","_ref$labelPosition","labelPosition","_ref$showRevealButton","showRevealButton","maxCharacters","validationState","errorText","successText","helpText","_ref$isDisabled","isDisabled","defaultValue","placeholder","_ref$isRequired","isRequired","_ref$necessityIndicat","necessityIndicator","value","onChange","onFocus","onBlur","onSubmit","name","_ref$autoFocus","autoFocus","_ref$keyboardReturnKe","keyboardReturnKeyType","autoCompleteSuggestionType","testID","_ref$size","size","labelSuffix","labelTrailing","rest","_objectWithoutProperties","_excluded","_React$useState","React","useState","_React$useState2","_slicedToArray","isRevealed","setIsRevealed","isEnabled","isRevealedAndEnabled","toggleIsRevealed","revealed","iconAccessibilityLabel","type","revealButtonIcon","EyeOffIcon","EyeIcon","revealButton","_jsx","IconButton","icon","onClick","trailingFooterSlot","_value$length","BaseBox","marginTop","marginRight","children","CharacterCounter","currentCount","length","maxCount","BaseInput","_objectSpread","componentName","MetaConstants","PasswordInput","id","hideLabelText","Boolean","trailingInteractionElement","autoCapitalize","assignWithoutSideEffects","forwardRef","displayName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA+GA,IAAMA,cAAmF,GAAG,SAAtFA,cAAmFA,CAAAC,IAAA,EA+BvFC,GAAG,EACA;AAAA,EAAA,IA9BDC,KAAK,GAAAF,IAAA,CAALE,KAAK;IACLC,kBAAkB,GAAAH,IAAA,CAAlBG,kBAAkB;IAAAC,kBAAA,GAAAJ,IAAA,CAClBK,aAAa;AAAbA,IAAAA,aAAa,GAAAD,kBAAA,KAAG,KAAA,CAAA,GAAA,KAAK,GAAAA,kBAAA;IAAAE,qBAAA,GAAAN,IAAA,CACrBO,gBAAgB;AAAhBA,IAAAA,gBAAgB,GAAAD,qBAAA,KAAG,KAAA,CAAA,GAAA,IAAI,GAAAA,qBAAA;IACvBE,aAAa,GAAAR,IAAA,CAAbQ,aAAa;IACbC,eAAe,GAAAT,IAAA,CAAfS,eAAe;IACfC,SAAS,GAAAV,IAAA,CAATU,SAAS;IACTC,WAAW,GAAAX,IAAA,CAAXW,WAAW;IACXC,QAAQ,GAAAZ,IAAA,CAARY,QAAQ;IAAAC,eAAA,GAAAb,IAAA,CACRc,UAAU;AAAVA,IAAAA,UAAU,GA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mB;AACvCC,IAAAA,KAAK,EAAEA,KAAM;AACbC,IAAAA,QAAQ,EAAEA,QAAS;AACnBE,IAAAA,MAAM,EAAEA,MAAO;AACfC,IAAAA,QAAQ,EAAEA,QAAS;AACnBF,IAAAA,OAAO,EAAEA,OAAQ;AACjBG,IAAAA,IAAI,EAAEA,IAAAA;AACN;AAAA;AACAE,IAAAA,SAAS,EAAEA,SAAU;AACrBG,IAAAA,0BAA0B,EAAEA,0BAA2B;AACvDD,IAAAA,qBAAqB,EAAEA,qBAAsB;AAC7CkD,IAAAA,cAAc,EAAC,MAAM;AACrBhD,IAAAA,MAAM,EAAEA,MAAO;AACfE,IAAAA,IAAI,EAAEA,IAAAA;GACFG,EAAAA,IAAI,CACT,CAAC,CAAA;AAEN,CAAC,CAAA;;AAED;AACMsC,IAAAA,aAAa,gBAAGM,wBAAwB,eAACxC,cAAK,CAACyC,UAAU,CAACnF,cAAc,CAAC,EAAE;AAC/EoF,EAAAA,WAAW,EAAE,eAAA;AACf,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"PasswordInput.js","sources":["../../../../../../../src/components/Input/PasswordInput/PasswordInput.tsx"],"sourcesContent":["import React from 'react';\nimport type { BaseInputProps } from '../BaseInput';\nimport { BaseInput } from '../BaseInput';\nimport { EyeIcon, EyeOffIcon } from '~components/Icons';\nimport BaseBox from '~components/Box/BaseBox';\nimport { CharacterCounter } from '~components/Form/CharacterCounter';\nimport { IconButton } from '~components/Button/IconButton';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { MetaConstants } from '~utils/metaAttribute';\nimport type { DataAnalyticsAttribute, BladeElementRef } from '~utils/types';\n\ntype PasswordInputExtraProps = {\n /**\n * Shows a reveal button to toggle password visibility\n *\n * @default true\n */\n showRevealButton?: boolean;\n\n /**\n * Displays asterisk (`*`) when `isRequired` is enabled\n *\n * @default none\n */\n necessityIndicator?: Exclude<BaseInputProps['necessityIndicator'], 'optional'>;\n\n /**\n * Determines what autoComplete suggestion type to show. Defaults to using platform heuristics.\n *\n * It's not recommended to turn this off in favor of safe password practices.\n * Providing `password` or `newPassword` is more informative to the platform for browser autofill or password managers.\n *\n * **Note**: Using `newPassword` on iOS has some [known issue](https://github.com/facebook/react-native/issues/21911) on React Native\n *\n * Internally it'll render platform specific attributes:\n *\n * - web: `autocomplete`\n * - iOS: `textContentType`\n * - android: `autoComplete`\n *\n */\n autoCompleteSuggestionType?: Extract<\n BaseInputProps['autoCompleteSuggestionType'],\n 'none' | 'password' | 'newPassword'\n >;\n};\n\ntype PasswordInputCommonProps = Pick<\n BaseInputProps,\n | 'label'\n | 'accessibilityLabel'\n | 'labelPosition'\n | 'labelSuffix'\n | 'labelTrailing'\n | 'maxCharacters'\n | 'validationState'\n | 'errorText'\n | 'successText'\n | 'helpText'\n | 'isDisabled'\n | 'defaultValue'\n | 'placeholder'\n | 'isRequired'\n | 'value'\n | 'onChange'\n | 'onBlur'\n | 'onSubmit'\n | 'onFocus'\n | 'name'\n | 'autoFocus'\n | 'keyboardReturnKeyType'\n | 'autoCompleteSuggestionType'\n | 'testID'\n | 'size'\n | keyof DataAnalyticsAttribute\n> &\n PasswordInputExtraProps &\n StyledPropsBlade;\n\n/*\n Mandatory accessibilityLabel prop when label is not provided\n*/\ntype PasswordInputPropsWithA11yLabel = {\n /**\n * Label to be shown for the input field\n */\n label?: undefined;\n /**\n * Accessibility label for the input\n */\n accessibilityLabel: string;\n};\n\n/*\n Optional accessibilityLabel prop when label is provided\n*/\ntype PasswordInputPropsWithLabel = {\n /**\n * Label to be shown for the input field\n */\n label: string;\n /**\n * Accessibility label for the input\n */\n accessibilityLabel?: string;\n};\n\ntype PasswordInputProps = (PasswordInputPropsWithA11yLabel | PasswordInputPropsWithLabel) &\n PasswordInputCommonProps;\n\nconst _PasswordInput: React.ForwardRefRenderFunction<BladeElementRef, PasswordInputProps> = (\n {\n label,\n accessibilityLabel,\n labelPosition = 'top',\n showRevealButton = true,\n maxCharacters,\n validationState,\n errorText,\n successText,\n helpText,\n isDisabled = false,\n defaultValue,\n placeholder,\n isRequired = false,\n necessityIndicator = 'none',\n value,\n onChange,\n onFocus,\n onBlur,\n onSubmit,\n name,\n autoFocus = false,\n keyboardReturnKeyType = 'done',\n autoCompleteSuggestionType,\n testID,\n size = 'medium',\n labelSuffix,\n labelTrailing,\n ...rest\n },\n ref,\n) => {\n const [isRevealed, setIsRevealed] = React.useState(false);\n const isEnabled = !isDisabled;\n\n // If input is disabled reveal button shouldn't be present and input should be masked\n const isRevealedAndEnabled = isRevealed && isEnabled;\n\n const toggleIsRevealed = (): void => setIsRevealed((revealed) => !revealed);\n const iconAccessibilityLabel = isRevealedAndEnabled ? 'Hide password' : 'Show password';\n const type = isRevealedAndEnabled ? 'text' : 'password';\n\n const revealButtonIcon = isRevealedAndEnabled ? EyeOffIcon : EyeIcon;\n const revealButton =\n showRevealButton && !isDisabled ? (\n <IconButton\n size=\"medium\"\n icon={revealButtonIcon}\n onClick={toggleIsRevealed}\n accessibilityLabel={iconAccessibilityLabel}\n />\n ) : null;\n\n const trailingFooterSlot = (value?: string): React.ReactNode =>\n maxCharacters ? (\n <BaseBox marginTop=\"spacing.2\" marginRight=\"spacing.1\">\n <CharacterCounter currentCount={value?.length ?? 0} maxCount={maxCharacters} />\n </BaseBox>\n ) : null;\n\n return (\n <BaseInput\n ref={ref}\n componentName={MetaConstants.PasswordInput}\n id=\"password-field\"\n label={label as string}\n accessibilityLabel={accessibilityLabel}\n hideLabelText={!Boolean(label)}\n labelPosition={labelPosition}\n type={type}\n labelSuffix={labelSuffix}\n labelTrailing={labelTrailing}\n trailingInteractionElement={revealButton}\n trailingFooterSlot={trailingFooterSlot}\n maxCharacters={maxCharacters}\n validationState={validationState}\n errorText={errorText}\n successText={successText}\n helpText={helpText}\n isDisabled={isDisabled}\n defaultValue={defaultValue}\n placeholder={placeholder}\n isRequired={isRequired}\n necessityIndicator={necessityIndicator}\n value={value}\n onChange={onChange}\n onBlur={onBlur}\n onSubmit={onSubmit}\n onFocus={onFocus}\n name={name}\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus={autoFocus}\n autoCompleteSuggestionType={autoCompleteSuggestionType}\n keyboardReturnKeyType={keyboardReturnKeyType}\n autoCapitalize=\"none\"\n testID={testID}\n size={size}\n {...rest}\n />\n );\n};\n\n// nosemgrep\nconst PasswordInput = assignWithoutSideEffects(React.forwardRef(_PasswordInput), {\n displayName: 'PasswordInput',\n});\n\nexport type { PasswordInputProps };\nexport { PasswordInput };\n"],"names":["_PasswordInput","_ref","ref","label","accessibilityLabel","_ref$labelPosition","labelPosition","_ref$showRevealButton","showRevealButton","maxCharacters","validationState","errorText","successText","helpText","_ref$isDisabled","isDisabled","defaultValue","placeholder","_ref$isRequired","isRequired","_ref$necessityIndicat","necessityIndicator","value","onChange","onFocus","onBlur","onSubmit","name","_ref$autoFocus","autoFocus","_ref$keyboardReturnKe","keyboardReturnKeyType","autoCompleteSuggestionType","testID","_ref$size","size","labelSuffix","labelTrailing","rest","_objectWithoutProperties","_excluded","_React$useState","React","useState","_React$useState2","_slicedToArray","isRevealed","setIsRevealed","isEnabled","isRevealedAndEnabled","toggleIsRevealed","revealed","iconAccessibilityLabel","type","revealButtonIcon","EyeOffIcon","EyeIcon","revealButton","_jsx","IconButton","icon","onClick","trailingFooterSlot","_value$length","BaseBox","marginTop","marginRight","children","CharacterCounter","currentCount","length","maxCount","BaseInput","_objectSpread","componentName","MetaConstants","PasswordInput","id","hideLabelText","Boolean","trailingInteractionElement","autoCapitalize","assignWithoutSideEffects","forwardRef","displayName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA+GA,IAAMA,cAAmF,GAAG,SAAtFA,cAAmFA,CAAAC,IAAA,EA+BvFC,GAAG,EACA;AAAA,EAAA,IA9BDC,KAAK,GAAAF,IAAA,CAALE,KAAK;IACLC,kBAAkB,GAAAH,IAAA,CAAlBG,kBAAkB;IAAAC,kBAAA,GAAAJ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,IAAAA,WAAW,EAAEA,WAAY;AACzBC,IAAAA,aAAa,EAAEA,aAAc;AAC7B2C,IAAAA,0BAA0B,EAAEvB,YAAa;AACzCK,IAAAA,kBAAkB,EAAEA,kBAAmB;AACvCrD,IAAAA,aAAa,EAAEA,aAAc;AAC7BC,IAAAA,eAAe,EAAEA,eAAgB;AACjCC,IAAAA,SAAS,EAAEA,SAAU;AACrBC,IAAAA,WAAW,EAAEA,WAAY;AACzBC,IAAAA,QAAQ,EAAEA,QAAS;AACnBE,IAAAA,UAAU,EAAEA,UAAW;AACvBC,IAAAA,YAAY,EAAEA,YAAa;AAC3BC,IAAAA,WAAW,EAAEA,WAAY;AACzBE,IAAAA,UAAU,EAAEA,UAAW;AACvBE,IAAAA,kBAAkB,EAAEA,kBAAmB;AACvCC,IAAAA,KAAK,EAAEA,KAAM;AACbC,IAAAA,QAAQ,EAAEA,QAAS;AACnBE,IAAAA,MAAM,EAAEA,MAAO;AACfC,IAAAA,QAAQ,EAAEA,QAAS;AACnBF,IAAAA,OAAO,EAAEA,OAAQ;AACjBG,IAAAA,IAAI,EAAEA,IAAAA;AACN;AAAA;AACAE,IAAAA,SAAS,EAAEA,SAAU;AACrBG,IAAAA,0BAA0B,EAAEA,0BAA2B;AACvDD,IAAAA,qBAAqB,EAAEA,qBAAsB;AAC7CkD,IAAAA,cAAc,EAAC,MAAM;AACrBhD,IAAAA,MAAM,EAAEA,MAAO;AACfE,IAAAA,IAAI,EAAEA,IAAAA;GACFG,EAAAA,IAAI,CACT,CAAC,CAAA;AAEN,CAAC,CAAA;;AAED;AACMsC,IAAAA,aAAa,gBAAGM,wBAAwB,cAACxC,cAAK,CAACyC,UAAU,CAACnF,cAAc,CAAC,EAAE;AAC/EoF,EAAAA,WAAW,EAAE,eAAA;AACf,CAAC;;;;"}
|
package/build/lib/web/development/components/Input/PhoneNumberInput/CountrySelector.web.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CountrySelector.web.js","sources":["../../../../../../../src/components/Input/PhoneNumberInput/CountrySelector.web.tsx"],"sourcesContent":["import type { CountryCodeType, getFlagsForAllCountries } from '@razorpay/i18nify-js';\nimport { getDialCodeByCountryCode, getFlagOfCountry } from '@razorpay/i18nify-js';\nimport React from 'react';\nimport styled from 'styled-components';\nimport {\n ActionList,\n ActionListItem,\n ActionListItemAsset,\n ActionListItemText,\n} from '~components/ActionList';\nimport { BottomSheet, BottomSheetBody, BottomSheetHeader } from '~components/BottomSheet';\nimport type { DropdownOverlayProps } from '~components/Dropdown';\nimport { Dropdown, DropdownButton, DropdownOverlay } from '~components/Dropdown';\nimport { ChevronUpDownIcon } from '~components/Icons';\nimport { useIsMobile } from '~utils/useIsMobile';\nimport { size as sizes } from '~tokens/global';\nimport { makeSize } from '~utils';\nimport BaseBox from '~components/Box/BaseBox';\n\nconst countryNameFormatter = new Intl.DisplayNames(['en'], { type: 'region' });\n\ntype CountryData = {\n code: CountryCodeType;\n name: string;\n}[];\ntype CounterSelectorProps = {\n selectedCountry: CountryCodeType;\n inputWrapperRef: DropdownOverlayProps['referenceRef'];\n countryData: CountryData;\n onItemClick: (props: { name: string }) => void;\n flags: ReturnType<typeof getFlagsForAllCountries>;\n isDisabled?: boolean;\n size: 'medium' | 'large';\n};\n\nconst CountryDropdownButtonWrapper = styled(BaseBox)(() => {\n return {\n '& > button': {\n padding: '0',\n width: '100%',\n },\n };\n});\n\nconst CountrySelector = ({\n isDisabled,\n selectedCountry,\n inputWrapperRef,\n countryData,\n onItemClick,\n flags,\n size,\n}: CounterSelectorProps): React.ReactElement => {\n const [isDropdownOpen, setIsDropdownOpen] = React.useState(false);\n const isMobile = useIsMobile();\n\n const actionList = (\n <ActionList isVirtualized={!isMobile}>\n {countryData.map((country) => {\n return (\n <ActionListItem\n key={country.code}\n onClick={onItemClick}\n leading={<ActionListItemAsset src={flags[country.code]['4X3']} alt={country.name} />}\n title={country.name}\n value={country.code}\n trailing={\n <ActionListItemText>{getDialCodeByCountryCode(country.code)}</ActionListItemText>\n }\n />\n );\n })}\n </ActionList>\n );\n\n const flagSize = {\n medium: makeSize(sizes[20]),\n large: makeSize(sizes[24]),\n } as const;\n\n return (\n <Dropdown isOpen={isDropdownOpen} onOpenChange={setIsDropdownOpen}>\n {/* TODO: Remove once CountrySelector's button sizing is fixed in figma */}\n <CountryDropdownButtonWrapper\n width={size === 'medium' ? '45px' : '60px'}\n marginLeft={size === 'medium' ? '-3px' : '-2px'}\n >\n <DropdownButton\n isDisabled={isDisabled}\n size={size === 'medium' ? 'xsmall' : 'medium'}\n variant=\"tertiary\"\n //@ts-expect-error\n color=\"transparent\"\n accessibilityLabel={`${countryNameFormatter.of(selectedCountry)} - Select Country`}\n icon={ChevronUpDownIcon}\n iconPosition=\"right\"\n // We need to prevent the click event from propagating to the BaseInputWrapper,\n // Because the BaseInputWrapper is listening for click events to focus the input.\n // We don't want that to happen when the user clicks on the dropdown button\n // otherwise the dropdown will close immediately after opening\n onClick={(e) => {\n e.stopPropagation();\n }}\n >\n {/* @ts-expect-error */}\n <img\n loading=\"lazy\"\n role=\"presentation\"\n width={flagSize[size]}\n src={getFlagOfCountry(selectedCountry)['4X3']}\n alt=\"\"\n />\n </DropdownButton>\n </CountryDropdownButtonWrapper>\n {isMobile ? (\n <BottomSheet>\n <BottomSheetHeader title=\"Select A Country\" />\n <BottomSheetBody>{actionList}</BottomSheetBody>\n </BottomSheet>\n ) : (\n <DropdownOverlay referenceRef={inputWrapperRef}>{actionList}</DropdownOverlay>\n )}\n </Dropdown>\n );\n};\n\nexport { CountrySelector, countryNameFormatter };\n"],"names":["countryNameFormatter","Intl","DisplayNames","type","CountryDropdownButtonWrapper","styled","BaseBox","withConfig","displayName","componentId","padding","width","CountrySelector","_ref","isDisabled","selectedCountry","inputWrapperRef","countryData","onItemClick","flags","size","_React$useState","React","useState","_React$useState2","_slicedToArray","isDropdownOpen","setIsDropdownOpen","isMobile","useIsMobile","actionList","_jsx","ActionList","isVirtualized","children","map","country","ActionListItem","onClick","leading","ActionListItemAsset","src","code","alt","name","title","value","trailing","ActionListItemText","getDialCodeByCountryCode","flagSize","medium","makeSize","sizes","large","_jsxs","Dropdown","isOpen","onOpenChange","marginLeft","DropdownButton","variant","color","accessibilityLabel","concat","of","icon","ChevronUpDownIcon","iconPosition","e","stopPropagation","loading","role","getFlagOfCountry","BottomSheet","BottomSheetHeader","BottomSheetBody","DropdownOverlay","referenceRef"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBMA,IAAAA,oBAAoB,GAAG,IAAIC,IAAI,CAACC,YAAY,CAAC,CAAC,IAAI,CAAC,EAAE;AAAEC,EAAAA,IAAI,EAAE,QAAA;AAAS,CAAC,EAAC;AAgB9E,IAAMC,4BAA4B,gBAAGC,MAAM,CAACC,OAAO,CAAC,CAAAC,UAAA,CAAA;EAAAC,WAAA,EAAA,kDAAA;EAAAC,WAAA,EAAA,UAAA;AAAA,CAAA,CAAA,CAAC,YAAM;EACzD,OAAO;AACL,IAAA,YAAY,EAAE;AACZC,MAAAA,OAAO,EAAE,GAAG;AACZC,MAAAA,KAAK,EAAE,MAAA;AACT,KAAA;GACD,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,IAAMC,eAAe,GAAG,SAAlBA,eAAeA,CAAAC,IAAA,EAQ2B;AAAA,EAAA,IAP9CC,UAAU,GAAAD,IAAA,CAAVC,UAAU;IACVC,eAAe,GAAAF,IAAA,CAAfE,eAAe;IACfC,eAAe,GAAAH,IAAA,CAAfG,eAAe;IACfC,WAAW,GAAAJ,IAAA,CAAXI,WAAW;IACXC,WAAW,GAAAL,IAAA,CAAXK,WAAW;IACXC,KAAK,GAAAN,IAAA,CAALM,KAAK;IACLC,MAAI,GAAAP,IAAA,CAAJO,IAAI,CAAA;AAEJ,EAAA,IAAAC,eAAA,GAA4CC,cAAK,CAACC,QAAQ,CAAC,KAAK,CAAC;IAAAC,gBAAA,GAAAC,cAAA,CAAAJ,eAAA,EAAA,CAAA,CAAA;AAA1DK,IA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AAES,MAAI,KAAK,QAAQ,GAAG,MAAM,GAAG,MAAO;AAC3CuC,MAAAA,UAAU,EAAEvC,MAAI,KAAK,QAAQ,GAAG,MAAM,GAAG,MAAO;MAAAc,QAAA,eAEhDH,GAAA,CAAC6B,cAAc,EAAA;AACb9C,QAAAA,UAAU,EAAEA,UAAW;AACvBM,QAAAA,IAAI,EAAEA,MAAI,KAAK,QAAQ,GAAG,QAAQ,GAAG,QAAS;AAC9CyC,QAAAA,OAAO,EAAC,UAAA;AACR;AAAA;AACAC,QAAAA,KAAK,EAAC,aAAa;QACnBC,kBAAkB,EAAA,EAAA,CAAAC,MAAA,CAAKhE,oBAAoB,CAACiE,EAAE,CAAClD,eAAe,CAAC,EAAoB,mBAAA,CAAA;AACnFmD,QAAAA,IAAI,EAAEC,iBAAkB;AACxBC,QAAAA,YAAY,EAAC,OAAA;AACb;AACA;AACA;AACA;AAAA;AACA9B,QAAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"CountrySelector.web.js","sources":["../../../../../../../src/components/Input/PhoneNumberInput/CountrySelector.web.tsx"],"sourcesContent":["import type { CountryCodeType, getFlagsForAllCountries } from '@razorpay/i18nify-js';\nimport { getDialCodeByCountryCode, getFlagOfCountry } from '@razorpay/i18nify-js';\nimport React from 'react';\nimport styled from 'styled-components';\nimport {\n ActionList,\n ActionListItem,\n ActionListItemAsset,\n ActionListItemText,\n} from '~components/ActionList';\nimport { BottomSheet, BottomSheetBody, BottomSheetHeader } from '~components/BottomSheet';\nimport type { DropdownOverlayProps } from '~components/Dropdown';\nimport { Dropdown, DropdownButton, DropdownOverlay } from '~components/Dropdown';\nimport { ChevronUpDownIcon } from '~components/Icons';\nimport { useIsMobile } from '~utils/useIsMobile';\nimport { size as sizes } from '~tokens/global';\nimport { makeSize } from '~utils';\nimport BaseBox from '~components/Box/BaseBox';\n\nconst countryNameFormatter = new Intl.DisplayNames(['en'], { type: 'region' });\n\ntype CountryData = {\n code: CountryCodeType;\n name: string;\n}[];\ntype CounterSelectorProps = {\n selectedCountry: CountryCodeType;\n inputWrapperRef: DropdownOverlayProps['referenceRef'];\n countryData: CountryData;\n onItemClick: (props: { name: string }) => void;\n flags: ReturnType<typeof getFlagsForAllCountries>;\n isDisabled?: boolean;\n size: 'medium' | 'large';\n};\n\nconst CountryDropdownButtonWrapper = styled(BaseBox)(() => {\n return {\n '& > button': {\n padding: '0',\n width: '100%',\n },\n };\n});\n\nconst CountrySelector = ({\n isDisabled,\n selectedCountry,\n inputWrapperRef,\n countryData,\n onItemClick,\n flags,\n size,\n}: CounterSelectorProps): React.ReactElement => {\n const [isDropdownOpen, setIsDropdownOpen] = React.useState(false);\n const isMobile = useIsMobile();\n\n const actionList = (\n <ActionList isVirtualized={!isMobile}>\n {countryData.map((country) => {\n return (\n <ActionListItem\n key={country.code}\n onClick={onItemClick}\n leading={<ActionListItemAsset src={flags[country.code]['4X3']} alt={country.name} />}\n title={country.name}\n value={country.code}\n trailing={\n <ActionListItemText>{getDialCodeByCountryCode(country.code)}</ActionListItemText>\n }\n />\n );\n })}\n </ActionList>\n );\n\n const flagSize = {\n medium: makeSize(sizes[20]),\n large: makeSize(sizes[24]),\n } as const;\n\n return (\n <Dropdown isOpen={isDropdownOpen} onOpenChange={setIsDropdownOpen}>\n {/* TODO: Remove once CountrySelector's button sizing is fixed in figma */}\n <CountryDropdownButtonWrapper\n width={size === 'medium' ? '45px' : '60px'}\n marginLeft={size === 'medium' ? '-3px' : '-2px'}\n >\n <DropdownButton\n isDisabled={isDisabled}\n size={size === 'medium' ? 'xsmall' : 'medium'}\n variant=\"tertiary\"\n //@ts-expect-error\n color=\"transparent\"\n accessibilityLabel={`${countryNameFormatter.of(selectedCountry)} - Select Country`}\n icon={ChevronUpDownIcon}\n iconPosition=\"right\"\n // We need to prevent the click event from propagating to the BaseInputWrapper,\n // Because the BaseInputWrapper is listening for click events to focus the input.\n // We don't want that to happen when the user clicks on the dropdown button\n // otherwise the dropdown will close immediately after opening\n onClick={(e) => {\n e.stopPropagation();\n }}\n >\n {/* @ts-expect-error */}\n <img\n loading=\"lazy\"\n role=\"presentation\"\n width={flagSize[size]}\n src={getFlagOfCountry(selectedCountry)['4X3']}\n alt=\"\"\n />\n </DropdownButton>\n </CountryDropdownButtonWrapper>\n {isMobile ? (\n <BottomSheet>\n <BottomSheetHeader title=\"Select A Country\" />\n <BottomSheetBody>{actionList}</BottomSheetBody>\n </BottomSheet>\n ) : (\n <DropdownOverlay referenceRef={inputWrapperRef}>{actionList}</DropdownOverlay>\n )}\n </Dropdown>\n );\n};\n\nexport { CountrySelector, countryNameFormatter };\n"],"names":["countryNameFormatter","Intl","DisplayNames","type","CountryDropdownButtonWrapper","styled","BaseBox","withConfig","displayName","componentId","padding","width","CountrySelector","_ref","isDisabled","selectedCountry","inputWrapperRef","countryData","onItemClick","flags","size","_React$useState","React","useState","_React$useState2","_slicedToArray","isDropdownOpen","setIsDropdownOpen","isMobile","useIsMobile","actionList","_jsx","ActionList","isVirtualized","children","map","country","ActionListItem","onClick","leading","ActionListItemAsset","src","code","alt","name","title","value","trailing","ActionListItemText","getDialCodeByCountryCode","flagSize","medium","makeSize","sizes","large","_jsxs","Dropdown","isOpen","onOpenChange","marginLeft","DropdownButton","variant","color","accessibilityLabel","concat","of","icon","ChevronUpDownIcon","iconPosition","e","stopPropagation","loading","role","getFlagOfCountry","BottomSheet","BottomSheetHeader","BottomSheetBody","DropdownOverlay","referenceRef"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBMA,IAAAA,oBAAoB,GAAG,IAAIC,IAAI,CAACC,YAAY,CAAC,CAAC,IAAI,CAAC,EAAE;AAAEC,EAAAA,IAAI,EAAE,QAAA;AAAS,CAAC,EAAC;AAgB9E,IAAMC,4BAA4B,gBAAGC,MAAM,CAACC,OAAO,CAAC,CAAAC,UAAA,CAAA;EAAAC,WAAA,EAAA,kDAAA;EAAAC,WAAA,EAAA,UAAA;AAAA,CAAA,CAAA,CAAC,YAAM;EACzD,OAAO;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,CAAC,EAAK;UACdA,CAAC,CAACC,eAAe,EAAE,CAAA;SACnB;AAAApC,QAAAA,QAAA,eAGFH,GAAA,CAAA,KAAA,EAAA;AACEwC,UAAAA,OAAO,EAAC,MAAM;AACdC,UAAAA,IAAI,EAAC,cAAc;AACnB7D,UAAAA,KAAK,EAAEuC,QAAQ,CAAC9B,MAAI,CAAE;AACtBqB,UAAAA,GAAG,EAAEgC,gBAAgB,CAAC1D,eAAe,CAAC,CAAC,KAAK,CAAE;AAC9C4B,UAAAA,GAAG,EAAC,EAAA;SACL,CAAA;OACa,CAAA;AAAC,KACW,CAAC,EAC9Bf,QAAQ,gBACP2B,IAAA,CAACmB,WAAW,EAAA;MAAAxC,QAAA,EAAA,cACVH,GAAA,CAAC4C,iBAAiB,EAAA;AAAC9B,QAAAA,KAAK,EAAC,kBAAA;AAAkB,OAAE,CAAC,eAC9Cd,GAAA,CAAC6C,eAAe,EAAA;AAAA1C,QAAAA,QAAA,EAAEJ,UAAAA;AAAU,OAAkB,CAAC,CAAA;AAAA,KACpC,CAAC,gBAEdC,GAAA,CAAC8C,eAAe,EAAA;AAACC,MAAAA,YAAY,EAAE9D,eAAgB;AAAAkB,MAAAA,QAAA,EAAEJ,UAAAA;AAAU,KAAkB,CAC9E,CAAA;AAAA,GACO,CAAC,CAAA;AAEf;;;;"}
|
|
@@ -102,8 +102,8 @@ var _PhoneNumberInput = function _PhoneNumberInput(_ref, ref) {
|
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
// if the input field is controlled just call the click handler and the value change shall be left upto the consumer
|
|
105
|
-
onClearButtonClick === null || onClearButtonClick === void 0
|
|
106
|
-
inputRef === null || inputRef === void 0
|
|
105
|
+
onClearButtonClick === null || onClearButtonClick === void 0 || onClearButtonClick();
|
|
106
|
+
inputRef === null || inputRef === void 0 || (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 || _inputRef$current.focus();
|
|
107
107
|
setShouldShowClearButton(false);
|
|
108
108
|
},
|
|
109
109
|
isDisabled: isDisabled,
|
|
@@ -138,7 +138,7 @@ var _PhoneNumberInput = function _PhoneNumberInput(_ref, ref) {
|
|
|
138
138
|
var name = _ref2.name,
|
|
139
139
|
value = _ref2.value,
|
|
140
140
|
selectedCountry = _ref2.selectedCountry;
|
|
141
|
-
onChange === null || onChange === void 0
|
|
141
|
+
onChange === null || onChange === void 0 || onChange({
|
|
142
142
|
name: name,
|
|
143
143
|
value: value,
|
|
144
144
|
phoneNumber: value ? formatPhoneNumber(value, selectedCountry) : undefined,
|
|
@@ -158,7 +158,7 @@ var _PhoneNumberInput = function _PhoneNumberInput(_ref, ref) {
|
|
|
158
158
|
name: (_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === void 0 ? void 0 : _inputRef$current2.name,
|
|
159
159
|
value: (_inputRef$current3 = inputRef.current) === null || _inputRef$current3 === void 0 ? void 0 : _inputRef$current3.value
|
|
160
160
|
});
|
|
161
|
-
(_inputRef$current4 = inputRef.current) === null || _inputRef$current4 === void 0
|
|
161
|
+
(_inputRef$current4 = inputRef.current) === null || _inputRef$current4 === void 0 || _inputRef$current4.focus();
|
|
162
162
|
};
|
|
163
163
|
return /*#__PURE__*/jsx(BaseInput, _objectSpread(_objectSpread({
|
|
164
164
|
setInputWrapperRef: function setInputWrapperRef(node) {
|
|
@@ -242,7 +242,7 @@ var _PhoneNumberInput = function _PhoneNumberInput(_ref, ref) {
|
|
|
242
242
|
* <PhoneNumberInput />
|
|
243
243
|
* ```
|
|
244
244
|
*/
|
|
245
|
-
var PhoneNumberInput = /*#__PURE__*/assignWithoutSideEffects(
|
|
245
|
+
var PhoneNumberInput = /*#__PURE__*/assignWithoutSideEffects(/*#__PURE__*/React__default.forwardRef(_PhoneNumberInput), {
|
|
246
246
|
displayName: 'PhoneNumberInput'
|
|
247
247
|
});
|
|
248
248
|
|
package/build/lib/web/development/components/Input/PhoneNumberInput/PhoneNumberInput.web.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PhoneNumberInput.web.js","sources":["../../../../../../../src/components/Input/PhoneNumberInput/PhoneNumberInput.web.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */\nimport type { CountryCodeType } from '@razorpay/i18nify-js';\nimport {\n formatPhoneNumber,\n getDialCodeByCountryCode,\n getFlagsForAllCountries,\n} from '@razorpay/i18nify-js';\nimport React from 'react';\nimport type { PhoneNumberInputProps } from './types';\nimport { countryNameFormatter, CountrySelector } from './CountrySelector';\nimport { BaseInput } from '~components/Input/BaseInput';\nimport { IconButton } from '~components/Button/IconButton';\nimport isEmpty from '~utils/lodashButBetter/isEmpty';\nimport { getKeyboardAndAutocompleteProps } from '~components/Input/BaseInput/utils';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { useMergeRefs } from '~utils/useMergeRefs';\nimport type { BladeElementRef } from '~utils/types';\nimport { CloseIcon } from '~components/Icons';\nimport { MetaConstants } from '~utils/metaAttribute';\nimport { useControllableState } from '~utils/useControllable';\n\nconst _PhoneNumberInput: React.ForwardRefRenderFunction<BladeElementRef, PhoneNumberInputProps> = (\n {\n defaultCountry = 'IN',\n country,\n onCountryChange,\n label,\n labelPosition,\n defaultValue,\n value,\n name,\n onChange,\n necessityIndicator,\n isRequired,\n isDisabled,\n leadingIcon,\n trailingIcon,\n validationState,\n errorText,\n helpText,\n successText,\n size = 'medium',\n onClearButtonClick,\n showCountrySelector = true,\n showDialCode = true,\n onClick,\n onBlur,\n onFocus,\n accessibilityLabel = 'Enter phone number',\n autoFocus,\n testID,\n keyboardReturnKeyType = 'done',\n autoCompleteSuggestionType,\n allowedCountries,\n placeholder,\n labelSuffix,\n labelTrailing,\n ...rest\n },\n ref,\n): React.ReactElement => {\n const inputRef = React.useRef<HTMLInputElement | null>(null);\n const mergedRef = useMergeRefs(ref, inputRef);\n\n const inputWrapperRef = React.useRef<HTMLDivElement | null>(null);\n const [shouldShowClearButton, setShouldShowClearButton] = React.useState(false);\n const [selectedCountry, setSelectedCountry] = useControllableState<CountryCodeType>({\n defaultValue: defaultCountry as CountryCodeType,\n value: country,\n onChange: (country) => onCountryChange?.({ country }),\n });\n\n React.useEffect(() => {\n setShouldShowClearButton(Boolean(defaultValue ?? value));\n }, [defaultValue, value]);\n\n const renderTrailingInteractionElement = (): React.ReactNode => {\n if (!shouldShowClearButton) return null;\n return (\n <IconButton\n size=\"medium\"\n icon={CloseIcon}\n onClick={() => {\n if (isEmpty(value) && inputRef.current) {\n // when the input field is uncontrolled take the ref and clear the input and then call the onClearButtonClick function\n if (inputRef.current instanceof HTMLInputElement) {\n inputRef.current.value = '';\n inputRef.current.focus();\n }\n }\n // if the input field is controlled just call the click handler and the value change shall be left upto the consumer\n onClearButtonClick?.();\n inputRef?.current?.focus();\n setShouldShowClearButton(false);\n }}\n isDisabled={isDisabled}\n accessibilityLabel=\"Clear Input Content\"\n />\n );\n };\n\n const flags = React.useMemo(() => getFlagsForAllCountries(), []);\n const countryData = React.useMemo(() => {\n if (allowedCountries) {\n return allowedCountries.map((countryCode) => {\n return {\n code: countryCode,\n name: countryNameFormatter.of(countryCode)!,\n };\n });\n }\n\n return (Object.keys(flags) as CountryCodeType[])\n .filter((countryCode) => !countryCode.includes('-')) // remove the non ISO 3166-1 alpha-2 country codes\n .map((countryCode) => {\n return {\n code: countryCode,\n name: countryNameFormatter.of(countryCode)!,\n };\n })\n .sort((a, b) => a.name.localeCompare(b.name));\n }, [allowedCountries, flags]);\n\n const handleOnChange = ({\n name,\n value,\n selectedCountry,\n }: {\n name?: string;\n value?: string;\n selectedCountry: CountryCodeType;\n }): void => {\n onChange?.({\n name: name!,\n value: value!,\n phoneNumber: value ? formatPhoneNumber(value, selectedCountry) : undefined!,\n dialCode: getDialCodeByCountryCode(selectedCountry),\n country: selectedCountry,\n });\n };\n\n const onItemClick = ({ name }: { name: string }): void => {\n const selectedCountry = name as CountryCodeType;\n setSelectedCountry(() => selectedCountry);\n handleOnChange({\n selectedCountry,\n name: inputRef.current?.name,\n value: inputRef.current?.value,\n });\n inputRef.current?.focus();\n };\n\n return (\n <BaseInput\n setInputWrapperRef={(node) => {\n inputWrapperRef.current = node as HTMLInputElement;\n }}\n ref={mergedRef}\n id=\"phone-number-input\"\n componentName={MetaConstants.PhoneNumberInput}\n label={label as string}\n hideLabelText={!Boolean(label)}\n labelPosition={labelPosition}\n defaultValue={defaultValue}\n value={value}\n name={name}\n placeholder={placeholder ?? formatPhoneNumber('1234567890', selectedCountry)}\n trailingIcon={trailingIcon}\n leadingIcon={leadingIcon}\n prefix={showDialCode ? getDialCodeByCountryCode(selectedCountry) : undefined}\n labelSuffix={labelSuffix}\n labelTrailing={labelTrailing}\n trailingInteractionElement={renderTrailingInteractionElement()}\n leadingInteractionElement={\n showCountrySelector ? (\n <CountrySelector\n size={size}\n countryData={countryData}\n flags={flags}\n inputWrapperRef={inputWrapperRef}\n isDisabled={isDisabled}\n selectedCountry={selectedCountry}\n onItemClick={onItemClick}\n />\n ) : null\n }\n onChange={({ name, value }) => {\n if (value?.length) {\n // show the clear button when the user starts typing in\n setShouldShowClearButton(true);\n }\n if (shouldShowClearButton && !value?.length) {\n // hide the clear button when the input field is empty\n setShouldShowClearButton(false);\n }\n handleOnChange({ name, value, selectedCountry });\n }}\n onClick={onClick}\n onFocus={onFocus}\n onBlur={onBlur}\n isDisabled={isDisabled}\n accessibilityLabel={accessibilityLabel}\n necessityIndicator={necessityIndicator}\n isRequired={isRequired}\n validationState={validationState}\n errorText={errorText}\n helpText={helpText}\n successText={successText}\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus={autoFocus}\n testID={testID}\n size={size}\n {...getKeyboardAndAutocompleteProps({\n type: 'number',\n keyboardReturnKeyType,\n autoCompleteSuggestionType,\n autoCapitalize: 'none',\n })}\n type=\"telephone\"\n {...rest}\n />\n );\n};\n\n/**\n * PhoneNumberInput is a component that allows users to input phone numbers.\n * It provides a country selector dropdown to select the country code.\n *\n * @example\n *\n * ```ts\n * <PhoneNumberInput />\n * ```\n */\nconst PhoneNumberInput = assignWithoutSideEffects(React.forwardRef(_PhoneNumberInput), {\n displayName: 'PhoneNumberInput',\n});\n\nexport { PhoneNumberInput };\n"],"names":["_PhoneNumberInput","_ref","ref","_ref$defaultCountry","defaultCountry","country","onCountryChange","label","labelPosition","defaultValue","value","name","onChange","necessityIndicator","isRequired","isDisabled","leadingIcon","trailingIcon","validationState","errorText","helpText","successText","_ref$size","size","onClearButtonClick","_ref$showCountrySelec","showCountrySelector","_ref$showDialCode","showDialCode","onClick","onBlur","onFocus","_ref$accessibilityLab","accessibilityLabel","autoFocus","testID","_ref$keyboardReturnKe","keyboardReturnKeyType","autoCompleteSuggestionType","allowedCountries","placeholder","labelSuffix","labelTrailing","rest","_objectWithoutProperties","_excluded","inputRef","React","useRef","mergedRef","useMergeRefs","inputWrapperRef","_React$useState","useState","_React$useState2","_slicedToArray","shouldShowClearButton","setShouldShowClearButton","_useControllableState","useControllableState","_useControllableState2","selectedCountry","setSelectedCountry","useEffect","Boolean","renderTrailingInteractionElement","_jsx","IconButton","icon","CloseIcon","_inputRef$current","isEmpty","current","HTMLInputElement","focus","flags","useMemo","getFlagsForAllCountries","countryData","map","countryCode","code","countryNameFormatter","of","Object","keys","filter","includes","sort","a","b","localeCompare","handleOnChange","_ref2","phoneNumber","formatPhoneNumber","undefined","dialCode","getDialCodeByCountryCode","onItemClick","_ref3","_inputRef$current2","_inputRef$current3","_inputRef$current4","BaseInput","_objectSpread","setInputWrapperRef","node","id","componentName","MetaConstants","PhoneNumberInput","hideLabelText","prefix","trailingInteractionElement","leadingInteractionElement","CountrySelector","_ref4","length","getKeyboardAndAutocompleteProps","type","autoCapitalize","assignWithoutSideEffects","forwardRef","displayName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAqBA,IAAMA,iBAAyF,GAAG,SAA5FA,iBAAyFA,CAAAC,IAAA,EAsC7FC,GAAG,EACoB;AAAA,EAAA,IAAAC,mBAAA,GAAAF,IAAA,CArCrBG,c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honeNumberInput.web.js","sources":["../../../../../../../src/components/Input/PhoneNumberInput/PhoneNumberInput.web.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */\nimport type { CountryCodeType } from '@razorpay/i18nify-js';\nimport {\n formatPhoneNumber,\n getDialCodeByCountryCode,\n getFlagsForAllCountries,\n} from '@razorpay/i18nify-js';\nimport React from 'react';\nimport type { PhoneNumberInputProps } from './types';\nimport { countryNameFormatter, CountrySelector } from './CountrySelector';\nimport { BaseInput } from '~components/Input/BaseInput';\nimport { IconButton } from '~components/Button/IconButton';\nimport isEmpty from '~utils/lodashButBetter/isEmpty';\nimport { getKeyboardAndAutocompleteProps } from '~components/Input/BaseInput/utils';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { useMergeRefs } from '~utils/useMergeRefs';\nimport type { BladeElementRef } from '~utils/types';\nimport { CloseIcon } from '~components/Icons';\nimport { MetaConstants } from '~utils/metaAttribute';\nimport { useControllableState } from '~utils/useControllable';\n\nconst _PhoneNumberInput: React.ForwardRefRenderFunction<BladeElementRef, PhoneNumberInputProps> = (\n {\n defaultCountry = 'IN',\n country,\n onCountryChange,\n label,\n labelPosition,\n defaultValue,\n value,\n name,\n onChange,\n necessityIndicator,\n isRequired,\n isDisabled,\n leadingIcon,\n trailingIcon,\n validationState,\n errorText,\n helpText,\n successText,\n size = 'medium',\n onClearButtonClick,\n showCountrySelector = true,\n showDialCode = true,\n onClick,\n onBlur,\n onFocus,\n accessibilityLabel = 'Enter phone number',\n autoFocus,\n testID,\n keyboardReturnKeyType = 'done',\n autoCompleteSuggestionType,\n allowedCountries,\n placeholder,\n labelSuffix,\n labelTrailing,\n ...rest\n },\n ref,\n): React.ReactElement => {\n const inputRef = React.useRef<HTMLInputElement | null>(null);\n const mergedRef = useMergeRefs(ref, inputRef);\n\n const inputWrapperRef = React.useRef<HTMLDivElement | null>(null);\n const [shouldShowClearButton, setShouldShowClearButton] = React.useState(false);\n const [selectedCountry, setSelectedCountry] = useControllableState<CountryCodeType>({\n defaultValue: defaultCountry as CountryCodeType,\n value: country,\n onChange: (country) => onCountryChange?.({ country }),\n });\n\n React.useEffect(() => {\n setShouldShowClearButton(Boolean(defaultValue ?? value));\n }, [defaultValue, value]);\n\n const renderTrailingInteractionElement = (): React.ReactNode => {\n if (!shouldShowClearButton) return null;\n return (\n <IconButton\n size=\"medium\"\n icon={CloseIcon}\n onClick={() => {\n if (isEmpty(value) && inputRef.current) {\n // when the input field is uncontrolled take the ref and clear the input and then call the onClearButtonClick function\n if (inputRef.current instanceof HTMLInputElement) {\n inputRef.current.value = '';\n inputRef.current.focus();\n }\n }\n // if the input field is controlled just call the click handler and the value change shall be left upto the consumer\n onClearButtonClick?.();\n inputRef?.current?.focus();\n setShouldShowClearButton(false);\n }}\n isDisabled={isDisabled}\n accessibilityLabel=\"Clear Input Content\"\n />\n );\n };\n\n const flags = React.useMemo(() => getFlagsForAllCountries(), []);\n const countryData = React.useMemo(() => {\n if (allowedCountries) {\n return allowedCountries.map((countryCode) => {\n return {\n code: countryCode,\n name: countryNameFormatter.of(countryCode)!,\n };\n });\n }\n\n return (Object.keys(flags) as CountryCodeType[])\n .filter((countryCode) => !countryCode.includes('-')) // remove the non ISO 3166-1 alpha-2 country codes\n .map((countryCode) => {\n return {\n code: countryCode,\n name: countryNameFormatter.of(countryCode)!,\n };\n })\n .sort((a, b) => a.name.localeCompare(b.name));\n }, [allowedCountries, flags]);\n\n const handleOnChange = ({\n name,\n value,\n selectedCountry,\n }: {\n name?: string;\n value?: string;\n selectedCountry: CountryCodeType;\n }): void => {\n onChange?.({\n name: name!,\n value: value!,\n phoneNumber: value ? formatPhoneNumber(value, selectedCountry) : undefined!,\n dialCode: getDialCodeByCountryCode(selectedCountry),\n country: selectedCountry,\n });\n };\n\n const onItemClick = ({ name }: { name: string }): void => {\n const selectedCountry = name as CountryCodeType;\n setSelectedCountry(() => selectedCountry);\n handleOnChange({\n selectedCountry,\n name: inputRef.current?.name,\n value: inputRef.current?.value,\n });\n inputRef.current?.focus();\n };\n\n return (\n <BaseInput\n setInputWrapperRef={(node) => {\n inputWrapperRef.current = node as HTMLInputElement;\n }}\n ref={mergedRef}\n id=\"phone-number-input\"\n componentName={MetaConstants.PhoneNumberInput}\n label={label as string}\n hideLabelText={!Boolean(label)}\n labelPosition={labelPosition}\n defaultValue={defaultValue}\n value={value}\n name={name}\n placeholder={placeholder ?? formatPhoneNumber('1234567890', selectedCountry)}\n trailingIcon={trailingIcon}\n leadingIcon={leadingIcon}\n prefix={showDialCode ? getDialCodeByCountryCode(selectedCountry) : undefined}\n labelSuffix={labelSuffix}\n labelTrailing={labelTrailing}\n trailingInteractionElement={renderTrailingInteractionElement()}\n leadingInteractionElement={\n showCountrySelector ? (\n <CountrySelector\n size={size}\n countryData={countryData}\n flags={flags}\n inputWrapperRef={inputWrapperRef}\n isDisabled={isDisabled}\n selectedCountry={selectedCountry}\n onItemClick={onItemClick}\n />\n ) : null\n }\n onChange={({ name, value }) => {\n if (value?.length) {\n // show the clear button when the user starts typing in\n setShouldShowClearButton(true);\n }\n if (shouldShowClearButton && !value?.length) {\n // hide the clear button when the input field is empty\n setShouldShowClearButton(false);\n }\n handleOnChange({ name, value, selectedCountry });\n }}\n onClick={onClick}\n onFocus={onFocus}\n onBlur={onBlur}\n isDisabled={isDisabled}\n accessibilityLabel={accessibilityLabel}\n necessityIndicator={necessityIndicator}\n isRequired={isRequired}\n validationState={validationState}\n errorText={errorText}\n helpText={helpText}\n successText={successText}\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus={autoFocus}\n testID={testID}\n size={size}\n {...getKeyboardAndAutocompleteProps({\n type: 'number',\n keyboardReturnKeyType,\n autoCompleteSuggestionType,\n autoCapitalize: 'none',\n })}\n type=\"telephone\"\n {...rest}\n />\n );\n};\n\n/**\n * PhoneNumberInput is a component that allows users to input phone numbers.\n * It provides a country selector dropdown to select the country code.\n *\n * @example\n *\n * ```ts\n * <PhoneNumberInput />\n * ```\n */\nconst PhoneNumberInput = assignWithoutSideEffects(React.forwardRef(_PhoneNumberInput), {\n displayName: 'PhoneNumberInput',\n});\n\nexport { PhoneNumberInput };\n"],"names":["_PhoneNumberInput","_ref","ref","_ref$defaultCountry","defaultCountry","country","onCountryChange","label","labelPosition","defaultValue","value","name","onChange","necessityIndicator","isRequired","isDisabled","leadingIcon","trailingIcon","validationState","errorText","helpText","successText","_ref$size","size","onClearButtonClick","_ref$showCountrySelec","showCountrySelector","_ref$showDialCode","showDialCode","onClick","onBlur","onFocus","_ref$accessibilityLab","accessibilityLabel","autoFocus","testID","_ref$keyboardReturnKe","keyboardReturnKeyType","autoCompleteSuggestionType","allowedCountries","placeholder","labelSuffix","labelTrailing","rest","_objectWithoutProperties","_excluded","inputRef","React","useRef","mergedRef","useMergeRefs","inputWrapperRef","_React$useState","useState","_React$useState2","_slicedToArray","shouldShowClearButton","setShouldShowClearButton","_useControllableState","useControllableState","_useControllableState2","selectedCountry","setSelectedCountry","useEffect","Boolean","renderTrailingInteractionElement","_jsx","IconButton","icon","CloseIcon","_inputRef$current","isEmpty","current","HTMLInputElement","focus","flags","useMemo","getFlagsForAllCountries","countryData","map","countryCode","code","countryNameFormatter","of","Object","keys","filter","includes","sort","a","b","localeCompare","handleOnChange","_ref2","phoneNumber","formatPhoneNumber","undefined","dialCode","getDialCodeByCountryCode","onItemClick","_ref3","_inputRef$current2","_inputRef$current3","_inputRef$current4","BaseInput","_objectSpread","setInputWrapperRef","node","id","componentName","MetaConstants","PhoneNumberInput","hideLabelText","prefix","trailingInteractionElement","leadingInteractionElement","CountrySelector","_ref4","length","getKeyboardAndAutocompleteProps","type","autoCapitalize","assignWithoutSideEffects","forwardRef","displayName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAqBA,IAAMA,iBAAyF,GAAG,SAA5FA,iBAAyFA,CAAAC,IAAA,EAsC7FC,GAAG,EACoB;AAAA,EAAA,IAAAC,mBAAA,GAAAF,IAAA,CArCrBG,cAAc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AJA,IAAI;AAAED,QAAAA,KAAK,EAALA,KAAK;AAAEmD,QAAAA,eAAe,EAAfA,eAAAA;AAAgB,OAAC,CAAC,CAAA;KAChD;AACFhC,IAAAA,OAAO,EAAEA,OAAQ;AACjBE,IAAAA,OAAO,EAAEA,OAAQ;AACjBD,IAAAA,MAAM,EAAEA,MAAO;AACff,IAAAA,UAAU,EAAEA,UAAW;AACvBkB,IAAAA,kBAAkB,EAAEA,kBAAmB;AACvCpB,IAAAA,kBAAkB,EAAEA,kBAAmB;AACvCC,IAAAA,UAAU,EAAEA,UAAW;AACvBI,IAAAA,eAAe,EAAEA,eAAgB;AACjCC,IAAAA,SAAS,EAAEA,SAAU;AACrBC,IAAAA,QAAQ,EAAEA,QAAS;AACnBC,IAAAA,WAAW,EAAEA,WAAAA;AACb;AAAA;AACAa,IAAAA,SAAS,EAAEA,SAAU;AACrBC,IAAAA,MAAM,EAAEA,MAAO;AACfZ,IAAAA,IAAI,EAAEA,IAAAA;AAAK,GAAA,EACPgG,+BAA+B,CAAC;AAClCC,IAAAA,IAAI,EAAE,QAAQ;AACdnF,IAAAA,qBAAqB,EAArBA,qBAAqB;AACrBC,IAAAA,0BAA0B,EAA1BA,0BAA0B;AAC1BmF,IAAAA,cAAc,EAAE,MAAA;AAClB,GAAC,CAAC,CAAA,EAAA,EAAA,EAAA;AACFD,IAAAA,IAAI,EAAC,WAAA;GACD7E,EAAAA,IAAI,CACT,CAAC,CAAA;AAEN,CAAC,CAAA;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACMoE,IAAAA,gBAAgB,gBAAGW,wBAAwB,cAAC3E,cAAK,CAAC4E,UAAU,CAAC3H,iBAAiB,CAAC,EAAE;AACrF4H,EAAAA,WAAW,EAAE,kBAAA;AACf,CAAC;;;;"}
|
|
@@ -149,8 +149,8 @@ var _SearchInput = function _SearchInput(_ref, ref) {
|
|
|
149
149
|
}
|
|
150
150
|
|
|
151
151
|
// if the input field is controlled just call the click handler and the value change shall be left upto the consumer
|
|
152
|
-
onClearButtonClick === null || onClearButtonClick === void 0
|
|
153
|
-
textInputRef === null || textInputRef === void 0
|
|
152
|
+
onClearButtonClick === null || onClearButtonClick === void 0 || onClearButtonClick();
|
|
153
|
+
textInputRef === null || textInputRef === void 0 || (_textInputRef$current = textInputRef.current) === null || _textInputRef$current === void 0 || _textInputRef$current.focus();
|
|
154
154
|
setShouldShowClearButton(false);
|
|
155
155
|
},
|
|
156
156
|
isDisabled: isDisabled,
|
|
@@ -210,7 +210,7 @@ var _SearchInput = function _SearchInput(_ref, ref) {
|
|
|
210
210
|
// hide the clear button when the input field is empty
|
|
211
211
|
setShouldShowClearButton(false);
|
|
212
212
|
}
|
|
213
|
-
_onChange === null || _onChange === void 0
|
|
213
|
+
_onChange === null || _onChange === void 0 || _onChange({
|
|
214
214
|
name: name,
|
|
215
215
|
value: value
|
|
216
216
|
});
|
|
@@ -220,7 +220,7 @@ var _SearchInput = function _SearchInput(_ref, ref) {
|
|
|
220
220
|
if (isInsideDropdown) {
|
|
221
221
|
onTriggerClick();
|
|
222
222
|
}
|
|
223
|
-
_onClick === null || _onClick === void 0
|
|
223
|
+
_onClick === null || _onClick === void 0 || _onClick(e);
|
|
224
224
|
},
|
|
225
225
|
onFocus: onFocus,
|
|
226
226
|
onBlur: onBlur,
|
|
@@ -242,7 +242,7 @@ var _SearchInput = function _SearchInput(_ref, ref) {
|
|
|
242
242
|
}, rest))
|
|
243
243
|
});
|
|
244
244
|
};
|
|
245
|
-
var SearchInput = /*#__PURE__*/assignWithoutSideEffects(
|
|
245
|
+
var SearchInput = /*#__PURE__*/assignWithoutSideEffects(/*#__PURE__*/React__default.forwardRef(_SearchInput), {
|
|
246
246
|
displayName: 'SearchInput',
|
|
247
247
|
componentId: dropdownComponentIds.triggers.SearchInput
|
|
248
248
|
});
|