@admin-layout/gluestack-ui-mobile 10.0.9-alpha.9 → 10.1.1-alpha.8

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 (170) hide show
  1. package/CHANGELOG.md +2 -6
  2. package/lib/components/ui/accordion/index.web.d.ts +209 -0
  3. package/lib/components/ui/accordion/index.web.js +156 -0
  4. package/lib/components/ui/accordion/index.web.js.map +1 -0
  5. package/lib/components/ui/actionsheet/index.web.d.ts +872 -0
  6. package/lib/components/ui/actionsheet/index.web.js +286 -0
  7. package/lib/components/ui/actionsheet/index.web.js.map +1 -0
  8. package/lib/components/ui/alert/index.web.d.ts +135 -0
  9. package/lib/components/ui/alert/index.web.js +38 -0
  10. package/lib/components/ui/alert/index.web.js.map +1 -0
  11. package/lib/components/ui/alert-dialog/index.web.d.ts +64 -0
  12. package/lib/components/ui/alert-dialog/index.web.js +139 -0
  13. package/lib/components/ui/alert-dialog/index.web.js.map +1 -0
  14. package/lib/components/ui/avatar/index.web.d.ts +21 -0
  15. package/lib/components/ui/avatar/index.web.js +92 -0
  16. package/lib/components/ui/avatar/index.web.js.map +1 -0
  17. package/lib/components/ui/badge/index.web.d.ts +382 -0
  18. package/lib/components/ui/badge/index.web.js +138 -0
  19. package/lib/components/ui/badge/index.web.js.map +1 -0
  20. package/lib/components/ui/button/index.web.d.ts +247 -0
  21. package/lib/components/ui/button/index.web.js +57 -0
  22. package/lib/components/ui/button/index.web.js.map +1 -0
  23. package/lib/components/ui/checkbox/index.web.d.ts +265 -0
  24. package/lib/components/ui/checkbox/index.web.js +77 -0
  25. package/lib/components/ui/checkbox/index.web.js.map +1 -0
  26. package/lib/components/ui/divider/index.web.d.ts +53 -0
  27. package/lib/components/ui/divider/index.web.js +21 -0
  28. package/lib/components/ui/divider/index.web.js.map +1 -0
  29. package/lib/components/ui/drawer/index.web.d.ts +174 -0
  30. package/lib/components/ui/drawer/index.web.js +65 -0
  31. package/lib/components/ui/drawer/index.web.js.map +1 -0
  32. package/lib/components/ui/fab/index.web.d.ts +520 -0
  33. package/lib/components/ui/fab/index.web.js +146 -0
  34. package/lib/components/ui/fab/index.web.js.map +1 -0
  35. package/lib/components/ui/flat-list/index.web.d.ts +21 -0
  36. package/lib/components/ui/flat-list/index.web.js +41 -0
  37. package/lib/components/ui/flat-list/index.web.js.map +1 -0
  38. package/lib/components/ui/form-control/index.web.d.ts +2071 -0
  39. package/lib/components/ui/form-control/index.web.js +290 -0
  40. package/lib/components/ui/form-control/index.web.js.map +1 -0
  41. package/lib/components/ui/image/index.web.d.ts +142 -0
  42. package/lib/components/ui/image/index.web.js +29 -0
  43. package/lib/components/ui/image/index.web.js.map +1 -0
  44. package/lib/components/ui/image-background/index.web.d.ts +8 -0
  45. package/lib/components/ui/image-background/index.web.js +23 -0
  46. package/lib/components/ui/image-background/index.web.js.map +1 -0
  47. package/lib/components/ui/input/index.web.d.ts +163 -0
  48. package/lib/components/ui/input/index.web.js +50 -0
  49. package/lib/components/ui/input/index.web.js.map +1 -0
  50. package/lib/components/ui/input-accessory-view/index.web.d.ts +9 -0
  51. package/lib/components/ui/input-accessory-view/index.web.js +16 -0
  52. package/lib/components/ui/input-accessory-view/index.web.js.map +1 -0
  53. package/lib/components/ui/keyboard-avoiding-view/index.web.d.ts +9 -0
  54. package/lib/components/ui/keyboard-avoiding-view/index.web.js +8 -0
  55. package/lib/components/ui/keyboard-avoiding-view/index.web.js.map +1 -0
  56. package/lib/components/ui/link/index.web.d.ts +365 -0
  57. package/lib/components/ui/link/index.web.js +70 -0
  58. package/lib/components/ui/link/index.web.js.map +1 -0
  59. package/lib/components/ui/menu/index.web.d.ts +142 -0
  60. package/lib/components/ui/menu/index.web.js +83 -0
  61. package/lib/components/ui/menu/index.web.js.map +1 -0
  62. package/lib/components/ui/modal/index.web.d.ts +111 -0
  63. package/lib/components/ui/modal/index.web.js +58 -0
  64. package/lib/components/ui/modal/index.web.js.map +1 -0
  65. package/lib/components/ui/popover/index.web.d.ts +309 -0
  66. package/lib/components/ui/popover/index.web.js +184 -0
  67. package/lib/components/ui/popover/index.web.js.map +1 -0
  68. package/lib/components/ui/portal/index.web.d.ts +9 -0
  69. package/lib/components/ui/portal/index.web.js +16 -0
  70. package/lib/components/ui/portal/index.web.js.map +1 -0
  71. package/lib/components/ui/pressable/index.web.d.ts +8 -0
  72. package/lib/components/ui/pressable/index.web.js +44 -0
  73. package/lib/components/ui/pressable/index.web.js.map +1 -0
  74. package/lib/components/ui/progress/index.web.d.ts +237 -0
  75. package/lib/components/ui/progress/index.web.js +73 -0
  76. package/lib/components/ui/progress/index.web.js.map +1 -0
  77. package/lib/components/ui/radio/index.web.d.ts +224 -0
  78. package/lib/components/ui/radio/index.web.js +69 -0
  79. package/lib/components/ui/radio/index.web.js.map +1 -0
  80. package/lib/components/ui/refresh-control/index.web.d.ts +14 -0
  81. package/lib/components/ui/refresh-control/index.web.js +69 -0
  82. package/lib/components/ui/refresh-control/index.web.js.map +1 -0
  83. package/lib/components/ui/safe-area-view/index.web.d.ts +6 -0
  84. package/lib/components/ui/safe-area-view/index.web.js +10 -0
  85. package/lib/components/ui/safe-area-view/index.web.js.map +1 -0
  86. package/lib/components/ui/scroll-view/index.web.d.ts +44 -0
  87. package/lib/components/ui/scroll-view/index.web.js +41 -0
  88. package/lib/components/ui/scroll-view/index.web.js.map +1 -0
  89. package/lib/components/ui/section-list/index.web.d.ts +26 -0
  90. package/lib/components/ui/section-list/index.web.js +35 -0
  91. package/lib/components/ui/section-list/index.web.js.map +1 -0
  92. package/lib/components/ui/select/index.web.d.ts +162 -0
  93. package/lib/components/ui/select/index.web.js +51 -0
  94. package/lib/components/ui/select/index.web.js.map +1 -0
  95. package/lib/components/ui/slider/index.web.d.ts +223 -0
  96. package/lib/components/ui/slider/index.web.js +189 -0
  97. package/lib/components/ui/slider/index.web.js.map +1 -0
  98. package/lib/components/ui/spinner/index.web.d.ts +176 -0
  99. package/lib/components/ui/spinner/index.web.js +55 -0
  100. package/lib/components/ui/spinner/index.web.js.map +1 -0
  101. package/lib/components/ui/status-bar/index.web.d.ts +14 -0
  102. package/lib/components/ui/status-bar/index.web.js +7 -0
  103. package/lib/components/ui/status-bar/index.web.js.map +1 -0
  104. package/lib/components/ui/switch/index.web.d.ts +71 -0
  105. package/lib/components/ui/switch/index.web.js +27 -0
  106. package/lib/components/ui/switch/index.web.js.map +1 -0
  107. package/lib/components/ui/tabs/index.web.d.ts +351 -0
  108. package/lib/components/ui/tabs/index.web.js +120 -0
  109. package/lib/components/ui/tabs/index.web.js.map +1 -0
  110. package/lib/components/ui/textarea/index.web.d.ts +162 -0
  111. package/lib/components/ui/textarea/index.web.js +50 -0
  112. package/lib/components/ui/textarea/index.web.js.map +1 -0
  113. package/lib/components/ui/toast/index.web.d.ts +225 -0
  114. package/lib/components/ui/toast/index.web.js +80 -0
  115. package/lib/components/ui/toast/index.web.js.map +1 -0
  116. package/lib/components/ui/tooltip/index.web.d.ts +86 -0
  117. package/lib/components/ui/tooltip/index.web.js +110 -0
  118. package/lib/components/ui/tooltip/index.web.js.map +1 -0
  119. package/lib/components/ui/view/index.web.d.ts +2 -0
  120. package/lib/components/ui/view/index.web.js +7 -0
  121. package/lib/components/ui/view/index.web.js.map +1 -0
  122. package/lib/components/ui/virtualized-list/index.web.d.ts +19 -0
  123. package/lib/components/ui/virtualized-list/index.web.js +30 -0
  124. package/lib/components/ui/virtualized-list/index.web.js.map +1 -0
  125. package/lib/components/usePermissionAutoFetch.d.ts +7 -19
  126. package/lib/containers/layout/DrawerBottomNavigationConfig.d.ts +47 -47
  127. package/lib/containers/layout/DrawerConfig.d.ts +31 -31
  128. package/lib/redux/settings.d.ts +3 -9
  129. package/package.json +9 -5
  130. package/src/components/ui/accordion/index.web.tsx +294 -0
  131. package/src/components/ui/actionsheet/index.web.tsx +555 -0
  132. package/src/components/ui/alert/index.web.tsx +71 -0
  133. package/src/components/ui/alert-dialog/index.web.tsx +241 -0
  134. package/src/components/ui/avatar/index.web.tsx +150 -0
  135. package/src/components/ui/badge/index.web.tsx +188 -0
  136. package/src/components/ui/button/index.web.tsx +86 -0
  137. package/src/components/ui/checkbox/index.web.tsx +151 -0
  138. package/src/components/ui/divider/index.web.tsx +37 -0
  139. package/src/components/ui/drawer/index.web.tsx +144 -0
  140. package/src/components/ui/fab/index.web.tsx +201 -0
  141. package/src/components/ui/flat-list/index.web.tsx +89 -0
  142. package/src/components/ui/form-control/index.web.tsx +451 -0
  143. package/src/components/ui/image/index.web.tsx +43 -0
  144. package/src/components/ui/image-background/index.web.tsx +43 -0
  145. package/src/components/ui/input/index.web.tsx +80 -0
  146. package/src/components/ui/input-accessory-view/index.web.tsx +31 -0
  147. package/src/components/ui/keyboard-avoiding-view/index.web.tsx +23 -0
  148. package/src/components/ui/link/index.web.tsx +103 -0
  149. package/src/components/ui/menu/index.web.tsx +159 -0
  150. package/src/components/ui/modal/index.web.tsx +135 -0
  151. package/src/components/ui/popover/index.web.tsx +326 -0
  152. package/src/components/ui/portal/index.web.tsx +34 -0
  153. package/src/components/ui/pressable/index.web.tsx +73 -0
  154. package/src/components/ui/progress/index.web.tsx +123 -0
  155. package/src/components/ui/radio/index.web.tsx +130 -0
  156. package/src/components/ui/refresh-control/index.web.tsx +104 -0
  157. package/src/components/ui/safe-area-view/index.web.tsx +24 -0
  158. package/src/components/ui/scroll-view/index.web.tsx +142 -0
  159. package/src/components/ui/section-list/index.web.tsx +93 -0
  160. package/src/components/ui/select/index.web.tsx +83 -0
  161. package/src/components/ui/slider/index.web.tsx +283 -0
  162. package/src/components/ui/spinner/index.web.tsx +81 -0
  163. package/src/components/ui/status-bar/index.web.tsx +20 -0
  164. package/src/components/ui/switch/index.web.tsx +44 -0
  165. package/src/components/ui/tabs/index.web.tsx +205 -0
  166. package/src/components/ui/textarea/index.web.tsx +86 -0
  167. package/src/components/ui/toast/index.web.tsx +132 -0
  168. package/src/components/ui/tooltip/index.web.tsx +155 -0
  169. package/src/components/ui/view/index.web.tsx +15 -0
  170. package/src/components/ui/virtualized-list/index.web.tsx +84 -0
