@razorpay/blade 11.11.0 → 11.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/lib/native/components/ActionList/ActionListBox.native.js.map +1 -1
- package/build/lib/native/components/Amount/Amount.js +1 -1
- package/build/lib/native/components/Amount/Amount.js.map +1 -1
- package/build/lib/native/components/BottomSheet/BottomSheet.native.js.map +1 -1
- package/build/lib/native/components/Box/BaseBox/baseBoxStyles.js +1 -1
- package/build/lib/native/components/Box/BaseBox/baseBoxStyles.js.map +1 -1
- package/build/lib/native/components/Box/BaseBox/types/propsTypes.js.map +1 -1
- package/build/lib/native/components/Button/BaseButton/AnimatedButtonContent.native.js.map +1 -1
- package/build/lib/native/components/Button/BaseButton/StyledBaseButton.native.js.map +1 -1
- package/build/lib/native/components/Divider/Divider.js +1 -1
- package/build/lib/native/components/Divider/Divider.js.map +1 -1
- package/build/lib/native/components/Input/BaseInput/AnimatedBaseInputWrapper.native.js +1 -1
- package/build/lib/native/components/Input/BaseInput/AnimatedBaseInputWrapper.native.js.map +1 -1
- package/build/lib/native/components/Input/BaseInput/BaseInput.js +2 -1
- package/build/lib/native/components/Input/BaseInput/BaseInput.js.map +1 -1
- package/build/lib/native/components/Input/BaseInput/BaseInputTagSlot.native.js +1 -1
- package/build/lib/native/components/Input/BaseInput/BaseInputTagSlot.native.js.map +1 -1
- package/build/lib/native/components/Input/BaseInput/BaseInputWrapper.js +1 -1
- package/build/lib/native/components/Input/BaseInput/BaseInputWrapper.js.map +1 -1
- package/build/lib/native/components/Input/BaseInput/StyledBaseInput.native.js +1 -1
- package/build/lib/native/components/Input/BaseInput/StyledBaseInput.native.js.map +1 -1
- package/build/lib/native/components/Input/BaseInput/baseInputStyles.js +1 -1
- package/build/lib/native/components/Input/BaseInput/baseInputStyles.js.map +1 -1
- package/build/lib/native/components/Input/BaseInput/useTaggedInput.js +13 -0
- package/build/lib/native/components/Input/BaseInput/useTaggedInput.js.map +1 -0
- package/build/lib/native/components/Input/OTPInput/OTPInput.js +1 -1
- package/build/lib/native/components/Input/OTPInput/OTPInput.js.map +1 -1
- package/build/lib/native/components/Input/TextArea/TextArea.js +2 -1
- package/build/lib/native/components/Input/TextArea/TextArea.js.map +1 -1
- package/build/lib/native/components/Input/TextInput/TextInput.js +2 -1
- package/build/lib/native/components/Input/TextInput/TextInput.js.map +1 -1
- package/build/lib/native/components/PopupArrow/PopupArrow.native.js +1 -1
- package/build/lib/native/components/PopupArrow/PopupArrow.native.js.map +1 -1
- package/build/lib/native/components/Tabs/Tabs.native.js.map +1 -1
- package/build/lib/native/components/Tag/AnimatedTag.native.js.map +1 -1
- package/build/lib/native/components/Tag/Tag.js +1 -1
- package/build/lib/native/components/Tag/Tag.js.map +1 -1
- package/build/lib/native/components/Tag/getTagsGroup.js +1 -1
- package/build/lib/native/components/Tag/getTagsGroup.js.map +1 -1
- package/build/lib/native/components/Tag/tagAnimationConfig.js +1 -2
- package/build/lib/native/components/Tag/tagAnimationConfig.js.map +1 -1
- package/build/lib/native/components/Typography/BaseText/getBaseTextStyles.js +1 -1
- package/build/lib/native/components/Typography/BaseText/getBaseTextStyles.js.map +1 -1
- package/build/lib/native/utils/mergeProps.js +1 -1
- package/build/lib/native/utils/mergeProps.js.map +1 -1
- package/build/lib/web/development/components/Accordion/Accordion.js +2 -2
- package/build/lib/web/development/components/Accordion/AccordionButton.web.js +2 -2
- package/build/lib/web/development/components/Accordion/AccordionItem.js +2 -2
- package/build/lib/web/development/components/Accordion/AccordionItemBody.js +2 -2
- package/build/lib/web/development/components/Accordion/AccordionItemHeader.js +2 -2
- package/build/lib/web/development/components/Accordion/StyledAccordionButton.web.js +2 -2
- package/build/lib/web/development/components/ActionList/ActionList.js +2 -2
- package/build/lib/web/development/components/ActionList/ActionListBox.web.js +2 -2
- package/build/lib/web/development/components/ActionList/ActionListItem.js +2 -2
- package/build/lib/web/development/components/ActionList/actionListUtils.js +2 -2
- package/build/lib/web/development/components/ActionList/styles/StyledActionListItem.web.js +2 -2
- package/build/lib/web/development/components/ActionList/styles/StyledListBoxWrapper.web.js +4 -5
- package/build/lib/web/development/components/ActionList/styles/StyledListBoxWrapper.web.js.map +1 -1
- package/build/lib/web/development/components/Alert/Alert.js +2 -2
- package/build/lib/web/development/components/Amount/Amount.js +5 -3
- package/build/lib/web/development/components/Amount/Amount.js.map +1 -1
- package/build/lib/web/development/components/Badge/Badge.js +2 -2
- package/build/lib/web/development/components/Badge/StyledBadge.web.js +2 -2
- package/build/lib/web/development/components/BaseHeaderFooter/BaseFooter.js +2 -2
- package/build/lib/web/development/components/BaseHeaderFooter/BaseHeader.js +2 -2
- package/build/lib/web/development/components/BladeProvider/useBladeProvider.js +2 -2
- package/build/lib/web/development/components/BottomSheet/BottomSheet.web.js +2 -2
- package/build/lib/web/development/components/BottomSheet/BottomSheetBackdrop.web.js +2 -2
- package/build/lib/web/development/components/BottomSheet/BottomSheetBody.web.js +2 -2
- package/build/lib/web/development/components/BottomSheet/BottomSheetCommon.js +2 -2
- package/build/lib/web/development/components/BottomSheet/BottomSheetFooter.web.js +2 -2
- package/build/lib/web/development/components/BottomSheet/BottomSheetHeader.web.js +2 -2
- package/build/lib/web/development/components/BottomSheet/getBottomSheetGrabHandleStyles.js +2 -2
- package/build/lib/web/development/components/Box/BaseBox/BaseBox.web.js +2 -2
- package/build/lib/web/development/components/Box/BaseBox/baseBoxStyles.js +4 -3
- package/build/lib/web/development/components/Box/BaseBox/baseBoxStyles.js.map +1 -1
- package/build/lib/web/development/components/Box/BaseBox/types/propsTypes.js.map +1 -1
- package/build/lib/web/development/components/Box/BaseBox/useMemoizedStyles.web.js +2 -2
- package/build/lib/web/development/components/Box/Box.js +2 -2
- package/build/lib/web/development/components/Box/styledProps/getStyledProps.js +3 -1
- package/build/lib/web/development/components/Box/styledProps/getStyledProps.js.map +1 -1
- package/build/lib/web/development/components/Box/styledProps/useStyledProps.js +4 -3
- package/build/lib/web/development/components/Box/styledProps/useStyledProps.js.map +1 -1
- package/build/lib/web/development/components/Breadcrumb/Breadcrumb.web.js +2 -2
- package/build/lib/web/development/components/Button/BaseButton/BaseButton.js +2 -3
- package/build/lib/web/development/components/Button/BaseButton/BaseButton.js.map +1 -1
- package/build/lib/web/development/components/Button/BaseButton/StyledBaseButton.web.js +2 -2
- package/build/lib/web/development/components/Button/Button/Button.js +2 -2
- package/build/lib/web/development/components/Button/IconButton/StyledIconButton.web.js +2 -2
- package/build/lib/web/development/components/ButtonGroup/ButtonGroup.web.js +2 -3
- package/build/lib/web/development/components/ButtonGroup/ButtonGroup.web.js.map +1 -1
- package/build/lib/web/development/components/Card/Card.js +2 -2
- package/build/lib/web/development/components/Card/CardFooter.js +2 -2
- package/build/lib/web/development/components/Card/CardHeader.js +2 -2
- package/build/lib/web/development/components/Card/CardRoot.web.js +5 -6
- package/build/lib/web/development/components/Card/CardRoot.web.js.map +1 -1
- package/build/lib/web/development/components/Carousel/Carousel.web.js +2 -2
- package/build/lib/web/development/components/Carousel/CarouselItem.web.js +2 -2
- package/build/lib/web/development/components/Carousel/Indicators/IndicatorButton.js +2 -2
- package/build/lib/web/development/components/Carousel/Indicators/Indicators.js +2 -2
- package/build/lib/web/development/components/Carousel/Indicators/getIndicatorButtonStyles.js +2 -2
- package/build/lib/web/development/components/Carousel/NavigationButton/NavigationButton.js +2 -2
- package/build/lib/web/development/components/Carousel/NavigationButton/getNavigationButtonStyles.js +2 -2
- package/build/lib/web/development/components/Checkbox/Checkbox.js +2 -2
- package/build/lib/web/development/components/Checkbox/CheckboxGroup/CheckboxGroup.js +2 -2
- package/build/lib/web/development/components/Checkbox/CheckboxIcon/CheckboxIcon.js +2 -2
- package/build/lib/web/development/components/Checkbox/CheckboxIcon/Fade.web.js +2 -2
- package/build/lib/web/development/components/Checkbox/useCheckbox.js +2 -2
- package/build/lib/web/development/components/Chip/AnimatedChip.web.js +2 -2
- package/build/lib/web/development/components/Chip/Chip.js +2 -2
- package/build/lib/web/development/components/Chip/ChipGroup.js +2 -2
- package/build/lib/web/development/components/Chip/StyledChipWrapper.web.js +2 -2
- package/build/lib/web/development/components/Collapsible/Collapsible.js +2 -2
- package/build/lib/web/development/components/Collapsible/CollapsibleBody.js +2 -2
- package/build/lib/web/development/components/Collapsible/CollapsibleBodyContent.web.js +2 -2
- package/build/lib/web/development/components/Collapsible/CollapsibleChevronIcon.web.js +2 -2
- package/build/lib/web/development/components/Counter/Counter.js +2 -2
- package/build/lib/web/development/components/Counter/StyledCounter.web.js +2 -2
- package/build/lib/web/development/components/Divider/Divider.js +4 -5
- package/build/lib/web/development/components/Divider/Divider.js.map +1 -1
- package/build/lib/web/development/components/Drawer/Drawer.web.js +2 -2
- package/build/lib/web/development/components/Dropdown/Dropdown.js +2 -2
- package/build/lib/web/development/components/Dropdown/DropdownButton.js +2 -2
- package/build/lib/web/development/components/Dropdown/DropdownHeaderFooter.js +2 -2
- package/build/lib/web/development/components/Dropdown/DropdownLink.js +2 -2
- package/build/lib/web/development/components/Dropdown/DropdownOverlay.web.js +2 -2
- package/build/lib/web/development/components/Dropdown/useDropdown.js +2 -2
- package/build/lib/web/development/components/FileUpload/FileUpload.web.js +2 -2
- package/build/lib/web/development/components/FileUpload/FileUploadItemIcon.js +2 -2
- package/build/lib/web/development/components/FileUpload/StyledFileUploadItemWrapper.js +2 -2
- package/build/lib/web/development/components/FileUpload/StyledFileUploadWrapper.js +2 -2
- package/build/lib/web/development/components/Form/FormLabel.js +2 -2
- package/build/lib/web/development/components/Form/Selector/SelectorGroupField.js +2 -2
- package/build/lib/web/development/components/Form/Selector/SelectorInput.web.js +2 -2
- package/build/lib/web/development/components/Form/Selector/SelectorLabel.web.js +2 -2
- package/build/lib/web/development/components/Icons/ActivityIcon/ActivityIcon.js +2 -2
- package/build/lib/web/development/components/Icons/AirplayIcon/AirplayIcon.js +2 -2
- package/build/lib/web/development/components/Icons/AlertCircleIcon/AlertCircleIcon.js +2 -2
- package/build/lib/web/development/components/Icons/AlertOctagonIcon/AlertOctagonIcon.js +2 -2
- package/build/lib/web/development/components/Icons/AlertOnlyIcon/AlertOnlyIcon.js +2 -2
- package/build/lib/web/development/components/Icons/AlertTriangleIcon/AlertTriangleIcon.js +2 -2
- package/build/lib/web/development/components/Icons/AlignCenterIcon/AlignCenterIcon.js +2 -2
- package/build/lib/web/development/components/Icons/AlignJustifyIcon/AlignJustifyIcon.js +2 -2
- package/build/lib/web/development/components/Icons/AlignLeftIcon/AlignLeftIcon.js +2 -2
- package/build/lib/web/development/components/Icons/AlignRightIcon/AlignRightIcon.js +2 -2
- package/build/lib/web/development/components/Icons/AnchorIcon/AnchorIcon.js +2 -2
- package/build/lib/web/development/components/Icons/AnnouncementIcon/AnnouncementIcon.js +2 -2
- package/build/lib/web/development/components/Icons/ApertureIcon/ApertureIcon.js +2 -2
- package/build/lib/web/development/components/Icons/AppStoreIcon/AppStoreIcon.js +2 -2
- package/build/lib/web/development/components/Icons/ArrowDownIcon/ArrowDownIcon.js +2 -2
- package/build/lib/web/development/components/Icons/ArrowDownLeftIcon/ArrowDownLeftIcon.js +2 -2
- package/build/lib/web/development/components/Icons/ArrowDownRightIcon/ArrowDownRightIcon.js +2 -2
- package/build/lib/web/development/components/Icons/ArrowLeftIcon/ArrowLeftIcon.js +2 -2
- package/build/lib/web/development/components/Icons/ArrowRightIcon/ArrowRightIcon.js +2 -2
- package/build/lib/web/development/components/Icons/ArrowUpIcon/ArrowUpIcon.js +2 -2
- package/build/lib/web/development/components/Icons/ArrowUpLeftIcon/ArrowUpLeftIcon.js +2 -2
- package/build/lib/web/development/components/Icons/ArrowUpRightIcon/ArrowUpRightIcon.js +2 -2
- package/build/lib/web/development/components/Icons/AtSignIcon/AtSignIcon.js +2 -2
- package/build/lib/web/development/components/Icons/AttachmentIcon/AttachmentIcon.js +2 -2
- package/build/lib/web/development/components/Icons/AwardIcon/AwardIcon.js +2 -2
- package/build/lib/web/development/components/Icons/BankIcon/BankIcon.js +2 -2
- package/build/lib/web/development/components/Icons/BarChartAltIcon/BarChartAltIcon.js +2 -2
- package/build/lib/web/development/components/Icons/BarChartIcon/BarChartIcon.js +2 -2
- package/build/lib/web/development/components/Icons/BatteryChargingIcon/BatteryChargingIcon.js +2 -2
- package/build/lib/web/development/components/Icons/BatteryIcon/BatteryIcon.js +2 -2
- package/build/lib/web/development/components/Icons/BellIcon/BellIcon.js +2 -2
- package/build/lib/web/development/components/Icons/BellOffIcon/BellOffIcon.js +2 -2
- package/build/lib/web/development/components/Icons/BillIcon/BillIcon.js +2 -2
- package/build/lib/web/development/components/Icons/BluetoothIcon/BluetoothIcon.js +2 -2
- package/build/lib/web/development/components/Icons/BoldIcon/BoldIcon.js +2 -2
- package/build/lib/web/development/components/Icons/BookIcon/BookIcon.js +2 -2
- package/build/lib/web/development/components/Icons/BookmarkIcon/BookmarkIcon.js +2 -2
- package/build/lib/web/development/components/Icons/BoxIcon/BoxIcon.js +2 -2
- package/build/lib/web/development/components/Icons/BriefcaseIcon/BriefcaseIcon.js +2 -2
- package/build/lib/web/development/components/Icons/BulkPayoutsIcon/BulkPayoutsIcon.js +2 -2
- package/build/lib/web/development/components/Icons/CalendarIcon/CalendarIcon.js +2 -2
- package/build/lib/web/development/components/Icons/CameraIcon/CameraIcon.js +2 -2
- package/build/lib/web/development/components/Icons/CameraOffIcon/CameraOffIcon.js +2 -2
- package/build/lib/web/development/components/Icons/CastIcon/CastIcon.js +2 -2
- package/build/lib/web/development/components/Icons/CheckCircleIcon/CheckCircleIcon.js +2 -2
- package/build/lib/web/development/components/Icons/CheckIcon/CheckIcon.js +2 -2
- package/build/lib/web/development/components/Icons/CheckSquareIcon/CheckSquareIcon.js +2 -2
- package/build/lib/web/development/components/Icons/ChevronDownIcon/ChevronDownIcon.js +2 -2
- package/build/lib/web/development/components/Icons/ChevronLeftIcon/ChevronLeftIcon.js +2 -2
- package/build/lib/web/development/components/Icons/ChevronRightIcon/ChevronRightIcon.js +2 -2
- package/build/lib/web/development/components/Icons/ChevronUpIcon/ChevronUpIcon.js +2 -2
- package/build/lib/web/development/components/Icons/ChevronsDownIcon/ChevronsDownIcon.js +2 -2
- package/build/lib/web/development/components/Icons/ChevronsLeftIcon/ChevronsLeftIcon.js +2 -2
- package/build/lib/web/development/components/Icons/ChevronsRightIcon/ChevronsRightIcon.js +2 -2
- package/build/lib/web/development/components/Icons/ChevronsUpIcon/ChevronsUpIcon.js +2 -2
- package/build/lib/web/development/components/Icons/ChromeIcon/ChromeIcon.js +2 -2
- package/build/lib/web/development/components/Icons/CircleIcon/CircleIcon.js +2 -2
- package/build/lib/web/development/components/Icons/ClipboardIcon/ClipboardIcon.js +2 -2
- package/build/lib/web/development/components/Icons/ClockIcon/ClockIcon.js +2 -2
- package/build/lib/web/development/components/Icons/CloseIcon/CloseIcon.js +2 -2
- package/build/lib/web/development/components/Icons/CloudDrizzleIcon/CloudDrizzleIcon.js +2 -2
- package/build/lib/web/development/components/Icons/CloudIcon/CloudIcon.js +2 -2
- package/build/lib/web/development/components/Icons/CloudLightningIcon/CloudLightningIcon.js +2 -2
- package/build/lib/web/development/components/Icons/CloudOffIcon/CloudOffIcon.js +2 -2
- package/build/lib/web/development/components/Icons/CloudRainIcon/CloudRainIcon.js +2 -2
- package/build/lib/web/development/components/Icons/CloudSnowIcon/CloudSnowIcon.js +2 -2
- package/build/lib/web/development/components/Icons/CodepenIcon/CodepenIcon.js +2 -2
- package/build/lib/web/development/components/Icons/CoinsIcon/CoinsIcon.js +2 -2
- package/build/lib/web/development/components/Icons/CommandIcon/CommandIcon.js +2 -2
- package/build/lib/web/development/components/Icons/CompassIcon/CompassIcon.js +2 -2
- package/build/lib/web/development/components/Icons/CopyIcon/CopyIcon.js +2 -2
- package/build/lib/web/development/components/Icons/CornerDownLeftIcon/CornerDownLeftIcon.js +2 -2
- package/build/lib/web/development/components/Icons/CornerDownRightIcon/CornerDownRightIcon.js +2 -2
- package/build/lib/web/development/components/Icons/CornerLeftDownIcon/CornerLeftDownIcon.js +2 -2
- package/build/lib/web/development/components/Icons/CornerLeftUpIcon/CornerLeftUpIcon.js +2 -2
- package/build/lib/web/development/components/Icons/CornerRightDownIcon/CornerRightDownIcon.js +2 -2
- package/build/lib/web/development/components/Icons/CornerRightUpIcon/CornerRightUpIcon.js +2 -2
- package/build/lib/web/development/components/Icons/CornerUpLeftIcon/CornerUpLeftIcon.js +2 -2
- package/build/lib/web/development/components/Icons/CornerUpRightIcon/CornerUpRightIcon.js +2 -2
- package/build/lib/web/development/components/Icons/CpuIcon/CpuIcon.js +2 -2
- package/build/lib/web/development/components/Icons/CreditCardIcon/CreditCardIcon.js +2 -2
- package/build/lib/web/development/components/Icons/CropIcon/CropIcon.js +2 -2
- package/build/lib/web/development/components/Icons/CrosshairIcon/CrosshairIcon.js +2 -2
- package/build/lib/web/development/components/Icons/CustomersIcon/CustomersIcon.js +2 -2
- package/build/lib/web/development/components/Icons/CutIcon/CutIcon.js +2 -2
- package/build/lib/web/development/components/Icons/DashboardIcon/DashboardIcon.js +2 -2
- package/build/lib/web/development/components/Icons/DeleteIcon/DeleteIcon.js +2 -2
- package/build/lib/web/development/components/Icons/DiscIcon/DiscIcon.js +2 -2
- package/build/lib/web/development/components/Icons/DollarIcon/DollarIcon.js +2 -2
- package/build/lib/web/development/components/Icons/DollarsIcon/DollarsIcon.js +2 -2
- package/build/lib/web/development/components/Icons/DownloadCloudIcon/DownloadCloudIcon.js +2 -2
- package/build/lib/web/development/components/Icons/DownloadIcon/DownloadIcon.js +2 -2
- package/build/lib/web/development/components/Icons/DropletIcon/DropletIcon.js +2 -2
- package/build/lib/web/development/components/Icons/EditComposeIcon/EditComposeIcon.js +2 -2
- package/build/lib/web/development/components/Icons/EditIcon/EditIcon.js +2 -2
- package/build/lib/web/development/components/Icons/EditInlineIcon/EditInlineIcon.js +2 -2
- package/build/lib/web/development/components/Icons/ExportIcon/ExportIcon.js +2 -2
- package/build/lib/web/development/components/Icons/ExternalLinkIcon/ExternalLinkIcon.js +2 -2
- package/build/lib/web/development/components/Icons/EyeIcon/EyeIcon.js +2 -2
- package/build/lib/web/development/components/Icons/EyeOffIcon/EyeOffIcon.js +2 -2
- package/build/lib/web/development/components/Icons/FacebookIcon/FacebookIcon.js +2 -2
- package/build/lib/web/development/components/Icons/FastForwardIcon/FastForwardIcon.js +2 -2
- package/build/lib/web/development/components/Icons/FeatherIcon/FeatherIcon.js +2 -2
- package/build/lib/web/development/components/Icons/FileIcon/FileIcon.js +2 -2
- package/build/lib/web/development/components/Icons/FileMinusIcon/FileMinusIcon.js +2 -2
- package/build/lib/web/development/components/Icons/FilePlusIcon/FilePlusIcon.js +2 -2
- package/build/lib/web/development/components/Icons/FileTextIcon/FileTextIcon.js +2 -2
- package/build/lib/web/development/components/Icons/FileZipIcon/FileZipIcon.js +2 -2
- package/build/lib/web/development/components/Icons/FilmIcon/FilmIcon.js +2 -2
- package/build/lib/web/development/components/Icons/FilterIcon/FilterIcon.js +2 -2
- package/build/lib/web/development/components/Icons/FlagIcon/FlagIcon.js +2 -2
- package/build/lib/web/development/components/Icons/FolderIcon/FolderIcon.js +2 -2
- package/build/lib/web/development/components/Icons/FullScreenEnterIcon/FullScreenEnterIcon.js +2 -2
- package/build/lib/web/development/components/Icons/FullScreenExitIcon/FullScreenExitIcon.js +2 -2
- package/build/lib/web/development/components/Icons/GithubIcon/GithubIcon.js +2 -2
- package/build/lib/web/development/components/Icons/GitlabIcon/GitlabIcon.js +2 -2
- package/build/lib/web/development/components/Icons/GlobeIcon/GlobeIcon.js +2 -2
- package/build/lib/web/development/components/Icons/GridIcon/GridIcon.js +2 -2
- package/build/lib/web/development/components/Icons/HashIcon/HashIcon.js +2 -2
- package/build/lib/web/development/components/Icons/HeadphonesIcon/HeadphonesIcon.js +2 -2
- package/build/lib/web/development/components/Icons/HeartIcon/HeartIcon.js +2 -2
- package/build/lib/web/development/components/Icons/HelpCircleIcon/HelpCircleIcon.js +2 -2
- package/build/lib/web/development/components/Icons/HistoryIcon/HistoryIcon.js +2 -2
- package/build/lib/web/development/components/Icons/HomeIcon/HomeIcon.js +2 -2
- package/build/lib/web/development/components/Icons/ImageIcon/ImageIcon.js +2 -2
- package/build/lib/web/development/components/Icons/InboxIcon/InboxIcon.js +2 -2
- package/build/lib/web/development/components/Icons/InfoIcon/InfoIcon.js +2 -2
- package/build/lib/web/development/components/Icons/InstagramIcon/InstagramIcon.js +2 -2
- package/build/lib/web/development/components/Icons/InvoicesIcon/InvoicesIcon.js +2 -2
- package/build/lib/web/development/components/Icons/ItalicIcon/ItalicIcon.js +2 -2
- package/build/lib/web/development/components/Icons/LayersIcon/LayersIcon.js +2 -2
- package/build/lib/web/development/components/Icons/LayoutIcon/LayoutIcon.js +2 -2
- package/build/lib/web/development/components/Icons/LifeBuoyIcon/LifeBuoyIcon.js +2 -2
- package/build/lib/web/development/components/Icons/LinkIcon/LinkIcon.js +2 -2
- package/build/lib/web/development/components/Icons/ListIcon/ListIcon.js +2 -2
- package/build/lib/web/development/components/Icons/LoaderIcon/LoaderIcon.js +2 -2
- package/build/lib/web/development/components/Icons/LockIcon/LockIcon.js +2 -2
- package/build/lib/web/development/components/Icons/LogInIcon/LogInIcon.js +2 -2
- package/build/lib/web/development/components/Icons/LogOutIcon/LogOutIcon.js +2 -2
- package/build/lib/web/development/components/Icons/MailIcon/MailIcon.js +2 -2
- package/build/lib/web/development/components/Icons/MailOpenIcon/MailOpenIcon.js +2 -2
- package/build/lib/web/development/components/Icons/MapIcon/MapIcon.js +2 -2
- package/build/lib/web/development/components/Icons/MapPinIcon/MapPinIcon.js +2 -2
- package/build/lib/web/development/components/Icons/MaximizeIcon/MaximizeIcon.js +2 -2
- package/build/lib/web/development/components/Icons/MenuDotsIcon/MenuDotsIcon.js +2 -2
- package/build/lib/web/development/components/Icons/MenuIcon/MenuIcon.js +2 -2
- package/build/lib/web/development/components/Icons/MessageCircleIcon/MessageCircleIcon.js +2 -2
- package/build/lib/web/development/components/Icons/MessageSquareIcon/MessageSquareIcon.js +2 -2
- package/build/lib/web/development/components/Icons/MicIcon/MicIcon.js +2 -2
- package/build/lib/web/development/components/Icons/MicOffIcon/MicOffIcon.js +2 -2
- package/build/lib/web/development/components/Icons/MinimizeIcon/MinimizeIcon.js +2 -2
- package/build/lib/web/development/components/Icons/MinusCircleIcon/MinusCircleIcon.js +2 -2
- package/build/lib/web/development/components/Icons/MinusIcon/MinusIcon.js +2 -2
- package/build/lib/web/development/components/Icons/MinusSquareIcon/MinusSquareIcon.js +2 -2
- package/build/lib/web/development/components/Icons/MonitorIcon/MonitorIcon.js +2 -2
- package/build/lib/web/development/components/Icons/MoonIcon/MoonIcon.js +2 -2
- package/build/lib/web/development/components/Icons/MoreHorizontalIcon/MoreHorizontalIcon.js +2 -2
- package/build/lib/web/development/components/Icons/MoreVerticalIcon/MoreVerticalIcon.js +2 -2
- package/build/lib/web/development/components/Icons/MoveIcon/MoveIcon.js +2 -2
- package/build/lib/web/development/components/Icons/MusicIcon/MusicIcon.js +2 -2
- package/build/lib/web/development/components/Icons/MyAccountIcon/MyAccountIcon.js +2 -2
- package/build/lib/web/development/components/Icons/NavigationIcon/NavigationIcon.js +2 -2
- package/build/lib/web/development/components/Icons/OctagonIcon/OctagonIcon.js +2 -2
- package/build/lib/web/development/components/Icons/OffersIcon/OffersIcon.js +2 -2
- package/build/lib/web/development/components/Icons/PackageIcon/PackageIcon.js +2 -2
- package/build/lib/web/development/components/Icons/PaperclipIcon/PaperclipIcon.js +2 -2
- package/build/lib/web/development/components/Icons/PauseCircleIcon/PauseCircleIcon.js +2 -2
- package/build/lib/web/development/components/Icons/PauseIcon/PauseIcon.js +2 -2
- package/build/lib/web/development/components/Icons/PaymentButtonsIcon/PaymentButtonsIcon.js +2 -2
- package/build/lib/web/development/components/Icons/PaymentLinksIcon/PaymentLinksIcon.js +2 -2
- package/build/lib/web/development/components/Icons/PaymentPagesIcon/PaymentPagesIcon.js +2 -2
- package/build/lib/web/development/components/Icons/PercentIcon/PercentIcon.js +2 -2
- package/build/lib/web/development/components/Icons/PhoneCallIcon/PhoneCallIcon.js +2 -2
- package/build/lib/web/development/components/Icons/PhoneForwardedIcon/PhoneForwardedIcon.js +2 -2
- package/build/lib/web/development/components/Icons/PhoneIcon/PhoneIcon.js +2 -2
- package/build/lib/web/development/components/Icons/PhoneIncomingIcon/PhoneIncomingIcon.js +2 -2
- package/build/lib/web/development/components/Icons/PhoneMissedIcon/PhoneMissedIcon.js +2 -2
- package/build/lib/web/development/components/Icons/PhoneOffIcon/PhoneOffIcon.js +2 -2
- package/build/lib/web/development/components/Icons/PhoneOutgoingIcon/PhoneOutgoingIcon.js +2 -2
- package/build/lib/web/development/components/Icons/PieChartIcon/PieChartIcon.js +2 -2
- package/build/lib/web/development/components/Icons/PlayCircleIcon/PlayCircleIcon.js +2 -2
- package/build/lib/web/development/components/Icons/PlayIcon/PlayIcon.js +2 -2
- package/build/lib/web/development/components/Icons/PlusCircleIcon/PlusCircleIcon.js +2 -2
- package/build/lib/web/development/components/Icons/PlusIcon/PlusIcon.js +2 -2
- package/build/lib/web/development/components/Icons/PlusSquareIcon/PlusSquareIcon.js +2 -2
- package/build/lib/web/development/components/Icons/PocketIcon/PocketIcon.js +2 -2
- package/build/lib/web/development/components/Icons/PowerIcon/PowerIcon.js +2 -2
- package/build/lib/web/development/components/Icons/PrinterIcon/PrinterIcon.js +2 -2
- package/build/lib/web/development/components/Icons/QRCodeIcon/QRCodeIcon.js +2 -2
- package/build/lib/web/development/components/Icons/RadioIcon/RadioIcon.js +2 -2
- package/build/lib/web/development/components/Icons/RazorpayIcon/RazorpayIcon.js +2 -2
- package/build/lib/web/development/components/Icons/RazorpayXIcon/RazorpayXIcon.js +2 -2
- package/build/lib/web/development/components/Icons/RefreshIcon/RefreshIcon.js +2 -2
- package/build/lib/web/development/components/Icons/RepeatIcon/RepeatIcon.js +2 -2
- package/build/lib/web/development/components/Icons/ReportsIcon/ReportsIcon.js +2 -2
- package/build/lib/web/development/components/Icons/RewindIcon/RewindIcon.js +2 -2
- package/build/lib/web/development/components/Icons/RotateClockWiseIcon/RotateClockWiseIcon.js +2 -2
- package/build/lib/web/development/components/Icons/RotateCounterClockWiseIcon/RotateCounterClockWiseIcon.js +2 -2
- package/build/lib/web/development/components/Icons/RoutesIcon/RoutesIcon.js +2 -2
- package/build/lib/web/development/components/Icons/RupeeIcon/RupeeIcon.js +2 -2
- package/build/lib/web/development/components/Icons/RupeesIcon/RupeesIcon.js +2 -2
- package/build/lib/web/development/components/Icons/SaveIcon/SaveIcon.js +2 -2
- package/build/lib/web/development/components/Icons/ScissorsIcon/ScissorsIcon.js +2 -2
- package/build/lib/web/development/components/Icons/SearchIcon/SearchIcon.js +2 -2
- package/build/lib/web/development/components/Icons/SendIcon/SendIcon.js +2 -2
- package/build/lib/web/development/components/Icons/ServerIcon/ServerIcon.js +2 -2
- package/build/lib/web/development/components/Icons/SettingsIcon/SettingsIcon.js +2 -2
- package/build/lib/web/development/components/Icons/SettlementsIcon/SettlementsIcon.js +2 -2
- package/build/lib/web/development/components/Icons/ShareIcon/ShareIcon.js +2 -2
- package/build/lib/web/development/components/Icons/ShieldIcon/ShieldIcon.js +2 -2
- package/build/lib/web/development/components/Icons/ShoppingCartIcon/ShoppingCartIcon.js +2 -2
- package/build/lib/web/development/components/Icons/ShuffleIcon/ShuffleIcon.js +2 -2
- package/build/lib/web/development/components/Icons/SidebarIcon/SidebarIcon.js +2 -2
- package/build/lib/web/development/components/Icons/SkipBackIcon/SkipBackIcon.js +2 -2
- package/build/lib/web/development/components/Icons/SkipForwardIcon/SkipForwardIcon.js +2 -2
- package/build/lib/web/development/components/Icons/SlackIcon/SlackIcon.js +2 -2
- package/build/lib/web/development/components/Icons/SlashIcon/SlashIcon.js +2 -2
- package/build/lib/web/development/components/Icons/SlidersIcon/SlidersIcon.js +2 -2
- package/build/lib/web/development/components/Icons/SmartCollectIcon/SmartCollectIcon.js +2 -2
- package/build/lib/web/development/components/Icons/SmartphoneIcon/SmartphoneIcon.js +2 -2
- package/build/lib/web/development/components/Icons/SpeakerIcon/SpeakerIcon.js +2 -2
- package/build/lib/web/development/components/Icons/SquareIcon/SquareIcon.js +2 -2
- package/build/lib/web/development/components/Icons/StampIcon/StampIcon.js +2 -2
- package/build/lib/web/development/components/Icons/StarIcon/StarIcon.js +2 -2
- package/build/lib/web/development/components/Icons/StopCircleIcon/StopCircleIcon.js +2 -2
- package/build/lib/web/development/components/Icons/SubscriptionsIcon/SubscriptionsIcon.js +2 -2
- package/build/lib/web/development/components/Icons/SunIcon/SunIcon.js +2 -2
- package/build/lib/web/development/components/Icons/SunriseIcon/SunriseIcon.js +2 -2
- package/build/lib/web/development/components/Icons/SunsetIcon/SunsetIcon.js +2 -2
- package/build/lib/web/development/components/Icons/TabletIcon/TabletIcon.js +2 -2
- package/build/lib/web/development/components/Icons/TagIcon/TagIcon.js +2 -2
- package/build/lib/web/development/components/Icons/TargetIcon/TargetIcon.js +2 -2
- package/build/lib/web/development/components/Icons/ThermometerIcon/ThermometerIcon.js +2 -2
- package/build/lib/web/development/components/Icons/ThumbsDownIcon/ThumbsDownIcon.js +2 -2
- package/build/lib/web/development/components/Icons/ThumbsUpIcon/ThumbsUpIcon.js +2 -2
- package/build/lib/web/development/components/Icons/ToggleLeftIcon/ToggleLeftIcon.js +2 -2
- package/build/lib/web/development/components/Icons/ToggleRightIcon/ToggleRightIcon.js +2 -2
- package/build/lib/web/development/components/Icons/TransactionsIcon/TransactionsIcon.js +2 -2
- package/build/lib/web/development/components/Icons/TrashIcon/TrashIcon.js +2 -2
- package/build/lib/web/development/components/Icons/TrendingDownIcon/TrendingDownIcon.js +2 -2
- package/build/lib/web/development/components/Icons/TrendingUpIcon/TrendingUpIcon.js +2 -2
- package/build/lib/web/development/components/Icons/TriangleIcon/TriangleIcon.js +2 -2
- package/build/lib/web/development/components/Icons/TvIcon/TvIcon.js +2 -2
- package/build/lib/web/development/components/Icons/TwitterIcon/TwitterIcon.js +2 -2
- package/build/lib/web/development/components/Icons/TypeIcon/TypeIcon.js +2 -2
- package/build/lib/web/development/components/Icons/UmbrellaIcon/UmbrellaIcon.js +2 -2
- package/build/lib/web/development/components/Icons/UnderlineIcon/UnderlineIcon.js +2 -2
- package/build/lib/web/development/components/Icons/UnlockIcon/UnlockIcon.js +2 -2
- package/build/lib/web/development/components/Icons/UploadCloudIcon/UploadCloudIcon.js +2 -2
- package/build/lib/web/development/components/Icons/UploadIcon/UploadIcon.js +2 -2
- package/build/lib/web/development/components/Icons/UserCheckIcon/UserCheckIcon.js +2 -2
- package/build/lib/web/development/components/Icons/UserIcon/UserIcon.js +2 -2
- package/build/lib/web/development/components/Icons/UserMinusIcon/UserMinusIcon.js +2 -2
- package/build/lib/web/development/components/Icons/UserPlusIcon/UserPlusIcon.js +2 -2
- package/build/lib/web/development/components/Icons/UserXIcon/UserXIcon.js +2 -2
- package/build/lib/web/development/components/Icons/UsersIcon/UsersIcon.js +2 -2
- package/build/lib/web/development/components/Icons/VideoIcon/VideoIcon.js +2 -2
- package/build/lib/web/development/components/Icons/VideoOffIcon/VideoOffIcon.js +2 -2
- package/build/lib/web/development/components/Icons/VoicemailIcon/VoicemailIcon.js +2 -2
- package/build/lib/web/development/components/Icons/VolumeHighIcon/VolumeHighIcon.js +2 -2
- package/build/lib/web/development/components/Icons/VolumeIcon/VolumeIcon.js +2 -2
- package/build/lib/web/development/components/Icons/VolumeLowIcon/VolumeLowIcon.js +2 -2
- package/build/lib/web/development/components/Icons/VolumeMuteIcon/VolumeMuteIcon.js +2 -2
- package/build/lib/web/development/components/Icons/WatchIcon/WatchIcon.js +2 -2
- package/build/lib/web/development/components/Icons/WifiIcon/WifiIcon.js +2 -2
- package/build/lib/web/development/components/Icons/WifiOffIcon/WifiOffIcon.js +2 -2
- package/build/lib/web/development/components/Icons/WindIcon/WindIcon.js +2 -2
- package/build/lib/web/development/components/Icons/XCircleIcon/XCircleIcon.js +2 -2
- package/build/lib/web/development/components/Icons/XSquareIcon/XSquareIcon.js +2 -2
- package/build/lib/web/development/components/Icons/ZapIcon/ZapIcon.js +2 -2
- package/build/lib/web/development/components/Icons/ZoomInIcon/ZoomInIcon.js +2 -2
- package/build/lib/web/development/components/Icons/ZoomOutIcon/ZoomOutIcon.js +2 -2
- package/build/lib/web/development/components/Icons/_Svg/Circle/Circle.web.js +2 -2
- package/build/lib/web/development/components/Icons/_Svg/ClipPath/ClipPath.web.js +2 -2
- package/build/lib/web/development/components/Icons/_Svg/Defs/Defs.web.js +2 -2
- package/build/lib/web/development/components/Icons/_Svg/G/G.web.js +2 -2
- package/build/lib/web/development/components/Icons/_Svg/Path/Path.web.js +2 -2
- package/build/lib/web/development/components/Icons/_Svg/Rect/Rect.web.js +2 -2
- package/build/lib/web/development/components/Icons/_Svg/Svg/Svg.web.js +2 -2
- package/build/lib/web/development/components/Indicator/Indicator.js +2 -2
- package/build/lib/web/development/components/Input/BaseInput/AnimatedBaseInputWrapper.web.js +10 -4
- package/build/lib/web/development/components/Input/BaseInput/AnimatedBaseInputWrapper.web.js.map +1 -1
- package/build/lib/web/development/components/Input/BaseInput/BaseInput.js +15 -3
- package/build/lib/web/development/components/Input/BaseInput/BaseInput.js.map +1 -1
- package/build/lib/web/development/components/Input/BaseInput/BaseInputTagSlot.web.js +14 -1
- package/build/lib/web/development/components/Input/BaseInput/BaseInputTagSlot.web.js.map +1 -1
- package/build/lib/web/development/components/Input/BaseInput/BaseInputVisuals.js +2 -2
- package/build/lib/web/development/components/Input/BaseInput/BaseInputWrapper.js +6 -4
- package/build/lib/web/development/components/Input/BaseInput/BaseInputWrapper.js.map +1 -1
- package/build/lib/web/development/components/Input/BaseInput/StyledBaseInput.web.js +7 -4
- package/build/lib/web/development/components/Input/BaseInput/StyledBaseInput.web.js.map +1 -1
- package/build/lib/web/development/components/Input/BaseInput/baseInputStyles.js +4 -4
- package/build/lib/web/development/components/Input/BaseInput/baseInputStyles.js.map +1 -1
- package/build/lib/web/development/components/Input/BaseInput/useTaggedInput.js +172 -0
- package/build/lib/web/development/components/Input/BaseInput/useTaggedInput.js.map +1 -0
- package/build/lib/web/development/components/Input/DropdownInputTriggers/AutoComplete.js +2 -2
- package/build/lib/web/development/components/Input/DropdownInputTriggers/SelectInput.js +2 -2
- package/build/lib/web/development/components/Input/OTPInput/OTPInput.js +2 -2
- package/build/lib/web/development/components/Input/PasswordInput/PasswordInput.js +2 -2
- package/build/lib/web/development/components/Input/PhoneNumberInput/PhoneNumberInput.web.js +2 -2
- package/build/lib/web/development/components/Input/TextArea/TextArea.js +56 -10
- package/build/lib/web/development/components/Input/TextArea/TextArea.js.map +1 -1
- package/build/lib/web/development/components/Input/TextInput/TextInput.js +53 -7
- package/build/lib/web/development/components/Input/TextInput/TextInput.js.map +1 -1
- package/build/lib/web/development/components/Link/BaseLink/BaseLink.js +2 -2
- package/build/lib/web/development/components/Link/BaseLink/StyledBaseLink.web.js +2 -2
- package/build/lib/web/development/components/Link/Link/Link.js +2 -2
- package/build/lib/web/development/components/List/List.js +2 -3
- package/build/lib/web/development/components/List/List.js.map +1 -1
- package/build/lib/web/development/components/List/ListItem.js +2 -2
- package/build/lib/web/development/components/List/ListItemLink.js +2 -2
- package/build/lib/web/development/components/List/ListItemText.js +2 -2
- package/build/lib/web/development/components/LiveAnnouncer/LiveAnnouncer.web.js +1 -2
- package/build/lib/web/development/components/LiveAnnouncer/LiveAnnouncer.web.js.map +1 -1
- package/build/lib/web/development/components/Modal/Modal.web.js +2 -2
- package/build/lib/web/development/components/Modal/ModalBackdrop.js +2 -2
- package/build/lib/web/development/components/Modal/ModalBody.web.js +2 -2
- package/build/lib/web/development/components/Popover/Popover.web.js +2 -2
- package/build/lib/web/development/components/Popover/PopoverInteractiveWrapper.web.js +2 -2
- package/build/lib/web/development/components/Popover/getPopoverContentWrapperStyles.js +2 -2
- package/build/lib/web/development/components/ProgressBar/ProgressBar.js +2 -2
- package/build/lib/web/development/components/Radio/Radio.js +2 -2
- package/build/lib/web/development/components/Radio/RadioGroup/RadioGroup.js +2 -2
- package/build/lib/web/development/components/Radio/RadioIcon/RadioIcon.js +2 -2
- package/build/lib/web/development/components/Radio/RadioIcon/RadioIconWrapperStyles.js +2 -2
- package/build/lib/web/development/components/Radio/useRadio.js +2 -2
- package/build/lib/web/development/components/Skeleton/Skeleton.js +2 -2
- package/build/lib/web/development/components/SkipNav/SkipNav.web.js +2 -2
- package/build/lib/web/development/components/Spinner/BaseSpinner/BaseSpinner.js +2 -2
- package/build/lib/web/development/components/Spinner/Spinner/Spinner.js +2 -2
- package/build/lib/web/development/components/SpotlightPopoverTour/TourFooter.web.js +2 -2
- package/build/lib/web/development/components/SpotlightPopoverTour/TourMask.web.js +2 -2
- package/build/lib/web/development/components/SpotlightPopoverTour/TourPopover.web.js +2 -2
- package/build/lib/web/development/components/SpotlightPopoverTour/TourStep.web.js +2 -2
- package/build/lib/web/development/components/SpotlightPopoverTour/utils.js +2 -2
- package/build/lib/web/development/components/Switch/Switch.js +2 -2
- package/build/lib/web/development/components/Switch/SwitchTrack.web.js +2 -2
- package/build/lib/web/development/components/Switch/Thumb.js +2 -2
- package/build/lib/web/development/components/Table/Table.web.js +2 -2
- package/build/lib/web/development/components/Table/TableBody.web.js +2 -2
- package/build/lib/web/development/components/Table/TableFooter.web.js +2 -2
- package/build/lib/web/development/components/Table/TableHeader.web.js +2 -2
- package/build/lib/web/development/components/Table/TablePagination.web.js +2 -2
- package/build/lib/web/development/components/Table/TableToolbar.web.js +2 -2
- package/build/lib/web/development/components/Tabs/TabIndicator.web.js +2 -2
- package/build/lib/web/development/components/Tabs/TabItem.web.js +9 -9
- 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/TabPanel.web.js +2 -2
- package/build/lib/web/development/components/Tabs/Tabs.web.js +2 -2
- package/build/lib/web/development/components/Tag/AnimatedTag.web.js +2 -3
- package/build/lib/web/development/components/Tag/AnimatedTag.web.js.map +1 -1
- package/build/lib/web/development/components/Tag/Tag.js +7 -8
- package/build/lib/web/development/components/Tag/Tag.js.map +1 -1
- package/build/lib/web/development/components/Tag/getTagsGroup.js +1 -1
- package/build/lib/web/development/components/Tag/getTagsGroup.js.map +1 -1
- package/build/lib/web/development/components/Tag/tagAnimationConfig.js +4 -2
- package/build/lib/web/development/components/Tag/tagAnimationConfig.js.map +1 -1
- package/build/lib/web/development/components/Toast/Toast.web.js +2 -2
- package/build/lib/web/development/components/Toast/ToastContainer.web.js +2 -2
- package/build/lib/web/development/components/Toast/useToast.js +2 -2
- package/build/lib/web/development/components/Tooltip/Tooltip.web.js +2 -2
- package/build/lib/web/development/components/Tooltip/TooltipInteractiveWrapper.web.js +2 -2
- package/build/lib/web/development/components/Tooltip/getTooltipContentWrapperStyles.js +2 -2
- package/build/lib/web/development/components/Typography/BaseText/BaseText.web.js +2 -2
- package/build/lib/web/development/components/Typography/BaseText/getBaseTextStyles.js +4 -3
- package/build/lib/web/development/components/Typography/BaseText/getBaseTextStyles.js.map +1 -1
- package/build/lib/web/development/components/Typography/Code/Code.js +2 -2
- package/build/lib/web/development/components/Typography/Display/Display.js +2 -2
- package/build/lib/web/development/components/Typography/Heading/Heading.js +2 -2
- package/build/lib/web/development/components/Typography/Heading/getHeadingStyles.js +2 -2
- package/build/lib/web/development/components/Typography/Text/Text.js +2 -2
- package/build/lib/web/development/components/Typography/Text/getTextStyles.js +2 -2
- package/build/lib/web/development/components/VisuallyHidden/VisuallyHidden.web.js +2 -2
- package/build/lib/web/development/tokens/global/border.js +0 -1
- package/build/lib/web/development/tokens/global/border.js.map +1 -1
- package/build/lib/web/development/tokens/global/typography.js +2 -2
- package/build/lib/web/development/tokens/theme/createTheme.js +2 -3
- package/build/lib/web/development/tokens/theme/createTheme.js.map +1 -1
- package/build/lib/web/development/utils/bladeCoverage.js +1 -1
- package/build/lib/web/development/utils/bladeCoverage.js.map +1 -1
- package/build/lib/web/development/utils/makeAccessible/accessibilityMapWeb.js +2 -2
- package/build/lib/web/development/utils/mergeProps.js +19 -18
- package/build/lib/web/development/utils/mergeProps.js.map +1 -1
- package/build/lib/web/development/utils/metaAttribute/metaAttribute.web.js +2 -2
- package/build/lib/web/production/components/Accordion/Accordion.js +2 -2
- package/build/lib/web/production/components/Accordion/AccordionButton.web.js +2 -2
- package/build/lib/web/production/components/Accordion/AccordionItem.js +2 -2
- package/build/lib/web/production/components/Accordion/AccordionItemBody.js +2 -2
- package/build/lib/web/production/components/Accordion/AccordionItemHeader.js +2 -2
- package/build/lib/web/production/components/Accordion/StyledAccordionButton.web.js +2 -2
- package/build/lib/web/production/components/ActionList/ActionList.js +2 -2
- package/build/lib/web/production/components/ActionList/ActionListBox.web.js +2 -2
- package/build/lib/web/production/components/ActionList/ActionListItem.js +2 -2
- package/build/lib/web/production/components/ActionList/actionListUtils.js +2 -2
- package/build/lib/web/production/components/ActionList/styles/StyledActionListItem.web.js +2 -2
- package/build/lib/web/production/components/ActionList/styles/StyledListBoxWrapper.web.js +4 -5
- package/build/lib/web/production/components/ActionList/styles/StyledListBoxWrapper.web.js.map +1 -1
- package/build/lib/web/production/components/Alert/Alert.js +2 -2
- package/build/lib/web/production/components/Amount/Amount.js +5 -3
- package/build/lib/web/production/components/Amount/Amount.js.map +1 -1
- package/build/lib/web/production/components/Badge/Badge.js +2 -2
- package/build/lib/web/production/components/Badge/StyledBadge.web.js +2 -2
- package/build/lib/web/production/components/BaseHeaderFooter/BaseFooter.js +2 -2
- package/build/lib/web/production/components/BaseHeaderFooter/BaseHeader.js +2 -2
- package/build/lib/web/production/components/BladeProvider/useBladeProvider.js +2 -2
- package/build/lib/web/production/components/BottomSheet/BottomSheet.web.js +2 -2
- package/build/lib/web/production/components/BottomSheet/BottomSheetBackdrop.web.js +2 -2
- package/build/lib/web/production/components/BottomSheet/BottomSheetBody.web.js +2 -2
- package/build/lib/web/production/components/BottomSheet/BottomSheetCommon.js +2 -2
- package/build/lib/web/production/components/BottomSheet/BottomSheetFooter.web.js +2 -2
- package/build/lib/web/production/components/BottomSheet/BottomSheetHeader.web.js +2 -2
- package/build/lib/web/production/components/BottomSheet/getBottomSheetGrabHandleStyles.js +2 -2
- package/build/lib/web/production/components/Box/BaseBox/BaseBox.web.js +2 -2
- package/build/lib/web/production/components/Box/BaseBox/baseBoxStyles.js +4 -3
- package/build/lib/web/production/components/Box/BaseBox/baseBoxStyles.js.map +1 -1
- package/build/lib/web/production/components/Box/BaseBox/types/propsTypes.js.map +1 -1
- package/build/lib/web/production/components/Box/BaseBox/useMemoizedStyles.web.js +2 -2
- package/build/lib/web/production/components/Box/Box.js +2 -2
- package/build/lib/web/production/components/Box/styledProps/getStyledProps.js +3 -1
- package/build/lib/web/production/components/Box/styledProps/getStyledProps.js.map +1 -1
- package/build/lib/web/production/components/Box/styledProps/useStyledProps.js +4 -3
- package/build/lib/web/production/components/Box/styledProps/useStyledProps.js.map +1 -1
- package/build/lib/web/production/components/Breadcrumb/Breadcrumb.web.js +2 -2
- package/build/lib/web/production/components/Button/BaseButton/BaseButton.js +2 -3
- package/build/lib/web/production/components/Button/BaseButton/BaseButton.js.map +1 -1
- package/build/lib/web/production/components/Button/BaseButton/StyledBaseButton.web.js +2 -2
- package/build/lib/web/production/components/Button/Button/Button.js +2 -2
- package/build/lib/web/production/components/Button/IconButton/StyledIconButton.web.js +2 -2
- package/build/lib/web/production/components/ButtonGroup/ButtonGroup.web.js +2 -3
- package/build/lib/web/production/components/ButtonGroup/ButtonGroup.web.js.map +1 -1
- package/build/lib/web/production/components/Card/Card.js +2 -2
- package/build/lib/web/production/components/Card/CardFooter.js +2 -2
- package/build/lib/web/production/components/Card/CardHeader.js +2 -2
- package/build/lib/web/production/components/Card/CardRoot.web.js +5 -6
- package/build/lib/web/production/components/Card/CardRoot.web.js.map +1 -1
- package/build/lib/web/production/components/Carousel/Carousel.web.js +2 -2
- package/build/lib/web/production/components/Carousel/CarouselItem.web.js +2 -2
- package/build/lib/web/production/components/Carousel/Indicators/IndicatorButton.js +2 -2
- package/build/lib/web/production/components/Carousel/Indicators/Indicators.js +2 -2
- package/build/lib/web/production/components/Carousel/Indicators/getIndicatorButtonStyles.js +2 -2
- package/build/lib/web/production/components/Carousel/NavigationButton/NavigationButton.js +2 -2
- package/build/lib/web/production/components/Carousel/NavigationButton/getNavigationButtonStyles.js +2 -2
- package/build/lib/web/production/components/Checkbox/Checkbox.js +2 -2
- package/build/lib/web/production/components/Checkbox/CheckboxGroup/CheckboxGroup.js +2 -2
- package/build/lib/web/production/components/Checkbox/CheckboxIcon/CheckboxIcon.js +2 -2
- package/build/lib/web/production/components/Checkbox/CheckboxIcon/Fade.web.js +2 -2
- package/build/lib/web/production/components/Checkbox/useCheckbox.js +2 -2
- package/build/lib/web/production/components/Chip/AnimatedChip.web.js +2 -2
- package/build/lib/web/production/components/Chip/Chip.js +2 -2
- package/build/lib/web/production/components/Chip/ChipGroup.js +2 -2
- package/build/lib/web/production/components/Chip/StyledChipWrapper.web.js +2 -2
- package/build/lib/web/production/components/Collapsible/Collapsible.js +2 -2
- package/build/lib/web/production/components/Collapsible/CollapsibleBody.js +2 -2
- package/build/lib/web/production/components/Collapsible/CollapsibleBodyContent.web.js +2 -2
- package/build/lib/web/production/components/Collapsible/CollapsibleChevronIcon.web.js +2 -2
- package/build/lib/web/production/components/Counter/Counter.js +2 -2
- package/build/lib/web/production/components/Counter/StyledCounter.web.js +2 -2
- package/build/lib/web/production/components/Divider/Divider.js +4 -5
- package/build/lib/web/production/components/Divider/Divider.js.map +1 -1
- package/build/lib/web/production/components/Drawer/Drawer.web.js +2 -2
- package/build/lib/web/production/components/Dropdown/Dropdown.js +2 -2
- package/build/lib/web/production/components/Dropdown/DropdownButton.js +2 -2
- package/build/lib/web/production/components/Dropdown/DropdownHeaderFooter.js +2 -2
- package/build/lib/web/production/components/Dropdown/DropdownLink.js +2 -2
- package/build/lib/web/production/components/Dropdown/DropdownOverlay.web.js +2 -2
- package/build/lib/web/production/components/Dropdown/useDropdown.js +2 -2
- package/build/lib/web/production/components/FileUpload/FileUpload.web.js +2 -2
- package/build/lib/web/production/components/FileUpload/FileUploadItemIcon.js +2 -2
- package/build/lib/web/production/components/FileUpload/StyledFileUploadItemWrapper.js +2 -2
- package/build/lib/web/production/components/FileUpload/StyledFileUploadWrapper.js +2 -2
- package/build/lib/web/production/components/Form/FormLabel.js +2 -2
- package/build/lib/web/production/components/Form/Selector/SelectorGroupField.js +2 -2
- package/build/lib/web/production/components/Form/Selector/SelectorInput.web.js +2 -2
- package/build/lib/web/production/components/Form/Selector/SelectorLabel.web.js +2 -2
- package/build/lib/web/production/components/Icons/ActivityIcon/ActivityIcon.js +2 -2
- package/build/lib/web/production/components/Icons/AirplayIcon/AirplayIcon.js +2 -2
- package/build/lib/web/production/components/Icons/AlertCircleIcon/AlertCircleIcon.js +2 -2
- package/build/lib/web/production/components/Icons/AlertOctagonIcon/AlertOctagonIcon.js +2 -2
- package/build/lib/web/production/components/Icons/AlertOnlyIcon/AlertOnlyIcon.js +2 -2
- package/build/lib/web/production/components/Icons/AlertTriangleIcon/AlertTriangleIcon.js +2 -2
- package/build/lib/web/production/components/Icons/AlignCenterIcon/AlignCenterIcon.js +2 -2
- package/build/lib/web/production/components/Icons/AlignJustifyIcon/AlignJustifyIcon.js +2 -2
- package/build/lib/web/production/components/Icons/AlignLeftIcon/AlignLeftIcon.js +2 -2
- package/build/lib/web/production/components/Icons/AlignRightIcon/AlignRightIcon.js +2 -2
- package/build/lib/web/production/components/Icons/AnchorIcon/AnchorIcon.js +2 -2
- package/build/lib/web/production/components/Icons/AnnouncementIcon/AnnouncementIcon.js +2 -2
- package/build/lib/web/production/components/Icons/ApertureIcon/ApertureIcon.js +2 -2
- package/build/lib/web/production/components/Icons/AppStoreIcon/AppStoreIcon.js +2 -2
- package/build/lib/web/production/components/Icons/ArrowDownIcon/ArrowDownIcon.js +2 -2
- package/build/lib/web/production/components/Icons/ArrowDownLeftIcon/ArrowDownLeftIcon.js +2 -2
- package/build/lib/web/production/components/Icons/ArrowDownRightIcon/ArrowDownRightIcon.js +2 -2
- package/build/lib/web/production/components/Icons/ArrowLeftIcon/ArrowLeftIcon.js +2 -2
- package/build/lib/web/production/components/Icons/ArrowRightIcon/ArrowRightIcon.js +2 -2
- package/build/lib/web/production/components/Icons/ArrowUpIcon/ArrowUpIcon.js +2 -2
- package/build/lib/web/production/components/Icons/ArrowUpLeftIcon/ArrowUpLeftIcon.js +2 -2
- package/build/lib/web/production/components/Icons/ArrowUpRightIcon/ArrowUpRightIcon.js +2 -2
- package/build/lib/web/production/components/Icons/AtSignIcon/AtSignIcon.js +2 -2
- package/build/lib/web/production/components/Icons/AttachmentIcon/AttachmentIcon.js +2 -2
- package/build/lib/web/production/components/Icons/AwardIcon/AwardIcon.js +2 -2
- package/build/lib/web/production/components/Icons/BankIcon/BankIcon.js +2 -2
- package/build/lib/web/production/components/Icons/BarChartAltIcon/BarChartAltIcon.js +2 -2
- package/build/lib/web/production/components/Icons/BarChartIcon/BarChartIcon.js +2 -2
- package/build/lib/web/production/components/Icons/BatteryChargingIcon/BatteryChargingIcon.js +2 -2
- package/build/lib/web/production/components/Icons/BatteryIcon/BatteryIcon.js +2 -2
- package/build/lib/web/production/components/Icons/BellIcon/BellIcon.js +2 -2
- package/build/lib/web/production/components/Icons/BellOffIcon/BellOffIcon.js +2 -2
- package/build/lib/web/production/components/Icons/BillIcon/BillIcon.js +2 -2
- package/build/lib/web/production/components/Icons/BluetoothIcon/BluetoothIcon.js +2 -2
- package/build/lib/web/production/components/Icons/BoldIcon/BoldIcon.js +2 -2
- package/build/lib/web/production/components/Icons/BookIcon/BookIcon.js +2 -2
- package/build/lib/web/production/components/Icons/BookmarkIcon/BookmarkIcon.js +2 -2
- package/build/lib/web/production/components/Icons/BoxIcon/BoxIcon.js +2 -2
- package/build/lib/web/production/components/Icons/BriefcaseIcon/BriefcaseIcon.js +2 -2
- package/build/lib/web/production/components/Icons/BulkPayoutsIcon/BulkPayoutsIcon.js +2 -2
- package/build/lib/web/production/components/Icons/CalendarIcon/CalendarIcon.js +2 -2
- package/build/lib/web/production/components/Icons/CameraIcon/CameraIcon.js +2 -2
- package/build/lib/web/production/components/Icons/CameraOffIcon/CameraOffIcon.js +2 -2
- package/build/lib/web/production/components/Icons/CastIcon/CastIcon.js +2 -2
- package/build/lib/web/production/components/Icons/CheckCircleIcon/CheckCircleIcon.js +2 -2
- package/build/lib/web/production/components/Icons/CheckIcon/CheckIcon.js +2 -2
- package/build/lib/web/production/components/Icons/CheckSquareIcon/CheckSquareIcon.js +2 -2
- package/build/lib/web/production/components/Icons/ChevronDownIcon/ChevronDownIcon.js +2 -2
- package/build/lib/web/production/components/Icons/ChevronLeftIcon/ChevronLeftIcon.js +2 -2
- package/build/lib/web/production/components/Icons/ChevronRightIcon/ChevronRightIcon.js +2 -2
- package/build/lib/web/production/components/Icons/ChevronUpIcon/ChevronUpIcon.js +2 -2
- package/build/lib/web/production/components/Icons/ChevronsDownIcon/ChevronsDownIcon.js +2 -2
- package/build/lib/web/production/components/Icons/ChevronsLeftIcon/ChevronsLeftIcon.js +2 -2
- package/build/lib/web/production/components/Icons/ChevronsRightIcon/ChevronsRightIcon.js +2 -2
- package/build/lib/web/production/components/Icons/ChevronsUpIcon/ChevronsUpIcon.js +2 -2
- package/build/lib/web/production/components/Icons/ChromeIcon/ChromeIcon.js +2 -2
- package/build/lib/web/production/components/Icons/CircleIcon/CircleIcon.js +2 -2
- package/build/lib/web/production/components/Icons/ClipboardIcon/ClipboardIcon.js +2 -2
- package/build/lib/web/production/components/Icons/ClockIcon/ClockIcon.js +2 -2
- package/build/lib/web/production/components/Icons/CloseIcon/CloseIcon.js +2 -2
- package/build/lib/web/production/components/Icons/CloudDrizzleIcon/CloudDrizzleIcon.js +2 -2
- package/build/lib/web/production/components/Icons/CloudIcon/CloudIcon.js +2 -2
- package/build/lib/web/production/components/Icons/CloudLightningIcon/CloudLightningIcon.js +2 -2
- package/build/lib/web/production/components/Icons/CloudOffIcon/CloudOffIcon.js +2 -2
- package/build/lib/web/production/components/Icons/CloudRainIcon/CloudRainIcon.js +2 -2
- package/build/lib/web/production/components/Icons/CloudSnowIcon/CloudSnowIcon.js +2 -2
- package/build/lib/web/production/components/Icons/CodepenIcon/CodepenIcon.js +2 -2
- package/build/lib/web/production/components/Icons/CoinsIcon/CoinsIcon.js +2 -2
- package/build/lib/web/production/components/Icons/CommandIcon/CommandIcon.js +2 -2
- package/build/lib/web/production/components/Icons/CompassIcon/CompassIcon.js +2 -2
- package/build/lib/web/production/components/Icons/CopyIcon/CopyIcon.js +2 -2
- package/build/lib/web/production/components/Icons/CornerDownLeftIcon/CornerDownLeftIcon.js +2 -2
- package/build/lib/web/production/components/Icons/CornerDownRightIcon/CornerDownRightIcon.js +2 -2
- package/build/lib/web/production/components/Icons/CornerLeftDownIcon/CornerLeftDownIcon.js +2 -2
- package/build/lib/web/production/components/Icons/CornerLeftUpIcon/CornerLeftUpIcon.js +2 -2
- package/build/lib/web/production/components/Icons/CornerRightDownIcon/CornerRightDownIcon.js +2 -2
- package/build/lib/web/production/components/Icons/CornerRightUpIcon/CornerRightUpIcon.js +2 -2
- package/build/lib/web/production/components/Icons/CornerUpLeftIcon/CornerUpLeftIcon.js +2 -2
- package/build/lib/web/production/components/Icons/CornerUpRightIcon/CornerUpRightIcon.js +2 -2
- package/build/lib/web/production/components/Icons/CpuIcon/CpuIcon.js +2 -2
- package/build/lib/web/production/components/Icons/CreditCardIcon/CreditCardIcon.js +2 -2
- package/build/lib/web/production/components/Icons/CropIcon/CropIcon.js +2 -2
- package/build/lib/web/production/components/Icons/CrosshairIcon/CrosshairIcon.js +2 -2
- package/build/lib/web/production/components/Icons/CustomersIcon/CustomersIcon.js +2 -2
- package/build/lib/web/production/components/Icons/CutIcon/CutIcon.js +2 -2
- package/build/lib/web/production/components/Icons/DashboardIcon/DashboardIcon.js +2 -2
- package/build/lib/web/production/components/Icons/DeleteIcon/DeleteIcon.js +2 -2
- package/build/lib/web/production/components/Icons/DiscIcon/DiscIcon.js +2 -2
- package/build/lib/web/production/components/Icons/DollarIcon/DollarIcon.js +2 -2
- package/build/lib/web/production/components/Icons/DollarsIcon/DollarsIcon.js +2 -2
- package/build/lib/web/production/components/Icons/DownloadCloudIcon/DownloadCloudIcon.js +2 -2
- package/build/lib/web/production/components/Icons/DownloadIcon/DownloadIcon.js +2 -2
- package/build/lib/web/production/components/Icons/DropletIcon/DropletIcon.js +2 -2
- package/build/lib/web/production/components/Icons/EditComposeIcon/EditComposeIcon.js +2 -2
- package/build/lib/web/production/components/Icons/EditIcon/EditIcon.js +2 -2
- package/build/lib/web/production/components/Icons/EditInlineIcon/EditInlineIcon.js +2 -2
- package/build/lib/web/production/components/Icons/ExportIcon/ExportIcon.js +2 -2
- package/build/lib/web/production/components/Icons/ExternalLinkIcon/ExternalLinkIcon.js +2 -2
- package/build/lib/web/production/components/Icons/EyeIcon/EyeIcon.js +2 -2
- package/build/lib/web/production/components/Icons/EyeOffIcon/EyeOffIcon.js +2 -2
- package/build/lib/web/production/components/Icons/FacebookIcon/FacebookIcon.js +2 -2
- package/build/lib/web/production/components/Icons/FastForwardIcon/FastForwardIcon.js +2 -2
- package/build/lib/web/production/components/Icons/FeatherIcon/FeatherIcon.js +2 -2
- package/build/lib/web/production/components/Icons/FileIcon/FileIcon.js +2 -2
- package/build/lib/web/production/components/Icons/FileMinusIcon/FileMinusIcon.js +2 -2
- package/build/lib/web/production/components/Icons/FilePlusIcon/FilePlusIcon.js +2 -2
- package/build/lib/web/production/components/Icons/FileTextIcon/FileTextIcon.js +2 -2
- package/build/lib/web/production/components/Icons/FileZipIcon/FileZipIcon.js +2 -2
- package/build/lib/web/production/components/Icons/FilmIcon/FilmIcon.js +2 -2
- package/build/lib/web/production/components/Icons/FilterIcon/FilterIcon.js +2 -2
- package/build/lib/web/production/components/Icons/FlagIcon/FlagIcon.js +2 -2
- package/build/lib/web/production/components/Icons/FolderIcon/FolderIcon.js +2 -2
- package/build/lib/web/production/components/Icons/FullScreenEnterIcon/FullScreenEnterIcon.js +2 -2
- package/build/lib/web/production/components/Icons/FullScreenExitIcon/FullScreenExitIcon.js +2 -2
- package/build/lib/web/production/components/Icons/GithubIcon/GithubIcon.js +2 -2
- package/build/lib/web/production/components/Icons/GitlabIcon/GitlabIcon.js +2 -2
- package/build/lib/web/production/components/Icons/GlobeIcon/GlobeIcon.js +2 -2
- package/build/lib/web/production/components/Icons/GridIcon/GridIcon.js +2 -2
- package/build/lib/web/production/components/Icons/HashIcon/HashIcon.js +2 -2
- package/build/lib/web/production/components/Icons/HeadphonesIcon/HeadphonesIcon.js +2 -2
- package/build/lib/web/production/components/Icons/HeartIcon/HeartIcon.js +2 -2
- package/build/lib/web/production/components/Icons/HelpCircleIcon/HelpCircleIcon.js +2 -2
- package/build/lib/web/production/components/Icons/HistoryIcon/HistoryIcon.js +2 -2
- package/build/lib/web/production/components/Icons/HomeIcon/HomeIcon.js +2 -2
- package/build/lib/web/production/components/Icons/ImageIcon/ImageIcon.js +2 -2
- package/build/lib/web/production/components/Icons/InboxIcon/InboxIcon.js +2 -2
- package/build/lib/web/production/components/Icons/InfoIcon/InfoIcon.js +2 -2
- package/build/lib/web/production/components/Icons/InstagramIcon/InstagramIcon.js +2 -2
- package/build/lib/web/production/components/Icons/InvoicesIcon/InvoicesIcon.js +2 -2
- package/build/lib/web/production/components/Icons/ItalicIcon/ItalicIcon.js +2 -2
- package/build/lib/web/production/components/Icons/LayersIcon/LayersIcon.js +2 -2
- package/build/lib/web/production/components/Icons/LayoutIcon/LayoutIcon.js +2 -2
- package/build/lib/web/production/components/Icons/LifeBuoyIcon/LifeBuoyIcon.js +2 -2
- package/build/lib/web/production/components/Icons/LinkIcon/LinkIcon.js +2 -2
- package/build/lib/web/production/components/Icons/ListIcon/ListIcon.js +2 -2
- package/build/lib/web/production/components/Icons/LoaderIcon/LoaderIcon.js +2 -2
- package/build/lib/web/production/components/Icons/LockIcon/LockIcon.js +2 -2
- package/build/lib/web/production/components/Icons/LogInIcon/LogInIcon.js +2 -2
- package/build/lib/web/production/components/Icons/LogOutIcon/LogOutIcon.js +2 -2
- package/build/lib/web/production/components/Icons/MailIcon/MailIcon.js +2 -2
- package/build/lib/web/production/components/Icons/MailOpenIcon/MailOpenIcon.js +2 -2
- package/build/lib/web/production/components/Icons/MapIcon/MapIcon.js +2 -2
- package/build/lib/web/production/components/Icons/MapPinIcon/MapPinIcon.js +2 -2
- package/build/lib/web/production/components/Icons/MaximizeIcon/MaximizeIcon.js +2 -2
- package/build/lib/web/production/components/Icons/MenuDotsIcon/MenuDotsIcon.js +2 -2
- package/build/lib/web/production/components/Icons/MenuIcon/MenuIcon.js +2 -2
- package/build/lib/web/production/components/Icons/MessageCircleIcon/MessageCircleIcon.js +2 -2
- package/build/lib/web/production/components/Icons/MessageSquareIcon/MessageSquareIcon.js +2 -2
- package/build/lib/web/production/components/Icons/MicIcon/MicIcon.js +2 -2
- package/build/lib/web/production/components/Icons/MicOffIcon/MicOffIcon.js +2 -2
- package/build/lib/web/production/components/Icons/MinimizeIcon/MinimizeIcon.js +2 -2
- package/build/lib/web/production/components/Icons/MinusCircleIcon/MinusCircleIcon.js +2 -2
- package/build/lib/web/production/components/Icons/MinusIcon/MinusIcon.js +2 -2
- package/build/lib/web/production/components/Icons/MinusSquareIcon/MinusSquareIcon.js +2 -2
- package/build/lib/web/production/components/Icons/MonitorIcon/MonitorIcon.js +2 -2
- package/build/lib/web/production/components/Icons/MoonIcon/MoonIcon.js +2 -2
- package/build/lib/web/production/components/Icons/MoreHorizontalIcon/MoreHorizontalIcon.js +2 -2
- package/build/lib/web/production/components/Icons/MoreVerticalIcon/MoreVerticalIcon.js +2 -2
- package/build/lib/web/production/components/Icons/MoveIcon/MoveIcon.js +2 -2
- package/build/lib/web/production/components/Icons/MusicIcon/MusicIcon.js +2 -2
- package/build/lib/web/production/components/Icons/MyAccountIcon/MyAccountIcon.js +2 -2
- package/build/lib/web/production/components/Icons/NavigationIcon/NavigationIcon.js +2 -2
- package/build/lib/web/production/components/Icons/OctagonIcon/OctagonIcon.js +2 -2
- package/build/lib/web/production/components/Icons/OffersIcon/OffersIcon.js +2 -2
- package/build/lib/web/production/components/Icons/PackageIcon/PackageIcon.js +2 -2
- package/build/lib/web/production/components/Icons/PaperclipIcon/PaperclipIcon.js +2 -2
- package/build/lib/web/production/components/Icons/PauseCircleIcon/PauseCircleIcon.js +2 -2
- package/build/lib/web/production/components/Icons/PauseIcon/PauseIcon.js +2 -2
- package/build/lib/web/production/components/Icons/PaymentButtonsIcon/PaymentButtonsIcon.js +2 -2
- package/build/lib/web/production/components/Icons/PaymentLinksIcon/PaymentLinksIcon.js +2 -2
- package/build/lib/web/production/components/Icons/PaymentPagesIcon/PaymentPagesIcon.js +2 -2
- package/build/lib/web/production/components/Icons/PercentIcon/PercentIcon.js +2 -2
- package/build/lib/web/production/components/Icons/PhoneCallIcon/PhoneCallIcon.js +2 -2
- package/build/lib/web/production/components/Icons/PhoneForwardedIcon/PhoneForwardedIcon.js +2 -2
- package/build/lib/web/production/components/Icons/PhoneIcon/PhoneIcon.js +2 -2
- package/build/lib/web/production/components/Icons/PhoneIncomingIcon/PhoneIncomingIcon.js +2 -2
- package/build/lib/web/production/components/Icons/PhoneMissedIcon/PhoneMissedIcon.js +2 -2
- package/build/lib/web/production/components/Icons/PhoneOffIcon/PhoneOffIcon.js +2 -2
- package/build/lib/web/production/components/Icons/PhoneOutgoingIcon/PhoneOutgoingIcon.js +2 -2
- package/build/lib/web/production/components/Icons/PieChartIcon/PieChartIcon.js +2 -2
- package/build/lib/web/production/components/Icons/PlayCircleIcon/PlayCircleIcon.js +2 -2
- package/build/lib/web/production/components/Icons/PlayIcon/PlayIcon.js +2 -2
- package/build/lib/web/production/components/Icons/PlusCircleIcon/PlusCircleIcon.js +2 -2
- package/build/lib/web/production/components/Icons/PlusIcon/PlusIcon.js +2 -2
- package/build/lib/web/production/components/Icons/PlusSquareIcon/PlusSquareIcon.js +2 -2
- package/build/lib/web/production/components/Icons/PocketIcon/PocketIcon.js +2 -2
- package/build/lib/web/production/components/Icons/PowerIcon/PowerIcon.js +2 -2
- package/build/lib/web/production/components/Icons/PrinterIcon/PrinterIcon.js +2 -2
- package/build/lib/web/production/components/Icons/QRCodeIcon/QRCodeIcon.js +2 -2
- package/build/lib/web/production/components/Icons/RadioIcon/RadioIcon.js +2 -2
- package/build/lib/web/production/components/Icons/RazorpayIcon/RazorpayIcon.js +2 -2
- package/build/lib/web/production/components/Icons/RazorpayXIcon/RazorpayXIcon.js +2 -2
- package/build/lib/web/production/components/Icons/RefreshIcon/RefreshIcon.js +2 -2
- package/build/lib/web/production/components/Icons/RepeatIcon/RepeatIcon.js +2 -2
- package/build/lib/web/production/components/Icons/ReportsIcon/ReportsIcon.js +2 -2
- package/build/lib/web/production/components/Icons/RewindIcon/RewindIcon.js +2 -2
- package/build/lib/web/production/components/Icons/RotateClockWiseIcon/RotateClockWiseIcon.js +2 -2
- package/build/lib/web/production/components/Icons/RotateCounterClockWiseIcon/RotateCounterClockWiseIcon.js +2 -2
- package/build/lib/web/production/components/Icons/RoutesIcon/RoutesIcon.js +2 -2
- package/build/lib/web/production/components/Icons/RupeeIcon/RupeeIcon.js +2 -2
- package/build/lib/web/production/components/Icons/RupeesIcon/RupeesIcon.js +2 -2
- package/build/lib/web/production/components/Icons/SaveIcon/SaveIcon.js +2 -2
- package/build/lib/web/production/components/Icons/ScissorsIcon/ScissorsIcon.js +2 -2
- package/build/lib/web/production/components/Icons/SearchIcon/SearchIcon.js +2 -2
- package/build/lib/web/production/components/Icons/SendIcon/SendIcon.js +2 -2
- package/build/lib/web/production/components/Icons/ServerIcon/ServerIcon.js +2 -2
- package/build/lib/web/production/components/Icons/SettingsIcon/SettingsIcon.js +2 -2
- package/build/lib/web/production/components/Icons/SettlementsIcon/SettlementsIcon.js +2 -2
- package/build/lib/web/production/components/Icons/ShareIcon/ShareIcon.js +2 -2
- package/build/lib/web/production/components/Icons/ShieldIcon/ShieldIcon.js +2 -2
- package/build/lib/web/production/components/Icons/ShoppingCartIcon/ShoppingCartIcon.js +2 -2
- package/build/lib/web/production/components/Icons/ShuffleIcon/ShuffleIcon.js +2 -2
- package/build/lib/web/production/components/Icons/SidebarIcon/SidebarIcon.js +2 -2
- package/build/lib/web/production/components/Icons/SkipBackIcon/SkipBackIcon.js +2 -2
- package/build/lib/web/production/components/Icons/SkipForwardIcon/SkipForwardIcon.js +2 -2
- package/build/lib/web/production/components/Icons/SlackIcon/SlackIcon.js +2 -2
- package/build/lib/web/production/components/Icons/SlashIcon/SlashIcon.js +2 -2
- package/build/lib/web/production/components/Icons/SlidersIcon/SlidersIcon.js +2 -2
- package/build/lib/web/production/components/Icons/SmartCollectIcon/SmartCollectIcon.js +2 -2
- package/build/lib/web/production/components/Icons/SmartphoneIcon/SmartphoneIcon.js +2 -2
- package/build/lib/web/production/components/Icons/SpeakerIcon/SpeakerIcon.js +2 -2
- package/build/lib/web/production/components/Icons/SquareIcon/SquareIcon.js +2 -2
- package/build/lib/web/production/components/Icons/StampIcon/StampIcon.js +2 -2
- package/build/lib/web/production/components/Icons/StarIcon/StarIcon.js +2 -2
- package/build/lib/web/production/components/Icons/StopCircleIcon/StopCircleIcon.js +2 -2
- package/build/lib/web/production/components/Icons/SubscriptionsIcon/SubscriptionsIcon.js +2 -2
- package/build/lib/web/production/components/Icons/SunIcon/SunIcon.js +2 -2
- package/build/lib/web/production/components/Icons/SunriseIcon/SunriseIcon.js +2 -2
- package/build/lib/web/production/components/Icons/SunsetIcon/SunsetIcon.js +2 -2
- package/build/lib/web/production/components/Icons/TabletIcon/TabletIcon.js +2 -2
- package/build/lib/web/production/components/Icons/TagIcon/TagIcon.js +2 -2
- package/build/lib/web/production/components/Icons/TargetIcon/TargetIcon.js +2 -2
- package/build/lib/web/production/components/Icons/ThermometerIcon/ThermometerIcon.js +2 -2
- package/build/lib/web/production/components/Icons/ThumbsDownIcon/ThumbsDownIcon.js +2 -2
- package/build/lib/web/production/components/Icons/ThumbsUpIcon/ThumbsUpIcon.js +2 -2
- package/build/lib/web/production/components/Icons/ToggleLeftIcon/ToggleLeftIcon.js +2 -2
- package/build/lib/web/production/components/Icons/ToggleRightIcon/ToggleRightIcon.js +2 -2
- package/build/lib/web/production/components/Icons/TransactionsIcon/TransactionsIcon.js +2 -2
- package/build/lib/web/production/components/Icons/TrashIcon/TrashIcon.js +2 -2
- package/build/lib/web/production/components/Icons/TrendingDownIcon/TrendingDownIcon.js +2 -2
- package/build/lib/web/production/components/Icons/TrendingUpIcon/TrendingUpIcon.js +2 -2
- package/build/lib/web/production/components/Icons/TriangleIcon/TriangleIcon.js +2 -2
- package/build/lib/web/production/components/Icons/TvIcon/TvIcon.js +2 -2
- package/build/lib/web/production/components/Icons/TwitterIcon/TwitterIcon.js +2 -2
- package/build/lib/web/production/components/Icons/TypeIcon/TypeIcon.js +2 -2
- package/build/lib/web/production/components/Icons/UmbrellaIcon/UmbrellaIcon.js +2 -2
- package/build/lib/web/production/components/Icons/UnderlineIcon/UnderlineIcon.js +2 -2
- package/build/lib/web/production/components/Icons/UnlockIcon/UnlockIcon.js +2 -2
- package/build/lib/web/production/components/Icons/UploadCloudIcon/UploadCloudIcon.js +2 -2
- package/build/lib/web/production/components/Icons/UploadIcon/UploadIcon.js +2 -2
- package/build/lib/web/production/components/Icons/UserCheckIcon/UserCheckIcon.js +2 -2
- package/build/lib/web/production/components/Icons/UserIcon/UserIcon.js +2 -2
- package/build/lib/web/production/components/Icons/UserMinusIcon/UserMinusIcon.js +2 -2
- package/build/lib/web/production/components/Icons/UserPlusIcon/UserPlusIcon.js +2 -2
- package/build/lib/web/production/components/Icons/UserXIcon/UserXIcon.js +2 -2
- package/build/lib/web/production/components/Icons/UsersIcon/UsersIcon.js +2 -2
- package/build/lib/web/production/components/Icons/VideoIcon/VideoIcon.js +2 -2
- package/build/lib/web/production/components/Icons/VideoOffIcon/VideoOffIcon.js +2 -2
- package/build/lib/web/production/components/Icons/VoicemailIcon/VoicemailIcon.js +2 -2
- package/build/lib/web/production/components/Icons/VolumeHighIcon/VolumeHighIcon.js +2 -2
- package/build/lib/web/production/components/Icons/VolumeIcon/VolumeIcon.js +2 -2
- package/build/lib/web/production/components/Icons/VolumeLowIcon/VolumeLowIcon.js +2 -2
- package/build/lib/web/production/components/Icons/VolumeMuteIcon/VolumeMuteIcon.js +2 -2
- package/build/lib/web/production/components/Icons/WatchIcon/WatchIcon.js +2 -2
- package/build/lib/web/production/components/Icons/WifiIcon/WifiIcon.js +2 -2
- package/build/lib/web/production/components/Icons/WifiOffIcon/WifiOffIcon.js +2 -2
- package/build/lib/web/production/components/Icons/WindIcon/WindIcon.js +2 -2
- package/build/lib/web/production/components/Icons/XCircleIcon/XCircleIcon.js +2 -2
- package/build/lib/web/production/components/Icons/XSquareIcon/XSquareIcon.js +2 -2
- package/build/lib/web/production/components/Icons/ZapIcon/ZapIcon.js +2 -2
- package/build/lib/web/production/components/Icons/ZoomInIcon/ZoomInIcon.js +2 -2
- package/build/lib/web/production/components/Icons/ZoomOutIcon/ZoomOutIcon.js +2 -2
- package/build/lib/web/production/components/Icons/_Svg/Circle/Circle.web.js +2 -2
- package/build/lib/web/production/components/Icons/_Svg/ClipPath/ClipPath.web.js +2 -2
- package/build/lib/web/production/components/Icons/_Svg/Defs/Defs.web.js +2 -2
- package/build/lib/web/production/components/Icons/_Svg/G/G.web.js +2 -2
- package/build/lib/web/production/components/Icons/_Svg/Path/Path.web.js +2 -2
- package/build/lib/web/production/components/Icons/_Svg/Rect/Rect.web.js +2 -2
- package/build/lib/web/production/components/Icons/_Svg/Svg/Svg.web.js +2 -2
- package/build/lib/web/production/components/Indicator/Indicator.js +2 -2
- package/build/lib/web/production/components/Input/BaseInput/AnimatedBaseInputWrapper.web.js +10 -4
- package/build/lib/web/production/components/Input/BaseInput/AnimatedBaseInputWrapper.web.js.map +1 -1
- package/build/lib/web/production/components/Input/BaseInput/BaseInput.js +15 -3
- package/build/lib/web/production/components/Input/BaseInput/BaseInput.js.map +1 -1
- package/build/lib/web/production/components/Input/BaseInput/BaseInputTagSlot.web.js +14 -1
- package/build/lib/web/production/components/Input/BaseInput/BaseInputTagSlot.web.js.map +1 -1
- package/build/lib/web/production/components/Input/BaseInput/BaseInputVisuals.js +2 -2
- package/build/lib/web/production/components/Input/BaseInput/BaseInputWrapper.js +6 -4
- package/build/lib/web/production/components/Input/BaseInput/BaseInputWrapper.js.map +1 -1
- package/build/lib/web/production/components/Input/BaseInput/StyledBaseInput.web.js +7 -4
- package/build/lib/web/production/components/Input/BaseInput/StyledBaseInput.web.js.map +1 -1
- package/build/lib/web/production/components/Input/BaseInput/baseInputStyles.js +4 -4
- package/build/lib/web/production/components/Input/BaseInput/baseInputStyles.js.map +1 -1
- package/build/lib/web/production/components/Input/BaseInput/useTaggedInput.js +172 -0
- package/build/lib/web/production/components/Input/BaseInput/useTaggedInput.js.map +1 -0
- package/build/lib/web/production/components/Input/DropdownInputTriggers/AutoComplete.js +2 -2
- package/build/lib/web/production/components/Input/DropdownInputTriggers/SelectInput.js +2 -2
- package/build/lib/web/production/components/Input/OTPInput/OTPInput.js +2 -2
- package/build/lib/web/production/components/Input/PasswordInput/PasswordInput.js +2 -2
- package/build/lib/web/production/components/Input/PhoneNumberInput/PhoneNumberInput.web.js +2 -2
- package/build/lib/web/production/components/Input/TextArea/TextArea.js +56 -10
- package/build/lib/web/production/components/Input/TextArea/TextArea.js.map +1 -1
- package/build/lib/web/production/components/Input/TextInput/TextInput.js +53 -7
- package/build/lib/web/production/components/Input/TextInput/TextInput.js.map +1 -1
- package/build/lib/web/production/components/Link/BaseLink/BaseLink.js +2 -2
- package/build/lib/web/production/components/Link/BaseLink/StyledBaseLink.web.js +2 -2
- package/build/lib/web/production/components/Link/Link/Link.js +2 -2
- package/build/lib/web/production/components/List/List.js +2 -3
- package/build/lib/web/production/components/List/List.js.map +1 -1
- package/build/lib/web/production/components/List/ListItem.js +2 -2
- package/build/lib/web/production/components/List/ListItemLink.js +2 -2
- package/build/lib/web/production/components/List/ListItemText.js +2 -2
- package/build/lib/web/production/components/LiveAnnouncer/LiveAnnouncer.web.js +1 -2
- package/build/lib/web/production/components/LiveAnnouncer/LiveAnnouncer.web.js.map +1 -1
- package/build/lib/web/production/components/Modal/Modal.web.js +2 -2
- package/build/lib/web/production/components/Modal/ModalBackdrop.js +2 -2
- package/build/lib/web/production/components/Modal/ModalBody.web.js +2 -2
- package/build/lib/web/production/components/Popover/Popover.web.js +2 -2
- package/build/lib/web/production/components/Popover/PopoverInteractiveWrapper.web.js +2 -2
- package/build/lib/web/production/components/Popover/getPopoverContentWrapperStyles.js +2 -2
- package/build/lib/web/production/components/ProgressBar/ProgressBar.js +2 -2
- package/build/lib/web/production/components/Radio/Radio.js +2 -2
- package/build/lib/web/production/components/Radio/RadioGroup/RadioGroup.js +2 -2
- package/build/lib/web/production/components/Radio/RadioIcon/RadioIcon.js +2 -2
- package/build/lib/web/production/components/Radio/RadioIcon/RadioIconWrapperStyles.js +2 -2
- package/build/lib/web/production/components/Radio/useRadio.js +2 -2
- package/build/lib/web/production/components/Skeleton/Skeleton.js +2 -2
- package/build/lib/web/production/components/SkipNav/SkipNav.web.js +2 -2
- package/build/lib/web/production/components/Spinner/BaseSpinner/BaseSpinner.js +2 -2
- package/build/lib/web/production/components/Spinner/Spinner/Spinner.js +2 -2
- package/build/lib/web/production/components/SpotlightPopoverTour/TourFooter.web.js +2 -2
- package/build/lib/web/production/components/SpotlightPopoverTour/TourMask.web.js +2 -2
- package/build/lib/web/production/components/SpotlightPopoverTour/TourPopover.web.js +2 -2
- package/build/lib/web/production/components/SpotlightPopoverTour/TourStep.web.js +2 -2
- package/build/lib/web/production/components/SpotlightPopoverTour/utils.js +2 -2
- package/build/lib/web/production/components/Switch/Switch.js +2 -2
- package/build/lib/web/production/components/Switch/SwitchTrack.web.js +2 -2
- package/build/lib/web/production/components/Switch/Thumb.js +2 -2
- package/build/lib/web/production/components/Table/Table.web.js +2 -2
- package/build/lib/web/production/components/Table/TableBody.web.js +2 -2
- package/build/lib/web/production/components/Table/TableFooter.web.js +2 -2
- package/build/lib/web/production/components/Table/TableHeader.web.js +2 -2
- package/build/lib/web/production/components/Table/TablePagination.web.js +2 -2
- package/build/lib/web/production/components/Table/TableToolbar.web.js +2 -2
- package/build/lib/web/production/components/Tabs/TabIndicator.web.js +2 -2
- package/build/lib/web/production/components/Tabs/TabItem.web.js +9 -9
- 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/TabPanel.web.js +2 -2
- package/build/lib/web/production/components/Tabs/Tabs.web.js +2 -2
- package/build/lib/web/production/components/Tag/AnimatedTag.web.js +2 -3
- package/build/lib/web/production/components/Tag/AnimatedTag.web.js.map +1 -1
- package/build/lib/web/production/components/Tag/Tag.js +7 -8
- package/build/lib/web/production/components/Tag/Tag.js.map +1 -1
- package/build/lib/web/production/components/Tag/getTagsGroup.js +1 -1
- package/build/lib/web/production/components/Tag/getTagsGroup.js.map +1 -1
- package/build/lib/web/production/components/Tag/tagAnimationConfig.js +4 -2
- package/build/lib/web/production/components/Tag/tagAnimationConfig.js.map +1 -1
- package/build/lib/web/production/components/Toast/Toast.web.js +2 -2
- package/build/lib/web/production/components/Toast/ToastContainer.web.js +2 -2
- package/build/lib/web/production/components/Toast/useToast.js +2 -2
- package/build/lib/web/production/components/Tooltip/Tooltip.web.js +2 -2
- package/build/lib/web/production/components/Tooltip/TooltipInteractiveWrapper.web.js +2 -2
- package/build/lib/web/production/components/Tooltip/getTooltipContentWrapperStyles.js +2 -2
- package/build/lib/web/production/components/Typography/BaseText/BaseText.web.js +2 -2
- package/build/lib/web/production/components/Typography/BaseText/getBaseTextStyles.js +4 -3
- package/build/lib/web/production/components/Typography/BaseText/getBaseTextStyles.js.map +1 -1
- package/build/lib/web/production/components/Typography/Code/Code.js +2 -2
- package/build/lib/web/production/components/Typography/Display/Display.js +2 -2
- package/build/lib/web/production/components/Typography/Heading/Heading.js +2 -2
- package/build/lib/web/production/components/Typography/Heading/getHeadingStyles.js +2 -2
- package/build/lib/web/production/components/Typography/Text/Text.js +2 -2
- package/build/lib/web/production/components/Typography/Text/getTextStyles.js +2 -2
- package/build/lib/web/production/components/VisuallyHidden/VisuallyHidden.web.js +2 -2
- package/build/lib/web/production/tokens/global/border.js +0 -1
- package/build/lib/web/production/tokens/global/border.js.map +1 -1
- package/build/lib/web/production/tokens/global/typography.js +2 -2
- package/build/lib/web/production/tokens/theme/createTheme.js +2 -3
- package/build/lib/web/production/tokens/theme/createTheme.js.map +1 -1
- package/build/lib/web/production/utils/bladeCoverage.js +1 -1
- package/build/lib/web/production/utils/bladeCoverage.js.map +1 -1
- package/build/lib/web/production/utils/makeAccessible/accessibilityMapWeb.js +2 -2
- package/build/lib/web/production/utils/mergeProps.js +19 -18
- package/build/lib/web/production/utils/mergeProps.js.map +1 -1
- package/build/lib/web/production/utils/metaAttribute/metaAttribute.web.js +2 -2
- package/build/types/components/index.d.ts +20 -4
- package/build/types/components/index.native.d.ts +13 -5
- package/package.json +7 -5
|
@@ -14,7 +14,7 @@ import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
|
14
14
|
import { Text } from '../../Typography/Text/Text.js';
|
|
15
15
|
import '../../Typography/Code/Code.js';
|
|
16
16
|
|
|
17
|
-
var ScrollableTagSlotContainer=function ScrollableTagSlotContainer(_ref){var maxTagRows=_ref.maxTagRows,children=_ref.children,handleOnInputClick=_ref.handleOnInputClick;var scrollViewRef=React__default.useRef(null);var _React$useState=React__default.useState(false),_React$useState2=_slicedToArray(_React$useState,2),isScrolling=_React$useState2[0],setIsScrolling=_React$useState2[1];return jsxs(ScrollView,{ref:scrollViewRef,contentContainerStyle:{flexWrap:maxTagRows==='single'?'nowrap':'wrap',position:'relative',flexDirection:'row',flexGrow:1,alignItems:'center'},onScrollBeginDrag:function onScrollBeginDrag(){setIsScrolling(true);},onScrollEndDrag:function onScrollEndDrag(){setIsScrolling(false);},horizontal:maxTagRows==='single',showsHorizontalScrollIndicator:maxTagRows==='single',onContentSizeChange:function onContentSizeChange(){var _scrollViewRef$curren;(_scrollViewRef$curren=scrollViewRef.current)==null?void 0:_scrollViewRef$curren.scrollToEnd({animated:true});},children:[jsx(TouchableWithoutFeedback,{onPress:function onPress(){if(!isScrolling){handleOnInputClick();}},children:jsx(BaseBox,{position:"absolute",height:"100%",width:"100%"})}),children]});};var ClickableText=function ClickableText(_ref2){var children=_ref2.children,handleOnInputClick=_ref2.handleOnInputClick,isDisabled=_ref2.isDisabled;return jsx(TouchableWithoutFeedback,{onPress:function onPress(){handleOnInputClick();},children:jsx(BaseBox,{alignSelf:"center",marginRight:"spacing.4",children:jsx(Text,{size:"small",variant:"body",weight:"regular",color:isDisabled?'surface.text.gray.disabled':'surface.text.gray.subtle',children:children})})});};var PLUS_X_MORE_TEXT_WIDTH=60;var BaseInputTagSlot=function BaseInputTagSlot(_ref3){var tags=_ref3.tags,maxTagRows=_ref3.maxTagRows,showAllTags=_ref3.showAllTags,handleOnInputClick=_ref3.handleOnInputClick,renderAs=_ref3.renderAs,children=_ref3.children,isDropdownTrigger=_ref3.isDropdownTrigger,labelPrefix=_ref3.labelPrefix,isDisabled=_ref3.isDisabled,size$1=_ref3.size;var hasTags=tags&&tags.length>0;var initialVisibleTags=maxTagRows==='multiple'?6:1;var _React$useState3=React__default.useState(labelPrefix?0:initialVisibleTags),_React$useState4=_slicedToArray(_React$useState3,2),visibleTags=_React$useState4[0],setVisibleTags=_React$useState4[1];var invisibleTagsCount=tags||tags&&labelPrefix?tags.length-visibleTags:0;if(!isDropdownTrigger){return children;}return jsxs(BaseBox,{justifyContent:"flex-start",paddingY:"spacing.1",paddingX:"spacing.4",minHeight:makeSize(baseInputHeight[size$1]),display:"flex",flexDirection:"row",position:"relative",flex:"1",onLayout:function onLayout(e){var _e$nativeEvent,_e$nativeEvent$layout;if(!hasTags)return;if(labelPrefix){setVisibleTags(0);return;}if(maxTagRows==='multiple'){return;}var containerWidth=(_e$nativeEvent=e.nativeEvent)==null?void 0:(_e$nativeEvent$layout=_e$nativeEvent.layout)==null?void 0:_e$nativeEvent$layout.width;if(!containerWidth){return;}var availableTagsSpace=containerWidth-PLUS_X_MORE_TEXT_WIDTH;var visibleTagsCount=Math.floor(availableTagsSpace/140);setVisibleTags(visibleTagsCount);},children:[jsxs(ScrollableTagSlotContainer,{maxTagRows:maxTagRows,showAllTags:showAllTags,handleOnInputClick:handleOnInputClick,children:[hasTags?jsxs(Fragment,{children:[showAllTags||maxTagRows==='multiple'?tags:tags.slice(0,visibleTags),invisibleTagsCount>0&&!showAllTags&&!labelPrefix&&maxTagRows!=='multiple'?jsxs(ClickableText,{isDisabled:isDisabled,handleOnInputClick:handleOnInputClick,children:["+ ",invisibleTagsCount," More"]}):null,!showAllTags&&invisibleTagsCount>0&&labelPrefix?jsxs(ClickableText,{isDisabled:isDisabled,handleOnInputClick:handleOnInputClick,children:[labelPrefix," (",invisibleTagsCount," Selected)"]}):null]}):null,jsx(BaseBox,{width:hasTags&&renderAs==='button'?makeSize(size['1']):'100%',children:children})]}),jsx(TouchableWithoutFeedback,{onPress:function onPress(){handleOnInputClick();},children:jsx(BaseBox,{flex:"1"})})]});};
|
|
17
|
+
var ScrollableTagSlotContainer=function ScrollableTagSlotContainer(_ref){var maxTagRows=_ref.maxTagRows,children=_ref.children,handleOnInputClick=_ref.handleOnInputClick;var scrollViewRef=React__default.useRef(null);var _React$useState=React__default.useState(false),_React$useState2=_slicedToArray(_React$useState,2),isScrolling=_React$useState2[0],setIsScrolling=_React$useState2[1];return jsxs(ScrollView,{ref:scrollViewRef,contentContainerStyle:{flexWrap:maxTagRows==='single'?'nowrap':'wrap',position:'relative',flexDirection:'row',flexGrow:1,alignItems:'center'},onScrollBeginDrag:function onScrollBeginDrag(){setIsScrolling(true);},onScrollEndDrag:function onScrollEndDrag(){setIsScrolling(false);},horizontal:maxTagRows==='single',showsHorizontalScrollIndicator:maxTagRows==='single',onContentSizeChange:function onContentSizeChange(){var _scrollViewRef$curren;(_scrollViewRef$curren=scrollViewRef.current)==null?void 0:_scrollViewRef$curren.scrollToEnd({animated:true});},children:[jsx(TouchableWithoutFeedback,{onPress:function onPress(){if(!isScrolling){handleOnInputClick();}},children:jsx(BaseBox,{position:"absolute",height:"100%",width:"100%"})}),children]});};var ClickableText=function ClickableText(_ref2){var children=_ref2.children,handleOnInputClick=_ref2.handleOnInputClick,isDisabled=_ref2.isDisabled;return jsx(TouchableWithoutFeedback,{onPress:function onPress(){handleOnInputClick();},children:jsx(BaseBox,{alignSelf:"center",marginRight:"spacing.4",children:jsx(Text,{size:"small",variant:"body",weight:"regular",color:isDisabled?'surface.text.gray.disabled':'surface.text.gray.subtle',children:children})})});};var PLUS_X_MORE_TEXT_WIDTH=60;var BaseInputTagSlot=function BaseInputTagSlot(_ref3){var tags=_ref3.tags,maxTagRows=_ref3.maxTagRows,showAllTags=_ref3.showAllTags,handleOnInputClick=_ref3.handleOnInputClick,renderAs=_ref3.renderAs,children=_ref3.children,isDropdownTrigger=_ref3.isDropdownTrigger,labelPrefix=_ref3.labelPrefix,isDisabled=_ref3.isDisabled,numberOfLines=_ref3.numberOfLines,isTextArea=_ref3.isTextArea,size$1=_ref3.size;var hasTags=tags&&tags.length>0;var initialVisibleTags=maxTagRows==='multiple'?6:1;var _React$useState3=React__default.useState(labelPrefix?0:initialVisibleTags),_React$useState4=_slicedToArray(_React$useState3,2),visibleTags=_React$useState4[0],setVisibleTags=_React$useState4[1];var invisibleTagsCount=tags||tags&&labelPrefix?tags.length-visibleTags:0;if(!isDropdownTrigger){return children;}return jsxs(BaseBox,{justifyContent:"flex-start",paddingY:"spacing.1",paddingX:"spacing.4",minHeight:makeSize(baseInputHeight[size$1]),height:isTextArea&&isDropdownTrigger?makeSize(baseInputHeight[size$1]*(numberOfLines!=null?numberOfLines:1)):undefined,display:"flex",flexDirection:"row",position:"relative",flex:"1",onLayout:function onLayout(e){var _e$nativeEvent,_e$nativeEvent$layout;if(!hasTags)return;if(labelPrefix){setVisibleTags(0);return;}if(maxTagRows==='multiple'){return;}var containerWidth=(_e$nativeEvent=e.nativeEvent)==null?void 0:(_e$nativeEvent$layout=_e$nativeEvent.layout)==null?void 0:_e$nativeEvent$layout.width;if(!containerWidth){return;}var availableTagsSpace=containerWidth-PLUS_X_MORE_TEXT_WIDTH;var visibleTagsCount=Math.floor(availableTagsSpace/140);setVisibleTags(visibleTagsCount);},children:[jsxs(ScrollableTagSlotContainer,{maxTagRows:maxTagRows,showAllTags:showAllTags,handleOnInputClick:handleOnInputClick,children:[hasTags?jsxs(Fragment,{children:[showAllTags||maxTagRows==='multiple'?tags:tags.slice(0,visibleTags),invisibleTagsCount>0&&!showAllTags&&!labelPrefix&&maxTagRows!=='multiple'?jsxs(ClickableText,{isDisabled:isDisabled,handleOnInputClick:handleOnInputClick,children:["+ ",invisibleTagsCount," More"]}):null,!showAllTags&&invisibleTagsCount>0&&labelPrefix?jsxs(ClickableText,{isDisabled:isDisabled,handleOnInputClick:handleOnInputClick,children:[labelPrefix," (",invisibleTagsCount," Selected)"]}):null]}):null,jsx(BaseBox,{width:hasTags&&renderAs==='button'?makeSize(size['1']):'100%',children:children})]}),jsx(TouchableWithoutFeedback,{onPress:function onPress(){handleOnInputClick();},children:jsx(BaseBox,{flex:"1"})})]});};
|
|
18
18
|
|
|
19
19
|
export { BaseInputTagSlot };
|
|
20
20
|
//# sourceMappingURL=BaseInputTagSlot.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseInputTagSlot.native.js","sources":["../../../../../../src/components/Input/BaseInput/BaseInputTagSlot.native.tsx"],"sourcesContent":["import React from 'react';\nimport { ScrollView, TouchableWithoutFeedback } from 'react-native';\nimport type { BaseInputTagSlotProps } from './types';\nimport { baseInputHeight } from './baseInputTokens';\nimport BaseBox from '~components/Box/BaseBox';\nimport { makeSize } from '~utils';\nimport { size as sizeToken } from '~tokens/global';\nimport { Text } from '~components/Typography';\nimport type { StringChildrenType } from '~utils/types';\n\nconst ScrollableTagSlotContainer = ({\n maxTagRows,\n children,\n handleOnInputClick,\n}: Pick<BaseInputTagSlotProps, 'maxTagRows' | 'showAllTags' | 'handleOnInputClick'> & {\n children: (React.ReactNode | null)[];\n}): React.ReactElement => {\n const scrollViewRef = React.useRef<ScrollView>(null);\n const [isScrolling, setIsScrolling] = React.useState(false);\n return (\n <ScrollView\n ref={scrollViewRef}\n contentContainerStyle={{\n flexWrap: maxTagRows === 'single' ? 'nowrap' : 'wrap',\n position: 'relative',\n flexDirection: 'row',\n flexGrow: 1,\n alignItems: 'center',\n }}\n onScrollBeginDrag={() => {\n setIsScrolling(true);\n }}\n onScrollEndDrag={() => {\n setIsScrolling(false);\n }}\n horizontal={maxTagRows === 'single'}\n showsHorizontalScrollIndicator={maxTagRows === 'single'}\n onContentSizeChange={() => {\n scrollViewRef.current?.scrollToEnd({ animated: true });\n }}\n >\n {/* This creates a clickable layer behind tags so if user clicks empty area between of tags, it handles opening of Dropdown */}\n <TouchableWithoutFeedback\n onPress={() => {\n if (!isScrolling) {\n handleOnInputClick();\n }\n }}\n >\n <BaseBox position=\"absolute\" height=\"100%\" width=\"100%\" />\n </TouchableWithoutFeedback>\n {children}\n </ScrollView>\n );\n};\n\nconst ClickableText = ({\n children,\n handleOnInputClick,\n isDisabled,\n}: {\n children: StringChildrenType;\n handleOnInputClick: BaseInputTagSlotProps['handleOnInputClick'];\n isDisabled: BaseInputTagSlotProps['isDisabled'];\n}): React.ReactElement => {\n return (\n <TouchableWithoutFeedback\n onPress={() => {\n handleOnInputClick();\n }}\n >\n <BaseBox alignSelf=\"center\" marginRight=\"spacing.4\">\n <Text\n size=\"small\"\n variant=\"body\"\n weight=\"regular\"\n color={isDisabled ? 'surface.text.gray.disabled' : 'surface.text.gray.subtle'}\n >\n {children}\n </Text>\n </BaseBox>\n </TouchableWithoutFeedback>\n );\n};\n\nconst PLUS_X_MORE_TEXT_WIDTH = 60;\n\nconst BaseInputTagSlot = ({\n tags,\n maxTagRows,\n showAllTags,\n handleOnInputClick,\n renderAs,\n children,\n isDropdownTrigger,\n labelPrefix,\n isDisabled,\n size,\n}: BaseInputTagSlotProps): React.ReactElement | null => {\n const hasTags = tags && tags.length > 0;\n const initialVisibleTags = maxTagRows === 'multiple' ? 6 : 1;\n const [visibleTags, setVisibleTags] = React.useState(labelPrefix ? 0 : initialVisibleTags);\n const invisibleTagsCount = tags || (tags && labelPrefix) ? tags.length - visibleTags : 0;\n\n if (!isDropdownTrigger) {\n return children;\n }\n\n return (\n <BaseBox\n justifyContent=\"flex-start\"\n paddingY=\"spacing.1\"\n paddingX=\"spacing.4\"\n minHeight={makeSize(baseInputHeight[size])}\n display=\"flex\"\n flexDirection=\"row\"\n position=\"relative\"\n flex=\"1\"\n onLayout={(e) => {\n if (!hasTags) return;\n\n if (labelPrefix) {\n setVisibleTags(0);\n return;\n }\n\n if (maxTagRows === 'multiple') {\n // The calculation is for single-line versions.\n // In multiline, we have default 6 tags in RN\n return;\n }\n\n const containerWidth = e.nativeEvent?.layout?.width;\n if (!containerWidth) {\n return;\n }\n\n const availableTagsSpace = containerWidth - PLUS_X_MORE_TEXT_WIDTH;\n const visibleTagsCount = Math.floor(availableTagsSpace / 140);\n setVisibleTags(visibleTagsCount);\n }}\n >\n <ScrollableTagSlotContainer\n maxTagRows={maxTagRows}\n showAllTags={showAllTags}\n handleOnInputClick={handleOnInputClick}\n >\n {hasTags ? (\n <>\n {showAllTags || maxTagRows === 'multiple' ? tags : tags.slice(0, visibleTags)}\n {invisibleTagsCount > 0 && !showAllTags && !labelPrefix && maxTagRows !== 'multiple' ? (\n <ClickableText isDisabled={isDisabled} handleOnInputClick={handleOnInputClick}>\n + {invisibleTagsCount} More\n </ClickableText>\n ) : null}\n {!showAllTags && invisibleTagsCount > 0 && labelPrefix ? (\n <ClickableText isDisabled={isDisabled} handleOnInputClick={handleOnInputClick}>\n {labelPrefix} ({invisibleTagsCount} Selected)\n </ClickableText>\n ) : null}\n </>\n ) : null}\n <BaseBox width={hasTags && renderAs === 'button' ? makeSize(sizeToken['1']) : '100%'}>\n {children}\n </BaseBox>\n </ScrollableTagSlotContainer>\n <TouchableWithoutFeedback\n onPress={() => {\n handleOnInputClick();\n }}\n >\n <BaseBox flex=\"1\" />\n </TouchableWithoutFeedback>\n </BaseBox>\n );\n};\n\nexport { BaseInputTagSlot };\n"],"names":["ScrollableTagSlotContainer","_ref","maxTagRows","children","handleOnInputClick","scrollViewRef","React","useRef","_React$useState","useState","_React$useState2","_slicedToArray","isScrolling","setIsScrolling","_jsxs","ScrollView","ref","contentContainerStyle","flexWrap","position","flexDirection","flexGrow","alignItems","onScrollBeginDrag","onScrollEndDrag","horizontal","showsHorizontalScrollIndicator","onContentSizeChange","_scrollViewRef$curren","current","scrollToEnd","animated","_jsx","TouchableWithoutFeedback","onPress","BaseBox","height","width","ClickableText","_ref2","isDisabled","alignSelf","marginRight","Text","size","variant","weight","color","PLUS_X_MORE_TEXT_WIDTH","BaseInputTagSlot","_ref3","tags","showAllTags","renderAs","isDropdownTrigger","labelPrefix","hasTags","length","initialVisibleTags","_React$useState3","_React$useState4","visibleTags","setVisibleTags","invisibleTagsCount","justifyContent","paddingY","paddingX","minHeight","makeSize","baseInputHeight","display","flex","onLayout","e","_e$nativeEvent","_e$nativeEvent$layout","containerWidth","nativeEvent","layout","availableTagsSpace","visibleTagsCount","Math","floor","_Fragment","slice","sizeToken"],"mappings":";;;;;;;;;;;;;;;;AAUA,IAAMA,0BAA0B,CAAG,SAA7BA,0BAA0BA,CAAAC,IAAA,CAMN,KALxBC,UAAU,CAAAD,IAAA,CAAVC,UAAU,CACVC,QAAQ,CAAAF,IAAA,CAARE,QAAQ,CACRC,kBAAkB,CAAAH,IAAA,CAAlBG,kBAAkB,CAIlB,IAAMC,aAAa,CAAGC,cAAK,CAACC,MAAM,CAAa,IAAI,CAAC,CACpD,IAAAC,eAAA,CAAsCF,cAAK,CAACG,QAAQ,CAAC,KAAK,CAAC,CAAAC,gBAAA,CAAAC,cAAA,CAAAH,eAAA,CAApDI,CAAAA,CAAAA,CAAAA,WAAW,CAAAF,gBAAA,IAA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,EACvBC,OAAO,CAAE,SAAAA,OAAAA,EAAM,CACb9B,kBAAkB,EAAE,CACtB,CAAE,CAAAD,QAAA,CAEF6B,GAAA,CAACG,OAAO,CAACoC,CAAAA,IAAI,CAAC,GAAG,CAAE,CAAC,CACI,CAAC,CAAA,CACpB,CAAC,CAEd;;;;"}
|
|
1
|
+
{"version":3,"file":"BaseInputTagSlot.native.js","sources":["../../../../../../src/components/Input/BaseInput/BaseInputTagSlot.native.tsx"],"sourcesContent":["import React from 'react';\nimport { ScrollView, TouchableWithoutFeedback } from 'react-native';\nimport type { BaseInputTagSlotProps } from './types';\nimport { baseInputHeight } from './baseInputTokens';\nimport BaseBox from '~components/Box/BaseBox';\nimport { makeSize } from '~utils';\nimport { size as sizeToken } from '~tokens/global';\nimport { Text } from '~components/Typography';\nimport type { StringChildrenType } from '~utils/types';\n\nconst ScrollableTagSlotContainer = ({\n maxTagRows,\n children,\n handleOnInputClick,\n}: Pick<BaseInputTagSlotProps, 'maxTagRows' | 'showAllTags' | 'handleOnInputClick'> & {\n children: (React.ReactNode | null)[];\n}): React.ReactElement => {\n const scrollViewRef = React.useRef<ScrollView>(null);\n const [isScrolling, setIsScrolling] = React.useState(false);\n return (\n <ScrollView\n ref={scrollViewRef}\n contentContainerStyle={{\n flexWrap: maxTagRows === 'single' ? 'nowrap' : 'wrap',\n position: 'relative',\n flexDirection: 'row',\n flexGrow: 1,\n alignItems: 'center',\n }}\n onScrollBeginDrag={() => {\n setIsScrolling(true);\n }}\n onScrollEndDrag={() => {\n setIsScrolling(false);\n }}\n horizontal={maxTagRows === 'single'}\n showsHorizontalScrollIndicator={maxTagRows === 'single'}\n onContentSizeChange={() => {\n scrollViewRef.current?.scrollToEnd({ animated: true });\n }}\n >\n {/* This creates a clickable layer behind tags so if user clicks empty area between of tags, it handles opening of Dropdown */}\n <TouchableWithoutFeedback\n onPress={() => {\n if (!isScrolling) {\n handleOnInputClick();\n }\n }}\n >\n <BaseBox position=\"absolute\" height=\"100%\" width=\"100%\" />\n </TouchableWithoutFeedback>\n {children}\n </ScrollView>\n );\n};\n\nconst ClickableText = ({\n children,\n handleOnInputClick,\n isDisabled,\n}: {\n children: StringChildrenType;\n handleOnInputClick: BaseInputTagSlotProps['handleOnInputClick'];\n isDisabled: BaseInputTagSlotProps['isDisabled'];\n}): React.ReactElement => {\n return (\n <TouchableWithoutFeedback\n onPress={() => {\n handleOnInputClick();\n }}\n >\n <BaseBox alignSelf=\"center\" marginRight=\"spacing.4\">\n <Text\n size=\"small\"\n variant=\"body\"\n weight=\"regular\"\n color={isDisabled ? 'surface.text.gray.disabled' : 'surface.text.gray.subtle'}\n >\n {children}\n </Text>\n </BaseBox>\n </TouchableWithoutFeedback>\n );\n};\n\nconst PLUS_X_MORE_TEXT_WIDTH = 60;\n\nconst BaseInputTagSlot = ({\n tags,\n maxTagRows,\n showAllTags,\n handleOnInputClick,\n renderAs,\n children,\n isDropdownTrigger,\n labelPrefix,\n isDisabled,\n numberOfLines,\n isTextArea,\n size,\n}: BaseInputTagSlotProps): React.ReactElement | null => {\n const hasTags = tags && tags.length > 0;\n const initialVisibleTags = maxTagRows === 'multiple' ? 6 : 1;\n const [visibleTags, setVisibleTags] = React.useState(labelPrefix ? 0 : initialVisibleTags);\n const invisibleTagsCount = tags || (tags && labelPrefix) ? tags.length - visibleTags : 0;\n\n if (!isDropdownTrigger) {\n return children;\n }\n\n return (\n <BaseBox\n justifyContent=\"flex-start\"\n paddingY=\"spacing.1\"\n paddingX=\"spacing.4\"\n minHeight={makeSize(baseInputHeight[size])}\n height={\n isTextArea && isDropdownTrigger\n ? makeSize(baseInputHeight[size] * (numberOfLines ?? 1))\n : undefined\n }\n display=\"flex\"\n flexDirection=\"row\"\n position=\"relative\"\n flex=\"1\"\n onLayout={(e) => {\n if (!hasTags) return;\n\n if (labelPrefix) {\n setVisibleTags(0);\n return;\n }\n\n if (maxTagRows === 'multiple') {\n // The calculation is for single-line versions.\n // In multiline, we have default 6 tags in RN\n return;\n }\n\n const containerWidth = e.nativeEvent?.layout?.width;\n if (!containerWidth) {\n return;\n }\n\n const availableTagsSpace = containerWidth - PLUS_X_MORE_TEXT_WIDTH;\n const visibleTagsCount = Math.floor(availableTagsSpace / 140);\n setVisibleTags(visibleTagsCount);\n }}\n >\n <ScrollableTagSlotContainer\n maxTagRows={maxTagRows}\n showAllTags={showAllTags}\n handleOnInputClick={handleOnInputClick}\n >\n {hasTags ? (\n <>\n {showAllTags || maxTagRows === 'multiple' ? tags : tags.slice(0, visibleTags)}\n {invisibleTagsCount > 0 && !showAllTags && !labelPrefix && maxTagRows !== 'multiple' ? (\n <ClickableText isDisabled={isDisabled} handleOnInputClick={handleOnInputClick}>\n + {invisibleTagsCount} More\n </ClickableText>\n ) : null}\n {!showAllTags && invisibleTagsCount > 0 && labelPrefix ? (\n <ClickableText isDisabled={isDisabled} handleOnInputClick={handleOnInputClick}>\n {labelPrefix} ({invisibleTagsCount} Selected)\n </ClickableText>\n ) : null}\n </>\n ) : null}\n <BaseBox width={hasTags && renderAs === 'button' ? makeSize(sizeToken['1']) : '100%'}>\n {children}\n </BaseBox>\n </ScrollableTagSlotContainer>\n <TouchableWithoutFeedback\n onPress={() => {\n handleOnInputClick();\n }}\n >\n <BaseBox flex=\"1\" />\n </TouchableWithoutFeedback>\n </BaseBox>\n );\n};\n\nexport { BaseInputTagSlot };\n"],"names":["ScrollableTagSlotContainer","_ref","maxTagRows","children","handleOnInputClick","scrollViewRef","React","useRef","_React$useState","useState","_React$useState2","_slicedToArray","isScrolling","setIsScrolling","_jsxs","ScrollView","ref","contentContainerStyle","flexWrap","position","flexDirection","flexGrow","alignItems","onScrollBeginDrag","onScrollEndDrag","horizontal","showsHorizontalScrollIndicator","onContentSizeChange","_scrollViewRef$curren","current","scrollToEnd","animated","_jsx","TouchableWithoutFeedback","onPress","BaseBox","height","width","ClickableText","_ref2","isDisabled","alignSelf","marginRight","Text","size","variant","weight","color","PLUS_X_MORE_TEXT_WIDTH","BaseInputTagSlot","_ref3","tags","showAllTags","renderAs","isDropdownTrigger","labelPrefix","numberOfLines","isTextArea","hasTags","length","initialVisibleTags","_React$useState3","_React$useState4","visibleTags","setVisibleTags","invisibleTagsCount","justifyContent","paddingY","paddingX","minHeight","makeSize","baseInputHeight","undefined","display","flex","onLayout","e","_e$nativeEvent","_e$nativeEvent$layout","containerWidth","nativeEvent","layout","availableTagsSpace","visibleTagsCount","Math","floor","_Fragment","slice","sizeToken"],"mappings":";;;;;;;;;;;;;;;;AAUA,IAAMA,0BAA0B,CAAG,SAA7BA,0BAA0BA,CAAAC,IAAA,CAMN,CALxB,IAAAC,UAAU,CAAAD,IAAA,CAAVC,UAAU,CACVC,QAAQ,CAAAF,IAAA,CAARE,QAAQ,CACRC,kBAAkB,CAAAH,IAAA,CAAlBG,kBAAkB,CAIlB,IAAMC,aAAa,CAAGC,cAAK,CAACC,MAAM,CAAa,IAAI,CAAC,CACpD,IAAAC,eAAA,CAAsCF,cAAK,CAACG,QAAQ,CAAC,KAAK,CAAC,CAAAC,gBAAA,CAAAC,cAAA,CAAAH,eAAA,CAAA,CAAA,CAAA,CAApDI,WAAW,CAAAF,gBAAA,CAAEG,CAAAA,CAAAA,CAAAA,cAAc,CAAAH,gBAAA,IAClC,OACEI,IAAA,CAACC,UAAU,EACTC,GAAG,CAAEX,aAAc,CACnBY,qBAAqB,CAAE,CACrBC,QAAQ,CAAEhB,UAAU,GAAK,QAAQ,CAAG,QAAQ,CAAG,MAAM,CACrDiB,QAAQ,CAAE,UAAU,CACpBC,aAAa,CAAE,KAAK,CACpBC,QAAQ,CAAE,CAAC,CACXC,UAAU,CAAE,QACd,CAAE,CACFC,iBAAiB,CAAE,SAAAA,iBAAA,EAAM,CACvBV,cAAc,CAAC,IAAI,CAAC,CACtB,CAAE,CACFW,eAAe,CAAE,SAAAA,eAAAA,EAAM,CACrBX,cAAc,CAAC,KAAK,CAAC,CACvB,CAAE,CACFY,UAAU,CAAEvB,UAAU,GAAK,QAAS,CACpCwB,8BAA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seInputWrapper.native.js';
|
|
4
4
|
import { jsx } from 'react/jsx-runtime';
|
|
5
5
|
|
|
6
|
-
var _excluded=["children","validationState","currentInteraction","isLabelLeftPositioned","isTextArea","showAllTags","setShowAllTagsWithAnimation","maxTagRows"];var _BaseInputWrapper=function _BaseInputWrapper(_ref,ref){var children=_ref.children,validationState=_ref.validationState,currentInteraction=_ref.currentInteraction;_ref.isLabelLeftPositioned;var isTextArea=_ref.isTextArea,showAllTags=_ref.showAllTags,setShowAllTagsWithAnimation=_ref.setShowAllTagsWithAnimation,maxTagRows=_ref.maxTagRows,props=_objectWithoutProperties(_ref,_excluded);return jsx(AnimatedBaseInputWrapper,Object.assign({ref:ref,isTextArea:isTextArea,validationState:validationState,currentInteraction:currentInteraction,showAllTags:showAllTags,maxTagRows:maxTagRows,setShowAllTagsWithAnimation:setShowAllTagsWithAnimation},props,{children:children}));};var BaseInputWrapper=React__default.forwardRef(_BaseInputWrapper);
|
|
6
|
+
var _excluded=["children","validationState","currentInteraction","isLabelLeftPositioned","isTextArea","showAllTags","setShowAllTagsWithAnimation","maxTagRows","numberOfLines"];var _BaseInputWrapper=function _BaseInputWrapper(_ref,ref){var children=_ref.children,validationState=_ref.validationState,currentInteraction=_ref.currentInteraction;_ref.isLabelLeftPositioned;var isTextArea=_ref.isTextArea,showAllTags=_ref.showAllTags,setShowAllTagsWithAnimation=_ref.setShowAllTagsWithAnimation,maxTagRows=_ref.maxTagRows,numberOfLines=_ref.numberOfLines,props=_objectWithoutProperties(_ref,_excluded);return jsx(AnimatedBaseInputWrapper,Object.assign({ref:ref,isTextArea:isTextArea,validationState:validationState,currentInteraction:currentInteraction,showAllTags:showAllTags,maxTagRows:maxTagRows,setShowAllTagsWithAnimation:setShowAllTagsWithAnimation,numberOfLines:numberOfLines},props,{children:children}));};var BaseInputWrapper=React__default.forwardRef(_BaseInputWrapper);
|
|
7
7
|
|
|
8
8
|
export { BaseInputWrapper };
|
|
9
9
|
//# sourceMappingURL=BaseInputWrapper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseInputWrapper.js","sources":["../../../../../../src/components/Input/BaseInput/BaseInputWrapper.tsx"],"sourcesContent":["import type { ReactElement, ReactNode } from 'react';\nimport React from 'react';\nimport
|
|
1
|
+
{"version":3,"file":"BaseInputWrapper.js","sources":["../../../../../../src/components/Input/BaseInput/BaseInputWrapper.tsx"],"sourcesContent":["import type { ReactElement, ReactNode } from 'react';\nimport React from 'react';\nimport { AnimatedBaseInputWrapper } from './AnimatedBaseInputWrapper';\nimport type { BaseInputWrapperProps } from './types';\nimport type { ContainerElementType } from '~utils/types';\n\nconst _BaseInputWrapper: React.ForwardRefRenderFunction<\n ContainerElementType,\n BaseInputWrapperProps & {\n children: ReactNode;\n }\n> = (\n {\n children,\n validationState,\n currentInteraction,\n isLabelLeftPositioned,\n isTextArea,\n showAllTags,\n setShowAllTagsWithAnimation,\n maxTagRows,\n numberOfLines,\n ...props\n },\n ref,\n): ReactElement => {\n return (\n <AnimatedBaseInputWrapper\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unnecessary-type-assertion\n ref={ref as any}\n isTextArea={isTextArea}\n validationState={validationState}\n currentInteraction={currentInteraction}\n showAllTags={showAllTags}\n maxTagRows={maxTagRows}\n setShowAllTagsWithAnimation={setShowAllTagsWithAnimation}\n numberOfLines={numberOfLines}\n {...props}\n >\n {children}\n </AnimatedBaseInputWrapper>\n );\n};\n\nexport const BaseInputWrapper = React.forwardRef(_BaseInputWrapper);\n"],"names":["_BaseInputWrapper","_ref","ref","children","validationState","currentInteraction","isLabelLeftPositioned","isTextArea","showAllTags","setShowAllTagsWithAnimation","maxTagRows","numberOfLines","props","_objectWithoutProperties","_excluded","_jsx","AnimatedBaseInputWrapper","Object","assign","BaseInputWrapper","React","forwardRef"],"mappings":";;;;;AACA,IAAA,SAAA,CAAA,CAAA,UAAA,CAAA,iBAAA,CAAA,oBAAA,CAAA,uBAAA,CAAA,YAAA,CAAA,aAAA,CAAA,6BAAA,CAAA,YAAA,CAAA,eAAA,CAAA,CAKA,IAAMA,iBAKL,CAAG,SALEA,iBAKLA,CAAAC,IAAA,CAaCC,GAAG,CACc,CAZf,IAAAC,QAAQ,CAAAF,IAAA,CAARE,QAAQ,CACRC,eAAe,CAAAH,IAAA,CAAfG,eAAe,CACfC,kBAAkB,CAAAJ,IAAA,CAAlBI,kBAAkB,CACGJ,IAAA,CAArBK,qBAAqB,KACrBC,UAAU,CAAAN,IAAA,CAAVM,UAAU,CACVC,WAAW,CAAAP,IAAA,CAAXO,WAAW,CACXC,2BAA2B,CAAAR,IAAA,CAA3BQ,2BAA2B,CAC3BC,UAAU,CAAAT,IAAA,CAAVS,UAAU,CACVC,aAAa,CAAAV,IAAA,CAAbU,aAAa,CACVC,KAAK,CAAAC,wBAAA,CAAAZ,IAAA,CAAAa,SAAA,EAIV,OACEC,GAAA,CAACC,wBAAwB,CAAAC,MAAA,CAAAC,MAAA,CAAA,CAEvBhB,GAAG,CAAEA,GAAW,CAChBK,UAAU,CAAEA,UAAW,CACvBH,eAAe,CAAEA,eAAgB,CACjCC,kBAAkB,CAAEA,kBAAmB,CACvCG,WAAW,CAAEA,WAAY,CACzBE,UAAU,CAAEA,UAAW,CACvBD,2BAA2B,CAAEA,2BAA4B,CACzDE,aAAa,CAAEA,aAAc,EACzBC,KAAK,CAAA,CAAAT,QAAA,CAERA,QAAQ,CACe,CAAA,CAAC,CAE/B,CAAC,CAEY,IAAAgB,gBAAgB,CAAGC,cAAK,CAACC,UAAU,CAACrB,iBAAiB;;;;"}
|
|
@@ -19,7 +19,7 @@ import 'react-native-gesture-handler';
|
|
|
19
19
|
import '../../BottomSheet/BottomSheetStack.js';
|
|
20
20
|
import { assignWithoutSideEffects } from '../../../utils/assignWithoutSideEffects/assignWithoutSideEffects.js';
|
|
21
21
|
|
|
22
|
-
var _excluded=["name","isRequired","isDisabled","maxCharacters","handleOnFocus","handleOnChange","handleOnBlur","handleOnSubmit","handleOnInput","handleOnKeyDown","handleOnClick","keyboardType","keyboardReturnKeyType","autoCompleteSuggestionType","accessibilityProps","currentInteraction","setCurrentInteraction","type","numberOfLines","isTextArea","hasPopup","shouldIgnoreBlurAnimation","autoCapitalize","as","$size"];var autoCompleteSuggestionTypeAndroid={none:'off',name:'name',email:'email',username:'username',password:'password',newPassword:'password-new',oneTimeCode:'sms-otp',telephone:'tel',postalCode:'postal-code',countryName:'postal-address-country',creditCardNumber:'cc-number',creditCardCSC:'cc-csc',creditCardExpiry:'cc-exp',creditCardExpiryMonth:'cc-exp-month',creditCardExpiryYear:'cc-exp-year'};var autoCompleteSuggestionTypeIOS={none:'none',name:'name',email:'emailAddress',username:'username',password:'password',newPassword:'newPassword',oneTimeCode:'oneTimeCode',telephone:'telephoneNumber',postalCode:'postalCode',countryName:'countryName',creditCardNumber:'creditCardNumber',creditCardCSC:'none',creditCardExpiry:'none',creditCardExpiryMonth:'none',creditCardExpiryYear:'none'};var KeyboardTypeToNativeValuesMap={text:'default',search:'default',telephone:'phone-pad',email:'email-address',url:'url',decimal:'decimal-pad'};var getInputHeight=function getInputHeight(_ref){var isTextArea=_ref.isTextArea,hasTags=_ref.hasTags,numberOfLines=_ref.numberOfLines,
|
|
22
|
+
var _excluded=["name","isRequired","isDisabled","maxCharacters","handleOnFocus","handleOnChange","handleOnBlur","handleOnSubmit","handleOnInput","handleOnKeyDown","handleOnClick","keyboardType","keyboardReturnKeyType","autoCompleteSuggestionType","accessibilityProps","currentInteraction","setCurrentInteraction","type","numberOfLines","isTextArea","hasPopup","shouldIgnoreBlurAnimation","autoCapitalize","as","$size"];var autoCompleteSuggestionTypeAndroid={none:'off',name:'name',email:'email',username:'username',password:'password',newPassword:'password-new',oneTimeCode:'sms-otp',telephone:'tel',postalCode:'postal-code',countryName:'postal-address-country',creditCardNumber:'cc-number',creditCardCSC:'cc-csc',creditCardExpiry:'cc-exp',creditCardExpiryMonth:'cc-exp-month',creditCardExpiryYear:'cc-exp-year'};var autoCompleteSuggestionTypeIOS={none:'none',name:'name',email:'emailAddress',username:'username',password:'password',newPassword:'newPassword',oneTimeCode:'oneTimeCode',telephone:'telephoneNumber',postalCode:'postalCode',countryName:'countryName',creditCardNumber:'creditCardNumber',creditCardCSC:'none',creditCardExpiry:'none',creditCardExpiryMonth:'none',creditCardExpiryYear:'none'};var KeyboardTypeToNativeValuesMap={text:'default',search:'default',telephone:'phone-pad',email:'email-address',url:'url',decimal:'decimal-pad'};var getInputHeight=function getInputHeight(_ref){var isTextArea=_ref.isTextArea,hasTags=_ref.hasTags,numberOfLines=_ref.numberOfLines,isDropdownTrigger=_ref.isDropdownTrigger,size$1=_ref.size;if(isTextArea){var lines=isDropdownTrigger?1:numberOfLines!=null?numberOfLines:0;return `${baseInputHeight[size$1]*lines}px`;}if(hasTags){return undefined;}return makeSize(size[baseInputHeight[size$1]]);};var getRNInputStyles=function getRNInputStyles(props){return Object.assign({},getBaseInputStyles({theme:props.theme,isFocused:props.isFocused,isDisabled:!props.editable,validationState:props.validationState,leadingIcon:props.leadingIcon,prefix:props.prefix,trailingInteractionElement:props.trailingInteractionElement,leadingInteractionElement:props.leadingInteractionElement,suffix:props.suffix,trailingIcon:props.trailingIcon,isTextArea:props.isTextArea,hasTags:props.hasTags,isDropdownTrigger:props.isDropdownTrigger,size:props.$size,valueComponentType:props.valueComponentType}),{lineHeight:Platform.select({android:makeSize(props.theme.typography.lineHeights[100]),ios:undefined}),textAlignVertical:'top',height:getInputHeight({isTextArea:props.isTextArea,hasTags:props.hasTags,numberOfLines:props.numberOfLines,isDropdownTrigger:props.isDropdownTrigger,size:props.$size})});};var StyledNativeBaseInput=styled.TextInput(function(_ref2){var id=_ref2.id,isFocused=_ref2.isFocused,theme=_ref2.theme,editable=_ref2.editable,validationState=_ref2.validationState,leadingIcon=_ref2.leadingIcon,prefix=_ref2.prefix,trailingInteractionElement=_ref2.trailingInteractionElement,leadingInteractionElement=_ref2.leadingInteractionElement,suffix=_ref2.suffix,trailingIcon=_ref2.trailingIcon,isTextArea=_ref2.isTextArea,numberOfLines=_ref2.numberOfLines,isDropdownTrigger=_ref2.isDropdownTrigger,hasTags=_ref2.hasTags,$size=_ref2.$size,valueComponentType=_ref2.valueComponentType;return getRNInputStyles({id:id,isFocused:isFocused,theme:theme,editable:editable,validationState:validationState,leadingIcon:leadingIcon,prefix:prefix,trailingInteractionElement:trailingInteractionElement,leadingInteractionElement:leadingInteractionElement,suffix:suffix,trailingIcon:trailingIcon,isTextArea:isTextArea,numberOfLines:numberOfLines,hasTags:hasTags,isDropdownTrigger:isDropdownTrigger,$size:$size,valueComponentType:valueComponentType});});var StyledNativeBaseButton=styled.TouchableOpacity(function(_ref3){var id=_ref3.id,isFocused=_ref3.isFocused,theme=_ref3.theme,editable=_ref3.editable,validationState=_ref3.validationState,leadingIcon=_ref3.leadingIcon,prefix=_ref3.prefix,trailingInteractionElement=_ref3.trailingInteractionElement,leadingInteractionElement=_ref3.leadingInteractionElement,suffix=_ref3.suffix,trailingIcon=_ref3.trailingIcon,isTextArea=_ref3.isTextArea,numberOfLines=_ref3.numberOfLines,isDropdownTrigger=_ref3.isDropdownTrigger,hasTags=_ref3.hasTags,$size=_ref3.$size,valueComponentType=_ref3.valueComponentType;return Object.assign({},getRNInputStyles({id:id,isFocused:isFocused,theme:theme,editable:editable,validationState:validationState,leadingIcon:leadingIcon,prefix:prefix,trailingInteractionElement:trailingInteractionElement,leadingInteractionElement:leadingInteractionElement,suffix:suffix,trailingIcon:trailingIcon,isTextArea:isTextArea,numberOfLines:numberOfLines,isDropdownTrigger:isDropdownTrigger,hasTags:hasTags,$size:$size,valueComponentType:valueComponentType}));});var _StyledBaseInput=function _StyledBaseInput(_ref4,ref){var name=_ref4.name;_ref4.isRequired;var isDisabled=_ref4.isDisabled,maxCharacters=_ref4.maxCharacters,handleOnFocus=_ref4.handleOnFocus,handleOnChange=_ref4.handleOnChange,handleOnBlur=_ref4.handleOnBlur,handleOnSubmit=_ref4.handleOnSubmit,handleOnInput=_ref4.handleOnInput,handleOnKeyDown=_ref4.handleOnKeyDown,handleOnClick=_ref4.handleOnClick,_ref4$keyboardType=_ref4.keyboardType,keyboardType=_ref4$keyboardType===void 0?'text':_ref4$keyboardType,keyboardReturnKeyType=_ref4.keyboardReturnKeyType,autoCompleteSuggestionType=_ref4.autoCompleteSuggestionType,accessibilityProps=_ref4.accessibilityProps,currentInteraction=_ref4.currentInteraction,setCurrentInteraction=_ref4.setCurrentInteraction,type=_ref4.type,numberOfLines=_ref4.numberOfLines,isTextArea=_ref4.isTextArea;_ref4.hasPopup;var shouldIgnoreBlurAnimation=_ref4.shouldIgnoreBlurAnimation,autoCapitalize=_ref4.autoCapitalize,renderAs=_ref4.as,$size=_ref4.$size,props=_objectWithoutProperties(_ref4,_excluded);var buttonValue=props.value?props.value:props.placeholder;var _useTheme=useTheme(),theme=_useTheme.theme;var commonProps={onBlur:function onBlur(){if(!shouldIgnoreBlurAnimation){setCurrentInteraction('default');}},isFocused:currentInteraction==='focus'};return renderAs==='button'?jsx(StyledNativeBaseButton,Object.assign({ref:ref,onPress:function onPress(){handleOnClick==null?void 0:handleOnClick({name:name,value:props.value});},onFocus:function onFocus(){handleOnFocus==null?void 0:handleOnFocus({name:name,value:props.value});setCurrentInteraction('focus');},as:undefined,$size:$size},commonProps,props,accessibilityProps,{children:jsx(Text,{color:props.value&&!isDisabled?'surface.text.gray.subtle':'surface.text.gray.disabled',truncateAfterLines:1,textAlign:props.textAlign,size:$size,children:buttonValue})})):jsx(StyledNativeBaseInput,Object.assign({ref:ref,multiline:isTextArea,numberOfLines:numberOfLines,editable:!isDisabled,maxLength:maxCharacters,placeholderTextColor:theme.colors.surface.text.gray.disabled,onFocus:function onFocus(event){handleOnFocus==null?void 0:handleOnFocus({name:name,value:event==null?void 0:event.nativeEvent.text});handleOnClick==null?void 0:handleOnClick({name:name,value:event==null?void 0:event.nativeEvent.text});setCurrentInteraction('focus');},onChangeText:function onChangeText(text){handleOnChange==null?void 0:handleOnChange({name:name,value:text});handleOnInput==null?void 0:handleOnInput({name:name,value:text});},onEndEditing:function onEndEditing(event){return handleOnBlur==null?void 0:handleOnBlur({name:name,value:event==null?void 0:event.nativeEvent.text});},onSubmitEditing:function onSubmitEditing(event){return handleOnSubmit==null?void 0:handleOnSubmit({name:name,value:event==null?void 0:event.nativeEvent.text});},onKeyPress:function onKeyPress(event){handleOnKeyDown==null?void 0:handleOnKeyDown({name:name,key:event==null?void 0:event.nativeEvent.key,event:event});},keyboardType:KeyboardTypeToNativeValuesMap[keyboardType],returnKeyType:keyboardReturnKeyType,autoCompleteType:autoCompleteSuggestionType?autoCompleteSuggestionTypeAndroid[autoCompleteSuggestionType]:undefined,secureTextEntry:type==='password',isTextArea:isTextArea,textContentType:autoCompleteSuggestionType?autoCompleteSuggestionTypeIOS[autoCompleteSuggestionType]:undefined,autoCapitalize:autoCapitalize,$size:$size},commonProps,props,accessibilityProps));};var StyledBaseInput=assignWithoutSideEffects(React__default.forwardRef(_StyledBaseInput),{displayName:'StyledBaseInput'});
|
|
23
23
|
|
|
24
24
|
export { StyledBaseInput };
|
|
25
25
|
//# sourceMappingURL=StyledBaseInput.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StyledBaseInput.native.js","sources":["../../../../../../src/components/Input/BaseInput/StyledBaseInput.native.tsx"],"sourcesContent":["import React from 'react';\nimport styled from 'styled-components/native';\nimport type { CSSObject, ThemeProps, DefaultTheme } from 'styled-components';\nimport type {\n TextInputProps,\n TouchableHighlight,\n TouchableHighlightProps,\n GestureResponderEvent,\n TextInput,\n} from 'react-native';\nimport { Platform as RNPlatform } from 'react-native';\nimport type { BaseInputProps } from './BaseInput';\nimport type { StyledBaseInputProps } from './types';\nimport { getBaseInputStyles } from './baseInputStyles';\nimport { baseInputHeight } from './baseInputTokens';\nimport { Text } from '~components/Typography';\nimport { useTheme } from '~components/BladeProvider';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { size as sizeToken } from '~tokens/global';\nimport { makeSize } from '~utils/makeSize';\nimport type { Platform } from '~utils';\n\ntype StyledComponentAutoCompleteAndroid =\n | 'off'\n | 'name'\n | 'cc-csc'\n | 'cc-exp'\n | 'cc-exp-month'\n | 'cc-exp-year'\n | 'cc-number'\n | 'email'\n | 'username'\n | 'password'\n | 'postal-code'\n | 'tel'\n | undefined;\n\nconst autoCompleteSuggestionTypeAndroid = {\n none: 'off',\n name: 'name',\n email: 'email',\n username: 'username',\n password: 'password',\n newPassword: 'password-new',\n oneTimeCode: 'sms-otp',\n telephone: 'tel',\n postalCode: 'postal-code',\n countryName: 'postal-address-country',\n creditCardNumber: 'cc-number',\n creditCardCSC: 'cc-csc',\n creditCardExpiry: 'cc-exp',\n creditCardExpiryMonth: 'cc-exp-month',\n creditCardExpiryYear: 'cc-exp-year',\n} as const;\n\nconst autoCompleteSuggestionTypeIOS = {\n none: 'none',\n name: 'name',\n email: 'emailAddress',\n username: 'username',\n password: 'password',\n newPassword: 'newPassword',\n oneTimeCode: 'oneTimeCode',\n telephone: 'telephoneNumber',\n postalCode: 'postalCode',\n countryName: 'countryName',\n creditCardNumber: 'creditCardNumber',\n creditCardCSC: 'none',\n creditCardExpiry: 'none',\n creditCardExpiryMonth: 'none',\n creditCardExpiryYear: 'none',\n} as const;\n\nconst KeyboardTypeToNativeValuesMap = {\n text: 'default',\n search: 'default',\n telephone: 'phone-pad',\n email: 'email-address',\n url: 'url',\n decimal: 'decimal-pad',\n};\n\ntype StyledComponentInputProps = Omit<\n StyledBaseInputProps,\n 'accessibilityProps' | 'setCurrentInteraction' | 'currentInteraction'\n> & {\n isTextArea?: boolean;\n isFocused: boolean;\n autoCompleteType?: typeof autoCompleteSuggestionTypeAndroid[keyof typeof autoCompleteSuggestionTypeAndroid];\n editable?: boolean;\n onPress?: (event: GestureResponderEvent) => void;\n $size: NonNullable<BaseInputProps['size']>;\n};\n\nconst getInputHeight = ({\n isTextArea,\n hasTags,\n numberOfLines,\n lineHeight,\n size,\n}: Pick<StyledBaseInputProps, 'hasTags' | 'isTextArea' | 'numberOfLines'> & {\n lineHeight: number;\n size: NonNullable<BaseInputProps['size']>;\n}): string | undefined => {\n if (isTextArea) {\n return `${lineHeight * (numberOfLines ?? 0)}px`;\n }\n\n if (hasTags) {\n return undefined; // we don't set height on input. We set it on wrapper to properly include tags in overall height\n }\n\n return makeSize(sizeToken[baseInputHeight[size]]);\n};\n\nconst getRNInputStyles = (\n props: StyledComponentInputProps &\n ThemeProps<DefaultTheme> &\n (TextInputProps | TouchableHighlightProps),\n): CSSObject => {\n return {\n ...getBaseInputStyles({\n theme: props.theme,\n isFocused: props.isFocused,\n isDisabled: !props.editable,\n validationState: props.validationState,\n leadingIcon: props.leadingIcon,\n prefix: props.prefix,\n trailingInteractionElement: props.trailingInteractionElement,\n leadingInteractionElement: props.leadingInteractionElement,\n suffix: props.suffix,\n trailingIcon: props.trailingIcon,\n isTextArea: props.isTextArea,\n hasTags: props.hasTags,\n isDropdownTrigger: props.isDropdownTrigger,\n size: props.$size,\n valueComponentType: props.valueComponentType,\n }),\n lineHeight: RNPlatform.select({\n android: makeSize(props.theme.typography.lineHeights[100]),\n ios: undefined,\n }),\n textAlignVertical: 'top',\n height: getInputHeight({\n isTextArea: props.isTextArea,\n hasTags: props.hasTags,\n numberOfLines: props.numberOfLines,\n lineHeight: props.theme.typography.lineHeights[300],\n size: props.$size,\n }),\n };\n};\nconst StyledNativeBaseInput = styled.TextInput<StyledComponentInputProps>(\n ({\n id,\n isFocused,\n theme,\n editable,\n validationState,\n leadingIcon,\n prefix,\n trailingInteractionElement,\n leadingInteractionElement,\n suffix,\n trailingIcon,\n isTextArea,\n numberOfLines,\n isDropdownTrigger,\n hasTags,\n $size,\n valueComponentType,\n }) =>\n getRNInputStyles({\n id,\n isFocused,\n theme,\n editable,\n validationState,\n leadingIcon,\n prefix,\n trailingInteractionElement,\n leadingInteractionElement,\n suffix,\n trailingIcon,\n isTextArea,\n numberOfLines,\n hasTags,\n isDropdownTrigger,\n $size,\n valueComponentType,\n }),\n);\nconst StyledNativeBaseButton = styled.TouchableOpacity<StyledComponentInputProps>(\n ({\n id,\n isFocused,\n theme,\n editable,\n validationState,\n leadingIcon,\n prefix,\n trailingInteractionElement,\n leadingInteractionElement,\n suffix,\n trailingIcon,\n isTextArea,\n numberOfLines,\n isDropdownTrigger,\n hasTags,\n $size,\n valueComponentType,\n }) => ({\n ...getRNInputStyles({\n id,\n isFocused,\n theme,\n editable,\n validationState,\n leadingIcon,\n prefix,\n trailingInteractionElement,\n leadingInteractionElement,\n suffix,\n trailingIcon,\n isTextArea,\n numberOfLines,\n isDropdownTrigger,\n hasTags,\n $size,\n valueComponentType,\n }),\n }),\n);\n\nconst _StyledBaseInput: React.ForwardRefRenderFunction<\n TextInput | TouchableHighlight,\n StyledBaseInputProps\n> = (\n {\n name,\n isRequired,\n isDisabled,\n maxCharacters,\n handleOnFocus,\n handleOnChange,\n handleOnBlur,\n handleOnSubmit,\n handleOnInput,\n handleOnKeyDown,\n handleOnClick,\n keyboardType = 'text',\n keyboardReturnKeyType,\n autoCompleteSuggestionType,\n accessibilityProps,\n currentInteraction,\n setCurrentInteraction,\n type,\n numberOfLines,\n isTextArea,\n hasPopup,\n shouldIgnoreBlurAnimation,\n autoCapitalize,\n as: renderAs,\n $size,\n ...props\n },\n ref,\n) => {\n const buttonValue = props.value ? props.value : props.placeholder;\n const { theme } = useTheme();\n const commonProps = {\n onBlur: (): void => {\n // In certain cases like SelectInput, we want to ignore the blur animation when option item is clicked.\n // The selectinput should always look like it is in focus otherwise it triggers blur + focus again which can cause flicker\n if (!shouldIgnoreBlurAnimation) {\n setCurrentInteraction('default');\n }\n },\n isFocused: currentInteraction === 'focus',\n };\n\n return renderAs === 'button' ? (\n <StyledNativeBaseButton\n // the types of styled-components for react-native is creating a mess, so there's no other option but to type `ref` as any\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ref={ref as any}\n onPress={(): void => {\n handleOnClick?.({ name, value: props.value });\n }}\n onFocus={(): void => {\n handleOnFocus?.({ name, value: props.value });\n setCurrentInteraction('focus');\n }}\n as={undefined}\n $size={$size}\n {...commonProps}\n {...props}\n {...accessibilityProps}\n >\n <Text\n color={\n props.value && !isDisabled ? 'surface.text.gray.subtle' : 'surface.text.gray.disabled'\n }\n truncateAfterLines={1}\n textAlign={props.textAlign}\n size={$size}\n >\n {buttonValue}\n </Text>\n </StyledNativeBaseButton>\n ) : (\n <StyledNativeBaseInput\n // the types of styled-components for react-native is creating a mess, so there's no other option but to type `ref` as any\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ref={ref as any}\n multiline={isTextArea}\n numberOfLines={numberOfLines}\n editable={!isDisabled}\n maxLength={maxCharacters}\n placeholderTextColor={theme.colors.surface.text.gray.disabled}\n onFocus={(event): void => {\n handleOnFocus?.({ name, value: event?.nativeEvent.text });\n // React Native does not have native onPress event on Input elements so for consistency of API we call it on onFocus which also gets triggered on clicks\n handleOnClick?.({ name, value: event?.nativeEvent.text });\n setCurrentInteraction('focus');\n }}\n onChangeText={(text): void => {\n handleOnChange?.({ name, value: text });\n handleOnInput?.({ name, value: text });\n }}\n onEndEditing={(event): void => handleOnBlur?.({ name, value: event?.nativeEvent.text })}\n onSubmitEditing={(event): void => handleOnSubmit?.({ name, value: event?.nativeEvent.text })}\n onKeyPress={(event): void => {\n handleOnKeyDown?.({\n name,\n key: event?.nativeEvent.key,\n event: (event as unknown) as React.KeyboardEvent<HTMLInputElement>, // TODO: handle platform specific type\n });\n }}\n // @ts-expect-error styled-components have limited keyboard types('default' | 'email-address' | 'numeric' | 'phone-pad' | 'number-pad' | 'decimal-pad') compared to the actual supported types so ignoring the error.\n // source: https://reactnative.dev/docs/textinput/#keyboardtype\n keyboardType={KeyboardTypeToNativeValuesMap[keyboardType]}\n returnKeyType={keyboardReturnKeyType}\n autoCompleteType={\n autoCompleteSuggestionType\n ? (autoCompleteSuggestionTypeAndroid[\n autoCompleteSuggestionType as Platform.CastNative<\n BaseInputProps['autoCompleteSuggestionType']\n >\n ] as StyledComponentAutoCompleteAndroid)\n : undefined\n }\n secureTextEntry={type === 'password'}\n isTextArea={isTextArea}\n textContentType={\n autoCompleteSuggestionType\n ? autoCompleteSuggestionTypeIOS[\n autoCompleteSuggestionType as Platform.CastNative<\n BaseInputProps['autoCompleteSuggestionType']\n >\n ]\n : undefined\n }\n autoCapitalize={autoCapitalize}\n $size={$size}\n {...commonProps}\n {...props}\n {...accessibilityProps}\n />\n );\n};\n\nconst StyledBaseInput = assignWithoutSideEffects(React.forwardRef(_StyledBaseInput), {\n displayName: 'StyledBaseInput',\n});\n\nexport { StyledBaseInput };\n"],"names":["autoCompleteSuggestionTypeAndroid","none","name","email","username","password","newPassword","oneTimeCode","telephone","postalCode","countryName","creditCardNumber","creditCardCSC","creditCardExpiry","creditCardExpiryMonth","creditCardExpiryYear","autoCompleteSuggestionTypeIOS","KeyboardTypeToNativeValuesMap","text","search","url","decimal","getInputHeight","_ref","isTextArea","hasTags","numberOfLines","lineHeight","size","undefined","makeSize","sizeToken","baseInputHeight","getRNInputStyles","props","Object","assign","getBaseInputStyles","theme","isFocused","isDisabled","editable","validationState","leadingIcon","prefix","trailingInteractionElement","leadingInteractionElement","suffix","trailingIcon","isDropdownTrigger","$size","valueComponentType","RNPlatform","select","android","typography","lineHeights","ios","textAlignVertical","height","StyledNativeBaseInput","styled","TextInput","_ref2","id","StyledNativeBaseButton","TouchableOpacity","_ref3","_StyledBaseInput","_ref4","ref","isRequired","maxCharacters","handleOnFocus","handleOnChange","handleOnBlur","handleOnSubmit","handleOnInput","handleOnKeyDown","handleOnClick","_ref4$keyboardType","keyboardType","keyboardReturnKeyType","autoCompleteSuggestionType","accessibilityProps","currentInteraction","setCurrentInteraction","type","hasPopup","shouldIgnoreBlurAnimation","autoCapitalize","renderAs","as","_objectWithoutProperties","_excluded","buttonValue","value","placeholder","_useTheme","useTheme","commonProps","onBlur","_jsx","onPress","onFocus","children","Text","color","truncateAfterLines","textAlign","multiline","maxLength","placeholderTextColor","colors","surface","gray","disabled","event","nativeEvent","onChangeText","onEndEditing","onSubmitEditing","onKeyPress","key","returnKeyType","autoCompleteType","secureTextEntry","textContentType","StyledBaseInput","assignWithoutSideEffects","React","forwardRef","displayName"],"mappings":";;;;;;;;;;;;;;;;;;;;;maAqCA,IAAMA,iCAAiC,CAAG,CACxCC,IAAI,CAAE,KAAK,CACXC,IAAI,CAAE,MAAM,CACZC,KAAK,CAAE,OAAO,CACdC,QAAQ,CAAE,UAAU,CACpBC,QAAQ,CAAE,UAAU,CACpBC,WAAW,CAAE,cAAc,CAC3BC,WAAW,CAAE,SAAS,CACtBC,SAAS,CAAE,KAAK,CAChBC,UAAU,CAAE,aAAa,CACzBC,WAAW,CAAE,wBAAwB,CACrCC,gBAAgB,CAAE,WAAW,CAC7BC,aAAa,CAAE,QAAQ,CACvBC,gBAAgB,CAAE,QAAQ,CAC1BC,qBAAqB,CAAE,cAAc,CACrCC,oBAAoB,CAAE,aACxB,CAAU,CAEV,IAAMC,6BAA6B,CAAG,CACpCf,IAAI,CAAE,MAAM,CACZC,IAAI,CAAE,MAAM,CACZC,KAAK,CAAE,cAAc,CACrBC,QAAQ,CAAE,UAAU,CACpBC,QAAQ,CAAE,UAAU,CACpBC,WAAW,CAAE,aAAa,CAC1BC,WAAW,CAAE,aAAa,CAC1BC,SAAS,CAAE,iBAAiB,CAC5BC,UAAU,CAAE,YAAY,CACxBC,WAAW,CAAE,aAAa,CAC1BC,gBAAgB,CAAE,kBAAkB,CACpCC,aAAa,CAAE,MAAM,CACrBC,gBAAgB,CAAE,MAAM,CACxBC,qBAAqB,CAAE,MAAM,CAC7BC,oBAAoB,CAAE,MACxB,CAAU,CAEV,IAAME,6BAA6B,CAAG,CACpCC,IAAI,CAAE,SAAS,CACfC,MAAM,CAAE,SAAS,CACjBX,SAAS,CAAE,WAAW,CACtBL,KAAK,CAAE,eAAe,CACtBiB,GAAG,CAAE,KAAK,CACVC,OAAO,CAAE,aACX,CAAC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CAAE,SAAAA,UAACL,CAAAA,KAAK,CAAW,CAC3BvC,eAAe,cAAfA,eAAe,CAAG,CAChB5E,IAAI,CAAJA,IAAI,CACJyH,GAAG,CAAEN,KAAK,EAALA,IAAAA,CAAAA,KAAAA,CAAAA,CAAAA,KAAK,CAAEC,WAAW,CAACK,GAAG,CAC3BN,KAAK,CAAGA,KACV,CAAC,CAAC,CACJ,CAAE,CAGFpC,YAAY,CAAEhE,6BAA6B,CAACgE,YAAY,CAAE,CAC1D2C,aAAa,CAAE1C,qBAAsB,CACrC2C,gBAAgB,CACd1C,0BAA0B,CACrBnF,iCAAiC,CAChCmF,0BAA0B,CAG3B,CACDtD,SACL,CACDiG,eAAe,CAAEvC,IAAI,GAAK,UAAW,CACrC/D,UAAU,CAAEA,UAAW,CACvBuG,eAAe,CACb5C,0BAA0B,CACtBnE,6BAA6B,CAC3BmE,0BAA0B,CAG3B,CACDtD,SACL,CACD6D,cAAc,CAAEA,cAAe,CAC/BxC,KAAK,CAAEA,KAAM,EACTkD,WAAW,CACXlE,KAAK,CACLkD,kBAAkB,CACvB,CACF,CACH,CAAC,CAEK,IAAA4C,eAAe,CAAGC,wBAAwB,CAACC,cAAK,CAACC,UAAU,CAAC/D,gBAAgB,CAAC,CAAE,CACnFgE,WAAW,CAAE,iBACf,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"StyledBaseInput.native.js","sources":["../../../../../../src/components/Input/BaseInput/StyledBaseInput.native.tsx"],"sourcesContent":["import React from 'react';\nimport styled from 'styled-components/native';\nimport type { CSSObject, ThemeProps, DefaultTheme } from 'styled-components';\nimport type {\n TextInputProps,\n TouchableHighlight,\n TouchableHighlightProps,\n GestureResponderEvent,\n TextInput,\n} from 'react-native';\nimport { Platform as RNPlatform } from 'react-native';\nimport type { BaseInputProps } from './BaseInput';\nimport type { StyledBaseInputProps } from './types';\nimport { getBaseInputStyles } from './baseInputStyles';\nimport { baseInputHeight } from './baseInputTokens';\nimport { Text } from '~components/Typography';\nimport { useTheme } from '~components/BladeProvider';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { size as sizeToken } from '~tokens/global';\nimport { makeSize } from '~utils/makeSize';\nimport type { Platform } from '~utils';\n\ntype StyledComponentAutoCompleteAndroid =\n | 'off'\n | 'name'\n | 'cc-csc'\n | 'cc-exp'\n | 'cc-exp-month'\n | 'cc-exp-year'\n | 'cc-number'\n | 'email'\n | 'username'\n | 'password'\n | 'postal-code'\n | 'tel'\n | undefined;\n\nconst autoCompleteSuggestionTypeAndroid = {\n none: 'off',\n name: 'name',\n email: 'email',\n username: 'username',\n password: 'password',\n newPassword: 'password-new',\n oneTimeCode: 'sms-otp',\n telephone: 'tel',\n postalCode: 'postal-code',\n countryName: 'postal-address-country',\n creditCardNumber: 'cc-number',\n creditCardCSC: 'cc-csc',\n creditCardExpiry: 'cc-exp',\n creditCardExpiryMonth: 'cc-exp-month',\n creditCardExpiryYear: 'cc-exp-year',\n} as const;\n\nconst autoCompleteSuggestionTypeIOS = {\n none: 'none',\n name: 'name',\n email: 'emailAddress',\n username: 'username',\n password: 'password',\n newPassword: 'newPassword',\n oneTimeCode: 'oneTimeCode',\n telephone: 'telephoneNumber',\n postalCode: 'postalCode',\n countryName: 'countryName',\n creditCardNumber: 'creditCardNumber',\n creditCardCSC: 'none',\n creditCardExpiry: 'none',\n creditCardExpiryMonth: 'none',\n creditCardExpiryYear: 'none',\n} as const;\n\nconst KeyboardTypeToNativeValuesMap = {\n text: 'default',\n search: 'default',\n telephone: 'phone-pad',\n email: 'email-address',\n url: 'url',\n decimal: 'decimal-pad',\n};\n\ntype StyledComponentInputProps = Omit<\n StyledBaseInputProps,\n 'accessibilityProps' | 'setCurrentInteraction' | 'currentInteraction'\n> & {\n isTextArea?: boolean;\n isFocused: boolean;\n autoCompleteType?: typeof autoCompleteSuggestionTypeAndroid[keyof typeof autoCompleteSuggestionTypeAndroid];\n editable?: boolean;\n onPress?: (event: GestureResponderEvent) => void;\n $size: NonNullable<BaseInputProps['size']>;\n};\n\nconst getInputHeight = ({\n isTextArea,\n hasTags,\n numberOfLines,\n isDropdownTrigger,\n size,\n}: Pick<StyledBaseInputProps, 'hasTags' | 'isTextArea' | 'numberOfLines' | 'isDropdownTrigger'> & {\n size: NonNullable<BaseInputProps['size']>;\n}): string | undefined => {\n if (isTextArea) {\n const lines = isDropdownTrigger ? 1 : numberOfLines ?? 0;\n return `${baseInputHeight[size] * lines}px`;\n }\n\n if (hasTags) {\n return undefined; // we don't set height on input. We set it on wrapper to properly include tags in overall height\n }\n\n return makeSize(sizeToken[baseInputHeight[size]]);\n};\n\nconst getRNInputStyles = (\n props: StyledComponentInputProps &\n ThemeProps<DefaultTheme> &\n (TextInputProps | TouchableHighlightProps),\n): CSSObject => {\n return {\n ...getBaseInputStyles({\n theme: props.theme,\n isFocused: props.isFocused,\n isDisabled: !props.editable,\n validationState: props.validationState,\n leadingIcon: props.leadingIcon,\n prefix: props.prefix,\n trailingInteractionElement: props.trailingInteractionElement,\n leadingInteractionElement: props.leadingInteractionElement,\n suffix: props.suffix,\n trailingIcon: props.trailingIcon,\n isTextArea: props.isTextArea,\n hasTags: props.hasTags,\n isDropdownTrigger: props.isDropdownTrigger,\n size: props.$size,\n valueComponentType: props.valueComponentType,\n }),\n lineHeight: RNPlatform.select({\n android: makeSize(props.theme.typography.lineHeights[100]),\n ios: undefined,\n }),\n textAlignVertical: 'top',\n height: getInputHeight({\n isTextArea: props.isTextArea,\n hasTags: props.hasTags,\n numberOfLines: props.numberOfLines,\n isDropdownTrigger: props.isDropdownTrigger,\n size: props.$size,\n }),\n };\n};\nconst StyledNativeBaseInput = styled.TextInput<StyledComponentInputProps>(\n ({\n id,\n isFocused,\n theme,\n editable,\n validationState,\n leadingIcon,\n prefix,\n trailingInteractionElement,\n leadingInteractionElement,\n suffix,\n trailingIcon,\n isTextArea,\n numberOfLines,\n isDropdownTrigger,\n hasTags,\n $size,\n valueComponentType,\n }) =>\n getRNInputStyles({\n id,\n isFocused,\n theme,\n editable,\n validationState,\n leadingIcon,\n prefix,\n trailingInteractionElement,\n leadingInteractionElement,\n suffix,\n trailingIcon,\n isTextArea,\n numberOfLines,\n hasTags,\n isDropdownTrigger,\n $size,\n valueComponentType,\n }),\n);\nconst StyledNativeBaseButton = styled.TouchableOpacity<StyledComponentInputProps>(\n ({\n id,\n isFocused,\n theme,\n editable,\n validationState,\n leadingIcon,\n prefix,\n trailingInteractionElement,\n leadingInteractionElement,\n suffix,\n trailingIcon,\n isTextArea,\n numberOfLines,\n isDropdownTrigger,\n hasTags,\n $size,\n valueComponentType,\n }) => ({\n ...getRNInputStyles({\n id,\n isFocused,\n theme,\n editable,\n validationState,\n leadingIcon,\n prefix,\n trailingInteractionElement,\n leadingInteractionElement,\n suffix,\n trailingIcon,\n isTextArea,\n numberOfLines,\n isDropdownTrigger,\n hasTags,\n $size,\n valueComponentType,\n }),\n }),\n);\n\nconst _StyledBaseInput: React.ForwardRefRenderFunction<\n TextInput | TouchableHighlight,\n StyledBaseInputProps\n> = (\n {\n name,\n isRequired,\n isDisabled,\n maxCharacters,\n handleOnFocus,\n handleOnChange,\n handleOnBlur,\n handleOnSubmit,\n handleOnInput,\n handleOnKeyDown,\n handleOnClick,\n keyboardType = 'text',\n keyboardReturnKeyType,\n autoCompleteSuggestionType,\n accessibilityProps,\n currentInteraction,\n setCurrentInteraction,\n type,\n numberOfLines,\n isTextArea,\n hasPopup,\n shouldIgnoreBlurAnimation,\n autoCapitalize,\n as: renderAs,\n $size,\n ...props\n },\n ref,\n) => {\n const buttonValue = props.value ? props.value : props.placeholder;\n const { theme } = useTheme();\n const commonProps = {\n onBlur: (): void => {\n // In certain cases like SelectInput, we want to ignore the blur animation when option item is clicked.\n // The selectinput should always look like it is in focus otherwise it triggers blur + focus again which can cause flicker\n if (!shouldIgnoreBlurAnimation) {\n setCurrentInteraction('default');\n }\n },\n isFocused: currentInteraction === 'focus',\n };\n\n return renderAs === 'button' ? (\n <StyledNativeBaseButton\n // the types of styled-components for react-native is creating a mess, so there's no other option but to type `ref` as any\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ref={ref as any}\n onPress={(): void => {\n handleOnClick?.({ name, value: props.value });\n }}\n onFocus={(): void => {\n handleOnFocus?.({ name, value: props.value });\n setCurrentInteraction('focus');\n }}\n as={undefined}\n $size={$size}\n {...commonProps}\n {...props}\n {...accessibilityProps}\n >\n <Text\n color={\n props.value && !isDisabled ? 'surface.text.gray.subtle' : 'surface.text.gray.disabled'\n }\n truncateAfterLines={1}\n textAlign={props.textAlign}\n size={$size}\n >\n {buttonValue}\n </Text>\n </StyledNativeBaseButton>\n ) : (\n <StyledNativeBaseInput\n // the types of styled-components for react-native is creating a mess, so there's no other option but to type `ref` as any\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ref={ref as any}\n multiline={isTextArea}\n numberOfLines={numberOfLines}\n editable={!isDisabled}\n maxLength={maxCharacters}\n placeholderTextColor={theme.colors.surface.text.gray.disabled}\n onFocus={(event): void => {\n handleOnFocus?.({ name, value: event?.nativeEvent.text });\n // React Native does not have native onPress event on Input elements so for consistency of API we call it on onFocus which also gets triggered on clicks\n handleOnClick?.({ name, value: event?.nativeEvent.text });\n setCurrentInteraction('focus');\n }}\n onChangeText={(text): void => {\n handleOnChange?.({ name, value: text });\n handleOnInput?.({ name, value: text });\n }}\n onEndEditing={(event): void => handleOnBlur?.({ name, value: event?.nativeEvent.text })}\n onSubmitEditing={(event): void => handleOnSubmit?.({ name, value: event?.nativeEvent.text })}\n onKeyPress={(event): void => {\n handleOnKeyDown?.({\n name,\n key: event?.nativeEvent.key,\n event: (event as unknown) as React.KeyboardEvent<HTMLInputElement>, // TODO: handle platform specific type\n });\n }}\n // @ts-expect-error styled-components have limited keyboard types('default' | 'email-address' | 'numeric' | 'phone-pad' | 'number-pad' | 'decimal-pad') compared to the actual supported types so ignoring the error.\n // source: https://reactnative.dev/docs/textinput/#keyboardtype\n keyboardType={KeyboardTypeToNativeValuesMap[keyboardType]}\n returnKeyType={keyboardReturnKeyType}\n autoCompleteType={\n autoCompleteSuggestionType\n ? (autoCompleteSuggestionTypeAndroid[\n autoCompleteSuggestionType as Platform.CastNative<\n BaseInputProps['autoCompleteSuggestionType']\n >\n ] as StyledComponentAutoCompleteAndroid)\n : undefined\n }\n secureTextEntry={type === 'password'}\n isTextArea={isTextArea}\n textContentType={\n autoCompleteSuggestionType\n ? autoCompleteSuggestionTypeIOS[\n autoCompleteSuggestionType as Platform.CastNative<\n BaseInputProps['autoCompleteSuggestionType']\n >\n ]\n : undefined\n }\n autoCapitalize={autoCapitalize}\n $size={$size}\n {...commonProps}\n {...props}\n {...accessibilityProps}\n />\n );\n};\n\nconst StyledBaseInput = assignWithoutSideEffects(React.forwardRef(_StyledBaseInput), {\n displayName: 'StyledBaseInput',\n});\n\nexport { StyledBaseInput };\n"],"names":["autoCompleteSuggestionTypeAndroid","none","name","email","username","password","newPassword","oneTimeCode","telephone","postalCode","countryName","creditCardNumber","creditCardCSC","creditCardExpiry","creditCardExpiryMonth","creditCardExpiryYear","autoCompleteSuggestionTypeIOS","KeyboardTypeToNativeValuesMap","text","search","url","decimal","getInputHeight","_ref","isTextArea","hasTags","numberOfLines","isDropdownTrigger","size","lines","baseInputHeight","undefined","makeSize","sizeToken","getRNInputStyles","props","Object","assign","getBaseInputStyles","theme","isFocused","isDisabled","editable","validationState","leadingIcon","prefix","trailingInteractionElement","leadingInteractionElement","suffix","trailingIcon","$size","valueComponentType","lineHeight","RNPlatform","select","android","typography","lineHeights","ios","textAlignVertical","height","StyledNativeBaseInput","styled","TextInput","_ref2","id","StyledNativeBaseButton","TouchableOpacity","_ref3","_StyledBaseInput","_ref4","ref","isRequired","maxCharacters","handleOnFocus","handleOnChange","handleOnBlur","handleOnSubmit","handleOnInput","handleOnKeyDown","handleOnClick","_ref4$keyboardType","keyboardType","keyboardReturnKeyType","autoCompleteSuggestionType","accessibilityProps","currentInteraction","setCurrentInteraction","type","hasPopup","shouldIgnoreBlurAnimation","autoCapitalize","renderAs","as","_objectWithoutProperties","_excluded","buttonValue","value","placeholder","_useTheme","useTheme","commonProps","onBlur","_jsx","onPress","onFocus","children","Text","color","truncateAfterLines","textAlign","multiline","maxLength","placeholderTextColor","colors","surface","gray","disabled","event","nativeEvent","onChangeText","onEndEditing","onSubmitEditing","onKeyPress","key","returnKeyType","autoCompleteType","secureTextEntry","textContentType","StyledBaseInput","assignWithoutSideEffects","React","forwardRef","displayName"],"mappings":";;;;;;;;;;;;;;;;;;;;;maAqCA,IAAMA,iCAAiC,CAAG,CACxCC,IAAI,CAAE,KAAK,CACXC,IAAI,CAAE,MAAM,CACZC,KAAK,CAAE,OAAO,CACdC,QAAQ,CAAE,UAAU,CACpBC,QAAQ,CAAE,UAAU,CACpBC,WAAW,CAAE,cAAc,CAC3BC,WAAW,CAAE,SAAS,CACtBC,SAAS,CAAE,KAAK,CAChBC,UAAU,CAAE,aAAa,CACzBC,WAAW,CAAE,wBAAwB,CACrCC,gBAAgB,CAAE,WAAW,CAC7BC,aAAa,CAAE,QAAQ,CACvBC,gBAAgB,CAAE,QAAQ,CAC1BC,qBAAqB,CAAE,cAAc,CACrCC,oBAAoB,CAAE,aACxB,CAAU,CAEV,IAAMC,6BAA6B,CAAG,CACpCf,IAAI,CAAE,MAAM,CACZC,IAAI,CAAE,MAAM,CACZC,KAAK,CAAE,cAAc,CACrBC,QAAQ,CAAE,UAAU,CACpBC,QAAQ,CAAE,UAAU,CACpBC,WAAW,CAAE,aAAa,CAC1BC,WAAW,CAAE,aAAa,CAC1BC,SAAS,CAAE,iBAAiB,CAC5BC,UAAU,CAAE,YAAY,CACxBC,WAAW,CAAE,aAAa,CAC1BC,gBAAgB,CAAE,kBAAkB,CACpCC,aAAa,CAAE,MAAM,CACrBC,gBAAgB,CAAE,MAAM,CACxBC,qBAAqB,CAAE,MAAM,CAC7BC,oBAAoB,CAAE,MACxB,CAAU,CAEV,IAAME,6BAA6B,CAAG,CACpCC,IAAI,CAAE,SAAS,CACfC,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AG,CAAE3E,IAAI,CAAJA,IAAI,CAAE+F,KAAK,CAAEqB,KAAK,EAALA,IAAAA,CAAAA,KAAAA,CAAAA,CAAAA,KAAK,CAAEC,WAAW,CAACrG,IAAK,CAAC,CAAC,EAAC,CAC7FyG,UAAU,CAAE,SAAAA,UAAAA,CAACL,KAAK,CAAW,CAC3BvC,eAAe,EAAfA,IAAAA,CAAAA,KAAAA,CAAAA,CAAAA,eAAe,CAAG,CAChB7E,IAAI,CAAJA,IAAI,CACJ0H,GAAG,CAAEN,KAAK,EAAA,IAAA,CAAA,KAAA,CAAA,CAALA,KAAK,CAAEC,WAAW,CAACK,GAAG,CAC3BN,KAAK,CAAGA,KACV,CAAC,CAAC,CACJ,CAAE,CAGFpC,YAAY,CAAEjE,6BAA6B,CAACiE,YAAY,CAAE,CAC1D2C,aAAa,CAAE1C,qBAAsB,CACrC2C,gBAAgB,CACd1C,0BAA0B,CACrBpF,iCAAiC,CAChCoF,0BAA0B,CAG3B,CACDrD,SACL,CACDgG,eAAe,CAAEvC,IAAI,GAAK,UAAW,CACrChE,UAAU,CAAEA,UAAW,CACvBwG,eAAe,CACb5C,0BAA0B,CACtBpE,6BAA6B,CAC3BoE,0BAA0B,CAG3B,CACDrD,SACL,CACD4D,cAAc,CAAEA,cAAe,CAC/BzC,KAAK,CAAEA,KAAM,EACTmD,WAAW,CACXlE,KAAK,CACLkD,kBAAkB,CACvB,CACF,CACH,CAAC,CAEK,IAAA4C,eAAe,CAAGC,wBAAwB,CAACC,cAAK,CAACC,UAAU,CAAC/D,gBAAgB,CAAC,CAAE,CACnFgE,WAAW,CAAE,iBACf,CAAC;;;;"}
|
|
@@ -12,7 +12,7 @@ import '../../BladeProvider/useTheme.js';
|
|
|
12
12
|
import getIn from '../../../utils/lodashButBetter/get.js';
|
|
13
13
|
import getHeadingStyles from '../../Typography/Heading/getHeadingStyles.js';
|
|
14
14
|
|
|
15
|
-
var getBaseInputState=function getBaseInputState(_ref){var isFocused=_ref.isFocused,isHovered=_ref.isHovered,isDisabled=_ref.isDisabled;if(isDisabled){return 'disabled';}else if(isFocused){return 'focused';}else if(isHovered){return 'hovered';}else {return 'default';}};var getInputBackgroundAndBorderStyles=function getInputBackgroundAndBorderStyles(_ref2){var theme=_ref2.theme,isHovered=_ref2.isHovered,isFocused=_ref2.isFocused,isDisabled=_ref2.isDisabled,validationState=_ref2.validationState,isTextArea=_ref2.isTextArea,isDropdownTrigger=_ref2.isDropdownTrigger;var backgroundColor=getIn(theme.colors,baseInputBackgroundColor.default);var borderColor=getIn(theme.colors,baseInputBorderColor.default);var borderWidth=getIn(theme.border.width,baseInputBorderWidth.default);var baseInputState=getBaseInputState({isFocused:isFocused,isHovered:isHovered,isDisabled:isDisabled});backgroundColor=getIn(theme.colors,baseInputBackgroundColor[baseInputState]);borderColor=getIn(theme.colors,baseInputBorderColor[baseInputState]);borderWidth=getIn(theme.border.width,baseInputBorderWidth[baseInputState]);if(validationState==='error'){borderColor=getIn(theme.colors,baseInputBorderColor.error);borderWidth=getIn(theme.border.width,baseInputBorderWidth.error);}else if(validationState==='success'){borderColor=getIn(theme.colors,baseInputBorderColor.success);borderWidth=getIn(theme.border.width,baseInputBorderWidth.success);}return Object.assign({backgroundColor:backgroundColor,borderRadius:makeBorderSize(theme.border.radius.medium),borderStyle:'solid',display:'flex',flexDirection:'row',width:'100%',alignItems:isTextArea?'flex-start':undefined,position:'relative',height:isDropdownTrigger?'auto':undefined,border:'none'},getBaseInputBorderStyles({theme:theme,borderColor:borderColor,borderWidth:borderWidth,isFocused:isFocused}));};var getLeftPadding=function getLeftPadding(_ref3){var theme=_ref3.theme,isDropdownTrigger=_ref3.isDropdownTrigger,hasLeadingIcon=_ref3.hasLeadingIcon,hasPrefix=_ref3.hasPrefix,size=_ref3.size;if(isDropdownTrigger){return theme.spacing[0];}if(hasLeadingIcon||hasPrefix){return theme.spacing[3];}return theme.spacing[baseInputPaddingTokens.left[size]];};var getRightPadding=function getRightPadding(_ref4){var theme=_ref4.theme,hasTrailingInteractionElement=_ref4.hasTrailingInteractionElement,hasSuffix=_ref4.hasSuffix,hasTrailingIcon=_ref4.hasTrailingIcon,size=_ref4.size;if(hasTrailingInteractionElement||hasSuffix||hasTrailingIcon){return theme.spacing[3];}return theme.spacing[baseInputPaddingTokens.right[size]];};var getBaseInputStyles=function getBaseInputStyles(_ref5){var theme=_ref5.theme,isDisabled=_ref5.isDisabled,leadingIcon=_ref5.leadingIcon,prefix=_ref5.prefix,trailingInteractionElement=_ref5.trailingInteractionElement,leadingInteractionElement=_ref5.leadingInteractionElement,suffix=_ref5.suffix,trailingIcon=_ref5.trailingIcon,textAlign=_ref5.textAlign,isTextArea=_ref5.isTextArea,hasTags=_ref5.hasTags,isDropdownTrigger=_ref5.isDropdownTrigger,size=_ref5.size,valueComponentType=_ref5.valueComponentType;var _getInputVisualsToBeR=getInputVisualsToBeRendered({leadingIcon:leadingIcon,prefix:prefix,trailingInteractionElement:trailingInteractionElement,leadingInteractionElement:leadingInteractionElement,suffix:suffix,trailingIcon:trailingIcon,size:size}),hasLeadingIcon=_getInputVisualsToBeR.hasLeadingIcon,hasPrefix=_getInputVisualsToBeR.hasPrefix,hasTrailingInteractionElement=_getInputVisualsToBeR.hasTrailingInteractionElement,hasSuffix=_getInputVisualsToBeR.hasSuffix,hasTrailingIcon=_getInputVisualsToBeR.hasTrailingIcon;var isDropdownWithTags=isDropdownTrigger&&hasTags;var isReactNative=getPlatformType()==='react-native';return Object.assign({},valueComponentType==='heading'?getHeadingStyles({size:size,weight:'regular',color:isDisabled?'surface.text.gray.disabled':'surface.text.gray.subtle',theme:theme}):getTextStyles({size:size,variant:'body',weight:'regular',color:isDisabled?'surface.text.gray.disabled':'surface.text.gray.subtle',theme:theme}),{flex:1,backgroundColor:'transparent',paddingTop:makeSpace(theme.spacing[baseInputPaddingTokens.top[size]]),paddingBottom:makeSpace(theme.spacing[baseInputPaddingTokens.bottom[size]]),paddingLeft:makeSpace(getLeftPadding({theme:theme,isDropdownTrigger:isDropdownTrigger,hasLeadingIcon:hasLeadingIcon,hasPrefix:hasPrefix,size:size})),paddingRight:getRightPadding({theme:theme,hasTrailingInteractionElement:hasTrailingInteractionElement,hasSuffix:hasSuffix,hasTrailingIcon:hasTrailingIcon,size:size}),textAlign:textAlign,width:'100%',height:isTextArea||isDropdownWithTags?undefined:makeSpace(baseInputHeight[size]),minHeight:isDropdownWithTags?undefined:makeSpace(baseInputHeight[size])},isReactNative?{}:{resize:'none'});};var getAnimatedBaseInputWrapperMaxHeight=function getAnimatedBaseInputWrapperMaxHeight(_ref6){var maxTagRows=_ref6.maxTagRows,showAllTags=_ref6.showAllTags,size=_ref6.size;if(maxTagRows==='single'){return baseInputHeight[size];}if(maxTagRows==='multiple'){return baseInputWrapperMaxHeight[size];}return showAllTags?baseInputWrapperMaxHeight[size]:baseInputHeight[size];};
|
|
15
|
+
var getBaseInputState=function getBaseInputState(_ref){var isFocused=_ref.isFocused,isHovered=_ref.isHovered,isDisabled=_ref.isDisabled;if(isDisabled){return 'disabled';}else if(isFocused){return 'focused';}else if(isHovered){return 'hovered';}else {return 'default';}};var getInputBackgroundAndBorderStyles=function getInputBackgroundAndBorderStyles(_ref2){var theme=_ref2.theme,isHovered=_ref2.isHovered,isFocused=_ref2.isFocused,isDisabled=_ref2.isDisabled,validationState=_ref2.validationState,isTextArea=_ref2.isTextArea,isDropdownTrigger=_ref2.isDropdownTrigger;var backgroundColor=getIn(theme.colors,baseInputBackgroundColor.default);var borderColor=getIn(theme.colors,baseInputBorderColor.default);var borderWidth=getIn(theme.border.width,baseInputBorderWidth.default);var baseInputState=getBaseInputState({isFocused:isFocused,isHovered:isHovered,isDisabled:isDisabled});backgroundColor=getIn(theme.colors,baseInputBackgroundColor[baseInputState]);borderColor=getIn(theme.colors,baseInputBorderColor[baseInputState]);borderWidth=getIn(theme.border.width,baseInputBorderWidth[baseInputState]);if(validationState==='error'){borderColor=getIn(theme.colors,baseInputBorderColor.error);borderWidth=getIn(theme.border.width,baseInputBorderWidth.error);}else if(validationState==='success'){borderColor=getIn(theme.colors,baseInputBorderColor.success);borderWidth=getIn(theme.border.width,baseInputBorderWidth.success);}return Object.assign({backgroundColor:backgroundColor,borderRadius:makeBorderSize(theme.border.radius.medium),borderStyle:'solid',display:'flex',flexDirection:'row',width:'100%',alignItems:isTextArea?'flex-start':undefined,position:'relative',height:isDropdownTrigger&&!isTextArea?'auto':undefined,border:'none'},getBaseInputBorderStyles({theme:theme,borderColor:borderColor,borderWidth:borderWidth,isFocused:isFocused}));};var getLeftPadding=function getLeftPadding(_ref3){var theme=_ref3.theme,isDropdownTrigger=_ref3.isDropdownTrigger,hasLeadingIcon=_ref3.hasLeadingIcon,hasPrefix=_ref3.hasPrefix,size=_ref3.size;if(isDropdownTrigger){return theme.spacing[0];}if(hasLeadingIcon||hasPrefix){return theme.spacing[3];}return theme.spacing[baseInputPaddingTokens.left[size]];};var getRightPadding=function getRightPadding(_ref4){var theme=_ref4.theme,hasTrailingInteractionElement=_ref4.hasTrailingInteractionElement,hasSuffix=_ref4.hasSuffix,hasTrailingIcon=_ref4.hasTrailingIcon,size=_ref4.size;if(hasTrailingInteractionElement||hasSuffix||hasTrailingIcon){return theme.spacing[3];}return theme.spacing[baseInputPaddingTokens.right[size]];};var getBaseInputStyles=function getBaseInputStyles(_ref5){var theme=_ref5.theme,isDisabled=_ref5.isDisabled,leadingIcon=_ref5.leadingIcon,prefix=_ref5.prefix,trailingInteractionElement=_ref5.trailingInteractionElement,leadingInteractionElement=_ref5.leadingInteractionElement,suffix=_ref5.suffix,trailingIcon=_ref5.trailingIcon,textAlign=_ref5.textAlign,isTextArea=_ref5.isTextArea,hasTags=_ref5.hasTags,isDropdownTrigger=_ref5.isDropdownTrigger,size=_ref5.size,valueComponentType=_ref5.valueComponentType;var _getInputVisualsToBeR=getInputVisualsToBeRendered({leadingIcon:leadingIcon,prefix:prefix,trailingInteractionElement:trailingInteractionElement,leadingInteractionElement:leadingInteractionElement,suffix:suffix,trailingIcon:trailingIcon,size:size}),hasLeadingIcon=_getInputVisualsToBeR.hasLeadingIcon,hasPrefix=_getInputVisualsToBeR.hasPrefix,hasTrailingInteractionElement=_getInputVisualsToBeR.hasTrailingInteractionElement,hasSuffix=_getInputVisualsToBeR.hasSuffix,hasTrailingIcon=_getInputVisualsToBeR.hasTrailingIcon;var isDropdownWithTags=isDropdownTrigger&&hasTags;var isReactNative=getPlatformType()==='react-native';return Object.assign({},valueComponentType==='heading'?getHeadingStyles({size:size,weight:'regular',color:isDisabled?'surface.text.gray.disabled':'surface.text.gray.subtle',theme:theme}):getTextStyles({size:size,variant:'body',weight:'regular',color:isDisabled?'surface.text.gray.disabled':'surface.text.gray.subtle',theme:theme}),{flex:1,backgroundColor:'transparent',paddingTop:makeSpace(theme.spacing[baseInputPaddingTokens.top[size]]),paddingBottom:makeSpace(theme.spacing[baseInputPaddingTokens.bottom[size]]),paddingLeft:makeSpace(getLeftPadding({theme:theme,isDropdownTrigger:isDropdownTrigger,hasLeadingIcon:hasLeadingIcon,hasPrefix:hasPrefix,size:size})),paddingRight:getRightPadding({theme:theme,hasTrailingInteractionElement:hasTrailingInteractionElement,hasSuffix:hasSuffix,hasTrailingIcon:hasTrailingIcon,size:size}),textAlign:textAlign,width:'100%',height:isTextArea||isDropdownWithTags?undefined:makeSpace(baseInputHeight[size]),minHeight:isTextArea||isDropdownWithTags?undefined:makeSpace(baseInputHeight[size])},isReactNative?{}:{resize:'none'});};var getAnimatedBaseInputWrapperMaxHeight=function getAnimatedBaseInputWrapperMaxHeight(_ref6){var maxTagRows=_ref6.maxTagRows,showAllTags=_ref6.showAllTags,size=_ref6.size;if(maxTagRows==='single'){return baseInputHeight[size];}if(maxTagRows==='multiple'){return baseInputWrapperMaxHeight[size];}return showAllTags?baseInputWrapperMaxHeight[size]:baseInputHeight[size];};
|
|
16
16
|
|
|
17
17
|
export { getAnimatedBaseInputWrapperMaxHeight, getBaseInputState, getBaseInputStyles, getInputBackgroundAndBorderStyles };
|
|
18
18
|
//# sourceMappingURL=baseInputStyles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"baseInputStyles.js","sources":["../../../../../../src/components/Input/BaseInput/baseInputStyles.ts"],"sourcesContent":["import type { CSSObject } from 'styled-components';\nimport type { BaseInputProps } from './BaseInput';\nimport { getBaseInputBorderStyles } from './getBaseInputBorderStyles';\nimport {\n baseInputBackgroundColor,\n baseInputBorderColor,\n baseInputBorderWidth,\n baseInputHeight,\n baseInputPaddingTokens,\n baseInputWrapperMaxHeight,\n} from './baseInputTokens';\nimport { getInputVisualsToBeRendered } from './BaseInputVisuals';\nimport type { BaseInputWrapperProps } from './types';\nimport type { Theme } from '~components/BladeProvider';\nimport getTextStyles from '~components/Typography/Text/getTextStyles';\nimport { makeSpace } from '~utils/makeSpace';\nimport { makeBorderSize } from '~utils/makeBorderSize';\nimport { getPlatformType } from '~utils';\nimport getIn from '~utils/lodashButBetter/get';\nimport getHeadingStyles from '~components/Typography/Heading/getHeadingStyles';\n\ntype GetInputStyles = Pick<\n BaseInputProps,\n | 'isDisabled'\n | 'validationState'\n | 'leadingIcon'\n | 'prefix'\n | 'trailingInteractionElement'\n | 'leadingInteractionElement'\n | 'suffix'\n | 'trailingIcon'\n | 'textAlign'\n | 'isDropdownTrigger'\n | 'valueComponentType'\n> & {\n isHovered?: boolean;\n isFocused?: boolean;\n isTextArea?: boolean;\n hasTags?: boolean;\n theme: Theme;\n size: NonNullable<BaseInputProps['size']>;\n};\n\nexport const getBaseInputState = ({\n isFocused,\n isHovered,\n isDisabled,\n}: {\n isFocused?: boolean;\n isHovered?: boolean;\n isDisabled?: boolean;\n}): 'focused' | 'hovered' | 'disabled' | 'default' => {\n if (isDisabled) {\n return 'disabled';\n } else if (isFocused) {\n return 'focused';\n } else if (isHovered) {\n return 'hovered';\n } else {\n return 'default';\n }\n};\n\nexport const getInputBackgroundAndBorderStyles = ({\n theme,\n isHovered,\n isFocused,\n isDisabled,\n validationState,\n isTextArea,\n isDropdownTrigger,\n}: Pick<\n GetInputStyles,\n | 'theme'\n | 'isFocused'\n | 'isDisabled'\n | 'validationState'\n | 'isHovered'\n | 'isTextArea'\n | 'isDropdownTrigger'\n>): CSSObject => {\n // normal state\n let backgroundColor = getIn(theme.colors, baseInputBackgroundColor.default);\n let borderColor = getIn(theme.colors, baseInputBorderColor.default);\n let borderWidth = getIn(theme.border.width, baseInputBorderWidth.default);\n\n const baseInputState = getBaseInputState({ isFocused, isHovered, isDisabled });\n\n backgroundColor = getIn(theme.colors, baseInputBackgroundColor[baseInputState]);\n borderColor = getIn(theme.colors, baseInputBorderColor[baseInputState]);\n borderWidth = getIn(theme.border.width, baseInputBorderWidth[baseInputState]);\n\n if (validationState === 'error') {\n borderColor = getIn(theme.colors, baseInputBorderColor.error);\n borderWidth = getIn(theme.border.width, baseInputBorderWidth.error);\n } else if (validationState === 'success') {\n borderColor = getIn(theme.colors, baseInputBorderColor.success);\n borderWidth = getIn(theme.border.width, baseInputBorderWidth.success);\n }\n\n return {\n backgroundColor,\n borderRadius: makeBorderSize(theme.border.radius.medium),\n borderStyle: 'solid',\n display: 'flex',\n flexDirection: 'row',\n width: '100%',\n alignItems: isTextArea ? 'flex-start' : undefined,\n position: 'relative',\n height: isDropdownTrigger ? 'auto' : undefined,\n border: 'none',\n ...getBaseInputBorderStyles({ theme, borderColor, borderWidth, isFocused }),\n };\n};\n\nconst getLeftPadding = ({\n theme,\n isDropdownTrigger,\n hasLeadingIcon,\n hasPrefix,\n size,\n}: {\n theme: Theme;\n hasLeadingIcon: boolean;\n hasPrefix: boolean;\n isDropdownTrigger: GetInputStyles['isDropdownTrigger'];\n size: GetInputStyles['size'];\n}): number => {\n if (isDropdownTrigger) {\n return theme.spacing[0];\n }\n\n if (hasLeadingIcon || hasPrefix) {\n return theme.spacing[3];\n }\n\n return theme.spacing[baseInputPaddingTokens.left[size]];\n};\n\nconst getRightPadding = ({\n theme,\n hasTrailingInteractionElement,\n hasSuffix,\n hasTrailingIcon,\n size,\n}: {\n theme: Theme;\n hasTrailingInteractionElement: boolean;\n hasSuffix: boolean;\n hasTrailingIcon: boolean;\n size: GetInputStyles['size'];\n}): number => {\n if (hasTrailingInteractionElement || hasSuffix || hasTrailingIcon) {\n return theme.spacing[3];\n }\n return theme.spacing[baseInputPaddingTokens.right[size]];\n};\n\nexport const getBaseInputStyles = ({\n theme,\n isDisabled,\n leadingIcon,\n prefix,\n trailingInteractionElement,\n leadingInteractionElement,\n suffix,\n trailingIcon,\n textAlign,\n isTextArea,\n hasTags,\n isDropdownTrigger,\n size,\n valueComponentType,\n}: GetInputStyles): CSSObject => {\n const {\n hasLeadingIcon,\n hasPrefix,\n hasTrailingInteractionElement,\n hasSuffix,\n hasTrailingIcon,\n } = getInputVisualsToBeRendered({\n leadingIcon,\n prefix,\n trailingInteractionElement,\n leadingInteractionElement,\n suffix,\n trailingIcon,\n size,\n });\n\n const isDropdownWithTags = isDropdownTrigger && hasTags;\n const isReactNative = getPlatformType() === 'react-native';\n\n return {\n ...(valueComponentType === 'heading'\n ? getHeadingStyles({\n size,\n weight: 'regular',\n color: isDisabled ? 'surface.text.gray.disabled' : 'surface.text.gray.subtle',\n theme,\n })\n : getTextStyles({\n size,\n variant: 'body',\n weight: 'regular',\n color: isDisabled ? 'surface.text.gray.disabled' : 'surface.text.gray.subtle',\n theme,\n })),\n\n // take the full available width of parent container for input field\n flex: 1,\n backgroundColor: 'transparent',\n\n paddingTop: makeSpace(theme.spacing[baseInputPaddingTokens.top[size]]),\n paddingBottom: makeSpace(theme.spacing[baseInputPaddingTokens.bottom[size]]),\n paddingLeft: makeSpace(\n getLeftPadding({ theme, isDropdownTrigger, hasLeadingIcon, hasPrefix, size }),\n ),\n paddingRight: getRightPadding({\n theme,\n hasTrailingInteractionElement,\n hasSuffix,\n hasTrailingIcon,\n size,\n }),\n\n textAlign,\n width: '100%',\n height: isTextArea || isDropdownWithTags ? undefined : makeSpace(baseInputHeight[size]),\n minHeight: isDropdownWithTags ? undefined : makeSpace(baseInputHeight[size]),\n ...(isReactNative ? {} : { resize: 'none' }),\n };\n};\n\nexport const getAnimatedBaseInputWrapperMaxHeight = ({\n maxTagRows,\n showAllTags,\n size,\n}: Pick<BaseInputWrapperProps, 'maxTagRows' | 'showAllTags' | 'size'>): number => {\n if (maxTagRows === 'single') {\n return baseInputHeight[size];\n }\n\n if (maxTagRows === 'multiple') {\n return baseInputWrapperMaxHeight[size];\n }\n\n // In expandable, max-height depends on the state\n return showAllTags ? baseInputWrapperMaxHeight[size] : baseInputHeight[size];\n};\n"],"names":["getBaseInputState","_ref","isFocused","isHovered","isDisabled","getInputBackgroundAndBorderStyles","_ref2","theme","validationState","isTextArea","isDropdownTrigger","backgroundColor","getIn","colors","baseInputBackgroundColor","default","borderColor","baseInputBorderColor","borderWidth","border","width","baseInputBorderWidth","baseInputState","error","success","Object","assign","borderRadius","makeBorderSize","radius","medium","borderStyle","display","flexDirection","alignItems","undefined","position","height","getBaseInputBorderStyles","getLeftPadding","_ref3","hasLeadingIcon","hasPrefix","size","spacing","baseInputPaddingTokens","left","getRightPadding","_ref4","hasTrailingInteractionElement","hasSuffix","hasTrailingIcon","right","getBaseInputStyles","_ref5","leadingIcon","prefix","trailingInteractionElement","leadingInteractionElement","suffix","trailingIcon","textAlign","hasTags","valueComponentType","_getInputVisualsToBeR","getInputVisualsToBeRendered","isDropdownWithTags","isReactNative","getPlatformType","getHeadingStyles","weight","color","getTextStyles","variant","flex","paddingTop","makeSpace","top","paddingBottom","bottom","paddingLeft","paddingRight","baseInputHeight","minHeight","resize","getAnimatedBaseInputWrapperMaxHeight","_ref6","maxTagRows","showAllTags","baseInputWrapperMaxHeight"],"mappings":";;;;;;;;;;;;;;AA2Ca,IAAAA,iBAAiB,CAAG,SAApBA,iBAAiBA,CAAAC,IAAA,CAQwB,CAAA,IAPpDC,SAAS,CAAAD,IAAA,CAATC,SAAS,CACTC,SAAS,CAAAF,IAAA,CAATE,SAAS,CACTC,UAAU,CAAAH,IAAA,CAAVG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AI,CAAA2C,KAAA,CAAJ3C,IAAI,CAEJ,GAAI4C,UAAU,GAAK,QAAQ,CAAE,CAC3B,OAAOL,eAAe,CAACvC,IAAI,CAAC,CAC9B,CAEA,GAAI4C,UAAU,GAAK,UAAU,CAAE,CAC7B,OAAOE,yBAAyB,CAAC9C,IAAI,CAAC,CACxC,CAGA,OAAO6C,WAAW,CAAGC,yBAAyB,CAAC9C,IAAI,CAAC,CAAGuC,eAAe,CAACvC,IAAI,CAAC,CAC9E;;;;"}
|
|
1
|
+
{"version":3,"file":"baseInputStyles.js","sources":["../../../../../../src/components/Input/BaseInput/baseInputStyles.ts"],"sourcesContent":["import type { CSSObject } from 'styled-components';\nimport type { BaseInputProps } from './BaseInput';\nimport { getBaseInputBorderStyles } from './getBaseInputBorderStyles';\nimport {\n baseInputBackgroundColor,\n baseInputBorderColor,\n baseInputBorderWidth,\n baseInputHeight,\n baseInputPaddingTokens,\n baseInputWrapperMaxHeight,\n} from './baseInputTokens';\nimport { getInputVisualsToBeRendered } from './BaseInputVisuals';\nimport type { BaseInputWrapperProps } from './types';\nimport type { Theme } from '~components/BladeProvider';\nimport getTextStyles from '~components/Typography/Text/getTextStyles';\nimport { makeSpace } from '~utils/makeSpace';\nimport { makeBorderSize } from '~utils/makeBorderSize';\nimport { getPlatformType } from '~utils';\nimport getIn from '~utils/lodashButBetter/get';\nimport getHeadingStyles from '~components/Typography/Heading/getHeadingStyles';\n\ntype GetInputStyles = Pick<\n BaseInputProps,\n | 'isDisabled'\n | 'validationState'\n | 'leadingIcon'\n | 'prefix'\n | 'trailingInteractionElement'\n | 'leadingInteractionElement'\n | 'suffix'\n | 'trailingIcon'\n | 'textAlign'\n | 'isDropdownTrigger'\n | 'valueComponentType'\n> & {\n isHovered?: boolean;\n isFocused?: boolean;\n isTextArea?: boolean;\n hasTags?: boolean;\n theme: Theme;\n size: NonNullable<BaseInputProps['size']>;\n};\n\nexport const getBaseInputState = ({\n isFocused,\n isHovered,\n isDisabled,\n}: {\n isFocused?: boolean;\n isHovered?: boolean;\n isDisabled?: boolean;\n}): 'focused' | 'hovered' | 'disabled' | 'default' => {\n if (isDisabled) {\n return 'disabled';\n } else if (isFocused) {\n return 'focused';\n } else if (isHovered) {\n return 'hovered';\n } else {\n return 'default';\n }\n};\n\nexport const getInputBackgroundAndBorderStyles = ({\n theme,\n isHovered,\n isFocused,\n isDisabled,\n validationState,\n isTextArea,\n isDropdownTrigger,\n}: Pick<\n GetInputStyles,\n | 'theme'\n | 'isFocused'\n | 'isDisabled'\n | 'validationState'\n | 'isHovered'\n | 'isTextArea'\n | 'isDropdownTrigger'\n>): CSSObject => {\n // normal state\n let backgroundColor = getIn(theme.colors, baseInputBackgroundColor.default);\n let borderColor = getIn(theme.colors, baseInputBorderColor.default);\n let borderWidth = getIn(theme.border.width, baseInputBorderWidth.default);\n\n const baseInputState = getBaseInputState({ isFocused, isHovered, isDisabled });\n\n backgroundColor = getIn(theme.colors, baseInputBackgroundColor[baseInputState]);\n borderColor = getIn(theme.colors, baseInputBorderColor[baseInputState]);\n borderWidth = getIn(theme.border.width, baseInputBorderWidth[baseInputState]);\n\n if (validationState === 'error') {\n borderColor = getIn(theme.colors, baseInputBorderColor.error);\n borderWidth = getIn(theme.border.width, baseInputBorderWidth.error);\n } else if (validationState === 'success') {\n borderColor = getIn(theme.colors, baseInputBorderColor.success);\n borderWidth = getIn(theme.border.width, baseInputBorderWidth.success);\n }\n\n return {\n backgroundColor,\n borderRadius: makeBorderSize(theme.border.radius.medium),\n borderStyle: 'solid',\n display: 'flex',\n flexDirection: 'row',\n width: '100%',\n alignItems: isTextArea ? 'flex-start' : undefined,\n position: 'relative',\n height: isDropdownTrigger && !isTextArea ? 'auto' : undefined,\n border: 'none',\n ...getBaseInputBorderStyles({ theme, borderColor, borderWidth, isFocused }),\n };\n};\n\nconst getLeftPadding = ({\n theme,\n isDropdownTrigger,\n hasLeadingIcon,\n hasPrefix,\n size,\n}: {\n theme: Theme;\n hasLeadingIcon: boolean;\n hasPrefix: boolean;\n isDropdownTrigger: GetInputStyles['isDropdownTrigger'];\n size: GetInputStyles['size'];\n}): number => {\n if (isDropdownTrigger) {\n return theme.spacing[0];\n }\n\n if (hasLeadingIcon || hasPrefix) {\n return theme.spacing[3];\n }\n\n return theme.spacing[baseInputPaddingTokens.left[size]];\n};\n\nconst getRightPadding = ({\n theme,\n hasTrailingInteractionElement,\n hasSuffix,\n hasTrailingIcon,\n size,\n}: {\n theme: Theme;\n hasTrailingInteractionElement: boolean;\n hasSuffix: boolean;\n hasTrailingIcon: boolean;\n size: GetInputStyles['size'];\n}): number => {\n if (hasTrailingInteractionElement || hasSuffix || hasTrailingIcon) {\n return theme.spacing[3];\n }\n return theme.spacing[baseInputPaddingTokens.right[size]];\n};\n\nexport const getBaseInputStyles = ({\n theme,\n isDisabled,\n leadingIcon,\n prefix,\n trailingInteractionElement,\n leadingInteractionElement,\n suffix,\n trailingIcon,\n textAlign,\n isTextArea,\n hasTags,\n isDropdownTrigger,\n size,\n valueComponentType,\n}: GetInputStyles): CSSObject => {\n const {\n hasLeadingIcon,\n hasPrefix,\n hasTrailingInteractionElement,\n hasSuffix,\n hasTrailingIcon,\n } = getInputVisualsToBeRendered({\n leadingIcon,\n prefix,\n trailingInteractionElement,\n leadingInteractionElement,\n suffix,\n trailingIcon,\n size,\n });\n\n const isDropdownWithTags = isDropdownTrigger && hasTags;\n const isReactNative = getPlatformType() === 'react-native';\n\n return {\n ...(valueComponentType === 'heading'\n ? getHeadingStyles({\n size,\n weight: 'regular',\n color: isDisabled ? 'surface.text.gray.disabled' : 'surface.text.gray.subtle',\n theme,\n })\n : getTextStyles({\n size,\n variant: 'body',\n weight: 'regular',\n color: isDisabled ? 'surface.text.gray.disabled' : 'surface.text.gray.subtle',\n theme,\n })),\n\n // take the full available width of parent container for input field\n flex: 1,\n backgroundColor: 'transparent',\n\n paddingTop: makeSpace(theme.spacing[baseInputPaddingTokens.top[size]]),\n paddingBottom: makeSpace(theme.spacing[baseInputPaddingTokens.bottom[size]]),\n paddingLeft: makeSpace(\n getLeftPadding({ theme, isDropdownTrigger, hasLeadingIcon, hasPrefix, size }),\n ),\n paddingRight: getRightPadding({\n theme,\n hasTrailingInteractionElement,\n hasSuffix,\n hasTrailingIcon,\n size,\n }),\n\n textAlign,\n width: '100%',\n height: isTextArea || isDropdownWithTags ? undefined : makeSpace(baseInputHeight[size]),\n minHeight: isTextArea || isDropdownWithTags ? undefined : makeSpace(baseInputHeight[size]),\n ...(isReactNative ? {} : { resize: 'none' }),\n };\n};\n\nexport const getAnimatedBaseInputWrapperMaxHeight = ({\n maxTagRows,\n showAllTags,\n size,\n}: Pick<BaseInputWrapperProps, 'maxTagRows' | 'showAllTags' | 'size'>): number => {\n if (maxTagRows === 'single') {\n return baseInputHeight[size];\n }\n\n if (maxTagRows === 'multiple') {\n return baseInputWrapperMaxHeight[size];\n }\n\n // In expandable, max-height depends on the state\n return showAllTags ? baseInputWrapperMaxHeight[size] : baseInputHeight[size];\n};\n"],"names":["getBaseInputState","_ref","isFocused","isHovered","isDisabled","getInputBackgroundAndBorderStyles","_ref2","theme","validationState","isTextArea","isDropdownTrigger","backgroundColor","getIn","colors","baseInputBackgroundColor","default","borderColor","baseInputBorderColor","borderWidth","border","width","baseInputBorderWidth","baseInputState","error","success","Object","assign","borderRadius","makeBorderSize","radius","medium","borderStyle","display","flexDirection","alignItems","undefined","position","height","getBaseInputBorderStyles","getLeftPadding","_ref3","hasLeadingIcon","hasPrefix","size","spacing","baseInputPaddingTokens","left","getRightPadding","_ref4","hasTrailingInteractionElement","hasSuffix","hasTrailingIcon","right","getBaseInputStyles","_ref5","leadingIcon","prefix","trailingInteractionElement","leadingInteractionElement","suffix","trailingIcon","textAlign","hasTags","valueComponentType","_getInputVisualsToBeR","getInputVisualsToBeRendered","isDropdownWithTags","isReactNative","getPlatformType","getHeadingStyles","weight","color","getTextStyles","variant","flex","paddingTop","makeSpace","top","paddingBottom","bottom","paddingLeft","paddingRight","baseInputHeight","minH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B,SAAS,CAAGyC,SAAS,CAACM,eAAe,CAACvC,IAAI,CAAC,CAAC,CACtFwB,CAAAA,aAAa,CAAG,EAAE,CAAG,CAAEiB,MAAM,CAAE,MAAO,CAAC,CAE/C,CAAA,EAEa,IAAAC,oCAAoC,CAAG,SAAvCA,oCAAoCA,CAAAC,KAAA,CAIiC,CAAA,IAHhFC,UAAU,CAAAD,KAAA,CAAVC,UAAU,CACVC,WAAW,CAAAF,KAAA,CAAXE,WAAW,CACX7C,IAAI,CAAA2C,KAAA,CAAJ3C,IAAI,CAEJ,GAAI4C,UAAU,GAAK,QAAQ,CAAE,CAC3B,OAAOL,eAAe,CAACvC,IAAI,CAAC,CAC9B,CAEA,GAAI4C,UAAU,GAAK,UAAU,CAAE,CAC7B,OAAOE,yBAAyB,CAAC9C,IAAI,CAAC,CACxC,CAGA,OAAO6C,WAAW,CAAGC,yBAAyB,CAAC9C,IAAI,CAAC,CAAGuC,eAAe,CAACvC,IAAI,CAAC,CAC9E;;;;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
2
|
+
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
3
|
+
import React__default from 'react';
|
|
4
|
+
import { getTagsGroup } from '../../Tag/getTagsGroup.js';
|
|
5
|
+
import 'react-native';
|
|
6
|
+
import { isReactNative } from '../../../utils/platform/isReactNative.js';
|
|
7
|
+
import '../../BladeProvider/useTheme.js';
|
|
8
|
+
import { useControllableState } from '../../../utils/useControllable.js';
|
|
9
|
+
|
|
10
|
+
var useTaggedInput=function useTaggedInput(_ref){var tags=_ref.tags,isDisabled=_ref.isDisabled,onTagChange=_ref.onTagChange,isTaggedInput=_ref.isTaggedInput,inputRef=_ref.inputRef,onChange=_ref.onChange,name=_ref.name,value=_ref.value,defaultValue=_ref.defaultValue;var _React$useState=React__default.useState(-1),_React$useState2=_slicedToArray(_React$useState,2),activeTagIndex=_React$useState2[0],setActiveTagIndex=_React$useState2[1];var _React$useState3=React__default.useState(defaultValue!=null?defaultValue:''),_React$useState4=_slicedToArray(_React$useState3,2),inputValueUncontrolled=_React$useState4[0],setInputValueUncontrolled=_React$useState4[1];var _useControllableState=useControllableState({value:tags,defaultValue:[],onChange:function onChange(tags){onTagChange==null?void 0:onTagChange({tags:tags});}}),_useControllableState2=_slicedToArray(_useControllableState,2),tagsValue=_useControllableState2[0],setTagsValue=_useControllableState2[1];var isTagsControlled=Boolean(tags);var getNewTagsArray=function getNewTagsArray(indexToRemove){var currentTags=tagsValue;if(!currentTags){return [];}if(indexToRemove<0||indexToRemove>=currentTags.length){return currentTags;}var newArray=currentTags.slice(0,indexToRemove).concat(currentTags.slice(indexToRemove+1));return newArray;};var getTags=React__default.useMemo(function(){return function(_ref2){var size=_ref2.size;return getTagsGroup({size:size,tags:tagsValue,activeTagIndex:activeTagIndex,isDisabled:isDisabled,onDismiss:function onDismiss(_ref3){var tagIndex=_ref3.tagIndex;console.log('dismiss',{tagIndex:tagIndex});if(!isTagsControlled){setTagsValue(function(){return getNewTagsArray(tagIndex);});}onTagChange==null?void 0:onTagChange({tags:getNewTagsArray(tagIndex)});}});};},[activeTagIndex,tags,tagsValue,isDisabled]);var handleTaggedInputChange=function handleTaggedInputChange(_ref4){var value=_ref4.value;if(!isTaggedInput){return;}setInputValueUncontrolled(value!=null?value:'');};var handleTagsClear=function handleTagsClear(){if(!isTaggedInput){return;}if(!isTagsControlled){setTagsValue(function(){return [];});}onTagChange==null?void 0:onTagChange({tags:[]});};var clearInput=function clearInput(){var isControlledValue=value!==undefined;if(isControlledValue){onChange==null?void 0:onChange({name:name,value:''});return;}if(!inputRef.current){return;}setInputValueUncontrolled('');if(isReactNative()){setTimeout(function(){var _inputRef$current;(_inputRef$current=inputRef.current)==null?void 0:_inputRef$current.clear();},10);return;}inputRef.current.value='';};var handleTaggedInputKeydown=function handleTaggedInputKeydown(e){if(!isTaggedInput){return;}var currentTags=tagsValue;var isControlledValue=value!==undefined;var inputValue=isControlledValue?value==null?void 0:value.trim():inputValueUncontrolled.trim();if(e.key==='Enter'||e.key===','){e.event.preventDefault==null?void 0:e.event.preventDefault();if(inputValue){if(!isTagsControlled){setTagsValue(function(){return [].concat(_toConsumableArray(currentTags),[inputValue]);});}onTagChange==null?void 0:onTagChange({tags:[].concat(_toConsumableArray(currentTags),[inputValue])});clearInput();setActiveTagIndex(-1);}}if(e.key==='Backspace'&&!inputValue&&activeTagIndex<0&¤tTags.length>0){if(!isTagsControlled){setTagsValue(function(){return currentTags.slice(0,-1);});}onTagChange==null?void 0:onTagChange({tags:currentTags.slice(0,-1)});}};return {activeTagIndex:activeTagIndex,setActiveTagIndex:setActiveTagIndex,getTags:getTags,handleTaggedInputKeydown:handleTaggedInputKeydown,handleTaggedInputChange:handleTaggedInputChange,handleTagsClear:handleTagsClear};};
|
|
11
|
+
|
|
12
|
+
export { useTaggedInput };
|
|
13
|
+
//# sourceMappingURL=useTaggedInput.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTaggedInput.js","sources":["../../../../../../src/components/Input/BaseInput/useTaggedInput.ts"],"sourcesContent":["import React from 'react';\nimport type { BaseInputProps } from './BaseInput';\nimport type { BladeElementRefWithValue } from '~utils/types';\nimport type { FormInputOnEvent, FormInputOnKeyDownEvent } from '~components/Form/FormTypes';\n// import { isReactNative } from '~utils';\nimport { getTagsGroup } from '~components/Tag/getTagsGroup';\nimport { isReactNative } from '~utils';\nimport { useControllableState } from '~utils/useControllable';\n\ntype TaggedInputProps = {\n isTaggedInput?: boolean;\n tags?: string[];\n onTagChange?: ({ tags }: { tags: string[] }) => void;\n};\n\ntype UseTaggedInputProps = TaggedInputProps &\n Pick<BaseInputProps, 'isDisabled' | 'onChange' | 'name' | 'value' | 'defaultValue'> & {\n inputRef: React.RefObject<BladeElementRefWithValue | null>;\n };\n\ntype UseTaggedInputReturn = {\n activeTagIndex: number;\n setActiveTagIndex: (activeTagIndex: number) => void;\n getTags: ({ size }: { size: NonNullable<BaseInputProps['size']> }) => React.ReactElement[];\n handleTaggedInputKeydown: (e: FormInputOnKeyDownEvent) => void;\n handleTaggedInputChange: FormInputOnEvent;\n handleTagsClear: () => void;\n};\n\nconst useTaggedInput = ({\n tags,\n isDisabled,\n onTagChange,\n isTaggedInput,\n inputRef,\n onChange,\n name,\n value,\n defaultValue,\n}: UseTaggedInputProps): UseTaggedInputReturn => {\n const [activeTagIndex, setActiveTagIndex] = React.useState(-1);\n const [inputValueUncontrolled, setInputValueUncontrolled] = React.useState(defaultValue ?? '');\n const [tagsValue, setTagsValue] = useControllableState({\n value: tags,\n defaultValue: [],\n onChange: (tags) => {\n onTagChange?.({ tags });\n },\n });\n\n const isTagsControlled = Boolean(tags);\n\n const getNewTagsArray = (indexToRemove: number): string[] => {\n const currentTags = tagsValue;\n\n if (!currentTags) {\n return [];\n }\n\n // Check if the index is valid\n if (indexToRemove < 0 || indexToRemove >= currentTags.length) {\n return currentTags; // Return the original array\n }\n\n // Create a new array without the element at the specified index\n const newArray = currentTags\n .slice(0, indexToRemove)\n .concat(currentTags.slice(indexToRemove + 1));\n\n return newArray;\n };\n\n const getTags = React.useMemo(\n () => ({ size }: { size: NonNullable<BaseInputProps['size']> }): React.ReactElement[] => {\n return getTagsGroup({\n size,\n tags: tagsValue,\n activeTagIndex,\n isDisabled,\n onDismiss: ({ tagIndex }) => {\n console.log('dismiss', { tagIndex });\n if (!isTagsControlled) {\n setTagsValue(() => getNewTagsArray(tagIndex));\n }\n onTagChange?.({ tags: getNewTagsArray(tagIndex) });\n },\n });\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [activeTagIndex, tags, tagsValue, isDisabled],\n );\n\n const handleTaggedInputChange: FormInputOnEvent = ({ value }) => {\n if (!isTaggedInput) {\n return;\n }\n setInputValueUncontrolled(value ?? '');\n };\n\n const handleTagsClear = (): void => {\n if (!isTaggedInput) {\n return;\n }\n\n if (!isTagsControlled) {\n setTagsValue(() => []);\n }\n\n onTagChange?.({ tags: [] });\n };\n\n const clearInput = (): void => {\n const isControlledValue = value !== undefined;\n\n if (isControlledValue) {\n // In Controlled component, we don't clear input ourselves. We just call onChange with empty value\n onChange?.({ name, value: '' });\n return;\n }\n\n if (!inputRef.current) {\n return;\n }\n\n setInputValueUncontrolled('');\n\n if (isReactNative()) {\n setTimeout(() => {\n // eslint-disable-next-line @typescript-eslint/prefer-ts-expect-error\n // @ts-ignore: clear does exist in react native\n inputRef.current?.clear();\n }, 10);\n return;\n }\n\n inputRef.current.value = '';\n };\n\n const handleTaggedInputKeydown = (e: FormInputOnKeyDownEvent): void => {\n if (!isTaggedInput) {\n return;\n }\n\n const currentTags = tagsValue;\n const isControlledValue = value !== undefined;\n const inputValue = isControlledValue ? value?.trim() : inputValueUncontrolled.trim();\n if (e.key === 'Enter' || e.key === ',') {\n e.event.preventDefault?.(); // we don't want textarea to treat enter as line break in tagged inputs\n if (inputValue) {\n if (!isTagsControlled) {\n setTagsValue(() => [...currentTags, inputValue]);\n }\n onTagChange?.({ tags: [...currentTags, inputValue] });\n clearInput();\n setActiveTagIndex(-1);\n }\n }\n if (e.key === 'Backspace' && !inputValue && activeTagIndex < 0 && currentTags.length > 0) {\n if (!isTagsControlled) {\n setTagsValue(() => currentTags.slice(0, -1));\n }\n onTagChange?.({ tags: currentTags.slice(0, -1) });\n }\n };\n\n return {\n activeTagIndex,\n setActiveTagIndex,\n getTags,\n handleTaggedInputKeydown,\n handleTaggedInputChange,\n handleTagsClear,\n };\n};\n\nexport type { TaggedInputProps };\nexport { useTaggedInput };\n"],"names":["useTaggedInput","_ref","tags","isDisabled","onTagChange","isTaggedInput","inputRef","onChange","name","value","defaultValue","_React$useState","React","useState","_React$useState2","_slicedToArray","activeTagIndex","setActiveTagIndex","_React$useState3","_React$useState4","inputValueUncontrolled","setInputValueUncontrolled","_useControllableState","useControllableState","_useControllableState2","tagsValue","setTagsValue","isTagsControlled","Boolean","getNewTagsArray","indexToRemove","currentTags","length","newArray","slice","concat","getTags","useMemo","_ref2","size","getTagsGroup","onDismiss","_ref3","tagIndex","console","log","handleTaggedInputChange","_ref4","handleTagsClear","clearInput","isControlledValue","undefined","current","isReactNative","setTimeout","_inputRef$current","clear","handleTaggedInputKeydown","e","inputValue","trim","key","event","preventDefault","_toConsumableArray"],"mappings":";;;;;;;;;AA6BM,IAAAA,cAAc,CAAG,SAAjBA,cAAcA,CAAAC,IAAA,CAU6B,CAAA,IAT/CC,IAAI,CAAAD,IAAA,CAAJC,IAAI,CACJC,UAAU,CAAAF,IAAA,CAAVE,UAAU,CACVC,WAAW,CAAAH,IAAA,CAAXG,WAAW,CACXC,aAAa,CAAAJ,IAAA,CAAbI,aAAa,CACbC,QAAQ,CAAAL,IAAA,CAARK,QAAQ,CACRC,QAAQ,CAAAN,IAAA,CAARM,QAAQ,CACRC,IAAI,CAAAP,IAAA,CAAJO,IAAI,CACJC,KAAK,CAAAR,IAAA,CAALQ,KAAK,CACLC,YAAY,CAAAT,IAAA,CAAZS,YAAY,CAEZ,IAAAC,eAAA,CAA4CC,cAAK,CAACC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAAC,gBAAA,CAAAC,cAAA,CAAAJ,eAAA,IAAvDK,cAAc,CAAAF,gBAAA,CAAEG,CAAAA,CAAAA,CAAAA,iBAAiB,CAAAH,gBAAA,CAAA,CAAA,CAAA,CACxC,IAAAI,gBAAA,CAA4DN,cAAK,CAACC,QAAQ,CAACH,YAAY,EAAA,IAAA,CAAZA,YAAY,CAAI,EAAE,CAAC,CAAAS,gBAAA,CAAAJ,cAAA,CAAAG,gBAAA,CAAvFE,CAAAA,CAAAA,CAAAA,sBAAsB,CAAAD,gBAAA,CAAA,CAAA,CAAA,CAAEE,yBAAyB,CAAAF,gBAAA,IACxD,IAAAG,qBAAA,CAAkCC,oBAAoB,CAAC,CACrDd,KAAK,CAAEP,IAAI,CACXQ,YAAY,CAAE,EAAE,CAChBH,QAAQ,CAAE,SAAAA,QAAAA,CAACL,IAAI,CAA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,CACF,CACA,GAAIyC,CAAC,CAACG,GAAG,GAAK,WAAW,EAAI,CAACF,UAAU,EAAI3C,cAAc,CAAG,CAAC,EAAIe,WAAW,CAACC,MAAM,CAAG,CAAC,CAAE,CACxF,GAAI,CAACL,gBAAgB,CAAE,CACrBD,YAAY,CAAC,UAAM,CAAA,OAAAK,WAAW,CAACG,KAAK,CAAC,CAAC,CAAE,CAAC,CAAC,CAAC,GAAC,CAC9C,CACA9B,WAAW,EAAA,IAAA,CAAA,KAAA,CAAA,CAAXA,WAAW,CAAG,CAAEF,IAAI,CAAE6B,WAAW,CAACG,KAAK,CAAC,CAAC,CAAE,CAAC,CAAC,CAAE,CAAC,CAAC,CACnD,CACF,CAAC,CAED,OAAO,CACLlB,cAAc,CAAdA,cAAc,CACdC,iBAAiB,CAAjBA,iBAAiB,CACjBmB,OAAO,CAAPA,OAAO,CACPqB,wBAAwB,CAAxBA,wBAAwB,CACxBX,uBAAuB,CAAvBA,uBAAuB,CACvBE,eAAe,CAAfA,eACF,CAAC,CACH;;;;"}
|
|
@@ -18,7 +18,7 @@ import { metaAttribute } from '../../../utils/metaAttribute/metaAttribute.native
|
|
|
18
18
|
import { MetaConstants } from '../../../utils/metaAttribute/metaConstants.js';
|
|
19
19
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
20
20
|
|
|
21
|
-
var _excluded=["autoFocus","errorText","helpText","isDisabled","keyboardReturnKeyType","keyboardType","label","accessibilityLabel","labelPosition","name","onChange","onFocus","onBlur","onOTPFilled","otpLength","placeholder","successText","validationState","value","isMasked","autoCompleteSuggestionType","testID","size"];var isReactNative=getPlatformType()==='react-native';var otpToArray=function otpToArray(code){var _code$split;return (_code$split=code==null?void 0:code.split(''))!=null?_code$split:Array(6).fill('');};var _OTPInput=function _OTPInput(_ref,incomingRef){var autoFocus=_ref.autoFocus,errorText=_ref.errorText,helpText=_ref.helpText,isDisabled=_ref.isDisabled,keyboardReturnKeyType=_ref.keyboardReturnKeyType,_ref$keyboardType=_ref.keyboardType,keyboardType=_ref$keyboardType===void 0?'decimal':_ref$keyboardType,label=_ref.label,accessibilityLabel=_ref.accessibilityLabel,labelPosition=_ref.labelPosition,name=_ref.name,onChange=_ref.onChange,_onFocus=_ref.onFocus,_onBlur=_ref.onBlur,onOTPFilled=_ref.onOTPFilled,_ref$otpLength=_ref.otpLength,otpLength=_ref$otpLength===void 0?6:_ref$otpLength,placeholder=_ref.placeholder,successText=_ref.successText,validationState=_ref.validationState,inputValue=_ref.value,isMasked=_ref.isMasked,_ref$autoCompleteSugg=_ref.autoCompleteSuggestionType,autoCompleteSuggestionType=_ref$autoCompleteSugg===void 0?'oneTimeCode':_ref$autoCompleteSugg,testID=_ref.testID,_ref$size=_ref.size,size=_ref$size===void 0?'medium':_ref$size,styledProps=_objectWithoutProperties(_ref,_excluded);var inputRefs=[];var _useState=useState(otpToArray(inputValue)),_useState2=_slicedToArray(_useState,2),otpValue=_useState2[0],setOtpValue=_useState2[1];var _useState3=useState([]),_useState4=_slicedToArray(_useState3,2),inputType=_useState4[0],setInputType=_useState4[1];var isLabelLeftPositioned=labelPosition==='left';var _useFormId=useFormId('otp'),inputId=_useFormId.inputId,helpTextId=_useFormId.helpTextId,errorTextId=_useFormId.errorTextId,successTextId=_useFormId.successTextId;useImperativeHandle(incomingRef,function(){return inputRefs.map(function(ref){return ref.current;});},[inputRefs]);useEffect(function(){if(inputValue&&inputValue.length>=otpLength){onOTPFilled==null?void 0:onOTPFilled({value:inputValue.slice(0,otpLength),name:name});}else if(!inputValue&&otpValue.join('').length>=otpLength){onOTPFilled==null?void 0:onOTPFilled({value:otpValue.slice(0,otpLength).join(''),name:name});}},[otpValue,otpLength,name,inputValue,onOTPFilled]);useEffect(function(){otpValue.forEach(function(otp,index){if(!isEmpty(otp)&&!inputType[index]&&isMasked){var newInputType=Array.from(inputType);newInputType[index]='password';setInputType(newInputType);}if(isEmpty(otp)&&inputType[index]){var _newInputType=Array.from(inputType);_newInputType[index]=undefined;setInputType(_newInputType);}});},[otpValue,inputType,isMasked]);var setOtpValueByIndex=function setOtpValueByIndex(_ref2){var value=_ref2.value,index=_ref2.index;var newOtpValue=Array.from(otpValue);newOtpValue[index]=value;setOtpValue(newOtpValue);return newOtpValue.join('');};var focusOnOtpByIndex=function focusOnOtpByIndex(index){var _inputRefs$index,_inputRefs$index$curr;(_inputRefs$index=inputRefs[index])==null?void 0:(_inputRefs$index$curr=_inputRefs$index.current)==null?void 0:_inputRefs$index$curr.focus();if(!isReactNative){var _inputRefs$index2,_inputRefs$index2$cur;(_inputRefs$index2=inputRefs[index])==null?void 0:(_inputRefs$index2$cur=_inputRefs$index2.current)==null?void 0:_inputRefs$index2$cur.select();}};var handleOnChange=function handleOnChange(_ref3){var value=_ref3.value,currentOtpIndex=_ref3.currentOtpIndex;if(value&&value===' '){return;}if(inputValue&&inputValue.length>0){var newOtpValue=Array.from(inputValue);newOtpValue[currentOtpIndex]=value!=null?value:'';setOtpValue(newOtpValue);onChange==null?void 0:onChange({name:name,value:newOtpValue.join('')});}else if(value&&value.trim().length>1){setOtpValue(Array.from(value));onChange==null?void 0:onChange({name:name,value:value.trim().slice(0,otpLength)});}else if(otpValue[currentOtpIndex]!==(value==null?void 0:value.trim())){var _value$trim;var newValue=setOtpValueByIndex({value:(_value$trim=value==null?void 0:value.trim())!=null?_value$trim:'',index:currentOtpIndex});onChange==null?void 0:onChange({name:name,value:newValue});}};var handleOnInput=function handleOnInput(_ref4){var value=_ref4.value,currentOtpIndex=_ref4.currentOtpIndex;if(value&&value.trim().length===1){focusOnOtpByIndex(++currentOtpIndex);}};var handleOnKeyDown=function handleOnKeyDown(_ref5){var key=_ref5.key,code=_ref5.code,event=_ref5.event,currentOtpIndex=_ref5.currentOtpIndex;if(key==='Backspace'||code==='Backspace'||code==='Delete'||key==='Delete'){event.preventDefault==null?void 0:event.preventDefault();handleOnChange({value:'',currentOtpIndex:currentOtpIndex});focusOnOtpByIndex(--currentOtpIndex);}else if(key==='ArrowLeft'||code==='ArrowLeft'){event.preventDefault==null?void 0:event.preventDefault();focusOnOtpByIndex(--currentOtpIndex);}else if(key==='ArrowRight'||code==='ArrowRight'){event.preventDefault==null?void 0:event.preventDefault();focusOnOtpByIndex(++currentOtpIndex);}else if(key===' '||code==='Space'){event.preventDefault==null?void 0:event.preventDefault();}};var getHiddenInput=function getHiddenInput(){if(!isReactNative){var _ref6;return jsx("input",{hidden:true,id:inputId,name:name,value:(_ref6=inputValue!=null?inputValue:otpValue.join(''))!=null?_ref6:'',readOnly:true});}return null;};var getOTPInputFields=function getOTPInputFields(){var inputs=[];var _loop=function _loop(index){var _otpValue$index,_Array$from$index;var currentValue=inputValue?otpToArray(inputValue)[index]||'':otpValue[index]||'';var ref=React__default.createRef();var currentInputType
|
|
21
|
+
var _excluded=["autoFocus","errorText","helpText","isDisabled","keyboardReturnKeyType","keyboardType","label","accessibilityLabel","labelPosition","name","onChange","onFocus","onBlur","onOTPFilled","otpLength","placeholder","successText","validationState","value","isMasked","autoCompleteSuggestionType","testID","size"];var isReactNative=getPlatformType()==='react-native';var otpToArray=function otpToArray(code){var _code$split;return (_code$split=code==null?void 0:code.split(''))!=null?_code$split:Array(6).fill('');};var _OTPInput=function _OTPInput(_ref,incomingRef){var autoFocus=_ref.autoFocus,errorText=_ref.errorText,helpText=_ref.helpText,isDisabled=_ref.isDisabled,keyboardReturnKeyType=_ref.keyboardReturnKeyType,_ref$keyboardType=_ref.keyboardType,keyboardType=_ref$keyboardType===void 0?'decimal':_ref$keyboardType,label=_ref.label,accessibilityLabel=_ref.accessibilityLabel,labelPosition=_ref.labelPosition,name=_ref.name,onChange=_ref.onChange,_onFocus=_ref.onFocus,_onBlur=_ref.onBlur,onOTPFilled=_ref.onOTPFilled,_ref$otpLength=_ref.otpLength,otpLength=_ref$otpLength===void 0?6:_ref$otpLength,placeholder=_ref.placeholder,successText=_ref.successText,validationState=_ref.validationState,inputValue=_ref.value,isMasked=_ref.isMasked,_ref$autoCompleteSugg=_ref.autoCompleteSuggestionType,autoCompleteSuggestionType=_ref$autoCompleteSugg===void 0?'oneTimeCode':_ref$autoCompleteSugg,testID=_ref.testID,_ref$size=_ref.size,size=_ref$size===void 0?'medium':_ref$size,styledProps=_objectWithoutProperties(_ref,_excluded);var inputRefs=[];var _useState=useState(otpToArray(inputValue)),_useState2=_slicedToArray(_useState,2),otpValue=_useState2[0],setOtpValue=_useState2[1];var _useState3=useState([]),_useState4=_slicedToArray(_useState3,2),inputType=_useState4[0],setInputType=_useState4[1];var isLabelLeftPositioned=labelPosition==='left';var _useFormId=useFormId('otp'),inputId=_useFormId.inputId,helpTextId=_useFormId.helpTextId,errorTextId=_useFormId.errorTextId,successTextId=_useFormId.successTextId;useImperativeHandle(incomingRef,function(){return inputRefs.map(function(ref){return ref.current;});},[inputRefs]);useEffect(function(){if(inputValue&&inputValue.length>=otpLength){onOTPFilled==null?void 0:onOTPFilled({value:inputValue.slice(0,otpLength),name:name});}else if(!inputValue&&otpValue.join('').length>=otpLength){onOTPFilled==null?void 0:onOTPFilled({value:otpValue.slice(0,otpLength).join(''),name:name});}},[otpValue,otpLength,name,inputValue,onOTPFilled]);useEffect(function(){otpValue.forEach(function(otp,index){if(!isEmpty(otp)&&!inputType[index]&&isMasked){var newInputType=Array.from(inputType);newInputType[index]='password';setInputType(newInputType);}if(isEmpty(otp)&&inputType[index]){var _newInputType=Array.from(inputType);_newInputType[index]=undefined;setInputType(_newInputType);}});},[otpValue,inputType,isMasked]);var setOtpValueByIndex=function setOtpValueByIndex(_ref2){var value=_ref2.value,index=_ref2.index;var newOtpValue=Array.from(otpValue);newOtpValue[index]=value;setOtpValue(newOtpValue);return newOtpValue.join('');};var focusOnOtpByIndex=function focusOnOtpByIndex(index){var _inputRefs$index,_inputRefs$index$curr;(_inputRefs$index=inputRefs[index])==null?void 0:(_inputRefs$index$curr=_inputRefs$index.current)==null?void 0:_inputRefs$index$curr.focus();if(!isReactNative){var _inputRefs$index2,_inputRefs$index2$cur;(_inputRefs$index2=inputRefs[index])==null?void 0:(_inputRefs$index2$cur=_inputRefs$index2.current)==null?void 0:_inputRefs$index2$cur.select();}};var handleOnChange=function handleOnChange(_ref3){var value=_ref3.value,currentOtpIndex=_ref3.currentOtpIndex;if(value&&value===' '){return;}if(inputValue&&inputValue.length>0){var newOtpValue=Array.from(inputValue);newOtpValue[currentOtpIndex]=value!=null?value:'';setOtpValue(newOtpValue);onChange==null?void 0:onChange({name:name,value:newOtpValue.join('')});}else if(value&&value.trim().length>1){setOtpValue(Array.from(value));onChange==null?void 0:onChange({name:name,value:value.trim().slice(0,otpLength)});}else if(otpValue[currentOtpIndex]!==(value==null?void 0:value.trim())){var _value$trim;var newValue=setOtpValueByIndex({value:(_value$trim=value==null?void 0:value.trim())!=null?_value$trim:'',index:currentOtpIndex});onChange==null?void 0:onChange({name:name,value:newValue});}};var handleOnInput=function handleOnInput(_ref4){var value=_ref4.value,currentOtpIndex=_ref4.currentOtpIndex;if(value&&value.trim().length===1){focusOnOtpByIndex(++currentOtpIndex);}};var handleOnKeyDown=function handleOnKeyDown(_ref5){var key=_ref5.key,code=_ref5.code,event=_ref5.event,currentOtpIndex=_ref5.currentOtpIndex;if(key==='Backspace'||code==='Backspace'||code==='Delete'||key==='Delete'){event.preventDefault==null?void 0:event.preventDefault();handleOnChange({value:'',currentOtpIndex:currentOtpIndex});focusOnOtpByIndex(--currentOtpIndex);}else if(key==='ArrowLeft'||code==='ArrowLeft'){event.preventDefault==null?void 0:event.preventDefault();focusOnOtpByIndex(--currentOtpIndex);}else if(key==='ArrowRight'||code==='ArrowRight'){event.preventDefault==null?void 0:event.preventDefault();focusOnOtpByIndex(++currentOtpIndex);}else if(key===' '||code==='Space'){event.preventDefault==null?void 0:event.preventDefault();}};var getHiddenInput=function getHiddenInput(){if(!isReactNative){var _ref6;return jsx("input",{hidden:true,id:inputId,name:name,value:(_ref6=inputValue!=null?inputValue:otpValue.join(''))!=null?_ref6:'',readOnly:true});}return null;};var getOTPInputFields=function getOTPInputFields(){var inputs=[];var _loop=function _loop(index){var _otpValue$index,_Array$from$index;var currentValue=inputValue?otpToArray(inputValue)[index]||'':otpValue[index]||'';var ref=React__default.createRef();var currentInputType;if(isMasked){currentInputType=inputValue?'password':inputType[index];}inputRefs.push(ref);inputs.push(jsx(BaseBox,{flex:1,marginLeft:index==0?'spacing.0':'spacing.3',children:jsx(BaseInput,{autoFocus:autoFocus&&index===0,accessibilityLabel:`${index===0?label||accessibilityLabel:''} character ${index+1}`,label:label,hideLabelText:true,id:`${inputId}-${index}`,textAlign:"center",ref:ref,name:name,value:currentValue,maxCharacters:((_otpValue$index=otpValue[index])==null?void 0:_otpValue$index.length)>0?1:undefined,onChange:function onChange(formEvent){return handleOnChange(Object.assign({},formEvent,{currentOtpIndex:index}));},onFocus:function onFocus(formEvent){return _onFocus==null?void 0:_onFocus(Object.assign({},formEvent,{inputIndex:index}));},onBlur:function onBlur(formEvent){return _onBlur==null?void 0:_onBlur(Object.assign({},formEvent,{inputIndex:index}));},onInput:function onInput(formEvent){return handleOnInput(Object.assign({},formEvent,{currentOtpIndex:index}));},onKeyDown:function onKeyDown(keyboardEvent){return handleOnKeyDown(Object.assign({},keyboardEvent,{currentOtpIndex:index}));},isDisabled:isDisabled,placeholder:(_Array$from$index=Array.from(placeholder!=null?placeholder:'')[index])!=null?_Array$from$index:'',isRequired:true,autoCompleteSuggestionType:autoCompleteSuggestionType,keyboardType:keyboardType,keyboardReturnKeyType:keyboardReturnKeyType,validationState:validationState,successText:successText,errorText:errorText,helpText:helpText,hideFormHint:true,type:currentInputType,size:size,valueComponentType:"heading"})},`${inputId}-${index}`));};for(var index=0;index<otpLength;index++){_loop(index);}return inputs;};return jsxs(BaseBox,Object.assign({},metaAttribute({name:MetaConstants.OTPInput,testID:testID}),getStyledProps(styledProps),{children:[jsxs(BaseBox,{display:"flex",flexDirection:isLabelLeftPositioned?'row':'column',alignItems:isLabelLeftPositioned?'center':undefined,position:"relative",children:[Boolean(label)&&jsx(FormLabel,{as:"label",position:labelPosition,htmlFor:inputId,size:size,children:label}),jsxs(BaseBox,{display:"flex",flexDirection:"row",children:[getHiddenInput(),getOTPInputFields()]})]}),jsx(BaseBox,{marginLeft:makeSize(isLabelLeftPositioned?136:0),children:jsx(FormHint,{type:getHintType({validationState:validationState,hasHelpText:Boolean(helpText)}),helpText:helpText,errorText:errorText,successText:successText,helpTextId:helpTextId,errorTextId:errorTextId,successTextId:successTextId,size:size})})]}));};var OTPInput=React__default.forwardRef(_OTPInput);
|
|
22
22
|
|
|
23
23
|
export { OTPInput };
|
|
24
24
|
//# sourceMappingURL=OTPInput.js.map
|