@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,375 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.OTPInput = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _index = require("../../theme/index.js");
|
|
10
|
+
var _index2 = require("../../utils/index.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
|
+
cell: 36,
|
|
16
|
+
fontSize: 16,
|
|
17
|
+
borderRadius: 8,
|
|
18
|
+
gap: 8
|
|
19
|
+
},
|
|
20
|
+
md: {
|
|
21
|
+
cell: 48,
|
|
22
|
+
fontSize: 20,
|
|
23
|
+
borderRadius: 10,
|
|
24
|
+
gap: 10
|
|
25
|
+
},
|
|
26
|
+
lg: {
|
|
27
|
+
cell: 56,
|
|
28
|
+
fontSize: 24,
|
|
29
|
+
borderRadius: 12,
|
|
30
|
+
gap: 12
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
const sanitizeChar = (input, kind) => {
|
|
34
|
+
if (!input) return '';
|
|
35
|
+
if (kind === 'number-pad') {
|
|
36
|
+
return input.replace(/\D/g, '');
|
|
37
|
+
}
|
|
38
|
+
return input;
|
|
39
|
+
};
|
|
40
|
+
const OTPInput = exports.OTPInput = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
41
|
+
const {
|
|
42
|
+
value,
|
|
43
|
+
onChange,
|
|
44
|
+
onComplete,
|
|
45
|
+
length = 6,
|
|
46
|
+
keyboardType = 'number-pad',
|
|
47
|
+
autoFocus = false,
|
|
48
|
+
disabled = false,
|
|
49
|
+
error,
|
|
50
|
+
size = 'md',
|
|
51
|
+
secure = false,
|
|
52
|
+
accessibilityLabel,
|
|
53
|
+
style,
|
|
54
|
+
cellStyle,
|
|
55
|
+
textStyle,
|
|
56
|
+
testID
|
|
57
|
+
} = props;
|
|
58
|
+
const theme = (0, _index.useTheme)();
|
|
59
|
+
const styles = (0, _react.useMemo)(() => buildStyles(theme), [theme]);
|
|
60
|
+
const sizeStyles = sizeMap[size];
|
|
61
|
+
const inputsRef = (0, _react.useRef)([]);
|
|
62
|
+
const [focusedIndex, setFocusedIndex] = (0, _react.useState)(-1);
|
|
63
|
+
const previousErrorRef = (0, _react.useRef)(null);
|
|
64
|
+
const shake = (0, _react.useRef)(new _reactNative.Animated.Value(0)).current;
|
|
65
|
+
const underlines = (0, _react.useRef)(Array.from({
|
|
66
|
+
length
|
|
67
|
+
}, () => new _reactNative.Animated.Value(0))).current;
|
|
68
|
+
const previousFocusedIndexRef = (0, _react.useRef)(-1);
|
|
69
|
+
|
|
70
|
+
// Resize underline array if length prop changes between renders.
|
|
71
|
+
if (underlines.length !== length) {
|
|
72
|
+
if (underlines.length < length) {
|
|
73
|
+
for (let i = underlines.length; i < length; i += 1) {
|
|
74
|
+
underlines.push(new _reactNative.Animated.Value(0));
|
|
75
|
+
}
|
|
76
|
+
} else {
|
|
77
|
+
underlines.length = length;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
const hasError = Boolean(error);
|
|
81
|
+
const errorMessage = typeof error === 'string' ? error : undefined;
|
|
82
|
+
|
|
83
|
+
// Shake on transition from no-error -> error. Skip on first mount even if
|
|
84
|
+
// error is initially true — there's no transition to animate.
|
|
85
|
+
(0, _react.useEffect)(() => {
|
|
86
|
+
const isFirstRun = previousErrorRef.current === null;
|
|
87
|
+
if (!isFirstRun && hasError && !previousErrorRef.current) {
|
|
88
|
+
(0, _index2.triggerHaptic)('notificationError');
|
|
89
|
+
shake.setValue(0);
|
|
90
|
+
_reactNative.Animated.sequence([_reactNative.Animated.timing(shake, {
|
|
91
|
+
toValue: 1,
|
|
92
|
+
duration: 75,
|
|
93
|
+
easing: _reactNative.Easing.linear,
|
|
94
|
+
useNativeDriver: true
|
|
95
|
+
}), _reactNative.Animated.timing(shake, {
|
|
96
|
+
toValue: -1,
|
|
97
|
+
duration: 75,
|
|
98
|
+
easing: _reactNative.Easing.linear,
|
|
99
|
+
useNativeDriver: true
|
|
100
|
+
}), _reactNative.Animated.timing(shake, {
|
|
101
|
+
toValue: 1,
|
|
102
|
+
duration: 75,
|
|
103
|
+
easing: _reactNative.Easing.linear,
|
|
104
|
+
useNativeDriver: true
|
|
105
|
+
}), _reactNative.Animated.timing(shake, {
|
|
106
|
+
toValue: 0,
|
|
107
|
+
duration: 75,
|
|
108
|
+
easing: _reactNative.Easing.linear,
|
|
109
|
+
useNativeDriver: true
|
|
110
|
+
})]).start();
|
|
111
|
+
}
|
|
112
|
+
previousErrorRef.current = hasError;
|
|
113
|
+
}, [hasError, shake]);
|
|
114
|
+
|
|
115
|
+
// Animate underline opacity for the focused cell. Skip on first mount
|
|
116
|
+
// (no prior focus state) — values are already at 0 and there's nothing to animate.
|
|
117
|
+
(0, _react.useEffect)(() => {
|
|
118
|
+
const previous = previousFocusedIndexRef.current;
|
|
119
|
+
previousFocusedIndexRef.current = focusedIndex;
|
|
120
|
+
if (previous === focusedIndex) return;
|
|
121
|
+
if (previous === -1 && focusedIndex === -1) return;
|
|
122
|
+
underlines.forEach((anim, idx) => {
|
|
123
|
+
const target = idx === focusedIndex ? 1 : 0;
|
|
124
|
+
// Only animate the cells whose target changed.
|
|
125
|
+
if (idx !== focusedIndex && idx !== previous) return;
|
|
126
|
+
_reactNative.Animated.timing(anim, {
|
|
127
|
+
toValue: target,
|
|
128
|
+
duration: theme.motion.duration.fast,
|
|
129
|
+
easing: _reactNative.Easing.bezier(...theme.motion.easing.standard),
|
|
130
|
+
useNativeDriver: true
|
|
131
|
+
}).start();
|
|
132
|
+
});
|
|
133
|
+
}, [focusedIndex, underlines, theme]);
|
|
134
|
+
const focusCell = (0, _react.useCallback)(index => {
|
|
135
|
+
const target = inputsRef.current[index];
|
|
136
|
+
if (target) {
|
|
137
|
+
target.focus();
|
|
138
|
+
}
|
|
139
|
+
}, []);
|
|
140
|
+
(0, _react.useImperativeHandle)(ref, () => ({
|
|
141
|
+
focus: () => focusCell(0),
|
|
142
|
+
blur: () => {
|
|
143
|
+
const current = inputsRef.current[focusedIndex >= 0 ? focusedIndex : 0];
|
|
144
|
+
current?.blur();
|
|
145
|
+
},
|
|
146
|
+
clear: () => {
|
|
147
|
+
onChange('');
|
|
148
|
+
focusCell(0);
|
|
149
|
+
}
|
|
150
|
+
}), [focusCell, focusedIndex, onChange]);
|
|
151
|
+
(0, _react.useEffect)(() => {
|
|
152
|
+
if (autoFocus && !disabled) {
|
|
153
|
+
// Defer one frame so the inputs are mounted.
|
|
154
|
+
const timer = setTimeout(() => focusCell(0), 0);
|
|
155
|
+
return () => clearTimeout(timer);
|
|
156
|
+
}
|
|
157
|
+
return undefined;
|
|
158
|
+
}, [autoFocus, disabled, focusCell]);
|
|
159
|
+
const cells = (0, _react.useMemo)(() => {
|
|
160
|
+
const arr = new Array(length).fill('');
|
|
161
|
+
for (let i = 0; i < Math.min(value.length, length); i += 1) {
|
|
162
|
+
arr[i] = value[i] ?? '';
|
|
163
|
+
}
|
|
164
|
+
return arr;
|
|
165
|
+
}, [value, length]);
|
|
166
|
+
const updateValue = (0, _react.useCallback)(next => {
|
|
167
|
+
const trimmed = next.slice(0, length);
|
|
168
|
+
if (trimmed === value) return;
|
|
169
|
+
onChange(trimmed);
|
|
170
|
+
if (trimmed.length === length && onComplete) {
|
|
171
|
+
onComplete(trimmed);
|
|
172
|
+
}
|
|
173
|
+
}, [length, onChange, onComplete, value]);
|
|
174
|
+
const handleChangeText = (0, _react.useCallback)((index, raw) => {
|
|
175
|
+
const sanitized = sanitizeChar(raw, keyboardType);
|
|
176
|
+
if (!sanitized) {
|
|
177
|
+
// User cleared this cell explicitly via change (rare since we manage backspace via key-press).
|
|
178
|
+
const chars = cells.slice();
|
|
179
|
+
chars[index] = '';
|
|
180
|
+
updateValue(chars.join('').slice(0, length));
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
// Fill cells from current index onward (handles paste of multi-char text).
|
|
185
|
+
const chars = cells.slice();
|
|
186
|
+
let writeIndex = index;
|
|
187
|
+
for (let i = 0; i < sanitized.length && writeIndex < length; i += 1) {
|
|
188
|
+
chars[writeIndex] = sanitized[i] ?? '';
|
|
189
|
+
writeIndex += 1;
|
|
190
|
+
}
|
|
191
|
+
const next = chars.join('').slice(0, length);
|
|
192
|
+
const previousLength = value.length;
|
|
193
|
+
updateValue(next);
|
|
194
|
+
if (next.length !== previousLength) {
|
|
195
|
+
(0, _index2.triggerHaptic)('selection');
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
// Move focus to the next empty cell or last cell.
|
|
199
|
+
const nextFocus = Math.min(writeIndex, length - 1);
|
|
200
|
+
if (writeIndex >= length) {
|
|
201
|
+
// All filled — blur last cell.
|
|
202
|
+
inputsRef.current[length - 1]?.blur();
|
|
203
|
+
} else {
|
|
204
|
+
focusCell(nextFocus);
|
|
205
|
+
}
|
|
206
|
+
}, [cells, focusCell, keyboardType, length, updateValue, value]);
|
|
207
|
+
const handleKeyPress = (0, _react.useCallback)((index, e) => {
|
|
208
|
+
const key = e.nativeEvent.key;
|
|
209
|
+
if (key !== 'Backspace') return;
|
|
210
|
+
const current = cells[index] ?? '';
|
|
211
|
+
if (current.length === 0) {
|
|
212
|
+
// Move back, clear previous cell.
|
|
213
|
+
if (index > 0) {
|
|
214
|
+
const chars = cells.slice();
|
|
215
|
+
chars[index - 1] = '';
|
|
216
|
+
updateValue(chars.join(''));
|
|
217
|
+
focusCell(index - 1);
|
|
218
|
+
}
|
|
219
|
+
} else {
|
|
220
|
+
const chars = cells.slice();
|
|
221
|
+
chars[index] = '';
|
|
222
|
+
updateValue(chars.join(''));
|
|
223
|
+
}
|
|
224
|
+
}, [cells, focusCell, updateValue]);
|
|
225
|
+
const handleFocus = (0, _react.useCallback)(index => {
|
|
226
|
+
setFocusedIndex(index);
|
|
227
|
+
}, []);
|
|
228
|
+
const handleBlur = (0, _react.useCallback)(() => {
|
|
229
|
+
setFocusedIndex(-1);
|
|
230
|
+
}, []);
|
|
231
|
+
const handleContainerPress = (0, _react.useCallback)(() => {
|
|
232
|
+
if (disabled) return;
|
|
233
|
+
// Focus the first empty cell, else the last cell.
|
|
234
|
+
const firstEmpty = cells.findIndex(c => c === '');
|
|
235
|
+
focusCell(firstEmpty === -1 ? length - 1 : firstEmpty);
|
|
236
|
+
}, [cells, disabled, focusCell, length]);
|
|
237
|
+
const accessibleLabel = accessibilityLabel ?? `Enter ${length}-digit code`;
|
|
238
|
+
const translateX = shake.interpolate({
|
|
239
|
+
inputRange: [-1, 1],
|
|
240
|
+
outputRange: [-6, 6]
|
|
241
|
+
});
|
|
242
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
243
|
+
style: style,
|
|
244
|
+
accessible: true,
|
|
245
|
+
accessibilityRole: "none",
|
|
246
|
+
accessibilityLabel: accessibleLabel,
|
|
247
|
+
accessibilityValue: {
|
|
248
|
+
text: value
|
|
249
|
+
},
|
|
250
|
+
accessibilityState: {
|
|
251
|
+
disabled
|
|
252
|
+
},
|
|
253
|
+
testID: testID,
|
|
254
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
|
|
255
|
+
onPress: handleContainerPress,
|
|
256
|
+
disabled: disabled,
|
|
257
|
+
accessible: false,
|
|
258
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Animated.View, {
|
|
259
|
+
style: [styles.row, {
|
|
260
|
+
columnGap: sizeStyles.gap,
|
|
261
|
+
transform: [{
|
|
262
|
+
translateX
|
|
263
|
+
}]
|
|
264
|
+
}],
|
|
265
|
+
children: cells.map((char, index) => {
|
|
266
|
+
const isFocused = focusedIndex === index;
|
|
267
|
+
const isFilled = char.length > 0;
|
|
268
|
+
const borderColor = hasError ? theme.colors.border.error : isFocused ? theme.colors.border.focus : theme.colors.border.primary;
|
|
269
|
+
const backgroundColor = disabled ? theme.colors.surface.disabled : theme.colors.background.secondary;
|
|
270
|
+
const underlineColor = hasError ? theme.colors.border.error : theme.colors.border.focus;
|
|
271
|
+
const underlineOpacity = underlines[index] ?? new _reactNative.Animated.Value(0);
|
|
272
|
+
const display = secure && isFilled ? '●' : char;
|
|
273
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
274
|
+
style: styles.cellWrapper,
|
|
275
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
276
|
+
style: [styles.cell, {
|
|
277
|
+
width: sizeStyles.cell,
|
|
278
|
+
height: sizeStyles.cell,
|
|
279
|
+
borderRadius: sizeStyles.borderRadius,
|
|
280
|
+
backgroundColor,
|
|
281
|
+
borderColor
|
|
282
|
+
}, cellStyle],
|
|
283
|
+
accessibilityElementsHidden: true,
|
|
284
|
+
importantForAccessibility: "no-hide-descendants",
|
|
285
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TextInput, {
|
|
286
|
+
ref: node => {
|
|
287
|
+
inputsRef.current[index] = node;
|
|
288
|
+
},
|
|
289
|
+
value: secure && isFilled ? '' : char,
|
|
290
|
+
onChangeText: t => handleChangeText(index, t),
|
|
291
|
+
onKeyPress: e => handleKeyPress(index, e),
|
|
292
|
+
onFocus: () => handleFocus(index),
|
|
293
|
+
onBlur: handleBlur,
|
|
294
|
+
keyboardType: keyboardType,
|
|
295
|
+
editable: !disabled,
|
|
296
|
+
selectTextOnFocus: true,
|
|
297
|
+
caretHidden: isFilled,
|
|
298
|
+
maxLength: length,
|
|
299
|
+
textContentType: index === 0 ? 'oneTimeCode' : 'none',
|
|
300
|
+
autoComplete: index === 0 ? 'sms-otp' : 'off',
|
|
301
|
+
importantForAutofill: index === 0 ? 'yes' : 'no',
|
|
302
|
+
style: [styles.input, {
|
|
303
|
+
fontSize: sizeStyles.fontSize,
|
|
304
|
+
color: theme.colors.text.primary,
|
|
305
|
+
fontWeight: theme.typography.fontWeight.semibold
|
|
306
|
+
}, textStyle]
|
|
307
|
+
}), secure && isFilled ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
308
|
+
pointerEvents: "none",
|
|
309
|
+
style: styles.maskOverlay,
|
|
310
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
311
|
+
style: [{
|
|
312
|
+
fontSize: sizeStyles.fontSize,
|
|
313
|
+
color: theme.colors.text.primary,
|
|
314
|
+
fontWeight: theme.typography.fontWeight.semibold
|
|
315
|
+
}, textStyle],
|
|
316
|
+
children: display
|
|
317
|
+
})
|
|
318
|
+
}) : null]
|
|
319
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Animated.View, {
|
|
320
|
+
style: [styles.underline, {
|
|
321
|
+
backgroundColor: underlineColor,
|
|
322
|
+
opacity: underlineOpacity
|
|
323
|
+
}]
|
|
324
|
+
})]
|
|
325
|
+
}, `otp-cell-${index}`);
|
|
326
|
+
})
|
|
327
|
+
})
|
|
328
|
+
}), errorMessage ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
329
|
+
style: [styles.errorText, {
|
|
330
|
+
color: theme.colors.error,
|
|
331
|
+
fontSize: theme.typography.fontSize.sm
|
|
332
|
+
}],
|
|
333
|
+
accessibilityLiveRegion: "polite",
|
|
334
|
+
children: errorMessage
|
|
335
|
+
}) : null]
|
|
336
|
+
});
|
|
337
|
+
});
|
|
338
|
+
OTPInput.displayName = 'OTPInput';
|
|
339
|
+
const buildStyles = _theme => _reactNative.StyleSheet.create({
|
|
340
|
+
row: {
|
|
341
|
+
flexDirection: 'row',
|
|
342
|
+
alignItems: 'center'
|
|
343
|
+
},
|
|
344
|
+
cellWrapper: {
|
|
345
|
+
alignItems: 'center'
|
|
346
|
+
},
|
|
347
|
+
cell: {
|
|
348
|
+
borderWidth: 1.5,
|
|
349
|
+
alignItems: 'center',
|
|
350
|
+
justifyContent: 'center',
|
|
351
|
+
overflow: 'hidden'
|
|
352
|
+
},
|
|
353
|
+
input: {
|
|
354
|
+
width: '100%',
|
|
355
|
+
height: '100%',
|
|
356
|
+
textAlign: 'center',
|
|
357
|
+
padding: 0
|
|
358
|
+
},
|
|
359
|
+
maskOverlay: {
|
|
360
|
+
..._reactNative.StyleSheet.absoluteFillObject,
|
|
361
|
+
alignItems: 'center',
|
|
362
|
+
justifyContent: 'center'
|
|
363
|
+
},
|
|
364
|
+
underline: {
|
|
365
|
+
marginTop: 4,
|
|
366
|
+
height: 2,
|
|
367
|
+
width: '60%',
|
|
368
|
+
borderRadius: 1
|
|
369
|
+
},
|
|
370
|
+
errorText: {
|
|
371
|
+
marginTop: 6
|
|
372
|
+
}
|
|
373
|
+
});
|
|
374
|
+
var _default = exports.default = OTPInput;
|
|
375
|
+
//# sourceMappingURL=OTPInput.js.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "OTPInput", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _OTPInput.OTPInput;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "default", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _OTPInput.default;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
var _OTPInput = _interopRequireWildcard(require("./OTPInput.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,149 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.ProgressBar = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _index = require("../../theme/index.js");
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
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); }
|
|
12
|
+
const toneColor = (theme, tone) => {
|
|
13
|
+
switch (tone) {
|
|
14
|
+
case 'success':
|
|
15
|
+
return theme.colors.success;
|
|
16
|
+
case 'warning':
|
|
17
|
+
return theme.colors.warning;
|
|
18
|
+
case 'error':
|
|
19
|
+
return theme.colors.error;
|
|
20
|
+
case 'primary':
|
|
21
|
+
default:
|
|
22
|
+
return theme.colors.primary;
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
const clampProgress = value => {
|
|
26
|
+
if (typeof value !== 'number' || Number.isNaN(value)) return 0;
|
|
27
|
+
if (value < 0) return 0;
|
|
28
|
+
if (value > 1) return 1;
|
|
29
|
+
return value;
|
|
30
|
+
};
|
|
31
|
+
const ProgressBar = exports.ProgressBar = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
32
|
+
const theme = (0, _index.useTheme)();
|
|
33
|
+
const {
|
|
34
|
+
progress,
|
|
35
|
+
indeterminate: indeterminateProp,
|
|
36
|
+
height = 6,
|
|
37
|
+
radius,
|
|
38
|
+
tone = 'primary',
|
|
39
|
+
trackColor,
|
|
40
|
+
barColor,
|
|
41
|
+
animated = true,
|
|
42
|
+
style,
|
|
43
|
+
accessibilityLabel,
|
|
44
|
+
testID
|
|
45
|
+
} = props;
|
|
46
|
+
const isIndeterminate = indeterminateProp ?? typeof progress !== 'number';
|
|
47
|
+
const clamped = clampProgress(progress);
|
|
48
|
+
const fillAnim = (0, _react.useRef)(new _reactNative.Animated.Value(clamped)).current;
|
|
49
|
+
const loopAnim = (0, _react.useRef)(new _reactNative.Animated.Value(0)).current;
|
|
50
|
+
const widthRef = (0, _react.useRef)(0);
|
|
51
|
+
const styles = (0, _react.useMemo)(() => buildStyles(theme), [theme]);
|
|
52
|
+
const resolvedRadius = radius ?? theme.radius.full;
|
|
53
|
+
const resolvedTrack = trackColor ?? theme.colors.surface.disabled;
|
|
54
|
+
const resolvedBar = barColor ?? toneColor(theme, tone);
|
|
55
|
+
(0, _react.useEffect)(() => {
|
|
56
|
+
if (isIndeterminate) return;
|
|
57
|
+
if (!animated) {
|
|
58
|
+
fillAnim.setValue(clamped);
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
_reactNative.Animated.timing(fillAnim, {
|
|
62
|
+
toValue: clamped,
|
|
63
|
+
duration: 400,
|
|
64
|
+
easing: _reactNative.Easing.bezier(...theme.motion.easing.standard),
|
|
65
|
+
useNativeDriver: false
|
|
66
|
+
}).start();
|
|
67
|
+
}, [animated, clamped, fillAnim, isIndeterminate, theme]);
|
|
68
|
+
(0, _react.useEffect)(() => {
|
|
69
|
+
if (!isIndeterminate) return;
|
|
70
|
+
loopAnim.setValue(0);
|
|
71
|
+
const animation = _reactNative.Animated.loop(_reactNative.Animated.timing(loopAnim, {
|
|
72
|
+
toValue: 1,
|
|
73
|
+
duration: 1500,
|
|
74
|
+
easing: _reactNative.Easing.inOut(_reactNative.Easing.ease),
|
|
75
|
+
useNativeDriver: true
|
|
76
|
+
}));
|
|
77
|
+
animation.start();
|
|
78
|
+
return () => {
|
|
79
|
+
animation.stop();
|
|
80
|
+
};
|
|
81
|
+
}, [isIndeterminate, loopAnim]);
|
|
82
|
+
const determinateWidth = fillAnim.interpolate({
|
|
83
|
+
inputRange: [0, 1],
|
|
84
|
+
outputRange: ['0%', '100%']
|
|
85
|
+
});
|
|
86
|
+
const indeterminateTranslate = loopAnim.interpolate({
|
|
87
|
+
inputRange: [0, 1],
|
|
88
|
+
outputRange: [-1, 1]
|
|
89
|
+
});
|
|
90
|
+
const onLayout = event => {
|
|
91
|
+
widthRef.current = event.nativeEvent.layout.width;
|
|
92
|
+
};
|
|
93
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
94
|
+
ref: ref,
|
|
95
|
+
accessibilityRole: "progressbar",
|
|
96
|
+
accessibilityLabel: accessibilityLabel,
|
|
97
|
+
accessibilityValue: isIndeterminate ? {
|
|
98
|
+
text: 'Loading'
|
|
99
|
+
} : {
|
|
100
|
+
min: 0,
|
|
101
|
+
max: 100,
|
|
102
|
+
now: Math.round(clamped * 100)
|
|
103
|
+
},
|
|
104
|
+
testID: testID,
|
|
105
|
+
onLayout: onLayout,
|
|
106
|
+
style: [styles.track, {
|
|
107
|
+
height,
|
|
108
|
+
borderRadius: resolvedRadius,
|
|
109
|
+
backgroundColor: resolvedTrack
|
|
110
|
+
}, style],
|
|
111
|
+
children: isIndeterminate ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Animated.View, {
|
|
112
|
+
style: [styles.indeterminateBar, {
|
|
113
|
+
height,
|
|
114
|
+
borderRadius: resolvedRadius,
|
|
115
|
+
backgroundColor: resolvedBar,
|
|
116
|
+
transform: [{
|
|
117
|
+
translateX: _reactNative.Animated.multiply(indeterminateTranslate, new _reactNative.Animated.Value(widthRef.current || 0))
|
|
118
|
+
}]
|
|
119
|
+
}]
|
|
120
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Animated.View, {
|
|
121
|
+
style: [styles.determinateBar, {
|
|
122
|
+
height,
|
|
123
|
+
borderRadius: resolvedRadius,
|
|
124
|
+
backgroundColor: resolvedBar,
|
|
125
|
+
width: determinateWidth
|
|
126
|
+
}]
|
|
127
|
+
})
|
|
128
|
+
});
|
|
129
|
+
});
|
|
130
|
+
ProgressBar.displayName = 'ProgressBar';
|
|
131
|
+
const buildStyles = _theme => _reactNative.StyleSheet.create({
|
|
132
|
+
track: {
|
|
133
|
+
width: '100%',
|
|
134
|
+
overflow: 'hidden'
|
|
135
|
+
},
|
|
136
|
+
determinateBar: {
|
|
137
|
+
position: 'absolute',
|
|
138
|
+
left: 0,
|
|
139
|
+
top: 0
|
|
140
|
+
},
|
|
141
|
+
indeterminateBar: {
|
|
142
|
+
position: 'absolute',
|
|
143
|
+
left: 0,
|
|
144
|
+
top: 0,
|
|
145
|
+
width: '30%'
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
var _default = exports.default = ProgressBar;
|
|
149
|
+
//# sourceMappingURL=ProgressBar.js.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "ProgressBar", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _ProgressBar.ProgressBar;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "default", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _ProgressBar.default;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
var _ProgressBar = _interopRequireWildcard(require("./ProgressBar.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
|