laif-ds 0.1.80 → 0.1.81

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,6 @@
1
1
  "use client";
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);
2
+ import { __require as r } from "../node_modules/use-sync-external-store/shim/index.js";
3
+ var i = r();
6
4
  export {
7
- m as default
5
+ i as s
8
6
  };
@@ -1,8 +1,5 @@
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
+ var e = { exports: {} };
6
3
  export {
7
- a as default
4
+ e as __module
8
5
  };
@@ -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,5 +1,8 @@
1
1
  "use client";
2
- var e = { exports: {} };
2
+ import { getDefaultExportFromCjs as e } from "./_commonjsHelpers.js";
3
+ import { __require as r } from "../node_modules/extend/index.js";
4
+ var t = r();
5
+ const x = /* @__PURE__ */ e(t);
3
6
  export {
4
- e as __module
7
+ x as default
5
8
  };
@@ -1,5 +1,8 @@
1
1
  "use client";
2
- var e = { exports: {} };
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
6
  export {
4
- e as __module
7
+ m as default
5
8
  };
@@ -1,6 +1,5 @@
1
1
  "use client";
2
- import { __require as r } from "../node_modules/use-sync-external-store/shim/index.js";
3
- var i = r();
2
+ var e = { exports: {} };
4
3
  export {
5
- i as s
4
+ e as __module
6
5
  };
@@ -1,36 +1,37 @@
1
1
  "use client";
2
- import { jsx as r, jsxs as l, Fragment as A } from "react/jsx-runtime";
2
+ import { jsx as r, jsxs as l, Fragment as B } from "react/jsx-runtime";
3
3
  import * as n from "react";
