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