@gv-tech/ui-native 2.6.0 → 2.10.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/README.md +19 -0
- package/package.json +10 -7
- package/src/accordion.tsx +24 -9
- package/src/alert-dialog.tsx +36 -11
- package/src/alert.tsx +2 -2
- package/src/avatar.tsx +14 -4
- package/src/card.tsx +3 -3
- package/src/checkbox.tsx +2 -2
- package/src/collapsible.tsx +3 -3
- package/src/dialog.tsx +64 -60
- package/src/input.tsx +1 -1
- package/src/label.tsx +1 -1
- package/src/radio-group.tsx +1 -1
- package/src/select.tsx +6 -6
- package/src/separator.tsx +1 -1
- package/src/sheet.tsx +79 -76
- package/src/skeleton.tsx +1 -1
- package/src/switch.tsx +2 -2
- package/src/table.tsx +4 -4
- package/src/tabs.tsx +4 -4
- package/src/textarea.tsx +1 -1
- package/src/toast.tsx +5 -5
- package/src/tooltip.tsx +7 -3
package/README.md
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# @gv-tech/ui-native
|
|
2
|
+
|
|
3
|
+
React Native implementations of the GV Tech design system components, optimized for Expo and mobile platforms. Built with NativeWind and React Native Primitives.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
yarn add @gv-tech/ui-native
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Features
|
|
12
|
+
|
|
13
|
+
- **Mobile First**: Components tailored for touch interactions and native mobile patterns.
|
|
14
|
+
- **NativeWind**: Styled with a powerful Tailwind-like engine for React Native.
|
|
15
|
+
- **Consistent**: Follows the same API contracts as `@gv-tech/ui-web`.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
This is a sub-package of the [GV Tech Design System](https://github.com/Garcia-Ventures/gvtech-design).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gv-tech/ui-native",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.10.0",
|
|
4
4
|
"description": "React Native implementations of the GV Tech design system components",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -19,22 +19,24 @@
|
|
|
19
19
|
"default": "./src/*/index.ts"
|
|
20
20
|
}
|
|
21
21
|
},
|
|
22
|
-
"main": "
|
|
23
|
-
"
|
|
22
|
+
"main": "./dist/index.cjs.js",
|
|
23
|
+
"module": "./dist/index.es.js",
|
|
24
|
+
"types": "./dist/index.d.ts",
|
|
24
25
|
"files": [
|
|
26
|
+
"dist",
|
|
25
27
|
"src",
|
|
26
28
|
"!src/**/*.test.*",
|
|
27
29
|
"!src/**/*.spec.*"
|
|
28
30
|
],
|
|
29
31
|
"scripts": {
|
|
30
|
-
"build": "
|
|
32
|
+
"build": "vite build",
|
|
31
33
|
"lint": "echo 'Linted from workspace root'",
|
|
32
34
|
"test": "vitest run",
|
|
33
35
|
"typecheck": "npx tsc --noEmit"
|
|
34
36
|
},
|
|
35
37
|
"dependencies": {
|
|
36
|
-
"@gv-tech/design-tokens": "
|
|
37
|
-
"@gv-tech/ui-core": "
|
|
38
|
+
"@gv-tech/design-tokens": "workspace:*",
|
|
39
|
+
"@gv-tech/ui-core": "workspace:*",
|
|
38
40
|
"@rn-primitives/accordion": "^1.2.0",
|
|
39
41
|
"@rn-primitives/alert-dialog": "^1.2.0",
|
|
40
42
|
"@rn-primitives/aspect-ratio": "^1.2.0",
|
|
@@ -75,6 +77,7 @@
|
|
|
75
77
|
"react-native": ">=0.72"
|
|
76
78
|
},
|
|
77
79
|
"publishConfig": {
|
|
78
|
-
"access": "public"
|
|
80
|
+
"access": "public",
|
|
81
|
+
"provenance": true
|
|
79
82
|
}
|
|
80
83
|
}
|
package/src/accordion.tsx
CHANGED
|
@@ -12,7 +12,9 @@ import Animated, {
|
|
|
12
12
|
|
|
13
13
|
import { cn } from './lib/utils';
|
|
14
14
|
|
|
15
|
-
const Accordion
|
|
15
|
+
const Accordion: React.ForwardRefExoticComponent<
|
|
16
|
+
AccordionProps & React.RefAttributes<React.ElementRef<typeof AccordionPrimitive.Root>>
|
|
17
|
+
> = React.forwardRef<
|
|
16
18
|
React.ElementRef<typeof AccordionPrimitive.Root>,
|
|
17
19
|
React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Root>
|
|
18
20
|
>(({ className, ...props }, ref) => {
|
|
@@ -20,17 +22,21 @@ const Accordion = React.forwardRef<
|
|
|
20
22
|
});
|
|
21
23
|
Accordion.displayName = AccordionPrimitive.Root?.displayName || 'Accordion';
|
|
22
24
|
|
|
23
|
-
const AccordionItem
|
|
25
|
+
const AccordionItem: React.ForwardRefExoticComponent<
|
|
26
|
+
AccordionItemProps & React.RefAttributes<React.ElementRef<typeof AccordionPrimitive.Item>>
|
|
27
|
+
> = React.forwardRef<
|
|
24
28
|
React.ElementRef<typeof AccordionPrimitive.Item>,
|
|
25
29
|
React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item>
|
|
26
30
|
>(({ className, ...props }, ref) => {
|
|
27
31
|
return (
|
|
28
|
-
<AccordionPrimitive.Item ref={ref} className={cn('border-
|
|
32
|
+
<AccordionPrimitive.Item ref={ref} className={cn('border-border overflow-hidden border-b', className)} {...props} />
|
|
29
33
|
);
|
|
30
34
|
});
|
|
31
35
|
AccordionItem.displayName = AccordionPrimitive.Item?.displayName || 'AccordionItem';
|
|
32
36
|
|
|
33
|
-
const AccordionHeader
|
|
37
|
+
const AccordionHeader: React.ForwardRefExoticComponent<
|
|
38
|
+
AccordionHeaderProps & React.RefAttributes<React.ElementRef<typeof AccordionPrimitive.Header>>
|
|
39
|
+
> = React.forwardRef<
|
|
34
40
|
React.ElementRef<typeof AccordionPrimitive.Header>,
|
|
35
41
|
React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Header>
|
|
36
42
|
>(({ className, ...props }, ref) => {
|
|
@@ -38,7 +44,9 @@ const AccordionHeader = React.forwardRef<
|
|
|
38
44
|
});
|
|
39
45
|
AccordionHeader.displayName = AccordionPrimitive.Header?.displayName || 'AccordionHeader';
|
|
40
46
|
|
|
41
|
-
const AccordionTrigger
|
|
47
|
+
const AccordionTrigger: React.ForwardRefExoticComponent<
|
|
48
|
+
AccordionTriggerProps & React.RefAttributes<React.ElementRef<typeof AccordionPrimitive.Trigger>>
|
|
49
|
+
> = React.forwardRef<
|
|
42
50
|
React.ElementRef<typeof AccordionPrimitive.Trigger>,
|
|
43
51
|
React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger>
|
|
44
52
|
>(({ className, children, ...props }, ref) => {
|
|
@@ -63,7 +71,7 @@ const AccordionTrigger = React.forwardRef<
|
|
|
63
71
|
>
|
|
64
72
|
<>{children}</>
|
|
65
73
|
<Animated.View style={chevronStyle}>
|
|
66
|
-
<ChevronDown className="h-4 w-4 shrink-0
|
|
74
|
+
<ChevronDown className="text-muted-foreground h-4 w-4 shrink-0 transition-transform duration-200" />
|
|
67
75
|
</Animated.View>
|
|
68
76
|
</AccordionPrimitive.Trigger>
|
|
69
77
|
</AccordionPrimitive.Header>
|
|
@@ -71,7 +79,9 @@ const AccordionTrigger = React.forwardRef<
|
|
|
71
79
|
});
|
|
72
80
|
AccordionTrigger.displayName = AccordionPrimitive.Trigger?.displayName || 'AccordionTrigger';
|
|
73
81
|
|
|
74
|
-
const AccordionContent
|
|
82
|
+
const AccordionContent: React.ForwardRefExoticComponent<
|
|
83
|
+
AccordionContentProps & React.RefAttributes<React.ElementRef<typeof AccordionPrimitive.Content>>
|
|
84
|
+
> = React.forwardRef<
|
|
75
85
|
React.ElementRef<typeof AccordionPrimitive.Content>,
|
|
76
86
|
React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Content>
|
|
77
87
|
>(({ className, children, ...props }, ref) => {
|
|
@@ -79,15 +89,20 @@ const AccordionContent = React.forwardRef<
|
|
|
79
89
|
<AccordionPrimitive.Content
|
|
80
90
|
ref={ref}
|
|
81
91
|
className={cn(
|
|
82
|
-
'
|
|
92
|
+
'data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm transition-all',
|
|
83
93
|
className,
|
|
84
94
|
)}
|
|
85
95
|
{...props}
|
|
86
96
|
>
|
|
87
|
-
<View className={cn('pb-4
|
|
97
|
+
<View className={cn('pt-0 pb-4', className)}>{children}</View>
|
|
88
98
|
</AccordionPrimitive.Content>
|
|
89
99
|
);
|
|
90
100
|
});
|
|
91
101
|
AccordionContent.displayName = AccordionPrimitive.Content?.displayName || 'AccordionContent';
|
|
92
102
|
|
|
93
103
|
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger };
|
|
104
|
+
export type AccordionProps = React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Root>;
|
|
105
|
+
export type AccordionItemProps = React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item>;
|
|
106
|
+
export type AccordionHeaderProps = React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Header>;
|
|
107
|
+
export type AccordionTriggerProps = React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger>;
|
|
108
|
+
export type AccordionContentProps = React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Content>;
|
package/src/alert-dialog.tsx
CHANGED
|
@@ -12,7 +12,9 @@ const AlertDialogTrigger = AlertDialogPrimitive.Trigger;
|
|
|
12
12
|
|
|
13
13
|
const AlertDialogPortal = AlertDialogPrimitive.Portal;
|
|
14
14
|
|
|
15
|
-
const AlertDialogOverlay
|
|
15
|
+
const AlertDialogOverlay: React.ForwardRefExoticComponent<
|
|
16
|
+
AlertDialogOverlayProps & React.RefAttributes<React.ElementRef<typeof AlertDialogPrimitive.Overlay>>
|
|
17
|
+
> = React.forwardRef<
|
|
16
18
|
React.ElementRef<typeof AlertDialogPrimitive.Overlay>,
|
|
17
19
|
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Overlay>
|
|
18
20
|
>(({ className, ...props }, ref) => {
|
|
@@ -21,14 +23,16 @@ const AlertDialogOverlay = React.forwardRef<
|
|
|
21
23
|
<Animated.View
|
|
22
24
|
entering={FadeIn.duration(150)}
|
|
23
25
|
exiting={FadeOut.duration(150)}
|
|
24
|
-
className={cn('z-50
|
|
26
|
+
className={cn('z-50 flex items-center justify-center bg-black/80 p-2', className)}
|
|
25
27
|
/>
|
|
26
28
|
</AlertDialogPrimitive.Overlay>
|
|
27
29
|
);
|
|
28
30
|
});
|
|
29
31
|
AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay?.displayName || 'AlertDialogOverlay';
|
|
30
32
|
|
|
31
|
-
const AlertDialogContent
|
|
33
|
+
const AlertDialogContent: React.ForwardRefExoticComponent<
|
|
34
|
+
AlertDialogContentProps & React.RefAttributes<React.ElementRef<typeof AlertDialogPrimitive.Content>>
|
|
35
|
+
> = React.forwardRef<
|
|
32
36
|
React.ElementRef<typeof AlertDialogPrimitive.Content>,
|
|
33
37
|
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content> & {
|
|
34
38
|
portalHost?: string;
|
|
@@ -44,7 +48,7 @@ const AlertDialogContent = React.forwardRef<
|
|
|
44
48
|
entering={FadeIn.duration(150)}
|
|
45
49
|
exiting={FadeOut.duration(150)}
|
|
46
50
|
className={cn(
|
|
47
|
-
'z-50 max-w-lg gap-4
|
|
51
|
+
'border-border bg-background z-50 w-full max-w-lg gap-4 rounded-xl border p-6 shadow-lg sm:rounded-lg',
|
|
48
52
|
className,
|
|
49
53
|
)}
|
|
50
54
|
/>
|
|
@@ -60,35 +64,41 @@ const AlertDialogHeader = ({ className, ...props }: React.ComponentPropsWithoutR
|
|
|
60
64
|
AlertDialogHeader.displayName = 'AlertDialogHeader';
|
|
61
65
|
|
|
62
66
|
const AlertDialogFooter = ({ className, ...props }: React.ComponentPropsWithoutRef<typeof View>) => (
|
|
63
|
-
<View className={cn('flex flex-col-reverse sm:flex-row sm:justify-end
|
|
67
|
+
<View className={cn('flex flex-col-reverse gap-2 sm:flex-row sm:justify-end', className)} {...props} />
|
|
64
68
|
);
|
|
65
69
|
AlertDialogFooter.displayName = 'AlertDialogFooter';
|
|
66
70
|
|
|
67
|
-
const AlertDialogTitle
|
|
71
|
+
const AlertDialogTitle: React.ForwardRefExoticComponent<
|
|
72
|
+
AlertDialogTitleProps & React.RefAttributes<React.ElementRef<typeof AlertDialogPrimitive.Title>>
|
|
73
|
+
> = React.forwardRef<
|
|
68
74
|
React.ElementRef<typeof AlertDialogPrimitive.Title>,
|
|
69
75
|
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Title>
|
|
70
76
|
>(({ className, ...props }, ref) => (
|
|
71
77
|
<AlertDialogPrimitive.Title
|
|
72
78
|
ref={ref}
|
|
73
|
-
className={cn('
|
|
79
|
+
className={cn('native:text-xl text-foreground text-lg font-semibold', className)}
|
|
74
80
|
{...props}
|
|
75
81
|
/>
|
|
76
82
|
));
|
|
77
83
|
AlertDialogTitle.displayName = AlertDialogPrimitive.Title?.displayName || 'AlertDialogTitle';
|
|
78
84
|
|
|
79
|
-
const AlertDialogDescription
|
|
85
|
+
const AlertDialogDescription: React.ForwardRefExoticComponent<
|
|
86
|
+
AlertDialogDescriptionProps & React.RefAttributes<React.ElementRef<typeof AlertDialogPrimitive.Description>>
|
|
87
|
+
> = React.forwardRef<
|
|
80
88
|
React.ElementRef<typeof AlertDialogPrimitive.Description>,
|
|
81
89
|
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Description>
|
|
82
90
|
>(({ className, ...props }, ref) => (
|
|
83
91
|
<AlertDialogPrimitive.Description
|
|
84
92
|
ref={ref}
|
|
85
|
-
className={cn('
|
|
93
|
+
className={cn('native:text-base text-muted-foreground text-sm', className)}
|
|
86
94
|
{...props}
|
|
87
95
|
/>
|
|
88
96
|
));
|
|
89
97
|
AlertDialogDescription.displayName = AlertDialogPrimitive.Description?.displayName || 'AlertDialogDescription';
|
|
90
98
|
|
|
91
|
-
const AlertDialogAction
|
|
99
|
+
const AlertDialogAction: React.ForwardRefExoticComponent<
|
|
100
|
+
AlertDialogActionProps & React.RefAttributes<React.ElementRef<typeof AlertDialogPrimitive.Action>>
|
|
101
|
+
> = React.forwardRef<
|
|
92
102
|
React.ElementRef<typeof AlertDialogPrimitive.Action>,
|
|
93
103
|
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Action>
|
|
94
104
|
>(({ className, ...props }, ref) => (
|
|
@@ -96,7 +106,9 @@ const AlertDialogAction = React.forwardRef<
|
|
|
96
106
|
));
|
|
97
107
|
AlertDialogAction.displayName = AlertDialogPrimitive.Action?.displayName || 'AlertDialogAction';
|
|
98
108
|
|
|
99
|
-
const AlertDialogCancel
|
|
109
|
+
const AlertDialogCancel: React.ForwardRefExoticComponent<
|
|
110
|
+
AlertDialogCancelProps & React.RefAttributes<React.ElementRef<typeof AlertDialogPrimitive.Cancel>>
|
|
111
|
+
> = React.forwardRef<
|
|
100
112
|
React.ElementRef<typeof AlertDialogPrimitive.Cancel>,
|
|
101
113
|
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Cancel>
|
|
102
114
|
>(({ className, ...props }, ref) => (
|
|
@@ -121,3 +133,16 @@ export {
|
|
|
121
133
|
AlertDialogTitle,
|
|
122
134
|
AlertDialogTrigger,
|
|
123
135
|
};
|
|
136
|
+
|
|
137
|
+
export type AlertDialogOverlayProps = React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Overlay>;
|
|
138
|
+
export type AlertDialogContentProps = React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content> & {
|
|
139
|
+
portalHost?: string;
|
|
140
|
+
overlayClassName?: string;
|
|
141
|
+
overlayStyle?: ViewStyle;
|
|
142
|
+
};
|
|
143
|
+
export type AlertDialogHeaderProps = React.ComponentPropsWithoutRef<typeof View>;
|
|
144
|
+
export type AlertDialogFooterProps = React.ComponentPropsWithoutRef<typeof View>;
|
|
145
|
+
export type AlertDialogTitleProps = React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Title>;
|
|
146
|
+
export type AlertDialogDescriptionProps = React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Description>;
|
|
147
|
+
export type AlertDialogActionProps = React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Action>;
|
|
148
|
+
export type AlertDialogCancelProps = React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Cancel>;
|
package/src/alert.tsx
CHANGED
|
@@ -33,7 +33,7 @@ const AlertTitle = React.forwardRef<React.ElementRef<typeof Text>, React.Compone
|
|
|
33
33
|
({ className, ...props }, ref) => (
|
|
34
34
|
<Text
|
|
35
35
|
ref={ref}
|
|
36
|
-
className={cn('mb-1 font-medium
|
|
36
|
+
className={cn('text-foreground mb-1 leading-none font-medium tracking-tight', className)}
|
|
37
37
|
{...props}
|
|
38
38
|
/>
|
|
39
39
|
),
|
|
@@ -42,7 +42,7 @@ AlertTitle.displayName = 'AlertTitle';
|
|
|
42
42
|
|
|
43
43
|
const AlertDescription = React.forwardRef<React.ElementRef<typeof Text>, React.ComponentPropsWithoutRef<typeof Text>>(
|
|
44
44
|
({ className, ...props }, ref) => (
|
|
45
|
-
<Text ref={ref} className={cn('text-
|
|
45
|
+
<Text ref={ref} className={cn('text-muted-foreground text-sm leading-relaxed', className)} {...props} />
|
|
46
46
|
),
|
|
47
47
|
);
|
|
48
48
|
AlertDescription.displayName = 'AlertDescription';
|
package/src/avatar.tsx
CHANGED
|
@@ -3,7 +3,9 @@ import * as React from 'react';
|
|
|
3
3
|
|
|
4
4
|
import { cn } from './lib/utils';
|
|
5
5
|
|
|
6
|
-
const Avatar
|
|
6
|
+
const Avatar: React.ForwardRefExoticComponent<
|
|
7
|
+
AvatarProps & React.RefAttributes<React.ElementRef<typeof AvatarPrimitive.Root>>
|
|
8
|
+
> = React.forwardRef<
|
|
7
9
|
React.ElementRef<typeof AvatarPrimitive.Root>,
|
|
8
10
|
React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>
|
|
9
11
|
>(({ className, ...props }, ref) => (
|
|
@@ -15,7 +17,9 @@ const Avatar = React.forwardRef<
|
|
|
15
17
|
));
|
|
16
18
|
Avatar.displayName = AvatarPrimitive.Root?.displayName || 'Avatar';
|
|
17
19
|
|
|
18
|
-
const AvatarImage
|
|
20
|
+
const AvatarImage: React.ForwardRefExoticComponent<
|
|
21
|
+
AvatarImageProps & React.RefAttributes<React.ElementRef<typeof AvatarPrimitive.Image>>
|
|
22
|
+
> = React.forwardRef<
|
|
19
23
|
React.ElementRef<typeof AvatarPrimitive.Image>,
|
|
20
24
|
React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Image>
|
|
21
25
|
>(({ className, ...props }, ref) => (
|
|
@@ -23,16 +27,22 @@ const AvatarImage = React.forwardRef<
|
|
|
23
27
|
));
|
|
24
28
|
AvatarImage.displayName = AvatarPrimitive.Image?.displayName || 'AvatarImage';
|
|
25
29
|
|
|
26
|
-
const AvatarFallback
|
|
30
|
+
const AvatarFallback: React.ForwardRefExoticComponent<
|
|
31
|
+
AvatarFallbackProps & React.RefAttributes<React.ElementRef<typeof AvatarPrimitive.Fallback>>
|
|
32
|
+
> = React.forwardRef<
|
|
27
33
|
React.ElementRef<typeof AvatarPrimitive.Fallback>,
|
|
28
34
|
React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Fallback>
|
|
29
35
|
>(({ className, ...props }, ref) => (
|
|
30
36
|
<AvatarPrimitive.Fallback
|
|
31
37
|
ref={ref}
|
|
32
|
-
className={cn('flex h-full w-full items-center justify-center rounded-full
|
|
38
|
+
className={cn('bg-muted flex h-full w-full items-center justify-center rounded-full', className)}
|
|
33
39
|
{...props}
|
|
34
40
|
/>
|
|
35
41
|
));
|
|
36
42
|
AvatarFallback.displayName = AvatarPrimitive.Fallback?.displayName || 'AvatarFallback';
|
|
37
43
|
|
|
38
44
|
export { Avatar, AvatarFallback, AvatarImage };
|
|
45
|
+
|
|
46
|
+
export type AvatarProps = React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>;
|
|
47
|
+
export type AvatarImageProps = React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Image>;
|
|
48
|
+
export type AvatarFallbackProps = React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Fallback>;
|
package/src/card.tsx
CHANGED
|
@@ -8,7 +8,7 @@ import { cn } from './lib/utils';
|
|
|
8
8
|
export interface CardProps extends React.ComponentPropsWithoutRef<typeof View>, CardBaseProps {}
|
|
9
9
|
|
|
10
10
|
const Card = React.forwardRef<React.ElementRef<typeof View>, CardProps>(({ className, ...props }, ref) => (
|
|
11
|
-
<View ref={ref} className={cn('
|
|
11
|
+
<View ref={ref} className={cn('border-border bg-card rounded-xl border shadow-sm', className)} {...props} />
|
|
12
12
|
));
|
|
13
13
|
Card.displayName = 'Card';
|
|
14
14
|
|
|
@@ -23,7 +23,7 @@ const CardTitle = React.forwardRef<React.ElementRef<typeof Text>, React.Componen
|
|
|
23
23
|
({ className, ...props }, ref) => (
|
|
24
24
|
<Text
|
|
25
25
|
ref={ref}
|
|
26
|
-
className={cn('
|
|
26
|
+
className={cn('text-card-foreground text-lg leading-none font-semibold tracking-tight', className)}
|
|
27
27
|
{...props}
|
|
28
28
|
/>
|
|
29
29
|
),
|
|
@@ -32,7 +32,7 @@ CardTitle.displayName = 'CardTitle';
|
|
|
32
32
|
|
|
33
33
|
const CardDescription = React.forwardRef<React.ElementRef<typeof Text>, React.ComponentPropsWithoutRef<typeof Text>>(
|
|
34
34
|
({ className, ...props }, ref) => (
|
|
35
|
-
<Text ref={ref} className={cn('text-
|
|
35
|
+
<Text ref={ref} className={cn('text-muted-foreground text-sm', className)} {...props} />
|
|
36
36
|
),
|
|
37
37
|
);
|
|
38
38
|
CardDescription.displayName = 'CardDescription';
|
package/src/checkbox.tsx
CHANGED
|
@@ -13,13 +13,13 @@ const Checkbox = React.forwardRef<
|
|
|
13
13
|
<CheckboxPrimitive.Root
|
|
14
14
|
ref={ref}
|
|
15
15
|
className={cn(
|
|
16
|
-
'web:peer
|
|
16
|
+
'web:peer native:h-[20] native:w-[20] native:rounded border-primary web:ring-offset-background web:focus-visible:outline-none web:focus-visible:ring-2 web:focus-visible:ring-ring web:focus-visible:ring-offset-2 h-4 w-4 shrink-0 rounded-sm border disabled:cursor-not-allowed disabled:opacity-50',
|
|
17
17
|
props.checked && 'bg-primary',
|
|
18
18
|
className,
|
|
19
19
|
)}
|
|
20
20
|
{...props}
|
|
21
21
|
>
|
|
22
|
-
<CheckboxPrimitive.Indicator className={cn('items-center justify-center
|
|
22
|
+
<CheckboxPrimitive.Indicator className={cn('h-full w-full items-center justify-center')}>
|
|
23
23
|
<Check size={12} strokeWidth={Platform.OS === 'web' ? 2.5 : 3.5} className="text-primary-foreground" />
|
|
24
24
|
</CheckboxPrimitive.Indicator>
|
|
25
25
|
</CheckboxPrimitive.Root>
|
package/src/collapsible.tsx
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { CollapsibleBaseProps, CollapsibleContentBaseProps, CollapsibleTriggerBaseProps } from '@gv-tech/ui-core';
|
|
2
2
|
import * as CollapsiblePrimitive from '@rn-primitives/collapsible';
|
|
3
3
|
|
|
4
|
-
const Collapsible = CollapsiblePrimitive.Root;
|
|
4
|
+
const Collapsible: typeof CollapsiblePrimitive.Root = CollapsiblePrimitive.Root;
|
|
5
5
|
|
|
6
|
-
const CollapsibleTrigger = CollapsiblePrimitive.Trigger;
|
|
6
|
+
const CollapsibleTrigger: typeof CollapsiblePrimitive.Trigger = CollapsiblePrimitive.Trigger;
|
|
7
7
|
|
|
8
|
-
const CollapsibleContent = CollapsiblePrimitive.Content;
|
|
8
|
+
const CollapsibleContent: typeof CollapsiblePrimitive.Content = CollapsiblePrimitive.Content;
|
|
9
9
|
|
|
10
10
|
export { Collapsible, CollapsibleContent, CollapsibleTrigger };
|
|
11
11
|
export type {
|
package/src/dialog.tsx
CHANGED
|
@@ -24,53 +24,56 @@ const DialogPortal = DialogPrimitive.Portal;
|
|
|
24
24
|
|
|
25
25
|
const DialogClose = DialogPrimitive.Close;
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
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';
|
|
27
|
+
export type DialogOverlayProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>;
|
|
28
|
+
export type DialogOverlayRef = React.ElementRef<typeof DialogPrimitive.Overlay>;
|
|
42
29
|
|
|
43
|
-
const
|
|
44
|
-
({ className,
|
|
30
|
+
const DialogOverlay: React.ForwardRefExoticComponent<DialogOverlayProps & React.RefAttributes<DialogOverlayRef>> =
|
|
31
|
+
React.forwardRef<DialogOverlayRef, DialogOverlayProps>(({ className, ...props }, ref) => {
|
|
45
32
|
return (
|
|
46
|
-
<
|
|
47
|
-
<
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
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>
|
|
33
|
+
<DialogPrimitive.Overlay style={StyleSheet.absoluteFill} asChild ref={ref} {...props}>
|
|
34
|
+
<Animated.View
|
|
35
|
+
entering={FadeIn.duration(150)}
|
|
36
|
+
exiting={FadeOut.duration(150)}
|
|
37
|
+
className={cn('z-50 flex items-center justify-center bg-black/80 p-2', className)}
|
|
38
|
+
/>
|
|
39
|
+
</DialogPrimitive.Overlay>
|
|
71
40
|
);
|
|
72
|
-
}
|
|
73
|
-
|
|
41
|
+
});
|
|
42
|
+
DialogOverlay.displayName = DialogPrimitive.Overlay?.displayName || 'DialogOverlay';
|
|
43
|
+
|
|
44
|
+
export type DialogContentRef = React.ElementRef<typeof DialogPrimitive.Content>;
|
|
45
|
+
const DialogContent: React.ForwardRefExoticComponent<DialogContentProps & React.RefAttributes<DialogContentRef>> =
|
|
46
|
+
React.forwardRef<DialogContentRef, DialogContentProps>(
|
|
47
|
+
({ className, children, portalHost, overlayClassName, overlayStyle, ...props }, ref) => {
|
|
48
|
+
return (
|
|
49
|
+
<DialogPortal hostName={portalHost}>
|
|
50
|
+
<DialogOverlay className={overlayClassName} style={overlayStyle} />
|
|
51
|
+
<DialogPrimitive.Content ref={ref} asChild {...props}>
|
|
52
|
+
<Animated.View
|
|
53
|
+
entering={FadeIn.duration(150)}
|
|
54
|
+
exiting={FadeOut.duration(150)}
|
|
55
|
+
className={cn(
|
|
56
|
+
'border-border bg-background z-50 w-full max-w-lg gap-4 rounded-xl border p-6 shadow-lg sm:rounded-lg',
|
|
57
|
+
className,
|
|
58
|
+
)}
|
|
59
|
+
>
|
|
60
|
+
{children}
|
|
61
|
+
<DialogPrimitive.Close
|
|
62
|
+
className={
|
|
63
|
+
'ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:pointer-events-none'
|
|
64
|
+
}
|
|
65
|
+
>
|
|
66
|
+
<X size={18} className="text-muted-foreground" />
|
|
67
|
+
<View className="sr-only">
|
|
68
|
+
<DialogPrimitive.Title>Close</DialogPrimitive.Title>
|
|
69
|
+
</View>
|
|
70
|
+
</DialogPrimitive.Close>
|
|
71
|
+
</Animated.View>
|
|
72
|
+
</DialogPrimitive.Content>
|
|
73
|
+
</DialogPortal>
|
|
74
|
+
);
|
|
75
|
+
},
|
|
76
|
+
);
|
|
74
77
|
DialogContent.displayName = DialogPrimitive.Content?.displayName || 'DialogContent';
|
|
75
78
|
|
|
76
79
|
const DialogHeader = ({ className, ...props }: React.ComponentPropsWithoutRef<typeof View>) => (
|
|
@@ -79,29 +82,30 @@ const DialogHeader = ({ className, ...props }: React.ComponentPropsWithoutRef<ty
|
|
|
79
82
|
DialogHeader.displayName = 'DialogHeader';
|
|
80
83
|
|
|
81
84
|
const DialogFooter = ({ className, ...props }: React.ComponentPropsWithoutRef<typeof View>) => (
|
|
82
|
-
<View className={cn('flex flex-col-reverse sm:flex-row sm:justify-end
|
|
85
|
+
<View className={cn('flex flex-col-reverse gap-2 sm:flex-row sm:justify-end', className)} {...props} />
|
|
83
86
|
);
|
|
84
87
|
DialogFooter.displayName = 'DialogFooter';
|
|
85
88
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
>(({ className, ...props }, ref) => (
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
));
|
|
89
|
+
export type DialogTitleRef = React.ElementRef<typeof DialogPrimitive.Title>;
|
|
90
|
+
export type DialogTitleProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>;
|
|
91
|
+
const DialogTitle: React.ForwardRefExoticComponent<DialogTitleProps & React.RefAttributes<DialogTitleRef>> =
|
|
92
|
+
React.forwardRef<DialogTitleRef, DialogTitleProps>(({ className, ...props }, ref) => (
|
|
93
|
+
<DialogPrimitive.Title
|
|
94
|
+
ref={ref}
|
|
95
|
+
className={cn('native:text-xl text-foreground text-lg leading-none font-semibold tracking-tight', className)}
|
|
96
|
+
{...props}
|
|
97
|
+
/>
|
|
98
|
+
));
|
|
96
99
|
DialogTitle.displayName = DialogPrimitive.Title?.displayName || 'DialogTitle';
|
|
97
100
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
101
|
+
export type DialogDescriptionRef = React.ElementRef<typeof DialogPrimitive.Description>;
|
|
102
|
+
export type DialogDescriptionProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>;
|
|
103
|
+
const DialogDescription: React.ForwardRefExoticComponent<
|
|
104
|
+
DialogDescriptionProps & React.RefAttributes<DialogDescriptionRef>
|
|
105
|
+
> = React.forwardRef<DialogDescriptionRef, DialogDescriptionProps>(({ className, ...props }, ref) => (
|
|
102
106
|
<DialogPrimitive.Description
|
|
103
107
|
ref={ref}
|
|
104
|
-
className={cn('
|
|
108
|
+
className={cn('native:text-base text-muted-foreground text-sm', className)}
|
|
105
109
|
{...props}
|
|
106
110
|
/>
|
|
107
111
|
));
|
package/src/input.tsx
CHANGED
|
@@ -12,7 +12,7 @@ const Input = React.forwardRef<React.ElementRef<typeof TextInput>, InputProps>(
|
|
|
12
12
|
<TextInput
|
|
13
13
|
ref={ref}
|
|
14
14
|
className={cn(
|
|
15
|
-
'flex h-10 w-full rounded-md border
|
|
15
|
+
'border-input text-foreground placeholder:text-muted-foreground focus:border-ring flex h-10 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-sm transition-colors disabled:opacity-50',
|
|
16
16
|
className,
|
|
17
17
|
)}
|
|
18
18
|
placeholderClassName={cn('text-muted-foreground', placeholderClassName)}
|
package/src/label.tsx
CHANGED
|
@@ -17,7 +17,7 @@ const Label = React.forwardRef<
|
|
|
17
17
|
<LabelPrimitive.Text
|
|
18
18
|
ref={ref}
|
|
19
19
|
className={cn(
|
|
20
|
-
'text-
|
|
20
|
+
'text-foreground native:text-base web:peer-disabled:cursor-not-allowed web:peer-disabled:opacity-70 text-sm leading-none font-medium',
|
|
21
21
|
className,
|
|
22
22
|
)}
|
|
23
23
|
{...props}
|
package/src/radio-group.tsx
CHANGED
|
@@ -24,7 +24,7 @@ const RadioGroupItem = React.forwardRef<React.ElementRef<typeof RadioGroupPrimit
|
|
|
24
24
|
<RadioGroupPrimitive.Item
|
|
25
25
|
ref={ref}
|
|
26
26
|
className={cn(
|
|
27
|
-
'
|
|
27
|
+
'native:h-5 native:w-5 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 aspect-square h-4 w-4 rounded-full border',
|
|
28
28
|
props.disabled && 'web:cursor-not-allowed opacity-50',
|
|
29
29
|
className,
|
|
30
30
|
)}
|
package/src/select.tsx
CHANGED
|
@@ -48,7 +48,7 @@ const SelectTrigger = React.forwardRef<React.ElementRef<typeof SelectPrimitive.T
|
|
|
48
48
|
<SelectPrimitive.Trigger
|
|
49
49
|
ref={ref}
|
|
50
50
|
className={cn(
|
|
51
|
-
'
|
|
51
|
+
'native:h-12 border-input bg-background text-muted-foreground web:ring-offset-background web:focus:outline-none web:focus:ring-2 web:focus:ring-ring web:focus:ring-offset-2 flex h-10 flex-row items-center justify-between rounded-md border px-3 py-2 text-sm [&>span]:line-clamp-1',
|
|
52
52
|
props.disabled && 'web:cursor-not-allowed opacity-50',
|
|
53
53
|
className,
|
|
54
54
|
)}
|
|
@@ -121,7 +121,7 @@ const SelectContent = React.forwardRef<React.ElementRef<typeof SelectPrimitive.C
|
|
|
121
121
|
<SelectPrimitive.Content
|
|
122
122
|
ref={ref}
|
|
123
123
|
className={cn(
|
|
124
|
-
'
|
|
124
|
+
'border-border bg-popover 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 relative z-50 max-h-96 min-w-[8rem] rounded-md border shadow-md',
|
|
125
125
|
position === 'popper' &&
|
|
126
126
|
'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1',
|
|
127
127
|
open ? 'web:zoom-in-95 web:animate-in web:fade-in-0' : 'web:zoom-out-95 web:animate-out web:fade-out-0',
|
|
@@ -155,7 +155,7 @@ const SelectLabel = React.forwardRef<React.ElementRef<typeof SelectPrimitive.Lab
|
|
|
155
155
|
({ className, ...props }, ref) => (
|
|
156
156
|
<SelectPrimitive.Label
|
|
157
157
|
ref={ref}
|
|
158
|
-
className={cn('py-1.5 pl-8
|
|
158
|
+
className={cn('text-popover-foreground py-1.5 pr-2 pl-8 text-sm font-semibold', className)}
|
|
159
159
|
{...props}
|
|
160
160
|
/>
|
|
161
161
|
),
|
|
@@ -177,7 +177,7 @@ const SelectItem = React.forwardRef<React.ElementRef<typeof SelectPrimitive.Item
|
|
|
177
177
|
ref={ref}
|
|
178
178
|
label={itemLabel}
|
|
179
179
|
className={cn(
|
|
180
|
-
'relative flex w-full cursor-default
|
|
180
|
+
'web:hover:bg-accent/50 web:focus:bg-accent web:focus:text-accent-foreground web:hover:text-accent-foreground relative flex w-full cursor-default flex-row items-center rounded-sm py-1.5 pr-2 pl-8 text-sm outline-none select-none data-[disabled]:opacity-50',
|
|
181
181
|
props.disabled && 'web:pointer-events-none',
|
|
182
182
|
className,
|
|
183
183
|
)}
|
|
@@ -192,7 +192,7 @@ const SelectItem = React.forwardRef<React.ElementRef<typeof SelectPrimitive.Item
|
|
|
192
192
|
</SelectPrimitive.ItemIndicator>
|
|
193
193
|
</View>
|
|
194
194
|
{/* @ts-expect-error TODO: fix type */}
|
|
195
|
-
<SelectPrimitive.ItemText className="text-
|
|
195
|
+
<SelectPrimitive.ItemText className="text-popover-foreground native:text-base text-sm">
|
|
196
196
|
{children}
|
|
197
197
|
</SelectPrimitive.ItemText>
|
|
198
198
|
</SelectPrimitive.Item>
|
|
@@ -208,7 +208,7 @@ const SelectSeparator = React.forwardRef<React.ElementRef<typeof SelectPrimitive
|
|
|
208
208
|
({ className, ...props }, ref) => (
|
|
209
209
|
<SelectPrimitive.Separator
|
|
210
210
|
ref={ref}
|
|
211
|
-
className={cn('-mx-1 my-1 h-px
|
|
211
|
+
className={cn('bg-muted -mx-1 my-1 h-px', className)}
|
|
212
212
|
{...(props as Record<string, unknown>)}
|
|
213
213
|
/>
|
|
214
214
|
),
|
package/src/separator.tsx
CHANGED
|
@@ -11,7 +11,7 @@ const Separator = React.forwardRef<
|
|
|
11
11
|
ref={ref}
|
|
12
12
|
decorative={decorative}
|
|
13
13
|
orientation={orientation}
|
|
14
|
-
className={cn('shrink-0
|
|
14
|
+
className={cn('bg-border shrink-0', orientation === 'horizontal' ? 'h-[1px] w-full' : 'h-full w-[1px]', className)}
|
|
15
15
|
{...props}
|
|
16
16
|
/>
|
|
17
17
|
));
|
package/src/sheet.tsx
CHANGED
|
@@ -16,75 +16,77 @@ const SheetClose = DialogPrimitive.Close;
|
|
|
16
16
|
|
|
17
17
|
const SheetPortal = DialogPrimitive.Portal;
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
>(({ className, ...props }, ref) => {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
});
|
|
19
|
+
export type SheetOverlayRef = React.ElementRef<typeof DialogPrimitive.Overlay>;
|
|
20
|
+
export type SheetOverlayProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>;
|
|
21
|
+
const SheetOverlay: React.ForwardRefExoticComponent<SheetOverlayProps & React.RefAttributes<SheetOverlayRef>> =
|
|
22
|
+
React.forwardRef<SheetOverlayRef, SheetOverlayProps>(({ className, ...props }, ref) => {
|
|
23
|
+
return (
|
|
24
|
+
<DialogPrimitive.Overlay
|
|
25
|
+
style={Platform.OS !== 'web' ? StyleSheet.absoluteFill : undefined}
|
|
26
|
+
asChild
|
|
27
|
+
ref={ref}
|
|
28
|
+
{...props}
|
|
29
|
+
>
|
|
30
|
+
<Animated.View
|
|
31
|
+
entering={FadeIn.duration(150)}
|
|
32
|
+
exiting={FadeOut.duration(150)}
|
|
33
|
+
className={cn('web:cursor-default absolute inset-0 z-50 bg-black/80', className)}
|
|
34
|
+
/>
|
|
35
|
+
</DialogPrimitive.Overlay>
|
|
36
|
+
);
|
|
37
|
+
});
|
|
38
38
|
SheetOverlay.displayName = DialogPrimitive.Overlay?.displayName || 'SheetOverlay';
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
>(
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
40
|
+
export type SheetContentRef = React.ElementRef<typeof DialogPrimitive.Content>;
|
|
41
|
+
export type SheetContentProps = DialogContentProps & {
|
|
42
|
+
side?: 'top' | 'right' | 'bottom' | 'left';
|
|
43
|
+
overlayClassName?: string;
|
|
44
|
+
overlayStyle?: ViewStyle;
|
|
45
|
+
};
|
|
46
|
+
const SheetContent: React.ForwardRefExoticComponent<SheetContentProps & React.RefAttributes<SheetContentRef>> =
|
|
47
|
+
React.forwardRef<SheetContentRef, SheetContentProps>(
|
|
48
|
+
({ className, children, side = 'right', overlayClassName, overlayStyle, ...props }, ref) => {
|
|
49
|
+
const isWeb = Platform.OS === 'web';
|
|
50
|
+
// TODO: Add support for other sides
|
|
51
|
+
const entering = isWeb ? undefined : SlideInRight;
|
|
52
|
+
const exiting = isWeb ? undefined : SlideOutRight;
|
|
52
53
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
54
|
+
return (
|
|
55
|
+
<SheetPortal>
|
|
56
|
+
<SheetOverlay className={overlayClassName} style={overlayStyle} />
|
|
57
|
+
<DialogPrimitive.Content ref={ref} asChild {...props}>
|
|
58
|
+
<Animated.View
|
|
59
|
+
entering={entering}
|
|
60
|
+
exiting={exiting}
|
|
61
|
+
className={cn(
|
|
62
|
+
'bg-background web:cursor-default web:duration-200 web:ease-in-out absolute z-50 h-full w-3/4 gap-4 p-6 shadow-lg',
|
|
63
|
+
side === 'right' &&
|
|
64
|
+
'border-border data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right top-0 right-0 border-l',
|
|
65
|
+
side === 'left' &&
|
|
66
|
+
'border-border data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left top-0 left-0 border-r',
|
|
67
|
+
side === 'top' &&
|
|
68
|
+
'border-border data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top top-0 w-full border-b',
|
|
69
|
+
side === 'bottom' &&
|
|
70
|
+
'border-border data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom bottom-0 w-full border-t',
|
|
71
|
+
className,
|
|
72
|
+
)}
|
|
73
|
+
>
|
|
74
|
+
{children}
|
|
75
|
+
<DialogPrimitive.Close
|
|
76
|
+
className={cn(
|
|
77
|
+
'ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:pointer-events-none',
|
|
78
|
+
'web:absolute web:right-4 web:top-4',
|
|
79
|
+
)}
|
|
80
|
+
>
|
|
81
|
+
<X size={24} className="text-muted-foreground" />
|
|
82
|
+
<Text className="sr-only">Close</Text>
|
|
83
|
+
</DialogPrimitive.Close>
|
|
84
|
+
</Animated.View>
|
|
85
|
+
</DialogPrimitive.Content>
|
|
86
|
+
</SheetPortal>
|
|
87
|
+
);
|
|
88
|
+
},
|
|
86
89
|
);
|
|
87
|
-
});
|
|
88
90
|
SheetContent.displayName = DialogPrimitive.Content?.displayName || 'SheetContent';
|
|
89
91
|
|
|
90
92
|
const SheetHeader = ({ className, ...props }: React.ComponentPropsWithoutRef<typeof View>) => (
|
|
@@ -97,19 +99,20 @@ const SheetFooter = ({ className, ...props }: React.ComponentPropsWithoutRef<typ
|
|
|
97
99
|
);
|
|
98
100
|
SheetFooter.displayName = 'SheetFooter';
|
|
99
101
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
>(({ className, ...props }, ref) => (
|
|
104
|
-
|
|
105
|
-
));
|
|
102
|
+
export type SheetTitleRef = React.ElementRef<typeof DialogPrimitive.Title>;
|
|
103
|
+
export type SheetTitleProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>;
|
|
104
|
+
const SheetTitle: React.ForwardRefExoticComponent<SheetTitleProps & React.RefAttributes<SheetTitleRef>> =
|
|
105
|
+
React.forwardRef<SheetTitleRef, SheetTitleProps>(({ className, ...props }, ref) => (
|
|
106
|
+
<DialogPrimitive.Title ref={ref} className={cn('text-foreground text-lg font-semibold', className)} {...props} />
|
|
107
|
+
));
|
|
106
108
|
SheetTitle.displayName = DialogPrimitive.Title?.displayName || 'SheetTitle';
|
|
107
109
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
110
|
+
export type SheetDescriptionRef = React.ElementRef<typeof DialogPrimitive.Description>;
|
|
111
|
+
export type SheetDescriptionProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>;
|
|
112
|
+
const SheetDescription: React.ForwardRefExoticComponent<
|
|
113
|
+
SheetDescriptionProps & React.RefAttributes<SheetDescriptionRef>
|
|
114
|
+
> = React.forwardRef<SheetDescriptionRef, SheetDescriptionProps>(({ className, ...props }, ref) => (
|
|
115
|
+
<DialogPrimitive.Description ref={ref} className={cn('text-muted-foreground text-sm', className)} {...props} />
|
|
113
116
|
));
|
|
114
117
|
SheetDescription.displayName = DialogPrimitive.Description?.displayName || 'SheetDescription';
|
|
115
118
|
|
package/src/skeleton.tsx
CHANGED
|
@@ -25,7 +25,7 @@ function Skeleton({ className, ...props }: React.ComponentPropsWithoutRef<typeof
|
|
|
25
25
|
opacity: opacity.value,
|
|
26
26
|
}));
|
|
27
27
|
|
|
28
|
-
return <Animated.View className={cn('rounded-md
|
|
28
|
+
return <Animated.View className={cn('bg-muted rounded-md', className)} style={animatedStyle} {...props} />;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
export { Skeleton };
|
package/src/switch.tsx
CHANGED
|
@@ -13,7 +13,7 @@ const Switch = React.forwardRef<React.ElementRef<typeof SwitchPrimitive.Root>, S
|
|
|
13
13
|
({ className, checked, onCheckedChange, ...props }, ref) => (
|
|
14
14
|
<SwitchPrimitive.Root
|
|
15
15
|
className={cn(
|
|
16
|
-
'peer inline-flex h-6 w-11 shrink-0 cursor-pointer flex-row items-center rounded-full border-2 border-transparent transition-colors focus-visible:
|
|
16
|
+
'peer focus-visible:ring-ring focus-visible:ring-offset-background data-[state=checked]:bg-primary data-[state=unchecked]:bg-input inline-flex h-6 w-11 shrink-0 cursor-pointer flex-row items-center rounded-full border-2 border-transparent transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50',
|
|
17
17
|
className,
|
|
18
18
|
)}
|
|
19
19
|
{...props}
|
|
@@ -23,7 +23,7 @@ const Switch = React.forwardRef<React.ElementRef<typeof SwitchPrimitive.Root>, S
|
|
|
23
23
|
>
|
|
24
24
|
<SwitchPrimitive.Thumb
|
|
25
25
|
className={cn(
|
|
26
|
-
'pointer-events-none block h-5 w-5 rounded-full
|
|
26
|
+
'bg-background pointer-events-none block h-5 w-5 rounded-full shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0',
|
|
27
27
|
)}
|
|
28
28
|
/>
|
|
29
29
|
</SwitchPrimitive.Root>
|
package/src/table.tsx
CHANGED
|
@@ -12,7 +12,7 @@ const Table = React.forwardRef<React.ElementRef<typeof View>, React.ComponentPro
|
|
|
12
12
|
Table.displayName = 'Table';
|
|
13
13
|
|
|
14
14
|
const TableHeader = React.forwardRef<React.ElementRef<typeof View>, React.ComponentPropsWithoutRef<typeof View>>(
|
|
15
|
-
({ className, ...props }, ref) => <View ref={ref} className={cn('border-
|
|
15
|
+
({ className, ...props }, ref) => <View ref={ref} className={cn('border-border border-b', className)} {...props} />,
|
|
16
16
|
);
|
|
17
17
|
TableHeader.displayName = 'TableHeader';
|
|
18
18
|
|
|
@@ -33,7 +33,7 @@ const TableRow = React.forwardRef<React.ElementRef<typeof View>, React.Component
|
|
|
33
33
|
<View
|
|
34
34
|
ref={ref}
|
|
35
35
|
className={cn(
|
|
36
|
-
'
|
|
36
|
+
'border-border hover:bg-muted/50 data-[state=selected]:bg-muted flex-row border-b transition-colors',
|
|
37
37
|
className,
|
|
38
38
|
)}
|
|
39
39
|
{...props}
|
|
@@ -47,7 +47,7 @@ const TableHead = React.forwardRef<React.ElementRef<typeof Text>, React.Componen
|
|
|
47
47
|
<Text
|
|
48
48
|
ref={ref}
|
|
49
49
|
className={cn(
|
|
50
|
-
'h-12 px-4 text-left align-middle font-medium
|
|
50
|
+
'text-muted-foreground h-12 px-4 text-left align-middle font-medium [&:has([role=checkbox])]:pr-0',
|
|
51
51
|
className,
|
|
52
52
|
)}
|
|
53
53
|
{...props}
|
|
@@ -65,7 +65,7 @@ TableCell.displayName = 'TableCell';
|
|
|
65
65
|
|
|
66
66
|
const TableCaption = React.forwardRef<React.ElementRef<typeof Text>, React.ComponentPropsWithoutRef<typeof Text>>(
|
|
67
67
|
({ className, ...props }, ref) => (
|
|
68
|
-
<Text ref={ref} className={cn('mt-4 text-sm
|
|
68
|
+
<Text ref={ref} className={cn('text-muted-foreground mt-4 text-sm', className)} {...props} />
|
|
69
69
|
),
|
|
70
70
|
);
|
|
71
71
|
TableCaption.displayName = 'TableCaption';
|
package/src/tabs.tsx
CHANGED
|
@@ -22,7 +22,7 @@ const TabsList = React.forwardRef<React.ElementRef<typeof TabsPrimitive.List>, T
|
|
|
22
22
|
<TabsPrimitive.List
|
|
23
23
|
ref={ref}
|
|
24
24
|
className={cn(
|
|
25
|
-
'
|
|
25
|
+
'bg-muted text-muted-foreground inline-flex h-10 flex-row items-center justify-center rounded-md p-1',
|
|
26
26
|
className,
|
|
27
27
|
)}
|
|
28
28
|
{...props}
|
|
@@ -44,9 +44,9 @@ const TabsTrigger = React.forwardRef<React.ElementRef<typeof TabsPrimitive.Trigg
|
|
|
44
44
|
<TabsPrimitive.Trigger
|
|
45
45
|
ref={ref}
|
|
46
46
|
className={cn(
|
|
47
|
-
'inline-flex items-center justify-center
|
|
47
|
+
'ring-offset-background focus-visible:ring-ring inline-flex items-center justify-center rounded-sm px-3 py-1.5 text-sm font-medium whitespace-nowrap transition-all focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50',
|
|
48
48
|
props.disabled && 'opacity-50',
|
|
49
|
-
value === props.value && 'bg-background shadow-
|
|
49
|
+
value === props.value && 'bg-background shadow-foreground/10 shadow-sm',
|
|
50
50
|
className,
|
|
51
51
|
)}
|
|
52
52
|
{...props}
|
|
@@ -62,7 +62,7 @@ const TabsContent = React.forwardRef<React.ElementRef<typeof TabsPrimitive.Conte
|
|
|
62
62
|
<TabsPrimitive.Content
|
|
63
63
|
ref={ref}
|
|
64
64
|
className={cn(
|
|
65
|
-
'
|
|
65
|
+
'ring-offset-background focus-visible:ring-ring mt-2 focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none',
|
|
66
66
|
className,
|
|
67
67
|
)}
|
|
68
68
|
{...props}
|
package/src/textarea.tsx
CHANGED
|
@@ -13,7 +13,7 @@ const Textarea = React.forwardRef<React.ElementRef<typeof TextInput>, TextareaPr
|
|
|
13
13
|
multiline
|
|
14
14
|
numberOfLines={props.numberOfLines || 3}
|
|
15
15
|
className={cn(
|
|
16
|
-
'flex min-h-[80px] w-full rounded-md border
|
|
16
|
+
'border-input bg-background text-foreground placeholder:text-muted-foreground focus:border-ring flex min-h-[80px] w-full rounded-md border px-3 py-2 text-base shadow-sm transition-colors disabled:opacity-50',
|
|
17
17
|
className,
|
|
18
18
|
)}
|
|
19
19
|
placeholderClassName={cn('text-muted-foreground', placeholderClassName)}
|
package/src/toast.tsx
CHANGED
|
@@ -24,7 +24,7 @@ const Toast = React.forwardRef<
|
|
|
24
24
|
)}
|
|
25
25
|
{...props}
|
|
26
26
|
>
|
|
27
|
-
<Animated.View entering={FadeInUp} exiting={FadeOutDown} layout={Layout} className="flex-row items-center
|
|
27
|
+
<Animated.View entering={FadeInUp} exiting={FadeOutDown} layout={Layout} className="w-full flex-row items-center">
|
|
28
28
|
{props.children}
|
|
29
29
|
</Animated.View>
|
|
30
30
|
</ToastPrimitive.Root>
|
|
@@ -36,7 +36,7 @@ const ToastTitle = React.forwardRef<
|
|
|
36
36
|
React.ElementRef<typeof ToastPrimitive.Title>,
|
|
37
37
|
React.ComponentPropsWithoutRef<typeof ToastPrimitive.Title>
|
|
38
38
|
>(({ className, ...props }, ref) => (
|
|
39
|
-
<ToastPrimitive.Title ref={ref} className={cn('text-sm font-semibold
|
|
39
|
+
<ToastPrimitive.Title ref={ref} className={cn('text-foreground text-sm font-semibold', className)} {...props} />
|
|
40
40
|
));
|
|
41
41
|
ToastTitle.displayName = ToastPrimitive.Title.displayName;
|
|
42
42
|
|
|
@@ -46,7 +46,7 @@ const ToastDescription = React.forwardRef<
|
|
|
46
46
|
>(({ className, ...props }, ref) => (
|
|
47
47
|
<ToastPrimitive.Description
|
|
48
48
|
ref={ref}
|
|
49
|
-
className={cn('text-sm opacity-90
|
|
49
|
+
className={cn('text-muted-foreground text-sm opacity-90', className)}
|
|
50
50
|
{...props}
|
|
51
51
|
/>
|
|
52
52
|
));
|
|
@@ -59,7 +59,7 @@ const ToastClose = React.forwardRef<
|
|
|
59
59
|
<ToastPrimitive.Close
|
|
60
60
|
ref={ref}
|
|
61
61
|
className={cn(
|
|
62
|
-
'absolute
|
|
62
|
+
'text-foreground/50 hover:text-foreground absolute top-1 right-1 rounded-md p-1 opacity-0 transition-opacity group-hover:opacity-100 focus:opacity-100 focus:ring-1 focus:outline-none',
|
|
63
63
|
className,
|
|
64
64
|
)}
|
|
65
65
|
{...props}
|
|
@@ -76,7 +76,7 @@ const ToastAction = React.forwardRef<
|
|
|
76
76
|
<ToastPrimitive.Action
|
|
77
77
|
ref={ref}
|
|
78
78
|
className={cn(
|
|
79
|
-
'inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors
|
|
79
|
+
'hover:bg-secondary focus:ring-ring inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors focus:ring-1 focus:outline-none disabled:pointer-events-none disabled:opacity-50',
|
|
80
80
|
className,
|
|
81
81
|
)}
|
|
82
82
|
{...props}
|
package/src/tooltip.tsx
CHANGED
|
@@ -10,7 +10,11 @@ const Tooltip = TooltipPrimitive.Root;
|
|
|
10
10
|
|
|
11
11
|
const TooltipTrigger = TooltipPrimitive.Trigger;
|
|
12
12
|
|
|
13
|
-
const TooltipContent
|
|
13
|
+
const TooltipContent: React.ForwardRefExoticComponent<
|
|
14
|
+
React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content> & { portalHost?: string } & React.RefAttributes<
|
|
15
|
+
React.ElementRef<typeof TooltipPrimitive.Content>
|
|
16
|
+
>
|
|
17
|
+
> = React.forwardRef<
|
|
14
18
|
React.ElementRef<typeof TooltipPrimitive.Content>,
|
|
15
19
|
React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content> & {
|
|
16
20
|
portalHost?: string;
|
|
@@ -27,11 +31,11 @@ const TooltipContent = React.forwardRef<
|
|
|
27
31
|
entering={FadeIn}
|
|
28
32
|
exiting={FadeOut}
|
|
29
33
|
className={cn(
|
|
30
|
-
'
|
|
34
|
+
'border-border bg-popover web:animate-in web:fade-in-0 web:zoom-in-95 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 z-50 overflow-hidden rounded-md border px-3 py-1.5 shadow-md',
|
|
31
35
|
className,
|
|
32
36
|
)}
|
|
33
37
|
>
|
|
34
|
-
<Text className="text-
|
|
38
|
+
<Text className="text-popover-foreground native:text-base text-sm">{props.children}</Text>
|
|
35
39
|
</Animated.View>
|
|
36
40
|
</TooltipPrimitive.Overlay>
|
|
37
41
|
</TooltipPrimitive.Portal>
|