@flipova/foundation 2.3.0 → 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 (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
@@ -79,79 +79,67 @@ const useImageViewerContext = () => {
79
79
  };
80
80
 
81
81
  // Main ImageViewer Component
82
- const ImageViewer = React.forwardRef<HTMLDivElement, ImageViewerProps>(
83
- function ImageViewer(
84
- {
82
+ const ImageViewer = React.forwardRef<HTMLDivElement, ImageViewerProps>(function ImageViewer(
83
+ { images, defaultOpen = false, isOpen: controlledIsOpen, onOpenChange, onIndexChange, initialIndex = 0, children },
84
+ ref,
85
+ ) {
86
+ const [uncontrolledIsOpen, setUncontrolledIsOpen] = useState(defaultOpen);
87
+ const [currentIndex, setCurrentIndex] = useState(initialIndex);
88
+
89
+ const isControlled = controlledIsOpen !== undefined;
90
+ const isOpen = isControlled ? controlledIsOpen : uncontrolledIsOpen;
91
+
92
+ useEffect(() => {
93
+ onIndexChange?.(currentIndex);
94
+ }, [currentIndex, onIndexChange]);
95
+
96
+ const open = useCallback(() => {
97
+ if (!isControlled) {
98
+ setUncontrolledIsOpen(true);
99
+ }
100
+ onOpenChange?.(true);
101
+ }, [isControlled, onOpenChange]);
102
+
103
+ const close = useCallback(() => {
104
+ if (!isControlled) {
105
+ setUncontrolledIsOpen(false);
106
+ }
107
+ onOpenChange?.(false);
108
+ }, [isControlled, onOpenChange]);
109
+
110
+ const goNext = useCallback(() => {
111
+ setCurrentIndex((prev) => Math.min(prev + 1, images.length - 1));
112
+ }, [images.length]);
113
+
114
+ const goPrevious = useCallback(() => {
115
+ setCurrentIndex((prev) => Math.max(prev - 1, 0));
116
+ }, []);
117
+
118
+ const contextValue = React.useMemo(
119
+ () => ({
85
120
  images,
86
- defaultOpen = false,
87
- isOpen: controlledIsOpen,
88
- onOpenChange,
89
- onIndexChange,
90
- initialIndex = 0,
91
- children,
92
- },
93
- ref
94
- ) {
95
- const [uncontrolledIsOpen, setUncontrolledIsOpen] = useState(defaultOpen);
96
- const [currentIndex, setCurrentIndex] = useState(initialIndex);
97
-
98
- const isControlled = controlledIsOpen !== undefined;
99
- const isOpen = isControlled ? controlledIsOpen : uncontrolledIsOpen;
100
-
101
- useEffect(() => {
102
- onIndexChange?.(currentIndex);
103
- }, [currentIndex, onIndexChange]);
104
-
105
- const open = useCallback(() => {
106
- if (!isControlled) {
107
- setUncontrolledIsOpen(true);
108
- }
109
- onOpenChange?.(true);
110
- }, [isControlled, onOpenChange]);
111
-
112
- const close = useCallback(() => {
113
- if (!isControlled) {
114
- setUncontrolledIsOpen(false);
115
- }
116
- onOpenChange?.(false);
117
- }, [isControlled, onOpenChange]);
118
-
119
- const goNext = useCallback(() => {
120
- setCurrentIndex((prev) => Math.min(prev + 1, images.length - 1));
121
- }, [images.length]);
122
-
123
- const goPrevious = useCallback(() => {
124
- setCurrentIndex((prev) => Math.max(prev - 1, 0));
125
- }, []);
126
-
127
- const contextValue = React.useMemo(
128
- () => ({
129
- images,
130
- currentIndex,
131
- isOpen,
132
- open,
133
- close,
134
- goNext,
135
- goPrevious,
136
- }),
137
- [images, currentIndex, isOpen, open, close, goNext, goPrevious]
138
- );
121
+ currentIndex,
122
+ isOpen,
123
+ open,
124
+ close,
125
+ goNext,
126
+ goPrevious,
127
+ }),
128
+ [images, currentIndex, isOpen, open, close, goNext, goPrevious],
129
+ );
139
130
 
140
- return (
141
- <div ref={ref} className="w-full">
142
- <ImageViewerContext.Provider value={contextValue}>
143
- {children}
144
- </ImageViewerContext.Provider>
145
- </div>
146
- );
147
- }
148
- );
131
+ return (
132
+ <div ref={ref} className="w-full">
133
+ <ImageViewerContext.Provider value={contextValue}>{children}</ImageViewerContext.Provider>
134
+ </div>
135
+ );
136
+ });
149
137
 
150
138
  // Trigger Component
151
- const ImageViewerTrigger = React.forwardRef<
152
- HTMLDivElement,
153
- ImageViewerTriggerProps
154
- >(function ImageViewerTrigger({ children, onPress, ...props }, ref) {
139
+ const ImageViewerTrigger = React.forwardRef<HTMLDivElement, ImageViewerTriggerProps>(function ImageViewerTrigger(
140
+ { children, onPress, ...props },
141
+ ref,
142
+ ) {
155
143
  const { open } = useImageViewerContext();
156
144
 
157
145
  const handlePress = useCallback(() => {
@@ -168,10 +156,10 @@ const ImageViewerTrigger = React.forwardRef<
168
156
 
169
157
  // Content Component (Uses gluestack Overlay for proper portal rendering)
170
158
  // Context provider is placed INSIDE the Overlay so portaled content has access
171
- const ImageViewerContent = React.forwardRef<
172
- HTMLDivElement,
173
- { children?: React.ReactNode }
174
- >(function ImageViewerContent({ children }, ref) {
159
+ const ImageViewerContent = React.forwardRef<HTMLDivElement, { children?: React.ReactNode }>(function ImageViewerContent(
160
+ { children },
161
+ ref,
162
+ ) {
175
163
  const context = useImageViewerContext();
176
164
  const { images, currentIndex, isOpen, close, goNext, goPrevious } = context;
177
165
  const currentImage = images[currentIndex];
@@ -196,11 +184,7 @@ const ImageViewerContent = React.forwardRef<
196
184
  }, [isOpen, close, goNext, goPrevious]);
197
185
 
198
186
  return (
199
- <Overlay
200
- isOpen={isOpen}
201
- onRequestClose={close}
202
- isKeyboardDismissable={true}
203
- >
187
+ <Overlay isOpen={isOpen} onRequestClose={close} isKeyboardDismissable={true}>
204
188
  <ImageViewerContext.Provider value={context}>
205
189
  <div className={imageViewerModalStyle({})}>
206
190
  <div ref={ref} className={imageViewerContentStyle({})}>
@@ -220,30 +204,29 @@ const ImageViewerContent = React.forwardRef<
220
204
  });
221
205
 
222
206
  // Close Button Component
223
- const ImageViewerCloseButton = React.forwardRef<
224
- HTMLButtonElement,
225
- { className?: string }
226
- >(function ImageViewerCloseButton({ className, ...props }, ref) {
227
- const { close } = useImageViewerContext();
207
+ const ImageViewerCloseButton = React.forwardRef<HTMLButtonElement, { className?: string }>(
208
+ function ImageViewerCloseButton({ className, ...props }, ref) {
209
+ const { close } = useImageViewerContext();
228
210
 
229
- return (
230
- <button
231
- ref={ref}
232
- onClick={close}
233
- className={imageViewerCloseButtonStyle({ class: className })}
234
- aria-label="Close image viewer"
235
- {...props}
236
- >
237
- ✕
238
- </button>
239
- );
240
- });
211
+ return (
212
+ <button
213
+ ref={ref}
214
+ onClick={close}
215
+ className={imageViewerCloseButtonStyle({ class: className })}
216
+ aria-label="Close image viewer"
217
+ {...props}
218
+ >
219
+ ✕
220
+ </button>
221
+ );
222
+ },
223
+ );
241
224
 
242
225
  // Navigation Component
243
- const ImageViewerNavigation = React.forwardRef<
244
- HTMLDivElement,
245
- { className?: string }
246
- >(function ImageViewerNavigation({ className }, ref) {
226
+ const ImageViewerNavigation = React.forwardRef<HTMLDivElement, { className?: string }>(function ImageViewerNavigation(
227
+ { className },
228
+ ref,
229
+ ) {
247
230
  const { goPrevious, goNext, currentIndex, images } = useImageViewerContext();
248
231
 
249
232
  const canGoPrevious = currentIndex > 0;
@@ -252,21 +235,13 @@ const ImageViewerNavigation = React.forwardRef<
252
235
  return (
253
236
  <div ref={ref} className={imageViewerNavigationStyle({ class: className })}>
254
237
  {canGoPrevious && (
255
- <button
256
- onClick={goPrevious}
257
- className={imageViewerNavButtonStyle({})}
258
- aria-label="Previous image"
259
- >
238
+ <button onClick={goPrevious} className={imageViewerNavButtonStyle({})} aria-label="Previous image">
260
239
  ‹
261
240
  </button>
262
241
  )}
263
242
  <div className="flex-1" />
264
243
  {canGoNext && (
265
- <button
266
- onClick={goNext}
267
- className={imageViewerNavButtonStyle({})}
268
- aria-label="Next image"
269
- >
244
+ <button onClick={goNext} className={imageViewerNavButtonStyle({})} aria-label="Next image">
270
245
  ›
271
246
  </button>
272
247
  )}
@@ -275,10 +250,10 @@ const ImageViewerNavigation = React.forwardRef<
275
250
  });
276
251
 
277
252
  // Counter Component
278
- const ImageViewerCounter = React.forwardRef<
279
- HTMLDivElement,
280
- { className?: string }
281
- >(function ImageViewerCounter({ className }, ref) {
253
+ const ImageViewerCounter = React.forwardRef<HTMLDivElement, { className?: string }>(function ImageViewerCounter(
254
+ { className },
255
+ ref,
256
+ ) {
282
257
  const { currentIndex, images } = useImageViewerContext();
283
258
 
284
259
  return (
@@ -46,20 +46,13 @@ const inputFieldStyle = tva({
46
46
  base: 'flex-1 text-foreground text-sm md:text-sm py-1 h-full placeholder:text-muted-foreground web:outline-none ios:leading-[0px] web:cursor-text web:data-[disabled=true]:cursor-not-allowed',
47
47
  });
48
48
 
49
- type IInputProps = React.ComponentProps<typeof UIInput> &
50
- VariantProps<typeof inputStyle> & { className?: string };
51
- const Input = React.forwardRef<React.ComponentRef<typeof UIInput>, IInputProps>(
52
- function Input({ className, ...props }, ref) {
53
- return (
54
- <UIInput
55
- ref={ref}
56
- {...props}
57
- className={inputStyle({ class: className })}
58
- context={{}}
59
- />
60
- );
61
- }
62
- );
49
+ type IInputProps = React.ComponentProps<typeof UIInput> & VariantProps<typeof inputStyle> & { className?: string };
50
+ const Input = React.forwardRef<React.ComponentRef<typeof UIInput>, IInputProps>(function Input(
51
+ { className, ...props },
52
+ ref,
53
+ ) {
54
+ return <UIInput ref={ref} {...props} className={inputStyle({ class: className })} context={{}} />;
55
+ });
63
56
 
64
57
  type IInputIconProps = React.ComponentProps<typeof UIInput.Icon> &
65
58
  VariantProps<typeof inputIconStyle> & {
@@ -68,26 +61,20 @@ type IInputIconProps = React.ComponentProps<typeof UIInput.Icon> &
68
61
  width?: number;
69
62
  };
70
63
 
71
- const InputIcon = React.forwardRef<
72
- React.ComponentRef<typeof UIInput.Icon>,
73
- IInputIconProps
74
- >(function InputIcon({ className, ...props }, ref) {
75
- return (
76
- <UIInput.Icon
77
- ref={ref}
78
- {...props}
79
- className={inputIconStyle({ class: className })}
80
- />
81
- );
64
+ const InputIcon = React.forwardRef<React.ComponentRef<typeof UIInput.Icon>, IInputIconProps>(function InputIcon(
65
+ { className, ...props },
66
+ ref,
67
+ ) {
68
+ return <UIInput.Icon ref={ref} {...props} className={inputIconStyle({ class: className })} />;
82
69
  });
83
70
 
84
71
  type IInputSlotProps = React.ComponentProps<typeof UIInput.Slot> &
85
72
  VariantProps<typeof inputSlotStyle> & { className?: string };
86
73
 
87
- const InputSlot = React.forwardRef<
88
- React.ComponentRef<typeof UIInput.Slot>,
89
- IInputSlotProps
90
- >(function InputSlot({ className, ...props }, ref) {
74
+ const InputSlot = React.forwardRef<React.ComponentRef<typeof UIInput.Slot>, IInputSlotProps>(function InputSlot(
75
+ { className, ...props },
76
+ ref,
77
+ ) {
91
78
  return (
92
79
  <UIInput.Slot
93
80
  ref={ref}
@@ -102,10 +89,10 @@ const InputSlot = React.forwardRef<
102
89
  type IInputFieldProps = React.ComponentProps<typeof UIInput.Input> &
103
90
  VariantProps<typeof inputFieldStyle> & { className?: string };
104
91
 
105
- const InputField = React.forwardRef<
106
- React.ComponentRef<typeof UIInput.Input>,
107
- IInputFieldProps
108
- >(function InputField({ className, ...props }, ref) {
92
+ const InputField = React.forwardRef<React.ComponentRef<typeof UIInput.Input>, IInputFieldProps>(function InputField(
93
+ { className, ...props },
94
+ ref,
95
+ ) {
109
96
  return (
110
97
  <UIInput.Input
111
98
  ref={ref}
@@ -39,11 +39,11 @@ const linkTextStyle = tva({
39
39
  },
40
40
  size: {
41
41
  '2xs': 'text-2xs',
42
- 'xs': 'text-xs',
43
- 'sm': 'text-sm',
44
- 'md': 'text-base',
45
- 'lg': 'text-lg',
46
- 'xl': 'text-xl',
42
+ xs: 'text-xs',
43
+ sm: 'text-sm',
44
+ md: 'text-base',
45
+ lg: 'text-lg',
46
+ xl: 'text-xl',
47
47
  '2xl': 'text-2xl',
48
48
  '3xl': 'text-3xl',
49
49
  '4xl': 'text-4xl',
@@ -62,28 +62,22 @@ const linkTextStyle = tva({
62
62
  },
63
63
  });
64
64
 
65
- type ILinkProps = React.ComponentProps<typeof UILink> &
66
- VariantProps<typeof linkStyle> & { className?: string };
65
+ type ILinkProps = React.ComponentProps<typeof UILink> & VariantProps<typeof linkStyle> & { className?: string };
67
66
 
68
- const Link = React.forwardRef<React.ComponentRef<typeof UILink>, ILinkProps>(
69
- function Link({ className, ...props }, ref) {
70
- return (
71
- <UILink
72
- ref={ref}
73
- {...props}
74
- className={linkStyle({ class: className })}
75
- />
76
- );
77
- }
78
- );
67
+ const Link = React.forwardRef<React.ComponentRef<typeof UILink>, ILinkProps>(function Link(
68
+ { className, ...props },
69
+ ref,
70
+ ) {
71
+ return <UILink ref={ref} {...props} className={linkStyle({ class: className })} />;
72
+ });
79
73
 
80
74
  type ILinkTextProps = React.ComponentProps<typeof UILink.Text> &
81
75
  VariantProps<typeof linkTextStyle> & { className?: string };
82
76
 
83
- const LinkText = React.forwardRef<
84
- React.ComponentRef<typeof UILink.Text>,
85
- ILinkTextProps
86
- >(function LinkText({ className, size = 'md', ...props }, ref) {
77
+ const LinkText = React.forwardRef<React.ComponentRef<typeof UILink.Text>, ILinkTextProps>(function LinkText(
78
+ { className, size = 'md', ...props },
79
+ ref,
80
+ ) {
87
81
  return (
88
82
  <UILink.Text
89
83
  ref={ref}
@@ -3,7 +3,7 @@ import {
3
3
  GlassContainer as ExpoGlassContainer,
4
4
  GlassView as ExpoGlassView,
5
5
  type GlassContainerProps,
6
- type GlassViewProps
6
+ type GlassViewProps,
7
7
  } from 'expo-glass-effect';
8
8
 
9
9
  import { cssInterop } from 'nativewind';
@@ -25,10 +25,10 @@ type IGlassContainerProps = GlassContainerProps & {
25
25
  className?: string;
26
26
  };
27
27
 
28
- export const GlassView = React.forwardRef<
29
- React.ComponentRef<typeof ExpoGlassView>,
30
- IGlassViewProps
31
- >(function GlassView({ className, ...props }, ref) {
28
+ export const GlassView = React.forwardRef<React.ComponentRef<typeof ExpoGlassView>, IGlassViewProps>(function GlassView(
29
+ { className, ...props },
30
+ ref,
31
+ ) {
32
32
  return (
33
33
  <ExpoGlassView
34
34
  ref={ref}
@@ -41,29 +41,23 @@ export const GlassView = React.forwardRef<
41
41
 
42
42
  GlassView.displayName = 'GlassView';
43
43
 
44
- export const GlassContainer = React.forwardRef<
45
- React.ComponentRef<typeof ExpoGlassContainer>,
46
- IGlassContainerProps
47
- >(function GlassContainer({ className, ...props }, ref) {
48
- return (
49
- <ExpoGlassContainer
50
- ref={ref}
51
- {...props}
52
- // @ts-ignore - className support via cssInterop
53
- className={glassContainerStyle({ className })}
54
- />
55
- );
56
- });
44
+ export const GlassContainer = React.forwardRef<React.ComponentRef<typeof ExpoGlassContainer>, IGlassContainerProps>(
45
+ function GlassContainer({ className, ...props }, ref) {
46
+ return (
47
+ <ExpoGlassContainer
48
+ ref={ref}
49
+ {...props}
50
+ // @ts-ignore - className support via cssInterop
51
+ className={glassContainerStyle({ className })}
52
+ />
53
+ );
54
+ },
55
+ );
57
56
 
58
57
  GlassContainer.displayName = 'GlassContainer';
59
58
 
60
59
  export { isGlassEffectAPIAvailable, isLiquidGlassAvailable } from 'expo-glass-effect';
61
- export type {
62
- GlassColorScheme,
63
- GlassContainerProps,
64
- GlassStyle,
65
- GlassViewProps
66
- } from 'expo-glass-effect';
60
+ export type { GlassColorScheme, GlassContainerProps, GlassStyle, GlassViewProps } from 'expo-glass-effect';
67
61
 
68
62
  cssInterop(ExpoGlassView, {
69
63
  className: 'style',
@@ -71,4 +65,4 @@ cssInterop(ExpoGlassView, {
71
65
 
72
66
  cssInterop(ExpoGlassContainer, {
73
67
  className: 'style',
74
- });
68
+ });
@@ -56,8 +56,7 @@ const menuItemLabelStyle = tva({
56
56
 
57
57
  const BackdropPressable = React.forwardRef<
58
58
  React.ComponentRef<typeof Pressable>,
59
- React.ComponentPropsWithoutRef<typeof Pressable> &
60
- VariantProps<typeof menuBackdropStyle>
59
+ React.ComponentPropsWithoutRef<typeof Pressable> & VariantProps<typeof menuBackdropStyle>
61
60
  >(function BackdropPressable({ className, ...props }, ref) {
62
61
  return (
63
62
  <Pressable
@@ -74,10 +73,10 @@ type IMenuItemProps = VariantProps<typeof menuItemStyle> & {
74
73
  className?: string;
75
74
  } & React.ComponentPropsWithoutRef<typeof Pressable>;
76
75
 
77
- const Item = React.forwardRef<
78
- React.ComponentRef<typeof Pressable>,
79
- IMenuItemProps
80
- >(function Item({ className, ...props }, ref) {
76
+ const Item = React.forwardRef<React.ComponentRef<typeof Pressable>, IMenuItemProps>(function Item(
77
+ { className, ...props },
78
+ ref,
79
+ ) {
81
80
  return (
82
81
  <Pressable
83
82
  ref={ref}
@@ -91,22 +90,13 @@ const Item = React.forwardRef<
91
90
 
92
91
  const Separator = React.forwardRef<
93
92
  React.ComponentRef<typeof View>,
94
- React.ComponentPropsWithoutRef<typeof View> &
95
- VariantProps<typeof menuSeparatorStyle>
93
+ React.ComponentPropsWithoutRef<typeof View> & VariantProps<typeof menuSeparatorStyle>
96
94
  >(function Separator({ className, ...props }, ref) {
97
- return (
98
- <View
99
- ref={ref}
100
- className={menuSeparatorStyle({ class: className })}
101
- {...props}
102
- />
103
- );
95
+ return <View ref={ref} className={menuSeparatorStyle({ class: className })} {...props} />;
104
96
  });
105
97
 
106
98
  cssInterop(AnimatedView, { className: 'style' });
107
99
 
108
-
109
-
110
100
  export const UIMenu = createMenu({
111
101
  Root: AnimatedView,
112
102
  Item: Item,
@@ -115,61 +105,23 @@ export const UIMenu = createMenu({
115
105
  Separator: Separator,
116
106
  });
117
107
 
118
-
119
- type IMenuProps = React.ComponentProps<typeof UIMenu> &
120
- VariantProps<typeof menuStyle> & { className?: string };
108
+ type IMenuProps = React.ComponentProps<typeof UIMenu> & VariantProps<typeof menuStyle> & { className?: string };
121
109
  type IMenuItemLabelProps = React.ComponentProps<typeof UIMenu.ItemLabel> &
122
110
  VariantProps<typeof menuItemLabelStyle> & { className?: string };
123
111
 
124
- const Menu = React.forwardRef<React.ComponentRef<typeof UIMenu>, IMenuProps>(
125
- function Menu({ className, ...props }, ref) {
126
- return (
127
- <UIMenu
128
- entering={ZoomIn.duration(150).withInitialValues({
129
- transform: [{ scale: 0.9 }],
130
- opacity: 0,
131
- })}
132
- exiting={FadeOut.duration(150)}
133
- ref={ref}
134
- className={menuStyle({
135
- class: className,
136
- })}
137
- {...props}
138
- />
139
- );
140
- }
141
- );
142
-
143
- const MenuItem = UIMenu.Item;
144
-
145
- const MenuItemLabel = React.forwardRef<
146
- React.ComponentRef<typeof UIMenu.ItemLabel>,
147
- IMenuItemLabelProps
148
- >(function MenuItemLabel(
149
- {
150
- className,
151
- isTruncated,
152
- bold,
153
- underline,
154
- strikeThrough,
155
- sub,
156
- italic,
157
- highlight,
158
- ...props
159
- },
160
- ref
112
+ const Menu = React.forwardRef<React.ComponentRef<typeof UIMenu>, IMenuProps>(function Menu(
113
+ { className, ...props },
114
+ ref,
161
115
  ) {
162
116
  return (
163
- <UIMenu.ItemLabel
117
+ <UIMenu
118
+ entering={ZoomIn.duration(150).withInitialValues({
119
+ transform: [{ scale: 0.9 }],
120
+ opacity: 0,
121
+ })}
122
+ exiting={FadeOut.duration(150)}
164
123
  ref={ref}
165
- className={menuItemLabelStyle({
166
- isTruncated: isTruncated as boolean,
167
- bold: bold as boolean,
168
- underline: underline as boolean,
169
- strikeThrough: strikeThrough as boolean,
170
- sub: sub as boolean,
171
- italic: italic as boolean,
172
- highlight: highlight as boolean,
124
+ className={menuStyle({
173
125
  class: className,
174
126
  })}
175
127
  {...props}
@@ -177,6 +129,32 @@ const MenuItemLabel = React.forwardRef<
177
129
  );
178
130
  });
179
131
 
132
+ const MenuItem = UIMenu.Item;
133
+
134
+ const MenuItemLabel = React.forwardRef<React.ComponentRef<typeof UIMenu.ItemLabel>, IMenuItemLabelProps>(
135
+ function MenuItemLabel(
136
+ { className, isTruncated, bold, underline, strikeThrough, sub, italic, highlight, ...props },
137
+ ref,
138
+ ) {
139
+ return (
140
+ <UIMenu.ItemLabel
141
+ ref={ref}
142
+ className={menuItemLabelStyle({
143
+ isTruncated: isTruncated as boolean,
144
+ bold: bold as boolean,
145
+ underline: underline as boolean,
146
+ strikeThrough: strikeThrough as boolean,
147
+ sub: sub as boolean,
148
+ italic: italic as boolean,
149
+ highlight: highlight as boolean,
150
+ class: className,
151
+ })}
152
+ {...props}
153
+ />
154
+ );
155
+ },
156
+ );
157
+
180
158
  const MenuSeparator = UIMenu.Separator;
181
159
 
182
160
  Menu.displayName = 'Menu';