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