@flipova/foundation 2.2.1 → 2.4.0-beta.1

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 (109) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +157 -156
  3. package/components/ui/accordion/ANIMATION_CUSTOMIZATION.md +16 -7
  4. package/components/ui/accordion/AccordionAnimatedHeight.tsx +3 -15
  5. package/components/ui/accordion/AccordionAnimatedIcon.tsx +2 -9
  6. package/components/ui/accordion/AnimatedHeight.tsx +3 -15
  7. package/components/ui/accordion/AnimatedIcon.tsx +2 -9
  8. package/components/ui/accordion/MIGRATION_SUMMARY.md +22 -11
  9. package/components/ui/accordion/USAGE_EXAMPLE.tsx +10 -25
  10. package/components/ui/accordion/index.tsx +71 -139
  11. package/components/ui/actionsheet/index.tsx +63 -105
  12. package/components/ui/alert/index.tsx +20 -50
  13. package/components/ui/alert-dialog/index.tsx +23 -48
  14. package/components/ui/avatar/index.tsx +32 -68
  15. package/components/ui/badge/index.tsx +18 -49
  16. package/components/ui/bottomsheet/index.tsx +20 -52
  17. package/components/ui/box/index.tsx +4 -9
  18. package/components/ui/box/index.web.tsx +3 -9
  19. package/components/ui/button/index.tsx +73 -109
  20. package/components/ui/calendar/creator.tsx +69 -30
  21. package/components/ui/calendar/index.tsx +81 -159
  22. package/components/ui/calendar/styles.tsx +10 -10
  23. package/components/ui/card/index.tsx +8 -9
  24. package/components/ui/card/index.web.tsx +4 -10
  25. package/components/ui/center/index.tsx +6 -11
  26. package/components/ui/center/index.web.tsx +3 -9
  27. package/components/ui/checkbox/index.tsx +46 -107
  28. package/components/ui/date-time-picker/creator.tsx +14 -1
  29. package/components/ui/date-time-picker/index.tsx +107 -156
  30. package/components/ui/date-time-picker/index.web.tsx +11 -33
  31. package/components/ui/date-time-picker/styles.tsx +5 -5
  32. package/components/ui/divider/index.tsx +5 -6
  33. package/components/ui/drawer/index.tsx +108 -128
  34. package/components/ui/fab/index.tsx +25 -68
  35. package/components/ui/flat-list/index.tsx +11 -8
  36. package/components/ui/form-control/index.tsx +49 -90
  37. package/components/ui/gluestack-ui-provider/config.ts +69 -2
  38. package/components/ui/gluestack-ui-provider/index.tsx +32 -12
  39. package/components/ui/gluestack-ui-provider/index.web.tsx +43 -16
  40. package/components/ui/gluestack-ui-provider/script.ts +13 -8
  41. package/components/ui/gluestack-ui-provider/theme-context.ts +36 -1
  42. package/components/ui/gluestack-ui-provider/useGluestackColors.ts +11 -4
  43. package/components/ui/grid/index.tsx +128 -165
  44. package/components/ui/grid/index.web.tsx +17 -19
  45. package/components/ui/grid/styles.tsx +1 -3
  46. package/components/ui/heading/index.tsx +146 -169
  47. package/components/ui/heading/index.web.tsx +7 -28
  48. package/components/ui/heading/styles.tsx +5 -5
  49. package/components/ui/hstack/index.tsx +16 -15
  50. package/components/ui/hstack/index.web.tsx +17 -17
  51. package/components/ui/hstack/styles.tsx +5 -5
  52. package/components/ui/icon/index.tsx +95 -486
  53. package/components/ui/icon/index.web.tsx +79 -439
  54. package/components/ui/image/index.tsx +13 -18
  55. package/components/ui/image-viewer/index.tsx +149 -221
  56. package/components/ui/image-viewer/index.web.tsx +88 -113
  57. package/components/ui/input/index.tsx +20 -33
  58. package/components/ui/link/index.tsx +16 -22
  59. package/components/ui/liquid-glass/index.tsx +19 -25
  60. package/components/ui/menu/index.tsx +44 -66
  61. package/components/ui/modal/index.tsx +70 -91
  62. package/components/ui/popover/index.tsx +102 -121
  63. package/components/ui/portal/index.tsx +5 -6
  64. package/components/ui/pressable/index.tsx +5 -9
  65. package/components/ui/progress/index.tsx +4 -11
  66. package/components/ui/radio/index.tsx +47 -83
  67. package/components/ui/select/index.tsx +38 -59
  68. package/components/ui/select/select-actionsheet.tsx +61 -108
  69. package/components/ui/skeleton/index.tsx +22 -43
  70. package/components/ui/skeleton/index.web.tsx +63 -75
  71. package/components/ui/slider/index.tsx +36 -56
  72. package/components/ui/spinner/index.tsx +1 -10
  73. package/components/ui/switch/index.tsx +6 -13
  74. package/components/ui/table/index.tsx +39 -102
  75. package/components/ui/table/index.web.tsx +41 -79
  76. package/components/ui/tabs/TabsAnimatedIndicator.tsx +10 -38
  77. package/components/ui/tabs/creator.tsx +32 -24
  78. package/components/ui/tabs/index.tsx +253 -309
  79. package/components/ui/text/index.tsx +23 -37
  80. package/components/ui/text/index.web.tsx +33 -35
  81. package/components/ui/text/styles.tsx +5 -5
  82. package/components/ui/textarea/index.tsx +24 -38
  83. package/components/ui/toast/index.tsx +47 -52
  84. package/components/ui/tooltip/index.tsx +12 -28
  85. package/components/ui/vstack/index.tsx +17 -17
  86. package/components/ui/vstack/index.web.tsx +17 -17
  87. package/components/ui/vstack/styles.tsx +5 -5
  88. package/design/canonical.index.txt +15 -1
  89. package/design/manifest.xml +2 -0
  90. package/design/schema.xsd +11 -0
  91. package/design/themes.xml +175 -2
  92. package/design/tools/design.js +15 -12
  93. package/design/tools/npm.js +4 -3
  94. package/design/tools/sources/.generate/config.py +60 -2
  95. package/dist/{chunk-RPLDFHEZ.mjs → chunk-2R66P5X5.mjs} +1907 -3130
  96. package/dist/chunk-2R66P5X5.mjs.map +1 -0
  97. package/dist/{chunk-JVHJUIXV.js → chunk-LCTFQJZM.js} +1909 -3129
  98. package/dist/chunk-LCTFQJZM.js.map +1 -0
  99. package/dist/index.d.mts +1 -1
  100. package/dist/index.d.ts +1 -1
  101. package/dist/index.js +303 -291
  102. package/dist/index.mjs +1 -1
  103. package/dist/ui/index.d.mts +44 -3
  104. package/dist/ui/index.d.ts +44 -3
  105. package/dist/ui/index.js +303 -291
  106. package/dist/ui/index.mjs +1 -1
  107. package/package.json +12 -7
  108. package/dist/chunk-JVHJUIXV.js.map +0 -1
  109. package/dist/chunk-RPLDFHEZ.mjs.map +0 -1
