@shlinkio/shlink-frontend-kit 1.2.1 → 1.3.0
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/index.d.ts +41 -0
- package/dist/index.js +507 -506
- package/package.json +17 -16
package/dist/index.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { jsxs as g, jsx as
|
|
1
|
+
import { jsxs as g, jsx as a, Fragment as B } from "react/jsx-runtime";
|
|
2
2
|
import { clsx as d } from "clsx";
|
|
3
|
-
import { useRef as
|
|
4
|
-
import { Link as
|
|
5
|
-
import { faClose as Ne, faEyeSlash as Ce, faEye as Te, faCircleNotch as
|
|
6
|
-
import { FontAwesomeIcon as
|
|
7
|
-
import { useFloating as
|
|
3
|
+
import { useRef as C, useState as L, useEffect as R, forwardRef as k, useCallback as w, createContext as K, useContext as E, useId as S, useImperativeHandle as we, useMemo as P } from "react";
|
|
4
|
+
import { Link as W, useNavigate as ke, useLocation as oe, NavLink as ve } from "react-router";
|
|
5
|
+
import { faClose as Ne, faEyeSlash as Ce, faEye as Te, faCircleNotch as ae, faSearch as Ae, faCheck as Ie, faCaretDown as Oe, faChevronUp as Re, faChevronDown as Le, faChevronLeft as ee, faChevronRight as te, faEllipsisV as Pe, faSortAmountUp as Ee, faSortAmountDown as Se } from "@fortawesome/free-solid-svg-icons";
|
|
6
|
+
import { FontAwesomeIcon as N } from "@fortawesome/react-fontawesome";
|
|
7
|
+
import { useFloating as se, flip as De, offset as Me, useClick as _e, useInteractions as le, autoPlacement as Fe, arrow as Be, useHover as He, useTransitionStyles as $e } from "@floating-ui/react";
|
|
8
8
|
import { faClone as je } from "@fortawesome/free-regular-svg-icons";
|
|
9
9
|
import { createPortal as Ue } from "react-dom";
|
|
10
|
-
const
|
|
11
|
-
const
|
|
10
|
+
const tr = ({ children: e, summary: r, summaryClasses: t, ...n }) => {
|
|
11
|
+
const o = C(null), [s, l] = L(!1);
|
|
12
12
|
return R(() => {
|
|
13
|
-
const i =
|
|
13
|
+
const i = o.current, c = () => l(!!i?.open);
|
|
14
14
|
return i?.addEventListener("toggle", c), () => i?.removeEventListener("toggle", c);
|
|
15
|
-
}, []), /* @__PURE__ */ g("details", { ref:
|
|
16
|
-
/* @__PURE__ */
|
|
17
|
-
s && /* @__PURE__ */
|
|
15
|
+
}, []), /* @__PURE__ */ g("details", { ref: o, ...n, children: [
|
|
16
|
+
/* @__PURE__ */ a("summary", { className: d("focus-ring px-1 -mx-1 rounded-sm", t), children: r }),
|
|
17
|
+
s && /* @__PURE__ */ a("div", { className: "mt-3 flex flex-col gap-y-3", children: e })
|
|
18
18
|
] });
|
|
19
|
-
}, Ge =
|
|
19
|
+
}, Ge = k(({ className: e, ...r }, t) => /* @__PURE__ */ a(
|
|
20
20
|
"div",
|
|
21
21
|
{
|
|
22
22
|
className: d(
|
|
@@ -27,7 +27,7 @@ const er = ({ children: e, summary: r, summaryClasses: t, ...n }) => {
|
|
|
27
27
|
...r,
|
|
28
28
|
ref: t
|
|
29
29
|
}
|
|
30
|
-
)), Ke =
|
|
30
|
+
)), Ke = k(({ className: e, ...r }, t) => /* @__PURE__ */ a(
|
|
31
31
|
"div",
|
|
32
32
|
{
|
|
33
33
|
className: d(
|
|
@@ -38,7 +38,7 @@ const er = ({ children: e, summary: r, summaryClasses: t, ...n }) => {
|
|
|
38
38
|
...r,
|
|
39
39
|
ref: t
|
|
40
40
|
}
|
|
41
|
-
)), We =
|
|
41
|
+
)), We = k(({ className: e, ...r }, t) => /* @__PURE__ */ a(
|
|
42
42
|
"div",
|
|
43
43
|
{
|
|
44
44
|
className: d(
|
|
@@ -49,7 +49,7 @@ const er = ({ children: e, summary: r, summaryClasses: t, ...n }) => {
|
|
|
49
49
|
...r,
|
|
50
50
|
ref: t
|
|
51
51
|
}
|
|
52
|
-
)), qe =
|
|
52
|
+
)), qe = k(({ className: e, ...r }, t) => /* @__PURE__ */ a(
|
|
53
53
|
"div",
|
|
54
54
|
{
|
|
55
55
|
className: d(
|
|
@@ -60,19 +60,19 @@ const er = ({ children: e, summary: r, summaryClasses: t, ...n }) => {
|
|
|
60
60
|
...r,
|
|
61
61
|
ref: t
|
|
62
62
|
}
|
|
63
|
-
)),
|
|
64
|
-
const { title:
|
|
63
|
+
)), I = Object.assign(qe, { Body: Ke, Header: Ge, Footer: We }), Qe = k(({ bodyClassName: e, children: r, ...t }, n) => {
|
|
64
|
+
const { title: o, titleSize: s = "md", ...l } = "title" in t ? t : {
|
|
65
65
|
...t,
|
|
66
66
|
title: void 0,
|
|
67
67
|
titleSize: void 0
|
|
68
68
|
};
|
|
69
|
-
return /* @__PURE__ */ g(
|
|
70
|
-
|
|
71
|
-
s === "lg" && /* @__PURE__ */
|
|
72
|
-
s === "md" && /* @__PURE__ */
|
|
73
|
-
s === "sm" && /* @__PURE__ */
|
|
69
|
+
return /* @__PURE__ */ g(I, { ...l, ref: n, children: [
|
|
70
|
+
o && /* @__PURE__ */ g(I.Header, { children: [
|
|
71
|
+
s === "lg" && /* @__PURE__ */ a("h4", { children: o }),
|
|
72
|
+
s === "md" && /* @__PURE__ */ a("h5", { children: o }),
|
|
73
|
+
s === "sm" && /* @__PURE__ */ a("h6", { children: o })
|
|
74
74
|
] }),
|
|
75
|
-
/* @__PURE__ */
|
|
75
|
+
/* @__PURE__ */ a(I.Body, { className: e, children: r })
|
|
76
76
|
] });
|
|
77
77
|
});
|
|
78
78
|
function Ye({
|
|
@@ -80,53 +80,53 @@ function Ye({
|
|
|
80
80
|
items: r,
|
|
81
81
|
onSelectItem: t,
|
|
82
82
|
onActiveItemChange: n,
|
|
83
|
-
renderItem:
|
|
83
|
+
renderItem: o,
|
|
84
84
|
className: s,
|
|
85
85
|
noItemsMessage: l = "No items",
|
|
86
86
|
anchor: i,
|
|
87
87
|
"aria-label": c = "Items",
|
|
88
|
-
...
|
|
88
|
+
...u
|
|
89
89
|
}) {
|
|
90
|
-
const [
|
|
91
|
-
if (
|
|
92
|
-
const [
|
|
93
|
-
n(
|
|
90
|
+
const [b, x] = L(0), f = w((h) => {
|
|
91
|
+
if (x(h), n) {
|
|
92
|
+
const [p, m] = [...r.entries()][h];
|
|
93
|
+
n(p, m);
|
|
94
94
|
}
|
|
95
95
|
}, [r, n]);
|
|
96
96
|
return R(() => {
|
|
97
97
|
const h = i?.current;
|
|
98
98
|
if (!h)
|
|
99
99
|
return;
|
|
100
|
-
const
|
|
101
|
-
["Enter", "ArrowUp", "ArrowDown"].includes(
|
|
100
|
+
const p = (m) => {
|
|
101
|
+
["Enter", "ArrowUp", "ArrowDown"].includes(m.key) && m.preventDefault(), m.key === "ArrowDown" ? f(Math.min(b + 1, r.size - 1)) : m.key === "ArrowUp" ? f(Math.max(b - 1, 0)) : m.key === "Enter" && t([...r.values()][b]);
|
|
102
102
|
};
|
|
103
|
-
return h.addEventListener("keydown",
|
|
104
|
-
}, [
|
|
105
|
-
|
|
103
|
+
return h.addEventListener("keydown", p), () => h.removeEventListener("keydown", p);
|
|
104
|
+
}, [b, i, f, r, t]), /* @__PURE__ */ g(
|
|
105
|
+
I,
|
|
106
106
|
{
|
|
107
107
|
id: e,
|
|
108
108
|
className: d("py-1 flex flex-col", s),
|
|
109
109
|
role: "listbox",
|
|
110
110
|
"aria-orientation": "vertical",
|
|
111
111
|
"aria-label": c,
|
|
112
|
-
...
|
|
112
|
+
...u,
|
|
113
113
|
children: [
|
|
114
|
-
r.size === 0 && /* @__PURE__ */
|
|
115
|
-
[...r.entries()].map(([h,
|
|
114
|
+
r.size === 0 && /* @__PURE__ */ a("i", { role: "option", "aria-disabled": !0, "aria-selected": !1, "data-testid": "no-items", className: "px-2 py-1", children: l }),
|
|
115
|
+
[...r.entries()].map(([h, p], m) => /* @__PURE__ */ a(
|
|
116
116
|
"button",
|
|
117
117
|
{
|
|
118
118
|
id: `${e}_${h}`,
|
|
119
119
|
type: "button",
|
|
120
120
|
role: "option",
|
|
121
|
-
"aria-selected":
|
|
121
|
+
"aria-selected": m === b,
|
|
122
122
|
className: d(
|
|
123
123
|
"px-2 py-1 text-left truncate",
|
|
124
|
-
{ "bg-lm-secondary dark:bg-dm-secondary":
|
|
124
|
+
{ "bg-lm-secondary dark:bg-dm-secondary": m === b }
|
|
125
125
|
),
|
|
126
126
|
tabIndex: -1,
|
|
127
|
-
onClick: () => t(
|
|
128
|
-
onMouseOver: () =>
|
|
129
|
-
children:
|
|
127
|
+
onClick: () => t(p),
|
|
128
|
+
onMouseOver: () => f(m),
|
|
129
|
+
children: o(p)
|
|
130
130
|
},
|
|
131
131
|
h
|
|
132
132
|
))
|
|
@@ -134,9 +134,9 @@ function Ye({
|
|
|
134
134
|
}
|
|
135
135
|
);
|
|
136
136
|
}
|
|
137
|
-
const
|
|
138
|
-
const { responsive: t } =
|
|
139
|
-
return /* @__PURE__ */
|
|
137
|
+
const H = K(void 0), M = K({ responsive: !0, size: "md" }), Xe = ({ children: e, className: r }) => {
|
|
138
|
+
const { responsive: t } = E(M);
|
|
139
|
+
return /* @__PURE__ */ a(H.Provider, { value: { section: "head" }, children: /* @__PURE__ */ a(
|
|
140
140
|
"thead",
|
|
141
141
|
{
|
|
142
142
|
className: d(
|
|
@@ -147,8 +147,8 @@ const j = W(void 0), F = W({ responsive: !0, size: "md" }), Xe = ({ children: e,
|
|
|
147
147
|
}
|
|
148
148
|
) });
|
|
149
149
|
}, Je = ({ children: e, className: r }) => {
|
|
150
|
-
const { responsive: t } =
|
|
151
|
-
return /* @__PURE__ */
|
|
150
|
+
const { responsive: t } = E(M);
|
|
151
|
+
return /* @__PURE__ */ a(H.Provider, { value: { section: "body" }, children: /* @__PURE__ */ a(
|
|
152
152
|
"tbody",
|
|
153
153
|
{
|
|
154
154
|
className: d(
|
|
@@ -159,8 +159,8 @@ const j = W(void 0), F = W({ responsive: !0, size: "md" }), Xe = ({ children: e,
|
|
|
159
159
|
}
|
|
160
160
|
) });
|
|
161
161
|
}, Ze = ({ children: e, className: r }) => {
|
|
162
|
-
const { responsive: t } =
|
|
163
|
-
return /* @__PURE__ */
|
|
162
|
+
const { responsive: t } = E(M);
|
|
163
|
+
return /* @__PURE__ */ a(H.Provider, { value: { section: "footer" }, children: /* @__PURE__ */ a(
|
|
164
164
|
"tfoot",
|
|
165
165
|
{
|
|
166
166
|
className: d(
|
|
@@ -171,8 +171,8 @@ const j = W(void 0), F = W({ responsive: !0, size: "md" }), Xe = ({ children: e,
|
|
|
171
171
|
}
|
|
172
172
|
) });
|
|
173
173
|
}, Ve = ({ children: e, className: r, ...t }) => {
|
|
174
|
-
const
|
|
175
|
-
return /* @__PURE__ */
|
|
174
|
+
const o = E(H)?.section === "body", { responsive: s } = E(M);
|
|
175
|
+
return /* @__PURE__ */ a(
|
|
176
176
|
"tr",
|
|
177
177
|
{
|
|
178
178
|
className: d(
|
|
@@ -180,9 +180,9 @@ const j = W(void 0), F = W({ responsive: !0, size: "md" }), Xe = ({ children: e,
|
|
|
180
180
|
{
|
|
181
181
|
"lg:table-row flex flex-col": s,
|
|
182
182
|
"lg:border-0 border-y-2 border-lm-border dark:border-dm-border": s,
|
|
183
|
-
"hover:bg-lm-primary dark:hover:bg-dm-primary":
|
|
183
|
+
"hover:bg-lm-primary dark:hover:bg-dm-primary": o,
|
|
184
184
|
// Use a different hover bg color depending on the table being inside a card or not
|
|
185
|
-
"group-[&]/card:hover:bg-lm-secondary dark:group-[&]/card:hover:bg-dm-secondary":
|
|
185
|
+
"group-[&]/card:hover:bg-lm-secondary dark:group-[&]/card:hover:bg-dm-secondary": o
|
|
186
186
|
},
|
|
187
187
|
r
|
|
188
188
|
),
|
|
@@ -190,9 +190,9 @@ const j = W(void 0), F = W({ responsive: !0, size: "md" }), Xe = ({ children: e,
|
|
|
190
190
|
children: e
|
|
191
191
|
}
|
|
192
192
|
);
|
|
193
|
-
}, ze = ({ children: e, className: r, columnName: t, type: n, ...
|
|
194
|
-
const s =
|
|
195
|
-
return /* @__PURE__ */
|
|
193
|
+
}, ze = ({ children: e, className: r, columnName: t, type: n, ...o }) => {
|
|
194
|
+
const s = E(H), l = n ?? (s?.section !== "body" ? "th" : "td"), { responsive: i, size: c } = E(M);
|
|
195
|
+
return /* @__PURE__ */ a(
|
|
196
196
|
l,
|
|
197
197
|
{
|
|
198
198
|
"data-column": i ? t : void 0,
|
|
@@ -210,33 +210,33 @@ const j = W(void 0), F = W({ responsive: !0, size: "md" }), Xe = ({ children: e,
|
|
|
210
210
|
},
|
|
211
211
|
r
|
|
212
212
|
),
|
|
213
|
-
...
|
|
213
|
+
...o,
|
|
214
214
|
children: e
|
|
215
215
|
}
|
|
216
216
|
);
|
|
217
|
-
}, et = ({ header: e, footer: r, children: t, responsive: n = !0, size:
|
|
218
|
-
/* @__PURE__ */
|
|
219
|
-
/* @__PURE__ */
|
|
220
|
-
r && /* @__PURE__ */
|
|
221
|
-
] }) }),
|
|
217
|
+
}, et = ({ header: e, footer: r, children: t, responsive: n = !0, size: o = "md", ...s }) => /* @__PURE__ */ a(M.Provider, { value: { responsive: n, size: o }, children: /* @__PURE__ */ g("table", { className: "w-full", ...s, children: [
|
|
218
|
+
/* @__PURE__ */ a(Xe, { children: e }),
|
|
219
|
+
/* @__PURE__ */ a(Je, { children: t }),
|
|
220
|
+
r && /* @__PURE__ */ a(Ze, { children: r })
|
|
221
|
+
] }) }), rr = Object.assign(et, { Row: Ve, Cell: ze }), ie = k(({
|
|
222
222
|
className: e,
|
|
223
223
|
disabled: r,
|
|
224
224
|
variant: t = "primary",
|
|
225
225
|
size: n = "md",
|
|
226
|
-
inline:
|
|
226
|
+
inline: o = !1,
|
|
227
227
|
solid: s = !1,
|
|
228
228
|
type: l = "button",
|
|
229
229
|
...i
|
|
230
230
|
}, c) => {
|
|
231
|
-
const
|
|
232
|
-
return /* @__PURE__ */
|
|
233
|
-
|
|
231
|
+
const u = "to" in i && typeof i.to == "string", b = u ? W : "button", x = u ? void 0 : l;
|
|
232
|
+
return /* @__PURE__ */ a(
|
|
233
|
+
b,
|
|
234
234
|
{
|
|
235
235
|
ref: c,
|
|
236
236
|
className: d(
|
|
237
237
|
{
|
|
238
|
-
"inline-flex":
|
|
239
|
-
flex: !
|
|
238
|
+
"inline-flex": o,
|
|
239
|
+
flex: !o
|
|
240
240
|
},
|
|
241
241
|
"gap-2 items-center justify-center",
|
|
242
242
|
"border rounded-md no-underline",
|
|
@@ -281,15 +281,15 @@ const j = W(void 0), F = W({ responsive: !0, size: "md" }), Xe = ({ children: e,
|
|
|
281
281
|
},
|
|
282
282
|
e
|
|
283
283
|
),
|
|
284
|
-
disabled:
|
|
285
|
-
"aria-disabled":
|
|
286
|
-
type:
|
|
284
|
+
disabled: u ? void 0 : r,
|
|
285
|
+
"aria-disabled": u ? r : void 0,
|
|
286
|
+
type: x,
|
|
287
287
|
...i
|
|
288
288
|
}
|
|
289
289
|
);
|
|
290
|
-
}),
|
|
291
|
-
const
|
|
292
|
-
return /* @__PURE__ */
|
|
290
|
+
}), de = k(({ className: e, onChange: r, ...t }, n) => {
|
|
291
|
+
const o = w((s) => r?.(s.target.checked, s), [r]);
|
|
292
|
+
return /* @__PURE__ */ a(
|
|
293
293
|
"input",
|
|
294
294
|
{
|
|
295
295
|
ref: n,
|
|
@@ -302,18 +302,18 @@ const j = W(void 0), F = W({ responsive: !0, size: "md" }), Xe = ({ children: e,
|
|
|
302
302
|
"group-[&]/card:bg-lm-input group-[&]/card:dark:bg-dm-input",
|
|
303
303
|
e
|
|
304
304
|
),
|
|
305
|
-
onChange:
|
|
305
|
+
onChange: o,
|
|
306
306
|
...t
|
|
307
307
|
}
|
|
308
308
|
);
|
|
309
|
-
}),
|
|
310
|
-
|
|
309
|
+
}), nr = k(({ className: e, ...r }, t) => /* @__PURE__ */ a(
|
|
310
|
+
de,
|
|
311
311
|
{
|
|
312
312
|
ref: t,
|
|
313
313
|
className: d("rounded-sm w-4 h-4 checked:bg-(image:--tick) bg-center", e),
|
|
314
314
|
...r
|
|
315
315
|
}
|
|
316
|
-
)), Y =
|
|
316
|
+
)), Y = k(({ onClick: e, className: r, label: t = "Close", size: n = "lg", solid: o }, s) => /* @__PURE__ */ a(
|
|
317
317
|
"button",
|
|
318
318
|
{
|
|
319
319
|
ref: s,
|
|
@@ -322,22 +322,22 @@ const j = W(void 0), F = W({ responsive: !0, size: "md" }), Xe = ({ children: e,
|
|
|
322
322
|
className: d(
|
|
323
323
|
"rounded-md focus-ring cursor-pointer",
|
|
324
324
|
{
|
|
325
|
-
"opacity-50 highlight:opacity-80 transition-opacity": !
|
|
325
|
+
"opacity-50 highlight:opacity-80 transition-opacity": !o
|
|
326
326
|
},
|
|
327
327
|
r
|
|
328
328
|
),
|
|
329
329
|
"aria-label": t,
|
|
330
|
-
children: /* @__PURE__ */
|
|
330
|
+
children: /* @__PURE__ */ a(N, { icon: Ne, size: n === "lg" ? "xl" : n === "md" ? "lg" : void 0 })
|
|
331
331
|
}
|
|
332
|
-
)), J =
|
|
332
|
+
)), J = k(({
|
|
333
333
|
borderless: e = !1,
|
|
334
334
|
size: r = "md",
|
|
335
335
|
feedback: t,
|
|
336
336
|
variant: n = "default",
|
|
337
|
-
className:
|
|
337
|
+
className: o,
|
|
338
338
|
disabled: s,
|
|
339
339
|
...l
|
|
340
|
-
}, i) => /* @__PURE__ */
|
|
340
|
+
}, i) => /* @__PURE__ */ a(
|
|
341
341
|
"input",
|
|
342
342
|
{
|
|
343
343
|
ref: i,
|
|
@@ -360,17 +360,17 @@ const j = W(void 0), F = W({ responsive: !0, size: "md" }), Xe = ({ children: e,
|
|
|
360
360
|
"group-[&]/card:bg-lm-input group-[&]/card:dark:bg-dm-input": !s
|
|
361
361
|
}
|
|
362
362
|
],
|
|
363
|
-
|
|
363
|
+
o
|
|
364
364
|
),
|
|
365
365
|
disabled: s,
|
|
366
366
|
...l
|
|
367
367
|
}
|
|
368
368
|
)), Z = ({ required: e, children: r, className: t, ...n }) => /* @__PURE__ */ g("label", { className: d("cursor-pointer", t), ...n, children: [
|
|
369
369
|
r,
|
|
370
|
-
e && /* @__PURE__ */
|
|
370
|
+
e && /* @__PURE__ */ a("span", { className: "text-danger ml-1", "data-testid": "required-indicator", children: "*" })
|
|
371
371
|
] }), V = ({ children: e, helpText: r, error: t, "data-testid": n }) => /* @__PURE__ */ g("div", { className: "flex flex-col gap-1", "data-testid": n, children: [
|
|
372
372
|
e,
|
|
373
|
-
r && /* @__PURE__ */
|
|
373
|
+
r && /* @__PURE__ */ a(
|
|
374
374
|
"small",
|
|
375
375
|
{
|
|
376
376
|
"data-testid": n ? `${n}-help-text` : "help-text",
|
|
@@ -378,38 +378,38 @@ const j = W(void 0), F = W({ responsive: !0, size: "md" }), Xe = ({ children: e,
|
|
|
378
378
|
children: r
|
|
379
379
|
}
|
|
380
380
|
),
|
|
381
|
-
t && /* @__PURE__ */
|
|
382
|
-
] }),
|
|
383
|
-
const
|
|
384
|
-
return /* @__PURE__ */ g(V, { error:
|
|
385
|
-
/* @__PURE__ */
|
|
386
|
-
/* @__PURE__ */
|
|
381
|
+
t && /* @__PURE__ */ a("span", { "data-testid": n ? `${n}-error` : "error", className: "text-danger", children: t })
|
|
382
|
+
] }), or = k(({ label: e, inputClassName: r, required: t, hiddenRequired: n, error: o, helpText: s, "data-testid": l, ...i }, c) => {
|
|
383
|
+
const u = S();
|
|
384
|
+
return /* @__PURE__ */ g(V, { error: o, helpText: s, "data-testid": l, children: [
|
|
385
|
+
/* @__PURE__ */ a(Z, { htmlFor: u, required: t, children: e }),
|
|
386
|
+
/* @__PURE__ */ a(
|
|
387
387
|
J,
|
|
388
388
|
{
|
|
389
389
|
ref: c,
|
|
390
|
-
id:
|
|
390
|
+
id: u,
|
|
391
391
|
className: r,
|
|
392
392
|
required: t || n,
|
|
393
|
-
feedback:
|
|
393
|
+
feedback: o ? "error" : void 0,
|
|
394
394
|
...i
|
|
395
395
|
}
|
|
396
396
|
)
|
|
397
397
|
] });
|
|
398
|
-
}), tt =
|
|
399
|
-
const { flag: s, toggle: l, setToFalse: i } = ue(), c =
|
|
400
|
-
c.current?.contains(
|
|
398
|
+
}), tt = k(({ containerClassName: e, className: r, size: t, ...n }, o) => {
|
|
399
|
+
const { flag: s, toggle: l, setToFalse: i } = ue(), c = C(null), u = w(({ relatedTarget: b }) => {
|
|
400
|
+
c.current?.contains(b) || i();
|
|
401
401
|
}, [c, i]);
|
|
402
402
|
return /* @__PURE__ */ g(
|
|
403
403
|
"div",
|
|
404
404
|
{
|
|
405
405
|
className: d("group relative", e),
|
|
406
406
|
ref: c,
|
|
407
|
-
onBlurCapture:
|
|
407
|
+
onBlurCapture: u,
|
|
408
408
|
children: [
|
|
409
|
-
/* @__PURE__ */
|
|
409
|
+
/* @__PURE__ */ a(
|
|
410
410
|
J,
|
|
411
411
|
{
|
|
412
|
-
ref:
|
|
412
|
+
ref: o,
|
|
413
413
|
type: s ? "text" : "password",
|
|
414
414
|
className: d(
|
|
415
415
|
{
|
|
@@ -423,7 +423,7 @@ const j = W(void 0), F = W({ responsive: !0, size: "md" }), Xe = ({ children: e,
|
|
|
423
423
|
...n
|
|
424
424
|
}
|
|
425
425
|
),
|
|
426
|
-
/* @__PURE__ */
|
|
426
|
+
/* @__PURE__ */ a(
|
|
427
427
|
"button",
|
|
428
428
|
{
|
|
429
429
|
type: "button",
|
|
@@ -439,35 +439,35 @@ const j = W(void 0), F = W({ responsive: !0, size: "md" }), Xe = ({ children: e,
|
|
|
439
439
|
}
|
|
440
440
|
),
|
|
441
441
|
tabIndex: -1,
|
|
442
|
-
children: /* @__PURE__ */
|
|
442
|
+
children: /* @__PURE__ */ a(N, { icon: s ? Ce : Te })
|
|
443
443
|
}
|
|
444
444
|
)
|
|
445
445
|
]
|
|
446
446
|
}
|
|
447
447
|
);
|
|
448
|
-
}),
|
|
449
|
-
const
|
|
450
|
-
return /* @__PURE__ */ g(V, { error:
|
|
451
|
-
/* @__PURE__ */
|
|
452
|
-
/* @__PURE__ */
|
|
448
|
+
}), ar = k(({ label: e, inputClassName: r, required: t, hiddenRequired: n, error: o, helpText: s, "data-testid": l, ...i }, c) => {
|
|
449
|
+
const u = S();
|
|
450
|
+
return /* @__PURE__ */ g(V, { error: o, helpText: s, "data-testid": l, children: [
|
|
451
|
+
/* @__PURE__ */ a(Z, { htmlFor: u, required: t, children: e }),
|
|
452
|
+
/* @__PURE__ */ a(
|
|
453
453
|
tt,
|
|
454
454
|
{
|
|
455
455
|
ref: c,
|
|
456
|
-
id:
|
|
456
|
+
id: u,
|
|
457
457
|
className: r,
|
|
458
458
|
required: t || n,
|
|
459
|
-
feedback:
|
|
459
|
+
feedback: o ? "error" : void 0,
|
|
460
460
|
...i
|
|
461
461
|
}
|
|
462
462
|
)
|
|
463
463
|
] });
|
|
464
|
-
}), rt =
|
|
464
|
+
}), rt = k(({
|
|
465
465
|
className: e,
|
|
466
466
|
size: r = "md",
|
|
467
467
|
feedback: t,
|
|
468
468
|
disabled: n,
|
|
469
|
-
...
|
|
470
|
-
}, s) => /* @__PURE__ */
|
|
469
|
+
...o
|
|
470
|
+
}, s) => /* @__PURE__ */ a(
|
|
471
471
|
"select",
|
|
472
472
|
{
|
|
473
473
|
ref: s,
|
|
@@ -489,44 +489,44 @@ const j = W(void 0), F = W({ responsive: !0, size: "md" }), Xe = ({ children: e,
|
|
|
489
489
|
e
|
|
490
490
|
),
|
|
491
491
|
disabled: n,
|
|
492
|
-
...
|
|
492
|
+
...o
|
|
493
493
|
}
|
|
494
|
-
)),
|
|
495
|
-
const
|
|
494
|
+
)), sr = k(({ selectClassName: e, label: r, error: t, helpText: n, required: o, hiddenRequired: s, "data-testid": l, ...i }, c) => {
|
|
495
|
+
const u = S();
|
|
496
496
|
return /* @__PURE__ */ g(V, { error: t, helpText: n, "data-testid": l, children: [
|
|
497
|
-
/* @__PURE__ */
|
|
498
|
-
/* @__PURE__ */
|
|
497
|
+
/* @__PURE__ */ a(Z, { htmlFor: u, required: o, children: r }),
|
|
498
|
+
/* @__PURE__ */ a(
|
|
499
499
|
rt,
|
|
500
500
|
{
|
|
501
501
|
ref: c,
|
|
502
|
-
id:
|
|
502
|
+
id: u,
|
|
503
503
|
className: e,
|
|
504
|
-
required:
|
|
504
|
+
required: o || s,
|
|
505
505
|
feedback: t ? "error" : void 0,
|
|
506
506
|
...i
|
|
507
507
|
}
|
|
508
508
|
)
|
|
509
509
|
] });
|
|
510
|
-
}), nt =
|
|
510
|
+
}), nt = k(({
|
|
511
511
|
onChange: e,
|
|
512
512
|
containerClassName: r,
|
|
513
513
|
inputClassName: t,
|
|
514
514
|
// Inputs have a default 'md' size. Search inputs are usually 'lg' as they are rendered at the top of sections
|
|
515
515
|
size: n = "lg",
|
|
516
|
-
loading:
|
|
516
|
+
loading: o = !1,
|
|
517
517
|
variant: s = "default",
|
|
518
518
|
immediate: l = !1,
|
|
519
519
|
...i
|
|
520
520
|
}, c) => {
|
|
521
|
-
const { setTimeout:
|
|
522
|
-
!
|
|
523
|
-
}, [
|
|
521
|
+
const { setTimeout: u, clearCurrentTimeout: b } = me(500), x = w((f) => {
|
|
522
|
+
!f || l ? (b(), e(f)) : u(() => e(f));
|
|
523
|
+
}, [b, l, e, u]);
|
|
524
524
|
return /* @__PURE__ */ g("div", { className: d("group relative focus-within:z-10", r), children: [
|
|
525
|
-
s === "default" && /* @__PURE__ */
|
|
526
|
-
|
|
525
|
+
s === "default" && /* @__PURE__ */ a(
|
|
526
|
+
N,
|
|
527
527
|
{
|
|
528
|
-
icon:
|
|
529
|
-
spin:
|
|
528
|
+
icon: o ? ae : Ae,
|
|
529
|
+
spin: o,
|
|
530
530
|
className: d(
|
|
531
531
|
"absolute top-[50%] translate-y-[-50%] transition-colors",
|
|
532
532
|
"text-placeholder group-focus-within:text-lm-text dark:group-focus-within:text-dm-text",
|
|
@@ -537,7 +537,7 @@ const j = W(void 0), F = W({ responsive: !0, size: "md" }), Xe = ({ children: e,
|
|
|
537
537
|
)
|
|
538
538
|
}
|
|
539
539
|
),
|
|
540
|
-
/* @__PURE__ */
|
|
540
|
+
/* @__PURE__ */ a(
|
|
541
541
|
J,
|
|
542
542
|
{
|
|
543
543
|
ref: c,
|
|
@@ -551,7 +551,7 @@ const j = W(void 0), F = W({ responsive: !0, size: "md" }), Xe = ({ children: e,
|
|
|
551
551
|
t
|
|
552
552
|
),
|
|
553
553
|
placeholder: "Search...",
|
|
554
|
-
onChange: (
|
|
554
|
+
onChange: (f) => x(f.target.value),
|
|
555
555
|
size: n,
|
|
556
556
|
...i
|
|
557
557
|
}
|
|
@@ -563,22 +563,22 @@ function ot({
|
|
|
563
563
|
onSearch: r,
|
|
564
564
|
onSelectSearchResult: t,
|
|
565
565
|
renderSearchResult: n,
|
|
566
|
-
size:
|
|
566
|
+
size: o = "md",
|
|
567
567
|
// SearchInput defaults its size to 'lg'. Change it to 'md'
|
|
568
568
|
listboxSpan: s = "full",
|
|
569
569
|
onFocus: l,
|
|
570
570
|
containerClassName: i,
|
|
571
571
|
listboxClassName: c,
|
|
572
|
-
...
|
|
573
|
-
},
|
|
574
|
-
const
|
|
575
|
-
we(
|
|
576
|
-
const
|
|
577
|
-
() => e ?
|
|
578
|
-
[
|
|
579
|
-
),
|
|
580
|
-
t(y), r(""),
|
|
581
|
-
}, [r, t,
|
|
572
|
+
...u
|
|
573
|
+
}, b) {
|
|
574
|
+
const x = S(), [f, h] = L(), p = C(null);
|
|
575
|
+
we(b, () => p.current);
|
|
576
|
+
const m = P(
|
|
577
|
+
() => e ? f ?? [...e.keys()][0] : void 0,
|
|
578
|
+
[f, e]
|
|
579
|
+
), v = w((y) => {
|
|
580
|
+
t(y), r(""), p.current.value = "";
|
|
581
|
+
}, [r, t, p]);
|
|
582
582
|
return /* @__PURE__ */ g(
|
|
583
583
|
"div",
|
|
584
584
|
{
|
|
@@ -587,32 +587,32 @@ function ot({
|
|
|
587
587
|
y.currentTarget.contains(y.relatedTarget) || r("");
|
|
588
588
|
},
|
|
589
589
|
children: [
|
|
590
|
-
/* @__PURE__ */
|
|
590
|
+
/* @__PURE__ */ a(
|
|
591
591
|
nt,
|
|
592
592
|
{
|
|
593
593
|
onChange: r,
|
|
594
|
-
size:
|
|
595
|
-
ref:
|
|
594
|
+
size: o,
|
|
595
|
+
ref: p,
|
|
596
596
|
role: "combobox",
|
|
597
597
|
"aria-autocomplete": "list",
|
|
598
598
|
"aria-expanded": !!e,
|
|
599
|
-
"aria-controls":
|
|
600
|
-
"aria-activedescendant":
|
|
599
|
+
"aria-controls": x,
|
|
600
|
+
"aria-activedescendant": m ? `${x}_${m}` : void 0,
|
|
601
601
|
autoComplete: "off",
|
|
602
602
|
autoCorrect: "off",
|
|
603
603
|
onFocus: (y) => {
|
|
604
604
|
l?.(y), r(y.target.value);
|
|
605
605
|
},
|
|
606
|
-
...
|
|
606
|
+
...u
|
|
607
607
|
}
|
|
608
608
|
),
|
|
609
|
-
e && /* @__PURE__ */
|
|
609
|
+
e && /* @__PURE__ */ a(
|
|
610
610
|
Ye,
|
|
611
611
|
{
|
|
612
|
-
id:
|
|
612
|
+
id: x,
|
|
613
613
|
items: e,
|
|
614
|
-
anchor:
|
|
615
|
-
onSelectItem:
|
|
614
|
+
anchor: p,
|
|
615
|
+
onSelectItem: v,
|
|
616
616
|
onActiveItemChange: h,
|
|
617
617
|
renderItem: n,
|
|
618
618
|
className: d(
|
|
@@ -631,8 +631,8 @@ function ot({
|
|
|
631
631
|
}
|
|
632
632
|
);
|
|
633
633
|
}
|
|
634
|
-
const at =
|
|
635
|
-
/* @__PURE__ */
|
|
634
|
+
const at = k(ot), st = ({ name: e, color: r }) => /* @__PURE__ */ g("div", { className: "inline-flex items-center gap-2", children: [
|
|
635
|
+
/* @__PURE__ */ a("div", { "aria-hidden": !0, className: "w-4 h-4 rounded-full", style: { backgroundColor: r } }),
|
|
636
636
|
e
|
|
637
637
|
] }), lt = ({ tag: e, color: r, size: t, onRemove: n }) => (
|
|
638
638
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
|
|
@@ -649,47 +649,34 @@ const at = v(ot), st = ({ name: e, color: r }) => /* @__PURE__ */ g("div", { cla
|
|
|
649
649
|
),
|
|
650
650
|
style: {
|
|
651
651
|
backgroundColor: r,
|
|
652
|
-
color:
|
|
652
|
+
color: ct(r) ? "#000" : "#fff"
|
|
653
653
|
},
|
|
654
|
-
onClick: (
|
|
654
|
+
onClick: (o) => o.stopPropagation(),
|
|
655
655
|
children: [
|
|
656
656
|
e,
|
|
657
|
-
/* @__PURE__ */
|
|
657
|
+
/* @__PURE__ */ a(Y, { label: `Remove ${e}`, solid: !0, size: "sm", onClick: () => n(e) })
|
|
658
658
|
]
|
|
659
659
|
}
|
|
660
660
|
)
|
|
661
|
-
),
|
|
661
|
+
), re = "#99a1af", lr = ({
|
|
662
662
|
tags: e,
|
|
663
663
|
selectedTags: r = [],
|
|
664
664
|
onTagsChange: t,
|
|
665
665
|
getColorForTag: n,
|
|
666
|
-
searchMode:
|
|
666
|
+
searchMode: o = "startsWith",
|
|
667
667
|
immutable: s = !1,
|
|
668
668
|
size: l = "md",
|
|
669
669
|
disabled: i,
|
|
670
670
|
containerClassName: c,
|
|
671
|
-
...
|
|
671
|
+
...u
|
|
672
672
|
}) => {
|
|
673
|
-
const
|
|
674
|
-
const y =
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
}
|
|
679
|
-
const A = e.filter((N) => {
|
|
680
|
-
if (r.includes(N))
|
|
681
|
-
return !1;
|
|
682
|
-
const D = N.toLowerCase();
|
|
683
|
-
return a === "startsWith" ? D.startsWith(y) : D.includes(y);
|
|
684
|
-
}).slice(0, 5);
|
|
685
|
-
s || A.push(`Add "${y.split(",").map(ne).join(",")}" tag`), w(new Map(A.map((N) => [N, N])));
|
|
686
|
-
}, [s, a, r, e]), h = k((b) => {
|
|
687
|
-
const A = (b.match(/Add\s+"([^"]+)"\s+tag/)?.[1] ?? b).split(",").map(ne);
|
|
688
|
-
t?.([.../* @__PURE__ */ new Set([...r, ...A])]);
|
|
689
|
-
}, [t, r]), u = k(
|
|
690
|
-
(b) => t?.(r.filter((y) => y !== b)),
|
|
673
|
+
const { searchResults: b, onSearch: x } = yt({ tags: e, selectedTags: r, searchMode: o, allowAdding: !s }), f = w((m) => {
|
|
674
|
+
const y = (m.match(/Add\s+"([^"]+)"\s+tag/)?.[1] ?? m).split(",").map(ce);
|
|
675
|
+
t?.([.../* @__PURE__ */ new Set([...r, ...y])]);
|
|
676
|
+
}, [t, r]), h = w(
|
|
677
|
+
(m) => t?.(r.filter((v) => v !== m)),
|
|
691
678
|
[t, r]
|
|
692
|
-
), p =
|
|
679
|
+
), p = C(null);
|
|
693
680
|
return (
|
|
694
681
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
|
|
695
682
|
/* @__PURE__ */ g(
|
|
@@ -710,15 +697,15 @@ const at = v(ot), st = ({ name: e, color: r }) => /* @__PURE__ */ g("div", { cla
|
|
|
710
697
|
},
|
|
711
698
|
c
|
|
712
699
|
),
|
|
713
|
-
onClick: (
|
|
714
|
-
|
|
700
|
+
onClick: (m) => {
|
|
701
|
+
m.target !== p.current && p.current?.focus();
|
|
715
702
|
},
|
|
716
703
|
children: [
|
|
717
|
-
/* @__PURE__ */
|
|
718
|
-
const
|
|
719
|
-
return /* @__PURE__ */
|
|
704
|
+
/* @__PURE__ */ a("ul", { className: "m-0 p-0 flex flex-wrap gap-1", children: r.map((m, v) => {
|
|
705
|
+
const y = n?.(m) ?? re;
|
|
706
|
+
return /* @__PURE__ */ a(lt, { tag: m, color: y, onRemove: h, size: l }, `${m}${v}`);
|
|
720
707
|
}) }),
|
|
721
|
-
/* @__PURE__ */
|
|
708
|
+
/* @__PURE__ */ a(
|
|
722
709
|
at,
|
|
723
710
|
{
|
|
724
711
|
variant: "unstyled",
|
|
@@ -733,26 +720,26 @@ const at = v(ot), st = ({ name: e, color: r }) => /* @__PURE__ */ g("div", { cla
|
|
|
733
720
|
"px-3 text-xl": l === "lg"
|
|
734
721
|
}
|
|
735
722
|
),
|
|
736
|
-
searchResults:
|
|
723
|
+
searchResults: b,
|
|
737
724
|
onSearch: x,
|
|
738
|
-
onSelectSearchResult:
|
|
739
|
-
renderSearchResult: (
|
|
740
|
-
onKeyDown: (
|
|
741
|
-
|
|
725
|
+
onSelectSearchResult: f,
|
|
726
|
+
renderSearchResult: (m) => m.match(/Add\s+"([^"]+)"\s+tag/) ? m : /* @__PURE__ */ a(st, { name: m, color: n?.(m) ?? re }),
|
|
727
|
+
onKeyDown: (m) => {
|
|
728
|
+
m.key === "Backspace" && !b && h(r[r.length - 1]);
|
|
742
729
|
},
|
|
743
730
|
size: l,
|
|
744
731
|
disabled: i,
|
|
745
732
|
ref: p,
|
|
746
733
|
immediate: !0,
|
|
747
|
-
...
|
|
734
|
+
...u
|
|
748
735
|
}
|
|
749
736
|
)
|
|
750
737
|
]
|
|
751
738
|
}
|
|
752
739
|
)
|
|
753
740
|
);
|
|
754
|
-
},
|
|
755
|
-
|
|
741
|
+
}, ir = k(({ className: e, ...r }, t) => /* @__PURE__ */ a(
|
|
742
|
+
de,
|
|
756
743
|
{
|
|
757
744
|
ref: t,
|
|
758
745
|
className: d(
|
|
@@ -765,47 +752,47 @@ const at = v(ot), st = ({ name: e, color: r }) => /* @__PURE__ */ g("div", { cla
|
|
|
765
752
|
...r
|
|
766
753
|
}
|
|
767
754
|
));
|
|
768
|
-
function
|
|
769
|
-
const s =
|
|
755
|
+
function it(e, { elementsSelector: r, focusFirstItem: t = !1, vertical: n = !0, horizontal: o = !0 }) {
|
|
756
|
+
const s = P(() => {
|
|
770
757
|
const c = [];
|
|
771
|
-
return n && c.push("ArrowDown"),
|
|
772
|
-
}, [
|
|
758
|
+
return n && c.push("ArrowDown"), o && c.push("ArrowRight"), c;
|
|
759
|
+
}, [o, n]), l = P(() => {
|
|
773
760
|
const c = [];
|
|
774
|
-
return n && c.push("ArrowUp"),
|
|
775
|
-
}, [
|
|
761
|
+
return n && c.push("ArrowUp"), o && c.push("ArrowLeft"), c;
|
|
762
|
+
}, [o, n]), i = P(() => [...s, ...l], [s, l]);
|
|
776
763
|
R(() => {
|
|
777
764
|
const c = e.current;
|
|
778
765
|
if (!c)
|
|
779
766
|
return () => {
|
|
780
767
|
};
|
|
781
|
-
const
|
|
782
|
-
return
|
|
783
|
-
h.tabIndex =
|
|
768
|
+
const u = new AbortController(), b = () => [...c.querySelectorAll(r)], x = b(), f = Math.max(x.findIndex((h) => h.dataset.selected === "true"), 0);
|
|
769
|
+
return x.forEach((h, p) => {
|
|
770
|
+
h.tabIndex = p === f ? 0 : -1, t && p === f && h.focus();
|
|
784
771
|
}), c.addEventListener("keydown", (h) => {
|
|
785
772
|
if (!i.includes(h.key))
|
|
786
773
|
return;
|
|
787
774
|
h.preventDefault();
|
|
788
|
-
const
|
|
789
|
-
|
|
775
|
+
const p = b(), m = p.findIndex((y) => y.tabIndex === 0), v = s.includes(h.key) ? p[m + 1] ?? p[0] : p[m - 1] ?? p[p.length - 1];
|
|
776
|
+
p.forEach((y) => {
|
|
790
777
|
y.tabIndex = -1;
|
|
791
|
-
}),
|
|
792
|
-
}, { signal:
|
|
778
|
+
}), v.tabIndex = 0, v.focus();
|
|
779
|
+
}, { signal: u.signal }), () => u.abort();
|
|
793
780
|
}, [i, e, r, t, s]);
|
|
794
781
|
}
|
|
795
|
-
const
|
|
782
|
+
const dr = () => {
|
|
796
783
|
const e = ke();
|
|
797
|
-
return
|
|
798
|
-
},
|
|
799
|
-
function
|
|
784
|
+
return w(() => e(-1), [e]);
|
|
785
|
+
}, dt = 128;
|
|
786
|
+
function ct(e) {
|
|
800
787
|
const [r, t, n] = (e.match(/../g) ?? []).map((s) => parseInt(s, 16) || 0);
|
|
801
|
-
return Math.round(Math.sqrt(0.299 * r ** 2 + 0.587 * t ** 2 + 0.114 * n ** 2)) >=
|
|
788
|
+
return Math.round(Math.sqrt(0.299 * r ** 2 + 0.587 * t ** 2 + 0.114 * n ** 2)) >= dt;
|
|
802
789
|
}
|
|
803
|
-
const
|
|
804
|
-
const [l, i] =
|
|
805
|
-
() =>
|
|
806
|
-
[
|
|
790
|
+
const cr = ({ text: e, className: r, size: t = "lg", initialCopied: n = !1, navigator_: o = globalThis.navigator, ...s }) => {
|
|
791
|
+
const [l, i] = kt({ initialValue: n }), c = w(
|
|
792
|
+
() => o.clipboard.writeText(e).then(i),
|
|
793
|
+
[o.clipboard, e, i]
|
|
807
794
|
);
|
|
808
|
-
return /* @__PURE__ */
|
|
795
|
+
return /* @__PURE__ */ a(
|
|
809
796
|
"button",
|
|
810
797
|
{
|
|
811
798
|
type: "button",
|
|
@@ -822,55 +809,73 @@ const dr = ({ text: e, className: r, size: t = "lg", initialCopied: n = !1, navi
|
|
|
822
809
|
title: "Copy to clipboard",
|
|
823
810
|
onClick: c,
|
|
824
811
|
...s,
|
|
825
|
-
children: /* @__PURE__ */
|
|
812
|
+
children: /* @__PURE__ */ a(N, { icon: l ? Ie : je })
|
|
826
813
|
}
|
|
827
814
|
);
|
|
828
|
-
},
|
|
815
|
+
}, mt = (e) => {
|
|
829
816
|
const r = new URLSearchParams(e), t = {};
|
|
830
|
-
return r.forEach((n,
|
|
831
|
-
if (
|
|
832
|
-
const s =
|
|
817
|
+
return r.forEach((n, o) => {
|
|
818
|
+
if (o.endsWith("[]")) {
|
|
819
|
+
const s = o.slice(0, -2);
|
|
833
820
|
t[s] ??= [], t[s].push(n);
|
|
834
821
|
} else
|
|
835
|
-
t[
|
|
822
|
+
t[o] = n;
|
|
836
823
|
}), t;
|
|
837
|
-
},
|
|
824
|
+
}, mr = (e) => {
|
|
838
825
|
const r = new URLSearchParams();
|
|
839
826
|
for (const [t, n] of Object.entries(e))
|
|
840
|
-
n !== void 0 && (Array.isArray(n) ? n.forEach((
|
|
827
|
+
n !== void 0 && (Array.isArray(n) ? n.forEach((o) => r.append(`${t}[]`, `${o}`)) : r.append(t, `${n}`));
|
|
841
828
|
return r.toString();
|
|
842
|
-
},
|
|
843
|
-
const { search: e } =
|
|
844
|
-
return
|
|
845
|
-
}
|
|
829
|
+
}, ur = () => {
|
|
830
|
+
const { search: e } = oe();
|
|
831
|
+
return P(() => mt(e), [e]);
|
|
832
|
+
}, ut = /\s+/g, ce = (e) => e.trim().toLowerCase().replace(ut, "-"), pt = new Intl.NumberFormat("en-US"), gt = (e) => pt.format(Number(e)), ne = 10, pr = (e) => Math.ceil(e / ne) * ne, D = 2, G = "...", bt = (e, r) => Array.from({ length: r - e }, (t, n) => e + n), ht = (e, r) => {
|
|
833
|
+
const t = bt(
|
|
834
|
+
Math.max(D, e - D),
|
|
835
|
+
Math.min(r - 1, e + D) + 1
|
|
836
|
+
);
|
|
837
|
+
return e - D > D && t.unshift(G), e + D < r - 1 && t.push(G), t.unshift(1), t.push(r), t;
|
|
838
|
+
}, F = (e) => e === G, ft = (e) => F(e) ? e : gt(e), xt = (e, r) => F(e) ? `${e}_${r}` : `${e}`;
|
|
839
|
+
function yt({ tags: e, selectedTags: r, searchMode: t, searchLimit: n = 5, allowAdding: o = !1 }) {
|
|
840
|
+
const [s, l] = L(), i = w((c) => {
|
|
841
|
+
const u = c.toLowerCase().trim();
|
|
842
|
+
if (!u) {
|
|
843
|
+
l(void 0);
|
|
844
|
+
return;
|
|
845
|
+
}
|
|
846
|
+
const b = e.filter((x) => r.includes(x) ? !1 : x.toLowerCase()[t](u)).slice(0, n);
|
|
847
|
+
o && b.push(`Add "${u.split(",").map(ce).join(",")}" tag`), l(new Map(b.map((x) => [x, x])));
|
|
848
|
+
}, [o, n, t, r, e]);
|
|
849
|
+
return { searchResults: s, onSearch: i };
|
|
850
|
+
}
|
|
846
851
|
function me(e, r = globalThis.setTimeout, t = globalThis.clearTimeout) {
|
|
847
|
-
const n =
|
|
852
|
+
const n = C(null), o = w(() => {
|
|
848
853
|
n.current && t(n.current);
|
|
849
|
-
}, [t]), s =
|
|
850
|
-
|
|
854
|
+
}, [t]), s = w((l, i) => {
|
|
855
|
+
o(), n.current = r(() => {
|
|
851
856
|
l(), n.current = null;
|
|
852
857
|
}, i ?? e);
|
|
853
|
-
}, [
|
|
854
|
-
return R(() =>
|
|
855
|
-
() => ({ setTimeout: s, clearCurrentTimeout:
|
|
856
|
-
[
|
|
858
|
+
}, [o, e, r]);
|
|
859
|
+
return R(() => o, [o]), P(
|
|
860
|
+
() => ({ setTimeout: s, clearCurrentTimeout: o }),
|
|
861
|
+
[o, s]
|
|
857
862
|
);
|
|
858
863
|
}
|
|
859
|
-
const
|
|
860
|
-
const { setTimeout:
|
|
861
|
-
l(!i.current),
|
|
862
|
-
}, [
|
|
864
|
+
const wt = 2e3, kt = ({ initialValue: e = !1, delay: r = wt } = {}, t = globalThis.setTimeout, n = globalThis.clearTimeout) => {
|
|
865
|
+
const { setTimeout: o } = me(r, t, n), [s, l] = L(e), i = C(e), c = w(() => {
|
|
866
|
+
l(!i.current), o(() => l(i.current));
|
|
867
|
+
}, [o]);
|
|
863
868
|
return [s, c];
|
|
864
869
|
};
|
|
865
870
|
function ue(e = !1) {
|
|
866
|
-
const [r, t] =
|
|
867
|
-
return { flag: r, toggle: n, setToTrue:
|
|
871
|
+
const [r, t] = L(e), n = w(() => t((l) => !l), []), o = w(() => t(!0), []), s = w(() => t(!1), []);
|
|
872
|
+
return { flag: r, toggle: n, setToTrue: o, setToFalse: s };
|
|
868
873
|
}
|
|
869
|
-
const pe =
|
|
870
|
-
const s = "to" in
|
|
874
|
+
const pe = K({}), vt = ({ className: e, selected: r, disabled: t, onClick: n, ...o }) => {
|
|
875
|
+
const s = "to" in o && typeof o.to == "string", l = s ? W : "button", { onItemClick: i } = E(pe);
|
|
871
876
|
return (
|
|
872
877
|
// @ts-expect-error The Tag is inferred from provided props, so they should always match
|
|
873
|
-
/* @__PURE__ */
|
|
878
|
+
/* @__PURE__ */ a(
|
|
874
879
|
l,
|
|
875
880
|
{
|
|
876
881
|
role: "menuitem",
|
|
@@ -895,14 +900,14 @@ const pe = W({}), bt = ({ className: e, selected: r, disabled: t, onClick: n, ..
|
|
|
895
900
|
onClick: (c) => {
|
|
896
901
|
n?.(c), i?.();
|
|
897
902
|
},
|
|
898
|
-
...
|
|
903
|
+
...o
|
|
899
904
|
}
|
|
900
905
|
)
|
|
901
906
|
);
|
|
902
|
-
},
|
|
907
|
+
}, Nt = () => (
|
|
903
908
|
// TODO Use an <hr /> tag once tailwind styles are not set with !important
|
|
904
|
-
/* @__PURE__ */
|
|
905
|
-
),
|
|
909
|
+
/* @__PURE__ */ a("div", { role: "separator", "aria-hidden": !0, className: "border-b border-lm-border dark:border-dm-border my-2" })
|
|
910
|
+
), Ct = ({ children: e }) => /* @__PURE__ */ a(
|
|
906
911
|
"div",
|
|
907
912
|
{
|
|
908
913
|
role: "heading",
|
|
@@ -915,77 +920,77 @@ const pe = W({}), bt = ({ className: e, selected: r, disabled: t, onClick: n, ..
|
|
|
915
920
|
onClick: (r) => r.stopPropagation(),
|
|
916
921
|
children: e
|
|
917
922
|
}
|
|
918
|
-
),
|
|
923
|
+
), Tt = ({ className: e, ...r }) => /* @__PURE__ */ a("div", { className: d("px-3 py-1.5", e), ...r }), At = ({
|
|
919
924
|
children: e,
|
|
920
925
|
className: r,
|
|
921
926
|
focusableElementsSelector: t = '[role="menuitem"]:not([disabled]):not([aria-disabled])',
|
|
922
927
|
focusFirstItem: n = !1,
|
|
923
|
-
onItemClick:
|
|
928
|
+
onItemClick: o,
|
|
924
929
|
...s
|
|
925
930
|
}) => {
|
|
926
|
-
const l =
|
|
927
|
-
return
|
|
928
|
-
},
|
|
931
|
+
const l = C(null);
|
|
932
|
+
return it(l, { elementsSelector: t, focusFirstItem: n }), /* @__PURE__ */ a(I, { ref: l, role: "menu", className: d("py-2 whitespace-nowrap", r), ...s, children: /* @__PURE__ */ a(pe.Provider, { value: { onItemClick: o }, children: e }) });
|
|
933
|
+
}, _ = Object.assign(At, { Item: vt, Separator: Nt, Title: Ct, Misc: Tt }), It = ({
|
|
929
934
|
children: e,
|
|
930
935
|
menuAlignment: r = "left",
|
|
931
936
|
buttonVariant: t = "button",
|
|
932
937
|
buttonContent: n,
|
|
933
|
-
buttonClassName:
|
|
938
|
+
buttonClassName: o,
|
|
934
939
|
buttonSize: s = "md",
|
|
935
940
|
buttonDisabled: l = !1,
|
|
936
941
|
containerClassName: i,
|
|
937
942
|
menuClassName: c,
|
|
938
|
-
caretless:
|
|
939
|
-
buttonLabel:
|
|
940
|
-
menuOffset:
|
|
943
|
+
caretless: u,
|
|
944
|
+
buttonLabel: b,
|
|
945
|
+
menuOffset: x = 3
|
|
941
946
|
}) => {
|
|
942
|
-
const [
|
|
943
|
-
open:
|
|
947
|
+
const [f, h] = L(!1), p = w(() => h(!1), []), m = C(null), { refs: v, floatingStyles: y, context: q } = se({
|
|
948
|
+
open: f,
|
|
944
949
|
onOpenChange: h,
|
|
945
950
|
placement: r === "right" ? "bottom-end" : "bottom-start",
|
|
946
|
-
middleware: [De(), Me(
|
|
951
|
+
middleware: [De(), Me(x)],
|
|
947
952
|
// eslint-disable-next-line react-compiler/react-compiler
|
|
948
|
-
elements: { reference:
|
|
949
|
-
}),
|
|
950
|
-
|
|
951
|
-
]),
|
|
953
|
+
elements: { reference: m.current }
|
|
954
|
+
}), T = _e(q), { getReferenceProps: $, getFloatingProps: j } = le([
|
|
955
|
+
T
|
|
956
|
+
]), U = S(), Q = C(null);
|
|
952
957
|
return R(() => {
|
|
953
|
-
const
|
|
954
|
-
if (!
|
|
958
|
+
const A = Q.current;
|
|
959
|
+
if (!A || !f)
|
|
955
960
|
return () => {
|
|
956
961
|
};
|
|
957
962
|
const z = new AbortController();
|
|
958
963
|
return document.body.addEventListener("click", (ye) => {
|
|
959
|
-
ye.composedPath().includes(
|
|
964
|
+
ye.composedPath().includes(A) || p();
|
|
960
965
|
}, { signal: z.signal }), () => z.abort();
|
|
961
|
-
}, [
|
|
966
|
+
}, [p, f]), // eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
962
967
|
/* @__PURE__ */ g(
|
|
963
968
|
"div",
|
|
964
969
|
{
|
|
965
970
|
ref: Q,
|
|
966
971
|
className: d("relative inline-block", i),
|
|
967
|
-
onKeyDown: (
|
|
968
|
-
|
|
972
|
+
onKeyDown: (A) => {
|
|
973
|
+
A.key === "Escape" && p();
|
|
969
974
|
},
|
|
970
|
-
onBlur: (
|
|
971
|
-
|
|
975
|
+
onBlur: (A) => {
|
|
976
|
+
A.relatedTarget && !Q.current.contains(A.relatedTarget) && p();
|
|
972
977
|
},
|
|
973
978
|
children: [
|
|
974
979
|
/* @__PURE__ */ g(
|
|
975
980
|
"button",
|
|
976
981
|
{
|
|
977
|
-
ref:
|
|
978
|
-
|
|
982
|
+
ref: m,
|
|
983
|
+
...$(),
|
|
979
984
|
type: "button",
|
|
980
985
|
"aria-haspopup": !0,
|
|
981
|
-
"aria-expanded":
|
|
982
|
-
"aria-controls":
|
|
983
|
-
"aria-label":
|
|
986
|
+
"aria-expanded": f,
|
|
987
|
+
"aria-controls": U,
|
|
988
|
+
"aria-label": b,
|
|
984
989
|
disabled: l,
|
|
985
990
|
className: d(
|
|
986
991
|
"flex items-center rounded-md focus-ring",
|
|
987
992
|
{
|
|
988
|
-
"justify-between": !
|
|
993
|
+
"justify-between": !u,
|
|
989
994
|
"cursor-pointer": !l,
|
|
990
995
|
"pointer-events-none opacity-50": l,
|
|
991
996
|
// Button variant
|
|
@@ -1003,32 +1008,32 @@ const pe = W({}), bt = ({ className: e, selected: r, disabled: t, onClick: n, ..
|
|
|
1003
1008
|
"gap-x-1.5": s === "sm",
|
|
1004
1009
|
"gap-x-2": s !== "sm"
|
|
1005
1010
|
},
|
|
1006
|
-
|
|
1011
|
+
o
|
|
1007
1012
|
),
|
|
1008
|
-
onKeyDown: (
|
|
1009
|
-
|
|
1013
|
+
onKeyDown: (A) => {
|
|
1014
|
+
A.key === "ArrowDown" && (A.preventDefault(), h(!0));
|
|
1010
1015
|
},
|
|
1011
1016
|
children: [
|
|
1012
1017
|
n,
|
|
1013
|
-
!
|
|
1018
|
+
!u && /* @__PURE__ */ a(N, { icon: Oe, size: "xs", widthAuto: !0 })
|
|
1014
1019
|
]
|
|
1015
1020
|
}
|
|
1016
1021
|
),
|
|
1017
|
-
|
|
1022
|
+
f && /* @__PURE__ */ a(
|
|
1018
1023
|
"div",
|
|
1019
1024
|
{
|
|
1020
|
-
ref:
|
|
1025
|
+
ref: v.setFloating,
|
|
1021
1026
|
style: y,
|
|
1022
1027
|
className: "min-w-full z-500",
|
|
1023
|
-
...
|
|
1024
|
-
children: /* @__PURE__ */
|
|
1025
|
-
|
|
1028
|
+
...j(),
|
|
1029
|
+
children: /* @__PURE__ */ a(
|
|
1030
|
+
_,
|
|
1026
1031
|
{
|
|
1027
1032
|
className: c,
|
|
1028
|
-
id:
|
|
1033
|
+
id: U,
|
|
1029
1034
|
focusableElementsSelector: '[role="menuitem"]:not([disabled]):not([aria-disabled]),input:not([disabled]),select:not([disabled])',
|
|
1030
1035
|
focusFirstItem: !0,
|
|
1031
|
-
onItemClick:
|
|
1036
|
+
onItemClick: p,
|
|
1032
1037
|
children: e
|
|
1033
1038
|
}
|
|
1034
1039
|
)
|
|
@@ -1037,12 +1042,12 @@ const pe = W({}), bt = ({ className: e, selected: r, disabled: t, onClick: n, ..
|
|
|
1037
1042
|
]
|
|
1038
1043
|
}
|
|
1039
1044
|
);
|
|
1040
|
-
},
|
|
1041
|
-
Item:
|
|
1042
|
-
Separator:
|
|
1043
|
-
Title:
|
|
1044
|
-
Misc:
|
|
1045
|
-
}),
|
|
1045
|
+
}, O = Object.assign(It, {
|
|
1046
|
+
Item: _.Item,
|
|
1047
|
+
Separator: _.Separator,
|
|
1048
|
+
Title: _.Title,
|
|
1049
|
+
Misc: _.Misc
|
|
1050
|
+
}), Ot = k(({ className: e, disabled: r, size: t = "md", type: n = "button", ...o }, s) => /* @__PURE__ */ a(
|
|
1046
1051
|
"button",
|
|
1047
1052
|
{
|
|
1048
1053
|
className: d(
|
|
@@ -1060,11 +1065,11 @@ const pe = W({}), bt = ({ className: e, selected: r, disabled: t, onClick: n, ..
|
|
|
1060
1065
|
),
|
|
1061
1066
|
disabled: r,
|
|
1062
1067
|
type: n,
|
|
1063
|
-
...
|
|
1068
|
+
...o,
|
|
1064
1069
|
ref: s
|
|
1065
1070
|
}
|
|
1066
|
-
)),
|
|
1067
|
-
|
|
1071
|
+
)), Rt = ({ className: e, active: r, ...t }) => /* @__PURE__ */ a("li", { role: "menuitem", className: "w-full flex", "data-active": r, children: /* @__PURE__ */ a(
|
|
1072
|
+
W,
|
|
1068
1073
|
{
|
|
1069
1074
|
className: d(
|
|
1070
1075
|
"px-2 py-3",
|
|
@@ -1078,8 +1083,8 @@ const pe = W({}), bt = ({ className: e, selected: r, disabled: t, onClick: n, ..
|
|
|
1078
1083
|
),
|
|
1079
1084
|
...t
|
|
1080
1085
|
}
|
|
1081
|
-
) }),
|
|
1082
|
-
|
|
1086
|
+
) }), Lt = ({ containerClassName: e, buttonClassName: r, menuClassName: t, active: n, ...o }) => /* @__PURE__ */ a("li", { role: "menuitem", "aria-haspopup": !0, className: "w-full flex", "data-active": n, children: /* @__PURE__ */ a(
|
|
1087
|
+
O,
|
|
1083
1088
|
{
|
|
1084
1089
|
containerClassName: d("max-md:w-full", e),
|
|
1085
1090
|
buttonVariant: "text",
|
|
@@ -1096,10 +1101,10 @@ const pe = W({}), bt = ({ className: e, selected: r, disabled: t, onClick: n, ..
|
|
|
1096
1101
|
menuAlignment: "right",
|
|
1097
1102
|
menuOffset: -3,
|
|
1098
1103
|
menuClassName: d("mx-2", t),
|
|
1099
|
-
...
|
|
1104
|
+
...o
|
|
1100
1105
|
}
|
|
1101
|
-
) }),
|
|
1102
|
-
const { flag: n, toggle:
|
|
1106
|
+
) }), Pt = ({ className: e, brand: r, children: t }) => {
|
|
1107
|
+
const { flag: n, toggle: o, setToFalse: s } = ue(), l = S(), i = S(), { pathname: c } = oe();
|
|
1103
1108
|
return R(() => s(), [c, s]), /* @__PURE__ */ g(
|
|
1104
1109
|
"nav",
|
|
1105
1110
|
{
|
|
@@ -1111,7 +1116,7 @@ const pe = W({}), bt = ({ className: e, selected: r, disabled: t, onClick: n, ..
|
|
|
1111
1116
|
),
|
|
1112
1117
|
children: [
|
|
1113
1118
|
/* @__PURE__ */ g("div", { className: "w-full relative", children: [
|
|
1114
|
-
/* @__PURE__ */
|
|
1119
|
+
/* @__PURE__ */ a(
|
|
1115
1120
|
"h4",
|
|
1116
1121
|
{
|
|
1117
1122
|
className: d(
|
|
@@ -1121,8 +1126,8 @@ const pe = W({}), bt = ({ className: e, selected: r, disabled: t, onClick: n, ..
|
|
|
1121
1126
|
children: r
|
|
1122
1127
|
}
|
|
1123
1128
|
),
|
|
1124
|
-
/* @__PURE__ */
|
|
1125
|
-
|
|
1129
|
+
/* @__PURE__ */ a(
|
|
1130
|
+
ie,
|
|
1126
1131
|
{
|
|
1127
1132
|
id: i,
|
|
1128
1133
|
variant: "secondary",
|
|
@@ -1132,14 +1137,14 @@ const pe = W({}), bt = ({ className: e, selected: r, disabled: t, onClick: n, ..
|
|
|
1132
1137
|
"opacity-60 highlight:opacity-100 transition-opacity",
|
|
1133
1138
|
"[&]:text-white [&]:border-white [&]:highlight:bg-transparent"
|
|
1134
1139
|
),
|
|
1135
|
-
onClick:
|
|
1140
|
+
onClick: o,
|
|
1136
1141
|
"aria-label": `${n ? "Hide" : "Show"} menu`,
|
|
1137
1142
|
"aria-controls": l,
|
|
1138
|
-
children: /* @__PURE__ */
|
|
1143
|
+
children: /* @__PURE__ */ a(N, { icon: n ? Re : Le })
|
|
1139
1144
|
}
|
|
1140
1145
|
)
|
|
1141
1146
|
] }),
|
|
1142
|
-
/* @__PURE__ */
|
|
1147
|
+
/* @__PURE__ */ a(
|
|
1143
1148
|
"ul",
|
|
1144
1149
|
{
|
|
1145
1150
|
id: l,
|
|
@@ -1158,23 +1163,23 @@ const pe = W({}), bt = ({ className: e, selected: r, disabled: t, onClick: n, ..
|
|
|
1158
1163
|
]
|
|
1159
1164
|
}
|
|
1160
1165
|
);
|
|
1161
|
-
},
|
|
1162
|
-
const n =
|
|
1163
|
-
return /* @__PURE__ */
|
|
1166
|
+
}, gr = Object.assign(Pt, { MenuItem: Rt, Dropdown: Lt }), ge = K(null), Et = ({ className: e, to: r, ...t }) => {
|
|
1167
|
+
const n = E(ge);
|
|
1168
|
+
return /* @__PURE__ */ a(
|
|
1164
1169
|
ve,
|
|
1165
1170
|
{
|
|
1166
1171
|
role: "menuitem",
|
|
1167
1172
|
to: r,
|
|
1168
|
-
className: ({ isActive:
|
|
1173
|
+
className: ({ isActive: o }) => d(
|
|
1169
1174
|
"px-4 pt-2 pb-[calc(0.5rem-3px)] border-b-3",
|
|
1170
1175
|
"highlight:text-lm-brand dark:highlight:text-dm-brand",
|
|
1171
1176
|
"font-bold text-center no-underline transition-colors",
|
|
1172
1177
|
"rounded-none outline-none focus-visible:inset-ring-2",
|
|
1173
1178
|
"focus-visible:inset-ring-lm-brand/50 dark:focus-visible:inset-ring-dm-brand/50",
|
|
1174
1179
|
{
|
|
1175
|
-
"text-lm-brand dark:text-dm-brand":
|
|
1176
|
-
"border-b-lm-brand dark:border-b-dm-brand active":
|
|
1177
|
-
"border-b-transparent text-gray-500": !
|
|
1180
|
+
"text-lm-brand dark:text-dm-brand": o,
|
|
1181
|
+
"border-b-lm-brand dark:border-b-dm-brand active": o,
|
|
1182
|
+
"border-b-transparent text-gray-500": !o,
|
|
1178
1183
|
"flex-grow": n?.fill
|
|
1179
1184
|
},
|
|
1180
1185
|
e
|
|
@@ -1182,13 +1187,7 @@ const pe = W({}), bt = ({ className: e, selected: r, disabled: t, onClick: n, ..
|
|
|
1182
1187
|
...t
|
|
1183
1188
|
}
|
|
1184
1189
|
);
|
|
1185
|
-
},
|
|
1186
|
-
const t = Lt(
|
|
1187
|
-
Math.max(_, e - _),
|
|
1188
|
-
Math.min(r - 1, e + _) + 1
|
|
1189
|
-
);
|
|
1190
|
-
return e - _ > _ && t.unshift(K), e + _ < r - 1 && t.push(K), t.unshift(1), t.push(r), t;
|
|
1191
|
-
}, H = (e) => e === K, Pt = (e) => H(e) ? e : Ot(e), Et = (e, r) => H(e) ? `${e}_${r}` : `${e}`, be = [
|
|
1190
|
+
}, St = ({ children: e, className: r, fill: t }) => /* @__PURE__ */ a(ge.Provider, { value: { fill: t }, children: /* @__PURE__ */ a(I, { role: "menubar", className: d("flex overflow-hidden", r), children: e }) }), br = Object.assign(St, { Pill: Et }), be = [
|
|
1192
1191
|
"border border-r-0 last:border-r border-lm-border dark:border-dm-border",
|
|
1193
1192
|
"rounded-none first:rounded-l last:rounded-r"
|
|
1194
1193
|
], he = (e = !1) => d(
|
|
@@ -1201,39 +1200,39 @@ const pe = W({}), bt = ({ className: e, selected: r, disabled: t, onClick: n, ..
|
|
|
1201
1200
|
"highlight:bg-lm-secondary dark:highlight:bg-dm-secondary"
|
|
1202
1201
|
],
|
|
1203
1202
|
e && "bg-lm-main dark:bg-dm-main text-white"
|
|
1204
|
-
), X = ({ children: e }) => /* @__PURE__ */
|
|
1205
|
-
function
|
|
1206
|
-
const s =
|
|
1207
|
-
return t ? /* @__PURE__ */
|
|
1203
|
+
), X = ({ children: e }) => /* @__PURE__ */ a("span", { "aria-hidden": !0, className: d(be, "px-3 py-2 text-gray-400"), children: e }), fe = () => /* @__PURE__ */ a(X, { children: G });
|
|
1204
|
+
function Dt({ children: e, active: r, isEllipsis: t, href: n, ...o }) {
|
|
1205
|
+
const s = P(() => he(r), [r]);
|
|
1206
|
+
return t ? /* @__PURE__ */ a(fe, {}) : /* @__PURE__ */ a(W, { className: s, to: n, ...o, "data-active": r, children: e });
|
|
1208
1207
|
}
|
|
1209
|
-
function
|
|
1210
|
-
const
|
|
1211
|
-
return t ? /* @__PURE__ */
|
|
1208
|
+
function Mt({ children: e, active: r, isEllipsis: t, ...n }) {
|
|
1209
|
+
const o = P(() => he(r), [r]);
|
|
1210
|
+
return t ? /* @__PURE__ */ a(fe, {}) : /* @__PURE__ */ a("button", { type: "button", className: o, ...n, "data-active": r, children: e });
|
|
1212
1211
|
}
|
|
1213
|
-
const
|
|
1214
|
-
const n = "urlForPage" in t,
|
|
1215
|
-
(l) => n ? { href:
|
|
1212
|
+
const hr = ({ currentPage: e, pagesCount: r, ...t }) => {
|
|
1213
|
+
const n = "urlForPage" in t, o = n ? Dt : Mt, s = w(
|
|
1214
|
+
(l) => n ? { href: F(l) ? void 0 : t.urlForPage(l) } : { onClick: () => !F(l) && t.onPageChange(l) },
|
|
1216
1215
|
[n, t]
|
|
1217
1216
|
);
|
|
1218
1217
|
return r < 2 ? null : /* @__PURE__ */ g("div", { className: "select-none flex", "data-testid": "paginator", children: [
|
|
1219
|
-
e === 1 ? /* @__PURE__ */
|
|
1220
|
-
|
|
1221
|
-
|
|
1218
|
+
e === 1 ? /* @__PURE__ */ a(X, { children: /* @__PURE__ */ a(N, { size: "xs", icon: ee }) }) : /* @__PURE__ */ a(o, { ...s(Math.max(1, e - 1)), "aria-label": "Previous", children: /* @__PURE__ */ a(N, { size: "xs", icon: ee }) }),
|
|
1219
|
+
ht(e, r).map((l, i) => /* @__PURE__ */ a(
|
|
1220
|
+
o,
|
|
1222
1221
|
{
|
|
1223
1222
|
active: l === e,
|
|
1224
|
-
isEllipsis:
|
|
1223
|
+
isEllipsis: F(l),
|
|
1225
1224
|
...s(l),
|
|
1226
|
-
children:
|
|
1225
|
+
children: ft(l)
|
|
1227
1226
|
},
|
|
1228
|
-
|
|
1227
|
+
xt(l, i)
|
|
1229
1228
|
)),
|
|
1230
|
-
e === r ? /* @__PURE__ */
|
|
1229
|
+
e === r ? /* @__PURE__ */ a(X, { children: /* @__PURE__ */ a(N, { size: "xs", icon: te }) }) : /* @__PURE__ */ a(o, { ...s(Math.min(r, e + 1)), "aria-label": "Next", children: /* @__PURE__ */ a(N, { size: "xs", icon: te }) })
|
|
1231
1230
|
] });
|
|
1232
|
-
},
|
|
1233
|
-
|
|
1231
|
+
}, _t = ({ buttonLabel: e = "Options", buttonSize: r = "md", ...t }) => /* @__PURE__ */ a(
|
|
1232
|
+
O,
|
|
1234
1233
|
{
|
|
1235
|
-
buttonContent: /* @__PURE__ */
|
|
1236
|
-
|
|
1234
|
+
buttonContent: /* @__PURE__ */ a(
|
|
1235
|
+
N,
|
|
1237
1236
|
{
|
|
1238
1237
|
icon: Pe,
|
|
1239
1238
|
widthAuto: !0,
|
|
@@ -1245,31 +1244,31 @@ const br = ({ currentPage: e, pagesCount: r, ...t }) => {
|
|
|
1245
1244
|
buttonSize: r,
|
|
1246
1245
|
...t
|
|
1247
1246
|
}
|
|
1248
|
-
),
|
|
1249
|
-
Item:
|
|
1250
|
-
Separator:
|
|
1251
|
-
Title:
|
|
1252
|
-
Misc:
|
|
1253
|
-
}),
|
|
1247
|
+
), fr = Object.assign(_t, {
|
|
1248
|
+
Item: O.Item,
|
|
1249
|
+
Separator: O.Separator,
|
|
1250
|
+
Title: O.Title,
|
|
1251
|
+
Misc: O.Misc
|
|
1252
|
+
}), Ft = ({
|
|
1254
1253
|
open: e,
|
|
1255
1254
|
children: r,
|
|
1256
1255
|
className: t,
|
|
1257
1256
|
onClose: n,
|
|
1258
|
-
...
|
|
1257
|
+
...o
|
|
1259
1258
|
}) => {
|
|
1260
|
-
const s =
|
|
1259
|
+
const s = C(null);
|
|
1261
1260
|
return R(() => {
|
|
1262
1261
|
const l = document.body, i = l.style.overflow, c = l.style.paddingRight;
|
|
1263
1262
|
if (e) {
|
|
1264
|
-
const
|
|
1265
|
-
l.style.overflow = "hidden",
|
|
1263
|
+
const u = window.outerWidth - l.clientWidth, b = l.scrollHeight > l.clientHeight;
|
|
1264
|
+
l.style.overflow = "hidden", b && (l.style.paddingRight = `${u}px`), s.current?.showModal();
|
|
1266
1265
|
} else
|
|
1267
1266
|
s.current?.close();
|
|
1268
1267
|
return () => {
|
|
1269
1268
|
l.style.overflow = i, l.style.paddingRight = c;
|
|
1270
1269
|
};
|
|
1271
1270
|
}, [e]), Ue(
|
|
1272
|
-
/* @__PURE__ */
|
|
1271
|
+
/* @__PURE__ */ a(
|
|
1273
1272
|
"dialog",
|
|
1274
1273
|
{
|
|
1275
1274
|
ref: s,
|
|
@@ -1277,69 +1276,69 @@ const br = ({ currentPage: e, pagesCount: r, ...t }) => {
|
|
|
1277
1276
|
onCancel: (l) => {
|
|
1278
1277
|
l.preventDefault(), n();
|
|
1279
1278
|
},
|
|
1280
|
-
...
|
|
1279
|
+
...o,
|
|
1281
1280
|
children: e && r
|
|
1282
1281
|
}
|
|
1283
1282
|
),
|
|
1284
1283
|
document.body
|
|
1285
1284
|
);
|
|
1286
|
-
},
|
|
1285
|
+
}, xr = ({
|
|
1287
1286
|
open: e,
|
|
1288
1287
|
onClose: r,
|
|
1289
1288
|
variant: t = "default",
|
|
1290
1289
|
title: n,
|
|
1291
|
-
children:
|
|
1290
|
+
children: o,
|
|
1292
1291
|
className: s,
|
|
1293
1292
|
...l
|
|
1294
1293
|
}) => {
|
|
1295
1294
|
const {
|
|
1296
1295
|
size: i = "md",
|
|
1297
1296
|
confirmText: c = "Confirm",
|
|
1298
|
-
cancelText:
|
|
1299
|
-
confirmDisabled:
|
|
1300
|
-
onConfirm:
|
|
1301
|
-
onClosed:
|
|
1297
|
+
cancelText: u = "Cancel",
|
|
1298
|
+
confirmDisabled: b,
|
|
1299
|
+
onConfirm: x,
|
|
1300
|
+
onClosed: f,
|
|
1302
1301
|
...h
|
|
1303
|
-
} = "onConfirm" in l ? l : { ...l }, [
|
|
1304
|
-
|
|
1305
|
-
}, [
|
|
1302
|
+
} = "onConfirm" in l ? l : { ...l }, [p, m] = L(e), v = C(null), y = C("cancel"), q = w((T) => {
|
|
1303
|
+
T.preventDefault(), T.stopPropagation(), y.current = "confirm", x?.();
|
|
1304
|
+
}, [x]);
|
|
1306
1305
|
return R(() => {
|
|
1307
1306
|
if (e) {
|
|
1308
|
-
y.current = "cancel",
|
|
1307
|
+
y.current = "cancel", m(!0);
|
|
1309
1308
|
return;
|
|
1310
1309
|
}
|
|
1311
|
-
const
|
|
1312
|
-
if (
|
|
1313
|
-
delete
|
|
1314
|
-
let
|
|
1315
|
-
const
|
|
1316
|
-
|
|
1310
|
+
const T = v.current;
|
|
1311
|
+
if (T) {
|
|
1312
|
+
delete v.current.dataset.open;
|
|
1313
|
+
let $ = !1;
|
|
1314
|
+
const j = (U) => {
|
|
1315
|
+
$ || U.target !== T || ($ = !0, m(!1), f?.(y.current));
|
|
1317
1316
|
};
|
|
1318
|
-
return
|
|
1319
|
-
|
|
1317
|
+
return T.addEventListener("transitionend", j), () => {
|
|
1318
|
+
T.removeEventListener("transitionend", j);
|
|
1320
1319
|
};
|
|
1321
1320
|
}
|
|
1322
|
-
}, [
|
|
1323
|
-
const
|
|
1324
|
-
|
|
1325
|
-
}, [
|
|
1326
|
-
|
|
1321
|
+
}, [f, e]), R(() => {
|
|
1322
|
+
const T = v.current;
|
|
1323
|
+
p && T && (T.dataset.open = "");
|
|
1324
|
+
}, [p]), /* @__PURE__ */ a(
|
|
1325
|
+
Ft,
|
|
1327
1326
|
{
|
|
1328
|
-
open:
|
|
1327
|
+
open: p,
|
|
1329
1328
|
onClose: r,
|
|
1330
1329
|
className: d(
|
|
1331
1330
|
{
|
|
1332
|
-
"flex w-screen h-screen max-w-screen max-h-screen":
|
|
1331
|
+
"flex w-screen h-screen max-w-screen max-h-screen": p,
|
|
1333
1332
|
"overflow-hidden": t === "cover"
|
|
1334
1333
|
},
|
|
1335
1334
|
s
|
|
1336
1335
|
),
|
|
1337
1336
|
...h,
|
|
1338
|
-
children: /* @__PURE__ */
|
|
1337
|
+
children: /* @__PURE__ */ a(
|
|
1339
1338
|
"form",
|
|
1340
1339
|
{
|
|
1341
1340
|
"data-testid": "transition-container",
|
|
1342
|
-
ref:
|
|
1341
|
+
ref: v,
|
|
1343
1342
|
className: d(
|
|
1344
1343
|
"w-full m-auto p-4 sm:p-6",
|
|
1345
1344
|
// CSS transitions are based on the presence of the `data-open` attribute
|
|
@@ -1354,11 +1353,11 @@ const br = ({ currentPage: e, pagesCount: r, ...t }) => {
|
|
|
1354
1353
|
},
|
|
1355
1354
|
{ "h-full": t === "cover" }
|
|
1356
1355
|
),
|
|
1357
|
-
onSubmit:
|
|
1358
|
-
children: /* @__PURE__ */
|
|
1356
|
+
onSubmit: q,
|
|
1357
|
+
children: /* @__PURE__ */ a(I, { className: d(
|
|
1359
1358
|
"w-full",
|
|
1360
1359
|
{ "h-full relative overflow-auto": t === "cover" }
|
|
1361
|
-
), children: t === "cover" ? /* @__PURE__ */ g(
|
|
1360
|
+
), children: t === "cover" ? /* @__PURE__ */ g(B, { children: [
|
|
1362
1361
|
/* @__PURE__ */ g(
|
|
1363
1362
|
"div",
|
|
1364
1363
|
{
|
|
@@ -1369,23 +1368,23 @@ const br = ({ currentPage: e, pagesCount: r, ...t }) => {
|
|
|
1369
1368
|
"[text-shadow:_0_2px_4px_rgb(0_0_0/_0.8)]"
|
|
1370
1369
|
),
|
|
1371
1370
|
children: [
|
|
1372
|
-
/* @__PURE__ */
|
|
1373
|
-
/* @__PURE__ */
|
|
1371
|
+
/* @__PURE__ */ a("h5", { children: n }),
|
|
1372
|
+
/* @__PURE__ */ a(Y, { onClick: r, label: "Close dialog" })
|
|
1374
1373
|
]
|
|
1375
1374
|
}
|
|
1376
1375
|
),
|
|
1377
|
-
|
|
1378
|
-
] }) : /* @__PURE__ */ g(
|
|
1379
|
-
/* @__PURE__ */ g(
|
|
1376
|
+
o
|
|
1377
|
+
] }) : /* @__PURE__ */ g(B, { children: [
|
|
1378
|
+
/* @__PURE__ */ g(I.Header, { className: d(
|
|
1380
1379
|
"sticky top-0",
|
|
1381
1380
|
"flex items-center justify-between gap-x-2"
|
|
1382
1381
|
), children: [
|
|
1383
|
-
/* @__PURE__ */
|
|
1384
|
-
/* @__PURE__ */
|
|
1382
|
+
/* @__PURE__ */ a("h5", { className: d({ "text-danger": t === "danger" }), children: n }),
|
|
1383
|
+
/* @__PURE__ */ a(Y, { onClick: r, label: "Close dialog" })
|
|
1385
1384
|
] }),
|
|
1386
|
-
/* @__PURE__ */
|
|
1387
|
-
|
|
1388
|
-
|
|
1385
|
+
/* @__PURE__ */ a(I.Body, { children: o }),
|
|
1386
|
+
x && /* @__PURE__ */ g(
|
|
1387
|
+
I.Footer,
|
|
1389
1388
|
{
|
|
1390
1389
|
"data-testid": "footer",
|
|
1391
1390
|
className: d(
|
|
@@ -1393,13 +1392,13 @@ const br = ({ currentPage: e, pagesCount: r, ...t }) => {
|
|
|
1393
1392
|
"[&]:px-3 sticky bottom-0"
|
|
1394
1393
|
),
|
|
1395
1394
|
children: [
|
|
1396
|
-
/* @__PURE__ */
|
|
1397
|
-
/* @__PURE__ */
|
|
1398
|
-
|
|
1395
|
+
/* @__PURE__ */ a(Ot, { onClick: r, children: u }),
|
|
1396
|
+
/* @__PURE__ */ a(
|
|
1397
|
+
ie,
|
|
1399
1398
|
{
|
|
1400
1399
|
solid: !0,
|
|
1401
1400
|
variant: t === "danger" ? "danger" : "primary",
|
|
1402
|
-
disabled:
|
|
1401
|
+
disabled: b,
|
|
1403
1402
|
type: "submit",
|
|
1404
1403
|
children: c
|
|
1405
1404
|
}
|
|
@@ -1412,16 +1411,16 @@ const br = ({ currentPage: e, pagesCount: r, ...t }) => {
|
|
|
1412
1411
|
)
|
|
1413
1412
|
}
|
|
1414
1413
|
);
|
|
1415
|
-
},
|
|
1414
|
+
}, yr = ({ className: e, children: r, loading: t = !1, variant: n = "default" }) => /* @__PURE__ */ a(Qe, { className: d({ "[&]:border-danger": n === "error" }, e), children: /* @__PURE__ */ g("h3", { className: d("text-center", {
|
|
1416
1415
|
"text-gray-500 dark:text-gray-400": n === "default",
|
|
1417
1416
|
"text-danger": n === "error"
|
|
1418
1417
|
}), children: [
|
|
1419
|
-
t && /* @__PURE__ */ g(
|
|
1420
|
-
/* @__PURE__ */
|
|
1421
|
-
/* @__PURE__ */
|
|
1418
|
+
t && /* @__PURE__ */ g(B, { children: [
|
|
1419
|
+
/* @__PURE__ */ a(N, { icon: ae, spin: !0 }),
|
|
1420
|
+
/* @__PURE__ */ a("span", { className: "ml-2", children: r ?? "Loading..." })
|
|
1422
1421
|
] }),
|
|
1423
1422
|
!t && r
|
|
1424
|
-
] }) }),
|
|
1423
|
+
] }) }), wr = ({ variant: e, className: r, size: t = "md", children: n }) => /* @__PURE__ */ a(
|
|
1425
1424
|
"div",
|
|
1426
1425
|
{
|
|
1427
1426
|
className: d(
|
|
@@ -1439,40 +1438,40 @@ const br = ({ currentPage: e, pagesCount: r, ...t }) => {
|
|
|
1439
1438
|
),
|
|
1440
1439
|
children: n
|
|
1441
1440
|
}
|
|
1442
|
-
),
|
|
1443
|
-
const r =
|
|
1444
|
-
const
|
|
1445
|
-
return e === "auto" &&
|
|
1446
|
-
})(), [n,
|
|
1441
|
+
), kr = ({ placement: e = "auto" } = {}) => {
|
|
1442
|
+
const r = C(null), t = (() => {
|
|
1443
|
+
const m = [];
|
|
1444
|
+
return e === "auto" && m.push(Fe()), m.push(Be({ element: r })), m;
|
|
1445
|
+
})(), [n, o] = L(!1), { refs: s, floatingStyles: l, context: i, middlewareData: c } = se({
|
|
1447
1446
|
placement: e === "auto" ? void 0 : e,
|
|
1448
1447
|
open: n,
|
|
1449
|
-
onOpenChange:
|
|
1448
|
+
onOpenChange: o,
|
|
1450
1449
|
middleware: t
|
|
1451
|
-
}),
|
|
1450
|
+
}), u = He(i, {
|
|
1452
1451
|
delay: { open: 300 },
|
|
1453
1452
|
move: !0
|
|
1454
|
-
}), { getFloatingProps:
|
|
1455
|
-
const
|
|
1453
|
+
}), { getFloatingProps: b, getReferenceProps: x } = le([u]), { isMounted: f, styles: h } = $e(i, { duration: 200 }), p = P(() => {
|
|
1454
|
+
const m = i.placement.split("-")[0];
|
|
1456
1455
|
return {
|
|
1457
1456
|
top: "bottom",
|
|
1458
1457
|
right: "left",
|
|
1459
1458
|
bottom: "top",
|
|
1460
1459
|
left: "right"
|
|
1461
|
-
}[
|
|
1460
|
+
}[m] ?? "";
|
|
1462
1461
|
}, [i.placement]);
|
|
1463
1462
|
return {
|
|
1464
|
-
anchor: { ...
|
|
1463
|
+
anchor: { ...x(), ref: s.setReference },
|
|
1465
1464
|
tooltip: {
|
|
1466
|
-
...
|
|
1465
|
+
...b(),
|
|
1467
1466
|
refSetter: s.setFloating,
|
|
1468
|
-
isMounted:
|
|
1467
|
+
isMounted: f,
|
|
1469
1468
|
styles: { ...l, ...h },
|
|
1470
1469
|
arrowPos: c.arrow,
|
|
1471
1470
|
arrowRef: r,
|
|
1472
|
-
arrowSide:
|
|
1471
|
+
arrowSide: p
|
|
1473
1472
|
}
|
|
1474
1473
|
};
|
|
1475
|
-
},
|
|
1474
|
+
}, vr = ({ children: e, isMounted: r, styles: t, refSetter: n, arrowRef: o, arrowPos: s, arrowSide: l, ...i }) => r && /* @__PURE__ */ a(
|
|
1476
1475
|
"div",
|
|
1477
1476
|
{
|
|
1478
1477
|
role: "tooltip",
|
|
@@ -1492,12 +1491,12 @@ const br = ({ currentPage: e, pagesCount: r, ...t }) => {
|
|
|
1492
1491
|
style: t,
|
|
1493
1492
|
...i,
|
|
1494
1493
|
children: /* @__PURE__ */ g("div", { className: "relative px-1.5 py-1 rounded bg-black/90 text-white text-center", children: [
|
|
1495
|
-
/* @__PURE__ */
|
|
1494
|
+
/* @__PURE__ */ a("span", { className: "sr-only", children: "Tooltip: " }),
|
|
1496
1495
|
e,
|
|
1497
|
-
/* @__PURE__ */
|
|
1496
|
+
/* @__PURE__ */ a(
|
|
1498
1497
|
"div",
|
|
1499
1498
|
{
|
|
1500
|
-
ref:
|
|
1499
|
+
ref: o,
|
|
1501
1500
|
className: d(
|
|
1502
1501
|
"absolute",
|
|
1503
1502
|
// Render as a triangle
|
|
@@ -1512,7 +1511,7 @@ const br = ({ currentPage: e, pagesCount: r, ...t }) => {
|
|
|
1512
1511
|
style: {
|
|
1513
1512
|
left: s?.x,
|
|
1514
1513
|
top: s?.y,
|
|
1515
|
-
[l]: `${-(
|
|
1514
|
+
[l]: `${-(o.current?.offsetWidth ?? 0) / 2}px`
|
|
1516
1515
|
},
|
|
1517
1516
|
"data-testid": "arrow"
|
|
1518
1517
|
}
|
|
@@ -1520,7 +1519,7 @@ const br = ({ currentPage: e, pagesCount: r, ...t }) => {
|
|
|
1520
1519
|
] })
|
|
1521
1520
|
}
|
|
1522
1521
|
);
|
|
1523
|
-
function
|
|
1522
|
+
function Bt(e) {
|
|
1524
1523
|
if (e.currentField !== e.newField)
|
|
1525
1524
|
return "ASC";
|
|
1526
1525
|
const r = {
|
|
@@ -1529,135 +1528,137 @@ function Ft(e) {
|
|
|
1529
1528
|
};
|
|
1530
1529
|
return e.currentOrderDir ? r[e.currentOrderDir] : "ASC";
|
|
1531
1530
|
}
|
|
1532
|
-
function
|
|
1533
|
-
const r =
|
|
1531
|
+
function Ht(e) {
|
|
1532
|
+
const r = Bt(e);
|
|
1534
1533
|
return {
|
|
1535
1534
|
field: r ? e.newField : void 0,
|
|
1536
1535
|
dir: r
|
|
1537
1536
|
};
|
|
1538
1537
|
}
|
|
1539
|
-
const
|
|
1538
|
+
const Nr = (e, { field: r, dir: t }) => !r || !t ? e : e.sort((n, o) => {
|
|
1540
1539
|
const s = t === "ASC" ? 1 : -1, l = t === "ASC" ? -1 : 1;
|
|
1541
|
-
return n[r] >
|
|
1542
|
-
}),
|
|
1540
|
+
return n[r] > o[r] ? s : l;
|
|
1541
|
+
}), Cr = (e) => e.dir ? `${e.field}-${e.dir}` : void 0, Tr = (e) => {
|
|
1543
1542
|
const [r, t] = e.split("-");
|
|
1544
1543
|
return { field: r, dir: t };
|
|
1545
1544
|
};
|
|
1546
|
-
function
|
|
1547
|
-
const l =
|
|
1548
|
-
const
|
|
1549
|
-
t(
|
|
1550
|
-
}, [t, r.dir, r.field]), i =
|
|
1545
|
+
function Ar({ items: e, order: r, onChange: t, prefixed: n = !0, buttonVariant: o = "button", ...s }) {
|
|
1546
|
+
const l = w((c) => {
|
|
1547
|
+
const u = Ht({ currentOrderDir: r.dir, currentField: r.field, newField: c });
|
|
1548
|
+
t(u);
|
|
1549
|
+
}, [t, r.dir, r.field]), i = o === "button";
|
|
1551
1550
|
return /* @__PURE__ */ g(
|
|
1552
|
-
|
|
1551
|
+
O,
|
|
1553
1552
|
{
|
|
1554
|
-
buttonContent: /* @__PURE__ */ g(
|
|
1553
|
+
buttonContent: /* @__PURE__ */ g(B, { children: [
|
|
1555
1554
|
!i && "Order by",
|
|
1556
|
-
i && !r.field && /* @__PURE__ */
|
|
1557
|
-
i && r.field && /* @__PURE__ */ g(
|
|
1555
|
+
i && !r.field && /* @__PURE__ */ a("i", { children: "Order by..." }),
|
|
1556
|
+
i && r.field && /* @__PURE__ */ g(B, { children: [
|
|
1558
1557
|
n && "Order by: ",
|
|
1559
1558
|
e[r.field],
|
|
1560
1559
|
" - ",
|
|
1561
1560
|
r.dir ?? "DESC"
|
|
1562
1561
|
] })
|
|
1563
1562
|
] }),
|
|
1564
|
-
buttonVariant:
|
|
1563
|
+
buttonVariant: o,
|
|
1565
1564
|
...s,
|
|
1566
1565
|
children: [
|
|
1567
|
-
Object.entries(e).map(([c,
|
|
1568
|
-
|
|
1566
|
+
Object.entries(e).map(([c, u]) => /* @__PURE__ */ g(
|
|
1567
|
+
O.Item,
|
|
1569
1568
|
{
|
|
1570
1569
|
selected: r.field === c,
|
|
1571
1570
|
onClick: () => l(c),
|
|
1572
1571
|
className: "flex items-center justify-between gap-2",
|
|
1573
1572
|
children: [
|
|
1574
|
-
|
|
1575
|
-
r.field === c && /* @__PURE__ */
|
|
1573
|
+
u,
|
|
1574
|
+
r.field === c && /* @__PURE__ */ a(N, { icon: r.dir === "ASC" ? Ee : Se })
|
|
1576
1575
|
]
|
|
1577
1576
|
},
|
|
1578
1577
|
c
|
|
1579
1578
|
)),
|
|
1580
|
-
/* @__PURE__ */
|
|
1581
|
-
/* @__PURE__ */
|
|
1579
|
+
/* @__PURE__ */ a(O.Separator, {}),
|
|
1580
|
+
/* @__PURE__ */ a(O.Item, { disabled: !r.field, onClick: () => t({}), children: /* @__PURE__ */ a("i", { children: "Clear selection" }) })
|
|
1582
1581
|
]
|
|
1583
1582
|
}
|
|
1584
1583
|
);
|
|
1585
1584
|
}
|
|
1586
|
-
const
|
|
1587
|
-
const [r, t] =
|
|
1585
|
+
const $t = "#4696e5", jt = "rgba(70, 150, 229, 0.4)", Ut = "#2078CF", Gt = "rgba(32, 120, 207, 0.4)", Ir = () => xe() ? $t : Ut, Or = () => xe() ? jt : Gt, Rr = "#f77f28", Lr = "rgba(247, 127, 40, 0.4)", Pr = "white", Er = "#161b22", Kt = (e) => document.querySelector("html")?.setAttribute("data-theme", e), xe = () => document.querySelector("html")?.getAttribute("data-theme") === "dark", Wt = (e = window.matchMedia.bind(window)) => e("(prefers-color-scheme: dark)").matches ? "dark" : "light", Sr = (e) => {
|
|
1586
|
+
const [r, t] = L(() => e ?? Wt());
|
|
1588
1587
|
return R(() => {
|
|
1589
|
-
|
|
1588
|
+
Kt(r);
|
|
1590
1589
|
}, [r]), [r, t];
|
|
1591
1590
|
};
|
|
1592
1591
|
export {
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1592
|
+
jt as BRAND_COLOR_ALPHA_DM,
|
|
1593
|
+
Gt as BRAND_COLOR_ALPHA_LM,
|
|
1594
|
+
$t as BRAND_COLOR_DM,
|
|
1595
|
+
Ut as BRAND_COLOR_LM,
|
|
1596
|
+
Pt as BaseNavBar,
|
|
1597
|
+
ie as Button,
|
|
1598
|
+
I as Card,
|
|
1599
|
+
xr as CardModal,
|
|
1600
|
+
nr as Checkbox,
|
|
1602
1601
|
Y as CloseButton,
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1602
|
+
cr as CopyToClipboardButton,
|
|
1603
|
+
tr as Details,
|
|
1604
|
+
O as Dropdown,
|
|
1605
|
+
G as ELLIPSIS,
|
|
1606
|
+
Rr as HIGHLIGHTED_COLOR,
|
|
1608
1607
|
Lr as HIGHLIGHTED_COLOR_ALPHA,
|
|
1609
1608
|
J as Input,
|
|
1610
1609
|
Z as Label,
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1610
|
+
or as LabelledInput,
|
|
1611
|
+
ar as LabelledRevealablePasswordInput,
|
|
1612
|
+
sr as LabelledSelect,
|
|
1613
|
+
Ot as LinkButton,
|
|
1615
1614
|
Ye as Listbox,
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1615
|
+
_ as Menu,
|
|
1616
|
+
yr as Message,
|
|
1617
|
+
Ft as ModalDialog,
|
|
1618
|
+
gr as NavBar,
|
|
1619
|
+
br as NavPills,
|
|
1620
|
+
Ar as OrderingDropdown,
|
|
1621
|
+
Er as PRIMARY_DARK_COLOR,
|
|
1622
|
+
Pr as PRIMARY_LIGHT_COLOR,
|
|
1623
|
+
hr as Paginator,
|
|
1624
|
+
wr as Result,
|
|
1626
1625
|
tt as RevealablePasswordInput,
|
|
1627
|
-
|
|
1626
|
+
fr as RowDropdown,
|
|
1628
1627
|
at as SearchCombobox,
|
|
1629
1628
|
nt as SearchInput,
|
|
1630
1629
|
rt as Select,
|
|
1631
1630
|
Qe as SimpleCard,
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1631
|
+
rr as Table,
|
|
1632
|
+
lr as TagsAutocomplete,
|
|
1633
|
+
ir as ToggleSwitch,
|
|
1634
|
+
vr as Tooltip,
|
|
1635
|
+
Ir as brandColor,
|
|
1636
|
+
Or as brandColorAlpha,
|
|
1637
|
+
Kt as changeThemeInMarkup,
|
|
1638
|
+
Ht as determineOrder,
|
|
1639
|
+
Bt as determineOrderDir,
|
|
1640
|
+
gt as formatNumber,
|
|
1641
|
+
Wt as getSystemPreferredTheme,
|
|
1643
1642
|
xe as isDarkThemeEnabled,
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1643
|
+
ct as isLightColor,
|
|
1644
|
+
xt as keyForPage,
|
|
1645
|
+
ce as normalizeTag,
|
|
1646
|
+
Cr as orderToString,
|
|
1647
|
+
F as pageIsEllipsis,
|
|
1648
|
+
mt as parseQueryString,
|
|
1649
|
+
ft as prettifyPageNumber,
|
|
1650
|
+
ht as progressivePagination,
|
|
1651
|
+
pr as roundTen,
|
|
1652
|
+
Nr as sortList,
|
|
1653
|
+
Tr as stringToOrder,
|
|
1654
|
+
mr as stringifyQueryParams,
|
|
1655
|
+
it as useArrowKeyNavigation,
|
|
1656
|
+
dr as useGoBack,
|
|
1657
|
+
ur as useParsedQuery,
|
|
1658
|
+
yt as useTagsSearch,
|
|
1659
|
+
Sr as useTheme,
|
|
1659
1660
|
me as useTimeout,
|
|
1660
|
-
|
|
1661
|
+
kt as useTimeoutToggle,
|
|
1661
1662
|
ue as useToggle,
|
|
1662
|
-
|
|
1663
|
+
kr as useTooltip
|
|
1663
1664
|
};
|