@@ -0,0 +1,224 @@
1
+ import React from 'react';
2
+ import type { VariantProps } from '@gluestack-ui/nativewind-utils';
3
+ declare const radioStyle: import("@gluestack-ui/nativewind-utils/types").TVReturnType<{
4
+ size: {
5
+ sm: string;
6
+ md: string;
7
+ lg: string;
8
+ };
9
+ status: {
10
+ error: string;
11
+ success: string;
12
+ warning: string;
13
+ };
14
+ } | ({
15
+ size: {
16
+ sm: string;
17
+ md: string;
18
+ lg: string;
19
+ };
20
+ status: {
21
+ error: string;
22
+ success: string;
23
+ warning: string;
24
+ };
25
+ } & {
26
+ size: {
27
+ sm: import("tailwind-merge").ClassNameValue | {
28
+ base?: import("tailwind-merge").ClassNameValue;
29
+ };
30
+ md: import("tailwind-merge").ClassNameValue | {
31
+ base?: import("tailwind-merge").ClassNameValue;
32
+ };
33
+ lg: import("tailwind-merge").ClassNameValue | {
34
+ base?: import("tailwind-merge").ClassNameValue;
35
+ };
36
+ };
37
+ status: {
38
+ error: import("tailwind-merge").ClassNameValue | {
39
+ base?: import("tailwind-merge").ClassNameValue;
40
+ };
41
+ success: import("tailwind-merge").ClassNameValue | {
42
+ base?: import("tailwind-merge").ClassNameValue;
43
+ };
44
+ warning: import("tailwind-merge").ClassNameValue | {
45
+ base?: import("tailwind-merge").ClassNameValue;
46
+ };
47
+ };
48
+ }), undefined, "form-radio h-4 w-4 text-blue-600 transition duration-150 ease-in-out", import("tailwind-variants/dist/config").TVConfig<{
49
+ size: {
50
+ sm: string;
51
+ md: string;
52
+ lg: string;
53
+ };
54
+ status: {
55
+ error: string;
56
+ success: string;
57
+ warning: string;
58
+ };
59
+ }, {
60
+ size: {
61
+ sm: string;
62
+ md: string;
63
+ lg: string;
64
+ };
65
+ status: {
66
+ error: string;
67
+ success: string;
68
+ warning: string;
69
+ };
70
+ }>, {
71
+ size: {
72
+ sm: string;
73
+ md: string;
74
+ lg: string;
75
+ };
76
+ status: {
77
+ error: string;
78
+ success: string;
79
+ warning: string;
80
+ };
81
+ }, undefined, import("@gluestack-ui/nativewind-utils/types").TVReturnType<{
82
+ size: {
83
+ sm: string;
84
+ md: string;
85
+ lg: string;
86
+ };
87
+ status: {
88
+ error: string;
89
+ success: string;
90
+ warning: string;
91
+ };
92
+ }, undefined, "form-radio h-4 w-4 text-blue-600 transition duration-150 ease-in-out", import("tailwind-variants/dist/config").TVConfig<{
93
+ size: {
94
+ sm: string;
95
+ md: string;
96
+ lg: string;
97
+ };
98
+ status: {
99
+ error: string;
100
+ success: string;
101
+ warning: string;
102
+ };
103
+ }, {
104
+ size: {
105
+ sm: string;
106
+ md: string;
107
+ lg: string;
108
+ };
109
+ status: {
110
+ error: string;
111
+ success: string;
112
+ warning: string;
113
+ };
114
+ }>, unknown, unknown, undefined>>;
115
+ declare const labelStyle: import("@gluestack-ui/nativewind-utils/types").TVReturnType<{
116
+ size: {
117
+ sm: string;
118
+ md: string;
119
+ lg: string;
120
+ };
121
+ disabled: {
122
+ true: string;
123
+ };
124
+ } | ({
125
+ size: {
126
+ sm: string;
127
+ md: string;
128
+ lg: string;
129
+ };
130
+ disabled: {
131
+ true: string;
132
+ };
133
+ } & {
134
+ size: {
135
+ sm: import("tailwind-merge").ClassNameValue | {
136
+ base?: import("tailwind-merge").ClassNameValue;
137
+ };
138
+ md: import("tailwind-merge").ClassNameValue | {
139
+ base?: import("tailwind-merge").ClassNameValue;
140
+ };
141
+ lg: import("tailwind-merge").ClassNameValue | {
142
+ base?: import("tailwind-merge").ClassNameValue;
143
+ };
144
+ };
145
+ disabled: {
146
+ true: import("tailwind-merge").ClassNameValue | {
147
+ base?: import("tailwind-merge").ClassNameValue;
148
+ };
149
+ };
150
+ }), undefined, "ml-2 select-none", import("tailwind-variants/dist/config").TVConfig<{
151
+ size: {
152
+ sm: string;
153
+ md: string;
154
+ lg: string;
155
+ };
156
+ disabled: {
157
+ true: string;
158
+ };
159
+ }, {
160
+ size: {
161
+ sm: string;
162
+ md: string;
163
+ lg: string;
164
+ };
165
+ disabled: {
166
+ true: string;
167
+ };
168
+ }>, {
169
+ size: {
170
+ sm: string;
171
+ md: string;
172
+ lg: string;
173
+ };
174
+ disabled: {
175
+ true: string;
176
+ };
177
+ }, undefined, import("@gluestack-ui/nativewind-utils/types").TVReturnType<{
178
+ size: {
179
+ sm: string;
180
+ md: string;
181
+ lg: string;
182
+ };
183
+ disabled: {
184
+ true: string;
185
+ };
186
+ }, undefined, "ml-2 select-none", import("tailwind-variants/dist/config").TVConfig<{
187
+ size: {
188
+ sm: string;
189
+ md: string;
190
+ lg: string;
191
+ };
192
+ disabled: {
193
+ true: string;
194
+ };
195
+ }, {
196
+ size: {
197
+ sm: string;
198
+ md: string;
199
+ lg: string;
200
+ };
201
+ disabled: {
202
+ true: string;
203
+ };
204
+ }>, unknown, unknown, undefined>>;
205
+ type RadioGroupContextType = {
206
+ value?: string;
207
+ onChange?: (value: string) => void;
208
+ name?: string;
209
+ size?: VariantProps<typeof radioStyle>['size'];
210
+ status?: VariantProps<typeof radioStyle>['status'];
211
+ };
212
+ export declare const RadioGroup: React.ForwardRefExoticComponent<Omit<React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement> & RadioGroupContextType, "ref"> & React.RefAttributes<HTMLDivElement>>;
213
+ export declare const RadioLabel: React.ForwardRefExoticComponent<Omit<React.ClassAttributes<HTMLLabelElement> & React.LabelHTMLAttributes<HTMLLabelElement> & {
214
+ size?: VariantProps<typeof labelStyle>["size"];
215
+ disabled?: boolean;
216
+ }, "ref"> & React.RefAttributes<HTMLLabelElement>>;
217
+ export declare const RadioIcon: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
218
+ type IRadioProps = Omit<React.ComponentProps<'input'>, 'size'> & {
219
+ value: string;
220
+ size?: VariantProps<typeof radioStyle>['size'];
221
+ status?: VariantProps<typeof radioStyle>['status'];
222
+ };
223
+ declare const Radio: React.ForwardRefExoticComponent<Omit<IRadioProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
224
+ export { Radio };
@@ -0,0 +1,69 @@
1
+ 'use client';
2
+ import React, { forwardRef, createContext, useContext } from 'react';
3
+ import { tva } from '@gluestack-ui/nativewind-utils/tva';
4
+ const SCOPE = 'RADIO';
5
+ const radioStyle = tva({
6
+ base: 'form-radio h-4 w-4 text-blue-600 transition duration-150 ease-in-out',
7
+ variants: {
8
+ size: {
9
+ sm: 'h-3 w-3',
10
+ md: 'h-4 w-4',
11
+ lg: 'h-5 w-5',
12
+ },
13
+ status: {
14
+ error: 'border-red-500 focus:border-red-500 focus:ring-red-500',
15
+ success: 'border-green-500 focus:border-green-500 focus:ring-green-500',
16
+ warning: 'border-yellow-500 focus:border-yellow-500 focus:ring-yellow-500',
17
+ },
18
+ },
19
+ defaultVariants: {
20
+ size: 'md',
21
+ },
22
+ });
23
+ const labelStyle = tva({
24
+ base: 'ml-2 select-none',
25
+ variants: {
26
+ size: {
27
+ sm: 'text-sm',
28
+ md: 'text-base',
29
+ lg: 'text-lg',
30
+ },
31
+ disabled: {
32
+ true: 'opacity-50 cursor-not-allowed',
33
+ },
34
+ },
35
+ defaultVariants: {
36
+ size: 'md',
37
+ },
38
+ });
39
+ const RadioGroupContext = createContext({});
40
+ export const RadioGroup = forwardRef(({ value, onChange, name, size, status, ...props }, ref) => {
41
+ return (React.createElement(RadioGroupContext.Provider, { value: { value, onChange, name, size, status } },
42
+ React.createElement("div", { ref: ref, role: "radiogroup", ...props })));
43
+ });
44
+ RadioGroup.displayName = 'RadioGroup';
45
+ export const RadioLabel = forwardRef(({ className, size, disabled, ...props }, ref) => {
46
+ return React.createElement("label", { ref: ref, className: labelStyle({ size, disabled, class: className }), ...props });
47
+ });
48
+ RadioLabel.displayName = 'RadioLabel';
49
+ export const RadioIcon = forwardRef(({ className, children, ...props }, ref) => {
50
+ return (React.createElement("div", { ref: ref, className: `flex items-center justify-center ${className || ''}`, ...props }, children));
51
+ });
52
+ RadioIcon.displayName = 'RadioIcon';
53
+ const Radio = forwardRef(({ className, value, size: itemSize, status: itemStatus, onChange, ...props }, ref) => {
54
+ const group = useContext(RadioGroupContext);
55
+ const size = itemSize || group.size;
56
+ const status = itemStatus || group.status;
57
+ const handleChange = (e) => {
58
+ if (onChange) {
59
+ onChange(e);
60
+ }
61
+ if (group.onChange) {
62
+ group.onChange(e.target.value);
63
+ }
64
+ };
65
+ return (React.createElement("input", { ref: ref, type: "radio", value: value, checked: group.value === value, name: group.name, onChange: handleChange, className: radioStyle({ size, status, class: className }), ...props }));
66
+ });
67
+ Radio.displayName = 'Radio';
68
+ export { Radio };
69
+ //# sourceMappingURL=index.web.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.web.js","sourceRoot":"","sources":["../../../../src/components/ui/radio/index.web.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;AACb,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACrE,OAAO,EAAE,GAAG,EAAE,MAAM,oCAAoC,CAAC;AAKzD,MAAM,KAAK,GAAG,OAAO,CAAC;AAEtB,MAAM,UAAU,GAAG,GAAG,CAAC;IACnB,IAAI,EAAE,sEAAsE;IAC5E,QAAQ,EAAE;QACN,IAAI,EAAE;YACF,EAAE,EAAE,SAAS;YACb,EAAE,EAAE,SAAS;YACb,EAAE,EAAE,SAAS;SAChB;QACD,MAAM,EAAE;YACJ,KAAK,EAAE,wDAAwD;YAC/D,OAAO,EAAE,8DAA8D;YACvE,OAAO,EAAE,iEAAiE;SAC7E;KACJ;IACD,eAAe,EAAE;QACb,IAAI,EAAE,IAAI;KACb;CACJ,CAAC,CAAC;AAEH,MAAM,UAAU,GAAG,GAAG,CAAC;IACnB,IAAI,EAAE,kBAAkB;IACxB,QAAQ,EAAE;QACN,IAAI,EAAE;YACF,EAAE,EAAE,SAAS;YACb,EAAE,EAAE,WAAW;YACf,EAA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4
+ onRefresh?: () => void;
5
+ progressViewOffset?: number;
6
+ tintColor?: string;
7
+ title?: string;
8
+ titleColor?: string;
9
+ colors?: string[];
10
+ enabled?: boolean;
11
+ style?: React.CSSProperties;
12
+ }
13
+ export declare const RefreshControl: React.FC<RefreshControlProps>;
14
+ export {};
@@ -0,0 +1,69 @@
1
+ 'use client';
2
+ import React, { useEffect, useState } from 'react';
3
+ export const RefreshControl = ({ refreshing = false, onRefresh, style, ...props }) => {
4
+ const [startY, setStartY] = useState(0);
5
+ const [pulling, setPulling] = useState(false);
6
+ const [pullDistance, setPullDistance] = useState(0);
7
+ const threshold = 100; // Minimum pull distance to trigger refresh
8
+ useEffect(() => {
9
+ if (!refreshing) {
10
+ setPullDistance(0);
11
+ setPulling(false);
12
+ }
13
+ }, [refreshing]);
14
+ const handleTouchStart = (e) => {
15
+ if (window.scrollY === 0) {
16
+ setStartY(e.touches[0].clientY);
17
+ setPulling(true);
18
+ }
19
+ };
20
+ const handleTouchMove = (e) => {
21
+ if (pulling && !refreshing) {
22
+ const currentY = e.touches[0].clientY;
23
+ const distance = Math.max(0, currentY - startY);
24
+ setPullDistance(Math.min(distance * 0.5, threshold * 1.5)); // Add resistance
25
+ }
26
+ };
27
+ const handleTouchEnd = () => {
28
+ if (pulling && pullDistance >= threshold && onRefresh) {
29
+ onRefresh();
30
+ }
31
+ if (!refreshing) {
32
+ setPullDistance(0);
33
+ }
34
+ setPulling(false);
35
+ };
36
+ return (React.createElement("div", { style: {
37
+ position: 'relative',
38
+ width: '100%',
39
+ ...style,
40
+ }, onTouchStart: handleTouchStart, onTouchMove: handleTouchMove, onTouchEnd: handleTouchEnd },
41
+ (pulling || refreshing) && (React.createElement("div", { style: {
42
+ position: 'absolute',
43
+ top: 0,
44
+ left: 0,
45
+ right: 0,
46
+ display: 'flex',
47
+ justifyContent: 'center',
48
+ alignItems: 'center',
49
+ height: Math.max(pullDistance, refreshing ? 50 : 0),
50
+ transition: pulling ? 'none' : 'height 0.2s ease-out',
51
+ overflow: 'hidden',
52
+ } },
53
+ React.createElement("div", { style: {
54
+ width: '20px',
55
+ height: '20px',
56
+ border: '2px solid #ccc',
57
+ borderTopColor: props.tintColor || '#000',
58
+ borderRadius: '50%',
59
+ animation: refreshing ? 'spin 1s linear infinite' : 'none',
60
+ transform: !refreshing ? `rotate(${(pullDistance / threshold) * 360}deg)` : undefined,
61
+ } }))),
62
+ React.createElement("style", null, `
63
+ @keyframes spin {
64
+ 0% { transform: rotate(0deg); }
65
+ 100% { transform: rotate(360deg); }
66
+ }
67
+ `)));
68
+ };
69
+ //# sourceMappingURL=index.web.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.web.js","sourceRoot":"","sources":["../../../../src/components/ui/refresh-control/index.web.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAcnD,MAAM,CAAC,MAAM,cAAc,GAAkC,CAAC,EAAE,UAAU,GAAG,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE;IAChH,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IACxC,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC9C,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IACpD,MAAM,SAAS,GAAG,GAAG,CAAC,CAAC,2CAA2C;IAElE,SAAS,CAAC,GAAG,EAAE;QACX,IAAI,CAAC,UAAU,EAAE,CAAC;YACd,eAAe,CAAC,CAAC,CAAC,CAAC;YACnB,UAAU,CAAC,KAAK,CAAC,CAAC;QACtB,CAAC;IACL,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;IAEjB,MAAM,gBAAgB,GAAG,CAAC,CAAmB,EA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,EAAE,CAAC;gBACR,OAAO,EAAE,MAAM;gBACf,cAAc,EAAE,QAAQ;gBACxB,UAAU,EAAE,QAAQ;gBACpB,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;gBACnD,UAAU,EAAE,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,sBAAsB;gBACrD,QAAQ,EAAE,QAAQ;aACrB;YAED,6BACI,KAAK,EAAE;oBACH,KAAK,EAAE,MAAM;oBACb,MAAM,EAAE,MAAM;oBACd,MAAM,EAAE,gBAAgB;oBACxB,cAAc,EAAE,KAAK,CAAC,SAAS,IAAI,MAAM;oBACzC,YAAY,EAAE,KAAK;oBACnB,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC,yBAAyB,CAAC,CAAC,CAAC,MAAM;oBAC1D,SAAS,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,YAAY,GAAG,SAAS,CAAC,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,SAAS;iBACxF,GACH,CACA,CACT;QACD,mCACK;;;;;SAKR,CACW,CACN,CACT,CAAC;AACN,CAAC,CAAC"}
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import type { VariantProps } from '@gluestack-ui/nativewind-utils';
3
+ export declare const StyledSafeAreaView: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & VariantProps<import("@gluestack-ui/nativewind-utils/types").TVReturnType<{} | {}, undefined, "" | "flex flex-col relative z-0 box-border border-0 list-none min-w-0 min-h-0 bg-transparent items-stretch m-0 p-0 text-decoration-none", import("tailwind-variants/dist/config").TVConfig<unknown, unknown>, unknown, undefined, import("@gluestack-ui/nativewind-utils/types").TVReturnType<unknown, undefined, "" | "flex flex-col relative z-0 box-border border-0 list-none min-w-0 min-h-0 bg-transparent items-stretch m-0 p-0 text-decoration-none", import("tailwind-variants/dist/config").TVConfig<unknown, unknown>, unknown, unknown, undefined>>> & {
4
+ className?: string;
5
+ } & React.RefAttributes<HTMLDivElement>>;
6
+ export { StyledSafeAreaView as SafeAreaView };
@@ -0,0 +1,10 @@
1
+ 'use client';
2
+ import React, { forwardRef } from 'react';
3
+ import { clsx } from 'clsx';
4
+ import { safeAreaStyle } from './styles';
5
+ export const StyledSafeAreaView = forwardRef(({ className, children, ...props }, ref) => {
6
+ return (React.createElement("div", { ...props, ref: ref, className: safeAreaStyle({ class: clsx(className) }) }, children));
7
+ });
8
+ StyledSafeAreaView.displayName = 'StyledSafeAreaView';
9
+ export { StyledSafeAreaView as SafeAreaView };
10
+ //# sourceMappingURL=index.web.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.web.js","sourceRoot":"","sources":["../../../../src/components/ui/safe-area-view/index.web.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;AACb,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAOzC,MAAM,CAAC,MAAM,kBAAkB,GAAG,UAAU,CACxC,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE;IACvC,OAAO,CACH,gCAAS,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,aAAa,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,IACzE,QAAQ,CACP,CACT,CAAC;AACN,CAAC,CACJ,CAAC;AAEF,kBAAkB,CAAC,WAAW,GAAG,oBAAoB,CAAC;AAEtD,OAAO,EAAE,kBAAkB,IAAI,YAAY,EAAE,CAAC"}
@@ -0,0 +1,44 @@
1
+ import React from 'react';
2
+ export declare const ScrollView: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
3
+ horizontal?: boolean;
4
+ className?: string;
5
+ contentContainerStyle?: React.CSSProperties;
6
+ showsHorizontalScrollIndicator?: boolean;
7
+ showsVerticalScrollIndicator?: boolean;
8
+ } & React.RefAttributes<HTMLDivElement>>;
9
+ type FlatListProps<T> = {
10
+ data: T[];
11
+ renderItem: ({ item, index }: {
12
+ item: T;
13
+ index: number;
14
+ }) => React.ReactNode;
15
+ keyExtractor?: (item: T, index: number) => string;
16
+ horizontal?: boolean;
17
+ className?: string;
18
+ contentContainerStyle?: React.CSSProperties;
19
+ showsHorizontalScrollIndicator?: boolean;
20
+ showsVerticalScrollIndicator?: boolean;
21
+ };
22
+ export declare function FlatList<T>({ data, renderItem, keyExtractor, horizontal, className, contentContainerStyle, showsHorizontalScrollIndicator, showsVerticalScrollIndicator, ...props }: FlatListProps<T>): React.JSX.Element;
23
+ type SectionListProps<T, S> = {
24
+ sections: Array<{
25
+ title: string;
26
+ data: T[];
27
+ }>;
28
+ renderItem: ({ item, index }: {
29
+ item: T;
30
+ index: number;
31
+ }) => React.ReactNode;
32
+ renderSectionHeader?: ({ section }: {
33
+ section: {
34
+ title: string;
35
+ data: T[];
36
+ };
37
+ }) => React.ReactNode;
38
+ keyExtractor?: (item: T, index: number) => string;
39
+ className?: string;
40
+ contentContainerStyle?: React.CSSProperties;
41
+ };
42
+ export declare function SectionList<T, S>({ sections, renderItem, renderSectionHeader, keyExtractor, className, contentContainerStyle, ...props }: SectionListProps<T, S>): React.JSX.Element;
43
+ export declare const VirtualizedList: typeof FlatList;
44
+ export {};
@@ -0,0 +1,41 @@
1
+ 'use client';
2
+ import React, { forwardRef } from 'react';
3
+ import { tva } from '@gluestack-ui/nativewind-utils/tva';
4
+ import { clsx } from 'clsx';
5
+ // Styles for scroll containers
6
+ const scrollContainerStyle = tva({
7
+ base: 'overflow-auto',
8
+ variants: {
9
+ horizontal: {
10
+ true: 'overflow-x-auto overflow-y-hidden whitespace-nowrap',
11
+ },
12
+ vertical: {
13
+ true: 'overflow-y-auto overflow-x-hidden',
14
+ },
15
+ },
16
+ });
17
+ export const ScrollView = forwardRef(({ horizontal, className, contentContainerStyle, showsHorizontalScrollIndicator = true, showsVerticalScrollIndicator = true, children, style, ...props }, ref) => {
18
+ return (React.createElement("div", { ref: ref, className: scrollContainerStyle({
19
+ horizontal,
20
+ vertical: !horizontal,
21
+ class: clsx(className),
22
+ }), style: {
23
+ ...style,
24
+ overflowX: !showsHorizontalScrollIndicator ? 'hidden' : undefined,
25
+ overflowY: !showsVerticalScrollIndicator ? 'hidden' : undefined,
26
+ }, ...props },
27
+ React.createElement("div", { style: contentContainerStyle }, children)));
28
+ });
29
+ ScrollView.displayName = 'ScrollView';
30
+ export function FlatList({ data, renderItem, keyExtractor, horizontal, className, contentContainerStyle, showsHorizontalScrollIndicator, showsVerticalScrollIndicator, ...props }) {
31
+ return (React.createElement(ScrollView, { horizontal: horizontal, className: className, contentContainerStyle: contentContainerStyle, showsHorizontalScrollIndicator: showsHorizontalScrollIndicator, showsVerticalScrollIndicator: showsVerticalScrollIndicator, ...props }, data.map((item, index) => (React.createElement(React.Fragment, { key: keyExtractor ? keyExtractor(item, index) : index }, renderItem({ item, index }))))));
32
+ }
33
+ export function SectionList({ sections, renderItem, renderSectionHeader, keyExtractor, className, contentContainerStyle, ...props }) {
34
+ return (React.createElement(ScrollView, { className: className, contentContainerStyle: contentContainerStyle, ...props }, sections.map((section, sectionIndex) => (React.createElement(React.Fragment, { key: `section-${sectionIndex}` },
35
+ renderSectionHeader?.({ section }),
36
+ section.data.map((item, index) => (React.createElement(React.Fragment, { key: keyExtractor ? keyExtractor(item, index) : index }, renderItem({ item, index })))))))));
37
+ }
38
+ // VirtualizedList is an alias for FlatList in web implementation
39
+ // since we're not implementing actual virtualization in this basic version
40
+ export const VirtualizedList = FlatList;
41
+ //# sourceMappingURL=index.web.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.web.js","sourceRoot":"","sources":["../../../../src/components/ui/scroll-view/index.web.tsx"],"names":[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CACpB,CAAC,CACW,CACpB,CAAC,CACO,CAChB,CAAC;AACN,CAAC;AAED,iEAAiE;AACjE,2EAA2E;AAC3E,MAAM,CAAC,MAAM,eAAe,GAAG,QAAQ,CAAC"}
@@ -0,0 +1,26 @@
1
+ import React from 'react';
2
+ interface SectionBase {
3
+ title: string;
4
+ }
5
+ interface SectionListProps<ItemT, SectionT extends SectionBase> {
6
+ sections: ReadonlyArray<SectionT & {
7
+ data: ReadonlyArray<ItemT>;
8
+ }>;
9
+ renderItem: ({ item, index }: {
10
+ item: ItemT;
11
+ index: number;
12
+ }) => React.ReactElement;
13
+ renderSectionHeader?: ({ section }: {
14
+ section: SectionT;
15
+ }) => React.ReactElement;
16
+ keyExtractor?: (item: ItemT, index: number) => string;
17
+ className?: string;
18
+ contentContainerStyle?: React.CSSProperties;
19
+ onEndReached?: () => void;
20
+ onEndReachedThreshold?: number;
21
+ stickySectionHeadersEnabled?: boolean;
22
+ }
23
+ declare const SectionList: <ItemT, SectionT extends SectionBase>(props: SectionListProps<ItemT, SectionT> & {
24
+ ref?: React.Ref<HTMLDivElement>;
25
+ }) => React.ReactElement;
26
+ export { SectionList };
@@ -0,0 +1,35 @@
1
+ 'use client';
2
+ import React from 'react';
3
+ import { tva } from '@gluestack-ui/nativewind-utils/tva';
4
+ import { ScrollView } from '../scroll-view/index.web';
5
+ const sectionListStyle = tva({
6
+ base: 'flex flex-col',
7
+ });
8
+ const sectionHeaderStyle = tva({
9
+ base: 'font-bold text-lg py-2 bg-gray-100',
10
+ });
11
+ function SectionListComponent({ sections, renderItem, renderSectionHeader, keyExtractor, className, contentContainerStyle, onEndReached, onEndReachedThreshold = 0.5, stickySectionHeadersEnabled = false, ...props }, ref) {
12
+ const handleScroll = (event) => {
13
+ if (!onEndReached)
14
+ return;
15
+ const target = event.target;
16
+ const scrollPosition = target.scrollTop + target.clientHeight;
17
+ const scrollSize = target.scrollHeight;
18
+ const threshold = scrollSize * onEndReachedThreshold;
19
+ if (scrollSize - scrollPosition <= threshold) {
20
+ onEndReached();
21
+ }
22
+ };
23
+ const defaultSectionHeader = (section) => React.createElement("div", { className: sectionHeaderStyle() }, section.title);
24
+ return (React.createElement(ScrollView, { ref: ref, className: className, onScroll: handleScroll, ...props },
25
+ React.createElement("div", { className: sectionListStyle(), style: contentContainerStyle }, sections.map((section, sectionIndex) => (React.createElement("div", { key: `section-${sectionIndex}` },
26
+ React.createElement("div", { style: {
27
+ position: stickySectionHeadersEnabled ? 'sticky' : 'relative',
28
+ top: stickySectionHeadersEnabled ? 0 : undefined,
29
+ zIndex: stickySectionHeadersEnabled ? 1 : undefined,
30
+ } }, renderSectionHeader ? renderSectionHeader({ section }) : defaultSectionHeader(section)),
31
+ section.data.map((item, index) => (React.createElement(React.Fragment, { key: keyExtractor ? keyExtractor(item, index) : `${sectionIndex}-${index}` }, renderItem({ item, index }))))))))));
32
+ }
33
+ const SectionList = React.forwardRef(SectionListComponent);
34
+ export { SectionList };
35
+ //# sourceMappingURL=index.web.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.web.js","sourceRoot":"","sources":["../../../../src/components/ui/section-list/index.web.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;AACb,OAAO,KAAqB,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,GAAG,EAAE,MAAM,oCAAoC,CAAC;AAIzD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEtD,MAAM,gBAAgB,GAAG,GAAG,CAAC;IACzB,IAAI,EAAE,eAAe;CACxB,CAAC,CAAC;AAEH,MAAM,kBAAkB,GAAG,GAAG,CAAC;IAC3B,IAAI,EAAE,oCAAoC;CAC7C,CAAC,CAAC;AAkBH,SAAS,oBAAoB,CACzB,EACI,QAAQ,EACR,UAAU,EACV,mBAAmB,EACnB,YAAY,EACZ,SAAS,EACT,qBAAqB,EACrB,YAAY,EACZ,qBAAqB,GAAG,GAAG,EAC3B,2BAA2B,GAAG,KAAK,EACnC,GAAG,KAAK,EACwB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