laif-ds 0.1.85 → 0.1.88
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/index4.js +5 -5
- package/dist/_virtual/index5.js +4 -4
- package/dist/components/ui/app-editor.js +58 -58
- package/dist/components/ui/app-multiple-select-dropdown.js +111 -88
- package/dist/components/ui/async-select.js +182 -151
- package/dist/components/ui/button.js +1 -1
- package/dist/components/ui/checkbox.js +5 -5
- package/dist/components/ui/multiple-selector.js +202 -190
- package/dist/components/ui/navigation-menu.js +2 -2
- package/dist/components/ui/select.js +1 -1
- package/dist/components/ui/switch.js +5 -5
- package/dist/components/ui/weekly-calendar/appointment-card.js +39 -39
- package/dist/components/ui/weekly-calendar/calendar-header.js +2 -2
- package/dist/components/ui/weekly-calendar/day-column.js +1 -1
- package/dist/index.d.ts +4 -4
- 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/dist/node_modules/unified/lib/index.js +1 -1
- package/dist/styles.css +1 -1
- package/dist/styles.v3.css +1 -1
- package/package.json +1 -1
- package/dist/components/ui/command-portal.js +0 -67
|
@@ -1,151 +1,159 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { Command as
|
|
4
|
-
import * as
|
|
5
|
-
import { useEffect as C, forwardRef as
|
|
6
|
-
import {
|
|
7
|
-
import { Badge as
|
|
8
|
-
import { CommandItem as
|
|
9
|
-
import { cn as
|
|
10
|
-
import { Label as
|
|
11
|
-
import
|
|
12
|
-
|
|
13
|
-
|
|
2
|
+
import { jsx as r, jsxs as L, Fragment as G } from "react/jsx-runtime";
|
|
3
|
+
import { Command as ue, useCommandState as ce } from "../../node_modules/cmdk/dist/index.js";
|
|
4
|
+
import * as o from "react";
|
|
5
|
+
import { useEffect as C, forwardRef as fe } from "react";
|
|
6
|
+
import { Popover as me, PopoverTrigger as he, PopoverContent as ge } from "./popover.js";
|
|
7
|
+
import { Badge as pe } from "./badge.js";
|
|
8
|
+
import { CommandItem as I, Command as q, CommandList as ve, CommandGroup as be } from "./command.js";
|
|
9
|
+
import { cn as p } from "../../lib/utils.js";
|
|
10
|
+
import { Label as xe } from "./label.js";
|
|
11
|
+
import { Icon as we } from "./icon.js";
|
|
12
|
+
import Ne from "../../node_modules/lucide-react/dist/esm/icons/x.js";
|
|
13
|
+
function ye(s, l) {
|
|
14
|
+
const [i, u] = o.useState(s);
|
|
14
15
|
return C(() => {
|
|
15
|
-
const
|
|
16
|
+
const a = setTimeout(() => u(s), l);
|
|
16
17
|
return () => {
|
|
17
|
-
clearTimeout(
|
|
18
|
+
clearTimeout(a);
|
|
18
19
|
};
|
|
19
|
-
}, [
|
|
20
|
+
}, [s, l]), i;
|
|
20
21
|
}
|
|
21
|
-
function
|
|
22
|
-
if (
|
|
22
|
+
function T(s, l) {
|
|
23
|
+
if (s.length === 0)
|
|
23
24
|
return {};
|
|
24
|
-
if (!
|
|
25
|
+
if (!l)
|
|
25
26
|
return {
|
|
26
|
-
"":
|
|
27
|
+
"": s
|
|
27
28
|
};
|
|
28
|
-
const
|
|
29
|
-
return
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
}),
|
|
29
|
+
const i = {};
|
|
30
|
+
return s.forEach((u) => {
|
|
31
|
+
const a = u[l] || "";
|
|
32
|
+
i[a] || (i[a] = []), i[a].push(u);
|
|
33
|
+
}), i;
|
|
33
34
|
}
|
|
34
|
-
function
|
|
35
|
-
const
|
|
36
|
-
for (const [u,
|
|
37
|
-
|
|
38
|
-
(
|
|
35
|
+
function Ce(s, l) {
|
|
36
|
+
const i = JSON.parse(JSON.stringify(s));
|
|
37
|
+
for (const [u, a] of Object.entries(i))
|
|
38
|
+
i[u] = a.filter(
|
|
39
|
+
(V) => !l.find((c) => c.value === V.value)
|
|
39
40
|
);
|
|
40
|
-
return
|
|
41
|
+
return i;
|
|
41
42
|
}
|
|
42
|
-
function
|
|
43
|
-
for (const [,
|
|
44
|
-
if (
|
|
43
|
+
function Ee(s, l) {
|
|
44
|
+
for (const [, i] of Object.entries(s))
|
|
45
|
+
if (i.some((u) => l.find((a) => a.value === u.value)))
|
|
45
46
|
return !0;
|
|
46
47
|
return !1;
|
|
47
48
|
}
|
|
48
|
-
const Q =
|
|
49
|
+
const Q = fe(({ className: s, ...l }, i) => ce((a) => a.filtered.count === 0) ? /* @__PURE__ */ r(
|
|
49
50
|
"div",
|
|
50
51
|
{
|
|
51
|
-
ref:
|
|
52
|
-
className:
|
|
52
|
+
ref: i,
|
|
53
|
+
className: p("py-6 text-center text-sm", s),
|
|
53
54
|
"cmdk-empty": "",
|
|
54
55
|
role: "presentation",
|
|
55
|
-
...
|
|
56
|
+
...l
|
|
56
57
|
}
|
|
57
58
|
) : null);
|
|
58
59
|
Q.displayName = "CommandEmpty";
|
|
59
|
-
const
|
|
60
|
+
const Oe = o.forwardRef(
|
|
60
61
|
({
|
|
61
|
-
value:
|
|
62
|
-
onChange:
|
|
63
|
-
placeholder:
|
|
62
|
+
value: s,
|
|
63
|
+
onChange: l,
|
|
64
|
+
placeholder: i,
|
|
64
65
|
defaultOptions: u = [],
|
|
65
|
-
options:
|
|
66
|
-
delay:
|
|
66
|
+
options: a,
|
|
67
|
+
delay: V,
|
|
67
68
|
onSearch: c,
|
|
68
|
-
onSearchSync:
|
|
69
|
+
onSearchSync: X,
|
|
69
70
|
loadingIndicator: Y,
|
|
70
71
|
emptyIndicator: D,
|
|
71
72
|
maxSelected: _ = Number.MAX_SAFE_INTEGER,
|
|
72
|
-
onMaxSelected:
|
|
73
|
-
hidePlaceholderWhenSelected:
|
|
74
|
-
disabled:
|
|
75
|
-
groupBy:
|
|
73
|
+
onMaxSelected: A,
|
|
74
|
+
hidePlaceholderWhenSelected: U,
|
|
75
|
+
disabled: N,
|
|
76
|
+
groupBy: v,
|
|
76
77
|
className: Z,
|
|
77
|
-
badgeClassName:
|
|
78
|
-
selectFirstItem:
|
|
79
|
-
creatable:
|
|
80
|
-
triggerSearchOnFocus:
|
|
78
|
+
badgeClassName: B,
|
|
79
|
+
selectFirstItem: P = !0,
|
|
80
|
+
creatable: E = !1,
|
|
81
|
+
triggerSearchOnFocus: R = !1,
|
|
81
82
|
commandProps: m,
|
|
82
|
-
inputProps:
|
|
83
|
-
hideClearAllButton:
|
|
84
|
-
label:
|
|
85
|
-
},
|
|
86
|
-
const
|
|
87
|
-
|
|
88
|
-
),
|
|
89
|
-
|
|
90
|
-
|
|
83
|
+
inputProps: O,
|
|
84
|
+
hideClearAllButton: ee = !1,
|
|
85
|
+
label: W
|
|
86
|
+
}, te) => {
|
|
87
|
+
const h = o.useRef(null), [f, S] = o.useState(!1), [ne, z] = o.useState(!1), [H, $] = o.useState(!1), [re, oe] = o.useState(
|
|
88
|
+
void 0
|
|
89
|
+
), j = o.useRef(null), F = o.useRef(null), [t, y] = o.useState(s || []), [b, J] = o.useState(
|
|
90
|
+
T(u, v)
|
|
91
|
+
), [g, K] = o.useState(""), x = ye(g, V || 500);
|
|
92
|
+
o.useImperativeHandle(
|
|
93
|
+
te,
|
|
91
94
|
() => ({
|
|
92
95
|
selectedValue: [...t],
|
|
93
|
-
input:
|
|
94
|
-
focus: () =>
|
|
95
|
-
reset: () =>
|
|
96
|
+
input: h.current,
|
|
97
|
+
focus: () => h?.current?.focus(),
|
|
98
|
+
reset: () => y([])
|
|
96
99
|
}),
|
|
97
100
|
[t]
|
|
98
101
|
);
|
|
99
|
-
const
|
|
100
|
-
|
|
101
|
-
},
|
|
102
|
+
const w = (e) => {
|
|
103
|
+
j.current && !j.current.contains(e.target) && h.current && !h.current.contains(e.target) && (S(!1), h.current.blur());
|
|
104
|
+
}, M = o.useCallback(
|
|
102
105
|
(e) => {
|
|
103
|
-
const n = t.filter((
|
|
104
|
-
|
|
106
|
+
const n = t.filter((d) => d.value !== e.value);
|
|
107
|
+
y(n), l?.(n);
|
|
105
108
|
},
|
|
106
|
-
[
|
|
107
|
-
),
|
|
109
|
+
[l, t]
|
|
110
|
+
), se = o.useCallback(
|
|
108
111
|
(e) => {
|
|
109
|
-
const n =
|
|
110
|
-
n && ((e.key === "Delete" || e.key === "Backspace") && n.value === "" && t.length > 0 && (t[t.length - 1].fixed ||
|
|
112
|
+
const n = h.current;
|
|
113
|
+
n && ((e.key === "Delete" || e.key === "Backspace") && n.value === "" && t.length > 0 && (t[t.length - 1].fixed || M(t[t.length - 1])), e.key === "Escape" && n.blur());
|
|
111
114
|
},
|
|
112
|
-
[
|
|
115
|
+
[M, t]
|
|
113
116
|
);
|
|
114
117
|
C(() => {
|
|
115
118
|
if (typeof document < "u")
|
|
116
|
-
return
|
|
117
|
-
document.removeEventListener("mousedown",
|
|
119
|
+
return f ? (document.addEventListener("mousedown", w), document.addEventListener("touchend", w)) : (document.removeEventListener("mousedown", w), document.removeEventListener("touchend", w)), () => {
|
|
120
|
+
document.removeEventListener("mousedown", w), document.removeEventListener("touchend", w);
|
|
118
121
|
};
|
|
119
|
-
}, [
|
|
120
|
-
|
|
121
|
-
}, [
|
|
122
|
-
if (!
|
|
122
|
+
}, [f, w]), C(() => {
|
|
123
|
+
s && y(s);
|
|
124
|
+
}, [s]), C(() => {
|
|
125
|
+
if (!a || c)
|
|
123
126
|
return;
|
|
124
|
-
const e =
|
|
125
|
-
JSON.stringify(e) !== JSON.stringify(
|
|
126
|
-
}, [u,
|
|
127
|
+
const e = T(a || [], v);
|
|
128
|
+
JSON.stringify(e) !== JSON.stringify(b) && J(e);
|
|
129
|
+
}, [u, a, v, c, b]), C(() => {
|
|
127
130
|
const e = () => {
|
|
128
|
-
const
|
|
129
|
-
T(
|
|
131
|
+
const d = X?.(x);
|
|
132
|
+
J(T(d || [], v));
|
|
130
133
|
};
|
|
131
134
|
(async () => {
|
|
132
|
-
!
|
|
135
|
+
!X || !f || (R && e(), x && e());
|
|
133
136
|
})();
|
|
134
|
-
}, [
|
|
137
|
+
}, [x, v, f, R]), C(() => {
|
|
135
138
|
const e = async () => {
|
|
136
139
|
$(!0);
|
|
137
|
-
const
|
|
138
|
-
T(
|
|
140
|
+
const d = await c?.(x);
|
|
141
|
+
J(T(d || [], v)), $(!1);
|
|
139
142
|
};
|
|
140
143
|
(async () => {
|
|
141
|
-
!c || !
|
|
144
|
+
!c || !f || (R && await e(), x && await e());
|
|
142
145
|
})();
|
|
143
|
-
}, [
|
|
144
|
-
|
|
145
|
-
|
|
146
|
+
}, [x, v, f, R]), o.useEffect(() => {
|
|
147
|
+
if (f && F.current) {
|
|
148
|
+
const e = F.current.getBoundingClientRect();
|
|
149
|
+
oe(e.width);
|
|
150
|
+
}
|
|
151
|
+
}, [f]);
|
|
152
|
+
const le = () => {
|
|
153
|
+
if (!E || Ee(b, [{ value: g, label: g }]) || t.find((n) => n.value === g))
|
|
146
154
|
return;
|
|
147
|
-
const e = /* @__PURE__ */
|
|
148
|
-
|
|
155
|
+
const e = /* @__PURE__ */ r(
|
|
156
|
+
I,
|
|
149
157
|
{
|
|
150
158
|
value: g,
|
|
151
159
|
className: "cursor-pointer",
|
|
@@ -154,213 +162,217 @@ const xe = a.forwardRef(
|
|
|
154
162
|
},
|
|
155
163
|
onSelect: (n) => {
|
|
156
164
|
if (t.length >= _) {
|
|
157
|
-
|
|
165
|
+
A?.(t.length);
|
|
158
166
|
return;
|
|
159
167
|
}
|
|
160
|
-
|
|
161
|
-
const
|
|
162
|
-
|
|
168
|
+
K("");
|
|
169
|
+
const d = [...t, { value: n, label: n }];
|
|
170
|
+
y(d), l?.(d);
|
|
163
171
|
},
|
|
164
172
|
children: `Create "${g}"`
|
|
165
173
|
}
|
|
166
174
|
);
|
|
167
|
-
if (!c && g.length > 0 || c &&
|
|
175
|
+
if (!c && g.length > 0 || c && x.length > 0 && !H)
|
|
168
176
|
return e;
|
|
169
|
-
},
|
|
177
|
+
}, ie = o.useCallback(() => {
|
|
170
178
|
if (D)
|
|
171
|
-
return c && !
|
|
172
|
-
}, [
|
|
173
|
-
() =>
|
|
174
|
-
[
|
|
175
|
-
),
|
|
179
|
+
return c && !E && Object.keys(b).length === 0 ? /* @__PURE__ */ r(I, { value: "-", disabled: !0, children: D }) : /* @__PURE__ */ r(Q, { children: D });
|
|
180
|
+
}, [E, D, c, b]), de = o.useMemo(
|
|
181
|
+
() => Ce(b, t),
|
|
182
|
+
[b, t]
|
|
183
|
+
), ae = o.useCallback(() => {
|
|
176
184
|
if (m?.filter)
|
|
177
185
|
return m.filter;
|
|
178
|
-
if (
|
|
186
|
+
if (E)
|
|
179
187
|
return (e, n) => e.toLowerCase().includes(n.toLowerCase()) ? 1 : -1;
|
|
180
|
-
}, [
|
|
188
|
+
}, [E, m?.filter]);
|
|
181
189
|
return /* @__PURE__ */ L("div", { className: "flex flex-col space-y-1.5", children: [
|
|
182
|
-
|
|
183
|
-
/* @__PURE__ */
|
|
184
|
-
|
|
190
|
+
W && /* @__PURE__ */ r(xe, { children: W }),
|
|
191
|
+
/* @__PURE__ */ r(
|
|
192
|
+
q,
|
|
185
193
|
{
|
|
186
|
-
ref:
|
|
194
|
+
ref: j,
|
|
187
195
|
...m,
|
|
188
196
|
onKeyDown: (e) => {
|
|
189
|
-
|
|
197
|
+
se(e), m?.onKeyDown?.(e);
|
|
190
198
|
},
|
|
191
|
-
className:
|
|
192
|
-
"h-auto overflow-visible
|
|
199
|
+
className: p(
|
|
200
|
+
"bg-d-input border-d-border h-auto overflow-visible shadow-sm",
|
|
193
201
|
m?.className
|
|
194
202
|
),
|
|
195
203
|
shouldFilter: m?.shouldFilter !== void 0 ? m.shouldFilter : !c,
|
|
196
|
-
filter:
|
|
197
|
-
children: [
|
|
198
|
-
/* @__PURE__ */
|
|
204
|
+
filter: ae(),
|
|
205
|
+
children: /* @__PURE__ */ L(me, { open: f, onOpenChange: S, children: [
|
|
206
|
+
/* @__PURE__ */ r(he, { asChild: !0, children: /* @__PURE__ */ r(
|
|
199
207
|
"div",
|
|
200
208
|
{
|
|
201
|
-
|
|
209
|
+
ref: F,
|
|
210
|
+
className: p(
|
|
211
|
+
// asyncSelectTriggerVariants({ size: "default" }),
|
|
202
212
|
"border-d-input ring-offset-d-background focus-within:ring-d-ring min-h-10 rounded-md border text-base focus-within:ring-1 md:text-sm",
|
|
203
213
|
{
|
|
204
214
|
"px-3 py-2": t.length !== 0,
|
|
205
|
-
"cursor-text": !
|
|
206
|
-
"disabled:cursor-not-allowed disabled:opacity-50":
|
|
215
|
+
"cursor-text": !N && t.length !== 0,
|
|
216
|
+
"disabled:cursor-not-allowed disabled:opacity-50": N
|
|
207
217
|
},
|
|
208
218
|
Z
|
|
209
219
|
),
|
|
210
|
-
onClick: () => {
|
|
211
|
-
v || f?.current?.focus();
|
|
212
|
-
},
|
|
213
220
|
children: /* @__PURE__ */ L("div", { className: "relative flex flex-wrap gap-1", children: [
|
|
214
221
|
t.map((e) => /* @__PURE__ */ L(
|
|
215
|
-
|
|
222
|
+
pe,
|
|
216
223
|
{
|
|
217
|
-
className:
|
|
224
|
+
className: p(
|
|
218
225
|
"data-[disabled]:bg-d-secondary-foreground data-[disabled]:text-d-secondary data-[disabled]:hover:bg-d-secondary-foreground",
|
|
219
226
|
"data-[fixed]:bg-d-secondary-foreground data-[fixed]:text-d-secondary data-[fixed]:hover:bg-d-secondary-foreground",
|
|
220
|
-
|
|
227
|
+
B
|
|
221
228
|
),
|
|
222
229
|
"data-fixed": e.fixed,
|
|
223
|
-
"data-disabled":
|
|
230
|
+
"data-disabled": N || void 0,
|
|
224
231
|
children: [
|
|
225
232
|
e.label,
|
|
226
|
-
/* @__PURE__ */
|
|
233
|
+
/* @__PURE__ */ r(
|
|
227
234
|
"button",
|
|
228
235
|
{
|
|
229
236
|
type: "button",
|
|
230
|
-
className:
|
|
237
|
+
className: p(
|
|
231
238
|
"text-d-secondary-foreground ring-offset-d-background focus:ring-d-ring ml-1 rounded-full outline-none focus:ring-1 focus:ring-offset-2",
|
|
232
|
-
(
|
|
239
|
+
(N || e.fixed) && "hidden"
|
|
233
240
|
),
|
|
234
241
|
onKeyDown: (n) => {
|
|
235
|
-
n.key === "Enter" &&
|
|
242
|
+
n.key === "Enter" && M(e);
|
|
236
243
|
},
|
|
237
244
|
onMouseDown: (n) => {
|
|
238
245
|
n.preventDefault(), n.stopPropagation();
|
|
239
246
|
},
|
|
240
|
-
onClick: () =>
|
|
241
|
-
children: /* @__PURE__ */
|
|
247
|
+
onClick: () => M(e),
|
|
248
|
+
children: /* @__PURE__ */ r(Ne, { className: "text-d-secondary-foreground hover:text-d-foreground h-3 w-3 cursor-pointer" })
|
|
242
249
|
}
|
|
243
250
|
)
|
|
244
251
|
]
|
|
245
252
|
},
|
|
246
253
|
e.value
|
|
247
254
|
)),
|
|
248
|
-
/* @__PURE__ */
|
|
249
|
-
|
|
255
|
+
/* @__PURE__ */ r(
|
|
256
|
+
ue.Input,
|
|
250
257
|
{
|
|
251
|
-
...
|
|
252
|
-
ref:
|
|
258
|
+
...O,
|
|
259
|
+
ref: h,
|
|
253
260
|
value: g,
|
|
254
|
-
disabled:
|
|
261
|
+
disabled: N,
|
|
255
262
|
onValueChange: (e) => {
|
|
256
|
-
|
|
263
|
+
K(e), O?.onValueChange?.(e);
|
|
257
264
|
},
|
|
258
265
|
onBlur: (e) => {
|
|
259
|
-
|
|
266
|
+
ne || S(!1), O?.onBlur?.(e);
|
|
260
267
|
},
|
|
261
268
|
onFocus: (e) => {
|
|
262
|
-
|
|
269
|
+
S(!0), O?.onFocus?.(e);
|
|
263
270
|
},
|
|
264
|
-
placeholder:
|
|
265
|
-
className:
|
|
271
|
+
placeholder: U && t.length !== 0 ? "" : i,
|
|
272
|
+
className: p(
|
|
266
273
|
"placeholder:text-d-muted-foreground flex-1 bg-transparent outline-none",
|
|
267
274
|
{
|
|
268
|
-
"w-full":
|
|
275
|
+
"w-full": U,
|
|
269
276
|
"px-3 py-2": t.length === 0,
|
|
270
277
|
"ml-1": t.length !== 0
|
|
271
278
|
},
|
|
272
|
-
|
|
279
|
+
O?.className
|
|
273
280
|
)
|
|
274
281
|
}
|
|
275
282
|
),
|
|
276
|
-
/* @__PURE__ */
|
|
283
|
+
/* @__PURE__ */ r(
|
|
277
284
|
"div",
|
|
278
285
|
{
|
|
279
|
-
className:
|
|
280
|
-
"
|
|
281
|
-
(
|
|
286
|
+
className: p(
|
|
287
|
+
"border-d-input bg-d-accent cursor-pointer rounded-full p-1",
|
|
288
|
+
(ee || N || t.length < 1 || t.filter((e) => e.fixed).length === t.length) && "hidden"
|
|
282
289
|
),
|
|
283
290
|
onClick: () => {
|
|
284
|
-
|
|
291
|
+
y(t.filter((e) => e.fixed)), l?.(t.filter((e) => e.fixed));
|
|
285
292
|
},
|
|
286
293
|
"aria-label": "Clear selection",
|
|
287
|
-
children: /* @__PURE__ */
|
|
294
|
+
children: /* @__PURE__ */ r(
|
|
295
|
+
we,
|
|
296
|
+
{
|
|
297
|
+
name: "X",
|
|
298
|
+
size: "xs",
|
|
299
|
+
className: "!text-d-foreground opacity-50"
|
|
300
|
+
}
|
|
301
|
+
)
|
|
288
302
|
}
|
|
289
303
|
)
|
|
290
304
|
] })
|
|
291
305
|
}
|
|
292
|
-
),
|
|
293
|
-
/* @__PURE__ */
|
|
294
|
-
|
|
306
|
+
) }),
|
|
307
|
+
/* @__PURE__ */ r(
|
|
308
|
+
ge,
|
|
295
309
|
{
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
children: /* @__PURE__ */ o(
|
|
302
|
-
me,
|
|
310
|
+
className: "border-none p-0 shadow-lg",
|
|
311
|
+
style: { width: re },
|
|
312
|
+
onWheel: (e) => e.stopPropagation(),
|
|
313
|
+
children: /* @__PURE__ */ r(q, { shouldFilter: !1, className: "w-full", children: /* @__PURE__ */ r(
|
|
314
|
+
ve,
|
|
303
315
|
{
|
|
304
316
|
className: "bg-d-popover text-d-popover-foreground animate-in border-d-border w-full rounded-md border shadow-md outline-none",
|
|
305
317
|
onMouseLeave: () => {
|
|
306
|
-
|
|
318
|
+
z(!1);
|
|
307
319
|
},
|
|
308
320
|
onMouseEnter: () => {
|
|
309
|
-
|
|
321
|
+
z(!0);
|
|
310
322
|
},
|
|
311
323
|
onMouseUp: () => {
|
|
312
|
-
|
|
324
|
+
h?.current?.focus();
|
|
313
325
|
},
|
|
314
|
-
children: H ? /* @__PURE__ */
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
!
|
|
318
|
-
Object.entries(
|
|
319
|
-
|
|
326
|
+
children: H ? /* @__PURE__ */ r(G, { children: Y }) : /* @__PURE__ */ L(G, { children: [
|
|
327
|
+
ie(),
|
|
328
|
+
le(),
|
|
329
|
+
!P && /* @__PURE__ */ r(I, { value: "-", className: "hidden" }),
|
|
330
|
+
Object.entries(de).map(([e, n]) => /* @__PURE__ */ r(
|
|
331
|
+
be,
|
|
320
332
|
{
|
|
321
333
|
heading: e,
|
|
322
334
|
className: "h-full overflow-auto",
|
|
323
|
-
children: /* @__PURE__ */
|
|
324
|
-
|
|
335
|
+
children: /* @__PURE__ */ r(G, { children: n.map((d) => /* @__PURE__ */ r(
|
|
336
|
+
I,
|
|
325
337
|
{
|
|
326
|
-
value:
|
|
327
|
-
disabled:
|
|
328
|
-
onMouseDown: (
|
|
329
|
-
|
|
338
|
+
value: d.label,
|
|
339
|
+
disabled: d.disable,
|
|
340
|
+
onMouseDown: (k) => {
|
|
341
|
+
k.preventDefault(), k.stopPropagation();
|
|
330
342
|
},
|
|
331
343
|
onSelect: () => {
|
|
332
344
|
if (t.length >= _) {
|
|
333
|
-
|
|
345
|
+
A?.(t.length);
|
|
334
346
|
return;
|
|
335
347
|
}
|
|
336
|
-
|
|
337
|
-
const
|
|
338
|
-
|
|
348
|
+
K("");
|
|
349
|
+
const k = [...t, d];
|
|
350
|
+
y(k), l?.(k);
|
|
339
351
|
},
|
|
340
|
-
className:
|
|
352
|
+
className: p(
|
|
341
353
|
"cursor-pointer",
|
|
342
|
-
|
|
354
|
+
d.disable && "text-d-secondary-foreground cursor-default"
|
|
343
355
|
),
|
|
344
|
-
children:
|
|
356
|
+
children: d.label
|
|
345
357
|
},
|
|
346
|
-
|
|
358
|
+
d.value
|
|
347
359
|
)) })
|
|
348
360
|
},
|
|
349
361
|
e
|
|
350
362
|
))
|
|
351
363
|
] })
|
|
352
364
|
}
|
|
353
|
-
)
|
|
365
|
+
) })
|
|
354
366
|
}
|
|
355
367
|
)
|
|
356
|
-
]
|
|
368
|
+
] })
|
|
357
369
|
}
|
|
358
370
|
)
|
|
359
371
|
] });
|
|
360
372
|
}
|
|
361
373
|
);
|
|
362
|
-
|
|
374
|
+
Oe.displayName = "MultipleSelector";
|
|
363
375
|
export {
|
|
364
|
-
|
|
365
|
-
|
|
376
|
+
Oe as MultipleSelector,
|
|
377
|
+
ye as useDebounce
|
|
366
378
|
};
|
|
@@ -57,7 +57,7 @@ function k({
|
|
|
57
57
|
);
|
|
58
58
|
}
|
|
59
59
|
const w = f(
|
|
60
|
-
"group inline-flex h-9 w-max items-center justify-center rounded-md bg-d-background px-4 py-2 text-sm font-medium hover:bg-d-accent hover:text-d-accent-foreground focus:bg-d-accent focus:text-d-accent-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=open]:hover:bg-d-accent data-[state=open]:text-d-accent-foreground data-[state=open]:focus:bg-d-accent data-[state=open]:bg-d-accent
|
|
60
|
+
"group inline-flex h-9 w-max items-center justify-center rounded-md bg-d-background px-4 py-2 text-sm font-medium hover:bg-d-accent hover:text-d-accent-foreground focus:bg-d-accent focus:text-d-accent-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=open]:hover:bg-d-accent data-[state=open]:text-d-accent-foreground data-[state=open]:focus:bg-d-accent data-[state=open]:bg-d-accent focus-visible:ring-d-ring/50 outline-none transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1"
|
|
61
61
|
);
|
|
62
62
|
function I({
|
|
63
63
|
className: t,
|
|
@@ -134,7 +134,7 @@ function C({
|
|
|
134
134
|
{
|
|
135
135
|
"data-slot": "navigation-menu-link",
|
|
136
136
|
className: o(
|
|
137
|
-
"data-[active=true]:focus:bg-d-accent data-[active=true]:hover:bg-d-accent data-[active=true]:bg-d-accent
|
|
137
|
+
"data-[active=true]:focus:bg-d-accent data-[active=true]:hover:bg-d-accent data-[active=true]:bg-d-accent data-[active=true]:text-d-accent-foreground hover:bg-d-accent hover:text-d-accent-foreground focus:bg-d-accent focus:text-d-accent-foreground focus-visible:ring-d-ring/50 [&_svg:not([class*='text-'])]:text-d-secondary-foreground flex flex-col gap-1 rounded-sm p-2 text-sm transition-all outline-none focus-visible:ring-[3px] focus-visible:outline-1 [&_svg:not([class*='size-'])]:size-4",
|
|
138
138
|
t
|
|
139
139
|
),
|
|
140
140
|
...a
|
|
@@ -73,7 +73,7 @@ function J({
|
|
|
73
73
|
{
|
|
74
74
|
"data-slot": "select-content",
|
|
75
75
|
className: o(
|
|
76
|
-
"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 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",
|
|
76
|
+
"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",
|
|
77
77
|
s === "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",
|
|
78
78
|
t
|
|
79
79
|
),
|
|
@@ -3,18 +3,18 @@ import { jsx as e } from "react/jsx-runtime";
|
|
|
3
3
|
import { Root as d, Thumb as n } from "../../node_modules/@radix-ui/react-switch/dist/index.js";
|
|
4
4
|
import { cn as t } from "../../lib/utils.js";
|
|
5
5
|
function c({
|
|
6
|
-
className:
|
|
7
|
-
...
|
|
6
|
+
className: r,
|
|
7
|
+
...a
|
|
8
8
|
}) {
|
|
9
9
|
return /* @__PURE__ */ e(
|
|
10
10
|
d,
|
|
11
11
|
{
|
|
12
12
|
"data-slot": "switch",
|
|
13
13
|
className: t(
|
|
14
|
-
"peer data-[state=checked]:bg-d-primary data-[state=unchecked]:bg-d-input focus-visible:border-d-ring focus-visible:ring-d-ring/50 dark:data-[state=unchecked]:bg-d-
|
|
15
|
-
|
|
14
|
+
"peer data-[state=checked]:bg-d-primary data-[state=unchecked]:bg-d-input focus-visible:border-d-ring focus-visible:ring-d-ring/50 dark:data-[state=unchecked]:bg-d-foreground/20 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
|
|
15
|
+
r
|
|
16
16
|
),
|
|
17
|
-
...
|
|
17
|
+
...a,
|
|
18
18
|
children: /* @__PURE__ */ e(
|
|
19
19
|
n,
|
|
20
20
|
{
|