@flipova/foundation 2.3.0 → 2.4.0

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 (98) hide show
  1. package/README.md +157 -156
  2. package/components/ui/accordion/ANIMATION_CUSTOMIZATION.md +16 -7
  3. package/components/ui/accordion/AccordionAnimatedHeight.tsx +3 -15
  4. package/components/ui/accordion/AccordionAnimatedIcon.tsx +2 -9
  5. package/components/ui/accordion/AnimatedHeight.tsx +3 -15
  6. package/components/ui/accordion/AnimatedIcon.tsx +2 -9
  7. package/components/ui/accordion/MIGRATION_SUMMARY.md +22 -11
  8. package/components/ui/accordion/USAGE_EXAMPLE.tsx +10 -25
  9. package/components/ui/accordion/index.tsx +71 -139
  10. package/components/ui/actionsheet/index.tsx +63 -105
  11. package/components/ui/alert/index.tsx +20 -50
  12. package/components/ui/alert-dialog/index.tsx +23 -48
  13. package/components/ui/avatar/index.tsx +32 -68
  14. package/components/ui/badge/index.tsx +18 -49
  15. package/components/ui/bottomsheet/index.tsx +20 -52
  16. package/components/ui/box/index.tsx +4 -9
  17. package/components/ui/box/index.web.tsx +3 -9
  18. package/components/ui/button/index.tsx +73 -109
  19. package/components/ui/calendar/creator.tsx +69 -30
  20. package/components/ui/calendar/index.tsx +81 -159
  21. package/components/ui/calendar/styles.tsx +10 -10
  22. package/components/ui/card/index.tsx +8 -9
  23. package/components/ui/card/index.web.tsx +4 -10
  24. package/components/ui/center/index.tsx +6 -11
  25. package/components/ui/center/index.web.tsx +3 -9
  26. package/components/ui/checkbox/index.tsx +46 -107
  27. package/components/ui/date-time-picker/creator.tsx +14 -1
  28. package/components/ui/date-time-picker/index.tsx +107 -156
  29. package/components/ui/date-time-picker/index.web.tsx +11 -33
  30. package/components/ui/date-time-picker/styles.tsx +5 -5
  31. package/components/ui/divider/index.tsx +5 -6
  32. package/components/ui/drawer/index.tsx +108 -128
  33. package/components/ui/fab/index.tsx +25 -68
  34. package/components/ui/flat-list/index.tsx +11 -8
  35. package/components/ui/form-control/index.tsx +49 -90
  36. package/components/ui/gluestack-ui-provider/index.tsx +4 -18
  37. package/components/ui/gluestack-ui-provider/index.web.tsx +10 -11
  38. package/components/ui/gluestack-ui-provider/script.ts +1 -3
  39. package/components/ui/gluestack-ui-provider/theme-context.ts +2 -2
  40. package/components/ui/gluestack-ui-provider/useGluestackColors.ts +2 -6
  41. package/components/ui/grid/index.tsx +128 -165
  42. package/components/ui/grid/index.web.tsx +17 -19
  43. package/components/ui/grid/styles.tsx +1 -3
  44. package/components/ui/heading/index.tsx +146 -169
  45. package/components/ui/heading/index.web.tsx +7 -28
  46. package/components/ui/heading/styles.tsx +5 -5
  47. package/components/ui/hstack/index.tsx +16 -15
  48. package/components/ui/hstack/index.web.tsx +17 -17
  49. package/components/ui/hstack/styles.tsx +5 -5
  50. package/components/ui/icon/index.tsx +95 -486
  51. package/components/ui/icon/index.web.tsx +79 -439
  52. package/components/ui/image/index.tsx +13 -18
  53. package/components/ui/image-viewer/index.tsx +149 -221
  54. package/components/ui/image-viewer/index.web.tsx +88 -113
  55. package/components/ui/input/index.tsx +20 -33
  56. package/components/ui/link/index.tsx +16 -22
  57. package/components/ui/liquid-glass/index.tsx +19 -25
  58. package/components/ui/menu/index.tsx +44 -66
  59. package/components/ui/modal/index.tsx +70 -91
  60. package/components/ui/popover/index.tsx +102 -121
  61. package/components/ui/portal/index.tsx +5 -6
  62. package/components/ui/pressable/index.tsx +5 -9
  63. package/components/ui/progress/index.tsx +4 -11
  64. package/components/ui/radio/index.tsx +47 -83
  65. package/components/ui/select/index.tsx +38 -59
  66. package/components/ui/select/select-actionsheet.tsx +61 -108
  67. package/components/ui/skeleton/index.tsx +22 -43
  68. package/components/ui/skeleton/index.web.tsx +63 -75
  69. package/components/ui/slider/index.tsx +36 -56
  70. package/components/ui/spinner/index.tsx +1 -10
  71. package/components/ui/switch/index.tsx +6 -13
  72. package/components/ui/table/index.tsx +39 -102
  73. package/components/ui/table/index.web.tsx +41 -79
  74. package/components/ui/tabs/TabsAnimatedIndicator.tsx +10 -38
  75. package/components/ui/tabs/creator.tsx +32 -24
  76. package/components/ui/tabs/index.tsx +253 -309
  77. package/components/ui/text/index.tsx +23 -37
  78. package/components/ui/text/index.web.tsx +33 -35
  79. package/components/ui/text/styles.tsx +5 -5
  80. package/components/ui/textarea/index.tsx +24 -38
  81. package/components/ui/toast/index.tsx +47 -52
  82. package/components/ui/tooltip/index.tsx +12 -28
  83. package/components/ui/vstack/index.tsx +17 -17
  84. package/components/ui/vstack/index.web.tsx +17 -17
  85. package/components/ui/vstack/styles.tsx +5 -5
  86. package/design/tools/design.js +15 -12
  87. package/design/tools/npm.js +4 -3
  88. package/dist/{chunk-B277QSR5.mjs → chunk-2R66P5X5.mjs} +1816 -3124
  89. package/dist/chunk-2R66P5X5.mjs.map +1 -0
  90. package/dist/{chunk-GD37RFBR.js → chunk-LCTFQJZM.js} +1816 -3124
  91. package/dist/chunk-LCTFQJZM.js.map +1 -0
  92. package/dist/index.js +294 -294
  93. package/dist/index.mjs +1 -1
  94. package/dist/ui/index.js +294 -294
  95. package/dist/ui/index.mjs +1 -1
  96. package/package.json +12 -7
  97. package/dist/chunk-B277QSR5.mjs.map +0 -1
  98. package/dist/chunk-GD37RFBR.js.map +0 -1
