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.
@@ -1,8 +1,8 @@
1
1
  "use client";
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);
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
- a as default
7
+ m as default
8
8
  };
@@ -1,8 +1,8 @@
1
1
  "use client";
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);
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
- x as default
7
+ a as default
8
8
  };
@@ -1,8 +1,8 @@
1
1
  "use client";
2
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);
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
- m as default
7
+ x as default
8
8
  };
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- var e = {};
2
+ var e = { exports: {} };
3
3
  export {
4
- e as __exports
4
+ e as __module
5
5
  };
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- var e = { exports: {} };
2
+ var e = {};
3
3
  export {
4
- e as __module
4
+ e as __exports
5
5
  };
@@ -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 N } from "./icon.js";
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), [d, v] = t.useState(""), [O, S] = t.useState(
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((c) => c !== e));
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(() => d ? a.filter(
49
- (e) => e.label.toLowerCase().includes(d.toLowerCase())
50
- ) : a, [a, d]), x = t.useMemo(() => i ? n.length >= i : !1, [n, i]);
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
- N,
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
- N,
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: d,
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 c = n.includes(e.value);
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 || !c && x,
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 || !c && x) && "cursor-not-allowed opacity-50"
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: c,
169
+ checked: d,
170
170
  className: "z-10 mr-2 flex-shrink-0",
