@webority-technologies/mobile 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +399 -0
- package/lib/commonjs/api/publicClient.js +73 -0
- package/lib/commonjs/api/userClient.js +290 -0
- package/lib/commonjs/auth/authStore.js +107 -0
- package/lib/commonjs/auth/index.js +44 -0
- package/lib/commonjs/auth/jwt.js +84 -0
- package/lib/commonjs/components/Accordion/Accordion.js +257 -0
- package/lib/commonjs/components/Accordion/index.js +26 -0
- package/lib/commonjs/components/Avatar/Avatar.js +283 -0
- package/lib/commonjs/components/Avatar/index.js +26 -0
- package/lib/commonjs/components/Badge/Badge.js +212 -0
- package/lib/commonjs/components/Badge/index.js +20 -0
- package/lib/commonjs/components/Banner/Banner.js +276 -0
- package/lib/commonjs/components/Banner/index.js +20 -0
- package/lib/commonjs/components/BottomNavigation/BottomNavigation.js +288 -0
- package/lib/commonjs/components/BottomNavigation/index.js +20 -0
- package/lib/commonjs/components/BottomSheet/BottomSheet.js +367 -0
- package/lib/commonjs/components/BottomSheet/index.js +20 -0
- package/lib/commonjs/components/Button/Button.js +281 -0
- package/lib/commonjs/components/Button/index.js +20 -0
- package/lib/commonjs/components/Card/Card.js +194 -0
- package/lib/commonjs/components/Card/index.js +20 -0
- package/lib/commonjs/components/Carousel/Carousel.js +475 -0
- package/lib/commonjs/components/Carousel/index.js +20 -0
- package/lib/commonjs/components/Checkbox/Checkbox.js +165 -0
- package/lib/commonjs/components/Checkbox/index.js +20 -0
- package/lib/commonjs/components/Chip/Chip.js +272 -0
- package/lib/commonjs/components/Chip/index.js +20 -0
- package/lib/commonjs/components/DatePicker/DatePicker.js +813 -0
- package/lib/commonjs/components/DatePicker/index.js +20 -0
- package/lib/commonjs/components/DateRangePicker/DateRangePicker.js +622 -0
- package/lib/commonjs/components/DateRangePicker/index.js +20 -0
- package/lib/commonjs/components/Dialog/Dialog.js +215 -0
- package/lib/commonjs/components/Dialog/index.js +20 -0
- package/lib/commonjs/components/Divider/Divider.js +118 -0
- package/lib/commonjs/components/Divider/index.js +20 -0
- package/lib/commonjs/components/Drawer/Drawer.js +344 -0
- package/lib/commonjs/components/Drawer/index.js +20 -0
- package/lib/commonjs/components/EmptyState/EmptyState.js +201 -0
- package/lib/commonjs/components/EmptyState/index.js +20 -0
- package/lib/commonjs/components/FAB/FAB.js +457 -0
- package/lib/commonjs/components/FAB/index.js +26 -0
- package/lib/commonjs/components/Field/Field.js +127 -0
- package/lib/commonjs/components/Field/index.js +20 -0
- package/lib/commonjs/components/ForceUpdateDialog/ForceUpdateDialog.js +81 -0
- package/lib/commonjs/components/ForceUpdateDialog/index.js +20 -0
- package/lib/commonjs/components/Header/Header.js +339 -0
- package/lib/commonjs/components/Header/index.js +20 -0
- package/lib/commonjs/components/Icon/Icon.js +120 -0
- package/lib/commonjs/components/Icon/index.js +20 -0
- package/lib/commonjs/components/ImageGallery/ImageGallery.js +463 -0
- package/lib/commonjs/components/ImageGallery/index.js +20 -0
- package/lib/commonjs/components/Input/Input.js +390 -0
- package/lib/commonjs/components/Input/index.js +20 -0
- package/lib/commonjs/components/ListItem/ListItem.js +241 -0
- package/lib/commonjs/components/ListItem/index.js +20 -0
- package/lib/commonjs/components/LoadingSpinner/LoadingSpinner.js +183 -0
- package/lib/commonjs/components/LoadingSpinner/index.js +20 -0
- package/lib/commonjs/components/Modal/Modal.js +239 -0
- package/lib/commonjs/components/Modal/index.js +20 -0
- package/lib/commonjs/components/NumberInput/NumberInput.js +392 -0
- package/lib/commonjs/components/NumberInput/index.js +20 -0
- package/lib/commonjs/components/OTPInput/OTPInput.js +375 -0
- package/lib/commonjs/components/OTPInput/index.js +20 -0
- package/lib/commonjs/components/ProgressBar/ProgressBar.js +149 -0
- package/lib/commonjs/components/ProgressBar/index.js +20 -0
- package/lib/commonjs/components/Radio/Radio.js +160 -0
- package/lib/commonjs/components/Radio/RadioGroup.js +43 -0
- package/lib/commonjs/components/Radio/index.js +39 -0
- package/lib/commonjs/components/Rating/Rating.js +236 -0
- package/lib/commonjs/components/Rating/index.js +20 -0
- package/lib/commonjs/components/SearchBar/SearchBar.js +274 -0
- package/lib/commonjs/components/SearchBar/index.js +20 -0
- package/lib/commonjs/components/SegmentedControl/SegmentedControl.js +184 -0
- package/lib/commonjs/components/SegmentedControl/index.js +20 -0
- package/lib/commonjs/components/Select/Select.js +540 -0
- package/lib/commonjs/components/Select/index.js +20 -0
- package/lib/commonjs/components/SkeletonLoader/SkeletonContent.js +191 -0
- package/lib/commonjs/components/SkeletonLoader/SkeletonLoader.js +311 -0
- package/lib/commonjs/components/SkeletonLoader/index.js +57 -0
- package/lib/commonjs/components/Slider/Slider.js +443 -0
- package/lib/commonjs/components/Slider/index.js +20 -0
- package/lib/commonjs/components/Stepper/Stepper.js +403 -0
- package/lib/commonjs/components/Stepper/index.js +20 -0
- package/lib/commonjs/components/Swipeable/Swipeable.js +349 -0
- package/lib/commonjs/components/Swipeable/index.js +20 -0
- package/lib/commonjs/components/Switch/Switch.js +173 -0
- package/lib/commonjs/components/Switch/index.js +20 -0
- package/lib/commonjs/components/Tabs/Tabs.js +204 -0
- package/lib/commonjs/components/Tabs/index.js +20 -0
- package/lib/commonjs/components/TimePicker/TimePicker.js +551 -0
- package/lib/commonjs/components/TimePicker/index.js +20 -0
- package/lib/commonjs/components/Toast/Toast.js +273 -0
- package/lib/commonjs/components/Toast/ToastProvider.js +195 -0
- package/lib/commonjs/components/Toast/index.js +39 -0
- package/lib/commonjs/components/Tooltip/Tooltip.js +363 -0
- package/lib/commonjs/components/Tooltip/index.js +20 -0
- package/lib/commonjs/components/index.js +392 -0
- package/lib/commonjs/config/index.js +63 -0
- package/lib/commonjs/formatters/currency.js +61 -0
- package/lib/commonjs/formatters/date.js +156 -0
- package/lib/commonjs/formatters/index.js +77 -0
- package/lib/commonjs/formatters/initials.js +28 -0
- package/lib/commonjs/formatters/number.js +76 -0
- package/lib/commonjs/formatters/phone.js +59 -0
- package/lib/commonjs/hooks/index.js +27 -0
- package/lib/commonjs/hooks/useDebounce.js +17 -0
- package/lib/commonjs/hooks/usePressAnimation.js +44 -0
- package/lib/commonjs/hooks/useToggle.js +22 -0
- package/lib/commonjs/index.js +628 -0
- package/lib/commonjs/initSDK.js +47 -0
- package/lib/commonjs/initUI.js +24 -0
- package/lib/commonjs/initUserAuth.js +40 -0
- package/lib/commonjs/logger/index.js +127 -0
- package/lib/commonjs/network/NetworkStatusBanner.js +89 -0
- package/lib/commonjs/network/index.js +32 -0
- package/lib/commonjs/network/networkStatus.js +88 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/permissions/index.js +180 -0
- package/lib/commonjs/storage/index.js +187 -0
- package/lib/commonjs/theme/ThemeContext.js +73 -0
- package/lib/commonjs/theme/index.js +93 -0
- package/lib/commonjs/theme/merge.js +30 -0
- package/lib/commonjs/theme/tokens.js +319 -0
- package/lib/commonjs/theme/types.js +6 -0
- package/lib/commonjs/types/vector-icons.d.js +2 -0
- package/lib/commonjs/utils/dimensions.js +31 -0
- package/lib/commonjs/utils/hapticUtils.js +57 -0
- package/lib/commonjs/utils/imageCompression.js +51 -0
- package/lib/commonjs/utils/index.js +83 -0
- package/lib/commonjs/utils/responsive.js +48 -0
- package/lib/commonjs/utils/shadows.js +12 -0
- package/lib/commonjs/utils/spacing.js +86 -0
- package/lib/commonjs/validators/index.js +165 -0
- package/lib/commonjs/versionCheck/index.js +338 -0
- package/lib/module/api/publicClient.js +69 -0
- package/lib/module/api/userClient.js +283 -0
- package/lib/module/auth/authStore.js +100 -0
- package/lib/module/auth/index.js +5 -0
- package/lib/module/auth/jwt.js +78 -0
- package/lib/module/components/Accordion/Accordion.js +251 -0
- package/lib/module/components/Accordion/index.js +4 -0
- package/lib/module/components/Avatar/Avatar.js +278 -0
- package/lib/module/components/Avatar/index.js +4 -0
- package/lib/module/components/Badge/Badge.js +208 -0
- package/lib/module/components/Badge/index.js +4 -0
- package/lib/module/components/Banner/Banner.js +272 -0
- package/lib/module/components/Banner/index.js +4 -0
- package/lib/module/components/BottomNavigation/BottomNavigation.js +284 -0
- package/lib/module/components/BottomNavigation/index.js +4 -0
- package/lib/module/components/BottomSheet/BottomSheet.js +363 -0
- package/lib/module/components/BottomSheet/index.js +4 -0
- package/lib/module/components/Button/Button.js +277 -0
- package/lib/module/components/Button/index.js +4 -0
- package/lib/module/components/Card/Card.js +190 -0
- package/lib/module/components/Card/index.js +4 -0
- package/lib/module/components/Carousel/Carousel.js +471 -0
- package/lib/module/components/Carousel/index.js +4 -0
- package/lib/module/components/Checkbox/Checkbox.js +161 -0
- package/lib/module/components/Checkbox/index.js +4 -0
- package/lib/module/components/Chip/Chip.js +268 -0
- package/lib/module/components/Chip/index.js +4 -0
- package/lib/module/components/DatePicker/DatePicker.js +808 -0
- package/lib/module/components/DatePicker/index.js +4 -0
- package/lib/module/components/DateRangePicker/DateRangePicker.js +618 -0
- package/lib/module/components/DateRangePicker/index.js +4 -0
- package/lib/module/components/Dialog/Dialog.js +210 -0
- package/lib/module/components/Dialog/index.js +4 -0
- package/lib/module/components/Divider/Divider.js +114 -0
- package/lib/module/components/Divider/index.js +4 -0
- package/lib/module/components/Drawer/Drawer.js +340 -0
- package/lib/module/components/Drawer/index.js +4 -0
- package/lib/module/components/EmptyState/EmptyState.js +197 -0
- package/lib/module/components/EmptyState/index.js +4 -0
- package/lib/module/components/FAB/FAB.js +452 -0
- package/lib/module/components/FAB/index.js +4 -0
- package/lib/module/components/Field/Field.js +123 -0
- package/lib/module/components/Field/index.js +4 -0
- package/lib/module/components/ForceUpdateDialog/ForceUpdateDialog.js +75 -0
- package/lib/module/components/ForceUpdateDialog/index.js +4 -0
- package/lib/module/components/Header/Header.js +335 -0
- package/lib/module/components/Header/index.js +4 -0
- package/lib/module/components/Icon/Icon.js +111 -0
- package/lib/module/components/Icon/index.js +4 -0
- package/lib/module/components/ImageGallery/ImageGallery.js +458 -0
- package/lib/module/components/ImageGallery/index.js +4 -0
- package/lib/module/components/Input/Input.js +384 -0
- package/lib/module/components/Input/index.js +4 -0
- package/lib/module/components/ListItem/ListItem.js +237 -0
- package/lib/module/components/ListItem/index.js +4 -0
- package/lib/module/components/LoadingSpinner/LoadingSpinner.js +179 -0
- package/lib/module/components/LoadingSpinner/index.js +4 -0
- package/lib/module/components/Modal/Modal.js +235 -0
- package/lib/module/components/Modal/index.js +4 -0
- package/lib/module/components/NumberInput/NumberInput.js +388 -0
- package/lib/module/components/NumberInput/index.js +4 -0
- package/lib/module/components/OTPInput/OTPInput.js +371 -0
- package/lib/module/components/OTPInput/index.js +4 -0
- package/lib/module/components/ProgressBar/ProgressBar.js +145 -0
- package/lib/module/components/ProgressBar/index.js +4 -0
- package/lib/module/components/Radio/Radio.js +155 -0
- package/lib/module/components/Radio/RadioGroup.js +38 -0
- package/lib/module/components/Radio/index.js +5 -0
- package/lib/module/components/Rating/Rating.js +232 -0
- package/lib/module/components/Rating/index.js +4 -0
- package/lib/module/components/SearchBar/SearchBar.js +270 -0
- package/lib/module/components/SearchBar/index.js +4 -0
- package/lib/module/components/SegmentedControl/SegmentedControl.js +180 -0
- package/lib/module/components/SegmentedControl/index.js +4 -0
- package/lib/module/components/Select/Select.js +536 -0
- package/lib/module/components/Select/index.js +4 -0
- package/lib/module/components/SkeletonLoader/SkeletonContent.js +186 -0
- package/lib/module/components/SkeletonLoader/SkeletonLoader.js +301 -0
- package/lib/module/components/SkeletonLoader/index.js +5 -0
- package/lib/module/components/Slider/Slider.js +439 -0
- package/lib/module/components/Slider/index.js +4 -0
- package/lib/module/components/Stepper/Stepper.js +399 -0
- package/lib/module/components/Stepper/index.js +4 -0
- package/lib/module/components/Swipeable/Swipeable.js +344 -0
- package/lib/module/components/Swipeable/index.js +4 -0
- package/lib/module/components/Switch/Switch.js +169 -0
- package/lib/module/components/Switch/index.js +4 -0
- package/lib/module/components/Tabs/Tabs.js +200 -0
- package/lib/module/components/Tabs/index.js +4 -0
- package/lib/module/components/TimePicker/TimePicker.js +545 -0
- package/lib/module/components/TimePicker/index.js +4 -0
- package/lib/module/components/Toast/Toast.js +268 -0
- package/lib/module/components/Toast/ToastProvider.js +187 -0
- package/lib/module/components/Toast/index.js +5 -0
- package/lib/module/components/Tooltip/Tooltip.js +358 -0
- package/lib/module/components/Tooltip/index.js +4 -0
- package/lib/module/components/index.js +47 -0
- package/lib/module/config/index.js +55 -0
- package/lib/module/formatters/currency.js +56 -0
- package/lib/module/formatters/date.js +148 -0
- package/lib/module/formatters/index.js +8 -0
- package/lib/module/formatters/initials.js +23 -0
- package/lib/module/formatters/number.js +69 -0
- package/lib/module/formatters/phone.js +53 -0
- package/lib/module/hooks/index.js +6 -0
- package/lib/module/hooks/useDebounce.js +12 -0
- package/lib/module/hooks/usePressAnimation.js +39 -0
- package/lib/module/hooks/useToggle.js +17 -0
- package/lib/module/index.js +37 -0
- package/lib/module/initSDK.js +42 -0
- package/lib/module/initUI.js +19 -0
- package/lib/module/initUserAuth.js +36 -0
- package/lib/module/logger/index.js +123 -0
- package/lib/module/network/NetworkStatusBanner.js +83 -0
- package/lib/module/network/index.js +5 -0
- package/lib/module/network/networkStatus.js +81 -0
- package/lib/module/package.json +1 -0
- package/lib/module/permissions/index.js +177 -0
- package/lib/module/storage/index.js +183 -0
- package/lib/module/theme/ThemeContext.js +65 -0
- package/lib/module/theme/index.js +48 -0
- package/lib/module/theme/merge.js +25 -0
- package/lib/module/theme/tokens.js +315 -0
- package/lib/module/theme/types.js +4 -0
- package/lib/module/types/vector-icons.d.js +2 -0
- package/lib/module/utils/dimensions.js +4 -0
- package/lib/module/utils/hapticUtils.js +51 -0
- package/lib/module/utils/imageCompression.js +46 -0
- package/lib/module/utils/index.js +8 -0
- package/lib/module/utils/responsive.js +42 -0
- package/lib/module/utils/shadows.js +7 -0
- package/lib/module/utils/spacing.js +82 -0
- package/lib/module/validators/index.js +143 -0
- package/lib/module/versionCheck/index.js +334 -0
- package/lib/typescript/commonjs/api/publicClient.d.ts +11 -0
- package/lib/typescript/commonjs/api/userClient.d.ts +18 -0
- package/lib/typescript/commonjs/auth/authStore.d.ts +20 -0
- package/lib/typescript/commonjs/auth/index.d.ts +5 -0
- package/lib/typescript/commonjs/auth/jwt.d.ts +31 -0
- package/lib/typescript/commonjs/components/Accordion/Accordion.d.ts +33 -0
- package/lib/typescript/commonjs/components/Accordion/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/Avatar/Avatar.d.ts +42 -0
- package/lib/typescript/commonjs/components/Avatar/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/Badge/Badge.d.ts +27 -0
- package/lib/typescript/commonjs/components/Badge/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/Banner/Banner.d.ts +27 -0
- package/lib/typescript/commonjs/components/Banner/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/BottomNavigation/BottomNavigation.d.ts +34 -0
- package/lib/typescript/commonjs/components/BottomNavigation/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/BottomSheet/BottomSheet.d.ts +45 -0
- package/lib/typescript/commonjs/components/BottomSheet/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/Button/Button.d.ts +29 -0
- package/lib/typescript/commonjs/components/Button/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/Card/Card.d.ts +29 -0
- package/lib/typescript/commonjs/components/Card/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/Carousel/Carousel.d.ts +66 -0
- package/lib/typescript/commonjs/components/Carousel/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/Checkbox/Checkbox.d.ts +24 -0
- package/lib/typescript/commonjs/components/Checkbox/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/Chip/Chip.d.ts +25 -0
- package/lib/typescript/commonjs/components/Chip/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/DatePicker/DatePicker.d.ts +25 -0
- package/lib/typescript/commonjs/components/DatePicker/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/DateRangePicker/DateRangePicker.d.ts +32 -0
- package/lib/typescript/commonjs/components/DateRangePicker/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/Dialog/Dialog.d.ts +25 -0
- package/lib/typescript/commonjs/components/Dialog/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/Divider/Divider.d.ts +21 -0
- package/lib/typescript/commonjs/components/Divider/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/Drawer/Drawer.d.ts +53 -0
- package/lib/typescript/commonjs/components/Drawer/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/EmptyState/EmptyState.d.ts +25 -0
- package/lib/typescript/commonjs/components/EmptyState/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/FAB/FAB.d.ts +53 -0
- package/lib/typescript/commonjs/components/FAB/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/Field/Field.d.ts +28 -0
- package/lib/typescript/commonjs/components/Field/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/ForceUpdateDialog/ForceUpdateDialog.d.ts +39 -0
- package/lib/typescript/commonjs/components/ForceUpdateDialog/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/Header/Header.d.ts +36 -0
- package/lib/typescript/commonjs/components/Header/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/Icon/Icon.d.ts +20 -0
- package/lib/typescript/commonjs/components/Icon/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/ImageGallery/ImageGallery.d.ts +41 -0
- package/lib/typescript/commonjs/components/ImageGallery/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/Input/Input.d.ts +34 -0
- package/lib/typescript/commonjs/components/Input/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/ListItem/ListItem.d.ts +30 -0
- package/lib/typescript/commonjs/components/ListItem/index.d.ts +4 -0
- package/lib/typescript/commonjs/components/LoadingSpinner/LoadingSpinner.d.ts +20 -0
- package/lib/typescript/commonjs/components/LoadingSpinner/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/Modal/Modal.d.ts +29 -0
- package/lib/typescript/commonjs/components/Modal/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/NumberInput/NumberInput.d.ts +35 -0
- package/lib/typescript/commonjs/components/NumberInput/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/OTPInput/OTPInput.d.ts +29 -0
- package/lib/typescript/commonjs/components/OTPInput/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/ProgressBar/ProgressBar.d.ts +21 -0
- package/lib/typescript/commonjs/components/ProgressBar/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/Radio/Radio.d.ts +32 -0
- package/lib/typescript/commonjs/components/Radio/RadioGroup.d.ts +16 -0
- package/lib/typescript/commonjs/components/Radio/index.d.ts +5 -0
- package/lib/typescript/commonjs/components/Rating/Rating.d.ts +22 -0
- package/lib/typescript/commonjs/components/Rating/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/SearchBar/SearchBar.d.ts +28 -0
- package/lib/typescript/commonjs/components/SearchBar/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/SegmentedControl/SegmentedControl.d.ts +36 -0
- package/lib/typescript/commonjs/components/SegmentedControl/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/Select/Select.d.ts +48 -0
- package/lib/typescript/commonjs/components/Select/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/SkeletonLoader/SkeletonContent.d.ts +29 -0
- package/lib/typescript/commonjs/components/SkeletonLoader/SkeletonLoader.d.ts +42 -0
- package/lib/typescript/commonjs/components/SkeletonLoader/index.d.ts +5 -0
- package/lib/typescript/commonjs/components/Slider/Slider.d.ts +33 -0
- package/lib/typescript/commonjs/components/Slider/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/Stepper/Stepper.d.ts +25 -0
- package/lib/typescript/commonjs/components/Stepper/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/Swipeable/Swipeable.d.ts +45 -0
- package/lib/typescript/commonjs/components/Swipeable/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/Switch/Switch.d.ts +24 -0
- package/lib/typescript/commonjs/components/Switch/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/Tabs/Tabs.d.ts +37 -0
- package/lib/typescript/commonjs/components/Tabs/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/TimePicker/TimePicker.d.ts +26 -0
- package/lib/typescript/commonjs/components/TimePicker/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/Toast/Toast.d.ts +30 -0
- package/lib/typescript/commonjs/components/Toast/ToastProvider.d.ts +26 -0
- package/lib/typescript/commonjs/components/Toast/index.d.ts +5 -0
- package/lib/typescript/commonjs/components/Tooltip/Tooltip.d.ts +22 -0
- package/lib/typescript/commonjs/components/Tooltip/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/index.d.ts +89 -0
- package/lib/typescript/commonjs/config/index.d.ts +40 -0
- package/lib/typescript/commonjs/formatters/currency.d.ts +24 -0
- package/lib/typescript/commonjs/formatters/date.d.ts +22 -0
- package/lib/typescript/commonjs/formatters/index.d.ts +8 -0
- package/lib/typescript/commonjs/formatters/initials.d.ts +11 -0
- package/lib/typescript/commonjs/formatters/number.d.ts +15 -0
- package/lib/typescript/commonjs/formatters/phone.d.ts +13 -0
- package/lib/typescript/commonjs/hooks/index.d.ts +6 -0
- package/lib/typescript/commonjs/hooks/useDebounce.d.ts +2 -0
- package/lib/typescript/commonjs/hooks/usePressAnimation.d.ts +14 -0
- package/lib/typescript/commonjs/hooks/useToggle.d.ts +9 -0
- package/lib/typescript/commonjs/index.d.ts +37 -0
- package/lib/typescript/commonjs/initSDK.d.ts +40 -0
- package/lib/typescript/commonjs/initUI.d.ts +12 -0
- package/lib/typescript/commonjs/initUserAuth.d.ts +22 -0
- package/lib/typescript/commonjs/logger/index.d.ts +42 -0
- package/lib/typescript/commonjs/network/NetworkStatusBanner.d.ts +19 -0
- package/lib/typescript/commonjs/network/index.d.ts +5 -0
- package/lib/typescript/commonjs/network/networkStatus.d.ts +27 -0
- package/lib/typescript/commonjs/package.json +1 -0
- package/lib/typescript/commonjs/permissions/index.d.ts +20 -0
- package/lib/typescript/commonjs/storage/index.d.ts +42 -0
- package/lib/typescript/commonjs/theme/ThemeContext.d.ts +18 -0
- package/lib/typescript/commonjs/theme/index.d.ts +13 -0
- package/lib/typescript/commonjs/theme/merge.d.ts +3 -0
- package/lib/typescript/commonjs/theme/tokens.d.ts +4 -0
- package/lib/typescript/commonjs/theme/types.d.ts +161 -0
- package/lib/typescript/commonjs/utils/dimensions.d.ts +3 -0
- package/lib/typescript/commonjs/utils/hapticUtils.d.ts +4 -0
- package/lib/typescript/commonjs/utils/imageCompression.d.ts +15 -0
- package/lib/typescript/commonjs/utils/index.d.ts +10 -0
- package/lib/typescript/commonjs/utils/responsive.d.ts +23 -0
- package/lib/typescript/commonjs/utils/shadows.d.ts +4 -0
- package/lib/typescript/commonjs/utils/spacing.d.ts +61 -0
- package/lib/typescript/commonjs/validators/index.d.ts +46 -0
- package/lib/typescript/commonjs/versionCheck/index.d.ts +59 -0
- package/lib/typescript/module/api/publicClient.d.ts +11 -0
- package/lib/typescript/module/api/userClient.d.ts +18 -0
- package/lib/typescript/module/auth/authStore.d.ts +20 -0
- package/lib/typescript/module/auth/index.d.ts +5 -0
- package/lib/typescript/module/auth/jwt.d.ts +31 -0
- package/lib/typescript/module/components/Accordion/Accordion.d.ts +33 -0
- package/lib/typescript/module/components/Accordion/index.d.ts +3 -0
- package/lib/typescript/module/components/Avatar/Avatar.d.ts +42 -0
- package/lib/typescript/module/components/Avatar/index.d.ts +3 -0
- package/lib/typescript/module/components/Badge/Badge.d.ts +27 -0
- package/lib/typescript/module/components/Badge/index.d.ts +3 -0
- package/lib/typescript/module/components/Banner/Banner.d.ts +27 -0
- package/lib/typescript/module/components/Banner/index.d.ts +3 -0
- package/lib/typescript/module/components/BottomNavigation/BottomNavigation.d.ts +34 -0
- package/lib/typescript/module/components/BottomNavigation/index.d.ts +3 -0
- package/lib/typescript/module/components/BottomSheet/BottomSheet.d.ts +45 -0
- package/lib/typescript/module/components/BottomSheet/index.d.ts +3 -0
- package/lib/typescript/module/components/Button/Button.d.ts +29 -0
- package/lib/typescript/module/components/Button/index.d.ts +3 -0
- package/lib/typescript/module/components/Card/Card.d.ts +29 -0
- package/lib/typescript/module/components/Card/index.d.ts +3 -0
- package/lib/typescript/module/components/Carousel/Carousel.d.ts +66 -0
- package/lib/typescript/module/components/Carousel/index.d.ts +3 -0
- package/lib/typescript/module/components/Checkbox/Checkbox.d.ts +24 -0
- package/lib/typescript/module/components/Checkbox/index.d.ts +3 -0
- package/lib/typescript/module/components/Chip/Chip.d.ts +25 -0
- package/lib/typescript/module/components/Chip/index.d.ts +3 -0
- package/lib/typescript/module/components/DatePicker/DatePicker.d.ts +25 -0
- package/lib/typescript/module/components/DatePicker/index.d.ts +3 -0
- package/lib/typescript/module/components/DateRangePicker/DateRangePicker.d.ts +32 -0
- package/lib/typescript/module/components/DateRangePicker/index.d.ts +3 -0
- package/lib/typescript/module/components/Dialog/Dialog.d.ts +25 -0
- package/lib/typescript/module/components/Dialog/index.d.ts +3 -0
- package/lib/typescript/module/components/Divider/Divider.d.ts +21 -0
- package/lib/typescript/module/components/Divider/index.d.ts +3 -0
- package/lib/typescript/module/components/Drawer/Drawer.d.ts +53 -0
- package/lib/typescript/module/components/Drawer/index.d.ts +3 -0
- package/lib/typescript/module/components/EmptyState/EmptyState.d.ts +25 -0
- package/lib/typescript/module/components/EmptyState/index.d.ts +3 -0
- package/lib/typescript/module/components/FAB/FAB.d.ts +53 -0
- package/lib/typescript/module/components/FAB/index.d.ts +3 -0
- package/lib/typescript/module/components/Field/Field.d.ts +28 -0
- package/lib/typescript/module/components/Field/index.d.ts +3 -0
- package/lib/typescript/module/components/ForceUpdateDialog/ForceUpdateDialog.d.ts +39 -0
- package/lib/typescript/module/components/ForceUpdateDialog/index.d.ts +3 -0
- package/lib/typescript/module/components/Header/Header.d.ts +36 -0
- package/lib/typescript/module/components/Header/index.d.ts +3 -0
- package/lib/typescript/module/components/Icon/Icon.d.ts +20 -0
- package/lib/typescript/module/components/Icon/index.d.ts +3 -0
- package/lib/typescript/module/components/ImageGallery/ImageGallery.d.ts +41 -0
- package/lib/typescript/module/components/ImageGallery/index.d.ts +3 -0
- package/lib/typescript/module/components/Input/Input.d.ts +34 -0
- package/lib/typescript/module/components/Input/index.d.ts +3 -0
- package/lib/typescript/module/components/ListItem/ListItem.d.ts +30 -0
- package/lib/typescript/module/components/ListItem/index.d.ts +4 -0
- package/lib/typescript/module/components/LoadingSpinner/LoadingSpinner.d.ts +20 -0
- package/lib/typescript/module/components/LoadingSpinner/index.d.ts +3 -0
- package/lib/typescript/module/components/Modal/Modal.d.ts +29 -0
- package/lib/typescript/module/components/Modal/index.d.ts +3 -0
- package/lib/typescript/module/components/NumberInput/NumberInput.d.ts +35 -0
- package/lib/typescript/module/components/NumberInput/index.d.ts +3 -0
- package/lib/typescript/module/components/OTPInput/OTPInput.d.ts +29 -0
- package/lib/typescript/module/components/OTPInput/index.d.ts +3 -0
- package/lib/typescript/module/components/ProgressBar/ProgressBar.d.ts +21 -0
- package/lib/typescript/module/components/ProgressBar/index.d.ts +3 -0
- package/lib/typescript/module/components/Radio/Radio.d.ts +32 -0
- package/lib/typescript/module/components/Radio/RadioGroup.d.ts +16 -0
- package/lib/typescript/module/components/Radio/index.d.ts +5 -0
- package/lib/typescript/module/components/Rating/Rating.d.ts +22 -0
- package/lib/typescript/module/components/Rating/index.d.ts +3 -0
- package/lib/typescript/module/components/SearchBar/SearchBar.d.ts +28 -0
- package/lib/typescript/module/components/SearchBar/index.d.ts +3 -0
- package/lib/typescript/module/components/SegmentedControl/SegmentedControl.d.ts +36 -0
- package/lib/typescript/module/components/SegmentedControl/index.d.ts +3 -0
- package/lib/typescript/module/components/Select/Select.d.ts +48 -0
- package/lib/typescript/module/components/Select/index.d.ts +3 -0
- package/lib/typescript/module/components/SkeletonLoader/SkeletonContent.d.ts +29 -0
- package/lib/typescript/module/components/SkeletonLoader/SkeletonLoader.d.ts +42 -0
- package/lib/typescript/module/components/SkeletonLoader/index.d.ts +5 -0
- package/lib/typescript/module/components/Slider/Slider.d.ts +33 -0
- package/lib/typescript/module/components/Slider/index.d.ts +3 -0
- package/lib/typescript/module/components/Stepper/Stepper.d.ts +25 -0
- package/lib/typescript/module/components/Stepper/index.d.ts +3 -0
- package/lib/typescript/module/components/Swipeable/Swipeable.d.ts +45 -0
- package/lib/typescript/module/components/Swipeable/index.d.ts +3 -0
- package/lib/typescript/module/components/Switch/Switch.d.ts +24 -0
- package/lib/typescript/module/components/Switch/index.d.ts +3 -0
- package/lib/typescript/module/components/Tabs/Tabs.d.ts +37 -0
- package/lib/typescript/module/components/Tabs/index.d.ts +3 -0
- package/lib/typescript/module/components/TimePicker/TimePicker.d.ts +26 -0
- package/lib/typescript/module/components/TimePicker/index.d.ts +3 -0
- package/lib/typescript/module/components/Toast/Toast.d.ts +30 -0
- package/lib/typescript/module/components/Toast/ToastProvider.d.ts +26 -0
- package/lib/typescript/module/components/Toast/index.d.ts +5 -0
- package/lib/typescript/module/components/Tooltip/Tooltip.d.ts +22 -0
- package/lib/typescript/module/components/Tooltip/index.d.ts +3 -0
- package/lib/typescript/module/components/index.d.ts +89 -0
- package/lib/typescript/module/config/index.d.ts +40 -0
- package/lib/typescript/module/formatters/currency.d.ts +24 -0
- package/lib/typescript/module/formatters/date.d.ts +22 -0
- package/lib/typescript/module/formatters/index.d.ts +8 -0
- package/lib/typescript/module/formatters/initials.d.ts +11 -0
- package/lib/typescript/module/formatters/number.d.ts +15 -0
- package/lib/typescript/module/formatters/phone.d.ts +13 -0
- package/lib/typescript/module/hooks/index.d.ts +6 -0
- package/lib/typescript/module/hooks/useDebounce.d.ts +2 -0
- package/lib/typescript/module/hooks/usePressAnimation.d.ts +14 -0
- package/lib/typescript/module/hooks/useToggle.d.ts +9 -0
- package/lib/typescript/module/index.d.ts +37 -0
- package/lib/typescript/module/initSDK.d.ts +40 -0
- package/lib/typescript/module/initUI.d.ts +12 -0
- package/lib/typescript/module/initUserAuth.d.ts +22 -0
- package/lib/typescript/module/logger/index.d.ts +42 -0
- package/lib/typescript/module/network/NetworkStatusBanner.d.ts +19 -0
- package/lib/typescript/module/network/index.d.ts +5 -0
- package/lib/typescript/module/network/networkStatus.d.ts +27 -0
- package/lib/typescript/module/package.json +1 -0
- package/lib/typescript/module/permissions/index.d.ts +20 -0
- package/lib/typescript/module/storage/index.d.ts +42 -0
- package/lib/typescript/module/theme/ThemeContext.d.ts +18 -0
- package/lib/typescript/module/theme/index.d.ts +13 -0
- package/lib/typescript/module/theme/merge.d.ts +3 -0
- package/lib/typescript/module/theme/tokens.d.ts +4 -0
- package/lib/typescript/module/theme/types.d.ts +161 -0
- package/lib/typescript/module/utils/dimensions.d.ts +3 -0
- package/lib/typescript/module/utils/hapticUtils.d.ts +4 -0
- package/lib/typescript/module/utils/imageCompression.d.ts +15 -0
- package/lib/typescript/module/utils/index.d.ts +10 -0
- package/lib/typescript/module/utils/responsive.d.ts +23 -0
- package/lib/typescript/module/utils/shadows.d.ts +4 -0
- package/lib/typescript/module/utils/spacing.d.ts +61 -0
- package/lib/typescript/module/validators/index.d.ts +46 -0
- package/lib/typescript/module/versionCheck/index.d.ts +59 -0
- package/package.json +137 -0
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React, { forwardRef, useMemo } from 'react';
|
|
4
|
+
import { Animated, Pressable, StyleSheet, Text, View } from 'react-native';
|
|
5
|
+
import { useTheme } from "../../theme/index.js";
|
|
6
|
+
import { usePressAnimation } from "../../hooks/usePressAnimation.js";
|
|
7
|
+
import { triggerHaptic } from "../../utils/hapticUtils.js";
|
|
8
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
+
const sizeFor = (theme, size) => {
|
|
10
|
+
switch (size) {
|
|
11
|
+
case 'sm':
|
|
12
|
+
return {
|
|
13
|
+
iconSize: 48,
|
|
14
|
+
titleSize: theme.typography.fontSize.lg,
|
|
15
|
+
descriptionSize: theme.typography.fontSize.sm,
|
|
16
|
+
paddingVertical: theme.spacing.lg
|
|
17
|
+
};
|
|
18
|
+
case 'lg':
|
|
19
|
+
return {
|
|
20
|
+
iconSize: 80,
|
|
21
|
+
titleSize: theme.typography.fontSize['2xl'],
|
|
22
|
+
descriptionSize: theme.typography.fontSize.base,
|
|
23
|
+
paddingVertical: theme.spacing['2xl']
|
|
24
|
+
};
|
|
25
|
+
case 'md':
|
|
26
|
+
default:
|
|
27
|
+
return {
|
|
28
|
+
iconSize: 64,
|
|
29
|
+
titleSize: theme.typography.fontSize.xl,
|
|
30
|
+
descriptionSize: theme.typography.fontSize.base,
|
|
31
|
+
paddingVertical: theme.spacing.xl
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
const ActionButton = ({
|
|
36
|
+
action,
|
|
37
|
+
variant
|
|
38
|
+
}) => {
|
|
39
|
+
const theme = useTheme();
|
|
40
|
+
const {
|
|
41
|
+
scale,
|
|
42
|
+
pressIn,
|
|
43
|
+
pressOut
|
|
44
|
+
} = usePressAnimation({
|
|
45
|
+
enabled: true
|
|
46
|
+
});
|
|
47
|
+
const styles = useMemo(() => buildActionStyles(theme), [theme]);
|
|
48
|
+
const isPrimary = variant === 'primary';
|
|
49
|
+
const onPress = () => {
|
|
50
|
+
triggerHaptic('selection');
|
|
51
|
+
action.onPress();
|
|
52
|
+
};
|
|
53
|
+
return /*#__PURE__*/_jsx(Animated.View, {
|
|
54
|
+
style: {
|
|
55
|
+
transform: [{
|
|
56
|
+
scale
|
|
57
|
+
}]
|
|
58
|
+
},
|
|
59
|
+
children: /*#__PURE__*/_jsx(Pressable, {
|
|
60
|
+
onPress: onPress,
|
|
61
|
+
onPressIn: pressIn,
|
|
62
|
+
onPressOut: pressOut,
|
|
63
|
+
accessibilityRole: "button",
|
|
64
|
+
accessibilityLabel: action.accessibilityLabel ?? action.label,
|
|
65
|
+
accessibilityHint: action.accessibilityHint,
|
|
66
|
+
testID: action.testID,
|
|
67
|
+
android_ripple: {
|
|
68
|
+
color: isPrimary ? theme.colors.primaryHover : theme.colors.surface.pressed,
|
|
69
|
+
borderless: false
|
|
70
|
+
},
|
|
71
|
+
style: ({
|
|
72
|
+
pressed
|
|
73
|
+
}) => [styles.button, isPrimary ? styles.buttonPrimary : styles.buttonSecondary, pressed && !isPrimary ? styles.buttonSecondaryPressed : null],
|
|
74
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
75
|
+
style: [styles.buttonText, isPrimary ? styles.buttonTextPrimary : styles.buttonTextSecondary],
|
|
76
|
+
numberOfLines: 1,
|
|
77
|
+
children: action.label
|
|
78
|
+
})
|
|
79
|
+
})
|
|
80
|
+
});
|
|
81
|
+
};
|
|
82
|
+
const EmptyState = /*#__PURE__*/forwardRef((props, ref) => {
|
|
83
|
+
const {
|
|
84
|
+
icon,
|
|
85
|
+
title,
|
|
86
|
+
description,
|
|
87
|
+
action,
|
|
88
|
+
secondaryAction,
|
|
89
|
+
size = 'md',
|
|
90
|
+
style,
|
|
91
|
+
testID
|
|
92
|
+
} = props;
|
|
93
|
+
const theme = useTheme();
|
|
94
|
+
const sz = useMemo(() => sizeFor(theme, size), [theme, size]);
|
|
95
|
+
const styles = useMemo(() => buildStyles(theme), [theme]);
|
|
96
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
97
|
+
ref: ref,
|
|
98
|
+
accessibilityRole: "summary",
|
|
99
|
+
testID: testID,
|
|
100
|
+
style: [styles.root, {
|
|
101
|
+
paddingVertical: sz.paddingVertical
|
|
102
|
+
}, style],
|
|
103
|
+
children: [icon ? /*#__PURE__*/_jsx(View, {
|
|
104
|
+
style: [styles.iconCircle, {
|
|
105
|
+
width: sz.iconSize,
|
|
106
|
+
height: sz.iconSize,
|
|
107
|
+
borderRadius: sz.iconSize / 2
|
|
108
|
+
}],
|
|
109
|
+
children: icon
|
|
110
|
+
}) : null, /*#__PURE__*/_jsx(Text, {
|
|
111
|
+
style: [styles.title, {
|
|
112
|
+
fontSize: sz.titleSize,
|
|
113
|
+
fontWeight: theme.typography.fontWeight.semibold
|
|
114
|
+
}],
|
|
115
|
+
children: title
|
|
116
|
+
}), description ? /*#__PURE__*/_jsx(Text, {
|
|
117
|
+
style: [styles.description, {
|
|
118
|
+
fontSize: sz.descriptionSize
|
|
119
|
+
}],
|
|
120
|
+
children: description
|
|
121
|
+
}) : null, action || secondaryAction ? /*#__PURE__*/_jsxs(View, {
|
|
122
|
+
style: styles.actions,
|
|
123
|
+
children: [action ? /*#__PURE__*/_jsx(ActionButton, {
|
|
124
|
+
action: action,
|
|
125
|
+
variant: "primary"
|
|
126
|
+
}) : null, secondaryAction ? /*#__PURE__*/_jsx(ActionButton, {
|
|
127
|
+
action: secondaryAction,
|
|
128
|
+
variant: "secondary"
|
|
129
|
+
}) : null]
|
|
130
|
+
}) : null]
|
|
131
|
+
});
|
|
132
|
+
});
|
|
133
|
+
EmptyState.displayName = 'EmptyState';
|
|
134
|
+
const buildStyles = theme => StyleSheet.create({
|
|
135
|
+
root: {
|
|
136
|
+
alignItems: 'center',
|
|
137
|
+
justifyContent: 'center',
|
|
138
|
+
paddingHorizontal: theme.spacing.lg,
|
|
139
|
+
gap: theme.spacing.md
|
|
140
|
+
},
|
|
141
|
+
iconCircle: {
|
|
142
|
+
backgroundColor: theme.colors.surface.disabled,
|
|
143
|
+
alignItems: 'center',
|
|
144
|
+
justifyContent: 'center'
|
|
145
|
+
},
|
|
146
|
+
title: {
|
|
147
|
+
color: theme.colors.text.primary,
|
|
148
|
+
textAlign: 'center'
|
|
149
|
+
},
|
|
150
|
+
description: {
|
|
151
|
+
color: theme.colors.text.secondary,
|
|
152
|
+
textAlign: 'center',
|
|
153
|
+
maxWidth: 320,
|
|
154
|
+
lineHeight: theme.typography.fontSize.base * theme.typography.lineHeight.normal
|
|
155
|
+
},
|
|
156
|
+
actions: {
|
|
157
|
+
flexDirection: 'row',
|
|
158
|
+
alignItems: 'center',
|
|
159
|
+
gap: theme.spacing.sm,
|
|
160
|
+
marginTop: theme.spacing.xs
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
const buildActionStyles = theme => StyleSheet.create({
|
|
164
|
+
button: {
|
|
165
|
+
paddingHorizontal: theme.spacing.lg,
|
|
166
|
+
paddingVertical: theme.spacing.sm,
|
|
167
|
+
minHeight: 42,
|
|
168
|
+
borderRadius: theme.radius.md,
|
|
169
|
+
alignItems: 'center',
|
|
170
|
+
justifyContent: 'center',
|
|
171
|
+
flexDirection: 'row'
|
|
172
|
+
},
|
|
173
|
+
buttonPrimary: {
|
|
174
|
+
backgroundColor: theme.colors.primary
|
|
175
|
+
},
|
|
176
|
+
buttonSecondary: {
|
|
177
|
+
backgroundColor: 'transparent',
|
|
178
|
+
borderWidth: 1,
|
|
179
|
+
borderColor: theme.colors.border.primary
|
|
180
|
+
},
|
|
181
|
+
buttonSecondaryPressed: {
|
|
182
|
+
backgroundColor: theme.colors.surface.pressed
|
|
183
|
+
},
|
|
184
|
+
buttonText: {
|
|
185
|
+
fontSize: theme.typography.fontSize.base,
|
|
186
|
+
fontWeight: theme.typography.fontWeight.semibold
|
|
187
|
+
},
|
|
188
|
+
buttonTextPrimary: {
|
|
189
|
+
color: theme.colors.text.inverse
|
|
190
|
+
},
|
|
191
|
+
buttonTextSecondary: {
|
|
192
|
+
color: theme.colors.text.primary
|
|
193
|
+
}
|
|
194
|
+
});
|
|
195
|
+
export { EmptyState };
|
|
196
|
+
export default EmptyState;
|
|
197
|
+
//# sourceMappingURL=EmptyState.js.map
|
|
@@ -0,0 +1,452 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React, { forwardRef, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
4
|
+
import { Animated, Easing, Pressable, StyleSheet, Text, View } from 'react-native';
|
|
5
|
+
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
6
|
+
import { useTheme } from "../../theme/index.js";
|
|
7
|
+
import { usePressAnimation } from "../../hooks/usePressAnimation.js";
|
|
8
|
+
import { triggerHaptic } from "../../utils/hapticUtils.js";
|
|
9
|
+
import { Icon } from "../Icon/index.js";
|
|
10
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
11
|
+
const sizeMap = {
|
|
12
|
+
sm: {
|
|
13
|
+
diameter: 40,
|
|
14
|
+
iconSize: 18,
|
|
15
|
+
fontSize: 13,
|
|
16
|
+
labelPaddingHorizontal: 14
|
|
17
|
+
},
|
|
18
|
+
md: {
|
|
19
|
+
diameter: 56,
|
|
20
|
+
iconSize: 22,
|
|
21
|
+
fontSize: 15,
|
|
22
|
+
labelPaddingHorizontal: 18
|
|
23
|
+
},
|
|
24
|
+
lg: {
|
|
25
|
+
diameter: 72,
|
|
26
|
+
iconSize: 28,
|
|
27
|
+
fontSize: 16,
|
|
28
|
+
labelPaddingHorizontal: 22
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
const toneBackground = (theme, tone) => {
|
|
32
|
+
switch (tone) {
|
|
33
|
+
case 'success':
|
|
34
|
+
return theme.colors.success;
|
|
35
|
+
case 'warning':
|
|
36
|
+
return theme.colors.warning;
|
|
37
|
+
case 'error':
|
|
38
|
+
return theme.colors.error;
|
|
39
|
+
case 'neutral':
|
|
40
|
+
return theme.colors.background.tertiary;
|
|
41
|
+
case 'primary':
|
|
42
|
+
default:
|
|
43
|
+
return theme.colors.primary;
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
const toneForeground = (theme, tone) => {
|
|
47
|
+
if (tone === 'neutral') return theme.colors.text.primary;
|
|
48
|
+
return theme.colors.text.inverse;
|
|
49
|
+
};
|
|
50
|
+
const isIconConfig = value => {
|
|
51
|
+
return typeof value === 'object' && value !== null && ! /*#__PURE__*/React.isValidElement(value) && typeof value.name === 'string';
|
|
52
|
+
};
|
|
53
|
+
const FAB = /*#__PURE__*/forwardRef((props, ref) => {
|
|
54
|
+
const {
|
|
55
|
+
icon,
|
|
56
|
+
onPress,
|
|
57
|
+
label,
|
|
58
|
+
size = 'md',
|
|
59
|
+
tone = 'primary',
|
|
60
|
+
position,
|
|
61
|
+
bottomOffset,
|
|
62
|
+
disabled = false,
|
|
63
|
+
hideOnScroll = false,
|
|
64
|
+
isScrolling = false,
|
|
65
|
+
accessibilityLabel,
|
|
66
|
+
accessibilityHint,
|
|
67
|
+
style,
|
|
68
|
+
testID
|
|
69
|
+
} = props;
|
|
70
|
+
const theme = useTheme();
|
|
71
|
+
const insets = useSafeAreaInsets();
|
|
72
|
+
const sizeStyles = sizeMap[size];
|
|
73
|
+
const styles = useMemo(() => buildStyles(theme), [theme]);
|
|
74
|
+
const {
|
|
75
|
+
scale,
|
|
76
|
+
pressIn,
|
|
77
|
+
pressOut
|
|
78
|
+
} = usePressAnimation({
|
|
79
|
+
enabled: !disabled
|
|
80
|
+
});
|
|
81
|
+
const hideAnim = useRef(new Animated.Value(0)).current;
|
|
82
|
+
useEffect(() => {
|
|
83
|
+
if (!hideOnScroll) {
|
|
84
|
+
hideAnim.setValue(0);
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
Animated.timing(hideAnim, {
|
|
88
|
+
toValue: isScrolling ? 1 : 0,
|
|
89
|
+
duration: theme.motion.duration.normal,
|
|
90
|
+
easing: Easing.bezier(...theme.motion.easing.standard),
|
|
91
|
+
useNativeDriver: true
|
|
92
|
+
}).start();
|
|
93
|
+
}, [hideOnScroll, isScrolling, hideAnim, theme.motion.duration.normal, theme.motion.easing.standard]);
|
|
94
|
+
const hideTranslateY = hideAnim.interpolate({
|
|
95
|
+
inputRange: [0, 1],
|
|
96
|
+
outputRange: [0, sizeStyles.diameter + (bottomOffset ?? 24) + insets.bottom + 24]
|
|
97
|
+
});
|
|
98
|
+
const hideOpacity = hideAnim.interpolate({
|
|
99
|
+
inputRange: [0, 1],
|
|
100
|
+
outputRange: [1, 0]
|
|
101
|
+
});
|
|
102
|
+
const handlePress = _event => {
|
|
103
|
+
if (disabled) return;
|
|
104
|
+
triggerHaptic('impactLight');
|
|
105
|
+
onPress();
|
|
106
|
+
};
|
|
107
|
+
const renderedIcon = isIconConfig(icon) ? /*#__PURE__*/_jsx(Icon, {
|
|
108
|
+
name: icon.name,
|
|
109
|
+
family: icon.family ?? 'feather',
|
|
110
|
+
size: sizeStyles.iconSize,
|
|
111
|
+
color: toneForeground(theme, tone)
|
|
112
|
+
}) : icon;
|
|
113
|
+
const isExtended = typeof label === 'string' && label.length > 0;
|
|
114
|
+
const backgroundColor = disabled ? theme.colors.surface.disabled : toneBackground(theme, tone);
|
|
115
|
+
const foregroundColor = disabled ? theme.colors.text.disabled : toneForeground(theme, tone);
|
|
116
|
+
const positionStyle = useMemo(() => {
|
|
117
|
+
if (!position) return null;
|
|
118
|
+
const bottom = (bottomOffset ?? 24) + insets.bottom;
|
|
119
|
+
switch (position) {
|
|
120
|
+
case 'bottomLeft':
|
|
121
|
+
return {
|
|
122
|
+
position: 'absolute',
|
|
123
|
+
bottom,
|
|
124
|
+
left: 24
|
|
125
|
+
};
|
|
126
|
+
case 'bottomCenter':
|
|
127
|
+
return {
|
|
128
|
+
position: 'absolute',
|
|
129
|
+
bottom,
|
|
130
|
+
alignSelf: 'center'
|
|
131
|
+
};
|
|
132
|
+
case 'bottomRight':
|
|
133
|
+
default:
|
|
134
|
+
return {
|
|
135
|
+
position: 'absolute',
|
|
136
|
+
bottom,
|
|
137
|
+
right: 24
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
}, [position, bottomOffset, insets.bottom]);
|
|
141
|
+
return /*#__PURE__*/_jsx(Animated.View, {
|
|
142
|
+
style: [positionStyle, {
|
|
143
|
+
transform: [{
|
|
144
|
+
translateY: hideTranslateY
|
|
145
|
+
}, {
|
|
146
|
+
scale
|
|
147
|
+
}],
|
|
148
|
+
opacity: hideOpacity
|
|
149
|
+
}, style],
|
|
150
|
+
pointerEvents: hideOnScroll && isScrolling ? 'none' : 'auto',
|
|
151
|
+
children: /*#__PURE__*/_jsxs(Pressable, {
|
|
152
|
+
ref: ref,
|
|
153
|
+
onPress: handlePress,
|
|
154
|
+
onPressIn: pressIn,
|
|
155
|
+
onPressOut: pressOut,
|
|
156
|
+
disabled: disabled,
|
|
157
|
+
accessibilityRole: "button",
|
|
158
|
+
accessibilityLabel: accessibilityLabel,
|
|
159
|
+
accessibilityHint: accessibilityHint,
|
|
160
|
+
accessibilityState: {
|
|
161
|
+
disabled
|
|
162
|
+
},
|
|
163
|
+
testID: testID,
|
|
164
|
+
android_ripple: {
|
|
165
|
+
color: theme.colors.surface.pressed,
|
|
166
|
+
borderless: false
|
|
167
|
+
},
|
|
168
|
+
style: [styles.base, isExtended ? {
|
|
169
|
+
height: sizeStyles.diameter,
|
|
170
|
+
paddingHorizontal: sizeStyles.labelPaddingHorizontal,
|
|
171
|
+
borderRadius: sizeStyles.diameter / 2
|
|
172
|
+
} : {
|
|
173
|
+
width: sizeStyles.diameter,
|
|
174
|
+
height: sizeStyles.diameter,
|
|
175
|
+
borderRadius: sizeStyles.diameter / 2
|
|
176
|
+
}, theme.shadows.lg, {
|
|
177
|
+
backgroundColor,
|
|
178
|
+
opacity: disabled ? 0.7 : 1
|
|
179
|
+
}],
|
|
180
|
+
children: [renderedIcon, isExtended ? /*#__PURE__*/_jsx(Text, {
|
|
181
|
+
style: [styles.label, {
|
|
182
|
+
color: foregroundColor,
|
|
183
|
+
fontSize: sizeStyles.fontSize,
|
|
184
|
+
fontWeight: theme.typography.fontWeight.semibold,
|
|
185
|
+
marginLeft: theme.spacing.sm
|
|
186
|
+
}],
|
|
187
|
+
numberOfLines: 1,
|
|
188
|
+
children: label
|
|
189
|
+
}) : null]
|
|
190
|
+
})
|
|
191
|
+
});
|
|
192
|
+
});
|
|
193
|
+
FAB.displayName = 'FAB';
|
|
194
|
+
const buildStyles = _theme => StyleSheet.create({
|
|
195
|
+
base: {
|
|
196
|
+
flexDirection: 'row',
|
|
197
|
+
alignItems: 'center',
|
|
198
|
+
justifyContent: 'center',
|
|
199
|
+
overflow: 'hidden'
|
|
200
|
+
},
|
|
201
|
+
label: {
|
|
202
|
+
includeFontPadding: false
|
|
203
|
+
}
|
|
204
|
+
});
|
|
205
|
+
|
|
206
|
+
// =====================================================================
|
|
207
|
+
// FABGroup — speed-dial: primary FAB that expands radially upward into
|
|
208
|
+
// N secondary FABs. Animations use the native driver (opacity, transform)
|
|
209
|
+
// so they remain smooth during JS thread work.
|
|
210
|
+
// =====================================================================
|
|
211
|
+
|
|
212
|
+
const SECONDARY_GAP = 16;
|
|
213
|
+
const STAGGER_MS = 50;
|
|
214
|
+
const FABGroup = props => {
|
|
215
|
+
const {
|
|
216
|
+
primaryIcon,
|
|
217
|
+
primaryActiveIcon,
|
|
218
|
+
actions,
|
|
219
|
+
open: controlledOpen,
|
|
220
|
+
defaultOpen = false,
|
|
221
|
+
onOpenChange,
|
|
222
|
+
position = 'bottomRight',
|
|
223
|
+
bottomOffset,
|
|
224
|
+
size = 'md',
|
|
225
|
+
accessibilityLabel = 'Quick actions',
|
|
226
|
+
testID
|
|
227
|
+
} = props;
|
|
228
|
+
const theme = useTheme();
|
|
229
|
+
const insets = useSafeAreaInsets();
|
|
230
|
+
const sizeStyles = sizeMap[size];
|
|
231
|
+
const styles = useMemo(() => buildGroupStyles(theme), [theme]);
|
|
232
|
+
const isControlled = typeof controlledOpen === 'boolean';
|
|
233
|
+
const [internalOpen, setInternalOpen] = useState(defaultOpen);
|
|
234
|
+
const isOpen = isControlled ? controlledOpen : internalOpen;
|
|
235
|
+
|
|
236
|
+
// Animation drivers
|
|
237
|
+
const progress = useRef(new Animated.Value(isOpen ? 1 : 0)).current;
|
|
238
|
+
const itemAnims = useRef([]);
|
|
239
|
+
|
|
240
|
+
// Resize per-item anim array if action count changes
|
|
241
|
+
if (itemAnims.current.length !== actions.length) {
|
|
242
|
+
const next = [];
|
|
243
|
+
for (let i = 0; i < actions.length; i += 1) {
|
|
244
|
+
next.push(itemAnims.current[i] ?? new Animated.Value(isOpen ? 1 : 0));
|
|
245
|
+
}
|
|
246
|
+
itemAnims.current = next;
|
|
247
|
+
}
|
|
248
|
+
useEffect(() => {
|
|
249
|
+
Animated.timing(progress, {
|
|
250
|
+
toValue: isOpen ? 1 : 0,
|
|
251
|
+
duration: theme.motion.duration.normal,
|
|
252
|
+
easing: Easing.bezier(...theme.motion.easing.standard),
|
|
253
|
+
useNativeDriver: true
|
|
254
|
+
}).start();
|
|
255
|
+
const animations = itemAnims.current.map(value => Animated.timing(value, {
|
|
256
|
+
toValue: isOpen ? 1 : 0,
|
|
257
|
+
duration: theme.motion.duration.normal,
|
|
258
|
+
easing: Easing.bezier(...theme.motion.easing.standard),
|
|
259
|
+
useNativeDriver: true
|
|
260
|
+
}));
|
|
261
|
+
// Reverse stagger order on close so items closest to primary collapse last
|
|
262
|
+
const ordered = isOpen ? animations : [...animations].reverse();
|
|
263
|
+
Animated.stagger(STAGGER_MS, ordered).start();
|
|
264
|
+
}, [isOpen, progress, theme.motion.duration.normal, theme.motion.easing.standard, actions.length]);
|
|
265
|
+
const setOpen = useCallback(next => {
|
|
266
|
+
triggerHaptic('impactLight');
|
|
267
|
+
if (!isControlled) setInternalOpen(next);
|
|
268
|
+
onOpenChange?.(next);
|
|
269
|
+
}, [isControlled, onOpenChange]);
|
|
270
|
+
const handlePrimaryPress = useCallback(() => {
|
|
271
|
+
setOpen(!isOpen);
|
|
272
|
+
}, [isOpen, setOpen]);
|
|
273
|
+
const handleActionPress = useCallback(action => {
|
|
274
|
+
triggerHaptic('selection');
|
|
275
|
+
action.onPress();
|
|
276
|
+
// Close after action runs
|
|
277
|
+
if (!isControlled) setInternalOpen(false);
|
|
278
|
+
onOpenChange?.(false);
|
|
279
|
+
}, [isControlled, onOpenChange]);
|
|
280
|
+
const handleBackdropPress = useCallback(() => {
|
|
281
|
+
if (isOpen) setOpen(false);
|
|
282
|
+
}, [isOpen, setOpen]);
|
|
283
|
+
const positionStyle = useMemo(() => {
|
|
284
|
+
const bottom = (bottomOffset ?? 24) + insets.bottom;
|
|
285
|
+
switch (position) {
|
|
286
|
+
case 'bottomLeft':
|
|
287
|
+
return {
|
|
288
|
+
position: 'absolute',
|
|
289
|
+
bottom,
|
|
290
|
+
left: 24,
|
|
291
|
+
alignItems: 'flex-start'
|
|
292
|
+
};
|
|
293
|
+
case 'bottomCenter':
|
|
294
|
+
return {
|
|
295
|
+
position: 'absolute',
|
|
296
|
+
bottom,
|
|
297
|
+
alignSelf: 'center',
|
|
298
|
+
alignItems: 'center'
|
|
299
|
+
};
|
|
300
|
+
case 'bottomRight':
|
|
301
|
+
default:
|
|
302
|
+
return {
|
|
303
|
+
position: 'absolute',
|
|
304
|
+
bottom,
|
|
305
|
+
right: 24,
|
|
306
|
+
alignItems: 'flex-end'
|
|
307
|
+
};
|
|
308
|
+
}
|
|
309
|
+
}, [position, bottomOffset, insets.bottom]);
|
|
310
|
+
|
|
311
|
+
// Vertical slot offset per index: secondary at index i sits (diameter + gap) * (i + 1) above primary
|
|
312
|
+
const slotOffset = index => -((sizeStyles.diameter + SECONDARY_GAP) * (index + 1));
|
|
313
|
+
const backdropOpacity = progress.interpolate({
|
|
314
|
+
inputRange: [0, 1],
|
|
315
|
+
outputRange: [0, 0.4]
|
|
316
|
+
});
|
|
317
|
+
const rotation = progress.interpolate({
|
|
318
|
+
inputRange: [0, 1],
|
|
319
|
+
outputRange: ['0deg', '45deg']
|
|
320
|
+
});
|
|
321
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
322
|
+
children: [isOpen ? /*#__PURE__*/_jsx(Animated.View, {
|
|
323
|
+
pointerEvents: isOpen ? 'auto' : 'none',
|
|
324
|
+
style: [StyleSheet.absoluteFillObject, {
|
|
325
|
+
backgroundColor: theme.colors.background.overlay,
|
|
326
|
+
opacity: backdropOpacity
|
|
327
|
+
}],
|
|
328
|
+
children: /*#__PURE__*/_jsx(Pressable, {
|
|
329
|
+
style: StyleSheet.absoluteFill,
|
|
330
|
+
onPress: handleBackdropPress,
|
|
331
|
+
accessibilityElementsHidden: true,
|
|
332
|
+
importantForAccessibility: "no",
|
|
333
|
+
testID: testID ? `${testID}-backdrop` : undefined
|
|
334
|
+
})
|
|
335
|
+
}) : null, /*#__PURE__*/_jsxs(View, {
|
|
336
|
+
style: positionStyle,
|
|
337
|
+
accessibilityRole: 'menu',
|
|
338
|
+
testID: testID,
|
|
339
|
+
children: [actions.map((action, index) => {
|
|
340
|
+
const anim = itemAnims.current[index];
|
|
341
|
+
if (!anim) return null;
|
|
342
|
+
const translateY = anim.interpolate({
|
|
343
|
+
inputRange: [0, 1],
|
|
344
|
+
outputRange: [0, slotOffset(index)]
|
|
345
|
+
});
|
|
346
|
+
const scale = anim.interpolate({
|
|
347
|
+
inputRange: [0, 1],
|
|
348
|
+
outputRange: [0.6, 1]
|
|
349
|
+
});
|
|
350
|
+
const itemBackground = toneBackground(theme, action.tone ?? 'primary');
|
|
351
|
+
const itemForeground = toneForeground(theme, action.tone ?? 'primary');
|
|
352
|
+
const secondaryDiameter = sizeStyles.diameter * 0.78;
|
|
353
|
+
return /*#__PURE__*/_jsxs(Animated.View, {
|
|
354
|
+
pointerEvents: isOpen ? 'auto' : 'none',
|
|
355
|
+
style: [styles.secondaryRow, {
|
|
356
|
+
position: 'absolute',
|
|
357
|
+
bottom: 0,
|
|
358
|
+
opacity: anim,
|
|
359
|
+
transform: [{
|
|
360
|
+
translateY
|
|
361
|
+
}, {
|
|
362
|
+
scale
|
|
363
|
+
}]
|
|
364
|
+
}],
|
|
365
|
+
children: [action.label ? /*#__PURE__*/_jsx(View, {
|
|
366
|
+
style: [styles.labelPill, theme.shadows.sm, {
|
|
367
|
+
backgroundColor: theme.colors.background.elevated,
|
|
368
|
+
paddingHorizontal: theme.spacing.sm,
|
|
369
|
+
paddingVertical: theme.spacing.xs,
|
|
370
|
+
borderRadius: theme.radius.sm,
|
|
371
|
+
marginRight: theme.spacing.sm
|
|
372
|
+
}],
|
|
373
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
374
|
+
style: {
|
|
375
|
+
color: theme.colors.text.primary,
|
|
376
|
+
fontSize: theme.typography.fontSize.sm,
|
|
377
|
+
fontWeight: theme.typography.fontWeight.medium
|
|
378
|
+
},
|
|
379
|
+
numberOfLines: 1,
|
|
380
|
+
children: action.label
|
|
381
|
+
})
|
|
382
|
+
}) : null, /*#__PURE__*/_jsx(Pressable, {
|
|
383
|
+
onPress: () => handleActionPress(action),
|
|
384
|
+
accessibilityRole: 'menuitem',
|
|
385
|
+
accessibilityLabel: action.accessibilityLabel,
|
|
386
|
+
android_ripple: {
|
|
387
|
+
color: theme.colors.surface.pressed,
|
|
388
|
+
borderless: false
|
|
389
|
+
},
|
|
390
|
+
style: [styles.fabBase, theme.shadows.md, {
|
|
391
|
+
width: secondaryDiameter,
|
|
392
|
+
height: secondaryDiameter,
|
|
393
|
+
borderRadius: secondaryDiameter / 2,
|
|
394
|
+
backgroundColor: itemBackground
|
|
395
|
+
}],
|
|
396
|
+
testID: testID ? `${testID}-action-${action.key}` : undefined,
|
|
397
|
+
children: /*#__PURE__*/React.isValidElement(action.icon) ? action.icon : /*#__PURE__*/_jsx(Text, {
|
|
398
|
+
style: {
|
|
399
|
+
color: itemForeground
|
|
400
|
+
},
|
|
401
|
+
children: String(action.icon ?? '')
|
|
402
|
+
})
|
|
403
|
+
})]
|
|
404
|
+
}, action.key);
|
|
405
|
+
}), /*#__PURE__*/_jsx(Pressable, {
|
|
406
|
+
onPress: handlePrimaryPress,
|
|
407
|
+
accessibilityRole: "button",
|
|
408
|
+
accessibilityLabel: accessibilityLabel,
|
|
409
|
+
accessibilityState: {
|
|
410
|
+
expanded: isOpen
|
|
411
|
+
},
|
|
412
|
+
android_ripple: {
|
|
413
|
+
color: theme.colors.surface.pressed,
|
|
414
|
+
borderless: false
|
|
415
|
+
},
|
|
416
|
+
style: [styles.fabBase, theme.shadows.lg, {
|
|
417
|
+
width: sizeStyles.diameter,
|
|
418
|
+
height: sizeStyles.diameter,
|
|
419
|
+
borderRadius: sizeStyles.diameter / 2,
|
|
420
|
+
backgroundColor: theme.colors.primary
|
|
421
|
+
}],
|
|
422
|
+
testID: testID ? `${testID}-primary` : undefined,
|
|
423
|
+
children: /*#__PURE__*/_jsx(Animated.View, {
|
|
424
|
+
style: primaryActiveIcon ? undefined : {
|
|
425
|
+
transform: [{
|
|
426
|
+
rotate: rotation
|
|
427
|
+
}]
|
|
428
|
+
},
|
|
429
|
+
children: isOpen && primaryActiveIcon ? primaryActiveIcon : primaryIcon
|
|
430
|
+
})
|
|
431
|
+
})]
|
|
432
|
+
})]
|
|
433
|
+
});
|
|
434
|
+
};
|
|
435
|
+
const buildGroupStyles = _theme => StyleSheet.create({
|
|
436
|
+
fabBase: {
|
|
437
|
+
flexDirection: 'row',
|
|
438
|
+
alignItems: 'center',
|
|
439
|
+
justifyContent: 'center',
|
|
440
|
+
overflow: 'hidden'
|
|
441
|
+
},
|
|
442
|
+
secondaryRow: {
|
|
443
|
+
flexDirection: 'row',
|
|
444
|
+
alignItems: 'center'
|
|
445
|
+
},
|
|
446
|
+
labelPill: {
|
|
447
|
+
alignSelf: 'center'
|
|
448
|
+
}
|
|
449
|
+
});
|
|
450
|
+
export { FAB, FABGroup };
|
|
451
|
+
export default FAB;
|
|
452
|
+
//# sourceMappingURL=FAB.js.map
|