@shlinkio/shlink-frontend-kit 0.8.6 → 0.8.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +3 -0
- package/dist/index.js +107 -104
- package/dist/tailwind.d.ts +60 -1
- package/dist/tailwind.js +503 -380
- package/dist/use-toggle-CNvdDGvy.js +22 -0
- package/package.json +1 -1
- package/dist/use-toggle-DlYE68B3.js +0 -24
package/dist/tailwind.js
CHANGED
|
@@ -1,111 +1,219 @@
|
|
|
1
|
-
import { jsx as o, jsxs as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import { Link as
|
|
5
|
-
import { faClose as
|
|
6
|
-
import { FontAwesomeIcon as
|
|
7
|
-
import { a as
|
|
8
|
-
import { createPortal as
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { jsx as o, jsxs as b, Fragment as S } from "react/jsx-runtime";
|
|
2
|
+
import i, { clsx as x } from "clsx";
|
|
3
|
+
import { useState as K, useEffect as M, createContext as H, useContext as v, forwardRef as p, useCallback as I, useId as _, useRef as L, useMemo as Q } from "react";
|
|
4
|
+
import { Link as j, NavLink as nt } from "react-router";
|
|
5
|
+
import { faClose as at, faEyeSlash as lt, faEye as dt, faCircleNotch as V, faSearch as st, faChevronLeft as q, faChevronRight as z } from "@fortawesome/free-solid-svg-icons";
|
|
6
|
+
import { FontAwesomeIcon as k } from "@fortawesome/react-fontawesome";
|
|
7
|
+
import { a as it, u as wt } from "./use-toggle-CNvdDGvy.js";
|
|
8
|
+
import { createPortal as ct } from "react-dom";
|
|
9
|
+
const mt = ({ className: t, ...e }) => /* @__PURE__ */ o(
|
|
10
|
+
"div",
|
|
11
|
+
{
|
|
12
|
+
className: i(
|
|
13
|
+
"tw:px-4 tw:py-3 tw:rounded-t-md",
|
|
14
|
+
"tw:bg-lm-primary tw:dark:bg-dm-primary tw:border-b tw:border-lm-border tw:dark:border-dm-border",
|
|
15
|
+
t
|
|
16
|
+
),
|
|
17
|
+
...e
|
|
18
|
+
}
|
|
19
|
+
), gt = ({ className: t, ...e }) => /* @__PURE__ */ o(
|
|
20
|
+
"div",
|
|
21
|
+
{
|
|
22
|
+
className: i(
|
|
23
|
+
"tw:p-4 tw:bg-lm-primary tw:dark:bg-dm-primary tw:first:rounded-t-md",
|
|
24
|
+
"tw:first:rounded-t-md tw:last:rounded-b-md",
|
|
25
|
+
t
|
|
26
|
+
),
|
|
27
|
+
...e
|
|
28
|
+
}
|
|
29
|
+
), bt = ({ className: t, ...e }) => /* @__PURE__ */ o(
|
|
30
|
+
"div",
|
|
31
|
+
{
|
|
32
|
+
className: i(
|
|
33
|
+
"tw:px-4 tw:py-3 tw:rounded-b-md",
|
|
34
|
+
"tw:bg-lm-primary tw:dark:bg-dm-primary tw:border-t tw:border-lm-border tw:dark:border-dm-border",
|
|
35
|
+
t
|
|
36
|
+
),
|
|
37
|
+
...e
|
|
38
|
+
}
|
|
39
|
+
), ut = ({ className: t, ...e }) => /* @__PURE__ */ o(
|
|
40
|
+
"div",
|
|
41
|
+
{
|
|
42
|
+
className: i(
|
|
43
|
+
"tw:group/card tw:rounded-md tw:shadow-md",
|
|
44
|
+
"tw:border tw:border-lm-border tw:dark:border-dm-border tw:bg-lm-primary tw:dark:bg-dm-primary",
|
|
45
|
+
t
|
|
46
|
+
),
|
|
47
|
+
...e
|
|
48
|
+
}
|
|
49
|
+
), f = Object.assign(ut, { Body: gt, Header: mt, Footer: bt }), pt = ({ bodyClassName: t, children: e, ...r }) => {
|
|
50
|
+
const { title: n, titleSize: a = "md", ...d } = "title" in r ? r : {
|
|
51
|
+
...r,
|
|
52
|
+
title: void 0,
|
|
53
|
+
titleSize: void 0
|
|
54
|
+
};
|
|
55
|
+
return /* @__PURE__ */ b(f, { ...d, children: [
|
|
56
|
+
n && /* @__PURE__ */ b(f.Header, { children: [
|
|
57
|
+
a === "lg" && /* @__PURE__ */ o("h4", { children: n }),
|
|
58
|
+
a === "md" && /* @__PURE__ */ o("h5", { children: n }),
|
|
59
|
+
a === "sm" && /* @__PURE__ */ o("h6", { children: n })
|
|
60
|
+
] }),
|
|
61
|
+
/* @__PURE__ */ o(f.Body, { className: t, children: e })
|
|
62
|
+
] });
|
|
63
|
+
};
|
|
64
|
+
function ht({
|
|
65
|
+
id: t,
|
|
66
|
+
items: e,
|
|
67
|
+
onSelectItem: r,
|
|
68
|
+
renderItem: n,
|
|
69
|
+
className: a,
|
|
70
|
+
noItemsMessage: d = "No items",
|
|
71
|
+
anchor: l,
|
|
72
|
+
"aria-label": s = "Items",
|
|
73
|
+
...c
|
|
74
|
+
}) {
|
|
75
|
+
const [g, m] = K(0);
|
|
76
|
+
return M(() => {
|
|
77
|
+
const w = l == null ? void 0 : l.current;
|
|
78
|
+
if (!w)
|
|
79
|
+
return;
|
|
80
|
+
const u = (h) => {
|
|
81
|
+
h.key === "ArrowDown" ? m((y) => Math.min(y + 1, e.size - 1)) : h.key === "ArrowUp" ? m((y) => Math.max(y - 1, 0)) : h.key === "Enter" && r([...e.values()][g]);
|
|
82
|
+
};
|
|
83
|
+
return w.addEventListener("keydown", u), () => w.removeEventListener("keydown", u);
|
|
84
|
+
}, [g, l, e, r]), /* @__PURE__ */ b(
|
|
85
|
+
f,
|
|
86
|
+
{
|
|
87
|
+
id: t,
|
|
88
|
+
className: i("tw:py-1 tw:flex tw:flex-col", a),
|
|
89
|
+
role: "listbox",
|
|
90
|
+
"aria-orientation": "vertical",
|
|
91
|
+
"aria-label": s,
|
|
92
|
+
...c,
|
|
93
|
+
children: [
|
|
94
|
+
e.size === 0 && /* @__PURE__ */ o("i", { role: "option", "aria-disabled": !0, "aria-selected": !1, "data-testid": "no-items", className: "tw:px-2 tw:py-1", children: d }),
|
|
95
|
+
[...e.entries()].map(([w, u], h) => /* @__PURE__ */ o(
|
|
96
|
+
"button",
|
|
97
|
+
{
|
|
98
|
+
type: "button",
|
|
99
|
+
role: "option",
|
|
100
|
+
"aria-selected": h === g,
|
|
101
|
+
className: i(
|
|
102
|
+
"tw:px-2 tw:py-1 tw:text-left tw:truncate",
|
|
103
|
+
{ "tw:bg-lm-secondary tw:dark:bg-dm-secondary": h === g }
|
|
104
|
+
),
|
|
105
|
+
tabIndex: -1,
|
|
106
|
+
onClick: () => r(u),
|
|
107
|
+
onMouseOver: () => m(h),
|
|
108
|
+
children: n(u)
|
|
109
|
+
},
|
|
110
|
+
w
|
|
111
|
+
))
|
|
112
|
+
]
|
|
113
|
+
}
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
const B = H(void 0), C = H({ responsive: !0 }), ft = ({ children: t, className: e }) => {
|
|
117
|
+
const { responsive: r } = v(C);
|
|
118
|
+
return /* @__PURE__ */ o(B.Provider, { value: { section: "head" }, children: /* @__PURE__ */ o(
|
|
12
119
|
"thead",
|
|
13
120
|
{
|
|
14
|
-
className:
|
|
15
|
-
{ "tw:hidden tw:lg:table-header-group":
|
|
16
|
-
|
|
121
|
+
className: i(
|
|
122
|
+
{ "tw:hidden tw:lg:table-header-group": r },
|
|
123
|
+
e
|
|
17
124
|
),
|
|
18
125
|
children: t
|
|
19
126
|
}
|
|
20
127
|
) });
|
|
21
|
-
},
|
|
22
|
-
const { responsive:
|
|
23
|
-
return /* @__PURE__ */ o(
|
|
128
|
+
}, xt = ({ children: t, className: e }) => {
|
|
129
|
+
const { responsive: r } = v(C);
|
|
130
|
+
return /* @__PURE__ */ o(B.Provider, { value: { section: "body" }, children: /* @__PURE__ */ o(
|
|
24
131
|
"tbody",
|
|
25
132
|
{
|
|
26
|
-
className:
|
|
27
|
-
{ "tw:lg:table-row-group tw:flex tw:flex-col tw:gap-y-3":
|
|
28
|
-
|
|
133
|
+
className: i(
|
|
134
|
+
{ "tw:lg:table-row-group tw:flex tw:flex-col tw:gap-y-3": r },
|
|
135
|
+
e
|
|
29
136
|
),
|
|
30
137
|
children: t
|
|
31
138
|
}
|
|
32
139
|
) });
|
|
33
|
-
},
|
|
34
|
-
const { responsive:
|
|
35
|
-
return /* @__PURE__ */ o(
|
|
140
|
+
}, yt = ({ children: t, className: e }) => {
|
|
141
|
+
const { responsive: r } = v(C);
|
|
142
|
+
return /* @__PURE__ */ o(B.Provider, { value: { section: "footer" }, children: /* @__PURE__ */ o(
|
|
36
143
|
"tfoot",
|
|
37
144
|
{
|
|
38
|
-
className:
|
|
39
|
-
{ "tw:lg:table-row-group tw:flex tw:flex-col tw:gap-y-3 tw:mt-4":
|
|
40
|
-
|
|
145
|
+
className: i(
|
|
146
|
+
{ "tw:lg:table-row-group tw:flex tw:flex-col tw:gap-y-3 tw:mt-4": r },
|
|
147
|
+
e
|
|
41
148
|
),
|
|
42
149
|
children: t
|
|
43
150
|
}
|
|
44
151
|
) });
|
|
45
|
-
},
|
|
46
|
-
const n =
|
|
152
|
+
}, kt = ({ children: t, className: e, ...r }) => {
|
|
153
|
+
const n = v(B), a = (n == null ? void 0 : n.section) === "body", { responsive: d } = v(C);
|
|
47
154
|
return /* @__PURE__ */ o(
|
|
48
155
|
"tr",
|
|
49
156
|
{
|
|
50
|
-
className:
|
|
157
|
+
className: i(
|
|
51
158
|
"tw:group",
|
|
52
159
|
{
|
|
53
|
-
"tw:lg:table-row tw:flex tw:flex-col":
|
|
54
|
-
"tw:lg:border-0 tw:border-y-2 tw:border-lm-border tw:dark:border-dm-border":
|
|
160
|
+
"tw:lg:table-row tw:flex tw:flex-col": d,
|
|
161
|
+
"tw:lg:border-0 tw:border-y-2 tw:border-lm-border tw:dark:border-dm-border": d,
|
|
55
162
|
"tw:hover:bg-lm-primary tw:dark:hover:bg-dm-primary": a,
|
|
56
163
|
// Use a different hover bg color depending on the table being inside a card or not
|
|
57
164
|
"tw:group-[&]/card:hover:bg-lm-secondary tw:dark:group-[&]/card:hover:bg-dm-secondary": a
|
|
58
165
|
},
|
|
59
|
-
|
|
166
|
+
e
|
|
60
167
|
),
|
|
61
|
-
...
|
|
168
|
+
...r,
|
|
62
169
|
children: t
|
|
63
170
|
}
|
|
64
171
|
);
|
|
65
|
-
},
|
|
66
|
-
const
|
|
172
|
+
}, vt = ({ children: t, className: e, columnName: r, type: n, ...a }) => {
|
|
173
|
+
const d = v(B), l = n ?? ((d == null ? void 0 : d.section) !== "body" ? "th" : "td"), { responsive: s } = v(C);
|
|
67
174
|
return /* @__PURE__ */ o(
|
|
68
|
-
|
|
175
|
+
l,
|
|
69
176
|
{
|
|
70
|
-
"data-column": s ?
|
|
71
|
-
className:
|
|
177
|
+
"data-column": s ? r : void 0,
|
|
178
|
+
className: i(
|
|
72
179
|
"tw:p-2 tw:border-lm-border tw:dark:border-dm-border",
|
|
73
180
|
{
|
|
74
181
|
"tw:border-b-1": !s,
|
|
75
182
|
"tw:block tw:lg:table-cell tw:not-last:border-b-1 tw:lg:border-b-1": s,
|
|
76
183
|
// For md and lower, display the content in data-column attribute as before
|
|
77
|
-
"tw:before:lg:hidden tw:before:content-[attr(data-column)] tw:before:font-bold tw:before:mr-1": s &&
|
|
184
|
+
"tw:before:lg:hidden tw:before:content-[attr(data-column)] tw:before:font-bold tw:before:mr-1": s && l === "td"
|
|
78
185
|
},
|
|
79
|
-
|
|
186
|
+
e
|
|
80
187
|
),
|
|
81
188
|
...a,
|
|
82
189
|
children: t
|
|
83
190
|
}
|
|
84
191
|
);
|
|
85
|
-
},
|
|
86
|
-
/* @__PURE__ */ o(
|
|
87
|
-
/* @__PURE__ */ o(
|
|
88
|
-
|
|
89
|
-
] }) }), Kt = Object.assign(
|
|
192
|
+
}, Nt = ({ header: t, footer: e, children: r, responsive: n = !0, ...a }) => /* @__PURE__ */ o(C.Provider, { value: { responsive: n }, children: /* @__PURE__ */ b("table", { className: "tw:w-full", ...a, children: [
|
|
193
|
+
/* @__PURE__ */ o(ft, { children: t }),
|
|
194
|
+
/* @__PURE__ */ o(xt, { children: r }),
|
|
195
|
+
e && /* @__PURE__ */ o(yt, { children: e })
|
|
196
|
+
] }) }), Kt = Object.assign(Nt, { Row: kt, Cell: vt }), Pt = ({
|
|
90
197
|
children: t,
|
|
91
|
-
className:
|
|
92
|
-
disabled:
|
|
198
|
+
className: e,
|
|
199
|
+
disabled: r,
|
|
93
200
|
variant: n = "primary",
|
|
94
201
|
size: a = "md",
|
|
95
|
-
inline:
|
|
96
|
-
solid:
|
|
97
|
-
|
|
202
|
+
inline: d = !1,
|
|
203
|
+
solid: l = !1,
|
|
204
|
+
type: s = "button",
|
|
205
|
+
...c
|
|
98
206
|
}) => {
|
|
99
|
-
const
|
|
207
|
+
const g = "to" in c ? j : "button", m = g === j ? void 0 : s;
|
|
100
208
|
return (
|
|
101
209
|
// @ts-expect-error We are explicitly checking for the `to` prop before using Link
|
|
102
210
|
/* @__PURE__ */ o(
|
|
103
|
-
|
|
211
|
+
g,
|
|
104
212
|
{
|
|
105
|
-
className:
|
|
213
|
+
className: i(
|
|
106
214
|
{
|
|
107
|
-
"tw:inline-flex":
|
|
108
|
-
"tw:flex": !
|
|
215
|
+
"tw:inline-flex": d,
|
|
216
|
+
"tw:flex": !d
|
|
109
217
|
},
|
|
110
218
|
"tw:gap-2 tw:items-center tw:justify-center",
|
|
111
219
|
"tw:border tw:rounded-md tw:no-underline",
|
|
@@ -122,11 +230,11 @@ const I = M(void 0), v = M({ responsive: !0 }), gt = ({ children: t, className:
|
|
|
122
230
|
{
|
|
123
231
|
"tw:border-brand tw:text-brand": n === "primary",
|
|
124
232
|
"tw:border-zinc-500": n === "secondary",
|
|
125
|
-
"tw:text-zinc-500": n === "secondary" && !
|
|
233
|
+
"tw:text-zinc-500": n === "secondary" && !l,
|
|
126
234
|
"tw:border-danger": n === "danger",
|
|
127
|
-
"tw:text-danger": n === "danger" && !
|
|
235
|
+
"tw:text-danger": n === "danger" && !l
|
|
128
236
|
},
|
|
129
|
-
|
|
237
|
+
l && {
|
|
130
238
|
"tw:text-white": !0,
|
|
131
239
|
"tw:bg-brand": n === "primary",
|
|
132
240
|
"tw:highlight:bg-brand-dark tw:highlight:border-brand-dark": n === "primary",
|
|
@@ -135,31 +243,32 @@ const I = M(void 0), v = M({ responsive: !0 }), gt = ({ children: t, className:
|
|
|
135
243
|
"tw:bg-danger": n === "danger",
|
|
136
244
|
"tw:highlight:bg-danger-dark tw:highlight:border-danger-dark": n === "danger"
|
|
137
245
|
},
|
|
138
|
-
!
|
|
139
|
-
"tw:highlight:text-white": !
|
|
246
|
+
!r && {
|
|
247
|
+
"tw:highlight:text-white": !l,
|
|
140
248
|
"tw:highlight:bg-brand": n === "primary",
|
|
141
249
|
"tw:highlight:bg-zinc-500": n === "secondary",
|
|
142
250
|
"tw:highlight:bg-danger": n === "danger"
|
|
143
251
|
},
|
|
144
252
|
{
|
|
145
|
-
"tw:pointer-events-none tw:opacity-65":
|
|
253
|
+
"tw:pointer-events-none tw:opacity-65": r
|
|
146
254
|
},
|
|
147
|
-
|
|
255
|
+
e
|
|
148
256
|
),
|
|
149
|
-
disabled:
|
|
150
|
-
|
|
257
|
+
disabled: r,
|
|
258
|
+
type: m,
|
|
259
|
+
...c,
|
|
151
260
|
children: t
|
|
152
261
|
}
|
|
153
262
|
)
|
|
154
263
|
);
|
|
155
|
-
},
|
|
156
|
-
const a =
|
|
264
|
+
}, X = p(({ className: t, onChange: e, ...r }, n) => {
|
|
265
|
+
const a = I((d) => e == null ? void 0 : e(d.target.checked, d), [e]);
|
|
157
266
|
return /* @__PURE__ */ o(
|
|
158
267
|
"input",
|
|
159
268
|
{
|
|
160
269
|
ref: n,
|
|
161
270
|
type: "checkbox",
|
|
162
|
-
className:
|
|
271
|
+
className: x(
|
|
163
272
|
"tw:appearance-none tw:focus-ring",
|
|
164
273
|
"tw:border-1 tw:border-lm-input-border tw:dark:border-dm-input-border",
|
|
165
274
|
"tw:bg-lm-primary tw:dark:bg-dm-primary tw:checked:bg-brand tw:bg-no-repeat",
|
|
@@ -168,56 +277,57 @@ const I = M(void 0), v = M({ responsive: !0 }), gt = ({ children: t, className:
|
|
|
168
277
|
t
|
|
169
278
|
),
|
|
170
279
|
onChange: a,
|
|
171
|
-
...
|
|
280
|
+
...r
|
|
172
281
|
}
|
|
173
282
|
);
|
|
174
|
-
}), Qt =
|
|
175
|
-
|
|
283
|
+
}), Qt = p(({ className: t, ...e }, r) => /* @__PURE__ */ o(
|
|
284
|
+
X,
|
|
176
285
|
{
|
|
177
|
-
ref:
|
|
178
|
-
className:
|
|
179
|
-
...
|
|
286
|
+
ref: r,
|
|
287
|
+
className: x("tw:rounded-sm tw:w-4 tw:h-4 tw:checked:bg-(image:--tick) tw:bg-center", t),
|
|
288
|
+
...e
|
|
180
289
|
}
|
|
181
|
-
)),
|
|
290
|
+
)), G = ({ onClick: t, label: e = "Close" }) => /* @__PURE__ */ o(
|
|
182
291
|
"button",
|
|
183
292
|
{
|
|
293
|
+
type: "button",
|
|
184
294
|
onClick: t,
|
|
185
|
-
className:
|
|
295
|
+
className: i(
|
|
186
296
|
"tw:opacity-50 tw:highlight:opacity-80 tw:transition-opacity",
|
|
187
297
|
"tw:rounded-md tw:focus-ring"
|
|
188
298
|
),
|
|
189
|
-
"aria-label":
|
|
190
|
-
children: /* @__PURE__ */ o(
|
|
299
|
+
"aria-label": e,
|
|
300
|
+
children: /* @__PURE__ */ o(k, { icon: at, size: "xl" })
|
|
191
301
|
}
|
|
192
|
-
),
|
|
302
|
+
), A = p(({
|
|
193
303
|
borderless: t = !1,
|
|
194
|
-
size:
|
|
195
|
-
feedback:
|
|
304
|
+
size: e = "md",
|
|
305
|
+
feedback: r,
|
|
196
306
|
className: n,
|
|
197
307
|
disabled: a,
|
|
198
|
-
readOnly:
|
|
199
|
-
...
|
|
308
|
+
readOnly: d,
|
|
309
|
+
...l
|
|
200
310
|
}, s) => {
|
|
201
|
-
const c = !a && !
|
|
311
|
+
const c = !a && !d;
|
|
202
312
|
return /* @__PURE__ */ o(
|
|
203
313
|
"input",
|
|
204
314
|
{
|
|
205
315
|
ref: s,
|
|
206
|
-
className:
|
|
316
|
+
className: i(
|
|
207
317
|
"tw:w-full",
|
|
208
318
|
{
|
|
209
|
-
"tw:focus-ring": !
|
|
210
|
-
"tw:focus-ring-danger":
|
|
319
|
+
"tw:focus-ring": !r,
|
|
320
|
+
"tw:focus-ring-danger": r === "error"
|
|
211
321
|
},
|
|
212
322
|
{
|
|
213
|
-
"tw:px-2 tw:py-1 tw:text-sm":
|
|
214
|
-
"tw:px-3 tw:py-1.5":
|
|
215
|
-
"tw:px-4 tw:py-2 tw:text-xl":
|
|
323
|
+
"tw:px-2 tw:py-1 tw:text-sm": e === "sm",
|
|
324
|
+
"tw:px-3 tw:py-1.5": e === "md",
|
|
325
|
+
"tw:px-4 tw:py-2 tw:text-xl": e === "lg"
|
|
216
326
|
},
|
|
217
327
|
{
|
|
218
328
|
"tw:rounded-md tw:border": !t,
|
|
219
|
-
"tw:border-lm-input-border tw:dark:border-dm-input-border": !t && !
|
|
220
|
-
"tw:border-danger": !t &&
|
|
329
|
+
"tw:border-lm-input-border tw:dark:border-dm-input-border": !t && !r,
|
|
330
|
+
"tw:border-danger": !t && r === "error",
|
|
221
331
|
"tw:bg-lm-disabled-input tw:dark:bg-dm-disabled-input": !c,
|
|
222
332
|
"tw:bg-lm-primary tw:dark:bg-dm-primary": c,
|
|
223
333
|
// Use different background color when rendered inside a card
|
|
@@ -226,55 +336,55 @@ const I = M(void 0), v = M({ responsive: !0 }), gt = ({ children: t, className:
|
|
|
226
336
|
n
|
|
227
337
|
),
|
|
228
338
|
disabled: a,
|
|
229
|
-
readOnly:
|
|
230
|
-
...
|
|
339
|
+
readOnly: d,
|
|
340
|
+
...l
|
|
231
341
|
}
|
|
232
342
|
);
|
|
233
|
-
}),
|
|
234
|
-
|
|
343
|
+
}), O = ({ required: t, children: e, ...r }) => /* @__PURE__ */ b("label", { ...r, children: [
|
|
344
|
+
e,
|
|
235
345
|
t && /* @__PURE__ */ o("span", { className: "tw:text-danger tw:ml-1", "data-testid": "required-indicator", children: "*" })
|
|
236
|
-
] }), Vt =
|
|
237
|
-
const s =
|
|
238
|
-
return /* @__PURE__ */
|
|
239
|
-
/* @__PURE__ */ o(
|
|
346
|
+
] }), Vt = p(({ label: t, inputClassName: e, required: r, hiddenRequired: n, error: a, ...d }, l) => {
|
|
347
|
+
const s = _();
|
|
348
|
+
return /* @__PURE__ */ b("div", { className: "tw:flex tw:flex-col tw:gap-1", children: [
|
|
349
|
+
/* @__PURE__ */ o(O, { htmlFor: s, required: r, children: t }),
|
|
240
350
|
/* @__PURE__ */ o(
|
|
241
|
-
|
|
351
|
+
A,
|
|
242
352
|
{
|
|
243
|
-
ref:
|
|
353
|
+
ref: l,
|
|
244
354
|
id: s,
|
|
245
|
-
className:
|
|
246
|
-
required:
|
|
355
|
+
className: e,
|
|
356
|
+
required: r || n,
|
|
247
357
|
feedback: a ? "error" : void 0,
|
|
248
|
-
...
|
|
358
|
+
...d
|
|
249
359
|
}
|
|
250
360
|
),
|
|
251
361
|
a && /* @__PURE__ */ o("span", { className: "tw:text-danger", children: a })
|
|
252
362
|
] });
|
|
253
|
-
}),
|
|
254
|
-
const [
|
|
255
|
-
var
|
|
256
|
-
(
|
|
363
|
+
}), It = p(({ containerClassName: t, className: e, size: r, ...n }, a) => {
|
|
364
|
+
const [d, l, , s] = it(!1), c = L(null), g = I(({ relatedTarget: m }) => {
|
|
365
|
+
var w;
|
|
366
|
+
(w = c.current) != null && w.contains(m) || s();
|
|
257
367
|
}, [c, s]);
|
|
258
|
-
return /* @__PURE__ */
|
|
368
|
+
return /* @__PURE__ */ b(
|
|
259
369
|
"div",
|
|
260
370
|
{
|
|
261
|
-
className:
|
|
371
|
+
className: x("tw:group tw:relative", t),
|
|
262
372
|
ref: c,
|
|
263
|
-
onBlurCapture:
|
|
373
|
+
onBlurCapture: g,
|
|
264
374
|
children: [
|
|
265
375
|
/* @__PURE__ */ o(
|
|
266
|
-
|
|
376
|
+
A,
|
|
267
377
|
{
|
|
268
378
|
ref: a,
|
|
269
|
-
type:
|
|
270
|
-
className:
|
|
379
|
+
type: d ? "text" : "password",
|
|
380
|
+
className: x(
|
|
271
381
|
{
|
|
272
|
-
"tw:pr-10":
|
|
273
|
-
"tw:pr-8":
|
|
382
|
+
"tw:pr-10": r !== "sm",
|
|
383
|
+
"tw:pr-8": r === "sm"
|
|
274
384
|
},
|
|
275
|
-
|
|
385
|
+
e
|
|
276
386
|
),
|
|
277
|
-
size:
|
|
387
|
+
size: r,
|
|
278
388
|
"data-testid": "input",
|
|
279
389
|
...n
|
|
280
390
|
}
|
|
@@ -282,68 +392,69 @@ const I = M(void 0), v = M({ responsive: !0 }), gt = ({ children: t, className:
|
|
|
282
392
|
/* @__PURE__ */ o(
|
|
283
393
|
"button",
|
|
284
394
|
{
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
395
|
+
type: "button",
|
|
396
|
+
onClick: l,
|
|
397
|
+
title: d ? "Hide password" : "Show password",
|
|
398
|
+
"aria-label": d ? "Hide password" : "Show password",
|
|
399
|
+
className: x(
|
|
289
400
|
"tw:absolute tw:top-[50%] tw:translate-y-[-50%] tw:px-1",
|
|
290
401
|
"tw:text-placeholder tw:hover:text-lm-text tw:hover:dark:text-dm-text tw:transition-colors",
|
|
291
402
|
{
|
|
292
|
-
"tw:right-1.5":
|
|
293
|
-
"tw:scale-85 tw:right-1":
|
|
403
|
+
"tw:right-1.5": r !== "sm",
|
|
404
|
+
"tw:scale-85 tw:right-1": r === "sm"
|
|
294
405
|
}
|
|
295
406
|
),
|
|
296
407
|
tabIndex: -1,
|
|
297
|
-
children: /* @__PURE__ */ o(
|
|
408
|
+
children: /* @__PURE__ */ o(k, { fixedWidth: !0, icon: d ? lt : dt })
|
|
298
409
|
}
|
|
299
410
|
)
|
|
300
411
|
]
|
|
301
412
|
}
|
|
302
413
|
);
|
|
303
|
-
}), Xt =
|
|
304
|
-
const s =
|
|
305
|
-
return /* @__PURE__ */
|
|
306
|
-
/* @__PURE__ */ o(
|
|
414
|
+
}), Xt = p(({ label: t, inputClassName: e, required: r, hiddenRequired: n, error: a, ...d }, l) => {
|
|
415
|
+
const s = _();
|
|
416
|
+
return /* @__PURE__ */ b("div", { className: "tw:flex tw:flex-col tw:gap-1", children: [
|
|
417
|
+
/* @__PURE__ */ o(O, { htmlFor: s, required: r, children: t }),
|
|
307
418
|
/* @__PURE__ */ o(
|
|
308
|
-
|
|
419
|
+
It,
|
|
309
420
|
{
|
|
310
|
-
ref:
|
|
421
|
+
ref: l,
|
|
311
422
|
id: s,
|
|
312
|
-
className:
|
|
313
|
-
required:
|
|
423
|
+
className: e,
|
|
424
|
+
required: r || n,
|
|
314
425
|
feedback: a ? "error" : void 0,
|
|
315
|
-
...
|
|
426
|
+
...d
|
|
316
427
|
}
|
|
317
428
|
),
|
|
318
429
|
a && /* @__PURE__ */ o("span", { className: "tw:text-danger", children: a })
|
|
319
430
|
] });
|
|
320
|
-
}),
|
|
431
|
+
}), Ct = p(({
|
|
321
432
|
className: t,
|
|
322
|
-
size:
|
|
323
|
-
feedback:
|
|
433
|
+
size: e = "md",
|
|
434
|
+
feedback: r,
|
|
324
435
|
style: n = {},
|
|
325
436
|
disabled: a,
|
|
326
|
-
...
|
|
327
|
-
},
|
|
437
|
+
...d
|
|
438
|
+
}, l) => /* @__PURE__ */ o(
|
|
328
439
|
"select",
|
|
329
440
|
{
|
|
330
|
-
ref:
|
|
331
|
-
className:
|
|
441
|
+
ref: l,
|
|
442
|
+
className: i(
|
|
332
443
|
"tw:w-full tw:appearance-none tw:pr-9",
|
|
333
444
|
"tw:bg-(image:--chevron-down) tw:bg-no-repeat",
|
|
334
445
|
{
|
|
335
|
-
"tw:focus-ring": !
|
|
336
|
-
"tw:focus-ring-danger":
|
|
446
|
+
"tw:focus-ring": !r,
|
|
447
|
+
"tw:focus-ring-danger": r === "error"
|
|
337
448
|
},
|
|
338
449
|
"tw:rounded-md tw:border",
|
|
339
450
|
{
|
|
340
|
-
"tw:border-lm-input-border tw:dark:border-dm-input-border": !
|
|
341
|
-
"tw:border-danger":
|
|
451
|
+
"tw:border-lm-input-border tw:dark:border-dm-input-border": !r,
|
|
452
|
+
"tw:border-danger": r === "error"
|
|
342
453
|
},
|
|
343
454
|
{
|
|
344
|
-
"tw:pl-2 tw:py-1 tw:text-sm":
|
|
345
|
-
"tw:pl-3 tw:py-1.5":
|
|
346
|
-
"tw:pl-4 tw:py-2 tw:text-xl":
|
|
455
|
+
"tw:pl-2 tw:py-1 tw:text-sm": e === "sm",
|
|
456
|
+
"tw:pl-3 tw:py-1.5": e === "md",
|
|
457
|
+
"tw:pl-4 tw:py-2 tw:text-xl": e === "lg",
|
|
347
458
|
"tw:bg-lm-disabled-input tw:dark:bg-dm-disabled-input": a,
|
|
348
459
|
// Apply different background color when rendered inside a card
|
|
349
460
|
"tw:bg-lm-primary tw:dark:bg-dm-primary tw:group-[&]/card:bg-lm-input tw:group-[&]/card:dark:bg-dm-input": !a
|
|
@@ -355,31 +466,33 @@ const I = M(void 0), v = M({ responsive: !0 }), gt = ({ children: t, className:
|
|
|
355
466
|
background: "right 0.75rem center / 16px 12px"
|
|
356
467
|
},
|
|
357
468
|
disabled: a,
|
|
358
|
-
...
|
|
469
|
+
...d
|
|
359
470
|
}
|
|
360
|
-
)), Yt =
|
|
361
|
-
const
|
|
362
|
-
return /* @__PURE__ */
|
|
363
|
-
/* @__PURE__ */ o(
|
|
364
|
-
/* @__PURE__ */ o(
|
|
471
|
+
)), Yt = p(({ selectClassName: t, label: e, required: r, hiddenRequired: n, ...a }, d) => {
|
|
472
|
+
const l = _();
|
|
473
|
+
return /* @__PURE__ */ b("div", { className: "tw:flex tw:flex-col tw:gap-1", children: [
|
|
474
|
+
/* @__PURE__ */ o(O, { htmlFor: l, required: r, children: e }),
|
|
475
|
+
/* @__PURE__ */ o(Ct, { ref: d, id: l, className: t, required: r || n, ...a })
|
|
365
476
|
] });
|
|
366
|
-
}),
|
|
477
|
+
}), Tt = p(({
|
|
367
478
|
onChange: t,
|
|
368
|
-
containerClassName:
|
|
369
|
-
inputClassName:
|
|
479
|
+
containerClassName: e,
|
|
480
|
+
inputClassName: r,
|
|
370
481
|
// Inputs have a default 'md' size. Search inputs are usually 'lg' as they are rendered at the top of sections
|
|
371
482
|
size: n = "lg",
|
|
372
|
-
|
|
483
|
+
loading: a = !1,
|
|
484
|
+
...d
|
|
373
485
|
}, l) => {
|
|
374
|
-
const { setTimeout:
|
|
375
|
-
m ?
|
|
376
|
-
}, [
|
|
377
|
-
return /* @__PURE__ */
|
|
486
|
+
const { setTimeout: s, clearCurrentTimeout: c } = wt(500), g = I((m) => {
|
|
487
|
+
m ? s(() => t(m)) : (c(), t(m));
|
|
488
|
+
}, [c, t, s]);
|
|
489
|
+
return /* @__PURE__ */ b("div", { className: i("tw:group tw:relative tw:focus-within:z-10", e), children: [
|
|
378
490
|
/* @__PURE__ */ o(
|
|
379
|
-
|
|
491
|
+
k,
|
|
380
492
|
{
|
|
381
|
-
icon:
|
|
382
|
-
|
|
493
|
+
icon: a ? V : st,
|
|
494
|
+
spin: a,
|
|
495
|
+
className: i(
|
|
383
496
|
"tw:absolute tw:top-[50%] tw:translate-y-[-50%] tw:transition-colors",
|
|
384
497
|
"tw:text-placeholder tw:group-focus-within:text-lm-text tw:dark:group-focus-within:text-dm-text",
|
|
385
498
|
{
|
|
@@ -390,116 +503,124 @@ const I = M(void 0), v = M({ responsive: !0 }), gt = ({ children: t, className:
|
|
|
390
503
|
}
|
|
391
504
|
),
|
|
392
505
|
/* @__PURE__ */ o(
|
|
393
|
-
|
|
506
|
+
A,
|
|
394
507
|
{
|
|
395
508
|
ref: l,
|
|
396
509
|
type: "search",
|
|
397
|
-
className:
|
|
510
|
+
className: i(
|
|
398
511
|
{
|
|
399
512
|
"tw:pl-9": n !== "sm",
|
|
400
513
|
"tw:pl-7": n === "sm"
|
|
401
514
|
},
|
|
402
|
-
|
|
515
|
+
r
|
|
403
516
|
),
|
|
404
517
|
placeholder: "Search...",
|
|
405
|
-
onChange: (m) =>
|
|
518
|
+
onChange: (m) => g(m.target.value),
|
|
406
519
|
size: n,
|
|
407
|
-
...
|
|
520
|
+
...d
|
|
408
521
|
}
|
|
409
522
|
)
|
|
410
523
|
] });
|
|
411
|
-
})
|
|
412
|
-
|
|
524
|
+
});
|
|
525
|
+
function Zt({
|
|
526
|
+
searchResults: t,
|
|
527
|
+
onSearch: e,
|
|
528
|
+
onSelectSearchResult: r,
|
|
529
|
+
renderSearchResult: n,
|
|
530
|
+
size: a = "md",
|
|
531
|
+
listboxSpan: d = "full",
|
|
532
|
+
onFocus: l,
|
|
533
|
+
...s
|
|
534
|
+
}) {
|
|
535
|
+
const c = L(null), g = _(), m = I((w) => {
|
|
536
|
+
r(w), e(""), c.current.value = "";
|
|
537
|
+
}, [e, r]);
|
|
538
|
+
return /* @__PURE__ */ b(
|
|
539
|
+
"div",
|
|
540
|
+
{
|
|
541
|
+
className: "tw:relative",
|
|
542
|
+
onBlur: (w) => {
|
|
543
|
+
w.currentTarget.contains(w.relatedTarget) || e("");
|
|
544
|
+
},
|
|
545
|
+
children: [
|
|
546
|
+
/* @__PURE__ */ o(
|
|
547
|
+
Tt,
|
|
548
|
+
{
|
|
549
|
+
onChange: e,
|
|
550
|
+
size: a,
|
|
551
|
+
ref: c,
|
|
552
|
+
role: "combobox",
|
|
553
|
+
"aria-autocomplete": "list",
|
|
554
|
+
"aria-expanded": !!t,
|
|
555
|
+
"aria-controls": g,
|
|
556
|
+
onFocus: (w) => {
|
|
557
|
+
l == null || l(w), e(w.target.value);
|
|
558
|
+
},
|
|
559
|
+
...s
|
|
560
|
+
}
|
|
561
|
+
),
|
|
562
|
+
t && /* @__PURE__ */ o(
|
|
563
|
+
ht,
|
|
564
|
+
{
|
|
565
|
+
id: g,
|
|
566
|
+
items: t,
|
|
567
|
+
anchor: c,
|
|
568
|
+
onSelectItem: m,
|
|
569
|
+
renderItem: n,
|
|
570
|
+
className: i(
|
|
571
|
+
"tw:absolute tw:top-full tw:mt-1 tw:z-10",
|
|
572
|
+
{
|
|
573
|
+
"tw:min-w-60 tw:max-w-full": d === "auto",
|
|
574
|
+
"tw:w-full": d === "full"
|
|
575
|
+
}
|
|
576
|
+
),
|
|
577
|
+
"aria-label": "Matching items",
|
|
578
|
+
noItemsMessage: "No results found matching search"
|
|
579
|
+
}
|
|
580
|
+
)
|
|
581
|
+
]
|
|
582
|
+
}
|
|
583
|
+
);
|
|
584
|
+
}
|
|
585
|
+
const te = p(({ className: t, ...e }, r) => /* @__PURE__ */ o(
|
|
586
|
+
X,
|
|
413
587
|
{
|
|
414
|
-
ref:
|
|
415
|
-
className:
|
|
588
|
+
ref: r,
|
|
589
|
+
className: x(
|
|
416
590
|
"tw:rounded-full tw:w-8 tw:h-4",
|
|
417
591
|
"tw:bg-(image:--circle-grey-dark) tw:dark:bg-(image:--circle-grey-light) tw:checked:bg-(image:--circle-white)",
|
|
418
592
|
"tw:focus-visible:not-checked:bg-(image:--circle-light-blue)",
|
|
419
593
|
"tw:checked:bg-right tw:transition-[background-position]",
|
|
420
594
|
t
|
|
421
595
|
),
|
|
422
|
-
...
|
|
596
|
+
...e
|
|
423
597
|
}
|
|
424
|
-
)),
|
|
598
|
+
)), Lt = ({ className: t, disabled: e, size: r = "md", type: n = "button", ...a }) => /* @__PURE__ */ o(
|
|
425
599
|
"button",
|
|
426
600
|
{
|
|
427
|
-
className:
|
|
601
|
+
className: i(
|
|
428
602
|
"tw:inline-flex tw:rounded-md tw:focus-ring",
|
|
429
603
|
"tw:text-brand tw:highlight:text-brand-dark tw:highlight:underline",
|
|
430
604
|
{
|
|
431
|
-
"tw:px-1.5 tw:py-1 tw:text-sm":
|
|
432
|
-
"tw:px-3 tw:py-1.5":
|
|
433
|
-
"tw:px-4 tw:py-2 tw:text-lg":
|
|
434
|
-
"tw:pointer-events-none tw:opacity-65":
|
|
605
|
+
"tw:px-1.5 tw:py-1 tw:text-sm": r === "sm",
|
|
606
|
+
"tw:px-3 tw:py-1.5": r === "md",
|
|
607
|
+
"tw:px-4 tw:py-2 tw:text-lg": r === "lg",
|
|
608
|
+
"tw:pointer-events-none tw:opacity-65": e
|
|
435
609
|
},
|
|
436
610
|
t
|
|
437
611
|
),
|
|
438
|
-
disabled:
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
), vt = ({ className: t, ...r }) => /* @__PURE__ */ o(
|
|
442
|
-
"div",
|
|
443
|
-
{
|
|
444
|
-
className: w(
|
|
445
|
-
"tw:px-4 tw:py-3 tw:rounded-t-md",
|
|
446
|
-
"tw:bg-lm-primary tw:dark:bg-dm-primary tw:border-b tw:border-lm-border tw:dark:border-dm-border",
|
|
447
|
-
t
|
|
448
|
-
),
|
|
449
|
-
...r
|
|
450
|
-
}
|
|
451
|
-
), Pt = ({ className: t, ...r }) => /* @__PURE__ */ o(
|
|
452
|
-
"div",
|
|
453
|
-
{
|
|
454
|
-
className: w(
|
|
455
|
-
"tw:p-4 tw:bg-lm-primary tw:dark:bg-dm-primary tw:first:rounded-t-md",
|
|
456
|
-
"tw:first:rounded-t-md tw:last:rounded-b-md",
|
|
457
|
-
t
|
|
458
|
-
),
|
|
459
|
-
...r
|
|
612
|
+
disabled: e,
|
|
613
|
+
type: n,
|
|
614
|
+
...a
|
|
460
615
|
}
|
|
461
|
-
),
|
|
462
|
-
|
|
463
|
-
{
|
|
464
|
-
className: w(
|
|
465
|
-
"tw:px-4 tw:py-3 tw:rounded-b-md",
|
|
466
|
-
"tw:bg-lm-primary tw:dark:bg-dm-primary tw:border-t tw:border-lm-border tw:dark:border-dm-border",
|
|
467
|
-
t
|
|
468
|
-
),
|
|
469
|
-
...r
|
|
470
|
-
}
|
|
471
|
-
), It = ({ className: t, ...r }) => /* @__PURE__ */ o(
|
|
472
|
-
"div",
|
|
473
|
-
{
|
|
474
|
-
className: w(
|
|
475
|
-
"tw:group/card tw:rounded-md tw:shadow-md",
|
|
476
|
-
"tw:border tw:border-lm-border tw:dark:border-dm-border tw:bg-lm-primary tw:dark:bg-dm-primary",
|
|
477
|
-
t
|
|
478
|
-
),
|
|
479
|
-
...r
|
|
480
|
-
}
|
|
481
|
-
), h = Object.assign(It, { Body: Pt, Header: vt, Footer: Ct }), Rt = ({ bodyClassName: t, children: r, ...e }) => {
|
|
482
|
-
const { title: n, titleSize: a = "md", ...l } = "title" in e ? e : {
|
|
483
|
-
...e,
|
|
484
|
-
title: void 0,
|
|
485
|
-
titleSize: void 0
|
|
486
|
-
};
|
|
487
|
-
return /* @__PURE__ */ i(h, { ...l, children: [
|
|
488
|
-
n && /* @__PURE__ */ i(h.Header, { children: [
|
|
489
|
-
a === "lg" && /* @__PURE__ */ o("h4", { children: n }),
|
|
490
|
-
a === "md" && /* @__PURE__ */ o("h5", { children: n }),
|
|
491
|
-
a === "sm" && /* @__PURE__ */ o("h6", { children: n })
|
|
492
|
-
] }),
|
|
493
|
-
/* @__PURE__ */ o(h.Body, { className: t, children: r })
|
|
494
|
-
] });
|
|
495
|
-
}, V = M(null), Tt = ({ className: t, to: r, ...e }) => {
|
|
496
|
-
const n = f(V);
|
|
616
|
+
), Y = H(null), Bt = ({ className: t, to: e, ...r }) => {
|
|
617
|
+
const n = v(Y);
|
|
497
618
|
return /* @__PURE__ */ o(
|
|
498
|
-
|
|
619
|
+
nt,
|
|
499
620
|
{
|
|
500
621
|
role: "menuitem",
|
|
501
|
-
to:
|
|
502
|
-
className: ({ isActive: a }) =>
|
|
622
|
+
to: e,
|
|
623
|
+
className: ({ isActive: a }) => i(
|
|
503
624
|
"tw:px-4 tw:pt-2 tw:pb-[calc(0.5rem-3px)] tw:border-b-3",
|
|
504
625
|
"tw:font-bold tw:no-underline tw:text-center tw:highlight:text-brand tw:transition-colors",
|
|
505
626
|
"tw:rounded-none tw:outline-none tw:focus-visible:inset-ring-2 tw:focus-visible:inset-ring-brand/50",
|
|
@@ -510,167 +631,167 @@ const I = M(void 0), v = M({ responsive: !0 }), gt = ({ children: t, className:
|
|
|
510
631
|
},
|
|
511
632
|
t
|
|
512
633
|
),
|
|
513
|
-
...
|
|
634
|
+
...r
|
|
514
635
|
}
|
|
515
636
|
);
|
|
516
|
-
},
|
|
517
|
-
const
|
|
518
|
-
Math.max(
|
|
519
|
-
Math.min(
|
|
637
|
+
}, Et = ({ children: t, className: e, fill: r }) => /* @__PURE__ */ o(Y.Provider, { value: { fill: r }, children: /* @__PURE__ */ o(f, { role: "menubar", className: i("tw:flex tw:overflow-hidden", e), children: t }) }), ee = Object.assign(Et, { Pill: Bt }), Mt = new Intl.NumberFormat("en-US"), Rt = (t) => Mt.format(Number(t)), J = 10, re = (t) => Math.ceil(t / J) * J, P = 2, R = "...", _t = (t, e) => Array.from({ length: e - t }, (r, n) => t + n), Ft = (t, e) => {
|
|
638
|
+
const r = _t(
|
|
639
|
+
Math.max(P, t - P),
|
|
640
|
+
Math.min(e - 1, t + P) + 1
|
|
520
641
|
);
|
|
521
|
-
return t -
|
|
522
|
-
},
|
|
642
|
+
return t - P > P && r.unshift(R), t + P < e - 1 && r.push(R), r.unshift(1), r.push(e), r;
|
|
643
|
+
}, T = (t) => t === R, St = (t) => T(t) ? t : Rt(t), jt = (t, e) => T(t) ? `${t}_${e}` : `${t}`, Z = [
|
|
523
644
|
"tw:border tw:border-r-0 tw:last:border-r tw:border-lm-border tw:dark:border-dm-border",
|
|
524
645
|
"tw:rounded-none tw:first:rounded-l tw:last:rounded-r"
|
|
525
|
-
],
|
|
526
|
-
|
|
646
|
+
], tt = (t = !1) => i(
|
|
647
|
+
Z,
|
|
527
648
|
"tw:px-3 py-2 tw:cursor-pointer tw:no-underline",
|
|
528
649
|
"tw:focus-ring tw:focus-visible:z-1",
|
|
529
650
|
{
|
|
530
651
|
"tw:highlight:bg-lm-secondary tw:dark:highlight:bg-dm-secondary tw:text-brand": !t,
|
|
531
652
|
"tw:bg-lm-brand tw:dark:bg-dm-brand tw:text-white": t
|
|
532
653
|
}
|
|
533
|
-
),
|
|
534
|
-
function
|
|
535
|
-
const
|
|
536
|
-
return
|
|
654
|
+
), D = ({ children: t }) => /* @__PURE__ */ o("span", { "aria-hidden": !0, className: i(Z, "tw:px-3 py-2 tw:text-gray-400"), children: t }), et = () => /* @__PURE__ */ o(D, { children: R });
|
|
655
|
+
function Dt({ children: t, active: e, isEllipsis: r, href: n, ...a }) {
|
|
656
|
+
const d = Q(() => tt(e), [e]);
|
|
657
|
+
return r ? /* @__PURE__ */ o(et, {}) : /* @__PURE__ */ o(j, { className: d, to: n, ...a, children: t });
|
|
537
658
|
}
|
|
538
|
-
function Ht({ children: t, active:
|
|
539
|
-
const a =
|
|
540
|
-
return
|
|
659
|
+
function Ht({ children: t, active: e, isEllipsis: r, ...n }) {
|
|
660
|
+
const a = Q(() => tt(e), [e]);
|
|
661
|
+
return r ? /* @__PURE__ */ o(et, {}) : /* @__PURE__ */ o("button", { type: "button", className: a, ...n, children: t });
|
|
541
662
|
}
|
|
542
|
-
const
|
|
543
|
-
const n = "urlForPage" in
|
|
544
|
-
(
|
|
545
|
-
[n,
|
|
663
|
+
const oe = ({ currentPage: t, pagesCount: e, ...r }) => {
|
|
664
|
+
const n = "urlForPage" in r, a = n ? Dt : Ht, d = I(
|
|
665
|
+
(l) => n ? { href: T(l) ? void 0 : r.urlForPage(l) } : { onClick: () => !T(l) && r.onPageChange(l) },
|
|
666
|
+
[n, r]
|
|
546
667
|
);
|
|
547
|
-
return
|
|
548
|
-
t === 1 ? /* @__PURE__ */ o(
|
|
549
|
-
Ft(t,
|
|
668
|
+
return e < 2 ? null : /* @__PURE__ */ b("div", { className: "tw:select-none tw:flex", "data-testid": "paginator", children: [
|
|
669
|
+
t === 1 ? /* @__PURE__ */ o(D, { children: /* @__PURE__ */ o(k, { size: "xs", icon: q }) }) : /* @__PURE__ */ o(a, { ...d(Math.max(1, t - 1)), "aria-label": "Previous", children: /* @__PURE__ */ o(k, { size: "xs", icon: q }) }),
|
|
670
|
+
Ft(t, e).map((l, s) => /* @__PURE__ */ o(
|
|
550
671
|
a,
|
|
551
672
|
{
|
|
552
|
-
active:
|
|
553
|
-
isEllipsis:
|
|
554
|
-
...l
|
|
555
|
-
children:
|
|
673
|
+
active: l === t,
|
|
674
|
+
isEllipsis: T(l),
|
|
675
|
+
...d(l),
|
|
676
|
+
children: St(l)
|
|
556
677
|
},
|
|
557
|
-
|
|
678
|
+
jt(l, s)
|
|
558
679
|
)),
|
|
559
|
-
t ===
|
|
680
|
+
t === e ? /* @__PURE__ */ o(D, { children: /* @__PURE__ */ o(k, { size: "xs", icon: z }) }) : /* @__PURE__ */ o(a, { ...d(Math.min(e, t + 1)), "aria-label": "Next", children: /* @__PURE__ */ o(k, { size: "xs", icon: z }) })
|
|
560
681
|
] });
|
|
561
|
-
},
|
|
682
|
+
}, At = ({
|
|
562
683
|
open: t,
|
|
563
|
-
children:
|
|
564
|
-
className:
|
|
684
|
+
children: e,
|
|
685
|
+
className: r,
|
|
565
686
|
onClose: n,
|
|
566
687
|
...a
|
|
567
688
|
}) => {
|
|
568
|
-
const
|
|
569
|
-
return
|
|
570
|
-
var
|
|
571
|
-
const
|
|
689
|
+
const d = L(null);
|
|
690
|
+
return M(() => {
|
|
691
|
+
var g, m;
|
|
692
|
+
const l = document.body, s = l.style.overflow, c = l.style.paddingRight;
|
|
572
693
|
if (t) {
|
|
573
|
-
const
|
|
574
|
-
|
|
694
|
+
const w = window.outerWidth - l.clientWidth, u = l.scrollHeight > l.clientHeight;
|
|
695
|
+
l.style.overflow = "hidden", u && (l.style.paddingRight = `${w}px`), (g = d.current) == null || g.showModal();
|
|
575
696
|
} else
|
|
576
|
-
(
|
|
697
|
+
(m = d.current) == null || m.close();
|
|
577
698
|
return () => {
|
|
578
|
-
|
|
699
|
+
l.style.overflow = s, l.style.paddingRight = c;
|
|
579
700
|
};
|
|
580
|
-
}, [t]),
|
|
701
|
+
}, [t]), ct(
|
|
581
702
|
/* @__PURE__ */ o(
|
|
582
703
|
"dialog",
|
|
583
704
|
{
|
|
584
|
-
ref:
|
|
585
|
-
className:
|
|
586
|
-
onCancel: (
|
|
587
|
-
|
|
705
|
+
ref: d,
|
|
706
|
+
className: i("tw:bg-transparent tw:backdrop:bg-black/50", r),
|
|
707
|
+
onCancel: (l) => {
|
|
708
|
+
l.preventDefault(), n();
|
|
588
709
|
},
|
|
589
710
|
...a,
|
|
590
|
-
children: t &&
|
|
711
|
+
children: t && e
|
|
591
712
|
}
|
|
592
713
|
),
|
|
593
714
|
document.body
|
|
594
715
|
);
|
|
595
|
-
},
|
|
716
|
+
}, ne = ({
|
|
596
717
|
open: t,
|
|
597
|
-
onClose:
|
|
598
|
-
variant:
|
|
718
|
+
onClose: e,
|
|
719
|
+
variant: r = "default",
|
|
599
720
|
title: n,
|
|
600
721
|
children: a,
|
|
601
|
-
className:
|
|
602
|
-
...
|
|
722
|
+
className: d,
|
|
723
|
+
...l
|
|
603
724
|
}) => {
|
|
604
725
|
const {
|
|
605
726
|
size: s = "md",
|
|
606
727
|
confirmText: c = "Confirm",
|
|
607
|
-
cancelText:
|
|
608
|
-
confirmDisabled:
|
|
609
|
-
onConfirm:
|
|
610
|
-
onClosed:
|
|
611
|
-
...
|
|
612
|
-
} = "onConfirm" in
|
|
613
|
-
|
|
614
|
-
}, [
|
|
615
|
-
return
|
|
728
|
+
cancelText: g = "Cancel",
|
|
729
|
+
confirmDisabled: m,
|
|
730
|
+
onConfirm: w,
|
|
731
|
+
onClosed: u,
|
|
732
|
+
...h
|
|
733
|
+
} = "onConfirm" in l ? l : { ...l }, [y, $] = K(t), E = L(null), F = L("cancel"), rt = I(() => {
|
|
734
|
+
F.current = "confirm", w == null || w();
|
|
735
|
+
}, [w]);
|
|
736
|
+
return M(() => {
|
|
616
737
|
if (t) {
|
|
617
|
-
|
|
738
|
+
F.current = "cancel", $(!0);
|
|
618
739
|
return;
|
|
619
740
|
}
|
|
620
|
-
const
|
|
621
|
-
if (
|
|
622
|
-
delete
|
|
623
|
-
let
|
|
624
|
-
const
|
|
625
|
-
|
|
741
|
+
const N = E.current;
|
|
742
|
+
if (N) {
|
|
743
|
+
delete E.current.dataset.open;
|
|
744
|
+
let U = !1;
|
|
745
|
+
const W = (ot) => {
|
|
746
|
+
U || ot.target !== N || (U = !0, $(!1), u == null || u(F.current));
|
|
626
747
|
};
|
|
627
|
-
return
|
|
628
|
-
|
|
748
|
+
return N.addEventListener("transitionend", W), () => {
|
|
749
|
+
N.removeEventListener("transitionend", W);
|
|
629
750
|
};
|
|
630
751
|
}
|
|
631
|
-
}, [
|
|
632
|
-
const
|
|
633
|
-
|
|
634
|
-
}, [
|
|
635
|
-
|
|
752
|
+
}, [u, t]), M(() => {
|
|
753
|
+
const N = E.current;
|
|
754
|
+
y && N && (N.dataset.open = "");
|
|
755
|
+
}, [y]), /* @__PURE__ */ o(
|
|
756
|
+
At,
|
|
636
757
|
{
|
|
637
|
-
open:
|
|
638
|
-
onClose:
|
|
639
|
-
className:
|
|
758
|
+
open: y,
|
|
759
|
+
onClose: e,
|
|
760
|
+
className: i(
|
|
640
761
|
{
|
|
641
|
-
"tw:flex tw:w-screen tw:h-screen tw:max-w-screen tw:max-h-screen":
|
|
642
|
-
"tw:overflow-hidden":
|
|
762
|
+
"tw:flex tw:w-screen tw:h-screen tw:max-w-screen tw:max-h-screen": y,
|
|
763
|
+
"tw:overflow-hidden": r === "cover"
|
|
643
764
|
},
|
|
644
|
-
|
|
765
|
+
d
|
|
645
766
|
),
|
|
646
|
-
...
|
|
767
|
+
...h,
|
|
647
768
|
children: /* @__PURE__ */ o(
|
|
648
769
|
"div",
|
|
649
770
|
{
|
|
650
771
|
"data-testid": "transition-container",
|
|
651
|
-
ref:
|
|
652
|
-
className:
|
|
772
|
+
ref: E,
|
|
773
|
+
className: i(
|
|
653
774
|
"tw:w-full tw:m-auto tw:p-4 tw:sm:p-6",
|
|
654
775
|
// CSS transitions are based on the presence of the `data-open` attribute
|
|
655
776
|
"tw:-translate-y-4 tw:data-open:translate-y-0 tw:opacity-0 tw:data-open:opacity-100",
|
|
656
777
|
"tw:transition-[opacity_,_translate] tw:duration-300",
|
|
657
778
|
// Handle modal dimensions for different variants and sizes
|
|
658
|
-
|
|
779
|
+
r !== "cover" && {
|
|
659
780
|
"tw:sm:w-sm": s === "sm",
|
|
660
781
|
"tw:md:w-lg": s === "md",
|
|
661
782
|
"tw:md:w-4xl": s === "lg",
|
|
662
783
|
"tw:md:w-6xl": s === "xl"
|
|
663
784
|
},
|
|
664
|
-
{ "tw:h-full":
|
|
785
|
+
{ "tw:h-full": r === "cover" }
|
|
665
786
|
),
|
|
666
|
-
children: /* @__PURE__ */ o(
|
|
787
|
+
children: /* @__PURE__ */ o(f, { className: i(
|
|
667
788
|
"tw:w-full",
|
|
668
|
-
{ "tw:h-full tw:relative tw:overflow-auto":
|
|
669
|
-
), children:
|
|
670
|
-
/* @__PURE__ */
|
|
789
|
+
{ "tw:h-full tw:relative tw:overflow-auto": r === "cover" }
|
|
790
|
+
), children: r === "cover" ? /* @__PURE__ */ b(S, { children: [
|
|
791
|
+
/* @__PURE__ */ b(
|
|
671
792
|
"div",
|
|
672
793
|
{
|
|
673
|
-
className:
|
|
794
|
+
className: i(
|
|
674
795
|
"tw:px-4 tw:py-3 tw:absolute tw:top-0 tw:left-0 tw:right-0",
|
|
675
796
|
"tw:flex tw:items-center tw:justify-between",
|
|
676
797
|
"tw:text-white tw:bg-linear-to-b tw:from-black/70 tw:to-black/10",
|
|
@@ -678,37 +799,37 @@ const re = ({ currentPage: t, pagesCount: r, ...e }) => {
|
|
|
678
799
|
),
|
|
679
800
|
children: [
|
|
680
801
|
/* @__PURE__ */ o("h5", { children: n }),
|
|
681
|
-
/* @__PURE__ */ o(
|
|
802
|
+
/* @__PURE__ */ o(G, { onClick: e, label: "Close dialog" })
|
|
682
803
|
]
|
|
683
804
|
}
|
|
684
805
|
),
|
|
685
806
|
/* @__PURE__ */ o("div", { children: a })
|
|
686
|
-
] }) : /* @__PURE__ */
|
|
687
|
-
/* @__PURE__ */
|
|
807
|
+
] }) : /* @__PURE__ */ b(S, { children: [
|
|
808
|
+
/* @__PURE__ */ b(f.Header, { className: i(
|
|
688
809
|
"tw:sticky tw:top-0",
|
|
689
810
|
"tw:flex tw:items-center tw:justify-between tw:gap-x-2"
|
|
690
811
|
), children: [
|
|
691
|
-
/* @__PURE__ */ o("h5", { className:
|
|
692
|
-
/* @__PURE__ */ o(
|
|
812
|
+
/* @__PURE__ */ o("h5", { className: i({ "tw:text-danger": r === "danger" }), children: n }),
|
|
813
|
+
/* @__PURE__ */ o(G, { onClick: e, label: "Close dialog" })
|
|
693
814
|
] }),
|
|
694
|
-
/* @__PURE__ */ o(
|
|
695
|
-
|
|
696
|
-
|
|
815
|
+
/* @__PURE__ */ o(f.Body, { children: a }),
|
|
816
|
+
w && /* @__PURE__ */ b(
|
|
817
|
+
f.Footer,
|
|
697
818
|
{
|
|
698
819
|
"data-testid": "footer",
|
|
699
|
-
className:
|
|
820
|
+
className: i(
|
|
700
821
|
"tw:flex tw:justify-end tw:items-center tw:gap-x-2",
|
|
701
822
|
"tw:[&]:px-3 tw:sticky tw:bottom-0"
|
|
702
823
|
),
|
|
703
824
|
children: [
|
|
704
|
-
/* @__PURE__ */ o(
|
|
825
|
+
/* @__PURE__ */ o(Lt, { onClick: e, children: g }),
|
|
705
826
|
/* @__PURE__ */ o(
|
|
706
|
-
|
|
827
|
+
Pt,
|
|
707
828
|
{
|
|
708
829
|
solid: !0,
|
|
709
|
-
variant:
|
|
710
|
-
disabled:
|
|
711
|
-
onClick:
|
|
830
|
+
variant: r === "danger" ? "danger" : "primary",
|
|
831
|
+
disabled: m,
|
|
832
|
+
onClick: rt,
|
|
712
833
|
children: c
|
|
713
834
|
}
|
|
714
835
|
)
|
|
@@ -720,62 +841,64 @@ const re = ({ currentPage: t, pagesCount: r, ...e }) => {
|
|
|
720
841
|
)
|
|
721
842
|
}
|
|
722
843
|
);
|
|
723
|
-
},
|
|
844
|
+
}, ae = ({ className: t, children: e, loading: r = !1, variant: n = "default" }) => /* @__PURE__ */ o(pt, { className: x({ "tw:[&]:border-danger": n === "error" }, t), children: /* @__PURE__ */ b("h3", { className: x("tw:text-center", {
|
|
724
845
|
"tw:text-gray-500 tw:dark:text-gray-400": n === "default",
|
|
725
846
|
"tw:text-danger": n === "error"
|
|
726
847
|
}), children: [
|
|
727
|
-
|
|
728
|
-
/* @__PURE__ */ o(
|
|
729
|
-
/* @__PURE__ */ o("span", { className: "tw:ml-2", children:
|
|
848
|
+
r && /* @__PURE__ */ b(S, { children: [
|
|
849
|
+
/* @__PURE__ */ o(k, { icon: V, spin: !0 }),
|
|
850
|
+
/* @__PURE__ */ o("span", { className: "tw:ml-2", children: e ?? "Loading..." })
|
|
730
851
|
] }),
|
|
731
|
-
!
|
|
732
|
-
] }) }),
|
|
852
|
+
!r && e
|
|
853
|
+
] }) }), le = ({ variant: t, className: e, size: r = "md", children: n }) => /* @__PURE__ */ o(
|
|
733
854
|
"div",
|
|
734
855
|
{
|
|
735
|
-
className:
|
|
856
|
+
className: x(
|
|
736
857
|
"tw:rounded-md tw:text-center",
|
|
737
858
|
{
|
|
738
|
-
"tw:p-2":
|
|
739
|
-
"tw:p-4":
|
|
740
|
-
"tw:p-6":
|
|
859
|
+
"tw:p-2": r === "sm",
|
|
860
|
+
"tw:p-4": r === "md",
|
|
861
|
+
"tw:p-6": r === "lg",
|
|
741
862
|
"tw:[&]:text-white": t !== "warning",
|
|
742
863
|
"tw:bg-brand": t === "success",
|
|
743
864
|
"tw:bg-danger": t === "error",
|
|
744
865
|
"tw:bg-warning tw:text-black": t === "warning"
|
|
745
866
|
},
|
|
746
|
-
|
|
867
|
+
e
|
|
747
868
|
),
|
|
748
869
|
children: n
|
|
749
870
|
}
|
|
750
871
|
);
|
|
751
872
|
export {
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
873
|
+
Pt as Button,
|
|
874
|
+
f as Card,
|
|
875
|
+
ne as CardModal,
|
|
755
876
|
Qt as Checkbox,
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
877
|
+
G as CloseButton,
|
|
878
|
+
R as ELLIPSIS,
|
|
879
|
+
A as Input,
|
|
880
|
+
O as Label,
|
|
760
881
|
Vt as LabelledInput,
|
|
761
882
|
Xt as LabelledRevealablePasswordInput,
|
|
762
883
|
Yt as LabelledSelect,
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
884
|
+
Lt as LinkButton,
|
|
885
|
+
ht as Listbox,
|
|
886
|
+
ae as Message,
|
|
887
|
+
At as ModalDialog,
|
|
888
|
+
ee as NavPills,
|
|
889
|
+
oe as Paginator,
|
|
890
|
+
le as Result,
|
|
891
|
+
It as RevealablePasswordInput,
|
|
892
|
+
Zt as SearchCombobox,
|
|
893
|
+
Tt as SearchInput,
|
|
894
|
+
Ct as Select,
|
|
895
|
+
pt as SimpleCard,
|
|
773
896
|
Kt as Table,
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
897
|
+
te as ToggleSwitch,
|
|
898
|
+
Rt as formatNumber,
|
|
899
|
+
jt as keyForPage,
|
|
900
|
+
T as pageIsEllipsis,
|
|
901
|
+
St as prettifyPageNumber,
|
|
779
902
|
Ft as progressivePagination,
|
|
780
|
-
|
|
903
|
+
re as roundTen
|
|
781
904
|
};
|