@jamadd/react-native-template-ui 0.8.7 → 0.9.2
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 +8 -0
- package/lib/module/components/accordion/ThemedAccordion.js +270 -0
- package/lib/module/components/accordion/ThemedAccordion.js.map +1 -0
- package/lib/module/components/button/AnimatedPressable.js +6 -0
- package/lib/module/components/button/AnimatedPressable.js.map +1 -1
- package/lib/module/components/button/AnimatedThemedPressable.js +15 -0
- package/lib/module/components/button/AnimatedThemedPressable.js.map +1 -1
- package/lib/module/components/button/ThemedButton.js +15 -0
- package/lib/module/components/button/ThemedButton.js.map +1 -1
- package/lib/module/components/button/ThemedIconButton.js +15 -0
- package/lib/module/components/button/ThemedIconButton.js.map +1 -1
- package/lib/module/components/button/ThemedIconTextButton.js +16 -0
- package/lib/module/components/button/ThemedIconTextButton.js.map +1 -1
- package/lib/module/components/button/ThemedPressable.js +15 -0
- package/lib/module/components/button/ThemedPressable.js.map +1 -1
- package/lib/module/components/icon/ThemedIcon.js +14 -0
- package/lib/module/components/icon/ThemedIcon.js.map +1 -1
- package/lib/module/components/list/List.js +15 -0
- package/lib/module/components/list/List.js.map +1 -1
- package/lib/module/components/loading/ThemedLoading.js +13 -0
- package/lib/module/components/loading/ThemedLoading.js.map +1 -1
- package/lib/module/components/overlay/actionSheet/ActionSheet.js +32 -3
- package/lib/module/components/overlay/actionSheet/ActionSheet.js.map +1 -1
- package/lib/module/components/overlay/actionSheet/ActionSheetContentGesture.js +4 -0
- package/lib/module/components/overlay/actionSheet/ActionSheetContentGesture.js.map +1 -1
- package/lib/module/components/overlay/actionSheet/ActionSheetHeader.js +17 -2
- package/lib/module/components/overlay/actionSheet/ActionSheetHeader.js.map +1 -1
- package/lib/module/components/overlay/actionSheet/ActionSheetListView.js +7 -1
- package/lib/module/components/overlay/actionSheet/ActionSheetListView.js.map +1 -1
- package/lib/module/components/overlay/actionSheet/ActionSheetListViewContent.js +6 -0
- package/lib/module/components/overlay/actionSheet/ActionSheetListViewContent.js.map +1 -1
- package/lib/module/components/overlay/actionSheet/ActionSheetOptionList.js +6 -0
- package/lib/module/components/overlay/actionSheet/ActionSheetOptionList.js.map +1 -1
- package/lib/module/components/overlay/actionSheet/ActionSheetOptionListItem.js +6 -0
- package/lib/module/components/overlay/actionSheet/ActionSheetOptionListItem.js.map +1 -1
- package/lib/module/components/overlay/actionSheet/ActionSheetOptions.js +7 -1
- package/lib/module/components/overlay/actionSheet/ActionSheetOptions.js.map +1 -1
- package/lib/module/components/overlay/actionSheet/ActionSheetScrollView.js +7 -1
- package/lib/module/components/overlay/actionSheet/ActionSheetScrollView.js.map +1 -1
- package/lib/module/components/overlay/actionSheet/ActionSheetScrollViewContent.js +6 -0
- package/lib/module/components/overlay/actionSheet/ActionSheetScrollViewContent.js.map +1 -1
- package/lib/module/components/overlay/actionSheet/ActionSheetWrap.js +8 -2
- package/lib/module/components/overlay/actionSheet/ActionSheetWrap.js.map +1 -1
- package/lib/module/components/overlay/alert/Alert.js +19 -0
- package/lib/module/components/overlay/alert/Alert.js.map +1 -1
- package/lib/module/components/overlay/alert/AlertButton.js +6 -0
- package/lib/module/components/overlay/alert/AlertButton.js.map +1 -1
- package/lib/module/components/overlay/alert/AlertButtons.js +6 -0
- package/lib/module/components/overlay/alert/AlertButtons.js.map +1 -1
- package/lib/module/components/overlay/alert/AlertContent.js +6 -0
- package/lib/module/components/overlay/alert/AlertContent.js.map +1 -1
- package/lib/module/components/overlay/alert/AlertWrap.js +7 -1
- package/lib/module/components/overlay/alert/AlertWrap.js.map +1 -1
- package/lib/module/components/overlay/modal/ThemedLoadingModal.js +15 -0
- package/lib/module/components/overlay/modal/ThemedLoadingModal.js.map +1 -1
- package/lib/module/components/overlay/modal/ThemedModal.js +18 -0
- package/lib/module/components/overlay/modal/ThemedModal.js.map +1 -1
- package/lib/module/components/overlay/toast/ThemedToast.js +17 -2
- package/lib/module/components/overlay/toast/ThemedToast.js.map +1 -1
- package/lib/module/components/provider/GestureProvider.js +11 -0
- package/lib/module/components/provider/GestureProvider.js.map +1 -1
- package/lib/module/components/provider/InsetsProvider.js +12 -0
- package/lib/module/components/provider/InsetsProvider.js.map +1 -1
- package/lib/module/components/provider/ReactNativeTemplateProviders.js +12 -0
- package/lib/module/components/provider/ReactNativeTemplateProviders.js.map +1 -1
- package/lib/module/components/provider/ThemeProvider.js +11 -0
- package/lib/module/components/provider/ThemeProvider.js.map +1 -1
- package/lib/module/components/separator/ThemedSeparator.js +19 -0
- package/lib/module/components/separator/ThemedSeparator.js.map +1 -1
- package/lib/module/components/slider/Slider.js +162 -213
- package/lib/module/components/slider/Slider.js.map +1 -1
- package/lib/module/components/slider/ThemedSlider.js +24 -2
- package/lib/module/components/slider/ThemedSlider.js.map +1 -1
- package/lib/module/components/slider/ThemedSliderStepIndicator.js +6 -0
- package/lib/module/components/slider/ThemedSliderStepIndicator.js.map +1 -1
- package/lib/module/components/switch/ThemedSwitch.js +14 -0
- package/lib/module/components/switch/ThemedSwitch.js.map +1 -1
- package/lib/module/components/text/Text.js +5 -0
- package/lib/module/components/text/Text.js.map +1 -1
- package/lib/module/components/text/ThemedIconText.js +22 -0
- package/lib/module/components/text/ThemedIconText.js.map +1 -1
- package/lib/module/components/text/ThemedText.js +15 -0
- package/lib/module/components/text/ThemedText.js.map +1 -1
- package/lib/module/components/view/AnimatedThemedView.js +16 -0
- package/lib/module/components/view/AnimatedThemedView.js.map +1 -1
- package/lib/module/components/view/AnimatedView.js +6 -0
- package/lib/module/components/view/AnimatedView.js.map +1 -1
- package/lib/module/components/view/Box.js +5 -0
- package/lib/module/components/view/Box.js.map +1 -1
- package/lib/module/components/view/ThemedScreenWrap.js +79 -88
- package/lib/module/components/view/ThemedScreenWrap.js.map +1 -1
- package/lib/module/components/view/ThemedScreenWrap.web.js +84 -59
- package/lib/module/components/view/ThemedScreenWrap.web.js.map +1 -1
- package/lib/module/components/view/ThemedScrollView.js +17 -0
- package/lib/module/components/view/ThemedScrollView.js.map +1 -1
- package/lib/module/components/view/ThemedView.js +16 -0
- package/lib/module/components/view/ThemedView.js.map +1 -1
- package/lib/module/hooks/button.js +46 -0
- package/lib/module/hooks/button.js.map +1 -1
- package/lib/module/hooks/list.js +29 -0
- package/lib/module/hooks/list.js.map +1 -1
- package/lib/module/hooks/react.js +41 -0
- package/lib/module/hooks/react.js.map +1 -1
- package/lib/module/hooks/reanimated.js +10 -0
- package/lib/module/hooks/reanimated.js.map +1 -1
- package/lib/module/hooks/separator.js +18 -1
- package/lib/module/hooks/separator.js.map +1 -1
- package/lib/module/hooks/style.js +72 -0
- package/lib/module/hooks/style.js.map +1 -1
- package/lib/module/hooks/theme.js +93 -0
- package/lib/module/hooks/theme.js.map +1 -1
- package/lib/module/hooks/view.js +122 -1
- package/lib/module/hooks/view.js.map +1 -1
- package/lib/module/index.js +4 -2
- package/lib/module/index.js.map +1 -1
- package/lib/module/types/accordion.js +4 -0
- package/lib/module/types/accordion.js.map +1 -0
- package/lib/module/utils/button/const.js +28 -0
- package/lib/module/utils/button/const.js.map +1 -1
- package/lib/module/utils/overlay/const.js +72 -0
- package/lib/module/utils/overlay/const.js.map +1 -1
- package/lib/module/utils/overlay/func.js +101 -0
- package/lib/module/utils/overlay/func.js.map +1 -1
- package/lib/module/utils/slider/const.js +52 -0
- package/lib/module/utils/slider/const.js.map +1 -1
- package/lib/module/utils/style/const.js +14 -0
- package/lib/module/utils/style/const.js.map +1 -1
- package/lib/module/utils/style/func.js +102 -0
- package/lib/module/utils/style/func.js.map +1 -1
- package/lib/module/utils/theme/const.js +180 -0
- package/lib/module/utils/theme/const.js.map +1 -1
- package/lib/module/utils/theme/restyle.js +124 -0
- package/lib/module/utils/theme/restyle.js.map +1 -1
- package/lib/typescript/src/components/accordion/ThemedAccordion.d.ts +20 -0
- package/lib/typescript/src/components/accordion/ThemedAccordion.d.ts.map +1 -0
- package/lib/typescript/src/components/button/AnimatedPressable.d.ts +0 -1
- package/lib/typescript/src/components/button/AnimatedPressable.d.ts.map +1 -1
- package/lib/typescript/src/components/button/AnimatedThemedPressable.d.ts +14 -0
- package/lib/typescript/src/components/button/AnimatedThemedPressable.d.ts.map +1 -1
- package/lib/typescript/src/components/button/ThemedButton.d.ts +14 -0
- package/lib/typescript/src/components/button/ThemedButton.d.ts.map +1 -1
- package/lib/typescript/src/components/button/ThemedIconButton.d.ts +14 -0
- package/lib/typescript/src/components/button/ThemedIconButton.d.ts.map +1 -1
- package/lib/typescript/src/components/button/ThemedIconTextButton.d.ts +15 -0
- package/lib/typescript/src/components/button/ThemedIconTextButton.d.ts.map +1 -1
- package/lib/typescript/src/components/button/ThemedPressable.d.ts +15 -0
- package/lib/typescript/src/components/button/ThemedPressable.d.ts.map +1 -1
- package/lib/typescript/src/components/icon/ThemedIcon.d.ts +13 -0
- package/lib/typescript/src/components/icon/ThemedIcon.d.ts.map +1 -1
- package/lib/typescript/src/components/list/List.d.ts +14 -0
- package/lib/typescript/src/components/list/List.d.ts.map +1 -1
- package/lib/typescript/src/components/loading/ThemedLoading.d.ts +12 -0
- package/lib/typescript/src/components/loading/ThemedLoading.d.ts.map +1 -1
- package/lib/typescript/src/components/overlay/actionSheet/ActionSheet.d.ts +18 -1
- package/lib/typescript/src/components/overlay/actionSheet/ActionSheet.d.ts.map +1 -1
- package/lib/typescript/src/components/overlay/actionSheet/ActionSheetContentGesture.d.ts +0 -2
- package/lib/typescript/src/components/overlay/actionSheet/ActionSheetContentGesture.d.ts.map +1 -1
- package/lib/typescript/src/components/overlay/actionSheet/ActionSheetHeader.d.ts +0 -2
- package/lib/typescript/src/components/overlay/actionSheet/ActionSheetHeader.d.ts.map +1 -1
- package/lib/typescript/src/components/overlay/actionSheet/ActionSheetListView.d.ts +0 -2
- package/lib/typescript/src/components/overlay/actionSheet/ActionSheetListView.d.ts.map +1 -1
- package/lib/typescript/src/components/overlay/actionSheet/ActionSheetListViewContent.d.ts +0 -2
- package/lib/typescript/src/components/overlay/actionSheet/ActionSheetListViewContent.d.ts.map +1 -1
- package/lib/typescript/src/components/overlay/actionSheet/ActionSheetOptionList.d.ts +0 -2
- package/lib/typescript/src/components/overlay/actionSheet/ActionSheetOptionList.d.ts.map +1 -1
- package/lib/typescript/src/components/overlay/actionSheet/ActionSheetOptionListItem.d.ts +0 -3
- package/lib/typescript/src/components/overlay/actionSheet/ActionSheetOptionListItem.d.ts.map +1 -1
- package/lib/typescript/src/components/overlay/actionSheet/ActionSheetOptions.d.ts +0 -2
- package/lib/typescript/src/components/overlay/actionSheet/ActionSheetOptions.d.ts.map +1 -1
- package/lib/typescript/src/components/overlay/actionSheet/ActionSheetScrollView.d.ts +0 -2
- package/lib/typescript/src/components/overlay/actionSheet/ActionSheetScrollView.d.ts.map +1 -1
- package/lib/typescript/src/components/overlay/actionSheet/ActionSheetScrollViewContent.d.ts +0 -3
- package/lib/typescript/src/components/overlay/actionSheet/ActionSheetScrollViewContent.d.ts.map +1 -1
- package/lib/typescript/src/components/overlay/actionSheet/ActionSheetWrap.d.ts +0 -2
- package/lib/typescript/src/components/overlay/actionSheet/ActionSheetWrap.d.ts.map +1 -1
- package/lib/typescript/src/components/overlay/alert/Alert.d.ts +18 -0
- package/lib/typescript/src/components/overlay/alert/Alert.d.ts.map +1 -1
- package/lib/typescript/src/components/overlay/alert/AlertButton.d.ts +0 -3
- package/lib/typescript/src/components/overlay/alert/AlertButton.d.ts.map +1 -1
- package/lib/typescript/src/components/overlay/alert/AlertButtons.d.ts +0 -3
- package/lib/typescript/src/components/overlay/alert/AlertButtons.d.ts.map +1 -1
- package/lib/typescript/src/components/overlay/alert/AlertContent.d.ts +0 -3
- package/lib/typescript/src/components/overlay/alert/AlertContent.d.ts.map +1 -1
- package/lib/typescript/src/components/overlay/alert/AlertWrap.d.ts +0 -8
- package/lib/typescript/src/components/overlay/alert/AlertWrap.d.ts.map +1 -1
- package/lib/typescript/src/components/overlay/modal/ThemedLoadingModal.d.ts +14 -0
- package/lib/typescript/src/components/overlay/modal/ThemedLoadingModal.d.ts.map +1 -1
- package/lib/typescript/src/components/overlay/modal/ThemedModal.d.ts +17 -0
- package/lib/typescript/src/components/overlay/modal/ThemedModal.d.ts.map +1 -1
- package/lib/typescript/src/components/overlay/toast/ThemedToast.d.ts +14 -0
- package/lib/typescript/src/components/overlay/toast/ThemedToast.d.ts.map +1 -1
- package/lib/typescript/src/components/provider/GestureProvider.d.ts +11 -0
- package/lib/typescript/src/components/provider/GestureProvider.d.ts.map +1 -1
- package/lib/typescript/src/components/provider/InsetsProvider.d.ts +11 -0
- package/lib/typescript/src/components/provider/InsetsProvider.d.ts.map +1 -1
- package/lib/typescript/src/components/provider/ReactNativeTemplateProviders.d.ts +11 -0
- package/lib/typescript/src/components/provider/ReactNativeTemplateProviders.d.ts.map +1 -1
- package/lib/typescript/src/components/provider/ThemeProvider.d.ts +11 -0
- package/lib/typescript/src/components/provider/ThemeProvider.d.ts.map +1 -1
- package/lib/typescript/src/components/separator/ThemedSeparator.d.ts +18 -0
- package/lib/typescript/src/components/separator/ThemedSeparator.d.ts.map +1 -1
- package/lib/typescript/src/components/slider/Slider.d.ts +20 -0
- package/lib/typescript/src/components/slider/Slider.d.ts.map +1 -1
- package/lib/typescript/src/components/slider/ThemedSlider.d.ts +15 -0
- package/lib/typescript/src/components/slider/ThemedSlider.d.ts.map +1 -1
- package/lib/typescript/src/components/slider/ThemedSliderStepIndicator.d.ts +0 -2
- package/lib/typescript/src/components/slider/ThemedSliderStepIndicator.d.ts.map +1 -1
- package/lib/typescript/src/components/switch/ThemedSwitch.d.ts +13 -0
- package/lib/typescript/src/components/switch/ThemedSwitch.d.ts.map +1 -1
- package/lib/typescript/src/components/text/Text.d.ts +0 -2021
- package/lib/typescript/src/components/text/Text.d.ts.map +1 -1
- package/lib/typescript/src/components/text/ThemedIconText.d.ts +21 -0
- package/lib/typescript/src/components/text/ThemedIconText.d.ts.map +1 -1
- package/lib/typescript/src/components/text/ThemedText.d.ts +14 -0
- package/lib/typescript/src/components/text/ThemedText.d.ts.map +1 -1
- package/lib/typescript/src/components/view/AnimatedThemedView.d.ts +15 -0
- package/lib/typescript/src/components/view/AnimatedThemedView.d.ts.map +1 -1
- package/lib/typescript/src/components/view/AnimatedView.d.ts +0 -1
- package/lib/typescript/src/components/view/AnimatedView.d.ts.map +1 -1
- package/lib/typescript/src/components/view/Box.d.ts +0 -2071
- package/lib/typescript/src/components/view/Box.d.ts.map +1 -1
- package/lib/typescript/src/components/view/ThemedScreenWrap.d.ts +16 -0
- package/lib/typescript/src/components/view/ThemedScreenWrap.d.ts.map +1 -1
- package/lib/typescript/src/components/view/ThemedScreenWrap.web.d.ts +14 -0
- package/lib/typescript/src/components/view/ThemedScreenWrap.web.d.ts.map +1 -1
- package/lib/typescript/src/components/view/ThemedScrollView.d.ts +16 -0
- package/lib/typescript/src/components/view/ThemedScrollView.d.ts.map +1 -1
- package/lib/typescript/src/components/view/ThemedView.d.ts +15 -0
- package/lib/typescript/src/components/view/ThemedView.d.ts.map +1 -1
- package/lib/typescript/src/hooks/button.d.ts +41 -0
- package/lib/typescript/src/hooks/button.d.ts.map +1 -1
- package/lib/typescript/src/hooks/list.d.ts +27 -0
- package/lib/typescript/src/hooks/list.d.ts.map +1 -1
- package/lib/typescript/src/hooks/react.d.ts +38 -0
- package/lib/typescript/src/hooks/react.d.ts.map +1 -1
- package/lib/typescript/src/hooks/reanimated.d.ts +10 -0
- package/lib/typescript/src/hooks/reanimated.d.ts.map +1 -1
- package/lib/typescript/src/hooks/separator.d.ts +16 -0
- package/lib/typescript/src/hooks/separator.d.ts.map +1 -1
- package/lib/typescript/src/hooks/style.d.ts +65 -0
- package/lib/typescript/src/hooks/style.d.ts.map +1 -1
- package/lib/typescript/src/hooks/theme.d.ts +82 -0
- package/lib/typescript/src/hooks/theme.d.ts.map +1 -1
- package/lib/typescript/src/hooks/view.d.ts +40 -2
- package/lib/typescript/src/hooks/view.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +2 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/types/accordion.d.ts +42 -0
- package/lib/typescript/src/types/accordion.d.ts.map +1 -0
- package/lib/typescript/src/types/button.d.ts +92 -0
- package/lib/typescript/src/types/button.d.ts.map +1 -1
- package/lib/typescript/src/types/icon.d.ts +43 -0
- package/lib/typescript/src/types/icon.d.ts.map +1 -1
- package/lib/typescript/src/types/list.d.ts +84 -0
- package/lib/typescript/src/types/list.d.ts.map +1 -1
- package/lib/typescript/src/types/loading.d.ts +38 -0
- package/lib/typescript/src/types/loading.d.ts.map +1 -1
- package/lib/typescript/src/types/overlay.d.ts +222 -0
- package/lib/typescript/src/types/overlay.d.ts.map +1 -1
- package/lib/typescript/src/types/provider.d.ts +21 -0
- package/lib/typescript/src/types/provider.d.ts.map +1 -1
- package/lib/typescript/src/types/react.d.ts +32 -0
- package/lib/typescript/src/types/react.d.ts.map +1 -1
- package/lib/typescript/src/types/reanimated.d.ts +32 -1
- package/lib/typescript/src/types/reanimated.d.ts.map +1 -1
- package/lib/typescript/src/types/separator.d.ts +26 -0
- package/lib/typescript/src/types/separator.d.ts.map +1 -1
- package/lib/typescript/src/types/slider.d.ts +88 -0
- package/lib/typescript/src/types/slider.d.ts.map +1 -1
- package/lib/typescript/src/types/style.d.ts +43 -0
- package/lib/typescript/src/types/style.d.ts.map +1 -1
- package/lib/typescript/src/types/switch.d.ts +50 -0
- package/lib/typescript/src/types/switch.d.ts.map +1 -1
- package/lib/typescript/src/types/text.d.ts +72 -0
- package/lib/typescript/src/types/text.d.ts.map +1 -1
- package/lib/typescript/src/types/theme.d.ts +111 -0
- package/lib/typescript/src/types/theme.d.ts.map +1 -1
- package/lib/typescript/src/types/view.d.ts +137 -0
- package/lib/typescript/src/types/view.d.ts.map +1 -1
- package/lib/typescript/src/utils/button/const.d.ts +27 -0
- package/lib/typescript/src/utils/button/const.d.ts.map +1 -1
- package/lib/typescript/src/utils/overlay/const.d.ts +67 -0
- package/lib/typescript/src/utils/overlay/const.d.ts.map +1 -1
- package/lib/typescript/src/utils/overlay/func.d.ts +93 -0
- package/lib/typescript/src/utils/overlay/func.d.ts.map +1 -1
- package/lib/typescript/src/utils/slider/const.d.ts +47 -0
- package/lib/typescript/src/utils/slider/const.d.ts.map +1 -1
- package/lib/typescript/src/utils/style/const.d.ts +14 -0
- package/lib/typescript/src/utils/style/const.d.ts.map +1 -1
- package/lib/typescript/src/utils/style/func.d.ts +95 -0
- package/lib/typescript/src/utils/style/func.d.ts.map +1 -1
- package/lib/typescript/src/utils/theme/const.d.ts +170 -0
- package/lib/typescript/src/utils/theme/const.d.ts.map +1 -1
- package/lib/typescript/src/utils/theme/restyle.d.ts +1 -1977
- package/lib/typescript/src/utils/theme/restyle.d.ts.map +1 -1
- package/package.json +4 -4
- package/lib/module/components/overlay/actionSheet/ActionSheet.web.js +0 -76
- package/lib/module/components/overlay/actionSheet/ActionSheet.web.js.map +0 -1
- package/lib/module/components/overlay/actionSheet/ActionSheetHeader.web.js +0 -113
- package/lib/module/components/overlay/actionSheet/ActionSheetHeader.web.js.map +0 -1
- package/lib/module/components/slider/ThemedSlider.web.js +0 -206
- package/lib/module/components/slider/ThemedSlider.web.js.map +0 -1
- package/lib/typescript/src/components/overlay/actionSheet/ActionSheet.web.d.ts +0 -5
- package/lib/typescript/src/components/overlay/actionSheet/ActionSheet.web.d.ts.map +0 -1
- package/lib/typescript/src/components/overlay/actionSheet/ActionSheetHeader.web.d.ts +0 -4
- package/lib/typescript/src/components/overlay/actionSheet/ActionSheetHeader.web.d.ts.map +0 -1
- package/lib/typescript/src/components/slider/ThemedSlider.web.d.ts +0 -5
- package/lib/typescript/src/components/slider/ThemedSlider.web.d.ts.map +0 -1
|
@@ -3,21 +3,79 @@
|
|
|
3
3
|
import { use as reactUse } from 'react';
|
|
4
4
|
import { getWindowDimensionsHeight } from "../style/func.js";
|
|
5
5
|
import { ActionSheetContext, ActionSheetExpandableHeightRatio, actionSheetMaxHeightRatio, AlertContext } from "./const.js";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Hook to access the Alert context.
|
|
9
|
+
* Provides access to alert state and control functions.
|
|
10
|
+
*
|
|
11
|
+
* @returns The alert context value
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* const alertContext = getAlertContext();
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
6
18
|
export function getAlertContext() {
|
|
7
19
|
return reactUse(AlertContext);
|
|
8
20
|
}
|
|
9
21
|
function getActionSheetExpandableHeightByRatio(ratio) {
|
|
10
22
|
return getWindowDimensionsHeight() * ratio;
|
|
11
23
|
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Calculates the maximum height for an action sheet.
|
|
27
|
+
*
|
|
28
|
+
* @param expandable - Whether the action sheet is expandable (supports multiple height positions)
|
|
29
|
+
* @returns The maximum height in pixels
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```tsx
|
|
33
|
+
* const maxHeight = getActionSheetMaxHeight(true);
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
12
36
|
export function getActionSheetMaxHeight(expandable = false) {
|
|
13
37
|
return expandable ? getActionSheetExpandableHeightByRatio(ActionSheetExpandableHeightRatio.Top) : getWindowDimensionsHeight() * actionSheetMaxHeightRatio;
|
|
14
38
|
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Constrains an action sheet height to not exceed the maximum allowed height.
|
|
42
|
+
*
|
|
43
|
+
* @param height - The desired height in pixels
|
|
44
|
+
* @returns The constrained height in pixels, capped at maximum
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```tsx
|
|
48
|
+
* const constrainedHeight = getActionSheetHeight(800);
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
15
51
|
export function getActionSheetHeight(height) {
|
|
16
52
|
return Math.min(height, getActionSheetMaxHeight());
|
|
17
53
|
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Gets the maximum height for an expandable action sheet.
|
|
57
|
+
*
|
|
58
|
+
* @returns The maximum expandable height in pixels (90% of screen height)
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* ```tsx
|
|
62
|
+
* const expandableHeight = getActionSheetExpandableHeight();
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
18
65
|
export function getActionSheetExpandableHeight() {
|
|
19
66
|
return getActionSheetMaxHeight(true);
|
|
20
67
|
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Gets the initial height for an expandable action sheet when first shown.
|
|
71
|
+
*
|
|
72
|
+
* @returns The initial height in pixels (60% of screen height)
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* ```tsx
|
|
76
|
+
* const initialHeight = getActionSheetExpandableInitHeight();
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
21
79
|
export function getActionSheetExpandableInitHeight() {
|
|
22
80
|
return getActionSheetExpandableHeightByRatio(ActionSheetExpandableHeightRatio.Middle);
|
|
23
81
|
}
|
|
@@ -27,9 +85,40 @@ function getActionSheetDismiss(height, currentHeight) {
|
|
|
27
85
|
function getActionSheetExpandableDismiss(currentHight) {
|
|
28
86
|
return currentHight < getActionSheetExpandableHeightByRatio(ActionSheetExpandableHeightRatio.Bottom) / 2;
|
|
29
87
|
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Calculates the snap height for a non-expandable action sheet after user drag gesture ends.
|
|
91
|
+
* Determines whether the sheet should dismiss or snap back to its original height.
|
|
92
|
+
*
|
|
93
|
+
* @param height - The original height of the action sheet in pixels
|
|
94
|
+
* @param currentHeight - The current height after user drag in pixels
|
|
95
|
+
* @param forceDismiss - Whether to force dismissal regardless of current height
|
|
96
|
+
* @returns The target snap height - either the original height (dismissed) or 0 (visible)
|
|
97
|
+
*
|
|
98
|
+
* @example
|
|
99
|
+
* ```tsx
|
|
100
|
+
* const snapHeight = getActionSheetSnapHeight(400, 200, false);
|
|
101
|
+
* // Returns 400 to dismiss if dragged past threshold
|
|
102
|
+
* ```
|
|
103
|
+
*/
|
|
30
104
|
export function getActionSheetSnapHeight(height, currentHeight, forceDismiss) {
|
|
31
105
|
return forceDismiss || getActionSheetDismiss(height, currentHeight) ? height : 0;
|
|
32
106
|
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Calculates the snap height for an expandable action sheet after user drag gesture ends.
|
|
110
|
+
* Determines which height position (top/middle/bottom) the sheet should snap to, or if it should dismiss.
|
|
111
|
+
*
|
|
112
|
+
* @param currentHight - The current height after user drag in pixels
|
|
113
|
+
* @param forceDismiss - Whether to force dismissal regardless of current height
|
|
114
|
+
* @returns The target snap height - 0 for dismissed, or one of the defined snap positions (90%/60%/30% of screen)
|
|
115
|
+
*
|
|
116
|
+
* @example
|
|
117
|
+
* ```tsx
|
|
118
|
+
* const snapHeight = getActionSheetExpandableSnapHeight(500, false);
|
|
119
|
+
* // Returns closest snap position based on current height
|
|
120
|
+
* ```
|
|
121
|
+
*/
|
|
33
122
|
export function getActionSheetExpandableSnapHeight(currentHight, forceDismiss) {
|
|
34
123
|
if (forceDismiss || getActionSheetExpandableDismiss(currentHight)) {
|
|
35
124
|
return 0;
|
|
@@ -46,6 +135,18 @@ export function getActionSheetExpandableSnapHeight(currentHight, forceDismiss) {
|
|
|
46
135
|
return bottomHeight;
|
|
47
136
|
}
|
|
48
137
|
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Hook to access the ActionSheet context.
|
|
141
|
+
* Provides access to action sheet state and control functions.
|
|
142
|
+
*
|
|
143
|
+
* @returns The action sheet context value
|
|
144
|
+
*
|
|
145
|
+
* @example
|
|
146
|
+
* ```tsx
|
|
147
|
+
* const actionSheetContext = getActionSheetContext();
|
|
148
|
+
* ```
|
|
149
|
+
*/
|
|
49
150
|
export function getActionSheetContext() {
|
|
50
151
|
return reactUse(ActionSheetContext);
|
|
51
152
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["use","reactUse","getWindowDimensionsHeight","ActionSheetContext","ActionSheetExpandableHeightRatio","actionSheetMaxHeightRatio","AlertContext","getAlertContext","getActionSheetExpandableHeightByRatio","ratio","getActionSheetMaxHeight","expandable","Top","getActionSheetHeight","height","Math","min","getActionSheetExpandableHeight","getActionSheetExpandableInitHeight","Middle","getActionSheetDismiss","currentHeight","getActionSheetExpandableDismiss","currentHight","Bottom","getActionSheetSnapHeight","forceDismiss","getActionSheetExpandableSnapHeight","topHeight","middleHeight","bottomHeight","getActionSheetContext"],"sourceRoot":"../../../../src","sources":["utils/overlay/func.ts"],"mappings":";;AAAA,SAASA,GAAG,IAAIC,QAAQ,QAAQ,OAAO;AACvC,SAASC,yBAAyB,QAAQ,kBAAe;AACzD,SACEC,kBAAkB,EAClBC,gCAAgC,EAChCC,yBAAyB,EACzBC,YAAY,QACP,YAAS;
|
|
1
|
+
{"version":3,"names":["use","reactUse","getWindowDimensionsHeight","ActionSheetContext","ActionSheetExpandableHeightRatio","actionSheetMaxHeightRatio","AlertContext","getAlertContext","getActionSheetExpandableHeightByRatio","ratio","getActionSheetMaxHeight","expandable","Top","getActionSheetHeight","height","Math","min","getActionSheetExpandableHeight","getActionSheetExpandableInitHeight","Middle","getActionSheetDismiss","currentHeight","getActionSheetExpandableDismiss","currentHight","Bottom","getActionSheetSnapHeight","forceDismiss","getActionSheetExpandableSnapHeight","topHeight","middleHeight","bottomHeight","getActionSheetContext"],"sourceRoot":"../../../../src","sources":["utils/overlay/func.ts"],"mappings":"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","ignoreList":[]}
|
|
@@ -1,24 +1,76 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { BorderSize } from "../theme/const.js";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Display modes for showing the current slider value.
|
|
7
|
+
* Controls whether and where the value label is displayed.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* <Slider
|
|
12
|
+
* valueDisplayMode={SliderValueDisplayMode.Top}
|
|
13
|
+
* value={50}
|
|
14
|
+
* />
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
4
17
|
export let SliderValueDisplayMode = /*#__PURE__*/function (SliderValueDisplayMode) {
|
|
18
|
+
/** No value display */
|
|
5
19
|
SliderValueDisplayMode["None"] = "none";
|
|
20
|
+
/** Display value above the slider */
|
|
6
21
|
SliderValueDisplayMode["Top"] = "top";
|
|
22
|
+
/** Display value below the slider */
|
|
7
23
|
SliderValueDisplayMode["Bottom"] = "bottom";
|
|
8
24
|
return SliderValueDisplayMode;
|
|
9
25
|
}({});
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Size options for the slider track (the rail along which the thumb moves).
|
|
29
|
+
* Values are in pixels representing the track height.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```tsx
|
|
33
|
+
* <Slider trackSize={SliderTrackSize.L} />
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
10
36
|
export let SliderTrackSize = /*#__PURE__*/function (SliderTrackSize) {
|
|
37
|
+
/** Small track - 8px height */
|
|
11
38
|
SliderTrackSize[SliderTrackSize["S"] = 8] = "S";
|
|
39
|
+
/** Medium track - 10px height */
|
|
12
40
|
SliderTrackSize[SliderTrackSize["M"] = 10] = "M";
|
|
41
|
+
/** Large track - 12px height */
|
|
13
42
|
SliderTrackSize[SliderTrackSize["L"] = 12] = "L";
|
|
14
43
|
return SliderTrackSize;
|
|
15
44
|
}({});
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Size options for the slider thumb (the draggable knob).
|
|
48
|
+
* Values are in pixels representing the thumb diameter.
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```tsx
|
|
52
|
+
* <Slider thumbSize={SliderThumbSize.L} />
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
16
55
|
export let SliderThumbSize = /*#__PURE__*/function (SliderThumbSize) {
|
|
56
|
+
/** Small thumb - 20px diameter */
|
|
17
57
|
SliderThumbSize[SliderThumbSize["S"] = 20] = "S";
|
|
58
|
+
/** Medium thumb - 24px diameter */
|
|
18
59
|
SliderThumbSize[SliderThumbSize["M"] = 24] = "M";
|
|
60
|
+
/** Large thumb - 28px diameter */
|
|
19
61
|
SliderThumbSize[SliderThumbSize["L"] = 28] = "L";
|
|
20
62
|
return SliderThumbSize;
|
|
21
63
|
}({});
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Default thumb size used when no size is specified.
|
|
67
|
+
* Set to medium (24px).
|
|
68
|
+
*/
|
|
22
69
|
export const sliderThumbDefaultSize = SliderThumbSize.M;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Default width for slider step indicators.
|
|
73
|
+
* Uses medium border size from theme constants.
|
|
74
|
+
*/
|
|
23
75
|
export const sliderStepIndicatorDefaultWidth = BorderSize.M;
|
|
24
76
|
//# sourceMappingURL=const.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["BorderSize","SliderValueDisplayMode","SliderTrackSize","SliderThumbSize","sliderThumbDefaultSize","M","sliderStepIndicatorDefaultWidth"],"sourceRoot":"../../../../src","sources":["utils/slider/const.ts"],"mappings":";;AAAA,SAASA,UAAU,QAAQ,mBAAgB;
|
|
1
|
+
{"version":3,"names":["BorderSize","SliderValueDisplayMode","SliderTrackSize","SliderThumbSize","sliderThumbDefaultSize","M","sliderStepIndicatorDefaultWidth"],"sourceRoot":"../../../../src","sources":["utils/slider/const.ts"],"mappings":";;AAAA,SAASA,UAAU,QAAQ,mBAAgB;;AAE3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAYC,sBAAsB,0BAAtBA,sBAAsB;EAChC;EADUA,sBAAsB;EAGhC;EAHUA,sBAAsB;EAKhC;EALUA,sBAAsB;EAAA,OAAtBA,sBAAsB;AAAA;;AASlC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAYC,eAAe,0BAAfA,eAAe;EACzB;EADUA,eAAe,CAAfA,eAAe;EAGzB;EAHUA,eAAe,CAAfA,eAAe;EAKzB;EALUA,eAAe,CAAfA,eAAe;EAAA,OAAfA,eAAe;AAAA;;AAS3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAYC,eAAe,0BAAfA,eAAe;EACzB;EADUA,eAAe,CAAfA,eAAe;EAGzB;EAHUA,eAAe,CAAfA,eAAe;EAKzB;EALUA,eAAe,CAAfA,eAAe;EAAA,OAAfA,eAAe;AAAA;;AAS3B;AACA;AACA;AACA;AACA,OAAO,MAAMC,sBAAsB,GAAGD,eAAe,CAACE,CAAC;;AAEvD;AACA;AACA;AACA;AACA,OAAO,MAAMC,+BAA+B,GAAGN,UAAU,CAACK,CAAC","ignoreList":[]}
|
|
@@ -1,7 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Device screen orientation types.
|
|
5
|
+
* Used for responsive layouts and orientation-specific styling.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```tsx
|
|
9
|
+
* const orientation = useOrientation();
|
|
10
|
+
* if (orientation === Orientation.Landscape) {
|
|
11
|
+
* // Apply landscape-specific layout
|
|
12
|
+
* }
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
3
15
|
export let Orientation = /*#__PURE__*/function (Orientation) {
|
|
16
|
+
/** Portrait orientation - height is greater than width */
|
|
4
17
|
Orientation["Portrait"] = "portrait";
|
|
18
|
+
/** Landscape orientation - width is greater than height */
|
|
5
19
|
Orientation["Landscape"] = "landscape";
|
|
6
20
|
return Orientation;
|
|
7
21
|
}({});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Orientation"],"sourceRoot":"../../../../src","sources":["utils/style/const.ts"],"mappings":";;AAAA,WAAYA,WAAW,0BAAXA,WAAW;
|
|
1
|
+
{"version":3,"names":["Orientation"],"sourceRoot":"../../../../src","sources":["utils/style/const.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAYA,WAAW,0BAAXA,WAAW;EACrB;EADUA,WAAW;EAGrB;EAHUA,WAAW;EAAA,OAAXA,WAAW;AAAA","ignoreList":[]}
|
|
@@ -1,27 +1,129 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { Dimensions, StyleSheet } from 'react-native';
|
|
4
|
+
/**
|
|
5
|
+
* Creates a stylesheet from a style object with type safety.
|
|
6
|
+
* Wrapper around React Native's StyleSheet.create for better type inference.
|
|
7
|
+
*
|
|
8
|
+
* @param styles - Object containing named styles
|
|
9
|
+
* @returns A stylesheet object with optimized and frozen styles
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* const styles = createStyleSheet({
|
|
14
|
+
* container: {
|
|
15
|
+
* flex: 1,
|
|
16
|
+
* padding: 16
|
|
17
|
+
* }
|
|
18
|
+
* });
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
4
21
|
export function createStyleSheet(styles) {
|
|
5
22
|
return StyleSheet.create(styles);
|
|
6
23
|
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Composes two style objects or style props into a single style.
|
|
27
|
+
* Handles arrays, objects, and null/undefined values automatically.
|
|
28
|
+
*
|
|
29
|
+
* @param style1 - First style to compose
|
|
30
|
+
* @param style2 - Second style to compose (overrides style1 properties)
|
|
31
|
+
* @returns Composed style object
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```tsx
|
|
35
|
+
* const combinedStyle = composeStyles(baseStyle, overrideStyle);
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
7
38
|
export function composeStyles(style1, style2) {
|
|
8
39
|
return StyleSheet.compose(style1, style2);
|
|
9
40
|
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Flattens an array of styles into a single style object.
|
|
44
|
+
* Useful for resolving style arrays into their final computed values.
|
|
45
|
+
*
|
|
46
|
+
* @param style - Style or array of styles to flatten
|
|
47
|
+
* @returns Flattened style object with all properties resolved
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```tsx
|
|
51
|
+
* const flatStyle = flattenStyle([styles.base, styles.active]);
|
|
52
|
+
* console.log(flatStyle.backgroundColor); // Access resolved value
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
10
55
|
export function flattenStyle(style) {
|
|
11
56
|
return StyleSheet.flatten(style);
|
|
12
57
|
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Gets the current window dimensions.
|
|
61
|
+
*
|
|
62
|
+
* @returns Object containing width, height, scale, and fontScale
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* ```tsx
|
|
66
|
+
* const { width, height } = getWindowDimensions();
|
|
67
|
+
* ```
|
|
68
|
+
*/
|
|
13
69
|
export function getWindowDimensions() {
|
|
14
70
|
return Dimensions.get('window');
|
|
15
71
|
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Gets the current window width in pixels.
|
|
75
|
+
*
|
|
76
|
+
* @returns Window width in pixels
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* ```tsx
|
|
80
|
+
* const width = getWindowDimensionsWidth();
|
|
81
|
+
* ```
|
|
82
|
+
*/
|
|
16
83
|
export function getWindowDimensionsWidth() {
|
|
17
84
|
return getWindowDimensions().width;
|
|
18
85
|
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Gets the current window height in pixels.
|
|
89
|
+
*
|
|
90
|
+
* @returns Window height in pixels
|
|
91
|
+
*
|
|
92
|
+
* @example
|
|
93
|
+
* ```tsx
|
|
94
|
+
* const height = getWindowDimensionsHeight();
|
|
95
|
+
* ```
|
|
96
|
+
*/
|
|
19
97
|
export function getWindowDimensionsHeight() {
|
|
20
98
|
return getWindowDimensions().height;
|
|
21
99
|
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Gets the device pixel density scale factor.
|
|
103
|
+
*
|
|
104
|
+
* @returns Device scale factor (e.g., 2 for @2x, 3 for @3x displays)
|
|
105
|
+
*
|
|
106
|
+
* @example
|
|
107
|
+
* ```tsx
|
|
108
|
+
* const scale = getWindowDimensionsScale();
|
|
109
|
+
* const physicalPixels = logicalPixels * scale;
|
|
110
|
+
* ```
|
|
111
|
+
*/
|
|
22
112
|
export function getWindowDimensionsScale() {
|
|
23
113
|
return getWindowDimensions().scale;
|
|
24
114
|
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Gets the font scaling factor set by the user in device accessibility settings.
|
|
118
|
+
*
|
|
119
|
+
* @returns Font scale factor (typically 1.0, but can be higher for accessibility)
|
|
120
|
+
*
|
|
121
|
+
* @example
|
|
122
|
+
* ```tsx
|
|
123
|
+
* const fontScale = getWindowDimensionsFontScale();
|
|
124
|
+
* const actualFontSize = baseFontSize * fontScale;
|
|
125
|
+
* ```
|
|
126
|
+
*/
|
|
25
127
|
export function getWindowDimensionsFontScale() {
|
|
26
128
|
return getWindowDimensions().fontScale;
|
|
27
129
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Dimensions","StyleSheet","createStyleSheet","styles","create","composeStyles","style1","style2","compose","flattenStyle","style","flatten","getWindowDimensions","get","getWindowDimensionsWidth","width","getWindowDimensionsHeight","height","getWindowDimensionsScale","scale","getWindowDimensionsFontScale","fontScale"],"sourceRoot":"../../../../src","sources":["utils/style/func.ts"],"mappings":";;AAAA,SAASA,UAAU,EAAEC,UAAU,QAAQ,cAAc;AAGrD,OAAO,SAASC,gBAAgBA,CAAkCC,MAAS,EAAE;EAC3E,OAAOF,UAAU,CAACG,MAAM,CAAID,MAAM,CAAC;AACrC;
|
|
1
|
+
{"version":3,"names":["Dimensions","StyleSheet","createStyleSheet","styles","create","composeStyles","style1","style2","compose","flattenStyle","style","flatten","getWindowDimensions","get","getWindowDimensionsWidth","width","getWindowDimensionsHeight","height","getWindowDimensionsScale","scale","getWindowDimensionsFontScale","fontScale"],"sourceRoot":"../../../../src","sources":["utils/style/func.ts"],"mappings":";;AAAA,SAASA,UAAU,EAAEC,UAAU,QAAQ,cAAc;AAGrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,gBAAgBA,CAAkCC,MAAS,EAAE;EAC3E,OAAOF,UAAU,CAACG,MAAM,CAAID,MAAM,CAAC;AACrC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASE,aAAaA,CAC3BC,MAA4B,EAC5BC,MAA4B,EAC5B;EACA,OAAON,UAAU,CAACO,OAAO,CAAUF,MAAM,EAAEC,MAAM,CAAC;AACpD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASE,YAAYA,CAAkBC,KAA0B,EAAE;EACxE,OAAOT,UAAU,CAACU,OAAO,CAAID,KAAK,CAAC;AACrC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASE,mBAAmBA,CAAA,EAAG;EACpC,OAAOZ,UAAU,CAACa,GAAG,CAAC,QAAQ,CAAC;AACjC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,wBAAwBA,CAAA,EAAG;EACzC,OAAOF,mBAAmB,CAAC,CAAC,CAACG,KAAK;AACpC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,yBAAyBA,CAAA,EAAG;EAC1C,OAAOJ,mBAAmB,CAAC,CAAC,CAACK,MAAM;AACrC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,wBAAwBA,CAAA,EAAG;EACzC,OAAON,mBAAmB,CAAC,CAAC,CAACO,KAAK;AACpC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,4BAA4BA,CAAA,EAAG;EAC7C,OAAOR,mBAAmB,CAAC,CAAC,CAACS,SAAS;AACxC","ignoreList":[]}
|
|
@@ -2,79 +2,228 @@
|
|
|
2
2
|
|
|
3
3
|
import { createTheme } from '@shopify/restyle';
|
|
4
4
|
import { StyleSheet } from 'react-native';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Color palette used throughout the application.
|
|
8
|
+
* Contains primary theme colors and semantic colors with transparency variants.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```tsx
|
|
12
|
+
* const styles = StyleSheet.create({
|
|
13
|
+
* container: {
|
|
14
|
+
* backgroundColor: Palette.ThemePri,
|
|
15
|
+
* borderColor: Palette.Silver
|
|
16
|
+
* }
|
|
17
|
+
* });
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
5
20
|
export let Palette = /*#__PURE__*/function (Palette) {
|
|
21
|
+
/** Fully transparent color */
|
|
6
22
|
Palette["Transparent"] = "transparent";
|
|
23
|
+
/** Primary theme color - bright green */
|
|
7
24
|
Palette["ThemePri"] = "#7ccf6b";
|
|
25
|
+
/** Secondary theme color - darker green */
|
|
8
26
|
Palette["ThemeSec"] = "#5aa85a";
|
|
27
|
+
/** Primary theme color with 50% transparency */
|
|
9
28
|
Palette["ThemePriT"] = "#7ccf6b80";
|
|
29
|
+
/** Near black - used for text in light mode */
|
|
10
30
|
Palette["Black"] = "#000501";
|
|
31
|
+
/** Black with 50% transparency */
|
|
11
32
|
Palette["BlackT"] = "#00050180";
|
|
33
|
+
/** Off-white - used for backgrounds in light mode */
|
|
12
34
|
Palette["White"] = "#fafafa";
|
|
35
|
+
/** White with 50% transparency */
|
|
13
36
|
Palette["WhiteT"] = "#fafafa80";
|
|
37
|
+
/** Light gray - used for disabled states */
|
|
14
38
|
Palette["Silver"] = "#c4c4c4";
|
|
39
|
+
/** Medium gray - used for borders */
|
|
15
40
|
Palette["Grey"] = "#7a7a7a";
|
|
41
|
+
/** Red - used for errors and destructive actions */
|
|
16
42
|
Palette["Red"] = "#ff3b30";
|
|
17
43
|
return Palette;
|
|
18
44
|
}({});
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Spacing scale used for margins, padding, and gaps.
|
|
48
|
+
* Based on a geometric progression for consistent spacing ratios.
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```tsx
|
|
52
|
+
* <View style={{ padding: Spacing.M, gap: Spacing.S }}>
|
|
53
|
+
* <Text>Content</Text>
|
|
54
|
+
* </View>
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
19
57
|
export let Spacing = /*#__PURE__*/function (Spacing) {
|
|
58
|
+
/** No spacing - 0px */
|
|
20
59
|
Spacing[Spacing["None"] = 0] = "None";
|
|
60
|
+
/** Extra extra extra small - 2px */
|
|
21
61
|
Spacing[Spacing["XXXS"] = 2] = "XXXS";
|
|
62
|
+
/** Extra extra small - 4px */
|
|
22
63
|
Spacing[Spacing["XXS"] = 4] = "XXS";
|
|
64
|
+
/** Extra small - 6px */
|
|
23
65
|
Spacing[Spacing["XS"] = 6] = "XS";
|
|
66
|
+
/** Small - 10px */
|
|
24
67
|
Spacing[Spacing["S"] = 10] = "S";
|
|
68
|
+
/** Medium - 16px */
|
|
25
69
|
Spacing[Spacing["M"] = 16] = "M";
|
|
70
|
+
/** Large - 26px */
|
|
26
71
|
Spacing[Spacing["L"] = 26] = "L";
|
|
72
|
+
/** Extra large - 42px */
|
|
27
73
|
Spacing[Spacing["XL"] = 42] = "XL";
|
|
74
|
+
/** Extra extra large - 68px */
|
|
28
75
|
Spacing[Spacing["XXL"] = 68] = "XXL";
|
|
76
|
+
/** Extra extra extra large - 110px */
|
|
29
77
|
Spacing[Spacing["XXXL"] = 110] = "XXXL";
|
|
30
78
|
return Spacing;
|
|
31
79
|
}({});
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Font size scale for text elements.
|
|
83
|
+
* Provides consistent typography sizing across the application.
|
|
84
|
+
*
|
|
85
|
+
* @example
|
|
86
|
+
* ```tsx
|
|
87
|
+
* <Text style={{ fontSize: FontSize.M }}>
|
|
88
|
+
* Medium text
|
|
89
|
+
* </Text>
|
|
90
|
+
* ```
|
|
91
|
+
*/
|
|
32
92
|
export let FontSize = /*#__PURE__*/function (FontSize) {
|
|
93
|
+
/** Extra small - 12px */
|
|
33
94
|
FontSize[FontSize["XS"] = 12] = "XS";
|
|
95
|
+
/** Small - 16px */
|
|
34
96
|
FontSize[FontSize["S"] = 16] = "S";
|
|
97
|
+
/** Medium - 20px */
|
|
35
98
|
FontSize[FontSize["M"] = 20] = "M";
|
|
99
|
+
/** Large - 24px */
|
|
36
100
|
FontSize[FontSize["L"] = 24] = "L";
|
|
101
|
+
/** Extra large - 28px */
|
|
37
102
|
FontSize[FontSize["XL"] = 28] = "XL";
|
|
38
103
|
return FontSize;
|
|
39
104
|
}({});
|
|
40
105
|
|
|
41
106
|
/** @internal */
|
|
42
107
|
const FontLineHeightRatio = 1.4;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Line heights calculated from font sizes with a 1.4 ratio.
|
|
111
|
+
* Ensures proper vertical spacing and readability for text.
|
|
112
|
+
*
|
|
113
|
+
* @example
|
|
114
|
+
* ```tsx
|
|
115
|
+
* <Text style={{
|
|
116
|
+
* fontSize: FontSize.M,
|
|
117
|
+
* lineHeight: FontLineHeight.M
|
|
118
|
+
* }}>
|
|
119
|
+
* Readable text
|
|
120
|
+
* </Text>
|
|
121
|
+
* ```
|
|
122
|
+
*/
|
|
43
123
|
export let FontLineHeight = /*#__PURE__*/function (FontLineHeight) {
|
|
124
|
+
/** Extra small line height - 16.8px (12px * 1.4) */
|
|
44
125
|
FontLineHeight[FontLineHeight["XS"] = 16.799999999999997] = "XS";
|
|
126
|
+
/** Small line height - 22.4px (16px * 1.4) */
|
|
45
127
|
FontLineHeight[FontLineHeight["S"] = 22.4] = "S";
|
|
128
|
+
/** Medium line height - 28px (20px * 1.4) */
|
|
46
129
|
FontLineHeight[FontLineHeight["M"] = 28] = "M";
|
|
130
|
+
/** Large line height - 33.6px (24px * 1.4) */
|
|
47
131
|
FontLineHeight[FontLineHeight["L"] = 33.599999999999994] = "L";
|
|
132
|
+
/** Extra large line height - 39.2px (28px * 1.4) */
|
|
48
133
|
FontLineHeight[FontLineHeight["XL"] = 39.199999999999996] = "XL";
|
|
49
134
|
return FontLineHeight;
|
|
50
135
|
}({});
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Size options for switch components.
|
|
139
|
+
* Values represent the width/height of the switch track in pixels.
|
|
140
|
+
*
|
|
141
|
+
* @example
|
|
142
|
+
* ```tsx
|
|
143
|
+
* <Switch size={SwitchSize.M} />
|
|
144
|
+
* ```
|
|
145
|
+
*/
|
|
51
146
|
export let SwitchSize = /*#__PURE__*/function (SwitchSize) {
|
|
147
|
+
/** Small switch - 16px */
|
|
52
148
|
SwitchSize[SwitchSize["S"] = 16] = "S";
|
|
149
|
+
/** Medium switch - 22px */
|
|
53
150
|
SwitchSize[SwitchSize["M"] = 22] = "M";
|
|
151
|
+
/** Large switch - 28px */
|
|
54
152
|
SwitchSize[SwitchSize["L"] = 28] = "L";
|
|
55
153
|
return SwitchSize;
|
|
56
154
|
}({});
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Border width/thickness options.
|
|
158
|
+
* Includes hairline width for platform-specific thin borders.
|
|
159
|
+
*
|
|
160
|
+
* @example
|
|
161
|
+
* ```tsx
|
|
162
|
+
* <View style={{ borderWidth: BorderSize.M }}>
|
|
163
|
+
* Content
|
|
164
|
+
* </View>
|
|
165
|
+
* ```
|
|
166
|
+
*/
|
|
57
167
|
export let BorderSize = function (BorderSize) {
|
|
168
|
+
/** No border - 0px */
|
|
58
169
|
BorderSize[BorderSize["None"] = 0] = "None";
|
|
170
|
+
/** Hairline border - thinnest possible border for the platform (typically 0.5-1px) */
|
|
59
171
|
BorderSize[BorderSize["XS"] = StyleSheet.hairlineWidth] = "XS";
|
|
172
|
+
/** Small border - 1px */
|
|
60
173
|
BorderSize[BorderSize["S"] = 1] = "S";
|
|
174
|
+
/** Medium border - 2px */
|
|
61
175
|
BorderSize[BorderSize["M"] = 2] = "M";
|
|
176
|
+
/** Large border - 4px */
|
|
62
177
|
BorderSize[BorderSize["L"] = 4] = "L";
|
|
178
|
+
/** Extra large border - 8px */
|
|
63
179
|
BorderSize[BorderSize["XL"] = 8] = "XL";
|
|
64
180
|
return BorderSize;
|
|
65
181
|
}({});
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Border radius options for rounded corners.
|
|
185
|
+
* Round value creates fully circular shapes when applied to square elements.
|
|
186
|
+
*
|
|
187
|
+
* @example
|
|
188
|
+
* ```tsx
|
|
189
|
+
* <View style={{ borderRadius: BorderRadius.M }}>
|
|
190
|
+
* Rounded corners
|
|
191
|
+
* </View>
|
|
192
|
+
* ```
|
|
193
|
+
*/
|
|
66
194
|
export let BorderRadius = /*#__PURE__*/function (BorderRadius) {
|
|
195
|
+
/** No rounding - sharp corners */
|
|
67
196
|
BorderRadius[BorderRadius["None"] = 0] = "None";
|
|
197
|
+
/** Small radius - 12px */
|
|
68
198
|
BorderRadius[BorderRadius["S"] = 12] = "S";
|
|
199
|
+
/** Medium radius - 24px */
|
|
69
200
|
BorderRadius[BorderRadius["M"] = 24] = "M";
|
|
201
|
+
/** Large radius - 36px */
|
|
70
202
|
BorderRadius[BorderRadius["L"] = 36] = "L";
|
|
203
|
+
/** Fully rounded - creates circles/pills (9999px) */
|
|
71
204
|
BorderRadius[BorderRadius["Round"] = 9999] = "Round";
|
|
72
205
|
return BorderRadius;
|
|
73
206
|
}({});
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* Z-index layering values for stacking order.
|
|
210
|
+
* Controls which elements appear above others in the visual hierarchy.
|
|
211
|
+
*
|
|
212
|
+
* @example
|
|
213
|
+
* ```tsx
|
|
214
|
+
* <View style={{ zIndex: ZIndex.Top }}>
|
|
215
|
+
* Top layer content
|
|
216
|
+
* </View>
|
|
217
|
+
* ```
|
|
218
|
+
*/
|
|
74
219
|
export let ZIndex = /*#__PURE__*/function (ZIndex) {
|
|
220
|
+
/** Base layer - 0 */
|
|
75
221
|
ZIndex[ZIndex["Base"] = 0] = "Base";
|
|
222
|
+
/** Bottom layer - 1 */
|
|
76
223
|
ZIndex[ZIndex["Bottom"] = 1] = "Bottom";
|
|
224
|
+
/** Middle layer - 2 */
|
|
77
225
|
ZIndex[ZIndex["Middle"] = 2] = "Middle";
|
|
226
|
+
/** Top layer - 3 */
|
|
78
227
|
ZIndex[ZIndex["Top"] = 3] = "Top";
|
|
79
228
|
return ZIndex;
|
|
80
229
|
}({});
|
|
@@ -107,6 +256,22 @@ const textVariants = {
|
|
|
107
256
|
color: 'text'
|
|
108
257
|
}
|
|
109
258
|
};
|
|
259
|
+
|
|
260
|
+
/**
|
|
261
|
+
* Light theme configuration for the application.
|
|
262
|
+
* Contains all theme values including colors, spacing, breakpoints, and text variants.
|
|
263
|
+
* Built using Shopify Restyle for type-safe styling.
|
|
264
|
+
*
|
|
265
|
+
* @example
|
|
266
|
+
* ```tsx
|
|
267
|
+
* import { ThemeProvider } from '@shopify/restyle';
|
|
268
|
+
* import { lightTheme } from './utils/theme/const';
|
|
269
|
+
*
|
|
270
|
+
* <ThemeProvider theme={lightTheme}>
|
|
271
|
+
* <App />
|
|
272
|
+
* </ThemeProvider>
|
|
273
|
+
* ```
|
|
274
|
+
*/
|
|
110
275
|
export const lightTheme = createTheme({
|
|
111
276
|
colors: {
|
|
112
277
|
transparent: Palette.Transparent,
|
|
@@ -179,6 +344,21 @@ export const lightTheme = createTheme({
|
|
|
179
344
|
defaults: textVariants.textM
|
|
180
345
|
}
|
|
181
346
|
});
|
|
347
|
+
|
|
348
|
+
/**
|
|
349
|
+
* Dark theme configuration for the application.
|
|
350
|
+
* Extends the light theme with inverted background and text colors.
|
|
351
|
+
*
|
|
352
|
+
* @example
|
|
353
|
+
* ```tsx
|
|
354
|
+
* import { ThemeProvider } from '@shopify/restyle';
|
|
355
|
+
* import { darkTheme } from './utils/theme/const';
|
|
356
|
+
*
|
|
357
|
+
* <ThemeProvider theme={darkTheme}>
|
|
358
|
+
* <App />
|
|
359
|
+
* </ThemeProvider>
|
|
360
|
+
* ```
|
|
361
|
+
*/
|
|
182
362
|
export const darkTheme = {
|
|
183
363
|
...lightTheme,
|
|
184
364
|
colors: {
|