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