@flipova/foundation 1.14.0 → 2.0.5

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 (268) hide show
  1. package/CHANGELOG.md +181 -0
  2. package/README.md +53 -178
  3. package/components/ui/accordion/ANIMATION_CUSTOMIZATION.md +162 -0
  4. package/components/ui/accordion/AccordionAnimatedHeight.tsx +56 -0
  5. package/components/ui/accordion/AccordionAnimatedIcon.tsx +41 -0
  6. package/components/ui/accordion/AnimatedHeight.tsx +56 -0
  7. package/components/ui/accordion/AnimatedIcon.tsx +41 -0
  8. package/components/ui/accordion/MIGRATION_SUMMARY.md +250 -0
  9. package/components/ui/accordion/USAGE_EXAMPLE.tsx +179 -0
  10. package/components/ui/accordion/animation-config.ts +32 -0
  11. package/components/ui/accordion/index.tsx +253 -0
  12. package/components/ui/actionsheet/index.tsx +511 -0
  13. package/components/ui/alert/index.tsx +158 -0
  14. package/components/ui/alert-dialog/index.tsx +254 -0
  15. package/components/ui/avatar/index.tsx +139 -0
  16. package/components/ui/badge/index.tsx +163 -0
  17. package/components/ui/bottomsheet/index.tsx +477 -0
  18. package/components/ui/box/index.tsx +19 -0
  19. package/components/ui/box/index.web.tsx +19 -0
  20. package/components/ui/box/styles.tsx +10 -0
  21. package/components/ui/button/index.tsx +264 -0
  22. package/components/ui/calendar/creator.tsx +366 -0
  23. package/components/ui/calendar/index.tsx +462 -0
  24. package/components/ui/calendar/styles.tsx +140 -0
  25. package/components/ui/card/index.tsx +23 -0
  26. package/components/ui/card/index.web.tsx +26 -0
  27. package/components/ui/card/styles.tsx +16 -0
  28. package/components/ui/center/index.tsx +22 -0
  29. package/components/ui/center/index.web.tsx +20 -0
  30. package/components/ui/center/styles.tsx +8 -0
  31. package/components/ui/checkbox/index.tsx +184 -0
  32. package/components/ui/date-time-picker/creator.tsx +109 -0
  33. package/components/ui/date-time-picker/index.tsx +585 -0
  34. package/components/ui/date-time-picker/index.web.tsx +217 -0
  35. package/components/ui/date-time-picker/styles.tsx +56 -0
  36. package/components/ui/divider/index.tsx +40 -0
  37. package/components/ui/drawer/index.tsx +362 -0
  38. package/components/ui/fab/index.tsx +215 -0
  39. package/components/ui/flat-list/index.tsx +21 -0
  40. package/components/ui/form-control/index.tsx +352 -0
  41. package/components/ui/gluestack-ui-provider/config.ts +72 -0
  42. package/components/ui/gluestack-ui-provider/index.tsx +47 -0
  43. package/components/ui/gluestack-ui-provider/index.web.tsx +96 -0
  44. package/components/ui/gluestack-ui-provider/script.ts +19 -0
  45. package/components/ui/gluestack-ui-provider/tokens.d.ts +17 -0
  46. package/components/ui/gluestack-ui-provider/tokens.js +188 -0
  47. package/components/ui/gluestack-ui-provider/useGluestackColors.ts +82 -0
  48. package/components/ui/grid/index.tsx +283 -0
  49. package/components/ui/grid/index.web.tsx +66 -0
  50. package/components/ui/grid/styles.tsx +15 -0
  51. package/components/ui/heading/index.tsx +220 -0
  52. package/components/ui/heading/index.web.tsx +202 -0
  53. package/components/ui/heading/styles.tsx +43 -0
  54. package/components/ui/hstack/index.tsx +27 -0
  55. package/components/ui/hstack/index.web.tsx +26 -0
  56. package/components/ui/hstack/styles.tsx +25 -0
  57. package/components/ui/icon/index.tsx +1588 -0
  58. package/components/ui/icon/index.web.tsx +1573 -0
  59. package/components/ui/image/index.tsx +48 -0
  60. package/components/ui/image-background/index.tsx +25 -0
  61. package/components/ui/image-viewer/index.tsx +743 -0
  62. package/components/ui/image-viewer/index.web.tsx +302 -0
  63. package/components/ui/index.ts +58 -0
  64. package/components/ui/input/index.tsx +125 -0
  65. package/components/ui/input-accessory-view/index.tsx +2 -0
  66. package/components/ui/keyboard-avoiding-view/index.tsx +2 -0
  67. package/components/ui/link/index.tsx +102 -0
  68. package/components/ui/liquid-glass/index.tsx +74 -0
  69. package/components/ui/menu/index.tsx +186 -0
  70. package/components/ui/modal/index.tsx +237 -0
  71. package/components/ui/popover/index.tsx +272 -0
  72. package/components/ui/portal/index.tsx +17 -0
  73. package/components/ui/pressable/index.tsx +39 -0
  74. package/components/ui/progress/index.tsx +83 -0
  75. package/components/ui/radio/index.tsx +217 -0
  76. package/components/ui/refresh-control/index.tsx +2 -0
  77. package/components/ui/safe-area-view/index.tsx +2 -0
  78. package/components/ui/scroll-view/index.tsx +2 -0
  79. package/components/ui/section-list/index.tsx +2 -0
  80. package/components/ui/select/index.tsx +277 -0
  81. package/components/ui/select/select-actionsheet.tsx +562 -0
  82. package/components/ui/skeleton/index.tsx +105 -0
  83. package/components/ui/skeleton/index.web.tsx +103 -0
  84. package/components/ui/skeleton/styles.tsx +35 -0
  85. package/components/ui/slider/index.tsx +181 -0
  86. package/components/ui/spinner/index.tsx +40 -0
  87. package/components/ui/status-bar/index.tsx +2 -0
  88. package/components/ui/switch/index.tsx +41 -0
  89. package/components/ui/table/index.tsx +210 -0
  90. package/components/ui/table/index.web.tsx +157 -0
  91. package/components/ui/table/styles.tsx +44 -0
  92. package/components/ui/tabs/TabsAnimatedIndicator.tsx +160 -0
  93. package/components/ui/tabs/animation-config.ts +3 -0
  94. package/components/ui/tabs/creator.tsx +206 -0
  95. package/components/ui/tabs/index.tsx +484 -0
  96. package/components/ui/text/index.tsx +48 -0
  97. package/components/ui/text/index.web.tsx +45 -0
  98. package/components/ui/text/styles.tsx +47 -0
  99. package/components/ui/textarea/index.tsx +94 -0
  100. package/components/ui/toast/index.tsx +252 -0
  101. package/components/ui/tooltip/index.tsx +131 -0
  102. package/components/ui/view/index.tsx +2 -0
  103. package/components/ui/virtualized-list/index.tsx +2 -0
  104. package/components/ui/vstack/index.tsx +28 -0
  105. package/components/ui/vstack/index.web.tsx +27 -0
  106. package/components/ui/vstack/styles.tsx +25 -0
  107. package/design/canonical.index.txt +53 -0
  108. package/design/documentation.xml +519 -0
  109. package/design/manifest.xml +90 -0
  110. package/design/schema.xsd +639 -0
  111. package/design/themes.xml +204 -0
  112. package/design/tokens.xml +510 -0
  113. package/design/tools/design.js +165 -0
  114. package/design/tools/npm.js +65 -0
  115. package/design/tools/requirements.txt +35 -0
  116. package/design/tools/sources/.checker/__init__.py +81 -0
  117. package/design/tools/sources/.checker/checks.py +198 -0
  118. package/design/tools/sources/.checker/cli.py +154 -0
  119. package/design/tools/sources/.checker/io.py +242 -0
  120. package/design/tools/sources/.checker/model.py +144 -0
  121. package/design/tools/sources/.checker/registry.py +115 -0
  122. package/design/tools/sources/.checker/report.py +21 -0
  123. package/design/tools/sources/.docgen/__init__.py +45 -0
  124. package/design/tools/sources/.docgen/cli.py +101 -0
  125. package/design/tools/sources/.docgen/model.py +147 -0
  126. package/design/tools/sources/.docgen/reference.py +97 -0
  127. package/design/tools/sources/.docgen/site.py +145 -0
  128. package/design/tools/sources/.docgen/xsddoc.py +329 -0
  129. package/design/tools/sources/.generate/__init__.py +35 -0
  130. package/design/tools/sources/.generate/cli.py +76 -0
  131. package/design/tools/sources/.generate/common.py +33 -0
  132. package/design/tools/sources/.generate/config.py +119 -0
  133. package/design/tools/sources/.generate/model.py +51 -0
  134. package/design/tools/sources/.generate/tokens.py +141 -0
  135. package/design/tools/sources/.linter/__init__.py +9 -0
  136. package/design/tools/sources/.linter/cli.py +44 -0
  137. package/design/tools/sources/.linter/discovery.py +30 -0
  138. package/design/tools/sources/.linter/errors.py +45 -0
  139. package/design/tools/sources/.linter/linter.py +68 -0
  140. package/design/tools/sources/.xmleditor/__init__.py +74 -0
  141. package/design/tools/sources/.xmleditor/blocks.py +185 -0
  142. package/design/tools/sources/.xmleditor/cli.py +141 -0
  143. package/design/tools/sources/.xmleditor/editor.py +906 -0
  144. package/design/tools/sources/.xmleditor/model.py +708 -0
  145. package/design/tools/sources/.xmleditor/widgets.py +1832 -0
  146. package/design/tools/sources/.xmleditor/xsdmodel.py +753 -0
  147. package/design/tools/sources/checker.py +55 -0
  148. package/design/tools/sources/docgen.py +66 -0
  149. package/design/tools/sources/generate.py +48 -0
  150. package/design/tools/sources/linter.py +54 -0
  151. package/design/tools/sources/ruff.toml +12 -0
  152. package/design/tools/sources/xmleditor.py +62 -0
  153. package/design/tools/unix/_venv_python.sh +16 -0
  154. package/design/tools/unix/check.sh +13 -0
  155. package/design/tools/unix/doc.sh +14 -0
  156. package/design/tools/unix/gen.sh +14 -0
  157. package/design/tools/unix/lint.sh +10 -0
  158. package/design/tools/unix/run.sh +20 -0
  159. package/design/tools/unix/verify.sh +12 -0
  160. package/design/tools/unix/xmledit.sh +12 -0
  161. package/design/tools/windows/check.cmd +12 -0
  162. package/design/tools/windows/doc.cmd +12 -0
  163. package/design/tools/windows/gen.cmd +11 -0
  164. package/design/tools/windows/lint.cmd +9 -0
  165. package/design/tools/windows/run.cmd +26 -0
  166. package/design/tools/windows/verify.cmd +10 -0
  167. package/design/tools/windows/xmledit.cmd +10 -0
  168. package/dist/chunk-LV4UIEQN.js +9730 -0
  169. package/dist/chunk-LV4UIEQN.js.map +1 -0
  170. package/dist/chunk-WNVU3BM2.mjs +9401 -0
  171. package/dist/chunk-WNVU3BM2.mjs.map +1 -0
  172. package/dist/index.d.mts +40 -10
  173. package/dist/index.d.ts +40 -10
  174. package/dist/index.js +726 -414
  175. package/dist/index.mjs +1 -5
  176. package/dist/ui/index.d.mts +6931 -3070
  177. package/dist/ui/index.d.ts +6931 -3070
  178. package/dist/ui/index.js +779 -352
  179. package/dist/ui/index.mjs +1 -2
  180. package/package.json +66 -149
  181. package/dist/chunk-2XORADW6.js +0 -24552
  182. package/dist/chunk-2XORADW6.js.map +0 -1
  183. package/dist/chunk-52BHHF5M.js +0 -46
  184. package/dist/chunk-52BHHF5M.js.map +0 -1
  185. package/dist/chunk-5647JY7Z.mjs +0 -100
  186. package/dist/chunk-5647JY7Z.mjs.map +0 -1
  187. package/dist/chunk-5N5HC4ZA.mjs +0 -3
  188. package/dist/chunk-5N5HC4ZA.mjs.map +0 -1
  189. package/dist/chunk-7QFZMGL6.js +0 -8583
  190. package/dist/chunk-7QFZMGL6.js.map +0 -1
  191. package/dist/chunk-ASZEP37D.js +0 -423
  192. package/dist/chunk-ASZEP37D.js.map +0 -1
  193. package/dist/chunk-BH5SU2JQ.mjs +0 -8282
  194. package/dist/chunk-BH5SU2JQ.mjs.map +0 -1
  195. package/dist/chunk-BO65GO53.mjs +0 -422
  196. package/dist/chunk-BO65GO53.mjs.map +0 -1
  197. package/dist/chunk-BSVXX52E.mjs +0 -413
  198. package/dist/chunk-BSVXX52E.mjs.map +0 -1
  199. package/dist/chunk-DNV5UBNF.mjs +0 -3
  200. package/dist/chunk-DNV5UBNF.mjs.map +0 -1
  201. package/dist/chunk-EDTAMUO2.js +0 -8310
  202. package/dist/chunk-EDTAMUO2.js.map +0 -1
  203. package/dist/chunk-IJTI6EX4.js +0 -4
  204. package/dist/chunk-IJTI6EX4.js.map +0 -1
  205. package/dist/chunk-M3YLASM2.js +0 -428
  206. package/dist/chunk-M3YLASM2.js.map +0 -1
  207. package/dist/chunk-OXKOGLXE.js +0 -4
  208. package/dist/chunk-OXKOGLXE.js.map +0 -1
  209. package/dist/chunk-RQXQK3ZO.mjs +0 -8486
  210. package/dist/chunk-RQXQK3ZO.mjs.map +0 -1
  211. package/dist/chunk-SR25V4EA.mjs +0 -40
  212. package/dist/chunk-SR25V4EA.mjs.map +0 -1
  213. package/dist/chunk-UB34WFEQ.js +0 -106
  214. package/dist/chunk-UB34WFEQ.js.map +0 -1
  215. package/dist/chunk-ZBRWXKDF.mjs +0 -24431
  216. package/dist/chunk-ZBRWXKDF.mjs.map +0 -1
  217. package/dist/cli/ds.d.mts +0 -1
  218. package/dist/cli/ds.d.ts +0 -1
  219. package/dist/cli/ds.js +0 -602
  220. package/dist/cli/ds.js.map +0 -1
  221. package/dist/cli/ds.mjs +0 -579
  222. package/dist/cli/ds.mjs.map +0 -1
  223. package/dist/cli/flipova.d.mts +0 -1
  224. package/dist/cli/flipova.d.ts +0 -1
  225. package/dist/cli/flipova.js +0 -161
  226. package/dist/cli/flipova.js.map +0 -1
  227. package/dist/cli/flipova.mjs +0 -154
  228. package/dist/cli/flipova.mjs.map +0 -1
  229. package/dist/config/index.d.mts +0 -123
  230. package/dist/config/index.d.ts +0 -123
  231. package/dist/config/index.js +0 -28
  232. package/dist/config/index.js.map +0 -1
  233. package/dist/config/index.mjs +0 -3
  234. package/dist/config/index.mjs.map +0 -1
  235. package/dist/createTheme-DQeX3s0I.d.mts +0 -78
  236. package/dist/createTheme-Y4jfz4-u.d.ts +0 -78
  237. package/dist/index-CuaJA3gM.d.mts +0 -78
  238. package/dist/index-CuaJA3gM.d.ts +0 -78
  239. package/dist/registry/index.d.mts +0 -10160
  240. package/dist/registry/index.d.ts +0 -10160
  241. package/dist/registry/index.js +0 -392
  242. package/dist/registry/index.js.map +0 -1
  243. package/dist/registry/index.mjs +0 -3
  244. package/dist/registry/index.mjs.map +0 -1
  245. package/dist/theme/index.d.mts +0 -35
  246. package/dist/theme/index.d.ts +0 -35
  247. package/dist/theme/index.js +0 -28
  248. package/dist/theme/index.js.map +0 -1
  249. package/dist/theme/index.mjs +0 -3
  250. package/dist/theme/index.mjs.map +0 -1
  251. package/dist/tokens/index.d.mts +0 -423
  252. package/dist/tokens/index.d.ts +0 -423
  253. package/dist/tokens/index.js +0 -44
  254. package/dist/tokens/index.js.map +0 -1
  255. package/dist/tokens/index.mjs +0 -3
  256. package/dist/tokens/index.mjs.map +0 -1
  257. package/dist/types/index.d.mts +0 -202
  258. package/dist/types/index.d.ts +0 -202
  259. package/dist/types/index.js +0 -4
  260. package/dist/types/index.js.map +0 -1
  261. package/dist/types/index.mjs +0 -3
  262. package/dist/types/index.mjs.map +0 -1
  263. package/dist/web/index.d.mts +0 -316
  264. package/dist/web/index.d.ts +0 -316
  265. package/dist/web/index.js +0 -1500
  266. package/dist/web/index.js.map +0 -1
  267. package/dist/web/index.mjs +0 -1396
  268. package/dist/web/index.mjs.map +0 -1
