@admin-layout/gluestack-ui-mobile 10.0.9-alpha.42 → 10.0.9-alpha.53

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 (166) hide show
  1. package/CHANGELOG.md +8 -0
  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/package.json +8 -4
  126. package/src/components/ui/accordion/index.web.tsx +294 -0
  127. package/src/components/ui/actionsheet/index.web.tsx +555 -0
  128. package/src/components/ui/alert/index.web.tsx +71 -0
  129. package/src/components/ui/alert-dialog/index.web.tsx +241 -0
  130. package/src/components/ui/avatar/index.web.tsx +150 -0
  131. package/src/components/ui/badge/index.web.tsx +188 -0
  132. package/src/components/ui/button/index.web.tsx +86 -0
  133. package/src/components/ui/checkbox/index.web.tsx +151 -0
  134. package/src/components/ui/divider/index.web.tsx +37 -0
  135. package/src/components/ui/drawer/index.web.tsx +144 -0
  136. package/src/components/ui/fab/index.web.tsx +201 -0
  137. package/src/components/ui/flat-list/index.web.tsx +89 -0
  138. package/src/components/ui/form-control/index.web.tsx +451 -0
  139. package/src/components/ui/image/index.web.tsx +43 -0
  140. package/src/components/ui/image-background/index.web.tsx +43 -0
  141. package/src/components/ui/input/index.web.tsx +80 -0
  142. package/src/components/ui/input-accessory-view/index.web.tsx +31 -0
  143. package/src/components/ui/keyboard-avoiding-view/index.web.tsx +23 -0
  144. package/src/components/ui/link/index.web.tsx +103 -0
  145. package/src/components/ui/menu/index.web.tsx +159 -0
  146. package/src/components/ui/modal/index.web.tsx +135 -0
  147. package/src/components/ui/popover/index.web.tsx +326 -0
  148. package/src/components/ui/portal/index.web.tsx +34 -0
  149. package/src/components/ui/pressable/index.web.tsx +73 -0
  150. package/src/components/ui/progress/index.web.tsx +123 -0
  151. package/src/components/ui/radio/index.web.tsx +130 -0
  152. package/src/components/ui/refresh-control/index.web.tsx +104 -0
  153. package/src/components/ui/safe-area-view/index.web.tsx +24 -0
  154. package/src/components/ui/scroll-view/index.web.tsx +142 -0
  155. package/src/components/ui/section-list/index.web.tsx +93 -0
  156. package/src/components/ui/select/index.web.tsx +83 -0
  157. package/src/components/ui/slider/index.web.tsx +283 -0
  158. package/src/components/ui/spinner/index.web.tsx +81 -0
  159. package/src/components/ui/status-bar/index.web.tsx +20 -0
  160. package/src/components/ui/switch/index.web.tsx +44 -0
  161. package/src/components/ui/tabs/index.web.tsx +205 -0
  162. package/src/components/ui/textarea/index.web.tsx +86 -0
  163. package/src/components/ui/toast/index.web.tsx +132 -0
  164. package/src/components/ui/tooltip/index.web.tsx +155 -0
  165. package/src/components/ui/view/index.web.tsx +15 -0
  166. package/src/components/ui/virtualized-list/index.web.tsx +84 -0
