@shlinkio/shlink-frontend-kit 0.9.6 → 0.9.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/tailwind.d.ts +878 -3
- package/dist/tailwind.js +407 -321
- package/package.json +2 -1
package/dist/tailwind.js
CHANGED
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
import { jsxs as g, jsx as n, Fragment as
|
|
1
|
+
import { jsxs as g, jsx as n, Fragment as O } from "react/jsx-runtime";
|
|
2
2
|
import w, { clsx as y } from "clsx";
|
|
3
|
-
import { useRef as I, useState as
|
|
3
|
+
import { useRef as I, useState as R, useEffect as M, forwardRef as h, useCallback as T, createContext as S, useContext as C, useId as D, useMemo as $ } from "react";
|
|
4
4
|
import { Link as j, NavLink as at } from "react-router";
|
|
5
|
-
import { faClose as
|
|
5
|
+
import { faClose as lt, faEyeSlash as dt, faEye as st, faCircleNotch as X, faSearch as it, faChevronLeft as G, faChevronRight as J, faCheck as wt } from "@fortawesome/free-solid-svg-icons";
|
|
6
6
|
import { FontAwesomeIcon as v } from "@fortawesome/react-fontawesome";
|
|
7
|
-
import { u as ct, a as mt, b as
|
|
8
|
-
import { createPortal as
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
import { u as ct, a as mt, b as bt } from "./use-toggle-C1uZwbSD.js";
|
|
8
|
+
import { createPortal as gt } from "react-dom";
|
|
9
|
+
import { autoPlacement as pt, arrow as ut, useFloating as ht, useHover as ft, useInteractions as xt, useTransitionStyles as yt } from "@floating-ui/react";
|
|
10
|
+
import { faClone as kt } from "@fortawesome/free-regular-svg-icons";
|
|
11
|
+
const le = ({ children: t, summary: r, summaryClasses: e, ...o }) => {
|
|
12
|
+
const a = I(null), [d, l] = R(!1);
|
|
12
13
|
return M(() => {
|
|
13
|
-
const
|
|
14
|
-
return
|
|
14
|
+
const s = a.current, i = () => l(!!(s != null && s.open));
|
|
15
|
+
return s == null || s.addEventListener("toggle", i), () => s == null ? void 0 : s.removeEventListener("toggle", i);
|
|
15
16
|
}, []), /* @__PURE__ */ g("details", { ref: a, ...o, children: [
|
|
16
17
|
/* @__PURE__ */ n("summary", { className: y("tw:focus-ring tw:px-1 tw:-mx-1 tw:rounded-sm", e), children: r }),
|
|
17
|
-
|
|
18
|
+
d && /* @__PURE__ */ n("div", { className: "tw:mt-3 tw:flex tw:flex-col tw:gap-y-3", children: t })
|
|
18
19
|
] });
|
|
19
|
-
},
|
|
20
|
+
}, vt = h(({ className: t, ...r }, e) => /* @__PURE__ */ n(
|
|
20
21
|
"div",
|
|
21
22
|
{
|
|
22
23
|
className: w(
|
|
@@ -27,7 +28,7 @@ const Zt = ({ children: t, summary: r, summaryClasses: e, ...o }) => {
|
|
|
27
28
|
...r,
|
|
28
29
|
ref: e
|
|
29
30
|
}
|
|
30
|
-
)),
|
|
31
|
+
)), Nt = h(({ className: t, ...r }, e) => /* @__PURE__ */ n(
|
|
31
32
|
"div",
|
|
32
33
|
{
|
|
33
34
|
className: w(
|
|
@@ -38,7 +39,7 @@ const Zt = ({ children: t, summary: r, summaryClasses: e, ...o }) => {
|
|
|
38
39
|
...r,
|
|
39
40
|
ref: e
|
|
40
41
|
}
|
|
41
|
-
)),
|
|
42
|
+
)), Ct = h(({ className: t, ...r }, e) => /* @__PURE__ */ n(
|
|
42
43
|
"div",
|
|
43
44
|
{
|
|
44
45
|
className: w(
|
|
@@ -49,7 +50,7 @@ const Zt = ({ children: t, summary: r, summaryClasses: e, ...o }) => {
|
|
|
49
50
|
...r,
|
|
50
51
|
ref: e
|
|
51
52
|
}
|
|
52
|
-
)),
|
|
53
|
+
)), Tt = h(({ className: t, ...r }, e) => /* @__PURE__ */ n(
|
|
53
54
|
"div",
|
|
54
55
|
{
|
|
55
56
|
className: w(
|
|
@@ -60,72 +61,72 @@ const Zt = ({ children: t, summary: r, summaryClasses: e, ...o }) => {
|
|
|
60
61
|
...r,
|
|
61
62
|
ref: e
|
|
62
63
|
}
|
|
63
|
-
)), N = Object.assign(
|
|
64
|
-
const { title: a, titleSize:
|
|
64
|
+
)), N = Object.assign(Tt, { Body: Nt, Header: vt, Footer: Ct }), It = h(({ bodyClassName: t, children: r, ...e }, o) => {
|
|
65
|
+
const { title: a, titleSize: d = "md", ...l } = "title" in e ? e : {
|
|
65
66
|
...e,
|
|
66
67
|
title: void 0,
|
|
67
68
|
titleSize: void 0
|
|
68
69
|
};
|
|
69
|
-
return /* @__PURE__ */ g(N, { ...
|
|
70
|
+
return /* @__PURE__ */ g(N, { ...l, ref: o, children: [
|
|
70
71
|
a && /* @__PURE__ */ g(N.Header, { children: [
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
d === "lg" && /* @__PURE__ */ n("h4", { children: a }),
|
|
73
|
+
d === "md" && /* @__PURE__ */ n("h5", { children: a }),
|
|
74
|
+
d === "sm" && /* @__PURE__ */ n("h6", { children: a })
|
|
74
75
|
] }),
|
|
75
76
|
/* @__PURE__ */ n(N.Body, { className: t, children: r })
|
|
76
77
|
] });
|
|
77
78
|
});
|
|
78
|
-
function
|
|
79
|
+
function Pt({
|
|
79
80
|
id: t,
|
|
80
81
|
items: r,
|
|
81
82
|
onSelectItem: e,
|
|
82
83
|
onActiveItemChange: o,
|
|
83
84
|
renderItem: a,
|
|
84
|
-
className:
|
|
85
|
-
noItemsMessage:
|
|
86
|
-
anchor:
|
|
87
|
-
"aria-label":
|
|
85
|
+
className: d,
|
|
86
|
+
noItemsMessage: l = "No items",
|
|
87
|
+
anchor: s,
|
|
88
|
+
"aria-label": i = "Items",
|
|
88
89
|
...c
|
|
89
90
|
}) {
|
|
90
|
-
const [m,
|
|
91
|
-
if (
|
|
92
|
-
const [b,
|
|
93
|
-
o(b,
|
|
91
|
+
const [m, u] = R(0), f = T((x) => {
|
|
92
|
+
if (u(x), o) {
|
|
93
|
+
const [b, p] = [...r.entries()][x];
|
|
94
|
+
o(b, p);
|
|
94
95
|
}
|
|
95
96
|
}, [r, o]);
|
|
96
97
|
return M(() => {
|
|
97
|
-
const x =
|
|
98
|
+
const x = s == null ? void 0 : s.current;
|
|
98
99
|
if (!x)
|
|
99
100
|
return;
|
|
100
|
-
const b = (
|
|
101
|
-
["Enter", "ArrowUp", "ArrowDown"].includes(
|
|
101
|
+
const b = (p) => {
|
|
102
|
+
["Enter", "ArrowUp", "ArrowDown"].includes(p.key) && p.preventDefault(), p.key === "ArrowDown" ? f(Math.min(m + 1, r.size - 1)) : p.key === "ArrowUp" ? f(Math.max(m - 1, 0)) : p.key === "Enter" && e([...r.values()][m]);
|
|
102
103
|
};
|
|
103
104
|
return x.addEventListener("keydown", b), () => x.removeEventListener("keydown", b);
|
|
104
|
-
}, [m,
|
|
105
|
+
}, [m, s, f, r, e]), /* @__PURE__ */ g(
|
|
105
106
|
N,
|
|
106
107
|
{
|
|
107
108
|
id: t,
|
|
108
|
-
className: w("tw:py-1 tw:flex tw:flex-col",
|
|
109
|
+
className: w("tw:py-1 tw:flex tw:flex-col", d),
|
|
109
110
|
role: "listbox",
|
|
110
111
|
"aria-orientation": "vertical",
|
|
111
|
-
"aria-label":
|
|
112
|
+
"aria-label": i,
|
|
112
113
|
...c,
|
|
113
114
|
children: [
|
|
114
|
-
r.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:
|
|
115
|
-
[...r.entries()].map(([x, b],
|
|
115
|
+
r.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: l }),
|
|
116
|
+
[...r.entries()].map(([x, b], p) => /* @__PURE__ */ n(
|
|
116
117
|
"button",
|
|
117
118
|
{
|
|
118
119
|
id: `${t}_${x}`,
|
|
119
120
|
type: "button",
|
|
120
121
|
role: "option",
|
|
121
|
-
"aria-selected":
|
|
122
|
+
"aria-selected": p === m,
|
|
122
123
|
className: w(
|
|
123
124
|
"tw:px-2 tw:py-1 tw:text-left tw:truncate",
|
|
124
|
-
{ "tw:bg-lm-secondary tw:dark:bg-dm-secondary":
|
|
125
|
+
{ "tw:bg-lm-secondary tw:dark:bg-dm-secondary": p === m }
|
|
125
126
|
),
|
|
126
127
|
tabIndex: -1,
|
|
127
128
|
onClick: () => e(b),
|
|
128
|
-
onMouseOver: () =>
|
|
129
|
+
onMouseOver: () => f(p),
|
|
129
130
|
children: a(b)
|
|
130
131
|
},
|
|
131
132
|
x
|
|
@@ -134,7 +135,7 @@ function kt({
|
|
|
134
135
|
}
|
|
135
136
|
);
|
|
136
137
|
}
|
|
137
|
-
const E =
|
|
138
|
+
const E = S(void 0), L = S({ responsive: !0, size: "md" }), Lt = ({ children: t, className: r }) => {
|
|
138
139
|
const { responsive: e } = C(L);
|
|
139
140
|
return /* @__PURE__ */ n(E.Provider, { value: { section: "head" }, children: /* @__PURE__ */ n(
|
|
140
141
|
"thead",
|
|
@@ -146,7 +147,7 @@ const E = H(void 0), L = H({ responsive: !0, size: "md" }), vt = ({ children: t,
|
|
|
146
147
|
children: t
|
|
147
148
|
}
|
|
148
149
|
) });
|
|
149
|
-
},
|
|
150
|
+
}, Bt = ({ children: t, className: r }) => {
|
|
150
151
|
const { responsive: e } = C(L);
|
|
151
152
|
return /* @__PURE__ */ n(E.Provider, { value: { section: "body" }, children: /* @__PURE__ */ n(
|
|
152
153
|
"tbody",
|
|
@@ -158,7 +159,7 @@ const E = H(void 0), L = H({ responsive: !0, size: "md" }), vt = ({ children: t,
|
|
|
158
159
|
children: t
|
|
159
160
|
}
|
|
160
161
|
) });
|
|
161
|
-
},
|
|
162
|
+
}, Mt = ({ children: t, className: r }) => {
|
|
162
163
|
const { responsive: e } = C(L);
|
|
163
164
|
return /* @__PURE__ */ n(E.Provider, { value: { section: "footer" }, children: /* @__PURE__ */ n(
|
|
164
165
|
"tfoot",
|
|
@@ -170,16 +171,16 @@ const E = H(void 0), L = H({ responsive: !0, size: "md" }), vt = ({ children: t,
|
|
|
170
171
|
children: t
|
|
171
172
|
}
|
|
172
173
|
) });
|
|
173
|
-
},
|
|
174
|
-
const o = C(E), a = (o == null ? void 0 : o.section) === "body", { responsive:
|
|
174
|
+
}, Rt = ({ children: t, className: r, ...e }) => {
|
|
175
|
+
const o = C(E), a = (o == null ? void 0 : o.section) === "body", { responsive: d } = C(L);
|
|
175
176
|
return /* @__PURE__ */ n(
|
|
176
177
|
"tr",
|
|
177
178
|
{
|
|
178
179
|
className: w(
|
|
179
180
|
"tw:group",
|
|
180
181
|
{
|
|
181
|
-
"tw:lg:table-row tw:flex tw:flex-col":
|
|
182
|
-
"tw:lg:border-0 tw:border-y-2 tw:border-lm-border tw:dark:border-dm-border":
|
|
182
|
+
"tw:lg:table-row tw:flex tw:flex-col": d,
|
|
183
|
+
"tw:lg:border-0 tw:border-y-2 tw:border-lm-border tw:dark:border-dm-border": d,
|
|
183
184
|
"tw:hover:bg-lm-primary tw:dark:hover:bg-dm-primary": a,
|
|
184
185
|
// Use a different hover bg color depending on the table being inside a card or not
|
|
185
186
|
"tw:group-[&]/card:hover:bg-lm-secondary tw:dark:group-[&]/card:hover:bg-dm-secondary": a
|
|
@@ -190,22 +191,22 @@ const E = H(void 0), L = H({ responsive: !0, size: "md" }), vt = ({ children: t,
|
|
|
190
191
|
children: t
|
|
191
192
|
}
|
|
192
193
|
);
|
|
193
|
-
},
|
|
194
|
-
const
|
|
194
|
+
}, Et = ({ children: t, className: r, columnName: e, type: o, ...a }) => {
|
|
195
|
+
const d = C(E), l = o ?? ((d == null ? void 0 : d.section) !== "body" ? "th" : "td"), { responsive: s, size: i } = C(L);
|
|
195
196
|
return /* @__PURE__ */ n(
|
|
196
|
-
|
|
197
|
+
l,
|
|
197
198
|
{
|
|
198
|
-
"data-column":
|
|
199
|
+
"data-column": s ? e : void 0,
|
|
199
200
|
className: w(
|
|
200
201
|
"tw:border-lm-border tw:dark:border-dm-border",
|
|
201
202
|
{
|
|
202
|
-
"tw:p-1":
|
|
203
|
-
"tw:p-2":
|
|
204
|
-
"tw:p-3":
|
|
205
|
-
"tw:border-b-1": !
|
|
206
|
-
"tw:block tw:lg:table-cell tw:not-last:border-b-1 tw:lg:border-b-1":
|
|
203
|
+
"tw:p-1": i === "sm",
|
|
204
|
+
"tw:p-2": i === "md",
|
|
205
|
+
"tw:p-3": i === "lg",
|
|
206
|
+
"tw:border-b-1": !s,
|
|
207
|
+
"tw:block tw:lg:table-cell tw:not-last:border-b-1 tw:lg:border-b-1": s,
|
|
207
208
|
// For responsive tables, display the content in data-column attribute for md sizes and lower
|
|
208
|
-
"tw:before:lg:hidden tw:before:content-[attr(data-column)] tw:before:font-bold tw:before:mr-1":
|
|
209
|
+
"tw:before:lg:hidden tw:before:content-[attr(data-column)] tw:before:font-bold tw:before:mr-1": s && l === "td"
|
|
209
210
|
},
|
|
210
211
|
r
|
|
211
212
|
),
|
|
@@ -213,83 +214,81 @@ const E = H(void 0), L = H({ responsive: !0, size: "md" }), vt = ({ children: t,
|
|
|
213
214
|
children: t
|
|
214
215
|
}
|
|
215
216
|
);
|
|
216
|
-
},
|
|
217
|
-
/* @__PURE__ */ n(
|
|
218
|
-
/* @__PURE__ */ n(
|
|
219
|
-
r && /* @__PURE__ */ n(
|
|
220
|
-
] }) }),
|
|
217
|
+
}, Ft = ({ header: t, footer: r, children: e, responsive: o = !0, size: a = "md", ...d }) => /* @__PURE__ */ n(L.Provider, { value: { responsive: o, size: a }, children: /* @__PURE__ */ g("table", { className: "tw:w-full", ...d, children: [
|
|
218
|
+
/* @__PURE__ */ n(Lt, { children: t }),
|
|
219
|
+
/* @__PURE__ */ n(Bt, { children: e }),
|
|
220
|
+
r && /* @__PURE__ */ n(Mt, { children: r })
|
|
221
|
+
] }) }), de = Object.assign(Ft, { Row: Rt, Cell: Et }), _t = h(({
|
|
221
222
|
children: t,
|
|
222
223
|
className: r,
|
|
223
224
|
disabled: e,
|
|
224
225
|
variant: o = "primary",
|
|
225
226
|
size: a = "md",
|
|
226
|
-
inline:
|
|
227
|
-
solid:
|
|
228
|
-
type:
|
|
229
|
-
...
|
|
230
|
-
}) => {
|
|
231
|
-
const
|
|
232
|
-
return (
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
c,
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
!
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
}
|
|
289
|
-
)
|
|
227
|
+
inline: d = !1,
|
|
228
|
+
solid: l = !1,
|
|
229
|
+
type: s = "button",
|
|
230
|
+
...i
|
|
231
|
+
}, c) => {
|
|
232
|
+
const m = "to" in i ? j : "button", u = m === j ? void 0 : s;
|
|
233
|
+
return /* @__PURE__ */ n(
|
|
234
|
+
m,
|
|
235
|
+
{
|
|
236
|
+
ref: c,
|
|
237
|
+
className: w(
|
|
238
|
+
{
|
|
239
|
+
"tw:inline-flex": d,
|
|
240
|
+
"tw:flex": !d
|
|
241
|
+
},
|
|
242
|
+
"tw:gap-2 tw:items-center tw:justify-center",
|
|
243
|
+
"tw:border tw:rounded-md tw:no-underline",
|
|
244
|
+
"tw:transition-colors",
|
|
245
|
+
{
|
|
246
|
+
"tw:focus-ring": o === "primary",
|
|
247
|
+
"tw:focus-ring-secondary": o === "secondary",
|
|
248
|
+
"tw:focus-ring-danger": o === "danger"
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
"tw:px-1.5 tw:py-1 tw:text-sm": a === "sm",
|
|
252
|
+
"tw:px-3 tw:py-1.5": a === "md",
|
|
253
|
+
"tw:px-4 tw:py-2 tw:text-lg": a === "lg"
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
"tw:border-lm-brand tw:dark:border-dm-brand": o === "primary",
|
|
257
|
+
"tw:text-lm-brand tw:dark:text-dm-brand": o === "primary" && !l,
|
|
258
|
+
"tw:border-zinc-500": o === "secondary",
|
|
259
|
+
"tw:text-zinc-500": o === "secondary" && !l,
|
|
260
|
+
"tw:border-danger": o === "danger",
|
|
261
|
+
"tw:text-danger": o === "danger" && !l
|
|
262
|
+
},
|
|
263
|
+
l && {
|
|
264
|
+
"tw:text-white": !0,
|
|
265
|
+
"tw:bg-lm-brand tw:dark:bg-dm-brand": o === "primary",
|
|
266
|
+
"tw:highlight:bg-lm-brand-dark tw:dark:highlight:bg-dm-brand-dark": o === "primary",
|
|
267
|
+
"tw:highlight:border-lm-brand-dark tw:dark:highlight:border-dm-brand-dark": o === "primary",
|
|
268
|
+
"tw:bg-zinc-500": o === "secondary",
|
|
269
|
+
"tw:highlight:bg-zinc-600 tw:highlight:border-zinc-600": o === "secondary",
|
|
270
|
+
"tw:bg-danger": o === "danger",
|
|
271
|
+
"tw:highlight:bg-danger-dark tw:highlight:border-danger-dark": o === "danger"
|
|
272
|
+
},
|
|
273
|
+
!e && {
|
|
274
|
+
"tw:highlight:text-white": !l,
|
|
275
|
+
"tw:highlight:bg-lm-brand tw:dark:highlight:bg-dm-brand": o === "primary",
|
|
276
|
+
"tw:highlight:bg-zinc-500": o === "secondary",
|
|
277
|
+
"tw:highlight:bg-danger": o === "danger"
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
"tw:pointer-events-none tw:opacity-65": e
|
|
281
|
+
},
|
|
282
|
+
r
|
|
283
|
+
),
|
|
284
|
+
disabled: e,
|
|
285
|
+
type: u,
|
|
286
|
+
...i,
|
|
287
|
+
children: t
|
|
288
|
+
}
|
|
290
289
|
);
|
|
291
|
-
}, Y =
|
|
292
|
-
const a =
|
|
290
|
+
}), Y = h(({ className: t, onChange: r, ...e }, o) => {
|
|
291
|
+
const a = T((d) => r == null ? void 0 : r(d.target.checked, d), [r]);
|
|
293
292
|
return /* @__PURE__ */ n(
|
|
294
293
|
"input",
|
|
295
294
|
{
|
|
@@ -307,16 +306,17 @@ const E = H(void 0), L = H({ responsive: !0, size: "md" }), vt = ({ children: t,
|
|
|
307
306
|
...e
|
|
308
307
|
}
|
|
309
308
|
);
|
|
310
|
-
}),
|
|
309
|
+
}), se = h(({ className: t, ...r }, e) => /* @__PURE__ */ n(
|
|
311
310
|
Y,
|
|
312
311
|
{
|
|
313
312
|
ref: e,
|
|
314
313
|
className: y("tw:rounded-sm tw:w-4 tw:h-4 tw:checked:bg-(image:--tick) tw:bg-center", t),
|
|
315
314
|
...r
|
|
316
315
|
}
|
|
317
|
-
)), Q = ({ onClick: t, className: r, label: e = "Close" }) => /* @__PURE__ */ n(
|
|
316
|
+
)), Q = h(({ onClick: t, className: r, label: e = "Close" }, o) => /* @__PURE__ */ n(
|
|
318
317
|
"button",
|
|
319
318
|
{
|
|
319
|
+
ref: o,
|
|
320
320
|
type: "button",
|
|
321
321
|
onClick: t,
|
|
322
322
|
className: w(
|
|
@@ -325,22 +325,22 @@ const E = H(void 0), L = H({ responsive: !0, size: "md" }), vt = ({ children: t,
|
|
|
325
325
|
r
|
|
326
326
|
),
|
|
327
327
|
"aria-label": e,
|
|
328
|
-
children: /* @__PURE__ */ n(v, { icon:
|
|
328
|
+
children: /* @__PURE__ */ n(v, { icon: lt, size: "xl" })
|
|
329
329
|
}
|
|
330
|
-
),
|
|
330
|
+
)), W = h(({
|
|
331
331
|
borderless: t = !1,
|
|
332
332
|
size: r = "md",
|
|
333
333
|
feedback: e,
|
|
334
334
|
className: o,
|
|
335
335
|
disabled: a,
|
|
336
|
-
readOnly:
|
|
337
|
-
...
|
|
338
|
-
},
|
|
339
|
-
const
|
|
336
|
+
readOnly: d,
|
|
337
|
+
...l
|
|
338
|
+
}, s) => {
|
|
339
|
+
const i = !a && !d;
|
|
340
340
|
return /* @__PURE__ */ n(
|
|
341
341
|
"input",
|
|
342
342
|
{
|
|
343
|
-
ref:
|
|
343
|
+
ref: s,
|
|
344
344
|
className: w(
|
|
345
345
|
"tw:w-full",
|
|
346
346
|
{
|
|
@@ -356,19 +356,19 @@ const E = H(void 0), L = H({ responsive: !0, size: "md" }), vt = ({ children: t,
|
|
|
356
356
|
"tw:rounded-md tw:border": !t,
|
|
357
357
|
"tw:border-lm-input-border tw:dark:border-dm-input-border": !t && !e,
|
|
358
358
|
"tw:border-danger": !t && e === "error",
|
|
359
|
-
"tw:bg-lm-disabled-input tw:dark:bg-dm-disabled-input": !
|
|
360
|
-
"tw:bg-lm-primary tw:dark:bg-dm-primary":
|
|
359
|
+
"tw:bg-lm-disabled-input tw:dark:bg-dm-disabled-input": !i,
|
|
360
|
+
"tw:bg-lm-primary tw:dark:bg-dm-primary": i,
|
|
361
361
|
// Use different background color when rendered inside a card
|
|
362
|
-
"tw:group-[&]/card:bg-lm-input tw:group-[&]/card:dark:bg-dm-input":
|
|
362
|
+
"tw:group-[&]/card:bg-lm-input tw:group-[&]/card:dark:bg-dm-input": i
|
|
363
363
|
},
|
|
364
364
|
o
|
|
365
365
|
),
|
|
366
366
|
disabled: a,
|
|
367
|
-
readOnly:
|
|
368
|
-
...
|
|
367
|
+
readOnly: d,
|
|
368
|
+
...l
|
|
369
369
|
}
|
|
370
370
|
);
|
|
371
|
-
}),
|
|
371
|
+
}), U = ({ required: t, children: r, className: e, ...o }) => /* @__PURE__ */ g("label", { className: y("tw:cursor-pointer", e), ...o, children: [
|
|
372
372
|
r,
|
|
373
373
|
t && /* @__PURE__ */ n("span", { className: "tw:text-danger tw:ml-1", "data-testid": "required-indicator", children: "*" })
|
|
374
374
|
] }), K = ({ children: t, helpText: r, error: e, "data-testid": o }) => /* @__PURE__ */ g("div", { className: "tw:flex tw:flex-col tw:gap-1", "data-testid": o, children: [
|
|
@@ -382,39 +382,39 @@ const E = H(void 0), L = H({ responsive: !0, size: "md" }), vt = ({ children: t,
|
|
|
382
382
|
}
|
|
383
383
|
),
|
|
384
384
|
e && /* @__PURE__ */ n("span", { "data-testid": o ? `${o}-error` : "error", className: "tw:text-danger", children: e })
|
|
385
|
-
] }),
|
|
386
|
-
const c =
|
|
387
|
-
return /* @__PURE__ */ g(K, { error: a, helpText:
|
|
388
|
-
/* @__PURE__ */ n(
|
|
385
|
+
] }), ie = h(({ label: t, inputClassName: r, required: e, hiddenRequired: o, error: a, helpText: d, "data-testid": l, ...s }, i) => {
|
|
386
|
+
const c = D();
|
|
387
|
+
return /* @__PURE__ */ g(K, { error: a, helpText: d, "data-testid": l, children: [
|
|
388
|
+
/* @__PURE__ */ n(U, { htmlFor: c, required: e, children: t }),
|
|
389
389
|
/* @__PURE__ */ n(
|
|
390
|
-
|
|
390
|
+
W,
|
|
391
391
|
{
|
|
392
|
-
ref:
|
|
392
|
+
ref: i,
|
|
393
393
|
id: c,
|
|
394
394
|
className: r,
|
|
395
395
|
required: e || o,
|
|
396
396
|
feedback: a ? "error" : void 0,
|
|
397
|
-
...
|
|
397
|
+
...s
|
|
398
398
|
}
|
|
399
399
|
)
|
|
400
400
|
] });
|
|
401
|
-
}),
|
|
402
|
-
const [
|
|
403
|
-
var
|
|
404
|
-
(
|
|
405
|
-
}, [
|
|
401
|
+
}), Dt = h(({ containerClassName: t, className: r, size: e, ...o }, a) => {
|
|
402
|
+
const [d, l, , s] = ct(!1), i = I(null), c = T(({ relatedTarget: m }) => {
|
|
403
|
+
var u;
|
|
404
|
+
(u = i.current) != null && u.contains(m) || s();
|
|
405
|
+
}, [i, s]);
|
|
406
406
|
return /* @__PURE__ */ g(
|
|
407
407
|
"div",
|
|
408
408
|
{
|
|
409
409
|
className: y("tw:group tw:relative", t),
|
|
410
|
-
ref:
|
|
410
|
+
ref: i,
|
|
411
411
|
onBlurCapture: c,
|
|
412
412
|
children: [
|
|
413
413
|
/* @__PURE__ */ n(
|
|
414
|
-
|
|
414
|
+
W,
|
|
415
415
|
{
|
|
416
416
|
ref: a,
|
|
417
|
-
type:
|
|
417
|
+
type: d ? "text" : "password",
|
|
418
418
|
className: y(
|
|
419
419
|
{
|
|
420
420
|
"tw:pr-10": e !== "sm",
|
|
@@ -431,9 +431,9 @@ const E = H(void 0), L = H({ responsive: !0, size: "md" }), vt = ({ children: t,
|
|
|
431
431
|
"button",
|
|
432
432
|
{
|
|
433
433
|
type: "button",
|
|
434
|
-
onClick:
|
|
435
|
-
title:
|
|
436
|
-
"aria-label":
|
|
434
|
+
onClick: l,
|
|
435
|
+
title: d ? "Hide password" : "Show password",
|
|
436
|
+
"aria-label": d ? "Hide password" : "Show password",
|
|
437
437
|
className: y(
|
|
438
438
|
"tw:absolute tw:top-[50%] tw:translate-y-[-50%] tw:px-1",
|
|
439
439
|
"tw:text-placeholder tw:hover:text-lm-text tw:hover:dark:text-dm-text tw:transition-colors",
|
|
@@ -443,39 +443,39 @@ const E = H(void 0), L = H({ responsive: !0, size: "md" }), vt = ({ children: t,
|
|
|
443
443
|
}
|
|
444
444
|
),
|
|
445
445
|
tabIndex: -1,
|
|
446
|
-
children: /* @__PURE__ */ n(v, { fixedWidth: !0, icon:
|
|
446
|
+
children: /* @__PURE__ */ n(v, { fixedWidth: !0, icon: d ? dt : st })
|
|
447
447
|
}
|
|
448
448
|
)
|
|
449
449
|
]
|
|
450
450
|
}
|
|
451
451
|
);
|
|
452
|
-
}),
|
|
453
|
-
const c =
|
|
454
|
-
return /* @__PURE__ */ g(K, { error: a, helpText:
|
|
455
|
-
/* @__PURE__ */ n(
|
|
452
|
+
}), we = h(({ label: t, inputClassName: r, required: e, hiddenRequired: o, error: a, helpText: d, "data-testid": l, ...s }, i) => {
|
|
453
|
+
const c = D();
|
|
454
|
+
return /* @__PURE__ */ g(K, { error: a, helpText: d, "data-testid": l, children: [
|
|
455
|
+
/* @__PURE__ */ n(U, { htmlFor: c, required: e, children: t }),
|
|
456
456
|
/* @__PURE__ */ n(
|
|
457
|
-
|
|
457
|
+
Dt,
|
|
458
458
|
{
|
|
459
|
-
ref:
|
|
459
|
+
ref: i,
|
|
460
460
|
id: c,
|
|
461
461
|
className: r,
|
|
462
462
|
required: e || o,
|
|
463
463
|
feedback: a ? "error" : void 0,
|
|
464
|
-
...
|
|
464
|
+
...s
|
|
465
465
|
}
|
|
466
466
|
)
|
|
467
467
|
] });
|
|
468
|
-
}),
|
|
468
|
+
}), $t = h(({
|
|
469
469
|
className: t,
|
|
470
470
|
size: r = "md",
|
|
471
471
|
feedback: e,
|
|
472
472
|
style: o = {},
|
|
473
473
|
disabled: a,
|
|
474
|
-
...
|
|
475
|
-
},
|
|
474
|
+
...d
|
|
475
|
+
}, l) => /* @__PURE__ */ n(
|
|
476
476
|
"select",
|
|
477
477
|
{
|
|
478
|
-
ref:
|
|
478
|
+
ref: l,
|
|
479
479
|
className: w(
|
|
480
480
|
"tw:w-full tw:appearance-none tw:pr-9",
|
|
481
481
|
"tw:bg-(image:--chevron-down) tw:bg-no-repeat",
|
|
@@ -503,41 +503,41 @@ const E = H(void 0), L = H({ responsive: !0, size: "md" }), vt = ({ children: t,
|
|
|
503
503
|
background: "right 0.75rem center / 16px 12px"
|
|
504
504
|
},
|
|
505
505
|
disabled: a,
|
|
506
|
-
...
|
|
506
|
+
...d
|
|
507
507
|
}
|
|
508
|
-
)),
|
|
509
|
-
const c =
|
|
510
|
-
return /* @__PURE__ */ g(K, { error: e, helpText: o, "data-testid":
|
|
511
|
-
/* @__PURE__ */ n(
|
|
508
|
+
)), ce = h(({ selectClassName: t, label: r, error: e, helpText: o, required: a, hiddenRequired: d, "data-testid": l, ...s }, i) => {
|
|
509
|
+
const c = D();
|
|
510
|
+
return /* @__PURE__ */ g(K, { error: e, helpText: o, "data-testid": l, children: [
|
|
511
|
+
/* @__PURE__ */ n(U, { htmlFor: c, required: a, children: r }),
|
|
512
512
|
/* @__PURE__ */ n(
|
|
513
|
-
|
|
513
|
+
$t,
|
|
514
514
|
{
|
|
515
|
-
ref:
|
|
515
|
+
ref: i,
|
|
516
516
|
id: c,
|
|
517
517
|
className: t,
|
|
518
|
-
required: a ||
|
|
518
|
+
required: a || d,
|
|
519
519
|
feedback: e ? "error" : void 0,
|
|
520
|
-
...
|
|
520
|
+
...s
|
|
521
521
|
}
|
|
522
522
|
)
|
|
523
523
|
] });
|
|
524
|
-
}),
|
|
524
|
+
}), Ht = h(({
|
|
525
525
|
onChange: t,
|
|
526
526
|
containerClassName: r,
|
|
527
527
|
inputClassName: e,
|
|
528
528
|
// Inputs have a default 'md' size. Search inputs are usually 'lg' as they are rendered at the top of sections
|
|
529
529
|
size: o = "lg",
|
|
530
530
|
loading: a = !1,
|
|
531
|
-
...
|
|
532
|
-
},
|
|
533
|
-
const { setTimeout:
|
|
534
|
-
m ?
|
|
535
|
-
}, [
|
|
531
|
+
...d
|
|
532
|
+
}, l) => {
|
|
533
|
+
const { setTimeout: s, clearCurrentTimeout: i } = mt(500), c = T((m) => {
|
|
534
|
+
m ? s(() => t(m)) : (i(), t(m));
|
|
535
|
+
}, [i, t, s]);
|
|
536
536
|
return /* @__PURE__ */ g("div", { className: w("tw:group tw:relative tw:focus-within:z-10", r), children: [
|
|
537
537
|
/* @__PURE__ */ n(
|
|
538
538
|
v,
|
|
539
539
|
{
|
|
540
|
-
icon: a ? X :
|
|
540
|
+
icon: a ? X : it,
|
|
541
541
|
spin: a,
|
|
542
542
|
className: w(
|
|
543
543
|
"tw:absolute tw:top-[50%] tw:translate-y-[-50%] tw:transition-colors",
|
|
@@ -550,9 +550,9 @@ const E = H(void 0), L = H({ responsive: !0, size: "md" }), vt = ({ children: t,
|
|
|
550
550
|
}
|
|
551
551
|
),
|
|
552
552
|
/* @__PURE__ */ n(
|
|
553
|
-
|
|
553
|
+
W,
|
|
554
554
|
{
|
|
555
|
-
ref:
|
|
555
|
+
ref: l,
|
|
556
556
|
type: "search",
|
|
557
557
|
className: w(
|
|
558
558
|
{
|
|
@@ -564,27 +564,27 @@ const E = H(void 0), L = H({ responsive: !0, size: "md" }), vt = ({ children: t,
|
|
|
564
564
|
placeholder: "Search...",
|
|
565
565
|
onChange: (m) => c(m.target.value),
|
|
566
566
|
size: o,
|
|
567
|
-
...
|
|
567
|
+
...d
|
|
568
568
|
}
|
|
569
569
|
)
|
|
570
570
|
] });
|
|
571
571
|
});
|
|
572
|
-
function
|
|
572
|
+
function me({
|
|
573
573
|
searchResults: t,
|
|
574
574
|
onSearch: r,
|
|
575
575
|
onSelectSearchResult: e,
|
|
576
576
|
renderSearchResult: o,
|
|
577
577
|
size: a = "md",
|
|
578
578
|
// SearchInput defaults its size to 'lg'. Change it to 'md'
|
|
579
|
-
listboxSpan:
|
|
580
|
-
onFocus:
|
|
581
|
-
...
|
|
579
|
+
listboxSpan: d = "full",
|
|
580
|
+
onFocus: l,
|
|
581
|
+
...s
|
|
582
582
|
}) {
|
|
583
|
-
const
|
|
583
|
+
const i = I(null), c = D(), [m, u] = R(), f = $(
|
|
584
584
|
() => t ? m ?? [...t.keys()][0] : void 0,
|
|
585
585
|
[m, t]
|
|
586
|
-
), x =
|
|
587
|
-
e(b), r(""),
|
|
586
|
+
), x = T((b) => {
|
|
587
|
+
e(b), r(""), i.current.value = "";
|
|
588
588
|
}, [r, e]);
|
|
589
589
|
return /* @__PURE__ */ g(
|
|
590
590
|
"div",
|
|
@@ -595,38 +595,38 @@ function ae({
|
|
|
595
595
|
},
|
|
596
596
|
children: [
|
|
597
597
|
/* @__PURE__ */ n(
|
|
598
|
-
|
|
598
|
+
Ht,
|
|
599
599
|
{
|
|
600
600
|
onChange: r,
|
|
601
601
|
size: a,
|
|
602
|
-
ref:
|
|
602
|
+
ref: i,
|
|
603
603
|
role: "combobox",
|
|
604
604
|
"aria-autocomplete": "list",
|
|
605
605
|
"aria-expanded": !!t,
|
|
606
606
|
"aria-controls": c,
|
|
607
|
-
"aria-activedescendant":
|
|
607
|
+
"aria-activedescendant": f ? `${c}_${f}` : void 0,
|
|
608
608
|
autoComplete: "off",
|
|
609
609
|
autoCorrect: "off",
|
|
610
610
|
onFocus: (b) => {
|
|
611
|
-
|
|
611
|
+
l == null || l(b), r(b.target.value);
|
|
612
612
|
},
|
|
613
|
-
...
|
|
613
|
+
...s
|
|
614
614
|
}
|
|
615
615
|
),
|
|
616
616
|
t && /* @__PURE__ */ n(
|
|
617
|
-
|
|
617
|
+
Pt,
|
|
618
618
|
{
|
|
619
619
|
id: c,
|
|
620
620
|
items: t,
|
|
621
|
-
anchor:
|
|
621
|
+
anchor: i,
|
|
622
622
|
onSelectItem: x,
|
|
623
|
-
onActiveItemChange:
|
|
623
|
+
onActiveItemChange: u,
|
|
624
624
|
renderItem: o,
|
|
625
625
|
className: w(
|
|
626
626
|
"tw:absolute tw:top-full tw:mt-1 tw:z-10",
|
|
627
627
|
{
|
|
628
|
-
"tw:min-w-60 tw:max-w-full":
|
|
629
|
-
"tw:w-full":
|
|
628
|
+
"tw:min-w-60 tw:max-w-full": d === "auto",
|
|
629
|
+
"tw:w-full": d === "full"
|
|
630
630
|
}
|
|
631
631
|
),
|
|
632
632
|
"aria-label": "Matching items",
|
|
@@ -637,7 +637,7 @@ function ae({
|
|
|
637
637
|
}
|
|
638
638
|
);
|
|
639
639
|
}
|
|
640
|
-
const
|
|
640
|
+
const be = h(({ className: t, ...r }, e) => /* @__PURE__ */ n(
|
|
641
641
|
Y,
|
|
642
642
|
{
|
|
643
643
|
ref: e,
|
|
@@ -650,7 +650,7 @@ const de = u(({ className: t, ...r }, e) => /* @__PURE__ */ n(
|
|
|
650
650
|
),
|
|
651
651
|
...r
|
|
652
652
|
}
|
|
653
|
-
)),
|
|
653
|
+
)), Ot = h(({ className: t, disabled: r, size: e = "md", type: o = "button", ...a }, d) => /* @__PURE__ */ n(
|
|
654
654
|
"button",
|
|
655
655
|
{
|
|
656
656
|
className: w(
|
|
@@ -667,9 +667,10 @@ const de = u(({ className: t, ...r }, e) => /* @__PURE__ */ n(
|
|
|
667
667
|
),
|
|
668
668
|
disabled: r,
|
|
669
669
|
type: o,
|
|
670
|
-
...a
|
|
670
|
+
...a,
|
|
671
|
+
ref: d
|
|
671
672
|
}
|
|
672
|
-
), Z =
|
|
673
|
+
)), Z = S(null), jt = ({ className: t, to: r, ...e }) => {
|
|
673
674
|
const o = C(Z);
|
|
674
675
|
return /* @__PURE__ */ n(
|
|
675
676
|
at,
|
|
@@ -693,13 +694,13 @@ const de = u(({ className: t, ...r }, e) => /* @__PURE__ */ n(
|
|
|
693
694
|
...e
|
|
694
695
|
}
|
|
695
696
|
);
|
|
696
|
-
},
|
|
697
|
-
const e =
|
|
698
|
-
Math.max(
|
|
699
|
-
Math.min(r - 1, t +
|
|
697
|
+
}, At = ({ children: t, className: r, fill: e }) => /* @__PURE__ */ n(Z.Provider, { value: { fill: e }, children: /* @__PURE__ */ n(N, { role: "menubar", className: w("tw:flex tw:overflow-hidden", r), children: t }) }), ge = Object.assign(At, { Pill: jt }), St = new Intl.NumberFormat("en-US"), Wt = (t) => St.format(Number(t)), V = 10, pe = (t) => Math.ceil(t / V) * V, P = 2, _ = "...", Ut = (t, r) => Array.from({ length: r - t }, (e, o) => t + o), Kt = (t, r) => {
|
|
698
|
+
const e = Ut(
|
|
699
|
+
Math.max(P, t - P),
|
|
700
|
+
Math.min(r - 1, t + P) + 1
|
|
700
701
|
);
|
|
701
|
-
return t -
|
|
702
|
-
}, B = (t) => t === _,
|
|
702
|
+
return t - P > P && e.unshift(_), t + P < r - 1 && e.push(_), e.unshift(1), e.push(r), e;
|
|
703
|
+
}, B = (t) => t === _, zt = (t) => B(t) ? t : Wt(t), qt = (t, r) => B(t) ? `${t}_${r}` : `${t}`, tt = [
|
|
703
704
|
"tw:border tw:border-r-0 tw:last:border-r tw:border-lm-border tw:dark:border-dm-border",
|
|
704
705
|
"tw:rounded-none tw:first:rounded-l tw:last:rounded-r"
|
|
705
706
|
], et = (t = !1) => w(
|
|
@@ -713,60 +714,60 @@ const de = u(({ className: t, ...r }, e) => /* @__PURE__ */ n(
|
|
|
713
714
|
],
|
|
714
715
|
t && "tw:bg-lm-main tw:dark:bg-dm-main tw:text-white"
|
|
715
716
|
), A = ({ children: t }) => /* @__PURE__ */ n("span", { "aria-hidden": !0, className: w(tt, "tw:px-3 py-2 tw:text-gray-400"), children: t }), rt = () => /* @__PURE__ */ n(A, { children: _ });
|
|
716
|
-
function
|
|
717
|
-
const
|
|
718
|
-
return e ? /* @__PURE__ */ n(rt, {}) : /* @__PURE__ */ n(j, { className:
|
|
717
|
+
function Gt({ children: t, active: r, isEllipsis: e, href: o, ...a }) {
|
|
718
|
+
const d = $(() => et(r), [r]);
|
|
719
|
+
return e ? /* @__PURE__ */ n(rt, {}) : /* @__PURE__ */ n(j, { className: d, to: o, ...a, children: t });
|
|
719
720
|
}
|
|
720
|
-
function
|
|
721
|
-
const a =
|
|
721
|
+
function Jt({ children: t, active: r, isEllipsis: e, ...o }) {
|
|
722
|
+
const a = $(() => et(r), [r]);
|
|
722
723
|
return e ? /* @__PURE__ */ n(rt, {}) : /* @__PURE__ */ n("button", { type: "button", className: a, ...o, children: t });
|
|
723
724
|
}
|
|
724
|
-
const
|
|
725
|
-
const o = "urlForPage" in e, a = o ?
|
|
726
|
-
(
|
|
725
|
+
const ue = ({ currentPage: t, pagesCount: r, ...e }) => {
|
|
726
|
+
const o = "urlForPage" in e, a = o ? Gt : Jt, d = T(
|
|
727
|
+
(l) => o ? { href: B(l) ? void 0 : e.urlForPage(l) } : { onClick: () => !B(l) && e.onPageChange(l) },
|
|
727
728
|
[o, e]
|
|
728
729
|
);
|
|
729
730
|
return r < 2 ? null : /* @__PURE__ */ g("div", { className: "tw:select-none tw:flex", "data-testid": "paginator", children: [
|
|
730
|
-
t === 1 ? /* @__PURE__ */ n(A, { children: /* @__PURE__ */ n(v, { size: "xs", icon: G }) }) : /* @__PURE__ */ n(a, { ...
|
|
731
|
-
|
|
731
|
+
t === 1 ? /* @__PURE__ */ n(A, { children: /* @__PURE__ */ n(v, { size: "xs", icon: G }) }) : /* @__PURE__ */ n(a, { ...d(Math.max(1, t - 1)), "aria-label": "Previous", children: /* @__PURE__ */ n(v, { size: "xs", icon: G }) }),
|
|
732
|
+
Kt(t, r).map((l, s) => /* @__PURE__ */ n(
|
|
732
733
|
a,
|
|
733
734
|
{
|
|
734
|
-
active:
|
|
735
|
-
isEllipsis: B(
|
|
736
|
-
...l
|
|
737
|
-
children:
|
|
735
|
+
active: l === t,
|
|
736
|
+
isEllipsis: B(l),
|
|
737
|
+
...d(l),
|
|
738
|
+
children: zt(l)
|
|
738
739
|
},
|
|
739
|
-
|
|
740
|
+
qt(l, s)
|
|
740
741
|
)),
|
|
741
|
-
t === r ? /* @__PURE__ */ n(A, { children: /* @__PURE__ */ n(v, { size: "xs", icon: J }) }) : /* @__PURE__ */ n(a, { ...
|
|
742
|
+
t === r ? /* @__PURE__ */ n(A, { children: /* @__PURE__ */ n(v, { size: "xs", icon: J }) }) : /* @__PURE__ */ n(a, { ...d(Math.min(r, t + 1)), "aria-label": "Next", children: /* @__PURE__ */ n(v, { size: "xs", icon: J }) })
|
|
742
743
|
] });
|
|
743
|
-
},
|
|
744
|
+
}, Qt = ({
|
|
744
745
|
open: t,
|
|
745
746
|
children: r,
|
|
746
747
|
className: e,
|
|
747
748
|
onClose: o,
|
|
748
749
|
...a
|
|
749
750
|
}) => {
|
|
750
|
-
const
|
|
751
|
+
const d = I(null);
|
|
751
752
|
return M(() => {
|
|
752
753
|
var c, m;
|
|
753
|
-
const
|
|
754
|
+
const l = document.body, s = l.style.overflow, i = l.style.paddingRight;
|
|
754
755
|
if (t) {
|
|
755
|
-
const
|
|
756
|
-
|
|
756
|
+
const u = window.outerWidth - l.clientWidth, f = l.scrollHeight > l.clientHeight;
|
|
757
|
+
l.style.overflow = "hidden", f && (l.style.paddingRight = `${u}px`), (c = d.current) == null || c.showModal();
|
|
757
758
|
} else
|
|
758
|
-
(m =
|
|
759
|
+
(m = d.current) == null || m.close();
|
|
759
760
|
return () => {
|
|
760
|
-
|
|
761
|
+
l.style.overflow = s, l.style.paddingRight = i;
|
|
761
762
|
};
|
|
762
|
-
}, [t]),
|
|
763
|
+
}, [t]), gt(
|
|
763
764
|
/* @__PURE__ */ n(
|
|
764
765
|
"dialog",
|
|
765
766
|
{
|
|
766
|
-
ref:
|
|
767
|
+
ref: d,
|
|
767
768
|
className: w("tw:bg-transparent tw:backdrop:bg-black/50", e),
|
|
768
|
-
onCancel: (
|
|
769
|
-
|
|
769
|
+
onCancel: (l) => {
|
|
770
|
+
l.preventDefault(), o();
|
|
770
771
|
},
|
|
771
772
|
...a,
|
|
772
773
|
children: t && r
|
|
@@ -774,47 +775,47 @@ const se = ({ currentPage: t, pagesCount: r, ...e }) => {
|
|
|
774
775
|
),
|
|
775
776
|
document.body
|
|
776
777
|
);
|
|
777
|
-
},
|
|
778
|
+
}, he = ({
|
|
778
779
|
open: t,
|
|
779
780
|
onClose: r,
|
|
780
781
|
variant: e = "default",
|
|
781
782
|
title: o,
|
|
782
783
|
children: a,
|
|
783
|
-
className:
|
|
784
|
-
...
|
|
784
|
+
className: d,
|
|
785
|
+
...l
|
|
785
786
|
}) => {
|
|
786
787
|
const {
|
|
787
|
-
size:
|
|
788
|
-
confirmText:
|
|
788
|
+
size: s = "md",
|
|
789
|
+
confirmText: i = "Confirm",
|
|
789
790
|
cancelText: c = "Cancel",
|
|
790
791
|
confirmDisabled: m,
|
|
791
|
-
onConfirm:
|
|
792
|
-
onClosed:
|
|
792
|
+
onConfirm: u,
|
|
793
|
+
onClosed: f,
|
|
793
794
|
...x
|
|
794
|
-
} = "onConfirm" in
|
|
795
|
-
k.preventDefault(), k.stopPropagation(),
|
|
796
|
-
}, [
|
|
795
|
+
} = "onConfirm" in l ? l : { ...l }, [b, p] = R(t), F = I(null), H = I("cancel"), ot = T((k) => {
|
|
796
|
+
k.preventDefault(), k.stopPropagation(), H.current = "confirm", u == null || u();
|
|
797
|
+
}, [u]);
|
|
797
798
|
return M(() => {
|
|
798
799
|
if (t) {
|
|
799
|
-
|
|
800
|
+
H.current = "cancel", p(!0);
|
|
800
801
|
return;
|
|
801
802
|
}
|
|
802
|
-
const k =
|
|
803
|
+
const k = F.current;
|
|
803
804
|
if (k) {
|
|
804
|
-
delete
|
|
805
|
-
let
|
|
806
|
-
const
|
|
807
|
-
|
|
805
|
+
delete F.current.dataset.open;
|
|
806
|
+
let z = !1;
|
|
807
|
+
const q = (nt) => {
|
|
808
|
+
z || nt.target !== k || (z = !0, p(!1), f == null || f(H.current));
|
|
808
809
|
};
|
|
809
|
-
return k.addEventListener("transitionend",
|
|
810
|
-
k.removeEventListener("transitionend",
|
|
810
|
+
return k.addEventListener("transitionend", q), () => {
|
|
811
|
+
k.removeEventListener("transitionend", q);
|
|
811
812
|
};
|
|
812
813
|
}
|
|
813
|
-
}, [
|
|
814
|
-
const k =
|
|
814
|
+
}, [f, t]), M(() => {
|
|
815
|
+
const k = F.current;
|
|
815
816
|
b && k && (k.dataset.open = "");
|
|
816
817
|
}, [b]), /* @__PURE__ */ n(
|
|
817
|
-
|
|
818
|
+
Qt,
|
|
818
819
|
{
|
|
819
820
|
open: b,
|
|
820
821
|
onClose: r,
|
|
@@ -823,14 +824,14 @@ const se = ({ currentPage: t, pagesCount: r, ...e }) => {
|
|
|
823
824
|
"tw:flex tw:w-screen tw:h-screen tw:max-w-screen tw:max-h-screen": b,
|
|
824
825
|
"tw:overflow-hidden": e === "cover"
|
|
825
826
|
},
|
|
826
|
-
|
|
827
|
+
d
|
|
827
828
|
),
|
|
828
829
|
...x,
|
|
829
830
|
children: /* @__PURE__ */ n(
|
|
830
831
|
"form",
|
|
831
832
|
{
|
|
832
833
|
"data-testid": "transition-container",
|
|
833
|
-
ref:
|
|
834
|
+
ref: F,
|
|
834
835
|
className: w(
|
|
835
836
|
"tw:w-full tw:m-auto tw:p-4 tw:sm:p-6",
|
|
836
837
|
// CSS transitions are based on the presence of the `data-open` attribute
|
|
@@ -838,10 +839,10 @@ const se = ({ currentPage: t, pagesCount: r, ...e }) => {
|
|
|
838
839
|
"tw:transition-[opacity_,_translate] tw:duration-300",
|
|
839
840
|
// Handle modal dimensions for different variants and sizes
|
|
840
841
|
e !== "cover" && {
|
|
841
|
-
"tw:sm:w-sm":
|
|
842
|
-
"tw:md:w-lg":
|
|
843
|
-
"tw:md:w-4xl":
|
|
844
|
-
"tw:md:w-6xl":
|
|
842
|
+
"tw:sm:w-sm": s === "sm",
|
|
843
|
+
"tw:md:w-lg": s === "md",
|
|
844
|
+
"tw:md:w-4xl": s === "lg",
|
|
845
|
+
"tw:md:w-6xl": s === "xl"
|
|
845
846
|
},
|
|
846
847
|
{ "tw:h-full": e === "cover" }
|
|
847
848
|
),
|
|
@@ -849,12 +850,12 @@ const se = ({ currentPage: t, pagesCount: r, ...e }) => {
|
|
|
849
850
|
children: /* @__PURE__ */ n(N, { className: w(
|
|
850
851
|
"tw:w-full",
|
|
851
852
|
{ "tw:h-full tw:relative tw:overflow-auto": e === "cover" }
|
|
852
|
-
), children: e === "cover" ? /* @__PURE__ */ g(
|
|
853
|
+
), children: e === "cover" ? /* @__PURE__ */ g(O, { children: [
|
|
853
854
|
/* @__PURE__ */ g(
|
|
854
855
|
"div",
|
|
855
856
|
{
|
|
856
857
|
className: w(
|
|
857
|
-
"tw:px-4 tw:py-3 tw:absolute tw:top-0 tw:left-0 tw:right-0",
|
|
858
|
+
"tw:px-4 tw:py-3 tw:absolute tw:top-0 tw:left-0 tw:right-0 tw:z-3000",
|
|
858
859
|
"tw:flex tw:items-center tw:justify-between",
|
|
859
860
|
"tw:text-white tw:bg-linear-to-b tw:from-black/70 tw:to-black/10",
|
|
860
861
|
"tw:[text-shadow:_0_2px_4px_rgb(0_0_0/_0.8)]"
|
|
@@ -865,8 +866,8 @@ const se = ({ currentPage: t, pagesCount: r, ...e }) => {
|
|
|
865
866
|
]
|
|
866
867
|
}
|
|
867
868
|
),
|
|
868
|
-
|
|
869
|
-
] }) : /* @__PURE__ */ g(
|
|
869
|
+
a
|
|
870
|
+
] }) : /* @__PURE__ */ g(O, { children: [
|
|
870
871
|
/* @__PURE__ */ g(N.Header, { className: w(
|
|
871
872
|
"tw:sticky tw:top-0",
|
|
872
873
|
"tw:flex tw:items-center tw:justify-between tw:gap-x-2"
|
|
@@ -875,7 +876,7 @@ const se = ({ currentPage: t, pagesCount: r, ...e }) => {
|
|
|
875
876
|
/* @__PURE__ */ n(Q, { onClick: r, label: "Close dialog" })
|
|
876
877
|
] }),
|
|
877
878
|
/* @__PURE__ */ n(N.Body, { children: a }),
|
|
878
|
-
|
|
879
|
+
u && /* @__PURE__ */ g(
|
|
879
880
|
N.Footer,
|
|
880
881
|
{
|
|
881
882
|
"data-testid": "footer",
|
|
@@ -884,15 +885,15 @@ const se = ({ currentPage: t, pagesCount: r, ...e }) => {
|
|
|
884
885
|
"tw:[&]:px-3 tw:sticky tw:bottom-0"
|
|
885
886
|
),
|
|
886
887
|
children: [
|
|
887
|
-
/* @__PURE__ */ n(
|
|
888
|
+
/* @__PURE__ */ n(Ot, { onClick: r, children: c }),
|
|
888
889
|
/* @__PURE__ */ n(
|
|
889
|
-
|
|
890
|
+
_t,
|
|
890
891
|
{
|
|
891
892
|
solid: !0,
|
|
892
893
|
variant: e === "danger" ? "danger" : "primary",
|
|
893
894
|
disabled: m,
|
|
894
895
|
type: "submit",
|
|
895
|
-
children:
|
|
896
|
+
children: i
|
|
896
897
|
}
|
|
897
898
|
)
|
|
898
899
|
]
|
|
@@ -903,16 +904,16 @@ const se = ({ currentPage: t, pagesCount: r, ...e }) => {
|
|
|
903
904
|
)
|
|
904
905
|
}
|
|
905
906
|
);
|
|
906
|
-
},
|
|
907
|
+
}, fe = ({ className: t, children: r, loading: e = !1, variant: o = "default" }) => /* @__PURE__ */ n(It, { className: y({ "tw:[&]:border-danger": o === "error" }, t), children: /* @__PURE__ */ g("h3", { className: y("tw:text-center", {
|
|
907
908
|
"tw:text-gray-500 tw:dark:text-gray-400": o === "default",
|
|
908
909
|
"tw:text-danger": o === "error"
|
|
909
910
|
}), children: [
|
|
910
|
-
e && /* @__PURE__ */ g(
|
|
911
|
+
e && /* @__PURE__ */ g(O, { children: [
|
|
911
912
|
/* @__PURE__ */ n(v, { icon: X, spin: !0 }),
|
|
912
913
|
/* @__PURE__ */ n("span", { className: "tw:ml-2", children: r ?? "Loading..." })
|
|
913
914
|
] }),
|
|
914
915
|
!e && r
|
|
915
|
-
] }) }),
|
|
916
|
+
] }) }), xe = ({ variant: t, className: r, size: e = "md", children: o }) => /* @__PURE__ */ n(
|
|
916
917
|
"div",
|
|
917
918
|
{
|
|
918
919
|
className: y(
|
|
@@ -930,10 +931,93 @@ const se = ({ currentPage: t, pagesCount: r, ...e }) => {
|
|
|
930
931
|
),
|
|
931
932
|
children: o
|
|
932
933
|
}
|
|
933
|
-
),
|
|
934
|
-
const
|
|
935
|
-
|
|
936
|
-
|
|
934
|
+
), ye = ({ placement: t = "auto" } = {}) => {
|
|
935
|
+
const r = I(null), e = (() => {
|
|
936
|
+
const p = [];
|
|
937
|
+
return t === "auto" && p.push(pt()), p.push(ut({ element: r })), p;
|
|
938
|
+
})(), [o, a] = R(!1), { refs: d, floatingStyles: l, context: s, middlewareData: i } = ht({
|
|
939
|
+
placement: t === "auto" ? void 0 : t,
|
|
940
|
+
open: o,
|
|
941
|
+
onOpenChange: a,
|
|
942
|
+
middleware: e
|
|
943
|
+
}), c = ft(s, {
|
|
944
|
+
delay: { open: 300 },
|
|
945
|
+
move: !0
|
|
946
|
+
}), { getFloatingProps: m, getReferenceProps: u } = xt([c]), { isMounted: f, styles: x } = yt(s, { duration: 200 }), b = $(() => {
|
|
947
|
+
const p = s.placement.split("-")[0];
|
|
948
|
+
return {
|
|
949
|
+
top: "bottom",
|
|
950
|
+
right: "left",
|
|
951
|
+
bottom: "top",
|
|
952
|
+
left: "right"
|
|
953
|
+
}[p] ?? "";
|
|
954
|
+
}, [s.placement]);
|
|
955
|
+
return {
|
|
956
|
+
anchor: { ...u(), ref: d.setReference },
|
|
957
|
+
tooltip: {
|
|
958
|
+
...m(),
|
|
959
|
+
refSetter: d.setFloating,
|
|
960
|
+
isMounted: f,
|
|
961
|
+
styles: { ...l, ...x },
|
|
962
|
+
arrowPos: i.arrow,
|
|
963
|
+
arrowRef: r,
|
|
964
|
+
arrowSide: b
|
|
965
|
+
}
|
|
966
|
+
};
|
|
967
|
+
}, ke = ({ children: t, isMounted: r, styles: e, refSetter: o, arrowRef: a, arrowPos: d, arrowSide: l, ...s }) => {
|
|
968
|
+
var i;
|
|
969
|
+
return r && /* @__PURE__ */ n(
|
|
970
|
+
"div",
|
|
971
|
+
{
|
|
972
|
+
role: "tooltip",
|
|
973
|
+
"aria-live": "polite",
|
|
974
|
+
className: y(
|
|
975
|
+
"tw:z-1000 tw:max-w-64",
|
|
976
|
+
// Add space between anchor and tooltip via padding, so that if the tooltip is inside the anchor, you can hover it
|
|
977
|
+
// and it's never closed
|
|
978
|
+
{
|
|
979
|
+
"tw:pt-2.5": l === "top",
|
|
980
|
+
"tw:pb-2.5": l === "bottom",
|
|
981
|
+
"tw:pr-2.5": l === "right",
|
|
982
|
+
"tw:pl-2.5": l === "left"
|
|
983
|
+
}
|
|
984
|
+
),
|
|
985
|
+
ref: o,
|
|
986
|
+
style: e,
|
|
987
|
+
...s,
|
|
988
|
+
children: /* @__PURE__ */ g("div", { className: "tw:relative tw:px-1.5 tw:py-1 tw:rounded tw:bg-black/90 tw:text-white tw:text-center", children: [
|
|
989
|
+
/* @__PURE__ */ n("span", { className: "tw:sr-only", children: "Tooltip: " }),
|
|
990
|
+
t,
|
|
991
|
+
/* @__PURE__ */ n(
|
|
992
|
+
"div",
|
|
993
|
+
{
|
|
994
|
+
ref: a,
|
|
995
|
+
className: y(
|
|
996
|
+
"tw:absolute",
|
|
997
|
+
// Render as a triangle
|
|
998
|
+
"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",
|
|
999
|
+
// Rotate triangle so that it points to the correct direction
|
|
1000
|
+
{
|
|
1001
|
+
"tw:rotate-180": l === "bottom",
|
|
1002
|
+
"tw:rotate-90 tw:mr-[-3px]": l === "right",
|
|
1003
|
+
"tw:rotate-270 tw:ml-[-3px]": l === "left"
|
|
1004
|
+
}
|
|
1005
|
+
),
|
|
1006
|
+
style: {
|
|
1007
|
+
left: d == null ? void 0 : d.x,
|
|
1008
|
+
top: d == null ? void 0 : d.y,
|
|
1009
|
+
[l]: `${-(((i = a.current) == null ? void 0 : i.offsetWidth) ?? 0) / 2}px`
|
|
1010
|
+
},
|
|
1011
|
+
"data-testid": "arrow"
|
|
1012
|
+
}
|
|
1013
|
+
)
|
|
1014
|
+
] })
|
|
1015
|
+
}
|
|
1016
|
+
);
|
|
1017
|
+
}, ve = ({ text: t, className: r, size: e = "lg", initialCopied: o = !1, navigator_: a = globalThis.navigator, ...d }) => {
|
|
1018
|
+
const [l, s] = bt(o), i = T(
|
|
1019
|
+
() => a.clipboard.writeText(t).then(s),
|
|
1020
|
+
[a.clipboard, t, s]
|
|
937
1021
|
);
|
|
938
1022
|
return /* @__PURE__ */ n(
|
|
939
1023
|
"button",
|
|
@@ -950,44 +1034,46 @@ const se = ({ currentPage: t, pagesCount: r, ...e }) => {
|
|
|
950
1034
|
),
|
|
951
1035
|
"aria-label": `Copy ${t} to clipboard`,
|
|
952
1036
|
title: "Copy to clipboard",
|
|
953
|
-
onClick:
|
|
954
|
-
...
|
|
955
|
-
children: /* @__PURE__ */ n(v, { icon:
|
|
1037
|
+
onClick: i,
|
|
1038
|
+
...d,
|
|
1039
|
+
children: /* @__PURE__ */ n(v, { icon: l ? wt : kt, fixedWidth: !0 })
|
|
956
1040
|
}
|
|
957
1041
|
);
|
|
958
1042
|
};
|
|
959
1043
|
export {
|
|
960
|
-
|
|
1044
|
+
_t as Button,
|
|
961
1045
|
N as Card,
|
|
962
|
-
|
|
963
|
-
|
|
1046
|
+
he as CardModal,
|
|
1047
|
+
se as Checkbox,
|
|
964
1048
|
Q as CloseButton,
|
|
965
|
-
|
|
966
|
-
|
|
1049
|
+
ve as CopyToClipboardButton,
|
|
1050
|
+
le as Details,
|
|
967
1051
|
_ as ELLIPSIS,
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
1052
|
+
W as Input,
|
|
1053
|
+
U as Label,
|
|
1054
|
+
ie as LabelledInput,
|
|
1055
|
+
we as LabelledRevealablePasswordInput,
|
|
1056
|
+
ce as LabelledSelect,
|
|
1057
|
+
Ot as LinkButton,
|
|
1058
|
+
Pt as Listbox,
|
|
1059
|
+
fe as Message,
|
|
1060
|
+
Qt as ModalDialog,
|
|
1061
|
+
ge as NavPills,
|
|
1062
|
+
ue as Paginator,
|
|
1063
|
+
xe as Result,
|
|
1064
|
+
Dt as RevealablePasswordInput,
|
|
1065
|
+
me as SearchCombobox,
|
|
1066
|
+
Ht as SearchInput,
|
|
1067
|
+
$t as Select,
|
|
1068
|
+
It as SimpleCard,
|
|
1069
|
+
de as Table,
|
|
1070
|
+
be as ToggleSwitch,
|
|
1071
|
+
ke as Tooltip,
|
|
1072
|
+
Wt as formatNumber,
|
|
1073
|
+
qt as keyForPage,
|
|
989
1074
|
B as pageIsEllipsis,
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
1075
|
+
zt as prettifyPageNumber,
|
|
1076
|
+
Kt as progressivePagination,
|
|
1077
|
+
pe as roundTen,
|
|
1078
|
+
ye as useTooltip
|
|
993
1079
|
};
|