laif-ds 0.2.23 → 0.2.24

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.
Files changed (44) hide show
  1. package/dist/components/ui/alert-dialog.js +6 -6
  2. package/dist/components/ui/app-multiple-select-dropdown.js +34 -34
  3. package/dist/components/ui/app-select.js +127 -124
  4. package/dist/components/ui/badge.js +13 -12
  5. package/dist/components/ui/button.js +20 -18
  6. package/dist/components/ui/calendar.js +6 -6
  7. package/dist/components/ui/checkbox.js +9 -9
  8. package/dist/components/ui/confirmer.js +45 -19
  9. package/dist/components/ui/context-menu.js +4 -4
  10. package/dist/components/ui/input-otp.js +16 -16
  11. package/dist/components/ui/input-selector.js +19 -19
  12. package/dist/components/ui/input.js +19 -19
  13. package/dist/components/ui/menubar.js +1 -1
  14. package/dist/components/ui/pagination.js +90 -77
  15. package/dist/components/ui/radio-group.js +14 -14
  16. package/dist/components/ui/select.js +27 -27
  17. package/dist/components/ui/switch.js +8 -6
  18. package/dist/components/ui/table.js +16 -16
  19. package/dist/components/ui/tables/data-cross-table/data-cross-table.js +6 -6
  20. package/dist/components/ui/tables/data-table/components/data-table-actions.js +51 -0
  21. package/dist/components/ui/tables/data-table/components/data-table-advanced-filter.js +470 -0
  22. package/dist/components/ui/tables/data-table/components/data-table-body.js +340 -0
  23. package/dist/components/ui/tables/data-table/components/data-table-column-visibility.js +274 -0
  24. package/dist/components/ui/tables/data-table/components/data-table-filter-inputs.js +177 -0
  25. package/dist/components/ui/tables/data-table/components/data-table-filters.js +286 -0
  26. package/dist/components/ui/tables/data-table/components/data-table-pagination.js +131 -0
  27. package/dist/components/ui/tables/data-table/components/data-table-searchbar.js +112 -0
  28. package/dist/components/ui/tables/data-table/components/data-table-simple-filters.js +263 -0
  29. package/dist/components/ui/tables/data-table/components/data-table-sorting.js +128 -0
  30. package/dist/components/ui/tables/data-table/data-table-constants.js +58 -0
  31. package/dist/components/ui/tables/data-table/data-table-i18n.js +138 -0
  32. package/dist/components/ui/tables/data-table/data-table.js +549 -0
  33. package/dist/components/ui/tables/data-table/data-table.service.js +254 -0
  34. package/dist/components/ui/tabs.js +33 -33
  35. package/dist/components/ui/textarea.js +11 -11
  36. package/dist/components/ui/tooltip.js +10 -10
  37. package/dist/css-for-template.css +57 -0
  38. package/dist/index.d.ts +245 -75
  39. package/dist/index.js +64 -64
  40. package/dist/styles.css +1 -1
  41. package/dist/styles.v3.css +1 -1
  42. package/package.json +5 -3
  43. package/dist/components/ui/data-table.js +0 -461
  44. package/dist/components/ui/data-table.service.js +0 -62
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import { jsx as e, jsxs as r } from "react/jsx-runtime";
3
3
  import { Root as n, Trigger as i, Content as s, Title as d, Description as c, Action as g, Cancel as u, Portal as f, Overlay as m } from "../../node_modules/@radix-ui/react-alert-dialog/dist/index.js";
4
- import { cn as o } from "../../lib/utils.js";
5
4
  import { buttonVariants as l } from "./button.js";
5
+ import { cn as o } from "../../lib/utils.js";
6
6
  function N({ ...t }) {
7
7
  return /* @__PURE__ */ e(n, { "data-slot": "alert-dialog", ...t });
8
8
  }
@@ -64,7 +64,7 @@ function C({ className: t, ...a }) {
64
64
  }
65
65
  );
66
66
  }
