@webority/mobile-ui 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/components/BottomSheet/BottomSheet.js +1 -1
- package/lib/commonjs/components/Button/Button.js +1 -1
- package/lib/commonjs/components/Confetti/Confetti.js +1 -1
- package/lib/commonjs/components/Drawer/Drawer.js +1 -1
- package/lib/commonjs/components/ImageGallery/ImageGallery.js +1 -1
- package/lib/commonjs/components/SlideToConfirm/SlideToConfirm.js +1 -1
- package/lib/commonjs/components/Slider/Slider.js +1 -1
- package/lib/commonjs/components/Swipeable/Swipeable.js +1 -1
- package/lib/commonjs/components/ZoomableImage/ZoomableImage.js +1 -1
- package/lib/module/components/Accordion/Accordion.js +1 -1
- package/lib/module/components/Accordion/index.js +1 -1
- package/lib/module/components/AmountSlider/AmountSlider.js +1 -1
- package/lib/module/components/AmountSlider/index.js +1 -1
- package/lib/module/components/AnimatePresence/AnimatePresence.js +1 -1
- package/lib/module/components/AnimatePresence/index.js +1 -1
- package/lib/module/components/AppBar/AppBar.js +1 -1
- package/lib/module/components/AppBar/index.js +1 -1
- package/lib/module/components/AppIcon/AppIcon.js +1 -1
- package/lib/module/components/AppIcon/catalog/bold/a.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/bold/b.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/bold/c.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/bold/d.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/bold/e.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/bold/f.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/bold/g.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/bold/h.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/bold/i.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/bold/j.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/bold/k.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/bold/l.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/bold/m.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/bold/n.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/bold/o.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/bold/p.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/bold/q.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/bold/r.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/bold/s.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/bold/t.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/bold/u.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/bold/v.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/bold/w.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/bold/x.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/bold/y.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/bold/z.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/broken/a.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/broken/b.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/broken/c.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/broken/d.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/broken/e.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/broken/f.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/broken/g.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/broken/h.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/broken/i.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/broken/j.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/broken/k.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/broken/l.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/broken/m.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/broken/n.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/broken/o.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/broken/p.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/broken/q.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/broken/r.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/broken/s.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/broken/t.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/broken/u.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/broken/v.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/broken/w.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/broken/x.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/broken/y.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/broken/z.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/bulk/a.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/bulk/b.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/bulk/c.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/bulk/d.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/bulk/e.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/bulk/f.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/bulk/g.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/bulk/h.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/bulk/i.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/bulk/j.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/bulk/k.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/bulk/l.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/bulk/m.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/bulk/n.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/bulk/o.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/bulk/p.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/bulk/q.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/bulk/r.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/bulk/s.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/bulk/t.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/bulk/u.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/bulk/v.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/bulk/w.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/bulk/x.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/bulk/y.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/bulk/z.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/linear/a.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/linear/b.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/linear/c.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/linear/d.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/linear/e.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/linear/f.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/linear/g.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/linear/h.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/linear/i.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/linear/j.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/linear/k.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/linear/l.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/linear/m.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/linear/n.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/linear/o.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/linear/p.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/linear/q.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/linear/r.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/linear/s.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/linear/t.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/linear/u.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/linear/v.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/linear/w.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/linear/x.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/linear/y.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/linear/z.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/outline/a.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/outline/b.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/outline/c.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/outline/d.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/outline/e.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/outline/f.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/outline/g.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/outline/h.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/outline/i.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/outline/j.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/outline/k.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/outline/l.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/outline/m.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/outline/n.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/outline/o.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/outline/p.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/outline/q.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/outline/r.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/outline/s.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/outline/t.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/outline/u.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/outline/v.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/outline/w.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/outline/x.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/outline/y.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/outline/z.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/twotone/a.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/twotone/b.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/twotone/c.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/twotone/d.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/twotone/e.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/twotone/f.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/twotone/g.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/twotone/h.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/twotone/i.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/twotone/j.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/twotone/k.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/twotone/l.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/twotone/m.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/twotone/n.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/twotone/o.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/twotone/p.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/twotone/q.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/twotone/r.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/twotone/s.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/twotone/t.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/twotone/u.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/twotone/v.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/twotone/w.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/twotone/x.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/twotone/y.g.js +1 -1
- package/lib/module/components/AppIcon/catalog/twotone/z.g.js +1 -1
- package/lib/module/components/AppIcon/catalog.g.js +1 -1
- package/lib/module/components/AppIcon/defaultIcons.js +1 -1
- package/lib/module/components/AppIcon/glyphs.g.js +1 -1
- package/lib/module/components/AppIcon/index.js +1 -1
- package/lib/module/components/AppIcon/slotIcon.js +1 -1
- package/lib/module/components/AppIcon/variants.g.js +1 -1
- package/lib/module/components/AsyncBlock/AsyncBlock.js +1 -1
- package/lib/module/components/AsyncBlock/index.js +1 -1
- package/lib/module/components/AuthedImage/AuthedImage.js +1 -1
- package/lib/module/components/AuthedImage/authedImageCache.js +1 -1
- package/lib/module/components/AuthedImage/index.js +1 -1
- package/lib/module/components/Autocomplete/Autocomplete.js +1 -1
- package/lib/module/components/Autocomplete/index.js +1 -1
- package/lib/module/components/Avatar/Avatar.js +1 -1
- package/lib/module/components/Avatar/index.js +1 -1
- package/lib/module/components/Badge/Badge.js +1 -1
- package/lib/module/components/Badge/index.js +1 -1
- package/lib/module/components/Banner/Banner.js +1 -1
- package/lib/module/components/Banner/index.js +1 -1
- package/lib/module/components/BottomNavigation/BottomNavigation.js +1 -1
- package/lib/module/components/BottomNavigation/index.js +1 -1
- package/lib/module/components/BottomSheet/BottomSheet.js +1 -1
- package/lib/module/components/BottomSheet/index.js +1 -1
- package/lib/module/components/Box/Box.js +1 -1
- package/lib/module/components/Box/index.js +1 -1
- package/lib/module/components/Button/Button.js +1 -1
- package/lib/module/components/Button/index.js +1 -1
- package/lib/module/components/Card/Card.js +1 -1
- package/lib/module/components/Card/index.js +1 -1
- package/lib/module/components/Carousel/Carousel.js +1 -1
- package/lib/module/components/Carousel/index.js +1 -1
- package/lib/module/components/Checkbox/Checkbox.js +1 -1
- package/lib/module/components/Checkbox/index.js +1 -1
- package/lib/module/components/Chip/Chip.js +1 -1
- package/lib/module/components/Chip/index.js +1 -1
- package/lib/module/components/ChoiceGroup/ChoiceGroup.js +1 -1
- package/lib/module/components/ChoiceGroup/index.js +1 -1
- package/lib/module/components/Confetti/Confetti.js +1 -1
- package/lib/module/components/Confetti/index.js +1 -1
- package/lib/module/components/DatePicker/DatePicker.js +1 -1
- package/lib/module/components/DatePicker/index.js +1 -1
- package/lib/module/components/DateRangePicker/DateRangePicker.js +1 -1
- package/lib/module/components/DateRangePicker/index.js +1 -1
- package/lib/module/components/DecimalInput/DecimalInput.js +1 -1
- package/lib/module/components/DecimalInput/index.js +1 -1
- package/lib/module/components/Descriptions/Descriptions.js +1 -1
- package/lib/module/components/Descriptions/index.js +1 -1
- package/lib/module/components/Dialog/Dialog.js +1 -1
- package/lib/module/components/Dialog/index.js +1 -1
- package/lib/module/components/Divider/Divider.js +1 -1
- package/lib/module/components/Divider/index.js +1 -1
- package/lib/module/components/Drawer/Drawer.js +1 -1
- package/lib/module/components/Drawer/index.js +1 -1
- package/lib/module/components/EmptyState/EmptyState.js +1 -1
- package/lib/module/components/EmptyState/index.js +1 -1
- package/lib/module/components/ErrorBoundary/ErrorBoundary.js +1 -1
- package/lib/module/components/ErrorBoundary/index.js +1 -1
- package/lib/module/components/ErrorBoundary/useErrorHandler.js +1 -1
- package/lib/module/components/ErrorBoundary/withErrorBoundary.js +1 -1
- package/lib/module/components/FieldBase/Chevron.js +1 -1
- package/lib/module/components/FieldBase/ChoiceText.js +1 -1
- package/lib/module/components/FieldBase/FieldBase.js +1 -1
- package/lib/module/components/FieldBase/index.js +1 -1
- package/lib/module/components/FieldBase/useFloatingLabel.js +1 -1
- package/lib/module/components/FilePicker/FilePicker.js +1 -1
- package/lib/module/components/FilePicker/index.js +1 -1
- package/lib/module/components/FileViewer/FileViewer.js +1 -1
- package/lib/module/components/FileViewer/index.js +1 -1
- package/lib/module/components/FloatingActionButton/FloatingActionButton.js +1 -1
- package/lib/module/components/FloatingActionButton/index.js +1 -1
- package/lib/module/components/ForceUpdateDialog/ForceUpdateDialog.js +1 -1
- package/lib/module/components/ForceUpdateDialog/index.js +1 -1
- package/lib/module/components/FormField/FormField.js +1 -1
- package/lib/module/components/FormField/index.js +1 -1
- package/lib/module/components/IconBadge/IconBadge.js +1 -1
- package/lib/module/components/IconBadge/index.js +1 -1
- package/lib/module/components/IconButton/IconButton.js +1 -1
- package/lib/module/components/IconButton/index.js +1 -1
- package/lib/module/components/ImageGallery/ImageGallery.js +1 -1
- package/lib/module/components/ImageGallery/index.js +1 -1
- package/lib/module/components/InlineSelect/InlineSelect.js +1 -1
- package/lib/module/components/InlineSelect/index.js +1 -1
- package/lib/module/components/Input/Input.js +1 -1
- package/lib/module/components/Input/index.js +1 -1
- package/lib/module/components/KeyboardAwareScrollView/KeyboardAwareScrollView.js +1 -1
- package/lib/module/components/KeyboardAwareScrollView/index.js +1 -1
- package/lib/module/components/KeyboardToolbar/KeyboardToolbar.js +1 -1
- package/lib/module/components/KeyboardToolbar/index.js +1 -1
- package/lib/module/components/ListItem/ListItem.js +1 -1
- package/lib/module/components/ListItem/index.js +1 -1
- package/lib/module/components/LoaderOverlay/LoaderOverlay.js +1 -1
- package/lib/module/components/LoaderOverlay/index.js +1 -1
- package/lib/module/components/Markdown/Markdown.js +1 -1
- package/lib/module/components/Markdown/index.js +1 -1
- package/lib/module/components/Markdown/parse.js +1 -1
- package/lib/module/components/Modal/Modal.js +1 -1
- package/lib/module/components/Modal/index.js +1 -1
- package/lib/module/components/Notation/Notation.js +1 -1
- package/lib/module/components/Notation/index.js +1 -1
- package/lib/module/components/NumberInput/NumberInput.js +1 -1
- package/lib/module/components/NumberInput/index.js +1 -1
- package/lib/module/components/OTPInput/OTPInput.js +1 -1
- package/lib/module/components/OTPInput/index.js +1 -1
- package/lib/module/components/OptionSheet/OptionSheet.js +1 -1
- package/lib/module/components/OptionSheet/index.js +1 -1
- package/lib/module/components/PhoneNumberInput/PhoneNumberInput.js +1 -1
- package/lib/module/components/PhoneNumberInput/index.js +1 -1
- package/lib/module/components/PickerTrigger/PickerTrigger.js +1 -1
- package/lib/module/components/PickerTrigger/index.js +1 -1
- package/lib/module/components/ProfileCompletion/ProfileCompletion.js +1 -1
- package/lib/module/components/ProfileCompletion/index.js +1 -1
- package/lib/module/components/ProfilePicker/ProfilePicker.js +1 -1
- package/lib/module/components/ProfilePicker/index.js +1 -1
- package/lib/module/components/ProgressBar/ProgressBar.js +1 -1
- package/lib/module/components/ProgressBar/index.js +1 -1
- package/lib/module/components/ProgressRing/ProgressRing.js +1 -1
- package/lib/module/components/ProgressRing/index.js +1 -1
- package/lib/module/components/Radio/Radio.js +1 -1
- package/lib/module/components/Radio/RadioDot.js +1 -1
- package/lib/module/components/Radio/RadioGroup.js +1 -1
- package/lib/module/components/Radio/index.js +1 -1
- package/lib/module/components/Rating/Rating.js +1 -1
- package/lib/module/components/Rating/index.js +1 -1
- package/lib/module/components/Repeater/Repeater.js +1 -1
- package/lib/module/components/Repeater/index.js +1 -1
- package/lib/module/components/RichTextEditor/RichTextEditor.js +1 -1
- package/lib/module/components/RichTextEditor/index.js +1 -1
- package/lib/module/components/RichTextEditor/markdownActions.js +1 -1
- package/lib/module/components/SearchBar/SearchBar.js +1 -1
- package/lib/module/components/SearchBar/index.js +1 -1
- package/lib/module/components/SectionHeader/SectionHeader.js +1 -1
- package/lib/module/components/SectionHeader/index.js +1 -1
- package/lib/module/components/SegmentedControl/SegmentedControl.js +1 -1
- package/lib/module/components/SegmentedControl/index.js +1 -1
- package/lib/module/components/Select/Select.js +1 -1
- package/lib/module/components/Select/index.js +1 -1
- package/lib/module/components/Skeleton/Skeleton.js +1 -1
- package/lib/module/components/Skeleton/SkeletonClock.js +1 -1
- package/lib/module/components/Skeleton/SkeletonContent.js +1 -1
- package/lib/module/components/Skeleton/SkeletonList.js +1 -1
- package/lib/module/components/Skeleton/SkeletonProvider.js +1 -1
- package/lib/module/components/Skeleton/SkeletonSkip.js +1 -1
- package/lib/module/components/Skeleton/index.js +1 -1
- package/lib/module/components/SlideToConfirm/SlideToConfirm.js +1 -1
- package/lib/module/components/SlideToConfirm/index.js +1 -1
- package/lib/module/components/Slider/Slider.js +1 -1
- package/lib/module/components/Slider/index.js +1 -1
- package/lib/module/components/Slider/valueText.js +1 -1
- package/lib/module/components/SliderField/SliderField.js +1 -1
- package/lib/module/components/SliderField/index.js +1 -1
- package/lib/module/components/Spinner/Spinner.js +1 -1
- package/lib/module/components/Spinner/index.js +1 -1
- package/lib/module/components/SquircleFill/SquircleFill.js +1 -1
- package/lib/module/components/StatTile/StatTile.js +1 -1
- package/lib/module/components/StatTile/index.js +1 -1
- package/lib/module/components/StatusBadge/StatusBadge.js +1 -1
- package/lib/module/components/StatusBadge/index.js +1 -1
- package/lib/module/components/Stepper/Stepper.js +1 -1
- package/lib/module/components/Stepper/index.js +1 -1
- package/lib/module/components/Swipeable/Swipeable.js +1 -1
- package/lib/module/components/Swipeable/index.js +1 -1
- package/lib/module/components/Switch/Switch.js +1 -1
- package/lib/module/components/Switch/index.js +1 -1
- package/lib/module/components/Tabs/Tabs.js +1 -1
- package/lib/module/components/Tabs/index.js +1 -1
- package/lib/module/components/TagInput/TagInput.js +1 -1
- package/lib/module/components/TagInput/index.js +1 -1
- package/lib/module/components/Text/Text.js +1 -1
- package/lib/module/components/Text/index.js +1 -1
- package/lib/module/components/TimePicker/TimePicker.js +1 -1
- package/lib/module/components/TimePicker/index.js +1 -1
- package/lib/module/components/Timeline/Timeline.js +1 -1
- package/lib/module/components/Timeline/index.js +1 -1
- package/lib/module/components/Toast/Toast.js +1 -1
- package/lib/module/components/Toast/ToastProvider.js +1 -1
- package/lib/module/components/Toast/index.js +1 -1
- package/lib/module/components/Tooltip/Tooltip.js +1 -1
- package/lib/module/components/Tooltip/index.js +1 -1
- package/lib/module/components/Tour/Tour.js +1 -1
- package/lib/module/components/Tour/index.js +1 -1
- package/lib/module/components/ZoomableImage/ZoomableImage.js +1 -1
- package/lib/module/components/ZoomableImage/index.js +1 -1
- package/lib/module/components/index.js +1 -1
- package/lib/module/form/FormContext.js +1 -1
- package/lib/module/form/HookFormField.js +1 -1
- package/lib/module/form/equal.js +1 -1
- package/lib/module/form/index.js +1 -1
- package/lib/module/form/path.js +1 -1
- package/lib/module/form/rules.js +1 -1
- package/lib/module/form/types.js +1 -0
- package/lib/module/form/useField.js +1 -1
- package/lib/module/form/useForm.js +1 -1
- package/lib/module/form/useFormCompletion.js +1 -1
- package/lib/module/form/useHookFormField.js +1 -1
- package/lib/module/hooks/index.js +1 -1
- package/lib/module/hooks/useControllableState.js +1 -1
- package/lib/module/hooks/useDebounce.js +1 -1
- package/lib/module/hooks/useDragToDismiss.js +1 -1
- package/lib/module/hooks/useFlickGuard.js +1 -1
- package/lib/module/hooks/usePressAnimation.js +1 -1
- package/lib/module/hooks/useReducedMotion.js +1 -1
- package/lib/module/hooks/useToggle.js +1 -1
- package/lib/module/index.js +1 -1
- package/lib/module/initUI.js +1 -1
- package/lib/module/network/NetworkStatusBanner.js +1 -1
- package/lib/module/network/index.js +1 -1
- package/lib/module/specs/NativePdfRasterizer.js +1 -1
- package/lib/module/theme/Gradient.js +1 -1
- package/lib/module/theme/ThemeContext.js +1 -1
- package/lib/module/theme/animatedValue.js +1 -1
- package/lib/module/theme/index.js +1 -1
- package/lib/module/theme/merge.js +1 -1
- package/lib/module/theme/textStyle.js +1 -1
- package/lib/module/theme/tokens.js +1 -1
- package/lib/module/theme/types.js +1 -1
- package/lib/module/utils/color.js +1 -1
- package/lib/module/utils/corners.js +1 -1
- package/lib/module/utils/dimensions.js +1 -1
- package/lib/module/utils/feedback.js +1 -1
- package/lib/module/utils/hapticUtils.js +1 -1
- package/lib/module/utils/hashString.js +1 -1
- package/lib/module/utils/index.js +1 -1
- package/lib/module/utils/mergeRefs.js +1 -1
- package/lib/module/utils/responsive.js +1 -1
- package/lib/module/utils/shadows.js +1 -1
- package/lib/module/utils/spacing.js +1 -1
- package/lib/module/utils/squircle.js +1 -1
- package/lib/module/utils/warnUnknownProps.js +1 -1
- package/lib/typescript/commonjs/components/Button/Button.d.ts +5 -0
- package/lib/typescript/module/components/Button/Button.d.ts +5 -0
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
"use strict";import React,{useMemo}from"react";import{useTheme}from"../../theme/index.js";import{RequiredMark}from"../FieldBase/index.js";import{Text}from"../Text/Text.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export const SectionHeader=({children:e,variant:t="title",flush:i=!1,required:r=!1,style:s,testID:o})=>{const a=useTheme(),l=useMemo(()=>({marginTop:i?0:a.spacing.lg,marginBottom:a.spacing.sm}),[a,i]),n="caps"===t?{variant:"overline",color:"tertiary",weight:void 0}:"sub"===t?{variant:"label",color:"primary",weight:"semibold"}:{variant:"title",color:void 0,weight:void 0};return _jsxs(Text,{variant:n.variant,color:n.color,weight:n.weight,accessibilityRole:"header",accessibilityLabel:r&&"string"==typeof e?`${e}, required`:void 0,style:[l,s],testID:o,children:[e,r?_jsx(RequiredMark,{}):null]})};export default SectionHeader;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{default,SectionHeader}from"./SectionHeader.js";
|
|
1
|
+
"use strict";export{default,SectionHeader}from"./SectionHeader.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{forwardRef
|
|
1
|
+
"use strict";import{forwardRef,useCallback,useEffect,useMemo,useRef,useState}from"react";import{Animated,Pressable,StyleSheet,Text,View}from"react-native";import{useControllableState}from"../../hooks/index.js";import{createAnimatedValue,useTheme}from"../../theme/index.js";import{resolveHaptic,triggerHaptic}from"../../utils/index.js";import{smoothCorners}from"../../utils/corners.js";import{renderSlotIcon}from"../AppIcon/slotIcon.js";import{FieldLabel,FieldMessage,hasFieldText}from"../FieldBase/index.js";import{SquircleFill,useSquircle}from"../SquircleFill/SquircleFill.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export const segmentedControlSizes={sm:{height:32,fontSize:12,paddingHorizontal:10,iconSize:14},md:{height:40,fontSize:14,paddingHorizontal:14,iconSize:16},lg:{height:48,fontSize:16,paddingHorizontal:18,iconSize:18}};export const segmentedControlTrackPadding=4;const sizeMap=segmentedControlSizes,TRACK_PADDING=4,SegmentedControl=forwardRef((e,t)=>{const{segments:i,label:o,helperText:r,error:s,value:l,defaultValue:n,onChange:a,size:d="md",fullWidth:c=!0,disabled:m=!1,tone:u="primary",variant:g="segmented",radius:h,haptic:p,accessibilityLabel:f,style:S,containerStyle:b,segmentStyle:y,selectedIndicatorStyle:x,textStyle:z,labelStyle:v,testID:C}=e,[j,w]=useControllableState({value:l,defaultValue:n??i[0]?.value,onChange:a}),F=useTheme(),I=F.components.segmentedControl,k=useMemo(()=>buildStyles(F),[F]),H=sizeMap[d],_={height:I?.[d]?.height??H.height,fontSize:I?.[d]?.fontSize??H.fontSize,paddingHorizontal:I?.[d]?.paddingHorizontal??H.paddingHorizontal,iconSize:I?.[d]?.iconSize??H.iconSize},T="segmented"===g,V="underline"===g,L="pills"===g,M=T?I?.trackPadding??4:0,R=I?.underlineHeight??2,A=I?.pillInset??4,D="number"==typeof h?h:h?F.radius[h]:I?.radius,P=D??F.radius.md,q=void 0===D?F.radius.sm:Math.max(D-M,0),W=D??F.radius.full,E=D??0,[B,N]=useState(0),G=useRef(createAnimatedValue(0)).current,K=Math.max(0,i.findIndex(e=>e.value===j)),O=B>0?(B-2*M)/Math.max(i.length,1):0,X=useCallback((e,t)=>{if(t<=0)return;const i=t*e,o=F.motion.spring.snappy,r=Animated.spring(G,{toValue:i,damping:o.damping,stiffness:o.stiffness,mass:o.mass,overshootClamping:!0,useNativeDriver:!0});return r.start(),r},[F.motion.spring.snappy,G]);useEffect(()=>{if(O>0){const e=X(K,O);return()=>e?.stop()}},[K,O,X]);const J=useCallback(e=>{const t=e.nativeEvent.layout.width;t!==B&&N(t)},[B]),Q=useCallback(e=>{if(m)return;if(e.value===j)return;const t=resolveHaptic(p,"selection");t&&triggerHaptic(t),w(e.value)},[m,w,j,p]),U=T?F.colors.background.elevated:L?F.colors.primaryMuted:F.colors.primary,Y=T?q:L?W:E,Z="neutral"===u?F.colors.text.primary:F.colors.primary,$=F.colors.background.tertiary,ee=useSquircle(T,P,J),te=hasFieldText(o),ie=hasFieldText(s)?s:r,oe=hasFieldText(ie),re=_jsxs(View,{ref:t,accessibilityRole:"radiogroup",accessibilityLabel:f??("string"==typeof o?o:void 0),testID:C,style:[k.track,{height:_.height,opacity:m?.55:1,alignSelf:c?"stretch":"flex-start"},T?{borderRadius:P,...smoothCorners,backgroundColor:ee.active?"transparent":$,padding:M}:V?{borderBottomColor:F.colors.border.secondary,borderBottomWidth:StyleSheet.hairlineWidth}:null,b,S],onLayout:ee.onLayout,children:[ee.active&&ee.size?_jsx(SquircleFill,{width:ee.size.width,height:ee.size.height,radius:P,fill:$}):null,_jsxs(View,{style:k.row,children:[O>0?_jsx(Animated.View,{pointerEvents:"none",style:[k.thumb,T?{top:0,height:_.height-2*M}:L?{top:A,bottom:A}:{bottom:0,height:R},{width:O,borderRadius:Y,...smoothCorners,backgroundColor:U,transform:[{translateX:G}]},x]}):null,i.map(e=>{const t=e.value===j,i=t?Z:F.colors.text.tertiary,o=renderSlotIcon(e.icon,{color:i,size:_.iconSize,selected:t,disabled:m});return _jsxs(Pressable,{onPress:()=>Q(e),disabled:m,accessibilityRole:"radio",accessibilityLabel:e.label,accessibilityState:{selected:t,disabled:m},style:({pressed:e})=>[k.segment,{paddingHorizontal:_.paddingHorizontal,opacity:e&&!t?.7:1},y],children:[o?_jsx(View,{style:k.segmentIcon,children:o}):null,_jsx(Text,{style:[k.segmentLabel,{color:i,fontSize:_.fontSize,fontWeight:t?F.typography.fontWeight.semibold:F.typography.fontWeight.medium},z,v],numberOfLines:1,children:e.label})]},String(e.value))})]})]});return te||oe?_jsxs(View,{style:{alignSelf:c?"stretch":"flex-start"},children:[te?_jsx(FieldLabel,{size:d,children:o}):null,re,oe?_jsx(FieldMessage,{size:d,text:ie,error:hasFieldText(s)}):null]}):re});SegmentedControl.displayName="SegmentedControl";const buildStyles=e=>StyleSheet.create({track:{flexDirection:"row",alignItems:"stretch",position:"relative"},row:{flex:1,flexDirection:"row",alignItems:"stretch",position:"relative",overflow:"hidden"},thumb:{position:"absolute",left:0},segment:{flex:1,flexDirection:"row",alignItems:"center",justifyContent:"center"},segmentIcon:{marginRight:6},segmentLabel:{includeFontPadding:!1}});export{SegmentedControl};export default SegmentedControl;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{default,SegmentedControl}from"./SegmentedControl.js";
|
|
1
|
+
"use strict";export{default,SegmentedControl}from"./SegmentedControl.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
"use strict";import React,{forwardRef,useCallback,useMemo,useState}from"react";import{StyleSheet,Text,View}from"react-native";import{useTheme}from"../../theme/index.js";import{resolveHaptic,triggerHaptic}from"../../utils/index.js";import{renderSlotIcon}from"../AppIcon/slotIcon.js";import{Chevron}from"../FieldBase/Chevron.js";import{FieldBase,FieldLabel,FieldMessage,fieldTextAsString,hasFieldText,RequiredMark,resolveFieldSize,resolveFieldTextStyle,resolveVariantColors}from"../FieldBase/FieldBase.js";import{OptionSheet}from"../OptionSheet/OptionSheet.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const sameSelectValue=(e,l)=>String(e)===String(l),containsValue=(e,l)=>e.some(e=>sameSelectValue(e,l)),Select=forwardRef((e,l)=>{const{options:t,getOptionLabel:i,getOptionValue:o,getOptionDisabled:r,getOptionDescription:s,getOptionIcon:n,placeholder:a,searchable:c=!1,haptic:d,label:u,help:p,title:f,required:S=!1,error:b,helperText:g,prefix:h,numberOfLines:x=1,disabled:m=!1,size:v="md",variant:y,leftIcon:j,rightIcon:F,chevronColor:C,chevronSize:O,borderRadius:T,accessibilityLabel:V,labelStyle:k,style:z,triggerStyle:_,textStyle:I,optionStyle:R,selectedOptionStyle:H,optionTextStyle:w,selectedOptionTextStyle:L,testID:M}=e,D=!0===e.multi,B=useCallback(e=>i?i(e):e.label??"",[i]),P=useCallback(e=>o?o(e):e.value,[o]),q=useCallback(e=>r?r(e):!0===e.disabled,[r]),A=useCallback(e=>s?s(e):e.description,[s]),E=useCallback(e=>n?n(e):e.icon,[n]),N=useTheme(),$=useMemo(()=>buildStyles(N),[N]),G=resolveFieldSize(N,v),J=resolveFieldTextStyle(N,{disabled:m}),K=y??N.components.select?.defaultVariant??N.components.field?.defaultVariant??"outlined",Q=useMemo(()=>{const e=N.components.select?.fillColors?.[K];if(!e)return;const l={};return void 0!==e.idleEmpty&&(l.backgroundIdleEmpty=e.idleEmpty),void 0!==e.idleFilled&&(l.backgroundIdleFilled=e.idleFilled),void 0!==e.focus&&(l.backgroundFocused=e.focus),void 0!==e.error&&(l.backgroundError=e.error),void 0!==e.disabled&&(l.backgroundDisabled=e.disabled),Object.keys(l).length>0?l:void 0},[N.components.select?.fillColors,K]),U=T??N.components.select?.borderRadius,[W,X]=useState(!1),Y=useCallback(l=>{if(D){const t=e.value??[];return containsValue(t,l)}return null!=e.value&&sameSelectValue(e.value,l)},[D,e.value]),Z=useMemo(()=>{if(D){const l=e.value??[];return t.filter(e=>containsValue(l,P(e)))}const l=e.value;if(null==l)return[];const i=t.find(e=>sameSelectValue(P(e),l));return i?[i]:[]},[D,t,e.value,P]),ee=useCallback(()=>{if(m)return;const e=resolveHaptic(d,"selection");e&&triggerHaptic(e),X(!0)},[m,d]),le=useCallback(()=>{X(!1)},[]),te=useCallback(l=>{if(q(l))return;const t=P(l),i=resolveHaptic(d,"selection");if(i&&triggerHaptic(i),D){const l=e.value??[],i=containsValue(l,t)?l.filter(e=>!sameSelectValue(e,t)):[...l,t];return void e.onChange(i)}e.onChange(t),le()},[D,e,le,q,P,d]),ie=0===Z.length?a??"Select…":Z.map(e=>B(e)).join(", "),oe=0===Z.length,re=hasFieldText(b),se=hasFieldText(u),ne=fieldTextAsString(u),ae=Math.round(1.4*G.fontSize),ce={color:m?N.colors.field.iconDisabled:W?N.colors.field.iconFocused:N.colors.field.icon,size:G.iconSize,disabled:m,focused:W,error:re},de=0===Z.length?a??"No selection":`Selected: ${Z.map(e=>B(e)).join(", ")}`,ue=V??`${ne??"Select"}. ${de}`;return _jsxs(View,{style:[$.container,z],testID:M,children:[se?_jsx(FieldLabel,{size:v,required:S,help:p,style:k,children:u}):null,_jsx(View,{ref:l,collapsable:!1,children:_jsxs(FieldBase,{size:v,variant:K,disabled:m,error:re,filled:Z.length>0,onPress:ee,borderRadius:U,fillOverrides:Q,paddingHorizontal:"underline"===K?0:void 0,accessibilityRole:"button",accessibilityLabel:ue,accessibilityState:{disabled:m,expanded:W},style:_,slotAlign:1===x?"center":"top",slotLineHeight:1===x?void 0:ae,leading:j?_jsx(View,{children:renderSlotIcon(j,ce)}):null,trailing:F?_jsx(View,{children:renderSlotIcon(F,ce)}):_jsx(Chevron,{color:C??(m?N.colors.text.disabled:N.colors.text.tertiary),size:O??G.iconSize,open:W,style:$.chevron}),children:[hasFieldText(h)?"string"==typeof h||"number"==typeof h?_jsx(Text,{style:[$.prefix,{color:J.placeholderColor,fontSize:G.fontSize,lineHeight:1===x?void 0:ae,marginRight:N.spacing.xs}],children:h}):_jsx(View,{style:[$.prefixNode,{minHeight:1===x?void 0:ae,justifyContent:"center",marginRight:N.spacing.xs}],children:h}):null,_jsxs(Text,{style:[$.triggerText,{color:oe?J.placeholderColor:J.color,fontSize:G.fontSize,lineHeight:1===x?void 0:ae,...J.weightStyle},I],numberOfLines:x,children:[ie,oe&&S&&!se?_jsx(RequiredMark,{}):null]})]})}),_jsx(FieldMessage,{size:v,error:re,text:re?b:g}),_jsx(OptionSheet,{open:W,onClose:le,title:f??ne,accessibilityLabel:ne??(se?f:void 0)??a??"Options",options:t,labelOf:B,getValue:P,disabledOf:q,descriptionOf:A,iconOf:E,isSelected:Y,onSelect:te,multi:D,searchable:c,optionStyle:R,selectedOptionStyle:H,optionTextStyle:w,selectedOptionTextStyle:L,searchSelectionColor:resolveVariantColors(N,K,Q).borderFocusedRepresentative})]})});Select.displayName="Select";const buildStyles=e=>StyleSheet.create({container:{width:"100%"},label:{includeFontPadding:!1},triggerText:{flex:1,includeFontPadding:!1},errorText:{includeFontPadding:!1},prefix:{flexShrink:0,includeFontPadding:!1},prefixNode:{flexShrink:0},chevron:{marginLeft:8}});export{Select};export default Select;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{default,Select}from"./Select.js";
|
|
1
|
+
"use strict";export{default,Select}from"./Select.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
"use strict";import React,{useMemo,useState}from"react";import{Animated,StyleSheet,View}from"react-native";import{useTheme}from"../../theme/index.js";import{toBackgroundImage}from"../../theme/Gradient.js";import{useScreenDimensions}from"../../utils/index.js";import{smoothCorners}from"../../utils/corners.js";import{useSkeletonClock}from"./SkeletonClock.js";import{useSkeletonDefaults}from"./SkeletonProvider.js";import{jsx as _jsx}from"react/jsx-runtime";const resolveRadius=(e,t)=>"number"==typeof t?t:e.radius[t],resolveWidth=e=>void 0===e?"100%":e,radiusForShape=(e,t,s,o,i)=>{if(void 0!==i)return resolveRadius(e,i);switch(t){case"circle":return"number"==typeof s?Math.min(s,o)/2:o/2;case"rounded":return e.radius.md;default:return e.radius.sm}},Skeleton=({shape:e="rect",width:t="100%",height:s=16,radius:o,variant:i,speed:r,colors:n,style:a,testID:l})=>{const u=useTheme(),m=useSkeletonDefaults(),c=useSkeletonClock(),d=i??m.variant??"shimmer",h=c.enabled?d:"none",p=n?.background??m.colors?.background??u.colors.skeleton.background,S=n?.highlight??m.colors?.highlight??u.colors.skeleton.highlight,{responsive:k}=useScreenDimensions(),g=useMemo(()=>buildStyles(),[]),y=resolveWidth(t),b=k.size(s),x=radiusForShape(u,e,y,b,o),[f,v]=useState(0),j=useMemo(()=>f<=0?0:Math.max(48,.7*f),[f]),w=useMemo(()=>f<=0?0:c.shimmer.interpolate({inputRange:[0,1],outputRange:[-j,f]}),[c.shimmer,j,f]),C=useMemo(()=>"none"===h?null:"pulse"===h?_jsx(Animated.View,{pointerEvents:"none",style:[StyleSheet.absoluteFill,{backgroundColor:S,opacity:c.pulse.interpolate({inputRange:[0,1],outputRange:[0,.55]})}]}):f<=0?null:_jsx(Animated.View,{pointerEvents:"none",style:[g.shimmerBand,{width:j,transform:[{translateX:w}],experimental_backgroundImage:[toBackgroundImage({colors:["transparent",S,"transparent"],locations:[0,.5,1],start:{x:0,y:.5},end:{x:1,y:.5}})]}]}),[h,S,c.pulse,f,g.shimmerBand,j,w]);return _jsx(View,{onLayout:e=>{const t=e.nativeEvent.layout.width;t!==f&&v(t)},accessible:!0,accessibilityLabel:"Loading",accessibilityRole:"progressbar",accessibilityState:{busy:!0},accessibilityLiveRegion:"polite",testID:l,style:[g.base,{width:y,height:b,borderRadius:x,...smoothCorners,backgroundColor:p},a],children:C})};Skeleton.displayName="Skeleton";const SkeletonCircle=({size:e,style:t,...s})=>{const{responsive:o}=useScreenDimensions(),i=o.size(e);return _jsx(Skeleton,{...s,shape:"circle",width:i,height:e,style:t})};SkeletonCircle.displayName="SkeletonCircle";const SkeletonText=({lines:e=3,lastLineWidth:t="60%",spacing:s,fontSize:o=14,variant:i,speed:r,radius:n="sm",width:a="100%",style:l,testID:u})=>{const m=useTheme(),c=s??m.spacing.xs,d=Math.max(1,e);return _jsx(View,{style:l,testID:u,children:Array.from({length:d}).map((e,s)=>_jsx(Skeleton,{shape:"text",width:s===d-1&&d>1?t:a,height:o,radius:n,variant:i,speed:r,style:s<d-1?{marginBottom:c}:void 0},s))})};SkeletonText.displayName="SkeletonText";const buildStyles=()=>StyleSheet.create({base:{overflow:"hidden"},shimmerBand:{position:"absolute",top:0,bottom:0,left:0}});export{Skeleton,SkeletonCircle,SkeletonText};export default Skeleton;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
"use strict";import React,{createContext,useContext,useEffect,useMemo,useRef}from"react";import{Animated,Easing}from"react-native";import{createAnimatedValue}from"../../theme/index.js";import{jsx as _jsx}from"react/jsx-runtime";const SHIMMER_DURATION={slow:1800,normal:1200,fast:800},PULSE_DURATION=1e3,SkeletonClockContext=createContext(null);export const SkeletonClockProvider=({speed:e,enabled:t,variant:n,children:a})=>{const o=useRef(createAnimatedValue(0)).current,r=useRef(createAnimatedValue(0)).current;useEffect(()=>{if(!t)return o.setValue(0),void r.setValue(.5);const n=Animated.loop(Animated.timing(o,{toValue:1,duration:SHIMMER_DURATION[e],easing:Easing.linear,useNativeDriver:!0})),a=Animated.loop(Animated.sequence([Animated.timing(r,{toValue:1,duration:500,easing:Easing.inOut(Easing.ease),useNativeDriver:!0}),Animated.timing(r,{toValue:0,duration:500,easing:Easing.inOut(Easing.ease),useNativeDriver:!0})]));return n.start(),a.start(),()=>{n.stop(),a.stop()}},[e,t,o,r]);const i=useMemo(()=>({shimmer:o,pulse:r,enabled:t}),[o,r,t]);return _jsx(SkeletonClockContext.Provider,{value:i,children:a})};SkeletonClockProvider.displayName="SkeletonClockProvider";export const useSkeletonClock=()=>{const e=useContext(SkeletonClockContext);return e||fallbackClock};const fallbackClock={shimmer:createAnimatedValue(0),pulse:createAnimatedValue(.5),enabled:!1};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
"use strict";import React,{Children,cloneElement,isValidElement,useEffect,useRef}from"react";import{Animated,Image,StyleSheet,Text,View}from"react-native";import{createAnimatedValue}from"../../theme/index.js";import{Skeleton}from"./Skeleton.js";import{useSkeletonDefaults}from"./SkeletonProvider.js";import{SkeletonSkip}from"./SkeletonSkip.js";import{jsx as _jsx,Fragment as _Fragment}from"react/jsx-runtime";const flattenStyle=e=>{if(!e)return{};return StyleSheet.flatten(e)??{}},resolveWidth=(e,t)=>"number"==typeof e?e:"string"!=typeof e||"auto"!==e&&"100%"!==e&&!/^\d+(\.\d+)?%$/.test(e)?t:e,resolveRadius=(e,t)=>"number"==typeof e?e:t,skeletonizeNode=(e,t,i,r,n="r")=>{if(null==e||"boolean"==typeof e)return null;if("string"==typeof e||"number"==typeof e)return _jsx(Skeleton,{shape:"text",width:"60%",height:14,variant:t,speed:i,colors:r},`${n}-text`);if(Array.isArray(e))return Children.map(e,(e,s)=>skeletonizeNode(e,t,i,r,`${n}-${s}`));if(!isValidElement(e))return null;const s=e,o=s.props??{},l=s.type;if(l===SkeletonSkip)return cloneElement(s,{key:`${n}-skip`});if("function"==typeof l||"object"==typeof l){const e=l.Skeleton;if(e){return _jsx(e,{...o},`${n}-self`)}}if(l===Image){const e=flattenStyle(o.style),s=resolveWidth(e.width,"100%"),l="number"==typeof e.height?e.height:120,a=resolveRadius(e.borderRadius,"sm");return _jsx(Skeleton,{width:s,height:l,radius:a,variant:t,speed:i,colors:r,style:{margin:"number"==typeof e.margin?e.margin:void 0}},`${n}-img`)}if(l===Text){const e=flattenStyle(o.style),s="number"==typeof e.fontSize?e.fontSize:14,l=resolveWidth(e.width,"85%");return _jsx(Skeleton,{shape:"text",width:l,height:Math.round(1.15*s),variant:t,speed:i,colors:r,style:{marginVertical:2}},`${n}-txt`)}if(null!=o.children)return cloneElement(s,{key:`${n}-w`},skeletonizeNode(o.children,t,i,r,`${n}-c`));if(l===View){const e=flattenStyle(o.style);if(null!=e.width||null!=e.height){const s=resolveWidth(e.width,"100%"),o="number"==typeof e.height?e.height:20,l=resolveRadius(e.borderRadius,"sm");return _jsx(Skeleton,{width:s,height:o,radius:l,variant:t,speed:i,colors:r},`${n}-vw`)}}return cloneElement(s,{key:`${n}-leaf`})},SkeletonContent=({loading:e,children:t,placeholder:i,variant:r,speed:n,count:s=1,colors:o,fadeDuration:l,style:a,testID:c})=>{const u=useSkeletonDefaults(),d=l??u.fadeDuration??300,f=useRef(e),m=useRef(createAnimatedValue(e?0:1)).current;if(useEffect(()=>{let t;return f.current&&!e?(m.setValue(0),t=Animated.timing(m,{toValue:1,duration:d,useNativeDriver:!0}),t.start()):!f.current&&e&&m.setValue(1),f.current=e,()=>t?.stop()},[e,m,d]),!e)return d<=0?_jsx(_Fragment,{children:t}):_jsx(Animated.View,{style:[a,{opacity:m}],testID:c,children:t});if(void 0!==i){const e=s>1?Array.from({length:s},(e,t)=>_jsx(React.Fragment,{children:i},`sk-ph-${t}`)):i;return _jsx(View,{style:a,testID:c,accessible:!0,accessibilityLabel:"Loading",accessibilityRole:"progressbar",accessibilityState:{busy:!0},accessibilityLiveRegion:"polite",children:e})}const h=s>1?Array.from({length:s},(e,i)=>_jsx(React.Fragment,{children:t},`sk-rep-${i}`)):t;return _jsx(View,{style:a,testID:c,accessible:!0,accessibilityLabel:"Loading",accessibilityRole:"progressbar",accessibilityState:{busy:!0},accessibilityLiveRegion:"polite",children:skeletonizeNode(h,r,n,o)})};SkeletonContent.displayName="SkeletonContent";export{SkeletonContent};export default SkeletonContent;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
"use strict";import React from"react";import{FlatList,View}from"react-native";import{SkeletonContent}from"./SkeletonContent.js";import{useSkeletonDefaults}from"./SkeletonProvider.js";import{jsx as _jsx}from"react/jsx-runtime";function SkeletonListInner(e){const{loading:t,data:n,renderItem:o,renderPlaceholder:r,placeholderCount:l,variant:s,speed:i,colors:a,placeholderContainerStyle:c,horizontal:m,contentContainerStyle:d,style:u,testID:f,...S}=e,h=useSkeletonDefaults(),p=l??h.placeholderCount??3;if(t){const e=Array.from({length:Math.max(0,p)},(e,t)=>_jsx(React.Fragment,{children:r?r(t):null},`sk-list-${t}`));return _jsx(SkeletonContent,{loading:!0,variant:s,speed:i,colors:a,style:u,testID:f,children:_jsx(View,{style:[m?styles.row:styles.column,c],children:e})})}return _jsx(FlatList,{data:n??[],renderItem:o,horizontal:m,contentContainerStyle:d,style:u,testID:f,...S})}const styles={row:{flexDirection:"row"},column:{flexDirection:"column"}};export const SkeletonList=SkeletonListInner;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
"use strict";import React,{createContext,useContext,useEffect,useMemo,useState}from"react";import{AccessibilityInfo}from"react-native";import{SkeletonClockProvider}from"./SkeletonClock.js";import{jsx as _jsx}from"react/jsx-runtime";const SkeletonDefaultsContext=createContext({});export const SkeletonProvider=({children:e,variant:t,speed:o,placeholderCount:n,radius:r,colors:s,fadeDuration:a,animation:i="auto"})=>{const c=useReduceMotion(),l="always"===i||"never"!==i&&!c,u=o??"normal",d=t??"shimmer",m=useMemo(()=>({variant:t,speed:o,placeholderCount:n,radius:r,colors:s,fadeDuration:a,animation:i}),[t,o,n,r,s,a,i]);return _jsx(SkeletonDefaultsContext.Provider,{value:m,children:_jsx(SkeletonClockProvider,{speed:u,variant:d,enabled:l,children:e})})};SkeletonProvider.displayName="SkeletonProvider";export const useSkeletonDefaults=()=>useContext(SkeletonDefaultsContext);export const useReduceMotion=()=>{const[e,t]=useState(!1);return useEffect(()=>{let e=!0;AccessibilityInfo.isReduceMotionEnabled().then(o=>{e&&t(o)}).catch(()=>{e&&t(!1)});const o=AccessibilityInfo.addEventListener("reduceMotionChanged",e=>{t(e)});return()=>{e=!1,o.remove()}},[]),e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
"use strict";import React from"react";import{Fragment as _Fragment,jsx as _jsx}from"react/jsx-runtime";export const SkeletonSkip=({children:e})=>_jsx(_Fragment,{children:e});SkeletonSkip.displayName="SkeletonSkip";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{default,Skeleton,SkeletonCircle,SkeletonText}from"./Skeleton.js";export{SkeletonClockProvider,useSkeletonClock}from"./SkeletonClock.js";export{SkeletonContent}from"./SkeletonContent.js";export{SkeletonList}from"./SkeletonList.js";export{SkeletonProvider,useReduceMotion,useSkeletonDefaults}from"./SkeletonProvider.js";export{SkeletonSkip}from"./SkeletonSkip.js";
|
|
1
|
+
"use strict";export{default,Skeleton,SkeletonCircle,SkeletonText}from"./Skeleton.js";export{SkeletonClockProvider,useSkeletonClock}from"./SkeletonClock.js";export{SkeletonContent}from"./SkeletonContent.js";export{SkeletonList}from"./SkeletonList.js";export{SkeletonProvider,useReduceMotion,useSkeletonDefaults}from"./SkeletonProvider.js";export{SkeletonSkip}from"./SkeletonSkip.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
"use strict";import React,{forwardRef,useCallback,useMemo,useRef,useState}from"react";import{StyleSheet,Text,View}from"react-native";import{Gesture,GestureDetector}from"react-native-gesture-handler";import Animated,{cancelAnimation,Easing,runOnJS,useAnimatedStyle,useSharedValue,withSpring,withTiming}from"react-native-reanimated";import{useTheme}from"../../theme/index.js";import{resolveHaptic,triggerHaptic}from"../../utils/index.js";import{smoothCorners}from"../../utils/corners.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const SIZE_MAP={sm:{height:44,pad:4},md:{height:56,pad:5},lg:{height:64,pad:6}},Chevron=({color:e,size:t})=>_jsx(View,{style:{width:0,height:0,borderTopWidth:.4*t,borderBottomWidth:.4*t,borderLeftWidth:.55*t,borderTopColor:"transparent",borderBottomColor:"transparent",borderLeftColor:e,marginLeft:.2*t}}),ACCESSIBILITY_ACTIONS=[{name:"activate",label:"Confirm"},{name:"increment",label:"Confirm"}],SlideToConfirm=forwardRef((e,t)=>{const{onConfirm:a,label:i="Slide to confirm",confirmedLabel:r="Confirmed",tone:o="primary",size:n="md",disabled:s=!1,threshold:l=.9,resetAfter:c=!1,haptic:d,icon:u,style:m,trackStyle:h,handleStyle:f,labelStyle:p,testID:b}=e,S=useTheme(),g=SIZE_MAP[n],y=g.height-2*g.pad,v=useMemo(()=>buildStyles(S,g),[S,g]),C=S.colors[o],[x,w]=useState(!1),A=useSharedValue(0),T=useSharedValue(0),j=useSharedValue(0),k=useRef(null),_=useCallback(()=>{const e=resolveHaptic(d,"notificationSuccess");e&&triggerHaptic(e)},[d]),E=useCallback(()=>{w(!1),A.value=withSpring(0,{damping:18,stiffness:160,mass:1})},[A]),I=useCallback(()=>{w(!0),_(),a(),!1!==c&&(k.current&&clearTimeout(k.current),k.current=setTimeout(E,c))},[_,a,c,E]),R=useCallback(e=>{if(s||x)return;const{actionName:t}=e.nativeEvent;"activate"!==t&&"increment"!==t||I()},[s,x,I]);React.useEffect(()=>()=>{cancelAnimation(A),k.current&&clearTimeout(k.current)},[A]);const V=useCallback(e=>{T.value=Math.max(0,e.nativeEvent.layout.width-y-2*g.pad)},[T,y,g.pad]),L=useMemo(()=>{const e=l,t={damping:18,stiffness:160,mass:1},a={duration:S.motion.duration.fast,easing:Easing.out(Easing.cubic)};return Gesture.Pan().enabled(!s&&!x).minDistance(0).onStart(()=>{"worklet";j.value=A.value}).onUpdate(e=>{"worklet";A.value=Math.min(Math.max(j.value+e.translationX,0),T.value)}).onEnd(()=>{"worklet";T.value>0&&A.value>=T.value*e?(A.value=withTiming(T.value,a),runOnJS(I)()):A.value=withSpring(0,t)})},[s,x,l,A,T,j,I,S.motion.duration.fast]),M=useAnimatedStyle(()=>({transform:[{translateX:A.value}]})),z=useAnimatedStyle(()=>({width:A.value+y+g.pad})),D=useAnimatedStyle(()=>{const e=T.value>0?T.value:1;return{opacity:Math.max(0,1-A.value/(.6*e))}});return _jsxs(View,{ref:t,style:[v.track,{backgroundColor:S.colors.background.secondary},h,m],onLayout:V,testID:b,accessibilityRole:"adjustable",accessibilityLabel:x?r:i,accessibilityState:{disabled:s},accessibilityActions:ACCESSIBILITY_ACTIONS,onAccessibilityAction:R,children:[_jsx(Animated.View,{style:[v.fill,{backgroundColor:C,opacity:s?.5:1},z],pointerEvents:"none"}),_jsx(Animated.View,{style:[v.labelWrap,D],pointerEvents:"none",children:_jsx(Text,{style:[v.label,{color:S.colors.text.secondary,fontSize:S.typography.fontSize.base},p],numberOfLines:1,children:x?r:i})}),_jsx(GestureDetector,{gesture:L,children:_jsx(Animated.View,{style:[v.handle,{width:y,height:y,borderRadius:y/2,...smoothCorners,backgroundColor:S.colors.background.elevated,opacity:s?.5:1,...S.shadows.sm},f,M],children:u??_jsx(Chevron,{color:C,size:.5*y})})})]})});SlideToConfirm.displayName="SlideToConfirm";const buildStyles=(e,t)=>StyleSheet.create({track:{height:t.height,borderRadius:t.height/2,...smoothCorners,justifyContent:"center",overflow:"hidden",padding:t.pad},fill:{position:"absolute",left:0,top:0,bottom:0,borderRadius:t.height/2,...smoothCorners},labelWrap:{position:"absolute",left:t.height,right:t.height},label:{textAlign:"center",includeFontPadding:!1},handle:{alignItems:"center",justifyContent:"center"}});export{SlideToConfirm};export default SlideToConfirm;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{SlideToConfirm}from"./SlideToConfirm.js";
|
|
1
|
+
"use strict";export{SlideToConfirm}from"./SlideToConfirm.js";
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
1
|
+
"use strict";import{forwardRef,useCallback,useEffect,useMemo,useRef,useState}from"react";import{Platform,Pressable,StyleSheet,Text,View}from"react-native";import{Gesture,GestureDetector}from"react-native-gesture-handler";import Animated,{cancelAnimation,Easing,runOnJS,useAnimatedStyle,useSharedValue,withSpring,withTiming}from"react-native-reanimated";import{useControllableState}from"../../hooks/index.js";import{useTheme}from"../../theme/index.js";import{resolveHaptic,triggerHaptic}from"../../utils/index.js";import{smoothCorners}from"../../utils/corners.js";import{sliderToneInk}from"./valueText.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const SIZE_MAP={sm:{trackHeight:4,thumbDiameter:24},md:{trackHeight:6,thumbDiameter:28},lg:{trackHeight:8,thumbDiameter:32}},VARIANT_SIZE_MAP={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}}},INSET_RING_RATIO=.3,MIN_THUMB_TOUCH=44,TONE_TO_COLOR_KEY={primary:"primary",success:"success",warning:"warning",error:"error"},clamp=(e,t,a)=>Math.min(Math.max(e,t),a),snapToStep=(e,t,a,r)=>{if(r<=0)return clamp(e,t,a);const i=Math.round((e-t)/r)*r+t,s=String(r).split(".")[1]?.length??0,n=s>0?Number(i.toFixed(s)):i;return clamp(n,t,a)},BUBBLE_GAP=2,BUBBLE_CARET=8,BUBBLE_WRAP_WIDTH=160,NO_SHADOW={shadowOpacity:0,elevation:0},defaultFormatLabel=e=>String(e),Slider=forwardRef((e,t)=>{const{min:a=0,max:r=100,step:i=1,disabled:s=!1,tone:n="primary",size:o="md",variant:l="default",showLabel:u=!1,snapThumb:c=!1,formatLabel:m=defaultFormatLabel,renderLabel:d,accessibilityLabel:h,haptic:b,style:g,containerStyle:p,trackStyle:f,fillStyle:y,thumbStyle:v,labelStyle:w,thumbPressScale:S,labelShowDuration:k,labelOpacity:C,testID:x}=e,_=useTheme(),A=_.components.slider,D=A?.[o],M=useMemo(()=>"default"===l?{trackHeight:D?.trackHeight??SIZE_MAP[o].trackHeight,thumbDiameter:D?.thumbDiameter??SIZE_MAP[o].thumbDiameter}:VARIANT_SIZE_MAP[l][o],[D,o,l]),H="inset"===l?M.trackHeight/2:0,O=A?.thumbPressAnimation??!1,E=S??A?.thumbPressScale??1.1,j=k??A?.labelShowDuration??_.motion.duration.fast,T=C??A?.labelOpacity??1,V=useMemo(()=>buildStyles(_,M),[_,M]),R=useMemo(()=>({damping:_.motion.spring.snappy.damping,stiffness:_.motion.spring.snappy.stiffness,mass:_.motion.spring.snappy.mass}),[_.motion.spring.snappy]),[I,P]=useState(0),W=_.colors[TONE_TO_COLOR_KEY[n]],L=sliderToneInk(_,n),N=!0===e.range,[X,B]=useControllableState({value:e.value,defaultValue:e.defaultValue??(N?[a,r]:a),onChange:e.onChange}),F=useSharedValue(0),G=useSharedValue(0),J=useSharedValue(N?X[0]:X),U=useSharedValue(N?X[1]:X),z=useSharedValue(0),Z=useSharedValue(0),K=useSharedValue(1),Y=useSharedValue(1),$="always"===u,q=useSharedValue($?1:0),Q=useSharedValue($?1:0),ee=useMemo(()=>{const e=String(i).split(".")[1]?.length??0;return Math.pow(10,e)},[i]);useEffect(()=>()=>{cancelAnimation(F),cancelAnimation(G),cancelAnimation(K),cancelAnimation(Y),cancelAnimation(q),cancelAnimation(Q)},[F,G,K,Y,q,Q]);const te=useCallback((e,t)=>{const i=t-2*H;return r===a||i<=0?H:H+(e-a)/(r-a)*i},[a,r,H]),ae=useCallback((e,t)=>{const s=t-2*H;if(s<=0)return a;const n=clamp((e-H)/s,0,1);return snapToStep(a+n*(r-a),a,r,i)},[a,r,i,H]),re=useRef(!1),ie=_.motion.duration.fast,se=useRef(X);se.current=X;const ne=useRef(I);ne.current=I;const oe=useCallback((e=!1)=>{const t=ne.current;if(t<=0)return;const place=t=>e?withTiming(t,{duration:ie,easing:Easing.out(Easing.cubic)}):t,a=se.current;if(N){const[e,r]=a,i=Math.min(e,r),s=Math.max(e,r);J.value=i,U.value=s,F.value=place(te(i,t)),G.value=place(te(s,t))}else{const e=a;J.value=e,U.value=e,F.value=place(te(e,t))}},[N,te,J,U,F,G,ie]),[le,ue]=useState(0),ce=useRef(!1),me=useCallback(e=>{re.current=e,e||(ce.current=!0,ue(e=>e+1))},[]);useEffect(()=>{if(re.current)return;const e=ce.current;ce.current=!1,oe(e)},[JSON.stringify(X),I,le,oe]);const de=useCallback(e=>{const t=e.nativeEvent.layout.width;Z.value=t,P(t)},[Z]),he=useCallback((e,t)=>{B(N?[e,t]:e)},[N,B]),be=useCallback(()=>{const e=resolveHaptic(b,"selection");e&&triggerHaptic(e)},[b]),ge=useRef(he);ge.current=he;const pe=useRef(be);pe.current=be;const fe=useCallback((e,t)=>ge.current(e,t),[]),ye=useCallback(()=>pe.current(),[]),ve=Math.max(0,(44-M.thumbDiameter)/2),we=ve>0?ve:void 0,Se=useCallback(e=>{const t="low"===e?F:G,n="low"===e?J:U,o="low"===e?U:J,l="low"===e?K:Y,m="low"===e?q:Q,d="low"===e,h=a,b=r,g=i,p=ee,f=N,y=E,v=O,w=!0===u,S=c,k=T,C=j,x=R,_=H,follow=e=>{"worklet";const a=Z.value-2*_;if(a<=0||!Number.isFinite(e))return;const r=Math.min(Math.max(z.value+e,_),Z.value-_);let i=h+(r-_)/a*(b-h);g>0&&(i=Math.round((i-h)/g)*g+h,i=Math.round(i*p)/p),i=Math.min(Math.max(i,h),b),f&&(d&&i>o.value&&(i=o.value),!d&&i<o.value&&(i=o.value)),t.value=S||b===h?b===h?_:_+(i-h)/(b-h)*a:f?d?Math.min(r,G.value):Math.max(r,F.value):r,i!==n.value&&(n.value=i,i!==h&&i!==b||runOnJS(ye)(),runOnJS(fe)(J.value,U.value))},A=Gesture.Pan().enabled(!s).minDistance(0);return(void 0===we?A:A.hitSlop(we)).onStart(()=>{"worklet";runOnJS(me)(!0),z.value=t.value,v&&(l.value=withSpring(y,x)),w&&(m.value=withTiming(k,{duration:C,easing:Easing.out(Easing.cubic)})),runOnJS(ye)()}).onUpdate(e=>{"worklet";follow(e.translationX)}).onEnd(e=>{"worklet";follow(e.translationX),v&&(l.value=withSpring(1,x)),w&&(m.value=withTiming(0,{duration:C,easing:Easing.out(Easing.cubic)}))}).onFinalize(()=>{"worklet";runOnJS(me)(!1)})},[s,a,r,i,ee,N,E,O,u,c,T,j,R,H,we,fe,ye,me,F,G,J,U,K,Y,q,Q,z,Z]),ke=useMemo(()=>Se("low"),[Se]),Ce=useMemo(()=>Se("high"),[Se]),xe=useCallback(e=>{if(s||N||I<=0)return;const t=clamp(e.nativeEvent.locationX,0,I),a=ae(t,I);a!==J.value&&(be(),J.value=a,F.value=withTiming(te(a,I),{duration:_.motion.duration.fast,easing:Easing.out(Easing.cubic)}),he(a,a))},[s,N,I,ae,te,he,be,F,J,_.motion.duration.fast]),_e=useCallback(e=>{if(s)return;const t="increment"===e.nativeEvent.actionName?i:-i,n=i>0?Math.round(t*ee)/ee:t;if(N){const e=Math.round((J.value+n)*ee)/ee,t=clamp(e,a,U.value);t!==J.value&&(J.value=t,F.value=te(t,I),be(),he(t,U.value))}else{const e=Math.round((J.value+n)*ee)/ee,t=clamp(e,a,r);t!==J.value&&(J.value=t,F.value=te(t,I),be(),he(t,t))}},[s,i,ee,N,a,r,te,I,F,J,U,he,be]),Ae=M.thumbDiameter/2,De=s?_.colors.surface.disabled:W,Me="inset"===l?{backgroundColor:De,borderColor:_.colors.background.elevated,borderWidth:Math.max(2,Math.round(.3*M.thumbDiameter)),...NO_SHADOW}:"minimal"===l?{backgroundColor:De,borderWidth:0}:"bar"===l?{backgroundColor:"transparent",borderWidth:0,...NO_SHADOW}:{backgroundColor:_.colors.background.elevated,borderColor:De},He=useAnimatedStyle(()=>{const e=Z.value;if(e<=0)return{opacity:0,transform:[{translateX:0},{scaleX:1}]};const t=s?.55:1;if(N){const a=Math.max(0,G.value-F.value+2*H);return{opacity:t,transform:[{translateX:F.value-H},{scaleX:a/e}]}}return{opacity:t,transform:[{translateX:F.value+H-e},{scaleX:1}]}}),Oe=useAnimatedStyle(()=>({transform:[{translateX:F.value-Ae},{scale:K.value}]})),Ee=useAnimatedStyle(()=>({transform:[{translateX:G.value-Ae},{scale:Y.value}]})),je=useAnimatedStyle(()=>({opacity:q.value})),Te=useAnimatedStyle(()=>({opacity:Q.value})),clampDisplay=e=>clamp(e,a,r),Ve=clampDisplay(N?Math.min(...X):X),Re=clampDisplay(N?Math.max(...X):X);return _jsx(View,{ref:t,style:[V.container,p,g],testID:x,accessibilityRole:"adjustable",accessibilityLabel:h,accessibilityState:{disabled:s},accessibilityValue:N?{min:a,max:r,now:Ve,text:`${Ve} to ${Re}`}:{min:a,max:r,now:Ve},accessibilityActions:[{name:"increment"},{name:"decrement"}],onAccessibilityAction:_e,children:_jsx(Pressable,{onPress:xe,disabled:s||N,style:V.trackTouch,accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants",children:_jsxs(View,{style:V.trackWrap,onLayout:de,children:[_jsxs(View,{style:V.trackClip,pointerEvents:"none",children:[_jsx(View,{style:[V.track,{backgroundColor:s?_.colors.surface.disabled:_.colors.border.primary},f]}),_jsx(Animated.View,{style:[V.fill,{backgroundColor:s?_.colors.surface.disabled:W},y,He]})]}),_jsx(GestureDetector,{gesture:ke,children:_jsx(Animated.View,{style:[V.thumb,{width:M.thumbDiameter,height:M.thumbDiameter,borderRadius:Ae,...smoothCorners,opacity:s?.55:1},Me,v,Oe],accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants",children:u?_jsxs(Animated.View,{style:[V.bubbleWrap,je],pointerEvents:"none",children:[_jsx(View,{style:[V.bubble,{backgroundColor:W}],children:d?d(Ve):_jsx(Text,{style:[V.bubbleText,{color:L},w],numberOfLines:1,children:m(Ve)})}),_jsx(View,{style:[V.bubbleCaret,{backgroundColor:W}]})]}):null})}),N?_jsx(GestureDetector,{gesture:Ce,children:_jsx(Animated.View,{style:[V.thumb,{width:M.thumbDiameter,height:M.thumbDiameter,borderRadius:Ae,...smoothCorners,opacity:s?.55:1},Me,v,Ee],accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants",children:u?_jsxs(Animated.View,{style:[V.bubbleWrap,Te],pointerEvents:"none",children:[_jsx(View,{style:[V.bubble,{backgroundColor:W}],children:d?d(Re):_jsx(Text,{style:[V.bubbleText,{color:L},w],numberOfLines:1,children:m(Re)})}),_jsx(View,{style:[V.bubbleCaret,{backgroundColor:W}]})]}):null})}):null]})})})});Slider.displayName="Slider";const buildStyles=(e,t)=>{const a=e.shadows.md,r=Math.max(t.thumbDiameter,t.trackHeight),i=r/2+4;return StyleSheet.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:t.trackHeight,top:(r-t.trackHeight)/2,borderRadius:t.trackHeight/2,...smoothCorners,overflow:"hidden"},track:{position:"absolute",top:0,right:0,bottom:0,left:0,borderRadius:t.trackHeight/2,...smoothCorners},fill:{position:"absolute",top:0,left:0,width:"100%",height:t.trackHeight,borderRadius:t.trackHeight/2,...smoothCorners,transformOrigin:"left"},thumb:{position:"absolute",top:(r-t.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:t.thumbDiameter+2,left:t.thumbDiameter/2-80,width:160,alignItems:"center"},bubbleCaret:{width:8,height:8,marginTop:-5,borderRadius:1,...smoothCorners,transform:[{rotate:"45deg"}]},bubble:{paddingHorizontal:e.spacing.sm,paddingVertical:e.spacing.xxs,borderRadius:e.radius.md,...smoothCorners,minWidth:36,alignItems:"center",justifyContent:"center",...Platform.select({ios:{shadowColor:e.shadows.sm.shadowColor,shadowOffset:e.shadows.sm.shadowOffset,shadowOpacity:e.shadows.sm.shadowOpacity,shadowRadius:e.shadows.sm.shadowRadius},android:{elevation:e.shadows.sm.elevation},default:{}})},bubbleText:{color:e.colors.onPrimary,fontSize:e.typography.fontSize.xs,fontWeight:e.typography.fontWeight.semibold}})};export{Slider};export default Slider;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{default,Slider}from"./Slider.js";
|
|
1
|
+
"use strict";export{default,Slider}from"./Slider.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{memo
|
|
1
|
+
"use strict";import{memo,useEffect,useRef,useState}from"react";import{Animated,Easing,StyleSheet,Text,View}from"react-native";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export const sliderToneInk=(t,e)=>{switch(e){case"success":return t.colors.onSuccess;case"warning":return t.colors.onWarning;case"error":return t.colors.onError;default:return t.colors.onPrimary}};export const clampValue=(t,e,n)=>Math.min(Math.max(t,e),n);export const snapValue=(t,e,n,r)=>{if(r<=0)return clampValue(t,e,n);const o=String(r).split(".")[1]?.length??0,s=Math.round((t-e)/r)*r+e;return clampValue(o>0?Number(s.toFixed(o)):s,e,n)};export const parseTyped=t=>{const e=t.replace(/[^\d.-]/g,"");if(""===e||"."===e||"-"===e)return null;const n=Number.parseFloat(e);return Number.isFinite(n)?n:null};const easeOutCubic=t=>1-(1-t)**3,roundTo=(t,e)=>{const n=10**e;return Math.round(t*n)/n};export const CountingText=memo(({value:t,format:e,decimals:n=2,duration:r,jumpKey:o="",style:s,testID:l})=>{const[a,u]=useState(t),i=useRef(t),c=useRef(o);return useEffect(()=>{const e=c.current!==o;c.current=o;const n=i.current;if(e||r<=0||n===t)return i.current=t,void u(t);const s=Date.now();let l=0;const tick=()=>{const e=Math.min(1,(Date.now()-s)/r),o=n+(t-n)*easeOutCubic(e);i.current=o,u(o),e<1&&(l=requestAnimationFrame(tick))};return l=requestAnimationFrame(tick),()=>cancelAnimationFrame(l)},[t,o,r]),_jsx(Text,{style:s,testID:l,children:e(roundTo(a,n))})});CountingText.displayName="CountingText";export const useValueDraft=({value:t,min:e,max:n,step:r,format:o,parse:s=parseTyped,onChange:l})=>{const[a,u]=useState(null);return{text:a??o(t),editing:null!==a,onFocus:()=>u(o(t)),onChangeText:t=>{u(t);const r=s(t);null!==r&&l(clampValue(r,e,n))},onBlur:()=>{if(null===a)return;const o=s(a);u(null);const i=snapValue(o??e,e,n,r);i!==t&&l(i)}}};const ROLL_TRAVEL_RATIO=1.2,RollingSlot=memo(({text:t,direction:e,duration:n,style:r,testID:o})=>{const[s,l]=useState(null),a=useRef(t),u=useRef(new Animated.Value(1)).current,i=1.2*(StyleSheet.flatten(r)?.fontSize??14);useEffect(()=>{if(a.current===t)return;const e=a.current;if(a.current=t,n<=0)return void l(null);l(e),u.setValue(0);const r=Animated.timing(u,{toValue:1,duration:n,easing:Easing.out(Easing.cubic),useNativeDriver:!0});return r.start(({finished:t})=>{t&&l(null)}),()=>r.stop()},[t,n,u]);const c="up"===e?-1:1,m=null===s?null:{opacity:u,transform:[{translateY:u.interpolate({inputRange:[0,1],outputRange:[-c*i,0]})}]},p={opacity:u.interpolate({inputRange:[0,1],outputRange:[1,0]}),transform:[{translateY:u.interpolate({inputRange:[0,1],outputRange:[0,c*i]})}]};return _jsxs(View,{style:rollStyles.slot,children:[_jsx(Animated.Text,{style:[r,m],testID:o,children:t}),null!==s?_jsx(Animated.Text,{style:[r,rollStyles.leaving,p],testID:o?`${o}-leaving`:void 0,children:s}):null]})});RollingSlot.displayName="RollingSlot";export const RollingText=memo(({text:t,direction:e="up",duration:n,perCharacter:r=!0,style:o,testID:s})=>{const l=useRef(t),a=r?Math.max(t.length,l.current.length):1;return useEffect(()=>{l.current=t},[t]),_jsx(View,{style:rollStyles.row,testID:s,children:r?Array.from({length:a},(r,l)=>_jsx(RollingSlot,{text:t[l]??"",direction:e,duration:n,style:o,testID:s?`${s}-char`:void 0},l)):_jsx(RollingSlot,{text:t,direction:e,duration:n,style:o,testID:s?`${s}-char`:void 0})})});RollingText.displayName="RollingText";const rollStyles=StyleSheet.create({row:{flexDirection:"row",alignItems:"baseline"},slot:{overflow:"hidden"},leaving:{position:"absolute",left:0,top:0}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{forwardRef
|
|
1
|
+
"use strict";import{forwardRef,useCallback,useMemo,useRef}from"react";import{Pressable,StyleSheet,Text,TextInput,View}from"react-native";import{useControllableState}from"../../hooks/index.js";import{useTheme}from"../../theme/index.js";import{AppIcon,renderSlotIcon}from"../AppIcon/index.js";import{FieldBase,FieldLabel,FieldMessage,resolveFieldSize,resolveFieldTextStyle}from"../FieldBase/FieldBase.js";import{IconButton}from"../IconButton/index.js";import{Slider}from"../Slider/index.js";import{CountingText,clampValue,sliderToneInk,snapValue,useValueDraft}from"../Slider/valueText.js";import{Tooltip}from"../Tooltip/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const DEFAULT_INPUT_WIDTH=72,defaultFormatValue=e=>String(e),stepDecimals=e=>String(e).split(".")[1]?.length??0,ValueBox=({draft:e,error:t,disabled:l,width:i,accessibilityLabel:s,style:o,testID:a})=>{const n=useTheme(),r=resolveFieldSize(n,"sm"),d=resolveFieldTextStyle(n,{disabled:l}),c=useRef(null),u=useCallback(()=>{l||c.current?.focus()},[l]);return _jsx(FieldBase,{size:"sm",focused:e.editing,disabled:l,error:t,filled:!0,width:i,onPress:u,pressFeedback:!1,paddingHorizontal:n.spacing.sm,gap:n.spacing.xs,trailing:t?_jsx(AppIcon,{name:"info-circle",size:r.iconSize,color:n.colors.error}):void 0,style:o,children:_jsx(TextInput,{ref:c,style:[styles.boxInput,{color:d.color,fontSize:r.fontSize,...d.weightStyle}],value:e.text,onChangeText:e.onChangeText,onFocus:e.onFocus,onBlur:e.onBlur,onSubmitEditing:e.onBlur,editable:!l,keyboardType:"decimal-pad",returnKeyType:"done",textAlign:"center",selectionColor:n.colors.primary,accessibilityLabel:s,accessibilityState:{disabled:l},testID:a})})},SliderField=forwardRef((e,t)=>{const{label:l,unit:i,info:s,required:o=!1,helperText:a,error:n,min:r=0,max:d=100,step:c=1,disabled:u=!1,tone:p="primary",size:b,variant:m,haptic:x,showBubble:h=!0,showBounds:y=!0,showInput:f=!1,showStepper:g=!1,startIcon:S,endIcon:I,startLabel:j,endLabel:w,formatValue:T=defaultFormatValue,parseInput:_,animationDuration:v,inputWidth:V=DEFAULT_INPUT_WIDTH,accessibilityLabel:z,style:F,labelStyle:D,boundStyle:B,sliderStyle:L,inputStyle:C,testID:$}=e,A=useTheme(),W=useMemo(()=>buildStyles(A),[A]),M=v??A.motion.duration.fast,P=!0===e.range,k=Boolean(n),R=stepDecimals(c),[H,U]=useControllableState({value:e.value,defaultValue:e.defaultValue??(P?[r,d]:r),onChange:e.onChange}),[E,N]=P?H:[H,d],q=clampValue(Math.min(E,N),r,d),K=clampValue(Math.max(E,N),r,d),G=useValueDraft({value:q,min:r,max:d,step:c,format:T,parse:_,onChange:e=>U(P?[Math.min(e,K),K]:e)}),J=useValueDraft({value:K,min:r,max:d,step:c,format:T,parse:_,onChange:e=>U([q,Math.max(e,q)])}),stepBy=e=>{const t=snapValue(q+e*c,r,d,c);t!==q&&U(t)},O={color:u?A.colors.text.disabled:A.colors.text.secondary,size:A.components.field?.md?.iconSize??18,disabled:u},Q=[W.bubbleText,{color:sliderToneInk(A,p),fontWeight:A.typography.fontWeight.semibold}],boundText=e=>_jsx(Text,{style:[W.bound,{color:u?A.colors.text.disabled:A.colors.text.secondary},B],children:e}),X={min:r,max:d,step:c,disabled:u,tone:p,size:b,variant:m,haptic:x,showLabel:!!h&&"always",renderLabel:h?e=>_jsx(CountingText,{value:e,format:T,decimals:R,duration:M,style:Q,testID:$&&!P?`${$}-bubble`:void 0}):void 0,accessibilityLabel:z??l,style:L,testID:$?`${$}-slider`:void 0};return _jsxs(View,{ref:t,style:[W.container,F],testID:$,children:[l?_jsxs(View,{style:W.labelRow,children:[_jsx(FieldLabel,{required:o,style:D,children:l}),i?_jsx(Text,{style:[W.unit,{color:A.colors.text.tertiary}],children:i}):null,s?_jsx(Tooltip,{content:s,trigger:"press",placement:"top",children:_jsx(Pressable,{accessibilityRole:"button",accessibilityLabel:`About ${l}`,hitSlop:8,style:W.infoButton,children:_jsx(AppIcon,{name:"info-circle",variant:"bold",size:16,color:A.colors.text.tertiary})})}):null]}):null,_jsxs(View,{style:[W.row,h?W.rowWithBubble:null],children:[S?_jsx(View,{children:renderSlotIcon(S,O)}):null,g&&!P?_jsx(IconButton,{icon:e=>_jsx(AppIcon,{name:"minus",size:e.size,color:e.color}),onPress:()=>stepBy(-1),accessibilityLabel:"Decrease",variant:"ghost",tone:"neutral",size:"sm",disabled:u||q<=r,haptic:x,testID:$?`${$}-minus`:void 0}):null,P&&f?_jsx(ValueBox,{draft:G,error:k,disabled:u,width:V,accessibilityLabel:`${l??"Value"} low`,style:C,testID:$?`${$}-input-low`:void 0}):y?boundText(j??T(r)):null,_jsx(View,{style:W.sliderWrap,children:_jsx(Slider,P?{...X,range:!0,value:[q,K],onChange:U}:{...X,value:q,onChange:U})}),P&&f?_jsx(ValueBox,{draft:J,error:k,disabled:u,width:V,accessibilityLabel:`${l??"Value"} high`,style:C,testID:$?`${$}-input-high`:void 0}):y?boundText(w??T(d)):null,g&&!P?_jsx(IconButton,{icon:e=>_jsx(AppIcon,{name:"add",size:e.size,color:e.color}),onPress:()=>stepBy(1),accessibilityLabel:"Increase",variant:"ghost",tone:"neutral",size:"sm",disabled:u||q>=d,haptic:x,testID:$?`${$}-plus`:void 0}):null,I?_jsx(View,{children:renderSlotIcon(I,O)}):null,!P&&f?_jsx(ValueBox,{draft:G,error:k,disabled:u,width:V,accessibilityLabel:`${l??"Value"} value`,style:C,testID:$?`${$}-input`:void 0}):null]}),_jsx(FieldMessage,{text:k?n:a,error:k})]})});SliderField.displayName="SliderField";const styles=StyleSheet.create({boxInput:{flex:1,padding:0,margin:0,includeFontPadding:!1}}),buildStyles=e=>StyleSheet.create({container:{width:"100%"},labelRow:{flexDirection:"row",alignItems:"center",gap:e.spacing.xs},unit:{fontSize:e.typography.fontSize.xs},infoButton:{marginLeft:e.spacing.xxs},row:{flexDirection:"row",alignItems:"center",gap:e.spacing.sm},rowWithBubble:{marginTop:e.spacing.lg},sliderWrap:{flex:1,paddingHorizontal:10},bound:{fontSize:e.typography.fontSize.sm,fontVariant:["tabular-nums"]},bubbleText:{fontSize:e.typography.fontSize.xs,fontVariant:["tabular-nums"]}});export{SliderField};export default SliderField;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{default,SliderField}from"./SliderField.js";
|
|
1
|
+
"use strict";export{default,SliderField}from"./SliderField.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
"use strict";import React,{forwardRef,useEffect,useMemo,useRef}from"react";import{ActivityIndicator,Animated,Easing,StyleSheet,Text,View}from"react-native";import{createAnimatedValue,useTheme}from"../../theme/index.js";import{smoothCorners}from"../../utils/corners.js";import{squircleHostRadius}from"../../utils/squircle.js";import{SquircleFill,useSquircle}from"../SquircleFill/SquircleFill.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const sizeMap={sm:20,md:32,lg:48},DOT_COUNT=3,DOT_STAGGER_MS=150,DOT_CYCLE_MS=600,Dot=({size:e,color:t,delay:i,duration:r})=>{const s=useRef(createAnimatedValue(1)).current;return useEffect(()=>{const e=Animated.loop(Animated.sequence([Animated.delay(i),Animated.timing(s,{toValue:1.4,duration:r/2,easing:Easing.out(Easing.quad),useNativeDriver:!0}),Animated.timing(s,{toValue:1,duration:r/2,easing:Easing.in(Easing.quad),useNativeDriver:!0})]));return e.start(),()=>{e.stop()}},[s,i,r]),_jsx(Animated.View,{style:{width:e,height:e,borderRadius:e/2,...smoothCorners,backgroundColor:t,transform:[{scale:s}]}})},Spinner=forwardRef((e,t)=>{const{size:i="md",color:r,message:s,overlay:n=!1,backdropColor:o,variant:a="circular",accessibilityLabel:l,style:c,testID:u}=e,d=useTheme(),m=useRef(createAnimatedValue(0)).current;useEffect(()=>{Animated.timing(m,{toValue:1,duration:d.motion.duration.normal,easing:Easing.bezier(...d.motion.easing.standard),useNativeDriver:!0}).start()},[m,d]);const g=useMemo(()=>buildStyles(d),[d]),y=sizeMap[i],h=r??d.colors.primary,p=o??d.colors.background.overlay,f=useMemo(()=>{if("dots"===a){const e=Math.max(6,Math.round(y/4));return _jsx(View,{style:[g.dotsRow,{gap:Math.round(e/2)}],children:Array.from({length:3}).map((t,i)=>_jsx(Dot,{size:e,color:h,delay:150*i,duration:600},i))})}return _jsx(ActivityIndicator,{color:h,size:"sm"===i?"small":"large",style:{width:y,height:y}})},[a,i,y,h,g.dotsRow]),b=l??s??"Loading",x=useSquircle(n,d.radius.lg),S=x.active&&x.size?{borderRadius:squircleHostRadius(x.size.width,x.size.height,d.radius.lg)}:null,j=_jsxs(Animated.View,{ref:t,accessible:!0,accessibilityRole:"progressbar",accessibilityLiveRegion:"polite",accessibilityLabel:b,accessibilityState:{busy:!0},testID:u,onLayout:x.onLayout,style:[n?g.overlayContent:g.inlineContent,S,{opacity:m}],children:[x.active&&x.size?_jsx(SquircleFill,{width:x.size.width,height:x.size.height,radius:d.radius.lg,fill:d.colors.background.elevated}):null,f,s?_jsx(Text,{style:[g.message,{color:d.colors.text.primary,fontSize:d.typography.fontSize.base,fontWeight:d.typography.fontWeight.medium,marginTop:d.spacing.md}],numberOfLines:2,children:s}):null]});return _jsx(View,n?{pointerEvents:"auto",style:[g.overlay,{backgroundColor:p},c],children:j}:{style:[g.inline,c],children:j})});Spinner.displayName="Spinner";const buildStyles=e=>StyleSheet.create({inline:{alignItems:"center",justifyContent:"center"},inlineContent:{alignItems:"center",justifyContent:"center"},overlay:{...StyleSheet.absoluteFill,alignItems:"center",justifyContent:"center",zIndex:1e3},overlayContent:{alignItems:"center",justifyContent:"center",backgroundColor:e.colors.background.elevated,borderRadius:e.radius.lg,...smoothCorners,paddingHorizontal:e.spacing.xl,paddingVertical:e.spacing.xl,minWidth:140,...e.shadows.lg},dotsRow:{flexDirection:"row",alignItems:"center",justifyContent:"center"},message:{textAlign:"center"}});export{Spinner};export default Spinner;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{default,Spinner}from"./Spinner.js";
|
|
1
|
+
"use strict";export{default,Spinner}from"./Spinner.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useCallback
|
|
1
|
+
"use strict";import{useCallback,useState}from"react";import{Animated,Platform,StyleSheet,View}from"react-native";import Svg,{Path}from"react-native-svg";import{squircleApplies,squirclePath}from"../../utils/squircle.js";import{jsx as _jsx}from"react/jsx-runtime";const AnimatedPath=Animated.createAnimatedComponent(Path);export function SquircleFill({width:t,height:e,radius:i,fill:r,stroke:s,strokeWidth:o=0,outset:l=0,testID:a}){const n=o>0&&void 0!==s&&"transparent"!==s,h=squirclePath({width:t,height:e,radius:i,inset:n?o/2:0});return _jsx(View,{pointerEvents:"none",style:[styles.overlay,l?{top:-l,left:-l,right:-l,bottom:-l}:null],testID:a,children:_jsx(Svg,{width:t,height:e,viewBox:`0 0 ${t} ${e}`,children:_jsx(AnimatedPath,{d:h,fill:r,stroke:n?s:void 0,strokeWidth:n?o:void 0})})})}SquircleFill.displayName="SquircleFill";export function useSquircle(t,e,i){const[r,s]=useState(null),o=t&&"android"===Platform.OS;return{onLayout:useCallback(t=>{if(o){const{width:e,height:i}=t.nativeEvent.layout;s(t=>t&&t.width===e&&t.height===i?t:{width:e,height:i})}i?.(t)},[o,i]),size:r,active:o&&null!==r&&squircleApplies(r.width,r.height,e)}}const styles=StyleSheet.create({overlay:{position:"absolute",top:0,left:0,right:0,bottom:0}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{forwardRef
|
|
1
|
+
"use strict";import{forwardRef}from"react";import{StyleSheet,View}from"react-native";import{useTheme}from"../../theme/index.js";import{Card}from"../Card/index.js";import{IconBadge}from"../IconBadge/index.js";import{Skeleton}from"../Skeleton/index.js";import{Text}from"../Text/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const isText=e=>"string"==typeof e||"number"==typeof e,StatTile=forwardRef((e,t)=>{const{label:i,value:s,icon:r,iconVariant:n,tone:o="primary",caption:l,onPress:a,loading:c=!1,accessibilityLabel:x,style:d,testID:m}=e,h=useTheme(),p=x??(isText(s)?`${i}, ${s}`:void 0);return _jsx(Card,c?{ref:t,variant:"outlined",style:d,testID:m,children:_jsxs(View,{style:[styles.row,{columnGap:h.spacing.md}],children:[void 0===r?null:_jsx(Skeleton,{shape:"circle",width:40,height:40}),_jsxs(View,{style:styles.text,children:[_jsx(Skeleton,{shape:"text",width:"50%",height:12}),_jsx(Skeleton,{shape:"text",width:"35%",height:24,style:{marginTop:h.spacing.xs}})]})]})}:{ref:t,variant:"outlined",onPress:a,accessibilityLabel:p,style:d,testID:m,children:_jsxs(View,{style:[styles.row,{columnGap:h.spacing.md}],children:[void 0===r?null:_jsx(IconBadge,{icon:r,iconVariant:n,tone:o}),_jsxs(View,{style:styles.text,children:[_jsx(Text,{variant:"caption",color:"secondary",numberOfLines:1,children:i}),isText(s)?_jsx(Text,{variant:"h3",numberOfLines:1,children:s}):s,null==l||""===l?null:isText(l)?_jsx(Text,{variant:"caption",color:"tertiary",numberOfLines:1,children:l}):l]})]})})});StatTile.displayName="StatTile";const styles=StyleSheet.create({row:{flexDirection:"row",alignItems:"center"},text:{flex:1,minWidth:0}});export{StatTile};export default StatTile;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{default,StatTile}from"./StatTile.js";
|
|
1
|
+
"use strict";export{default,StatTile}from"./StatTile.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
"use strict";import React,{forwardRef,useMemo}from"react";import{StyleSheet,Text,View}from"react-native";import{fontFor,useTheme}from"../../theme/index.js";import{tintOf}from"../../utils/color.js";import{smoothCorners}from"../../utils/corners.js";import{Skeleton}from"../Skeleton/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const sizeMap={sm:{height:22,paddingH:8,fontSize:11,dot:5,gap:5},md:{height:24,paddingH:10,fontSize:12,dot:6,gap:6}},SOFT_FILL_OPACITY=.14,SOFT_BORDER_OPACITY=.4,BORDER_WIDTH=1,toneFor=(e,t)=>{switch(t){case"success":return{base:e.colors.success,on:e.colors.onSuccess};case"warning":return{base:e.colors.warning,on:e.colors.onWarning};case"error":return{base:e.colors.error,on:e.colors.onError};case"info":return{base:e.colors.info,on:e.colors.onInfo};case"primary":return{base:e.colors.primary,on:e.colors.onPrimary};default:return{base:e.colors.text.secondary,on:e.colors.text.inverse}}},isHex=e=>"string"==typeof e&&/^#[0-9a-f]{6}$/i.test(e),paletteFor=(e,t,o,r)=>{const s=isHex(r),{base:a,on:n}=s?{base:r,on:e.colors.text.inverse}:toneFor(e,t),i=!s&&"neutral"===t,l=i?e.colors.background.tertiary:tintOf(a,.14,e.colors.background.secondary),d=i?e.colors.border.primary:tintOf(a,.4,a);switch(o){case"solid":return{fill:a,border:a,text:n,dot:n};case"outline":return{fill:"transparent",border:i?d:a,text:a,dot:a};default:return{fill:l,border:d,text:a,dot:a}}},StatusBadge=forwardRef((e,t)=>{const{label:o,tone:r="neutral",variant:s="soft",size:a="md",dot:n=!1,color:i,loading:l=!1,accessibilityLabel:d,style:c,textStyle:u,testID:g}=e,f=useTheme(),m=sizeMap[a],b=useMemo(()=>paletteFor(f,r,s,i),[f,r,s,i]);return l?_jsx(StatusBadgeSkeleton,{...e}):_jsxs(View,{ref:t,accessible:!0,accessibilityRole:"text",accessibilityLabel:d??o,testID:g,style:[styles.base,{minHeight:m.height,paddingHorizontal:m.paddingH,borderRadius:f.radius.full,...smoothCorners,backgroundColor:b.fill,borderColor:b.border,borderWidth:1},c],children:[n?_jsx(View,{testID:"status-badge-dot",style:{width:m.dot,height:m.dot,borderRadius:m.dot/2,marginRight:m.gap,backgroundColor:b.dot}}):null,_jsx(Text,{style:[styles.label,{color:b.text,fontSize:m.fontSize,...fontFor(f,"semibold")},u],numberOfLines:1,maxFontSizeMultiplier:f.maxFontSizeMultiplier,children:o})]})});StatusBadge.displayName="StatusBadge";const StatusBadgeSkeleton=({label:e,size:t="md",dot:o,style:r})=>{const s=sizeMap[t],a=Math.max(32,Math.min(120,6.5*(e??"").length))+2*s.paddingH+(o?s.dot+s.gap:0);return _jsx(Skeleton,{width:a,height:s.height,radius:s.height/2,style:[styles.skeleton,r]})};StatusBadgeSkeleton.displayName="StatusBadgeSkeleton",StatusBadge.Skeleton=StatusBadgeSkeleton;const styles=StyleSheet.create({base:{alignSelf:"flex-start",flexDirection:"row",alignItems:"center",justifyContent:"center"},label:{textAlign:"center",includeFontPadding:!1,textAlignVertical:"center"},skeleton:{alignSelf:"flex-start"}});export{StatusBadge};export default StatusBadge;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{default,StatusBadge}from"./StatusBadge.js";
|
|
1
|
+
"use strict";export{default,StatusBadge}from"./StatusBadge.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e,{forwardRef as t,useEffect as o,useMemo as i,useRef as l,useState as n}from"react";import{Animated as r,Easing as s,Pressable as c,StyleSheet as a,Text as p,View as d}from"react-native";import{createAnimatedValue as u,useTheme as h}from"../../theme/index.js";import{smoothCorners as m}from"../../utils/corners.js";import{resolveHaptic as y,triggerHaptic as g}from"../../utils/hapticUtils.js";import{Skeleton as b}from"../Skeleton/index.js";import{jsx as f,jsxs as v}from"react/jsx-runtime";const StepCircle=({index:e,step:t,status:i,toneColor:n,upcomingColor:a,upcomingFillColor:h,textOnColor:y,upcomingTextColor:g,interactive:b,canPress:C,totalSteps:x,onPress:w,circleSize:R,pulseSize:k,pulseEnabled:D,pulseDuration:I,circleSlotStyle:$})=>{const L="active"===i,z=l(u(1)).current,P=l(u(.5)).current;o(()=>{if(!L||!D)return z.setValue(1),void P.setValue(0);const e=r.loop(r.parallel([r.sequence([r.timing(z,{toValue:1.4,duration:I,easing:s.out(s.ease),useNativeDriver:!0}),r.timing(z,{toValue:1,duration:0,useNativeDriver:!0})]),r.sequence([r.timing(P,{toValue:0,duration:I,easing:s.out(s.ease),useNativeDriver:!0}),r.timing(P,{toValue:.5,duration:0,useNativeDriver:!0})])]));return e.start(),()=>e.stop()},[L,z,P,D,I]);const V="upcoming"===i?h:n,F="upcoming"===i?a:n,T="upcoming"===i?g:y,j="complete"===i,B=`Step ${e+1} of ${x}, ${t.label}, ${i}`,A=v(d,{style:S.relative,children:[L&&D?f(r.View,{pointerEvents:"none",style:[S.pulse,{width:k,height:k,borderRadius:k/2,...m,backgroundColor:n,opacity:P,transform:[{scale:z}]}]}):null,f(d,{style:[S.circle,{width:R,height:R,borderRadius:R/2,...m,backgroundColor:V,borderColor:F},$],children:t.icon?t.icon:f(p,j?{style:[S.glyph,{color:T}],children:"✓"}:{style:[S.glyph,{color:T}],children:e+1})})]});return b?f(c,{onPress:()=>w(e),disabled:!C,accessibilityRole:"button",accessibilityLabel:B,accessibilityState:{selected:L,disabled:!C},hitSlop:8,children:A}):f(d,{accessibilityRole:"text",accessibilityLabel:B,accessibilityState:{selected:L},children:A})},S=a.create({relative:{alignItems:"center",justifyContent:"center"},pulse:{position:"absolute"},circle:{borderWidth:2,alignItems:"center",justifyContent:"center"},glyph:{fontSize:12,fontWeight:"600",includeFontPadding:!1}}),C=t((e,t)=>{const{steps:a,activeStep:m,defaultActiveStep:b=0,pressMode:S="none",onStepPress:C,onActiveStepChange:x,variant:w="horizontal",tone:R="primary",formatCaption:k,showCaption:D=!0,loading:I=!1,accessibilityLabel:$,style:L,containerStyle:z,circleStyle:P,labelStyle:V,connectorStyle:F,haptic:T,testID:j}=e,B=h(),A=B.components.stepper,E=A?.circleSize??24,N=A?.pulseSize??32,O=A?.pulseAnimation??!1,W=A?.pulseDuration??1100,q=y(T,"selection"),M=i(()=>buildStyles(B),[B]),G=((e,t)=>"success"===t?e.colors.success:e.colors.primary)(B,R),H=B.colors.border.primary,U=B.colors.background.primary,J=B.colors.text.secondary,K=((e,t)=>"success"===t?e.colors.onSuccess:e.colors.onPrimary)(B,R),Q=a.length,X="none"!==S,Y=void 0!==m,[Z,_]=n(b),ee=Y?m:Z,te=null==ee||ee<0?null:ee,oe=a.map((e,t)=>(e=>null===te?"upcoming":e<te?"complete":e===te?"active":"upcoming")(t)),ie=oe.filter(e=>"upcoming"!==e).length,le=oe.filter(e=>"complete"===e).length,canPressStatus=e=>"back"===S?"complete"===e:X,handleStepPress=e=>{if(!canPressStatus(oe[e]))return;q&&g(q),C?.(e);const t="select"===S&&e===te?null:e;Y||_(t),x?.(t)},ne=l(u(ie)).current,re=l(ie);o(()=>{const e=re.current;if(e===ie)return;re.current=ie;const t=r.timing(ne,{toValue:ie,duration:B.motion.duration.normal*Math.abs(ie-e),easing:s.linear,useNativeDriver:!1});return t.start(),()=>t.stop()},[ie,ne,B.motion]);const sliceOf=e=>ne.interpolate({inputRange:[e,e+1],outputRange:["0%","100%"],extrapolate:"clamp"}),se=Q<=1?"0%":ne.interpolate({inputRange:[1,Q],outputRange:["0%","100%"],extrapolate:"clamp"}),ce=null!==te&&te<Q?te:null,ae=$??(null!==ce?`Progress: step ${ce+1} of ${Q}`:`Progress: ${le} of ${Q} steps done`),[pe,de]=n(0),ue=Q>0&&pe>0?pe/(2*Q):0,he=f(d,{ref:t,style:[M.container,z,L],testID:j,accessibilityRole:"progressbar",accessibilityLabel:ae,accessibilityValue:{min:0,max:Q,now:ie},children:"segmented"===w?(()=>{const e=null!==ce?a[ce]:void 0,t=D?k?k(ce,Q,e):null!==ce?`Step ${ce+1} of ${Q}${e?.label?` · ${e.label}`:""}`:`${le} of ${Q} done`:"";return v(d,{children:[D?f(p,{style:[M.sCaption,{color:B.colors.text.secondary,fontSize:B.typography.fontSize.sm,marginBottom:B.spacing.sm},V],numberOfLines:1,children:t}):null,f(d,{style:M.sRow,children:a.map((e,t)=>{const o=oe[t],i=`Step ${t+1} of ${Q}, ${e.label}, ${o}`,l=f(d,{testID:j?`${j}-segment-${t}`:void 0,style:[M.sTrack,{backgroundColor:H},F],children:f(r.View,{style:[M.sFill,{backgroundColor:G,width:sliceOf(t)}]})});if(X){const n=canPressStatus(o);return f(c,{style:M.sItem,onPress:()=>handleStepPress(t),disabled:!n,accessibilityRole:"button",accessibilityLabel:i,accessibilityState:{selected:"active"===o,disabled:!n},hitSlop:{top:12,bottom:12},children:l},e.key)}return f(d,{style:M.sItem,accessibilityRole:"text",accessibilityLabel:i,accessibilityState:{selected:"active"===o},children:l},e.key)})})]})})():"vertical"===w?f(d,{style:M.vCol,children:a.map((e,t)=>{const o=oe[t],i=t===Q-1;return v(d,{style:M.vRow,children:[v(d,{style:M.vLeft,children:[f(StepCircle,{index:t,step:e,status:o,toneColor:G,upcomingColor:H,upcomingFillColor:U,onPressColor:G,textOnColor:K,upcomingTextColor:J,interactive:X,canPress:canPressStatus(o),totalSteps:Q,onPress:handleStepPress,circleSize:E,pulseSize:N,pulseEnabled:O,pulseDuration:W,circleSlotStyle:P}),i?null:v(d,{style:[M.vConnectorContainer,F],children:[f(d,{style:[M.vConnectorTrack,{backgroundColor:H}]}),f(r.View,{style:[M.vConnectorFill,{backgroundColor:G,height:sliceOf(t+1)}]})]})]}),v(d,{style:M.vBody,children:[f(p,{style:[M.vLabel,{color:"upcoming"===o?B.colors.text.tertiary:B.colors.text.primary,fontSize:B.typography.fontSize.base,fontWeight:B.typography.fontWeight.semibold},V],numberOfLines:1,children:e?.label??" "}),e.description?f(p,{style:[M.vDescription,{color:B.colors.text.secondary,fontSize:B.typography.fontSize.sm}],numberOfLines:3,children:e.description}):null]})]},e.key)})}):v(d,{style:M.hRow,onLayout:e=>de(e.nativeEvent.layout.width),children:[v(d,{pointerEvents:"none",style:[M.hConnectorContainer,{left:ue,right:ue},F],children:[f(d,{style:[M.hConnectorTrack,{backgroundColor:H}]}),f(r.View,{style:[M.hConnectorFill,{backgroundColor:G,width:se}]})]}),a.map((e,t)=>{const o=oe[t];return v(d,{style:M.hStepItem,children:[f(StepCircle,{index:t,step:e,status:o,toneColor:G,upcomingColor:H,upcomingFillColor:U,onPressColor:G,textOnColor:K,upcomingTextColor:J,interactive:X,canPress:canPressStatus(o),totalSteps:Q,onPress:handleStepPress,circleSize:E,pulseSize:N,pulseEnabled:O,pulseDuration:W,circleSlotStyle:P}),f(p,{style:[M.hLabel,{color:"upcoming"===o?B.colors.text.tertiary:B.colors.text.primary,fontSize:B.typography.fontSize.xs},V],numberOfLines:1,children:e?.label??" "})]},e.key)})]})});return I?f(StepperSkeleton,{...e}):he});C.displayName="Stepper";const StepperSkeleton=({steps:e,variant:t="horizontal",showCaption:o=!0,containerStyle:l,style:n,testID:r})=>{const s=h(),c=s.components.stepper,a=c?.circleSize??24,p=i(()=>buildStyles(s),[s]),u=e.length||3;return"segmented"===t?v(d,{style:[p.container,l,n],testID:r,accessibilityRole:"progressbar",accessibilityState:{busy:!0},children:[o?f(b,{shape:"text",width:"45%",height:14,style:{marginBottom:s.spacing.sm}}):null,f(d,{style:p.sRow,children:Array.from({length:u}).map((e,t)=>f(d,{style:p.sItem,children:f(b,{width:"100%",height:4,radius:2})},`sk-step-${t}`))})]}):f(d,"vertical"===t?{style:[p.container,l,n],testID:r,accessibilityRole:"progressbar",accessibilityState:{busy:!0},children:f(d,{style:x.vCol,children:Array.from({length:u}).map((e,t)=>{const o=t===u-1;return v(d,{style:x.vRow,children:[v(d,{style:[x.vLeft,{width:a+8}],children:[f(b,{shape:"circle",width:a,height:a}),o?null:f(b,{width:2,height:36})]}),v(d,{style:x.vBody,children:[f(b,{shape:"text",width:"55%",height:16,style:{marginBottom:4}}),f(b,{shape:"text",width:"80%",height:12})]})]},`sk-step-${t}`)})})}:{style:[p.container,l,n],testID:r,accessibilityRole:"progressbar",accessibilityState:{busy:!0},children:v(d,{style:p.hRow,children:[f(d,{pointerEvents:"none",style:[p.hConnectorContainer,{left:50/u+"%",right:50/u+"%"}],children:f(b,{width:"100%",height:2,radius:1})}),Array.from({length:u}).map((e,t)=>v(d,{style:p.hStepItem,children:[f(b,{shape:"circle",width:a,height:a}),f(b,{shape:"text",width:"80%",height:12,style:{marginTop:s.spacing.xs}})]},`sk-step-${t}`))]})})};StepperSkeleton.displayName="StepperSkeleton",C.Skeleton=StepperSkeleton;const x=a.create({vCol:{flexDirection:"column"},vRow:{flexDirection:"row",alignItems:"flex-start"},vLeft:{alignItems:"center"},vBody:{flex:1,paddingLeft:12,paddingBottom:16}}),buildStyles=e=>a.create({container:{width:"100%"},hRow:{flexDirection:"row",alignItems:"flex-start",justifyContent:"space-between",position:"relative"},hConnectorContainer:{position:"absolute",top:11,height:2,flexDirection:"row",alignItems:"center"},hConnectorTrack:{position:"absolute",left:0,right:0,height:2,borderRadius:1,...m},hConnectorFill:{position:"absolute",left:0,height:2,borderRadius:1,...m},hStepItem:{alignItems:"center",flex:1},hLabel:{marginTop:e.spacing.xs,textAlign:"center"},vCol:{flexDirection:"column"},vRow:{flexDirection:"row",alignItems:"flex-start"},vLeft:{alignItems:"center",alignSelf:"stretch",width:32},vConnectorContainer:{flex:1,width:2,minHeight:32,position:"relative",alignSelf:"center"},vConnectorTrack:{position:"absolute",top:0,bottom:0,width:2,borderRadius:1,...m},vConnectorFill:{position:"absolute",top:0,width:2,borderRadius:1,...m},vBody:{flex:1,paddingLeft:e.spacing.sm,paddingBottom:e.spacing.md},vLabel:{marginBottom:2},vDescription:{},sCaption:{includeFontPadding:!1},sRow:{flexDirection:"row",columnGap:6},sItem:{flex:1},sTrack:{height:4,borderRadius:2,overflow:"hidden"},sFill:{height:4,borderRadius:2}});export{C as Stepper};export default C;
|
|
1
|
+
"use strict";import React,{forwardRef,useEffect,useMemo,useRef,useState}from"react";import{Animated,Easing,Pressable,StyleSheet,Text,View}from"react-native";import{createAnimatedValue,useTheme}from"../../theme/index.js";import{smoothCorners}from"../../utils/corners.js";import{resolveHaptic,triggerHaptic}from"../../utils/hapticUtils.js";import{Skeleton}from"../Skeleton/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const CIRCLE_SIZE=24,SEGMENT_HEIGHT=4,SEGMENT_GAP=6,PULSE_SIZE=32,PULSE_DURATION=1100,toneColorFor=(e,t)=>"success"===t?e.colors.success:e.colors.primary,toneOnColorFor=(e,t)=>"success"===t?e.colors.onSuccess:e.colors.onPrimary,StepCircle=({index:e,step:t,status:i,toneColor:o,upcomingColor:s,upcomingFillColor:l,textOnColor:n,upcomingTextColor:r,interactive:a,canPress:c,totalSteps:p,onPress:u,circleSize:d,pulseSize:h,pulseEnabled:m,pulseDuration:y,circleSlotStyle:g})=>{const S="active"===i,x=useRef(createAnimatedValue(1)).current,b=useRef(createAnimatedValue(.5)).current;useEffect(()=>{if(!S||!m)return x.setValue(1),void b.setValue(0);const e=Animated.loop(Animated.parallel([Animated.sequence([Animated.timing(x,{toValue:1.4,duration:y,easing:Easing.out(Easing.ease),useNativeDriver:!0}),Animated.timing(x,{toValue:1,duration:0,useNativeDriver:!0})]),Animated.sequence([Animated.timing(b,{toValue:0,duration:y,easing:Easing.out(Easing.ease),useNativeDriver:!0}),Animated.timing(b,{toValue:.5,duration:0,useNativeDriver:!0})])]));return e.start(),()=>e.stop()},[S,x,b,m,y]);const f="upcoming"===i?l:o,w="upcoming"===i?s:o,C="upcoming"===i?r:n,v="complete"===i,j=`Step ${e+1} of ${p}, ${t.label}, ${i}`,_=_jsxs(View,{style:circleStyles.relative,children:[S&&m?_jsx(Animated.View,{pointerEvents:"none",style:[circleStyles.pulse,{width:h,height:h,borderRadius:h/2,...smoothCorners,backgroundColor:o,opacity:b,transform:[{scale:x}]}]}):null,_jsx(View,{style:[circleStyles.circle,{width:d,height:d,borderRadius:d/2,...smoothCorners,backgroundColor:f,borderColor:w},g],children:t.icon?t.icon:_jsx(Text,v?{style:[circleStyles.glyph,{color:C}],children:"✓"}:{style:[circleStyles.glyph,{color:C}],children:e+1})})]});return a?_jsx(Pressable,{onPress:()=>u(e),disabled:!c,accessibilityRole:"button",accessibilityLabel:j,accessibilityState:{selected:S,disabled:!c},hitSlop:8,children:_}):_jsx(View,{accessibilityRole:"text",accessibilityLabel:j,accessibilityState:{selected:S},children:_})},circleStyles=StyleSheet.create({relative:{alignItems:"center",justifyContent:"center"},pulse:{position:"absolute"},circle:{borderWidth:2,alignItems:"center",justifyContent:"center"},glyph:{fontSize:12,fontWeight:"600",includeFontPadding:!1}}),Stepper=forwardRef((e,t)=>{const{steps:i,activeStep:o,defaultActiveStep:s=0,pressMode:l="none",onStepPress:n,onActiveStepChange:r,variant:a="horizontal",tone:c="primary",formatCaption:p,showCaption:u=!0,loading:d=!1,accessibilityLabel:h,style:m,containerStyle:y,circleStyle:g,labelStyle:S,connectorStyle:x,haptic:b,testID:f}=e,w=useTheme(),C=w.components.stepper,v=C?.circleSize??24,j=C?.pulseSize??32,_=C?.pulseAnimation??!1,V=C?.pulseDuration??1100,k=resolveHaptic(b,"selection"),R=useMemo(()=>buildStyles(w),[w]),I=toneColorFor(w,c),A=w.colors.border.primary,D=w.colors.background.primary,E=w.colors.text.secondary,L=toneOnColorFor(w,c),T=i.length,$="none"!==l,P=void 0!==o,[z,F]=useState(s),B=P?o:z,N=null==B||B<0?null:B,O=i.map((e,t)=>(e=>null===N?"upcoming":e<N?"complete":e===N?"active":"upcoming")(t)),H=O.filter(e=>"upcoming"!==e).length,M=O.filter(e=>"complete"===e).length,canPressStatus=e=>"back"===l?"complete"===e:$,handleStepPress=e=>{if(!canPressStatus(O[e]))return;k&&triggerHaptic(k),n?.(e);const t="select"===l&&e===N?null:e;P||F(t),r?.(t)},G=useRef(createAnimatedValue(H)).current,U=useRef(H);useEffect(()=>{const e=U.current;if(e===H)return;U.current=H;const t=Animated.timing(G,{toValue:H,duration:w.motion.duration.normal*Math.abs(H-e),easing:Easing.linear,useNativeDriver:!1});return t.start(),()=>t.stop()},[H,G,w.motion]);const sliceOf=e=>G.interpolate({inputRange:[e,e+1],outputRange:["0%","100%"],extrapolate:"clamp"}),W=T<=1?"0%":G.interpolate({inputRange:[1,T],outputRange:["0%","100%"],extrapolate:"clamp"}),q=null!==N&&N<T?N:null,Z=h??(null!==q?`Progress: step ${q+1} of ${T}`:`Progress: ${M} of ${T} steps done`),[J,K]=useState(0),Q=T>0&&J>0?J/(2*T):0,X=_jsx(View,{ref:t,style:[R.container,y,m],testID:f,accessibilityRole:"progressbar",accessibilityLabel:Z,accessibilityValue:{min:0,max:T,now:H},children:"segmented"===a?(()=>{const e=null!==q?i[q]:void 0,t=u?p?p(q,T,e):null!==q?`Step ${q+1} of ${T}${e?.label?` · ${e.label}`:""}`:`${M} of ${T} done`:"";return _jsxs(View,{children:[u?_jsx(Text,{style:[R.sCaption,{color:w.colors.text.secondary,fontSize:w.typography.fontSize.sm,marginBottom:w.spacing.sm},S],numberOfLines:1,children:t}):null,_jsx(View,{style:R.sRow,children:i.map((e,t)=>{const i=O[t],o=`Step ${t+1} of ${T}, ${e.label}, ${i}`,s=_jsx(View,{testID:f?`${f}-segment-${t}`:void 0,style:[R.sTrack,{backgroundColor:A},x],children:_jsx(Animated.View,{style:[R.sFill,{backgroundColor:I,width:sliceOf(t)}]})});if($){const l=canPressStatus(i);return _jsx(Pressable,{style:R.sItem,onPress:()=>handleStepPress(t),disabled:!l,accessibilityRole:"button",accessibilityLabel:o,accessibilityState:{selected:"active"===i,disabled:!l},hitSlop:{top:12,bottom:12},children:s},e.key)}return _jsx(View,{style:R.sItem,accessibilityRole:"text",accessibilityLabel:o,accessibilityState:{selected:"active"===i},children:s},e.key)})})]})})():"vertical"===a?_jsx(View,{style:R.vCol,children:i.map((e,t)=>{const i=O[t],o=t===T-1;return _jsxs(View,{style:R.vRow,children:[_jsxs(View,{style:R.vLeft,children:[_jsx(StepCircle,{index:t,step:e,status:i,toneColor:I,upcomingColor:A,upcomingFillColor:D,onPressColor:I,textOnColor:L,upcomingTextColor:E,interactive:$,canPress:canPressStatus(i),totalSteps:T,onPress:handleStepPress,circleSize:v,pulseSize:j,pulseEnabled:_,pulseDuration:V,circleSlotStyle:g}),o?null:_jsxs(View,{style:[R.vConnectorContainer,x],children:[_jsx(View,{style:[R.vConnectorTrack,{backgroundColor:A}]}),_jsx(Animated.View,{style:[R.vConnectorFill,{backgroundColor:I,height:sliceOf(t+1)}]})]})]}),_jsxs(View,{style:R.vBody,children:[_jsx(Text,{style:[R.vLabel,{color:"upcoming"===i?w.colors.text.tertiary:w.colors.text.primary,fontSize:w.typography.fontSize.base,fontWeight:w.typography.fontWeight.semibold},S],numberOfLines:1,children:e?.label??" "}),e.description?_jsx(Text,{style:[R.vDescription,{color:w.colors.text.secondary,fontSize:w.typography.fontSize.sm}],numberOfLines:3,children:e.description}):null]})]},e.key)})}):_jsxs(View,{style:R.hRow,onLayout:e=>K(e.nativeEvent.layout.width),children:[_jsxs(View,{pointerEvents:"none",style:[R.hConnectorContainer,{left:Q,right:Q},x],children:[_jsx(View,{style:[R.hConnectorTrack,{backgroundColor:A}]}),_jsx(Animated.View,{style:[R.hConnectorFill,{backgroundColor:I,width:W}]})]}),i.map((e,t)=>{const i=O[t];return _jsxs(View,{style:R.hStepItem,children:[_jsx(StepCircle,{index:t,step:e,status:i,toneColor:I,upcomingColor:A,upcomingFillColor:D,onPressColor:I,textOnColor:L,upcomingTextColor:E,interactive:$,canPress:canPressStatus(i),totalSteps:T,onPress:handleStepPress,circleSize:v,pulseSize:j,pulseEnabled:_,pulseDuration:V,circleSlotStyle:g}),_jsx(Text,{style:[R.hLabel,{color:"upcoming"===i?w.colors.text.tertiary:w.colors.text.primary,fontSize:w.typography.fontSize.xs},S],numberOfLines:1,children:e?.label??" "})]},e.key)})]})});return d?_jsx(StepperSkeleton,{...e}):X});Stepper.displayName="Stepper";const StepperSkeleton=({steps:e,variant:t="horizontal",showCaption:i=!0,containerStyle:o,style:s,testID:l})=>{const n=useTheme(),r=n.components.stepper,a=r?.circleSize??24,c=useMemo(()=>buildStyles(n),[n]),p=e.length||3;return"segmented"===t?_jsxs(View,{style:[c.container,o,s],testID:l,accessibilityRole:"progressbar",accessibilityState:{busy:!0},children:[i?_jsx(Skeleton,{shape:"text",width:"45%",height:14,style:{marginBottom:n.spacing.sm}}):null,_jsx(View,{style:c.sRow,children:Array.from({length:p}).map((e,t)=>_jsx(View,{style:c.sItem,children:_jsx(Skeleton,{width:"100%",height:4,radius:2})},`sk-step-${t}`))})]}):_jsx(View,"vertical"===t?{style:[c.container,o,s],testID:l,accessibilityRole:"progressbar",accessibilityState:{busy:!0},children:_jsx(View,{style:skeletonStyles.vCol,children:Array.from({length:p}).map((e,t)=>{const i=t===p-1;return _jsxs(View,{style:skeletonStyles.vRow,children:[_jsxs(View,{style:[skeletonStyles.vLeft,{width:a+8}],children:[_jsx(Skeleton,{shape:"circle",width:a,height:a}),i?null:_jsx(Skeleton,{width:2,height:36})]}),_jsxs(View,{style:skeletonStyles.vBody,children:[_jsx(Skeleton,{shape:"text",width:"55%",height:16,style:{marginBottom:4}}),_jsx(Skeleton,{shape:"text",width:"80%",height:12})]})]},`sk-step-${t}`)})})}:{style:[c.container,o,s],testID:l,accessibilityRole:"progressbar",accessibilityState:{busy:!0},children:_jsxs(View,{style:c.hRow,children:[_jsx(View,{pointerEvents:"none",style:[c.hConnectorContainer,{left:50/p+"%",right:50/p+"%"}],children:_jsx(Skeleton,{width:"100%",height:2,radius:1})}),Array.from({length:p}).map((e,t)=>_jsxs(View,{style:c.hStepItem,children:[_jsx(Skeleton,{shape:"circle",width:a,height:a}),_jsx(Skeleton,{shape:"text",width:"80%",height:12,style:{marginTop:n.spacing.xs}})]},`sk-step-${t}`))]})})};StepperSkeleton.displayName="StepperSkeleton",Stepper.Skeleton=StepperSkeleton;const skeletonStyles=StyleSheet.create({vCol:{flexDirection:"column"},vRow:{flexDirection:"row",alignItems:"flex-start"},vLeft:{alignItems:"center"},vBody:{flex:1,paddingLeft:12,paddingBottom:16}}),buildStyles=e=>StyleSheet.create({container:{width:"100%"},hRow:{flexDirection:"row",alignItems:"flex-start",justifyContent:"space-between",position:"relative"},hConnectorContainer:{position:"absolute",top:11,height:2,flexDirection:"row",alignItems:"center"},hConnectorTrack:{position:"absolute",left:0,right:0,height:2,borderRadius:1,...smoothCorners},hConnectorFill:{position:"absolute",left:0,height:2,borderRadius:1,...smoothCorners},hStepItem:{alignItems:"center",flex:1},hLabel:{marginTop:e.spacing.xs,textAlign:"center"},vCol:{flexDirection:"column"},vRow:{flexDirection:"row",alignItems:"flex-start"},vLeft:{alignItems:"center",alignSelf:"stretch",width:32},vConnectorContainer:{flex:1,width:2,minHeight:32,position:"relative",alignSelf:"center"},vConnectorTrack:{position:"absolute",top:0,bottom:0,width:2,borderRadius:1,...smoothCorners},vConnectorFill:{position:"absolute",top:0,width:2,borderRadius:1,...smoothCorners},vBody:{flex:1,paddingLeft:e.spacing.sm,paddingBottom:e.spacing.md},vLabel:{marginBottom:2},vDescription:{},sCaption:{includeFontPadding:!1},sRow:{flexDirection:"row",columnGap:6},sItem:{flex:1},sTrack:{height:4,borderRadius:2,overflow:"hidden"},sFill:{height:4,borderRadius:2}});export{Stepper};export default Stepper;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{default,Stepper}from"./Stepper.js";
|
|
1
|
+
"use strict";export{default,Stepper}from"./Stepper.js";
|