@gv-tech/ui-native 2.20.0 → 2.21.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/dist/index.d.ts +2 -679
- package/dist/packages/ui-native/src/accordion.d.ts +13 -0
- package/dist/packages/ui-native/src/accordion.d.ts.map +1 -0
- package/dist/packages/ui-native/src/accordion.test.d.ts +2 -0
- package/dist/packages/ui-native/src/accordion.test.d.ts.map +1 -0
- package/dist/packages/ui-native/src/alert-dialog.d.ts +51 -0
- package/dist/packages/ui-native/src/alert-dialog.d.ts.map +1 -0
- package/dist/packages/ui-native/src/alert.d.ts +10 -0
- package/dist/packages/ui-native/src/alert.d.ts.map +1 -0
- package/dist/packages/ui-native/src/alert.test.d.ts +2 -0
- package/dist/packages/ui-native/src/alert.test.d.ts.map +1 -0
- package/dist/packages/ui-native/src/aspect-ratio.d.ts +4 -0
- package/dist/packages/ui-native/src/aspect-ratio.d.ts.map +1 -0
- package/dist/packages/ui-native/src/avatar.d.ts +10 -0
- package/dist/packages/ui-native/src/avatar.d.ts.map +1 -0
- package/dist/packages/ui-native/src/avatar.test.d.ts +2 -0
- package/dist/packages/ui-native/src/avatar.test.d.ts.map +1 -0
- package/dist/packages/ui-native/src/badge.d.ts +12 -0
- package/dist/packages/ui-native/src/badge.d.ts.map +1 -0
- package/dist/packages/ui-native/src/badge.test.d.ts +2 -0
- package/dist/packages/ui-native/src/badge.test.d.ts.map +1 -0
- package/dist/packages/ui-native/src/breadcrumb.d.ts +24 -0
- package/dist/packages/ui-native/src/breadcrumb.d.ts.map +1 -0
- package/dist/packages/ui-native/src/button.d.ts +14 -0
- package/dist/packages/ui-native/src/button.d.ts.map +1 -0
- package/dist/packages/ui-native/src/button.test.d.ts +2 -0
- package/dist/packages/ui-native/src/button.test.d.ts.map +1 -0
- package/dist/packages/ui-native/src/calendar.d.ts +4 -0
- package/dist/packages/ui-native/src/calendar.d.ts.map +1 -0
- package/dist/packages/ui-native/src/card.d.ts +13 -0
- package/dist/packages/ui-native/src/card.d.ts.map +1 -0
- package/dist/packages/ui-native/src/card.test.d.ts +2 -0
- package/dist/packages/ui-native/src/card.test.d.ts.map +1 -0
- package/dist/packages/ui-native/src/carousel.d.ts +8 -0
- package/dist/packages/ui-native/src/carousel.d.ts.map +1 -0
- package/dist/packages/ui-native/src/chart.d.ts +13 -0
- package/dist/packages/ui-native/src/chart.d.ts.map +1 -0
- package/dist/packages/ui-native/src/checkbox.d.ts +15 -0
- package/dist/packages/ui-native/src/checkbox.d.ts.map +1 -0
- package/dist/packages/ui-native/src/checkbox.test.d.ts +2 -0
- package/dist/packages/ui-native/src/checkbox.test.d.ts.map +1 -0
- package/dist/packages/ui-native/src/collapsible.d.ts +8 -0
- package/dist/packages/ui-native/src/collapsible.d.ts.map +1 -0
- package/dist/packages/ui-native/src/collapsible.test.d.ts +2 -0
- package/dist/packages/ui-native/src/collapsible.test.d.ts.map +1 -0
- package/dist/packages/ui-native/src/command.d.ts +14 -0
- package/dist/packages/ui-native/src/command.d.ts.map +1 -0
- package/dist/packages/ui-native/src/context-menu.d.ts +61 -0
- package/dist/packages/ui-native/src/context-menu.d.ts.map +1 -0
- package/dist/packages/ui-native/src/dialog.d.ts +61 -0
- package/dist/packages/ui-native/src/dialog.d.ts.map +1 -0
- package/dist/packages/ui-native/src/dialog.test.d.ts +2 -0
- package/dist/packages/ui-native/src/dialog.test.d.ts.map +1 -0
- package/dist/packages/ui-native/src/drawer.d.ts +31 -0
- package/dist/packages/ui-native/src/drawer.d.ts.map +1 -0
- package/dist/packages/ui-native/src/dropdown-menu.d.ts +60 -0
- package/dist/packages/ui-native/src/dropdown-menu.d.ts.map +1 -0
- package/dist/packages/ui-native/src/form.d.ts +2 -0
- package/dist/packages/ui-native/src/form.d.ts.map +1 -0
- package/dist/packages/ui-native/src/hooks/use-toast.d.ts +46 -0
- package/dist/packages/ui-native/src/hooks/use-toast.d.ts.map +1 -0
- package/dist/packages/ui-native/src/hover-card.d.ts +23 -0
- package/dist/packages/ui-native/src/hover-card.d.ts.map +1 -0
- package/dist/packages/ui-native/src/index.d.ts +67 -0
- package/dist/packages/ui-native/src/index.d.ts.map +1 -0
- package/dist/packages/ui-native/src/input.d.ts +8 -0
- package/dist/packages/ui-native/src/input.d.ts.map +1 -0
- package/dist/packages/ui-native/src/input.test.d.ts +2 -0
- package/dist/packages/ui-native/src/input.test.d.ts.map +1 -0
- package/dist/packages/ui-native/src/label.d.ts +9 -0
- package/dist/packages/ui-native/src/label.d.ts.map +1 -0
- package/dist/packages/ui-native/src/label.test.d.ts +2 -0
- package/dist/packages/ui-native/src/label.test.d.ts.map +1 -0
- package/dist/packages/ui-native/src/lib/render-native.d.ts +4 -0
- package/dist/packages/ui-native/src/lib/render-native.d.ts.map +1 -0
- package/dist/packages/ui-native/src/lib/utils.d.ts +4 -0
- package/dist/packages/ui-native/src/lib/utils.d.ts.map +1 -0
- package/dist/packages/ui-native/src/menubar.d.ts +53 -0
- package/dist/packages/ui-native/src/menubar.d.ts.map +1 -0
- package/dist/packages/ui-native/src/navigation-menu.d.ts +14 -0
- package/dist/packages/ui-native/src/navigation-menu.d.ts.map +1 -0
- package/dist/packages/ui-native/src/pagination.d.ts +33 -0
- package/dist/packages/ui-native/src/pagination.d.ts.map +1 -0
- package/dist/packages/ui-native/src/popover.d.ts +9 -0
- package/dist/packages/ui-native/src/popover.d.ts.map +1 -0
- package/dist/packages/ui-native/src/popover.test.d.ts +2 -0
- package/dist/packages/ui-native/src/popover.test.d.ts.map +1 -0
- package/dist/packages/ui-native/src/progress.d.ts +6 -0
- package/dist/packages/ui-native/src/progress.d.ts.map +1 -0
- package/dist/packages/ui-native/src/progress.test.d.ts +2 -0
- package/dist/packages/ui-native/src/progress.test.d.ts.map +1 -0
- package/dist/packages/ui-native/src/radio-group.d.ts +11 -0
- package/dist/packages/ui-native/src/radio-group.d.ts.map +1 -0
- package/dist/packages/ui-native/src/radio-group.test.d.ts +2 -0
- package/dist/packages/ui-native/src/radio-group.test.d.ts.map +1 -0
- package/dist/packages/ui-native/src/resizable.d.ts +6 -0
- package/dist/packages/ui-native/src/resizable.d.ts.map +1 -0
- package/dist/packages/ui-native/src/scroll-area.d.ts +6 -0
- package/dist/packages/ui-native/src/scroll-area.d.ts.map +1 -0
- package/dist/packages/ui-native/src/scroll-to-top.d.ts +29 -0
- package/dist/packages/ui-native/src/scroll-to-top.d.ts.map +1 -0
- package/dist/packages/ui-native/src/search.d.ts +3 -0
- package/dist/packages/ui-native/src/search.d.ts.map +1 -0
- package/dist/packages/ui-native/src/search.test.d.ts +2 -0
- package/dist/packages/ui-native/src/search.test.d.ts.map +1 -0
- package/dist/packages/ui-native/src/select.d.ts +66 -0
- package/dist/packages/ui-native/src/select.d.ts.map +1 -0
- package/dist/packages/ui-native/src/select.test.d.ts +2 -0
- package/dist/packages/ui-native/src/select.test.d.ts.map +1 -0
- package/dist/packages/ui-native/src/separator.d.ts +9 -0
- package/dist/packages/ui-native/src/separator.d.ts.map +1 -0
- package/dist/packages/ui-native/src/separator.test.d.ts +2 -0
- package/dist/packages/ui-native/src/separator.test.d.ts.map +1 -0
- package/dist/packages/ui-native/src/sheet.d.ts +59 -0
- package/dist/packages/ui-native/src/sheet.d.ts.map +1 -0
- package/dist/packages/ui-native/src/sheet.test.d.ts +2 -0
- package/dist/packages/ui-native/src/sheet.test.d.ts.map +1 -0
- package/dist/packages/ui-native/src/skeleton.d.ts +5 -0
- package/dist/packages/ui-native/src/skeleton.d.ts.map +1 -0
- package/dist/packages/ui-native/src/skeleton.test.d.ts +2 -0
- package/dist/packages/ui-native/src/skeleton.test.d.ts.map +1 -0
- package/dist/packages/ui-native/src/slider.d.ts +4 -0
- package/dist/packages/ui-native/src/slider.d.ts.map +1 -0
- package/dist/packages/ui-native/src/sonner.d.ts +4 -0
- package/dist/packages/ui-native/src/sonner.d.ts.map +1 -0
- package/dist/packages/ui-native/src/support-fab.d.ts +18 -0
- package/dist/packages/ui-native/src/support-fab.d.ts.map +1 -0
- package/dist/packages/ui-native/src/switch.d.ts +8 -0
- package/dist/packages/ui-native/src/switch.d.ts.map +1 -0
- package/dist/packages/ui-native/src/switch.test.d.ts +2 -0
- package/dist/packages/ui-native/src/switch.test.d.ts.map +1 -0
- package/dist/packages/ui-native/src/table-of-contents.d.ts +47 -0
- package/dist/packages/ui-native/src/table-of-contents.d.ts.map +1 -0
- package/dist/packages/ui-native/src/table-of-contents.test.d.ts +2 -0
- package/dist/packages/ui-native/src/table-of-contents.test.d.ts.map +1 -0
- package/dist/packages/ui-native/src/table.d.ts +12 -0
- package/dist/packages/ui-native/src/table.d.ts.map +1 -0
- package/dist/packages/ui-native/src/table.test.d.ts +2 -0
- package/dist/packages/ui-native/src/table.test.d.ts.map +1 -0
- package/dist/packages/ui-native/src/tabs.d.ts +30 -0
- package/dist/packages/ui-native/src/tabs.d.ts.map +1 -0
- package/dist/packages/ui-native/src/tabs.test.d.ts +2 -0
- package/dist/packages/ui-native/src/tabs.test.d.ts.map +1 -0
- package/dist/packages/ui-native/src/text.d.ts +13 -0
- package/dist/packages/ui-native/src/text.d.ts.map +1 -0
- package/dist/packages/ui-native/src/text.test.d.ts +2 -0
- package/dist/packages/ui-native/src/text.test.d.ts.map +1 -0
- package/dist/packages/ui-native/src/textarea.d.ts +6 -0
- package/dist/packages/ui-native/src/textarea.d.ts.map +1 -0
- package/dist/packages/ui-native/src/textarea.test.d.ts +2 -0
- package/dist/packages/ui-native/src/textarea.test.d.ts.map +1 -0
- package/dist/packages/ui-native/src/theme-provider.d.ts +5 -0
- package/dist/packages/ui-native/src/theme-provider.d.ts.map +1 -0
- package/dist/packages/ui-native/src/theme-toggle.d.ts +2 -0
- package/dist/packages/ui-native/src/theme-toggle.d.ts.map +1 -0
- package/dist/packages/ui-native/src/theme-toggle.test.d.ts +2 -0
- package/dist/packages/ui-native/src/theme-toggle.test.d.ts.map +1 -0
- package/dist/packages/ui-native/src/toast.d.ts +35 -0
- package/dist/packages/ui-native/src/toast.d.ts.map +1 -0
- package/dist/packages/ui-native/src/toast.test.d.ts +2 -0
- package/dist/packages/ui-native/src/toast.test.d.ts.map +1 -0
- package/dist/packages/ui-native/src/toaster.d.ts +5 -0
- package/dist/packages/ui-native/src/toaster.d.ts.map +1 -0
- package/dist/packages/ui-native/src/toggle-group.d.ts +11 -0
- package/dist/packages/ui-native/src/toggle-group.d.ts.map +1 -0
- package/dist/packages/ui-native/src/toggle-group.test.d.ts +2 -0
- package/dist/packages/ui-native/src/toggle-group.test.d.ts.map +1 -0
- package/dist/packages/ui-native/src/toggle.d.ts +8 -0
- package/dist/packages/ui-native/src/toggle.d.ts.map +1 -0
- package/dist/packages/ui-native/src/toggle.test.d.ts +2 -0
- package/dist/packages/ui-native/src/toggle.test.d.ts.map +1 -0
- package/dist/packages/ui-native/src/tooltip.d.ts +30 -0
- package/dist/packages/ui-native/src/tooltip.d.ts.map +1 -0
- package/dist/packages/ui-native/src/tooltip.test.d.ts +2 -0
- package/dist/packages/ui-native/src/tooltip.test.d.ts.map +1 -0
- package/dist/ui-native.cjs +2 -0
- package/dist/ui-native.mjs +2036 -1428
- package/package.json +10 -12
- package/src/aspect-ratio.tsx +9 -5
- package/src/breadcrumb.tsx +126 -4
- package/src/calendar.tsx +5 -7
- package/src/carousel.tsx +28 -8
- package/src/chart.tsx +30 -8
- package/src/command.tsx +48 -8
- package/src/context-menu.tsx +213 -5
- package/src/drawer.tsx +132 -6
- package/src/dropdown-menu.tsx +217 -5
- package/src/hooks/use-toast.ts +186 -0
- package/src/hover-card.tsx +26 -6
- package/src/index.ts +114 -11
- package/src/menubar.tsx +253 -5
- package/src/navigation-menu.tsx +175 -5
- package/src/pagination.tsx +107 -4
- package/src/resizable.tsx +9 -19
- package/src/scroll-area.tsx +24 -7
- package/src/slider.tsx +38 -5
- package/src/sonner.tsx +5 -7
- package/src/toaster.tsx +25 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gv-tech/ui-native",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.21.1",
|
|
4
4
|
"description": "React Native implementations of the GV Tech design system components",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -11,15 +11,13 @@
|
|
|
11
11
|
"author": "Eric N. Garcia <eng618@garciaericn.com>",
|
|
12
12
|
"exports": {
|
|
13
13
|
".": {
|
|
14
|
-
"types": "./
|
|
15
|
-
"
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
"types": "./src/*/index.ts",
|
|
19
|
-
"default": "./src/*/index.ts"
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"import": "./dist/ui-native.mjs",
|
|
16
|
+
"require": "./dist/ui-native.cjs",
|
|
17
|
+
"default": "./dist/ui-native.mjs"
|
|
20
18
|
}
|
|
21
19
|
},
|
|
22
|
-
"main": "./dist/ui-native.
|
|
20
|
+
"main": "./dist/ui-native.cjs",
|
|
23
21
|
"module": "./dist/ui-native.mjs",
|
|
24
22
|
"types": "./dist/index.d.ts",
|
|
25
23
|
"files": [
|
|
@@ -37,8 +35,8 @@
|
|
|
37
35
|
"dependencies": {
|
|
38
36
|
"@gv-tech/design-tokens": "^2.12.0",
|
|
39
37
|
"@gv-tech/ui-core": "^2.12.0",
|
|
40
|
-
"react-native-reanimated": "4.
|
|
41
|
-
"react-native-worklets": "0.
|
|
38
|
+
"react-native-reanimated": "4.3.0",
|
|
39
|
+
"react-native-worklets": "0.8.1",
|
|
42
40
|
"@rn-primitives/accordion": "^1.2.0",
|
|
43
41
|
"@rn-primitives/alert-dialog": "^1.2.0",
|
|
44
42
|
"@rn-primitives/aspect-ratio": "^1.2.0",
|
|
@@ -67,7 +65,7 @@
|
|
|
67
65
|
"@rn-primitives/toggle-group": "^1.2.0",
|
|
68
66
|
"@rn-primitives/tooltip": "^1.2.0",
|
|
69
67
|
"clsx": "^2.1.1",
|
|
70
|
-
"lucide-react-native": "^
|
|
68
|
+
"lucide-react-native": "^1.8.0",
|
|
71
69
|
"nativewind": "^4.2.1",
|
|
72
70
|
"react-native-svg": "^15.15.3",
|
|
73
71
|
"tailwind-merge": "^3.4.1",
|
|
@@ -76,7 +74,7 @@
|
|
|
76
74
|
"peerDependencies": {
|
|
77
75
|
"react": ">=18",
|
|
78
76
|
"react-native": ">=0.72",
|
|
79
|
-
"react-native-reanimated": "^4.
|
|
77
|
+
"react-native-reanimated": "^4.2.3",
|
|
80
78
|
"react-native-worklets": "^0.7.2"
|
|
81
79
|
},
|
|
82
80
|
"peerDependenciesMeta": {
|
package/src/aspect-ratio.tsx
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { AspectRatioBaseProps } from '@gv-tech/ui-core';
|
|
2
|
+
import * as AspectRatioPrimitive from '@rn-primitives/aspect-ratio';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { cn } from './lib/utils';
|
|
2
5
|
|
|
3
|
-
export const AspectRatio = () => {
|
|
6
|
+
export const AspectRatio: React.FC<AspectRatioBaseProps> = ({ children, className, ratio = 1 }) => {
|
|
4
7
|
return (
|
|
5
|
-
<
|
|
6
|
-
|
|
7
|
-
</
|
|
8
|
+
<AspectRatioPrimitive.Root ratio={ratio} className={cn('w-full', className)}>
|
|
9
|
+
{children}
|
|
10
|
+
</AspectRatioPrimitive.Root>
|
|
8
11
|
);
|
|
9
12
|
};
|
|
13
|
+
AspectRatio.displayName = 'AspectRatio';
|
package/src/breadcrumb.tsx
CHANGED
|
@@ -1,9 +1,131 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type {
|
|
2
|
+
BreadcrumbBaseProps,
|
|
3
|
+
BreadcrumbEllipsisBaseProps,
|
|
4
|
+
BreadcrumbItemBaseProps,
|
|
5
|
+
BreadcrumbLinkBaseProps,
|
|
6
|
+
BreadcrumbListBaseProps,
|
|
7
|
+
BreadcrumbPageBaseProps,
|
|
8
|
+
BreadcrumbSeparatorBaseProps,
|
|
9
|
+
} from '@gv-tech/ui-core';
|
|
10
|
+
import { Slot } from '@rn-primitives/slot';
|
|
11
|
+
import { ChevronRight, MoreHorizontal } from 'lucide-react-native';
|
|
12
|
+
import * as React from 'react';
|
|
13
|
+
import { Pressable, View } from 'react-native';
|
|
14
|
+
import { wrapTextChildren } from './lib/render-native';
|
|
15
|
+
import { cn } from './lib/utils';
|
|
16
|
+
import { Text } from './text';
|
|
2
17
|
|
|
3
|
-
export const Breadcrumb =
|
|
18
|
+
export const Breadcrumb = React.forwardRef<View, BreadcrumbBaseProps & { separator?: React.ReactNode }>(
|
|
19
|
+
({ className, children, ...props }, ref) => {
|
|
20
|
+
return (
|
|
21
|
+
<View ref={ref} aria-label="breadcrumb" className={cn('flex flex-row', className)} {...props}>
|
|
22
|
+
{children}
|
|
23
|
+
</View>
|
|
24
|
+
);
|
|
25
|
+
},
|
|
26
|
+
);
|
|
27
|
+
Breadcrumb.displayName = 'Breadcrumb';
|
|
28
|
+
|
|
29
|
+
export const BreadcrumbList = React.forwardRef<View, BreadcrumbListBaseProps>(
|
|
30
|
+
({ className, children, ...props }, ref) => {
|
|
31
|
+
return (
|
|
32
|
+
<View
|
|
33
|
+
ref={ref}
|
|
34
|
+
className={cn(
|
|
35
|
+
'text-muted-foreground flex flex-row flex-wrap items-center gap-1.5 break-words sm:gap-2.5',
|
|
36
|
+
className,
|
|
37
|
+
)}
|
|
38
|
+
{...props}
|
|
39
|
+
>
|
|
40
|
+
{children}
|
|
41
|
+
</View>
|
|
42
|
+
);
|
|
43
|
+
},
|
|
44
|
+
);
|
|
45
|
+
BreadcrumbList.displayName = 'BreadcrumbList';
|
|
46
|
+
|
|
47
|
+
export const BreadcrumbItem = React.forwardRef<View, BreadcrumbItemBaseProps>(
|
|
48
|
+
({ className, children, ...props }, ref) => {
|
|
49
|
+
return (
|
|
50
|
+
<View ref={ref} className={cn('flex flex-row items-center gap-1.5', className)} {...props}>
|
|
51
|
+
{children}
|
|
52
|
+
</View>
|
|
53
|
+
);
|
|
54
|
+
},
|
|
55
|
+
);
|
|
56
|
+
BreadcrumbItem.displayName = 'BreadcrumbItem';
|
|
57
|
+
|
|
58
|
+
export type BreadcrumbLinkProps = BreadcrumbLinkBaseProps & {
|
|
59
|
+
onPress?: () => void;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export const BreadcrumbLink = React.forwardRef<View, BreadcrumbLinkProps>(
|
|
63
|
+
({ asChild, className, children, onPress, ...props }, ref) => {
|
|
64
|
+
const Comp = asChild ? Slot : Pressable;
|
|
65
|
+
|
|
66
|
+
return (
|
|
67
|
+
<Comp
|
|
68
|
+
ref={ref}
|
|
69
|
+
onPress={onPress}
|
|
70
|
+
className={cn(
|
|
71
|
+
'hover:text-foreground active:text-foreground flex flex-row items-center transition-colors',
|
|
72
|
+
className,
|
|
73
|
+
)}
|
|
74
|
+
{...props}
|
|
75
|
+
>
|
|
76
|
+
{wrapTextChildren(children, Text, {
|
|
77
|
+
className: 'text-muted-foreground hover:text-foreground text-sm font-medium',
|
|
78
|
+
})}
|
|
79
|
+
</Comp>
|
|
80
|
+
);
|
|
81
|
+
},
|
|
82
|
+
);
|
|
83
|
+
BreadcrumbLink.displayName = 'BreadcrumbLink';
|
|
84
|
+
|
|
85
|
+
export const BreadcrumbPage = React.forwardRef<View, BreadcrumbPageBaseProps>(
|
|
86
|
+
({ className, children, ...props }, ref) => {
|
|
87
|
+
return (
|
|
88
|
+
<View
|
|
89
|
+
ref={ref}
|
|
90
|
+
role="link"
|
|
91
|
+
aria-disabled={true}
|
|
92
|
+
aria-current="page"
|
|
93
|
+
className={cn('flex flex-row items-center', className)}
|
|
94
|
+
{...props}
|
|
95
|
+
>
|
|
96
|
+
{wrapTextChildren(children, Text, {
|
|
97
|
+
className: 'text-foreground text-sm font-normal',
|
|
98
|
+
})}
|
|
99
|
+
</View>
|
|
100
|
+
);
|
|
101
|
+
},
|
|
102
|
+
);
|
|
103
|
+
BreadcrumbPage.displayName = 'BreadcrumbPage';
|
|
104
|
+
|
|
105
|
+
export const BreadcrumbSeparator = ({ children, className, ...props }: BreadcrumbSeparatorBaseProps) => {
|
|
106
|
+
return (
|
|
107
|
+
<View
|
|
108
|
+
role="presentation"
|
|
109
|
+
aria-hidden={true}
|
|
110
|
+
className={cn('flex flex-row items-center justify-center', className)}
|
|
111
|
+
{...props}
|
|
112
|
+
>
|
|
113
|
+
{children ?? <ChevronRight size={14} className="text-muted-foreground" />}
|
|
114
|
+
</View>
|
|
115
|
+
);
|
|
116
|
+
};
|
|
117
|
+
BreadcrumbSeparator.displayName = 'BreadcrumbSeparator';
|
|
118
|
+
|
|
119
|
+
export const BreadcrumbEllipsis = ({ className, children, ...props }: BreadcrumbEllipsisBaseProps) => {
|
|
4
120
|
return (
|
|
5
|
-
<View
|
|
6
|
-
|
|
121
|
+
<View
|
|
122
|
+
role="presentation"
|
|
123
|
+
aria-hidden={true}
|
|
124
|
+
className={cn('flex h-9 w-9 flex-row items-center justify-center', className)}
|
|
125
|
+
{...props}
|
|
126
|
+
>
|
|
127
|
+
{children ?? <MoreHorizontal size={14} className="text-muted-foreground" />}
|
|
7
128
|
</View>
|
|
8
129
|
);
|
|
9
130
|
};
|
|
131
|
+
BreadcrumbEllipsis.displayName = 'BreadcrumbEllipsis';
|
package/src/calendar.tsx
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { CalendarBaseProps } from '@gv-tech/ui-core';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { View } from 'react-native';
|
|
2
4
|
|
|
3
|
-
export const Calendar = () => {
|
|
4
|
-
return
|
|
5
|
-
<View>
|
|
6
|
-
<Text>calendar is not yet implemented for React Native</Text>
|
|
7
|
-
</View>
|
|
8
|
-
);
|
|
5
|
+
export const Calendar: React.FC<CalendarBaseProps> = ({ className }) => {
|
|
6
|
+
return <View className={className} />;
|
|
9
7
|
};
|
package/src/carousel.tsx
CHANGED
|
@@ -1,9 +1,29 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import type {
|
|
2
|
+
CarouselBaseProps,
|
|
3
|
+
CarouselContentBaseProps,
|
|
4
|
+
CarouselItemBaseProps,
|
|
5
|
+
CarouselNextBaseProps,
|
|
6
|
+
CarouselPreviousBaseProps,
|
|
7
|
+
} from '@gv-tech/ui-core';
|
|
8
|
+
import * as React from 'react';
|
|
9
|
+
import { View } from 'react-native';
|
|
10
|
+
|
|
11
|
+
export const Carousel: React.FC<CarouselBaseProps> = ({ children, className }) => {
|
|
12
|
+
return <View className={className}>{children}</View>;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const CarouselContent: React.FC<CarouselContentBaseProps> = ({ children, className }) => {
|
|
16
|
+
return <View className={className}>{children}</View>;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export const CarouselItem: React.FC<CarouselItemBaseProps> = ({ children, className }) => {
|
|
20
|
+
return <View className={className}>{children}</View>;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export const CarouselPrevious: React.FC<CarouselPreviousBaseProps> = ({ className }) => {
|
|
24
|
+
return <View className={className} />;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export const CarouselNext: React.FC<CarouselNextBaseProps> = ({ className }) => {
|
|
28
|
+
return <View className={className} />;
|
|
9
29
|
};
|
package/src/chart.tsx
CHANGED
|
@@ -1,9 +1,31 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import type {
|
|
2
|
+
ChartContainerBaseProps,
|
|
3
|
+
ChartLegendContentBaseProps,
|
|
4
|
+
ChartTooltipContentBaseProps,
|
|
5
|
+
} from '@gv-tech/ui-core';
|
|
6
|
+
import * as React from 'react';
|
|
7
|
+
import { View } from 'react-native';
|
|
8
|
+
|
|
9
|
+
export const ChartContainer: React.FC<ChartContainerBaseProps> = ({ children, className }) => {
|
|
10
|
+
return <View className={className}>{children}</View>;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const ChartTooltipContent: React.FC<ChartTooltipContentBaseProps> = ({ className }) => {
|
|
14
|
+
return <View className={className} />;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export const ChartLegendContent: React.FC<ChartLegendContentBaseProps> = ({ className }) => {
|
|
18
|
+
return <View className={className} />;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export const ChartTooltip: React.FC<{ children?: React.ReactNode }> = ({ children }) => {
|
|
22
|
+
return <>{children}</>;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export const ChartLegend: React.FC<{ children?: React.ReactNode }> = ({ children }) => {
|
|
26
|
+
return <>{children}</>;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export const ChartStyle: React.FC = () => {
|
|
30
|
+
return null;
|
|
9
31
|
};
|
package/src/command.tsx
CHANGED
|
@@ -1,9 +1,49 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import type {
|
|
2
|
+
CommandBaseProps,
|
|
3
|
+
CommandEmptyBaseProps,
|
|
4
|
+
CommandGroupBaseProps,
|
|
5
|
+
CommandInputBaseProps,
|
|
6
|
+
CommandItemBaseProps,
|
|
7
|
+
CommandListBaseProps,
|
|
8
|
+
CommandSeparatorBaseProps,
|
|
9
|
+
CommandShortcutBaseProps,
|
|
10
|
+
} from '@gv-tech/ui-core';
|
|
11
|
+
import * as React from 'react';
|
|
12
|
+
import { View } from 'react-native';
|
|
13
|
+
import { wrapTextChildren } from './lib/render-native';
|
|
14
|
+
|
|
15
|
+
export const Command: React.FC<CommandBaseProps> = ({ children, className }) => {
|
|
16
|
+
return <View className={className}>{wrapTextChildren(children)}</View>;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export const CommandDialog: React.FC<{ children?: React.ReactNode }> = ({ children }) => {
|
|
20
|
+
return <>{children}</>;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export const CommandInput: React.FC<CommandInputBaseProps> = ({ className }) => {
|
|
24
|
+
return <View className={className} />;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export const CommandList: React.FC<CommandListBaseProps> = ({ children, className }) => {
|
|
28
|
+
return <View className={className}>{wrapTextChildren(children)}</View>;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export const CommandEmpty: React.FC<CommandEmptyBaseProps> = ({ children, className }) => {
|
|
32
|
+
return <View className={className}>{wrapTextChildren(children)}</View>;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export const CommandGroup: React.FC<CommandGroupBaseProps> = ({ children, className }) => {
|
|
36
|
+
return <View className={className}>{wrapTextChildren(children)}</View>;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export const CommandItem: React.FC<CommandItemBaseProps> = ({ children, className }) => {
|
|
40
|
+
return <View className={className}>{wrapTextChildren(children)}</View>;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export const CommandSeparator: React.FC<CommandSeparatorBaseProps> = ({ className }) => {
|
|
44
|
+
return <View className={className} />;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export const CommandShortcut: React.FC<CommandShortcutBaseProps> = ({ children, className }) => {
|
|
48
|
+
return <View className={className}>{wrapTextChildren(children)}</View>;
|
|
9
49
|
};
|
package/src/context-menu.tsx
CHANGED
|
@@ -1,9 +1,217 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type {
|
|
2
|
+
ContextMenuCheckboxItemBaseProps,
|
|
3
|
+
ContextMenuContentBaseProps,
|
|
4
|
+
ContextMenuItemBaseProps,
|
|
5
|
+
ContextMenuLabelBaseProps,
|
|
6
|
+
ContextMenuRadioItemBaseProps,
|
|
7
|
+
ContextMenuSeparatorBaseProps,
|
|
8
|
+
ContextMenuShortcutBaseProps,
|
|
9
|
+
ContextMenuSubContentBaseProps,
|
|
10
|
+
ContextMenuSubTriggerBaseProps,
|
|
11
|
+
} from '@gv-tech/ui-core';
|
|
12
|
+
import * as ContextMenuPrimitive from '@rn-primitives/context-menu';
|
|
13
|
+
import { Check, ChevronRight, Circle } from 'lucide-react-native';
|
|
14
|
+
import * as React from 'react';
|
|
15
|
+
import { Platform, StyleSheet, View } from 'react-native';
|
|
16
|
+
import Animated, { FadeIn, FadeOut } from 'react-native-reanimated';
|
|
17
|
+
import { wrapTextChildren } from './lib/render-native';
|
|
18
|
+
import { cn } from './lib/utils';
|
|
19
|
+
import { Text } from './text';
|
|
2
20
|
|
|
3
|
-
export const ContextMenu =
|
|
21
|
+
export const ContextMenu = ContextMenuPrimitive.Root;
|
|
22
|
+
|
|
23
|
+
export const ContextMenuTrigger = ContextMenuPrimitive.Trigger;
|
|
24
|
+
|
|
25
|
+
export const ContextMenuPortal = ContextMenuPrimitive.Portal;
|
|
26
|
+
|
|
27
|
+
export const ContextMenuGroup = ContextMenuPrimitive.Group;
|
|
28
|
+
|
|
29
|
+
export const ContextMenuRadioGroup = ContextMenuPrimitive.RadioGroup;
|
|
30
|
+
|
|
31
|
+
export const ContextMenuSub = ContextMenuPrimitive.Sub;
|
|
32
|
+
|
|
33
|
+
const ContextMenuOverlay = React.forwardRef<
|
|
34
|
+
React.ElementRef<typeof ContextMenuPrimitive.Overlay>,
|
|
35
|
+
React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Overlay>
|
|
36
|
+
>(({ className, ...props }, ref) => {
|
|
37
|
+
return (
|
|
38
|
+
<ContextMenuPrimitive.Overlay
|
|
39
|
+
style={Platform.OS !== 'web' ? StyleSheet.absoluteFill : undefined}
|
|
40
|
+
ref={ref}
|
|
41
|
+
{...props}
|
|
42
|
+
>
|
|
43
|
+
<Animated.View
|
|
44
|
+
entering={FadeIn.duration(100)}
|
|
45
|
+
exiting={FadeOut.duration(100)}
|
|
46
|
+
className={cn('absolute inset-0 z-50 bg-black/30', className)}
|
|
47
|
+
/>
|
|
48
|
+
</ContextMenuPrimitive.Overlay>
|
|
49
|
+
);
|
|
50
|
+
});
|
|
51
|
+
ContextMenuOverlay.displayName = 'ContextMenuOverlay';
|
|
52
|
+
|
|
53
|
+
export const ContextMenuContent = React.forwardRef<
|
|
54
|
+
React.ElementRef<typeof ContextMenuPrimitive.Content>,
|
|
55
|
+
ContextMenuContentBaseProps
|
|
56
|
+
>(({ className, children, ...props }, ref) => {
|
|
57
|
+
return (
|
|
58
|
+
<ContextMenuPortal>
|
|
59
|
+
<ContextMenuOverlay />
|
|
60
|
+
<ContextMenuPrimitive.Content
|
|
61
|
+
ref={ref}
|
|
62
|
+
className={cn(
|
|
63
|
+
'bg-popover border-border z-50 min-w-[8rem] overflow-hidden rounded-md border p-1 shadow-md',
|
|
64
|
+
className,
|
|
65
|
+
)}
|
|
66
|
+
{...props}
|
|
67
|
+
>
|
|
68
|
+
{children}
|
|
69
|
+
</ContextMenuPrimitive.Content>
|
|
70
|
+
</ContextMenuPortal>
|
|
71
|
+
);
|
|
72
|
+
});
|
|
73
|
+
ContextMenuContent.displayName = 'ContextMenuContent';
|
|
74
|
+
|
|
75
|
+
export const ContextMenuItem = React.forwardRef<
|
|
76
|
+
React.ElementRef<typeof ContextMenuPrimitive.Item>,
|
|
77
|
+
ContextMenuItemBaseProps
|
|
78
|
+
>(({ className, children, inset, ...props }, ref) => {
|
|
4
79
|
return (
|
|
5
|
-
<
|
|
6
|
-
|
|
7
|
-
|
|
80
|
+
<ContextMenuPrimitive.Item
|
|
81
|
+
ref={ref}
|
|
82
|
+
className={cn(
|
|
83
|
+
'focus:bg-accent focus:text-accent-foreground active:bg-accent active:text-accent-foreground relative flex flex-row items-center rounded-sm px-2 py-1.5 text-sm outline-none',
|
|
84
|
+
inset && 'pl-8',
|
|
85
|
+
className,
|
|
86
|
+
)}
|
|
87
|
+
{...props}
|
|
88
|
+
>
|
|
89
|
+
{wrapTextChildren(children, Text)}
|
|
90
|
+
</ContextMenuPrimitive.Item>
|
|
91
|
+
);
|
|
92
|
+
});
|
|
93
|
+
ContextMenuItem.displayName = 'ContextMenuItem';
|
|
94
|
+
|
|
95
|
+
export const ContextMenuCheckboxItem = React.forwardRef<
|
|
96
|
+
React.ElementRef<typeof ContextMenuPrimitive.CheckboxItem>,
|
|
97
|
+
ContextMenuCheckboxItemBaseProps
|
|
98
|
+
>(({ className, children, checked, onCheckedChange, ...props }, ref) => {
|
|
99
|
+
return (
|
|
100
|
+
<ContextMenuPrimitive.CheckboxItem
|
|
101
|
+
ref={ref}
|
|
102
|
+
checked={!!checked}
|
|
103
|
+
onCheckedChange={onCheckedChange || (() => {})}
|
|
104
|
+
className={cn(
|
|
105
|
+
'focus:bg-accent focus:text-accent-foreground active:bg-accent active:text-accent-foreground relative flex flex-row items-center rounded-sm py-1.5 pr-2 pl-8 text-sm outline-none',
|
|
106
|
+
className,
|
|
107
|
+
)}
|
|
108
|
+
{...props}
|
|
109
|
+
>
|
|
110
|
+
<View className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
|
|
111
|
+
<ContextMenuPrimitive.ItemIndicator>
|
|
112
|
+
<Check size={14} className="text-foreground" />
|
|
113
|
+
</ContextMenuPrimitive.ItemIndicator>
|
|
114
|
+
</View>
|
|
115
|
+
{wrapTextChildren(children, Text)}
|
|
116
|
+
</ContextMenuPrimitive.CheckboxItem>
|
|
117
|
+
);
|
|
118
|
+
});
|
|
119
|
+
ContextMenuCheckboxItem.displayName = 'ContextMenuCheckboxItem';
|
|
120
|
+
|
|
121
|
+
export const ContextMenuRadioItem = React.forwardRef<
|
|
122
|
+
React.ElementRef<typeof ContextMenuPrimitive.RadioItem>,
|
|
123
|
+
ContextMenuRadioItemBaseProps
|
|
124
|
+
>(({ className, children, value, ...props }, ref) => {
|
|
125
|
+
return (
|
|
126
|
+
<ContextMenuPrimitive.RadioItem
|
|
127
|
+
ref={ref}
|
|
128
|
+
value={value}
|
|
129
|
+
className={cn(
|
|
130
|
+
'focus:bg-accent focus:text-accent-foreground active:bg-accent active:text-accent-foreground relative flex flex-row items-center rounded-sm py-1.5 pr-2 pl-8 text-sm outline-none',
|
|
131
|
+
className,
|
|
132
|
+
)}
|
|
133
|
+
{...props}
|
|
134
|
+
>
|
|
135
|
+
<View className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
|
|
136
|
+
<ContextMenuPrimitive.ItemIndicator>
|
|
137
|
+
<Circle size={8} className="text-foreground fill-current" />
|
|
138
|
+
</ContextMenuPrimitive.ItemIndicator>
|
|
139
|
+
</View>
|
|
140
|
+
{wrapTextChildren(children, Text)}
|
|
141
|
+
</ContextMenuPrimitive.RadioItem>
|
|
142
|
+
);
|
|
143
|
+
});
|
|
144
|
+
ContextMenuRadioItem.displayName = 'ContextMenuRadioItem';
|
|
145
|
+
|
|
146
|
+
export const ContextMenuLabel = React.forwardRef<
|
|
147
|
+
React.ElementRef<typeof ContextMenuPrimitive.Label>,
|
|
148
|
+
ContextMenuLabelBaseProps
|
|
149
|
+
>(({ className, children, inset, ...props }, ref) => {
|
|
150
|
+
return (
|
|
151
|
+
<ContextMenuPrimitive.Label
|
|
152
|
+
ref={ref}
|
|
153
|
+
className={cn('text-foreground px-2 py-1.5 text-sm font-semibold', inset && 'pl-8', className)}
|
|
154
|
+
{...props}
|
|
155
|
+
>
|
|
156
|
+
{wrapTextChildren(children, Text)}
|
|
157
|
+
</ContextMenuPrimitive.Label>
|
|
158
|
+
);
|
|
159
|
+
});
|
|
160
|
+
ContextMenuLabel.displayName = 'ContextMenuLabel';
|
|
161
|
+
|
|
162
|
+
export const ContextMenuSeparator = React.forwardRef<
|
|
163
|
+
React.ElementRef<typeof ContextMenuPrimitive.Separator>,
|
|
164
|
+
ContextMenuSeparatorBaseProps
|
|
165
|
+
>(({ className, ...props }, ref) => {
|
|
166
|
+
return <ContextMenuPrimitive.Separator ref={ref} className={cn('bg-border -mx-1 my-1 h-px', className)} {...props} />;
|
|
167
|
+
});
|
|
168
|
+
ContextMenuSeparator.displayName = 'ContextMenuSeparator';
|
|
169
|
+
|
|
170
|
+
export const ContextMenuShortcut = ({ className, children, ...props }: ContextMenuShortcutBaseProps) => {
|
|
171
|
+
return (
|
|
172
|
+
<Text className={cn('text-muted-foreground ml-auto text-xs tracking-widest', className)} {...props}>
|
|
173
|
+
{children}
|
|
174
|
+
</Text>
|
|
8
175
|
);
|
|
9
176
|
};
|
|
177
|
+
ContextMenuShortcut.displayName = 'ContextMenuShortcut';
|
|
178
|
+
|
|
179
|
+
export const ContextMenuSubTrigger = React.forwardRef<
|
|
180
|
+
React.ElementRef<typeof ContextMenuPrimitive.SubTrigger>,
|
|
181
|
+
ContextMenuSubTriggerBaseProps
|
|
182
|
+
>(({ className, children, inset, ...props }, ref) => {
|
|
183
|
+
return (
|
|
184
|
+
<ContextMenuPrimitive.SubTrigger
|
|
185
|
+
ref={ref}
|
|
186
|
+
className={cn(
|
|
187
|
+
'focus:bg-accent focus:text-accent-foreground active:bg-accent active:text-accent-foreground flex flex-row items-center rounded-sm px-2 py-1.5 text-sm outline-none',
|
|
188
|
+
inset && 'pl-8',
|
|
189
|
+
className,
|
|
190
|
+
)}
|
|
191
|
+
{...props}
|
|
192
|
+
>
|
|
193
|
+
<View className="flex flex-row items-center gap-1.5">{wrapTextChildren(children, Text)}</View>
|
|
194
|
+
<ChevronRight size={14} className="text-foreground ml-auto" />
|
|
195
|
+
</ContextMenuPrimitive.SubTrigger>
|
|
196
|
+
);
|
|
197
|
+
});
|
|
198
|
+
ContextMenuSubTrigger.displayName = 'ContextMenuSubTrigger';
|
|
199
|
+
|
|
200
|
+
export const ContextMenuSubContent = React.forwardRef<
|
|
201
|
+
React.ElementRef<typeof ContextMenuPrimitive.SubContent>,
|
|
202
|
+
ContextMenuSubContentBaseProps
|
|
203
|
+
>(({ className, children, ...props }, ref) => {
|
|
204
|
+
return (
|
|
205
|
+
<ContextMenuPrimitive.SubContent
|
|
206
|
+
ref={ref}
|
|
207
|
+
className={cn(
|
|
208
|
+
'bg-popover border-border z-50 min-w-[8rem] overflow-hidden rounded-md border p-1 shadow-md',
|
|
209
|
+
className,
|
|
210
|
+
)}
|
|
211
|
+
{...props}
|
|
212
|
+
>
|
|
213
|
+
{children}
|
|
214
|
+
</ContextMenuPrimitive.SubContent>
|
|
215
|
+
);
|
|
216
|
+
});
|
|
217
|
+
ContextMenuSubContent.displayName = 'ContextMenuSubContent';
|