@@ -17,17 +17,12 @@ import { UIIcon } from '@gluestack-ui/core/icon/creator';
17
17
  import { tva } from '@gluestack-ui/utils/nativewind-utils';
18
18
  import type { VariantProps } from '@gluestack-ui/utils/nativewind-utils';
19
19
  import { cssInterop } from 'nativewind';
20
- import {
21
- Motion,
22
- AnimatePresence,
23
- createMotionAnimatedComponent,
24
- MotionComponentProps,
25
- } from '@legendapp/motion';
26
-
27
- const ItemWrapper = React.forwardRef<
28
- React.ComponentRef<typeof Pressable>,
29
- PressableProps
30
- >(function ItemWrapper({ ...props }, ref) {
20
+ import { Motion, AnimatePresence, createMotionAnimatedComponent, MotionComponentProps } from '@legendapp/motion';
21
+
22
+ const ItemWrapper = React.forwardRef<React.ComponentRef<typeof Pressable>, PressableProps>(function ItemWrapper(
23
+ { ...props },
24
+ ref,
25
+ ) {
31
26
  return <Pressable {...props} ref={ref} />;
32
27
  });
33
28
 
@@ -39,9 +34,7 @@ const MotionView = Motion.View as React.ComponentType<IMotionViewProps>;
39
34
  type IAnimatedPressableProps = React.ComponentProps<typeof Pressable> &
40
35
  MotionComponentProps<typeof Pressable, ViewStyle, unknown, unknown, unknown>;
41
36
 
42
- const AnimatedPressable = createMotionAnimatedComponent(
43
- Pressable
44
- ) as React.ComponentType<IAnimatedPressableProps>;
37
+ const AnimatedPressable = createMotionAnimatedComponent(Pressable) as React.ComponentType<IAnimatedPressableProps>;
45
38
 
46
39
  export const UIActionsheet = createActionsheet({
47
40
  Root: View,
@@ -190,8 +183,7 @@ const actionsheetIconStyle = tva({
190
183
  base: 'text-foreground fill-none h-4 w-4',
191
184
  });
192
185
 
193
- type IActionsheetProps = VariantProps<typeof actionsheetStyle> &
194
- React.ComponentPropsWithoutRef<typeof UIActionsheet>;
186
+ type IActionsheetProps = VariantProps<typeof actionsheetStyle> & React.ComponentPropsWithoutRef<typeof UIActionsheet>;
195
187
 
196
188
  type IActionsheetContentProps = VariantProps<typeof actionsheetContentStyle> &
197
189
  React.ComponentPropsWithoutRef<typeof UIActionsheet.Content> & {
@@ -204,14 +196,10 @@ type IActionsheetItemProps = VariantProps<typeof actionsheetItemStyle> &
204
196
  type IActionsheetItemTextProps = VariantProps<typeof actionsheetItemTextStyle> &
205
197
  React.ComponentPropsWithoutRef<typeof UIActionsheet.ItemText>;
206
198
 
207
- type IActionsheetDragIndicatorProps = VariantProps<
208
- typeof actionsheetDragIndicatorStyle
209
- > &
199
+ type IActionsheetDragIndicatorProps = VariantProps<typeof actionsheetDragIndicatorStyle> &
210
200
  React.ComponentPropsWithoutRef<typeof UIActionsheet.DragIndicator>;
211
201
 
212
- type IActionsheetDragIndicatorWrapperProps = VariantProps<
213
- typeof actionsheetDragIndicatorWrapperStyle
214
- > &
202
+ type IActionsheetDragIndicatorWrapperProps = VariantProps<typeof actionsheetDragIndicatorWrapperStyle> &
215
203
  React.ComponentPropsWithoutRef<typeof UIActionsheet.DragIndicatorWrapper>;
216
204
 
217
205
  type IActionsheetBackdropProps = VariantProps<typeof actionsheetBackdropStyle> &
@@ -219,27 +207,19 @@ type IActionsheetBackdropProps = VariantProps<typeof actionsheetBackdropStyle> &
219
207
  className?: string;
220
208
  };
221
209
 
222
- type IActionsheetScrollViewProps = VariantProps<
223
- typeof actionsheetScrollViewStyle
224
- > &
210
+ type IActionsheetScrollViewProps = VariantProps<typeof actionsheetScrollViewStyle> &
225
211
  React.ComponentPropsWithoutRef<typeof UIActionsheet.ScrollView>;
226
212
 
227
- type IActionsheetVirtualizedListProps = VariantProps<
228
- typeof actionsheetVirtualizedListStyle
229
- > &
213
+ type IActionsheetVirtualizedListProps = VariantProps<typeof actionsheetVirtualizedListStyle> &
230
214
  React.ComponentPropsWithoutRef<typeof UIActionsheet.VirtualizedList>;
231
215
 
232
216
  type IActionsheetFlatListProps = VariantProps<typeof actionsheetFlatListStyle> &
233
217
  React.ComponentPropsWithoutRef<typeof UIActionsheet.FlatList>;
234
218
 
235
- type IActionsheetSectionListProps = VariantProps<
236
- typeof actionsheetSectionListStyle
237
- > &
219
+ type IActionsheetSectionListProps = VariantProps<typeof actionsheetSectionListStyle> &
238
220
  React.ComponentPropsWithoutRef<typeof UIActionsheet.SectionList>;
239
221
 
240
- type IActionsheetSectionHeaderTextProps = VariantProps<
241
- typeof actionsheetSectionHeaderTextStyle
242
- > &
222
+ type IActionsheetSectionHeaderTextProps = VariantProps<typeof actionsheetSectionHeaderTextStyle> &
243
223
  React.ComponentPropsWithoutRef<typeof UIActionsheet.SectionHeaderText>;
244
224
 
245
225
  type IActionsheetIconProps = VariantProps<typeof actionsheetIconStyle> &
@@ -250,10 +230,10 @@ type IActionsheetIconProps = VariantProps<typeof actionsheetIconStyle> &
250
230
  width?: number;
251
231
  };
252
232
 
253
- const Actionsheet = React.forwardRef<
254
- React.ComponentRef<typeof UIActionsheet>,
255
- IActionsheetProps
256
- >(function Actionsheet({ className, ...props }, ref) {
233
+ const Actionsheet = React.forwardRef<React.ComponentRef<typeof UIActionsheet>, IActionsheetProps>(function Actionsheet(
234
+ { className, ...props },
235
+ ref,
236
+ ) {
257
237
  return (
258
238
  <UIActionsheet
259
239
  className={actionsheetStyle({
@@ -265,43 +245,38 @@ const Actionsheet = React.forwardRef<
265
245
  );
266
246
  });
267
247
 
268
- const ActionsheetContent = React.forwardRef<
269
- React.ComponentRef<typeof UIActionsheet.Content>,
270
- IActionsheetContentProps
271
- >(function ActionsheetContent({ className, ...props }, ref) {
272
- return (
273
- <UIActionsheet.Content
274
- className={actionsheetContentStyle({
275
- class: className,
276
- })}
277
- ref={ref}
278
- {...props}
279
- />
280
- );
281
- });
248
+ const ActionsheetContent = React.forwardRef<React.ComponentRef<typeof UIActionsheet.Content>, IActionsheetContentProps>(
249
+ function ActionsheetContent({ className, ...props }, ref) {
250
+ return (
251
+ <UIActionsheet.Content
252
+ className={actionsheetContentStyle({
253
+ class: className,
254
+ })}
255
+ ref={ref}
256
+ {...props}
257
+ />
258
+ );
259
+ },
260
+ );
282
261
 
283
- const ActionsheetItem = React.forwardRef<
284
- React.ComponentRef<typeof UIActionsheet.Item>,
285
- IActionsheetItemProps
286
- >(function ActionsheetItem({ className, ...props }, ref) {
287
- return (
288
- <UIActionsheet.Item
289
- className={actionsheetItemStyle({
290
- class: className,
291
- })}
292
- ref={ref}
293
- {...props}
294
- />
295
- );
296
- });
262
+ const ActionsheetItem = React.forwardRef<React.ComponentRef<typeof UIActionsheet.Item>, IActionsheetItemProps>(
263
+ function ActionsheetItem({ className, ...props }, ref) {
264
+ return (
265
+ <UIActionsheet.Item
266
+ className={actionsheetItemStyle({
267
+ class: className,
268
+ })}
269
+ ref={ref}
270
+ {...props}
271
+ />
272
+ );
273
+ },
274
+ );
297
275
 
298
276
  const ActionsheetItemText = React.forwardRef<
299
277
  React.ComponentRef<typeof UIActionsheet.ItemText>,
300
278
  IActionsheetItemTextProps
301
- >(function ActionsheetItemText(
302
- { isTruncated, bold, underline, strikeThrough, className, ...props },
303
- ref
304
- ) {
279
+ >(function ActionsheetItemText({ isTruncated, bold, underline, strikeThrough, className, ...props }, ref) {
305
280
  return (
306
281
  <UIActionsheet.ItemText
307
282
  className={actionsheetItemTextStyle({
@@ -439,18 +414,8 @@ const ActionsheetSectionHeaderText = React.forwardRef<
439
414
  React.ComponentRef<typeof UIActionsheet.SectionHeaderText>,
440
415
  IActionsheetSectionHeaderTextProps
441
416
  >(function ActionsheetSectionHeaderText(
442
- {
443
- className,
444
- isTruncated,
445
- bold,
446
- underline,
447
- strikeThrough,
448
- sub,
449
- italic,
450
- highlight,
451
- ...props
452
- },
453
- ref
417
+ { className, isTruncated, bold, underline, strikeThrough, sub, italic, highlight, ...props },
418
+ ref,
454
419
  ) {
455
420
  return (
456
421
  <UIActionsheet.SectionHeaderText
@@ -470,29 +435,22 @@ const ActionsheetSectionHeaderText = React.forwardRef<
470
435
  );
471
436
  });
472
437
 
473
- const ActionsheetIcon = React.forwardRef<
474
- React.ComponentRef<typeof UIActionsheet.Icon>,
475
- IActionsheetIconProps
476
- >(function ActionsheetIcon({ className, height, width, ...props }, ref) {
477
- if (typeof height === 'number' || typeof width === 'number') {
478
- return (
479
- <UIActionsheet.Icon
480
- ref={ref}
481
- {...props}
482
- height={height}
483
- width={width}
484
- className={actionsheetIconStyle({ class: className })}
485
- />
486
- );
487
- }
488
- return (
489
- <UIActionsheet.Icon
490
- className={actionsheetIconStyle({ class: className })}
491
- ref={ref}
492
- {...props}
493
- />
494
- );
495
- });
438
+ const ActionsheetIcon = React.forwardRef<React.ComponentRef<typeof UIActionsheet.Icon>, IActionsheetIconProps>(
439
+ function ActionsheetIcon({ className, height, width, ...props }, ref) {
440
+ if (typeof height === 'number' || typeof width === 'number') {
441
+ return (
442
+ <UIActionsheet.Icon
443
+ ref={ref}
444
+ {...props}
445
+ height={height}
446
+ width={width}
447
+ className={actionsheetIconStyle({ class: className })}
448
+ />
449
+ );
450
+ }
451
+ return <UIActionsheet.Icon className={actionsheetIconStyle({ class: className })} ref={ref} {...props} />;
452
+ },
453
+ );
496
454
 
497
455
  export {
498
456
  Actionsheet,
@@ -2,10 +2,7 @@
2
2
  import { createAlert } from '@gluestack-ui/core/alert/creator';
3
3
  import { View, Text } from 'react-native';
4
4
  import { tva } from '@gluestack-ui/utils/nativewind-utils';
5
- import {
6
- withStyleContext,
7
- useStyleContext,
8
- } from '@gluestack-ui/utils/nativewind-utils';
5
+ import { withStyleContext, useStyleContext } from '@gluestack-ui/utils/nativewind-utils';
9
6
  import React from 'react';
10
7
  import { cssInterop } from 'nativewind';
11
8
  import type { VariantProps } from '@gluestack-ui/utils/nativewind-utils';
@@ -62,32 +59,21 @@ cssInterop(UIIcon, {
62
59
  },
63
60
  });
64
61
 
65
- type IAlertProps = Omit<
66
- React.ComponentPropsWithoutRef<typeof UIAlert>,
67
- 'context'
68
- > &
69
- VariantProps<typeof alertStyle>;
62
+ type IAlertProps = Omit<React.ComponentPropsWithoutRef<typeof UIAlert>, 'context'> & VariantProps<typeof alertStyle>;
70
63
 
71
- const Alert = React.forwardRef<React.ComponentRef<typeof UIAlert>, IAlertProps>(
72
- function Alert({ className, variant = 'default', ...props }, ref) {
73
- return (
74
- <UIAlert
75
- className={alertStyle({ variant, class: className })}
76
- context={{ variant }}
77
- ref={ref}
78
- {...props}
79
- />
80
- );
81
- }
82
- );
64
+ const Alert = React.forwardRef<React.ComponentRef<typeof UIAlert>, IAlertProps>(function Alert(
65
+ { className, variant = 'default', ...props },
66
+ ref,
67
+ ) {
68
+ return <UIAlert className={alertStyle({ variant, class: className })} context={{ variant }} ref={ref} {...props} />;
69
+ });
83
70
 
84
- type IAlertTextProps = React.ComponentPropsWithoutRef<typeof UIAlert.Text> &
85
- VariantProps<typeof alertTextStyle>;
71
+ type IAlertTextProps = React.ComponentPropsWithoutRef<typeof UIAlert.Text> & VariantProps<typeof alertTextStyle>;
86
72
 
87
- const AlertText = React.forwardRef<
88
- React.ComponentRef<typeof UIAlert.Text>,
89
- IAlertTextProps
90
- >(function AlertText({ className, ...props }, ref) {
73
+ const AlertText = React.forwardRef<React.ComponentRef<typeof UIAlert.Text>, IAlertTextProps>(function AlertText(
74
+ { className, ...props },
75
+ ref,
76
+ ) {
91
77
  const { variant: parentVariant } = useStyleContext(SCOPE);
92
78
  return (
93
79
  <UIAlert.Text
@@ -110,32 +96,16 @@ type IAlertIconProps = React.ComponentPropsWithoutRef<typeof UIAlert.Icon> &
110
96
  size?: number | 'sm' | 'md' | 'lg' | 'xl';
111
97
  };
112
98
 
113
- const AlertIcon = React.forwardRef<
114
- React.ComponentRef<typeof UIAlert.Icon>,
115
- IAlertIconProps
116
- >(function AlertIcon({ className, size = 'sm', ...props }, ref) {
99
+ const AlertIcon = React.forwardRef<React.ComponentRef<typeof UIAlert.Icon>, IAlertIconProps>(function AlertIcon(
100
+ { className, size = 'sm', ...props },
101
+ ref,
102
+ ) {
117
103
  const { variant: parentVariant } = useStyleContext(SCOPE);
118
104
 
119
105
  if (typeof size === 'number') {
120
- return (
121
- <UIAlert.Icon
122
- ref={ref}
123
- {...props}
124
- className={alertIconStyle({ class: className })}
125
- size={size}
126
- />
127
- );
128
- } else if (
129
- (props.height !== undefined || props.width !== undefined) &&
130
- size === undefined
131
- ) {
132
- return (
133
- <UIAlert.Icon
134
- ref={ref}
135
- {...props}
136
- className={alertIconStyle({ class: className })}
137
- />
138
- );
106
+ return <UIAlert.Icon ref={ref} {...props} className={alertIconStyle({ class: className })} size={size} />;
107
+ } else if ((props.height !== undefined || props.width !== undefined) && size === undefined) {
108
+ return <UIAlert.Icon ref={ref} {...props} className={alertIconStyle({ class: className })} />;
139
109
  }
140
110
  return (
141
111
  <UIAlert.Icon
@@ -1,20 +1,11 @@
1
1
  'use client';
2
2
  import { createAlertDialog } from '@gluestack-ui/core/alert-dialog/creator';
3
3
  import type { VariantProps } from '@gluestack-ui/utils/nativewind-utils';
4
- import {
5
- tva,
6
- useStyleContext,
7
- withStyleContext,
8
- } from '@gluestack-ui/utils/nativewind-utils';
4
+ import { tva, useStyleContext, withStyleContext } from '@gluestack-ui/utils/nativewind-utils';
9
5
  import { cssInterop } from 'nativewind';
10
6
  import React from 'react';
11
7
  import { Pressable, ScrollView, View } from 'react-native';
12
- import Animated, {
13
- Easing,
14
- FadeIn,
15
- FadeOut,
16
- ZoomIn
17
- } from 'react-native-reanimated';
8
+ import Animated, { Easing, FadeIn, FadeOut, ZoomIn } from 'react-native-reanimated';
18
9
 
19
10
  const SCOPE = 'ALERT_DIALOG';
20
11
 
@@ -80,55 +71,40 @@ const alertDialogBackdropStyle = tva({
80
71
  base: 'absolute left-0 top-0 right-0 bottom-0 bg-black/50 web:cursor-default',
81
72
  });
82
73
 
83
- type IAlertDialogProps = React.ComponentPropsWithoutRef<
84
- typeof UIAccessibleAlertDialog
85
- > &
74
+ type IAlertDialogProps = React.ComponentPropsWithoutRef<typeof UIAccessibleAlertDialog> &
86
75
  VariantProps<typeof alertDialogStyle>;
87
76
 
88
- type IAlertDialogContentProps = React.ComponentPropsWithoutRef<
89
- typeof UIAccessibleAlertDialog.Content
90
- > &
77
+ type IAlertDialogContentProps = React.ComponentPropsWithoutRef<typeof UIAccessibleAlertDialog.Content> &
91
78
  VariantProps<typeof alertDialogContentStyle> & { className?: string };
92
79
 
93
- type IAlertDialogCloseButtonProps = React.ComponentPropsWithoutRef<
94
- typeof UIAccessibleAlertDialog.CloseButton
95
- > &
80
+ type IAlertDialogCloseButtonProps = React.ComponentPropsWithoutRef<typeof UIAccessibleAlertDialog.CloseButton> &
96
81
  VariantProps<typeof alertDialogCloseButtonStyle>;
97
82
 
98
- type IAlertDialogHeaderProps = React.ComponentPropsWithoutRef<
99
- typeof UIAccessibleAlertDialog.Header
100
- > &
83
+ type IAlertDialogHeaderProps = React.ComponentPropsWithoutRef<typeof UIAccessibleAlertDialog.Header> &
101
84
  VariantProps<typeof alertDialogHeaderStyle>;
102
85
 
103
- type IAlertDialogFooterProps = React.ComponentPropsWithoutRef<
104
- typeof UIAccessibleAlertDialog.Footer
105
- > &
86
+ type IAlertDialogFooterProps = React.ComponentPropsWithoutRef<typeof UIAccessibleAlertDialog.Footer> &
106
87
  VariantProps<typeof alertDialogFooterStyle>;
107
88
 
108
- type IAlertDialogBodyProps = React.ComponentPropsWithoutRef<
109
- typeof UIAccessibleAlertDialog.Body
110
- > &
89
+ type IAlertDialogBodyProps = React.ComponentPropsWithoutRef<typeof UIAccessibleAlertDialog.Body> &
111
90
  VariantProps<typeof alertDialogBodyStyle>;
112
91
 
113
- type IAlertDialogBackdropProps = React.ComponentPropsWithoutRef<
114
- typeof UIAccessibleAlertDialog.Backdrop
115
- > &
92
+ type IAlertDialogBackdropProps = React.ComponentPropsWithoutRef<typeof UIAccessibleAlertDialog.Backdrop> &
116
93
  VariantProps<typeof alertDialogBackdropStyle> & { className?: string };
117
94
 
118
- const AlertDialog = React.forwardRef<
119
- React.ComponentRef<typeof UIAccessibleAlertDialog>,
120
- IAlertDialogProps
121
- >(function AlertDialog({ className, size = 'md', ...props }, ref) {
122
- return (
123
- <UIAccessibleAlertDialog
124
- ref={ref}
125
- {...props}
126
- className={alertDialogStyle({ class: className })}
127
- context={{ size }}
128
- pointerEvents="box-none"
129
- />
130
- );
131
- });
95
+ const AlertDialog = React.forwardRef<React.ComponentRef<typeof UIAccessibleAlertDialog>, IAlertDialogProps>(
96
+ function AlertDialog({ className, size = 'md', ...props }, ref) {
97
+ return (
98
+ <UIAccessibleAlertDialog
99
+ ref={ref}
100
+ {...props}
101
+ className={alertDialogStyle({ class: className })}
102
+ context={{ size }}
103
+ pointerEvents="box-none"
104
+ />
105
+ );
106
+ },
107
+ );
132
108
 
133
109
  const AlertDialogContent = React.forwardRef<
134
110
  React.ComponentRef<typeof UIAccessibleAlertDialog.Content>,
@@ -249,6 +225,5 @@ export {
249
225
  AlertDialogCloseButton,
250
226
  AlertDialogContent,
251
227
  AlertDialogFooter,
252
- AlertDialogHeader
228
+ AlertDialogHeader,
253
229
  };
254
-
@@ -36,66 +36,38 @@ const avatarImageStyle = tva({
36
36
  base: 'h-full w-full rounded-full absolute',
37
37
  });
38
38
 
39
- type IAvatarProps = Omit<
40
- React.ComponentPropsWithoutRef<typeof UIAvatar>,
41
- 'context'
42
- > &
43
- VariantProps<typeof avatarStyle>;
44
-
45
- const Avatar = React.forwardRef<
46
- React.ComponentRef<typeof UIAvatar>,
47
- IAvatarProps
48
- >(function Avatar({ className, ...props }, ref) {
49
- return (
50
- <UIAvatar
51
- ref={ref}
52
- {...props}
53
- className={avatarStyle({ class: className })}
54
- context={{}}
55
- />
56
- );
39
+ type IAvatarProps = Omit<React.ComponentPropsWithoutRef<typeof UIAvatar>, 'context'> & VariantProps<typeof avatarStyle>;
40
+
41
+ const Avatar = React.forwardRef<React.ComponentRef<typeof UIAvatar>, IAvatarProps>(function Avatar(
42
+ { className, ...props },
43
+ ref,
44
+ ) {
45
+ return <UIAvatar ref={ref} {...props} className={avatarStyle({ class: className })} context={{}} />;
57
46
  });
58
47
 
59
- type IAvatarBadgeProps = React.ComponentPropsWithoutRef<typeof UIAvatar.Badge> &
60
- VariantProps<typeof avatarBadgeStyle>;
48
+ type IAvatarBadgeProps = React.ComponentPropsWithoutRef<typeof UIAvatar.Badge> & VariantProps<typeof avatarBadgeStyle>;
61
49
 
62
- const AvatarBadge = React.forwardRef<
63
- React.ComponentRef<typeof UIAvatar.Badge>,
64
- IAvatarBadgeProps
65
- >(function AvatarBadge({ className, ...props }, ref) {
66
- return (
67
- <UIAvatar.Badge
68
- ref={ref}
69
- {...props}
70
- className={avatarBadgeStyle({ class: className })}
71
- />
72
- );
50
+ const AvatarBadge = React.forwardRef<React.ComponentRef<typeof UIAvatar.Badge>, IAvatarBadgeProps>(function AvatarBadge(
51
+ { className, ...props },
52
+ ref,
53
+ ) {
54
+ return <UIAvatar.Badge ref={ref} {...props} className={avatarBadgeStyle({ class: className })} />;
73
55
  });
74
56
 
75
- type IAvatarFallbackTextProps = React.ComponentPropsWithoutRef<
76
- typeof UIAvatar.FallbackText
77
- > &
57
+ type IAvatarFallbackTextProps = React.ComponentPropsWithoutRef<typeof UIAvatar.FallbackText> &
78
58
  VariantProps<typeof avatarFallbackTextStyle>;
79
- const AvatarFallbackText = React.forwardRef<
80
- React.ComponentRef<typeof UIAvatar.FallbackText>,
81
- IAvatarFallbackTextProps
82
- >(function AvatarFallbackText({ className, ...props }, ref) {
83
- return (
84
- <UIAvatar.FallbackText
85
- ref={ref}
86
- {...props}
87
- className={avatarFallbackTextStyle({ class: className })}
88
- />
89
- );
90
- });
91
-
92
- type IAvatarImageProps = React.ComponentPropsWithoutRef<typeof UIAvatar.Image> &
93
- VariantProps<typeof avatarImageStyle>;
94
-
95
- const AvatarImage = React.forwardRef<
96
- React.ComponentRef<typeof UIAvatar.Image>,
97
- IAvatarImageProps
98
- >(function AvatarImage({ className, ...props }, ref) {
59
+ const AvatarFallbackText = React.forwardRef<React.ComponentRef<typeof UIAvatar.FallbackText>, IAvatarFallbackTextProps>(
60
+ function AvatarFallbackText({ className, ...props }, ref) {
61
+ return <UIAvatar.FallbackText ref={ref} {...props} className={avatarFallbackTextStyle({ class: className })} />;
62
+ },
63
+ );
64
+
65
+ type IAvatarImageProps = React.ComponentPropsWithoutRef<typeof UIAvatar.Image> & VariantProps<typeof avatarImageStyle>;
66
+
67
+ const AvatarImage = React.forwardRef<React.ComponentRef<typeof UIAvatar.Image>, IAvatarImageProps>(function AvatarImage(
68
+ { className, ...props },
69
+ ref,
70
+ ) {
99
71
  return (
100
72
  <UIAvatar.Image
101
73
  ref={ref}
@@ -108,13 +80,12 @@ const AvatarImage = React.forwardRef<
108
80
  );
109
81
  });
110
82
 
111
- type IAvatarGroupProps = React.ComponentPropsWithoutRef<typeof UIAvatar.Group> &
112
- VariantProps<typeof avatarGroupStyle>;
83
+ type IAvatarGroupProps = React.ComponentPropsWithoutRef<typeof UIAvatar.Group> & VariantProps<typeof avatarGroupStyle>;
113
84
 
114
- const AvatarGroup = React.forwardRef<
115
- React.ComponentRef<typeof UIAvatar.Group>,
116
- IAvatarGroupProps
117
- >(function AvatarGroup({ className, ...props }, ref) {
85
+ const AvatarGroup = React.forwardRef<React.ComponentRef<typeof UIAvatar.Group>, IAvatarGroupProps>(function AvatarGroup(
86
+ { className, ...props },
87
+ ref,
88
+ ) {
118
89
  return (
119
90
  <UIAvatar.Group
120
91
  ref={ref}
@@ -129,11 +100,4 @@ const AvatarGroup = React.forwardRef<
129
100
  // Alias for shadcn compatibility
130
101
  const AvatarFallback = AvatarFallbackText;
131
102
 
132
- export {
133
- Avatar,
134
- AvatarBadge,
135
- AvatarFallback,
136
- AvatarFallbackText,
137
- AvatarGroup,
138
- AvatarImage,
139
- };
103
+ export { Avatar, AvatarBadge, AvatarFallback, AvatarFallbackText, AvatarGroup, AvatarImage };