@a2ui-sdk/react 0.0.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/dist/0.8/A2UIRenderer.d.ts +31 -0
- package/dist/0.8/A2UIRenderer.js +19 -0
- package/dist/0.8/components/ComponentRenderer.d.ts +39 -0
- package/dist/0.8/components/ComponentRenderer.js +76 -0
- package/dist/0.8/components/UnknownComponent.d.ts +18 -0
- package/dist/0.8/components/display/AudioPlayerComponent.d.ts +5 -0
- package/dist/0.8/components/display/AudioPlayerComponent.js +19 -0
- package/dist/0.8/components/display/DividerComponent.d.ts +5 -0
- package/dist/0.8/components/display/DividerComponent.js +18 -0
- package/dist/0.8/components/display/IconComponent.d.ts +5 -0
- package/dist/0.8/components/display/IconComponent.js +68 -0
- package/dist/0.8/components/display/ImageComponent.d.ts +6 -0
- package/dist/0.8/components/display/ImageComponent.js +36 -0
- package/dist/0.8/components/display/TextComponent.d.ts +6 -0
- package/dist/0.8/components/display/TextComponent.js +32 -0
- package/dist/0.8/components/display/VideoComponent.d.ts +5 -0
- package/dist/0.8/components/display/VideoComponent.js +18 -0
- package/dist/0.8/components/display/index.d.ts +9 -0
- package/dist/0.8/components/index.d.ts +7 -0
- package/dist/0.8/components/interactive/ButtonComponent.d.ts +5 -0
- package/dist/0.8/components/interactive/ButtonComponent.js +29 -0
- package/dist/0.8/components/interactive/CheckBoxComponent.d.ts +5 -0
- package/dist/0.8/components/interactive/CheckBoxComponent.js +27 -0
- package/dist/0.8/components/interactive/DateTimeInputComponent.d.ts +5 -0
- package/dist/0.8/components/interactive/DateTimeInputComponent.js +46 -0
- package/dist/0.8/components/interactive/MultipleChoiceComponent.d.ts +7 -0
- package/dist/0.8/components/interactive/MultipleChoiceComponent.js +89 -0
- package/dist/0.8/components/interactive/SliderComponent.d.ts +5 -0
- package/dist/0.8/components/interactive/SliderComponent.js +48 -0
- package/dist/0.8/components/interactive/TextFieldComponent.d.ts +5 -0
- package/dist/0.8/components/interactive/TextFieldComponent.js +44 -0
- package/dist/0.8/components/interactive/index.d.ts +9 -0
- package/dist/0.8/components/layout/CardComponent.d.ts +5 -0
- package/dist/0.8/components/layout/CardComponent.js +14 -0
- package/dist/0.8/components/layout/ColumnComponent.d.ts +5 -0
- package/dist/0.8/components/layout/ColumnComponent.js +58 -0
- package/dist/0.8/components/layout/ListComponent.d.ts +5 -0
- package/dist/0.8/components/layout/ListComponent.js +51 -0
- package/dist/0.8/components/layout/ModalComponent.d.ts +5 -0
- package/dist/0.8/components/layout/ModalComponent.js +25 -0
- package/dist/0.8/components/layout/RowComponent.d.ts +5 -0
- package/dist/0.8/components/layout/RowComponent.js +58 -0
- package/dist/0.8/components/layout/TabsComponent.d.ts +5 -0
- package/dist/0.8/components/layout/TabsComponent.js +29 -0
- package/dist/0.8/components/layout/index.d.ts +9 -0
- package/dist/0.8/contexts/A2UIProvider.d.ts +56 -0
- package/dist/0.8/contexts/A2UIProvider.js +33 -0
- package/dist/0.8/contexts/ActionContext.d.ts +33 -0
- package/dist/0.8/contexts/ActionContext.js +41 -0
- package/dist/0.8/contexts/ComponentsMapContext.d.ts +63 -0
- package/dist/0.8/contexts/ComponentsMapContext.js +21 -0
- package/dist/0.8/contexts/DataModelContext.d.ts +43 -0
- package/dist/0.8/contexts/DataModelContext.js +86 -0
- package/dist/0.8/contexts/SurfaceContext.d.ts +45 -0
- package/dist/0.8/contexts/SurfaceContext.js +88 -0
- package/dist/0.8/hooks/useA2UIMessageHandler.d.ts +41 -0
- package/dist/0.8/hooks/useA2UIMessageHandler.js +54 -0
- package/dist/0.8/hooks/useComponent.d.ts +23 -0
- package/dist/0.8/hooks/useComponent.js +9 -0
- package/dist/0.8/hooks/useDataBinding.d.ts +50 -0
- package/dist/0.8/hooks/useDataBinding.js +28 -0
- package/dist/0.8/hooks/useDispatchAction.d.ts +22 -0
- package/dist/0.8/hooks/useDispatchAction.js +8 -0
- package/dist/0.8/index.d.ts +44 -0
- package/dist/0.8/index.js +17 -0
- package/dist/0.8/utils/dataBinding.d.ts +95 -0
- package/dist/0.8/utils/dataBinding.js +46 -0
- package/dist/0.8/utils/pathUtils.d.ts +63 -0
- package/dist/0.8/utils/pathUtils.js +44 -0
- package/dist/0.9/A2UIRenderer.d.ts +54 -0
- package/dist/0.9/A2UIRenderer.js +41 -0
- package/dist/0.9/components/ComponentRenderer.d.ts +39 -0
- package/dist/0.9/components/ComponentRenderer.js +34 -0
- package/dist/0.9/components/UnknownComponent.d.ts +11 -0
- package/dist/0.9/components/UnknownComponent.js +35 -0
- package/dist/0.9/components/display/AudioPlayerComponent.d.ts +5 -0
- package/dist/0.9/components/display/AudioPlayerComponent.js +21 -0
- package/dist/0.9/components/display/DividerComponent.d.ts +5 -0
- package/dist/0.9/components/display/DividerComponent.js +19 -0
- package/dist/0.9/components/display/IconComponent.d.ts +5 -0
- package/dist/0.9/components/display/IconComponent.js +68 -0
- package/dist/0.9/components/display/ImageComponent.d.ts +6 -0
- package/dist/0.9/components/display/ImageComponent.js +43 -0
- package/dist/0.9/components/display/TextComponent.d.ts +6 -0
- package/dist/0.9/components/display/TextComponent.js +31 -0
- package/dist/0.9/components/display/VideoComponent.d.ts +5 -0
- package/dist/0.9/components/display/VideoComponent.js +30 -0
- package/dist/0.9/components/display/index.d.ts +9 -0
- package/dist/0.9/components/index.d.ts +12 -0
- package/dist/0.9/components/index.js +68 -0
- package/dist/0.9/components/interactive/ButtonComponent.d.ts +6 -0
- package/dist/0.9/components/interactive/ButtonComponent.js +29 -0
- package/dist/0.9/components/interactive/CheckBoxComponent.d.ts +5 -0
- package/dist/0.9/components/interactive/CheckBoxComponent.js +41 -0
- package/dist/0.9/components/interactive/ChoicePickerComponent.d.ts +7 -0
- package/dist/0.9/components/interactive/ChoicePickerComponent.js +80 -0
- package/dist/0.9/components/interactive/DateTimeInputComponent.d.ts +5 -0
- package/dist/0.9/components/interactive/DateTimeInputComponent.js +50 -0
- package/dist/0.9/components/interactive/SliderComponent.d.ts +6 -0
- package/dist/0.9/components/interactive/SliderComponent.js +47 -0
- package/dist/0.9/components/interactive/TextFieldComponent.d.ts +5 -0
- package/dist/0.9/components/interactive/TextFieldComponent.js +57 -0
- package/dist/0.9/components/interactive/index.d.ts +9 -0
- package/dist/0.9/components/layout/CardComponent.d.ts +5 -0
- package/dist/0.9/components/layout/CardComponent.js +15 -0
- package/dist/0.9/components/layout/ColumnComponent.d.ts +6 -0
- package/dist/0.9/components/layout/ColumnComponent.js +50 -0
- package/dist/0.9/components/layout/ListComponent.d.ts +17 -0
- package/dist/0.9/components/layout/ListComponent.js +42 -0
- package/dist/0.9/components/layout/ModalComponent.d.ts +5 -0
- package/dist/0.9/components/layout/ModalComponent.js +30 -0
- package/dist/0.9/components/layout/RowComponent.d.ts +6 -0
- package/dist/0.9/components/layout/RowComponent.js +50 -0
- package/dist/0.9/components/layout/TabsComponent.d.ts +5 -0
- package/dist/0.9/components/layout/TabsComponent.js +30 -0
- package/dist/0.9/components/layout/TemplateRenderer.d.ts +25 -0
- package/dist/0.9/components/layout/TemplateRenderer.js +49 -0
- package/dist/0.9/components/layout/index.d.ts +10 -0
- package/dist/0.9/contexts/A2UIProvider.d.ts +58 -0
- package/dist/0.9/contexts/A2UIProvider.js +34 -0
- package/dist/0.9/contexts/ActionContext.d.ts +33 -0
- package/dist/0.9/contexts/ActionContext.js +47 -0
- package/dist/0.9/contexts/ComponentsMapContext.d.ts +73 -0
- package/dist/0.9/contexts/ComponentsMapContext.js +21 -0
- package/dist/0.9/contexts/ScopeContext.d.ts +53 -0
- package/dist/0.9/contexts/ScopeContext.js +22 -0
- package/dist/0.9/contexts/SurfaceContext.d.ts +50 -0
- package/dist/0.9/contexts/SurfaceContext.js +118 -0
- package/dist/0.9/hooks/useA2UIMessageHandler.d.ts +44 -0
- package/dist/0.9/hooks/useA2UIMessageHandler.js +87 -0
- package/dist/0.9/hooks/useComponent.d.ts +23 -0
- package/dist/0.9/hooks/useComponent.js +9 -0
- package/dist/0.9/hooks/useDataBinding.d.ts +59 -0
- package/dist/0.9/hooks/useDataBinding.js +43 -0
- package/dist/0.9/hooks/useDispatchAction.d.ts +22 -0
- package/dist/0.9/hooks/useDispatchAction.js +17 -0
- package/dist/0.9/hooks/useValidation.d.ts +25 -0
- package/dist/0.9/hooks/useValidation.js +14 -0
- package/dist/0.9/index.d.ts +35 -0
- package/dist/0.9/index.js +26 -0
- package/dist/0.9/utils/dataBinding.d.ts +126 -0
- package/dist/0.9/utils/dataBinding.js +41 -0
- package/dist/0.9/utils/pathUtils.d.ts +109 -0
- package/dist/0.9/utils/pathUtils.js +74 -0
- package/dist/0.9/utils/validation.d.ts +49 -0
- package/dist/0.9/utils/validation.js +75 -0
- package/dist/components/ui/button.d.ts +10 -0
- package/dist/components/ui/button.js +53 -0
- package/dist/components/ui/card.d.ts +9 -0
- package/dist/components/ui/card.js +29 -0
- package/dist/components/ui/checkbox.d.ts +4 -0
- package/dist/components/ui/checkbox.js +31 -0
- package/dist/components/ui/dialog.d.ts +15 -0
- package/dist/components/ui/dialog.js +77 -0
- package/dist/components/ui/input.d.ts +3 -0
- package/dist/components/ui/input.js +21 -0
- package/dist/components/ui/label.d.ts +4 -0
- package/dist/components/ui/label.js +22 -0
- package/dist/components/ui/native-select.d.ts +7 -0
- package/dist/components/ui/select.d.ts +15 -0
- package/dist/components/ui/select.js +144 -0
- package/dist/components/ui/separator.d.ts +4 -0
- package/dist/components/ui/separator.js +26 -0
- package/dist/components/ui/slider.d.ts +4 -0
- package/dist/components/ui/slider.js +63 -0
- package/dist/components/ui/tabs.d.ts +7 -0
- package/dist/components/ui/tabs.js +67 -0
- package/dist/components/ui/textarea.d.ts +3 -0
- package/dist/components/ui/textarea.js +18 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +6 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/lib/utils.js +8 -0
- package/package.json +75 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
3
|
+
declare function Select({ ...props }: React.ComponentProps<typeof SelectPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function SelectGroup({ ...props }: React.ComponentProps<typeof SelectPrimitive.Group>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function SelectValue({ ...props }: React.ComponentProps<typeof SelectPrimitive.Value>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare function SelectTrigger({ className, size, children, ...props }: React.ComponentProps<typeof SelectPrimitive.Trigger> & {
|
|
7
|
+
size?: 'sm' | 'default';
|
|
8
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare function SelectContent({ className, children, position, align, ...props }: React.ComponentProps<typeof SelectPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
declare function SelectLabel({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Label>): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
declare function SelectItem({ className, children, ...props }: React.ComponentProps<typeof SelectPrimitive.Item>): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
declare function SelectSeparator({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Separator>): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
declare function SelectScrollUpButton({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
declare function SelectScrollDownButton({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, };
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { jsx as e, jsxs as i } from "react/jsx-runtime";
|
|
2
|
+
import * as a from "@radix-ui/react-select";
|
|
3
|
+
import { ChevronDownIcon as l, CheckIcon as c, ChevronUpIcon as u } from "lucide-react";
|
|
4
|
+
import { cn as o } from "../../lib/utils.js";
|
|
5
|
+
function h({
|
|
6
|
+
...t
|
|
7
|
+
}) {
|
|
8
|
+
return /* @__PURE__ */ e(a.Root, { "data-slot": "select", ...t });
|
|
9
|
+
}
|
|
10
|
+
function x({
|
|
11
|
+
...t
|
|
12
|
+
}) {
|
|
13
|
+
return /* @__PURE__ */ e(a.Value, { "data-slot": "select-value", ...t });
|
|
14
|
+
}
|
|
15
|
+
function b({
|
|
16
|
+
className: t,
|
|
17
|
+
size: s = "default",
|
|
18
|
+
children: r,
|
|
19
|
+
...n
|
|
20
|
+
}) {
|
|
21
|
+
return /* @__PURE__ */ i(
|
|
22
|
+
a.Trigger,
|
|
23
|
+
{
|
|
24
|
+
"data-slot": "select-trigger",
|
|
25
|
+
"data-size": s,
|
|
26
|
+
className: o(
|
|
27
|
+
"border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
28
|
+
t
|
|
29
|
+
),
|
|
30
|
+
...n,
|
|
31
|
+
children: [
|
|
32
|
+
r,
|
|
33
|
+
/* @__PURE__ */ e(a.Icon, { asChild: !0, children: /* @__PURE__ */ e(l, { className: "size-4 opacity-50" }) })
|
|
34
|
+
]
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
function w({
|
|
39
|
+
className: t,
|
|
40
|
+
children: s,
|
|
41
|
+
position: r = "item-aligned",
|
|
42
|
+
align: n = "center",
|
|
43
|
+
...d
|
|
44
|
+
}) {
|
|
45
|
+
return /* @__PURE__ */ e(a.Portal, { children: /* @__PURE__ */ i(
|
|
46
|
+
a.Content,
|
|
47
|
+
{
|
|
48
|
+
"data-slot": "select-content",
|
|
49
|
+
className: o(
|
|
50
|
+
"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]: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 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",
|
|
51
|
+
r === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
52
|
+
t
|
|
53
|
+
),
|
|
54
|
+
position: r,
|
|
55
|
+
align: n,
|
|
56
|
+
...d,
|
|
57
|
+
children: [
|
|
58
|
+
/* @__PURE__ */ e(m, {}),
|
|
59
|
+
/* @__PURE__ */ e(
|
|
60
|
+
a.Viewport,
|
|
61
|
+
{
|
|
62
|
+
className: o(
|
|
63
|
+
"p-1",
|
|
64
|
+
r === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"
|
|
65
|
+
),
|
|
66
|
+
children: s
|
|
67
|
+
}
|
|
68
|
+
),
|
|
69
|
+
/* @__PURE__ */ e(p, {})
|
|
70
|
+
]
|
|
71
|
+
}
|
|
72
|
+
) });
|
|
73
|
+
}
|
|
74
|
+
function y({
|
|
75
|
+
className: t,
|
|
76
|
+
children: s,
|
|
77
|
+
...r
|
|
78
|
+
}) {
|
|
79
|
+
return /* @__PURE__ */ i(
|
|
80
|
+
a.Item,
|
|
81
|
+
{
|
|
82
|
+
"data-slot": "select-item",
|
|
83
|
+
className: o(
|
|
84
|
+
"focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
|
|
85
|
+
t
|
|
86
|
+
),
|
|
87
|
+
...r,
|
|
88
|
+
children: [
|
|
89
|
+
/* @__PURE__ */ e(
|
|
90
|
+
"span",
|
|
91
|
+
{
|
|
92
|
+
"data-slot": "select-item-indicator",
|
|
93
|
+
className: "absolute right-2 flex size-3.5 items-center justify-center",
|
|
94
|
+
children: /* @__PURE__ */ e(a.ItemIndicator, { children: /* @__PURE__ */ e(c, { className: "size-4" }) })
|
|
95
|
+
}
|
|
96
|
+
),
|
|
97
|
+
/* @__PURE__ */ e(a.ItemText, { children: s })
|
|
98
|
+
]
|
|
99
|
+
}
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
function m({
|
|
103
|
+
className: t,
|
|
104
|
+
...s
|
|
105
|
+
}) {
|
|
106
|
+
return /* @__PURE__ */ e(
|
|
107
|
+
a.ScrollUpButton,
|
|
108
|
+
{
|
|
109
|
+
"data-slot": "select-scroll-up-button",
|
|
110
|
+
className: o(
|
|
111
|
+
"flex cursor-default items-center justify-center py-1",
|
|
112
|
+
t
|
|
113
|
+
),
|
|
114
|
+
...s,
|
|
115
|
+
children: /* @__PURE__ */ e(u, { className: "size-4" })
|
|
116
|
+
}
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
function p({
|
|
120
|
+
className: t,
|
|
121
|
+
...s
|
|
122
|
+
}) {
|
|
123
|
+
return /* @__PURE__ */ e(
|
|
124
|
+
a.ScrollDownButton,
|
|
125
|
+
{
|
|
126
|
+
"data-slot": "select-scroll-down-button",
|
|
127
|
+
className: o(
|
|
128
|
+
"flex cursor-default items-center justify-center py-1",
|
|
129
|
+
t
|
|
130
|
+
),
|
|
131
|
+
...s,
|
|
132
|
+
children: /* @__PURE__ */ e(l, { className: "size-4" })
|
|
133
|
+
}
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
export {
|
|
137
|
+
h as Select,
|
|
138
|
+
w as SelectContent,
|
|
139
|
+
y as SelectItem,
|
|
140
|
+
p as SelectScrollDownButton,
|
|
141
|
+
m as SelectScrollUpButton,
|
|
142
|
+
b as SelectTrigger,
|
|
143
|
+
x as SelectValue
|
|
144
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as SeparatorPrimitive from '@radix-ui/react-separator';
|
|
3
|
+
declare function Separator({ className, orientation, decorative, ...props }: React.ComponentProps<typeof SeparatorPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export { Separator };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import * as n from "@radix-ui/react-separator";
|
|
3
|
+
import { cn as e } from "../../lib/utils.js";
|
|
4
|
+
function m({
|
|
5
|
+
className: t,
|
|
6
|
+
orientation: o = "horizontal",
|
|
7
|
+
decorative: r = !0,
|
|
8
|
+
...a
|
|
9
|
+
}) {
|
|
10
|
+
return /* @__PURE__ */ i(
|
|
11
|
+
n.Root,
|
|
12
|
+
{
|
|
13
|
+
"data-slot": "separator",
|
|
14
|
+
decorative: r,
|
|
15
|
+
orientation: o,
|
|
16
|
+
className: e(
|
|
17
|
+
"bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",
|
|
18
|
+
t
|
|
19
|
+
),
|
|
20
|
+
...a
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
export {
|
|
25
|
+
m as Separator
|
|
26
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as SliderPrimitive from '@radix-ui/react-slider';
|
|
3
|
+
declare function Slider({ className, defaultValue, value, min, max, ...props }: React.ComponentProps<typeof SliderPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export { Slider };
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { jsxs as h, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import * as m from "react";
|
|
3
|
+
import * as a from "@radix-ui/react-slider";
|
|
4
|
+
import { cn as n } from "../../lib/utils.js";
|
|
5
|
+
function v({
|
|
6
|
+
className: l,
|
|
7
|
+
defaultValue: r,
|
|
8
|
+
value: t,
|
|
9
|
+
min: i = 0,
|
|
10
|
+
max: o = 100,
|
|
11
|
+
...s
|
|
12
|
+
}) {
|
|
13
|
+
const d = m.useMemo(
|
|
14
|
+
() => Array.isArray(t) ? t : Array.isArray(r) ? r : [i, o],
|
|
15
|
+
[t, r, i, o]
|
|
16
|
+
);
|
|
17
|
+
return /* @__PURE__ */ h(
|
|
18
|
+
a.Root,
|
|
19
|
+
{
|
|
20
|
+
"data-slot": "slider",
|
|
21
|
+
defaultValue: r,
|
|
22
|
+
value: t,
|
|
23
|
+
min: i,
|
|
24
|
+
max: o,
|
|
25
|
+
className: n(
|
|
26
|
+
"relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",
|
|
27
|
+
l
|
|
28
|
+
),
|
|
29
|
+
...s,
|
|
30
|
+
children: [
|
|
31
|
+
/* @__PURE__ */ e(
|
|
32
|
+
a.Track,
|
|
33
|
+
{
|
|
34
|
+
"data-slot": "slider-track",
|
|
35
|
+
className: n(
|
|
36
|
+
"bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"
|
|
37
|
+
),
|
|
38
|
+
children: /* @__PURE__ */ e(
|
|
39
|
+
a.Range,
|
|
40
|
+
{
|
|
41
|
+
"data-slot": "slider-range",
|
|
42
|
+
className: n(
|
|
43
|
+
"bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full"
|
|
44
|
+
)
|
|
45
|
+
}
|
|
46
|
+
)
|
|
47
|
+
}
|
|
48
|
+
),
|
|
49
|
+
Array.from({ length: d.length }, (f, c) => /* @__PURE__ */ e(
|
|
50
|
+
a.Thumb,
|
|
51
|
+
{
|
|
52
|
+
"data-slot": "slider-thumb",
|
|
53
|
+
className: "border-primary ring-ring/50 block size-4 shrink-0 rounded-full border bg-white shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"
|
|
54
|
+
},
|
|
55
|
+
c
|
|
56
|
+
))
|
|
57
|
+
]
|
|
58
|
+
}
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
export {
|
|
62
|
+
v as Slider
|
|
63
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as TabsPrimitive from '@radix-ui/react-tabs';
|
|
3
|
+
declare function Tabs({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function TabsList({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.List>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function TabsTrigger({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare function TabsContent({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export { Tabs, TabsList, TabsTrigger, TabsContent };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import * as s from "@radix-ui/react-tabs";
|
|
3
|
+
import { cn as i } from "../../lib/utils.js";
|
|
4
|
+
function o({
|
|
5
|
+
className: t,
|
|
6
|
+
...e
|
|
7
|
+
}) {
|
|
8
|
+
return /* @__PURE__ */ a(
|
|
9
|
+
s.Root,
|
|
10
|
+
{
|
|
11
|
+
"data-slot": "tabs",
|
|
12
|
+
className: i("flex flex-col gap-2", t),
|
|
13
|
+
...e
|
|
14
|
+
}
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
function d({
|
|
18
|
+
className: t,
|
|
19
|
+
...e
|
|
20
|
+
}) {
|
|
21
|
+
return /* @__PURE__ */ a(
|
|
22
|
+
s.List,
|
|
23
|
+
{
|
|
24
|
+
"data-slot": "tabs-list",
|
|
25
|
+
className: i(
|
|
26
|
+
"bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",
|
|
27
|
+
t
|
|
28
|
+
),
|
|
29
|
+
...e
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
function c({
|
|
34
|
+
className: t,
|
|
35
|
+
...e
|
|
36
|
+
}) {
|
|
37
|
+
return /* @__PURE__ */ a(
|
|
38
|
+
s.Trigger,
|
|
39
|
+
{
|
|
40
|
+
"data-slot": "tabs-trigger",
|
|
41
|
+
className: i(
|
|
42
|
+
"data-[state=active]:bg-background dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
43
|
+
t
|
|
44
|
+
),
|
|
45
|
+
...e
|
|
46
|
+
}
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
function l({
|
|
50
|
+
className: t,
|
|
51
|
+
...e
|
|
52
|
+
}) {
|
|
53
|
+
return /* @__PURE__ */ a(
|
|
54
|
+
s.Content,
|
|
55
|
+
{
|
|
56
|
+
"data-slot": "tabs-content",
|
|
57
|
+
className: i("flex-1 outline-none", t),
|
|
58
|
+
...e
|
|
59
|
+
}
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
export {
|
|
63
|
+
o as Tabs,
|
|
64
|
+
l as TabsContent,
|
|
65
|
+
d as TabsList,
|
|
66
|
+
c as TabsTrigger
|
|
67
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { cn as t } from "../../lib/utils.js";
|
|
3
|
+
function n({ className: r, ...e }) {
|
|
4
|
+
return /* @__PURE__ */ i(
|
|
5
|
+
"textarea",
|
|
6
|
+
{
|
|
7
|
+
"data-slot": "textarea",
|
|
8
|
+
className: t(
|
|
9
|
+
"border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
|
|
10
|
+
r
|
|
11
|
+
),
|
|
12
|
+
...e
|
|
13
|
+
}
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
export {
|
|
17
|
+
n as Textarea
|
|
18
|
+
};
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@a2ui-sdk/react",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"description": "A2UI SDK for React",
|
|
5
|
+
"homepage": "https://easyops-cn.github.io/a2ui-sdk/",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git@github.com:easyops-cn/a2ui-sdk.git",
|
|
9
|
+
"directory": "packages/react"
|
|
10
|
+
},
|
|
11
|
+
"type": "module",
|
|
12
|
+
"main": "./dist/index.js",
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"default": "./dist/index.js"
|
|
18
|
+
},
|
|
19
|
+
"./0.8": {
|
|
20
|
+
"types": "./dist/0.8/index.d.ts",
|
|
21
|
+
"default": "./dist/0.8/index.js"
|
|
22
|
+
},
|
|
23
|
+
"./0.9": {
|
|
24
|
+
"types": "./dist/0.9/index.d.ts",
|
|
25
|
+
"default": "./dist/0.9/index.js"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"files": [
|
|
29
|
+
"dist"
|
|
30
|
+
],
|
|
31
|
+
"scripts": {
|
|
32
|
+
"dev": "vite",
|
|
33
|
+
"build": "tsc -b && vite build",
|
|
34
|
+
"test": "vitest",
|
|
35
|
+
"test:run": "vitest run",
|
|
36
|
+
"test:coverage": "vitest run --coverage"
|
|
37
|
+
},
|
|
38
|
+
"license": "Apache-2.0",
|
|
39
|
+
"peerDependencies": {
|
|
40
|
+
"react": "^19.0.0",
|
|
41
|
+
"react-dom": "^19.0.0"
|
|
42
|
+
},
|
|
43
|
+
"devDependencies": {
|
|
44
|
+
"@a2ui-sdk/types": "^0.0.0",
|
|
45
|
+
"@a2ui-sdk/utils": "^0.0.0",
|
|
46
|
+
"@testing-library/dom": "^10.4.1",
|
|
47
|
+
"@testing-library/jest-dom": "^6.9.1",
|
|
48
|
+
"@testing-library/react": "^16.3.1",
|
|
49
|
+
"@testing-library/user-event": "^14.6.1",
|
|
50
|
+
"@vitejs/plugin-react": "^5.1.2",
|
|
51
|
+
"@vitest/coverage-v8": "^4.0.16",
|
|
52
|
+
"jsdom": "^27.4.0",
|
|
53
|
+
"react": "^19.2.3",
|
|
54
|
+
"react-dom": "^19.2.3",
|
|
55
|
+
"typescript": "~5.9.3",
|
|
56
|
+
"vite": "^7.3.1",
|
|
57
|
+
"vite-plugin-dts": "^4.5.4",
|
|
58
|
+
"vite-tsconfig-paths": "^6.0.4",
|
|
59
|
+
"vitest": "^4.0.16"
|
|
60
|
+
},
|
|
61
|
+
"dependencies": {
|
|
62
|
+
"@radix-ui/react-checkbox": "^1.3.3",
|
|
63
|
+
"@radix-ui/react-dialog": "^1.1.15",
|
|
64
|
+
"@radix-ui/react-label": "^2.1.8",
|
|
65
|
+
"@radix-ui/react-select": "^2.2.6",
|
|
66
|
+
"@radix-ui/react-separator": "^1.1.8",
|
|
67
|
+
"@radix-ui/react-slider": "^1.3.6",
|
|
68
|
+
"@radix-ui/react-slot": "^1.2.4",
|
|
69
|
+
"@radix-ui/react-tabs": "^1.1.13",
|
|
70
|
+
"class-variance-authority": "^0.7.1",
|
|
71
|
+
"clsx": "^2.1.1",
|
|
72
|
+
"lucide-react": "^0.562.0",
|
|
73
|
+
"tailwind-merge": "^3.4.0"
|
|
74
|
+
}
|
|
75
|
+
}
|