@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,363 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.Tooltip = 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 TOOLTIP_GAP = 8;
|
|
13
|
+
const SCREEN_PADDING = 8;
|
|
14
|
+
const PRESS_AUTO_HIDE_MS = 4000;
|
|
15
|
+
const ARROW_HALF_WIDTH = 4; // half of 8px arrow base
|
|
16
|
+
const ARROW_HEIGHT = 6;
|
|
17
|
+
const ARROW_CORNER_PADDING = 12;
|
|
18
|
+
const Tooltip = props => {
|
|
19
|
+
const {
|
|
20
|
+
content,
|
|
21
|
+
children,
|
|
22
|
+
placement = 'auto',
|
|
23
|
+
trigger = 'longPress',
|
|
24
|
+
visible: controlledVisible,
|
|
25
|
+
onVisibleChange,
|
|
26
|
+
hideOnContentPress = true,
|
|
27
|
+
maxWidth = 240,
|
|
28
|
+
showArrow = true,
|
|
29
|
+
accessibilityLabel,
|
|
30
|
+
style,
|
|
31
|
+
testID
|
|
32
|
+
} = props;
|
|
33
|
+
const theme = (0, _index.useTheme)();
|
|
34
|
+
const styles = (0, _react.useMemo)(() => buildStyles(theme), [theme]);
|
|
35
|
+
const isControlled = trigger === 'manual' || typeof controlledVisible === 'boolean';
|
|
36
|
+
const [internalVisible, setInternalVisible] = (0, _react.useState)(false);
|
|
37
|
+
const visible = isControlled ? Boolean(controlledVisible) : internalVisible;
|
|
38
|
+
const [anchor, setAnchor] = (0, _react.useState)(null);
|
|
39
|
+
const [size, setSize] = (0, _react.useState)({
|
|
40
|
+
width: 0,
|
|
41
|
+
height: 0
|
|
42
|
+
});
|
|
43
|
+
const wrapperRef = (0, _react.useRef)(null);
|
|
44
|
+
const scale = (0, _react.useRef)(new _reactNative.Animated.Value(visible ? 1 : 0.85)).current;
|
|
45
|
+
const opacity = (0, _react.useRef)(new _reactNative.Animated.Value(visible ? 1 : 0)).current;
|
|
46
|
+
const autoHideTimer = (0, _react.useRef)(null);
|
|
47
|
+
const didMount = (0, _react.useRef)(false);
|
|
48
|
+
const setVisible = (0, _react.useCallback)(next => {
|
|
49
|
+
if (!isControlled) setInternalVisible(next);
|
|
50
|
+
onVisibleChange?.(next);
|
|
51
|
+
}, [isControlled, onVisibleChange]);
|
|
52
|
+
const measureAnchor = (0, _react.useCallback)(() => {
|
|
53
|
+
if (!wrapperRef.current) return;
|
|
54
|
+
wrapperRef.current.measureInWindow((x, y, width, height) => {
|
|
55
|
+
setAnchor({
|
|
56
|
+
x,
|
|
57
|
+
y,
|
|
58
|
+
width,
|
|
59
|
+
height
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
}, []);
|
|
63
|
+
const handleTrigger = (0, _react.useCallback)(_event => {
|
|
64
|
+
if (trigger === 'manual') return;
|
|
65
|
+
measureAnchor();
|
|
66
|
+
setVisible(true);
|
|
67
|
+
}, [trigger, measureAnchor, setVisible]);
|
|
68
|
+
const handleHide = (0, _react.useCallback)(() => {
|
|
69
|
+
setVisible(false);
|
|
70
|
+
}, [setVisible]);
|
|
71
|
+
|
|
72
|
+
// Animations + auto-hide
|
|
73
|
+
(0, _react.useEffect)(() => {
|
|
74
|
+
// On first mount, skip the entry animation if we're already visible
|
|
75
|
+
// (avoids native-driver bootstrap issues during render).
|
|
76
|
+
if (!didMount.current) {
|
|
77
|
+
didMount.current = true;
|
|
78
|
+
if (visible) {
|
|
79
|
+
measureAnchor();
|
|
80
|
+
if (trigger === 'press') {
|
|
81
|
+
if (autoHideTimer.current) clearTimeout(autoHideTimer.current);
|
|
82
|
+
autoHideTimer.current = setTimeout(() => {
|
|
83
|
+
handleHide();
|
|
84
|
+
}, PRESS_AUTO_HIDE_MS);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return () => {
|
|
88
|
+
if (autoHideTimer.current) {
|
|
89
|
+
clearTimeout(autoHideTimer.current);
|
|
90
|
+
autoHideTimer.current = null;
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
if (visible) {
|
|
95
|
+
measureAnchor();
|
|
96
|
+
_reactNative.Animated.parallel([_reactNative.Animated.spring(scale, {
|
|
97
|
+
toValue: 1,
|
|
98
|
+
damping: theme.motion.spring.snappy.damping,
|
|
99
|
+
stiffness: theme.motion.spring.snappy.stiffness,
|
|
100
|
+
mass: theme.motion.spring.snappy.mass,
|
|
101
|
+
useNativeDriver: true
|
|
102
|
+
}), _reactNative.Animated.timing(opacity, {
|
|
103
|
+
toValue: 1,
|
|
104
|
+
duration: theme.motion.duration.fast,
|
|
105
|
+
useNativeDriver: true
|
|
106
|
+
})]).start();
|
|
107
|
+
if (trigger === 'press') {
|
|
108
|
+
if (autoHideTimer.current) clearTimeout(autoHideTimer.current);
|
|
109
|
+
autoHideTimer.current = setTimeout(() => {
|
|
110
|
+
handleHide();
|
|
111
|
+
}, PRESS_AUTO_HIDE_MS);
|
|
112
|
+
}
|
|
113
|
+
} else {
|
|
114
|
+
_reactNative.Animated.parallel([_reactNative.Animated.timing(scale, {
|
|
115
|
+
toValue: 0.85,
|
|
116
|
+
duration: 150,
|
|
117
|
+
useNativeDriver: true
|
|
118
|
+
}), _reactNative.Animated.timing(opacity, {
|
|
119
|
+
toValue: 0,
|
|
120
|
+
duration: 150,
|
|
121
|
+
useNativeDriver: true
|
|
122
|
+
})]).start();
|
|
123
|
+
if (autoHideTimer.current) {
|
|
124
|
+
clearTimeout(autoHideTimer.current);
|
|
125
|
+
autoHideTimer.current = null;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
return () => {
|
|
129
|
+
if (autoHideTimer.current) {
|
|
130
|
+
clearTimeout(autoHideTimer.current);
|
|
131
|
+
autoHideTimer.current = null;
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
135
|
+
}, [visible]);
|
|
136
|
+
const handleContentLayout = e => {
|
|
137
|
+
const {
|
|
138
|
+
width,
|
|
139
|
+
height
|
|
140
|
+
} = e.nativeEvent.layout;
|
|
141
|
+
if (width !== size.width || height !== size.height) {
|
|
142
|
+
setSize({
|
|
143
|
+
width,
|
|
144
|
+
height
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
const position = (0, _react.useMemo)(() => {
|
|
149
|
+
const screen = _reactNative.Dimensions.get('window');
|
|
150
|
+
if (!anchor) {
|
|
151
|
+
// Fallback before measurement: render off-screen-ish at top-left, will reposition on layout.
|
|
152
|
+
return {
|
|
153
|
+
top: SCREEN_PADDING,
|
|
154
|
+
left: SCREEN_PADDING,
|
|
155
|
+
placement: 'bottom',
|
|
156
|
+
arrowOffset: 0
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
const tooltipWidth = size.width || Math.min(maxWidth, screen.width - SCREEN_PADDING * 2);
|
|
160
|
+
const tooltipHeight = size.height || 0;
|
|
161
|
+
|
|
162
|
+
// Choose placement.
|
|
163
|
+
let resolved;
|
|
164
|
+
if (placement === 'auto') {
|
|
165
|
+
const space = {
|
|
166
|
+
top: anchor.y,
|
|
167
|
+
bottom: screen.height - (anchor.y + anchor.height),
|
|
168
|
+
left: anchor.x,
|
|
169
|
+
right: screen.width - (anchor.x + anchor.width)
|
|
170
|
+
};
|
|
171
|
+
const max = Math.max(space.top, space.bottom, space.left, space.right);
|
|
172
|
+
if (max === space.bottom) resolved = 'bottom';else if (max === space.top) resolved = 'top';else if (max === space.right) resolved = 'right';else resolved = 'left';
|
|
173
|
+
} else {
|
|
174
|
+
resolved = placement;
|
|
175
|
+
}
|
|
176
|
+
let top = 0;
|
|
177
|
+
let left = 0;
|
|
178
|
+
if (resolved === 'top') {
|
|
179
|
+
top = anchor.y - tooltipHeight - TOOLTIP_GAP;
|
|
180
|
+
left = anchor.x + anchor.width / 2 - tooltipWidth / 2;
|
|
181
|
+
} else if (resolved === 'bottom') {
|
|
182
|
+
top = anchor.y + anchor.height + TOOLTIP_GAP;
|
|
183
|
+
left = anchor.x + anchor.width / 2 - tooltipWidth / 2;
|
|
184
|
+
} else if (resolved === 'left') {
|
|
185
|
+
top = anchor.y + anchor.height / 2 - tooltipHeight / 2;
|
|
186
|
+
left = anchor.x - tooltipWidth - TOOLTIP_GAP;
|
|
187
|
+
} else {
|
|
188
|
+
top = anchor.y + anchor.height / 2 - tooltipHeight / 2;
|
|
189
|
+
left = anchor.x + anchor.width + TOOLTIP_GAP;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
// Clamp to screen.
|
|
193
|
+
left = Math.max(SCREEN_PADDING, Math.min(left, screen.width - tooltipWidth - SCREEN_PADDING));
|
|
194
|
+
top = Math.max(SCREEN_PADDING, Math.min(top, screen.height - tooltipHeight - SCREEN_PADDING));
|
|
195
|
+
|
|
196
|
+
// Compute arrow offset along the card's trigger-facing edge so the caret stays
|
|
197
|
+
// pointing at the trigger even after the card is clamped to the viewport.
|
|
198
|
+
let arrowOffset = 0;
|
|
199
|
+
if (resolved === 'top' || resolved === 'bottom') {
|
|
200
|
+
const triggerCenterX = anchor.x + anchor.width / 2;
|
|
201
|
+
const desired = triggerCenterX - left; // x-offset from card's left edge
|
|
202
|
+
const min = ARROW_CORNER_PADDING;
|
|
203
|
+
const max = Math.max(min, tooltipWidth - ARROW_CORNER_PADDING);
|
|
204
|
+
arrowOffset = Math.max(min, Math.min(desired, max));
|
|
205
|
+
} else {
|
|
206
|
+
const triggerCenterY = anchor.y + anchor.height / 2;
|
|
207
|
+
const desired = triggerCenterY - top;
|
|
208
|
+
const min = ARROW_CORNER_PADDING;
|
|
209
|
+
const max = Math.max(min, tooltipHeight - ARROW_CORNER_PADDING);
|
|
210
|
+
arrowOffset = Math.max(min, Math.min(desired, max));
|
|
211
|
+
}
|
|
212
|
+
return {
|
|
213
|
+
top,
|
|
214
|
+
left,
|
|
215
|
+
placement: resolved,
|
|
216
|
+
arrowOffset
|
|
217
|
+
};
|
|
218
|
+
}, [anchor, size, placement, maxWidth]);
|
|
219
|
+
|
|
220
|
+
// Build the cloned trigger.
|
|
221
|
+
const triggerProps = {};
|
|
222
|
+
if (trigger === 'longPress') {
|
|
223
|
+
triggerProps.onLongPress = handleTrigger;
|
|
224
|
+
triggerProps.accessibilityHint = 'Long press for more info';
|
|
225
|
+
} else if (trigger === 'press') {
|
|
226
|
+
const childOnPress = children.props.onPress;
|
|
227
|
+
triggerProps.onPress = e => {
|
|
228
|
+
childOnPress?.(e);
|
|
229
|
+
handleTrigger(e);
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
const clonedChild = /*#__PURE__*/_react.default.cloneElement(children, triggerProps);
|
|
233
|
+
const a11yLabel = accessibilityLabel ?? (typeof content === 'string' ? content : 'Tooltip');
|
|
234
|
+
|
|
235
|
+
// Arrow style: a CSS-triangle implemented via 0-width view with transparent
|
|
236
|
+
// borders. We rotate the base (placement='top' = arrow on bottom-edge pointing
|
|
237
|
+
// down) into the four cardinal orientations.
|
|
238
|
+
const arrowStyle = (0, _react.useMemo)(() => {
|
|
239
|
+
if (!showArrow) return null;
|
|
240
|
+
const arrowColor = theme.colors.background.inverse;
|
|
241
|
+
const base = {
|
|
242
|
+
position: 'absolute',
|
|
243
|
+
width: 0,
|
|
244
|
+
height: 0,
|
|
245
|
+
backgroundColor: 'transparent',
|
|
246
|
+
borderStyle: 'solid',
|
|
247
|
+
borderLeftWidth: ARROW_HALF_WIDTH,
|
|
248
|
+
borderRightWidth: ARROW_HALF_WIDTH,
|
|
249
|
+
borderBottomWidth: ARROW_HEIGHT,
|
|
250
|
+
borderTopWidth: 0,
|
|
251
|
+
borderLeftColor: 'transparent',
|
|
252
|
+
borderRightColor: 'transparent',
|
|
253
|
+
borderTopColor: 'transparent',
|
|
254
|
+
borderBottomColor: arrowColor
|
|
255
|
+
};
|
|
256
|
+
if (position.placement === 'top') {
|
|
257
|
+
// Card is above trigger; arrow on bottom edge, pointing down.
|
|
258
|
+
return {
|
|
259
|
+
...base,
|
|
260
|
+
bottom: -ARROW_HEIGHT,
|
|
261
|
+
left: position.arrowOffset - ARROW_HALF_WIDTH,
|
|
262
|
+
transform: [{
|
|
263
|
+
rotate: '180deg'
|
|
264
|
+
}]
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
if (position.placement === 'bottom') {
|
|
268
|
+
// Card below trigger; arrow on top edge, pointing up.
|
|
269
|
+
return {
|
|
270
|
+
...base,
|
|
271
|
+
top: -ARROW_HEIGHT,
|
|
272
|
+
left: position.arrowOffset - ARROW_HALF_WIDTH
|
|
273
|
+
};
|
|
274
|
+
}
|
|
275
|
+
if (position.placement === 'left') {
|
|
276
|
+
// Card left of trigger; arrow on right edge, pointing right.
|
|
277
|
+
return {
|
|
278
|
+
...base,
|
|
279
|
+
right: -ARROW_HEIGHT,
|
|
280
|
+
top: position.arrowOffset - ARROW_HALF_WIDTH,
|
|
281
|
+
transform: [{
|
|
282
|
+
rotate: '90deg'
|
|
283
|
+
}]
|
|
284
|
+
};
|
|
285
|
+
}
|
|
286
|
+
// 'right': card right of trigger; arrow on left edge, pointing left.
|
|
287
|
+
return {
|
|
288
|
+
...base,
|
|
289
|
+
left: -ARROW_HEIGHT,
|
|
290
|
+
top: position.arrowOffset - ARROW_HALF_WIDTH,
|
|
291
|
+
transform: [{
|
|
292
|
+
rotate: '-90deg'
|
|
293
|
+
}]
|
|
294
|
+
};
|
|
295
|
+
}, [showArrow, position, theme]);
|
|
296
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
297
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
298
|
+
ref: wrapperRef,
|
|
299
|
+
collapsable: false,
|
|
300
|
+
onLayout: measureAnchor,
|
|
301
|
+
testID: testID,
|
|
302
|
+
children: clonedChild
|
|
303
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Modal, {
|
|
304
|
+
visible: visible,
|
|
305
|
+
transparent: true,
|
|
306
|
+
statusBarTranslucent: true,
|
|
307
|
+
presentationStyle: "overFullScreen",
|
|
308
|
+
animationType: "none",
|
|
309
|
+
onRequestClose: handleHide,
|
|
310
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
|
|
311
|
+
style: _reactNative.StyleSheet.absoluteFill,
|
|
312
|
+
onPress: hideOnContentPress ? handleHide : undefined,
|
|
313
|
+
accessibilityLabel: "Close tooltip",
|
|
314
|
+
accessibilityRole: "button",
|
|
315
|
+
children: visible ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Animated.View, {
|
|
316
|
+
accessibilityRole: 'tooltip',
|
|
317
|
+
accessibilityLiveRegion: "polite",
|
|
318
|
+
accessibilityLabel: a11yLabel,
|
|
319
|
+
onLayout: handleContentLayout,
|
|
320
|
+
style: [{
|
|
321
|
+
position: 'absolute',
|
|
322
|
+
top: position.top,
|
|
323
|
+
left: position.left,
|
|
324
|
+
maxWidth,
|
|
325
|
+
opacity,
|
|
326
|
+
transform: [{
|
|
327
|
+
scale
|
|
328
|
+
}]
|
|
329
|
+
}, style],
|
|
330
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
331
|
+
style: [styles.tooltip, {
|
|
332
|
+
backgroundColor: theme.colors.background.inverse,
|
|
333
|
+
borderRadius: theme.radius.md,
|
|
334
|
+
paddingHorizontal: theme.spacing.md,
|
|
335
|
+
paddingVertical: theme.spacing.sm,
|
|
336
|
+
...theme.shadows.lg,
|
|
337
|
+
shadowColor: theme.shadows.lg.shadowColor
|
|
338
|
+
}],
|
|
339
|
+
children: typeof content === 'string' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
340
|
+
style: {
|
|
341
|
+
color: theme.colors.text.inverse,
|
|
342
|
+
fontSize: theme.typography.fontSize.sm,
|
|
343
|
+
lineHeight: 18
|
|
344
|
+
},
|
|
345
|
+
children: content
|
|
346
|
+
}) : content
|
|
347
|
+
}), arrowStyle ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
348
|
+
style: arrowStyle,
|
|
349
|
+
pointerEvents: "none"
|
|
350
|
+
}) : null]
|
|
351
|
+
}) : null
|
|
352
|
+
})
|
|
353
|
+
})]
|
|
354
|
+
});
|
|
355
|
+
};
|
|
356
|
+
exports.Tooltip = Tooltip;
|
|
357
|
+
const buildStyles = _theme => _reactNative.StyleSheet.create({
|
|
358
|
+
tooltip: {
|
|
359
|
+
overflow: 'hidden'
|
|
360
|
+
}
|
|
361
|
+
});
|
|
362
|
+
var _default = exports.default = Tooltip;
|
|
363
|
+
//# sourceMappingURL=Tooltip.js.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "Tooltip", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _Tooltip.Tooltip;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "default", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _Tooltip.default;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
var _Tooltip = _interopRequireWildcard(require("./Tooltip.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
|