@react-native-reusables/cli 0.0.18 → 0.1.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/README.md +2 -37
- package/__generated/components/ui/accordion.tsx +30 -32
- package/__generated/components/ui/alert-dialog.tsx +19 -26
- package/__generated/components/ui/aspect-ratio.tsx +1 -1
- package/__generated/components/ui/avatar.tsx +31 -34
- 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 +25 -27
- package/__generated/components/ui/collapsible.tsx +1 -1
- package/__generated/components/ui/context-menu.tsx +28 -31
- package/__generated/components/ui/dialog.tsx +40 -43
- package/__generated/components/ui/dropdown-menu.tsx +27 -22
- package/__generated/components/ui/hover-card.tsx +3 -3
- package/__generated/components/ui/input.tsx +17 -18
- package/__generated/components/ui/label.tsx +21 -22
- package/__generated/components/ui/menubar.tsx +45 -47
- package/__generated/components/ui/navigation-menu.tsx +19 -17
- package/__generated/components/ui/popover.tsx +4 -4
- package/__generated/components/ui/progress.tsx +15 -11
- package/__generated/components/ui/radio-group.tsx +27 -29
- package/__generated/components/ui/select.tsx +55 -65
- package/__generated/components/ui/separator.tsx +16 -17
- package/__generated/components/ui/switch.tsx +59 -61
- package/__generated/components/ui/table.tsx +69 -76
- package/__generated/components/ui/tabs.tsx +49 -52
- package/__generated/components/ui/text.tsx +2 -2
- package/__generated/components/ui/textarea.tsx +20 -21
- package/__generated/components/ui/toggle-group.tsx +5 -7
- package/__generated/components/ui/toggle.tsx +4 -4
- package/__generated/components/ui/tooltip.tsx +4 -5
- package/__generated/components/ui/typography.tsx +2 -2
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/package.json +2 -34
- package/__generated/components/primitives/accordion/accordion.tsx +0 -216
- package/__generated/components/primitives/accordion/accordion.web.tsx +0 -295
- package/__generated/components/primitives/accordion/index.ts +0 -1
- package/__generated/components/primitives/accordion/types.ts +0 -45
- package/__generated/components/primitives/alert-dialog/alert-dialog.tsx +0 -237
- package/__generated/components/primitives/alert-dialog/alert-dialog.web.tsx +0 -256
- package/__generated/components/primitives/alert-dialog/index.ts +0 -1
- package/__generated/components/primitives/alert-dialog/types.ts +0 -48
- package/__generated/components/primitives/aspect-ratio.tsx +0 -23
- package/__generated/components/primitives/avatar/index.tsx +0 -95
- package/__generated/components/primitives/avatar/types.ts +0 -10
- package/__generated/components/primitives/checkbox/checkbox.tsx +0 -101
- package/__generated/components/primitives/checkbox/checkbox.web.tsx +0 -114
- package/__generated/components/primitives/checkbox/index.ts +0 -1
- package/__generated/components/primitives/checkbox/types.ts +0 -11
- package/__generated/components/primitives/collapsible/collapsible.tsx +0 -119
- package/__generated/components/primitives/collapsible/collapsible.web.tsx +0 -157
- package/__generated/components/primitives/collapsible/index.ts +0 -1
- package/__generated/components/primitives/collapsible/types.ts +0 -18
- package/__generated/components/primitives/context-menu/context-menu.tsx +0 -648
- package/__generated/components/primitives/context-menu/context-menu.web.tsx +0 -533
- package/__generated/components/primitives/context-menu/index.ts +0 -1
- package/__generated/components/primitives/context-menu/types.ts +0 -90
- package/__generated/components/primitives/dialog/dialog.tsx +0 -211
- package/__generated/components/primitives/dialog/dialog.web.tsx +0 -197
- package/__generated/components/primitives/dialog/index.ts +0 -1
- package/__generated/components/primitives/dialog/types.ts +0 -60
- package/__generated/components/primitives/dropdown-menu/dropdown-menu.tsx +0 -608
- package/__generated/components/primitives/dropdown-menu/dropdown-menu.web.tsx +0 -550
- package/__generated/components/primitives/dropdown-menu/index.ts +0 -1
- package/__generated/components/primitives/dropdown-menu/types.ts +0 -72
- package/__generated/components/primitives/hooks/index.ts +0 -3
- package/__generated/components/primitives/hooks/useAugmentedRef.tsx +0 -29
- package/__generated/components/primitives/hooks/useControllableState.tsx +0 -75
- package/__generated/components/primitives/hooks/useRelativePosition.tsx +0 -227
- package/__generated/components/primitives/hover-card/hover-card.tsx +0 -279
- package/__generated/components/primitives/hover-card/hover-card.web.tsx +0 -150
- package/__generated/components/primitives/hover-card/index.ts +0 -1
- package/__generated/components/primitives/hover-card/types.ts +0 -51
- package/__generated/components/primitives/label/index.ts +0 -1
- package/__generated/components/primitives/label/label.tsx +0 -31
- package/__generated/components/primitives/label/label.web.tsx +0 -36
- package/__generated/components/primitives/label/types.ts +0 -15
- package/__generated/components/primitives/menubar/index.ts +0 -1
- package/__generated/components/primitives/menubar/menubar.tsx +0 -622
- package/__generated/components/primitives/menubar/menubar.web.tsx +0 -548
- package/__generated/components/primitives/menubar/types.ts +0 -77
- package/__generated/components/primitives/navigation-menu/index.ts +0 -1
- package/__generated/components/primitives/navigation-menu/navigation-menu.tsx +0 -315
- package/__generated/components/primitives/navigation-menu/navigation-menu.web.tsx +0 -264
- package/__generated/components/primitives/navigation-menu/types.ts +0 -49
- package/__generated/components/primitives/popover/index.ts +0 -1
- package/__generated/components/primitives/popover/popover.tsx +0 -290
- package/__generated/components/primitives/popover/popover.web.tsx +0 -191
- package/__generated/components/primitives/popover/types.ts +0 -24
- package/__generated/components/primitives/portal.tsx +0 -82
- package/__generated/components/primitives/progress/index.ts +0 -1
- package/__generated/components/primitives/progress/progress.tsx +0 -59
- package/__generated/components/primitives/progress/progress.web.tsx +0 -36
- package/__generated/components/primitives/progress/types.ts +0 -7
- package/__generated/components/primitives/radio-group/index.ts +0 -1
- package/__generated/components/primitives/radio-group/radio-group.tsx +0 -116
- package/__generated/components/primitives/radio-group/radio-group.web.tsx +0 -78
- package/__generated/components/primitives/radio-group/types.ts +0 -15
- package/__generated/components/primitives/select/index.ts +0 -1
- package/__generated/components/primitives/select/select.tsx +0 -466
- package/__generated/components/primitives/select/select.web.tsx +0 -332
- package/__generated/components/primitives/select/types.ts +0 -89
- package/__generated/components/primitives/separator/index.tsx +0 -23
- package/__generated/components/primitives/separator/types.ts +0 -6
- package/__generated/components/primitives/slider/index.ts +0 -1
- package/__generated/components/primitives/slider/slider.tsx +0 -89
- package/__generated/components/primitives/slider/slider.web.tsx +0 -67
- package/__generated/components/primitives/slider/types.ts +0 -24
- package/__generated/components/primitives/slot.tsx +0 -187
- package/__generated/components/primitives/switch/index.ts +0 -1
- package/__generated/components/primitives/switch/switch.tsx +0 -65
- package/__generated/components/primitives/switch/switch.web.tsx +0 -67
- package/__generated/components/primitives/switch/types.ts +0 -11
- package/__generated/components/primitives/table.tsx +0 -55
- package/__generated/components/primitives/tabs/index.ts +0 -1
- package/__generated/components/primitives/tabs/tabs.tsx +0 -133
- package/__generated/components/primitives/tabs/tabs.web.tsx +0 -97
- package/__generated/components/primitives/tabs/types.ts +0 -24
- package/__generated/components/primitives/toast/index.tsx +0 -128
- package/__generated/components/primitives/toast/types.ts +0 -7
- package/__generated/components/primitives/toggle/index.ts +0 -1
- package/__generated/components/primitives/toggle/toggle.tsx +0 -37
- package/__generated/components/primitives/toggle/toggle.web.tsx +0 -26
- package/__generated/components/primitives/toggle/types.ts +0 -7
- package/__generated/components/primitives/toggle-group/index.ts +0 -1
- package/__generated/components/primitives/toggle-group/toggle-group.tsx +0 -125
- package/__generated/components/primitives/toggle-group/toggle-group.web.tsx +0 -124
- package/__generated/components/primitives/toggle-group/types.ts +0 -37
- package/__generated/components/primitives/toolbar/index.ts +0 -1
- package/__generated/components/primitives/toolbar/toolbar.tsx +0 -125
- package/__generated/components/primitives/toolbar/toolbar.web.tsx +0 -129
- package/__generated/components/primitives/toolbar/types.ts +0 -39
- package/__generated/components/primitives/tooltip/index.ts +0 -1
- package/__generated/components/primitives/tooltip/tooltip.tsx +0 -277
- package/__generated/components/primitives/tooltip/tooltip.web.tsx +0 -181
- package/__generated/components/primitives/tooltip/types.ts +0 -42
- package/__generated/components/primitives/types.ts +0 -105
- package/__generated/components/primitives/utils.ts +0 -61
|
@@ -1,6 +1,14 @@
|
|
|
1
|
-
import * as ContextMenuPrimitive from '@
|
|
1
|
+
import * as ContextMenuPrimitive from '@rn-primitives/context-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';
|
|
@@ -9,20 +17,14 @@ import { cn } from '../../lib/utils';
|
|
|
9
17
|
import { TextClassContext } from './text';
|
|
10
18
|
|
|
11
19
|
const ContextMenu = ContextMenuPrimitive.Root;
|
|
12
|
-
|
|
13
20
|
const ContextMenuTrigger = ContextMenuPrimitive.Trigger;
|
|
14
|
-
|
|
15
21
|
const ContextMenuGroup = ContextMenuPrimitive.Group;
|
|
16
|
-
|
|
17
|
-
const ContextMenuPortal = ContextMenuPrimitive.Portal;
|
|
18
|
-
|
|
19
22
|
const ContextMenuSub = ContextMenuPrimitive.Sub;
|
|
20
|
-
|
|
21
23
|
const ContextMenuRadioGroup = ContextMenuPrimitive.RadioGroup;
|
|
22
24
|
|
|
23
25
|
const ContextMenuSubTrigger = React.forwardRef<
|
|
24
|
-
|
|
25
|
-
|
|
26
|
+
ContextMenuPrimitive.SubTriggerRef,
|
|
27
|
+
ContextMenuPrimitive.SubTriggerProps & {
|
|
26
28
|
inset?: boolean;
|
|
27
29
|
}
|
|
28
30
|
>(({ className, inset, children, ...props }, ref) => {
|
|
@@ -54,8 +56,8 @@ const ContextMenuSubTrigger = React.forwardRef<
|
|
|
54
56
|
ContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName;
|
|
55
57
|
|
|
56
58
|
const ContextMenuSubContent = React.forwardRef<
|
|
57
|
-
|
|
58
|
-
|
|
59
|
+
ContextMenuPrimitive.SubContentRef,
|
|
60
|
+
ContextMenuPrimitive.SubContentProps
|
|
59
61
|
>(({ className, ...props }, ref) => {
|
|
60
62
|
const { open } = ContextMenuPrimitive.useSubContext();
|
|
61
63
|
return (
|
|
@@ -75,8 +77,8 @@ const ContextMenuSubContent = React.forwardRef<
|
|
|
75
77
|
ContextMenuSubContent.displayName = ContextMenuPrimitive.SubContent.displayName;
|
|
76
78
|
|
|
77
79
|
const ContextMenuContent = React.forwardRef<
|
|
78
|
-
|
|
79
|
-
|
|
80
|
+
ContextMenuPrimitive.ContentRef,
|
|
81
|
+
ContextMenuPrimitive.ContentProps & {
|
|
80
82
|
overlayStyle?: StyleProp<ViewStyle>;
|
|
81
83
|
overlayClassName?: string;
|
|
82
84
|
portalHost?: string;
|
|
@@ -116,8 +118,8 @@ const ContextMenuContent = React.forwardRef<
|
|
|
116
118
|
ContextMenuContent.displayName = ContextMenuPrimitive.Content.displayName;
|
|
117
119
|
|
|
118
120
|
const ContextMenuItem = React.forwardRef<
|
|
119
|
-
|
|
120
|
-
|
|
121
|
+
ContextMenuPrimitive.ItemRef,
|
|
122
|
+
ContextMenuPrimitive.ItemProps & {
|
|
121
123
|
inset?: boolean;
|
|
122
124
|
}
|
|
123
125
|
>(({ className, inset, ...props }, ref) => (
|
|
@@ -137,9 +139,9 @@ const ContextMenuItem = React.forwardRef<
|
|
|
137
139
|
ContextMenuItem.displayName = ContextMenuPrimitive.Item.displayName;
|
|
138
140
|
|
|
139
141
|
const ContextMenuCheckboxItem = React.forwardRef<
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
>(({ className, children,
|
|
142
|
+
ContextMenuPrimitive.CheckboxItemRef,
|
|
143
|
+
ContextMenuPrimitive.CheckboxItemProps
|
|
144
|
+
>(({ className, children, ...props }, ref) => (
|
|
143
145
|
<ContextMenuPrimitive.CheckboxItem
|
|
144
146
|
ref={ref}
|
|
145
147
|
className={cn(
|
|
@@ -147,7 +149,6 @@ const ContextMenuCheckboxItem = React.forwardRef<
|
|
|
147
149
|
props.disabled && 'web:pointer-events-none opacity-50',
|
|
148
150
|
className
|
|
149
151
|
)}
|
|
150
|
-
checked={checked}
|
|
151
152
|
{...props}
|
|
152
153
|
>
|
|
153
154
|
<View className='absolute left-2 flex h-3.5 w-3.5 items-center justify-center'>
|
|
@@ -161,8 +162,8 @@ const ContextMenuCheckboxItem = React.forwardRef<
|
|
|
161
162
|
ContextMenuCheckboxItem.displayName = ContextMenuPrimitive.CheckboxItem.displayName;
|
|
162
163
|
|
|
163
164
|
const ContextMenuRadioItem = React.forwardRef<
|
|
164
|
-
|
|
165
|
-
|
|
165
|
+
ContextMenuPrimitive.RadioItemRef,
|
|
166
|
+
ContextMenuPrimitive.RadioItemProps
|
|
166
167
|
>(({ className, children, ...props }, ref) => (
|
|
167
168
|
<ContextMenuPrimitive.RadioItem
|
|
168
169
|
ref={ref}
|
|
@@ -184,8 +185,8 @@ const ContextMenuRadioItem = React.forwardRef<
|
|
|
184
185
|
ContextMenuRadioItem.displayName = ContextMenuPrimitive.RadioItem.displayName;
|
|
185
186
|
|
|
186
187
|
const ContextMenuLabel = React.forwardRef<
|
|
187
|
-
|
|
188
|
-
|
|
188
|
+
ContextMenuPrimitive.LabelRef,
|
|
189
|
+
ContextMenuPrimitive.LabelProps & {
|
|
189
190
|
inset?: boolean;
|
|
190
191
|
}
|
|
191
192
|
>(({ className, inset, ...props }, ref) => (
|
|
@@ -202,8 +203,8 @@ const ContextMenuLabel = React.forwardRef<
|
|
|
202
203
|
ContextMenuLabel.displayName = ContextMenuPrimitive.Label.displayName;
|
|
203
204
|
|
|
204
205
|
const ContextMenuSeparator = React.forwardRef<
|
|
205
|
-
|
|
206
|
-
|
|
206
|
+
ContextMenuPrimitive.SeparatorRef,
|
|
207
|
+
ContextMenuPrimitive.SeparatorProps
|
|
207
208
|
>(({ className, ...props }, ref) => (
|
|
208
209
|
<ContextMenuPrimitive.Separator
|
|
209
210
|
ref={ref}
|
|
@@ -213,10 +214,7 @@ const ContextMenuSeparator = React.forwardRef<
|
|
|
213
214
|
));
|
|
214
215
|
ContextMenuSeparator.displayName = ContextMenuPrimitive.Separator.displayName;
|
|
215
216
|
|
|
216
|
-
const ContextMenuShortcut = ({
|
|
217
|
-
className,
|
|
218
|
-
...props
|
|
219
|
-
}: React.ComponentPropsWithoutRef<typeof Text>) => {
|
|
217
|
+
const ContextMenuShortcut = ({ className, ...props }: TextProps) => {
|
|
220
218
|
return (
|
|
221
219
|
<Text
|
|
222
220
|
className={cn(
|
|
@@ -236,7 +234,6 @@ export {
|
|
|
236
234
|
ContextMenuGroup,
|
|
237
235
|
ContextMenuItem,
|
|
238
236
|
ContextMenuLabel,
|
|
239
|
-
ContextMenuPortal,
|
|
240
237
|
ContextMenuRadioGroup,
|
|
241
238
|
ContextMenuRadioItem,
|
|
242
239
|
ContextMenuSeparator,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as DialogPrimitive from '@
|
|
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,35 +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
|
-
);
|
|
33
|
-
});
|
|
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
|
+
);
|
|
34
32
|
|
|
35
33
|
DialogOverlayWeb.displayName = 'DialogOverlayWeb';
|
|
36
34
|
|
|
37
35
|
const DialogOverlayNative = React.forwardRef<
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
DialogPrimitive.OverlayRef,
|
|
37
|
+
DialogPrimitive.OverlayProps
|
|
40
38
|
>(({ className, children, ...props }, ref) => {
|
|
41
39
|
return (
|
|
42
40
|
<DialogPrimitive.Overlay
|
|
43
41
|
style={StyleSheet.absoluteFill}
|
|
44
|
-
className={cn('
|
|
42
|
+
className={cn('flex bg-black/80 justify-center items-center p-2', className)}
|
|
45
43
|
{...props}
|
|
46
44
|
ref={ref}
|
|
47
45
|
>
|
|
@@ -60,8 +58,8 @@ const DialogOverlay = Platform.select({
|
|
|
60
58
|
});
|
|
61
59
|
|
|
62
60
|
const DialogContent = React.forwardRef<
|
|
63
|
-
|
|
64
|
-
|
|
61
|
+
DialogPrimitive.ContentRef,
|
|
62
|
+
DialogPrimitive.ContentProps & { portalHost?: string }
|
|
65
63
|
>(({ className, children, portalHost, ...props }, ref) => {
|
|
66
64
|
const { open } = DialogPrimitive.useRootContext();
|
|
67
65
|
return (
|
|
@@ -70,7 +68,7 @@ const DialogContent = React.forwardRef<
|
|
|
70
68
|
<DialogPrimitive.Content
|
|
71
69
|
ref={ref}
|
|
72
70
|
className={cn(
|
|
73
|
-
'
|
|
71
|
+
'max-w-lg gap-4 border border-border web:cursor-default bg-background p-6 shadow-lg web:duration-200 rounded-lg',
|
|
74
72
|
open
|
|
75
73
|
? 'web:animate-in web:fade-in-0 web:zoom-in-95'
|
|
76
74
|
: 'web:animate-out web:fade-out-0 web:zoom-out-95',
|
|
@@ -96,12 +94,12 @@ const DialogContent = React.forwardRef<
|
|
|
96
94
|
});
|
|
97
95
|
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
98
96
|
|
|
99
|
-
const DialogHeader = ({ className, ...props }:
|
|
97
|
+
const DialogHeader = ({ className, ...props }: ViewProps) => (
|
|
100
98
|
<View className={cn('flex flex-col gap-1.5 text-center sm:text-left', className)} {...props} />
|
|
101
99
|
);
|
|
102
100
|
DialogHeader.displayName = 'DialogHeader';
|
|
103
101
|
|
|
104
|
-
const DialogFooter = ({ className, ...props }:
|
|
102
|
+
const DialogFooter = ({ className, ...props }: ViewProps) => (
|
|
105
103
|
<View
|
|
106
104
|
className={cn('flex flex-col-reverse sm:flex-row sm:justify-end gap-2', className)}
|
|
107
105
|
{...props}
|
|
@@ -109,24 +107,23 @@ const DialogFooter = ({ className, ...props }: React.ComponentPropsWithoutRef<ty
|
|
|
109
107
|
);
|
|
110
108
|
DialogFooter.displayName = 'DialogFooter';
|
|
111
109
|
|
|
112
|
-
const DialogTitle = React.forwardRef<
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
));
|
|
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
|
+
);
|
|
125
122
|
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
126
123
|
|
|
127
124
|
const DialogDescription = React.forwardRef<
|
|
128
|
-
|
|
129
|
-
|
|
125
|
+
DialogPrimitive.DescriptionRef,
|
|
126
|
+
DialogPrimitive.DescriptionProps
|
|
130
127
|
>(({ className, ...props }, ref) => (
|
|
131
128
|
<DialogPrimitive.Description
|
|
132
129
|
ref={ref}
|
|
@@ -1,6 +1,14 @@
|
|
|
1
|
-
import * as DropdownMenuPrimitive from '@
|
|
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(
|
|
@@ -2,7 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import { Platform, StyleSheet } from 'react-native';
|
|
3
3
|
import Animated, { FadeIn } from 'react-native-reanimated';
|
|
4
4
|
import { TextClassContext } from './text';
|
|
5
|
-
import * as HoverCardPrimitive from '@
|
|
5
|
+
import * as HoverCardPrimitive from '@rn-primitives/hover-card';
|
|
6
6
|
import { cn } from '../../lib/utils';
|
|
7
7
|
|
|
8
8
|
const HoverCard = HoverCardPrimitive.Root;
|
|
@@ -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
|
|
|
@@ -1,28 +1,27 @@
|
|
|
1
|
-
import * as LabelPrimitive from '@
|
|
1
|
+
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 };
|