@@ -2,12 +2,7 @@
2
2
 
3
3
  import React from 'react';
4
4
  import { View, Text, Pressable } from 'react-native';
5
- import {
6
- createCalendar,
7
- type ICalendarProps,
8
- type CalendarMode,
9
- type CalendarMarkers,
10
- } from './creator';
5
+ import { createCalendar, type ICalendarProps, type CalendarMode, type CalendarMarkers } from './creator';
11
6
  import { cssInterop } from 'nativewind';
12
7
  import {
13
8
  calendarStyle,
@@ -40,13 +35,7 @@ const CalendarRoot = React.forwardRef<
40
35
  React.ElementRef<typeof View>,
41
36
  ICalendarProps & React.ComponentProps<typeof View> & { className?: string }
42
37
  >(({ className, ...props }, ref) => {
43
- return (
44
- <View
45
- ref={ref}
46
- className={calendarStyle({ class: className })}
47
- {...props}
48
- />
49
- );
38
+ return <View ref={ref} className={calendarStyle({ class: className })} {...props} />;
50
39
  });
51
40
 
52
41
  // Styled Header
@@ -54,13 +43,7 @@ const CalendarHeaderRoot = React.forwardRef<
54
43
  React.ElementRef<typeof View>,
55
44
  React.ComponentProps<typeof View> & { className?: string }
56
45
  >(({ className, ...props }, ref) => {
57
- return (
58
- <View
59
- ref={ref}
60
- className={calendarHeaderStyle({ class: className })}
61
- {...props}
62
- />
63
- );
46
+ return <View ref={ref} className={calendarHeaderStyle({ class: className })} {...props} />;
64
47
  });
65
48
 
66
49
  const CalendarHeaderPrevButtonRoot = React.forwardRef<
@@ -101,18 +84,22 @@ const CalendarHeaderTitleRoot = React.forwardRef<
101
84
  React.ElementRef<typeof Text>,
102
85
  React.ComponentProps<typeof Text> & { className?: string }
103
86
  >(({ className, ...props }, ref) => {
104
- return (
105
- <Text
106
- ref={ref}
107
- className={calendarHeaderTitleStyle({ class: className })}
108
- {...props}
109
- />
110
- );
87
+ return <Text ref={ref} className={calendarHeaderTitleStyle({ class: className })} {...props} />;
111
88
  });
112
89
 
113
90
  const MONTH_NAMES = [
114
- 'January', 'February', 'March', 'April', 'May', 'June',
115
- 'July', 'August', 'September', 'October', 'November', 'December',
91
+ 'January',
92
+ 'February',
93
+ 'March',
94
+ 'April',
95
+ 'May',
96
+ 'June',
97
+ 'July',
98
+ 'August',
99
+ 'September',
100
+ 'October',
101
+ 'November',
102
+ 'December',
116
103
  ];
117
104
 
118
105
  type SelectRootProps = React.ComponentProps<typeof View> & {
@@ -122,86 +109,66 @@ type SelectRootProps = React.ComponentProps<typeof View> & {
122
109
  onValueChange?: (value: number) => void;
123
110
  };
124
111
 
125
- const CalendarHeaderMonthSelectRoot = React.forwardRef<
126
- React.ElementRef<typeof View>,
127
- SelectRootProps
128
- >(({ className, items = [], selectedValue, onValueChange, ...props }, ref) => {
129
- const label = selectedValue !== undefined ? MONTH_NAMES[selectedValue] : 'Month';
130
- return (
131
- <View ref={ref} className={calendarHeaderSelectStyle({ class: className })} {...props}>
132
- <Menu
133
- placement="bottom"
134
- offset={4}
135
- trigger={({ ...triggerProps }) => (
136
- <Pressable {...triggerProps} className="px-2 py-1 rounded-md flex-row items-center">
137
- <Text className="text-sm font-medium text-foreground">{label}</Text>
138
- </Pressable>
139
- )}
140
- >
141
- {items.map((item) => (
142
- <MenuItem
143
- key={item.value}
144
- textValue={item.label}
145
- onPress={() => onValueChange?.(item.value)}
146
- >
147
- <MenuItemLabel
148
- className={item.value === selectedValue ? 'text-primary font-semibold' : ''}
149
- >
150
- {item.label}
151
- </MenuItemLabel>
152
- </MenuItem>
153
- ))}
154
- </Menu>
155
- </View>
156
- );
157
- });
112
+ const CalendarHeaderMonthSelectRoot = React.forwardRef<React.ElementRef<typeof View>, SelectRootProps>(
113
+ ({ className, items = [], selectedValue, onValueChange, ...props }, ref) => {
114
+ const label = selectedValue !== undefined ? MONTH_NAMES[selectedValue] : 'Month';
115
+ return (
116
+ <View ref={ref} className={calendarHeaderSelectStyle({ class: className })} {...props}>
117
+ <Menu
118
+ placement="bottom"
119
+ offset={4}
120
+ trigger={({ ...triggerProps }) => (
121
+ <Pressable {...triggerProps} className="px-2 py-1 rounded-md flex-row items-center">
122
+ <Text className="text-sm font-medium text-foreground">{label}</Text>
123
+ </Pressable>
124
+ )}
125
+ >
126
+ {items.map((item) => (
127
+ <MenuItem key={item.value} textValue={item.label} onPress={() => onValueChange?.(item.value)}>
128
+ <MenuItemLabel className={item.value === selectedValue ? 'text-primary font-semibold' : ''}>
129
+ {item.label}
130
+ </MenuItemLabel>
131
+ </MenuItem>
132
+ ))}
133
+ </Menu>
134
+ </View>
135
+ );
136
+ },
137
+ );
158
138
 
159
- const CalendarHeaderYearSelectRoot = React.forwardRef<
160
- React.ElementRef<typeof View>,
161
- SelectRootProps
162
- >(({ className, items = [], selectedValue, onValueChange, ...props }, ref) => {
163
- const label = selectedValue !== undefined ? String(selectedValue) : 'Year';
164
- return (
165
- <View ref={ref} className={calendarHeaderSelectStyle({ class: className })} {...props}>
166
- <Menu
167
- placement="bottom"
168
- offset={4}
169
- trigger={({ ...triggerProps }) => (
170
- <Pressable {...triggerProps} className="px-2 py-1 rounded-md flex-row items-center">
171
- <Text className="text-sm font-medium text-foreground">{label}</Text>
172
- </Pressable>
173
- )}
174
- >
175
- {items.map((item) => (
176
- <MenuItem
177
- key={item.value}
178
- textValue={item.label}
179
- onPress={() => onValueChange?.(item.value)}
180
- >
181
- <MenuItemLabel
182
- className={item.value === selectedValue ? 'text-primary font-semibold' : ''}
183
- >
184
- {item.label}
185
- </MenuItemLabel>
186
- </MenuItem>
187
- ))}
188
- </Menu>
189
- </View>
190
- );
191
- });
139
+ const CalendarHeaderYearSelectRoot = React.forwardRef<React.ElementRef<typeof View>, SelectRootProps>(
140
+ ({ className, items = [], selectedValue, onValueChange, ...props }, ref) => {
141
+ const label = selectedValue !== undefined ? String(selectedValue) : 'Year';
142
+ return (
143
+ <View ref={ref} className={calendarHeaderSelectStyle({ class: className })} {...props}>
144
+ <Menu
145
+ placement="bottom"
146
+ offset={4}
147
+ trigger={({ ...triggerProps }) => (
148
+ <Pressable {...triggerProps} className="px-2 py-1 rounded-md flex-row items-center">
149
+ <Text className="text-sm font-medium text-foreground">{label}</Text>
150
+ </Pressable>
151
+ )}
152
+ >
153
+ {items.map((item) => (
154
+ <MenuItem key={item.value} textValue={item.label} onPress={() => onValueChange?.(item.value)}>
155
+ <MenuItemLabel className={item.value === selectedValue ? 'text-primary font-semibold' : ''}>
156
+ {item.label}
157
+ </MenuItemLabel>
158
+ </MenuItem>
159
+ ))}
160
+ </Menu>
161
+ </View>
162
+ );
163
+ },
164
+ );
192
165
 
193
166
  // Styled Week Days Header
194
167
  const CalendarWeekDaysHeaderRoot = React.forwardRef<
195
168
  React.ElementRef<typeof View>,
196
169
  React.ComponentProps<typeof View> & { className?: string }
197
170
  >(({ className, ...props }, ref) => {
198
- return (
199
- <View
200
- ref={ref}
201
- className={calendarWeekDaysHeaderStyle({ class: className })}
202
- {...props}
203
- />
204
- );
171
+ return <View ref={ref} className={calendarWeekDaysHeaderStyle({ class: className })} {...props} />;
205
172
  });
206
173
 
207
174
  const CalendarWeekDayRoot = React.forwardRef<
@@ -209,15 +176,9 @@ const CalendarWeekDayRoot = React.forwardRef<
209
176
  React.ComponentProps<typeof View> & { className?: string }
210
177
  >(({ className, children, ...props }, ref) => {
211
178
  return (
212
- <View
213
- ref={ref}
214
- className={calendarWeekDayStyle({ class: className })}
215
- {...props}
216
- >
179
+ <View ref={ref} className={calendarWeekDayStyle({ class: className })} {...props}>
217
180
  {typeof children === 'string' ? (
218
- <Text className={calendarWeekDayTextStyle({ class: '' })}>
219
- {children}
220
- </Text>
181
+ <Text className={calendarWeekDayTextStyle({ class: '' })}>{children}</Text>
221
182
  ) : (
222
183
  children
223
184
  )}
@@ -230,46 +191,28 @@ const CalendarBodyRoot = React.forwardRef<
230
191
  React.ElementRef<typeof View>,
231
192
  React.ComponentProps<typeof View> & { className?: string }
232
193
  >(({ className, ...props }, ref) => {
233
- return (
234
- <View
235
- ref={ref}
236
- className={calendarBodyStyle({ class: className })}
237
- {...props}
238
- />
239
- );
194
+ return <View ref={ref} className={calendarBodyStyle({ class: className })} {...props} />;
240
195
  });
241
196
 
242
197
  const CalendarGridRoot = React.forwardRef<
243
198
  React.ElementRef<typeof View>,
244
199
  React.ComponentProps<typeof View> & { className?: string }
245
200
  >(({ className, ...props }, ref) => {
246
- return (
247
- <View
248
- ref={ref}
249
- className={calendarGridStyle({ class: className })}
250
- {...props}
251
- />
252
- );
201
+ return <View ref={ref} className={calendarGridStyle({ class: className })} {...props} />;
253
202
  });
254
203
 
255
204
  const CalendarWeekRoot = React.forwardRef<
256
205
  React.ElementRef<typeof View>,
257
206
  React.ComponentProps<typeof View> & { className?: string }
258
207
  >(({ className, ...props }, ref) => {
259
- return (
260
- <View
261
- ref={ref}
262
- className={calendarWeekStyle({ class: className })}
263
- {...props}
264
- />
265
- );
208
+ return <View ref={ref} className={calendarWeekStyle({ class: className })} {...props} />;
266
209
  });
267
210
 
268
211
  // Styled Day
269
212
  const CalendarDayRoot = React.forwardRef<
270
213
  React.ElementRef<typeof Pressable>,
271
214
  React.ComponentProps<typeof Pressable> & {
272
- 'className'?: string;
215
+ className?: string;
273
216
  'data-state'?: string;
274
217
  }
275
218
  >(({ className, 'data-state': dataState, ...props }, ref) => {
@@ -319,7 +262,7 @@ const CalendarDayTextRoot = React.forwardRef<
319
262
  const CalendarDayIndicatorRoot = React.forwardRef<
320
263
  React.ElementRef<typeof View>,
321
264
  React.ComponentProps<typeof View> & {
322
- 'className'?: string;
265
+ className?: string;
323
266
  'data-type'?: string;
324
267
  }
325
268
  >(({ className, 'data-type': dataType, ...props }, ref) => {
@@ -341,15 +284,9 @@ const CalendarWeekNumberRoot = React.forwardRef<
341
284
  React.ComponentProps<typeof View> & { className?: string }
342
285
  >(({ className, children, ...props }, ref) => {
343
286
  return (
344
- <View
345
- ref={ref}
346
- className={calendarWeekNumberStyle({ class: className })}
347
- {...props}
348
- >
287
+ <View ref={ref} className={calendarWeekNumberStyle({ class: className })} {...props}>
349
288
  {typeof children === 'string' || typeof children === 'number' ? (
350
- <Text className={calendarWeekNumberTextStyle({ class: '' })}>
351
- {children}
352
- </Text>
289
+ <Text className={calendarWeekNumberTextStyle({ class: '' })}>{children}</Text>
353
290
  ) : (
354
291
  children
355
292
  )}
@@ -362,13 +299,7 @@ const CalendarFooterRoot = React.forwardRef<
362
299
  React.ElementRef<typeof View>,
363
300
  React.ComponentProps<typeof View> & { className?: string }
364
301
  >(({ className, ...props }, ref) => {
365
- return (
366
- <View
367
- ref={ref}
368
- className={calendarFooterStyle({ class: className })}
369
- {...props}
370
- />
371
- );
302
+ return <View ref={ref} className={calendarFooterStyle({ class: className })} {...props} />;
372
303
  });
373
304
 
374
305
  // Create Calendar using the factory
@@ -423,10 +354,7 @@ type CalendarProps = (SingleModeProps | MultipleModeProps | RangeModeProps) &
423
354
  className?: string;
424
355
  };
425
356
 
426
- const CalendarComponent = React.forwardRef<
427
- React.ElementRef<typeof View>,
428
- CalendarProps
429
- >((props, ref) => {
357
+ const CalendarComponent = React.forwardRef<React.ElementRef<typeof View>, CalendarProps>((props, ref) => {
430
358
  return <UICalendar ref={ref} {...(props as any)} />;
431
359
  });
432
360
  CalendarComponent.displayName = 'Calendar';
@@ -451,12 +379,6 @@ export const CalendarWeekNumber = UICalendar.WeekNumber;
451
379
  export const CalendarFooter = UICalendar.Footer;
452
380
 
453
381
  // Re-export types
454
- export type {
455
- ICalendarProps,
456
- CalendarMode,
457
- CalendarMarker,
458
- CalendarMarkers,
459
- DayState,
460
- } from './creator';
382
+ export type { ICalendarProps, CalendarMode, CalendarMarker, CalendarMarkers, DayState } from './creator';
461
383
 
462
384
  export type { CalendarProps };
@@ -70,10 +70,10 @@ export const calendarDayStyle = tva({
70
70
  base: 'flex-1 aspect-square items-center justify-center rounded-md web:max-w-[2.25rem] relative transition-colors',
71
71
  variants: {
72
72
  state: {
73
- 'default': 'hover:bg-accent active:bg-accent/80',
74
- 'selected': 'bg-primary hover:bg-primary/90 active:bg-primary/80',
75
- 'today': 'bg-accent',
76
- 'disabled': 'opacity-40 cursor-not-allowed',
73
+ default: 'hover:bg-accent active:bg-accent/80',
74
+ selected: 'bg-primary hover:bg-primary/90 active:bg-primary/80',
75
+ today: 'bg-accent',
76
+ disabled: 'opacity-40 cursor-not-allowed',
77
77
  'outside-month': 'opacity-30',
78
78
  'range-start': 'bg-primary rounded-r-md',
79
79
  'range-end': 'bg-primary rounded-l-md',
@@ -86,10 +86,10 @@ export const calendarDayTextStyle = tva({
86
86
  base: 'text-foreground text-sm font-normal z-10',
87
87
  variants: {
88
88
  state: {
89
- 'default': 'text-foreground',
90
- 'selected': 'text-primary-foreground ',
91
- 'today': 'text-accent-foreground',
92
- 'disabled': 'text-muted-foreground',
89
+ default: 'text-foreground',
90
+ selected: 'text-primary-foreground ',
91
+ today: 'text-accent-foreground',
92
+ disabled: 'text-muted-foreground',
93
93
  'outside-month': 'text-muted-foreground',
94
94
  'range-start': 'text-primary-foreground font-semibold',
95
95
  'range-end': 'text-primary-foreground font-semibold',
@@ -103,9 +103,9 @@ export const calendarDayIndicatorStyle = tva({
103
103
  base: 'absolute bottom-1 flex-row gap-0.5 z-0',
104
104
  variants: {
105
105
  type: {
106
- 'dot': 'flex-row gap-0.5',
106
+ dot: 'flex-row gap-0.5',
107
107
  'multi-dot': 'flex-row gap-0.5',
108
- 'period': 'absolute inset-0 rounded-md opacity-20',
108
+ period: 'absolute inset-0 rounded-md opacity-20',
109
109
  },
110
110
  },
111
111
  });
@@ -4,19 +4,18 @@ import { View } from 'react-native';
4
4
  import { cardStyle } from './styles';
5
5
  import type { VariantProps } from '@gluestack-ui/utils/nativewind-utils';
6
6
 
7
- type ICardProps = React.ComponentPropsWithoutRef<typeof View> &
8
- VariantProps<typeof cardStyle> & {
7
+ type ICardProps = React.ComponentPropsWithoutRef<typeof View> &
8
+ VariantProps<typeof cardStyle> & {
9
9
  className?: string;
10
10
  size?: 'default' | 'sm';
11
11
  };
12
12
 
13
- const Card = React.forwardRef<React.ComponentRef<typeof View>, ICardProps>(
14
- function Card({ className, size = 'default', ...props }, ref) {
15
- return (
16
- <View className={cardStyle({ size, class: className })} {...props} ref={ref} />
17
- );
18
- }
19
- );
13
+ const Card = React.forwardRef<React.ComponentRef<typeof View>, ICardProps>(function Card(
14
+ { className, size = 'default', ...props },
15
+ ref,
16
+ ) {
17
+ return <View className={cardStyle({ size, class: className })} {...props} ref={ref} />;
18
+ });
20
19
 
21
20
  Card.displayName = 'Card';
22
21
 
@@ -2,23 +2,17 @@ import React from 'react';
2
2
  import { cardStyle } from './styles';
3
3
  import type { VariantProps } from '@gluestack-ui/utils/nativewind-utils';
4
4
 
5
- type ICardProps = React.ComponentPropsWithoutRef<'div'> &
6
- VariantProps<typeof cardStyle> & {
5
+ type ICardProps = React.ComponentPropsWithoutRef<'div'> &
6
+ VariantProps<typeof cardStyle> & {
7
7
  className?: string;
8
8
  size?: 'default' | 'sm';
9
9
  };
10
10
 
11
11
  const Card = React.forwardRef<HTMLDivElement, ICardProps>(function Card(
12
12
  { className, size = 'default', ...props },
13
- ref
13
+ ref,
14
14
  ) {
15
- return (
16
- <div
17
- className={cardStyle({ size, class: className })}
18
- {...props}
19
- ref={ref}
20
- />
21
- );
15
+ return <div className={cardStyle({ size, class: className })} {...props} ref={ref} />;
22
16
  });
23
17
 
24
18
  Card.displayName = 'Card';
@@ -5,17 +5,12 @@ import type { VariantProps } from '@gluestack-ui/utils/nativewind-utils';
5
5
 
6
6
  type ICenterProps = ViewProps & VariantProps<typeof centerStyle>;
7
7
 
8
- const Center = React.forwardRef<React.ComponentRef<typeof View>, ICenterProps>(
9
- function Center({ className, ...props }, ref) {
10
- return (
11
- <View
12
- className={centerStyle({ class: className })}
13
- {...props}
14
- ref={ref}
15
- />
16
- );
17
- }
18
- );
8
+ const Center = React.forwardRef<React.ComponentRef<typeof View>, ICenterProps>(function Center(
9
+ { className, ...props },
10
+ ref,
11
+ ) {
12
+ return <View className={centerStyle({ class: className })} {...props} ref={ref} />;
13
+ });
19
14
 
20
15
  Center.displayName = 'Center';
21
16
 
@@ -3,16 +3,10 @@ import { centerStyle } from './styles';
3
3
 
4
4
  import type { VariantProps } from '@gluestack-ui/utils/nativewind-utils';
5
5
 
6
- type ICenterProps = React.ComponentPropsWithoutRef<'div'> &
7
- VariantProps<typeof centerStyle>;
6
+ type ICenterProps = React.ComponentPropsWithoutRef<'div'> & VariantProps<typeof centerStyle>;
8
7
 
9
- const Center = React.forwardRef<HTMLDivElement, ICenterProps>(function Center(
10
- { className, ...props },
11
- ref
12
- ) {
13
- return (
14
- <div className={centerStyle({ class: className })} {...props} ref={ref} />
15
- );
8
+ const Center = React.forwardRef<HTMLDivElement, ICenterProps>(function Center({ className, ...props }, ref) {
9
+ return <div className={centerStyle({ class: className })} {...props} ref={ref} />;
16
10
  });
17
11
 
18
12
  Center.displayName = 'Center';