@@ -0,0 +1,103 @@
1
+ import React from 'react';
2
+ import { skeletonStyle, skeletonTextStyle } from './styles';
3
+
4
+ import type { VariantProps } from '@gluestack-ui/utils/nativewind-utils';
5
+
6
+ type ISkeletonProps = React.ComponentPropsWithoutRef<'div'> &
7
+ VariantProps<typeof skeletonStyle> & {
8
+ startColor?: string;
9
+ isLoaded?: boolean;
10
+ };
11
+
12
+ const Skeleton = React.forwardRef<HTMLDivElement, ISkeletonProps>(
13
+ function Skeleton(
14
+ {
15
+ className,
16
+ variant = 'rounded',
17
+ children,
18
+ speed = 4,
19
+ startColor = 'bg-muted-foreground/20',
20
+ isLoaded = false,
21
+ ...props
22
+ },
23
+ ref
24
+ ) {
25
+ if (!isLoaded) {
26
+ return (
27
+ <div
28
+ ref={ref}
29
+ className={`animate-pulse ${startColor} ${skeletonStyle({
30
+ variant,
31
+ speed,
32
+ class: className,
33
+ })}`}
34
+ {...props}
35
+ />
36
+ );
37
+ } else {
38
+ return children;
39
+ }
40
+ }
41
+ );
42
+
43
+ type ISkeletonTextProps = React.ComponentPropsWithoutRef<'div'> &
44
+ VariantProps<typeof skeletonTextStyle> & {
45
+ _lines?: number;
46
+ isLoaded?: boolean;
47
+ startColor?: string;
48
+ };
49
+
50
+ const SkeletonText = React.forwardRef<HTMLDivElement, ISkeletonTextProps>(
51
+ function SkeletonText(
52
+ {
53
+ className,
54
+ _lines,
55
+ isLoaded = false,
56
+ startColor = 'bg-muted-foreground/20',
57
+ gap = 2,
58
+ children,
59
+ ...props
60
+ },
61
+ ref
62
+ ) {
63
+ if (!isLoaded) {
64
+ if (_lines) {
65
+ return (
66
+ <div
67
+ ref={ref}
68
+ className={`flex flex-col ${skeletonTextStyle({
69
+ gap,
70
+ })}`}
71
+ >
72
+ {Array.from({ length: _lines }).map((_, index) => (
73
+ <div
74
+ key={index}
75
+ className={`animate-pulse ${startColor} ${skeletonTextStyle({
76
+ class: className,
77
+ })}`}
78
+ {...props}
79
+ />
80
+ ))}
81
+ </div>
82
+ );
83
+ } else {
84
+ return (
85
+ <div
86
+ ref={ref}
87
+ className={`animate-pulse ${startColor} ${skeletonTextStyle({
88
+ class: className,
89
+ })}`}
90
+ {...props}
91
+ />
92
+ );
93
+ }
94
+ } else {
95
+ return children;
96
+ }
97
+ }
98
+ );
99
+
100
+ Skeleton.displayName = 'Skeleton';
101
+ SkeletonText.displayName = 'SkeletonText';
102
+
103
+ export { Skeleton, SkeletonText };
@@ -0,0 +1,35 @@
1
+ import { tva } from '@gluestack-ui/utils/nativewind-utils';
2
+
3
+ export const skeletonStyle = tva({
4
+ base: 'w-full h-full rounded-sm',
5
+ variants: {
6
+ variant: {
7
+ sharp: 'rounded-none',
8
+ circular: 'rounded-full',
9
+ rounded: 'rounded-md',
10
+ },
11
+ speed: {
12
+ 1: 'duration-750',
13
+ 2: 'duration-100',
14
+ 3: 'duration-1500',
15
+ 4: 'duration-2000',
16
+ },
17
+ },
18
+ });
19
+ export const skeletonTextStyle = tva({
20
+ base: 'rounded-sm w-full',
21
+ variants: {
22
+ speed: {
23
+ 1: 'duration-750',
24
+ 2: 'duration-1000',
25
+ 3: 'duration-1500',
26
+ 4: 'duration-2000',
27
+ },
28
+ gap: {
29
+ 1: 'gap-1',
30
+ 2: 'gap-2',
31
+ 3: 'gap-3',
32
+ 4: 'gap-4',
33
+ },
34
+ },
35
+ });
@@ -0,0 +1,181 @@
1
+ 'use client';
2
+ import { createSlider } from '@gluestack-ui/core/slider/creator';
3
+ import { Pressable } from 'react-native';
4
+ import { View } from 'react-native';
5
+ import React from 'react';
6
+ import { tva } from '@gluestack-ui/utils/nativewind-utils';
7
+ import {
8
+ withStyleContext,
9
+ useStyleContext,
10
+ } from '@gluestack-ui/utils/nativewind-utils';
11
+ import type { VariantProps } from '@gluestack-ui/utils/nativewind-utils';
12
+ import { cssInterop } from 'nativewind';
13
+
14
+ const SCOPE = 'SLIDER';
15
+ const Root = withStyleContext(View, SCOPE);
16
+ export const UISlider = createSlider({
17
+ Root: Root,
18
+ Thumb: View,
19
+ Track: Pressable,
20
+ FilledTrack: View,
21
+ ThumbInteraction: View,
22
+ });
23
+
24
+ cssInterop(UISlider.Track, { className: 'style' });
25
+
26
+ const sliderStyle = tva({
27
+ base: 'justify-center items-center data-[disabled=true]:opacity-40 data-[disabled=true]:web:pointer-events-none',
28
+ variants: {
29
+ orientation: {
30
+ horizontal: 'w-full',
31
+ vertical: 'h-full',
32
+ },
33
+ isReversed: {
34
+ true: '',
35
+ false: '',
36
+ },
37
+ },
38
+ });
39
+
40
+ const sliderThumbStyle = tva({
41
+ base: 'bg-white border border-primary ring-ring/50 absolute rounded-full shadow-sm transition-[color,box-shadow] data-[hover=true]:ring-4 data-[focus-visible=true]:ring-4 data-[focus-visible=true]:outline-hidden disabled:pointer-events-none disabled:opacity-50 web:cursor-pointer h-4 w-4',
42
+ });
43
+
44
+ const sliderTrackStyle = tva({
45
+ base: 'bg-muted rounded-full overflow-hidden',
46
+ parentVariants: {
47
+ orientation: {
48
+ horizontal: 'w-full h-1.5 flex-row',
49
+ vertical: 'h-full w-1.5 flex-col-reverse',
50
+ },
51
+ isReversed: {
52
+ true: '',
53
+ false: '',
54
+ },
55
+ },
56
+ parentCompoundVariants: [
57
+ {
58
+ orientation: 'horizontal',
59
+ isReversed: true,
60
+ class: 'flex-row-reverse',
61
+ },
62
+ {
63
+ orientation: 'vertical',
64
+ isReversed: true,
65
+ class: 'flex-col',
66
+ },
67
+ ],
68
+ });
69
+
70
+ const sliderFilledTrackStyle = tva({
71
+ base: 'bg-primary',
72
+ parentVariants: {
73
+ orientation: {
74
+ horizontal: 'h-full',
75
+ vertical: 'w-full',
76
+ },
77
+ },
78
+ });
79
+
80
+ type ISliderProps = React.ComponentProps<typeof UISlider> &
81
+ VariantProps<typeof sliderStyle>;
82
+
83
+ const Slider = React.forwardRef<
84
+ React.ComponentRef<typeof UISlider>,
85
+ ISliderProps
86
+ >(function Slider(
87
+ {
88
+ className,
89
+ orientation = 'horizontal',
90
+ isReversed = false,
91
+ ...props
92
+ },
93
+ ref
94
+ ) {
95
+ return (
96
+ <UISlider
97
+ ref={ref}
98
+ isReversed={isReversed}
99
+ orientation={orientation}
100
+ {...props}
101
+ className={sliderStyle({
102
+ orientation,
103
+ isReversed,
104
+ class: className,
105
+ })}
106
+ context={{ orientation, isReversed }}
107
+ />
108
+ );
109
+ });
110
+
111
+ type ISliderThumbProps = React.ComponentProps<typeof UISlider.Thumb> &
112
+ VariantProps<typeof sliderThumbStyle>;
113
+
114
+ const SliderThumb = React.forwardRef<
115
+ React.ComponentRef<typeof UISlider.Thumb>,
116
+ ISliderThumbProps
117
+ >(function SliderThumb({ className, ...props }, ref) {
118
+ return (
119
+ <UISlider.Thumb
120
+ ref={ref}
121
+ {...props}
122
+ className={sliderThumbStyle({
123
+ class: className,
124
+ })}
125
+ />
126
+ );
127
+ });
128
+
129
+ type ISliderTrackProps = React.ComponentProps<typeof UISlider.Track> &
130
+ VariantProps<typeof sliderTrackStyle>;
131
+
132
+ const SliderTrack = React.forwardRef<
133
+ React.ComponentRef<typeof UISlider.Track>,
134
+ ISliderTrackProps
135
+ >(function SliderTrack({ className, ...props }, ref) {
136
+ const {
137
+ orientation: parentOrientation,
138
+ isReversed,
139
+ } = useStyleContext(SCOPE);
140
+
141
+ return (
142
+ <UISlider.Track
143
+ ref={ref}
144
+ {...props}
145
+ className={sliderTrackStyle({
146
+ parentVariants: {
147
+ orientation: parentOrientation,
148
+ isReversed,
149
+ },
150
+ class: className,
151
+ })}
152
+ />
153
+ );
154
+ });
155
+
156
+ type ISliderFilledTrackProps = React.ComponentProps<
157
+ typeof UISlider.FilledTrack
158
+ > &
159
+ VariantProps<typeof sliderFilledTrackStyle>;
160
+
161
+ const SliderFilledTrack = React.forwardRef<
162
+ React.ComponentRef<typeof UISlider.FilledTrack>,
163
+ ISliderFilledTrackProps
164
+ >(function SliderFilledTrack({ className, ...props }, ref) {
165
+ const { orientation: parentOrientation } = useStyleContext(SCOPE);
166
+
167
+ return (
168
+ <UISlider.FilledTrack
169
+ ref={ref}
170
+ {...props}
171
+ className={sliderFilledTrackStyle({
172
+ parentVariants: {
173
+ orientation: parentOrientation,
174
+ },
175
+ class: className,
176
+ })}
177
+ />
178
+ );
179
+ });
180
+
181
+ export { Slider, SliderThumb, SliderTrack, SliderFilledTrack };
@@ -0,0 +1,40 @@
1
+ 'use client';
2
+ import { ActivityIndicator } from 'react-native';
3
+ import React from 'react';
4
+ import { tva } from '@gluestack-ui/utils/nativewind-utils';
5
+ import { cssInterop } from 'nativewind';
6
+
7
+ cssInterop(ActivityIndicator, {
8
+ className: { target: 'style', nativeStyleToProp: { color: true } },
9
+ });
10
+
11
+ const spinnerStyle = tva({});
12
+
13
+ const Spinner = React.forwardRef<
14
+ React.ComponentRef<typeof ActivityIndicator>,
15
+ React.ComponentProps<typeof ActivityIndicator>
16
+ >(function Spinner(
17
+ {
18
+ className,
19
+ color,
20
+ focusable = false,
21
+ 'aria-label': ariaLabel = 'loading',
22
+ ...props
23
+ },
24
+ ref
25
+ ) {
26
+ return (
27
+ <ActivityIndicator
28
+ ref={ref}
29
+ focusable={focusable}
30
+ aria-label={ariaLabel}
31
+ {...props}
32
+ color={color}
33
+ className={spinnerStyle({ class: className })}
34
+ />
35
+ );
36
+ });
37
+
38
+ Spinner.displayName = 'Spinner';
39
+
40
+ export { Spinner };
@@ -0,0 +1,2 @@
1
+ 'use client';
2
+ export { StatusBar } from 'react-native';
@@ -0,0 +1,41 @@
1
+ 'use client';
2
+ import React from 'react';
3
+ import { Switch as RNSwitch } from 'react-native';
4
+ import { createSwitch } from '@gluestack-ui/core/switch/creator';
5
+ import { tva } from '@gluestack-ui/utils/nativewind-utils';
6
+ import { withStyleContext } from '@gluestack-ui/utils/nativewind-utils';
7
+ import type { VariantProps } from '@gluestack-ui/utils/nativewind-utils';
8
+
9
+ const UISwitch = createSwitch({
10
+ Root: withStyleContext(RNSwitch),
11
+ });
12
+
13
+ const switchStyle = tva({
14
+ base: 'data-[focus=true]:outline-0 data-[focus=true]:ring-2 data-[focus=true]:ring-indicator-primary web:cursor-pointer disabled:cursor-not-allowed data-[disabled=true]:opacity-40 data-[invalid=true]:border-destructive data-[invalid=true]:rounded-xl data-[invalid=true]:border-2',
15
+
16
+ variants: {
17
+ size: {
18
+ sm: 'scale-75',
19
+ md: '',
20
+ lg: 'scale-125',
21
+ },
22
+ },
23
+ });
24
+
25
+ type ISwitchProps = React.ComponentProps<typeof UISwitch> &
26
+ VariantProps<typeof switchStyle>;
27
+ const Switch = React.forwardRef<
28
+ React.ComponentRef<typeof UISwitch>,
29
+ ISwitchProps
30
+ >(function Switch({ className, size = 'md', ...props }, ref) {
31
+ return (
32
+ <UISwitch
33
+ ref={ref}
34
+ {...props}
35
+ className={switchStyle({ size, class: className })}
36
+ />
37
+ );
38
+ });
39
+
40
+ Switch.displayName = 'Switch';
41
+ export { Switch };
@@ -0,0 +1,210 @@
1
+ import React, { createContext, useMemo, useContext } from 'react';
2
+ import {
3
+ Table as ExpoTable,
4
+ THead as ExpoTHead,
5
+ TBody as ExpoTBody,
6
+ TFoot as ExpoTFoot,
7
+ TR as ExpoTR,
8
+ Caption as ExpoTCaption,
9
+ } from '@expo/html-elements';
10
+
11
+ import {
12
+ tableStyle,
13
+ tableHeaderStyle,
14
+ tableBodyStyle,
15
+ tableFooterStyle,
16
+ tableHeadStyle,
17
+ tableRowStyleStyle,
18
+ tableDataStyle,
19
+ tableCaptionStyle,
20
+ } from './styles';
21
+ import { Text, View } from 'react-native';
22
+
23
+ const TableHeaderContext = createContext<{
24
+ isHeaderRow: boolean;
25
+ }>({
26
+ isHeaderRow: false,
27
+ });
28
+ const TableFooterContext = createContext<{
29
+ isFooterRow: boolean;
30
+ }>({
31
+ isFooterRow: false,
32
+ });
33
+
34
+ type ITableProps = React.ComponentProps<typeof ExpoTable>;
35
+ type ITableHeaderProps = React.ComponentProps<typeof ExpoTHead>;
36
+ type ITableBodyProps = React.ComponentProps<typeof ExpoTBody>;
37
+ type ITableFooterProps = React.ComponentProps<typeof ExpoTFoot>;
38
+ type ITableHeadProps = React.ComponentProps<typeof View | typeof Text> & {
39
+ useRNView?: boolean;
40
+ };
41
+ type ITableRowProps = React.ComponentProps<typeof ExpoTR>;
42
+ type ITableDataProps = React.ComponentProps<typeof View | typeof Text> & {
43
+ useRNView?: boolean;
44
+ };
45
+ type ITableCaptionProps = React.ComponentProps<typeof ExpoTCaption>;
46
+
47
+ const Table = React.forwardRef<
48
+ React.ComponentRef<typeof ExpoTable>,
49
+ ITableProps
50
+ >(({ className, ...props }, ref) => {
51
+ return (
52
+ <ExpoTable
53
+ ref={ref}
54
+ className={tableStyle({ class: className })}
55
+ {...props}
56
+ />
57
+ );
58
+ });
59
+
60
+ const TableHeader = React.forwardRef<
61
+ React.ComponentRef<typeof ExpoTHead>,
62
+ ITableHeaderProps
63
+ >(function TableHeader({ className, ...props }, ref) {
64
+ const contextValue = useMemo(() => {
65
+ return {
66
+ isHeaderRow: true,
67
+ };
68
+ }, []);
69
+ return (
70
+ <TableHeaderContext.Provider value={contextValue}>
71
+ <ExpoTHead
72
+ ref={ref}
73
+ className={tableHeaderStyle({ class: className })}
74
+ {...props}
75
+ />
76
+ </TableHeaderContext.Provider>
77
+ );
78
+ });
79
+
80
+ const TableBody = React.forwardRef<
81
+ React.ComponentRef<typeof ExpoTBody>,
82
+ ITableBodyProps
83
+ >(function TableBody({ className, ...props }, ref) {
84
+ return (
85
+ <ExpoTBody
86
+ ref={ref}
87
+ className={tableBodyStyle({ class: className })}
88
+ {...props}
89
+ />
90
+ );
91
+ });
92
+
93
+ const TableFooter = React.forwardRef<
94
+ React.ComponentRef<typeof ExpoTFoot>,
95
+ ITableFooterProps
96
+ >(function TableFooter({ className, ...props }, ref) {
97
+ const contextValue = useMemo(() => {
98
+ return {
99
+ isFooterRow: true,
100
+ };
101
+ }, []);
102
+ return (
103
+ <TableFooterContext.Provider value={contextValue}>
104
+ <ExpoTFoot
105
+ ref={ref}
106
+ className={tableFooterStyle({ class: className })}
107
+ {...props}
108
+ />
109
+ </TableFooterContext.Provider>
110
+ );
111
+ });
112
+
113
+ const TableHead = React.forwardRef<
114
+ React.ComponentRef<typeof View | typeof Text>,
115
+ ITableHeadProps
116
+ >(function TableHead({ useRNView = false, className, ...props }, ref) {
117
+ if (useRNView) {
118
+ return (
119
+ <View
120
+ ref={ref}
121
+ className={tableHeadStyle({ class: className })}
122
+ {...props}
123
+ />
124
+ );
125
+ } else {
126
+ return (
127
+ <Text
128
+ ref={ref}
129
+ className={tableHeadStyle({ class: className })}
130
+ {...props}
131
+ />
132
+ );
133
+ }
134
+ });
135
+
136
+ const TableRow = React.forwardRef<
137
+ React.ComponentRef<typeof ExpoTR>,
138
+ ITableRowProps
139
+ >(function TableRow({ className, ...props }, ref) {
140
+ const { isHeaderRow } = useContext(TableHeaderContext);
141
+ const { isFooterRow } = useContext(TableFooterContext);
142
+
143
+ return (
144
+ <ExpoTR
145
+ ref={ref}
146
+ className={tableRowStyleStyle({
147
+ isHeaderRow,
148
+ isFooterRow,
149
+ class: className,
150
+ })}
151
+ {...props}
152
+ />
153
+ );
154
+ });
155
+
156
+ const TableData = React.forwardRef<
157
+ React.ComponentRef<typeof View | typeof Text>,
158
+ ITableDataProps
159
+ >(function TableData({ useRNView = false, className, ...props }, ref) {
160
+ if (useRNView) {
161
+ return (
162
+ <View
163
+ ref={ref}
164
+ className={tableDataStyle({ class: className })}
165
+ {...props}
166
+ />
167
+ );
168
+ } else {
169
+ return (
170
+ <Text
171
+ ref={ref}
172
+ className={tableDataStyle({ class: className })}
173
+ {...props}
174
+ />
175
+ );
176
+ }
177
+ });
178
+
179
+ const TableCaption = React.forwardRef<
180
+ React.ComponentRef<typeof ExpoTCaption>,
181
+ ITableCaptionProps
182
+ >(({ className, ...props }, ref) => {
183
+ return (
184
+ <ExpoTCaption
185
+ ref={ref}
186
+ className={tableCaptionStyle({ class: className })}
187
+ {...props}
188
+ />
189
+ );
190
+ });
191
+
192
+ Table.displayName = 'Table';
193
+ TableHeader.displayName = 'TableHeader';
194
+ TableBody.displayName = 'TableBody';
195
+ TableFooter.displayName = 'TableFooter';
196
+ TableHead.displayName = 'TableHead';
197
+ TableRow.displayName = 'TableRow';
198
+ TableData.displayName = 'TableData';
199
+ TableCaption.displayName = 'TableCaption';
200
+
201
+ export {
202
+ Table,
203
+ TableHeader,
204
+ TableBody,
205
+ TableFooter,
206
+ TableHead,
207
+ TableRow,
208
+ TableData,
209
+ TableCaption,
210
+ };