laif-ds 0.1.11 → 0.1.13
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/components/ui/accordion.js +16 -16
- package/dist/components/ui/alert-dialog.js +2 -2
- package/dist/components/ui/alert.js +5 -5
- package/dist/components/ui/async-select.js +39 -39
- package/dist/components/ui/audio-visualizer.js +7 -7
- package/dist/components/ui/avatar.js +3 -3
- package/dist/components/ui/badge.js +12 -12
- package/dist/components/ui/breadcrumb.js +1 -1
- package/dist/components/ui/button.js +31 -28
- package/dist/components/ui/calendar.js +23 -23
- package/dist/components/ui/card.js +6 -6
- package/dist/components/ui/chart.js +40 -40
- package/dist/components/ui/chat-message.js +59 -59
- package/dist/components/ui/checkbox.js +7 -7
- package/dist/components/ui/command.js +35 -35
- package/dist/components/ui/context-menu.js +16 -16
- package/dist/components/ui/data-table.js +2 -2
- package/dist/components/ui/date-picker.js +14 -14
- package/dist/components/ui/dialog.js +11 -11
- package/dist/components/ui/drawer.js +5 -5
- package/dist/components/ui/file-preview.js +14 -14
- package/dist/components/ui/form.js +18 -18
- package/dist/components/ui/gantt/components/Chart/Bars/BarsRow/BarsRow.js +6 -6
- package/dist/components/ui/gantt/components/Chart/Tree/Tree.js +9 -9
- package/dist/components/ui/hover-card.js +5 -5
- package/dist/components/ui/input-otp.js +5 -5
- package/dist/components/ui/input-selector.js +11 -11
- package/dist/components/ui/input.js +25 -25
- package/dist/components/ui/interrupt-prompt.js +1 -1
- package/dist/components/ui/markdown-renderer.js +19 -19
- package/dist/components/ui/menubar.js +16 -16
- package/dist/components/ui/message-input.js +29 -29
- package/dist/components/ui/multiple-selector.js +92 -92
- package/dist/components/ui/navigation-menu.js +13 -13
- package/dist/components/ui/popover.js +1 -1
- package/dist/components/ui/progress.js +4 -4
- package/dist/components/ui/prompt-suggestions.js +9 -9
- package/dist/components/ui/radio-group.js +5 -5
- package/dist/components/ui/resizable.js +2 -2
- package/dist/components/ui/scroll-area.js +7 -7
- package/dist/components/ui/select.js +10 -10
- package/dist/components/ui/separator.js +3 -3
- package/dist/components/ui/sheet.js +8 -8
- package/dist/components/ui/sidebar.js +134 -134
- package/dist/components/ui/skeleton.js +1 -1
- package/dist/components/ui/switch.js +5 -5
- package/dist/components/ui/table.js +3 -3
- package/dist/components/ui/tabs.js +2 -2
- package/dist/components/ui/textarea.js +7 -7
- package/dist/components/ui/toaster.js +12 -12
- package/dist/components/ui/toggle.js +2 -2
- package/dist/components/ui/tooltip.js +2 -2
- package/dist/components/ui/typing-indicator.js +8 -8
- package/dist/components/ui/typo.js +9 -9
- package/dist/dist/components/ui/checkbox.js +5 -5
- package/dist/dist/components/ui/scroll-area.js +2 -2
- package/dist/dist/components/ui/table.js +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/styles.css +1 -1
- package/dist/styles.v3.css +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
2
|
+
import { jsxs as d, jsx as e } from "react/jsx-runtime";
|
|
3
3
|
import { useState as y, useEffect as C, useRef as Y } from "react";
|
|
4
4
|
import { AnimatePresence as v, motion as x } from "framer-motion";
|
|
5
5
|
import { a as I } from "../../node_modules/remeda/dist/chunk-A3PVMI4K.js";
|
|
@@ -21,8 +21,8 @@ function ne({
|
|
|
21
21
|
className: l,
|
|
22
22
|
onKeyDown: o,
|
|
23
23
|
submitOnEnter: s = !0,
|
|
24
|
-
stop:
|
|
25
|
-
isGenerating:
|
|
24
|
+
stop: u,
|
|
25
|
+
isGenerating: m,
|
|
26
26
|
enableInterrupt: A = !0,
|
|
27
27
|
transcribeAudio: P,
|
|
28
28
|
...r
|
|
@@ -44,8 +44,8 @@ function ne({
|
|
|
44
44
|
}
|
|
45
45
|
});
|
|
46
46
|
C(() => {
|
|
47
|
-
|
|
48
|
-
}, [
|
|
47
|
+
m || h(!1);
|
|
48
|
+
}, [m]);
|
|
49
49
|
const g = (t) => {
|
|
50
50
|
r.allowAttachments && r.setFiles((i) => i === null ? t : t === null ? i : [...i, ...t]);
|
|
51
51
|
}, H = (t) => {
|
|
@@ -76,9 +76,9 @@ function ne({
|
|
|
76
76
|
}, W = (t) => {
|
|
77
77
|
var i, n, c;
|
|
78
78
|
if (s && t.key === "Enter" && !t.shiftKey) {
|
|
79
|
-
if (t.preventDefault(),
|
|
79
|
+
if (t.preventDefault(), m && u && A) {
|
|
80
80
|
if (N)
|
|
81
|
-
|
|
81
|
+
u(), h(!1), (i = t.currentTarget.form) == null || i.requestSubmit();
|
|
82
82
|
else if (r.value || r.allowAttachments && ((n = r.files) != null && n.length)) {
|
|
83
83
|
h(!0);
|
|
84
84
|
return;
|
|
@@ -97,7 +97,7 @@ function ne({
|
|
|
97
97
|
maxHeight: 240,
|
|
98
98
|
borderWidth: 1,
|
|
99
99
|
dependencies: [r.value, z]
|
|
100
|
-
}), /* @__PURE__ */
|
|
100
|
+
}), /* @__PURE__ */ d(
|
|
101
101
|
"div",
|
|
102
102
|
{
|
|
103
103
|
className: "relative flex w-full",
|
|
@@ -119,7 +119,7 @@ function ne({
|
|
|
119
119
|
onStopRecording: D
|
|
120
120
|
}
|
|
121
121
|
),
|
|
122
|
-
/* @__PURE__ */ e("div", { className: "relative flex w-full items-center space-x-2", children: /* @__PURE__ */
|
|
122
|
+
/* @__PURE__ */ e("div", { className: "relative flex w-full items-center space-x-2", children: /* @__PURE__ */ d("div", { className: "relative flex-1", children: [
|
|
123
123
|
/* @__PURE__ */ e(
|
|
124
124
|
"textarea",
|
|
125
125
|
{
|
|
@@ -129,7 +129,7 @@ function ne({
|
|
|
129
129
|
onPaste: B,
|
|
130
130
|
onKeyDown: W,
|
|
131
131
|
className: R(
|
|
132
|
-
"z-10 w-full grow resize-none rounded-xl border border-input bg-background p-3 pr-24 text-sm ring-offset-background transition-[border] placeholder:text-
|
|
132
|
+
"z-10 w-full grow resize-none rounded-xl border border-d-input bg-d-background p-3 pr-24 text-sm ring-offset-d-background transition-[border] placeholder:text-d-secondary-foreground focus-visible:border-d-primary focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",
|
|
133
133
|
z && "pb-16",
|
|
134
134
|
l
|
|
135
135
|
),
|
|
@@ -153,7 +153,7 @@ function ne({
|
|
|
153
153
|
t.name + String(t.lastModified)
|
|
154
154
|
)) }) }) })
|
|
155
155
|
] }) }),
|
|
156
|
-
/* @__PURE__ */
|
|
156
|
+
/* @__PURE__ */ d("div", { className: "absolute right-3 top-3 z-20 flex gap-2", children: [
|
|
157
157
|
r.allowAttachments && /* @__PURE__ */ e(
|
|
158
158
|
p,
|
|
159
159
|
{
|
|
@@ -174,21 +174,21 @@ function ne({
|
|
|
174
174
|
{
|
|
175
175
|
type: "button",
|
|
176
176
|
variant: "outline",
|
|
177
|
-
className: R("h-8 w-8", M && "text-primary"),
|
|
177
|
+
className: R("h-8 w-8", M && "text-d-primary"),
|
|
178
178
|
"aria-label": "Voice input",
|
|
179
179
|
size: "icon",
|
|
180
180
|
onClick: E,
|
|
181
181
|
children: /* @__PURE__ */ e(ee, { className: "h-4 w-4" })
|
|
182
182
|
}
|
|
183
183
|
),
|
|
184
|
-
|
|
184
|
+
m && u ? /* @__PURE__ */ e(
|
|
185
185
|
p,
|
|
186
186
|
{
|
|
187
187
|
type: "button",
|
|
188
188
|
size: "icon",
|
|
189
189
|
className: "h-8 w-8",
|
|
190
190
|
"aria-label": "Stop generating",
|
|
191
|
-
onClick:
|
|
191
|
+
onClick: u,
|
|
192
192
|
children: /* @__PURE__ */ e(te, { className: "h-3 w-3 animate-pulse", fill: "currentColor" })
|
|
193
193
|
}
|
|
194
194
|
) : /* @__PURE__ */ e(
|
|
@@ -198,14 +198,14 @@ function ne({
|
|
|
198
198
|
size: "icon",
|
|
199
199
|
className: "h-8 w-8 transition-opacity",
|
|
200
200
|
"aria-label": "Send message",
|
|
201
|
-
disabled: r.value === "" ||
|
|
201
|
+
disabled: r.value === "" || m,
|
|
202
202
|
children: /* @__PURE__ */ e(re, { className: "h-5 w-5" })
|
|
203
203
|
}
|
|
204
204
|
)
|
|
205
205
|
] }),
|
|
206
206
|
r.allowAttachments && /* @__PURE__ */ e(le, { isDragging: L }),
|
|
207
207
|
/* @__PURE__ */ e(
|
|
208
|
-
|
|
208
|
+
de,
|
|
209
209
|
{
|
|
210
210
|
isRecording: k,
|
|
211
211
|
isTranscribing: j,
|
|
@@ -220,10 +220,10 @@ function ne({
|
|
|
220
220
|
}
|
|
221
221
|
ne.displayName = "MessageInput";
|
|
222
222
|
function le({ isDragging: a }) {
|
|
223
|
-
return /* @__PURE__ */ e(v, { children: a && /* @__PURE__ */
|
|
223
|
+
return /* @__PURE__ */ e(v, { children: a && /* @__PURE__ */ d(
|
|
224
224
|
x.div,
|
|
225
225
|
{
|
|
226
|
-
className: "pointer-events-none absolute inset-0 z-20 flex items-center justify-center space-x-2 rounded-xl border border-dashed border-border bg-background text-sm text-
|
|
226
|
+
className: "pointer-events-none absolute inset-0 z-20 flex items-center justify-center space-x-2 rounded-xl border border-dashed border-d-border bg-d-background text-sm text-d-secondary-foreground",
|
|
227
227
|
initial: { opacity: 0 },
|
|
228
228
|
animate: { opacity: 1 },
|
|
229
229
|
exit: { opacity: 0 },
|
|
@@ -252,21 +252,21 @@ function oe() {
|
|
|
252
252
|
});
|
|
253
253
|
}
|
|
254
254
|
function se() {
|
|
255
|
-
return /* @__PURE__ */
|
|
255
|
+
return /* @__PURE__ */ d(
|
|
256
256
|
x.div,
|
|
257
257
|
{
|
|
258
|
-
className: "flex h-full w-full flex-col items-center justify-center rounded-xl bg-background/80 backdrop-blur-sm",
|
|
258
|
+
className: "flex h-full w-full flex-col items-center justify-center rounded-xl bg-d-background/80 backdrop-blur-sm",
|
|
259
259
|
initial: { opacity: 0 },
|
|
260
260
|
animate: { opacity: 1 },
|
|
261
261
|
exit: { opacity: 0 },
|
|
262
262
|
transition: { duration: 0.2 },
|
|
263
263
|
children: [
|
|
264
|
-
/* @__PURE__ */
|
|
265
|
-
/* @__PURE__ */ e(ae, { className: "h-8 w-8 animate-spin text-primary" }),
|
|
264
|
+
/* @__PURE__ */ d("div", { className: "relative", children: [
|
|
265
|
+
/* @__PURE__ */ e(ae, { className: "h-8 w-8 animate-spin text-d-primary" }),
|
|
266
266
|
/* @__PURE__ */ e(
|
|
267
267
|
x.div,
|
|
268
268
|
{
|
|
269
|
-
className: "absolute inset-0 h-8 w-8 animate-pulse rounded-full bg-primary/20",
|
|
269
|
+
className: "absolute inset-0 h-8 w-8 animate-pulse rounded-full bg-d-primary/20",
|
|
270
270
|
initial: { scale: 0.8, opacity: 0 },
|
|
271
271
|
animate: { scale: 1.2, opacity: 1 },
|
|
272
272
|
transition: {
|
|
@@ -278,7 +278,7 @@ function se() {
|
|
|
278
278
|
}
|
|
279
279
|
)
|
|
280
280
|
] }),
|
|
281
|
-
/* @__PURE__ */ e("p", { className: "mt-4 text-sm font-medium text-
|
|
281
|
+
/* @__PURE__ */ e("p", { className: "mt-4 text-sm font-medium text-d-secondary-foreground", children: "Transcribing audio..." })
|
|
282
282
|
]
|
|
283
283
|
}
|
|
284
284
|
);
|
|
@@ -297,21 +297,21 @@ function ce({ isVisible: a, onStopRecording: l }) {
|
|
|
297
297
|
}
|
|
298
298
|
},
|
|
299
299
|
exit: { top: 0, filter: "blur(5px)" },
|
|
300
|
-
className: "absolute left-1/2 flex -translate-x-1/2 cursor-pointer overflow-hidden whitespace-nowrap rounded-full border bg-background py-1 text-center text-sm text-
|
|
300
|
+
className: "absolute left-1/2 flex -translate-x-1/2 cursor-pointer overflow-hidden whitespace-nowrap rounded-full border bg-d-background py-1 text-center text-sm text-d-secondary-foreground",
|
|
301
301
|
onClick: l,
|
|
302
|
-
children: /* @__PURE__ */
|
|
302
|
+
children: /* @__PURE__ */ d("span", { className: "mx-2.5 flex items-center", children: [
|
|
303
303
|
/* @__PURE__ */ e(ie, { className: "mr-2 h-3 w-3" }),
|
|
304
304
|
"Click to finish recording"
|
|
305
305
|
] })
|
|
306
306
|
}
|
|
307
307
|
) });
|
|
308
308
|
}
|
|
309
|
-
function
|
|
309
|
+
function de({
|
|
310
310
|
isRecording: a,
|
|
311
311
|
isTranscribing: l,
|
|
312
312
|
audioStream: o,
|
|
313
313
|
textAreaHeight: s,
|
|
314
|
-
onStopRecording:
|
|
314
|
+
onStopRecording: u
|
|
315
315
|
}) {
|
|
316
316
|
return a ? /* @__PURE__ */ e(
|
|
317
317
|
"div",
|
|
@@ -323,7 +323,7 @@ function ue({
|
|
|
323
323
|
{
|
|
324
324
|
stream: o,
|
|
325
325
|
isRecording: a,
|
|
326
|
-
onClick:
|
|
326
|
+
onClick: u
|
|
327
327
|
}
|
|
328
328
|
)
|
|
329
329
|
}
|
|
@@ -1,52 +1,52 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { Command as
|
|
2
|
+
import { jsx as u, jsxs as j, Fragment as X } from "react/jsx-runtime";
|
|
3
|
+
import { Command as ue, useCommandState as fe } from "../../node_modules/cmdk/dist/index.js";
|
|
4
4
|
import * as a from "react";
|
|
5
|
-
import { useEffect as
|
|
5
|
+
import { useEffect as L, forwardRef as de } from "react";
|
|
6
6
|
import { Badge as ae } from "./badge.js";
|
|
7
7
|
import { CommandItem as K, Command as ce, CommandList as oe, CommandGroup as ve } from "./command.js";
|
|
8
8
|
import { cn as w } from "../../lib/utils.js";
|
|
9
|
-
import { Label as
|
|
9
|
+
import { Label as be } from "./label.js";
|
|
10
10
|
import Y from "../../node_modules/lucide-react/dist/esm/icons/x.js";
|
|
11
|
-
function
|
|
12
|
-
const [f,
|
|
13
|
-
return
|
|
14
|
-
const c = setTimeout(() =>
|
|
11
|
+
function me(i, r) {
|
|
12
|
+
const [f, b] = a.useState(i);
|
|
13
|
+
return L(() => {
|
|
14
|
+
const c = setTimeout(() => b(i), r);
|
|
15
15
|
return () => {
|
|
16
16
|
clearTimeout(c);
|
|
17
17
|
};
|
|
18
|
-
}, [
|
|
18
|
+
}, [i, r]), f;
|
|
19
19
|
}
|
|
20
|
-
function G(
|
|
21
|
-
if (
|
|
20
|
+
function G(i, r) {
|
|
21
|
+
if (i.length === 0)
|
|
22
22
|
return {};
|
|
23
23
|
if (!r)
|
|
24
24
|
return {
|
|
25
|
-
"":
|
|
25
|
+
"": i
|
|
26
26
|
};
|
|
27
27
|
const f = {};
|
|
28
|
-
return
|
|
29
|
-
const c =
|
|
30
|
-
f[c] || (f[c] = []), f[c].push(
|
|
28
|
+
return i.forEach((b) => {
|
|
29
|
+
const c = b[r] || "";
|
|
30
|
+
f[c] || (f[c] = []), f[c].push(b);
|
|
31
31
|
}), f;
|
|
32
32
|
}
|
|
33
|
-
function we(
|
|
34
|
-
const f = JSON.parse(JSON.stringify(
|
|
35
|
-
for (const [
|
|
36
|
-
f[
|
|
33
|
+
function we(i, r) {
|
|
34
|
+
const f = JSON.parse(JSON.stringify(i));
|
|
35
|
+
for (const [b, c] of Object.entries(f))
|
|
36
|
+
f[b] = c.filter((_) => !r.find((v) => v.value === _.value));
|
|
37
37
|
return f;
|
|
38
38
|
}
|
|
39
|
-
function ge(
|
|
40
|
-
for (const [, f] of Object.entries(
|
|
41
|
-
if (f.some((
|
|
39
|
+
function ge(i, r) {
|
|
40
|
+
for (const [, f] of Object.entries(i))
|
|
41
|
+
if (f.some((b) => r.find((c) => c.value === b.value)))
|
|
42
42
|
return !0;
|
|
43
43
|
return !1;
|
|
44
44
|
}
|
|
45
|
-
const Z = de(({ className:
|
|
45
|
+
const Z = de(({ className: i, ...r }, f) => fe((c) => c.filtered.count === 0) ? /* @__PURE__ */ u(
|
|
46
46
|
"div",
|
|
47
47
|
{
|
|
48
48
|
ref: f,
|
|
49
|
-
className: w("py-6 text-center text-sm",
|
|
49
|
+
className: w("py-6 text-center text-sm", i),
|
|
50
50
|
"cmdk-empty": "",
|
|
51
51
|
role: "presentation",
|
|
52
52
|
...r
|
|
@@ -55,10 +55,10 @@ const Z = de(({ className: s, ...r }, f) => fe((c) => c.filtered.count === 0) ?
|
|
|
55
55
|
Z.displayName = "CommandEmpty";
|
|
56
56
|
const he = a.forwardRef(
|
|
57
57
|
({
|
|
58
|
-
value:
|
|
58
|
+
value: i,
|
|
59
59
|
onChange: r,
|
|
60
60
|
placeholder: f,
|
|
61
|
-
defaultOptions:
|
|
61
|
+
defaultOptions: b = [],
|
|
62
62
|
options: c,
|
|
63
63
|
delay: _,
|
|
64
64
|
onSearch: v,
|
|
@@ -66,23 +66,23 @@ const he = a.forwardRef(
|
|
|
66
66
|
loadingIndicator: W,
|
|
67
67
|
emptyIndicator: F,
|
|
68
68
|
maxSelected: z = Number.MAX_SAFE_INTEGER,
|
|
69
|
-
onMaxSelected:
|
|
69
|
+
onMaxSelected: k,
|
|
70
70
|
hidePlaceholderWhenSelected: H,
|
|
71
|
-
disabled:
|
|
71
|
+
disabled: E,
|
|
72
72
|
groupBy: g,
|
|
73
73
|
className: B,
|
|
74
74
|
badgeClassName: S,
|
|
75
75
|
selectFirstItem: p = !0,
|
|
76
|
-
creatable:
|
|
76
|
+
creatable: D = !1,
|
|
77
77
|
triggerSearchOnFocus: T = !1,
|
|
78
78
|
commandProps: n,
|
|
79
|
-
inputProps:
|
|
79
|
+
inputProps: s,
|
|
80
80
|
hideClearAllButton: P = !1,
|
|
81
81
|
label: M
|
|
82
82
|
}, ee) => {
|
|
83
|
-
const o = a.useRef(null), [h, A] = a.useState(!1), [te, $] = a.useState(!1), [q, Q] = a.useState(!1), C = a.useRef(null), [l,
|
|
84
|
-
G(
|
|
85
|
-
), [
|
|
83
|
+
const o = a.useRef(null), [h, A] = a.useState(!1), [te, $] = a.useState(!1), [q, Q] = a.useState(!1), C = a.useRef(null), [l, O] = a.useState(i || []), [x, R] = a.useState(
|
|
84
|
+
G(b, g)
|
|
85
|
+
), [m, U] = a.useState(""), N = me(m, _ || 500);
|
|
86
86
|
a.useImperativeHandle(
|
|
87
87
|
ee,
|
|
88
88
|
() => ({
|
|
@@ -92,16 +92,16 @@ const he = a.forwardRef(
|
|
|
92
92
|
var e;
|
|
93
93
|
return (e = o == null ? void 0 : o.current) == null ? void 0 : e.focus();
|
|
94
94
|
},
|
|
95
|
-
reset: () =>
|
|
95
|
+
reset: () => O([])
|
|
96
96
|
}),
|
|
97
97
|
[l]
|
|
98
98
|
);
|
|
99
|
-
const
|
|
99
|
+
const y = (e) => {
|
|
100
100
|
C.current && !C.current.contains(e.target) && o.current && !o.current.contains(e.target) && (A(!1), o.current.blur());
|
|
101
101
|
}, J = a.useCallback(
|
|
102
102
|
(e) => {
|
|
103
103
|
const t = l.filter((d) => d.value !== e.value);
|
|
104
|
-
|
|
104
|
+
O(t), r == null || r(t);
|
|
105
105
|
},
|
|
106
106
|
[r, l]
|
|
107
107
|
), le = a.useCallback(
|
|
@@ -111,19 +111,19 @@ const he = a.forwardRef(
|
|
|
111
111
|
},
|
|
112
112
|
[J, l]
|
|
113
113
|
);
|
|
114
|
-
|
|
114
|
+
L(() => {
|
|
115
115
|
if (typeof document < "u")
|
|
116
|
-
return h ? (document.addEventListener("mousedown",
|
|
117
|
-
document.removeEventListener("mousedown",
|
|
116
|
+
return h ? (document.addEventListener("mousedown", y), document.addEventListener("touchend", y)) : (document.removeEventListener("mousedown", y), document.removeEventListener("touchend", y)), () => {
|
|
117
|
+
document.removeEventListener("mousedown", y), document.removeEventListener("touchend", y);
|
|
118
118
|
};
|
|
119
|
-
}, [h,
|
|
120
|
-
|
|
121
|
-
}, [
|
|
119
|
+
}, [h, y]), L(() => {
|
|
120
|
+
i && O(i);
|
|
121
|
+
}, [i]), L(() => {
|
|
122
122
|
if (!c || v)
|
|
123
123
|
return;
|
|
124
124
|
const e = G(c || [], g);
|
|
125
125
|
JSON.stringify(e) !== JSON.stringify(x) && R(e);
|
|
126
|
-
}, [
|
|
126
|
+
}, [b, c, g, v, x]), L(() => {
|
|
127
127
|
const e = () => {
|
|
128
128
|
const d = I == null ? void 0 : I(N);
|
|
129
129
|
R(G(d || [], g));
|
|
@@ -131,7 +131,7 @@ const he = a.forwardRef(
|
|
|
131
131
|
(async () => {
|
|
132
132
|
!I || !h || (T && e(), N && e());
|
|
133
133
|
})();
|
|
134
|
-
}, [N, g, h, T]),
|
|
134
|
+
}, [N, g, h, T]), L(() => {
|
|
135
135
|
const e = async () => {
|
|
136
136
|
Q(!0);
|
|
137
137
|
const d = await (v == null ? void 0 : v(N));
|
|
@@ -142,44 +142,44 @@ const he = a.forwardRef(
|
|
|
142
142
|
})();
|
|
143
143
|
}, [N, g, h, T]);
|
|
144
144
|
const re = () => {
|
|
145
|
-
if (!
|
|
145
|
+
if (!D || ge(x, [{ value: m, label: m }]) || l.find((t) => t.value === m))
|
|
146
146
|
return;
|
|
147
|
-
const e = /* @__PURE__ */
|
|
147
|
+
const e = /* @__PURE__ */ u(
|
|
148
148
|
K,
|
|
149
149
|
{
|
|
150
|
-
value:
|
|
150
|
+
value: m,
|
|
151
151
|
className: "cursor-pointer",
|
|
152
152
|
onMouseDown: (t) => {
|
|
153
153
|
t.preventDefault(), t.stopPropagation();
|
|
154
154
|
},
|
|
155
155
|
onSelect: (t) => {
|
|
156
156
|
if (l.length >= z) {
|
|
157
|
-
|
|
157
|
+
k == null || k(l.length);
|
|
158
158
|
return;
|
|
159
159
|
}
|
|
160
160
|
U("");
|
|
161
161
|
const d = [...l, { value: t, label: t }];
|
|
162
|
-
|
|
162
|
+
O(d), r == null || r(d);
|
|
163
163
|
},
|
|
164
|
-
children: `Create "${
|
|
164
|
+
children: `Create "${m}"`
|
|
165
165
|
}
|
|
166
166
|
);
|
|
167
|
-
if (!v &&
|
|
167
|
+
if (!v && m.length > 0 || v && N.length > 0 && !q)
|
|
168
168
|
return e;
|
|
169
169
|
}, ne = a.useCallback(() => {
|
|
170
170
|
if (F)
|
|
171
|
-
return v && !
|
|
172
|
-
}, [
|
|
171
|
+
return v && !D && Object.keys(x).length === 0 ? /* @__PURE__ */ u(K, { value: "-", disabled: !0, children: F }) : /* @__PURE__ */ u(Z, { children: F });
|
|
172
|
+
}, [D, F, v, x]), se = a.useMemo(
|
|
173
173
|
() => we(x, l),
|
|
174
174
|
[x, l]
|
|
175
|
-
),
|
|
175
|
+
), ie = a.useCallback(() => {
|
|
176
176
|
if (n != null && n.filter)
|
|
177
177
|
return n.filter;
|
|
178
|
-
if (
|
|
178
|
+
if (D)
|
|
179
179
|
return (e, t) => e.toLowerCase().includes(t.toLowerCase()) ? 1 : -1;
|
|
180
|
-
}, [
|
|
180
|
+
}, [D, n == null ? void 0 : n.filter]);
|
|
181
181
|
return /* @__PURE__ */ j("div", { className: "flex flex-col space-y-1.5", children: [
|
|
182
|
-
M && /* @__PURE__ */
|
|
182
|
+
M && /* @__PURE__ */ u(be, { children: M }),
|
|
183
183
|
/* @__PURE__ */ j(
|
|
184
184
|
ce,
|
|
185
185
|
{
|
|
@@ -191,43 +191,43 @@ const he = a.forwardRef(
|
|
|
191
191
|
},
|
|
192
192
|
className: w("h-auto overflow-visible bg-transparent", n == null ? void 0 : n.className),
|
|
193
193
|
shouldFilter: (n == null ? void 0 : n.shouldFilter) !== void 0 ? n.shouldFilter : !v,
|
|
194
|
-
filter:
|
|
194
|
+
filter: ie(),
|
|
195
195
|
children: [
|
|
196
|
-
/* @__PURE__ */
|
|
196
|
+
/* @__PURE__ */ u(
|
|
197
197
|
"div",
|
|
198
198
|
{
|
|
199
199
|
className: w(
|
|
200
|
-
"min-h-10 rounded-md border border-input text-base ring-offset-background focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2 md:text-sm",
|
|
200
|
+
"min-h-10 rounded-md border border-d-input text-base ring-offset-d-background focus-within:ring-2 focus-within:ring-d-ring focus-within:ring-offset-2 md:text-sm",
|
|
201
201
|
{
|
|
202
202
|
"px-3 py-2": l.length !== 0,
|
|
203
|
-
"cursor-text": !
|
|
203
|
+
"cursor-text": !E && l.length !== 0
|
|
204
204
|
},
|
|
205
205
|
B
|
|
206
206
|
),
|
|
207
207
|
onClick: () => {
|
|
208
208
|
var e;
|
|
209
|
-
|
|
209
|
+
E || (e = o == null ? void 0 : o.current) == null || e.focus();
|
|
210
210
|
},
|
|
211
211
|
children: /* @__PURE__ */ j("div", { className: "relative flex flex-wrap gap-1", children: [
|
|
212
212
|
l.map((e) => /* @__PURE__ */ j(
|
|
213
213
|
ae,
|
|
214
214
|
{
|
|
215
215
|
className: w(
|
|
216
|
-
"data-[disabled]:bg-
|
|
217
|
-
"data-[fixed]:bg-
|
|
216
|
+
"data-[disabled]:bg-d-secondary-foreground data-[disabled]:text-d-secondary data-[disabled]:hover:bg-d-secondary-foreground",
|
|
217
|
+
"data-[fixed]:bg-d-secondary-foreground data-[fixed]:text-d-secondary data-[fixed]:hover:bg-d-secondary-foreground",
|
|
218
218
|
S
|
|
219
219
|
),
|
|
220
220
|
"data-fixed": e.fixed,
|
|
221
|
-
"data-disabled":
|
|
221
|
+
"data-disabled": E || void 0,
|
|
222
222
|
children: [
|
|
223
223
|
e.label,
|
|
224
|
-
/* @__PURE__ */
|
|
224
|
+
/* @__PURE__ */ u(
|
|
225
225
|
"button",
|
|
226
226
|
{
|
|
227
227
|
type: "button",
|
|
228
228
|
className: w(
|
|
229
|
-
"ml-1 rounded-full outline-none ring-offset-background focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
230
|
-
(
|
|
229
|
+
"ml-1 rounded-full outline-none ring-offset-d-background focus:ring-2 focus:ring-d-ring focus:ring-offset-2",
|
|
230
|
+
(E || e.fixed) && "hidden"
|
|
231
231
|
),
|
|
232
232
|
onKeyDown: (t) => {
|
|
233
233
|
t.key === "Enter" && J(e);
|
|
@@ -236,65 +236,65 @@ const he = a.forwardRef(
|
|
|
236
236
|
t.preventDefault(), t.stopPropagation();
|
|
237
237
|
},
|
|
238
238
|
onClick: () => J(e),
|
|
239
|
-
children: /* @__PURE__ */
|
|
239
|
+
children: /* @__PURE__ */ u(Y, { className: "h-3 w-3 text-d-secondary-foreground hover:text-foreground" })
|
|
240
240
|
}
|
|
241
241
|
)
|
|
242
242
|
]
|
|
243
243
|
},
|
|
244
244
|
e.value
|
|
245
245
|
)),
|
|
246
|
-
/* @__PURE__ */
|
|
247
|
-
|
|
246
|
+
/* @__PURE__ */ u(
|
|
247
|
+
ue.Input,
|
|
248
248
|
{
|
|
249
|
-
...
|
|
249
|
+
...s,
|
|
250
250
|
ref: o,
|
|
251
|
-
value:
|
|
252
|
-
disabled:
|
|
251
|
+
value: m,
|
|
252
|
+
disabled: E,
|
|
253
253
|
onValueChange: (e) => {
|
|
254
254
|
var t;
|
|
255
|
-
U(e), (t =
|
|
255
|
+
U(e), (t = s == null ? void 0 : s.onValueChange) == null || t.call(s, e);
|
|
256
256
|
},
|
|
257
257
|
onBlur: (e) => {
|
|
258
258
|
var t;
|
|
259
|
-
te || A(!1), (t =
|
|
259
|
+
te || A(!1), (t = s == null ? void 0 : s.onBlur) == null || t.call(s, e);
|
|
260
260
|
},
|
|
261
261
|
onFocus: (e) => {
|
|
262
262
|
var t;
|
|
263
|
-
A(!0), (t =
|
|
263
|
+
A(!0), (t = s == null ? void 0 : s.onFocus) == null || t.call(s, e);
|
|
264
264
|
},
|
|
265
265
|
placeholder: H && l.length !== 0 ? "" : f,
|
|
266
266
|
className: w(
|
|
267
|
-
"flex-1 bg-transparent outline-none placeholder:text-
|
|
267
|
+
"flex-1 bg-transparent outline-none placeholder:text-d-secondary-foreground",
|
|
268
268
|
{
|
|
269
269
|
"w-full": H,
|
|
270
270
|
"px-3 py-2": l.length === 0,
|
|
271
271
|
"ml-1": l.length !== 0
|
|
272
272
|
},
|
|
273
|
-
|
|
273
|
+
s == null ? void 0 : s.className
|
|
274
274
|
)
|
|
275
275
|
}
|
|
276
276
|
),
|
|
277
|
-
/* @__PURE__ */
|
|
277
|
+
/* @__PURE__ */ u(
|
|
278
278
|
"button",
|
|
279
279
|
{
|
|
280
280
|
type: "button",
|
|
281
281
|
onClick: () => {
|
|
282
|
-
|
|
282
|
+
O(l.filter((e) => e.fixed)), r == null || r(l.filter((e) => e.fixed));
|
|
283
283
|
},
|
|
284
284
|
className: w(
|
|
285
285
|
"absolute right-0 h-6 w-6 p-0",
|
|
286
|
-
(P ||
|
|
286
|
+
(P || E || l.length < 1 || l.filter((e) => e.fixed).length === l.length) && "hidden"
|
|
287
287
|
),
|
|
288
|
-
children: /* @__PURE__ */
|
|
288
|
+
children: /* @__PURE__ */ u(Y, {})
|
|
289
289
|
}
|
|
290
290
|
)
|
|
291
291
|
] })
|
|
292
292
|
}
|
|
293
293
|
),
|
|
294
|
-
/* @__PURE__ */
|
|
294
|
+
/* @__PURE__ */ u("div", { className: "relative", children: h && /* @__PURE__ */ u(
|
|
295
295
|
oe,
|
|
296
296
|
{
|
|
297
|
-
className: "absolute top-1 z-10 w-full rounded-md border bg-popover text-popover-foreground shadow-md outline-none animate-in",
|
|
297
|
+
className: "absolute top-1 z-10 w-full rounded-md border bg-d-popover text-d-popover-foreground shadow-md outline-none animate-in",
|
|
298
298
|
onMouseLeave: () => {
|
|
299
299
|
$(!1);
|
|
300
300
|
},
|
|
@@ -305,11 +305,11 @@ const he = a.forwardRef(
|
|
|
305
305
|
var e;
|
|
306
306
|
(e = o == null ? void 0 : o.current) == null || e.focus();
|
|
307
307
|
},
|
|
308
|
-
children: q ? /* @__PURE__ */
|
|
308
|
+
children: q ? /* @__PURE__ */ u(X, { children: W }) : /* @__PURE__ */ j(X, { children: [
|
|
309
309
|
ne(),
|
|
310
310
|
re(),
|
|
311
|
-
!p && /* @__PURE__ */
|
|
312
|
-
Object.entries(
|
|
311
|
+
!p && /* @__PURE__ */ u(K, { value: "-", className: "hidden" }),
|
|
312
|
+
Object.entries(se).map(([e, t]) => /* @__PURE__ */ u(ve, { heading: e, className: "h-full overflow-auto", children: /* @__PURE__ */ u(X, { children: t.map((d) => /* @__PURE__ */ u(
|
|
313
313
|
K,
|
|
314
314
|
{
|
|
315
315
|
value: d.label,
|
|
@@ -319,16 +319,16 @@ const he = a.forwardRef(
|
|
|
319
319
|
},
|
|
320
320
|
onSelect: () => {
|
|
321
321
|
if (l.length >= z) {
|
|
322
|
-
|
|
322
|
+
k == null || k(l.length);
|
|
323
323
|
return;
|
|
324
324
|
}
|
|
325
325
|
U("");
|
|
326
326
|
const V = [...l, d];
|
|
327
|
-
|
|
327
|
+
O(V), r == null || r(V);
|
|
328
328
|
},
|
|
329
329
|
className: w(
|
|
330
330
|
"cursor-pointer",
|
|
331
|
-
d.disable && "cursor-default text-
|
|
331
|
+
d.disable && "cursor-default text-d-secondary-foreground"
|
|
332
332
|
),
|
|
333
333
|
children: d.label
|
|
334
334
|
},
|
|
@@ -346,5 +346,5 @@ const he = a.forwardRef(
|
|
|
346
346
|
he.displayName = "MultipleSelector";
|
|
347
347
|
export {
|
|
348
348
|
he as MultipleSelector,
|
|
349
|
-
|
|
349
|
+
me as useDebounce
|
|
350
350
|
};
|