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