laif-ds 0.2.49 → 0.2.51
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/_virtual/index4.js +5 -5
- package/dist/_virtual/index5.js +5 -5
- package/dist/_virtual/index6.js +2 -2
- package/dist/_virtual/index7.js +2 -2
- 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/node_modules/eventemitter3/index2.js +1 -1
- package/dist/node_modules/hast-util-to-jsx-runtime/lib/index.js +1 -1
- package/dist/node_modules/style-to-object/cjs/index.js +1 -1
- package/dist/node_modules/unified/lib/index.js +1 -1
- package/dist/styles.css +1 -1
- package/dist/styles.v3.css +1 -1
- package/package.json +1 -1
package/dist/_virtual/index4.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { getDefaultExportFromCjs as
|
|
3
|
-
import { __require as
|
|
4
|
-
var t =
|
|
5
|
-
const
|
|
2
|
+
import { getDefaultExportFromCjs as e } from "./_commonjsHelpers.js";
|
|
3
|
+
import { __require as r } from "../node_modules/extend/index.js";
|
|
4
|
+
var t = r();
|
|
5
|
+
const x = /* @__PURE__ */ e(t);
|
|
6
6
|
export {
|
|
7
|
-
|
|
7
|
+
x as default
|
|
8
8
|
};
|
package/dist/_virtual/index5.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { getDefaultExportFromCjs as
|
|
3
|
-
import { __require as
|
|
4
|
-
var t =
|
|
5
|
-
const
|
|
2
|
+
import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.js";
|
|
3
|
+
import { __require as e } from "../node_modules/style-to-js/cjs/index.js";
|
|
4
|
+
var t = e();
|
|
5
|
+
const a = /* @__PURE__ */ r(t);
|
|
6
6
|
export {
|
|
7
|
-
|
|
7
|
+
a as default
|
|
8
8
|
};
|
package/dist/_virtual/index6.js
CHANGED
package/dist/_virtual/index7.js
CHANGED
|
@@ -5,7 +5,7 @@ import { createPortal as I } from "react-dom";
|
|
|
5
5
|
import { Button as P } from "./ui/button.js";
|
|
6
6
|
import { Popover as z, PopoverTrigger as L, PopoverContent as _ } from "./ui/popover.js";
|
|
7
7
|
import { TooltipProvider as j } from "./ui/tooltip.js";
|
|
8
|
-
import { Typo as
|
|
8
|
+
import { Typo as k } from "./ui/typo.js";
|
|
9
9
|
import { cn as m } from "../lib/utils.js";
|
|
10
10
|
import F from "../node_modules/lucide-react/dist/esm/icons/pencil.js";
|
|
11
11
|
import H from "../node_modules/lucide-react/dist/esm/icons/ellipsis-vertical.js";
|
|
@@ -179,10 +179,10 @@ const Q = ({
|
|
|
179
179
|
},
|
|
180
180
|
[]
|
|
181
181
|
), a = b(
|
|
182
|
-
(g, v,
|
|
182
|
+
(g, v, C) => {
|
|
183
183
|
for (const N of c.current) {
|
|
184
|
-
const
|
|
185
|
-
|
|
184
|
+
const w = N[g];
|
|
185
|
+
w && w(v, C);
|
|
186
186
|
}
|
|
187
187
|
},
|
|
188
188
|
[]
|
|
@@ -238,7 +238,7 @@ function ge({
|
|
|
238
238
|
}
|
|
239
239
|
);
|
|
240
240
|
}
|
|
241
|
-
const U = "w-80 flex-shrink-0 rounded-lg border flex flex-col border-d-border bg-d-sidebar py-
|
|
241
|
+
const U = "w-80 flex-shrink-0 rounded-lg border flex flex-col border-d-border bg-d-sidebar py-1.5";
|
|
242
242
|
function pe({
|
|
243
243
|
className: e,
|
|
244
244
|
columnId: r,
|
|
@@ -253,7 +253,7 @@ function pe({
|
|
|
253
253
|
"aria-labelledby": `column-${r}-title`,
|
|
254
254
|
className: m(
|
|
255
255
|
U,
|
|
256
|
-
c && "border-d-primary",
|
|
256
|
+
c && "border-d-primary border-2 bg-d-primary/5",
|
|
257
257
|
e
|
|
258
258
|
),
|
|
259
259
|
draggable: !1,
|
|
@@ -320,8 +320,8 @@ function me({
|
|
|
320
320
|
{
|
|
321
321
|
className: m(
|
|
322
322
|
X,
|
|
323
|
-
c === "top" && "border-t-d-primary",
|
|
324
|
-
c === "bottom" && "border-b-d-primary",
|
|
323
|
+
c === "top" && "border-t-d-primary !border-t-[3px]",
|
|
324
|
+
c === "bottom" && "border-b-d-primary !border-b-[3px]",
|
|
325
325
|
r
|
|
326
326
|
),
|
|
327
327
|
onDragLeave: () => {
|
|
@@ -344,7 +344,7 @@ function me({
|
|
|
344
344
|
}
|
|
345
345
|
);
|
|
346
346
|
}
|
|
347
|
-
const Z = "p-
|
|
347
|
+
const Z = "p-2.5 text-start";
|
|
348
348
|
function be({
|
|
349
349
|
className: e,
|
|
350
350
|
data: r,
|
|
@@ -357,7 +357,7 @@ function be({
|
|
|
357
357
|
children: u,
|
|
358
358
|
...a
|
|
359
359
|
}) {
|
|
360
|
-
const [o, g] = y(!1), [v,
|
|
360
|
+
const [o, g] = y(!1), [v, C] = y(!1), { draggableDescribedById: N, onDragStart: w } = B(), K = t || s && s.length > 0;
|
|
361
361
|
return /* @__PURE__ */ D(
|
|
362
362
|
"div",
|
|
363
363
|
{
|
|
@@ -376,7 +376,7 @@ function be({
|
|
|
376
376
|
f,
|
|
377
377
|
h.width / 2,
|
|
378
378
|
h.height / 2
|
|
379
|
-
), setTimeout(() => document.body.removeChild(f), 0), n.currentTarget.blur(),
|
|
379
|
+
), setTimeout(() => document.body.removeChild(f), 0), n.currentTarget.blur(), w(r.id);
|
|
380
380
|
},
|
|
381
381
|
onDragEnd: () => {
|
|
382
382
|
g(!1);
|
|
@@ -392,7 +392,7 @@ function be({
|
|
|
392
392
|
!l && "bg-d-card",
|
|
393
393
|
Z,
|
|
394
394
|
"focus-visible:ring-d-ring inline-flex w-full cursor-grab touch-manipulation flex-col gap-2 focus-visible:ring-1 focus-visible:outline-none",
|
|
395
|
-
o ? "cursor-grabbing active:cursor-grabbing" : "group/card relative",
|
|
395
|
+
o ? "cursor-grabbing active:cursor-grabbing opacity-40" : "group/card relative",
|
|
396
396
|
i && "rotate-1 transform shadow-lg",
|
|
397
397
|
e
|
|
398
398
|
),
|
|
@@ -408,10 +408,11 @@ function be({
|
|
|
408
408
|
c && c.length > 0 && /* @__PURE__ */ d("div", { className: "mt-1.5 flex flex-wrap gap-1.5", children: c.map((n, f) => /* @__PURE__ */ D(
|
|
409
409
|
"div",
|
|
410
410
|
{
|
|
411
|
-
className: "inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[11px]",
|
|
411
|
+
className: "inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-[11px]",
|
|
412
412
|
style: {
|
|
413
|
-
backgroundColor:
|
|
414
|
-
color:
|
|
413
|
+
backgroundColor: void 0,
|
|
414
|
+
color: void 0,
|
|
415
|
+
borderColor: l ? `${l}40` : void 0
|
|
415
416
|
},
|
|
416
417
|
children: [
|
|
417
418
|
/* @__PURE__ */ d("span", { className: "truncate font-medium", children: n.name }),
|
|
@@ -423,7 +424,7 @@ function be({
|
|
|
423
424
|
},
|
|
424
425
|
f
|
|
425
426
|
)) }),
|
|
426
|
-
|
|
427
|
+
K && !o && /* @__PURE__ */ D(
|
|
427
428
|
"div",
|
|
428
429
|
{
|
|
429
430
|
className: m(
|
|
@@ -443,7 +444,7 @@ function be({
|
|
|
443
444
|
children: /* @__PURE__ */ d(F, { className: "size-3.5" })
|
|
444
445
|
}
|
|
445
446
|
),
|
|
446
|
-
s && s.length > 0 && /* @__PURE__ */ D(z, { open: v, onOpenChange:
|
|
447
|
+
s && s.length > 0 && /* @__PURE__ */ D(z, { open: v, onOpenChange: C, children: [
|
|
447
448
|
/* @__PURE__ */ d(L, { asChild: !0, children: /* @__PURE__ */ d(
|
|
448
449
|
P,
|
|
449
450
|
{
|
|
@@ -471,7 +472,7 @@ function be({
|
|
|
471
472
|
size: "sm",
|
|
472
473
|
className: "w-full justify-start gap-2",
|
|
473
474
|
onClick: (h) => {
|
|
474
|
-
h.stopPropagation(), h.preventDefault(), n.onClick(),
|
|
475
|
+
h.stopPropagation(), h.preventDefault(), n.onClick(), C(!1);
|
|
475
476
|
},
|
|
476
477
|
children: [
|
|
477
478
|
n.icon && /* @__PURE__ */ d("span", { className: "size-4", children: n.icon }),
|
|
@@ -495,7 +496,7 @@ function De({
|
|
|
495
496
|
...r
|
|
496
497
|
}) {
|
|
497
498
|
return /* @__PURE__ */ d(
|
|
498
|
-
|
|
499
|
+
k,
|
|
499
500
|
{
|
|
500
501
|
variant: "small",
|
|
501
502
|
as: "h3",
|
|
@@ -509,7 +510,7 @@ function ve({
|
|
|
509
510
|
...r
|
|
510
511
|
}) {
|
|
511
512
|
return /* @__PURE__ */ d(
|
|
512
|
-
|
|
513
|
+
k,
|
|
513
514
|
{
|
|
514
515
|
variant: "caption",
|
|
515
516
|
as: "p",
|
|
@@ -1,151 +1,145 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { useState as
|
|
4
|
-
import { KanbanBoardProvider as H, KanbanBoard as I, KanbanBoardColumn as
|
|
5
|
-
import { stringToHexColor as E } from "../../lib/utils.js";
|
|
6
|
-
import {
|
|
7
|
-
import Q from "
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
import { jsx as i, jsxs as l, Fragment as z } from "react/jsx-runtime";
|
|
3
|
+
import { useState as L } from "react";
|
|
4
|
+
import { KanbanBoardProvider as H, KanbanBoard as I, KanbanBoardColumn as P, KanbanBoardColumnHeader as S, KanbanBoardColumnList as A, KanbanBoardColumnListItem as F, KanbanBoardCard as J, KanbanBoardCardTitle as R, KanbanBoardCardDescription as W } from "../kanban.js";
|
|
5
|
+
import { stringToHexColor as q, hexToRgba as E } from "../../lib/utils.js";
|
|
6
|
+
import { Button as G } from "./button.js";
|
|
7
|
+
import { Icon as Q } from "./icon.js";
|
|
8
|
+
import U from "../../node_modules/lucide-react/dist/esm/icons/plus.js";
|
|
9
|
+
function M({
|
|
10
|
+
columns: v,
|
|
10
11
|
initialTasks: K,
|
|
11
|
-
onTaskMove:
|
|
12
|
+
onTaskMove: m,
|
|
12
13
|
onTaskEdit: x,
|
|
13
14
|
onTaskCreate: u,
|
|
14
15
|
taskActions: B,
|
|
15
16
|
renderTaskContent: b,
|
|
16
|
-
className:
|
|
17
|
-
allowTaskCreate:
|
|
18
|
-
createTaskLabel: O = "Nuovo task"
|
|
17
|
+
className: y,
|
|
18
|
+
allowTaskCreate: j = !0
|
|
19
19
|
}) {
|
|
20
|
-
const [h,
|
|
21
|
-
const
|
|
20
|
+
const [h, N] = L(K), g = (r) => {
|
|
21
|
+
const d = {};
|
|
22
22
|
for (const e of Object.keys(r))
|
|
23
|
-
|
|
24
|
-
return
|
|
25
|
-
},
|
|
26
|
-
|
|
27
|
-
const
|
|
28
|
-
let
|
|
29
|
-
for (const s of Object.keys(
|
|
30
|
-
const c =
|
|
23
|
+
d[e] = [...r[e]];
|
|
24
|
+
return d;
|
|
25
|
+
}, w = (r, d) => {
|
|
26
|
+
N((e) => {
|
|
27
|
+
const o = g(e);
|
|
28
|
+
let t, n;
|
|
29
|
+
for (const s of Object.keys(o)) {
|
|
30
|
+
const c = o[s].findIndex((p) => p.id === r);
|
|
31
31
|
if (c !== -1) {
|
|
32
|
-
|
|
32
|
+
n = s, [t] = o[s].splice(c, 1);
|
|
33
33
|
break;
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
|
-
return !
|
|
36
|
+
return !t || n === d ? e : (o[d] || (o[d] = []), o[d].push(t), n && m && m(r, n, d), o);
|
|
37
37
|
});
|
|
38
|
-
},
|
|
39
|
-
|
|
40
|
-
const
|
|
41
|
-
(a) =>
|
|
38
|
+
}, O = (r, d, e, o) => {
|
|
39
|
+
N((t) => {
|
|
40
|
+
const n = g(t), s = Object.keys(n).find(
|
|
41
|
+
(a) => n[a].some((D) => D.id === r)
|
|
42
42
|
);
|
|
43
|
-
if (!s) return
|
|
44
|
-
const c =
|
|
43
|
+
if (!s) return t;
|
|
44
|
+
const c = n[s].findIndex(
|
|
45
45
|
(a) => a.id === r
|
|
46
46
|
);
|
|
47
|
-
if (c === -1) return
|
|
48
|
-
const [
|
|
49
|
-
|
|
50
|
-
const f =
|
|
51
|
-
(a) => a.id ===
|
|
47
|
+
if (c === -1) return t;
|
|
48
|
+
const [p] = n[s].splice(c, 1);
|
|
49
|
+
n[e] || (n[e] = []);
|
|
50
|
+
const f = n[e].findIndex(
|
|
51
|
+
(a) => a.id === d
|
|
52
52
|
);
|
|
53
53
|
if (f === -1)
|
|
54
|
-
|
|
54
|
+
n[e].push(p);
|
|
55
55
|
else {
|
|
56
|
-
const a =
|
|
57
|
-
|
|
56
|
+
const a = o === "top" ? f : f + 1;
|
|
57
|
+
n[e].splice(a, 0, p);
|
|
58
58
|
}
|
|
59
|
-
return s !== e &&
|
|
59
|
+
return s !== e && m && m(r, s, e), n;
|
|
60
60
|
});
|
|
61
|
-
},
|
|
62
|
-
return /* @__PURE__ */
|
|
63
|
-
const
|
|
61
|
+
}, C = (r) => JSON.parse(r);
|
|
62
|
+
return /* @__PURE__ */ i(H, { children: /* @__PURE__ */ i(I, { className: y, children: v.map((r) => {
|
|
63
|
+
const d = q(r.label);
|
|
64
64
|
return /* @__PURE__ */ l(
|
|
65
|
-
|
|
65
|
+
P,
|
|
66
66
|
{
|
|
67
67
|
columnId: r.id,
|
|
68
68
|
onDropOverColumn: (e) => {
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
},
|
|
72
|
-
className: "group/column border-0",
|
|
73
|
-
style: {
|
|
74
|
-
backgroundColor: `${n}1d`
|
|
69
|
+
const o = C(e);
|
|
70
|
+
w(o.id, r.id);
|
|
75
71
|
},
|
|
72
|
+
className: "group/column rounded-xl backdrop-blur-sm transition-colors",
|
|
76
73
|
children: [
|
|
77
|
-
/* @__PURE__ */
|
|
78
|
-
/* @__PURE__ */
|
|
79
|
-
|
|
74
|
+
/* @__PURE__ */ i(S, { className: "relative mb-1.5 px-1.5 pt-1.5", children: /* @__PURE__ */ l("div", { className: "flex w-full items-center justify-between", children: [
|
|
75
|
+
/* @__PURE__ */ l("div", { className: "flex items-center gap-2", children: [
|
|
76
|
+
/* @__PURE__ */ i(
|
|
77
|
+
"div",
|
|
78
|
+
{
|
|
79
|
+
className: "flex items-center gap-1.5 rounded-md px-2 py-0.5 text-xs font-semibold",
|
|
80
|
+
style: {
|
|
81
|
+
backgroundColor: E(d, 0.15),
|
|
82
|
+
color: d
|
|
83
|
+
},
|
|
84
|
+
children: /* @__PURE__ */ i("span", { className: "max-w-[150px] truncate", children: r.label })
|
|
85
|
+
}
|
|
86
|
+
),
|
|
87
|
+
/* @__PURE__ */ i("span", { className: "text-d-muted-foreground text-xs", children: h[r.id]?.length ?? 0 })
|
|
88
|
+
] }),
|
|
89
|
+
/* @__PURE__ */ i("div", { className: "flex items-center gap-1", children: j && u && /* @__PURE__ */ i(
|
|
90
|
+
G,
|
|
80
91
|
{
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
}
|
|
86
|
-
children: r.label
|
|
92
|
+
variant: "ghost",
|
|
93
|
+
size: "icon",
|
|
94
|
+
className: "text-d-muted-foreground hover:text-d-foreground h-6 w-6",
|
|
95
|
+
onClick: () => u(r.id),
|
|
96
|
+
children: /* @__PURE__ */ i(U, { className: "size-3.5" })
|
|
87
97
|
}
|
|
88
|
-
)
|
|
89
|
-
/* @__PURE__ */ o("span", { className: "text-d-muted-foreground text-sm", children: h[r.id]?.length ?? 0 })
|
|
98
|
+
) })
|
|
90
99
|
] }) }),
|
|
91
|
-
/* @__PURE__ */
|
|
100
|
+
/* @__PURE__ */ i(A, { className: "px-1 pb-2", children: h[r.id]?.map((e) => /* @__PURE__ */ i(
|
|
92
101
|
F,
|
|
93
102
|
{
|
|
94
103
|
cardId: e.id,
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
104
|
+
className: "mb-1.5 border-0 last:mb-0",
|
|
105
|
+
onDropOverListItem: (o, t) => {
|
|
106
|
+
if (t === "none") return;
|
|
107
|
+
const n = C(o);
|
|
108
|
+
O(
|
|
109
|
+
n.id,
|
|
100
110
|
e.id,
|
|
101
111
|
r.id,
|
|
102
|
-
|
|
112
|
+
t
|
|
103
113
|
);
|
|
104
114
|
},
|
|
105
|
-
children: /* @__PURE__ */
|
|
115
|
+
children: /* @__PURE__ */ i(
|
|
106
116
|
J,
|
|
107
117
|
{
|
|
108
118
|
data: e,
|
|
119
|
+
className: "group/card hover:border-d-border/40 relative rounded-md border border-transparent shadow-sm transition-all duration-200 hover:shadow-md",
|
|
120
|
+
backgroundColor: d,
|
|
109
121
|
onEdit: x ? () => x(e, r.id) : void 0,
|
|
110
122
|
actions: B?.(e, r.id),
|
|
111
123
|
meta: e.meta,
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
G,
|
|
124
|
+
children: b ? b(e, r.id) : /* @__PURE__ */ l(z, { children: [
|
|
125
|
+
/* @__PURE__ */ l("div", { className: "mb-1 flex items-start gap-2", children: [
|
|
126
|
+
e.icon && /* @__PURE__ */ i(
|
|
127
|
+
Q,
|
|
117
128
|
{
|
|
118
129
|
name: e.icon,
|
|
119
130
|
size: "sm",
|
|
120
|
-
className: "text-d-foreground
|
|
131
|
+
className: "text-d-muted-foreground mt-0.5 shrink-0"
|
|
121
132
|
}
|
|
122
133
|
),
|
|
123
|
-
/* @__PURE__ */
|
|
134
|
+
/* @__PURE__ */ i(R, { className: "flex-1 text-sm leading-snug font-medium", children: e.title })
|
|
124
135
|
] }),
|
|
125
|
-
e.description && /* @__PURE__ */
|
|
136
|
+
e.description && /* @__PURE__ */ i(W, { className: "text-d-muted-foreground mt-1.5 line-clamp-2 text-xs", children: e.description })
|
|
126
137
|
] })
|
|
127
138
|
}
|
|
128
139
|
)
|
|
129
140
|
},
|
|
130
141
|
e.id
|
|
131
|
-
)) })
|
|
132
|
-
v && u && /* @__PURE__ */ o("div", { className: "px-2 pt-1", children: /* @__PURE__ */ l(
|
|
133
|
-
"button",
|
|
134
|
-
{
|
|
135
|
-
className: "flex w-full cursor-pointer items-center justify-center gap-1.5 rounded-md px-2 py-1.5 text-sm transition-colors",
|
|
136
|
-
style: {
|
|
137
|
-
backgroundColor: `${n}1a`,
|
|
138
|
-
color: n
|
|
139
|
-
},
|
|
140
|
-
onClick: (e) => {
|
|
141
|
-
e.stopPropagation(), u(r.id);
|
|
142
|
-
},
|
|
143
|
-
children: [
|
|
144
|
-
/* @__PURE__ */ o(Q, { className: "size-4" }),
|
|
145
|
-
/* @__PURE__ */ o("span", { children: O })
|
|
146
|
-
]
|
|
147
|
-
}
|
|
148
|
-
) })
|
|
142
|
+
)) })
|
|
149
143
|
]
|
|
150
144
|
},
|
|
151
145
|
r.id
|
|
@@ -153,5 +147,5 @@ function _({
|
|
|
153
147
|
}) }) });
|
|
154
148
|
}
|
|
155
149
|
export {
|
|
156
|
-
|
|
150
|
+
M as AppKanban
|
|
157
151
|
};
|
|
@@ -1,50 +1,64 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as r, jsx as t, Fragment as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
2
|
+
import { jsxs as r, jsx as t, Fragment as O } from "react/jsx-runtime";
|
|
3
|
+
import { designTokens as h } from "../../lib/design-tokens.js";
|
|
4
|
+
import { cn as o } from "../../lib/utils.js";
|
|
5
|
+
import { Icon as j } from "./icon.js";
|
|
6
|
+
import { Label as C } from "./label.js";
|
|
7
|
+
import { RadioGroup as F, RadioGroupItem as I } from "./radio-group.js";
|
|
8
|
+
const d = ({ content: e }) => typeof e == "string" ? /* @__PURE__ */ t("span", { children: e }) : e, P = ({ option: e }) => /* @__PURE__ */ r(O, { children: [
|
|
9
|
+
/* @__PURE__ */ r(
|
|
10
|
+
"div",
|
|
11
|
+
{
|
|
12
|
+
className: o(
|
|
13
|
+
"text-d-foreground flex flex-row items-center gap-1.5",
|
|
14
|
+
h.text.base
|
|
15
|
+
),
|
|
16
|
+
children: [
|
|
17
|
+
e.icon && /* @__PURE__ */ t(j, { size: "xs", className: "min-h-4 min-w-4", name: e.icon }),
|
|
18
|
+
/* @__PURE__ */ t(d, { content: e.label })
|
|
19
|
+
]
|
|
20
|
+
}
|
|
21
|
+
),
|
|
22
|
+
e.description && /* @__PURE__ */ t("div", { className: "text-d-foreground text-xs font-light", children: /* @__PURE__ */ t(d, { content: e.description }) })
|
|
23
|
+
] }), T = ({
|
|
14
24
|
option: e,
|
|
15
25
|
optionId: c,
|
|
16
|
-
isDisabled:
|
|
26
|
+
isDisabled: s,
|
|
17
27
|
isCard: n,
|
|
18
28
|
optionClassName: l
|
|
19
29
|
}) => /* @__PURE__ */ r(
|
|
20
|
-
|
|
30
|
+
C,
|
|
21
31
|
{
|
|
22
32
|
htmlFor: c,
|
|
23
|
-
className:
|
|
33
|
+
className: o(
|
|
24
34
|
"flex items-center gap-2",
|
|
25
|
-
|
|
26
|
-
n &&
|
|
35
|
+
s ? "cursor-not-allowed opacity-50" : "cursor-pointer",
|
|
36
|
+
n && o(
|
|
37
|
+
"bg-d-card border-d-border border p-2 shadow",
|
|
38
|
+
h.radius.lg
|
|
39
|
+
// Card layout uses lg radius
|
|
40
|
+
),
|
|
27
41
|
l
|
|
28
42
|
),
|
|
29
43
|
children: [
|
|
30
|
-
/* @__PURE__ */ t(
|
|
44
|
+
/* @__PURE__ */ t(I, { value: e.value, id: c, disabled: s }),
|
|
31
45
|
/* @__PURE__ */ t(
|
|
32
46
|
"div",
|
|
33
47
|
{
|
|
34
|
-
className:
|
|
48
|
+
className: o(
|
|
35
49
|
"flex flex-1 flex-col items-start gap-1",
|
|
36
|
-
|
|
50
|
+
s ? "cursor-not-allowed" : "cursor-pointer"
|
|
37
51
|
),
|
|
38
|
-
children: /* @__PURE__ */ t(
|
|
52
|
+
children: /* @__PURE__ */ t(P, { option: e })
|
|
39
53
|
}
|
|
40
54
|
)
|
|
41
55
|
]
|
|
42
56
|
}
|
|
43
57
|
);
|
|
44
|
-
function
|
|
58
|
+
function E({
|
|
45
59
|
options: e,
|
|
46
60
|
value: c,
|
|
47
|
-
defaultValue:
|
|
61
|
+
defaultValue: s,
|
|
48
62
|
onValueChange: n,
|
|
49
63
|
label: l,
|
|
50
64
|
description: i,
|
|
@@ -52,55 +66,55 @@ function k({
|
|
|
52
66
|
required: f = !1,
|
|
53
67
|
name: u,
|
|
54
68
|
orientation: p = "vertical",
|
|
55
|
-
loop:
|
|
56
|
-
className:
|
|
57
|
-
wrpClassName:
|
|
58
|
-
optionClassName:
|
|
59
|
-
layout:
|
|
69
|
+
loop: g = !0,
|
|
70
|
+
className: v = "",
|
|
71
|
+
wrpClassName: N = "",
|
|
72
|
+
optionClassName: w = "",
|
|
73
|
+
layout: b = "default",
|
|
60
74
|
error: m
|
|
61
75
|
}) {
|
|
62
|
-
const
|
|
63
|
-
return /* @__PURE__ */ r("div", { className:
|
|
76
|
+
const y = p === "horizontal", R = b === "card";
|
|
77
|
+
return /* @__PURE__ */ r("div", { className: o("flex w-full flex-col gap-2", N), children: [
|
|
64
78
|
(l || i) && /* @__PURE__ */ r("div", { className: "flex flex-col gap-1", children: [
|
|
65
79
|
l && /* @__PURE__ */ r(
|
|
66
80
|
"div",
|
|
67
81
|
{
|
|
68
|
-
className:
|
|
82
|
+
className: o(
|
|
69
83
|
"flex items-center gap-1 text-sm font-medium",
|
|
70
84
|
m ? "text-d-destructive" : "text-d-foreground"
|
|
71
85
|
),
|
|
72
86
|
children: [
|
|
73
|
-
/* @__PURE__ */ t(
|
|
87
|
+
/* @__PURE__ */ t(d, { content: l }),
|
|
74
88
|
f && /* @__PURE__ */ t("span", { children: "*" })
|
|
75
89
|
]
|
|
76
90
|
}
|
|
77
91
|
),
|
|
78
|
-
i && /* @__PURE__ */ t("div", { className: "text-bodySecondary text-xs", children: /* @__PURE__ */ t(
|
|
92
|
+
i && /* @__PURE__ */ t("div", { className: "text-bodySecondary text-xs", children: /* @__PURE__ */ t(d, { content: i }) })
|
|
79
93
|
] }),
|
|
80
94
|
/* @__PURE__ */ t(
|
|
81
|
-
|
|
95
|
+
F,
|
|
82
96
|
{
|
|
83
97
|
value: c,
|
|
84
|
-
defaultValue:
|
|
98
|
+
defaultValue: s,
|
|
85
99
|
onValueChange: n,
|
|
86
100
|
disabled: x,
|
|
87
101
|
required: f,
|
|
88
102
|
name: u,
|
|
89
103
|
orientation: p,
|
|
90
|
-
loop:
|
|
91
|
-
className:
|
|
104
|
+
loop: g,
|
|
105
|
+
className: o(
|
|
92
106
|
"flex gap-2",
|
|
93
|
-
|
|
94
|
-
|
|
107
|
+
y ? "flex-row" : "flex-col",
|
|
108
|
+
v
|
|
95
109
|
),
|
|
96
|
-
children: e.map((
|
|
97
|
-
const
|
|
98
|
-
return /* @__PURE__ */ t(
|
|
99
|
-
option:
|
|
100
|
-
optionId:
|
|
101
|
-
isDisabled:
|
|
102
|
-
optionClassName:
|
|
103
|
-
} },
|
|
110
|
+
children: e.map((a) => {
|
|
111
|
+
const z = `${u || "radio"}-${a.value}`, G = x || !!a.disabled;
|
|
112
|
+
return /* @__PURE__ */ t(T, { isCard: R, ...{
|
|
113
|
+
option: a,
|
|
114
|
+
optionId: z,
|
|
115
|
+
isDisabled: G,
|
|
116
|
+
optionClassName: w
|
|
117
|
+
} }, a.value);
|
|
104
118
|
})
|
|
105
119
|
}
|
|
106
120
|
),
|
|
@@ -111,5 +125,5 @@ function k({
|
|
|
111
125
|
] });
|
|
112
126
|
}
|
|
113
127
|
export {
|
|
114
|
-
|
|
128
|
+
E as AppRadioGroup
|
|
115
129
|
};
|