@easyops-cn/a2ui-react 0.0.4 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -7
- package/dist/0.8/A2UIRenderer.d.ts +43 -35
- package/dist/0.8/A2UIRenderer.js +12 -34
- package/dist/0.8/components/display/AudioPlayerComponent.js +2 -2
- package/dist/0.8/components/display/DividerComponent.js +1 -1
- package/dist/0.8/components/display/IconComponent.js +2 -2
- package/dist/0.8/components/display/ImageComponent.js +2 -2
- package/dist/0.8/components/display/TextComponent.js +2 -2
- package/dist/0.8/components/display/VideoComponent.js +2 -2
- package/dist/0.8/components/interactive/ButtonComponent.js +2 -2
- package/dist/0.8/components/interactive/CheckBoxComponent.js +4 -4
- package/dist/0.8/components/interactive/DateTimeInputComponent.js +6 -6
- package/dist/0.8/components/interactive/MultipleChoiceComponent.js +5 -5
- package/dist/0.8/components/interactive/SliderComponent.js +3 -3
- package/dist/0.8/components/interactive/TextFieldComponent.js +5 -5
- package/dist/0.8/components/layout/CardComponent.js +1 -1
- package/dist/0.8/components/layout/ColumnComponent.js +3 -3
- package/dist/0.8/components/layout/ListComponent.js +3 -3
- package/dist/0.8/components/layout/ModalComponent.js +1 -1
- package/dist/0.8/components/layout/RowComponent.js +3 -3
- package/dist/0.8/components/layout/TabsComponent.js +2 -2
- package/dist/0.8/contexts/A2UIProvider.d.ts +40 -13
- package/dist/0.8/contexts/A2UIProvider.js +32 -7
- package/dist/0.8/hooks/useDataBinding.js +17 -12
- package/dist/0.8/index.d.ts +20 -2
- package/dist/0.8/index.js +13 -9
- package/dist/components/ui/button.js +53 -0
- package/dist/components/ui/calendar.js +173 -0
- package/dist/components/ui/card.js +29 -0
- package/dist/components/ui/checkbox.js +31 -0
- package/dist/components/ui/dialog.js +77 -0
- package/dist/components/ui/input.js +21 -0
- package/dist/components/ui/label.js +22 -0
- package/dist/components/ui/popover.js +38 -0
- package/dist/components/ui/select.js +144 -0
- package/dist/components/ui/separator.js +26 -0
- package/dist/components/ui/slider.js +63 -0
- package/dist/components/ui/tabs.js +67 -0
- package/dist/components/ui/textarea.js +18 -0
- package/dist/lib/utils.js +8 -0
- package/package.json +1 -1
- package/dist/0.8/A2UIRenderer.test.d.ts +0 -6
- package/dist/0.8/components/ComponentRenderer.test.d.ts +0 -6
- package/dist/0.8/components/display/display.test.d.ts +0 -7
- package/dist/0.8/components/interactive/interactive.test.d.ts +0 -7
- package/dist/0.8/components/layout/layout.test.d.ts +0 -7
- package/dist/0.8/contexts/A2UIProvider.test.d.ts +0 -6
- package/dist/0.8/contexts/ActionContext.test.d.ts +0 -6
- package/dist/0.8/contexts/DataModelContext.test.d.ts +0 -6
- package/dist/0.8/contexts/SurfaceContext.test.d.ts +0 -6
- package/dist/0.8/hooks/useA2UIMessageHandler.test.d.ts +0 -6
- package/dist/0.8/hooks/useComponent.test.d.ts +0 -6
- package/dist/0.8/hooks/useDataBinding.test.d.ts +0 -6
- package/dist/0.8/hooks/useDispatchAction.test.d.ts +0 -6
- package/dist/0.8/hooks/useSurface.test.d.ts +0 -6
- package/dist/0.8/utils/dataBinding.test.d.ts +0 -6
- package/dist/0.8/utils/pathUtils.test.d.ts +0 -6
package/dist/0.8/index.js
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { A2UIProvider as o } from "./contexts/A2UIProvider.js";
|
|
2
|
+
import { A2UIRenderer as t } from "./A2UIRenderer.js";
|
|
3
|
+
import { ComponentRenderer as p } from "./components/ComponentRenderer.js";
|
|
4
|
+
import { useDispatchAction as s } from "./hooks/useDispatchAction.js";
|
|
5
|
+
import { useDataBinding as f, useFormBinding as x } from "./hooks/useDataBinding.js";
|
|
6
|
+
import { useA2UIMessageHandler as u } from "./hooks/useA2UIMessageHandler.js";
|
|
5
7
|
export {
|
|
6
|
-
o as
|
|
7
|
-
t as
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
f as
|
|
8
|
+
o as A2UIProvider,
|
|
9
|
+
t as A2UIRenderer,
|
|
10
|
+
p as ComponentRenderer,
|
|
11
|
+
u as useA2UIMessageHandler,
|
|
12
|
+
f as useDataBinding,
|
|
13
|
+
s as useDispatchAction,
|
|
14
|
+
x as useFormBinding
|
|
11
15
|
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { Slot as a } from "@radix-ui/react-slot";
|
|
3
|
+
import { cva as s } from "class-variance-authority";
|
|
4
|
+
import { cn as d } from "../../lib/utils.js";
|
|
5
|
+
const u = s(
|
|
6
|
+
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
|
7
|
+
{
|
|
8
|
+
variants: {
|
|
9
|
+
variant: {
|
|
10
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
11
|
+
destructive: "bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
|
|
12
|
+
outline: "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
|
|
13
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
14
|
+
ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
|
|
15
|
+
link: "text-primary underline-offset-4 hover:underline"
|
|
16
|
+
},
|
|
17
|
+
size: {
|
|
18
|
+
default: "h-9 px-4 py-2 has-[>svg]:px-3",
|
|
19
|
+
sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
|
|
20
|
+
lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
|
|
21
|
+
icon: "size-9",
|
|
22
|
+
"icon-sm": "size-8",
|
|
23
|
+
"icon-lg": "size-10"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
defaultVariants: {
|
|
27
|
+
variant: "default",
|
|
28
|
+
size: "default"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
function b({
|
|
33
|
+
className: t,
|
|
34
|
+
variant: e = "default",
|
|
35
|
+
size: r = "default",
|
|
36
|
+
asChild: i = !1,
|
|
37
|
+
...n
|
|
38
|
+
}) {
|
|
39
|
+
return /* @__PURE__ */ o(
|
|
40
|
+
i ? a : "button",
|
|
41
|
+
{
|
|
42
|
+
"data-slot": "button",
|
|
43
|
+
"data-variant": e,
|
|
44
|
+
"data-size": r,
|
|
45
|
+
className: d(u({ variant: e, size: r, className: t })),
|
|
46
|
+
...n
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
export {
|
|
51
|
+
b as Button,
|
|
52
|
+
u as buttonVariants
|
|
53
|
+
};
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import * as m from "react";
|
|
3
|
+
import { ChevronLeftIcon as b, ChevronRightIcon as h, ChevronDownIcon as w } from "lucide-react";
|
|
4
|
+
import { getDefaultClassNames as p, DayPicker as _ } from "react-day-picker";
|
|
5
|
+
import { cn as e } from "../../lib/utils.js";
|
|
6
|
+
import { buttonVariants as f, Button as y } from "./button.js";
|
|
7
|
+
function j({
|
|
8
|
+
className: c,
|
|
9
|
+
classNames: i,
|
|
10
|
+
showOutsideDays: r = !0,
|
|
11
|
+
captionLayout: l = "label",
|
|
12
|
+
buttonVariant: s = "ghost",
|
|
13
|
+
formatters: u,
|
|
14
|
+
components: x,
|
|
15
|
+
...g
|
|
16
|
+
}) {
|
|
17
|
+
const t = p();
|
|
18
|
+
return /* @__PURE__ */ n(
|
|
19
|
+
_,
|
|
20
|
+
{
|
|
21
|
+
showOutsideDays: r,
|
|
22
|
+
className: e(
|
|
23
|
+
"bg-background group/calendar p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",
|
|
24
|
+
String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,
|
|
25
|
+
String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,
|
|
26
|
+
c
|
|
27
|
+
),
|
|
28
|
+
captionLayout: l,
|
|
29
|
+
formatters: {
|
|
30
|
+
formatMonthDropdown: (a) => a.toLocaleString("default", { month: "short" }),
|
|
31
|
+
...u
|
|
32
|
+
},
|
|
33
|
+
classNames: {
|
|
34
|
+
root: e("w-fit", t.root),
|
|
35
|
+
months: e(
|
|
36
|
+
"flex gap-4 flex-col md:flex-row relative",
|
|
37
|
+
t.months
|
|
38
|
+
),
|
|
39
|
+
month: e("flex flex-col w-full gap-4", t.month),
|
|
40
|
+
nav: e(
|
|
41
|
+
"flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between",
|
|
42
|
+
t.nav
|
|
43
|
+
),
|
|
44
|
+
button_previous: e(
|
|
45
|
+
f({ variant: s }),
|
|
46
|
+
"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",
|
|
47
|
+
t.button_previous
|
|
48
|
+
),
|
|
49
|
+
button_next: e(
|
|
50
|
+
f({ variant: s }),
|
|
51
|
+
"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",
|
|
52
|
+
t.button_next
|
|
53
|
+
),
|
|
54
|
+
month_caption: e(
|
|
55
|
+
"flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)",
|
|
56
|
+
t.month_caption
|
|
57
|
+
),
|
|
58
|
+
dropdowns: e(
|
|
59
|
+
"w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5",
|
|
60
|
+
t.dropdowns
|
|
61
|
+
),
|
|
62
|
+
dropdown_root: e(
|
|
63
|
+
"relative has-focus:border-ring border border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] rounded-md",
|
|
64
|
+
t.dropdown_root
|
|
65
|
+
),
|
|
66
|
+
dropdown: e(
|
|
67
|
+
"absolute bg-popover inset-0 opacity-0",
|
|
68
|
+
t.dropdown
|
|
69
|
+
),
|
|
70
|
+
caption_label: e(
|
|
71
|
+
"select-none font-medium",
|
|
72
|
+
l === "label" ? "text-sm" : "rounded-md pl-2 pr-1 flex items-center gap-1 text-sm h-8 [&>svg]:text-muted-foreground [&>svg]:size-3.5",
|
|
73
|
+
t.caption_label
|
|
74
|
+
),
|
|
75
|
+
table: "w-full border-collapse",
|
|
76
|
+
weekdays: e("flex", t.weekdays),
|
|
77
|
+
weekday: e(
|
|
78
|
+
"text-muted-foreground rounded-md flex-1 font-normal text-[0.8rem] select-none",
|
|
79
|
+
t.weekday
|
|
80
|
+
),
|
|
81
|
+
week: e("flex w-full mt-2", t.week),
|
|
82
|
+
week_number_header: e(
|
|
83
|
+
"select-none w-(--cell-size)",
|
|
84
|
+
t.week_number_header
|
|
85
|
+
),
|
|
86
|
+
week_number: e(
|
|
87
|
+
"text-[0.8rem] select-none text-muted-foreground",
|
|
88
|
+
t.week_number
|
|
89
|
+
),
|
|
90
|
+
day: e(
|
|
91
|
+
"relative w-full h-full p-0 text-center [&:last-child[data-selected=true]_button]:rounded-r-md group/day aspect-square select-none",
|
|
92
|
+
g.showWeekNumber ? "[&:nth-child(2)[data-selected=true]_button]:rounded-l-md" : "[&:first-child[data-selected=true]_button]:rounded-l-md",
|
|
93
|
+
t.day
|
|
94
|
+
),
|
|
95
|
+
range_start: e(
|
|
96
|
+
"rounded-l-md bg-accent",
|
|
97
|
+
t.range_start
|
|
98
|
+
),
|
|
99
|
+
range_middle: e("rounded-none", t.range_middle),
|
|
100
|
+
range_end: e("rounded-r-md bg-accent", t.range_end),
|
|
101
|
+
today: e(
|
|
102
|
+
"bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",
|
|
103
|
+
t.today
|
|
104
|
+
),
|
|
105
|
+
outside: e(
|
|
106
|
+
"text-muted-foreground aria-selected:text-muted-foreground",
|
|
107
|
+
t.outside
|
|
108
|
+
),
|
|
109
|
+
disabled: e(
|
|
110
|
+
"text-muted-foreground opacity-50",
|
|
111
|
+
t.disabled
|
|
112
|
+
),
|
|
113
|
+
hidden: e("invisible", t.hidden),
|
|
114
|
+
...i
|
|
115
|
+
},
|
|
116
|
+
components: {
|
|
117
|
+
Root: ({ className: a, rootRef: d, ...o }) => /* @__PURE__ */ n(
|
|
118
|
+
"div",
|
|
119
|
+
{
|
|
120
|
+
"data-slot": "calendar",
|
|
121
|
+
ref: d,
|
|
122
|
+
className: e(a),
|
|
123
|
+
...o
|
|
124
|
+
}
|
|
125
|
+
),
|
|
126
|
+
Chevron: ({ className: a, orientation: d, ...o }) => d === "left" ? /* @__PURE__ */ n(b, { className: e("size-4", a), ...o }) : d === "right" ? /* @__PURE__ */ n(
|
|
127
|
+
h,
|
|
128
|
+
{
|
|
129
|
+
className: e("size-4", a),
|
|
130
|
+
...o
|
|
131
|
+
}
|
|
132
|
+
) : /* @__PURE__ */ n(w, { className: e("size-4", a), ...o }),
|
|
133
|
+
DayButton: v,
|
|
134
|
+
WeekNumber: ({ children: a, ...d }) => /* @__PURE__ */ n("td", { ...d, children: /* @__PURE__ */ n("div", { className: "flex size-(--cell-size) items-center justify-center text-center", children: a }) }),
|
|
135
|
+
...x
|
|
136
|
+
},
|
|
137
|
+
...g
|
|
138
|
+
}
|
|
139
|
+
);
|
|
140
|
+
}
|
|
141
|
+
function v({
|
|
142
|
+
className: c,
|
|
143
|
+
day: i,
|
|
144
|
+
modifiers: r,
|
|
145
|
+
...l
|
|
146
|
+
}) {
|
|
147
|
+
const s = p(), u = m.useRef(null);
|
|
148
|
+
return m.useEffect(() => {
|
|
149
|
+
r.focused && u.current?.focus();
|
|
150
|
+
}, [r.focused]), /* @__PURE__ */ n(
|
|
151
|
+
y,
|
|
152
|
+
{
|
|
153
|
+
ref: u,
|
|
154
|
+
variant: "ghost",
|
|
155
|
+
size: "icon",
|
|
156
|
+
"data-day": i.date.toLocaleDateString(),
|
|
157
|
+
"data-selected-single": r.selected && !r.range_start && !r.range_end && !r.range_middle,
|
|
158
|
+
"data-range-start": r.range_start,
|
|
159
|
+
"data-range-end": r.range_end,
|
|
160
|
+
"data-range-middle": r.range_middle,
|
|
161
|
+
className: e(
|
|
162
|
+
"data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 dark:hover:text-accent-foreground flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md [&>span]:text-xs [&>span]:opacity-70",
|
|
163
|
+
s.day,
|
|
164
|
+
c
|
|
165
|
+
),
|
|
166
|
+
...l
|
|
167
|
+
}
|
|
168
|
+
);
|
|
169
|
+
}
|
|
170
|
+
export {
|
|
171
|
+
j as Calendar,
|
|
172
|
+
v as CalendarDayButton
|
|
173
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { cn as a } from "../../lib/utils.js";
|
|
3
|
+
function n({ className: r, ...o }) {
|
|
4
|
+
return /* @__PURE__ */ t(
|
|
5
|
+
"div",
|
|
6
|
+
{
|
|
7
|
+
"data-slot": "card",
|
|
8
|
+
className: a(
|
|
9
|
+
"bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",
|
|
10
|
+
r
|
|
11
|
+
),
|
|
12
|
+
...o
|
|
13
|
+
}
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
function c({ className: r, ...o }) {
|
|
17
|
+
return /* @__PURE__ */ t(
|
|
18
|
+
"div",
|
|
19
|
+
{
|
|
20
|
+
"data-slot": "card-content",
|
|
21
|
+
className: a("px-6", r),
|
|
22
|
+
...o
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
export {
|
|
27
|
+
n as Card,
|
|
28
|
+
c as CardContent
|
|
29
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import * as e from "@radix-ui/react-checkbox";
|
|
3
|
+
import { CheckIcon as t } from "lucide-react";
|
|
4
|
+
import { cn as o } from "../../lib/utils.js";
|
|
5
|
+
function s({
|
|
6
|
+
className: i,
|
|
7
|
+
...a
|
|
8
|
+
}) {
|
|
9
|
+
return /* @__PURE__ */ r(
|
|
10
|
+
e.Root,
|
|
11
|
+
{
|
|
12
|
+
"data-slot": "checkbox",
|
|
13
|
+
className: o(
|
|
14
|
+
"peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
|
|
15
|
+
i
|
|
16
|
+
),
|
|
17
|
+
...a,
|
|
18
|
+
children: /* @__PURE__ */ r(
|
|
19
|
+
e.Indicator,
|
|
20
|
+
{
|
|
21
|
+
"data-slot": "checkbox-indicator",
|
|
22
|
+
className: "grid place-content-center text-current transition-none",
|
|
23
|
+
children: /* @__PURE__ */ r(t, { className: "size-3.5" })
|
|
24
|
+
}
|
|
25
|
+
)
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
export {
|
|
30
|
+
s as Checkbox
|
|
31
|
+
};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { jsx as a, jsxs as n } from "react/jsx-runtime";
|
|
2
|
+
import * as o from "@radix-ui/react-dialog";
|
|
3
|
+
import { XIcon as l } from "lucide-react";
|
|
4
|
+
import { cn as i } from "../../lib/utils.js";
|
|
5
|
+
function m({
|
|
6
|
+
...t
|
|
7
|
+
}) {
|
|
8
|
+
return /* @__PURE__ */ a(o.Root, { "data-slot": "dialog", ...t });
|
|
9
|
+
}
|
|
10
|
+
function p({
|
|
11
|
+
...t
|
|
12
|
+
}) {
|
|
13
|
+
return /* @__PURE__ */ a(o.Trigger, { "data-slot": "dialog-trigger", ...t });
|
|
14
|
+
}
|
|
15
|
+
function d({
|
|
16
|
+
...t
|
|
17
|
+
}) {
|
|
18
|
+
return /* @__PURE__ */ a(o.Portal, { "data-slot": "dialog-portal", ...t });
|
|
19
|
+
}
|
|
20
|
+
function g({
|
|
21
|
+
className: t,
|
|
22
|
+
...e
|
|
23
|
+
}) {
|
|
24
|
+
return /* @__PURE__ */ a(
|
|
25
|
+
o.Overlay,
|
|
26
|
+
{
|
|
27
|
+
"data-slot": "dialog-overlay",
|
|
28
|
+
className: i(
|
|
29
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",
|
|
30
|
+
t
|
|
31
|
+
),
|
|
32
|
+
...e
|
|
33
|
+
}
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
function v({
|
|
37
|
+
className: t,
|
|
38
|
+
children: e,
|
|
39
|
+
showCloseButton: s = !0,
|
|
40
|
+
...r
|
|
41
|
+
}) {
|
|
42
|
+
return /* @__PURE__ */ n(d, { "data-slot": "dialog-portal", children: [
|
|
43
|
+
/* @__PURE__ */ a(g, {}),
|
|
44
|
+
/* @__PURE__ */ n(
|
|
45
|
+
o.Content,
|
|
46
|
+
{
|
|
47
|
+
"data-slot": "dialog-content",
|
|
48
|
+
className: i(
|
|
49
|
+
"bg-background 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 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 outline-none sm:max-w-lg",
|
|
50
|
+
t
|
|
51
|
+
),
|
|
52
|
+
...r,
|
|
53
|
+
children: [
|
|
54
|
+
e,
|
|
55
|
+
s && /* @__PURE__ */ n(
|
|
56
|
+
o.Close,
|
|
57
|
+
{
|
|
58
|
+
"data-slot": "dialog-close",
|
|
59
|
+
className: "ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
60
|
+
children: [
|
|
61
|
+
/* @__PURE__ */ a(l, {}),
|
|
62
|
+
/* @__PURE__ */ a("span", { className: "sr-only", children: "Close" })
|
|
63
|
+
]
|
|
64
|
+
}
|
|
65
|
+
)
|
|
66
|
+
]
|
|
67
|
+
}
|
|
68
|
+
)
|
|
69
|
+
] });
|
|
70
|
+
}
|
|
71
|
+
export {
|
|
72
|
+
m as Dialog,
|
|
73
|
+
v as DialogContent,
|
|
74
|
+
g as DialogOverlay,
|
|
75
|
+
d as DialogPortal,
|
|
76
|
+
p as DialogTrigger
|
|
77
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { cn as n } from "../../lib/utils.js";
|
|
3
|
+
function a({ className: e, type: i, ...r }) {
|
|
4
|
+
return /* @__PURE__ */ t(
|
|
5
|
+
"input",
|
|
6
|
+
{
|
|
7
|
+
type: i,
|
|
8
|
+
"data-slot": "input",
|
|
9
|
+
className: n(
|
|
10
|
+
"file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
|
|
11
|
+
"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
|
|
12
|
+
"aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
|
13
|
+
e
|
|
14
|
+
),
|
|
15
|
+
...r
|
|
16
|
+
}
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
export {
|
|
20
|
+
a as Input
|
|
21
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import * as a from "@radix-ui/react-label";
|
|
3
|
+
import { cn as r } from "../../lib/utils.js";
|
|
4
|
+
function l({
|
|
5
|
+
className: e,
|
|
6
|
+
...t
|
|
7
|
+
}) {
|
|
8
|
+
return /* @__PURE__ */ o(
|
|
9
|
+
a.Root,
|
|
10
|
+
{
|
|
11
|
+
"data-slot": "label",
|
|
12
|
+
className: r(
|
|
13
|
+
"flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
|
|
14
|
+
e
|
|
15
|
+
),
|
|
16
|
+
...t
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
l as Label
|
|
22
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import * as e from "@radix-ui/react-popover";
|
|
3
|
+
import { cn as n } from "../../lib/utils.js";
|
|
4
|
+
function s({
|
|
5
|
+
...o
|
|
6
|
+
}) {
|
|
7
|
+
return /* @__PURE__ */ t(e.Root, { "data-slot": "popover", ...o });
|
|
8
|
+
}
|
|
9
|
+
function m({
|
|
10
|
+
...o
|
|
11
|
+
}) {
|
|
12
|
+
return /* @__PURE__ */ t(e.Trigger, { "data-slot": "popover-trigger", ...o });
|
|
13
|
+
}
|
|
14
|
+
function f({
|
|
15
|
+
className: o,
|
|
16
|
+
align: r = "center",
|
|
17
|
+
sideOffset: a = 4,
|
|
18
|
+
...i
|
|
19
|
+
}) {
|
|
20
|
+
return /* @__PURE__ */ t(e.Portal, { children: /* @__PURE__ */ t(
|
|
21
|
+
e.Content,
|
|
22
|
+
{
|
|
23
|
+
"data-slot": "popover-content",
|
|
24
|
+
align: r,
|
|
25
|
+
sideOffset: a,
|
|
26
|
+
className: n(
|
|
27
|
+
"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 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",
|
|
28
|
+
o
|
|
29
|
+
),
|
|
30
|
+
...i
|
|
31
|
+
}
|
|
32
|
+
) });
|
|
33
|
+
}
|
|
34
|
+
export {
|
|
35
|
+
s as Popover,
|
|
36
|
+
f as PopoverContent,
|
|
37
|
+
m as PopoverTrigger
|
|
38
|
+
};
|
|
@@ -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,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
|
+
};
|