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