@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
|
@@ -13,60 +13,66 @@ const DialogPortal = DialogPrimitive.Portal;
|
|
|
13
13
|
|
|
14
14
|
const DialogClose = DialogPrimitive.Close;
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
16
|
+
function DialogOverlayWeb({
|
|
17
|
+
className,
|
|
18
|
+
...props
|
|
19
|
+
}: DialogPrimitive.OverlayProps & {
|
|
20
|
+
ref?: React.RefObject<DialogPrimitive.OverlayRef>;
|
|
21
|
+
}) {
|
|
22
|
+
const { open } = DialogPrimitive.useRootContext();
|
|
23
|
+
return (
|
|
24
|
+
<DialogPrimitive.Overlay
|
|
25
|
+
className={cn(
|
|
26
|
+
'bg-black/80 flex justify-center items-center p-2 absolute top-0 right-0 bottom-0 left-0',
|
|
27
|
+
open ? 'web:animate-in web:fade-in-0' : 'web:animate-out web:fade-out-0',
|
|
28
|
+
className
|
|
29
|
+
)}
|
|
30
|
+
{...props}
|
|
31
|
+
/>
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
function DialogOverlayNative({
|
|
36
|
+
className,
|
|
37
|
+
children,
|
|
38
|
+
...props
|
|
39
|
+
}: DialogPrimitive.OverlayProps & {
|
|
40
|
+
ref?: React.RefObject<DialogPrimitive.OverlayRef>;
|
|
41
|
+
children?: React.ReactNode;
|
|
42
|
+
}) {
|
|
39
43
|
return (
|
|
40
44
|
<DialogPrimitive.Overlay
|
|
41
45
|
style={StyleSheet.absoluteFill}
|
|
42
46
|
className={cn('flex bg-black/80 justify-center items-center p-2', className)}
|
|
43
47
|
{...props}
|
|
44
|
-
ref={ref}
|
|
45
48
|
>
|
|
46
49
|
<Animated.View entering={FadeIn.duration(150)} exiting={FadeOut.duration(150)}>
|
|
47
|
-
|
|
50
|
+
{children}
|
|
48
51
|
</Animated.View>
|
|
49
52
|
</DialogPrimitive.Overlay>
|
|
50
53
|
);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
DialogOverlayNative.displayName = 'DialogOverlayNative';
|
|
54
|
+
}
|
|
54
55
|
|
|
55
56
|
const DialogOverlay = Platform.select({
|
|
56
57
|
web: DialogOverlayWeb,
|
|
57
58
|
default: DialogOverlayNative,
|
|
58
59
|
});
|
|
59
60
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
61
|
+
function DialogContent({
|
|
62
|
+
className,
|
|
63
|
+
children,
|
|
64
|
+
portalHost,
|
|
65
|
+
...props
|
|
66
|
+
}: DialogPrimitive.ContentProps & {
|
|
67
|
+
ref?: React.RefObject<DialogPrimitive.ContentRef>;
|
|
68
|
+
className?: string;
|
|
69
|
+
portalHost?: string;
|
|
70
|
+
}) {
|
|
64
71
|
const { open } = DialogPrimitive.useRootContext();
|
|
65
72
|
return (
|
|
66
73
|
<DialogPortal hostName={portalHost}>
|
|
67
74
|
<DialogOverlay>
|
|
68
75
|
<DialogPrimitive.Content
|
|
69
|
-
ref={ref}
|
|
70
76
|
className={cn(
|
|
71
77
|
'max-w-lg gap-4 border border-border web:cursor-default bg-background p-6 shadow-lg web:duration-200 rounded-lg',
|
|
72
78
|
open
|
|
@@ -91,47 +97,53 @@ const DialogContent = React.forwardRef<
|
|
|
91
97
|
</DialogOverlay>
|
|
92
98
|
</DialogPortal>
|
|
93
99
|
);
|
|
94
|
-
}
|
|
95
|
-
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
100
|
+
}
|
|
96
101
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
)
|
|
100
|
-
|
|
102
|
+
function DialogHeader({ className, ...props }: ViewProps) {
|
|
103
|
+
return (
|
|
104
|
+
<View className={cn('flex flex-col gap-1.5 text-center sm:text-left', className)} {...props} />
|
|
105
|
+
);
|
|
106
|
+
}
|
|
101
107
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
108
|
+
function DialogFooter({ className, ...props }: ViewProps) {
|
|
109
|
+
return (
|
|
110
|
+
<View
|
|
111
|
+
className={cn('flex flex-col-reverse sm:flex-row sm:justify-end gap-2', className)}
|
|
112
|
+
{...props}
|
|
113
|
+
/>
|
|
114
|
+
);
|
|
115
|
+
}
|
|
109
116
|
|
|
110
|
-
|
|
111
|
-
|
|
117
|
+
function DialogTitle({
|
|
118
|
+
className,
|
|
119
|
+
...props
|
|
120
|
+
}: DialogPrimitive.TitleProps & {
|
|
121
|
+
ref?: React.RefObject<DialogPrimitive.TitleRef>;
|
|
122
|
+
}) {
|
|
123
|
+
return (
|
|
112
124
|
<DialogPrimitive.Title
|
|
113
|
-
ref={ref}
|
|
114
125
|
className={cn(
|
|
115
126
|
'text-lg native:text-xl text-foreground font-semibold leading-none tracking-tight',
|
|
116
127
|
className
|
|
117
128
|
)}
|
|
118
129
|
{...props}
|
|
119
130
|
/>
|
|
120
|
-
)
|
|
121
|
-
|
|
122
|
-
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
131
|
+
);
|
|
132
|
+
}
|
|
123
133
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
<DialogPrimitive.
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
134
|
+
function DialogDescription({
|
|
135
|
+
className,
|
|
136
|
+
...props
|
|
137
|
+
}: DialogPrimitive.DescriptionProps & {
|
|
138
|
+
ref?: React.RefObject<DialogPrimitive.DescriptionRef>;
|
|
139
|
+
}) {
|
|
140
|
+
return (
|
|
141
|
+
<DialogPrimitive.Description
|
|
142
|
+
className={cn('text-sm native:text-base text-muted-foreground', className)}
|
|
143
|
+
{...props}
|
|
144
|
+
/>
|
|
145
|
+
);
|
|
146
|
+
}
|
|
135
147
|
|
|
136
148
|
export {
|
|
137
149
|
Dialog,
|
|
@@ -28,12 +28,17 @@ const DropdownMenuSub = DropdownMenuPrimitive.Sub;
|
|
|
28
28
|
|
|
29
29
|
const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
31
|
+
function DropdownMenuSubTrigger({
|
|
32
|
+
className,
|
|
33
|
+
inset,
|
|
34
|
+
children,
|
|
35
|
+
...props
|
|
36
|
+
}: DropdownMenuPrimitive.SubTriggerProps & {
|
|
37
|
+
ref?: React.RefObject<DropdownMenuPrimitive.SubTriggerRef>;
|
|
38
|
+
className?: string;
|
|
39
|
+
inset?: boolean;
|
|
40
|
+
children?: React.ReactNode;
|
|
41
|
+
}) {
|
|
37
42
|
const { open } = DropdownMenuPrimitive.useSubContext();
|
|
38
43
|
const Icon = Platform.OS === 'web' ? ChevronRight : open ? ChevronUp : ChevronDown;
|
|
39
44
|
return (
|
|
@@ -44,7 +49,6 @@ const DropdownMenuSubTrigger = React.forwardRef<
|
|
|
44
49
|
)}
|
|
45
50
|
>
|
|
46
51
|
<DropdownMenuPrimitive.SubTrigger
|
|
47
|
-
ref={ref}
|
|
48
52
|
className={cn(
|
|
49
53
|
'flex flex-row web:cursor-default web:select-none gap-2 items-center web:focus:bg-accent web:hover:bg-accent active:bg-accent rounded-sm px-2 py-1.5 native:py-2 web:outline-none',
|
|
50
54
|
open && 'bg-accent',
|
|
@@ -53,22 +57,22 @@ const DropdownMenuSubTrigger = React.forwardRef<
|
|
|
53
57
|
)}
|
|
54
58
|
{...props}
|
|
55
59
|
>
|
|
56
|
-
|
|
60
|
+
{children}
|
|
57
61
|
<Icon size={18} className='ml-auto text-foreground' />
|
|
58
62
|
</DropdownMenuPrimitive.SubTrigger>
|
|
59
63
|
</TextClassContext.Provider>
|
|
60
64
|
);
|
|
61
|
-
}
|
|
62
|
-
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
|
|
65
|
+
}
|
|
63
66
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
67
|
+
function DropdownMenuSubContent({
|
|
68
|
+
className,
|
|
69
|
+
...props
|
|
70
|
+
}: DropdownMenuPrimitive.SubContentProps & {
|
|
71
|
+
ref?: React.RefObject<DropdownMenuPrimitive.SubContentRef>;
|
|
72
|
+
}) {
|
|
68
73
|
const { open } = DropdownMenuPrimitive.useSubContext();
|
|
69
74
|
return (
|
|
70
75
|
<DropdownMenuPrimitive.SubContent
|
|
71
|
-
ref={ref}
|
|
72
76
|
className={cn(
|
|
73
77
|
'z-50 min-w-[8rem] overflow-hidden rounded-md border border-border mt-1 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',
|
|
74
78
|
open
|
|
@@ -79,17 +83,20 @@ const DropdownMenuSubContent = React.forwardRef<
|
|
|
79
83
|
{...props}
|
|
80
84
|
/>
|
|
81
85
|
);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function DropdownMenuContent({
|
|
89
|
+
className,
|
|
90
|
+
overlayClassName,
|
|
91
|
+
overlayStyle,
|
|
92
|
+
portalHost,
|
|
93
|
+
...props
|
|
94
|
+
}: DropdownMenuPrimitive.ContentProps & {
|
|
95
|
+
ref?: React.RefObject<DropdownMenuPrimitive.ContentRef>;
|
|
96
|
+
overlayStyle?: StyleProp<ViewStyle>;
|
|
97
|
+
overlayClassName?: string;
|
|
98
|
+
portalHost?: string;
|
|
99
|
+
}) {
|
|
93
100
|
const { open } = DropdownMenuPrimitive.useRootContext();
|
|
94
101
|
return (
|
|
95
102
|
<DropdownMenuPrimitive.Portal hostName={portalHost}>
|
|
@@ -98,7 +105,7 @@ const DropdownMenuContent = React.forwardRef<
|
|
|
98
105
|
overlayStyle
|
|
99
106
|
? StyleSheet.flatten([
|
|
100
107
|
Platform.OS !== 'web' ? StyleSheet.absoluteFill : undefined,
|
|
101
|
-
overlayStyle,
|
|
108
|
+
overlayStyle as typeof StyleSheet.absoluteFill,
|
|
102
109
|
])
|
|
103
110
|
: Platform.OS !== 'web'
|
|
104
111
|
? StyleSheet.absoluteFill
|
|
@@ -107,7 +114,6 @@ const DropdownMenuContent = React.forwardRef<
|
|
|
107
114
|
className={overlayClassName}
|
|
108
115
|
>
|
|
109
116
|
<DropdownMenuPrimitive.Content
|
|
110
|
-
ref={ref}
|
|
111
117
|
className={cn(
|
|
112
118
|
'z-50 min-w-[8rem] overflow-hidden rounded-md border border-border bg-popover p-1 shadow-md shadow-foreground/5 web:data-[side=bottom]:slide-in-from-top-2 web:data-[side=left]:slide-in-from-right-2 web:data-[side=right]:slide-in-from-left-2 web:data-[side=top]:slide-in-from-bottom-2',
|
|
113
119
|
open
|
|
@@ -120,108 +126,124 @@ const DropdownMenuContent = React.forwardRef<
|
|
|
120
126
|
</DropdownMenuPrimitive.Overlay>
|
|
121
127
|
</DropdownMenuPrimitive.Portal>
|
|
122
128
|
);
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
function DropdownMenuItem({
|
|
132
|
+
className,
|
|
133
|
+
inset,
|
|
134
|
+
...props
|
|
135
|
+
}: DropdownMenuPrimitive.ItemProps & {
|
|
136
|
+
ref?: React.RefObject<DropdownMenuPrimitive.ItemRef>;
|
|
137
|
+
className?: string;
|
|
138
|
+
inset?: boolean;
|
|
139
|
+
}) {
|
|
140
|
+
return (
|
|
141
|
+
<TextClassContext.Provider value='select-none text-sm native:text-lg text-popover-foreground web:group-focus:text-accent-foreground'>
|
|
142
|
+
<DropdownMenuPrimitive.Item
|
|
143
|
+
className={cn(
|
|
144
|
+
'relative flex flex-row web:cursor-default gap-2 items-center 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',
|
|
145
|
+
inset && 'pl-8',
|
|
146
|
+
props.disabled && 'opacity-50 web:pointer-events-none',
|
|
147
|
+
className
|
|
148
|
+
)}
|
|
149
|
+
{...props}
|
|
150
|
+
/>
|
|
151
|
+
</TextClassContext.Provider>
|
|
152
|
+
);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
function DropdownMenuCheckboxItem({
|
|
156
|
+
className,
|
|
157
|
+
children,
|
|
158
|
+
checked,
|
|
159
|
+
...props
|
|
160
|
+
}: DropdownMenuPrimitive.CheckboxItemProps & {
|
|
161
|
+
ref?: React.RefObject<DropdownMenuPrimitive.CheckboxItemRef>;
|
|
162
|
+
children?: React.ReactNode;
|
|
163
|
+
}) {
|
|
164
|
+
return (
|
|
165
|
+
<DropdownMenuPrimitive.CheckboxItem
|
|
166
|
+
className={cn(
|
|
167
|
+
'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',
|
|
168
|
+
props.disabled && 'web:pointer-events-none opacity-50',
|
|
169
|
+
className
|
|
170
|
+
)}
|
|
171
|
+
checked={checked}
|
|
172
|
+
{...props}
|
|
173
|
+
>
|
|
174
|
+
<View className='absolute left-2 flex h-3.5 w-3.5 items-center justify-center'>
|
|
175
|
+
<DropdownMenuPrimitive.ItemIndicator>
|
|
176
|
+
<Check size={14} strokeWidth={3} className='text-foreground' />
|
|
177
|
+
</DropdownMenuPrimitive.ItemIndicator>
|
|
178
|
+
</View>
|
|
179
|
+
{children}
|
|
180
|
+
</DropdownMenuPrimitive.CheckboxItem>
|
|
181
|
+
);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
function DropdownMenuRadioItem({
|
|
185
|
+
className,
|
|
186
|
+
children,
|
|
187
|
+
...props
|
|
188
|
+
}: DropdownMenuPrimitive.RadioItemProps & {
|
|
189
|
+
ref?: React.RefObject<DropdownMenuPrimitive.RadioItemRef>;
|
|
190
|
+
children?: React.ReactNode;
|
|
191
|
+
}) {
|
|
192
|
+
return (
|
|
193
|
+
<DropdownMenuPrimitive.RadioItem
|
|
194
|
+
className={cn(
|
|
195
|
+
'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',
|
|
196
|
+
props.disabled && 'web:pointer-events-none opacity-50',
|
|
197
|
+
className
|
|
198
|
+
)}
|
|
199
|
+
{...props}
|
|
200
|
+
>
|
|
201
|
+
<View className='absolute left-2 flex h-3.5 w-3.5 items-center justify-center'>
|
|
202
|
+
<DropdownMenuPrimitive.ItemIndicator>
|
|
203
|
+
<View className='bg-foreground h-2 w-2 rounded-full' />
|
|
204
|
+
</DropdownMenuPrimitive.ItemIndicator>
|
|
205
|
+
</View>
|
|
206
|
+
{children}
|
|
207
|
+
</DropdownMenuPrimitive.RadioItem>
|
|
208
|
+
);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
function DropdownMenuLabel({
|
|
212
|
+
className,
|
|
213
|
+
inset,
|
|
214
|
+
...props
|
|
215
|
+
}: DropdownMenuPrimitive.LabelProps & {
|
|
216
|
+
ref?: React.RefObject<DropdownMenuPrimitive.LabelRef>;
|
|
217
|
+
className?: string;
|
|
218
|
+
inset?: boolean;
|
|
219
|
+
}) {
|
|
220
|
+
return (
|
|
221
|
+
<DropdownMenuPrimitive.Label
|
|
135
222
|
className={cn(
|
|
136
|
-
'
|
|
223
|
+
'px-2 py-1.5 text-sm native:text-base font-semibold text-foreground web:cursor-default',
|
|
137
224
|
inset && 'pl-8',
|
|
138
|
-
props.disabled && 'opacity-50 web:pointer-events-none',
|
|
139
225
|
className
|
|
140
226
|
)}
|
|
141
227
|
{...props}
|
|
142
228
|
/>
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
'
|
|
155
|
-
props
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
<View className='absolute left-2 flex h-3.5 w-3.5 items-center justify-center'>
|
|
162
|
-
<DropdownMenuPrimitive.ItemIndicator>
|
|
163
|
-
<Check size={14} strokeWidth={3} className='text-foreground' />
|
|
164
|
-
</DropdownMenuPrimitive.ItemIndicator>
|
|
165
|
-
</View>
|
|
166
|
-
<>{children}</>
|
|
167
|
-
</DropdownMenuPrimitive.CheckboxItem>
|
|
168
|
-
));
|
|
169
|
-
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
|
|
170
|
-
|
|
171
|
-
const DropdownMenuRadioItem = React.forwardRef<
|
|
172
|
-
DropdownMenuPrimitive.RadioItemRef,
|
|
173
|
-
DropdownMenuPrimitive.RadioItemProps
|
|
174
|
-
>(({ className, children, ...props }, ref) => (
|
|
175
|
-
<DropdownMenuPrimitive.RadioItem
|
|
176
|
-
ref={ref}
|
|
177
|
-
className={cn(
|
|
178
|
-
'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',
|
|
179
|
-
props.disabled && 'web:pointer-events-none opacity-50',
|
|
180
|
-
className
|
|
181
|
-
)}
|
|
182
|
-
{...props}
|
|
183
|
-
>
|
|
184
|
-
<View className='absolute left-2 flex h-3.5 w-3.5 items-center justify-center'>
|
|
185
|
-
<DropdownMenuPrimitive.ItemIndicator>
|
|
186
|
-
<View className='bg-foreground h-2 w-2 rounded-full' />
|
|
187
|
-
</DropdownMenuPrimitive.ItemIndicator>
|
|
188
|
-
</View>
|
|
189
|
-
<>{children}</>
|
|
190
|
-
</DropdownMenuPrimitive.RadioItem>
|
|
191
|
-
));
|
|
192
|
-
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
|
|
193
|
-
|
|
194
|
-
const DropdownMenuLabel = React.forwardRef<
|
|
195
|
-
DropdownMenuPrimitive.LabelRef,
|
|
196
|
-
DropdownMenuPrimitive.LabelProps & {
|
|
197
|
-
inset?: boolean;
|
|
198
|
-
}
|
|
199
|
-
>(({ className, inset, ...props }, ref) => (
|
|
200
|
-
<DropdownMenuPrimitive.Label
|
|
201
|
-
ref={ref}
|
|
202
|
-
className={cn(
|
|
203
|
-
'px-2 py-1.5 text-sm native:text-base font-semibold text-foreground web:cursor-default',
|
|
204
|
-
inset && 'pl-8',
|
|
205
|
-
className
|
|
206
|
-
)}
|
|
207
|
-
{...props}
|
|
208
|
-
/>
|
|
209
|
-
));
|
|
210
|
-
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
|
211
|
-
|
|
212
|
-
const DropdownMenuSeparator = React.forwardRef<
|
|
213
|
-
DropdownMenuPrimitive.SeparatorRef,
|
|
214
|
-
DropdownMenuPrimitive.SeparatorProps
|
|
215
|
-
>(({ className, ...props }, ref) => (
|
|
216
|
-
<DropdownMenuPrimitive.Separator
|
|
217
|
-
ref={ref}
|
|
218
|
-
className={cn('-mx-1 my-1 h-px bg-border', className)}
|
|
219
|
-
{...props}
|
|
220
|
-
/>
|
|
221
|
-
));
|
|
222
|
-
DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
|
|
223
|
-
|
|
224
|
-
const DropdownMenuShortcut = ({ className, ...props }: TextProps) => {
|
|
229
|
+
);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
function DropdownMenuSeparator({
|
|
233
|
+
className,
|
|
234
|
+
...props
|
|
235
|
+
}: DropdownMenuPrimitive.SeparatorProps & {
|
|
236
|
+
ref?: React.RefObject<DropdownMenuPrimitive.SeparatorRef>;
|
|
237
|
+
}) {
|
|
238
|
+
return (
|
|
239
|
+
<DropdownMenuPrimitive.Separator
|
|
240
|
+
className={cn('-mx-1 my-1 h-px bg-border', className)}
|
|
241
|
+
{...props}
|
|
242
|
+
/>
|
|
243
|
+
);
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
function DropdownMenuShortcut({ className, ...props }: TextProps) {
|
|
225
247
|
return (
|
|
226
248
|
<Text
|
|
227
249
|
className={cn(
|
|
@@ -231,8 +253,7 @@ const DropdownMenuShortcut = ({ className, ...props }: TextProps) => {
|
|
|
231
253
|
{...props}
|
|
232
254
|
/>
|
|
233
255
|
);
|
|
234
|
-
}
|
|
235
|
-
DropdownMenuShortcut.displayName = 'DropdownMenuShortcut';
|
|
256
|
+
}
|
|
236
257
|
|
|
237
258
|
export {
|
|
238
259
|
DropdownMenu,
|
|
@@ -9,10 +9,14 @@ const HoverCard = HoverCardPrimitive.Root;
|
|
|
9
9
|
|
|
10
10
|
const HoverCardTrigger = HoverCardPrimitive.Trigger;
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
function HoverCardContent({
|
|
13
|
+
className,
|
|
14
|
+
align = 'center',
|
|
15
|
+
sideOffset = 4,
|
|
16
|
+
...props
|
|
17
|
+
}: HoverCardPrimitive.ContentProps & {
|
|
18
|
+
ref?: React.RefObject<HoverCardPrimitive.ContentRef>;
|
|
19
|
+
}) {
|
|
16
20
|
const { open } = HoverCardPrimitive.useRootContext();
|
|
17
21
|
return (
|
|
18
22
|
<HoverCardPrimitive.Portal>
|
|
@@ -22,7 +26,6 @@ const HoverCardContent = React.forwardRef<
|
|
|
22
26
|
<Animated.View entering={FadeIn}>
|
|
23
27
|
<TextClassContext.Provider value='text-popover-foreground'>
|
|
24
28
|
<HoverCardPrimitive.Content
|
|
25
|
-
ref={ref}
|
|
26
29
|
align={align}
|
|
27
30
|
sideOffset={sideOffset}
|
|
28
31
|
className={cn(
|
|
@@ -39,7 +42,6 @@ const HoverCardContent = React.forwardRef<
|
|
|
39
42
|
</HoverCardPrimitive.Overlay>
|
|
40
43
|
</HoverCardPrimitive.Portal>
|
|
41
44
|
);
|
|
42
|
-
}
|
|
43
|
-
HoverCardContent.displayName = HoverCardPrimitive.Content.displayName;
|
|
45
|
+
}
|
|
44
46
|
|
|
45
47
|
export { HoverCard, HoverCardContent, HoverCardTrigger };
|
|
@@ -2,23 +2,24 @@ import * as React from 'react';
|
|
|
2
2
|
import { TextInput, type TextInputProps } from 'react-native';
|
|
3
3
|
import { cn } from '../../lib/utils';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
5
|
+
function Input({
|
|
6
|
+
className,
|
|
7
|
+
placeholderClassName,
|
|
8
|
+
...props
|
|
9
|
+
}: TextInputProps & {
|
|
10
|
+
ref?: React.RefObject<TextInput>;
|
|
11
|
+
}) {
|
|
12
|
+
return (
|
|
13
|
+
<TextInput
|
|
14
|
+
className={cn(
|
|
15
|
+
'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',
|
|
16
|
+
props.editable === false && 'opacity-50 web:cursor-not-allowed',
|
|
17
|
+
className
|
|
18
|
+
)}
|
|
19
|
+
placeholderClassName={cn('text-muted-foreground', placeholderClassName)}
|
|
20
|
+
{...props}
|
|
21
|
+
/>
|
|
22
|
+
);
|
|
23
|
+
}
|
|
23
24
|
|
|
24
25
|
export { Input };
|
|
@@ -2,8 +2,17 @@ import * as LabelPrimitive from '@rn-primitives/label';
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { cn } from '../../lib/utils';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
function Label({
|
|
6
|
+
className,
|
|
7
|
+
onPress,
|
|
8
|
+
onLongPress,
|
|
9
|
+
onPressIn,
|
|
10
|
+
onPressOut,
|
|
11
|
+
...props
|
|
12
|
+
}: LabelPrimitive.TextProps & {
|
|
13
|
+
ref?: React.RefObject<LabelPrimitive.TextRef>;
|
|
14
|
+
}) {
|
|
15
|
+
return (
|
|
7
16
|
<LabelPrimitive.Root
|
|
8
17
|
className='web:cursor-default'
|
|
9
18
|
onPress={onPress}
|
|
@@ -12,7 +21,6 @@ const Label = React.forwardRef<LabelPrimitive.TextRef, LabelPrimitive.TextProps>
|
|
|
12
21
|
onPressOut={onPressOut}
|
|
13
22
|
>
|
|
14
23
|
<LabelPrimitive.Text
|
|
15
|
-
ref={ref}
|
|
16
24
|
className={cn(
|
|
17
25
|
'text-sm text-foreground native:text-base font-medium leading-none web:peer-disabled:cursor-not-allowed web:peer-disabled:opacity-70',
|
|
18
26
|
className
|
|
@@ -20,8 +28,7 @@ const Label = React.forwardRef<LabelPrimitive.TextRef, LabelPrimitive.TextProps>
|
|
|
20
28
|
{...props}
|
|
21
29
|
/>
|
|
22
30
|
</LabelPrimitive.Root>
|
|
23
|
-
)
|
|
24
|
-
|
|
25
|
-
Label.displayName = LabelPrimitive.Root.displayName;
|
|
31
|
+
);
|
|
32
|
+
}
|
|
26
33
|
|
|
27
34
|
export { Label };
|