@webority/mobile-ui 0.165.0 → 0.167.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 +10 -10
- package/dist/canvas-kit/manifest.json +22 -13
- package/dist/canvas-kit/release.json +6 -6
- package/lib/commonjs/components/Accordion/Accordion.js +1 -1
- package/lib/commonjs/components/AmountSlider/AmountSlider.js +1 -1
- package/lib/commonjs/components/AmountSlider/index.js +1 -1
- package/lib/commonjs/components/AppBar/AppBar.js +1 -1
- package/lib/commonjs/components/AppBar/index.js +1 -1
- package/lib/commonjs/components/AppLockOverlay/AppLockOverlay.js +1 -1
- package/lib/commonjs/components/AppLockOverlay/index.js +1 -1
- package/lib/commonjs/components/AsyncBlock/AsyncBlock.js +1 -1
- package/lib/commonjs/components/AsyncBlock/index.js +1 -1
- package/lib/commonjs/components/AuthedImage/AuthedImage.js +1 -1
- package/lib/commonjs/components/Autocomplete/Autocomplete.js +1 -1
- package/lib/commonjs/components/Autocomplete/index.js +1 -1
- package/lib/commonjs/components/Avatar/Avatar.js +1 -1
- package/lib/commonjs/components/Avatar/index.js +1 -1
- package/lib/commonjs/components/Badge/Badge.js +1 -1
- package/lib/commonjs/components/Badge/index.js +1 -1
- package/lib/commonjs/components/Banner/Banner.js +1 -1
- package/lib/commonjs/components/Banner/index.js +1 -1
- package/lib/commonjs/components/BarChart/BarChart.js +1 -1
- package/lib/commonjs/components/BarChart/index.js +1 -1
- package/lib/commonjs/components/BottomNavigation/BottomNavigation.js +1 -1
- package/lib/commonjs/components/BottomNavigation/index.js +1 -1
- package/lib/commonjs/components/BottomSheet/BottomSheet.js +1 -1
- package/lib/commonjs/components/BottomSheet/index.js +1 -1
- package/lib/commonjs/components/Button/Button.js +1 -1
- package/lib/commonjs/components/Calendar/Calendar.js +1 -1
- package/lib/commonjs/components/Calendar/index.js +1 -1
- package/lib/commonjs/components/Card/Card.js +1 -1
- package/lib/commonjs/components/Card/index.js +1 -1
- package/lib/commonjs/components/Carousel/Carousel.js +1 -1
- package/lib/commonjs/components/Carousel/index.js +1 -1
- package/lib/commonjs/components/Checkbox/Checkbox.js +1 -1
- package/lib/commonjs/components/Chip/Chip.js +1 -1
- package/lib/commonjs/components/Chip/index.js +1 -1
- package/lib/commonjs/components/Composer/Composer.js +1 -1
- package/lib/commonjs/components/Composer/index.js +1 -1
- package/lib/commonjs/components/Confirm/confirm.js +1 -1
- package/lib/commonjs/components/DatePicker/DatePicker.js +1 -1
- package/lib/commonjs/components/DatePicker/index.js +1 -1
- package/lib/commonjs/components/DateRangePicker/DateRangePicker.js +1 -1
- package/lib/commonjs/components/DateRangePicker/index.js +1 -1
- package/lib/commonjs/components/DateSeparator/DateSeparator.js +1 -1
- package/lib/commonjs/components/DateSeparator/index.js +1 -1
- package/lib/commonjs/components/DecimalInput/DecimalInput.js +1 -1
- package/lib/commonjs/components/DecimalInput/index.js +1 -1
- package/lib/commonjs/components/Dialog/Dialog.js +1 -1
- package/lib/commonjs/components/Drawer/Drawer.js +1 -1
- package/lib/commonjs/components/Drawer/index.js +1 -1
- package/lib/commonjs/components/ErrorBoundary/ErrorBoundary.js +1 -1
- package/lib/commonjs/components/ErrorBoundary/index.js +1 -1
- package/lib/commonjs/components/FieldBase/FieldBase.js +1 -1
- package/lib/commonjs/components/FilePicker/FilePicker.js +1 -1
- package/lib/commonjs/components/FilePicker/index.js +1 -1
- package/lib/commonjs/components/FloatingActionButton/FloatingActionButton.js +1 -1
- package/lib/commonjs/components/FloatingActionButton/index.js +1 -1
- package/lib/commonjs/components/ForceUpdateDialog/ForceUpdateDialog.js +1 -1
- package/lib/commonjs/components/ForceUpdateDialog/index.js +1 -1
- package/lib/commonjs/components/FormField/FormField.js +1 -1
- package/lib/commonjs/components/FormField/index.js +1 -1
- package/lib/commonjs/components/ImageGallery/ImageGallery.js +1 -1
- package/lib/commonjs/components/ImageGallery/index.js +1 -1
- package/lib/commonjs/components/InlineSelect/InlineSelect.js +1 -1
- package/lib/commonjs/components/InlineSelect/index.js +1 -1
- package/lib/commonjs/components/Input/Input.js +1 -1
- package/lib/commonjs/components/Input/index.js +1 -1
- package/lib/commonjs/components/KeyboardToolbar/KeyboardToolbar.js +1 -1
- package/lib/commonjs/components/KeyboardToolbar/index.js +1 -1
- package/lib/commonjs/components/ListItem/ListItem.js +1 -1
- package/lib/commonjs/components/LoaderOverlay/LoaderOverlay.js +1 -1
- package/lib/commonjs/components/LoaderOverlay/index.js +1 -1
- package/lib/commonjs/components/Menu/Menu.js +1 -1
- package/lib/commonjs/components/Menu/index.js +1 -1
- package/lib/commonjs/components/Menu/menuModel.js +1 -1
- package/lib/commonjs/components/Menu/useContextMenu.js +1 -1
- package/lib/commonjs/components/MessageBubble/MessageBubble.js +1 -1
- package/lib/commonjs/components/MessageBubble/index.js +1 -1
- package/lib/commonjs/components/MessageList/MessageList.js +1 -1
- package/lib/commonjs/components/MessageList/index.js +1 -1
- package/lib/commonjs/components/Modal/Modal.js +1 -1
- package/lib/commonjs/components/Modal/index.js +1 -1
- package/lib/commonjs/components/NonModalBottomSheet/NonModalBottomSheet.js +1 -1
- package/lib/commonjs/components/NonModalBottomSheet/index.js +1 -1
- package/lib/commonjs/components/NumberInput/NumberInput.js +1 -1
- package/lib/commonjs/components/NumberInput/index.js +1 -1
- package/lib/commonjs/components/OTPInput/OTPInput.js +1 -1
- package/lib/commonjs/components/OTPInput/OTPResendRow.js +1 -1
- package/lib/commonjs/components/OTPInput/index.js +1 -1
- package/lib/commonjs/components/OnboardingPager/OnboardingPager.js +1 -1
- package/lib/commonjs/components/OnboardingPager/index.js +1 -1
- package/lib/commonjs/components/OptionSheet/OptionSheet.js +1 -1
- package/lib/commonjs/components/OptionSheet/index.js +1 -1
- package/lib/commonjs/components/PagedListFooter/PagedListFooter.js +1 -1
- package/lib/commonjs/components/PagedListFooter/index.js +1 -1
- package/lib/commonjs/components/PermissionPrompt/PermissionPrompt.js +1 -1
- package/lib/commonjs/components/PermissionPrompt/index.js +1 -1
- package/lib/commonjs/components/PhoneNumberInput/PhoneNumberInput.js +1 -1
- package/lib/commonjs/components/PhoneNumberInput/index.js +1 -1
- package/lib/commonjs/components/PickerTrigger/PickerTrigger.js +1 -1
- package/lib/commonjs/components/PickerTrigger/index.js +1 -1
- package/lib/commonjs/components/ProfileCompletion/ProfileCompletion.js +1 -1
- package/lib/commonjs/components/ProfileCompletion/index.js +1 -1
- package/lib/commonjs/components/ProfilePicker/ProfilePicker.js +1 -1
- package/lib/commonjs/components/ProfilePicker/index.js +1 -1
- package/lib/commonjs/components/ProgressBar/ProgressBar.js +1 -1
- package/lib/commonjs/components/ProgressBar/index.js +1 -1
- package/lib/commonjs/components/Radio/Radio.js +1 -1
- package/lib/commonjs/components/Rating/Rating.js +1 -1
- package/lib/commonjs/components/Rating/index.js +1 -1
- package/lib/commonjs/components/Repeater/Repeater.js +1 -1
- package/lib/commonjs/components/Repeater/index.js +1 -1
- package/lib/commonjs/components/RichTextEditor/RichTextEditor.js +1 -1
- package/lib/commonjs/components/RichTextEditor/index.js +1 -1
- package/lib/commonjs/components/RichTextEditor/markdownActions.js +1 -1
- package/lib/commonjs/components/ScannerOverlay/ScannerOverlay.js +1 -1
- package/lib/commonjs/components/ScannerOverlay/index.js +1 -1
- package/lib/commonjs/components/Screen/Screen.js +1 -1
- package/lib/commonjs/components/SearchBar/SearchBar.js +1 -1
- package/lib/commonjs/components/SearchBar/SearchPanel.js +1 -1
- package/lib/commonjs/components/SearchBar/index.js +1 -1
- package/lib/commonjs/components/SectionHeader/SectionHeader.js +1 -1
- package/lib/commonjs/components/SectionHeader/index.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/Select/index.js +1 -1
- package/lib/commonjs/components/SignaturePad/SignaturePad.js +1 -1
- package/lib/commonjs/components/SignaturePad/index.js +1 -1
- package/lib/commonjs/components/Skeleton/Skeleton.js +1 -1
- package/lib/commonjs/components/Skeleton/SkeletonContent.js +1 -1
- package/lib/commonjs/components/Skeleton/index.js +1 -1
- package/lib/commonjs/components/SlideToConfirm/SlideToConfirm.js +1 -1
- package/lib/commonjs/components/SlideToConfirm/index.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/SliderField/index.js +1 -1
- package/lib/commonjs/components/SortableList/SortableList.js +1 -1
- package/lib/commonjs/components/SortableList/index.js +1 -1
- package/lib/commonjs/components/Sparkline/Sparkline.js +1 -1
- package/lib/commonjs/components/Sparkline/index.js +1 -1
- package/lib/commonjs/components/Spinner/Spinner.js +1 -1
- package/lib/commonjs/components/Spinner/index.js +1 -1
- package/lib/commonjs/components/Stepper/Stepper.js +1 -1
- package/lib/commonjs/components/Stepper/index.js +1 -1
- package/lib/commonjs/components/Swipeable/Swipeable.js +1 -1
- package/lib/commonjs/components/Switch/Switch.js +1 -1
- package/lib/commonjs/components/TimePicker/TimePicker.js +1 -1
- package/lib/commonjs/components/TimePicker/index.js +1 -1
- package/lib/commonjs/components/Toast/Toast.js +1 -1
- package/lib/commonjs/components/Toast/ToastProvider.js +1 -1
- package/lib/commonjs/components/Toast/index.js +1 -1
- package/lib/commonjs/components/Tooltip/Tooltip.js +1 -1
- package/lib/commonjs/components/Tooltip/index.js +1 -1
- package/lib/commonjs/components/Tour/Tour.js +1 -1
- package/lib/commonjs/components/Tour/index.js +1 -1
- package/lib/commonjs/components/TypingIndicator/TypingIndicator.js +1 -1
- package/lib/commonjs/components/TypingIndicator/index.js +1 -1
- package/lib/commonjs/components/WheelPicker/Wheel.js +1 -1
- package/lib/commonjs/components/WheelPicker/WheelPicker.js +1 -1
- package/lib/commonjs/components/WheelPicker/index.js +1 -1
- package/lib/commonjs/components/index.js +1 -1
- package/lib/commonjs/form/HookFormField.js +1 -1
- package/lib/commonjs/hooks/useRefreshControl.js +1 -1
- package/lib/commonjs/index.js +1 -1
- package/lib/commonjs/navigation/DiscardGuard.js +1 -1
- package/lib/commonjs/navigation/index.js +1 -1
- package/lib/commonjs/network/NetworkStatusBanner.js +1 -1
- package/lib/commonjs/text/index.js +1 -0
- package/lib/commonjs/text/phone/amountSlider.g.js +1 -0
- package/lib/commonjs/text/phone/asyncBlock.g.js +1 -0
- package/lib/commonjs/text/phone/authedImage.g.js +1 -0
- package/lib/commonjs/text/phone/autocomplete.g.js +1 -0
- package/lib/commonjs/text/phone/avatar.g.js +1 -0
- package/lib/commonjs/text/phone/badge.g.js +1 -0
- package/lib/commonjs/text/phone/banner.g.js +1 -0
- package/lib/commonjs/text/phone/bar.g.js +1 -0
- package/lib/commonjs/text/phone/barChart.g.js +1 -0
- package/lib/commonjs/text/phone/bottomNavigation.g.js +1 -0
- package/lib/commonjs/text/phone/bottomSheet.g.js +1 -0
- package/lib/commonjs/text/phone/button.g.js +1 -0
- package/lib/commonjs/text/phone/calendar.g.js +1 -0
- package/lib/commonjs/text/phone/card.g.js +1 -0
- package/lib/commonjs/text/phone/carousel.g.js +1 -0
- package/lib/commonjs/text/phone/catalogue.g.js +1 -0
- package/lib/commonjs/text/phone/chip.g.js +1 -0
- package/lib/commonjs/text/phone/composer.g.js +1 -0
- package/lib/commonjs/text/phone/confirm.g.js +1 -0
- package/lib/commonjs/text/phone/datePicker.g.js +1 -0
- package/lib/commonjs/text/phone/dateRangePicker.g.js +1 -0
- package/lib/commonjs/text/phone/dateSeparator.g.js +1 -0
- package/lib/commonjs/text/phone/decimalInput.g.js +1 -0
- package/lib/commonjs/text/phone/discardGuard.g.js +1 -0
- package/lib/commonjs/text/phone/drawer.g.js +1 -0
- package/lib/commonjs/text/phone/errorBoundary.g.js +1 -0
- package/lib/commonjs/text/phone/filePicker.g.js +1 -0
- package/lib/commonjs/text/phone/floatingActionButton.g.js +1 -0
- package/lib/commonjs/text/phone/forceUpdateDialog.g.js +1 -0
- package/lib/commonjs/text/phone/formField.g.js +1 -0
- package/lib/commonjs/text/phone/imageGallery.g.js +1 -0
- package/lib/commonjs/text/phone/index.g.js +1 -0
- package/lib/commonjs/text/phone/inlineSelect.g.js +1 -0
- package/lib/commonjs/text/phone/input.g.js +1 -0
- package/lib/commonjs/text/phone/keyboardToolbar.g.js +1 -0
- package/lib/commonjs/text/phone/loaderOverlay.g.js +1 -0
- package/lib/commonjs/text/phone/lockOverlay.g.js +1 -0
- package/lib/commonjs/text/phone/menu.g.js +1 -0
- package/lib/commonjs/text/phone/messageBubble.g.js +1 -0
- package/lib/commonjs/text/phone/messageList.g.js +1 -0
- package/lib/commonjs/text/phone/modal.g.js +1 -0
- package/lib/commonjs/text/phone/networkStatusBanner.g.js +1 -0
- package/lib/commonjs/text/phone/nonModalBottomSheet.g.js +1 -0
- package/lib/commonjs/text/phone/numberInput.g.js +1 -0
- package/lib/commonjs/text/phone/onboardingPager.g.js +1 -0
- package/lib/commonjs/text/phone/optionSheet.g.js +1 -0
- package/lib/commonjs/text/phone/otpInput.g.js +1 -0
- package/lib/commonjs/text/phone/pagedListFooter.g.js +1 -0
- package/lib/commonjs/text/phone/permissionPrompt.g.js +1 -0
- package/lib/commonjs/text/phone/phoneNumberInput.g.js +1 -0
- package/lib/commonjs/text/phone/pickerTrigger.g.js +1 -0
- package/lib/commonjs/text/phone/profileCompletion.g.js +1 -0
- package/lib/commonjs/text/phone/profilePicker.g.js +1 -0
- package/lib/commonjs/text/phone/progressBar.g.js +1 -0
- package/lib/commonjs/text/phone/rating.g.js +1 -0
- package/lib/commonjs/text/phone/refreshControl.g.js +1 -0
- package/lib/commonjs/text/phone/repeater.g.js +1 -0
- package/lib/commonjs/text/phone/richTextEditor.g.js +1 -0
- package/lib/commonjs/text/phone/scannerOverlay.g.js +1 -0
- package/lib/commonjs/text/phone/searchBar.g.js +1 -0
- package/lib/commonjs/text/phone/sectionHeader.g.js +1 -0
- package/lib/commonjs/text/phone/select.g.js +1 -0
- package/lib/commonjs/text/phone/signaturePad.g.js +1 -0
- package/lib/commonjs/text/phone/skeleton.g.js +1 -0
- package/lib/commonjs/text/phone/slideToConfirm.g.js +1 -0
- package/lib/commonjs/text/phone/slider.g.js +1 -0
- package/lib/commonjs/text/phone/sliderField.g.js +1 -0
- package/lib/commonjs/text/phone/sortableList.g.js +1 -0
- package/lib/commonjs/text/phone/sparkline.g.js +1 -0
- package/lib/commonjs/text/phone/spinner.g.js +1 -0
- package/lib/commonjs/text/phone/stepper.g.js +1 -0
- package/lib/commonjs/text/phone/timePicker.g.js +1 -0
- package/lib/commonjs/text/phone/toast.g.js +1 -0
- package/lib/commonjs/text/phone/tooltip.g.js +1 -0
- package/lib/commonjs/text/phone/tour.g.js +1 -0
- package/lib/commonjs/text/phone/typingIndicator.g.js +1 -0
- package/lib/commonjs/text/phone/wheelPicker.g.js +1 -0
- package/lib/commonjs/text/textStore.js +1 -0
- package/lib/commonjs/theme/tokens.generated.js +1 -1
- package/lib/module/components/Accordion/Accordion.js +1 -1
- package/lib/module/components/AmountSlider/AmountSlider.js +1 -1
- package/lib/module/components/AmountSlider/index.js +1 -1
- package/lib/module/components/AppBar/AppBar.js +1 -1
- package/lib/module/components/AppBar/index.js +1 -1
- package/lib/module/components/AppLockOverlay/AppLockOverlay.js +1 -1
- package/lib/module/components/AppLockOverlay/index.js +1 -1
- package/lib/module/components/AsyncBlock/AsyncBlock.js +1 -1
- package/lib/module/components/AsyncBlock/index.js +1 -1
- package/lib/module/components/AuthedImage/AuthedImage.js +1 -1
- package/lib/module/components/Autocomplete/Autocomplete.js +1 -1
- package/lib/module/components/Autocomplete/index.js +1 -1
- package/lib/module/components/Avatar/Avatar.js +1 -1
- package/lib/module/components/Avatar/index.js +1 -1
- package/lib/module/components/Badge/Badge.js +1 -1
- package/lib/module/components/Badge/index.js +1 -1
- package/lib/module/components/Banner/Banner.js +1 -1
- package/lib/module/components/Banner/index.js +1 -1
- package/lib/module/components/BarChart/BarChart.js +1 -1
- package/lib/module/components/BarChart/index.js +1 -1
- package/lib/module/components/BottomNavigation/BottomNavigation.js +1 -1
- package/lib/module/components/BottomNavigation/index.js +1 -1
- package/lib/module/components/BottomSheet/BottomSheet.js +1 -1
- package/lib/module/components/BottomSheet/index.js +1 -1
- package/lib/module/components/Button/Button.js +1 -1
- package/lib/module/components/Calendar/Calendar.js +1 -1
- package/lib/module/components/Calendar/index.js +1 -1
- package/lib/module/components/Card/Card.js +1 -1
- package/lib/module/components/Card/index.js +1 -1
- package/lib/module/components/Carousel/Carousel.js +1 -1
- package/lib/module/components/Carousel/index.js +1 -1
- package/lib/module/components/Checkbox/Checkbox.js +1 -1
- package/lib/module/components/Chip/Chip.js +1 -1
- package/lib/module/components/Chip/index.js +1 -1
- package/lib/module/components/Composer/Composer.js +1 -1
- package/lib/module/components/Composer/index.js +1 -1
- package/lib/module/components/Confirm/confirm.js +1 -1
- package/lib/module/components/DatePicker/DatePicker.js +1 -1
- package/lib/module/components/DatePicker/index.js +1 -1
- package/lib/module/components/DateRangePicker/DateRangePicker.js +1 -1
- package/lib/module/components/DateRangePicker/index.js +1 -1
- package/lib/module/components/DateSeparator/DateSeparator.js +1 -1
- package/lib/module/components/DateSeparator/index.js +1 -1
- package/lib/module/components/DecimalInput/DecimalInput.js +1 -1
- package/lib/module/components/DecimalInput/index.js +1 -1
- package/lib/module/components/Dialog/Dialog.js +1 -1
- package/lib/module/components/Drawer/Drawer.js +1 -1
- package/lib/module/components/Drawer/index.js +1 -1
- package/lib/module/components/ErrorBoundary/ErrorBoundary.js +1 -1
- package/lib/module/components/ErrorBoundary/index.js +1 -1
- package/lib/module/components/FieldBase/FieldBase.js +1 -1
- package/lib/module/components/FilePicker/FilePicker.js +1 -1
- package/lib/module/components/FilePicker/index.js +1 -1
- package/lib/module/components/FloatingActionButton/FloatingActionButton.js +1 -1
- package/lib/module/components/FloatingActionButton/index.js +1 -1
- package/lib/module/components/ForceUpdateDialog/ForceUpdateDialog.js +1 -1
- package/lib/module/components/ForceUpdateDialog/index.js +1 -1
- package/lib/module/components/FormField/FormField.js +1 -1
- package/lib/module/components/FormField/index.js +1 -1
- package/lib/module/components/ImageGallery/ImageGallery.js +1 -1
- package/lib/module/components/ImageGallery/index.js +1 -1
- package/lib/module/components/InlineSelect/InlineSelect.js +1 -1
- package/lib/module/components/InlineSelect/index.js +1 -1
- package/lib/module/components/Input/Input.js +1 -1
- package/lib/module/components/Input/index.js +1 -1
- package/lib/module/components/KeyboardToolbar/KeyboardToolbar.js +1 -1
- package/lib/module/components/KeyboardToolbar/index.js +1 -1
- package/lib/module/components/ListItem/ListItem.js +1 -1
- package/lib/module/components/LoaderOverlay/LoaderOverlay.js +1 -1
- package/lib/module/components/LoaderOverlay/index.js +1 -1
- package/lib/module/components/Menu/Menu.js +1 -1
- package/lib/module/components/Menu/index.js +1 -1
- package/lib/module/components/Menu/menuModel.js +1 -1
- package/lib/module/components/Menu/useContextMenu.js +1 -1
- package/lib/module/components/MessageBubble/MessageBubble.js +1 -1
- package/lib/module/components/MessageBubble/index.js +1 -1
- package/lib/module/components/MessageList/MessageList.js +1 -1
- package/lib/module/components/MessageList/index.js +1 -1
- package/lib/module/components/Modal/Modal.js +1 -1
- package/lib/module/components/Modal/index.js +1 -1
- package/lib/module/components/NonModalBottomSheet/NonModalBottomSheet.js +1 -1
- package/lib/module/components/NonModalBottomSheet/index.js +1 -1
- package/lib/module/components/NumberInput/NumberInput.js +1 -1
- package/lib/module/components/NumberInput/index.js +1 -1
- package/lib/module/components/OTPInput/OTPInput.js +1 -1
- package/lib/module/components/OTPInput/OTPResendRow.js +1 -1
- package/lib/module/components/OTPInput/index.js +1 -1
- package/lib/module/components/OnboardingPager/OnboardingPager.js +1 -1
- package/lib/module/components/OnboardingPager/index.js +1 -1
- package/lib/module/components/OptionSheet/OptionSheet.js +1 -1
- package/lib/module/components/OptionSheet/index.js +1 -1
- package/lib/module/components/PagedListFooter/PagedListFooter.js +1 -1
- package/lib/module/components/PagedListFooter/index.js +1 -1
- package/lib/module/components/PermissionPrompt/PermissionPrompt.js +1 -1
- package/lib/module/components/PermissionPrompt/index.js +1 -1
- package/lib/module/components/PhoneNumberInput/PhoneNumberInput.js +1 -1
- package/lib/module/components/PhoneNumberInput/index.js +1 -1
- package/lib/module/components/PickerTrigger/PickerTrigger.js +1 -1
- package/lib/module/components/PickerTrigger/index.js +1 -1
- package/lib/module/components/ProfileCompletion/ProfileCompletion.js +1 -1
- package/lib/module/components/ProfileCompletion/index.js +1 -1
- package/lib/module/components/ProfilePicker/ProfilePicker.js +1 -1
- package/lib/module/components/ProfilePicker/index.js +1 -1
- package/lib/module/components/ProgressBar/ProgressBar.js +1 -1
- package/lib/module/components/ProgressBar/index.js +1 -1
- package/lib/module/components/Radio/Radio.js +1 -1
- package/lib/module/components/Rating/Rating.js +1 -1
- package/lib/module/components/Rating/index.js +1 -1
- package/lib/module/components/Repeater/Repeater.js +1 -1
- package/lib/module/components/Repeater/index.js +1 -1
- package/lib/module/components/RichTextEditor/RichTextEditor.js +1 -1
- package/lib/module/components/RichTextEditor/index.js +1 -1
- package/lib/module/components/RichTextEditor/markdownActions.js +1 -1
- package/lib/module/components/ScannerOverlay/ScannerOverlay.js +1 -1
- package/lib/module/components/ScannerOverlay/index.js +1 -1
- package/lib/module/components/Screen/Screen.js +1 -1
- package/lib/module/components/SearchBar/SearchBar.js +1 -1
- package/lib/module/components/SearchBar/SearchPanel.js +1 -1
- package/lib/module/components/SearchBar/index.js +1 -1
- package/lib/module/components/SectionHeader/SectionHeader.js +1 -1
- package/lib/module/components/SectionHeader/index.js +1 -1
- package/lib/module/components/SegmentedControl/SegmentedControl.js +1 -1
- package/lib/module/components/Select/Select.js +1 -1
- package/lib/module/components/Select/index.js +1 -1
- package/lib/module/components/SignaturePad/SignaturePad.js +1 -1
- package/lib/module/components/SignaturePad/index.js +1 -1
- package/lib/module/components/Skeleton/Skeleton.js +1 -1
- package/lib/module/components/Skeleton/SkeletonContent.js +1 -1
- package/lib/module/components/Skeleton/index.js +1 -1
- package/lib/module/components/SlideToConfirm/SlideToConfirm.js +1 -1
- package/lib/module/components/SlideToConfirm/index.js +1 -1
- package/lib/module/components/Slider/Slider.js +1 -1
- package/lib/module/components/SliderField/SliderField.js +1 -1
- package/lib/module/components/SliderField/index.js +1 -1
- package/lib/module/components/SortableList/SortableList.js +1 -1
- package/lib/module/components/SortableList/index.js +1 -1
- package/lib/module/components/Sparkline/Sparkline.js +1 -1
- package/lib/module/components/Sparkline/index.js +1 -1
- package/lib/module/components/Spinner/Spinner.js +1 -1
- package/lib/module/components/Spinner/index.js +1 -1
- package/lib/module/components/Stepper/Stepper.js +1 -1
- package/lib/module/components/Stepper/index.js +1 -1
- package/lib/module/components/Swipeable/Swipeable.js +1 -1
- package/lib/module/components/Switch/Switch.js +1 -1
- package/lib/module/components/TimePicker/TimePicker.js +1 -1
- package/lib/module/components/TimePicker/index.js +1 -1
- package/lib/module/components/Toast/Toast.js +1 -1
- package/lib/module/components/Toast/ToastProvider.js +1 -1
- package/lib/module/components/Toast/index.js +1 -1
- package/lib/module/components/Tooltip/Tooltip.js +1 -1
- package/lib/module/components/Tooltip/index.js +1 -1
- package/lib/module/components/Tour/Tour.js +1 -1
- package/lib/module/components/Tour/index.js +1 -1
- package/lib/module/components/TypingIndicator/TypingIndicator.js +1 -1
- package/lib/module/components/TypingIndicator/index.js +1 -1
- package/lib/module/components/WheelPicker/Wheel.js +1 -1
- package/lib/module/components/WheelPicker/WheelPicker.js +1 -1
- package/lib/module/components/WheelPicker/index.js +1 -1
- package/lib/module/components/index.js +1 -1
- package/lib/module/form/HookFormField.js +1 -1
- package/lib/module/hooks/useRefreshControl.js +1 -1
- package/lib/module/index.js +1 -1
- package/lib/module/navigation/DiscardGuard.js +1 -1
- package/lib/module/navigation/index.js +1 -1
- package/lib/module/network/NetworkStatusBanner.js +1 -1
- package/lib/module/text/index.js +1 -0
- package/lib/module/text/phone/amountSlider.g.js +1 -0
- package/lib/module/text/phone/asyncBlock.g.js +1 -0
- package/lib/module/text/phone/authedImage.g.js +1 -0
- package/lib/module/text/phone/autocomplete.g.js +1 -0
- package/lib/module/text/phone/avatar.g.js +1 -0
- package/lib/module/text/phone/badge.g.js +1 -0
- package/lib/module/text/phone/banner.g.js +1 -0
- package/lib/module/text/phone/bar.g.js +1 -0
- package/lib/module/text/phone/barChart.g.js +1 -0
- package/lib/module/text/phone/bottomNavigation.g.js +1 -0
- package/lib/module/text/phone/bottomSheet.g.js +1 -0
- package/lib/module/text/phone/button.g.js +1 -0
- package/lib/module/text/phone/calendar.g.js +1 -0
- package/lib/module/text/phone/card.g.js +1 -0
- package/lib/module/text/phone/carousel.g.js +1 -0
- package/lib/module/text/phone/catalogue.g.js +1 -0
- package/lib/module/text/phone/chip.g.js +1 -0
- package/lib/module/text/phone/composer.g.js +1 -0
- package/lib/module/text/phone/confirm.g.js +1 -0
- package/lib/module/text/phone/datePicker.g.js +1 -0
- package/lib/module/text/phone/dateRangePicker.g.js +1 -0
- package/lib/module/text/phone/dateSeparator.g.js +1 -0
- package/lib/module/text/phone/decimalInput.g.js +1 -0
- package/lib/module/text/phone/discardGuard.g.js +1 -0
- package/lib/module/text/phone/drawer.g.js +1 -0
- package/lib/module/text/phone/errorBoundary.g.js +1 -0
- package/lib/module/text/phone/filePicker.g.js +1 -0
- package/lib/module/text/phone/floatingActionButton.g.js +1 -0
- package/lib/module/text/phone/forceUpdateDialog.g.js +1 -0
- package/lib/module/text/phone/formField.g.js +1 -0
- package/lib/module/text/phone/imageGallery.g.js +1 -0
- package/lib/module/text/phone/index.g.js +1 -0
- package/lib/module/text/phone/inlineSelect.g.js +1 -0
- package/lib/module/text/phone/input.g.js +1 -0
- package/lib/module/text/phone/keyboardToolbar.g.js +1 -0
- package/lib/module/text/phone/loaderOverlay.g.js +1 -0
- package/lib/module/text/phone/lockOverlay.g.js +1 -0
- package/lib/module/text/phone/menu.g.js +1 -0
- package/lib/module/text/phone/messageBubble.g.js +1 -0
- package/lib/module/text/phone/messageList.g.js +1 -0
- package/lib/module/text/phone/modal.g.js +1 -0
- package/lib/module/text/phone/networkStatusBanner.g.js +1 -0
- package/lib/module/text/phone/nonModalBottomSheet.g.js +1 -0
- package/lib/module/text/phone/numberInput.g.js +1 -0
- package/lib/module/text/phone/onboardingPager.g.js +1 -0
- package/lib/module/text/phone/optionSheet.g.js +1 -0
- package/lib/module/text/phone/otpInput.g.js +1 -0
- package/lib/module/text/phone/pagedListFooter.g.js +1 -0
- package/lib/module/text/phone/permissionPrompt.g.js +1 -0
- package/lib/module/text/phone/phoneNumberInput.g.js +1 -0
- package/lib/module/text/phone/pickerTrigger.g.js +1 -0
- package/lib/module/text/phone/profileCompletion.g.js +1 -0
- package/lib/module/text/phone/profilePicker.g.js +1 -0
- package/lib/module/text/phone/progressBar.g.js +1 -0
- package/lib/module/text/phone/rating.g.js +1 -0
- package/lib/module/text/phone/refreshControl.g.js +1 -0
- package/lib/module/text/phone/repeater.g.js +1 -0
- package/lib/module/text/phone/richTextEditor.g.js +1 -0
- package/lib/module/text/phone/scannerOverlay.g.js +1 -0
- package/lib/module/text/phone/searchBar.g.js +1 -0
- package/lib/module/text/phone/sectionHeader.g.js +1 -0
- package/lib/module/text/phone/select.g.js +1 -0
- package/lib/module/text/phone/signaturePad.g.js +1 -0
- package/lib/module/text/phone/skeleton.g.js +1 -0
- package/lib/module/text/phone/slideToConfirm.g.js +1 -0
- package/lib/module/text/phone/slider.g.js +1 -0
- package/lib/module/text/phone/sliderField.g.js +1 -0
- package/lib/module/text/phone/sortableList.g.js +1 -0
- package/lib/module/text/phone/sparkline.g.js +1 -0
- package/lib/module/text/phone/spinner.g.js +1 -0
- package/lib/module/text/phone/stepper.g.js +1 -0
- package/lib/module/text/phone/timePicker.g.js +1 -0
- package/lib/module/text/phone/toast.g.js +1 -0
- package/lib/module/text/phone/tooltip.g.js +1 -0
- package/lib/module/text/phone/tour.g.js +1 -0
- package/lib/module/text/phone/typingIndicator.g.js +1 -0
- package/lib/module/text/phone/wheelPicker.g.js +1 -0
- package/lib/module/text/textStore.js +1 -0
- package/lib/module/theme/tokens.generated.js +1 -1
- package/lib/text/en.json +508 -0
- package/lib/typescript/commonjs/components/Accordion/Accordion.d.ts +1 -3
- package/lib/typescript/commonjs/components/AmountSlider/AmountSlider.d.ts +3 -11
- package/lib/typescript/commonjs/components/AmountSlider/index.d.ts +2 -2
- package/lib/typescript/commonjs/components/AppBar/AppBar.d.ts +3 -8
- package/lib/typescript/commonjs/components/AppBar/index.d.ts +2 -2
- package/lib/typescript/commonjs/components/AppLockOverlay/AppLockOverlay.d.ts +2 -10
- package/lib/typescript/commonjs/components/AppLockOverlay/index.d.ts +2 -2
- package/lib/typescript/commonjs/components/AsyncBlock/AsyncBlock.d.ts +2 -8
- package/lib/typescript/commonjs/components/AsyncBlock/index.d.ts +2 -2
- package/lib/typescript/commonjs/components/AuthedImage/AuthedImage.d.ts +2 -7
- package/lib/typescript/commonjs/components/Autocomplete/Autocomplete.d.ts +3 -7
- package/lib/typescript/commonjs/components/Autocomplete/index.d.ts +2 -2
- package/lib/typescript/commonjs/components/Avatar/Avatar.d.ts +3 -13
- package/lib/typescript/commonjs/components/Avatar/index.d.ts +2 -2
- package/lib/typescript/commonjs/components/Badge/Badge.d.ts +2 -6
- package/lib/typescript/commonjs/components/Badge/index.d.ts +2 -2
- package/lib/typescript/commonjs/components/Banner/Banner.d.ts +4 -9
- package/lib/typescript/commonjs/components/Banner/index.d.ts +2 -2
- package/lib/typescript/commonjs/components/BarChart/BarChart.d.ts +2 -7
- package/lib/typescript/commonjs/components/BarChart/index.d.ts +2 -2
- package/lib/typescript/commonjs/components/BottomNavigation/BottomNavigation.d.ts +2 -7
- package/lib/typescript/commonjs/components/BottomNavigation/index.d.ts +2 -2
- package/lib/typescript/commonjs/components/BottomSheet/BottomSheet.d.ts +3 -7
- package/lib/typescript/commonjs/components/BottomSheet/index.d.ts +2 -2
- package/lib/typescript/commonjs/components/Button/Button.d.ts +4 -8
- package/lib/typescript/commonjs/components/Button/index.d.ts +1 -1
- package/lib/typescript/commonjs/components/Calendar/Calendar.d.ts +2 -8
- package/lib/typescript/commonjs/components/Calendar/index.d.ts +2 -2
- package/lib/typescript/commonjs/components/Card/Card.d.ts +4 -12
- package/lib/typescript/commonjs/components/Card/index.d.ts +2 -2
- package/lib/typescript/commonjs/components/Carousel/Carousel.d.ts +3 -8
- package/lib/typescript/commonjs/components/Carousel/index.d.ts +2 -2
- package/lib/typescript/commonjs/components/Checkbox/Checkbox.d.ts +1 -3
- package/lib/typescript/commonjs/components/Chip/Chip.d.ts +3 -8
- package/lib/typescript/commonjs/components/Chip/index.d.ts +2 -2
- package/lib/typescript/commonjs/components/Composer/Composer.d.ts +2 -6
- package/lib/typescript/commonjs/components/Composer/index.d.ts +2 -2
- package/lib/typescript/commonjs/components/Confirm/confirm.d.ts +2 -3
- package/lib/typescript/commonjs/components/DatePicker/DatePicker.d.ts +5 -21
- package/lib/typescript/commonjs/components/DatePicker/index.d.ts +2 -2
- package/lib/typescript/commonjs/components/DateRangePicker/DateRangePicker.d.ts +5 -11
- package/lib/typescript/commonjs/components/DateRangePicker/index.d.ts +2 -2
- package/lib/typescript/commonjs/components/DateSeparator/DateSeparator.d.ts +3 -7
- package/lib/typescript/commonjs/components/DateSeparator/index.d.ts +2 -2
- package/lib/typescript/commonjs/components/DecimalInput/DecimalInput.d.ts +3 -6
- package/lib/typescript/commonjs/components/DecimalInput/index.d.ts +2 -2
- package/lib/typescript/commonjs/components/Dialog/Dialog.d.ts +3 -3
- package/lib/typescript/commonjs/components/Drawer/Drawer.d.ts +3 -7
- package/lib/typescript/commonjs/components/Drawer/index.d.ts +2 -2
- package/lib/typescript/commonjs/components/ErrorBoundary/ErrorBoundary.d.ts +2 -7
- package/lib/typescript/commonjs/components/ErrorBoundary/index.d.ts +2 -2
- package/lib/typescript/commonjs/components/FieldBase/FieldBase.d.ts +4 -3
- package/lib/typescript/commonjs/components/FilePicker/FilePicker.d.ts +2 -29
- package/lib/typescript/commonjs/components/FilePicker/index.d.ts +2 -2
- package/lib/typescript/commonjs/components/FloatingActionButton/FloatingActionButton.d.ts +4 -14
- package/lib/typescript/commonjs/components/FloatingActionButton/index.d.ts +2 -2
- package/lib/typescript/commonjs/components/ForceUpdateDialog/ForceUpdateDialog.d.ts +6 -10
- package/lib/typescript/commonjs/components/ForceUpdateDialog/index.d.ts +2 -2
- package/lib/typescript/commonjs/components/FormField/FormField.d.ts +5 -7
- package/lib/typescript/commonjs/components/FormField/index.d.ts +2 -2
- package/lib/typescript/commonjs/components/ImageGallery/ImageGallery.d.ts +3 -9
- package/lib/typescript/commonjs/components/ImageGallery/index.d.ts +2 -2
- package/lib/typescript/commonjs/components/InlineSelect/InlineSelect.d.ts +2 -8
- package/lib/typescript/commonjs/components/InlineSelect/index.d.ts +2 -2
- package/lib/typescript/commonjs/components/Input/Input.d.ts +5 -10
- package/lib/typescript/commonjs/components/Input/index.d.ts +2 -2
- package/lib/typescript/commonjs/components/KeyboardToolbar/KeyboardToolbar.d.ts +2 -7
- package/lib/typescript/commonjs/components/KeyboardToolbar/index.d.ts +2 -2
- package/lib/typescript/commonjs/components/ListItem/ListItem.d.ts +2 -1
- package/lib/typescript/commonjs/components/LoaderOverlay/LoaderOverlay.d.ts +2 -6
- package/lib/typescript/commonjs/components/LoaderOverlay/index.d.ts +2 -2
- package/lib/typescript/commonjs/components/Menu/Menu.d.ts +3 -2
- package/lib/typescript/commonjs/components/Menu/MenuSurface.d.ts +3 -2
- package/lib/typescript/commonjs/components/Menu/index.d.ts +1 -2
- package/lib/typescript/commonjs/components/Menu/menuModel.d.ts +0 -6
- package/lib/typescript/commonjs/components/Menu/useContextMenu.d.ts +3 -2
- package/lib/typescript/commonjs/components/MessageBubble/MessageBubble.d.ts +2 -13
- package/lib/typescript/commonjs/components/MessageBubble/index.d.ts +2 -2
- package/lib/typescript/commonjs/components/MessageList/MessageList.d.ts +2 -10
- package/lib/typescript/commonjs/components/MessageList/index.d.ts +2 -2
- package/lib/typescript/commonjs/components/Modal/Modal.d.ts +3 -6
- package/lib/typescript/commonjs/components/Modal/index.d.ts +2 -2
- package/lib/typescript/commonjs/components/NonModalBottomSheet/NonModalBottomSheet.d.ts +3 -6
- package/lib/typescript/commonjs/components/NonModalBottomSheet/index.d.ts +2 -2
- package/lib/typescript/commonjs/components/NumberInput/NumberInput.d.ts +3 -10
- package/lib/typescript/commonjs/components/NumberInput/index.d.ts +2 -2
- package/lib/typescript/commonjs/components/OTPInput/OTPInput.d.ts +2 -5
- package/lib/typescript/commonjs/components/OTPInput/OTPResendRow.d.ts +2 -10
- package/lib/typescript/commonjs/components/OTPInput/index.d.ts +4 -4
- package/lib/typescript/commonjs/components/OnboardingPager/OnboardingPager.d.ts +2 -12
- package/lib/typescript/commonjs/components/OnboardingPager/index.d.ts +2 -2
- package/lib/typescript/commonjs/components/OptionSheet/OptionSheet.d.ts +2 -13
- package/lib/typescript/commonjs/components/OptionSheet/index.d.ts +2 -2
- package/lib/typescript/commonjs/components/PagedListFooter/PagedListFooter.d.ts +2 -7
- package/lib/typescript/commonjs/components/PagedListFooter/index.d.ts +2 -2
- package/lib/typescript/commonjs/components/PermissionPrompt/PermissionPrompt.d.ts +2 -12
- package/lib/typescript/commonjs/components/PermissionPrompt/index.d.ts +2 -2
- package/lib/typescript/commonjs/components/PhoneNumberInput/PhoneNumberInput.d.ts +2 -14
- package/lib/typescript/commonjs/components/PhoneNumberInput/index.d.ts +2 -2
- package/lib/typescript/commonjs/components/PickerTrigger/PickerTrigger.d.ts +3 -9
- package/lib/typescript/commonjs/components/PickerTrigger/index.d.ts +2 -2
- package/lib/typescript/commonjs/components/ProfileCompletion/ProfileCompletion.d.ts +2 -6
- package/lib/typescript/commonjs/components/ProfileCompletion/index.d.ts +2 -2
- package/lib/typescript/commonjs/components/ProfilePicker/ProfilePicker.d.ts +2 -12
- package/lib/typescript/commonjs/components/ProfilePicker/index.d.ts +2 -2
- package/lib/typescript/commonjs/components/ProgressBar/ProgressBar.d.ts +3 -8
- package/lib/typescript/commonjs/components/ProgressBar/index.d.ts +2 -2
- package/lib/typescript/commonjs/components/Radio/Radio.d.ts +1 -3
- package/lib/typescript/commonjs/components/Rating/Rating.d.ts +3 -8
- package/lib/typescript/commonjs/components/Rating/index.d.ts +2 -2
- package/lib/typescript/commonjs/components/Repeater/Repeater.d.ts +2 -7
- package/lib/typescript/commonjs/components/Repeater/index.d.ts +1 -1
- package/lib/typescript/commonjs/components/RichTextEditor/RichTextEditor.d.ts +2 -3
- package/lib/typescript/commonjs/components/RichTextEditor/index.d.ts +2 -2
- package/lib/typescript/commonjs/components/ScannerOverlay/ScannerOverlay.d.ts +2 -28
- package/lib/typescript/commonjs/components/ScannerOverlay/index.d.ts +2 -2
- package/lib/typescript/commonjs/components/SearchBar/SearchBar.d.ts +2 -16
- package/lib/typescript/commonjs/components/SearchBar/SearchPanel.d.ts +3 -3
- package/lib/typescript/commonjs/components/SearchBar/index.d.ts +2 -2
- package/lib/typescript/commonjs/components/SectionHeader/SectionHeader.d.ts +3 -5
- package/lib/typescript/commonjs/components/SectionHeader/index.d.ts +2 -2
- package/lib/typescript/commonjs/components/SegmentedControl/SegmentedControl.d.ts +1 -3
- package/lib/typescript/commonjs/components/Select/Select.d.ts +7 -12
- package/lib/typescript/commonjs/components/Select/index.d.ts +1 -1
- package/lib/typescript/commonjs/components/SignaturePad/SignaturePad.d.ts +2 -35
- package/lib/typescript/commonjs/components/SignaturePad/index.d.ts +2 -2
- package/lib/typescript/commonjs/components/Skeleton/Skeleton.d.ts +2 -6
- package/lib/typescript/commonjs/components/Skeleton/SkeletonContent.d.ts +3 -2
- package/lib/typescript/commonjs/components/Skeleton/SkeletonList.d.ts +3 -2
- package/lib/typescript/commonjs/components/Skeleton/index.d.ts +2 -2
- package/lib/typescript/commonjs/components/SlideToConfirm/SlideToConfirm.d.ts +2 -7
- package/lib/typescript/commonjs/components/SlideToConfirm/index.d.ts +2 -2
- package/lib/typescript/commonjs/components/Slider/Slider.d.ts +1 -3
- package/lib/typescript/commonjs/components/SliderField/SliderField.d.ts +2 -11
- package/lib/typescript/commonjs/components/SliderField/index.d.ts +2 -2
- package/lib/typescript/commonjs/components/SortableList/SortableList.d.ts +2 -6
- package/lib/typescript/commonjs/components/SortableList/index.d.ts +2 -2
- package/lib/typescript/commonjs/components/Sparkline/Sparkline.d.ts +2 -6
- package/lib/typescript/commonjs/components/Sparkline/index.d.ts +2 -2
- package/lib/typescript/commonjs/components/Spinner/Spinner.d.ts +2 -5
- package/lib/typescript/commonjs/components/Spinner/index.d.ts +2 -2
- package/lib/typescript/commonjs/components/Stepper/Stepper.d.ts +3 -15
- package/lib/typescript/commonjs/components/Stepper/index.d.ts +2 -2
- package/lib/typescript/commonjs/components/Swipeable/Swipeable.d.ts +1 -1
- package/lib/typescript/commonjs/components/Switch/Switch.d.ts +1 -3
- package/lib/typescript/commonjs/components/TimePicker/TimePicker.d.ts +6 -19
- package/lib/typescript/commonjs/components/TimePicker/index.d.ts +2 -2
- package/lib/typescript/commonjs/components/Toast/Toast.d.ts +2 -7
- package/lib/typescript/commonjs/components/Toast/ToastProvider.d.ts +3 -2
- package/lib/typescript/commonjs/components/Toast/index.d.ts +2 -2
- package/lib/typescript/commonjs/components/Tooltip/Tooltip.d.ts +3 -10
- package/lib/typescript/commonjs/components/Tooltip/index.d.ts +2 -2
- package/lib/typescript/commonjs/components/Tour/Tour.d.ts +2 -9
- package/lib/typescript/commonjs/components/Tour/index.d.ts +2 -2
- package/lib/typescript/commonjs/components/TypingIndicator/TypingIndicator.d.ts +2 -5
- package/lib/typescript/commonjs/components/TypingIndicator/index.d.ts +2 -2
- package/lib/typescript/commonjs/components/WheelPicker/WheelPicker.d.ts +2 -15
- package/lib/typescript/commonjs/components/WheelPicker/index.d.ts +2 -2
- package/lib/typescript/commonjs/components/index.d.ts +129 -129
- package/lib/typescript/commonjs/form/HookFormField.d.ts +1 -1
- package/lib/typescript/commonjs/index.d.ts +2 -0
- package/lib/typescript/commonjs/navigation/DiscardGuard.d.ts +2 -8
- package/lib/typescript/commonjs/navigation/index.d.ts +2 -2
- package/lib/typescript/commonjs/text/index.d.ts +8 -0
- package/lib/typescript/commonjs/text/phone/amountSlider.g.d.ts +10 -0
- package/lib/typescript/commonjs/text/phone/asyncBlock.g.d.ts +8 -0
- package/lib/typescript/commonjs/text/phone/authedImage.g.d.ts +7 -0
- package/lib/typescript/commonjs/text/phone/autocomplete.g.d.ts +6 -0
- package/lib/typescript/commonjs/text/phone/avatar.g.d.ts +13 -0
- package/lib/typescript/commonjs/text/phone/badge.g.d.ts +6 -0
- package/lib/typescript/commonjs/text/phone/banner.g.d.ts +5 -0
- package/lib/typescript/commonjs/text/phone/bar.g.d.ts +5 -0
- package/lib/typescript/commonjs/text/phone/barChart.g.d.ts +8 -0
- package/lib/typescript/commonjs/text/phone/bottomNavigation.g.d.ts +7 -0
- package/lib/typescript/commonjs/text/phone/bottomSheet.g.d.ts +7 -0
- package/lib/typescript/commonjs/text/phone/button.g.d.ts +5 -0
- package/lib/typescript/commonjs/text/phone/calendar.g.d.ts +12 -0
- package/lib/typescript/commonjs/text/phone/card.g.d.ts +8 -0
- package/lib/typescript/commonjs/text/phone/carousel.g.d.ts +7 -0
- package/lib/typescript/commonjs/text/phone/catalogue.g.d.ts +153 -0
- package/lib/typescript/commonjs/text/phone/chip.g.d.ts +5 -0
- package/lib/typescript/commonjs/text/phone/composer.g.d.ts +7 -0
- package/lib/typescript/commonjs/text/phone/confirm.g.d.ts +5 -0
- package/lib/typescript/commonjs/text/phone/datePicker.g.d.ts +18 -0
- package/lib/typescript/commonjs/text/phone/dateRangePicker.g.d.ts +8 -0
- package/lib/typescript/commonjs/text/phone/dateSeparator.g.d.ts +6 -0
- package/lib/typescript/commonjs/text/phone/decimalInput.g.d.ts +5 -0
- package/lib/typescript/commonjs/text/phone/discardGuard.g.d.ts +8 -0
- package/lib/typescript/commonjs/text/phone/drawer.g.d.ts +6 -0
- package/lib/typescript/commonjs/text/phone/errorBoundary.g.d.ts +7 -0
- package/lib/typescript/commonjs/text/phone/filePicker.g.d.ts +20 -0
- package/lib/typescript/commonjs/text/phone/floatingActionButton.g.d.ts +8 -0
- package/lib/typescript/commonjs/text/phone/forceUpdateDialog.g.d.ts +9 -0
- package/lib/typescript/commonjs/text/phone/formField.g.d.ts +5 -0
- package/lib/typescript/commonjs/text/phone/imageGallery.g.d.ts +8 -0
- package/lib/typescript/commonjs/text/phone/index.g.d.ts +76 -0
- package/lib/typescript/commonjs/text/phone/inlineSelect.g.d.ts +8 -0
- package/lib/typescript/commonjs/text/phone/input.g.d.ts +6 -0
- package/lib/typescript/commonjs/text/phone/keyboardToolbar.g.d.ts +7 -0
- package/lib/typescript/commonjs/text/phone/loaderOverlay.g.d.ts +5 -0
- package/lib/typescript/commonjs/text/phone/lockOverlay.g.d.ts +10 -0
- package/lib/typescript/commonjs/text/phone/menu.g.d.ts +6 -0
- package/lib/typescript/commonjs/text/phone/messageBubble.g.d.ts +14 -0
- package/lib/typescript/commonjs/text/phone/messageList.g.d.ts +11 -0
- package/lib/typescript/commonjs/text/phone/modal.g.d.ts +5 -0
- package/lib/typescript/commonjs/text/phone/networkStatusBanner.g.d.ts +6 -0
- package/lib/typescript/commonjs/text/phone/nonModalBottomSheet.g.d.ts +7 -0
- package/lib/typescript/commonjs/text/phone/numberInput.g.d.ts +7 -0
- package/lib/typescript/commonjs/text/phone/onboardingPager.g.d.ts +9 -0
- package/lib/typescript/commonjs/text/phone/optionSheet.g.d.ts +13 -0
- package/lib/typescript/commonjs/text/phone/otpInput.g.d.ts +12 -0
- package/lib/typescript/commonjs/text/phone/pagedListFooter.g.d.ts +7 -0
- package/lib/typescript/commonjs/text/phone/permissionPrompt.g.d.ts +21 -0
- package/lib/typescript/commonjs/text/phone/phoneNumberInput.g.d.ts +12 -0
- package/lib/typescript/commonjs/text/phone/pickerTrigger.g.d.ts +8 -0
- package/lib/typescript/commonjs/text/phone/profileCompletion.g.d.ts +6 -0
- package/lib/typescript/commonjs/text/phone/profilePicker.g.d.ts +9 -0
- package/lib/typescript/commonjs/text/phone/progressBar.g.d.ts +5 -0
- package/lib/typescript/commonjs/text/phone/rating.g.d.ts +5 -0
- package/lib/typescript/commonjs/text/phone/refreshControl.g.d.ts +7 -0
- package/lib/typescript/commonjs/text/phone/repeater.g.d.ts +7 -0
- package/lib/typescript/commonjs/text/phone/richTextEditor.g.d.ts +15 -0
- package/lib/typescript/commonjs/text/phone/scannerOverlay.g.d.ts +16 -0
- package/lib/typescript/commonjs/text/phone/searchBar.g.d.ts +17 -0
- package/lib/typescript/commonjs/text/phone/sectionHeader.g.d.ts +5 -0
- package/lib/typescript/commonjs/text/phone/select.g.d.ts +9 -0
- package/lib/typescript/commonjs/text/phone/signaturePad.g.d.ts +24 -0
- package/lib/typescript/commonjs/text/phone/skeleton.g.d.ts +5 -0
- package/lib/typescript/commonjs/text/phone/slideToConfirm.g.d.ts +7 -0
- package/lib/typescript/commonjs/text/phone/slider.g.d.ts +5 -0
- package/lib/typescript/commonjs/text/phone/sliderField.g.d.ts +11 -0
- package/lib/typescript/commonjs/text/phone/sortableList.g.d.ts +6 -0
- package/lib/typescript/commonjs/text/phone/sparkline.g.d.ts +6 -0
- package/lib/typescript/commonjs/text/phone/spinner.g.d.ts +5 -0
- package/lib/typescript/commonjs/text/phone/stepper.g.d.ts +13 -0
- package/lib/typescript/commonjs/text/phone/timePicker.g.d.ts +15 -0
- package/lib/typescript/commonjs/text/phone/toast.g.d.ts +7 -0
- package/lib/typescript/commonjs/text/phone/tooltip.g.d.ts +7 -0
- package/lib/typescript/commonjs/text/phone/tour.g.d.ts +9 -0
- package/lib/typescript/commonjs/text/phone/typingIndicator.g.d.ts +5 -0
- package/lib/typescript/commonjs/text/phone/wheelPicker.g.d.ts +15 -0
- package/lib/typescript/commonjs/text/textStore.d.ts +20 -0
- package/lib/typescript/commonjs/theme/tokens.generated.d.ts +1 -1
- package/lib/typescript/commonjs/theme/types.d.ts +1 -1
- package/lib/typescript/module/components/Accordion/Accordion.d.ts +1 -3
- package/lib/typescript/module/components/AmountSlider/AmountSlider.d.ts +3 -11
- package/lib/typescript/module/components/AmountSlider/index.d.ts +2 -2
- package/lib/typescript/module/components/AppBar/AppBar.d.ts +3 -8
- package/lib/typescript/module/components/AppBar/index.d.ts +2 -2
- package/lib/typescript/module/components/AppLockOverlay/AppLockOverlay.d.ts +2 -10
- package/lib/typescript/module/components/AppLockOverlay/index.d.ts +2 -2
- package/lib/typescript/module/components/AsyncBlock/AsyncBlock.d.ts +2 -8
- package/lib/typescript/module/components/AsyncBlock/index.d.ts +2 -2
- package/lib/typescript/module/components/AuthedImage/AuthedImage.d.ts +2 -7
- package/lib/typescript/module/components/Autocomplete/Autocomplete.d.ts +3 -7
- package/lib/typescript/module/components/Autocomplete/index.d.ts +2 -2
- package/lib/typescript/module/components/Avatar/Avatar.d.ts +3 -13
- package/lib/typescript/module/components/Avatar/index.d.ts +2 -2
- package/lib/typescript/module/components/Badge/Badge.d.ts +2 -6
- package/lib/typescript/module/components/Badge/index.d.ts +2 -2
- package/lib/typescript/module/components/Banner/Banner.d.ts +4 -9
- package/lib/typescript/module/components/Banner/index.d.ts +2 -2
- package/lib/typescript/module/components/BarChart/BarChart.d.ts +2 -7
- package/lib/typescript/module/components/BarChart/index.d.ts +2 -2
- package/lib/typescript/module/components/BottomNavigation/BottomNavigation.d.ts +2 -7
- package/lib/typescript/module/components/BottomNavigation/index.d.ts +2 -2
- package/lib/typescript/module/components/BottomSheet/BottomSheet.d.ts +3 -7
- package/lib/typescript/module/components/BottomSheet/index.d.ts +2 -2
- package/lib/typescript/module/components/Button/Button.d.ts +4 -8
- package/lib/typescript/module/components/Button/index.d.ts +1 -1
- package/lib/typescript/module/components/Calendar/Calendar.d.ts +2 -8
- package/lib/typescript/module/components/Calendar/index.d.ts +2 -2
- package/lib/typescript/module/components/Card/Card.d.ts +4 -12
- package/lib/typescript/module/components/Card/index.d.ts +2 -2
- package/lib/typescript/module/components/Carousel/Carousel.d.ts +3 -8
- package/lib/typescript/module/components/Carousel/index.d.ts +2 -2
- package/lib/typescript/module/components/Checkbox/Checkbox.d.ts +1 -3
- package/lib/typescript/module/components/Chip/Chip.d.ts +3 -8
- package/lib/typescript/module/components/Chip/index.d.ts +2 -2
- package/lib/typescript/module/components/Composer/Composer.d.ts +2 -6
- package/lib/typescript/module/components/Composer/index.d.ts +2 -2
- package/lib/typescript/module/components/Confirm/confirm.d.ts +2 -3
- package/lib/typescript/module/components/DatePicker/DatePicker.d.ts +5 -21
- package/lib/typescript/module/components/DatePicker/index.d.ts +2 -2
- package/lib/typescript/module/components/DateRangePicker/DateRangePicker.d.ts +5 -11
- package/lib/typescript/module/components/DateRangePicker/index.d.ts +2 -2
- package/lib/typescript/module/components/DateSeparator/DateSeparator.d.ts +3 -7
- package/lib/typescript/module/components/DateSeparator/index.d.ts +2 -2
- package/lib/typescript/module/components/DecimalInput/DecimalInput.d.ts +3 -6
- package/lib/typescript/module/components/DecimalInput/index.d.ts +2 -2
- package/lib/typescript/module/components/Dialog/Dialog.d.ts +3 -3
- package/lib/typescript/module/components/Drawer/Drawer.d.ts +3 -7
- package/lib/typescript/module/components/Drawer/index.d.ts +2 -2
- package/lib/typescript/module/components/ErrorBoundary/ErrorBoundary.d.ts +2 -7
- package/lib/typescript/module/components/ErrorBoundary/index.d.ts +2 -2
- package/lib/typescript/module/components/FieldBase/FieldBase.d.ts +4 -3
- package/lib/typescript/module/components/FilePicker/FilePicker.d.ts +2 -29
- package/lib/typescript/module/components/FilePicker/index.d.ts +2 -2
- package/lib/typescript/module/components/FloatingActionButton/FloatingActionButton.d.ts +4 -14
- package/lib/typescript/module/components/FloatingActionButton/index.d.ts +2 -2
- package/lib/typescript/module/components/ForceUpdateDialog/ForceUpdateDialog.d.ts +6 -10
- package/lib/typescript/module/components/ForceUpdateDialog/index.d.ts +2 -2
- package/lib/typescript/module/components/FormField/FormField.d.ts +5 -7
- package/lib/typescript/module/components/FormField/index.d.ts +2 -2
- package/lib/typescript/module/components/ImageGallery/ImageGallery.d.ts +3 -9
- package/lib/typescript/module/components/ImageGallery/index.d.ts +2 -2
- package/lib/typescript/module/components/InlineSelect/InlineSelect.d.ts +2 -8
- package/lib/typescript/module/components/InlineSelect/index.d.ts +2 -2
- package/lib/typescript/module/components/Input/Input.d.ts +5 -10
- package/lib/typescript/module/components/Input/index.d.ts +2 -2
- package/lib/typescript/module/components/KeyboardToolbar/KeyboardToolbar.d.ts +2 -7
- package/lib/typescript/module/components/KeyboardToolbar/index.d.ts +2 -2
- package/lib/typescript/module/components/ListItem/ListItem.d.ts +2 -1
- package/lib/typescript/module/components/LoaderOverlay/LoaderOverlay.d.ts +2 -6
- package/lib/typescript/module/components/LoaderOverlay/index.d.ts +2 -2
- package/lib/typescript/module/components/Menu/Menu.d.ts +3 -2
- package/lib/typescript/module/components/Menu/MenuSurface.d.ts +3 -2
- package/lib/typescript/module/components/Menu/index.d.ts +1 -2
- package/lib/typescript/module/components/Menu/menuModel.d.ts +0 -6
- package/lib/typescript/module/components/Menu/useContextMenu.d.ts +3 -2
- package/lib/typescript/module/components/MessageBubble/MessageBubble.d.ts +2 -13
- package/lib/typescript/module/components/MessageBubble/index.d.ts +2 -2
- package/lib/typescript/module/components/MessageList/MessageList.d.ts +2 -10
- package/lib/typescript/module/components/MessageList/index.d.ts +2 -2
- package/lib/typescript/module/components/Modal/Modal.d.ts +3 -6
- package/lib/typescript/module/components/Modal/index.d.ts +2 -2
- package/lib/typescript/module/components/NonModalBottomSheet/NonModalBottomSheet.d.ts +3 -6
- package/lib/typescript/module/components/NonModalBottomSheet/index.d.ts +2 -2
- package/lib/typescript/module/components/NumberInput/NumberInput.d.ts +3 -10
- package/lib/typescript/module/components/NumberInput/index.d.ts +2 -2
- package/lib/typescript/module/components/OTPInput/OTPInput.d.ts +2 -5
- package/lib/typescript/module/components/OTPInput/OTPResendRow.d.ts +2 -10
- package/lib/typescript/module/components/OTPInput/index.d.ts +4 -4
- package/lib/typescript/module/components/OnboardingPager/OnboardingPager.d.ts +2 -12
- package/lib/typescript/module/components/OnboardingPager/index.d.ts +2 -2
- package/lib/typescript/module/components/OptionSheet/OptionSheet.d.ts +2 -13
- package/lib/typescript/module/components/OptionSheet/index.d.ts +2 -2
- package/lib/typescript/module/components/PagedListFooter/PagedListFooter.d.ts +2 -7
- package/lib/typescript/module/components/PagedListFooter/index.d.ts +2 -2
- package/lib/typescript/module/components/PermissionPrompt/PermissionPrompt.d.ts +2 -12
- package/lib/typescript/module/components/PermissionPrompt/index.d.ts +2 -2
- package/lib/typescript/module/components/PhoneNumberInput/PhoneNumberInput.d.ts +2 -14
- package/lib/typescript/module/components/PhoneNumberInput/index.d.ts +2 -2
- package/lib/typescript/module/components/PickerTrigger/PickerTrigger.d.ts +3 -9
- package/lib/typescript/module/components/PickerTrigger/index.d.ts +2 -2
- package/lib/typescript/module/components/ProfileCompletion/ProfileCompletion.d.ts +2 -6
- package/lib/typescript/module/components/ProfileCompletion/index.d.ts +2 -2
- package/lib/typescript/module/components/ProfilePicker/ProfilePicker.d.ts +2 -12
- package/lib/typescript/module/components/ProfilePicker/index.d.ts +2 -2
- package/lib/typescript/module/components/ProgressBar/ProgressBar.d.ts +3 -8
- package/lib/typescript/module/components/ProgressBar/index.d.ts +2 -2
- package/lib/typescript/module/components/Radio/Radio.d.ts +1 -3
- package/lib/typescript/module/components/Rating/Rating.d.ts +3 -8
- package/lib/typescript/module/components/Rating/index.d.ts +2 -2
- package/lib/typescript/module/components/Repeater/Repeater.d.ts +2 -7
- package/lib/typescript/module/components/Repeater/index.d.ts +1 -1
- package/lib/typescript/module/components/RichTextEditor/RichTextEditor.d.ts +2 -3
- package/lib/typescript/module/components/RichTextEditor/index.d.ts +2 -2
- package/lib/typescript/module/components/ScannerOverlay/ScannerOverlay.d.ts +2 -28
- package/lib/typescript/module/components/ScannerOverlay/index.d.ts +2 -2
- package/lib/typescript/module/components/SearchBar/SearchBar.d.ts +2 -16
- package/lib/typescript/module/components/SearchBar/SearchPanel.d.ts +3 -3
- package/lib/typescript/module/components/SearchBar/index.d.ts +2 -2
- package/lib/typescript/module/components/SectionHeader/SectionHeader.d.ts +3 -5
- package/lib/typescript/module/components/SectionHeader/index.d.ts +2 -2
- package/lib/typescript/module/components/SegmentedControl/SegmentedControl.d.ts +1 -3
- package/lib/typescript/module/components/Select/Select.d.ts +7 -12
- package/lib/typescript/module/components/Select/index.d.ts +1 -1
- package/lib/typescript/module/components/SignaturePad/SignaturePad.d.ts +2 -35
- package/lib/typescript/module/components/SignaturePad/index.d.ts +2 -2
- package/lib/typescript/module/components/Skeleton/Skeleton.d.ts +2 -6
- package/lib/typescript/module/components/Skeleton/SkeletonContent.d.ts +3 -2
- package/lib/typescript/module/components/Skeleton/SkeletonList.d.ts +3 -2
- package/lib/typescript/module/components/Skeleton/index.d.ts +2 -2
- package/lib/typescript/module/components/SlideToConfirm/SlideToConfirm.d.ts +2 -7
- package/lib/typescript/module/components/SlideToConfirm/index.d.ts +2 -2
- package/lib/typescript/module/components/Slider/Slider.d.ts +1 -3
- package/lib/typescript/module/components/SliderField/SliderField.d.ts +2 -11
- package/lib/typescript/module/components/SliderField/index.d.ts +2 -2
- package/lib/typescript/module/components/SortableList/SortableList.d.ts +2 -6
- package/lib/typescript/module/components/SortableList/index.d.ts +2 -2
- package/lib/typescript/module/components/Sparkline/Sparkline.d.ts +2 -6
- package/lib/typescript/module/components/Sparkline/index.d.ts +2 -2
- package/lib/typescript/module/components/Spinner/Spinner.d.ts +2 -5
- package/lib/typescript/module/components/Spinner/index.d.ts +2 -2
- package/lib/typescript/module/components/Stepper/Stepper.d.ts +3 -15
- package/lib/typescript/module/components/Stepper/index.d.ts +2 -2
- package/lib/typescript/module/components/Swipeable/Swipeable.d.ts +1 -1
- package/lib/typescript/module/components/Switch/Switch.d.ts +1 -3
- package/lib/typescript/module/components/TimePicker/TimePicker.d.ts +6 -19
- package/lib/typescript/module/components/TimePicker/index.d.ts +2 -2
- package/lib/typescript/module/components/Toast/Toast.d.ts +2 -7
- package/lib/typescript/module/components/Toast/ToastProvider.d.ts +3 -2
- package/lib/typescript/module/components/Toast/index.d.ts +2 -2
- package/lib/typescript/module/components/Tooltip/Tooltip.d.ts +3 -10
- package/lib/typescript/module/components/Tooltip/index.d.ts +2 -2
- package/lib/typescript/module/components/Tour/Tour.d.ts +2 -9
- package/lib/typescript/module/components/Tour/index.d.ts +2 -2
- package/lib/typescript/module/components/TypingIndicator/TypingIndicator.d.ts +2 -5
- package/lib/typescript/module/components/TypingIndicator/index.d.ts +2 -2
- package/lib/typescript/module/components/WheelPicker/WheelPicker.d.ts +2 -15
- package/lib/typescript/module/components/WheelPicker/index.d.ts +2 -2
- package/lib/typescript/module/components/index.d.ts +129 -129
- package/lib/typescript/module/form/HookFormField.d.ts +1 -1
- package/lib/typescript/module/index.d.ts +2 -0
- package/lib/typescript/module/navigation/DiscardGuard.d.ts +2 -8
- package/lib/typescript/module/navigation/index.d.ts +2 -2
- package/lib/typescript/module/text/index.d.ts +8 -0
- package/lib/typescript/module/text/phone/amountSlider.g.d.ts +10 -0
- package/lib/typescript/module/text/phone/asyncBlock.g.d.ts +8 -0
- package/lib/typescript/module/text/phone/authedImage.g.d.ts +7 -0
- package/lib/typescript/module/text/phone/autocomplete.g.d.ts +6 -0
- package/lib/typescript/module/text/phone/avatar.g.d.ts +13 -0
- package/lib/typescript/module/text/phone/badge.g.d.ts +6 -0
- package/lib/typescript/module/text/phone/banner.g.d.ts +5 -0
- package/lib/typescript/module/text/phone/bar.g.d.ts +5 -0
- package/lib/typescript/module/text/phone/barChart.g.d.ts +8 -0
- package/lib/typescript/module/text/phone/bottomNavigation.g.d.ts +7 -0
- package/lib/typescript/module/text/phone/bottomSheet.g.d.ts +7 -0
- package/lib/typescript/module/text/phone/button.g.d.ts +5 -0
- package/lib/typescript/module/text/phone/calendar.g.d.ts +12 -0
- package/lib/typescript/module/text/phone/card.g.d.ts +8 -0
- package/lib/typescript/module/text/phone/carousel.g.d.ts +7 -0
- package/lib/typescript/module/text/phone/catalogue.g.d.ts +153 -0
- package/lib/typescript/module/text/phone/chip.g.d.ts +5 -0
- package/lib/typescript/module/text/phone/composer.g.d.ts +7 -0
- package/lib/typescript/module/text/phone/confirm.g.d.ts +5 -0
- package/lib/typescript/module/text/phone/datePicker.g.d.ts +18 -0
- package/lib/typescript/module/text/phone/dateRangePicker.g.d.ts +8 -0
- package/lib/typescript/module/text/phone/dateSeparator.g.d.ts +6 -0
- package/lib/typescript/module/text/phone/decimalInput.g.d.ts +5 -0
- package/lib/typescript/module/text/phone/discardGuard.g.d.ts +8 -0
- package/lib/typescript/module/text/phone/drawer.g.d.ts +6 -0
- package/lib/typescript/module/text/phone/errorBoundary.g.d.ts +7 -0
- package/lib/typescript/module/text/phone/filePicker.g.d.ts +20 -0
- package/lib/typescript/module/text/phone/floatingActionButton.g.d.ts +8 -0
- package/lib/typescript/module/text/phone/forceUpdateDialog.g.d.ts +9 -0
- package/lib/typescript/module/text/phone/formField.g.d.ts +5 -0
- package/lib/typescript/module/text/phone/imageGallery.g.d.ts +8 -0
- package/lib/typescript/module/text/phone/index.g.d.ts +76 -0
- package/lib/typescript/module/text/phone/inlineSelect.g.d.ts +8 -0
- package/lib/typescript/module/text/phone/input.g.d.ts +6 -0
- package/lib/typescript/module/text/phone/keyboardToolbar.g.d.ts +7 -0
- package/lib/typescript/module/text/phone/loaderOverlay.g.d.ts +5 -0
- package/lib/typescript/module/text/phone/lockOverlay.g.d.ts +10 -0
- package/lib/typescript/module/text/phone/menu.g.d.ts +6 -0
- package/lib/typescript/module/text/phone/messageBubble.g.d.ts +14 -0
- package/lib/typescript/module/text/phone/messageList.g.d.ts +11 -0
- package/lib/typescript/module/text/phone/modal.g.d.ts +5 -0
- package/lib/typescript/module/text/phone/networkStatusBanner.g.d.ts +6 -0
- package/lib/typescript/module/text/phone/nonModalBottomSheet.g.d.ts +7 -0
- package/lib/typescript/module/text/phone/numberInput.g.d.ts +7 -0
- package/lib/typescript/module/text/phone/onboardingPager.g.d.ts +9 -0
- package/lib/typescript/module/text/phone/optionSheet.g.d.ts +13 -0
- package/lib/typescript/module/text/phone/otpInput.g.d.ts +12 -0
- package/lib/typescript/module/text/phone/pagedListFooter.g.d.ts +7 -0
- package/lib/typescript/module/text/phone/permissionPrompt.g.d.ts +21 -0
- package/lib/typescript/module/text/phone/phoneNumberInput.g.d.ts +12 -0
- package/lib/typescript/module/text/phone/pickerTrigger.g.d.ts +8 -0
- package/lib/typescript/module/text/phone/profileCompletion.g.d.ts +6 -0
- package/lib/typescript/module/text/phone/profilePicker.g.d.ts +9 -0
- package/lib/typescript/module/text/phone/progressBar.g.d.ts +5 -0
- package/lib/typescript/module/text/phone/rating.g.d.ts +5 -0
- package/lib/typescript/module/text/phone/refreshControl.g.d.ts +7 -0
- package/lib/typescript/module/text/phone/repeater.g.d.ts +7 -0
- package/lib/typescript/module/text/phone/richTextEditor.g.d.ts +15 -0
- package/lib/typescript/module/text/phone/scannerOverlay.g.d.ts +16 -0
- package/lib/typescript/module/text/phone/searchBar.g.d.ts +17 -0
- package/lib/typescript/module/text/phone/sectionHeader.g.d.ts +5 -0
- package/lib/typescript/module/text/phone/select.g.d.ts +9 -0
- package/lib/typescript/module/text/phone/signaturePad.g.d.ts +24 -0
- package/lib/typescript/module/text/phone/skeleton.g.d.ts +5 -0
- package/lib/typescript/module/text/phone/slideToConfirm.g.d.ts +7 -0
- package/lib/typescript/module/text/phone/slider.g.d.ts +5 -0
- package/lib/typescript/module/text/phone/sliderField.g.d.ts +11 -0
- package/lib/typescript/module/text/phone/sortableList.g.d.ts +6 -0
- package/lib/typescript/module/text/phone/sparkline.g.d.ts +6 -0
- package/lib/typescript/module/text/phone/spinner.g.d.ts +5 -0
- package/lib/typescript/module/text/phone/stepper.g.d.ts +13 -0
- package/lib/typescript/module/text/phone/timePicker.g.d.ts +15 -0
- package/lib/typescript/module/text/phone/toast.g.d.ts +7 -0
- package/lib/typescript/module/text/phone/tooltip.g.d.ts +7 -0
- package/lib/typescript/module/text/phone/tour.g.d.ts +9 -0
- package/lib/typescript/module/text/phone/typingIndicator.g.d.ts +5 -0
- package/lib/typescript/module/text/phone/wheelPicker.g.d.ts +15 -0
- package/lib/typescript/module/text/textStore.d.ts +20 -0
- package/lib/typescript/module/theme/tokens.generated.d.ts +1 -1
- package/lib/typescript/module/theme/types.d.ts +1 -1
- package/package.json +10 -10
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";export{
|
|
1
|
+
"use strict";export{default,Select}from"./Select.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{formatDateTime}from"@webority/mobile-core";import{forwardRef,memo,useCallback,useEffect,useImperativeHandle,useMemo,useRef,useState}from"react";import{AccessibilityInfo,Modal,PixelRatio,Platform,StyleSheet,useWindowDimensions,View}from"react-native";import{GestureDetector,GestureHandlerRootView,useCompetingGestures,usePanGesture}from"react-native-gesture-handler";import Svg,{Path,Rect,Text as SvgText}from"react-native-svg";import{lightTheme,useTheme}from"../../theme/index.js";import{announce}from"../../utils/announce.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{smoothCorners}from"../../utils/corners.js";import{Button}from"../Button/index.js";import{Input}from"../Input/index.js";import{Text}from"../Text/index.js";import{BASELINE_RATIO,buildSignatureSvg,distanceBetween,FALLBACK_WIDTH,pointOf,strokePath,typedFontSize}from"./signatureGeometry.js";import{writePng}from"./writePng";import{jsx as _jsx,Fragment as _Fragment,jsxs as _jsxs}from"react/jsx-runtime";export const DEFAULT_SIGNATURE_PAD_LABELS=Object.freeze({pad:"Signature pad",padHint:"Draw with one finger. To sign without drawing, use the type your name action.",caption:"Sign above the line. To start with an up or down stroke, rest your finger a moment first.",typedCaption:"Your typed name is used as your signature.",undo:"Undo",clear:"Clear",typeInstead:"Type your name instead",drawInstead:"Draw instead",typedLabel:"Type your name",typedPlaceholder:"Your full name",empty:"Not signed",signed:"Signed",typingAnnouncement:"Signing by typing your name. Your typed name is used as your signature. Choose Draw instead to sign with your finger.",drawingAnnouncement:"Signing by drawing. Use one finger on the pad.",clearedAnnouncement:"Signature cleared",undoneAnnouncement:"Last stroke removed",emptyError:"Add a signature first.",expand:"Expand",done:"Done",close:"Close"});const STROKE_WIDTH=2.5,SIDEWAYS_TO_DRAW=6,UPRIGHT_TO_SCROLL=8,REST_TO_DRAW_MS=200,MIN_POINT_GAP=.8,DEFAULT_HEIGHT=180,EXPANDED_CHROME=200,DEFAULT_NAME_LENGTH=100,MAX_EXPORT_SCALE=3,MIN_TARGET=44,BASELINE_OPACITY=.3,DISABLED_OPACITY=.5,TARGET_STYLE={minHeight:44},defaultScriptFont=()=>Platform.select({ios:"Snell Roundhand",default:"cursive"}),cssFontStack=e=>"cursive"===e?"cursive":`'${e}', cursive`,useScreenReader=()=>{const[e,t]=useState(!1);return useEffect(()=>{let e=!0;AccessibilityInfo.isScreenReaderEnabled().then(n=>{e&&t(n)});const n=AccessibilityInfo.addEventListener("screenReaderChanged",t);return()=>{e=!1,n.remove()}},[]),e},StrokePath=memo(({points:e,color:t})=>_jsx(Path,{d:strokePath(e),stroke:t,strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round",fill:"none"}));StrokePath.displayName="SignaturePadStroke";const Marks=({mode:e,strokes:t,name:n,color:a,fontFamily:r,width:o,height:s})=>"draw"===e?_jsx(_Fragment,{children:t.map(e=>_jsx(StrokePath,{points:e.points,color:a},e.id))}):n?_jsx(SvgText,{x:o/2,y:s*BASELINE_RATIO,fontSize:typedFontSize(o,n),fontFamily:r,textAnchor:"middle",fill:a,children:n}):null,SignaturePadSurface=forwardRef((e,t)=>{const{expandable:n,initialStrokes:a,onChange:r,initialTypedName:o="",onTypedNameChange:s,defaultMode:i="draw",onModeChange:l,onEmptyChange:d,allowTyped:u=!0,signedBy:c,signedAt:p,height:m=DEFAULT_HEIGHT,maxNameLength:h=DEFAULT_NAME_LENGTH,inkColor:g,paperColor:y,scriptFontFamily:f,labels:S,haptic:x="selection",disabled:w=!1,style:T,testID:b}=e;assertValidValue("SignaturePad","defaultMode",e.defaultMode,["draw","type"]);const _=useTheme(),E=void 0===g&&void 0===y,A=E?_.colors["text-body"]:g??lightTheme.colors["text-body"],C=E?_.colors.surface:y??lightTheme.colors.surface,v=E?lightTheme.colors["text-body"]:A,R=E?lightTheme.colors.surface:C,I=v!==A||R!==C,j=f??defaultScriptFont(),P=useMemo(()=>({...DEFAULT_SIGNATURE_PAD_LABELS,...S}),[S]),D=useScreenReader(),k=useRef(null),L=useRef(null),[F,M]=useState(0),[G,N]=useState(()=>(a??[]).map((e,t)=>({id:t+1,points:[...e]}))),B=useRef(G),O=useRef(G.length),H=useRef(null),V=useRef(null),[Y,$]=useState(u?i:"draw"),[z,U]=useState(o),[W,K]=useState(null),X=useRef(!1),{height:q}=useWindowDimensions(),[J,Q]=useState(!1),[Z,ee]=useState([]),te=useRef({onChange:r,onTypedNameChange:s,onModeChange:l,onEmptyChange:d});useEffect(()=>{te.current={onChange:r,onTypedNameChange:s,onModeChange:l,onEmptyChange:d}});const ne="draw"===Y&&!w,ae="draw"===Y?0===G.length:0===z.trim().length,re=useRef(null);useEffect(()=>{re.current!==ae&&(re.current=ae,te.current.onEmptyChange?.(ae))},[ae]);const oe=useCallback(e=>{B.current=e,N(e)},[]),se=useCallback(()=>{K(Date.now()),te.current.onChange?.(B.current.map(e=>e.points))},[]),ie=useMemo(()=>{const pan=e=>({enabled:ne,runOnJS:!0,onBegin:e=>{H.current=pointOf(e.x,e.y)},onActivate:t=>{V.current=e,O.current+=1;const n=pointOf(t.x,t.y);oe([...B.current,{id:O.current,points:[H.current??n,n]}])},onUpdate:t=>{if(V.current!==e)return;const n=B.current[B.current.length-1];if(void 0===n)throw new Error("The stroke being drawn is missing.");const a=pointOf(t.x,t.y),r=n.points[n.points.length-1];if(void 0===r)throw new Error("A drawn stroke has no points.");distanceBetween(r,a)<.8||oe([...B.current.slice(0,-1),{...n,points:[...n.points,a]}])},onFinalize:()=>{V.current===e&&(V.current=null,se())}});return{sidewaysConfig:{...pan("sideways"),activeOffsetX:[-6,6],failOffsetY:[-8,8]},restedConfig:{...pan("rested"),activateAfterLongPress:200}}},[ne,oe,se]),le=usePanGesture(ie.sidewaysConfig),de=usePanGesture(ie.restedConfig),ue=useCompetingGestures(le,de),ce=useCallback(e=>{$(e),te.current.onModeChange?.(e),announce("type"===e?P.typingAnnouncement:P.drawingAnnouncement)},[P.typingAnnouncement,P.drawingAnnouncement]);useEffect(()=>{D&&u&&!X.current&&"draw"===Y&&0===B.current.length&&ce("type")},[D,u,Y,ce]);const pe=useCallback(()=>{X.current=!0,ce("draw"===Y?"type":"draw")},[Y,ce]),me=useCallback(e=>{U(e),K(Date.now()),te.current.onTypedNameChange?.(e)},[]),he=useCallback(()=>{"type"===Y?me(""):(oe([]),se()),announce(P.clearedAnnouncement)},[Y,me,oe,se,P.clearedAnnouncement]),ge=useCallback(()=>{"draw"===Y&&0!==B.current.length&&(oe(B.current.slice(0,-1)),se(),announce(P.undoneAnnouncement))},[Y,oe,se,P.undoneAnnouncement]),ye=useCallback(()=>{ee(B.current.map(e=>e.points)),Q(!0)},[]),fe=useCallback(()=>{Q(!1)},[]),Se=useCallback(()=>{oe(Z.map(e=>(O.current+=1,{id:O.current,points:[...e]}))),se(),Q(!1)},[Z,oe,se]),xe=F||FALLBACK_WIDTH;useImperativeHandle(t,()=>({toFile:()=>new Promise((e,t)=>{if(ae)return void t(new Error(P.emptyError));const n=I?L.current:k.current;if(!n)return void t(new Error("The signature pad is not on screen."));const a=Math.min(3,Math.max(1,PixelRatio.get()));n.toDataURL(n=>{writePng(n).then(e,t)},{width:xe*a,height:m*a})}),toSvg:()=>buildSignatureSvg({width:xe,height:m,mode:Y,strokes:G.map(e=>e.points),typedName:z,ink:v,paper:R,strokeWidth:2.5,fontFamily:cssFontStack(j)}),clear:he,undo:ge,isEmpty:()=>ae}),[ae,P.emptyError,xe,m,Y,G,z,I,v,R,j,he,ge]);const we=useMemo(()=>[{name:"undo",label:P.undo},{name:"clear",label:P.clear},...u?[{name:"toggleMode",label:"draw"===Y?P.typeInstead:P.drawInstead}]:[]],[P.undo,P.clear,P.typeInstead,P.drawInstead,u,Y]),Te=useCallback(e=>{if(w)return;const{actionName:t}=e.nativeEvent;"undo"===t?ge():"clear"===t?he():"toggleMode"===t&&u&&pe()},[w,ge,he,pe,u]),be=useCallback(e=>{M(e.nativeEvent.layout.width)},[]),Ee=useMemo(()=>StyleSheet.create({root:{gap:_.space.sm},pad:{height:m,borderWidth:_.size.border,borderColor:_.colors.border,borderRadius:_.radius.md,...smoothCorners,overflow:"hidden",backgroundColor:C,opacity:w?.5:1},baseline:{position:"absolute",left:_.space.md,right:_.space.md,top:m*BASELINE_RATIO,height:StyleSheet.hairlineWidth,backgroundColor:A,opacity:.3},actions:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:_.space.xs},trailing:{flexDirection:"row",alignItems:"center",gap:_.space.xs},expandedRoot:{flex:1,padding:_.space.md,gap:_.space.sm,backgroundColor:_.colors.bg},expandedBar:{flexDirection:"row",alignItems:"center",justifyContent:"space-between"}}),[_,m,C,A,w]),Ae=z.trim(),Ce=p??W,ve=c&&!ae?`Signed by ${c}${Ce?`, ${formatDateTime(Ce)}`:""}`:null,Re="type"===Y&&Ae?`${P.pad}. ${Ae}`:P.pad;return _jsxs(View,{style:[Ee.root,T],testID:b,children:[_jsx(GestureDetector,{gesture:ue,children:_jsxs(View,{style:Ee.pad,onLayout:be,accessible:!0,accessibilityRole:"image",accessibilityLabel:Re,accessibilityHint:"draw"===Y?P.padHint:void 0,accessibilityValue:{text:ae?P.empty:P.signed},accessibilityState:{disabled:w},"aria-disabled":w,accessibilityActions:we,onAccessibilityAction:Te,children:[I?_jsxs(Svg,{ref:L,style:StyleSheet.absoluteFill,width:"100%",height:m,children:[_jsx(Rect,{x:"0",y:"0",width:"100%",height:"100%",fill:R}),_jsx(Marks,{mode:Y,strokes:G,name:Ae,color:v,fontFamily:j,width:xe,height:m})]}):null,_jsxs(Svg,{ref:k,width:"100%",height:m,children:[_jsx(Rect,{x:"0",y:"0",width:"100%",height:"100%",fill:C}),_jsx(Marks,{mode:Y,strokes:G,name:Ae,color:A,fontFamily:j,width:xe,height:m})]}),_jsx(View,{pointerEvents:"none",style:Ee.baseline})]})}),"type"===Y?_jsx(Input,{label:P.typedLabel,placeholder:P.typedPlaceholder,value:z,onChangeText:me,maxLength:h,disabled:w,autoComplete:"name",textContentType:"name",autoCapitalize:"words",autoCorrect:!1,returnKeyType:"done",testID:b?`${b}-name`:void 0}):null,_jsx(Text,{variant:"caption",color:"tertiary",children:"draw"===Y?P.caption:P.typedCaption}),_jsxs(View,{style:Ee.actions,children:[u?_jsx(Button,{label:"draw"===Y?P.typeInstead:P.drawInstead,variant:"ghost",tone:"primary",size:"md",style:TARGET_STYLE,haptic:x,disabled:w,onPress:pe,testID:b?`${b}-mode`:void 0}):_jsx(View,{}),"draw"===Y?_jsxs(View,{style:Ee.trailing,children:[G.length>0?_jsxs(_Fragment,{children:[_jsx(Button,{label:P.undo,variant:"ghost",tone:"primary",size:"md",style:TARGET_STYLE,haptic:x,disabled:w,onPress:ge,testID:b?`${b}-undo`:void 0}),_jsx(Button,{label:P.clear,variant:"ghost",tone:"primary",size:"md",style:TARGET_STYLE,haptic:x,disabled:w,onPress:he,testID:b?`${b}-clear`:void 0})]}):null,n?_jsx(Button,{label:P.expand,variant:"ghost",tone:"primary",size:"md",style:TARGET_STYLE,haptic:x,disabled:w,onPress:ye,testID:b?`${b}-expand`:void 0}):null]}):null,"type"===Y&&Ae?_jsx(Button,{label:P.clear,variant:"ghost",tone:"primary",size:"md",style:TARGET_STYLE,haptic:x,disabled:w,onPress:he,testID:b?`${b}-clear`:void 0}):null]}),ve?_jsx(Text,{variant:"caption",color:"secondary",children:ve}):null,n?_jsx(Modal,{visible:J,animationType:"slide",presentationStyle:"fullScreen",onRequestClose:fe,children:_jsxs(ExpandedRoot,{style:Ee.expandedRoot,children:[_jsxs(View,{style:Ee.expandedBar,children:[_jsx(Button,{label:P.close,variant:"ghost",tone:"primary",size:"md",style:TARGET_STYLE,haptic:x,onPress:fe,testID:b?`${b}-close`:void 0}),_jsx(Button,{label:P.done,variant:"solid",tone:"primary",size:"md",style:TARGET_STYLE,haptic:x,onPress:Se,testID:b?`${b}-done`:void 0})]}),J?_jsx(SignaturePadSurface,{expandable:!1,defaultMode:"draw",allowTyped:!1,initialStrokes:Z,onChange:ee,height:Math.max(DEFAULT_HEIGHT,q-200),inkColor:g,paperColor:y,scriptFontFamily:f,labels:S,haptic:x,testID:b?`${b}-expanded`:void 0}):null]})}):null]})});SignaturePadSurface.displayName="SignaturePadSurface";const ExpandedRoot="android"===Platform.OS?GestureHandlerRootView:View,SignaturePad=forwardRef((e,t)=>_jsx(SignaturePadSurface,{...e,expandable:!0,ref:t}));SignaturePad.displayName="SignaturePad";export{SignaturePad};export default SignaturePad;
|
|
1
|
+
"use strict";import{formatDateTime}from"@webority/mobile-core";import{forwardRef,memo,useCallback,useEffect,useImperativeHandle,useMemo,useRef,useState}from"react";import{AccessibilityInfo,Modal,PixelRatio,Platform,StyleSheet,useWindowDimensions,View}from"react-native";import{GestureDetector,GestureHandlerRootView,useCompetingGestures,usePanGesture}from"react-native-gesture-handler";import Svg,{Path,Rect,Text as SvgText}from"react-native-svg";import{useMobileUiText}from"../../text/index.js";import{SIGNATURE_PAD_TEXT}from"../../text/phone/signaturePad.g.js";import{lightTheme,useTheme}from"../../theme/index.js";import{announce}from"../../utils/announce.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{smoothCorners}from"../../utils/corners.js";import{Button}from"../Button/index.js";import{Input}from"../Input/index.js";import{Text}from"../Text/index.js";import{BASELINE_RATIO,buildSignatureSvg,distanceBetween,FALLBACK_WIDTH,pointOf,strokePath,typedFontSize}from"./signatureGeometry.js";import{writePng}from"./writePng";import{jsx as _jsx,Fragment as _Fragment,jsxs as _jsxs}from"react/jsx-runtime";const STROKE_WIDTH=2.5,SIDEWAYS_TO_DRAW=6,UPRIGHT_TO_SCROLL=8,REST_TO_DRAW_MS=200,MIN_POINT_GAP=.8,DEFAULT_HEIGHT=180,EXPANDED_CHROME=200,DEFAULT_NAME_LENGTH=100,MAX_EXPORT_SCALE=3,MIN_TARGET=44,BASELINE_OPACITY=.3,DISABLED_OPACITY=.5,TARGET_STYLE={minHeight:44},defaultScriptFont=()=>Platform.select({ios:"Snell Roundhand",default:"cursive"}),cssFontStack=e=>"cursive"===e?"cursive":`'${e}', cursive`,useScreenReader=()=>{const[e,t]=useState(!1);return useEffect(()=>{let e=!0;AccessibilityInfo.isScreenReaderEnabled().then(n=>{e&&t(n)});const n=AccessibilityInfo.addEventListener("screenReaderChanged",t);return()=>{e=!1,n.remove()}},[]),e},StrokePath=memo(({points:e,color:t})=>_jsx(Path,{d:strokePath(e),stroke:t,strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round",fill:"none"}));StrokePath.displayName="SignaturePadStroke";const Marks=({mode:e,strokes:t,name:n,color:a,fontFamily:r,width:o,height:s})=>"draw"===e?_jsx(_Fragment,{children:t.map(e=>_jsx(StrokePath,{points:e.points,color:a},e.id))}):n?_jsx(SvgText,{x:o/2,y:s*BASELINE_RATIO,fontSize:typedFontSize(o,n),fontFamily:r,textAnchor:"middle",fill:a,children:n}):null,SignaturePadSurface=forwardRef((e,t)=>{const{expandable:n,initialStrokes:a,onChange:r,initialTypedName:o="",onTypedNameChange:s,defaultMode:i="draw",onModeChange:l,onEmptyChange:d,allowTyped:c=!0,signedBy:u,signedAt:p,height:m=DEFAULT_HEIGHT,maxNameLength:h=DEFAULT_NAME_LENGTH,inkColor:g,paperColor:f,scriptFontFamily:y,labels:x,haptic:S="selection",disabled:T=!1,style:b,testID:_}=e;assertValidValue("SignaturePad","defaultMode",e.defaultMode,["draw","type"]);const w=useTheme(),E=void 0===g&&void 0===f,C=E?w.colors["text-body"]:g??lightTheme.colors["text-body"],A=E?w.colors.surface:f??lightTheme.colors.surface,v=E?lightTheme.colors["text-body"]:C,R=E?lightTheme.colors.surface:A,j=v!==C||R!==A,I=y??defaultScriptFont(),P=useMobileUiText("signaturePad",SIGNATURE_PAD_TEXT),k=useMemo(()=>({...P,...x}),[P,x]),D=useScreenReader(),L=useRef(null),M=useRef(null),[F,G]=useState(0),[N,B]=useState(()=>(a??[]).map((e,t)=>({id:t+1,points:[...e]}))),O=useRef(N),H=useRef(N.length),V=useRef(null),$=useRef(null),[z,W]=useState(c?i:"draw"),[U,Y]=useState(o),[X,K]=useState(null),q=useRef(!1),{height:J}=useWindowDimensions(),[Q,Z]=useState(!1),[ee,te]=useState([]),ne=useRef({onChange:r,onTypedNameChange:s,onModeChange:l,onEmptyChange:d});useEffect(()=>{ne.current={onChange:r,onTypedNameChange:s,onModeChange:l,onEmptyChange:d}});const ae="draw"===z&&!T,re="draw"===z?0===N.length:0===U.trim().length,oe=useRef(null);useEffect(()=>{oe.current!==re&&(oe.current=re,ne.current.onEmptyChange?.(re))},[re]);const se=useCallback(e=>{O.current=e,B(e)},[]),ie=useCallback(()=>{K(Date.now()),ne.current.onChange?.(O.current.map(e=>e.points))},[]),le=useMemo(()=>{const pan=e=>({enabled:ae,runOnJS:!0,onBegin:e=>{V.current=pointOf(e.x,e.y)},onActivate:t=>{$.current=e,H.current+=1;const n=pointOf(t.x,t.y);se([...O.current,{id:H.current,points:[V.current??n,n]}])},onUpdate:t=>{if($.current!==e)return;const n=O.current[O.current.length-1];if(void 0===n)throw new Error("The stroke being drawn is missing.");const a=pointOf(t.x,t.y),r=n.points[n.points.length-1];if(void 0===r)throw new Error("A drawn stroke has no points.");distanceBetween(r,a)<.8||se([...O.current.slice(0,-1),{...n,points:[...n.points,a]}])},onFinalize:()=>{$.current===e&&($.current=null,ie())}});return{sidewaysConfig:{...pan("sideways"),activeOffsetX:[-6,6],failOffsetY:[-8,8]},restedConfig:{...pan("rested"),activateAfterLongPress:200}}},[ae,se,ie]),de=usePanGesture(le.sidewaysConfig),ce=usePanGesture(le.restedConfig),ue=useCompetingGestures(de,ce),pe=useCallback(e=>{W(e),ne.current.onModeChange?.(e),announce("type"===e?k.typingAnnouncement:k.drawingAnnouncement)},[k.typingAnnouncement,k.drawingAnnouncement]);useEffect(()=>{D&&c&&!q.current&&"draw"===z&&0===O.current.length&&pe("type")},[D,c,z,pe]);const me=useCallback(()=>{q.current=!0,pe("draw"===z?"type":"draw")},[z,pe]),he=useCallback(e=>{Y(e),K(Date.now()),ne.current.onTypedNameChange?.(e)},[]),ge=useCallback(()=>{"type"===z?he(""):(se([]),ie()),announce(k.clearedAnnouncement)},[z,he,se,ie,k.clearedAnnouncement]),fe=useCallback(()=>{"draw"===z&&0!==O.current.length&&(se(O.current.slice(0,-1)),ie(),announce(k.undoneAnnouncement))},[z,se,ie,k.undoneAnnouncement]),ye=useCallback(()=>{te(O.current.map(e=>e.points)),Z(!0)},[]),xe=useCallback(()=>{Z(!1)},[]),Se=useCallback(()=>{se(ee.map(e=>(H.current+=1,{id:H.current,points:[...e]}))),ie(),Z(!1)},[ee,se,ie]),Te=F||FALLBACK_WIDTH;useImperativeHandle(t,()=>({toFile:()=>new Promise((e,t)=>{if(re)return void t(new Error(k.emptyError));const n=j?M.current:L.current;if(!n)return void t(new Error("The signature pad is not on screen."));const a=Math.min(3,Math.max(1,PixelRatio.get()));n.toDataURL(n=>{writePng(n).then(e,t)},{width:Te*a,height:m*a})}),toSvg:()=>buildSignatureSvg({width:Te,height:m,mode:z,strokes:N.map(e=>e.points),typedName:U,ink:v,paper:R,strokeWidth:2.5,fontFamily:cssFontStack(I)}),clear:ge,undo:fe,isEmpty:()=>re}),[re,k.emptyError,Te,m,z,N,U,j,v,R,I,ge,fe]);const be=useMemo(()=>[{name:"undo",label:k.undo},{name:"clear",label:k.clear},...c?[{name:"toggleMode",label:"draw"===z?k.typeInstead:k.drawInstead}]:[]],[k.undo,k.clear,k.typeInstead,k.drawInstead,c,z]),we=useCallback(e=>{if(T)return;const{actionName:t}=e.nativeEvent;"undo"===t?fe():"clear"===t?ge():"toggleMode"===t&&c&&me()},[T,fe,ge,me,c]),Ee=useCallback(e=>{G(e.nativeEvent.layout.width)},[]),Ce=useMemo(()=>StyleSheet.create({root:{gap:w.space.sm},pad:{height:m,borderWidth:w.size.border,borderColor:w.colors.border,borderRadius:w.radius.md,...smoothCorners,overflow:"hidden",backgroundColor:A,opacity:T?.5:1},baseline:{position:"absolute",left:w.space.md,right:w.space.md,top:m*BASELINE_RATIO,height:StyleSheet.hairlineWidth,backgroundColor:C,opacity:.3},actions:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:w.space.xs},trailing:{flexDirection:"row",alignItems:"center",gap:w.space.xs},expandedRoot:{flex:1,padding:w.space.md,gap:w.space.sm,backgroundColor:w.colors.bg},expandedBar:{flexDirection:"row",alignItems:"center",justifyContent:"space-between"}}),[w,m,A,C,T]),Ae=U.trim(),ve=p??X,Re=u&&!re?`Signed by ${u}${ve?`, ${formatDateTime(ve)}`:""}`:null,je="type"===z&&Ae?`${k.pad}. ${Ae}`:k.pad;return _jsxs(View,{style:[Ce.root,b],testID:_,children:[_jsx(GestureDetector,{gesture:ue,children:_jsxs(View,{style:Ce.pad,onLayout:Ee,accessible:!0,accessibilityRole:"image",accessibilityLabel:je,accessibilityHint:"draw"===z?k.padHint:void 0,accessibilityValue:{text:re?k.empty:k.signed},accessibilityState:{disabled:T},"aria-disabled":T,accessibilityActions:be,onAccessibilityAction:we,children:[j?_jsxs(Svg,{ref:M,style:StyleSheet.absoluteFill,width:"100%",height:m,children:[_jsx(Rect,{x:"0",y:"0",width:"100%",height:"100%",fill:R}),_jsx(Marks,{mode:z,strokes:N,name:Ae,color:v,fontFamily:I,width:Te,height:m})]}):null,_jsxs(Svg,{ref:L,width:"100%",height:m,children:[_jsx(Rect,{x:"0",y:"0",width:"100%",height:"100%",fill:A}),_jsx(Marks,{mode:z,strokes:N,name:Ae,color:C,fontFamily:I,width:Te,height:m})]}),_jsx(View,{pointerEvents:"none",style:Ce.baseline})]})}),"type"===z?_jsx(Input,{label:k.typedLabel,placeholder:k.typedPlaceholder,value:U,onChangeText:he,maxLength:h,disabled:T,autoComplete:"name",textContentType:"name",autoCapitalize:"words",autoCorrect:!1,returnKeyType:"done",testID:_?`${_}-name`:void 0}):null,_jsx(Text,{variant:"caption",color:"tertiary",children:"draw"===z?k.caption:k.typedCaption}),_jsxs(View,{style:Ce.actions,children:[c?_jsx(Button,{label:"draw"===z?k.typeInstead:k.drawInstead,variant:"ghost",tone:"primary",size:"md",style:TARGET_STYLE,haptic:S,disabled:T,onPress:me,testID:_?`${_}-mode`:void 0}):_jsx(View,{}),"draw"===z?_jsxs(View,{style:Ce.trailing,children:[N.length>0?_jsxs(_Fragment,{children:[_jsx(Button,{label:k.undo,variant:"ghost",tone:"primary",size:"md",style:TARGET_STYLE,haptic:S,disabled:T,onPress:fe,testID:_?`${_}-undo`:void 0}),_jsx(Button,{label:k.clear,variant:"ghost",tone:"primary",size:"md",style:TARGET_STYLE,haptic:S,disabled:T,onPress:ge,testID:_?`${_}-clear`:void 0})]}):null,n?_jsx(Button,{label:k.expand,variant:"ghost",tone:"primary",size:"md",style:TARGET_STYLE,haptic:S,disabled:T,onPress:ye,testID:_?`${_}-expand`:void 0}):null]}):null,"type"===z&&Ae?_jsx(Button,{label:k.clear,variant:"ghost",tone:"primary",size:"md",style:TARGET_STYLE,haptic:S,disabled:T,onPress:ge,testID:_?`${_}-clear`:void 0}):null]}),Re?_jsx(Text,{variant:"caption",color:"secondary",children:Re}):null,n?_jsx(Modal,{visible:Q,animationType:"slide",presentationStyle:"fullScreen",onRequestClose:xe,children:_jsxs(ExpandedRoot,{style:Ce.expandedRoot,children:[_jsxs(View,{style:Ce.expandedBar,children:[_jsx(Button,{label:k.close,variant:"ghost",tone:"primary",size:"md",style:TARGET_STYLE,haptic:S,onPress:xe,testID:_?`${_}-close`:void 0}),_jsx(Button,{label:k.done,variant:"solid",tone:"primary",size:"md",style:TARGET_STYLE,haptic:S,onPress:Se,testID:_?`${_}-done`:void 0})]}),Q?_jsx(SignaturePadSurface,{expandable:!1,defaultMode:"draw",allowTyped:!1,initialStrokes:ee,onChange:te,height:Math.max(DEFAULT_HEIGHT,J-200),inkColor:g,paperColor:f,scriptFontFamily:y,labels:x,haptic:S,testID:_?`${_}-expanded`:void 0}):null]})}):null]})});SignaturePadSurface.displayName="SignaturePadSurface";const ExpandedRoot="android"===Platform.OS?GestureHandlerRootView:View,SignaturePad=forwardRef((e,t)=>_jsx(SignaturePadSurface,{...e,expandable:!0,ref:t}));SignaturePad.displayName="SignaturePad";export{SignaturePad};export default SignaturePad;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";export{
|
|
1
|
+
"use strict";export{SignaturePad}from"./SignaturePad.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{useMemo,useState}from"react";import{Animated,StyleSheet,View}from"react-native";import{useReducedMotion}from"../../hooks/useReducedMotion.js";import{useTheme}from"../../theme/index.js";import{toBackgroundImage}from"../../theme/Gradient.js";import{useScreenDimensions}from"../../utils/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{smoothCorners}from"../../utils/corners.js";import{useSkeletonClock}from"./SkeletonClock.js";import{useSkeletonDefaults}from"./SkeletonProvider.js";import{jsx as _jsx}from"react/jsx-runtime";
|
|
1
|
+
"use strict";import{useMemo,useState}from"react";import{Animated,StyleSheet,View}from"react-native";import{useReducedMotion}from"../../hooks/useReducedMotion.js";import{useMobileUiText}from"../../text/index.js";import{SKELETON_TEXT}from"../../text/phone/skeleton.g.js";import{useTheme}from"../../theme/index.js";import{toBackgroundImage}from"../../theme/Gradient.js";import{useScreenDimensions}from"../../utils/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{smoothCorners}from"../../utils/corners.js";import{useSkeletonClock}from"./SkeletonClock.js";import{useSkeletonDefaults}from"./SkeletonProvider.js";import{jsx as _jsx}from"react/jsx-runtime";const resolveRadius=(e,t)=>"number"==typeof t?t:e.radius[t],resolveWidth=e=>void 0===e?"100%":e,radiusForShape=(e,t,s,o,i)=>{if(void 0!==i)return resolveRadius(e,i);switch(t){case"circle":return"number"==typeof s?Math.min(s,o)/2:o/2;case"rounded":return e.radius.md;default:return e.radius.sm}},Skeleton=e=>{const{shape:t="rect",width:s="100%",height:o=16,radius:i,variant:r,colors:n,labels:a,style:l,testID:u}=e;assertValidValue("Skeleton","shape",e.shape,["rect","rounded","circle","text"]),assertValidValue("Skeleton","variant",e.variant,["shimmer","pulse","none"]);const m=useTheme(),d=useSkeletonDefaults(),c=useSkeletonClock(),h=useReducedMotion(),p=r??d.variant??"shimmer",S=h&&"auto"===(d.animation??"auto");let k=p;c.enabled?S&&"shimmer"===p&&(k="pulse"):k="none";const x=n?.background??d.colors?.background??m.colors.skeleton,y=n?.highlight??d.colors?.highlight??m.colors["skeleton-highlight"],{responsive:b}=useScreenDimensions(),g=useMemo(()=>buildStyles(),[]),f=useMobileUiText("skeleton",SKELETON_TEXT),v=useMemo(()=>({...f,...a}),[f,a]),j=resolveWidth(s),M=b.size(o),T=radiusForShape(m,t,j,M,i),[w,V]=useState(0),R=useMemo(()=>w<=0?0:Math.max(48,.7*w),[w]),C=useMemo(()=>w<=0?0:c.shimmer.interpolate({inputRange:[0,1],outputRange:[-R,w]}),[c.shimmer,R,w]),_=useMemo(()=>"none"===k?null:"pulse"===k?_jsx(Animated.View,{pointerEvents:"none",style:[StyleSheet.absoluteFill,{backgroundColor:y,opacity:c.pulse.interpolate({inputRange:[0,1],outputRange:[0,.55]})}]}):w<=0?null:_jsx(Animated.View,{pointerEvents:"none",style:[g.shimmerBand,{width:R,transform:[{translateX:C}],experimental_backgroundImage:[toBackgroundImage({colors:["transparent",y,"transparent"],locations:[0,.5,1],start:{x:0,y:.5},end:{x:1,y:.5}})]}]}),[k,y,c.pulse,w,g.shimmerBand,R,C]);return _jsx(View,{onLayout:e=>{const t=e.nativeEvent.layout.width;t!==w&&V(t)},accessible:!0,accessibilityLabel:v.loading,accessibilityRole:"progressbar",accessibilityState:{busy:!0},"aria-busy":!0,accessibilityLiveRegion:"polite",testID:u,style:[g.base,{width:j,height:M,borderRadius:T,...smoothCorners,backgroundColor:x},l],children:_})};Skeleton.displayName="Skeleton";const SkeletonCircle=({size:e,style:t,...s})=>{const{responsive:o}=useScreenDimensions(),i=o.size(e);return _jsx(Skeleton,{...s,shape:"circle",width:i,height:e,style:t})};SkeletonCircle.displayName="SkeletonCircle";const SkeletonText=({lines:e=3,lastLineWidth:t="60%",spacing:s,fontSize:o,variant:i,radius:r="sm",width:n="100%",labels:a,style:l,testID:u})=>{const m=useTheme(),d=s??m.space.xs,c=Math.max(1,e),h=useMemo(()=>Array.from({length:c},(e,t)=>({key:`sk-text-line-${t}`,index:t})),[c]);return _jsx(View,{style:l,testID:u,children:h.map(e=>{const s=e.index===c-1;return _jsx(Skeleton,{shape:"text",width:s&&c>1?t:n,height:o??m.text.base.size,radius:r,variant:i,labels:a,style:e.index<c-1?{marginBottom:d}:void 0},e.key)})})};SkeletonText.displayName="SkeletonText";const buildStyles=()=>StyleSheet.create({base:{overflow:"hidden"},shimmerBand:{position:"absolute",top:0,bottom:0,left:0}});export{Skeleton,SkeletonCircle,SkeletonText};export default Skeleton;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import React,{Children,cloneElement,isValidElement,useEffect,useMemo,useRef}from"react";import{Animated,Image,StyleSheet,Text,View}from"react-native";import{usePresenceMotion}from"../../hooks/usePresenceMotion.js";import{createAnimatedValue,useTheme}from"../../theme/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{isRecord}from"../../utils/guards.js";import{nativeDriver}from"../../utils/nativeDriver.js";import{Text as LibraryText}from"../Text/index.js";import{
|
|
1
|
+
"use strict";import React,{Children,cloneElement,isValidElement,useEffect,useMemo,useRef}from"react";import{Animated,Image,StyleSheet,Text,View}from"react-native";import{usePresenceMotion}from"../../hooks/usePresenceMotion.js";import{useMobileUiText}from"../../text/index.js";import{SKELETON_TEXT}from"../../text/phone/skeleton.g.js";import{createAnimatedValue,useTheme}from"../../theme/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{isRecord}from"../../utils/guards.js";import{nativeDriver}from"../../utils/nativeDriver.js";import{Text as LibraryText}from"../Text/index.js";import{Skeleton}from"./Skeleton.js";import{useSkeletonDefaults}from"./SkeletonProvider.js";import{SkeletonSkip}from"./SkeletonSkip.js";import{jsx as _jsx,Fragment as _Fragment}from"react/jsx-runtime";const DEFAULT_REVEAL_FADE_MS=300,flattenStyle=e=>({...StyleSheet.flatten(e)}),isWidthText=e=>"auto"===e||"100%"===e||/^\d+(\.\d+)?%$/.test(e),isComponentType=e=>"function"==typeof e||isRecord(e),resolveWidth=(e,t)=>"number"==typeof e||"string"==typeof e&&isWidthText(e)?e:t,resolveRadius=(e,t)=>"number"==typeof e?e:t,skeletonizeNode=(e,t,i,r,s="r")=>{if(null==t||"boolean"==typeof t)return null;if("string"==typeof t||"number"==typeof t)return _jsx(Skeleton,{shape:"text",width:"60%",height:14,variant:i,colors:r},`${s}-text`);if(Array.isArray(t))return Children.map(t,(t,n)=>skeletonizeNode(e,t,i,r,`${s}-${n}`));if(!isValidElement(t))return null;const n=t,o=n.props??{},l=n.type;if(l===SkeletonSkip)return cloneElement(n,{key:`${s}-skip`});if(("function"==typeof l||"object"==typeof l)&&"Skeleton"in l&&isComponentType(l.Skeleton)){const e=l.Skeleton;return _jsx(e,{...o},`${s}-self`)}if(l===Image){const e=flattenStyle(o.style),t=resolveWidth(e.width,"100%"),n="number"==typeof e.height?e.height:120,l=resolveRadius(e.borderRadius,"sm");return _jsx(Skeleton,{width:t,height:n,radius:l,variant:i,colors:r,style:{margin:"number"==typeof e.margin?e.margin:void 0}},`${s}-img`)}if(l===Text||l===LibraryText){const t=flattenStyle(o.style),n="number"==typeof t.fontSize?t.fontSize:e.text.base.size,l=resolveWidth(t.width,"85%");return _jsx(Skeleton,{shape:"text",width:l,height:Math.round(1.15*n),variant:i,colors:r,style:{marginVertical:e.space.xxs}},`${s}-txt`)}if(null!=o.children)return cloneElement(n,{key:`${s}-w`},skeletonizeNode(e,o.children,i,r,`${s}-c`));if(l===View){const e=flattenStyle(o.style);if(null!=e.width||null!=e.height){const t=resolveWidth(e.width,"100%"),n="number"==typeof e.height?e.height:20,o=resolveRadius(e.borderRadius,"sm");return _jsx(Skeleton,{width:t,height:n,radius:o,variant:i,colors:r},`${s}-vw`)}}return cloneElement(n,{key:`${s}-leaf`})},SkeletonContent=e=>{const{loading:t,children:i,placeholder:r,variant:s,count:n=1,colors:o,labels:l,fadeDuration:a,style:u,testID:c}=e;assertValidValue("SkeletonContent","variant",e.variant,["shimmer","pulse","none"]);const m=useTheme(),d=useMobileUiText("skeleton",SKELETON_TEXT),f=useMemo(()=>({...d,...l}),[d,l]),h=useMemo(()=>Array.from({length:n},(e,t)=>({key:`sk-slot-${t}`})),[n]),p=useSkeletonDefaults(),y=usePresenceMotion(),k=a??p.fadeDuration??(y.reduced?y.duration("default"):300),S=useRef(t),x=useRef(createAnimatedValue(t?0:1)).current;if(useEffect(()=>{let e;return S.current&&!t?(x.setValue(0),e=Animated.timing(x,{toValue:1,duration:k,useNativeDriver:nativeDriver}),e.start()):!S.current&&t&&x.setValue(1),S.current=t,()=>e?.stop()},[t,x,k]),!t)return k<=0?_jsx(_Fragment,{children:i}):_jsx(Animated.View,{style:[u,{opacity:x}],testID:c,children:i});if(void 0!==r){const e=n>1?h.map(e=>_jsx(React.Fragment,{children:r},e.key)):r;return _jsx(View,{style:u,testID:c,accessible:!0,accessibilityLabel:f.loading,accessibilityRole:"progressbar",accessibilityState:{busy:!0},"aria-busy":!0,accessibilityLiveRegion:"polite",children:e})}const b=n>1?h.map(e=>_jsx(React.Fragment,{children:i},e.key)):i;return _jsx(View,{style:u,testID:c,accessible:!0,accessibilityLabel:f.loading,accessibilityRole:"progressbar",accessibilityState:{busy:!0},"aria-busy":!0,accessibilityLiveRegion:"polite",children:skeletonizeNode(m,b,s,o)})};SkeletonContent.displayName="SkeletonContent";export{SkeletonContent};export default SkeletonContent;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";export{
|
|
1
|
+
"use strict";export{default,Skeleton,SkeletonCircle,SkeletonText}from"./Skeleton.js";export{SkeletonClockProvider,useSkeletonClock}from"./SkeletonClock.js";export{SkeletonContent}from"./SkeletonContent.js";export{SkeletonList}from"./SkeletonList.js";export{SkeletonProvider,useSkeletonDefaults}from"./SkeletonProvider.js";export{SkeletonSkip}from"./SkeletonSkip.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import React,{forwardRef,useCallback,useMemo,useRef,useState}from"react";import{StyleSheet,View}from"react-native";import{GestureDetector,usePanGesture}from"react-native-gesture-handler";import Animated,{cancelAnimation,Easing,useAnimatedStyle,useSharedValue,withSpring,withTiming}from"react-native-reanimated";import{scheduleOnRN}from"react-native-worklets";import{useTheme}from"../../theme/index.js";import{resolveHaptic,triggerHaptic}from"../../utils/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{smoothCorners}from"../../utils/corners.js";import{Text}from"../Text/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";
|
|
1
|
+
"use strict";import React,{forwardRef,useCallback,useMemo,useRef,useState}from"react";import{StyleSheet,View}from"react-native";import{GestureDetector,usePanGesture}from"react-native-gesture-handler";import Animated,{cancelAnimation,Easing,useAnimatedStyle,useSharedValue,withSpring,withTiming}from"react-native-reanimated";import{scheduleOnRN}from"react-native-worklets";import{useMobileUiText}from"../../text/index.js";import{SLIDE_TO_CONFIRM_TEXT}from"../../text/phone/slideToConfirm.g.js";import{useTheme}from"../../theme/index.js";import{resolveHaptic,triggerHaptic}from"../../utils/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{smoothCorners}from"../../utils/corners.js";import{Text}from"../Text/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const SIZE_MAP={sm:{height:44,pad:"xxs"},md:{height:56,pad:"xs"},lg:{height:64,pad:"sm"}},Chevron=({color:e,size:t})=>_jsx(View,{style:{width:0,height:0,borderTopWidth:.4*t,borderBottomWidth:.4*t,borderLeftWidth:.55*t,borderTopColor:"transparent",borderBottomColor:"transparent",borderLeftColor:e,marginLeft:.2*t}}),SlideToConfirm=forwardRef((e,t)=>{const{onConfirm:i,label:a,tone:r="primary",size:o="md",disabled:s=!1,threshold:n=.9,resetAfter:l=!1,haptic:u,icon:c,labels:d,style:m,trackStyle:h,handleStyle:f,labelStyle:p,testID:b}=e;assertValidValue("SlideToConfirm","tone",e.tone,["primary","success","warning","danger","info","neutral"]),assertValidValue("SlideToConfirm","size",e.size,["sm","md","lg"]);const g=useMobileUiText("slideToConfirm",SLIDE_TO_CONFIRM_TEXT),v=useMemo(()=>({...g,...d}),[g,d]),S=useMemo(()=>[{name:"activate",label:v.confirmAction},{name:"increment",label:v.confirmAction}],[v.confirmAction]),x=useTheme(),y=SIZE_MAP[o],C=x.space[y.pad],T=y.height-2*C,w=useMemo(()=>buildStyles(x,y),[x,y]),j=x.colors[r],[A,V]=useState(!1),_=useSharedValue(0),k=useSharedValue(0),M=useSharedValue(0),E=useRef(null),R=useCallback(()=>{const e=resolveHaptic(u,"notificationSuccess");e&&triggerHaptic(e)},[u]),I=useCallback(()=>{V(!1),_.value=withSpring(0,{damping:18,stiffness:160,mass:1})},[_]),D=useCallback(()=>{V(!0),R(),i(),!1!==l&&(E.current&&clearTimeout(E.current),E.current=setTimeout(I,l))},[R,i,l,I]),L=useCallback(e=>{if(s||A)return;const{actionName:t}=e.nativeEvent;"activate"!==t&&"increment"!==t||D()},[s,A,D]);React.useEffect(()=>()=>{cancelAnimation(_),E.current&&clearTimeout(E.current)},[_]);const O=useCallback(e=>{k.value=Math.max(0,e.nativeEvent.layout.width-T-2*C)},[k,T,C]),N=useMemo(()=>{const e=n,t={damping:18,stiffness:160,mass:1},i={duration:x.motion.duration.fast,easing:Easing.out(Easing.cubic)};return{enabled:!s&&!A,minDistance:0,onActivate:()=>{"worklet";M.value=_.value},onUpdate:e=>{"worklet";_.value=Math.min(Math.max(M.value+e.translationX,0),k.value)},onDeactivate:()=>{"worklet";k.value>0&&_.value>=k.value*e?(_.value=withTiming(k.value,i),scheduleOnRN(D)):_.value=withSpring(0,t)}}},[s,A,n,_,k,M,D,x.motion.duration.fast]),z=usePanGesture(N),P=useAnimatedStyle(()=>({transform:[{translateX:_.value}]}),[_]),W=useAnimatedStyle(()=>({width:_.value+T+C}),[_,T,C]),G=useAnimatedStyle(()=>{const e=k.value>0?k.value:1;return{opacity:Math.max(0,1-_.value/(.6*e))}},[k,_]);return _jsxs(View,{ref:t,style:[w.track,{backgroundColor:x.colors["bg-subtle"]},h,m],onLayout:O,testID:b,accessibilityRole:"adjustable",accessibilityLabel:A?v.confirmed:a??v.slide,accessibilityState:{disabled:s},"aria-disabled":s,accessibilityActions:S,onAccessibilityAction:L,children:[_jsx(Animated.View,{style:[w.fill,{backgroundColor:j,opacity:s?.5:1},W],pointerEvents:"none"}),_jsx(Animated.View,{style:[w.labelWrap,G],pointerEvents:"none",children:_jsx(Text,{variant:"body",style:[w.label,{color:x.colors["text-muted"]},p],numberOfLines:1,children:A?v.confirmed:a??v.slide})}),_jsx(GestureDetector,{gesture:z,children:_jsx(Animated.View,{style:[w.handle,{width:T,height:T,borderRadius:x.radius.pill,...smoothCorners,backgroundColor:x.colors.surface,opacity:s?.5:1,...x.shadow.card},f,P],children:c??_jsx(Chevron,{color:j,size:.5*T})})})]})});SlideToConfirm.displayName="SlideToConfirm";const buildStyles=(e,t)=>StyleSheet.create({track:{height:t.height,borderRadius:e.radius.pill,...smoothCorners,justifyContent:"center",overflow:"hidden",padding:e.space[t.pad]},fill:{position:"absolute",left:0,top:0,bottom:0,borderRadius:e.radius.pill,...smoothCorners},labelWrap:{position:"absolute",left:t.height,right:t.height},label:{textAlign:"center",includeFontPadding:!1},handle:{alignItems:"center",justifyContent:"center"}});export{SlideToConfirm};export default SlideToConfirm;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";export{
|
|
1
|
+
"use strict";export{SlideToConfirm}from"./SlideToConfirm.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{forwardRef,useCallback,useEffect,useMemo,useRef,useState}from"react";import{Platform,Pressable,StyleSheet,View}from"react-native";import{GestureDetector,usePanGesture}from"react-native-gesture-handler";import Animated,{cancelAnimation,Easing,useAnimatedStyle,useSharedValue,withSpring,withTiming}from"react-native-reanimated";import{scheduleOnRN}from"react-native-worklets";import{useControllableState}from"../../hooks/index.js";import{resolveSliderSize,useTheme}from"../../theme/index.js";import{resolveHaptic,triggerHaptic}from"../../utils/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{smoothCorners}from"../../utils/corners.js";import{Text}from"../Text/index.js";import{sliderToneInk}from"./valueText.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const VARIANT_SIZE_MAP={inset:{sm:{trackHeight:14,thumbDiameter:10},md:{trackHeight:20,thumbDiameter:14},lg:{trackHeight:26,thumbDiameter:18}},minimal:{sm:{trackHeight:2,thumbDiameter:14},md:{trackHeight:3,thumbDiameter:18},lg:{trackHeight:4,thumbDiameter:22}},bar:{sm:{trackHeight:20,thumbDiameter:20},md:{trackHeight:28,thumbDiameter:28},lg:{trackHeight:36,thumbDiameter:36}}},INSET_RING_RATIO=.3,MIN_THUMB_TOUCH=44,clamp=(e,t,a)=>Math.min(Math.max(e,t),a),snapToStep=(e,t,a,i)=>{if(i<=0)return clamp(e,t,a);const r=Math.round((e-t)/i)*i+t,s=String(i).split(".")[1]?.length??0,n=s>0?Number(r.toFixed(s)):r;return clamp(n,t,a)},BUBBLE_GAP=2,BUBBLE_CARET=8,BUBBLE_WRAP_WIDTH=160,NO_SHADOW={shadowOpacity:0,elevation:0},defaultFormatLabel=e=>String(e),isPair=e=>Array.isArray(e),Slider=forwardRef((e,t)=>{const{min:a=0,max:i=100,step:r=1,disabled:s=!1,tone:n="primary",size:o="md",variant:l="default",showLabel:u=!1,snapThumb:c=!1,formatLabel:d=defaultFormatLabel,renderLabel:m,accessibilityLabel:h,haptic:b,style:g,containerStyle:p,trackStyle:f,fillStyle:v,thumbStyle:w,labelStyle:y,thumbPressScale:S,labelShowDuration:k,labelOpacity:C,testID:x}=e;assertValidValue("Slider","tone",e.tone,["primary","success","warning","danger","info","neutral"]),assertValidValue("Slider","size",e.size,["sm","md","lg"]),assertValidValue("Slider","variant",e.variant,["default","inset","minimal","bar"]);const A=useTheme(),V=useMemo(()=>{const e=resolveSliderSize(A,o);return{trackHeight:e["track-height"],thumbDiameter:e["thumb-diameter"]}},[A,o]),D=useMemo(()=>"default"===l?V:VARIANT_SIZE_MAP[l][o],[V,o,l]),j="inset"===l?D.trackHeight/2:0,M=A.settings.components.slider?.thumbPressAnimation??!1,_=S??1.1,R=k??A.motion.duration.fast,H=C??1,E=useMemo(()=>buildStyles(A,D),[A,D]),O=useMemo(()=>({damping:A.motion.spring.snappy.damping,stiffness:A.motion.spring.snappy.stiffness,mass:A.motion.spring.snappy.mass}),[A.motion.spring.snappy]),[T,I]=useState(0),P=A.colors[n],N=sliderToneInk(A,n),W=!0===e.range,L=useCallback(t=>{if(!0!==e.range){if(Array.isArray(t))throw new Error("Slider received a range value in single mode.");e.onChange?.(t)}else{if(!Array.isArray(t))throw new Error("Slider received a single value in range mode.");e.onChange?.(t)}},[e.onChange,e.range]),[X,B]=useControllableState({value:e.value,defaultValue:e.defaultValue??(W?[a,i]:a),onChange:L}),F=useSharedValue(0),G=useSharedValue(0),z=useSharedValue(isPair(X)?X[0]:X),$=useSharedValue(isPair(X)?X[1]:X),U=useSharedValue(0),Z=useSharedValue(0),J=useSharedValue(1),q=useSharedValue(1),K="always"===u,Q=useSharedValue(K?1:0),Y=useSharedValue(K?1:0),ee=useMemo(()=>10**(String(r).split(".")[1]?.length??0),[r]);useEffect(()=>()=>{cancelAnimation(F),cancelAnimation(G),cancelAnimation(J),cancelAnimation(q),cancelAnimation(Q),cancelAnimation(Y)},[F,G,J,q,Q,Y]);const te=useCallback((e,t)=>{const r=t-2*j;return i===a||r<=0?j:j+(e-a)/(i-a)*r},[a,i,j]),ae=useCallback((e,t)=>{const s=t-2*j;if(s<=0)return a;const n=clamp((e-j)/s,0,1);return snapToStep(a+n*(i-a),a,i,r)},[a,i,r,j]),ie=useRef(!1),re=A.motion.duration.fast,se=useRef(X);se.current=X;const ne=useRef(T);ne.current=T;const oe=useCallback((e=!1)=>{const t=ne.current;if(t<=0)return;const place=t=>e?withTiming(t,{duration:re,easing:Easing.out(Easing.cubic)}):t,a=se.current;if(isPair(a)){const[e,i]=a,r=Math.min(e,i),s=Math.max(e,i);z.value=r,$.value=s,F.value=place(te(r,t)),G.value=place(te(s,t))}else{const e=a;z.value=e,$.value=e,F.value=place(te(e,t))}},[te,z,$,F,G,re]),[le,ue]=useState(0),ce=useRef(!1),de=useCallback(e=>{ie.current=e,e||(ce.current=!0,ue(e=>e+1))},[]);useEffect(()=>{if(ie.current)return;const e=ce.current;ce.current=!1,oe(e)},[JSON.stringify(X),T,le,oe]);const me=useCallback(e=>{const t=e.nativeEvent.layout.width;Z.value=t,I(t)},[Z]),he=useCallback((e,t)=>{B(W?[e,t]:e)},[W,B]),be=useCallback(()=>{const e=resolveHaptic(b,"selection");e&&triggerHaptic(e)},[b]),ge=useRef(he);ge.current=he;const pe=useRef(be);pe.current=be;const fe=useCallback((e,t)=>ge.current(e,t),[]),ve=useCallback(()=>pe.current(),[]),we=Math.max(0,(44-D.thumbDiameter)/2),ye=we>0?we:void 0,Se=useCallback(e=>{const t="low"===e?F:G,n="low"===e?z:$,o="low"===e?$:z,l="low"===e?J:q,d="low"===e?Q:Y,m="low"===e,h=a,b=i,g=r,p=ee,f=W,v=_,w=M,y=!0===u,S=c,k=H,C=R,A=O,V=j,D=m&&x?`${x}-pan`:void 0,follow=e=>{"worklet";const a=Z.value-2*V;if(a<=0||!Number.isFinite(e))return;const i=Math.min(Math.max(U.value+e,V),Z.value-V);let r=h+(i-V)/a*(b-h);g>0&&(r=Math.round((r-h)/g)*g+h,r=Math.round(r*p)/p),r=Math.min(Math.max(r,h),b),f&&(m&&r>o.value&&(r=o.value),!m&&r<o.value&&(r=o.value)),t.value=S||b===h?b===h?V:V+(r-h)/(b-h)*a:f?m?Math.min(i,G.value):Math.max(i,F.value):i,r!==n.value&&(n.value=r,r!==h&&r!==b||scheduleOnRN(ve),scheduleOnRN(fe,z.value,$.value))};return{enabled:!s,minDistance:0,testID:D,...void 0===ye?{}:{hitSlop:ye},onActivate:()=>{"worklet";scheduleOnRN(de,!0),U.value=t.value,w&&(l.value=withSpring(v,A)),y&&(d.value=withTiming(k,{duration:C,easing:Easing.out(Easing.cubic)})),scheduleOnRN(ve)},onUpdate:e=>{"worklet";follow(e.translationX)},onDeactivate:e=>{"worklet";follow(e.translationX),w&&(l.value=withSpring(1,A)),y&&(d.value=withTiming(0,{duration:C,easing:Easing.out(Easing.cubic)}))},onFinalize:()=>{"worklet";scheduleOnRN(de,!1)}}},[s,a,i,r,ee,W,_,M,u,c,H,R,O,j,ye,x,fe,ve,de,F,G,z,$,J,q,Q,Y,U,Z]),ke=useMemo(()=>Se("low"),[Se]),Ce=useMemo(()=>Se("high"),[Se]),xe=usePanGesture(ke),Ae=usePanGesture(Ce),Ve=useCallback(e=>{if(s||W||T<=0)return;const t=clamp(e.nativeEvent.locationX,0,T),a=ae(t,T);a!==z.value&&(be(),z.value=a,F.value=withTiming(te(a,T),{duration:A.motion.duration.fast,easing:Easing.out(Easing.cubic)}),he(a,a))},[s,W,T,ae,te,he,be,F,z,A.motion.duration.fast]),De=useCallback(e=>{if(s)return;const t="increment"===e.nativeEvent.actionName?r:-r,n=r>0?Math.round(t*ee)/ee:t;if(W){const e=Math.round((z.value+n)*ee)/ee,t=clamp(e,a,$.value);t!==z.value&&(z.value=t,F.value=te(t,T),be(),he(t,$.value))}else{const e=Math.round((z.value+n)*ee)/ee,t=clamp(e,a,i);t!==z.value&&(z.value=t,F.value=te(t,T),be(),he(t,t))}},[s,r,ee,W,a,i,te,T,F,z,$,he,be]),je=D.thumbDiameter/2,Me=s?A.colors["surface-disabled"]:P,Re="inset"===l?{backgroundColor:Me,borderColor:A.colors.surface,borderWidth:Math.max(2,Math.round(.3*D.thumbDiameter)),...NO_SHADOW}:"minimal"===l?{backgroundColor:Me,borderWidth:0}:"bar"===l?{backgroundColor:"transparent",borderWidth:0,...NO_SHADOW}:{backgroundColor:A.colors.surface,borderColor:Me},He=useAnimatedStyle(()=>{const e=Z.value;if(e<=0)return{opacity:0,transform:[{translateX:0},{scaleX:1}]};const t=s?.55:1;if(W){const a=Math.max(0,G.value-F.value+2*j);return{opacity:t,transform:[{translateX:F.value-j},{scaleX:a/e}]}}return{opacity:t,transform:[{translateX:F.value+j-e},{scaleX:1}]}},[Z,s,W,G,F,j]),Ee=useAnimatedStyle(()=>({transform:[{translateX:F.value-je},{scale:J.value}]}),[F,je,J]),Oe=useAnimatedStyle(()=>({transform:[{translateX:G.value-je},{scale:q.value}]}),[G,je,q]),Te=useAnimatedStyle(()=>({opacity:Q.value}),[Q]),Ie=useAnimatedStyle(()=>({opacity:Y.value}),[Y]),clampDisplay=e=>clamp(e,a,i),Pe=clampDisplay(isPair(X)?Math.min(...X):X),Ne=clampDisplay(isPair(X)?Math.max(...X):X);return _jsx(View,{ref:t,style:[E.container,p,g],testID:x,accessibilityRole:"adjustable",accessibilityLabel:h,accessibilityState:{disabled:s},"aria-disabled":s,accessibilityValue:W?{min:a,max:i,now:Pe,text:`${Pe} to ${Ne}`}:{min:a,max:i,now:Pe},accessibilityActions:[{name:"increment"},{name:"decrement"}],onAccessibilityAction:De,children:_jsx(Pressable,{onPress:Ve,disabled:s||W,style:E.trackTouch,testID:x?`${x}-track-press`:void 0,accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants",children:_jsxs(View,{style:E.trackWrap,onLayout:me,testID:x?`${x}-track`:void 0,children:[_jsxs(View,{style:E.trackClip,pointerEvents:"none",children:[_jsx(View,{style:[E.track,{backgroundColor:s?A.colors["surface-disabled"]:A.colors.border},f]}),_jsx(Animated.View,{style:[E.fill,{backgroundColor:s?A.colors["surface-disabled"]:P},v,He],testID:x?`${x}-fill`:void 0})]}),_jsx(GestureDetector,{gesture:xe,children:_jsx(Animated.View,{style:[E.thumb,{width:D.thumbDiameter,height:D.thumbDiameter,borderRadius:je,...smoothCorners,opacity:s?.55:1},Re,w,Ee],testID:x?`${x}-thumb`:void 0,accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants",children:u?_jsxs(Animated.View,{style:[E.bubbleWrap,Te],pointerEvents:"none",children:[_jsx(View,{style:[E.bubble,{backgroundColor:P}],children:m?m(Pe):_jsx(Text,{variant:"caption",weight:"semibold",style:[{color:N},y],numberOfLines:1,children:d(Pe)})}),_jsx(View,{style:[E.bubbleCaret,{backgroundColor:P}]})]}):null})}),W?_jsx(GestureDetector,{gesture:Ae,children:_jsx(Animated.View,{style:[E.thumb,{width:D.thumbDiameter,height:D.thumbDiameter,borderRadius:je,...smoothCorners,opacity:s?.55:1},Re,w,Oe],accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants",children:u?_jsxs(Animated.View,{style:[E.bubbleWrap,Ie],pointerEvents:"none",children:[_jsx(View,{style:[E.bubble,{backgroundColor:P}],children:m?m(Ne):_jsx(Text,{variant:"caption",weight:"semibold",style:[{color:N},y],numberOfLines:1,children:d(Ne)})}),_jsx(View,{style:[E.bubbleCaret,{backgroundColor:P}]})]}):null})}):null]})})})});Slider.displayName="Slider";const buildStyles=(e,t)=>{const a=e.shadow.elevated,i=Math.max(t.thumbDiameter,t.trackHeight),r=i/2+e.space.xs;return StyleSheet.create({container:{width:"100%",paddingVertical:r,justifyContent:"center"},trackTouch:{width:"100%",justifyContent:"center"},trackWrap:{width:"100%",height:i,justifyContent:"center"},trackClip:{position:"absolute",left:0,right:0,height:t.trackHeight,top:(i-t.trackHeight)/2,borderRadius:t.trackHeight/2,...smoothCorners,overflow:"hidden"},track:{position:"absolute",top:0,right:0,bottom:0,left:0,borderRadius:t.trackHeight/2,...smoothCorners},fill:{position:"absolute",top:0,left:0,width:"100%",height:t.trackHeight,borderRadius:t.trackHeight/2,...smoothCorners,transformOrigin:"left"},thumb:{position:"absolute",top:(i-t.thumbDiameter)/2,left:0,borderWidth:2,shadowColor:a.shadowColor,shadowOffset:a.shadowOffset,shadowOpacity:a.shadowOpacity,shadowRadius:a.shadowRadius,elevation:a.elevation,alignItems:"center",justifyContent:"center"},bubbleWrap:{position:"absolute",bottom:t.thumbDiameter+2,left:t.thumbDiameter/2-80,width:160,alignItems:"center"},bubbleCaret:{width:8,height:8,marginTop:-5,borderRadius:e.radius.none,...smoothCorners,transform:[{rotate:"45deg"}]},bubble:{paddingHorizontal:e.space.sm,paddingVertical:e.space.xxs,borderRadius:e.radius.md,...smoothCorners,minWidth:36,alignItems:"center",justifyContent:"center",...Platform.select({ios:{shadowColor:e.shadow.card.shadowColor,shadowOffset:e.shadow.card.shadowOffset,shadowOpacity:e.shadow.card.shadowOpacity,shadowRadius:e.shadow.card.shadowRadius},android:{elevation:e.shadow.card.elevation},default:{}})}})};export{Slider};export default Slider;
|
|
1
|
+
"use strict";import{forwardRef,useCallback,useEffect,useMemo,useRef,useState}from"react";import{Platform,Pressable,StyleSheet,View}from"react-native";import{GestureDetector,usePanGesture}from"react-native-gesture-handler";import Animated,{cancelAnimation,Easing,useAnimatedStyle,useSharedValue,withSpring,withTiming}from"react-native-reanimated";import{scheduleOnRN}from"react-native-worklets";import{useControllableState}from"../../hooks/index.js";import{fillText,useMobileUiText}from"../../text/index.js";import{SLIDER_TEXT}from"../../text/phone/slider.g.js";import{resolveSliderSize,useTheme}from"../../theme/index.js";import{resolveHaptic,triggerHaptic}from"../../utils/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{smoothCorners}from"../../utils/corners.js";import{Text}from"../Text/index.js";import{sliderToneInk}from"./valueText.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const VARIANT_SIZE_MAP={inset:{sm:{trackHeight:14,thumbDiameter:10},md:{trackHeight:20,thumbDiameter:14},lg:{trackHeight:26,thumbDiameter:18}},minimal:{sm:{trackHeight:2,thumbDiameter:14},md:{trackHeight:3,thumbDiameter:18},lg:{trackHeight:4,thumbDiameter:22}},bar:{sm:{trackHeight:20,thumbDiameter:20},md:{trackHeight:28,thumbDiameter:28},lg:{trackHeight:36,thumbDiameter:36}}},INSET_RING_RATIO=.3,MIN_THUMB_TOUCH=44,clamp=(e,t,a)=>Math.min(Math.max(e,t),a),snapToStep=(e,t,a,i)=>{if(i<=0)return clamp(e,t,a);const r=Math.round((e-t)/i)*i+t,s=String(i).split(".")[1]?.length??0,n=s>0?Number(r.toFixed(s)):r;return clamp(n,t,a)},BUBBLE_GAP=2,BUBBLE_CARET=8,BUBBLE_WRAP_WIDTH=160,NO_SHADOW={shadowOpacity:0,elevation:0},defaultFormatLabel=e=>String(e),isPair=e=>Array.isArray(e),Slider=forwardRef((e,t)=>{const{min:a=0,max:i=100,step:r=1,disabled:s=!1,tone:n="primary",size:o="md",variant:l="default",showLabel:u=!1,snapThumb:c=!1,formatLabel:d=defaultFormatLabel,renderLabel:m,accessibilityLabel:h,haptic:b,style:f,trackStyle:p,fillStyle:g,thumbStyle:v,labelStyle:w,thumbPressScale:y,labelShowDuration:S,labelOpacity:k,testID:x}=e;assertValidValue("Slider","tone",e.tone,["primary","success","warning","danger","info","neutral"]),assertValidValue("Slider","size",e.size,["sm","md","lg"]),assertValidValue("Slider","variant",e.variant,["default","inset","minimal","bar"]);const C=useTheme(),A=useMobileUiText("slider",SLIDER_TEXT),V=useMemo(()=>{const e=resolveSliderSize(C,o);return{trackHeight:e["track-height"],thumbDiameter:e["thumb-diameter"]}},[C,o]),D=useMemo(()=>"default"===l?V:VARIANT_SIZE_MAP[l][o],[V,o,l]),j="inset"===l?D.trackHeight/2:0,M=C.settings.components.slider?.thumbPressAnimation??!1,_=y??1.1,T=S??C.motion.duration.fast,R=k??1,E=useMemo(()=>buildStyles(C,D),[C,D]),H=useMemo(()=>({damping:C.motion.spring.snappy.damping,stiffness:C.motion.spring.snappy.stiffness,mass:C.motion.spring.snappy.mass}),[C.motion.spring.snappy]),[O,I]=useState(0),P=C.colors[n],N=sliderToneInk(C,n),L=!0===e.range,W=useCallback(t=>{if(!0!==e.range){if(Array.isArray(t))throw new Error("Slider received a range value in single mode.");e.onChange?.(t)}else{if(!Array.isArray(t))throw new Error("Slider received a single value in range mode.");e.onChange?.(t)}},[e.onChange,e.range]),[X,B]=useControllableState({value:e.value,defaultValue:e.defaultValue??(L?[a,i]:a),onChange:W}),F=useSharedValue(0),G=useSharedValue(0),U=useSharedValue(isPair(X)?X[0]:X),z=useSharedValue(isPair(X)?X[1]:X),$=useSharedValue(0),Z=useSharedValue(0),J=useSharedValue(1),q=useSharedValue(1),K="always"===u,Q=useSharedValue(K?1:0),Y=useSharedValue(K?1:0),ee=useMemo(()=>10**(String(r).split(".")[1]?.length??0),[r]);useEffect(()=>()=>{cancelAnimation(F),cancelAnimation(G),cancelAnimation(J),cancelAnimation(q),cancelAnimation(Q),cancelAnimation(Y)},[F,G,J,q,Q,Y]);const te=useCallback((e,t)=>{const r=t-2*j;return i===a||r<=0?j:j+(e-a)/(i-a)*r},[a,i,j]),ae=useCallback((e,t)=>{const s=t-2*j;if(s<=0)return a;const n=clamp((e-j)/s,0,1);return snapToStep(a+n*(i-a),a,i,r)},[a,i,r,j]),ie=useRef(!1),re=C.motion.duration.fast,se=useRef(X);se.current=X;const ne=useRef(O);ne.current=O;const oe=useCallback((e=!1)=>{const t=ne.current;if(t<=0)return;const place=t=>e?withTiming(t,{duration:re,easing:Easing.out(Easing.cubic)}):t,a=se.current;if(isPair(a)){const[e,i]=a,r=Math.min(e,i),s=Math.max(e,i);U.value=r,z.value=s,F.value=place(te(r,t)),G.value=place(te(s,t))}else{const e=a;U.value=e,z.value=e,F.value=place(te(e,t))}},[te,U,z,F,G,re]),[le,ue]=useState(0),ce=useRef(!1),de=useCallback(e=>{ie.current=e,e||(ce.current=!0,ue(e=>e+1))},[]);useEffect(()=>{if(ie.current)return;const e=ce.current;ce.current=!1,oe(e)},[JSON.stringify(X),O,le,oe]);const me=useCallback(e=>{const t=e.nativeEvent.layout.width;Z.value=t,I(t)},[Z]),he=useCallback((e,t)=>{B(L?[e,t]:e)},[L,B]),be=useCallback(()=>{const e=resolveHaptic(b,"selection");e&&triggerHaptic(e)},[b]),fe=useRef(he);fe.current=he;const pe=useRef(be);pe.current=be;const ge=useCallback((e,t)=>fe.current(e,t),[]),ve=useCallback(()=>pe.current(),[]),we=Math.max(0,(44-D.thumbDiameter)/2),ye=we>0?we:void 0,Se=useCallback(e=>{const t="low"===e?F:G,n="low"===e?U:z,o="low"===e?z:U,l="low"===e?J:q,d="low"===e?Q:Y,m="low"===e,h=a,b=i,f=r,p=ee,g=L,v=_,w=M,y=!0===u,S=c,k=R,C=T,A=H,V=j,D=m&&x?`${x}-pan`:void 0,follow=e=>{"worklet";const a=Z.value-2*V;if(a<=0||!Number.isFinite(e))return;const i=Math.min(Math.max($.value+e,V),Z.value-V);let r=h+(i-V)/a*(b-h);f>0&&(r=Math.round((r-h)/f)*f+h,r=Math.round(r*p)/p),r=Math.min(Math.max(r,h),b),g&&(m&&r>o.value&&(r=o.value),!m&&r<o.value&&(r=o.value)),t.value=S||b===h?b===h?V:V+(r-h)/(b-h)*a:g?m?Math.min(i,G.value):Math.max(i,F.value):i,r!==n.value&&(n.value=r,r!==h&&r!==b||scheduleOnRN(ve),scheduleOnRN(ge,U.value,z.value))};return{enabled:!s,minDistance:0,testID:D,...void 0===ye?{}:{hitSlop:ye},onActivate:()=>{"worklet";scheduleOnRN(de,!0),$.value=t.value,w&&(l.value=withSpring(v,A)),y&&(d.value=withTiming(k,{duration:C,easing:Easing.out(Easing.cubic)})),scheduleOnRN(ve)},onUpdate:e=>{"worklet";follow(e.translationX)},onDeactivate:e=>{"worklet";follow(e.translationX),w&&(l.value=withSpring(1,A)),y&&(d.value=withTiming(0,{duration:C,easing:Easing.out(Easing.cubic)}))},onFinalize:()=>{"worklet";scheduleOnRN(de,!1)}}},[s,a,i,r,ee,L,_,M,u,c,R,T,H,j,ye,x,ge,ve,de,F,G,U,z,J,q,Q,Y,$,Z]),ke=useMemo(()=>Se("low"),[Se]),xe=useMemo(()=>Se("high"),[Se]),Ce=usePanGesture(ke),Ae=usePanGesture(xe),Ve=useCallback(e=>{if(s||L||O<=0)return;const t=clamp(e.nativeEvent.locationX,0,O),a=ae(t,O);a!==U.value&&(be(),U.value=a,F.value=withTiming(te(a,O),{duration:C.motion.duration.fast,easing:Easing.out(Easing.cubic)}),he(a,a))},[s,L,O,ae,te,he,be,F,U,C.motion.duration.fast]),De=useCallback(e=>{if(s)return;const t="increment"===e.nativeEvent.actionName?r:-r,n=r>0?Math.round(t*ee)/ee:t;if(L){const e=Math.round((U.value+n)*ee)/ee,t=clamp(e,a,z.value);t!==U.value&&(U.value=t,F.value=te(t,O),be(),he(t,z.value))}else{const e=Math.round((U.value+n)*ee)/ee,t=clamp(e,a,i);t!==U.value&&(U.value=t,F.value=te(t,O),be(),he(t,t))}},[s,r,ee,L,a,i,te,O,F,U,z,he,be]),je=D.thumbDiameter/2,Me=s?C.colors["surface-disabled"]:P,Te="inset"===l?{backgroundColor:Me,borderColor:C.colors.surface,borderWidth:Math.max(2,Math.round(.3*D.thumbDiameter)),...NO_SHADOW}:"minimal"===l?{backgroundColor:Me,borderWidth:0}:"bar"===l?{backgroundColor:"transparent",borderWidth:0,...NO_SHADOW}:{backgroundColor:C.colors.surface,borderColor:Me},Re=useAnimatedStyle(()=>{const e=Z.value;if(e<=0)return{opacity:0,transform:[{translateX:0},{scaleX:1}]};const t=s?.55:1;if(L){const a=Math.max(0,G.value-F.value+2*j);return{opacity:t,transform:[{translateX:F.value-j},{scaleX:a/e}]}}return{opacity:t,transform:[{translateX:F.value+j-e},{scaleX:1}]}},[Z,s,L,G,F,j]),Ee=useAnimatedStyle(()=>({transform:[{translateX:F.value-je},{scale:J.value}]}),[F,je,J]),He=useAnimatedStyle(()=>({transform:[{translateX:G.value-je},{scale:q.value}]}),[G,je,q]),Oe=useAnimatedStyle(()=>({opacity:Q.value}),[Q]),Ie=useAnimatedStyle(()=>({opacity:Y.value}),[Y]),clampDisplay=e=>clamp(e,a,i),Pe=clampDisplay(isPair(X)?Math.min(...X):X),Ne=clampDisplay(isPair(X)?Math.max(...X):X);return _jsx(View,{ref:t,style:[E.container,f],testID:x,accessibilityRole:"adjustable",accessibilityLabel:h,accessibilityState:{disabled:s},"aria-disabled":s,accessibilityValue:L?{min:a,max:i,now:Pe,text:fillText(A.text,{start:Pe,end:Ne})}:{min:a,max:i,now:Pe},accessibilityActions:[{name:"increment"},{name:"decrement"}],onAccessibilityAction:De,children:_jsx(Pressable,{onPress:Ve,disabled:s||L,style:E.trackTouch,testID:x?`${x}-track-press`:void 0,accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants",children:_jsxs(View,{style:E.trackWrap,onLayout:me,testID:x?`${x}-track`:void 0,children:[_jsxs(View,{style:E.trackClip,pointerEvents:"none",children:[_jsx(View,{style:[E.track,{backgroundColor:s?C.colors["surface-disabled"]:C.colors.border},p]}),_jsx(Animated.View,{style:[E.fill,{backgroundColor:s?C.colors["surface-disabled"]:P},g,Re],testID:x?`${x}-fill`:void 0})]}),_jsx(GestureDetector,{gesture:Ce,children:_jsx(Animated.View,{style:[E.thumb,{width:D.thumbDiameter,height:D.thumbDiameter,borderRadius:je,...smoothCorners,opacity:s?.55:1},Te,v,Ee],testID:x?`${x}-thumb`:void 0,accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants",children:u?_jsxs(Animated.View,{style:[E.bubbleWrap,Oe],pointerEvents:"none",children:[_jsx(View,{style:[E.bubble,{backgroundColor:P}],children:m?m(Pe):_jsx(Text,{variant:"caption",weight:"semibold",style:[{color:N},w],numberOfLines:1,children:d(Pe)})}),_jsx(View,{style:[E.bubbleCaret,{backgroundColor:P}]})]}):null})}),L?_jsx(GestureDetector,{gesture:Ae,children:_jsx(Animated.View,{style:[E.thumb,{width:D.thumbDiameter,height:D.thumbDiameter,borderRadius:je,...smoothCorners,opacity:s?.55:1},Te,v,He],accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants",children:u?_jsxs(Animated.View,{style:[E.bubbleWrap,Ie],pointerEvents:"none",children:[_jsx(View,{style:[E.bubble,{backgroundColor:P}],children:m?m(Ne):_jsx(Text,{variant:"caption",weight:"semibold",style:[{color:N},w],numberOfLines:1,children:d(Ne)})}),_jsx(View,{style:[E.bubbleCaret,{backgroundColor:P}]})]}):null})}):null]})})})});Slider.displayName="Slider";const buildStyles=(e,t)=>{const a=e.shadow.elevated,i=Math.max(t.thumbDiameter,t.trackHeight),r=i/2+e.space.xs;return StyleSheet.create({container:{width:"100%",paddingVertical:r,justifyContent:"center"},trackTouch:{width:"100%",justifyContent:"center"},trackWrap:{width:"100%",height:i,justifyContent:"center"},trackClip:{position:"absolute",left:0,right:0,height:t.trackHeight,top:(i-t.trackHeight)/2,borderRadius:t.trackHeight/2,...smoothCorners,overflow:"hidden"},track:{position:"absolute",top:0,right:0,bottom:0,left:0,borderRadius:t.trackHeight/2,...smoothCorners},fill:{position:"absolute",top:0,left:0,width:"100%",height:t.trackHeight,borderRadius:t.trackHeight/2,...smoothCorners,transformOrigin:"left"},thumb:{position:"absolute",top:(i-t.thumbDiameter)/2,left:0,borderWidth:2,shadowColor:a.shadowColor,shadowOffset:a.shadowOffset,shadowOpacity:a.shadowOpacity,shadowRadius:a.shadowRadius,elevation:a.elevation,alignItems:"center",justifyContent:"center"},bubbleWrap:{position:"absolute",bottom:t.thumbDiameter+2,left:t.thumbDiameter/2-80,width:160,alignItems:"center"},bubbleCaret:{width:8,height:8,marginTop:-5,borderRadius:e.radius.none,...smoothCorners,transform:[{rotate:"45deg"}]},bubble:{paddingHorizontal:e.space.sm,paddingVertical:e.space.xxs,borderRadius:e.radius.md,...smoothCorners,minWidth:36,alignItems:"center",justifyContent:"center",...Platform.select({ios:{shadowColor:e.shadow.card.shadowColor,shadowOffset:e.shadow.card.shadowOffset,shadowOpacity:e.shadow.card.shadowOpacity,shadowRadius:e.shadow.card.shadowRadius},android:{elevation:e.shadow.card.elevation},default:{}})}})};export{Slider};export default Slider;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{forwardRef,useCallback,useMemo,useRef}from"react";import{Pressable,StyleSheet,TextInput,View}from"react-native";import{useControllableState}from"../../hooks/index.js";import{resolveFieldSize,useTheme}from"../../theme/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{hitSlopMarker}from"../../utils/hitSlop.js";import{AppIcon,renderSlotIcon}from"../AppIcon/index.js";import{FieldBase,FieldLabel,FieldMessage,hasFieldText,resolveFieldTextStyle}from"../FieldBase/FieldBase.js";import{IconButton}from"../IconButton/index.js";import{Slider}from"../Slider/index.js";import{CountingText,clampValue,sliderToneInk,snapValue,useValueDraft}from"../Slider/valueText.js";import{Text}from"../Text/index.js";import{Tooltip}from"../Tooltip/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";
|
|
1
|
+
"use strict";import{forwardRef,useCallback,useMemo,useRef}from"react";import{Pressable,StyleSheet,TextInput,View}from"react-native";import{useControllableState}from"../../hooks/index.js";import{fillText,useMobileUiText}from"../../text/index.js";import{SLIDER_FIELD_TEXT}from"../../text/phone/sliderField.g.js";import{resolveFieldSize,useTheme}from"../../theme/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{hitSlopMarker}from"../../utils/hitSlop.js";import{AppIcon,renderSlotIcon}from"../AppIcon/index.js";import{FieldBase,FieldLabel,FieldMessage,hasFieldText,resolveFieldTextStyle}from"../FieldBase/FieldBase.js";import{IconButton}from"../IconButton/index.js";import{Slider}from"../Slider/index.js";import{CountingText,clampValue,sliderToneInk,snapValue,useValueDraft}from"../Slider/valueText.js";import{Text}from"../Text/index.js";import{Tooltip}from"../Tooltip/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const DEFAULT_INPUT_WIDTH=72,defaultFormatValue=e=>String(e),stepDecimals=e=>String(e).split(".")[1]?.length??0,ValueBox=({draft:e,error:l,disabled:t,width:i,accessibilityLabel:s,styles:a,style:r,testID:o,fieldTestID:n})=>{const d=useTheme(),c=resolveFieldSize(d,"sm"),u=resolveFieldTextStyle(d,{disabled:t}),m=useRef(null),p=useCallback(()=>{t||m.current?.focus()},[t]);return _jsx(FieldBase,{testID:n,size:"sm",focused:e.editing,disabled:t,error:l,filled:!0,width:i,onPress:p,pressFeedback:!1,paddingHorizontal:d.space.sm,gap:d.space.xs,trailing:l?_jsx(AppIcon,{name:"info-circle",size:c.icon,color:d.colors["danger-text"]}):void 0,style:r,children:_jsx(TextInput,{ref:m,style:[a.boxInput,{color:u.color,fontSize:c.text,...u.weightStyle}],value:e.text,onChangeText:e.onChangeText,onFocus:e.onFocus,onBlur:e.onBlur,onSubmitEditing:e.onBlur,editable:!t,keyboardType:"decimal-pad",returnKeyType:"done",textAlign:"center",selectionColor:d.colors.primary,accessibilityLabel:s,accessibilityState:{disabled:t},"aria-disabled":t,testID:o})})},SliderField=forwardRef((e,l)=>{const{label:t,unit:i,info:s,required:a=!1,helperText:r,error:o,min:n=0,max:d=100,step:c=1,disabled:u=!1,tone:m="primary",size:p,variant:x,haptic:b,showBubble:f=!0,showBounds:h=!0,showInput:y=!1,showStepper:g=!1,leftIcon:T,rightIcon:I,startLabel:S,endLabel:j,formatValue:v=defaultFormatValue,parseInput:w,animationDuration:F,inputWidth:V=DEFAULT_INPUT_WIDTH,labels:_,accessibilityLabel:D,style:L,labelStyle:B,boundStyle:z,sliderStyle:C,inputStyle:A,testID:k}=e;assertValidValue("SliderField","tone",e.tone,["primary","success","warning","danger","info","neutral"]),assertValidValue("SliderField","size",e.size,["sm","md","lg"]),assertValidValue("SliderField","variant",e.variant,["default","inset","minimal","bar"]);const M=useMobileUiText("sliderField",SLIDER_FIELD_TEXT),E=useMemo(()=>({...M,..._}),[M,_]),$=useTheme(),R=useMemo(()=>buildStyles($),[$]),P=F??$.motion.duration.fast,W=!0===e.range,N=!0===o||hasFieldText(o),U=stepDecimals(c),H=useCallback(l=>{if(!0!==e.range){if(Array.isArray(l))throw new Error("SliderField received a range value in single mode.");e.onChange?.(l)}else{if(!Array.isArray(l))throw new Error("SliderField received a single value in range mode.");e.onChange?.(l)}},[e.onChange,e.range]),[q,X]=useControllableState({value:e.value,defaultValue:e.defaultValue??(W?[n,d]:n),onChange:H}),[K,G]=Array.isArray(q)?q:[q,d],J=clampValue(Math.min(K,G),n,d),O=clampValue(Math.max(K,G),n,d),Q=useValueDraft({value:J,min:n,max:d,step:c,format:v,parse:w,onChange:e=>X(W?[Math.min(e,O),O]:e)}),Y=useValueDraft({value:O,min:n,max:d,step:c,format:v,parse:w,onChange:e=>X([J,Math.max(e,J)])}),stepBy=e=>{const l=snapValue(J+e*c,n,d,c);l!==J&&X(l)},Z={color:u?$.colors["text-disabled"]:$.colors["text-muted"],size:resolveFieldSize($,"md").icon,disabled:u},ee=[R.bubbleText,{color:sliderToneInk($,m)}],boundText=e=>_jsx(Text,{variant:"bodySmall",style:[R.bound,{color:u?$.colors["text-disabled"]:$.colors["text-muted"]},z],children:e}),le={min:n,max:d,step:c,disabled:u,tone:m,size:p,variant:x,haptic:b,showLabel:!!f&&"always",renderLabel:f?e=>_jsx(CountingText,{value:e,format:v,decimals:U,duration:P,style:ee,testID:k&&!W?`${k}-bubble`:void 0}):void 0,accessibilityLabel:D??t,style:C,testID:k?`${k}-slider`:void 0};return _jsxs(View,{ref:l,style:[R.container,L],testID:k,children:[t?_jsxs(View,{style:R.labelRow,children:[_jsx(FieldLabel,{required:a,style:B,children:t}),i?_jsx(Text,{variant:"caption",style:{color:$.colors["text-subtle"]},children:i}):null,s?_jsx(Tooltip,{content:s,trigger:"press",placement:"top",children:_jsx(Pressable,{accessibilityRole:"button",accessibilityLabel:fillText(E.about,{label:t}),hitSlop:8,...hitSlopMarker(8),style:R.infoButton,children:_jsx(AppIcon,{name:"info-circle",variant:"bold",size:16,color:$.colors["text-subtle"]})})}):null]}):null,_jsxs(View,{style:[R.row,f?R.rowWithBubble:null],children:[T?_jsx(View,{children:renderSlotIcon(T,Z)}):null,g&&!W?_jsx(IconButton,{icon:e=>_jsx(AppIcon,{name:"minus",size:e.size,color:e.color}),onPress:()=>stepBy(-1),accessibilityLabel:E.decrease,variant:"ghost",tone:"neutral",size:"sm",disabled:u||J<=n,haptic:b,testID:k?`${k}-minus`:void 0}):null,W&&y?_jsx(ValueBox,{draft:Q,error:N,disabled:u,width:V,accessibilityLabel:fillText(E.low,{name:t??E.fallbackName}),styles:R,style:A,testID:k?`${k}-input-low`:void 0,fieldTestID:k?`${k}-field-low`:void 0}):h?boundText(S??v(n)):null,_jsx(View,{style:R.sliderWrap,children:_jsx(Slider,W?{...le,range:!0,value:[J,O],onChange:X}:{...le,value:J,onChange:X})}),W&&y?_jsx(ValueBox,{draft:Y,error:N,disabled:u,width:V,accessibilityLabel:fillText(E.high,{name:t??E.fallbackName}),styles:R,style:A,testID:k?`${k}-input-high`:void 0,fieldTestID:k?`${k}-field-high`:void 0}):h?boundText(j??v(d)):null,g&&!W?_jsx(IconButton,{icon:e=>_jsx(AppIcon,{name:"add",size:e.size,color:e.color}),onPress:()=>stepBy(1),accessibilityLabel:E.increase,variant:"ghost",tone:"neutral",size:"sm",disabled:u||J>=d,haptic:b,testID:k?`${k}-plus`:void 0}):null,I?_jsx(View,{children:renderSlotIcon(I,Z)}):null,!W&&y?_jsx(ValueBox,{draft:Q,error:N,disabled:u,width:V,accessibilityLabel:fillText(E.current,{name:t??E.fallbackName}),styles:R,style:A,testID:k?`${k}-input`:void 0,fieldTestID:k?`${k}-field`:void 0}):null]}),_jsx(FieldMessage,{text:N?o:r,error:N})]})});SliderField.displayName="SliderField";const buildStyles=e=>StyleSheet.create({container:{width:"100%"},labelRow:{flexDirection:"row",alignItems:"center",gap:e.space.xs},infoButton:{marginLeft:e.space.xxs},row:{flexDirection:"row",alignItems:"center",gap:e.space.sm},rowWithBubble:{marginTop:e.space.lg},sliderWrap:{flex:1,paddingHorizontal:e.space.sm},bound:{fontVariant:["tabular-nums"]},bubbleText:{fontVariant:["tabular-nums"]},boxInput:{flex:1,padding:e.space.none,margin:e.space.none,includeFontPadding:!1}});export{SliderField};export default SliderField;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";export{
|
|
1
|
+
"use strict";export{default,SliderField}from"./SliderField.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{useCallback,useEffect,useMemo,useRef,useState}from"react";import{StyleSheet,View}from"react-native";import{GestureDetector,usePanGesture}from"react-native-gesture-handler";import Animated,{cancelAnimation,measure,scrollTo,useAnimatedRef,useAnimatedScrollHandler,useAnimatedStyle,useFrameCallback,useSharedValue,withSpring}from"react-native-reanimated";import{scheduleOnRN}from"react-native-worklets";import{useTheme}from"../../theme/index.js";import{triggerHaptic}from"../../utils/index.js";import{useScrollHost}from"../Screen/ScrollHost.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";
|
|
1
|
+
"use strict";import{useCallback,useEffect,useMemo,useRef,useState}from"react";import{StyleSheet,View}from"react-native";import{GestureDetector,usePanGesture}from"react-native-gesture-handler";import Animated,{cancelAnimation,measure,scrollTo,useAnimatedRef,useAnimatedScrollHandler,useAnimatedStyle,useFrameCallback,useSharedValue,withSpring}from"react-native-reanimated";import{scheduleOnRN}from"react-native-worklets";import{useMobileUiText}from"../../text/index.js";import{SORTABLE_LIST_TEXT}from"../../text/phone/sortableList.g.js";import{useTheme}from"../../theme/index.js";import{triggerHaptic}from"../../utils/index.js";import{useScrollHost}from"../Screen/ScrollHost.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const LONG_PRESS_MS=350,EDGE_PX=48,SCROLL_STEP_PX=12,SCROLL_SLACK_PX=1,SPRING_CONFIG={damping:22,stiffness:260,mass:1},ACTION_STEP={moveUp:-1,moveDown:1},noop=e=>{};export function moveItem(e,t,a){const l=e.slice();if(t<0||t>=l.length)return l;const[s]=l.splice(t,1);return void 0===s||l.splice(a,0,s),l}export function topOf(e,t){"worklet";let a=0;for(let l=0;l<t;l++)a+=e[l]??0;return a}export function slotTop(e,t,a){"worklet";let l=0,s=0;for(let o=0;o<e.length&&s<a;o++)o!==t&&(l+=e[o]??0,s++);return l}export function dropIndex(e,t,a){"worklet";const l=topOf(e,t)+(e[t]??0)/2+a;let s=0,o=0;for(let a=0;a<e.length;a++){const r=e[a]??0;a!==t&&o+r/2<l&&s++,o+=r}return s}export function rowShifts(e,t,a){const l=[];let s=0;for(const t of e)l.push(s),s+=t;const o=e.map(()=>0),r=moveItem(e.map((e,t)=>t),t,a);let n=0;for(const t of r)o[t]=n-(l[t]??0),n+=e[t]??0;return o}const buildStyles=e=>StyleSheet.create({handleRow:{flexDirection:"row",alignItems:"center"},handle:{paddingHorizontal:e.space.sm,paddingVertical:e.space.md,gap:e.space.xxs},bar:{width:e.space.md,height:e.space.xxs,backgroundColor:e.colors["text-muted"]},body:{flex:1}});function SortableRow({rowKey:e,index:t,count:a,shift:l,isActive:s,dragging:o,handle:r,disabled:n,shared:u,callbacks:i,labels:c,children:d}){const m=useTheme(),h=useMemo(()=>buildStyles(m),[m]),v=useSharedValue(0);useEffect(()=>{v.value=o&&!s?withSpring(l,SPRING_CONFIG):l},[o,s,l,v]),useEffect(()=>()=>{cancelAnimation(v)},[v]);const f=useAnimatedStyle(()=>({transform:[{translateY:s?u.dragY.value:v.value}],zIndex:s?1:0}),[s,u,v]),g=useMemo(()=>{const{dragIndex:e,dropTo:a,dragY:l,translation:s,absoluteY:o,scrollY:c,scrollStart:d,hostOffset:m,hostStart:h,hostTarget:v,heights:f}=u,{onLift:g,onDrop:p,onSettled:S}=i;return{enabled:!n,...r?{}:{activateAfterLongPress:350},onActivate:r=>{"worklet";o.value=r.absoluteY,e.value=t,a.value=t,d.value=c.value,h.value=m.value,v.value=m.value,s.value=0,l.value=0,scheduleOnRN(g,t)},onUpdate:a=>{"worklet";e.value===t&&(s.value=a.translationY,o.value=a.absoluteY)},onFinalize:()=>{"worklet";if(e.value!==t)return;const s=a.value,o=f.value;e.value=-1,l.value=topOf(o,t)+l.value-slotTop(o,t,s),l.value=withSpring(0,SPRING_CONFIG,e=>{"worklet";e&&scheduleOnRN(S)}),scheduleOnRN(p,t,s)}}},[n,r,t,i,u]),p=usePanGesture(g),S=n?[]:[...t>0?[{name:"moveUp",label:c.moveUp}]:[],...t<a-1?[{name:"moveDown",label:c.moveDown}]:[]];return _jsx(Animated.View,{style:f,onLayout:t=>i.onHeight(e,t.nativeEvent.layout.height),accessibilityActions:S,onAccessibilityAction:e=>{if(n)return;const l=t+(ACTION_STEP[e.nativeEvent.actionName]??0);l!==t&&l>=0&&l<a&&i.onMove(t,l)},testID:`sortable-row-${e}`,children:r?_jsxs(View,{style:h.handleRow,children:[_jsx(GestureDetector,{gesture:p,children:_jsxs(View,{style:h.handle,children:[_jsx(View,{style:h.bar}),_jsx(View,{style:h.bar}),_jsx(View,{style:h.bar})]})}),_jsx(View,{style:h.body,children:d})]}):_jsx(GestureDetector,{gesture:p,children:_jsx(View,{children:d})})})}export function SortableList(e){const{data:t,keyExtractor:a,renderItem:l,onReorder:s,handle:o=!1,disabled:r=!1,accessibilityLabel:n,labels:u,testID:i}=e,c=useMobileUiText("sortableList",SORTABLE_LIST_TEXT),d=useMemo(()=>({...c,...u}),[c,u]),m=useMemo(()=>t.map((e,t)=>({key:a(e,t),item:e})),[t,a]),h=useMemo(()=>m.map(e=>e.key),[m]),v=useAnimatedRef(),f=useSharedValue(0),g=useSharedValue(0),p=useSharedValue(0),S=useScrollHost(),b=useSharedValue(0),x=null!==S,w=S?.top??b,y=S?.bottom??b,k=S?.offset??b,_=S?.maxOffset??b,T=S?.scrollTo??noop,A=useSharedValue(0),R=useSharedValue(0),V=useSharedValue(0),I=useSharedValue(0),O=useSharedValue(-1),j=useSharedValue(-1),C=useSharedValue(0),L=useSharedValue([]),M=useRef(new Map),E=useRef(h),[N,Y]=useState(null),P=useCallback(()=>{L.value=E.current.map(e=>M.current.get(e)??0)},[L]);useEffect(()=>{E.current=h,P()},[h,P]),useEffect(()=>()=>{cancelAnimation(C)},[C]);const D=useCallback(e=>{Y(t=>t?.dragging?{...t,to:e}:t)},[]),G=useFrameCallback(()=>{"worklet";const e=O.value;if(e<0)return;const t=measure(v);if(t){const e=x?Math.max(t.pageY,w.value):t.pageY,a=x?Math.min(t.pageY+t.height,y.value):t.pageY+t.height,l=Math.max(0,p.value-t.height-1);I.value<e+48?f.value>1?scrollTo(v,0,Math.max(0,f.value-12),!1):x&&R.value>0&&(R.value=Math.max(0,R.value-12),scheduleOnRN(T,R.value)):I.value>a-48&&(f.value<l?scrollTo(v,0,Math.min(l,f.value+12),!1):x&&R.value<_.value&&(R.value=Math.min(_.value,R.value+12),scheduleOnRN(T,R.value)))}C.value=V.value+f.value-g.value+k.value-A.value;const a=dropIndex(L.value,e,C.value);a!==j.value&&(j.value=a,scheduleOnRN(D,a))},!1),H=useCallback(e=>{triggerHaptic("longPress"),G.setActive(!0),Y({key:h[e]??"",from:e,to:e,dragging:!0})},[G,h]),F=useCallback((e,t)=>{G.setActive(!1),Y(e=>e?{...e,to:t,dragging:!1}:e),t!==e&&s(moveItem(h,e,t))},[G,h,s]),U=useCallback(()=>{Y(e=>e&&!e.dragging?null:e)},[]),X=useCallback((e,t)=>{s(moveItem(h,e,t))},[h,s]),z=useCallback((e,t)=>{M.current.set(e,t),P()},[P]),K=useAnimatedScrollHandler({onScroll:e=>{"worklet";f.value=e.contentOffset.y}}),B=useCallback((e,t)=>{p.value=t},[p]),$=useMemo(()=>({scrollRef:v,scrollY:f,scrollStart:g,hostOffset:k,hostStart:A,hostTarget:R,translation:V,absoluteY:I,dragIndex:O,dropTo:j,dragY:C,heights:L}),[v,f,g,k,A,R,V,I,O,j,C,L]),q=useMemo(()=>({onLift:H,onDrop:F,onSettled:U,onMove:X,onHeight:z}),[H,F,U,X,z]),J=!0===N?.dragging,Q=J&&N?rowShifts(h.map(e=>M.current.get(e)??0),N.from,N.to):null;return _jsx(Animated.ScrollView,{ref:v,onScroll:K,onContentSizeChange:B,scrollEventThrottle:16,scrollEnabled:!J,accessibilityLabel:n,testID:i,children:m.map((e,t)=>{const a=N?.key===e.key;return _jsx(SortableRow,{rowKey:e.key,index:t,count:m.length,shift:Q?.[t]??0,isActive:a,dragging:J,handle:o,disabled:r,shared:$,callbacks:q,labels:d,children:l({item:e.item,index:t,isActive:a})},e.key)})})}SortableList.displayName="SortableList";export default SortableList;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";export{
|
|
1
|
+
"use strict";export{default,SortableList}from"./SortableList.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{formatNumber}from"@webority/mobile-core";import{forwardRef,useCallback,useMemo,useState}from"react";import{StyleSheet,View}from"react-native";import Svg,{Circle,Path}from"react-native-svg";import{useTheme}from"../../theme/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{finiteValues,sparklineGeometry}from"./geometry.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";
|
|
1
|
+
"use strict";import{formatNumber}from"@webority/mobile-core";import{forwardRef,useCallback,useMemo,useState}from"react";import{StyleSheet,View}from"react-native";import Svg,{Circle,Path}from"react-native-svg";import{fillText,useMobileUiText}from"../../text/index.js";import{SPARKLINE_TEXT}from"../../text/phone/sparkline.g.js";import{useTheme}from"../../theme/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{finiteValues,sparklineGeometry}from"./geometry.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const DOT_RADIUS=3,lineColor=(e,t)=>{if("neutral"===t)return e.colors["text-muted"];const r=`${t}-text`;return e.colors[r]},defaultFormat=e=>formatNumber(e),Sparkline=forwardRef((e,t)=>{const{data:r,tone:i="primary",color:s,fill:o=!1,highlightLast:l=!0,height:a=32,width:n,strokeWidth:m=2,label:u,formatLabel:c=defaultFormat,accessibilityLabel:f,labels:h,style:d,testID:p}=e;assertValidValue("Sparkline","tone",e.tone,["primary","success","warning","danger","info","neutral"]);const x=useMobileUiText("sparkline",SPARKLINE_TEXT),y=useMemo(()=>({...x,...h}),[x,h]),k=useTheme(),[g,S]=useState(0),b=n??g,w=useCallback(e=>{if(void 0===n){const t=Math.round(e.nativeEvent.layout.width);S(e=>e===t?e:t)}},[n]),j=Math.max(3,m/2)+1,v=useMemo(()=>sparklineGeometry(r,b,a,j),[r,b,a,j]),$=s??lineColor(k,i),T=useMemo(()=>{if(void 0!==f)return f;const e=finiteValues(r),t=u?`${u}, `:"",[i]=e;if(void 0===i)return`${t}${y.noData}`;if(1===e.length)return`${t}${c(i)}`;const s=e[e.length-1];if(void 0===s)throw new Error("A sparkline with two or more finite values has a last value.");const o=c(i),l=c(s),a=c(Math.min(...e)),n=c(Math.max(...e));return`${t}${fillText(y.range,{first:o,end:l,low:a,high:n})}`},[f,r,c,u,y]);return _jsx(View,{ref:t,accessible:!0,accessibilityRole:"image",accessibilityLabel:T,testID:p,onLayout:w,style:[styles.root,void 0===n?styles.stretch:{width:n},{height:a},d],children:""===v.line?null:_jsxs(Svg,{width:b,height:a,viewBox:`0 0 ${b} ${a}`,children:[o?_jsx(Path,{d:v.area,fill:$,fillOpacity:.14,stroke:"none"}):null,_jsx(Path,{d:v.line,fill:"none",stroke:$,strokeWidth:m,strokeLinecap:"round",strokeLinejoin:"round",...p?{testID:`${p}-line`}:{}}),l&&v.last?_jsx(Circle,{cx:v.last.x,cy:v.last.y,r:3,fill:$,...p?{testID:`${p}-dot`}:{}}):null]})})});Sparkline.displayName="Sparkline";const styles=StyleSheet.create({root:{overflow:"hidden"},stretch:{alignSelf:"stretch"}});export{Sparkline};export default Sparkline;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";export{
|
|
1
|
+
"use strict";export{default,Sparkline}from"./Sparkline.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{forwardRef,useEffect,useMemo,useRef}from"react";import{ActivityIndicator,Animated,Easing,StyleSheet,View}from"react-native";import{usePresenceMotion}from"../../hooks/usePresenceMotion.js";import{createAnimatedValue,useTheme}from"../../theme/index.js";import{announce}from"../../utils/announce.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{blendOf}from"../../utils/color.js";import{smoothCorners}from"../../utils/corners.js";import{nativeDriver}from"../../utils/nativeDriver.js";import{squircleHostRadius}from"../../utils/squircle.js";import{SquircleFill,useSquircle}from"../SquircleFill/SquircleFill.js";import{Text}from"../Text/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";
|
|
1
|
+
"use strict";import{forwardRef,useEffect,useMemo,useRef}from"react";import{ActivityIndicator,Animated,Easing,StyleSheet,View}from"react-native";import{usePresenceMotion}from"../../hooks/usePresenceMotion.js";import{useMobileUiText}from"../../text/index.js";import{SPINNER_TEXT}from"../../text/phone/spinner.g.js";import{createAnimatedValue,useTheme}from"../../theme/index.js";import{announce}from"../../utils/announce.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{blendOf}from"../../utils/color.js";import{smoothCorners}from"../../utils/corners.js";import{nativeDriver}from"../../utils/nativeDriver.js";import{squircleHostRadius}from"../../utils/squircle.js";import{SquircleFill,useSquircle}from"../SquircleFill/SquircleFill.js";import{Text}from"../Text/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const sizeMap={sm:20,md:32,lg:48},CONTAINER_RATIO=1.5,DOT_NAMES=["first","second","third"],DOT_STAGGER_MS=150,DOT_CYCLE_MS=600,DOT_GROW_SCALE=1.4,DOT_PULSE_MIN_OPACITY=.4,Dot=({size:e,color:t,delay:i,duration:r,reduced:n})=>{const s=useTheme(),o=useRef(createAnimatedValue(0)).current;useEffect(()=>{const e=Animated.loop(Animated.sequence([Animated.delay(i),Animated.timing(o,{toValue:1,duration:r/2,easing:Easing.out(Easing.quad),useNativeDriver:nativeDriver}),Animated.timing(o,{toValue:0,duration:r/2,easing:Easing.in(Easing.quad),useNativeDriver:nativeDriver})]));return e.start(),()=>{e.stop()}},[o,i,r]);const a=useMemo(()=>({grow:o.interpolate({inputRange:[0,1],outputRange:[1,1.4]}),fade:o.interpolate({inputRange:[0,1],outputRange:[.4,1]})}),[o]);return _jsx(Animated.View,{style:{width:e,height:e,borderRadius:s.radius.pill,...smoothCorners,backgroundColor:t,...n?{opacity:a.fade}:{transform:[{scale:a.grow}]}}})},Spinner=forwardRef((e,t)=>{const{size:i="md",color:r,message:n,overlay:s=!1,backdropColor:o,variant:a="circular",accessibilityLabel:l,labels:c,style:u,testID:d}=e;assertValidValue("Spinner","size",e.size,["sm","md","lg"]),assertValidValue("Spinner","variant",e.variant,["circular","dots","contained"]);const m=useMobileUiText("spinner",SPINNER_TEXT),g=useMemo(()=>({...m,...c}),[m,c]),p="contained"===a,f=s&&!p,h=useTheme(),y=usePresenceMotion(),b=y.duration("default"),j=useRef(createAnimatedValue(0)).current;useEffect(()=>{Animated.timing(j,{toValue:1,duration:b,easing:Easing.bezier(...h.motion.ease["in-out"]),useNativeDriver:nativeDriver}).start()},[j,h,b]);const x=useMemo(()=>buildStyles(h),[h]),v=sizeMap[i],S=r??h.colors.primary,C=o??h.colors.scrim,R=useMemo(()=>{if("contained"===a){const e=Math.round(1.5*v);return _jsx(View,{style:[x.container,{width:e,height:e,borderRadius:h.radius.pill,backgroundColor:blendOf(S,.14,h.colors.surface,h.colors["bg-subtle"])}],children:_jsx(ActivityIndicator,{color:S,size:"sm"===i?"small":"large",style:{width:v,height:v}})})}if("dots"===a){const e=Math.max(6,Math.round(v/4));return _jsx(View,{style:[x.dotsRow,{gap:Math.round(e/2)}],children:DOT_NAMES.map((t,i)=>_jsx(Dot,{size:e,color:S,delay:150*i,duration:600,reduced:y.reduced},t))})}return _jsx(ActivityIndicator,{color:S,size:"sm"===i?"small":"large",style:{width:v,height:v}})},[a,i,v,S,x.dotsRow,x.container,y.reduced,h.radius.pill,h.colors.surface,h.colors["bg-subtle"]]),_=l??n??g.loading,w=useRef(_);w.current=_,useEffect(()=>{p&&announce(w.current)},[p]);const A=useSquircle(f,h.radius.lg),M=A.active&&A.size?{borderRadius:squircleHostRadius(A.size.width,A.size.height,h.radius.lg)}:null;let T=x.inlineContent;f?T=x.overlayContent:p&&(T=x.containedContent);const E=_jsxs(Animated.View,{ref:t,accessible:!0,accessibilityRole:"progressbar",accessibilityLiveRegion:p?"none":"polite",accessibilityLabel:_,accessibilityState:{busy:!0},"aria-busy":!0,testID:d,onLayout:A.onLayout,style:[T,M,{opacity:j}],children:[A.active&&A.size?_jsx(SquircleFill,{width:A.size.width,height:A.size.height,radius:h.radius.lg,fill:h.colors.surface}):null,R,n?_jsx(Text,{variant:"body",weight:"medium",style:[x.message,{marginTop:h.space.md}],numberOfLines:2,children:n}):null]});return _jsx(View,f?{pointerEvents:"auto",style:[x.overlay,{backgroundColor:C},u],children:E}:{style:[p?x.containedFill:x.inline,u],children:E})});Spinner.displayName="Spinner";const buildStyles=e=>StyleSheet.create({inline:{alignItems:"center",justifyContent:"center"},inlineContent:{alignItems:"center",justifyContent:"center"},containedFill:{flex:1,alignSelf:"stretch",alignItems:"center",justifyContent:"center",minHeight:Math.round(1.5*sizeMap.lg)+2*e.space.xl},containedContent:{alignItems:"center",justifyContent:"center",paddingHorizontal:e.space.lg},container:{alignItems:"center",justifyContent:"center"},overlay:{...StyleSheet.absoluteFill,alignItems:"center",justifyContent:"center",zIndex:1e3},overlayContent:{alignItems:"center",justifyContent:"center",backgroundColor:e.colors.surface,borderRadius:e.radius.lg,...smoothCorners,paddingHorizontal:e.space.xl,paddingVertical:e.space.xl,minWidth:140,...e.shadow.popover},dotsRow:{flexDirection:"row",alignItems:"center",justifyContent:"center"},message:{textAlign:"center"}});export{Spinner};export default Spinner;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";export{
|
|
1
|
+
"use strict";export{default,Spinner}from"./Spinner.js";
|
|
@@ -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,w="upcoming"===s?o:i,f="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:w},g],children:t.icon?t.icon:_jsx(Text,C?{variant:"bodySmall",weight:"semibold",style:[h.glyph,{color:f}],children:"✓"}:{variant:"bodySmall",weight:"semibold",style:[h.glyph,{color:f}],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:w}=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 f=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,E=C.colors.bg,A=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?f.progressStep(G+1,T):f.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:w,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?f.captionStep(G+1,T,e?.label):f.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=f.step(t+1,T,e.label,statusWordFor(f,s)),o=_jsx(View,{testID:w?`${w}-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:E,onPressColor:R,textOnColor:L,upcomingTextColor:A,interactive:I,canPress:canPressStatus(s),totalSteps:T,onPress:handleStepPress,pulseEnabled:j,labels:f,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:E,onPressColor:R,textOnColor:L,upcomingTextColor:A,interactive:I,canPress:canPressStatus(s),totalSteps:T,onPress:handleStepPress,pulseEnabled:j,labels:f,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,p=useMemo(()=>Array.from({length:c},(e,t)=>({key:`sk-step-${t}`,index:t})),[c]);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:p.map(e=>_jsx(View,{style:n.sItem,children:_jsx(Skeleton,{width:"100%",height:4,radius:"pill"})},e.key))})]}):_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:p.map(e=>{const t=e.index===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}),t?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})]})]},e.key)})})}:{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"})}),p.map(e=>_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}})]},e.key))]})})};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
|
+
"use strict";import{forwardRef,useEffect,useMemo,useRef,useState}from"react";import{Animated,Easing,Pressable,StyleSheet,View}from"react-native";import{fillText,useMobileUiText}from"../../text/index.js";import{STEPPER_TEXT}from"../../text/phone/stepper.g.js";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";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:i,toneColor:s,upcomingColor:o,upcomingFillColor:l,textOnColor:r,upcomingTextColor:n,interactive:a,canPress:c,totalSteps:u,onPress:p,pulseEnabled:d,labels:m,circleStyles:h,circleSlotStyle:g})=>{const x="active"===i,b=useTheme(),y=useRef(createAnimatedValue(1)).current,S=useRef(createAnimatedValue(.5)).current;useEffect(()=>{if(!x||!d)return y.setValue(1),void S.setValue(0);const e=Animated.loop(Animated.parallel([Animated.sequence([Animated.timing(y,{toValue:1.4,duration:1100,easing:Easing.out(Easing.ease),useNativeDriver:nativeDriver}),Animated.timing(y,{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()},[x,y,S,d]);const v="upcoming"===i?l:s,f="upcoming"===i?o:s,w="upcoming"===i?n:r,C="complete"===i,j=fillText(m.step,{index:e+1,total:u,label:t.label,status:statusWordFor(m,i)}),_=_jsxs(View,{style:h.relative,children:[x&&d?_jsx(Animated.View,{pointerEvents:"none",style:[h.pulse,{width:32,height:32,borderRadius:b.radius.pill,...smoothCorners,backgroundColor:s,opacity:S,transform:[{scale:y}]}]}):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:()=>p(e),disabled:!c,accessibilityRole:"button",accessibilityLabel:j,accessibilityState:{selected:x,disabled:!c},"aria-selected":x,"aria-disabled":!c,hitSlop:8,...hitSlopMarker(8),children:_}):_jsx(View,{accessibilityRole:"text",accessibilityLabel:j,accessibilityState:{selected:x},"aria-selected":x,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:i,activeStep:s,defaultActiveStep:o=0,pressMode:l="none",onStepPress:r,onActiveStepChange:n,variant:a="horizontal",tone:c="primary",formatCaption:u,showCaption:p=!0,loading:d=!1,labels:m,accessibilityLabel:h,style:g,circleStyle:x,labelStyle:b,connectorStyle:y,haptic:S,testID:v}=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 f=useMobileUiText("stepper",STEPPER_TEXT),w=useMemo(()=>({...f,...m}),[f,m]),C=useTheme(),j=C.settings.components.stepper?.pulseAnimation??!1,_=resolveHaptic(S,"selection"),V=useMemo(()=>buildStyles(C),[C]),k=useMemo(()=>buildCircleStyles(),[]),R=toneColorFor(C,c),T=C.colors.border,D=C.colors.bg,E=C.colors["text-muted"],I=toneOnColorFor(C,c),A=i.length,L="none"!==l,P=void 0!==s,[F,M]=useState(o),O=P?s:F,B=null==O||O<0?null:O,statusOf=e=>null===B?"upcoming":e<B?"complete":e===B?"active":"upcoming",N=i.map((e,t)=>statusOf(t)),H=N.filter(e=>"upcoming"!==e).length,U=N.filter(e=>"complete"===e).length,canPressStatus=e=>"back"===l?"complete"===e:L,handleStepPress=e=>{if(!canPressStatus(statusOf(e)))return;_&&triggerHaptic(_),r?.(e);const t="select"===l&&e===B?null:e;P||M(t),n?.(t)},W=useRef(createAnimatedValue(H)).current,z=useRef(H);useEffect(()=>{const e=z.current;if(e===H)return;z.current=H;const t=Animated.timing(W,{toValue:H,duration:C.motion.duration.default*Math.abs(H-e),easing:Easing.linear,useNativeDriver:!1});return t.start(),()=>t.stop()},[H,W,C.motion]);const sliceOf=e=>W.interpolate({inputRange:[e,e+1],outputRange:["0%","100%"],extrapolate:"clamp"}),G=A<=1?"0%":W.interpolate({inputRange:[1,A],outputRange:["0%","100%"],extrapolate:"clamp"}),$=null!==B&&B<A?B:null,q=h??(null!==$?fillText(w.progressStep,{step:$+1,total:A}):fillText(w.progressDone,{done:U,total:A})),[X,Z]=useState(0),J=A>0&&X>0?X/(2*A):0,K=_jsx(View,{ref:t,style:[V.container,g],testID:v,accessibilityRole:"progressbar",accessibilityLabel:q,accessibilityValue:{min:0,max:A,now:H},children:"segmented"===a?(()=>{const e=null!==$?i[$]:void 0,t=p?u?u($,A,e):null!==$?e?.label?fillText(w.captionStepLabelled,{step:$+1,total:A,label:e.label}):fillText(w.captionStep,{step:$+1,total:A}):fillText(w.captionDone,{done:U,total:A}):"";return _jsxs(View,{children:[p?_jsx(Text,{variant:"bodySmall",style:[V.sCaption,{marginBottom:C.space.sm},b],numberOfLines:1,children:t}):null,_jsx(View,{style:V.sRow,children:i.map((e,t)=>{const i=statusOf(t),s=fillText(w.step,{index:t+1,total:A,label:e.label,status:statusWordFor(w,i)}),o=_jsx(View,{testID:v?`${v}-segment-${t}`:void 0,style:[V.sTrack,{backgroundColor:T},y],children:_jsx(Animated.View,{style:[V.sFill,{backgroundColor:R,width:sliceOf(t)}]})});if(L){const l=canPressStatus(i);return _jsx(Pressable,{style:V.sItem,onPress:()=>handleStepPress(t),disabled:!l,accessibilityRole:"button",accessibilityLabel:s,accessibilityState:{selected:"active"===i,disabled:!l},"aria-selected":"active"===i,"aria-disabled":!l,hitSlop:{top:12,bottom:12},...hitSlopMarker({top:12,bottom:12}),children:o},e.key)}return _jsx(View,{style:V.sItem,accessibilityRole:"text",accessibilityLabel:s,accessibilityState:{selected:"active"===i},"aria-selected":"active"===i,children:o},e.key)})})]})})():"vertical"===a?_jsx(View,{style:V.vCol,children:i.map((e,t)=>{const i=statusOf(t),s=t===A-1;return _jsxs(View,{style:V.vRow,children:[_jsxs(View,{style:V.vLeft,children:[_jsx(StepCircle,{index:t,step:e,status:i,toneColor:R,upcomingColor:T,upcomingFillColor:D,onPressColor:R,textOnColor:I,upcomingTextColor:E,interactive:L,canPress:canPressStatus(i),totalSteps:A,onPress:handleStepPress,pulseEnabled:j,labels:w,circleStyles:k,circleSlotStyle:x}),s?null:_jsxs(View,{style:[V.vConnectorContainer,y],children:[_jsx(View,{style:[V.vConnectorTrack,{backgroundColor:T}]}),_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"===i?C.colors["text-subtle"]:C.colors["text-body"]},b],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=>Z(e.nativeEvent.layout.width),children:[_jsxs(View,{pointerEvents:"none",style:[V.hConnectorContainer,{left:J,right:J},y],children:[_jsx(View,{style:[V.hConnectorTrack,{backgroundColor:T}]}),_jsx(Animated.View,{style:[V.hConnectorFill,{backgroundColor:R,width:G}]})]}),i.map((e,t)=>{const i=statusOf(t);return _jsxs(View,{style:V.hStepItem,children:[_jsx(StepCircle,{index:t,step:e,status:i,toneColor:R,upcomingColor:T,upcomingFillColor:D,onPressColor:R,textOnColor:I,upcomingTextColor:E,interactive:L,canPress:canPressStatus(i),totalSteps:A,onPress:handleStepPress,pulseEnabled:j,labels:w,circleStyles:k,circleSlotStyle:x}),_jsx(Text,{variant:"caption",style:[V.hLabel,{color:"upcoming"===i?C.colors["text-subtle"]:C.colors["text-body"]},b],numberOfLines:1,children:e?.label??" "})]},e.key)})]})});return d?_jsx(StepperSkeleton,{...e}):K});StepperRoot.displayName="Stepper";const StepperSkeleton=({steps:e,variant:t="horizontal",showCaption:i=!0,style:s,testID:o})=>{const l=useTheme(),r=useMemo(()=>buildStyles(l),[l]),n=useMemo(()=>buildSkeletonStyles(l),[l]),a=e.length||3,c=useMemo(()=>Array.from({length:a},(e,t)=>({key:`sk-step-${t}`,index:t})),[a]);return"segmented"===t?_jsxs(View,{style:[r.container,s],testID:o,accessibilityRole:"progressbar",accessibilityState:{busy:!0},"aria-busy":!0,children:[i?_jsx(Skeleton,{shape:"text",width:"45%",height:14,style:{marginBottom:l.space.sm}}):null,_jsx(View,{style:r.sRow,children:c.map(e=>_jsx(View,{style:r.sItem,children:_jsx(Skeleton,{width:"100%",height:4,radius:"pill"})},e.key))})]}):_jsx(View,"vertical"===t?{style:[r.container,s],testID:o,accessibilityRole:"progressbar",accessibilityState:{busy:!0},"aria-busy":!0,children:_jsx(View,{style:n.vCol,children:c.map(e=>{const t=e.index===a-1;return _jsxs(View,{style:n.vRow,children:[_jsxs(View,{style:[n.vLeft,{width:32}],children:[_jsx(Skeleton,{shape:"circle",width:24,height:24}),t?null:_jsx(Skeleton,{width:2,height:36})]}),_jsxs(View,{style:n.vBody,children:[_jsx(Skeleton,{shape:"text",width:"55%",height:16,style:{marginBottom:l.space.xs}}),_jsx(Skeleton,{shape:"text",width:"80%",height:12})]})]},e.key)})})}:{style:[r.container,s],testID:o,accessibilityRole:"progressbar",accessibilityState:{busy:!0},"aria-busy":!0,children:_jsxs(View,{style:r.hRow,children:[_jsx(View,{pointerEvents:"none",style:[r.hConnectorContainer,{left:50/a+"%",right:50/a+"%"}],children:_jsx(Skeleton,{width:"100%",height:2,radius:"pill"})}),c.map(e=>_jsxs(View,{style:r.hStepItem,children:[_jsx(Skeleton,{shape:"circle",width:24,height:24}),_jsx(Skeleton,{shape:"text",width:"80%",height:12,style:{marginTop:l.space.xs}})]},e.key))]})})};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";export{
|
|
1
|
+
"use strict";export{default,Stepper}from"./Stepper.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{useCallback,useEffect,useMemo,useRef}from"react";import{Dimensions,Pressable,StyleSheet,View}from"react-native";import{GestureDetector,usePanGesture}from"react-native-gesture-handler";import Animated,{cancelAnimation,useAnimatedStyle,useSharedValue,withSpring}from"react-native-reanimated";import{scheduleOnRN}from"react-native-worklets";import{useTheme}from"../../theme/index.js";import{resolveHaptic,triggerHaptic}from"../../utils/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{renderSlotIcon}from"../AppIcon/slotIcon.js";import{Text}from"../Text/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const SPRING_CONFIG={damping:22,stiffness:260,mass:1},DRAG_ACTIVATION_OFFSET=10,RUBBER_BAND_FACTOR=.35,FAIL_OFFSET_Y=15,ACTION_ICON_SIZE=20,toneToBg=(e,t)=>{switch(t){case"primary":return e.colors.primary;case"success":return e.colors.success;case"warning":return e.colors.warning;case"danger":return e.colors.danger;case"info":return e.colors.info;default:return e.colors.neutral}},toneToOnColor=(e,t)=>{switch(t){case"primary":return e.colors["on-primary"];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"];default:return e.colors["on-neutral"]}},Swipeable=e=>{const{children:t,leftActions:n,rightActions:s,threshold:i,fullSwipeThreshold:o,onSwipeOpen:r,onSwipeClose:
|
|
1
|
+
"use strict";import{useCallback,useEffect,useMemo,useRef}from"react";import{Dimensions,Pressable,StyleSheet,View}from"react-native";import{GestureDetector,usePanGesture}from"react-native-gesture-handler";import Animated,{cancelAnimation,useAnimatedStyle,useSharedValue,withSpring}from"react-native-reanimated";import{scheduleOnRN}from"react-native-worklets";import{useTheme}from"../../theme/index.js";import{resolveHaptic,triggerHaptic}from"../../utils/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{renderSlotIcon}from"../AppIcon/slotIcon.js";import{Text}from"../Text/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const SPRING_CONFIG={damping:22,stiffness:260,mass:1},DRAG_ACTIVATION_OFFSET=10,RUBBER_BAND_FACTOR=.35,FAIL_OFFSET_Y=15,ACTION_ICON_SIZE=20,toneToBg=(e,t)=>{switch(t){case"primary":return e.colors.primary;case"success":return e.colors.success;case"warning":return e.colors.warning;case"danger":return e.colors.danger;case"info":return e.colors.info;default:return e.colors.neutral}},toneToOnColor=(e,t)=>{switch(t){case"primary":return e.colors["on-primary"];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"];default:return e.colors["on-neutral"]}},Swipeable=e=>{const{children:t,leftActions:n,rightActions:s,threshold:i,fullSwipeThreshold:o,onSwipeOpen:r,onSwipeClose:l,disabled:a=!1,haptic:c,style:u,contentStyle:d,actionStyle:m,accessibilityLabel:h,testID:p}=e,S=useTheme(),b=i??80,f=o??200,w=useMemo(()=>buildStyles(S),[S]),g=useMemo(()=>buildActionStyles(S),[S]),y=!!n&&n.length>0,v=!!s&&s.length>0,x=Dimensions.get("window").width,A=y?b*(n?.length??0):0,I=v?b*(s?.length??0):0,_=useSharedValue(0),N=useSharedValue(0),C=useRef(null);useEffect(()=>()=>{cancelAnimation(_),cancelAnimation(N)},[_,N]);const O=useCallback(e=>{C.current!==e&&(C.current=e,r?.(e))},[r]),R=useCallback(()=>{null!==C.current&&(C.current=null,l?.())},[l]),j=useCallback(e=>{const t="left"===e?n:s,i=t?.[0];i&&(!1!==c&&triggerHaptic("notificationSuccess"),i.onPress(),_.value=withSpring(0,SPRING_CONFIG),C.current=null,l?.())},[n,s,_,l,c]),G=useCallback(()=>{_.value=withSpring(0,SPRING_CONFIG),R()},[_,R]),k=useCallback(e=>{const t=resolveHaptic(c,"selection");t&&triggerHaptic(t),e.onPress(),G()},[G,c]),P=useMemo(()=>{const e=A,t=I,n=f,s=-f,i=x,o=-x,r=b,l=y,c=v;return{enabled:!a,testID:p?`${p}-gesture`:"swipeable-gesture",activeOffsetX:[-10,10],failOffsetY:[-15,15],onActivate:()=>{"worklet";N.value=_.value},onUpdate:n=>{"worklet";const s=N.value+n.translationX;_.value=s>0&&!l||s<0&&!c?0:s>e&&l?e+.35*(s-e):s<-t&&c?.35*(s+t)-t:s},onDeactivate:()=>{"worklet";const a=_.value;return l&&a>=n?(_.value=withSpring(i,SPRING_CONFIG),void scheduleOnRN(j,"left")):c&&a<=s?(_.value=withSpring(o,SPRING_CONFIG),void scheduleOnRN(j,"right")):l&&a>=r?(_.value=withSpring(e,SPRING_CONFIG),void scheduleOnRN(O,"left")):c&&a<=-r?(_.value=withSpring(-t,SPRING_CONFIG),void scheduleOnRN(O,"right")):(_.value=withSpring(0,SPRING_CONFIG),void scheduleOnRN(R))}}},[a,N,j,f,y,v,A,R,O,I,x,b,_,p]),T=usePanGesture(P),V=useAnimatedStyle(()=>({transform:[{translateX:_.value}]}),[_]),F=useAnimatedStyle(()=>({opacity:A>0?Math.min(1,Math.max(0,_.value/A)):0}),[A,_]),D=useAnimatedStyle(()=>({opacity:I>0?Math.min(1,Math.max(0,-_.value/I)):0}),[I,_]),E=useMemo(()=>{const e=[];return n?.forEach(t=>{e.push({name:t.key,label:t.label})}),s?.forEach(t=>{e.push({name:t.key,label:t.label})}),e},[n,s]),B=useCallback(e=>{const t=e.nativeEvent.actionName,i=[...n??[],...s??[]].find(e=>e.key===t);i&&(!1!==c&&triggerHaptic("selection"),i.onPress())},[n,s,c]);return y||v?_jsxs(View,{style:[w.root,u],testID:p,accessibilityLabel:h,accessibilityActions:E,onAccessibilityAction:B,children:[y?_jsx(Animated.View,{style:[w.actionsRow,w.actionsLeft,{width:A},m,F],pointerEvents:"box-none",children:n?.map(e=>_jsx(ActionButton,{action:e,theme:S,actionStyles:g,width:b,onPress:k},e.key))}):null,v?_jsx(Animated.View,{style:[w.actionsRow,w.actionsRight,{width:I},m,D],pointerEvents:"box-none",children:s?.map(e=>_jsx(ActionButton,{action:e,theme:S,actionStyles:g,width:b,onPress:k},e.key))}):null,_jsx(GestureDetector,{gesture:T,children:_jsx(Animated.View,{style:[w.content,d,V],children:t})})]}):_jsx(View,{style:u,testID:p,children:t})};Swipeable.displayName="Swipeable";const ActionButton=({action:e,theme:t,actionStyles:n,width:s,onPress:i})=>{assertValidValue("Swipeable","tone",e.tone,["primary","success","warning","danger","info","neutral"]);const o=e.tone??"neutral",r=toneToBg(t,o),l=renderSlotIcon(e.icon,{color:toneToOnColor(t,o),size:20,disabled:!1});return _jsxs(Pressable,{onPress:()=>i(e),accessibilityRole:"button",accessibilityLabel:e.label,style:[n.button,{width:s,backgroundColor:r,paddingHorizontal:t.space.sm}],children:[l?_jsx(View,{style:n.icon,accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants","aria-hidden":!0,children:l}):null,_jsx(Text,{variant:"bodySmall",weight:"semibold",style:[n.label,{color:toneToOnColor(t,o)}],numberOfLines:1,children:e.label})]})},buildActionStyles=e=>StyleSheet.create({button:{flexGrow:0,flexShrink:0,alignItems:"center",justifyContent:"center"},icon:{marginBottom:e.space.xxs},label:{textAlign:"center"}}),buildStyles=e=>StyleSheet.create({root:{position:"relative",overflow:"hidden"},content:{backgroundColor:"transparent"},actionsRow:{position:"absolute",top:0,bottom:0,flexDirection:"row"},actionsLeft:{left:0},actionsRight:{right:0,justifyContent:"flex-end"}});export{Swipeable};export default Swipeable;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{forwardRef,useEffect,useMemo,useRef}from"react";import{Animated,Easing,Pressable,StyleSheet,View}from"react-native";import{useControllableState}from"../../hooks/index.js";import{createAnimatedValue,resolveSwitchSize,useTheme}from"../../theme/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{smoothCorners}from"../../utils/corners.js";import{triggerHaptic}from"../../utils/hapticUtils.js";import{hitSlopMarker}from"../../utils/hitSlop.js";import{nativeDriver}from"../../utils/nativeDriver.js";import{ChoiceText,hasChoiceDetail}from"../FieldBase/ChoiceText.js";import{fieldTextAsString,hasFieldText}from"../FieldBase/FieldBase.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const toneColor=(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;default:return e.colors.primary}},Switch=forwardRef((e,t)=>{const{value:
|
|
1
|
+
"use strict";import{forwardRef,useEffect,useMemo,useRef}from"react";import{Animated,Easing,Pressable,StyleSheet,View}from"react-native";import{useControllableState}from"../../hooks/index.js";import{createAnimatedValue,resolveSwitchSize,useTheme}from"../../theme/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{smoothCorners}from"../../utils/corners.js";import{triggerHaptic}from"../../utils/hapticUtils.js";import{hitSlopMarker}from"../../utils/hitSlop.js";import{nativeDriver}from"../../utils/nativeDriver.js";import{ChoiceText,hasChoiceDetail}from"../FieldBase/ChoiceText.js";import{fieldTextAsString,hasFieldText}from"../FieldBase/FieldBase.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const toneColor=(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;default:return e.colors.primary}},Switch=forwardRef((e,t)=>{const{value:s,defaultValue:i,onChange:r,disabled:a=!1,size:o="md",tone:n="primary",label:l,description:c,helperText:d,error:u,layout:p="inline",accessibilityLabel:m,haptic:h="selection",bounce:f=!1,style:b,trackStyle:g,thumbStyle:y,testID:w,hitSlop:x,...S}=e,v=useTheme(),j=Object.keys(v.components.switch);assertValidValue("Switch","size",e.size,j),assertValidValue("Switch","tone",e.tone,["primary","success","warning","danger","info","neutral"]),assertValidValue("Switch","layout",e.layout,["inline","row"]);const[V,T]=useControllableState({value:s,defaultValue:i??!1,onChange:r}),C=j.includes(o)?o:"md",R=useMemo(()=>resolveSwitchSize(v,C),[v,C]),k=v.colors["switch-thumb"],A=useMemo(()=>buildStyles(v),[v]),D="dark"===v.mode?v.colors.neutral:v.colors["surface-disabled"],_=toneColor(v,n),z=x??8,E=useRef(createAnimatedValue(V?1:0)).current;useEffect(()=>{const e=Animated.spring(E,{toValue:V?1:0,damping:v.motion.spring.snappy.damping,stiffness:v.motion.spring.snappy.stiffness,mass:v.motion.spring.snappy.mass,useNativeDriver:nativeDriver});return e.start(),()=>e.stop()},[V,E,v.motion.spring.snappy]);const F=useRef(createAnimatedValue(V?1:0)).current;useEffect(()=>{const e=Animated.timing(F,{toValue:V?1:0,duration:v.motion.duration.fast,easing:Easing.out(Easing.ease),useNativeDriver:!1});return e.start(),()=>e.stop()},[V,F,v.motion.duration.fast]);const H=R.padding,M=R["track-width"]-R["thumb-size"]-R.padding,P=E.interpolate({inputRange:[0,1],outputRange:[H,M]}),I=F.interpolate({inputRange:[0,1],outputRange:[D,_]}),N=useRef(createAnimatedValue(1)).current,L=useRef(!0);useEffect(()=>{if(!f)return;if(L.current)return void(L.current=!1);const e=Animated.sequence([Animated.spring(N,{toValue:1.15,damping:10,stiffness:220,mass:1,useNativeDriver:nativeDriver}),Animated.spring(N,{toValue:1,damping:14,stiffness:240,mass:1,useNativeDriver:nativeDriver})]);return e.start(),()=>e.stop()},[V,f,N]);const handlePress=e=>{a||(!1!==h&&triggerHaptic(h),T(!V),S.onPressOut?.(e))},B=m??fieldTextAsString(l),O="string"==typeof u?u:void 0,q=hasChoiceDetail({description:c,error:O,helperText:d}),U=hasFieldText(l)||q,W=(!0===u||hasFieldText(u))&&!V&&!a,X="row"===p&&U,G=_jsxs(Animated.View,{style:[A.track,{width:R["track-width"],height:R["track-height"],borderRadius:v.radius.pill,...smoothCorners,backgroundColor:I},g],children:[W?_jsx(View,{pointerEvents:"none",style:[A.errorRing,{borderRadius:v.radius.pill,...smoothCorners,borderWidth:v.size.border,borderColor:v.colors["field-border-error"]}]}):null,_jsx(Animated.View,{style:[A.thumb,v.shadow.card,{backgroundColor:k,width:R["thumb-size"],height:R["thumb-size"],borderRadius:v.radius.pill,...smoothCorners,transform:[{translateX:P},{scale:N}]},y]})]});if(X)return _jsxs(Pressable,{ref:t,onPress:handlePress,disabled:a,accessibilityRole:"switch",accessibilityLabel:B,accessibilityHint:S.accessibilityHint??fieldTextAsString(c),accessibilityState:{checked:V,disabled:a},"aria-checked":V,"aria-disabled":a,testID:w,hitSlop:x,...null==x?{}:hitSlopMarker(x),...S,style:({pressed:e})=>[A.row,A.spreadRow,q?A.rowTop:null,{opacity:a?.55:e?.9:1},b],children:[_jsx(ChoiceText,{label:l,description:c,helperText:d,error:O,disabled:a,style:A.spreadText}),G]});const J=_jsx(Pressable,{ref:t,onPress:handlePress,disabled:a,accessibilityRole:"switch",accessibilityLabel:B,accessibilityHint:S.accessibilityHint??fieldTextAsString(c),accessibilityState:{checked:V,disabled:a},"aria-checked":V,"aria-disabled":a,testID:w,hitSlop:z,...hitSlopMarker(z),...S,style:({pressed:e})=>[{opacity:a?.55:e?.9:1},U?null:b],children:G});return U?_jsxs(View,{style:[A.row,q?A.rowTop:null,b],children:[J,_jsx(ChoiceText,{label:l,description:c,helperText:d,error:O,disabled:a,style:A.text})]}):J});Switch.displayName="Switch";const buildStyles=e=>StyleSheet.create({row:{flexDirection:"row",alignItems:"center"},track:{justifyContent:"center"},thumb:{position:"absolute",top:2},errorRing:{...StyleSheet.absoluteFill},rowTop:{alignItems:"flex-start"},text:{marginLeft:e.space.sm},spreadRow:{minHeight:44,justifyContent:"space-between"},spreadText:{flex:1,marginRight:e.space.md}});export{Switch};export default Switch;
|