laif-ds 0.2.49 → 0.2.50
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/kanban.js +21 -20
- package/dist/components/ui/app-kanban.js +89 -95
- package/dist/components/ui/app-radio-group.js +62 -48
- package/dist/components/ui/app-select.js +93 -90
- package/dist/components/ui/async-select.js +134 -126
- package/dist/components/ui/badge.js +38 -31
- package/dist/components/ui/button.js +49 -40
- package/dist/components/ui/card.js +36 -28
- package/dist/components/ui/checkbox.js +23 -20
- package/dist/components/ui/date-picker.js +64 -59
- package/dist/components/ui/dialog.js +54 -42
- package/dist/components/ui/input.js +116 -111
- package/dist/components/ui/popover.js +15 -13
- package/dist/components/ui/radio-group.js +29 -27
- package/dist/components/ui/select.js +74 -67
- package/dist/components/ui/sheet.js +39 -28
- package/dist/components/ui/slider.js +34 -28
- package/dist/components/ui/switch.js +16 -13
- package/dist/components/ui/tabs.js +35 -26
- package/dist/components/ui/textarea.js +26 -17
- package/dist/index.d.ts +2 -2
- package/dist/lib/design-tokens.js +43 -0
- package/dist/styles.v3.css +1 -1
- package/package.json +1 -1
|
@@ -1,25 +1,33 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as u, jsx as r } from "react/jsx-runtime";
|
|
3
|
-
import { useDebounce as
|
|
4
|
-
import { cva as
|
|
5
|
-
import * as
|
|
3
|
+
import { useDebounce as de } from "../../hooks/use-debounce.js";
|
|
4
|
+
import { cva as ie } from "../../node_modules/class-variance-authority/dist/index.js";
|
|
5
|
+
import * as M from "react";
|
|
6
6
|
import { useState as p, useEffect as N, useCallback as j } from "react";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import ye from "
|
|
14
|
-
import Ne from "../../node_modules/lucide-react/dist/esm/icons/
|
|
15
|
-
|
|
16
|
-
|
|
7
|
+
import { designTokens as b } from "../../lib/design-tokens.js";
|
|
8
|
+
import { cn as k } from "../../lib/utils.js";
|
|
9
|
+
import { Checkbox as fe } from "./checkbox.js";
|
|
10
|
+
import { Command as me, CommandInput as ue, CommandList as he, CommandEmpty as ge, CommandGroup as O, CommandItem as V } from "./command.js";
|
|
11
|
+
import { Icon as _ } from "./icon.js";
|
|
12
|
+
import { Label as pe } from "./label.js";
|
|
13
|
+
import { Popover as xe, PopoverTrigger as we, PopoverContent as ye } from "./popover.js";
|
|
14
|
+
import Ne from "../../node_modules/lucide-react/dist/esm/icons/loader-circle.js";
|
|
15
|
+
import be from "../../node_modules/lucide-react/dist/esm/icons/check.js";
|
|
16
|
+
const Ce = ie(
|
|
17
|
+
k(
|
|
18
|
+
b.input.base,
|
|
19
|
+
b.radius.default,
|
|
20
|
+
b.interaction.disabled,
|
|
21
|
+
"flex items-center justify-between whitespace-nowrap transition-all [&>span]:line-clamp-1",
|
|
22
|
+
"data-[placeholder]:text-d-muted-foreground",
|
|
23
|
+
"focus:outline-none"
|
|
24
|
+
),
|
|
17
25
|
{
|
|
18
26
|
variants: {
|
|
19
27
|
size: {
|
|
20
|
-
default:
|
|
21
|
-
sm:
|
|
22
|
-
lg:
|
|
28
|
+
default: b.sizes.default,
|
|
29
|
+
sm: b.sizes.sm,
|
|
30
|
+
lg: b.sizes.lg
|
|
23
31
|
}
|
|
24
32
|
},
|
|
25
33
|
defaultVariants: {
|
|
@@ -27,11 +35,11 @@ const be = de(
|
|
|
27
35
|
}
|
|
28
36
|
}
|
|
29
37
|
);
|
|
30
|
-
function
|
|
38
|
+
function Be({
|
|
31
39
|
fetcher: i,
|
|
32
40
|
initialOptions: t,
|
|
33
41
|
debounce: x = 300,
|
|
34
|
-
renderOptionItem:
|
|
42
|
+
renderOptionItem: C,
|
|
35
43
|
resolveOptionValue: a,
|
|
36
44
|
renderSelectedValue: s,
|
|
37
45
|
notFound: h,
|
|
@@ -39,92 +47,92 @@ function Ie({
|
|
|
39
47
|
placeholder: f = "Select...",
|
|
40
48
|
value: n,
|
|
41
49
|
onChange: g,
|
|
42
|
-
disabled:
|
|
43
|
-
className:
|
|
44
|
-
wrpClassName:
|
|
45
|
-
noResultsMessage:
|
|
46
|
-
clearable:
|
|
50
|
+
disabled: A = !1,
|
|
51
|
+
className: v,
|
|
52
|
+
wrpClassName: D,
|
|
53
|
+
noResultsMessage: E,
|
|
54
|
+
clearable: S = !0,
|
|
47
55
|
multiple: l = !1,
|
|
48
|
-
size:
|
|
56
|
+
size: ee
|
|
49
57
|
}) {
|
|
50
|
-
const [m,
|
|
58
|
+
const [m, L] = p(!1), P = M.useRef(null), F = M.useRef(null), re = M.useRef(null), [ne, I] = p({ loading: !1, error: null }), [X, te] = p(""), W = de(X, x), [B, q] = p(/* @__PURE__ */ new Map()), [$, G] = p([]), [H, se] = p(0), [J, Q] = p(() => t?.length ? new Map(
|
|
51
59
|
t.map((e) => [a(e), e])
|
|
52
60
|
) : /* @__PURE__ */ new Map());
|
|
53
61
|
N(() => {
|
|
54
|
-
t?.length && (
|
|
62
|
+
t?.length && (q((e) => {
|
|
55
63
|
const o = new Map(e);
|
|
56
64
|
return o.has("") || o.set("", t), o;
|
|
57
|
-
}),
|
|
65
|
+
}), G((e) => e.length ? e : t), Q((e) => {
|
|
58
66
|
const o = new Map(e);
|
|
59
67
|
return t.forEach((c) => o.set(a(c), c)), o;
|
|
60
68
|
}));
|
|
61
69
|
}, [t, a]);
|
|
62
|
-
const [
|
|
70
|
+
const [R, Y] = p([]), z = j(
|
|
63
71
|
(e) => {
|
|
64
72
|
if (!e) {
|
|
65
|
-
|
|
73
|
+
Y([]);
|
|
66
74
|
return;
|
|
67
75
|
}
|
|
68
76
|
const c = (Array.isArray(e) ? e : [e]).map((d) => {
|
|
69
|
-
const w =
|
|
77
|
+
const w = J.get(d);
|
|
70
78
|
if (w) return w;
|
|
71
79
|
if (t?.length) {
|
|
72
|
-
const
|
|
73
|
-
(
|
|
80
|
+
const T = t.find(
|
|
81
|
+
(le) => a(le) === d
|
|
74
82
|
);
|
|
75
|
-
if (
|
|
83
|
+
if (T) return T;
|
|
76
84
|
}
|
|
77
|
-
return
|
|
78
|
-
(
|
|
85
|
+
return $.find(
|
|
86
|
+
(T) => a(T) === d
|
|
79
87
|
) ?? null;
|
|
80
88
|
}).filter(Boolean);
|
|
81
|
-
|
|
89
|
+
Y(c);
|
|
82
90
|
},
|
|
83
|
-
[
|
|
91
|
+
[J, a, t, $]
|
|
84
92
|
);
|
|
85
93
|
N(() => {
|
|
86
|
-
|
|
87
|
-
}, [n,
|
|
88
|
-
const
|
|
94
|
+
z(n);
|
|
95
|
+
}, [n, z]);
|
|
96
|
+
const K = M.useMemo(() => l ? null : R[0] ?? null, [l, R]);
|
|
89
97
|
N(() => {
|
|
90
98
|
if (!m) return;
|
|
91
|
-
const e =
|
|
92
|
-
if (
|
|
93
|
-
|
|
99
|
+
const e = W || "";
|
|
100
|
+
if (B.has(e)) {
|
|
101
|
+
G(B.get(e));
|
|
94
102
|
return;
|
|
95
103
|
}
|
|
96
104
|
(async () => {
|
|
97
105
|
try {
|
|
98
|
-
|
|
99
|
-
const c = await i(
|
|
100
|
-
|
|
106
|
+
I({ loading: !0, error: null });
|
|
107
|
+
const c = await i(W);
|
|
108
|
+
q((d) => new Map(d).set(e, c)), G(c), Q((d) => {
|
|
101
109
|
const w = new Map(d);
|
|
102
|
-
return c.forEach((
|
|
110
|
+
return c.forEach((U) => w.set(a(U), U)), w;
|
|
103
111
|
});
|
|
104
112
|
} catch (c) {
|
|
105
|
-
|
|
113
|
+
I({
|
|
106
114
|
loading: !1,
|
|
107
115
|
error: c instanceof Error ? c.message : "Failed to fetch options"
|
|
108
116
|
});
|
|
109
117
|
} finally {
|
|
110
|
-
|
|
118
|
+
I((c) => ({ ...c, loading: !1 }));
|
|
111
119
|
}
|
|
112
120
|
})();
|
|
113
|
-
}, [m,
|
|
114
|
-
m &&
|
|
115
|
-
}, [m,
|
|
116
|
-
m &&
|
|
121
|
+
}, [m, W, B, i, a]), N(() => {
|
|
122
|
+
m && z(n);
|
|
123
|
+
}, [m, z, n]), N(() => {
|
|
124
|
+
m && P.current && P.current.focus();
|
|
117
125
|
}, [m]), N(() => {
|
|
118
|
-
if (!m || !
|
|
119
|
-
const e =
|
|
120
|
-
|
|
126
|
+
if (!m || !F.current) return;
|
|
127
|
+
const e = F.current.getBoundingClientRect();
|
|
128
|
+
se(e.width);
|
|
121
129
|
}, [m]);
|
|
122
|
-
const
|
|
130
|
+
const ce = j(
|
|
123
131
|
(e) => {
|
|
124
|
-
g?.(
|
|
132
|
+
g?.(S && e === n ? "" : e), L(!1);
|
|
125
133
|
},
|
|
126
|
-
[n, g,
|
|
127
|
-
),
|
|
134
|
+
[n, g, S]
|
|
135
|
+
), ae = j(
|
|
128
136
|
(e) => {
|
|
129
137
|
if (!l) return;
|
|
130
138
|
const o = Array.isArray(n) ? n : [], c = o.includes(e);
|
|
@@ -132,44 +140,44 @@ function Ie({
|
|
|
132
140
|
c ? d = o.filter((w) => w !== e) : d = [...o, e], g?.(d);
|
|
133
141
|
},
|
|
134
142
|
[n, g, l]
|
|
135
|
-
),
|
|
143
|
+
), oe = j(
|
|
136
144
|
(e) => {
|
|
137
|
-
e.stopPropagation(), e.preventDefault(), g?.(l ? [] : ""),
|
|
145
|
+
e.stopPropagation(), e.preventDefault(), g?.(l ? [] : ""), L(!1);
|
|
138
146
|
},
|
|
139
147
|
[g]
|
|
140
|
-
),
|
|
141
|
-
return /* @__PURE__ */ u("div", { className:
|
|
142
|
-
y && /* @__PURE__ */ r(
|
|
143
|
-
/* @__PURE__ */ u(
|
|
144
|
-
/* @__PURE__ */ r(
|
|
148
|
+
), Z = M.useId();
|
|
149
|
+
return /* @__PURE__ */ u("div", { className: k("flex flex-col gap-2", D), children: [
|
|
150
|
+
y && /* @__PURE__ */ r(pe, { htmlFor: Z, children: y }),
|
|
151
|
+
/* @__PURE__ */ u(xe, { open: m, onOpenChange: L, children: [
|
|
152
|
+
/* @__PURE__ */ r(we, { asChild: !0, children: /* @__PURE__ */ r(
|
|
145
153
|
"button",
|
|
146
154
|
{
|
|
147
|
-
id:
|
|
148
|
-
ref:
|
|
155
|
+
id: Z,
|
|
156
|
+
ref: F,
|
|
149
157
|
type: "button",
|
|
150
|
-
disabled:
|
|
151
|
-
className:
|
|
152
|
-
|
|
158
|
+
disabled: A,
|
|
159
|
+
className: k(
|
|
160
|
+
Ce({ size: ee }),
|
|
153
161
|
"!border-d-border/50 border !shadow-none",
|
|
154
|
-
|
|
162
|
+
A && "cursor-not-allowed opacity-50",
|
|
155
163
|
"font-normal",
|
|
156
164
|
"w-full",
|
|
157
165
|
"focus-visible:ring-d-ring focus-visible:ring-1",
|
|
158
166
|
m && "ring-d-ring ring-1",
|
|
159
|
-
|
|
167
|
+
v
|
|
160
168
|
),
|
|
161
169
|
children: /* @__PURE__ */ u("div", { className: "flex w-full flex-1 items-center justify-between overflow-hidden", children: [
|
|
162
|
-
l ? Array.isArray(n) && n.length > 0 ? /* @__PURE__ */ r("div", { className: "min-w-0 flex-1 truncate text-left", children: n.length === 1 ?
|
|
170
|
+
l ? Array.isArray(n) && n.length > 0 ? /* @__PURE__ */ r("div", { className: "min-w-0 flex-1 truncate text-left", children: n.length === 1 ? R[0] && s(R[0]) : `${n.length} elementi selezionati` }) : /* @__PURE__ */ r("span", { className: "text-d-muted-foreground truncate text-left", children: f }) : K ? /* @__PURE__ */ r("div", { className: "min-w-0 flex-1 truncate text-left", children: s(K) }) : /* @__PURE__ */ r("span", { className: "text-d-muted-foreground truncate text-left", children: f }),
|
|
163
171
|
/* @__PURE__ */ u("div", { className: "flex flex-shrink-0 items-center justify-end gap-1", children: [
|
|
164
|
-
|
|
172
|
+
S && (l && Array.isArray(n) && n.length > 0 || !l && K) && /* @__PURE__ */ r(
|
|
165
173
|
"div",
|
|
166
174
|
{
|
|
167
175
|
className: "border-d-input bg-d-accent cursor-pointer rounded-full p-1",
|
|
168
|
-
onClick:
|
|
176
|
+
onClick: oe,
|
|
169
177
|
onMouseDown: (e) => e.preventDefault(),
|
|
170
178
|
"aria-label": "Clear selection",
|
|
171
179
|
children: /* @__PURE__ */ r(
|
|
172
|
-
|
|
180
|
+
_,
|
|
173
181
|
{
|
|
174
182
|
name: "X",
|
|
175
183
|
size: "xs",
|
|
@@ -179,7 +187,7 @@ function Ie({
|
|
|
179
187
|
}
|
|
180
188
|
),
|
|
181
189
|
/* @__PURE__ */ r(
|
|
182
|
-
|
|
190
|
+
_,
|
|
183
191
|
{
|
|
184
192
|
name: "ChevronsUpDown",
|
|
185
193
|
size: "xs",
|
|
@@ -191,34 +199,34 @@ function Ie({
|
|
|
191
199
|
}
|
|
192
200
|
) }),
|
|
193
201
|
/* @__PURE__ */ r(
|
|
194
|
-
|
|
202
|
+
ye,
|
|
195
203
|
{
|
|
196
|
-
className:
|
|
197
|
-
style: { width:
|
|
204
|
+
className: k("p-0"),
|
|
205
|
+
style: { width: H ? `${H}px` : void 0 },
|
|
198
206
|
align: "start",
|
|
199
207
|
side: "bottom",
|
|
200
208
|
sideOffset: 4,
|
|
201
209
|
onWheel: (e) => e.stopPropagation(),
|
|
202
210
|
avoidCollisions: !1,
|
|
203
211
|
children: /* @__PURE__ */ r(
|
|
204
|
-
|
|
212
|
+
Se,
|
|
205
213
|
{
|
|
206
|
-
inputRef:
|
|
207
|
-
commandListRef:
|
|
214
|
+
inputRef: P,
|
|
215
|
+
commandListRef: re,
|
|
208
216
|
placeholder: f,
|
|
209
|
-
searchTerm:
|
|
210
|
-
onSearchTermChange:
|
|
211
|
-
fetchState:
|
|
212
|
-
options:
|
|
217
|
+
searchTerm: X,
|
|
218
|
+
onSearchTermChange: te,
|
|
219
|
+
fetchState: ne,
|
|
220
|
+
options: $,
|
|
213
221
|
notFound: h,
|
|
214
|
-
noResultsMessage:
|
|
222
|
+
noResultsMessage: E,
|
|
215
223
|
multiple: l,
|
|
216
224
|
value: n,
|
|
217
225
|
resolveOptionValue: a,
|
|
218
226
|
renderSelectedValue: s,
|
|
219
|
-
renderOptionItem:
|
|
220
|
-
onSelect:
|
|
221
|
-
onSelectMultiple:
|
|
227
|
+
renderOptionItem: C,
|
|
228
|
+
onSelect: ce,
|
|
229
|
+
onSelectMultiple: ae
|
|
222
230
|
}
|
|
223
231
|
)
|
|
224
232
|
}
|
|
@@ -226,33 +234,33 @@ function Ie({
|
|
|
226
234
|
] })
|
|
227
235
|
] });
|
|
228
236
|
}
|
|
229
|
-
function
|
|
237
|
+
function Ae({
|
|
230
238
|
option: i,
|
|
231
239
|
multiple: t,
|
|
232
240
|
value: x,
|
|
233
|
-
resolveOptionValue:
|
|
241
|
+
resolveOptionValue: C,
|
|
234
242
|
renderSelectedValue: a,
|
|
235
243
|
renderOptionItem: s,
|
|
236
244
|
onSelect: h,
|
|
237
245
|
onSelectMultiple: y
|
|
238
246
|
}) {
|
|
239
|
-
const f =
|
|
247
|
+
const f = C(i);
|
|
240
248
|
let n = !1;
|
|
241
249
|
return t ? n = Array.isArray(x) && x.includes(f) : n = x === f, /* @__PURE__ */ r(
|
|
242
|
-
|
|
250
|
+
V,
|
|
243
251
|
{
|
|
244
252
|
value: f,
|
|
245
253
|
onSelect: t ? y : h,
|
|
246
254
|
className: "cursor-pointer",
|
|
247
255
|
children: /* @__PURE__ */ u("div", { className: "flex w-full items-center justify-between overflow-hidden", children: [
|
|
248
256
|
/* @__PURE__ */ u("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: [
|
|
249
|
-
t && /* @__PURE__ */ r(
|
|
257
|
+
t && /* @__PURE__ */ r(fe, { checked: n }),
|
|
250
258
|
s ? /* @__PURE__ */ r("div", { className: "truncate", children: s(i) }) : /* @__PURE__ */ r("span", { className: "truncate", children: a(i) })
|
|
251
259
|
] }),
|
|
252
260
|
/* @__PURE__ */ r(
|
|
253
|
-
|
|
261
|
+
be,
|
|
254
262
|
{
|
|
255
|
-
className:
|
|
263
|
+
className: k(
|
|
256
264
|
"ml-2 h-4 w-4 flex-shrink-0",
|
|
257
265
|
n ? "opacity-100" : "opacity-0"
|
|
258
266
|
)
|
|
@@ -263,11 +271,11 @@ function Ce({
|
|
|
263
271
|
f
|
|
264
272
|
);
|
|
265
273
|
}
|
|
266
|
-
function
|
|
274
|
+
function Se({
|
|
267
275
|
inputRef: i,
|
|
268
276
|
commandListRef: t,
|
|
269
277
|
placeholder: x,
|
|
270
|
-
searchTerm:
|
|
278
|
+
searchTerm: C,
|
|
271
279
|
onSearchTermChange: a,
|
|
272
280
|
fetchState: s,
|
|
273
281
|
options: h,
|
|
@@ -275,47 +283,47 @@ function Ae({
|
|
|
275
283
|
noResultsMessage: f,
|
|
276
284
|
multiple: n,
|
|
277
285
|
value: g,
|
|
278
|
-
resolveOptionValue:
|
|
279
|
-
renderSelectedValue:
|
|
280
|
-
renderOptionItem:
|
|
281
|
-
onSelect:
|
|
282
|
-
onSelectMultiple:
|
|
286
|
+
resolveOptionValue: A,
|
|
287
|
+
renderSelectedValue: v,
|
|
288
|
+
renderOptionItem: D,
|
|
289
|
+
onSelect: E,
|
|
290
|
+
onSelectMultiple: S
|
|
283
291
|
}) {
|
|
284
|
-
return /* @__PURE__ */ u(
|
|
292
|
+
return /* @__PURE__ */ u(me, { shouldFilter: !1, className: "w-full border-none shadow-sm", children: [
|
|
285
293
|
/* @__PURE__ */ r(
|
|
286
|
-
|
|
294
|
+
ue,
|
|
287
295
|
{
|
|
288
296
|
ref: i,
|
|
289
297
|
placeholder: x,
|
|
290
298
|
className: "placeholder:text-d-muted-foreground",
|
|
291
|
-
value:
|
|
299
|
+
value: C,
|
|
292
300
|
onValueChange: a
|
|
293
301
|
}
|
|
294
302
|
),
|
|
295
|
-
s.loading && h.length > 0 && /* @__PURE__ */ r("div", { className: "flex items-center justify-center p-2", children: /* @__PURE__ */ r(
|
|
296
|
-
/* @__PURE__ */ u(
|
|
303
|
+
s.loading && h.length > 0 && /* @__PURE__ */ r("div", { className: "flex items-center justify-center p-2", children: /* @__PURE__ */ r(Ne, { className: "h-4 w-4 animate-spin" }) }),
|
|
304
|
+
/* @__PURE__ */ u(he, { ref: t, children: [
|
|
297
305
|
s.error && /* @__PURE__ */ r("div", { className: "text-d-destructive p-3 text-center", children: s.error }),
|
|
298
|
-
s.loading && h.length === 0 && /* @__PURE__ */ r(
|
|
299
|
-
!s.loading && !s.error && h.length === 0 && (y || /* @__PURE__ */ r(
|
|
300
|
-
!s.loading && !s.error && h.length > 0 && /* @__PURE__ */ r(
|
|
301
|
-
|
|
306
|
+
s.loading && h.length === 0 && /* @__PURE__ */ r(Me, {}),
|
|
307
|
+
!s.loading && !s.error && h.length === 0 && (y || /* @__PURE__ */ r(ge, { children: f || "No results found." })),
|
|
308
|
+
!s.loading && !s.error && h.length > 0 && /* @__PURE__ */ r(O, { children: h.map((l) => /* @__PURE__ */ r(
|
|
309
|
+
Ae,
|
|
302
310
|
{
|
|
303
311
|
option: l,
|
|
304
312
|
multiple: n,
|
|
305
313
|
value: g,
|
|
306
|
-
resolveOptionValue:
|
|
307
|
-
renderSelectedValue:
|
|
308
|
-
renderOptionItem:
|
|
309
|
-
onSelect:
|
|
310
|
-
onSelectMultiple:
|
|
314
|
+
resolveOptionValue: A,
|
|
315
|
+
renderSelectedValue: v,
|
|
316
|
+
renderOptionItem: D,
|
|
317
|
+
onSelect: E,
|
|
318
|
+
onSelectMultiple: S
|
|
311
319
|
},
|
|
312
|
-
|
|
320
|
+
A(l)
|
|
313
321
|
)) })
|
|
314
322
|
] })
|
|
315
323
|
] });
|
|
316
324
|
}
|
|
317
|
-
function
|
|
318
|
-
return /* @__PURE__ */ r(
|
|
325
|
+
function Me() {
|
|
326
|
+
return /* @__PURE__ */ r(O, { children: [1, 2, 3].map((i) => /* @__PURE__ */ r(V, { disabled: !0, children: /* @__PURE__ */ u("div", { className: "flex w-full items-center gap-2", children: [
|
|
319
327
|
/* @__PURE__ */ r("div", { className: "bg-d-secondary h-6 w-6 animate-pulse rounded-full" }),
|
|
320
328
|
/* @__PURE__ */ u("div", { className: "flex flex-1 flex-col gap-1", children: [
|
|
321
329
|
/* @__PURE__ */ r("div", { className: "bg-d-secondary h-4 w-24 animate-pulse rounded" }),
|
|
@@ -324,6 +332,6 @@ function Se() {
|
|
|
324
332
|
] }) }, i)) });
|
|
325
333
|
}
|
|
326
334
|
export {
|
|
327
|
-
|
|
328
|
-
|
|
335
|
+
Be as AsyncSelect,
|
|
336
|
+
Ce as selectTriggerVariants
|
|
329
337
|
};
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as e, jsxs as
|
|
3
|
-
import { Root as
|
|
4
|
-
import { cva as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
import { jsx as e, jsxs as v } from "react/jsx-runtime";
|
|
3
|
+
import { Root as p } from "../../node_modules/@radix-ui/react-slot/dist/index.js";
|
|
4
|
+
import { cva as h } from "../../node_modules/class-variance-authority/dist/index.js";
|
|
5
|
+
import { designTokens as t } from "../../lib/design-tokens.js";
|
|
6
|
+
import { cn as a } from "../../lib/utils.js";
|
|
7
|
+
import { Icon as u } from "./icon.js";
|
|
8
|
+
const b = h(
|
|
9
|
+
a(
|
|
10
|
+
t.badge.base,
|
|
11
|
+
t.radius.default,
|
|
12
|
+
t.focusRing,
|
|
13
|
+
"transition-[color,box-shadow] overflow-hidden",
|
|
14
|
+
"[&>svg]:size-3 [&>svg]:pointer-events-none"
|
|
15
|
+
),
|
|
9
16
|
{
|
|
10
17
|
variants: {
|
|
11
18
|
variant: {
|
|
@@ -32,46 +39,46 @@ const u = p(
|
|
|
32
39
|
}
|
|
33
40
|
}
|
|
34
41
|
);
|
|
35
|
-
function
|
|
36
|
-
className:
|
|
37
|
-
variant:
|
|
38
|
-
asChild:
|
|
39
|
-
disabled:
|
|
40
|
-
iconLeft:
|
|
41
|
-
iconRight:
|
|
42
|
+
function k({
|
|
43
|
+
className: o,
|
|
44
|
+
variant: d,
|
|
45
|
+
asChild: n = !1,
|
|
46
|
+
disabled: s = !1,
|
|
47
|
+
iconLeft: c,
|
|
48
|
+
iconRight: i,
|
|
42
49
|
...r
|
|
43
50
|
}) {
|
|
44
|
-
const
|
|
45
|
-
return
|
|
46
|
-
|
|
51
|
+
const g = n ? p : "span";
|
|
52
|
+
return n ? /* @__PURE__ */ e(
|
|
53
|
+
g,
|
|
47
54
|
{
|
|
48
55
|
"data-slot": "badge",
|
|
49
|
-
className:
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
56
|
+
className: a(
|
|
57
|
+
b({ variant: d }),
|
|
58
|
+
s && "cursor-not-allowed opacity-50",
|
|
59
|
+
o
|
|
53
60
|
),
|
|
54
61
|
...r
|
|
55
62
|
}
|
|
56
|
-
) : /* @__PURE__ */
|
|
57
|
-
|
|
63
|
+
) : /* @__PURE__ */ v(
|
|
64
|
+
g,
|
|
58
65
|
{
|
|
59
66
|
"data-slot": "badge",
|
|
60
|
-
className:
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
67
|
+
className: a(
|
|
68
|
+
b({ variant: d }),
|
|
69
|
+
s && "cursor-not-allowed opacity-50",
|
|
70
|
+
o
|
|
64
71
|
),
|
|
65
72
|
...r,
|
|
66
73
|
children: [
|
|
67
|
-
|
|
74
|
+
c && /* @__PURE__ */ e(u, { name: c }),
|
|
68
75
|
r.children,
|
|
69
|
-
|
|
76
|
+
i && /* @__PURE__ */ e(u, { name: i })
|
|
70
77
|
]
|
|
71
78
|
}
|
|
72
79
|
);
|
|
73
80
|
}
|
|
74
81
|
export {
|
|
75
|
-
|
|
76
|
-
|
|
82
|
+
k as Badge,
|
|
83
|
+
b as badgeVariants
|
|
77
84
|
};
|