@webority/mobile-ui 0.0.38 → 0.1.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/README.md +1 -1
- 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 -246
- 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 -232
- 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 +0 -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 +15 -3
- 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 +6 -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 +15 -3
- 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 +6 -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 +15 -5
|
@@ -1,805 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { forwardRef, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
4
|
-
import { Platform, Pressable, StyleSheet, Text, View } from 'react-native';
|
|
5
|
-
import { Gesture, GestureDetector } from 'react-native-gesture-handler';
|
|
6
|
-
import Animated, { cancelAnimation, Easing, runOnJS, useAnimatedStyle, useSharedValue, withSpring, withTiming } from 'react-native-reanimated';
|
|
7
|
-
import { useControllableState } from "../../hooks/index.js";
|
|
8
|
-
import { useTheme } from "../../theme/index.js";
|
|
9
|
-
import { resolveHaptic, triggerHaptic } from "../../utils/index.js";
|
|
10
|
-
import { smoothCorners } from "../../utils/corners.js";
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Visual style of the slider.
|
|
14
|
-
*
|
|
15
|
-
* - `default`: a thin track under a white thumb ringed in the tone colour.
|
|
16
|
-
* - `inset`: a thick track; the thumb is a small white ring with a tone-coloured
|
|
17
|
-
* centre that rides INSIDE the fill, so the fill always extends past it.
|
|
18
|
-
* - `minimal`: a hairline track and a small solid thumb in the tone colour.
|
|
19
|
-
* - `bar`: a thick bar with no visible thumb (like a volume or brightness
|
|
20
|
-
* control); drag anywhere on the fill's end, or tap the bar to jump.
|
|
21
|
-
*/
|
|
22
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
23
|
-
const SIZE_MAP = {
|
|
24
|
-
sm: {
|
|
25
|
-
trackHeight: 4,
|
|
26
|
-
thumbDiameter: 24
|
|
27
|
-
},
|
|
28
|
-
md: {
|
|
29
|
-
trackHeight: 6,
|
|
30
|
-
thumbDiameter: 28
|
|
31
|
-
},
|
|
32
|
-
lg: {
|
|
33
|
-
trackHeight: 8,
|
|
34
|
-
thumbDiameter: 32
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
/** Geometry of the non-default variants, per size. */
|
|
39
|
-
const VARIANT_SIZE_MAP = {
|
|
40
|
-
// The thumb is about two thirds of the track, as in the design.
|
|
41
|
-
inset: {
|
|
42
|
-
sm: {
|
|
43
|
-
trackHeight: 14,
|
|
44
|
-
thumbDiameter: 10
|
|
45
|
-
},
|
|
46
|
-
md: {
|
|
47
|
-
trackHeight: 20,
|
|
48
|
-
thumbDiameter: 14
|
|
49
|
-
},
|
|
50
|
-
lg: {
|
|
51
|
-
trackHeight: 26,
|
|
52
|
-
thumbDiameter: 18
|
|
53
|
-
}
|
|
54
|
-
},
|
|
55
|
-
minimal: {
|
|
56
|
-
sm: {
|
|
57
|
-
trackHeight: 2,
|
|
58
|
-
thumbDiameter: 14
|
|
59
|
-
},
|
|
60
|
-
md: {
|
|
61
|
-
trackHeight: 3,
|
|
62
|
-
thumbDiameter: 18
|
|
63
|
-
},
|
|
64
|
-
lg: {
|
|
65
|
-
trackHeight: 4,
|
|
66
|
-
thumbDiameter: 22
|
|
67
|
-
}
|
|
68
|
-
},
|
|
69
|
-
// The invisible thumb is as tall as the bar, so the drag target spans it.
|
|
70
|
-
bar: {
|
|
71
|
-
sm: {
|
|
72
|
-
trackHeight: 20,
|
|
73
|
-
thumbDiameter: 20
|
|
74
|
-
},
|
|
75
|
-
md: {
|
|
76
|
-
trackHeight: 28,
|
|
77
|
-
thumbDiameter: 28
|
|
78
|
-
},
|
|
79
|
-
lg: {
|
|
80
|
-
trackHeight: 36,
|
|
81
|
-
thumbDiameter: 36
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
/** Share of the `inset` thumb taken by its white ring (each side). */
|
|
87
|
-
const INSET_RING_RATIO = 0.3;
|
|
88
|
-
/** Minimum drag target around a thumb smaller than this, per side. */
|
|
89
|
-
const MIN_THUMB_TOUCH = 44;
|
|
90
|
-
const TONE_TO_COLOR_KEY = {
|
|
91
|
-
primary: 'primary',
|
|
92
|
-
success: 'success',
|
|
93
|
-
warning: 'warning',
|
|
94
|
-
error: 'error'
|
|
95
|
-
};
|
|
96
|
-
const clamp = (value, min, max) => Math.min(Math.max(value, min), max);
|
|
97
|
-
const snapToStep = (value, min, max, step) => {
|
|
98
|
-
if (step <= 0) {
|
|
99
|
-
return clamp(value, min, max);
|
|
100
|
-
}
|
|
101
|
-
const stepped = Math.round((value - min) / step) * step + min;
|
|
102
|
-
const decimals = String(step).split('.')[1]?.length ?? 0;
|
|
103
|
-
const fixed = decimals > 0 ? Number(stepped.toFixed(decimals)) : stepped;
|
|
104
|
-
return clamp(fixed, min, max);
|
|
105
|
-
};
|
|
106
|
-
|
|
107
|
-
/** Air between the thumb's top and the bubble's caret tip. */
|
|
108
|
-
const BUBBLE_GAP = 2;
|
|
109
|
-
/** Side of the square that, rotated, draws the bubble's caret. */
|
|
110
|
-
const BUBBLE_CARET = 8;
|
|
111
|
-
/**
|
|
112
|
-
* The bubble's column is a fixed width centred on the thumb. Left to size
|
|
113
|
-
* itself, an absolute child of the thumb measures against the thumb's own
|
|
114
|
-
* width and wraps "70%" onto two lines.
|
|
115
|
-
*/
|
|
116
|
-
const BUBBLE_WRAP_WIDTH = 160;
|
|
117
|
-
const NO_SHADOW = {
|
|
118
|
-
shadowOpacity: 0,
|
|
119
|
-
elevation: 0
|
|
120
|
-
};
|
|
121
|
-
const defaultFormatLabel = value => String(value);
|
|
122
|
-
const Slider = /*#__PURE__*/forwardRef((props, ref) => {
|
|
123
|
-
const {
|
|
124
|
-
min = 0,
|
|
125
|
-
max = 100,
|
|
126
|
-
step = 1,
|
|
127
|
-
disabled = false,
|
|
128
|
-
tone = 'primary',
|
|
129
|
-
size = 'md',
|
|
130
|
-
variant = 'default',
|
|
131
|
-
showLabel = false,
|
|
132
|
-
snapThumb = false,
|
|
133
|
-
formatLabel = defaultFormatLabel,
|
|
134
|
-
renderLabel,
|
|
135
|
-
accessibilityLabel,
|
|
136
|
-
haptic,
|
|
137
|
-
style,
|
|
138
|
-
containerStyle,
|
|
139
|
-
trackStyle,
|
|
140
|
-
fillStyle,
|
|
141
|
-
thumbStyle,
|
|
142
|
-
labelStyle,
|
|
143
|
-
thumbPressScale,
|
|
144
|
-
labelShowDuration,
|
|
145
|
-
labelOpacity: labelOpacityProp,
|
|
146
|
-
testID
|
|
147
|
-
} = props;
|
|
148
|
-
const theme = useTheme();
|
|
149
|
-
const sliderTheme = theme.components.slider;
|
|
150
|
-
const sliderSizeTheme = sliderTheme?.[size];
|
|
151
|
-
const sizeCfg = useMemo(() => variant === 'default' ? {
|
|
152
|
-
trackHeight: sliderSizeTheme?.trackHeight ?? SIZE_MAP[size].trackHeight,
|
|
153
|
-
thumbDiameter: sliderSizeTheme?.thumbDiameter ?? SIZE_MAP[size].thumbDiameter
|
|
154
|
-
} : VARIANT_SIZE_MAP[variant][size], [sliderSizeTheme, size, variant]);
|
|
155
|
-
// `inset` keeps the thumb inside the fill's rounded end: the thumb's centre
|
|
156
|
-
// travels between half a track-height from each edge, not edge to edge, and
|
|
157
|
-
// the fill runs that same half-height past it.
|
|
158
|
-
const endInset = variant === 'inset' ? sizeCfg.trackHeight / 2 : 0;
|
|
159
|
-
const thumbPressAnimationEnabled = sliderTheme?.thumbPressAnimation ?? false;
|
|
160
|
-
const resolvedPressScale = thumbPressScale ?? sliderTheme?.thumbPressScale ?? 1.1;
|
|
161
|
-
const resolvedLabelDuration = labelShowDuration ?? sliderTheme?.labelShowDuration ?? theme.motion.duration.fast;
|
|
162
|
-
const resolvedLabelOpacity = labelOpacityProp ?? sliderTheme?.labelOpacity ?? 1;
|
|
163
|
-
const styles = useMemo(() => buildStyles(theme, sizeCfg), [theme, sizeCfg]);
|
|
164
|
-
const springCfg = useMemo(() => ({
|
|
165
|
-
damping: theme.motion.spring.snappy.damping,
|
|
166
|
-
stiffness: theme.motion.spring.snappy.stiffness,
|
|
167
|
-
mass: theme.motion.spring.snappy.mass
|
|
168
|
-
}), [theme.motion.spring.snappy]);
|
|
169
|
-
const [trackWidth, setTrackWidth] = useState(0);
|
|
170
|
-
const fillColor = theme.colors[TONE_TO_COLOR_KEY[tone]];
|
|
171
|
-
const isRange = props.range === true;
|
|
172
|
-
const [currentValue, setCurrentValue] = useControllableState({
|
|
173
|
-
value: props.value,
|
|
174
|
-
defaultValue: props.defaultValue ?? (isRange ? [min, max] : min),
|
|
175
|
-
onChange: props.onChange
|
|
176
|
-
});
|
|
177
|
-
|
|
178
|
-
// ───────── Shared values (UI thread) ─────────
|
|
179
|
-
// lowX/highX: thumb px positions. lowVal/highVal: their snapped numeric values
|
|
180
|
-
// (mirrored on the UI thread so worklets can clamp the range + detect changes).
|
|
181
|
-
const lowX = useSharedValue(0);
|
|
182
|
-
const highX = useSharedValue(0);
|
|
183
|
-
const lowVal = useSharedValue(isRange ? currentValue[0] : currentValue);
|
|
184
|
-
const highVal = useSharedValue(isRange ? currentValue[1] : currentValue);
|
|
185
|
-
const dragStartX = useSharedValue(0);
|
|
186
|
-
const trackW = useSharedValue(0);
|
|
187
|
-
const lowScale = useSharedValue(1);
|
|
188
|
-
const highScale = useSharedValue(1);
|
|
189
|
-
// A bubble that is always up starts visible and never fades.
|
|
190
|
-
const labelAlwaysOn = showLabel === 'always';
|
|
191
|
-
const lowLabelOpacity = useSharedValue(labelAlwaysOn ? 1 : 0);
|
|
192
|
-
const highLabelOpacity = useSharedValue(labelAlwaysOn ? 1 : 0);
|
|
193
|
-
|
|
194
|
-
// Float-drift guard precision for step snapping (e.g. step 0.1 -> precision 10).
|
|
195
|
-
const precision = useMemo(() => {
|
|
196
|
-
const decimals = String(step).split('.')[1]?.length ?? 0;
|
|
197
|
-
return Math.pow(10, decimals);
|
|
198
|
-
}, [step]);
|
|
199
|
-
useEffect(() => {
|
|
200
|
-
return () => {
|
|
201
|
-
cancelAnimation(lowX);
|
|
202
|
-
cancelAnimation(highX);
|
|
203
|
-
cancelAnimation(lowScale);
|
|
204
|
-
cancelAnimation(highScale);
|
|
205
|
-
cancelAnimation(lowLabelOpacity);
|
|
206
|
-
cancelAnimation(highLabelOpacity);
|
|
207
|
-
};
|
|
208
|
-
}, [lowX, highX, lowScale, highScale, lowLabelOpacity, highLabelOpacity]);
|
|
209
|
-
const valueToPx = useCallback((value, width) => {
|
|
210
|
-
const travel = width - endInset * 2;
|
|
211
|
-
if (max === min || travel <= 0) {
|
|
212
|
-
return endInset;
|
|
213
|
-
}
|
|
214
|
-
return endInset + (value - min) / (max - min) * travel;
|
|
215
|
-
}, [min, max, endInset]);
|
|
216
|
-
const pxToValue = useCallback((px, width) => {
|
|
217
|
-
const travel = width - endInset * 2;
|
|
218
|
-
if (travel <= 0) {
|
|
219
|
-
return min;
|
|
220
|
-
}
|
|
221
|
-
const ratio = clamp((px - endInset) / travel, 0, 1);
|
|
222
|
-
return snapToStep(min + ratio * (max - min), min, max, step);
|
|
223
|
-
}, [min, max, step, endInset]);
|
|
224
|
-
|
|
225
|
-
// Sync external value -> shared values (controlled updates, value prop changes).
|
|
226
|
-
//
|
|
227
|
-
// Never while a thumb is being dragged. The pan puts the thumb where the
|
|
228
|
-
// finger is on the UI thread; every committed step then comes back through
|
|
229
|
-
// React, and by the time this effect ran for step N the finger was already
|
|
230
|
-
// at N+2. Writing N's position here yanked the thumb back a frame on every
|
|
231
|
-
// step, which read as a stutter on Android, where the JS thread lags more.
|
|
232
|
-
// The drag's own end runs one sync instead (see `setDragging`), so a parent
|
|
233
|
-
// that rewrites the value it was given still wins once the finger lifts.
|
|
234
|
-
const dragging = useRef(false);
|
|
235
|
-
const settleDuration = theme.motion.duration.fast;
|
|
236
|
-
const currentValueRef = useRef(currentValue);
|
|
237
|
-
currentValueRef.current = currentValue;
|
|
238
|
-
const trackWidthRef = useRef(trackWidth);
|
|
239
|
-
trackWidthRef.current = trackWidth;
|
|
240
|
-
// `settle` eases the thumbs into place instead of placing them: a thumb
|
|
241
|
-
// that followed the finger between steps glides onto its step when let go.
|
|
242
|
-
const syncFromValue = useCallback((settle = false) => {
|
|
243
|
-
const width = trackWidthRef.current;
|
|
244
|
-
if (width <= 0) {
|
|
245
|
-
return;
|
|
246
|
-
}
|
|
247
|
-
const place = px => settle ? withTiming(px, {
|
|
248
|
-
duration: settleDuration,
|
|
249
|
-
easing: Easing.out(Easing.cubic)
|
|
250
|
-
}) : px;
|
|
251
|
-
const value = currentValueRef.current;
|
|
252
|
-
if (isRange) {
|
|
253
|
-
const [v0, v1] = value;
|
|
254
|
-
const lo = Math.min(v0, v1);
|
|
255
|
-
const hi = Math.max(v0, v1);
|
|
256
|
-
lowVal.value = lo;
|
|
257
|
-
highVal.value = hi;
|
|
258
|
-
lowX.value = place(valueToPx(lo, width));
|
|
259
|
-
highX.value = place(valueToPx(hi, width));
|
|
260
|
-
} else {
|
|
261
|
-
const v = value;
|
|
262
|
-
lowVal.value = v;
|
|
263
|
-
highVal.value = v;
|
|
264
|
-
lowX.value = place(valueToPx(v, width));
|
|
265
|
-
}
|
|
266
|
-
}, [isRange, valueToPx, lowVal, highVal, lowX, highX, settleDuration]);
|
|
267
|
-
// A drag's end asks for one sync through a render, never straight from a
|
|
268
|
-
// ref: the last committed step is still a pending state update when the
|
|
269
|
-
// lift's callback runs, so a ref read here would put the thumb back where
|
|
270
|
-
// the finger started. The render that follows sees the settled value.
|
|
271
|
-
const [dragEnd, setDragEnd] = useState(0);
|
|
272
|
-
const settleOnNextSync = useRef(false);
|
|
273
|
-
const setDragging = useCallback(next => {
|
|
274
|
-
dragging.current = next;
|
|
275
|
-
if (!next) {
|
|
276
|
-
settleOnNextSync.current = true;
|
|
277
|
-
setDragEnd(n => n + 1);
|
|
278
|
-
}
|
|
279
|
-
}, []);
|
|
280
|
-
|
|
281
|
-
// biome-ignore lint/correctness/useExhaustiveDependencies: `JSON.stringify(currentValue)` is the dependency by design (value equality for the tuple); adding `currentValue` itself would re-run on every new array identity and defeat it
|
|
282
|
-
useEffect(() => {
|
|
283
|
-
if (dragging.current) {
|
|
284
|
-
return;
|
|
285
|
-
}
|
|
286
|
-
const settle = settleOnNextSync.current;
|
|
287
|
-
settleOnNextSync.current = false;
|
|
288
|
-
syncFromValue(settle);
|
|
289
|
-
}, [JSON.stringify(currentValue), trackWidth, dragEnd, syncFromValue]);
|
|
290
|
-
const onTrackLayout = useCallback(e => {
|
|
291
|
-
const w = e.nativeEvent.layout.width;
|
|
292
|
-
trackW.value = w;
|
|
293
|
-
setTrackWidth(w);
|
|
294
|
-
}, [trackW]);
|
|
295
|
-
const fireChange = useCallback((lo, hi) => {
|
|
296
|
-
setCurrentValue(isRange ? [lo, hi] : lo);
|
|
297
|
-
}, [isRange, setCurrentValue]);
|
|
298
|
-
const fireHaptic = useCallback(() => {
|
|
299
|
-
const h = resolveHaptic(haptic, 'selection');
|
|
300
|
-
if (h) {
|
|
301
|
-
triggerHaptic(h);
|
|
302
|
-
}
|
|
303
|
-
}, [haptic]);
|
|
304
|
-
|
|
305
|
-
// The worklets call these through refs so the gesture is built once: a
|
|
306
|
-
// consumer's inline `onChange` gives `fireChange` a new identity on every
|
|
307
|
-
// render, and every render during a drag would otherwise hand the
|
|
308
|
-
// GestureDetector a new gesture mid-gesture.
|
|
309
|
-
const fireChangeRef = useRef(fireChange);
|
|
310
|
-
fireChangeRef.current = fireChange;
|
|
311
|
-
const fireHapticRef = useRef(fireHaptic);
|
|
312
|
-
fireHapticRef.current = fireHaptic;
|
|
313
|
-
const emitChange = useCallback((lo, hi) => fireChangeRef.current(lo, hi), []);
|
|
314
|
-
const emitHaptic = useCallback(() => fireHapticRef.current(), []);
|
|
315
|
-
|
|
316
|
-
// A thumb smaller than the minimum touch size still drags from a 44dp area.
|
|
317
|
-
const thumbSlop = Math.max(0, (MIN_THUMB_TOUCH - sizeCfg.thumbDiameter) / 2);
|
|
318
|
-
const thumbHitSlop = thumbSlop > 0 ? thumbSlop : undefined;
|
|
319
|
-
|
|
320
|
-
// ───────── Pan gesture per thumb (UI thread) ─────────
|
|
321
|
-
const buildPan = useCallback(which => {
|
|
322
|
-
const xSV = which === 'low' ? lowX : highX;
|
|
323
|
-
const valSV = which === 'low' ? lowVal : highVal;
|
|
324
|
-
const otherSV = which === 'low' ? highVal : lowVal;
|
|
325
|
-
const scaleSV = which === 'low' ? lowScale : highScale;
|
|
326
|
-
const labelSV = which === 'low' ? lowLabelOpacity : highLabelOpacity;
|
|
327
|
-
const isLow = which === 'low';
|
|
328
|
-
const _min = min;
|
|
329
|
-
const _max = max;
|
|
330
|
-
const _step = step;
|
|
331
|
-
const _precision = precision;
|
|
332
|
-
const _range = isRange;
|
|
333
|
-
const _pressScale = resolvedPressScale;
|
|
334
|
-
const _pressAnim = thumbPressAnimationEnabled;
|
|
335
|
-
const _showLabel = showLabel === true;
|
|
336
|
-
const _snapThumb = snapThumb;
|
|
337
|
-
const _labelOpacity = resolvedLabelOpacity;
|
|
338
|
-
const _labelDur = resolvedLabelDuration;
|
|
339
|
-
const _spring = springCfg;
|
|
340
|
-
const _inset = endInset;
|
|
341
|
-
|
|
342
|
-
// Puts the thumb and the value where the finger's translation says.
|
|
343
|
-
const follow = translationX => {
|
|
344
|
-
'worklet';
|
|
345
|
-
|
|
346
|
-
const travel = trackW.value - _inset * 2;
|
|
347
|
-
if (travel <= 0 || !Number.isFinite(translationX)) {
|
|
348
|
-
return;
|
|
349
|
-
}
|
|
350
|
-
const px = Math.min(Math.max(dragStartX.value + translationX, _inset), trackW.value - _inset);
|
|
351
|
-
const ratio = (px - _inset) / travel;
|
|
352
|
-
let v = _min + ratio * (_max - _min);
|
|
353
|
-
if (_step > 0) {
|
|
354
|
-
v = Math.round((v - _min) / _step) * _step + _min;
|
|
355
|
-
v = Math.round(v * _precision) / _precision;
|
|
356
|
-
}
|
|
357
|
-
v = Math.min(Math.max(v, _min), _max);
|
|
358
|
-
if (_range) {
|
|
359
|
-
if (isLow && v > otherSV.value) {
|
|
360
|
-
v = otherSV.value;
|
|
361
|
-
}
|
|
362
|
-
if (!isLow && v < otherSV.value) {
|
|
363
|
-
v = otherSV.value;
|
|
364
|
-
}
|
|
365
|
-
}
|
|
366
|
-
// The thumb follows the finger (held off the other thumb in range
|
|
367
|
-
// mode) unless it is pinned to the steps; the value snaps either way.
|
|
368
|
-
if (_snapThumb || _max === _min) {
|
|
369
|
-
xSV.value = _max === _min ? _inset : _inset + (v - _min) / (_max - _min) * travel;
|
|
370
|
-
} else if (_range) {
|
|
371
|
-
xSV.value = isLow ? Math.min(px, highX.value) : Math.max(px, lowX.value);
|
|
372
|
-
} else {
|
|
373
|
-
xSV.value = px;
|
|
374
|
-
}
|
|
375
|
-
if (v !== valSV.value) {
|
|
376
|
-
valSV.value = v;
|
|
377
|
-
// A detent at the ends only; see the `haptic` prop.
|
|
378
|
-
if (v === _min || v === _max) {
|
|
379
|
-
runOnJS(emitHaptic)();
|
|
380
|
-
}
|
|
381
|
-
runOnJS(emitChange)(lowVal.value, highVal.value);
|
|
382
|
-
}
|
|
383
|
-
};
|
|
384
|
-
const pan = Gesture.Pan().enabled(!disabled).minDistance(0);
|
|
385
|
-
return (thumbHitSlop === undefined ? pan : pan.hitSlop(thumbHitSlop)).onStart(() => {
|
|
386
|
-
'worklet';
|
|
387
|
-
|
|
388
|
-
runOnJS(setDragging)(true);
|
|
389
|
-
dragStartX.value = xSV.value;
|
|
390
|
-
if (_pressAnim) {
|
|
391
|
-
scaleSV.value = withSpring(_pressScale, _spring);
|
|
392
|
-
}
|
|
393
|
-
if (_showLabel) {
|
|
394
|
-
labelSV.value = withTiming(_labelOpacity, {
|
|
395
|
-
duration: _labelDur,
|
|
396
|
-
easing: Easing.out(Easing.cubic)
|
|
397
|
-
});
|
|
398
|
-
}
|
|
399
|
-
runOnJS(emitHaptic)();
|
|
400
|
-
}).onUpdate(event => {
|
|
401
|
-
'worklet';
|
|
402
|
-
|
|
403
|
-
follow(event.translationX);
|
|
404
|
-
})
|
|
405
|
-
// The end event carries the finger's last position. A fast flick
|
|
406
|
-
// often delivers its final moves in the same batch as the lift, so
|
|
407
|
-
// they never reach onUpdate: without this the thumb settled back to
|
|
408
|
-
// the last update, or to where it was grabbed.
|
|
409
|
-
.onEnd(event => {
|
|
410
|
-
'worklet';
|
|
411
|
-
|
|
412
|
-
follow(event.translationX);
|
|
413
|
-
if (_pressAnim) {
|
|
414
|
-
scaleSV.value = withSpring(1, _spring);
|
|
415
|
-
}
|
|
416
|
-
if (_showLabel) {
|
|
417
|
-
labelSV.value = withTiming(0, {
|
|
418
|
-
duration: _labelDur,
|
|
419
|
-
easing: Easing.out(Easing.cubic)
|
|
420
|
-
});
|
|
421
|
-
}
|
|
422
|
-
})
|
|
423
|
-
// Also on a cancelled pan (a parent scroll took over), which skips onEnd.
|
|
424
|
-
.onFinalize(() => {
|
|
425
|
-
'worklet';
|
|
426
|
-
|
|
427
|
-
runOnJS(setDragging)(false);
|
|
428
|
-
});
|
|
429
|
-
}, [disabled, min, max, step, precision, isRange, resolvedPressScale, thumbPressAnimationEnabled, showLabel, snapThumb, resolvedLabelOpacity, resolvedLabelDuration, springCfg, endInset, thumbHitSlop, emitChange, emitHaptic, setDragging, lowX, highX, lowVal, highVal, lowScale, highScale, lowLabelOpacity, highLabelOpacity, dragStartX, trackW]);
|
|
430
|
-
const lowPan = useMemo(() => buildPan('low'), [buildPan]);
|
|
431
|
-
const highPan = useMemo(() => buildPan('high'), [buildPan]);
|
|
432
|
-
|
|
433
|
-
// Tap on track jumps to position (single mode only).
|
|
434
|
-
const handleTrackPress = useCallback(e => {
|
|
435
|
-
if (disabled || isRange || trackWidth <= 0) {
|
|
436
|
-
return;
|
|
437
|
-
}
|
|
438
|
-
const px = clamp(e.nativeEvent.locationX, 0, trackWidth);
|
|
439
|
-
const next = pxToValue(px, trackWidth);
|
|
440
|
-
if (next !== lowVal.value) {
|
|
441
|
-
fireHaptic();
|
|
442
|
-
lowVal.value = next;
|
|
443
|
-
lowX.value = withTiming(valueToPx(next, trackWidth), {
|
|
444
|
-
duration: theme.motion.duration.fast,
|
|
445
|
-
easing: Easing.out(Easing.cubic)
|
|
446
|
-
});
|
|
447
|
-
fireChange(next, next);
|
|
448
|
-
}
|
|
449
|
-
}, [disabled, isRange, trackWidth, pxToValue, valueToPx, fireChange, fireHaptic, lowX, lowVal, theme.motion.duration.fast]);
|
|
450
|
-
|
|
451
|
-
// Accessibility actions: increment / decrement.
|
|
452
|
-
const handleAccessibilityAction = useCallback(event => {
|
|
453
|
-
if (disabled) {
|
|
454
|
-
return;
|
|
455
|
-
}
|
|
456
|
-
const delta = event.nativeEvent.actionName === 'increment' ? step : -step;
|
|
457
|
-
// Round through `precision` (same guard the pan gesture uses) so repeated
|
|
458
|
-
// increments of a fractional step (e.g. 0.1) don't drift off the exact
|
|
459
|
-
// decimal via binary float addition (0.1+0.1+0.1 = 0.30000000000000004).
|
|
460
|
-
const roundedDelta = step > 0 ? Math.round(delta * precision) / precision : delta;
|
|
461
|
-
if (isRange) {
|
|
462
|
-
const rawLow = Math.round((lowVal.value + roundedDelta) * precision) / precision;
|
|
463
|
-
const nextLow = clamp(rawLow, min, highVal.value);
|
|
464
|
-
if (nextLow !== lowVal.value) {
|
|
465
|
-
lowVal.value = nextLow;
|
|
466
|
-
lowX.value = valueToPx(nextLow, trackWidth);
|
|
467
|
-
fireHaptic();
|
|
468
|
-
fireChange(nextLow, highVal.value);
|
|
469
|
-
}
|
|
470
|
-
} else {
|
|
471
|
-
const rawNext = Math.round((lowVal.value + roundedDelta) * precision) / precision;
|
|
472
|
-
const next = clamp(rawNext, min, max);
|
|
473
|
-
if (next !== lowVal.value) {
|
|
474
|
-
lowVal.value = next;
|
|
475
|
-
lowX.value = valueToPx(next, trackWidth);
|
|
476
|
-
fireHaptic();
|
|
477
|
-
fireChange(next, next);
|
|
478
|
-
}
|
|
479
|
-
}
|
|
480
|
-
}, [disabled, step, precision, isRange, min, max, valueToPx, trackWidth, lowX, lowVal, highVal, fireChange, fireHaptic]);
|
|
481
|
-
const thumbRadius = sizeCfg.thumbDiameter / 2;
|
|
482
|
-
const thumbInk = disabled ? theme.colors.surface.disabled : fillColor;
|
|
483
|
-
// What the thumb itself looks like; position, scale and size are shared.
|
|
484
|
-
const thumbLook = variant === 'inset' ? {
|
|
485
|
-
backgroundColor: thumbInk,
|
|
486
|
-
borderColor: theme.colors.background.elevated,
|
|
487
|
-
borderWidth: Math.max(2, Math.round(sizeCfg.thumbDiameter * INSET_RING_RATIO)),
|
|
488
|
-
...NO_SHADOW
|
|
489
|
-
} : variant === 'minimal' ? {
|
|
490
|
-
backgroundColor: thumbInk,
|
|
491
|
-
borderWidth: 0
|
|
492
|
-
} : variant === 'bar' ? {
|
|
493
|
-
backgroundColor: 'transparent',
|
|
494
|
-
borderWidth: 0,
|
|
495
|
-
...NO_SHADOW
|
|
496
|
-
} : {
|
|
497
|
-
backgroundColor: theme.colors.background.elevated,
|
|
498
|
-
borderColor: thumbInk
|
|
499
|
-
};
|
|
500
|
-
|
|
501
|
-
// ───────── Animated styles ─────────
|
|
502
|
-
// The fill is a full-width bar moved with transforms, never resized: on
|
|
503
|
-
// Fabric a layout prop (`width`, `left`) animated from a worklet clones and
|
|
504
|
-
// commits the shadow tree every frame, and on Android that missed frames
|
|
505
|
-
// for the whole drag. A transform is applied on the UI thread directly.
|
|
506
|
-
// Single mode slides the bar so its rounded end sits at the value; the
|
|
507
|
-
// track's own clip hides the rest. Range mode also scales it from its left
|
|
508
|
-
// edge to span the two thumbs. Hidden until the track is measured, so the
|
|
509
|
-
// bar never flashes full width on the first frame.
|
|
510
|
-
const fillAnimStyle = useAnimatedStyle(() => {
|
|
511
|
-
const width = trackW.value;
|
|
512
|
-
if (width <= 0) {
|
|
513
|
-
return {
|
|
514
|
-
opacity: 0,
|
|
515
|
-
transform: [{
|
|
516
|
-
translateX: 0
|
|
517
|
-
}, {
|
|
518
|
-
scaleX: 1
|
|
519
|
-
}]
|
|
520
|
-
};
|
|
521
|
-
}
|
|
522
|
-
const opacity = disabled ? 0.55 : 1;
|
|
523
|
-
if (isRange) {
|
|
524
|
-
const span = Math.max(0, highX.value - lowX.value + endInset * 2);
|
|
525
|
-
return {
|
|
526
|
-
opacity,
|
|
527
|
-
transform: [{
|
|
528
|
-
translateX: lowX.value - endInset
|
|
529
|
-
}, {
|
|
530
|
-
scaleX: span / width
|
|
531
|
-
}]
|
|
532
|
-
};
|
|
533
|
-
}
|
|
534
|
-
return {
|
|
535
|
-
opacity,
|
|
536
|
-
transform: [{
|
|
537
|
-
translateX: lowX.value + endInset - width
|
|
538
|
-
}, {
|
|
539
|
-
scaleX: 1
|
|
540
|
-
}]
|
|
541
|
-
};
|
|
542
|
-
});
|
|
543
|
-
const lowThumbStyle = useAnimatedStyle(() => ({
|
|
544
|
-
transform: [{
|
|
545
|
-
translateX: lowX.value - thumbRadius
|
|
546
|
-
}, {
|
|
547
|
-
scale: lowScale.value
|
|
548
|
-
}]
|
|
549
|
-
}));
|
|
550
|
-
const highThumbStyle = useAnimatedStyle(() => ({
|
|
551
|
-
transform: [{
|
|
552
|
-
translateX: highX.value - thumbRadius
|
|
553
|
-
}, {
|
|
554
|
-
scale: highScale.value
|
|
555
|
-
}]
|
|
556
|
-
}));
|
|
557
|
-
const lowLabelStyle = useAnimatedStyle(() => ({
|
|
558
|
-
opacity: lowLabelOpacity.value
|
|
559
|
-
}));
|
|
560
|
-
const highLabelStyle = useAnimatedStyle(() => ({
|
|
561
|
-
opacity: highLabelOpacity.value
|
|
562
|
-
}));
|
|
563
|
-
|
|
564
|
-
// Display values (from committed state) for labels + a11y.
|
|
565
|
-
//
|
|
566
|
-
// Clamped to [min, max]. A caller-supplied value outside the range is not
|
|
567
|
-
// rewritten — `onChange` is never fired from here and the caller's own state
|
|
568
|
-
// is untouched — but it must not be RENDERED as-is: valueToPx does not clamp,
|
|
569
|
-
// so value=150 on a 0..100 slider puts the thumb off the end of the track, and
|
|
570
|
-
// accessibilityValue would announce `now: 150` against `max: 100`, which is an
|
|
571
|
-
// invalid state for a screen reader. Any interaction re-clamps through
|
|
572
|
-
// clamp()/snapToStep() anyway, so this only aligns the first render with what
|
|
573
|
-
// every subsequent one already does.
|
|
574
|
-
const clampDisplay = v => clamp(v, min, max);
|
|
575
|
-
const lowDisplayValue = clampDisplay(isRange ? Math.min(...currentValue) : currentValue);
|
|
576
|
-
const highDisplayValue = clampDisplay(isRange ? Math.max(...currentValue) : currentValue);
|
|
577
|
-
return /*#__PURE__*/_jsx(View, {
|
|
578
|
-
ref: ref,
|
|
579
|
-
style: [styles.container, containerStyle, style],
|
|
580
|
-
testID: testID,
|
|
581
|
-
accessibilityRole: "adjustable",
|
|
582
|
-
accessibilityLabel: accessibilityLabel,
|
|
583
|
-
accessibilityState: {
|
|
584
|
-
disabled
|
|
585
|
-
},
|
|
586
|
-
accessibilityValue: isRange ? {
|
|
587
|
-
min,
|
|
588
|
-
max,
|
|
589
|
-
now: lowDisplayValue,
|
|
590
|
-
text: `${lowDisplayValue} to ${highDisplayValue}`
|
|
591
|
-
} : {
|
|
592
|
-
min,
|
|
593
|
-
max,
|
|
594
|
-
now: lowDisplayValue
|
|
595
|
-
},
|
|
596
|
-
accessibilityActions: [{
|
|
597
|
-
name: 'increment'
|
|
598
|
-
}, {
|
|
599
|
-
name: 'decrement'
|
|
600
|
-
}],
|
|
601
|
-
onAccessibilityAction: handleAccessibilityAction,
|
|
602
|
-
children: /*#__PURE__*/_jsx(Pressable, {
|
|
603
|
-
onPress: handleTrackPress,
|
|
604
|
-
disabled: disabled || isRange,
|
|
605
|
-
style: styles.trackTouch,
|
|
606
|
-
accessibilityElementsHidden: true,
|
|
607
|
-
importantForAccessibility: "no-hide-descendants",
|
|
608
|
-
children: /*#__PURE__*/_jsxs(View, {
|
|
609
|
-
style: styles.trackWrap,
|
|
610
|
-
onLayout: onTrackLayout,
|
|
611
|
-
children: [/*#__PURE__*/_jsxs(View, {
|
|
612
|
-
style: styles.trackClip,
|
|
613
|
-
pointerEvents: "none",
|
|
614
|
-
children: [/*#__PURE__*/_jsx(View, {
|
|
615
|
-
style: [styles.track, {
|
|
616
|
-
backgroundColor: disabled ? theme.colors.surface.disabled : theme.colors.border.primary
|
|
617
|
-
}, trackStyle]
|
|
618
|
-
}), /*#__PURE__*/_jsx(Animated.View, {
|
|
619
|
-
style: [styles.fill, {
|
|
620
|
-
backgroundColor: disabled ? theme.colors.surface.disabled : fillColor
|
|
621
|
-
}, fillStyle, fillAnimStyle]
|
|
622
|
-
})]
|
|
623
|
-
}), /*#__PURE__*/_jsx(GestureDetector, {
|
|
624
|
-
gesture: lowPan,
|
|
625
|
-
children: /*#__PURE__*/_jsx(Animated.View, {
|
|
626
|
-
style: [styles.thumb, {
|
|
627
|
-
width: sizeCfg.thumbDiameter,
|
|
628
|
-
height: sizeCfg.thumbDiameter,
|
|
629
|
-
borderRadius: thumbRadius,
|
|
630
|
-
...smoothCorners,
|
|
631
|
-
opacity: disabled ? 0.55 : 1
|
|
632
|
-
}, thumbLook, thumbStyle, lowThumbStyle],
|
|
633
|
-
accessibilityElementsHidden: true,
|
|
634
|
-
importantForAccessibility: "no-hide-descendants",
|
|
635
|
-
children: showLabel ? /*#__PURE__*/_jsxs(Animated.View, {
|
|
636
|
-
style: [styles.bubbleWrap, lowLabelStyle],
|
|
637
|
-
pointerEvents: "none",
|
|
638
|
-
children: [/*#__PURE__*/_jsx(View, {
|
|
639
|
-
style: [styles.bubble, {
|
|
640
|
-
backgroundColor: fillColor
|
|
641
|
-
}],
|
|
642
|
-
children: renderLabel ? renderLabel(lowDisplayValue) : /*#__PURE__*/_jsx(Text, {
|
|
643
|
-
style: [styles.bubbleText, labelStyle],
|
|
644
|
-
numberOfLines: 1,
|
|
645
|
-
children: formatLabel(lowDisplayValue)
|
|
646
|
-
})
|
|
647
|
-
}), /*#__PURE__*/_jsx(View, {
|
|
648
|
-
style: [styles.bubbleCaret, {
|
|
649
|
-
backgroundColor: fillColor
|
|
650
|
-
}]
|
|
651
|
-
})]
|
|
652
|
-
}) : null
|
|
653
|
-
})
|
|
654
|
-
}), isRange ? /*#__PURE__*/_jsx(GestureDetector, {
|
|
655
|
-
gesture: highPan,
|
|
656
|
-
children: /*#__PURE__*/_jsx(Animated.View, {
|
|
657
|
-
style: [styles.thumb, {
|
|
658
|
-
width: sizeCfg.thumbDiameter,
|
|
659
|
-
height: sizeCfg.thumbDiameter,
|
|
660
|
-
borderRadius: thumbRadius,
|
|
661
|
-
...smoothCorners,
|
|
662
|
-
opacity: disabled ? 0.55 : 1
|
|
663
|
-
}, thumbLook, thumbStyle, highThumbStyle],
|
|
664
|
-
accessibilityElementsHidden: true,
|
|
665
|
-
importantForAccessibility: "no-hide-descendants",
|
|
666
|
-
children: showLabel ? /*#__PURE__*/_jsxs(Animated.View, {
|
|
667
|
-
style: [styles.bubbleWrap, highLabelStyle],
|
|
668
|
-
pointerEvents: "none",
|
|
669
|
-
children: [/*#__PURE__*/_jsx(View, {
|
|
670
|
-
style: [styles.bubble, {
|
|
671
|
-
backgroundColor: fillColor
|
|
672
|
-
}],
|
|
673
|
-
children: renderLabel ? renderLabel(highDisplayValue) : /*#__PURE__*/_jsx(Text, {
|
|
674
|
-
style: [styles.bubbleText, labelStyle],
|
|
675
|
-
numberOfLines: 1,
|
|
676
|
-
children: formatLabel(highDisplayValue)
|
|
677
|
-
})
|
|
678
|
-
}), /*#__PURE__*/_jsx(View, {
|
|
679
|
-
style: [styles.bubbleCaret, {
|
|
680
|
-
backgroundColor: fillColor
|
|
681
|
-
}]
|
|
682
|
-
})]
|
|
683
|
-
}) : null
|
|
684
|
-
})
|
|
685
|
-
}) : null]
|
|
686
|
-
})
|
|
687
|
-
})
|
|
688
|
-
});
|
|
689
|
-
});
|
|
690
|
-
Slider.displayName = 'Slider';
|
|
691
|
-
const buildStyles = (theme, sizeCfg) => {
|
|
692
|
-
const thumbShadow = theme.shadows.md;
|
|
693
|
-
// The row is as tall as whichever is taller, the thumb or the track.
|
|
694
|
-
const rowHeight = Math.max(sizeCfg.thumbDiameter, sizeCfg.trackHeight);
|
|
695
|
-
const verticalPad = rowHeight / 2 + 4;
|
|
696
|
-
return StyleSheet.create({
|
|
697
|
-
container: {
|
|
698
|
-
width: '100%',
|
|
699
|
-
paddingVertical: verticalPad,
|
|
700
|
-
justifyContent: 'center'
|
|
701
|
-
},
|
|
702
|
-
trackTouch: {
|
|
703
|
-
width: '100%',
|
|
704
|
-
justifyContent: 'center'
|
|
705
|
-
},
|
|
706
|
-
trackWrap: {
|
|
707
|
-
width: '100%',
|
|
708
|
-
height: rowHeight,
|
|
709
|
-
justifyContent: 'center'
|
|
710
|
-
},
|
|
711
|
-
trackClip: {
|
|
712
|
-
position: 'absolute',
|
|
713
|
-
left: 0,
|
|
714
|
-
right: 0,
|
|
715
|
-
height: sizeCfg.trackHeight,
|
|
716
|
-
top: (rowHeight - sizeCfg.trackHeight) / 2,
|
|
717
|
-
// Half the height, not `radius.full`: Android drops an oversized radius
|
|
718
|
-
// to square corners on a view whose size it is still settling.
|
|
719
|
-
borderRadius: sizeCfg.trackHeight / 2,
|
|
720
|
-
...smoothCorners,
|
|
721
|
-
overflow: 'hidden'
|
|
722
|
-
},
|
|
723
|
-
track: {
|
|
724
|
-
position: 'absolute',
|
|
725
|
-
top: 0,
|
|
726
|
-
right: 0,
|
|
727
|
-
bottom: 0,
|
|
728
|
-
left: 0,
|
|
729
|
-
borderRadius: sizeCfg.trackHeight / 2,
|
|
730
|
-
...smoothCorners
|
|
731
|
-
},
|
|
732
|
-
fill: {
|
|
733
|
-
position: 'absolute',
|
|
734
|
-
top: 0,
|
|
735
|
-
left: 0,
|
|
736
|
-
width: '100%',
|
|
737
|
-
height: sizeCfg.trackHeight,
|
|
738
|
-
borderRadius: sizeCfg.trackHeight / 2,
|
|
739
|
-
...smoothCorners,
|
|
740
|
-
// Range mode scales the bar from this edge.
|
|
741
|
-
transformOrigin: 'left'
|
|
742
|
-
},
|
|
743
|
-
thumb: {
|
|
744
|
-
position: 'absolute',
|
|
745
|
-
top: (rowHeight - sizeCfg.thumbDiameter) / 2,
|
|
746
|
-
left: 0,
|
|
747
|
-
borderWidth: 2,
|
|
748
|
-
shadowColor: thumbShadow.shadowColor,
|
|
749
|
-
shadowOffset: thumbShadow.shadowOffset,
|
|
750
|
-
shadowOpacity: thumbShadow.shadowOpacity,
|
|
751
|
-
shadowRadius: thumbShadow.shadowRadius,
|
|
752
|
-
elevation: thumbShadow.elevation,
|
|
753
|
-
alignItems: 'center',
|
|
754
|
-
justifyContent: 'center'
|
|
755
|
-
},
|
|
756
|
-
// The bubble and its caret share one absolutely placed, centred column so
|
|
757
|
-
// the caret's tip sits on the thumb's centre line.
|
|
758
|
-
bubbleWrap: {
|
|
759
|
-
position: 'absolute',
|
|
760
|
-
bottom: sizeCfg.thumbDiameter + BUBBLE_GAP,
|
|
761
|
-
left: sizeCfg.thumbDiameter / 2 - BUBBLE_WRAP_WIDTH / 2,
|
|
762
|
-
width: BUBBLE_WRAP_WIDTH,
|
|
763
|
-
alignItems: 'center'
|
|
764
|
-
},
|
|
765
|
-
bubbleCaret: {
|
|
766
|
-
width: BUBBLE_CARET,
|
|
767
|
-
height: BUBBLE_CARET,
|
|
768
|
-
marginTop: -BUBBLE_CARET / 2 - 1,
|
|
769
|
-
borderRadius: 1,
|
|
770
|
-
...smoothCorners,
|
|
771
|
-
transform: [{
|
|
772
|
-
rotate: '45deg'
|
|
773
|
-
}]
|
|
774
|
-
},
|
|
775
|
-
bubble: {
|
|
776
|
-
paddingHorizontal: theme.spacing.sm,
|
|
777
|
-
paddingVertical: theme.spacing.xxs,
|
|
778
|
-
borderRadius: theme.radius.md,
|
|
779
|
-
...smoothCorners,
|
|
780
|
-
minWidth: 36,
|
|
781
|
-
alignItems: 'center',
|
|
782
|
-
justifyContent: 'center',
|
|
783
|
-
...Platform.select({
|
|
784
|
-
ios: {
|
|
785
|
-
shadowColor: theme.shadows.sm.shadowColor,
|
|
786
|
-
shadowOffset: theme.shadows.sm.shadowOffset,
|
|
787
|
-
shadowOpacity: theme.shadows.sm.shadowOpacity,
|
|
788
|
-
shadowRadius: theme.shadows.sm.shadowRadius
|
|
789
|
-
},
|
|
790
|
-
android: {
|
|
791
|
-
elevation: theme.shadows.sm.elevation
|
|
792
|
-
},
|
|
793
|
-
default: {}
|
|
794
|
-
})
|
|
795
|
-
},
|
|
796
|
-
bubbleText: {
|
|
797
|
-
color: theme.colors.text.inverse,
|
|
798
|
-
fontSize: theme.typography.fontSize.xs,
|
|
799
|
-
fontWeight: theme.typography.fontWeight.semibold
|
|
800
|
-
}
|
|
801
|
-
});
|
|
802
|
-
};
|
|
803
|
-
export { Slider };
|
|
804
|
-
export default Slider;
|
|
805
|
-
//# sourceMappingURL=Slider.js.map
|
|
1
|
+
import{forwardRef as t,useCallback as e,useEffect as a,useMemo as r,useRef as i,useState as o}from"react";import{Platform as n,Pressable as s,StyleSheet as l,Text as u,View as c}from"react-native";import{Gesture as m,GestureDetector as d}from"react-native-gesture-handler";import h,{cancelAnimation as b,Easing as g,runOnJS as p,useAnimatedStyle as v,useSharedValue as f,withSpring as y,withTiming as w}from"react-native-reanimated";import{useControllableState as k}from"../../hooks/index.js";import{useTheme as D}from"../../theme/index.js";import{resolveHaptic as x,triggerHaptic as C}from"../../utils/index.js";import{smoothCorners as H}from"../../utils/corners.js";import{sliderToneInk as M}from"./valueText.js";import{jsx as S,jsxs as O}from"react/jsx-runtime";const j={sm:{trackHeight:4,thumbDiameter:24},md:{trackHeight:6,thumbDiameter:28},lg:{trackHeight:8,thumbDiameter:32}},R={inset:{sm:{trackHeight:14,thumbDiameter:10},md:{trackHeight:20,thumbDiameter:14},lg:{trackHeight:26,thumbDiameter:18}},minimal:{sm:{trackHeight:2,thumbDiameter:14},md:{trackHeight:3,thumbDiameter:18},lg:{trackHeight:4,thumbDiameter:22}},bar:{sm:{trackHeight:20,thumbDiameter:20},md:{trackHeight:28,thumbDiameter:28},lg:{trackHeight:36,thumbDiameter:36}}},W={primary:"primary",success:"success",warning:"warning",error:"error"},clamp=(t,e,a)=>Math.min(Math.max(t,e),a),X={shadowOpacity:0,elevation:0},defaultFormatLabel=t=>String(t),E=t((t,n)=>{const{min:l=0,max:E=100,step:V=1,disabled:L=!1,tone:T="primary",size:A="md",variant:F="default",showLabel:P=!1,snapThumb:z=!1,formatLabel:I=defaultFormatLabel,renderLabel:N,accessibilityLabel:$,haptic:J,style:U,containerStyle:q,trackStyle:B,fillStyle:G,thumbStyle:K,labelStyle:Q,thumbPressScale:Y,labelShowDuration:Z,labelOpacity:_,testID:tt}=t,et=D(),at=et.components.slider,rt=at?.[A],it=r(()=>"default"===F?{trackHeight:rt?.trackHeight??j[A].trackHeight,thumbDiameter:rt?.thumbDiameter??j[A].thumbDiameter}:R[F][A],[rt,A,F]),ot="inset"===F?it.trackHeight/2:0,nt=at?.thumbPressAnimation??!1,st=Y??at?.thumbPressScale??1.1,lt=Z??at?.labelShowDuration??et.motion.duration.fast,ut=_??at?.labelOpacity??1,ct=r(()=>buildStyles(et,it),[et,it]),mt=r(()=>({damping:et.motion.spring.snappy.damping,stiffness:et.motion.spring.snappy.stiffness,mass:et.motion.spring.snappy.mass}),[et.motion.spring.snappy]),[dt,ht]=o(0),bt=et.colors[W[T]],gt=M(et,T),pt=!0===t.range,[vt,ft]=k({value:t.value,defaultValue:t.defaultValue??(pt?[l,E]:l),onChange:t.onChange}),yt=f(0),wt=f(0),kt=f(pt?vt[0]:vt),Dt=f(pt?vt[1]:vt),xt=f(0),Ct=f(0),Ht=f(1),Mt=f(1),St="always"===P,Ot=f(St?1:0),jt=f(St?1:0),Rt=r(()=>{const t=String(V).split(".")[1]?.length??0;return Math.pow(10,t)},[V]);a(()=>()=>{b(yt),b(wt),b(Ht),b(Mt),b(Ot),b(jt)},[yt,wt,Ht,Mt,Ot,jt]);const Wt=e((t,e)=>{const a=e-2*ot;return E===l||a<=0?ot:ot+(t-l)/(E-l)*a},[l,E,ot]),Xt=e((t,e)=>{const a=e-2*ot;if(a<=0)return l;const r=clamp((t-ot)/a,0,1);return((t,e,a,r)=>{if(r<=0)return clamp(t,e,a);const i=Math.round((t-e)/r)*r+e,o=String(r).split(".")[1]?.length??0,n=o>0?Number(i.toFixed(o)):i;return clamp(n,e,a)})(l+r*(E-l),l,E,V)},[l,E,V,ot]),Et=i(!1),Vt=et.motion.duration.fast,Lt=i(vt);Lt.current=vt;const Tt=i(dt);Tt.current=dt;const At=e((t=!1)=>{const e=Tt.current;if(e<=0)return;const place=e=>t?w(e,{duration:Vt,easing:g.out(g.cubic)}):e,a=Lt.current;if(pt){const[t,r]=a,i=Math.min(t,r),o=Math.max(t,r);kt.value=i,Dt.value=o,yt.value=place(Wt(i,e)),wt.value=place(Wt(o,e))}else{const t=a;kt.value=t,Dt.value=t,yt.value=place(Wt(t,e))}},[pt,Wt,kt,Dt,yt,wt,Vt]),[Ft,Pt]=o(0),zt=i(!1),It=e(t=>{Et.current=t,t||(zt.current=!0,Pt(t=>t+1))},[]);a(()=>{if(Et.current)return;const t=zt.current;zt.current=!1,At(t)},[JSON.stringify(vt),dt,Ft,At]);const Nt=e(t=>{const e=t.nativeEvent.layout.width;Ct.value=e,ht(e)},[Ct]),$t=e((t,e)=>{ft(pt?[t,e]:t)},[pt,ft]),Jt=e(()=>{const t=x(J,"selection");t&&C(t)},[J]),Ut=i($t);Ut.current=$t;const qt=i(Jt);qt.current=Jt;const Bt=e((t,e)=>Ut.current(t,e),[]),Gt=e(()=>qt.current(),[]),Kt=Math.max(0,(44-it.thumbDiameter)/2),Qt=Kt>0?Kt:void 0,Yt=e(t=>{const e="low"===t?yt:wt,a="low"===t?kt:Dt,r="low"===t?Dt:kt,i="low"===t?Ht:Mt,o="low"===t?Ot:jt,n="low"===t,s=l,u=E,c=V,d=Rt,h=pt,b=st,v=nt,f=!0===P,k=z,D=ut,x=lt,C=mt,H=ot,follow=t=>{const i=Ct.value-2*H;if(i<=0||!Number.isFinite(t))return;const o=Math.min(Math.max(xt.value+t,H),Ct.value-H);let l=s+(o-H)/i*(u-s);c>0&&(l=Math.round((l-s)/c)*c+s,l=Math.round(l*d)/d),l=Math.min(Math.max(l,s),u),h&&(n&&l>r.value&&(l=r.value),!n&&l<r.value&&(l=r.value)),e.value=k||u===s?u===s?H:H+(l-s)/(u-s)*i:h?n?Math.min(o,wt.value):Math.max(o,yt.value):o,l!==a.value&&(a.value=l,l!==s&&l!==u||p(Gt)(),p(Bt)(kt.value,Dt.value))},M=m.Pan().enabled(!L).minDistance(0);return(void 0===Qt?M:M.hitSlop(Qt)).onStart(()=>{p(It)(!0),xt.value=e.value,v&&(i.value=y(b,C)),f&&(o.value=w(D,{duration:x,easing:g.out(g.cubic)})),p(Gt)()}).onUpdate(t=>{follow(t.translationX)}).onEnd(t=>{follow(t.translationX),v&&(i.value=y(1,C)),f&&(o.value=w(0,{duration:x,easing:g.out(g.cubic)}))}).onFinalize(()=>{p(It)(!1)})},[L,l,E,V,Rt,pt,st,nt,P,z,ut,lt,mt,ot,Qt,Bt,Gt,It,yt,wt,kt,Dt,Ht,Mt,Ot,jt,xt,Ct]),Zt=r(()=>Yt("low"),[Yt]),_t=r(()=>Yt("high"),[Yt]),te=e(t=>{if(L||pt||dt<=0)return;const e=clamp(t.nativeEvent.locationX,0,dt),a=Xt(e,dt);a!==kt.value&&(Jt(),kt.value=a,yt.value=w(Wt(a,dt),{duration:et.motion.duration.fast,easing:g.out(g.cubic)}),$t(a,a))},[L,pt,dt,Xt,Wt,$t,Jt,yt,kt,et.motion.duration.fast]),ee=e(t=>{if(L)return;const e="increment"===t.nativeEvent.actionName?V:-V,a=V>0?Math.round(e*Rt)/Rt:e;if(pt){const t=Math.round((kt.value+a)*Rt)/Rt,e=clamp(t,l,Dt.value);e!==kt.value&&(kt.value=e,yt.value=Wt(e,dt),Jt(),$t(e,Dt.value))}else{const t=Math.round((kt.value+a)*Rt)/Rt,e=clamp(t,l,E);e!==kt.value&&(kt.value=e,yt.value=Wt(e,dt),Jt(),$t(e,e))}},[L,V,Rt,pt,l,E,Wt,dt,yt,kt,Dt,$t,Jt]),ae=it.thumbDiameter/2,re=L?et.colors.surface.disabled:bt,ie="inset"===F?{backgroundColor:re,borderColor:et.colors.background.elevated,borderWidth:Math.max(2,Math.round(.3*it.thumbDiameter)),...X}:"minimal"===F?{backgroundColor:re,borderWidth:0}:"bar"===F?{backgroundColor:"transparent",borderWidth:0,...X}:{backgroundColor:et.colors.background.elevated,borderColor:re},oe=v(()=>{const t=Ct.value;if(t<=0)return{opacity:0,transform:[{translateX:0},{scaleX:1}]};const e=L?.55:1;if(pt){const a=Math.max(0,wt.value-yt.value+2*ot);return{opacity:e,transform:[{translateX:yt.value-ot},{scaleX:a/t}]}}return{opacity:e,transform:[{translateX:yt.value+ot-t},{scaleX:1}]}}),ne=v(()=>({transform:[{translateX:yt.value-ae},{scale:Ht.value}]})),se=v(()=>({transform:[{translateX:wt.value-ae},{scale:Mt.value}]})),le=v(()=>({opacity:Ot.value})),ue=v(()=>({opacity:jt.value})),clampDisplay=t=>clamp(t,l,E),ce=clampDisplay(pt?Math.min(...vt):vt),me=clampDisplay(pt?Math.max(...vt):vt);return S(c,{ref:n,style:[ct.container,q,U],testID:tt,accessibilityRole:"adjustable",accessibilityLabel:$,accessibilityState:{disabled:L},accessibilityValue:pt?{min:l,max:E,now:ce,text:`${ce} to ${me}`}:{min:l,max:E,now:ce},accessibilityActions:[{name:"increment"},{name:"decrement"}],onAccessibilityAction:ee,children:S(s,{onPress:te,disabled:L||pt,style:ct.trackTouch,accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants",children:O(c,{style:ct.trackWrap,onLayout:Nt,children:[O(c,{style:ct.trackClip,pointerEvents:"none",children:[S(c,{style:[ct.track,{backgroundColor:L?et.colors.surface.disabled:et.colors.border.primary},B]}),S(h.View,{style:[ct.fill,{backgroundColor:L?et.colors.surface.disabled:bt},G,oe]})]}),S(d,{gesture:Zt,children:S(h.View,{style:[ct.thumb,{width:it.thumbDiameter,height:it.thumbDiameter,borderRadius:ae,...H,opacity:L?.55:1},ie,K,ne],accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants",children:P?O(h.View,{style:[ct.bubbleWrap,le],pointerEvents:"none",children:[S(c,{style:[ct.bubble,{backgroundColor:bt}],children:N?N(ce):S(u,{style:[ct.bubbleText,{color:gt},Q],numberOfLines:1,children:I(ce)})}),S(c,{style:[ct.bubbleCaret,{backgroundColor:bt}]})]}):null})}),pt?S(d,{gesture:_t,children:S(h.View,{style:[ct.thumb,{width:it.thumbDiameter,height:it.thumbDiameter,borderRadius:ae,...H,opacity:L?.55:1},ie,K,se],accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants",children:P?O(h.View,{style:[ct.bubbleWrap,ue],pointerEvents:"none",children:[S(c,{style:[ct.bubble,{backgroundColor:bt}],children:N?N(me):S(u,{style:[ct.bubbleText,{color:gt},Q],numberOfLines:1,children:I(me)})}),S(c,{style:[ct.bubbleCaret,{backgroundColor:bt}]})]}):null})}):null]})})})});E.displayName="Slider";const buildStyles=(t,e)=>{const a=t.shadows.md,r=Math.max(e.thumbDiameter,e.trackHeight),i=r/2+4;return l.create({container:{width:"100%",paddingVertical:i,justifyContent:"center"},trackTouch:{width:"100%",justifyContent:"center"},trackWrap:{width:"100%",height:r,justifyContent:"center"},trackClip:{position:"absolute",left:0,right:0,height:e.trackHeight,top:(r-e.trackHeight)/2,borderRadius:e.trackHeight/2,...H,overflow:"hidden"},track:{position:"absolute",top:0,right:0,bottom:0,left:0,borderRadius:e.trackHeight/2,...H},fill:{position:"absolute",top:0,left:0,width:"100%",height:e.trackHeight,borderRadius:e.trackHeight/2,...H,transformOrigin:"left"},thumb:{position:"absolute",top:(r-e.thumbDiameter)/2,left:0,borderWidth:2,shadowColor:a.shadowColor,shadowOffset:a.shadowOffset,shadowOpacity:a.shadowOpacity,shadowRadius:a.shadowRadius,elevation:a.elevation,alignItems:"center",justifyContent:"center"},bubbleWrap:{position:"absolute",bottom:e.thumbDiameter+2,left:e.thumbDiameter/2-80,width:160,alignItems:"center"},bubbleCaret:{width:8,height:8,marginTop:-5,borderRadius:1,...H,transform:[{rotate:"45deg"}]},bubble:{paddingHorizontal:t.spacing.sm,paddingVertical:t.spacing.xxs,borderRadius:t.radius.md,...H,minWidth:36,alignItems:"center",justifyContent:"center",...n.select({ios:{shadowColor:t.shadows.sm.shadowColor,shadowOffset:t.shadows.sm.shadowOffset,shadowOpacity:t.shadows.sm.shadowOpacity,shadowRadius:t.shadows.sm.shadowRadius},android:{elevation:t.shadows.sm.elevation},default:{}})},bubbleText:{color:t.colors.onPrimary,fontSize:t.typography.fontSize.xs,fontWeight:t.typography.fontWeight.semibold}})};export{E as Slider};export default E;
|