4
- import { cn as N } from "../../lib/utils.js";
5
- import { Label as B } from "./label.js";
6
- import { Badge as F } from "./badge.js";
7
- import { Button as C } from "./button.js";
8
- import { Command as E, CommandList as G, CommandEmpty as V, CommandGroup as X, CommandItem as $ } from "./command.js";
9
- import { inputVariants as q } from "./input.js";
10
- import { Checkbox as H } from "./checkbox.js";
11
- import { Icon as I } from "./icon.js";
12
- import { CommandPortal as J } from "./command-portal.js";
13
- import K from "../../node_modules/lucide-react/dist/esm/icons/x.js";
14
- import Q from "../../node_modules/lucide-react/dist/esm/icons/chevron-down.js";
15
- const T = n.createContext({ size: "default" });
16
- function oe({
4
+ import { cn as C } from "../../lib/utils.js";
5
+ import { Label as F } from "./label.js";
6
+ import { Badge as E } from "./badge.js";
7
+ import { Button as y } from "./button.js";
8
+ import { Command as G, CommandList as V, CommandEmpty as X, CommandGroup as $, CommandItem as q } from "./command.js";
9
+ import { inputVariants as H } from "./input.js";
10
+ import { Checkbox as I } from "./checkbox.js";
11
+ import { Icon as J } from "./icon.js";
12
+ import { CommandPortal as K } from "./command-portal.js";
13
+ import Q from "../../node_modules/lucide-react/dist/esm/icons/x.js";
14
+ import T from "../../node_modules/lucide-react/dist/esm/icons/chevron-down.js";
15
+ const U = n.createContext({ size: "default" });
16
+ function ie({
17
17
  options: s,
18
18
  value: a,
19
19
  onChange: o,
20
- placeholder: y = "Seleziona...",
21
- disabled: k = !1,
22
- size: f = "default",
23
- label: p,
24
- labelClassName: z,
25
- emptyMessage: M = "Nessun risultato trovato",
26
- className: j,
27
- filterPlaceholder: P = "Cerca...",
28
- filterable: D = !1,
29
- cancelLabel: L = "Cancella selezione",
30
- cancelButtonLabel: R = "Cancella",
20
+ onClear: f,
21
+ placeholder: k = "Seleziona...",
22
+ disabled: z = !1,
23
+ size: p = "default",
24
+ label: h,
25
+ labelClassName: M,
26
+ emptyMessage: j = "Nessun risultato trovato",
27
+ className: P,
28
+ filterPlaceholder: D = "Cerca...",
29
+ filterable: L = !1,
30
+ cancelLabel: R = "Cancella selezione",
31
+ cancelButtonLabel: S = "Cancella",
31
32
  maxSelectedItems: t
32
33
  }) {
33
- const m = n.useId(), [u, h] = n.useState(!1), [d, b] = n.useState(""), g = n.useRef(null), v = n.useCallback(
34
+ const m = n.useId(), [u, b] = n.useState(!1), [d, g] = n.useState(""), v = n.useRef(null), w = n.useCallback(
34
35
  (e) => {
35
36
  if (a.includes(e))
36
37
  o(a.filter((i) => i !== e));
@@ -41,40 +42,40 @@ function oe({
41
42
  }
42
43
  },
43
44
  [a, o, t]
44
- ), w = n.useCallback(() => {
45
- o([]), b("");
46
- }, [o]), c = n.useMemo(() => s.filter((e) => a.includes(e.value)), [s, a]), S = n.useMemo(() => d ? s.filter(
45
+ ), x = n.useCallback(() => {
46
+ o([]), g(""), f && f();
47
+ }, [o]), c = n.useMemo(() => s.filter((e) => a.includes(e.value)), [s, a]), O = n.useMemo(() => d ? s.filter(
47
48
  (e) => e.label.toLowerCase().includes(d.toLowerCase())
48
- ) : s, [s, d]), x = n.useMemo(() => t ? a.length >= t : !1, [a, t]);
49
- return /* @__PURE__ */ r(T.Provider, { value: { size: f, id: m }, children: /* @__PURE__ */ l("div", { className: "space-y-1.5", children: [
50
- p && /* @__PURE__ */ r(B, { htmlFor: m, className: z, children: p }),
49
+ ) : s, [s, d]), N = n.useMemo(() => t ? a.length >= t : !1, [a, t]);
50
+ return /* @__PURE__ */ r(U.Provider, { value: { size: p, id: m }, children: /* @__PURE__ */ l("div", { className: "space-y-1.5", children: [
51
+ h && /* @__PURE__ */ r(F, { htmlFor: m, className: M, children: h }),
51
52
  /* @__PURE__ */ l(
52
53
  "div",
53
54
  {
54
- ref: g,
55
+ ref: v,
55
56
  className: "relative w-full",
56
57
  "data-slot": "app-multiple-select-dropdown",
57
58
  children: [
58
59
  /* @__PURE__ */ l(
59
- C,
60
+ y,
60
61
  {
61
62
  id: m,
62
63
  type: "button",
63
64
  variant: "outline",
64
65
  role: "combobox",
65
66
  "aria-expanded": u,
66
- disabled: k,
67
- className: N(
67
+ disabled: z,
68
+ className: C(
68
69
  "!bg-d-input relative w-full justify-between border font-normal",
69
70
  "border-d-input ring-offset-background focus:ring-ring flex items-center rounded-md border whitespace-nowrap shadow-sm focus:ring-1 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",
70
71
  "aria-invalid:ring-d-destructive/20 dark:aria-invalid:ring-d-destructive/40 aria-invalid:border-d-destructive",
71
- j
72
+ P
72
73
  ),
73
- onClick: () => h(!u),
74
+ onClick: () => b(!u),
74
75
  children: [
75
- /* @__PURE__ */ r("div", { className: "flex w-full items-center gap-2 overflow-hidden", children: c.length > 0 ? /* @__PURE__ */ l(A, { children: [
76
+ /* @__PURE__ */ r("div", { className: "flex w-full items-center gap-2 overflow-hidden", children: c.length > 0 ? /* @__PURE__ */ l(B, { children: [
76
77
  /* @__PURE__ */ l(
77
- F,
78
+ E,
78
79
  {
79
80
  variant: "secondary",
80
81
  className: "flex items-center gap-1",
@@ -89,74 +90,74 @@ function oe({
89
90
  {
90
91
  className: "hover:bg-d-secondary flex h-5 w-5 items-center justify-center gap-1 rounded-full p-0",
91
92
  onClick: (e) => {
92
- e.stopPropagation(), e.preventDefault(), w();
93
+ e.stopPropagation(), e.preventDefault(), x();
93
94
  },
94
95
  children: [
95
- /* @__PURE__ */ r(K, { className: "h-3 w-3" }),
96
- /* @__PURE__ */ r("span", { className: "sr-only", children: L })
96
+ /* @__PURE__ */ r(Q, { className: "h-3 w-3" }),
97
+ /* @__PURE__ */ r("span", { className: "sr-only", children: R })
97
98
  ]
98
99
  }
99
100
  )
100
- ] }) : /* @__PURE__ */ r("span", { className: "text-d-muted-foreground", children: y }) }),
101
- /* @__PURE__ */ r(Q, { className: "ml-1 h-4 w-4 shrink-0 opacity-50" })
101
+ ] }) : /* @__PURE__ */ r("span", { className: "text-d-muted-foreground", children: k }) }),
102
+ /* @__PURE__ */ r(T, { className: "ml-1 h-4 w-4 shrink-0 opacity-50" })
102
103
  ]
103
104
  }
104
105
  ),
105
106
  /* @__PURE__ */ r(
106
- J,
107
+ K,
107
108
  {
108
109
  open: u,
109
- triggerRef: g,
110
- onClose: () => h(!1),
111
- children: /* @__PURE__ */ r("div", { children: /* @__PURE__ */ l(E, { className: "bg-d-popover border-d-border w-full rounded-md border shadow-md", children: [
112
- D && /* @__PURE__ */ l("div", { className: "border-d-border flex items-center justify-between border-b px-3", children: [
110
+ triggerRef: v,
111
+ onClose: () => b(!1),
112
+ children: /* @__PURE__ */ r("div", { children: /* @__PURE__ */ l(G, { className: "bg-d-popover border-d-border w-full rounded-md border shadow-md", children: [
113
+ L && /* @__PURE__ */ l("div", { className: "border-d-border flex items-center justify-between border-b px-3", children: [
113
114
  /* @__PURE__ */ l("div", { className: "flex items-center", children: [
114
- /* @__PURE__ */ r(I, { name: "Search", className: "text-d-accent", size: "sm" }),
115
+ /* @__PURE__ */ r(J, { name: "Search", className: "text-d-accent", size: "sm" }),
115
116
  /* @__PURE__ */ r(
116
117
  "input",
117
118
  {
118
119
  id: "app-multiple-select-dropdown-filter",
119
- placeholder: P,
120
+ placeholder: D,
120
121
  value: d,
121
- onChange: (e) => b(e.target.value),
122
- className: `focus-visible:ring-none border-none focus-visible:border-none disabled:opacity-50 ${q({ size: f })} !shadow-none`
122
+ onChange: (e) => g(e.target.value),
123
+ className: `focus-visible:ring-none border-none focus-visible:border-none disabled:opacity-50 ${H({ size: p })} !shadow-none`
123
124
  }
124
125
  )
125
126
  ] }),
126
127
  c.length > 0 && /* @__PURE__ */ r(
127
- C,
128
+ y,
128
129
  {
129
130
  variant: "ghost",
130
131
  size: "sm",
131
132
  className: "h-6 px-2 text-xs",
132
- onClick: w,
133
- children: R
133
+ onClick: x,
134
+ children: S
134
135
  }
135
136
  )
136
137
  ] }),
137
- /* @__PURE__ */ l(G, { className: "max-h-60 w-full overflow-auto", children: [
138
- /* @__PURE__ */ r(V, { children: M }),
139
- /* @__PURE__ */ r(X, { children: S.map((e) => {
138
+ /* @__PURE__ */ l(V, { className: "max-h-60 w-full overflow-auto", children: [
139
+ /* @__PURE__ */ r(X, { children: j }),
140
+ /* @__PURE__ */ r($, { children: O.map((e) => {
140
141
  const i = a.includes(e.value);
141
142
  return /* @__PURE__ */ l(
142
- $,
143
+ q,
143
144
  {
144
145
  value: e.value,
145
- disabled: e.disabled || !i && x,
146
- onSelect: () => v(e.value),
147
- className: N(
146
+ disabled: e.disabled || !i && N,
147
+ onSelect: () => w(e.value),
148
+ className: C(
148
149
  "aria-selected:bg-d-accent aria-selected:text-d-accent-foreground flex cursor-pointer items-center gap-2 px-2 py-1.5",
149
- (e.disabled || !i && x) && "cursor-not-allowed opacity-50"
150
+ (e.disabled || !i && N) && "cursor-not-allowed opacity-50"
150
151
  ),
151
- onPointerDown: (O) => O.stopPropagation(),
152
+ onPointerDown: (A) => A.stopPropagation(),
152
153
  children: [
153
154
  /* @__PURE__ */ r(
154
- H,
155
+ I,
155
156
  {
156
157
  checked: i,
157
158
  className: "mr-2 flex-shrink-0",
158
159
  onCheckedChange: () => {
159
- console.log("checkbox change for:", e.value), v(e.value);
160
+ console.log("checkbox change for:", e.value), w(e.value);
160
161
  }
161
162
  }
162
163
  ),
@@ -176,5 +177,5 @@ function oe({
176
177
  ] }) });
177
178
  }
178
179
  export {
179
- oe as AppMultipleSelectDropdown
180
+ ie as AppMultipleSelectDropdown
180
181
  };
package/dist/index.d.ts CHANGED
@@ -142,7 +142,7 @@ declare interface AppEditorProps {
142
142
 
143
143
  declare type AppEditorToolbar = "block-format" | "font-format" | "history";
144
144
 
145
- export declare function AppMultipleSelectDropdown({ options, value, onChange, placeholder, disabled, size, label, labelClassName, emptyMessage, className, filterPlaceholder, filterable, cancelLabel, cancelButtonLabel, maxSelectedItems, }: MultipleSelectDropdownProps): JSX.Element;
145
+ export declare function AppMultipleSelectDropdown({ options, value, onChange, onClear, placeholder, disabled, size, label, labelClassName, emptyMessage, className, filterPlaceholder, filterable, cancelLabel, cancelButtonLabel, maxSelectedItems, }: MultipleSelectDropdownProps): JSX.Element;
146
146
 
147
147
  export declare interface AppMultipleSelectOption {
148
148
  value: string;
@@ -1143,6 +1143,7 @@ declare interface MultipleSelectDropdownProps {
1143
1143
  options: AppMultipleSelectOption[];
1144
1144
  value: string[];
1145
1145
  onChange: (value: string[]) => void;
1146
+ onClear?: () => void;
1146
1147
  placeholder?: string;
1147
1148
  disabled?: boolean;
1148
1149
  size?: MultipleSelectSizeType;
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { s as e } from "../../../../_virtual/index7.js";
2
+ import { s as e } from "../../../../_virtual/index.js";
3
3
  function s() {
4
4
  return e.useSyncExternalStore(
5
5
  r,
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import e from "../../_virtual/index.js";
2
+ import e from "../../_virtual/index5.js";
3
3
  export {
4
4
  e as EventEmitter,
5
5
  e as default
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { __module as x } from "../../_virtual/index5.js";
2
+ import { __module as x } from "../../_virtual/index7.js";
3
3
  var w;
4
4
  function O() {
5
5
  return w ? x.exports : (w = 1, function(d) {
@@ -3,7 +3,7 @@ import { stringify as w } from "../../comma-separated-tokens/index.js";
3
3
  import { ok as u } from "../../devlop/lib/default.js";
4
4
  import { svg as m, html as C } from "../../property-information/index.js";
5
5
  import { stringify as N } from "../../space-separated-tokens/index.js";
6
- import S from "../../../_virtual/index2.js";
6
+ import S from "../../../_virtual/index3.js";
7
7
  import { whitespace as j } from "../../hast-util-whitespace/lib/index.js";
8
8
  import { name as x } from "../../estree-util-is-identifier-name/lib/index.js";
9
9
  import { VFileMessage as h } from "../../vfile-message/lib/index.js";
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import e from "../../../../_virtual/index.js";
2
+ import e from "../../../../_virtual/index5.js";
3
3
  var r = new e(), n = "recharts.syncEvent.tooltip";
4
4
  export {
5
5
  n as TOOLTIP_SYNC_EVENT,
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { bail as P } from "../../bail/index.js";
3
- import y from "../../../_virtual/index3.js";
3
+ import y from "../../../_virtual/index4.js";
4
4
  import z from "../../is-plain-obj/index.js";
5
5
  import { CallableInstance as C } from "./callable-instance.js";
6
6
  import { trough as A } from "../../trough/lib/index.js";
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { __module as e } from "../../../_virtual/index4.js";
2
+ import { __module as e } from "../../../_virtual/index2.js";
3
3
  import { __require as i } from "../cjs/use-sync-external-store-shim.production.js";
4
4
  import { __require as o } from "../cjs/use-sync-external-store-shim.development.js";
5
5
  var r;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "laif-ds",
3
3
  "private": false,
4
- "version": "0.1.80",
4
+ "version": "0.1.81",
5
5
  "type": "module",
6
6
  "main": "dist/index.es.js",
7
7
  "module": "dist/index.es.js",