@react-native-reusables/cli 0.1.0 → 0.1.2
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 +29 -31
- package/__generated/components/ui/alert-dialog.tsx +18 -24
- package/__generated/components/ui/avatar.tsx +34 -41
- package/__generated/components/ui/badge.tsx +2 -2
- package/__generated/components/ui/button.tsx +2 -5
- package/__generated/components/ui/card.tsx +39 -51
- package/__generated/components/ui/checkbox.tsx +23 -24
- package/__generated/components/ui/context-menu.tsx +27 -22
- package/__generated/components/ui/dialog.tsx +39 -41
- package/__generated/components/ui/dropdown-menu.tsx +26 -21
- package/__generated/components/ui/hover-card.tsx +2 -2
- package/__generated/components/ui/input.tsx +17 -18
- package/__generated/components/ui/label.tsx +20 -21
- package/__generated/components/ui/menubar.tsx +44 -46
- package/__generated/components/ui/navigation-menu.tsx +13 -13
- package/__generated/components/ui/popover.tsx +4 -4
- package/__generated/components/ui/progress.tsx +3 -3
- package/__generated/components/ui/radio-group.tsx +27 -29
- package/__generated/components/ui/select.tsx +63 -74
- package/__generated/components/ui/separator.tsx +16 -17
- package/__generated/components/ui/switch.tsx +58 -59
- package/__generated/components/ui/table.tsx +69 -76
- package/__generated/components/ui/tabs.tsx +49 -52
- package/__generated/components/ui/textarea.tsx +20 -21
- package/__generated/components/ui/toggle-group.tsx +4 -6
- package/__generated/components/ui/toggle.tsx +4 -4
- package/__generated/components/ui/tooltip.tsx +4 -4
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as DialogPrimitive from '@rn-primitives/dialog';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import { Platform, StyleSheet, View } from 'react-native';
|
|
3
|
+
import { Platform, StyleSheet, View, type ViewProps } from 'react-native';
|
|
4
4
|
import Animated, { FadeIn, FadeOut } from 'react-native-reanimated';
|
|
5
5
|
import { X } from '../../lib/icons/X';
|
|
6
6
|
import { cn } from '../../lib/utils';
|
|
@@ -13,34 +13,33 @@ const DialogPortal = DialogPrimitive.Portal;
|
|
|
13
13
|
|
|
14
14
|
const DialogClose = DialogPrimitive.Close;
|
|
15
15
|
|
|
16
|
-
const DialogOverlayWeb = React.forwardRef<
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
});
|
|
16
|
+
const DialogOverlayWeb = React.forwardRef<DialogPrimitive.OverlayRef, DialogPrimitive.OverlayProps>(
|
|
17
|
+
({ className, ...props }, ref) => {
|
|
18
|
+
const { open } = DialogPrimitive.useRootContext();
|
|
19
|
+
return (
|
|
20
|
+
<DialogPrimitive.Overlay
|
|
21
|
+
className={cn(
|
|
22
|
+
'bg-black/80 flex justify-center items-center p-2 absolute top-0 right-0 bottom-0 left-0',
|
|
23
|
+
open ? 'web:animate-in web:fade-in-0' : 'web:animate-out web:fade-out-0',
|
|
24
|
+
className
|
|
25
|
+
)}
|
|
26
|
+
{...props}
|
|
27
|
+
ref={ref}
|
|
28
|
+
/>
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
);
|
|
33
32
|
|
|
34
33
|
DialogOverlayWeb.displayName = 'DialogOverlayWeb';
|
|
35
34
|
|
|
36
35
|
const DialogOverlayNative = React.forwardRef<
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
DialogPrimitive.OverlayRef,
|
|
37
|
+
DialogPrimitive.OverlayProps
|
|
39
38
|
>(({ className, children, ...props }, ref) => {
|
|
40
39
|
return (
|
|
41
40
|
<DialogPrimitive.Overlay
|
|
42
41
|
style={StyleSheet.absoluteFill}
|
|
43
|
-
className={cn('
|
|
42
|
+
className={cn('flex bg-black/80 justify-center items-center p-2', className)}
|
|
44
43
|
{...props}
|
|
45
44
|
ref={ref}
|
|
46
45
|
>
|
|
@@ -59,8 +58,8 @@ const DialogOverlay = Platform.select({
|
|
|
59
58
|
});
|
|
60
59
|
|
|
61
60
|
const DialogContent = React.forwardRef<
|
|
62
|
-
|
|
63
|
-
|
|
61
|
+
DialogPrimitive.ContentRef,
|
|
62
|
+
DialogPrimitive.ContentProps & { portalHost?: string }
|
|
64
63
|
>(({ className, children, portalHost, ...props }, ref) => {
|
|
65
64
|
const { open } = DialogPrimitive.useRootContext();
|
|
66
65
|
return (
|
|
@@ -69,7 +68,7 @@ const DialogContent = React.forwardRef<
|
|
|
69
68
|
<DialogPrimitive.Content
|
|
70
69
|
ref={ref}
|
|
71
70
|
className={cn(
|
|
72
|
-
'
|
|
71
|
+
'max-w-lg gap-4 border border-border web:cursor-default bg-background p-6 shadow-lg web:duration-200 rounded-lg',
|
|
73
72
|
open
|
|
74
73
|
? 'web:animate-in web:fade-in-0 web:zoom-in-95'
|
|
75
74
|
: 'web:animate-out web:fade-out-0 web:zoom-out-95',
|
|
@@ -95,12 +94,12 @@ const DialogContent = React.forwardRef<
|
|
|
95
94
|
});
|
|
96
95
|
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
97
96
|
|
|
98
|
-
const DialogHeader = ({ className, ...props }:
|
|
97
|
+
const DialogHeader = ({ className, ...props }: ViewProps) => (
|
|
99
98
|
<View className={cn('flex flex-col gap-1.5 text-center sm:text-left', className)} {...props} />
|
|
100
99
|
);
|
|
101
100
|
DialogHeader.displayName = 'DialogHeader';
|
|
102
101
|
|
|
103
|
-
const DialogFooter = ({ className, ...props }:
|
|
102
|
+
const DialogFooter = ({ className, ...props }: ViewProps) => (
|
|
104
103
|
<View
|
|
105
104
|
className={cn('flex flex-col-reverse sm:flex-row sm:justify-end gap-2', className)}
|
|
106
105
|
{...props}
|
|
@@ -108,24 +107,23 @@ const DialogFooter = ({ className, ...props }: React.ComponentPropsWithoutRef<ty
|
|
|
108
107
|
);
|
|
109
108
|
DialogFooter.displayName = 'DialogFooter';
|
|
110
109
|
|
|
111
|
-
const DialogTitle = React.forwardRef<
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
));
|
|
110
|
+
const DialogTitle = React.forwardRef<DialogPrimitive.TitleRef, DialogPrimitive.TitleProps>(
|
|
111
|
+
({ className, ...props }, ref) => (
|
|
112
|
+
<DialogPrimitive.Title
|
|
113
|
+
ref={ref}
|
|
114
|
+
className={cn(
|
|
115
|
+
'text-lg native:text-xl text-foreground font-semibold leading-none tracking-tight',
|
|
116
|
+
className
|
|
117
|
+
)}
|
|
118
|
+
{...props}
|
|
119
|
+
/>
|
|
120
|
+
)
|
|
121
|
+
);
|
|
124
122
|
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
125
123
|
|
|
126
124
|
const DialogDescription = React.forwardRef<
|
|
127
|
-
|
|
128
|
-
|
|
125
|
+
DialogPrimitive.DescriptionRef,
|
|
126
|
+
DialogPrimitive.DescriptionProps
|
|
129
127
|
>(({ className, ...props }, ref) => (
|
|
130
128
|
<DialogPrimitive.Description
|
|
131
129
|
ref={ref}
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import * as DropdownMenuPrimitive from '@rn-primitives/dropdown-menu';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
Platform,
|
|
5
|
+
type StyleProp,
|
|
6
|
+
StyleSheet,
|
|
7
|
+
Text,
|
|
8
|
+
type TextProps,
|
|
9
|
+
View,
|
|
10
|
+
type ViewStyle,
|
|
11
|
+
} from 'react-native';
|
|
4
12
|
import { Check } from '../../lib/icons/Check';
|
|
5
13
|
import { ChevronDown } from '../../lib/icons/ChevronDown';
|
|
6
14
|
import { ChevronRight } from '../../lib/icons/ChevronRight';
|
|
@@ -21,8 +29,8 @@ const DropdownMenuSub = DropdownMenuPrimitive.Sub;
|
|
|
21
29
|
const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
|
|
22
30
|
|
|
23
31
|
const DropdownMenuSubTrigger = React.forwardRef<
|
|
24
|
-
|
|
25
|
-
|
|
32
|
+
DropdownMenuPrimitive.SubTriggerRef,
|
|
33
|
+
DropdownMenuPrimitive.SubTriggerProps & {
|
|
26
34
|
inset?: boolean;
|
|
27
35
|
}
|
|
28
36
|
>(({ className, inset, children, ...props }, ref) => {
|
|
@@ -54,8 +62,8 @@ const DropdownMenuSubTrigger = React.forwardRef<
|
|
|
54
62
|
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
|
|
55
63
|
|
|
56
64
|
const DropdownMenuSubContent = React.forwardRef<
|
|
57
|
-
|
|
58
|
-
|
|
65
|
+
DropdownMenuPrimitive.SubContentRef,
|
|
66
|
+
DropdownMenuPrimitive.SubContentProps
|
|
59
67
|
>(({ className, ...props }, ref) => {
|
|
60
68
|
const { open } = DropdownMenuPrimitive.useSubContext();
|
|
61
69
|
return (
|
|
@@ -75,8 +83,8 @@ const DropdownMenuSubContent = React.forwardRef<
|
|
|
75
83
|
DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
|
|
76
84
|
|
|
77
85
|
const DropdownMenuContent = React.forwardRef<
|
|
78
|
-
|
|
79
|
-
|
|
86
|
+
DropdownMenuPrimitive.ContentRef,
|
|
87
|
+
DropdownMenuPrimitive.ContentProps & {
|
|
80
88
|
overlayStyle?: StyleProp<ViewStyle>;
|
|
81
89
|
overlayClassName?: string;
|
|
82
90
|
portalHost?: string;
|
|
@@ -116,8 +124,8 @@ const DropdownMenuContent = React.forwardRef<
|
|
|
116
124
|
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
117
125
|
|
|
118
126
|
const DropdownMenuItem = React.forwardRef<
|
|
119
|
-
|
|
120
|
-
|
|
127
|
+
DropdownMenuPrimitive.ItemRef,
|
|
128
|
+
DropdownMenuPrimitive.ItemProps & {
|
|
121
129
|
inset?: boolean;
|
|
122
130
|
}
|
|
123
131
|
>(({ className, inset, ...props }, ref) => (
|
|
@@ -137,8 +145,8 @@ const DropdownMenuItem = React.forwardRef<
|
|
|
137
145
|
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
138
146
|
|
|
139
147
|
const DropdownMenuCheckboxItem = React.forwardRef<
|
|
140
|
-
|
|
141
|
-
|
|
148
|
+
DropdownMenuPrimitive.CheckboxItemRef,
|
|
149
|
+
DropdownMenuPrimitive.CheckboxItemProps
|
|
142
150
|
>(({ className, children, checked, ...props }, ref) => (
|
|
143
151
|
<DropdownMenuPrimitive.CheckboxItem
|
|
144
152
|
ref={ref}
|
|
@@ -161,8 +169,8 @@ const DropdownMenuCheckboxItem = React.forwardRef<
|
|
|
161
169
|
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
|
|
162
170
|
|
|
163
171
|
const DropdownMenuRadioItem = React.forwardRef<
|
|
164
|
-
|
|
165
|
-
|
|
172
|
+
DropdownMenuPrimitive.RadioItemRef,
|
|
173
|
+
DropdownMenuPrimitive.RadioItemProps
|
|
166
174
|
>(({ className, children, ...props }, ref) => (
|
|
167
175
|
<DropdownMenuPrimitive.RadioItem
|
|
168
176
|
ref={ref}
|
|
@@ -184,8 +192,8 @@ const DropdownMenuRadioItem = React.forwardRef<
|
|
|
184
192
|
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
|
|
185
193
|
|
|
186
194
|
const DropdownMenuLabel = React.forwardRef<
|
|
187
|
-
|
|
188
|
-
|
|
195
|
+
DropdownMenuPrimitive.LabelRef,
|
|
196
|
+
DropdownMenuPrimitive.LabelProps & {
|
|
189
197
|
inset?: boolean;
|
|
190
198
|
}
|
|
191
199
|
>(({ className, inset, ...props }, ref) => (
|
|
@@ -202,8 +210,8 @@ const DropdownMenuLabel = React.forwardRef<
|
|
|
202
210
|
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
|
203
211
|
|
|
204
212
|
const DropdownMenuSeparator = React.forwardRef<
|
|
205
|
-
|
|
206
|
-
|
|
213
|
+
DropdownMenuPrimitive.SeparatorRef,
|
|
214
|
+
DropdownMenuPrimitive.SeparatorProps
|
|
207
215
|
>(({ className, ...props }, ref) => (
|
|
208
216
|
<DropdownMenuPrimitive.Separator
|
|
209
217
|
ref={ref}
|
|
@@ -213,10 +221,7 @@ const DropdownMenuSeparator = React.forwardRef<
|
|
|
213
221
|
));
|
|
214
222
|
DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
|
|
215
223
|
|
|
216
|
-
const DropdownMenuShortcut = ({
|
|
217
|
-
className,
|
|
218
|
-
...props
|
|
219
|
-
}: React.ComponentPropsWithoutRef<typeof Text>) => {
|
|
224
|
+
const DropdownMenuShortcut = ({ className, ...props }: TextProps) => {
|
|
220
225
|
return (
|
|
221
226
|
<Text
|
|
222
227
|
className={cn(
|
|
@@ -10,8 +10,8 @@ const HoverCard = HoverCardPrimitive.Root;
|
|
|
10
10
|
const HoverCardTrigger = HoverCardPrimitive.Trigger;
|
|
11
11
|
|
|
12
12
|
const HoverCardContent = React.forwardRef<
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
HoverCardPrimitive.ContentRef,
|
|
14
|
+
HoverCardPrimitive.ContentProps
|
|
15
15
|
>(({ className, align = 'center', sideOffset = 4, ...props }, ref) => {
|
|
16
16
|
const { open } = HoverCardPrimitive.useRootContext();
|
|
17
17
|
return (
|
|
@@ -1,24 +1,23 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { TextInput } from 'react-native';
|
|
2
|
+
import { TextInput, type TextInputProps } from 'react-native';
|
|
3
3
|
import { cn } from '../../lib/utils';
|
|
4
4
|
|
|
5
|
-
const Input = React.forwardRef<
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
});
|
|
5
|
+
const Input = React.forwardRef<React.ElementRef<typeof TextInput>, TextInputProps>(
|
|
6
|
+
({ className, placeholderClassName, ...props }, ref) => {
|
|
7
|
+
return (
|
|
8
|
+
<TextInput
|
|
9
|
+
ref={ref}
|
|
10
|
+
className={cn(
|
|
11
|
+
'web:flex h-10 native:h-12 web:w-full rounded-md border border-input bg-background px-3 web:py-2 text-base lg:text-sm native:text-lg native:leading-[1.25] text-foreground placeholder:text-muted-foreground web:ring-offset-background file:border-0 file:bg-transparent file:font-medium web:focus-visible:outline-none web:focus-visible:ring-2 web:focus-visible:ring-ring web:focus-visible:ring-offset-2',
|
|
12
|
+
props.editable === false && 'opacity-50 web:cursor-not-allowed',
|
|
13
|
+
className
|
|
14
|
+
)}
|
|
15
|
+
placeholderClassName={cn('text-muted-foreground', placeholderClassName)}
|
|
16
|
+
{...props}
|
|
17
|
+
/>
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
);
|
|
22
21
|
|
|
23
22
|
Input.displayName = 'Input';
|
|
24
23
|
|
|
@@ -2,27 +2,26 @@ import * as LabelPrimitive from '@rn-primitives/label';
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { cn } from '../../lib/utils';
|
|
4
4
|
|
|
5
|
-
const Label = React.forwardRef<
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
));
|
|
5
|
+
const Label = React.forwardRef<LabelPrimitive.TextRef, LabelPrimitive.TextProps>(
|
|
6
|
+
({ className, onPress, onLongPress, onPressIn, onPressOut, ...props }, ref) => (
|
|
7
|
+
<LabelPrimitive.Root
|
|
8
|
+
className='web:cursor-default'
|
|
9
|
+
onPress={onPress}
|
|
10
|
+
onLongPress={onLongPress}
|
|
11
|
+
onPressIn={onPressIn}
|
|
12
|
+
onPressOut={onPressOut}
|
|
13
|
+
>
|
|
14
|
+
<LabelPrimitive.Text
|
|
15
|
+
ref={ref}
|
|
16
|
+
className={cn(
|
|
17
|
+
'text-sm text-foreground native:text-base font-medium leading-none web:peer-disabled:cursor-not-allowed web:peer-disabled:opacity-70',
|
|
18
|
+
className
|
|
19
|
+
)}
|
|
20
|
+
{...props}
|
|
21
|
+
/>
|
|
22
|
+
</LabelPrimitive.Root>
|
|
23
|
+
)
|
|
24
|
+
);
|
|
26
25
|
Label.displayName = LabelPrimitive.Root.displayName;
|
|
27
26
|
|
|
28
27
|
export { Label };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as MenubarPrimitive from '@rn-primitives/menubar';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import { Platform, Text, View } from 'react-native';
|
|
3
|
+
import { Platform, Text, TextProps, View } from 'react-native';
|
|
4
4
|
import { Check } from '../../lib/icons/Check';
|
|
5
5
|
import { ChevronDown } from '../../lib/icons/ChevronDown';
|
|
6
6
|
import { ChevronRight } from '../../lib/icons/ChevronRight';
|
|
@@ -18,45 +18,43 @@ const MenubarSub = MenubarPrimitive.Sub;
|
|
|
18
18
|
|
|
19
19
|
const MenubarRadioGroup = MenubarPrimitive.RadioGroup;
|
|
20
20
|
|
|
21
|
-
const Menubar = React.forwardRef<
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
>(({ className, ...props }, ref) => (
|
|
25
|
-
<MenubarPrimitive.Root
|
|
26
|
-
ref={ref}
|
|
27
|
-
className={cn(
|
|
28
|
-
'flex flex-row h-10 native:h-12 items-center space-x-1 rounded-md border border-border bg-background p-1',
|
|
29
|
-
className
|
|
30
|
-
)}
|
|
31
|
-
{...props}
|
|
32
|
-
/>
|
|
33
|
-
));
|
|
34
|
-
Menubar.displayName = MenubarPrimitive.Root.displayName;
|
|
35
|
-
|
|
36
|
-
const MenubarTrigger = React.forwardRef<
|
|
37
|
-
React.ElementRef<typeof MenubarPrimitive.Trigger>,
|
|
38
|
-
React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Trigger>
|
|
39
|
-
>(({ className, ...props }, ref) => {
|
|
40
|
-
const { value } = MenubarPrimitive.useRootContext();
|
|
41
|
-
const { value: itemValue } = MenubarPrimitive.useMenuContext();
|
|
42
|
-
|
|
43
|
-
return (
|
|
44
|
-
<MenubarPrimitive.Trigger
|
|
21
|
+
const Menubar = React.forwardRef<MenubarPrimitive.RootRef, MenubarPrimitive.RootProps>(
|
|
22
|
+
({ className, ...props }, ref) => (
|
|
23
|
+
<MenubarPrimitive.Root
|
|
45
24
|
ref={ref}
|
|
46
25
|
className={cn(
|
|
47
|
-
'flex flex-row
|
|
48
|
-
value === itemValue && 'bg-accent text-accent-foreground',
|
|
26
|
+
'flex flex-row h-10 native:h-12 items-center space-x-1 rounded-md border border-border bg-background p-1',
|
|
49
27
|
className
|
|
50
28
|
)}
|
|
51
29
|
{...props}
|
|
52
30
|
/>
|
|
53
|
-
)
|
|
54
|
-
|
|
31
|
+
)
|
|
32
|
+
);
|
|
33
|
+
Menubar.displayName = MenubarPrimitive.Root.displayName;
|
|
34
|
+
|
|
35
|
+
const MenubarTrigger = React.forwardRef<MenubarPrimitive.TriggerRef, MenubarPrimitive.TriggerProps>(
|
|
36
|
+
({ className, ...props }, ref) => {
|
|
37
|
+
const { value } = MenubarPrimitive.useRootContext();
|
|
38
|
+
const { value: itemValue } = MenubarPrimitive.useMenuContext();
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<MenubarPrimitive.Trigger
|
|
42
|
+
ref={ref}
|
|
43
|
+
className={cn(
|
|
44
|
+
'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',
|
|
45
|
+
value === itemValue && 'bg-accent text-accent-foreground',
|
|
46
|
+
className
|
|
47
|
+
)}
|
|
48
|
+
{...props}
|
|
49
|
+
/>
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
);
|
|
55
53
|
MenubarTrigger.displayName = MenubarPrimitive.Trigger.displayName;
|
|
56
54
|
|
|
57
55
|
const MenubarSubTrigger = React.forwardRef<
|
|
58
|
-
|
|
59
|
-
|
|
56
|
+
MenubarPrimitive.SubTriggerRef,
|
|
57
|
+
MenubarPrimitive.SubTriggerProps & {
|
|
60
58
|
inset?: boolean;
|
|
61
59
|
}
|
|
62
60
|
>(({ className, inset, children, ...props }, ref) => {
|
|
@@ -88,8 +86,8 @@ const MenubarSubTrigger = React.forwardRef<
|
|
|
88
86
|
MenubarSubTrigger.displayName = MenubarPrimitive.SubTrigger.displayName;
|
|
89
87
|
|
|
90
88
|
const MenubarSubContent = React.forwardRef<
|
|
91
|
-
|
|
92
|
-
|
|
89
|
+
MenubarPrimitive.SubContentRef,
|
|
90
|
+
MenubarPrimitive.SubContentProps
|
|
93
91
|
>(({ className, ...props }, ref) => {
|
|
94
92
|
const { open } = MenubarPrimitive.useSubContext();
|
|
95
93
|
return (
|
|
@@ -109,8 +107,8 @@ const MenubarSubContent = React.forwardRef<
|
|
|
109
107
|
MenubarSubContent.displayName = MenubarPrimitive.SubContent.displayName;
|
|
110
108
|
|
|
111
109
|
const MenubarContent = React.forwardRef<
|
|
112
|
-
|
|
113
|
-
|
|
110
|
+
MenubarPrimitive.ContentRef,
|
|
111
|
+
MenubarPrimitive.ContentProps & { portalHost?: string }
|
|
114
112
|
>(({ className, portalHost, ...props }, ref) => {
|
|
115
113
|
const { value } = MenubarPrimitive.useRootContext();
|
|
116
114
|
const { value: itemValue } = MenubarPrimitive.useMenuContext();
|
|
@@ -133,8 +131,8 @@ const MenubarContent = React.forwardRef<
|
|
|
133
131
|
MenubarContent.displayName = MenubarPrimitive.Content.displayName;
|
|
134
132
|
|
|
135
133
|
const MenubarItem = React.forwardRef<
|
|
136
|
-
|
|
137
|
-
|
|
134
|
+
MenubarPrimitive.ItemRef,
|
|
135
|
+
MenubarPrimitive.ItemProps & {
|
|
138
136
|
inset?: boolean;
|
|
139
137
|
}
|
|
140
138
|
>(({ className, inset, ...props }, ref) => (
|
|
@@ -154,8 +152,8 @@ const MenubarItem = React.forwardRef<
|
|
|
154
152
|
MenubarItem.displayName = MenubarPrimitive.Item.displayName;
|
|
155
153
|
|
|
156
154
|
const MenubarCheckboxItem = React.forwardRef<
|
|
157
|
-
|
|
158
|
-
|
|
155
|
+
MenubarPrimitive.CheckboxItemRef,
|
|
156
|
+
MenubarPrimitive.CheckboxItemProps
|
|
159
157
|
>(({ className, children, checked, ...props }, ref) => (
|
|
160
158
|
<MenubarPrimitive.CheckboxItem
|
|
161
159
|
ref={ref}
|
|
@@ -178,8 +176,8 @@ const MenubarCheckboxItem = React.forwardRef<
|
|
|
178
176
|
MenubarCheckboxItem.displayName = MenubarPrimitive.CheckboxItem.displayName;
|
|
179
177
|
|
|
180
178
|
const MenubarRadioItem = React.forwardRef<
|
|
181
|
-
|
|
182
|
-
|
|
179
|
+
MenubarPrimitive.RadioItemRef,
|
|
180
|
+
MenubarPrimitive.RadioItemProps
|
|
183
181
|
>(({ className, children, ...props }, ref) => (
|
|
184
182
|
<MenubarPrimitive.RadioItem
|
|
185
183
|
ref={ref}
|
|
@@ -201,8 +199,8 @@ const MenubarRadioItem = React.forwardRef<
|
|
|
201
199
|
MenubarRadioItem.displayName = MenubarPrimitive.RadioItem.displayName;
|
|
202
200
|
|
|
203
201
|
const MenubarLabel = React.forwardRef<
|
|
204
|
-
|
|
205
|
-
|
|
202
|
+
MenubarPrimitive.LabelRef,
|
|
203
|
+
MenubarPrimitive.LabelProps & {
|
|
206
204
|
inset?: boolean;
|
|
207
205
|
}
|
|
208
206
|
>(({ className, inset, ...props }, ref) => (
|
|
@@ -219,8 +217,8 @@ const MenubarLabel = React.forwardRef<
|
|
|
219
217
|
MenubarLabel.displayName = MenubarPrimitive.Label.displayName;
|
|
220
218
|
|
|
221
219
|
const MenubarSeparator = React.forwardRef<
|
|
222
|
-
|
|
223
|
-
|
|
220
|
+
MenubarPrimitive.SeparatorRef,
|
|
221
|
+
MenubarPrimitive.SeparatorProps
|
|
224
222
|
>(({ className, ...props }, ref) => (
|
|
225
223
|
<MenubarPrimitive.Separator
|
|
226
224
|
ref={ref}
|
|
@@ -230,7 +228,7 @@ const MenubarSeparator = React.forwardRef<
|
|
|
230
228
|
));
|
|
231
229
|
MenubarSeparator.displayName = MenubarPrimitive.Separator.displayName;
|
|
232
230
|
|
|
233
|
-
const MenubarShortcut = ({ className, ...props }:
|
|
231
|
+
const MenubarShortcut = ({ className, ...props }: TextProps) => {
|
|
234
232
|
return (
|
|
235
233
|
<Text
|
|
236
234
|
className={cn(
|
|
@@ -15,8 +15,8 @@ import { ChevronDown } from '../../lib/icons/ChevronDown';
|
|
|
15
15
|
import { cn } from '../../lib/utils';
|
|
16
16
|
|
|
17
17
|
const NavigationMenu = React.forwardRef<
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
NavigationMenuPrimitive.RootRef,
|
|
19
|
+
NavigationMenuPrimitive.RootProps
|
|
20
20
|
>(({ className, children, ...props }, ref) => (
|
|
21
21
|
<NavigationMenuPrimitive.Root
|
|
22
22
|
ref={ref}
|
|
@@ -30,8 +30,8 @@ const NavigationMenu = React.forwardRef<
|
|
|
30
30
|
NavigationMenu.displayName = NavigationMenuPrimitive.Root.displayName;
|
|
31
31
|
|
|
32
32
|
const NavigationMenuList = React.forwardRef<
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
NavigationMenuPrimitive.ListRef,
|
|
34
|
+
NavigationMenuPrimitive.ListProps
|
|
35
35
|
>(({ className, ...props }, ref) => (
|
|
36
36
|
<NavigationMenuPrimitive.List
|
|
37
37
|
ref={ref}
|
|
@@ -51,8 +51,8 @@ const navigationMenuTriggerStyle = cva(
|
|
|
51
51
|
);
|
|
52
52
|
|
|
53
53
|
const NavigationMenuTrigger = React.forwardRef<
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
NavigationMenuPrimitive.TriggerRef,
|
|
55
|
+
NavigationMenuPrimitive.TriggerProps
|
|
56
56
|
>(({ className, children, ...props }, ref) => {
|
|
57
57
|
const { value } = NavigationMenuPrimitive.useRootContext();
|
|
58
58
|
const { value: itemValue } = NavigationMenuPrimitive.useItemContext();
|
|
@@ -90,8 +90,8 @@ const NavigationMenuTrigger = React.forwardRef<
|
|
|
90
90
|
NavigationMenuTrigger.displayName = NavigationMenuPrimitive.Trigger.displayName;
|
|
91
91
|
|
|
92
92
|
const NavigationMenuContent = React.forwardRef<
|
|
93
|
-
|
|
94
|
-
|
|
93
|
+
NavigationMenuPrimitive.ContentRef,
|
|
94
|
+
NavigationMenuPrimitive.ContentProps & {
|
|
95
95
|
portalHost?: string;
|
|
96
96
|
}
|
|
97
97
|
>(({ className, children, portalHost, ...props }, ref) => {
|
|
@@ -125,8 +125,8 @@ NavigationMenuContent.displayName = NavigationMenuPrimitive.Content.displayName;
|
|
|
125
125
|
const NavigationMenuLink = NavigationMenuPrimitive.Link;
|
|
126
126
|
|
|
127
127
|
const NavigationMenuViewport = React.forwardRef<
|
|
128
|
-
|
|
129
|
-
|
|
128
|
+
NavigationMenuPrimitive.ViewportRef,
|
|
129
|
+
NavigationMenuPrimitive.ViewportProps
|
|
130
130
|
>(({ className, ...props }, ref) => {
|
|
131
131
|
return (
|
|
132
132
|
<View className={cn('absolute left-0 top-full flex justify-center')}>
|
|
@@ -146,8 +146,8 @@ const NavigationMenuViewport = React.forwardRef<
|
|
|
146
146
|
NavigationMenuViewport.displayName = NavigationMenuPrimitive.Viewport.displayName;
|
|
147
147
|
|
|
148
148
|
const NavigationMenuIndicator = React.forwardRef<
|
|
149
|
-
|
|
150
|
-
|
|
149
|
+
NavigationMenuPrimitive.IndicatorRef,
|
|
150
|
+
NavigationMenuPrimitive.IndicatorProps
|
|
151
151
|
>(({ className, ...props }, ref) => {
|
|
152
152
|
const { value } = NavigationMenuPrimitive.useRootContext();
|
|
153
153
|
const { value: itemValue } = NavigationMenuPrimitive.useItemContext();
|
|
@@ -176,6 +176,6 @@ export {
|
|
|
176
176
|
NavigationMenuLink,
|
|
177
177
|
NavigationMenuList,
|
|
178
178
|
NavigationMenuTrigger,
|
|
179
|
-
NavigationMenuViewport,
|
|
180
179
|
navigationMenuTriggerStyle,
|
|
180
|
+
NavigationMenuViewport,
|
|
181
181
|
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
+
import * as PopoverPrimitive from '@rn-primitives/popover';
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
import { Platform, StyleSheet } from 'react-native';
|
|
3
4
|
import Animated, { FadeIn, FadeOut } from 'react-native-reanimated';
|
|
4
|
-
import { TextClassContext } from './text';
|
|
5
|
-
import * as PopoverPrimitive from '@rn-primitives/popover';
|
|
6
5
|
import { cn } from '../../lib/utils';
|
|
6
|
+
import { TextClassContext } from './text';
|
|
7
7
|
|
|
8
8
|
const Popover = PopoverPrimitive.Root;
|
|
9
9
|
|
|
10
10
|
const PopoverTrigger = PopoverPrimitive.Trigger;
|
|
11
11
|
|
|
12
12
|
const PopoverContent = React.forwardRef<
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
PopoverPrimitive.ContentRef,
|
|
14
|
+
PopoverPrimitive.ContentProps & { portalHost?: string }
|
|
15
15
|
>(({ className, align = 'center', sideOffset = 4, portalHost, ...props }, ref) => {
|
|
16
16
|
return (
|
|
17
17
|
<PopoverPrimitive.Portal hostName={portalHost}>
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as ProgressPrimitive from '@rn-primitives/progress';
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
import { Platform, View } from 'react-native';
|
|
3
4
|
import Animated, {
|
|
@@ -7,12 +8,11 @@ import Animated, {
|
|
|
7
8
|
useDerivedValue,
|
|
8
9
|
withSpring,
|
|
9
10
|
} from 'react-native-reanimated';
|
|
10
|
-
import * as ProgressPrimitive from '@rn-primitives/progress';
|
|
11
11
|
import { cn } from '../../lib/utils';
|
|
12
12
|
|
|
13
13
|
const Progress = React.forwardRef<
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
ProgressPrimitive.RootRef,
|
|
15
|
+
ProgressPrimitive.RootProps & {
|
|
16
16
|
indicatorClassName?: string;
|
|
17
17
|
}
|
|
18
18
|
>(({ className, value, indicatorClassName, ...props }, ref) => {
|