@jamadd/react-native-template-ui 0.9.1 → 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/lib/module/components/accordion/ThemedAccordion.js +85 -60
- package/lib/module/components/accordion/ThemedAccordion.js.map +1 -1
- 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 +89 -61
- package/lib/module/components/slider/Slider.js.map +1 -1
- package/lib/module/components/slider/ThemedSlider.js +25 -3
- 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 +3 -3
- package/lib/module/index.js.map +1 -1
- 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 +15 -0
- package/lib/typescript/src/components/accordion/ThemedAccordion.d.ts.map +1 -1
- 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/types/accordion.d.ts +26 -0
- package/lib/typescript/src/types/accordion.d.ts.map +1 -1
- 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/accordion/ThemedAccordion.web.js +0 -245
- package/lib/module/components/accordion/ThemedAccordion.web.js.map +0 -1
- 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/Slider.web.js +0 -595
- package/lib/module/components/slider/Slider.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/accordion/ThemedAccordion.web.d.ts +0 -5
- package/lib/typescript/src/components/accordion/ThemedAccordion.web.d.ts.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/Slider.web.d.ts +0 -5
- package/lib/typescript/src/components/slider/Slider.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
|
@@ -6,6 +6,18 @@ import { useEffect, useMemo, useRef } from 'react';
|
|
|
6
6
|
import { ButtonScaleRatio, OnPressDelayType } from "../utils/button/const.js";
|
|
7
7
|
import { composeStyles } from "../utils/style/func.js";
|
|
8
8
|
import { animatedThemedPressableRestyleFuncs, themedPressableRestyleFuncs } from "../utils/theme/restyle.js";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Hook to wrap an onPress handler with debounce or throttle behavior.
|
|
12
|
+
* @param onPress - The press handler function to be delayed
|
|
13
|
+
* @param onPressDelayConfig - Configuration for delay type (debounce/throttle) and wait time
|
|
14
|
+
* @returns A memoized onPress handler with the configured delay behavior
|
|
15
|
+
* @example
|
|
16
|
+
* const delayedPress = useDelayedOnPress(
|
|
17
|
+
* () => console.log('Pressed'),
|
|
18
|
+
* { type: OnPressDelayType.Debounce, wait: 500 }
|
|
19
|
+
* );
|
|
20
|
+
*/
|
|
9
21
|
export function useDelayedOnPress(onPress, onPressDelayConfig) {
|
|
10
22
|
const $ = _c(9);
|
|
11
23
|
const onPressTimestamp = useRef(0);
|
|
@@ -95,6 +107,8 @@ export function useDelayedOnPress(onPress, onPressDelayConfig) {
|
|
|
95
107
|
}
|
|
96
108
|
return t3;
|
|
97
109
|
}
|
|
110
|
+
|
|
111
|
+
/** @internal */
|
|
98
112
|
function _temp() {
|
|
99
113
|
console.warn("onPress is not defined");
|
|
100
114
|
}
|
|
@@ -142,6 +156,21 @@ function usePressableProps(t0) {
|
|
|
142
156
|
const pressableProps = t3;
|
|
143
157
|
return pressableProps;
|
|
144
158
|
}
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Hook to create themed pressable props with restyle support, scale animation, and delayed press handling.
|
|
162
|
+
* @param props - Themed pressable properties including theme props, onPress, scaleRatio, and onPressDelayConfig
|
|
163
|
+
* @returns Object containing all pressable props with applied theme styles and behaviors
|
|
164
|
+
* @example
|
|
165
|
+
* const pressableProps = useThemedPressable({
|
|
166
|
+
* backgroundColor: 'themePri',
|
|
167
|
+
* padding: 'm',
|
|
168
|
+
* borderRadius: 'm',
|
|
169
|
+
* onPress: () => console.log('Pressed'),
|
|
170
|
+
* scaleRatio: ButtonScaleRatio.Small,
|
|
171
|
+
* onPressDelayConfig: { type: OnPressDelayType.Debounce, wait: 300 }
|
|
172
|
+
* });
|
|
173
|
+
*/
|
|
145
174
|
export function useThemedPressable(t0) {
|
|
146
175
|
const $ = _c(16);
|
|
147
176
|
let onPress;
|
|
@@ -213,6 +242,23 @@ export function useThemedPressable(t0) {
|
|
|
213
242
|
const themedPressableProps = t3;
|
|
214
243
|
return themedPressableProps;
|
|
215
244
|
}
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* Hook to create animated themed pressable props with reanimated support and delayed press handling.
|
|
248
|
+
* @param props - Animated themed pressable properties including theme props, onPress, animatedStyle, and onPressDelayConfig
|
|
249
|
+
* @returns Object containing all animated pressable props with applied theme styles, animations, and behaviors
|
|
250
|
+
* @example
|
|
251
|
+
* const animatedStyle = useAnimatedStyle(() => ({
|
|
252
|
+
* opacity: interpolate(progress.value, [0, 1], [0.5, 1])
|
|
253
|
+
* }));
|
|
254
|
+
* const pressableProps = useAnimatedThemedPressable({
|
|
255
|
+
* backgroundColor: 'themePri',
|
|
256
|
+
* padding: 'm',
|
|
257
|
+
* animatedStyle,
|
|
258
|
+
* onPress: () => console.log('Pressed'),
|
|
259
|
+
* onPressDelayConfig: { type: OnPressDelayType.Throttle, wait: 1000 }
|
|
260
|
+
* });
|
|
261
|
+
*/
|
|
216
262
|
export function useAnimatedThemedPressable(t0) {
|
|
217
263
|
const $ = _c(19);
|
|
218
264
|
let animatedStyle;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useRestyle","useEffect","useMemo","useRef","ButtonScaleRatio","OnPressDelayType","composeStyles","animatedThemedPressableRestyleFuncs","themedPressableRestyleFuncs","useDelayedOnPress","onPress","onPressDelayConfig","$","_c","onPressTimestamp","debounceTimeout","undefined","t0","Symbol","for","current","clearTimeout","clearDebounceTimeout","t1","t2","t3","bb0","tempOnPress","_temp","type","wait","Debounce","t4","event_0","setTimeout","event","Throttle","Date","now","console","warn","usePressableProps","scaleRatio","style","None","pressableOnPress","pressed","transform","scale","styleCb","pressableProps","useThemedPressable","props","restyle","themedPressableProps","useAnimatedThemedPressable","animatedStyle","animatedThemedPressableProps"],"sourceRoot":"../../../src","sources":["hooks/button.ts"],"mappings":";;;AAAA,SAASA,UAAU,QAAQ,kBAAkB;AAC7C,SAASC,SAAS,EAAEC,OAAO,EAAEC,MAAM,QAAQ,OAAO;AAUlD,SAASC,gBAAgB,EAAEC,gBAAgB,QAAQ,0BAAuB;AAC1E,SAASC,aAAa,QAAQ,wBAAqB;AACnD,SACEC,mCAAmC,EACnCC,2BAA2B,QACtB,2BAAwB
|
|
1
|
+
{"version":3,"names":["useRestyle","useEffect","useMemo","useRef","ButtonScaleRatio","OnPressDelayType","composeStyles","animatedThemedPressableRestyleFuncs","themedPressableRestyleFuncs","useDelayedOnPress","onPress","onPressDelayConfig","$","_c","onPressTimestamp","debounceTimeout","undefined","t0","Symbol","for","current","clearTimeout","clearDebounceTimeout","t1","t2","t3","bb0","tempOnPress","_temp","type","wait","Debounce","t4","event_0","setTimeout","event","Throttle","Date","now","console","warn","usePressableProps","scaleRatio","style","None","pressableOnPress","pressed","transform","scale","styleCb","pressableProps","useThemedPressable","props","restyle","themedPressableProps","useAnimatedThemedPressable","animatedStyle","animatedThemedPressableProps"],"sourceRoot":"../../../src","sources":["hooks/button.ts"],"mappings":";;;AAAA,SAASA,UAAU,QAAQ,kBAAkB;AAC7C,SAASC,SAAS,EAAEC,OAAO,EAAEC,MAAM,QAAQ,OAAO;AAUlD,SAASC,gBAAgB,EAAEC,gBAAgB,QAAQ,0BAAuB;AAC1E,SAASC,aAAa,QAAQ,wBAAqB;AACnD,SACEC,mCAAmC,EACnCC,2BAA2B,QACtB,2BAAwB;;AAE/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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
|
|
4
4
|
import { useRef } from 'react';
|
|
5
5
|
import { useThemedSeparator } from "./separator.js";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Hook to create a ref for a FlatList or SectionList component.
|
|
9
|
+
* @template T - The type of items in the list
|
|
10
|
+
* @returns A mutable ref object for accessing the list instance
|
|
11
|
+
* @example
|
|
12
|
+
* const listRef = useListRef<MyItemType>();
|
|
13
|
+
* <FlatList ref={listRef} />
|
|
14
|
+
* // Later: listRef.current?.scrollToEnd()
|
|
15
|
+
*/
|
|
6
16
|
export function useListRef() {
|
|
7
17
|
return useRef(null);
|
|
8
18
|
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Hook to create a customizable list item separator component with conditional rendering.
|
|
22
|
+
* @param props - Configuration for the separator appearance
|
|
23
|
+
* @param props.size - The size/thickness of the separator
|
|
24
|
+
* @param props.vertical - Whether the separator is vertical (default: false)
|
|
25
|
+
* @param props.backgroundColor - The background color of the separator
|
|
26
|
+
* @param props.style - Additional styles for the separator
|
|
27
|
+
* @param hideForLeadingItemTypes - Array of item type strings to hide separator after
|
|
28
|
+
* @param hideForTrailingItemTypes - Array of item type strings to hide separator before
|
|
29
|
+
* @returns A ListItemSeparatorComponent that renders conditionally based on adjacent items
|
|
30
|
+
* @example
|
|
31
|
+
* const ItemSeparator = useListItemSeparatorComponent(
|
|
32
|
+
* { size: BorderSize.S, backgroundColor: 'separator' },
|
|
33
|
+
* ['header'],
|
|
34
|
+
* ['footer']
|
|
35
|
+
* );
|
|
36
|
+
* <FlatList ItemSeparatorComponent={ItemSeparator} />
|
|
37
|
+
*/
|
|
9
38
|
export function useListItemSeparatorComponent(t0, t1, t2) {
|
|
10
39
|
const $ = _c(10);
|
|
11
40
|
let t3;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useRef","useThemedSeparator","useListRef","useListItemSeparatorComponent","t0","t1","t2","$","_c","t3","undefined","props","t4","hideForLeadingItemTypes","t5","hideForTrailingItemTypes","ThemedSeparator","size","vertical","backgroundColor","style","t6","t7","leadingItem","trailingItem","includes","type","ListItemSeparatorComponent"],"sourceRoot":"../../../src","sources":["hooks/list.ts"],"mappings":";;;AAAA,SAASA,MAAM,QAAQ,OAAO;AAM9B,SAASC,kBAAkB,QAAQ,gBAAa;
|
|
1
|
+
{"version":3,"names":["useRef","useThemedSeparator","useListRef","useListItemSeparatorComponent","t0","t1","t2","$","_c","t3","undefined","props","t4","hideForLeadingItemTypes","t5","hideForTrailingItemTypes","ThemedSeparator","size","vertical","backgroundColor","style","t6","t7","leadingItem","trailingItem","includes","type","ListItemSeparatorComponent"],"sourceRoot":"../../../src","sources":["hooks/list.ts"],"mappings":";;;AAAA,SAASA,MAAM,QAAQ,OAAO;AAM9B,SAASC,kBAAkB,QAAQ,gBAAa;;AAEhD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAAAC,WAAA;EAAA,OACEF,MAAM,CAAa,IAAI,CAAC;AAAA;;AAGjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAAAG,8BAAAC,EAAA,EAAAC,EAAA,EAAAC,EAAA;EAAA,MAAAC,CAAA,GAAAC,EAAA;EAAA,IAAAC,EAAA;EAAA,IAAAF,CAAA,QAAAH,EAAA;IACLK,EAAA,GAAAL,EAAkC,KAAlCM,SAAkC,GAAlC,CAAiC,CAAC,GAAlCN,EAAkC;IAAAG,CAAA,MAAAH,EAAA;IAAAG,CAAA,MAAAE,EAAA;EAAA;IAAAA,EAAA,GAAAF,CAAA;EAAA;EAAlC,MAAAI,KAAA,GAAAF,EAAkC;EAAA,IAAAG,EAAA;EAAA,IAAAL,CAAA,QAAAF,EAAA;IAClCO,EAAA,GAAAP,EAAsC,KAAtCK,SAAsC,GAAtC,EAAsC,GAAtCL,EAAsC;IAAAE,CAAA,MAAAF,EAAA;IAAAE,CAAA,MAAAK,EAAA;EAA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ect, useRef, useState } from 'react';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Hook to manage a timeout with automatic cleanup.
|
|
8
|
+
* @returns Object containing timeoutRef and clearTimeoutRef function
|
|
9
|
+
* @returns timeoutRef - Ref to store the timeout ID
|
|
10
|
+
* @returns clearTimeoutRef - Function to clear the timeout
|
|
11
|
+
* @example
|
|
12
|
+
* const { timeoutRef, clearTimeoutRef } = useTimeout();
|
|
13
|
+
* timeoutRef.current = setTimeout(() => {
|
|
14
|
+
* console.log('Delayed action');
|
|
15
|
+
* }, 1000);
|
|
16
|
+
* // Cleanup happens automatically on unmount
|
|
17
|
+
*/
|
|
5
18
|
export function useTimeout() {
|
|
6
19
|
const $ = _c(4);
|
|
7
20
|
const timeoutRef = useRef(null);
|
|
@@ -42,6 +55,19 @@ export function useTimeout() {
|
|
|
42
55
|
}
|
|
43
56
|
return t3;
|
|
44
57
|
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Hook to manage an interval with automatic cleanup.
|
|
61
|
+
* @returns Object containing intervalRef and clearIntervalRef function
|
|
62
|
+
* @returns intervalRef - Ref to store the interval ID
|
|
63
|
+
* @returns clearIntervalRef - Function to clear the interval
|
|
64
|
+
* @example
|
|
65
|
+
* const { intervalRef, clearIntervalRef } = useInterval();
|
|
66
|
+
* intervalRef.current = setInterval(() => {
|
|
67
|
+
* console.log('Repeating action');
|
|
68
|
+
* }, 1000);
|
|
69
|
+
* // Cleanup happens automatically on unmount
|
|
70
|
+
*/
|
|
45
71
|
export function useInterval() {
|
|
46
72
|
const $ = _c(4);
|
|
47
73
|
const intervalRef = useRef(null);
|
|
@@ -82,6 +108,21 @@ export function useInterval() {
|
|
|
82
108
|
}
|
|
83
109
|
return t3;
|
|
84
110
|
}
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Hook to manage state with a deferred version for performance optimization.
|
|
114
|
+
* @template T - The type of the state value
|
|
115
|
+
* @param initialState - Initial state value
|
|
116
|
+
* @returns Object containing state, setState, and deferredState
|
|
117
|
+
* @returns state - The current state value
|
|
118
|
+
* @returns setState - Function to update the state
|
|
119
|
+
* @returns deferredState - Deferred version of state that updates after urgent updates
|
|
120
|
+
* @example
|
|
121
|
+
* const { state, setState, deferredState } = useDeferredState('');
|
|
122
|
+
* // Use state for input control, deferredState for expensive operations
|
|
123
|
+
* <TextInput value={state} onChangeText={setState} />
|
|
124
|
+
* <ExpensiveList filter={deferredState} />
|
|
125
|
+
*/
|
|
85
126
|
export function useDeferredState(initialState) {
|
|
86
127
|
const $ = _c(3);
|
|
87
128
|
const [state, setState] = useState(initialState);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useDeferredValue","useEffect","useRef","useState","useTimeout","$","_c","timeoutRef","t0","Symbol","for","current","clearTimeout","clearTimeoutRef","t1","t2","t3","useInterval","intervalRef","clearInterval","clearIntervalRef","useDeferredState","initialState","state","setState","deferredState"],"sourceRoot":"../../../src","sources":["hooks/react.ts"],"mappings":";;;AAAA,SAASA,gBAAgB,EAAEC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;
|
|
1
|
+
{"version":3,"names":["useDeferredValue","useEffect","useRef","useState","useTimeout","$","_c","timeoutRef","t0","Symbol","for","current","clearTimeout","clearTimeoutRef","t1","t2","t3","useInterval","intervalRef","clearInterval","clearIntervalRef","useDeferredState","initialState","state","setState","deferredState"],"sourceRoot":"../../../src","sources":["hooks/react.ts"],"mappings":";;;AAAA,SAASA,gBAAgB,EAAEC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;;AAErE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAAAC,WAAA;EAAA,MAAAC,CAAA,GAAAC,EAAA;EACL,MAAAC,UAAA,GAAmBL,MAAM,CAAS,IAAI,CAAC;EAAC,IAAAM,EAAA;EAAA,IAAAH,CAAA,QAAAI,MAAA,CAAAC,GAAA;IAChBF,EAAA,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|
+
* Hook to create a shared value for animations initialized to 0.
|
|
6
|
+
* @returns A shared value initialized to 0, used for controlling animations
|
|
7
|
+
* @example
|
|
8
|
+
* const animValue = useAnimationSharedVal();
|
|
9
|
+
* const animatedStyle = useAnimatedStyle(() => ({
|
|
10
|
+
* opacity: animValue.value
|
|
11
|
+
* }));
|
|
12
|
+
* // Later: animValue.value = withTiming(1);
|
|
13
|
+
*/
|
|
4
14
|
export function useAnimationSharedVal() {
|
|
5
15
|
return useSharedValue(0);
|
|
6
16
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useSharedValue","useAnimationSharedVal"],"sourceRoot":"../../../src","sources":["hooks/reanimated.ts"],"mappings":";;AAAA,SAASA,cAAc,QAAQ,yBAAyB;AAGxD,OAAO,SAAAC,sBAAA;EAAA,OACED,cAAc,CAAiB,CAAC,CAAC;AAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["useSharedValue","useAnimationSharedVal"],"sourceRoot":"../../../src","sources":["hooks/reanimated.ts"],"mappings":";;AAAA,SAASA,cAAc,QAAQ,yBAAyB;AAGxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAAAC,sBAAA;EAAA,OACED,cAAc,CAAiB,CAAC,CAAC;AAAA","ignoreList":[]}
|
|
@@ -3,8 +3,25 @@
|
|
|
3
3
|
import { createElement } from 'react';
|
|
4
4
|
import { BorderSize } from "../utils/theme/const.js";
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
/** @internal */
|
|
7
7
|
let ThemedSeparator;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Hook to create a themed separator element with customizable appearance.
|
|
11
|
+
* @param size - The thickness of the separator (default: BorderSize.S)
|
|
12
|
+
* @param vertical - Whether the separator is vertical (default: false)
|
|
13
|
+
* @param backgroundColor - The background color from theme colors (default: 'separator')
|
|
14
|
+
* @param style - Additional style properties to apply
|
|
15
|
+
* @returns A React element representing the separator
|
|
16
|
+
* @example
|
|
17
|
+
* const separator = useThemedSeparator(
|
|
18
|
+
* BorderSize.M,
|
|
19
|
+
* false,
|
|
20
|
+
* 'themePri',
|
|
21
|
+
* { marginVertical: 'm' }
|
|
22
|
+
* );
|
|
23
|
+
* // Use in JSX: {separator}
|
|
24
|
+
*/
|
|
8
25
|
export function useThemedSeparator(size = BorderSize.S, vertical = false, backgroundColor = 'separator', style = {}) {
|
|
9
26
|
const props = {
|
|
10
27
|
size,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createElement","BorderSize","ThemedSeparator","useThemedSeparator","size","S","vertical","backgroundColor","style","props","require","default","element"],"sourceRoot":"../../../src","sources":["hooks/separator.ts"],"mappings":";;AAAA,SAASA,aAAa,QAAiB,OAAO;AAG9C,SAASC,UAAU,QAAQ,yBAAsB;;AAEjD;AACA,IAAIC,eAAqD;
|
|
1
|
+
{"version":3,"names":["createElement","BorderSize","ThemedSeparator","useThemedSeparator","size","S","vertical","backgroundColor","style","props","require","default","element"],"sourceRoot":"../../../src","sources":["hooks/separator.ts"],"mappings":";;AAAA,SAASA,aAAa,QAAiB,OAAO;AAG9C,SAASC,UAAU,QAAQ,yBAAsB;;AAEjD;AACA,IAAIC,eAAqD;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,kBAAkBA,CAChCC,IAAI,GAAGH,UAAU,CAACI,CAAC,EACnBC,QAAQ,GAAG,KAAK,EAChBC,eAA4B,GAAG,WAAW,EAC1CC,KAGC,GAAG,CAAC,CAAC,EACN;EACA,MAAMC,KAA2B,GAAG;IAClCL,IAAI;IACJE,QAAQ;IACRC,eAAe;IACf,GAAGC;EACL,CAAC;EACDN,eAAe,KACbQ,OAAO,CAAC,yCAAyC,CAAC,CAACC,OAAO;EAC5D,MAAMC,OAAO,gBAAGZ,aAAa,CAACE,eAAe,EAAGO,KAAK,CAAC;EAEtD,OAAOG,OAAO;AAChB","ignoreList":[]}
|
|
@@ -5,6 +5,28 @@ import { useWindowDimensions as useRNWindowDimensions } from 'react-native';
|
|
|
5
5
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
6
6
|
import { Orientation } from "../utils/style/const.js";
|
|
7
7
|
import { useThemeSpacing } from "./theme.js";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Hook to calculate padding styles based on safe area insets.
|
|
11
|
+
* @param config - Configuration object specifying which insets to apply and optional padding values
|
|
12
|
+
* @param config.insets - If true, applies all insets (top, bottom, left, right)
|
|
13
|
+
* @param config.insetTop - If true, applies top inset
|
|
14
|
+
* @param config.insetBottom - If true, applies bottom inset
|
|
15
|
+
* @param config.insetLeft - If true, applies left inset
|
|
16
|
+
* @param config.insetRight - If true, applies right inset
|
|
17
|
+
* @param config.insetsPadding - Additional padding to apply to all insets
|
|
18
|
+
* @param config.insetPaddingTop - Additional padding to apply to top inset
|
|
19
|
+
* @param config.insetPaddingBottom - Additional padding to apply to bottom inset
|
|
20
|
+
* @param config.insetPaddingLeft - Additional padding to apply to left inset
|
|
21
|
+
* @param config.insetPaddingRight - Additional padding to apply to right inset
|
|
22
|
+
* @returns ViewStyle object with calculated padding values for safe areas
|
|
23
|
+
* @example
|
|
24
|
+
* const insetsStyle = useInsetsStyle({
|
|
25
|
+
* insets: true,
|
|
26
|
+
* insetsPadding: 'm'
|
|
27
|
+
* });
|
|
28
|
+
* // Returns: { paddingTop: 44 + 16, paddingBottom: 34 + 16, ... }
|
|
29
|
+
*/
|
|
8
30
|
export function useInsetsStyle(t0) {
|
|
9
31
|
const $ = _c(16);
|
|
10
32
|
const {
|
|
@@ -56,21 +78,71 @@ export function useInsetsStyle(t0) {
|
|
|
56
78
|
const insetsStyle = t1;
|
|
57
79
|
return insetsStyle;
|
|
58
80
|
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Hook to get the window dimensions including width, height, scale, and fontScale.
|
|
84
|
+
* @returns Object containing window dimensions { width, height, scale, fontScale }
|
|
85
|
+
* @example
|
|
86
|
+
* const { width, height } = useWindowDimensions();
|
|
87
|
+
* console.log(`Screen size: ${width}x${height}`);
|
|
88
|
+
*/
|
|
59
89
|
export function useWindowDimensions() {
|
|
60
90
|
return useRNWindowDimensions();
|
|
61
91
|
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Hook to get the current window width in pixels.
|
|
95
|
+
* @returns The width of the window in pixels
|
|
96
|
+
* @example
|
|
97
|
+
* const width = useWindowDimensionsWidth();
|
|
98
|
+
* console.log(`Window width: ${width}px`);
|
|
99
|
+
*/
|
|
62
100
|
export function useWindowDimensionsWidth() {
|
|
63
101
|
return useWindowDimensions().width;
|
|
64
102
|
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Hook to get the current window height in pixels.
|
|
106
|
+
* @returns The height of the window in pixels
|
|
107
|
+
* @example
|
|
108
|
+
* const height = useWindowDimensionsHeight();
|
|
109
|
+
* console.log(`Window height: ${height}px`);
|
|
110
|
+
*/
|
|
65
111
|
export function useWindowDimensionsHeight() {
|
|
66
112
|
return useWindowDimensions().height;
|
|
67
113
|
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Hook to get the pixel density scale of the device.
|
|
117
|
+
* @returns The scale factor (e.g., 2 for @2x, 3 for @3x displays)
|
|
118
|
+
* @example
|
|
119
|
+
* const scale = useWindowDimensionsScale();
|
|
120
|
+
* console.log(`Device scale: ${scale}x`);
|
|
121
|
+
*/
|
|
68
122
|
export function useWindowDimensionsScale() {
|
|
69
123
|
return useWindowDimensions().scale;
|
|
70
124
|
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Hook to get the font scaling factor set by the user in device settings.
|
|
128
|
+
* @returns The font scale factor (1.0 is default, >1.0 means larger text is enabled)
|
|
129
|
+
* @example
|
|
130
|
+
* const fontScale = useWindowDimensionsFontScale();
|
|
131
|
+
* const adjustedFontSize = 16 * fontScale;
|
|
132
|
+
*/
|
|
71
133
|
export function useWindowDimensionsFontScale() {
|
|
72
134
|
return useWindowDimensions().fontScale;
|
|
73
135
|
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Hook to determine the current device orientation.
|
|
139
|
+
* @returns The current orientation ('portrait' or 'landscape')
|
|
140
|
+
* @example
|
|
141
|
+
* const orientation = useOrientation();
|
|
142
|
+
* if (orientation === Orientation.Landscape) {
|
|
143
|
+
* // Render landscape layout
|
|
144
|
+
* }
|
|
145
|
+
*/
|
|
74
146
|
export function useOrientation() {
|
|
75
147
|
const {
|
|
76
148
|
width,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useWindowDimensions","useRNWindowDimensions","useSafeAreaInsets","Orientation","useThemeSpacing","useInsetsStyle","t0","$","_c","insets","insetTop","insetBottom","insetLeft","insetRight","insetsPadding","insetPaddingTop","insetPaddingBottom","insetPaddingLeft","insetPaddingRight","top","bottom","left","right","spacing","t1","JSON","parse","stringify","paddingTop","undefined","paddingBottom","paddingLeft","paddingRight","insetsStyle","useWindowDimensionsWidth","width","useWindowDimensionsHeight","height","useWindowDimensionsScale","scale","useWindowDimensionsFontScale","fontScale","useOrientation","orientation","Landscape","Portrait"],"sourceRoot":"../../../src","sources":["hooks/style.ts"],"mappings":";;;AAAA,SACEA,mBAAmB,IAAIC,qBAAqB,QAEvC,cAAc;AACrB,SAASC,iBAAiB,QAAQ,gCAAgC;AAElE,SAASC,WAAW,QAAQ,yBAAsB;AAClD,SAASC,eAAe,QAAQ,YAAS;
|
|
1
|
+
{"version":3,"names":["useWindowDimensions","useRNWindowDimensions","useSafeAreaInsets","Orientation","useThemeSpacing","useInsetsStyle","t0","$","_c","insets","insetTop","insetBottom","insetLeft","insetRight","insetsPadding","insetPaddingTop","insetPaddingBottom","insetPaddingLeft","insetPaddingRight","top","bottom","left","right","spacing","t1","JSON","parse","stringify","paddingTop","undefined","paddingBottom","paddingLeft","paddingRight","insetsStyle","useWindowDimensionsWidth","width","useWindowDimensionsHeight","height","useWindowDimensionsScale","scale","useWindowDimensionsFontScale","fontScale","useOrientation","orientation","Landscape","Portrait"],"sourceRoot":"../../../src","sources":["hooks/style.ts"],"mappings":";;;AAAA,SACEA,mBAAmB,IAAIC,qBAAqB,QAEvC,cAAc;AACrB,SAASC,iBAAiB,QAAQ,gCAAgC;AAElE,SAASC,WAAW,QAAQ,yBAAsB;AAClD,SAASC,eAAe,QAAQ,YAAS;;AAEzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAAAC,eAAAC,EAAA;EAAA,MAAAC,CAAA,GAAAC,EAAA;EAAwB;IAAAC,MAAA;IAAAC,QAAA;IAAAC,WAAA;IAAAC,SAAA;IAAAC,UAAA;IAAAC,aAAA;IAAAC,eAAA;IAAAC,kBAAA;IAAAC,gBAAA;IAAAC;EAAA,IAAAZ,EAWX;EAClB;IAAAa,GAAA;IAAAC,MAAA;IAAAC,IAAA;IAAAC;EAAA,IAAqCpB,iBAAiB,CAAC,CAAC;EACxD,MAAAqB,OAAA,GAAgBnB,eAAe,CAAC,CAAC;EAAC,IAAAoB,EAAA;EAAA,IAAAjB,CAAA,QAAAa,MAAA,IAAAb,CAAA,QAAAI,WAAA,IAAAJ,CAAA,QAAAK,SAAA,IAAAL,CAAA,QAAAS,kBAAA,IAAAT,CAAA,QAAAU,gBAAA,IAAAV,CAAA,QAAAW,iBAAA,IAAAX,CAAA,QAAAQ,eAAA,IAAAR,CAAA,QAAAM,UAAA,IAAAN,CAAA,QAAAG,QAAA,IAAAH,CAAA,QAAAE,MAAA,IAAAF,CAAA,SAAAO,aAAA,IAAAP,CAAA,SAAAc,IAAA,IAAAd,CAAA,SAAAe,KAAA,IAAAf,CAAA,SAAAgB,OAAA,IAAAhB,CAAA,SAAAY,GAAA;IAK9BK,EAAA,GAAAC,IAAI,CAAAC,KAAM,CACZD,IAAI,CAAAE,SAAU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ACA,OAAO,SAAAiC,yBAAA;EAAA,OACElC,mBAAmB,CAAC,CAAC,CAAAmC,KAAM;AAAA;;AAGpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAAAC,0BAAA;EAAA,OACEpC,mBAAmB,CAAC,CAAC,CAAAqC,MAAO;AAAA;;AAGrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAAAC,yBAAA;EAAA,OACEtC,mBAAmB,CAAC,CAAC,CAAAuC,KAAM;AAAA;;AAGpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAAAC,6BAAA;EAAA,OACExC,mBAAmB,CAAC,CAAC,CAAAyC,SAAU;AAAA;;AAGxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAAAC,eAAA;EACL;IAAAP,KAAA;IAAAE;EAAA,IAA0BrC,mBAAmB,CAAC,CAAC;EAE/C,MAAA2C,WAAA,GACER,KAAK,GAAGE,MAAqD,GAA5ClC,WAAW,CAAAyC,SAAiC,GAApBzC,WAAW,CAAA0C,QAAS;EAAC,OAEzDF,WAAW;AAAA","ignoreList":[]}
|
|
@@ -4,21 +4,72 @@ import { c as _c } from "react/compiler-runtime";
|
|
|
4
4
|
import { useResponsiveProp, useTheme as useRestyleTheme } from '@shopify/restyle';
|
|
5
5
|
import { useColorScheme } from 'react-native';
|
|
6
6
|
import { darkTheme, lightTheme } from "../utils/theme/const.js";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Hook to access the current theme object.
|
|
10
|
+
* @returns The current theme configuration including colors, spacing, breakpoints, etc.
|
|
11
|
+
* @example
|
|
12
|
+
* const theme = useTheme();
|
|
13
|
+
* console.log(theme.colors.themePri);
|
|
14
|
+
*/
|
|
7
15
|
export function useTheme() {
|
|
8
16
|
return useRestyleTheme();
|
|
9
17
|
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Hook to access the theme's color palette.
|
|
21
|
+
* @returns Object containing all theme colors (themePri, themeSec, background, text, etc.).
|
|
22
|
+
* @example
|
|
23
|
+
* const colors = useThemeColors();
|
|
24
|
+
* console.log(colors.themePri); // '#7ccf6b'
|
|
25
|
+
*/
|
|
10
26
|
export function useThemeColors() {
|
|
11
27
|
return useTheme().colors;
|
|
12
28
|
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Hook to access the theme's spacing scale.
|
|
32
|
+
* @returns Object containing spacing values (none, xxxs, xxs, xs, s, m, l, xl, xxl, xxxl).
|
|
33
|
+
* @example
|
|
34
|
+
* const spacing = useThemeSpacing();
|
|
35
|
+
* console.log(spacing.m); // 16
|
|
36
|
+
*/
|
|
13
37
|
export function useThemeSpacing() {
|
|
14
38
|
return useTheme().spacing;
|
|
15
39
|
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Hook to access the theme's responsive breakpoints.
|
|
43
|
+
* @returns Object containing breakpoint values (smallPhone, phone, smallTablet, tablet, desktop).
|
|
44
|
+
* @example
|
|
45
|
+
* const breakpoints = useThemeBreakpoints();
|
|
46
|
+
* console.log(breakpoints.tablet); // 900
|
|
47
|
+
*/
|
|
16
48
|
export function useThemeBreakpoints() {
|
|
17
49
|
return useTheme().breakpoints;
|
|
18
50
|
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Hook to resolve a responsive prop value based on the current breakpoint.
|
|
54
|
+
* @template T - The type of the prop value
|
|
55
|
+
* @param propValue - A responsive value object with breakpoint keys
|
|
56
|
+
* @returns The resolved value for the current breakpoint
|
|
57
|
+
* @example
|
|
58
|
+
* const fontSize = useThemeBreakpointValues({ phone: 14, tablet: 16, desktop: 18 });
|
|
59
|
+
*/
|
|
19
60
|
export function useThemeBreakpointValues(propValue) {
|
|
20
61
|
return useResponsiveProp(propValue);
|
|
21
62
|
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Hook to get the current active breakpoint name.
|
|
66
|
+
* @returns The name of the current breakpoint ('smallPhone' | 'phone' | 'smallTablet' | 'tablet' | 'desktop')
|
|
67
|
+
* @example
|
|
68
|
+
* const breakpoint = useThemeBreakpoint();
|
|
69
|
+
* if (breakpoint === 'phone') {
|
|
70
|
+
* // Render mobile layout
|
|
71
|
+
* }
|
|
72
|
+
*/
|
|
22
73
|
export function useThemeBreakpoint() {
|
|
23
74
|
const $ = _c(1);
|
|
24
75
|
let t0;
|
|
@@ -37,19 +88,61 @@ export function useThemeBreakpoint() {
|
|
|
37
88
|
const responsiveVal = t0;
|
|
38
89
|
return useThemeBreakpointValues(responsiveVal);
|
|
39
90
|
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Hook to access the theme's z-index scale.
|
|
94
|
+
* @returns Object containing z-index values (base, bottom, middle, top).
|
|
95
|
+
* @example
|
|
96
|
+
* const zIndices = useThemeZIndices();
|
|
97
|
+
* console.log(zIndices.top); // 3
|
|
98
|
+
*/
|
|
40
99
|
export function useThemeZIndices() {
|
|
41
100
|
return useTheme().zIndices;
|
|
42
101
|
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Hook to access the theme's border radius scale.
|
|
105
|
+
* @returns Object containing border radius values (none, s, m, l, round).
|
|
106
|
+
* @example
|
|
107
|
+
* const borderRadii = useThemeBorderRadii();
|
|
108
|
+
* console.log(borderRadii.m); // 24
|
|
109
|
+
*/
|
|
43
110
|
export function useThemeBorderRadii() {
|
|
44
111
|
return useTheme().borderRadii;
|
|
45
112
|
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Hook to access the theme's text style variants.
|
|
116
|
+
* @returns Object containing text variant definitions (textXS, textS, textM, textL, textXL and their bold versions).
|
|
117
|
+
* @example
|
|
118
|
+
* const textVariants = useThemeTextVariants();
|
|
119
|
+
* console.log(textVariants.textM);
|
|
120
|
+
*/
|
|
46
121
|
export function useThemeTextVariants() {
|
|
47
122
|
return useTheme().textVariants;
|
|
48
123
|
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Hook to determine if the current color scheme is dark mode.
|
|
127
|
+
* @param overrideColorScheme - Optional color scheme to override the system's color scheme
|
|
128
|
+
* @returns True if the color scheme is 'dark', false otherwise
|
|
129
|
+
* @example
|
|
130
|
+
* const isDark = useIsDarkColorScheme();
|
|
131
|
+
* const backgroundColor = isDark ? '#000' : '#fff';
|
|
132
|
+
*/
|
|
49
133
|
export function useIsDarkColorScheme(overrideColorScheme) {
|
|
50
134
|
const colorScheme = useColorScheme();
|
|
51
135
|
return (overrideColorScheme ?? colorScheme) === "dark";
|
|
52
136
|
}
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Hook to get the appropriate theme (light or dark) based on the current color scheme.
|
|
140
|
+
* @param overrideColorScheme - Optional color scheme to override the system's color scheme
|
|
141
|
+
* @returns The dark theme if in dark mode, otherwise the light theme
|
|
142
|
+
* @example
|
|
143
|
+
* const theme = useColorSchemeTheme();
|
|
144
|
+
* // Returns darkTheme or lightTheme based on system preference
|
|
145
|
+
*/
|
|
53
146
|
export function useColorSchemeTheme(overrideColorScheme) {
|
|
54
147
|
return useIsDarkColorScheme(overrideColorScheme) ? darkTheme : lightTheme;
|
|
55
148
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useResponsiveProp","useTheme","useRestyleTheme","useColorScheme","darkTheme","lightTheme","useThemeColors","colors","useThemeSpacing","spacing","useThemeBreakpoints","breakpoints","useThemeBreakpointValues","propValue","useThemeBreakpoint","$","_c","t0","Symbol","for","smallPhone","phone","smallTablet","tablet","desktop","responsiveVal","useThemeZIndices","zIndices","useThemeBorderRadii","borderRadii","useThemeTextVariants","textVariants","useIsDarkColorScheme","overrideColorScheme","colorScheme","useColorSchemeTheme"],"sourceRoot":"../../../src","sources":["hooks/theme.ts"],"mappings":";;;AAAA,SACEA,iBAAiB,EACjBC,QAAQ,IAAIC,eAAe,QAGtB,kBAAkB;AACzB,SAASC,cAAc,QAA8B,cAAc;AAEnE,SAASC,SAAS,EAAEC,UAAU,QAAQ,yBAAsB;
|
|
1
|
+
{"version":3,"names":["useResponsiveProp","useTheme","useRestyleTheme","useColorScheme","darkTheme","lightTheme","useThemeColors","colors","useThemeSpacing","spacing","useThemeBreakpoints","breakpoints","useThemeBreakpointValues","propValue","useThemeBreakpoint","$","_c","t0","Symbol","for","smallPhone","phone","smallTablet","tablet","desktop","responsiveVal","useThemeZIndices","zIndices","useThemeBorderRadii","borderRadii","useThemeTextVariants","textVariants","useIsDarkColorScheme","overrideColorScheme","colorScheme","useColorSchemeTheme"],"sourceRoot":"../../../src","sources":["hooks/theme.ts"],"mappings":";;;AAAA,SACEA,iBAAiB,EACjBC,QAAQ,IAAIC,eAAe,QAGtB,kBAAkB;AACzB,SAASC,cAAc,QAA8B,cAAc;AAEnE,SAASC,SAAS,EAAEC,UAAU,QAAQ,yBAAsB;;AAE5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAAAJ,SAAA;EAAA,OACEC,eAAe,CAAQ,CAAC;AAAA;;AAGjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAAAI,eAAA;EAAA,OACEL,QAAQ,CAAC,CAAC,CAAAM,MAAO;AAAA;;AAG1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAAAC,gBAAA;EAAA,OACEP,QAAQ,CAAC,CAAC,CAAAQ,OAAQ;AAAA;;AAG3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAAAC,oBAAA;EAAA,OACET,QAAQ,CAAC,CAAC,CAAAU,WAAY;AAAA;;AAG/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAAAC,yBAAAC,SAAA;EAAA,OAGEb,iBAAiB,CAACa,SAAS,CAAC;AAAA;;AAGrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAAAC,mBAAA;EAAA,MAAAC,CAAA,GAAAC,EAAA;EAAA,IAAAC,EAAA;EAAA,IAAAF,CAAA,QAAAG,MAAA,CAAAC,GAA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