67
- function z({ className: t, ...a }) {
67
+ function h({ className: t, ...a }) {
68
68
  return /* @__PURE__ */ e(
69
69
  d,
70
70
  {
@@ -74,7 +74,7 @@ function z({ className: t, ...a }) {
74
74
  }
75
75
  );
76
76
  }
77
- function h({
77
+ function z({
78
78
  className: t,
79
79
  ...a
80
80
  }) {
@@ -100,7 +100,7 @@ function O({ className: t, ...a }) {
100
100
  return /* @__PURE__ */ e(
101
101
  u,
102
102
  {
103
- className: o(l({ variant: "outline" }), t),
103
+ className: o(l({ variant: "ghost" }), t),
104
104
  ...a
105
105
  }
106
106
  );
@@ -110,11 +110,11 @@ export {
110
110
  j as AlertDialogAction,
111
111
  O as AlertDialogCancel,
112
112
  T as AlertDialogContent,
113
- h as AlertDialogDescription,
113
+ z as AlertDialogDescription,
114
114
  C as AlertDialogFooter,
115
115
  w as AlertDialogHeader,
116
116
  x as AlertDialogOverlay,
117
117
  p as AlertDialogPortal,
118
- z as AlertDialogTitle,
118
+ h as AlertDialogTitle,
119
119
  y as AlertDialogTrigger
120
120
  };
@@ -1,16 +1,16 @@
1
1
  "use client";
2
2
  import { jsx as r, jsxs as l, Fragment as A } from "react/jsx-runtime";
3
- import * as t from "react";
4
- import { useEffect as B } from "react";
3
+ import { Badge as B } from "./badge.js";
4
+ import { Command as E, CommandList as F, CommandEmpty as V, CommandGroup as G, CommandItem as X } from "./command.js";
5
+ import { Label as $ } from "./label.js";
5
6
  import { cn as u } from "../../lib/utils.js";
6
- import { Label as E } from "./label.js";
7
- import { Badge as F } from "./badge.js";
8
- import { Popover as V, PopoverTrigger as G, PopoverContent as X } from "./popover.js";
9
- import { Command as $, CommandList as q, CommandEmpty as H, CommandGroup as I, CommandItem as J } from "./command.js";
10
- import { inputVariants as K } from "./input.js";
11
- import { Checkbox as Q } from "./checkbox.js";
7
+ import * as t from "react";
8
+ import { useEffect as q } from "react";
9
+ import { selectTriggerVariants as H } from "./async-select.js";
10
+ import { Checkbox as I } from "./checkbox.js";
12
11
  import { Icon as N } from "./icon.js";
13
- import { selectTriggerVariants as U } from "./async-select.js";
12
+ import { inputVariants as J } from "./input.js";
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";
15
15
  const Z = t.createContext({ size: "default" });
16
16
  function ue({
@@ -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), [c, v] = t.useState(""), [O, S] = t.useState(
33
+ const f = t.useId(), [s, D] = t.useState(!1), [d, 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((d) => d !== e));
38
+ o(n.filter((c) => c !== e));
39
39
  else {
40
40
  if (i && n.length >= i)
41
41
  return;
@@ -45,24 +45,24 @@ 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(() => c ? a.filter(
49
- (e) => e.label.toLowerCase().includes(c.toLowerCase())
50
- ) : a, [a, c]), x = t.useMemo(() => i ? n.length >= i : !1, [n, i]);
51
- return B(() => {
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]);
51
+ return q(() => {
52
52
  if (s && p.current) {
53
53
  const e = p.current.getBoundingClientRect();
54
54
  S(e.width);
55
55
  }
56
56
  }, [s]), /* @__PURE__ */ r(Z.Provider, { value: { size: m, id: f }, children: /* @__PURE__ */ l("div", { className: "space-y-1.5", children: [
57
- b && /* @__PURE__ */ r(E, { htmlFor: f, className: u(k, "w-fit"), children: b }),
57
+ b && /* @__PURE__ */ r($, { htmlFor: f, className: u(k, "w-fit"), children: b }),
58
58
  /* @__PURE__ */ r(
59
59
  "div",
60
60
  {
61
61
  ref: L,
62
62
  className: "relative w-full",
63
63
  "data-slot": "app-multiple-select-dropdown",
64
- children: /* @__PURE__ */ l(V, { open: s, onOpenChange: D, children: [
65
- /* @__PURE__ */ r(G, { asChild: !0, children: /* @__PURE__ */ l(
64
+ children: /* @__PURE__ */ l(K, { open: s, onOpenChange: D, children: [
65
+ /* @__PURE__ */ r(Q, { asChild: !0, children: /* @__PURE__ */ l(
66
66
  "button",
67
67
  {
68
68
  id: f,
@@ -72,10 +72,10 @@ function ue({
72
72
  disabled: y,
73
73
  ref: p,
74
74
  className: u(
75
- U({ size: m }),
75
+ H({ size: m }),
76
76
  "!bg-d-input hover:bg-d-input/50 relative w-full justify-between font-normal",
77
77
  "ring-offset-background border-d-border/50 flex items-center rounded-md border whitespace-nowrap focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",
78
- "aria-invalid:ring-d-destructive/20 dark:aria-invalid:ring-d-destructive/40 aria-invalid:border-d-destructive",
78
+ "aria-invalid:ring-d-destructive/20 aria-invalid:border-d-destructive",
79
79
  "focus-visible:ring-d-ring focus-visible:ring-1",
80
80
  s && "ring-d-ring ring-1",
81
81
  z
@@ -83,7 +83,7 @@ function ue({
83
83
  children: [
84
84
  /* @__PURE__ */ r("div", { className: "flex w-full items-center justify-between gap-2 overflow-hidden", children: h.length > 0 ? /* @__PURE__ */ l(A, { children: [
85
85
  /* @__PURE__ */ l(
86
- F,
86
+ B,
87
87
  {
88
88
  variant: "secondary",
89
89
  className: "!bg-d-accent flex items-center gap-1",
@@ -118,7 +118,7 @@ function ue({
118
118
  }
119
119
  ) }),
120
120
  /* @__PURE__ */ r(
121
- X,
121
+ U,
122
122
  {
123
123
  className: u("p-0"),
124
124
  style: { width: O },
@@ -127,7 +127,7 @@ function ue({
127
127
  sideOffset: 4,
128
128
  onWheel: (e) => e.stopPropagation(),
129
129
  avoidCollisions: !1,
130
- children: /* @__PURE__ */ l($, { className: "bg-d-popover w-full rounded-md border border-none", children: [
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
  N,
@@ -142,31 +142,31 @@ function ue({
142
142
  {
143
143
  id: "app-multiple-select-dropdown-filter",
144
144
  placeholder: P,
145
- value: c,
145
+ value: d,
146
146
  onChange: (e) => v(e.target.value),
147
- className: `focus-visible:ring-none border-none focus-visible:border-none disabled:opacity-50 ${K({ size: m })} !shadow-none`
147
+ className: `focus-visible:ring-none border-none focus-visible:border-none disabled:opacity-50 ${J({ size: m })} !shadow-none`
148
148
  }
149
149
  )
150
150
  ] }) }),
151
- /* @__PURE__ */ l(q, { className: "max-h-60 w-full", children: [
152
- /* @__PURE__ */ r(H, { children: M }),
153
- /* @__PURE__ */ r(I, { children: W.map((e) => {
154
- const d = n.includes(e.value);
151
+ /* @__PURE__ */ l(F, { className: "max-h-60 w-full", children: [
152
+ /* @__PURE__ */ r(V, { children: M }),
153
+ /* @__PURE__ */ r(G, { children: W.map((e) => {
154
+ const c = n.includes(e.value);
155
155
  return /* @__PURE__ */ l(
156
- J,
156
+ X,
157
157
  {
158
158
  value: e.value,
159
- disabled: e.disabled || !d && x,
159
+ disabled: e.disabled || !c && x,
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 || !d && x) && "cursor-not-allowed opacity-50"
163
+ (e.disabled || !c && x) && "cursor-not-allowed opacity-50"
164
164
  ),
165
165
  children: [
166
166
  /* @__PURE__ */ r(
167
- Q,
167
+ I,
168
168
  {
169
- checked: d,
169
+ checked: c,
170
170
  className: "z-10 mr-2 flex-shrink-0",
171
171
  onCheckedChange: () => {
172
172
  console.log("checkbox change for:", e.value), w(e.value);
@@ -1,197 +1,200 @@
1
1
  "use client";
2
- import { jsxs as s, jsx as l, Fragment as ee } from "react/jsx-runtime";
3
- import { Badge as le } from "./badge.js";
4
- import { Command as re, CommandInput as ne, CommandList as te, CommandEmpty as ae, CommandGroup as D, CommandItem as j } from "./command.js";
5
- import { Label as se } from "./label.js";
6
- import { cn as h } from "../../lib/utils.js";
7
- import { useState as p, useRef as oe, useMemo as N, useCallback as ie, useEffect as de } from "react";
8
- import { Checkbox as ce } from "./checkbox.js";
9
- import { Icon as B } from "./icon.js";
10
- import { Popover as ue, PopoverTrigger as me, PopoverContent as fe } from "./popover.js";
11
- import he from "../../node_modules/lucide-react/dist/esm/icons/chevron-down.js";
12
- const pe = {
2
+ import { jsxs as s, jsx as r, Fragment as le } from "react/jsx-runtime";
3
+ import { Badge as re } from "./badge.js";
4
+ import { Command as ne, CommandInput as te, CommandList as ae, CommandEmpty as se, CommandGroup as j, CommandItem as B } from "./command.js";
5
+ import { Label as ie } from "./label.js";
6
+ import { cn as y } from "../../lib/utils.js";
7
+ import { useState as h, useRef as oe, useMemo as N, useCallback as de, useEffect as ce } from "react";
8
+ import { Button as D } from "./button.js";
9
+ import { Checkbox as ue } from "./checkbox.js";
10
+ import { Icon as me } from "./icon.js";
11
+ import { Popover as fe, PopoverTrigger as he, PopoverContent as pe } from "./popover.js";
12
+ import ge from "../../node_modules/lucide-react/dist/esm/icons/chevron-down.js";
13
+ const ve = {
13
14
  sm: "min-h-8 h-8 text-xs py-1.5",
14
15
  default: "min-h-9 h-9 text-sm py-2",
15
16
  lg: "min-h-10 h-10 text-base py-2"
16
- }, ge = {
17
- sm: "h-5 w-5",
18
- default: "h-5 w-5",
19
- lg: "h-5.5 w-5.5"
20
17
  };
21
- function ze(M) {
18
+ function ke(S) {
22
19
  const {
23
- multiple: a = !1,
24
- options: u,
25
- value: S,
26
- defaultValue: A,
27
- onValueChange: R,
28
- onClear: g,
29
- placeholder: E = "Seleziona...",
30
- emptyPlaceholder: F = "Nessun risultato",
31
- searchPlaceholder: L = "Cerca...",
32
- addItemPlaceholder: T = "Aggiungi",
33
- itemCountMessage: W = (e) => `${e} elementi selezionati`,
34
- maxSelectedMessage: X = (e) => `Puoi selezionare fino a ${e} elementi`,
20
+ multiple: n = !1,
21
+ options: m,
22
+ value: A,
23
+ defaultValue: L,
24
+ onValueChange: M,
25
+ onClear: p,
26
+ placeholder: R = "Seleziona...",
27
+ emptyPlaceholder: X = "Nessun risultato",
28
+ searchPlaceholder: E = "Cerca...",
29
+ addItemPlaceholder: F = "Aggiungi",
30
+ itemCountMessage: T = (e) => `${e} elementi selezionati`,
31
+ maxSelectedMessage: W = (e) => `Puoi selezionare fino a ${e} elementi`,
35
32
  label: P,
36
33
  className: $ = "",
37
- wrpClassName: q = "",
38
- searchable: V = !1,
39
- creatable: G = !1,
40
- groupBy: v = "group",
34
+ wrpClassName: G = "",
35
+ searchable: O = !1,
36
+ creatable: q = !1,
37
+ groupBy: g = "group",
41
38
  maxSelected: o,
42
39
  showChipsInsteadOfCount: H = !1,
43
- disabled: b,
44
- size: z = "default"
45
- } = M, [x, C] = p(!1), [i, w] = p(""), y = oe(null), [J, K] = p(0), O = S !== void 0, [Q, U] = p(A), d = O ? S : Q, c = (e) => {
46
- O || U(e), R?.(e);
47
- }, n = N(() => a ? Array.isArray(d) ? d : [] : d != null ? [d] : [], [d, a]), f = N(() => {
48
- const e = u.filter((t) => n.includes(t.value));
49
- if (a) {
50
- const t = n.filter((r) => !e.find((m) => m.value === r)).map((r) => ({ value: r, label: r }));
51
- return [...e, ...t];
52
- } else if (n.length && !e.length)
53
- return [{ value: n[0], label: n[0] }];
40
+ disabled: v,
41
+ size: J = "default",
42
+ isSingleSelectClearable: K = !1
43
+ } = S, [b, x] = h(!1), [d, C] = h(""), w = oe(null), [Q, U] = h(0), V = S.hasOwnProperty("value"), [Y, Z] = h(L), i = V ? A : Y, c = (e) => {
44
+ V || Z(e), M?.(e);
45
+ }, t = N(() => n ? Array.isArray(i) ? i : [] : i != null ? [i] : [], [i, n]), u = N(() => {
46
+ const e = m.filter((a) => t.includes(a.value));
47
+ if (n) {
48
+ const a = t.filter((l) => !e.find((f) => f.value === l)).map((l) => ({ value: l, label: l }));
49
+ return [...e, ...a];
50
+ } else if (t.length && !e.length)
51
+ return [{ value: t[0], label: t[0] }];
54
52
  return e;
55
- }, [u, n, a]), I = (e) => {
53
+ }, [m, t, n]), z = (e) => {
56
54
  if (!e.disabled)
57
- if (a) {
58
- const t = n.includes(e.value);
59
- if (!t && o !== void 0 && n.length >= o)
55
+ if (n) {
56
+ const a = t.includes(e.value);
57
+ if (!a && o !== void 0 && t.length >= o)
60
58
  return;
61
59
  c(
62
- t ? n.filter((r) => r !== e.value) : [...n, e.value]
60
+ a ? t.filter((l) => l !== e.value) : [...t, e.value]
63
61
  );
64
62
  } else
65
- c(e.value), C(!1);
66
- }, Y = ie(() => {
67
- c([]), w(""), g && g();
68
- }, [c, g]), Z = N(() => v ? u.reduce(
69
- (e, t) => {
70
- const r = t[v] || "";
71
- return e[r] = e[r] || [], e[r].push(t), e;
63
+ c(e.value), x(!1);
64
+ }, k = de(() => {
65
+ c(n ? [] : void 0), C(""), p && p();
66
+ }, [c, p, n]), _ = N(() => g ? m.reduce(
67
+ (e, a) => {
68
+ const l = a[g] || "";
69
+ return e[l] = e[l] || [], e[l].push(a), e;
72
70
  },
73
71
  {}
74
- ) : { "": u }, [u, v]);
75
- return de(() => {
76
- x && y.current && K(y.current.getBoundingClientRect().width);
77
- }, [x]), /* @__PURE__ */ s("div", { className: h("flex flex-col gap-2", q), children: [
78
- P && /* @__PURE__ */ l(se, { children: P }),
72
+ ) : { "": m }, [m, g]);
73
+ return ce(() => {
74
+ b && w.current && U(w.current.getBoundingClientRect().width);
75
+ }, [b]), /* @__PURE__ */ s("div", { className: y("flex flex-col gap-2", G), children: [
76
+ P && /* @__PURE__ */ r(ie, { children: P }),
79
77
  /* @__PURE__ */ s(
80
- ue,
78
+ fe,
81
79
  {
82
- open: b ? !1 : x,
83
- onOpenChange: (e) => !b && C(e),
80
+ open: v ? !1 : b,
81
+ onOpenChange: (e) => !v && x(e),
84
82
  modal: !0,
85
83
  children: [
86
- /* @__PURE__ */ l(me, { asChild: !0, children: /* @__PURE__ */ s(
84
+ /* @__PURE__ */ r(he, { asChild: !0, children: /* @__PURE__ */ s(
87
85
  "div",
88
86
  {
89
- ref: y,
90
- className: h(
91
- "bg-d-input border-d-border/50 focus-within:ring-d-ring flex min-h-10 w-full min-w-[100px] items-center justify-between gap-2 rounded-md border px-3 py-2 text-sm focus-within:ring-1",
92
- pe[z],
93
- b && "cursor-not-allowed opacity-50",
87
+ ref: w,
88
+ className: y(
89
+ "bg-d-input border-d-border/50 focus-within:ring-d-ring flex min-h-10 w-full min-w-[100px] cursor-pointer items-center justify-between gap-2 rounded-md border px-3 py-2 text-sm focus-within:ring-1",
90
+ ve[J],
91
+ v && "cursor-not-allowed opacity-50",
94
92
  $
95
93
  ),
96
94
  children: [
97
- f.length === 0 ? /* @__PURE__ */ l("span", { className: "text-d-muted-foreground", children: E }) : a ? /* @__PURE__ */ s("div", { className: "flex h-full w-full min-w-0 items-center justify-between gap-2", children: [
98
- /* @__PURE__ */ l("div", { className: "flex min-w-0 flex-nowrap gap-1 overflow-auto", children: H ? /* @__PURE__ */ l(ee, { children: f.map((e) => /* @__PURE__ */ s(
99
- le,
95
+ u.length === 0 ? /* @__PURE__ */ r("span", { className: "text-d-muted-foreground", children: R }) : n ? /* @__PURE__ */ s("div", { className: "flex h-full w-full min-w-0 items-center justify-between gap-2", children: [
96
+ /* @__PURE__ */ r("div", { className: "flex min-w-0 flex-nowrap gap-1 overflow-auto", children: H ? /* @__PURE__ */ r(le, { children: u.map((e) => /* @__PURE__ */ s(
97
+ re,
100
98
  {
101
99
  variant: "secondary",
102
100
  className: "hover:bg-d-secondary/100 bg-d-secondary/50 border-d-border flex cursor-pointer items-center gap-1 border",
103
- onClick: (t) => {
104
- t.stopPropagation(), I(e);
101
+ onClick: (a) => {
102
+ a.stopPropagation(), z(e);
105
103
  },
106
104
  children: [
107
105
  e.label,
108
- !e.fixed && /* @__PURE__ */ l(B, { name: "X", size: "xs" })
106
+ !e.fixed && /* @__PURE__ */ r(me, { name: "X", size: "xs" })
109
107
  ]
110
108
  },
111
109
  e.value
112
- )) }) : /* @__PURE__ */ l("div", { children: W(f.length) }) }),
113
- /* @__PURE__ */ l(
114
- "div",
110
+ )) }) : /* @__PURE__ */ r("div", { children: T(u.length) }) }),
111
+ n && /* @__PURE__ */ r(
112
+ D,
115
113
  {
116
- className: h(
117
- "border-d-input bg-d-accent flex aspect-square cursor-pointer items-center rounded-full p-1",
118
- ge[z]
119
- ),
114
+ className: "h-6 w-6 rounded-full",
115
+ iconLeft: "X",
116
+ variant: "ghost-destructive",
117
+ size: "icon",
120
118
  onClick: (e) => {
121
- e.stopPropagation(), e.preventDefault(), Y();
122
- },
123
- onMouseDown: (e) => e.preventDefault(),
124
- children: /* @__PURE__ */ l(
125
- B,
126
- {
127
- name: "X",
128
- size: "xs",
129
- className: "!text-d-foreground h-full w-full opacity-50"
130
- }
131
- )
119
+ e.stopPropagation(), e.preventDefault(), k();
120
+ }
121
+ }
122
+ )
123
+ ] }) : /* @__PURE__ */ s("div", { className: "flex h-full w-full min-w-0 items-center justify-between gap-2", children: [
124
+ /* @__PURE__ */ r("div", { className: "min-w-0 flex-1 truncate", children: typeof u[0]?.label == "string" ? /* @__PURE__ */ r("span", { children: u[0]?.label }) : u[0]?.label }),
125
+ K && i !== void 0 && i !== null && /* @__PURE__ */ r(
126
+ D,
127
+ {
128
+ className: "h-6 w-6 rounded-full",
129
+ iconLeft: "X",
130
+ variant: "ghost-destructive",
131
+ size: "icon",
132
+ onClick: (e) => {
133
+ e.stopPropagation(), e.preventDefault(), k();
134
+ }
132
135
  }
133
136
  )
134
- ] }) : /* @__PURE__ */ l("span", { children: f[0]?.label }),
135
- /* @__PURE__ */ l(he, { className: "h-4 w-4 opacity-50" })
137
+ ] }),
138
+ /* @__PURE__ */ r(ge, { className: "h-4 w-4 opacity-50" })
136
139
  ]
137
140
  }
138
141
  ) }),
139
- /* @__PURE__ */ l(
140
- fe,
142
+ /* @__PURE__ */ r(
143
+ pe,
141
144
  {
142
145
  className: "p-0",
143
- style: { width: J },
146
+ style: { width: Q },
144
147
  align: "start",
145
148
  sideOffset: 4,
146
- children: /* @__PURE__ */ s(re, { shouldFilter: !!V, className: "w-full", children: [
147
- V && /* @__PURE__ */ l(
148
- ne,
149
+ children: /* @__PURE__ */ s(ne, { shouldFilter: !!O, className: "w-full", children: [
150
+ O && /* @__PURE__ */ r(
151
+ te,
149
152
  {
150
- placeholder: L,
153
+ placeholder: E,
151
154
  className: "placeholder:text-d-muted-foreground",
152
- value: i,
153
- onValueChange: w
155
+ value: d,
156
+ onValueChange: C
154
157
  }
155
158
  ),
156
- /* @__PURE__ */ s(te, { className: "max-h-60 overflow-auto overscroll-contain", children: [
157
- /* @__PURE__ */ l(ae, { children: F }),
158
- G && i && /* @__PURE__ */ l(D, { children: /* @__PURE__ */ l(
159
- j,
159
+ /* @__PURE__ */ s(ae, { className: "max-h-60 overflow-auto overscroll-contain", children: [
160
+ /* @__PURE__ */ r(se, { children: X }),
161
+ q && d && /* @__PURE__ */ r(j, { children: /* @__PURE__ */ r(
162
+ B,
160
163
  {
161
164
  className: "cursor-pointer",
162
165
  onSelect: () => {
163
- i && (c(a ? [...n, i] : i), w(""), !a && C(!1));
166
+ d && (c(n ? [...t, d] : d), C(""), !n && x(!1));
164
167
  },
165
168
  children: /* @__PURE__ */ s("div", { className: "text-d-foreground text-xs", children: [
166
- T,
169
+ F,
167
170
  " “",
168
- i,
171
+ d,
169
172
  "”"
170
173
  ] })
171
174
  }
172
175
  ) }),
173
- Object.entries(Z).map(([e, t]) => /* @__PURE__ */ l(D, { heading: e || void 0, children: t.map((r) => {
174
- const m = n.includes(r.value), _ = a && o !== void 0 && !m && n.length >= o, k = r.disabled || _;
176
+ Object.entries(_).map(([e, a]) => /* @__PURE__ */ r(j, { heading: e || void 0, children: a.map((l) => {
177
+ const f = t.includes(l.value), ee = n && o !== void 0 && !f && t.length >= o, I = l.disabled || ee;
175
178
  return /* @__PURE__ */ s(
176
- j,
179
+ B,
177
180
  {
178
- value: typeof r.label == "string" ? r.label : String(r.value),
179
- onSelect: () => !k && I(r),
180
- className: h(
181
+ value: typeof l.label == "string" ? l.label : String(l.value),
182
+ onSelect: () => !I && z(l),
183
+ className: y(
181
184
  "cursor-pointer",
182
- k && "cursor-not-allowed opacity-50",
183
- !a && m && "bg-d-accent/75 text-d-accent-foreground"
185
+ I && "cursor-not-allowed opacity-50",
186
+ !n && f && "bg-d-accent/75 text-d-accent-foreground"
184
187
  ),
185
188
  children: [
186
- a && /* @__PURE__ */ l(ce, { checked: m, className: "mr-1" }),
187
- /* @__PURE__ */ l("span", { children: r.label })
189
+ n && /* @__PURE__ */ r(ue, { checked: f, className: "mr-1" }),
190
+ typeof l.label == "string" ? /* @__PURE__ */ r("span", { children: l.label }) : l.label
188
191
  ]
189
192
  },
190
- r.value
193
+ l.value
191
194
  );
192
195
  }) }, e))
193
196
  ] }),
194
- a && o !== void 0 && n.length >= o && /* @__PURE__ */ l("div", { className: "border-d-border text-d-muted-foreground border-t px-2 py-1 text-xs", children: X(o) })
197
+ n && o !== void 0 && t.length >= o && /* @__PURE__ */ r("div", { className: "border-d-border text-d-muted-foreground border-t px-2 py-1 text-xs", children: W(o) })
195
198
  ] })
196
199
  }
197
200
  )
@@ -201,5 +204,5 @@ function ze(M) {
201
204
  ] });
202
205
  }
203
206
  export {
204
- ze as AppSelect
207
+ ke as AppSelect
205
208
  };
@@ -1,16 +1,17 @@
1
1
  "use client";
2
- import { jsx as a } from "react/jsx-runtime";
3
- import { Root as i } from "../../node_modules/@radix-ui/react-slot/dist/index.js";
4
- import { cva as o } from "../../node_modules/class-variance-authority/dist/index.js";
5
- import { cn as n } from "../../lib/utils.js";
6
- const s = o(
7
- "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 dark:aria-invalid:ring-d-destructive/40 aria-invalid:border-d-destructive transition-[color,box-shadow] overflow-hidden",
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(
7
+ "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
8
  {
9
9
  variants: {
10
10
  variant: {
11
11
  default: "border-transparent bg-d-primary text-d-primary-foreground [a&]:hover:bg-d-primary/90",
12
12
  secondary: "border-transparent bg-d-secondary text-d-secondary-foreground [a&]:hover:bg-d-secondary/90",
13
- destructive: "border-transparent bg-d-destructive text-white [a&]:hover:bg-d-destructive/90 focus-visible:ring-d-destructive/20 dark:focus-visible:ring-d-destructive/40 dark:bg-d-destructive/60",
13
+ 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",
14
15
  outline: "text-d-foreground [a&]:hover:bg-d-accent [a&]:hover:text-d-background !bg-d-background",
15
16
  "outline-primary": "text-d-primary [a&]:hover:bg-d-accent [a&]:hover:text-d-background !bg-d-background !border-d-primary"
16
17
  }
@@ -24,14 +25,14 @@ function p({
24
25
  className: r,
25
26
  variant: e,
26
27
  asChild: t = !1,
27
- ...d
28
+ ...a
28
29
  }) {
29
- return /* @__PURE__ */ a(
30
- t ? i : "span",
30
+ return /* @__PURE__ */ o(
31
+ t ? d : "span",
31
32
  {
32
33
  "data-slot": "badge",
33
- className: n(s({ variant: e }), r),
34
- ...d
34
+ className: i(s({ variant: e }), r),
35
+ ...a
35
36
  }
36
37
  );
37
38
  }