@react-native-reusables/cli 0.4.0 → 0.4.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.
- package/__generated/components/ui/accordion.tsx +53 -44
- package/__generated/components/ui/alert-dialog.tsx +96 -84
- package/__generated/components/ui/alert.tsx +33 -37
- package/__generated/components/ui/avatar.tsx +28 -22
- package/__generated/components/ui/badge.tsx +4 -3
- package/__generated/components/ui/button.tsx +18 -22
- package/__generated/components/ui/card.tsx +70 -43
- package/__generated/components/ui/checkbox.tsx +25 -24
- package/__generated/components/ui/context-menu.tsx +140 -121
- package/__generated/components/ui/dialog.tsx +74 -62
- package/__generated/components/ui/dropdown-menu.tsx +147 -126
- package/__generated/components/ui/hover-card.tsx +9 -7
- package/__generated/components/ui/input.tsx +19 -18
- package/__generated/components/ui/label.tsx +13 -6
- package/__generated/components/ui/menubar.tsx +164 -141
- package/__generated/components/ui/navigation-menu.tsx +68 -58
- package/__generated/components/ui/popover.tsx +11 -8
- package/__generated/components/ui/progress.tsx +10 -9
- package/__generated/components/ui/radio-group.tsx +29 -29
- package/__generated/components/ui/select.tsx +58 -40
- package/__generated/components/ui/separator.tsx +11 -6
- package/__generated/components/ui/switch.tsx +50 -47
- package/__generated/components/ui/table.tsx +66 -50
- package/__generated/components/ui/tabs.tsx +43 -36
- package/__generated/components/ui/text.tsx +17 -15
- package/__generated/components/ui/textarea.tsx +24 -21
- package/__generated/components/ui/toggle-group.tsx +32 -22
- package/__generated/components/ui/toggle.tsx +28 -23
- package/__generated/components/ui/tooltip.tsx +31 -26
- package/__generated/components/ui/typography.tsx +141 -198
- package/__generated/starter-base/app/_layout.tsx +24 -22
- package/__generated/starter-base/components/ThemeToggle.tsx +8 -16
- package/__generated/starter-base/components/ui/avatar.tsx +30 -28
- package/__generated/starter-base/components/ui/button.tsx +18 -25
- package/__generated/starter-base/components/ui/card.tsx +61 -36
- package/__generated/starter-base/components/ui/progress.tsx +11 -10
- package/__generated/starter-base/components/ui/text.tsx +17 -15
- package/__generated/starter-base/components/ui/tooltip.tsx +31 -26
- package/__generated/starter-base/package.json +1 -3
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
|
@@ -18,46 +18,55 @@ const MenubarSub = MenubarPrimitive.Sub;
|
|
|
18
18
|
|
|
19
19
|
const MenubarRadioGroup = MenubarPrimitive.RadioGroup;
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
function Menubar({
|
|
22
|
+
className,
|
|
23
|
+
...props
|
|
24
|
+
}: MenubarPrimitive.RootProps & {
|
|
25
|
+
ref?: React.RefObject<MenubarPrimitive.RootRef>;
|
|
26
|
+
}) {
|
|
27
|
+
return (
|
|
23
28
|
<MenubarPrimitive.Root
|
|
24
|
-
ref={ref}
|
|
25
29
|
className={cn(
|
|
26
30
|
'flex flex-row h-10 native:h-12 items-center space-x-1 rounded-md border border-border bg-background p-1',
|
|
27
31
|
className
|
|
28
32
|
)}
|
|
29
33
|
{...props}
|
|
30
34
|
/>
|
|
31
|
-
)
|
|
32
|
-
|
|
33
|
-
Menubar.displayName = MenubarPrimitive.Root.displayName;
|
|
35
|
+
);
|
|
36
|
+
}
|
|
34
37
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
38
|
+
function MenubarTrigger({
|
|
39
|
+
className,
|
|
40
|
+
...props
|
|
41
|
+
}: MenubarPrimitive.TriggerProps & {
|
|
42
|
+
ref?: React.RefObject<MenubarPrimitive.TriggerRef>;
|
|
43
|
+
}) {
|
|
44
|
+
const { value } = MenubarPrimitive.useRootContext();
|
|
45
|
+
const { value: itemValue } = MenubarPrimitive.useMenuContext();
|
|
39
46
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
52
|
-
);
|
|
53
|
-
MenubarTrigger.displayName = MenubarPrimitive.Trigger.displayName;
|
|
47
|
+
return (
|
|
48
|
+
<MenubarPrimitive.Trigger
|
|
49
|
+
className={cn(
|
|
50
|
+
'flex flex-row web:cursor-default web:select-none items-center rounded-sm px-3 py-1.5 text-sm native:h-10 native:px-5 native:py-0 font-medium web:outline-none web:focus:bg-accent active:bg-accent web:focus:text-accent-foreground',
|
|
51
|
+
value === itemValue && 'bg-accent text-accent-foreground',
|
|
52
|
+
className
|
|
53
|
+
)}
|
|
54
|
+
{...props}
|
|
55
|
+
/>
|
|
56
|
+
);
|
|
57
|
+
}
|
|
54
58
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
function MenubarSubTrigger({
|
|
60
|
+
className,
|
|
61
|
+
inset,
|
|
62
|
+
children,
|
|
63
|
+
...props
|
|
64
|
+
}: MenubarPrimitive.SubTriggerProps & {
|
|
65
|
+
ref?: React.RefObject<MenubarPrimitive.SubTriggerRef>;
|
|
66
|
+
className?: string;
|
|
67
|
+
inset?: boolean;
|
|
68
|
+
children?: React.ReactNode;
|
|
69
|
+
}) {
|
|
61
70
|
const { open } = MenubarPrimitive.useSubContext();
|
|
62
71
|
const Icon = Platform.OS === 'web' ? ChevronRight : open ? ChevronUp : ChevronDown;
|
|
63
72
|
return (
|
|
@@ -68,7 +77,6 @@ const MenubarSubTrigger = React.forwardRef<
|
|
|
68
77
|
)}
|
|
69
78
|
>
|
|
70
79
|
<MenubarPrimitive.SubTrigger
|
|
71
|
-
ref={ref}
|
|
72
80
|
className={cn(
|
|
73
81
|
'flex flex-row web:cursor-default web:select-none items-center gap-2 web:focus:bg-accent active:bg-accent web:hover:bg-accent rounded-sm px-2 py-1.5 native:py-2 web:outline-none',
|
|
74
82
|
open && 'bg-accent',
|
|
@@ -77,22 +85,22 @@ const MenubarSubTrigger = React.forwardRef<
|
|
|
77
85
|
)}
|
|
78
86
|
{...props}
|
|
79
87
|
>
|
|
80
|
-
|
|
88
|
+
{children}
|
|
81
89
|
<Icon size={18} className='ml-auto text-foreground' />
|
|
82
90
|
</MenubarPrimitive.SubTrigger>
|
|
83
91
|
</TextClassContext.Provider>
|
|
84
92
|
);
|
|
85
|
-
}
|
|
86
|
-
MenubarSubTrigger.displayName = MenubarPrimitive.SubTrigger.displayName;
|
|
93
|
+
}
|
|
87
94
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
95
|
+
function MenubarSubContent({
|
|
96
|
+
className,
|
|
97
|
+
...props
|
|
98
|
+
}: MenubarPrimitive.SubContentProps & {
|
|
99
|
+
ref?: React.RefObject<MenubarPrimitive.SubContentRef>;
|
|
100
|
+
}) {
|
|
92
101
|
const { open } = MenubarPrimitive.useSubContext();
|
|
93
102
|
return (
|
|
94
103
|
<MenubarPrimitive.SubContent
|
|
95
|
-
ref={ref}
|
|
96
104
|
className={cn(
|
|
97
105
|
'z-50 min-w-[8rem] overflow-hidden rounded-md border mt-1 border-border bg-popover p-1 shadow-md shadow-foreground/5 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',
|
|
98
106
|
open
|
|
@@ -103,19 +111,22 @@ const MenubarSubContent = React.forwardRef<
|
|
|
103
111
|
{...props}
|
|
104
112
|
/>
|
|
105
113
|
);
|
|
106
|
-
}
|
|
107
|
-
MenubarSubContent.displayName = MenubarPrimitive.SubContent.displayName;
|
|
114
|
+
}
|
|
108
115
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
116
|
+
function MenubarContent({
|
|
117
|
+
className,
|
|
118
|
+
portalHost,
|
|
119
|
+
...props
|
|
120
|
+
}: MenubarPrimitive.ContentProps & {
|
|
121
|
+
ref?: React.RefObject<MenubarPrimitive.ContentRef>;
|
|
122
|
+
className?: string;
|
|
123
|
+
portalHost?: string;
|
|
124
|
+
}) {
|
|
113
125
|
const { value } = MenubarPrimitive.useRootContext();
|
|
114
126
|
const { value: itemValue } = MenubarPrimitive.useMenuContext();
|
|
115
127
|
return (
|
|
116
128
|
<MenubarPrimitive.Portal hostName={portalHost}>
|
|
117
129
|
<MenubarPrimitive.Content
|
|
118
|
-
ref={ref}
|
|
119
130
|
className={cn(
|
|
120
131
|
'z-50 min-w-[8rem] overflow-hidden rounded-md border border-border bg-popover p-1 shadow-md shadow-foreground/5',
|
|
121
132
|
value === itemValue
|
|
@@ -127,108 +138,121 @@ const MenubarContent = React.forwardRef<
|
|
|
127
138
|
/>
|
|
128
139
|
</MenubarPrimitive.Portal>
|
|
129
140
|
);
|
|
130
|
-
}
|
|
131
|
-
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
function MenubarItem({
|
|
144
|
+
className,
|
|
145
|
+
inset,
|
|
146
|
+
...props
|
|
147
|
+
}: MenubarPrimitive.ItemProps & {
|
|
148
|
+
ref?: React.RefObject<MenubarPrimitive.ItemRef>;
|
|
149
|
+
className?: string;
|
|
150
|
+
inset?: boolean;
|
|
151
|
+
}) {
|
|
152
|
+
return (
|
|
153
|
+
<TextClassContext.Provider value='select-none text-sm native:text-lg text-popover-foreground web:group-focus:text-accent-foreground'>
|
|
154
|
+
<MenubarPrimitive.Item
|
|
155
|
+
className={cn(
|
|
156
|
+
'relative flex flex-row web:cursor-default items-center gap-2 rounded-sm px-2 py-1.5 native:py-2 web:outline-none web:focus:bg-accent active:bg-accent web:hover:bg-accent group',
|
|
157
|
+
inset && 'pl-8',
|
|
158
|
+
props.disabled && 'opacity-50 web:pointer-events-none',
|
|
159
|
+
className
|
|
160
|
+
)}
|
|
161
|
+
{...props}
|
|
162
|
+
/>
|
|
163
|
+
</TextClassContext.Provider>
|
|
164
|
+
);
|
|
165
|
+
}
|
|
132
166
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
<
|
|
140
|
-
|
|
141
|
-
|
|
167
|
+
function MenubarCheckboxItem({
|
|
168
|
+
className,
|
|
169
|
+
children,
|
|
170
|
+
checked,
|
|
171
|
+
...props
|
|
172
|
+
}: MenubarPrimitive.CheckboxItemProps & {
|
|
173
|
+
ref?: React.RefObject<MenubarPrimitive.CheckboxItemRef>;
|
|
174
|
+
children?: React.ReactNode;
|
|
175
|
+
}) {
|
|
176
|
+
return (
|
|
177
|
+
<MenubarPrimitive.CheckboxItem
|
|
142
178
|
className={cn(
|
|
143
|
-
'relative flex flex-row web:cursor-default items-center
|
|
144
|
-
|
|
145
|
-
props.disabled && 'opacity-50 web:pointer-events-none',
|
|
179
|
+
'relative flex flex-row web:cursor-default items-center web:group rounded-sm py-1.5 native:py-2 pl-8 pr-2 web:outline-none web:focus:bg-accent active:bg-accent',
|
|
180
|
+
props.disabled && 'web:pointer-events-none opacity-50',
|
|
146
181
|
className
|
|
147
182
|
)}
|
|
183
|
+
checked={checked}
|
|
148
184
|
{...props}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
ref={ref}
|
|
160
|
-
className={cn(
|
|
161
|
-
'relative flex flex-row web:cursor-default items-center web:group rounded-sm py-1.5 native:py-2 pl-8 pr-2 web:outline-none web:focus:bg-accent active:bg-accent',
|
|
162
|
-
props.disabled && 'web:pointer-events-none opacity-50',
|
|
163
|
-
className
|
|
164
|
-
)}
|
|
165
|
-
checked={checked}
|
|
166
|
-
{...props}
|
|
167
|
-
>
|
|
168
|
-
<View className='absolute left-2 flex h-3.5 w-3.5 items-center justify-center'>
|
|
169
|
-
<MenubarPrimitive.ItemIndicator>
|
|
170
|
-
<Check size={14} strokeWidth={3} className='text-foreground' />
|
|
171
|
-
</MenubarPrimitive.ItemIndicator>
|
|
172
|
-
</View>
|
|
173
|
-
<>{children}</>
|
|
174
|
-
</MenubarPrimitive.CheckboxItem>
|
|
175
|
-
));
|
|
176
|
-
MenubarCheckboxItem.displayName = MenubarPrimitive.CheckboxItem.displayName;
|
|
185
|
+
>
|
|
186
|
+
<View className='absolute left-2 flex h-3.5 w-3.5 items-center justify-center'>
|
|
187
|
+
<MenubarPrimitive.ItemIndicator>
|
|
188
|
+
<Check size={14} strokeWidth={3} className='text-foreground' />
|
|
189
|
+
</MenubarPrimitive.ItemIndicator>
|
|
190
|
+
</View>
|
|
191
|
+
{children}
|
|
192
|
+
</MenubarPrimitive.CheckboxItem>
|
|
193
|
+
);
|
|
194
|
+
}
|
|
177
195
|
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
196
|
+
function MenubarRadioItem({
|
|
197
|
+
className,
|
|
198
|
+
children,
|
|
199
|
+
...props
|
|
200
|
+
}: MenubarPrimitive.RadioItemProps & {
|
|
201
|
+
ref?: React.RefObject<MenubarPrimitive.RadioItemRef>;
|
|
202
|
+
children?: React.ReactNode;
|
|
203
|
+
}) {
|
|
204
|
+
return (
|
|
205
|
+
<MenubarPrimitive.RadioItem
|
|
206
|
+
className={cn(
|
|
207
|
+
'relative flex flex-row web:cursor-default web:group items-center rounded-sm py-1.5 native:py-2 pl-8 pr-2 web:outline-none web:focus:bg-accent active:bg-accent',
|
|
208
|
+
props.disabled && 'web:pointer-events-none opacity-50',
|
|
209
|
+
className
|
|
210
|
+
)}
|
|
211
|
+
{...props}
|
|
212
|
+
>
|
|
213
|
+
<View className='absolute left-2 flex h-3.5 w-3.5 items-center justify-center'>
|
|
214
|
+
<MenubarPrimitive.ItemIndicator>
|
|
215
|
+
<View className='bg-foreground h-2 w-2 rounded-full' />
|
|
216
|
+
</MenubarPrimitive.ItemIndicator>
|
|
217
|
+
</View>
|
|
218
|
+
{children}
|
|
219
|
+
</MenubarPrimitive.RadioItem>
|
|
220
|
+
);
|
|
221
|
+
}
|
|
200
222
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
className
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
)
|
|
217
|
-
|
|
223
|
+
function MenubarLabel({
|
|
224
|
+
className,
|
|
225
|
+
inset,
|
|
226
|
+
...props
|
|
227
|
+
}: MenubarPrimitive.LabelProps & {
|
|
228
|
+
ref?: React.RefObject<MenubarPrimitive.LabelRef>;
|
|
229
|
+
className?: string;
|
|
230
|
+
inset?: boolean;
|
|
231
|
+
}) {
|
|
232
|
+
return (
|
|
233
|
+
<MenubarPrimitive.Label
|
|
234
|
+
className={cn(
|
|
235
|
+
'px-2 py-1.5 text-sm native:text-base font-semibold text-foreground web:cursor-default',
|
|
236
|
+
inset && 'pl-8',
|
|
237
|
+
className
|
|
238
|
+
)}
|
|
239
|
+
{...props}
|
|
240
|
+
/>
|
|
241
|
+
);
|
|
242
|
+
}
|
|
218
243
|
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
<MenubarPrimitive.
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
{...props}
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
MenubarSeparator.displayName = MenubarPrimitive.Separator.displayName;
|
|
244
|
+
function MenubarSeparator({
|
|
245
|
+
className,
|
|
246
|
+
...props
|
|
247
|
+
}: MenubarPrimitive.SeparatorProps & {
|
|
248
|
+
ref?: React.RefObject<MenubarPrimitive.SeparatorRef>;
|
|
249
|
+
}) {
|
|
250
|
+
return (
|
|
251
|
+
<MenubarPrimitive.Separator className={cn('-mx-1 my-1 h-px bg-border', className)} {...props} />
|
|
252
|
+
);
|
|
253
|
+
}
|
|
230
254
|
|
|
231
|
-
|
|
255
|
+
function MenubarShortcut({ className, ...props }: TextProps) {
|
|
232
256
|
return (
|
|
233
257
|
<Text
|
|
234
258
|
className={cn(
|
|
@@ -238,8 +262,7 @@ const MenubarShortcut = ({ className, ...props }: TextProps) => {
|
|
|
238
262
|
{...props}
|
|
239
263
|
/>
|
|
240
264
|
);
|
|
241
|
-
}
|
|
242
|
-
MenubarShortcut.displayName = 'MenubarShortcut';
|
|
265
|
+
}
|
|
243
266
|
|
|
244
267
|
export {
|
|
245
268
|
Menubar,
|
|
@@ -14,35 +14,40 @@ import Animated, {
|
|
|
14
14
|
import { ChevronDown } from '../../lib/icons/ChevronDown';
|
|
15
15
|
import { cn } from '../../lib/utils';
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
17
|
+
function NavigationMenu({
|
|
18
|
+
className,
|
|
19
|
+
children,
|
|
20
|
+
...props
|
|
21
|
+
}: NavigationMenuPrimitive.RootProps & {
|
|
22
|
+
ref?: React.RefObject<NavigationMenuPrimitive.RootRef>;
|
|
23
|
+
}) {
|
|
24
|
+
return (
|
|
25
|
+
<NavigationMenuPrimitive.Root
|
|
26
|
+
className={cn('relative z-10 flex flex-row max-w-max items-center justify-center', className)}
|
|
27
|
+
{...props}
|
|
28
|
+
>
|
|
29
|
+
{children}
|
|
30
|
+
{Platform.OS === 'web' && <NavigationMenuViewport />}
|
|
31
|
+
</NavigationMenuPrimitive.Root>
|
|
32
|
+
);
|
|
33
|
+
}
|
|
31
34
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
<NavigationMenuPrimitive.
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
className
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
35
|
+
function NavigationMenuList({
|
|
36
|
+
className,
|
|
37
|
+
...props
|
|
38
|
+
}: NavigationMenuPrimitive.ListProps & {
|
|
39
|
+
ref?: React.RefObject<NavigationMenuPrimitive.ListRef>;
|
|
40
|
+
}) {
|
|
41
|
+
return (
|
|
42
|
+
<NavigationMenuPrimitive.List
|
|
43
|
+
className={cn(
|
|
44
|
+
'web:group flex flex-1 flex-row web:list-none items-center justify-center gap-1',
|
|
45
|
+
className
|
|
46
|
+
)}
|
|
47
|
+
{...props}
|
|
48
|
+
/>
|
|
49
|
+
);
|
|
50
|
+
}
|
|
46
51
|
|
|
47
52
|
const NavigationMenuItem = NavigationMenuPrimitive.Item;
|
|
48
53
|
|
|
@@ -50,10 +55,14 @@ const navigationMenuTriggerStyle = cva(
|
|
|
50
55
|
'web:group web:inline-flex flex-row h-10 native:h-12 native:px-3 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium web:transition-colors web:hover:bg-accent active:bg-accent web:hover:text-accent-foreground web:focus:bg-accent web:focus:text-accent-foreground web:focus:outline-none web:disabled:pointer-events-none disabled:opacity-50 web:data-[active]:bg-accent/50 web:data-[state=open]:bg-accent/50'
|
|
51
56
|
);
|
|
52
57
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
58
|
+
function NavigationMenuTrigger({
|
|
59
|
+
className,
|
|
60
|
+
children,
|
|
61
|
+
...props
|
|
62
|
+
}: Omit<NavigationMenuPrimitive.TriggerProps, 'children'> & {
|
|
63
|
+
children?: React.ReactNode;
|
|
64
|
+
ref?: React.RefObject<NavigationMenuPrimitive.TriggerRef>;
|
|
65
|
+
}) {
|
|
57
66
|
const { value } = NavigationMenuPrimitive.useRootContext();
|
|
58
67
|
const { value: itemValue } = NavigationMenuPrimitive.useItemContext();
|
|
59
68
|
|
|
@@ -67,7 +76,6 @@ const NavigationMenuTrigger = React.forwardRef<
|
|
|
67
76
|
|
|
68
77
|
return (
|
|
69
78
|
<NavigationMenuPrimitive.Trigger
|
|
70
|
-
ref={ref}
|
|
71
79
|
className={cn(
|
|
72
80
|
navigationMenuTriggerStyle(),
|
|
73
81
|
'web:group gap-1.5',
|
|
@@ -76,7 +84,7 @@ const NavigationMenuTrigger = React.forwardRef<
|
|
|
76
84
|
)}
|
|
77
85
|
{...props}
|
|
78
86
|
>
|
|
79
|
-
|
|
87
|
+
{children}
|
|
80
88
|
<Animated.View style={chevronStyle}>
|
|
81
89
|
<ChevronDown
|
|
82
90
|
size={12}
|
|
@@ -86,21 +94,22 @@ const NavigationMenuTrigger = React.forwardRef<
|
|
|
86
94
|
</Animated.View>
|
|
87
95
|
</NavigationMenuPrimitive.Trigger>
|
|
88
96
|
);
|
|
89
|
-
}
|
|
90
|
-
NavigationMenuTrigger.displayName = NavigationMenuPrimitive.Trigger.displayName;
|
|
97
|
+
}
|
|
91
98
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
99
|
+
function NavigationMenuContent({
|
|
100
|
+
className,
|
|
101
|
+
children,
|
|
102
|
+
portalHost,
|
|
103
|
+
...props
|
|
104
|
+
}: NavigationMenuPrimitive.ContentProps & {
|
|
105
|
+
portalHost?: string;
|
|
106
|
+
ref?: React.RefObject<NavigationMenuPrimitive.ContentRef>;
|
|
107
|
+
}) {
|
|
98
108
|
const { value } = NavigationMenuPrimitive.useRootContext();
|
|
99
109
|
const { value: itemValue } = NavigationMenuPrimitive.useItemContext();
|
|
100
110
|
return (
|
|
101
111
|
<NavigationMenuPrimitive.Portal hostName={portalHost}>
|
|
102
112
|
<NavigationMenuPrimitive.Content
|
|
103
|
-
ref={ref}
|
|
104
113
|
className={cn(
|
|
105
114
|
'w-full native:border native:border-border native:rounded-lg native:shadow-lg native:bg-popover native:text-popover-foreground native:overflow-hidden',
|
|
106
115
|
value === itemValue
|
|
@@ -119,15 +128,16 @@ const NavigationMenuContent = React.forwardRef<
|
|
|
119
128
|
</NavigationMenuPrimitive.Content>
|
|
120
129
|
</NavigationMenuPrimitive.Portal>
|
|
121
130
|
);
|
|
122
|
-
}
|
|
123
|
-
NavigationMenuContent.displayName = NavigationMenuPrimitive.Content.displayName;
|
|
131
|
+
}
|
|
124
132
|
|
|
125
133
|
const NavigationMenuLink = NavigationMenuPrimitive.Link;
|
|
126
134
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
135
|
+
function NavigationMenuViewport({
|
|
136
|
+
className,
|
|
137
|
+
...props
|
|
138
|
+
}: NavigationMenuPrimitive.ViewportProps & {
|
|
139
|
+
ref?: React.RefObject<NavigationMenuPrimitive.ViewportRef>;
|
|
140
|
+
}) {
|
|
131
141
|
return (
|
|
132
142
|
<View className={cn('absolute left-0 top-full flex justify-center')}>
|
|
133
143
|
<View
|
|
@@ -135,20 +145,21 @@ const NavigationMenuViewport = React.forwardRef<
|
|
|
135
145
|
'web:origin-top-center relative mt-1.5 web:h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border border-border bg-popover text-popover-foreground shadow-lg web:animate-in web:zoom-in-90',
|
|
136
146
|
className
|
|
137
147
|
)}
|
|
138
|
-
ref={ref}
|
|
139
148
|
{...props}
|
|
140
149
|
>
|
|
141
150
|
<NavigationMenuPrimitive.Viewport />
|
|
142
151
|
</View>
|
|
143
152
|
</View>
|
|
144
153
|
);
|
|
145
|
-
}
|
|
146
|
-
NavigationMenuViewport.displayName = NavigationMenuPrimitive.Viewport.displayName;
|
|
154
|
+
}
|
|
147
155
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
156
|
+
function NavigationMenuIndicator({
|
|
157
|
+
ref,
|
|
158
|
+
className,
|
|
159
|
+
...props
|
|
160
|
+
}: NavigationMenuPrimitive.IndicatorProps & {
|
|
161
|
+
ref?: React.RefObject<NavigationMenuPrimitive.IndicatorRef>;
|
|
162
|
+
}) {
|
|
152
163
|
const { value } = NavigationMenuPrimitive.useRootContext();
|
|
153
164
|
const { value: itemValue } = NavigationMenuPrimitive.useItemContext();
|
|
154
165
|
|
|
@@ -165,8 +176,7 @@ const NavigationMenuIndicator = React.forwardRef<
|
|
|
165
176
|
<View className='relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md shadow-foreground/5' />
|
|
166
177
|
</NavigationMenuPrimitive.Indicator>
|
|
167
178
|
);
|
|
168
|
-
}
|
|
169
|
-
NavigationMenuIndicator.displayName = NavigationMenuPrimitive.Indicator.displayName;
|
|
179
|
+
}
|
|
170
180
|
|
|
171
181
|
export {
|
|
172
182
|
NavigationMenu,
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as PopoverPrimitive from '@rn-primitives/popover';
|
|
2
|
-
import * as React from 'react';
|
|
3
2
|
import { Platform, StyleSheet } from 'react-native';
|
|
4
3
|
import Animated, { FadeIn, FadeOut } from 'react-native-reanimated';
|
|
5
4
|
import { cn } from '../../lib/utils';
|
|
@@ -9,17 +8,22 @@ const Popover = PopoverPrimitive.Root;
|
|
|
9
8
|
|
|
10
9
|
const PopoverTrigger = PopoverPrimitive.Trigger;
|
|
11
10
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
function PopoverContent({
|
|
12
|
+
className,
|
|
13
|
+
align = 'center',
|
|
14
|
+
sideOffset = 4,
|
|
15
|
+
portalHost,
|
|
16
|
+
...props
|
|
17
|
+
}: PopoverPrimitive.ContentProps & {
|
|
18
|
+
ref?: React.RefObject<PopoverPrimitive.ContentRef>;
|
|
19
|
+
portalHost?: string;
|
|
20
|
+
}) {
|
|
16
21
|
return (
|
|
17
22
|
<PopoverPrimitive.Portal hostName={portalHost}>
|
|
18
23
|
<PopoverPrimitive.Overlay style={Platform.OS !== 'web' ? StyleSheet.absoluteFill : undefined}>
|
|
19
24
|
<Animated.View entering={FadeIn.duration(200)} exiting={FadeOut}>
|
|
20
25
|
<TextClassContext.Provider value='text-popover-foreground'>
|
|
21
26
|
<PopoverPrimitive.Content
|
|
22
|
-
ref={ref}
|
|
23
27
|
align={align}
|
|
24
28
|
sideOffset={sideOffset}
|
|
25
29
|
className={cn(
|
|
@@ -33,7 +37,6 @@ const PopoverContent = React.forwardRef<
|
|
|
33
37
|
</PopoverPrimitive.Overlay>
|
|
34
38
|
</PopoverPrimitive.Portal>
|
|
35
39
|
);
|
|
36
|
-
}
|
|
37
|
-
PopoverContent.displayName = PopoverPrimitive.Content.displayName;
|
|
40
|
+
}
|
|
38
41
|
|
|
39
42
|
export { Popover, PopoverContent, PopoverTrigger };
|
|
@@ -10,23 +10,24 @@ import Animated, {
|
|
|
10
10
|
} from 'react-native-reanimated';
|
|
11
11
|
import { cn } from '../../lib/utils';
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
function Progress({
|
|
14
|
+
className,
|
|
15
|
+
value,
|
|
16
|
+
indicatorClassName,
|
|
17
|
+
...props
|
|
18
|
+
}: ProgressPrimitive.RootProps & {
|
|
19
|
+
ref?: React.RefObject<ProgressPrimitive.RootRef>;
|
|
20
|
+
indicatorClassName?: string;
|
|
21
|
+
}) {
|
|
19
22
|
return (
|
|
20
23
|
<ProgressPrimitive.Root
|
|
21
|
-
ref={ref}
|
|
22
24
|
className={cn('relative h-4 w-full overflow-hidden rounded-full bg-secondary', className)}
|
|
23
25
|
{...props}
|
|
24
26
|
>
|
|
25
27
|
<Indicator value={value} className={indicatorClassName} />
|
|
26
28
|
</ProgressPrimitive.Root>
|
|
27
29
|
);
|
|
28
|
-
}
|
|
29
|
-
Progress.displayName = ProgressPrimitive.Root.displayName;
|
|
30
|
+
}
|
|
30
31
|
|
|
31
32
|
export { Progress };
|
|
32
33
|
|