@webority/mobile-ui 0.165.0 → 0.168.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";import{useEffect,useMemo,useRef}from"react";import{Animated,Easing,Platform,Pressable,StyleSheet,Text,View}from"react-native";import{useFieldErrorAnchor}from"../../hooks/useFieldErrorScroll.js";import{createAnimatedValue,fontFor,resolveFieldSize,useTheme}from"../../theme/index.js";import{ariaFromState}from"../../utils/ariaState.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{smoothCorners}from"../../utils/corners.js";import{defaultIcons}from"../AppIcon/defaultIcons.js";import{SquircleFill,useSquircle}from"../SquircleFill/SquircleFill.js";import{TextInkContext,useTextInk}from"../Text/textInk.js";import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from"react/jsx-runtime";const expandColorSides=e=>"string"==typeof e?{top:e,right:e,bottom:e,left:e}:{top:e.top??"transparent",right:e.right??"transparent",bottom:e.bottom??"transparent",left:e.left??"transparent"},expandWidthSides=e=>"number"==typeof e?{top:e,right:e,bottom:e,left:e}:{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0};export const pickRepresentativeBorderColor=e=>{for(const t of["bottom","top","left","right"]){const o=e[t];if(o&&"transparent"!==o)return o}return e.bottom};export const resolveFieldTextStyle=(e,t={})=>{const{disabled:o=!1}=t;return{color:o?e.colors["field-text-disabled"]:e.colors["field-text"],placeholderColor:o?e.colors["field-placeholder-disabled"]:e.colors["field-placeholder"],weightStyle:fontFor(e,"normal")}};export const RequiredMark=()=>{const e=useTheme();return _jsx(Text,{style:{color:e.colors["danger-text"]},..."web"===Platform.OS?{"aria-hidden":!0}:null,children:` ${e.settings.components.field?.requiredMarker??"*"}`})};export const RequiredPlaceholder=({text:e,color:t,fontSize:o,weightStyle:r,align:i="center",paddingTop:l,textAlign:s})=>_jsx(View,{pointerEvents:"none",style:[StyleSheet.absoluteFill,{justifyContent:"top"===i?"flex-start":"center",paddingTop:l}],children:_jsxs(Text,{accessible:!1,numberOfLines:1,style:{color:t,fontSize:o,...r,includeFontPadding:!1,textAlign:s},children:[e,_jsx(RequiredMark,{})]})});export const FieldErrorGlyph=({size:e,color:t})=>{const o=useTheme().settings.icons.error??defaultIcons.error;return _jsx(_Fragment,{children:o({size:e,color:t})})};export const hasFieldText=e=>null!=e&&!1!==e&&!0!==e&&""!==e;export const fieldTextAsString=e=>"string"==typeof e?e:void 0;export const FieldLabel=({children:e,size:t="md",required:o=!1,help:r,color:i,style:l})=>{const s=useTheme(),n=resolveFieldSize(s,t),d=hasFieldText(r),a=useTextInk(l,n["label-text"],i??s.colors["field-label"]),c=_jsxs(Text,{style:[familyStyles.label,{color:i??s.colors["field-label"],fontSize:n["label-text"],...fontFor(s,"semibold"),marginBottom:d?s.space.none:n["label-gap"]},d?familyStyles.labelShrink:null,l],children:[_jsx(TextInkContext.Provider,{value:a,children:e}),o?_jsx(RequiredMark,{}):null]});return d?_jsxs(View,{style:[familyStyles.labelRow,{marginBottom:n["label-gap"]}],children:[c,_jsx(View,{style:[familyStyles.help,{marginLeft:s.space.xs}],children:r})]}):c};export const FieldMessage=({text:e,error:t=!1,size:o="md",style:r})=>{const i=useTheme(),l=resolveFieldSize(i,o),s=t?i.colors["field-message"]:i.colors["text-muted"],n=useTextInk(r,l["message-text"],s);return hasFieldText(e)?_jsxs(View,{style:[familyStyles.messageRow,{marginTop:l["message-gap"],columnGap:i.space.xs}],accessibilityLiveRegion:t?"polite":"none",children:[t?_jsx(FieldErrorGlyph,{size:l["message-text"],color:s}):null,_jsx(Text,{style:[familyStyles.messageText,{color:s,fontSize:l["message-text"],...fontFor(i,"normal")},r],children:_jsx(TextInkContext.Provider,{value:n,children:e})})]}):null};const familyStyles=StyleSheet.create({label:{includeFontPadding:!1},labelShrink:{flexShrink:1},labelRow:{flexDirection:"row",alignItems:"center"},help:{flexShrink:0,alignItems:"center",justifyContent:"center"},messageRow:{flexDirection:"row",alignItems:"center"},messageText:{flexShrink:1,includeFontPadding:!1}});export const resolveVariantColors=(e,t)=>{let o,r,i,l,s;"outline"===t?(o=e.colors["field-bg"],r=e.colors["field-bg-focus"],i=e.colors["field-bg-disabled"],l=e.colors["field-border"],s=e.size.border):"underline"===t?(o="transparent",r=void 0,i="transparent",l={bottom:e.colors["field-border"]},s={bottom:e.size.border}):(o=e.colors["field-bg"],r=void 0,i=e.colors["field-bg-disabled"],l="transparent",s=0);const wrapToIdleShape=e=>"string"==typeof l?e:{bottom:e},n=expandColorSides(l),d=expandColorSides(wrapToIdleShape(e.colors["field-border-focus"]));return{backgroundIdleEmpty:o,backgroundIdleFilled:o,backgroundFocused:r,backgroundError:void 0,backgroundDisabled:i,borderIdle:n,borderFocused:d,borderError:expandColorSides(wrapToIdleShape(e.colors["field-border-error"])),borderDisabled:expandColorSides(l),borderWidth:expandWidthSides(s),borderFocusedRepresentative:pickRepresentativeBorderColor(d)}};export const FieldBase=e=>{assertValidValue("FieldBase","variant",e.variant,["outline","filled","underline"]),assertValidValue("FieldBase","size",e.size,["sm","md","lg"]);const{size:t="md",variant:o,focused:r=!1,disabled:i=!1,error:l=!1,filled:s=!1,leading:n,leadingDivider:d=!1,trailing:a,slotAlign:c="center",slotLineHeight:u,topNotch:b,children:p,onPress:m,pressFeedback:g=!0,minHeight:h,maxHeight:f,width:x,height:y,paddingHorizontal:S,paddingLeft:F,paddingRight:v,paddingVertical:j,radius:R,borderTopLeftRadius:T,borderTopRightRadius:k,borderBottomLeftRadius:C,borderBottomRightRadius:w,borderWidth:_,borderTopWidth:I,borderRightWidth:V,borderBottomWidth:z,borderLeftWidth:L,gap:B,flushBottom:D=!1,style:E,testID:W,accessibilityRole:A,accessibilityLabel:P,accessibilityState:q,accessibilityHint:M}=e,H=useTheme(),G=useFieldErrorAnchor(l),N=useMemo(()=>buildStyles(),[]),O=o??H.settings.components.field?.defaultVariant??"outline",$=resolveFieldSize(H,t),J=useMemo(()=>resolveVariantColors(H,O),[H,O]),K=l?2:r?1:0,Q=useRef(createAnimatedValue(K)).current;useEffect(()=>{const e=Animated.timing(Q,{toValue:K,duration:H.motion.duration.fast,easing:Easing.bezier(...H.motion.ease["in-out"]),useNativeDriver:!1});return e.start(),()=>e.stop()},[K,Q,H.motion.duration.fast,H.motion.ease["in-out"]]);const U=[0,1,2],X=s?J.backgroundIdleFilled:J.backgroundIdleEmpty,Y=J.backgroundFocused??X,Z=J.backgroundError??X,ee=i?J.backgroundDisabled:Q.interpolate({inputRange:U,outputRange:[X,Y,Z]}),te=J.borderIdle,oe=J.borderFocused,re=J.borderError,ie={top:I,right:V,bottom:z,left:L},le={top:ie.top??_??J.borderWidth.top,right:ie.right??_??J.borderWidth.right,bottom:ie.bottom??_??J.borderWidth.bottom,left:ie.left??_??J.borderWidth.left},se="underline"===O,ne=se?H.radius.none:R?H.radius[R]:$.radius,de=se?{tl:H.radius.none,tr:H.radius.none,bl:H.radius.none,br:H.radius.none}:{tl:T??ne,tr:k??ne,bl:C??ne,br:w??ne},sideColor=e=>Q.interpolate({inputRange:U,outputRange:[te[e],oe[e],re[e]]}),sameOnEverySide=e=>e.top===e.right&&e.top===e.bottom&&e.top===e.left,ae=!se&&de.tl===de.tr&&de.tl===de.bl&&de.tl===de.br&&sameOnEverySide(le)&&sameOnEverySide(te)&&sameOnEverySide(oe)&&sameOnEverySide(re)&&sameOnEverySide(J.borderDisabled),ce=useSquircle(ae,de.tl),ue=ce.active?{borderTopColor:"transparent",borderRightColor:"transparent",borderBottomColor:"transparent",borderLeftColor:"transparent"}:i?{borderTopColor:J.borderDisabled.top,borderRightColor:J.borderDisabled.right,borderBottomColor:J.borderDisabled.bottom,borderLeftColor:J.borderDisabled.left}:{borderTopColor:sideColor("top"),borderRightColor:sideColor("right"),borderBottomColor:sideColor("bottom"),borderLeftColor:sideColor("left")},be=i?J.borderDisabled.top:sideColor("top"),pe={minHeight:y??h??$["min-height"],maxHeight:f,paddingHorizontal:S??$["padding-x"],paddingVertical:j??$["padding-y"],paddingLeft:F??S??$["padding-x"],paddingRight:v??S??$["padding-x"],backgroundColor:ce.active?"transparent":ee,columnGap:B??H.space.md,alignItems:"top"===c?"flex-start":"center",borderTopLeftRadius:de.tl,borderTopRightRadius:de.tr,borderBottomLeftRadius:de.bl,borderBottomRightRadius:de.br,borderCurve:smoothCorners.borderCurve,borderTopWidth:le.top,borderRightWidth:le.right,borderBottomWidth:le.bottom,borderLeftWidth:le.left,...ue,...void 0!==x?{width:x}:null,...void 0!==y?{height:y}:null},me=useRef(K);me.current=K,useEffect(()=>{Q.setValue(me.current)},[J,Q]);const ge=D?{marginBottom:H.space.none}:void 0,he={disabled:i,...q},fe="top"===c,xe=fe?{alignSelf:"flex-start",marginTop:Math.max(0,((u??$.icon)-$.icon)/2)}:null,ye=y??h??$["min-height"],Se=(()=>{if(!b)return 0;const e=Math.min(de.tl,ye/2),t=b.left;return e<=0||t>=e?0:Math.ceil(e-Math.sqrt(e*e-(e-t)*(e-t)))})(),Fe=b&&le.top>0?_jsx(Animated.View,{pointerEvents:"none",style:{position:"absolute",top:-le.top,left:b.left-le.left,width:b.width,height:le.top+Se,backgroundColor:ee}}):null,renderInner=e=>_jsxs(_Fragment,{children:[ce.active&&ce.size?_jsx(SquircleFill,{width:ce.size.width,height:ce.size.height,radius:de.tl,fill:e&&!i?H.colors["surface-pressed"]:ee,stroke:be,strokeWidth:le.top}):null,Fe,null!=n?_jsx(View,{style:[N.slot,xe],children:n}):null,null!=n&&d?_jsx(View,{pointerEvents:"none",style:[N.divider,xe,{height:$.icon,backgroundColor:H.colors["field-border"]}]}):null,_jsx(View,{style:[N.content,fe?N.contentTop:null],children:p}),null!=a?_jsx(View,{style:[N.slot,xe],children:a}):null]}),ve=_jsx(Animated.View,{ref:G,onLayout:ce.onLayout,style:[N.box,pe,m?null:ge,E],accessibilityRole:A,accessibilityLabel:P,accessibilityHint:M,accessibilityState:he,...ariaFromState(he),testID:W,children:renderInner(!1)});return m&&!g?_jsx(Pressable,{onPress:m,disabled:i,accessible:!1,style:ge,testID:W?`${W}-press`:void 0,children:ve}):m?_jsx(Pressable,{onPress:m,disabled:i,style:ge,accessibilityRole:A??"button",accessibilityLabel:P,accessibilityHint:M,accessibilityState:he,...ariaFromState(he),testID:W,children:({pressed:e})=>_jsx(Animated.View,{ref:G,onLayout:ce.onLayout,style:[N.box,pe,!e||i||ce.active?null:{backgroundColor:H.colors["surface-pressed"]},E],children:renderInner(e)})}):ve};FieldBase.displayName="FieldBase";const buildStyles=()=>StyleSheet.create({box:{flexDirection:"row",alignItems:"center",overflow:"visible"},slot:{alignItems:"center",justifyContent:"center"},divider:{width:1,alignSelf:"center"},content:{flex:1,flexDirection:"row",alignItems:"center"},contentTop:{alignItems:"flex-start"}});export default FieldBase;
|
|
1
|
+
"use strict";import{useEffect,useMemo,useRef}from"react";import{Animated,Easing,Platform,Pressable,StyleSheet,Text,View}from"react-native";import{useFieldErrorAnchor}from"../../hooks/useFieldErrorScroll.js";import{createAnimatedValue,fontFor,resolveFieldSize,useTheme}from"../../theme/index.js";import{ariaFromState}from"../../utils/ariaState.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{smoothCorners}from"../../utils/corners.js";import{defaultIcons}from"../AppIcon/defaultIcons.js";import{SquircleFill,useSquircle}from"../SquircleFill/SquircleFill.js";import{TextInkContext,useTextInk}from"../Text/textInk.js";import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from"react/jsx-runtime";const expandColorSides=e=>"string"==typeof e?{top:e,right:e,bottom:e,left:e}:{top:e.top??"transparent",right:e.right??"transparent",bottom:e.bottom??"transparent",left:e.left??"transparent"},expandWidthSides=e=>"number"==typeof e?{top:e,right:e,bottom:e,left:e}:{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0};export const pickRepresentativeBorderColor=e=>{for(const t of["bottom","top","left","right"]){const o=e[t];if(o&&"transparent"!==o)return o}return e.bottom};export const resolveFieldTextStyle=(e,t={})=>{const{disabled:o=!1}=t;return{color:o?e.colors["field-text-disabled"]:e.colors["field-text"],placeholderColor:o?e.colors["field-placeholder-disabled"]:e.colors["field-placeholder"],weightStyle:fontFor(e,"normal")}};export const RequiredMark=()=>{const e=useTheme();return _jsx(Text,{style:{color:e.colors["danger-text"]},..."web"===Platform.OS?{"aria-hidden":!0}:null,children:` ${e.settings.components.field?.requiredMarker??"*"}`})};export const RequiredPlaceholder=({text:e,color:t,fontSize:o,weightStyle:r,align:i="center",paddingTop:l,textAlign:s})=>_jsx(View,{pointerEvents:"none",style:[StyleSheet.absoluteFill,{justifyContent:"top"===i?"flex-start":"center",paddingTop:l}],children:_jsxs(Text,{accessible:!1,numberOfLines:1,style:{color:t,fontSize:o,...r,includeFontPadding:!1,textAlign:s},children:[e,_jsx(RequiredMark,{})]})});export const FieldErrorGlyph=({size:e,color:t})=>{const o=useTheme().settings.icons.error??defaultIcons.error;return _jsx(_Fragment,{children:o({size:e,color:t})})};export const hasFieldText=e=>null!=e&&!1!==e&&!0!==e&&""!==e;export const fieldTextAsString=e=>"string"==typeof e?e:void 0;export const FieldLabel=({children:e,size:t="md",required:o=!1,help:r,color:i,style:l})=>{const s=useTheme(),n=resolveFieldSize(s,t),d=hasFieldText(r),a=useTextInk(l,n["label-text"],i??s.colors["field-label"]),c=_jsxs(Text,{style:[familyStyles.label,{color:i??s.colors["field-label"],fontSize:n["label-text"],...fontFor(s,"semibold"),marginBottom:d?s.space.none:n["label-gap"]},d?familyStyles.labelShrink:null,l],children:[_jsx(TextInkContext.Provider,{value:a,children:e}),o?_jsx(RequiredMark,{}):null]});return d?_jsxs(View,{style:[familyStyles.labelRow,{marginBottom:n["label-gap"]}],children:[c,_jsx(View,{style:[familyStyles.help,{marginLeft:s.space.xs}],children:"string"==typeof r||"number"==typeof r?_jsx(Text,{style:[familyStyles.helpText,{color:s.colors["text-muted"],fontSize:n["message-text"],...fontFor(s,"normal")}],children:r}):r})]}):c};export const FieldMessage=({text:e,error:t=!1,size:o="md",style:r})=>{const i=useTheme(),l=resolveFieldSize(i,o),s=t?i.colors["field-message"]:i.colors["text-muted"],n=useTextInk(r,l["message-text"],s);return hasFieldText(e)?_jsxs(View,{style:[familyStyles.messageRow,{marginTop:l["message-gap"],columnGap:i.space.xs}],accessibilityLiveRegion:t?"polite":"none",children:[t?_jsx(FieldErrorGlyph,{size:l["message-text"],color:s}):null,_jsx(Text,{style:[familyStyles.messageText,{color:s,fontSize:l["message-text"],...fontFor(i,"normal")},r],children:_jsx(TextInkContext.Provider,{value:n,children:e})})]}):null};const familyStyles=StyleSheet.create({label:{includeFontPadding:!1},labelShrink:{flexShrink:1},labelRow:{flexDirection:"row",alignItems:"center"},help:{flexShrink:0,alignItems:"center",justifyContent:"center"},helpText:{includeFontPadding:!1},messageRow:{flexDirection:"row",alignItems:"center"},messageText:{flexShrink:1,includeFontPadding:!1}});export const resolveVariantColors=(e,t)=>{let o,r,i,l,s;"outline"===t?(o=e.colors["field-bg"],r=e.colors["field-bg-focus"],i=e.colors["field-bg-disabled"],l=e.colors["field-border"],s=e.size.border):"underline"===t?(o="transparent",r=void 0,i="transparent",l={bottom:e.colors["field-border"]},s={bottom:e.size.border}):(o=e.colors["field-bg"],r=void 0,i=e.colors["field-bg-disabled"],l="transparent",s=0);const wrapToIdleShape=e=>"string"==typeof l?e:{bottom:e},n=expandColorSides(l),d=expandColorSides(wrapToIdleShape(e.colors["field-border-focus"]));return{backgroundIdleEmpty:o,backgroundIdleFilled:o,backgroundFocused:r,backgroundError:void 0,backgroundDisabled:i,borderIdle:n,borderFocused:d,borderError:expandColorSides(wrapToIdleShape(e.colors["field-border-error"])),borderDisabled:expandColorSides(l),borderWidth:expandWidthSides(s),borderFocusedRepresentative:pickRepresentativeBorderColor(d)}};export const FieldBase=e=>{assertValidValue("FieldBase","variant",e.variant,["outline","filled","underline"]),assertValidValue("FieldBase","size",e.size,["sm","md","lg"]);const{size:t="md",variant:o,focused:r=!1,disabled:i=!1,error:l=!1,filled:s=!1,leading:n,leadingDivider:d=!1,trailing:a,slotAlign:c="center",slotLineHeight:u,topNotch:b,children:p,onPress:m,pressFeedback:g=!0,minHeight:f,maxHeight:h,width:x,height:y,paddingHorizontal:S,paddingLeft:F,paddingRight:v,paddingVertical:T,radius:j,borderTopLeftRadius:R,borderTopRightRadius:k,borderBottomLeftRadius:C,borderBottomRightRadius:w,borderWidth:_,borderTopWidth:I,borderRightWidth:V,borderBottomWidth:z,borderLeftWidth:L,gap:B,flushBottom:D=!1,style:E,testID:W,accessibilityRole:P,accessibilityLabel:A,accessibilityState:q,accessibilityHint:M}=e,H=useTheme(),G=useFieldErrorAnchor(l),N=useMemo(()=>buildStyles(),[]),O=o??H.settings.components.field?.defaultVariant??"outline",$=resolveFieldSize(H,t),J=useMemo(()=>resolveVariantColors(H,O),[H,O]),K=l?2:r?1:0,Q=useRef(createAnimatedValue(K)).current;useEffect(()=>{const e=Animated.timing(Q,{toValue:K,duration:H.motion.duration.fast,easing:Easing.bezier(...H.motion.ease["in-out"]),useNativeDriver:!1});return e.start(),()=>e.stop()},[K,Q,H.motion.duration.fast,H.motion.ease["in-out"]]);const U=[0,1,2],X=s?J.backgroundIdleFilled:J.backgroundIdleEmpty,Y=J.backgroundFocused??X,Z=J.backgroundError??X,ee=i?J.backgroundDisabled:Q.interpolate({inputRange:U,outputRange:[X,Y,Z]}),te=J.borderIdle,oe=J.borderFocused,re=J.borderError,ie={top:I,right:V,bottom:z,left:L},le={top:ie.top??_??J.borderWidth.top,right:ie.right??_??J.borderWidth.right,bottom:ie.bottom??_??J.borderWidth.bottom,left:ie.left??_??J.borderWidth.left},se="underline"===O,ne=se?H.radius.none:j?H.radius[j]:$.radius,de=se?{tl:H.radius.none,tr:H.radius.none,bl:H.radius.none,br:H.radius.none}:{tl:R??ne,tr:k??ne,bl:C??ne,br:w??ne},sideColor=e=>Q.interpolate({inputRange:U,outputRange:[te[e],oe[e],re[e]]}),sameOnEverySide=e=>e.top===e.right&&e.top===e.bottom&&e.top===e.left,ae=!se&&de.tl===de.tr&&de.tl===de.bl&&de.tl===de.br&&sameOnEverySide(le)&&sameOnEverySide(te)&&sameOnEverySide(oe)&&sameOnEverySide(re)&&sameOnEverySide(J.borderDisabled),ce=useSquircle(ae,de.tl),ue=ce.active?{borderTopColor:"transparent",borderRightColor:"transparent",borderBottomColor:"transparent",borderLeftColor:"transparent"}:i?{borderTopColor:J.borderDisabled.top,borderRightColor:J.borderDisabled.right,borderBottomColor:J.borderDisabled.bottom,borderLeftColor:J.borderDisabled.left}:{borderTopColor:sideColor("top"),borderRightColor:sideColor("right"),borderBottomColor:sideColor("bottom"),borderLeftColor:sideColor("left")},be=i?J.borderDisabled.top:sideColor("top"),pe={minHeight:y??f??$["min-height"],maxHeight:h,paddingHorizontal:S??$["padding-x"],paddingVertical:T??$["padding-y"],paddingLeft:F??S??$["padding-x"],paddingRight:v??S??$["padding-x"],backgroundColor:ce.active?"transparent":ee,columnGap:B??H.space.md,alignItems:"top"===c?"flex-start":"center",borderTopLeftRadius:de.tl,borderTopRightRadius:de.tr,borderBottomLeftRadius:de.bl,borderBottomRightRadius:de.br,borderCurve:smoothCorners.borderCurve,borderTopWidth:le.top,borderRightWidth:le.right,borderBottomWidth:le.bottom,borderLeftWidth:le.left,...ue,...void 0!==x?{width:x}:null,...void 0!==y?{height:y}:null},me=useRef(K);me.current=K,useEffect(()=>{Q.setValue(me.current)},[J,Q]);const ge=D?{marginBottom:H.space.none}:void 0,fe={disabled:i,...q},he="top"===c,xe=he?{alignSelf:"flex-start",marginTop:Math.max(0,((u??$.icon)-$.icon)/2)}:null,ye=y??f??$["min-height"],Se=(()=>{if(!b)return 0;const e=Math.min(de.tl,ye/2),t=b.left;return e<=0||t>=e?0:Math.ceil(e-Math.sqrt(e*e-(e-t)*(e-t)))})(),Fe=b&&le.top>0?_jsx(Animated.View,{pointerEvents:"none",style:{position:"absolute",top:-le.top,left:b.left-le.left,width:b.width,height:le.top+Se,backgroundColor:ee}}):null,renderInner=e=>_jsxs(_Fragment,{children:[ce.active&&ce.size?_jsx(SquircleFill,{width:ce.size.width,height:ce.size.height,radius:de.tl,fill:e&&!i?H.colors["surface-pressed"]:ee,stroke:be,strokeWidth:le.top}):null,Fe,null!=n?_jsx(View,{style:[N.slot,xe],children:n}):null,null!=n&&d?_jsx(View,{pointerEvents:"none",style:[N.divider,xe,{height:$.icon,backgroundColor:H.colors["field-border"]}]}):null,_jsx(View,{style:[N.content,he?N.contentTop:null],children:p}),null!=a?_jsx(View,{style:[N.slot,xe],children:a}):null]}),ve=_jsx(Animated.View,{ref:G,onLayout:ce.onLayout,style:[N.box,pe,m?null:ge,E],accessibilityRole:P,accessibilityLabel:A,accessibilityHint:M,accessibilityState:fe,...ariaFromState(fe),testID:W,children:renderInner(!1)});return m&&!g?_jsx(Pressable,{onPress:m,disabled:i,accessible:!1,style:ge,testID:W?`${W}-press`:void 0,children:ve}):m?_jsx(Pressable,{onPress:m,disabled:i,style:ge,accessibilityRole:P??"button",accessibilityLabel:A,accessibilityHint:M,accessibilityState:fe,...ariaFromState(fe),testID:W,children:({pressed:e})=>_jsx(Animated.View,{ref:G,onLayout:ce.onLayout,style:[N.box,pe,!e||i||ce.active?null:{backgroundColor:H.colors["surface-pressed"]},E],children:renderInner(e)})}):ve};FieldBase.displayName="FieldBase";const buildStyles=()=>StyleSheet.create({box:{flexDirection:"row",alignItems:"center",overflow:"visible"},slot:{alignItems:"center",justifyContent:"center"},divider:{width:1,alignSelf:"center"},content:{flex:1,flexDirection:"row",alignItems:"center"},contentTop:{alignItems:"flex-start"}});export default FieldBase;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{forwardRef,useCallback,useImperativeHandle,useMemo,useRef,useState}from"react";import{Image,Pressable,ScrollView,StyleSheet,Text,View}from"react-native";import{useControllableState}from"../../hooks/index.js";import{fontFor,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{hitSlopMarker}from"../../utils/hitSlop.js";import{defaultIcons}from"../AppIcon/defaultIcons.js";import{hasFieldText}from"../FieldBase/index.js";import{OptionSheet}from"../OptionSheet/OptionSheet.js";import{Spinner}from"../Spinner/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";let fileIdSeq=0;const nextFileId=()=>"wfp-"+ ++fileIdSeq;export const DEFAULT_FILE_PICKER_LABELS={trigger:"Attach file",addMore:"Add more",sheetTitle:"Add from",removeFile:e=>`Remove ${e}`,retry:"Retry upload",attachments:"Attachments",attached:e=>`${e} file${1===e?"":"s"} attached`,processing:"Processing…",uploading:e=>`Uploading ${e}%`,uploaded:"Uploaded",failed:"Failed",errorTooMany:e=>`You can attach up to ${e} files.`,errorTooLarge:(e,t)=>`${e} is larger than ${t} MB.`,errorWrongType:e=>`${e} is not an accepted file type.`};export const formatFileSize=e=>{if(void 0===e||e<=0)return"";const t=["B","KB","MB","GB"];let r=e,s=0;for(;r>=1024&&s<t.length-1;)r/=1024,s+=1;const i=r>=10||0===s?Math.round(r):Math.round(10*r)/10,o=t[s];if(void 0===o)throw new Error("formatFileSize has no unit label for this size.");return`${i} ${o}`};export const matchesAccept=(e,t)=>!t||0===t.length||!!e&&t.some(t=>"*/*"===t||"*"===t||(t.endsWith("/*")?e.startsWith(t.slice(0,t.length-1)):e===t));const isImage=e=>!0===e.type?.startsWith("image/")||!e.type&&/\.(png|jpe?g|gif|webp|heic)$/i.test(e.name),imageSourceOf=e=>e.thumbnailUrl??(isImage(e)?e.uri??e.url:void 0),extensionOf=e=>{const t=e.lastIndexOf(".");return t<=0||t===e.length-1?"FILE":e.slice(t+1).toUpperCase().slice(0,4)},FilePicker=forwardRef((e,t)=>{assertValidValue("FilePicker","variant",e.variant,["card","list"]);const{files:r,defaultFiles:s,onChange:i,sources:o,maxFiles:l,maxSizeMB:n,accept:a,validate:c,process:d,variant:u="card",renderFile:h,renderTrigger:g,disabled:p=!1,helperText:m,error:x,labels:b,haptic:f,onPick:y,onRemove:T,onError:S,onFilePress:j,onRetry:C,style:w,accessibilityLabel:F,testID:v}=e,_=useTheme(),P=useMemo(()=>buildStyles(_),[_]),z=useMemo(()=>({...DEFAULT_FILE_PICKER_LABELS,...b}),[b]),k=_.radius.md,I=_.colors.primary,[R,V]=useControllableState({value:r,defaultValue:s??[],onChange:i}),M=useRef(R);M.current=R;const L=useCallback(e=>{M.current=e,V(e)},[V]),[O,B]=useState(null),[H,$]=useState(!1),E=x??O??void 0,A="number"==typeof l&&R.length>=l,W=useCallback((e,t)=>{const[r]=e;void 0!==r&&(B(r),e.forEach(e=>{S?.(e,t)}),!1!==f&&triggerHaptic("notificationError"))},[S,f]),D=useCallback(async e=>{let t;try{t=await e.pick()}catch(e){return void W([e instanceof Error?e.message:String(e)])}if(!t||0===t.length)return;const r=[];let s=t.map(e=>({id:nextFileId(),name:e.name??e.uri.split("/").pop()??"file",uri:e.uri,type:e.type,bytes:e.size,meta:e.meta,status:"idle"}));if("number"==typeof l){const e=Math.max(0,l-M.current.length);s.length>e&&(r.push(z.errorTooMany(l)),s=s.slice(0,e))}const i=[];for(const e of s){if("number"==typeof n&&"number"==typeof e.bytes&&e.bytes>1024*n*1024){r.push(z.errorTooLarge(e.name,n));continue}if(!matchesAccept(e.type,a)){r.push(z.errorWrongType(e.name));continue}const t=c?.(e);t?r.push(t):i.push(e)}if(W(r),0===i.length)return;if(!d){L([...M.current,...i]);const[e]=r;B(e??null);const t=resolveHaptic(f,"selection");return t&&triggerHaptic(t),void y?.(i)}const o=i.map(e=>({...e,status:"processing"}));L([...M.current,...o]);const u=[];for(const e of o)try{const t=await d({...e,status:"idle"}),r={...t,id:e.id,status:t.status??"idle"};L(M.current.map(t=>t.id===e.id?r:t)),u.push(r)}catch(t){L(M.current.filter(t=>t.id!==e.id)),W([t instanceof Error?t.message:String(t)],e)}if(u.length>0){0===r.length&&B(null);const e=resolveHaptic(f,"selection");e&&triggerHaptic(e),y?.(u)}},[l,n,a,c,d,z,W,L,y,f]),U=useCallback(e=>{if(p||A)return;const[t]=o,r=e?o.find(t=>t.key===e):1===o.length?t:void 0;r?D(r):o.length>1&&$(!0)},[p,A,o,D]),G=useCallback(e=>{if(p)return;L(M.current.filter(t=>t.id!==e.id)),B(null);const t=resolveHaptic(f,"selection");t&&triggerHaptic(t),T?.(e)},[p,L,T,f]),K=useCallback(()=>{L([]),B(null)},[L]);useImperativeHandle(t,()=>({open:U,clear:K}),[U,K]);const N=0===R.length?z.trigger:z.attached(R.length),q=F??`${z.attachments}. ${N}`,statusText=e=>{switch(e.status){case"processing":return z.processing;case"uploading":return z.uploading(Math.round(100*(e.progress??0)));case"done":return z.uploaded;case"error":return e.error??z.failed;case"idle":case void 0:return""}},fileA11yLabel=e=>[e.name,formatFileSize(e.bytes),statusText(e)].filter(Boolean).join(", "),Y=_.settings.icons.attachment??defaultIcons.attachment,renderStatusOverlay=e=>{if("processing"===e.status)return _jsx(View,{style:[P.tileOverlay,{backgroundColor:_.colors.scrim}],children:_jsx(Spinner,{size:"sm"})});if("uploading"===e.status){const t=Math.round(100*(e.progress??0));return _jsxs(View,{style:[P.tileOverlay,{backgroundColor:_.colors.scrim}],children:[_jsx(Text,{style:[P.tileOverlayText,{color:_.colors["on-scrim"]}],children:`${t}%`}),_jsx(View,{style:[P.tileProgressTrack,{backgroundColor:_.colors.border}],children:_jsx(View,{style:[P.tileProgressFill,{width:`${t}%`,backgroundColor:_.colors.primary}]})})]})}return"done"===e.status?_jsx(View,{style:[P.doneBadge,{backgroundColor:_.colors.success}],children:_jsx(Text,{style:[P.doneBadgeText,{color:_.colors["on-success"]}],children:"✓"})}):null},renderThumbnail=e=>{const t=imageSourceOf(e);return t?_jsx(Image,{source:{uri:t},style:P.thumbnailImage}):_jsx(View,{style:[P.extensionTile,{backgroundColor:_.colors["bg-subtle"]}],children:_jsx(Text,{style:[P.extensionText,{color:_.colors["text-muted"],...fontFor(_,"semibold")}],children:extensionOf(e.name)})})},removeButton=e=>_jsx(Pressable,{onPress:()=>G(e),disabled:p,hitSlop:8,...hitSlopMarker(8),accessibilityRole:"button",accessibilityLabel:z.removeFile(e.name),style:[P.removeButton,{backgroundColor:_.colors.scrim}],children:_jsx(Text,{style:[P.removeButtonText,{color:_.colors["on-scrim"]}],children:"×"})}),retryButton=e=>C&&"error"===e.status?_jsx(Pressable,{onPress:()=>C(e),disabled:p,hitSlop:8,...hitSlopMarker(8),accessibilityRole:"button",accessibilityLabel:z.retry,children:_jsx(Text,{style:[P.retryText,{color:_.colors.primary}],children:"↻"})}):null,renderOneFile=(e,t)=>{const r={file:e,index:t,disabled:p,remove:()=>G(e),retry:C?()=>C(e):void 0},s=h?h(r):"card"===u?(e=>{const{file:t}=e;return _jsxs(View,{style:[P.tile,{width:84,height:84,borderRadius:k,...smoothCorners,borderColor:"error"===t.status?_.colors.danger:_.colors.border}],children:[renderThumbnail(t),renderStatusOverlay(t),"error"===t.status?_jsx(View,{style:[P.tileOverlay,{backgroundColor:_.colors.scrim}],children:retryButton(t)}):null,removeButton(t)]})})(r):(e=>{const{file:t}=e,r=statusText(t);return _jsxs(View,{style:[P.listRow,{borderRadius:k,...smoothCorners,borderColor:"error"===t.status?_.colors.danger:_.colors.border,backgroundColor:_.colors.bg}],children:[_jsxs(View,{style:[P.listThumb,{borderRadius:_.radius.sm,...smoothCorners}],children:[renderThumbnail(t),"processing"===t.status?_jsx(View,{style:[P.tileOverlay,{backgroundColor:_.colors.scrim}],children:_jsx(Spinner,{size:"sm"})}):null]}),_jsxs(View,{style:P.listTextWrap,children:[_jsx(Text,{numberOfLines:1,ellipsizeMode:"middle",style:[P.listName,{color:_.colors["text-body"],fontSize:_.text.sm.size,...fontFor(_,"medium")}],children:t.name}),_jsx(Text,{numberOfLines:1,style:[P.listSubtitle,{color:"error"===t.status?_.colors["danger-text"]:_.colors["text-subtle"],fontSize:_.text.xs.size}],children:[formatFileSize(t.bytes),r].filter(Boolean).join(" · ")}),"uploading"===t.status?_jsx(View,{style:[P.listProgressTrack,{backgroundColor:_.colors.border}],children:_jsx(View,{style:[P.listProgressFill,{width:`${Math.round(100*(t.progress??0))}%`,backgroundColor:_.colors.primary}]})}):null]}),retryButton(t),_jsx(Pressable,{onPress:()=>G(t),disabled:p,hitSlop:8,...hitSlopMarker(8),accessibilityRole:"button",accessibilityLabel:z.removeFile(t.name),children:_jsx(Text,{style:[P.listRemoveText,{color:_.colors["text-subtle"]}],children:"×"})})]})})(r);return _jsx(Pressable,{onPress:j?()=>j(e):void 0,disabled:p||!j,accessibilityLabel:fileA11yLabel(e),children:s},e.id)},J={open:U,disabled:p||A,fileCount:R.length,atCapacity:A},dashedTrigger=e=>_jsxs(Pressable,{onPress:()=>U(),disabled:p||A,accessibilityRole:"button",accessibilityState:{disabled:p||A},"aria-disabled":p||A,style:({pressed:t})=>[P.trigger,e?P.triggerCompact:null,{borderRadius:k,...smoothCorners,borderColor:I,backgroundColor:t?_.colors["surface-pressed"]:_.colors.bg,opacity:p||A?.55:1}],children:[_jsxs(View,{style:P.triggerRow,children:[Y?Y({size:16,color:_.colors.primary}):null,_jsx(Text,{style:[P.triggerText,{color:_.colors.primary,fontSize:_.text.sm.size,...fontFor(_,"medium")}],children:0===R.length?z.trigger:z.addMore})]}),!e&&m?_jsx(Text,{style:[P.helperText,{color:_.colors["text-subtle"],fontSize:_.text.xs.size}],children:m}):null]}),Q=_jsx(Pressable,{onPress:()=>U(),disabled:p||A,accessibilityRole:"button",accessibilityLabel:z.addMore,style:({pressed:e})=>[P.tile,P.addTile,{width:84,height:84,borderRadius:k,...smoothCorners,borderColor:I,backgroundColor:e?_.colors["surface-pressed"]:"transparent",opacity:p||A?.55:1}],children:_jsx(Text,{style:[P.addTileText,{color:_.colors.primary}],children:"+"})});return _jsxs(View,{style:[P.container,w],testID:v,accessibilityLabel:q,children:["card"===u?0===R.length?g?g(J):dashedTrigger(!1):_jsxs(ScrollView,{horizontal:!0,showsHorizontalScrollIndicator:!1,contentContainerStyle:[P.strip,{columnGap:_.space.sm}],children:[R.map(renderOneFile),g?g(J):A||p?null:Q]}):_jsxs(View,{style:{rowGap:_.space.sm},children:[g?g(J):A?null:dashedTrigger(R.length>0),R.map(renderOneFile)]}),hasFieldText(E)?_jsx(Text,{accessibilityLiveRegion:"polite",style:[P.errorText,{color:_.colors["danger-text"],fontSize:_.text.xs.size,marginTop:_.space.xxs}],children:E}):null,_jsx(OptionSheet,{open:H,onClose:()=>$(!1),title:z.sheetTitle,options:o,getOptionLabel:e=>e.label,getOptionValue:e=>e.key,getOptionDescription:e=>e.description,getOptionIcon:e=>e.icon,onChange:(e,t)=>{$(!1),D(t)}})]})});FilePicker.displayName="FilePicker";const buildStyles=e=>StyleSheet.create({container:{width:"100%"},trigger:{borderWidth:1,borderStyle:"dashed",alignItems:"center",minHeight:48,paddingVertical:e.space.md,paddingHorizontal:e.space.lg},triggerCompact:{minHeight:40,paddingVertical:e.space.sm},triggerRow:{flexDirection:"row",alignItems:"center",columnGap:e.space.sm},triggerText:{includeFontPadding:!1},helperText:{includeFontPadding:!1,marginTop:e.space.xs,textAlign:"center"},strip:{paddingVertical:e.space.xxs},tile:{borderWidth:1,overflow:"hidden"},addTile:{borderStyle:"dashed",alignItems:"center",justifyContent:"center"},addTileText:{fontSize:e.text["3xl"].size,includeFontPadding:!1},thumbnailImage:{width:"100%",height:"100%",resizeMode:"cover"},extensionTile:{width:"100%",height:"100%",alignItems:"center",justifyContent:"center"},extensionText:{fontSize:e.text.sm.size,letterSpacing:1,includeFontPadding:!1},tileOverlay:{...StyleSheet.absoluteFill,alignItems:"center",justifyContent:"center"},tileOverlayText:{fontSize:e.text.sm.size,includeFontPadding:!1,marginBottom:e.space.xs},tileProgressTrack:{position:"absolute",left:8,right:8,bottom:8,height:3,borderRadius:e.radius.pill,...smoothCorners,overflow:"hidden"},tileProgressFill:{height:"100%",borderRadius:e.radius.pill,...smoothCorners},doneBadge:{position:"absolute",right:4,bottom:4,width:18,height:18,borderRadius:e.radius.pill,...smoothCorners,alignItems:"center",justifyContent:"center"},doneBadgeText:{fontSize:e.text.xs.size,includeFontPadding:!1},removeButton:{position:"absolute",top:4,right:4,width:20,height:20,borderRadius:e.radius.pill,...smoothCorners,alignItems:"center",justifyContent:"center"},removeButtonText:{fontSize:e.text.sm.size,lineHeight:Math.round(e.text.sm.size*e.leading.heading),includeFontPadding:!1},retryText:{fontSize:e.text.xl.size,includeFontPadding:!1},listRow:{flexDirection:"row",alignItems:"center",borderWidth:1,padding:e.space.sm,columnGap:e.space.sm},listThumb:{width:40,height:40,overflow:"hidden"},listTextWrap:{flex:1},listName:{includeFontPadding:!1},listSubtitle:{includeFontPadding:!1,marginTop:e.space.xxs},listProgressTrack:{height:3,borderRadius:e.radius.pill,...smoothCorners,overflow:"hidden",marginTop:e.space.xs},listProgressFill:{height:"100%",borderRadius:e.radius.pill,...smoothCorners},listRemoveText:{fontSize:e.text["2xl"].size,includeFontPadding:!1,paddingHorizontal:e.space.xs},errorText:{includeFontPadding:!1}});export{FilePicker};export default FilePicker;
|
|
1
|
+
"use strict";import{forwardRef,useCallback,useImperativeHandle,useMemo,useRef,useState}from"react";import{Image,Pressable,ScrollView,StyleSheet,Text,View}from"react-native";import{useControllableState}from"../../hooks/index.js";import{fillText,pluralText,useMobileUiText}from"../../text/index.js";import{FILE_PICKER_TEXT}from"../../text/phone/filePicker.g.js";import{fontFor,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{hitSlopMarker}from"../../utils/hitSlop.js";import{defaultIcons}from"../AppIcon/defaultIcons.js";import{hasFieldText}from"../FieldBase/index.js";import{OptionSheet}from"../OptionSheet/OptionSheet.js";import{Spinner}from"../Spinner/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";let fileIdSeq=0;const nextFileId=()=>"wfp-"+ ++fileIdSeq;export const formatFileSize=e=>{if(void 0===e||e<=0)return"";const t=["B","KB","MB","GB"];let r=e,s=0;for(;r>=1024&&s<t.length-1;)r/=1024,s+=1;const i=r>=10||0===s?Math.round(r):Math.round(10*r)/10,o=t[s];if(void 0===o)throw new Error("formatFileSize has no unit label for this size.");return`${i} ${o}`};export const matchesAccept=(e,t)=>!t||0===t.length||!!e&&t.some(t=>"*/*"===t||"*"===t||(t.endsWith("/*")?e.startsWith(t.slice(0,t.length-1)):e===t));const isImage=e=>!0===e.type?.startsWith("image/")||!e.type&&/\.(png|jpe?g|gif|webp|heic)$/i.test(e.name),imageSourceOf=e=>e.thumbnailUrl??(isImage(e)?e.uri??e.url:void 0),extensionOf=e=>{const t=e.lastIndexOf(".");return t<=0||t===e.length-1?"FILE":e.slice(t+1).toUpperCase().slice(0,4)},FilePicker=forwardRef((e,t)=>{assertValidValue("FilePicker","variant",e.variant,["card","list"]);const{files:r,defaultFiles:s,onChange:i,sources:o,maxFiles:l,maxSizeMB:n,accept:a,validate:c,process:d,variant:u="card",renderFile:m,renderTrigger:h,disabled:p=!1,helperText:g,error:x,labels:b,haptic:f,onPick:y,onRemove:T,onError:j,onFilePress:S,onRetry:C,style:w,accessibilityLabel:v,testID:_}=e,P=useTheme(),F=useMemo(()=>buildStyles(P),[P]),k=useMobileUiText("filePicker",FILE_PICKER_TEXT),z=useMemo(()=>({...k,...b}),[k,b]),I=P.radius.md,R=P.colors.primary,[V,M]=useControllableState({value:r,defaultValue:s??[],onChange:i}),O=useRef(V);O.current=V;const B=useCallback(e=>{O.current=e,M(e)},[M]),[H,L]=useState(null),[E,W]=useState(!1),$=x??H??void 0,D="number"==typeof l&&V.length>=l,G=useCallback((e,t)=>{const[r]=e;void 0!==r&&(L(r),e.forEach(e=>{j?.(e,t)}),!1!==f&&triggerHaptic("notificationError"))},[j,f]),N=useCallback(async e=>{let t;try{t=await e.pick()}catch(e){return void G([e instanceof Error?e.message:String(e)])}if(!t||0===t.length)return;const r=[];let s=t.map(e=>({id:nextFileId(),name:e.name??e.uri.split("/").pop()??"file",uri:e.uri,type:e.type,bytes:e.size,meta:e.meta,status:"idle"}));if("number"==typeof l){const e=Math.max(0,l-O.current.length);s.length>e&&(r.push(pluralText(z,"errorTooMany",l,{max:l})),s=s.slice(0,e))}const i=[];for(const e of s){if("number"==typeof n&&"number"==typeof e.bytes&&e.bytes>1024*n*1024){r.push(fillText(z.errorTooLarge,{name:e.name,maxSizeMB:n}));continue}if(!matchesAccept(e.type,a)){r.push(fillText(z.errorWrongType,{name:e.name}));continue}const t=c?.(e);t?r.push(t):i.push(e)}if(G(r),0===i.length)return;if(!d){B([...O.current,...i]);const[e]=r;L(e??null);const t=resolveHaptic(f,"selection");return t&&triggerHaptic(t),void y?.(i)}const o=i.map(e=>({...e,status:"processing"}));B([...O.current,...o]);const u=[];for(const e of o)try{const t=await d({...e,status:"idle"}),r={...t,id:e.id,status:t.status??"idle"};B(O.current.map(t=>t.id===e.id?r:t)),u.push(r)}catch(t){B(O.current.filter(t=>t.id!==e.id)),G([t instanceof Error?t.message:String(t)],e)}if(u.length>0){0===r.length&&L(null);const e=resolveHaptic(f,"selection");e&&triggerHaptic(e),y?.(u)}},[l,n,a,c,d,z,G,B,y,f]),A=useCallback(e=>{if(p||D)return;const[t]=o,r=e?o.find(t=>t.key===e):1===o.length?t:void 0;r?N(r):o.length>1&&W(!0)},[p,D,o,N]),U=useCallback(e=>{if(p)return;B(O.current.filter(t=>t.id!==e.id)),L(null);const t=resolveHaptic(f,"selection");t&&triggerHaptic(t),T?.(e)},[p,B,T,f]),K=useCallback(()=>{B([]),L(null)},[B]);useImperativeHandle(t,()=>({open:A,clear:K}),[A,K]);const q=0===V.length?z.trigger:pluralText(z,"attached",V.length),X=v??`${z.attachments}. ${q}`,statusText=e=>{switch(e.status){case"processing":return z.processing;case"uploading":return fillText(z.uploading,{percent:Math.round(100*(e.progress??0))});case"done":return z.uploaded;case"error":return e.error??z.failed;case"idle":case void 0:return""}},fileA11yLabel=e=>[e.name,formatFileSize(e.bytes),statusText(e)].filter(Boolean).join(", "),J=P.settings.icons.attachment??defaultIcons.attachment,renderStatusOverlay=e=>{if("processing"===e.status)return _jsx(View,{style:[F.tileOverlay,{backgroundColor:P.colors.scrim}],children:_jsx(Spinner,{size:"sm"})});if("uploading"===e.status){const t=Math.round(100*(e.progress??0));return _jsxs(View,{style:[F.tileOverlay,{backgroundColor:P.colors.scrim}],children:[_jsx(Text,{style:[F.tileOverlayText,{color:P.colors["on-scrim"]}],children:`${t}%`}),_jsx(View,{style:[F.tileProgressTrack,{backgroundColor:P.colors.border}],children:_jsx(View,{style:[F.tileProgressFill,{width:`${t}%`,backgroundColor:P.colors.primary}]})})]})}return"done"===e.status?_jsx(View,{style:[F.doneBadge,{backgroundColor:P.colors.success}],children:_jsx(Text,{style:[F.doneBadgeText,{color:P.colors["on-success"]}],children:"✓"})}):null},renderThumbnail=e=>{const t=imageSourceOf(e);return t?_jsx(Image,{source:{uri:t},style:F.thumbnailImage}):_jsx(View,{style:[F.extensionTile,{backgroundColor:P.colors["bg-subtle"]}],children:_jsx(Text,{style:[F.extensionText,{color:P.colors["text-muted"],...fontFor(P,"semibold")}],children:extensionOf(e.name)})})},removeButton=e=>_jsx(Pressable,{onPress:()=>U(e),disabled:p,hitSlop:8,...hitSlopMarker(8),accessibilityRole:"button",accessibilityLabel:fillText(z.removeNamedText,{label:e.name}),style:[F.removeButton,{backgroundColor:P.colors.scrim}],children:_jsx(Text,{style:[F.removeButtonText,{color:P.colors["on-scrim"]}],children:"×"})}),retryButton=e=>C&&"error"===e.status?_jsx(Pressable,{onPress:()=>C(e),disabled:p,hitSlop:8,...hitSlopMarker(8),accessibilityRole:"button",accessibilityLabel:z.retry,children:_jsx(Text,{style:[F.retryText,{color:P.colors.primary}],children:"↻"})}):null,renderOneFile=(e,t)=>{const r={file:e,index:t,disabled:p,remove:()=>U(e),retry:C?()=>C(e):void 0},s=m?m(r):"card"===u?(e=>{const{file:t}=e;return _jsxs(View,{style:[F.tile,{width:84,height:84,borderRadius:I,...smoothCorners,borderColor:"error"===t.status?P.colors.danger:P.colors.border}],children:[renderThumbnail(t),renderStatusOverlay(t),"error"===t.status?_jsx(View,{style:[F.tileOverlay,{backgroundColor:P.colors.scrim}],children:retryButton(t)}):null,removeButton(t)]})})(r):(e=>{const{file:t}=e,r=statusText(t);return _jsxs(View,{style:[F.listRow,{borderRadius:I,...smoothCorners,borderColor:"error"===t.status?P.colors.danger:P.colors.border,backgroundColor:P.colors.bg}],children:[_jsxs(View,{style:[F.listThumb,{borderRadius:P.radius.sm,...smoothCorners}],children:[renderThumbnail(t),"processing"===t.status?_jsx(View,{style:[F.tileOverlay,{backgroundColor:P.colors.scrim}],children:_jsx(Spinner,{size:"sm"})}):null]}),_jsxs(View,{style:F.listTextWrap,children:[_jsx(Text,{numberOfLines:1,ellipsizeMode:"middle",style:[F.listName,{color:P.colors["text-body"],fontSize:P.text.sm.size,...fontFor(P,"medium")}],children:t.name}),_jsx(Text,{numberOfLines:1,style:[F.listSubtitle,{color:"error"===t.status?P.colors["danger-text"]:P.colors["text-subtle"],fontSize:P.text.xs.size}],children:[formatFileSize(t.bytes),r].filter(Boolean).join(" · ")}),"uploading"===t.status?_jsx(View,{style:[F.listProgressTrack,{backgroundColor:P.colors.border}],children:_jsx(View,{style:[F.listProgressFill,{width:`${Math.round(100*(t.progress??0))}%`,backgroundColor:P.colors.primary}]})}):null]}),retryButton(t),_jsx(Pressable,{onPress:()=>U(t),disabled:p,hitSlop:8,...hitSlopMarker(8),accessibilityRole:"button",accessibilityLabel:fillText(z.removeNamedText,{label:t.name}),children:_jsx(Text,{style:[F.listRemoveText,{color:P.colors["text-subtle"]}],children:"×"})})]})})(r);return _jsx(Pressable,{onPress:S?()=>S(e):void 0,disabled:p||!S,accessibilityLabel:fileA11yLabel(e),children:s},e.id)},Q={open:A,disabled:p||D,fileCount:V.length,atCapacity:D},dashedTrigger=e=>_jsxs(Pressable,{onPress:()=>A(),disabled:p||D,accessibilityRole:"button",accessibilityState:{disabled:p||D},"aria-disabled":p||D,style:({pressed:t})=>[F.trigger,e?F.triggerCompact:null,{borderRadius:I,...smoothCorners,borderColor:R,backgroundColor:t?P.colors["surface-pressed"]:P.colors.bg,opacity:p||D?.55:1}],children:[_jsxs(View,{style:F.triggerRow,children:[J?J({size:16,color:P.colors.primary}):null,_jsx(Text,{style:[F.triggerText,{color:P.colors.primary,fontSize:P.text.sm.size,...fontFor(P,"medium")}],children:0===V.length?z.trigger:z.addMore})]}),!e&&g?_jsx(Text,{style:[F.helperText,{color:P.colors["text-subtle"],fontSize:P.text.xs.size}],children:g}):null]}),Y=_jsx(Pressable,{onPress:()=>A(),disabled:p||D,accessibilityRole:"button",accessibilityLabel:z.addMore,style:({pressed:e})=>[F.tile,F.addTile,{width:84,height:84,borderRadius:I,...smoothCorners,borderColor:R,backgroundColor:e?P.colors["surface-pressed"]:"transparent",opacity:p||D?.55:1}],children:_jsx(Text,{style:[F.addTileText,{color:P.colors.primary}],children:"+"})});return _jsxs(View,{style:[F.container,w],testID:_,accessibilityLabel:X,children:["card"===u?0===V.length?h?h(Q):dashedTrigger(!1):_jsxs(ScrollView,{horizontal:!0,showsHorizontalScrollIndicator:!1,contentContainerStyle:[F.strip,{columnGap:P.space.sm}],children:[V.map(renderOneFile),h?h(Q):D||p?null:Y]}):_jsxs(View,{style:{rowGap:P.space.sm},children:[h?h(Q):D?null:dashedTrigger(V.length>0),V.map(renderOneFile)]}),hasFieldText($)?_jsx(Text,{accessibilityLiveRegion:"polite",style:[F.errorText,{color:P.colors["danger-text"],fontSize:P.text.xs.size,marginTop:P.space.xxs}],children:$}):null,_jsx(OptionSheet,{open:E,onClose:()=>W(!1),title:z.sheetTitle,options:o,getOptionLabel:e=>e.label,getOptionValue:e=>e.key,getOptionDescription:e=>e.description,getOptionIcon:e=>e.icon,onChange:(e,t)=>{W(!1),N(t)}})]})});FilePicker.displayName="FilePicker";const buildStyles=e=>StyleSheet.create({container:{width:"100%"},trigger:{borderWidth:1,borderStyle:"dashed",alignItems:"center",minHeight:48,paddingVertical:e.space.md,paddingHorizontal:e.space.lg},triggerCompact:{minHeight:40,paddingVertical:e.space.sm},triggerRow:{flexDirection:"row",alignItems:"center",columnGap:e.space.sm},triggerText:{includeFontPadding:!1},helperText:{includeFontPadding:!1,marginTop:e.space.xs,textAlign:"center"},strip:{paddingVertical:e.space.xxs},tile:{borderWidth:1,overflow:"hidden"},addTile:{borderStyle:"dashed",alignItems:"center",justifyContent:"center"},addTileText:{fontSize:e.text["3xl"].size,includeFontPadding:!1},thumbnailImage:{width:"100%",height:"100%",resizeMode:"cover"},extensionTile:{width:"100%",height:"100%",alignItems:"center",justifyContent:"center"},extensionText:{fontSize:e.text.sm.size,letterSpacing:1,includeFontPadding:!1},tileOverlay:{...StyleSheet.absoluteFill,alignItems:"center",justifyContent:"center"},tileOverlayText:{fontSize:e.text.sm.size,includeFontPadding:!1,marginBottom:e.space.xs},tileProgressTrack:{position:"absolute",left:8,right:8,bottom:8,height:3,borderRadius:e.radius.pill,...smoothCorners,overflow:"hidden"},tileProgressFill:{height:"100%",borderRadius:e.radius.pill,...smoothCorners},doneBadge:{position:"absolute",right:4,bottom:4,width:18,height:18,borderRadius:e.radius.pill,...smoothCorners,alignItems:"center",justifyContent:"center"},doneBadgeText:{fontSize:e.text.xs.size,includeFontPadding:!1},removeButton:{position:"absolute",top:4,right:4,width:20,height:20,borderRadius:e.radius.pill,...smoothCorners,alignItems:"center",justifyContent:"center"},removeButtonText:{fontSize:e.text.sm.size,lineHeight:Math.round(e.text.sm.size*e.leading.heading),includeFontPadding:!1},retryText:{fontSize:e.text.xl.size,includeFontPadding:!1},listRow:{flexDirection:"row",alignItems:"center",borderWidth:1,padding:e.space.sm,columnGap:e.space.sm},listThumb:{width:40,height:40,overflow:"hidden"},listTextWrap:{flex:1},listName:{includeFontPadding:!1},listSubtitle:{includeFontPadding:!1,marginTop:e.space.xxs},listProgressTrack:{height:3,borderRadius:e.radius.pill,...smoothCorners,overflow:"hidden",marginTop:e.space.xs},listProgressFill:{height:"100%",borderRadius:e.radius.pill,...smoothCorners},listRemoveText:{fontSize:e.text["2xl"].size,includeFontPadding:!1,paddingHorizontal:e.space.xs},errorText:{includeFontPadding:!1}});export{FilePicker};export default FilePicker;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";export{
|
|
1
|
+
"use strict";export{default,FilePicker,formatFileSize}from"./FilePicker.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{Logger}from"@webority/mobile-core";import{forwardRef,useCallback,useEffect,useMemo,useRef,useState}from"react";import{AccessibilityInfo,Animated,BackHandler,Easing,Platform,Pressable,StyleSheet,Text,View}from"react-native";import Reanimated,{cancelAnimation,Easing as ReanimatedEasing,useAnimatedStyle,useSharedValue,withTiming}from"react-native-reanimated";import{useSafeAreaInsets}from"react-native-safe-area-context";import{usePresenceMotion}from"../../hooks/usePresenceMotion.js";import{usePressAnimation}from"../../hooks/usePressAnimation.js";import{createAnimatedValue,resolveFloatingActionButtonSize,setNativeValue,useTheme}from"../../theme/index.js";import{announce}from"../../utils/announce.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{ACCENT_PRESSED_TINT}from"../../utils/color.js";import{smoothCorners}from"../../utils/corners.js";import{resolveHaptic,triggerHaptic}from"../../utils/hapticUtils.js";import{nativeDriver}from"../../utils/nativeDriver.js";import{renderSlotIcon}from"../AppIcon/slotIcon.js";import{Spinner}from"../Spinner/index.js";import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from"react/jsx-runtime";const FAB_SIZES=["sm","md","lg"],FAB_TONES=["primary","success","warning","danger","info","neutral"],FAB_POSITIONS=["bottomRight","bottomLeft","bottomCenter"],toneBackground=(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["bg-muted"];default:return e.colors.primary}},pressedTintFor=(e,t)=>"neutral"===t?e.colors["surface-pressed"]:ACCENT_PRESSED_TINT,toneForeground=(e,t)=>{if("neutral"===t)return e.colors["text-body"];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"];default:return e.colors["on-primary"]}},FloatingActionButton=forwardRef((e,t)=>{const{icon:o,onPress:n,label:i,collapsed:s=!1,size:r="md",tone:a="primary",position:l,bottomOffset:c,disabled:u=!1,loading:d=!1,hideOnScroll:m=!1,isScrolling:p=!1,accessibilityLabel:f,accessibilityHint:b,haptic:g,style:h,containerStyle:y,labelStyle:A,testID:S}=e;assertValidValue("FloatingActionButton","size",e.size,FAB_SIZES),assertValidValue("FloatingActionButton","tone",e.tone,FAB_TONES),assertValidValue("FloatingActionButton","position",e.position,FAB_POSITIONS);const v=!u&&!d,x=useTheme(),_=useSafeAreaInsets(),w=useMemo(()=>resolveFloatingActionButtonSize(x,r),[x,r]),E=useMemo(()=>buildStyles(x),[x]),{scale:R,opacity:I,pressIn:F,pressOut:C}=usePressAnimation({enabled:v}),V=usePresenceMotion(),j=x.space[x.components["floating-action-button"]["edge-offset"]],T=x.space[x.components["floating-action-button"]["bottom-offset"]],B=useRef(createAnimatedValue(1)).current,P=V.duration("default");useEffect(()=>{if(!m)return void setNativeValue(B,1);const e=Animated.timing(B,{toValue:p?0:1,duration:P,easing:Easing.bezier(...x.motion.ease["in-out"]),useNativeDriver:nativeDriver});return e.start(),()=>e.stop()},[m,p,B,P,x.motion.ease["in-out"]]);const k=w.diameter+(c??T)+_.bottom+j,D=B.interpolate({inputRange:[0,1],outputRange:V.range(k,0)}),O=useMemo(()=>Animated.multiply(B,I),[B,I]),L="string"==typeof i&&i.length>0,N=L&&s,z=V.reduced,M=x.space.sm,G=w["label-padding-x"],H=x.motion.duration.fast,$=x.motion.ease["in-out"],U=useSharedValue(N?1:0),[W,Y]=useState(null);useEffect(()=>{const e=N?1:0;return U.value=z?e:withTiming(e,{duration:H,easing:ReanimatedEasing.bezier(...$)}),()=>cancelAnimation(U)},[N,z,U,H,$]);const Z=useCallback(e=>{const t=Math.ceil(e);Y(e=>e===t?e:t)},[]),q=useAnimatedStyle(()=>({paddingHorizontal:G*(1-U.value)}),[G,U]),Q=useAnimatedStyle(()=>{const e=Math.max(0,1-2*U.value);return null===W?U.value>=1?{opacity:e,width:0}:{opacity:e}:{opacity:e,width:(W+M)*(1-U.value)}},[U,W,M]),X=u?x.colors["surface-disabled"]:toneBackground(x,a),J=u?x.colors["text-disabled"]:toneForeground(x,a),K=d?_jsx(Spinner,{variant:"circular",size:"lg"===r?"md":"sm",color:J}):renderSlotIcon(o,{color:J,size:w.icon,disabled:u}),ee=useMemo(()=>{if(!l)return null;const e=(c??T)+_.bottom;switch(l){case"bottomLeft":return{position:"absolute",bottom:e,left:j};case"bottomCenter":return{position:"absolute",bottom:e,alignSelf:"center"};default:return{position:"absolute",bottom:e,right:j}}},[l,c,_.bottom,T,j]);return _jsx(Animated.View,{style:[ee,{transform:[{translateY:D},{scale:R}],opacity:O},y,h],pointerEvents:m&&p?"none":"auto",children:_jsx(Pressable,{ref:t,onPress:e=>{if(!v)return;const t=resolveHaptic(g,"impactLight");t&&triggerHaptic(t),n()},onPressIn:F,onPressOut:C,disabled:!v,accessibilityRole:"button",accessibilityLabel:f,accessibilityHint:b,accessibilityState:{disabled:!v,busy:d},"aria-disabled":!v,"aria-busy":d,testID:S,style:[E.base,L?{height:w.diameter,minWidth:w.diameter,borderRadius:w.diameter/2,...smoothCorners}:{width:w.diameter,height:w.diameter,borderRadius:w.diameter/2,...smoothCorners},x.shadow.popover,{backgroundColor:X,opacity:u||d?.55:1}],children:({pressed:e})=>_jsxs(_Fragment,{children:[e&&v?_jsx(View,{pointerEvents:"none",testID:"fab-pressed",style:[E.pressedTint,{backgroundColor:pressedTintFor(x,a),borderRadius:w.diameter/2,...smoothCorners}]}):null,L?_jsxs(Reanimated.View,{style:[E.extendedRow,q],children:[K,_jsx(Reanimated.View,{style:[E.labelClip,Q],children:_jsx(Text,{onLayout:e=>Z(e.nativeEvent.layout.width),style:[E.label,{color:J,fontSize:w.text,fontWeight:x.weight.semibold,marginLeft:M},A],numberOfLines:1,children:i})})]}):K]})})})});FloatingActionButton.displayName="FloatingActionButton";const buildStyles=e=>StyleSheet.create({base:{flexDirection:"row",alignItems:"center",justifyContent:"center",overflow:"hidden"},pressedTint:{position:"absolute",top:0,right:0,bottom:0,left:0},extendedRow:{flexDirection:"row",alignItems:"center"},labelClip:{flexDirection:"row",overflow:"hidden"},label:{includeFontPadding:!1,flexShrink:0}}),FAB_GROUP_MIN_ACTIONS=2,FAB_GROUP_MAX_ACTIONS=6,FAB_GROUP_RANGE="2 to 6",describeActionProblem=e=>e.length<2?`was given ${e.length} action(s); a menu holds 2 to 6.`:e.length>6?`was given ${e.length} actions; a menu holds 2 to 6, so only the first 6 are drawn.`:e.some(e=>"string"!=typeof e.label||""===e.label.trim())?"has an action without a visible `label`; every menu action needs one.":"";export const DEFAULT_FLOATING_ACTION_BUTTON_GROUP_LABELS={quickActions:"Quick actions",expanded:(e,t)=>`${e}, expanded, ${t} ${1===t?"action":"actions"}`,collapsed:e=>`${e}, collapsed`};const FloatingActionButtonGroup=e=>{const{primaryIcon:t,primaryActiveIcon:o,actions:n,expanded:i,defaultExpanded:s=!1,onExpandedChange:r,labels:a,position:l="bottomRight",bottomOffset:c,size:u="md",accessibilityLabel:d,haptic:m,hideOnScroll:p=!1,isScrolling:f=!1,containerStyle:b,secondaryActionStyle:g,labelPillStyle:h,labelStyle:y,testID:A}=e;assertValidValue("FloatingActionButtonGroup","size",e.size,FAB_SIZES),assertValidValue("FloatingActionButtonGroup","position",e.position,FAB_POSITIONS);const S=useMemo(()=>({...DEFAULT_FLOATING_ACTION_BUTTON_GROUP_LABELS,...a}),[a]),v=d??S.quickActions,x=useTheme(),_=useSafeAreaInsets(),w=useMemo(()=>resolveFloatingActionButtonSize(x,u),[x,u]),E=useMemo(()=>buildGroupStyles(x),[x]),R=usePresenceMotion(),I=R.duration("default"),F=x.space[x.components["floating-action-button"]["edge-offset"]],C=x.space[x.components["floating-action-button"]["bottom-offset"]],V=x.space[x.components["floating-action-button"]["secondary-gap"]],j=x.components["floating-action-button"]["stagger-ms"],T=useMemo(()=>n.slice(0,6),[n]),B=T.length,P=useMemo(()=>T.map((e,t)=>({action:e,index:t})).reverse(),[T]);n.forEach(e=>{assertValidValue("FloatingActionButtonGroup","actions[].tone",e.tone,FAB_TONES)});const k=__DEV__?describeActionProblem(n):"";useEffect(()=>{__DEV__&&k&&Logger.warn(`[@webority/mobile-ui] FloatingActionButtonGroup ${k}`)},[k]);const D="boolean"==typeof i,[O,L]=useState(s),N="boolean"==typeof i?i:O,z=useRef(createAnimatedValue(1)).current;useEffect(()=>{if(!p)return void setNativeValue(z,1);const e=Animated.timing(z,{toValue:f?0:1,duration:I,easing:Easing.bezier(...x.motion.ease["in-out"]),useNativeDriver:nativeDriver});return e.start(),()=>e.stop()},[p,f,z,I,x.motion.ease["in-out"]]);const M=p&&f;useEffect(()=>{M&&N&&(D||L(!1),r?.(!1))},[M,N,D,r]);const G=w.diameter+(c??C)+_.bottom+F,H=z.interpolate({inputRange:[0,1],outputRange:R.range(G,0)}),$=z,U=useRef(createAnimatedValue(N?1:0)).current,W=useRef([]),[Y,Z]=useState(0);useEffect(()=>{const e=W.current;if(e.length!==B){if(e.length<B){const t=e.slice();for(let o=e.length;o<B;o+=1)t.push(new Animated.Value(N?1:0));W.current=t}else W.current=e.slice(0,B);Z(e=>e+1)}},[B,N]),useEffect(()=>{const e=Animated.timing(U,{toValue:N?1:0,duration:I,easing:Easing.bezier(...x.motion.ease["in-out"]),useNativeDriver:nativeDriver});e.start();const t=W.current.map(e=>Animated.timing(e,{toValue:N?1:0,duration:I,easing:Easing.bezier(...x.motion.ease["in-out"]),useNativeDriver:nativeDriver})),o=N?t:[...t].reverse(),n=Animated.stagger(j,o);return n.start(),()=>{e.stop(),n.stop()}},[N,U,I,x.motion.ease["in-out"],B,Y,j]);const q=useCallback(e=>{const t=resolveHaptic(m,"impactLight");t&&triggerHaptic(t),D||L(e),r?.(e)},[D,r,m]),Q=useRef(null),X=useRef(N),J=useRef(!1);useEffect(()=>{if(X.current===N)return;X.current=N;const e=J.current;if(J.current=!1,M||e)return;const t=Q.current;t&&("web"===Platform.OS?"focus"in t&&"function"==typeof t.focus&&t.focus():AccessibilityInfo.sendAccessibilityEvent(t,"focus")),announce(N?S.expanded(v,B):S.collapsed(v))},[N,M,v,B,S]);const K=useCallback(()=>{q(!N)},[N,q]),ee=useCallback(e=>{!1!==m&&triggerHaptic("selection"),J.current=!0,e.onPress(),D||L(!1),r?.(!1)},[D,r,m]),te=useCallback(()=>{N&&q(!1)},[N,q]);useEffect(()=>{if(!N)return;const e=BackHandler.addEventListener("hardwareBackPress",()=>(q(!1),!0));return()=>e.remove()},[N,q]),useEffect(()=>{if(!N||"web"!==Platform.OS)return;const onKeyDown=e=>{"Escape"===e.key&&q(!1)};return window.addEventListener("keydown",onKeyDown),()=>window.removeEventListener("keydown",onKeyDown)},[N,q]);const oe=useMemo(()=>{const e=(c??C)+_.bottom;switch(l){case"bottomLeft":return{position:"absolute",bottom:e,left:F,alignItems:"flex-start"};case"bottomCenter":return{position:"absolute",bottom:e,alignSelf:"center",alignItems:"center"};default:return{position:"absolute",bottom:e,right:F,alignItems:"flex-end"}}},[l,c,_.bottom,C,F]),slotOffset=e=>-(w.diameter+V)*(e+1),ne=useMemo(()=>{switch(l){case"bottomLeft":return{left:0,right:0,justifyContent:"flex-start"};case"bottomCenter":return{left:0,right:0,justifyContent:"center"};default:return{left:0,right:0,justifyContent:"flex-end"}}},[l]),ie=.78*w.diameter,se=useMemo(()=>{const e=ie+x.space.sm;switch(l){case"bottomLeft":return{left:e,alignItems:"flex-start"};case"bottomCenter":return{right:w.diameter/2+ie/2+x.space.sm,alignItems:"flex-end"};default:return{right:e,alignItems:"flex-end"}}},[l,ie,w.diameter,x.space.sm]),re=U.interpolate({inputRange:[0,1],outputRange:[0,.4]}),ae=U.interpolate(R.reduced?{inputRange:[0,.5,.5001,1],outputRange:["0deg","0deg","45deg","45deg"]}:{inputRange:[0,1],outputRange:["0deg","45deg"]});return _jsxs(_Fragment,{children:[N?_jsx(Animated.View,{pointerEvents:N?"auto":"none",style:[StyleSheet.absoluteFill,{backgroundColor:x.colors.scrim,opacity:re}],children:_jsx(Pressable,{style:StyleSheet.absoluteFill,onPress:te,accessibilityElementsHidden:!0,importantForAccessibility:"no",testID:A?`${A}-backdrop`:void 0})}):null,_jsxs(Animated.View,{pointerEvents:M?"none":"box-none",style:[oe,{transform:[{translateY:H}],opacity:$},b],accessibilityRole:"menu",testID:A,children:[P.map(({action:e,index:t})=>{const o=W.current[t];if(!o)return null;const n=o.interpolate({inputRange:[0,1],outputRange:R.range(0,slotOffset(t))}),i=o.interpolate({inputRange:[0,1],outputRange:R.range(.6,1)}),s=toneBackground(x,e.tone??"primary"),r=toneForeground(x,e.tone??"primary"),a=e.label?_jsx(View,{pointerEvents:"none",style:[E.labelSlot,se],testID:A?`${A}-label-${e.key}`:void 0,children:_jsx(View,{style:[E.labelPill,x.shadow.card,{backgroundColor:x.colors.surface,paddingHorizontal:x.space.sm,paddingVertical:x.space.xs,borderRadius:x.radius.sm,...smoothCorners},h],children:_jsx(Text,{style:[{color:x.colors["text-body"],fontSize:x.text.sm.size,fontWeight:x.weight.medium},y],numberOfLines:1,children:e.label})})}):null;return _jsxs(Animated.View,{pointerEvents:N?"auto":"none",accessibilityElementsHidden:!N,importantForAccessibility:N?"auto":"no-hide-descendants","aria-hidden":!N,style:[E.secondaryRow,ne,{position:"absolute",bottom:0,opacity:o,transform:[{translateY:n},{scale:i}]}],children:[_jsx(Pressable,{onPress:()=>ee(e),focusable:N,accessibilityRole:"menuitem",accessibilityLabel:e.accessibilityLabel,style:[E.fabBase,x.shadow.elevated,{width:ie,height:ie,borderRadius:ie/2,...smoothCorners,backgroundColor:s},g],testID:A?`${A}-action-${e.key}`:void 0,children:({pressed:t})=>_jsxs(_Fragment,{children:[t?_jsx(View,{pointerEvents:"none",testID:"fab-pressed",style:[E.pressedTint,{backgroundColor:pressedTintFor(x,e.tone??"primary"),borderRadius:ie/2,...smoothCorners}]}):null,renderSlotIcon(e.icon,{color:r,size:w.icon,disabled:!1})]})}),a]},e.key)}),_jsx(Pressable,{ref:Q,onPress:K,accessibilityRole:"button",accessibilityLabel:v,accessibilityState:{expanded:N},"aria-expanded":N,style:[E.fabBase,x.shadow.popover,{width:w.diameter,height:w.diameter,borderRadius:w.diameter/2,...smoothCorners,backgroundColor:x.colors.primary}],testID:A?`${A}-primary`:void 0,children:({pressed:e})=>_jsxs(_Fragment,{children:[e?_jsx(View,{pointerEvents:"none",testID:"fab-pressed",style:[E.pressedTint,{backgroundColor:ACCENT_PRESSED_TINT,borderRadius:w.diameter/2,...smoothCorners}]}):null,_jsx(Animated.View,{style:o?void 0:{transform:[{rotate:ae}]},children:renderSlotIcon(N&&o?o:t,{color:x.colors["on-primary"],size:w.icon,disabled:!1})})]})})]})]})},buildGroupStyles=e=>StyleSheet.create({fabBase:{flexDirection:"row",alignItems:"center",justifyContent:"center",overflow:"hidden"},pressedTint:{position:"absolute",top:0,right:0,bottom:0,left:0},secondaryRow:{flexDirection:"row",alignItems:"center"},labelSlot:{position:"absolute",top:0,bottom:0,justifyContent:"center"},labelPill:{alignSelf:"auto"}});export{FloatingActionButton,FloatingActionButtonGroup};export default FloatingActionButton;
|
|
1
|
+
"use strict";import{Logger}from"@webority/mobile-core";import{forwardRef,useCallback,useEffect,useMemo,useRef,useState}from"react";import{AccessibilityInfo,Animated,BackHandler,Easing,Platform,Pressable,StyleSheet,Text,View}from"react-native";import Reanimated,{cancelAnimation,Easing as ReanimatedEasing,useAnimatedStyle,useSharedValue,withTiming}from"react-native-reanimated";import{useSafeAreaInsets}from"react-native-safe-area-context";import{usePresenceMotion}from"../../hooks/usePresenceMotion.js";import{usePressAnimation}from"../../hooks/usePressAnimation.js";import{fillText,pluralText,useMobileUiText}from"../../text/index.js";import{FLOATING_ACTION_BUTTON_TEXT}from"../../text/phone/floatingActionButton.g.js";import{createAnimatedValue,resolveFloatingActionButtonSize,setNativeValue,useTheme}from"../../theme/index.js";import{announce}from"../../utils/announce.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{ACCENT_PRESSED_TINT}from"../../utils/color.js";import{smoothCorners}from"../../utils/corners.js";import{resolveHaptic,triggerHaptic}from"../../utils/hapticUtils.js";import{nativeDriver}from"../../utils/nativeDriver.js";import{renderSlotIcon}from"../AppIcon/slotIcon.js";import{Spinner}from"../Spinner/index.js";import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from"react/jsx-runtime";const FAB_SIZES=["sm","md","lg"],FAB_TONES=["primary","success","warning","danger","info","neutral"],FAB_POSITIONS=["bottomRight","bottomLeft","bottomCenter"],toneBackground=(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["bg-muted"];default:return e.colors.primary}},pressedTintFor=(e,t)=>"neutral"===t?e.colors["surface-pressed"]:ACCENT_PRESSED_TINT,toneForeground=(e,t)=>{if("neutral"===t)return e.colors["text-body"];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"];default:return e.colors["on-primary"]}},FloatingActionButton=forwardRef((e,t)=>{const{icon:o,onPress:n,label:i,collapsed:s=!1,size:r="md",tone:a="primary",position:l,bottomOffset:c,disabled:u=!1,loading:d=!1,hideOnScroll:m=!1,isScrolling:p=!1,accessibilityLabel:f,accessibilityHint:b,haptic:g,style:h,labelStyle:y,testID:A}=e;assertValidValue("FloatingActionButton","size",e.size,FAB_SIZES),assertValidValue("FloatingActionButton","tone",e.tone,FAB_TONES),assertValidValue("FloatingActionButton","position",e.position,FAB_POSITIONS);const S=!u&&!d,x=useTheme(),v=useSafeAreaInsets(),w=useMemo(()=>resolveFloatingActionButtonSize(x,r),[x,r]),_=useMemo(()=>buildStyles(x),[x]),{scale:E,opacity:I,pressIn:R,pressOut:T}=usePressAnimation({enabled:S}),F=usePresenceMotion(),j=x.space[x.components["floating-action-button"]["edge-offset"]],C=x.space[x.components["floating-action-button"]["bottom-offset"]],V=useRef(createAnimatedValue(1)).current,B=F.duration("default");useEffect(()=>{if(!m)return void setNativeValue(V,1);const e=Animated.timing(V,{toValue:p?0:1,duration:B,easing:Easing.bezier(...x.motion.ease["in-out"]),useNativeDriver:nativeDriver});return e.start(),()=>e.stop()},[m,p,V,B,x.motion.ease["in-out"]]);const P=w.diameter+(c??C)+v.bottom+j,k=V.interpolate({inputRange:[0,1],outputRange:F.range(P,0)}),D=useMemo(()=>Animated.multiply(V,I),[V,I]),N="string"==typeof i&&i.length>0,O=N&&s,L=F.reduced,z=x.space.sm,M=w["label-padding-x"],H=x.motion.duration.fast,G=x.motion.ease["in-out"],$=useSharedValue(O?1:0),[U,W]=useState(null);useEffect(()=>{const e=O?1:0;return $.value=L?e:withTiming(e,{duration:H,easing:ReanimatedEasing.bezier(...G)}),()=>cancelAnimation($)},[O,L,$,H,G]);const X=useCallback(e=>{const t=Math.ceil(e);W(e=>e===t?e:t)},[]),Y=useAnimatedStyle(()=>({paddingHorizontal:M*(1-$.value)}),[M,$]),Z=useAnimatedStyle(()=>{const e=Math.max(0,1-2*$.value);return null===U?$.value>=1?{opacity:e,width:0}:{opacity:e}:{opacity:e,width:(U+z)*(1-$.value)}},[$,U,z]),q=u?x.colors["surface-disabled"]:toneBackground(x,a),J=u?x.colors["text-disabled"]:toneForeground(x,a),K=d?_jsx(Spinner,{variant:"circular",size:"lg"===r?"md":"sm",color:J}):renderSlotIcon(o,{color:J,size:w.icon,disabled:u}),Q=useMemo(()=>{if(!l)return null;const e=(c??C)+v.bottom;switch(l){case"bottomLeft":return{position:"absolute",bottom:e,left:j};case"bottomCenter":return{position:"absolute",bottom:e,alignSelf:"center"};default:return{position:"absolute",bottom:e,right:j}}},[l,c,v.bottom,C,j]);return _jsx(Animated.View,{style:[Q,{transform:[{translateY:k},{scale:E}],opacity:D},h],pointerEvents:m&&p?"none":"auto",children:_jsx(Pressable,{ref:t,onPress:e=>{if(!S)return;const t=resolveHaptic(g,"impactLight");t&&triggerHaptic(t),n()},onPressIn:R,onPressOut:T,disabled:!S,accessibilityRole:"button",accessibilityLabel:f,accessibilityHint:b,accessibilityState:{disabled:!S,busy:d},"aria-disabled":!S,"aria-busy":d,testID:A,style:[_.base,N?{height:w.diameter,minWidth:w.diameter,borderRadius:w.diameter/2,...smoothCorners}:{width:w.diameter,height:w.diameter,borderRadius:w.diameter/2,...smoothCorners},x.shadow.popover,{backgroundColor:q,opacity:u||d?.55:1}],children:({pressed:e})=>_jsxs(_Fragment,{children:[e&&S?_jsx(View,{pointerEvents:"none",testID:"fab-pressed",style:[_.pressedTint,{backgroundColor:pressedTintFor(x,a),borderRadius:w.diameter/2,...smoothCorners}]}):null,N?_jsxs(Reanimated.View,{style:[_.extendedRow,Y],children:[K,_jsx(Reanimated.View,{style:[_.labelClip,Z],children:_jsx(Text,{onLayout:e=>X(e.nativeEvent.layout.width),style:[_.label,{color:J,fontSize:w.text,fontWeight:x.weight.semibold,marginLeft:z},y],numberOfLines:1,children:i})})]}):K]})})})});FloatingActionButton.displayName="FloatingActionButton";const buildStyles=e=>StyleSheet.create({base:{flexDirection:"row",alignItems:"center",justifyContent:"center",overflow:"hidden"},pressedTint:{position:"absolute",top:0,right:0,bottom:0,left:0},extendedRow:{flexDirection:"row",alignItems:"center"},labelClip:{flexDirection:"row",overflow:"hidden"},label:{includeFontPadding:!1,flexShrink:0}}),FAB_GROUP_MIN_ACTIONS=2,FAB_GROUP_MAX_ACTIONS=6,FAB_GROUP_RANGE="2 to 6",describeActionProblem=e=>e.length<2?`was given ${e.length} action(s); a menu holds 2 to 6.`:e.length>6?`was given ${e.length} actions; a menu holds 2 to 6, so only the first 6 are drawn.`:e.some(e=>"string"!=typeof e.label||""===e.label.trim())?"has an action without a visible `label`; every menu action needs one.":"",FloatingActionButtonGroup=e=>{const{primaryIcon:t,primaryActiveIcon:o,actions:n,expanded:i,defaultExpanded:s=!1,onExpandedChange:r,labels:a,position:l="bottomRight",bottomOffset:c,size:u="md",accessibilityLabel:d,haptic:m,hideOnScroll:p=!1,isScrolling:f=!1,style:b,secondaryActionStyle:g,labelPillStyle:h,labelStyle:y,testID:A}=e;assertValidValue("FloatingActionButtonGroup","size",e.size,FAB_SIZES),assertValidValue("FloatingActionButtonGroup","position",e.position,FAB_POSITIONS);const S=useMobileUiText("floatingActionButton",FLOATING_ACTION_BUTTON_TEXT),x=useMemo(()=>({...S,...a}),[S,a]),v=d??x.quickActions,w=useTheme(),_=useSafeAreaInsets(),E=useMemo(()=>resolveFloatingActionButtonSize(w,u),[w,u]),I=useMemo(()=>buildGroupStyles(w),[w]),R=usePresenceMotion(),T=R.duration("default"),F=w.space[w.components["floating-action-button"]["edge-offset"]],j=w.space[w.components["floating-action-button"]["bottom-offset"]],C=w.space[w.components["floating-action-button"]["secondary-gap"]],V=w.components["floating-action-button"]["stagger-ms"],B=useMemo(()=>n.slice(0,6),[n]),P=B.length,k=useMemo(()=>B.map((e,t)=>({action:e,index:t})).reverse(),[B]);n.forEach(e=>{assertValidValue("FloatingActionButtonGroup","actions[].tone",e.tone,FAB_TONES)});const D=__DEV__?describeActionProblem(n):"";useEffect(()=>{__DEV__&&D&&Logger.warn(`[@webority/mobile-ui] FloatingActionButtonGroup ${D}`)},[D]);const N="boolean"==typeof i,[O,L]=useState(s),z="boolean"==typeof i?i:O,M=useRef(createAnimatedValue(1)).current;useEffect(()=>{if(!p)return void setNativeValue(M,1);const e=Animated.timing(M,{toValue:f?0:1,duration:T,easing:Easing.bezier(...w.motion.ease["in-out"]),useNativeDriver:nativeDriver});return e.start(),()=>e.stop()},[p,f,M,T,w.motion.ease["in-out"]]);const H=p&&f;useEffect(()=>{H&&z&&(N||L(!1),r?.(!1))},[H,z,N,r]);const G=E.diameter+(c??j)+_.bottom+F,$=M.interpolate({inputRange:[0,1],outputRange:R.range(G,0)}),U=M,W=useRef(createAnimatedValue(z?1:0)).current,X=useRef([]),[Y,Z]=useState(0);useEffect(()=>{const e=X.current;if(e.length!==P){if(e.length<P){const t=e.slice();for(let o=e.length;o<P;o+=1)t.push(new Animated.Value(z?1:0));X.current=t}else X.current=e.slice(0,P);Z(e=>e+1)}},[P,z]),useEffect(()=>{const e=Animated.timing(W,{toValue:z?1:0,duration:T,easing:Easing.bezier(...w.motion.ease["in-out"]),useNativeDriver:nativeDriver});e.start();const t=X.current.map(e=>Animated.timing(e,{toValue:z?1:0,duration:T,easing:Easing.bezier(...w.motion.ease["in-out"]),useNativeDriver:nativeDriver})),o=z?t:[...t].reverse(),n=Animated.stagger(V,o);return n.start(),()=>{e.stop(),n.stop()}},[z,W,T,w.motion.ease["in-out"],P,Y,V]);const q=useCallback(e=>{const t=resolveHaptic(m,"impactLight");t&&triggerHaptic(t),N||L(e),r?.(e)},[N,r,m]),J=useRef(null),K=useRef(z),Q=useRef(!1);useEffect(()=>{if(K.current===z)return;K.current=z;const e=Q.current;if(Q.current=!1,H||e)return;const t=J.current;t&&("web"===Platform.OS?"focus"in t&&"function"==typeof t.focus&&t.focus():AccessibilityInfo.sendAccessibilityEvent(t,"focus")),announce(z?pluralText(x,"expanded",P,{label:v}):fillText(x.collapsed,{label:v}))},[z,H,v,P,x]);const ee=useCallback(()=>{q(!z)},[z,q]),te=useCallback(e=>{!1!==m&&triggerHaptic("selection"),Q.current=!0,e.onPress(),N||L(!1),r?.(!1)},[N,r,m]),oe=useCallback(()=>{z&&q(!1)},[z,q]);useEffect(()=>{if(!z)return;const e=BackHandler.addEventListener("hardwareBackPress",()=>(q(!1),!0));return()=>e.remove()},[z,q]),useEffect(()=>{if(!z||"web"!==Platform.OS)return;const onKeyDown=e=>{"Escape"===e.key&&q(!1)};return window.addEventListener("keydown",onKeyDown),()=>window.removeEventListener("keydown",onKeyDown)},[z,q]);const ne=useMemo(()=>{const e=(c??j)+_.bottom;switch(l){case"bottomLeft":return{position:"absolute",bottom:e,left:F,alignItems:"flex-start"};case"bottomCenter":return{position:"absolute",bottom:e,alignSelf:"center",alignItems:"center"};default:return{position:"absolute",bottom:e,right:F,alignItems:"flex-end"}}},[l,c,_.bottom,j,F]),slotOffset=e=>-(E.diameter+C)*(e+1),ie=useMemo(()=>{switch(l){case"bottomLeft":return{left:0,right:0,justifyContent:"flex-start"};case"bottomCenter":return{left:0,right:0,justifyContent:"center"};default:return{left:0,right:0,justifyContent:"flex-end"}}},[l]),se=.78*E.diameter,re=useMemo(()=>{const e=se+w.space.sm;switch(l){case"bottomLeft":return{left:e,alignItems:"flex-start"};case"bottomCenter":return{right:E.diameter/2+se/2+w.space.sm,alignItems:"flex-end"};default:return{right:e,alignItems:"flex-end"}}},[l,se,E.diameter,w.space.sm]),ae=W.interpolate({inputRange:[0,1],outputRange:[0,.4]}),le=W.interpolate(R.reduced?{inputRange:[0,.5,.5001,1],outputRange:["0deg","0deg","45deg","45deg"]}:{inputRange:[0,1],outputRange:["0deg","45deg"]});return _jsxs(_Fragment,{children:[z?_jsx(Animated.View,{pointerEvents:z?"auto":"none",style:[StyleSheet.absoluteFill,{backgroundColor:w.colors.scrim,opacity:ae}],children:_jsx(Pressable,{style:StyleSheet.absoluteFill,onPress:oe,accessibilityElementsHidden:!0,importantForAccessibility:"no",testID:A?`${A}-backdrop`:void 0})}):null,_jsxs(Animated.View,{pointerEvents:H?"none":"box-none",style:[ne,{transform:[{translateY:$}],opacity:U},b],accessibilityRole:"menu",testID:A,children:[k.map(({action:e,index:t})=>{const o=X.current[t];if(!o)return null;const n=o.interpolate({inputRange:[0,1],outputRange:R.range(0,slotOffset(t))}),i=o.interpolate({inputRange:[0,1],outputRange:R.range(.6,1)}),s=toneBackground(w,e.tone??"primary"),r=toneForeground(w,e.tone??"primary"),a=e.label?_jsx(View,{pointerEvents:"none",style:[I.labelSlot,re],testID:A?`${A}-label-${e.key}`:void 0,children:_jsx(View,{style:[I.labelPill,w.shadow.card,{backgroundColor:w.colors.surface,paddingHorizontal:w.space.sm,paddingVertical:w.space.xs,borderRadius:w.radius.sm,...smoothCorners},h],children:_jsx(Text,{style:[{color:w.colors["text-body"],fontSize:w.text.sm.size,fontWeight:w.weight.medium},y],numberOfLines:1,children:e.label})})}):null;return _jsxs(Animated.View,{pointerEvents:z?"auto":"none",accessibilityElementsHidden:!z,importantForAccessibility:z?"auto":"no-hide-descendants","aria-hidden":!z,style:[I.secondaryRow,ie,{position:"absolute",bottom:0,opacity:o,transform:[{translateY:n},{scale:i}]}],children:[_jsx(Pressable,{onPress:()=>te(e),focusable:z,accessibilityRole:"menuitem",accessibilityLabel:e.accessibilityLabel,style:[I.fabBase,w.shadow.elevated,{width:se,height:se,borderRadius:se/2,...smoothCorners,backgroundColor:s},g],testID:A?`${A}-action-${e.key}`:void 0,children:({pressed:t})=>_jsxs(_Fragment,{children:[t?_jsx(View,{pointerEvents:"none",testID:"fab-pressed",style:[I.pressedTint,{backgroundColor:pressedTintFor(w,e.tone??"primary"),borderRadius:se/2,...smoothCorners}]}):null,renderSlotIcon(e.icon,{color:r,size:E.icon,disabled:!1})]})}),a]},e.key)}),_jsx(Pressable,{ref:J,onPress:ee,accessibilityRole:"button",accessibilityLabel:v,accessibilityState:{expanded:z},"aria-expanded":z,style:[I.fabBase,w.shadow.popover,{width:E.diameter,height:E.diameter,borderRadius:E.diameter/2,...smoothCorners,backgroundColor:w.colors.primary}],testID:A?`${A}-primary`:void 0,children:({pressed:e})=>_jsxs(_Fragment,{children:[e?_jsx(View,{pointerEvents:"none",testID:"fab-pressed",style:[I.pressedTint,{backgroundColor:ACCENT_PRESSED_TINT,borderRadius:E.diameter/2,...smoothCorners}]}):null,_jsx(Animated.View,{style:o?void 0:{transform:[{rotate:le}]},children:renderSlotIcon(z&&o?o:t,{color:w.colors["on-primary"],size:E.icon,disabled:!1})})]})})]})]})},buildGroupStyles=e=>StyleSheet.create({fabBase:{flexDirection:"row",alignItems:"center",justifyContent:"center",overflow:"hidden"},pressedTint:{position:"absolute",top:0,right:0,bottom:0,left:0},secondaryRow:{flexDirection:"row",alignItems:"center"},labelSlot:{position:"absolute",top:0,bottom:0,justifyContent:"center"},labelPill:{alignSelf:"auto"}});export{FloatingActionButton,FloatingActionButtonGroup};export default FloatingActionButton;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";export{
|
|
1
|
+
"use strict";export{default,FloatingActionButton,FloatingActionButtonGroup}from"./FloatingActionButton.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{Logger,VersionCheck}from"@webority/mobile-core";import{useCallback,useMemo,useState}from"react";import{Linking,StyleSheet,Text,View}from"react-native";import{useTheme}from"../../theme/index.js";import{Dialog}from"../Dialog/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";
|
|
1
|
+
"use strict";import{Logger,VersionCheck}from"@webority/mobile-core";import{useCallback,useMemo,useState}from"react";import{Linking,StyleSheet,Text,View}from"react-native";import{useMobileUiText}from"../../text/index.js";import{FORCE_UPDATE_DIALOG_TEXT}from"../../text/phone/forceUpdateDialog.g.js";import{useTheme}from"../../theme/index.js";import{Dialog}from"../Dialog/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const styles=StyleSheet.create({fallback:{alignItems:"center"},fallbackCopy:{textAlign:"center"},fallbackLink:{textAlign:"center",textDecorationLine:"underline"}});export const ForceUpdateDialog=({open:e,onClose:t,mandatory:l=!1,updateUrl:o,updateFallbackUrl:s,title:a,message:i,labels:r,style:n,bodyStyle:c,titleStyle:m,messageStyle:d,testID:b})=>{const p=useTheme(),[g,x]=useState(!1),[y,u]=useState(!1),f=useMobileUiText("forceUpdateDialog",FORCE_UPDATE_DIALOG_TEXT),k=useMemo(()=>({...f,...r}),[f,r]),h=useCallback(()=>{x(!0),u(!1),(async()=>{let e=!1;try{e=await VersionCheck.openUpdateUrl(o??null)}catch(e){Logger.error("[@webority/mobile-ui] ForceUpdateDialog failed to open the store URL.",e)}finally{x(!1),u(!e)}})()},[o]),D=useCallback(e=>{Linking.openURL(e).catch(e=>{Logger.error("[@webority/mobile-ui] ForceUpdateDialog failed to open the fallback address.",e)})},[]),U=y?s:null,S=U?_jsxs(View,{style:styles.fallback,children:[_jsx(Text,{style:[styles.fallbackCopy,{color:p.colors["text-muted"],fontSize:p.text.base.size,lineHeight:p.text.base.size*p.leading.body}],children:k.storeFallbackText}),_jsx(Text,{accessibilityRole:"link",onPress:()=>D(U),style:[styles.fallbackLink,{color:p.colors.link,fontSize:p.text.base.size,marginTop:p.space.xs}],children:U})]}):null,T=useCallback(()=>{l||t?.()},[l,t]),j=l?[{label:k.update,onPress:h,tone:"info",loading:g}]:[{label:k.later,onPress:T,tone:"neutral"},{label:k.update,onPress:h,tone:"info",loading:g}];return _jsx(Dialog,{open:e,onClose:T,title:a??k.title,message:i??k.message,tone:"info",actions:j,dismissOnAction:!1,style:n,bodyStyle:c,titleStyle:m,messageStyle:d,testID:b,children:S})};export default ForceUpdateDialog;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";export{
|
|
1
|
+
"use strict";export{default,ForceUpdateDialog}from"./ForceUpdateDialog.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import React,{forwardRef,useEffect,useMemo,useRef}from"react";import{Animated,StyleSheet,Text,View}from"react-native";import{useFieldErrorAnchor}from"../../hooks/useFieldErrorScroll.js";import{createAnimatedValue,fontFor,useTheme}from"../../theme/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{nativeDriver}from"../../utils/nativeDriver.js";import{fieldTextAsString,hasFieldText,RequiredMark}from"../FieldBase/index.js";import{TextInkContext,useTextInk}from"../Text/textInk.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";
|
|
1
|
+
"use strict";import React,{forwardRef,useEffect,useMemo,useRef}from"react";import{Animated,StyleSheet,Text,View}from"react-native";import{useFieldErrorAnchor}from"../../hooks/useFieldErrorScroll.js";import{fillText,useMobileUiText}from"../../text/index.js";import{FORM_FIELD_TEXT}from"../../text/phone/formField.g.js";import{createAnimatedValue,fontFor,useTheme}from"../../theme/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{nativeDriver}from"../../utils/nativeDriver.js";import{fieldTextAsString,hasFieldText,RequiredMark}from"../FieldBase/index.js";import{TextInkContext,useTextInk}from"../Text/textInk.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const FormField=forwardRef((e,t)=>{assertValidValue("FormField","layout",e.layout,["stacked","inline"]);const{label:i,help:l,helperText:r,error:s,required:o=!1,children:n,layout:a="stacked",helperLines:d,labelStyle:x,helperStyle:u,errorStyle:c,style:m,inputContainerStyle:f,accessibilityLabel:h,labels:p,testID:T}=e,F=useFieldErrorAnchor(hasFieldText(s),t),b=useTheme(),y=useMemo(()=>buildStyles(b),[b]),S=useMobileUiText("formField",FORM_FIELD_TEXT),j=useMemo(()=>({...S,...p}),[S,p]),k=fieldTextAsString(s),I=useRef(createAnimatedValue(s?1:0)).current;useEffect(()=>{const e=Animated.timing(I,{toValue:s?1:0,duration:b.motion.duration.fast,useNativeDriver:nativeDriver});return e.start(),()=>e.stop()},[s,I,b.motion.duration.fast]);const v=useMemo(()=>{if(h)return h;const e=fieldTextAsString(i);return e?k?fillText(j.labelWithError,{label:e,error:k}):e:void 0},[h,i,k,j]),_=useTextInk(x,b.text.sm.size,b.colors["text-muted"]),V=useTextInk(u,b.text.sm.size,b.colors["text-subtle"]),w=useTextInk(c,b.text.sm.size,b.colors["danger-text"]),R=hasFieldText(i),g=_jsxs(Text,{style:[y.label,"inline"!==a||hasFieldText(l)?null:y.labelInline,hasFieldText(l)?y.labelShrink:null,x],children:[_jsx(TextInkContext.Provider,{value:_,children:i}),o?_jsx(RequiredMark,{}):null]}),E=R?hasFieldText(l)?_jsxs(View,{style:[y.labelRow,"inline"===a?y.labelInline:null],children:[g,_jsx(View,{style:[y.help,{marginLeft:b.space.xs}],children:l})]}):g:null,D="inline"===a?y.inputInline:y.inputStacked,A=hasFieldText(s),M=!A&&hasFieldText(r),z=o&&!R&&React.isValidElement(n)?React.cloneElement(n,{required:!0}):n;return _jsxs(View,{ref:F,style:["inline"===a?y.rootInline:y.rootStacked,m],accessibilityLabel:v,accessibilityHint:k||void 0,testID:T,children:[E,_jsx(View,{style:[D,f],children:z}),M?_jsx(Text,{style:[y.helper,u],numberOfLines:d||void 0,children:_jsx(TextInkContext.Provider,{value:V,children:r})}):null,A?_jsx(Animated.Text,{style:[y.error,{opacity:I},c],numberOfLines:d||void 0,accessibilityLiveRegion:"polite",children:_jsx(TextInkContext.Provider,{value:w,children:s})}):null]})});FormField.displayName="FormField";const buildStyles=e=>StyleSheet.create({rootStacked:{flexDirection:"column",gap:e.space.xs},rootInline:{flexDirection:"row",alignItems:"center",flexWrap:"wrap",gap:e.space.xs},label:{fontSize:e.text.sm.size,...fontFor(e,"medium"),color:e.colors["text-muted"]},labelShrink:{flexShrink:1},labelRow:{flexDirection:"row",alignItems:"center"},help:{flexShrink:0},labelInline:{width:"35%"},inputStacked:{width:"100%"},inputInline:{flex:1,minWidth:0},helper:{fontSize:e.text.sm.size,color:e.colors["text-subtle"]},error:{fontSize:e.text.sm.size,color:e.colors["danger-text"]}});export{FormField};export default FormField;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";export{
|
|
1
|
+
"use strict";export{default,FormField}from"./FormField.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import React,{useCallback,useMemo,useRef,useState}from"react";import{Dimensions,Image,Pressable,StyleSheet,View}from"react-native";import{GestureDetector,useCompetingGestures,usePanGesture,usePinchGesture,useTapGesture}from"react-native-gesture-handler";import Animated,{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{smoothCorners}from"../../utils/corners.js";import{hitSlopMarker}from"../../utils/hitSlop.js";import{defaultIcons}from"../AppIcon/defaultIcons.js";import{Carousel}from"../Carousel/index.js";import{Modal}from"../Modal/Modal.js";import{Skeleton}from"../Skeleton/index.js";import{Text}from"../Text/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";
|
|
1
|
+
"use strict";import React,{useCallback,useMemo,useRef,useState}from"react";import{Dimensions,Image,Pressable,StyleSheet,View}from"react-native";import{GestureDetector,useCompetingGestures,usePanGesture,usePinchGesture,useTapGesture}from"react-native-gesture-handler";import Animated,{useAnimatedStyle,useSharedValue,withSpring,withTiming}from"react-native-reanimated";import{scheduleOnRN}from"react-native-worklets";import{fillText,useMobileUiText}from"../../text/index.js";import{IMAGE_GALLERY_TEXT}from"../../text/phone/imageGallery.g.js";import{useTheme}from"../../theme/index.js";import{resolveHaptic,triggerHaptic}from"../../utils/index.js";import{smoothCorners}from"../../utils/corners.js";import{hitSlopMarker}from"../../utils/hitSlop.js";import{defaultIcons}from"../AppIcon/defaultIcons.js";import{Carousel}from"../Carousel/index.js";import{Modal}from"../Modal/Modal.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 MAX_SCALE_FALLBACK=4,MIN_SCALE_FALLBACK=1,DOUBLE_TAP_SCALE_FALLBACK=2,SPRING_CONFIG={damping:18,stiffness:220,mass:1},ImageGallery=({images:e,initialIndex:t=0,showThumbnails:a=!0,showCounter:l=!0,enableLightbox:i=!0,enablePinchZoom:s=!0,onIndexChange:o,haptic:n,loading:r=!1,accessibilityLabel:u,style:c,testID:m,labels:d})=>{const h=useTheme(),g=useMemo(()=>buildStyles(h),[h]),p=useMobileUiText("imageGallery",IMAGE_GALLERY_TEXT),b=useMemo(()=>({...p,...d}),[p,d]),[x,v]=useState(clamp(t,0,Math.max(0,e.length-1))),[S,y]=useState(!1),I=useCallback(e=>{v(e),o?.(e)},[o]),w=useCallback(()=>{if(!i)return;const e=resolveHaptic(n,"selection");e&&triggerHaptic(e),y(!0)},[i,n]),C=useCallback(()=>{const e=resolveHaptic(n,"selection");e&&triggerHaptic(e),y(!1)},[n]),f=useCallback((t,a)=>{const l=t.alt??fillText(b.imageOf,{index:a+1,total:e.length});return _jsx(Pressable,{onPress:w,accessibilityRole:"image",accessibilityLabel:l,accessibilityHint:i?b.openFullscreen:void 0,style:g.imageWrap,children:_jsx(Image,{source:t.source,style:g.image,resizeMode:"cover"})})},[i,e.length,w,g,b]),_=useCallback(e=>_jsx(Image,{source:e.source,style:g.thumbnailImage,resizeMode:"cover"}),[g]),G=_jsxs(View,{style:[g.container,c],testID:m,accessibilityLabel:u??b.gallery,children:[_jsxs(View,{style:g.carouselWrap,accessibilityElementsHidden:S,importantForAccessibility:S?"no-hide-descendants":"auto",children:[_jsx(Carousel,{data:e,defaultIndex:t,onIndexChange:I,renderItem:f,showPagination:!1,showThumbnails:a,renderThumbnail:_,haptic:n}),l&&e.length>0?_jsx(View,{style:g.counterPill,pointerEvents:"none",children:_jsx(Text,{variant:"label",weight:"semibold",style:{color:h.colors["on-scrim"]},accessibilityLabel:fillText(b.imageOf,{index:x+1,total:e.length}),children:`${x+1} / ${e.length}`})}):null]}),i?_jsx(Lightbox,{open:S,images:e,initialIndex:x,enablePinchZoom:s,showCounter:l,onClose:C,onIndexChange:I,haptic:n,labels:b,testID:m}):null]});return r?_jsx(ImageGallerySkeleton,{images:e,showThumbnails:a,showCounter:l,style:c,testID:m}):G};ImageGallery.displayName="ImageGallery";const ImageGallerySkeleton=({images:e,showThumbnails:t=!0,showCounter:a=!0,style:l,testID:i})=>{const s=useTheme(),o=Math.min(e?.length||4,6),n=useMemo(()=>Array.from({length:o},(e,t)=>({key:`sk-thumb-${t}`})),[o]);return _jsxs(View,{style:[{width:"100%"},l],testID:i,accessibilityRole:"progressbar",accessibilityState:{busy:!0},"aria-busy":!0,children:[_jsxs(View,{style:{position:"relative"},children:[_jsx(Skeleton,{width:"100%",height:280,radius:"lg"}),a?_jsx(View,{style:{position:"absolute",top:12,right:12},children:_jsx(Skeleton,{width:44,height:22,radius:"pill"})}):null]}),t?_jsx(View,{style:{flexDirection:"row",marginTop:s.space.md},children:n.map(e=>_jsx(Skeleton,{width:64,height:64,radius:"md",style:{marginRight:s.space.sm}},e.key))}):null]})};ImageGallerySkeleton.displayName="ImageGallerySkeleton",ImageGallery.Skeleton=ImageGallerySkeleton;const Lightbox=({open:e,images:t,initialIndex:a,enablePinchZoom:l,showCounter:i,onClose:s,onIndexChange:o,haptic:n,labels:r,testID:u})=>{const c=useTheme(),m=useMemo(()=>buildLightboxStyles(c),[c]),d=useRef(null),[h,g]=useState(a),p=useCallback(e=>{if(e!==h){const t=resolveHaptic(n,"selection");t&&triggerHaptic(t),g(e),o(e)}},[h,o,n]),b=useCallback((e,a)=>_jsx(ZoomableImage,{image:e,index:a,total:t.length,active:a===h,enabled:l,maxScale:4,minScale:1,doubleTapScale:2,haptic:n,imageLabel:r.imageOf}),[h,l,t.length,n,r]),x=t[h]?.caption;return _jsx(Modal,{open:e,onClose:s,presentation:"fullScreen",backdropPressClose:!1,animateMount:!1,contentStyle:{backgroundColor:"transparent"},children:_jsxs(View,{style:m.backdrop,children:[_jsx(Carousel,{ref:d,testID:u?`${u}-lightbox`:void 0,data:t,defaultIndex:a,onIndexChange:p,renderItem:b,showPagination:!1,haptic:n}),i&&t.length>0?_jsx(View,{style:m.counterPill,pointerEvents:"none",children:_jsx(Text,{variant:"label",weight:"semibold",style:{color:c.colors["on-scrim"]},accessibilityLabel:fillText(r.imageOf,{index:h+1,total:t.length}),children:`${h+1} / ${t.length}`})}):null,_jsx(Pressable,{onPress:s,accessibilityRole:"button",accessibilityLabel:r.closeGallery,style:m.closeButton,hitSlop:12,...hitSlopMarker(12),children:(c.settings.icons.close??defaultIcons.close)({size:24,color:c.colors["on-scrim"]})}),x?_jsx(Animated.View,{style:m.captionWrap,accessibilityElementsHidden:!1,children:_jsx(Text,{variant:"body",align:"center",numberOfLines:3,style:m.captionText,children:x})}):null]})})},ZoomableImage=({image:e,index:t,total:a,active:l,enabled:i,maxScale:s,minScale:o,doubleTapScale:n,haptic:r,imageLabel:u})=>{const c=Dimensions.get("window"),m=useSharedValue(1),d=useSharedValue(1),h=useSharedValue(0),g=useSharedValue(0),p=useSharedValue(0),b=useSharedValue(0),x=useCallback(()=>{m.value=withSpring(1,SPRING_CONFIG),d.value=1,h.value=withSpring(0,SPRING_CONFIG),g.value=withSpring(0,SPRING_CONFIG),p.value=0,b.value=0},[m,d,h,g,p,b]);React.useEffect(()=>{l||(m.value=withTiming(1,{duration:150}),h.value=withTiming(0,{duration:150}),g.value=withTiming(0,{duration:150}),d.value=1,p.value=0,b.value=0)},[l,m,h,g,d,p,b]);const v=useCallback(()=>{!1!==r&&triggerHaptic("impactLight")},[r]),S=useMemo(()=>({enabled:i,onActivate:()=>{"worklet";d.value=m.value},onUpdate:e=>{"worklet";const t=d.value*e.scale;m.value=t<o?o+.3*(t-o):t>s?s+.2*(t-s):t},onDeactivate:()=>{"worklet";return m.value<o?(m.value=withSpring(o,SPRING_CONFIG),h.value=withSpring(0,SPRING_CONFIG),g.value=withSpring(0,SPRING_CONFIG),d.value=o,p.value=0,void(b.value=0)):m.value>s?(m.value=withSpring(s,SPRING_CONFIG),void(d.value=s)):void(d.value=m.value)}}),[i,m,d,h,g,p,b,o,s]),y=usePinchGesture(S),I=useMemo(()=>({minPointers:1,maxPointers:1,onActivate:()=>{"worklet";p.value=h.value,b.value=g.value},onUpdate:e=>{"worklet";m.value<=1||(h.value=p.value+e.translationX,g.value=b.value+e.translationY)},onDeactivate:()=>{"worklet";p.value=h.value,b.value=g.value}}),[m,h,g,p,b]),w=usePanGesture(I),C=useMemo(()=>({numberOfTaps:2,onDeactivate:()=>{"worklet";scheduleOnRN(v),m.value>1?(m.value=withSpring(1,SPRING_CONFIG),h.value=withSpring(0,SPRING_CONFIG),g.value=withSpring(0,SPRING_CONFIG),d.value=1,p.value=0,b.value=0):(m.value=withSpring(n,SPRING_CONFIG),d.value=n)}}),[m,d,h,g,p,b,v,n]),f=useTapGesture(C),_=useCompetingGestures(y,w,f),G=useAnimatedStyle(()=>({transform:[{translateX:h.value},{translateY:g.value},{scale:m.value}]}),[h,g,m]);React.useEffect(()=>{l||x()},[l,x]);const j=e.alt??fillText(u,{index:t+1,total:a});return _jsx(GestureDetector,{gesture:_,children:_jsx(Animated.View,{style:[lightboxImageStyles.container,{width:c.width}],children:_jsx(Animated.Image,{source:e.source,resizeMode:"contain",style:[lightboxImageStyles.image,G],accessibilityLabel:j,accessible:!0})})})},clamp=(e,t,a)=>Math.min(Math.max(e,t),a),buildStyles=e=>StyleSheet.create({container:{width:"100%"},carouselWrap:{width:"100%",position:"relative"},imageWrap:{width:"100%",aspectRatio:16/9,backgroundColor:e.colors["bg-subtle"],overflow:"hidden",borderRadius:e.radius.md,...smoothCorners},image:{width:"100%",height:"100%"},thumbnailImage:{width:"100%",height:"100%"},counterPill:{position:"absolute",top:12,alignSelf:"center",paddingHorizontal:e.space.md,paddingVertical:e.space.xs,borderRadius:e.radius.pill,...smoothCorners,backgroundColor:"rgba(0,0,0,0.55)"}}),buildLightboxStyles=e=>StyleSheet.create({backdrop:{flex:1,backgroundColor:"#000",justifyContent:"center"},counterPill:{position:"absolute",top:48,alignSelf:"center",paddingHorizontal:e.space.md,paddingVertical:e.space.xs,borderRadius:e.radius.pill,...smoothCorners,backgroundColor:"rgba(0,0,0,0.6)"},closeButton:{position:"absolute",top:44,right:16,width:40,height:40,borderRadius:e.radius.pill,...smoothCorners,alignItems:"center",justifyContent:"center",backgroundColor:"rgba(0,0,0,0.5)"},captionWrap:{position:"absolute",left:0,right:0,bottom:32,paddingHorizontal:e.space.xl},captionText:{color:e.colors["on-scrim"]}}),lightboxImageStyles=StyleSheet.create({container:{flex:1,alignItems:"center",justifyContent:"center"},image:{width:"100%",height:"100%"}});export{ImageGallery};export default ImageGallery;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";export{
|
|
1
|
+
"use strict";export{default,ImageGallery}from"./ImageGallery.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{useCallback,useMemo,useState}from"react";import{Pressable,StyleSheet,Text,View}from"react-native";import{fontFor,resolveFieldSize,useTheme}from"../../theme/index.js";import{resolveHaptic,triggerHaptic}from"../../utils/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{isRecord}from"../../utils/guards.js";import{hitSlopMarker}from"../../utils/hitSlop.js";import{Chevron}from"../FieldBase/Chevron.js";import{FieldLabel}from"../FieldBase/FieldBase.js";import{OptionSheet}from"../OptionSheet/OptionSheet.js";import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from"react/jsx-runtime";
|
|
1
|
+
"use strict";import{useCallback,useMemo,useState}from"react";import{Pressable,StyleSheet,Text,View}from"react-native";import{fillText,useMobileUiText}from"../../text/index.js";import{INLINE_SELECT_TEXT}from"../../text/phone/inlineSelect.g.js";import{fontFor,resolveFieldSize,useTheme}from"../../theme/index.js";import{resolveHaptic,triggerHaptic}from"../../utils/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{isRecord}from"../../utils/guards.js";import{hitSlopMarker}from"../../utils/hitSlop.js";import{Chevron}from"../FieldBase/Chevron.js";import{FieldLabel}from"../FieldBase/FieldBase.js";import{OptionSheet}from"../OptionSheet/OptionSheet.js";import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from"react/jsx-runtime";const isSelectOption=e=>isRecord(e)&&("string"==typeof e.value||"number"==typeof e.value);function InlineSelect(e){const{ref:t,options:i,getOptionLabel:l,getOptionValue:s,isOptionDisabled:o,getOptionDescription:n,getOptionIcon:r,value:a,onChange:c,placeholder:p,labels:d,label:u,title:m,searchable:S=!1,haptic:b,disabled:x=!1,size:f="md",color:g,chevronColor:h,chevronSize:y,textStyle:O,style:j,optionStyle:v,selectedOptionStyle:T,optionTextStyle:C,selectedOptionTextStyle:I,accessibilityLabel:_,testID:F}=e,k=useTheme(),L=Object.keys(k.components.field);assertValidValue("InlineSelect","size",e.size,L);const V=useMemo(()=>buildStyles(k),[k]),z=L.includes(f)?f:"md",E=resolveFieldSize(k,z),M=useMobileUiText("inlineSelect",INLINE_SELECT_TEXT),D=useMemo(()=>({...M,...d}),[M,d]),H=useCallback(e=>l?l(e):isSelectOption(e)?e.label??"":"",[l]),w=useCallback(e=>{if(s)return s(e);if(isSelectOption(e))return e.value;throw new Error("InlineSelect option has no value; pass getOptionValue.")},[s]),N=useCallback(e=>o?o(e):isSelectOption(e)&&!0===e.disabled,[o]),P=useCallback(e=>n?n(e):isSelectOption(e)?e.description:void 0,[n]),B=useCallback(e=>r?r(e):isSelectOption(e)?e.icon:void 0,[r]),[R,U]=useState(!1),X=useMemo(()=>{if(null!=a)return i.find(e=>w(e)===a)},[i,a,w]),$=useCallback(()=>{if(x)return;const e=resolveHaptic(b,"selection");e&&triggerHaptic(e),U(!0)},[x,b]),G=useCallback(()=>{U(!1)},[]),q=useCallback(e=>{if(N(e))return;const t=resolveHaptic(b,"selection");t&&triggerHaptic(t),c(w(e)),G()},[N,w,c,G,b]),A=x?k.colors["text-disabled"]:g??k.colors.primary,J=void 0!==X?H(X):p??D.select,K=void 0!==X?fillText(D.selected,{label:H(X)}):p??D.noSelection,Q=_??`${u??m??D.select}. ${K}`,W=_jsxs(Pressable,{ref:t,onPress:$,disabled:x,hitSlop:8,...hitSlopMarker(8),accessibilityRole:"button",accessibilityLabel:Q,accessibilityState:{disabled:x,expanded:R},"aria-disabled":x,"aria-expanded":R,testID:F,style:({pressed:e})=>[V.trigger,{columnGap:k.space.xs,opacity:e&&!x?.6:1},j],children:[_jsx(Text,{style:[V.triggerText,{color:A,fontSize:E.text,...fontFor(k,"medium")},O],numberOfLines:1,children:J}),_jsx(Chevron,{color:h??A,size:y??E.icon,open:R})]});return _jsxs(_Fragment,{children:[u?_jsxs(View,{style:V.labelled,children:[_jsx(FieldLabel,{size:z,children:u}),W]}):W,_jsx(OptionSheet,{open:R,onClose:G,haptic:b,title:m,accessibilityLabel:u??m??p??D.options,options:i,getOptionLabel:H,getOptionValue:w,isOptionDisabled:N,getOptionDescription:P,getOptionIcon:B,value:a,onChange:(e,t)=>q(t),searchable:S,optionStyle:v,selectedOptionStyle:T,optionTextStyle:C,selectedOptionTextStyle:I})]})}InlineSelect.displayName="InlineSelect";const buildStyles=e=>StyleSheet.create({labelled:{alignItems:"flex-start"},trigger:{flexDirection:"row",alignItems:"center"},triggerText:{includeFontPadding:!1}});export{InlineSelect};export default InlineSelect;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";export{
|
|
1
|
+
"use strict";export{default,InlineSelect}from"./InlineSelect.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{forwardRef,useCallback,useEffect,useMemo,useRef,useState}from"react";import{Animated,Easing,Pressable,StyleSheet,Text,TextInput,View}from"react-native";import{useReducedMotion}from"../../hooks/index.js";import{createAnimatedValue,fontFor,resolveFieldSize,setNativeValue,useTheme}from"../../theme/index.js";import{mergeRefs,triggerHaptic}from"../../utils/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{hitSlopMarker}from"../../utils/hitSlop.js";import{nativeDriver}from"../../utils/nativeDriver.js";import{defaultIcons}from"../AppIcon/defaultIcons.js";import{renderSlotIcon,slotIconView}from"../AppIcon/slotIcon.js";import{Button}from"../Button/index.js";import{FieldBase,FieldErrorGlyph,FieldLabel,fieldTextAsString,hasFieldText,RequiredPlaceholder,resolveFieldTextStyle}from"../FieldBase/FieldBase.js";import{useFloatingLabel}from"../FieldBase/useFloatingLabel.js";import{TextInkContext,useTextInk}from"../Text/textInk.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";
|
|
1
|
+
"use strict";import{forwardRef,useCallback,useEffect,useMemo,useRef,useState}from"react";import{Animated,Easing,Pressable,StyleSheet,Text,TextInput,View}from"react-native";import{useReducedMotion}from"../../hooks/index.js";import{useMobileUiText}from"../../text/index.js";import{INPUT_TEXT}from"../../text/phone/input.g.js";import{createAnimatedValue,fontFor,resolveFieldSize,setNativeValue,useTheme}from"../../theme/index.js";import{mergeRefs,triggerHaptic}from"../../utils/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{hitSlopMarker}from"../../utils/hitSlop.js";import{nativeDriver}from"../../utils/nativeDriver.js";import{defaultIcons}from"../AppIcon/defaultIcons.js";import{renderSlotIcon,slotIconView}from"../AppIcon/slotIcon.js";import{Button}from"../Button/index.js";import{FieldBase,FieldErrorGlyph,FieldLabel,fieldTextAsString,hasFieldText,RequiredPlaceholder,resolveFieldTextStyle}from"../FieldBase/FieldBase.js";import{useFloatingLabel}from"../FieldBase/useFloatingLabel.js";import{TextInkContext,useTextInk}from"../Text/textInk.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const Input=forwardRef((e,t)=>{const{label:i,help:n,placeholder:o,value:l,onChangeText:s,error:r,helperText:a,type:d="input",secureTextEntry:u=!1,showPasswordToggle:c=!1,disabled:p=!1,multiline:f=!1,leftIcon:m,rightIcon:x,unit:g,unitStyle:h,prefix:v,prefixStyle:y,readOnly:b=!1,action:S,actionStyle:T,size:j="md",variant:I,labelMode:w,required:V=!1,maxLength:F,showCounter:R=!0,textAlign:_,format:A,parse:D,style:z,fieldStyle:k,inputStyle:P,labelStyle:C,messageStyle:L,radius:M,onFocus:N,onBlur:E,accessibilityLabel:B,labels:H,testID:O,editable:q,...G}=e;assertValidValue("Input","variant",I,["outline","filled","underline"]),assertValidValue("Input","size",e.size,["sm","md","lg"]),assertValidValue("Input","labelMode",w,["float","top"]),assertValidValue("Input","type",e.type,["input","password","textarea"]);const U=useMobileUiText("input",INPUT_TEXT),W=useMemo(()=>({...U,...H}),[U,H]),X=useTheme(),$=useMemo(()=>buildStyles(X),[X]),J=resolveFieldSize(X,j),K=X.components.input[j]["multiline-min-height"],Q=Math.round(J.text*X.leading.body),Y=I??X.settings.components.input?.defaultVariant??X.settings.components.field?.defaultVariant??"outline",Z=w??X.settings.components.input?.defaultLabelMode??"top",[ee,te]=useState(!1),[ie,ne]=useState(!1),oe="password"===d||c||u,le="password"===d||c,se="textarea"===d||f,re=se?Math.round(.1*J.text):0,ae="string"==typeof l&&l.length>0,de=hasFieldText(r),ue=!0===r||de,ce=hasFieldText(a),pe=de||!ue&&ce,fe=hasFieldText(i),me=hasFieldText(v),xe=!p&&!1!==q,ge=ee||ae||me,he=useRef(null),ve=useMemo(()=>mergeRefs(he,t),[t]),ye=useCallback(()=>{xe&&he.current?.focus()},[xe]),be=fe&&"float"===Z,Se=useRef(createAnimatedValue(0)).current,Te=useRef(createAnimatedValue(pe?1:0)).current;useEffect(()=>{const e=Animated.timing(Te,{toValue:pe?1:0,duration:X.motion.duration.fast,easing:Easing.bezier(...X.motion.ease["in-out"]),useNativeDriver:nativeDriver});return e.start(),()=>e.stop()},[pe,Te,X.motion.duration.fast,X.motion.ease["in-out"]]);const je=useReducedMotion(),Ie=X.settings.components.input?.shakeOnError??!1,we=useRef(ue);useEffect(()=>{if(!Ie)return void(we.current=ue);let e;return ue&&!we.current&&(je||(setNativeValue(Se,0),e=Animated.sequence([Animated.timing(Se,{toValue:1,duration:50,useNativeDriver:nativeDriver}),Animated.timing(Se,{toValue:-1,duration:50,useNativeDriver:nativeDriver}),Animated.timing(Se,{toValue:1,duration:50,useNativeDriver:nativeDriver}),Animated.timing(Se,{toValue:-1,duration:50,useNativeDriver:nativeDriver}),Animated.timing(Se,{toValue:0,duration:100,useNativeDriver:nativeDriver})]),e.start()),triggerHaptic("notificationError")),we.current=ue,()=>e?.stop()},[ue,Se,Ie,je]);const Ve=useCallback(e=>{te(!0),N?.(e)},[N]),Fe=useCallback(e=>{te(!1),E?.(e)},[E]),Re=useCallback(()=>{triggerHaptic("selection"),ne(e=>!e)},[]),Ae=X.colors["field-caret"],De=X.settings.components.input?.tintLabelOnFocus??!1,ze=ee&&De?X.colors["field-border-focus"]:X.colors["field-label"],ke=Se.interpolate({inputRange:[-1,0,1],outputRange:[-6,0,6]}),Pe=Boolean(x)||Boolean(g)||le,Ce="underline"===Y,Le=m?J.icon+X.space.md+1+X.space.md:0,Me=useFloatingLabel({label:i,enabled:be,floated:ge,required:V,variant:Y,sizeTokens:J,leadingOffset:Le,trailingOffset:Pe?J.icon+X.space.sm:0,textAlign:"center"===_||"right"===_?_:"left",paddingLeft:Ce?X.space.none:J["padding-x"],lineHeight:se?Q:void 0,restNudge:re,floatTrim:se?2:0,color:ze,style:C}),Ne=resolveFieldTextStyle(X,{disabled:p}),Ee=Ne.color,Be=Ne.placeholderColor,He=V&&!fe&&!ae&&"string"==typeof o&&o.length>0,Oe=ue?r:a,qe=R&&"number"==typeof F&&"string"==typeof l?`${l.length} / ${F}`:null,Ge=ue?X.colors["field-message"]:X.colors["text-muted"],Ue=useTextInk(L,J["message-text"],Ge),We=B??fieldTextAsString(i)??o,Xe=p?X.colors["field-icon-disabled"]:ee?X.colors["field-icon-focus"]:X.colors["field-icon"],$e={focused:ee,disabled:p,error:ue,color:Xe,size:J.icon},renderSlot=e=>renderSlotIcon(e,$e),Je=(()=>{if(le){const e=(ie?X.settings.icons.eyeOff:X.settings.icons.eye)??(ie?defaultIcons.eyeOff:defaultIcons.eye);return _jsx(Pressable,{onPress:Re,disabled:!xe,hitSlop:8,...hitSlopMarker(8),accessibilityRole:"button",accessibilityLabel:ie?W.hidePassword:W.showPassword,children:e({size:J.icon,color:Xe})})}const e=g?_jsx(Text,{style:[$.unit,{fontSize:J.text,color:Be},h],children:g}):null,t=x?slotIconView(x,renderSlot(x)):null;return e&&t?_jsxs(View,{style:$.trailingRow,children:[e,t]}):e??t})(),Ke=m?slotIconView(m,renderSlot(m)):null,Qe=StyleSheet.flatten(y),Ye=Qe?.fontSize??J.text,Ze=Qe?.color??Be,et=useMemo(()=>({fontSize:Ye,color:Ze}),[Ye,Ze]),tt=me?"string"==typeof v||"number"==typeof v?_jsx(Text,{style:[$.prefix,{fontSize:J.text,color:Be,marginRight:X.space.xs,lineHeight:se?Q:void 0,paddingTop:se?re:void 0},y],children:v}):_jsx(View,{style:[$.prefixNode,{marginRight:X.space.xs,minHeight:se?Q:void 0,justifyContent:"center",paddingTop:se?re:void 0}],children:_jsx(Text,{style:[$.prefix,{fontSize:J.text,color:Be,lineHeight:se?Q:void 0},y],children:_jsx(TextInkContext.Provider,{value:et,children:v})})}):null,it=S?_jsx(Button,{variant:S.variant??"outline",tone:S.tone??"primary",size:j,label:S.label,leftIcon:S.icon,loading:S.loading,disabled:p||S.disabled,onPress:S.onPress,pressAnimation:!1,testID:S.testID,style:[$.action,{minHeight:J["min-height"],alignSelf:se?"flex-start":"stretch"},T]}):null;return _jsxs(Animated.View,{style:[$.container,{transform:[{translateX:ke}]},z],children:[fe&&!be?_jsx(FieldLabel,{size:j,required:V,help:n,color:ze,style:C,children:i}):null,_jsxs(View,{style:[$.fieldRow,{columnGap:X.space.sm,alignItems:se?"flex-start":"stretch"}],children:[_jsxs(View,{style:$.fieldWrapper,children:[_jsxs(FieldBase,{testID:O?`${O}-field`:void 0,size:j,variant:Y,focused:ee,disabled:p,error:ue,filled:ae,minHeight:se?K:void 0,radius:M,leading:Ke,leadingDivider:null!=m,paddingLeft:Ce?X.space.none:void 0,trailing:Je,slotAlign:se?"top":"center",slotLineHeight:se?Q:void 0,topNotch:Me.topNotch,onPress:ye,pressFeedback:!1,style:k,children:[tt,_jsxs(View,{style:$.inputWrap,children:[_jsx(TextInput,{ref:ve,style:[$.input,{color:Ee,fontSize:J.text,...Ne.weightStyle,paddingLeft:Ce?X.space.none:void 0,minHeight:se?K-2*J["padding-y"]:void 0,lineHeight:se?Q:void 0,paddingTop:se?re:void 0,textAlignVertical:se?"top":"center"},P],textAlign:_,placeholder:be&&!ge||He?void 0:o,placeholderTextColor:Be,value:A&&null!=l?A(l):l,onChangeText:e=>{s&&s(D?D(e):e)},onFocus:Ve,onBlur:Fe,editable:xe,readOnly:b,secureTextEntry:oe&&!ie,multiline:se,autoCapitalize:oe?"none":void 0,autoCorrect:!oe&&void 0,maxLength:F,selectionColor:Ae,accessibilityLabel:We,accessibilityState:{disabled:p},"aria-disabled":p,testID:O,...G}),He&&"string"==typeof o?_jsx(RequiredPlaceholder,{text:o,color:Be,fontSize:J.text,weightStyle:Ne.weightStyle,align:se?"top":"center",paddingTop:se?re:void 0,textAlign:_}):null]})]}),Me.node]}),it]}),pe||qe?_jsxs(View,{style:[$.footerRow,{marginTop:J["message-gap"]}],children:[pe?_jsxs(Animated.View,{style:[$.messageRow,{columnGap:X.space.xs,opacity:Te}],accessibilityLiveRegion:ue?"polite":"none",children:[ue?_jsx(FieldErrorGlyph,{size:J["message-text"],color:Ge}):null,_jsx(Text,{style:[$.messageText,{color:Ge,fontSize:J["message-text"],...fontFor(X,"normal")},L],children:_jsx(TextInkContext.Provider,{value:Ue,children:Oe})})]}):_jsx(View,{style:$.footerSpacer}),qe?_jsx(Text,{style:[$.counterText,{color:X.colors["text-subtle"],fontSize:J["message-text"],...fontFor(X,"normal")}],children:qe}):null]}):null]})});Input.displayName="Input";const buildStyles=e=>StyleSheet.create({container:{width:"100%"},fieldRow:{flexDirection:"row"},fieldWrapper:{position:"relative",overflow:"visible",flex:1},action:{flexShrink:0},input:{padding:e.space.none,margin:e.space.none,includeFontPadding:!1},prefix:{flexShrink:0,includeFontPadding:!1},prefixNode:{flexShrink:0},inputWrap:{flex:1,alignSelf:"stretch",justifyContent:"center"},unit:{includeFontPadding:!1},trailingRow:{flexDirection:"row",alignItems:"center",columnGap:e.space.sm},footerRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",columnGap:e.space.sm},footerSpacer:{flex:1},messageRow:{flex:1,flexDirection:"row",alignItems:"center"},messageText:{flexShrink:1,includeFontPadding:!1},counterText:{flexShrink:0,includeFontPadding:!1}});export{Input};export default Input;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";export{
|
|
1
|
+
"use strict";export{default,Input}from"./Input.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{useMemo}from"react";import{Pressable,StyleSheet,View}from"react-native";import{KeyboardController,KeyboardStickyView,useKeyboardState}from"react-native-keyboard-controller";import{useTheme}from"../../theme/index.js";import{hitSlopMarker}from"../../utils/hitSlop.js";import{Text}from"../Text/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";
|
|
1
|
+
"use strict";import{useMemo}from"react";import{Pressable,StyleSheet,View}from"react-native";import{KeyboardController,KeyboardStickyView,useKeyboardState}from"react-native-keyboard-controller";import{useMobileUiText}from"../../text/index.js";import{KEYBOARD_TOOLBAR_TEXT}from"../../text/phone/keyboardToolbar.g.js";import{useTheme}from"../../theme/index.js";import{hitSlopMarker}from"../../utils/hitSlop.js";import{Text}from"../Text/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const NavButton=({label:e,accessibilityLabel:o,onPress:t,theme:s})=>_jsx(Pressable,{onPress:t,accessibilityRole:"button",accessibilityLabel:o,hitSlop:8,...hitSlopMarker(8),style:{paddingHorizontal:s.space.sm},children:_jsx(Text,{variant:"body",weight:"semibold",size:"lg",color:"link",children:e})}),KeyboardToolbar=e=>{const{showNavigation:o=!0,onDone:t,onNext:s,onPrev:r,labels:i,leading:l,style:a,testID:n}=e,b=useTheme(),c=useKeyboardState(e=>e.isVisible),d=useMobileUiText("keyboardToolbar",KEYBOARD_TOOLBAR_TEXT),y=useMemo(()=>({...d,...i}),[d,i]);if(!c)return null;const m=t??(()=>{KeyboardController.dismiss()}),x=r??(()=>KeyboardController.setFocusTo("prev")),h=s??(()=>KeyboardController.setFocusTo("next"));return _jsx(KeyboardStickyView,{style:styles.anchor,children:_jsxs(View,{testID:n,accessibilityRole:"toolbar",style:[styles.bar,{backgroundColor:b.colors.surface,borderTopColor:b.colors.border,paddingHorizontal:b.space.md},a],children:[o?_jsxs(View,{style:styles.nav,children:[_jsx(NavButton,{label:"‹",accessibilityLabel:y.previous,onPress:x,theme:b}),_jsx(NavButton,{label:"›",accessibilityLabel:y.next,onPress:h,theme:b})]}):_jsx(View,{}),l,_jsx(View,{style:styles.spacer}),_jsx(Pressable,{onPress:m,accessibilityRole:"button",accessibilityLabel:y.done,hitSlop:8,...hitSlopMarker(8),children:_jsx(Text,{variant:"body",weight:"semibold",color:"link",children:y.done})})]})})},styles=StyleSheet.create({anchor:{position:"absolute",left:0,right:0,bottom:0},bar:{height:44,flexDirection:"row",alignItems:"center",borderTopWidth:StyleSheet.hairlineWidth},nav:{flexDirection:"row",alignItems:"center"},spacer:{flex:1}});export{KeyboardToolbar};export default KeyboardToolbar;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";export{
|
|
1
|
+
"use strict";export{KeyboardToolbar}from"./KeyboardToolbar.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import React,{forwardRef,useMemo}from"react";import{Animated,Pressable,StyleSheet,Text,useWindowDimensions,View}from"react-native";import Svg,{Path}from"react-native-svg";import{useFlickGuard}from"../../hooks/useFlickGuard.js";import{usePressAnimation}from"../../hooks/usePressAnimation.js";import{fontFor,resolveCheckboxSize,resolveListItemSize,useTheme}from"../../theme/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{smoothCorners}from"../../utils/corners.js";import{triggerHaptic}from"../../utils/hapticUtils.js";import{mergeRefs}from"../../utils/mergeRefs.js";import{themeStyles}from"../../utils/themeStyles.js";import{defaultIcons}from"../AppIcon/defaultIcons.js";import{Button}from"../Button/index.js";import{IconBadge}from"../IconBadge/index.js";import{useContextMenu}from"../Menu/useContextMenu.js";import{webOnly}from"../Menu/webOnly.js";import{Skeleton}from"../Skeleton/index.js";import{Swipeable}from"../Swipeable/index.js";import{Fragment as _Fragment,jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const Chevron=({color:e})=>{const t=useTheme();return _jsx(_Fragment,{children:(t.settings.icons.chevronRight??defaultIcons.chevronRight)({size:20,color:e})})},BADGE_SIZE={sm:"sm",md:"md",lg:"lg"},RIGHT_BELOW_FONT_SCALE=1.2,MENU_ROW_MIN_HEIGHT=48,WEB_CHECKABLE_ROLE=webOnly({role:"menuitemcheckbox"}),SelectionBox=({checked:e,disabled:t})=>{const i=useTheme(),s=resolveCheckboxSize(i,"md")["box-size"],l=Math.round(.72*s);return _jsx(View,{accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants",pointerEvents:"none",style:{width:s,height:s,alignItems:"center",justifyContent:"center",borderWidth:i.size.border,borderRadius:i.radius.sm,...smoothCorners,borderColor:e?i.colors.primary:i.colors.border,backgroundColor:e?i.colors.primary:t?i.colors["surface-disabled"]:"transparent"},children:e?_jsx(Svg,{width:l,height:l,viewBox:"0 0 24 24",children:_jsx(Path,{d:"M5 12.5l4.5 4.5L19 7.5",stroke:i.colors["on-primary"],strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round",fill:"none"})}):null})},isActionList=e=>Array.isArray(e)&&e.length>0&&e.every(e=>null!=e&&"object"==typeof e&&!React.isValidElement(e)&&"label"in e),renderActions=e=>isActionList(e)?e.map(e=>_jsx(Button,{size:"sm",variant:e.variant??"outline",tone:e.tone,leftIcon:e.icon,disabled:e.disabled,testID:e.testID,label:e.label,onPress:e.onPress},e.label)):e,ListItemRoot=React.memo(forwardRef((e,t)=>{const{title:i,loading:s=!1,subtitle:l,description:o,children:n,titleLines:r,subtitleLines:a=1,leading:c,icon:d,iconTone:m="primary",trailing:u,rightPlacement:h="auto",selectable:p=!1,checked:x=!1,onCheckedChange:g,actions:b,onPress:
|
|
1
|
+
"use strict";import React,{forwardRef,useMemo}from"react";import{Animated,Pressable,StyleSheet,Text,useWindowDimensions,View}from"react-native";import Svg,{Path}from"react-native-svg";import{useFlickGuard}from"../../hooks/useFlickGuard.js";import{usePressAnimation}from"../../hooks/usePressAnimation.js";import{fontFor,resolveCheckboxSize,resolveListItemSize,useTheme}from"../../theme/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{smoothCorners}from"../../utils/corners.js";import{triggerHaptic}from"../../utils/hapticUtils.js";import{mergeRefs}from"../../utils/mergeRefs.js";import{themeStyles}from"../../utils/themeStyles.js";import{defaultIcons}from"../AppIcon/defaultIcons.js";import{Button}from"../Button/index.js";import{IconBadge}from"../IconBadge/index.js";import{useContextMenu}from"../Menu/useContextMenu.js";import{webOnly}from"../Menu/webOnly.js";import{Skeleton}from"../Skeleton/index.js";import{Swipeable}from"../Swipeable/index.js";import{Fragment as _Fragment,jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const Chevron=({color:e})=>{const t=useTheme();return _jsx(_Fragment,{children:(t.settings.icons.chevronRight??defaultIcons.chevronRight)({size:20,color:e})})},BADGE_SIZE={sm:"sm",md:"md",lg:"lg"},RIGHT_BELOW_FONT_SCALE=1.2,MENU_ROW_MIN_HEIGHT=48,WEB_CHECKABLE_ROLE=webOnly({role:"menuitemcheckbox"}),SelectionBox=({checked:e,disabled:t})=>{const i=useTheme(),s=resolveCheckboxSize(i,"md")["box-size"],l=Math.round(.72*s);return _jsx(View,{accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants",pointerEvents:"none",style:{width:s,height:s,alignItems:"center",justifyContent:"center",borderWidth:i.size.border,borderRadius:i.radius.sm,...smoothCorners,borderColor:e?i.colors.primary:i.colors.border,backgroundColor:e?i.colors.primary:t?i.colors["surface-disabled"]:"transparent"},children:e?_jsx(Svg,{width:l,height:l,viewBox:"0 0 24 24",children:_jsx(Path,{d:"M5 12.5l4.5 4.5L19 7.5",stroke:i.colors["on-primary"],strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round",fill:"none"})}):null})},isActionList=e=>Array.isArray(e)&&e.length>0&&e.every(e=>null!=e&&"object"==typeof e&&!React.isValidElement(e)&&"label"in e),renderActions=e=>isActionList(e)?e.map(e=>_jsx(Button,{size:"sm",variant:e.variant??"outline",tone:e.tone,leftIcon:e.icon,disabled:e.disabled,testID:e.testID,label:e.label,onPress:e.onPress},e.label)):e,ListItemRoot=React.memo(forwardRef((e,t)=>{const{title:i,loading:s=!1,subtitle:l,description:o,children:n,titleLines:r,subtitleLines:a=1,leading:c,icon:d,iconTone:m="primary",trailing:u,rightPlacement:h="auto",selectable:p=!1,checked:x=!1,onCheckedChange:g,actions:b,onPress:f,onFocus:y,haptic:j,selected:S=!1,expanded:w,disabled:_=!1,size:v="md",variant:I="list",divider:L=!1,chevron:k=!1,leftActions:V,rightActions:C,contextMenu:R,accessibilityLabel:A,accessibilityHint:B,style:z,rowStyle:T,titleStyle:E,subtitleStyle:F,descriptionStyle:P,leftSlotStyle:D,rightSlotStyle:H,testID:M}=e;assertValidValue("ListItem","size",e.size,["sm","md","lg"]),assertValidValue("ListItem","iconTone",e.iconTone,["primary","success","warning","danger","info","neutral"]),assertValidValue("ListItem","rightPlacement",e.rightPlacement,["auto","side","below"]),assertValidValue("ListItem","variant",e.variant,["list","menu"]);const O="menu"===I,W=r??(O?2:1),G=O?e.checked:void 0,N=useTheme(),K=useMemo(()=>resolveListItemSize(N,v),[N,v]),U=stylesFor(N),{fontScale:Z}=useWindowDimensions(),q=!!u&&("below"===h||"auto"===h&&Z>1.2),J=useContextMenu(_?void 0:R,{haptic:j||!1,testID:M}),Q=useMemo(()=>mergeRefs(t,J.hostRef),[t,J.hostRef]),X=p||!!f,Y=X||J.enabled,$=Y&&!_,{style:ee,pressIn:te,pressOut:ie}=usePressAnimation({enabled:$&&!O}),se=useFlickGuard(),le=A??("string"==typeof i?i:void 0),isText=e=>"string"==typeof e||"number"==typeof e,oe=c??(void 0===d?null:_jsx(IconBadge,{icon:d,tone:m,size:BADGE_SIZE[v]})),ne=p?_jsxs(View,{style:U.selectionLead,children:[_jsx(SelectionBox,{checked:x,disabled:_}),oe?_jsx(View,{style:U.selectionLeadContent,children:oe}):null]}):oe,re=null!=b&&!1!==b&&!(Array.isArray(b)&&0===b.length),ae=L&&!re,ce=_jsxs(View,{style:[U.row,{paddingVertical:O?N.space.sm:K["padding-y"],minHeight:O?48:K["min-height"],backgroundColor:S?N.colors["surface-selected"]:"transparent"},ae?U.divider:null,_&&!O?U.disabled:null,T],children:[ne?_jsx(View,{style:[U.leftSlot,D],children:ne}):null,_jsxs(View,{style:U.middle,children:[null==i||isText(i)?_jsx(Text,{style:[U.title,{fontSize:O?N.text.base.size:K["title-text"],...fontFor(N,O?"normal":"medium"),color:_?N.colors["text-disabled"]:N.colors["text-body"]},E],numberOfLines:W,children:i??" "}):i,null==l||""===l?null:isText(l)?_jsx(Text,{style:[U.subtitle,{fontSize:O?N.text.xs.size:K["subtitle-text"],color:_?N.colors["text-disabled"]:N.colors["text-muted"]},O?U.menuSubtitle:null,F],numberOfLines:a,children:l}):l,null==o||""===o?null:isText(o)?_jsx(Text,{style:[U.description,{fontSize:K["subtitle-text"],color:_?N.colors["text-disabled"]:N.colors["text-subtle"]},P],numberOfLines:2,children:o}):o,null!=n&&!1!==n?_jsx(View,{style:U.body,children:n}):null,q?_jsx(View,{style:[U.rightBelow,H],children:u}):null]}),u&&!q||k?_jsxs(View,{style:[U.rightSlot,q?null:H],children:[q?null:u,k?_jsx(View,{style:u&&!q?U.chevronWithRight:null,children:_jsx(Chevron,{color:_?N.colors["text-disabled"]:N.colors["text-subtle"]})}):null]}):null]}),de=Y?_jsx(Pressable,{ref:Q,onPress:e=>{$&&X&&!se.isFlick(e)&&(j&&triggerHaptic(j),p?g?.(!x):f?.(e))},onPressIn:e=>{se.onPressIn(e),te()},onPressOut:ie,disabled:!$,onFocus:y,accessibilityRole:p?"checkbox":O?"menuitem":f?"button":void 0,accessibilityLabel:le,accessibilityHint:B,accessibilityState:p?{checked:x,disabled:!$,expanded:w}:{selected:S,disabled:!$,expanded:w,...void 0!==G?{checked:G}:null},"aria-disabled":!$,"aria-expanded":w,...p?{"aria-checked":x}:void 0!==G?{"aria-checked":G}:{"aria-selected":S},...void 0!==G?WEB_CHECKABLE_ROLE:null,testID:M,android_ripple:{color:N.colors["surface-pressed"],borderless:!1},style:({pressed:e})=>[z,e?U.pressed:null],...J.hostProps,children:_jsx(Animated.View,{style:ee,children:ce})}):_jsx(View,{ref:t,accessibilityRole:"none",accessibilityLabel:le,accessibilityHint:B,accessibilityState:{selected:S,disabled:_},"aria-selected":S,"aria-disabled":_,testID:M,style:z,children:ce}),me=V&&V.length>0||C&&C.length>0,ue=re?_jsxs(View,{style:[S?{backgroundColor:N.colors["surface-selected"]}:null,L?U.divider:null],children:[de,_jsx(View,{style:U.actions,children:renderActions(b)})]}):de,he=me?_jsx(Swipeable,{leftActions:V,rightActions:C,accessibilityLabel:le,children:ue}):ue;return s?_jsx(ListItemSkeleton,{...e}):J.enabled?_jsxs(_Fragment,{children:[he,J.renderSurface(_jsx(View,{style:U.preview,children:ce}))]}):he})),ListItemSkeleton=({subtitle:e,description:t,leading:i,icon:s,trailing:l,chevron:o,size:n="md",variant:r="list",style:a})=>{const c=useTheme(),d=resolveListItemSize(c,n),m=Math.round(1.15*d["title-text"]),u=Math.round(1.15*d["subtitle-text"]),h="menu"===r;return _jsxs(View,{style:[{flexDirection:"row",alignItems:"center",paddingHorizontal:c.space.md,paddingVertical:h?c.space.sm:d["padding-y"],minHeight:h?48:d["min-height"]},a],children:[void 0!==i||void 0!==s?_jsx(View,{style:{marginRight:c.space.sm},children:_jsx(Skeleton,{shape:"circle",width:40,height:40})}):null,_jsxs(View,{style:{flex:1},children:[_jsx(Skeleton,{shape:"text",width:"70%",height:m,style:{marginBottom:c.space.xs}}),void 0!==e?_jsx(Skeleton,{shape:"text",width:"50%",height:u,style:void 0!==t?{marginBottom:c.space.xs}:void 0}):null,void 0!==t?_jsx(Skeleton,{shape:"text",width:"85%",height:u}):null]}),void 0!==l||o?_jsx(View,{style:{marginLeft:c.space.sm},children:_jsx(Skeleton,{width:20,height:20,radius:"sm"})}):null]})};ListItemSkeleton.displayName="ListItemSkeleton";const ListItem=Object.assign(ListItemRoot,{Skeleton:ListItemSkeleton});ListItem.displayName="ListItem";const buildStyles=e=>StyleSheet.create({row:{flexDirection:"row",alignItems:"center",paddingHorizontal:e.space.md},divider:{borderBottomWidth:StyleSheet.hairlineWidth,borderBottomColor:e.colors.border},pressed:{backgroundColor:e.colors["surface-pressed"]},disabled:{opacity:.55},leftSlot:{marginRight:e.space.md,alignItems:"center",justifyContent:"center"},middle:{flex:1,flexDirection:"column",justifyContent:"center"},selectionLead:{flexDirection:"row",alignItems:"center"},selectionLeadContent:{marginLeft:e.space.sm},body:{marginTop:e.space.xs},rightBelow:{alignSelf:"flex-start",flexDirection:"row",alignItems:"center",marginTop:e.space.xs},rightSlot:{marginLeft:e.space.md,alignItems:"center",justifyContent:"center",flexDirection:"row"},actions:{flexDirection:"row",flexWrap:"wrap",gap:e.space.sm,paddingHorizontal:e.space.md,paddingBottom:e.space.md},chevronWithRight:{marginLeft:e.space.xs},preview:{flex:1,backgroundColor:e.colors.surface,borderRadius:e.radius.md,...smoothCorners,overflow:"hidden"},title:{letterSpacing:e["letter-spacing"].normal},subtitle:{marginTop:e.space.xxs,...fontFor(e,"normal")},menuSubtitle:{marginTop:0},description:{marginTop:e.space.xxs,...fontFor(e,"normal")}}),stylesFor=themeStyles(buildStyles);export{ListItem};export default ListItem;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{useEffect,useMemo,useRef,useState,useSyncExternalStore}from"react";import{AccessibilityInfo,Animated,BackHandler,Easing,StyleSheet}from"react-native";import{usePresenceMotion}from"../../hooks/usePresenceMotion.js";import{createAnimatedValue,useTheme}from"../../theme/index.js";import{nativeDriver}from"../../utils/nativeDriver.js";import{Spinner}from"../Spinner/index.js";import{jsx as _jsx}from"react/jsx-runtime";const DEFAULT_SHOW_DELAY_MS=150,DEFAULT_MIN_VISIBLE_MS=400;let state={refCount:0,message:void 0};const listeners=new Set,notify=()=>{for(const e of listeners)e()},subscribe=e=>(listeners.add(e),()=>{listeners.delete(e)}),getState=()=>state,show=e=>{state={refCount:state.refCount+1,message:e??state.message},notify()},hide=()=>{if(state.refCount<=0)return;const e=state.refCount-1;state={refCount:e,message:0===e?void 0:state.message},notify()},reset=()=>{0===state.refCount&&void 0===state.message||(state={refCount:0,message:void 0},notify())},isVisible=()=>state.refCount>0,wrap=async(e,t)=>{show(t);try{return await("function"==typeof e?e():e)}finally{hide()}};export const loader={show:show,hide:hide,wrap:wrap,isVisible:isVisible,reset:reset};export const useLoader=()=>loader;export const
|
|
1
|
+
"use strict";import{useEffect,useMemo,useRef,useState,useSyncExternalStore}from"react";import{AccessibilityInfo,Animated,BackHandler,Easing,StyleSheet}from"react-native";import{usePresenceMotion}from"../../hooks/usePresenceMotion.js";import{useMobileUiText}from"../../text/index.js";import{LOADER_OVERLAY_TEXT}from"../../text/phone/loaderOverlay.g.js";import{createAnimatedValue,useTheme}from"../../theme/index.js";import{nativeDriver}from"../../utils/nativeDriver.js";import{Spinner}from"../Spinner/index.js";import{jsx as _jsx}from"react/jsx-runtime";const DEFAULT_SHOW_DELAY_MS=150,DEFAULT_MIN_VISIBLE_MS=400;let state={refCount:0,message:void 0};const listeners=new Set,notify=()=>{for(const e of listeners)e()},subscribe=e=>(listeners.add(e),()=>{listeners.delete(e)}),getState=()=>state,show=e=>{state={refCount:state.refCount+1,message:e??state.message},notify()},hide=()=>{if(state.refCount<=0)return;const e=state.refCount-1;state={refCount:e,message:0===e?void 0:state.message},notify()},reset=()=>{0===state.refCount&&void 0===state.message||(state={refCount:0,message:void 0},notify())},isVisible=()=>state.refCount>0,wrap=async(e,t)=>{show(t);try{return await("function"==typeof e?e():e)}finally{hide()}};export const loader={show:show,hide:hide,wrap:wrap,isVisible:isVisible,reset:reset};export const useLoader=()=>loader;export const LoaderOverlay=({renderIndicator:e,backdropColor:t,showDelayMs:r=150,minVisibleMs:s=400,labels:n,testID:i})=>{const o=useTheme(),a=usePresenceMotion().duration("default"),u=useSyncExternalStore(subscribe,getState),[l,c]=useState(!1),f=useRef(null),m=useRef(null),d=useRef(null),y=useRef(createAnimatedValue(0)).current,b=u.refCount>0;useEffect(()=>{if(b)return null!==m.current&&(clearTimeout(m.current),m.current=null),void(l||null!==f.current||(f.current=setTimeout(()=>{f.current=null,0!==getState().refCount&&(d.current=Date.now(),c(!0))},r)));if(null!==f.current&&(clearTimeout(f.current),f.current=null),l&&null===m.current){const e=null!==d.current?Date.now()-d.current:s,t=Math.max(0,s-e);m.current=setTimeout(()=>{m.current=null,d.current=null,c(!1)},t)}},[b,l,r,s]),useEffect(()=>()=>{null!==f.current&&clearTimeout(f.current),null!==m.current&&clearTimeout(m.current)},[]),useEffect(()=>{l?Animated.timing(y,{toValue:1,duration:a,easing:Easing.bezier(...o.motion.ease["in-out"]),useNativeDriver:nativeDriver}).start():y.setValue(0)},[l,a,y,o]),useEffect(()=>{if(!l)return;const e=BackHandler.addEventListener("hardwareBackPress",()=>!0);return()=>{e.remove()}},[l]);const S=u.message;useEffect(()=>{l&&S&&AccessibilityInfo.announceForAccessibility(S)},[l,S]);const p=useMemo(()=>buildStyles(),[]),g=useMobileUiText("loaderOverlay",LOADER_OVERLAY_TEXT),v=useMemo(()=>({...g,...n}),[g,n]);return l?_jsx(Animated.View,{pointerEvents:"auto",testID:i,accessible:!0,accessibilityViewIsModal:!0,accessibilityLiveRegion:"polite",accessibilityLabel:S??v.loading,accessibilityRole:"progressbar",accessibilityState:{busy:!0},"aria-busy":!0,style:[p.overlay,{backgroundColor:t??o.colors.scrim,opacity:y}],children:e?e(S):_jsx(Spinner,{size:"lg",message:S})}):null};const buildStyles=()=>StyleSheet.create({overlay:{...StyleSheet.absoluteFill,alignItems:"center",justifyContent:"center",zIndex:1e3}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";export{
|
|
1
|
+
"use strict";export{LoaderOverlay,loader,useLoader}from"./LoaderOverlay.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import React,{useCallback,useEffect,useMemo,useRef,useState}from"react";import{View}from"react-native";import{useControllableState}from"../../hooks/useControllableState.js";import{
|
|
1
|
+
"use strict";import React,{useCallback,useEffect,useMemo,useRef,useState}from"react";import{View}from"react-native";import{useControllableState}from"../../hooks/useControllableState.js";import{useMobileUiText}from"../../text/index.js";import{MENU_TEXT}from"../../text/phone/menu.g.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{mergeRefs}from"../../utils/mergeRefs.js";import{MenuSurface}from"./MenuSurface.js";import{jsx as _jsx,Fragment as _Fragment,jsxs as _jsxs}from"react/jsx-runtime";const Menu=e=>{const{items:t,trigger:a,title:s,topActions:l,placement:o="bottom",presentation:n="auto",unavailable:r="disable",open:u,onOpenChange:i,haptic:m,accessibilityLabel:c,labels:p,testID:f}=e;assertValidValue("Menu","placement",e.placement,["top","bottom","auto"]),assertValidValue("Menu","presentation",e.presentation,["auto","popover","sheet"]),assertValidValue("Menu","unavailable",e.unavailable,["disable","hide"]);const b=useMobileUiText("menu",MENU_TEXT),d=useMemo(()=>({...b,...p}),[b,p]),[x,M]=useControllableState({value:u,defaultValue:!1,onChange:i}),[h,j]=useState(null),[V,g]=useState(x),C=useRef(null),S=useRef(null);useEffect(()=>{x?(g(!0),C.current?.measureInWindow((e,t,a,s)=>{j({x:e,y:t,width:a,height:s})})):j(null)},[x]);const _=useCallback(()=>M(!1),[M]),R=useCallback(()=>S.current??C.current,[]),v=a.props,E=v.ref,T={ref:useMemo(()=>mergeRefs(E,S),[E]),"aria-expanded":x,onPress:e=>{v.onPress?.(e),M(!0)}};return _jsxs(_Fragment,{children:[_jsx(View,{ref:C,collapsable:!1,testID:f,children:React.cloneElement(a,T)}),V?_jsx(MenuSurface,{open:x,anchor:h,items:t,title:s,topActions:l,placement:o,presentation:n,unavailable:r,onClose:_,restoreFocusTo:R,haptic:m,accessibilityLabel:c,labels:d,testID:f}):null]})};export{Menu};export default Menu;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";export{default,Menu}from"./Menu.js";
|
|
1
|
+
"use strict";export{default,Menu}from"./Menu.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{Logger}from"@webority/mobile-core";export const
|
|
1
|
+
"use strict";import{Logger}from"@webority/mobile-core";export const MAX_GROUPS=3;export const MAX_TOP_ACTIONS=3;export const SHEET_ITEM_THRESHOLD=7;export const ACTION_PREFIX="menu:";const isGrouped=e=>e.length>0&&Array.isArray(e[0]),isShown=(e,o)=>!(e.hidden||"hide"===o&&e.disabled),visibleItem=(e,o)=>{if(!isShown(e,o))return null;if(!e.submenu)return e;const t=e.submenu.filter(e=>isShown(e,o));return t.length>0?{...e,submenu:t}:null};export const visibleGroups=(e,o)=>{const t=isGrouped(e)?e:[e];__DEV__&&t.length>3&&Logger.warn(`[@webority/mobile-ui] Menu ${t.length} groups given; a menu keeps to 3.`);const n=[];for(const e of t){const t=[];for(const n of e){const e=visibleItem(n,o);e&&t.push(e)}t.length>0&&n.push(t)}return n};export const visibleTopActions=(e,o)=>{if(!e)return[];__DEV__&&e.length>3&&Logger.warn("[@webority/mobile-ui] Menu topActions takes at most 3; the rest are not shown.");return e.slice(0,3).filter(e=>isShown(e,o)&&!e.submenu)};export const wantsSheet=(e,o)=>{let t=o.length;for(const o of e)for(const e of o)if(t+=1,e.description)return!0;return t>7};export const menuActions=(e,o)=>{const t=[],add=(e,o)=>{if(e.disabled)return;if(e.submenu){for(const o of e.submenu)add(o,e);return}const n=e.accessibilityLabel??e.label;t.push({name:`menu:${o?`${o.key}/`:""}${e.key}`,label:o?`${o.label}, ${n}`:n,item:e})};for(const e of o)add(e);for(const o of e)for(const e of o)add(e);return t};
|