@gv-tech/ui-native 2.6.0
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/package.json +80 -0
- package/src/accordion.tsx +93 -0
- package/src/alert-dialog.tsx +123 -0
- package/src/alert.tsx +50 -0
- package/src/aspect-ratio.tsx +9 -0
- package/src/avatar.tsx +38 -0
- package/src/badge.tsx +51 -0
- package/src/breadcrumb.tsx +9 -0
- package/src/button.tsx +75 -0
- package/src/calendar.tsx +9 -0
- package/src/card.tsx +56 -0
- package/src/carousel.tsx +9 -0
- package/src/chart.tsx +9 -0
- package/src/checkbox.tsx +31 -0
- package/src/collapsible.tsx +15 -0
- package/src/command.tsx +9 -0
- package/src/context-menu.tsx +9 -0
- package/src/dialog.tsx +121 -0
- package/src/drawer.tsx +9 -0
- package/src/dropdown-menu.tsx +9 -0
- package/src/form.tsx +9 -0
- package/src/hover-card.tsx +9 -0
- package/src/index.ts +209 -0
- package/src/input.tsx +27 -0
- package/src/label.tsx +29 -0
- package/src/lib/render-native.tsx +17 -0
- package/src/lib/utils.ts +6 -0
- package/src/menubar.tsx +9 -0
- package/src/nativewind-env.d.ts +1 -0
- package/src/navigation-menu.tsx +9 -0
- package/src/pagination.tsx +9 -0
- package/src/popover.tsx +9 -0
- package/src/progress.tsx +9 -0
- package/src/radio-group.tsx +42 -0
- package/src/resizable.tsx +25 -0
- package/src/scroll-area.tsx +9 -0
- package/src/search.tsx +17 -0
- package/src/select.tsx +229 -0
- package/src/separator.tsx +20 -0
- package/src/sheet.tsx +127 -0
- package/src/skeleton.tsx +31 -0
- package/src/slider.tsx +9 -0
- package/src/sonner.tsx +9 -0
- package/src/switch.tsx +34 -0
- package/src/table.tsx +73 -0
- package/src/tabs.tsx +74 -0
- package/src/text.tsx +43 -0
- package/src/textarea.tsx +29 -0
- package/src/theme-provider.tsx +6 -0
- package/src/theme-toggle.tsx +11 -0
- package/src/toast.tsx +88 -0
- package/src/toaster.tsx +9 -0
- package/src/toggle-group.tsx +78 -0
- package/src/toggle.tsx +35 -0
- package/src/tooltip.tsx +44 -0
package/src/command.tsx
ADDED
package/src/dialog.tsx
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { DialogBaseProps, DialogContentBaseProps } from '@gv-tech/ui-core';
|
|
2
|
+
import * as DialogPrimitive from '@rn-primitives/dialog';
|
|
3
|
+
import { X } from 'lucide-react-native';
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { StyleSheet, View, type ViewStyle } from 'react-native';
|
|
6
|
+
import Animated, { FadeIn, FadeOut } from 'react-native-reanimated';
|
|
7
|
+
|
|
8
|
+
import { cn } from './lib/utils';
|
|
9
|
+
|
|
10
|
+
const Dialog = DialogPrimitive.Root;
|
|
11
|
+
|
|
12
|
+
export interface DialogProps extends React.ComponentPropsWithoutRef<typeof DialogPrimitive.Root>, DialogBaseProps {}
|
|
13
|
+
|
|
14
|
+
export interface DialogContentProps
|
|
15
|
+
extends React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>, DialogContentBaseProps {
|
|
16
|
+
portalHost?: string;
|
|
17
|
+
overlayClassName?: string;
|
|
18
|
+
overlayStyle?: ViewStyle;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const DialogTrigger = DialogPrimitive.Trigger;
|
|
22
|
+
|
|
23
|
+
const DialogPortal = DialogPrimitive.Portal;
|
|
24
|
+
|
|
25
|
+
const DialogClose = DialogPrimitive.Close;
|
|
26
|
+
|
|
27
|
+
const DialogOverlay = React.forwardRef<
|
|
28
|
+
React.ElementRef<typeof DialogPrimitive.Overlay>,
|
|
29
|
+
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>
|
|
30
|
+
>(({ className, ...props }, ref) => {
|
|
31
|
+
return (
|
|
32
|
+
<DialogPrimitive.Overlay style={StyleSheet.absoluteFill} asChild ref={ref} {...props}>
|
|
33
|
+
<Animated.View
|
|
34
|
+
entering={FadeIn.duration(150)}
|
|
35
|
+
exiting={FadeOut.duration(150)}
|
|
36
|
+
className={cn('z-50 bg-black/80 flex justify-center items-center p-2', className)}
|
|
37
|
+
/>
|
|
38
|
+
</DialogPrimitive.Overlay>
|
|
39
|
+
);
|
|
40
|
+
});
|
|
41
|
+
DialogOverlay.displayName = DialogPrimitive.Overlay?.displayName || 'DialogOverlay';
|
|
42
|
+
|
|
43
|
+
const DialogContent = React.forwardRef<React.ElementRef<typeof DialogPrimitive.Content>, DialogContentProps>(
|
|
44
|
+
({ className, children, portalHost, overlayClassName, overlayStyle, ...props }, ref) => {
|
|
45
|
+
return (
|
|
46
|
+
<DialogPortal hostName={portalHost}>
|
|
47
|
+
<DialogOverlay className={overlayClassName} style={overlayStyle} />
|
|
48
|
+
<DialogPrimitive.Content ref={ref} asChild {...props}>
|
|
49
|
+
<Animated.View
|
|
50
|
+
entering={FadeIn.duration(150)}
|
|
51
|
+
exiting={FadeOut.duration(150)}
|
|
52
|
+
className={cn(
|
|
53
|
+
'z-50 max-w-lg gap-4 border border-border bg-background p-6 shadow-lg sm:rounded-lg w-full rounded-xl',
|
|
54
|
+
className,
|
|
55
|
+
)}
|
|
56
|
+
>
|
|
57
|
+
{children}
|
|
58
|
+
<DialogPrimitive.Close
|
|
59
|
+
className={
|
|
60
|
+
'absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground'
|
|
61
|
+
}
|
|
62
|
+
>
|
|
63
|
+
<X size={18} className="text-muted-foreground" />
|
|
64
|
+
<View className="sr-only">
|
|
65
|
+
<DialogPrimitive.Title>Close</DialogPrimitive.Title>
|
|
66
|
+
</View>
|
|
67
|
+
</DialogPrimitive.Close>
|
|
68
|
+
</Animated.View>
|
|
69
|
+
</DialogPrimitive.Content>
|
|
70
|
+
</DialogPortal>
|
|
71
|
+
);
|
|
72
|
+
},
|
|
73
|
+
);
|
|
74
|
+
DialogContent.displayName = DialogPrimitive.Content?.displayName || 'DialogContent';
|
|
75
|
+
|
|
76
|
+
const DialogHeader = ({ className, ...props }: React.ComponentPropsWithoutRef<typeof View>) => (
|
|
77
|
+
<View className={cn('flex flex-col gap-1.5 text-center sm:text-left', className)} {...props} />
|
|
78
|
+
);
|
|
79
|
+
DialogHeader.displayName = 'DialogHeader';
|
|
80
|
+
|
|
81
|
+
const DialogFooter = ({ className, ...props }: React.ComponentPropsWithoutRef<typeof View>) => (
|
|
82
|
+
<View className={cn('flex flex-col-reverse sm:flex-row sm:justify-end gap-2', className)} {...props} />
|
|
83
|
+
);
|
|
84
|
+
DialogFooter.displayName = 'DialogFooter';
|
|
85
|
+
|
|
86
|
+
const DialogTitle = React.forwardRef<
|
|
87
|
+
React.ElementRef<typeof DialogPrimitive.Title>,
|
|
88
|
+
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>
|
|
89
|
+
>(({ className, ...props }, ref) => (
|
|
90
|
+
<DialogPrimitive.Title
|
|
91
|
+
ref={ref}
|
|
92
|
+
className={cn('text-lg native:text-xl font-semibold leading-none tracking-tight text-foreground', className)}
|
|
93
|
+
{...props}
|
|
94
|
+
/>
|
|
95
|
+
));
|
|
96
|
+
DialogTitle.displayName = DialogPrimitive.Title?.displayName || 'DialogTitle';
|
|
97
|
+
|
|
98
|
+
const DialogDescription = React.forwardRef<
|
|
99
|
+
React.ElementRef<typeof DialogPrimitive.Description>,
|
|
100
|
+
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>
|
|
101
|
+
>(({ className, ...props }, ref) => (
|
|
102
|
+
<DialogPrimitive.Description
|
|
103
|
+
ref={ref}
|
|
104
|
+
className={cn('text-sm native:text-base text-muted-foreground', className)}
|
|
105
|
+
{...props}
|
|
106
|
+
/>
|
|
107
|
+
));
|
|
108
|
+
DialogDescription.displayName = DialogPrimitive.Description?.displayName || 'DialogDescription';
|
|
109
|
+
|
|
110
|
+
export {
|
|
111
|
+
Dialog,
|
|
112
|
+
DialogClose,
|
|
113
|
+
DialogContent,
|
|
114
|
+
DialogDescription,
|
|
115
|
+
DialogFooter,
|
|
116
|
+
DialogHeader,
|
|
117
|
+
DialogOverlay,
|
|
118
|
+
DialogPortal,
|
|
119
|
+
DialogTitle,
|
|
120
|
+
DialogTrigger,
|
|
121
|
+
};
|
package/src/drawer.tsx
ADDED
package/src/form.tsx
ADDED
package/src/index.ts
ADDED
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
// @gv-tech/ui-native
|
|
2
|
+
//
|
|
3
|
+
// React Native implementations of the GV Tech design system components.
|
|
4
|
+
// Each component satisfies the contracts defined in @gv-tech/ui-core.
|
|
5
|
+
|
|
6
|
+
// Utilities
|
|
7
|
+
export { wrapTextChildren } from './lib/render-native';
|
|
8
|
+
export { cn } from './lib/utils';
|
|
9
|
+
|
|
10
|
+
// Accordion
|
|
11
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from './accordion';
|
|
12
|
+
|
|
13
|
+
// Alert
|
|
14
|
+
export { Alert, AlertDescription, AlertTitle } from './alert';
|
|
15
|
+
|
|
16
|
+
// Alert Dialog
|
|
17
|
+
export {
|
|
18
|
+
AlertDialog,
|
|
19
|
+
AlertDialogAction,
|
|
20
|
+
AlertDialogCancel,
|
|
21
|
+
AlertDialogContent,
|
|
22
|
+
AlertDialogDescription,
|
|
23
|
+
AlertDialogFooter,
|
|
24
|
+
AlertDialogHeader,
|
|
25
|
+
AlertDialogOverlay,
|
|
26
|
+
AlertDialogPortal,
|
|
27
|
+
AlertDialogTitle,
|
|
28
|
+
AlertDialogTrigger,
|
|
29
|
+
} from './alert-dialog';
|
|
30
|
+
|
|
31
|
+
// Aspect Ratio
|
|
32
|
+
export { AspectRatio } from './aspect-ratio';
|
|
33
|
+
|
|
34
|
+
// Avatar
|
|
35
|
+
export { Avatar, AvatarFallback, AvatarImage } from './avatar';
|
|
36
|
+
|
|
37
|
+
// Badge
|
|
38
|
+
export { Badge, badgeVariants } from './badge';
|
|
39
|
+
|
|
40
|
+
// Breadcrumb
|
|
41
|
+
export { Breadcrumb } from './breadcrumb';
|
|
42
|
+
|
|
43
|
+
// Button
|
|
44
|
+
export { Button, buttonVariants } from './button';
|
|
45
|
+
export type { ButtonProps } from './button';
|
|
46
|
+
|
|
47
|
+
// Calendar
|
|
48
|
+
export { Calendar } from './calendar';
|
|
49
|
+
|
|
50
|
+
// Card
|
|
51
|
+
export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from './card';
|
|
52
|
+
export type { CardProps } from './card';
|
|
53
|
+
|
|
54
|
+
// Carousel
|
|
55
|
+
export { Carousel } from './carousel';
|
|
56
|
+
|
|
57
|
+
// Chart
|
|
58
|
+
export { Chart } from './chart';
|
|
59
|
+
|
|
60
|
+
// Checkbox
|
|
61
|
+
export { Checkbox } from './checkbox';
|
|
62
|
+
export type { CheckboxProps } from './checkbox';
|
|
63
|
+
|
|
64
|
+
// Collapsible
|
|
65
|
+
export { Collapsible, CollapsibleContent, CollapsibleTrigger } from './collapsible';
|
|
66
|
+
|
|
67
|
+
// Command
|
|
68
|
+
export { Command } from './command';
|
|
69
|
+
|
|
70
|
+
// Context Menu
|
|
71
|
+
export { ContextMenu } from './context-menu';
|
|
72
|
+
|
|
73
|
+
// Dialog
|
|
74
|
+
export {
|
|
75
|
+
Dialog,
|
|
76
|
+
DialogClose,
|
|
77
|
+
DialogContent,
|
|
78
|
+
DialogDescription,
|
|
79
|
+
DialogFooter,
|
|
80
|
+
DialogHeader,
|
|
81
|
+
DialogTitle,
|
|
82
|
+
DialogTrigger,
|
|
83
|
+
} from './dialog';
|
|
84
|
+
export type { DialogProps } from './dialog';
|
|
85
|
+
|
|
86
|
+
// Drawer
|
|
87
|
+
export { Drawer } from './drawer';
|
|
88
|
+
|
|
89
|
+
// Dropdown Menu
|
|
90
|
+
export { DropdownMenu } from './dropdown-menu';
|
|
91
|
+
|
|
92
|
+
// Form
|
|
93
|
+
export { Form } from './form';
|
|
94
|
+
|
|
95
|
+
// Hover Card
|
|
96
|
+
export { HoverCard } from './hover-card';
|
|
97
|
+
|
|
98
|
+
// Input
|
|
99
|
+
export { Input } from './input';
|
|
100
|
+
export type { InputProps } from './input';
|
|
101
|
+
|
|
102
|
+
// Label
|
|
103
|
+
export { Label } from './label';
|
|
104
|
+
|
|
105
|
+
// Menubar
|
|
106
|
+
export { Menubar } from './menubar';
|
|
107
|
+
|
|
108
|
+
// Navigation Menu
|
|
109
|
+
export { NavigationMenu } from './navigation-menu';
|
|
110
|
+
|
|
111
|
+
// Pagination
|
|
112
|
+
export { Pagination } from './pagination';
|
|
113
|
+
|
|
114
|
+
// Popover
|
|
115
|
+
export { Popover } from './popover';
|
|
116
|
+
|
|
117
|
+
// Progress
|
|
118
|
+
export { Progress } from './progress';
|
|
119
|
+
|
|
120
|
+
// Radio
|
|
121
|
+
export { RadioGroup, RadioGroupItem } from './radio-group';
|
|
122
|
+
export type { RadioGroupItemProps, RadioGroupProps } from './radio-group';
|
|
123
|
+
|
|
124
|
+
// Resizable
|
|
125
|
+
export { ResizableHandle, ResizablePanel, ResizablePanelGroup } from './resizable';
|
|
126
|
+
|
|
127
|
+
// Scroll Area
|
|
128
|
+
export { ScrollArea } from './scroll-area';
|
|
129
|
+
|
|
130
|
+
// Search
|
|
131
|
+
export { Search } from './search';
|
|
132
|
+
|
|
133
|
+
// Select
|
|
134
|
+
export {
|
|
135
|
+
Select,
|
|
136
|
+
SelectContent,
|
|
137
|
+
SelectGroup,
|
|
138
|
+
SelectItem,
|
|
139
|
+
SelectLabel,
|
|
140
|
+
SelectScrollDownButton,
|
|
141
|
+
SelectScrollUpButton,
|
|
142
|
+
SelectSeparator,
|
|
143
|
+
SelectTrigger,
|
|
144
|
+
SelectValue,
|
|
145
|
+
} from './select';
|
|
146
|
+
|
|
147
|
+
// Separator
|
|
148
|
+
export { Separator } from './separator';
|
|
149
|
+
|
|
150
|
+
// Sheet
|
|
151
|
+
export {
|
|
152
|
+
Sheet,
|
|
153
|
+
SheetClose,
|
|
154
|
+
SheetContent,
|
|
155
|
+
SheetDescription,
|
|
156
|
+
SheetFooter,
|
|
157
|
+
SheetHeader,
|
|
158
|
+
SheetOverlay,
|
|
159
|
+
SheetPortal,
|
|
160
|
+
SheetTitle,
|
|
161
|
+
SheetTrigger,
|
|
162
|
+
} from './sheet';
|
|
163
|
+
|
|
164
|
+
// Skeleton
|
|
165
|
+
export { Skeleton } from './skeleton';
|
|
166
|
+
|
|
167
|
+
// Slider
|
|
168
|
+
export { Slider } from './slider';
|
|
169
|
+
|
|
170
|
+
// Sonner
|
|
171
|
+
export { Toaster as Sonner } from './sonner';
|
|
172
|
+
|
|
173
|
+
// Switch
|
|
174
|
+
export { Switch } from './switch';
|
|
175
|
+
|
|
176
|
+
// Table
|
|
177
|
+
export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow } from './table';
|
|
178
|
+
|
|
179
|
+
// Tabs
|
|
180
|
+
export { Tabs, TabsContent, TabsList, TabsTrigger } from './tabs';
|
|
181
|
+
|
|
182
|
+
// Text
|
|
183
|
+
export { Text, textVariants } from './text';
|
|
184
|
+
export type { TextProps } from './text';
|
|
185
|
+
|
|
186
|
+
// Textarea
|
|
187
|
+
export { Textarea } from './textarea';
|
|
188
|
+
|
|
189
|
+
// Toggle
|
|
190
|
+
export { Toggle, toggleVariants } from './toggle';
|
|
191
|
+
|
|
192
|
+
// Toggle Group
|
|
193
|
+
export { ToggleGroup, ToggleGroupItem } from './toggle-group';
|
|
194
|
+
|
|
195
|
+
// Tooltip
|
|
196
|
+
export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from './tooltip';
|
|
197
|
+
|
|
198
|
+
// Toast
|
|
199
|
+
export { Toast } from './toast';
|
|
200
|
+
export type { ToastProps } from './toast';
|
|
201
|
+
|
|
202
|
+
// Theme Provider
|
|
203
|
+
export { ThemeProvider } from './theme-provider';
|
|
204
|
+
|
|
205
|
+
// Theme Toggle
|
|
206
|
+
export { ThemeToggle } from './theme-toggle';
|
|
207
|
+
|
|
208
|
+
// Toaster
|
|
209
|
+
export { Toaster } from './toaster';
|
package/src/input.tsx
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { TextInput } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import type { InputBaseProps } from '@gv-tech/ui-core';
|
|
5
|
+
import { cn } from './lib/utils';
|
|
6
|
+
|
|
7
|
+
export interface InputProps extends React.ComponentPropsWithoutRef<typeof TextInput>, InputBaseProps {}
|
|
8
|
+
|
|
9
|
+
const Input = React.forwardRef<React.ElementRef<typeof TextInput>, InputProps>(
|
|
10
|
+
({ className, placeholderClassName, ...props }, ref) => {
|
|
11
|
+
return (
|
|
12
|
+
<TextInput
|
|
13
|
+
ref={ref}
|
|
14
|
+
className={cn(
|
|
15
|
+
'flex h-10 w-full rounded-md border border-input bg-transparent px-3 py-2 text-base text-foreground shadow-sm transition-colors placeholder:text-muted-foreground focus:border-ring disabled:opacity-50',
|
|
16
|
+
className,
|
|
17
|
+
)}
|
|
18
|
+
placeholderClassName={cn('text-muted-foreground', placeholderClassName)}
|
|
19
|
+
{...props}
|
|
20
|
+
/>
|
|
21
|
+
);
|
|
22
|
+
},
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
Input.displayName = 'Input';
|
|
26
|
+
|
|
27
|
+
export { Input };
|
package/src/label.tsx
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as LabelPrimitive from '@rn-primitives/label';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
|
|
4
|
+
import { cn } from './lib/utils';
|
|
5
|
+
|
|
6
|
+
const Label = React.forwardRef<
|
|
7
|
+
React.ElementRef<typeof LabelPrimitive.Text>,
|
|
8
|
+
React.ComponentPropsWithoutRef<typeof LabelPrimitive.Text>
|
|
9
|
+
>(({ className, onPress, onLongPress, onPressIn, onPressOut, ...props }, ref) => (
|
|
10
|
+
<LabelPrimitive.Root
|
|
11
|
+
className="web:cursor-default"
|
|
12
|
+
onPress={onPress}
|
|
13
|
+
onLongPress={onLongPress}
|
|
14
|
+
onPressIn={onPressIn}
|
|
15
|
+
onPressOut={onPressOut}
|
|
16
|
+
>
|
|
17
|
+
<LabelPrimitive.Text
|
|
18
|
+
ref={ref}
|
|
19
|
+
className={cn(
|
|
20
|
+
'text-sm text-foreground native:text-base font-medium leading-none web:peer-disabled:cursor-not-allowed web:peer-disabled:opacity-70',
|
|
21
|
+
className,
|
|
22
|
+
)}
|
|
23
|
+
{...props}
|
|
24
|
+
/>
|
|
25
|
+
</LabelPrimitive.Root>
|
|
26
|
+
));
|
|
27
|
+
Label.displayName = LabelPrimitive.Root?.displayName || 'Label';
|
|
28
|
+
|
|
29
|
+
export { Label };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Text, type TextProps } from 'react-native';
|
|
3
|
+
|
|
4
|
+
// Wraps raw strings or numbers in a React Native <Text> component.
|
|
5
|
+
// Prevents "Unexpected text node" errors in React Native environments.
|
|
6
|
+
export function wrapTextChildren(
|
|
7
|
+
children: React.ReactNode,
|
|
8
|
+
TextComponent: React.ComponentType<TextProps> = Text,
|
|
9
|
+
textProps: TextProps = {},
|
|
10
|
+
): React.ReactNode {
|
|
11
|
+
return React.Children.map(children, (child) => {
|
|
12
|
+
if (typeof child === 'string' || typeof child === 'number') {
|
|
13
|
+
return <TextComponent {...textProps}>{child}</TextComponent>;
|
|
14
|
+
}
|
|
15
|
+
return child;
|
|
16
|
+
});
|
|
17
|
+
}
|
package/src/lib/utils.ts
ADDED
package/src/menubar.tsx
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/// <reference types="nativewind/types" />
|
package/src/popover.tsx
ADDED
package/src/progress.tsx
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { RadioGroupBaseProps, RadioGroupItemBaseProps } from '@gv-tech/ui-core';
|
|
2
|
+
import * as RadioGroupPrimitive from '@rn-primitives/radio-group';
|
|
3
|
+
import { Circle } from 'lucide-react-native';
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
|
|
6
|
+
import { cn } from './lib/utils';
|
|
7
|
+
|
|
8
|
+
export interface RadioGroupProps
|
|
9
|
+
extends React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>, RadioGroupBaseProps {}
|
|
10
|
+
|
|
11
|
+
const RadioGroup = React.forwardRef<React.ElementRef<typeof RadioGroupPrimitive.Root>, RadioGroupProps>(
|
|
12
|
+
({ className, ...props }, ref) => {
|
|
13
|
+
return <RadioGroupPrimitive.Root className={cn('web:grid gap-2', className)} {...props} ref={ref} />;
|
|
14
|
+
},
|
|
15
|
+
);
|
|
16
|
+
RadioGroup.displayName = RadioGroupPrimitive.Root?.displayName || 'RadioGroup';
|
|
17
|
+
|
|
18
|
+
export interface RadioGroupItemProps
|
|
19
|
+
extends Omit<React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>, 'disabled'>, RadioGroupItemBaseProps {}
|
|
20
|
+
|
|
21
|
+
const RadioGroupItem = React.forwardRef<React.ElementRef<typeof RadioGroupPrimitive.Item>, RadioGroupItemProps>(
|
|
22
|
+
({ className, ...props }, ref) => {
|
|
23
|
+
return (
|
|
24
|
+
<RadioGroupPrimitive.Item
|
|
25
|
+
ref={ref}
|
|
26
|
+
className={cn(
|
|
27
|
+
'aspect-square h-4 w-4 native:h-5 native:w-5 rounded-full 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',
|
|
28
|
+
props.disabled && 'web:cursor-not-allowed opacity-50',
|
|
29
|
+
className,
|
|
30
|
+
)}
|
|
31
|
+
{...props}
|
|
32
|
+
>
|
|
33
|
+
<RadioGroupPrimitive.Indicator className="flex items-center justify-center">
|
|
34
|
+
<Circle className="h-2.5 w-2.5 fill-current text-current" />
|
|
35
|
+
</RadioGroupPrimitive.Indicator>
|
|
36
|
+
</RadioGroupPrimitive.Item>
|
|
37
|
+
);
|
|
38
|
+
},
|
|
39
|
+
);
|
|
40
|
+
RadioGroupItem.displayName = RadioGroupPrimitive.Item?.displayName || 'RadioGroupItem';
|
|
41
|
+
|
|
42
|
+
export { RadioGroup, RadioGroupItem };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Text, View } from 'react-native';
|
|
2
|
+
|
|
3
|
+
export const ResizablePanelGroup = () => {
|
|
4
|
+
return (
|
|
5
|
+
<View>
|
|
6
|
+
<Text>ResizablePanelGroup is not yet implemented for React Native</Text>
|
|
7
|
+
</View>
|
|
8
|
+
);
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const ResizablePanel = () => {
|
|
12
|
+
return (
|
|
13
|
+
<View>
|
|
14
|
+
<Text>ResizablePanel is not yet implemented for React Native</Text>
|
|
15
|
+
</View>
|
|
16
|
+
);
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export const ResizableHandle = () => {
|
|
20
|
+
return (
|
|
21
|
+
<View>
|
|
22
|
+
<Text>ResizableHandle is not yet implemented for React Native</Text>
|
|
23
|
+
</View>
|
|
24
|
+
);
|
|
25
|
+
};
|
package/src/search.tsx
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Text, View } from 'react-native';
|
|
2
|
+
|
|
3
|
+
export const Search = () => {
|
|
4
|
+
return (
|
|
5
|
+
<View>
|
|
6
|
+
<Text>Search is not yet implemented for React Native</Text>
|
|
7
|
+
</View>
|
|
8
|
+
);
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const SearchTrigger = () => {
|
|
12
|
+
return (
|
|
13
|
+
<View>
|
|
14
|
+
<Text>SearchTrigger is not yet implemented for React Native</Text>
|
|
15
|
+
</View>
|
|
16
|
+
);
|
|
17
|
+
};
|