@webority/mobile-ui 0.164.0 → 0.167.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.txt +1 -1
- package/dist/canvas-kit/kit.js +10 -10
- package/dist/canvas-kit/manifest.json +27 -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/IconBadge/IconBadge.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/TagInput/TagInput.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/useDragToDismiss.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/merge.js +1 -1
- 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/IconBadge/IconBadge.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/TagInput/TagInput.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/useDragToDismiss.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/merge.js +1 -1
- 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 +4 -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 +4 -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 +4 -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 +4 -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 +6 -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 +5 -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 +4 -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 +6 -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 +4 -3
- 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 +4 -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 +4 -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 +3 -14
- 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 +3 -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 +3 -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/Screen/Screen.d.ts +1 -0
- package/lib/typescript/commonjs/components/SearchBar/SearchBar.d.ts +3 -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 +6 -3
- package/lib/typescript/commonjs/components/SliderField/SliderField.d.ts +3 -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/TagInput/TagInput.d.ts +1 -0
- 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/hooks/useDragToDismiss.d.ts +2 -0
- 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 +10 -4
- 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 +4 -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 +4 -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 +4 -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 +4 -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 +6 -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 +5 -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 +4 -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 +6 -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 +4 -3
- 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 +4 -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 +4 -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 +3 -14
- 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 +3 -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 +3 -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/Screen/Screen.d.ts +1 -0
- package/lib/typescript/module/components/SearchBar/SearchBar.d.ts +3 -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 +6 -3
- package/lib/typescript/module/components/SliderField/SliderField.d.ts +3 -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/TagInput/TagInput.d.ts +1 -0
- 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/hooks/useDragToDismiss.d.ts +2 -0
- 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 +10 -4
- package/package.json +12 -13
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";export{AmountSlider,
|
|
1
|
+
"use strict";export{AmountSlider,default}from"./AmountSlider.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{Fragment,forwardRef,useCallback,useMemo,useState}from"react";import{Animated,Pressable,StyleSheet,View}from"react-native";import{useSafeAreaInsets}from"react-native-safe-area-context";import{usePressAnimation}from"../../hooks/usePressAnimation.js";import{useTheme}from"../../theme/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{smoothCorners}from"../../utils/corners.js";import{resolveHaptic,triggerHaptic}from"../../utils/hapticUtils.js";import{AppIcon}from"../AppIcon/AppIcon.js";import{Menu}from"../Menu/index.js";import{Text as ThemedText}from"../Text/Text.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const ACTION_BUTTON_SIZE=44,DOT_OFFSET=10,DOT_SIZE=8,BADGE_OFFSET=4
|
|
1
|
+
"use strict";import{Fragment,forwardRef,useCallback,useMemo,useState}from"react";import{Animated,Pressable,StyleSheet,View}from"react-native";import{useSafeAreaInsets}from"react-native-safe-area-context";import{usePressAnimation}from"../../hooks/usePressAnimation.js";import{useMobileUiText}from"../../text/index.js";import{BAR_TEXT}from"../../text/phone/bar.g.js";import{useTheme}from"../../theme/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{smoothCorners}from"../../utils/corners.js";import{resolveHaptic,triggerHaptic}from"../../utils/hapticUtils.js";import{AppIcon}from"../AppIcon/AppIcon.js";import{Menu}from"../Menu/index.js";import{Text as ThemedText}from"../Text/Text.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const ACTION_BUTTON_SIZE=44,DOT_OFFSET=10,DOT_SIZE=8,BADGE_OFFSET=4,variantSize=(e,t)=>{switch(t){case"compact":return{height:44,titleSize:e.text.lg.size,titleWeight:"semibold",subtitleLines:1};case"large":return{height:56,titleSize:e.text["2xl"].size,titleWeight:"bold",subtitleLines:2};default:return{height:56,titleSize:e.text.lg.size,titleWeight:"semibold",subtitleLines:1}}},ActionButton=forwardRef(({action:e,side:t,badgeStyle:i,haptic:n,flush:o,onPress:l},s)=>{const r=useTheme(),{style:a,pressIn:d,pressOut:c}=usePressAnimation({enabled:!0}),u=useMemo(()=>buildActionStyles(r),[r]),p=e.badge,h=void 0!==p&&0!==p,g=void 0!==e.label;return _jsx(Animated.View,{style:a,children:_jsxs(Pressable,{ref:s,onPress:t=>{const i=resolveHaptic(n,"selection");i&&triggerHaptic(i),"onPress"in e&&e.onPress(),l?.(t)},onPressIn:d,onPressOut:c,accessibilityRole:"button",accessibilityLabel:e.accessibilityLabel??e.label,testID:e.testID,android_ripple:{color:r.colors["surface-pressed"],borderless:!g},style:({pressed:e})=>[g?u.textButton:u.actionButton,o?null:"left"===t?u.actionLeft:u.actionRight,e&&!g?u.actionPressed:null,e&&g?u.textPressed:null],children:[g?_jsx(ThemedText,{variant:"body",weight:"semibold",color:"link",numberOfLines:1,children:e.label}):_jsx(View,{style:u.iconWrap,children:e.icon}),h?_jsx(View,{style:[u.badge,i],pointerEvents:"none",children:_jsx(ThemedText,{variant:"caption",weight:"semibold",numberOfLines:1,style:u.badgeText,children:String(p)})}):null,e.dot?_jsx(View,{testID:e.testID?`${e.testID}-dot`:"appbar-action-dot",style:u.dot,pointerEvents:"none"}):null]})})}),COLLAPSE_RANGE=60,AppBar=forwardRef((e,t)=>{const{title:i,subtitle:n,titleAlignment:o="left",leftAction:l,rightActions:s,leading:r,trailing:a,onBack:d,gutter:c,titleVariant:u,titleOffset:p,height:h,divider:g,elevated:m=!1,variant:x="default",transparent:f=!1,scrollY:b,style:y,titleStyle:S,subtitleStyle:A,badgeStyle:j,haptic:w,labels:T,testID:_}=e;assertValidValue("AppBar","variant",e.variant,["default","large","compact"]),assertValidValue("AppBar","titleAlignment",e.titleAlignment,["left","center"]);const v=useMobileUiText("bar",BAR_TEXT),I=useMemo(()=>({...v,...T}),[v,T]),R=useTheme(),B=useSafeAreaInsets(),V=useMemo(()=>variantSize(R,x),[R,x]),C=useMemo(()=>buildStyles(R),[R]),z="large"===x,L=z&&void 0!==b,[O,P]=useState(40),W=useCallback(e=>P(e.nativeEvent.layout.height),[]),D=l??(d?{icon:_jsx(AppIcon,{name:"arrow-left",size:24,color:R.colors["text-body"]}),onPress:d,accessibilityLabel:I.back}:void 0),E=a?void 0:s?.[s.length-1],opticalInset=e=>void 0===e?0:void 0!==e.label?R.space.sm:Math.max((44-(e.glyphSize??24))/2,0),M=void 0===c?null:{paddingLeft:Math.max(c-opticalInset(D),0),paddingRight:Math.max(c-opticalInset(E),0)},k=void 0!==p,H=Boolean(D)||Boolean(r),F=!k&&"left"===o&&Boolean(D),N=k||F||!H&&"left"===o,$="default"!==x||H?V.titleSize:R.text.xl.size,U=g??!1,G=StyleSheet.hairlineWidth,X=useMemo(()=>{if(!b)return null;const e=b;return{rootHeight:e.interpolate({inputRange:[0,60],outputRange:[B.top+V.height+O,B.top+V.height],extrapolate:"clamp"}),titleRowOpacity:e.interpolate({inputRange:[0,30],outputRange:[1,0],extrapolate:"clamp"}),compactTitleOpacity:e.interpolate({inputRange:[30,60],outputRange:[0,1],extrapolate:"clamp"}),borderOpacity:e.interpolate({inputRange:[0,60],outputRange:[0,1],extrapolate:"clamp"})}},[b,B.top,V.height,O]),Z=i?u?_jsx(ThemedText,{variant:u,align:"center"===o?"center":"left",accessibilityRole:"header",numberOfLines:1,style:[C.titleVariant,S],children:i}):_jsx(Animated.Text,{accessibilityRole:"header",style:[C.title,{fontSize:$,fontWeight:R.weight[V.titleWeight],textAlign:"center"===o?"center":"left"},n?C.stackedText:null,S],numberOfLines:1,children:i}):null,Y=L&&X&&i?_jsx(Animated.Text,{accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants",style:[C.title,{fontSize:R.text.lg.size,fontWeight:R.weight.semibold,textAlign:"center"===o?"center":"left",opacity:X.compactTitleOpacity}],numberOfLines:1,children:i}):null,q=n?_jsx(Animated.Text,{style:[C.subtitle,{textAlign:"center"===o?"center":"left"},A],numberOfLines:V.subtitleLines,children:n}):null,J=_jsxs(View,{style:[C.titleColumn,"center"===o?C.titleColumnCenter:null],children:[Z,q]}),K=L?Animated.View:View,Q=L&&X?{height:X.rootHeight,overflow:"hidden"}:z&&void 0===h?null:{height:(h??V.height)+B.top},ee=useMemo(()=>(s??[]).map((e,t)=>({key:`appbar-right-${t}`,action:e})),[s]);return _jsxs(K,{ref:t,testID:_,style:[C.root,{paddingTop:B.top,backgroundColor:f?"transparent":R.colors.surface},Q,!L&&U?{borderBottomWidth:G,borderBottomColor:R.colors.border}:null,m&&!f?R.shadow.card:null,y],children:[L&&X&&U?_jsx(Animated.View,{pointerEvents:"none",style:[C.animatedBorder,{backgroundColor:R.colors.border,opacity:X.borderOpacity}]}):null,_jsxs(View,{testID:z&&_?`${_}-bar-row`:void 0,style:[C.row,z?{height:V.height}:{flex:1},M],children:[_jsxs(View,{testID:_?`${_}-leading-slot`:void 0,style:[C.sideSlot,N?C.sideSlotCompact:null],children:[D?_jsx(ActionButton,{action:D,side:"left",haptic:w,flush:k||F}):null,null!=r&&!1!==r?_jsx(View,{style:C.slotNode,children:r}):null]}),_jsx(View,{pointerEvents:"none",style:[C.center,"center"===o?C.centerAligned:C.centerLeft,k?{paddingLeft:H?p:R.space.none,paddingRight:R.space.none}:N?{paddingLeft:R.space.none}:null],children:z?Y:J}),_jsxs(View,{style:[C.sideSlot,C.sideSlotRight,k?C.sideSlotCompact:null],children:[ee.map(({key:e,action:t})=>_jsx(Fragment,{children:"menu"in t?_jsx(Menu,{items:t.menu,title:t.menuTitle,haptic:w,trigger:_jsx(ActionButton,{action:t,side:"right",badgeStyle:j,haptic:w,flush:k})}):_jsx(ActionButton,{action:t,side:"right",badgeStyle:j,haptic:w,flush:k})},e)),null!=a&&!1!==a?_jsx(View,{style:C.slotNode,children:a}):null]})]}),z?_jsx(Animated.View,{testID:_?`${_}-title-row`:void 0,onLayout:L?W:void 0,pointerEvents:"none",style:[{paddingHorizontal:c??R.space.md,paddingBottom:R.space.sm},L&&X?{opacity:X.titleRowOpacity}:null],children:J}):null]})});AppBar.displayName="AppBar";const buildStyles=e=>StyleSheet.create({root:{width:"100%"},row:{flexDirection:"row",alignItems:"center",paddingHorizontal:e.space.xs},sideSlot:{flexDirection:"row",alignItems:"center",minWidth:48},sideSlotRight:{justifyContent:"flex-end"},sideSlotCompact:{minWidth:0},slotNode:{flexDirection:"row",alignItems:"center"},center:{flex:1,minWidth:0,paddingHorizontal:e.space.xs},centerAligned:{alignItems:"center"},centerLeft:{alignItems:"flex-start"},titleColumn:{flexDirection:"column",maxWidth:"100%"},titleColumnCenter:{alignItems:"center"},title:{color:e.colors["text-body"]},titleVariant:{includeFontPadding:!1,textAlignVertical:"center"},stackedText:{includeFontPadding:!1},subtitle:{includeFontPadding:!1,color:e.colors["text-subtle"],fontSize:e.text.sm.size,fontWeight:e.weight.normal},animatedBorder:{position:"absolute",left:0,right:0,bottom:0,height:StyleSheet.hairlineWidth}}),buildActionStyles=e=>StyleSheet.create({actionButton:{width:44,height:44,borderRadius:e.radius.pill,...smoothCorners,alignItems:"center",justifyContent:"center"},actionLeft:{marginRight:e.space.xs},actionRight:{marginLeft:e.space.xs},actionPressed:{backgroundColor:e.colors["surface-pressed"]},textButton:{minWidth:44,minHeight:44,paddingHorizontal:e.space.sm,alignItems:"center",justifyContent:"center"},textPressed:{opacity:.6},dot:{position:"absolute",top:10,right:10,width:8,height:8,borderRadius:e.radius.pill,backgroundColor:e.colors.danger},iconWrap:{alignItems:"center",justifyContent:"center"},badge:{position:"absolute",top:4,right:4,minWidth:16,height:16,paddingHorizontal:e.space.xs,borderRadius:e.radius.pill,...smoothCorners,backgroundColor:e.colors.danger,alignItems:"center",justifyContent:"center"},badgeText:{color:e.colors["on-danger"],fontSize:e.text.xs.size,fontWeight:e.weight.semibold,lineHeight:Math.round(e.text.xs.size*e.leading.heading)}});export{AppBar};export default AppBar;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";export{AppBar,
|
|
1
|
+
"use strict";export{AppBar,default}from"./AppBar.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{useEffect,useMemo,useRef}from"react";import{View}from"react-native";import{useSafeAreaInsets}from"react-native-safe-area-context";import{makeStyles,useTheme}from"../../theme/index.js";import{smoothCorners}from"../../utils/corners.js";import{AppIcon}from"../AppIcon/index.js";import{Button}from"../Button/index.js";import{Modal}from"../Modal/index.js";import{Text}from"../Text/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";
|
|
1
|
+
"use strict";import{useEffect,useMemo,useRef}from"react";import{View}from"react-native";import{useSafeAreaInsets}from"react-native-safe-area-context";import{useMobileUiText}from"../../text/index.js";import{LOCK_OVERLAY_TEXT}from"../../text/phone/lockOverlay.g.js";import{makeStyles,useTheme}from"../../theme/index.js";import{smoothCorners}from"../../utils/corners.js";import{AppIcon}from"../AppIcon/index.js";import{Button}from"../Button/index.js";import{Modal}from"../Modal/index.js";import{Text}from"../Text/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const noop=()=>{},useStyles=makeStyles(e=>({body:{alignItems:"center",flex:1,gap:e.space.sm,justifyContent:"center",paddingHorizontal:e.space["2xl"]},footer:{paddingHorizontal:e.space.xl},iconCircle:{alignItems:"center",backgroundColor:e.colors["primary-wash"],borderRadius:e.radius.pill,...smoothCorners,height:e.space["4xl"],justifyContent:"center",marginBottom:e.space.md,width:e.space["4xl"]}})),failureMessage=(e,t)=>{switch(e){case"lockout":return t.lockout;case"not-enrolled":return t.notEnrolled;case"failed":case"not-available":return t.failed;default:return null}};export function AppLockOverlay({open:e,onUnlock:t,failure:o,secondaryAction:s,brandMark:r,labels:n,testID:i}){const l=useTheme(),a=useStyles(),c=useSafeAreaInsets(),m=useMobileUiText("lockOverlay",LOCK_OVERLAY_TEXT),u=useMemo(()=>({...m,...n}),[m,n]),d=useRef(t);d.current=t,useEffect(()=>{e&&d.current()},[e]);const p=failureMessage(o,u);return _jsxs(Modal,{open:e,onClose:noop,presentation:"fullScreen",hardwareBackPress:!1,haptic:!1,accessibilityLabel:u.title,testID:i,children:[_jsxs(View,{style:a.body,children:[r??_jsx(View,{style:a.iconCircle,children:_jsx(AppIcon,{name:"lock",size:"xl",color:l.colors["primary-text"]})}),_jsx(Text,{variant:"h3",weight:"semibold",align:"center",children:u.title}),_jsx(Text,{variant:"bodySmall",weight:"medium",align:"center",children:u.message}),p?_jsx(Text,{variant:"caption",weight:"semibold",align:"center",color:"danger",children:p}):null]}),_jsxs(View,{style:[a.footer,{paddingBottom:l.space.xl+c.bottom}],children:[_jsx(Button,{fullWidth:!0,size:"lg",label:u.unlock,onPress:t,testID:i?`${i}-unlock`:void 0}),s?_jsx(Button,{variant:"link",label:s.label,onPress:s.onPress,testID:i?`${i}-secondary`:void 0}):null]})]})}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";export{AppLockOverlay
|
|
1
|
+
"use strict";export{AppLockOverlay}from"./AppLockOverlay.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{OFFLINE_CODE}from"@webority/mobile-core";import{useMemo}from"react";import{View}from"react-native";import{useTheme}from"../../theme/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{AppIcon}from"../AppIcon/index.js";import{EmptyState}from"../EmptyState/index.js";import{Spinner}from"../Spinner/index.js";import{jsx as _jsx,Fragment as _Fragment}from"react/jsx-runtime";export
|
|
1
|
+
"use strict";import{OFFLINE_CODE}from"@webority/mobile-core";import{useMemo}from"react";import{View}from"react-native";import{useMobileUiText}from"../../text/index.js";import{ASYNC_BLOCK_TEXT}from"../../text/phone/asyncBlock.g.js";import{useTheme}from"../../theme/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{AppIcon}from"../AppIcon/index.js";import{EmptyState}from"../EmptyState/index.js";import{Spinner}from"../Spinner/index.js";import{jsx as _jsx,Fragment as _Fragment}from"react/jsx-runtime";export function AsyncBlock({state:e,children:t,empty:r,errorVariant:s,icon:i,skeleton:o,errorTitle:l,offlineTitle:n,labels:a,style:c,testID:m}){const p=useTheme(),d=useMobileUiText("asyncBlock",ASYNC_BLOCK_TEXT),u=useMemo(()=>({...d,...a}),[d,a]);switch(assertValidValue("AsyncBlock","errorVariant",s,["default","offline"]),assertValidValue("AsyncBlock","status",e.status,["idle","loading","error","empty","data"]),e.status){case"idle":return null;case"loading":return _jsx(View,{style:c,testID:m,children:o??_jsx(View,{style:{paddingVertical:p.space["2xl"],alignItems:"center"},children:_jsx(Spinner,{})})});case"error":{const t="offline"===(s??(e.error.code===OFFLINE_CODE?"offline":"default"));return _jsx(View,{style:c,testID:m,children:_jsx(EmptyState,{icon:i??(t?_jsx(AppIcon,{name:"cloud-cross",size:"xl",color:p.colors["text-subtle"],testID:"async-block-offline-icon"}):void 0),title:t?n??u.offlineTitle:l??u.errorTitle,description:e.error.message,action:{label:u.retry,onPress:e.retry}})})}case"empty":return _jsx(View,{style:c,testID:m,children:_jsx(EmptyState,{...r??{title:u.emptyTitle}})});case"data":return _jsx(_Fragment,{children:t(e.data)})}}export default AsyncBlock;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";export{AsyncBlock,
|
|
1
|
+
"use strict";export{AsyncBlock,default}from"./AsyncBlock.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{Image}from"expo-image";import{useEffect,useMemo,useRef,useState}from"react";import{StyleSheet,View}from"react-native";import{useTheme}from"../../theme/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{smoothCorners}from"../../utils/corners.js";import{Spinner}from"../Spinner/index.js";import{Text}from"../Text/index.js";import{acquireFetch,DEFAULT_TTL_MS,deriveCacheKey,isFresh,isPermanentRefusal,readEntry,releaseFetch,removeEntry,touchEntry}from"./authedImageCache.js";import{jsx as _jsx}from"react/jsx-runtime";
|
|
1
|
+
"use strict";import{Image}from"expo-image";import{useEffect,useMemo,useRef,useState}from"react";import{StyleSheet,View}from"react-native";import{fillText,useMobileUiText}from"../../text/index.js";import{AUTHED_IMAGE_TEXT}from"../../text/phone/authedImage.g.js";import{useTheme}from"../../theme/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{smoothCorners}from"../../utils/corners.js";import{Spinner}from"../Spinner/index.js";import{Text}from"../Text/index.js";import{acquireFetch,DEFAULT_TTL_MS,deriveCacheKey,isFresh,isPermanentRefusal,readEntry,releaseFetch,removeEntry,touchEntry}from"./authedImageCache.js";import{jsx as _jsx}from"react/jsx-runtime";const CONTENT_FIT={cover:"cover",contain:"contain",stretch:"fill",center:"scale-down",repeat:"cover"},toError=e=>e instanceof Error?e:new Error(String(e)),AuthedImage=e=>{const{uri:t,headers:r,client:i,authenticated:s=!0,ttlMs:o=DEFAULT_TTL_MS,placeholder:a,fallback:n,onLoadStart:l,onLoadEnd:c,onError:d,cacheKey:u,testID:m,accessibilityLabel:h,style:f,resizeMode:y,fadeDuration:b,contentFit:E,transition:g,labels:p,cachePolicy:T="memory",...I}=e;assertValidValue("AuthedImage","resizeMode",y,Object.keys(CONTENT_FIT));const x=useMobileUiText("authedImage",AUTHED_IMAGE_TEXT),v=useMemo(()=>({...x,...p}),[x,p]),j=useTheme(),S=useMemo(()=>buildStyles(j),[j]),[L,_]=useState({status:"loading"}),F=useRef({onLoadStart:l,onLoadEnd:c,onError:d});F.current={onLoadStart:l,onLoadEnd:c,onError:d};const w=JSON.stringify(r??{});if(useEffect(()=>{let e=!1,r=null;const finish=t=>{e||(_(t),F.current.onLoadEnd?.())};return(async()=>{if(!t){const t=new Error("[@webority/mobile-ui] AuthedImage was given an empty `uri`. Pass the image URL, or render nothing while the URL is still unknown.");return void(e||(_({status:"error"}),F.current.onError?.(t)))}_({status:"loading"}),F.current.onLoadStart?.();const a=deriveCacheKey(t,u),n=await readEntry(a);if(e)return;if(n&&isFresh(n.meta,o))return touchEntry(a),void finish({status:"ready",fileUri:n.fileUri});const l=JSON.parse(w),c=acquireFetch(a,{uri:t,headers:l,authenticated:s,client:i});r={key:a,entry:c};try{const e=await c.promise;finish({status:"ready",fileUri:e.fileUri})}catch(t){if(e)return;if(n&&!isPermanentRefusal(t))return void finish({status:"ready",fileUri:n.fileUri});if(n&&(await removeEntry(a),e))return;_({status:"error"}),F.current.onError?.(toError(t)),F.current.onLoadEnd?.()}})(),()=>{e=!0,r&&releaseFetch(r.key,r.entry)}},[t,u,o,s,i,w]),"loading"===L.status)return _jsx(View,void 0!==a?{style:f,testID:m,children:a}:{style:[S.placeholder,f],testID:m,children:_jsx(View,{style:S.stateFill,testID:m?`${m}-placeholder`:void 0,pointerEvents:"none",children:_jsx(Spinner,{size:"sm",accessibilityLabel:v.loading})})});if("error"===L.status)return _jsx(View,void 0!==n?{style:f,testID:m,children:n}:{style:[S.fallback,f],testID:m,children:_jsx(View,{accessible:!0,accessibilityRole:"image",accessibilityLabel:h?fillText(v.unavailableNamed,{name:h}):v.unavailable,testID:m?`${m}-fallback`:void 0,style:S.stateFill,children:_jsx(Text,{variant:"title",color:"tertiary",accessible:!1,children:"!"})})});const C=E??(y?CONTENT_FIT[y]:void 0),U=g??b,A={...void 0!==h?{accessibilityLabel:h}:{},...void 0!==m?{testID:m}:{},...void 0!==f?{style:f}:{},...void 0!==C?{contentFit:C}:{},...void 0!==U?{transition:U}:{}};return _jsx(Image,{...I,...A,accessible:!0,accessibilityRole:"image",cachePolicy:T,source:{uri:L.fileUri}})};AuthedImage.displayName="AuthedImage";const buildStyles=e=>StyleSheet.create({placeholder:{alignItems:"center",justifyContent:"center",backgroundColor:e.colors["bg-subtle"],borderRadius:e.radius.md,...smoothCorners},fallback:{alignItems:"center",justifyContent:"center",backgroundColor:e.colors["bg-subtle"],borderRadius:e.radius.md,...smoothCorners,borderWidth:e.size.border,borderColor:e.colors["border-subtle"],padding:e.space.sm},stateFill:{alignItems:"center",flex:1,justifyContent:"center"}});export{AuthedImage};export default AuthedImage;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import React,{useCallback,useMemo,useRef,useState}from"react";import{Keyboard,Pressable,ScrollView,StyleSheet,View}from"react-native";import{useControllableState}from"../../hooks/index.js";import{useTheme}from"../../theme/index.js";import{resolveHaptic,triggerHaptic}from"../../utils/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{smoothCorners}from"../../utils/corners.js";import{Input}from"../Input/index.js";import{Spinner}from"../Spinner/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{Keyboard,Pressable,ScrollView,StyleSheet,View}from"react-native";import{useControllableState}from"../../hooks/index.js";import{useMobileUiText}from"../../text/index.js";import{AUTOCOMPLETE_TEXT}from"../../text/phone/autocomplete.g.js";import{useTheme}from"../../theme/index.js";import{resolveHaptic,triggerHaptic}from"../../utils/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{smoothCorners}from"../../utils/corners.js";import{Input}from"../Input/index.js";import{Spinner}from"../Spinner/index.js";import{Text}from"../Text/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const defaultGetLabel=e=>"string"==typeof e?e:String(e);function Autocomplete(e){const{options:t,value:o,defaultValue:r,onChangeText:i,onSelect:l,getOptionLabel:s,getOptionKey:a,filter:n,minChars:c=1,maxResults:d=8,loading:u=!1,filterMode:p="client",loadingText:m,labels:x,placeholder:h,label:b,error:f,helperText:g,disabled:y=!1,size:T="md",variant:S,haptic:j,style:C,listStyle:v,optionTextStyle:w,testID:V}=e;assertValidValue("Autocomplete","filterMode",e.filterMode,["client","none"]);const _=useMobileUiText("autocomplete",AUTOCOMPLETE_TEXT),M=useMemo(()=>({..._,...x}),[_,x]),L=useTheme(),P=useMemo(()=>buildStyles(L),[L]),[R,k]=useControllableState({value:o,defaultValue:r??"",onChange:i}),[A,E]=useState(!1),[I,z]=useState(0),H=useRef(null),O=useCallback(e=>s?s(e):defaultGetLabel(e),[s]),F=useMemo(()=>{if("none"===p)return t.slice(0,d);const e=R.trim();if(e.length<c)return[];const o=e.toLowerCase(),r=n?t=>n(t,e):e=>O(e).toLowerCase().includes(o);return t.filter(r).slice(0,d)},[t,R,c,d,n,O,p]),U=A&&(u||R.trim().length>=c),D=useCallback(e=>{const t=resolveHaptic(j,"selection");t&&triggerHaptic(t),H.current&&clearTimeout(H.current),k(O(e)),E(!1),Keyboard.dismiss(),l(e)},[j,k,O,l]);React.useEffect(()=>()=>{H.current&&clearTimeout(H.current)},[]);const K=useCallback(e=>{z(e.nativeEvent.layout.height)},[]);return _jsxs(View,{style:[P.container,C],testID:V,children:[_jsx(View,{onLayout:K,children:_jsx(Input,{value:R,onChangeText:k,onFocus:()=>{H.current&&clearTimeout(H.current),E(!0)},onBlur:()=>{H.current=setTimeout(()=>E(!1),120)},placeholder:h,label:b,error:f,helperText:g,editable:!y,accessibilityState:{disabled:y},"aria-disabled":y,size:T,variant:S,autoCorrect:!1,autoCapitalize:"none"})}),U?_jsx(View,{style:[P.list,{top:I,backgroundColor:L.colors.surface,borderColor:L.colors.border,borderRadius:L.radius.md,...smoothCorners,...L.shadow.popover},v],children:u?_jsxs(View,{style:P.loadingRow,children:[_jsx(Spinner,{size:"sm"}),_jsx(Text,{variant:"bodySmall",color:"secondary",style:P.loadingText,children:m??M.searching})]}):0===F.length?_jsx(Text,{variant:"bodySmall",color:"tertiary",align:"center",style:P.empty,children:M.empty}):_jsx(ScrollView,{keyboardShouldPersistTaps:"handled",style:P.scroll,children:F.map(e=>_jsx(Pressable,{onPress:()=>D(e),android_ripple:{color:L.colors["surface-pressed"]},style:({pressed:e})=>[P.option,{paddingHorizontal:L.space.md,paddingVertical:L.space.sm,backgroundColor:e?L.colors["surface-pressed"]:"transparent"}],accessibilityRole:"button",accessibilityLabel:O(e),accessibilityState:{selected:O(e)===R},"aria-selected":O(e)===R,children:_jsx(Text,{variant:"body",numberOfLines:1,style:[P.optionText,w],children:O(e)})},a?a(e):O(e)))})}):null]})}Autocomplete.displayName="Autocomplete";const buildStyles=e=>StyleSheet.create({container:{width:"100%",position:"relative",zIndex:10},list:{position:"absolute",left:0,right:0,borderWidth:StyleSheet.hairlineWidth,overflow:"hidden",zIndex:20,maxHeight:240},scroll:{maxHeight:240},option:{width:"100%"},optionText:{includeFontPadding:!1},empty:{padding:e.space.md,includeFontPadding:!1},loadingRow:{flexDirection:"row",alignItems:"center",gap:e.space.sm,padding:e.space.md},loadingText:{includeFontPadding:!1}});export{Autocomplete};export default Autocomplete;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";export{Autocomplete
|
|
1
|
+
"use strict";export{Autocomplete}from"./Autocomplete.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{Image}from"expo-image";import{Children,cloneElement,forwardRef,isValidElement,useEffect,useMemo,useRef,useState}from"react";import{Animated,Easing,Pressable,StyleSheet,View}from"react-native";import{createAnimatedValue,useTheme}from"../../theme/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{tintOf}from"../../utils/color.js";import{smoothCorners}from"../../utils/corners.js";import{resolveHaptic,triggerHaptic}from"../../utils/hapticUtils.js";import{hitSlopMarker}from"../../utils/hitSlop.js";import{nativeDriver}from"../../utils/nativeDriver.js";import{AppIcon}from"../AppIcon/index.js";import{renderSlotIcon}from"../AppIcon/slotIcon.js";import{AuthedImage}from"../AuthedImage/AuthedImage.js";import{Skeleton}from"../Skeleton/index.js";import{Text}from"../Text/index.js";import{jsx as _jsx,Fragment as _Fragment,jsxs as _jsxs}from"react/jsx-runtime";const SOFT_FILL_OPACITY=.14,MIN_TOUCH_TARGET=44,PRESSED_OPACITY=.7,INITIALS_MAX_FONT_SCALE=1.2;export const AVATAR_COLORS=["avatar-1","avatar-2","avatar-3","avatar-4","avatar-5","avatar-6","avatar-7","avatar-8"];export const avatarToneColors=(e,t)=>{const soft=(e,t)=>tintOf(e,.14,t);switch(t){case"primary":return{background:soft(e.colors.primary,e.colors["primary-soft"]),color:e.colors["primary-text"]};case"success":return{background:soft(e.colors.success,e.colors["bg-subtle"]),color:e.colors["success-text"]};case"warning":return{background:soft(e.colors.warning,e.colors["bg-subtle"]),color:e.colors["warning-text"]};case"danger":return{background:soft(e.colors.danger,e.colors["bg-subtle"]),color:e.colors["danger-text"]};case"info":return{background:soft(e.colors.info,e.colors["bg-subtle"]),color:e.colors["info-text"]};case"neutral":return{background:e.colors["bg-muted"],color:e.colors["text-body"]}}};export const DEFAULT_AVATAR_LABELS=Object.freeze({avatar:"Avatar",avatarOf:e=>`${e}'s avatar`,verified:"verified",pendingVerification:"pending verification",rejected:"rejected",groupOf:e=>`Group of ${e} ${1===e?"person":"people"}`,moreCount:e=>`${e} more`,moreAvatars:"More avatars"});const sizeMap={xs:24,sm:32,md:48,lg:64,xl:80},resolveSize=e=>sizeMap[e],resolveRadius=(e,t,r,o)=>{switch(t){case"circle":return r/2;case"rounded":return o?e.radius[o]:Math.max(e.radius.sm,Math.round(.22*r));case"square":return 0}},initialsFromName=e=>{if(!e)return"";const t=e.trim().split(/\s+/u).filter(Boolean),[r,o]=t;return void 0===r?"":void 0===o?r.charAt(0).toUpperCase():(r.charAt(0)+o.charAt(0)).toUpperCase()},hashColor=(e,t)=>{let r=0;for(let t=0;t<e.length;t+=1)r=(r<<5)-r+e.charCodeAt(t),r|=0;const o=t[Math.abs(r)%t.length];if(void 0===o)throw new Error("The avatar colour palette is empty.");return o},RING_WIDTH=1.5,keyOfSource=e=>"object"==typeof e&&null!==e&&"uri"in e&&"string"==typeof e.uri?e.uri:e,uriOfSource=e=>"object"==typeof e&&null!==e&&"uri"in e&&"string"==typeof e.uri?e.uri:void 0,isImageSourceList=e=>Array.isArray(e),toExpoSource=e=>({...void 0!==e.uri?{uri:e.uri}:{},...void 0!==e.headers?{headers:e.headers}:{},...void 0!==e.width?{width:e.width}:{},...void 0!==e.height?{height:e.height}:{}}),toExpoSources=e=>"number"==typeof e?e:isImageSourceList(e)?e.map(toExpoSource):toExpoSource(e),isRingStatus=e=>"verified"===e||"pending"===e||"rejected"===e,statusColor=(e,t)=>{switch(t){case"online":case"verified":return e.colors.success;case"busy":case"rejected":return e.colors.danger;case"away":case"pending":return e.colors.warning;case"offline":return e.colors["text-subtle"]}},AvatarRoot=forwardRef((e,t)=>{const{source:r,ImageComponent:o,imageClient:s,name:a,size:i="md",shape:n="circle",dimension:l,radius:c,border:u=!1,contentFit:d="cover",placeholderIcon:m,status:h=null,statusPosition:g="bottomRight",tone:p,backgroundColor:b,color:v,fontSize:f,loading:y=!1,accessibilityLabel:A,onPress:x,onLongPress:S,haptic:j,hitSlop:C,style:I,textStyle:R,testID:V,labels:_}=e;assertValidValue("Avatar","size",e.size,Object.keys(sizeMap)),assertValidValue("Avatar","shape",e.shape,["circle","square","rounded"]),assertValidValue("Avatar","radius",e.radius,["sm","md","lg"]),assertValidValue("Avatar","contentFit",e.contentFit,["cover","contain"]),assertValidValue("Avatar","status",e.status,["online","offline","busy","away","verified","pending","rejected"]),assertValidValue("Avatar","statusPosition",e.statusPosition,["topRight","bottomRight"]),assertValidValue("Avatar","tone",e.tone,["primary","success","warning","danger","info","neutral"]);const w=useMemo(()=>_?{...DEFAULT_AVATAR_LABELS,..._}:DEFAULT_AVATAR_LABELS,[_]),M=useTheme(),[T,E]=useState(null),L=useMemo(()=>l??resolveSize(i),[l,i]),k=useMemo(()=>resolveRadius(M,n,L,c),[M,n,L,c]),z=u?M.size.border:0,O=M.colors.border,F=M.colors.surface,D=useMemo(()=>initialsFromName(a),[a]),G=useMemo(()=>p?avatarToneColors(M,p):null,[M,p]),P=useMemo(()=>b||(G?.background??M.colors[hashColor(a??"",AVATAR_COLORS)]),[b,G,a,M]),$=v??G?.color??M.colors["on-primary"],N=r?keyOfSource(r):null,B=useMemo(()=>void 0!==r?toExpoSources(r):void 0,[r]),H=null!==N&&N!==T,U=!H&&""===D&&null!=m,W=v??G?.color??M.colors["text-subtle"],q=f??Math.max(M.text.xs.size,Math.round(.4*L)),Y=Math.max(8,Math.round(.25*L)),X=isRingStatus(h),J=L-2*(X?3:z),K=X?resolveRadius(M,n,J,c):Math.max(0,k-z),Q=U?renderSlotIcon(m,{color:W,size:Math.round(.45*J),disabled:!1}):null,Z=X?statusColor(M,h):"transparent",ee=Math.max(12,Math.round(.32*L)),te=Math.max(10,ee-4),re=b??G?.background??M.colors["bg-muted"],oe=H?"contain"===d?"transparent":M.colors["bg-muted"]:U?re:P,se=V??"avatar",ae=a?w.avatarOf(a):w.avatar,ie="verified"===h?`, ${w.verified}`:"pending"===h?`, ${w.pendingVerification}`:"rejected"===h?`, ${w.rejected}`:"",ne=A??`${ae}${ie}`,le="function"==typeof x||"function"==typeof S,ce=A??`${a||ae}${ie}`,ue=Math.max(0,Math.ceil((44-L)/2)),de=C??ue,me=[styles.root,{width:L,height:L,borderRadius:k,...smoothCorners,borderWidth:X?0:z,borderColor:O,backgroundColor:X?"transparent":oe},I],he=_jsxs(_Fragment,{children:[X?_jsx(View,{style:[styles.ring,{borderRadius:k,...smoothCorners,borderWidth:1.5,borderColor:Z}],accessible:!1,pointerEvents:"none",testID:`${se}-ring`}):null,_jsx(View,{style:[styles.picture,{width:J,height:J,borderRadius:K,...smoothCorners,borderWidth:X?z:0,borderColor:O,backgroundColor:X?oe:"transparent"}],children:H?(()=>{const e={width:J,height:J,borderRadius:K,...smoothCorners};if(!r)return null;const onError=()=>E(N),t=uriOfSource(r);return o?_jsx(o,{source:r,onError:onError,style:e,contentFit:d,resizeMode:d,accessibilityIgnoresInvertColors:!0}):s&&void 0!==t?_jsx(AuthedImage,{uri:t,client:s,onError:onError,style:e,contentFit:d,placeholder:null,fallback:null,accessibilityIgnoresInvertColors:!0}):_jsx(Image,{...void 0!==B?{source:B}:{},onError:onError,style:e,contentFit:d,accessibilityIgnoresInvertColors:!0})})():Q||_jsx(Text,{variant:"label",weight:"semibold",numberOfLines:1,maxFontSizeMultiplier:1.2,style:[styles.initials,{color:$,fontSize:q,lineHeight:Math.round(q*M.leading.body)},R],children:D??" "})}),"verified"===h||"rejected"===h?_jsx(View,{style:[styles.status,"topRight"===g?styles.badgeTopRight:styles.badgeBottomRight,{width:ee,height:ee,borderRadius:ee/2,...smoothCorners,backgroundColor:F}],accessible:!1,pointerEvents:"none",testID:`${se}-badge`,children:_jsx(AppIcon,{name:"verified"===h?"verify":"close-circle",variant:"bold",size:te,color:Z})}):null,h&&!X?_jsx(View,{style:[styles.status,"topRight"===g?styles.statusTopRight:styles.statusBottomRight,{width:Y,height:Y,borderRadius:Y/2,...smoothCorners,backgroundColor:statusColor(M,h),borderWidth:2,borderColor:F}],accessible:!1,pointerEvents:"none"}):null]}),ge=le?_jsx(Pressable,{ref:t,onPress:x?e=>{const t=resolveHaptic(j,"selection");t&&triggerHaptic(t),x?.(e)}:void 0,onLongPress:S?e=>{const t=resolveHaptic(j,"longPress");t&&triggerHaptic(t),S?.(e)}:void 0,hitSlop:de,...hitSlopMarker(de),accessibilityRole:"button",accessibilityLabel:ce,testID:V,style:({pressed:e})=>[me,e?styles.pressed:null],children:he}):_jsx(View,{ref:t,style:me,accessible:!0,accessibilityRole:"image",accessibilityLabel:ne,testID:V,children:he});return y?_jsx(AvatarSkeleton,{...e}):ge}),AvatarSkeleton=({size:e="md",shape:t="circle",dimension:r,style:o})=>{const s=r??resolveSize(e);return _jsx(Skeleton,{shape:"circle"===t?"circle":"rounded"===t?"rounded":"rect",width:s,height:s,style:o})};AvatarSkeleton.displayName="AvatarSkeleton";const Avatar=Object.assign(AvatarRoot,{Skeleton:AvatarSkeleton});Avatar.displayName="Avatar";const styles=StyleSheet.create({root:{alignItems:"center",justifyContent:"center",overflow:"visible",position:"relative"},pressed:{opacity:.7},initials:{textAlign:"center"},ring:{position:"absolute",top:0,right:0,bottom:0,left:0},picture:{alignItems:"center",justifyContent:"center",overflow:"hidden"},status:{position:"absolute"},badgeTopRight:{top:-2,right:-2,alignItems:"center",justifyContent:"center"},badgeBottomRight:{bottom:-2,right:-2,alignItems:"center",justifyContent:"center"},statusTopRight:{top:0,right:0},statusBottomRight:{bottom:0,right:0}}),SPACING_OFFSET={tight:"lg",normal:"md",loose:"sm"},STAGGER_MS=50,ENTRANCE_DURATION_MS=220,AvatarGroupItem=({delay:e,marginLeft:t,borderColor:r,borderWidth:o,children:s})=>{const a=useTheme(),i=useRef(createAnimatedValue(0)).current;return useEffect(()=>{const t=Animated.timing(i,{toValue:1,duration:220,delay:e,easing:Easing.out(Easing.cubic),useNativeDriver:nativeDriver});return t.start(),()=>t.stop()},[e,i]),_jsx(Animated.View,{style:[groupStyles.item,{marginLeft:t,borderRadius:a.radius.pill,borderColor:r,borderWidth:o,opacity:i}],children:s})},AvatarGroup=e=>{const{children:t,max:r=4,size:o="md",spacing:s="normal",overflowVariant:a="count",accessibilityLabel:i,style:n,testID:l,labels:c}=e;assertValidValue("AvatarGroup","spacing",e.spacing,["tight","normal","loose"]),assertValidValue("AvatarGroup","overflowVariant",e.overflowVariant,["count","plus"]),assertValidValue("AvatarGroup","size",e.size,Object.keys(sizeMap));const u=useMemo(()=>c?{...DEFAULT_AVATAR_LABELS,...c}:DEFAULT_AVATAR_LABELS,[c]),d=useTheme(),m=useMemo(()=>Children.toArray(t).filter(e=>isValidElement(e)),[t]),h=m.length,g=m.slice(0,r),p=Math.max(0,h-r),b=p>0,v=-d.space[SPACING_OFFSET[s]],f=d.colors.surface,y=i??u.groupOf(h),A=useMemo(()=>resolveSize(o),[o]),x=Math.max(d.text.xs.size,Math.round(.34*A));return _jsxs(View,{style:[groupStyles.row,n],accessible:!0,accessibilityLabel:y,accessibilityRole:"summary",testID:l,children:[g.map((e,t)=>{const r=e.key??`avatar-${t}`,s=cloneElement(e,{size:o,labels:e.props.labels??c});return _jsx(AvatarGroupItem,{delay:50*t,marginLeft:0===t?0:v,borderColor:f,borderWidth:1.5,children:s},r)}),b?_jsx(AvatarGroupItem,{delay:50*g.length,marginLeft:0===g.length?0:v,borderColor:f,borderWidth:1.5,children:_jsx(View,{style:[groupStyles.overflow,{width:A,height:A,borderRadius:A/2,...smoothCorners,backgroundColor:d.colors["surface-disabled"]}],accessible:!0,accessibilityRole:"text",accessibilityLabel:"count"===a?u.moreCount(p):u.moreAvatars,children:_jsx(Text,{variant:"label",weight:"semibold",color:"secondary",numberOfLines:1,maxFontSizeMultiplier:1.2,style:{fontSize:x,lineHeight:Math.round(x*d.leading.body)},children:"count"===a?`+${p}`:"+"})})},"avatar-overflow"):null]})},groupStyles=StyleSheet.create({row:{flexDirection:"row",alignItems:"center"},item:{...smoothCorners},overflow:{alignItems:"center",justifyContent:"center"}});export{Avatar,AvatarGroup};export default Avatar;
|
|
1
|
+
"use strict";import{Image}from"expo-image";import{Children,cloneElement,forwardRef,isValidElement,useEffect,useMemo,useRef,useState}from"react";import{Animated,Easing,Pressable,StyleSheet,View}from"react-native";import{fillText,pluralText,useMobileUiText}from"../../text/index.js";import{AVATAR_TEXT}from"../../text/phone/avatar.g.js";import{createAnimatedValue,useTheme}from"../../theme/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{tintOf}from"../../utils/color.js";import{smoothCorners}from"../../utils/corners.js";import{resolveHaptic,triggerHaptic}from"../../utils/hapticUtils.js";import{hitSlopMarker}from"../../utils/hitSlop.js";import{nativeDriver}from"../../utils/nativeDriver.js";import{AppIcon}from"../AppIcon/index.js";import{renderSlotIcon}from"../AppIcon/slotIcon.js";import{AuthedImage}from"../AuthedImage/AuthedImage.js";import{Skeleton}from"../Skeleton/index.js";import{Text}from"../Text/index.js";import{jsx as _jsx,Fragment as _Fragment,jsxs as _jsxs}from"react/jsx-runtime";const SOFT_FILL_OPACITY=.14,MIN_TOUCH_TARGET=44,PRESSED_OPACITY=.7,INITIALS_MAX_FONT_SCALE=1.2;export const AVATAR_COLORS=["avatar-1","avatar-2","avatar-3","avatar-4","avatar-5","avatar-6","avatar-7","avatar-8"];export const avatarToneColors=(e,t)=>{const soft=(e,t)=>tintOf(e,.14,t);switch(t){case"primary":return{background:soft(e.colors.primary,e.colors["primary-soft"]),color:e.colors["primary-text"]};case"success":return{background:soft(e.colors.success,e.colors["bg-subtle"]),color:e.colors["success-text"]};case"warning":return{background:soft(e.colors.warning,e.colors["bg-subtle"]),color:e.colors["warning-text"]};case"danger":return{background:soft(e.colors.danger,e.colors["bg-subtle"]),color:e.colors["danger-text"]};case"info":return{background:soft(e.colors.info,e.colors["bg-subtle"]),color:e.colors["info-text"]};case"neutral":return{background:e.colors["bg-muted"],color:e.colors["text-body"]}}};const sizeMap={xs:24,sm:32,md:48,lg:64,xl:80},resolveSize=e=>sizeMap[e],resolveRadius=(e,t,r,o)=>{switch(t){case"circle":return r/2;case"rounded":return o?e.radius[o]:Math.max(e.radius.sm,Math.round(.22*r));case"square":return 0}},initialsFromName=e=>{if(!e)return"";const t=e.trim().split(/\s+/u).filter(Boolean),[r,o]=t;return void 0===r?"":void 0===o?r.charAt(0).toUpperCase():(r.charAt(0)+o.charAt(0)).toUpperCase()},hashColor=(e,t)=>{let r=0;for(let t=0;t<e.length;t+=1)r=(r<<5)-r+e.charCodeAt(t),r|=0;const o=t[Math.abs(r)%t.length];if(void 0===o)throw new Error("The avatar colour palette is empty.");return o},RING_WIDTH=1.5,keyOfSource=e=>"object"==typeof e&&null!==e&&"uri"in e&&"string"==typeof e.uri?e.uri:e,uriOfSource=e=>"object"==typeof e&&null!==e&&"uri"in e&&"string"==typeof e.uri?e.uri:void 0,isImageSourceList=e=>Array.isArray(e),toExpoSource=e=>({...void 0!==e.uri?{uri:e.uri}:{},...void 0!==e.headers?{headers:e.headers}:{},...void 0!==e.width?{width:e.width}:{},...void 0!==e.height?{height:e.height}:{}}),toExpoSources=e=>"number"==typeof e?e:isImageSourceList(e)?e.map(toExpoSource):toExpoSource(e),isRingStatus=e=>"verified"===e||"pending"===e||"rejected"===e,statusColor=(e,t)=>{switch(t){case"online":case"verified":return e.colors.success;case"busy":case"rejected":return e.colors.danger;case"away":case"pending":return e.colors.warning;case"offline":return e.colors["text-subtle"]}},AvatarRoot=forwardRef((e,t)=>{const{source:r,ImageComponent:o,imageClient:s,name:a,size:i="md",shape:l="circle",dimension:n,radius:c,border:u=!1,contentFit:d="cover",placeholderIcon:m,status:h=null,statusPosition:g="bottomRight",tone:p,backgroundColor:b,color:v,fontSize:f,loading:y=!1,accessibilityLabel:x,onPress:A,onLongPress:S,haptic:j,hitSlop:C,style:I,textStyle:R,testID:T,labels:V}=e;assertValidValue("Avatar","size",e.size,Object.keys(sizeMap)),assertValidValue("Avatar","shape",e.shape,["circle","square","rounded"]),assertValidValue("Avatar","radius",e.radius,["sm","md","lg"]),assertValidValue("Avatar","contentFit",e.contentFit,["cover","contain"]),assertValidValue("Avatar","status",e.status,["online","offline","busy","away","verified","pending","rejected"]),assertValidValue("Avatar","statusPosition",e.statusPosition,["topRight","bottomRight"]),assertValidValue("Avatar","tone",e.tone,["primary","success","warning","danger","info","neutral"]);const w=useMobileUiText("avatar",AVATAR_TEXT),M=useMemo(()=>V?{...w,...V}:w,[w,V]),_=useTheme(),[E,k]=useState(null),z=useMemo(()=>n??resolveSize(i),[n,i]),O=useMemo(()=>resolveRadius(_,l,z,c),[_,l,z,c]),L=u?_.size.border:0,F=_.colors.border,D=_.colors.surface,P=useMemo(()=>initialsFromName(a),[a]),G=useMemo(()=>p?avatarToneColors(_,p):null,[_,p]),N=useMemo(()=>b||(G?.background??_.colors[hashColor(a??"",AVATAR_COLORS)]),[b,G,a,_]),$=v??G?.color??_.colors["on-primary"],H=r?keyOfSource(r):null,W=useMemo(()=>void 0!==r?toExpoSources(r):void 0,[r]),U=null!==H&&H!==E,B=!U&&""===P&&null!=m,X=v??G?.color??_.colors["text-subtle"],q=f??Math.max(_.text.xs.size,Math.round(.4*z)),Y=Math.max(8,Math.round(.25*z)),J=isRingStatus(h),K=z-2*(J?3:L),Q=J?resolveRadius(_,l,K,c):Math.max(0,O-L),Z=B?renderSlotIcon(m,{color:X,size:Math.round(.45*K),disabled:!1}):null,ee=J?statusColor(_,h):"transparent",te=Math.max(12,Math.round(.32*z)),re=Math.max(10,te-4),oe=b??G?.background??_.colors["bg-muted"],se=U?"contain"===d?"transparent":_.colors["bg-muted"]:B?oe:N,ae=T??"avatar",ie=a?fillText(M.avatarOf,{name:a}):M.avatar,le="verified"===h?`, ${M.verified}`:"pending"===h?`, ${M.pendingVerification}`:"rejected"===h?`, ${M.rejected}`:"",ne=x??`${ie}${le}`,ce="function"==typeof A||"function"==typeof S,ue=x??`${a||ie}${le}`,de=Math.max(0,Math.ceil((44-z)/2)),me=C??de,he=[styles.root,{width:z,height:z,borderRadius:O,...smoothCorners,borderWidth:J?0:L,borderColor:F,backgroundColor:J?"transparent":se},I],ge=_jsxs(_Fragment,{children:[J?_jsx(View,{style:[styles.ring,{borderRadius:O,...smoothCorners,borderWidth:1.5,borderColor:ee}],accessible:!1,pointerEvents:"none",testID:`${ae}-ring`}):null,_jsx(View,{style:[styles.picture,{width:K,height:K,borderRadius:Q,...smoothCorners,borderWidth:J?L:0,borderColor:F,backgroundColor:J?se:"transparent"}],children:U?(()=>{const e={width:K,height:K,borderRadius:Q,...smoothCorners};if(!r)return null;const onError=()=>k(H),t=uriOfSource(r);return o?_jsx(o,{source:r,onError:onError,style:e,contentFit:d,resizeMode:d,accessibilityIgnoresInvertColors:!0}):s&&void 0!==t?_jsx(AuthedImage,{uri:t,client:s,onError:onError,style:e,contentFit:d,placeholder:null,fallback:null,accessibilityIgnoresInvertColors:!0}):_jsx(Image,{...void 0!==W?{source:W}:{},onError:onError,style:e,contentFit:d,accessibilityIgnoresInvertColors:!0,testID:T?`${T}-image`:void 0})})():Z||_jsx(Text,{variant:"label",weight:"semibold",numberOfLines:1,maxFontSizeMultiplier:1.2,style:[styles.initials,{color:$,fontSize:q,lineHeight:Math.round(q*_.leading.body)},R],children:P??" "})}),"verified"===h||"rejected"===h?_jsx(View,{style:[styles.status,"topRight"===g?styles.badgeTopRight:styles.badgeBottomRight,{width:te,height:te,borderRadius:te/2,...smoothCorners,backgroundColor:D}],accessible:!1,pointerEvents:"none",testID:`${ae}-badge`,children:_jsx(AppIcon,{name:"verified"===h?"verify":"close-circle",variant:"bold",size:re,color:ee})}):null,h&&!J?_jsx(View,{style:[styles.status,"topRight"===g?styles.statusTopRight:styles.statusBottomRight,{width:Y,height:Y,borderRadius:Y/2,...smoothCorners,backgroundColor:statusColor(_,h),borderWidth:2,borderColor:D}],accessible:!1,pointerEvents:"none"}):null]}),pe=ce?_jsx(Pressable,{ref:t,onPress:A?e=>{const t=resolveHaptic(j,"selection");t&&triggerHaptic(t),A?.(e)}:void 0,onLongPress:S?e=>{const t=resolveHaptic(j,"longPress");t&&triggerHaptic(t),S?.(e)}:void 0,hitSlop:me,...hitSlopMarker(me),accessibilityRole:"button",accessibilityLabel:ue,testID:T,style:({pressed:e})=>[he,e?styles.pressed:null],children:ge}):_jsx(View,{ref:t,style:he,accessible:!0,accessibilityRole:"image",accessibilityLabel:ne,testID:T,children:ge});return y?_jsx(AvatarSkeleton,{...e}):pe}),AvatarSkeleton=({size:e="md",shape:t="circle",dimension:r,style:o})=>{const s=r??resolveSize(e);return _jsx(Skeleton,{shape:"circle"===t?"circle":"rounded"===t?"rounded":"rect",width:s,height:s,style:o})};AvatarSkeleton.displayName="AvatarSkeleton";const Avatar=Object.assign(AvatarRoot,{Skeleton:AvatarSkeleton});Avatar.displayName="Avatar";const styles=StyleSheet.create({root:{alignItems:"center",justifyContent:"center",overflow:"visible",position:"relative"},pressed:{opacity:.7},initials:{textAlign:"center"},ring:{position:"absolute",top:0,right:0,bottom:0,left:0},picture:{alignItems:"center",justifyContent:"center",overflow:"hidden"},status:{position:"absolute"},badgeTopRight:{top:-2,right:-2,alignItems:"center",justifyContent:"center"},badgeBottomRight:{bottom:-2,right:-2,alignItems:"center",justifyContent:"center"},statusTopRight:{top:0,right:0},statusBottomRight:{bottom:0,right:0}}),SPACING_OFFSET={tight:"lg",normal:"md",loose:"sm"},STAGGER_MS=50,ENTRANCE_DURATION_MS=220,AvatarGroupItem=({delay:e,marginLeft:t,borderColor:r,borderWidth:o,children:s})=>{const a=useTheme(),i=useRef(createAnimatedValue(0)).current;return useEffect(()=>{const t=Animated.timing(i,{toValue:1,duration:220,delay:e,easing:Easing.out(Easing.cubic),useNativeDriver:nativeDriver});return t.start(),()=>t.stop()},[e,i]),_jsx(Animated.View,{style:[groupStyles.item,{marginLeft:t,borderRadius:a.radius.pill,borderColor:r,borderWidth:o,opacity:i}],children:s})},AvatarGroup=e=>{const{children:t,max:r=4,size:o="md",spacing:s="normal",overflowVariant:a="count",accessibilityLabel:i,style:l,testID:n,labels:c}=e;assertValidValue("AvatarGroup","spacing",e.spacing,["tight","normal","loose"]),assertValidValue("AvatarGroup","overflowVariant",e.overflowVariant,["count","plus"]),assertValidValue("AvatarGroup","size",e.size,Object.keys(sizeMap));const u=useMobileUiText("avatar",AVATAR_TEXT),d=useMemo(()=>c?{...u,...c}:u,[u,c]),m=useTheme(),h=useMemo(()=>Children.toArray(t).filter(e=>isValidElement(e)),[t]),g=h.length,p=h.slice(0,r),b=Math.max(0,g-r),v=b>0,f=-m.space[SPACING_OFFSET[s]],y=m.colors.surface,x=i??pluralText(d,"groupOf",g),A=useMemo(()=>resolveSize(o),[o]),S=Math.max(m.text.xs.size,Math.round(.34*A));return _jsxs(View,{style:[groupStyles.row,l],accessible:!0,accessibilityLabel:x,accessibilityRole:"summary",testID:n,children:[p.map((e,t)=>{const r=e.key??`avatar-${t}`,s=cloneElement(e,{size:o,labels:e.props.labels??c});return _jsx(AvatarGroupItem,{delay:50*t,marginLeft:0===t?0:f,borderColor:y,borderWidth:1.5,children:s},r)}),v?_jsx(AvatarGroupItem,{delay:50*p.length,marginLeft:0===p.length?0:f,borderColor:y,borderWidth:1.5,children:_jsx(View,{style:[groupStyles.overflow,{width:A,height:A,borderRadius:A/2,...smoothCorners,backgroundColor:m.colors["surface-disabled"]}],accessible:!0,accessibilityRole:"text",accessibilityLabel:"count"===a?fillText(d.moreCount,{count:b}):d.moreAvatars,children:_jsx(Text,{variant:"label",weight:"semibold",color:"secondary",numberOfLines:1,maxFontSizeMultiplier:1.2,style:{fontSize:S,lineHeight:Math.round(S*m.leading.body)},children:"count"===a?`+${b}`:"+"})})},"avatar-overflow"):null]})},groupStyles=StyleSheet.create({row:{flexDirection:"row",alignItems:"center"},item:{...smoothCorners},overflow:{alignItems:"center",justifyContent:"center"}});export{Avatar,AvatarGroup};export default Avatar;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";export{Avatar,AvatarGroup,avatarToneColors,
|
|
1
|
+
"use strict";export{Avatar,AvatarGroup,avatarToneColors,default}from"./Avatar.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{forwardRef,useEffect,useMemo,useRef}from"react";import{Animated,Easing,StyleSheet,View}from"react-native";import{createAnimatedValue,resolveBadgeSize,setNativeValue,useTheme}from"../../theme/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{smoothCorners}from"../../utils/corners.js";import{nativeDriver}from"../../utils/nativeDriver.js";import{Skeleton}from"../Skeleton/index.js";import{Text}from"../Text/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";
|
|
1
|
+
"use strict";import{forwardRef,useEffect,useMemo,useRef}from"react";import{Animated,Easing,StyleSheet,View}from"react-native";import{fillText,useMobileUiText}from"../../text/index.js";import{BADGE_TEXT}from"../../text/phone/badge.g.js";import{createAnimatedValue,resolveBadgeSize,setNativeValue,useTheme}from"../../theme/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{smoothCorners}from"../../utils/corners.js";import{nativeDriver}from"../../utils/nativeDriver.js";import{Skeleton}from"../Skeleton/index.js";import{Text}from"../Text/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const toneFor=(e,t)=>{switch(t){case"primary":return{background:e.colors.primary,text:e.colors["on-primary"]};case"success":return{background:e.colors.success,text:e.colors["on-success"]};case"warning":return{background:e.colors.warning,text:e.colors["on-warning"]};case"info":return{background:e.colors.info,text:e.colors["on-info"]};case"neutral":return{background:e.colors["bg-muted"],text:e.colors["text-body"]};default:return{background:e.colors.danger,text:e.colors["on-danger"]}}},softToneFor=(e,t)=>{switch(t){case"primary":return{background:e.colors["primary-soft"],text:e.colors.primary};case"success":return{background:e.colors["success-soft"],text:e.colors.success};case"warning":return{background:e.colors["warning-soft"],text:e.colors.warning};case"info":return{background:e.colors["info-soft"],text:e.colors.info};case"neutral":return{background:e.colors["bg-muted"],text:e.colors["text-muted"]};default:return{background:e.colors["danger-soft"],text:e.colors.danger}}},anchorPosition=(e,t)=>{const o=-t;switch(e){case"topLeft":return{top:o,left:o};case"bottomRight":return{bottom:o,right:o};case"bottomLeft":return{bottom:o,left:o};default:return{top:o,right:o}}},formatValue=(e,t)=>{if(null==e)return null;if("number"==typeof e)return e<=0?null:e>t?`${t}+`:String(e);const o=String(e);return 0===o.length?null:o},BadgeRoot=forwardRef((e,t)=>{const{value:o,max:r=99,variant:i="standard",tone:s="danger",size:n="sm",fill:a="solid",accessible:l=!0,invisible:d=!1,loading:c=!1,children:u,anchor:g="topRight",pulse:m=!1,accessibilityLabel:h,labels:f,style:b,badgeStyle:x,textStyle:p,testID:y}=e;assertValidValue("Badge","variant",e.variant,["standard","dot"]),assertValidValue("Badge","tone",e.tone,["primary","success","warning","danger","neutral","info"]),assertValidValue("Badge","size",e.size,["sm","md"]),assertValidValue("Badge","anchor",e.anchor,["topRight","topLeft","bottomRight","bottomLeft"]),assertValidValue("Badge","fill",e.fill,["solid","soft"]);const v=useMobileUiText("badge",BADGE_TEXT),w=useMemo(()=>({...v,...f}),[v,f]),V=useTheme(),j=useMemo(()=>"soft"===a?softToneFor(V,s):toneFor(V,s),[V,s,a]),k=resolveBadgeSize(V,n),S=V.components.badge["border-width"],B=V.components.badge["anchor-offset"],z="dot"===i?null:formatValue(o,r),T=!d&&("dot"===i||null!==z),R=useRef(createAnimatedValue(1)).current;useEffect(()=>{if(!m||!T)return void setNativeValue(R,1);const e=Animated.loop(Animated.sequence([Animated.timing(R,{toValue:1.15,duration:V.motion.duration.slow,easing:Easing.bezier(...V.motion.ease["in-out"]),useNativeDriver:nativeDriver}),Animated.timing(R,{toValue:1,duration:V.motion.duration.slow,easing:Easing.bezier(...V.motion.ease["in-out"]),useNativeDriver:nativeDriver})]));return e.start(),()=>{e.stop()}},[m,T,R,V]);const _="dot"===i,A=_?"image":"text",D=h??(_?w.indicator:z?fillText(w.unread,{count:z}):void 0),E=T?_jsx(Animated.View,{style:[styles.badge,_?{width:k["dot-size"],height:k["dot-size"],borderRadius:k["dot-size"]/2,...smoothCorners,paddingHorizontal:0}:{minWidth:k["min-width"],minHeight:k.height,borderRadius:V.radius.pill,...smoothCorners,paddingHorizontal:k["padding-x"]},{backgroundColor:j.background,transform:[{scale:R}]},u?{position:"absolute",borderWidth:S,borderColor:V.colors.surface,...anchorPosition(g,B)}:null,x],accessible:l,importantForAccessibility:l?void 0:"no-hide-descendants",accessibilityElementsHidden:!l||void 0,accessibilityRole:l?A:void 0,accessibilityLabel:l?D:void 0,children:_||null===z?null:_jsx(Text,{variant:"caption",weight:"soft"===a?"semibold":"bold",numberOfLines:1,style:[styles.text,{color:j.text,fontSize:k.text,lineHeight:Math.round(k.text*V.leading.body)},p],children:z??" "})}):null,L=u?_jsxs(View,{ref:t,style:[styles.wrapper,b],testID:y,children:[u,E]}):_jsx(View,{ref:t,style:b,testID:y,children:E});return c?_jsx(BadgeSkeleton,{...e}):L}),BadgeSkeleton=({variant:e="standard",size:t="md",children:o,anchor:r,style:i,badgeStyle:s})=>{const n=useTheme(),a=resolveBadgeSize(n,t);if("dot"===e)return _jsx(Skeleton,{shape:"circle",width:a["dot-size"],height:a["dot-size"],style:[s,i]});const l=a.height/2;if(void 0!==o){const e="topLeft"===r?{top:-a.height/2,left:-a.height/2}:"bottomRight"===r?{bottom:-a.height/2,right:-a.height/2}:"bottomLeft"===r?{bottom:-a.height/2,left:-a.height/2}:{top:-a.height/2,right:-a.height/2};return _jsxs(View,{style:[styles.wrapper,i],children:[o,_jsx(View,{style:[{position:"absolute"},e],children:_jsx(Skeleton,{width:a["min-width"]+a["padding-x"],height:a.height,radius:l,style:s})})]})}return _jsx(Skeleton,{width:a["min-width"]+a["padding-x"],height:a.height,radius:l,style:[s,i]})};BadgeSkeleton.displayName="BadgeSkeleton";const Badge=Object.assign(BadgeRoot,{Skeleton:BadgeSkeleton});Badge.displayName="Badge";const styles=StyleSheet.create({wrapper:{position:"relative",alignSelf:"flex-start"},badge:{alignItems:"center",justifyContent:"center",flexDirection:"row"},text:{textAlign:"center",includeFontPadding:!1}});export{Badge};export default Badge;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";export{Badge,
|
|
1
|
+
"use strict";export{Badge,default}from"./Badge.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{forwardRef,useEffect,useMemo,useRef,useState}from"react";import{Animated,Pressable,StyleSheet,View}from"react-native";import{usePresenceMotion}from"../../hooks/usePresenceMotion.js";import{createAnimatedValue,useTheme}from"../../theme/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{smoothCorners}from"../../utils/corners.js";import{resolveHaptic,triggerHaptic}from"../../utils/hapticUtils.js";import{hitSlopMarker}from"../../utils/hitSlop.js";import{nativeDriver}from"../../utils/nativeDriver.js";import{renderSlotIcon}from"../AppIcon/slotIcon.js";import{IconBadge}from"../IconBadge/index.js";import{Skeleton,SkeletonText}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{forwardRef,useEffect,useMemo,useRef,useState}from"react";import{Animated,Platform,Pressable,StyleSheet,View}from"react-native";import{usePresenceMotion}from"../../hooks/usePresenceMotion.js";import{useMobileUiText}from"../../text/index.js";import{BANNER_TEXT}from"../../text/phone/banner.g.js";import{createAnimatedValue,useTheme}from"../../theme/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{smoothCorners}from"../../utils/corners.js";import{resolveHaptic,triggerHaptic}from"../../utils/hapticUtils.js";import{hitSlopMarker}from"../../utils/hitSlop.js";import{nativeDriver}from"../../utils/nativeDriver.js";import{renderSlotIcon}from"../AppIcon/slotIcon.js";import{IconBadge}from"../IconBadge/index.js";import{Skeleton,SkeletonText}from"../Skeleton/index.js";import{Text}from"../Text/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const BannerRoot=forwardRef((e,t)=>{const{title:r,message:o,tone:n="neutral",variant:s="bar",icon:i,actions:a,dismissible:l=!1,onClose:c,haptic:d,open:u=!0,animateMount:m=!0,loading:p=!1,accessibilityRole:g="alert",accessibilityLabel:h,labels:y,style:x,iconCircleStyle:b,tintBarStyle:f,closeButtonStyle:w,actionButtonStyle:j,testID:v}=e;assertValidValue("Banner","tone",e.tone,["primary","success","warning","danger","info","neutral"]),assertValidValue("Banner","variant",e.variant,["bar","wash","tint"]),assertValidValue("Banner","accessibilityRole",e.accessibilityRole,["alert","summary","none"]);const k=useTheme(),S=usePresenceMotion(),B=useMemo(()=>buildStyles(k),[k]),V=useMemo(()=>tintFor(k,n),[k,n]),C=useMobileUiText("banner",BANNER_TEXT),R=useMemo(()=>({...C,...y}),[C,y]),_=useMemo(()=>(a??[]).map((e,t)=>({key:`${e.label}-${t}`,action:e})),[a]),[I,T]=S.range(-20,0),M=useRef(createAnimatedValue(m&&u?I:0)).current,D=useRef(createAnimatedValue(m&&u?0:u?1:0)).current,[A,H]=useState(u),N=useRef(!0),z=useRef({animateMount:m,mounted:A,theme:k,presence:S,hiddenY:I,shownY:T,translateY:M,opacity:D});if(z.current={animateMount:m,mounted:A,theme:k,presence:S,hiddenY:I,shownY:T,translateY:M,opacity:D},useEffect(()=>{if(N.current&&(N.current=!1,!z.current.animateMount))return;let e;return u?(H(!0),e=Animated.parallel([Animated.timing(z.current.translateY,{toValue:z.current.shownY,duration:z.current.theme.motion.duration.default,useNativeDriver:nativeDriver}),Animated.timing(z.current.opacity,{toValue:1,duration:z.current.presence.duration("default"),useNativeDriver:nativeDriver})]),e.start()):z.current.mounted&&(e=Animated.parallel([Animated.timing(z.current.translateY,{toValue:z.current.hiddenY,duration:z.current.theme.motion.duration.fast,useNativeDriver:nativeDriver}),Animated.timing(z.current.opacity,{toValue:0,duration:z.current.presence.duration("fast"),useNativeDriver:nativeDriver})]),e.start(()=>{H(!1)})),()=>e?.stop()},[u]),!A)return null;const E=r??" ",L="string"==typeof o?o??" ":"",P="wash"===s,Y="bar"!==s,W="alert"===g,O=W?"danger"===n?"assertive":"polite":"none",$=_jsxs(Animated.View,{ref:t,accessibilityRole:g,..."web"===Platform.OS&&W&&"danger"!==n?{role:"status"}:null,accessibilityLiveRegion:O,accessibilityLabel:h,testID:v,style:[B.container,{backgroundColor:Y?V.soft:k.colors["bg-subtle"],borderRadius:P?k.radius.sm:k.radius.md,...smoothCorners,padding:k.space.md,opacity:D,transform:[{translateY:M}]},x],children:[!P&&k.components.banner["tint-bar-width"]>0?_jsx(View,{style:[B.tintBar,{backgroundColor:V.bar},f]}):null,_jsxs(View,{style:[B.row,void 0===r&&B.rowCentred],children:[!1===i?null:i?_jsx(View,{style:B.iconWrap,accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants","aria-hidden":!0,children:renderSlotIcon(i,{color:V.ink,size:k.text.xl.size,disabled:!1})}):_jsx(IconBadge,{dimension:ICON_CIRCLE_SIZE,color:V.bar,icon:_jsx(Text,{variant:"body",weight:"bold",accessible:!1,style:[B.iconGlyph,{color:V.ink}],children:V.glyph}),style:[B.iconCircle,b]}),_jsxs(View,{style:B.textBlock,children:[r||p?_jsx(Text,{variant:"body",weight:"semibold",numberOfLines:2,style:P?{color:V.ink}:void 0,children:E}):null,"string"==typeof o||p?_jsx(Text,{variant:"bodySmall",color:"secondary",style:{marginTop:r?k.space.xxs:0},children:L||" "}):_jsx(View,{style:{marginTop:r?k.space.xxs:0},children:o})]}),l?_jsx(Pressable,{accessibilityRole:"button",accessibilityLabel:R.dismiss,onPress:()=>{const e=resolveHaptic(d,"selection");e&&triggerHaptic(e),c?.()},hitSlop:8,...hitSlopMarker(8),style:({pressed:e})=>[B.closeBtn,{backgroundColor:e?k.colors["surface-pressed"]:"transparent"},w],children:_jsx(Text,{variant:"title",weight:"bold",color:"secondary",accessible:!1,style:{lineHeight:Math.round(k.text.lg.size*k.leading.heading)},children:"×"})}):null]}),a&&a.length>0?_jsx(View,{style:B.actionsRow,children:_.map(({key:e,action:t})=>{assertValidValue("Banner","action.tone",t.tone,["primary","success","warning","danger","info","neutral"]),assertValidValue("Banner","action.variant",t.variant,["solid","outline","ghost"]),assertValidValue("Banner","action.size",t.size,["sm","md"]);const r=t.tone??"primary",o=t.variant??"ghost",n="primary"===r?V.glyphColor:"neutral"===r?k.colors["text-muted"]:k.colors[r],s="primary"===r?V.ink:"neutral"===r?k.colors["text-muted"]:k.colors[`${r}-text`],i="primary"===r?V.on:"neutral"===r?k.colors["on-neutral-strong"]:k.colors[`on-${r}`],a="solid"===o;return _jsx(Pressable,{accessibilityRole:"button",accessibilityLabel:t.label,testID:t.testID,onPress:()=>{const e=resolveHaptic(d,"selection");e&&triggerHaptic(e),t.onPress()},style:({pressed:e})=>[B.actionBtn,"md"===t.size&&B.actionBtnMd,"outline"===o&&{borderWidth:1,borderColor:s},{backgroundColor:a?n:e?k.colors["surface-pressed"]:"transparent",opacity:a&&e?.85:1},j],children:_jsx(Text,{variant:"bodySmall",weight:"semibold",align:"center",style:{color:a?i:s},children:t.label})},e)})}):null]});return p?_jsx(BannerSkeleton,{...e}):$}),BannerSkeleton=({title:e,actions:t,icon:r,style:o})=>{const n=useTheme(),s=!1!==r,i=t?.length??0,a=useMemo(()=>Array.from({length:i},(e,t)=>({key:`sk-banner-action-${t}`})),[i]);return _jsxs(View,{style:[{flexDirection:"row",alignItems:"flex-start",backgroundColor:n.colors.surface,borderRadius:n.radius.md,...smoothCorners,padding:n.space.md,borderWidth:1,borderColor:n.colors.border},o],accessibilityRole:"progressbar",accessibilityState:{busy:!0},"aria-busy":!0,children:[s?_jsx(View,{style:{marginRight:n.space.sm},children:_jsx(Skeleton,{shape:"circle",width:32,height:32})}):null,_jsxs(View,{style:{flex:1},children:[void 0!==e?_jsx(Skeleton,{shape:"text",width:"55%",height:16,style:{marginBottom:n.space.xs}}):null,_jsx(SkeletonText,{lines:2,fontSize:n.text.sm.size,lastLineWidth:"70%"}),t&&t.length>0?_jsx(View,{style:{flexDirection:"row",marginTop:n.space.sm},children:a.map(e=>_jsx(Skeleton,{width:72,height:28,shape:"rounded",style:{marginRight:n.space.sm}},e.key))}):null]})]})};BannerSkeleton.displayName="BannerSkeleton";const Banner=Object.assign(BannerRoot,{Skeleton:BannerSkeleton});Banner.displayName="Banner";const tintFor=(e,t)=>{switch(t){case"success":return{soft:e.colors["success-soft"],bar:e.colors.success,glyphColor:e.colors.success,ink:e.colors["success-text"],on:e.colors["on-success"],glyph:"✓"};case"warning":return{soft:e.colors["warning-soft"],bar:e.colors.warning,glyphColor:e.colors.warning,ink:e.colors["warning-text"],on:e.colors["on-warning"],glyph:"⚠"};case"danger":return{soft:e.colors["danger-soft"],bar:e.colors.danger,glyphColor:e.colors.danger,ink:e.colors["danger-text"],on:e.colors["on-danger"],glyph:"✗"};case"neutral":return{soft:e.colors["bg-subtle"],bar:e.colors["text-subtle"],glyphColor:e.colors["text-muted"],ink:e.colors["text-muted"],on:e.colors["on-neutral-strong"],glyph:"i"};case"primary":return{soft:e.colors["primary-soft"],bar:e.colors.primary,glyphColor:e.colors.primary,ink:e.colors["primary-text"],on:e.colors["on-primary"],glyph:"i"};case"info":return{soft:e.colors["info-soft"],bar:e.colors.info,glyphColor:e.colors.info,ink:e.colors["info-text"],on:e.colors["on-info"],glyph:"i"};default:return tintFor(e,"neutral")}},ICON_CIRCLE_SIZE=28,buildStyles=e=>{const t=e.components.banner,r=e.space.sm;return StyleSheet.create({container:{overflow:"hidden",paddingLeft:e.space.md},tintBar:{position:"absolute",left:0,top:0,bottom:0,width:t["tint-bar-width"]},row:{flexDirection:"row",alignItems:"flex-start"},rowCentred:{alignItems:"center"},iconWrap:{marginRight:r},iconCircle:{marginRight:r},iconGlyph:{lineHeight:Math.round(e.text.base.size*e.leading.heading)},textBlock:{flex:1,paddingRight:e.space.xs},closeBtn:{width:28,height:28,borderRadius:e.radius.pill,...smoothCorners,alignItems:"center",justifyContent:"center",marginLeft:e.space.xxs},actionsRow:{flexDirection:"row",flexWrap:"wrap",justifyContent:"flex-end",marginTop:e.space.xs,columnGap:e.space.xs,rowGap:e.space.xs},actionBtn:{paddingHorizontal:e.space.sm,paddingVertical:e.space.xs,borderRadius:e.radius.sm,...smoothCorners,maxWidth:"100%",alignItems:"center",justifyContent:"center"},actionBtnMd:{minHeight:44,paddingHorizontal:e.space.md}})};export{Banner};export default Banner;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";export{Banner,
|
|
1
|
+
"use strict";export{Banner,default}from"./Banner.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{formatCompactNumber,formatNumber}from"@webority/mobile-core";import{forwardRef,useCallback,useMemo,useRef,useState}from"react";import{StyleSheet,View}from"react-native";import{GestureDetector,useCompetingGestures,usePanGesture,useTapGesture}from"react-native-gesture-handler";import{useControllableState}from"../../hooks/index.js";import{useTheme}from"../../theme/index.js";import{resolveHaptic,triggerHaptic}from"../../utils/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{smoothCorners}from"../../utils/corners.js";import{Text}from"../Text/index.js";import{barScale}from"./scale.js";import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from"react/jsx-runtime";
|
|
1
|
+
"use strict";import{formatCompactNumber,formatNumber}from"@webority/mobile-core";import{forwardRef,useCallback,useMemo,useRef,useState}from"react";import{StyleSheet,View}from"react-native";import{GestureDetector,useCompetingGestures,usePanGesture,useTapGesture}from"react-native-gesture-handler";import{useControllableState}from"../../hooks/index.js";import{fillText,useMobileUiText}from"../../text/index.js";import{BAR_CHART_TEXT}from"../../text/phone/barChart.g.js";import{useTheme}from"../../theme/index.js";import{resolveHaptic,triggerHaptic}from"../../utils/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{smoothCorners}from"../../utils/corners.js";import{Text}from"../Text/index.js";import{barScale}from"./scale.js";import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from"react/jsx-runtime";const AUTO_VALUES_MAX_BARS=7,MAX_BAR_WIDTH=40,BAR_SHARE=.6,MIN_BAR_HEIGHT=2,VALUE_LABEL_ROOM=20,PLOT_PAD=6,HEADER_MIN_HEIGHT=48,AXIS_LABEL_MIN_WIDTH=44,CHAR_WIDTH=8,SWATCH_SIZE=10,STACK_TONES=["primary","info","success","warning","danger","neutral"],FONT_SCALE_CAP=1.2,toneColor=(e,t)=>"neutral"===t?e.colors["text-muted"]:e.colors[`${t}-text`],safe=e=>"number"==typeof e&&Number.isFinite(e)?e:0,entryAt=(e,t)=>{const r=e[t];if(void 0===r)throw new Error(`BarChart has no entry at index ${t}.`);return r},defaultFormatValue=e=>formatNumber(e),defaultFormatTick=e=>formatCompactNumber(e),BarChart=forwardRef((e,t)=>{const{data:r,tone:s="primary",color:a,series:i,height:l=160,label:o,summary:n,formatValue:c=defaultFormatValue,formatTick:u=defaultFormatTick,showValues:m,selection:d,defaultSelection:h=null,onSelect:p,haptic:x,labels:y,style:b,testID:f}=e;assertValidValue("BarChart","tone",e.tone,["primary","success","warning","danger","info","neutral"]);const g=useMobileUiText("barChart",BAR_CHART_TEXT),_=useMemo(()=>({...g,...y}),[g,y]),C=useTheme(),A=r.length,[T,M]=useState(0),[j,w]=useControllableState({value:d,defaultValue:h,onChange:p}),S=null!==j&&j>=0&&j<A?j:null,v=useRef(S);v.current=S;const R=useRef(-1),V=resolveHaptic(x,"tick"),k=useCallback(()=>{V&&triggerHaptic(V)},[V]),D=m??(A>0&&A<=7),L=void 0!==i&&i.length>0,$=useMemo(()=>L?i.map((e,t)=>e.tone??entryAt(STACK_TONES,t%STACK_TONES.length)):[],[L,i]),I=useMemo(()=>L?i.map(e=>e.key):[],[L,i]),E=useMemo(()=>L?r.map(e=>i.map(t=>safe(e.values?.[t.key]))):null,[r,i,L]),B=useMemo(()=>E?E.map(e=>e.reduce((e,t)=>e+t,0)):r.map(e=>safe(e.value)),[r,E]),H=useMemo(()=>E?E.flatMap(e=>[e.reduce((e,t)=>t>0?e+t:e,0),e.reduce((e,t)=>t<0?e+t:e,0)]):B,[E,B]),O=useMemo(()=>barScale(H),[H]),N=D?20:6,F=D&&O.min<0?20:6,G=Math.max(1,l-N-F),W=useCallback(e=>N+(O.max-e)/(O.max-O.min)*G,[N,O.max,O.min,G]),U=W(0),X=useMemo(()=>O.ticks.map(e=>u(e)),[O.ticks,u]),P=Math.ceil(8*Math.max(...X.map(e=>e.length),1)*1.2)+C.space.xs,z=A>0?T/A:0,K=Math.max(1,Math.ceil(44/Math.max(1,z||44))),J=useMemo(()=>r.map((e,t)=>({key:`axis-${t}`,d:e,index:t})),[r]),Y=useCallback(e=>{const t=entryAt(r,e);if(t.accessibilityLabel)return t.accessibilityLabel;if(E&&i){const r=entryAt(E,e);return`${t.label}, ${i.map((e,t)=>`${e.label} ${c(entryAt(r,t))}`).join(", ")}`}return`${t.label}, ${c(entryAt(B,e))}`},[r,c,B,E,i]),Z=useMemo(()=>{let e=-1,t=0;for(const[r,s]of B.entries())(-1===e||s>t)&&(e=r,t=s);return e},[B]),q=n??(Z>=0?fillText(_.highest,{label:entryAt(r,Z).label,value:c(entryAt(B,Z))}):""),Q=useRef({fire:k,setSelected:w,count:A,plotWidth:T});Q.current={fire:k,setSelected:w,count:A,plotWidth:T};const ee=useCallback(e=>{const{count:t,plotWidth:r}=Q.current;return 0===t||r<=0||!Number.isFinite(e)?-1:Math.min(t-1,Math.max(0,Math.floor(e/r*t)))},[]),te=useCallback(e=>{const t=ee(e);t<0||t===R.current||(R.current=t,Q.current.fire(),Q.current.setSelected(t))},[ee]),re=useMemo(()=>({runOnJS:!0,activeOffsetX:[-8,8],failOffsetY:[-12,12],onActivate:e=>{R.current=v.current??-1,te(e.x)},onUpdate:e=>te(e.x),testID:f?`${f}-pan`:"bar-chart-pan"}),[te,f]),se=usePanGesture(re),ae=useMemo(()=>({runOnJS:!0,onDeactivate:e=>{if(e.canceled)return;const t=ee(e.x);t<0||(Q.current.fire(),R.current=t,Q.current.setSelected(t===v.current?null:t))},testID:f?`${f}-tap`:"bar-chart-tap"}),[ee,f]),ie=useTapGesture(ae),le=useCompetingGestures(se,ie),oe=useCallback(e=>{if(0===A)return;const t=v.current,r="increment"===e.nativeEvent.actionName?null===t?0:Math.min(A-1,t+1):null===t?A-1:Math.max(0,t-1);r!==t&&(k(),w(r))},[A,k,w]),ne=useCallback(e=>{const t=Math.round(e.nativeEvent.layout.width);M(e=>e===t?e:t)},[]),ce=a??toneColor(C,s),ue=C.radius.sm,me=o??_.chart,de=0===A?`${me}, ${_.noData}`:q?`${me}, ${q}`:me,he=null===S?q:Y(S),pe=Math.min(40,Math.max(4,.6*z)),renderStack=(e,t,r)=>{const s=e.reduce((e,t)=>t>0?e+t:e,0),a=e.reduce((e,t)=>t<0?e+t:e,0);if(0===s&&0===a)return null;const i=W(s),l=[];let o=0,n=0;return e.forEach((e,r)=>{if(0===e)return;const s=e>0?o:n,a=s+e;e>0?o=a:n=a;const c=W(s),u=W(a);l.push(_jsx(View,{testID:f?`${f}-bar-${t}-series-${r}`:void 0,style:{position:"absolute",left:0,right:0,top:Math.min(c,u)-i,height:Math.abs(c-u),backgroundColor:toneColor(C,entryAt($,r))}},entryAt(I,r)))}),_jsx(View,{testID:f?`${f}-bar-${t}`:void 0,style:{position:"absolute",left:(z-pe)/2,top:i,width:pe,height:Math.max(2,W(a)-i),overflow:"hidden",opacity:r?.4:1,...smoothCorners,...s>0?{borderTopLeftRadius:ue,borderTopRightRadius:ue}:null,...a<0?{borderBottomLeftRadius:ue,borderBottomRightRadius:ue}:null},children:l})},xe=useMemo(()=>B.map((e,t)=>({key:`bar-${t}`,value:e,index:t})),[B]).map(({key:e,value:t,index:r})=>{const s=W(t),a=t>=0?s:U,i=0===t?0:Math.max(2,Math.abs(s-U)),o=null!==S&&S!==r;return _jsxs(View,{style:[styles.slot,{height:l}],children:[T>0&&E?renderStack(entryAt(E,r),r,o):null,T>0&&!E&&i>0?_jsx(View,{testID:f?`${f}-bar-${r}`:void 0,style:{position:"absolute",left:(z-pe)/2,top:a,width:pe,height:i,backgroundColor:ce,opacity:o?.4:1,...smoothCorners,...t>=0?{borderTopLeftRadius:ue,borderTopRightRadius:ue}:{borderBottomLeftRadius:ue,borderBottomRightRadius:ue}}}):null,D&&T>0?_jsx(Text,{variant:"caption",color:"secondary",align:"center",numberOfLines:1,maxFontSizeMultiplier:1.2,style:{position:"absolute",left:0,right:0,top:t>=0?(E?W(entryAt(H,2*r)):s)-20+2:(E?W(entryAt(H,2*r+1)):s)+2},children:u(t)}):null]},e)});return 0===A?_jsx(View,{ref:t,accessible:!0,accessibilityRole:"image",accessibilityLabel:de,testID:f,style:[styles.root,b],children:_jsx(Text,{variant:"bodySmall",color:"secondary",children:_.noDataLabel})}):_jsxs(View,{ref:t,accessible:!0,accessibilityRole:"adjustable",accessibilityLabel:de,accessibilityValue:{min:0,max:A-1,now:S??0,text:he},accessibilityActions:[{name:"increment"},{name:"decrement"}],onAccessibilityAction:oe,testID:f,style:[styles.root,b],children:[_jsx(View,{style:[styles.header,{minHeight:48,marginBottom:C.space.sm}],children:null===S?q?_jsx(Text,{variant:"bodySmall",color:"secondary",children:q}):null:_jsxs(_Fragment,{children:[_jsx(Text,{variant:"caption",color:"secondary",numberOfLines:1,children:entryAt(r,S).label}),_jsx(Text,{variant:"h3",numberOfLines:1,testID:f?`${f}-callout`:void 0,children:c(entryAt(B,S))})]})}),_jsxs(View,{style:styles.body,children:[_jsx(View,{style:{width:P,height:l},children:O.ticks.map((e,t)=>_jsx(Text,{variant:"caption",color:"tertiary",align:"right",numberOfLines:1,maxFontSizeMultiplier:1.2,style:{position:"absolute",right:C.space.xs,left:0,top:W(e)-8},children:entryAt(X,t)},e))}),_jsxs(View,{style:styles.plotColumn,children:[_jsx(GestureDetector,{gesture:le,children:_jsxs(View,{style:{height:l},onLayout:ne,testID:f?`${f}-plot`:void 0,children:[O.ticks.map(e=>_jsx(View,{pointerEvents:"none",style:{position:"absolute",left:0,right:0,top:W(e)-(0===e?.75:StyleSheet.hairlineWidth),height:0===e?1.5:2*StyleSheet.hairlineWidth,backgroundColor:0===e?C.colors["text-subtle"]:C.colors["border-subtle"]}},e)),_jsx(View,{style:[styles.slots,{height:l}],children:xe})]})}),_jsx(View,{style:styles.axis,children:J.map(({key:e,d:t,index:r})=>_jsx(View,{style:styles.axisSlot,children:r%K===0?_jsx(Text,{variant:"caption",color:S===r?"primary":"tertiary",weight:S===r?"semibold":void 0,align:"center",numberOfLines:1,maxFontSizeMultiplier:1.2,style:z>0?{width:z*K}:void 0,children:t.axisLabel??t.label}):null},e))})]})]}),i&&L?_jsx(View,{style:[styles.legend,{marginTop:C.space.sm,columnGap:C.space.md,rowGap:C.space.xs}],children:i.map((e,t)=>_jsxs(View,{style:[styles.legendItem,{columnGap:C.space.xs}],children:[_jsx(View,{style:{width:10,height:10,borderRadius:C.radius.sm,...smoothCorners,backgroundColor:toneColor(C,entryAt($,t))}}),_jsx(Text,{variant:"caption",color:"secondary",numberOfLines:1,maxFontSizeMultiplier:1.2,children:e.label})]},e.key))}):null]})});BarChart.displayName="BarChart";const styles=StyleSheet.create({root:{alignSelf:"stretch"},header:{justifyContent:"center"},body:{flexDirection:"row"},plotColumn:{flex:1},slots:{flexDirection:"row"},slot:{flex:1},axis:{flexDirection:"row"},legend:{flexDirection:"row",flexWrap:"wrap"},legendItem:{flexDirection:"row",alignItems:"center"},axisSlot:{flex:1,alignItems:"center",overflow:"visible"}});export{BarChart};export default BarChart;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";export{BarChart,
|
|
1
|
+
"use strict";export{BarChart,default}from"./BarChart.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import React,{forwardRef,useEffect,useMemo,useRef}from"react";import{Animated,LayoutAnimation,Platform,Pressable,StyleSheet,View}from"react-native";import{useSafeAreaInsets}from"react-native-safe-area-context";import{useReducedMotion}from"../../hooks/useReducedMotion.js";import{createAnimatedValue,useTheme}from"../../theme/index.js";import{triggerHaptic}from"../../utils/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{smoothCorners}from"../../utils/corners.js";import{hitSlopMarker}from"../../utils/hitSlop.js";import{nativeDriver}from"../../utils/nativeDriver.js";import{supportsBoxShadow,toBoxShadow}from"../../utils/shadows.js";import{renderSlotIcon}from"../AppIcon/index.js";import{Badge}from"../Badge/index.js";import{Text}from"../Text/index.js";import{useScreenReaderEnabled}from"./useScreenReaderEnabled.js";import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from"react/jsx-runtime";export const DEFAULT_BOTTOM_NAVIGATION_LABELS=Object.freeze({switchesTo:e=>`Switches to ${e}`,unread:e=>`${e} unread`,newUpdates:"new updates"});const DEFAULT_ICON_SIZE=18,DEFAULT_LABEL_MAX_FONT_SCALE=1.2,ICON_WRAP_AIR=4,PILL_AIR=8,DEFAULT_PILL_MAX_WIDTH=64,TILE_MAX_WIDTH=96,DEFAULT_UNDERLINE_HEIGHT=3,DEFAULT_BUBBLE_SIZE=48,DEFAULT_BUBBLE_LIFT=14,DEFAULT_CENTER_SIZE=48,DEFAULT_CENTER_ICON_SIZE=24,CENTER_KEY="__center_action__",EXPANDED_FLEX=1.5,SOLID_INACTIVE_OPACITY=.7,TILE_INSET=2,badgeVariantOf=e=>null==e||!1===e?null:!0===e||"·"===e?"dot":"number"==typeof e?e>0?"standard":null:e.length>0?"standard":null,badgeAccessibilitySuffix=(e,t)=>null==e||!1===e?"":"number"==typeof e?e>0?`, ${t.unread(e)}`:"":!0===e||"·"===e?`, ${t.newUpdates}`:"string"==typeof e&&e.length>0?`, ${e}`:"",BottomNavigation=forwardRef((e,t)=>{const{tabs:i,centerAction:n,activeTab:o,onChange:a,haptic:r="selection",showLabels:s=!0,variant:l="pill",indicatorPosition:d="bottom",radius:c,indicatorRadius:u="auto",elevation:p,iconSize:m,marginHorizontal:h,marginVertical:g,paddingHorizontal:b,paddingVertical:f,border:x,minimizeOnScroll:y=!1,scrollDirection:_="idle",accessory:S,style:v,indicatorStyle:w,labelStyle:A,labelMaxFontScale:E,labels:I,testID:R}=e;assertValidValue("BottomNavigation","variant",e.variant,["pill","underline","floating","bubble","expand","solid","tile"]),assertValidValue("BottomNavigation","indicatorPosition",e.indicatorPosition,["top","bottom"]);const T=useMemo(()=>I?{...DEFAULT_BOTTOM_NAVIGATION_LABELS,...I}:DEFAULT_BOTTOM_NAVIGATION_LABELS,[I]),V=useTheme(),j=useSafeAreaInsets(),L=useMemo(()=>buildStyles(V),[V]),B=m??18,D=B+4+8,M=V.space.lg,C=V.space.lg,k=V.radius.xl,N=useReducedMotion(),P=useScreenReaderEnabled(y),[z,F]=React.useState(null);useEffect(()=>{null!==z&&z!==_&&F(null)},[z,_]);const H=y&&!P&&"down"===_&&null===z,[O,W]=React.useState(H);useEffect(()=>{O!==H&&(N||"web"===Platform.OS||LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut),W(H))},[O,H,N]);const U="function"==typeof S?S({minimized:O}):S,$=null!=U&&!1!==U,X=O&&$,[G,Z]=React.useState(0),Y=$&&!X?G+V.space.xs:0,K="tile"===l,q="floating"===l||K,J="bubble"===l,Q="expand"===l,ee="solid"===l,te="pill"===l||q||ee,ie=Math.max(0,i.findIndex(e=>e.key===o)),[ne,oe]=React.useState(0),[ae,re]=React.useState(0),se=n?Math.ceil(i.length/2):i.length,le=i.length+(n?1:0),[de,ce]=React.useState({width:0,height:0}),ue=n?.size??48,pe=void 0!==n?.gap,me=Math.max(0,n?.gap??0),he=pe?(de.width||ue)+2*me:0,ge=pe?i.length>0?Math.max(0,ne-he)/i.length:0:le>0?ne/le:0,be=pe?he:ge,fe=useRef(createAnimatedValue(ie)).current,xe=useRef({}),ye=useRef({});i.forEach(e=>{xe.current[e.key]||(xe.current[e.key]=new Animated.Value(1)),ye.current[e.key]||(ye.current[e.key]=createAnimatedValue(e.key===o?1:0))});const Se=ge>0?K?Math.min(ge-4,96):Math.min(ge-M,64):0,ve=ge>0?(ge-Se)/2:0,we=ge>0?(ge-48)/2:0,hasLabel=e=>s&&!O&&!1!==e.showLabel&&e.label.trim().length>0,Ae=i[ie],Ee=Ae&&!hasLabel(Ae)&&ae>0?ae/2:V.space.xs+(B+4)/2,Ie=Ee-14-24,Re=Math.max(0,ae-4),Te=K?2:Ee-D/2,Ve=useRef(ie);useEffect(()=>{if(Ve.current===ie)return;Ve.current=ie;const e=Animated.spring(fe,{toValue:ie,tension:120,friction:14,useNativeDriver:nativeDriver});return e.start(),()=>e.stop()},[ie,fe]);const je=Math.max(1,i.length-1),Le=useMemo(()=>{const e=[],t=[];for(let i=0;i<=je;i++)e.push(i),t.push(i<se?i*ge:i*ge+be);return fe.interpolate({inputRange:e,outputRange:t})},[fe,je,se,ge,be]),Be=i.map(e=>e.key).join(" "),De=J||Q;useEffect(()=>{const e=Be.split(" ").flatMap(e=>{const t=e===o?1:0,i=ye.current[e];return i?De?[Animated.spring(i,{toValue:t,tension:140,friction:13,useNativeDriver:!1})]:(i.setValue(t),[]):[]});if(0===e.length)return;const t=Animated.parallel(e);return t.start(),()=>t.stop()},[o,Be,De]);const popIcon=e=>{Animated.sequence([Animated.timing(e,{toValue:1.15,duration:120,useNativeDriver:nativeDriver}),Animated.spring(e,{toValue:1,tension:200,friction:8,useNativeDriver:nativeDriver})]).start()},Me=useRef(new Animated.Value(1)).current,{colors:Ce}=V,ke=ee?Ce.primary:Ce.surface,Ne=ee?Ce["on-primary"]:Ce.primary,Pe=ee?Ce["on-primary"]:K?Ce["text-body"]:Ce["text-subtle"],ze=ee?Ce["on-primary"]:Ce["primary-soft"],Fe=ee?Ce.primary:J?Ce["on-primary"]:Ne,He=h??C,Oe=g??(q?C:0),We=Oe>0,Ue=f??V.space.sm,$e=b??(q?V.space.sm:V.space.xs),Xe=We?Ue:Math.max(Ue,j.bottom),Ge=We?Math.max(Oe,j.bottom>0?j.bottom+V.space.sm:0):0,Ze="pill"===c,Ye=q?ae+Y+2*Ue+2*StyleSheet.hairlineWidth:ae+Y+Ue+Xe,Ke=Ze?ae>0?Ye/2:V.radius.pill:c??(K?V.radius.pill:q?k:V.radius.none),qe=void 0!==c,activeBgRadius=(e,t)=>"number"==typeof u?Math.max(0,Math.min(u,e/2)):"auto"===u&&qe?Math.min(Ke,e/2):t,Je="underline"===l?Math.max($e,Ze&&0===ae?0:Ke):$e,Qe=p??"none",et="none"===Qe?void 0:V.shadow[Qe],tt=void 0===et?null:supportsBoxShadow()?{boxShadow:toBoxShadow(et)}:et,it=x?StyleSheet.hairlineWidth:0,nt=ee?Ce.primary:Ce.border,ot=n?.lift??0,at=Ue+it+Y,rt=n&&ae>0?Math.max(0,(de.height||ue)/2+ot-ae/2-at):0,st=n?_jsx(View,{style:[L.centerCell,pe?{flex:0,marginHorizontal:me}:null],pointerEvents:"box-none",children:_jsxs(Pressable,{onPress:()=>{if(!n)return;const e=n.haptic??r;!1!==e&&triggerHaptic(e),popIcon(Me),n.onPress()},onLayout:e=>{const{width:t,height:i}=e.nativeEvent.layout;ce(e=>e.width===t&&e.height===i?e:{width:t,height:i})},accessibilityRole:"button",accessibilityLabel:n.label,hitSlop:{top:6,bottom:6,left:6,right:6},...hitSlopMarker({top:6,bottom:6,left:6,right:6}),style:({pressed:e})=>[L.centerPressable,{top:-ot},e?{opacity:.85}:null],testID:n.testID??(R?`${R}-center`:void 0),children:[n.content?_jsx(Animated.View,{style:{transform:[{scale:Me}]},children:n.content}):_jsx(View,{style:[L.centerCircle,{width:ue,height:ue,borderRadius:V.radius.pill,...smoothCorners,backgroundColor:n.color??Ce.primary}],children:_jsx(Animated.View,{style:{transform:[{scale:Me}]},children:renderSlotIcon(n.icon??"add",{color:n.iconColor??Ce["on-primary"],size:n.iconSize??24,disabled:!1})})}),(lt=n,s&&!O&<.label.trim().length>0?_jsx(Text,{variant:"caption",numberOfLines:1,maxFontSizeMultiplier:E??V.settings.maxFontSizeMultiplier??1.2,style:[L.label,{color:Pe,opacity:ee?.7:1},A],children:n.label}):null)]})},CENTER_KEY):null;var lt;const dt=$?_jsx(View,{style:X?L.accessoryInline:L.accessoryStacked,onLayout:e=>Z(e.nativeEvent.layout.height),testID:R?`${R}-accessory`:void 0,children:U}):null,ct=_jsxs(View,{style:X?[L.tabRow,L.tabRowInline]:L.tabRow,onLayout:e=>{const{width:t,height:i}=e.nativeEvent.layout;oe(t),re(i)},children:[te&&Se>0&&(!K||Re>0)?_jsx(Animated.View,{pointerEvents:"none",style:[L.pill,{width:Se,height:K?Re:D,left:ve,top:Te,backgroundColor:ze,borderRadius:K?activeBgRadius(Re,Re/2):activeBgRadius(D,V.radius.pill),...smoothCorners,transform:[{translateX:Le}]},w]}):null,J&&ge>0?_jsx(Animated.View,{pointerEvents:"none",style:[L.bubble,V.shadow.elevated,{width:48,height:48,borderRadius:V.radius.pill,...smoothCorners,left:we,top:Ie,backgroundColor:Ce.primary,borderColor:Ce.surface,transform:[{translateX:Le}]},w]}):null,(ut=i.map(e=>{const t=e.key===o,i=t?Ne:Pe,n=t?Fe:Pe,s="string"==typeof e.icon?{name:e.icon,variant:"bold"}:e.icon,l=t?e.activeIcon??s:e.icon,d=xe.current[e.key],c=ye.current[e.key];if(void 0===d||void 0===c)throw new Error(`BottomNavigation has no animation values for tab "${e.key}".`);const u=badgeVariantOf(e.badge??null),p=badgeAccessibilitySuffix(e.badge??null,T),m=ee&&!t?.7:1,h=J&&t||ee?Ce.primary:Ce.surface,g=hasLabel(e),b=g&&(!Q||t),f=_jsxs(Animated.View,{style:[L.iconWrap,{width:B+4,height:B+4,opacity:m,transform:[{scale:d}]}],children:[_jsx(View,{accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants","aria-hidden":!0,children:renderSlotIcon(l,{color:n,size:B,focused:t,disabled:!1})}),u?_jsx(Badge,{variant:u,value:"standard"!==u||"number"!=typeof e.badge&&"string"!=typeof e.badge?void 0:e.badge,tone:"danger",accessible:!1,style:"dot"===u?L.badgeDotPosition:L.badgePillPosition,badgeStyle:["dot"===u?L.badgeDot:L.badgePill,{borderColor:h}],textStyle:L.badgeText}):null]}),x=J?_jsx(Animated.View,{style:{top:c.interpolate({inputRange:[0,1],outputRange:[0,-14]})},children:f}):f,y=b?_jsx(Animated.Text,{numberOfLines:1,maxFontSizeMultiplier:E??V.settings.maxFontSizeMultiplier??1.2,style:[L.label,Q?L.labelInline:null,{color:i,opacity:Q?c:m,fontWeight:t?V.weight.semibold:V.weight.normal},A],children:e.label}):null,S=_jsx(Pressable,{onPress:()=>(e=>{O&&F(_),e.key!==o&&!1!==r&&triggerHaptic(r);const t=xe.current[e.key];t&&popIcon(t),a(e.key)})(e),accessibilityRole:"tab",accessibilityState:{selected:t},"aria-selected":t,accessibilityLabel:`${e.label}${p}`,accessibilityHint:T.switchesTo(e.label),hitSlop:{top:6,bottom:6,left:6,right:6},...hitSlopMarker({top:6,bottom:6,left:6,right:6}),style:({pressed:e})=>[L.tab,K?L.tabTile:null,e?{opacity:.85}:null],testID:R?`${R}-tab-${e.key}`:void 0,children:Q?_jsxs(View,{style:[L.expandPill,{height:D,paddingHorizontal:t&&g?V.space.md:Math.max(0,(D-(B+4))/2)}],children:[_jsx(View,{pointerEvents:"none",style:[L.expandFill,{borderRadius:activeBgRadius(D,D/2),...smoothCorners,backgroundColor:t?Ce["primary-soft"]:"transparent"},t?w:null]}),x,y]}):_jsxs(_Fragment,{children:[x,y]})},e.key);return Q?_jsx(Animated.View,{style:{flex:c.interpolate({inputRange:[0,1],outputRange:[1,g?1.5:1]})},children:S},e.key):S}),st?[...ut.slice(0,se),st,...ut.slice(se)]:ut),"underline"===l&&ge>0?_jsx(Animated.View,{pointerEvents:"none",style:[L.underline,"top"===d?L.underlineTop:L.underlineBottom,"top"===d?{top:-Ue-Y}:{bottom:-Ue},{width:ge,height:3,backgroundColor:Ce.primary,transform:[{translateX:Le}]},w]}):null]});var ut;return _jsx(View,{ref:t,testID:R,accessibilityRole:"tablist",style:[L.outer,{paddingHorizontal:He,paddingTop:Math.max(Oe,rt),paddingBottom:Ge},v],children:_jsxs(View,{style:[q?L.floatingBar:L.dockedBar,X?L.barInline:null,tt,{backgroundColor:ke,borderColor:nt,borderRadius:Ke,...smoothCorners},q?{borderWidth:it,paddingHorizontal:$e,paddingVertical:Ue}:{borderTopWidth:it,borderBottomWidth:it,borderLeftWidth:it,borderRightWidth:it,paddingHorizontal:Je,paddingTop:Ue,paddingBottom:Xe}],children:[dt,ct]})})});BottomNavigation.displayName="BottomNavigation";const buildStyles=e=>StyleSheet.create({outer:{backgroundColor:"transparent"},dockedBar:{paddingHorizontal:e.space.xs},floatingBar:{paddingVertical:e.space.sm,paddingHorizontal:e.space.sm},tabRow:{flexDirection:"row",alignItems:"stretch",position:"relative"},tabRowInline:{flex:1},barInline:{flexDirection:"row",alignItems:"center"},accessoryStacked:{marginBottom:e.space.xs},accessoryInline:{flexShrink:0,marginRight:e.space.xs},tab:{flex:1,minHeight:44,alignItems:"center",justifyContent:"center",paddingVertical:e.space.xs,gap:e.space.xs},tabTile:{paddingVertical:e.space.sm,gap:e.space.xxs},centerCell:{flex:1,minHeight:44,alignItems:"center",justifyContent:"center"},centerPressable:{alignItems:"center",maxWidth:"100%",gap:e.space.xs},centerCircle:{alignItems:"center",justifyContent:"center"},iconWrap:{alignItems:"center",justifyContent:"center",position:"relative"},label:{fontSize:e.text.xs.size,lineHeight:e.text.xs.size*e.leading.heading,textAlign:"center",includeFontPadding:!1},labelInline:{fontSize:e.text.sm.size,lineHeight:e.text.sm.size*e.leading.heading,flexShrink:1,includeFontPadding:!1},expandPill:{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:e.space.xs},expandFill:{position:"absolute",top:0,right:0,bottom:0,left:0,overflow:"hidden"},pill:{position:"absolute",left:0},bubble:{position:"absolute",left:0,borderWidth:3},underline:{position:"absolute",left:0,height:3},underlineBottom:{borderTopLeftRadius:e.radius.none,borderTopRightRadius:e.radius.none,...smoothCorners},underlineTop:{borderBottomLeftRadius:e.radius.none,borderBottomRightRadius:e.radius.none,...smoothCorners},badgePillPosition:{position:"absolute",top:-4,right:-8},badgePill:{minWidth:18,height:18,paddingHorizontal:e.space.xs,paddingVertical:e.space.xxs,borderWidth:1.5},badgeDotPosition:{position:"absolute",top:-2,right:-2},badgeDot:{width:10,height:10,borderRadius:e.radius.pill,borderWidth:1.5},badgeText:{lineHeight:Math.round(e.text.xs.size*e.leading.heading)}});export{BottomNavigation};export default BottomNavigation;
|
|
1
|
+
"use strict";import React,{forwardRef,useEffect,useMemo,useRef}from"react";import{Animated,LayoutAnimation,Platform,Pressable,StyleSheet,View}from"react-native";import{useSafeAreaInsets}from"react-native-safe-area-context";import{useReducedMotion}from"../../hooks/useReducedMotion.js";import{fillText,useMobileUiText}from"../../text/index.js";import{BOTTOM_NAVIGATION_TEXT}from"../../text/phone/bottomNavigation.g.js";import{createAnimatedValue,useTheme}from"../../theme/index.js";import{triggerHaptic}from"../../utils/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{smoothCorners}from"../../utils/corners.js";import{hitSlopMarker}from"../../utils/hitSlop.js";import{nativeDriver}from"../../utils/nativeDriver.js";import{supportsBoxShadow,toBoxShadow}from"../../utils/shadows.js";import{renderSlotIcon}from"../AppIcon/index.js";import{Badge}from"../Badge/index.js";import{Text}from"../Text/index.js";import{useScreenReaderEnabled}from"./useScreenReaderEnabled.js";import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from"react/jsx-runtime";const DEFAULT_ICON_SIZE=18,DEFAULT_LABEL_MAX_FONT_SCALE=1.2,ICON_WRAP_AIR=4,PILL_AIR=8,DEFAULT_PILL_MAX_WIDTH=64,TILE_MAX_WIDTH=96,DEFAULT_UNDERLINE_HEIGHT=3,DEFAULT_BUBBLE_SIZE=48,DEFAULT_BUBBLE_LIFT=14,DEFAULT_CENTER_SIZE=48,DEFAULT_CENTER_ICON_SIZE=24,CENTER_KEY="__center_action__",EXPANDED_FLEX=1.5,SOLID_INACTIVE_OPACITY=.7,TILE_INSET=2,badgeVariantOf=e=>null==e||!1===e?null:!0===e||"·"===e?"dot":"number"==typeof e?e>0?"standard":null:e.length>0?"standard":null,badgeAccessibilitySuffix=(e,t)=>null==e||!1===e?"":"number"==typeof e?e>0?`, ${fillText(t.unread,{count:e})}`:"":!0===e||"·"===e?`, ${t.newUpdates}`:"string"==typeof e&&e.length>0?`, ${e}`:"",BottomNavigation=forwardRef((e,t)=>{const{tabs:i,centerAction:o,activeTab:n,onChange:a,haptic:r="selection",showLabels:s=!0,variant:l="pill",indicatorPosition:d="bottom",radius:c,indicatorRadius:u="auto",elevation:p,iconSize:m,marginHorizontal:h,marginVertical:g,paddingHorizontal:b,paddingVertical:f,border:x,minimizeOnScroll:y=!1,scrollDirection:v="idle",accessory:_,style:S,indicatorStyle:w,labelStyle:E,labelMaxFontScale:I,labels:R,testID:T}=e;assertValidValue("BottomNavigation","variant",e.variant,["pill","underline","floating","bubble","expand","solid","tile"]),assertValidValue("BottomNavigation","indicatorPosition",e.indicatorPosition,["top","bottom"]);const A=useMobileUiText("bottomNavigation",BOTTOM_NAVIGATION_TEXT),j=useMemo(()=>R?{...A,...R}:A,[A,R]),V=useTheme(),M=useSafeAreaInsets(),C=useMemo(()=>buildStyles(V),[V]),L=m??18,D=L+4+8,B=V.space.lg,k=V.space.lg,N=V.radius.xl,P=useReducedMotion(),z=useScreenReaderEnabled(y),[F,H]=React.useState(null);useEffect(()=>{null!==F&&F!==v&&H(null)},[F,v]);const O=y&&!z&&"down"===v&&null===F,[W,U]=React.useState(O);useEffect(()=>{W!==O&&(P||"web"===Platform.OS||LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut),U(O))},[W,O,P]);const X="function"==typeof _?_({minimized:W}):_,$=null!=X&&!1!==X,Z=W&&$,[G,Y]=React.useState(0),K=$&&!Z?G+V.space.xs:0,q="tile"===l,J="floating"===l||q,Q="bubble"===l,ee="expand"===l,te="solid"===l,ie="pill"===l||J||te,oe=Math.max(0,i.findIndex(e=>e.key===n)),[ne,ae]=React.useState(0),[re,se]=React.useState(0),le=o?Math.ceil(i.length/2):i.length,de=i.length+(o?1:0),[ce,ue]=React.useState({width:0,height:0}),pe=o?.size??48,me=void 0!==o?.gap,he=Math.max(0,o?.gap??0),ge=me?(ce.width||pe)+2*he:0,be=me?i.length>0?Math.max(0,ne-ge)/i.length:0:de>0?ne/de:0,fe=me?ge:be,xe=useRef(createAnimatedValue(oe)).current,ye=useRef({}),ve=useRef({});i.forEach(e=>{ye.current[e.key]||(ye.current[e.key]=new Animated.Value(1)),ve.current[e.key]||(ve.current[e.key]=createAnimatedValue(e.key===n?1:0))});const Se=be>0?q?Math.min(be-4,96):Math.min(be-B,64):0,we=be>0?(be-Se)/2:0,Ee=be>0?(be-48)/2:0,hasLabel=e=>s&&!W&&!1!==e.showLabel&&e.label.trim().length>0,Ie=i[oe],Re=Ie&&!hasLabel(Ie)&&re>0?re/2:V.space.xs+(L+4)/2,Te=Re-14-24,Ae=Math.max(0,re-4),je=q?2:Re-D/2,Ve=useRef(oe);useEffect(()=>{if(Ve.current===oe)return;Ve.current=oe;const e=Animated.spring(xe,{toValue:oe,tension:120,friction:14,useNativeDriver:nativeDriver});return e.start(),()=>e.stop()},[oe,xe]);const Me=Math.max(1,i.length-1),Ce=useMemo(()=>{const e=[],t=[];for(let i=0;i<=Me;i++)e.push(i),t.push(i<le?i*be:i*be+fe);return xe.interpolate({inputRange:e,outputRange:t})},[xe,Me,le,be,fe]),Le=i.map(e=>e.key).join(" "),De=Q||ee;useEffect(()=>{const e=Le.split(" ").flatMap(e=>{const t=e===n?1:0,i=ve.current[e];return i?De?[Animated.spring(i,{toValue:t,tension:140,friction:13,useNativeDriver:!1})]:(i.setValue(t),[]):[]});if(0===e.length)return;const t=Animated.parallel(e);return t.start(),()=>t.stop()},[n,Le,De]);const popIcon=e=>{Animated.sequence([Animated.timing(e,{toValue:1.15,duration:120,useNativeDriver:nativeDriver}),Animated.spring(e,{toValue:1,tension:200,friction:8,useNativeDriver:nativeDriver})]).start()},Be=useRef(new Animated.Value(1)).current,{colors:ke}=V,Ne=te?ke.primary:ke.surface,Pe=te?ke["on-primary"]:ke.primary,ze=te?ke["on-primary"]:q?ke["text-body"]:ke["text-subtle"],Fe=te?ke["on-primary"]:ke["primary-soft"],He=te?ke.primary:Q?ke["on-primary"]:Pe,Oe=h??k,We=g??(J?k:0),Ue=We>0,Xe=f??V.space.sm,$e=b??(J?V.space.sm:V.space.xs),Ze=Ue?Xe:Math.max(Xe,M.bottom),Ge=Ue?Math.max(We,M.bottom>0?M.bottom+V.space.sm:0):0,Ye="pill"===c,Ke=J?re+K+2*Xe+2*StyleSheet.hairlineWidth:re+K+Xe+Ze,qe=Ye?re>0?Ke/2:V.radius.pill:c??(q?V.radius.pill:J?N:V.radius.none),Je=void 0!==c,activeBgRadius=(e,t)=>"number"==typeof u?Math.max(0,Math.min(u,e/2)):"auto"===u&&Je?Math.min(qe,e/2):t,Qe="underline"===l?Math.max($e,Ye&&0===re?0:qe):$e,et=p??"none",tt="none"===et?void 0:V.shadow[et],it=void 0===tt?null:supportsBoxShadow()?{boxShadow:toBoxShadow(tt)}:tt,ot=x?StyleSheet.hairlineWidth:0,nt=te?ke.primary:ke.border,at=o?.lift??0,rt=Xe+ot+K,st=o&&re>0?Math.max(0,(ce.height||pe)/2+at-re/2-rt):0,lt=o?_jsx(View,{style:[C.centerCell,me?{flex:0,marginHorizontal:he}:null],pointerEvents:"box-none",children:_jsxs(Pressable,{onPress:()=>{if(!o)return;const e=o.haptic??r;!1!==e&&triggerHaptic(e),popIcon(Be),o.onPress()},onLayout:e=>{const{width:t,height:i}=e.nativeEvent.layout;ue(e=>e.width===t&&e.height===i?e:{width:t,height:i})},accessibilityRole:"button",accessibilityLabel:o.label,hitSlop:{top:6,bottom:6,left:6,right:6},...hitSlopMarker({top:6,bottom:6,left:6,right:6}),style:({pressed:e})=>[C.centerPressable,{top:-at},e?{opacity:.85}:null],testID:o.testID??(T?`${T}-center`:void 0),children:[o.content?_jsx(Animated.View,{style:{transform:[{scale:Be}]},children:o.content}):_jsx(View,{style:[C.centerCircle,{width:pe,height:pe,borderRadius:V.radius.pill,...smoothCorners,backgroundColor:o.color??ke.primary}],children:_jsx(Animated.View,{style:{transform:[{scale:Be}]},children:renderSlotIcon(o.icon??"add",{color:o.iconColor??ke["on-primary"],size:o.iconSize??24,disabled:!1})})}),(dt=o,s&&!W&&dt.label.trim().length>0?_jsx(Text,{variant:"caption",numberOfLines:1,maxFontSizeMultiplier:I??V.settings.maxFontSizeMultiplier??1.2,style:[C.label,{color:ze,opacity:te?.7:1},E],children:o.label}):null)]})},CENTER_KEY):null;var dt;const ct=$?_jsx(View,{style:Z?C.accessoryInline:C.accessoryStacked,onLayout:e=>Y(e.nativeEvent.layout.height),testID:T?`${T}-accessory`:void 0,children:X}):null,ut=_jsxs(View,{style:Z?[C.tabRow,C.tabRowInline]:C.tabRow,onLayout:e=>{const{width:t,height:i}=e.nativeEvent.layout;ae(t),se(i)},children:[ie&&Se>0&&(!q||Ae>0)?_jsx(Animated.View,{pointerEvents:"none",style:[C.pill,{width:Se,height:q?Ae:D,left:we,top:je,backgroundColor:Fe,borderRadius:q?activeBgRadius(Ae,Ae/2):activeBgRadius(D,V.radius.pill),...smoothCorners,transform:[{translateX:Ce}]},w]}):null,Q&&be>0?_jsx(Animated.View,{pointerEvents:"none",style:[C.bubble,V.shadow.elevated,{width:48,height:48,borderRadius:V.radius.pill,...smoothCorners,left:Ee,top:Te,backgroundColor:ke.primary,borderColor:ke.surface,transform:[{translateX:Ce}]},w]}):null,(pt=i.map(e=>{const t=e.key===n,i=t?Pe:ze,o=t?He:ze,s="string"==typeof e.icon?{name:e.icon,variant:"bold"}:e.icon,l=t?e.activeIcon??s:e.icon,d=ye.current[e.key],c=ve.current[e.key];if(void 0===d||void 0===c)throw new Error(`BottomNavigation has no animation values for tab "${e.key}".`);const u=badgeVariantOf(e.badge??null),p=badgeAccessibilitySuffix(e.badge??null,j),m=te&&!t?.7:1,h=Q&&t||te?ke.primary:ke.surface,g=hasLabel(e),b=g&&(!ee||t),f=_jsxs(Animated.View,{style:[C.iconWrap,{width:L+4,height:L+4,opacity:m,transform:[{scale:d}]}],children:[_jsx(View,{accessibilityElementsHidden:!0,importantForAccessibility:"no-hide-descendants","aria-hidden":!0,children:renderSlotIcon(l,{color:o,size:L,focused:t,disabled:!1})}),u?_jsx(Badge,{variant:u,value:"standard"!==u||"number"!=typeof e.badge&&"string"!=typeof e.badge?void 0:e.badge,tone:"danger",accessible:!1,style:"dot"===u?C.badgeDotPosition:C.badgePillPosition,badgeStyle:["dot"===u?C.badgeDot:C.badgePill,{borderColor:h}],textStyle:C.badgeText}):null]}),x=Q?_jsx(Animated.View,{style:{top:c.interpolate({inputRange:[0,1],outputRange:[0,-14]})},children:f}):f,y=b?_jsx(Animated.Text,{numberOfLines:1,maxFontSizeMultiplier:I??V.settings.maxFontSizeMultiplier??1.2,style:[C.label,ee?C.labelInline:null,{color:i,opacity:ee?c:m,fontWeight:t?V.weight.semibold:V.weight.normal},E],children:e.label}):null,_=_jsx(Pressable,{onPress:()=>(e=>{W&&H(v),e.key!==n&&!1!==r&&triggerHaptic(r);const t=ye.current[e.key];t&&popIcon(t),a(e.key)})(e),accessibilityRole:"tab",accessibilityState:{selected:t},"aria-selected":t,accessibilityLabel:`${e.label}${p}`,accessibilityHint:fillText(j.switchesTo,{label:e.label}),hitSlop:{top:6,bottom:6,left:6,right:6},...hitSlopMarker({top:6,bottom:6,left:6,right:6}),style:({pressed:e})=>[C.tab,q?C.tabTile:null,e?{opacity:.85}:null],testID:T?`${T}-tab-${e.key}`:void 0,children:ee?_jsxs(View,{style:[C.expandPill,{height:D,paddingHorizontal:t&&g?V.space.md:Math.max(0,(D-(L+4))/2)}],children:[_jsx(View,{pointerEvents:"none",style:[C.expandFill,{borderRadius:activeBgRadius(D,D/2),...smoothCorners,backgroundColor:t?ke["primary-soft"]:"transparent"},t?w:null]}),x,y]}):_jsxs(_Fragment,{children:[x,y]})},e.key);return ee?_jsx(Animated.View,{style:{flex:c.interpolate({inputRange:[0,1],outputRange:[1,g?1.5:1]})},children:_},e.key):_}),lt?[...pt.slice(0,le),lt,...pt.slice(le)]:pt),"underline"===l&&be>0?_jsx(Animated.View,{pointerEvents:"none",style:[C.underline,"top"===d?C.underlineTop:C.underlineBottom,"top"===d?{top:-Xe-K}:{bottom:-Xe},{width:be,height:3,backgroundColor:ke.primary,transform:[{translateX:Ce}]},w]}):null]});var pt;return _jsx(View,{ref:t,testID:T,accessibilityRole:"tablist",style:[C.outer,{paddingHorizontal:Oe,paddingTop:Math.max(We,st),paddingBottom:Ge},S],children:_jsxs(View,{style:[J?C.floatingBar:C.dockedBar,Z?C.barInline:null,it,{backgroundColor:Ne,borderColor:nt,borderRadius:qe,...smoothCorners},J?{borderWidth:ot,paddingHorizontal:$e,paddingVertical:Xe}:{borderTopWidth:ot,borderBottomWidth:ot,borderLeftWidth:ot,borderRightWidth:ot,paddingHorizontal:Qe,paddingTop:Xe,paddingBottom:Ze}],children:[ct,ut]})})});BottomNavigation.displayName="BottomNavigation";const buildStyles=e=>StyleSheet.create({outer:{backgroundColor:"transparent"},dockedBar:{paddingHorizontal:e.space.xs},floatingBar:{paddingVertical:e.space.sm,paddingHorizontal:e.space.sm},tabRow:{flexDirection:"row",alignItems:"stretch",position:"relative"},tabRowInline:{flex:1},barInline:{flexDirection:"row",alignItems:"center"},accessoryStacked:{marginBottom:e.space.xs},accessoryInline:{flexShrink:0,marginRight:e.space.xs},tab:{flex:1,minHeight:44,alignItems:"center",justifyContent:"center",paddingVertical:e.space.xs,gap:e.space.xs},tabTile:{paddingVertical:e.space.sm,gap:e.space.xxs},centerCell:{flex:1,minHeight:44,alignItems:"center",justifyContent:"center"},centerPressable:{alignItems:"center",maxWidth:"100%",gap:e.space.xs},centerCircle:{alignItems:"center",justifyContent:"center"},iconWrap:{alignItems:"center",justifyContent:"center",position:"relative"},label:{fontSize:e.text.xs.size,lineHeight:e.text.xs.size*e.leading.heading,textAlign:"center",includeFontPadding:!1},labelInline:{fontSize:e.text.sm.size,lineHeight:e.text.sm.size*e.leading.heading,flexShrink:1,includeFontPadding:!1},expandPill:{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:e.space.xs},expandFill:{position:"absolute",top:0,right:0,bottom:0,left:0,overflow:"hidden"},pill:{position:"absolute",left:0},bubble:{position:"absolute",left:0,borderWidth:3},underline:{position:"absolute",left:0,height:3},underlineBottom:{borderTopLeftRadius:e.radius.none,borderTopRightRadius:e.radius.none,...smoothCorners},underlineTop:{borderBottomLeftRadius:e.radius.none,borderBottomRightRadius:e.radius.none,...smoothCorners},badgePillPosition:{position:"absolute",top:-4,right:-8},badgePill:{minWidth:18,height:18,paddingHorizontal:e.space.xs,paddingVertical:e.space.xxs,borderWidth:1.5},badgeDotPosition:{position:"absolute",top:-2,right:-2},badgeDot:{width:10,height:10,borderRadius:e.radius.pill,borderWidth:1.5},badgeText:{lineHeight:Math.round(e.text.xs.size*e.leading.heading)}});export{BottomNavigation};export default BottomNavigation;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";export{BottomNavigation,
|
|
1
|
+
"use strict";export{BottomNavigation,default}from"./BottomNavigation.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{createContext,useCallback,useContext,useEffect,useMemo,useRef,useState}from"react";import{Dimensions,Keyboard,Platform,ScrollView,StyleSheet,useWindowDimensions,View}from"react-native";import{GestureDetector,GestureHandlerRootView,useNativeGesture,usePanGesture,useTapGesture}from"react-native-gesture-handler";import{useReanimatedKeyboardAnimation}from"react-native-keyboard-controller";import Animated,{Easing,useAnimatedStyle,useDerivedValue,useSharedValue,withSpring,withTiming}from"react-native-reanimated";import{useSafeAreaInsets}from"react-native-safe-area-context";import{scheduleOnRN}from"react-native-worklets";import{PRESENCE_REDUCE_MOTION,usePresenceMotion}from"../../hooks/usePresenceMotion.js";import{useTheme}from"../../theme/index.js";import{triggerHaptic}from"../../utils/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{transparentOf}from"../../utils/color.js";import{smoothCorners}from"../../utils/corners.js";import{ACTIONS_LAYOUTS,OverlayActions}from"../Dialog/OverlayActions.js";import{Modal}from"../Modal/Modal.js";import{useModalInsets}from"../ModalSafeArea/ModalSafeArea.js";import{Text}from"../Text/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export const DEFAULT_BOTTOM_SHEET_LABELS=Object.freeze({close:"Close bottom sheet",dragHandle:"Drag handle"});const DEFAULT_SNAP_POINTS=["content"],TABLET_MIN_SHORT_SIDE=600,DIALOG_MAX_WIDTH=560,BottomSheetContext=createContext(null);export const useBottomSheet=()=>{const e=useContext(BottomSheetContext);if(!e)throw new Error("[@webority/mobile-ui] BottomSheet: useBottomSheet must be used inside a <BottomSheet>.");return e};const SPRING_CONFIG={damping:20,stiffness:240,mass:1},CLOSE_VELOCITY_THRESHOLD=1e3,DRAG_ACTIVATION_OFFSET=10,BottomSheet=e=>{const{snapPoints:t=DEFAULT_SNAP_POINTS,open:o,onClose:s,snapIndex:r,onSnapChange:a,onAnimate:n,onAfterClose:l,enablePanDownToClose:i=!0,enableBackdropPress:u=!0,onBeforeClose:c,title:d,labels:h,scrollable:m=!1,scrollRef:f,onScroll:p,onContentSizeChange:b,onScrollLayout:S,scrollEventThrottle:v,keyboardBehavior:y="shift",inline:g=!1,presentation:x="sheet",animateMount:w=!0,handleIndicatorStyle:C,containerStyle:M,header:R,actions:_,actionsLayout:O="auto",footer:k,headerStyle:E,footerStyle:T,children:A,accessibilityLabel:I,accessibilityViewIsModal:j,testID:V}=e;assertValidValue("BottomSheet","presentation",e.presentation,["sheet","dialog","auto"]),assertValidValue("BottomSheet","keyboardBehavior",e.keyboardBehavior,["none","shift"]),assertValidValue("BottomSheet","actionsLayout",e.actionsLayout,ACTIONS_LAYOUTS);const D=useMemo(()=>({...DEFAULT_BOTTOM_SHEET_LABELS,...h}),[h]),N=null!=R||null!=d,B=null!=_&&_.length>0,L=null!=k||B,P=g?"inline":"modal",H=useTheme(),G=usePresenceMotion(),F=useSafeAreaInsets(),[U,z]=useState(()=>Dimensions.get("window").height),[Y,K]=useState(()=>Dimensions.get("window").width),$=useCallback(e=>{const{height:t,width:o}=e.nativeEvent.layout;t>0&&z(e=>e===t?e:t),o>0&&K(e=>e===o?e:o)},[]),W=useWindowDimensions(),X="dialog"===x||"auto"===x&&Math.min(W.width,W.height)>=600,q=Math.min(560,Y-2*H.space.xl),[J,Q]=useModalInsets(),Z="modal"===P?J.top:F.top,ee="modal"===P?J.bottom:F.bottom,te=t.includes("content"),[oe,se]=useMeasuredHeight(),[re,ae]=useMeasuredHeight(),[ne,le,ie]=useMeasuredHeight(),[ue,ce]=useMeasuredHeight(),de=X?H.space.md:oe,he=te?Math.min(de+(N?re:0)+ne+(L?ue:0)+ee,U-Z):0,me=useCallback((e,t)=>{te&&ie(t),b?.(e,t)},[te,b,ie]),fe=useMemo(()=>resolveSnapPoints(t,U,he),[t,U,he]),pe=U,be=fe[fe.length-1]??0,Se=useSharedValue(pe),ve=useSharedValue(pe),ye=useSharedValue(1),ge=useSharedValue(-1),[xe,we]=useState(-1),Ce=useRef(!1),[Me,Re]=useState(!1),[Oe,ke]=useState(!1),Ee=useRef(!1),Te=useRef(l);Te.current=l;const[Ae,Ie]=useState(!1),je=useRef(!w&&o),Ve=useRef(-1),De=useRef(!1);De.current="modal"===P?Oe:Ae;const Ne=useRef(c);Ne.current=c;const Be=useRef(s);Be.current=s;const Le=useRef(!1),Pe=useRef(!0),He=useRef([]),Ge=useCallback(e=>{const t=He.current;He.current=[];for(const o of t)o(e)},[]);useEffect(()=>(Pe.current=!0,()=>{Pe.current=!1,Ge(!1)}),[Ge]);const Fe=useCallback(e=>{if(e<0||e>=fe.length)return pe;const t=fe[e];if(void 0===t)throw new Error("BottomSheet: an in-range snap index always has a resolved snap point");return X?(U-t)/2:U-t},[fe,U,pe,X]),Ue=useCallback(e=>{Ve.current=e;xe!==e&&(we(e),ge.value=e,e>=0&&a?.(e))},[xe,ge,a]),ze=useCallback(()=>{Ce.current=!1,ge.value<0&&(Ee.current=!0,"modal"===P?(Re(!1),"ios"!==Platform.OS&&ke(!1)):Ie(!1))},[P,ge]),Ye=useCallback(()=>{Ee.current&&ke(!1)},[]);useEffect(()=>{("modal"===P?!Oe:!Ae)&&Ee.current&&(Ee.current=!1,Te.current?.(),Ge(!0))},[P,Oe,Ae,Ge]);const Ke=useCallback((e,t,o)=>{Ce.current=!0,n?.(t,o),Se.value=withSpring(e,SPRING_CONFIG,e=>{"worklet";e&&scheduleOnRN(ze)})},[n,Se,ze]),$e=useCallback(e=>{const t="number"==typeof e?clamp(e,0,fe.length-1):Math.max(xe,0),o=ge.value,s=Fe(t);return Ee.current=!1,Ge(!1),"modal"===P?(ke(!0),Re(!0)):Ie(!0),o<0&&je.current?(Se.value=s,ye.value=1,Ue(t),void n?.(o,t)):o<0&&G.reduced?(Se.value=s,ye.value=0,ye.value=withTiming(1,{duration:G.duration("fast"),easing:Easing.bezier(...H.motion.ease.decelerate),reduceMotion:PRESENCE_REDUCE_MOTION}),Ue(t),void n?.(o,t)):(o<0&&(Se.value=pe,ye.value=1),Ue(t),void Ke(s,o,t))},[Ke,pe,xe,ge,P,n,G,ye,fe.length,Ue,Ge,H.motion.ease.decelerate,Se,Fe]),We=useCallback(()=>new Promise(e=>{if(Ve.current<0)return void(De.current?He.current.push(e):e(!0));He.current.push(e),je.current=!1;const t=ge.value;Ue(-1),Ce.current=!0,n?.(t,-1);const o=G.reduced?ye:Se,s=G.reduced?0:pe;o.value=withTiming(s,{duration:G.duration("fast"),easing:Easing.bezier(...H.motion.ease.accelerate),reduceMotion:PRESENCE_REDUCE_MOTION},e=>{"worklet";e&&scheduleOnRN(ze)})}),[pe,ge,ze,n,G,ye,Ue,Se,H.motion.ease.accelerate]),Xe=useCallback((e,t,o)=>{const s=Ne.current;if(!s)return void e();if(Le.current)return void t?.();const r=s();"boolean"!=typeof r?(Le.current=!0,o?.(),r.then(o=>{Le.current=!1,o&&Pe.current&&Ve.current>=0?e():t?.()},e=>{throw Le.current=!1,e})):(r?e:t)?.()},[]),qe=useCallback(()=>new Promise(e=>{Ve.current<0?e(!0):Xe(()=>{Be.current(),We(),e(!0)},()=>e(!1))}),[We,Xe]),Je=useCallback(()=>{Be.current()},[]),Qe=useCallback(()=>{u&&qe()},[u,qe]),Ze=useRef(null),et=useRef($e);et.current=$e;const tt=useRef(We);tt.current=We,useEffect(()=>{const e=Ze.current!==o;Ze.current=o,e?o?et.current(r??0):tt.current():o&&"number"==typeof r&&r!==ge.value&&et.current(r)},[o,r,ge]);const ot=useRef({hostHeight:U,contentSnap:he}),st=useRef(Fe);st.current=Fe,useEffect(()=>{const e=ot.current;if(e.hostHeight===U&&e.contentSnap===he)return;if(ot.current={hostHeight:U,contentSnap:he},e.hostHeight===U&&ge.value<0)return;const t=st.current(ge.value);Se.value=je.current?t:withSpring(t,SPRING_CONFIG)},[U,he,ge,Se]);const rt=U-be,at=useMemo(()=>fe.map(e=>U-e),[fe,U]),nt=useCallback(()=>{const e=Ve.current;e<0||Ke(Fe(e),e,e)},[Ke,Fe]),lt=useCallback((e,t)=>{const o=ge.value;-1!==e?(Ue(e),Ke(t,o,e)):Xe(()=>{Keyboard.dismiss(),triggerHaptic("selection"),Be.current(),We()},nt,nt)},[Ke,We,ge,Xe,Ue,nt]),it=useMemo(()=>({testID:V?`${V}-content-gesture`:"bottom-sheet-content-gesture"}),[V]),ut=useNativeGesture(it),ct=useMemo(()=>{const e=at,t=pe,o=rt,s=i;return{testID:V?`${V}-pan-gesture`:"bottom-sheet-pan-gesture",activeOffsetY:[-10,10],failOffsetX:[-15,15],onActivate:()=>{"worklet";ve.value=Se.value},onUpdate:e=>{"worklet";const t=ve.value+e.translationY;Se.value=t<o?o+.25*(t-o):t},onDeactivate:o=>{"worklet";const r=Se.value,a=o.velocityY,[n]=e;if(void 0===n)return void scheduleOnRN(lt,-1,t);if(a>1e3)return s?void scheduleOnRN(lt,-1,t):void scheduleOnRN(lt,0,n);let l=0,i=n,u=1/0,c=0;for(const t of e){const e=Math.abs(r-t);e<u&&(u=e,i=t,l=c),c++}s&&r-n>80?scheduleOnRN(lt,-1,t):scheduleOnRN(lt,l,i)}}},[pe,ve,i,lt,rt,at,V,Se]),dt=usePanGesture(ct),{height:ht}=useReanimatedKeyboardAnimation(),mt="shift"===y,ft=useDerivedValue(()=>mt?ht.value:0,[mt,ht]),pt=fe[Math.max(xe,0)]??be,bt=H.space.md,St=useAnimatedStyle(()=>{if(X){const e=ft.value,t=U+e-pt-bt,o=e<0&&Se.value>t?t:Se.value;return{top:Math.max(o,Z),opacity:ye.value}}const e=Se.value+ft.value,t=ft.value<0?Z:rt;return{top:Math.max(e,t),opacity:ye.value}},[X,ft,U,pt,bt,Se,Z,ye,rt]),vt=useAnimatedStyle(()=>{const e=ft.value;if(X){const t=U+e-pt-bt,o=e<0&&Se.value>t?t:Se.value,s=Math.max(o,Z),r=U+e-bt-s;return{height:r<0?0:Math.min(r,pt)}}const t=e<0?Z:rt,o=Se.value+e,s=Math.max(o,t),r=U+e-s;return{height:r<0?0:Math.min(r,be)}},[ft,X,U,pt,bt,Se,Z,rt,be]),yt=xe>=0,gt=useMemo(()=>buildStyles(H),[H]),xt=useCallback(()=>{u&&Xe(()=>{triggerHaptic("selection"),Be.current(),We()})},[u,We,Xe]),wt=useMemo(()=>({testID:V?`${V}-backdrop-gesture`:"bottom-sheet-backdrop-gesture",maxDuration:250,onDeactivate:e=>{"worklet";e.canceled||scheduleOnRN(xt)}}),[xt,V]),Ct=useTapGesture(wt),Mt=useMemo(()=>({snapIndex:xe,snapPoints:fe,close:Je,requestClose:qe}),[xe,fe,Je,qe]);if("inline"===P&&!Ae)return null;if("modal"===P&&!Oe)return null;const Rt=_jsxs(View,{collapsable:!1,style:["modal"===P?gt.backdropModal:gt.backdropInline,{backgroundColor:"modal"===P?transparentOf(H.colors.scrim):H.colors.scrim}],onLayout:$,testID:V,accessibilityViewIsModal:j??yt,children:[_jsx(GestureDetector,{gesture:Ct,children:_jsx(Animated.View,{style:StyleSheet.absoluteFill,accessibilityRole:"button",accessibilityLabel:D.close})}),_jsx(Animated.View,{accessibilityRole:"alert",accessibilityLabel:I,accessibilityViewIsModal:j??yt,accessibilityActions:[{name:"escape",label:D.close}],onAccessibilityAction:e=>{"escape"===e.nativeEvent.actionName&&Qe()},onAccessibilityEscape:Qe,style:[gt.sheet,{height:be,backgroundColor:H.colors.surface,borderTopLeftRadius:H.radius.xl,borderTopRightRadius:H.radius.xl,...smoothCorners,...H.shadow.modal},X?{height:pt,left:(Y-q)/2,right:void 0,width:q,borderBottomLeftRadius:H.radius.xl,borderBottomRightRadius:H.radius.xl}:null,M,St],children:_jsxs(SheetBody,{style:[gt.body,vt],keyboardOffset:ft,children:[X?_jsx(View,{style:{height:H.space.md}}):_jsx(GestureDetector,{gesture:dt,children:_jsx(View,{style:gt.handleRow,onLayout:te?se:void 0,accessible:!0,accessibilityLabel:D.dragHandle,accessibilityHint:"Drag up or down to resize the sheet, or swipe down to close it",testID:V?`${V}-handle`:"bottom-sheet-handle",children:_jsx(View,{style:[gt.handle,{backgroundColor:H.colors.border},C]})})}),N&&_jsxs(View,{style:[gt.header,E],onLayout:te?ae:void 0,children:[null!=d?_jsx(Text,{variant:"title",accessibilityRole:"header",children:d}):null,R]}),m?_jsx(GestureDetector,{gesture:ut,children:_jsx(ScrollView,{ref:f,style:gt.scrollContent,onScroll:p,onContentSizeChange:me,onLayout:S,scrollEventThrottle:v,keyboardShouldPersistTaps:"always",keyboardDismissMode:"none",children:A})}):_jsx(View,{style:te?[gt.content,{overflow:"visible"}]:gt.content,children:te?_jsx(View,{onLayout:le,children:A}):A}),L&&_jsxs(View,{style:[gt.footer,T],onLayout:te?ce:void 0,children:[B?_jsx(View,{style:gt.actions,children:_jsx(OverlayActions,{actions:_??[],layout:O})}):null,k]})]})})]}),_t=_jsx(BottomSheetContext.Provider,{value:Mt,children:Rt});return"modal"===P?_jsx(Modal,{open:Me,onClose:Qe,presentation:"fullScreen",bare:!0,backdropPressClose:!1,haptic:!1,animateMount:!1,onInsetsChange:Q,onDismissed:"ios"===Platform.OS?Ye:void 0,children:"android"===Platform.OS?_jsx(GestureHandlerRootView,{style:gt.modalRoot,children:_t}):_t}):_t},SheetBody=({style:e,keyboardOffset:t,children:o})=>{const s=useSafeAreaInsets().bottom,r=useAnimatedStyle(()=>{const e=s+t.value;return{paddingBottom:Math.max(e,0)}},[s,t]);return _jsx(Animated.View,{style:[e,r],children:o})};BottomSheet.displayName="BottomSheet";const useMeasuredHeight=()=>{const[e,t]=useState(0),o=useCallback(e=>{t(t=>t===e?t:e)},[]);return[e,useCallback(e=>o(e.nativeEvent.layout.height),[o]),o]},resolveSnapPoints=(e,t,o)=>[...e.map(e=>{if("number"==typeof e)return e;if("content"===e)return o;const s=parseFloat(e);return Number.isNaN(s)?0:s/100*t})].sort((e,t)=>e-t),clamp=(e,t,o)=>Math.min(Math.max(e,t),o),buildStyles=e=>StyleSheet.create({backdropModal:{flex:1},backdropInline:{...StyleSheet.absoluteFill},sheet:{position:"absolute",left:0,right:0,overflow:"hidden"},body:{overflow:"hidden"},handleRow:{alignItems:"center",justifyContent:"center",alignSelf:"stretch",paddingTop:e.space.md,paddingBottom:e.space.xl},header:{},actions:{padding:e.space.lg},footer:{},handle:{width:36,height:4,borderRadius:e.radius.pill,...smoothCorners},content:{flex:1,overflow:"hidden"},scrollContent:{flex:1},modalRoot:{flex:1}});export{BottomSheet};export default BottomSheet;
|
|
1
|
+
"use strict";import{createContext,useCallback,useContext,useEffect,useMemo,useRef,useState}from"react";import{Dimensions,Keyboard,Platform,ScrollView,StyleSheet,useWindowDimensions,View}from"react-native";import{GestureDetector,GestureHandlerRootView,useNativeGesture,usePanGesture,useTapGesture}from"react-native-gesture-handler";import{useReanimatedKeyboardAnimation}from"react-native-keyboard-controller";import Animated,{Easing,useAnimatedStyle,useDerivedValue,useSharedValue,withSpring,withTiming}from"react-native-reanimated";import{useSafeAreaInsets}from"react-native-safe-area-context";import{scheduleOnRN}from"react-native-worklets";import{PRESENCE_REDUCE_MOTION,usePresenceMotion}from"../../hooks/usePresenceMotion.js";import{useMobileUiText}from"../../text/index.js";import{BOTTOM_SHEET_TEXT}from"../../text/phone/bottomSheet.g.js";import{useTheme}from"../../theme/index.js";import{triggerHaptic}from"../../utils/index.js";import{assertValidValue}from"../../utils/assertValidValue.js";import{transparentOf}from"../../utils/color.js";import{smoothCorners}from"../../utils/corners.js";import{ACTIONS_LAYOUTS,OverlayActions}from"../Dialog/OverlayActions.js";import{Modal}from"../Modal/Modal.js";import{useModalInsets}from"../ModalSafeArea/ModalSafeArea.js";import{Text}from"../Text/index.js";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const DEFAULT_SNAP_POINTS=["content"],TABLET_MIN_SHORT_SIDE=600,DIALOG_MAX_WIDTH=560,BottomSheetContext=createContext(null);export const useBottomSheet=()=>{const e=useContext(BottomSheetContext);if(!e)throw new Error("[@webority/mobile-ui] BottomSheet: useBottomSheet must be used inside a <BottomSheet>.");return e};const SPRING_CONFIG={damping:20,stiffness:240,mass:1},CLOSE_VELOCITY_THRESHOLD=1e3,DRAG_ACTIVATION_OFFSET=10,BottomSheet=e=>{const{snapPoints:t=DEFAULT_SNAP_POINTS,open:o,onClose:s,snapIndex:r,onSnapChange:a,onAnimate:n,onAfterClose:i,enablePanDownToClose:l=!0,enableBackdropPress:u=!0,onBeforeClose:c,title:d,labels:h,scrollable:m=!1,scrollRef:f,onScroll:b,onContentSizeChange:p,onScrollLayout:S,scrollEventThrottle:v,keyboardBehavior:y="shift",inline:g=!1,presentation:x="sheet",animateMount:C=!0,handleIndicatorStyle:w,sheetStyle:M,header:R,actions:_,actionsLayout:T="auto",footer:k,headerStyle:O,footerStyle:E,children:I,accessibilityLabel:j,accessibilityViewIsModal:A,testID:V}=e;assertValidValue("BottomSheet","presentation",e.presentation,["sheet","dialog","auto"]),assertValidValue("BottomSheet","keyboardBehavior",e.keyboardBehavior,["none","shift"]),assertValidValue("BottomSheet","actionsLayout",e.actionsLayout,ACTIONS_LAYOUTS);const N=useMobileUiText("bottomSheet",BOTTOM_SHEET_TEXT),D=useMemo(()=>({...N,...h}),[N,h]),B=null!=R||null!=d,P=null!=_&&_.length>0,L=null!=k||P,H=g?"inline":"modal",G=useTheme(),F=usePresenceMotion(),U=useSafeAreaInsets(),[Y,$]=useState(()=>Dimensions.get("window").height),[z,K]=useState(()=>Dimensions.get("window").width),X=useCallback(e=>{const{height:t,width:o}=e.nativeEvent.layout;t>0&&$(e=>e===t?e:t),o>0&&K(e=>e===o?e:o)},[]),W=useWindowDimensions(),q="dialog"===x||"auto"===x&&Math.min(W.width,W.height)>=600,J=Math.min(560,z-2*G.space.xl),[Q,Z]=useModalInsets(),ee="modal"===H?Q.top:U.top,te="modal"===H?Q.bottom:U.bottom,oe=t.includes("content"),[se,re]=useMeasuredHeight(),[ae,ne]=useMeasuredHeight(),[ie,le,ue]=useMeasuredHeight(),[ce,de]=useMeasuredHeight(),he=q?G.space.md:se,me=oe?Math.min(he+(B?ae:0)+ie+(L?ce:0)+te,Y-ee):0,fe=useCallback((e,t)=>{oe&&ue(t),p?.(e,t)},[oe,p,ue]),be=useMemo(()=>resolveSnapPoints(t,Y,me),[t,Y,me]),pe=Y,Se=be[be.length-1]??0,ve=useSharedValue(pe),ye=useSharedValue(pe),ge=useSharedValue(1),xe=useSharedValue(-1),[Ce,we]=useState(-1),Me=useRef(!1),[Re,Te]=useState(!1),[ke,Oe]=useState(!1),Ee=useRef(!1),Ie=useRef(i);Ie.current=i;const[je,Ae]=useState(!1),Ve=useRef(!C&&o),Ne=useRef(-1),De=useRef(!1);De.current="modal"===H?ke:je;const Be=useRef(c);Be.current=c;const Pe=useRef(s);Pe.current=s;const Le=useRef(!1),He=useRef(!0),Ge=useRef([]),Fe=useCallback(e=>{const t=Ge.current;Ge.current=[];for(const o of t)o(e)},[]);useEffect(()=>(He.current=!0,()=>{He.current=!1,Fe(!1)}),[Fe]);const Ue=useCallback(e=>{if(e<0||e>=be.length)return pe;const t=be[e];if(void 0===t)throw new Error("BottomSheet: an in-range snap index always has a resolved snap point");return q?(Y-t)/2:Y-t},[be,Y,pe,q]),Ye=useCallback(e=>{Ne.current=e;Ce!==e&&(we(e),xe.value=e,e>=0&&a?.(e))},[Ce,xe,a]),$e=useCallback(()=>{Me.current=!1,xe.value<0&&(Ee.current=!0,"modal"===H?(Te(!1),"ios"!==Platform.OS&&Oe(!1)):Ae(!1))},[H,xe]),ze=useCallback(()=>{Ee.current&&Oe(!1)},[]);useEffect(()=>{("modal"===H?!ke:!je)&&Ee.current&&(Ee.current=!1,Ie.current?.(),Fe(!0))},[H,ke,je,Fe]);const Ke=useCallback((e,t,o)=>{Me.current=!0,n?.(t,o),ve.value=withSpring(e,SPRING_CONFIG,e=>{"worklet";e&&scheduleOnRN($e)})},[n,ve,$e]),Xe=useCallback(e=>{const t="number"==typeof e?clamp(e,0,be.length-1):Math.max(Ce,0),o=xe.value,s=Ue(t);return Ee.current=!1,Fe(!1),"modal"===H?(Oe(!0),Te(!0)):Ae(!0),o<0&&Ve.current?(ve.value=s,ge.value=1,Ye(t),void n?.(o,t)):o<0&&F.reduced?(ve.value=s,ge.value=0,ge.value=withTiming(1,{duration:F.duration("fast"),easing:Easing.bezier(...G.motion.ease.decelerate),reduceMotion:PRESENCE_REDUCE_MOTION}),Ye(t),void n?.(o,t)):(o<0&&(ve.value=pe,ge.value=1),Ye(t),void Ke(s,o,t))},[Ke,pe,Ce,xe,H,n,F,ge,be.length,Ye,Fe,G.motion.ease.decelerate,ve,Ue]),We=useCallback(()=>new Promise(e=>{if(Ne.current<0)return void(De.current?Ge.current.push(e):e(!0));Ge.current.push(e),Ve.current=!1;const t=xe.value;Ye(-1),Me.current=!0,n?.(t,-1);const o=F.reduced?ge:ve,s=F.reduced?0:pe;o.value=withTiming(s,{duration:F.duration("fast"),easing:Easing.bezier(...G.motion.ease.accelerate),reduceMotion:PRESENCE_REDUCE_MOTION},e=>{"worklet";e&&scheduleOnRN($e)})}),[pe,xe,$e,n,F,ge,Ye,ve,G.motion.ease.accelerate]),qe=useCallback((e,t,o)=>{const s=Be.current;if(!s)return void e();if(Le.current)return void t?.();const r=s();"boolean"!=typeof r?(Le.current=!0,o?.(),r.then(o=>{Le.current=!1,o&&He.current&&Ne.current>=0?e():t?.()},e=>{throw Le.current=!1,e})):(r?e:t)?.()},[]),Je=useCallback(()=>new Promise(e=>{Ne.current<0?e(!0):qe(()=>{Pe.current(),We(),e(!0)},()=>e(!1))}),[We,qe]),Qe=useCallback(()=>{Pe.current()},[]),Ze=useCallback(()=>{u&&Je()},[u,Je]),et=useRef(null),tt=useRef(Xe);tt.current=Xe;const ot=useRef(We);ot.current=We,useEffect(()=>{const e=et.current!==o;et.current=o,e?o?tt.current(r??0):ot.current():o&&"number"==typeof r&&r!==xe.value&&tt.current(r)},[o,r,xe]);const st=useRef({hostHeight:Y,contentSnap:me}),rt=useRef(Ue);rt.current=Ue,useEffect(()=>{const e=st.current;if(e.hostHeight===Y&&e.contentSnap===me)return;if(st.current={hostHeight:Y,contentSnap:me},e.hostHeight===Y&&xe.value<0)return;const t=rt.current(xe.value);ve.value=Ve.current?t:withSpring(t,SPRING_CONFIG)},[Y,me,xe,ve]);const at=Y-Se,nt=useMemo(()=>be.map(e=>Y-e),[be,Y]),it=useCallback(()=>{const e=Ne.current;e<0||Ke(Ue(e),e,e)},[Ke,Ue]),lt=useCallback((e,t)=>{const o=xe.value;-1!==e?(Ye(e),Ke(t,o,e)):qe(()=>{Keyboard.dismiss(),triggerHaptic("selection"),Pe.current(),We()},it,it)},[Ke,We,xe,qe,Ye,it]),ut=useMemo(()=>({testID:V?`${V}-content-gesture`:"bottom-sheet-content-gesture"}),[V]),ct=useNativeGesture(ut),dt=useMemo(()=>{const e=nt,t=pe,o=at,s=l;return{testID:V?`${V}-pan-gesture`:"bottom-sheet-pan-gesture",activeOffsetY:[-10,10],failOffsetX:[-15,15],onActivate:()=>{"worklet";ye.value=ve.value},onUpdate:e=>{"worklet";const t=ye.value+e.translationY;ve.value=t<o?o+.25*(t-o):t},onDeactivate:o=>{"worklet";const r=ve.value,a=o.velocityY,[n]=e;if(void 0===n)return void scheduleOnRN(lt,-1,t);if(a>1e3)return s?void scheduleOnRN(lt,-1,t):void scheduleOnRN(lt,0,n);let i=0,l=n,u=1/0,c=0;for(const t of e){const e=Math.abs(r-t);e<u&&(u=e,l=t,i=c),c++}s&&r-n>80?scheduleOnRN(lt,-1,t):scheduleOnRN(lt,i,l)}}},[pe,ye,l,lt,at,nt,V,ve]),ht=usePanGesture(dt),{height:mt}=useReanimatedKeyboardAnimation(),ft="shift"===y,bt=useDerivedValue(()=>ft?mt.value:0,[ft,mt]),pt=be[Math.max(Ce,0)]??Se,St=G.space.md,vt=useAnimatedStyle(()=>{if(q){const e=bt.value,t=Y+e-pt-St,o=e<0&&ve.value>t?t:ve.value;return{top:Math.max(o,ee),opacity:ge.value}}const e=ve.value+bt.value,t=bt.value<0?ee:at;return{top:Math.max(e,t),opacity:ge.value}},[q,bt,Y,pt,St,ve,ee,ge,at]),yt=useAnimatedStyle(()=>{const e=bt.value;if(q){const t=Y+e-pt-St,o=e<0&&ve.value>t?t:ve.value,s=Math.max(o,ee),r=Y+e-St-s;return{height:r<0?0:Math.min(r,pt)}}const t=e<0?ee:at,o=ve.value+e,s=Math.max(o,t),r=Y+e-s;return{height:r<0?0:Math.min(r,Se)}},[bt,q,Y,pt,St,ve,ee,at,Se]),gt=Ce>=0,xt=useMemo(()=>buildStyles(G),[G]),Ct=useCallback(()=>{u&&qe(()=>{triggerHaptic("selection"),Pe.current(),We()})},[u,We,qe]),wt=useMemo(()=>({testID:V?`${V}-backdrop-gesture`:"bottom-sheet-backdrop-gesture",maxDuration:250,onDeactivate:e=>{"worklet";e.canceled||scheduleOnRN(Ct)}}),[Ct,V]),Mt=useTapGesture(wt),Rt=useMemo(()=>({snapIndex:Ce,snapPoints:be,close:Qe,requestClose:Je}),[Ce,be,Qe,Je]);if("inline"===H&&!je)return null;if("modal"===H&&!ke)return null;const _t=_jsxs(View,{collapsable:!1,style:["modal"===H?xt.backdropModal:xt.backdropInline,{backgroundColor:"modal"===H?transparentOf(G.colors.scrim):G.colors.scrim}],onLayout:X,testID:V,accessibilityViewIsModal:A??gt,children:[_jsx(GestureDetector,{gesture:Mt,children:_jsx(Animated.View,{style:StyleSheet.absoluteFill,accessibilityRole:"button",accessibilityLabel:D.close})}),_jsx(Animated.View,{accessibilityRole:"alert",accessibilityLabel:j,accessibilityViewIsModal:A??gt,accessibilityActions:[{name:"escape",label:D.close}],onAccessibilityAction:e=>{"escape"===e.nativeEvent.actionName&&Ze()},onAccessibilityEscape:Ze,style:[xt.sheet,{height:Se,backgroundColor:G.colors.surface,borderTopLeftRadius:G.radius.xl,borderTopRightRadius:G.radius.xl,...smoothCorners,...G.shadow.modal},q?{height:pt,left:(z-J)/2,right:void 0,width:J,borderBottomLeftRadius:G.radius.xl,borderBottomRightRadius:G.radius.xl}:null,M,vt],children:_jsxs(SheetBody,{style:[xt.body,yt],keyboardOffset:bt,children:[q?_jsx(View,{style:{height:G.space.md}}):_jsx(GestureDetector,{gesture:ht,children:_jsx(View,{style:xt.handleRow,onLayout:oe?re:void 0,accessible:!0,accessibilityLabel:D.dragHandle,accessibilityHint:D.dragHandleHintText,testID:V?`${V}-handle`:"bottom-sheet-handle",children:_jsx(View,{style:[xt.handle,{backgroundColor:G.colors.border},w]})})}),B&&_jsxs(View,{style:[xt.header,O],onLayout:oe?ne:void 0,children:[null!=d?_jsx(Text,{variant:"title",accessibilityRole:"header",children:d}):null,R]}),m?_jsx(GestureDetector,{gesture:ct,children:_jsx(ScrollView,{ref:f,testID:V?`${V}-scroll`:void 0,style:xt.scrollContent,onScroll:b,onContentSizeChange:fe,onLayout:S,scrollEventThrottle:v,keyboardShouldPersistTaps:"always",keyboardDismissMode:"none",children:I})}):_jsx(View,{style:oe?[xt.content,{overflow:"visible"}]:xt.content,children:oe?_jsx(View,{onLayout:le,children:I}):I}),L&&_jsxs(View,{style:[xt.footer,E],onLayout:oe?de:void 0,children:[P?_jsx(View,{style:xt.actions,children:_jsx(OverlayActions,{actions:_??[],layout:T})}):null,k]})]})})]}),Tt=_jsx(BottomSheetContext.Provider,{value:Rt,children:_t});return"modal"===H?_jsx(Modal,{open:Re,onClose:Ze,presentation:"fullScreen",bare:!0,backdropPressClose:!1,haptic:!1,animateMount:!1,onInsetsChange:Z,onDismissed:"ios"===Platform.OS?ze:void 0,children:"android"===Platform.OS?_jsx(GestureHandlerRootView,{style:xt.modalRoot,children:Tt}):Tt}):Tt},SheetBody=({style:e,keyboardOffset:t,children:o})=>{const s=useSafeAreaInsets().bottom,r=useAnimatedStyle(()=>{const e=s+t.value;return{paddingBottom:Math.max(e,0)}},[s,t]);return _jsx(Animated.View,{style:[e,r],children:o})};BottomSheet.displayName="BottomSheet";const useMeasuredHeight=()=>{const[e,t]=useState(0),o=useCallback(e=>{t(t=>t===e?t:e)},[]);return[e,useCallback(e=>o(e.nativeEvent.layout.height),[o]),o]},resolveSnapPoints=(e,t,o)=>[...e.map(e=>{if("number"==typeof e)return e;if("content"===e)return o;const s=parseFloat(e);return Number.isNaN(s)?0:s/100*t})].sort((e,t)=>e-t),clamp=(e,t,o)=>Math.min(Math.max(e,t),o),buildStyles=e=>StyleSheet.create({backdropModal:{flex:1},backdropInline:{...StyleSheet.absoluteFill},sheet:{position:"absolute",left:0,right:0,overflow:"hidden"},body:{overflow:"hidden"},handleRow:{alignItems:"center",justifyContent:"center",alignSelf:"stretch",paddingTop:e.space.md,paddingBottom:e.space.xl},header:{},actions:{padding:e.space.lg},footer:{},handle:{width:36,height:4,borderRadius:e.radius.pill,...smoothCorners},content:{flex:1,overflow:"hidden"},scrollContent:{flex:1},modalRoot:{flex:1}});export{BottomSheet};export default BottomSheet;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";export{BottomSheet,
|
|
1
|
+
"use strict";export{BottomSheet,default,useBottomSheet}from"./BottomSheet.js";
|