@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,281 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.Button = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _index = require("../../theme/index.js");
|
|
10
|
+
var _usePressAnimation = require("../../hooks/usePressAnimation.js");
|
|
11
|
+
var _hapticUtils = require("../../utils/hapticUtils.js");
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
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); }
|
|
14
|
+
const Button = exports.Button = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
15
|
+
const {
|
|
16
|
+
title,
|
|
17
|
+
children,
|
|
18
|
+
variant = 'solid',
|
|
19
|
+
tone = 'primary',
|
|
20
|
+
size = 'md',
|
|
21
|
+
loading = false,
|
|
22
|
+
disabled = false,
|
|
23
|
+
fullWidth = false,
|
|
24
|
+
leftIcon,
|
|
25
|
+
rightIcon,
|
|
26
|
+
haptic = 'selection',
|
|
27
|
+
rounded = false,
|
|
28
|
+
style,
|
|
29
|
+
textStyle,
|
|
30
|
+
pressAnimation = true,
|
|
31
|
+
onPress,
|
|
32
|
+
accessibilityLabel,
|
|
33
|
+
accessibilityHint,
|
|
34
|
+
testID,
|
|
35
|
+
...rest
|
|
36
|
+
} = props;
|
|
37
|
+
const theme = (0, _index.useTheme)();
|
|
38
|
+
const isInteractive = !disabled && !loading;
|
|
39
|
+
const {
|
|
40
|
+
scale,
|
|
41
|
+
pressIn,
|
|
42
|
+
pressOut
|
|
43
|
+
} = (0, _usePressAnimation.usePressAnimation)({
|
|
44
|
+
enabled: pressAnimation && isInteractive
|
|
45
|
+
});
|
|
46
|
+
const styles = (0, _react.useMemo)(() => buildStyles(theme), [theme]);
|
|
47
|
+
const sizeStyles = sizeMap[size];
|
|
48
|
+
const toneColors = (0, _react.useMemo)(() => toneFor(theme, tone), [theme, tone]);
|
|
49
|
+
const variantStyles = (0, _react.useMemo)(() => variantFor(theme, variant, toneColors, disabled), [theme, variant, toneColors, disabled]);
|
|
50
|
+
const handlePress = event => {
|
|
51
|
+
if (!isInteractive) return;
|
|
52
|
+
if (haptic !== false) (0, _hapticUtils.triggerHaptic)(haptic);
|
|
53
|
+
onPress?.(event);
|
|
54
|
+
};
|
|
55
|
+
const accessibleLabel = accessibilityLabel ?? title;
|
|
56
|
+
const content = /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
57
|
+
style: styles.contentRow,
|
|
58
|
+
children: loading ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ActivityIndicator, {
|
|
59
|
+
color: variantStyles.textColor,
|
|
60
|
+
size: size === 'xs' || size === 'sm' ? 'small' : 'small'
|
|
61
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
62
|
+
children: [leftIcon ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
63
|
+
style: styles.iconLeft,
|
|
64
|
+
children: leftIcon
|
|
65
|
+
}) : null, title ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
66
|
+
style: [styles.label, {
|
|
67
|
+
color: variantStyles.textColor,
|
|
68
|
+
fontSize: sizeStyles.fontSize,
|
|
69
|
+
fontWeight: theme.typography.fontWeight.semibold
|
|
70
|
+
}, textStyle],
|
|
71
|
+
numberOfLines: 1,
|
|
72
|
+
children: title
|
|
73
|
+
}) : children, rightIcon ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
74
|
+
style: styles.iconRight,
|
|
75
|
+
children: rightIcon
|
|
76
|
+
}) : null]
|
|
77
|
+
})
|
|
78
|
+
});
|
|
79
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Animated.View, {
|
|
80
|
+
style: [{
|
|
81
|
+
transform: [{
|
|
82
|
+
scale
|
|
83
|
+
}]
|
|
84
|
+
}, fullWidth ? styles.fullWidth : null],
|
|
85
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
|
|
86
|
+
ref: ref,
|
|
87
|
+
onPress: handlePress,
|
|
88
|
+
onPressIn: pressIn,
|
|
89
|
+
onPressOut: pressOut,
|
|
90
|
+
disabled: !isInteractive,
|
|
91
|
+
android_ripple: variant === 'solid' ? {
|
|
92
|
+
color: theme.colors.surface.pressed,
|
|
93
|
+
borderless: false
|
|
94
|
+
} : {
|
|
95
|
+
color: theme.colors.surface.hovered,
|
|
96
|
+
borderless: false
|
|
97
|
+
},
|
|
98
|
+
accessibilityRole: "button",
|
|
99
|
+
accessibilityLabel: accessibleLabel,
|
|
100
|
+
accessibilityHint: accessibilityHint,
|
|
101
|
+
accessibilityState: {
|
|
102
|
+
disabled: !isInteractive,
|
|
103
|
+
busy: loading
|
|
104
|
+
},
|
|
105
|
+
testID: testID,
|
|
106
|
+
style: ({
|
|
107
|
+
pressed
|
|
108
|
+
}) => [styles.base, {
|
|
109
|
+
paddingHorizontal: sizeStyles.paddingHorizontal,
|
|
110
|
+
paddingVertical: sizeStyles.paddingVertical,
|
|
111
|
+
minHeight: sizeStyles.minHeight,
|
|
112
|
+
borderRadius: rounded ? theme.radius.full : sizeStyles.borderRadius,
|
|
113
|
+
backgroundColor: variantStyles.backgroundColor,
|
|
114
|
+
borderWidth: variantStyles.borderWidth,
|
|
115
|
+
borderColor: variantStyles.borderColor,
|
|
116
|
+
opacity: !isInteractive ? 0.55 : 1
|
|
117
|
+
}, pressed && variant !== 'solid' ? {
|
|
118
|
+
backgroundColor: theme.colors.surface.pressed
|
|
119
|
+
} : null, fullWidth ? styles.fullWidth : null, style],
|
|
120
|
+
...rest,
|
|
121
|
+
children: content
|
|
122
|
+
})
|
|
123
|
+
});
|
|
124
|
+
});
|
|
125
|
+
Button.displayName = 'Button';
|
|
126
|
+
const sizeMap = {
|
|
127
|
+
xs: {
|
|
128
|
+
paddingHorizontal: 10,
|
|
129
|
+
paddingVertical: 4,
|
|
130
|
+
minHeight: 28,
|
|
131
|
+
fontSize: 12,
|
|
132
|
+
borderRadius: 8
|
|
133
|
+
},
|
|
134
|
+
sm: {
|
|
135
|
+
paddingHorizontal: 12,
|
|
136
|
+
paddingVertical: 6,
|
|
137
|
+
minHeight: 34,
|
|
138
|
+
fontSize: 13,
|
|
139
|
+
borderRadius: 10
|
|
140
|
+
},
|
|
141
|
+
md: {
|
|
142
|
+
paddingHorizontal: 16,
|
|
143
|
+
paddingVertical: 9,
|
|
144
|
+
minHeight: 42,
|
|
145
|
+
fontSize: 15,
|
|
146
|
+
borderRadius: 12
|
|
147
|
+
},
|
|
148
|
+
lg: {
|
|
149
|
+
paddingHorizontal: 20,
|
|
150
|
+
paddingVertical: 12,
|
|
151
|
+
minHeight: 50,
|
|
152
|
+
fontSize: 16,
|
|
153
|
+
borderRadius: 14
|
|
154
|
+
},
|
|
155
|
+
xl: {
|
|
156
|
+
paddingHorizontal: 24,
|
|
157
|
+
paddingVertical: 14,
|
|
158
|
+
minHeight: 58,
|
|
159
|
+
fontSize: 17,
|
|
160
|
+
borderRadius: 16
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
const toneFor = (theme, tone) => {
|
|
164
|
+
switch (tone) {
|
|
165
|
+
case 'primary':
|
|
166
|
+
return {
|
|
167
|
+
base: theme.colors.primary,
|
|
168
|
+
hover: theme.colors.primaryHover,
|
|
169
|
+
pressed: theme.colors.primaryPressed,
|
|
170
|
+
on: theme.colors.text.inverse,
|
|
171
|
+
muted: theme.colors.primaryMuted
|
|
172
|
+
};
|
|
173
|
+
case 'secondary':
|
|
174
|
+
return {
|
|
175
|
+
base: theme.colors.secondary,
|
|
176
|
+
hover: theme.colors.secondaryHover,
|
|
177
|
+
pressed: theme.colors.secondaryHover,
|
|
178
|
+
on: theme.colors.text.primary,
|
|
179
|
+
muted: theme.colors.secondary
|
|
180
|
+
};
|
|
181
|
+
case 'success':
|
|
182
|
+
return {
|
|
183
|
+
base: theme.colors.success,
|
|
184
|
+
hover: theme.colors.success,
|
|
185
|
+
pressed: theme.colors.success,
|
|
186
|
+
on: theme.colors.text.inverse,
|
|
187
|
+
muted: theme.colors.background.secondary
|
|
188
|
+
};
|
|
189
|
+
case 'warning':
|
|
190
|
+
return {
|
|
191
|
+
base: theme.colors.warning,
|
|
192
|
+
hover: theme.colors.warning,
|
|
193
|
+
pressed: theme.colors.warning,
|
|
194
|
+
on: theme.colors.text.inverse,
|
|
195
|
+
muted: theme.colors.background.secondary
|
|
196
|
+
};
|
|
197
|
+
case 'danger':
|
|
198
|
+
return {
|
|
199
|
+
base: theme.colors.error,
|
|
200
|
+
hover: theme.colors.error,
|
|
201
|
+
pressed: theme.colors.error,
|
|
202
|
+
on: theme.colors.text.inverse,
|
|
203
|
+
muted: theme.colors.background.secondary
|
|
204
|
+
};
|
|
205
|
+
case 'neutral':
|
|
206
|
+
default:
|
|
207
|
+
return {
|
|
208
|
+
base: theme.colors.background.tertiary,
|
|
209
|
+
hover: theme.colors.surface.hovered,
|
|
210
|
+
pressed: theme.colors.surface.pressed,
|
|
211
|
+
on: theme.colors.text.primary,
|
|
212
|
+
muted: theme.colors.background.secondary
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
};
|
|
216
|
+
const variantFor = (theme, variant, toneSet, disabled) => {
|
|
217
|
+
switch (variant) {
|
|
218
|
+
case 'solid':
|
|
219
|
+
return {
|
|
220
|
+
backgroundColor: disabled ? theme.colors.surface.disabled : toneSet.base,
|
|
221
|
+
borderColor: 'transparent',
|
|
222
|
+
borderWidth: 0,
|
|
223
|
+
textColor: disabled ? theme.colors.text.disabled : toneSet.on
|
|
224
|
+
};
|
|
225
|
+
case 'outline':
|
|
226
|
+
return {
|
|
227
|
+
backgroundColor: 'transparent',
|
|
228
|
+
borderColor: disabled ? theme.colors.border.primary : toneSet.base,
|
|
229
|
+
borderWidth: 1,
|
|
230
|
+
textColor: disabled ? theme.colors.text.disabled : toneSet.base
|
|
231
|
+
};
|
|
232
|
+
case 'ghost':
|
|
233
|
+
return {
|
|
234
|
+
backgroundColor: 'transparent',
|
|
235
|
+
borderColor: 'transparent',
|
|
236
|
+
borderWidth: 0,
|
|
237
|
+
textColor: disabled ? theme.colors.text.disabled : toneSet.base
|
|
238
|
+
};
|
|
239
|
+
case 'link':
|
|
240
|
+
return {
|
|
241
|
+
backgroundColor: 'transparent',
|
|
242
|
+
borderColor: 'transparent',
|
|
243
|
+
borderWidth: 0,
|
|
244
|
+
textColor: disabled ? theme.colors.text.disabled : theme.colors.text.link
|
|
245
|
+
};
|
|
246
|
+
default:
|
|
247
|
+
return {
|
|
248
|
+
backgroundColor: toneSet.base,
|
|
249
|
+
borderColor: 'transparent',
|
|
250
|
+
borderWidth: 0,
|
|
251
|
+
textColor: toneSet.on
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
};
|
|
255
|
+
const buildStyles = _theme => _reactNative.StyleSheet.create({
|
|
256
|
+
base: {
|
|
257
|
+
alignItems: 'center',
|
|
258
|
+
justifyContent: 'center',
|
|
259
|
+
flexDirection: 'row',
|
|
260
|
+
overflow: 'hidden'
|
|
261
|
+
},
|
|
262
|
+
contentRow: {
|
|
263
|
+
flexDirection: 'row',
|
|
264
|
+
alignItems: 'center',
|
|
265
|
+
justifyContent: 'center'
|
|
266
|
+
},
|
|
267
|
+
label: {
|
|
268
|
+
textAlign: 'center'
|
|
269
|
+
},
|
|
270
|
+
iconLeft: {
|
|
271
|
+
marginRight: 8
|
|
272
|
+
},
|
|
273
|
+
iconRight: {
|
|
274
|
+
marginLeft: 8
|
|
275
|
+
},
|
|
276
|
+
fullWidth: {
|
|
277
|
+
alignSelf: 'stretch'
|
|
278
|
+
}
|
|
279
|
+
});
|
|
280
|
+
var _default = exports.default = Button;
|
|
281
|
+
//# sourceMappingURL=Button.js.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "Button", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _Button.Button;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "default", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _Button.default;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
var _Button = _interopRequireWildcard(require("./Button.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,194 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.Card = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _index = require("../../theme/index.js");
|
|
10
|
+
var _usePressAnimation = require("../../hooks/usePressAnimation.js");
|
|
11
|
+
var _hapticUtils = require("../../utils/hapticUtils.js");
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
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); }
|
|
14
|
+
const paddingMap = {
|
|
15
|
+
none: 'none',
|
|
16
|
+
sm: 'sm',
|
|
17
|
+
md: 'lg',
|
|
18
|
+
lg: 'xl',
|
|
19
|
+
xl: '2xl'
|
|
20
|
+
};
|
|
21
|
+
const Card = exports.Card = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
22
|
+
const {
|
|
23
|
+
children,
|
|
24
|
+
variant = 'elevated',
|
|
25
|
+
elevation = 'sm',
|
|
26
|
+
radius = 'lg',
|
|
27
|
+
padding = 'md',
|
|
28
|
+
interactive = false,
|
|
29
|
+
header,
|
|
30
|
+
footer,
|
|
31
|
+
imageSource,
|
|
32
|
+
imageHeight = 160,
|
|
33
|
+
imageAspectRatio,
|
|
34
|
+
imageOverlay,
|
|
35
|
+
onPress,
|
|
36
|
+
accessibilityLabel,
|
|
37
|
+
accessibilityHint,
|
|
38
|
+
accessibilityRole,
|
|
39
|
+
style,
|
|
40
|
+
testID,
|
|
41
|
+
...rest
|
|
42
|
+
} = props;
|
|
43
|
+
const theme = (0, _index.useTheme)();
|
|
44
|
+
const isInteractive = interactive || typeof onPress === 'function';
|
|
45
|
+
const {
|
|
46
|
+
scale,
|
|
47
|
+
pressIn,
|
|
48
|
+
pressOut
|
|
49
|
+
} = (0, _usePressAnimation.usePressAnimation)({
|
|
50
|
+
enabled: isInteractive
|
|
51
|
+
});
|
|
52
|
+
const styles = (0, _react.useMemo)(() => buildStyles(theme), [theme]);
|
|
53
|
+
const hasImage = Boolean(imageSource);
|
|
54
|
+
const contentPadding = theme.spacing[paddingMap[padding]];
|
|
55
|
+
const containerStyle = (0, _react.useMemo)(() => {
|
|
56
|
+
const base = {
|
|
57
|
+
borderRadius: theme.radius[radius],
|
|
58
|
+
// When an image header is present we move padding to the inner content
|
|
59
|
+
// wrapper so the image can occupy the card's full top edge.
|
|
60
|
+
padding: hasImage ? 0 : contentPadding,
|
|
61
|
+
overflow: 'hidden'
|
|
62
|
+
};
|
|
63
|
+
switch (variant) {
|
|
64
|
+
case 'outlined':
|
|
65
|
+
return {
|
|
66
|
+
...base,
|
|
67
|
+
backgroundColor: theme.colors.background.elevated,
|
|
68
|
+
borderWidth: 1,
|
|
69
|
+
borderColor: theme.colors.border.primary
|
|
70
|
+
};
|
|
71
|
+
case 'filled':
|
|
72
|
+
return {
|
|
73
|
+
...base,
|
|
74
|
+
backgroundColor: theme.colors.background.secondary
|
|
75
|
+
};
|
|
76
|
+
case 'elevated':
|
|
77
|
+
default:
|
|
78
|
+
return {
|
|
79
|
+
...base,
|
|
80
|
+
backgroundColor: theme.colors.background.elevated,
|
|
81
|
+
...theme.shadows[elevation]
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
}, [theme, variant, elevation, radius, padding, hasImage, contentPadding]);
|
|
85
|
+
const imageStyle = (0, _react.useMemo)(() => {
|
|
86
|
+
const topRadius = theme.radius[radius];
|
|
87
|
+
const dimensions = typeof imageAspectRatio === 'number' ? {
|
|
88
|
+
width: '100%',
|
|
89
|
+
aspectRatio: imageAspectRatio
|
|
90
|
+
} : {
|
|
91
|
+
width: '100%',
|
|
92
|
+
height: imageHeight
|
|
93
|
+
};
|
|
94
|
+
return {
|
|
95
|
+
...dimensions,
|
|
96
|
+
borderTopLeftRadius: topRadius,
|
|
97
|
+
borderTopRightRadius: topRadius,
|
|
98
|
+
borderBottomLeftRadius: 0,
|
|
99
|
+
borderBottomRightRadius: 0
|
|
100
|
+
};
|
|
101
|
+
}, [theme, radius, imageAspectRatio, imageHeight]);
|
|
102
|
+
const innerContent = /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
103
|
+
children: [header ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
104
|
+
style: styles.header,
|
|
105
|
+
children: header
|
|
106
|
+
}) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
107
|
+
style: header || footer ? styles.body : null,
|
|
108
|
+
children: children
|
|
109
|
+
}), footer ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
110
|
+
style: styles.footer,
|
|
111
|
+
children: footer
|
|
112
|
+
}) : null]
|
|
113
|
+
});
|
|
114
|
+
const content = hasImage ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
115
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
116
|
+
style: styles.imageWrapper,
|
|
117
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Image, {
|
|
118
|
+
source: imageSource,
|
|
119
|
+
resizeMode: "cover",
|
|
120
|
+
style: imageStyle,
|
|
121
|
+
accessibilityLabel: "",
|
|
122
|
+
accessible: false
|
|
123
|
+
}), imageOverlay ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
124
|
+
pointerEvents: "box-none",
|
|
125
|
+
style: styles.imageOverlay,
|
|
126
|
+
children: imageOverlay
|
|
127
|
+
}) : null]
|
|
128
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
129
|
+
style: {
|
|
130
|
+
padding: contentPadding
|
|
131
|
+
},
|
|
132
|
+
children: innerContent
|
|
133
|
+
})]
|
|
134
|
+
}) : innerContent;
|
|
135
|
+
if (isInteractive) {
|
|
136
|
+
const handlePress = event => {
|
|
137
|
+
(0, _hapticUtils.triggerHaptic)('selection');
|
|
138
|
+
onPress?.(event);
|
|
139
|
+
};
|
|
140
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Animated.View, {
|
|
141
|
+
style: [{
|
|
142
|
+
transform: [{
|
|
143
|
+
scale
|
|
144
|
+
}]
|
|
145
|
+
}],
|
|
146
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
|
|
147
|
+
ref: ref,
|
|
148
|
+
onPress: handlePress,
|
|
149
|
+
onPressIn: pressIn,
|
|
150
|
+
onPressOut: pressOut,
|
|
151
|
+
android_ripple: {
|
|
152
|
+
color: theme.colors.surface.pressed,
|
|
153
|
+
borderless: false
|
|
154
|
+
},
|
|
155
|
+
accessibilityRole: accessibilityRole ?? 'button',
|
|
156
|
+
accessibilityLabel: accessibilityLabel,
|
|
157
|
+
accessibilityHint: accessibilityHint,
|
|
158
|
+
testID: testID,
|
|
159
|
+
style: [containerStyle, style],
|
|
160
|
+
...rest,
|
|
161
|
+
children: content
|
|
162
|
+
})
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
166
|
+
ref: ref,
|
|
167
|
+
accessibilityLabel: accessibilityLabel,
|
|
168
|
+
accessibilityHint: accessibilityHint,
|
|
169
|
+
accessibilityRole: accessibilityRole,
|
|
170
|
+
testID: testID,
|
|
171
|
+
style: [containerStyle, style],
|
|
172
|
+
children: content
|
|
173
|
+
});
|
|
174
|
+
});
|
|
175
|
+
Card.displayName = 'Card';
|
|
176
|
+
const buildStyles = theme => _reactNative.StyleSheet.create({
|
|
177
|
+
header: {
|
|
178
|
+
marginBottom: theme.spacing.md
|
|
179
|
+
},
|
|
180
|
+
body: {
|
|
181
|
+
flexShrink: 1
|
|
182
|
+
},
|
|
183
|
+
footer: {
|
|
184
|
+
marginTop: theme.spacing.md
|
|
185
|
+
},
|
|
186
|
+
imageWrapper: {
|
|
187
|
+
position: 'relative'
|
|
188
|
+
},
|
|
189
|
+
imageOverlay: {
|
|
190
|
+
..._reactNative.StyleSheet.absoluteFillObject
|
|
191
|
+
}
|
|
192
|
+
});
|
|
193
|
+
var _default = exports.default = Card;
|
|
194
|
+
//# sourceMappingURL=Card.js.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "Card", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _Card.Card;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "default", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _Card.default;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
var _Card = _interopRequireWildcard(require("./Card.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
|