laif-ds 0.2.33 → 0.2.35
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/index3.js +5 -5
- package/dist/_virtual/index4.js +5 -5
- package/dist/_virtual/index5.js +4 -4
- package/dist/_virtual/index6.js +2 -2
- package/dist/_virtual/index7.js +2 -2
- package/dist/components/ui/app-multiple-select-dropdown.js +14 -14
- package/dist/components/ui/avatar.js +3 -3
- package/dist/components/ui/button.js +27 -26
- package/dist/components/ui/checkbox.js +15 -11
- package/dist/components/ui/collapsible.js +3 -3
- package/dist/components/ui/input.js +173 -68
- package/dist/components/ui/tooltip.js +6 -6
- package/dist/index.d.ts +17 -5
- package/dist/index.js +12 -12
- package/dist/node_modules/@radix-ui/react-tooltip/dist/index.js +3 -3
- package/dist/node_modules/eventemitter3/index.js +1 -1
- 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/recharts/es6/util/Events.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/index3.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { getDefaultExportFromCjs as
|
|
3
|
-
import { __require as
|
|
4
|
-
var
|
|
5
|
-
const
|
|
2
|
+
import { getDefaultExportFromCjs as e } from "./_commonjsHelpers.js";
|
|
3
|
+
import { __require as t } from "../node_modules/eventemitter3/index2.js";
|
|
4
|
+
var r = t();
|
|
5
|
+
const m = /* @__PURE__ */ e(r);
|
|
6
6
|
export {
|
|
7
|
-
|
|
7
|
+
m as default
|
|
8
8
|
};
|
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 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/index5.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { getDefaultExportFromCjs as e } from "./_commonjsHelpers.js";
|
|
3
|
-
import { __require as
|
|
4
|
-
var
|
|
5
|
-
const
|
|
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/index6.js
CHANGED
package/dist/_virtual/index7.js
CHANGED
|
@@ -8,7 +8,7 @@ import * as t from "react";
|
|
|
8
8
|
import { useEffect as q } from "react";
|
|
9
9
|
import { selectTriggerVariants as H } from "./async-select.js";
|
|
10
10
|
import { Checkbox as I } from "./checkbox.js";
|
|
11
|
-
import { Icon as
|
|
11
|
+
import { Icon as x } from "./icon.js";
|
|
12
12
|
import { inputVariants as J } from "./input.js";
|
|
13
13
|
import { Popover as K, PopoverTrigger as Q, PopoverContent as U } from "./popover.js";
|
|
14
14
|
import Y from "../../node_modules/lucide-react/dist/esm/icons/chevron-down.js";
|
|
@@ -30,12 +30,12 @@ function ue({
|
|
|
30
30
|
cancelLabel: j = "Cancella selezione",
|
|
31
31
|
maxSelectedItems: i
|
|
32
32
|
}) {
|
|
33
|
-
const f = t.useId(), [s, D] = t.useState(!1), [
|
|
33
|
+
const f = t.useId(), [s, D] = t.useState(!1), [c, v] = t.useState(""), [O, S] = t.useState(
|
|
34
34
|
void 0
|
|
35
35
|
), L = t.useRef(null), p = t.useRef(null), w = t.useCallback(
|
|
36
36
|
(e) => {
|
|
37
37
|
if (n.includes(e))
|
|
38
|
-
o(n.filter((
|
|
38
|
+
o(n.filter((d) => d !== e));
|
|
39
39
|
else {
|
|
40
40
|
if (i && n.length >= i)
|
|
41
41
|
return;
|
|
@@ -45,9 +45,9 @@ function ue({
|
|
|
45
45
|
[n, o, i]
|
|
46
46
|
), T = t.useCallback(() => {
|
|
47
47
|
o([]), v(""), g && g();
|
|
48
|
-
}, [o]), h = t.useMemo(() => a.filter((e) => n.includes(e.value)), [a, n]), W = t.useMemo(() =>
|
|
49
|
-
(e) => e.label.toLowerCase().includes(
|
|
50
|
-
) : a, [a,
|
|
48
|
+
}, [o]), h = t.useMemo(() => a.filter((e) => n.includes(e.value)), [a, n]), W = t.useMemo(() => c ? a.filter(
|
|
49
|
+
(e) => e.label.toLowerCase().includes(c.toLowerCase())
|
|
50
|
+
) : a, [a, c]), N = t.useMemo(() => i ? n.length >= i : !1, [n, i]);
|
|
51
51
|
return q(() => {
|
|
52
52
|
if (s && p.current) {
|
|
53
53
|
const e = p.current.getBoundingClientRect();
|
|
@@ -103,7 +103,7 @@ function ue({
|
|
|
103
103
|
onMouseDown: (e) => e.preventDefault(),
|
|
104
104
|
"aria-label": j,
|
|
105
105
|
children: /* @__PURE__ */ r(
|
|
106
|
-
|
|
106
|
+
x,
|
|
107
107
|
{
|
|
108
108
|
name: "X",
|
|
109
109
|
size: "xs",
|
|
@@ -130,7 +130,7 @@ function ue({
|
|
|
130
130
|
children: /* @__PURE__ */ l(E, { className: "bg-d-popover w-full rounded-md border border-none", children: [
|
|
131
131
|
R && /* @__PURE__ */ r("div", { className: "border-d-border flex items-center justify-between border-b px-3", children: /* @__PURE__ */ l("div", { className: "flex items-center", children: [
|
|
132
132
|
/* @__PURE__ */ r(
|
|
133
|
-
|
|
133
|
+
x,
|
|
134
134
|
{
|
|
135
135
|
name: "Search",
|
|
136
136
|
className: "text-d-accent-foreground opacity-50",
|
|
@@ -142,7 +142,7 @@ function ue({
|
|
|
142
142
|
{
|
|
143
143
|
id: "app-multiple-select-dropdown-filter",
|
|
144
144
|
placeholder: P,
|
|
145
|
-
value:
|
|
145
|
+
value: c,
|
|
146
146
|
onChange: (e) => v(e.target.value),
|
|
147
147
|
className: `focus-visible:ring-none border-none focus-visible:border-none disabled:opacity-50 ${J({ size: m })} !shadow-none`
|
|
148
148
|
}
|
|
@@ -151,25 +151,25 @@ function ue({
|
|
|
151
151
|
/* @__PURE__ */ l(F, { className: "max-h-60 w-full", children: [
|
|
152
152
|
/* @__PURE__ */ r(V, { children: M }),
|
|
153
153
|
/* @__PURE__ */ r(G, { children: W.map((e) => {
|
|
154
|
-
const
|
|
154
|
+
const d = n.includes(e.value);
|
|
155
155
|
return /* @__PURE__ */ l(
|
|
156
156
|
X,
|
|
157
157
|
{
|
|
158
158
|
value: e.value,
|
|
159
|
-
disabled: e.disabled || !
|
|
159
|
+
disabled: e.disabled || !d && N,
|
|
160
160
|
onSelect: () => w(e.value),
|
|
161
161
|
className: u(
|
|
162
162
|
"aria-selected:!bg-d-accent aria-selected:text-d-accent-foreground flex cursor-pointer items-center gap-2 px-2 py-1.5",
|
|
163
|
-
(e.disabled || !
|
|
163
|
+
(e.disabled || !d && N) && "cursor-not-allowed opacity-50"
|
|
164
164
|
),
|
|
165
165
|
children: [
|
|
166
166
|
/* @__PURE__ */ r(
|
|
167
167
|
I,
|
|
168
168
|
{
|
|
169
|
-
checked:
|
|
169
|
+
checked: d,
|
|
170
170
|
className: "z-10 mr-2 flex-shrink-0",
|
|
171
171
|
onCheckedChange: () => {
|
|
172
|
-
|
|
172
|
+
w(e.value);
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
175
|
),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
-
import { Root as l,
|
|
3
|
+
import { Root as l, Fallback as o, Image as s } from "../../node_modules/@radix-ui/react-avatar/dist/index.js";
|
|
4
4
|
import { cn as r } from "../../lib/utils.js";
|
|
5
5
|
function f({
|
|
6
6
|
className: a,
|
|
@@ -23,7 +23,7 @@ function u({
|
|
|
23
23
|
...e
|
|
24
24
|
}) {
|
|
25
25
|
return /* @__PURE__ */ t(
|
|
26
|
-
|
|
26
|
+
s,
|
|
27
27
|
{
|
|
28
28
|
"data-slot": "avatar-image",
|
|
29
29
|
className: r("aspect-square size-full", a),
|
|
@@ -36,7 +36,7 @@ function m({
|
|
|
36
36
|
...e
|
|
37
37
|
}) {
|
|
38
38
|
return /* @__PURE__ */ t(
|
|
39
|
-
|
|
39
|
+
o,
|
|
40
40
|
{
|
|
41
41
|
"data-slot": "avatar-fallback",
|
|
42
42
|
className: r(
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as r, jsxs as
|
|
3
|
-
import { Root as
|
|
4
|
-
import { cva as
|
|
5
|
-
import { cn as
|
|
6
|
-
import { Icon as
|
|
7
|
-
const
|
|
2
|
+
import { jsx as r, jsxs as u } from "react/jsx-runtime";
|
|
3
|
+
import { Root as f } from "../../node_modules/@radix-ui/react-slot/dist/index.js";
|
|
4
|
+
import { cva as m } from "../../node_modules/class-variance-authority/dist/index.js";
|
|
5
|
+
import { cn as c } from "../../lib/utils.js";
|
|
6
|
+
import { Icon as l } from "./icon.js";
|
|
7
|
+
const v = m(
|
|
8
8
|
"cursor-pointer inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all focus-visible:ring-d-ring/50 focus-visible:ring-[3px] aria-invalid:ring-d-destructive/20 aria-invalid:border-d-destructive transition-all duration-200 ease-out transform-gpu active:scale-[0.98] active:shadow-sm overflow-hidden relative group disabled:cursor-not-allowed disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-d-ring",
|
|
9
9
|
{
|
|
10
10
|
variants: {
|
|
11
11
|
variant: {
|
|
12
12
|
default: "bg-d-primary text-d-primary-foreground shadow-xs hover:bg-d-primary/90 hover:shadow-d-primary/25 [clip-path:inset(0_round_0.375rem)] before:absolute before:inset-0 before:bg-gradient-to-r before:from-transparent before:via-white/20 before:to-transparent before:translate-x-[-100%] hover:before:translate-x-[100%] before:transition-transform before:duration-700 before:ease-out",
|
|
13
13
|
destructive: "bg-d-destructive text-d-destructive-foreground shadow-xs hover:bg-d-destructive/90 hover:shadow-d-destructive/25 focus-visible:ring-d-destructive/20 [clip-path:inset(0_round_0.375rem)] before:absolute before:inset-0 before:bg-gradient-to-r before:from-transparent before:via-white/20 before:to-transparent before:translate-x-[-100%] hover:before:translate-x-[100%] before:transition-transform before:duration-700 before:ease-out",
|
|
14
|
-
outline: "border border-d-foreground
|
|
15
|
-
"outline-primary": "border !border-d-primary
|
|
14
|
+
outline: "border border-d-foreground shadow-xs hover:bg-d-accent hover:text-d-accent-foreground hover:border-d-accent disabled:border-d-foreground/30 hover:border-d-foreground/80",
|
|
15
|
+
"outline-primary": "border !border-d-primary shadow-xs text-d-primary/80 hover:!text-d-primary hover:bg-d-primary/10 hover:border-d-primary/80 ",
|
|
16
|
+
"outline-destructive": "border !border-d-destructive shadow-xs text-d-destructive/80 hover:!text-d-destructive hover:bg-d-destructive/10 hover:border-d-destructive/80 ",
|
|
16
17
|
secondary: "bg-d-secondary text-d-secondary-foreground shadow-xs hover:bg-d-secondary/80 hover:text-d-secondary-foreground ",
|
|
17
18
|
ghost: "hover:bg-d-accent hover:text-d-accent-foreground ",
|
|
18
19
|
"ghost-destructive": "text-d-destructive bg-transparent hover:bg-d-destructive/10",
|
|
@@ -34,30 +35,30 @@ const b = v(
|
|
|
34
35
|
);
|
|
35
36
|
function w({
|
|
36
37
|
className: o,
|
|
37
|
-
variant:
|
|
38
|
+
variant: d,
|
|
38
39
|
size: e,
|
|
39
|
-
asChild:
|
|
40
|
-
iconLeft:
|
|
41
|
-
iconRight:
|
|
42
|
-
isLoading:
|
|
40
|
+
asChild: a = !1,
|
|
41
|
+
iconLeft: s,
|
|
42
|
+
iconRight: n,
|
|
43
|
+
isLoading: b = !1,
|
|
43
44
|
...t
|
|
44
45
|
}) {
|
|
45
|
-
const i =
|
|
46
|
-
return
|
|
46
|
+
const i = a ? f : "button";
|
|
47
|
+
return a ? /* @__PURE__ */ r(
|
|
47
48
|
i,
|
|
48
49
|
{
|
|
49
50
|
"data-slot": "button",
|
|
50
|
-
className:
|
|
51
|
+
className: c(v({ variant: d, size: e, className: o })),
|
|
51
52
|
...t
|
|
52
53
|
}
|
|
53
|
-
) : /* @__PURE__ */
|
|
54
|
+
) : /* @__PURE__ */ u(
|
|
54
55
|
i,
|
|
55
56
|
{
|
|
56
57
|
"data-slot": "button",
|
|
57
|
-
className:
|
|
58
|
+
className: c(v({ variant: d, size: e, className: o }), "relative"),
|
|
58
59
|
...t,
|
|
59
60
|
children: [
|
|
60
|
-
|
|
61
|
+
b ? /* @__PURE__ */ u(
|
|
61
62
|
"svg",
|
|
62
63
|
{
|
|
63
64
|
className: "mr-1 -ml-1 animate-spin",
|
|
@@ -88,18 +89,18 @@ function w({
|
|
|
88
89
|
)
|
|
89
90
|
]
|
|
90
91
|
}
|
|
91
|
-
) :
|
|
92
|
-
|
|
92
|
+
) : s && /* @__PURE__ */ r(
|
|
93
|
+
l,
|
|
93
94
|
{
|
|
94
|
-
name:
|
|
95
|
+
name: s,
|
|
95
96
|
size: e === "default" ? "md" : e === "sm" ? "xs" : "sm"
|
|
96
97
|
}
|
|
97
98
|
),
|
|
98
99
|
t.children,
|
|
99
|
-
|
|
100
|
-
|
|
100
|
+
n && /* @__PURE__ */ r(
|
|
101
|
+
l,
|
|
101
102
|
{
|
|
102
|
-
name:
|
|
103
|
+
name: n,
|
|
103
104
|
size: e === "default" ? "md" : e === "sm" ? "xs" : "sm"
|
|
104
105
|
}
|
|
105
106
|
)
|
|
@@ -109,5 +110,5 @@ function w({
|
|
|
109
110
|
}
|
|
110
111
|
export {
|
|
111
112
|
w as Button,
|
|
112
|
-
|
|
113
|
+
v as buttonVariants
|
|
113
114
|
};
|
|
@@ -1,26 +1,30 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as e } from "react/jsx-runtime";
|
|
3
|
-
import { Checkbox as
|
|
3
|
+
import { Checkbox as t, CheckboxIndicator as a } from "../../node_modules/@radix-ui/react-checkbox/dist/index.js";
|
|
4
4
|
import { cn as n } from "../../lib/utils.js";
|
|
5
5
|
import s from "../../node_modules/lucide-react/dist/esm/icons/minus.js";
|
|
6
6
|
import c from "../../node_modules/lucide-react/dist/esm/icons/check.js";
|
|
7
|
-
function
|
|
7
|
+
function p({
|
|
8
8
|
className: o,
|
|
9
|
-
checked:
|
|
10
|
-
...
|
|
9
|
+
checked: d,
|
|
10
|
+
...i
|
|
11
11
|
}) {
|
|
12
|
-
const r =
|
|
12
|
+
const r = d === "indeterminate";
|
|
13
13
|
return /* @__PURE__ */ e(
|
|
14
|
-
|
|
14
|
+
t,
|
|
15
15
|
{
|
|
16
16
|
"data-slot": "checkbox",
|
|
17
17
|
className: n(
|
|
18
|
-
"peer bg-d-input border-d-
|
|
19
|
-
|
|
18
|
+
"peer bg-d-input border-d-foreground size-4 shrink-0 cursor-pointer rounded-[4px] border shadow-xs transition-shadow outline-none",
|
|
19
|
+
"aria-invalid:border-d-destructive aria-invalid:ring-d-destructive/20",
|
|
20
|
+
"focus-visible:border-d-ring focus-visible:ring-d-ring/50 focus-visible:ring-[3px]",
|
|
21
|
+
"data-[state=checked]:bg-d-primary data-[state=checked]:border-d-primary data-[state=checked]:text-d-primary-foreground",
|
|
22
|
+
"disabled:data-[state=unchecked]:border-d-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
|
|
23
|
+
r && "bg-d-primary border-d-primary text-d-primary-foreground disabled:border-d-muted-foreground",
|
|
20
24
|
o
|
|
21
25
|
),
|
|
22
|
-
checked: r ? !1 :
|
|
23
|
-
...
|
|
26
|
+
checked: r ? !1 : d,
|
|
27
|
+
...i,
|
|
24
28
|
children: /* @__PURE__ */ e(
|
|
25
29
|
a,
|
|
26
30
|
{
|
|
@@ -34,5 +38,5 @@ function f({
|
|
|
34
38
|
);
|
|
35
39
|
}
|
|
36
40
|
export {
|
|
37
|
-
|
|
41
|
+
p as Checkbox
|
|
38
42
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as o } from "react/jsx-runtime";
|
|
3
|
-
import { Root as t,
|
|
3
|
+
import { Root as t, CollapsibleContent as e, CollapsibleTrigger as i } from "../../node_modules/@radix-ui/react-collapsible/dist/index.js";
|
|
4
4
|
function n({
|
|
5
5
|
...l
|
|
6
6
|
}) {
|
|
@@ -10,7 +10,7 @@ function s({
|
|
|
10
10
|
...l
|
|
11
11
|
}) {
|
|
12
12
|
return /* @__PURE__ */ o(
|
|
13
|
-
|
|
13
|
+
i,
|
|
14
14
|
{
|
|
15
15
|
"data-slot": "collapsible-trigger",
|
|
16
16
|
...l
|
|
@@ -21,7 +21,7 @@ function p({
|
|
|
21
21
|
...l
|
|
22
22
|
}) {
|
|
23
23
|
return /* @__PURE__ */ o(
|
|
24
|
-
|
|
24
|
+
e,
|
|
25
25
|
{
|
|
26
26
|
"data-slot": "collapsible-content",
|
|
27
27
|
...l
|
|
@@ -1,85 +1,190 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as i, jsx as
|
|
3
|
-
import { Label as
|
|
4
|
-
import { cn as
|
|
5
|
-
import { cva as
|
|
6
|
-
import * as
|
|
7
|
-
import { Icon as
|
|
8
|
-
const
|
|
9
|
-
"
|
|
2
|
+
import { jsxs as i, jsx as r } from "react/jsx-runtime";
|
|
3
|
+
import { Label as Z } from "./label.js";
|
|
4
|
+
import { cn as o } from "../../lib/utils.js";
|
|
5
|
+
import { cva as j } from "../../node_modules/class-variance-authority/dist/index.js";
|
|
6
|
+
import * as t from "react";
|
|
7
|
+
import { Icon as T } from "./icon.js";
|
|
8
|
+
const q = j(
|
|
9
|
+
"flex w-full items-center gap-2 rounded-md bg-d-input border border-d-border/50 px-3 transition-all duration-200 focus-within:border-d-ring focus-within:border-1",
|
|
10
10
|
{
|
|
11
11
|
variants: {
|
|
12
12
|
size: {
|
|
13
|
-
default: "h-9
|
|
14
|
-
sm: "h-8
|
|
15
|
-
lg: "h-10
|
|
13
|
+
default: "h-9",
|
|
14
|
+
sm: "h-8",
|
|
15
|
+
lg: "h-10"
|
|
16
16
|
}
|
|
17
17
|
},
|
|
18
18
|
defaultVariants: {
|
|
19
19
|
size: "default"
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
|
-
),
|
|
22
|
+
), ee = j(
|
|
23
|
+
o(
|
|
24
|
+
"shadow-none flex-1 min-w-0 bg-transparent outline-none border-0 p-0 overflow-hidden text-ellipsis whitespace-nowrap",
|
|
25
|
+
"file:text-d-foreground file:inline-flex file:border-0 file:bg-transparent file:text-sm file:font-medium",
|
|
26
|
+
"placeholder:text-d-muted-foreground",
|
|
27
|
+
"selection:bg-d-primary selection:text-d-primary-foreground",
|
|
28
|
+
"disabled:cursor-not-allowed disabled:opacity-50"
|
|
29
|
+
),
|
|
30
|
+
{
|
|
31
|
+
variants: {
|
|
32
|
+
size: {
|
|
33
|
+
default: "text-sm file:h-7",
|
|
34
|
+
sm: "text-xs file:h-6",
|
|
35
|
+
lg: "text-lg file:h-8"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
defaultVariants: {
|
|
39
|
+
size: "default"
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
), n = {
|
|
43
|
+
show: "Mostra password",
|
|
44
|
+
hide: "Nascondi password"
|
|
45
|
+
}, te = t.forwardRef(
|
|
23
46
|
({
|
|
24
|
-
className:
|
|
25
|
-
type:
|
|
26
|
-
label:
|
|
27
|
-
labelClassName:
|
|
28
|
-
id:
|
|
29
|
-
iconLeft:
|
|
30
|
-
iconRight:
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
47
|
+
className: L,
|
|
48
|
+
type: d,
|
|
49
|
+
label: k,
|
|
50
|
+
labelClassName: R,
|
|
51
|
+
id: W,
|
|
52
|
+
iconLeft: v,
|
|
53
|
+
iconRight: x,
|
|
54
|
+
startContent: S,
|
|
55
|
+
endContent: C,
|
|
56
|
+
size: l,
|
|
57
|
+
disabled: a,
|
|
58
|
+
required: w,
|
|
59
|
+
errorMessage: b,
|
|
60
|
+
onBlur: E,
|
|
61
|
+
onChange: M,
|
|
62
|
+
onInvalid: B,
|
|
63
|
+
"aria-invalid": N,
|
|
64
|
+
"aria-describedby": D,
|
|
65
|
+
...y
|
|
66
|
+
}, G) => {
|
|
67
|
+
const P = t.useId(), c = W ?? P, V = `${c}-error`, u = t.useRef(null), f = d === "password", [s, U] = t.useState(!1), [_, m] = t.useState(!0), [F, z] = t.useState(!1), [A, p] = t.useState(""), H = f ? s ? "text" : "password" : d;
|
|
68
|
+
t.useImperativeHandle(G, () => u.current);
|
|
69
|
+
const $ = t.useCallback(
|
|
70
|
+
(e) => {
|
|
71
|
+
if (a) return;
|
|
72
|
+
const g = e.target;
|
|
73
|
+
if (g.tagName === "INPUT" || g.tagName === "BUTTON") return;
|
|
74
|
+
const I = u.current;
|
|
75
|
+
I && (I.focus(), !f && d !== "file" && I.select());
|
|
76
|
+
},
|
|
77
|
+
[a, f, d]
|
|
78
|
+
), J = t.useCallback(
|
|
79
|
+
(e) => {
|
|
80
|
+
m(e.target.validity.valid), p(e.target.validationMessage), M?.(e);
|
|
81
|
+
},
|
|
82
|
+
[M]
|
|
83
|
+
), K = t.useCallback(
|
|
84
|
+
(e) => {
|
|
85
|
+
z(!0), m(e.currentTarget.validity.valid), p(e.currentTarget.validationMessage), E?.(e);
|
|
86
|
+
},
|
|
87
|
+
[E]
|
|
88
|
+
), Q = t.useCallback(
|
|
89
|
+
(e) => {
|
|
90
|
+
z(!0), m(!1), p(e.currentTarget.validationMessage), B?.(e);
|
|
91
|
+
},
|
|
92
|
+
[B]
|
|
93
|
+
);
|
|
94
|
+
t.useEffect(() => {
|
|
95
|
+
if (y.value !== void 0) {
|
|
96
|
+
const e = u.current;
|
|
97
|
+
e && (m(e.validity.valid), p(e.validationMessage));
|
|
98
|
+
}
|
|
99
|
+
}, [y.value]);
|
|
100
|
+
const h = (F || (N === !0 || N === "true")) && (!!b || !_), X = w && h, O = N ?? (h ? !0 : void 0), Y = [D, h ? V : void 0].filter(Boolean).join(" ").trim() || void 0;
|
|
101
|
+
return /* @__PURE__ */ i("div", { className: o("flex flex-col gap-1.5", L), children: [
|
|
102
|
+
k && /* @__PURE__ */ i(Z, { htmlFor: c, className: o("gap-0.5", R), children: [
|
|
103
|
+
k,
|
|
104
|
+
w && /* @__PURE__ */ r("div", { className: X ? "text-d-destructive" : "", children: "*" })
|
|
105
|
+
] }),
|
|
106
|
+
/* @__PURE__ */ i(
|
|
107
|
+
"div",
|
|
108
|
+
{
|
|
109
|
+
className: o(
|
|
110
|
+
q({ size: l }),
|
|
111
|
+
"aria-[invalid=true]:ring-d-destructive/20 aria-[invalid=true]:border-d-destructive",
|
|
112
|
+
a ? "cursor-not-allowed opacity-50" : "cursor-text"
|
|
113
|
+
),
|
|
114
|
+
"aria-invalid": O,
|
|
115
|
+
onClick: $,
|
|
116
|
+
children: [
|
|
117
|
+
(v || S) && /* @__PURE__ */ i("div", { className: "text-d-muted-foreground flex shrink-0 items-center gap-2", children: [
|
|
118
|
+
v && /* @__PURE__ */ r(T, { name: v, size: l === "lg" ? "sm" : "xs" }),
|
|
119
|
+
S
|
|
120
|
+
] }),
|
|
121
|
+
/* @__PURE__ */ r(
|
|
122
|
+
"input",
|
|
123
|
+
{
|
|
124
|
+
id: c,
|
|
125
|
+
type: H,
|
|
126
|
+
"data-slot": "input",
|
|
127
|
+
className: o(ee({ size: l })),
|
|
128
|
+
ref: u,
|
|
129
|
+
disabled: a,
|
|
130
|
+
onChange: J,
|
|
131
|
+
onBlur: K,
|
|
132
|
+
onInvalid: Q,
|
|
133
|
+
"aria-invalid": O,
|
|
134
|
+
"aria-describedby": Y,
|
|
135
|
+
required: w,
|
|
136
|
+
...y
|
|
137
|
+
}
|
|
51
138
|
),
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
139
|
+
f ? /* @__PURE__ */ i(
|
|
140
|
+
"button",
|
|
141
|
+
{
|
|
142
|
+
type: "button",
|
|
143
|
+
onClick: (e) => {
|
|
144
|
+
e.stopPropagation(), e.preventDefault(), U((g) => !g);
|
|
145
|
+
},
|
|
146
|
+
className: o(
|
|
147
|
+
"text-d-muted-foreground flex shrink-0 cursor-pointer items-center",
|
|
148
|
+
a && "cursor-not-allowed"
|
|
149
|
+
),
|
|
150
|
+
"aria-label": s ? n.hide : n.show,
|
|
151
|
+
"aria-pressed": s,
|
|
152
|
+
"aria-controls": c,
|
|
153
|
+
title: s ? n.hide : n.show,
|
|
154
|
+
disabled: a,
|
|
155
|
+
children: [
|
|
156
|
+
/* @__PURE__ */ r(
|
|
157
|
+
T,
|
|
158
|
+
{
|
|
159
|
+
name: s ? "EyeOff" : "Eye",
|
|
160
|
+
size: l === "lg" ? "sm" : "xs"
|
|
161
|
+
}
|
|
162
|
+
),
|
|
163
|
+
/* @__PURE__ */ r("span", { className: "sr-only", children: s ? n.hide : n.show })
|
|
164
|
+
]
|
|
165
|
+
}
|
|
166
|
+
) : (x || C) && /* @__PURE__ */ i("div", { className: "text-d-muted-foreground flex shrink-0 items-center gap-2", children: [
|
|
167
|
+
C,
|
|
168
|
+
x && /* @__PURE__ */ r(T, { name: x, size: l === "lg" ? "sm" : "xs" })
|
|
169
|
+
] })
|
|
170
|
+
]
|
|
171
|
+
}
|
|
172
|
+
),
|
|
173
|
+
h && (b || A) && /* @__PURE__ */ r(
|
|
174
|
+
"span",
|
|
175
|
+
{
|
|
176
|
+
id: V,
|
|
177
|
+
role: "alert",
|
|
178
|
+
"aria-live": "polite",
|
|
179
|
+
className: "text-d-destructive max-w-full min-w-0 text-xs text-wrap",
|
|
180
|
+
children: b || A
|
|
181
|
+
}
|
|
182
|
+
)
|
|
78
183
|
] });
|
|
79
184
|
}
|
|
80
185
|
);
|
|
81
|
-
|
|
186
|
+
te.displayName = "Input";
|
|
82
187
|
export {
|
|
83
|
-
|
|
84
|
-
|
|
188
|
+
te as Input,
|
|
189
|
+
ee as inputVariants
|
|
85
190
|
};
|