@webority/mobile-ui 0.149.0 → 0.150.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/dist/canvas-kit/kit.js +13 -56714
- package/dist/canvas-kit/manifest.json +20 -41
- package/dist/canvas-kit/release.json +6 -6
- package/lib/commonjs/components/Accordion/Accordion.js +1 -1
- package/lib/commonjs/components/AppIcon/AppIcon.js +1 -1
- package/lib/commonjs/components/AppIcon/glyphs.g.js +1 -1
- package/lib/commonjs/components/AsyncBlock/AsyncBlock.js +1 -1
- package/lib/commonjs/components/AuthedImage/AuthedImage.js +1 -1
- package/lib/commonjs/components/AuthedImage/authedImageCache.js +1 -1
- package/lib/commonjs/components/Avatar/Avatar.js +1 -1
- package/lib/commonjs/components/Badge/Badge.js +1 -1
- package/lib/commonjs/components/Banner/Banner.js +1 -1
- package/lib/commonjs/components/BottomNavigation/BottomNavigation.js +1 -1
- package/lib/commonjs/components/Box/Box.js +1 -1
- package/lib/commonjs/components/Card/Card.js +1 -1
- package/lib/commonjs/components/Carousel/Carousel.js +1 -1
- package/lib/commonjs/components/Chip/Chip.js +1 -1
- package/lib/commonjs/components/ChoiceGroup/ChoiceGroup.js +1 -1
- package/lib/commonjs/components/Confetti/Confetti.js +1 -1
- package/lib/commonjs/components/DatePicker/DatePicker.js +1 -1
- package/lib/commonjs/components/DateRangePicker/DateRangePicker.js +1 -1
- package/lib/commonjs/components/Descriptions/Descriptions.js +1 -1
- package/lib/commonjs/components/Dialog/Dialog.js +1 -1
- package/lib/commonjs/components/FileViewer/fileSource.js +1 -1
- package/lib/commonjs/components/FloatingActionButton/FloatingActionButton.js +1 -1
- package/lib/commonjs/components/ImageGallery/ImageGallery.js +1 -1
- package/lib/commonjs/components/InlineSelect/InlineSelect.js +1 -1
- package/lib/commonjs/components/Input/Input.js +1 -1
- package/lib/commonjs/components/ListItem/ListItem.js +1 -1
- package/lib/commonjs/components/Markdown/Markdown.js +1 -1
- package/lib/commonjs/components/Menu/MenuSurface.js +1 -1
- package/lib/commonjs/components/Menu/focusHost.js +1 -1
- package/lib/commonjs/components/OptionSheet/OptionSheet.js +1 -1
- package/lib/commonjs/components/OptionSheet/optionAccessors.js +1 -0
- package/lib/commonjs/components/PhoneNumberInput/PhoneNumberInput.js +1 -1
- package/lib/commonjs/components/ProgressRing/ProgressRing.js +1 -1
- package/lib/commonjs/components/Radio/RadioGroup.js +1 -1
- package/lib/commonjs/components/Rating/Rating.js +1 -1
- package/lib/commonjs/components/Repeater/Repeater.js +1 -1
- package/lib/commonjs/components/Screen/Screen.js +1 -1
- package/lib/commonjs/components/SearchBar/useRecentSearches.js +1 -1
- package/lib/commonjs/components/SegmentedControl/SegmentedControl.js +1 -1
- package/lib/commonjs/components/Select/Select.js +1 -1
- package/lib/commonjs/components/Skeleton/SkeletonContent.js +1 -1
- package/lib/commonjs/components/Skeleton/SkeletonList.js +1 -1
- package/lib/commonjs/components/Slider/Slider.js +1 -1
- package/lib/commonjs/components/SliderField/SliderField.js +1 -1
- package/lib/commonjs/components/SortableList/SortableList.js +1 -1
- package/lib/commonjs/components/Sparkline/Sparkline.js +1 -1
- package/lib/commonjs/components/SquircleFill/SquircleFill.js +1 -1
- package/lib/commonjs/components/StatTile/StatTile.js +1 -1
- package/lib/commonjs/components/StatusBadge/StatusBadge.js +1 -1
- package/lib/commonjs/components/StatusBadge/statusMap.js +1 -1
- package/lib/commonjs/components/Stepper/Stepper.js +1 -1
- package/lib/commonjs/components/Text/Text.js +1 -1
- package/lib/commonjs/components/TimePicker/TimePicker.js +1 -1
- package/lib/commonjs/components/WheelPicker/WheelPicker.js +1 -1
- package/lib/commonjs/form/HookFormField.js +1 -1
- package/lib/commonjs/form/path.js +1 -1
- package/lib/commonjs/hooks/useControllableState.js +1 -1
- package/lib/commonjs/specs/NativePdfRasterizer.js +1 -1
- package/lib/commonjs/theme/ThemeContext.js +1 -1
- package/lib/commonjs/theme/animatedValue.js +1 -1
- package/lib/commonjs/theme/componentSizes.js +1 -1
- package/lib/commonjs/theme/merge.js +1 -1
- package/lib/commonjs/theme/scale.js +1 -1
- package/lib/commonjs/utils/complete.js +1 -0
- package/lib/commonjs/utils/guards.js +1 -0
- package/lib/commonjs/utils/hapticUtils.js +1 -1
- package/lib/module/components/Accordion/Accordion.js +1 -1
- package/lib/module/components/AppIcon/AppIcon.js +1 -1
- package/lib/module/components/AppIcon/glyphs.g.js +1 -1
- package/lib/module/components/AsyncBlock/AsyncBlock.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/Avatar/Avatar.js +1 -1
- package/lib/module/components/Badge/Badge.js +1 -1
- package/lib/module/components/Banner/Banner.js +1 -1
- package/lib/module/components/BottomNavigation/BottomNavigation.js +1 -1
- package/lib/module/components/Box/Box.js +1 -1
- package/lib/module/components/Card/Card.js +1 -1
- package/lib/module/components/Carousel/Carousel.js +1 -1
- package/lib/module/components/Chip/Chip.js +1 -1
- package/lib/module/components/ChoiceGroup/ChoiceGroup.js +1 -1
- package/lib/module/components/Confetti/Confetti.js +1 -1
- package/lib/module/components/DatePicker/DatePicker.js +1 -1
- package/lib/module/components/DateRangePicker/DateRangePicker.js +1 -1
- package/lib/module/components/Descriptions/Descriptions.js +1 -1
- package/lib/module/components/Dialog/Dialog.js +1 -1
- package/lib/module/components/FileViewer/fileSource.js +1 -1
- package/lib/module/components/FloatingActionButton/FloatingActionButton.js +1 -1
- package/lib/module/components/ImageGallery/ImageGallery.js +1 -1
- package/lib/module/components/InlineSelect/InlineSelect.js +1 -1
- package/lib/module/components/Input/Input.js +1 -1
- package/lib/module/components/ListItem/ListItem.js +1 -1
- package/lib/module/components/Markdown/Markdown.js +1 -1
- package/lib/module/components/Menu/MenuSurface.js +1 -1
- package/lib/module/components/Menu/focusHost.js +1 -1
- package/lib/module/components/OptionSheet/OptionSheet.js +1 -1
- package/lib/module/components/OptionSheet/optionAccessors.js +1 -0
- package/lib/module/components/PhoneNumberInput/PhoneNumberInput.js +1 -1
- package/lib/module/components/ProgressRing/ProgressRing.js +1 -1
- package/lib/module/components/Radio/RadioGroup.js +1 -1
- package/lib/module/components/Rating/Rating.js +1 -1
- package/lib/module/components/Repeater/Repeater.js +1 -1
- package/lib/module/components/Screen/Screen.js +1 -1
- package/lib/module/components/SearchBar/useRecentSearches.js +1 -1
- package/lib/module/components/SegmentedControl/SegmentedControl.js +1 -1
- package/lib/module/components/Select/Select.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/Slider/Slider.js +1 -1
- package/lib/module/components/SliderField/SliderField.js +1 -1
- package/lib/module/components/SortableList/SortableList.js +1 -1
- package/lib/module/components/Sparkline/Sparkline.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/StatusBadge/StatusBadge.js +1 -1
- package/lib/module/components/StatusBadge/statusMap.js +1 -1
- package/lib/module/components/Stepper/Stepper.js +1 -1
- package/lib/module/components/Text/Text.js +1 -1
- package/lib/module/components/TimePicker/TimePicker.js +1 -1
- package/lib/module/components/WheelPicker/WheelPicker.js +1 -1
- package/lib/module/form/HookFormField.js +1 -1
- package/lib/module/form/path.js +1 -1
- package/lib/module/hooks/useControllableState.js +1 -1
- package/lib/module/specs/NativePdfRasterizer.js +1 -1
- package/lib/module/theme/ThemeContext.js +1 -1
- package/lib/module/theme/animatedValue.js +1 -1
- package/lib/module/theme/componentSizes.js +1 -1
- package/lib/module/theme/merge.js +1 -1
- package/lib/module/theme/scale.js +1 -1
- package/lib/module/utils/complete.js +1 -0
- package/lib/module/utils/guards.js +1 -0
- package/lib/module/utils/hapticUtils.js +1 -1
- package/lib/typescript/commonjs/canvasKit/index.d.ts +12 -12
- package/lib/typescript/commonjs/canvasKit/meta.d.ts +5 -7
- package/lib/typescript/commonjs/components/Accordion/Accordion.d.ts +22 -22
- package/lib/typescript/commonjs/components/AmountSlider/AmountSlider.d.ts +23 -23
- package/lib/typescript/commonjs/components/AnimatePresence/AnimatePresence.d.ts +5 -5
- package/lib/typescript/commonjs/components/AppBar/AppBar.d.ts +39 -39
- package/lib/typescript/commonjs/components/AppIcon/AppIcon.d.ts +7 -7
- package/lib/typescript/commonjs/components/AppIcon/defaultIcons.d.ts +2 -1
- package/lib/typescript/commonjs/components/AppIcon/glyphs.g.d.ts +233 -233
- package/lib/typescript/commonjs/components/AppIcon/slotIcon.d.ts +1 -1
- package/lib/typescript/commonjs/components/AppLockOverlay/AppLockOverlay.d.ts +5 -5
- package/lib/typescript/commonjs/components/AsyncBlock/AsyncBlock.d.ts +22 -40
- package/lib/typescript/commonjs/components/AuthedImage/AuthedImage.d.ts +15 -15
- package/lib/typescript/commonjs/components/AuthedImage/authedImageCache.d.ts +2 -2
- package/lib/typescript/commonjs/components/Autocomplete/Autocomplete.d.ts +24 -24
- package/lib/typescript/commonjs/components/Avatar/Avatar.d.ts +36 -36
- package/lib/typescript/commonjs/components/Badge/Badge.d.ts +18 -18
- package/lib/typescript/commonjs/components/Banner/Banner.d.ts +25 -25
- package/lib/typescript/commonjs/components/BarChart/BarChart.d.ts +21 -21
- package/lib/typescript/commonjs/components/BottomNavigation/BottomNavigation.d.ts +36 -36
- package/lib/typescript/commonjs/components/BottomSheet/BottomSheet.d.ts +32 -32
- package/lib/typescript/commonjs/components/Box/Box.d.ts +27 -27
- package/lib/typescript/commonjs/components/Button/Button.d.ts +22 -22
- package/lib/typescript/commonjs/components/Calendar/Calendar.d.ts +20 -20
- package/lib/typescript/commonjs/components/Calendar/CalendarDay.d.ts +4 -2
- package/lib/typescript/commonjs/components/Card/Card.d.ts +41 -41
- package/lib/typescript/commonjs/components/Carousel/Carousel.d.ts +21 -21
- package/lib/typescript/commonjs/components/Checkbox/Checkbox.d.ts +21 -21
- package/lib/typescript/commonjs/components/Chip/Chip.d.ts +23 -23
- package/lib/typescript/commonjs/components/ChoiceGroup/ChoiceGroup.d.ts +51 -46
- package/lib/typescript/commonjs/components/Composer/Composer.d.ts +27 -27
- package/lib/typescript/commonjs/components/Confetti/Confetti.d.ts +22 -21
- package/lib/typescript/commonjs/components/Confirm/confirm.d.ts +4 -4
- package/lib/typescript/commonjs/components/DatePicker/DatePicker.d.ts +20 -20
- package/lib/typescript/commonjs/components/DateRangePicker/DateRangePicker.d.ts +22 -22
- package/lib/typescript/commonjs/components/DateSeparator/DateSeparator.d.ts +9 -9
- package/lib/typescript/commonjs/components/DecimalInput/DecimalInput.d.ts +14 -14
- package/lib/typescript/commonjs/components/Descriptions/Descriptions.d.ts +13 -13
- package/lib/typescript/commonjs/components/Dialog/Dialog.d.ts +24 -24
- package/lib/typescript/commonjs/components/Dialog/OverlayActions.d.ts +5 -5
- package/lib/typescript/commonjs/components/Divider/Divider.d.ts +9 -9
- package/lib/typescript/commonjs/components/Drawer/Drawer.d.ts +14 -14
- package/lib/typescript/commonjs/components/EmptyState/EmptyState.d.ts +13 -13
- package/lib/typescript/commonjs/components/ErrorBoundary/ErrorBoundary.d.ts +8 -8
- package/lib/typescript/commonjs/components/FieldBase/Chevron.d.ts +2 -2
- package/lib/typescript/commonjs/components/FieldBase/ChoiceText.d.ts +10 -10
- package/lib/typescript/commonjs/components/FieldBase/FieldBase.d.ts +54 -54
- package/lib/typescript/commonjs/components/FieldBase/useFloatingLabel.d.ts +8 -8
- package/lib/typescript/commonjs/components/FilePicker/FilePicker.d.ts +35 -35
- package/lib/typescript/commonjs/components/FileViewer/FileViewer.d.ts +10 -10
- package/lib/typescript/commonjs/components/FileViewer/fileSource.d.ts +3 -3
- package/lib/typescript/commonjs/components/FilterChipRow/FilterChipRow.d.ts +12 -12
- package/lib/typescript/commonjs/components/FloatingActionButton/FloatingActionButton.d.ts +35 -35
- package/lib/typescript/commonjs/components/ForceUpdateDialog/ForceUpdateDialog.d.ts +11 -11
- package/lib/typescript/commonjs/components/FormField/FormField.d.ts +15 -15
- package/lib/typescript/commonjs/components/IconBadge/IconBadge.d.ts +11 -11
- package/lib/typescript/commonjs/components/IconButton/IconButton.d.ts +14 -14
- package/lib/typescript/commonjs/components/ImageGallery/ImageGallery.d.ts +14 -14
- package/lib/typescript/commonjs/components/InlineSelect/InlineSelect.d.ts +36 -31
- package/lib/typescript/commonjs/components/Input/Input.d.ts +47 -47
- package/lib/typescript/commonjs/components/KeyboardAwareScrollView/KeyboardAwareScrollView.d.ts +7 -7
- package/lib/typescript/commonjs/components/KeyboardToolbar/KeyboardToolbar.d.ts +8 -8
- package/lib/typescript/commonjs/components/ListItem/ListItem.d.ts +44 -44
- package/lib/typescript/commonjs/components/ListSection/ListSection.d.ts +6 -6
- package/lib/typescript/commonjs/components/LoaderOverlay/LoaderOverlay.d.ts +17 -11
- package/lib/typescript/commonjs/components/Markdown/Markdown.d.ts +15 -15
- package/lib/typescript/commonjs/components/Menu/Menu.d.ts +17 -12
- package/lib/typescript/commonjs/components/Menu/MenuSurface.d.ts +8 -8
- package/lib/typescript/commonjs/components/Menu/menuModel.d.ts +11 -11
- package/lib/typescript/commonjs/components/Menu/useContextMenu.d.ts +13 -13
- package/lib/typescript/commonjs/components/Menu/webOnly.d.ts +3 -3
- package/lib/typescript/commonjs/components/MessageBubble/MessageBubble.d.ts +20 -20
- package/lib/typescript/commonjs/components/MessageList/MessageList.d.ts +14 -14
- package/lib/typescript/commonjs/components/Modal/Modal.d.ts +19 -19
- package/lib/typescript/commonjs/components/NumberInput/NumberInput.d.ts +27 -27
- package/lib/typescript/commonjs/components/OTPInput/OTPInput.d.ts +20 -20
- package/lib/typescript/commonjs/components/OTPInput/OTPResendRow.d.ts +9 -9
- package/lib/typescript/commonjs/components/OnboardingPager/OnboardingPager.d.ts +5 -5
- package/lib/typescript/commonjs/components/OptionSheet/OptionSheet.d.ts +33 -33
- package/lib/typescript/commonjs/components/OptionSheet/optionAccessors.d.ts +8 -0
- package/lib/typescript/commonjs/components/PagedListFooter/PagedListFooter.d.ts +2 -2
- package/lib/typescript/commonjs/components/PermissionPrompt/PermissionPrompt.d.ts +6 -6
- package/lib/typescript/commonjs/components/PermissionPrompt/usePermissionPrompt.d.ts +1 -1
- package/lib/typescript/commonjs/components/PhoneNumberInput/PhoneNumberInput.d.ts +43 -43
- package/lib/typescript/commonjs/components/PickerTrigger/PickerTrigger.d.ts +23 -23
- package/lib/typescript/commonjs/components/ProfileCompletion/ProfileCompletion.d.ts +23 -23
- package/lib/typescript/commonjs/components/ProfilePicker/ProfilePicker.d.ts +30 -30
- package/lib/typescript/commonjs/components/ProgressBar/ProgressBar.d.ts +21 -21
- package/lib/typescript/commonjs/components/ProgressRing/ProgressRing.d.ts +13 -13
- package/lib/typescript/commonjs/components/Radio/Radio.d.ts +18 -18
- package/lib/typescript/commonjs/components/Radio/RadioDot.d.ts +5 -5
- package/lib/typescript/commonjs/components/Radio/RadioGroup.d.ts +8 -8
- package/lib/typescript/commonjs/components/Rating/Rating.d.ts +15 -15
- package/lib/typescript/commonjs/components/Repeater/Repeater.d.ts +10 -10
- package/lib/typescript/commonjs/components/RichTextEditor/RichTextEditor.d.ts +15 -15
- package/lib/typescript/commonjs/components/ScannerOverlay/ScannerOverlay.d.ts +13 -13
- package/lib/typescript/commonjs/components/Screen/Screen.d.ts +43 -44
- package/lib/typescript/commonjs/components/Screen/index.d.ts +1 -1
- package/lib/typescript/commonjs/components/SearchBar/SearchBar.d.ts +31 -31
- package/lib/typescript/commonjs/components/SearchBar/SearchPanel.d.ts +6 -6
- package/lib/typescript/commonjs/components/SearchBar/useRecentSearches.d.ts +1 -1
- package/lib/typescript/commonjs/components/SectionHeader/SectionHeader.d.ts +10 -10
- package/lib/typescript/commonjs/components/SegmentedControl/SegmentedControl.d.ts +25 -24
- package/lib/typescript/commonjs/components/Select/Select.d.ts +50 -45
- package/lib/typescript/commonjs/components/SignaturePad/SignaturePad.d.ts +20 -20
- package/lib/typescript/commonjs/components/Skeleton/Skeleton.d.ts +13 -13
- package/lib/typescript/commonjs/components/Skeleton/SkeletonContent.d.ts +9 -9
- package/lib/typescript/commonjs/components/Skeleton/SkeletonList.d.ts +30 -8
- package/lib/typescript/commonjs/components/Skeleton/SkeletonProvider.d.ts +9 -9
- package/lib/typescript/commonjs/components/SlideToConfirm/SlideToConfirm.d.ts +14 -14
- package/lib/typescript/commonjs/components/Slider/Slider.d.ts +30 -30
- package/lib/typescript/commonjs/components/Slider/valueText.d.ts +9 -9
- package/lib/typescript/commonjs/components/SliderField/SliderField.d.ts +41 -41
- package/lib/typescript/commonjs/components/SortableList/SortableList.d.ts +5 -5
- package/lib/typescript/commonjs/components/Sparkline/Sparkline.d.ts +13 -13
- package/lib/typescript/commonjs/components/Sparkline/geometry.d.ts +3 -1
- package/lib/typescript/commonjs/components/Spinner/Spinner.d.ts +10 -10
- package/lib/typescript/commonjs/components/SquircleFill/SquircleFill.d.ts +3 -3
- package/lib/typescript/commonjs/components/SquircleImage/SquircleImage.d.ts +5 -12
- package/lib/typescript/commonjs/components/StatTile/StatTile.d.ts +14 -14
- package/lib/typescript/commonjs/components/StatusBadge/StatusBadge.d.ts +13 -13
- package/lib/typescript/commonjs/components/Stepper/Stepper.d.ts +21 -21
- package/lib/typescript/commonjs/components/Swipeable/Swipeable.d.ts +15 -15
- package/lib/typescript/commonjs/components/Switch/Switch.d.ts +19 -19
- package/lib/typescript/commonjs/components/Tabs/Tabs.d.ts +20 -20
- package/lib/typescript/commonjs/components/TagInput/TagInput.d.ts +19 -19
- package/lib/typescript/commonjs/components/Text/Text.d.ts +10 -10
- package/lib/typescript/commonjs/components/TimePicker/TimePicker.d.ts +14 -14
- package/lib/typescript/commonjs/components/Timeline/Timeline.d.ts +12 -12
- package/lib/typescript/commonjs/components/Toast/Toast.d.ts +17 -17
- package/lib/typescript/commonjs/components/Toast/ToastProvider.d.ts +8 -8
- package/lib/typescript/commonjs/components/Tooltip/RichTooltipBody.d.ts +4 -4
- package/lib/typescript/commonjs/components/Tooltip/Tooltip.d.ts +24 -19
- package/lib/typescript/commonjs/components/Tour/Tour.d.ts +7 -7
- package/lib/typescript/commonjs/components/TypingIndicator/TypingIndicator.d.ts +6 -6
- package/lib/typescript/commonjs/components/WheelPicker/Wheel.d.ts +6 -6
- package/lib/typescript/commonjs/components/WheelPicker/WheelPicker.d.ts +20 -20
- package/lib/typescript/commonjs/components/ZoomableImage/ZoomableImage.d.ts +8 -8
- package/lib/typescript/commonjs/form/HookFormField.d.ts +5 -18
- package/lib/typescript/commonjs/form/path.d.ts +4 -2
- package/lib/typescript/commonjs/form/useFormCompletion.d.ts +1 -1
- package/lib/typescript/commonjs/hooks/useControllableState.d.ts +2 -2
- package/lib/typescript/commonjs/hooks/useDragToDismiss.d.ts +3 -3
- package/lib/typescript/commonjs/hooks/useFieldErrorScroll.d.ts +1 -1
- package/lib/typescript/commonjs/hooks/usePressAnimation.d.ts +4 -4
- package/lib/typescript/commonjs/hooks/useRefreshControl.d.ts +8 -8
- package/lib/typescript/commonjs/hooks/useResendCountdown.d.ts +1 -1
- package/lib/typescript/commonjs/hooks/useScrollDirection.d.ts +1 -1
- package/lib/typescript/commonjs/navigation/DiscardGuard.d.ts +2 -2
- package/lib/typescript/commonjs/navigation/NavigationScreen.d.ts +3 -3
- package/lib/typescript/commonjs/network/NetworkStatusBanner.d.ts +7 -7
- package/lib/typescript/commonjs/theme/Gradient.d.ts +2 -2
- package/lib/typescript/commonjs/theme/ThemeContext.d.ts +5 -5
- package/lib/typescript/commonjs/theme/componentSizes.d.ts +15 -38
- package/lib/typescript/commonjs/theme/types.d.ts +84 -84
- package/lib/typescript/commonjs/utils/announce.d.ts +1 -1
- package/lib/typescript/commonjs/utils/complete.d.ts +5 -0
- package/lib/typescript/commonjs/utils/feedback.d.ts +3 -1
- package/lib/typescript/commonjs/utils/guards.d.ts +9 -0
- package/lib/typescript/commonjs/utils/placement.d.ts +3 -3
- package/lib/typescript/commonjs/utils/squircle.d.ts +2 -2
- package/lib/typescript/module/canvasKit/index.d.ts +12 -12
- package/lib/typescript/module/canvasKit/meta.d.ts +5 -7
- package/lib/typescript/module/components/Accordion/Accordion.d.ts +22 -22
- package/lib/typescript/module/components/AmountSlider/AmountSlider.d.ts +23 -23
- package/lib/typescript/module/components/AnimatePresence/AnimatePresence.d.ts +5 -5
- package/lib/typescript/module/components/AppBar/AppBar.d.ts +39 -39
- package/lib/typescript/module/components/AppIcon/AppIcon.d.ts +7 -7
- package/lib/typescript/module/components/AppIcon/defaultIcons.d.ts +2 -1
- package/lib/typescript/module/components/AppIcon/glyphs.g.d.ts +233 -233
- package/lib/typescript/module/components/AppIcon/slotIcon.d.ts +1 -1
- package/lib/typescript/module/components/AppLockOverlay/AppLockOverlay.d.ts +5 -5
- package/lib/typescript/module/components/AsyncBlock/AsyncBlock.d.ts +22 -40
- package/lib/typescript/module/components/AuthedImage/AuthedImage.d.ts +15 -15
- package/lib/typescript/module/components/AuthedImage/authedImageCache.d.ts +2 -2
- package/lib/typescript/module/components/Autocomplete/Autocomplete.d.ts +24 -24
- package/lib/typescript/module/components/Avatar/Avatar.d.ts +36 -36
- package/lib/typescript/module/components/Badge/Badge.d.ts +18 -18
- package/lib/typescript/module/components/Banner/Banner.d.ts +25 -25
- package/lib/typescript/module/components/BarChart/BarChart.d.ts +21 -21
- package/lib/typescript/module/components/BottomNavigation/BottomNavigation.d.ts +36 -36
- package/lib/typescript/module/components/BottomSheet/BottomSheet.d.ts +32 -32
- package/lib/typescript/module/components/Box/Box.d.ts +27 -27
- package/lib/typescript/module/components/Button/Button.d.ts +22 -22
- package/lib/typescript/module/components/Calendar/Calendar.d.ts +20 -20
- package/lib/typescript/module/components/Calendar/CalendarDay.d.ts +4 -2
- package/lib/typescript/module/components/Card/Card.d.ts +41 -41
- package/lib/typescript/module/components/Carousel/Carousel.d.ts +21 -21
- package/lib/typescript/module/components/Checkbox/Checkbox.d.ts +21 -21
- package/lib/typescript/module/components/Chip/Chip.d.ts +23 -23
- package/lib/typescript/module/components/ChoiceGroup/ChoiceGroup.d.ts +51 -46
- package/lib/typescript/module/components/Composer/Composer.d.ts +27 -27
- package/lib/typescript/module/components/Confetti/Confetti.d.ts +22 -21
- package/lib/typescript/module/components/Confirm/confirm.d.ts +4 -4
- package/lib/typescript/module/components/DatePicker/DatePicker.d.ts +20 -20
- package/lib/typescript/module/components/DateRangePicker/DateRangePicker.d.ts +22 -22
- package/lib/typescript/module/components/DateSeparator/DateSeparator.d.ts +9 -9
- package/lib/typescript/module/components/DecimalInput/DecimalInput.d.ts +14 -14
- package/lib/typescript/module/components/Descriptions/Descriptions.d.ts +13 -13
- package/lib/typescript/module/components/Dialog/Dialog.d.ts +24 -24
- package/lib/typescript/module/components/Dialog/OverlayActions.d.ts +5 -5
- package/lib/typescript/module/components/Divider/Divider.d.ts +9 -9
- package/lib/typescript/module/components/Drawer/Drawer.d.ts +14 -14
- package/lib/typescript/module/components/EmptyState/EmptyState.d.ts +13 -13
- package/lib/typescript/module/components/ErrorBoundary/ErrorBoundary.d.ts +8 -8
- package/lib/typescript/module/components/FieldBase/Chevron.d.ts +2 -2
- package/lib/typescript/module/components/FieldBase/ChoiceText.d.ts +10 -10
- package/lib/typescript/module/components/FieldBase/FieldBase.d.ts +54 -54
- package/lib/typescript/module/components/FieldBase/useFloatingLabel.d.ts +8 -8
- package/lib/typescript/module/components/FilePicker/FilePicker.d.ts +35 -35
- package/lib/typescript/module/components/FileViewer/FileViewer.d.ts +10 -10
- package/lib/typescript/module/components/FileViewer/fileSource.d.ts +3 -3
- package/lib/typescript/module/components/FilterChipRow/FilterChipRow.d.ts +12 -12
- package/lib/typescript/module/components/FloatingActionButton/FloatingActionButton.d.ts +35 -35
- package/lib/typescript/module/components/ForceUpdateDialog/ForceUpdateDialog.d.ts +11 -11
- package/lib/typescript/module/components/FormField/FormField.d.ts +15 -15
- package/lib/typescript/module/components/IconBadge/IconBadge.d.ts +11 -11
- package/lib/typescript/module/components/IconButton/IconButton.d.ts +14 -14
- package/lib/typescript/module/components/ImageGallery/ImageGallery.d.ts +14 -14
- package/lib/typescript/module/components/InlineSelect/InlineSelect.d.ts +36 -31
- package/lib/typescript/module/components/Input/Input.d.ts +47 -47
- package/lib/typescript/module/components/KeyboardAwareScrollView/KeyboardAwareScrollView.d.ts +7 -7
- package/lib/typescript/module/components/KeyboardToolbar/KeyboardToolbar.d.ts +8 -8
- package/lib/typescript/module/components/ListItem/ListItem.d.ts +44 -44
- package/lib/typescript/module/components/ListSection/ListSection.d.ts +6 -6
- package/lib/typescript/module/components/LoaderOverlay/LoaderOverlay.d.ts +17 -11
- package/lib/typescript/module/components/Markdown/Markdown.d.ts +15 -15
- package/lib/typescript/module/components/Menu/Menu.d.ts +17 -12
- package/lib/typescript/module/components/Menu/MenuSurface.d.ts +8 -8
- package/lib/typescript/module/components/Menu/menuModel.d.ts +11 -11
- package/lib/typescript/module/components/Menu/useContextMenu.d.ts +13 -13
- package/lib/typescript/module/components/Menu/webOnly.d.ts +3 -3
- package/lib/typescript/module/components/MessageBubble/MessageBubble.d.ts +20 -20
- package/lib/typescript/module/components/MessageList/MessageList.d.ts +14 -14
- package/lib/typescript/module/components/Modal/Modal.d.ts +19 -19
- package/lib/typescript/module/components/NumberInput/NumberInput.d.ts +27 -27
- package/lib/typescript/module/components/OTPInput/OTPInput.d.ts +20 -20
- package/lib/typescript/module/components/OTPInput/OTPResendRow.d.ts +9 -9
- package/lib/typescript/module/components/OnboardingPager/OnboardingPager.d.ts +5 -5
- package/lib/typescript/module/components/OptionSheet/OptionSheet.d.ts +33 -33
- package/lib/typescript/module/components/OptionSheet/optionAccessors.d.ts +8 -0
- package/lib/typescript/module/components/PagedListFooter/PagedListFooter.d.ts +2 -2
- package/lib/typescript/module/components/PermissionPrompt/PermissionPrompt.d.ts +6 -6
- package/lib/typescript/module/components/PermissionPrompt/usePermissionPrompt.d.ts +1 -1
- package/lib/typescript/module/components/PhoneNumberInput/PhoneNumberInput.d.ts +43 -43
- package/lib/typescript/module/components/PickerTrigger/PickerTrigger.d.ts +23 -23
- package/lib/typescript/module/components/ProfileCompletion/ProfileCompletion.d.ts +23 -23
- package/lib/typescript/module/components/ProfilePicker/ProfilePicker.d.ts +30 -30
- package/lib/typescript/module/components/ProgressBar/ProgressBar.d.ts +21 -21
- package/lib/typescript/module/components/ProgressRing/ProgressRing.d.ts +13 -13
- package/lib/typescript/module/components/Radio/Radio.d.ts +18 -18
- package/lib/typescript/module/components/Radio/RadioDot.d.ts +5 -5
- package/lib/typescript/module/components/Radio/RadioGroup.d.ts +8 -8
- package/lib/typescript/module/components/Rating/Rating.d.ts +15 -15
- package/lib/typescript/module/components/Repeater/Repeater.d.ts +10 -10
- package/lib/typescript/module/components/RichTextEditor/RichTextEditor.d.ts +15 -15
- package/lib/typescript/module/components/ScannerOverlay/ScannerOverlay.d.ts +13 -13
- package/lib/typescript/module/components/Screen/Screen.d.ts +43 -44
- package/lib/typescript/module/components/Screen/index.d.ts +1 -1
- package/lib/typescript/module/components/SearchBar/SearchBar.d.ts +31 -31
- package/lib/typescript/module/components/SearchBar/SearchPanel.d.ts +6 -6
- package/lib/typescript/module/components/SearchBar/useRecentSearches.d.ts +1 -1
- package/lib/typescript/module/components/SectionHeader/SectionHeader.d.ts +10 -10
- package/lib/typescript/module/components/SegmentedControl/SegmentedControl.d.ts +25 -24
- package/lib/typescript/module/components/Select/Select.d.ts +50 -45
- package/lib/typescript/module/components/SignaturePad/SignaturePad.d.ts +20 -20
- package/lib/typescript/module/components/Skeleton/Skeleton.d.ts +13 -13
- package/lib/typescript/module/components/Skeleton/SkeletonContent.d.ts +9 -9
- package/lib/typescript/module/components/Skeleton/SkeletonList.d.ts +30 -8
- package/lib/typescript/module/components/Skeleton/SkeletonProvider.d.ts +9 -9
- package/lib/typescript/module/components/SlideToConfirm/SlideToConfirm.d.ts +14 -14
- package/lib/typescript/module/components/Slider/Slider.d.ts +30 -30
- package/lib/typescript/module/components/Slider/valueText.d.ts +9 -9
- package/lib/typescript/module/components/SliderField/SliderField.d.ts +41 -41
- package/lib/typescript/module/components/SortableList/SortableList.d.ts +5 -5
- package/lib/typescript/module/components/Sparkline/Sparkline.d.ts +13 -13
- package/lib/typescript/module/components/Sparkline/geometry.d.ts +3 -1
- package/lib/typescript/module/components/Spinner/Spinner.d.ts +10 -10
- package/lib/typescript/module/components/SquircleFill/SquircleFill.d.ts +3 -3
- package/lib/typescript/module/components/SquircleImage/SquircleImage.d.ts +5 -12
- package/lib/typescript/module/components/StatTile/StatTile.d.ts +14 -14
- package/lib/typescript/module/components/StatusBadge/StatusBadge.d.ts +13 -13
- package/lib/typescript/module/components/Stepper/Stepper.d.ts +21 -21
- package/lib/typescript/module/components/Swipeable/Swipeable.d.ts +15 -15
- package/lib/typescript/module/components/Switch/Switch.d.ts +19 -19
- package/lib/typescript/module/components/Tabs/Tabs.d.ts +20 -20
- package/lib/typescript/module/components/TagInput/TagInput.d.ts +19 -19
- package/lib/typescript/module/components/Text/Text.d.ts +10 -10
- package/lib/typescript/module/components/TimePicker/TimePicker.d.ts +14 -14
- package/lib/typescript/module/components/Timeline/Timeline.d.ts +12 -12
- package/lib/typescript/module/components/Toast/Toast.d.ts +17 -17
- package/lib/typescript/module/components/Toast/ToastProvider.d.ts +8 -8
- package/lib/typescript/module/components/Tooltip/RichTooltipBody.d.ts +4 -4
- package/lib/typescript/module/components/Tooltip/Tooltip.d.ts +24 -19
- package/lib/typescript/module/components/Tour/Tour.d.ts +7 -7
- package/lib/typescript/module/components/TypingIndicator/TypingIndicator.d.ts +6 -6
- package/lib/typescript/module/components/WheelPicker/Wheel.d.ts +6 -6
- package/lib/typescript/module/components/WheelPicker/WheelPicker.d.ts +20 -20
- package/lib/typescript/module/components/ZoomableImage/ZoomableImage.d.ts +8 -8
- package/lib/typescript/module/form/HookFormField.d.ts +5 -18
- package/lib/typescript/module/form/path.d.ts +4 -2
- package/lib/typescript/module/form/useFormCompletion.d.ts +1 -1
- package/lib/typescript/module/hooks/useControllableState.d.ts +2 -2
- package/lib/typescript/module/hooks/useDragToDismiss.d.ts +3 -3
- package/lib/typescript/module/hooks/useFieldErrorScroll.d.ts +1 -1
- package/lib/typescript/module/hooks/usePressAnimation.d.ts +4 -4
- package/lib/typescript/module/hooks/useRefreshControl.d.ts +8 -8
- package/lib/typescript/module/hooks/useResendCountdown.d.ts +1 -1
- package/lib/typescript/module/hooks/useScrollDirection.d.ts +1 -1
- package/lib/typescript/module/navigation/DiscardGuard.d.ts +2 -2
- package/lib/typescript/module/navigation/NavigationScreen.d.ts +3 -3
- package/lib/typescript/module/network/NetworkStatusBanner.d.ts +7 -7
- package/lib/typescript/module/theme/Gradient.d.ts +2 -2
- package/lib/typescript/module/theme/ThemeContext.d.ts +5 -5
- package/lib/typescript/module/theme/componentSizes.d.ts +15 -38
- package/lib/typescript/module/theme/types.d.ts +84 -84
- package/lib/typescript/module/utils/announce.d.ts +1 -1
- package/lib/typescript/module/utils/complete.d.ts +5 -0
- package/lib/typescript/module/utils/feedback.d.ts +3 -1
- package/lib/typescript/module/utils/guards.d.ts +9 -0
- package/lib/typescript/module/utils/placement.d.ts +3 -3
- package/lib/typescript/module/utils/squircle.d.ts +2 -2
- package/package.json +9 -9
- package/src/specs/NativePdfRasterizer.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{forwardRef,useMemo}from"react";import{StyleSheet,View}from"react-native";import{useTheme}from"../../theme/index.js";import{deriveToneInk}from"../../theme/toneInk.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{tintOf}from"../../utils/color.js";import{smoothCorners}from"../../utils/corners.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 sizeMap={sm:{height:22,paddingX:"sm",dot:5,gap:"xs"},md:{height:24,paddingX:"md",dot:6,gap:"xs"}},sizeFor=(e,t)=>{const s=sizeMap[t];return{height:s.height,paddingH:e.space[s.paddingX],dot:s.dot,gap:e.space[s.gap]}},SOFT_FILL_OPACITY=.14,SOFT_BORDER_OPACITY=.4,BORDER_WIDTH=1,toneFor=(e,t)=>{const{colors:s}=e;switch(t){case"success":return{base:s.success,on:s["on-success"],ink:s["success-text"],soft:s["success-soft"]};case"warning":return{base:s.warning,on:s["on-warning"],ink:s["warning-text"],soft:s["warning-soft"]};case"danger":return{base:s.danger,on:s["on-danger"],ink:s["danger-text"],soft:s["danger-soft"]};case"info":return{base:s.info,on:s["on-info"],ink:s["info-text"],soft:s["info-soft"]};case"primary":return{base:s.primary,on:s["on-primary"],ink:s["primary-text"],soft:s["primary-soft"]};default:return{base:s["text-muted"],on:s["on-neutral-strong"],ink:s["text-muted"],soft:s.border}}},isHex=e=>"string"==typeof e&&/^#[0-9a-f]{6}$/i.test(e),paletteFor=(e,t,s,a)=>{const o=isHex(a),{base:r,on:n,ink:i,soft:l}=o?{base:a,on:e.colors["text-inverse"],ink:deriveToneInk(a,[e.colors.bg,e.colors["bg-subtle"],e.colors["bg-muted"]],e.mode),soft:tintOf(a,.14,e.colors["bg-subtle"])}:toneFor(e,t),d=!o&&"neutral"===t,u=d?e.colors["bg-muted"]:tintOf(r,.14,e.colors["bg-subtle"]),g=d?e.colors.border:tintOf(r,.4,r);switch(s){case"solid":return{fill:r,border:r,text:n,dot:n};case"outline":return{fill:"transparent",border:d?g:r,text:i,dot:r};case"flat":return{fill:u,border:"transparent",text:i,dot:r};case"ghost":return{fill:"transparent",border:"transparent",text:i,dot:r};case"filled":return{fill:l,border:"transparent",text:i,dot:r};default:return{fill:u,border:g,text:i,dot:r}}},
|
|
1
|
+
"use strict";import{forwardRef,useMemo}from"react";import{StyleSheet,View}from"react-native";import{useTheme}from"../../theme/index.js";import{deriveToneInk}from"../../theme/toneInk.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{tintOf}from"../../utils/color.js";import{smoothCorners}from"../../utils/corners.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 sizeMap={sm:{height:22,paddingX:"sm",dot:5,gap:"xs"},md:{height:24,paddingX:"md",dot:6,gap:"xs"}},sizeFor=(e,t)=>{const s=sizeMap[t];return{height:s.height,paddingH:e.space[s.paddingX],dot:s.dot,gap:e.space[s.gap]}},SOFT_FILL_OPACITY=.14,SOFT_BORDER_OPACITY=.4,BORDER_WIDTH=1,toneFor=(e,t)=>{const{colors:s}=e;switch(t){case"success":return{base:s.success,on:s["on-success"],ink:s["success-text"],soft:s["success-soft"]};case"warning":return{base:s.warning,on:s["on-warning"],ink:s["warning-text"],soft:s["warning-soft"]};case"danger":return{base:s.danger,on:s["on-danger"],ink:s["danger-text"],soft:s["danger-soft"]};case"info":return{base:s.info,on:s["on-info"],ink:s["info-text"],soft:s["info-soft"]};case"primary":return{base:s.primary,on:s["on-primary"],ink:s["primary-text"],soft:s["primary-soft"]};default:return{base:s["text-muted"],on:s["on-neutral-strong"],ink:s["text-muted"],soft:s.border}}},isHex=e=>"string"==typeof e&&/^#[0-9a-f]{6}$/i.test(e),paletteFor=(e,t,s,a)=>{const o=isHex(a),{base:r,on:n,ink:i,soft:l}=o?{base:a,on:e.colors["text-inverse"],ink:deriveToneInk(a,[e.colors.bg,e.colors["bg-subtle"],e.colors["bg-muted"]],e.mode),soft:tintOf(a,.14,e.colors["bg-subtle"])}:toneFor(e,t),d=!o&&"neutral"===t,u=d?e.colors["bg-muted"]:tintOf(r,.14,e.colors["bg-subtle"]),g=d?e.colors.border:tintOf(r,.4,r);switch(s){case"solid":return{fill:r,border:r,text:n,dot:n};case"outline":return{fill:"transparent",border:d?g:r,text:i,dot:r};case"flat":return{fill:u,border:"transparent",text:i,dot:r};case"ghost":return{fill:"transparent",border:"transparent",text:i,dot:r};case"filled":return{fill:l,border:"transparent",text:i,dot:r};default:return{fill:u,border:g,text:i,dot:r}}},StatusBadgeRoot=forwardRef((e,t)=>{const{label:s,tone:a="neutral",variant:o="soft",size:r="md",ink:n="tone",weight:i="semibold",padding:l="default",dot:d=!1,color:u,loading:g=!1,accessibilityLabel:c,style:f,textStyle:m,testID:p}=e;assertValidValue("StatusBadge","tone",e.tone,["success","warning","danger","info","primary","neutral"]),assertValidValue("StatusBadge","variant",e.variant,["solid","soft","outline","ghost","flat","filled"]),assertValidValue("StatusBadge","size",e.size,["sm","md"]),assertValidValue("StatusBadge","ink",e.ink,["tone","primary"]),assertValidValue("StatusBadge","weight",e.weight,["semibold","bold"]),assertValidValue("StatusBadge","padding",e.padding,["default","sm","md"]);const b=useTheme(),x=sizeFor(b,r),h=useMemo(()=>paletteFor(b,a,o,u),[b,a,o,u]),S="primary"===n&&"solid"!==o?b.colors["text-body"]:h.text,y="default"===l?{minHeight:x.height,paddingHorizontal:x.paddingH}:{paddingHorizontal:b.space[l],paddingVertical:b.space.xs},k="filled"===o?0:1;return g?_jsx(StatusBadgeSkeleton,{...e}):_jsxs(View,{ref:t,accessible:!0,accessibilityRole:"text",accessibilityLabel:c??s,testID:p,style:[styles.base,{...y,borderRadius:b.radius.pill,...smoothCorners,backgroundColor:h.fill,borderColor:h.border,borderWidth:k},f],children:[d?_jsx(View,{testID:"status-badge-dot",style:{width:x.dot,height:x.dot,borderRadius:x.dot/2,marginRight:x.gap,backgroundColor:h.dot}}):null,_jsx(Text,{variant:"sm"===r?"caption":"bodySmall",weight:i,style:[styles.label,{color:S},m],numberOfLines:1,children:s})]})});StatusBadgeRoot.displayName="StatusBadge";const StatusBadgeSkeleton=({label:e,size:t="md",variant:s="soft",padding:a="default",dot:o,style:r})=>{const n=useTheme(),i=sizeFor(n,t),l=Math.max(32,Math.min(120,6.5*(e??"").length))+2*("default"===a?i.paddingH:n.space[a])+(o?i.dot+i.gap:0),d="default"===a?i.height:Math.round(n.text["sm"===t?"xs":"sm"].size*n.leading.body)+2*n.space.xs+2*("filled"===s?0:1);return _jsx(Skeleton,{width:l,height:d,radius:d/2,style:[styles.skeleton,r]})};StatusBadgeSkeleton.displayName="StatusBadgeSkeleton";const StatusBadge=Object.assign(StatusBadgeRoot,{Skeleton:StatusBadgeSkeleton}),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
|
-
"use strict";export function defineStatusMap(t,e){return
|
|
1
|
+
"use strict";import{hasKey}from"../../utils/guards.js";export function defineStatusMap(t,e){return r=>(null!=r&&hasKey(t,r)?t[r]:void 0)??e??{label:r??"-",tone:"neutral"}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{forwardRef,useEffect,useMemo,useRef,useState}from"react";import{Animated,Easing,Pressable,StyleSheet,View}from"react-native";import{createAnimatedValue,useTheme}from"../../theme/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{smoothCorners}from"../../utils/corners.js";import{resolveHaptic,triggerHaptic}from"../../utils/hapticUtils.js";import{hitSlopMarker}from"../../utils/hitSlop.js";import{nativeDriver}from"../../utils/nativeDriver.js";import{Skeleton}from"../Skeleton/index.js";import{Text}from"../Text/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export const DEFAULT_STEPPER_LABELS=Object.freeze({step:(e,t,s,i)=>`Step ${e} of ${t}, ${s}, ${i}`,statusComplete:"complete",statusActive:"active",statusUpcoming:"upcoming",progressStep:(e,t)=>`Progress: step ${e} of ${t}`,progressDone:(e,t)=>`Progress: ${e} of ${t} steps done`,captionStep:(e,t,s)=>`Step ${e} of ${t}${s?` · ${s}`:""}`,captionDone:(e,t)=>`${e} of ${t} done`});const CIRCLE_SIZE=24,SEGMENT_HEIGHT=4,PULSE_SIZE=32,PULSE_DURATION=1100,toneColorFor=(e,t)=>{switch(t){case"success":return e.colors.success;case"warning":return e.colors.warning;case"danger":return e.colors.danger;case"info":return e.colors.info;case"neutral":return e.colors.neutral;case"primary":return e.colors.primary}},toneOnColorFor=(e,t)=>{switch(t){case"success":return e.colors["on-success"];case"warning":return e.colors["on-warning"];case"danger":return e.colors["on-danger"];case"info":return e.colors["on-info"];case"neutral":return e.colors["on-neutral"];case"primary":return e.colors["on-primary"]}},statusWordFor=(e,t)=>{switch(t){case"complete":return e.statusComplete;case"active":return e.statusActive;case"upcoming":return e.statusUpcoming}},StepCircle=({index:e,step:t,status:s,toneColor:i,upcomingColor:o,upcomingFillColor:r,textOnColor:l,upcomingTextColor:n,interactive:a,canPress:c,totalSteps:p,onPress:u,pulseEnabled:d,labels:m,circleStyles:h,circleSlotStyle:g})=>{const y="active"===s,b=useTheme(),x=useRef(createAnimatedValue(1)).current,S=useRef(createAnimatedValue(.5)).current;useEffect(()=>{if(!y||!d)return x.setValue(1),void S.setValue(0);const e=Animated.loop(Animated.parallel([Animated.sequence([Animated.timing(x,{toValue:1.4,duration:1100,easing:Easing.out(Easing.ease),useNativeDriver:nativeDriver}),Animated.timing(x,{toValue:1,duration:0,useNativeDriver:nativeDriver})]),Animated.sequence([Animated.timing(S,{toValue:0,duration:1100,easing:Easing.out(Easing.ease),useNativeDriver:nativeDriver}),Animated.timing(S,{toValue:.5,duration:0,useNativeDriver:nativeDriver})])]));return e.start(),()=>e.stop()},[y,x,S,d]);const v="upcoming"===s?r:i,f="upcoming"===s?o:i,w="upcoming"===s?n:l,C="complete"===s,j=m.step(e+1,p,t.label,statusWordFor(m,s)),_=_jsxs(View,{style:h.relative,children:[y&&d?_jsx(Animated.View,{pointerEvents:"none",style:[h.pulse,{width:32,height:32,borderRadius:b.radius.pill,...smoothCorners,backgroundColor:i,opacity:S,transform:[{scale:x}]}]}):null,_jsx(View,{style:[h.circle,{width:24,height:24,borderRadius:b.radius.pill,...smoothCorners,backgroundColor:v,borderColor:f},g],children:t.icon?t.icon:_jsx(Text,C?{variant:"bodySmall",weight:"semibold",style:[h.glyph,{color:w}],children:"✓"}:{variant:"bodySmall",weight:"semibold",style:[h.glyph,{color:w}],children:e+1})})]});return a?_jsx(Pressable,{onPress:()=>u(e),disabled:!c,accessibilityRole:"button",accessibilityLabel:j,accessibilityState:{selected:y,disabled:!c},"aria-selected":y,"aria-disabled":!c,hitSlop:8,...hitSlopMarker(8),children:_}):_jsx(View,{accessibilityRole:"text",accessibilityLabel:j,accessibilityState:{selected:y},"aria-selected":y,children:_})},buildCircleStyles=()=>StyleSheet.create({relative:{alignItems:"center",justifyContent:"center"},pulse:{position:"absolute"},circle:{borderWidth:2,alignItems:"center",justifyContent:"center"},glyph:{includeFontPadding:!1}}),Stepper=forwardRef((e,t)=>{const{steps:s,activeStep:i,defaultActiveStep:o=0,pressMode:r="none",onStepPress:l,onActiveStepChange:n,variant:a="horizontal",tone:c="primary",formatCaption:p,showCaption:u=!0,loading:d=!1,labels:m,accessibilityLabel:h,style:g,containerStyle:y,circleStyle:b,labelStyle:x,connectorStyle:S,haptic:v,testID:f}=e;assertValidValue("Stepper","variant",e.variant,["horizontal","vertical","segmented"]),assertValidValue("Stepper","tone",e.tone,["primary","success","warning","danger","info","neutral"]),assertValidValue("Stepper","pressMode",e.pressMode,["none","back","select"]);const w=useMemo(()=>({...DEFAULT_STEPPER_LABELS,...m}),[m]),C=useTheme(),j=C.settings.components.stepper?.pulseAnimation??!1,_=resolveHaptic(v,"selection"),V=useMemo(()=>buildStyles(C),[C]),k=useMemo(()=>buildCircleStyles(),[]),R=toneColorFor(C,c),D=C.colors.border,A=C.colors.bg,E=C.colors["text-muted"],L=toneOnColorFor(C,c),T=s.length,I="none"!==r,P=void 0!==i,[F,$]=useState(o),M=P?i:F,B=null==M||M<0?null:M,statusOf=e=>null===B?"upcoming":e<B?"complete":e===B?"active":"upcoming",O=s.map((e,t)=>statusOf(t)),N=O.filter(e=>"upcoming"!==e).length,U=O.filter(e=>"complete"===e).length,canPressStatus=e=>"back"===r?"complete"===e:I,handleStepPress=e=>{if(!canPressStatus(statusOf(e)))return;_&&triggerHaptic(_),l?.(e);const t="select"===r&&e===B?null:e;P||$(t),n?.(t)},H=useRef(createAnimatedValue(N)).current,z=useRef(N);useEffect(()=>{const e=z.current;if(e===N)return;z.current=N;const t=Animated.timing(H,{toValue:N,duration:C.motion.duration.default*Math.abs(N-e),easing:Easing.linear,useNativeDriver:!1});return t.start(),()=>t.stop()},[N,H,C.motion]);const sliceOf=e=>H.interpolate({inputRange:[e,e+1],outputRange:["0%","100%"],extrapolate:"clamp"}),W=T<=1?"0%":H.interpolate({inputRange:[1,T],outputRange:["0%","100%"],extrapolate:"clamp"}),G=null!==B&&B<T?B:null,q=h??(null!==G?w.progressStep(G+1,T):w.progressDone(U,T)),[Z,J]=useState(0),K=T>0&&Z>0?Z/(2*T):0,Q=_jsx(View,{ref:t,style:[V.container,y,g],testID:f,accessibilityRole:"progressbar",accessibilityLabel:q,accessibilityValue:{min:0,max:T,now:N},children:"segmented"===a?(()=>{const e=null!==G?s[G]:void 0,t=u?p?p(G,T,e):null!==G?w.captionStep(G+1,T,e?.label):w.captionDone(U,T):"";return _jsxs(View,{children:[u?_jsx(Text,{variant:"bodySmall",style:[V.sCaption,{marginBottom:C.space.sm},x],numberOfLines:1,children:t}):null,_jsx(View,{style:V.sRow,children:s.map((e,t)=>{const s=statusOf(t),i=w.step(t+1,T,e.label,statusWordFor(w,s)),o=_jsx(View,{testID:f?`${f}-segment-${t}`:void 0,style:[V.sTrack,{backgroundColor:D},S],children:_jsx(Animated.View,{style:[V.sFill,{backgroundColor:R,width:sliceOf(t)}]})});if(I){const r=canPressStatus(s);return _jsx(Pressable,{style:V.sItem,onPress:()=>handleStepPress(t),disabled:!r,accessibilityRole:"button",accessibilityLabel:i,accessibilityState:{selected:"active"===s,disabled:!r},"aria-selected":"active"===s,"aria-disabled":!r,hitSlop:{top:12,bottom:12},...hitSlopMarker({top:12,bottom:12}),children:o},e.key)}return _jsx(View,{style:V.sItem,accessibilityRole:"text",accessibilityLabel:i,accessibilityState:{selected:"active"===s},"aria-selected":"active"===s,children:o},e.key)})})]})})():"vertical"===a?_jsx(View,{style:V.vCol,children:s.map((e,t)=>{const s=statusOf(t),i=t===T-1;return _jsxs(View,{style:V.vRow,children:[_jsxs(View,{style:V.vLeft,children:[_jsx(StepCircle,{index:t,step:e,status:s,toneColor:R,upcomingColor:D,upcomingFillColor:A,onPressColor:R,textOnColor:L,upcomingTextColor:E,interactive:I,canPress:canPressStatus(s),totalSteps:T,onPress:handleStepPress,pulseEnabled:j,labels:w,circleStyles:k,circleSlotStyle:b}),i?null:_jsxs(View,{style:[V.vConnectorContainer,S],children:[_jsx(View,{style:[V.vConnectorTrack,{backgroundColor:D}]}),_jsx(Animated.View,{style:[V.vConnectorFill,{backgroundColor:R,height:sliceOf(t+1)}]})]})]}),_jsxs(View,{style:V.vBody,children:[_jsx(Text,{variant:"body",weight:"semibold",style:[V.vLabel,{color:"upcoming"===s?C.colors["text-subtle"]:C.colors["text-body"]},x],numberOfLines:1,children:e?.label??" "}),e.description?_jsx(Text,{variant:"bodySmall",style:V.vDescription,numberOfLines:3,children:e.description}):null]})]},e.key)})}):_jsxs(View,{style:V.hRow,onLayout:e=>J(e.nativeEvent.layout.width),children:[_jsxs(View,{pointerEvents:"none",style:[V.hConnectorContainer,{left:K,right:K},S],children:[_jsx(View,{style:[V.hConnectorTrack,{backgroundColor:D}]}),_jsx(Animated.View,{style:[V.hConnectorFill,{backgroundColor:R,width:W}]})]}),s.map((e,t)=>{const s=statusOf(t);return _jsxs(View,{style:V.hStepItem,children:[_jsx(StepCircle,{index:t,step:e,status:s,toneColor:R,upcomingColor:D,upcomingFillColor:A,onPressColor:R,textOnColor:L,upcomingTextColor:E,interactive:I,canPress:canPressStatus(s),totalSteps:T,onPress:handleStepPress,pulseEnabled:j,labels:w,circleStyles:k,circleSlotStyle:b}),_jsx(Text,{variant:"caption",style:[V.hLabel,{color:"upcoming"===s?C.colors["text-subtle"]:C.colors["text-body"]},x],numberOfLines:1,children:e?.label??" "})]},e.key)})]})});return d?_jsx(StepperSkeleton,{...e}):Q});Stepper.displayName="Stepper";const StepperSkeleton=({steps:e,variant:t="horizontal",showCaption:s=!0,containerStyle:i,style:o,testID:r})=>{const l=useTheme(),n=useMemo(()=>buildStyles(l),[l]),a=useMemo(()=>buildSkeletonStyles(l),[l]),c=e.length||3;return"segmented"===t?_jsxs(View,{style:[n.container,i,o],testID:r,accessibilityRole:"progressbar",accessibilityState:{busy:!0},"aria-busy":!0,children:[s?_jsx(Skeleton,{shape:"text",width:"45%",height:14,style:{marginBottom:l.space.sm}}):null,_jsx(View,{style:n.sRow,children:Array.from({length:c}).map((e,t)=>_jsx(View,{style:n.sItem,children:_jsx(Skeleton,{width:"100%",height:4,radius:"pill"})},`sk-step-${t}`))})]}):_jsx(View,"vertical"===t?{style:[n.container,i,o],testID:r,accessibilityRole:"progressbar",accessibilityState:{busy:!0},"aria-busy":!0,children:_jsx(View,{style:a.vCol,children:Array.from({length:c}).map((e,t)=>{const s=t===c-1;return _jsxs(View,{style:a.vRow,children:[_jsxs(View,{style:[a.vLeft,{width:32}],children:[_jsx(Skeleton,{shape:"circle",width:24,height:24}),s?null:_jsx(Skeleton,{width:2,height:36})]}),_jsxs(View,{style:a.vBody,children:[_jsx(Skeleton,{shape:"text",width:"55%",height:16,style:{marginBottom:l.space.xs}}),_jsx(Skeleton,{shape:"text",width:"80%",height:12})]})]},`sk-step-${t}`)})})}:{style:[n.container,i,o],testID:r,accessibilityRole:"progressbar",accessibilityState:{busy:!0},"aria-busy":!0,children:_jsxs(View,{style:n.hRow,children:[_jsx(View,{pointerEvents:"none",style:[n.hConnectorContainer,{left:50/c+"%",right:50/c+"%"}],children:_jsx(Skeleton,{width:"100%",height:2,radius:"pill"})}),Array.from({length:c}).map((e,t)=>_jsxs(View,{style:n.hStepItem,children:[_jsx(Skeleton,{shape:"circle",width:24,height:24}),_jsx(Skeleton,{shape:"text",width:"80%",height:12,style:{marginTop:l.space.xs}})]},`sk-step-${t}`))]})})};StepperSkeleton.displayName="StepperSkeleton",Stepper.Skeleton=StepperSkeleton;const buildSkeletonStyles=e=>StyleSheet.create({vCol:{flexDirection:"column"},vRow:{flexDirection:"row",alignItems:"flex-start"},vLeft:{alignItems:"center"},vBody:{flex:1,paddingLeft:e.space.md,paddingBottom:e.space.lg}}),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:e.radius.pill,...smoothCorners},hConnectorFill:{position:"absolute",left:0,height:2,borderRadius:e.radius.pill,...smoothCorners},hStepItem:{alignItems:"center",flex:1},hLabel:{marginTop:e.space.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:e.radius.pill,...smoothCorners},vConnectorFill:{position:"absolute",top:0,width:2,borderRadius:e.radius.pill,...smoothCorners},vBody:{flex:1,paddingLeft:e.space.sm,paddingBottom:e.space.md},vLabel:{marginBottom:e.space.xxs},vDescription:{},sCaption:{includeFontPadding:!1},sRow:{flexDirection:"row",columnGap:e.space.xs},sItem:{flex:1},sTrack:{height:4,borderRadius:e.radius.pill,overflow:"hidden"},sFill:{height:4,borderRadius:e.radius.pill}});export{Stepper};export default Stepper;
|
|
1
|
+
"use strict";import{forwardRef,useEffect,useMemo,useRef,useState}from"react";import{Animated,Easing,Pressable,StyleSheet,View}from"react-native";import{createAnimatedValue,useTheme}from"../../theme/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{smoothCorners}from"../../utils/corners.js";import{resolveHaptic,triggerHaptic}from"../../utils/hapticUtils.js";import{hitSlopMarker}from"../../utils/hitSlop.js";import{nativeDriver}from"../../utils/nativeDriver.js";import{Skeleton}from"../Skeleton/index.js";import{Text}from"../Text/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export const DEFAULT_STEPPER_LABELS=Object.freeze({step:(e,t,s,i)=>`Step ${e} of ${t}, ${s}, ${i}`,statusComplete:"complete",statusActive:"active",statusUpcoming:"upcoming",progressStep:(e,t)=>`Progress: step ${e} of ${t}`,progressDone:(e,t)=>`Progress: ${e} of ${t} steps done`,captionStep:(e,t,s)=>`Step ${e} of ${t}${s?` · ${s}`:""}`,captionDone:(e,t)=>`${e} of ${t} done`});const CIRCLE_SIZE=24,SEGMENT_HEIGHT=4,PULSE_SIZE=32,PULSE_DURATION=1100,toneColorFor=(e,t)=>{switch(t){case"success":return e.colors.success;case"warning":return e.colors.warning;case"danger":return e.colors.danger;case"info":return e.colors.info;case"neutral":return e.colors.neutral;case"primary":return e.colors.primary}},toneOnColorFor=(e,t)=>{switch(t){case"success":return e.colors["on-success"];case"warning":return e.colors["on-warning"];case"danger":return e.colors["on-danger"];case"info":return e.colors["on-info"];case"neutral":return e.colors["on-neutral"];case"primary":return e.colors["on-primary"]}},statusWordFor=(e,t)=>{switch(t){case"complete":return e.statusComplete;case"active":return e.statusActive;case"upcoming":return e.statusUpcoming}},StepCircle=({index:e,step:t,status:s,toneColor:i,upcomingColor:o,upcomingFillColor:r,textOnColor:l,upcomingTextColor:n,interactive:a,canPress:c,totalSteps:p,onPress:u,pulseEnabled:d,labels:m,circleStyles:h,circleSlotStyle:g})=>{const y="active"===s,b=useTheme(),x=useRef(createAnimatedValue(1)).current,S=useRef(createAnimatedValue(.5)).current;useEffect(()=>{if(!y||!d)return x.setValue(1),void S.setValue(0);const e=Animated.loop(Animated.parallel([Animated.sequence([Animated.timing(x,{toValue:1.4,duration:1100,easing:Easing.out(Easing.ease),useNativeDriver:nativeDriver}),Animated.timing(x,{toValue:1,duration:0,useNativeDriver:nativeDriver})]),Animated.sequence([Animated.timing(S,{toValue:0,duration:1100,easing:Easing.out(Easing.ease),useNativeDriver:nativeDriver}),Animated.timing(S,{toValue:.5,duration:0,useNativeDriver:nativeDriver})])]));return e.start(),()=>e.stop()},[y,x,S,d]);const v="upcoming"===s?r:i,f="upcoming"===s?o:i,w="upcoming"===s?n:l,C="complete"===s,j=m.step(e+1,p,t.label,statusWordFor(m,s)),_=_jsxs(View,{style:h.relative,children:[y&&d?_jsx(Animated.View,{pointerEvents:"none",style:[h.pulse,{width:32,height:32,borderRadius:b.radius.pill,...smoothCorners,backgroundColor:i,opacity:S,transform:[{scale:x}]}]}):null,_jsx(View,{style:[h.circle,{width:24,height:24,borderRadius:b.radius.pill,...smoothCorners,backgroundColor:v,borderColor:f},g],children:t.icon?t.icon:_jsx(Text,C?{variant:"bodySmall",weight:"semibold",style:[h.glyph,{color:w}],children:"✓"}:{variant:"bodySmall",weight:"semibold",style:[h.glyph,{color:w}],children:e+1})})]});return a?_jsx(Pressable,{onPress:()=>u(e),disabled:!c,accessibilityRole:"button",accessibilityLabel:j,accessibilityState:{selected:y,disabled:!c},"aria-selected":y,"aria-disabled":!c,hitSlop:8,...hitSlopMarker(8),children:_}):_jsx(View,{accessibilityRole:"text",accessibilityLabel:j,accessibilityState:{selected:y},"aria-selected":y,children:_})},buildCircleStyles=()=>StyleSheet.create({relative:{alignItems:"center",justifyContent:"center"},pulse:{position:"absolute"},circle:{borderWidth:2,alignItems:"center",justifyContent:"center"},glyph:{includeFontPadding:!1}}),StepperRoot=forwardRef((e,t)=>{const{steps:s,activeStep:i,defaultActiveStep:o=0,pressMode:r="none",onStepPress:l,onActiveStepChange:n,variant:a="horizontal",tone:c="primary",formatCaption:p,showCaption:u=!0,loading:d=!1,labels:m,accessibilityLabel:h,style:g,containerStyle:y,circleStyle:b,labelStyle:x,connectorStyle:S,haptic:v,testID:f}=e;assertValidValue("Stepper","variant",e.variant,["horizontal","vertical","segmented"]),assertValidValue("Stepper","tone",e.tone,["primary","success","warning","danger","info","neutral"]),assertValidValue("Stepper","pressMode",e.pressMode,["none","back","select"]);const w=useMemo(()=>({...DEFAULT_STEPPER_LABELS,...m}),[m]),C=useTheme(),j=C.settings.components.stepper?.pulseAnimation??!1,_=resolveHaptic(v,"selection"),V=useMemo(()=>buildStyles(C),[C]),k=useMemo(()=>buildCircleStyles(),[]),R=toneColorFor(C,c),D=C.colors.border,A=C.colors.bg,E=C.colors["text-muted"],L=toneOnColorFor(C,c),T=s.length,I="none"!==r,P=void 0!==i,[F,$]=useState(o),M=P?i:F,B=null==M||M<0?null:M,statusOf=e=>null===B?"upcoming":e<B?"complete":e===B?"active":"upcoming",O=s.map((e,t)=>statusOf(t)),N=O.filter(e=>"upcoming"!==e).length,U=O.filter(e=>"complete"===e).length,canPressStatus=e=>"back"===r?"complete"===e:I,handleStepPress=e=>{if(!canPressStatus(statusOf(e)))return;_&&triggerHaptic(_),l?.(e);const t="select"===r&&e===B?null:e;P||$(t),n?.(t)},H=useRef(createAnimatedValue(N)).current,z=useRef(N);useEffect(()=>{const e=z.current;if(e===N)return;z.current=N;const t=Animated.timing(H,{toValue:N,duration:C.motion.duration.default*Math.abs(N-e),easing:Easing.linear,useNativeDriver:!1});return t.start(),()=>t.stop()},[N,H,C.motion]);const sliceOf=e=>H.interpolate({inputRange:[e,e+1],outputRange:["0%","100%"],extrapolate:"clamp"}),W=T<=1?"0%":H.interpolate({inputRange:[1,T],outputRange:["0%","100%"],extrapolate:"clamp"}),G=null!==B&&B<T?B:null,q=h??(null!==G?w.progressStep(G+1,T):w.progressDone(U,T)),[Z,J]=useState(0),K=T>0&&Z>0?Z/(2*T):0,Q=_jsx(View,{ref:t,style:[V.container,y,g],testID:f,accessibilityRole:"progressbar",accessibilityLabel:q,accessibilityValue:{min:0,max:T,now:N},children:"segmented"===a?(()=>{const e=null!==G?s[G]:void 0,t=u?p?p(G,T,e):null!==G?w.captionStep(G+1,T,e?.label):w.captionDone(U,T):"";return _jsxs(View,{children:[u?_jsx(Text,{variant:"bodySmall",style:[V.sCaption,{marginBottom:C.space.sm},x],numberOfLines:1,children:t}):null,_jsx(View,{style:V.sRow,children:s.map((e,t)=>{const s=statusOf(t),i=w.step(t+1,T,e.label,statusWordFor(w,s)),o=_jsx(View,{testID:f?`${f}-segment-${t}`:void 0,style:[V.sTrack,{backgroundColor:D},S],children:_jsx(Animated.View,{style:[V.sFill,{backgroundColor:R,width:sliceOf(t)}]})});if(I){const r=canPressStatus(s);return _jsx(Pressable,{style:V.sItem,onPress:()=>handleStepPress(t),disabled:!r,accessibilityRole:"button",accessibilityLabel:i,accessibilityState:{selected:"active"===s,disabled:!r},"aria-selected":"active"===s,"aria-disabled":!r,hitSlop:{top:12,bottom:12},...hitSlopMarker({top:12,bottom:12}),children:o},e.key)}return _jsx(View,{style:V.sItem,accessibilityRole:"text",accessibilityLabel:i,accessibilityState:{selected:"active"===s},"aria-selected":"active"===s,children:o},e.key)})})]})})():"vertical"===a?_jsx(View,{style:V.vCol,children:s.map((e,t)=>{const s=statusOf(t),i=t===T-1;return _jsxs(View,{style:V.vRow,children:[_jsxs(View,{style:V.vLeft,children:[_jsx(StepCircle,{index:t,step:e,status:s,toneColor:R,upcomingColor:D,upcomingFillColor:A,onPressColor:R,textOnColor:L,upcomingTextColor:E,interactive:I,canPress:canPressStatus(s),totalSteps:T,onPress:handleStepPress,pulseEnabled:j,labels:w,circleStyles:k,circleSlotStyle:b}),i?null:_jsxs(View,{style:[V.vConnectorContainer,S],children:[_jsx(View,{style:[V.vConnectorTrack,{backgroundColor:D}]}),_jsx(Animated.View,{style:[V.vConnectorFill,{backgroundColor:R,height:sliceOf(t+1)}]})]})]}),_jsxs(View,{style:V.vBody,children:[_jsx(Text,{variant:"body",weight:"semibold",style:[V.vLabel,{color:"upcoming"===s?C.colors["text-subtle"]:C.colors["text-body"]},x],numberOfLines:1,children:e?.label??" "}),e.description?_jsx(Text,{variant:"bodySmall",style:V.vDescription,numberOfLines:3,children:e.description}):null]})]},e.key)})}):_jsxs(View,{style:V.hRow,onLayout:e=>J(e.nativeEvent.layout.width),children:[_jsxs(View,{pointerEvents:"none",style:[V.hConnectorContainer,{left:K,right:K},S],children:[_jsx(View,{style:[V.hConnectorTrack,{backgroundColor:D}]}),_jsx(Animated.View,{style:[V.hConnectorFill,{backgroundColor:R,width:W}]})]}),s.map((e,t)=>{const s=statusOf(t);return _jsxs(View,{style:V.hStepItem,children:[_jsx(StepCircle,{index:t,step:e,status:s,toneColor:R,upcomingColor:D,upcomingFillColor:A,onPressColor:R,textOnColor:L,upcomingTextColor:E,interactive:I,canPress:canPressStatus(s),totalSteps:T,onPress:handleStepPress,pulseEnabled:j,labels:w,circleStyles:k,circleSlotStyle:b}),_jsx(Text,{variant:"caption",style:[V.hLabel,{color:"upcoming"===s?C.colors["text-subtle"]:C.colors["text-body"]},x],numberOfLines:1,children:e?.label??" "})]},e.key)})]})});return d?_jsx(StepperSkeleton,{...e}):Q});StepperRoot.displayName="Stepper";const StepperSkeleton=({steps:e,variant:t="horizontal",showCaption:s=!0,containerStyle:i,style:o,testID:r})=>{const l=useTheme(),n=useMemo(()=>buildStyles(l),[l]),a=useMemo(()=>buildSkeletonStyles(l),[l]),c=e.length||3;return"segmented"===t?_jsxs(View,{style:[n.container,i,o],testID:r,accessibilityRole:"progressbar",accessibilityState:{busy:!0},"aria-busy":!0,children:[s?_jsx(Skeleton,{shape:"text",width:"45%",height:14,style:{marginBottom:l.space.sm}}):null,_jsx(View,{style:n.sRow,children:Array.from({length:c}).map((e,t)=>_jsx(View,{style:n.sItem,children:_jsx(Skeleton,{width:"100%",height:4,radius:"pill"})},`sk-step-${t}`))})]}):_jsx(View,"vertical"===t?{style:[n.container,i,o],testID:r,accessibilityRole:"progressbar",accessibilityState:{busy:!0},"aria-busy":!0,children:_jsx(View,{style:a.vCol,children:Array.from({length:c}).map((e,t)=>{const s=t===c-1;return _jsxs(View,{style:a.vRow,children:[_jsxs(View,{style:[a.vLeft,{width:32}],children:[_jsx(Skeleton,{shape:"circle",width:24,height:24}),s?null:_jsx(Skeleton,{width:2,height:36})]}),_jsxs(View,{style:a.vBody,children:[_jsx(Skeleton,{shape:"text",width:"55%",height:16,style:{marginBottom:l.space.xs}}),_jsx(Skeleton,{shape:"text",width:"80%",height:12})]})]},`sk-step-${t}`)})})}:{style:[n.container,i,o],testID:r,accessibilityRole:"progressbar",accessibilityState:{busy:!0},"aria-busy":!0,children:_jsxs(View,{style:n.hRow,children:[_jsx(View,{pointerEvents:"none",style:[n.hConnectorContainer,{left:50/c+"%",right:50/c+"%"}],children:_jsx(Skeleton,{width:"100%",height:2,radius:"pill"})}),Array.from({length:c}).map((e,t)=>_jsxs(View,{style:n.hStepItem,children:[_jsx(Skeleton,{shape:"circle",width:24,height:24}),_jsx(Skeleton,{shape:"text",width:"80%",height:12,style:{marginTop:l.space.xs}})]},`sk-step-${t}`))]})})};StepperSkeleton.displayName="StepperSkeleton";const Stepper=Object.assign(StepperRoot,{Skeleton:StepperSkeleton}),buildSkeletonStyles=e=>StyleSheet.create({vCol:{flexDirection:"column"},vRow:{flexDirection:"row",alignItems:"flex-start"},vLeft:{alignItems:"center"},vBody:{flex:1,paddingLeft:e.space.md,paddingBottom:e.space.lg}}),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:e.radius.pill,...smoothCorners},hConnectorFill:{position:"absolute",left:0,height:2,borderRadius:e.radius.pill,...smoothCorners},hStepItem:{alignItems:"center",flex:1},hLabel:{marginTop:e.space.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:e.radius.pill,...smoothCorners},vConnectorFill:{position:"absolute",top:0,width:2,borderRadius:e.radius.pill,...smoothCorners},vBody:{flex:1,paddingLeft:e.space.sm,paddingBottom:e.space.md},vLabel:{marginBottom:e.space.xxs},vDescription:{},sCaption:{includeFontPadding:!1},sRow:{flexDirection:"row",columnGap:e.space.xs},sItem:{flex:1},sTrack:{height:4,borderRadius:e.radius.pill,overflow:"hidden"},sFill:{height:4,borderRadius:e.radius.pill}});export{Stepper};export default Stepper;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{forwardRef,useMemo}from"react";import{Text as RNText}from"react-native";import{fontFor,useTheme}from"../../theme/index.js";import{TEXT_NAMES}from"../../theme/tokens.generated.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{TextInkContext,useTextInk}from"./textInk.js";import{jsx as _jsx}from"react/jsx-runtime";const VARIANTS={display:{size:"4xl",weight:"bold",line:"display",color:"primary",heading:!0,fontFamily:"display"},h1:{size:"3xl",weight:"bold",line:"heading",color:"primary",heading:!0,fontFamily:"display"},h2:{size:"2xl",weight:"semibold",line:"heading",color:"primary",heading:!0,fontFamily:"display"},h3:{size:"xl",weight:"semibold",line:"heading",color:"primary",heading:!0},title:{size:"lg",weight:"semibold",line:"body",color:"primary",fontFamily:"display"},body:{size:"base",weight:"normal",line:"body",color:"primary"},bodySmall:{size:"sm",weight:"normal",line:"body",color:"secondary"},caption:{size:"xs",weight:"normal",line:"body",color:"tertiary"},label:{size:"sm",weight:"medium",line:"body",color:"secondary"},overline:{size:"xs",weight:"semibold",line:"body",color:"secondary",uppercase:!0,letterSpacing:"wide"}},TEXT_ROLE_COLOR={textStrong:"text",primary:"text-body",secondary:"text-muted",tertiary:"text-subtle",inverse:"text-inverse",disabled:"text-disabled",link:"link",brand:"primary-text"},
|
|
1
|
+
"use strict";import{forwardRef,useMemo}from"react";import{Text as RNText}from"react-native";import{fontFor,useTheme}from"../../theme/index.js";import{TEXT_NAMES,COLOR_NAMES as THEME_COLOR_NAMES}from"../../theme/tokens.generated.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{hasKey,isOneOf}from"../../utils/guards.js";import{TextInkContext,useTextInk}from"./textInk.js";import{jsx as _jsx}from"react/jsx-runtime";const VARIANTS={display:{size:"4xl",weight:"bold",line:"display",color:"primary",heading:!0,fontFamily:"display"},h1:{size:"3xl",weight:"bold",line:"heading",color:"primary",heading:!0,fontFamily:"display"},h2:{size:"2xl",weight:"semibold",line:"heading",color:"primary",heading:!0,fontFamily:"display"},h3:{size:"xl",weight:"semibold",line:"heading",color:"primary",heading:!0},title:{size:"lg",weight:"semibold",line:"body",color:"primary",fontFamily:"display"},body:{size:"base",weight:"normal",line:"body",color:"primary"},bodySmall:{size:"sm",weight:"normal",line:"body",color:"secondary"},caption:{size:"xs",weight:"normal",line:"body",color:"tertiary"},label:{size:"sm",weight:"medium",line:"body",color:"secondary"},overline:{size:"xs",weight:"semibold",line:"body",color:"secondary",uppercase:!0,letterSpacing:"wide"}},TEXT_ROLE_COLOR={textStrong:"text",primary:"text-body",secondary:"text-muted",tertiary:"text-subtle",inverse:"text-inverse",disabled:"text-disabled",link:"link",brand:"primary-text"},SEMANTIC_TONES=["success","warning","danger","info","neutral"],COLOR_NAMES=["primary","secondary","tertiary","inverse","disabled","link","textStrong","brand","success","warning","danger","info","neutral"];export const resolveColor=(e,t)=>{if(Object.hasOwn(TEXT_ROLE_COLOR,t)){const i=TEXT_ROLE_COLOR[t];if(void 0===i)throw new Error(`resolveColor: "${t}" is listed as a text role but has no colour`);return e.colors[i]}if(isOneOf(SEMANTIC_TONES,t)){const i=`${t}-text`;return e.colors[i]}return t};const resolveVariantColor=(e,t)=>hasKey(TEXT_ROLE_COLOR,t)||isOneOf(SEMANTIC_TONES,t)?resolveColor(e,t):isOneOf(THEME_COLOR_NAMES,t)?e.colors[t]:void 0,decorationOf=(e,t)=>e&&t?"underline line-through":e?"underline":t?"line-through":void 0,Text=forwardRef((e,t)=>{const{variant:i="body",color:o,weight:r,size:n,align:a,italic:l,underline:s,strikethrough:d,style:c,children:m,...x}=e,y=useTheme(),g=hasKey(VARIANTS,i),h=y.settings.textVariants,p=!g&&h&&Object.hasOwn(h,i)?h[i]:void 0;g||p||assertValidValue("Text","variant",e.variant,[...Object.keys(VARIANTS),...Object.keys(h??{})]),assertValidValue("Text","color",o,COLOR_NAMES),assertValidValue("Text","size",n,TEXT_NAMES);const u=void 0!==o&&COLOR_NAMES.includes(o)?o:void 0,f=useMemo(()=>{if(p){const e=n??p.size,t=y.text[e].size;return{fontSize:t,lineHeight:p.lineHeight??Math.round(t*y.leading[p.heading?"heading":"body"]),color:void 0!==u?resolveColor(y,u):p.color?resolveVariantColor(y,p.color):resolveColor(y,"primary"),textAlign:a,textTransform:p.uppercase?"uppercase":void 0,letterSpacing:p.letterSpacing?y["letter-spacing"][p.letterSpacing]:void 0,fontStyle:l||p.italic?"italic":void 0,fontVariant:p.fontVariant,textDecorationLine:decorationOf(s,d),...fontFor(y,r??p.weight??"normal",p.fontFamily)}}const e=VARIANTS[g?i:"body"],t=y.text[n??e.size].size;return{fontSize:t,lineHeight:Math.round(t*y.leading[e.line]),color:resolveColor(y,u??e.color),textAlign:a,textTransform:e.uppercase?"uppercase":void 0,letterSpacing:e.letterSpacing?y["letter-spacing"][e.letterSpacing]:void 0,fontStyle:l?"italic":void 0,textDecorationLine:decorationOf(s,d),...fontFor(y,r??e.weight,e.fontFamily)}},[y,p,g,i,u,r,n,a,l,s,d]),O=useTextInk([f,c],y.text.base.size,y.colors["text-body"]),T=g?VARIANTS[i].heading:p?.heading,b="string"==typeof m||"number"==typeof m;return _jsx(RNText,{ref:t,style:[f,c],maxFontSizeMultiplier:y.settings.maxFontSizeMultiplier,accessibilityRole:T?"header":x.accessibilityRole,...x,children:b?m:_jsx(TextInkContext.Provider,{value:O,children:m})})});Text.displayName="Text";export{Text};export default Text;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{useCallback,useEffect,useMemo,useState}from"react";import{StyleSheet,View}from"react-native";import{useTheme}from"../../theme/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{triggerHaptic}from"../../utils/hapticUtils.js";import Button from"../Button/Button.js";import{Modal}from"../Modal/index.js";import{PickerTrigger}from"../PickerTrigger/PickerTrigger.js";import{Text}from"../Text/index.js";import{WheelPicker}from"../WheelPicker/index.js";import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from"react/jsx-runtime";export const DEFAULT_TIME_PICKER_LABELS=Object.freeze({title:"Select Time",confirm:"Confirm",cancel:"Cancel",selected:e=>`Selected ${e}`,hour:"Hour",minute:"Minute",period:"Period",hourItem:e=>`Hour ${e}`,minuteItem:e=>`${e} minutes`,cancelHint:"Dismiss without changes",confirmHint:"Confirm selected time"});const range=(e,t,i=1)=>{const r=[];for(let a=e;a<=t;a+=i)r.push(a);return r},pad2=e=>e.toString().padStart(2,"0"),to24h=(e,t,i)=>"24h"===i?e:"AM"===t?12===e?0:e:12===e?12:e+12,from24h=(e,t)=>"24h"===t?{displayHour:e,period:"AM"}:0===e?{displayHour:12,period:"AM"}:12===e?{displayHour:12,period:"PM"}:e>12?{displayHour:e-12,period:"PM"}:{displayHour:e,period:"AM"},clampMinuteToStep=(e,t)=>{const i=Math.round(e/t)*t;return Math.min(59,Math.max(0,i))},TimePicker=e=>{const{open:t,value:i,onChange:r,onClose:a,format:s="12h",minuteStep:l=1,labels:o,testID:n,style:u,containerStyle:m,headerLabelStyle:c,footerButtonStyle:p,formatValue:d,haptic:h,triggerLabels:g,label:b,help:f,placeholder:y,helperText:M,error:x,required:S,disabled:k,size:T,variant:P,clearable:j,onClear:v,leftIcon:H,trailing:I,triggerStyle:_,valueStyle:C,labelStyle:D,messageStyle:V,accessibilityLabel:L}=e,B={label:b,help:f,placeholder:y,helperText:M,error:x,required:S,disabled:k,size:T,variant:P,clearable:j,onClear:v,leftIcon:H,trailing:I,triggerStyle:_,valueStyle:C,labelStyle:D,messageStyle:V,accessibilityLabel:L};assertValidValue("TimePicker","format",e.format,["12h","24h"]),assertValidValue("TimePicker","minuteStep",e.minuteStep?.toString(),["1","5","15","30"]),assertValidValue("TimePicker","size",e.size,["sm","md","lg"]),assertValidValue("TimePicker","variant",e.variant,["outline","filled","underline"]);const $=useMemo(()=>({...DEFAULT_TIME_PICKER_LABELS,...o}),[o]),w=void 0!==
|
|
1
|
+
"use strict";import{useCallback,useEffect,useMemo,useState}from"react";import{StyleSheet,View}from"react-native";import{useTheme}from"../../theme/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{triggerHaptic}from"../../utils/hapticUtils.js";import Button from"../Button/Button.js";import{Modal}from"../Modal/index.js";import{PickerTrigger}from"../PickerTrigger/PickerTrigger.js";import{Text}from"../Text/index.js";import{WheelPicker}from"../WheelPicker/index.js";import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from"react/jsx-runtime";export const DEFAULT_TIME_PICKER_LABELS=Object.freeze({title:"Select Time",confirm:"Confirm",cancel:"Cancel",selected:e=>`Selected ${e}`,hour:"Hour",minute:"Minute",period:"Period",hourItem:e=>`Hour ${e}`,minuteItem:e=>`${e} minutes`,cancelHint:"Dismiss without changes",confirmHint:"Confirm selected time"});const range=(e,t,i=1)=>{const r=[];for(let a=e;a<=t;a+=i)r.push(a);return r},pad2=e=>e.toString().padStart(2,"0"),to24h=(e,t,i)=>"24h"===i?e:"AM"===t?12===e?0:e:12===e?12:e+12,from24h=(e,t)=>"24h"===t?{displayHour:e,period:"AM"}:0===e?{displayHour:12,period:"AM"}:12===e?{displayHour:12,period:"PM"}:e>12?{displayHour:e-12,period:"PM"}:{displayHour:e,period:"AM"},clampMinuteToStep=(e,t)=>{const i=Math.round(e/t)*t;return Math.min(59,Math.max(0,i))},TimePicker=e=>{const{open:t,value:i,onChange:r,onClose:a,format:s="12h",minuteStep:l=1,labels:o,testID:n,style:u,containerStyle:m,headerLabelStyle:c,footerButtonStyle:p,formatValue:d,haptic:h,triggerLabels:g,label:b,help:f,placeholder:y,helperText:M,error:x,required:S,disabled:k,size:T,variant:P,clearable:j,onClear:v,leftIcon:H,trailing:I,triggerStyle:_,valueStyle:C,labelStyle:D,messageStyle:V,accessibilityLabel:L}=e,B={label:b,help:f,placeholder:y,helperText:M,error:x,required:S,disabled:k,size:T,variant:P,clearable:j,onClear:v,leftIcon:H,trailing:I,triggerStyle:_,valueStyle:C,labelStyle:D,messageStyle:V,accessibilityLabel:L};assertValidValue("TimePicker","format",e.format,["12h","24h"]),assertValidValue("TimePicker","minuteStep",e.minuteStep?.toString(),["1","5","15","30"]),assertValidValue("TimePicker","size",e.size,["sm","md","lg"]),assertValidValue("TimePicker","variant",e.variant,["outline","filled","underline"]);const $=useMemo(()=>({...DEFAULT_TIME_PICKER_LABELS,...o}),[o]),w=void 0!==t,[A,F]=useState(!1),E=w?t:A,N=w?n:n?`${n}-modal`:void 0,O=useTheme(),z=useMemo(()=>buildStyles(O),[O]),W=useCallback(()=>{w?a?.():F(!1)},[w,a]),R=useMemo(()=>"24h"===s?range(0,23):range(1,12),[s]),U=useMemo(()=>range(0,59,l),[l]),q=useMemo(()=>["AM","PM"],[]),K=useMemo(()=>{const e=i&&Number.isFinite(i.hour)?i.hour:(new Date).getHours(),t=i&&Number.isFinite(i.minute)?i.minute:(new Date).getMinutes(),r=clampMinuteToStep(t,l),{displayHour:a,period:o}=from24h(e,s);return{displayHour:a,minute:r,period:o,hour24:e}},[i,s,l]),[G,J]=useState(()=>{const e=R.indexOf(K.displayHour);return e>=0?e:0}),[Q,X]=useState(()=>{const e=U.indexOf(K.minute);return e>=0?e:0}),[Y,Z]=useState(()=>"PM"===K.period?1:0);useEffect(()=>{if(!E)return;const e=i&&Number.isFinite(i.hour)?i.hour:(new Date).getHours(),t=i&&Number.isFinite(i.minute)?i.minute:(new Date).getMinutes(),r=clampMinuteToStep(t,l),{displayHour:a,period:o}=from24h(e,s),n=R.indexOf(a);J(n>=0?n:0);const u=U.indexOf(r);X(u>=0?u:0),Z("PM"===o?1:0)},[E,i,s,l,R,U]);const ee=useCallback((e,t)=>{"hour"===e?J(Math.max(0,R.indexOf(Number(t)))):"minute"===e?X(Math.max(0,U.indexOf(Number(t)))):Z("PM"===t?1:0)},[R,U]),te=useCallback(()=>{!1!==h&&triggerHaptic("selection"),W()},[W,h]),ie=useCallback(()=>{const e=R[G]??0,t=q[Y]??"AM",i=to24h(e,t,s),a=U[Q]??0;!1!==h&&triggerHaptic("notificationSuccess"),r?.({hour:i,minute:a}),W()},[R,G,q,Y,U,Q,s,r,W,h]),re=useMemo(()=>{const e=R[G]??0,t=U[Q]??0;if("24h"===s)return`${pad2(e)}:${pad2(t)}`;const i=q[Y]??"AM";return`${pad2(e)}:${pad2(t)} ${i}`},[R,G,U,Q,q,Y,s]),ae=useMemo(()=>R.map(e=>({value:e,label:pad2(e),accessibilityLabel:$.hourItem(e)})),[R,$]),se=useMemo(()=>U.map(e=>({value:e,label:pad2(e),accessibilityLabel:$.minuteItem(e)})),[U,$]),le=useMemo(()=>q.map(e=>({value:e,label:e})),[q]),oe=useMemo(()=>{const e=[{key:"hour",label:$.hour,items:ae,value:R[G]??0,separator:":",testID:"time-picker-hour"},{key:"minute",label:$.minute,items:se,value:U[Q]??0,gapAfter:"12h"===s?O.space.md:void 0,testID:"time-picker-minute"}];return"12h"===s&&e.push({key:"period",label:$.period,items:le,value:q[Y]??"AM",testID:"time-picker-period"}),e},[ae,se,le,R,G,U,Q,q,Y,s,O.space.md,$]),ne=useCallback(e=>{if("24h"===s)return`${pad2(e.hour)}:${pad2(e.minute)}`;const{displayHour:t,period:i}=from24h(e.hour,"12h");return`${t}:${pad2(e.minute)} ${i}`},[s]),ue=!w&&i&&Number.isFinite(i.hour)&&Number.isFinite(i.minute)?(d??ne)(i):void 0,me=_jsxs(Modal,{open:E,onClose:W,presentation:"bottom",accessibilityLabel:$.title,haptic:h,contentStyle:[m,u],testID:N,children:[_jsx(Text,{variant:"title",align:"center",accessibilityRole:"header",style:[z.title,c],children:$.title}),_jsx(View,{style:z.summaryWrap,accessibilityLiveRegion:"polite",accessibilityLabel:$.selected(re),children:_jsx(Text,{variant:"h2",weight:"bold",color:"brand",style:z.summary,children:re})}),_jsx(WheelPicker,{columns:oe,onChange:ee,haptic:h,style:z.wheels}),_jsxs(View,{style:z.footer,children:[_jsx(Button,{label:$.cancel,haptic:!1,variant:"ghost",tone:"neutral",onPress:te,style:[z.footerBtn,p],accessibilityHint:$.cancelHint,testID:"time-picker-cancel"}),_jsx(Button,{label:$.confirm,variant:"solid",tone:"primary",haptic:!1,onPress:ie,style:[z.footerBtn,p],accessibilityHint:$.confirmHint,testID:"time-picker-confirm"})]})]});return w?me:_jsxs(_Fragment,{children:[_jsx(PickerTrigger,{...B,labels:g,value:ue,onPress:()=>F(!0),testID:n}),me]})},buildStyles=e=>StyleSheet.create({title:{marginBottom:e.space.sm},summaryWrap:{alignItems:"center",marginBottom:e.space.md},summary:{letterSpacing:e["letter-spacing"].wide},wheels:{marginBottom:e.space.lg},footer:{flexDirection:"row",justifyContent:"flex-end",alignItems:"center",gap:e.space.sm},footerBtn:{paddingHorizontal:e.space.lg}});export{TimePicker};export default TimePicker;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{Fragment,useCallback,useMemo}from"react";import{StyleSheet,useWindowDimensions,View}from"react-native";import{useReducedMotion}from"../../hooks/useReducedMotion.js";import{useTheme}from"../../theme/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{Chip}from"../Chip/index.js";import{Text}from"../Text/index.js";import{WHEEL_CENTER_OFFSET,WHEEL_VISIBLE_ITEMS,Wheel}from"./Wheel.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const BASE_ITEM_HEIGHT=40,MAX_FONT_SCALE=1.5,DEFAULT_COLUMN_WIDTH=64,MAX_DURATION_MINUTES=1439;export const DEFAULT_WHEEL_PICKER_LABELS=Object.freeze({hours:"Hours",minutes:"Minutes",hourUnit:"hr",minuteUnit:"min",hourOne:"hour",hourMany:"hours",minuteOne:"minute",minuteMany:"minutes",value:"Value"});const range=(e,t,i=1)=>{const s=[];for(let o=e;o<=t;o+=i)s.push(o);return s},plural=(e,t,i)=>`${e} ${1===e?t:i}`,formatPreset=(e,t,i)=>{const s=Math.floor(e/60),o=e%60;return 0===s?`${o} ${i}`:0===o?`${s} ${t}`:`${s} ${t} ${o} ${i}`},toItem=e=>"object"==typeof e?e:{value:e,label:String(e)},WheelPicker=e=>{const{haptic:t,disabled:i,testID:s,style:o,labels:n}=e;assertValidValue("WheelPicker","mode",e.mode,["columns","list","duration"]);const
|
|
1
|
+
"use strict";import{Fragment,useCallback,useMemo}from"react";import{StyleSheet,useWindowDimensions,View}from"react-native";import{useReducedMotion}from"../../hooks/useReducedMotion.js";import{useTheme}from"../../theme/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{Chip}from"../Chip/index.js";import{Text}from"../Text/index.js";import{WHEEL_CENTER_OFFSET,WHEEL_VISIBLE_ITEMS,Wheel}from"./Wheel.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const BASE_ITEM_HEIGHT=40,MAX_FONT_SCALE=1.5,DEFAULT_COLUMN_WIDTH=64,MAX_DURATION_MINUTES=1439;export const DEFAULT_WHEEL_PICKER_LABELS=Object.freeze({hours:"Hours",minutes:"Minutes",hourUnit:"hr",minuteUnit:"min",hourOne:"hour",hourMany:"hours",minuteOne:"minute",minuteMany:"minutes",value:"Value"});const range=(e,t,i=1)=>{const s=[];for(let o=e;o<=t;o+=i)s.push(o);return s},plural=(e,t,i)=>`${e} ${1===e?t:i}`,formatPreset=(e,t,i)=>{const s=Math.floor(e/60),o=e%60;return 0===s?`${o} ${i}`:0===o?`${s} ${t}`:`${s} ${t} ${o} ${i}`},toItem=e=>"object"==typeof e?e:{value:e,label:String(e)},WheelPicker=e=>{const{haptic:t,disabled:i,testID:s,style:o,labels:n}=e;assertValidValue("WheelPicker","mode",e.mode,["columns","list","duration"]);const a=useTheme(),r=useReducedMotion(),{fontScale:l}=useWindowDimensions(),u=Math.min(Math.max(l,1),1.5),m=Math.round(40*u),d=useMemo(()=>buildStyles(a,m),[a,m]),h="list"===e.mode?e.items:void 0,c=useMemo(()=>h?.map(toItem),[h]),p="duration"===e.mode?e.minuteStep??1:1,b="duration"===e.mode?Math.max(0,Math.min(1439,Math.floor(e.maxMinutes??1/0))):0,f=Math.floor(b/60),x=useMemo(()=>({...DEFAULT_WHEEL_PICKER_LABELS,...n}),[n]),M="duration"===e.mode?e.presets:void 0;for(const e of M??[])if(!Number.isInteger(e)||e<0||e>b||e%p!==0)throw new Error(`WheelPicker preset ${e} must be a whole number of minutes from 0 to ${b} in steps of ${p}.`);const y=useCallback(e=>{const t=e===f?b%60:59;return Math.floor(t/p)*p},[f,b,p]),E="duration"===e.mode?e.value:0,_=useMemo(()=>{const e=Number.isFinite(E)?E:0,t=Math.max(0,Math.min(b,e)),i=Math.floor(t/60),s=Math.round(t%60/p)*p;return{hour:i,minute:Math.min(y(i),s)}},[E,b,p,y]),g=useMemo(()=>"duration"===e.mode?range(0,f).map(e=>({value:e,label:String(e),accessibilityLabel:plural(e,x.hourOne,x.hourMany)})):[],[e.mode,f,x]),j=y(_.hour),S=useMemo(()=>"duration"===e.mode?range(0,j,p).map(e=>({value:e,label:String(e).padStart(2,"0"),accessibilityLabel:plural(e,x.minuteOne,x.minuteMany)})):[],[e.mode,j,p,x]),v=useMemo(()=>"list"===e.mode?[{key:"list",label:e.label??x.value,items:c??[],value:e.value??"",width:e.width}]:"duration"===e.mode?[{key:"hours",label:x.hours,items:g,value:_.hour,unit:x.hourUnit,gapAfter:a.space.md},{key:"minutes",label:x.minutes,items:S,value:_.minute,unit:x.minuteUnit}]:e.columns,[e,c,g,S,_,x,a.space.md]),w="list"===e.mode?e.onChange:void 0,I="duration"===e.mode?e.onChange:void 0,L="list"===e.mode||"duration"===e.mode?void 0:e.onChange,T=useCallback((e,t)=>{const i=e.items[t];if(i)if(w)w(i.value);else if(I){const t=Number(i.value);"hours"===e.key?I(60*t+Math.min(_.minute,y(t))):I(60*_.hour+t)}else L?.(e.key,i.value)},[w,I,L,_,y]),C=useCallback(e=>{I?.(e)},[I]),W=60*_.hour+_.minute,k=_jsxs(View,{style:[d.wheels,o],testID:s,children:[_jsxs(View,{pointerEvents:"none",style:d.selectionBand,children:[_jsx(View,{style:d.bandLine}),_jsx(View,{style:d.bandLine})]}),v.map(s=>{if(0===s.items.length)return null;const o=s.items.findIndex(e=>e.value===s.value);return _jsxs(Fragment,{children:[_jsx(Wheel,{label:s.label,items:s.items,selectedIndex:Math.max(0,o),onIndexChange:e=>T(s,e),itemHeight:m,width:s.width??("list"===e.mode?void 0:64),theme:a,haptic:t,disabled:i,reducedMotion:r,typeable:"duration"===e.mode,testID:s.testID}),s.unit?_jsx(Text,{variant:"body",weight:"semibold",color:"secondary",style:d.unit,maxFontSizeMultiplier:1.5,numberOfLines:1,accessible:!1,importantForAccessibility:"no","aria-hidden":!0,children:s.unit}):null,s.separator?_jsx(Text,{variant:"h2",weight:"bold",style:d.separator,maxFontSizeMultiplier:1.5,accessible:!1,importantForAccessibility:"no","aria-hidden":!0,children:s.separator}):null,s.gapAfter?_jsx(View,{style:{width:s.gapAfter}}):null]},s.key)})]});return M&&0!==M.length?_jsxs(View,{children:[k,_jsx(View,{style:d.presets,children:M.map(e=>_jsx(Chip,{label:formatPreset(e,x.hourUnit,x.minuteUnit),size:"sm",selected:e===W,disabled:i,onPress:()=>C(e)},e))})]}):k},buildStyles=(e,t)=>StyleSheet.create({wheels:{flexDirection:"row",alignItems:"center",justifyContent:"center",height:t*WHEEL_VISIBLE_ITEMS,position:"relative"},selectionBand:{position:"absolute",left:0,right:0,top:t*WHEEL_CENTER_OFFSET,height:t,justifyContent:"space-between"},bandLine:{height:2*StyleSheet.hairlineWidth,backgroundColor:e.colors.primary,opacity:.85},separator:{paddingHorizontal:e.space.xs},unit:{paddingLeft:e.space.xs},presets:{flexDirection:"row",flexWrap:"wrap",justifyContent:"center",gap:e.space.xs,paddingTop:e.space.sm}});export{WheelPicker};export default WheelPicker;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import React from"react";import{FormField}from"../components/FormField/FormField.js";import{useHookFormField}from"./useHookFormField.js";import{jsx as _jsx}from"react/jsx-runtime";const assignRef=(e,r)=>{"function"==typeof e?e(r):e&&(e.current=r)};export const HookFormField=e=>{const{label:r,help:o,helperText:l,helperLines:t,labels:i,required:n,layout:s,labelStyle:a,helperStyle:c,errorStyle:m,containerStyle:p,inputContainerStyle:u,accessibilityLabel:F,testID:d,children:y,hideError:f,...h}=e,b=useHookFormField(h),x="function"==typeof y;let S=null;if(x)S=y(b);else if(React.isValidElement(y)){const e=y.props
|
|
1
|
+
"use strict";import React from"react";import{FormField}from"../components/FormField/FormField.js";import{useHookFormField}from"./useHookFormField.js";import{jsx as _jsx}from"react/jsx-runtime";const assignRef=(e,r)=>{"function"==typeof e?e(r):e&&(e.current=r)};export const HookFormField=e=>{const{label:r,help:o,helperText:l,helperLines:t,labels:i,required:n,layout:s,labelStyle:a,helperStyle:c,errorStyle:m,containerStyle:p,inputContainerStyle:u,accessibilityLabel:F,testID:d,children:y,hideError:f,...h}=e,b=useHookFormField(h),x="function"==typeof y;let S=null;if(x)S=y(b);else if(React.isValidElement(y)){const e=y.props,r={value:b.value,error:b.error,onChangeText:r=>{b.onChangeText(r),e.onChangeText?.(r)},onBlur:r=>{b.onBlur(),e.onBlur?.(r)},ref:r=>{b.ref(r),assignRef(e.ref,r)}};S=React.cloneElement(y,r)}const j=!x||React.isValidElement(S)&&"error"in S.props;return _jsx(FormField,{label:r,help:o,helperText:l,helperLines:t,labels:i,required:n,layout:s,labelStyle:a,helperStyle:c,errorStyle:m,containerStyle:p,inputContainerStyle:u,accessibilityLabel:F,testID:d,error:f??j?void 0:b.error,children:S})};HookFormField.displayName="HookFormField";
|
package/lib/module/form/path.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const tokenize=t=>{const
|
|
1
|
+
"use strict";const tokenize=t=>{const e=[],o=/[^.[\]]+/g;for(const r of t.matchAll(o)){const t=r[0];e.push(/^\d+$/.test(t)?Number(t):t)}return e},copyOf=t=>Object.assign(Array.isArray(t)?Array.from(t):{},t);export const getPath=(t,e)=>{const o=tokenize(e);let r=t;for(const t of o){if(null==r||"object"!=typeof r)return;r=Reflect.get(r,t)}return r};export const setPath=(t,e,o)=>{const r=tokenize(e),n=r.pop();if(void 0===n)return t;const c={...t};let s=c,f=r.shift();for(const t of[...r,n]){if(void 0===f)break;const e=Reflect.get(s,f),o=null!=e&&"object"==typeof e?copyOf(e):"number"==typeof t?[]:{};Reflect.set(s,f,o),s=o,f=t}return Reflect.set(s,n,o),c};export const deletePath=(t,e)=>{const o=tokenize(e),r=o.pop();if(void 0===r)return t;const n={...t};let c=n;for(const t of o){const e=Reflect.get(c,t);if(null==e||"object"!=typeof e)return n;const o=copyOf(e);Reflect.set(c,t,o),c=o}return Array.isArray(c)&&"number"==typeof r?c.splice(r,1):Reflect.deleteProperty(c,r),n};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{useCallback,useRef,useState}from"react";export function useControllableState({value:e,defaultValue:t,onChange:u}){const a=useRef(void 0!==e).current,[l,
|
|
1
|
+
"use strict";import{useCallback,useRef,useState}from"react";export function useControllableState({value:e,defaultValue:t,onChange:u}){const a=useRef(void 0!==e).current,[l,o]=useState(t);return[a&&void 0!==e?e:l,useCallback(e=>{a||o(e),u?.(e)},[a,u])]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{TurboModuleRegistry}from"react-native";export default TurboModuleRegistry.get("PdfRasterizer");
|
|
1
|
+
"use strict";import{TurboModuleRegistry}from"react-native";export default TurboModuleRegistry.get("PdfRasterizer")??null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{Storage}from"@webority/mobile-core";import{createContext,useCallback,useContext,useEffect,useMemo,useRef,useState}from"react";import{Appearance}from"react-native";import{useReducedMotion}from"../hooks/useReducedMotion.js";import{mergeBrand}from"./merge.js";import{darkTheme,lightTheme}from"./tokens.js";import{jsx as _jsx}from"react/jsx-runtime";const REDUCED_SPRING={damping:100,stiffness:1e3,mass:1},collapseMotion=e=>({...e,duration:{instant:0,fast:0,default:0,slow:0,slower:0},spring:{gentle:REDUCED_SPRING,bouncy:REDUCED_SPRING,snappy:REDUCED_SPRING}}),isPreference=e=>"light"===e||"dark"===e||"system"===e,defaultValue={theme:lightTheme,mode:"light",preference:"system",setPreference:()=>{},toggleColorMode:()=>{}},ThemeContext=createContext(defaultValue);export const ThemeProvider=e=>{const{children:t,initialPreference:r="system",persistKey:o,brand:
|
|
1
|
+
"use strict";import{Storage}from"@webority/mobile-core";import{createContext,useCallback,useContext,useEffect,useMemo,useRef,useState}from"react";import{Appearance}from"react-native";import{useReducedMotion}from"../hooks/useReducedMotion.js";import{isOneOf}from"../utils/guards.js";import{mergeBrand}from"./merge.js";import{darkTheme,lightTheme}from"./tokens.js";import{jsx as _jsx}from"react/jsx-runtime";const REDUCED_SPRING={damping:100,stiffness:1e3,mass:1},collapseMotion=e=>({...e,duration:{instant:0,fast:0,default:0,slow:0,slower:0},spring:{gentle:REDUCED_SPRING,bouncy:REDUCED_SPRING,snappy:REDUCED_SPRING}}),isPreference=e=>"light"===e||"dark"===e||"system"===e,COLOR_MODES=["light","dark"],colorModeOf=e=>isOneOf(COLOR_MODES,e)?e:"light",defaultValue={theme:lightTheme,mode:"light",preference:"system",setPreference:()=>{},toggleColorMode:()=>{}},ThemeContext=createContext(defaultValue);export const ThemeProvider=e=>{const{children:t,initialPreference:r="system",persistKey:o,brand:s,settings:n,...i}=e;if(Object.keys(i).length>0)throw new Error("ThemeProvider takes only these props: children, initialPreference, persistKey, brand, settings (mobile-ui 0.89.0). Run webority upgrade 0.89.0 to move an app.");const[m,c]=useState(r),a=useRef(!1);useEffect(()=>{if(!o)return;let e=!0;return Storage.getItem(o).then(t=>{e&&!a.current&&isPreference(t)&&c(t)}),()=>{e=!1}},[o]);const d=useCallback(e=>{a.current=!0,c(e)},[]);useEffect(()=>{o&&a.current&&Storage.setItem(o,m)},[o,m]);const[l,u]=useState(()=>colorModeOf(Appearance.getColorScheme()));useEffect(()=>{const e=Appearance.addChangeListener(({colorScheme:e})=>{u(colorModeOf(e))});return()=>e.remove()},[]);const h="system"===m?l:m,f=useReducedMotion(),g=useMemo(()=>{const e="dark"===h?darkTheme:lightTheme,t=s||n?mergeBrand(e,s,n):e;return f?{...t,motion:collapseMotion(t.motion)}:t},[h,s,n,f]),p=useMemo(()=>({theme:g,mode:h,preference:m,setPreference:d,toggleColorMode:()=>d(e=>"system"===e?"dark"===l?"light":"dark":"dark"===e?"light":"dark")}),[g,h,m,l,d]);return _jsx(ThemeContext.Provider,{value:p,children:t})};export const KitThemeBridge=({mode:e,brand:t,children:r})=>{const o=useReducedMotion();if("light"!==e&&"dark"!==e)throw new Error('KitThemeBridge takes mode "light" or "dark".');const s=useMemo(()=>{const r="dark"===e?darkTheme:lightTheme,s=t?mergeBrand(r,t,void 0):r;return o?{...s,motion:collapseMotion(s.motion)}:s},[e,t,o]),n=useMemo(()=>({theme:s,mode:e,preference:e,setPreference:()=>{},toggleColorMode:()=>{}}),[s,e]);return _jsx(ThemeContext.Provider,{value:n,children:r})};export const useTheme=()=>useContext(ThemeContext).theme;export const useThemeMode=()=>{const e=useContext(ThemeContext);return{mode:e.mode,preference:e.preference,setPreference:e.setPreference,toggleColorMode:e.toggleColorMode}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{Animated,Platform}from"react-native";import{nativeDriver}from"../utils/nativeDriver.js";export const createAnimatedValue=(t,e)=>{const r=new Animated.Value(t,e);return"web"===Platform.OS?r:(r
|
|
1
|
+
"use strict";import{Animated,Platform}from"react-native";import{nativeDriver}from"../utils/nativeDriver.js";export const createAnimatedValue=(t,e)=>{const r=new Animated.Value(t,e);return"web"===Platform.OS?r:(Object.assign(r,{_tracking:null}),Object.seal(r))};export const setNativeValue=(t,e)=>{Animated.timing(t,{toValue:e,duration:0,useNativeDriver:nativeDriver}).start()};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{scaleStep}from"./scale.js";import{COMPONENT_KINDS}from"./tokens.generated.js";const SIZE_KEYS=["xs","sm","md","lg","xl"],kindOf=(e,
|
|
1
|
+
"use strict";import{isOneOf,isRecord,keysOf}from"../utils/guards.js";import{scaleStep}from"./scale.js";import{COMPONENT_KINDS}from"./tokens.generated.js";const SIZE_KEYS=["xs","sm","md","lg","xl"],kindOf=(e,t,i)=>{const o=COMPONENT_KINDS[e][t];if(!o)throw new Error(`components.${e}${i?`.${i}`:""}.${t} has no kind in COMPONENT_KINDS.`);return o},pixelsOf=(e,t,i,o)=>{if("space"===t||"text"===t||"radius"===t)return scaleStep(e,t,String(i),o);if("number"!=typeof i)throw new Error(`${o} is ${JSON.stringify(i)}; it takes a number.`);return i},resolveSize=(e,t,i)=>{const o=e.components[t];if(!isRecord(o))throw new Error(`components.${t} is missing in the theme.`);const n=o[i];if(!isRecord(n))throw new Error(`components.${t} has no "${i}" size in the theme.`);const s={};for(const o of Object.keys(n))s[o]=pixelsOf(e,kindOf(t,o,i),n[o],`components.${t}.${i}.${o}`);return s},sizeToken=(e,t,i,o)=>{const n=e[o];if(void 0===n)throw new Error(`components.${t}.${i}.${o} is missing`);return n};export const resolveButtonSize=(e,t)=>{const i=resolveSize(e,"button",t);return{"padding-x":sizeToken(i,"button",t,"padding-x"),"padding-y":sizeToken(i,"button",t,"padding-y"),"min-height":sizeToken(i,"button",t,"min-height"),text:sizeToken(i,"button",t,"text"),radius:sizeToken(i,"button",t,"radius"),icon:sizeToken(i,"button",t,"icon"),"badge-icon":sizeToken(i,"button",t,"badge-icon")}};export const resolveFieldSize=(e,t)=>{const i=resolveSize(e,"field",t);return{radius:sizeToken(i,"field",t,"radius"),"padding-x":sizeToken(i,"field",t,"padding-x"),"padding-y":sizeToken(i,"field",t,"padding-y"),"min-height":sizeToken(i,"field",t,"min-height"),text:sizeToken(i,"field",t,"text"),icon:sizeToken(i,"field",t,"icon"),"label-text":sizeToken(i,"field",t,"label-text"),"label-gap":sizeToken(i,"field",t,"label-gap"),"message-text":sizeToken(i,"field",t,"message-text"),"message-gap":sizeToken(i,"field",t,"message-gap")}};export const resolveEmptyStateSize=(e,t)=>{const i=resolveSize(e,"empty-state",t);return{icon:sizeToken(i,"empty-state",t,"icon"),"illustration-size":sizeToken(i,"empty-state",t,"illustration-size"),"title-text":sizeToken(i,"empty-state",t,"title-text"),"description-text":sizeToken(i,"empty-state",t,"description-text"),"padding-y":sizeToken(i,"empty-state",t,"padding-y"),"title-gap":sizeToken(i,"empty-state",t,"title-gap"),"description-gap":sizeToken(i,"empty-state",t,"description-gap")}};export const resolveListItemSize=(e,t)=>{const i=resolveSize(e,"list-item",t);return{"padding-y":sizeToken(i,"list-item",t,"padding-y"),"title-text":sizeToken(i,"list-item",t,"title-text"),"subtitle-text":sizeToken(i,"list-item",t,"subtitle-text"),"min-height":sizeToken(i,"list-item",t,"min-height")}};export const resolveBadgeSize=(e,t)=>{const i=resolveSize(e,"badge",t);return{text:sizeToken(i,"badge",t,"text"),"min-width":sizeToken(i,"badge",t,"min-width"),height:sizeToken(i,"badge",t,"height"),"padding-x":sizeToken(i,"badge",t,"padding-x"),"dot-size":sizeToken(i,"badge",t,"dot-size")}};export const resolveChipSize=(e,t)=>{const i=resolveSize(e,"chip",t);return{"padding-x":sizeToken(i,"chip",t,"padding-x"),"padding-y":sizeToken(i,"chip",t,"padding-y"),text:sizeToken(i,"chip",t,"text"),"min-height":sizeToken(i,"chip",t,"min-height"),"close-size":sizeToken(i,"chip",t,"close-size"),"close-text":sizeToken(i,"chip",t,"close-text"),gap:sizeToken(i,"chip",t,"gap"),icon:sizeToken(i,"chip",t,"icon")}};export const resolveCheckboxSize=(e,t)=>{const i=resolveSize(e,"checkbox",t);return{"box-size":sizeToken(i,"checkbox",t,"box-size")}};export const resolveRadioSize=(e,t)=>{const i=resolveSize(e,"radio",t);return{outer:sizeToken(i,"radio",t,"outer"),inner:sizeToken(i,"radio",t,"inner")}};export const resolveSwitchSize=(e,t)=>{const i=resolveSize(e,"switch",t);return{"track-width":sizeToken(i,"switch",t,"track-width"),"track-height":sizeToken(i,"switch",t,"track-height"),"thumb-size":sizeToken(i,"switch",t,"thumb-size"),padding:sizeToken(i,"switch",t,"padding")}};export const resolveOtpInputSize=(e,t)=>{const i=resolveSize(e,"otp-input",t);return{cell:sizeToken(i,"otp-input",t,"cell"),text:sizeToken(i,"otp-input",t,"text"),radius:sizeToken(i,"otp-input",t,"radius"),gap:sizeToken(i,"otp-input",t,"gap")}};export const resolveSegmentedControlSize=(e,t)=>{const i=resolveSize(e,"segmented-control",t);return{height:sizeToken(i,"segmented-control",t,"height"),text:sizeToken(i,"segmented-control",t,"text"),"padding-x":sizeToken(i,"segmented-control",t,"padding-x"),icon:sizeToken(i,"segmented-control",t,"icon")}};export const resolveTabsSize=(e,t)=>{const i=resolveSize(e,"tabs",t);return{text:sizeToken(i,"tabs",t,"text"),"padding-y":sizeToken(i,"tabs",t,"padding-y"),"padding-x":sizeToken(i,"tabs",t,"padding-x"),"scrollable-padding-x":sizeToken(i,"tabs",t,"scrollable-padding-x"),icon:sizeToken(i,"tabs",t,"icon")}};export const resolveSliderSize=(e,t)=>{const i=resolveSize(e,"slider",t);return{"track-height":sizeToken(i,"slider",t,"track-height"),"thumb-diameter":sizeToken(i,"slider",t,"thumb-diameter")}};export const resolveFloatingActionButtonSize=(e,t)=>{const i=resolveSize(e,"floating-action-button",t);return{diameter:sizeToken(i,"floating-action-button",t,"diameter"),icon:sizeToken(i,"floating-action-button",t,"icon"),text:sizeToken(i,"floating-action-button",t,"text"),"label-padding-x":sizeToken(i,"floating-action-button",t,"label-padding-x")}};export const validateComponentTokens=e=>{for(const t of keysOf(COMPONENT_KINDS))for(const[i,o]of Object.entries(e.components[t]))isOneOf(SIZE_KEYS,i)?resolveSize(e,t,i):pixelsOf(e,kindOf(t,i),o,`components.${t}.${i}`)};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{validateComponentTokens}from"./componentSizes.js";import{COLOR_NAMES,FONT_NAMES,RADIUS_NAMES,WEIGHT_NAMES}from"./tokens.generated.js";import{deriveSolidFill,deriveStateFills,deriveToneInk}from"./toneInk.js";const HINT="Run webority upgrade to rename old names.",BRAND_KEYS=["colors","radius","font"],COLOR_MODES=["light","dark"],FIXED_RADII=["none","pill"],RADIUS_ALLOWED="sm, md, lg, xl",SETTINGS_KEYS=["icons","gradients","textVariants","maxFontSizeMultiplier","components"],COMPONENT_SETTING_KEYS={field:{defaultVariant:!0,requiredMarker:!0},input:{defaultVariant:!0,defaultLabelMode:!0,tintLabelOnFocus:!0,shakeOnError:!0},"search-bar":{defaultVariant:!0},select:{defaultVariant:!0},"otp-input":{shakeOnError:!0},"option-sheet":{selectedMarker:!0},"profile-picker":{defaultTone:!0,defaultVariant:!0,defaultAvatarTone:!0},slider:{thumbPressAnimation:!0},rating:{pulseOnPress:!0},stepper:{pulseAnimation:!0},tooltip:{enableScaleAnimation:!0},toast:{enableSwipeDismiss:!0,defaultDurationMs:!0},button:{defaultVariant:!0,defaultSize:!0,defaultPressAnimation:!0},card:{defaultVariant:!0,defaultPadding:!0,defaultRadius:!0,defaultTitleFont:!0},"section-header":{defaultVariant:!0,defaultFlush:!0},"empty-state":{defaultSize:!0,defaultVariant:!0},screen:{tabBarFloats:!0,headerShadowOnScroll:!0}},isPlainObject=
|
|
1
|
+
"use strict";import{hasKey,isOneOf,isRecord,keysOf}from"../utils/guards.js";import{validateComponentTokens}from"./componentSizes.js";import{COLOR_NAMES,FONT_NAMES,RADIUS_NAMES,WEIGHT_NAMES}from"./tokens.generated.js";import{deriveSolidFill,deriveStateFills,deriveToneInk}from"./toneInk.js";const HINT="Run webority upgrade to rename old names.",BRAND_KEYS=["colors","radius","font"],COLOR_MODES=["light","dark"],FIXED_RADII=["none","pill"],RADIUS_ALLOWED="sm, md, lg, xl",SETTINGS_KEYS=["icons","gradients","textVariants","maxFontSizeMultiplier","components"],COMPONENT_SETTING_KEYS={field:{defaultVariant:!0,requiredMarker:!0},input:{defaultVariant:!0,defaultLabelMode:!0,tintLabelOnFocus:!0,shakeOnError:!0},"search-bar":{defaultVariant:!0},select:{defaultVariant:!0},"otp-input":{shakeOnError:!0},"option-sheet":{selectedMarker:!0},"profile-picker":{defaultTone:!0,defaultVariant:!0,defaultAvatarTone:!0},slider:{thumbPressAnimation:!0},rating:{pulseOnPress:!0},stepper:{pulseAnimation:!0},tooltip:{enableScaleAnimation:!0},toast:{enableSwipeDismiss:!0,defaultDurationMs:!0},button:{defaultVariant:!0,defaultSize:!0,defaultPressAnimation:!0},card:{defaultVariant:!0,defaultPadding:!0,defaultRadius:!0,defaultTitleFont:!0},"section-header":{defaultVariant:!0,defaultFlush:!0},"empty-state":{defaultSize:!0,defaultVariant:!0},screen:{tabBarFloats:!0,headerShadowOnScroll:!0}},isPlainObject=o=>"object"==typeof o&&null!==o&&!Array.isArray(o),validateBrand=o=>{if(void 0===o)return;if(!isPlainObject(o))throw new Error(`A brand is an object of colors, radius and font; got ${typeof o}. ${HINT}`);for(const e of Object.keys(o))if(!BRAND_KEYS.includes(e))throw new Error(`A brand sets colors, radius and font only; ${e} is not allowed (allowed: colors, radius, font). ${HINT}`);const e=o.colors;if(void 0!==e&&!isPlainObject(e))throw new Error(`A brand's colors is an object of light and dark; got ${typeof e}. ${HINT}`);if(isRecord(e))for(const o of Object.keys(e)){if(!COLOR_MODES.includes(o))throw new Error(`A brand sets colours under light and dark only; ${o} is not allowed (allowed: light, dark). ${HINT}`);const t=e[o];if(void 0===t)throw new Error(`A brand's ${o} colours are missing. ${HINT}`);if(!isRecord(t))throw new Error(`A brand's ${o} colours is an object of colour names; got ${typeof t}. ${HINT}`);for(const o of Object.keys(t)){if(!isOneOf(COLOR_NAMES,o))throw new Error(`unknown colour ${o}; allowed: ${COLOR_NAMES.join(", ")}. ${HINT}`);if(void 0!==t[o]&&"string"!=typeof t[o])throw new Error(`colour ${o} must be a string; got ${typeof t[o]}.`)}}const t=o.radius;if(void 0!==t){if(!isPlainObject(t))throw new Error(`A brand's radius is an object of radius names; got ${typeof t}. ${HINT}`);for(const o of Object.keys(t)){const e=t[o];if(!isOneOf(RADIUS_NAMES,o))throw new Error(`unknown radius ${o}; allowed: ${RADIUS_ALLOWED}. ${HINT}`);if(FIXED_RADII.includes(o))throw new Error(`radius ${o} is fixed by the library; allowed: ${RADIUS_ALLOWED}.`);if("number"!=typeof e||!Number.isFinite(e))throw new Error(`radius ${o} must be a number; got ${typeof e}.`)}}const n=o.font;if(void 0!==n){if(!isPlainObject(n))throw new Error(`A brand's font is an object of font names; got ${typeof n}. ${HINT}`);for(const o of Object.keys(n)){if(!isOneOf(FONT_NAMES,o))throw new Error(`unknown font ${o}; allowed: ${FONT_NAMES.join(", ")}. ${HINT}`);const e=n[o];if(!isPlainObject(e))throw new Error(`font ${o} must be an object of weights; got ${typeof e}. ${HINT}`);for(const t of Object.keys(e)){if(!isOneOf(WEIGHT_NAMES,t))throw new Error(`unknown font weight ${t} in font ${o}; allowed: ${WEIGHT_NAMES.join(", ")}. ${HINT}`);const n=e[t];if("string"!=typeof n||0===n.length)throw new Error(`font ${o} weight ${t} must be a non-empty string.`)}}}},validateSettings=o=>{if(void 0===o)return;if(!isPlainObject(o))throw new Error(`Theme settings is an object; got ${typeof o}. ${HINT}`);for(const e of Object.keys(o))if(!isOneOf(SETTINGS_KEYS,e))throw new Error(`Theme settings take ${SETTINGS_KEYS.join(", ")} only; ${e} is not allowed. ${HINT}`);const e=o.components;if(void 0!==e){if(!isPlainObject(e))throw new Error(`Theme settings components is an object of component names; got ${typeof e}. ${HINT}`);for(const o of Object.keys(e)){if(!hasKey(COMPONENT_SETTING_KEYS,o))throw new Error(`unknown component ${o} in theme settings; allowed: ${Object.keys(COMPONENT_SETTING_KEYS).join(", ")}. ${HINT}`);const t=e[o];if(void 0===t)continue;if(!isPlainObject(t))throw new Error(`theme settings for ${o} is an object; got ${typeof t}. ${HINT}`);const n=COMPONENT_SETTING_KEYS[o];for(const e of Object.keys(t))if(!(e in n))throw new Error(`unknown setting ${e} for ${o}; allowed: ${Object.keys(n).join(", ")}. ${HINT}`)}}},TONES=["primary","success","warning","danger","info"],setComponentSettings=(o,e,t)=>{o[e]=t},mergeComponentSettings=(o,e,t)=>({...hasKey(o,t)?o[t]:void 0,...void 0!==e&&hasKey(e,t)?e[t]:void 0});export const mergeBrand=(o,e,t)=>{validateBrand(e),validateSettings(t);const n={};for(const[t,r]of Object.entries(e?.colors?.[o.mode]??{}))void 0!==r&&(n[t]=r);const r={...o.colors,...n},colorOf=o=>{const e=r[o];if(void 0===e)throw new Error(`The theme has no colour ${o}.`);return e},i={...o.radius,...e?.radius},s={...o.font};if(void 0!==e?.font)for(const t of keysOf(e.font))s[t]={...o.font[t],...e.font[t]};const a=[colorOf("bg"),colorOf("bg-subtle"),colorOf("bg-muted")],f={};for(const e of TONES){const t="string"==typeof n[e];let r=colorOf(e);if(t||"string"==typeof n[`on-${e}`]){const o=deriveSolidFill(r,colorOf(`on-${e}`));o!==r&&(f[e]=o,r=o)}if(t&&"string"!=typeof n[`${e}-text`]&&(f[`${e}-text`]=deriveToneInk(r,a,o.mode)),"primary"===e&&(t||void 0!==f.primary)){const e=deriveStateFills(r,colorOf("on-primary"),{fill:o.colors.primary,hover:o.colors["primary-hover"],pressed:o.colors["primary-pressed"]});"string"!=typeof n["primary-hover"]&&(f["primary-hover"]=e.hover),"string"!=typeof n["primary-pressed"]&&(f["primary-pressed"]=e.pressed)}}const l=o.settings.components,d=t?.components,c={},u=new Set([...keysOf(l),...void 0===d?[]:keysOf(d)]);for(const o of u)setComponentSettings(c,o,mergeComponentSettings(l,d,o));const p=t?.maxFontSizeMultiplier??o.settings.maxFontSizeMultiplier,m={icons:{...o.settings.icons,...t?.icons},gradients:{...o.settings.gradients,...t?.gradients},textVariants:{...o.settings.textVariants,...t?.textVariants},components:c,...void 0===p?{}:{maxFontSizeMultiplier:p}},w={...o.colors};for(const o of COLOR_NAMES)w[o]=f[o]??r[o];const O={...o,colors:w,radius:i,font:s,settings:m};return validateComponentTokens(O),O};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";export const scaleStep=(e,t,s,r)=>{const
|
|
1
|
+
"use strict";import{isRecord}from"../utils/guards.js";export const scaleStep=(e,t,s,r)=>{const o="space"===t?e.space:"radius"===t?e.radius:e.text,c=o[s],i="text"===t?isRecord(c)?c.size:void 0:c;if("number"!=typeof i){const e=Object.keys(o).join(", ");throw new Error(`${r?`${r} is `:""}${JSON.stringify(s)}, which is not a ${"text"===t?"text size":"radius"===t?"corner":"space"} name. Use one of: ${e}.`)}return i};export const spaceOf=(e,t)=>scaleStep(e,"space",t);export const radiusOf=(e,t)=>scaleStep(e,"radius",t);export const textOf=(e,t)=>scaleStep(e,"text",t);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";export function isOneOf(e,r){return e.some(e=>e===r)}export function hasKey(e,r){return Object.hasOwn(e,r)}export function isRecord(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}export function keysOf(e){return Object.keys(e).filter(r=>hasKey(e,r))}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import*as Haptics from"expo-haptics";import{Platform}from"react-native";let hapticImpl=null;const EXPO_HANDLERS={selection:()=>Haptics.selectionAsync(),impactLight:()=>Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light),impactMedium:()=>Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Medium),impactHeavy:()=>Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Heavy),notificationSuccess:()=>Haptics.notificationAsync(Haptics.NotificationFeedbackType.Success),notificationWarning:()=>Haptics.notificationAsync(Haptics.NotificationFeedbackType.Warning),notificationError:()=>Haptics.notificationAsync(Haptics.NotificationFeedbackType.Error),longPress:()=>Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Medium),tick:()=>Haptics.selectionAsync(),denseTick:()=>Haptics.selectionAsync(),confirm:()=>Haptics.notificationAsync(Haptics.NotificationFeedbackType.Success),reject:()=>Haptics.notificationAsync(Haptics.NotificationFeedbackType.Error),gestureStart:()=>Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light)},ANDROID_HAPTICS={longPress:"Long_Press",tick:"Segment_Tick",denseTick:"Segment_Frequent_Tick",confirm:"Confirm",reject:"Reject",gestureStart:"Gesture_Start"},androidHandler=t=>{const c=ANDROID_HAPTICS[t];return"android"===Platform.OS&&c&&"function"==typeof Haptics.performAndroidHapticsAsync&&Haptics.AndroidHaptics?.[c]?()=>Haptics.performAndroidHapticsAsync(Haptics.AndroidHaptics[c]):null};let hapticsEnabled=!0;export const setHapticsEnabled=t=>{hapticsEnabled=t};export const isHapticsEnabled=()=>hapticsEnabled;export const triggerHaptic=(t="selection")=>{if(!hapticsEnabled)return;if(hapticImpl)try{return void hapticImpl(t)}catch{}const c=androidHandler(t)??EXPO_HANDLERS[t];try{c().catch(
|
|
1
|
+
"use strict";import{Logger}from"@webority/mobile-core";import*as Haptics from"expo-haptics";import{Platform}from"react-native";let hapticImpl=null;const EXPO_HANDLERS={selection:()=>Haptics.selectionAsync(),impactLight:()=>Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light),impactMedium:()=>Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Medium),impactHeavy:()=>Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Heavy),notificationSuccess:()=>Haptics.notificationAsync(Haptics.NotificationFeedbackType.Success),notificationWarning:()=>Haptics.notificationAsync(Haptics.NotificationFeedbackType.Warning),notificationError:()=>Haptics.notificationAsync(Haptics.NotificationFeedbackType.Error),longPress:()=>Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Medium),tick:()=>Haptics.selectionAsync(),denseTick:()=>Haptics.selectionAsync(),confirm:()=>Haptics.notificationAsync(Haptics.NotificationFeedbackType.Success),reject:()=>Haptics.notificationAsync(Haptics.NotificationFeedbackType.Error),gestureStart:()=>Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light)},ANDROID_HAPTICS={longPress:"Long_Press",tick:"Segment_Tick",denseTick:"Segment_Frequent_Tick",confirm:"Confirm",reject:"Reject",gestureStart:"Gesture_Start"},androidHandler=t=>{const c=ANDROID_HAPTICS[t];return"android"===Platform.OS&&c&&"function"==typeof Haptics.performAndroidHapticsAsync&&Haptics.AndroidHaptics?.[c]?()=>Haptics.performAndroidHapticsAsync(Haptics.AndroidHaptics[c]):null};let hapticsEnabled=!0;export const setHapticsEnabled=t=>{hapticsEnabled=t};export const isHapticsEnabled=()=>hapticsEnabled;export const triggerHaptic=(t="selection")=>{if(!hapticsEnabled)return;if(hapticImpl)try{return void hapticImpl(t)}catch(t){Logger.recordError(t,{op:"triggerHaptic"})}const c=androidHandler(t)??EXPO_HANDLERS[t];try{c().catch(t=>{Logger.recordError(t,{op:"triggerHaptic"})})}catch(t){Logger.recordError(t,{op:"triggerHaptic"})}};export const setHapticImplementation=t=>{hapticImpl=t};export const resolveHaptic=(t,c)=>!1===t?null:t??c;
|
|
@@ -13,43 +13,43 @@ export declare const PHONE_CHROME_INSETS: {
|
|
|
13
13
|
};
|
|
14
14
|
export interface StatusBarProps {
|
|
15
15
|
os: PhoneChromeOs;
|
|
16
|
-
colorMode?: ColorMode;
|
|
16
|
+
colorMode?: ColorMode | undefined;
|
|
17
17
|
/** The clock as shown, such as 9:41. */
|
|
18
|
-
time?: string;
|
|
18
|
+
time?: string | undefined;
|
|
19
19
|
/** Signal strength in bars, 0 to 4. */
|
|
20
|
-
signal?: number;
|
|
20
|
+
signal?: number | undefined;
|
|
21
21
|
/** Battery level in percent, 0 to 100. */
|
|
22
|
-
battery?: number;
|
|
22
|
+
battery?: number | undefined;
|
|
23
23
|
}
|
|
24
24
|
export declare const StatusBar: ({ os, colorMode, time, signal, battery }: StatusBarProps) => import("react").FunctionComponentElement<Omit<import("react-native").ViewProps, "ref"> & {
|
|
25
25
|
ref?: React.Ref<import("react-native").ViewInstance> | undefined;
|
|
26
26
|
}>;
|
|
27
27
|
export interface HomeIndicatorProps {
|
|
28
28
|
os: PhoneChromeOs;
|
|
29
|
-
colorMode?: ColorMode;
|
|
29
|
+
colorMode?: ColorMode | undefined;
|
|
30
30
|
}
|
|
31
31
|
export declare const HomeIndicator: ({ os, colorMode }: HomeIndicatorProps) => import("react").FunctionComponentElement<Omit<import("react-native").ViewProps, "ref"> & {
|
|
32
32
|
ref?: React.Ref<import("react-native").ViewInstance> | undefined;
|
|
33
33
|
}>;
|
|
34
34
|
export interface NavigationBarProps {
|
|
35
35
|
os: PhoneChromeOs;
|
|
36
|
-
colorMode?: ColorMode;
|
|
36
|
+
colorMode?: ColorMode | undefined;
|
|
37
37
|
}
|
|
38
38
|
export declare const NavigationBar: ({ os, colorMode }: NavigationBarProps) => import("react").FunctionComponentElement<Omit<import("react-native").ViewProps, "ref"> & {
|
|
39
39
|
ref?: React.Ref<import("react-native").ViewInstance> | undefined;
|
|
40
40
|
}> | null;
|
|
41
41
|
export interface SafeAreaProps {
|
|
42
42
|
os: PhoneChromeOs;
|
|
43
|
-
children?: ReactNode;
|
|
43
|
+
children?: ReactNode | undefined;
|
|
44
44
|
}
|
|
45
45
|
export declare const SafeArea: ({ os, children }: SafeAreaProps) => import("react").FunctionComponentElement<Omit<import("react-native").ViewProps, "ref"> & {
|
|
46
46
|
ref?: React.Ref<import("react-native").ViewInstance> | undefined;
|
|
47
47
|
}>;
|
|
48
48
|
export type KeyboardPreviewOs = "ios" | "android";
|
|
49
49
|
export interface KeyboardFrameProps {
|
|
50
|
-
colorMode?: ColorMode;
|
|
51
|
-
previewOs?: KeyboardPreviewOs;
|
|
52
|
-
children?: ReactNode;
|
|
50
|
+
colorMode?: ColorMode | undefined;
|
|
51
|
+
previewOs?: KeyboardPreviewOs | undefined;
|
|
52
|
+
children?: ReactNode | undefined;
|
|
53
53
|
}
|
|
54
54
|
export declare const KeyboardFrame: ({ colorMode, previewOs, children }: KeyboardFrameProps) => import("react").FunctionComponentElement<Omit<import("react-native").ViewProps, "ref"> & {
|
|
55
55
|
ref?: React.Ref<import("react-native").ViewInstance> | undefined;
|
|
@@ -57,9 +57,9 @@ export declare const KeyboardFrame: ({ colorMode, previewOs, children }: Keyboar
|
|
|
57
57
|
export interface PhoneChromeManifestProp {
|
|
58
58
|
name: string;
|
|
59
59
|
type: "enum" | "string" | "number";
|
|
60
|
-
enum?: string[];
|
|
60
|
+
enum?: string[] | undefined;
|
|
61
61
|
required: boolean;
|
|
62
|
-
description?: string;
|
|
62
|
+
description?: string | undefined;
|
|
63
63
|
}
|
|
64
64
|
export interface PhoneChromeManifestComponent {
|
|
65
65
|
name: string;
|
|
@@ -10,7 +10,7 @@ export type KitPropKey<P> = {
|
|
|
10
10
|
type Literal<T> = [NonNullable<T>] extends [string] ? string extends NonNullable<T> ? never : NonNullable<T> : [NonNullable<T>] extends [number] ? number extends NonNullable<T> ? never : NonNullable<T> : never;
|
|
11
11
|
type IsIconName<T> = [NonNullable<T>] extends [AppIconName] ? ([AppIconName] extends [NonNullable<T>] ? true : false) : false;
|
|
12
12
|
type PropFor<T, Optional extends boolean> = MetaProp & (Optional extends true ? {
|
|
13
|
-
required?: false;
|
|
13
|
+
required?: false | undefined;
|
|
14
14
|
} : {
|
|
15
15
|
required: true;
|
|
16
16
|
}) & (IsIconName<T> extends true ? {
|
|
@@ -30,20 +30,18 @@ type ObjectKey<P> = {
|
|
|
30
30
|
}[KitPropKey<P>];
|
|
31
31
|
export interface PhoneMeta<P, O extends KitPropKey<P>, F extends KitPropKey<P> = never> extends Omit<ComponentMeta, "props" | "examples" | "omit" | "component" | "fixedProps" | "actions" | "takesAction" | "itemsTakeAction"> {
|
|
32
32
|
/** The export this description draws, when it is not `name`: one export described once per mode. */
|
|
33
|
-
component?: string;
|
|
33
|
+
component?: string | undefined;
|
|
34
34
|
/** Props the kit sets on every placement; they are neither shown nor set by an example. */
|
|
35
35
|
fixedProps?: {
|
|
36
36
|
readonly [K in F]: ExampleValue<P[K]>;
|
|
37
|
-
};
|
|
37
|
+
} | undefined;
|
|
38
38
|
props: {
|
|
39
39
|
[K in Exclude<KitPropKey<P>, O | F>]: PropFor<P[K], Partial<Pick<P, K>> extends Pick<P, K> ? true : false>;
|
|
40
40
|
};
|
|
41
|
-
/** The part's role in the manifest. */
|
|
42
|
-
role?: "title" | "navigation";
|
|
43
41
|
/** Object props that each carry one action; in play a tap on one runs the stored action. */
|
|
44
|
-
takesAction?: readonly ObjectKey<P>[];
|
|
42
|
+
takesAction?: readonly ObjectKey<P>[] | undefined;
|
|
45
43
|
/** Array props whose items each carry an action. */
|
|
46
|
-
itemsTakeAction?: readonly ListKey<P>[];
|
|
44
|
+
itemsTakeAction?: readonly ListKey<P>[] | undefined;
|
|
47
45
|
/** Kit props deliberately not shown, such as object or render props no kit type fits. */
|
|
48
46
|
omit: readonly O[];
|
|
49
47
|
examples: readonly (Omit<MetaExample, "id" | "props"> & {
|
|
@@ -5,40 +5,40 @@ export type AccordionVariant = "plain" | "card";
|
|
|
5
5
|
export interface AccordionProps {
|
|
6
6
|
title: string;
|
|
7
7
|
children: React.ReactNode;
|
|
8
|
-
id?: string;
|
|
9
|
-
expanded?: boolean;
|
|
10
|
-
defaultExpanded?: boolean;
|
|
11
|
-
onChange?: (expanded: boolean) => void;
|
|
12
|
-
icon?: React.ReactNode;
|
|
13
|
-
disabled?: boolean;
|
|
14
|
-
variant?: AccordionVariant;
|
|
15
|
-
accessibilityLabel?: string;
|
|
8
|
+
id?: string | undefined;
|
|
9
|
+
expanded?: boolean | undefined;
|
|
10
|
+
defaultExpanded?: boolean | undefined;
|
|
11
|
+
onChange?: ((expanded: boolean) => void) | undefined;
|
|
12
|
+
icon?: React.ReactNode | undefined;
|
|
13
|
+
disabled?: boolean | undefined;
|
|
14
|
+
variant?: AccordionVariant | undefined;
|
|
15
|
+
accessibilityLabel?: string | undefined;
|
|
16
16
|
/** The outer box. Applied last on that node, so it wins over containerStyle. */
|
|
17
|
-
style?: StyleProp<ViewStyle
|
|
18
|
-
headerStyle?: StyleProp<ViewStyle
|
|
19
|
-
contentStyle?: StyleProp<ViewStyle
|
|
17
|
+
style?: StyleProp<ViewStyle> | undefined;
|
|
18
|
+
headerStyle?: StyleProp<ViewStyle> | undefined;
|
|
19
|
+
contentStyle?: StyleProp<ViewStyle> | undefined;
|
|
20
20
|
/** Style applied to the animated wrapper around the expandable content. */
|
|
21
|
-
contentWrapperStyle?: StyleProp<ViewStyle
|
|
21
|
+
contentWrapperStyle?: StyleProp<ViewStyle> | undefined;
|
|
22
22
|
/** Alias of style, applied before it on the same node. Use style. */
|
|
23
|
-
containerStyle?: StyleProp<ViewStyle
|
|
24
|
-
testID?: string;
|
|
23
|
+
containerStyle?: StyleProp<ViewStyle> | undefined;
|
|
24
|
+
testID?: string | undefined;
|
|
25
25
|
/**
|
|
26
26
|
* When true, renders the accordion as its authored skeleton placeholder
|
|
27
27
|
* shape (header row, collapsed body). Footprint matches the closed live
|
|
28
28
|
* accordion so the layout doesn't shift when data arrives.
|
|
29
29
|
*/
|
|
30
|
-
loading?: boolean;
|
|
30
|
+
loading?: boolean | undefined;
|
|
31
31
|
/** Haptic feedback for interactions. Pass false to disable; pass a HapticType to override the default. */
|
|
32
|
-
haptic?: HapticType | false;
|
|
32
|
+
haptic?: HapticType | false | undefined;
|
|
33
33
|
}
|
|
34
34
|
export interface AccordionGroupProps {
|
|
35
35
|
children: React.ReactNode;
|
|
36
|
-
allowMultiple?: boolean;
|
|
37
|
-
defaultExpandedKeys?: string[];
|
|
38
|
-
expandedKeys?: string[];
|
|
39
|
-
onChange?: (keys: string[]) => void;
|
|
40
|
-
style?: StyleProp<ViewStyle
|
|
41
|
-
testID?: string;
|
|
36
|
+
allowMultiple?: boolean | undefined;
|
|
37
|
+
defaultExpandedKeys?: string[] | undefined;
|
|
38
|
+
expandedKeys?: string[] | undefined;
|
|
39
|
+
onChange?: ((keys: string[]) => void) | undefined;
|
|
40
|
+
style?: StyleProp<ViewStyle> | undefined;
|
|
41
|
+
testID?: string | undefined;
|
|
42
42
|
}
|
|
43
43
|
declare const AccordionGroup: React.FC<AccordionGroupProps>;
|
|
44
44
|
declare const Accordion: React.FC<AccordionProps> & {
|
|
@@ -13,47 +13,47 @@ export interface AmountSliderLabels {
|
|
|
13
13
|
}
|
|
14
14
|
export declare const DEFAULT_AMOUNT_SLIDER_LABELS: Readonly<AmountSliderLabels>;
|
|
15
15
|
export interface AmountSliderProps {
|
|
16
|
-
value?: number;
|
|
17
|
-
defaultValue?: number;
|
|
18
|
-
onChange?: (value: number) => void;
|
|
19
|
-
min?: number;
|
|
20
|
-
max?: number;
|
|
21
|
-
step?: number;
|
|
22
|
-
disabled?: boolean;
|
|
23
|
-
tone?: SliderTone;
|
|
24
|
-
size?: SliderSize;
|
|
16
|
+
value?: number | undefined;
|
|
17
|
+
defaultValue?: number | undefined;
|
|
18
|
+
onChange?: ((value: number) => void) | undefined;
|
|
19
|
+
min?: number | undefined;
|
|
20
|
+
max?: number | undefined;
|
|
21
|
+
step?: number | undefined;
|
|
22
|
+
disabled?: boolean | undefined;
|
|
23
|
+
tone?: SliderTone | undefined;
|
|
24
|
+
size?: SliderSize | undefined;
|
|
25
25
|
/** The slider's look. Default `'inset'`, the design this component comes from. */
|
|
26
|
-
variant?: SliderVariant;
|
|
26
|
+
variant?: SliderVariant | undefined;
|
|
27
27
|
/**
|
|
28
28
|
* Whether the large amount reads in Thousand, Lakh and Crore or in Thousand,
|
|
29
29
|
* Million and Billion. Default: the grouping of the configured locale.
|
|
30
30
|
*/
|
|
31
|
-
units?: ScaleUnits;
|
|
31
|
+
units?: ScaleUnits | undefined;
|
|
32
32
|
/** ISO 4217 code of the amount; the symbol drawn before it comes from this. */
|
|
33
33
|
currency: string;
|
|
34
34
|
/** Unit words and the input box's label. Omitted keys keep the English defaults. */
|
|
35
|
-
labels?: Partial<AmountSliderLabels
|
|
35
|
+
labels?: Partial<AmountSliderLabels> | undefined;
|
|
36
36
|
/**
|
|
37
37
|
* Text of the input box when it is not being edited. Default: the currency
|
|
38
38
|
* with no decimals.
|
|
39
39
|
*/
|
|
40
|
-
formatInput?: (value: number) => string;
|
|
40
|
+
formatInput?: ((value: number) => string) | undefined;
|
|
41
41
|
/**
|
|
42
42
|
* Duration in ms of one digit roll. Default `theme.motion.duration.default`,
|
|
43
43
|
* which the ThemeProvider collapses to 0 when the OS asks for reduced
|
|
44
44
|
* motion.
|
|
45
45
|
*/
|
|
46
|
-
animationDuration?: number;
|
|
47
|
-
haptic?: HapticType | false;
|
|
46
|
+
animationDuration?: number | undefined;
|
|
47
|
+
haptic?: HapticType | false | undefined;
|
|
48
48
|
/** Read out for the slider. The input box reads `labels.inputLabel`. */
|
|
49
|
-
accessibilityLabel?: string;
|
|
50
|
-
style?: StyleProp<ViewStyle
|
|
51
|
-
headerStyle?: StyleProp<ViewStyle
|
|
52
|
-
valueStyle?: StyleProp<TextStyle
|
|
53
|
-
unitStyle?: StyleProp<TextStyle
|
|
54
|
-
inputStyle?: StyleProp<ViewStyle
|
|
55
|
-
sliderStyle?: StyleProp<ViewStyle
|
|
56
|
-
testID?: string;
|
|
49
|
+
accessibilityLabel?: string | undefined;
|
|
50
|
+
style?: StyleProp<ViewStyle> | undefined;
|
|
51
|
+
headerStyle?: StyleProp<ViewStyle> | undefined;
|
|
52
|
+
valueStyle?: StyleProp<TextStyle> | undefined;
|
|
53
|
+
unitStyle?: StyleProp<TextStyle> | undefined;
|
|
54
|
+
inputStyle?: StyleProp<ViewStyle> | undefined;
|
|
55
|
+
sliderStyle?: StyleProp<ViewStyle> | undefined;
|
|
56
|
+
testID?: string | undefined;
|
|
57
57
|
}
|
|
58
58
|
interface Scaled {
|
|
59
59
|
amount: number;
|