@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,783 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.formatFileSize = exports.default = exports.FilePicker = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _index = require("../../hooks/index.js");
|
|
10
|
+
var _index2 = require("../../theme/index.js");
|
|
11
|
+
var _index3 = require("../../utils/index.js");
|
|
12
|
+
var _OptionSheet = require("../OptionSheet/OptionSheet.js");
|
|
13
|
+
var _index4 = require("../Spinner/index.js");
|
|
14
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
16
|
+
/**
|
|
17
|
+
* FilePicker — attachment picking UI with pluggable native sources.
|
|
18
|
+
*
|
|
19
|
+
* The library owns the UI and behaviour: trigger (dashed card / list row /
|
|
20
|
+
* custom render prop), the source-chooser sheet (shared OptionSheet), enforced
|
|
21
|
+
* validation (maxFiles / maxSizeMB / accept / custom), the canonical file
|
|
22
|
+
* shape, per-file status + progress display, remove/retry affordances,
|
|
23
|
+
* a11y, haptics and theming.
|
|
24
|
+
*
|
|
25
|
+
* What it deliberately does NOT own:
|
|
26
|
+
* - Native picking. Camera / gallery / document access lives in app-level
|
|
27
|
+
* `sources` adapters (`pick(): Promise<PickedFileInput[]>`), so the
|
|
28
|
+
* library stays zero-dependency and each app wires the native modules it
|
|
29
|
+
* already ships. Throwing inside `pick` surfaces as a field error;
|
|
30
|
+
* returning `[]` is a cancel.
|
|
31
|
+
* - Networking. Uploads belong to the app's API client / outbox; the app
|
|
32
|
+
* reflects them back via per-file `status` / `progress` and gets retry
|
|
33
|
+
* taps through `onRetry`.
|
|
34
|
+
* - Heavy processing. The async `process` hook runs per accepted file
|
|
35
|
+
* (compression, EXIF strip, local copy) before it lands in `files` —
|
|
36
|
+
* plug the app's image pipeline in there.
|
|
37
|
+
*/
|
|
38
|
+
|
|
39
|
+
/** What a source's `pick()` resolves with — the library normalizes the rest. */
|
|
40
|
+
|
|
41
|
+
/** Everything a custom `renderFile` template needs to paint one file. */
|
|
42
|
+
|
|
43
|
+
let fileIdSeq = 0;
|
|
44
|
+
const nextFileId = () => `wfp-${++fileIdSeq}`;
|
|
45
|
+
const DEFAULT_LABELS = {
|
|
46
|
+
trigger: 'Attach file',
|
|
47
|
+
addMore: 'Add more',
|
|
48
|
+
sheetTitle: 'Add from',
|
|
49
|
+
removeFile: name => `Remove ${name}`,
|
|
50
|
+
retry: 'Retry upload',
|
|
51
|
+
errorTooMany: max => `You can attach up to ${max} files.`,
|
|
52
|
+
errorTooLarge: (name, maxSizeMB) => `${name} is larger than ${maxSizeMB} MB.`,
|
|
53
|
+
errorWrongType: name => `${name} is not an accepted file type.`
|
|
54
|
+
};
|
|
55
|
+
const formatFileSize = bytes => {
|
|
56
|
+
if (bytes === undefined || bytes <= 0) {
|
|
57
|
+
return '';
|
|
58
|
+
}
|
|
59
|
+
const units = ['B', 'KB', 'MB', 'GB'];
|
|
60
|
+
let value = bytes;
|
|
61
|
+
let unit = 0;
|
|
62
|
+
while (value >= 1024 && unit < units.length - 1) {
|
|
63
|
+
value /= 1024;
|
|
64
|
+
unit += 1;
|
|
65
|
+
}
|
|
66
|
+
const rounded = value >= 10 || unit === 0 ? Math.round(value) : Math.round(value * 10) / 10;
|
|
67
|
+
return `${rounded} ${units[unit]}`;
|
|
68
|
+
};
|
|
69
|
+
exports.formatFileSize = formatFileSize;
|
|
70
|
+
const matchesAccept = (type, accept) => {
|
|
71
|
+
if (!accept || accept.length === 0) {
|
|
72
|
+
return true;
|
|
73
|
+
}
|
|
74
|
+
if (!type) {
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
return accept.some(glob => {
|
|
78
|
+
if (glob === '*/*' || glob === '*') {
|
|
79
|
+
return true;
|
|
80
|
+
}
|
|
81
|
+
if (glob.endsWith('/*')) {
|
|
82
|
+
return type.startsWith(glob.slice(0, glob.length - 1));
|
|
83
|
+
}
|
|
84
|
+
return type === glob;
|
|
85
|
+
});
|
|
86
|
+
};
|
|
87
|
+
const isImage = file => file.type?.startsWith('image/') === true || !file.type && /\.(png|jpe?g|gif|webp|heic)$/i.test(file.name);
|
|
88
|
+
const imageSourceOf = file => file.thumbnailUrl ?? (isImage(file) ? file.uri ?? file.url : undefined);
|
|
89
|
+
|
|
90
|
+
/** Uppercase extension for the non-image tile, capped for layout ("PDF", "DOCX", "FILE"). */
|
|
91
|
+
const extensionOf = name => {
|
|
92
|
+
const dot = name.lastIndexOf('.');
|
|
93
|
+
if (dot <= 0 || dot === name.length - 1) {
|
|
94
|
+
return 'FILE';
|
|
95
|
+
}
|
|
96
|
+
return name.slice(dot + 1).toUpperCase().slice(0, 4);
|
|
97
|
+
};
|
|
98
|
+
const FilePicker = exports.FilePicker = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
99
|
+
const {
|
|
100
|
+
files: filesProp,
|
|
101
|
+
defaultFiles,
|
|
102
|
+
onChange,
|
|
103
|
+
sources,
|
|
104
|
+
maxFiles,
|
|
105
|
+
maxSizeMB,
|
|
106
|
+
accept,
|
|
107
|
+
validate,
|
|
108
|
+
process,
|
|
109
|
+
variant = 'card',
|
|
110
|
+
renderFile,
|
|
111
|
+
renderTrigger,
|
|
112
|
+
disabled = false,
|
|
113
|
+
helperText,
|
|
114
|
+
error: errorProp,
|
|
115
|
+
labels: labelsProp,
|
|
116
|
+
haptic,
|
|
117
|
+
onPick,
|
|
118
|
+
onRemove,
|
|
119
|
+
onError,
|
|
120
|
+
onFilePress,
|
|
121
|
+
onRetry,
|
|
122
|
+
style,
|
|
123
|
+
accessibilityLabel,
|
|
124
|
+
testID
|
|
125
|
+
} = props;
|
|
126
|
+
const theme = (0, _index2.useTheme)();
|
|
127
|
+
const styles = (0, _react.useMemo)(() => buildStyles(theme), [theme]);
|
|
128
|
+
const labels = (0, _react.useMemo)(() => ({
|
|
129
|
+
...DEFAULT_LABELS,
|
|
130
|
+
...labelsProp
|
|
131
|
+
}), [labelsProp]);
|
|
132
|
+
const tokens = theme.components.filePicker;
|
|
133
|
+
const thumbnailSize = tokens?.thumbnailSize ?? 84;
|
|
134
|
+
const borderRadius = tokens?.borderRadius ?? theme.radius.md;
|
|
135
|
+
const dashedBorderColor = tokens?.dashedBorderColor ?? theme.colors.primary;
|
|
136
|
+
const [files, setFilesState] = (0, _index.useControllableState)({
|
|
137
|
+
value: filesProp,
|
|
138
|
+
defaultValue: defaultFiles ?? [],
|
|
139
|
+
onChange
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
// Async pick/process callbacks need the latest list, not a stale closure.
|
|
143
|
+
const filesRef = (0, _react.useRef)(files);
|
|
144
|
+
filesRef.current = files;
|
|
145
|
+
const setFiles = (0, _react.useCallback)(next => {
|
|
146
|
+
filesRef.current = next;
|
|
147
|
+
setFilesState(next);
|
|
148
|
+
}, [setFilesState]);
|
|
149
|
+
const [localError, setLocalError] = (0, _react.useState)(null);
|
|
150
|
+
const [sheetOpen, setSheetOpen] = (0, _react.useState)(false);
|
|
151
|
+
const fieldError = errorProp ?? localError ?? undefined;
|
|
152
|
+
const atCapacity = typeof maxFiles === 'number' && files.length >= maxFiles;
|
|
153
|
+
const reportErrors = (0, _react.useCallback)((messages, file) => {
|
|
154
|
+
if (messages.length === 0) {
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
setLocalError(messages[0]);
|
|
158
|
+
messages.forEach(m => onError?.(m, file));
|
|
159
|
+
if (haptic !== false) {
|
|
160
|
+
(0, _index3.triggerHaptic)('notificationError');
|
|
161
|
+
}
|
|
162
|
+
}, [onError, haptic]);
|
|
163
|
+
const runSource = (0, _react.useCallback)(async source => {
|
|
164
|
+
let picked;
|
|
165
|
+
try {
|
|
166
|
+
picked = await source.pick();
|
|
167
|
+
} catch (e) {
|
|
168
|
+
reportErrors([e instanceof Error ? e.message : String(e)]);
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
if (!picked || picked.length === 0) {
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
const normalized = picked.map(p => ({
|
|
175
|
+
id: nextFileId(),
|
|
176
|
+
name: p.name ?? p.uri.split('/').pop() ?? 'file',
|
|
177
|
+
uri: p.uri,
|
|
178
|
+
type: p.type,
|
|
179
|
+
size: p.size,
|
|
180
|
+
meta: p.meta,
|
|
181
|
+
status: 'idle'
|
|
182
|
+
}));
|
|
183
|
+
const errors = [];
|
|
184
|
+
let candidates = normalized;
|
|
185
|
+
if (typeof maxFiles === 'number') {
|
|
186
|
+
const capacity = Math.max(0, maxFiles - filesRef.current.length);
|
|
187
|
+
if (candidates.length > capacity) {
|
|
188
|
+
errors.push(labels.errorTooMany(maxFiles));
|
|
189
|
+
candidates = candidates.slice(0, capacity);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
const accepted = [];
|
|
193
|
+
for (const file of candidates) {
|
|
194
|
+
// `?? 0` here used to let an unknown size through as "0 bytes"; some
|
|
195
|
+
// document providers report no size at all. Only enforce when known.
|
|
196
|
+
if (typeof maxSizeMB === 'number' && typeof file.size === 'number' && file.size > maxSizeMB * 1024 * 1024) {
|
|
197
|
+
errors.push(labels.errorTooLarge(file.name, maxSizeMB));
|
|
198
|
+
continue;
|
|
199
|
+
}
|
|
200
|
+
if (!matchesAccept(file.type, accept)) {
|
|
201
|
+
errors.push(labels.errorWrongType(file.name));
|
|
202
|
+
continue;
|
|
203
|
+
}
|
|
204
|
+
const customError = validate?.(file);
|
|
205
|
+
if (customError) {
|
|
206
|
+
errors.push(customError);
|
|
207
|
+
continue;
|
|
208
|
+
}
|
|
209
|
+
accepted.push(file);
|
|
210
|
+
}
|
|
211
|
+
reportErrors(errors);
|
|
212
|
+
if (accepted.length === 0) {
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
215
|
+
if (!process) {
|
|
216
|
+
setFiles([...filesRef.current, ...accepted]);
|
|
217
|
+
setLocalError(errors.length > 0 ? errors[0] : null);
|
|
218
|
+
const h = (0, _index3.resolveHaptic)(haptic, 'selection');
|
|
219
|
+
if (h) {
|
|
220
|
+
(0, _index3.triggerHaptic)(h);
|
|
221
|
+
}
|
|
222
|
+
onPick?.(accepted);
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
// With a process hook: land files immediately as 'processing', then
|
|
227
|
+
// swap each for its processed result (or drop it on failure).
|
|
228
|
+
const processing = accepted.map(f => ({
|
|
229
|
+
...f,
|
|
230
|
+
status: 'processing'
|
|
231
|
+
}));
|
|
232
|
+
setFiles([...filesRef.current, ...processing]);
|
|
233
|
+
const succeeded = [];
|
|
234
|
+
for (const file of processing) {
|
|
235
|
+
try {
|
|
236
|
+
const result = await process({
|
|
237
|
+
...file,
|
|
238
|
+
status: 'idle'
|
|
239
|
+
});
|
|
240
|
+
const finished = {
|
|
241
|
+
...result,
|
|
242
|
+
id: file.id,
|
|
243
|
+
status: result.status ?? 'idle'
|
|
244
|
+
};
|
|
245
|
+
setFiles(filesRef.current.map(f => f.id === file.id ? finished : f));
|
|
246
|
+
succeeded.push(finished);
|
|
247
|
+
} catch (e) {
|
|
248
|
+
setFiles(filesRef.current.filter(f => f.id !== file.id));
|
|
249
|
+
reportErrors([e instanceof Error ? e.message : String(e)], file);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
if (succeeded.length > 0) {
|
|
253
|
+
if (errors.length === 0) {
|
|
254
|
+
setLocalError(null);
|
|
255
|
+
}
|
|
256
|
+
const h = (0, _index3.resolveHaptic)(haptic, 'selection');
|
|
257
|
+
if (h) {
|
|
258
|
+
(0, _index3.triggerHaptic)(h);
|
|
259
|
+
}
|
|
260
|
+
onPick?.(succeeded);
|
|
261
|
+
}
|
|
262
|
+
}, [maxFiles, maxSizeMB, accept, validate, process, labels, reportErrors, setFiles, onPick, haptic]);
|
|
263
|
+
const open = (0, _react.useCallback)(sourceKey => {
|
|
264
|
+
if (disabled || atCapacity) {
|
|
265
|
+
return;
|
|
266
|
+
}
|
|
267
|
+
const source = sourceKey ? sources.find(s => s.key === sourceKey) : sources.length === 1 ? sources[0] : undefined;
|
|
268
|
+
if (source) {
|
|
269
|
+
void runSource(source);
|
|
270
|
+
return;
|
|
271
|
+
}
|
|
272
|
+
if (sources.length > 1) {
|
|
273
|
+
setSheetOpen(true);
|
|
274
|
+
}
|
|
275
|
+
}, [disabled, atCapacity, sources, runSource]);
|
|
276
|
+
const removeFile = (0, _react.useCallback)(file => {
|
|
277
|
+
if (disabled) {
|
|
278
|
+
return;
|
|
279
|
+
}
|
|
280
|
+
setFiles(filesRef.current.filter(f => f.id !== file.id));
|
|
281
|
+
setLocalError(null);
|
|
282
|
+
const h = (0, _index3.resolveHaptic)(haptic, 'selection');
|
|
283
|
+
if (h) {
|
|
284
|
+
(0, _index3.triggerHaptic)(h);
|
|
285
|
+
}
|
|
286
|
+
onRemove?.(file);
|
|
287
|
+
}, [disabled, setFiles, onRemove, haptic]);
|
|
288
|
+
const clear = (0, _react.useCallback)(() => {
|
|
289
|
+
setFiles([]);
|
|
290
|
+
setLocalError(null);
|
|
291
|
+
}, [setFiles]);
|
|
292
|
+
(0, _react.useImperativeHandle)(ref, () => ({
|
|
293
|
+
open,
|
|
294
|
+
clear
|
|
295
|
+
}), [open, clear]);
|
|
296
|
+
const a11ySummary = files.length === 0 ? labels.trigger : `${files.length} file${files.length === 1 ? '' : 's'} attached`;
|
|
297
|
+
const a11yLabel = accessibilityLabel ?? `Attachments. ${a11ySummary}`;
|
|
298
|
+
const statusText = file => {
|
|
299
|
+
switch (file.status) {
|
|
300
|
+
case 'processing':
|
|
301
|
+
return 'Processing…';
|
|
302
|
+
case 'uploading':
|
|
303
|
+
return `Uploading ${Math.round((file.progress ?? 0) * 100)}%`;
|
|
304
|
+
case 'done':
|
|
305
|
+
return 'Uploaded';
|
|
306
|
+
case 'error':
|
|
307
|
+
return file.error ?? 'Failed';
|
|
308
|
+
default:
|
|
309
|
+
return '';
|
|
310
|
+
}
|
|
311
|
+
};
|
|
312
|
+
const fileA11yLabel = file => [file.name, formatFileSize(file.size), statusText(file)].filter(Boolean).join(', ');
|
|
313
|
+
const attachmentIcon = theme.icons?.attachment;
|
|
314
|
+
const renderStatusOverlay = file => {
|
|
315
|
+
if (file.status === 'processing') {
|
|
316
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
317
|
+
style: [styles.tileOverlay, {
|
|
318
|
+
backgroundColor: theme.colors.background.overlay
|
|
319
|
+
}],
|
|
320
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index4.Spinner, {
|
|
321
|
+
size: "sm"
|
|
322
|
+
})
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
if (file.status === 'uploading') {
|
|
326
|
+
const pct = Math.round((file.progress ?? 0) * 100);
|
|
327
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
328
|
+
style: [styles.tileOverlay, {
|
|
329
|
+
backgroundColor: theme.colors.background.overlay
|
|
330
|
+
}],
|
|
331
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
332
|
+
style: [styles.tileOverlayText, {
|
|
333
|
+
color: theme.colors.text.inverse
|
|
334
|
+
}],
|
|
335
|
+
children: `${pct}%`
|
|
336
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
337
|
+
style: [styles.tileProgressTrack, {
|
|
338
|
+
backgroundColor: theme.colors.border.primary
|
|
339
|
+
}],
|
|
340
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
341
|
+
style: [styles.tileProgressFill, {
|
|
342
|
+
width: `${pct}%`,
|
|
343
|
+
backgroundColor: theme.colors.primary
|
|
344
|
+
}]
|
|
345
|
+
})
|
|
346
|
+
})]
|
|
347
|
+
});
|
|
348
|
+
}
|
|
349
|
+
if (file.status === 'done') {
|
|
350
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
351
|
+
style: [styles.doneBadge, {
|
|
352
|
+
backgroundColor: theme.colors.success
|
|
353
|
+
}],
|
|
354
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
355
|
+
style: [styles.doneBadgeText, {
|
|
356
|
+
color: theme.colors.text.inverse
|
|
357
|
+
}],
|
|
358
|
+
children: "\u2713"
|
|
359
|
+
})
|
|
360
|
+
});
|
|
361
|
+
}
|
|
362
|
+
return null;
|
|
363
|
+
};
|
|
364
|
+
const renderThumbnail = file => {
|
|
365
|
+
const src = imageSourceOf(file);
|
|
366
|
+
if (src) {
|
|
367
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Image, {
|
|
368
|
+
source: {
|
|
369
|
+
uri: src
|
|
370
|
+
},
|
|
371
|
+
style: styles.thumbnailImage
|
|
372
|
+
});
|
|
373
|
+
}
|
|
374
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
375
|
+
style: [styles.extensionTile, {
|
|
376
|
+
backgroundColor: theme.colors.background.secondary
|
|
377
|
+
}],
|
|
378
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
379
|
+
style: [styles.extensionText, {
|
|
380
|
+
color: theme.colors.text.secondary,
|
|
381
|
+
...(0, _index2.fontFor)(theme, 'semibold')
|
|
382
|
+
}],
|
|
383
|
+
children: extensionOf(file.name)
|
|
384
|
+
})
|
|
385
|
+
});
|
|
386
|
+
};
|
|
387
|
+
const removeButton = file => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
|
|
388
|
+
onPress: () => removeFile(file),
|
|
389
|
+
disabled: disabled,
|
|
390
|
+
hitSlop: 8,
|
|
391
|
+
accessibilityRole: "button",
|
|
392
|
+
accessibilityLabel: labels.removeFile(file.name),
|
|
393
|
+
style: [styles.removeButton, {
|
|
394
|
+
backgroundColor: theme.colors.background.overlay
|
|
395
|
+
}],
|
|
396
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
397
|
+
style: [styles.removeButtonText, {
|
|
398
|
+
color: theme.colors.text.inverse
|
|
399
|
+
}],
|
|
400
|
+
children: "\xD7"
|
|
401
|
+
})
|
|
402
|
+
});
|
|
403
|
+
const retryButton = file => onRetry && file.status === 'error' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
|
|
404
|
+
onPress: () => onRetry(file),
|
|
405
|
+
disabled: disabled,
|
|
406
|
+
hitSlop: 8,
|
|
407
|
+
accessibilityRole: "button",
|
|
408
|
+
accessibilityLabel: labels.retry,
|
|
409
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
410
|
+
style: [styles.retryText, {
|
|
411
|
+
color: theme.colors.primary
|
|
412
|
+
}],
|
|
413
|
+
children: "\u21BB"
|
|
414
|
+
})
|
|
415
|
+
}) : null;
|
|
416
|
+
const defaultCardFile = state => {
|
|
417
|
+
const {
|
|
418
|
+
file
|
|
419
|
+
} = state;
|
|
420
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
421
|
+
style: [styles.tile, {
|
|
422
|
+
width: thumbnailSize,
|
|
423
|
+
height: thumbnailSize,
|
|
424
|
+
borderRadius,
|
|
425
|
+
borderColor: file.status === 'error' ? theme.colors.error : theme.colors.border.primary
|
|
426
|
+
}],
|
|
427
|
+
children: [renderThumbnail(file), renderStatusOverlay(file), file.status === 'error' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
428
|
+
style: [styles.tileOverlay, {
|
|
429
|
+
backgroundColor: theme.colors.background.overlay
|
|
430
|
+
}],
|
|
431
|
+
children: retryButton(file)
|
|
432
|
+
}) : null, removeButton(file)]
|
|
433
|
+
});
|
|
434
|
+
};
|
|
435
|
+
const defaultListFile = state => {
|
|
436
|
+
const {
|
|
437
|
+
file
|
|
438
|
+
} = state;
|
|
439
|
+
const status = statusText(file);
|
|
440
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
441
|
+
style: [styles.listRow, {
|
|
442
|
+
borderRadius,
|
|
443
|
+
borderColor: file.status === 'error' ? theme.colors.error : theme.colors.border.primary,
|
|
444
|
+
backgroundColor: theme.colors.background.primary
|
|
445
|
+
}],
|
|
446
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
447
|
+
style: [styles.listThumb, {
|
|
448
|
+
borderRadius: theme.radius.sm
|
|
449
|
+
}],
|
|
450
|
+
children: [renderThumbnail(file), file.status === 'processing' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
451
|
+
style: [styles.tileOverlay, {
|
|
452
|
+
backgroundColor: theme.colors.background.overlay
|
|
453
|
+
}],
|
|
454
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index4.Spinner, {
|
|
455
|
+
size: "sm"
|
|
456
|
+
})
|
|
457
|
+
}) : null]
|
|
458
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
459
|
+
style: styles.listTextWrap,
|
|
460
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
461
|
+
numberOfLines: 1,
|
|
462
|
+
ellipsizeMode: "middle",
|
|
463
|
+
style: [styles.listName, {
|
|
464
|
+
color: theme.colors.text.primary,
|
|
465
|
+
fontSize: theme.typography.fontSize.sm,
|
|
466
|
+
...(0, _index2.fontFor)(theme, 'medium')
|
|
467
|
+
}],
|
|
468
|
+
children: file.name
|
|
469
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
470
|
+
numberOfLines: 1,
|
|
471
|
+
style: [styles.listSubtitle, {
|
|
472
|
+
color: file.status === 'error' ? theme.colors.error : theme.colors.text.tertiary,
|
|
473
|
+
fontSize: theme.typography.fontSize.xs
|
|
474
|
+
}],
|
|
475
|
+
children: [formatFileSize(file.size), status].filter(Boolean).join(' · ')
|
|
476
|
+
}), file.status === 'uploading' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
477
|
+
style: [styles.listProgressTrack, {
|
|
478
|
+
backgroundColor: theme.colors.border.primary
|
|
479
|
+
}],
|
|
480
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
481
|
+
style: [styles.listProgressFill, {
|
|
482
|
+
width: `${Math.round((file.progress ?? 0) * 100)}%`,
|
|
483
|
+
backgroundColor: theme.colors.primary
|
|
484
|
+
}]
|
|
485
|
+
})
|
|
486
|
+
}) : null]
|
|
487
|
+
}), retryButton(file), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
|
|
488
|
+
onPress: () => removeFile(file),
|
|
489
|
+
disabled: disabled,
|
|
490
|
+
hitSlop: 8,
|
|
491
|
+
accessibilityRole: "button",
|
|
492
|
+
accessibilityLabel: labels.removeFile(file.name),
|
|
493
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
494
|
+
style: [styles.listRemoveText, {
|
|
495
|
+
color: theme.colors.text.tertiary
|
|
496
|
+
}],
|
|
497
|
+
children: "\xD7"
|
|
498
|
+
})
|
|
499
|
+
})]
|
|
500
|
+
});
|
|
501
|
+
};
|
|
502
|
+
const renderOneFile = (file, index) => {
|
|
503
|
+
const state = {
|
|
504
|
+
file,
|
|
505
|
+
index,
|
|
506
|
+
disabled,
|
|
507
|
+
remove: () => removeFile(file),
|
|
508
|
+
retry: onRetry ? () => onRetry(file) : undefined
|
|
509
|
+
};
|
|
510
|
+
const content = renderFile ? renderFile(state) : variant === 'card' ? defaultCardFile(state) : defaultListFile(state);
|
|
511
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
|
|
512
|
+
onPress: onFilePress ? () => onFilePress(file) : undefined,
|
|
513
|
+
disabled: disabled || !onFilePress,
|
|
514
|
+
accessibilityLabel: fileA11yLabel(file),
|
|
515
|
+
children: content
|
|
516
|
+
}, file.id);
|
|
517
|
+
};
|
|
518
|
+
const triggerState = {
|
|
519
|
+
open,
|
|
520
|
+
disabled: disabled || atCapacity,
|
|
521
|
+
fileCount: files.length,
|
|
522
|
+
atCapacity
|
|
523
|
+
};
|
|
524
|
+
const dashedTrigger = compact => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Pressable, {
|
|
525
|
+
onPress: () => open(),
|
|
526
|
+
disabled: disabled || atCapacity,
|
|
527
|
+
accessibilityRole: "button",
|
|
528
|
+
accessibilityLabel: a11yLabel,
|
|
529
|
+
accessibilityState: {
|
|
530
|
+
disabled: disabled || atCapacity
|
|
531
|
+
},
|
|
532
|
+
style: ({
|
|
533
|
+
pressed
|
|
534
|
+
}) => [styles.trigger, compact ? styles.triggerCompact : null, {
|
|
535
|
+
borderRadius,
|
|
536
|
+
borderColor: dashedBorderColor,
|
|
537
|
+
backgroundColor: pressed ? theme.colors.surface.pressed : theme.colors.background.primary,
|
|
538
|
+
opacity: disabled || atCapacity ? 0.55 : 1
|
|
539
|
+
}],
|
|
540
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
541
|
+
style: styles.triggerRow,
|
|
542
|
+
children: [attachmentIcon ? attachmentIcon({
|
|
543
|
+
size: 16,
|
|
544
|
+
color: theme.colors.primary
|
|
545
|
+
}) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
546
|
+
style: [styles.triggerText, {
|
|
547
|
+
color: theme.colors.primary,
|
|
548
|
+
fontSize: theme.typography.fontSize.sm,
|
|
549
|
+
...(0, _index2.fontFor)(theme, 'medium')
|
|
550
|
+
}],
|
|
551
|
+
children: files.length === 0 ? labels.trigger : labels.addMore
|
|
552
|
+
})]
|
|
553
|
+
}), !compact && helperText ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
554
|
+
style: [styles.helperText, {
|
|
555
|
+
color: theme.colors.text.tertiary,
|
|
556
|
+
fontSize: theme.typography.fontSize.xs
|
|
557
|
+
}],
|
|
558
|
+
children: helperText
|
|
559
|
+
}) : null]
|
|
560
|
+
});
|
|
561
|
+
const addMoreTile = /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
|
|
562
|
+
onPress: () => open(),
|
|
563
|
+
disabled: disabled || atCapacity,
|
|
564
|
+
accessibilityRole: "button",
|
|
565
|
+
accessibilityLabel: labels.addMore,
|
|
566
|
+
style: ({
|
|
567
|
+
pressed
|
|
568
|
+
}) => [styles.tile, styles.addTile, {
|
|
569
|
+
width: thumbnailSize,
|
|
570
|
+
height: thumbnailSize,
|
|
571
|
+
borderRadius,
|
|
572
|
+
borderColor: dashedBorderColor,
|
|
573
|
+
backgroundColor: pressed ? theme.colors.surface.pressed : 'transparent',
|
|
574
|
+
opacity: disabled || atCapacity ? 0.55 : 1
|
|
575
|
+
}],
|
|
576
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
577
|
+
style: [styles.addTileText, {
|
|
578
|
+
color: theme.colors.primary
|
|
579
|
+
}],
|
|
580
|
+
children: "+"
|
|
581
|
+
})
|
|
582
|
+
});
|
|
583
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
584
|
+
style: [styles.container, style],
|
|
585
|
+
testID: testID,
|
|
586
|
+
accessibilityLabel: a11yLabel,
|
|
587
|
+
children: [variant === 'card' ? files.length === 0 ? renderTrigger ? renderTrigger(triggerState) : dashedTrigger(false) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.ScrollView, {
|
|
588
|
+
horizontal: true,
|
|
589
|
+
showsHorizontalScrollIndicator: false,
|
|
590
|
+
contentContainerStyle: [styles.strip, {
|
|
591
|
+
columnGap: theme.spacing.sm
|
|
592
|
+
}],
|
|
593
|
+
children: [files.map(renderOneFile), renderTrigger ? renderTrigger(triggerState) : !atCapacity && !disabled ? addMoreTile : null]
|
|
594
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
595
|
+
style: {
|
|
596
|
+
rowGap: theme.spacing.sm
|
|
597
|
+
},
|
|
598
|
+
children: [renderTrigger ? renderTrigger(triggerState) : !atCapacity ? dashedTrigger(files.length > 0) : null, files.map(renderOneFile)]
|
|
599
|
+
}), fieldError ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
600
|
+
accessibilityLiveRegion: "polite",
|
|
601
|
+
style: [styles.errorText, {
|
|
602
|
+
color: theme.colors.error,
|
|
603
|
+
fontSize: theme.typography.fontSize.xs,
|
|
604
|
+
marginTop: theme.spacing.xxs
|
|
605
|
+
}],
|
|
606
|
+
children: fieldError
|
|
607
|
+
}) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_OptionSheet.OptionSheet, {
|
|
608
|
+
open: sheetOpen,
|
|
609
|
+
onClose: () => setSheetOpen(false),
|
|
610
|
+
title: labels.sheetTitle,
|
|
611
|
+
options: sources,
|
|
612
|
+
labelOf: s => s.label,
|
|
613
|
+
valueOf: s => s.key,
|
|
614
|
+
disabledOf: () => false,
|
|
615
|
+
descriptionOf: s => s.description,
|
|
616
|
+
iconOf: s => s.icon,
|
|
617
|
+
isSelected: () => false,
|
|
618
|
+
onSelect: s => {
|
|
619
|
+
setSheetOpen(false);
|
|
620
|
+
void runSource(s);
|
|
621
|
+
}
|
|
622
|
+
})]
|
|
623
|
+
});
|
|
624
|
+
});
|
|
625
|
+
FilePicker.displayName = 'FilePicker';
|
|
626
|
+
const buildStyles = _theme => _reactNative.StyleSheet.create({
|
|
627
|
+
container: {
|
|
628
|
+
width: '100%'
|
|
629
|
+
},
|
|
630
|
+
trigger: {
|
|
631
|
+
borderWidth: 1,
|
|
632
|
+
borderStyle: 'dashed',
|
|
633
|
+
alignItems: 'center',
|
|
634
|
+
paddingVertical: 14,
|
|
635
|
+
paddingHorizontal: 16
|
|
636
|
+
},
|
|
637
|
+
triggerCompact: {
|
|
638
|
+
paddingVertical: 10
|
|
639
|
+
},
|
|
640
|
+
triggerRow: {
|
|
641
|
+
flexDirection: 'row',
|
|
642
|
+
alignItems: 'center',
|
|
643
|
+
columnGap: 8
|
|
644
|
+
},
|
|
645
|
+
triggerText: {
|
|
646
|
+
includeFontPadding: false
|
|
647
|
+
},
|
|
648
|
+
helperText: {
|
|
649
|
+
includeFontPadding: false,
|
|
650
|
+
marginTop: 6,
|
|
651
|
+
textAlign: 'center'
|
|
652
|
+
},
|
|
653
|
+
strip: {
|
|
654
|
+
paddingVertical: 2
|
|
655
|
+
},
|
|
656
|
+
tile: {
|
|
657
|
+
borderWidth: 1,
|
|
658
|
+
overflow: 'hidden'
|
|
659
|
+
},
|
|
660
|
+
addTile: {
|
|
661
|
+
borderStyle: 'dashed',
|
|
662
|
+
alignItems: 'center',
|
|
663
|
+
justifyContent: 'center'
|
|
664
|
+
},
|
|
665
|
+
addTileText: {
|
|
666
|
+
fontSize: 28,
|
|
667
|
+
includeFontPadding: false
|
|
668
|
+
},
|
|
669
|
+
thumbnailImage: {
|
|
670
|
+
width: '100%',
|
|
671
|
+
height: '100%',
|
|
672
|
+
resizeMode: 'cover'
|
|
673
|
+
},
|
|
674
|
+
extensionTile: {
|
|
675
|
+
width: '100%',
|
|
676
|
+
height: '100%',
|
|
677
|
+
alignItems: 'center',
|
|
678
|
+
justifyContent: 'center'
|
|
679
|
+
},
|
|
680
|
+
extensionText: {
|
|
681
|
+
fontSize: 12,
|
|
682
|
+
letterSpacing: 1,
|
|
683
|
+
includeFontPadding: false
|
|
684
|
+
},
|
|
685
|
+
tileOverlay: {
|
|
686
|
+
..._reactNative.StyleSheet.absoluteFill,
|
|
687
|
+
alignItems: 'center',
|
|
688
|
+
justifyContent: 'center'
|
|
689
|
+
},
|
|
690
|
+
tileOverlayText: {
|
|
691
|
+
fontSize: 12,
|
|
692
|
+
includeFontPadding: false,
|
|
693
|
+
marginBottom: 6
|
|
694
|
+
},
|
|
695
|
+
tileProgressTrack: {
|
|
696
|
+
position: 'absolute',
|
|
697
|
+
left: 8,
|
|
698
|
+
right: 8,
|
|
699
|
+
bottom: 8,
|
|
700
|
+
height: 3,
|
|
701
|
+
borderRadius: 2,
|
|
702
|
+
overflow: 'hidden'
|
|
703
|
+
},
|
|
704
|
+
tileProgressFill: {
|
|
705
|
+
height: '100%',
|
|
706
|
+
borderRadius: 2
|
|
707
|
+
},
|
|
708
|
+
doneBadge: {
|
|
709
|
+
position: 'absolute',
|
|
710
|
+
right: 4,
|
|
711
|
+
bottom: 4,
|
|
712
|
+
width: 18,
|
|
713
|
+
height: 18,
|
|
714
|
+
borderRadius: 9,
|
|
715
|
+
alignItems: 'center',
|
|
716
|
+
justifyContent: 'center'
|
|
717
|
+
},
|
|
718
|
+
doneBadgeText: {
|
|
719
|
+
fontSize: 11,
|
|
720
|
+
includeFontPadding: false
|
|
721
|
+
},
|
|
722
|
+
removeButton: {
|
|
723
|
+
position: 'absolute',
|
|
724
|
+
top: 4,
|
|
725
|
+
right: 4,
|
|
726
|
+
width: 20,
|
|
727
|
+
height: 20,
|
|
728
|
+
borderRadius: 10,
|
|
729
|
+
alignItems: 'center',
|
|
730
|
+
justifyContent: 'center'
|
|
731
|
+
},
|
|
732
|
+
removeButtonText: {
|
|
733
|
+
fontSize: 13,
|
|
734
|
+
lineHeight: 15,
|
|
735
|
+
includeFontPadding: false
|
|
736
|
+
},
|
|
737
|
+
retryText: {
|
|
738
|
+
fontSize: 20,
|
|
739
|
+
includeFontPadding: false
|
|
740
|
+
},
|
|
741
|
+
listRow: {
|
|
742
|
+
flexDirection: 'row',
|
|
743
|
+
alignItems: 'center',
|
|
744
|
+
borderWidth: 1,
|
|
745
|
+
padding: 10,
|
|
746
|
+
columnGap: 10
|
|
747
|
+
},
|
|
748
|
+
listThumb: {
|
|
749
|
+
width: 40,
|
|
750
|
+
height: 40,
|
|
751
|
+
overflow: 'hidden'
|
|
752
|
+
},
|
|
753
|
+
listTextWrap: {
|
|
754
|
+
flex: 1
|
|
755
|
+
},
|
|
756
|
+
listName: {
|
|
757
|
+
includeFontPadding: false
|
|
758
|
+
},
|
|
759
|
+
listSubtitle: {
|
|
760
|
+
includeFontPadding: false,
|
|
761
|
+
marginTop: 2
|
|
762
|
+
},
|
|
763
|
+
listProgressTrack: {
|
|
764
|
+
height: 3,
|
|
765
|
+
borderRadius: 2,
|
|
766
|
+
overflow: 'hidden',
|
|
767
|
+
marginTop: 6
|
|
768
|
+
},
|
|
769
|
+
listProgressFill: {
|
|
770
|
+
height: '100%',
|
|
771
|
+
borderRadius: 2
|
|
772
|
+
},
|
|
773
|
+
listRemoveText: {
|
|
774
|
+
fontSize: 22,
|
|
775
|
+
includeFontPadding: false,
|
|
776
|
+
paddingHorizontal: 4
|
|
777
|
+
},
|
|
778
|
+
errorText: {
|
|
779
|
+
includeFontPadding: false
|
|
780
|
+
}
|
|
781
|
+
});
|
|
782
|
+
var _default = exports.default = FilePicker;
|
|
783
|
+
//# sourceMappingURL=FilePicker.js.map
|