laif-ds 0.1.16 → 0.1.18
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/index2.js +2 -5
- package/dist/_virtual/index3.js +5 -5
- package/dist/_virtual/index4.js +5 -2
- package/dist/_virtual/index5.js +5 -2
- package/dist/_virtual/index6.js +2 -5
- package/dist/components/ui/async-select.js +34 -33
- package/dist/components/ui/calendar.js +1 -1
- package/dist/components/ui/charts/circular.js +74 -0
- package/dist/components/ui/date-picker.js +31 -31
- package/dist/components/ui/gantt/components/Chart/Chart.js +1 -1
- package/dist/components/ui/input.js +27 -25
- package/dist/components/ui/select.js +46 -40
- package/dist/components/ui/tabs.js +1 -1
- package/dist/index.d.ts +19 -3
- package/dist/index.js +92 -90
- package/dist/node_modules/hast-util-to-jsx-runtime/lib/index.js +1 -1
- package/dist/node_modules/react-is/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.v3.css +1 -1
- package/package.json +1 -1
package/dist/_virtual/index2.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
import { __require as e } from "../node_modules/style-to-js/cjs/index.js";
|
|
4
|
-
var t = e();
|
|
5
|
-
const a = /* @__PURE__ */ r(t);
|
|
2
|
+
var e = { exports: {} };
|
|
6
3
|
export {
|
|
7
|
-
|
|
4
|
+
e as __module
|
|
8
5
|
};
|
package/dist/_virtual/index3.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/index4.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
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);
|
|
3
6
|
export {
|
|
4
|
-
|
|
7
|
+
x as default
|
|
5
8
|
};
|
package/dist/_virtual/index5.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
2
|
+
import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.js";
|
|
3
|
+
import { __require as e } from "../node_modules/classnames/index.js";
|
|
4
|
+
var s = e();
|
|
5
|
+
const o = /* @__PURE__ */ r(s);
|
|
3
6
|
export {
|
|
4
|
-
|
|
7
|
+
o as default
|
|
5
8
|
};
|
package/dist/_virtual/index6.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
import { __require as e } from "../node_modules/classnames/index.js";
|
|
4
|
-
var s = e();
|
|
5
|
-
const o = /* @__PURE__ */ r(s);
|
|
2
|
+
var e = {};
|
|
6
3
|
export {
|
|
7
|
-
|
|
4
|
+
e as __exports
|
|
8
5
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as n, jsx as e } from "react/jsx-runtime";
|
|
3
3
|
import * as V from "react";
|
|
4
|
-
import { useState as r, useEffect as
|
|
4
|
+
import { useState as r, useEffect as y, useCallback as F } from "react";
|
|
5
5
|
import { useDebounce as ee } from "../../hooks/use-debounce.js";
|
|
6
6
|
import { cva as te } from "../../node_modules/class-variance-authority/dist/index.js";
|
|
7
7
|
import { cn as D } from "../../lib/utils.js";
|
|
@@ -14,13 +14,13 @@ import fe from "../../node_modules/lucide-react/dist/esm/icons/chevrons-up-down.
|
|
|
14
14
|
import pe from "../../node_modules/lucide-react/dist/esm/icons/loader-circle.js";
|
|
15
15
|
import ue from "../../node_modules/lucide-react/dist/esm/icons/check.js";
|
|
16
16
|
const he = te(
|
|
17
|
-
"justify-between",
|
|
17
|
+
"flex items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 shadow-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
|
|
18
18
|
{
|
|
19
19
|
variants: {
|
|
20
20
|
size: {
|
|
21
21
|
default: "h-9 text-sm",
|
|
22
22
|
sm: "h-8 text-xs",
|
|
23
|
-
lg: "h-10 text-lg
|
|
23
|
+
lg: "h-10 text-lg"
|
|
24
24
|
}
|
|
25
25
|
},
|
|
26
26
|
defaultVariants: {
|
|
@@ -28,7 +28,7 @@ const he = te(
|
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
);
|
|
31
|
-
function
|
|
31
|
+
function Ee({
|
|
32
32
|
fetcher: l,
|
|
33
33
|
preload: d,
|
|
34
34
|
filterFn: x,
|
|
@@ -43,22 +43,22 @@ function Oe({
|
|
|
43
43
|
value: a,
|
|
44
44
|
onChange: m,
|
|
45
45
|
disabled: j = !1,
|
|
46
|
-
width:
|
|
46
|
+
width: k = "200px",
|
|
47
47
|
className: q,
|
|
48
48
|
triggerClassName: H,
|
|
49
49
|
noResultsMessage: J,
|
|
50
50
|
clearable: v = !0,
|
|
51
51
|
size: K
|
|
52
52
|
}) {
|
|
53
|
-
const [f, Q] = r(!1), [
|
|
54
|
-
|
|
55
|
-
Q(!0),
|
|
56
|
-
}, [a]),
|
|
53
|
+
const [f, Q] = r(!1), [E, N] = r(!1), [o, p] = r([]), [w, u] = r(!1), [b, h] = r(null), [C, S] = r(a), [z, L] = r(null), [O, W] = r(""), g = ee(O, d ? 0 : 300), [T, P] = r([]);
|
|
54
|
+
y(() => {
|
|
55
|
+
Q(!0), S(a);
|
|
56
|
+
}, [a]), y(() => {
|
|
57
57
|
if (a && o.length > 0) {
|
|
58
58
|
const t = o.find((s) => i(s) === a);
|
|
59
59
|
t && L(t);
|
|
60
60
|
}
|
|
61
|
-
}, [a, o, i]),
|
|
61
|
+
}, [a, o, i]), y(() => {
|
|
62
62
|
f || (async () => {
|
|
63
63
|
try {
|
|
64
64
|
u(!0), h(null);
|
|
@@ -70,11 +70,11 @@ function Oe({
|
|
|
70
70
|
u(!1);
|
|
71
71
|
}
|
|
72
72
|
})();
|
|
73
|
-
}, [f, l, a]),
|
|
73
|
+
}, [f, l, a]), y(() => {
|
|
74
74
|
const t = async () => {
|
|
75
75
|
try {
|
|
76
76
|
u(!0), h(null);
|
|
77
|
-
const s = await l(
|
|
77
|
+
const s = await l(g);
|
|
78
78
|
P(s), p(s);
|
|
79
79
|
} catch (s) {
|
|
80
80
|
h(s instanceof Error ? s.message : "Failed to fetch options");
|
|
@@ -82,13 +82,13 @@ function Oe({
|
|
|
82
82
|
u(!1);
|
|
83
83
|
}
|
|
84
84
|
};
|
|
85
|
-
f && d ? d && p(
|
|
86
|
-
}, [l,
|
|
85
|
+
f && d ? d && p(g ? T.filter((s) => x ? x(s, g) : !0) : T) : t();
|
|
86
|
+
}, [l, g, f, d, x]);
|
|
87
87
|
const Y = F((t) => {
|
|
88
|
-
const s = v && t ===
|
|
89
|
-
|
|
90
|
-
}, [
|
|
91
|
-
t.stopPropagation(), t.preventDefault(),
|
|
88
|
+
const s = v && t === C ? "" : t;
|
|
89
|
+
S(s), L(o.find((_) => i(_) === s) || null), m(s), N(!1);
|
|
90
|
+
}, [C, m, v, o, i]), Z = F((t) => {
|
|
91
|
+
t.stopPropagation(), t.preventDefault(), S(""), L(null), m(""), N(!1);
|
|
92
92
|
}, [m]), I = V.useId();
|
|
93
93
|
return /* @__PURE__ */ n("div", { className: "space-y-1.5", children: [
|
|
94
94
|
c && /* @__PURE__ */ e(
|
|
@@ -99,23 +99,24 @@ function Oe({
|
|
|
99
99
|
children: c
|
|
100
100
|
}
|
|
101
101
|
),
|
|
102
|
-
/* @__PURE__ */ n(le, { open:
|
|
102
|
+
/* @__PURE__ */ n(le, { open: E, onOpenChange: N, children: [
|
|
103
103
|
/* @__PURE__ */ e(ce, { asChild: !0, children: /* @__PURE__ */ e(
|
|
104
104
|
se,
|
|
105
105
|
{
|
|
106
106
|
id: I,
|
|
107
|
-
variant: "
|
|
107
|
+
variant: "ghost",
|
|
108
108
|
role: "combobox",
|
|
109
|
-
"aria-expanded":
|
|
109
|
+
"aria-expanded": E,
|
|
110
110
|
className: D(
|
|
111
111
|
he({ size: K }),
|
|
112
112
|
j && "opacity-50 cursor-not-allowed",
|
|
113
|
-
H
|
|
113
|
+
H,
|
|
114
|
+
"font-normal"
|
|
114
115
|
),
|
|
115
|
-
style: { width:
|
|
116
|
+
style: { width: k },
|
|
116
117
|
disabled: j,
|
|
117
118
|
children: /* @__PURE__ */ n("div", { className: "flex-1 flex items-center justify-between overflow-hidden", children: [
|
|
118
|
-
z ? /* @__PURE__ */ e("div", { className: "truncate", children: B(z) }) : /* @__PURE__ */ e("span", { className: "text-d-
|
|
119
|
+
z ? /* @__PURE__ */ e("div", { className: "truncate", children: B(z) }) : /* @__PURE__ */ e("span", { className: "text-d-muted-foreground hover:text-d-foreground", children: X }),
|
|
119
120
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-1", children: [
|
|
120
121
|
v && z && /* @__PURE__ */ e(
|
|
121
122
|
"div",
|
|
@@ -124,7 +125,7 @@ function Oe({
|
|
|
124
125
|
onClick: Z,
|
|
125
126
|
onMouseDown: (t) => t.preventDefault(),
|
|
126
127
|
"aria-label": "Clear selection",
|
|
127
|
-
children: /* @__PURE__ */ e(me, { size:
|
|
128
|
+
children: /* @__PURE__ */ e(me, { size: 8, className: "text-d-foreground" })
|
|
128
129
|
}
|
|
129
130
|
),
|
|
130
131
|
/* @__PURE__ */ e(fe, { className: "opacity-50", size: 10 })
|
|
@@ -132,13 +133,13 @@ function Oe({
|
|
|
132
133
|
] })
|
|
133
134
|
}
|
|
134
135
|
) }),
|
|
135
|
-
/* @__PURE__ */ e(de, { style: { width:
|
|
136
|
+
/* @__PURE__ */ e(de, { style: { width: k }, className: D("p-0", q), children: /* @__PURE__ */ n(oe, { shouldFilter: !1, children: [
|
|
136
137
|
/* @__PURE__ */ n("div", { className: "relative border-b w-full", children: [
|
|
137
138
|
/* @__PURE__ */ e(
|
|
138
139
|
re,
|
|
139
140
|
{
|
|
140
141
|
placeholder: `Search ${typeof c == "string" ? c.toLowerCase() : "options"}...`,
|
|
141
|
-
value:
|
|
142
|
+
value: O,
|
|
142
143
|
onValueChange: (t) => {
|
|
143
144
|
W(t);
|
|
144
145
|
}
|
|
@@ -147,9 +148,9 @@ function Oe({
|
|
|
147
148
|
w && o.length > 0 && /* @__PURE__ */ e("div", { className: "absolute right-2 top-1/2 transform -translate-y-1/2 flex items-center", children: /* @__PURE__ */ e(pe, { className: "h-4 w-4 animate-spin" }) })
|
|
148
149
|
] }),
|
|
149
150
|
/* @__PURE__ */ n(ae, { children: [
|
|
150
|
-
|
|
151
|
-
w && o.length === 0 && (R || /* @__PURE__ */ e(
|
|
152
|
-
!w && !
|
|
151
|
+
b && /* @__PURE__ */ e("div", { className: "p-3 text-d-destructive text-center", children: b }),
|
|
152
|
+
w && o.length === 0 && (R || /* @__PURE__ */ e(ge, {})),
|
|
153
|
+
!w && !b && o.length === 0 && (G || /* @__PURE__ */ e(ie, { children: J ?? `No ${typeof c == "string" ? c.toLowerCase() : "options"} found.` })),
|
|
153
154
|
/* @__PURE__ */ e(M, { children: o.map((t) => /* @__PURE__ */ n(
|
|
154
155
|
$,
|
|
155
156
|
{
|
|
@@ -162,7 +163,7 @@ function Oe({
|
|
|
162
163
|
{
|
|
163
164
|
className: D(
|
|
164
165
|
"ml-auto h-3 w-3",
|
|
165
|
-
|
|
166
|
+
C === i(t) ? "opacity-100" : "opacity-0"
|
|
166
167
|
)
|
|
167
168
|
}
|
|
168
169
|
)
|
|
@@ -175,7 +176,7 @@ function Oe({
|
|
|
175
176
|
] })
|
|
176
177
|
] });
|
|
177
178
|
}
|
|
178
|
-
function
|
|
179
|
+
function ge() {
|
|
179
180
|
return /* @__PURE__ */ e(M, { children: [1, 2, 3].map((l) => /* @__PURE__ */ e($, { disabled: !0, children: /* @__PURE__ */ n("div", { className: "flex items-center gap-2 w-full", children: [
|
|
180
181
|
/* @__PURE__ */ e("div", { className: "h-6 w-6 rounded-full animate-pulse bg-d-secondary" }),
|
|
181
182
|
/* @__PURE__ */ n("div", { className: "flex flex-col flex-1 gap-1", children: [
|
|
@@ -185,5 +186,5 @@ function ye() {
|
|
|
185
186
|
] }) }, l)) });
|
|
186
187
|
}
|
|
187
188
|
export {
|
|
188
|
-
|
|
189
|
+
Ee as AsyncSelect
|
|
189
190
|
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as i, jsx as c } from "react/jsx-runtime";
|
|
3
|
+
import { cn as a } from "../../../lib/utils.js";
|
|
4
|
+
function v({
|
|
5
|
+
value: t,
|
|
6
|
+
renderLabel: o,
|
|
7
|
+
className: l,
|
|
8
|
+
progressClassName: m,
|
|
9
|
+
labelClassName: h,
|
|
10
|
+
showLabel: f,
|
|
11
|
+
shape: d = "round",
|
|
12
|
+
size: r = 100,
|
|
13
|
+
strokeWidth: n,
|
|
14
|
+
circleStrokeWidth: p = 10,
|
|
15
|
+
progressStrokeWidth: x = 10
|
|
16
|
+
}) {
|
|
17
|
+
const e = r / 2 - 10, s = Math.ceil(3.14 * e * 2), k = Math.ceil(s * ((100 - t) / 100)), y = `-${r * 0.125} -${r * 0.125} ${r * 1.25} ${r * 1.25}`;
|
|
18
|
+
return /* @__PURE__ */ i("div", { className: "relative", children: [
|
|
19
|
+
/* @__PURE__ */ i(
|
|
20
|
+
"svg",
|
|
21
|
+
{
|
|
22
|
+
width: r,
|
|
23
|
+
height: r,
|
|
24
|
+
viewBox: y,
|
|
25
|
+
version: "1.1",
|
|
26
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
27
|
+
style: { transform: "rotate(-90deg)" },
|
|
28
|
+
className: "relative",
|
|
29
|
+
children: [
|
|
30
|
+
/* @__PURE__ */ c(
|
|
31
|
+
"circle",
|
|
32
|
+
{
|
|
33
|
+
r: e,
|
|
34
|
+
cx: r / 2,
|
|
35
|
+
cy: r / 2,
|
|
36
|
+
fill: "transparent",
|
|
37
|
+
strokeWidth: n ?? p,
|
|
38
|
+
strokeDasharray: s,
|
|
39
|
+
strokeDashoffset: "0",
|
|
40
|
+
className: a("stroke-d-primary/25", l)
|
|
41
|
+
}
|
|
42
|
+
),
|
|
43
|
+
/* @__PURE__ */ c(
|
|
44
|
+
"circle",
|
|
45
|
+
{
|
|
46
|
+
r: e,
|
|
47
|
+
cx: r / 2,
|
|
48
|
+
cy: r / 2,
|
|
49
|
+
strokeWidth: n ?? x,
|
|
50
|
+
strokeLinecap: d,
|
|
51
|
+
strokeDashoffset: k,
|
|
52
|
+
fill: "transparent",
|
|
53
|
+
strokeDasharray: s,
|
|
54
|
+
className: a("stroke-d-primary", m)
|
|
55
|
+
}
|
|
56
|
+
)
|
|
57
|
+
]
|
|
58
|
+
}
|
|
59
|
+
),
|
|
60
|
+
f && /* @__PURE__ */ c(
|
|
61
|
+
"div",
|
|
62
|
+
{
|
|
63
|
+
className: a(
|
|
64
|
+
"absolute inset-0 flex items-center justify-center text-md",
|
|
65
|
+
h
|
|
66
|
+
),
|
|
67
|
+
children: o ? o(t) : t
|
|
68
|
+
}
|
|
69
|
+
)
|
|
70
|
+
] });
|
|
71
|
+
}
|
|
72
|
+
export {
|
|
73
|
+
v as CircularProgress
|
|
74
|
+
};
|
|
@@ -1,59 +1,59 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as u, jsx as
|
|
2
|
+
import { jsxs as u, jsx as e } from "react/jsx-runtime";
|
|
3
3
|
import * as c from "react";
|
|
4
|
-
import { cn as
|
|
4
|
+
import { cn as g } from "../../lib/utils.js";
|
|
5
5
|
import { Button as h } from "./button.js";
|
|
6
|
-
import { Calendar as
|
|
7
|
-
import { Popover as
|
|
8
|
-
import { formatDate as
|
|
9
|
-
function
|
|
6
|
+
import { Calendar as x } from "./calendar.js";
|
|
7
|
+
import { Popover as P, PopoverTrigger as w, PopoverContent as y } from "./popover.js";
|
|
8
|
+
import { formatDate as b } from "../../node_modules/date-fns/format.js";
|
|
9
|
+
function N({
|
|
10
10
|
value: r,
|
|
11
|
-
onChange:
|
|
11
|
+
onChange: a,
|
|
12
12
|
placeholder: l = "Seleziona data",
|
|
13
|
-
dateFormat:
|
|
14
|
-
className:
|
|
15
|
-
buttonVariant:
|
|
16
|
-
disabled:
|
|
17
|
-
size:
|
|
13
|
+
dateFormat: d = "PPP",
|
|
14
|
+
className: f,
|
|
15
|
+
buttonVariant: m = "outline",
|
|
16
|
+
disabled: t = !1,
|
|
17
|
+
size: n = "default"
|
|
18
18
|
}) {
|
|
19
19
|
const [o, i] = c.useState(r);
|
|
20
20
|
c.useEffect(() => {
|
|
21
21
|
i(r);
|
|
22
22
|
}, [r]);
|
|
23
|
-
const
|
|
24
|
-
i(s),
|
|
23
|
+
const p = (s) => {
|
|
24
|
+
i(s), a && a(s);
|
|
25
25
|
};
|
|
26
|
-
return /* @__PURE__ */ u(
|
|
27
|
-
/* @__PURE__ */
|
|
26
|
+
return /* @__PURE__ */ u(P, { open: t ? !1 : void 0, children: [
|
|
27
|
+
/* @__PURE__ */ e(w, { asChild: !0, children: /* @__PURE__ */ e(
|
|
28
28
|
h,
|
|
29
29
|
{
|
|
30
|
-
variant:
|
|
31
|
-
size:
|
|
32
|
-
className:
|
|
33
|
-
"justify-
|
|
30
|
+
variant: m,
|
|
31
|
+
size: n,
|
|
32
|
+
className: g(
|
|
33
|
+
"flex items-center justify-between whitespace-nowrap border border-d-input bg-d-transparent px-3 py-2 shadow-sm ring-offset-background data-[placeholder]:text-d-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1 font-normal",
|
|
34
34
|
!o && "text-d-secondary-foreground",
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
t && "opacity-50 cursor-not-allowed",
|
|
36
|
+
f,
|
|
37
|
+
n === "sm" && "text-xs",
|
|
38
|
+
n === "lg" && "text-lg"
|
|
39
39
|
),
|
|
40
|
-
disabled:
|
|
40
|
+
disabled: t,
|
|
41
41
|
iconLeft: "Calendar",
|
|
42
|
-
children: o ?
|
|
42
|
+
children: o ? b(o, d) : /* @__PURE__ */ e("span", { children: l })
|
|
43
43
|
}
|
|
44
44
|
) }),
|
|
45
|
-
/* @__PURE__ */
|
|
46
|
-
|
|
45
|
+
/* @__PURE__ */ e(y, { className: "w-auto p-0", children: /* @__PURE__ */ e(
|
|
46
|
+
x,
|
|
47
47
|
{
|
|
48
48
|
mode: "single",
|
|
49
49
|
selected: o,
|
|
50
|
-
onSelect:
|
|
50
|
+
onSelect: p,
|
|
51
51
|
initialFocus: !0,
|
|
52
|
-
disabled:
|
|
52
|
+
disabled: t
|
|
53
53
|
}
|
|
54
54
|
) })
|
|
55
55
|
] });
|
|
56
56
|
}
|
|
57
57
|
export {
|
|
58
|
-
|
|
58
|
+
N as DatePicker
|
|
59
59
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as o, jsxs as M, Fragment as N } from "react/jsx-runtime";
|
|
3
3
|
import { useContext as R, useRef as a, useState as s, useCallback as k, useMemo as y, useEffect as u } from "react";
|
|
4
|
-
import A from "../../../../../_virtual/
|
|
4
|
+
import A from "../../../../../_virtual/index5.js";
|
|
5
5
|
import B from "../../../../../_virtual/debounce.js";
|
|
6
6
|
import { GanttContext as F } from "../Gantt/GanttContext.js";
|
|
7
7
|
import { transformData as O } from "../../utils/transformData.js";
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as a, jsx as e } from "react/jsx-runtime";
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
import * as c from "react";
|
|
4
|
+
import { cva as x } from "../../node_modules/class-variance-authority/dist/index.js";
|
|
5
|
+
import { cn as g } from "../../lib/utils.js";
|
|
6
|
+
import { Label as v } from "./label.js";
|
|
7
|
+
import { Icon as d } from "./icon.js";
|
|
8
|
+
const b = x(
|
|
9
|
+
"file:text-d-foreground placeholder:text-d-muted-foreground selection:bg-d-primary selection:text-d-primary-foreground border-d-input flex w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-sm transition-colors outline-none file:inline-flex file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
|
|
9
10
|
{
|
|
10
11
|
variants: {
|
|
11
12
|
size: {
|
|
@@ -18,53 +19,54 @@ const g = c(
|
|
|
18
19
|
size: "default"
|
|
19
20
|
}
|
|
20
21
|
}
|
|
21
|
-
)
|
|
22
|
-
function w({
|
|
22
|
+
), h = c.forwardRef(({
|
|
23
23
|
className: o,
|
|
24
24
|
type: l,
|
|
25
25
|
label: r,
|
|
26
26
|
labelClassName: m,
|
|
27
27
|
id: p,
|
|
28
28
|
iconLeft: i,
|
|
29
|
-
iconRight:
|
|
29
|
+
iconRight: s,
|
|
30
30
|
size: t,
|
|
31
31
|
...u
|
|
32
|
-
}) {
|
|
33
|
-
const
|
|
32
|
+
}, f) => {
|
|
33
|
+
const n = p || (r ? `input-${Math.random().toString(36).substring(2, 9)}` : void 0);
|
|
34
34
|
return /* @__PURE__ */ a("div", { className: "space-y-1.5", children: [
|
|
35
35
|
r && /* @__PURE__ */ e(
|
|
36
|
-
|
|
36
|
+
v,
|
|
37
37
|
{
|
|
38
|
-
htmlFor:
|
|
38
|
+
htmlFor: n,
|
|
39
39
|
className: m,
|
|
40
40
|
children: r
|
|
41
41
|
}
|
|
42
42
|
),
|
|
43
43
|
/* @__PURE__ */ a("div", { className: "relative", children: [
|
|
44
|
-
i && /* @__PURE__ */ e("div", { className: "absolute left-3 top-1/2 -translate-y-1/2 text-d-
|
|
44
|
+
i && /* @__PURE__ */ e("div", { className: "absolute left-3 top-1/2 -translate-y-1/2 text-d-muted-foreground pointer-events-none", children: /* @__PURE__ */ e(d, { name: i, size: t === "lg" ? "sm" : "xs" }) }),
|
|
45
45
|
/* @__PURE__ */ e(
|
|
46
46
|
"input",
|
|
47
47
|
{
|
|
48
|
-
id:
|
|
48
|
+
id: n,
|
|
49
49
|
type: l,
|
|
50
50
|
"data-slot": "input",
|
|
51
|
-
className:
|
|
52
|
-
|
|
53
|
-
"focus-visible:
|
|
51
|
+
className: g(
|
|
52
|
+
b({ size: t }),
|
|
53
|
+
"focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
|
|
54
54
|
"aria-invalid:ring-d-destructive/20 dark:aria-invalid:ring-d-destructive/40 aria-invalid:border-d-destructive",
|
|
55
|
-
"shadow-
|
|
56
|
-
i ? t !== "lg" ? "pl-
|
|
57
|
-
|
|
55
|
+
"shadow-sm",
|
|
56
|
+
i ? t !== "lg" ? "pl-9" : "pl-10" : "",
|
|
57
|
+
s ? t !== "lg" ? "pr-9" : "pr-10" : "",
|
|
58
58
|
o
|
|
59
59
|
),
|
|
60
|
+
ref: f,
|
|
60
61
|
...u
|
|
61
62
|
}
|
|
62
63
|
),
|
|
63
|
-
|
|
64
|
+
s && /* @__PURE__ */ e("div", { className: "absolute right-3 top-1/2 -translate-y-1/2 text-d-muted-foreground pointer-events-none", children: /* @__PURE__ */ e(d, { name: s, size: t === "lg" ? "sm" : "xs" }) })
|
|
64
65
|
] })
|
|
65
66
|
] });
|
|
66
|
-
}
|
|
67
|
+
});
|
|
68
|
+
h.displayName = "Input";
|
|
67
69
|
export {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
+
h as Input,
|
|
71
|
+
b as inputVariants
|
|
70
72
|
};
|