@gv-tech/ui-native 2.28.0 → 2.29.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/__contracts.d.ts +44 -2
- package/dist/__contracts.d.ts.map +1 -1
- package/dist/aspect-ratio.d.ts.map +1 -1
- package/dist/attachment.d.ts +12 -0
- package/dist/attachment.d.ts.map +1 -0
- package/dist/badge.d.ts +1 -1
- package/dist/badge.d.ts.map +1 -1
- package/dist/breadcrumb.d.ts +27 -8
- package/dist/breadcrumb.d.ts.map +1 -1
- package/dist/bubble.d.ts +7 -0
- package/dist/bubble.d.ts.map +1 -0
- package/dist/button-group.d.ts +3 -3
- package/dist/button-group.d.ts.map +1 -1
- package/dist/button.d.ts +5 -2
- package/dist/button.d.ts.map +1 -1
- package/dist/calendar.d.ts +10 -7
- package/dist/calendar.d.ts.map +1 -1
- package/dist/carousel.d.ts +29 -6
- package/dist/carousel.d.ts.map +1 -1
- package/dist/collapsible.d.ts.map +1 -1
- package/dist/combobox.d.ts +16 -16
- package/dist/combobox.d.ts.map +1 -1
- package/dist/command.d.ts.map +1 -1
- package/dist/direction.d.ts +1 -1
- package/dist/direction.d.ts.map +1 -1
- package/dist/empty.d.ts +6 -6
- package/dist/empty.d.ts.map +1 -1
- package/dist/field.d.ts +10 -10
- package/dist/field.d.ts.map +1 -1
- package/dist/hooks/use-theme.d.ts +1 -1
- package/dist/hooks/use-theme.d.ts.map +1 -1
- package/dist/hooks/use-toast.d.ts.map +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/input-group.d.ts +6 -6
- package/dist/input-group.d.ts.map +1 -1
- package/dist/input-otp.d.ts +4 -4
- package/dist/input-otp.d.ts.map +1 -1
- package/dist/item.d.ts +10 -10
- package/dist/item.d.ts.map +1 -1
- package/dist/kbd.d.ts +2 -2
- package/dist/kbd.d.ts.map +1 -1
- package/dist/marker.d.ts +6 -0
- package/dist/marker.d.ts.map +1 -0
- package/dist/message-scroller.d.ts +9 -0
- package/dist/message-scroller.d.ts.map +1 -0
- package/dist/message.d.ts +9 -0
- package/dist/message.d.ts.map +1 -0
- package/dist/native-select.d.ts +3 -3
- package/dist/native-select.d.ts.map +1 -1
- package/dist/pagination.d.ts +17 -10
- package/dist/pagination.d.ts.map +1 -1
- package/dist/questionnaire.d.ts +18 -0
- package/dist/questionnaire.d.ts.map +1 -0
- package/dist/scroll-area.d.ts +9 -2
- package/dist/scroll-area.d.ts.map +1 -1
- package/dist/scroll-to-top.d.ts +7 -6
- package/dist/scroll-to-top.d.ts.map +1 -1
- package/dist/search.d.ts +6 -3
- package/dist/search.d.ts.map +1 -1
- package/dist/sidebar.d.ts +23 -23
- package/dist/sidebar.d.ts.map +1 -1
- package/dist/skeleton.d.ts +1 -1
- package/dist/skeleton.d.ts.map +1 -1
- package/dist/slider.d.ts.map +1 -1
- package/dist/sonner.d.ts.map +1 -1
- package/dist/spinner.d.ts +1 -1
- package/dist/spinner.d.ts.map +1 -1
- package/dist/support-fab.d.ts +1 -1
- package/dist/support-fab.d.ts.map +1 -1
- package/dist/table-of-contents.d.ts +9 -17
- package/dist/table-of-contents.d.ts.map +1 -1
- package/dist/theme-provider.d.ts +1 -1
- package/dist/theme-provider.d.ts.map +1 -1
- package/dist/theme-toggle.d.ts +1 -1
- package/dist/theme-toggle.d.ts.map +1 -1
- package/dist/toaster.d.ts.map +1 -1
- package/dist/ui-native.cjs +2 -2
- package/dist/ui-native.esm.js +407 -268
- package/package.json +19 -18
- package/src/__contracts.ts +441 -281
- package/src/aspect-ratio.tsx +1 -0
- package/src/attachment.tsx +51 -0
- package/src/badge.tsx +3 -3
- package/src/breadcrumb.tsx +2 -8
- package/src/bubble.tsx +26 -0
- package/src/button-group.tsx +8 -3
- package/src/button.tsx +4 -3
- package/src/calendar.tsx +8 -5
- package/src/card.tsx +1 -1
- package/src/carousel.tsx +6 -23
- package/src/collapsible.tsx +1 -1
- package/src/combobox.tsx +8 -8
- package/src/command.tsx +1 -0
- package/src/context-menu.tsx +1 -0
- package/src/dialog.tsx +1 -1
- package/src/drawer.tsx +1 -0
- package/src/dropdown-menu.tsx +1 -0
- package/src/empty.tsx +6 -1
- package/src/field.tsx +2 -1
- package/src/form.tsx +9 -9
- package/src/hooks/use-theme.ts +1 -0
- package/src/hooks/use-toast.ts +1 -0
- package/src/hover-card.tsx +1 -0
- package/src/index.ts +51 -0
- package/src/input-group.tsx +7 -2
- package/src/input-otp.tsx +6 -1
- package/src/input.tsx +1 -1
- package/src/item.tsx +9 -3
- package/src/kbd.tsx +1 -0
- package/src/marker.tsx +17 -0
- package/src/menubar.tsx +1 -0
- package/src/message-scroller.tsx +39 -0
- package/src/message.tsx +36 -0
- package/src/native-select.tsx +2 -1
- package/src/navigation-menu.tsx +18 -6
- package/src/pagination.tsx +5 -2
- package/src/popover.tsx +1 -1
- package/src/progress.tsx +1 -2
- package/src/questionnaire.tsx +87 -0
- package/src/radio-group.tsx +1 -1
- package/src/scroll-area.tsx +1 -0
- package/src/scroll-to-top.tsx +11 -10
- package/src/search.tsx +2 -1
- package/src/select.tsx +1 -1
- package/src/sidebar.tsx +20 -19
- package/src/skeleton.tsx +4 -2
- package/src/slider.tsx +2 -1
- package/src/sonner.tsx +1 -0
- package/src/spinner.tsx +4 -1
- package/src/switch.tsx +1 -1
- package/src/table-of-contents.tsx +16 -27
- package/src/tabs.tsx +18 -7
- package/src/text.tsx +3 -3
- package/src/theme-provider.tsx +3 -1
- package/src/theme-toggle.tsx +32 -29
- package/src/toaster.tsx +1 -0
- package/src/toggle-group.tsx +2 -2
- package/src/toggle.tsx +3 -2
- package/dist/alert-dialog.d.ts +0 -51
- package/dist/alert-dialog.d.ts.map +0 -1
- package/dist/alert.d.ts +0 -10
- package/dist/alert.d.ts.map +0 -1
- package/dist/card.d.ts +0 -13
- package/dist/card.d.ts.map +0 -1
- package/dist/checkbox.d.ts +0 -15
- package/dist/checkbox.d.ts.map +0 -1
- package/dist/context-menu.d.ts +0 -61
- package/dist/context-menu.d.ts.map +0 -1
- package/dist/dialog.d.ts +0 -61
- package/dist/dialog.d.ts.map +0 -1
- package/dist/drawer.d.ts +0 -33
- package/dist/drawer.d.ts.map +0 -1
- package/dist/dropdown-menu.d.ts +0 -60
- package/dist/dropdown-menu.d.ts.map +0 -1
- package/dist/form.d.ts +0 -33
- package/dist/form.d.ts.map +0 -1
- package/dist/hover-card.d.ts +0 -23
- package/dist/hover-card.d.ts.map +0 -1
- package/dist/input.d.ts +0 -8
- package/dist/input.d.ts.map +0 -1
- package/dist/label.d.ts +0 -9
- package/dist/label.d.ts.map +0 -1
- package/dist/menubar.d.ts +0 -53
- package/dist/menubar.d.ts.map +0 -1
- package/dist/navigation-menu.d.ts +0 -14
- package/dist/navigation-menu.d.ts.map +0 -1
- package/dist/popover.d.ts +0 -9
- package/dist/popover.d.ts.map +0 -1
- package/dist/progress.d.ts +0 -6
- package/dist/progress.d.ts.map +0 -1
- package/dist/radio-group.d.ts +0 -11
- package/dist/radio-group.d.ts.map +0 -1
- package/dist/select.d.ts +0 -59
- package/dist/select.d.ts.map +0 -1
- package/dist/separator.d.ts +0 -9
- package/dist/separator.d.ts.map +0 -1
- package/dist/sheet.d.ts +0 -59
- package/dist/sheet.d.ts.map +0 -1
- package/dist/switch.d.ts +0 -8
- package/dist/switch.d.ts.map +0 -1
- package/dist/table.d.ts +0 -12
- package/dist/table.d.ts.map +0 -1
- package/dist/tabs.d.ts +0 -30
- package/dist/tabs.d.ts.map +0 -1
- package/dist/text.d.ts +0 -13
- package/dist/text.d.ts.map +0 -1
- package/dist/textarea.d.ts +0 -6
- package/dist/textarea.d.ts.map +0 -1
- package/dist/toast.d.ts +0 -35
- package/dist/toast.d.ts.map +0 -1
- package/dist/toggle-group.d.ts +0 -11
- package/dist/toggle-group.d.ts.map +0 -1
- package/dist/toggle.d.ts +0 -8
- package/dist/toggle.d.ts.map +0 -1
- package/dist/tooltip.d.ts +0 -30
- package/dist/tooltip.d.ts.map +0 -1
package/src/aspect-ratio.tsx
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { AspectRatioBaseProps } from '@gv-tech/ui-core';
|
|
2
2
|
import * as AspectRatioPrimitive from '@rn-primitives/aspect-ratio';
|
|
3
3
|
import * as React from 'react';
|
|
4
|
+
|
|
4
5
|
import { cn } from './lib/utils';
|
|
5
6
|
|
|
6
7
|
export const AspectRatio: React.FC<AspectRatioBaseProps> = ({ children, className, ratio = 1 }) => {
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
AttachmentActionBaseProps,
|
|
3
|
+
AttachmentActionsBaseProps,
|
|
4
|
+
AttachmentBaseProps,
|
|
5
|
+
AttachmentContentBaseProps,
|
|
6
|
+
AttachmentDescriptionBaseProps,
|
|
7
|
+
AttachmentGroupBaseProps,
|
|
8
|
+
AttachmentMediaBaseProps,
|
|
9
|
+
AttachmentTitleBaseProps,
|
|
10
|
+
AttachmentTriggerBaseProps,
|
|
11
|
+
} from '@gv-tech/ui-core';
|
|
12
|
+
import * as React from 'react';
|
|
13
|
+
import { Pressable, View } from 'react-native';
|
|
14
|
+
|
|
15
|
+
// Web-first stub: structure-only passthrough until the full native
|
|
16
|
+
// implementation lands. See docs/reference/parity-matrix.md.
|
|
17
|
+
export const Attachment: React.FC<AttachmentBaseProps> = ({ children, className }) => {
|
|
18
|
+
return <View className={className}>{children}</View>;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export const AttachmentMedia: React.FC<AttachmentMediaBaseProps> = ({ children, className }) => {
|
|
22
|
+
return <View className={className}>{children}</View>;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export const AttachmentContent: React.FC<AttachmentContentBaseProps> = ({ children, className }) => {
|
|
26
|
+
return <View className={className}>{children}</View>;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export const AttachmentTitle: React.FC<AttachmentTitleBaseProps> = ({ children, className }) => {
|
|
30
|
+
return <View className={className}>{children}</View>;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export const AttachmentDescription: React.FC<AttachmentDescriptionBaseProps> = ({ children, className }) => {
|
|
34
|
+
return <View className={className}>{children}</View>;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export const AttachmentActions: React.FC<AttachmentActionsBaseProps> = ({ children, className }) => {
|
|
38
|
+
return <View className={className}>{children}</View>;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export const AttachmentAction: React.FC<AttachmentActionBaseProps> = ({ children, className }) => {
|
|
42
|
+
return <View className={className}>{children}</View>;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export const AttachmentTrigger: React.FC<AttachmentTriggerBaseProps> = ({ children, className }) => {
|
|
46
|
+
return <Pressable className={className}>{children}</Pressable>;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export const AttachmentGroup: React.FC<AttachmentGroupBaseProps> = ({ children, className }) => {
|
|
50
|
+
return <View className={className}>{children}</View>;
|
|
51
|
+
};
|
package/src/badge.tsx
CHANGED
|
@@ -7,9 +7,9 @@ import { cn } from './lib/utils';
|
|
|
7
7
|
const badgeVariants = cva('flex-row items-center rounded-md border px-2 py-0.5', {
|
|
8
8
|
variants: {
|
|
9
9
|
variant: {
|
|
10
|
-
default: 'border-transparent
|
|
11
|
-
secondary: 'border-transparent
|
|
12
|
-
destructive: 'border-transparent
|
|
10
|
+
default: 'bg-primary border-transparent',
|
|
11
|
+
secondary: 'bg-secondary border-transparent',
|
|
12
|
+
destructive: 'bg-destructive border-transparent',
|
|
13
13
|
outline: 'border-border bg-transparent',
|
|
14
14
|
},
|
|
15
15
|
},
|
package/src/breadcrumb.tsx
CHANGED
|
@@ -11,6 +11,7 @@ import { Slot } from '@rn-primitives/slot';
|
|
|
11
11
|
import { ChevronRight, MoreHorizontal } from 'lucide-react-native';
|
|
12
12
|
import * as React from 'react';
|
|
13
13
|
import { Pressable, View } from 'react-native';
|
|
14
|
+
|
|
14
15
|
import { wrapTextChildren } from './lib/render-native';
|
|
15
16
|
import { cn } from './lib/utils';
|
|
16
17
|
import { Text } from './text';
|
|
@@ -85,14 +86,7 @@ BreadcrumbLink.displayName = 'BreadcrumbLink';
|
|
|
85
86
|
export const BreadcrumbPage = React.forwardRef<View, BreadcrumbPageBaseProps>(
|
|
86
87
|
({ className, children, ...props }, ref) => {
|
|
87
88
|
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
|
-
>
|
|
89
|
+
<View ref={ref} aria-current="page" className={cn('flex flex-row items-center', className)} {...props}>
|
|
96
90
|
{wrapTextChildren(children, Text, {
|
|
97
91
|
className: 'text-foreground text-sm font-normal',
|
|
98
92
|
})}
|
package/src/bubble.tsx
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
BubbleBaseProps,
|
|
3
|
+
BubbleContentBaseProps,
|
|
4
|
+
BubbleGroupBaseProps,
|
|
5
|
+
BubbleReactionsBaseProps,
|
|
6
|
+
} from '@gv-tech/ui-core';
|
|
7
|
+
import * as React from 'react';
|
|
8
|
+
import { View } from 'react-native';
|
|
9
|
+
|
|
10
|
+
// Web-first stub: structure-only passthrough until the full native
|
|
11
|
+
// chat implementation lands. See docs/reference/parity-matrix.md.
|
|
12
|
+
export const BubbleGroup: React.FC<BubbleGroupBaseProps> = ({ children, className }) => {
|
|
13
|
+
return <View className={className}>{children}</View>;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const Bubble: React.FC<BubbleBaseProps> = ({ children, className }) => {
|
|
17
|
+
return <View className={className}>{children}</View>;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export const BubbleContent: React.FC<BubbleContentBaseProps> = ({ children, className }) => {
|
|
21
|
+
return <View className={className}>{children}</View>;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export const BubbleReactions: React.FC<BubbleReactionsBaseProps> = ({ children, className }) => {
|
|
25
|
+
return <View className={className}>{children}</View>;
|
|
26
|
+
};
|
package/src/button-group.tsx
CHANGED
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
import type { ButtonGroupBaseProps, ButtonGroupSeparatorBaseProps, ButtonGroupTextBaseProps } from '@gv-tech/ui-core';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { Text, View } from 'react-native';
|
|
4
|
+
|
|
4
5
|
import { cn } from './lib/utils';
|
|
5
6
|
|
|
6
7
|
// TODO: Implement proper React Native ButtonGroup logic
|
|
7
|
-
function ButtonGroup({
|
|
8
|
+
function ButtonGroup({
|
|
9
|
+
className,
|
|
10
|
+
orientation: _orientation,
|
|
11
|
+
...props
|
|
12
|
+
}: React.ComponentProps<typeof View> & ButtonGroupBaseProps) {
|
|
8
13
|
return <View className={cn('flex flex-row', className)} {...props} />;
|
|
9
14
|
}
|
|
10
15
|
|
|
11
16
|
function ButtonGroupText({
|
|
12
17
|
className,
|
|
13
|
-
asChild,
|
|
18
|
+
asChild: _asChild,
|
|
14
19
|
...props
|
|
15
20
|
}: React.ComponentProps<typeof Text> & ButtonGroupTextBaseProps) {
|
|
16
21
|
return <Text className={cn('text-sm font-medium', className)} {...props} />;
|
|
@@ -18,7 +23,7 @@ function ButtonGroupText({
|
|
|
18
23
|
|
|
19
24
|
function ButtonGroupSeparator({
|
|
20
25
|
className,
|
|
21
|
-
orientation,
|
|
26
|
+
orientation: _orientation,
|
|
22
27
|
...props
|
|
23
28
|
}: React.ComponentProps<typeof View> & ButtonGroupSeparatorBaseProps) {
|
|
24
29
|
return <View className={cn('bg-border h-full w-px', className)} {...props} />;
|
package/src/button.tsx
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import type { ButtonBaseProps } from '@gv-tech/ui-core';
|
|
1
2
|
import { cva } from 'class-variance-authority';
|
|
2
3
|
import * as React from 'react';
|
|
3
|
-
import {
|
|
4
|
+
import type { View } from 'react-native';
|
|
5
|
+
import { Pressable, Text } from 'react-native';
|
|
4
6
|
|
|
5
|
-
import type { ButtonBaseProps } from '@gv-tech/ui-core';
|
|
6
7
|
import { wrapTextChildren } from './lib/render-native';
|
|
7
8
|
import { cn } from './lib/utils';
|
|
8
9
|
|
|
@@ -13,7 +14,7 @@ const buttonVariants = cva(
|
|
|
13
14
|
variant: {
|
|
14
15
|
default: 'bg-primary shadow-sm',
|
|
15
16
|
destructive: 'bg-destructive shadow-sm',
|
|
16
|
-
outline: 'border
|
|
17
|
+
outline: 'border-input border bg-transparent shadow-sm',
|
|
17
18
|
secondary: 'bg-secondary shadow-sm',
|
|
18
19
|
ghost: 'bg-transparent',
|
|
19
20
|
link: 'bg-transparent',
|
package/src/calendar.tsx
CHANGED
|
@@ -2,6 +2,7 @@ import type { CalendarBaseProps } from '@gv-tech/ui-core';
|
|
|
2
2
|
import DateTimePicker from '@react-native-community/datetimepicker';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { View } from 'react-native';
|
|
5
|
+
|
|
5
6
|
import { cn } from './lib/utils';
|
|
6
7
|
|
|
7
8
|
export type CalendarProps = Omit<
|
|
@@ -14,16 +15,18 @@ export type CalendarProps = Omit<
|
|
|
14
15
|
};
|
|
15
16
|
|
|
16
17
|
export const Calendar = React.forwardRef<View, CalendarProps>(
|
|
17
|
-
({ className, value, onChange, showOutsideDays, ...props }, ref) => {
|
|
18
|
+
({ className, value, onChange, showOutsideDays: _showOutsideDays, ...props }, ref) => {
|
|
18
19
|
// If no value is provided, default to current date so the picker doesn't crash
|
|
19
|
-
const [date, setDate] = React.useState<Date>(value
|
|
20
|
+
const [date, setDate] = React.useState<Date>(() => value ?? new Date());
|
|
21
|
+
const [prevValue, setPrevValue] = React.useState(value);
|
|
20
22
|
|
|
21
|
-
// Sync internal state if external value changes
|
|
22
|
-
|
|
23
|
+
// Sync internal state if external value changes (adjust during render)
|
|
24
|
+
if (value !== prevValue) {
|
|
25
|
+
setPrevValue(value);
|
|
23
26
|
if (value) {
|
|
24
27
|
setDate(value);
|
|
25
28
|
}
|
|
26
|
-
}
|
|
29
|
+
}
|
|
27
30
|
|
|
28
31
|
const handleValueChange = (event: unknown, selectedDate: Date) => {
|
|
29
32
|
setDate(selectedDate);
|
package/src/card.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import type { CardBaseProps } from '@gv-tech/ui-core';
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
import { Text, View } from 'react-native';
|
|
3
4
|
|
|
4
|
-
import type { CardBaseProps } from '@gv-tech/ui-core';
|
|
5
5
|
import { wrapTextChildren } from './lib/render-native';
|
|
6
6
|
import { cn } from './lib/utils';
|
|
7
7
|
|
package/src/carousel.tsx
CHANGED
|
@@ -7,14 +7,8 @@ import type {
|
|
|
7
7
|
} from '@gv-tech/ui-core';
|
|
8
8
|
import { ArrowLeft, ArrowRight } from 'lucide-react-native';
|
|
9
9
|
import * as React from 'react';
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
ScrollView,
|
|
13
|
-
View,
|
|
14
|
-
type LayoutChangeEvent,
|
|
15
|
-
type NativeScrollEvent,
|
|
16
|
-
type NativeSyntheticEvent,
|
|
17
|
-
} from 'react-native';
|
|
10
|
+
import { Dimensions, ScrollView, View, type LayoutChangeEvent } from 'react-native';
|
|
11
|
+
|
|
18
12
|
import { Button } from './button';
|
|
19
13
|
import { cn } from './lib/utils';
|
|
20
14
|
type CarouselApi = unknown;
|
|
@@ -47,12 +41,12 @@ export type CarouselProps = CarouselBaseProps & {
|
|
|
47
41
|
};
|
|
48
42
|
|
|
49
43
|
export const Carousel = React.forwardRef<View, CarouselProps>(
|
|
50
|
-
({ children, className, opts, orientation = 'horizontal', setApi, plugins, ...props }, ref) => {
|
|
44
|
+
({ children, className, opts: _opts, orientation = 'horizontal', setApi, plugins: _plugins, ...props }, ref) => {
|
|
51
45
|
const scrollRef = React.useRef<ScrollView>(null) as React.RefObject<ScrollView>;
|
|
52
|
-
const [canScrollNext
|
|
53
|
-
const [canScrollPrev
|
|
46
|
+
const [canScrollNext] = React.useState(true);
|
|
47
|
+
const [canScrollPrev] = React.useState(false);
|
|
54
48
|
const [itemWidth, setItemWidth] = React.useState(Dimensions.get('window').width);
|
|
55
|
-
const [currentIndex
|
|
49
|
+
const [currentIndex] = React.useState(0);
|
|
56
50
|
|
|
57
51
|
const scrollNext = React.useCallback(() => {
|
|
58
52
|
scrollRef.current?.scrollTo({ x: (currentIndex + 1) * itemWidth, animated: true });
|
|
@@ -76,17 +70,6 @@ export const Carousel = React.forwardRef<View, CarouselProps>(
|
|
|
76
70
|
}
|
|
77
71
|
}, [setApi, scrollNext, scrollPrev, canScrollNext, canScrollPrev]);
|
|
78
72
|
|
|
79
|
-
const _handleScroll = (event: NativeSyntheticEvent<NativeScrollEvent>) => {
|
|
80
|
-
const offsetX = event.nativeEvent.contentOffset.x;
|
|
81
|
-
const contentWidth = event.nativeEvent.contentSize.width;
|
|
82
|
-
const layoutWidth = event.nativeEvent.layoutMeasurement.width;
|
|
83
|
-
|
|
84
|
-
const newIndex = Math.round(offsetX / itemWidth);
|
|
85
|
-
setCurrentIndex(newIndex);
|
|
86
|
-
setCanScrollPrev(offsetX > 0);
|
|
87
|
-
setCanScrollNext(offsetX + layoutWidth < contentWidth);
|
|
88
|
-
};
|
|
89
|
-
|
|
90
73
|
return (
|
|
91
74
|
<CarouselContext.Provider
|
|
92
75
|
value={{
|
package/src/collapsible.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CollapsibleBaseProps, CollapsibleContentBaseProps, CollapsibleTriggerBaseProps } from '@gv-tech/ui-core';
|
|
1
|
+
import type { CollapsibleBaseProps, CollapsibleContentBaseProps, CollapsibleTriggerBaseProps } from '@gv-tech/ui-core';
|
|
2
2
|
import * as CollapsiblePrimitive from '@rn-primitives/collapsible';
|
|
3
3
|
|
|
4
4
|
const Collapsible: typeof CollapsiblePrimitive.Root = CollapsiblePrimitive.Root;
|
package/src/combobox.tsx
CHANGED
|
@@ -18,6 +18,7 @@ import type {
|
|
|
18
18
|
import { Check, ChevronDown, X } from 'lucide-react-native';
|
|
19
19
|
import * as React from 'react';
|
|
20
20
|
import { Pressable, TextInput, View } from 'react-native';
|
|
21
|
+
|
|
21
22
|
import { Dialog, DialogContent, DialogTrigger } from './dialog';
|
|
22
23
|
import { wrapTextChildren } from './lib/render-native';
|
|
23
24
|
import { cn } from './lib/utils';
|
|
@@ -116,8 +117,8 @@ function ComboboxClear({
|
|
|
116
117
|
|
|
117
118
|
function ComboboxInput({
|
|
118
119
|
className,
|
|
119
|
-
showClear,
|
|
120
|
-
showTrigger,
|
|
120
|
+
showClear: _showClear,
|
|
121
|
+
showTrigger: _showTrigger,
|
|
121
122
|
placeholder = 'Search...',
|
|
122
123
|
...props
|
|
123
124
|
}: React.ComponentProps<typeof TextInput> & ComboboxInputBaseProps) {
|
|
@@ -130,7 +131,6 @@ function ComboboxInput({
|
|
|
130
131
|
placeholderTextColor="#a1a1aa"
|
|
131
132
|
value={searchQuery}
|
|
132
133
|
onChangeText={setSearchQuery}
|
|
133
|
-
autoFocus
|
|
134
134
|
{...props}
|
|
135
135
|
/>
|
|
136
136
|
</View>
|
|
@@ -139,11 +139,11 @@ function ComboboxInput({
|
|
|
139
139
|
|
|
140
140
|
function ComboboxContent({
|
|
141
141
|
className,
|
|
142
|
-
side,
|
|
143
|
-
sideOffset,
|
|
144
|
-
align,
|
|
145
|
-
alignOffset,
|
|
146
|
-
anchor,
|
|
142
|
+
side: _side,
|
|
143
|
+
sideOffset: _sideOffset,
|
|
144
|
+
align: _align,
|
|
145
|
+
alignOffset: _alignOffset,
|
|
146
|
+
anchor: _anchor,
|
|
147
147
|
...props
|
|
148
148
|
}: React.ComponentProps<typeof View> & ComboboxContentBaseProps) {
|
|
149
149
|
return (
|
package/src/command.tsx
CHANGED
|
@@ -10,6 +10,7 @@ import type {
|
|
|
10
10
|
} from '@gv-tech/ui-core';
|
|
11
11
|
import * as React from 'react';
|
|
12
12
|
import { View } from 'react-native';
|
|
13
|
+
|
|
13
14
|
import { wrapTextChildren } from './lib/render-native';
|
|
14
15
|
|
|
15
16
|
export const Command: React.FC<CommandBaseProps> = ({ children, className }) => {
|
package/src/context-menu.tsx
CHANGED
|
@@ -14,6 +14,7 @@ import { Check, ChevronRight, Circle } from 'lucide-react-native';
|
|
|
14
14
|
import * as React from 'react';
|
|
15
15
|
import { Platform, StyleSheet, View } from 'react-native';
|
|
16
16
|
import Animated, { FadeIn, FadeOut } from 'react-native-reanimated';
|
|
17
|
+
|
|
17
18
|
import { wrapTextChildren } from './lib/render-native';
|
|
18
19
|
import { cn } from './lib/utils';
|
|
19
20
|
import { Text } from './text';
|
package/src/dialog.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DialogBaseProps, DialogContentBaseProps } from '@gv-tech/ui-core';
|
|
1
|
+
import type { DialogBaseProps, DialogContentBaseProps } from '@gv-tech/ui-core';
|
|
2
2
|
import * as DialogPrimitive from '@rn-primitives/dialog';
|
|
3
3
|
import { X } from 'lucide-react-native';
|
|
4
4
|
import * as React from 'react';
|
package/src/drawer.tsx
CHANGED
|
@@ -12,6 +12,7 @@ import * as DialogPrimitive from '@rn-primitives/dialog';
|
|
|
12
12
|
import * as React from 'react';
|
|
13
13
|
import { Platform, View, type StyleProp, type ViewStyle } from 'react-native';
|
|
14
14
|
import Animated, { FadeIn, FadeOut, SlideInDown, SlideOutDown } from 'react-native-reanimated';
|
|
15
|
+
|
|
15
16
|
import { wrapTextChildren } from './lib/render-native';
|
|
16
17
|
import { cn } from './lib/utils';
|
|
17
18
|
|
package/src/dropdown-menu.tsx
CHANGED
|
@@ -15,6 +15,7 @@ import { Check, ChevronRight, Circle } from 'lucide-react-native';
|
|
|
15
15
|
import * as React from 'react';
|
|
16
16
|
import { Platform, StyleSheet, View } from 'react-native';
|
|
17
17
|
import Animated, { FadeIn, FadeOut } from 'react-native-reanimated';
|
|
18
|
+
|
|
18
19
|
import { wrapTextChildren } from './lib/render-native';
|
|
19
20
|
import { cn } from './lib/utils';
|
|
20
21
|
import { Text } from './text';
|
package/src/empty.tsx
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { EmptyBaseProps, EmptyMediaBaseProps } from '@gv-tech/ui-core';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { Text, View } from 'react-native';
|
|
4
|
+
|
|
4
5
|
import { cn } from './lib/utils';
|
|
5
6
|
|
|
6
7
|
function Empty({ className, ...props }: React.ComponentProps<typeof View> & EmptyBaseProps) {
|
|
@@ -19,7 +20,11 @@ function EmptyHeader({ className, ...props }: React.ComponentProps<typeof View>)
|
|
|
19
20
|
return <View className={cn('flex flex-col items-center gap-2', className)} {...props} />;
|
|
20
21
|
}
|
|
21
22
|
|
|
22
|
-
function EmptyMedia({
|
|
23
|
+
function EmptyMedia({
|
|
24
|
+
className,
|
|
25
|
+
variant: _variant,
|
|
26
|
+
...props
|
|
27
|
+
}: React.ComponentProps<typeof View> & EmptyMediaBaseProps) {
|
|
23
28
|
return <View className={cn('flex items-center justify-center', className)} {...props} />;
|
|
24
29
|
}
|
|
25
30
|
|
package/src/field.tsx
CHANGED
|
@@ -12,9 +12,10 @@ import type {
|
|
|
12
12
|
} from '@gv-tech/ui-core';
|
|
13
13
|
import * as React from 'react';
|
|
14
14
|
import { Text, View } from 'react-native';
|
|
15
|
+
|
|
15
16
|
import { cn } from './lib/utils';
|
|
16
17
|
|
|
17
|
-
function Field({ className, orientation, ...props }: React.ComponentProps<typeof View> & FieldBaseProps) {
|
|
18
|
+
function Field({ className, orientation: _orientation, ...props }: React.ComponentProps<typeof View> & FieldBaseProps) {
|
|
18
19
|
return <View className={cn('flex flex-col gap-2', className)} {...props} />;
|
|
19
20
|
}
|
|
20
21
|
|
package/src/form.tsx
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
FormControlBaseProps,
|
|
3
|
+
FormDescriptionBaseProps,
|
|
4
|
+
FormItemBaseProps,
|
|
5
|
+
FormLabelBaseProps,
|
|
6
|
+
FormMessageBaseProps,
|
|
7
|
+
} from '@gv-tech/ui-core';
|
|
8
|
+
// Assuming we have Slot from @rn-primitives/slot
|
|
9
|
+
import * as Slot from '@rn-primitives/slot';
|
|
1
10
|
import * as React from 'react';
|
|
2
11
|
import {
|
|
3
12
|
Controller,
|
|
@@ -9,17 +18,8 @@ import {
|
|
|
9
18
|
} from 'react-hook-form';
|
|
10
19
|
import { Text, View } from 'react-native';
|
|
11
20
|
|
|
12
|
-
import {
|
|
13
|
-
FormControlBaseProps,
|
|
14
|
-
FormDescriptionBaseProps,
|
|
15
|
-
FormItemBaseProps,
|
|
16
|
-
FormLabelBaseProps,
|
|
17
|
-
FormMessageBaseProps,
|
|
18
|
-
} from '@gv-tech/ui-core';
|
|
19
21
|
import { Label } from './label';
|
|
20
22
|
import { cn } from './lib/utils';
|
|
21
|
-
// Assuming we have Slot from @rn-primitives/slot
|
|
22
|
-
import * as Slot from '@rn-primitives/slot';
|
|
23
23
|
|
|
24
24
|
const Form = FormProvider;
|
|
25
25
|
|
package/src/hooks/use-theme.ts
CHANGED
package/src/hooks/use-toast.ts
CHANGED
package/src/hover-card.tsx
CHANGED
package/src/index.ts
CHANGED
|
@@ -436,3 +436,54 @@ export {
|
|
|
436
436
|
SidebarTrigger,
|
|
437
437
|
useSidebar,
|
|
438
438
|
} from './sidebar';
|
|
439
|
+
|
|
440
|
+
// Attachment
|
|
441
|
+
export {
|
|
442
|
+
Attachment,
|
|
443
|
+
AttachmentAction,
|
|
444
|
+
AttachmentActions,
|
|
445
|
+
AttachmentContent,
|
|
446
|
+
AttachmentDescription,
|
|
447
|
+
AttachmentGroup,
|
|
448
|
+
AttachmentMedia,
|
|
449
|
+
AttachmentTitle,
|
|
450
|
+
AttachmentTrigger,
|
|
451
|
+
} from './attachment';
|
|
452
|
+
|
|
453
|
+
// Bubble
|
|
454
|
+
export { Bubble, BubbleContent, BubbleGroup, BubbleReactions } from './bubble';
|
|
455
|
+
|
|
456
|
+
// Marker
|
|
457
|
+
export { Marker, MarkerContent, MarkerIcon } from './marker';
|
|
458
|
+
|
|
459
|
+
// Message
|
|
460
|
+
export { Message, MessageAvatar, MessageContent, MessageFooter, MessageGroup, MessageHeader } from './message';
|
|
461
|
+
|
|
462
|
+
// Message Scroller
|
|
463
|
+
export {
|
|
464
|
+
MessageScroller,
|
|
465
|
+
MessageScrollerButton,
|
|
466
|
+
MessageScrollerContent,
|
|
467
|
+
MessageScrollerItem,
|
|
468
|
+
MessageScrollerProvider,
|
|
469
|
+
MessageScrollerViewport,
|
|
470
|
+
} from './message-scroller';
|
|
471
|
+
|
|
472
|
+
// Questionnaire
|
|
473
|
+
export {
|
|
474
|
+
Questionnaire,
|
|
475
|
+
QuestionnaireActions,
|
|
476
|
+
QuestionnaireChoice,
|
|
477
|
+
QuestionnaireChoiceDescription,
|
|
478
|
+
QuestionnaireChoices,
|
|
479
|
+
QuestionnaireDescription,
|
|
480
|
+
QuestionnaireError,
|
|
481
|
+
QuestionnaireInput,
|
|
482
|
+
QuestionnaireItem,
|
|
483
|
+
QuestionnaireNext,
|
|
484
|
+
QuestionnairePrevious,
|
|
485
|
+
QuestionnaireProgress,
|
|
486
|
+
QuestionnaireSkip,
|
|
487
|
+
QuestionnaireSubmit,
|
|
488
|
+
QuestionnaireTitle,
|
|
489
|
+
} from './questionnaire';
|
package/src/input-group.tsx
CHANGED
|
@@ -8,6 +8,7 @@ import type {
|
|
|
8
8
|
} from '@gv-tech/ui-core';
|
|
9
9
|
import * as React from 'react';
|
|
10
10
|
import { Text, TextInput, View } from 'react-native';
|
|
11
|
+
|
|
11
12
|
import { Button } from './button';
|
|
12
13
|
import { cn } from './lib/utils';
|
|
13
14
|
|
|
@@ -15,13 +16,17 @@ function InputGroup({ className, ...props }: React.ComponentProps<typeof View> &
|
|
|
15
16
|
return <View className={cn('border-input flex flex-row items-center rounded-md border', className)} {...props} />;
|
|
16
17
|
}
|
|
17
18
|
|
|
18
|
-
function InputGroupAddon({
|
|
19
|
+
function InputGroupAddon({
|
|
20
|
+
className,
|
|
21
|
+
align: _align,
|
|
22
|
+
...props
|
|
23
|
+
}: React.ComponentProps<typeof View> & InputGroupAddonBaseProps) {
|
|
19
24
|
return <View className={cn('p-2', className)} {...props} />;
|
|
20
25
|
}
|
|
21
26
|
|
|
22
27
|
function InputGroupButton({
|
|
23
28
|
className,
|
|
24
|
-
type,
|
|
29
|
+
type: _type,
|
|
25
30
|
variant,
|
|
26
31
|
size,
|
|
27
32
|
...props
|
package/src/input-otp.tsx
CHANGED
|
@@ -6,6 +6,7 @@ import type {
|
|
|
6
6
|
} from '@gv-tech/ui-core';
|
|
7
7
|
import * as React from 'react';
|
|
8
8
|
import { Text, View } from 'react-native';
|
|
9
|
+
|
|
9
10
|
import { cn } from './lib/utils';
|
|
10
11
|
|
|
11
12
|
function InputOTP({ className, containerClassName, ...props }: React.ComponentProps<typeof View> & InputOTPBaseProps) {
|
|
@@ -23,7 +24,11 @@ function InputOTPGroup({ className, ...props }: React.ComponentProps<typeof View
|
|
|
23
24
|
return <View className={className} {...props} />;
|
|
24
25
|
}
|
|
25
26
|
|
|
26
|
-
function InputOTPSlot({
|
|
27
|
+
function InputOTPSlot({
|
|
28
|
+
className,
|
|
29
|
+
index: _index,
|
|
30
|
+
...props
|
|
31
|
+
}: React.ComponentProps<typeof View> & InputOTPSlotBaseProps) {
|
|
27
32
|
return <View className={className} {...props} />;
|
|
28
33
|
}
|
|
29
34
|
|
package/src/input.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import type { InputBaseProps } from '@gv-tech/ui-core';
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
import { TextInput } from 'react-native';
|
|
3
4
|
|
|
4
|
-
import type { InputBaseProps } from '@gv-tech/ui-core';
|
|
5
5
|
import { cn } from './lib/utils';
|
|
6
6
|
|
|
7
7
|
export interface InputProps extends React.ComponentPropsWithoutRef<typeof TextInput>, InputBaseProps {}
|
package/src/item.tsx
CHANGED
|
@@ -11,10 +11,16 @@ import type {
|
|
|
11
11
|
ItemTitleBaseProps,
|
|
12
12
|
} from '@gv-tech/ui-core';
|
|
13
13
|
import { View } from 'react-native';
|
|
14
|
+
|
|
14
15
|
import { cn } from './lib/utils';
|
|
15
16
|
import { Text } from './text';
|
|
16
17
|
|
|
17
|
-
function Item({
|
|
18
|
+
function Item({
|
|
19
|
+
className,
|
|
20
|
+
variant: _variant,
|
|
21
|
+
size: _size,
|
|
22
|
+
...props
|
|
23
|
+
}: React.ComponentProps<typeof View> & ItemBaseProps) {
|
|
18
24
|
return (
|
|
19
25
|
<View className={cn('flex flex-row flex-wrap items-center gap-2 rounded-lg border p-3', className)} {...props} />
|
|
20
26
|
);
|
|
@@ -44,13 +50,13 @@ function ItemHeader({ className, ...props }: React.ComponentProps<typeof View> &
|
|
|
44
50
|
return <View className={cn('flex w-full flex-row items-center justify-between gap-2', className)} {...props} />;
|
|
45
51
|
}
|
|
46
52
|
|
|
47
|
-
function ItemMedia({ className, variant, ...props }: React.ComponentProps<typeof View> & ItemMediaBaseProps) {
|
|
53
|
+
function ItemMedia({ className, variant: _variant, ...props }: React.ComponentProps<typeof View> & ItemMediaBaseProps) {
|
|
48
54
|
return <View className={cn('flex shrink-0 items-center justify-center gap-2', className)} {...props} />;
|
|
49
55
|
}
|
|
50
56
|
|
|
51
57
|
function ItemSeparator({
|
|
52
58
|
className,
|
|
53
|
-
orientation,
|
|
59
|
+
orientation: _orientation,
|
|
54
60
|
...props
|
|
55
61
|
}: React.ComponentProps<typeof View> & ItemSeparatorBaseProps) {
|
|
56
62
|
return <View className={cn('bg-border my-2 h-px w-full', className)} {...props} />;
|
package/src/kbd.tsx
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { KbdBaseProps, KbdGroupBaseProps } from '@gv-tech/ui-core';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { Text, View } from 'react-native';
|
|
4
|
+
|
|
4
5
|
import { cn } from './lib/utils';
|
|
5
6
|
|
|
6
7
|
function Kbd({ className, ...props }: React.ComponentProps<typeof Text> & KbdBaseProps) {
|
package/src/marker.tsx
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { MarkerBaseProps, MarkerContentBaseProps, MarkerIconBaseProps } from '@gv-tech/ui-core';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { View } from 'react-native';
|
|
4
|
+
|
|
5
|
+
// Web-first stub: structure-only passthrough until the full native
|
|
6
|
+
// implementation lands. See docs/reference/parity-matrix.md.
|
|
7
|
+
export const Marker: React.FC<MarkerBaseProps> = ({ children, className }) => {
|
|
8
|
+
return <View className={className}>{children}</View>;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const MarkerIcon: React.FC<MarkerIconBaseProps> = ({ children, className }) => {
|
|
12
|
+
return <View className={className}>{children}</View>;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const MarkerContent: React.FC<MarkerContentBaseProps> = ({ children, className }) => {
|
|
16
|
+
return <View className={className}>{children}</View>;
|
|
17
|
+
};
|
package/src/menubar.tsx
CHANGED
|
@@ -16,6 +16,7 @@ import { Check, ChevronRight, Circle } from 'lucide-react-native';
|
|
|
16
16
|
import * as React from 'react';
|
|
17
17
|
import { Platform, StyleSheet, View } from 'react-native';
|
|
18
18
|
import Animated, { FadeIn, FadeOut } from 'react-native-reanimated';
|
|
19
|
+
|
|
19
20
|
import { wrapTextChildren } from './lib/render-native';
|
|
20
21
|
import { cn } from './lib/utils';
|
|
21
22
|
import { Text } from './text';
|