laif-ds 0.1.89 → 0.1.91
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/index2.js +2 -5
- package/dist/_virtual/index3.js +5 -2
- package/dist/_virtual/index6.js +2 -2
- package/dist/_virtual/index7.js +2 -2
- package/dist/components/ui/app-multiple-select-dropdown.js +69 -68
- package/dist/components/ui/async-select.js +41 -39
- package/dist/components/ui/button.js +13 -13
- package/dist/components/ui/data-table.js +1 -1
- package/dist/components/ui/input.js +12 -12
- package/dist/components/ui/multiple-selector.js +24 -24
- package/dist/components/ui/select.js +23 -23
- package/dist/components/ui/textarea.js +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/node_modules/eventemitter3/index.js +1 -1
- package/dist/node_modules/eventemitter3/index2.js +1 -1
- package/dist/node_modules/recharts/es6/util/Events.js +1 -1
- package/dist/node_modules/style-to-object/cjs/index.js +1 -1
- package/dist/node_modules/use-sync-external-store/shim/index.js +1 -1
- package/dist/styles.v3.css +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as r, jsxs as L, Fragment as G } from "react/jsx-runtime";
|
|
3
|
-
import { Command as
|
|
3
|
+
import { Command as ue, useCommandState as ce } from "../../node_modules/cmdk/dist/index.js";
|
|
4
4
|
import * as o from "react";
|
|
5
5
|
import { useEffect as C, forwardRef as fe } from "react";
|
|
6
6
|
import { Popover as me, PopoverTrigger as ge, PopoverContent as he } from "./popover.js";
|
|
@@ -11,11 +11,11 @@ import { Label as we } from "./label.js";
|
|
|
11
11
|
import { Icon as xe } from "./icon.js";
|
|
12
12
|
import Ne from "../../node_modules/lucide-react/dist/esm/icons/x.js";
|
|
13
13
|
function ye(s, l) {
|
|
14
|
-
const [i,
|
|
14
|
+
const [i, u] = o.useState(s);
|
|
15
15
|
return C(() => {
|
|
16
|
-
const
|
|
16
|
+
const a = setTimeout(() => u(s), l);
|
|
17
17
|
return () => {
|
|
18
|
-
clearTimeout(
|
|
18
|
+
clearTimeout(a);
|
|
19
19
|
};
|
|
20
20
|
}, [s, l]), i;
|
|
21
21
|
}
|
|
@@ -27,26 +27,26 @@ function T(s, l) {
|
|
|
27
27
|
"": s
|
|
28
28
|
};
|
|
29
29
|
const i = {};
|
|
30
|
-
return s.forEach((
|
|
31
|
-
const
|
|
32
|
-
i[
|
|
30
|
+
return s.forEach((u) => {
|
|
31
|
+
const a = u[l] || "";
|
|
32
|
+
i[a] || (i[a] = []), i[a].push(u);
|
|
33
33
|
}), i;
|
|
34
34
|
}
|
|
35
35
|
function Ce(s, l) {
|
|
36
36
|
const i = JSON.parse(JSON.stringify(s));
|
|
37
|
-
for (const [
|
|
38
|
-
i[
|
|
37
|
+
for (const [u, a] of Object.entries(i))
|
|
38
|
+
i[u] = a.filter(
|
|
39
39
|
(V) => !l.find((c) => c.value === V.value)
|
|
40
40
|
);
|
|
41
41
|
return i;
|
|
42
42
|
}
|
|
43
43
|
function Ee(s, l) {
|
|
44
44
|
for (const [, i] of Object.entries(s))
|
|
45
|
-
if (i.some((
|
|
45
|
+
if (i.some((u) => l.find((a) => a.value === u.value)))
|
|
46
46
|
return !0;
|
|
47
47
|
return !1;
|
|
48
48
|
}
|
|
49
|
-
const Q = fe(({ className: s, ...l }, i) => ce((
|
|
49
|
+
const Q = fe(({ className: s, ...l }, i) => ce((a) => a.filtered.count === 0) ? /* @__PURE__ */ r(
|
|
50
50
|
"div",
|
|
51
51
|
{
|
|
52
52
|
ref: i,
|
|
@@ -62,8 +62,8 @@ const Oe = o.forwardRef(
|
|
|
62
62
|
value: s,
|
|
63
63
|
onChange: l,
|
|
64
64
|
placeholder: i,
|
|
65
|
-
defaultOptions:
|
|
66
|
-
options:
|
|
65
|
+
defaultOptions: u = [],
|
|
66
|
+
options: a,
|
|
67
67
|
delay: V,
|
|
68
68
|
onSearch: c,
|
|
69
69
|
onSearchSync: X,
|
|
@@ -87,7 +87,7 @@ const Oe = o.forwardRef(
|
|
|
87
87
|
const g = o.useRef(null), [f, S] = o.useState(!1), [ne, z] = o.useState(!1), [H, $] = o.useState(!1), [re, oe] = o.useState(
|
|
88
88
|
void 0
|
|
89
89
|
), j = o.useRef(null), F = o.useRef(null), [t, y] = o.useState(s || []), [b, J] = o.useState(
|
|
90
|
-
T(
|
|
90
|
+
T(u, v)
|
|
91
91
|
), [h, K] = o.useState(""), w = ye(h, V || 500);
|
|
92
92
|
o.useImperativeHandle(
|
|
93
93
|
te,
|
|
@@ -122,11 +122,11 @@ const Oe = o.forwardRef(
|
|
|
122
122
|
}, [f, x]), C(() => {
|
|
123
123
|
s && y(s);
|
|
124
124
|
}, [s]), C(() => {
|
|
125
|
-
if (!
|
|
125
|
+
if (!a || c)
|
|
126
126
|
return;
|
|
127
|
-
const e = T(
|
|
127
|
+
const e = T(a || [], v);
|
|
128
128
|
JSON.stringify(e) !== JSON.stringify(b) && J(e);
|
|
129
|
-
}, [
|
|
129
|
+
}, [u, a, v, c, b]), C(() => {
|
|
130
130
|
const e = () => {
|
|
131
131
|
const d = X?.(w);
|
|
132
132
|
J(T(d || [], v));
|
|
@@ -180,14 +180,14 @@ const Oe = o.forwardRef(
|
|
|
180
180
|
}, [E, D, c, b]), de = o.useMemo(
|
|
181
181
|
() => Ce(b, t),
|
|
182
182
|
[b, t]
|
|
183
|
-
),
|
|
183
|
+
), ae = o.useCallback(() => {
|
|
184
184
|
if (m?.filter)
|
|
185
185
|
return m.filter;
|
|
186
186
|
if (E)
|
|
187
187
|
return (e, n) => e.toLowerCase().includes(n.toLowerCase()) ? 1 : -1;
|
|
188
188
|
}, [E, m?.filter]);
|
|
189
189
|
return /* @__PURE__ */ L("div", { className: "flex flex-col space-y-1.5", children: [
|
|
190
|
-
W && /* @__PURE__ */ r(we, { children: W }),
|
|
190
|
+
W && /* @__PURE__ */ r(we, { className: "w-fit", children: W }),
|
|
191
191
|
/* @__PURE__ */ r(
|
|
192
192
|
q,
|
|
193
193
|
{
|
|
@@ -197,18 +197,18 @@ const Oe = o.forwardRef(
|
|
|
197
197
|
se(e), m?.onKeyDown?.(e);
|
|
198
198
|
},
|
|
199
199
|
className: p(
|
|
200
|
-
"bg-d-input border-d-border h-auto overflow-visible
|
|
200
|
+
"bg-d-input border-d-border h-auto overflow-visible",
|
|
201
201
|
m?.className
|
|
202
202
|
),
|
|
203
203
|
shouldFilter: m?.shouldFilter !== void 0 ? m.shouldFilter : !c,
|
|
204
|
-
filter:
|
|
204
|
+
filter: ae(),
|
|
205
205
|
children: /* @__PURE__ */ L(me, { open: f, onOpenChange: S, children: [
|
|
206
206
|
/* @__PURE__ */ r(ge, { asChild: !0, children: /* @__PURE__ */ r(
|
|
207
207
|
"div",
|
|
208
208
|
{
|
|
209
209
|
ref: F,
|
|
210
210
|
className: p(
|
|
211
|
-
"border-d-
|
|
211
|
+
"border-d-border/50 ring-offset-d-background min-h-10 rounded-md border text-base md:text-sm",
|
|
212
212
|
"focus-within:outline-none",
|
|
213
213
|
"focus-visible-within:ring-d-ring focus-visible-within:ring-1",
|
|
214
214
|
f && "ring-d-ring ring-1",
|
|
@@ -255,7 +255,7 @@ const Oe = o.forwardRef(
|
|
|
255
255
|
e.value
|
|
256
256
|
)),
|
|
257
257
|
/* @__PURE__ */ r(
|
|
258
|
-
|
|
258
|
+
ue.Input,
|
|
259
259
|
{
|
|
260
260
|
...O,
|
|
261
261
|
ref: g,
|
|
@@ -309,7 +309,7 @@ const Oe = o.forwardRef(
|
|
|
309
309
|
/* @__PURE__ */ r(
|
|
310
310
|
he,
|
|
311
311
|
{
|
|
312
|
-
className: "border-none p-0 shadow-
|
|
312
|
+
className: "border-none p-0 shadow-sm",
|
|
313
313
|
style: { width: re },
|
|
314
314
|
onWheel: (e) => e.stopPropagation(),
|
|
315
315
|
children: /* @__PURE__ */ r(q, { shouldFilter: !1, className: "w-full", children: /* @__PURE__ */ r(
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as i, jsx as e } from "react/jsx-runtime";
|
|
3
3
|
import * as c from "react";
|
|
4
|
-
import { Root as p, Group as f, Value as g, Trigger as x, Icon as h, Portal as v, Content as b, Viewport as y, Label as S, Item as
|
|
5
|
-
import { cn as
|
|
4
|
+
import { Root as p, Group as f, Value as g, Trigger as x, Icon as h, Portal as v, Content as b, Viewport as y, Label as S, Item as z, ItemIndicator as w, ItemText as N, Separator as C, ScrollUpButton as I, ScrollDownButton as _ } from "../../node_modules/@radix-ui/react-select/dist/index.js";
|
|
5
|
+
import { cn as s } from "../../lib/utils.js";
|
|
6
6
|
import { Label as j } from "./label.js";
|
|
7
7
|
import u from "../../node_modules/lucide-react/dist/esm/icons/chevron-down.js";
|
|
8
8
|
import k from "../../node_modules/lucide-react/dist/esm/icons/check.js";
|
|
@@ -10,12 +10,12 @@ import B from "../../node_modules/lucide-react/dist/esm/icons/chevron-up.js";
|
|
|
10
10
|
function q({
|
|
11
11
|
size: t = "default",
|
|
12
12
|
label: a,
|
|
13
|
-
className:
|
|
13
|
+
className: r,
|
|
14
14
|
labelClassName: o,
|
|
15
15
|
...d
|
|
16
16
|
}) {
|
|
17
17
|
const n = c.useId();
|
|
18
|
-
return /* @__PURE__ */ i("div", { className:
|
|
18
|
+
return /* @__PURE__ */ i("div", { className: s("space-y-1.5", r), children: [
|
|
19
19
|
a && /* @__PURE__ */ e(j, { htmlFor: n, className: o, children: a }),
|
|
20
20
|
/* @__PURE__ */ e(m.Provider, { value: { size: t, id: n }, children: /* @__PURE__ */ e(p, { "data-slot": "select", ...d }) })
|
|
21
21
|
] });
|
|
@@ -34,7 +34,7 @@ function E({
|
|
|
34
34
|
function H({
|
|
35
35
|
className: t,
|
|
36
36
|
size: a,
|
|
37
|
-
children:
|
|
37
|
+
children: r,
|
|
38
38
|
...o
|
|
39
39
|
}) {
|
|
40
40
|
const { size: d, id: n } = L(), l = a || d;
|
|
@@ -44,8 +44,8 @@ function H({
|
|
|
44
44
|
id: n,
|
|
45
45
|
"data-slot": "select-trigger",
|
|
46
46
|
"data-size": l,
|
|
47
|
-
className:
|
|
48
|
-
"border-d-
|
|
47
|
+
className: s(
|
|
48
|
+
"border-d-border/50 ring-offset-background data-[placeholder]:text-d-muted-foreground bg-d-input flex items-center justify-between rounded-md border px-3 py-2 whitespace-nowrap focus:outline-none disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
|
|
49
49
|
"focus-visible:ring-d-ring focus-visible:ring-1",
|
|
50
50
|
// Ring solo con tastiera
|
|
51
51
|
"data-[state=open]:ring-d-ring data-[state=open]:ring-1",
|
|
@@ -61,7 +61,7 @@ function H({
|
|
|
61
61
|
),
|
|
62
62
|
...o,
|
|
63
63
|
children: [
|
|
64
|
-
|
|
64
|
+
r,
|
|
65
65
|
/* @__PURE__ */ e(h, { asChild: !0, children: /* @__PURE__ */ e(u, { className: "size-4 opacity-50" }) })
|
|
66
66
|
]
|
|
67
67
|
}
|
|
@@ -70,28 +70,28 @@ function H({
|
|
|
70
70
|
function J({
|
|
71
71
|
className: t,
|
|
72
72
|
children: a,
|
|
73
|
-
position:
|
|
73
|
+
position: r = "popper",
|
|
74
74
|
...o
|
|
75
75
|
}) {
|
|
76
76
|
return /* @__PURE__ */ e(v, { children: /* @__PURE__ */ i(
|
|
77
77
|
b,
|
|
78
78
|
{
|
|
79
79
|
"data-slot": "select-content",
|
|
80
|
-
className:
|
|
80
|
+
className: s(
|
|
81
81
|
"bg-d-popover text-d-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 border-d-border relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",
|
|
82
|
-
|
|
82
|
+
r === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
83
83
|
t
|
|
84
84
|
),
|
|
85
|
-
position:
|
|
85
|
+
position: r,
|
|
86
86
|
...o,
|
|
87
87
|
children: [
|
|
88
88
|
/* @__PURE__ */ e(D, {}),
|
|
89
89
|
/* @__PURE__ */ e(
|
|
90
90
|
y,
|
|
91
91
|
{
|
|
92
|
-
className:
|
|
92
|
+
className: s(
|
|
93
93
|
"p-1",
|
|
94
|
-
|
|
94
|
+
r === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"
|
|
95
95
|
),
|
|
96
96
|
children: a
|
|
97
97
|
}
|
|
@@ -109,7 +109,7 @@ function K({
|
|
|
109
109
|
S,
|
|
110
110
|
{
|
|
111
111
|
"data-slot": "select-label",
|
|
112
|
-
className:
|
|
112
|
+
className: s(
|
|
113
113
|
"text-d-secondary-foreground px-2 py-1.5 text-xs",
|
|
114
114
|
t
|
|
115
115
|
),
|
|
@@ -120,19 +120,19 @@ function K({
|
|
|
120
120
|
function M({
|
|
121
121
|
className: t,
|
|
122
122
|
children: a,
|
|
123
|
-
...
|
|
123
|
+
...r
|
|
124
124
|
}) {
|
|
125
125
|
return /* @__PURE__ */ i(
|
|
126
|
-
|
|
126
|
+
z,
|
|
127
127
|
{
|
|
128
128
|
"data-slot": "select-item",
|
|
129
|
-
className:
|
|
129
|
+
className: s(
|
|
130
130
|
"focus:bg-d-accent focus:text-d-accent-foreground [&_svg:not([class*='text-'])]:text-d-secondary-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
|
|
131
131
|
t
|
|
132
132
|
),
|
|
133
|
-
...
|
|
133
|
+
...r,
|
|
134
134
|
children: [
|
|
135
|
-
/* @__PURE__ */ e("span", { className: "absolute right-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ e(
|
|
135
|
+
/* @__PURE__ */ e("span", { className: "absolute right-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ e(w, { children: /* @__PURE__ */ e(k, { className: "size-4" }) }) }),
|
|
136
136
|
/* @__PURE__ */ e(N, { children: a })
|
|
137
137
|
]
|
|
138
138
|
}
|
|
@@ -146,7 +146,7 @@ function O({
|
|
|
146
146
|
C,
|
|
147
147
|
{
|
|
148
148
|
"data-slot": "select-separator",
|
|
149
|
-
className:
|
|
149
|
+
className: s(
|
|
150
150
|
"bg-d-border pointer-events-none -mx-1 my-1 h-px",
|
|
151
151
|
t
|
|
152
152
|
),
|
|
@@ -162,7 +162,7 @@ function D({
|
|
|
162
162
|
I,
|
|
163
163
|
{
|
|
164
164
|
"data-slot": "select-scroll-up-button",
|
|
165
|
-
className:
|
|
165
|
+
className: s(
|
|
166
166
|
"flex cursor-default items-center justify-center py-1",
|
|
167
167
|
t
|
|
168
168
|
),
|
|
@@ -179,7 +179,7 @@ function R({
|
|
|
179
179
|
_,
|
|
180
180
|
{
|
|
181
181
|
"data-slot": "select-scroll-down-button",
|
|
182
|
-
className:
|
|
182
|
+
className: s(
|
|
183
183
|
"flex cursor-default items-center justify-center py-1",
|
|
184
184
|
t
|
|
185
185
|
),
|
|
@@ -7,7 +7,7 @@ function o({ className: r, ...e }) {
|
|
|
7
7
|
{
|
|
8
8
|
"data-slot": "textarea",
|
|
9
9
|
className: d(
|
|
10
|
-
"border-d-input placeholder:text-d-secondary-foreground focus-visible:border-d-ring focus-visible:ring-d-ring/50 aria-invalid:ring-d-destructive/20 dark:aria-invalid:ring-d-destructive/40 aria-invalid:border-d-destructive dark:bg-d-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none
|
|
10
|
+
"border-d-input placeholder:text-d-secondary-foreground focus-visible:border-d-ring focus-visible:ring-d-ring/50 aria-invalid:ring-d-destructive/20 dark:aria-invalid:ring-d-destructive/40 aria-invalid:border-d-destructive dark:bg-d-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
|
|
11
11
|
r
|
|
12
12
|
),
|
|
13
13
|
...e
|
package/dist/index.d.ts
CHANGED
|
@@ -191,7 +191,7 @@ declare type AspectRatioProps = React.ComponentProps<typeof AspectRatioPrimitive
|
|
|
191
191
|
|
|
192
192
|
export declare function AsyncSelect<T>({ fetcher, preload, filterFn, renderOption, getOptionValue, getDisplayValue, notFound, loadingSkeleton, label, labelClassName, placeholder, value, onChange, disabled, width, triggerClassName, noResultsMessage, clearable, size, }: AsyncSelectProps<T>): JSX.Element;
|
|
193
193
|
|
|
194
|
-
declare interface AsyncSelectProps<T> extends VariantProps<typeof
|
|
194
|
+
declare interface AsyncSelectProps<T> extends VariantProps<typeof selectTriggerVariants> {
|
|
195
195
|
fetcher: (query?: string) => Promise<T[]>;
|
|
196
196
|
preload?: boolean;
|
|
197
197
|
filterFn?: (option: T, query: string) => boolean;
|
|
@@ -212,10 +212,6 @@ declare interface AsyncSelectProps<T> extends VariantProps<typeof asyncSelectTri
|
|
|
212
212
|
clearable?: boolean;
|
|
213
213
|
}
|
|
214
214
|
|
|
215
|
-
declare const asyncSelectTriggerVariants: (props?: ({
|
|
216
|
-
size?: "default" | "sm" | "lg" | null | undefined;
|
|
217
|
-
} & ClassProp) | undefined) => string;
|
|
218
|
-
|
|
219
215
|
declare interface Attachment {
|
|
220
216
|
name?: string;
|
|
221
217
|
contentType?: string;
|
|
@@ -1467,6 +1463,10 @@ export declare function SelectTrigger({ className, size: sizeProp, children, ...
|
|
|
1467
1463
|
size?: SelectSizeType;
|
|
1468
1464
|
}): JSX.Element;
|
|
1469
1465
|
|
|
1466
|
+
declare const selectTriggerVariants: (props?: ({
|
|
1467
|
+
size?: "default" | "sm" | "lg" | null | undefined;
|
|
1468
|
+
} & ClassProp) | undefined) => string;
|
|
1469
|
+
|
|
1470
1470
|
export declare function SelectValue({ ...props }: React_2.ComponentProps<typeof SelectPrimitive.Value>): JSX.Element;
|
|
1471
1471
|
|
|
1472
1472
|
export declare function Separator({ className, orientation, decorative, ...props }: React_2.ComponentProps<typeof SeparatorPrimitive.Root>): JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { __module as e } from "../../../_virtual/
|
|
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;
|