@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,686 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
4
|
+
import { AccessibilityInfo, Animated, Easing, Modal, Platform, Pressable, StyleSheet, Text, View } from 'react-native';
|
|
5
|
+
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
6
|
+
import { createAnimatedValue, setNativeValue, useTheme } from "../../theme/index.js";
|
|
7
|
+
import { resolveHaptic, triggerHaptic } from "../../utils/hapticUtils.js";
|
|
8
|
+
import Button from "../Button/Button.js";
|
|
9
|
+
import { PickerTrigger } from "../PickerTrigger/PickerTrigger.js";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* TimePicker supports two modes:
|
|
13
|
+
*
|
|
14
|
+
* 1. Controlled-modal mode — pass `visible`, `onChange`, `onClose`. The
|
|
15
|
+
* component renders only the modal sheet and the caller owns open/close
|
|
16
|
+
* state plus its own trigger UI.
|
|
17
|
+
* 2. Trigger mode — omit `visible`. The component renders a PickerTrigger
|
|
18
|
+
* field (label / value / placeholder / chevron / clear / helper / error)
|
|
19
|
+
* and manages its own modal open state. `onChange` is still called on
|
|
20
|
+
* confirm.
|
|
21
|
+
*/
|
|
22
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
23
|
+
const ITEM_HEIGHT = 40;
|
|
24
|
+
const VISIBLE_ITEMS = 5;
|
|
25
|
+
const PICKER_HEIGHT = ITEM_HEIGHT * VISIBLE_ITEMS;
|
|
26
|
+
const CENTER_OFFSET = Math.floor(VISIBLE_ITEMS / 2);
|
|
27
|
+
const HAPTIC_DEBOUNCE_MS = 35;
|
|
28
|
+
const range = (start, endInclusive, step = 1) => {
|
|
29
|
+
const out = [];
|
|
30
|
+
for (let v = start; v <= endInclusive; v += step) {
|
|
31
|
+
out.push(v);
|
|
32
|
+
}
|
|
33
|
+
return out;
|
|
34
|
+
};
|
|
35
|
+
const pad2 = n => n.toString().padStart(2, '0');
|
|
36
|
+
const to24h = (hour, period, format) => {
|
|
37
|
+
if (format === '24h') {
|
|
38
|
+
return hour;
|
|
39
|
+
}
|
|
40
|
+
if (period === 'AM') {
|
|
41
|
+
return hour === 12 ? 0 : hour;
|
|
42
|
+
}
|
|
43
|
+
return hour === 12 ? 12 : hour + 12;
|
|
44
|
+
};
|
|
45
|
+
const from24h = (hour, format) => {
|
|
46
|
+
if (format === '24h') {
|
|
47
|
+
return {
|
|
48
|
+
displayHour: hour,
|
|
49
|
+
period: 'AM'
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
if (hour === 0) {
|
|
53
|
+
return {
|
|
54
|
+
displayHour: 12,
|
|
55
|
+
period: 'AM'
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
if (hour === 12) {
|
|
59
|
+
return {
|
|
60
|
+
displayHour: 12,
|
|
61
|
+
period: 'PM'
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
if (hour > 12) {
|
|
65
|
+
return {
|
|
66
|
+
displayHour: hour - 12,
|
|
67
|
+
period: 'PM'
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
return {
|
|
71
|
+
displayHour: hour,
|
|
72
|
+
period: 'AM'
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
const clampMinuteToStep = (minute, step) => {
|
|
76
|
+
const rounded = Math.round(minute / step) * step;
|
|
77
|
+
return Math.min(59, Math.max(0, rounded));
|
|
78
|
+
};
|
|
79
|
+
const Wheel = ({
|
|
80
|
+
kind,
|
|
81
|
+
label,
|
|
82
|
+
data,
|
|
83
|
+
selectedIndex,
|
|
84
|
+
onIndexChange,
|
|
85
|
+
formatItem,
|
|
86
|
+
theme,
|
|
87
|
+
haptic,
|
|
88
|
+
testID
|
|
89
|
+
}) => {
|
|
90
|
+
const listRef = useRef(null);
|
|
91
|
+
const scrollY = useRef(createAnimatedValue(selectedIndex * ITEM_HEIGHT)).current;
|
|
92
|
+
const lastIndexRef = useRef(selectedIndex);
|
|
93
|
+
const lastHapticAtRef = useRef(0);
|
|
94
|
+
|
|
95
|
+
// Keep list aligned when selectedIndex changes externally (e.g. value prop, format flip).
|
|
96
|
+
useEffect(() => {
|
|
97
|
+
if (lastIndexRef.current !== selectedIndex) {
|
|
98
|
+
lastIndexRef.current = selectedIndex;
|
|
99
|
+
const offset = selectedIndex * ITEM_HEIGHT;
|
|
100
|
+
setNativeValue(scrollY, offset);
|
|
101
|
+
// Defer to next frame so FlatList has measured.
|
|
102
|
+
requestAnimationFrame(() => {
|
|
103
|
+
listRef.current?.scrollToOffset({
|
|
104
|
+
offset,
|
|
105
|
+
animated: false
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
}, [selectedIndex, scrollY]);
|
|
110
|
+
const hapticDebounceMs = theme.components.timePicker?.hapticDebounceMs ?? HAPTIC_DEBOUNCE_MS;
|
|
111
|
+
const onScroll = useMemo(() => Animated.event([{
|
|
112
|
+
nativeEvent: {
|
|
113
|
+
contentOffset: {
|
|
114
|
+
y: scrollY
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}], {
|
|
118
|
+
useNativeDriver: true,
|
|
119
|
+
listener: event => {
|
|
120
|
+
const y = event.nativeEvent.contentOffset.y;
|
|
121
|
+
const idx = Math.round(y / ITEM_HEIGHT);
|
|
122
|
+
if (idx !== lastIndexRef.current && idx >= 0 && idx < data.length) {
|
|
123
|
+
const now = Date.now();
|
|
124
|
+
if (now - lastHapticAtRef.current >= hapticDebounceMs) {
|
|
125
|
+
const h = resolveHaptic(haptic, 'selection');
|
|
126
|
+
if (h) {
|
|
127
|
+
triggerHaptic(h);
|
|
128
|
+
}
|
|
129
|
+
lastHapticAtRef.current = now;
|
|
130
|
+
}
|
|
131
|
+
lastIndexRef.current = idx;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}), [scrollY, data.length, haptic, hapticDebounceMs]);
|
|
135
|
+
const onMomentumScrollEnd = useCallback(event => {
|
|
136
|
+
const y = event.nativeEvent.contentOffset.y;
|
|
137
|
+
const idx = Math.max(0, Math.min(data.length - 1, Math.round(y / ITEM_HEIGHT)));
|
|
138
|
+
if (idx !== selectedIndex) {
|
|
139
|
+
onIndexChange(idx);
|
|
140
|
+
}
|
|
141
|
+
}, [data.length, onIndexChange, selectedIndex]);
|
|
142
|
+
const handleA11yAction = useCallback(event => {
|
|
143
|
+
const action = event.nativeEvent.actionName;
|
|
144
|
+
if (action === 'increment') {
|
|
145
|
+
const next = Math.min(data.length - 1, selectedIndex + 1);
|
|
146
|
+
if (next !== selectedIndex) {
|
|
147
|
+
onIndexChange(next);
|
|
148
|
+
}
|
|
149
|
+
} else if (action === 'decrement') {
|
|
150
|
+
const next = Math.max(0, selectedIndex - 1);
|
|
151
|
+
if (next !== selectedIndex) {
|
|
152
|
+
onIndexChange(next);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}, [data.length, onIndexChange, selectedIndex]);
|
|
156
|
+
const renderItem = useCallback(({
|
|
157
|
+
item,
|
|
158
|
+
index
|
|
159
|
+
}) => {
|
|
160
|
+
const distance = Animated.subtract(Animated.divide(scrollY, ITEM_HEIGHT), index);
|
|
161
|
+
const opacity = distance.interpolate({
|
|
162
|
+
inputRange: [-2, -1, 0, 1, 2],
|
|
163
|
+
outputRange: [0.3, 0.6, 1, 0.6, 0.3],
|
|
164
|
+
extrapolate: 'clamp'
|
|
165
|
+
});
|
|
166
|
+
const scale = distance.interpolate({
|
|
167
|
+
inputRange: [-2, -1, 0, 1, 2],
|
|
168
|
+
outputRange: [0.85, 0.95, 1.05, 0.95, 0.85],
|
|
169
|
+
extrapolate: 'clamp'
|
|
170
|
+
});
|
|
171
|
+
const isSelected = index === selectedIndex;
|
|
172
|
+
return /*#__PURE__*/_jsx(Animated.View, {
|
|
173
|
+
style: [styles.wheelItem, {
|
|
174
|
+
opacity,
|
|
175
|
+
transform: [{
|
|
176
|
+
scale
|
|
177
|
+
}]
|
|
178
|
+
}],
|
|
179
|
+
accessible: false,
|
|
180
|
+
importantForAccessibility: "no",
|
|
181
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
182
|
+
style: [{
|
|
183
|
+
fontSize: theme.typography.fontSize.xl,
|
|
184
|
+
color: isSelected ? theme.colors.text.primary : theme.colors.text.secondary,
|
|
185
|
+
fontWeight: isSelected ? theme.typography.fontWeight.semibold : theme.typography.fontWeight.medium,
|
|
186
|
+
letterSpacing: theme.typography.letterSpacing.normal
|
|
187
|
+
}],
|
|
188
|
+
children: formatItem(item)
|
|
189
|
+
})
|
|
190
|
+
});
|
|
191
|
+
}, [scrollY, selectedIndex, theme, formatItem]);
|
|
192
|
+
const keyExtractor = useCallback((item, index) => `${kind}-${String(item)}-${index}`, [kind]);
|
|
193
|
+
const getItemLayout = useCallback((_data, index) => ({
|
|
194
|
+
length: ITEM_HEIGHT,
|
|
195
|
+
offset: ITEM_HEIGHT * index,
|
|
196
|
+
index
|
|
197
|
+
}), []);
|
|
198
|
+
const currentValueText = formatItem(data[selectedIndex] ?? '');
|
|
199
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
200
|
+
style: styles.wheelColumn,
|
|
201
|
+
testID: testID,
|
|
202
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
203
|
+
style: styles.wheelA11yLayer,
|
|
204
|
+
accessible: true,
|
|
205
|
+
accessibilityRole: "adjustable",
|
|
206
|
+
accessibilityLabel: label,
|
|
207
|
+
accessibilityValue: {
|
|
208
|
+
text: currentValueText
|
|
209
|
+
},
|
|
210
|
+
accessibilityActions: [{
|
|
211
|
+
name: 'increment'
|
|
212
|
+
}, {
|
|
213
|
+
name: 'decrement'
|
|
214
|
+
}],
|
|
215
|
+
onAccessibilityAction: handleA11yAction
|
|
216
|
+
}), /*#__PURE__*/_jsx(Animated.FlatList, {
|
|
217
|
+
ref: listRef,
|
|
218
|
+
data: data,
|
|
219
|
+
keyExtractor: keyExtractor,
|
|
220
|
+
renderItem: renderItem,
|
|
221
|
+
getItemLayout: getItemLayout,
|
|
222
|
+
showsVerticalScrollIndicator: false,
|
|
223
|
+
snapToInterval: ITEM_HEIGHT,
|
|
224
|
+
snapToAlignment: "start",
|
|
225
|
+
decelerationRate: "fast",
|
|
226
|
+
bounces: false,
|
|
227
|
+
scrollEventThrottle: 16,
|
|
228
|
+
onScroll: onScroll,
|
|
229
|
+
onMomentumScrollEnd: onMomentumScrollEnd,
|
|
230
|
+
contentContainerStyle: {
|
|
231
|
+
paddingVertical: ITEM_HEIGHT * CENTER_OFFSET
|
|
232
|
+
},
|
|
233
|
+
initialScrollIndex: selectedIndex,
|
|
234
|
+
style: styles.wheelList,
|
|
235
|
+
importantForAccessibility: "no-hide-descendants"
|
|
236
|
+
})]
|
|
237
|
+
});
|
|
238
|
+
};
|
|
239
|
+
const TimePicker = props => {
|
|
240
|
+
const {
|
|
241
|
+
visible,
|
|
242
|
+
value,
|
|
243
|
+
onChange,
|
|
244
|
+
onClose,
|
|
245
|
+
format = '12h',
|
|
246
|
+
minuteStep = 1,
|
|
247
|
+
title = 'Select Time',
|
|
248
|
+
confirmLabel = 'Confirm',
|
|
249
|
+
cancelLabel = 'Cancel',
|
|
250
|
+
testID,
|
|
251
|
+
style,
|
|
252
|
+
containerStyle,
|
|
253
|
+
headerLabelStyle,
|
|
254
|
+
footerButtonStyle,
|
|
255
|
+
label,
|
|
256
|
+
placeholder,
|
|
257
|
+
helperText,
|
|
258
|
+
error,
|
|
259
|
+
required,
|
|
260
|
+
disabled,
|
|
261
|
+
size,
|
|
262
|
+
variant,
|
|
263
|
+
clearable,
|
|
264
|
+
onClear,
|
|
265
|
+
formatValue,
|
|
266
|
+
triggerStyle,
|
|
267
|
+
haptic
|
|
268
|
+
} = props;
|
|
269
|
+
const isControlled = props.visible !== undefined;
|
|
270
|
+
const [internalOpen, setInternalOpen] = useState(false);
|
|
271
|
+
const open = isControlled ? visible : internalOpen;
|
|
272
|
+
|
|
273
|
+
// In trigger mode the trigger field is what's on screen by default, so it
|
|
274
|
+
// carries the bare testID; the modal sheet (rendered alongside it, just
|
|
275
|
+
// closed) gets a derived id to avoid two nodes sharing the same testID.
|
|
276
|
+
const modalTestID = isControlled ? testID : testID ? `${testID}-modal` : undefined;
|
|
277
|
+
const theme = useTheme();
|
|
278
|
+
const insets = useSafeAreaInsets();
|
|
279
|
+
const styles = useMemo(() => buildStyles(theme), [theme]);
|
|
280
|
+
const opacity = useRef(createAnimatedValue(0)).current;
|
|
281
|
+
const translateY = useRef(createAnimatedValue(40)).current;
|
|
282
|
+
const finalizeClose = useCallback(() => {
|
|
283
|
+
if (isControlled) {
|
|
284
|
+
onClose?.();
|
|
285
|
+
} else {
|
|
286
|
+
setInternalOpen(false);
|
|
287
|
+
}
|
|
288
|
+
}, [isControlled, onClose]);
|
|
289
|
+
|
|
290
|
+
// Animate out before finalizing, matching DatePicker/DateRangePicker — this
|
|
291
|
+
// sheet used to spring in and then vanish on close.
|
|
292
|
+
const handleCloseModal = useCallback(() => {
|
|
293
|
+
Animated.parallel([Animated.timing(opacity, {
|
|
294
|
+
toValue: 0,
|
|
295
|
+
duration: theme.motion.duration.fast,
|
|
296
|
+
easing: Easing.bezier(...theme.motion.easing.accelerate),
|
|
297
|
+
useNativeDriver: false
|
|
298
|
+
}), Animated.timing(translateY, {
|
|
299
|
+
toValue: 40,
|
|
300
|
+
duration: theme.motion.duration.fast,
|
|
301
|
+
easing: Easing.bezier(...theme.motion.easing.accelerate),
|
|
302
|
+
useNativeDriver: true
|
|
303
|
+
})]).start(() => finalizeClose());
|
|
304
|
+
}, [finalizeClose, opacity, translateY, theme.motion.duration.fast, theme.motion.easing.accelerate]);
|
|
305
|
+
const hours = useMemo(() => format === '24h' ? range(0, 23) : range(1, 12), [format]);
|
|
306
|
+
const minutes = useMemo(() => range(0, 59, minuteStep), [minuteStep]);
|
|
307
|
+
const periods = useMemo(() => ['AM', 'PM'], []);
|
|
308
|
+
const initial = useMemo(() => {
|
|
309
|
+
const h24 = value && Number.isFinite(value.hour) ? value.hour : new Date().getHours();
|
|
310
|
+
const m = value && Number.isFinite(value.minute) ? value.minute : new Date().getMinutes();
|
|
311
|
+
const minute = clampMinuteToStep(m, minuteStep);
|
|
312
|
+
const {
|
|
313
|
+
displayHour,
|
|
314
|
+
period
|
|
315
|
+
} = from24h(h24, format);
|
|
316
|
+
return {
|
|
317
|
+
displayHour,
|
|
318
|
+
minute,
|
|
319
|
+
period,
|
|
320
|
+
hour24: h24
|
|
321
|
+
};
|
|
322
|
+
}, [value, format, minuteStep]);
|
|
323
|
+
const [hourIndex, setHourIndex] = useState(() => {
|
|
324
|
+
const idx = hours.indexOf(initial.displayHour);
|
|
325
|
+
return idx >= 0 ? idx : 0;
|
|
326
|
+
});
|
|
327
|
+
const [minuteIndex, setMinuteIndex] = useState(() => {
|
|
328
|
+
const idx = minutes.indexOf(initial.minute);
|
|
329
|
+
return idx >= 0 ? idx : 0;
|
|
330
|
+
});
|
|
331
|
+
const [periodIndex, setPeriodIndex] = useState(() => initial.period === 'PM' ? 1 : 0);
|
|
332
|
+
|
|
333
|
+
// Re-sync on open toggle / value change / format / step.
|
|
334
|
+
useEffect(() => {
|
|
335
|
+
if (!open) {
|
|
336
|
+
return;
|
|
337
|
+
}
|
|
338
|
+
const h24 = value && Number.isFinite(value.hour) ? value.hour : new Date().getHours();
|
|
339
|
+
const m = value && Number.isFinite(value.minute) ? value.minute : new Date().getMinutes();
|
|
340
|
+
const stepped = clampMinuteToStep(m, minuteStep);
|
|
341
|
+
const {
|
|
342
|
+
displayHour,
|
|
343
|
+
period
|
|
344
|
+
} = from24h(h24, format);
|
|
345
|
+
const hIdx = hours.indexOf(displayHour);
|
|
346
|
+
setHourIndex(hIdx >= 0 ? hIdx : 0);
|
|
347
|
+
const mIdx = minutes.indexOf(stepped);
|
|
348
|
+
setMinuteIndex(mIdx >= 0 ? mIdx : 0);
|
|
349
|
+
setPeriodIndex(period === 'PM' ? 1 : 0);
|
|
350
|
+
}, [open, value, format, minuteStep, hours, minutes]);
|
|
351
|
+
|
|
352
|
+
// Sheet animations.
|
|
353
|
+
|
|
354
|
+
useEffect(() => {
|
|
355
|
+
let anim;
|
|
356
|
+
if (open) {
|
|
357
|
+
anim = Animated.parallel([
|
|
358
|
+
// Backdrop opacity uses JS driver — see Modal.tsx for the Fabric reason.
|
|
359
|
+
Animated.timing(opacity, {
|
|
360
|
+
toValue: 1,
|
|
361
|
+
duration: theme.motion.duration.normal,
|
|
362
|
+
easing: Easing.out(Easing.cubic),
|
|
363
|
+
useNativeDriver: false
|
|
364
|
+
}), Animated.spring(translateY, {
|
|
365
|
+
toValue: 0,
|
|
366
|
+
damping: theme.motion.spring.snappy.damping,
|
|
367
|
+
stiffness: theme.motion.spring.snappy.stiffness,
|
|
368
|
+
mass: theme.motion.spring.snappy.mass,
|
|
369
|
+
useNativeDriver: true
|
|
370
|
+
})]);
|
|
371
|
+
anim.start();
|
|
372
|
+
} else {
|
|
373
|
+
opacity.setValue(0);
|
|
374
|
+
setNativeValue(translateY, 40);
|
|
375
|
+
}
|
|
376
|
+
return () => anim?.stop();
|
|
377
|
+
}, [open, opacity, translateY, theme.motion]);
|
|
378
|
+
const announce = useCallback(msg => {
|
|
379
|
+
if (Platform.OS === 'ios' || Platform.OS === 'android') {
|
|
380
|
+
AccessibilityInfo.announceForAccessibility(msg);
|
|
381
|
+
}
|
|
382
|
+
}, []);
|
|
383
|
+
const handleHourIndex = useCallback(idx => {
|
|
384
|
+
setHourIndex(idx);
|
|
385
|
+
announce(`Hour ${hours[idx]}`);
|
|
386
|
+
}, [hours, announce]);
|
|
387
|
+
const handleMinuteIndex = useCallback(idx => {
|
|
388
|
+
setMinuteIndex(idx);
|
|
389
|
+
announce(`${minutes[idx]} minutes`);
|
|
390
|
+
}, [minutes, announce]);
|
|
391
|
+
const handlePeriodIndex = useCallback(idx => {
|
|
392
|
+
setPeriodIndex(idx);
|
|
393
|
+
announce(periods[idx] ?? '');
|
|
394
|
+
}, [periods, announce]);
|
|
395
|
+
const handleCancel = useCallback(() => {
|
|
396
|
+
if (haptic !== false) {
|
|
397
|
+
triggerHaptic('selection');
|
|
398
|
+
}
|
|
399
|
+
handleCloseModal();
|
|
400
|
+
}, [handleCloseModal, haptic]);
|
|
401
|
+
const handleConfirm = useCallback(() => {
|
|
402
|
+
const displayHour = hours[hourIndex] ?? 0;
|
|
403
|
+
const period = periods[periodIndex] ?? 'AM';
|
|
404
|
+
const hour24 = to24h(displayHour, period, format);
|
|
405
|
+
const minute = minutes[minuteIndex] ?? 0;
|
|
406
|
+
if (haptic !== false) {
|
|
407
|
+
triggerHaptic('notificationSuccess');
|
|
408
|
+
}
|
|
409
|
+
onChange?.({
|
|
410
|
+
hour: hour24,
|
|
411
|
+
minute
|
|
412
|
+
});
|
|
413
|
+
handleCloseModal();
|
|
414
|
+
}, [hours, hourIndex, periods, periodIndex, minutes, minuteIndex, format, onChange, handleCloseModal, haptic]);
|
|
415
|
+
const summary = useMemo(() => {
|
|
416
|
+
const displayHour = hours[hourIndex] ?? 0;
|
|
417
|
+
const minute = minutes[minuteIndex] ?? 0;
|
|
418
|
+
if (format === '24h') {
|
|
419
|
+
return `${pad2(displayHour)}:${pad2(minute)}`;
|
|
420
|
+
}
|
|
421
|
+
const period = periods[periodIndex] ?? 'AM';
|
|
422
|
+
return `${pad2(displayHour)}:${pad2(minute)} ${period}`;
|
|
423
|
+
}, [hours, hourIndex, minutes, minuteIndex, periods, periodIndex, format]);
|
|
424
|
+
const formatHourItem = useCallback(item => pad2(Number(item)), []);
|
|
425
|
+
const formatMinuteItem = useCallback(item => pad2(Number(item)), []);
|
|
426
|
+
const formatPeriodItem = useCallback(item => String(item), []);
|
|
427
|
+
const defaultFormatValue = useCallback(t => {
|
|
428
|
+
if (format === '24h') {
|
|
429
|
+
return `${pad2(t.hour)}:${pad2(t.minute)}`;
|
|
430
|
+
}
|
|
431
|
+
const {
|
|
432
|
+
displayHour,
|
|
433
|
+
period
|
|
434
|
+
} = from24h(t.hour, '12h');
|
|
435
|
+
return `${displayHour}:${pad2(t.minute)} ${period}`;
|
|
436
|
+
}, [format]);
|
|
437
|
+
const triggerValue = !isControlled && value && Number.isFinite(value.hour) && Number.isFinite(value.minute) ? (formatValue ?? defaultFormatValue)(value) : undefined;
|
|
438
|
+
const modal = /*#__PURE__*/_jsx(Modal, {
|
|
439
|
+
visible: open,
|
|
440
|
+
transparent: true,
|
|
441
|
+
statusBarTranslucent: true,
|
|
442
|
+
navigationBarTranslucent: true,
|
|
443
|
+
animationType: "none",
|
|
444
|
+
onRequestClose: handleCloseModal,
|
|
445
|
+
testID: modalTestID,
|
|
446
|
+
children: /*#__PURE__*/_jsxs(View
|
|
447
|
+
// Plain View + collapsable={false} — see Modal.tsx backdrop comment.
|
|
448
|
+
, {
|
|
449
|
+
collapsable: false,
|
|
450
|
+
style: styles.backdrop,
|
|
451
|
+
children: [/*#__PURE__*/_jsx(Pressable, {
|
|
452
|
+
style: StyleSheet.absoluteFill,
|
|
453
|
+
onPress: handleCloseModal,
|
|
454
|
+
accessibilityLabel: "Close time picker",
|
|
455
|
+
accessibilityRole: "button"
|
|
456
|
+
}), /*#__PURE__*/_jsxs(Animated.View, {
|
|
457
|
+
style: [styles.sheet, {
|
|
458
|
+
paddingBottom: insets.bottom + theme.spacing.xl,
|
|
459
|
+
transform: [{
|
|
460
|
+
translateY
|
|
461
|
+
}]
|
|
462
|
+
}, style, containerStyle],
|
|
463
|
+
accessibilityViewIsModal: true,
|
|
464
|
+
accessible: true,
|
|
465
|
+
accessibilityRole: "none",
|
|
466
|
+
accessibilityLabel: title,
|
|
467
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
468
|
+
style: styles.handle
|
|
469
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
470
|
+
style: [styles.title, headerLabelStyle],
|
|
471
|
+
accessibilityRole: "header",
|
|
472
|
+
children: title
|
|
473
|
+
}), /*#__PURE__*/_jsx(View, {
|
|
474
|
+
style: styles.summaryWrap,
|
|
475
|
+
accessibilityLiveRegion: "polite",
|
|
476
|
+
accessibilityLabel: `Selected ${summary}`,
|
|
477
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
478
|
+
style: styles.summary,
|
|
479
|
+
children: summary
|
|
480
|
+
})
|
|
481
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
482
|
+
style: styles.wheelsRow,
|
|
483
|
+
children: [/*#__PURE__*/_jsxs(View, {
|
|
484
|
+
pointerEvents: "none",
|
|
485
|
+
style: styles.selectionBand,
|
|
486
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
487
|
+
style: styles.bandLine
|
|
488
|
+
}), /*#__PURE__*/_jsx(View, {
|
|
489
|
+
style: [styles.bandLine, styles.bandLineBottom]
|
|
490
|
+
})]
|
|
491
|
+
}), /*#__PURE__*/_jsx(Wheel, {
|
|
492
|
+
kind: "hour",
|
|
493
|
+
label: "Hour",
|
|
494
|
+
data: hours,
|
|
495
|
+
selectedIndex: hourIndex,
|
|
496
|
+
onIndexChange: handleHourIndex,
|
|
497
|
+
formatItem: formatHourItem,
|
|
498
|
+
theme: theme,
|
|
499
|
+
haptic: haptic,
|
|
500
|
+
testID: "time-picker-hour"
|
|
501
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
502
|
+
style: styles.separator,
|
|
503
|
+
children: ":"
|
|
504
|
+
}), /*#__PURE__*/_jsx(Wheel, {
|
|
505
|
+
kind: "minute",
|
|
506
|
+
label: "Minute",
|
|
507
|
+
data: minutes,
|
|
508
|
+
selectedIndex: minuteIndex,
|
|
509
|
+
onIndexChange: handleMinuteIndex,
|
|
510
|
+
formatItem: formatMinuteItem,
|
|
511
|
+
theme: theme,
|
|
512
|
+
haptic: haptic,
|
|
513
|
+
testID: "time-picker-minute"
|
|
514
|
+
}), format === '12h' ? /*#__PURE__*/_jsxs(_Fragment, {
|
|
515
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
516
|
+
style: styles.spacer
|
|
517
|
+
}), /*#__PURE__*/_jsx(Wheel, {
|
|
518
|
+
kind: "period",
|
|
519
|
+
label: "Period",
|
|
520
|
+
data: periods,
|
|
521
|
+
selectedIndex: periodIndex,
|
|
522
|
+
onIndexChange: handlePeriodIndex,
|
|
523
|
+
formatItem: formatPeriodItem,
|
|
524
|
+
theme: theme,
|
|
525
|
+
haptic: haptic,
|
|
526
|
+
testID: "time-picker-period"
|
|
527
|
+
})]
|
|
528
|
+
}) : null]
|
|
529
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
530
|
+
style: styles.footer,
|
|
531
|
+
children: [/*#__PURE__*/_jsx(Button, {
|
|
532
|
+
title: cancelLabel,
|
|
533
|
+
haptic: false,
|
|
534
|
+
variant: "ghost",
|
|
535
|
+
tone: "neutral",
|
|
536
|
+
onPress: handleCancel,
|
|
537
|
+
style: [styles.footerBtn, footerButtonStyle],
|
|
538
|
+
accessibilityHint: "Dismiss without changes",
|
|
539
|
+
testID: "time-picker-cancel"
|
|
540
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
541
|
+
title: confirmLabel,
|
|
542
|
+
variant: "solid",
|
|
543
|
+
tone: "primary",
|
|
544
|
+
haptic: false,
|
|
545
|
+
onPress: handleConfirm,
|
|
546
|
+
style: [styles.footerBtn, footerButtonStyle],
|
|
547
|
+
accessibilityHint: "Confirm selected time",
|
|
548
|
+
testID: "time-picker-confirm"
|
|
549
|
+
})]
|
|
550
|
+
})]
|
|
551
|
+
})]
|
|
552
|
+
})
|
|
553
|
+
});
|
|
554
|
+
if (isControlled) {
|
|
555
|
+
return modal;
|
|
556
|
+
}
|
|
557
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
558
|
+
children: [/*#__PURE__*/_jsx(PickerTrigger, {
|
|
559
|
+
label: label,
|
|
560
|
+
placeholder: placeholder,
|
|
561
|
+
helperText: helperText,
|
|
562
|
+
error: error,
|
|
563
|
+
required: required,
|
|
564
|
+
disabled: disabled,
|
|
565
|
+
size: size,
|
|
566
|
+
variant: variant,
|
|
567
|
+
clearable: clearable,
|
|
568
|
+
onClear: onClear,
|
|
569
|
+
value: triggerValue,
|
|
570
|
+
onPress: () => setInternalOpen(true),
|
|
571
|
+
triggerStyle: triggerStyle,
|
|
572
|
+
testID: testID
|
|
573
|
+
}), modal]
|
|
574
|
+
});
|
|
575
|
+
};
|
|
576
|
+
const styles = StyleSheet.create({
|
|
577
|
+
wheelColumn: {
|
|
578
|
+
width: 64,
|
|
579
|
+
height: PICKER_HEIGHT,
|
|
580
|
+
overflow: 'hidden'
|
|
581
|
+
},
|
|
582
|
+
wheelList: {
|
|
583
|
+
flexGrow: 0,
|
|
584
|
+
height: PICKER_HEIGHT
|
|
585
|
+
},
|
|
586
|
+
wheelItem: {
|
|
587
|
+
height: ITEM_HEIGHT,
|
|
588
|
+
alignItems: 'center',
|
|
589
|
+
justifyContent: 'center'
|
|
590
|
+
},
|
|
591
|
+
wheelA11yLayer: {
|
|
592
|
+
...StyleSheet.absoluteFill,
|
|
593
|
+
zIndex: 2
|
|
594
|
+
}
|
|
595
|
+
});
|
|
596
|
+
const buildStyles = theme => {
|
|
597
|
+
const sheetShadow = theme.shadows.xl;
|
|
598
|
+
return StyleSheet.create({
|
|
599
|
+
backdrop: {
|
|
600
|
+
flex: 1,
|
|
601
|
+
backgroundColor: theme.colors.background.overlay,
|
|
602
|
+
justifyContent: 'flex-end'
|
|
603
|
+
},
|
|
604
|
+
sheet: {
|
|
605
|
+
backgroundColor: theme.colors.background.elevated,
|
|
606
|
+
borderTopLeftRadius: theme.radius.xl,
|
|
607
|
+
borderTopRightRadius: theme.radius.xl,
|
|
608
|
+
paddingTop: theme.spacing.sm,
|
|
609
|
+
paddingHorizontal: theme.spacing.lg,
|
|
610
|
+
paddingBottom: theme.spacing.xl,
|
|
611
|
+
shadowColor: sheetShadow.shadowColor,
|
|
612
|
+
shadowOffset: sheetShadow.shadowOffset,
|
|
613
|
+
shadowOpacity: sheetShadow.shadowOpacity,
|
|
614
|
+
shadowRadius: sheetShadow.shadowRadius,
|
|
615
|
+
elevation: sheetShadow.elevation
|
|
616
|
+
},
|
|
617
|
+
handle: {
|
|
618
|
+
alignSelf: 'center',
|
|
619
|
+
width: theme.components.timePicker?.handleWidth ?? 36,
|
|
620
|
+
height: theme.components.timePicker?.handleHeight ?? 4,
|
|
621
|
+
borderRadius: theme.radius.full,
|
|
622
|
+
backgroundColor: theme.colors.border.secondary,
|
|
623
|
+
marginBottom: theme.spacing.sm
|
|
624
|
+
},
|
|
625
|
+
title: {
|
|
626
|
+
textAlign: 'center',
|
|
627
|
+
fontSize: theme.typography.fontSize.lg,
|
|
628
|
+
fontWeight: theme.typography.fontWeight.semibold,
|
|
629
|
+
color: theme.colors.text.primary,
|
|
630
|
+
marginBottom: theme.spacing.sm
|
|
631
|
+
},
|
|
632
|
+
summaryWrap: {
|
|
633
|
+
alignItems: 'center',
|
|
634
|
+
marginBottom: theme.spacing.md
|
|
635
|
+
},
|
|
636
|
+
summary: {
|
|
637
|
+
fontSize: theme.typography.fontSize['2xl'],
|
|
638
|
+
fontWeight: theme.typography.fontWeight.bold,
|
|
639
|
+
color: theme.colors.primary,
|
|
640
|
+
letterSpacing: theme.typography.letterSpacing.wide
|
|
641
|
+
},
|
|
642
|
+
wheelsRow: {
|
|
643
|
+
flexDirection: 'row',
|
|
644
|
+
alignItems: 'center',
|
|
645
|
+
justifyContent: 'center',
|
|
646
|
+
height: PICKER_HEIGHT,
|
|
647
|
+
position: 'relative',
|
|
648
|
+
marginBottom: theme.spacing.lg
|
|
649
|
+
},
|
|
650
|
+
selectionBand: {
|
|
651
|
+
position: 'absolute',
|
|
652
|
+
left: 0,
|
|
653
|
+
right: 0,
|
|
654
|
+
top: ITEM_HEIGHT * CENTER_OFFSET,
|
|
655
|
+
height: ITEM_HEIGHT,
|
|
656
|
+
justifyContent: 'space-between'
|
|
657
|
+
},
|
|
658
|
+
bandLine: {
|
|
659
|
+
height: StyleSheet.hairlineWidth * 2,
|
|
660
|
+
backgroundColor: theme.colors.primary,
|
|
661
|
+
opacity: 0.85
|
|
662
|
+
},
|
|
663
|
+
bandLineBottom: {
|
|
664
|
+
// visual rhythm only — same color as top
|
|
665
|
+
},
|
|
666
|
+
separator: {
|
|
667
|
+
fontSize: theme.typography.fontSize['2xl'],
|
|
668
|
+
fontWeight: theme.typography.fontWeight.bold,
|
|
669
|
+
color: theme.colors.text.primary,
|
|
670
|
+
paddingHorizontal: theme.spacing.xs
|
|
671
|
+
},
|
|
672
|
+
spacer: {
|
|
673
|
+
width: theme.spacing.md
|
|
674
|
+
},
|
|
675
|
+
footer: {
|
|
676
|
+
flexDirection: 'row',
|
|
677
|
+
gap: theme.spacing.sm
|
|
678
|
+
},
|
|
679
|
+
footerBtn: {
|
|
680
|
+
flex: 1
|
|
681
|
+
}
|
|
682
|
+
});
|
|
683
|
+
};
|
|
684
|
+
export { TimePicker };
|
|
685
|
+
export default TimePicker;
|
|
686
|
+
//# sourceMappingURL=TimePicker.js.map
|