@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,349 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.Swipeable = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _reactNativeGestureHandler = require("react-native-gesture-handler");
|
|
10
|
+
var _reactNativeReanimated = _interopRequireWildcard(require("react-native-reanimated"));
|
|
11
|
+
var _index = require("../../theme/index.js");
|
|
12
|
+
var _index2 = require("../../utils/index.js");
|
|
13
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
15
|
+
/**
|
|
16
|
+
* Swipeable — Reanimated 3 + Gesture Handler 2 implementation.
|
|
17
|
+
*
|
|
18
|
+
* Wraps any content and reveals contextual actions when the user
|
|
19
|
+
* swipes left or right. Past `fullSwipeThreshold`, the first action
|
|
20
|
+
* fires automatically and the content slides off-screen.
|
|
21
|
+
*
|
|
22
|
+
* USAGE:
|
|
23
|
+
*
|
|
24
|
+
* <Swipeable
|
|
25
|
+
* leftActions={[{ key: 'archive', label: 'Archive', tone: 'success', onPress: handleArchive }]}
|
|
26
|
+
* rightActions={[{ key: 'delete', label: 'Delete', tone: 'error', onPress: handleDelete }]}
|
|
27
|
+
* >
|
|
28
|
+
* <ListItem title="Inbox item" />
|
|
29
|
+
* </Swipeable>
|
|
30
|
+
*/
|
|
31
|
+
|
|
32
|
+
const SPRING_CONFIG = {
|
|
33
|
+
damping: 22,
|
|
34
|
+
stiffness: 260,
|
|
35
|
+
mass: 1
|
|
36
|
+
};
|
|
37
|
+
const DRAG_ACTIVATION_OFFSET = 10;
|
|
38
|
+
const RUBBER_BAND_FACTOR = 0.35;
|
|
39
|
+
const toneToBg = (theme, tone) => {
|
|
40
|
+
switch (tone) {
|
|
41
|
+
case 'primary':
|
|
42
|
+
return theme.colors.primary;
|
|
43
|
+
case 'success':
|
|
44
|
+
return theme.colors.success;
|
|
45
|
+
case 'warning':
|
|
46
|
+
return theme.colors.warning;
|
|
47
|
+
case 'error':
|
|
48
|
+
return theme.colors.error;
|
|
49
|
+
case 'neutral':
|
|
50
|
+
default:
|
|
51
|
+
return theme.colors.secondary;
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
const Swipeable = props => {
|
|
55
|
+
const {
|
|
56
|
+
children,
|
|
57
|
+
leftActions,
|
|
58
|
+
rightActions,
|
|
59
|
+
threshold = 80,
|
|
60
|
+
fullSwipeThreshold = 200,
|
|
61
|
+
onSwipeOpen,
|
|
62
|
+
onSwipeClose,
|
|
63
|
+
disabled = false,
|
|
64
|
+
containerStyle,
|
|
65
|
+
accessibilityLabel,
|
|
66
|
+
testID
|
|
67
|
+
} = props;
|
|
68
|
+
const theme = (0, _index.useTheme)();
|
|
69
|
+
const styles = (0, _react.useMemo)(() => buildStyles(theme), [theme]);
|
|
70
|
+
const hasLeft = !!leftActions && leftActions.length > 0;
|
|
71
|
+
const hasRight = !!rightActions && rightActions.length > 0;
|
|
72
|
+
const screenWidth = _reactNative.Dimensions.get('window').width;
|
|
73
|
+
|
|
74
|
+
// Per-side total reveal width; each individual action is totalRevealWidth / actions.length.
|
|
75
|
+
const leftRevealWidth = hasLeft ? threshold * (leftActions?.length ?? 0) : 0;
|
|
76
|
+
const rightRevealWidth = hasRight ? threshold * (rightActions?.length ?? 0) : 0;
|
|
77
|
+
|
|
78
|
+
// translateX: 0 = closed, +leftRevealWidth = left actions revealed, -rightRevealWidth = right actions revealed.
|
|
79
|
+
const translateX = (0, _reactNativeReanimated.useSharedValue)(0);
|
|
80
|
+
const dragStartX = (0, _reactNativeReanimated.useSharedValue)(0);
|
|
81
|
+
|
|
82
|
+
// Mirror "is currently open + which side" on JS so we can debounce onSwipeOpen/onSwipeClose callbacks.
|
|
83
|
+
const openSideRef = (0, _react.useRef)(null);
|
|
84
|
+
|
|
85
|
+
// ───────── Animation cleanup on unmount ─────────
|
|
86
|
+
(0, _react.useEffect)(() => {
|
|
87
|
+
return () => {
|
|
88
|
+
(0, _reactNativeReanimated.cancelAnimation)(translateX);
|
|
89
|
+
(0, _reactNativeReanimated.cancelAnimation)(dragStartX);
|
|
90
|
+
};
|
|
91
|
+
}, [translateX, dragStartX]);
|
|
92
|
+
|
|
93
|
+
// ───────── JS-thread callbacks invoked from worklets ─────────
|
|
94
|
+
const notifyOpen = (0, _react.useCallback)(side => {
|
|
95
|
+
if (openSideRef.current === side) return;
|
|
96
|
+
openSideRef.current = side;
|
|
97
|
+
onSwipeOpen?.(side);
|
|
98
|
+
}, [onSwipeOpen]);
|
|
99
|
+
const notifyClose = (0, _react.useCallback)(() => {
|
|
100
|
+
if (openSideRef.current === null) return;
|
|
101
|
+
openSideRef.current = null;
|
|
102
|
+
onSwipeClose?.();
|
|
103
|
+
}, [onSwipeClose]);
|
|
104
|
+
const fireFirstAction = (0, _react.useCallback)(side => {
|
|
105
|
+
const list = side === 'left' ? leftActions : rightActions;
|
|
106
|
+
const first = list?.[0];
|
|
107
|
+
if (!first) return;
|
|
108
|
+
(0, _index2.triggerHaptic)('notificationSuccess');
|
|
109
|
+
first.onPress();
|
|
110
|
+
// After the off-screen slide, snap back to 0 silently.
|
|
111
|
+
translateX.value = (0, _reactNativeReanimated.withSpring)(0, SPRING_CONFIG);
|
|
112
|
+
openSideRef.current = null;
|
|
113
|
+
onSwipeClose?.();
|
|
114
|
+
}, [leftActions, rightActions, translateX, onSwipeClose]);
|
|
115
|
+
const close = (0, _react.useCallback)(() => {
|
|
116
|
+
translateX.value = (0, _reactNativeReanimated.withSpring)(0, SPRING_CONFIG);
|
|
117
|
+
notifyClose();
|
|
118
|
+
}, [translateX, notifyClose]);
|
|
119
|
+
const handleActionPress = (0, _react.useCallback)(action => {
|
|
120
|
+
(0, _index2.triggerHaptic)('selection');
|
|
121
|
+
action.onPress();
|
|
122
|
+
close();
|
|
123
|
+
}, [close]);
|
|
124
|
+
|
|
125
|
+
// ───────── Pan gesture (UI thread) ─────────
|
|
126
|
+
const panGesture = (0, _react.useMemo)(() => {
|
|
127
|
+
const leftCap = leftRevealWidth;
|
|
128
|
+
const rightCap = rightRevealWidth;
|
|
129
|
+
const fullSwipeLeft = fullSwipeThreshold; // positive when swiping right→reveal left
|
|
130
|
+
const fullSwipeRight = -fullSwipeThreshold; // negative when swiping left→reveal right
|
|
131
|
+
const offScreenLeft = screenWidth;
|
|
132
|
+
const offScreenRight = -screenWidth;
|
|
133
|
+
const openThreshold = threshold;
|
|
134
|
+
const allowLeft = hasLeft;
|
|
135
|
+
const allowRight = hasRight;
|
|
136
|
+
return _reactNativeGestureHandler.Gesture.Pan().enabled(!disabled).activeOffsetX([-DRAG_ACTIVATION_OFFSET, DRAG_ACTIVATION_OFFSET]).failOffsetY([-15, 15]).onStart(() => {
|
|
137
|
+
'worklet';
|
|
138
|
+
|
|
139
|
+
dragStartX.value = translateX.value;
|
|
140
|
+
}).onUpdate(event => {
|
|
141
|
+
'worklet';
|
|
142
|
+
|
|
143
|
+
const next = dragStartX.value + event.translationX;
|
|
144
|
+
// Disallow swipe in directions with no actions configured.
|
|
145
|
+
if (next > 0 && !allowLeft) {
|
|
146
|
+
translateX.value = 0;
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
if (next < 0 && !allowRight) {
|
|
150
|
+
translateX.value = 0;
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
// Rubber-band past the open position so it still feels physical past the cap.
|
|
154
|
+
if (next > leftCap && allowLeft) {
|
|
155
|
+
translateX.value = leftCap + (next - leftCap) * RUBBER_BAND_FACTOR;
|
|
156
|
+
} else if (next < -rightCap && allowRight) {
|
|
157
|
+
translateX.value = -rightCap + (next + rightCap) * RUBBER_BAND_FACTOR;
|
|
158
|
+
} else {
|
|
159
|
+
translateX.value = next;
|
|
160
|
+
}
|
|
161
|
+
}).onEnd(() => {
|
|
162
|
+
'worklet';
|
|
163
|
+
|
|
164
|
+
const releaseX = translateX.value;
|
|
165
|
+
|
|
166
|
+
// Past full-swipe threshold on either side → fire first action and slide off-screen.
|
|
167
|
+
if (allowLeft && releaseX >= fullSwipeLeft) {
|
|
168
|
+
translateX.value = (0, _reactNativeReanimated.withSpring)(offScreenLeft, SPRING_CONFIG);
|
|
169
|
+
(0, _reactNativeReanimated.runOnJS)(fireFirstAction)('left');
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
if (allowRight && releaseX <= fullSwipeRight) {
|
|
173
|
+
translateX.value = (0, _reactNativeReanimated.withSpring)(offScreenRight, SPRING_CONFIG);
|
|
174
|
+
(0, _reactNativeReanimated.runOnJS)(fireFirstAction)('right');
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
// Past open threshold → spring to open position.
|
|
179
|
+
if (allowLeft && releaseX >= openThreshold) {
|
|
180
|
+
translateX.value = (0, _reactNativeReanimated.withSpring)(leftCap, SPRING_CONFIG);
|
|
181
|
+
(0, _reactNativeReanimated.runOnJS)(notifyOpen)('left');
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
if (allowRight && releaseX <= -openThreshold) {
|
|
185
|
+
translateX.value = (0, _reactNativeReanimated.withSpring)(-rightCap, SPRING_CONFIG);
|
|
186
|
+
(0, _reactNativeReanimated.runOnJS)(notifyOpen)('right');
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
// Otherwise → spring back closed.
|
|
191
|
+
translateX.value = (0, _reactNativeReanimated.withSpring)(0, SPRING_CONFIG);
|
|
192
|
+
(0, _reactNativeReanimated.runOnJS)(notifyClose)();
|
|
193
|
+
});
|
|
194
|
+
}, [disabled, dragStartX, fireFirstAction, fullSwipeThreshold, hasLeft, hasRight, leftRevealWidth, notifyClose, notifyOpen, rightRevealWidth, screenWidth, threshold, translateX]);
|
|
195
|
+
|
|
196
|
+
// ───────── Animated styles ─────────
|
|
197
|
+
const contentStyle = (0, _reactNativeReanimated.useAnimatedStyle)(() => ({
|
|
198
|
+
transform: [{
|
|
199
|
+
translateX: translateX.value
|
|
200
|
+
}]
|
|
201
|
+
}));
|
|
202
|
+
|
|
203
|
+
// Each side fades in proportionally to how much it's been revealed.
|
|
204
|
+
const leftBgStyle = (0, _reactNativeReanimated.useAnimatedStyle)(() => ({
|
|
205
|
+
opacity: leftRevealWidth > 0 ? Math.min(1, Math.max(0, translateX.value / leftRevealWidth)) : 0
|
|
206
|
+
}));
|
|
207
|
+
const rightBgStyle = (0, _reactNativeReanimated.useAnimatedStyle)(() => ({
|
|
208
|
+
opacity: rightRevealWidth > 0 ? Math.min(1, Math.max(0, -translateX.value / rightRevealWidth)) : 0
|
|
209
|
+
}));
|
|
210
|
+
|
|
211
|
+
// ───────── A11y actions (so AT users don't need to swipe) ─────────
|
|
212
|
+
const a11yActions = (0, _react.useMemo)(() => {
|
|
213
|
+
const out = [];
|
|
214
|
+
leftActions?.forEach(a => out.push({
|
|
215
|
+
name: a.key,
|
|
216
|
+
label: a.label
|
|
217
|
+
}));
|
|
218
|
+
rightActions?.forEach(a => out.push({
|
|
219
|
+
name: a.key,
|
|
220
|
+
label: a.label
|
|
221
|
+
}));
|
|
222
|
+
return out;
|
|
223
|
+
}, [leftActions, rightActions]);
|
|
224
|
+
const handleA11yAction = (0, _react.useCallback)(event => {
|
|
225
|
+
const name = event.nativeEvent.actionName;
|
|
226
|
+
const all = [...(leftActions ?? []), ...(rightActions ?? [])];
|
|
227
|
+
const match = all.find(a => a.key === name);
|
|
228
|
+
if (match) {
|
|
229
|
+
(0, _index2.triggerHaptic)('selection');
|
|
230
|
+
match.onPress();
|
|
231
|
+
}
|
|
232
|
+
}, [leftActions, rightActions]);
|
|
233
|
+
|
|
234
|
+
// ───────── Render ─────────
|
|
235
|
+
// No actions configured → render children directly; zero gesture overhead.
|
|
236
|
+
if (!hasLeft && !hasRight) {
|
|
237
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
238
|
+
style: containerStyle,
|
|
239
|
+
children: children
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
243
|
+
style: [styles.root, containerStyle],
|
|
244
|
+
testID: testID,
|
|
245
|
+
accessibilityLabel: accessibilityLabel,
|
|
246
|
+
accessibilityActions: a11yActions,
|
|
247
|
+
onAccessibilityAction: handleA11yAction,
|
|
248
|
+
children: [hasLeft ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeReanimated.default.View, {
|
|
249
|
+
style: [styles.actionsRow, styles.actionsLeft, {
|
|
250
|
+
width: leftRevealWidth
|
|
251
|
+
}, leftBgStyle],
|
|
252
|
+
pointerEvents: "box-none",
|
|
253
|
+
children: leftActions?.map(action => /*#__PURE__*/(0, _jsxRuntime.jsx)(ActionButton, {
|
|
254
|
+
action: action,
|
|
255
|
+
theme: theme,
|
|
256
|
+
width: threshold,
|
|
257
|
+
onPress: handleActionPress
|
|
258
|
+
}, action.key))
|
|
259
|
+
}) : null, hasRight ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeReanimated.default.View, {
|
|
260
|
+
style: [styles.actionsRow, styles.actionsRight, {
|
|
261
|
+
width: rightRevealWidth
|
|
262
|
+
}, rightBgStyle],
|
|
263
|
+
pointerEvents: "box-none",
|
|
264
|
+
children: rightActions?.map(action => /*#__PURE__*/(0, _jsxRuntime.jsx)(ActionButton, {
|
|
265
|
+
action: action,
|
|
266
|
+
theme: theme,
|
|
267
|
+
width: threshold,
|
|
268
|
+
onPress: handleActionPress
|
|
269
|
+
}, action.key))
|
|
270
|
+
}) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeGestureHandler.GestureDetector, {
|
|
271
|
+
gesture: panGesture,
|
|
272
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeReanimated.default.View, {
|
|
273
|
+
style: [styles.content, contentStyle],
|
|
274
|
+
children: children
|
|
275
|
+
})
|
|
276
|
+
})]
|
|
277
|
+
});
|
|
278
|
+
};
|
|
279
|
+
exports.Swipeable = Swipeable;
|
|
280
|
+
Swipeable.displayName = 'Swipeable';
|
|
281
|
+
const ActionButton = ({
|
|
282
|
+
action,
|
|
283
|
+
theme,
|
|
284
|
+
width,
|
|
285
|
+
onPress
|
|
286
|
+
}) => {
|
|
287
|
+
const tone = action.tone ?? 'neutral';
|
|
288
|
+
const bg = toneToBg(theme, tone);
|
|
289
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Pressable, {
|
|
290
|
+
onPress: () => onPress(action),
|
|
291
|
+
accessibilityRole: "button",
|
|
292
|
+
accessibilityLabel: action.label,
|
|
293
|
+
style: [actionStyles.button, {
|
|
294
|
+
width,
|
|
295
|
+
backgroundColor: bg,
|
|
296
|
+
paddingHorizontal: theme.spacing.sm
|
|
297
|
+
}],
|
|
298
|
+
children: [action.icon ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
299
|
+
style: actionStyles.icon,
|
|
300
|
+
children: action.icon
|
|
301
|
+
}) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
302
|
+
style: [actionStyles.label, {
|
|
303
|
+
color: theme.colors.text.inverse,
|
|
304
|
+
fontSize: theme.typography.fontSize.sm,
|
|
305
|
+
fontWeight: theme.typography.fontWeight.semibold
|
|
306
|
+
}],
|
|
307
|
+
numberOfLines: 1,
|
|
308
|
+
children: action.label
|
|
309
|
+
})]
|
|
310
|
+
});
|
|
311
|
+
};
|
|
312
|
+
const actionStyles = _reactNative.StyleSheet.create({
|
|
313
|
+
button: {
|
|
314
|
+
flexGrow: 0,
|
|
315
|
+
flexShrink: 0,
|
|
316
|
+
alignItems: 'center',
|
|
317
|
+
justifyContent: 'center'
|
|
318
|
+
},
|
|
319
|
+
icon: {
|
|
320
|
+
marginBottom: 2
|
|
321
|
+
},
|
|
322
|
+
label: {
|
|
323
|
+
textAlign: 'center'
|
|
324
|
+
}
|
|
325
|
+
});
|
|
326
|
+
const buildStyles = _theme => _reactNative.StyleSheet.create({
|
|
327
|
+
root: {
|
|
328
|
+
position: 'relative',
|
|
329
|
+
overflow: 'hidden'
|
|
330
|
+
},
|
|
331
|
+
content: {
|
|
332
|
+
backgroundColor: 'transparent'
|
|
333
|
+
},
|
|
334
|
+
actionsRow: {
|
|
335
|
+
position: 'absolute',
|
|
336
|
+
top: 0,
|
|
337
|
+
bottom: 0,
|
|
338
|
+
flexDirection: 'row'
|
|
339
|
+
},
|
|
340
|
+
actionsLeft: {
|
|
341
|
+
left: 0
|
|
342
|
+
},
|
|
343
|
+
actionsRight: {
|
|
344
|
+
right: 0,
|
|
345
|
+
justifyContent: 'flex-end'
|
|
346
|
+
}
|
|
347
|
+
});
|
|
348
|
+
var _default = exports.default = Swipeable;
|
|
349
|
+
//# sourceMappingURL=Swipeable.js.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "Swipeable", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _Swipeable.Swipeable;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "default", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _Swipeable.default;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
var _Swipeable = _interopRequireWildcard(require("./Swipeable.js"));
|
|
19
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.Switch = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _index = require("../../theme/index.js");
|
|
10
|
+
var _hapticUtils = require("../../utils/hapticUtils.js");
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
13
|
+
const sizeMap = {
|
|
14
|
+
sm: {
|
|
15
|
+
trackWidth: 42,
|
|
16
|
+
trackHeight: 26,
|
|
17
|
+
thumbSize: 22,
|
|
18
|
+
padding: 2
|
|
19
|
+
},
|
|
20
|
+
md: {
|
|
21
|
+
trackWidth: 51,
|
|
22
|
+
trackHeight: 31,
|
|
23
|
+
thumbSize: 27,
|
|
24
|
+
padding: 2
|
|
25
|
+
},
|
|
26
|
+
lg: {
|
|
27
|
+
trackWidth: 60,
|
|
28
|
+
trackHeight: 36,
|
|
29
|
+
thumbSize: 32,
|
|
30
|
+
padding: 2
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
const toneColor = (theme, tone) => {
|
|
34
|
+
switch (tone) {
|
|
35
|
+
case 'success':
|
|
36
|
+
return theme.colors.success;
|
|
37
|
+
case 'warning':
|
|
38
|
+
return theme.colors.warning;
|
|
39
|
+
case 'error':
|
|
40
|
+
return theme.colors.error;
|
|
41
|
+
case 'primary':
|
|
42
|
+
default:
|
|
43
|
+
return theme.colors.primary;
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
const Switch = exports.Switch = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
47
|
+
const {
|
|
48
|
+
value,
|
|
49
|
+
onValueChange,
|
|
50
|
+
disabled = false,
|
|
51
|
+
size = 'md',
|
|
52
|
+
tone = 'primary',
|
|
53
|
+
label,
|
|
54
|
+
accessibilityLabel,
|
|
55
|
+
haptic = 'selection',
|
|
56
|
+
style,
|
|
57
|
+
trackStyle,
|
|
58
|
+
thumbStyle,
|
|
59
|
+
testID,
|
|
60
|
+
...rest
|
|
61
|
+
} = props;
|
|
62
|
+
const theme = (0, _index.useTheme)();
|
|
63
|
+
const sizeStyles = sizeMap[size];
|
|
64
|
+
const styles = (0, _react.useMemo)(() => buildStyles(theme), [theme]);
|
|
65
|
+
const offTrackColor = theme.mode === 'dark' ? theme.colors.secondary : theme.colors.surface.disabled;
|
|
66
|
+
const onTrackColor = toneColor(theme, tone);
|
|
67
|
+
const progress = (0, _react.useRef)(new _reactNative.Animated.Value(value ? 1 : 0)).current;
|
|
68
|
+
(0, _react.useEffect)(() => {
|
|
69
|
+
_reactNative.Animated.spring(progress, {
|
|
70
|
+
toValue: value ? 1 : 0,
|
|
71
|
+
damping: theme.motion.spring.snappy.damping,
|
|
72
|
+
stiffness: theme.motion.spring.snappy.stiffness,
|
|
73
|
+
mass: theme.motion.spring.snappy.mass,
|
|
74
|
+
useNativeDriver: true
|
|
75
|
+
}).start();
|
|
76
|
+
}, [value, progress, theme.motion.spring.snappy]);
|
|
77
|
+
const trackBgAnim = (0, _react.useRef)(new _reactNative.Animated.Value(value ? 1 : 0)).current;
|
|
78
|
+
(0, _react.useEffect)(() => {
|
|
79
|
+
_reactNative.Animated.timing(trackBgAnim, {
|
|
80
|
+
toValue: value ? 1 : 0,
|
|
81
|
+
duration: theme.motion.duration.fast,
|
|
82
|
+
easing: _reactNative.Easing.out(_reactNative.Easing.ease),
|
|
83
|
+
useNativeDriver: false
|
|
84
|
+
}).start();
|
|
85
|
+
}, [value, trackBgAnim, theme.motion.duration.fast]);
|
|
86
|
+
const offX = sizeStyles.padding;
|
|
87
|
+
const onX = sizeStyles.trackWidth - sizeStyles.thumbSize - sizeStyles.padding;
|
|
88
|
+
const translateX = progress.interpolate({
|
|
89
|
+
inputRange: [0, 1],
|
|
90
|
+
outputRange: [offX, onX]
|
|
91
|
+
});
|
|
92
|
+
const trackBg = trackBgAnim.interpolate({
|
|
93
|
+
inputRange: [0, 1],
|
|
94
|
+
outputRange: [offTrackColor, onTrackColor]
|
|
95
|
+
});
|
|
96
|
+
const handlePress = event => {
|
|
97
|
+
if (disabled) return;
|
|
98
|
+
if (haptic !== false) (0, _hapticUtils.triggerHaptic)(haptic);
|
|
99
|
+
onValueChange(!value);
|
|
100
|
+
rest.onPressOut?.(event);
|
|
101
|
+
};
|
|
102
|
+
const accessibleLabel = accessibilityLabel ?? label;
|
|
103
|
+
const switchEl = /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
|
|
104
|
+
ref: ref,
|
|
105
|
+
onPress: handlePress,
|
|
106
|
+
disabled: disabled,
|
|
107
|
+
accessibilityRole: "switch",
|
|
108
|
+
accessibilityLabel: accessibleLabel,
|
|
109
|
+
accessibilityState: {
|
|
110
|
+
checked: value,
|
|
111
|
+
disabled
|
|
112
|
+
},
|
|
113
|
+
testID: testID,
|
|
114
|
+
hitSlop: 8,
|
|
115
|
+
...rest,
|
|
116
|
+
style: ({
|
|
117
|
+
pressed
|
|
118
|
+
}) => [{
|
|
119
|
+
opacity: disabled ? 0.55 : pressed ? 0.9 : 1
|
|
120
|
+
}, label ? null : style],
|
|
121
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Animated.View, {
|
|
122
|
+
style: [styles.track, {
|
|
123
|
+
width: sizeStyles.trackWidth,
|
|
124
|
+
height: sizeStyles.trackHeight,
|
|
125
|
+
borderRadius: sizeStyles.trackHeight / 2,
|
|
126
|
+
backgroundColor: trackBg
|
|
127
|
+
}, trackStyle],
|
|
128
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Animated.View, {
|
|
129
|
+
style: [styles.thumb, theme.shadows.sm, {
|
|
130
|
+
width: sizeStyles.thumbSize,
|
|
131
|
+
height: sizeStyles.thumbSize,
|
|
132
|
+
borderRadius: sizeStyles.thumbSize / 2,
|
|
133
|
+
transform: [{
|
|
134
|
+
translateX
|
|
135
|
+
}]
|
|
136
|
+
}, thumbStyle]
|
|
137
|
+
})
|
|
138
|
+
})
|
|
139
|
+
});
|
|
140
|
+
if (!label) return switchEl;
|
|
141
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
142
|
+
style: [styles.row, style],
|
|
143
|
+
children: [switchEl, /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
144
|
+
style: [styles.label, {
|
|
145
|
+
color: disabled ? theme.colors.text.disabled : theme.colors.text.primary,
|
|
146
|
+
fontSize: theme.typography.fontSize.base
|
|
147
|
+
}],
|
|
148
|
+
numberOfLines: 1,
|
|
149
|
+
children: label
|
|
150
|
+
})]
|
|
151
|
+
});
|
|
152
|
+
});
|
|
153
|
+
Switch.displayName = 'Switch';
|
|
154
|
+
const buildStyles = _theme => _reactNative.StyleSheet.create({
|
|
155
|
+
row: {
|
|
156
|
+
flexDirection: 'row',
|
|
157
|
+
alignItems: 'center'
|
|
158
|
+
},
|
|
159
|
+
track: {
|
|
160
|
+
justifyContent: 'center'
|
|
161
|
+
},
|
|
162
|
+
thumb: {
|
|
163
|
+
backgroundColor: '#FFFFFF',
|
|
164
|
+
position: 'absolute',
|
|
165
|
+
top: 2
|
|
166
|
+
},
|
|
167
|
+
label: {
|
|
168
|
+
marginLeft: 10,
|
|
169
|
+
flexShrink: 1
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
var _default = exports.default = Switch;
|
|
173
|
+
//# sourceMappingURL=Switch.js.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "Switch", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _Switch.Switch;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "default", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _Switch.default;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
var _Switch = _interopRequireWildcard(require("./Switch.js"));
|
|
19
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
20
|
+
//# sourceMappingURL=index.js.map
|