laif-ds 0.2.34 → 0.2.36

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 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
- 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 r } from "../node_modules/extend/index.js";
4
+ var t = r();
5
+ const x = /* @__PURE__ */ e(t);
6
6
  export {
7
- a as default
7
+ x as default
8
8
  };
@@ -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,19 +1,30 @@
1
1
  "use client";
2
- import { jsx as o } from "react/jsx-runtime";
3
- import { Root as d } from "../../node_modules/@radix-ui/react-slot/dist/index.js";
4
- import { cva as n } from "../../node_modules/class-variance-authority/dist/index.js";
5
- import { cn as i } from "../../lib/utils.js";
6
- const s = n(
2
+ import { jsx as e, jsxs as b } from "react/jsx-runtime";
3
+ import { Root as v } from "../../node_modules/@radix-ui/react-slot/dist/index.js";
4
+ import { cva as p } from "../../node_modules/class-variance-authority/dist/index.js";
5
+ import { cn as c } from "../../lib/utils.js";
6
+ import { Icon as g } from "./icon.js";
7
+ const u = p(
7
8
  "inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-d-ring focus-visible:ring-d-ring/50 focus-visible:ring-[3px] aria-invalid:ring-d-destructive/20 aria-invalid:border-d-destructive transition-[color,box-shadow] overflow-hidden",
8
9
  {
9
10
  variants: {
10
11
  variant: {
11
12
  default: "border-transparent bg-d-primary text-d-primary-foreground [a&]:hover:bg-d-primary/90",
13
+ destructive: "border-transparent bg-d-destructive text-d-destructive-foreground [a&]:hover:bg-d-destructive/90 focus-visible:ring-d-destructive/20",
14
+ warning: "border-transparent bg-d-warning-background text-d-warning-foreground [a&]:hover:bg-d-warning-background/90",
15
+ success: "border-transparent bg-d-success-background text-d-success-foreground [a&]:hover:bg-d-success-background/90",
16
+ outline: "text-d-foreground [a&]:hover:bg-d-accent [a&]:hover:text-d-accent-foreground [a&]:hover:border-d-foreground/80",
17
+ "outline-primary": "text-d-primary border-d-primary [a&]:hover:text-d-primary [a&]:hover:bg-d-primary/10 [a&]:hover:border-d-primary/80",
18
+ "outline-destructive": "text-d-destructive border-d-destructive [a&]:hover:text-d-destructive [a&]:hover:bg-d-destructive/10 [a&]:hover:border-d-destructive/80",
19
+ "outline-warning": "text-d-warning border-d-warning [a&]:hover:text-d-warning [a&]:hover:bg-d-warning-background/10 [a&]:hover:border-d-warning/80",
20
+ "outline-success": "text-d-success border-d-success [a&]:hover:text-d-success [a&]:hover:bg-d-success-background/10 [a&]:hover:border-d-success/80",
12
21
  secondary: "border-transparent bg-d-secondary text-d-secondary-foreground [a&]:hover:bg-d-secondary/90",
13
22
  ghost: "border-transparent bg-transparent text-d-secondary-foreground [a&]:hover:bg-d-secondary/90",
14
- destructive: "border-transparent bg-d-destructive text-white [a&]:hover:bg-d-destructive/90 focus-visible:ring-d-destructive/20",
15
- outline: "text-d-foreground [a&]:hover:bg-d-accent [a&]:hover:text-d-background !bg-d-background",
16
- "outline-primary": "text-d-primary [a&]:hover:bg-d-accent [a&]:hover:text-d-background !bg-d-background !border-d-primary"
23
+ "ghost-destructive": "border-transparent bg-transparent text-d-destructive [a&]:hover:bg-d-destructive/10",
24
+ "ghost-accent": "border-transparent bg-transparent text-d-primary [a&]:hover:bg-d-primary/10",
25
+ "ghost-warning": "border-transparent bg-transparent text-d-warning [a&]:hover:bg-d-warning/10",
26
+ "ghost-success": "border-transparent bg-transparent text-d-success [a&]:hover:bg-d-success/10",
27
+ link: "border-transparent bg-transparent text-d-primary underline-offset-4 hover:underline cursor-pointer"
17
28
  }
18
29
  },
19
30
  defaultVariants: {
@@ -21,22 +32,46 @@ const s = n(
21
32
  }
22
33
  }
23
34
  );
24
- function p({
25
- className: r,
26
- variant: e,
27
- asChild: t = !1,
28
- ...a
35
+ function y({
36
+ className: t,
37
+ variant: a,
38
+ asChild: d = !1,
39
+ disabled: n = !1,
40
+ iconLeft: o,
41
+ iconRight: s,
42
+ ...r
29
43
  }) {
30
- return /* @__PURE__ */ o(
31
- t ? d : "span",
44
+ const i = d ? v : "span";
45
+ return d ? /* @__PURE__ */ e(
46
+ i,
32
47
  {
33
48
  "data-slot": "badge",
34
- className: i(s({ variant: e }), r),
35
- ...a
49
+ className: c(
50
+ u({ variant: a }),
51
+ n && "cursor-not-allowed opacity-50",
52
+ t
53
+ ),
54
+ ...r
55
+ }
56
+ ) : /* @__PURE__ */ b(
57
+ i,
58
+ {
59
+ "data-slot": "badge",
60
+ className: c(
61
+ u({ variant: a }),
62
+ n && "cursor-not-allowed opacity-50",
63
+ t
64
+ ),
65
+ ...r,
66
+ children: [
67
+ o && /* @__PURE__ */ e(g, { name: o }),
68
+ r.children,
69
+ s && /* @__PURE__ */ e(g, { name: s })
70
+ ]
36
71
  }
37
72
  );
38
73
  }
39
74
  export {
40
- p as Badge,
41
- s as badgeVariants
75
+ y as Badge,
76
+ u as badgeVariants
42
77
  };
@@ -11,11 +11,11 @@ const v = m(
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 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 ",
17
- secondary: "bg-d-secondary text-d-secondary-foreground shadow-xs hover:bg-d-secondary/80 hover:text-d-secondary-foreground ",
18
- ghost: "hover:bg-d-accent hover:text-d-accent-foreground ",
14
+ outline: "border border-d-foreground shadow-xs disabled:border-d-foreground/30 hover:bg-d-accent hover:text-d-accent-foreground 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",
17
+ secondary: "bg-d-secondary text-d-secondary-foreground shadow-xs hover:bg-d-secondary/80 hover:text-d-secondary-foreground",
18
+ ghost: "hover:bg-d-accent hover:text-d-accent-foreground",
19
19
  "ghost-destructive": "text-d-destructive bg-transparent hover:bg-d-destructive/10",
20
20
  "ghost-accent": "text-d-primary bg-transparent hover:bg-d-primary/10",
21
21
  link: "text-d-primary underline-offset-4 hover:underline"
@@ -35,27 +35,27 @@ const v = m(
35
35
  );
36
36
  function w({
37
37
  className: o,
38
- variant: d,
38
+ variant: a,
39
39
  size: e,
40
- asChild: a = !1,
40
+ asChild: d = !1,
41
41
  iconLeft: s,
42
42
  iconRight: n,
43
43
  isLoading: b = !1,
44
44
  ...t
45
45
  }) {
46
- const i = a ? f : "button";
47
- return a ? /* @__PURE__ */ r(
46
+ const i = d ? f : "button";
47
+ return d ? /* @__PURE__ */ r(
48
48
  i,
49
49
  {
50
50
  "data-slot": "button",
51
- className: c(v({ variant: d, size: e, className: o })),
51
+ className: c(v({ variant: a, size: e, className: o })),
52
52
  ...t
53
53
  }
54
54
  ) : /* @__PURE__ */ u(
55
55
  i,
56
56
  {
57
57
  "data-slot": "button",
58
- className: c(v({ variant: d, size: e, className: o }), "relative"),
58
+ className: c(v({ variant: a, size: e, className: o }), "relative"),
59
59
  ...t,
60
60
  children: [
61
61
  b ? /* @__PURE__ */ u(
@@ -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
  };
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { jsx as r, jsxs as s } from "react/jsx-runtime";
3
- import { Root as l, Trigger as p, Portal as m, Content as c, Arrow as f, Provider as u } from "../../node_modules/@radix-ui/react-tooltip/dist/index.js";
3
+ import { Root as l, Portal as p, Content as m, Arrow as c, Provider as f, Trigger as u } from "../../node_modules/@radix-ui/react-tooltip/dist/index.js";
4
4
  import { cva as e } from "../../node_modules/class-variance-authority/dist/index.js";
5
5
  import { cn as i } from "../../lib/utils.js";
6
6
  const g = e(
@@ -35,7 +35,7 @@ function b({
35
35
  ...o
36
36
  }) {
37
37
  return /* @__PURE__ */ r(
38
- u,
38
+ f,
39
39
  {
40
40
  "data-slot": "tooltip-provider",
41
41
  delayDuration: t,
@@ -51,7 +51,7 @@ function w({
51
51
  function z({
52
52
  ...t
53
53
  }) {
54
- return /* @__PURE__ */ r(p, { "data-slot": "tooltip-trigger", ...t });
54
+ return /* @__PURE__ */ r(u, { "data-slot": "tooltip-trigger", ...t });
55
55
  }
56
56
  function V({
57
57
  className: t,
@@ -60,8 +60,8 @@ function V({
60
60
  children: d,
61
61
  ...n
62
62
  }) {
63
- return /* @__PURE__ */ r(m, { children: /* @__PURE__ */ s(
64
- c,
63
+ return /* @__PURE__ */ r(p, { children: /* @__PURE__ */ s(
64
+ m,
65
65
  {
66
66
  "data-slot": "tooltip-content",
67
67
  sideOffset: o,
@@ -70,7 +70,7 @@ function V({
70
70
  children: [
71
71
  d,
72
72
  /* @__PURE__ */ r(
73
- f,
73
+ c,
74
74
  {
75
75
  className: i(x({ variant: a }))
76
76
  }
@@ -21,6 +21,12 @@
21
21
  --color-d-accent-foreground: var(--d-accent-foreground);
22
22
  --color-d-destructive: var(--d-destructive);
23
23
  --color-d-destructive-foreground: var(--d-destructive-foreground);
24
+ --color-d-warning: var(--d-warning);
25
+ --color-d-warning-background: var(--d-warning);
26
+ --color-d-warning-foreground: var(--d-warning-foreground);
27
+ --color-d-success: var(--d-success);
28
+ --color-d-success-background: var(--d-success);
29
+ --color-d-success-foreground: var(--d-success-foreground);
24
30
  --color-d-border: var(--d-border);
25
31
  --color-d-input: var(--d-input);
26
32
  --color-d-ring: var(--d-ring);