@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,6 @@
|
|
|
1
|
-
import * as MenubarPrimitive from '@
|
|
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(
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as NavigationMenuPrimitive from '@
|
|
1
|
+
import * as NavigationMenuPrimitive from '@rn-primitives/navigation-menu';
|
|
2
2
|
import { cva } from 'class-variance-authority';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { Platform, View } from 'react-native';
|
|
@@ -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) => {
|
|
@@ -102,7 +102,7 @@ const NavigationMenuContent = React.forwardRef<
|
|
|
102
102
|
<NavigationMenuPrimitive.Content
|
|
103
103
|
ref={ref}
|
|
104
104
|
className={cn(
|
|
105
|
-
'
|
|
105
|
+
'w-full native:border native:border-border native:rounded-lg native:shadow-lg native:bg-popover native:text-popover-foreground native:overflow-hidden',
|
|
106
106
|
value === itemValue
|
|
107
107
|
? 'web:animate-in web:fade-in web:slide-in-from-right-20'
|
|
108
108
|
: 'web:animate-out web:fade-out web:slide-out-to-left-20',
|
|
@@ -125,27 +125,29 @@ 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')}>
|
|
133
|
-
<
|
|
133
|
+
<View
|
|
134
134
|
className={cn(
|
|
135
135
|
'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
136
|
className
|
|
137
137
|
)}
|
|
138
138
|
ref={ref}
|
|
139
139
|
{...props}
|
|
140
|
-
|
|
140
|
+
>
|
|
141
|
+
<NavigationMenuPrimitive.Viewport />
|
|
142
|
+
</View>
|
|
141
143
|
</View>
|
|
142
144
|
);
|
|
143
145
|
});
|
|
144
146
|
NavigationMenuViewport.displayName = NavigationMenuPrimitive.Viewport.displayName;
|
|
145
147
|
|
|
146
148
|
const NavigationMenuIndicator = React.forwardRef<
|
|
147
|
-
|
|
148
|
-
|
|
149
|
+
NavigationMenuPrimitive.IndicatorRef,
|
|
150
|
+
NavigationMenuPrimitive.IndicatorProps
|
|
149
151
|
>(({ className, ...props }, ref) => {
|
|
150
152
|
const { value } = NavigationMenuPrimitive.useRootContext();
|
|
151
153
|
const { value: itemValue } = NavigationMenuPrimitive.useItemContext();
|
|
@@ -174,6 +176,6 @@ export {
|
|
|
174
176
|
NavigationMenuLink,
|
|
175
177
|
NavigationMenuList,
|
|
176
178
|
NavigationMenuTrigger,
|
|
177
|
-
NavigationMenuViewport,
|
|
178
179
|
navigationMenuTriggerStyle,
|
|
180
|
+
NavigationMenuViewport,
|
|
179
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 '@rnr/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,5 +1,6 @@
|
|
|
1
|
+
import * as ProgressPrimitive from '@rn-primitives/progress';
|
|
1
2
|
import * as React from 'react';
|
|
2
|
-
import { Platform } from 'react-native';
|
|
3
|
+
import { Platform, View } from 'react-native';
|
|
3
4
|
import Animated, {
|
|
4
5
|
Extrapolation,
|
|
5
6
|
interpolate,
|
|
@@ -7,20 +8,21 @@ import Animated, {
|
|
|
7
8
|
useDerivedValue,
|
|
8
9
|
withSpring,
|
|
9
10
|
} from 'react-native-reanimated';
|
|
10
|
-
import * as ProgressPrimitive from '@rnr/progress';
|
|
11
11
|
import { cn } from '../../lib/utils';
|
|
12
12
|
|
|
13
13
|
const Progress = React.forwardRef<
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
ProgressPrimitive.RootRef,
|
|
15
|
+
ProgressPrimitive.RootProps & {
|
|
16
|
+
indicatorClassName?: string;
|
|
17
|
+
}
|
|
18
|
+
>(({ className, value, indicatorClassName, ...props }, ref) => {
|
|
17
19
|
return (
|
|
18
20
|
<ProgressPrimitive.Root
|
|
19
21
|
ref={ref}
|
|
20
22
|
className={cn('relative h-4 w-full overflow-hidden rounded-full bg-secondary', className)}
|
|
21
23
|
{...props}
|
|
22
24
|
>
|
|
23
|
-
<Indicator value={value} />
|
|
25
|
+
<Indicator value={value} className={indicatorClassName} />
|
|
24
26
|
</ProgressPrimitive.Root>
|
|
25
27
|
);
|
|
26
28
|
});
|
|
@@ -28,7 +30,7 @@ Progress.displayName = ProgressPrimitive.Root.displayName;
|
|
|
28
30
|
|
|
29
31
|
export { Progress };
|
|
30
32
|
|
|
31
|
-
function Indicator({ value }: { value: number | undefined | null }) {
|
|
33
|
+
function Indicator({ value, className }: { value: number | undefined | null; className?: string }) {
|
|
32
34
|
const progress = useDerivedValue(() => value ?? 0);
|
|
33
35
|
|
|
34
36
|
const indicator = useAnimatedStyle(() => {
|
|
@@ -42,16 +44,18 @@ function Indicator({ value }: { value: number | undefined | null }) {
|
|
|
42
44
|
|
|
43
45
|
if (Platform.OS === 'web') {
|
|
44
46
|
return (
|
|
45
|
-
<
|
|
46
|
-
className='h-full w-full flex-1 bg-primary web:transition-all'
|
|
47
|
+
<View
|
|
48
|
+
className={cn('h-full w-full flex-1 bg-primary web:transition-all', className)}
|
|
47
49
|
style={{ transform: `translateX(-${100 - (value ?? 0)}%)` }}
|
|
48
|
-
|
|
50
|
+
>
|
|
51
|
+
<ProgressPrimitive.Indicator className={cn('h-full w-full ', className)} />
|
|
52
|
+
</View>
|
|
49
53
|
);
|
|
50
54
|
}
|
|
51
55
|
|
|
52
56
|
return (
|
|
53
57
|
<ProgressPrimitive.Indicator asChild>
|
|
54
|
-
<Animated.View style={indicator} className={cn('h-full bg-foreground')} />
|
|
58
|
+
<Animated.View style={indicator} className={cn('h-full bg-foreground', className)} />
|
|
55
59
|
</ProgressPrimitive.Indicator>
|
|
56
60
|
);
|
|
57
61
|
}
|
|
@@ -1,38 +1,36 @@
|
|
|
1
|
+
import * as RadioGroupPrimitive from '@rn-primitives/radio-group';
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
import { View } from 'react-native';
|
|
3
|
-
import * as RadioGroupPrimitive from '@rnr/radio-group';
|
|
4
4
|
import { cn } from '../../lib/utils';
|
|
5
5
|
|
|
6
|
-
const RadioGroup = React.forwardRef<
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
});
|
|
6
|
+
const RadioGroup = React.forwardRef<RadioGroupPrimitive.RootRef, RadioGroupPrimitive.RootProps>(
|
|
7
|
+
({ className, ...props }, ref) => {
|
|
8
|
+
return (
|
|
9
|
+
<RadioGroupPrimitive.Root className={cn('web:grid gap-2', className)} {...props} ref={ref} />
|
|
10
|
+
);
|
|
11
|
+
}
|
|
12
|
+
);
|
|
14
13
|
RadioGroup.displayName = RadioGroupPrimitive.Root.displayName;
|
|
15
14
|
|
|
16
|
-
const RadioGroupItem = React.forwardRef<
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
});
|
|
15
|
+
const RadioGroupItem = React.forwardRef<RadioGroupPrimitive.ItemRef, RadioGroupPrimitive.ItemProps>(
|
|
16
|
+
({ className, ...props }, ref) => {
|
|
17
|
+
return (
|
|
18
|
+
<RadioGroupPrimitive.Item
|
|
19
|
+
ref={ref}
|
|
20
|
+
className={cn(
|
|
21
|
+
'aspect-square h-4 w-4 native:h-5 native:w-5 rounded-full justify-center items-center border border-primary text-primary web:ring-offset-background web:focus:outline-none web:focus-visible:ring-2 web:focus-visible:ring-ring web:focus-visible:ring-offset-2',
|
|
22
|
+
props.disabled && 'web:cursor-not-allowed opacity-50',
|
|
23
|
+
className
|
|
24
|
+
)}
|
|
25
|
+
{...props}
|
|
26
|
+
>
|
|
27
|
+
<RadioGroupPrimitive.Indicator className='flex items-center justify-center'>
|
|
28
|
+
<View className='aspect-square h-[9px] w-[9px] native:h-[10] native:w-[10] bg-primary rounded-full' />
|
|
29
|
+
</RadioGroupPrimitive.Indicator>
|
|
30
|
+
</RadioGroupPrimitive.Item>
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
);
|
|
36
34
|
RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;
|
|
37
35
|
|
|
38
36
|
export { RadioGroup, RadioGroupItem };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as SelectPrimitive from '@
|
|
1
|
+
import * as SelectPrimitive from '@rn-primitives/select';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { Platform, StyleSheet, View } from 'react-native';
|
|
4
4
|
import Animated, { FadeIn, FadeOut } from 'react-native-reanimated';
|
|
@@ -15,32 +15,28 @@ const SelectGroup = SelectPrimitive.Group;
|
|
|
15
15
|
|
|
16
16
|
const SelectValue = SelectPrimitive.Value;
|
|
17
17
|
|
|
18
|
-
const SelectTrigger = React.forwardRef<
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
));
|
|
18
|
+
const SelectTrigger = React.forwardRef<SelectPrimitive.TriggerRef, SelectPrimitive.TriggerProps>(
|
|
19
|
+
({ className, children, ...props }, ref) => (
|
|
20
|
+
<SelectPrimitive.Trigger
|
|
21
|
+
ref={ref}
|
|
22
|
+
className={cn(
|
|
23
|
+
'flex flex-row h-10 native:h-12 items-center text-sm justify-between rounded-md border border-input bg-background px-3 py-2 web:ring-offset-background text-muted-foreground web:focus:outline-none web:focus:ring-2 web:focus:ring-ring web:focus:ring-offset-2 [&>span]:line-clamp-1',
|
|
24
|
+
props.disabled && 'web:cursor-not-allowed opacity-50',
|
|
25
|
+
className
|
|
26
|
+
)}
|
|
27
|
+
{...props}
|
|
28
|
+
>
|
|
29
|
+
<>{children}</>
|
|
30
|
+
<ChevronDown size={16} aria-hidden={true} className='text-foreground opacity-50' />
|
|
31
|
+
</SelectPrimitive.Trigger>
|
|
32
|
+
)
|
|
33
|
+
);
|
|
35
34
|
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
|
|
36
35
|
|
|
37
36
|
/**
|
|
38
37
|
* Platform: WEB ONLY
|
|
39
38
|
*/
|
|
40
|
-
const SelectScrollUpButton = ({
|
|
41
|
-
className,
|
|
42
|
-
...props
|
|
43
|
-
}: React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>) => {
|
|
39
|
+
const SelectScrollUpButton = ({ className, ...props }: SelectPrimitive.ScrollUpButtonProps) => {
|
|
44
40
|
if (Platform.OS !== 'web') {
|
|
45
41
|
return null;
|
|
46
42
|
}
|
|
@@ -57,10 +53,7 @@ const SelectScrollUpButton = ({
|
|
|
57
53
|
/**
|
|
58
54
|
* Platform: WEB ONLY
|
|
59
55
|
*/
|
|
60
|
-
const SelectScrollDownButton = ({
|
|
61
|
-
className,
|
|
62
|
-
...props
|
|
63
|
-
}: React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>) => {
|
|
56
|
+
const SelectScrollDownButton = ({ className, ...props }: SelectPrimitive.ScrollDownButtonProps) => {
|
|
64
57
|
if (Platform.OS !== 'web') {
|
|
65
58
|
return null;
|
|
66
59
|
}
|
|
@@ -75,8 +68,8 @@ const SelectScrollDownButton = ({
|
|
|
75
68
|
};
|
|
76
69
|
|
|
77
70
|
const SelectContent = React.forwardRef<
|
|
78
|
-
|
|
79
|
-
|
|
71
|
+
SelectPrimitive.ContentRef,
|
|
72
|
+
SelectPrimitive.ContentProps & { portalHost?: string }
|
|
80
73
|
>(({ className, children, position = 'popper', portalHost, ...props }, ref) => {
|
|
81
74
|
const { open } = SelectPrimitive.useRootContext();
|
|
82
75
|
|
|
@@ -117,48 +110,45 @@ const SelectContent = React.forwardRef<
|
|
|
117
110
|
});
|
|
118
111
|
SelectContent.displayName = SelectPrimitive.Content.displayName;
|
|
119
112
|
|
|
120
|
-
const SelectLabel = React.forwardRef<
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
));
|
|
113
|
+
const SelectLabel = React.forwardRef<SelectPrimitive.LabelRef, SelectPrimitive.LabelProps>(
|
|
114
|
+
({ className, ...props }, ref) => (
|
|
115
|
+
<SelectPrimitive.Label
|
|
116
|
+
ref={ref}
|
|
117
|
+
className={cn(
|
|
118
|
+
'py-1.5 native:pb-2 pl-8 native:pl-10 pr-2 text-popover-foreground text-sm native:text-base font-semibold',
|
|
119
|
+
className
|
|
120
|
+
)}
|
|
121
|
+
{...props}
|
|
122
|
+
/>
|
|
123
|
+
)
|
|
124
|
+
);
|
|
133
125
|
SelectLabel.displayName = SelectPrimitive.Label.displayName;
|
|
134
126
|
|
|
135
|
-
const SelectItem = React.forwardRef<
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
</
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
</SelectPrimitive.Item>
|
|
156
|
-
));
|
|
127
|
+
const SelectItem = React.forwardRef<SelectPrimitive.ItemRef, SelectPrimitive.ItemProps>(
|
|
128
|
+
({ className, children, ...props }, ref) => (
|
|
129
|
+
<SelectPrimitive.Item
|
|
130
|
+
ref={ref}
|
|
131
|
+
className={cn(
|
|
132
|
+
'relative web:group flex flex-row w-full web:cursor-default web:select-none items-center rounded-sm py-1.5 native:py-2 pl-8 native:pl-10 pr-2 web:hover:bg-accent/50 active:bg-accent web:outline-none web:focus:bg-accent',
|
|
133
|
+
props.disabled && 'web:pointer-events-none opacity-50',
|
|
134
|
+
className
|
|
135
|
+
)}
|
|
136
|
+
{...props}
|
|
137
|
+
>
|
|
138
|
+
<View className='absolute left-2 native:left-3.5 flex h-3.5 native:pt-px w-3.5 items-center justify-center'>
|
|
139
|
+
<SelectPrimitive.ItemIndicator>
|
|
140
|
+
<Check size={16} strokeWidth={3} className='text-popover-foreground' />
|
|
141
|
+
</SelectPrimitive.ItemIndicator>
|
|
142
|
+
</View>
|
|
143
|
+
<SelectPrimitive.ItemText className='text-sm native:text-lg text-popover-foreground native:text-base web:group-focus:text-accent-foreground' />
|
|
144
|
+
</SelectPrimitive.Item>
|
|
145
|
+
)
|
|
146
|
+
);
|
|
157
147
|
SelectItem.displayName = SelectPrimitive.Item.displayName;
|
|
158
148
|
|
|
159
149
|
const SelectSeparator = React.forwardRef<
|
|
160
|
-
|
|
161
|
-
|
|
150
|
+
SelectPrimitive.SeparatorRef,
|
|
151
|
+
SelectPrimitive.SeparatorProps
|
|
162
152
|
>(({ className, ...props }, ref) => (
|
|
163
153
|
<SelectPrimitive.Separator
|
|
164
154
|
ref={ref}
|
|
@@ -1,23 +1,22 @@
|
|
|
1
|
+
import * as SeparatorPrimitive from '@rn-primitives/separator';
|
|
1
2
|
import * as React from 'react';
|
|
2
|
-
import * as SeparatorPrimitive from '@rnr/separator';
|
|
3
3
|
import { cn } from '../../lib/utils';
|
|
4
4
|
|
|
5
|
-
const Separator = React.forwardRef<
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
));
|
|
5
|
+
const Separator = React.forwardRef<SeparatorPrimitive.RootRef, SeparatorPrimitive.RootProps>(
|
|
6
|
+
({ className, orientation = 'horizontal', decorative = true, ...props }, ref) => (
|
|
7
|
+
<SeparatorPrimitive.Root
|
|
8
|
+
ref={ref}
|
|
9
|
+
decorative={decorative}
|
|
10
|
+
orientation={orientation}
|
|
11
|
+
className={cn(
|
|
12
|
+
'shrink-0 bg-border',
|
|
13
|
+
orientation === 'horizontal' ? 'h-[1px] w-full' : 'h-full w-[1px]',
|
|
14
|
+
className
|
|
15
|
+
)}
|
|
16
|
+
{...props}
|
|
17
|
+
/>
|
|
18
|
+
)
|
|
19
|
+
);
|
|
21
20
|
Separator.displayName = SeparatorPrimitive.Root.displayName;
|
|
22
21
|
|
|
23
22
|
export { Separator };
|