laif-ds 0.1.91 → 0.1.92
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/index3.js +5 -5
- package/dist/_virtual/index5.js +5 -5
- package/dist/components/ui/async-select.js +179 -173
- package/dist/node_modules/eventemitter3/index.js +1 -1
- package/dist/node_modules/hast-util-to-jsx-runtime/lib/index.js +1 -1
- package/dist/node_modules/recharts/es6/util/Events.js +1 -1
- package/package.json +1 -1
package/dist/_virtual/index3.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { getDefaultExportFromCjs as
|
|
3
|
-
import { __require as
|
|
4
|
-
var
|
|
5
|
-
const
|
|
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
|
-
|
|
7
|
+
a as default
|
|
8
8
|
};
|
package/dist/_virtual/index5.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { getDefaultExportFromCjs as
|
|
3
|
-
import { __require as
|
|
4
|
-
var
|
|
5
|
-
const
|
|
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
|
-
|
|
7
|
+
m as default
|
|
8
8
|
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
2
|
+
import { jsxs as l, jsx as e } from "react/jsx-runtime";
|
|
3
3
|
import * as p from "react";
|
|
4
|
-
import { useState as
|
|
4
|
+
import { useState as i, useEffect as g, useCallback as B } from "react";
|
|
5
5
|
import { useDebounce as re } from "../../hooks/use-debounce.js";
|
|
6
|
-
import { cva as
|
|
7
|
-
import { cn as
|
|
8
|
-
import { Label as
|
|
9
|
-
import { Popover as
|
|
10
|
-
import { Command as de, CommandInput as fe, CommandList as me, CommandEmpty as ue, CommandGroup as
|
|
11
|
-
import { Icon as
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
const ge =
|
|
6
|
+
import { cva as le } from "../../node_modules/class-variance-authority/dist/index.js";
|
|
7
|
+
import { cn as x } from "../../lib/utils.js";
|
|
8
|
+
import { Label as oe } from "./label.js";
|
|
9
|
+
import { Popover as ie, PopoverTrigger as ae, PopoverContent as ce } from "./popover.js";
|
|
10
|
+
import { Command as de, CommandInput as fe, CommandList as me, CommandEmpty as ue, CommandGroup as M, CommandItem as U } from "./command.js";
|
|
11
|
+
import { Icon as G } from "./icon.js";
|
|
12
|
+
import he from "../../node_modules/lucide-react/dist/esm/icons/loader-circle.js";
|
|
13
|
+
import pe from "../../node_modules/lucide-react/dist/esm/icons/check.js";
|
|
14
|
+
const ge = le(
|
|
15
15
|
"flex items-center justify-between whitespace-nowrap rounded-md border border-d-input bg-d-input px-3 py-2 data-[placeholder]:text-muted-foreground focus:outline-none disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1 ",
|
|
16
16
|
{
|
|
17
17
|
variants: {
|
|
@@ -26,230 +26,236 @@ const ge = oe(
|
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
);
|
|
29
|
-
function
|
|
29
|
+
function Ie({
|
|
30
30
|
fetcher: c,
|
|
31
|
-
preload:
|
|
31
|
+
preload: m,
|
|
32
32
|
filterFn: S,
|
|
33
|
-
renderOption:
|
|
34
|
-
getOptionValue:
|
|
35
|
-
getDisplayValue:
|
|
36
|
-
notFound:
|
|
37
|
-
loadingSkeleton:
|
|
33
|
+
renderOption: P,
|
|
34
|
+
getOptionValue: a,
|
|
35
|
+
getDisplayValue: w,
|
|
36
|
+
notFound: X,
|
|
37
|
+
loadingSkeleton: q,
|
|
38
38
|
label: z,
|
|
39
|
-
labelClassName:
|
|
39
|
+
labelClassName: H,
|
|
40
40
|
placeholder: O = "Select...",
|
|
41
41
|
value: r = "",
|
|
42
|
-
onChange:
|
|
42
|
+
onChange: N,
|
|
43
43
|
disabled: W = !1,
|
|
44
|
-
width:
|
|
45
|
-
triggerClassName:
|
|
46
|
-
noResultsMessage:
|
|
44
|
+
width: u = "200px",
|
|
45
|
+
triggerClassName: J,
|
|
46
|
+
noResultsMessage: K,
|
|
47
47
|
clearable: L = !0,
|
|
48
|
-
size:
|
|
48
|
+
size: Q
|
|
49
49
|
}) {
|
|
50
|
-
const [
|
|
50
|
+
const [o, j] = i(!1), d = u === "auto", k = p.useRef(null), I = p.useRef(null), Y = p.useRef(null), Z = p.useRef(null), [v, y] = i(!1), [b, C] = i(null), [T, R] = i(null), [D, _] = i(""), h = re(D, m ? 0 : 300), [E, F] = i([]), [n, f] = i([]), [$, V] = i(
|
|
51
51
|
void 0
|
|
52
52
|
);
|
|
53
|
-
|
|
53
|
+
g(() => ((async () => {
|
|
54
54
|
try {
|
|
55
|
-
if (
|
|
55
|
+
if (y(!0), C(null), m) {
|
|
56
56
|
const s = await c("");
|
|
57
|
-
F(s),
|
|
57
|
+
F(s), f(s);
|
|
58
58
|
} else {
|
|
59
59
|
const s = await c(r);
|
|
60
|
-
|
|
60
|
+
f(s);
|
|
61
61
|
}
|
|
62
62
|
} catch (s) {
|
|
63
63
|
C(
|
|
64
64
|
s instanceof Error ? s.message : "Failed to fetch options"
|
|
65
65
|
);
|
|
66
66
|
} finally {
|
|
67
|
-
|
|
67
|
+
y(!1);
|
|
68
68
|
}
|
|
69
69
|
})(), () => {
|
|
70
|
-
|
|
71
|
-
}), [c, r,
|
|
72
|
-
if (
|
|
73
|
-
if (
|
|
74
|
-
if (
|
|
75
|
-
const t =
|
|
76
|
-
(s) => S ? S(s,
|
|
70
|
+
f([]), F([]);
|
|
71
|
+
}), [c, r, m]), g(() => {
|
|
72
|
+
if (o)
|
|
73
|
+
if (m)
|
|
74
|
+
if (h) {
|
|
75
|
+
const t = E.filter(
|
|
76
|
+
(s) => S ? S(s, h) : String(w(s)).toLowerCase().includes(h.toLowerCase())
|
|
77
77
|
);
|
|
78
|
-
|
|
78
|
+
f(t);
|
|
79
79
|
} else
|
|
80
|
-
|
|
80
|
+
f(E);
|
|
81
81
|
else
|
|
82
82
|
(async () => {
|
|
83
83
|
try {
|
|
84
|
-
|
|
85
|
-
const s = await c(
|
|
86
|
-
|
|
84
|
+
y(!0), C(null);
|
|
85
|
+
const s = await c(h);
|
|
86
|
+
f(s);
|
|
87
87
|
} catch (s) {
|
|
88
88
|
C(
|
|
89
89
|
s instanceof Error ? s.message : "Failed to fetch options"
|
|
90
90
|
);
|
|
91
91
|
} finally {
|
|
92
|
-
|
|
92
|
+
y(!1);
|
|
93
93
|
}
|
|
94
94
|
})();
|
|
95
95
|
}, [
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
96
|
+
o,
|
|
97
|
+
h,
|
|
98
|
+
m,
|
|
99
99
|
S,
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
]),
|
|
100
|
+
E,
|
|
101
|
+
w
|
|
102
|
+
]), g(() => {
|
|
103
103
|
if (r && n.length > 0) {
|
|
104
|
-
const t = n.find((s) =>
|
|
104
|
+
const t = n.find((s) => a(s) === r);
|
|
105
105
|
R(t || null);
|
|
106
106
|
} else r || R(null);
|
|
107
|
-
}, [r, n,
|
|
108
|
-
|
|
109
|
-
}, [
|
|
110
|
-
if (
|
|
111
|
-
const t =
|
|
112
|
-
|
|
107
|
+
}, [r, n, a]), g(() => {
|
|
108
|
+
o && k.current && k.current.focus();
|
|
109
|
+
}, [o]), g(() => {
|
|
110
|
+
if (o && I.current && d) {
|
|
111
|
+
const t = I.current.getBoundingClientRect();
|
|
112
|
+
V(t.width);
|
|
113
113
|
}
|
|
114
|
-
}, [
|
|
115
|
-
const
|
|
114
|
+
}, [o, d]);
|
|
115
|
+
const ee = B(
|
|
116
116
|
(t) => {
|
|
117
|
-
const s = L && t === r ? "" : t, se = n.find((ne) =>
|
|
118
|
-
R(se),
|
|
117
|
+
const s = L && t === r ? "" : t, se = n.find((ne) => a(ne) === s) || null;
|
|
118
|
+
R(se), N(s), j(!1);
|
|
119
119
|
},
|
|
120
|
-
[r,
|
|
121
|
-
),
|
|
120
|
+
[r, N, L, n, a]
|
|
121
|
+
), te = B(
|
|
122
122
|
(t) => {
|
|
123
|
-
t.stopPropagation(), t.preventDefault(), R(null),
|
|
123
|
+
t.stopPropagation(), t.preventDefault(), R(null), N(""), j(!1);
|
|
124
124
|
},
|
|
125
|
-
[
|
|
126
|
-
),
|
|
127
|
-
return /* @__PURE__ */
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
{
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
{
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
125
|
+
[N]
|
|
126
|
+
), A = p.useId();
|
|
127
|
+
return /* @__PURE__ */ l(
|
|
128
|
+
"div",
|
|
129
|
+
{
|
|
130
|
+
className: x("grid grid-cols-1 space-y-1.5", d && "w-full"),
|
|
131
|
+
children: [
|
|
132
|
+
z && /* @__PURE__ */ e(oe, { htmlFor: A, className: x(H, "w-fit"), children: z }),
|
|
133
|
+
/* @__PURE__ */ e("div", { ref: Y, className: "relative", "data-slot": "async-select", children: /* @__PURE__ */ l(ie, { open: o, onOpenChange: j, children: [
|
|
134
|
+
/* @__PURE__ */ e(ae, { asChild: !0, children: /* @__PURE__ */ e(
|
|
135
|
+
"button",
|
|
136
|
+
{
|
|
137
|
+
id: A,
|
|
138
|
+
ref: I,
|
|
139
|
+
type: "button",
|
|
140
|
+
disabled: W,
|
|
141
|
+
className: x(
|
|
142
|
+
ge({ size: Q }),
|
|
143
|
+
"!border-d-border/50 border !shadow-none",
|
|
144
|
+
W && "cursor-not-allowed opacity-50",
|
|
145
|
+
J,
|
|
146
|
+
"font-normal",
|
|
147
|
+
d && "w-full",
|
|
148
|
+
"focus-visible:ring-d-ring focus-visible:ring-1",
|
|
149
|
+
o && "ring-d-ring ring-1"
|
|
150
|
+
),
|
|
151
|
+
style: d ? void 0 : { width: u },
|
|
152
|
+
children: /* @__PURE__ */ l("div", { className: "flex w-full flex-1 items-center justify-between overflow-hidden", children: [
|
|
153
|
+
T ? /* @__PURE__ */ e("div", { className: "min-w-0 flex-1 truncate text-left", children: w(T) }) : /* @__PURE__ */ e("span", { className: "text-d-muted-foreground truncate text-left", children: O }),
|
|
154
|
+
/* @__PURE__ */ l("div", { className: "flex flex-shrink-0 items-center justify-end gap-1", children: [
|
|
155
|
+
L && T && /* @__PURE__ */ e(
|
|
156
|
+
"div",
|
|
157
|
+
{
|
|
158
|
+
className: "border-d-input bg-d-accent cursor-pointer rounded-full p-1",
|
|
159
|
+
onClick: te,
|
|
160
|
+
onMouseDown: (t) => t.preventDefault(),
|
|
161
|
+
"aria-label": "Clear selection",
|
|
162
|
+
children: /* @__PURE__ */ e(
|
|
163
|
+
G,
|
|
164
|
+
{
|
|
165
|
+
name: "X",
|
|
166
|
+
size: "xs",
|
|
167
|
+
className: "!text-d-foreground opacity-50"
|
|
168
|
+
}
|
|
169
|
+
)
|
|
170
|
+
}
|
|
171
|
+
),
|
|
172
|
+
/* @__PURE__ */ e(
|
|
173
|
+
G,
|
|
160
174
|
{
|
|
161
|
-
name: "
|
|
175
|
+
name: "ChevronsUpDown",
|
|
162
176
|
size: "xs",
|
|
163
177
|
className: "!text-d-foreground opacity-50"
|
|
164
178
|
}
|
|
165
179
|
)
|
|
166
|
-
}
|
|
167
|
-
)
|
|
168
|
-
|
|
169
|
-
|
|
180
|
+
] })
|
|
181
|
+
] })
|
|
182
|
+
}
|
|
183
|
+
) }),
|
|
184
|
+
/* @__PURE__ */ e(
|
|
185
|
+
ce,
|
|
186
|
+
{
|
|
187
|
+
className: x("p-0"),
|
|
188
|
+
style: {
|
|
189
|
+
width: d ? $ ? `${$}px` : void 0 : typeof u == "number" ? `${u}px` : u
|
|
190
|
+
},
|
|
191
|
+
align: "start",
|
|
192
|
+
side: "bottom",
|
|
193
|
+
sideOffset: 4,
|
|
194
|
+
onWheel: (t) => t.stopPropagation(),
|
|
195
|
+
avoidCollisions: !1,
|
|
196
|
+
children: /* @__PURE__ */ l(
|
|
197
|
+
de,
|
|
170
198
|
{
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
199
|
+
shouldFilter: !1,
|
|
200
|
+
className: "w-full border-none shadow-sm",
|
|
201
|
+
children: [
|
|
202
|
+
/* @__PURE__ */ e(
|
|
203
|
+
fe,
|
|
204
|
+
{
|
|
205
|
+
ref: k,
|
|
206
|
+
placeholder: O,
|
|
207
|
+
className: "placeholder:text-d-muted-foreground",
|
|
208
|
+
value: D,
|
|
209
|
+
onValueChange: _
|
|
210
|
+
}
|
|
211
|
+
),
|
|
212
|
+
v && n.length > 0 && /* @__PURE__ */ e("div", { className: "flex items-center justify-center p-2", children: /* @__PURE__ */ e(he, { className: "h-4 w-4 animate-spin" }) }),
|
|
213
|
+
/* @__PURE__ */ l(me, { ref: Z, children: [
|
|
214
|
+
b && /* @__PURE__ */ e("div", { className: "text-d-destructive p-3 text-center", children: b }),
|
|
215
|
+
v && n.length === 0 && (q || /* @__PURE__ */ e(xe, {})),
|
|
216
|
+
!v && !b && n.length === 0 && (X || /* @__PURE__ */ e(ue, { children: K || "No results found." })),
|
|
217
|
+
!v && !b && n.length > 0 && /* @__PURE__ */ e(M, { children: n.map((t) => /* @__PURE__ */ e(
|
|
218
|
+
U,
|
|
219
|
+
{
|
|
220
|
+
value: a(t),
|
|
221
|
+
onSelect: ee,
|
|
222
|
+
className: "cursor-pointer",
|
|
223
|
+
children: /* @__PURE__ */ l("div", { className: "flex w-full items-center justify-between overflow-hidden", children: [
|
|
224
|
+
/* @__PURE__ */ e("div", { className: "min-w-0 flex-1", children: P ? /* @__PURE__ */ e("div", { className: "truncate", children: P(t) }) : /* @__PURE__ */ e("span", { className: "truncate", children: w(t) }) }),
|
|
225
|
+
/* @__PURE__ */ e(
|
|
226
|
+
pe,
|
|
227
|
+
{
|
|
228
|
+
className: x(
|
|
229
|
+
"ml-2 h-4 w-4 flex-shrink-0",
|
|
230
|
+
r === a(t) ? "opacity-100" : "opacity-0"
|
|
231
|
+
)
|
|
232
|
+
}
|
|
233
|
+
)
|
|
234
|
+
] })
|
|
235
|
+
},
|
|
236
|
+
a(t)
|
|
237
|
+
)) })
|
|
238
|
+
] })
|
|
239
|
+
]
|
|
174
240
|
}
|
|
175
241
|
)
|
|
176
|
-
] })
|
|
177
|
-
] })
|
|
178
|
-
}
|
|
179
|
-
) }),
|
|
180
|
-
/* @__PURE__ */ e(
|
|
181
|
-
ce,
|
|
182
|
-
{
|
|
183
|
-
className: g("p-0"),
|
|
184
|
-
style: {
|
|
185
|
-
width: y ? Z : typeof m == "number" ? `${m}px` : m
|
|
186
|
-
},
|
|
187
|
-
align: "start",
|
|
188
|
-
side: "bottom",
|
|
189
|
-
sideOffset: 4,
|
|
190
|
-
onWheel: (t) => t.stopPropagation(),
|
|
191
|
-
avoidCollisions: !1,
|
|
192
|
-
children: /* @__PURE__ */ o(
|
|
193
|
-
de,
|
|
194
|
-
{
|
|
195
|
-
shouldFilter: !1,
|
|
196
|
-
className: "w-full border-none shadow-sm",
|
|
197
|
-
children: [
|
|
198
|
-
/* @__PURE__ */ e(
|
|
199
|
-
fe,
|
|
200
|
-
{
|
|
201
|
-
ref: I,
|
|
202
|
-
placeholder: O,
|
|
203
|
-
className: "placeholder:text-d-muted-foreground",
|
|
204
|
-
value: D,
|
|
205
|
-
onValueChange: Y
|
|
206
|
-
}
|
|
207
|
-
),
|
|
208
|
-
N && n.length > 0 && /* @__PURE__ */ e("div", { className: "flex items-center justify-center p-2", children: /* @__PURE__ */ e(pe, { className: "h-4 w-4 animate-spin" }) }),
|
|
209
|
-
/* @__PURE__ */ o(me, { ref: Q, children: [
|
|
210
|
-
v && /* @__PURE__ */ e("div", { className: "text-d-destructive p-3 text-center", children: v }),
|
|
211
|
-
N && n.length === 0 && (X || /* @__PURE__ */ e(xe, {})),
|
|
212
|
-
!N && !v && n.length === 0 && (U || /* @__PURE__ */ e(ue, { children: H || "No results found." })),
|
|
213
|
-
!N && !v && n.length > 0 && /* @__PURE__ */ e(G, { children: n.map((t) => /* @__PURE__ */ o(
|
|
214
|
-
M,
|
|
215
|
-
{
|
|
216
|
-
value: i(t),
|
|
217
|
-
onSelect: V,
|
|
218
|
-
className: "cursor-pointer",
|
|
219
|
-
children: [
|
|
220
|
-
k ? k(t) : /* @__PURE__ */ e("span", { children: x(t) }),
|
|
221
|
-
/* @__PURE__ */ e(
|
|
222
|
-
he,
|
|
223
|
-
{
|
|
224
|
-
className: g(
|
|
225
|
-
"ml-auto h-4 w-4",
|
|
226
|
-
r === i(t) ? "opacity-100" : "opacity-0"
|
|
227
|
-
)
|
|
228
|
-
}
|
|
229
|
-
)
|
|
230
|
-
]
|
|
231
|
-
},
|
|
232
|
-
i(t)
|
|
233
|
-
)) })
|
|
234
|
-
] })
|
|
235
|
-
]
|
|
236
242
|
}
|
|
237
243
|
)
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
244
|
+
] }) })
|
|
245
|
+
]
|
|
246
|
+
}
|
|
247
|
+
);
|
|
242
248
|
}
|
|
243
249
|
function xe() {
|
|
244
|
-
return /* @__PURE__ */ e(
|
|
250
|
+
return /* @__PURE__ */ e(M, { children: [1, 2, 3].map((c) => /* @__PURE__ */ e(U, { disabled: !0, children: /* @__PURE__ */ l("div", { className: "flex w-full items-center gap-2", children: [
|
|
245
251
|
/* @__PURE__ */ e("div", { className: "bg-d-secondary h-6 w-6 animate-pulse rounded-full" }),
|
|
246
|
-
/* @__PURE__ */
|
|
252
|
+
/* @__PURE__ */ l("div", { className: "flex flex-1 flex-col gap-1", children: [
|
|
247
253
|
/* @__PURE__ */ e("div", { className: "bg-d-secondary h-4 w-24 animate-pulse rounded" }),
|
|
248
254
|
/* @__PURE__ */ e("div", { className: "bg-d-secondary h-3 w-16 animate-pulse rounded" })
|
|
249
255
|
] })
|
|
250
256
|
] }) }, c)) });
|
|
251
257
|
}
|
|
252
258
|
export {
|
|
253
|
-
|
|
259
|
+
Ie as AsyncSelect,
|
|
254
260
|
ge as selectTriggerVariants
|
|
255
261
|
};
|
|
@@ -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/
|
|
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";
|