@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.
Files changed (274) hide show
  1. package/dist/NekoUI.js +1 -1
  2. package/dist/abstractions/ActivityIndicator.native.js +1 -1
  3. package/dist/abstractions/ActivityIndicator.web.js +1 -0
  4. package/dist/abstractions/AnimatedView.js +1 -1
  5. package/dist/abstractions/BlurView.js +1 -0
  6. package/dist/abstractions/BlurView.native.js +1 -0
  7. package/dist/abstractions/BlurView.web.js +1 -0
  8. package/dist/abstractions/FlatList.js +1 -0
  9. package/dist/abstractions/FlatList.native.js +1 -0
  10. package/dist/abstractions/FlatList.web.js +1 -0
  11. package/dist/abstractions/GradientView.js +1 -0
  12. package/dist/abstractions/GradientView.native.js +1 -0
  13. package/dist/abstractions/Icon.native.js +1 -1
  14. package/dist/abstractions/ImageBackground.js +1 -0
  15. package/dist/abstractions/ImageBackground.native.js +1 -0
  16. package/dist/abstractions/ImageBackground.web.js +1 -0
  17. package/dist/abstractions/Pressable.js +1 -0
  18. package/dist/abstractions/Pressable.native.js +1 -0
  19. package/dist/abstractions/Pressable.web.js +1 -0
  20. package/dist/abstractions/ScrollView.js +1 -0
  21. package/dist/abstractions/ScrollView.native.js +1 -0
  22. package/dist/abstractions/ScrollView.web.js +1 -0
  23. package/dist/abstractions/TextInput.js +1 -1
  24. package/dist/abstractions/helpers/storage.js +1 -0
  25. package/dist/abstractions/helpers/storage.native.js +1 -0
  26. package/dist/components/actions/Button.js +1 -1
  27. package/dist/components/actions/Dropdown.js +1 -1
  28. package/dist/components/actions/Link.js +1 -1
  29. package/dist/components/actions/Pressable.js +1 -0
  30. package/dist/components/actions/index.js +1 -1
  31. package/dist/components/actions/menu/HorizontalMenu.js +1 -1
  32. package/dist/components/actions/menu/VerticalMenu.js +1 -1
  33. package/dist/components/animations/ReanimatedView.js +1 -0
  34. package/dist/components/calendar/CalendarNav.js +1 -0
  35. package/dist/components/calendar/WeekDaysBar.js +1 -0
  36. package/dist/components/calendar/_helpers/calendarDays.js +1 -1
  37. package/dist/components/calendar/_helpers/dateDisabled.js +1 -0
  38. package/dist/components/calendar/index.js +0 -1
  39. package/dist/components/feedback/alerter.js +1 -0
  40. package/dist/components/feedback/confirmer.js +1 -0
  41. package/dist/components/feedback/index.js +1 -1
  42. package/dist/components/feedback/notifications/Notification.js +1 -1
  43. package/dist/components/feedback/notifications/NotificationsHandler.js +1 -1
  44. package/dist/components/index.js +1 -1
  45. package/dist/components/inputs/DateInput.js +1 -0
  46. package/dist/components/inputs/InputWrapper.js +1 -1
  47. package/dist/components/inputs/LinkInput.js +1 -0
  48. package/dist/components/inputs/MaskInput.js +1 -0
  49. package/dist/components/inputs/TextInput.js +1 -1
  50. package/dist/components/inputs/_DateInput.native.js +1 -0
  51. package/dist/components/inputs/datePicker/DatePicker.js +1 -0
  52. package/dist/components/inputs/datePicker/DayPicker.js +1 -0
  53. package/dist/components/inputs/datePicker/MonthPicker.js +1 -0
  54. package/dist/components/inputs/datePicker/QuarterPicker.js +1 -0
  55. package/dist/components/inputs/datePicker/WeekPicker.js +1 -0
  56. package/dist/components/inputs/datePicker/YearPicker.js +1 -0
  57. package/dist/components/inputs/index.js +1 -1
  58. package/dist/components/layout/Layout.js +1 -1
  59. package/dist/components/list/FlatList.js +1 -0
  60. package/dist/components/list/ScrollView.js +1 -0
  61. package/dist/components/list/index.js +1 -0
  62. package/dist/components/presentation/ImageBackground.js +1 -0
  63. package/dist/components/presentation/Result.js +1 -1
  64. package/dist/components/presentation/index.js +1 -1
  65. package/dist/components/state/LoadingView.js +1 -1
  66. package/dist/components/structure/Accordion.js +1 -1
  67. package/dist/components/structure/BlurView.js +1 -0
  68. package/dist/components/structure/GradientView.js +1 -0
  69. package/dist/components/structure/View.js +1 -1
  70. package/dist/components/structure/bottomDrawer/index.js +1 -0
  71. package/dist/components/structure/bottomDrawer/index.native.js +1 -0
  72. package/dist/components/structure/bottomDrawer/index.web.js +1 -0
  73. package/dist/components/structure/bottomDrawer/native/BottomDrawer.js +1 -0
  74. package/dist/components/structure/bottomDrawer/native/DrawerContext.js +1 -0
  75. package/dist/components/structure/bottomDrawer/native/DrawerHandle.js +1 -0
  76. package/dist/components/structure/bottomDrawer/native/DrawerScrollView.js +1 -0
  77. package/dist/components/structure/bottomDrawer/native/utils.js +1 -0
  78. package/dist/components/structure/bottomDrawer/web/BottomDrawer.js +1 -0
  79. package/dist/components/structure/drawer/Drawer.js +1 -0
  80. package/dist/components/structure/drawer/Drawer.native.js +1 -0
  81. package/dist/components/structure/drawer/index.js +1 -0
  82. package/dist/components/structure/index.js +1 -1
  83. package/dist/components/structure/modal/Modal.js +1 -0
  84. package/dist/components/structure/modal/Modal.native.js +1 -0
  85. package/dist/components/structure/modal/ModalBackdrop.js +1 -0
  86. package/dist/components/structure/modal/ModalContent.js +1 -0
  87. package/dist/components/structure/modal/ModalFooter.js +1 -0
  88. package/dist/components/structure/modal/ModalHeader.js +1 -0
  89. package/dist/components/structure/modal/handler/ModalsHandler.js +1 -0
  90. package/dist/components/structure/modal/index.js +1 -0
  91. package/dist/components/structure/overlay/OverlayWrapper.js +1 -1
  92. package/dist/components/structure/popover/Popover.js +1 -1
  93. package/dist/components/structure/popover/Popover.native.js +1 -1
  94. package/dist/components/theme/ThemePicker.js +1 -0
  95. package/dist/components/theme/ThemePickerDrawer.js +1 -0
  96. package/dist/components/theme/ThemeStatusBar.js +1 -0
  97. package/dist/components/theme/ThemeStatusBar.native.js +1 -0
  98. package/dist/components/theme/ThemeThumb.js +1 -0
  99. package/dist/components/theme/index.js +1 -0
  100. package/dist/helpers/index.js +1 -1
  101. package/dist/helpers/storage.js +1 -0
  102. package/dist/modifiers/animations/animatedEffects.js +1 -1
  103. package/dist/modifiers/animations/animatedEffects.native.js +1 -1
  104. package/dist/modifiers/animations/fadeEffect.js +1 -1
  105. package/dist/modifiers/animations/scaleEffect.js +1 -0
  106. package/dist/modifiers/animations/scaleEffect.native.js +1 -0
  107. package/dist/modifiers/animations/slideEffect.js +1 -1
  108. package/dist/modifiers/background.js +1 -1
  109. package/dist/modifiers/cursor.js +1 -0
  110. package/dist/modifiers/display.js +1 -1
  111. package/dist/modifiers/fullColor.js +1 -1
  112. package/dist/modifiers/hover.js +1 -0
  113. package/dist/modifiers/position.js +1 -1
  114. package/dist/modifiers/size.js +1 -1
  115. package/dist/modifiers/state.js +1 -1
  116. package/dist/responsive/responsiveHooks.js +1 -1
  117. package/dist/theme/ThemeHandler.js +1 -1
  118. package/dist/theme/default/base.js +1 -1
  119. package/dist/theme/default/blackTheme.js +1 -0
  120. package/dist/theme/default/cyberpunkTheme.js +1 -1
  121. package/dist/theme/default/darkTheme.js +1 -1
  122. package/dist/theme/default/deepWoodsTheme.js +1 -1
  123. package/dist/theme/default/forestTheme.js +1 -1
  124. package/dist/theme/default/hackerTheme.js +1 -1
  125. package/dist/theme/default/lightTheme.js +1 -1
  126. package/dist/theme/default/midnightTheme.js +1 -1
  127. package/dist/theme/default/msdosTheme.js +1 -1
  128. package/dist/theme/default/oceanTheme.js +1 -1
  129. package/dist/theme/default/paperTheme.js +1 -0
  130. package/dist/theme/default/pastelTheme.js +1 -1
  131. package/dist/theme/default/sunsetTheme.js +1 -1
  132. package/dist/theme/default/themes.js +1 -1
  133. package/dist/theme/format/formatTheme.js +1 -1
  134. package/dist/theme/helpers/contrastColor.js +1 -1
  135. package/package.json +8 -3
  136. package/src/NekoUI.js +18 -3
  137. package/src/abstractions/ActivityIndicator.native.js +3 -4
  138. package/src/abstractions/ActivityIndicator.web.js +43 -0
  139. package/src/abstractions/AnimatedView.js +3 -3
  140. package/src/abstractions/BlurView.js +43 -0
  141. package/src/abstractions/BlurView.native.js +39 -0
  142. package/src/abstractions/BlurView.web.js +39 -0
  143. package/src/abstractions/FlatList.js +39 -0
  144. package/src/abstractions/FlatList.native.js +32 -0
  145. package/src/abstractions/FlatList.web.js +3 -0
  146. package/src/abstractions/GradientView.js +5 -0
  147. package/src/abstractions/GradientView.native.js +32 -0
  148. package/src/abstractions/Icon.native.js +4 -2
  149. package/src/abstractions/ImageBackground.js +17 -0
  150. package/src/abstractions/ImageBackground.native.js +27 -0
  151. package/src/abstractions/ImageBackground.web.js +7 -0
  152. package/src/abstractions/Pressable.js +4 -0
  153. package/src/abstractions/Pressable.native.js +3 -0
  154. package/src/abstractions/Pressable.web.js +3 -0
  155. package/src/abstractions/ScrollView.js +3 -0
  156. package/src/abstractions/ScrollView.native.js +5 -0
  157. package/src/abstractions/ScrollView.web.js +3 -0
  158. package/src/abstractions/Text.web.js +15 -0
  159. package/src/abstractions/TextInput.js +2 -2
  160. package/src/abstractions/helpers/storage.js +32 -0
  161. package/src/abstractions/helpers/storage.native.js +34 -0
  162. package/src/components/actions/Button.js +8 -0
  163. package/src/components/actions/Dropdown.js +18 -2
  164. package/src/components/actions/Link.js +16 -2
  165. package/src/components/actions/Pressable.js +38 -0
  166. package/src/components/actions/index.js +1 -0
  167. package/src/components/actions/menu/HorizontalMenu.js +2 -1
  168. package/src/components/actions/menu/VerticalMenu.js +5 -4
  169. package/src/components/animations/ReanimatedView.js +40 -0
  170. package/src/components/calendar/CalendarNav.js +67 -0
  171. package/src/components/calendar/WeekDaysBar.js +18 -0
  172. package/src/components/calendar/_helpers/calendarDays.js +1 -3
  173. package/src/components/calendar/_helpers/dateDisabled.js +24 -0
  174. package/src/components/calendar/index.js +1 -1
  175. package/src/components/feedback/alerter.js +31 -0
  176. package/src/components/feedback/confirmer.js +70 -0
  177. package/src/components/feedback/index.js +2 -0
  178. package/src/components/feedback/notifications/Notification.js +1 -1
  179. package/src/components/feedback/notifications/NotificationsHandler.js +3 -3
  180. package/src/components/index.js +2 -0
  181. package/src/components/inputs/DateInput.js +111 -0
  182. package/src/components/inputs/InputWrapper.js +18 -6
  183. package/src/components/inputs/LinkInput.js +17 -0
  184. package/src/components/inputs/MaskInput.js +67 -0
  185. package/src/components/inputs/TextInput.js +2 -2
  186. package/src/components/inputs/_DateInput.native.js +89 -0
  187. package/src/components/inputs/datePicker/DatePicker.js +24 -0
  188. package/src/components/inputs/datePicker/DayPicker.js +65 -0
  189. package/src/components/inputs/datePicker/MonthPicker.js +62 -0
  190. package/src/components/inputs/datePicker/QuarterPicker.js +65 -0
  191. package/src/components/inputs/datePicker/WeekPicker.js +74 -0
  192. package/src/components/inputs/datePicker/YearPicker.js +67 -0
  193. package/src/components/inputs/index.js +4 -0
  194. package/src/components/layout/Layout.js +1 -1
  195. package/src/components/list/FlatList.js +54 -0
  196. package/src/components/list/ScrollView.js +58 -0
  197. package/src/components/list/index.js +2 -0
  198. package/src/components/presentation/ImageBackground.js +38 -0
  199. package/src/components/presentation/Result.js +2 -2
  200. package/src/components/presentation/index.js +1 -0
  201. package/src/components/state/LoadingView.js +10 -1
  202. package/src/components/structure/Accordion.js +1 -1
  203. package/src/components/structure/BlurView.js +58 -0
  204. package/src/components/structure/GradientView.js +42 -0
  205. package/src/components/structure/View.js +2 -0
  206. package/src/components/structure/bottomDrawer/index.js +1 -0
  207. package/src/components/structure/bottomDrawer/index.native.js +4 -0
  208. package/src/components/structure/bottomDrawer/index.web.js +4 -0
  209. package/src/components/structure/bottomDrawer/native/BottomDrawer.js +242 -0
  210. package/src/components/structure/bottomDrawer/native/DrawerContext.js +21 -0
  211. package/src/components/structure/bottomDrawer/native/DrawerHandle.js +12 -0
  212. package/src/components/structure/bottomDrawer/native/DrawerScrollView.js +83 -0
  213. package/src/components/structure/bottomDrawer/native/utils.js +58 -0
  214. package/src/components/structure/bottomDrawer/web/BottomDrawer.js +3 -0
  215. package/src/components/structure/drawer/Drawer.js +5 -0
  216. package/src/components/structure/drawer/Drawer.native.js +3 -0
  217. package/src/components/structure/drawer/index.js +1 -0
  218. package/src/components/structure/index.js +5 -0
  219. package/src/components/structure/modal/Modal.js +84 -0
  220. package/src/components/structure/modal/Modal.native.js +83 -0
  221. package/src/components/structure/modal/ModalBackdrop.js +58 -0
  222. package/src/components/structure/modal/ModalContent.js +28 -0
  223. package/src/components/structure/modal/ModalFooter.js +31 -0
  224. package/src/components/structure/modal/ModalHeader.js +50 -0
  225. package/src/components/structure/modal/handler/ModalsHandler.js +61 -0
  226. package/src/components/structure/modal/index.js +6 -0
  227. package/src/components/structure/overlay/OverlayWrapper.js +1 -1
  228. package/src/components/structure/popover/Popover.js +37 -2
  229. package/src/components/structure/popover/Popover.native.js +46 -16
  230. package/src/components/theme/ThemePicker.js +49 -0
  231. package/src/components/theme/ThemePickerDrawer.js +13 -0
  232. package/src/components/theme/ThemeStatusBar.js +3 -0
  233. package/src/components/theme/ThemeStatusBar.native.js +9 -0
  234. package/src/components/theme/ThemeThumb.js +98 -0
  235. package/src/components/theme/index.js +3 -0
  236. package/src/helpers/index.js +1 -0
  237. package/src/helpers/storage.js +54 -0
  238. package/src/modifiers/animations/animatedEffects.js +2 -0
  239. package/src/modifiers/animations/animatedEffects.native.js +3 -1
  240. package/src/modifiers/animations/fadeEffect.js +4 -2
  241. package/src/modifiers/animations/scaleEffect.js +45 -0
  242. package/src/modifiers/animations/scaleEffect.native.js +33 -0
  243. package/src/modifiers/animations/slideEffect.js +3 -1
  244. package/src/modifiers/background.js +16 -4
  245. package/src/modifiers/cursor.js +21 -0
  246. package/src/modifiers/display.js +2 -2
  247. package/src/modifiers/fullColor.js +2 -2
  248. package/src/modifiers/hover.js +28 -0
  249. package/src/modifiers/position.js +24 -3
  250. package/src/modifiers/size.js +2 -1
  251. package/src/modifiers/state.js +1 -1
  252. package/src/responsive/responsiveHooks.js +7 -0
  253. package/src/theme/ThemeHandler.js +18 -2
  254. package/src/theme/default/base.js +6 -6
  255. package/src/theme/default/blackTheme.js +35 -0
  256. package/src/theme/default/cyberpunkTheme.js +4 -1
  257. package/src/theme/default/darkTheme.js +4 -1
  258. package/src/theme/default/deepWoodsTheme.js +5 -2
  259. package/src/theme/default/forestTheme.js +4 -1
  260. package/src/theme/default/hackerTheme.js +4 -1
  261. package/src/theme/default/lightTheme.js +4 -1
  262. package/src/theme/default/midnightTheme.js +4 -1
  263. package/src/theme/default/msdosTheme.js +19 -4
  264. package/src/theme/default/oceanTheme.js +5 -2
  265. package/src/theme/default/paperTheme.js +35 -0
  266. package/src/theme/default/pastelTheme.js +5 -2
  267. package/src/theme/default/sunsetTheme.js +7 -4
  268. package/src/theme/default/themes.js +9 -10
  269. package/src/theme/format/formatTheme.js +9 -3
  270. package/src/theme/helpers/contrastColor.js +49 -11
  271. package/dist/abstractions/TouchableOpacity.web.js +0 -1
  272. package/dist/components/calendar/DayPicker.js +0 -1
  273. package/src/abstractions/TouchableOpacity.web.js +0 -3
  274. 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>
