@webority-technologies/mobile-ui 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -0
- package/lib/commonjs/components/Accordion/Accordion.js +331 -0
- package/lib/commonjs/components/Accordion/index.js +26 -0
- package/lib/commonjs/components/AnimatePresence/AnimatePresence.js +71 -0
- package/lib/commonjs/components/AnimatePresence/index.js +13 -0
- package/lib/commonjs/components/AppBar/AppBar.js +355 -0
- package/lib/commonjs/components/AppBar/index.js +20 -0
- package/lib/commonjs/components/AsyncBlock/AsyncBlock.js +87 -0
- package/lib/commonjs/components/AsyncBlock/index.js +20 -0
- package/lib/commonjs/components/Autocomplete/Autocomplete.js +225 -0
- package/lib/commonjs/components/Autocomplete/index.js +13 -0
- package/lib/commonjs/components/Avatar/Avatar.js +348 -0
- package/lib/commonjs/components/Avatar/index.js +26 -0
- package/lib/commonjs/components/Badge/Badge.js +295 -0
- package/lib/commonjs/components/Badge/index.js +20 -0
- package/lib/commonjs/components/Banner/Banner.js +395 -0
- package/lib/commonjs/components/Banner/index.js +20 -0
- package/lib/commonjs/components/BottomNavigation/BottomNavigation.js +336 -0
- package/lib/commonjs/components/BottomNavigation/index.js +20 -0
- package/lib/commonjs/components/BottomSheet/BottomSheet.js +558 -0
- package/lib/commonjs/components/BottomSheet/index.js +26 -0
- package/lib/commonjs/components/Box/Box.js +204 -0
- package/lib/commonjs/components/Box/index.js +37 -0
- package/lib/commonjs/components/Button/Button.js +316 -0
- package/lib/commonjs/components/Button/index.js +20 -0
- package/lib/commonjs/components/Card/Card.js +314 -0
- package/lib/commonjs/components/Card/index.js +20 -0
- package/lib/commonjs/components/Carousel/Carousel.js +582 -0
- package/lib/commonjs/components/Carousel/index.js +20 -0
- package/lib/commonjs/components/Checkbox/Checkbox.js +184 -0
- package/lib/commonjs/components/Checkbox/index.js +20 -0
- package/lib/commonjs/components/Chip/Chip.js +347 -0
- package/lib/commonjs/components/Chip/index.js +20 -0
- package/lib/commonjs/components/ChoiceGroup/ChoiceGroup.js +250 -0
- package/lib/commonjs/components/ChoiceGroup/index.js +20 -0
- package/lib/commonjs/components/Confetti/Confetti.js +177 -0
- package/lib/commonjs/components/Confetti/index.js +13 -0
- package/lib/commonjs/components/DatePicker/DatePicker.js +995 -0
- package/lib/commonjs/components/DatePicker/index.js +20 -0
- package/lib/commonjs/components/DateRangePicker/DateRangePicker.js +745 -0
- package/lib/commonjs/components/DateRangePicker/index.js +20 -0
- package/lib/commonjs/components/Descriptions/Descriptions.js +107 -0
- package/lib/commonjs/components/Descriptions/index.js +20 -0
- package/lib/commonjs/components/Dialog/Dialog.js +245 -0
- package/lib/commonjs/components/Dialog/index.js +20 -0
- package/lib/commonjs/components/Divider/Divider.js +117 -0
- package/lib/commonjs/components/Divider/index.js +20 -0
- package/lib/commonjs/components/Drawer/Drawer.js +379 -0
- package/lib/commonjs/components/Drawer/index.js +20 -0
- package/lib/commonjs/components/EmptyState/EmptyState.js +207 -0
- package/lib/commonjs/components/EmptyState/index.js +20 -0
- package/lib/commonjs/components/FieldBase/Chevron.js +81 -0
- package/lib/commonjs/components/FieldBase/FieldBase.js +521 -0
- package/lib/commonjs/components/FieldBase/index.js +38 -0
- package/lib/commonjs/components/FilePicker/FilePicker.js +783 -0
- package/lib/commonjs/components/FilePicker/index.js +26 -0
- package/lib/commonjs/components/FloatingActionButton/FloatingActionButton.js +517 -0
- package/lib/commonjs/components/FloatingActionButton/index.js +26 -0
- package/lib/commonjs/components/ForceUpdateDialog/ForceUpdateDialog.js +90 -0
- package/lib/commonjs/components/ForceUpdateDialog/index.js +20 -0
- package/lib/commonjs/components/FormField/FormField.js +162 -0
- package/lib/commonjs/components/FormField/index.js +20 -0
- package/lib/commonjs/components/IconButton/IconButton.js +180 -0
- package/lib/commonjs/components/IconButton/index.js +13 -0
- package/lib/commonjs/components/ImageGallery/ImageGallery.js +581 -0
- package/lib/commonjs/components/ImageGallery/index.js +20 -0
- package/lib/commonjs/components/InlineSelect/InlineSelect.js +178 -0
- package/lib/commonjs/components/InlineSelect/index.js +20 -0
- package/lib/commonjs/components/Input/Input.js +402 -0
- package/lib/commonjs/components/Input/index.js +20 -0
- package/lib/commonjs/components/KeyboardAwareScrollView/KeyboardAwareScrollView.js +115 -0
- package/lib/commonjs/components/KeyboardAwareScrollView/index.js +13 -0
- package/lib/commonjs/components/KeyboardToolbar/KeyboardToolbar.js +135 -0
- package/lib/commonjs/components/KeyboardToolbar/index.js +13 -0
- package/lib/commonjs/components/ListItem/ListItem.js +338 -0
- package/lib/commonjs/components/ListItem/index.js +20 -0
- package/lib/commonjs/components/Modal/Modal.js +356 -0
- package/lib/commonjs/components/Modal/index.js +26 -0
- package/lib/commonjs/components/NumberInput/NumberInput.js +381 -0
- package/lib/commonjs/components/NumberInput/index.js +20 -0
- package/lib/commonjs/components/OTPInput/OTPInput.js +441 -0
- package/lib/commonjs/components/OTPInput/index.js +20 -0
- package/lib/commonjs/components/OptionSheet/OptionSheet.js +450 -0
- package/lib/commonjs/components/PhoneNumberInput/PhoneNumberInput.js +243 -0
- package/lib/commonjs/components/PhoneNumberInput/index.js +32 -0
- package/lib/commonjs/components/PickerTrigger/PickerTrigger.js +156 -0
- package/lib/commonjs/components/PickerTrigger/index.js +20 -0
- package/lib/commonjs/components/ProgressBar/ProgressBar.js +198 -0
- package/lib/commonjs/components/ProgressBar/index.js +20 -0
- package/lib/commonjs/components/Radio/Radio.js +117 -0
- package/lib/commonjs/components/Radio/RadioDot.js +105 -0
- package/lib/commonjs/components/Radio/RadioGroup.js +50 -0
- package/lib/commonjs/components/Radio/index.js +46 -0
- package/lib/commonjs/components/Rating/Rating.js +333 -0
- package/lib/commonjs/components/Rating/index.js +20 -0
- package/lib/commonjs/components/Repeater/Repeater.js +141 -0
- package/lib/commonjs/components/Repeater/index.js +20 -0
- package/lib/commonjs/components/SearchBar/SearchBar.js +284 -0
- package/lib/commonjs/components/SearchBar/index.js +20 -0
- package/lib/commonjs/components/SegmentedControl/SegmentedControl.js +209 -0
- package/lib/commonjs/components/SegmentedControl/index.js +20 -0
- package/lib/commonjs/components/Select/Select.js +270 -0
- package/lib/commonjs/components/Select/index.js +20 -0
- package/lib/commonjs/components/Skeleton/Skeleton.js +293 -0
- package/lib/commonjs/components/Skeleton/SkeletonClock.js +118 -0
- package/lib/commonjs/components/Skeleton/SkeletonContent.js +309 -0
- package/lib/commonjs/components/Skeleton/SkeletonList.js +92 -0
- package/lib/commonjs/components/Skeleton/SkeletonProvider.js +114 -0
- package/lib/commonjs/components/Skeleton/SkeletonSkip.js +37 -0
- package/lib/commonjs/components/Skeleton/index.js +85 -0
- package/lib/commonjs/components/SlideToConfirm/SlideToConfirm.js +258 -0
- package/lib/commonjs/components/SlideToConfirm/index.js +13 -0
- package/lib/commonjs/components/Slider/Slider.js +502 -0
- package/lib/commonjs/components/Slider/index.js +20 -0
- package/lib/commonjs/components/Spinner/Spinner.js +183 -0
- package/lib/commonjs/components/Spinner/index.js +20 -0
- package/lib/commonjs/components/Stepper/Stepper.js +595 -0
- package/lib/commonjs/components/Stepper/index.js +20 -0
- package/lib/commonjs/components/Swipeable/Swipeable.js +380 -0
- package/lib/commonjs/components/Swipeable/index.js +20 -0
- package/lib/commonjs/components/Switch/Switch.js +230 -0
- package/lib/commonjs/components/Switch/index.js +20 -0
- package/lib/commonjs/components/Tabs/Tabs.js +289 -0
- package/lib/commonjs/components/Tabs/index.js +20 -0
- package/lib/commonjs/components/TagInput/TagInput.js +174 -0
- package/lib/commonjs/components/TagInput/index.js +20 -0
- package/lib/commonjs/components/Text/Text.js +146 -0
- package/lib/commonjs/components/Text/index.js +13 -0
- package/lib/commonjs/components/TimePicker/TimePicker.js +692 -0
- package/lib/commonjs/components/TimePicker/index.js +20 -0
- package/lib/commonjs/components/Timeline/Timeline.js +147 -0
- package/lib/commonjs/components/Timeline/index.js +20 -0
- package/lib/commonjs/components/Toast/Toast.js +322 -0
- package/lib/commonjs/components/Toast/ToastProvider.js +199 -0
- package/lib/commonjs/components/Toast/index.js +39 -0
- package/lib/commonjs/components/Tooltip/Tooltip.js +410 -0
- package/lib/commonjs/components/Tooltip/index.js +20 -0
- package/lib/commonjs/components/index.js +596 -0
- package/lib/commonjs/form/FormContext.js +40 -0
- package/lib/commonjs/form/index.js +68 -0
- package/lib/commonjs/form/path.js +91 -0
- package/lib/commonjs/form/rules.js +73 -0
- package/lib/commonjs/form/types.js +2 -0
- package/lib/commonjs/form/useField.js +54 -0
- package/lib/commonjs/form/useForm.js +364 -0
- package/lib/commonjs/hooks/index.js +41 -0
- package/lib/commonjs/hooks/useControllableState.js +32 -0
- package/lib/commonjs/hooks/useDebounce.js +17 -0
- package/lib/commonjs/hooks/usePressAnimation.js +47 -0
- package/lib/commonjs/hooks/useReducedMotion.js +33 -0
- package/lib/commonjs/hooks/useToggle.js +22 -0
- package/lib/commonjs/index.js +341 -0
- package/lib/commonjs/initUI.js +24 -0
- package/lib/commonjs/network/NetworkStatusBanner.js +89 -0
- package/lib/commonjs/network/index.js +13 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/theme/Gradient.js +56 -0
- package/lib/commonjs/theme/ThemeContext.js +101 -0
- package/lib/commonjs/theme/animatedValue.js +54 -0
- package/lib/commonjs/theme/index.js +127 -0
- package/lib/commonjs/theme/merge.js +30 -0
- package/lib/commonjs/theme/textStyle.js +39 -0
- package/lib/commonjs/theme/tokens.js +652 -0
- package/lib/commonjs/theme/types.js +6 -0
- package/lib/commonjs/utils/dimensions.js +31 -0
- package/lib/commonjs/utils/feedback.js +76 -0
- package/lib/commonjs/utils/hapticUtils.js +67 -0
- package/lib/commonjs/utils/index.js +114 -0
- package/lib/commonjs/utils/responsive.js +48 -0
- package/lib/commonjs/utils/shadows.js +12 -0
- package/lib/commonjs/utils/spacing.js +86 -0
- package/lib/commonjs/utils/warnUnknownProps.js +46 -0
- package/lib/module/components/Accordion/Accordion.js +325 -0
- package/lib/module/components/Accordion/index.js +4 -0
- package/lib/module/components/AnimatePresence/AnimatePresence.js +65 -0
- package/lib/module/components/AnimatePresence/index.js +4 -0
- package/lib/module/components/AppBar/AppBar.js +351 -0
- package/lib/module/components/AppBar/index.js +4 -0
- package/lib/module/components/AsyncBlock/AsyncBlock.js +81 -0
- package/lib/module/components/AsyncBlock/index.js +4 -0
- package/lib/module/components/Autocomplete/Autocomplete.js +220 -0
- package/lib/module/components/Autocomplete/index.js +4 -0
- package/lib/module/components/Avatar/Avatar.js +343 -0
- package/lib/module/components/Avatar/index.js +4 -0
- package/lib/module/components/Badge/Badge.js +291 -0
- package/lib/module/components/Badge/index.js +4 -0
- package/lib/module/components/Banner/Banner.js +391 -0
- package/lib/module/components/Banner/index.js +4 -0
- package/lib/module/components/BottomNavigation/BottomNavigation.js +332 -0
- package/lib/module/components/BottomNavigation/index.js +4 -0
- package/lib/module/components/BottomSheet/BottomSheet.js +553 -0
- package/lib/module/components/BottomSheet/index.js +4 -0
- package/lib/module/components/Box/Box.js +198 -0
- package/lib/module/components/Box/index.js +4 -0
- package/lib/module/components/Button/Button.js +312 -0
- package/lib/module/components/Button/index.js +4 -0
- package/lib/module/components/Card/Card.js +310 -0
- package/lib/module/components/Card/index.js +4 -0
- package/lib/module/components/Carousel/Carousel.js +578 -0
- package/lib/module/components/Carousel/index.js +4 -0
- package/lib/module/components/Checkbox/Checkbox.js +181 -0
- package/lib/module/components/Checkbox/index.js +4 -0
- package/lib/module/components/Chip/Chip.js +343 -0
- package/lib/module/components/Chip/index.js +4 -0
- package/lib/module/components/ChoiceGroup/ChoiceGroup.js +246 -0
- package/lib/module/components/ChoiceGroup/index.js +4 -0
- package/lib/module/components/Confetti/Confetti.js +173 -0
- package/lib/module/components/Confetti/index.js +4 -0
- package/lib/module/components/DatePicker/DatePicker.js +990 -0
- package/lib/module/components/DatePicker/index.js +4 -0
- package/lib/module/components/DateRangePicker/DateRangePicker.js +742 -0
- package/lib/module/components/DateRangePicker/index.js +4 -0
- package/lib/module/components/Descriptions/Descriptions.js +101 -0
- package/lib/module/components/Descriptions/index.js +4 -0
- package/lib/module/components/Dialog/Dialog.js +240 -0
- package/lib/module/components/Dialog/index.js +4 -0
- package/lib/module/components/Divider/Divider.js +114 -0
- package/lib/module/components/Divider/index.js +4 -0
- package/lib/module/components/Drawer/Drawer.js +375 -0
- package/lib/module/components/Drawer/index.js +4 -0
- package/lib/module/components/EmptyState/EmptyState.js +203 -0
- package/lib/module/components/EmptyState/index.js +4 -0
- package/lib/module/components/FieldBase/Chevron.js +75 -0
- package/lib/module/components/FieldBase/FieldBase.js +511 -0
- package/lib/module/components/FieldBase/index.js +4 -0
- package/lib/module/components/FilePicker/FilePicker.js +778 -0
- package/lib/module/components/FilePicker/index.js +4 -0
- package/lib/module/components/FloatingActionButton/FloatingActionButton.js +512 -0
- package/lib/module/components/FloatingActionButton/index.js +4 -0
- package/lib/module/components/ForceUpdateDialog/ForceUpdateDialog.js +84 -0
- package/lib/module/components/ForceUpdateDialog/index.js +4 -0
- package/lib/module/components/FormField/FormField.js +158 -0
- package/lib/module/components/FormField/index.js +4 -0
- package/lib/module/components/IconButton/IconButton.js +176 -0
- package/lib/module/components/IconButton/index.js +4 -0
- package/lib/module/components/ImageGallery/ImageGallery.js +576 -0
- package/lib/module/components/ImageGallery/index.js +4 -0
- package/lib/module/components/InlineSelect/InlineSelect.js +174 -0
- package/lib/module/components/InlineSelect/index.js +4 -0
- package/lib/module/components/Input/Input.js +398 -0
- package/lib/module/components/Input/index.js +4 -0
- package/lib/module/components/KeyboardAwareScrollView/KeyboardAwareScrollView.js +111 -0
- package/lib/module/components/KeyboardAwareScrollView/index.js +4 -0
- package/lib/module/components/KeyboardToolbar/KeyboardToolbar.js +130 -0
- package/lib/module/components/KeyboardToolbar/index.js +4 -0
- package/lib/module/components/ListItem/ListItem.js +334 -0
- package/lib/module/components/ListItem/index.js +4 -0
- package/lib/module/components/Modal/Modal.js +352 -0
- package/lib/module/components/Modal/index.js +4 -0
- package/lib/module/components/NumberInput/NumberInput.js +377 -0
- package/lib/module/components/NumberInput/index.js +4 -0
- package/lib/module/components/OTPInput/OTPInput.js +438 -0
- package/lib/module/components/OTPInput/index.js +4 -0
- package/lib/module/components/OptionSheet/OptionSheet.js +444 -0
- package/lib/module/components/PhoneNumberInput/PhoneNumberInput.js +238 -0
- package/lib/module/components/PhoneNumberInput/index.js +4 -0
- package/lib/module/components/PickerTrigger/PickerTrigger.js +152 -0
- package/lib/module/components/PickerTrigger/index.js +4 -0
- package/lib/module/components/ProgressBar/ProgressBar.js +195 -0
- package/lib/module/components/ProgressBar/index.js +4 -0
- package/lib/module/components/Radio/Radio.js +113 -0
- package/lib/module/components/Radio/RadioDot.js +99 -0
- package/lib/module/components/Radio/RadioGroup.js +45 -0
- package/lib/module/components/Radio/index.js +6 -0
- package/lib/module/components/Rating/Rating.js +329 -0
- package/lib/module/components/Rating/index.js +4 -0
- package/lib/module/components/Repeater/Repeater.js +135 -0
- package/lib/module/components/Repeater/index.js +4 -0
- package/lib/module/components/SearchBar/SearchBar.js +280 -0
- package/lib/module/components/SearchBar/index.js +4 -0
- package/lib/module/components/SegmentedControl/SegmentedControl.js +205 -0
- package/lib/module/components/SegmentedControl/index.js +4 -0
- package/lib/module/components/Select/Select.js +266 -0
- package/lib/module/components/Select/index.js +4 -0
- package/lib/module/components/Skeleton/Skeleton.js +286 -0
- package/lib/module/components/Skeleton/SkeletonClock.js +111 -0
- package/lib/module/components/Skeleton/SkeletonContent.js +304 -0
- package/lib/module/components/Skeleton/SkeletonList.js +87 -0
- package/lib/module/components/Skeleton/SkeletonProvider.js +106 -0
- package/lib/module/components/Skeleton/SkeletonSkip.js +31 -0
- package/lib/module/components/Skeleton/index.js +9 -0
- package/lib/module/components/SlideToConfirm/SlideToConfirm.js +254 -0
- package/lib/module/components/SlideToConfirm/index.js +4 -0
- package/lib/module/components/Slider/Slider.js +498 -0
- package/lib/module/components/Slider/index.js +4 -0
- package/lib/module/components/Spinner/Spinner.js +179 -0
- package/lib/module/components/Spinner/index.js +4 -0
- package/lib/module/components/Stepper/Stepper.js +591 -0
- package/lib/module/components/Stepper/index.js +4 -0
- package/lib/module/components/Swipeable/Swipeable.js +375 -0
- package/lib/module/components/Swipeable/index.js +4 -0
- package/lib/module/components/Switch/Switch.js +227 -0
- package/lib/module/components/Switch/index.js +4 -0
- package/lib/module/components/Tabs/Tabs.js +285 -0
- package/lib/module/components/Tabs/index.js +4 -0
- package/lib/module/components/TagInput/TagInput.js +170 -0
- package/lib/module/components/TagInput/index.js +4 -0
- package/lib/module/components/Text/Text.js +142 -0
- package/lib/module/components/Text/index.js +4 -0
- package/lib/module/components/TimePicker/TimePicker.js +686 -0
- package/lib/module/components/TimePicker/index.js +4 -0
- package/lib/module/components/Timeline/Timeline.js +141 -0
- package/lib/module/components/Timeline/index.js +4 -0
- package/lib/module/components/Toast/Toast.js +317 -0
- package/lib/module/components/Toast/ToastProvider.js +191 -0
- package/lib/module/components/Toast/index.js +5 -0
- package/lib/module/components/Tooltip/Tooltip.js +405 -0
- package/lib/module/components/Tooltip/index.js +4 -0
- package/lib/module/components/index.js +65 -0
- package/lib/module/form/FormContext.js +32 -0
- package/lib/module/form/index.js +16 -0
- package/lib/module/form/path.js +84 -0
- package/lib/module/form/rules.js +59 -0
- package/lib/module/form/types.js +2 -0
- package/lib/module/form/useField.js +49 -0
- package/lib/module/form/useForm.js +360 -0
- package/lib/module/hooks/index.js +8 -0
- package/lib/module/hooks/useControllableState.js +28 -0
- package/lib/module/hooks/useDebounce.js +12 -0
- package/lib/module/hooks/usePressAnimation.js +42 -0
- package/lib/module/hooks/useReducedMotion.js +29 -0
- package/lib/module/hooks/useToggle.js +17 -0
- package/lib/module/index.js +17 -0
- package/lib/module/initUI.js +19 -0
- package/lib/module/network/NetworkStatusBanner.js +83 -0
- package/lib/module/network/index.js +4 -0
- package/lib/module/package.json +1 -0
- package/lib/module/theme/Gradient.js +49 -0
- package/lib/module/theme/ThemeContext.js +93 -0
- package/lib/module/theme/animatedValue.js +49 -0
- package/lib/module/theme/index.js +51 -0
- package/lib/module/theme/merge.js +25 -0
- package/lib/module/theme/textStyle.js +34 -0
- package/lib/module/theme/tokens.js +648 -0
- package/lib/module/theme/types.js +4 -0
- package/lib/module/utils/dimensions.js +4 -0
- package/lib/module/utils/feedback.js +70 -0
- package/lib/module/utils/hapticUtils.js +60 -0
- package/lib/module/utils/index.js +9 -0
- package/lib/module/utils/responsive.js +42 -0
- package/lib/module/utils/shadows.js +7 -0
- package/lib/module/utils/spacing.js +82 -0
- package/lib/module/utils/warnUnknownProps.js +42 -0
- package/lib/typescript/commonjs/components/Accordion/Accordion.d.ts +48 -0
- package/lib/typescript/commonjs/components/Accordion/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/AnimatePresence/AnimatePresence.d.ts +30 -0
- package/lib/typescript/commonjs/components/AnimatePresence/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/AppBar/AppBar.d.ts +50 -0
- package/lib/typescript/commonjs/components/AppBar/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/AsyncBlock/AsyncBlock.d.ts +39 -0
- package/lib/typescript/commonjs/components/AsyncBlock/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/Autocomplete/Autocomplete.d.ts +53 -0
- package/lib/typescript/commonjs/components/Autocomplete/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/Avatar/Avatar.d.ts +75 -0
- package/lib/typescript/commonjs/components/Avatar/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/Badge/Badge.d.ts +34 -0
- package/lib/typescript/commonjs/components/Badge/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/Banner/Banner.d.ts +47 -0
- package/lib/typescript/commonjs/components/Banner/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/BottomNavigation/BottomNavigation.d.ts +40 -0
- package/lib/typescript/commonjs/components/BottomNavigation/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/BottomSheet/BottomSheet.d.ts +113 -0
- package/lib/typescript/commonjs/components/BottomSheet/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/Box/Box.d.ts +59 -0
- package/lib/typescript/commonjs/components/Box/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/Button/Button.d.ts +41 -0
- package/lib/typescript/commonjs/components/Button/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/Card/Card.d.ts +57 -0
- package/lib/typescript/commonjs/components/Card/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/Carousel/Carousel.d.ts +77 -0
- package/lib/typescript/commonjs/components/Carousel/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/Checkbox/Checkbox.d.ts +32 -0
- package/lib/typescript/commonjs/components/Checkbox/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/Chip/Chip.d.ts +41 -0
- package/lib/typescript/commonjs/components/Chip/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/ChoiceGroup/ChoiceGroup.d.ts +100 -0
- package/lib/typescript/commonjs/components/ChoiceGroup/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/Confetti/Confetti.d.ts +41 -0
- package/lib/typescript/commonjs/components/Confetti/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/DatePicker/DatePicker.d.ts +63 -0
- package/lib/typescript/commonjs/components/DatePicker/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/DateRangePicker/DateRangePicker.d.ts +69 -0
- package/lib/typescript/commonjs/components/DateRangePicker/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/Descriptions/Descriptions.d.ts +30 -0
- package/lib/typescript/commonjs/components/Descriptions/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/Dialog/Dialog.d.ts +45 -0
- package/lib/typescript/commonjs/components/Dialog/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/Divider/Divider.d.ts +19 -0
- package/lib/typescript/commonjs/components/Divider/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/Drawer/Drawer.d.ts +56 -0
- package/lib/typescript/commonjs/components/Drawer/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/EmptyState/EmptyState.d.ts +24 -0
- package/lib/typescript/commonjs/components/EmptyState/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/FieldBase/Chevron.d.ts +20 -0
- package/lib/typescript/commonjs/components/FieldBase/FieldBase.d.ts +180 -0
- package/lib/typescript/commonjs/components/FieldBase/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/FilePicker/FilePicker.d.ts +155 -0
- package/lib/typescript/commonjs/components/FilePicker/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/FloatingActionButton/FloatingActionButton.d.ts +59 -0
- package/lib/typescript/commonjs/components/FloatingActionButton/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/ForceUpdateDialog/ForceUpdateDialog.d.ts +47 -0
- package/lib/typescript/commonjs/components/ForceUpdateDialog/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/FormField/FormField.d.ts +49 -0
- package/lib/typescript/commonjs/components/FormField/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/IconButton/IconButton.d.ts +34 -0
- package/lib/typescript/commonjs/components/IconButton/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/ImageGallery/ImageGallery.d.ts +55 -0
- package/lib/typescript/commonjs/components/ImageGallery/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/InlineSelect/InlineSelect.d.ts +91 -0
- package/lib/typescript/commonjs/components/InlineSelect/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/Input/Input.d.ts +69 -0
- package/lib/typescript/commonjs/components/Input/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/KeyboardAwareScrollView/KeyboardAwareScrollView.d.ts +20 -0
- package/lib/typescript/commonjs/components/KeyboardAwareScrollView/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/KeyboardToolbar/KeyboardToolbar.d.ts +29 -0
- package/lib/typescript/commonjs/components/KeyboardToolbar/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/ListItem/ListItem.d.ts +46 -0
- package/lib/typescript/commonjs/components/ListItem/index.d.ts +4 -0
- package/lib/typescript/commonjs/components/Modal/Modal.d.ts +47 -0
- package/lib/typescript/commonjs/components/Modal/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/NumberInput/NumberInput.d.ts +42 -0
- package/lib/typescript/commonjs/components/NumberInput/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/OTPInput/OTPInput.d.ts +35 -0
- package/lib/typescript/commonjs/components/OTPInput/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/OptionSheet/OptionSheet.d.ts +57 -0
- package/lib/typescript/commonjs/components/PhoneNumberInput/PhoneNumberInput.d.ts +58 -0
- package/lib/typescript/commonjs/components/PhoneNumberInput/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/PickerTrigger/PickerTrigger.d.ts +60 -0
- package/lib/typescript/commonjs/components/PickerTrigger/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/ProgressBar/ProgressBar.d.ts +33 -0
- package/lib/typescript/commonjs/components/ProgressBar/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/Radio/Radio.d.ts +33 -0
- package/lib/typescript/commonjs/components/Radio/RadioDot.d.ts +24 -0
- package/lib/typescript/commonjs/components/Radio/RadioGroup.d.ts +17 -0
- package/lib/typescript/commonjs/components/Radio/index.d.ts +7 -0
- package/lib/typescript/commonjs/components/Rating/Rating.d.ts +37 -0
- package/lib/typescript/commonjs/components/Rating/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/Repeater/Repeater.d.ts +43 -0
- package/lib/typescript/commonjs/components/Repeater/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/SearchBar/SearchBar.d.ts +32 -0
- package/lib/typescript/commonjs/components/SearchBar/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/SegmentedControl/SegmentedControl.d.ts +42 -0
- package/lib/typescript/commonjs/components/SegmentedControl/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/Select/Select.d.ts +106 -0
- package/lib/typescript/commonjs/components/Select/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/Skeleton/Skeleton.d.ts +80 -0
- package/lib/typescript/commonjs/components/Skeleton/SkeletonClock.d.ts +60 -0
- package/lib/typescript/commonjs/components/Skeleton/SkeletonContent.d.ts +102 -0
- package/lib/typescript/commonjs/components/Skeleton/SkeletonList.d.ts +30 -0
- package/lib/typescript/commonjs/components/Skeleton/SkeletonProvider.d.ts +66 -0
- package/lib/typescript/commonjs/components/Skeleton/SkeletonSkip.d.ts +25 -0
- package/lib/typescript/commonjs/components/Skeleton/index.d.ts +13 -0
- package/lib/typescript/commonjs/components/SlideToConfirm/SlideToConfirm.d.ts +33 -0
- package/lib/typescript/commonjs/components/SlideToConfirm/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/Slider/Slider.d.ts +47 -0
- package/lib/typescript/commonjs/components/Slider/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/Spinner/Spinner.d.ts +19 -0
- package/lib/typescript/commonjs/components/Spinner/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/Stepper/Stepper.d.ts +49 -0
- package/lib/typescript/commonjs/components/Stepper/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/Swipeable/Swipeable.d.ts +50 -0
- package/lib/typescript/commonjs/components/Swipeable/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/Switch/Switch.d.ts +29 -0
- package/lib/typescript/commonjs/components/Switch/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/Tabs/Tabs.d.ts +64 -0
- package/lib/typescript/commonjs/components/Tabs/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/TagInput/TagInput.d.ts +36 -0
- package/lib/typescript/commonjs/components/TagInput/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/Text/Text.d.ts +24 -0
- package/lib/typescript/commonjs/components/Text/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/TimePicker/TimePicker.d.ts +62 -0
- package/lib/typescript/commonjs/components/TimePicker/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/Timeline/Timeline.d.ts +44 -0
- package/lib/typescript/commonjs/components/Timeline/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/Toast/Toast.d.ts +44 -0
- package/lib/typescript/commonjs/components/Toast/ToastProvider.d.ts +26 -0
- package/lib/typescript/commonjs/components/Toast/index.d.ts +5 -0
- package/lib/typescript/commonjs/components/Tooltip/Tooltip.d.ts +28 -0
- package/lib/typescript/commonjs/components/Tooltip/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/index.d.ts +125 -0
- package/lib/typescript/commonjs/form/FormContext.d.ts +17 -0
- package/lib/typescript/commonjs/form/index.d.ts +10 -0
- package/lib/typescript/commonjs/form/path.d.ts +10 -0
- package/lib/typescript/commonjs/form/rules.d.ts +37 -0
- package/lib/typescript/commonjs/form/types.d.ts +94 -0
- package/lib/typescript/commonjs/form/useField.d.ts +27 -0
- package/lib/typescript/commonjs/form/useForm.d.ts +10 -0
- package/lib/typescript/commonjs/hooks/index.d.ts +9 -0
- package/lib/typescript/commonjs/hooks/useControllableState.d.ts +17 -0
- package/lib/typescript/commonjs/hooks/useDebounce.d.ts +2 -0
- package/lib/typescript/commonjs/hooks/usePressAnimation.d.ts +13 -0
- package/lib/typescript/commonjs/hooks/useReducedMotion.d.ts +8 -0
- package/lib/typescript/commonjs/hooks/useToggle.d.ts +9 -0
- package/lib/typescript/commonjs/index.d.ts +14 -0
- package/lib/typescript/commonjs/initUI.d.ts +12 -0
- package/lib/typescript/commonjs/network/NetworkStatusBanner.d.ts +19 -0
- package/lib/typescript/commonjs/network/index.d.ts +3 -0
- package/lib/typescript/commonjs/package.json +1 -0
- package/lib/typescript/commonjs/theme/Gradient.d.ts +11 -0
- package/lib/typescript/commonjs/theme/ThemeContext.d.ts +18 -0
- package/lib/typescript/commonjs/theme/animatedValue.d.ts +39 -0
- package/lib/typescript/commonjs/theme/index.d.ts +18 -0
- package/lib/typescript/commonjs/theme/merge.d.ts +3 -0
- package/lib/typescript/commonjs/theme/textStyle.d.ts +18 -0
- package/lib/typescript/commonjs/theme/tokens.d.ts +4 -0
- package/lib/typescript/commonjs/theme/types.d.ts +913 -0
- package/lib/typescript/commonjs/utils/dimensions.d.ts +3 -0
- package/lib/typescript/commonjs/utils/feedback.d.ts +45 -0
- package/lib/typescript/commonjs/utils/hapticUtils.d.ts +12 -0
- package/lib/typescript/commonjs/utils/index.d.ts +11 -0
- package/lib/typescript/commonjs/utils/responsive.d.ts +23 -0
- package/lib/typescript/commonjs/utils/shadows.d.ts +4 -0
- package/lib/typescript/commonjs/utils/spacing.d.ts +61 -0
- package/lib/typescript/commonjs/utils/warnUnknownProps.d.ts +20 -0
- package/lib/typescript/module/components/Accordion/Accordion.d.ts +48 -0
- package/lib/typescript/module/components/Accordion/index.d.ts +3 -0
- package/lib/typescript/module/components/AnimatePresence/AnimatePresence.d.ts +30 -0
- package/lib/typescript/module/components/AnimatePresence/index.d.ts +3 -0
- package/lib/typescript/module/components/AppBar/AppBar.d.ts +50 -0
- package/lib/typescript/module/components/AppBar/index.d.ts +3 -0
- package/lib/typescript/module/components/AsyncBlock/AsyncBlock.d.ts +39 -0
- package/lib/typescript/module/components/AsyncBlock/index.d.ts +3 -0
- package/lib/typescript/module/components/Autocomplete/Autocomplete.d.ts +53 -0
- package/lib/typescript/module/components/Autocomplete/index.d.ts +3 -0
- package/lib/typescript/module/components/Avatar/Avatar.d.ts +75 -0
- package/lib/typescript/module/components/Avatar/index.d.ts +3 -0
- package/lib/typescript/module/components/Badge/Badge.d.ts +34 -0
- package/lib/typescript/module/components/Badge/index.d.ts +3 -0
- package/lib/typescript/module/components/Banner/Banner.d.ts +47 -0
- package/lib/typescript/module/components/Banner/index.d.ts +3 -0
- package/lib/typescript/module/components/BottomNavigation/BottomNavigation.d.ts +40 -0
- package/lib/typescript/module/components/BottomNavigation/index.d.ts +3 -0
- package/lib/typescript/module/components/BottomSheet/BottomSheet.d.ts +113 -0
- package/lib/typescript/module/components/BottomSheet/index.d.ts +3 -0
- package/lib/typescript/module/components/Box/Box.d.ts +59 -0
- package/lib/typescript/module/components/Box/index.d.ts +3 -0
- package/lib/typescript/module/components/Button/Button.d.ts +41 -0
- package/lib/typescript/module/components/Button/index.d.ts +3 -0
- package/lib/typescript/module/components/Card/Card.d.ts +57 -0
- package/lib/typescript/module/components/Card/index.d.ts +3 -0
- package/lib/typescript/module/components/Carousel/Carousel.d.ts +77 -0
- package/lib/typescript/module/components/Carousel/index.d.ts +3 -0
- package/lib/typescript/module/components/Checkbox/Checkbox.d.ts +32 -0
- package/lib/typescript/module/components/Checkbox/index.d.ts +3 -0
- package/lib/typescript/module/components/Chip/Chip.d.ts +41 -0
- package/lib/typescript/module/components/Chip/index.d.ts +3 -0
- package/lib/typescript/module/components/ChoiceGroup/ChoiceGroup.d.ts +100 -0
- package/lib/typescript/module/components/ChoiceGroup/index.d.ts +3 -0
- package/lib/typescript/module/components/Confetti/Confetti.d.ts +41 -0
- package/lib/typescript/module/components/Confetti/index.d.ts +3 -0
- package/lib/typescript/module/components/DatePicker/DatePicker.d.ts +63 -0
- package/lib/typescript/module/components/DatePicker/index.d.ts +3 -0
- package/lib/typescript/module/components/DateRangePicker/DateRangePicker.d.ts +69 -0
- package/lib/typescript/module/components/DateRangePicker/index.d.ts +3 -0
- package/lib/typescript/module/components/Descriptions/Descriptions.d.ts +30 -0
- package/lib/typescript/module/components/Descriptions/index.d.ts +3 -0
- package/lib/typescript/module/components/Dialog/Dialog.d.ts +45 -0
- package/lib/typescript/module/components/Dialog/index.d.ts +3 -0
- package/lib/typescript/module/components/Divider/Divider.d.ts +19 -0
- package/lib/typescript/module/components/Divider/index.d.ts +3 -0
- package/lib/typescript/module/components/Drawer/Drawer.d.ts +56 -0
- package/lib/typescript/module/components/Drawer/index.d.ts +3 -0
- package/lib/typescript/module/components/EmptyState/EmptyState.d.ts +24 -0
- package/lib/typescript/module/components/EmptyState/index.d.ts +3 -0
- package/lib/typescript/module/components/FieldBase/Chevron.d.ts +20 -0
- package/lib/typescript/module/components/FieldBase/FieldBase.d.ts +180 -0
- package/lib/typescript/module/components/FieldBase/index.d.ts +3 -0
- package/lib/typescript/module/components/FilePicker/FilePicker.d.ts +155 -0
- package/lib/typescript/module/components/FilePicker/index.d.ts +3 -0
- package/lib/typescript/module/components/FloatingActionButton/FloatingActionButton.d.ts +59 -0
- package/lib/typescript/module/components/FloatingActionButton/index.d.ts +3 -0
- package/lib/typescript/module/components/ForceUpdateDialog/ForceUpdateDialog.d.ts +47 -0
- package/lib/typescript/module/components/ForceUpdateDialog/index.d.ts +3 -0
- package/lib/typescript/module/components/FormField/FormField.d.ts +49 -0
- package/lib/typescript/module/components/FormField/index.d.ts +3 -0
- package/lib/typescript/module/components/IconButton/IconButton.d.ts +34 -0
- package/lib/typescript/module/components/IconButton/index.d.ts +3 -0
- package/lib/typescript/module/components/ImageGallery/ImageGallery.d.ts +55 -0
- package/lib/typescript/module/components/ImageGallery/index.d.ts +3 -0
- package/lib/typescript/module/components/InlineSelect/InlineSelect.d.ts +91 -0
- package/lib/typescript/module/components/InlineSelect/index.d.ts +3 -0
- package/lib/typescript/module/components/Input/Input.d.ts +69 -0
- package/lib/typescript/module/components/Input/index.d.ts +3 -0
- package/lib/typescript/module/components/KeyboardAwareScrollView/KeyboardAwareScrollView.d.ts +20 -0
- package/lib/typescript/module/components/KeyboardAwareScrollView/index.d.ts +3 -0
- package/lib/typescript/module/components/KeyboardToolbar/KeyboardToolbar.d.ts +29 -0
- package/lib/typescript/module/components/KeyboardToolbar/index.d.ts +3 -0
- package/lib/typescript/module/components/ListItem/ListItem.d.ts +46 -0
- package/lib/typescript/module/components/ListItem/index.d.ts +4 -0
- package/lib/typescript/module/components/Modal/Modal.d.ts +47 -0
- package/lib/typescript/module/components/Modal/index.d.ts +3 -0
- package/lib/typescript/module/components/NumberInput/NumberInput.d.ts +42 -0
- package/lib/typescript/module/components/NumberInput/index.d.ts +3 -0
- package/lib/typescript/module/components/OTPInput/OTPInput.d.ts +35 -0
- package/lib/typescript/module/components/OTPInput/index.d.ts +3 -0
- package/lib/typescript/module/components/OptionSheet/OptionSheet.d.ts +57 -0
- package/lib/typescript/module/components/PhoneNumberInput/PhoneNumberInput.d.ts +58 -0
- package/lib/typescript/module/components/PhoneNumberInput/index.d.ts +3 -0
- package/lib/typescript/module/components/PickerTrigger/PickerTrigger.d.ts +60 -0
- package/lib/typescript/module/components/PickerTrigger/index.d.ts +3 -0
- package/lib/typescript/module/components/ProgressBar/ProgressBar.d.ts +33 -0
- package/lib/typescript/module/components/ProgressBar/index.d.ts +3 -0
- package/lib/typescript/module/components/Radio/Radio.d.ts +33 -0
- package/lib/typescript/module/components/Radio/RadioDot.d.ts +24 -0
- package/lib/typescript/module/components/Radio/RadioGroup.d.ts +17 -0
- package/lib/typescript/module/components/Radio/index.d.ts +7 -0
- package/lib/typescript/module/components/Rating/Rating.d.ts +37 -0
- package/lib/typescript/module/components/Rating/index.d.ts +3 -0
- package/lib/typescript/module/components/Repeater/Repeater.d.ts +43 -0
- package/lib/typescript/module/components/Repeater/index.d.ts +3 -0
- package/lib/typescript/module/components/SearchBar/SearchBar.d.ts +32 -0
- package/lib/typescript/module/components/SearchBar/index.d.ts +3 -0
- package/lib/typescript/module/components/SegmentedControl/SegmentedControl.d.ts +42 -0
- package/lib/typescript/module/components/SegmentedControl/index.d.ts +3 -0
- package/lib/typescript/module/components/Select/Select.d.ts +106 -0
- package/lib/typescript/module/components/Select/index.d.ts +3 -0
- package/lib/typescript/module/components/Skeleton/Skeleton.d.ts +80 -0
- package/lib/typescript/module/components/Skeleton/SkeletonClock.d.ts +60 -0
- package/lib/typescript/module/components/Skeleton/SkeletonContent.d.ts +102 -0
- package/lib/typescript/module/components/Skeleton/SkeletonList.d.ts +30 -0
- package/lib/typescript/module/components/Skeleton/SkeletonProvider.d.ts +66 -0
- package/lib/typescript/module/components/Skeleton/SkeletonSkip.d.ts +25 -0
- package/lib/typescript/module/components/Skeleton/index.d.ts +13 -0
- package/lib/typescript/module/components/SlideToConfirm/SlideToConfirm.d.ts +33 -0
- package/lib/typescript/module/components/SlideToConfirm/index.d.ts +3 -0
- package/lib/typescript/module/components/Slider/Slider.d.ts +47 -0
- package/lib/typescript/module/components/Slider/index.d.ts +3 -0
- package/lib/typescript/module/components/Spinner/Spinner.d.ts +19 -0
- package/lib/typescript/module/components/Spinner/index.d.ts +3 -0
- package/lib/typescript/module/components/Stepper/Stepper.d.ts +49 -0
- package/lib/typescript/module/components/Stepper/index.d.ts +3 -0
- package/lib/typescript/module/components/Swipeable/Swipeable.d.ts +50 -0
- package/lib/typescript/module/components/Swipeable/index.d.ts +3 -0
- package/lib/typescript/module/components/Switch/Switch.d.ts +29 -0
- package/lib/typescript/module/components/Switch/index.d.ts +3 -0
- package/lib/typescript/module/components/Tabs/Tabs.d.ts +64 -0
- package/lib/typescript/module/components/Tabs/index.d.ts +3 -0
- package/lib/typescript/module/components/TagInput/TagInput.d.ts +36 -0
- package/lib/typescript/module/components/TagInput/index.d.ts +3 -0
- package/lib/typescript/module/components/Text/Text.d.ts +24 -0
- package/lib/typescript/module/components/Text/index.d.ts +3 -0
- package/lib/typescript/module/components/TimePicker/TimePicker.d.ts +62 -0
- package/lib/typescript/module/components/TimePicker/index.d.ts +3 -0
- package/lib/typescript/module/components/Timeline/Timeline.d.ts +44 -0
- package/lib/typescript/module/components/Timeline/index.d.ts +3 -0
- package/lib/typescript/module/components/Toast/Toast.d.ts +44 -0
- package/lib/typescript/module/components/Toast/ToastProvider.d.ts +26 -0
- package/lib/typescript/module/components/Toast/index.d.ts +5 -0
- package/lib/typescript/module/components/Tooltip/Tooltip.d.ts +28 -0
- package/lib/typescript/module/components/Tooltip/index.d.ts +3 -0
- package/lib/typescript/module/components/index.d.ts +125 -0
- package/lib/typescript/module/form/FormContext.d.ts +17 -0
- package/lib/typescript/module/form/index.d.ts +10 -0
- package/lib/typescript/module/form/path.d.ts +10 -0
- package/lib/typescript/module/form/rules.d.ts +37 -0
- package/lib/typescript/module/form/types.d.ts +94 -0
- package/lib/typescript/module/form/useField.d.ts +27 -0
- package/lib/typescript/module/form/useForm.d.ts +10 -0
- package/lib/typescript/module/hooks/index.d.ts +9 -0
- package/lib/typescript/module/hooks/useControllableState.d.ts +17 -0
- package/lib/typescript/module/hooks/useDebounce.d.ts +2 -0
- package/lib/typescript/module/hooks/usePressAnimation.d.ts +13 -0
- package/lib/typescript/module/hooks/useReducedMotion.d.ts +8 -0
- package/lib/typescript/module/hooks/useToggle.d.ts +9 -0
- package/lib/typescript/module/index.d.ts +14 -0
- package/lib/typescript/module/initUI.d.ts +12 -0
- package/lib/typescript/module/network/NetworkStatusBanner.d.ts +19 -0
- package/lib/typescript/module/network/index.d.ts +3 -0
- package/lib/typescript/module/package.json +1 -0
- package/lib/typescript/module/theme/Gradient.d.ts +11 -0
- package/lib/typescript/module/theme/ThemeContext.d.ts +18 -0
- package/lib/typescript/module/theme/animatedValue.d.ts +39 -0
- package/lib/typescript/module/theme/index.d.ts +18 -0
- package/lib/typescript/module/theme/merge.d.ts +3 -0
- package/lib/typescript/module/theme/textStyle.d.ts +18 -0
- package/lib/typescript/module/theme/tokens.d.ts +4 -0
- package/lib/typescript/module/theme/types.d.ts +913 -0
- package/lib/typescript/module/utils/dimensions.d.ts +3 -0
- package/lib/typescript/module/utils/feedback.d.ts +45 -0
- package/lib/typescript/module/utils/hapticUtils.d.ts +12 -0
- package/lib/typescript/module/utils/index.d.ts +11 -0
- package/lib/typescript/module/utils/responsive.d.ts +23 -0
- package/lib/typescript/module/utils/shadows.d.ts +4 -0
- package/lib/typescript/module/utils/spacing.d.ts +61 -0
- package/lib/typescript/module/utils/warnUnknownProps.d.ts +20 -0
- package/package.json +101 -0
|
@@ -0,0 +1,450 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.OptionSheet = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _reactNativeSafeAreaContext = require("react-native-safe-area-context");
|
|
10
|
+
var _index = require("../../theme/index.js");
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
13
|
+
/**
|
|
14
|
+
* OptionSheet — the shared bottom-sheet option picker.
|
|
15
|
+
*
|
|
16
|
+
* Internal primitive behind Select and InlineSelect: RN Modal-backed slide-up
|
|
17
|
+
* sheet with backdrop fade, grab handle, optional title, optional client-side
|
|
18
|
+
* search, the option list (icon + label + description, single dot / multi
|
|
19
|
+
* checkbox) and the multi-select Done footer. Owns the open/close animations
|
|
20
|
+
* and the search query; selection STATE stays with the caller — the sheet
|
|
21
|
+
* only reports `onSelect(option)` and asks `isSelected(value)`.
|
|
22
|
+
*
|
|
23
|
+
* Also the home of the canonical option types (`SelectValue`, `SelectOption`)
|
|
24
|
+
* and accessor signatures shared by every option-picking component. Select
|
|
25
|
+
* re-exports them so the public import path is unchanged.
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
// Drag-to-dismiss thresholds: release past this many px of downward drag, or
|
|
29
|
+
// above this downward velocity, dismisses instead of springing back.
|
|
30
|
+
const DRAG_CLOSE_DISTANCE = 100;
|
|
31
|
+
const DRAG_CLOSE_VELOCITY = 0.5;
|
|
32
|
+
const OptionSheet = props => {
|
|
33
|
+
const {
|
|
34
|
+
open,
|
|
35
|
+
onClose,
|
|
36
|
+
title,
|
|
37
|
+
options,
|
|
38
|
+
labelOf,
|
|
39
|
+
valueOf,
|
|
40
|
+
disabledOf,
|
|
41
|
+
descriptionOf,
|
|
42
|
+
iconOf,
|
|
43
|
+
isSelected,
|
|
44
|
+
onSelect,
|
|
45
|
+
multi = false,
|
|
46
|
+
searchable = false,
|
|
47
|
+
searchSelectionColor,
|
|
48
|
+
accessibilityLabel,
|
|
49
|
+
optionStyle,
|
|
50
|
+
selectedOptionStyle,
|
|
51
|
+
optionTextStyle,
|
|
52
|
+
selectedOptionTextStyle
|
|
53
|
+
} = props;
|
|
54
|
+
const theme = (0, _index.useTheme)();
|
|
55
|
+
const insets = (0, _reactNativeSafeAreaContext.useSafeAreaInsets)();
|
|
56
|
+
const styles = (0, _react.useMemo)(() => buildStyles(theme), [theme]);
|
|
57
|
+
const [query, setQuery] = (0, _react.useState)('');
|
|
58
|
+
const screenHeight = _reactNative.Dimensions.get('window').height;
|
|
59
|
+
const sheetMaxHeight = Math.round(screenHeight * 0.7);
|
|
60
|
+
|
|
61
|
+
// Animations: backdrop fade + sheet slide-up. `dragAnim` is the live
|
|
62
|
+
// finger offset from the drag-to-dismiss gesture, composed on top of the
|
|
63
|
+
// open/close slide so both can drive the same (native) transform.
|
|
64
|
+
// The close animation below is correct but was never visible: binding the
|
|
65
|
+
// native Modal to `open` unmounted the tree the moment `open` flipped, so the
|
|
66
|
+
// exit played against a torn-down view. Keep it mounted until the exit ends.
|
|
67
|
+
const [rendered, setRendered] = (0, _react.useState)(open);
|
|
68
|
+
const backdropAnim = (0, _react.useRef)((0, _index.createAnimatedValue)(0)).current;
|
|
69
|
+
const sheetAnim = (0, _react.useRef)((0, _index.createAnimatedValue)(sheetMaxHeight)).current;
|
|
70
|
+
const dragAnim = (0, _react.useRef)((0, _index.createAnimatedValue)(0)).current;
|
|
71
|
+
const sheetTranslateY = (0, _react.useMemo)(() => _reactNative.Animated.add(sheetAnim, dragAnim), [sheetAnim, dragAnim]);
|
|
72
|
+
(0, _react.useEffect)(() => {
|
|
73
|
+
if (open) {
|
|
74
|
+
setRendered(true);
|
|
75
|
+
}
|
|
76
|
+
}, [open]);
|
|
77
|
+
(0, _react.useEffect)(() => {
|
|
78
|
+
if (!rendered) {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
// A fresh open must start with no residual drag offset.
|
|
82
|
+
if (open) {
|
|
83
|
+
(0, _index.setNativeValue)(dragAnim, 0);
|
|
84
|
+
}
|
|
85
|
+
const anim = open ? _reactNative.Animated.parallel([
|
|
86
|
+
// Backdrop opacity uses JS driver — see Modal.tsx for the Fabric reason.
|
|
87
|
+
_reactNative.Animated.timing(backdropAnim, {
|
|
88
|
+
toValue: 1,
|
|
89
|
+
duration: theme.motion.duration.fast,
|
|
90
|
+
easing: _reactNative.Easing.bezier(...theme.motion.easing.standard),
|
|
91
|
+
useNativeDriver: false
|
|
92
|
+
}), _reactNative.Animated.spring(sheetAnim, {
|
|
93
|
+
toValue: 0,
|
|
94
|
+
damping: theme.motion.spring.snappy.damping,
|
|
95
|
+
stiffness: theme.motion.spring.snappy.stiffness,
|
|
96
|
+
mass: theme.motion.spring.snappy.mass,
|
|
97
|
+
useNativeDriver: true
|
|
98
|
+
})]) : _reactNative.Animated.parallel([_reactNative.Animated.timing(backdropAnim, {
|
|
99
|
+
toValue: 0,
|
|
100
|
+
duration: theme.motion.duration.fast,
|
|
101
|
+
easing: _reactNative.Easing.bezier(...theme.motion.easing.standard),
|
|
102
|
+
useNativeDriver: false
|
|
103
|
+
}), _reactNative.Animated.timing(sheetAnim, {
|
|
104
|
+
toValue: sheetMaxHeight,
|
|
105
|
+
duration: theme.motion.duration.fast,
|
|
106
|
+
easing: _reactNative.Easing.bezier(...theme.motion.easing.accelerate),
|
|
107
|
+
useNativeDriver: true
|
|
108
|
+
})]);
|
|
109
|
+
anim.start(({
|
|
110
|
+
finished
|
|
111
|
+
}) => {
|
|
112
|
+
if (finished && !open) {
|
|
113
|
+
setRendered(false);
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
return () => anim.stop();
|
|
117
|
+
}, [open, rendered, backdropAnim, sheetAnim, dragAnim, sheetMaxHeight, theme.motion.duration.fast, theme.motion.easing.standard, theme.motion.easing.accelerate, theme.motion.spring.snappy]);
|
|
118
|
+
|
|
119
|
+
// Drag-to-dismiss: dragging the grab handle / header down past the distance
|
|
120
|
+
// or velocity threshold slides the sheet the rest of the way and closes;
|
|
121
|
+
// a short drag springs back. Native driver throughout (matches Toast swipe)
|
|
122
|
+
// so the finger-tracking stays off the JS thread.
|
|
123
|
+
const panResponder = (0, _react.useMemo)(() => _reactNative.PanResponder.create({
|
|
124
|
+
onMoveShouldSetPanResponder: (_evt, gesture) => gesture.dy > 4 && gesture.dy > Math.abs(gesture.dx),
|
|
125
|
+
onPanResponderMove: (_evt, gesture) => {
|
|
126
|
+
if (gesture.dy > 0) {
|
|
127
|
+
(0, _index.setNativeValue)(dragAnim, gesture.dy);
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
// Another responder (parent scroll, system gesture) can take over
|
|
131
|
+
// mid-drag; without this the sheet stays parked at the finger offset.
|
|
132
|
+
onPanResponderTerminate: () => {
|
|
133
|
+
_reactNative.Animated.spring(dragAnim, {
|
|
134
|
+
toValue: 0,
|
|
135
|
+
damping: theme.motion.spring.snappy.damping,
|
|
136
|
+
stiffness: theme.motion.spring.snappy.stiffness,
|
|
137
|
+
mass: theme.motion.spring.snappy.mass,
|
|
138
|
+
useNativeDriver: true
|
|
139
|
+
}).start();
|
|
140
|
+
},
|
|
141
|
+
onPanResponderRelease: (_evt, gesture) => {
|
|
142
|
+
if (gesture.dy > DRAG_CLOSE_DISTANCE || gesture.vy > DRAG_CLOSE_VELOCITY) {
|
|
143
|
+
_reactNative.Animated.timing(dragAnim, {
|
|
144
|
+
toValue: sheetMaxHeight,
|
|
145
|
+
duration: theme.motion.duration.fast,
|
|
146
|
+
easing: _reactNative.Easing.bezier(...theme.motion.easing.accelerate),
|
|
147
|
+
useNativeDriver: true
|
|
148
|
+
}).start(() => onClose());
|
|
149
|
+
} else {
|
|
150
|
+
_reactNative.Animated.spring(dragAnim, {
|
|
151
|
+
toValue: 0,
|
|
152
|
+
damping: theme.motion.spring.snappy.damping,
|
|
153
|
+
stiffness: theme.motion.spring.snappy.stiffness,
|
|
154
|
+
mass: theme.motion.spring.snappy.mass,
|
|
155
|
+
useNativeDriver: true
|
|
156
|
+
}).start();
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}), [dragAnim, sheetMaxHeight, onClose, theme.motion.duration.fast, theme.motion.easing.accelerate, theme.motion.spring.snappy]);
|
|
160
|
+
|
|
161
|
+
// Stale-search guard: the query must not survive a close/reopen cycle.
|
|
162
|
+
(0, _react.useEffect)(() => {
|
|
163
|
+
if (!open) {
|
|
164
|
+
setQuery('');
|
|
165
|
+
}
|
|
166
|
+
}, [open]);
|
|
167
|
+
const filteredOptions = (0, _react.useMemo)(() => {
|
|
168
|
+
if (!searchable || query.trim().length === 0) {
|
|
169
|
+
return [...options];
|
|
170
|
+
}
|
|
171
|
+
const q = query.trim().toLowerCase();
|
|
172
|
+
return options.filter(o => labelOf(o).toLowerCase().includes(q) || (descriptionOf(o) ?? '').toLowerCase().includes(q));
|
|
173
|
+
}, [searchable, query, options, labelOf, descriptionOf]);
|
|
174
|
+
const handleClose = (0, _react.useCallback)(() => {
|
|
175
|
+
onClose();
|
|
176
|
+
}, [onClose]);
|
|
177
|
+
const renderOption = ({
|
|
178
|
+
item
|
|
179
|
+
}) => {
|
|
180
|
+
const itemLabel = labelOf(item);
|
|
181
|
+
const itemValue = valueOf(item);
|
|
182
|
+
const itemDescription = descriptionOf(item);
|
|
183
|
+
const itemIcon = iconOf(item);
|
|
184
|
+
const selected = isSelected(itemValue);
|
|
185
|
+
const optDisabled = disabledOf(item);
|
|
186
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Pressable, {
|
|
187
|
+
onPress: () => onSelect(item),
|
|
188
|
+
disabled: optDisabled,
|
|
189
|
+
android_ripple: {
|
|
190
|
+
color: theme.colors.surface.pressed,
|
|
191
|
+
borderless: false
|
|
192
|
+
},
|
|
193
|
+
accessibilityRole: "button",
|
|
194
|
+
accessibilityLabel: itemLabel,
|
|
195
|
+
accessibilityState: {
|
|
196
|
+
selected,
|
|
197
|
+
disabled: optDisabled
|
|
198
|
+
},
|
|
199
|
+
style: ({
|
|
200
|
+
pressed
|
|
201
|
+
}) => [styles.optionRow, {
|
|
202
|
+
backgroundColor: selected ? theme.colors.surface.selected : pressed ? theme.colors.surface.pressed : 'transparent',
|
|
203
|
+
opacity: optDisabled ? 0.5 : 1,
|
|
204
|
+
paddingHorizontal: theme.spacing.lg,
|
|
205
|
+
paddingVertical: theme.spacing.md
|
|
206
|
+
}, optionStyle, selected ? selectedOptionStyle : null],
|
|
207
|
+
children: [itemIcon ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
208
|
+
style: styles.optionIcon,
|
|
209
|
+
children: itemIcon
|
|
210
|
+
}) : null, /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
211
|
+
style: styles.optionTextWrap,
|
|
212
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
213
|
+
style: [styles.optionLabel, {
|
|
214
|
+
color: selected ? theme.colors.primary : theme.colors.text.primary,
|
|
215
|
+
fontSize: theme.typography.fontSize.base,
|
|
216
|
+
fontWeight: selected ? theme.typography.fontWeight.semibold : theme.typography.fontWeight.medium
|
|
217
|
+
}, optionTextStyle, selected ? selectedOptionTextStyle : null],
|
|
218
|
+
numberOfLines: 1,
|
|
219
|
+
children: itemLabel
|
|
220
|
+
}), itemDescription ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
221
|
+
style: [styles.optionDescription, {
|
|
222
|
+
color: theme.colors.text.tertiary,
|
|
223
|
+
fontSize: theme.typography.fontSize.sm
|
|
224
|
+
}],
|
|
225
|
+
numberOfLines: 2,
|
|
226
|
+
children: itemDescription
|
|
227
|
+
}) : null]
|
|
228
|
+
}), multi ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
229
|
+
style: [styles.checkbox, {
|
|
230
|
+
borderColor: selected ? theme.colors.primary : theme.colors.border.primary,
|
|
231
|
+
backgroundColor: selected ? theme.colors.primary : 'transparent'
|
|
232
|
+
}],
|
|
233
|
+
children: selected ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
234
|
+
style: styles.checkboxTick
|
|
235
|
+
}) : null
|
|
236
|
+
}) : selected ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
237
|
+
style: [styles.singleSelectedDot, {
|
|
238
|
+
backgroundColor: theme.colors.primary
|
|
239
|
+
}]
|
|
240
|
+
}) : null]
|
|
241
|
+
});
|
|
242
|
+
};
|
|
243
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Modal, {
|
|
244
|
+
visible: rendered,
|
|
245
|
+
transparent: true,
|
|
246
|
+
animationType: "none",
|
|
247
|
+
onRequestClose: handleClose,
|
|
248
|
+
statusBarTranslucent: true,
|
|
249
|
+
navigationBarTranslucent: true,
|
|
250
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View
|
|
251
|
+
// Backdrop wraps the sheet — see Modal.tsx for the Fabric reason.
|
|
252
|
+
, {
|
|
253
|
+
collapsable: false,
|
|
254
|
+
style: [_reactNative.StyleSheet.absoluteFill, {
|
|
255
|
+
backgroundColor: theme.colors.background.overlay
|
|
256
|
+
}],
|
|
257
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
|
|
258
|
+
style: _reactNative.StyleSheet.absoluteFill,
|
|
259
|
+
onPress: handleClose,
|
|
260
|
+
accessibilityRole: "button",
|
|
261
|
+
accessibilityLabel: "Close picker"
|
|
262
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Animated.View, {
|
|
263
|
+
accessibilityViewIsModal: true,
|
|
264
|
+
accessibilityLabel: accessibilityLabel ?? title ?? 'Options',
|
|
265
|
+
style: [styles.sheet, {
|
|
266
|
+
maxHeight: sheetMaxHeight,
|
|
267
|
+
paddingBottom: insets.bottom + 16,
|
|
268
|
+
backgroundColor: theme.colors.background.elevated,
|
|
269
|
+
borderTopLeftRadius: theme.radius.xl,
|
|
270
|
+
borderTopRightRadius: theme.radius.xl,
|
|
271
|
+
transform: [{
|
|
272
|
+
translateY: sheetTranslateY
|
|
273
|
+
}],
|
|
274
|
+
...theme.shadows.xl
|
|
275
|
+
}],
|
|
276
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
277
|
+
...panResponder.panHandlers,
|
|
278
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
279
|
+
style: styles.sheetHandleRow,
|
|
280
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
281
|
+
style: [styles.sheetHandle, {
|
|
282
|
+
backgroundColor: theme.components.select?.handleColor ?? theme.components.bottomSheet?.handleColor ?? theme.colors.border.primary
|
|
283
|
+
}]
|
|
284
|
+
})
|
|
285
|
+
}), title ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
286
|
+
style: [styles.sheetTitle, {
|
|
287
|
+
color: theme.colors.text.primary,
|
|
288
|
+
fontSize: theme.typography.fontSize.lg,
|
|
289
|
+
fontWeight: theme.typography.fontWeight.semibold,
|
|
290
|
+
paddingHorizontal: theme.spacing.lg,
|
|
291
|
+
marginBottom: theme.spacing.sm
|
|
292
|
+
}],
|
|
293
|
+
children: title
|
|
294
|
+
}) : null]
|
|
295
|
+
}), searchable ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
296
|
+
style: [styles.searchWrap, {
|
|
297
|
+
marginHorizontal: theme.spacing.lg,
|
|
298
|
+
marginBottom: theme.spacing.sm
|
|
299
|
+
}],
|
|
300
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TextInput, {
|
|
301
|
+
value: query,
|
|
302
|
+
onChangeText: setQuery,
|
|
303
|
+
placeholder: "Search\u2026",
|
|
304
|
+
placeholderTextColor: theme.colors.text.tertiary,
|
|
305
|
+
selectionColor: searchSelectionColor ?? theme.colors.border.focus,
|
|
306
|
+
accessibilityLabel: "Search options",
|
|
307
|
+
style: [styles.searchInput, {
|
|
308
|
+
color: theme.colors.text.primary,
|
|
309
|
+
fontSize: theme.typography.fontSize.base,
|
|
310
|
+
backgroundColor: theme.colors.background.secondary,
|
|
311
|
+
borderColor: theme.colors.border.primary,
|
|
312
|
+
borderRadius: theme.radius.md,
|
|
313
|
+
paddingHorizontal: theme.spacing.md,
|
|
314
|
+
paddingVertical: theme.spacing.sm
|
|
315
|
+
}]
|
|
316
|
+
})
|
|
317
|
+
}) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.FlatList, {
|
|
318
|
+
data: filteredOptions,
|
|
319
|
+
keyExtractor: item => String(valueOf(item)),
|
|
320
|
+
renderItem: renderOption,
|
|
321
|
+
keyboardShouldPersistTaps: "handled",
|
|
322
|
+
showsVerticalScrollIndicator: true,
|
|
323
|
+
ListEmptyComponent: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
324
|
+
style: [styles.empty, {
|
|
325
|
+
color: theme.colors.text.tertiary,
|
|
326
|
+
fontSize: theme.typography.fontSize.sm,
|
|
327
|
+
paddingVertical: theme.spacing.xl
|
|
328
|
+
}],
|
|
329
|
+
children: "No options"
|
|
330
|
+
})
|
|
331
|
+
}), multi ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
332
|
+
style: [styles.sheetFooter, {
|
|
333
|
+
borderTopColor: theme.colors.border.secondary,
|
|
334
|
+
paddingHorizontal: theme.spacing.lg,
|
|
335
|
+
paddingVertical: theme.spacing.md
|
|
336
|
+
}],
|
|
337
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
|
|
338
|
+
onPress: handleClose,
|
|
339
|
+
accessibilityRole: "button",
|
|
340
|
+
accessibilityLabel: "Done",
|
|
341
|
+
style: ({
|
|
342
|
+
pressed
|
|
343
|
+
}) => [styles.doneButton, {
|
|
344
|
+
backgroundColor: pressed ? theme.colors.primaryPressed : theme.colors.primary,
|
|
345
|
+
borderRadius: theme.radius.md,
|
|
346
|
+
paddingVertical: theme.spacing.sm,
|
|
347
|
+
paddingHorizontal: theme.spacing.lg
|
|
348
|
+
}],
|
|
349
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
350
|
+
style: {
|
|
351
|
+
color: theme.colors.text.inverse,
|
|
352
|
+
fontSize: theme.typography.fontSize.base,
|
|
353
|
+
fontWeight: theme.typography.fontWeight.semibold
|
|
354
|
+
},
|
|
355
|
+
children: "Done"
|
|
356
|
+
})
|
|
357
|
+
})
|
|
358
|
+
}) : null]
|
|
359
|
+
})]
|
|
360
|
+
})
|
|
361
|
+
});
|
|
362
|
+
};
|
|
363
|
+
exports.OptionSheet = OptionSheet;
|
|
364
|
+
OptionSheet.displayName = 'OptionSheet';
|
|
365
|
+
const buildStyles = theme => _reactNative.StyleSheet.create({
|
|
366
|
+
sheet: {
|
|
367
|
+
position: 'absolute',
|
|
368
|
+
left: 0,
|
|
369
|
+
right: 0,
|
|
370
|
+
bottom: 0,
|
|
371
|
+
paddingBottom: 16,
|
|
372
|
+
overflow: 'hidden'
|
|
373
|
+
},
|
|
374
|
+
sheetHandleRow: {
|
|
375
|
+
alignItems: 'center',
|
|
376
|
+
paddingTop: 10,
|
|
377
|
+
paddingBottom: 8
|
|
378
|
+
},
|
|
379
|
+
sheetHandle: {
|
|
380
|
+
width: 36,
|
|
381
|
+
height: 4,
|
|
382
|
+
borderRadius: 2
|
|
383
|
+
},
|
|
384
|
+
sheetTitle: {
|
|
385
|
+
includeFontPadding: false
|
|
386
|
+
},
|
|
387
|
+
searchWrap: {
|
|
388
|
+
width: 'auto'
|
|
389
|
+
},
|
|
390
|
+
searchInput: {
|
|
391
|
+
borderWidth: 1,
|
|
392
|
+
includeFontPadding: false
|
|
393
|
+
},
|
|
394
|
+
optionRow: {
|
|
395
|
+
flexDirection: 'row',
|
|
396
|
+
alignItems: 'center'
|
|
397
|
+
},
|
|
398
|
+
optionIcon: {
|
|
399
|
+
marginRight: 12
|
|
400
|
+
},
|
|
401
|
+
optionTextWrap: {
|
|
402
|
+
flex: 1
|
|
403
|
+
},
|
|
404
|
+
optionLabel: {
|
|
405
|
+
includeFontPadding: false
|
|
406
|
+
},
|
|
407
|
+
optionDescription: {
|
|
408
|
+
includeFontPadding: false,
|
|
409
|
+
marginTop: 2
|
|
410
|
+
},
|
|
411
|
+
checkbox: {
|
|
412
|
+
width: 22,
|
|
413
|
+
height: 22,
|
|
414
|
+
borderRadius: 6,
|
|
415
|
+
borderWidth: 2,
|
|
416
|
+
alignItems: 'center',
|
|
417
|
+
justifyContent: 'center',
|
|
418
|
+
marginLeft: 12
|
|
419
|
+
},
|
|
420
|
+
checkboxTick: {
|
|
421
|
+
width: 10,
|
|
422
|
+
height: 6,
|
|
423
|
+
borderLeftWidth: 2,
|
|
424
|
+
borderBottomWidth: 2,
|
|
425
|
+
borderColor: theme.colors.onPrimary,
|
|
426
|
+
transform: [{
|
|
427
|
+
rotate: '-45deg'
|
|
428
|
+
}, {
|
|
429
|
+
translateY: -1
|
|
430
|
+
}]
|
|
431
|
+
},
|
|
432
|
+
singleSelectedDot: {
|
|
433
|
+
width: 8,
|
|
434
|
+
height: 8,
|
|
435
|
+
borderRadius: 4,
|
|
436
|
+
marginLeft: 12
|
|
437
|
+
},
|
|
438
|
+
empty: {
|
|
439
|
+
textAlign: 'center'
|
|
440
|
+
},
|
|
441
|
+
sheetFooter: {
|
|
442
|
+
borderTopWidth: _reactNative.StyleSheet.hairlineWidth,
|
|
443
|
+
alignItems: 'flex-end'
|
|
444
|
+
},
|
|
445
|
+
doneButton: {
|
|
446
|
+
alignSelf: 'flex-end'
|
|
447
|
+
}
|
|
448
|
+
});
|
|
449
|
+
var _default = exports.default = OptionSheet;
|
|
450
|
+
//# sourceMappingURL=OptionSheet.js.map
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.formatE164 = exports.default = exports.PhoneNumberInput = exports.DEFAULT_CALLING_CODES = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _index = require("../../hooks/index.js");
|
|
10
|
+
var _index2 = require("../../theme/index.js");
|
|
11
|
+
var _index3 = require("../../utils/index.js");
|
|
12
|
+
var _index4 = require("../FieldBase/index.js");
|
|
13
|
+
var _index5 = require("../FormField/index.js");
|
|
14
|
+
var _OptionSheet = require("../OptionSheet/OptionSheet.js");
|
|
15
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
|
+
/**
|
|
17
|
+
* A deliberately short default list — the countries the fleet actually ships to.
|
|
18
|
+
* Consumers needing the full set pass their own `countries`; shipping 240 entries
|
|
19
|
+
* (and their flags) in a component library is weight almost nobody uses.
|
|
20
|
+
*/
|
|
21
|
+
const DEFAULT_CALLING_CODES = exports.DEFAULT_CALLING_CODES = [{
|
|
22
|
+
iso: 'IN',
|
|
23
|
+
code: '91',
|
|
24
|
+
label: 'India',
|
|
25
|
+
nationalLength: 10
|
|
26
|
+
}, {
|
|
27
|
+
iso: 'AE',
|
|
28
|
+
code: '971',
|
|
29
|
+
label: 'United Arab Emirates',
|
|
30
|
+
nationalLength: 9
|
|
31
|
+
}, {
|
|
32
|
+
iso: 'GB',
|
|
33
|
+
code: '44',
|
|
34
|
+
label: 'United Kingdom',
|
|
35
|
+
nationalLength: 10
|
|
36
|
+
}, {
|
|
37
|
+
iso: 'US',
|
|
38
|
+
code: '1',
|
|
39
|
+
label: 'United States',
|
|
40
|
+
nationalLength: 10
|
|
41
|
+
}, {
|
|
42
|
+
iso: 'CA',
|
|
43
|
+
code: '1',
|
|
44
|
+
label: 'Canada',
|
|
45
|
+
nationalLength: 10
|
|
46
|
+
}, {
|
|
47
|
+
iso: 'AU',
|
|
48
|
+
code: '61',
|
|
49
|
+
label: 'Australia',
|
|
50
|
+
nationalLength: 9
|
|
51
|
+
}, {
|
|
52
|
+
iso: 'SG',
|
|
53
|
+
code: '65',
|
|
54
|
+
label: 'Singapore',
|
|
55
|
+
nationalLength: 8
|
|
56
|
+
}, {
|
|
57
|
+
iso: 'SA',
|
|
58
|
+
code: '966',
|
|
59
|
+
label: 'Saudi Arabia',
|
|
60
|
+
nationalLength: 9
|
|
61
|
+
}];
|
|
62
|
+
const digitsOnly = raw => raw.replace(/[^0-9]/g, '');
|
|
63
|
+
|
|
64
|
+
/** `+<code> <national>` — presentational only; the value stays structured. */
|
|
65
|
+
const formatE164 = value => `+${value.callingCode}${value.nationalNumber}`;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Country calling code + national number, kept as a structured value rather than
|
|
69
|
+
* one string. A single free-text phone field is where "+91", "0091", "091" and
|
|
70
|
+
* "9876543210" all arrive for the same number and the backend has to guess.
|
|
71
|
+
*/
|
|
72
|
+
exports.formatE164 = formatE164;
|
|
73
|
+
const PhoneNumberInput = exports.PhoneNumberInput = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
74
|
+
const {
|
|
75
|
+
value,
|
|
76
|
+
defaultValue,
|
|
77
|
+
onChange,
|
|
78
|
+
onComplete,
|
|
79
|
+
countries = DEFAULT_CALLING_CODES,
|
|
80
|
+
defaultIso = 'IN',
|
|
81
|
+
label,
|
|
82
|
+
placeholder = 'Phone number',
|
|
83
|
+
helperText,
|
|
84
|
+
error,
|
|
85
|
+
required,
|
|
86
|
+
disabled = false,
|
|
87
|
+
size = 'md',
|
|
88
|
+
variant,
|
|
89
|
+
countrySheetTitle = 'Country code',
|
|
90
|
+
haptic,
|
|
91
|
+
style,
|
|
92
|
+
testID
|
|
93
|
+
} = props;
|
|
94
|
+
const theme = (0, _index2.useTheme)();
|
|
95
|
+
const styles = (0, _react.useMemo)(() => buildStyles(theme), [theme]);
|
|
96
|
+
const initial = (0, _react.useMemo)(() => {
|
|
97
|
+
const start = countries.find(c => c.iso === defaultIso) ?? countries[0];
|
|
98
|
+
return {
|
|
99
|
+
callingCode: start?.code ?? '91',
|
|
100
|
+
nationalNumber: '',
|
|
101
|
+
iso: start?.iso ?? 'IN'
|
|
102
|
+
};
|
|
103
|
+
}, [countries, defaultIso]);
|
|
104
|
+
const [current, setCurrent] = (0, _index.useControllableState)({
|
|
105
|
+
value,
|
|
106
|
+
defaultValue: defaultValue ?? initial,
|
|
107
|
+
onChange
|
|
108
|
+
});
|
|
109
|
+
const [focused, setFocused] = (0, _react.useState)(false);
|
|
110
|
+
const [sheetOpen, setSheetOpen] = (0, _react.useState)(false);
|
|
111
|
+
const selected = (0, _react.useMemo)(() => countries.find(c => c.iso === current.iso) ?? countries[0], [countries, current.iso]);
|
|
112
|
+
const commit = (0, _react.useCallback)(next => {
|
|
113
|
+
setCurrent(next);
|
|
114
|
+
const expected = countries.find(c => c.iso === next.iso)?.nationalLength;
|
|
115
|
+
if (expected && next.nationalNumber.length === expected) {
|
|
116
|
+
onComplete?.(formatE164(next));
|
|
117
|
+
}
|
|
118
|
+
}, [countries, onComplete, setCurrent]);
|
|
119
|
+
const handleChangeText = (0, _react.useCallback)(raw => {
|
|
120
|
+
const digits = digitsOnly(raw);
|
|
121
|
+
const max = selected?.nationalLength;
|
|
122
|
+
commit({
|
|
123
|
+
...current,
|
|
124
|
+
nationalNumber: max ? digits.slice(0, max) : digits
|
|
125
|
+
});
|
|
126
|
+
}, [commit, current, selected?.nationalLength]);
|
|
127
|
+
const pickCountry = (0, _react.useCallback)(option => {
|
|
128
|
+
const country = option;
|
|
129
|
+
// Keep the typed digits: changing country should not discard the number.
|
|
130
|
+
commit({
|
|
131
|
+
...current,
|
|
132
|
+
callingCode: country.code,
|
|
133
|
+
iso: country.iso
|
|
134
|
+
});
|
|
135
|
+
setSheetOpen(false);
|
|
136
|
+
const h = (0, _index3.resolveHaptic)(haptic, 'selection');
|
|
137
|
+
if (h) {
|
|
138
|
+
(0, _index3.triggerHaptic)(h);
|
|
139
|
+
}
|
|
140
|
+
}, [commit, current, haptic]);
|
|
141
|
+
const field = /*#__PURE__*/(0, _jsxRuntime.jsx)(_index4.FieldBase, {
|
|
142
|
+
size: size,
|
|
143
|
+
variant: variant,
|
|
144
|
+
focused: focused,
|
|
145
|
+
disabled: disabled,
|
|
146
|
+
error: Boolean(error),
|
|
147
|
+
filled: current.nationalNumber.length > 0,
|
|
148
|
+
style: style,
|
|
149
|
+
leading: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Pressable, {
|
|
150
|
+
onPress: () => {
|
|
151
|
+
if (disabled) {
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
setSheetOpen(true);
|
|
155
|
+
},
|
|
156
|
+
disabled: disabled,
|
|
157
|
+
accessibilityRole: "button",
|
|
158
|
+
accessibilityLabel: `Country code, currently +${current.callingCode}`,
|
|
159
|
+
accessibilityState: {
|
|
160
|
+
disabled
|
|
161
|
+
},
|
|
162
|
+
hitSlop: 6,
|
|
163
|
+
style: styles.codeTrigger,
|
|
164
|
+
testID: testID ? `${testID}-code` : undefined,
|
|
165
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
166
|
+
style: [styles.codeText, {
|
|
167
|
+
color: disabled ? theme.colors.text.tertiary : theme.colors.text.primary,
|
|
168
|
+
fontSize: theme.typography.fontSize.base
|
|
169
|
+
}],
|
|
170
|
+
children: `+${current.callingCode}`
|
|
171
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
172
|
+
style: [styles.caret, {
|
|
173
|
+
color: theme.colors.text.tertiary
|
|
174
|
+
}],
|
|
175
|
+
children: "\u25BE"
|
|
176
|
+
})]
|
|
177
|
+
}),
|
|
178
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TextInput, {
|
|
179
|
+
ref: ref,
|
|
180
|
+
value: current.nationalNumber,
|
|
181
|
+
onChangeText: handleChangeText,
|
|
182
|
+
onFocus: () => setFocused(true),
|
|
183
|
+
onBlur: () => setFocused(false),
|
|
184
|
+
editable: !disabled,
|
|
185
|
+
placeholder: placeholder,
|
|
186
|
+
placeholderTextColor: theme.colors.text.tertiary,
|
|
187
|
+
keyboardType: "phone-pad",
|
|
188
|
+
textContentType: "telephoneNumber",
|
|
189
|
+
autoComplete: "tel",
|
|
190
|
+
style: [styles.input, {
|
|
191
|
+
color: theme.colors.text.primary,
|
|
192
|
+
fontSize: theme.typography.fontSize.base
|
|
193
|
+
}],
|
|
194
|
+
testID: testID ? `${testID}-input` : undefined
|
|
195
|
+
})
|
|
196
|
+
});
|
|
197
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
198
|
+
testID: testID,
|
|
199
|
+
children: [label || helperText || error ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_index5.FormField, {
|
|
200
|
+
label: label,
|
|
201
|
+
helperText: helperText,
|
|
202
|
+
error: error,
|
|
203
|
+
required: required,
|
|
204
|
+
children: field
|
|
205
|
+
}) : field, /*#__PURE__*/(0, _jsxRuntime.jsx)(_OptionSheet.OptionSheet, {
|
|
206
|
+
open: sheetOpen,
|
|
207
|
+
onClose: () => setSheetOpen(false),
|
|
208
|
+
title: countrySheetTitle,
|
|
209
|
+
options: countries,
|
|
210
|
+
labelOf: o => `${o.label} (+${o.code})`,
|
|
211
|
+
valueOf: o => o.iso,
|
|
212
|
+
disabledOf: () => false,
|
|
213
|
+
descriptionOf: () => undefined,
|
|
214
|
+
iconOf: () => null,
|
|
215
|
+
isSelected: v => v === current.iso,
|
|
216
|
+
onSelect: pickCountry,
|
|
217
|
+
searchable: countries.length > 8
|
|
218
|
+
})]
|
|
219
|
+
});
|
|
220
|
+
});
|
|
221
|
+
PhoneNumberInput.displayName = 'PhoneNumberInput';
|
|
222
|
+
const buildStyles = theme => _reactNative.StyleSheet.create({
|
|
223
|
+
codeTrigger: {
|
|
224
|
+
flexDirection: 'row',
|
|
225
|
+
alignItems: 'center',
|
|
226
|
+
gap: 2,
|
|
227
|
+
paddingRight: theme.spacing.xs
|
|
228
|
+
},
|
|
229
|
+
codeText: {
|
|
230
|
+
...(0, _index2.fontFor)(theme, 'semibold'),
|
|
231
|
+
fontWeight: '600'
|
|
232
|
+
},
|
|
233
|
+
caret: {
|
|
234
|
+
fontSize: 10
|
|
235
|
+
},
|
|
236
|
+
input: {
|
|
237
|
+
...(0, _index2.fontFor)(theme, 'normal'),
|
|
238
|
+
flex: 1,
|
|
239
|
+
padding: 0
|
|
240
|
+
}
|
|
241
|
+
});
|
|
242
|
+
var _default = exports.default = PhoneNumberInput;
|
|
243
|
+
//# sourceMappingURL=PhoneNumberInput.js.map
|