ml-uikit 1.1.0 → 1.1.2
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/components/ui/alert.d.ts +8 -2
- package/dist/components/ui/alert.d.ts.map +1 -1
- package/dist/components/ui/badge.d.ts +1 -1
- package/dist/components/ui/button.d.ts.map +1 -1
- package/dist/components/ui/checkbox.d.ts.map +1 -1
- package/dist/components/ui/icon-button.d.ts +9 -0
- package/dist/components/ui/icon-button.d.ts.map +1 -0
- package/dist/components/ui/input-group.d.ts.map +1 -1
- package/dist/components/ui/radio-group.d.ts.map +1 -1
- package/dist/components/ui/select.d.ts.map +1 -1
- package/dist/components/ui/sidebar.d.ts.map +1 -1
- package/dist/components/ui/slider.d.ts.map +1 -1
- package/dist/components/ui/switch.d.ts.map +1 -1
- package/dist/components/ui/tabs.d.ts.map +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs10.js +1 -1
- package/dist/index.cjs10.js.map +1 -1
- package/dist/index.cjs11.js +1 -1
- package/dist/index.cjs11.js.map +1 -1
- package/dist/index.cjs12.js +1 -1
- package/dist/index.cjs12.js.map +1 -1
- package/dist/index.cjs13.js +1 -1
- package/dist/index.cjs13.js.map +1 -1
- package/dist/index.cjs14.js +1 -1
- package/dist/index.cjs14.js.map +1 -1
- package/dist/index.cjs15.js +1 -7
- package/dist/index.cjs15.js.map +1 -1
- package/dist/index.cjs16.js +7 -1
- package/dist/index.cjs16.js.map +1 -1
- package/dist/index.cjs17.js +1 -1
- package/dist/index.cjs17.js.map +1 -1
- package/dist/index.cjs18.js +1 -1
- package/dist/index.cjs18.js.map +1 -1
- package/dist/index.cjs19.js +1 -1
- package/dist/index.cjs19.js.map +1 -1
- package/dist/index.cjs2.js +1 -1
- package/dist/index.cjs20.js +1 -1
- package/dist/index.cjs20.js.map +1 -1
- package/dist/index.cjs21.js +1 -1
- package/dist/index.cjs21.js.map +1 -1
- package/dist/index.cjs22.js +1 -1
- package/dist/index.cjs22.js.map +1 -1
- package/dist/index.cjs23.js +1 -1
- package/dist/index.cjs23.js.map +1 -1
- package/dist/index.cjs24.js +1 -1
- package/dist/index.cjs24.js.map +1 -1
- package/dist/index.cjs25.js +1 -1
- package/dist/index.cjs25.js.map +1 -1
- package/dist/index.cjs26.js +1 -1
- package/dist/index.cjs26.js.map +1 -1
- package/dist/index.cjs27.js +1 -1
- package/dist/index.cjs27.js.map +1 -1
- package/dist/index.cjs28.js +1 -1
- package/dist/index.cjs28.js.map +1 -1
- package/dist/index.cjs29.js +1 -1
- package/dist/index.cjs29.js.map +1 -1
- package/dist/index.cjs3.js +1 -1
- package/dist/index.cjs30.js +1 -1
- package/dist/index.cjs30.js.map +1 -1
- package/dist/index.cjs31.js +1 -1
- package/dist/index.cjs31.js.map +1 -1
- package/dist/index.cjs32.js +1 -1
- package/dist/index.cjs32.js.map +1 -1
- package/dist/index.cjs33.js +1 -1
- package/dist/index.cjs33.js.map +1 -1
- package/dist/index.cjs34.js +1 -1
- package/dist/index.cjs34.js.map +1 -1
- package/dist/index.cjs35.js +1 -1
- package/dist/index.cjs35.js.map +1 -1
- package/dist/index.cjs36.js +1 -1
- package/dist/index.cjs36.js.map +1 -1
- package/dist/index.cjs37.js +1 -1
- package/dist/index.cjs37.js.map +1 -1
- package/dist/index.cjs38.js +1 -1
- package/dist/index.cjs38.js.map +1 -1
- package/dist/index.cjs39.js +1 -1
- package/dist/index.cjs39.js.map +1 -1
- package/dist/index.cjs4.js +1 -1
- package/dist/index.cjs4.js.map +1 -1
- package/dist/index.cjs40.js +1 -1
- package/dist/index.cjs40.js.map +1 -1
- package/dist/index.cjs41.js +1 -1
- package/dist/index.cjs41.js.map +1 -1
- package/dist/index.cjs42.js +1 -1
- package/dist/index.cjs42.js.map +1 -1
- package/dist/index.cjs43.js +1 -1
- package/dist/index.cjs43.js.map +1 -1
- package/dist/index.cjs44.js +1 -1
- package/dist/index.cjs44.js.map +1 -1
- package/dist/index.cjs45.js +1 -1
- package/dist/index.cjs45.js.map +1 -1
- package/dist/index.cjs46.js +1 -1
- package/dist/index.cjs46.js.map +1 -1
- package/dist/index.cjs47.js +1 -1
- package/dist/index.cjs47.js.map +1 -1
- package/dist/index.cjs48.js +1 -1
- package/dist/index.cjs48.js.map +1 -1
- package/dist/index.cjs49.js +1 -1
- package/dist/index.cjs49.js.map +1 -1
- package/dist/index.cjs5.js +1 -1
- package/dist/index.cjs50.js +1 -1
- package/dist/index.cjs50.js.map +1 -1
- package/dist/index.cjs51.js +1 -1
- package/dist/index.cjs51.js.map +1 -1
- package/dist/index.cjs52.js +1 -1
- package/dist/index.cjs52.js.map +1 -1
- package/dist/index.cjs53.js +1 -1
- package/dist/index.cjs53.js.map +1 -1
- package/dist/index.cjs54.js +1 -1
- package/dist/index.cjs54.js.map +1 -1
- package/dist/index.cjs55.js +1 -1
- package/dist/index.cjs55.js.map +1 -1
- package/dist/index.cjs56.js +1 -1
- package/dist/index.cjs56.js.map +1 -1
- package/dist/index.cjs57.js +1 -1
- package/dist/index.cjs57.js.map +1 -1
- package/dist/index.cjs7.js +1 -1
- package/dist/index.cjs8.js +1 -1
- package/dist/index.cjs9.js +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.es.js +321 -312
- package/dist/index.es.js.map +1 -1
- package/dist/index.es10.js +27 -27
- package/dist/index.es10.js.map +1 -1
- package/dist/index.es11.js +19 -72
- package/dist/index.es11.js.map +1 -1
- package/dist/index.es12.js +62 -157
- package/dist/index.es12.js.map +1 -1
- package/dist/index.es13.js +169 -58
- package/dist/index.es13.js.map +1 -1
- package/dist/index.es14.js +55 -157
- package/dist/index.es14.js.map +1 -1
- package/dist/index.es15.js +150 -181
- package/dist/index.es15.js.map +1 -1
- package/dist/index.es16.js +188 -21
- package/dist/index.es16.js.map +1 -1
- package/dist/index.es17.js +31 -5
- package/dist/index.es17.js.map +1 -1
- package/dist/index.es18.js +5 -103
- package/dist/index.es18.js.map +1 -1
- package/dist/index.es19.js +70 -103
- package/dist/index.es19.js.map +1 -1
- package/dist/index.es2.js +1 -1
- package/dist/index.es20.js +108 -61
- package/dist/index.es20.js.map +1 -1
- package/dist/index.es21.js +59 -60
- package/dist/index.es21.js.map +1 -1
- package/dist/index.es22.js +69 -114
- package/dist/index.es22.js.map +1 -1
- package/dist/index.es23.js +132 -97
- package/dist/index.es23.js.map +1 -1
- package/dist/index.es24.js +49 -156
- package/dist/index.es24.js.map +1 -1
- package/dist/index.es25.js +194 -76
- package/dist/index.es25.js.map +1 -1
- package/dist/index.es26.js +89 -20
- package/dist/index.es26.js.map +1 -1
- package/dist/index.es27.js +20 -22
- package/dist/index.es27.js.map +1 -1
- package/dist/index.es28.js +17 -144
- package/dist/index.es28.js.map +1 -1
- package/dist/index.es29.js +145 -37
- package/dist/index.es29.js.map +1 -1
- package/dist/index.es3.js +1 -1
- package/dist/index.es30.js +37 -179
- package/dist/index.es30.js.map +1 -1
- package/dist/index.es31.js +174 -18
- package/dist/index.es31.js.map +1 -1
- package/dist/index.es32.js +29 -16
- package/dist/index.es32.js.map +1 -1
- package/dist/index.es33.js +15 -92
- package/dist/index.es33.js.map +1 -1
- package/dist/index.es34.js +91 -189
- package/dist/index.es34.js.map +1 -1
- package/dist/index.es35.js +165 -71
- package/dist/index.es35.js.map +1 -1
- package/dist/index.es36.js +85 -84
- package/dist/index.es36.js.map +1 -1
- package/dist/index.es37.js +92 -17
- package/dist/index.es37.js.map +1 -1
- package/dist/index.es38.js +19 -21
- package/dist/index.es38.js.map +1 -1
- package/dist/index.es39.js +16 -21
- package/dist/index.es39.js.map +1 -1
- package/dist/index.es4.js +65 -26
- package/dist/index.es4.js.map +1 -1
- package/dist/index.es40.js +22 -25
- package/dist/index.es40.js.map +1 -1
- package/dist/index.es41.js +25 -104
- package/dist/index.es41.js.map +1 -1
- package/dist/index.es42.js +117 -20
- package/dist/index.es42.js.map +1 -1
- package/dist/index.es43.js +19 -97
- package/dist/index.es43.js.map +1 -1
- package/dist/index.es44.js +77 -509
- package/dist/index.es44.js.map +1 -1
- package/dist/index.es45.js +552 -11
- package/dist/index.es45.js.map +1 -1
- package/dist/index.es46.js +15 -18
- package/dist/index.es46.js.map +1 -1
- package/dist/index.es47.js +44 -19
- package/dist/index.es47.js.map +1 -1
- package/dist/index.es48.js +19 -12
- package/dist/index.es48.js.map +1 -1
- package/dist/index.es49.js +13 -22
- package/dist/index.es49.js.map +1 -1
- package/dist/index.es5.js +1 -1
- package/dist/index.es50.js +23 -197
- package/dist/index.es50.js.map +1 -1
- package/dist/index.es51.js +191 -28
- package/dist/index.es51.js.map +1 -1
- package/dist/index.es52.js +45 -14
- package/dist/index.es52.js.map +1 -1
- package/dist/index.es53.js +12 -28
- package/dist/index.es53.js.map +1 -1
- package/dist/index.es54.js +30 -34
- package/dist/index.es54.js.map +1 -1
- package/dist/index.es55.js +37 -19
- package/dist/index.es55.js.map +1 -1
- package/dist/index.es56.js +20 -6
- package/dist/index.es56.js.map +1 -1
- package/dist/index.es57.js +5 -11
- package/dist/index.es57.js.map +1 -1
- package/dist/index.es7.js +1 -1
- package/dist/index.es8.js +1 -1
- package/dist/index.es9.js +1 -1
- package/dist/style.css +436 -172
- package/package.json +1 -1
- package/dist/hooks/use-mobile.d.ts +0 -2
- package/dist/hooks/use-mobile.d.ts.map +0 -1
package/dist/index.es24.js
CHANGED
|
@@ -1,210 +1,103 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { cva as
|
|
3
|
-
import { cn as
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
return /* @__PURE__ */ React.createElement(
|
|
8
|
-
"fieldset",
|
|
1
|
+
import * as n from "react";
|
|
2
|
+
import { cva as i } from "class-variance-authority";
|
|
3
|
+
import { cn as a } from "./index.es57.js";
|
|
4
|
+
function c({ className: t, ...e }) {
|
|
5
|
+
return /* @__PURE__ */ n.createElement(
|
|
6
|
+
"div",
|
|
9
7
|
{
|
|
10
|
-
"data-slot": "
|
|
11
|
-
className:
|
|
12
|
-
"flex flex-col gap-6",
|
|
13
|
-
"has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3",
|
|
8
|
+
"data-slot": "empty",
|
|
9
|
+
className: a(
|
|
10
|
+
"flex min-w-0 flex-1 flex-col items-center justify-center gap-6 text-balance rounded-lg border-dashed p-6 text-center md:p-12",
|
|
14
11
|
t
|
|
15
12
|
),
|
|
16
13
|
...e
|
|
17
14
|
}
|
|
18
15
|
);
|
|
19
16
|
}
|
|
20
|
-
function
|
|
21
|
-
|
|
22
|
-
variant: e = "legend",
|
|
23
|
-
...a
|
|
24
|
-
}) {
|
|
25
|
-
return /* @__PURE__ */ React.createElement(
|
|
26
|
-
"legend",
|
|
27
|
-
{
|
|
28
|
-
"data-slot": "field-legend",
|
|
29
|
-
"data-variant": e,
|
|
30
|
-
className: l(
|
|
31
|
-
"mb-3 font-medium",
|
|
32
|
-
"data-[variant=legend]:text-base",
|
|
33
|
-
"data-[variant=label]:text-sm",
|
|
34
|
-
t
|
|
35
|
-
),
|
|
36
|
-
...a
|
|
37
|
-
}
|
|
38
|
-
);
|
|
39
|
-
}
|
|
40
|
-
function E({ className: t, ...e }) {
|
|
41
|
-
return /* @__PURE__ */ React.createElement(
|
|
17
|
+
function o({ className: t, ...e }) {
|
|
18
|
+
return /* @__PURE__ */ n.createElement(
|
|
42
19
|
"div",
|
|
43
20
|
{
|
|
44
|
-
"data-slot": "
|
|
45
|
-
className:
|
|
46
|
-
"
|
|
21
|
+
"data-slot": "empty-header",
|
|
22
|
+
className: a(
|
|
23
|
+
"flex max-w-sm flex-col items-center gap-2 text-center",
|
|
47
24
|
t
|
|
48
25
|
),
|
|
49
26
|
...e
|
|
50
27
|
}
|
|
51
28
|
);
|
|
52
29
|
}
|
|
53
|
-
const
|
|
54
|
-
"
|
|
30
|
+
const s = i(
|
|
31
|
+
"mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
55
32
|
{
|
|
56
33
|
variants: {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
"flex-row items-center",
|
|
61
|
-
"[&>[data-slot=field-label]]:flex-auto",
|
|
62
|
-
"has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px has-[>[data-slot=field-content]]:items-start"
|
|
63
|
-
],
|
|
64
|
-
responsive: [
|
|
65
|
-
"@md/field-group:flex-row @md/field-group:items-center @md/field-group:[&>*]:w-auto flex-col [&>*]:w-full [&>.sr-only]:w-auto",
|
|
66
|
-
"@md/field-group:[&>[data-slot=field-label]]:flex-auto",
|
|
67
|
-
"@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"
|
|
68
|
-
]
|
|
34
|
+
variant: {
|
|
35
|
+
default: "bg-transparent",
|
|
36
|
+
icon: "bg-muted text-foreground flex size-10 shrink-0 items-center justify-center rounded-lg [&_svg:not([class*='size-'])]:size-6"
|
|
69
37
|
}
|
|
70
38
|
},
|
|
71
39
|
defaultVariants: {
|
|
72
|
-
|
|
40
|
+
variant: "default"
|
|
73
41
|
}
|
|
74
42
|
}
|
|
75
43
|
);
|
|
76
|
-
function
|
|
44
|
+
function d({
|
|
77
45
|
className: t,
|
|
78
|
-
|
|
79
|
-
...
|
|
46
|
+
variant: e = "default",
|
|
47
|
+
...r
|
|
80
48
|
}) {
|
|
81
|
-
return /* @__PURE__ */
|
|
49
|
+
return /* @__PURE__ */ n.createElement(
|
|
82
50
|
"div",
|
|
83
51
|
{
|
|
84
|
-
|
|
85
|
-
"data-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
...a
|
|
52
|
+
"data-slot": "empty-icon",
|
|
53
|
+
"data-variant": e,
|
|
54
|
+
className: a(s({ variant: e, className: t })),
|
|
55
|
+
...r
|
|
89
56
|
}
|
|
90
57
|
);
|
|
91
58
|
}
|
|
92
|
-
function
|
|
93
|
-
return /* @__PURE__ */
|
|
59
|
+
function f({ className: t, ...e }) {
|
|
60
|
+
return /* @__PURE__ */ n.createElement(
|
|
94
61
|
"div",
|
|
95
62
|
{
|
|
96
|
-
"data-slot": "
|
|
97
|
-
className:
|
|
98
|
-
"group/field-content flex flex-1 flex-col gap-1.5 leading-snug",
|
|
99
|
-
t
|
|
100
|
-
),
|
|
101
|
-
...e
|
|
102
|
-
}
|
|
103
|
-
);
|
|
104
|
-
}
|
|
105
|
-
function N({
|
|
106
|
-
className: t,
|
|
107
|
-
...e
|
|
108
|
-
}) {
|
|
109
|
-
return /* @__PURE__ */ React.createElement(
|
|
110
|
-
c,
|
|
111
|
-
{
|
|
112
|
-
"data-slot": "field-label",
|
|
113
|
-
className: l(
|
|
114
|
-
"group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50",
|
|
115
|
-
"has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border [&>[data-slot=field]]:p-4",
|
|
116
|
-
"has-data-[state=checked]:bg-primary/5 has-data-[state=checked]:border-primary dark:has-data-[state=checked]:bg-primary/10",
|
|
117
|
-
t
|
|
118
|
-
),
|
|
63
|
+
"data-slot": "empty-title",
|
|
64
|
+
className: a("text-lg font-medium tracking-tight", t),
|
|
119
65
|
...e
|
|
120
66
|
}
|
|
121
67
|
);
|
|
122
68
|
}
|
|
123
|
-
function
|
|
124
|
-
return /* @__PURE__ */
|
|
69
|
+
function u({ className: t, ...e }) {
|
|
70
|
+
return /* @__PURE__ */ n.createElement(
|
|
125
71
|
"div",
|
|
126
72
|
{
|
|
127
|
-
"data-slot": "
|
|
128
|
-
className:
|
|
129
|
-
"
|
|
73
|
+
"data-slot": "empty-description",
|
|
74
|
+
className: a(
|
|
75
|
+
"text-muted-foreground [&>a:hover]:text-primary text-sm/relaxed [&>a]:underline [&>a]:underline-offset-4",
|
|
130
76
|
t
|
|
131
77
|
),
|
|
132
78
|
...e
|
|
133
79
|
}
|
|
134
80
|
);
|
|
135
81
|
}
|
|
136
|
-
function
|
|
137
|
-
return /* @__PURE__ */
|
|
138
|
-
"
|
|
82
|
+
function p({ className: t, ...e }) {
|
|
83
|
+
return /* @__PURE__ */ n.createElement(
|
|
84
|
+
"div",
|
|
139
85
|
{
|
|
140
|
-
"data-slot": "
|
|
141
|
-
className:
|
|
142
|
-
"
|
|
143
|
-
"nth-last-2:-mt-1 last:mt-0 [[data-variant=legend]+&]:-mt-1.5",
|
|
144
|
-
"[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4",
|
|
86
|
+
"data-slot": "empty-content",
|
|
87
|
+
className: a(
|
|
88
|
+
"flex w-full min-w-0 max-w-sm flex-col items-center gap-4 text-balance text-sm",
|
|
145
89
|
t
|
|
146
90
|
),
|
|
147
91
|
...e
|
|
148
92
|
}
|
|
149
93
|
);
|
|
150
94
|
}
|
|
151
|
-
function F({
|
|
152
|
-
children: t,
|
|
153
|
-
className: e,
|
|
154
|
-
...a
|
|
155
|
-
}) {
|
|
156
|
-
return /* @__PURE__ */ React.createElement(
|
|
157
|
-
"div",
|
|
158
|
-
{
|
|
159
|
-
"data-slot": "field-separator",
|
|
160
|
-
"data-content": !!t,
|
|
161
|
-
className: l(
|
|
162
|
-
"relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2",
|
|
163
|
-
e
|
|
164
|
-
),
|
|
165
|
-
...a
|
|
166
|
-
},
|
|
167
|
-
/* @__PURE__ */ React.createElement(f, { className: "absolute inset-0 top-1/2" }),
|
|
168
|
-
t && /* @__PURE__ */ React.createElement(
|
|
169
|
-
"span",
|
|
170
|
-
{
|
|
171
|
-
className: "bg-background text-muted-foreground relative mx-auto block w-fit px-2",
|
|
172
|
-
"data-slot": "field-separator-content"
|
|
173
|
-
},
|
|
174
|
-
t
|
|
175
|
-
)
|
|
176
|
-
);
|
|
177
|
-
}
|
|
178
|
-
function L({
|
|
179
|
-
className: t,
|
|
180
|
-
children: e,
|
|
181
|
-
errors: a,
|
|
182
|
-
...d
|
|
183
|
-
}) {
|
|
184
|
-
const o = n(() => e || (a ? a?.length === 1 && a[0]?.message ? a[0].message : /* @__PURE__ */ React.createElement("ul", { className: "ml-4 flex list-disc flex-col gap-1" }, a.map(
|
|
185
|
-
(r, i) => r?.message && /* @__PURE__ */ React.createElement("li", { key: i }, r.message)
|
|
186
|
-
)) : null), [e, a]);
|
|
187
|
-
return o ? /* @__PURE__ */ React.createElement(
|
|
188
|
-
"div",
|
|
189
|
-
{
|
|
190
|
-
role: "alert",
|
|
191
|
-
"data-slot": "field-error",
|
|
192
|
-
className: l("text-destructive text-sm font-normal", t),
|
|
193
|
-
...d
|
|
194
|
-
},
|
|
195
|
-
o
|
|
196
|
-
) : null;
|
|
197
|
-
}
|
|
198
95
|
export {
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
v as FieldLegend,
|
|
206
|
-
F as FieldSeparator,
|
|
207
|
-
h as FieldSet,
|
|
208
|
-
k as FieldTitle
|
|
96
|
+
c as Empty,
|
|
97
|
+
p as EmptyContent,
|
|
98
|
+
u as EmptyDescription,
|
|
99
|
+
o as EmptyHeader,
|
|
100
|
+
d as EmptyMedia,
|
|
101
|
+
f as EmptyTitle
|
|
209
102
|
};
|
|
210
103
|
//# sourceMappingURL=index.es24.js.map
|
package/dist/index.es24.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es24.js","sources":["../src/components/ui/
|
|
1
|
+
{"version":3,"file":"index.es24.js","sources":["../src/components/ui/empty.tsx"],"sourcesContent":["import * as React from \"react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/lib/utils\"\n\nfunction Empty({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"empty\"\n className={cn(\n \"flex min-w-0 flex-1 flex-col items-center justify-center gap-6 text-balance rounded-lg border-dashed p-6 text-center md:p-12\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction EmptyHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"empty-header\"\n className={cn(\n \"flex max-w-sm flex-col items-center gap-2 text-center\",\n className\n )}\n {...props}\n />\n )\n}\n\nconst emptyMediaVariants = cva(\n \"mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0\",\n {\n variants: {\n variant: {\n default: \"bg-transparent\",\n icon: \"bg-muted text-foreground flex size-10 shrink-0 items-center justify-center rounded-lg [&_svg:not([class*='size-'])]:size-6\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n }\n)\n\nfunction EmptyMedia({\n className,\n variant = \"default\",\n ...props\n}: React.ComponentProps<\"div\"> & VariantProps<typeof emptyMediaVariants>) {\n return (\n <div\n data-slot=\"empty-icon\"\n data-variant={variant}\n className={cn(emptyMediaVariants({ variant, className }))}\n {...props}\n />\n )\n}\n\nfunction EmptyTitle({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"empty-title\"\n className={cn(\"text-lg font-medium tracking-tight\", className)}\n {...props}\n />\n )\n}\n\nfunction EmptyDescription({ className, ...props }: React.ComponentProps<\"p\">) {\n return (\n <div\n data-slot=\"empty-description\"\n className={cn(\n \"text-muted-foreground [&>a:hover]:text-primary text-sm/relaxed [&>a]:underline [&>a]:underline-offset-4\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction EmptyContent({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"empty-content\"\n className={cn(\n \"flex w-full min-w-0 max-w-sm flex-col items-center gap-4 text-balance text-sm\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport {\n Empty,\n EmptyHeader,\n EmptyTitle,\n EmptyDescription,\n EmptyContent,\n EmptyMedia,\n}\n"],"names":["Empty","className","props","React","cn","EmptyHeader","emptyMediaVariants","cva","EmptyMedia","variant","EmptyTitle","EmptyDescription","EmptyContent"],"mappings":";;;AAKA,SAASA,EAAM,EAAE,WAAAC,GAAW,GAAGC,KAAsC;AACnE,SACE,gBAAAC,EAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAWC;AAAA,QACT;AAAA,QACAH;AAAA,MAAA;AAAA,MAED,GAAGC;AAAA,IAAA;AAAA,EAAA;AAGV;AAEA,SAASG,EAAY,EAAE,WAAAJ,GAAW,GAAGC,KAAsC;AACzE,SACE,gBAAAC,EAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAWC;AAAA,QACT;AAAA,QACAH;AAAA,MAAA;AAAA,MAED,GAAGC;AAAA,IAAA;AAAA,EAAA;AAGV;AAEA,MAAMI,IAAqBC;AAAA,EACzB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SAAS;AAAA,QACT,MAAM;AAAA,MAAA;AAAA,IACR;AAAA,IAEF,iBAAiB;AAAA,MACf,SAAS;AAAA,IAAA;AAAA,EACX;AAEJ;AAEA,SAASC,EAAW;AAAA,EAClB,WAAAP;AAAA,EACA,SAAAQ,IAAU;AAAA,EACV,GAAGP;AACL,GAA0E;AACxE,SACE,gBAAAC,EAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,aAAU;AAAA,MACV,gBAAcM;AAAA,MACd,WAAWL,EAAGE,EAAmB,EAAE,SAAAG,GAAS,WAAAR,EAAA,CAAW,CAAC;AAAA,MACvD,GAAGC;AAAA,IAAA;AAAA,EAAA;AAGV;AAEA,SAASQ,EAAW,EAAE,WAAAT,GAAW,GAAGC,KAAsC;AACxE,SACE,gBAAAC,EAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAWC,EAAG,sCAAsCH,CAAS;AAAA,MAC5D,GAAGC;AAAA,IAAA;AAAA,EAAA;AAGV;AAEA,SAASS,EAAiB,EAAE,WAAAV,GAAW,GAAGC,KAAoC;AAC5E,SACE,gBAAAC,EAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAWC;AAAA,QACT;AAAA,QACAH;AAAA,MAAA;AAAA,MAED,GAAGC;AAAA,IAAA;AAAA,EAAA;AAGV;AAEA,SAASU,EAAa,EAAE,WAAAX,GAAW,GAAGC,KAAsC;AAC1E,SACE,gBAAAC,EAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAWC;AAAA,QACT;AAAA,QACAH;AAAA,MAAA;AAAA,MAED,GAAGC;AAAA,IAAA;AAAA,EAAA;AAGV;"}
|
package/dist/index.es25.js
CHANGED
|
@@ -1,92 +1,210 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const r = e.useContext(c), t = e.useContext(l), { getFieldState: o, formState: m } = F();
|
|
10
|
-
if (!r)
|
|
11
|
-
throw new Error("useFormField should be used within <FormField>");
|
|
12
|
-
if (!t)
|
|
13
|
-
throw new Error("useFormField should be used within <FormItem>");
|
|
14
|
-
const n = o(r.name, m), { id: s } = t;
|
|
15
|
-
return {
|
|
16
|
-
id: s,
|
|
17
|
-
name: r.name,
|
|
18
|
-
formItemId: `${s}-form-item`,
|
|
19
|
-
formDescriptionId: `${s}-form-item-description`,
|
|
20
|
-
formMessageId: `${s}-form-item-message`,
|
|
21
|
-
...n
|
|
22
|
-
};
|
|
23
|
-
}, l = e.createContext(null), x = e.forwardRef(({ className: r, ...t }, o) => {
|
|
24
|
-
const m = e.useId();
|
|
25
|
-
return /* @__PURE__ */ e.createElement(l.Provider, { value: { id: m } }, /* @__PURE__ */ e.createElement("div", { ref: o, className: a("space-y-2", r), ...t }));
|
|
26
|
-
});
|
|
27
|
-
x.displayName = "FormItem";
|
|
28
|
-
const C = e.forwardRef(({ className: r, ...t }, o) => {
|
|
29
|
-
const { error: m, formItemId: n } = i();
|
|
30
|
-
return /* @__PURE__ */ e.createElement(
|
|
31
|
-
I,
|
|
1
|
+
import { useMemo as n } from "react";
|
|
2
|
+
import { cva as s } from "class-variance-authority";
|
|
3
|
+
import { cn as l } from "./index.es57.js";
|
|
4
|
+
import { Label as c } from "./index.es33.js";
|
|
5
|
+
import { Separator as f } from "./index.es43.js";
|
|
6
|
+
function h({ className: t, ...e }) {
|
|
7
|
+
return /* @__PURE__ */ React.createElement(
|
|
8
|
+
"fieldset",
|
|
32
9
|
{
|
|
33
|
-
|
|
34
|
-
className:
|
|
35
|
-
|
|
36
|
-
|
|
10
|
+
"data-slot": "field-set",
|
|
11
|
+
className: l(
|
|
12
|
+
"flex flex-col gap-6",
|
|
13
|
+
"has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3",
|
|
14
|
+
t
|
|
15
|
+
),
|
|
16
|
+
...e
|
|
37
17
|
}
|
|
38
18
|
);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
19
|
+
}
|
|
20
|
+
function v({
|
|
21
|
+
className: t,
|
|
22
|
+
variant: e = "legend",
|
|
23
|
+
...a
|
|
24
|
+
}) {
|
|
25
|
+
return /* @__PURE__ */ React.createElement(
|
|
26
|
+
"legend",
|
|
45
27
|
{
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
28
|
+
"data-slot": "field-legend",
|
|
29
|
+
"data-variant": e,
|
|
30
|
+
className: l(
|
|
31
|
+
"mb-3 font-medium",
|
|
32
|
+
"data-[variant=legend]:text-base",
|
|
33
|
+
"data-[variant=label]:text-sm",
|
|
34
|
+
t
|
|
35
|
+
),
|
|
36
|
+
...a
|
|
51
37
|
}
|
|
52
38
|
);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
39
|
+
}
|
|
40
|
+
function E({ className: t, ...e }) {
|
|
41
|
+
return /* @__PURE__ */ React.createElement(
|
|
42
|
+
"div",
|
|
43
|
+
{
|
|
44
|
+
"data-slot": "field-group",
|
|
45
|
+
className: l(
|
|
46
|
+
"group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4",
|
|
47
|
+
t
|
|
48
|
+
),
|
|
49
|
+
...e
|
|
50
|
+
}
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
const u = s(
|
|
54
|
+
"group/field data-[invalid=true]:text-destructive flex w-full gap-3",
|
|
55
|
+
{
|
|
56
|
+
variants: {
|
|
57
|
+
orientation: {
|
|
58
|
+
vertical: ["flex-col [&>*]:w-full [&>.sr-only]:w-auto"],
|
|
59
|
+
horizontal: [
|
|
60
|
+
"flex-row items-center",
|
|
61
|
+
"[&>[data-slot=field-label]]:flex-auto",
|
|
62
|
+
"has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px has-[>[data-slot=field-content]]:items-start"
|
|
63
|
+
],
|
|
64
|
+
responsive: [
|
|
65
|
+
"@md/field-group:flex-row @md/field-group:items-center @md/field-group:[&>*]:w-auto flex-col [&>*]:w-full [&>.sr-only]:w-auto",
|
|
66
|
+
"@md/field-group:[&>[data-slot=field-label]]:flex-auto",
|
|
67
|
+
"@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"
|
|
68
|
+
]
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
defaultVariants: {
|
|
72
|
+
orientation: "vertical"
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
);
|
|
76
|
+
function R({
|
|
77
|
+
className: t,
|
|
78
|
+
orientation: e = "vertical",
|
|
79
|
+
...a
|
|
80
|
+
}) {
|
|
81
|
+
return /* @__PURE__ */ React.createElement(
|
|
82
|
+
"div",
|
|
59
83
|
{
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
84
|
+
role: "group",
|
|
85
|
+
"data-slot": "field",
|
|
86
|
+
"data-orientation": e,
|
|
87
|
+
className: l(u({ orientation: e }), t),
|
|
88
|
+
...a
|
|
64
89
|
}
|
|
65
90
|
);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
91
|
+
}
|
|
92
|
+
function w({ className: t, ...e }) {
|
|
93
|
+
return /* @__PURE__ */ React.createElement(
|
|
94
|
+
"div",
|
|
95
|
+
{
|
|
96
|
+
"data-slot": "field-content",
|
|
97
|
+
className: l(
|
|
98
|
+
"group/field-content flex flex-1 flex-col gap-1.5 leading-snug",
|
|
99
|
+
t
|
|
100
|
+
),
|
|
101
|
+
...e
|
|
102
|
+
}
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
function N({
|
|
106
|
+
className: t,
|
|
107
|
+
...e
|
|
108
|
+
}) {
|
|
109
|
+
return /* @__PURE__ */ React.createElement(
|
|
110
|
+
c,
|
|
111
|
+
{
|
|
112
|
+
"data-slot": "field-label",
|
|
113
|
+
className: l(
|
|
114
|
+
"group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50",
|
|
115
|
+
"has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border [&>[data-slot=field]]:p-4",
|
|
116
|
+
"has-data-[state=checked]:bg-primary/5 has-data-[state=checked]:border-primary dark:has-data-[state=checked]:bg-primary/10",
|
|
117
|
+
t
|
|
118
|
+
),
|
|
119
|
+
...e
|
|
120
|
+
}
|
|
121
|
+
);
|
|
122
|
+
}
|
|
123
|
+
function k({ className: t, ...e }) {
|
|
124
|
+
return /* @__PURE__ */ React.createElement(
|
|
125
|
+
"div",
|
|
126
|
+
{
|
|
127
|
+
"data-slot": "field-label",
|
|
128
|
+
className: l(
|
|
129
|
+
"flex w-fit items-center gap-2 text-sm font-medium leading-snug group-data-[disabled=true]/field:opacity-50",
|
|
130
|
+
t
|
|
131
|
+
),
|
|
132
|
+
...e
|
|
133
|
+
}
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
function y({ className: t, ...e }) {
|
|
137
|
+
return /* @__PURE__ */ React.createElement(
|
|
71
138
|
"p",
|
|
72
139
|
{
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
140
|
+
"data-slot": "field-description",
|
|
141
|
+
className: l(
|
|
142
|
+
"text-muted-foreground text-sm font-normal leading-normal group-has-[[data-orientation=horizontal]]/field:text-balance",
|
|
143
|
+
"nth-last-2:-mt-1 last:mt-0 [[data-variant=legend]+&]:-mt-1.5",
|
|
144
|
+
"[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4",
|
|
145
|
+
t
|
|
146
|
+
),
|
|
147
|
+
...e
|
|
148
|
+
}
|
|
149
|
+
);
|
|
150
|
+
}
|
|
151
|
+
function F({
|
|
152
|
+
children: t,
|
|
153
|
+
className: e,
|
|
154
|
+
...a
|
|
155
|
+
}) {
|
|
156
|
+
return /* @__PURE__ */ React.createElement(
|
|
157
|
+
"div",
|
|
158
|
+
{
|
|
159
|
+
"data-slot": "field-separator",
|
|
160
|
+
"data-content": !!t,
|
|
161
|
+
className: l(
|
|
162
|
+
"relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2",
|
|
163
|
+
e
|
|
164
|
+
),
|
|
165
|
+
...a
|
|
166
|
+
},
|
|
167
|
+
/* @__PURE__ */ React.createElement(f, { className: "absolute inset-0 top-1/2" }),
|
|
168
|
+
t && /* @__PURE__ */ React.createElement(
|
|
169
|
+
"span",
|
|
170
|
+
{
|
|
171
|
+
className: "bg-background text-muted-foreground relative mx-auto block w-fit px-2",
|
|
172
|
+
"data-slot": "field-separator-content"
|
|
173
|
+
},
|
|
174
|
+
t
|
|
175
|
+
)
|
|
176
|
+
);
|
|
177
|
+
}
|
|
178
|
+
function L({
|
|
179
|
+
className: t,
|
|
180
|
+
children: e,
|
|
181
|
+
errors: a,
|
|
182
|
+
...d
|
|
183
|
+
}) {
|
|
184
|
+
const o = n(() => e || (a ? a?.length === 1 && a[0]?.message ? a[0].message : /* @__PURE__ */ React.createElement("ul", { className: "ml-4 flex list-disc flex-col gap-1" }, a.map(
|
|
185
|
+
(r, i) => r?.message && /* @__PURE__ */ React.createElement("li", { key: i }, r.message)
|
|
186
|
+
)) : null), [e, a]);
|
|
187
|
+
return o ? /* @__PURE__ */ React.createElement(
|
|
188
|
+
"div",
|
|
189
|
+
{
|
|
190
|
+
role: "alert",
|
|
191
|
+
"data-slot": "field-error",
|
|
192
|
+
className: l("text-destructive text-sm font-normal", t),
|
|
193
|
+
...d
|
|
77
194
|
},
|
|
78
|
-
|
|
195
|
+
o
|
|
79
196
|
) : null;
|
|
80
|
-
}
|
|
81
|
-
E.displayName = "FormMessage";
|
|
197
|
+
}
|
|
82
198
|
export {
|
|
83
|
-
|
|
84
|
-
w as
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
199
|
+
R as Field,
|
|
200
|
+
w as FieldContent,
|
|
201
|
+
y as FieldDescription,
|
|
202
|
+
L as FieldError,
|
|
203
|
+
E as FieldGroup,
|
|
204
|
+
N as FieldLabel,
|
|
205
|
+
v as FieldLegend,
|
|
206
|
+
F as FieldSeparator,
|
|
207
|
+
h as FieldSet,
|
|
208
|
+
k as FieldTitle
|
|
91
209
|
};
|
|
92
210
|
//# sourceMappingURL=index.es25.js.map
|