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