@neko-os/ui 0.0.7 → 0.0.9
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/dist/NekoUI.js +1 -1
- package/dist/abstractions/ActivityIndicator.native.js +1 -1
- package/dist/abstractions/ActivityIndicator.web.js +1 -0
- package/dist/abstractions/AnimatedView.js +1 -1
- package/dist/abstractions/BlurView.js +1 -0
- package/dist/abstractions/BlurView.native.js +1 -0
- package/dist/abstractions/BlurView.web.js +1 -0
- package/dist/abstractions/FlatList.js +1 -0
- package/dist/abstractions/FlatList.native.js +1 -0
- package/dist/abstractions/FlatList.web.js +1 -0
- package/dist/abstractions/GradientView.js +1 -0
- package/dist/abstractions/GradientView.native.js +1 -0
- package/dist/abstractions/Icon.native.js +1 -1
- package/dist/abstractions/ImageBackground.js +1 -0
- package/dist/abstractions/ImageBackground.native.js +1 -0
- package/dist/abstractions/ImageBackground.web.js +1 -0
- package/dist/abstractions/Pressable.js +1 -0
- package/dist/abstractions/Pressable.native.js +1 -0
- package/dist/abstractions/Pressable.web.js +1 -0
- package/dist/abstractions/ScrollView.js +1 -0
- package/dist/abstractions/ScrollView.native.js +1 -0
- package/dist/abstractions/ScrollView.web.js +1 -0
- package/dist/abstractions/TextInput.js +1 -1
- package/dist/abstractions/helpers/storage.js +1 -0
- package/dist/abstractions/helpers/storage.native.js +1 -0
- package/dist/components/actions/Button.js +1 -1
- package/dist/components/actions/Dropdown.js +1 -1
- package/dist/components/actions/Link.js +1 -1
- package/dist/components/actions/Pressable.js +1 -0
- package/dist/components/actions/index.js +1 -1
- package/dist/components/actions/menu/HorizontalMenu.js +1 -1
- package/dist/components/actions/menu/VerticalMenu.js +1 -1
- package/dist/components/animations/ReanimatedView.js +1 -0
- package/dist/components/calendar/CalendarNav.js +1 -0
- package/dist/components/calendar/WeekDaysBar.js +1 -0
- package/dist/components/calendar/_helpers/calendarDays.js +1 -1
- package/dist/components/calendar/_helpers/dateDisabled.js +1 -0
- package/dist/components/calendar/index.js +0 -1
- package/dist/components/feedback/alerter.js +1 -0
- package/dist/components/feedback/confirmer.js +1 -0
- package/dist/components/feedback/index.js +1 -1
- package/dist/components/feedback/notifications/Notification.js +1 -1
- package/dist/components/feedback/notifications/NotificationsHandler.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/inputs/DateInput.js +1 -0
- package/dist/components/inputs/InputWrapper.js +1 -1
- package/dist/components/inputs/LinkInput.js +1 -0
- package/dist/components/inputs/MaskInput.js +1 -0
- package/dist/components/inputs/TextInput.js +1 -1
- package/dist/components/inputs/_DateInput.native.js +1 -0
- package/dist/components/inputs/datePicker/DatePicker.js +1 -0
- package/dist/components/inputs/datePicker/DayPicker.js +1 -0
- package/dist/components/inputs/datePicker/MonthPicker.js +1 -0
- package/dist/components/inputs/datePicker/QuarterPicker.js +1 -0
- package/dist/components/inputs/datePicker/WeekPicker.js +1 -0
- package/dist/components/inputs/datePicker/YearPicker.js +1 -0
- package/dist/components/inputs/index.js +1 -1
- package/dist/components/layout/Layout.js +1 -1
- package/dist/components/list/FlatList.js +1 -0
- package/dist/components/list/ScrollView.js +1 -0
- package/dist/components/list/index.js +1 -0
- package/dist/components/presentation/ImageBackground.js +1 -0
- package/dist/components/presentation/Result.js +1 -1
- package/dist/components/presentation/index.js +1 -1
- package/dist/components/state/LoadingView.js +1 -1
- package/dist/components/structure/Accordion.js +1 -1
- package/dist/components/structure/BlurView.js +1 -0
- package/dist/components/structure/GradientView.js +1 -0
- package/dist/components/structure/View.js +1 -1
- package/dist/components/structure/bottomDrawer/index.js +1 -0
- package/dist/components/structure/bottomDrawer/index.native.js +1 -0
- package/dist/components/structure/bottomDrawer/index.web.js +1 -0
- package/dist/components/structure/bottomDrawer/native/BottomDrawer.js +1 -0
- package/dist/components/structure/bottomDrawer/native/DrawerContext.js +1 -0
- package/dist/components/structure/bottomDrawer/native/DrawerHandle.js +1 -0
- package/dist/components/structure/bottomDrawer/native/DrawerScrollView.js +1 -0
- package/dist/components/structure/bottomDrawer/native/utils.js +1 -0
- package/dist/components/structure/bottomDrawer/web/BottomDrawer.js +1 -0
- package/dist/components/structure/drawer/Drawer.js +1 -0
- package/dist/components/structure/drawer/Drawer.native.js +1 -0
- package/dist/components/structure/drawer/index.js +1 -0
- package/dist/components/structure/index.js +1 -1
- package/dist/components/structure/modal/Modal.js +1 -0
- package/dist/components/structure/modal/Modal.native.js +1 -0
- package/dist/components/structure/modal/ModalBackdrop.js +1 -0
- package/dist/components/structure/modal/ModalContent.js +1 -0
- package/dist/components/structure/modal/ModalFooter.js +1 -0
- package/dist/components/structure/modal/ModalHeader.js +1 -0
- package/dist/components/structure/modal/handler/ModalsHandler.js +1 -0
- package/dist/components/structure/modal/index.js +1 -0
- package/dist/components/structure/overlay/OverlayWrapper.js +1 -1
- package/dist/components/structure/popover/Popover.js +1 -1
- package/dist/components/structure/popover/Popover.native.js +1 -1
- package/dist/components/theme/ThemePicker.js +1 -0
- package/dist/components/theme/ThemePickerDrawer.js +1 -0
- package/dist/components/theme/ThemeStatusBar.js +1 -0
- package/dist/components/theme/ThemeStatusBar.native.js +1 -0
- package/dist/components/theme/ThemeThumb.js +1 -0
- package/dist/components/theme/index.js +1 -0
- package/dist/helpers/index.js +1 -1
- package/dist/helpers/storage.js +1 -0
- package/dist/modifiers/animations/animatedEffects.js +1 -1
- package/dist/modifiers/animations/animatedEffects.native.js +1 -1
- package/dist/modifiers/animations/fadeEffect.js +1 -1
- package/dist/modifiers/animations/scaleEffect.js +1 -0
- package/dist/modifiers/animations/scaleEffect.native.js +1 -0
- package/dist/modifiers/animations/slideEffect.js +1 -1
- package/dist/modifiers/background.js +1 -1
- package/dist/modifiers/cursor.js +1 -0
- package/dist/modifiers/display.js +1 -1
- package/dist/modifiers/fullColor.js +1 -1
- package/dist/modifiers/hover.js +1 -0
- package/dist/modifiers/position.js +1 -1
- package/dist/modifiers/size.js +1 -1
- package/dist/modifiers/state.js +1 -1
- package/dist/responsive/responsiveHooks.js +1 -1
- package/dist/theme/ThemeHandler.js +1 -1
- package/dist/theme/default/base.js +1 -1
- package/dist/theme/default/blackTheme.js +1 -0
- package/dist/theme/default/cyberpunkTheme.js +1 -1
- package/dist/theme/default/darkTheme.js +1 -1
- package/dist/theme/default/deepWoodsTheme.js +1 -1
- package/dist/theme/default/forestTheme.js +1 -1
- package/dist/theme/default/hackerTheme.js +1 -1
- package/dist/theme/default/lightTheme.js +1 -1
- package/dist/theme/default/midnightTheme.js +1 -1
- package/dist/theme/default/msdosTheme.js +1 -1
- package/dist/theme/default/oceanTheme.js +1 -1
- package/dist/theme/default/paperTheme.js +1 -0
- package/dist/theme/default/pastelTheme.js +1 -1
- package/dist/theme/default/sunsetTheme.js +1 -1
- package/dist/theme/default/themes.js +1 -1
- package/dist/theme/format/formatTheme.js +1 -1
- package/dist/theme/helpers/contrastColor.js +1 -1
- package/package.json +8 -3
- package/src/NekoUI.js +18 -3
- package/src/abstractions/ActivityIndicator.native.js +3 -4
- package/src/abstractions/ActivityIndicator.web.js +43 -0
- package/src/abstractions/AnimatedView.js +3 -3
- package/src/abstractions/BlurView.js +43 -0
- package/src/abstractions/BlurView.native.js +39 -0
- package/src/abstractions/BlurView.web.js +39 -0
- package/src/abstractions/FlatList.js +39 -0
- package/src/abstractions/FlatList.native.js +32 -0
- package/src/abstractions/FlatList.web.js +3 -0
- package/src/abstractions/GradientView.js +5 -0
- package/src/abstractions/GradientView.native.js +32 -0
- package/src/abstractions/Icon.native.js +4 -2
- package/src/abstractions/ImageBackground.js +17 -0
- package/src/abstractions/ImageBackground.native.js +27 -0
- package/src/abstractions/ImageBackground.web.js +7 -0
- package/src/abstractions/Pressable.js +4 -0
- package/src/abstractions/Pressable.native.js +3 -0
- package/src/abstractions/Pressable.web.js +3 -0
- package/src/abstractions/ScrollView.js +3 -0
- package/src/abstractions/ScrollView.native.js +5 -0
- package/src/abstractions/ScrollView.web.js +3 -0
- package/src/abstractions/Text.web.js +15 -0
- package/src/abstractions/TextInput.js +2 -2
- package/src/abstractions/helpers/storage.js +32 -0
- package/src/abstractions/helpers/storage.native.js +34 -0
- package/src/components/actions/Button.js +8 -0
- package/src/components/actions/Dropdown.js +18 -2
- package/src/components/actions/Link.js +16 -2
- package/src/components/actions/Pressable.js +38 -0
- package/src/components/actions/index.js +1 -0
- package/src/components/actions/menu/HorizontalMenu.js +2 -1
- package/src/components/actions/menu/VerticalMenu.js +5 -4
- package/src/components/animations/ReanimatedView.js +40 -0
- package/src/components/calendar/CalendarNav.js +67 -0
- package/src/components/calendar/WeekDaysBar.js +18 -0
- package/src/components/calendar/_helpers/calendarDays.js +1 -3
- package/src/components/calendar/_helpers/dateDisabled.js +24 -0
- package/src/components/calendar/index.js +1 -1
- package/src/components/feedback/alerter.js +31 -0
- package/src/components/feedback/confirmer.js +70 -0
- package/src/components/feedback/index.js +2 -0
- package/src/components/feedback/notifications/Notification.js +1 -1
- package/src/components/feedback/notifications/NotificationsHandler.js +3 -3
- package/src/components/index.js +2 -0
- package/src/components/inputs/DateInput.js +111 -0
- package/src/components/inputs/InputWrapper.js +18 -6
- package/src/components/inputs/LinkInput.js +17 -0
- package/src/components/inputs/MaskInput.js +67 -0
- package/src/components/inputs/TextInput.js +2 -2
- package/src/components/inputs/_DateInput.native.js +89 -0
- package/src/components/inputs/datePicker/DatePicker.js +24 -0
- package/src/components/inputs/datePicker/DayPicker.js +65 -0
- package/src/components/inputs/datePicker/MonthPicker.js +62 -0
- package/src/components/inputs/datePicker/QuarterPicker.js +65 -0
- package/src/components/inputs/datePicker/WeekPicker.js +74 -0
- package/src/components/inputs/datePicker/YearPicker.js +67 -0
- package/src/components/inputs/index.js +4 -0
- package/src/components/layout/Layout.js +1 -1
- package/src/components/list/FlatList.js +54 -0
- package/src/components/list/ScrollView.js +58 -0
- package/src/components/list/index.js +2 -0
- package/src/components/presentation/ImageBackground.js +38 -0
- package/src/components/presentation/Result.js +2 -2
- package/src/components/presentation/index.js +1 -0
- package/src/components/state/LoadingView.js +10 -1
- package/src/components/structure/Accordion.js +1 -1
- package/src/components/structure/BlurView.js +58 -0
- package/src/components/structure/GradientView.js +42 -0
- package/src/components/structure/View.js +2 -0
- package/src/components/structure/bottomDrawer/index.js +1 -0
- package/src/components/structure/bottomDrawer/index.native.js +4 -0
- package/src/components/structure/bottomDrawer/index.web.js +4 -0
- package/src/components/structure/bottomDrawer/native/BottomDrawer.js +242 -0
- package/src/components/structure/bottomDrawer/native/DrawerContext.js +21 -0
- package/src/components/structure/bottomDrawer/native/DrawerHandle.js +12 -0
- package/src/components/structure/bottomDrawer/native/DrawerScrollView.js +83 -0
- package/src/components/structure/bottomDrawer/native/utils.js +58 -0
- package/src/components/structure/bottomDrawer/web/BottomDrawer.js +3 -0
- package/src/components/structure/drawer/Drawer.js +5 -0
- package/src/components/structure/drawer/Drawer.native.js +3 -0
- package/src/components/structure/drawer/index.js +1 -0
- package/src/components/structure/index.js +5 -0
- package/src/components/structure/modal/Modal.js +84 -0
- package/src/components/structure/modal/Modal.native.js +83 -0
- package/src/components/structure/modal/ModalBackdrop.js +58 -0
- package/src/components/structure/modal/ModalContent.js +28 -0
- package/src/components/structure/modal/ModalFooter.js +31 -0
- package/src/components/structure/modal/ModalHeader.js +50 -0
- package/src/components/structure/modal/handler/ModalsHandler.js +61 -0
- package/src/components/structure/modal/index.js +6 -0
- package/src/components/structure/overlay/OverlayWrapper.js +1 -1
- package/src/components/structure/popover/Popover.js +37 -2
- package/src/components/structure/popover/Popover.native.js +46 -16
- package/src/components/theme/ThemePicker.js +49 -0
- package/src/components/theme/ThemePickerDrawer.js +13 -0
- package/src/components/theme/ThemeStatusBar.js +3 -0
- package/src/components/theme/ThemeStatusBar.native.js +9 -0
- package/src/components/theme/ThemeThumb.js +98 -0
- package/src/components/theme/index.js +3 -0
- package/src/helpers/index.js +1 -0
- package/src/helpers/storage.js +54 -0
- package/src/modifiers/animations/animatedEffects.js +2 -0
- package/src/modifiers/animations/animatedEffects.native.js +3 -1
- package/src/modifiers/animations/fadeEffect.js +4 -2
- package/src/modifiers/animations/scaleEffect.js +45 -0
- package/src/modifiers/animations/scaleEffect.native.js +33 -0
- package/src/modifiers/animations/slideEffect.js +3 -1
- package/src/modifiers/background.js +16 -4
- package/src/modifiers/cursor.js +21 -0
- package/src/modifiers/display.js +2 -2
- package/src/modifiers/fullColor.js +2 -2
- package/src/modifiers/hover.js +28 -0
- package/src/modifiers/position.js +24 -3
- package/src/modifiers/size.js +2 -1
- package/src/modifiers/state.js +1 -1
- package/src/responsive/responsiveHooks.js +7 -0
- package/src/theme/ThemeHandler.js +18 -2
- package/src/theme/default/base.js +6 -6
- package/src/theme/default/blackTheme.js +35 -0
- package/src/theme/default/cyberpunkTheme.js +4 -1
- package/src/theme/default/darkTheme.js +4 -1
- package/src/theme/default/deepWoodsTheme.js +5 -2
- package/src/theme/default/forestTheme.js +4 -1
- package/src/theme/default/hackerTheme.js +4 -1
- package/src/theme/default/lightTheme.js +4 -1
- package/src/theme/default/midnightTheme.js +4 -1
- package/src/theme/default/msdosTheme.js +19 -4
- package/src/theme/default/oceanTheme.js +5 -2
- package/src/theme/default/paperTheme.js +35 -0
- package/src/theme/default/pastelTheme.js +5 -2
- package/src/theme/default/sunsetTheme.js +7 -4
- package/src/theme/default/themes.js +9 -10
- package/src/theme/format/formatTheme.js +9 -3
- package/src/theme/helpers/contrastColor.js +49 -11
- package/dist/abstractions/TouchableOpacity.web.js +0 -1
- package/dist/components/calendar/DayPicker.js +0 -1
- package/src/abstractions/TouchableOpacity.web.js +0 -3
- package/src/components/calendar/DayPicker.js +0 -94
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { pipe } from 'ramda'
|
|
2
|
+
|
|
3
|
+
import { AbsImageBackground } from '../../abstractions/ImageBackground'
|
|
4
|
+
import { useAnimationModifier } from '../../modifiers/animation'
|
|
5
|
+
import { useBackgroundModifier } from '../../modifiers/background'
|
|
6
|
+
import { useBorderModifier } from '../../modifiers/border'
|
|
7
|
+
import { useDisplayModifier } from '../../modifiers/display'
|
|
8
|
+
import { useFlexModifier } from '../../modifiers/flex'
|
|
9
|
+
import { useFlexWrapperModifier } from '../../modifiers/flexWrapper'
|
|
10
|
+
import { useMarginModifier } from '../../modifiers/margin'
|
|
11
|
+
import { useOverflowModifier } from '../../modifiers/overflow'
|
|
12
|
+
import { usePaddingModifier } from '../../modifiers/padding'
|
|
13
|
+
import { usePositionModifier } from '../../modifiers/position'
|
|
14
|
+
import { useShadowModifier } from '../../modifiers/shadow'
|
|
15
|
+
import { useSizeModifier } from '../../modifiers/size'
|
|
16
|
+
import { useStateModifier } from '../../modifiers/state'
|
|
17
|
+
import { useThemeComponentModifier } from '../../modifiers/themeComponent'
|
|
18
|
+
|
|
19
|
+
export function ImageBackground({ ...rootProps }) {
|
|
20
|
+
const [_, props] = pipe(
|
|
21
|
+
useThemeComponentModifier('ImageBackground'),
|
|
22
|
+
useFlexWrapperModifier,
|
|
23
|
+
useDisplayModifier,
|
|
24
|
+
useAnimationModifier,
|
|
25
|
+
useStateModifier,
|
|
26
|
+
useSizeModifier,
|
|
27
|
+
usePositionModifier,
|
|
28
|
+
useOverflowModifier,
|
|
29
|
+
usePaddingModifier,
|
|
30
|
+
useMarginModifier,
|
|
31
|
+
useFlexModifier,
|
|
32
|
+
useBackgroundModifier,
|
|
33
|
+
useBorderModifier,
|
|
34
|
+
useShadowModifier
|
|
35
|
+
)([{}, rootProps])
|
|
36
|
+
|
|
37
|
+
return <AbsImageBackground className="neko-image-background" {...props} />
|
|
38
|
+
}
|
|
@@ -44,8 +44,8 @@ export function Result({
|
|
|
44
44
|
|
|
45
45
|
return (
|
|
46
46
|
<View className="neko-result" center padding="lg" {...props}>
|
|
47
|
-
<Icon name={icon} color={iconColor} size={42} primary {...iconProps} />
|
|
48
|
-
<Divider height={10} />
|
|
47
|
+
{!!icon && <Icon name={icon} color={iconColor} size={42} primary {...iconProps} />}
|
|
48
|
+
{!!icon && <Divider height={10} />}
|
|
49
49
|
<Text h3 {...textProps} {...titleProps}>
|
|
50
50
|
{title}
|
|
51
51
|
</Text>
|
|
@@ -18,7 +18,16 @@ export function LoadingView({ active, children, size, color, replaceChildren, no
|
|
|
18
18
|
return (
|
|
19
19
|
<View className="neko-loading-view" relative {...props}>
|
|
20
20
|
{children}
|
|
21
|
-
<View
|
|
21
|
+
<View
|
|
22
|
+
className="neko-laoding-view-overlay"
|
|
23
|
+
bg="mainBG_op90"
|
|
24
|
+
absolute
|
|
25
|
+
top={0}
|
|
26
|
+
left={0}
|
|
27
|
+
right={0}
|
|
28
|
+
bottom={0}
|
|
29
|
+
center
|
|
30
|
+
>
|
|
22
31
|
{loader}
|
|
23
32
|
</View>
|
|
24
33
|
</View>
|
|
@@ -43,7 +43,7 @@ export function Accordion({ children, title, open, onChange, ...rootProps }) {
|
|
|
43
43
|
row
|
|
44
44
|
gap={moveScale(sizeCode, -2)}
|
|
45
45
|
borderB={open ? props.border || true : open}
|
|
46
|
-
borderColor={props.borderColor}
|
|
46
|
+
borderColor={props.borderColor || 'bg'}
|
|
47
47
|
centerV
|
|
48
48
|
{...headerProps}
|
|
49
49
|
onPress={toggle}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import tinycolor from 'tinycolor2'
|
|
2
|
+
import { pipe } from 'ramda'
|
|
3
|
+
|
|
4
|
+
import { AbsBlurView } from '../../abstractions/BlurView'
|
|
5
|
+
import { useAnimationModifier } from '../../modifiers/animation'
|
|
6
|
+
import { useBackgroundModifier } from '../../modifiers/background'
|
|
7
|
+
import { useBorderModifier } from '../../modifiers/border'
|
|
8
|
+
import { useColors } from '../../theme'
|
|
9
|
+
import { useDefaultModifier } from '../../modifiers/default'
|
|
10
|
+
import { useDisplayModifier } from '../../modifiers/display'
|
|
11
|
+
import { useFlexModifier } from '../../modifiers/flex'
|
|
12
|
+
import { useFlexWrapperModifier } from '../../modifiers/flexWrapper'
|
|
13
|
+
import { useMarginModifier } from '../../modifiers/margin'
|
|
14
|
+
import { useOverflowModifier } from '../../modifiers/overflow'
|
|
15
|
+
import { usePaddingModifier } from '../../modifiers/padding'
|
|
16
|
+
import { usePositionModifier } from '../../modifiers/position'
|
|
17
|
+
import { useShadowModifier } from '../../modifiers/shadow'
|
|
18
|
+
import { useSizeModifier } from '../../modifiers/size'
|
|
19
|
+
import { useStateModifier } from '../../modifiers/state'
|
|
20
|
+
import { useThemeComponentModifier } from '../../modifiers/themeComponent'
|
|
21
|
+
|
|
22
|
+
const DEFAULT_PROPS =
|
|
23
|
+
(colors) =>
|
|
24
|
+
([{}, {}]) => {
|
|
25
|
+
const isDark = tinycolor(colors?.overlayBG || colors?.bg).isDark()
|
|
26
|
+
|
|
27
|
+
return {
|
|
28
|
+
tint: isDark ? 'dark' : 'light',
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function BlurView({ children, ...rootProps }) {
|
|
33
|
+
const colors = useColors()
|
|
34
|
+
|
|
35
|
+
const [{}, props] = pipe(
|
|
36
|
+
useThemeComponentModifier('BlurView'),
|
|
37
|
+
useDefaultModifier(DEFAULT_PROPS(colors)),
|
|
38
|
+
useFlexWrapperModifier,
|
|
39
|
+
useDisplayModifier,
|
|
40
|
+
useAnimationModifier,
|
|
41
|
+
useStateModifier,
|
|
42
|
+
useSizeModifier,
|
|
43
|
+
usePositionModifier,
|
|
44
|
+
useOverflowModifier,
|
|
45
|
+
usePaddingModifier,
|
|
46
|
+
useMarginModifier,
|
|
47
|
+
useFlexModifier,
|
|
48
|
+
useBackgroundModifier,
|
|
49
|
+
useBorderModifier,
|
|
50
|
+
useShadowModifier
|
|
51
|
+
)([{}, rootProps])
|
|
52
|
+
|
|
53
|
+
return (
|
|
54
|
+
<AbsBlurView className="neko-blur-view" {...props}>
|
|
55
|
+
{children}
|
|
56
|
+
</AbsBlurView>
|
|
57
|
+
)
|
|
58
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { pipe } from 'ramda'
|
|
2
|
+
|
|
3
|
+
import { AbsGradientView } from '../../abstractions/GradientView'
|
|
4
|
+
import { useAnimationModifier } from '../../modifiers/animation'
|
|
5
|
+
import { useBackgroundModifier } from '../../modifiers/background'
|
|
6
|
+
import { useBorderModifier } from '../../modifiers/border'
|
|
7
|
+
import { useDisplayModifier } from '../../modifiers/display'
|
|
8
|
+
import { useFlexModifier } from '../../modifiers/flex'
|
|
9
|
+
import { useFlexWrapperModifier } from '../../modifiers/flexWrapper'
|
|
10
|
+
import { useMarginModifier } from '../../modifiers/margin'
|
|
11
|
+
import { useOverflowModifier } from '../../modifiers/overflow'
|
|
12
|
+
import { usePaddingModifier } from '../../modifiers/padding'
|
|
13
|
+
import { usePositionModifier } from '../../modifiers/position'
|
|
14
|
+
import { useShadowModifier } from '../../modifiers/shadow'
|
|
15
|
+
import { useSizeModifier } from '../../modifiers/size'
|
|
16
|
+
import { useStateModifier } from '../../modifiers/state'
|
|
17
|
+
import { useThemeComponentModifier } from '../../modifiers/themeComponent'
|
|
18
|
+
|
|
19
|
+
export function GradientView({ children, ...rootProps }) {
|
|
20
|
+
const [{ gradientColors }, props] = pipe(
|
|
21
|
+
useThemeComponentModifier('GradientView'),
|
|
22
|
+
useFlexWrapperModifier,
|
|
23
|
+
useDisplayModifier,
|
|
24
|
+
useAnimationModifier,
|
|
25
|
+
useStateModifier,
|
|
26
|
+
useSizeModifier,
|
|
27
|
+
usePositionModifier,
|
|
28
|
+
useOverflowModifier,
|
|
29
|
+
usePaddingModifier,
|
|
30
|
+
useMarginModifier,
|
|
31
|
+
useFlexModifier,
|
|
32
|
+
useBackgroundModifier,
|
|
33
|
+
useBorderModifier,
|
|
34
|
+
useShadowModifier
|
|
35
|
+
)([{}, rootProps])
|
|
36
|
+
|
|
37
|
+
return (
|
|
38
|
+
<AbsGradientView className="neko-gradient-view" colors={gradientColors} {...props}>
|
|
39
|
+
{children}
|
|
40
|
+
</AbsGradientView>
|
|
41
|
+
)
|
|
42
|
+
}
|
|
@@ -4,6 +4,7 @@ import { AbsView } from '../../abstractions/View'
|
|
|
4
4
|
import { useAnimationModifier } from '../../modifiers/animation'
|
|
5
5
|
import { useBackgroundModifier } from '../../modifiers/background'
|
|
6
6
|
import { useBorderModifier } from '../../modifiers/border'
|
|
7
|
+
import { useCursorModifier } from '../../modifiers/cursor'
|
|
7
8
|
import { useDisplayModifier } from '../../modifiers/display'
|
|
8
9
|
import { useFlexModifier } from '../../modifiers/flex'
|
|
9
10
|
import { useFlexWrapperModifier } from '../../modifiers/flexWrapper'
|
|
@@ -21,6 +22,7 @@ export function View({ children, ...rootProps }) {
|
|
|
21
22
|
useThemeComponentModifier('View'),
|
|
22
23
|
useFlexWrapperModifier,
|
|
23
24
|
useDisplayModifier,
|
|
25
|
+
useCursorModifier,
|
|
24
26
|
useAnimationModifier,
|
|
25
27
|
useStateModifier,
|
|
26
28
|
useSizeModifier,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { BottomDrawer } from './web/BottomDrawer'
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
import { GestureDetector, Gesture, GestureHandlerRootView } from 'react-native-gesture-handler'
|
|
2
|
+
import { Modal, Dimensions, StyleSheet, BackHandler, Platform } from 'react-native'
|
|
3
|
+
import { useSafeAreaInsets } from 'react-native-safe-area-context'
|
|
4
|
+
import Animated, {
|
|
5
|
+
useSharedValue,
|
|
6
|
+
useAnimatedStyle,
|
|
7
|
+
withSpring,
|
|
8
|
+
runOnJS,
|
|
9
|
+
useAnimatedReaction,
|
|
10
|
+
} from 'react-native-reanimated'
|
|
11
|
+
import React from 'react'
|
|
12
|
+
|
|
13
|
+
import { DrawerHandle } from './DrawerHandle'
|
|
14
|
+
import { DrawerProvider } from './DrawerContext'
|
|
15
|
+
import { Pressable } from '../../../actions/Pressable'
|
|
16
|
+
import { View } from '../../View'
|
|
17
|
+
import { normalizeSnapPoints, findClosestSnapPoint } from './utils'
|
|
18
|
+
import { useColors } from '../../../../theme/ThemeHandler'
|
|
19
|
+
|
|
20
|
+
function InnerContent({
|
|
21
|
+
children,
|
|
22
|
+
render,
|
|
23
|
+
setRender,
|
|
24
|
+
open,
|
|
25
|
+
onClose,
|
|
26
|
+
snapPoints = ['50%'],
|
|
27
|
+
useSafeArea = true,
|
|
28
|
+
enableOverScroll = true,
|
|
29
|
+
enableHandlePanningGesture = true,
|
|
30
|
+
enableContentPanningGesture = true,
|
|
31
|
+
animationConfig = {
|
|
32
|
+
damping: 50,
|
|
33
|
+
stiffness: 500,
|
|
34
|
+
mass: 0.3,
|
|
35
|
+
overshootClamping: true,
|
|
36
|
+
restDisplacementThreshold: 10,
|
|
37
|
+
restSpeedThreshold: 10,
|
|
38
|
+
},
|
|
39
|
+
hideHandle,
|
|
40
|
+
contentProps,
|
|
41
|
+
...props
|
|
42
|
+
}) {
|
|
43
|
+
const { height: SCREEN_HEIGHT } = Dimensions.get('window')
|
|
44
|
+
const insets = useSafeAreaInsets()
|
|
45
|
+
const bottomInset = useSafeArea ? insets.bottom : 0
|
|
46
|
+
|
|
47
|
+
const colors = useColors()
|
|
48
|
+
|
|
49
|
+
const translateY = useSharedValue(SCREEN_HEIGHT)
|
|
50
|
+
const scrollOffset = useSharedValue(0)
|
|
51
|
+
const scrollEnabled = useSharedValue(false)
|
|
52
|
+
const isScrolling = useSharedValue(false)
|
|
53
|
+
const snapIndex = useSharedValue(0)
|
|
54
|
+
const velocityY = useSharedValue(0)
|
|
55
|
+
|
|
56
|
+
const normalizedSnapPoints = React.useMemo(() => normalizeSnapPoints(snapPoints, SCREEN_HEIGHT), [snapPoints])
|
|
57
|
+
const maxSnapPoint = React.useMemo(() => Math.max(...normalizedSnapPoints), [normalizedSnapPoints])
|
|
58
|
+
const minSnapPoint = React.useMemo(() => Math.min(...normalizedSnapPoints), [normalizedSnapPoints])
|
|
59
|
+
|
|
60
|
+
React.useEffect(() => {
|
|
61
|
+
if (open) {
|
|
62
|
+
const targetY = SCREEN_HEIGHT - normalizedSnapPoints[0]
|
|
63
|
+
translateY.value = withSpring(targetY, animationConfig)
|
|
64
|
+
snapIndex.value = 0
|
|
65
|
+
} else {
|
|
66
|
+
translateY.value = withSpring(SCREEN_HEIGHT, animationConfig, () => {
|
|
67
|
+
scrollOffset.value = 0
|
|
68
|
+
scrollEnabled.value = false
|
|
69
|
+
runOnJS(setRender)(false)
|
|
70
|
+
})
|
|
71
|
+
snapIndex.value = -1
|
|
72
|
+
}
|
|
73
|
+
}, [open])
|
|
74
|
+
|
|
75
|
+
React.useEffect(() => {
|
|
76
|
+
if (!onClose || !open || Platform.OS !== 'android') return
|
|
77
|
+
const backHandler = BackHandler.addEventListener('hardwareBackPress', () => {
|
|
78
|
+
onClose()
|
|
79
|
+
return true
|
|
80
|
+
})
|
|
81
|
+
return () => backHandler.remove()
|
|
82
|
+
}, [open, onClose])
|
|
83
|
+
|
|
84
|
+
useAnimatedReaction(
|
|
85
|
+
() => translateY.value,
|
|
86
|
+
(currentY) => {
|
|
87
|
+
const atMaxSnapPoint = currentY <= SCREEN_HEIGHT - maxSnapPoint
|
|
88
|
+
scrollEnabled.value = atMaxSnapPoint
|
|
89
|
+
},
|
|
90
|
+
[]
|
|
91
|
+
)
|
|
92
|
+
|
|
93
|
+
let handleClose = React.useCallback(() => {
|
|
94
|
+
onClose?.()
|
|
95
|
+
}, [onClose])
|
|
96
|
+
if (!onClose) handleClose = false
|
|
97
|
+
|
|
98
|
+
const snapTo = React.useCallback(
|
|
99
|
+
(index) => {
|
|
100
|
+
'worklet'
|
|
101
|
+
const snapPoint = normalizedSnapPoints[index]
|
|
102
|
+
if (snapPoint !== undefined) {
|
|
103
|
+
translateY.value = withSpring(SCREEN_HEIGHT - snapPoint, animationConfig)
|
|
104
|
+
snapIndex.value = index
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
[normalizedSnapPoints]
|
|
108
|
+
)
|
|
109
|
+
|
|
110
|
+
// contexto manual para gesto
|
|
111
|
+
const gestureStartTranslateY = useSharedValue(0)
|
|
112
|
+
|
|
113
|
+
const panGesture = React.useMemo(() => {
|
|
114
|
+
return Gesture.Pan()
|
|
115
|
+
.enabled(enableHandlePanningGesture || enableContentPanningGesture)
|
|
116
|
+
.onStart(() => {
|
|
117
|
+
gestureStartTranslateY.value = translateY.value
|
|
118
|
+
})
|
|
119
|
+
.onUpdate((event) => {
|
|
120
|
+
const newTranslateY = gestureStartTranslateY.value + event.translationY
|
|
121
|
+
const maxPosition = SCREEN_HEIGHT - maxSnapPoint
|
|
122
|
+
|
|
123
|
+
if (enableOverScroll && newTranslateY >= maxPosition) {
|
|
124
|
+
translateY.value = newTranslateY
|
|
125
|
+
} else {
|
|
126
|
+
translateY.value = Math.max(maxPosition, Math.min(SCREEN_HEIGHT, newTranslateY))
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
velocityY.value = event.velocityY
|
|
130
|
+
})
|
|
131
|
+
.onEnd(() => {
|
|
132
|
+
const currentPosition = SCREEN_HEIGHT - translateY.value
|
|
133
|
+
const shouldClose =
|
|
134
|
+
!!handleClose &&
|
|
135
|
+
((velocityY.value > 2000 && currentPosition < minSnapPoint * 0.75) || currentPosition < minSnapPoint * 0.25)
|
|
136
|
+
|
|
137
|
+
if (shouldClose) {
|
|
138
|
+
runOnJS(handleClose)()
|
|
139
|
+
} else {
|
|
140
|
+
const closestSnapIndex = findClosestSnapPoint(currentPosition, normalizedSnapPoints, velocityY.value)
|
|
141
|
+
const targetSnapPoint = normalizedSnapPoints[closestSnapIndex]
|
|
142
|
+
translateY.value = withSpring(SCREEN_HEIGHT - targetSnapPoint, animationConfig)
|
|
143
|
+
snapIndex.value = closestSnapIndex
|
|
144
|
+
}
|
|
145
|
+
})
|
|
146
|
+
}, [
|
|
147
|
+
enableHandlePanningGesture,
|
|
148
|
+
enableContentPanningGesture,
|
|
149
|
+
enableOverScroll,
|
|
150
|
+
maxSnapPoint,
|
|
151
|
+
minSnapPoint,
|
|
152
|
+
normalizedSnapPoints,
|
|
153
|
+
animationConfig,
|
|
154
|
+
handleClose,
|
|
155
|
+
])
|
|
156
|
+
|
|
157
|
+
const animatedSheetStyle = useAnimatedStyle(() => {
|
|
158
|
+
const currentHeight = SCREEN_HEIGHT - translateY.value
|
|
159
|
+
return {
|
|
160
|
+
transform: [{ translateY: translateY.value }],
|
|
161
|
+
maxHeight: currentHeight,
|
|
162
|
+
}
|
|
163
|
+
})
|
|
164
|
+
|
|
165
|
+
const contextValue = React.useMemo(
|
|
166
|
+
() => ({
|
|
167
|
+
translateY,
|
|
168
|
+
scrollOffset,
|
|
169
|
+
scrollEnabled,
|
|
170
|
+
isScrolling,
|
|
171
|
+
snapIndex,
|
|
172
|
+
maxSnapPoint,
|
|
173
|
+
snapTo,
|
|
174
|
+
animationConfig,
|
|
175
|
+
}),
|
|
176
|
+
[maxSnapPoint]
|
|
177
|
+
)
|
|
178
|
+
|
|
179
|
+
return (
|
|
180
|
+
<GestureHandlerRootView style={{ flex: 1 }}>
|
|
181
|
+
<Pressable
|
|
182
|
+
absoluteFill
|
|
183
|
+
bg="backdrop_op70"
|
|
184
|
+
onPress={() => {
|
|
185
|
+
if (!handleClose) return
|
|
186
|
+
runOnJS(handleClose)()
|
|
187
|
+
}}
|
|
188
|
+
/>
|
|
189
|
+
|
|
190
|
+
<DrawerProvider value={contextValue}>
|
|
191
|
+
<GestureDetector gesture={panGesture}>
|
|
192
|
+
<Animated.View
|
|
193
|
+
style={[styles.container, { height: SCREEN_HEIGHT }, animatedSheetStyle]}
|
|
194
|
+
pointerEvents="box-none"
|
|
195
|
+
>
|
|
196
|
+
<View
|
|
197
|
+
flex
|
|
198
|
+
bg="overlayBG"
|
|
199
|
+
shadow
|
|
200
|
+
paddingB={useSafeArea && bottomInset}
|
|
201
|
+
borderRadiusT="xxxl"
|
|
202
|
+
marginL="auto"
|
|
203
|
+
marginR="auto"
|
|
204
|
+
fullW
|
|
205
|
+
{...props}
|
|
206
|
+
>
|
|
207
|
+
<DrawerHandle hide={hideHandle} />
|
|
208
|
+
<View flex {...contentProps}>
|
|
209
|
+
{children}
|
|
210
|
+
</View>
|
|
211
|
+
</View>
|
|
212
|
+
</Animated.View>
|
|
213
|
+
</GestureDetector>
|
|
214
|
+
</DrawerProvider>
|
|
215
|
+
</GestureHandlerRootView>
|
|
216
|
+
)
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
const styles = StyleSheet.create({
|
|
220
|
+
container: {
|
|
221
|
+
position: 'absolute',
|
|
222
|
+
left: 0,
|
|
223
|
+
right: 0,
|
|
224
|
+
top: 0,
|
|
225
|
+
},
|
|
226
|
+
})
|
|
227
|
+
|
|
228
|
+
export function BottomDrawer({ open, ...props }) {
|
|
229
|
+
const [render, setRender] = React.useState(open)
|
|
230
|
+
|
|
231
|
+
React.useEffect(() => {
|
|
232
|
+
if (open) {
|
|
233
|
+
setRender(true)
|
|
234
|
+
}
|
|
235
|
+
}, [open])
|
|
236
|
+
|
|
237
|
+
return (
|
|
238
|
+
<Modal visible={render} transparent statusBarTranslucent navigationBarTranslucent animationType="none">
|
|
239
|
+
<InnerContent {...props} open={open} render={render} setRender={setRender} />
|
|
240
|
+
</Modal>
|
|
241
|
+
)
|
|
242
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
const DrawerContext = React.createContext(null);
|
|
4
|
+
|
|
5
|
+
export function DrawerProvider({ children, value }) {
|
|
6
|
+
return (
|
|
7
|
+
<DrawerContext.Provider value={value}>
|
|
8
|
+
{children}
|
|
9
|
+
</DrawerContext.Provider>
|
|
10
|
+
);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function useDrawerContext() {
|
|
14
|
+
const context = React.useContext(DrawerContext);
|
|
15
|
+
|
|
16
|
+
if (!context) {
|
|
17
|
+
throw new Error('useDrawerContext must be used within a DrawerProvider');
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return context;
|
|
21
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Divider } from '../../../helpers/Separator'
|
|
2
|
+
import { View } from '../../View'
|
|
3
|
+
|
|
4
|
+
export function DrawerHandle({ hide }) {
|
|
5
|
+
if (!!hide) return false
|
|
6
|
+
|
|
7
|
+
return (
|
|
8
|
+
<View center padding="sm">
|
|
9
|
+
<Divider maxWidth={35} line={4} color="text4_op30" height={4} />
|
|
10
|
+
</View>
|
|
11
|
+
)
|
|
12
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { ScrollView } from 'react-native'
|
|
3
|
+
import Animated, { useAnimatedScrollHandler, useAnimatedReaction, runOnJS } from 'react-native-reanimated'
|
|
4
|
+
import { useDrawerContext } from './DrawerContext'
|
|
5
|
+
|
|
6
|
+
const AnimatedScrollView = Animated.createAnimatedComponent(ScrollView)
|
|
7
|
+
|
|
8
|
+
export const DrawerScrollView = React.forwardRef((props, ref) => {
|
|
9
|
+
const {
|
|
10
|
+
children,
|
|
11
|
+
onScroll,
|
|
12
|
+
scrollEventThrottle = 16,
|
|
13
|
+
showsVerticalScrollIndicator = true,
|
|
14
|
+
bounces = true,
|
|
15
|
+
...scrollViewProps
|
|
16
|
+
} = props
|
|
17
|
+
|
|
18
|
+
const { scrollOffset, scrollEnabled, isScrolling } = useDrawerContext()
|
|
19
|
+
|
|
20
|
+
const scrollRef = React.useRef(null)
|
|
21
|
+
|
|
22
|
+
// Convert shared value to React state for the component
|
|
23
|
+
const [isScrollEnabled, setIsScrollEnabled] = React.useState(true)
|
|
24
|
+
|
|
25
|
+
React.useImperativeHandle(ref, () => scrollRef.current)
|
|
26
|
+
|
|
27
|
+
// Handle scroll lock/unlock based on drawer position
|
|
28
|
+
useAnimatedReaction(
|
|
29
|
+
() => scrollEnabled.value,
|
|
30
|
+
(enabled) => {
|
|
31
|
+
if (!enabled && scrollOffset.value > 0) {
|
|
32
|
+
runOnJS(() => {
|
|
33
|
+
scrollRef.current?.scrollTo({ y: 0, animated: false })
|
|
34
|
+
})()
|
|
35
|
+
scrollOffset.value = 0
|
|
36
|
+
}
|
|
37
|
+
// Update React state
|
|
38
|
+
runOnJS(setIsScrollEnabled)(enabled)
|
|
39
|
+
},
|
|
40
|
+
[]
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
const handleScrollBeginDrag = React.useCallback(() => {
|
|
44
|
+
isScrolling.value = true
|
|
45
|
+
}, [isScrolling])
|
|
46
|
+
|
|
47
|
+
const handleScrollEndDrag = React.useCallback(() => {
|
|
48
|
+
isScrolling.value = false
|
|
49
|
+
}, [isScrolling])
|
|
50
|
+
|
|
51
|
+
const animatedScrollHandler = useAnimatedScrollHandler({
|
|
52
|
+
onScroll: (event) => {
|
|
53
|
+
scrollOffset.value = event.contentOffset.y
|
|
54
|
+
|
|
55
|
+
if (onScroll) {
|
|
56
|
+
runOnJS(onScroll)(event)
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
onBeginDrag: () => {
|
|
60
|
+
runOnJS(handleScrollBeginDrag)()
|
|
61
|
+
},
|
|
62
|
+
onEndDrag: () => {
|
|
63
|
+
runOnJS(handleScrollEndDrag)()
|
|
64
|
+
},
|
|
65
|
+
})
|
|
66
|
+
|
|
67
|
+
return (
|
|
68
|
+
<AnimatedScrollView
|
|
69
|
+
ref={scrollRef}
|
|
70
|
+
style={{ flex: 1 }}
|
|
71
|
+
scrollEnabled={isScrollEnabled}
|
|
72
|
+
onScroll={animatedScrollHandler}
|
|
73
|
+
scrollEventThrottle={scrollEventThrottle}
|
|
74
|
+
showsVerticalScrollIndicator={showsVerticalScrollIndicator}
|
|
75
|
+
bounces={bounces}
|
|
76
|
+
{...scrollViewProps}
|
|
77
|
+
>
|
|
78
|
+
{children}
|
|
79
|
+
</AnimatedScrollView>
|
|
80
|
+
)
|
|
81
|
+
})
|
|
82
|
+
|
|
83
|
+
DrawerScrollView.displayName = 'DrawerScrollView'
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
export function normalizeSnapPoints(snapPoints, screenHeight) {
|
|
2
|
+
return snapPoints.map((point) => {
|
|
3
|
+
if (typeof point === 'string' && point.endsWith('%')) {
|
|
4
|
+
const percentage = parseFloat(point) / 100;
|
|
5
|
+
return screenHeight * percentage;
|
|
6
|
+
}
|
|
7
|
+
return point;
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function findClosestSnapPoint(currentPosition, snapPoints, velocity = 0) {
|
|
12
|
+
'worklet';
|
|
13
|
+
// Reduced velocity impact for more stable snapping
|
|
14
|
+
const velocityImpact = velocity * 0.03;
|
|
15
|
+
const adjustedPosition = currentPosition + velocityImpact;
|
|
16
|
+
|
|
17
|
+
let closestIndex = 0;
|
|
18
|
+
let minDistance = Math.abs(snapPoints[0] - adjustedPosition);
|
|
19
|
+
|
|
20
|
+
for (let i = 1; i < snapPoints.length; i++) {
|
|
21
|
+
const distance = Math.abs(snapPoints[i] - adjustedPosition);
|
|
22
|
+
if (distance < minDistance) {
|
|
23
|
+
minDistance = distance;
|
|
24
|
+
closestIndex = i;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// Increased velocity thresholds for more resistance
|
|
29
|
+
// Only change snap points with strong swipe gestures
|
|
30
|
+
|
|
31
|
+
// Bias towards opening more when swiping up very fast
|
|
32
|
+
if (velocity < -1500 && closestIndex < snapPoints.length - 1) {
|
|
33
|
+
closestIndex++;
|
|
34
|
+
}
|
|
35
|
+
// Bias towards closing when swiping down very fast
|
|
36
|
+
else if (velocity > 1500 && closestIndex > 0) {
|
|
37
|
+
closestIndex--;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// Add hysteresis: prefer staying at current position unless moved significantly
|
|
41
|
+
// This prevents accidental snap point changes
|
|
42
|
+
if (snapPoints.length > 1) {
|
|
43
|
+
const currentSnapDistance = minDistance;
|
|
44
|
+
// Require at least 20% of the distance between snap points to change
|
|
45
|
+
const snapPointSpacing = Math.abs(snapPoints[Math.min(closestIndex + 1, snapPoints.length - 1)] - snapPoints[closestIndex]);
|
|
46
|
+
if (currentSnapDistance < snapPointSpacing * 0.2) {
|
|
47
|
+
// Stay at current snap point unless moved significantly
|
|
48
|
+
return closestIndex;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return closestIndex;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export function clamp(value, min, max) {
|
|
56
|
+
'worklet';
|
|
57
|
+
return Math.min(Math.max(value, min), max);
|
|
58
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Drawer'
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
export * from './Accordion'
|
|
2
2
|
export * from './AccordionGroup'
|
|
3
3
|
export * from './View'
|
|
4
|
+
export * from './GradientView'
|
|
5
|
+
export * from './BlurView'
|
|
4
6
|
export * from './SafeAreaView'
|
|
5
7
|
export * from './Card'
|
|
6
8
|
export * from './Row'
|
|
7
9
|
export * from './Col'
|
|
10
|
+
export * from './modal'
|
|
11
|
+
export * from './drawer'
|
|
12
|
+
export * from './bottomDrawer'
|
|
8
13
|
export * from './popover/Popover'
|