@@ -0,0 +1,294 @@
1
+ 'use client';
2
+ import React from 'react';
3
+ import { createAccordion } from '@gluestack-ui/accordion';
4
+ import { tva } from '@gluestack-ui/nativewind-utils/tva';
5
+ import type { VariantProps } from '@gluestack-ui/nativewind-utils';
6
+ import { withStyleContext, useStyleContext } from '@gluestack-ui/nativewind-utils/withStyleContext';
7
+ import { UIIcon } from '@gluestack-ui/icon';
8
+
9
+ const SCOPE = 'ACCORDION';
10
+
11
+ /** Styles */
12
+ const accordionStyle = tva({
13
+ base: 'w-full',
14
+ variants: {
15
+ variant: {
16
+ filled: 'bg-white shadow-hard-2',
17
+ unfilled: '',
18
+ },
19
+ size: {
20
+ sm: '',
21
+ md: '',
22
+ lg: '',
23
+ },
24
+ },
25
+ });
26
+
27
+ const accordionItemStyle = tva({
28
+ base: '',
29
+ parentVariants: {
30
+ variant: {
31
+ filled: 'bg-background-0',
32
+ unfilled: 'bg-transparent',
33
+ },
34
+ },
35
+ });
36
+
37
+ const accordionTitleTextStyle = tva({
38
+ base: 'text-typography-900 font-bold flex-1 text-left',
39
+ parentVariants: {
40
+ size: {
41
+ sm: 'text-sm',
42
+ md: 'text-base',
43
+ lg: 'text-lg',
44
+ },
45
+ },
46
+ });
47
+
48
+ const accordionIconStyle = tva({
49
+ base: 'text-typography-900 fill-none',
50
+ parentVariants: {
51
+ size: {
52
+ '2xs': 'h-3 w-3',
53
+ xs: 'h-3.5 w-3.5',
54
+ sm: 'h-4 w-4',
55
+ md: 'h-[18px] w-[18px]',
56
+ lg: 'h-5 w-5',
57
+ xl: 'h-6 w-6',
58
+ },
59
+ },
60
+ });
61
+
62
+ const accordionContentTextStyle = tva({
63
+ base: 'text-typography-700 font-normal',
64
+ parentVariants: {
65
+ size: {
66
+ sm: 'text-sm',
67
+ md: 'text-base',
68
+ lg: 'text-lg',
69
+ },
70
+ },
71
+ });
72
+
73
+ const accordionHeaderStyle = tva({
74
+ base: 'mx-0 my-0',
75
+ });
76
+
77
+ const accordionContentStyle = tva({
78
+ base: 'pt-1 pb-3 px-4',
79
+ });
80
+
81
+ const accordionTriggerStyle = tva({
82
+ base: 'w-full flex-row justify-between items-center outline-none focus:outline-none data-[disabled=true]:opacity-40 data-[disabled=true]:cursor-not-allowed data-[focus-visible=true]:bg-background-50 py-3 px-4',
83
+ });
84
+
85
+ // Create web-specific components
86
+ const RootComponent = withStyleContext('div' as any, SCOPE);
87
+ const ItemComponent = React.forwardRef((props: any, ref) => <div {...props} ref={ref} />);
88
+ const HeaderComponent = React.forwardRef((props: any, ref) => <h3 {...props} ref={ref} />);
89
+ const TriggerComponent = React.forwardRef((props: any, ref) => <button {...props} ref={ref} />);
90
+ const TitleTextComponent = React.forwardRef((props: any, ref) => <span {...props} ref={ref} />);
91
+ const ContentTextComponent = React.forwardRef((props: any, ref) => <p {...props} ref={ref} />);
92
+ const ContentComponent = React.forwardRef((props: any, ref) => <div {...props} ref={ref} />);
93
+
94
+ /** Creator */
95
+ const UIAccordion = createAccordion({
96
+ Root: RootComponent,
97
+ Item: ItemComponent,
98
+ Header: HeaderComponent,
99
+ Trigger: TriggerComponent,
100
+ Icon: UIIcon,
101
+ TitleText: TitleTextComponent,
102
+ ContentText: ContentTextComponent,
103
+ Content: ContentComponent,
104
+ });
105
+
106
+ type StyleContextType = {
107
+ variant?: 'filled' | 'unfilled';
108
+ size?: 'sm' | 'md' | 'lg';
109
+ };
110
+
111
+ type IAccordionProps = React.ComponentPropsWithoutRef<typeof UIAccordion> &
112
+ VariantProps<typeof accordionStyle> & {
113
+ context?: StyleContextType;
114
+ };
115
+
116
+ type IAccordionItemProps = React.ComponentPropsWithoutRef<typeof UIAccordion.Item> &
117
+ VariantProps<typeof accordionItemStyle>;
118
+
119
+ type IAccordionContentProps = React.ComponentPropsWithoutRef<typeof UIAccordion.Content> &
120
+ VariantProps<typeof accordionContentStyle>;
121
+
122
+ type IAccordionContentTextProps = React.ComponentPropsWithoutRef<typeof UIAccordion.ContentText> &
123
+ VariantProps<typeof accordionContentTextStyle>;
124
+
125
+ type IAccordionIconProps = VariantProps<typeof accordionIconStyle> &
126
+ React.ComponentPropsWithoutRef<typeof UIAccordion.Icon> & {
127
+ as?: React.ElementType;
128
+ height?: number;
129
+ width?: number;
130
+ };
131
+
132
+ type IAccordionHeaderProps = React.ComponentPropsWithoutRef<typeof UIAccordion.Header> &
133
+ VariantProps<typeof accordionHeaderStyle>;
134
+
135
+ type IAccordionTriggerProps = React.ComponentPropsWithoutRef<typeof UIAccordion.Trigger> &
136
+ VariantProps<typeof accordionTriggerStyle>;
137
+
138
+ type IAccordionTitleTextProps = React.ComponentPropsWithoutRef<typeof UIAccordion.TitleText> &
139
+ VariantProps<typeof accordionTitleTextStyle>;
140
+
141
+ /** Components */
142
+ const Accordion = React.forwardRef<React.ElementRef<typeof UIAccordion>, IAccordionProps>(
143
+ ({ className, variant = 'filled', size = 'md', ...props }, ref) => {
144
+ return (
145
+ <UIAccordion
146
+ ref={ref}
147
+ {...props}
148
+ className={accordionStyle({ variant, class: className })}
149
+ context={{ variant, size }}
150
+ />
151
+ );
152
+ },
153
+ );
154
+
155
+ const AccordionItem = React.forwardRef<React.ElementRef<typeof UIAccordion.Item>, IAccordionItemProps>(
156
+ ({ className, ...props }, ref) => {
157
+ const { variant } = useStyleContext(SCOPE);
158
+ return (
159
+ <UIAccordion.Item
160
+ ref={ref}
161
+ {...props}
162
+ className={accordionItemStyle({
163
+ parentVariants: { variant },
164
+ class: className,
165
+ })}
166
+ />
167
+ );
168
+ },
169
+ );
170
+
171
+ const AccordionContent = React.forwardRef<React.ElementRef<typeof UIAccordion.Content>, IAccordionContentProps>(
172
+ ({ className, ...props }, ref) => {
173
+ return (
174
+ <UIAccordion.Content
175
+ ref={ref}
176
+ {...props}
177
+ className={accordionContentStyle({
178
+ class: className,
179
+ })}
180
+ />
181
+ );
182
+ },
183
+ );
184
+
185
+ const AccordionContentText = React.forwardRef<
186
+ React.ElementRef<typeof UIAccordion.ContentText>,
187
+ IAccordionContentTextProps
188
+ >(({ className, ...props }, ref) => {
189
+ const { size } = useStyleContext(SCOPE);
190
+ return (
191
+ <UIAccordion.ContentText
192
+ ref={ref}
193
+ {...props}
194
+ className={accordionContentTextStyle({
195
+ parentVariants: { size },
196
+ class: className,
197
+ })}
198
+ />
199
+ );
200
+ });
201
+
202
+ const AccordionIcon = React.forwardRef<React.ElementRef<typeof UIAccordion.Icon>, IAccordionIconProps>(
203
+ ({ size, className, ...props }, ref) => {
204
+ const { size: parentSize } = useStyleContext(SCOPE);
205
+
206
+ if (typeof size === 'number') {
207
+ return (
208
+ <UIAccordion.Icon
209
+ ref={ref}
210
+ {...props}
211
+ className={accordionIconStyle({ class: className })}
212
+ size={size}
213
+ />
214
+ );
215
+ } else if ((props.height !== undefined || props.width !== undefined) && size === undefined) {
216
+ return <UIAccordion.Icon ref={ref} {...props} className={accordionIconStyle({ class: className })} />;
217
+ }
218
+ return (
219
+ <UIAccordion.Icon
220
+ ref={ref}
221
+ {...props}
222
+ className={accordionIconStyle({
223
+ size,
224
+ class: className,
225
+ parentVariants: { size: parentSize },
226
+ })}
227
+ />
228
+ );
229
+ },
230
+ );
231
+
232
+ const AccordionHeader = React.forwardRef<React.ElementRef<typeof UIAccordion.Header>, IAccordionHeaderProps>(
233
+ ({ className, ...props }, ref) => {
234
+ return (
235
+ <UIAccordion.Header
236
+ ref={ref}
237
+ {...props}
238
+ className={accordionHeaderStyle({
239
+ class: className,
240
+ })}
241
+ />
242
+ );
243
+ },
244
+ );
245
+
246
+ const AccordionTrigger = React.forwardRef<React.ElementRef<typeof UIAccordion.Trigger>, IAccordionTriggerProps>(
247
+ ({ className, ...props }, ref) => {
248
+ return (
249
+ <UIAccordion.Trigger
250
+ ref={ref}
251
+ {...props}
252
+ className={accordionTriggerStyle({
253
+ class: className,
254
+ })}
255
+ />
256
+ );
257
+ },
258
+ );
259
+
260
+ const AccordionTitleText = React.forwardRef<React.ElementRef<typeof UIAccordion.TitleText>, IAccordionTitleTextProps>(
261
+ ({ className, ...props }, ref) => {
262
+ const { size } = useStyleContext(SCOPE);
263
+ return (
264
+ <UIAccordion.TitleText
265
+ ref={ref}
266
+ {...props}
267
+ className={accordionTitleTextStyle({
268
+ parentVariants: { size },
269
+ class: className,
270
+ })}
271
+ />
272
+ );
273
+ },
274
+ );
275
+
276
+ Accordion.displayName = 'Accordion';
277
+ AccordionItem.displayName = 'AccordionItem';
278
+ AccordionHeader.displayName = 'AccordionHeader';
279
+ AccordionTrigger.displayName = 'AccordionTrigger';
280
+ AccordionTitleText.displayName = 'AccordionTitleText';
281
+ AccordionContentText.displayName = 'AccordionContentText';
282
+ AccordionIcon.displayName = 'AccordionIcon';
283
+ AccordionContent.displayName = 'AccordionContent';
284
+
285
+ export {
286
+ Accordion,
287
+ AccordionItem,
288
+ AccordionHeader,
289
+ AccordionTrigger,
290
+ AccordionTitleText,
291
+ AccordionContentText,
292
+ AccordionIcon,
293
+ AccordionContent,
294
+ };