@shlinkio/shlink-frontend-kit 1.0.1 → 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.js +934 -945
- package/package.json +15 -15
package/dist/index.js
CHANGED
|
@@ -1,250 +1,250 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import { useRef as
|
|
4
|
-
import { Link as
|
|
5
|
-
import { faClose as
|
|
6
|
-
import { FontAwesomeIcon as
|
|
7
|
-
import { useFloating as
|
|
8
|
-
import { faClone as
|
|
9
|
-
import { createPortal as
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
return
|
|
13
|
-
const i =
|
|
14
|
-
return i
|
|
15
|
-
}, []), /* @__PURE__ */
|
|
16
|
-
/* @__PURE__ */
|
|
17
|
-
|
|
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
|
+
import { faClone as je } from "@fortawesome/free-regular-svg-icons";
|
|
9
|
+
import { createPortal as Ue } from "react-dom";
|
|
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
|
-
},
|
|
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
|
-
)), Ke =
|
|
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
|
-
)),
|
|
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:
|
|
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
|
-
|
|
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
|
-
function
|
|
79
|
-
id:
|
|
78
|
+
function Ye({
|
|
79
|
+
id: e,
|
|
80
80
|
items: r,
|
|
81
|
-
onSelectItem:
|
|
81
|
+
onSelectItem: t,
|
|
82
82
|
onActiveItemChange: n,
|
|
83
|
-
renderItem:
|
|
84
|
-
className:
|
|
85
|
-
noItemsMessage:
|
|
83
|
+
renderItem: a,
|
|
84
|
+
className: s,
|
|
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 (
|
|
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(p.key) && p.preventDefault(), p.key === "ArrowDown" ?
|
|
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": p ===
|
|
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": p ===
|
|
124
|
+
{ "bg-lm-secondary dark:bg-dm-secondary": p === f }
|
|
125
125
|
),
|
|
126
126
|
tabIndex: -1,
|
|
127
|
-
onClick: () =>
|
|
128
|
-
onMouseOver: () =>
|
|
129
|
-
children:
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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":
|
|
183
|
-
"hover:bg-lm-primary dark:hover:bg-dm-primary":
|
|
181
|
+
"lg:table-row flex flex-col": s,
|
|
182
|
+
"lg:border-0 border-y-2 border-lm-border dark:border-dm-border": s,
|
|
183
|
+
"hover:bg-lm-primary dark:hover:bg-dm-primary": a,
|
|
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": a
|
|
186
186
|
},
|
|
187
187
|
r
|
|
188
188
|
),
|
|
189
|
-
...
|
|
190
|
-
children:
|
|
189
|
+
...t,
|
|
190
|
+
children: e
|
|
191
191
|
}
|
|
192
192
|
);
|
|
193
|
-
},
|
|
194
|
-
const
|
|
195
|
-
return /* @__PURE__ */
|
|
196
|
-
|
|
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
|
+
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
|
-
"text-left":
|
|
207
|
+
"text-left": l === "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 && l === "td"
|
|
210
210
|
},
|
|
211
211
|
r
|
|
212
212
|
),
|
|
213
|
-
...
|
|
214
|
-
children:
|
|
213
|
+
...a,
|
|
214
|
+
children: e
|
|
215
215
|
}
|
|
216
216
|
);
|
|
217
|
-
},
|
|
218
|
-
/* @__PURE__ */
|
|
219
|
-
/* @__PURE__ */
|
|
220
|
-
r && /* @__PURE__ */
|
|
221
|
-
] }) }),
|
|
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
|
-
inline:
|
|
227
|
-
solid:
|
|
228
|
-
type:
|
|
226
|
+
inline: a = !1,
|
|
227
|
+
solid: s = !1,
|
|
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
|
-
"inline-flex":
|
|
239
|
-
flex: !
|
|
238
|
+
"inline-flex": a,
|
|
239
|
+
flex: !a
|
|
240
240
|
},
|
|
241
241
|
"gap-2 items-center justify-center",
|
|
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 U = q(void 0), F = q({ responsive: !0, size: "md" }), Je = ({ 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":
|
|
286
|
-
type:
|
|
284
|
+
disabled: m ? void 0 : r,
|
|
285
|
+
"aria-disabled": m ? r : void 0,
|
|
286
|
+
type: w,
|
|
287
287
|
...i
|
|
288
288
|
}
|
|
289
289
|
);
|
|
290
|
-
}),
|
|
291
|
-
const
|
|
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
|
-
onChange:
|
|
306
|
-
...
|
|
305
|
+
onChange: a,
|
|
306
|
+
...t
|
|
307
307
|
}
|
|
308
308
|
);
|
|
309
|
-
}),
|
|
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
|
-
"opacity-50 highlight:opacity-80 transition-opacity": !
|
|
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
|
-
)),
|
|
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
|
-
className:
|
|
338
|
-
disabled:
|
|
339
|
-
...
|
|
340
|
-
}, i) => /* @__PURE__ */
|
|
337
|
+
className: a,
|
|
338
|
+
disabled: s,
|
|
339
|
+
...l
|
|
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:
|
|
366
|
-
...
|
|
365
|
+
disabled: s,
|
|
366
|
+
...l
|
|
367
367
|
}
|
|
368
|
-
)),
|
|
368
|
+
)), Z = ({ required: e, children: r, className: t, ...n }) => /* @__PURE__ */ g("label", { className: d("cursor-pointer", t), ...n, children: [
|
|
369
369
|
r,
|
|
370
|
-
|
|
371
|
-
] }),
|
|
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 U = q(void 0), F = q({ responsive: !0, size: "md" }), Je = ({ children: t,
|
|
|
378
378
|
children: r
|
|
379
379
|
}
|
|
380
380
|
),
|
|
381
|
-
|
|
382
|
-
] }),
|
|
383
|
-
const
|
|
384
|
-
return /* @__PURE__ */
|
|
385
|
-
/* @__PURE__ */
|
|
386
|
-
/* @__PURE__ */
|
|
387
|
-
|
|
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
|
+
J,
|
|
388
388
|
{
|
|
389
|
-
ref:
|
|
390
|
-
id:
|
|
389
|
+
ref: c,
|
|
390
|
+
id: m,
|
|
391
391
|
className: r,
|
|
392
|
-
required:
|
|
393
|
-
feedback:
|
|
392
|
+
required: t || n,
|
|
393
|
+
feedback: a ? "error" : void 0,
|
|
394
394
|
...i
|
|
395
395
|
}
|
|
396
396
|
)
|
|
397
397
|
] });
|
|
398
|
-
}),
|
|
399
|
-
const { flag:
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
return /* @__PURE__ */ h(
|
|
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__ */
|
|
411
|
-
|
|
409
|
+
/* @__PURE__ */ o(
|
|
410
|
+
J,
|
|
412
411
|
{
|
|
413
|
-
ref:
|
|
414
|
-
type:
|
|
415
|
-
className:
|
|
412
|
+
ref: a,
|
|
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
|
-
onClick:
|
|
432
|
-
title:
|
|
433
|
-
"aria-label":
|
|
434
|
-
className:
|
|
430
|
+
onClick: l,
|
|
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
|
-
}),
|
|
450
|
-
const
|
|
451
|
-
return /* @__PURE__ */
|
|
452
|
-
/* @__PURE__ */
|
|
453
|
-
/* @__PURE__ */
|
|
454
|
-
|
|
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(
|
|
453
|
+
tt,
|
|
455
454
|
{
|
|
456
|
-
ref:
|
|
457
|
-
id:
|
|
455
|
+
ref: c,
|
|
456
|
+
id: m,
|
|
458
457
|
className: r,
|
|
459
|
-
required:
|
|
460
|
-
feedback:
|
|
458
|
+
required: t || n,
|
|
459
|
+
feedback: a ? "error" : void 0,
|
|
461
460
|
...i
|
|
462
461
|
}
|
|
463
462
|
)
|
|
464
463
|
] });
|
|
465
|
-
}),
|
|
466
|
-
className:
|
|
464
|
+
}), rt = v(({
|
|
465
|
+
className: e,
|
|
467
466
|
size: r = "md",
|
|
468
|
-
feedback:
|
|
467
|
+
feedback: t,
|
|
469
468
|
disabled: n,
|
|
470
|
-
...
|
|
471
|
-
},
|
|
469
|
+
...a
|
|
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 U = q(void 0), F = q({ responsive: !0, size: "md" }), Je = ({ 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
|
-
)),
|
|
496
|
-
const
|
|
497
|
-
return /* @__PURE__ */
|
|
498
|
-
/* @__PURE__ */
|
|
499
|
-
/* @__PURE__ */
|
|
500
|
-
|
|
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(
|
|
499
|
+
rt,
|
|
501
500
|
{
|
|
502
|
-
ref:
|
|
503
|
-
id:
|
|
504
|
-
className:
|
|
505
|
-
required:
|
|
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
|
-
}),
|
|
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
|
-
loading:
|
|
518
|
-
variant:
|
|
519
|
-
immediate:
|
|
516
|
+
loading: a = !1,
|
|
517
|
+
variant: s = "default",
|
|
518
|
+
immediate: l = !1,
|
|
520
519
|
...i
|
|
521
|
-
},
|
|
522
|
-
const { setTimeout:
|
|
523
|
-
!
|
|
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:
|
|
530
|
-
spin:
|
|
531
|
-
className:
|
|
528
|
+
icon: a ? se : Ae,
|
|
529
|
+
spin: a,
|
|
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,91 +537,91 @@ const U = q(void 0), F = q({ responsive: !0, size: "md" }), Je = ({ children: t,
|
|
|
538
537
|
)
|
|
539
538
|
}
|
|
540
539
|
),
|
|
541
|
-
/* @__PURE__ */
|
|
542
|
-
|
|
540
|
+
/* @__PURE__ */ o(
|
|
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
|
-
onChange: (
|
|
554
|
+
onChange: (x) => w(x.target.value),
|
|
556
555
|
size: n,
|
|
557
556
|
...i
|
|
558
557
|
}
|
|
559
558
|
)
|
|
560
559
|
] });
|
|
561
560
|
});
|
|
562
|
-
function
|
|
563
|
-
searchResults:
|
|
561
|
+
function ot({
|
|
562
|
+
searchResults: e,
|
|
564
563
|
onSearch: r,
|
|
565
|
-
onSelectSearchResult:
|
|
564
|
+
onSelectSearchResult: t,
|
|
566
565
|
renderSearchResult: n,
|
|
567
|
-
size:
|
|
566
|
+
size: a = "md",
|
|
568
567
|
// SearchInput defaults its size to 'lg'. Change it to 'md'
|
|
569
|
-
listboxSpan:
|
|
570
|
-
onFocus:
|
|
568
|
+
listboxSpan: s = "full",
|
|
569
|
+
onFocus: l,
|
|
571
570
|
containerClassName: i,
|
|
572
|
-
listboxClassName:
|
|
573
|
-
...
|
|
574
|
-
},
|
|
575
|
-
const
|
|
576
|
-
we(
|
|
577
|
-
const p =
|
|
578
|
-
() =>
|
|
579
|
-
[
|
|
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__ */
|
|
592
|
-
|
|
590
|
+
/* @__PURE__ */ o(
|
|
591
|
+
nt,
|
|
593
592
|
{
|
|
594
593
|
onChange: r,
|
|
595
|
-
size:
|
|
596
|
-
ref:
|
|
594
|
+
size: a,
|
|
595
|
+
ref: u,
|
|
597
596
|
role: "combobox",
|
|
598
597
|
"aria-autocomplete": "list",
|
|
599
|
-
"aria-expanded": !!
|
|
600
|
-
"aria-controls":
|
|
601
|
-
"aria-activedescendant": p ? `${
|
|
598
|
+
"aria-expanded": !!e,
|
|
599
|
+
"aria-controls": w,
|
|
600
|
+
"aria-activedescendant": p ? `${w}_${p}` : void 0,
|
|
602
601
|
autoComplete: "off",
|
|
603
602
|
autoCorrect: "off",
|
|
604
|
-
onFocus: (
|
|
605
|
-
|
|
603
|
+
onFocus: (y) => {
|
|
604
|
+
l?.(y), r(y.target.value);
|
|
606
605
|
},
|
|
607
|
-
...
|
|
606
|
+
...m
|
|
608
607
|
}
|
|
609
608
|
),
|
|
610
|
-
|
|
611
|
-
|
|
609
|
+
e && /* @__PURE__ */ o(
|
|
610
|
+
Ye,
|
|
612
611
|
{
|
|
613
|
-
id:
|
|
614
|
-
items:
|
|
615
|
-
anchor:
|
|
616
|
-
onSelectItem:
|
|
617
|
-
onActiveItemChange:
|
|
612
|
+
id: w,
|
|
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,406 +631,405 @@ function at({
|
|
|
632
631
|
}
|
|
633
632
|
);
|
|
634
633
|
}
|
|
635
|
-
const
|
|
636
|
-
/* @__PURE__ */
|
|
637
|
-
|
|
638
|
-
] }),
|
|
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: {
|
|
652
651
|
backgroundColor: r,
|
|
653
|
-
color:
|
|
652
|
+
color: mt(r) ? "#000" : "#fff"
|
|
654
653
|
},
|
|
655
|
-
onClick: (
|
|
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
|
-
),
|
|
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
|
-
searchMode:
|
|
668
|
-
immutable:
|
|
669
|
-
size:
|
|
666
|
+
searchMode: a = "startsWith",
|
|
667
|
+
immutable: s = !1,
|
|
668
|
+
size: l = "md",
|
|
670
669
|
disabled: i,
|
|
671
|
-
containerClassName:
|
|
672
|
-
...
|
|
670
|
+
containerClassName: c,
|
|
671
|
+
...m
|
|
673
672
|
}) => {
|
|
674
|
-
const [
|
|
675
|
-
const
|
|
676
|
-
if (!
|
|
677
|
-
|
|
673
|
+
const [f, w] = P(), x = k((b) => {
|
|
674
|
+
const y = b.toLowerCase().trim();
|
|
675
|
+
if (!y) {
|
|
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
|
|
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
|
-
), p =
|
|
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",
|
|
703
702
|
{
|
|
704
|
-
"p-0.5":
|
|
705
|
-
"p-1.25":
|
|
706
|
-
"p-2":
|
|
703
|
+
"p-0.5": l === "sm",
|
|
704
|
+
"p-1.25": l === "md",
|
|
705
|
+
"p-2": l === "lg",
|
|
707
706
|
"bg-lm-disabled-input dark:bg-dm-disabled-input": i,
|
|
708
707
|
"bg-lm-primary dark:bg-dm-primary": !i,
|
|
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
|
-
x.target !== p.current && ((b = p.current) == null || b.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__ */
|
|
724
|
-
|
|
721
|
+
/* @__PURE__ */ o(
|
|
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
|
-
"px-1 text-sm":
|
|
734
|
-
"px-2 h-[26px]":
|
|
735
|
-
"px-3 text-xl":
|
|
731
|
+
"px-1 text-sm": l === "sm",
|
|
732
|
+
"px-2 h-[26px]": l === "md",
|
|
733
|
+
"px-3 text-xl": l === "lg"
|
|
736
734
|
}
|
|
737
735
|
),
|
|
738
|
-
searchResults:
|
|
739
|
-
onSearch:
|
|
740
|
-
onSelectSearchResult:
|
|
741
|
-
renderSearchResult: (
|
|
742
|
-
onKeyDown: (
|
|
743
|
-
|
|
736
|
+
searchResults: f,
|
|
737
|
+
onSearch: x,
|
|
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
|
-
size:
|
|
743
|
+
size: l,
|
|
746
744
|
disabled: i,
|
|
747
745
|
ref: p,
|
|
748
746
|
immediate: !0,
|
|
749
|
-
...
|
|
747
|
+
...m
|
|
750
748
|
}
|
|
751
749
|
)
|
|
752
750
|
]
|
|
753
751
|
}
|
|
754
752
|
)
|
|
755
753
|
);
|
|
756
|
-
},
|
|
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
|
|
771
|
-
const
|
|
772
|
-
const
|
|
773
|
-
return n &&
|
|
774
|
-
}, [
|
|
775
|
-
const
|
|
776
|
-
return n &&
|
|
777
|
-
}, [
|
|
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
|
|
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
|
-
const
|
|
798
|
-
const
|
|
799
|
-
return
|
|
800
|
-
},
|
|
801
|
-
function
|
|
802
|
-
const [r,
|
|
803
|
-
return Math.round(Math.sqrt(0.299 * r ** 2 + 0.587 *
|
|
795
|
+
const ir = () => {
|
|
796
|
+
const e = ke();
|
|
797
|
+
return k(() => e(-1), [e]);
|
|
798
|
+
}, ct = 128;
|
|
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
|
|
806
|
-
const [
|
|
807
|
-
() =>
|
|
808
|
-
[
|
|
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
|
-
},
|
|
831
|
-
const r = new URLSearchParams(
|
|
832
|
-
return r.forEach((n,
|
|
833
|
-
if (
|
|
834
|
-
const
|
|
835
|
-
|
|
828
|
+
}, ut = (e) => {
|
|
829
|
+
const r = new URLSearchParams(e), t = {};
|
|
830
|
+
return r.forEach((n, a) => {
|
|
831
|
+
if (a.endsWith("[]")) {
|
|
832
|
+
const s = a.slice(0, -2);
|
|
833
|
+
t[s] ??= [], t[s].push(n);
|
|
836
834
|
} else
|
|
837
|
-
|
|
838
|
-
}),
|
|
839
|
-
},
|
|
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((
|
|
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
|
-
},
|
|
845
|
-
const { search:
|
|
846
|
-
return
|
|
842
|
+
}, mr = () => {
|
|
843
|
+
const { search: e } = ae();
|
|
844
|
+
return E(() => ut(e), [e]);
|
|
847
845
|
};
|
|
848
|
-
function
|
|
849
|
-
const n =
|
|
850
|
-
n.current &&
|
|
851
|
-
}, [
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
}, i ??
|
|
855
|
-
}, [
|
|
856
|
-
return
|
|
857
|
-
() => ({ setTimeout:
|
|
858
|
-
[
|
|
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) => {
|
|
850
|
+
a(), n.current = r(() => {
|
|
851
|
+
l(), n.current = null;
|
|
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
|
|
862
|
-
const { setTimeout:
|
|
863
|
-
|
|
864
|
-
}, [
|
|
865
|
-
return [
|
|
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(() => {
|
|
861
|
+
l(!i.current), a(() => l(i.current));
|
|
862
|
+
}, [a]);
|
|
863
|
+
return [s, c];
|
|
866
864
|
};
|
|
867
|
-
function
|
|
868
|
-
const [r,
|
|
869
|
-
return { flag: r, toggle: n, setToTrue:
|
|
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
|
-
type:
|
|
897
|
-
onClick: (
|
|
898
|
-
n
|
|
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?.();
|
|
899
897
|
},
|
|
900
|
-
...
|
|
898
|
+
...a
|
|
901
899
|
}
|
|
902
900
|
)
|
|
903
901
|
);
|
|
904
|
-
},
|
|
902
|
+
}, ht = () => (
|
|
905
903
|
// TODO Use an <hr /> tag once tailwind styles are not set with !important
|
|
906
|
-
/* @__PURE__ */
|
|
907
|
-
),
|
|
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(
|
|
908
906
|
"div",
|
|
909
907
|
{
|
|
910
908
|
role: "heading",
|
|
911
909
|
"aria-level": 6,
|
|
912
910
|
"aria-hidden": !0,
|
|
913
|
-
className:
|
|
911
|
+
className: d(
|
|
914
912
|
"flex items-center w-full px-3 py-1.5",
|
|
915
913
|
"text-gray-500 text-sm font-semibold"
|
|
916
914
|
),
|
|
917
915
|
onClick: (r) => r.stopPropagation(),
|
|
918
|
-
children:
|
|
916
|
+
children: e
|
|
919
917
|
}
|
|
920
|
-
),
|
|
921
|
-
children:
|
|
918
|
+
), xt = ({ className: e, ...r }) => /* @__PURE__ */ o("div", { className: d("px-3 py-1.5", e), ...r }), yt = ({
|
|
919
|
+
children: e,
|
|
922
920
|
className: r,
|
|
923
|
-
focusableElementsSelector:
|
|
921
|
+
focusableElementsSelector: t = '[role="menuitem"]:not([disabled]):not([aria-disabled])',
|
|
924
922
|
focusFirstItem: n = !1,
|
|
925
|
-
onItemClick:
|
|
926
|
-
...
|
|
923
|
+
onItemClick: a,
|
|
924
|
+
...s
|
|
927
925
|
}) => {
|
|
928
|
-
const
|
|
929
|
-
return
|
|
930
|
-
},
|
|
931
|
-
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,
|
|
932
930
|
menuAlignment: r = "left",
|
|
933
|
-
buttonVariant:
|
|
931
|
+
buttonVariant: t = "button",
|
|
934
932
|
buttonContent: n,
|
|
935
|
-
buttonClassName:
|
|
936
|
-
buttonSize:
|
|
937
|
-
buttonDisabled:
|
|
933
|
+
buttonClassName: a,
|
|
934
|
+
buttonSize: s = "md",
|
|
935
|
+
buttonDisabled: l = !1,
|
|
938
936
|
containerClassName: i,
|
|
939
|
-
menuClassName:
|
|
940
|
-
caretless:
|
|
941
|
-
buttonLabel:
|
|
942
|
-
menuOffset:
|
|
937
|
+
menuClassName: c,
|
|
938
|
+
caretless: m,
|
|
939
|
+
buttonLabel: f,
|
|
940
|
+
menuOffset: w = 3
|
|
943
941
|
}) => {
|
|
944
|
-
const [
|
|
945
|
-
open:
|
|
946
|
-
onOpenChange:
|
|
942
|
+
const [x, h] = P(!1), u = k(() => h(!1), []), p = T(null), { refs: b, floatingStyles: y, context: A } = le({
|
|
943
|
+
open: x,
|
|
944
|
+
onOpenChange: h,
|
|
947
945
|
placement: r === "right" ? "bottom-end" : "bottom-start",
|
|
948
|
-
middleware: [
|
|
946
|
+
middleware: [De(), Me(w)],
|
|
949
947
|
// eslint-disable-next-line react-compiler/react-compiler
|
|
950
948
|
elements: { reference: p.current }
|
|
951
|
-
}),
|
|
952
|
-
|
|
953
|
-
]),
|
|
954
|
-
return
|
|
955
|
-
const
|
|
956
|
-
if (!
|
|
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)
|
|
957
955
|
return () => {
|
|
958
956
|
};
|
|
959
|
-
const
|
|
960
|
-
return document.body.addEventListener("click", (
|
|
961
|
-
|
|
962
|
-
}, { signal:
|
|
963
|
-
}, [
|
|
964
|
-
/* @__PURE__ */
|
|
957
|
+
const z = new AbortController();
|
|
958
|
+
return document.body.addEventListener("click", (ye) => {
|
|
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(
|
|
965
963
|
"div",
|
|
966
964
|
{
|
|
967
|
-
ref:
|
|
968
|
-
className:
|
|
969
|
-
onKeyDown: (
|
|
970
|
-
|
|
965
|
+
ref: Q,
|
|
966
|
+
className: d("relative inline-block", i),
|
|
967
|
+
onKeyDown: (I) => {
|
|
968
|
+
I.key === "Escape" && u();
|
|
971
969
|
},
|
|
972
|
-
onBlur: (
|
|
973
|
-
|
|
970
|
+
onBlur: (I) => {
|
|
971
|
+
I.relatedTarget && !Q.current.contains(I.relatedTarget) && u();
|
|
974
972
|
},
|
|
975
973
|
children: [
|
|
976
|
-
/* @__PURE__ */
|
|
974
|
+
/* @__PURE__ */ g(
|
|
977
975
|
"button",
|
|
978
976
|
{
|
|
979
977
|
ref: p,
|
|
980
|
-
...
|
|
978
|
+
...D(),
|
|
981
979
|
type: "button",
|
|
982
980
|
"aria-haspopup": !0,
|
|
983
|
-
"aria-expanded":
|
|
984
|
-
"aria-controls":
|
|
985
|
-
"aria-label":
|
|
986
|
-
disabled:
|
|
987
|
-
className:
|
|
981
|
+
"aria-expanded": x,
|
|
982
|
+
"aria-controls": G,
|
|
983
|
+
"aria-label": f,
|
|
984
|
+
disabled: l,
|
|
985
|
+
className: d(
|
|
988
986
|
"flex items-center rounded-md focus-ring",
|
|
989
987
|
{
|
|
990
|
-
"justify-between": !
|
|
991
|
-
"cursor-pointer": !
|
|
992
|
-
"pointer-events-none opacity-50":
|
|
988
|
+
"justify-between": !m,
|
|
989
|
+
"cursor-pointer": !l,
|
|
990
|
+
"pointer-events-none opacity-50": l,
|
|
993
991
|
// Button variant
|
|
994
|
-
"border border-lm-border dark:border-dm-border":
|
|
995
|
-
"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",
|
|
996
994
|
// Use different bg color when inside a card
|
|
997
|
-
"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",
|
|
998
996
|
// Link variant
|
|
999
|
-
"text-lm-brand dark:text-dm-brand":
|
|
1000
|
-
"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",
|
|
1001
999
|
// Button sizes
|
|
1002
|
-
"px-1.5 py-1 text-sm":
|
|
1003
|
-
"px-3 py-1.5":
|
|
1004
|
-
"px-4 py-2 text-lg":
|
|
1005
|
-
"gap-x-1.5":
|
|
1006
|
-
"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"
|
|
1007
1005
|
},
|
|
1008
|
-
|
|
1006
|
+
a
|
|
1009
1007
|
),
|
|
1010
|
-
onKeyDown: (
|
|
1011
|
-
|
|
1008
|
+
onKeyDown: (I) => {
|
|
1009
|
+
I.key === "ArrowDown" && (I.preventDefault(), h(!0));
|
|
1012
1010
|
},
|
|
1013
1011
|
children: [
|
|
1014
1012
|
n,
|
|
1015
|
-
!
|
|
1013
|
+
!m && /* @__PURE__ */ o(C, { icon: Oe, size: "xs", widthAuto: !0 })
|
|
1016
1014
|
]
|
|
1017
1015
|
}
|
|
1018
1016
|
),
|
|
1019
|
-
|
|
1017
|
+
x && /* @__PURE__ */ o(
|
|
1020
1018
|
"div",
|
|
1021
1019
|
{
|
|
1022
|
-
ref:
|
|
1023
|
-
style:
|
|
1020
|
+
ref: b.setFloating,
|
|
1021
|
+
style: y,
|
|
1024
1022
|
className: "min-w-full z-500",
|
|
1025
|
-
...
|
|
1026
|
-
children: /* @__PURE__ */
|
|
1027
|
-
|
|
1023
|
+
...U(),
|
|
1024
|
+
children: /* @__PURE__ */ o(
|
|
1025
|
+
B,
|
|
1028
1026
|
{
|
|
1029
|
-
className:
|
|
1030
|
-
id:
|
|
1027
|
+
className: c,
|
|
1028
|
+
id: G,
|
|
1031
1029
|
focusableElementsSelector: '[role="menuitem"]:not([disabled]):not([aria-disabled]),input:not([disabled]),select:not([disabled])',
|
|
1032
1030
|
focusFirstItem: !0,
|
|
1033
|
-
onItemClick:
|
|
1034
|
-
children:
|
|
1031
|
+
onItemClick: u,
|
|
1032
|
+
children: e
|
|
1035
1033
|
}
|
|
1036
1034
|
)
|
|
1037
1035
|
}
|
|
@@ -1039,36 +1037,36 @@ const be = q({}), ht = ({ className: t, selected: r, disabled: e, onClick: n, ..
|
|
|
1039
1037
|
]
|
|
1040
1038
|
}
|
|
1041
1039
|
);
|
|
1042
|
-
},
|
|
1043
|
-
Item:
|
|
1044
|
-
Separator:
|
|
1045
|
-
Title:
|
|
1046
|
-
Misc:
|
|
1047
|
-
}),
|
|
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(
|
|
1048
1046
|
"button",
|
|
1049
1047
|
{
|
|
1050
|
-
className:
|
|
1048
|
+
className: d(
|
|
1051
1049
|
"inline-flex rounded-md focus-ring",
|
|
1052
1050
|
"text-lm-brand dark:text-dm-brand",
|
|
1053
1051
|
"highlight:text-lm-brand-dark dark:highlight:text-dm-brand-dark highlight:underline",
|
|
1054
1052
|
{
|
|
1055
|
-
"px-1.5 py-1 text-sm":
|
|
1056
|
-
"px-3 py-1.5":
|
|
1057
|
-
"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",
|
|
1058
1056
|
"cursor-pointer": !r,
|
|
1059
1057
|
"pointer-events-none opacity-65": r
|
|
1060
1058
|
},
|
|
1061
|
-
|
|
1059
|
+
e
|
|
1062
1060
|
),
|
|
1063
1061
|
disabled: r,
|
|
1064
1062
|
type: n,
|
|
1065
|
-
...
|
|
1066
|
-
ref:
|
|
1063
|
+
...a,
|
|
1064
|
+
ref: s
|
|
1067
1065
|
}
|
|
1068
|
-
)),
|
|
1069
|
-
|
|
1066
|
+
)), vt = ({ className: e, active: r, ...t }) => /* @__PURE__ */ o("li", { role: "menuitem", className: "w-full flex", "data-active": r, children: /* @__PURE__ */ o(
|
|
1067
|
+
q,
|
|
1070
1068
|
{
|
|
1071
|
-
className:
|
|
1069
|
+
className: d(
|
|
1072
1070
|
"px-2 py-3",
|
|
1073
1071
|
"max-md:w-full max-md:px-3 max-md:py-2",
|
|
1074
1072
|
"text-white no-underline highlight:opacity-100 transition-opacity",
|
|
@@ -1076,16 +1074,16 @@ const be = q({}), ht = ({ className: t, selected: r, disabled: e, onClick: n, ..
|
|
|
1076
1074
|
"opacity-60": !r,
|
|
1077
1075
|
"opacity-100": r
|
|
1078
1076
|
},
|
|
1079
|
-
|
|
1077
|
+
e
|
|
1080
1078
|
),
|
|
1081
|
-
...
|
|
1079
|
+
...t
|
|
1082
1080
|
}
|
|
1083
|
-
) }),
|
|
1084
|
-
|
|
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,
|
|
1085
1083
|
{
|
|
1086
|
-
containerClassName:
|
|
1084
|
+
containerClassName: d("max-md:w-full", e),
|
|
1087
1085
|
buttonVariant: "text",
|
|
1088
|
-
buttonClassName:
|
|
1086
|
+
buttonClassName: d(
|
|
1089
1087
|
"px-2 py-3",
|
|
1090
1088
|
"max-md:w-full max-md:px-3 max-md:py-2",
|
|
1091
1089
|
"text-white highlight:opacity-100 transition-opacity",
|
|
@@ -1097,313 +1095,313 @@ const be = q({}), ht = ({ className: t, selected: r, disabled: e, onClick: n, ..
|
|
|
1097
1095
|
),
|
|
1098
1096
|
menuAlignment: "right",
|
|
1099
1097
|
menuOffset: -3,
|
|
1100
|
-
menuClassName:
|
|
1101
|
-
...
|
|
1098
|
+
menuClassName: d("mx-2", t),
|
|
1099
|
+
...a
|
|
1102
1100
|
}
|
|
1103
|
-
) }),
|
|
1104
|
-
const { flag: n, toggle:
|
|
1105
|
-
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(
|
|
1106
1104
|
"nav",
|
|
1107
1105
|
{
|
|
1108
|
-
className:
|
|
1106
|
+
className: d(
|
|
1109
1107
|
"w-full relative",
|
|
1110
1108
|
"bg-lm-main dark:bg-dm-main",
|
|
1111
1109
|
"flex max-md:flex-col items-center justify-between",
|
|
1112
|
-
|
|
1110
|
+
e
|
|
1113
1111
|
),
|
|
1114
1112
|
children: [
|
|
1115
|
-
/* @__PURE__ */
|
|
1116
|
-
/* @__PURE__ */
|
|
1113
|
+
/* @__PURE__ */ g("div", { className: "w-full relative", children: [
|
|
1114
|
+
/* @__PURE__ */ o(
|
|
1117
1115
|
"h4",
|
|
1118
1116
|
{
|
|
1119
|
-
className:
|
|
1117
|
+
className: d(
|
|
1120
1118
|
"text-white px-4 py-3",
|
|
1121
1119
|
"max-md:w-full max-md:flex max-md:flex-col items-center"
|
|
1122
1120
|
),
|
|
1123
1121
|
children: r
|
|
1124
1122
|
}
|
|
1125
1123
|
),
|
|
1126
|
-
/* @__PURE__ */
|
|
1127
|
-
|
|
1124
|
+
/* @__PURE__ */ o(
|
|
1125
|
+
de,
|
|
1128
1126
|
{
|
|
1129
1127
|
id: i,
|
|
1130
1128
|
variant: "secondary",
|
|
1131
|
-
className:
|
|
1129
|
+
className: d(
|
|
1132
1130
|
"absolute right-0 top-[50%] translate-y-[-50%]",
|
|
1133
1131
|
"md:hidden mx-2 [&]:px-2",
|
|
1134
1132
|
"opacity-60 highlight:opacity-100 transition-opacity",
|
|
1135
|
-
"[&]:text-
|
|
1133
|
+
"[&]:text-white [&]:border-white [&]:highlight:bg-transparent"
|
|
1136
1134
|
),
|
|
1137
|
-
onClick:
|
|
1135
|
+
onClick: a,
|
|
1138
1136
|
"aria-label": `${n ? "Hide" : "Show"} menu`,
|
|
1139
|
-
"aria-controls":
|
|
1140
|
-
children: /* @__PURE__ */
|
|
1137
|
+
"aria-controls": l,
|
|
1138
|
+
children: /* @__PURE__ */ o(C, { icon: n ? Le : Re })
|
|
1141
1139
|
}
|
|
1142
1140
|
)
|
|
1143
1141
|
] }),
|
|
1144
|
-
/* @__PURE__ */
|
|
1142
|
+
/* @__PURE__ */ o(
|
|
1145
1143
|
"ul",
|
|
1146
1144
|
{
|
|
1147
|
-
id:
|
|
1145
|
+
id: l,
|
|
1148
1146
|
"aria-labelledby": i,
|
|
1149
1147
|
role: "menu",
|
|
1150
|
-
className:
|
|
1148
|
+
className: d(
|
|
1151
1149
|
"m-0 p-0",
|
|
1152
1150
|
"max-md:w-full md:mr-2 max-md:absolute max-md:top-full z-2000",
|
|
1153
1151
|
"flex max-md:flex-col items-center",
|
|
1154
1152
|
"bg-lm-main dark:bg-dm-main",
|
|
1155
1153
|
{ "max-md:hidden": !n }
|
|
1156
1154
|
),
|
|
1157
|
-
children:
|
|
1155
|
+
children: t
|
|
1158
1156
|
}
|
|
1159
1157
|
)
|
|
1160
1158
|
]
|
|
1161
1159
|
}
|
|
1162
1160
|
);
|
|
1163
|
-
},
|
|
1164
|
-
const n =
|
|
1165
|
-
return /* @__PURE__ */
|
|
1166
|
-
|
|
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(
|
|
1164
|
+
ve,
|
|
1167
1165
|
{
|
|
1168
1166
|
role: "menuitem",
|
|
1169
1167
|
to: r,
|
|
1170
|
-
className: ({ isActive:
|
|
1168
|
+
className: ({ isActive: a }) => d(
|
|
1171
1169
|
"px-4 pt-2 pb-[calc(0.5rem-3px)] border-b-3",
|
|
1172
1170
|
"highlight:text-lm-brand dark:highlight:text-dm-brand",
|
|
1173
1171
|
"font-bold text-center no-underline transition-colors",
|
|
1174
1172
|
"rounded-none outline-none focus-visible:inset-ring-2",
|
|
1175
1173
|
"focus-visible:inset-ring-lm-brand/50 dark:focus-visible:inset-ring-dm-brand/50",
|
|
1176
1174
|
{
|
|
1177
|
-
"text-lm-brand dark:text-dm-brand":
|
|
1178
|
-
"border-b-lm-brand dark:border-b-dm-brand active":
|
|
1179
|
-
"border-b-transparent text-gray-500": !
|
|
1180
|
-
"flex-grow": n
|
|
1175
|
+
"text-lm-brand dark:text-dm-brand": a,
|
|
1176
|
+
"border-b-lm-brand dark:border-b-dm-brand active": a,
|
|
1177
|
+
"border-b-transparent text-gray-500": !a,
|
|
1178
|
+
"flex-grow": n?.fill
|
|
1181
1179
|
},
|
|
1182
|
-
|
|
1180
|
+
e
|
|
1183
1181
|
),
|
|
1184
|
-
...
|
|
1182
|
+
...t
|
|
1185
1183
|
}
|
|
1186
1184
|
);
|
|
1187
|
-
},
|
|
1188
|
-
const
|
|
1189
|
-
Math.max(
|
|
1190
|
-
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
|
|
1191
1189
|
);
|
|
1192
|
-
return
|
|
1193
|
-
}, H = (
|
|
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 = [
|
|
1194
1192
|
"border border-r-0 last:border-r border-lm-border dark:border-dm-border",
|
|
1195
1193
|
"rounded-none first:rounded-l last:rounded-r"
|
|
1196
|
-
],
|
|
1197
|
-
|
|
1194
|
+
], he = (e = !1) => d(
|
|
1195
|
+
be,
|
|
1198
1196
|
"px-3 py-2 cursor-pointer no-underline",
|
|
1199
1197
|
"focus-ring focus-visible:z-1",
|
|
1200
|
-
!
|
|
1198
|
+
!e && [
|
|
1201
1199
|
"text-lm-brand dark:text-dm-brand",
|
|
1202
1200
|
"bg-lm-primary dark:bg-dm-primary",
|
|
1203
1201
|
"highlight:bg-lm-secondary dark:highlight:bg-dm-secondary"
|
|
1204
1202
|
],
|
|
1205
|
-
|
|
1206
|
-
),
|
|
1207
|
-
function
|
|
1208
|
-
const
|
|
1209
|
-
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 });
|
|
1210
1208
|
}
|
|
1211
|
-
function
|
|
1212
|
-
const
|
|
1213
|
-
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 });
|
|
1214
1212
|
}
|
|
1215
|
-
const
|
|
1216
|
-
const n = "urlForPage" in
|
|
1217
|
-
(
|
|
1218
|
-
[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]
|
|
1219
1217
|
);
|
|
1220
|
-
return r < 2 ? null : /* @__PURE__ */
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
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(
|
|
1221
|
+
a,
|
|
1224
1222
|
{
|
|
1225
|
-
active:
|
|
1226
|
-
isEllipsis: H(
|
|
1227
|
-
...
|
|
1228
|
-
children:
|
|
1223
|
+
active: l === e,
|
|
1224
|
+
isEllipsis: H(l),
|
|
1225
|
+
...s(l),
|
|
1226
|
+
children: Pt(l)
|
|
1229
1227
|
},
|
|
1230
|
-
|
|
1228
|
+
Et(l, i)
|
|
1231
1229
|
)),
|
|
1232
|
-
|
|
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 }) })
|
|
1233
1231
|
] });
|
|
1234
|
-
},
|
|
1235
|
-
|
|
1232
|
+
}, Mt = ({ buttonLabel: e = "Options", buttonSize: r = "md", ...t }) => /* @__PURE__ */ o(
|
|
1233
|
+
L,
|
|
1236
1234
|
{
|
|
1237
|
-
buttonContent: /* @__PURE__ */
|
|
1238
|
-
|
|
1235
|
+
buttonContent: /* @__PURE__ */ o(
|
|
1236
|
+
C,
|
|
1239
1237
|
{
|
|
1240
|
-
icon:
|
|
1241
|
-
|
|
1238
|
+
icon: Pe,
|
|
1239
|
+
widthAuto: !0,
|
|
1240
|
+
className: d({ "px-1": r === "sm" })
|
|
1242
1241
|
}
|
|
1243
1242
|
),
|
|
1244
1243
|
caretless: !0,
|
|
1245
|
-
buttonLabel:
|
|
1244
|
+
buttonLabel: e,
|
|
1246
1245
|
buttonSize: r,
|
|
1247
|
-
...
|
|
1246
|
+
...t
|
|
1248
1247
|
}
|
|
1249
|
-
),
|
|
1250
|
-
Item:
|
|
1251
|
-
Separator:
|
|
1252
|
-
Title:
|
|
1253
|
-
Misc:
|
|
1254
|
-
}),
|
|
1255
|
-
open:
|
|
1248
|
+
), hr = Object.assign(Mt, {
|
|
1249
|
+
Item: L.Item,
|
|
1250
|
+
Separator: L.Separator,
|
|
1251
|
+
Title: L.Title,
|
|
1252
|
+
Misc: L.Misc
|
|
1253
|
+
}), _t = ({
|
|
1254
|
+
open: e,
|
|
1256
1255
|
children: r,
|
|
1257
|
-
className:
|
|
1256
|
+
className: t,
|
|
1258
1257
|
onClose: n,
|
|
1259
|
-
...
|
|
1258
|
+
...a
|
|
1260
1259
|
}) => {
|
|
1261
|
-
const
|
|
1262
|
-
return
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
s.style.overflow = "hidden", u && (s.style.paddingRight = `${k}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();
|
|
1268
1266
|
} else
|
|
1269
|
-
|
|
1267
|
+
s.current?.close();
|
|
1270
1268
|
return () => {
|
|
1271
|
-
|
|
1269
|
+
l.style.overflow = i, l.style.paddingRight = c;
|
|
1272
1270
|
};
|
|
1273
|
-
}, [
|
|
1274
|
-
/* @__PURE__ */
|
|
1271
|
+
}, [e]), Ue(
|
|
1272
|
+
/* @__PURE__ */ o(
|
|
1275
1273
|
"dialog",
|
|
1276
1274
|
{
|
|
1277
|
-
ref:
|
|
1278
|
-
className:
|
|
1279
|
-
onCancel: (
|
|
1280
|
-
|
|
1275
|
+
ref: s,
|
|
1276
|
+
className: d("bg-transparent backdrop:bg-black/50", t),
|
|
1277
|
+
onCancel: (l) => {
|
|
1278
|
+
l.preventDefault(), n();
|
|
1281
1279
|
},
|
|
1282
|
-
...
|
|
1283
|
-
children:
|
|
1280
|
+
...a,
|
|
1281
|
+
children: e && r
|
|
1284
1282
|
}
|
|
1285
1283
|
),
|
|
1286
1284
|
document.body
|
|
1287
1285
|
);
|
|
1288
|
-
},
|
|
1289
|
-
open:
|
|
1286
|
+
}, fr = ({
|
|
1287
|
+
open: e,
|
|
1290
1288
|
onClose: r,
|
|
1291
|
-
variant:
|
|
1289
|
+
variant: t = "default",
|
|
1292
1290
|
title: n,
|
|
1293
|
-
children:
|
|
1294
|
-
className:
|
|
1295
|
-
...
|
|
1291
|
+
children: a,
|
|
1292
|
+
className: s,
|
|
1293
|
+
...l
|
|
1296
1294
|
}) => {
|
|
1297
1295
|
const {
|
|
1298
1296
|
size: i = "md",
|
|
1299
|
-
confirmText:
|
|
1300
|
-
cancelText:
|
|
1301
|
-
confirmDisabled:
|
|
1302
|
-
onConfirm:
|
|
1303
|
-
onClosed:
|
|
1304
|
-
...
|
|
1305
|
-
} = "onConfirm" in
|
|
1306
|
-
|
|
1307
|
-
}, [
|
|
1308
|
-
return
|
|
1309
|
-
if (
|
|
1310
|
-
|
|
1297
|
+
confirmText: c = "Confirm",
|
|
1298
|
+
cancelText: m = "Cancel",
|
|
1299
|
+
confirmDisabled: f,
|
|
1300
|
+
onConfirm: w,
|
|
1301
|
+
onClosed: x,
|
|
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?.();
|
|
1305
|
+
}, [w]);
|
|
1306
|
+
return R(() => {
|
|
1307
|
+
if (e) {
|
|
1308
|
+
y.current = "cancel", p(!0);
|
|
1311
1309
|
return;
|
|
1312
1310
|
}
|
|
1313
|
-
const
|
|
1314
|
-
if (
|
|
1315
|
-
delete
|
|
1316
|
-
let
|
|
1317
|
-
const
|
|
1318
|
-
|
|
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));
|
|
1319
1317
|
};
|
|
1320
|
-
return
|
|
1321
|
-
|
|
1318
|
+
return N.addEventListener("transitionend", U), () => {
|
|
1319
|
+
N.removeEventListener("transitionend", U);
|
|
1322
1320
|
};
|
|
1323
1321
|
}
|
|
1324
|
-
}, [
|
|
1325
|
-
const
|
|
1326
|
-
|
|
1327
|
-
}, [
|
|
1328
|
-
|
|
1322
|
+
}, [x, e]), R(() => {
|
|
1323
|
+
const N = b.current;
|
|
1324
|
+
u && N && (N.dataset.open = "");
|
|
1325
|
+
}, [u]), /* @__PURE__ */ o(
|
|
1326
|
+
_t,
|
|
1329
1327
|
{
|
|
1330
|
-
open:
|
|
1328
|
+
open: u,
|
|
1331
1329
|
onClose: r,
|
|
1332
|
-
className:
|
|
1330
|
+
className: d(
|
|
1333
1331
|
{
|
|
1334
|
-
"flex w-screen h-screen max-w-screen max-h-screen":
|
|
1335
|
-
"overflow-hidden":
|
|
1332
|
+
"flex w-screen h-screen max-w-screen max-h-screen": u,
|
|
1333
|
+
"overflow-hidden": t === "cover"
|
|
1336
1334
|
},
|
|
1337
|
-
|
|
1335
|
+
s
|
|
1338
1336
|
),
|
|
1339
|
-
...
|
|
1340
|
-
children: /* @__PURE__ */
|
|
1337
|
+
...h,
|
|
1338
|
+
children: /* @__PURE__ */ o(
|
|
1341
1339
|
"form",
|
|
1342
1340
|
{
|
|
1343
1341
|
"data-testid": "transition-container",
|
|
1344
|
-
ref:
|
|
1345
|
-
className:
|
|
1342
|
+
ref: b,
|
|
1343
|
+
className: d(
|
|
1346
1344
|
"w-full m-auto p-4 sm:p-6",
|
|
1347
1345
|
// CSS transitions are based on the presence of the `data-open` attribute
|
|
1348
1346
|
"-translate-y-4 data-open:translate-y-0 opacity-0 data-open:opacity-100",
|
|
1349
1347
|
"transition-[opacity_,_translate] duration-300",
|
|
1350
1348
|
// Handle modal dimensions for different variants and sizes
|
|
1351
|
-
|
|
1349
|
+
t !== "cover" && {
|
|
1352
1350
|
"sm:w-sm": i === "sm",
|
|
1353
1351
|
"md:w-lg": i === "md",
|
|
1354
1352
|
"md:w-4xl": i === "lg",
|
|
1355
1353
|
"md:w-6xl": i === "xl"
|
|
1356
1354
|
},
|
|
1357
|
-
{ "h-full":
|
|
1355
|
+
{ "h-full": t === "cover" }
|
|
1358
1356
|
),
|
|
1359
|
-
onSubmit:
|
|
1360
|
-
children: /* @__PURE__ */
|
|
1357
|
+
onSubmit: A,
|
|
1358
|
+
children: /* @__PURE__ */ o(O, { className: d(
|
|
1361
1359
|
"w-full",
|
|
1362
|
-
{ "h-full relative overflow-auto":
|
|
1363
|
-
), children:
|
|
1364
|
-
/* @__PURE__ */
|
|
1360
|
+
{ "h-full relative overflow-auto": t === "cover" }
|
|
1361
|
+
), children: t === "cover" ? /* @__PURE__ */ g($, { children: [
|
|
1362
|
+
/* @__PURE__ */ g(
|
|
1365
1363
|
"div",
|
|
1366
1364
|
{
|
|
1367
|
-
className:
|
|
1365
|
+
className: d(
|
|
1368
1366
|
"px-4 py-3 absolute top-0 left-0 right-0 z-3000",
|
|
1369
1367
|
"flex items-center justify-between",
|
|
1370
1368
|
"text-white bg-linear-to-b from-black/70 to-black/10",
|
|
1371
1369
|
"[text-shadow:_0_2px_4px_rgb(0_0_0/_0.8)]"
|
|
1372
1370
|
),
|
|
1373
1371
|
children: [
|
|
1374
|
-
/* @__PURE__ */
|
|
1375
|
-
/* @__PURE__ */
|
|
1372
|
+
/* @__PURE__ */ o("h5", { children: n }),
|
|
1373
|
+
/* @__PURE__ */ o(Y, { onClick: r, label: "Close dialog" })
|
|
1376
1374
|
]
|
|
1377
1375
|
}
|
|
1378
1376
|
),
|
|
1379
|
-
|
|
1380
|
-
] }) : /* @__PURE__ */
|
|
1381
|
-
/* @__PURE__ */
|
|
1377
|
+
a
|
|
1378
|
+
] }) : /* @__PURE__ */ g($, { children: [
|
|
1379
|
+
/* @__PURE__ */ g(O.Header, { className: d(
|
|
1382
1380
|
"sticky top-0",
|
|
1383
1381
|
"flex items-center justify-between gap-x-2"
|
|
1384
1382
|
), children: [
|
|
1385
|
-
/* @__PURE__ */
|
|
1386
|
-
/* @__PURE__ */
|
|
1383
|
+
/* @__PURE__ */ o("h5", { className: d({ "text-danger": t === "danger" }), children: n }),
|
|
1384
|
+
/* @__PURE__ */ o(Y, { onClick: r, label: "Close dialog" })
|
|
1387
1385
|
] }),
|
|
1388
|
-
/* @__PURE__ */
|
|
1389
|
-
|
|
1390
|
-
|
|
1386
|
+
/* @__PURE__ */ o(O.Body, { children: a }),
|
|
1387
|
+
w && /* @__PURE__ */ g(
|
|
1388
|
+
O.Footer,
|
|
1391
1389
|
{
|
|
1392
1390
|
"data-testid": "footer",
|
|
1393
|
-
className:
|
|
1391
|
+
className: d(
|
|
1394
1392
|
"flex justify-end items-center gap-x-2",
|
|
1395
1393
|
"[&]:px-3 sticky bottom-0"
|
|
1396
1394
|
),
|
|
1397
1395
|
children: [
|
|
1398
|
-
/* @__PURE__ */
|
|
1399
|
-
/* @__PURE__ */
|
|
1400
|
-
|
|
1396
|
+
/* @__PURE__ */ o(kt, { onClick: r, children: m }),
|
|
1397
|
+
/* @__PURE__ */ o(
|
|
1398
|
+
de,
|
|
1401
1399
|
{
|
|
1402
1400
|
solid: !0,
|
|
1403
|
-
variant:
|
|
1404
|
-
disabled:
|
|
1401
|
+
variant: t === "danger" ? "danger" : "primary",
|
|
1402
|
+
disabled: f,
|
|
1405
1403
|
type: "submit",
|
|
1406
|
-
children:
|
|
1404
|
+
children: c
|
|
1407
1405
|
}
|
|
1408
1406
|
)
|
|
1409
1407
|
]
|
|
@@ -1414,46 +1412,46 @@ const hr = ({ currentPage: t, pagesCount: r, ...e }) => {
|
|
|
1414
1412
|
)
|
|
1415
1413
|
}
|
|
1416
1414
|
);
|
|
1417
|
-
},
|
|
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", {
|
|
1418
1416
|
"text-gray-500 dark:text-gray-400": n === "default",
|
|
1419
1417
|
"text-danger": n === "error"
|
|
1420
1418
|
}), children: [
|
|
1421
|
-
|
|
1422
|
-
/* @__PURE__ */
|
|
1423
|
-
/* @__PURE__ */
|
|
1419
|
+
t && /* @__PURE__ */ g($, { children: [
|
|
1420
|
+
/* @__PURE__ */ o(C, { icon: se, spin: !0 }),
|
|
1421
|
+
/* @__PURE__ */ o("span", { className: "ml-2", children: r ?? "Loading..." })
|
|
1424
1422
|
] }),
|
|
1425
|
-
!
|
|
1426
|
-
] }) }),
|
|
1423
|
+
!t && r
|
|
1424
|
+
] }) }), yr = ({ variant: e, className: r, size: t = "md", children: n }) => /* @__PURE__ */ o(
|
|
1427
1425
|
"div",
|
|
1428
1426
|
{
|
|
1429
|
-
className:
|
|
1427
|
+
className: d(
|
|
1430
1428
|
"rounded-md text-center",
|
|
1431
1429
|
{
|
|
1432
|
-
"p-2":
|
|
1433
|
-
"p-4":
|
|
1434
|
-
"p-6":
|
|
1435
|
-
"[&]:text-white":
|
|
1436
|
-
"bg-lm-brand dark:bg-dm-brand":
|
|
1437
|
-
"bg-danger":
|
|
1438
|
-
"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"
|
|
1439
1437
|
},
|
|
1440
1438
|
r
|
|
1441
1439
|
),
|
|
1442
1440
|
children: n
|
|
1443
1441
|
}
|
|
1444
|
-
), wr = ({ placement:
|
|
1445
|
-
const r =
|
|
1442
|
+
), wr = ({ placement: e = "auto" } = {}) => {
|
|
1443
|
+
const r = T(null), t = (() => {
|
|
1446
1444
|
const p = [];
|
|
1447
|
-
return
|
|
1448
|
-
})(), [n,
|
|
1449
|
-
placement:
|
|
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,
|
|
1450
1448
|
open: n,
|
|
1451
|
-
onOpenChange:
|
|
1452
|
-
middleware:
|
|
1453
|
-
}),
|
|
1449
|
+
onOpenChange: a,
|
|
1450
|
+
middleware: t
|
|
1451
|
+
}), m = He(i, {
|
|
1454
1452
|
delay: { open: 300 },
|
|
1455
1453
|
move: !0
|
|
1456
|
-
}), { getFloatingProps:
|
|
1454
|
+
}), { getFloatingProps: f, getReferenceProps: w } = ie([m]), { isMounted: x, styles: h } = $e(i, { duration: 200 }), u = E(() => {
|
|
1457
1455
|
const p = i.placement.split("-")[0];
|
|
1458
1456
|
return {
|
|
1459
1457
|
top: "bottom",
|
|
@@ -1463,212 +1461,203 @@ const hr = ({ currentPage: t, pagesCount: r, ...e }) => {
|
|
|
1463
1461
|
}[p] ?? "";
|
|
1464
1462
|
}, [i.placement]);
|
|
1465
1463
|
return {
|
|
1466
|
-
anchor: { ...
|
|
1464
|
+
anchor: { ...w(), ref: s.setReference },
|
|
1467
1465
|
tooltip: {
|
|
1468
|
-
...
|
|
1469
|
-
refSetter:
|
|
1470
|
-
isMounted:
|
|
1471
|
-
styles: { ...
|
|
1472
|
-
arrowPos:
|
|
1466
|
+
...f(),
|
|
1467
|
+
refSetter: s.setFloating,
|
|
1468
|
+
isMounted: x,
|
|
1469
|
+
styles: { ...l, ...h },
|
|
1470
|
+
arrowPos: c.arrow,
|
|
1473
1471
|
arrowRef: r,
|
|
1474
|
-
arrowSide:
|
|
1472
|
+
arrowSide: u
|
|
1475
1473
|
}
|
|
1476
1474
|
};
|
|
1477
|
-
},
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
"
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
"
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
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",
|
|
1488
1499
|
{
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
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"
|
|
1493
1518
|
}
|
|
1494
|
-
)
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
t,
|
|
1501
|
-
/* @__PURE__ */ a(
|
|
1502
|
-
"div",
|
|
1503
|
-
{
|
|
1504
|
-
ref: l,
|
|
1505
|
-
className: f(
|
|
1506
|
-
"absolute",
|
|
1507
|
-
// Render as a triangle
|
|
1508
|
-
"border-l-6 border-r-6 border-b-6 border-l-transparent border-r-transparent border-b-black/90",
|
|
1509
|
-
// Rotate triangle so that it points to the correct direction
|
|
1510
|
-
{
|
|
1511
|
-
"rotate-180": s === "bottom",
|
|
1512
|
-
"rotate-90 mr-[-3px]": s === "right",
|
|
1513
|
-
"rotate-270 ml-[-3px]": s === "left"
|
|
1514
|
-
}
|
|
1515
|
-
),
|
|
1516
|
-
style: {
|
|
1517
|
-
left: o == null ? void 0 : o.x,
|
|
1518
|
-
top: o == null ? void 0 : o.y,
|
|
1519
|
-
[s]: `${-(((d = l.current) == null ? void 0 : d.offsetWidth) ?? 0) / 2}px`
|
|
1520
|
-
},
|
|
1521
|
-
"data-testid": "arrow"
|
|
1522
|
-
}
|
|
1523
|
-
)
|
|
1524
|
-
] })
|
|
1525
|
-
}
|
|
1526
|
-
);
|
|
1527
|
-
};
|
|
1528
|
-
function Ft(t) {
|
|
1529
|
-
if (t.currentField !== t.newField)
|
|
1519
|
+
)
|
|
1520
|
+
] })
|
|
1521
|
+
}
|
|
1522
|
+
);
|
|
1523
|
+
function Ft(e) {
|
|
1524
|
+
if (e.currentField !== e.newField)
|
|
1530
1525
|
return "ASC";
|
|
1531
1526
|
const r = {
|
|
1532
1527
|
ASC: "DESC",
|
|
1533
1528
|
DESC: void 0
|
|
1534
1529
|
};
|
|
1535
|
-
return
|
|
1530
|
+
return e.currentOrderDir ? r[e.currentOrderDir] : "ASC";
|
|
1536
1531
|
}
|
|
1537
|
-
function
|
|
1538
|
-
const r = Ft(
|
|
1532
|
+
function Bt(e) {
|
|
1533
|
+
const r = Ft(e);
|
|
1539
1534
|
return {
|
|
1540
|
-
field: r ?
|
|
1535
|
+
field: r ? e.newField : void 0,
|
|
1541
1536
|
dir: r
|
|
1542
1537
|
};
|
|
1543
1538
|
}
|
|
1544
|
-
const
|
|
1545
|
-
const
|
|
1546
|
-
return n[r] >
|
|
1547
|
-
}),
|
|
1548
|
-
const [r,
|
|
1549
|
-
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 };
|
|
1550
1545
|
};
|
|
1551
|
-
function
|
|
1552
|
-
const
|
|
1553
|
-
const
|
|
1554
|
-
|
|
1555
|
-
}, [
|
|
1556
|
-
return /* @__PURE__ */
|
|
1557
|
-
|
|
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,
|
|
1558
1553
|
{
|
|
1559
|
-
buttonContent: /* @__PURE__ */
|
|
1554
|
+
buttonContent: /* @__PURE__ */ g($, { children: [
|
|
1560
1555
|
!i && "Order by",
|
|
1561
|
-
i && !r.field && /* @__PURE__ */
|
|
1562
|
-
i && r.field && /* @__PURE__ */
|
|
1556
|
+
i && !r.field && /* @__PURE__ */ o("i", { children: "Order by..." }),
|
|
1557
|
+
i && r.field && /* @__PURE__ */ g($, { children: [
|
|
1563
1558
|
n && "Order by: ",
|
|
1564
|
-
|
|
1559
|
+
e[r.field],
|
|
1565
1560
|
" - ",
|
|
1566
1561
|
r.dir ?? "DESC"
|
|
1567
1562
|
] })
|
|
1568
1563
|
] }),
|
|
1569
|
-
buttonVariant:
|
|
1570
|
-
...
|
|
1564
|
+
buttonVariant: a,
|
|
1565
|
+
...s,
|
|
1571
1566
|
children: [
|
|
1572
|
-
Object.entries(
|
|
1573
|
-
|
|
1567
|
+
Object.entries(e).map(([c, m]) => /* @__PURE__ */ g(
|
|
1568
|
+
L.Item,
|
|
1574
1569
|
{
|
|
1575
|
-
selected: r.field ===
|
|
1576
|
-
onClick: () =>
|
|
1570
|
+
selected: r.field === c,
|
|
1571
|
+
onClick: () => l(c),
|
|
1577
1572
|
className: "flex items-center justify-between gap-2",
|
|
1578
1573
|
children: [
|
|
1579
|
-
|
|
1580
|
-
r.field ===
|
|
1574
|
+
m,
|
|
1575
|
+
r.field === c && /* @__PURE__ */ o(C, { icon: r.dir === "ASC" ? Ee : Se })
|
|
1581
1576
|
]
|
|
1582
1577
|
},
|
|
1583
|
-
|
|
1578
|
+
c
|
|
1584
1579
|
)),
|
|
1585
|
-
/* @__PURE__ */
|
|
1586
|
-
/* @__PURE__ */
|
|
1580
|
+
/* @__PURE__ */ o(L.Separator, {}),
|
|
1581
|
+
/* @__PURE__ */ o(L.Item, { disabled: !r.field, onClick: () => t({}), children: /* @__PURE__ */ o("i", { children: "Clear selection" }) })
|
|
1587
1582
|
]
|
|
1588
1583
|
}
|
|
1589
1584
|
);
|
|
1590
1585
|
}
|
|
1591
|
-
const Ht = "#4696e5",
|
|
1592
|
-
|
|
1593
|
-
return (
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
return ((t = document.querySelector("html")) == null ? void 0 : t.getAttribute("data-theme")) === "dark";
|
|
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);
|
|
1601
|
-
}, [r]), [r, e];
|
|
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(() => {
|
|
1589
|
+
Gt(r);
|
|
1590
|
+
}, [r]), [r, t];
|
|
1602
1591
|
};
|
|
1603
1592
|
export {
|
|
1604
|
-
|
|
1605
|
-
|
|
1593
|
+
$t as BRAND_COLOR_ALPHA_DM,
|
|
1594
|
+
Ut as BRAND_COLOR_ALPHA_LM,
|
|
1606
1595
|
Ht as BRAND_COLOR_DM,
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1596
|
+
jt as BRAND_COLOR_LM,
|
|
1597
|
+
Ct as BaseNavBar,
|
|
1598
|
+
de as Button,
|
|
1599
|
+
O as Card,
|
|
1600
|
+
fr as CardModal,
|
|
1601
|
+
rr as Checkbox,
|
|
1602
|
+
Y as CloseButton,
|
|
1603
|
+
dr as CopyToClipboardButton,
|
|
1604
|
+
er as Details,
|
|
1605
|
+
L as Dropdown,
|
|
1617
1606
|
K as ELLIPSIS,
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1607
|
+
Or as HIGHLIGHTED_COLOR,
|
|
1608
|
+
Lr as HIGHLIGHTED_COLOR_ALPHA,
|
|
1609
|
+
J as Input,
|
|
1610
|
+
Z as Label,
|
|
1611
|
+
nr as LabelledInput,
|
|
1612
|
+
or as LabelledRevealablePasswordInput,
|
|
1613
|
+
ar as LabelledSelect,
|
|
1614
|
+
kt as LinkButton,
|
|
1615
|
+
Ye as Listbox,
|
|
1616
|
+
B as Menu,
|
|
1617
|
+
xr as Message,
|
|
1618
|
+
_t as ModalDialog,
|
|
1619
|
+
ur as NavBar,
|
|
1620
|
+
pr as NavPills,
|
|
1621
|
+
Tr as OrderingDropdown,
|
|
1622
|
+
Pr as PRIMARY_DARK_COLOR,
|
|
1623
|
+
Rr as PRIMARY_LIGHT_COLOR,
|
|
1624
|
+
br as Paginator,
|
|
1625
|
+
yr as Result,
|
|
1626
|
+
tt as RevealablePasswordInput,
|
|
1627
|
+
hr as RowDropdown,
|
|
1628
|
+
at as SearchCombobox,
|
|
1629
|
+
nt as SearchInput,
|
|
1630
|
+
rt as Select,
|
|
1631
|
+
Qe as SimpleCard,
|
|
1632
|
+
tr as Table,
|
|
1644
1633
|
sr as TagsAutocomplete,
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1634
|
+
lr as ToggleSwitch,
|
|
1635
|
+
kr as Tooltip,
|
|
1636
|
+
Ar as brandColor,
|
|
1637
|
+
Ir as brandColorAlpha,
|
|
1638
|
+
Gt as changeThemeInMarkup,
|
|
1639
|
+
Bt as determineOrder,
|
|
1651
1640
|
Ft as determineOrderDir,
|
|
1652
|
-
|
|
1641
|
+
Ot as formatNumber,
|
|
1653
1642
|
Kt as getSystemPreferredTheme,
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1643
|
+
xe as isDarkThemeEnabled,
|
|
1644
|
+
mt as isLightColor,
|
|
1645
|
+
Et as keyForPage,
|
|
1646
|
+
Nr as orderToString,
|
|
1658
1647
|
H as pageIsEllipsis,
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1648
|
+
ut as parseQueryString,
|
|
1649
|
+
Pt as prettifyPageNumber,
|
|
1650
|
+
Rt as progressivePagination,
|
|
1662
1651
|
gr as roundTen,
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1652
|
+
vr as sortList,
|
|
1653
|
+
Cr as stringToOrder,
|
|
1654
|
+
cr as stringifyQueryParams,
|
|
1655
|
+
dt as useArrowKeyNavigation,
|
|
1656
|
+
ir as useGoBack,
|
|
1657
|
+
mr as useParsedQuery,
|
|
1658
|
+
Er as useTheme,
|
|
1659
|
+
me as useTimeout,
|
|
1671
1660
|
gt as useTimeoutToggle,
|
|
1672
|
-
|
|
1661
|
+
ue as useToggle,
|
|
1673
1662
|
wr as useTooltip
|
|
1674
1663
|
};
|