@shlinkio/shlink-frontend-kit 0.9.7 → 0.9.9
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 +40 -4
- package/dist/index.js +167 -188
- package/dist/ordering-B_hekQuu.js +96 -0
- package/dist/tailwind.d.ts +966 -3
- package/dist/tailwind.js +784 -462
- package/dist/tailwind.preset.css +2 -2
- package/package.json +8 -7
- package/dist/use-toggle-C1uZwbSD.js +0 -32
package/dist/tailwind.js
CHANGED
|
@@ -1,84 +1,86 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import w, { clsx as
|
|
3
|
-
import { useRef as
|
|
4
|
-
import { Link as
|
|
5
|
-
import { faClose as
|
|
1
|
+
import { jsxs as p, jsx as n, Fragment as _ } from "react/jsx-runtime";
|
|
2
|
+
import w, { clsx as f } from "clsx";
|
|
3
|
+
import { useRef as T, useState as R, useEffect as B, forwardRef as y, useCallback as P, createContext as q, useContext as O, useId as $, useMemo as W } from "react";
|
|
4
|
+
import { Link as G, NavLink as mt } from "react-router";
|
|
5
|
+
import { faClose as pt, faEyeSlash as bt, faEye as gt, faCircleNotch as nt, faSearch as ut, faCaretDown as ht, faChevronLeft as V, faChevronRight as tt, faEllipsisV as ft, faSortAmountUp as xt, faSortAmountDown as yt, faCheck as kt } from "@fortawesome/free-solid-svg-icons";
|
|
6
6
|
import { FontAwesomeIcon as v } from "@fortawesome/react-fontawesome";
|
|
7
|
-
import { u as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
import { u as vt, b as Nt, a as Ct, e as Tt, c as It } from "./ordering-B_hekQuu.js";
|
|
8
|
+
import { useFloating as ot, flip as Pt, offset as Ot, useClick as Dt, useInteractions as at, autoPlacement as Lt, arrow as Mt, useHover as Bt, useTransitionStyles as Rt } from "@floating-ui/react";
|
|
9
|
+
import { createPortal as Ft } from "react-dom";
|
|
10
|
+
import "reactstrap";
|
|
11
|
+
import { faClone as Et } from "@fortawesome/free-regular-svg-icons";
|
|
12
|
+
const Oe = ({ children: r, summary: e, summaryClasses: t, ...o }) => {
|
|
13
|
+
const a = T(null), [l, d] = R(!1);
|
|
14
|
+
return B(() => {
|
|
13
15
|
const i = a.current, s = () => d(!!(i != null && i.open));
|
|
14
16
|
return i == null || i.addEventListener("toggle", s), () => i == null ? void 0 : i.removeEventListener("toggle", s);
|
|
15
|
-
}, []), /* @__PURE__ */
|
|
16
|
-
/* @__PURE__ */ n("summary", { className:
|
|
17
|
-
l && /* @__PURE__ */ n("div", { className: "tw:mt-3 tw:flex tw:flex-col tw:gap-y-3", children:
|
|
17
|
+
}, []), /* @__PURE__ */ p("details", { ref: a, ...o, children: [
|
|
18
|
+
/* @__PURE__ */ n("summary", { className: f("tw:focus-ring tw:px-1 tw:-mx-1 tw:rounded-sm", t), children: e }),
|
|
19
|
+
l && /* @__PURE__ */ n("div", { className: "tw:mt-3 tw:flex tw:flex-col tw:gap-y-3", children: r })
|
|
18
20
|
] });
|
|
19
|
-
},
|
|
21
|
+
}, St = y(({ className: r, ...e }, t) => /* @__PURE__ */ n(
|
|
20
22
|
"div",
|
|
21
23
|
{
|
|
22
24
|
className: w(
|
|
23
25
|
"tw:px-4 tw:py-3 tw:rounded-t-md",
|
|
24
26
|
"tw:bg-lm-primary tw:dark:bg-dm-primary tw:border-b tw:border-lm-border tw:dark:border-dm-border",
|
|
25
|
-
|
|
27
|
+
r
|
|
26
28
|
),
|
|
27
|
-
...
|
|
28
|
-
ref:
|
|
29
|
+
...e,
|
|
30
|
+
ref: t
|
|
29
31
|
}
|
|
30
|
-
)),
|
|
32
|
+
)), jt = y(({ className: r, ...e }, t) => /* @__PURE__ */ n(
|
|
31
33
|
"div",
|
|
32
34
|
{
|
|
33
35
|
className: w(
|
|
34
36
|
"tw:p-4 tw:bg-lm-primary tw:dark:bg-dm-primary tw:first:rounded-t-md",
|
|
35
37
|
"tw:first:rounded-t-md tw:last:rounded-b-md",
|
|
36
|
-
|
|
38
|
+
r
|
|
37
39
|
),
|
|
38
|
-
...
|
|
39
|
-
ref:
|
|
40
|
+
...e,
|
|
41
|
+
ref: t
|
|
40
42
|
}
|
|
41
|
-
)),
|
|
43
|
+
)), At = y(({ className: r, ...e }, t) => /* @__PURE__ */ n(
|
|
42
44
|
"div",
|
|
43
45
|
{
|
|
44
46
|
className: w(
|
|
45
47
|
"tw:px-4 tw:py-3 tw:rounded-b-md",
|
|
46
48
|
"tw:bg-lm-primary tw:dark:bg-dm-primary tw:border-t tw:border-lm-border tw:dark:border-dm-border",
|
|
47
|
-
|
|
49
|
+
r
|
|
48
50
|
),
|
|
49
|
-
...
|
|
50
|
-
ref:
|
|
51
|
+
...e,
|
|
52
|
+
ref: t
|
|
51
53
|
}
|
|
52
|
-
)),
|
|
54
|
+
)), _t = y(({ className: r, ...e }, t) => /* @__PURE__ */ n(
|
|
53
55
|
"div",
|
|
54
56
|
{
|
|
55
57
|
className: w(
|
|
56
58
|
"tw:group/card tw:rounded-md tw:shadow-md",
|
|
57
59
|
"tw:border tw:border-lm-border tw:dark:border-dm-border tw:bg-lm-primary tw:dark:bg-dm-primary",
|
|
58
|
-
|
|
60
|
+
r
|
|
59
61
|
),
|
|
60
|
-
...r,
|
|
61
|
-
ref: e
|
|
62
|
-
}
|
|
63
|
-
)), N = Object.assign(xt, { Body: ht, Header: pt, Footer: ft }), yt = u(({ bodyClassName: t, children: r, ...e }, o) => {
|
|
64
|
-
const { title: a, titleSize: l = "md", ...d } = "title" in e ? e : {
|
|
65
62
|
...e,
|
|
63
|
+
ref: t
|
|
64
|
+
}
|
|
65
|
+
)), C = Object.assign(_t, { Body: jt, Header: St, Footer: At }), $t = y(({ bodyClassName: r, children: e, ...t }, o) => {
|
|
66
|
+
const { title: a, titleSize: l = "md", ...d } = "title" in t ? t : {
|
|
67
|
+
...t,
|
|
66
68
|
title: void 0,
|
|
67
69
|
titleSize: void 0
|
|
68
70
|
};
|
|
69
|
-
return /* @__PURE__ */
|
|
70
|
-
a && /* @__PURE__ */
|
|
71
|
+
return /* @__PURE__ */ p(C, { ...d, ref: o, children: [
|
|
72
|
+
a && /* @__PURE__ */ p(C.Header, { children: [
|
|
71
73
|
l === "lg" && /* @__PURE__ */ n("h4", { children: a }),
|
|
72
74
|
l === "md" && /* @__PURE__ */ n("h5", { children: a }),
|
|
73
75
|
l === "sm" && /* @__PURE__ */ n("h6", { children: a })
|
|
74
76
|
] }),
|
|
75
|
-
/* @__PURE__ */ n(
|
|
77
|
+
/* @__PURE__ */ n(C.Body, { className: r, children: e })
|
|
76
78
|
] });
|
|
77
79
|
});
|
|
78
|
-
function
|
|
79
|
-
id:
|
|
80
|
-
items:
|
|
81
|
-
onSelectItem:
|
|
80
|
+
function Ht({
|
|
81
|
+
id: r,
|
|
82
|
+
items: e,
|
|
83
|
+
onSelectItem: t,
|
|
82
84
|
onActiveItemChange: o,
|
|
83
85
|
renderItem: a,
|
|
84
86
|
className: l,
|
|
@@ -87,45 +89,45 @@ function kt({
|
|
|
87
89
|
"aria-label": s = "Items",
|
|
88
90
|
...c
|
|
89
91
|
}) {
|
|
90
|
-
const [m,
|
|
91
|
-
if (
|
|
92
|
-
const [b,
|
|
93
|
-
o(b,
|
|
92
|
+
const [m, g] = R(0), u = P((x) => {
|
|
93
|
+
if (g(x), o) {
|
|
94
|
+
const [b, h] = [...e.entries()][x];
|
|
95
|
+
o(b, h);
|
|
94
96
|
}
|
|
95
|
-
}, [
|
|
96
|
-
return
|
|
97
|
+
}, [e, o]);
|
|
98
|
+
return B(() => {
|
|
97
99
|
const x = i == null ? void 0 : i.current;
|
|
98
100
|
if (!x)
|
|
99
101
|
return;
|
|
100
|
-
const b = (
|
|
101
|
-
["Enter", "ArrowUp", "ArrowDown"].includes(
|
|
102
|
+
const b = (h) => {
|
|
103
|
+
["Enter", "ArrowUp", "ArrowDown"].includes(h.key) && h.preventDefault(), h.key === "ArrowDown" ? u(Math.min(m + 1, e.size - 1)) : h.key === "ArrowUp" ? u(Math.max(m - 1, 0)) : h.key === "Enter" && t([...e.values()][m]);
|
|
102
104
|
};
|
|
103
105
|
return x.addEventListener("keydown", b), () => x.removeEventListener("keydown", b);
|
|
104
|
-
}, [m, i,
|
|
105
|
-
|
|
106
|
+
}, [m, i, u, e, t]), /* @__PURE__ */ p(
|
|
107
|
+
C,
|
|
106
108
|
{
|
|
107
|
-
id:
|
|
109
|
+
id: r,
|
|
108
110
|
className: w("tw:py-1 tw:flex tw:flex-col", l),
|
|
109
111
|
role: "listbox",
|
|
110
112
|
"aria-orientation": "vertical",
|
|
111
113
|
"aria-label": s,
|
|
112
114
|
...c,
|
|
113
115
|
children: [
|
|
114
|
-
|
|
115
|
-
[...
|
|
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: d }),
|
|
117
|
+
[...e.entries()].map(([x, b], h) => /* @__PURE__ */ n(
|
|
116
118
|
"button",
|
|
117
119
|
{
|
|
118
|
-
id: `${
|
|
120
|
+
id: `${r}_${x}`,
|
|
119
121
|
type: "button",
|
|
120
122
|
role: "option",
|
|
121
|
-
"aria-selected":
|
|
123
|
+
"aria-selected": h === m,
|
|
122
124
|
className: w(
|
|
123
125
|
"tw:px-2 tw:py-1 tw:text-left tw:truncate",
|
|
124
|
-
{ "tw:bg-lm-secondary tw:dark:bg-dm-secondary":
|
|
126
|
+
{ "tw:bg-lm-secondary tw:dark:bg-dm-secondary": h === m }
|
|
125
127
|
),
|
|
126
128
|
tabIndex: -1,
|
|
127
|
-
onClick: () =>
|
|
128
|
-
onMouseOver: () => h
|
|
129
|
+
onClick: () => t(b),
|
|
130
|
+
onMouseOver: () => u(h),
|
|
129
131
|
children: a(b)
|
|
130
132
|
},
|
|
131
133
|
x
|
|
@@ -134,44 +136,44 @@ function kt({
|
|
|
134
136
|
}
|
|
135
137
|
);
|
|
136
138
|
}
|
|
137
|
-
const
|
|
138
|
-
const { responsive:
|
|
139
|
-
return /* @__PURE__ */ n(
|
|
139
|
+
const H = q(void 0), F = q({ responsive: !0, size: "md" }), Ut = ({ children: r, className: e }) => {
|
|
140
|
+
const { responsive: t } = O(F);
|
|
141
|
+
return /* @__PURE__ */ n(H.Provider, { value: { section: "head" }, children: /* @__PURE__ */ n(
|
|
140
142
|
"thead",
|
|
141
143
|
{
|
|
142
144
|
className: w(
|
|
143
|
-
{ "tw:hidden tw:lg:table-header-group":
|
|
144
|
-
|
|
145
|
+
{ "tw:hidden tw:lg:table-header-group": t },
|
|
146
|
+
e
|
|
145
147
|
),
|
|
146
|
-
children:
|
|
148
|
+
children: r
|
|
147
149
|
}
|
|
148
150
|
) });
|
|
149
|
-
},
|
|
150
|
-
const { responsive:
|
|
151
|
-
return /* @__PURE__ */ n(
|
|
151
|
+
}, Wt = ({ children: r, className: e }) => {
|
|
152
|
+
const { responsive: t } = O(F);
|
|
153
|
+
return /* @__PURE__ */ n(H.Provider, { value: { section: "body" }, children: /* @__PURE__ */ n(
|
|
152
154
|
"tbody",
|
|
153
155
|
{
|
|
154
156
|
className: w(
|
|
155
|
-
{ "tw:lg:table-row-group tw:flex tw:flex-col tw:gap-y-3":
|
|
156
|
-
|
|
157
|
+
{ "tw:lg:table-row-group tw:flex tw:flex-col tw:gap-y-3": t },
|
|
158
|
+
e
|
|
157
159
|
),
|
|
158
|
-
children:
|
|
160
|
+
children: r
|
|
159
161
|
}
|
|
160
162
|
) });
|
|
161
|
-
},
|
|
162
|
-
const { responsive:
|
|
163
|
-
return /* @__PURE__ */ n(
|
|
163
|
+
}, Kt = ({ children: r, className: e }) => {
|
|
164
|
+
const { responsive: t } = O(F);
|
|
165
|
+
return /* @__PURE__ */ n(H.Provider, { value: { section: "footer" }, children: /* @__PURE__ */ n(
|
|
164
166
|
"tfoot",
|
|
165
167
|
{
|
|
166
168
|
className: w(
|
|
167
|
-
{ "tw:lg:table-row-group tw:flex tw:flex-col tw:gap-y-3 tw:mt-4":
|
|
168
|
-
|
|
169
|
+
{ "tw:lg:table-row-group tw:flex tw:flex-col tw:gap-y-3 tw:mt-4": t },
|
|
170
|
+
e
|
|
169
171
|
),
|
|
170
|
-
children:
|
|
172
|
+
children: r
|
|
171
173
|
}
|
|
172
174
|
) });
|
|
173
|
-
},
|
|
174
|
-
const o =
|
|
175
|
+
}, zt = ({ children: r, className: e, ...t }) => {
|
|
176
|
+
const o = O(H), a = (o == null ? void 0 : o.section) === "body", { responsive: l } = O(F);
|
|
175
177
|
return /* @__PURE__ */ n(
|
|
176
178
|
"tr",
|
|
177
179
|
{
|
|
@@ -184,18 +186,18 @@ const E = H(void 0), L = H({ responsive: !0, size: "md" }), vt = ({ children: t,
|
|
|
184
186
|
// Use a different hover bg color depending on the table being inside a card or not
|
|
185
187
|
"tw:group-[&]/card:hover:bg-lm-secondary tw:dark:group-[&]/card:hover:bg-dm-secondary": a
|
|
186
188
|
},
|
|
187
|
-
|
|
189
|
+
e
|
|
188
190
|
),
|
|
189
|
-
...
|
|
190
|
-
children:
|
|
191
|
+
...t,
|
|
192
|
+
children: r
|
|
191
193
|
}
|
|
192
194
|
);
|
|
193
|
-
},
|
|
194
|
-
const l =
|
|
195
|
+
}, qt = ({ children: r, className: e, columnName: t, type: o, ...a }) => {
|
|
196
|
+
const l = O(H), d = o ?? ((l == null ? void 0 : l.section) !== "body" ? "th" : "td"), { responsive: i, size: s } = O(F);
|
|
195
197
|
return /* @__PURE__ */ n(
|
|
196
198
|
d,
|
|
197
199
|
{
|
|
198
|
-
"data-column": i ?
|
|
200
|
+
"data-column": i ? t : void 0,
|
|
199
201
|
className: w(
|
|
200
202
|
"tw:border-lm-border tw:dark:border-dm-border",
|
|
201
203
|
{
|
|
@@ -207,222 +209,215 @@ const E = H(void 0), L = H({ responsive: !0, size: "md" }), vt = ({ children: t,
|
|
|
207
209
|
// For responsive tables, display the content in data-column attribute for md sizes and lower
|
|
208
210
|
"tw:before:lg:hidden tw:before:content-[attr(data-column)] tw:before:font-bold tw:before:mr-1": i && d === "td"
|
|
209
211
|
},
|
|
210
|
-
|
|
212
|
+
e
|
|
211
213
|
),
|
|
212
214
|
...a,
|
|
213
|
-
children:
|
|
215
|
+
children: r
|
|
214
216
|
}
|
|
215
217
|
);
|
|
216
|
-
},
|
|
217
|
-
/* @__PURE__ */ n(
|
|
218
|
-
/* @__PURE__ */ n(
|
|
219
|
-
|
|
220
|
-
] }) }),
|
|
221
|
-
children: t,
|
|
218
|
+
}, Gt = ({ header: r, footer: e, children: t, responsive: o = !0, size: a = "md", ...l }) => /* @__PURE__ */ n(F.Provider, { value: { responsive: o, size: a }, children: /* @__PURE__ */ p("table", { className: "tw:w-full", ...l, children: [
|
|
219
|
+
/* @__PURE__ */ n(Ut, { children: r }),
|
|
220
|
+
/* @__PURE__ */ n(Wt, { children: t }),
|
|
221
|
+
e && /* @__PURE__ */ n(Kt, { children: e })
|
|
222
|
+
] }) }), De = Object.assign(Gt, { Row: zt, Cell: qt }), Jt = y(({
|
|
222
223
|
className: r,
|
|
223
224
|
disabled: e,
|
|
224
|
-
variant:
|
|
225
|
-
size:
|
|
226
|
-
inline:
|
|
227
|
-
solid:
|
|
228
|
-
type:
|
|
229
|
-
...
|
|
230
|
-
}) => {
|
|
231
|
-
const c = "to" in
|
|
232
|
-
return (
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
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
|
-
)
|
|
225
|
+
variant: t = "primary",
|
|
226
|
+
size: o = "md",
|
|
227
|
+
inline: a = !1,
|
|
228
|
+
solid: l = !1,
|
|
229
|
+
type: d = "button",
|
|
230
|
+
...i
|
|
231
|
+
}, s) => {
|
|
232
|
+
const c = "to" in i, m = c ? G : "button", g = c ? void 0 : d;
|
|
233
|
+
return /* @__PURE__ */ n(
|
|
234
|
+
m,
|
|
235
|
+
{
|
|
236
|
+
ref: s,
|
|
237
|
+
className: w(
|
|
238
|
+
{
|
|
239
|
+
"tw:inline-flex": a,
|
|
240
|
+
"tw:flex": !a
|
|
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": t === "primary",
|
|
247
|
+
"tw:focus-ring-secondary": t === "secondary",
|
|
248
|
+
"tw:focus-ring-danger": t === "danger"
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
"tw:px-1.5 tw:py-1 tw:text-sm": o === "sm",
|
|
252
|
+
"tw:px-3 tw:py-1.5": o === "md",
|
|
253
|
+
"tw:px-4 tw:py-2 tw:text-lg": o === "lg"
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
"tw:border-lm-brand tw:dark:border-dm-brand": t === "primary",
|
|
257
|
+
"tw:text-lm-brand tw:dark:text-dm-brand": t === "primary" && !l,
|
|
258
|
+
"tw:border-zinc-500": t === "secondary",
|
|
259
|
+
"tw:text-zinc-500": t === "secondary" && !l,
|
|
260
|
+
"tw:border-danger": t === "danger",
|
|
261
|
+
"tw:text-danger": t === "danger" && !l
|
|
262
|
+
},
|
|
263
|
+
l && {
|
|
264
|
+
"tw:text-white": !0,
|
|
265
|
+
"tw:bg-lm-brand tw:dark:bg-dm-brand": t === "primary",
|
|
266
|
+
"tw:highlight:bg-lm-brand-dark tw:dark:highlight:bg-dm-brand-dark": t === "primary",
|
|
267
|
+
"tw:highlight:border-lm-brand-dark tw:dark:highlight:border-dm-brand-dark": t === "primary",
|
|
268
|
+
"tw:bg-zinc-500": t === "secondary",
|
|
269
|
+
"tw:highlight:bg-zinc-600 tw:highlight:border-zinc-600": t === "secondary",
|
|
270
|
+
"tw:bg-danger": t === "danger",
|
|
271
|
+
"tw:highlight:bg-danger-dark tw:highlight:border-danger-dark": t === "danger"
|
|
272
|
+
},
|
|
273
|
+
!e && {
|
|
274
|
+
"tw:highlight:text-white": !l,
|
|
275
|
+
"tw:highlight:bg-lm-brand tw:dark:highlight:bg-dm-brand": t === "primary",
|
|
276
|
+
"tw:highlight:bg-zinc-500": t === "secondary",
|
|
277
|
+
"tw:highlight:bg-danger": t === "danger"
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
"tw:pointer-events-none tw:opacity-65": e
|
|
281
|
+
},
|
|
282
|
+
r
|
|
283
|
+
),
|
|
284
|
+
disabled: c ? void 0 : e,
|
|
285
|
+
"aria-disabled": c ? e : void 0,
|
|
286
|
+
type: g,
|
|
287
|
+
...i
|
|
288
|
+
}
|
|
290
289
|
);
|
|
291
|
-
},
|
|
292
|
-
const a = P((l) =>
|
|
290
|
+
}), lt = y(({ className: r, onChange: e, ...t }, o) => {
|
|
291
|
+
const a = P((l) => e == null ? void 0 : e(l.target.checked, l), [e]);
|
|
293
292
|
return /* @__PURE__ */ n(
|
|
294
293
|
"input",
|
|
295
294
|
{
|
|
296
295
|
ref: o,
|
|
297
296
|
type: "checkbox",
|
|
298
|
-
className:
|
|
297
|
+
className: f(
|
|
299
298
|
"tw:appearance-none tw:focus-ring tw:cursor-[inherit]",
|
|
300
299
|
"tw:border-1 tw:border-lm-input-border tw:dark:border-dm-input-border",
|
|
301
300
|
"tw:bg-lm-primary tw:dark:bg-dm-primary tw:checked:bg-lm-brand tw:dark:checked:bg-dm-brand tw:bg-no-repeat",
|
|
302
301
|
// Use different background color when rendered inside a card
|
|
303
302
|
"tw:group-[&]/card:bg-lm-input tw:group-[&]/card:dark:bg-dm-input",
|
|
304
|
-
|
|
303
|
+
r
|
|
305
304
|
),
|
|
306
305
|
onChange: a,
|
|
307
|
-
...
|
|
306
|
+
...t
|
|
308
307
|
}
|
|
309
308
|
);
|
|
310
|
-
}),
|
|
311
|
-
|
|
309
|
+
}), Le = y(({ className: r, ...e }, t) => /* @__PURE__ */ n(
|
|
310
|
+
lt,
|
|
312
311
|
{
|
|
313
|
-
ref:
|
|
314
|
-
className:
|
|
315
|
-
...
|
|
312
|
+
ref: t,
|
|
313
|
+
className: f("tw:rounded-sm tw:w-4 tw:h-4 tw:checked:bg-(image:--tick) tw:bg-center", r),
|
|
314
|
+
...e
|
|
316
315
|
}
|
|
317
|
-
)),
|
|
316
|
+
)), et = y(({ onClick: r, className: e, label: t = "Close" }, o) => /* @__PURE__ */ n(
|
|
318
317
|
"button",
|
|
319
318
|
{
|
|
319
|
+
ref: o,
|
|
320
320
|
type: "button",
|
|
321
|
-
onClick:
|
|
321
|
+
onClick: r,
|
|
322
322
|
className: w(
|
|
323
323
|
"tw:opacity-50 tw:highlight:opacity-80 tw:transition-opacity",
|
|
324
324
|
"tw:rounded-md tw:focus-ring",
|
|
325
|
-
|
|
325
|
+
e
|
|
326
326
|
),
|
|
327
|
-
"aria-label":
|
|
328
|
-
children: /* @__PURE__ */ n(v, { icon:
|
|
327
|
+
"aria-label": t,
|
|
328
|
+
children: /* @__PURE__ */ n(v, { icon: pt, size: "xl" })
|
|
329
329
|
}
|
|
330
|
-
),
|
|
331
|
-
borderless:
|
|
332
|
-
size:
|
|
333
|
-
feedback:
|
|
330
|
+
)), J = y(({
|
|
331
|
+
borderless: r = !1,
|
|
332
|
+
size: e = "md",
|
|
333
|
+
feedback: t,
|
|
334
334
|
className: o,
|
|
335
335
|
disabled: a,
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
"tw:
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
);
|
|
371
|
-
}), W = ({ required: t, children: r, className: e, ...o }) => /* @__PURE__ */ g("label", { className: y("tw:cursor-pointer", e), ...o, children: [
|
|
336
|
+
...l
|
|
337
|
+
}, d) => /* @__PURE__ */ n(
|
|
338
|
+
"input",
|
|
339
|
+
{
|
|
340
|
+
ref: d,
|
|
341
|
+
className: w(
|
|
342
|
+
"tw:w-full",
|
|
343
|
+
{
|
|
344
|
+
"tw:focus-ring": !t,
|
|
345
|
+
"tw:focus-ring-danger": t === "error"
|
|
346
|
+
},
|
|
347
|
+
{
|
|
348
|
+
"tw:px-2 tw:py-1 tw:text-sm": e === "sm",
|
|
349
|
+
"tw:px-3 tw:py-1.5": e === "md",
|
|
350
|
+
"tw:px-4 tw:py-2 tw:text-xl": e === "lg"
|
|
351
|
+
},
|
|
352
|
+
{
|
|
353
|
+
"tw:rounded-md tw:border": !r,
|
|
354
|
+
"tw:border-lm-input-border tw:dark:border-dm-input-border": !r && !t,
|
|
355
|
+
"tw:border-danger": !r && t === "error",
|
|
356
|
+
"tw:bg-lm-disabled-input tw:dark:bg-dm-disabled-input": a,
|
|
357
|
+
"tw:bg-lm-primary tw:dark:bg-dm-primary": !a,
|
|
358
|
+
// Use different background color when rendered inside a card
|
|
359
|
+
"tw:group-[&]/card:bg-lm-input tw:group-[&]/card:dark:bg-dm-input": !a
|
|
360
|
+
},
|
|
361
|
+
o
|
|
362
|
+
),
|
|
363
|
+
disabled: a,
|
|
364
|
+
...l
|
|
365
|
+
}
|
|
366
|
+
)), Q = ({ required: r, children: e, className: t, ...o }) => /* @__PURE__ */ p("label", { className: f("tw:cursor-pointer", t), ...o, children: [
|
|
367
|
+
e,
|
|
368
|
+
r && /* @__PURE__ */ n("span", { className: "tw:text-danger tw:ml-1", "data-testid": "required-indicator", children: "*" })
|
|
369
|
+
] }), X = ({ children: r, helpText: e, error: t, "data-testid": o }) => /* @__PURE__ */ p("div", { className: "tw:flex tw:flex-col tw:gap-1", "data-testid": o, children: [
|
|
372
370
|
r,
|
|
373
|
-
|
|
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: [
|
|
375
|
-
t,
|
|
376
|
-
r && /* @__PURE__ */ n(
|
|
371
|
+
e && /* @__PURE__ */ n(
|
|
377
372
|
"small",
|
|
378
373
|
{
|
|
379
374
|
"data-testid": o ? `${o}-help-text` : "help-text",
|
|
380
375
|
className: "tw:text-gray-500 tw:dark:text-gray-400",
|
|
381
|
-
children:
|
|
376
|
+
children: e
|
|
382
377
|
}
|
|
383
378
|
),
|
|
384
|
-
|
|
385
|
-
] }),
|
|
386
|
-
const c =
|
|
387
|
-
return /* @__PURE__ */
|
|
388
|
-
/* @__PURE__ */ n(
|
|
379
|
+
t && /* @__PURE__ */ n("span", { "data-testid": o ? `${o}-error` : "error", className: "tw:text-danger", children: t })
|
|
380
|
+
] }), Me = y(({ label: r, inputClassName: e, required: t, hiddenRequired: o, error: a, helpText: l, "data-testid": d, ...i }, s) => {
|
|
381
|
+
const c = $();
|
|
382
|
+
return /* @__PURE__ */ p(X, { error: a, helpText: l, "data-testid": d, children: [
|
|
383
|
+
/* @__PURE__ */ n(Q, { htmlFor: c, required: t, children: r }),
|
|
389
384
|
/* @__PURE__ */ n(
|
|
390
|
-
|
|
385
|
+
J,
|
|
391
386
|
{
|
|
392
387
|
ref: s,
|
|
393
388
|
id: c,
|
|
394
|
-
className:
|
|
395
|
-
required:
|
|
389
|
+
className: e,
|
|
390
|
+
required: t || o,
|
|
396
391
|
feedback: a ? "error" : void 0,
|
|
397
392
|
...i
|
|
398
393
|
}
|
|
399
394
|
)
|
|
400
395
|
] });
|
|
401
|
-
}),
|
|
402
|
-
const [l, d, , i] =
|
|
403
|
-
var
|
|
404
|
-
(
|
|
396
|
+
}), Qt = y(({ containerClassName: r, className: e, size: t, ...o }, a) => {
|
|
397
|
+
const [l, d, , i] = vt(!1), s = T(null), c = P(({ relatedTarget: m }) => {
|
|
398
|
+
var g;
|
|
399
|
+
(g = s.current) != null && g.contains(m) || i();
|
|
405
400
|
}, [s, i]);
|
|
406
|
-
return /* @__PURE__ */
|
|
401
|
+
return /* @__PURE__ */ p(
|
|
407
402
|
"div",
|
|
408
403
|
{
|
|
409
|
-
className:
|
|
404
|
+
className: f("tw:group tw:relative", r),
|
|
410
405
|
ref: s,
|
|
411
406
|
onBlurCapture: c,
|
|
412
407
|
children: [
|
|
413
408
|
/* @__PURE__ */ n(
|
|
414
|
-
|
|
409
|
+
J,
|
|
415
410
|
{
|
|
416
411
|
ref: a,
|
|
417
412
|
type: l ? "text" : "password",
|
|
418
|
-
className:
|
|
413
|
+
className: f(
|
|
419
414
|
{
|
|
420
|
-
"tw:pr-10":
|
|
421
|
-
"tw:pr-8":
|
|
415
|
+
"tw:pr-10": t !== "sm",
|
|
416
|
+
"tw:pr-8": t === "sm"
|
|
422
417
|
},
|
|
423
|
-
|
|
418
|
+
e
|
|
424
419
|
),
|
|
425
|
-
size:
|
|
420
|
+
size: t,
|
|
426
421
|
"data-testid": "input",
|
|
427
422
|
...o
|
|
428
423
|
}
|
|
@@ -434,41 +429,41 @@ const E = H(void 0), L = H({ responsive: !0, size: "md" }), vt = ({ children: t,
|
|
|
434
429
|
onClick: d,
|
|
435
430
|
title: l ? "Hide password" : "Show password",
|
|
436
431
|
"aria-label": l ? "Hide password" : "Show password",
|
|
437
|
-
className:
|
|
432
|
+
className: f(
|
|
438
433
|
"tw:absolute tw:top-[50%] tw:translate-y-[-50%] tw:px-1",
|
|
439
434
|
"tw:text-placeholder tw:hover:text-lm-text tw:hover:dark:text-dm-text tw:transition-colors",
|
|
440
435
|
{
|
|
441
|
-
"tw:right-1.5":
|
|
442
|
-
"tw:scale-85 tw:right-1":
|
|
436
|
+
"tw:right-1.5": t !== "sm",
|
|
437
|
+
"tw:scale-85 tw:right-1": t === "sm"
|
|
443
438
|
}
|
|
444
439
|
),
|
|
445
440
|
tabIndex: -1,
|
|
446
|
-
children: /* @__PURE__ */ n(v, { fixedWidth: !0, icon: l ?
|
|
441
|
+
children: /* @__PURE__ */ n(v, { fixedWidth: !0, icon: l ? bt : gt })
|
|
447
442
|
}
|
|
448
443
|
)
|
|
449
444
|
]
|
|
450
445
|
}
|
|
451
446
|
);
|
|
452
|
-
}),
|
|
453
|
-
const c =
|
|
454
|
-
return /* @__PURE__ */
|
|
455
|
-
/* @__PURE__ */ n(
|
|
447
|
+
}), Be = y(({ label: r, inputClassName: e, required: t, hiddenRequired: o, error: a, helpText: l, "data-testid": d, ...i }, s) => {
|
|
448
|
+
const c = $();
|
|
449
|
+
return /* @__PURE__ */ p(X, { error: a, helpText: l, "data-testid": d, children: [
|
|
450
|
+
/* @__PURE__ */ n(Q, { htmlFor: c, required: t, children: r }),
|
|
456
451
|
/* @__PURE__ */ n(
|
|
457
|
-
|
|
452
|
+
Qt,
|
|
458
453
|
{
|
|
459
454
|
ref: s,
|
|
460
455
|
id: c,
|
|
461
|
-
className:
|
|
462
|
-
required:
|
|
456
|
+
className: e,
|
|
457
|
+
required: t || o,
|
|
463
458
|
feedback: a ? "error" : void 0,
|
|
464
459
|
...i
|
|
465
460
|
}
|
|
466
461
|
)
|
|
467
462
|
] });
|
|
468
|
-
}),
|
|
469
|
-
className:
|
|
470
|
-
size:
|
|
471
|
-
feedback:
|
|
463
|
+
}), Xt = y(({
|
|
464
|
+
className: r,
|
|
465
|
+
size: e = "md",
|
|
466
|
+
feedback: t,
|
|
472
467
|
style: o = {},
|
|
473
468
|
disabled: a,
|
|
474
469
|
...l
|
|
@@ -480,23 +475,23 @@ const E = H(void 0), L = H({ responsive: !0, size: "md" }), vt = ({ children: t,
|
|
|
480
475
|
"tw:w-full tw:appearance-none tw:pr-9",
|
|
481
476
|
"tw:bg-(image:--chevron-down) tw:bg-no-repeat",
|
|
482
477
|
{
|
|
483
|
-
"tw:focus-ring": !
|
|
484
|
-
"tw:focus-ring-danger":
|
|
478
|
+
"tw:focus-ring": !t,
|
|
479
|
+
"tw:focus-ring-danger": t === "error"
|
|
485
480
|
},
|
|
486
481
|
"tw:rounded-md tw:border",
|
|
487
482
|
{
|
|
488
|
-
"tw:border-lm-input-border tw:dark:border-dm-input-border": !
|
|
489
|
-
"tw:border-danger":
|
|
483
|
+
"tw:border-lm-input-border tw:dark:border-dm-input-border": !t,
|
|
484
|
+
"tw:border-danger": t === "error"
|
|
490
485
|
},
|
|
491
486
|
{
|
|
492
|
-
"tw:pl-2 tw:py-1 tw:text-sm":
|
|
493
|
-
"tw:pl-3 tw:py-1.5":
|
|
494
|
-
"tw:pl-4 tw:py-2 tw:text-xl":
|
|
487
|
+
"tw:pl-2 tw:py-1 tw:text-sm": e === "sm",
|
|
488
|
+
"tw:pl-3 tw:py-1.5": e === "md",
|
|
489
|
+
"tw:pl-4 tw:py-2 tw:text-xl": e === "lg",
|
|
495
490
|
"tw:bg-lm-disabled-input tw:dark:bg-dm-disabled-input": a,
|
|
496
491
|
// Apply different background color when rendered inside a card
|
|
497
492
|
"tw:bg-lm-primary tw:dark:bg-dm-primary tw:group-[&]/card:bg-lm-input tw:group-[&]/card:dark:bg-dm-input": !a
|
|
498
493
|
},
|
|
499
|
-
|
|
494
|
+
r
|
|
500
495
|
),
|
|
501
496
|
style: {
|
|
502
497
|
...o,
|
|
@@ -505,39 +500,39 @@ const E = H(void 0), L = H({ responsive: !0, size: "md" }), vt = ({ children: t,
|
|
|
505
500
|
disabled: a,
|
|
506
501
|
...l
|
|
507
502
|
}
|
|
508
|
-
)),
|
|
509
|
-
const c =
|
|
510
|
-
return /* @__PURE__ */
|
|
511
|
-
/* @__PURE__ */ n(
|
|
503
|
+
)), Re = y(({ selectClassName: r, label: e, error: t, helpText: o, required: a, hiddenRequired: l, "data-testid": d, ...i }, s) => {
|
|
504
|
+
const c = $();
|
|
505
|
+
return /* @__PURE__ */ p(X, { error: t, helpText: o, "data-testid": d, children: [
|
|
506
|
+
/* @__PURE__ */ n(Q, { htmlFor: c, required: a, children: e }),
|
|
512
507
|
/* @__PURE__ */ n(
|
|
513
|
-
|
|
508
|
+
Xt,
|
|
514
509
|
{
|
|
515
510
|
ref: s,
|
|
516
511
|
id: c,
|
|
517
|
-
className:
|
|
512
|
+
className: r,
|
|
518
513
|
required: a || l,
|
|
519
|
-
feedback:
|
|
514
|
+
feedback: t ? "error" : void 0,
|
|
520
515
|
...i
|
|
521
516
|
}
|
|
522
517
|
)
|
|
523
518
|
] });
|
|
524
|
-
}),
|
|
525
|
-
onChange:
|
|
526
|
-
containerClassName:
|
|
527
|
-
inputClassName:
|
|
519
|
+
}), Yt = y(({
|
|
520
|
+
onChange: r,
|
|
521
|
+
containerClassName: e,
|
|
522
|
+
inputClassName: t,
|
|
528
523
|
// Inputs have a default 'md' size. Search inputs are usually 'lg' as they are rendered at the top of sections
|
|
529
524
|
size: o = "lg",
|
|
530
525
|
loading: a = !1,
|
|
531
526
|
...l
|
|
532
527
|
}, d) => {
|
|
533
|
-
const { setTimeout: i, clearCurrentTimeout: s } =
|
|
534
|
-
m ? i(() =>
|
|
535
|
-
}, [s,
|
|
536
|
-
return /* @__PURE__ */
|
|
528
|
+
const { setTimeout: i, clearCurrentTimeout: s } = Nt(500), c = P((m) => {
|
|
529
|
+
m ? i(() => r(m)) : (s(), r(m));
|
|
530
|
+
}, [s, r, i]);
|
|
531
|
+
return /* @__PURE__ */ p("div", { className: w("tw:group tw:relative tw:focus-within:z-10", e), children: [
|
|
537
532
|
/* @__PURE__ */ n(
|
|
538
533
|
v,
|
|
539
534
|
{
|
|
540
|
-
icon: a ?
|
|
535
|
+
icon: a ? nt : ut,
|
|
541
536
|
spin: a,
|
|
542
537
|
className: w(
|
|
543
538
|
"tw:absolute tw:top-[50%] tw:translate-y-[-50%] tw:transition-colors",
|
|
@@ -550,7 +545,7 @@ const E = H(void 0), L = H({ responsive: !0, size: "md" }), vt = ({ children: t,
|
|
|
550
545
|
}
|
|
551
546
|
),
|
|
552
547
|
/* @__PURE__ */ n(
|
|
553
|
-
|
|
548
|
+
J,
|
|
554
549
|
{
|
|
555
550
|
ref: d,
|
|
556
551
|
type: "search",
|
|
@@ -559,7 +554,7 @@ const E = H(void 0), L = H({ responsive: !0, size: "md" }), vt = ({ children: t,
|
|
|
559
554
|
"tw:pl-9": o !== "sm",
|
|
560
555
|
"tw:pl-7": o === "sm"
|
|
561
556
|
},
|
|
562
|
-
|
|
557
|
+
t
|
|
563
558
|
),
|
|
564
559
|
placeholder: "Search...",
|
|
565
560
|
onChange: (m) => c(m.target.value),
|
|
@@ -569,10 +564,10 @@ const E = H(void 0), L = H({ responsive: !0, size: "md" }), vt = ({ children: t,
|
|
|
569
564
|
)
|
|
570
565
|
] });
|
|
571
566
|
});
|
|
572
|
-
function
|
|
573
|
-
searchResults:
|
|
574
|
-
onSearch:
|
|
575
|
-
onSelectSearchResult:
|
|
567
|
+
function Fe({
|
|
568
|
+
searchResults: r,
|
|
569
|
+
onSearch: e,
|
|
570
|
+
onSelectSearchResult: t,
|
|
576
571
|
renderSearchResult: o,
|
|
577
572
|
size: a = "md",
|
|
578
573
|
// SearchInput defaults its size to 'lg'. Change it to 'md'
|
|
@@ -580,47 +575,47 @@ function ae({
|
|
|
580
575
|
onFocus: d,
|
|
581
576
|
...i
|
|
582
577
|
}) {
|
|
583
|
-
const s =
|
|
584
|
-
() =>
|
|
585
|
-
[m,
|
|
578
|
+
const s = T(null), c = $(), [m, g] = R(), u = W(
|
|
579
|
+
() => r ? m ?? [...r.keys()][0] : void 0,
|
|
580
|
+
[m, r]
|
|
586
581
|
), x = P((b) => {
|
|
587
|
-
|
|
588
|
-
}, [
|
|
589
|
-
return /* @__PURE__ */
|
|
582
|
+
t(b), e(""), s.current.value = "";
|
|
583
|
+
}, [e, t]);
|
|
584
|
+
return /* @__PURE__ */ p(
|
|
590
585
|
"div",
|
|
591
586
|
{
|
|
592
587
|
className: "tw:relative",
|
|
593
588
|
onBlur: (b) => {
|
|
594
|
-
b.currentTarget.contains(b.relatedTarget) ||
|
|
589
|
+
b.currentTarget.contains(b.relatedTarget) || e("");
|
|
595
590
|
},
|
|
596
591
|
children: [
|
|
597
592
|
/* @__PURE__ */ n(
|
|
598
|
-
|
|
593
|
+
Yt,
|
|
599
594
|
{
|
|
600
|
-
onChange:
|
|
595
|
+
onChange: e,
|
|
601
596
|
size: a,
|
|
602
597
|
ref: s,
|
|
603
598
|
role: "combobox",
|
|
604
599
|
"aria-autocomplete": "list",
|
|
605
|
-
"aria-expanded": !!
|
|
600
|
+
"aria-expanded": !!r,
|
|
606
601
|
"aria-controls": c,
|
|
607
|
-
"aria-activedescendant":
|
|
602
|
+
"aria-activedescendant": u ? `${c}_${u}` : void 0,
|
|
608
603
|
autoComplete: "off",
|
|
609
604
|
autoCorrect: "off",
|
|
610
605
|
onFocus: (b) => {
|
|
611
|
-
d == null || d(b),
|
|
606
|
+
d == null || d(b), e(b.target.value);
|
|
612
607
|
},
|
|
613
608
|
...i
|
|
614
609
|
}
|
|
615
610
|
),
|
|
616
|
-
|
|
617
|
-
|
|
611
|
+
r && /* @__PURE__ */ n(
|
|
612
|
+
Ht,
|
|
618
613
|
{
|
|
619
614
|
id: c,
|
|
620
|
-
items:
|
|
615
|
+
items: r,
|
|
621
616
|
anchor: s,
|
|
622
617
|
onSelectItem: x,
|
|
623
|
-
onActiveItemChange:
|
|
618
|
+
onActiveItemChange: g,
|
|
624
619
|
renderItem: o,
|
|
625
620
|
className: w(
|
|
626
621
|
"tw:absolute tw:top-full tw:mt-1 tw:z-10",
|
|
@@ -637,20 +632,196 @@ function ae({
|
|
|
637
632
|
}
|
|
638
633
|
);
|
|
639
634
|
}
|
|
640
|
-
const
|
|
641
|
-
|
|
635
|
+
const Ee = y(({ className: r, ...e }, t) => /* @__PURE__ */ n(
|
|
636
|
+
lt,
|
|
642
637
|
{
|
|
643
|
-
ref:
|
|
644
|
-
className:
|
|
638
|
+
ref: t,
|
|
639
|
+
className: f(
|
|
645
640
|
"tw:rounded-full tw:w-8 tw:h-4",
|
|
646
641
|
"tw:bg-(image:--circle-grey-dark) tw:dark:bg-(image:--circle-grey-light) tw:checked:bg-(image:--circle-white)",
|
|
647
642
|
"tw:focus-visible:not-checked:bg-(image:--circle-light-blue)",
|
|
648
643
|
"tw:checked:bg-right tw:transition-[background-position]",
|
|
649
|
-
|
|
644
|
+
r
|
|
650
645
|
),
|
|
651
|
-
...
|
|
646
|
+
...e
|
|
652
647
|
}
|
|
653
|
-
)),
|
|
648
|
+
)), Zt = ({ className: r, selected: e, disabled: t, ...o }) => {
|
|
649
|
+
const a = "to" in o;
|
|
650
|
+
return (
|
|
651
|
+
// @ts-expect-error The Tag is inferred from provided props, so they should always match
|
|
652
|
+
/* @__PURE__ */ n(
|
|
653
|
+
a ? G : "button",
|
|
654
|
+
{
|
|
655
|
+
role: "menuitem",
|
|
656
|
+
"data-selected": e,
|
|
657
|
+
className: f(
|
|
658
|
+
"tw:flex tw:items-center tw:w-full tw:px-3 tw:py-1.5 tw:focus-ring",
|
|
659
|
+
// Overwrite link styles in case a Link is being used
|
|
660
|
+
"tw:no-underline tw:text-inherit",
|
|
661
|
+
{
|
|
662
|
+
"tw:pointer-events-none tw:opacity-50": t,
|
|
663
|
+
"tw:bg-lm-secondary tw:dark:bg-dm-secondary": e && !t,
|
|
664
|
+
"tw:highlight:bg-lm-secondary tw:dark:highlight:bg-dm-secondary tw:highlight:z-1 tw:relative": !e && !t
|
|
665
|
+
},
|
|
666
|
+
r
|
|
667
|
+
),
|
|
668
|
+
tabIndex: -1,
|
|
669
|
+
disabled: a ? void 0 : t,
|
|
670
|
+
"aria-disabled": a ? t : void 0,
|
|
671
|
+
...o
|
|
672
|
+
}
|
|
673
|
+
)
|
|
674
|
+
);
|
|
675
|
+
}, Vt = () => (
|
|
676
|
+
// TODO Use an <hr /> tag once tailwind styles are not set with !important
|
|
677
|
+
/* @__PURE__ */ n("div", { role: "separator", "aria-hidden": !0, className: "tw:border-b tw:border-lm-border tw:dark:border-dm-border tw:my-2" })
|
|
678
|
+
), te = ({ children: r }) => /* @__PURE__ */ n(
|
|
679
|
+
"div",
|
|
680
|
+
{
|
|
681
|
+
role: "heading",
|
|
682
|
+
"aria-level": 6,
|
|
683
|
+
"aria-hidden": !0,
|
|
684
|
+
className: f(
|
|
685
|
+
"tw:flex tw:items-center tw:w-full tw:px-3 tw:py-1.5",
|
|
686
|
+
"tw:text-gray-500 tw:text-sm tw:font-semibold"
|
|
687
|
+
),
|
|
688
|
+
onClick: (e) => e.stopPropagation(),
|
|
689
|
+
children: r
|
|
690
|
+
}
|
|
691
|
+
), ee = ({ className: r, onClick: e, ...t }) => (
|
|
692
|
+
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
|
|
693
|
+
/* @__PURE__ */ n(
|
|
694
|
+
"div",
|
|
695
|
+
{
|
|
696
|
+
className: f("tw:px-3 tw:py-1.5", r),
|
|
697
|
+
...t,
|
|
698
|
+
onClick: (o) => {
|
|
699
|
+
o.stopPropagation(), e == null || e(o);
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
)
|
|
703
|
+
), re = ({
|
|
704
|
+
children: r,
|
|
705
|
+
className: e,
|
|
706
|
+
focusableElementsSelector: t = '[role="menuitem"]:not([disabled]):not([aria-disabled])',
|
|
707
|
+
focusFirstItem: o = !1,
|
|
708
|
+
...a
|
|
709
|
+
}) => {
|
|
710
|
+
const l = T(null);
|
|
711
|
+
return Ct(l, { elementsSelector: t, focusFirstItem: o }), /* @__PURE__ */ n(C, { ref: l, role: "menu", className: f("tw:py-2 tw:whitespace-nowrap", e), ...a, children: r });
|
|
712
|
+
}, j = Object.assign(re, { Item: Zt, Separator: Vt, Title: te, Misc: ee }), ne = ({
|
|
713
|
+
children: r,
|
|
714
|
+
menuAlignment: e = "left",
|
|
715
|
+
buttonVariant: t = "button",
|
|
716
|
+
buttonContent: o,
|
|
717
|
+
buttonClassName: a,
|
|
718
|
+
buttonSize: l = "md",
|
|
719
|
+
buttonDisabled: d = !1,
|
|
720
|
+
containerClassName: i,
|
|
721
|
+
menuClassName: s,
|
|
722
|
+
caretless: c,
|
|
723
|
+
buttonLabel: m
|
|
724
|
+
}) => {
|
|
725
|
+
const [g, u] = R(!1), x = T(null), { refs: b, floatingStyles: h, context: D } = ot({
|
|
726
|
+
open: g,
|
|
727
|
+
onOpenChange: u,
|
|
728
|
+
placement: e === "right" ? "bottom-end" : "bottom-start",
|
|
729
|
+
middleware: [Pt(), Ot(3)],
|
|
730
|
+
// eslint-disable-next-line react-compiler/react-compiler
|
|
731
|
+
elements: { reference: x.current }
|
|
732
|
+
}), E = Dt(D), { getReferenceProps: K, getFloatingProps: k } = at([
|
|
733
|
+
E
|
|
734
|
+
]), S = $(), L = T(null);
|
|
735
|
+
return B(() => {
|
|
736
|
+
const N = L.current, Y = x.current;
|
|
737
|
+
if (!N || !Y)
|
|
738
|
+
return () => {
|
|
739
|
+
};
|
|
740
|
+
const Z = new AbortController();
|
|
741
|
+
return document.body.addEventListener("click", (wt) => {
|
|
742
|
+
wt.composedPath().includes(Y) || u(!1);
|
|
743
|
+
}, { signal: Z.signal }), () => Z.abort();
|
|
744
|
+
}, []), // eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
745
|
+
/* @__PURE__ */ p(
|
|
746
|
+
"div",
|
|
747
|
+
{
|
|
748
|
+
ref: L,
|
|
749
|
+
className: f("tw:relative tw:inline-block", i),
|
|
750
|
+
onKeyDown: (N) => {
|
|
751
|
+
N.key === "Escape" && u(!1);
|
|
752
|
+
},
|
|
753
|
+
onBlur: (N) => {
|
|
754
|
+
N.relatedTarget && !L.current.contains(N.relatedTarget) && u(!1);
|
|
755
|
+
},
|
|
756
|
+
children: [
|
|
757
|
+
/* @__PURE__ */ p(
|
|
758
|
+
"button",
|
|
759
|
+
{
|
|
760
|
+
ref: x,
|
|
761
|
+
...K(),
|
|
762
|
+
type: "button",
|
|
763
|
+
"aria-haspopup": !0,
|
|
764
|
+
"aria-expanded": g,
|
|
765
|
+
"aria-controls": S,
|
|
766
|
+
"aria-label": m,
|
|
767
|
+
disabled: d,
|
|
768
|
+
className: f(
|
|
769
|
+
"tw:flex tw:items-center tw:rounded-md tw:focus-ring",
|
|
770
|
+
{
|
|
771
|
+
"tw:justify-between": !c,
|
|
772
|
+
"tw:pointer-events-none tw:opacity-50": d,
|
|
773
|
+
// Button variant
|
|
774
|
+
"tw:border tw:border-lm-border tw:dark:border-dm-border": t === "button",
|
|
775
|
+
"tw:bg-lm-primary tw:dark:bg-dm-primary": t === "button",
|
|
776
|
+
// Use different bg color when inside a card
|
|
777
|
+
"tw:group-[&]/card:bg-lm-input tw:group-[&]/card:dark:bg-dm-input": t === "button",
|
|
778
|
+
// Link variant
|
|
779
|
+
"tw:text-lm-brand tw:dark:text-dm-brand": t === "link",
|
|
780
|
+
"tw:highlight:text-lm-brand-dark tw:dark:highlight:text-dm-brand-dark tw:highlight:underline": t === "link",
|
|
781
|
+
// Button sizes
|
|
782
|
+
"tw:px-1.5 tw:py-1 tw:text-sm tw:gap-x-1.5": l === "sm",
|
|
783
|
+
"tw:px-3 tw:py-1.5 tw:gap-x-2": l === "md",
|
|
784
|
+
"tw:px-4 tw:py-2 tw:text-lg tw:gap-x-2": l === "lg"
|
|
785
|
+
},
|
|
786
|
+
a
|
|
787
|
+
),
|
|
788
|
+
onKeyDown: (N) => {
|
|
789
|
+
N.key === "ArrowDown" && (N.preventDefault(), u(!0));
|
|
790
|
+
},
|
|
791
|
+
children: [
|
|
792
|
+
o,
|
|
793
|
+
!c && /* @__PURE__ */ n(v, { icon: ht, size: "xs" })
|
|
794
|
+
]
|
|
795
|
+
}
|
|
796
|
+
),
|
|
797
|
+
g && /* @__PURE__ */ n(
|
|
798
|
+
"div",
|
|
799
|
+
{
|
|
800
|
+
ref: b.setFloating,
|
|
801
|
+
style: h,
|
|
802
|
+
className: "tw:min-w-full tw:z-1000",
|
|
803
|
+
...k(),
|
|
804
|
+
children: /* @__PURE__ */ n(
|
|
805
|
+
j,
|
|
806
|
+
{
|
|
807
|
+
className: s,
|
|
808
|
+
id: S,
|
|
809
|
+
focusableElementsSelector: '[role="menuitem"]:not([disabled]):not([aria-disabled]),input:not([disabled]),select:not([disabled])',
|
|
810
|
+
focusFirstItem: !0,
|
|
811
|
+
children: r
|
|
812
|
+
}
|
|
813
|
+
)
|
|
814
|
+
}
|
|
815
|
+
)
|
|
816
|
+
]
|
|
817
|
+
}
|
|
818
|
+
);
|
|
819
|
+
}, I = Object.assign(ne, {
|
|
820
|
+
Item: j.Item,
|
|
821
|
+
Separator: j.Separator,
|
|
822
|
+
Title: j.Title,
|
|
823
|
+
Misc: j.Misc
|
|
824
|
+
}), oe = y(({ className: r, disabled: e, size: t = "md", type: o = "button", ...a }, l) => /* @__PURE__ */ n(
|
|
654
825
|
"button",
|
|
655
826
|
{
|
|
656
827
|
className: w(
|
|
@@ -658,24 +829,25 @@ const de = u(({ className: t, ...r }, e) => /* @__PURE__ */ n(
|
|
|
658
829
|
"tw:text-lm-brand tw:dark:text-dm-brand",
|
|
659
830
|
"tw:highlight:text-lm-brand-dark tw:dark:highlight:text-dm-brand-dark tw:highlight:underline",
|
|
660
831
|
{
|
|
661
|
-
"tw:px-1.5 tw:py-1 tw:text-sm":
|
|
662
|
-
"tw:px-3 tw:py-1.5":
|
|
663
|
-
"tw:px-4 tw:py-2 tw:text-lg":
|
|
664
|
-
"tw:pointer-events-none tw:opacity-65":
|
|
832
|
+
"tw:px-1.5 tw:py-1 tw:text-sm": t === "sm",
|
|
833
|
+
"tw:px-3 tw:py-1.5": t === "md",
|
|
834
|
+
"tw:px-4 tw:py-2 tw:text-lg": t === "lg",
|
|
835
|
+
"tw:pointer-events-none tw:opacity-65": e
|
|
665
836
|
},
|
|
666
|
-
|
|
837
|
+
r
|
|
667
838
|
),
|
|
668
|
-
disabled:
|
|
839
|
+
disabled: e,
|
|
669
840
|
type: o,
|
|
670
|
-
...a
|
|
841
|
+
...a,
|
|
842
|
+
ref: l
|
|
671
843
|
}
|
|
672
|
-
),
|
|
673
|
-
const o =
|
|
844
|
+
)), dt = q(null), ae = ({ className: r, to: e, ...t }) => {
|
|
845
|
+
const o = O(dt);
|
|
674
846
|
return /* @__PURE__ */ n(
|
|
675
|
-
|
|
847
|
+
mt,
|
|
676
848
|
{
|
|
677
849
|
role: "menuitem",
|
|
678
|
-
to:
|
|
850
|
+
to: e,
|
|
679
851
|
className: ({ isActive: a }) => w(
|
|
680
852
|
"tw:px-4 tw:pt-2 tw:pb-[calc(0.5rem-3px)] tw:border-b-3",
|
|
681
853
|
"tw:highlight:text-lm-brand tw:dark:highlight:text-dm-brand",
|
|
@@ -688,96 +860,116 @@ const de = u(({ className: t, ...r }, e) => /* @__PURE__ */ n(
|
|
|
688
860
|
"tw:border-b-transparent tw:text-gray-500": !a,
|
|
689
861
|
"tw:flex-grow": o == null ? void 0 : o.fill
|
|
690
862
|
},
|
|
691
|
-
|
|
863
|
+
r
|
|
692
864
|
),
|
|
693
|
-
...
|
|
865
|
+
...t
|
|
694
866
|
}
|
|
695
867
|
);
|
|
696
|
-
},
|
|
697
|
-
const
|
|
698
|
-
Math.max(
|
|
699
|
-
Math.min(
|
|
868
|
+
}, le = ({ children: r, className: e, fill: t }) => /* @__PURE__ */ n(dt.Provider, { value: { fill: t }, children: /* @__PURE__ */ n(C, { role: "menubar", className: w("tw:flex tw:overflow-hidden", e), children: r }) }), Se = Object.assign(le, { Pill: ae }), de = new Intl.NumberFormat("en-US"), ie = (r) => de.format(Number(r)), rt = 10, je = (r) => Math.ceil(r / rt) * rt, M = 2, U = "...", se = (r, e) => Array.from({ length: e - r }, (t, o) => r + o), ce = (r, e) => {
|
|
869
|
+
const t = se(
|
|
870
|
+
Math.max(M, r - M),
|
|
871
|
+
Math.min(e - 1, r + M) + 1
|
|
700
872
|
);
|
|
701
|
-
return
|
|
702
|
-
},
|
|
873
|
+
return r - M > M && t.unshift(U), r + M < e - 1 && t.push(U), t.unshift(1), t.push(e), t;
|
|
874
|
+
}, A = (r) => r === U, we = (r) => A(r) ? r : ie(r), me = (r, e) => A(r) ? `${r}_${e}` : `${r}`, it = [
|
|
703
875
|
"tw:border tw:border-r-0 tw:last:border-r tw:border-lm-border tw:dark:border-dm-border",
|
|
704
876
|
"tw:rounded-none tw:first:rounded-l tw:last:rounded-r"
|
|
705
|
-
],
|
|
706
|
-
|
|
877
|
+
], st = (r = !1) => w(
|
|
878
|
+
it,
|
|
707
879
|
"tw:px-3 py-2 tw:cursor-pointer tw:no-underline",
|
|
708
880
|
"tw:focus-ring tw:focus-visible:z-1",
|
|
709
|
-
!
|
|
881
|
+
!r && [
|
|
710
882
|
"tw:text-lm-brand tw:dark:text-dm-brand",
|
|
711
883
|
"tw:bg-lm-primary tw:dark:bg-dm-primary",
|
|
712
884
|
"tw:highlight:bg-lm-secondary tw:dark:highlight:bg-dm-secondary"
|
|
713
885
|
],
|
|
714
|
-
|
|
715
|
-
),
|
|
716
|
-
function
|
|
717
|
-
const l =
|
|
718
|
-
return
|
|
886
|
+
r && "tw:bg-lm-main tw:dark:bg-dm-main tw:text-white"
|
|
887
|
+
), z = ({ children: r }) => /* @__PURE__ */ n("span", { "aria-hidden": !0, className: w(it, "tw:px-3 py-2 tw:text-gray-400"), children: r }), ct = () => /* @__PURE__ */ n(z, { children: U });
|
|
888
|
+
function pe({ children: r, active: e, isEllipsis: t, href: o, ...a }) {
|
|
889
|
+
const l = W(() => st(e), [e]);
|
|
890
|
+
return t ? /* @__PURE__ */ n(ct, {}) : /* @__PURE__ */ n(G, { className: l, to: o, ...a, children: r });
|
|
719
891
|
}
|
|
720
|
-
function
|
|
721
|
-
const a =
|
|
722
|
-
return
|
|
892
|
+
function be({ children: r, active: e, isEllipsis: t, ...o }) {
|
|
893
|
+
const a = W(() => st(e), [e]);
|
|
894
|
+
return t ? /* @__PURE__ */ n(ct, {}) : /* @__PURE__ */ n("button", { type: "button", className: a, ...o, children: r });
|
|
723
895
|
}
|
|
724
|
-
const
|
|
725
|
-
const o = "urlForPage" in
|
|
726
|
-
(d) => o ? { href:
|
|
727
|
-
[o,
|
|
896
|
+
const Ae = ({ currentPage: r, pagesCount: e, ...t }) => {
|
|
897
|
+
const o = "urlForPage" in t, a = o ? pe : be, l = P(
|
|
898
|
+
(d) => o ? { href: A(d) ? void 0 : t.urlForPage(d) } : { onClick: () => !A(d) && t.onPageChange(d) },
|
|
899
|
+
[o, t]
|
|
728
900
|
);
|
|
729
|
-
return
|
|
730
|
-
|
|
731
|
-
|
|
901
|
+
return e < 2 ? null : /* @__PURE__ */ p("div", { className: "tw:select-none tw:flex", "data-testid": "paginator", children: [
|
|
902
|
+
r === 1 ? /* @__PURE__ */ n(z, { children: /* @__PURE__ */ n(v, { size: "xs", icon: V }) }) : /* @__PURE__ */ n(a, { ...l(Math.max(1, r - 1)), "aria-label": "Previous", children: /* @__PURE__ */ n(v, { size: "xs", icon: V }) }),
|
|
903
|
+
ce(r, e).map((d, i) => /* @__PURE__ */ n(
|
|
732
904
|
a,
|
|
733
905
|
{
|
|
734
|
-
active: d ===
|
|
735
|
-
isEllipsis:
|
|
906
|
+
active: d === r,
|
|
907
|
+
isEllipsis: A(d),
|
|
736
908
|
...l(d),
|
|
737
|
-
children:
|
|
909
|
+
children: we(d)
|
|
738
910
|
},
|
|
739
|
-
|
|
911
|
+
me(d, i)
|
|
740
912
|
)),
|
|
741
|
-
|
|
913
|
+
r === e ? /* @__PURE__ */ n(z, { children: /* @__PURE__ */ n(v, { size: "xs", icon: tt }) }) : /* @__PURE__ */ n(a, { ...l(Math.min(e, r + 1)), "aria-label": "Next", children: /* @__PURE__ */ n(v, { size: "xs", icon: tt }) })
|
|
742
914
|
] });
|
|
743
|
-
},
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
915
|
+
}, ge = ({ buttonLabel: r = "Options", buttonSize: e = "md", ...t }) => /* @__PURE__ */ n(
|
|
916
|
+
I,
|
|
917
|
+
{
|
|
918
|
+
buttonContent: /* @__PURE__ */ n(
|
|
919
|
+
v,
|
|
920
|
+
{
|
|
921
|
+
icon: ft,
|
|
922
|
+
className: f({ "tw:px-1": e === "sm" })
|
|
923
|
+
}
|
|
924
|
+
),
|
|
925
|
+
caretless: !0,
|
|
926
|
+
buttonLabel: r,
|
|
927
|
+
buttonSize: e,
|
|
928
|
+
...t
|
|
929
|
+
}
|
|
930
|
+
), _e = Object.assign(ge, {
|
|
931
|
+
Item: I.Item,
|
|
932
|
+
Separator: I.Separator,
|
|
933
|
+
Title: I.Title,
|
|
934
|
+
Misc: I.Misc
|
|
935
|
+
}), ue = ({
|
|
936
|
+
open: r,
|
|
937
|
+
children: e,
|
|
938
|
+
className: t,
|
|
747
939
|
onClose: o,
|
|
748
940
|
...a
|
|
749
941
|
}) => {
|
|
750
|
-
const l =
|
|
751
|
-
return
|
|
942
|
+
const l = T(null);
|
|
943
|
+
return B(() => {
|
|
752
944
|
var c, m;
|
|
753
945
|
const d = document.body, i = d.style.overflow, s = d.style.paddingRight;
|
|
754
|
-
if (
|
|
755
|
-
const
|
|
756
|
-
d.style.overflow = "hidden",
|
|
946
|
+
if (r) {
|
|
947
|
+
const g = window.outerWidth - d.clientWidth, u = d.scrollHeight > d.clientHeight;
|
|
948
|
+
d.style.overflow = "hidden", u && (d.style.paddingRight = `${g}px`), (c = l.current) == null || c.showModal();
|
|
757
949
|
} else
|
|
758
950
|
(m = l.current) == null || m.close();
|
|
759
951
|
return () => {
|
|
760
952
|
d.style.overflow = i, d.style.paddingRight = s;
|
|
761
953
|
};
|
|
762
|
-
}, [
|
|
954
|
+
}, [r]), Ft(
|
|
763
955
|
/* @__PURE__ */ n(
|
|
764
956
|
"dialog",
|
|
765
957
|
{
|
|
766
958
|
ref: l,
|
|
767
|
-
className: w("tw:bg-transparent tw:backdrop:bg-black/50",
|
|
959
|
+
className: w("tw:bg-transparent tw:backdrop:bg-black/50", t),
|
|
768
960
|
onCancel: (d) => {
|
|
769
961
|
d.preventDefault(), o();
|
|
770
962
|
},
|
|
771
963
|
...a,
|
|
772
|
-
children:
|
|
964
|
+
children: r && e
|
|
773
965
|
}
|
|
774
966
|
),
|
|
775
967
|
document.body
|
|
776
968
|
);
|
|
777
|
-
},
|
|
778
|
-
open:
|
|
779
|
-
onClose:
|
|
780
|
-
variant:
|
|
969
|
+
}, $e = ({
|
|
970
|
+
open: r,
|
|
971
|
+
onClose: e,
|
|
972
|
+
variant: t = "default",
|
|
781
973
|
title: o,
|
|
782
974
|
children: a,
|
|
783
975
|
className: l,
|
|
@@ -788,40 +980,40 @@ const se = ({ currentPage: t, pagesCount: r, ...e }) => {
|
|
|
788
980
|
confirmText: s = "Confirm",
|
|
789
981
|
cancelText: c = "Cancel",
|
|
790
982
|
confirmDisabled: m,
|
|
791
|
-
onConfirm:
|
|
792
|
-
onClosed:
|
|
983
|
+
onConfirm: g,
|
|
984
|
+
onClosed: u,
|
|
793
985
|
...x
|
|
794
|
-
} = "onConfirm" in d ? d : { ...d }, [b,
|
|
795
|
-
k.preventDefault(), k.stopPropagation(),
|
|
796
|
-
}, [
|
|
797
|
-
return
|
|
798
|
-
if (
|
|
799
|
-
|
|
986
|
+
} = "onConfirm" in d ? d : { ...d }, [b, h] = R(r), D = T(null), E = T("cancel"), K = P((k) => {
|
|
987
|
+
k.preventDefault(), k.stopPropagation(), E.current = "confirm", g == null || g();
|
|
988
|
+
}, [g]);
|
|
989
|
+
return B(() => {
|
|
990
|
+
if (r) {
|
|
991
|
+
E.current = "cancel", h(!0);
|
|
800
992
|
return;
|
|
801
993
|
}
|
|
802
|
-
const k =
|
|
994
|
+
const k = D.current;
|
|
803
995
|
if (k) {
|
|
804
|
-
delete
|
|
805
|
-
let
|
|
806
|
-
const
|
|
807
|
-
|
|
996
|
+
delete D.current.dataset.open;
|
|
997
|
+
let S = !1;
|
|
998
|
+
const L = (N) => {
|
|
999
|
+
S || N.target !== k || (S = !0, h(!1), u == null || u(E.current));
|
|
808
1000
|
};
|
|
809
|
-
return k.addEventListener("transitionend",
|
|
810
|
-
k.removeEventListener("transitionend",
|
|
1001
|
+
return k.addEventListener("transitionend", L), () => {
|
|
1002
|
+
k.removeEventListener("transitionend", L);
|
|
811
1003
|
};
|
|
812
1004
|
}
|
|
813
|
-
}, [
|
|
814
|
-
const k =
|
|
1005
|
+
}, [u, r]), B(() => {
|
|
1006
|
+
const k = D.current;
|
|
815
1007
|
b && k && (k.dataset.open = "");
|
|
816
1008
|
}, [b]), /* @__PURE__ */ n(
|
|
817
|
-
|
|
1009
|
+
ue,
|
|
818
1010
|
{
|
|
819
1011
|
open: b,
|
|
820
|
-
onClose:
|
|
1012
|
+
onClose: e,
|
|
821
1013
|
className: w(
|
|
822
1014
|
{
|
|
823
1015
|
"tw:flex tw:w-screen tw:h-screen tw:max-w-screen tw:max-h-screen": b,
|
|
824
|
-
"tw:overflow-hidden":
|
|
1016
|
+
"tw:overflow-hidden": t === "cover"
|
|
825
1017
|
},
|
|
826
1018
|
l
|
|
827
1019
|
),
|
|
@@ -830,27 +1022,27 @@ const se = ({ currentPage: t, pagesCount: r, ...e }) => {
|
|
|
830
1022
|
"form",
|
|
831
1023
|
{
|
|
832
1024
|
"data-testid": "transition-container",
|
|
833
|
-
ref:
|
|
1025
|
+
ref: D,
|
|
834
1026
|
className: w(
|
|
835
1027
|
"tw:w-full tw:m-auto tw:p-4 tw:sm:p-6",
|
|
836
1028
|
// CSS transitions are based on the presence of the `data-open` attribute
|
|
837
1029
|
"tw:-translate-y-4 tw:data-open:translate-y-0 tw:opacity-0 tw:data-open:opacity-100",
|
|
838
1030
|
"tw:transition-[opacity_,_translate] tw:duration-300",
|
|
839
1031
|
// Handle modal dimensions for different variants and sizes
|
|
840
|
-
|
|
1032
|
+
t !== "cover" && {
|
|
841
1033
|
"tw:sm:w-sm": i === "sm",
|
|
842
1034
|
"tw:md:w-lg": i === "md",
|
|
843
1035
|
"tw:md:w-4xl": i === "lg",
|
|
844
1036
|
"tw:md:w-6xl": i === "xl"
|
|
845
1037
|
},
|
|
846
|
-
{ "tw:h-full":
|
|
1038
|
+
{ "tw:h-full": t === "cover" }
|
|
847
1039
|
),
|
|
848
|
-
onSubmit:
|
|
849
|
-
children: /* @__PURE__ */ n(
|
|
1040
|
+
onSubmit: K,
|
|
1041
|
+
children: /* @__PURE__ */ n(C, { className: w(
|
|
850
1042
|
"tw:w-full",
|
|
851
|
-
{ "tw:h-full tw:relative tw:overflow-auto":
|
|
852
|
-
), children:
|
|
853
|
-
/* @__PURE__ */
|
|
1043
|
+
{ "tw:h-full tw:relative tw:overflow-auto": t === "cover" }
|
|
1044
|
+
), children: t === "cover" ? /* @__PURE__ */ p(_, { children: [
|
|
1045
|
+
/* @__PURE__ */ p(
|
|
854
1046
|
"div",
|
|
855
1047
|
{
|
|
856
1048
|
className: w(
|
|
@@ -861,22 +1053,22 @@ const se = ({ currentPage: t, pagesCount: r, ...e }) => {
|
|
|
861
1053
|
),
|
|
862
1054
|
children: [
|
|
863
1055
|
/* @__PURE__ */ n("h5", { children: o }),
|
|
864
|
-
/* @__PURE__ */ n(
|
|
1056
|
+
/* @__PURE__ */ n(et, { onClick: e, label: "Close dialog" })
|
|
865
1057
|
]
|
|
866
1058
|
}
|
|
867
1059
|
),
|
|
868
1060
|
a
|
|
869
|
-
] }) : /* @__PURE__ */
|
|
870
|
-
/* @__PURE__ */
|
|
1061
|
+
] }) : /* @__PURE__ */ p(_, { children: [
|
|
1062
|
+
/* @__PURE__ */ p(C.Header, { className: w(
|
|
871
1063
|
"tw:sticky tw:top-0",
|
|
872
1064
|
"tw:flex tw:items-center tw:justify-between tw:gap-x-2"
|
|
873
1065
|
), children: [
|
|
874
|
-
/* @__PURE__ */ n("h5", { className: w({ "tw:text-danger":
|
|
875
|
-
/* @__PURE__ */ n(
|
|
1066
|
+
/* @__PURE__ */ n("h5", { className: w({ "tw:text-danger": t === "danger" }), children: o }),
|
|
1067
|
+
/* @__PURE__ */ n(et, { onClick: e, label: "Close dialog" })
|
|
876
1068
|
] }),
|
|
877
|
-
/* @__PURE__ */ n(
|
|
878
|
-
|
|
879
|
-
|
|
1069
|
+
/* @__PURE__ */ n(C.Body, { children: a }),
|
|
1070
|
+
g && /* @__PURE__ */ p(
|
|
1071
|
+
C.Footer,
|
|
880
1072
|
{
|
|
881
1073
|
"data-testid": "footer",
|
|
882
1074
|
className: w(
|
|
@@ -884,12 +1076,12 @@ const se = ({ currentPage: t, pagesCount: r, ...e }) => {
|
|
|
884
1076
|
"tw:[&]:px-3 tw:sticky tw:bottom-0"
|
|
885
1077
|
),
|
|
886
1078
|
children: [
|
|
887
|
-
/* @__PURE__ */ n(
|
|
1079
|
+
/* @__PURE__ */ n(oe, { onClick: e, children: c }),
|
|
888
1080
|
/* @__PURE__ */ n(
|
|
889
|
-
|
|
1081
|
+
Jt,
|
|
890
1082
|
{
|
|
891
1083
|
solid: !0,
|
|
892
|
-
variant:
|
|
1084
|
+
variant: t === "danger" ? "danger" : "primary",
|
|
893
1085
|
disabled: m,
|
|
894
1086
|
type: "submit",
|
|
895
1087
|
children: s
|
|
@@ -903,91 +1095,221 @@ const se = ({ currentPage: t, pagesCount: r, ...e }) => {
|
|
|
903
1095
|
)
|
|
904
1096
|
}
|
|
905
1097
|
);
|
|
906
|
-
},
|
|
1098
|
+
}, He = ({ className: r, children: e, loading: t = !1, variant: o = "default" }) => /* @__PURE__ */ n($t, { className: f({ "tw:[&]:border-danger": o === "error" }, r), children: /* @__PURE__ */ p("h3", { className: f("tw:text-center", {
|
|
907
1099
|
"tw:text-gray-500 tw:dark:text-gray-400": o === "default",
|
|
908
1100
|
"tw:text-danger": o === "error"
|
|
909
1101
|
}), children: [
|
|
910
|
-
|
|
911
|
-
/* @__PURE__ */ n(v, { icon:
|
|
912
|
-
/* @__PURE__ */ n("span", { className: "tw:ml-2", children:
|
|
1102
|
+
t && /* @__PURE__ */ p(_, { children: [
|
|
1103
|
+
/* @__PURE__ */ n(v, { icon: nt, spin: !0 }),
|
|
1104
|
+
/* @__PURE__ */ n("span", { className: "tw:ml-2", children: e ?? "Loading..." })
|
|
913
1105
|
] }),
|
|
914
|
-
!
|
|
915
|
-
] }) }),
|
|
1106
|
+
!t && e
|
|
1107
|
+
] }) }), Ue = ({ variant: r, className: e, size: t = "md", children: o }) => /* @__PURE__ */ n(
|
|
916
1108
|
"div",
|
|
917
1109
|
{
|
|
918
|
-
className:
|
|
1110
|
+
className: f(
|
|
919
1111
|
"tw:rounded-md tw:text-center",
|
|
920
1112
|
{
|
|
921
|
-
"tw:p-2":
|
|
922
|
-
"tw:p-4":
|
|
923
|
-
"tw:p-6":
|
|
924
|
-
"tw:[&]:text-white":
|
|
925
|
-
"tw:bg-lm-brand tw:dark:bg-dm-brand":
|
|
926
|
-
"tw:bg-danger":
|
|
927
|
-
"tw:bg-warning tw:text-black":
|
|
1113
|
+
"tw:p-2": t === "sm",
|
|
1114
|
+
"tw:p-4": t === "md",
|
|
1115
|
+
"tw:p-6": t === "lg",
|
|
1116
|
+
"tw:[&]:text-white": r !== "warning",
|
|
1117
|
+
"tw:bg-lm-brand tw:dark:bg-dm-brand": r === "success",
|
|
1118
|
+
"tw:bg-danger": r === "error",
|
|
1119
|
+
"tw:bg-warning tw:text-black": r === "warning"
|
|
928
1120
|
},
|
|
929
|
-
|
|
1121
|
+
e
|
|
930
1122
|
),
|
|
931
1123
|
children: o
|
|
932
1124
|
}
|
|
933
|
-
),
|
|
934
|
-
const
|
|
935
|
-
|
|
936
|
-
|
|
1125
|
+
), We = ({ placement: r = "auto" } = {}) => {
|
|
1126
|
+
const e = T(null), t = (() => {
|
|
1127
|
+
const h = [];
|
|
1128
|
+
return r === "auto" && h.push(Lt()), h.push(Mt({ element: e })), h;
|
|
1129
|
+
})(), [o, a] = R(!1), { refs: l, floatingStyles: d, context: i, middlewareData: s } = ot({
|
|
1130
|
+
placement: r === "auto" ? void 0 : r,
|
|
1131
|
+
open: o,
|
|
1132
|
+
onOpenChange: a,
|
|
1133
|
+
middleware: t
|
|
1134
|
+
}), c = Bt(i, {
|
|
1135
|
+
delay: { open: 300 },
|
|
1136
|
+
move: !0
|
|
1137
|
+
}), { getFloatingProps: m, getReferenceProps: g } = at([c]), { isMounted: u, styles: x } = Rt(i, { duration: 200 }), b = W(() => {
|
|
1138
|
+
const h = i.placement.split("-")[0];
|
|
1139
|
+
return {
|
|
1140
|
+
top: "bottom",
|
|
1141
|
+
right: "left",
|
|
1142
|
+
bottom: "top",
|
|
1143
|
+
left: "right"
|
|
1144
|
+
}[h] ?? "";
|
|
1145
|
+
}, [i.placement]);
|
|
1146
|
+
return {
|
|
1147
|
+
anchor: { ...g(), ref: l.setReference },
|
|
1148
|
+
tooltip: {
|
|
1149
|
+
...m(),
|
|
1150
|
+
refSetter: l.setFloating,
|
|
1151
|
+
isMounted: u,
|
|
1152
|
+
styles: { ...d, ...x },
|
|
1153
|
+
arrowPos: s.arrow,
|
|
1154
|
+
arrowRef: e,
|
|
1155
|
+
arrowSide: b
|
|
1156
|
+
}
|
|
1157
|
+
};
|
|
1158
|
+
}, Ke = ({ children: r, isMounted: e, styles: t, refSetter: o, arrowRef: a, arrowPos: l, arrowSide: d, ...i }) => {
|
|
1159
|
+
var s;
|
|
1160
|
+
return e && /* @__PURE__ */ n(
|
|
1161
|
+
"div",
|
|
1162
|
+
{
|
|
1163
|
+
role: "tooltip",
|
|
1164
|
+
"aria-live": "polite",
|
|
1165
|
+
className: f(
|
|
1166
|
+
"tw:z-1000 tw:max-w-64",
|
|
1167
|
+
// Add space between anchor and tooltip via padding, so that if the tooltip is inside the anchor, you can hover it
|
|
1168
|
+
// and it's never closed
|
|
1169
|
+
{
|
|
1170
|
+
"tw:pt-2.5": d === "top",
|
|
1171
|
+
"tw:pb-2.5": d === "bottom",
|
|
1172
|
+
"tw:pr-2.5": d === "right",
|
|
1173
|
+
"tw:pl-2.5": d === "left"
|
|
1174
|
+
}
|
|
1175
|
+
),
|
|
1176
|
+
ref: o,
|
|
1177
|
+
style: t,
|
|
1178
|
+
...i,
|
|
1179
|
+
children: /* @__PURE__ */ p("div", { className: "tw:relative tw:px-1.5 tw:py-1 tw:rounded tw:bg-black/90 tw:text-white tw:text-center", children: [
|
|
1180
|
+
/* @__PURE__ */ n("span", { className: "tw:sr-only", children: "Tooltip: " }),
|
|
1181
|
+
r,
|
|
1182
|
+
/* @__PURE__ */ n(
|
|
1183
|
+
"div",
|
|
1184
|
+
{
|
|
1185
|
+
ref: a,
|
|
1186
|
+
className: f(
|
|
1187
|
+
"tw:absolute",
|
|
1188
|
+
// Render as a triangle
|
|
1189
|
+
"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",
|
|
1190
|
+
// Rotate triangle so that it points to the correct direction
|
|
1191
|
+
{
|
|
1192
|
+
"tw:rotate-180": d === "bottom",
|
|
1193
|
+
"tw:rotate-90 tw:mr-[-3px]": d === "right",
|
|
1194
|
+
"tw:rotate-270 tw:ml-[-3px]": d === "left"
|
|
1195
|
+
}
|
|
1196
|
+
),
|
|
1197
|
+
style: {
|
|
1198
|
+
left: l == null ? void 0 : l.x,
|
|
1199
|
+
top: l == null ? void 0 : l.y,
|
|
1200
|
+
[d]: `${-(((s = a.current) == null ? void 0 : s.offsetWidth) ?? 0) / 2}px`
|
|
1201
|
+
},
|
|
1202
|
+
"data-testid": "arrow"
|
|
1203
|
+
}
|
|
1204
|
+
)
|
|
1205
|
+
] })
|
|
1206
|
+
}
|
|
1207
|
+
);
|
|
1208
|
+
};
|
|
1209
|
+
function ze({ items: r, order: e, onChange: t, prefixed: o = !0, buttonVariant: a = "button", ...l }) {
|
|
1210
|
+
const d = P((s) => {
|
|
1211
|
+
const c = Tt({ currentOrderDir: e.dir, currentField: e.field, newField: s });
|
|
1212
|
+
t(c);
|
|
1213
|
+
}, [t, e.dir, e.field]), i = a === "button";
|
|
1214
|
+
return /* @__PURE__ */ p(
|
|
1215
|
+
I,
|
|
1216
|
+
{
|
|
1217
|
+
buttonContent: /* @__PURE__ */ p(_, { children: [
|
|
1218
|
+
!i && "Order by",
|
|
1219
|
+
i && !e.field && /* @__PURE__ */ n("i", { children: "Order by..." }),
|
|
1220
|
+
i && e.field && /* @__PURE__ */ p(_, { children: [
|
|
1221
|
+
o && "Order by: ",
|
|
1222
|
+
r[e.field],
|
|
1223
|
+
" - ",
|
|
1224
|
+
e.dir ?? "DESC"
|
|
1225
|
+
] })
|
|
1226
|
+
] }),
|
|
1227
|
+
buttonVariant: a,
|
|
1228
|
+
...l,
|
|
1229
|
+
children: [
|
|
1230
|
+
Object.entries(r).map(([s, c]) => /* @__PURE__ */ p(
|
|
1231
|
+
I.Item,
|
|
1232
|
+
{
|
|
1233
|
+
selected: e.field === s,
|
|
1234
|
+
onClick: () => d(s),
|
|
1235
|
+
className: "tw:flex tw:items-center tw:justify-between",
|
|
1236
|
+
children: [
|
|
1237
|
+
c,
|
|
1238
|
+
e.field === s && /* @__PURE__ */ n(v, { icon: e.dir === "ASC" ? xt : yt })
|
|
1239
|
+
]
|
|
1240
|
+
},
|
|
1241
|
+
s
|
|
1242
|
+
)),
|
|
1243
|
+
/* @__PURE__ */ n(I.Separator, {}),
|
|
1244
|
+
/* @__PURE__ */ n(I.Item, { disabled: !e.field, onClick: () => t({}), children: /* @__PURE__ */ n("i", { children: "Clear selection" }) })
|
|
1245
|
+
]
|
|
1246
|
+
}
|
|
1247
|
+
);
|
|
1248
|
+
}
|
|
1249
|
+
const qe = ({ text: r, className: e, size: t = "lg", initialCopied: o = !1, navigator_: a = globalThis.navigator, ...l }) => {
|
|
1250
|
+
const [d, i] = It(o), s = P(
|
|
1251
|
+
() => a.clipboard.writeText(r).then(i),
|
|
1252
|
+
[a.clipboard, r, i]
|
|
937
1253
|
);
|
|
938
1254
|
return /* @__PURE__ */ n(
|
|
939
1255
|
"button",
|
|
940
1256
|
{
|
|
941
1257
|
type: "button",
|
|
942
|
-
className:
|
|
1258
|
+
className: f(
|
|
943
1259
|
"tw:focus-ring tw:rounded-sm",
|
|
944
1260
|
{
|
|
945
|
-
"tw:text-md":
|
|
946
|
-
"tw:text-lg":
|
|
947
|
-
"tw:text-xl":
|
|
1261
|
+
"tw:text-md": t === "sm",
|
|
1262
|
+
"tw:text-lg": t === "md",
|
|
1263
|
+
"tw:text-xl": t === "lg"
|
|
948
1264
|
},
|
|
949
|
-
|
|
1265
|
+
e
|
|
950
1266
|
),
|
|
951
|
-
"aria-label": `Copy ${
|
|
1267
|
+
"aria-label": `Copy ${r} to clipboard`,
|
|
952
1268
|
title: "Copy to clipboard",
|
|
953
1269
|
onClick: s,
|
|
954
1270
|
...l,
|
|
955
|
-
children: /* @__PURE__ */ n(v, { icon: d ?
|
|
1271
|
+
children: /* @__PURE__ */ n(v, { icon: d ? kt : Et, fixedWidth: !0 })
|
|
956
1272
|
}
|
|
957
1273
|
);
|
|
958
1274
|
};
|
|
959
1275
|
export {
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
U as
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
ie as
|
|
1276
|
+
Jt as Button,
|
|
1277
|
+
C as Card,
|
|
1278
|
+
$e as CardModal,
|
|
1279
|
+
Le as Checkbox,
|
|
1280
|
+
et as CloseButton,
|
|
1281
|
+
qe as CopyToClipboardButton,
|
|
1282
|
+
Oe as Details,
|
|
1283
|
+
I as Dropdown,
|
|
1284
|
+
U as ELLIPSIS,
|
|
1285
|
+
J as Input,
|
|
1286
|
+
Q as Label,
|
|
1287
|
+
Me as LabelledInput,
|
|
1288
|
+
Be as LabelledRevealablePasswordInput,
|
|
1289
|
+
Re as LabelledSelect,
|
|
1290
|
+
oe as LinkButton,
|
|
1291
|
+
Ht as Listbox,
|
|
1292
|
+
j as Menu,
|
|
1293
|
+
He as Message,
|
|
1294
|
+
ue as ModalDialog,
|
|
1295
|
+
Se as NavPills,
|
|
1296
|
+
ze as OrderingDropdown,
|
|
1297
|
+
Ae as Paginator,
|
|
1298
|
+
Ue as Result,
|
|
1299
|
+
Qt as RevealablePasswordInput,
|
|
1300
|
+
_e as RowDropdown,
|
|
1301
|
+
Fe as SearchCombobox,
|
|
1302
|
+
Yt as SearchInput,
|
|
1303
|
+
Xt as Select,
|
|
1304
|
+
$t as SimpleCard,
|
|
1305
|
+
De as Table,
|
|
1306
|
+
Ee as ToggleSwitch,
|
|
1307
|
+
Ke as Tooltip,
|
|
1308
|
+
ie as formatNumber,
|
|
1309
|
+
me as keyForPage,
|
|
1310
|
+
A as pageIsEllipsis,
|
|
1311
|
+
we as prettifyPageNumber,
|
|
1312
|
+
ce as progressivePagination,
|
|
1313
|
+
je as roundTen,
|
|
1314
|
+
We as useTooltip
|
|
993
1315
|
};
|