@@ -8,4 +8,5 @@ export * from './Badge'
8
8
  export * from './Avatar'
9
9
  export * from './AvatarLabel'
10
10
  export * from './Image'
11
+ export * from './ImageBackground'
11
12
  export * from './LabelValue'
@@ -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 className="neko-laoding-view-overlay" bg="bg_op90" absolute top={0} left={0} right={0} bottom={0} center>
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,4 @@
1
+ export { BottomDrawer } from './native/BottomDrawer'
2
+ export { DrawerScrollView } from './native/DrawerScrollView'
3
+ export { DrawerHandle } from './native/DrawerHandle'
4
+ export { DrawerProvider, useDrawerContext } from './native/DrawerContext'
@@ -0,0 +1,4 @@
1
+ export { BottomDrawer } from './native/BottomDrawer'
2
+ export { DrawerScrollView } from './native/DrawerScrollView'
3
+ export { DrawerHandle } from './native/DrawerHandle'
4
+ export { DrawerProvider, useDrawerContext } from './native/DrawerContext'
@@ -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,3 @@
1
+ import { Drawer } from '../../drawer'
2
+
3
+ export const BottomDrawer = (props) => <Drawer height={400} {...props} />
@@ -0,0 +1,5 @@
1
+ import { Modal } from '../modal/Modal'
2
+
3
+ export function Drawer(props) {
4
+ return <Modal position="bottom" {...props} />
5
+ }
@@ -0,0 +1,3 @@
1
+ import { BottomDrawer } from '../bottomDrawer/native/BottomDrawer'
2
+
3
+ export const Drawer = BottomDrawer
@@ -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'