@webority/mobile-ui 0.1.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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,{useCallback,useMemo,useRef,useState}from"react";import{Dimensions,Image,Pressable,Modal as RNModal,StyleSheet,Text,View}from"react-native";import{Gesture,GestureDetector}from"react-native-gesture-handler";import Animated,{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{defaultIcons}from"../AppIcon/defaultIcons.js";import{Carousel}from"../Carousel/index.js";import{Skeleton}from"../Skeleton/index.js";import{ToastHost}from"../Toast/ToastProvider.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const MAX_SCALE_FALLBACK=4,MIN_SCALE_FALLBACK=1,DOUBLE_TAP_SCALE_FALLBACK=2,SPRING_CONFIG={damping:18,stiffness:220,mass:1},ImageGallery=({images:e,initialIndex:t=0,showThumbnails:a=!0,showCounter:l=!0,enableLightbox:i=!0,enablePinchZoom:o=!0,onIndexChange:s,haptic:n,loading:r=!1,accessibilityLabel:u,containerStyle:c,testID:h})=>{const d=useTheme(),m=useMemo(()=>buildStyles(d),[d]),[g,p]=useState(clamp(t,0,Math.max(0,e.length-1))),[b,S]=useState(!1),y=useCallback(e=>{p(e),s?.(e)},[s]),v=useCallback(()=>{if(!i)return;const e=resolveHaptic(n,"selection");e&&triggerHaptic(e),S(!0)},[i,n]),x=useCallback(()=>{const e=resolveHaptic(n,"selection");e&&triggerHaptic(e),S(!1)},[n]),I=useCallback((t,a)=>{const l=t.alt??`Image ${a+1} of ${e.length}`;return _jsx(Pressable,{onPress:v,accessibilityRole:"image",accessibilityLabel:l,accessibilityHint:i?"Tap to open fullscreen":void 0,style:m.imageWrap,children:_jsx(Image,{source:t.source,style:m.image,resizeMode:"cover"})})},[i,e.length,v,m]),w=useCallback(e=>_jsx(Image,{source:e.source,style:m.thumbnailImage,resizeMode:"cover"}),[m]),f=_jsxs(View,{style:[m.container,c],testID:h,accessibilityLabel:u??"Image gallery",children:[_jsxs(View,{style:m.carouselWrap,children:[_jsx(Carousel,{data:e,defaultIndex:t,onIndexChange:y,renderItem:I,showPagination:!1,showThumbnails:a,renderThumbnail:w,haptic:n}),l&&e.length>0?_jsx(View,{style:m.counterPill,pointerEvents:"none",children:_jsx(Text,{style:[m.counterText,{color:d.colors.onOverlay}],accessibilityLabel:`Image ${g+1} of ${e.length}`,children:`${g+1} / ${e.length}`})}):null]}),i?_jsx(Lightbox,{visible:b,images:e,initialIndex:g,enablePinchZoom:o,showCounter:l,onClose:x,onIndexChange:y,haptic:n}):null]});return r?_jsx(ImageGallerySkeleton,{images:e,showThumbnails:a,showCounter:l,containerStyle:c,testID:h}):f};ImageGallery.displayName="ImageGallery";const ImageGallerySkeleton=({images:e,showThumbnails:t=!0,showCounter:a=!0,containerStyle:l,testID:i})=>{const o=Math.min(e?.length||4,6);return _jsxs(View,{style:[{width:"100%"},l],testID:i,accessibilityRole:"progressbar",accessibilityState:{busy:!0},children:[_jsxs(View,{style:{position:"relative"},children:[_jsx(Skeleton,{width:"100%",height:280,radius:"lg"}),a?_jsx(View,{style:{position:"absolute",top:12,right:12},children:_jsx(Skeleton,{width:44,height:22,radius:"full"})}):null]}),t?_jsx(View,{style:{flexDirection:"row",marginTop:12},children:Array.from({length:o}).map((e,t)=>_jsx(Skeleton,{width:64,height:64,radius:"md",style:{marginRight:8}},`sk-thumb-${t}`))}):null]})};ImageGallerySkeleton.displayName="ImageGallerySkeleton",ImageGallery.Skeleton=ImageGallerySkeleton;const Lightbox=({visible:e,images:t,initialIndex:a,enablePinchZoom:l,showCounter:i,onClose:o,onIndexChange:s,haptic:n})=>{const r=useTheme(),u=useMemo(()=>buildLightboxStyles(r),[r]),c=r.components.imageGallery,h=c?.maxScale??4,d=c?.minScale??1,m=c?.doubleTapScale??2,g=useRef(null),[p,b]=useState(a),S=useCallback(e=>{if(e!==p){const t=resolveHaptic(n,"selection");t&&triggerHaptic(t),b(e),s(e)}},[p,s,n]),y=useCallback((e,a)=>_jsx(ZoomableImage,{image:e,index:a,total:t.length,active:a===p,enabled:l,maxScale:h,minScale:d,doubleTapScale:m,haptic:n}),[p,l,t.length,h,d,m,n]),v=t[p]?.caption;return _jsx(RNModal,{visible:e,transparent:!0,statusBarTranslucent:!0,presentationStyle:"overFullScreen",animationType:"fade",onRequestClose:o,accessibilityViewIsModal:!0,children:_jsxs(View,{style:u.backdrop,accessibilityViewIsModal:!0,children:[_jsx(Carousel,{ref:g,data:t,defaultIndex:a,onIndexChange:S,renderItem:y,showPagination:!1,haptic:n}),i&&t.length>0?_jsx(View,{style:u.counterPill,pointerEvents:"none",children:_jsx(Text,{style:[u.counterText,{color:r.colors.onOverlay}],accessibilityLabel:`Image ${p+1} of ${t.length}`,children:`${p+1} / ${t.length}`})}):null,_jsx(Pressable,{onPress:o,accessibilityRole:"button",accessibilityLabel:"Close gallery",style:u.closeButton,hitSlop:12,children:(r.icons?.close??defaultIcons.close)({size:24,color:r.colors.onOverlay})}),v?_jsx(Animated.View,{style:u.captionWrap,entering:void 0,accessibilityElementsHidden:!1,children:_jsx(Text,{style:u.captionText,numberOfLines:3,children:v})}):null,_jsx(ToastHost,{})]})})},ZoomableImage=({image:e,index:t,total:a,active:l,enabled:i,maxScale:o,minScale:s,doubleTapScale:n,haptic:r})=>{const u=Dimensions.get("window"),c=useSharedValue(1),h=useSharedValue(1),d=useSharedValue(0),m=useSharedValue(0),g=useSharedValue(0),p=useSharedValue(0),b=useCallback(()=>{c.value=withSpring(1,SPRING_CONFIG),h.value=1,d.value=withSpring(0,SPRING_CONFIG),m.value=withSpring(0,SPRING_CONFIG),g.value=0,p.value=0},[c,h,d,m,g,p]);React.useEffect(()=>{l||(c.value=withTiming(1,{duration:150}),d.value=withTiming(0,{duration:150}),m.value=withTiming(0,{duration:150}),h.value=1,g.value=0,p.value=0)},[l,c,d,m,h,g,p]);const S=useCallback(()=>{!1!==r&&triggerHaptic("impactLight")},[r]),y=useMemo(()=>Gesture.Pinch().enabled(i).onStart(()=>{"worklet";h.value=c.value}).onUpdate(e=>{"worklet";const t=h.value*e.scale;c.value=t<s?s+.3*(t-s):t>o?o+.2*(t-o):t}).onEnd(()=>{"worklet";return c.value<s?(c.value=withSpring(s,SPRING_CONFIG),d.value=withSpring(0,SPRING_CONFIG),m.value=withSpring(0,SPRING_CONFIG),h.value=s,g.value=0,void(p.value=0)):c.value>o?(c.value=withSpring(o,SPRING_CONFIG),void(h.value=o)):void(h.value=c.value)}),[i,c,h,d,m,g,p,s,o]),v=useMemo(()=>Gesture.Pan().minPointers(1).maxPointers(1).onStart(()=>{"worklet";g.value=d.value,p.value=m.value}).onUpdate(e=>{"worklet";c.value<=1||(d.value=g.value+e.translationX,m.value=p.value+e.translationY)}).onEnd(()=>{"worklet";g.value=d.value,p.value=m.value}),[c,d,m,g,p]),x=useMemo(()=>Gesture.Tap().numberOfTaps(2).onEnd(()=>{"worklet";runOnJS(S)(),c.value>1?(c.value=withSpring(1,SPRING_CONFIG),d.value=withSpring(0,SPRING_CONFIG),m.value=withSpring(0,SPRING_CONFIG),h.value=1,g.value=0,p.value=0):(c.value=withSpring(n,SPRING_CONFIG),h.value=n)}),[c,h,d,m,g,p,S,n]),I=useMemo(()=>Gesture.Race(y,v,x),[y,v,x]),w=useAnimatedStyle(()=>({transform:[{translateX:d.value},{translateY:m.value},{scale:c.value}]}));React.useEffect(()=>{l||b()},[l,b]);const f=e.alt??`Image ${t+1} of ${a}`;return _jsx(GestureDetector,{gesture:I,children:_jsx(Animated.View,{style:[lightboxImageStyles.container,{width:u.width}],children:_jsx(Animated.Image,{source:e.source,resizeMode:"contain",style:[lightboxImageStyles.image,w],accessibilityLabel:f,accessible:!0})})})},clamp=(e,t,a)=>Math.min(Math.max(e,t),a),buildStyles=e=>StyleSheet.create({container:{width:"100%"},carouselWrap:{width:"100%",position:"relative"},imageWrap:{width:"100%",aspectRatio:16/9,backgroundColor:e.colors.background.secondary,overflow:"hidden",borderRadius:e.radius.md,...smoothCorners},image:{width:"100%",height:"100%"},thumbnailImage:{width:"100%",height:"100%"},counterPill:{position:"absolute",top:12,alignSelf:"center",paddingHorizontal:12,paddingVertical:4,borderRadius:e.radius.full,...smoothCorners,backgroundColor:"rgba(0,0,0,0.55)"},counterText:{fontSize:e.typography.fontSize.sm,fontWeight:e.typography.fontWeight.semibold}}),buildLightboxStyles=e=>StyleSheet.create({backdrop:{flex:1,backgroundColor:"#000",justifyContent:"center"},counterPill:{position:"absolute",top:48,alignSelf:"center",paddingHorizontal:14,paddingVertical:6,borderRadius:e.radius.full,...smoothCorners,backgroundColor:"rgba(0,0,0,0.6)"},counterText:{fontSize:e.typography.fontSize.sm,fontWeight:e.typography.fontWeight.semibold},closeButton:{position:"absolute",top:44,right:16,width:40,height:40,borderRadius:20,...smoothCorners,alignItems:"center",justifyContent:"center",backgroundColor:"rgba(0,0,0,0.5)"},captionWrap:{position:"absolute",left:0,right:0,bottom:32,paddingHorizontal:24},captionText:{color:"#FFFFFF",fontSize:14,lineHeight:20,textAlign:"center"}}),lightboxImageStyles=StyleSheet.create({container:{flex:1,alignItems:"center",justifyContent:"center"},image:{width:"100%",height:"100%"}});export{ImageGallery};export default ImageGallery;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{default,ImageGallery}from"./ImageGallery.js";
|
|
1
|
+
"use strict";export{default,ImageGallery}from"./ImageGallery.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
"use strict";import React,{forwardRef,useCallback,useMemo,useState}from"react";import{Pressable,StyleSheet,Text,View}from"react-native";import{fontFor,useTheme}from"../../theme/index.js";import{resolveHaptic,triggerHaptic}from"../../utils/index.js";import{Chevron}from"../FieldBase/Chevron.js";import{FieldLabel,resolveFieldSize}from"../FieldBase/FieldBase.js";import{OptionSheet}from"../OptionSheet/OptionSheet.js";import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from"react/jsx-runtime";const InlineSelect=forwardRef((e,t)=>{const{options:l,getOptionLabel:i,getOptionValue:s,getOptionDisabled:o,getOptionDescription:n,getOptionIcon:r,value:a,onChange:c,placeholder:d,label:p,title:b,searchable:S=!1,haptic:u,disabled:m=!1,size:x="md",color:f,chevronColor:g,chevronSize:h,textStyle:y,style:O,optionStyle:j,selectedOptionStyle:C,optionTextStyle:v,selectedOptionTextStyle:F,accessibilityLabel:_,testID:k}=e,I=useTheme(),T=useMemo(()=>buildStyles(I),[I]),z=resolveFieldSize(I,x),L=useCallback(e=>i?i(e):e.label??"",[i]),H=useCallback(e=>s?s(e):e.value,[s]),w=useCallback(e=>o?o(e):!0===e.disabled,[o]),D=useCallback(e=>n?n(e):e.description,[n]),P=useCallback(e=>r?r(e):e.icon,[r]),[R,V]=useState(!1),B=useMemo(()=>{if(null!=a)return l.find(e=>H(e)===a)},[l,a,H]),M=useCallback(e=>a===e,[a]),$=useCallback(()=>{if(m)return;const e=resolveHaptic(u,"selection");e&&triggerHaptic(e),V(!0)},[m,u]),N=useCallback(()=>{V(!1)},[]),G=useCallback(e=>{if(w(e))return;const t=resolveHaptic(u,"selection");t&&triggerHaptic(t),c(H(e)),N()},[w,H,c,N,u]),q=m?I.colors.text.disabled:f??I.components.inlineSelect?.color??I.colors.primary,A=void 0!==B?L(B):d??"Select",E=void 0!==B?`Selected: ${L(B)}`:d??"No selection",J=_jsxs(Pressable,{ref:t,onPress:$,disabled:m,hitSlop:8,accessibilityRole:"button",accessibilityLabel:_??`${p??b??"Select"}. ${E}`,accessibilityState:{disabled:m,expanded:R},testID:k,style:({pressed:e})=>[T.trigger,{columnGap:I.spacing.xs,opacity:e&&!m?.6:1},O],children:[_jsx(Text,{style:[T.triggerText,{color:q,fontSize:z.fontSize,...fontFor(I,"medium")},y],numberOfLines:1,children:A}),_jsx(Chevron,{color:g??q,size:h??z.iconSize,open:R})]});return _jsxs(_Fragment,{children:[p?_jsxs(View,{style:T.labelled,children:[_jsx(FieldLabel,{size:x,children:p}),J]}):J,_jsx(OptionSheet,{open:R,onClose:N,title:b,accessibilityLabel:p??b??d??"Options",options:l,labelOf:L,getValue:H,disabledOf:w,descriptionOf:D,iconOf:P,isSelected:M,onSelect:G,searchable:S,optionStyle:j,selectedOptionStyle:C,optionTextStyle:v,selectedOptionTextStyle:F})]})});InlineSelect.displayName="InlineSelect";const buildStyles=e=>StyleSheet.create({labelled:{alignItems:"flex-start"},trigger:{flexDirection:"row",alignItems:"center"},triggerText:{includeFontPadding:!1}});export{InlineSelect};export default InlineSelect;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{default,InlineSelect}from"./InlineSelect.js";
|
|
1
|
+
"use strict";export{default,InlineSelect}from"./InlineSelect.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
"use strict";import React,{forwardRef,useCallback,useEffect,useMemo,useRef,useState}from"react";import{Animated,Easing,Pressable,StyleSheet,Text,TextInput,View}from"react-native";import{useReducedMotion}from"../../hooks/index.js";import{createAnimatedValue,fontFor,setNativeValue,useTheme}from"../../theme/index.js";import{mergeRefs,triggerHaptic}from"../../utils/index.js";import{defaultIcons}from"../AppIcon/defaultIcons.js";import{renderSlotIcon}from"../AppIcon/slotIcon.js";import{Button}from"../Button/index.js";import{FieldBase,FieldErrorGlyph,FieldLabel,fieldTextAsString,hasFieldText,RequiredPlaceholder,resolveFieldSize,resolveFieldTextStyle}from"../FieldBase/FieldBase.js";import{useFloatingLabel}from"../FieldBase/useFloatingLabel.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const multilineMinHeightMap={sm:72,md:92,lg:110},Input=forwardRef((e,t)=>{const{label:i,help:n,placeholder:o,value:l,onChangeText:r,error:s,helperText:a,type:d="input",secureTextEntry:c=!1,showPasswordToggle:u=!1,disabled:p=!1,multiline:f=!1,leftIcon:g,rightIcon:m,unit:x,unitStyle:h,prefix:y,prefixStyle:b,readOnly:S=!1,action:v,actionStyle:F,size:w="md",variant:j,labelMode:T,required:z=!1,maxLength:R,showCounter:I=!0,textAlign:V,format:A,parse:_,style:k,containerStyle:C,inputStyle:D,labelStyle:L,messageStyle:H,borderRadius:E,onFocus:M,onBlur:N,accessibilityLabel:P,testID:B,editable:O,...G}=e,q=useTheme(),W=useMemo(()=>buildStyles(q),[q]),$=resolveFieldSize(q,w),X=multilineMinHeightMap[w],J=Math.round(1.4*$.fontSize),K=j??q.components.input?.defaultVariant??q.components.field?.defaultVariant??"outlined",Q=T??q.components.input?.defaultLabelMode??"top",[U,Y]=useState(!1),[Z,ee]=useState(!1),te="password"===d||u||c,ie="password"===d||u,ne="textarea"===d||f,oe=ne?Math.round(.1*$.fontSize):0,le="string"==typeof l&&l.length>0,re=hasFieldText(s),se=hasFieldText(a),ae=hasFieldText(i),de=hasFieldText(y),ce=!p&&!1!==O,ue=U||le||de,pe=useRef(null),fe=useMemo(()=>mergeRefs(pe,t),[t]),ge=useCallback(()=>{ce&&pe.current?.focus()},[ce]),me=ae&&"float"===Q,xe=useRef(createAnimatedValue(0)).current,he=useRef(createAnimatedValue(re||se?1:0)).current;useEffect(()=>{const e=Animated.timing(he,{toValue:re||se?1:0,duration:q.motion.duration.fast,easing:Easing.bezier(...q.motion.easing.standard),useNativeDriver:!0});return e.start(),()=>e.stop()},[re,se,he,q.motion.duration.fast,q.motion.easing.standard]);const ye=useReducedMotion(),be=q.components.input?.shakeOnError??!1,Se=useRef(re);useEffect(()=>{if(!be)return void(Se.current=re);let e;return re&&!Se.current&&(ye||(setNativeValue(xe,0),e=Animated.sequence([Animated.timing(xe,{toValue:1,duration:50,useNativeDriver:!0}),Animated.timing(xe,{toValue:-1,duration:50,useNativeDriver:!0}),Animated.timing(xe,{toValue:1,duration:50,useNativeDriver:!0}),Animated.timing(xe,{toValue:-1,duration:50,useNativeDriver:!0}),Animated.timing(xe,{toValue:0,duration:100,useNativeDriver:!0})]),e.start()),triggerHaptic("notificationError")),Se.current=re,()=>e?.stop()},[re,xe,be,ye]);const ve=useCallback(e=>{Y(!0),M?.(e)},[M]),Fe=useCallback(e=>{Y(!1),N?.(e)},[N]),we=useCallback(()=>{triggerHaptic("selection"),ee(e=>!e)},[]),je=useMemo(()=>{const e=q.components.input?.fillColors?.[K];if(!e)return;const t={};return void 0!==e.idleEmpty&&(t.backgroundIdleEmpty=e.idleEmpty),void 0!==e.idleFilled&&(t.backgroundIdleFilled=e.idleFilled),void 0!==e.focus&&(t.backgroundFocused=e.focus),void 0!==e.error&&(t.backgroundError=e.error),void 0!==e.disabled&&(t.backgroundDisabled=e.disabled),Object.keys(t).length>0?t:void 0},[q.components.input?.fillColors,K]),Te=q.colors.field.caret,ze=E??q.components.input?.borderRadius,Re=q.components.input?.tintLabelOnFocus??!1,Ie=U&&Re?q.colors.field.borderFocused:q.colors.field.label,Ve=xe.interpolate({inputRange:[-1,0,1],outputRange:[-6,0,6]}),Ae=Boolean(m)||Boolean(x)||ie,_e="underline"===K,ke=g?$.iconSize+q.spacing.md+1+q.spacing.md:0,Ce=useFloatingLabel({label:i,enabled:me,floated:ue,required:z,variant:K,sizeTokens:$,leadingOffset:ke,trailingOffset:Ae?$.iconSize+q.spacing.sm:0,textAlign:V,paddingLeft:_e?0:$.paddingHorizontal,lineHeight:ne?J:void 0,restNudge:oe,floatTrim:ne?2:0,color:Ie,style:L}),De=resolveFieldTextStyle(q,{disabled:p}),Le=De.color,He=De.placeholderColor,Ee=z&&!ae&&!le&&"string"==typeof o&&o.length>0,Me=re?s:a,Ne=re||se,Pe=I&&"number"==typeof R&&"string"==typeof l?`${l.length} / ${R}`:null,Be=re?q.colors.field.message:q.colors.text.secondary,Oe=P??fieldTextAsString(i)??o,Ge=q.colors.field,qe=p?Ge.iconDisabled:U?Ge.iconFocused:Ge.icon,We={focused:U,disabled:p,error:re,color:qe,size:$.iconSize},renderSlot=e=>renderSlotIcon(e,We),$e=(()=>{if(ie){const e=(Z?q.icons?.eyeOff:q.icons?.eye)??(Z?defaultIcons.eyeOff:defaultIcons.eye);return _jsx(Pressable,{onPress:we,disabled:!ce,hitSlop:8,accessibilityRole:"button",accessibilityLabel:Z?"Hide password":"Show password",children:e({size:$.iconSize,color:qe})})}const e=x?_jsx(Text,{style:[W.unit,{fontSize:$.fontSize,color:He},h],children:x}):null,t=m?_jsx(View,{children:renderSlot(m)}):null;return e&&t?_jsxs(View,{style:W.trailingRow,children:[e,t]}):e??t})(),Xe=g?_jsx(View,{children:renderSlot(g)}):null,Je=de?"string"==typeof y||"number"==typeof y?_jsx(Text,{style:[W.prefix,{fontSize:$.fontSize,color:He,marginRight:q.spacing.xs,lineHeight:ne?J:void 0,paddingTop:ne?oe:void 0},b],children:y}):_jsx(View,{style:[W.prefixNode,{marginRight:q.spacing.xs,minHeight:ne?J:void 0,justifyContent:"center",paddingTop:ne?oe:void 0}],children:y}):null,Ke=v?_jsx(Button,{variant:v.variant??"outline",tone:v.tone??"primary",size:w,title:v.label,leftIcon:v.icon,loading:v.loading,disabled:p||v.disabled,onPress:v.onPress,pressAnimation:!1,testID:v.testID,style:[W.action,{minHeight:$.minHeight,alignSelf:ne?"flex-start":"stretch"},F]}):null;return _jsxs(Animated.View,{style:[W.container,{transform:[{translateX:Ve}]},k],children:[ae&&!me?_jsx(FieldLabel,{size:w,required:z,help:n,color:Ie,style:L,children:i}):null,_jsxs(View,{style:[W.fieldRow,{columnGap:q.spacing.sm,alignItems:ne?"flex-start":"stretch"}],children:[_jsxs(View,{style:W.fieldWrapper,children:[_jsxs(FieldBase,{size:w,variant:K,focused:U,disabled:p,error:re,filled:le,minHeight:ne?X:void 0,borderRadius:ze,fillOverrides:je,leading:Xe,leadingDivider:null!=g,paddingLeft:_e?0:void 0,trailing:$e,slotAlign:ne?"top":"center",slotLineHeight:ne?J:void 0,topNotch:Ce.topNotch,onPress:ge,pressFeedback:!1,style:C,children:[Je,_jsxs(View,{style:W.inputWrap,children:[_jsx(TextInput,{ref:fe,style:[W.input,{color:Le,fontSize:$.fontSize,...De.weightStyle,paddingLeft:_e?0:void 0,minHeight:ne?X-2*$.paddingVertical:void 0,lineHeight:ne?J:void 0,paddingTop:ne?oe:void 0,textAlignVertical:ne?"top":"center"},D],textAlign:V,placeholder:me&&!ue||Ee?void 0:o,placeholderTextColor:He,value:A&&null!=l?A(l):l,onChangeText:e=>{r&&r(_?_(e):e)},onFocus:ve,onBlur:Fe,editable:ce,readOnly:S,secureTextEntry:te&&!Z,multiline:ne,autoCapitalize:te?"none":void 0,autoCorrect:!te&&void 0,maxLength:R,selectionColor:Te,accessibilityLabel:Oe,accessibilityState:{disabled:p},testID:B,...G}),Ee?_jsx(RequiredPlaceholder,{text:o,color:He,fontSize:$.fontSize,weightStyle:De.weightStyle,align:ne?"top":"center",paddingTop:ne?oe:void 0,textAlign:V}):null]})]}),Ce.node]}),Ke]}),Ne||Pe?_jsxs(View,{style:[W.footerRow,{marginTop:$.messageGap}],children:[Ne?_jsxs(Animated.View,{style:[W.messageRow,{columnGap:q.spacing.xs+2,opacity:he}],accessibilityLiveRegion:re?"polite":"none",children:[re?_jsx(FieldErrorGlyph,{size:$.messageFontSize,color:Be}):null,_jsx(Text,{style:[W.messageText,{color:Be,fontSize:$.messageFontSize,...fontFor(q,"normal")},H],children:Me})]}):_jsx(View,{style:W.footerSpacer}),Pe?_jsx(Text,{style:[W.counterText,{color:q.colors.text.tertiary,fontSize:$.messageFontSize,...fontFor(q,"normal")}],children:Pe}):null]}):null]})});Input.displayName="Input";const buildStyles=e=>StyleSheet.create({container:{width:"100%"},fieldRow:{flexDirection:"row"},fieldWrapper:{position:"relative",overflow:"visible",flex:1},action:{flexShrink:0},input:{padding:0,margin:0,includeFontPadding:!1},prefix:{flexShrink:0,includeFontPadding:!1},prefixNode:{flexShrink:0},inputWrap:{flex:1,alignSelf:"stretch",justifyContent:"center"},unit:{includeFontPadding:!1},trailingRow:{flexDirection:"row",alignItems:"center",columnGap:8},footerRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",columnGap:8},footerSpacer:{flex:1},messageRow:{flex:1,flexDirection:"row",alignItems:"center"},messageText:{flexShrink:1,includeFontPadding:!1},counterText:{flexShrink:0,includeFontPadding:!1}});export{Input};export default Input;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{default,Input}from"./Input.js";
|
|
1
|
+
"use strict";export{default,Input}from"./Input.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{forwardRef
|
|
1
|
+
"use strict";import{forwardRef}from"react";import{Keyboard,Pressable,RefreshControl}from"react-native";import{KeyboardAwareScrollView as ControllerScrollView}from"react-native-keyboard-controller";import{useSafeAreaInsets}from"react-native-safe-area-context";import{useTheme}from"../../theme/index.js";import{jsx as _jsx}from"react/jsx-runtime";const tapAreaStyle={flexGrow:1},KeyboardAwareScrollView=forwardRef((e,r)=>{const{children:o,bottomOffset:t=24,extraKeyboardSpace:a=0,safeAreaEdges:s=["bottom"],refreshing:l=!1,onRefresh:i,dismissOnTapOutside:n=!1,contentContainerStyle:d,refreshControl:c,...f}=e,m=useTheme(),p=useSafeAreaInsets(),b=s.includes("bottom"),y={paddingBottom:b?p.bottom:0,...s.includes("top")?{paddingTop:p.top}:null,...s.includes("left")?{paddingLeft:p.left}:null,...s.includes("right")?{paddingRight:p.right}:null},h=c??(i?_jsx(RefreshControl,{refreshing:l,onRefresh:i,tintColor:m.colors.primary,colors:[m.colors.primary]}):void 0);return _jsx(ControllerScrollView,{ref:r,bottomOffset:t,extraKeyboardSpace:a-(b?p.bottom:0),keyboardShouldPersistTaps:"handled",keyboardDismissMode:"none",contentContainerStyle:[d,y],refreshControl:h,...f,children:n?_jsx(Pressable,{accessible:!1,onPress:Keyboard.dismiss,style:tapAreaStyle,children:o}):o})});KeyboardAwareScrollView.displayName="KeyboardAwareScrollView";export{KeyboardAwareScrollView};export default KeyboardAwareScrollView;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{KeyboardAwareScrollView}from"./KeyboardAwareScrollView.js";
|
|
1
|
+
"use strict";export{KeyboardAwareScrollView}from"./KeyboardAwareScrollView.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Pressable
|
|
1
|
+
"use strict";import{Pressable,StyleSheet,View}from"react-native";import{KeyboardController,KeyboardStickyView,useKeyboardState}from"react-native-keyboard-controller";import{useOptionalFormContext}from"../../form/FormContext.js";import{useTheme}from"../../theme/index.js";import{Text}from"../Text/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const NavButton=({label:e,accessibilityLabel:o,onPress:t,theme:s})=>_jsx(Pressable,{onPress:t,accessibilityRole:"button",accessibilityLabel:o,hitSlop:8,style:{paddingHorizontal:s.spacing.sm},children:_jsx(Text,{variant:"h2",color:"link",children:e})}),KeyboardToolbar=e=>{const{doneLabel:o="Done",showNavigation:t=!0,onDone:s,onNext:r,onPrev:i,leading:l,style:a,testID:n}=e,c=useTheme(),b=useOptionalFormContext();if(!useKeyboardState(e=>e.isVisible))return null;const d=s??(()=>{KeyboardController.dismiss()}),y=i??b?.focusPrev??(()=>KeyboardController.setFocusTo("prev")),x=r??b?.focusNext??(()=>KeyboardController.setFocusTo("next"));return _jsx(KeyboardStickyView,{style:styles.anchor,children:_jsxs(View,{testID:n,accessibilityRole:"toolbar",style:[styles.bar,{backgroundColor:c.colors.background.elevated,borderTopColor:c.colors.border.primary,paddingHorizontal:c.spacing.md},a],children:[t?_jsxs(View,{style:styles.nav,children:[_jsx(NavButton,{label:"‹",accessibilityLabel:"Previous field",onPress:y,theme:c}),_jsx(NavButton,{label:"›",accessibilityLabel:"Next field",onPress:x,theme:c})]}):_jsx(View,{}),l,_jsx(View,{style:styles.spacer}),_jsx(Pressable,{onPress:d,accessibilityRole:"button",accessibilityLabel:o,hitSlop:8,children:_jsx(Text,{variant:"body",weight:"semibold",color:"link",children:o})})]})})},styles=StyleSheet.create({anchor:{position:"absolute",left:0,right:0,bottom:0},bar:{height:44,flexDirection:"row",alignItems:"center",borderTopWidth:StyleSheet.hairlineWidth},nav:{flexDirection:"row",alignItems:"center"},spacer:{flex:1}});export{KeyboardToolbar};export default KeyboardToolbar;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{KeyboardToolbar}from"./KeyboardToolbar.js";
|
|
1
|
+
"use strict";export{KeyboardToolbar}from"./KeyboardToolbar.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
"use strict";import React,{forwardRef,useMemo}from"react";import{Animated,Pressable,StyleSheet,Text,View}from"react-native";import{useFlickGuard}from"../../hooks/useFlickGuard.js";import{usePressAnimation}from"../../hooks/usePressAnimation.js";import{fontFor,useTheme}from"../../theme/index.js";import{resolveHaptic,triggerHaptic}from"../../utils/hapticUtils.js";import{defaultIcons}from"../AppIcon/defaultIcons.js";import{Button}from"../Button/index.js";import{IconBadge}from"../IconBadge/index.js";import{Skeleton}from"../Skeleton/index.js";import{Swipeable}from"../Swipeable/index.js";import{Fragment as _Fragment,jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const SIZE_FALLBACK={sm:{paddingVertical:"sm",titleFontSize:"sm",subtitleFontSize:"xs",minHeight:44},md:{paddingVertical:"md",titleFontSize:"base",subtitleFontSize:"sm",minHeight:56},lg:{paddingVertical:"lg",titleFontSize:"lg",subtitleFontSize:"sm",minHeight:72}},sizeFor=(e,t)=>{const i={...SIZE_FALLBACK[t],...e.components.listItem?.[t]??{}};return{paddingVertical:e.spacing[i.paddingVertical],titleSize:e.typography.fontSize[i.titleFontSize],subtitleSize:e.typography.fontSize[i.subtitleFontSize],minHeight:i.minHeight}},Chevron=({color:e})=>{const t=useTheme();return _jsx(_Fragment,{children:(t.icons?.chevronRight??defaultIcons.chevronRight)({size:20,color:e})})},BADGE_SIZE={sm:"sm",md:"md",lg:"lg"},isActionList=e=>Array.isArray(e)&&e.length>0&&e.every(e=>null!=e&&"object"==typeof e&&!React.isValidElement(e)&&"label"in e),renderActions=e=>isActionList(e)?e.map(e=>_jsx(Button,{size:"sm",variant:e.variant??"outline",tone:e.tone,leftIcon:e.icon,disabled:e.disabled,testID:e.testID,title:e.label,onPress:e.onPress},e.label)):e,ListItem=forwardRef((e,t)=>{const{title:i,loading:s=!1,subtitle:l,description:n,titleLines:o=1,subtitleLines:r=1,left:a,icon:c,iconTone:d="primary",right:m,actions:g,onPress:p,haptic:h,selected:u=!1,disabled:y=!1,size:x="md",divider:b=!1,chevron:f=!1,leftActions:S,rightActions:j,accessibilityLabel:_,accessibilityHint:I,style:w,containerStyle:z,titleStyle:L,subtitleStyle:v,descriptionStyle:A,leftSlotStyle:F,rightSlotStyle:V,testID:k}=e,H=useTheme(),B=useMemo(()=>sizeFor(H,x),[H,x]),D=useMemo(()=>buildStyles(H),[H]),P=!!p&&!y,{scale:R,pressIn:C,pressOut:T}=usePressAnimation({enabled:P}),E=useFlickGuard(),G=_??("string"==typeof i?i:void 0),isText=e=>"string"==typeof e||"number"==typeof e,M=a??(void 0===c?null:_jsx(IconBadge,{icon:c,tone:d,size:BADGE_SIZE[x]})),O=null!=g&&!1!==g&&!(Array.isArray(g)&&0===g.length),W=b&&!O,Z=_jsxs(View,{style:[D.row,{paddingVertical:B.paddingVertical,minHeight:B.minHeight,backgroundColor:u?H.colors.surface.selected:"transparent"},W?D.divider:null,y?D.disabled:null,z],children:[M?_jsx(View,{style:[D.leftSlot,F],children:M}):null,_jsxs(View,{style:D.middle,children:[null==i||isText(i)?_jsx(Text,{style:[D.title,{fontSize:B.titleSize,...fontFor(H,"medium"),color:y?H.colors.text.disabled:H.colors.text.primary},L],numberOfLines:o,children:i??" "}):i,null==l||""===l?null:isText(l)?_jsx(Text,{style:[D.subtitle,{fontSize:B.subtitleSize,color:y?H.colors.text.disabled:H.colors.text.secondary},v],numberOfLines:r,children:l}):l,n?_jsx(Text,{style:[D.description,{fontSize:B.subtitleSize,color:y?H.colors.text.disabled:H.colors.text.tertiary},A],numberOfLines:2,children:n}):null]}),m||f?_jsxs(View,{style:[D.rightSlot,V],children:[m,f?_jsx(View,{style:m?D.chevronWithRight:null,children:_jsx(Chevron,{color:y?H.colors.text.disabled:H.colors.text.tertiary})}):null]}):null]}),K=p?_jsx(Animated.View,{style:[{transform:[{scale:R}]},w],children:_jsx(Pressable,{ref:t,onPress:e=>{if(!P||E.isFlick(e))return;const t=resolveHaptic(h,"selection");t&&triggerHaptic(t),p?.(e)},onPressIn:e=>{E.onPressIn(e),C()},onPressOut:T,disabled:!P,accessibilityRole:"button",accessibilityLabel:G,accessibilityHint:I,accessibilityState:{selected:u,disabled:!P},testID:k,android_ripple:{color:H.colors.surface.pressed,borderless:!1},style:({pressed:e})=>e?D.pressed:null,children:Z})}):_jsx(View,{ref:t,accessibilityRole:"none",accessibilityLabel:G,accessibilityHint:I,accessibilityState:{selected:u,disabled:y},testID:k,style:w,children:Z}),N=S&&S.length>0||j&&j.length>0,U=O?_jsxs(View,{style:[u?{backgroundColor:H.colors.surface.selected}:null,b?D.divider:null],children:[K,_jsx(View,{style:D.actions,children:renderActions(g)})]}):K,q=N?_jsx(Swipeable,{leftActions:S,rightActions:j,accessibilityLabel:G,children:U}):U;return s?_jsx(ListItemSkeleton,{...e}):q});ListItem.displayName="ListItem";const ListItemSkeleton=({subtitle:e,description:t,left:i,icon:s,right:l,chevron:n,size:o="md",containerStyle:r,style:a})=>{const c=useTheme(),d=sizeFor(c,o),m=Math.round(1.15*d.titleSize),g=Math.round(1.15*d.subtitleSize);return _jsxs(View,{style:[{flexDirection:"row",alignItems:"center",paddingHorizontal:c.spacing.md,paddingVertical:d.paddingVertical,minHeight:d.minHeight},r,a],children:[void 0!==i||void 0!==s?_jsx(View,{style:{marginRight:c.spacing.sm},children:_jsx(Skeleton,{shape:"circle",width:40,height:40})}):null,_jsxs(View,{style:{flex:1},children:[_jsx(Skeleton,{shape:"text",width:"70%",height:m,style:{marginBottom:c.spacing.xs}}),void 0!==e?_jsx(Skeleton,{shape:"text",width:"50%",height:g,style:void 0!==t?{marginBottom:c.spacing.xs}:void 0}):null,void 0!==t?_jsx(Skeleton,{shape:"text",width:"85%",height:g}):null]}),void 0!==l||n?_jsx(View,{style:{marginLeft:c.spacing.sm},children:_jsx(Skeleton,{width:20,height:20,radius:"sm"})}):null]})};ListItemSkeleton.displayName="ListItemSkeleton",ListItem.Skeleton=ListItemSkeleton;const buildStyles=e=>StyleSheet.create({row:{flexDirection:"row",alignItems:"center",paddingHorizontal:e.spacing.md},divider:{borderBottomWidth:StyleSheet.hairlineWidth,borderBottomColor:e.colors.border.primary},pressed:{backgroundColor:e.colors.surface.pressed},disabled:{opacity:.55},leftSlot:{marginRight:e.spacing.md,alignItems:"center",justifyContent:"center"},middle:{flex:1,flexDirection:"column",justifyContent:"center"},rightSlot:{marginLeft:e.spacing.md,alignItems:"center",justifyContent:"center",flexDirection:"row"},actions:{flexDirection:"row",flexWrap:"wrap",gap:e.spacing.sm,paddingHorizontal:e.spacing.md,paddingBottom:e.spacing.md},chevronWithRight:{marginLeft:e.spacing.xs},title:{letterSpacing:e.typography.letterSpacing.normal},subtitle:{marginTop:2,...fontFor(e,"normal")},description:{marginTop:2,...fontFor(e,"normal")}});export{ListItem};export default ListItem;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{default,ListItem}from"./ListItem.js";
|
|
1
|
+
"use strict";export{default,ListItem}from"./ListItem.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
"use strict";import React,{useEffect,useMemo,useRef,useState}from"react";import{AccessibilityInfo,Animated,BackHandler,Easing,StyleSheet}from"react-native";import{useReducedMotion}from"../../hooks/useReducedMotion.js";import{createAnimatedValue,useTheme}from"../../theme/index.js";import{Spinner}from"../Spinner/index.js";import{jsx as _jsx}from"react/jsx-runtime";const DEFAULT_SHOW_DELAY_MS=150,DEFAULT_MIN_VISIBLE_MS=400;let state={refCount:0,message:void 0};const listeners=new Set,notify=()=>{for(const e of listeners)e()},subscribe=e=>(listeners.add(e),()=>{listeners.delete(e)}),getState=()=>state,show=e=>{state={refCount:state.refCount+1,message:e??state.message},notify()},hide=()=>{if(state.refCount<=0)return;const e=state.refCount-1;state={refCount:e,message:0===e?void 0:state.message},notify()},reset=()=>{0===state.refCount&&void 0===state.message||(state={refCount:0,message:void 0},notify())},isVisible=()=>state.refCount>0,wrap=async(e,t)=>{show(t);try{return await("function"==typeof e?e():e)}finally{hide()}};export const loader={show:show,hide:hide,wrap:wrap,isVisible:isVisible,reset:reset};export const useLoader=()=>loader;export const LoaderOverlay=({renderIndicator:e,backdropColor:t,showDelayMs:s=150,minVisibleMs:r=400,testID:n})=>{const i=useTheme(),o=useReducedMotion(),[u,a]=useState(getState),[c,l]=useState(!1),f=useRef(!1),d=useRef(null),m=useRef(null),y=useRef(null),b=useRef(createAnimatedValue(0)).current;useEffect(()=>subscribe(()=>a(getState())),[]),useEffect(()=>{f.current=c},[c]);const g=u.refCount>0;useEffect(()=>{if(g)return null!==m.current&&(clearTimeout(m.current),m.current=null),void(f.current||null!==d.current||(d.current=setTimeout(()=>{d.current=null,y.current=Date.now(),l(!0)},s)));if(null!==d.current)return clearTimeout(d.current),void(d.current=null);if(f.current&&null===m.current){const e=null!==y.current?Date.now()-y.current:r,t=Math.max(0,r-e);m.current=setTimeout(()=>{m.current=null,y.current=null,l(!1)},t)}},[g,s,r]),useEffect(()=>()=>{null!==d.current&&clearTimeout(d.current),null!==m.current&&clearTimeout(m.current)},[]),useEffect(()=>{c?o?b.setValue(1):Animated.timing(b,{toValue:1,duration:i.motion.duration.normal,easing:Easing.bezier(...i.motion.easing.standard),useNativeDriver:!0}).start():b.setValue(0)},[c,o,b,i]),useEffect(()=>{if(!c)return;const e=BackHandler.addEventListener("hardwareBackPress",()=>!0);return()=>{e.remove()}},[c]);const S=u.message;useEffect(()=>{c&&S&&AccessibilityInfo.announceForAccessibility(S)},[c,S]);const p=useMemo(()=>buildStyles(),[]);return c?_jsx(Animated.View,{pointerEvents:"auto",testID:n,accessible:!0,accessibilityViewIsModal:!0,accessibilityLiveRegion:"polite",accessibilityLabel:S??"Loading",accessibilityRole:"progressbar",accessibilityState:{busy:!0},style:[p.overlay,{backgroundColor:t??i.colors.background.overlay,opacity:b}],children:e?e(S):_jsx(Spinner,{size:"lg",message:S})}):null};const buildStyles=()=>StyleSheet.create({overlay:{...StyleSheet.absoluteFill,alignItems:"center",justifyContent:"center",zIndex:1e3}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{LoaderOverlay,loader,useLoader}from"./LoaderOverlay.js";
|
|
1
|
+
"use strict";export{LoaderOverlay,loader,useLoader}from"./LoaderOverlay.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
"use strict";import React,{useMemo}from"react";import{Linking,Platform,StyleSheet,Text,View}from"react-native";import{useTheme}from"../../theme/index.js";import{smoothCorners}from"../../utils/corners.js";import{Skeleton}from"../Skeleton/index.js";import{parseMarkdown}from"./parse.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const renderInline=(e,t,r,o="i")=>e.map((e,n)=>{const s=`${o}-${n}`;switch(e.type){case"text":return _jsx(Text,{children:e.value},s);case"strong":return _jsx(Text,{style:{fontWeight:t.typography.fontWeight.bold},children:renderInline(e.children,t,r,s)},s);case"em":return _jsx(Text,{style:{fontStyle:"italic"},children:renderInline(e.children,t,r,s)},s);case"strike":return _jsx(Text,{style:{textDecorationLine:"line-through"},children:renderInline(e.children,t,r,s)},s);case"code":return _jsx(Text,{style:{fontFamily:MONO,backgroundColor:t.colors.background.secondary,color:t.colors.text.primary},children:e.value},s);case"link":return _jsx(Text,{accessibilityRole:"link",onPress:()=>r(e.href),style:{color:t.colors.text.link,textDecorationLine:"underline"},children:renderInline(e.children,t,r,s)},s);default:return null}}),MONO=Platform.select({ios:"Menlo",android:"monospace",default:"monospace"}),HEADING_SCALE={1:"3xl",2:"2xl",3:"xl",4:"lg",5:"base",6:"sm"};export const Markdown=({children:e,onLinkPress:t,loading:r=!1,style:o,textStyle:n,testID:s})=>{const l=useTheme(),i=useMemo(()=>createStyles(l),[l]),c=useMemo(()=>parseMarkdown(e??""),[e]),handleLink=e=>{t?t(e):Linking.openURL(e).catch(()=>{})};return r?_jsx(MarkdownSkeleton,{style:o,testID:s}):0===c.length?null:_jsx(View,{style:o,testID:s,children:c.map((e,t)=>_jsx(MarkdownBlock,{block:e,theme:l,styles:i,textStyle:n,onLinkPress:handleLink},`b-${t}`))})};Markdown.displayName="Markdown";const MarkdownBlock=({block:e,theme:t,styles:r,textStyle:o,onLinkPress:n})=>{switch(e.type){case"heading":return _jsx(Text,{accessibilityRole:"header",style:[r.block,{fontSize:t.typography.fontSize[HEADING_SCALE[e.level]],fontWeight:t.typography.fontWeight.semibold,color:t.colors.text.primary},o],children:renderInline(e.children,t,n)});case"paragraph":return _jsx(Text,{style:[r.block,r.body,o],children:renderInline(e.children,t,n)});case"listItem":return _jsxs(View,{style:[r.listRow,{marginLeft:e.depth*t.spacing.md}],children:[_jsx(Text,{style:[r.body,r.bullet,o],children:e.ordered?`${e.index}.`:"•"}),_jsx(Text,{style:[r.body,r.listText,o],children:renderInline(e.children,t,n)})]});case"quote":return _jsx(View,{style:r.quote,children:_jsx(Text,{style:[r.body,r.quoteText,o],children:renderInline(e.children,t,n)})});case"codeBlock":return _jsx(View,{style:r.codeBlock,children:_jsx(Text,{style:r.codeText,children:e.value})});case"rule":return _jsx(View,{style:r.rule});default:return null}},MarkdownSkeleton=({style:e,testID:t})=>_jsxs(View,{style:e,testID:t,children:[_jsx(Skeleton,{shape:"text",width:"70%",height:20,style:{marginBottom:8}}),_jsx(Skeleton,{shape:"text",width:"100%",height:14,style:{marginBottom:6}}),_jsx(Skeleton,{shape:"text",width:"92%",height:14,style:{marginBottom:6}}),_jsx(Skeleton,{shape:"text",width:"60%",height:14})]}),createStyles=e=>StyleSheet.create({block:{marginBottom:e.spacing.sm},body:{fontSize:e.typography.fontSize.base,color:e.colors.text.primary,lineHeight:1.5*e.typography.fontSize.base},listRow:{flexDirection:"row",marginBottom:e.spacing.xs},bullet:{width:e.spacing.lg},listText:{flex:1},quote:{borderLeftWidth:3,borderLeftColor:e.colors.border.secondary,paddingLeft:e.spacing.sm,marginBottom:e.spacing.sm},quoteText:{color:e.colors.text.secondary,fontStyle:"italic"},codeBlock:{backgroundColor:e.colors.background.secondary,borderRadius:e.radius.sm,...smoothCorners,padding:e.spacing.sm,marginBottom:e.spacing.sm},codeText:{fontFamily:MONO,fontSize:e.typography.fontSize.sm,color:e.colors.text.primary},rule:{height:StyleSheet.hairlineWidth,backgroundColor:e.colors.border.primary,marginVertical:e.spacing.md}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{Markdown}from"./Markdown.js";
|
|
1
|
+
"use strict";export{Markdown}from"./Markdown.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
"use strict";const INLINE_PATTERNS=[{re:/^`([^`]+)`/,build:e=>({type:"code",value:e[1]})},{re:/^\[([^\]]*)\]\(([^)\s]+)\)/,build:(e,t)=>({type:"link",href:e[2],children:t(e[1])})},{re:/^\*\*([\s\S]+?)\*\*/,build:(e,t)=>({type:"strong",children:t(e[1])})},{re:/^__([\s\S]+?)__/,build:(e,t)=>({type:"strong",children:t(e[1])})},{re:/^~~([\s\S]+?)~~/,build:(e,t)=>({type:"strike",children:t(e[1])})},{re:/^\*([^*\n]+)\*/,build:(e,t)=>({type:"em",children:t(e[1])})},{re:/^_([^_\n]+)_/,build:(e,t)=>({type:"em",children:t(e[1])})}];export const parseInline=e=>{const t=[];let n="",s=e;const flush=()=>{n&&(t.push({type:"text",value:n}),n="")};for(;s.length>0;){if(s.startsWith("\\")&&s.length>1){n+=s[1],s=s.slice(2);continue}let e=!1;for(const{re:n,build:r}of INLINE_PATTERNS){const i=n.exec(s);if(i){flush(),t.push(r(i,parseInline)),s=s.slice(i[0].length),e=!0;break}}e||(n+=s[0],s=s.slice(1))}return flush(),t};const MAX_LIST_DEPTH=4,depthOf=e=>{const t=e.replace(/\t/g," ").length;return Math.min(Math.floor(t/2),4)},HEADING=/^(#{1,6})\s+(.*)$/,UNORDERED=/^(\s*)[-*+]\s+(.*)$/,ORDERED=/^(\s*)(\d+)[.)]\s+(.*)$/,QUOTE=/^\s*>\s?(.*)$/,RULE=/^\s*([-*_])\s*(?:\1\s*){2,}$/,FENCE=/^\s*```\s*(\S+)?\s*$/;export const parseMarkdown=e=>{const t=[],n=(e??"").replace(/\r\n?/g,"\n").split("\n");let s=[];const flushParagraph=()=>{s.length>0&&(t.push({type:"paragraph",children:parseInline(s.join(" ").trim())}),s=[])};for(let e=0;e<n.length;e++){const r=n[e],i=FENCE.exec(r);if(i){flushParagraph();const s=[];for(e++;e<n.length&&!FENCE.test(n[e]);)s.push(n[e]),e++;t.push({type:"codeBlock",value:s.join("\n"),language:i[1]});continue}if(""===r.trim()){flushParagraph();continue}if(RULE.test(r)){flushParagraph(),t.push({type:"rule"});continue}const l=HEADING.exec(r);if(l){flushParagraph(),t.push({type:"heading",level:l[1].length,children:parseInline(l[2])});continue}const c=ORDERED.exec(r);if(c){flushParagraph(),t.push({type:"listItem",ordered:!0,index:Number(c[2]),depth:depthOf(c[1]),children:parseInline(c[3])});continue}const p=UNORDERED.exec(r);if(p){flushParagraph(),t.push({type:"listItem",ordered:!1,index:0,depth:depthOf(p[1]),children:parseInline(p[2])});continue}const o=QUOTE.exec(r);o?(flushParagraph(),t.push({type:"quote",children:parseInline(o[1])})):s.push(r.trim())}return flushParagraph(),t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
"use strict";import React,{forwardRef,useCallback,useEffect,useMemo,useRef,useState}from"react";import{AccessibilityInfo,Animated,Dimensions,Easing,Platform,Pressable,Modal as RNModal,StyleSheet,View}from"react-native";import{useSafeAreaInsets}from"react-native-safe-area-context";import{createAnimatedValue,useTheme}from"../../theme/index.js";import{smoothCorners}from"../../utils/corners.js";import{resolveHaptic,triggerHaptic}from"../../utils/hapticUtils.js";import{squircleHostRadius}from"../../utils/squircle.js";import{SquircleFill,useSquircle}from"../SquircleFill/SquircleFill.js";import{ToastHost}from"../Toast/ToastProvider.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export const MODAL_DISMISS_GRACE_MS=300;const Modal=forwardRef((e,t)=>{const{visible:s,onRequestClose:i,presentation:r="centered",backdropOpacity:o,backdropPressClose:n=!0,animationDuration:a,accessibilityLabel:l,hardwareBackPress:c=!0,children:u,contentStyle:d,backdropStyle:m,restoreFocusRef:f,onDismissed:p,haptic:g,testID:b}=e,h=useTheme(),y=useSafeAreaInsets(),S=a??h.motion.duration.normal,v=Dimensions.get("window").height,x=h.components.modal,A=x?.scaleStartValue??.9,R=useRef(createAnimatedValue(A)).current,C=useRef(createAnimatedValue(0)).current,j=useRef(createAnimatedValue(v)).current,w=useRef(null),M=useRef(!1),[T,k]=useState(s),V=useMemo(()=>buildStyles(h),[h]),D=useMemo(()=>{const e=h.colors.background.overlay;if("number"!=typeof o)return e;const t=e.match(/^rgba?\(([^)]+)\)$/);if(!t)return e;const[s,i,r]=t[1].split(",").map(e=>e.trim());return`rgba(${s}, ${i}, ${r}, ${o})`},[h.colors.background.overlay,o]);useEffect(()=>{s&&k(!0)},[s]),useEffect(()=>{const e=[];if(s&&T)if("bottom"===r){const t=Animated.spring(j,{toValue:0,damping:h.motion.spring.gentle.damping,stiffness:h.motion.spring.gentle.stiffness,mass:h.motion.spring.gentle.mass,useNativeDriver:!0});t.start(),e.push(t)}else{const t=Animated.parallel([Animated.spring(R,{toValue:1,damping:h.motion.spring.gentle.damping,stiffness:h.motion.spring.gentle.stiffness,mass:h.motion.spring.gentle.mass,useNativeDriver:!0}),Animated.timing(C,{toValue:1,duration:S,useNativeDriver:!0})]);t.start(),e.push(t)}else if(T){const t=h.motion.duration.fast,s=Easing.bezier(...h.motion.easing.accelerate),i=Animated.parallel(["bottom"===r?Animated.timing(j,{toValue:v,duration:t,easing:s,useNativeDriver:!0}):Animated.parallel([Animated.timing(R,{toValue:A,duration:t,easing:s,useNativeDriver:!0}),Animated.timing(C,{toValue:0,duration:t,easing:s,useNativeDriver:!0})])]);i.start(({finished:e})=>{e&&k(!1)}),e.push(i)}return()=>e.forEach(e=>e.stop())},[s,T,r,S,R,C,j,v,h.motion.spring.gentle.damping,h.motion.spring.gentle.stiffness,h.motion.spring.gentle.mass,h.motion.duration.fast,h.motion.easing.accelerate,A]),useEffect(()=>{if("web"===Platform.OS)return;let e,t;return s?(e=setTimeout(()=>{w.current&&AccessibilityInfo.sendAccessibilityEvent(w.current,"focus")},150),M.current=!0):M.current&&(M.current=!1,f&&f.current&&(t=setTimeout(()=>{const e=f.current;e&&AccessibilityInfo.sendAccessibilityEvent(e,"focus")},S))),()=>{e&&clearTimeout(e),t&&clearTimeout(t)}},[s,S,f]);const E=useRef(!1);useEffect(()=>{if(s)return void(E.current=!0);if(!E.current)return;if(E.current=!1,!p)return;const e=setTimeout(p,300);return()=>clearTimeout(e)},[s,p]);const _=useCallback(()=>{if(!n)return;const e=resolveHaptic(g,"selection");e&&triggerHaptic(e),i()},[n,i,g]),q=useCallback(()=>{c&&i()},[c,i]),I=useSquircle("bottom"!==r&&"fullScreen"!==r,h.radius.xl),z=useMemo(()=>"fullScreen"===r?[V.fullScreenContent,{backgroundColor:h.colors.background.elevated}]:"bottom"===r?[V.bottomContent,{backgroundColor:h.colors.background.elevated,borderTopLeftRadius:h.radius.xl,borderTopRightRadius:h.radius.xl,...smoothCorners,paddingTop:h.spacing.lg,paddingHorizontal:h.spacing.lg,paddingBottom:h.spacing.lg+y.bottom},h.shadows.xl]:[V.centeredContent,{backgroundColor:h.colors.background.elevated,borderRadius:I.active&&I.size?squircleHostRadius(I.size.width,I.size.height,h.radius.xl):h.radius.xl,...smoothCorners,padding:h.spacing.xl},h.shadows.xl],[r,h,V,y.bottom,I.active,I.size]),H=useMemo(()=>"bottom"===r?V.bottomWrapper:"fullScreen"===r?V.fullScreenWrapper:V.centeredWrapper,[r,V]),N=useMemo(()=>"bottom"===r?{transform:[{translateY:j}]}:"fullScreen"===r?{opacity:C}:{opacity:C,transform:[{scale:R}]},[r,R,C,j]);return _jsx(RNModal,{visible:T,transparent:!0,statusBarTranslucent:!0,navigationBarTranslucent:!0,animationType:"none",onRequestClose:q,testID:b,children:_jsxs(View,{ref:e=>{w.current=e,"function"==typeof t?t(e):t&&(t.current=e)},style:V.root,accessible:!1,accessibilityViewIsModal:!0,accessibilityRole:"alert",accessibilityLabel:l,children:[_jsxs(View,{collapsable:!1,style:[StyleSheet.absoluteFill,H,{backgroundColor:D},m],children:[_jsx(Pressable,{style:StyleSheet.absoluteFill,onPress:_,accessibilityRole:"button",accessibilityLabel:"Close modal",disabled:!n}),_jsxs(Animated.View,{style:[z,N,d],onLayout:I.onLayout,pointerEvents:"auto",children:[I.active&&I.size?_jsx(SquircleFill,{width:I.size.width,height:I.size.height,radius:h.radius.xl,fill:h.colors.background.elevated}):null,u]})]}),_jsx(ToastHost,{})]})})});Modal.displayName="Modal";const buildStyles=e=>StyleSheet.create({root:{flex:1},centeredWrapper:{flex:1,alignItems:"center",justifyContent:"center",paddingHorizontal:16},centeredContent:{maxWidth:"90%",width:"90%"},bottomWrapper:{flex:1,justifyContent:"flex-end"},bottomContent:{width:"100%"},fullScreenWrapper:{flex:1},fullScreenContent:{flex:1}});export{Modal};export default Modal;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{default,MODAL_DISMISS_GRACE_MS,Modal}from"./Modal.js";
|
|
1
|
+
"use strict";export{default,MODAL_DISMISS_GRACE_MS,Modal}from"./Modal.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
"use strict";import React,{Fragment}from"react";import{Text as RNText}from"react-native";import{useTheme}from"../../theme/index.js";import{Text}from"../Text/Text.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const SUBSCRIPTED=/(?<![A-Za-z0-9_])([A-Za-z])_([A-Za-z0-9]+)(?![A-Za-z0-9_])/g;export const parseNotation=t=>{const e=String(t??""),s=[];let o=0;for(const t of e.matchAll(SUBSCRIPTED)){const n=t.index??0;n>o&&s.push({text:e.slice(o,n)}),s.push({text:t[1],sub:t[2]}),o=n+t[0].length}return o<e.length&&s.push({text:e.slice(o)}),s};export const Notation=({text:t,base:e,sub:s,desc:o,testID:n})=>{const r=useTheme(),x={fontSize:Math.round(.75*r.typography.fontSize.sm),lineHeight:Math.round(.9*r.typography.fontSize.sm)};return null!=e?_jsxs(Text,{testID:n,children:[e,s?_jsx(RNText,{style:x,children:s}):null,o?` ${o}`:null]}):_jsx(RNText,{testID:n,children:parseNotation(t).map((t,e)=>t.sub?_jsxs(Fragment,{children:[t.text,_jsx(RNText,{style:x,children:t.sub})]},e):_jsx(Fragment,{children:t.text},e))})};export const sym=(t,e,s)=>_jsx(Notation,{base:t,sub:e,desc:s});export default Notation;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{default,Notation,parseNotation,sym}from"./Notation.js";
|
|
1
|
+
"use strict";export{default,Notation,parseNotation,sym}from"./Notation.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
"use strict";import React,{forwardRef,useCallback,useEffect,useMemo,useRef,useState}from"react";import{Pressable,StyleSheet,Text,TextInput,View}from"react-native";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{FieldBase,FieldLabel,FieldMessage,fieldTextAsString,hasFieldText,resolveFieldSize,resolveFieldTextStyle}from"../FieldBase/FieldBase.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const DEFAULT_LONG_PRESS_DELAY=500,DEFAULT_LONG_PRESS_INTERVAL=80,roundToPrecision=(e,t)=>{if(!Number.isFinite(e))return 0;if(t<=0)return Math.round(e);const i=Math.pow(10,t);return Math.round(e*i)/i},clamp=(e,t,i)=>e<t?t:e>i?i:e,formatValue=(e,t,i)=>Number.isFinite(e)?t&&i>0?e.toFixed(i):String(Math.trunc(e)):"",sanitizeTyped=(e,t)=>{if(!e)return"";let i=e.replace(/[^0-9.-]/g,"");if(i=i.replace(/(?!^)-/g,""),t){const e=i.indexOf(".");-1!==e&&(i=i.slice(0,e+1)+i.slice(e+1).replace(/\./g,""))}else i=i.replace(/\./g,"");return i},NumberInput=forwardRef((e,t)=>{const{value:i,defaultValue:l,onChange:s,min:r=Number.NEGATIVE_INFINITY,max:n=Number.POSITIVE_INFINITY,step:a=1,allowDecimal:o=!1,precision:c=0,label:u,help:d,helperText:m,error:b,disabled:p=!1,size:f="md",variant:x="inline",unit:h,haptic:y,accessibilityLabel:g,style:S,containerStyle:T,inputStyle:I,buttonStyle:F,unitStyle:N,labelStyle:j,textInputProps:C,testID:v}=e,[z,_]=useControllableState({value:i,defaultValue:l??e.min??0,onChange:s}),P=useTheme(),w=resolveFieldSize(P,f),R=resolveFieldTextStyle(P,{disabled:p}),L=useMemo(()=>buildStyles(P),[P]),V=P.components.numberInput?.longPressDelayMs??500,k=P.components.numberInput?.longPressIntervalMs??80,E=useRef(null),[D,A]=useState(formatValue(z,o,c)),[M,H]=useState(!1),[B,O]=useState(!1),W=useCallback(()=>{p||E.current?.focus()},[p]),G=useRef(null),Y=useRef(null),U=useCallback(()=>{null!==G.current&&(clearTimeout(G.current),G.current=null),null!==Y.current&&(clearInterval(Y.current),Y.current=null)},[]);useEffect(()=>U,[U]),useEffect(()=>{M||A(formatValue(z,o,c))},[z,o,c,M]);const $=z<=r,q=z>=n,J=!p,K=useCallback(e=>{const t=roundToPrecision(e,o?c:0),i=clamp(t,r,n);i!==z&&_(i)},[o,n,r,_,c,z]),Q=useCallback(()=>{if(!J||$)return;const e=resolveHaptic(y,"selection");e&&triggerHaptic(e),K(z-a)},[$,J,y,K,a,z]),X=useCallback(()=>{if(!J||q)return;const e=resolveHaptic(y,"selection");e&&triggerHaptic(e),K(z+a)},[q,J,y,K,a,z]);React.useImperativeHandle(t,()=>({focus:()=>E.current?.focus(),blur:()=>E.current?.blur(),clear:()=>{A(""),Number.isFinite(r)&&r>0?_(r):_(0<r?r:0>n?n:0)}}),[n,r,_]);const Z=useCallback(e=>{J&&(U(),G.current=setTimeout(()=>{Y.current=setInterval(()=>{"inc"===e?X():Q()},k)},V))},[U,Q,X,J,V,k]),ee=useCallback(e=>{const t=sanitizeTyped(e,o);A(t);const i=Number(t);""!==t&&"-"!==t&&"."!==t&&Number.isFinite(i)&&i>=r&&i<=n&&i!==z&&_(roundToPrecision(i,o?c:0))},[o,n,r,_,c,z]),te=useCallback(()=>{H(!1),O(!1);const e=Number(D);if(""===D||!Number.isFinite(e))return void A(formatValue(z,o,c));const t=roundToPrecision(e,o?c:0),i=clamp(t,r,n);i!==z&&_(i),A(formatValue(i,o,c))},[o,D,n,r,_,c,z]),ie=useCallback(()=>{H(!0),O(!0)},[]),le=$||p?P.colors.text.disabled:P.colors.text.primary,se=q||p?P.colors.text.disabled:P.colors.text.primary,re=w.iconSize+8,renderStepper=(e,t,i,l,s,r)=>_jsx(Pressable,{onPress:t,onLongPress:()=>Z(e),onPressOut:U,delayLongPress:V,disabled:i,accessibilityRole:"button",accessibilityLabel:l,accessibilityState:{disabled:i},style:({pressed:e})=>[{width:re,height:re,alignItems:"center",justifyContent:"center",borderRadius:re/2,...smoothCorners},e&&!i?{backgroundColor:P.colors.surface.pressed}:null,F],testID:`${v??"numberinput"}-${"inc"===e?"plus":"minus"}`,children:_jsx(Text,{style:{fontSize:w.iconSize,color:s,fontWeight:P.typography.fontWeight.semibold,lineHeight:w.iconSize+2},children:r})}),ne=g??fieldTextAsString(u)??"Number input",ae=_jsx(FieldBase,{size:f,disabled:p,error:hasFieldText(b),filled:!0,focused:B,onPress:W,pressFeedback:!1,leading:renderStepper("dec",Q,$||p,"Decrease",le,"−"),trailing:renderStepper("inc",X,q||p,"Increase",se,"+"),children:_jsxs(View,{style:L.inputRow,children:[_jsx(TextInput,{ref:E,value:D,onChangeText:ee,onFocus:ie,onBlur:te,editable:!p,keyboardType:o?"decimal-pad":"number-pad",selectTextOnFocus:!0,accessibilityRole:"adjustable",accessibilityLabel:ne,accessibilityValue:{now:Number.isFinite(z)?z:0},accessibilityState:{disabled:p},accessibilityActions:[{name:"increment",label:"Increase"},{name:"decrement",label:"Decrease"}],onAccessibilityAction:e=>{"increment"===e.nativeEvent.actionName&&X(),"decrement"===e.nativeEvent.actionName&&Q()},style:[L.input,{fontSize:w.fontSize,color:R.color,...R.weightStyle},I],...C}),h?_jsx(Text,{style:[L.unit,{fontSize:w.fontSize,color:R.placeholderColor},N],children:h}):null]})}),oe=hasFieldText(u)?_jsx(FieldLabel,{size:f,help:d,style:j,children:u}):null,ce=_jsx(FieldMessage,{size:f,error:hasFieldText(b),text:hasFieldText(b)?b:m});return _jsxs(View,"horizontal"===x?{style:[L.horizontalContainer,S,T],testID:v,accessibilityState:{disabled:p},children:[_jsx(View,{style:L.horizontalLabelWrap,children:oe}),_jsxs(View,{children:[ae,ce]})]}:{style:[S,T],testID:v,accessibilityState:{disabled:p},children:[oe,ae,ce]})});NumberInput.displayName="NumberInput";const buildStyles=e=>StyleSheet.create({inputRow:{flex:1,flexDirection:"row",alignItems:"center",justifyContent:"center"},input:{flex:1,textAlign:"center",padding:0,margin:0,includeFontPadding:!1},unit:{marginLeft:4},label:{marginBottom:6},helper:{marginTop:6},horizontalContainer:{flexDirection:"row",alignItems:"center",justifyContent:"space-between"},horizontalLabelWrap:{flexShrink:1,paddingRight:12}});export{NumberInput};export default NumberInput;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{default,NumberInput}from"./NumberInput.js";
|
|
1
|
+
"use strict";export{default,NumberInput}from"./NumberInput.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{forwardRef
|
|
1
|
+
"use strict";import{forwardRef,useCallback,useEffect,useImperativeHandle,useMemo,useRef,useState}from"react";import{Animated,Easing,Pressable,StyleSheet,Text,TextInput,View}from"react-native";import{useControllableState,useReducedMotion}from"../../hooks/index.js";import{createAnimatedValue,fontFor,setNativeValue,useTheme}from"../../theme/index.js";import{resolveHaptic,triggerHaptic}from"../../utils/index.js";import{smoothCorners}from"../../utils/corners.js";import{FieldBase}from"../FieldBase/FieldBase.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const sizeMap={sm:{cell:36,fontSize:16,borderRadius:8,gap:8},md:{cell:48,fontSize:20,borderRadius:10,gap:10},lg:{cell:56,fontSize:24,borderRadius:12,gap:12}},sanitizeChar=(e,t)=>e?"number-pad"===t?e.replace(/\D/g,""):e:"",OTPInput=forwardRef((e,t)=>{const{value:n,defaultValue:r,onChange:i,onComplete:s,length:o=6,keyboardType:a="number-pad",autoFocus:l=!1,autoFocusDelay:c=0,disabled:u=!1,error:d,size:m="md",secure:p=!1,haptic:f,accessibilityLabel:g,style:h,cellStyle:b,textStyle:y,testID:x}=e,[v,j]=useControllableState({value:n,defaultValue:r??"",onChange:i}),S=useTheme(),T=useMemo(()=>buildStyles(S),[S]),C={...sizeMap[m],...S.components.otpInput?.[m]??{}},R=useRef([]),[V,k]=useState(-1),w=useRef(null),z=useRef(createAnimatedValue(0)).current,E=useRef(new Map),I=useMemo(()=>{const e=E.current,t=[];for(let n=0;n<o;n+=1){let r=e.get(n);r||(r=new Animated.Value(0),e.set(n,r)),t.push(r)}for(const t of Array.from(e.keys()))t>=o&&e.delete(t);return t},[o]),A=useRef(-1),F=S.components.otpInput?.shakeOnError??!1,_=useReducedMotion(),H=Boolean(d),M="string"==typeof d?d:void 0;useEffect(()=>{let e;return null===w.current||!H||w.current||(!1!==f&&triggerHaptic("notificationError"),F&&!_&&(setNativeValue(z,0),e=Animated.sequence([Animated.timing(z,{toValue:1,duration:S.motion.duration.instant,easing:Easing.linear,useNativeDriver:!0}),Animated.timing(z,{toValue:-1,duration:S.motion.duration.instant,easing:Easing.linear,useNativeDriver:!0}),Animated.timing(z,{toValue:1,duration:S.motion.duration.instant,easing:Easing.linear,useNativeDriver:!0}),Animated.timing(z,{toValue:0,duration:S.motion.duration.instant,easing:Easing.linear,useNativeDriver:!0})]),e.start())),w.current=H,()=>e?.stop()},[H,z,F,f,_,S.motion.duration.instant]),useEffect(()=>{const e=A.current;if(A.current=V,e===V)return;if(-1===e&&-1===V)return;const t=[];return I.forEach((n,r)=>{const i=r===V?1:0;if(r!==V&&r!==e)return;const s=Animated.timing(n,{toValue:i,duration:S.motion.duration.fast,easing:Easing.bezier(...S.motion.easing.standard),useNativeDriver:!0});s.start(),t.push(s)}),()=>t.forEach(e=>e.stop())},[V,I,S]);const D=useCallback(e=>{const t=R.current[e];t&&t.focus()},[]);useImperativeHandle(t,()=>({focus:()=>D(0),blur:()=>{const e=R.current[V>=0?V:0];e?.blur()},clear:()=>{j(""),D(0)}}),[D,V,j]),useEffect(()=>{if(l&&!u){const e=setTimeout(()=>D(0),c);return()=>clearTimeout(e)}},[l,c,u,D]);const O=useMemo(()=>{const e=new Array(o).fill("");for(let t=0;t<Math.min(v.length,o);t+=1)e[t]=v[t]??"";return e},[v,o]),P=useCallback(e=>{const t=e.slice(0,o);t!==v&&(j(t),t.length===o&&s&&s(t))},[o,j,s,v]),B=useCallback((e,t)=>{const n=t.replace(/\u200B/g,""),r=sanitizeChar(n,a);if(!r){const t=O.slice(),n=(t[e]??"").length>0;if(t[e]="",P(t.join("").slice(0,o)),!n&&e>0){const t=O.slice();t[e-1]="",P(t.join("")),D(e-1)}return}const i=O[e]??"",s=i&&r.length>o&&r.startsWith(i)?r.slice(i.length):r;if(s.length>=o){const t=s.slice(0,o),n=v.length;if(P(t),t.length!==n){const e=resolveHaptic(f,"selection");e&&triggerHaptic(e)}return void R.current[e]?.blur()}const l=O.slice();let c=e;for(let e=0;e<r.length&&c<o;e+=1)l[c]=r[e]??"",c+=1;const u=l.join("").slice(0,o),d=v.length;if(P(u),u.length!==d){const e=resolveHaptic(f,"selection");e&&triggerHaptic(e)}const m=Math.min(c,o-1);c>=o?R.current[e]?.blur():D(m)},[O,D,a,o,f,P,v]),N=useCallback((e,t)=>{if("Backspace"!==t.nativeEvent.key)return;if(0===(O[e]??"").length){if(e>0){const t=O.slice();t[e-1]="",P(t.join("")),D(e-1)}}else{const t=O.slice();t[e]="",P(t.join(""))}},[O,D,P]),L=useCallback(e=>{k(e)},[]),W=useCallback(()=>{k(-1)},[]),$=useCallback(()=>{if(u)return;const e=O.findIndex(e=>""===e);D(-1===e?o-1:e)},[O,u,D,o]),q=g??`Enter ${o}-digit code`,G=z.interpolate({inputRange:[-1,1],outputRange:[-6,6]});return _jsxs(View,{style:h,accessible:!0,accessibilityRole:"none",accessibilityLabel:q,accessibilityValue:{text:n},accessibilityState:{disabled:u},testID:x,children:[_jsx(Pressable,{onPress:$,disabled:u,accessible:!1,children:_jsx(Animated.View,{style:[T.row,{columnGap:C.gap,transform:[{translateX:G}]}],children:O.map((e,t)=>{const n=V===t,r=e.length>0,i=H?S.colors.border.error:S.colors.border.focus,s=I[t];if(!s)return null;const l=p&&r?"●":e;return _jsxs(View,{style:T.cellWrapper,children:[_jsxs(FieldBase,{size:m,width:C.cell,height:C.cell,borderRadius:C.borderRadius,borderWidth:1.5,focused:n,error:H,filled:r,disabled:u,paddingHorizontal:0,paddingVertical:0,gap:0,style:b,children:[_jsx(TextInput,{ref:e=>{R.current[t]=e},value:(p&&r?"":e)||"",onChangeText:e=>B(t,e),onKeyPress:e=>N(t,e),onFocus:()=>L(t),onBlur:W,keyboardType:a,editable:!u,selectTextOnFocus:!0,caretHidden:r,maxLength:o+1,textContentType:"oneTimeCode",autoComplete:0===t?"sms-otp":"off",importantForAutofill:0===t?"yes":"no",style:[T.input,{fontSize:C.fontSize,color:S.colors.text.primary,...fontFor(S,"semibold")},y]}),p&&r?_jsx(View,{pointerEvents:"none",style:T.maskOverlay,children:_jsx(Text,{style:[{fontSize:C.fontSize,color:S.colors.text.primary,...fontFor(S,"semibold")},y],children:l})}):null]}),_jsx(Animated.View,{style:[T.underline,{backgroundColor:i,opacity:s}]})]},`otp-cell-${t}`)})})}),M?_jsx(Text,{style:[T.errorText,{color:S.colors.error,fontSize:S.typography.fontSize.sm}],accessibilityLiveRegion:"polite",children:M}):null]})});OTPInput.displayName="OTPInput";const buildStyles=e=>StyleSheet.create({row:{flexDirection:"row",alignItems:"center"},cellWrapper:{alignItems:"center"},input:{width:"100%",height:"100%",textAlign:"center",padding:0},maskOverlay:{...StyleSheet.absoluteFill,alignItems:"center",justifyContent:"center"},underline:{marginTop:4,height:2,width:"60%",borderRadius:1,...smoothCorners},errorText:{marginTop:6}});export{OTPInput};export default OTPInput;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{default,OTPInput}from"./OTPInput.js";
|
|
1
|
+
"use strict";export{default,OTPInput}from"./OTPInput.js";
|