171
171
  onCheckedChange: () => {
172
- console.log("checkbox change for:", e.value), w(e.value);
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, Image as o, Fallback as s } from "../../node_modules/@radix-ui/react-avatar/dist/index.js";
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
- o,
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
- s,
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 c } from "react/jsx-runtime";
3
- import { Root as m } from "../../node_modules/@radix-ui/react-slot/dist/index.js";
4
- import { cva as v } from "../../node_modules/class-variance-authority/dist/index.js";
5
- import { cn as l } from "../../lib/utils.js";
6
- import { Icon as u } from "./icon.js";
7
- const b = v(
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 bg-d-background shadow-xs hover:bg-d-accent hover:text-d-accent-foreground hover:border-d-accent disabled:border-d-foreground/30",
15
- "outline-primary": "border !border-d-primary bg-d-background shadow-xs text-d-primary/80 hover:!text-d-primary hover:bg-d-primary/5 hover:border-d-primary/80 ",
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: a,
38
+ variant: d,
38
39
  size: e,
39
- asChild: d = !1,
40
- iconLeft: n,
41
- iconRight: s,
42
- isLoading: f = !1,
40
+ asChild: a = !1,
41
+ iconLeft: s,
42
+ iconRight: n,
43
+ isLoading: b = !1,
43
44
  ...t
44
45
  }) {
45
- const i = d ? m : "button";
46
- return d ? /* @__PURE__ */ r(
46
+ const i = a ? f : "button";
47
+ return a ? /* @__PURE__ */ r(
47
48
  i,
48
49
  {
49
50
  "data-slot": "button",
50
- className: l(b({ variant: a, size: e, className: o })),
51
+ className: c(v({ variant: d, size: e, className: o })),
51
52
  ...t
52
53
  }
53
- ) : /* @__PURE__ */ c(
54
+ ) : /* @__PURE__ */ u(
54
55
  i,
55
56
  {
56
57
  "data-slot": "button",
57
- className: l(b({ variant: a, size: e, className: o }), "relative"),
58
+ className: c(v({ variant: d, size: e, className: o }), "relative"),
58
59
  ...t,
59
60
  children: [
60
- f ? /* @__PURE__ */ c(
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
- ) : n && /* @__PURE__ */ r(
92
- u,
92
+ ) : s && /* @__PURE__ */ r(
93
+ l,
93
94
  {
94
- name: n,
95
+ name: s,
95
96
  size: e === "default" ? "md" : e === "sm" ? "xs" : "sm"
96
97
  }
97
98
  ),
98
99
  t.children,
99
- s && /* @__PURE__ */ r(
100
- u,
100
+ n && /* @__PURE__ */ r(
101
+ l,
101
102
  {
102
- name: s,
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
- b as buttonVariants
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 d, CheckboxIndicator as a } from "../../node_modules/@radix-ui/react-checkbox/dist/index.js";
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 f({
7
+ function p({
8
8
  className: o,
9
- checked: i,
10
- ...t
9
+ checked: d,
10
+ ...i
11
11
  }) {
12
- const r = i === "indeterminate";
12
+ const r = d === "indeterminate";
13
13
  return /* @__PURE__ */ e(
14
- d,
14
+ t,
15
15
  {
16
16
  "data-slot": "checkbox",
17
17
  className: n(
18
- "peer bg-d-input border-d-border data-[state=checked]:bg-d-primary data-[state=checked]:border-d-primary data-[state=checked]:text-d-primary-foreground focus-visible:border-d-ring focus-visible:ring-d-ring/50 aria-invalid:border-d-destructive aria-invalid:ring-d-destructive/20 size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
19
- r && "bg-d-primary border-d-primary text-d-primary-foreground",
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 : i,
23
- ...t,
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
- f as Checkbox
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, CollapsibleTrigger as e, CollapsibleContent as i } from "../../node_modules/@radix-ui/react-collapsible/dist/index.js";
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
- e,
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
- i,
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 e } from "react/jsx-runtime";
3
- import { Label as N } from "./label.js";
4
- import { cn as c } from "../../lib/utils.js";
5
- import { cva as I } from "../../node_modules/class-variance-authority/dist/index.js";
6
- import * as f from "react";
7
- import { Icon as l } from "./icon.js";
8
- const M = I(
9
- "file:text-d-foreground placeholder:text-d-muted-foreground shadow-none selection:bg-d-primary selection:text-d-primary-foreground flex w-full min-w-0 rounded-md bg-d-input border border-d-border/50 px-3 py-1 text-base transition-all duration-200 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",
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 py-1 text-base md:text-sm file:h-7",
14
- sm: "h-8 py-1 text-xs md:text-xs file:h-6",
15
- lg: "h-10 py-2 text-lg md:text-lg file:h-8"
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
- ), P = f.forwardRef(
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: x,
25
- type: m,
26
- label: r,
27
- labelClassName: b,
28
- id: g,
29
- iconLeft: o,
30
- iconRight: a,
31
- size: t,
32
- ...u
33
- }, h) => {
34
- const p = g || (r ? `input-${Math.random().toString(36).substring(2, 9)}` : void 0), n = m === "password", [s, v] = f.useState(!1), w = n ? s ? "text" : "password" : m, y = !!a || n;
35
- return /* @__PURE__ */ i("div", { className: c("space-y-1.5", x), children: [
36
- r && /* @__PURE__ */ e(N, { htmlFor: p, className: b, children: r }),
37
- /* @__PURE__ */ i("div", { className: "relative w-full", children: [
38
- o && /* @__PURE__ */ e("div", { className: "text-d-muted-foreground pointer-events-none absolute top-1/2 left-3 -translate-y-1/2", children: /* @__PURE__ */ e(l, { name: o, size: t === "lg" ? "sm" : "xs" }) }),
39
- /* @__PURE__ */ e(
40
- "input",
41
- {
42
- id: p,
43
- type: w,
44
- "data-slot": "input",
45
- className: c(
46
- M({ size: t }),
47
- "focus-visible:border-d-ring focus-visible:border-1 focus-visible:ring-0 focus-visible:outline-none",
48
- "aria-invalid:ring-d-destructive/20 aria-invalid:border-d-destructive",
49
- o ? t !== "lg" ? "pl-9" : "pl-10" : "",
50
- y ? t !== "lg" ? "pr-9" : "pr-10" : ""
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
- ref: h,
53
- ...u
54
- }
55
- ),
56
- n ? /* @__PURE__ */ i(
57
- "button",
58
- {
59
- type: "button",
60
- onClick: () => v((d) => !d),
61
- onMouseDown: (d) => d.preventDefault(),
62
- className: "text-d-muted-foreground absolute top-1/2 right-3 -translate-y-1/2",
63
- "aria-label": s ? "Nascondi password" : "Mostra password",
64
- disabled: u.disabled,
65
- children: [
66
- /* @__PURE__ */ e(
67
- l,
68
- {
69
- name: s ? "EyeOff" : "Eye",
70
- size: t === "lg" ? "sm" : "xs"
71
- }
72
- ),
73
- /* @__PURE__ */ e("span", { className: "sr-only", children: s ? "Nascondi password" : "Mostra password" })
74
- ]
75
- }
76
- ) : a && /* @__PURE__ */ e("div", { className: "text-d-muted-foreground pointer-events-none absolute top-1/2 right-3 -translate-y-1/2", children: /* @__PURE__ */ e(l, { name: a, size: t === "lg" ? "sm" : "xs" }) })
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
- P.displayName = "Input";
186
+ te.displayName = "Input";
82
187
  export {
83
- P as Input,
84
- M as inputVariants
188
+ te as Input,
189
+ ee as inputVariants
85
190
  };