@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,553 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* BottomSheet — Reanimated 3 + Gesture Handler 2 implementation.
|
|
5
|
+
*
|
|
6
|
+
* A polished, theme-aware bottom sheet with multi-snap-point support,
|
|
7
|
+
* UI-thread driven pan gestures, and native-driver spring animations.
|
|
8
|
+
*
|
|
9
|
+
* USAGE:
|
|
10
|
+
*
|
|
11
|
+
* const ref = useRef<BottomSheetRef>(null);
|
|
12
|
+
* <BottomSheet ref={ref} snapPoints={[200, '50%', '90%']}>
|
|
13
|
+
* <YourContent />
|
|
14
|
+
* </BottomSheet>
|
|
15
|
+
*
|
|
16
|
+
* ref.current?.expand(); // open at first snap point (or `index` prop)
|
|
17
|
+
* ref.current?.expand(2); // open at specific index
|
|
18
|
+
* ref.current?.collapse(); // animate to smallest snap point
|
|
19
|
+
* ref.current?.close(); // dismiss
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
import React, { createContext, forwardRef, useCallback, useContext, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';
|
|
23
|
+
import { Dimensions, Keyboard, Modal, Platform, StyleSheet, View } from 'react-native';
|
|
24
|
+
import { Gesture, GestureDetector, GestureHandlerRootView } from 'react-native-gesture-handler';
|
|
25
|
+
import Animated, { Easing, runOnJS, useAnimatedStyle, useSharedValue, withSpring, withTiming } from 'react-native-reanimated';
|
|
26
|
+
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
27
|
+
import { useTheme } from "../../theme/index.js";
|
|
28
|
+
import { triggerHaptic } from "../../utils/index.js";
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* State + actions exposed to anything rendered inside a `<BottomSheet>` —
|
|
32
|
+
* including the `header` and `footer` slots. Read via `useBottomSheet()`.
|
|
33
|
+
*
|
|
34
|
+
* `snapIndex` is the JS-thread mirror of the current snap point. -1 means the
|
|
35
|
+
* sheet is closed (mid-close-animation included). Use it to drive footer
|
|
36
|
+
* button enable state, conditional headers, etc. If you need per-frame
|
|
37
|
+
* progress (e.g. fade a header in as the sheet expands), reach for the
|
|
38
|
+
* animated value via a future enhancement — not exposed today to keep the
|
|
39
|
+
* surface minimal.
|
|
40
|
+
*/
|
|
41
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
42
|
+
const BottomSheetContext = /*#__PURE__*/createContext(null);
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Access the enclosing `<BottomSheet>`'s state and imperative actions.
|
|
46
|
+
* Must be called from a component rendered inside a `<BottomSheet>` (as
|
|
47
|
+
* `children`, `header`, or `footer`).
|
|
48
|
+
*/
|
|
49
|
+
export const useBottomSheet = () => {
|
|
50
|
+
const ctx = useContext(BottomSheetContext);
|
|
51
|
+
if (!ctx) {
|
|
52
|
+
throw new Error('useBottomSheet must be used inside a <BottomSheet>.');
|
|
53
|
+
}
|
|
54
|
+
return ctx;
|
|
55
|
+
};
|
|
56
|
+
const SPRING_CONFIG = {
|
|
57
|
+
damping: 20,
|
|
58
|
+
stiffness: 240,
|
|
59
|
+
mass: 1
|
|
60
|
+
};
|
|
61
|
+
const CLOSE_VELOCITY_THRESHOLD = 1000;
|
|
62
|
+
const DRAG_ACTIVATION_OFFSET = 10;
|
|
63
|
+
const BottomSheet = /*#__PURE__*/forwardRef((props, ref) => {
|
|
64
|
+
const {
|
|
65
|
+
snapPoints,
|
|
66
|
+
index: controlledIndex,
|
|
67
|
+
onChange,
|
|
68
|
+
onAnimate,
|
|
69
|
+
enablePanDownToClose = true,
|
|
70
|
+
enableBackdropPress = true,
|
|
71
|
+
keyboardBehavior = 'none',
|
|
72
|
+
mode = 'modal',
|
|
73
|
+
handleIndicatorStyle,
|
|
74
|
+
containerStyle,
|
|
75
|
+
header,
|
|
76
|
+
footer,
|
|
77
|
+
headerStyle,
|
|
78
|
+
footerStyle,
|
|
79
|
+
children,
|
|
80
|
+
accessibilityLabel,
|
|
81
|
+
accessibilityViewIsModal,
|
|
82
|
+
testID
|
|
83
|
+
} = props;
|
|
84
|
+
const theme = useTheme();
|
|
85
|
+
const insets = useSafeAreaInsets();
|
|
86
|
+
const [screenHeight, setScreenHeight] = useState(() => Dimensions.get('window').height);
|
|
87
|
+
|
|
88
|
+
// Resolve snap points (px values), sorted ascending so larger height = smaller translateY.
|
|
89
|
+
const resolvedSnapPoints = useMemo(() => resolveSnapPoints(snapPoints, screenHeight), [snapPoints, screenHeight]);
|
|
90
|
+
|
|
91
|
+
// Listen for orientation / window changes so % snap points stay accurate.
|
|
92
|
+
useEffect(() => {
|
|
93
|
+
const sub = Dimensions.addEventListener('change', ({
|
|
94
|
+
window
|
|
95
|
+
}) => {
|
|
96
|
+
setScreenHeight(window.height);
|
|
97
|
+
});
|
|
98
|
+
return () => sub.remove();
|
|
99
|
+
}, []);
|
|
100
|
+
const closedY = screenHeight; // fully off-screen
|
|
101
|
+
const maxSnapPoint = resolvedSnapPoints[resolvedSnapPoints.length - 1] ?? 0;
|
|
102
|
+
|
|
103
|
+
// translateY: 0 = top of screen, screenHeight = fully closed.
|
|
104
|
+
const translateY = useSharedValue(closedY);
|
|
105
|
+
// Captures the translateY at gesture start so onUpdate can be additive.
|
|
106
|
+
const dragStartY = useSharedValue(closedY);
|
|
107
|
+
// Tracks current snap index on the JS thread (mirrored to a shared value for worklets).
|
|
108
|
+
const currentIndexShared = useSharedValue(-1);
|
|
109
|
+
const [currentIndex, setCurrentIndex] = useState(-1);
|
|
110
|
+
const isAnimatingRef = useRef(false);
|
|
111
|
+
// Drives the native <Modal>'s visible prop in modal mode. We mount the modal
|
|
112
|
+
// synchronously on open and unmount only after the close animation finishes
|
|
113
|
+
// so the slide-down stays visible.
|
|
114
|
+
const [modalVisible, setModalVisible] = useState(false);
|
|
115
|
+
// Inline-mode mirror of modalVisible: gates the absoluteFill backdrop +
|
|
116
|
+
// sheet tree so a closed inline sheet doesn't sit over the parent dimming
|
|
117
|
+
// it and swallowing touches. Set true on expand, cleared in
|
|
118
|
+
// markAnimationDone once the close animation completes.
|
|
119
|
+
const [inlineMounted, setInlineMounted] = useState(false);
|
|
120
|
+
|
|
121
|
+
// Convert a snap-point index → translateY position. -1 = closed.
|
|
122
|
+
const yForIndex = useCallback(idx => {
|
|
123
|
+
if (idx < 0 || idx >= resolvedSnapPoints.length) {
|
|
124
|
+
return closedY;
|
|
125
|
+
}
|
|
126
|
+
const sheetHeight = resolvedSnapPoints[idx];
|
|
127
|
+
return screenHeight - sheetHeight;
|
|
128
|
+
}, [resolvedSnapPoints, screenHeight, closedY]);
|
|
129
|
+
const setIndexJS = useCallback(next => {
|
|
130
|
+
const previous = currentIndex;
|
|
131
|
+
if (previous === next) {
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
setCurrentIndex(next);
|
|
135
|
+
currentIndexShared.value = next;
|
|
136
|
+
onChange?.(next);
|
|
137
|
+
}, [currentIndex, currentIndexShared, onChange]);
|
|
138
|
+
const markAnimationDone = useCallback(() => {
|
|
139
|
+
isAnimatingRef.current = false;
|
|
140
|
+
// If we just finished a close animation, unmount the sheet wrapper.
|
|
141
|
+
if (currentIndexShared.value < 0) {
|
|
142
|
+
if (mode === 'modal') {
|
|
143
|
+
setModalVisible(false);
|
|
144
|
+
} else {
|
|
145
|
+
setInlineMounted(false);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}, [mode, currentIndexShared]);
|
|
149
|
+
const animateTo = useCallback((to, fromIndex, toIndex) => {
|
|
150
|
+
isAnimatingRef.current = true;
|
|
151
|
+
onAnimate?.(fromIndex, toIndex);
|
|
152
|
+
translateY.value = withSpring(to, SPRING_CONFIG, finished => {
|
|
153
|
+
'worklet';
|
|
154
|
+
|
|
155
|
+
if (finished) {
|
|
156
|
+
runOnJS(markAnimationDone)();
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
}, [onAnimate, translateY, markAnimationDone]);
|
|
160
|
+
const expand = useCallback(idx => {
|
|
161
|
+
const target = typeof idx === 'number' ? clamp(idx, 0, resolvedSnapPoints.length - 1) : currentIndex >= 0 ? currentIndex : 0;
|
|
162
|
+
const fromIndex = currentIndexShared.value;
|
|
163
|
+
const to = yForIndex(target);
|
|
164
|
+
// Mount the host (Modal in modal mode, inline overlay in inline mode)
|
|
165
|
+
// before kicking off the spring so the sheet has somewhere to animate
|
|
166
|
+
// into. Inline mode also gates the backdrop on this so a closed sheet
|
|
167
|
+
// doesn't dim the parent.
|
|
168
|
+
if (mode === 'modal') {
|
|
169
|
+
setModalVisible(true);
|
|
170
|
+
} else {
|
|
171
|
+
setInlineMounted(true);
|
|
172
|
+
}
|
|
173
|
+
// Reset translateY to the closed position so the first open animates
|
|
174
|
+
// up from off-screen rather than snapping in place.
|
|
175
|
+
if (fromIndex < 0) {
|
|
176
|
+
translateY.value = closedY;
|
|
177
|
+
}
|
|
178
|
+
setIndexJS(target);
|
|
179
|
+
animateTo(to, fromIndex, target);
|
|
180
|
+
}, [animateTo, closedY, currentIndex, currentIndexShared, mode, resolvedSnapPoints.length, setIndexJS, translateY, yForIndex]);
|
|
181
|
+
const collapse = useCallback(() => {
|
|
182
|
+
if (resolvedSnapPoints.length === 0) {
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
const fromIndex = currentIndexShared.value;
|
|
186
|
+
const to = yForIndex(0);
|
|
187
|
+
setIndexJS(0);
|
|
188
|
+
animateTo(to, fromIndex, 0);
|
|
189
|
+
}, [animateTo, currentIndexShared, resolvedSnapPoints.length, setIndexJS, yForIndex]);
|
|
190
|
+
const close = useCallback(() => {
|
|
191
|
+
const fromIndex = currentIndexShared.value;
|
|
192
|
+
setIndexJS(-1);
|
|
193
|
+
isAnimatingRef.current = true;
|
|
194
|
+
onAnimate?.(fromIndex, -1);
|
|
195
|
+
translateY.value = withTiming(closedY, {
|
|
196
|
+
duration: theme.motion.duration.fast,
|
|
197
|
+
easing: Easing.bezier(...theme.motion.easing.accelerate)
|
|
198
|
+
}, finished => {
|
|
199
|
+
'worklet';
|
|
200
|
+
|
|
201
|
+
if (finished) {
|
|
202
|
+
runOnJS(markAnimationDone)();
|
|
203
|
+
}
|
|
204
|
+
});
|
|
205
|
+
}, [closedY, currentIndexShared, markAnimationDone, onAnimate, setIndexJS, translateY, theme.motion.duration.fast, theme.motion.easing.accelerate]);
|
|
206
|
+
useImperativeHandle(ref, () => ({
|
|
207
|
+
expand,
|
|
208
|
+
collapse,
|
|
209
|
+
close
|
|
210
|
+
}), [expand, collapse, close]);
|
|
211
|
+
|
|
212
|
+
// Drive the controlled `index` prop.
|
|
213
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: controlled-prop driver: adding `currentIndex` would fight the user's drag by re-snapping to the controlled index
|
|
214
|
+
useEffect(() => {
|
|
215
|
+
if (typeof controlledIndex !== 'number') {
|
|
216
|
+
return;
|
|
217
|
+
}
|
|
218
|
+
if (controlledIndex === currentIndex) {
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
221
|
+
if (controlledIndex === -1) {
|
|
222
|
+
close();
|
|
223
|
+
} else {
|
|
224
|
+
expand(controlledIndex);
|
|
225
|
+
}
|
|
226
|
+
}, [controlledIndex]);
|
|
227
|
+
|
|
228
|
+
// ───────── Gesture (UI thread) ─────────
|
|
229
|
+
// Worklet helpers must be declared inline so they capture shared values correctly.
|
|
230
|
+
const minTopY = screenHeight - maxSnapPoint; // smallest translateY (sheet fully expanded)
|
|
231
|
+
const snapTargets = useMemo(() => resolvedSnapPoints.map(h => screenHeight - h), [resolvedSnapPoints, screenHeight]);
|
|
232
|
+
const handleSnapEnd = useCallback((toIndex, toY) => {
|
|
233
|
+
const fromIndex = currentIndexShared.value;
|
|
234
|
+
if (toIndex === -1) {
|
|
235
|
+
triggerHaptic('selection');
|
|
236
|
+
setIndexJS(-1);
|
|
237
|
+
isAnimatingRef.current = true;
|
|
238
|
+
onAnimate?.(fromIndex, -1);
|
|
239
|
+
translateY.value = withTiming(closedY, {
|
|
240
|
+
duration: theme.motion.duration.fast,
|
|
241
|
+
easing: Easing.bezier(...theme.motion.easing.accelerate)
|
|
242
|
+
}, finished => {
|
|
243
|
+
'worklet';
|
|
244
|
+
|
|
245
|
+
if (finished) {
|
|
246
|
+
runOnJS(markAnimationDone)();
|
|
247
|
+
}
|
|
248
|
+
});
|
|
249
|
+
return;
|
|
250
|
+
}
|
|
251
|
+
setIndexJS(toIndex);
|
|
252
|
+
animateTo(toY, fromIndex, toIndex);
|
|
253
|
+
}, [animateTo, closedY, currentIndexShared, markAnimationDone, onAnimate, setIndexJS, translateY, theme.motion.duration.fast, theme.motion.easing.accelerate]);
|
|
254
|
+
const panGesture = useMemo(() => {
|
|
255
|
+
const targets = snapTargets;
|
|
256
|
+
const closed = closedY;
|
|
257
|
+
const top = minTopY;
|
|
258
|
+
const canPanDownToClose = enablePanDownToClose;
|
|
259
|
+
return Gesture.Pan().activeOffsetY([-DRAG_ACTIVATION_OFFSET, DRAG_ACTIVATION_OFFSET]).failOffsetX([-15, 15]).onStart(() => {
|
|
260
|
+
'worklet';
|
|
261
|
+
|
|
262
|
+
dragStartY.value = translateY.value;
|
|
263
|
+
}).onUpdate(event => {
|
|
264
|
+
'worklet';
|
|
265
|
+
|
|
266
|
+
const next = dragStartY.value + event.translationY;
|
|
267
|
+
// Clamp at the top (most-expanded) snap point with a touch of rubber-banding.
|
|
268
|
+
if (next < top) {
|
|
269
|
+
translateY.value = top + (next - top) * 0.25;
|
|
270
|
+
} else {
|
|
271
|
+
translateY.value = next;
|
|
272
|
+
}
|
|
273
|
+
}).onEnd(event => {
|
|
274
|
+
'worklet';
|
|
275
|
+
|
|
276
|
+
const releaseY = translateY.value;
|
|
277
|
+
const velocity = event.velocityY;
|
|
278
|
+
|
|
279
|
+
// Fast downward swipe → close (if allowed) or snap to smallest.
|
|
280
|
+
if (velocity > CLOSE_VELOCITY_THRESHOLD) {
|
|
281
|
+
if (canPanDownToClose) {
|
|
282
|
+
runOnJS(handleSnapEnd)(-1, closed);
|
|
283
|
+
return;
|
|
284
|
+
}
|
|
285
|
+
runOnJS(handleSnapEnd)(0, targets[0]);
|
|
286
|
+
return;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
// Find nearest snap target by distance.
|
|
290
|
+
let nearestIdx = 0;
|
|
291
|
+
let nearestDist = Math.abs(releaseY - targets[0]);
|
|
292
|
+
for (let i = 1; i < targets.length; i++) {
|
|
293
|
+
const d = Math.abs(releaseY - targets[i]);
|
|
294
|
+
if (d < nearestDist) {
|
|
295
|
+
nearestDist = d;
|
|
296
|
+
nearestIdx = i;
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
// If user dragged below smallest snap point past threshold and pan-to-close is on, dismiss.
|
|
301
|
+
const smallest = targets[0];
|
|
302
|
+
const overshoot = releaseY - smallest;
|
|
303
|
+
if (canPanDownToClose && overshoot > 80) {
|
|
304
|
+
runOnJS(handleSnapEnd)(-1, closed);
|
|
305
|
+
return;
|
|
306
|
+
}
|
|
307
|
+
runOnJS(handleSnapEnd)(nearestIdx, targets[nearestIdx]);
|
|
308
|
+
});
|
|
309
|
+
}, [closedY, dragStartY, enablePanDownToClose, handleSnapEnd, minTopY, snapTargets, translateY]);
|
|
310
|
+
|
|
311
|
+
// ───────── Keyboard tracking ─────────
|
|
312
|
+
// keyboardOffset is added to translateY in sheetStyle so we don't disturb
|
|
313
|
+
// snap-point math. iOS gets keyboardWillShow/Hide (smoother), Android only
|
|
314
|
+
// emits keyboardDidShow/Hide.
|
|
315
|
+
const keyboardOffset = useSharedValue(0);
|
|
316
|
+
useEffect(() => {
|
|
317
|
+
if (keyboardBehavior === 'none') {
|
|
318
|
+
return;
|
|
319
|
+
}
|
|
320
|
+
const showEvt = Platform.OS === 'ios' ? 'keyboardWillShow' : 'keyboardDidShow';
|
|
321
|
+
const hideEvt = Platform.OS === 'ios' ? 'keyboardWillHide' : 'keyboardDidHide';
|
|
322
|
+
const onShow = e => {
|
|
323
|
+
const h = e.endCoordinates?.height ?? 0;
|
|
324
|
+
keyboardOffset.value = withTiming(-h, {
|
|
325
|
+
duration: theme.motion.duration.normal
|
|
326
|
+
});
|
|
327
|
+
};
|
|
328
|
+
const onHide = () => {
|
|
329
|
+
keyboardOffset.value = withTiming(0, {
|
|
330
|
+
duration: theme.motion.duration.normal
|
|
331
|
+
});
|
|
332
|
+
};
|
|
333
|
+
const showSub = Keyboard.addListener(showEvt, onShow);
|
|
334
|
+
const hideSub = Keyboard.addListener(hideEvt, onHide);
|
|
335
|
+
return () => {
|
|
336
|
+
showSub.remove();
|
|
337
|
+
hideSub.remove();
|
|
338
|
+
};
|
|
339
|
+
}, [keyboardBehavior, keyboardOffset, theme.motion.duration.normal]);
|
|
340
|
+
|
|
341
|
+
// ───────── Animated styles ─────────
|
|
342
|
+
const safeAreaTop = insets.top;
|
|
343
|
+
const sheetStyle = useAnimatedStyle(() => {
|
|
344
|
+
const yWithKb = translateY.value + keyboardOffset.value;
|
|
345
|
+
// When the keyboard is up, allow the sheet to slide above its natural
|
|
346
|
+
// max-snap-point top (`minTopY`) so the input area stays visible. We still
|
|
347
|
+
// clamp to the safe-area top so the sheet doesn't disappear under the
|
|
348
|
+
// status bar / notch.
|
|
349
|
+
const lowerBound = keyboardOffset.value < 0 ? safeAreaTop : minTopY;
|
|
350
|
+
const clamped = yWithKb < lowerBound ? lowerBound : yWithKb;
|
|
351
|
+
// Animate `top` (layout prop) instead of `transform: translateY`
|
|
352
|
+
// (visual only). Layout-prop animation under Reanimated still runs on
|
|
353
|
+
// the UI thread, but crucially the sheet's *hit-test box* moves with
|
|
354
|
+
// its visual position. With translateY the layout box stayed parked
|
|
355
|
+
// at top:0..maxSnap regardless of visual offset, so:
|
|
356
|
+
// (a) the empty top half intercepted backdrop taps (worked around
|
|
357
|
+
// previously via pointerEvents="box-none"), and
|
|
358
|
+
// (b) drag gestures on the handle could be claimed by sibling
|
|
359
|
+
// gesture handlers because the actual sheet view was effectively
|
|
360
|
+
// hidden from the responder chain.
|
|
361
|
+
// Animating `top` collapses both problems into nothing — visible area
|
|
362
|
+
// == hit area — so we can drop the box-none hack too.
|
|
363
|
+
return {
|
|
364
|
+
top: clamped
|
|
365
|
+
};
|
|
366
|
+
});
|
|
367
|
+
const isExpanded = currentIndex >= 0;
|
|
368
|
+
const styles = useMemo(() => buildStyles(theme), [theme]);
|
|
369
|
+
const handleBackdropPress = useCallback(() => {
|
|
370
|
+
if (!enableBackdropPress) {
|
|
371
|
+
return;
|
|
372
|
+
}
|
|
373
|
+
triggerHaptic('selection');
|
|
374
|
+
close();
|
|
375
|
+
}, [enableBackdropPress, close]);
|
|
376
|
+
|
|
377
|
+
// RNGH Tap gesture for the backdrop. Plain RN Pressable on a sibling of a
|
|
378
|
+
// gesture-handler/reanimated sheet doesn't fire reliably on RN 0.85 / Fabric
|
|
379
|
+
// (the gesture system swallows the touch sequence). gorhom/bottom-sheet uses
|
|
380
|
+
// the same Gesture.Tap() pattern for the same reason.
|
|
381
|
+
const backdropTapGesture = useMemo(() => Gesture.Tap().maxDuration(250).onEnd((_e, success) => {
|
|
382
|
+
'worklet';
|
|
383
|
+
|
|
384
|
+
if (!success) {
|
|
385
|
+
return;
|
|
386
|
+
}
|
|
387
|
+
runOnJS(handleBackdropPress)();
|
|
388
|
+
}), [handleBackdropPress]);
|
|
389
|
+
const contextValue = useMemo(() => ({
|
|
390
|
+
snapIndex: currentIndex,
|
|
391
|
+
snapPoints: resolvedSnapPoints,
|
|
392
|
+
expand,
|
|
393
|
+
collapse,
|
|
394
|
+
close
|
|
395
|
+
}), [currentIndex, resolvedSnapPoints, expand, collapse, close]);
|
|
396
|
+
|
|
397
|
+
// Don't render the backdrop / sheet tree when the sheet is fully closed.
|
|
398
|
+
// Inline: gated by `inlineMounted` (set in expand, cleared in
|
|
399
|
+
// markAnimationDone after close animation) — keeps an idle inline sheet
|
|
400
|
+
// from sitting over the parent and swallowing touches.
|
|
401
|
+
// Modal: gated by `modalVisible` for the same reason.
|
|
402
|
+
if (mode === 'inline' && !inlineMounted) {
|
|
403
|
+
return null;
|
|
404
|
+
}
|
|
405
|
+
if (mode === 'modal' && !modalVisible) {
|
|
406
|
+
return null;
|
|
407
|
+
}
|
|
408
|
+
const sheetTree = /*#__PURE__*/_jsxs(View, {
|
|
409
|
+
collapsable: false
|
|
410
|
+
// Modal mode: the backdrop is the modal's root, so it fills via flex.
|
|
411
|
+
// Inline mode: the backdrop overlays the parent, so it positions absolute.
|
|
412
|
+
,
|
|
413
|
+
style: [mode === 'modal' ? styles.backdropModal : styles.backdropInline, {
|
|
414
|
+
backgroundColor: theme.colors.background.overlay
|
|
415
|
+
}],
|
|
416
|
+
testID: testID,
|
|
417
|
+
accessibilityViewIsModal: accessibilityViewIsModal ?? isExpanded,
|
|
418
|
+
children: [/*#__PURE__*/_jsx(GestureDetector, {
|
|
419
|
+
gesture: backdropTapGesture,
|
|
420
|
+
children: /*#__PURE__*/_jsx(Animated.View, {
|
|
421
|
+
style: StyleSheet.absoluteFill,
|
|
422
|
+
accessibilityRole: "button",
|
|
423
|
+
accessibilityLabel: "Close bottom sheet"
|
|
424
|
+
})
|
|
425
|
+
}), /*#__PURE__*/_jsx(GestureDetector, {
|
|
426
|
+
gesture: panGesture,
|
|
427
|
+
children: /*#__PURE__*/_jsxs(Animated.View, {
|
|
428
|
+
// 'dialog' is a valid platform role on web/iOS; RN's typings list it as a string union
|
|
429
|
+
// that varies by platform — cast keeps strict-mode happy.
|
|
430
|
+
accessibilityRole: "alert",
|
|
431
|
+
accessibilityLabel: accessibilityLabel,
|
|
432
|
+
accessibilityViewIsModal: accessibilityViewIsModal ?? isExpanded,
|
|
433
|
+
style: [styles.sheet, {
|
|
434
|
+
height: maxSnapPoint,
|
|
435
|
+
backgroundColor: theme.colors.background.elevated,
|
|
436
|
+
borderTopLeftRadius: theme.radius['2xl'],
|
|
437
|
+
borderTopRightRadius: theme.radius['2xl'],
|
|
438
|
+
paddingBottom: insets.bottom,
|
|
439
|
+
...theme.shadows.xl
|
|
440
|
+
}, containerStyle, sheetStyle],
|
|
441
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
442
|
+
style: styles.handleRow,
|
|
443
|
+
pointerEvents: "box-none",
|
|
444
|
+
children: /*#__PURE__*/_jsx(View, {
|
|
445
|
+
style: [styles.handle, {
|
|
446
|
+
backgroundColor: theme.components.bottomSheet?.handleColor ?? theme.colors.border.primary
|
|
447
|
+
}, handleIndicatorStyle]
|
|
448
|
+
})
|
|
449
|
+
}), header != null && /*#__PURE__*/_jsx(View, {
|
|
450
|
+
style: [styles.header, headerStyle],
|
|
451
|
+
children: header
|
|
452
|
+
}), /*#__PURE__*/_jsx(View, {
|
|
453
|
+
style: styles.content,
|
|
454
|
+
children: children
|
|
455
|
+
}), footer != null && /*#__PURE__*/_jsx(View, {
|
|
456
|
+
style: [styles.footer, footerStyle],
|
|
457
|
+
children: footer
|
|
458
|
+
})]
|
|
459
|
+
})
|
|
460
|
+
})]
|
|
461
|
+
});
|
|
462
|
+
const wrappedTree = /*#__PURE__*/_jsx(BottomSheetContext.Provider, {
|
|
463
|
+
value: contextValue,
|
|
464
|
+
children: sheetTree
|
|
465
|
+
});
|
|
466
|
+
if (mode === 'modal') {
|
|
467
|
+
return /*#__PURE__*/_jsx(Modal, {
|
|
468
|
+
transparent: true,
|
|
469
|
+
visible: modalVisible,
|
|
470
|
+
onRequestClose: close,
|
|
471
|
+
statusBarTranslucent: true,
|
|
472
|
+
navigationBarTranslucent: true,
|
|
473
|
+
animationType: "none",
|
|
474
|
+
supportedOrientations: ['portrait', 'landscape'],
|
|
475
|
+
children: Platform.OS === 'android' ? /*#__PURE__*/_jsx(GestureHandlerRootView, {
|
|
476
|
+
style: styles.modalRoot,
|
|
477
|
+
children: wrappedTree
|
|
478
|
+
}) : wrappedTree
|
|
479
|
+
});
|
|
480
|
+
}
|
|
481
|
+
return wrappedTree;
|
|
482
|
+
});
|
|
483
|
+
BottomSheet.displayName = 'BottomSheet';
|
|
484
|
+
|
|
485
|
+
// ───────── Helpers ─────────
|
|
486
|
+
|
|
487
|
+
const resolveSnapPoints = (points, screenH) => {
|
|
488
|
+
const resolved = points.map(p => {
|
|
489
|
+
if (typeof p === 'number') {
|
|
490
|
+
return p;
|
|
491
|
+
}
|
|
492
|
+
const pct = parseFloat(p);
|
|
493
|
+
if (Number.isNaN(pct)) {
|
|
494
|
+
return 0;
|
|
495
|
+
}
|
|
496
|
+
return pct / 100 * screenH;
|
|
497
|
+
});
|
|
498
|
+
return [...resolved].sort((a, b) => a - b);
|
|
499
|
+
};
|
|
500
|
+
const clamp = (value, min, max) => Math.min(Math.max(value, min), max);
|
|
501
|
+
const buildStyles = _theme => StyleSheet.create({
|
|
502
|
+
backdropModal: {
|
|
503
|
+
// The backdrop is the modal's root View. On Fabric, an absolute-
|
|
504
|
+
// positioned root inside RNModal has no positioned ancestor and
|
|
505
|
+
// collapses to zero size, taking the scrim with it. `flex: 1` fills
|
|
506
|
+
// the modal content area reliably.
|
|
507
|
+
flex: 1
|
|
508
|
+
},
|
|
509
|
+
backdropInline: {
|
|
510
|
+
// Inline mode: overlay the parent. Parent must be positioned for this
|
|
511
|
+
// to take effect (the consumer is expected to render BottomSheet inside
|
|
512
|
+
// a relatively-positioned container).
|
|
513
|
+
...StyleSheet.absoluteFill
|
|
514
|
+
},
|
|
515
|
+
sheet: {
|
|
516
|
+
position: 'absolute',
|
|
517
|
+
left: 0,
|
|
518
|
+
right: 0,
|
|
519
|
+
// `top` is driven by the animated style (see sheetStyle). Omitted
|
|
520
|
+
// here so the static `0` doesn't fight the animated value during
|
|
521
|
+
// initial paint.
|
|
522
|
+
overflow: 'hidden'
|
|
523
|
+
},
|
|
524
|
+
handleRow: {
|
|
525
|
+
alignItems: 'center',
|
|
526
|
+
justifyContent: 'center',
|
|
527
|
+
paddingTop: 10,
|
|
528
|
+
paddingBottom: 8
|
|
529
|
+
},
|
|
530
|
+
header: {
|
|
531
|
+
// No opinionated padding — slot owns its own styling. Sits between the
|
|
532
|
+
// drag handle and the scrollable content; does not flex.
|
|
533
|
+
},
|
|
534
|
+
footer: {
|
|
535
|
+
// Pinned to the bottom of the sheet (above safe-area inset, which lives
|
|
536
|
+
// on the sheet's paddingBottom). Does not flex, does not scroll with
|
|
537
|
+
// content. Rides with the keyboard via the sheet's `top` animation.
|
|
538
|
+
},
|
|
539
|
+
handle: {
|
|
540
|
+
width: 36,
|
|
541
|
+
height: 4,
|
|
542
|
+
borderRadius: 2
|
|
543
|
+
},
|
|
544
|
+
content: {
|
|
545
|
+
flex: 1
|
|
546
|
+
},
|
|
547
|
+
modalRoot: {
|
|
548
|
+
flex: 1
|
|
549
|
+
}
|
|
550
|
+
});
|
|
551
|
+
export { BottomSheet };
|
|
552
|
+
export default BottomSheet;
|
|
553
|
+
//# sourceMappingURL=BottomSheet.js.map
|