@shlinkio/shlink-frontend-kit 0.8.10 → 0.8.12
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 +19 -2
- package/dist/index.js +1 -1
- package/dist/tailwind.d.ts +7 -0
- package/dist/tailwind.js +165 -154
- package/dist/tailwind.preset.css +9 -1
- package/dist/use-toggle-PWLikLl6.js +22 -0
- package/package.json +9 -9
- package/dist/use-toggle-CNvdDGvy.js +0 -22
package/dist/index.d.ts
CHANGED
|
@@ -206,7 +206,17 @@ export declare type TimeoutToggleOptions = {
|
|
|
206
206
|
delay?: number;
|
|
207
207
|
};
|
|
208
208
|
|
|
209
|
-
export declare type ToggleResult =
|
|
209
|
+
export declare type ToggleResult = ToggleResultTuple | ToggleResultObject;
|
|
210
|
+
|
|
211
|
+
export declare type ToggleResultObject = {
|
|
212
|
+
flag: boolean;
|
|
213
|
+
toggle: () => void;
|
|
214
|
+
setToTrue: () => void;
|
|
215
|
+
setToFalse: () => void;
|
|
216
|
+
};
|
|
217
|
+
|
|
218
|
+
/** @deprecated */
|
|
219
|
+
export declare type ToggleResultTuple = [boolean, () => void, () => void, () => void];
|
|
210
220
|
|
|
211
221
|
export declare const ToggleSwitch: FC<BooleanControlProps>;
|
|
212
222
|
|
|
@@ -242,6 +252,13 @@ export declare type UseTimeoutResult = {
|
|
|
242
252
|
*/
|
|
243
253
|
export declare const useTimeoutToggle: (initialValueOrOptions?: TimeoutToggleOptions | boolean, secondArg?: number, setTimeout_?: typeof setTimeout, clearTimeout_?: typeof clearTimeout) => [boolean, () => void];
|
|
244
254
|
|
|
245
|
-
|
|
255
|
+
/** @deprecated Returning result as tuple is deprecated */
|
|
256
|
+
export declare function useToggle(initialValue?: boolean, asObject?: false): ToggleResultTuple;
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* @param asObject - Whether the result should be returned as an object or as a tuple.
|
|
260
|
+
* Deprecated. Future releases will always return an object.
|
|
261
|
+
*/
|
|
262
|
+
export declare function useToggle(initialValue: boolean, asObject: true): ToggleResultObject;
|
|
246
263
|
|
|
247
264
|
export { }
|
package/dist/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import { clsx as h } from "clsx";
|
|
|
5
5
|
import { Card as N, CardHeader as $, CardBody as G, Dropdown as k, DropdownToggle as O, DropdownMenu as S, NavItem as j, NavLink as U, Nav as V, DropdownItem as w } from "reactstrap";
|
|
6
6
|
import { useId as y, useState as g, useRef as x, useCallback as C, useMemo as q, Children as Q, isValidElement as Y, useEffect as W } from "react";
|
|
7
7
|
import { useNavigate as z, useLocation as J, NavLink as X } from "react-router";
|
|
8
|
-
import { u as Z, a as L } from "./use-toggle-
|
|
8
|
+
import { u as Z, a as L } from "./use-toggle-PWLikLl6.js";
|
|
9
9
|
const be = ({ className: e, children: r, loading: t = !1, type: n = "default", fullWidth: o = !1 }) => /* @__PURE__ */ s(
|
|
10
10
|
N,
|
|
11
11
|
{
|
package/dist/tailwind.d.ts
CHANGED
|
@@ -85,6 +85,13 @@ declare type CoverCardModalProps = CommonCardModalProps & {
|
|
|
85
85
|
variant: 'cover';
|
|
86
86
|
};
|
|
87
87
|
|
|
88
|
+
export declare const Details: FC<DetailsProps>;
|
|
89
|
+
|
|
90
|
+
export declare type DetailsProps = Omit<HTMLProps<HTMLDetailsElement>, 'ref'> & {
|
|
91
|
+
summary: ReactNode;
|
|
92
|
+
summaryClasses?: string;
|
|
93
|
+
};
|
|
94
|
+
|
|
88
95
|
export declare const ELLIPSIS = "...";
|
|
89
96
|
|
|
90
97
|
declare type Ellipsis = typeof ELLIPSIS;
|
package/dist/tailwind.js
CHANGED
|
@@ -1,12 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import i, { clsx as
|
|
3
|
-
import {
|
|
4
|
-
import { Link as
|
|
1
|
+
import { jsxs as g, jsx as n, Fragment as S } from "react/jsx-runtime";
|
|
2
|
+
import i, { clsx as x } from "clsx";
|
|
3
|
+
import { useRef as L, useState as D, useEffect as M, useCallback as I, createContext as $, useContext as N, forwardRef as y, useId as A, useMemo as O } from "react";
|
|
4
|
+
import { Link as j, NavLink as nt } from "react-router";
|
|
5
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
6
|
import { FontAwesomeIcon as k } from "@fortawesome/react-fontawesome";
|
|
7
|
-
import { a as it, u as wt } from "./use-toggle-
|
|
7
|
+
import { a as it, u as wt } from "./use-toggle-PWLikLl6.js";
|
|
8
8
|
import { createPortal as ct } from "react-dom";
|
|
9
|
-
const
|
|
9
|
+
const Jt = ({ children: t, summary: e, summaryClasses: r, ...o }) => {
|
|
10
|
+
const a = L(null), [d, l] = D(!1);
|
|
11
|
+
return M(() => {
|
|
12
|
+
const s = a.current, w = () => l(!!(s != null && s.open));
|
|
13
|
+
return s == null || s.addEventListener("toggle", w), () => s == null ? void 0 : s.removeEventListener("toggle", w);
|
|
14
|
+
}, []), /* @__PURE__ */ g("details", { ref: a, ...o, children: [
|
|
15
|
+
/* @__PURE__ */ n("summary", { className: x("tw:focus-ring tw:px-1 tw:-mx-1 tw:rounded-sm", r), children: e }),
|
|
16
|
+
d && /* @__PURE__ */ n("div", { className: "tw:mt-3 tw:flex tw:flex-col tw:gap-y-3", children: t })
|
|
17
|
+
] });
|
|
18
|
+
}, mt = ({ className: t, ...e }) => /* @__PURE__ */ n(
|
|
10
19
|
"div",
|
|
11
20
|
{
|
|
12
21
|
className: i(
|
|
@@ -26,7 +35,7 @@ const mt = ({ className: t, ...e }) => /* @__PURE__ */ n(
|
|
|
26
35
|
),
|
|
27
36
|
...e
|
|
28
37
|
}
|
|
29
|
-
),
|
|
38
|
+
), ut = ({ className: t, ...e }) => /* @__PURE__ */ n(
|
|
30
39
|
"div",
|
|
31
40
|
{
|
|
32
41
|
className: i(
|
|
@@ -36,7 +45,7 @@ const mt = ({ className: t, ...e }) => /* @__PURE__ */ n(
|
|
|
36
45
|
),
|
|
37
46
|
...e
|
|
38
47
|
}
|
|
39
|
-
),
|
|
48
|
+
), bt = ({ className: t, ...e }) => /* @__PURE__ */ n(
|
|
40
49
|
"div",
|
|
41
50
|
{
|
|
42
51
|
className: i(
|
|
@@ -46,19 +55,19 @@ const mt = ({ className: t, ...e }) => /* @__PURE__ */ n(
|
|
|
46
55
|
),
|
|
47
56
|
...e
|
|
48
57
|
}
|
|
49
|
-
),
|
|
58
|
+
), v = Object.assign(bt, { Body: gt, Header: mt, Footer: ut }), pt = ({ bodyClassName: t, children: e, ...r }) => {
|
|
50
59
|
const { title: o, titleSize: a = "md", ...d } = "title" in r ? r : {
|
|
51
60
|
...r,
|
|
52
61
|
title: void 0,
|
|
53
62
|
titleSize: void 0
|
|
54
63
|
};
|
|
55
|
-
return /* @__PURE__ */ g(
|
|
56
|
-
o && /* @__PURE__ */ g(
|
|
64
|
+
return /* @__PURE__ */ g(v, { ...d, children: [
|
|
65
|
+
o && /* @__PURE__ */ g(v.Header, { children: [
|
|
57
66
|
a === "lg" && /* @__PURE__ */ n("h4", { children: o }),
|
|
58
67
|
a === "md" && /* @__PURE__ */ n("h5", { children: o }),
|
|
59
68
|
a === "sm" && /* @__PURE__ */ n("h6", { children: o })
|
|
60
69
|
] }),
|
|
61
|
-
/* @__PURE__ */ n(
|
|
70
|
+
/* @__PURE__ */ n(v.Body, { className: t, children: e })
|
|
62
71
|
] });
|
|
63
72
|
};
|
|
64
73
|
function ht({
|
|
@@ -70,32 +79,32 @@ function ht({
|
|
|
70
79
|
className: d,
|
|
71
80
|
noItemsMessage: l = "No items",
|
|
72
81
|
anchor: s,
|
|
73
|
-
"aria-label":
|
|
74
|
-
...
|
|
82
|
+
"aria-label": w = "Items",
|
|
83
|
+
...u
|
|
75
84
|
}) {
|
|
76
|
-
const [
|
|
77
|
-
if (
|
|
85
|
+
const [c, b] = D(0), p = I((f) => {
|
|
86
|
+
if (b(f), o) {
|
|
78
87
|
const [m, h] = [...e.entries()][f];
|
|
79
88
|
o(m, h);
|
|
80
89
|
}
|
|
81
90
|
}, [e, o]);
|
|
82
|
-
return
|
|
91
|
+
return M(() => {
|
|
83
92
|
const f = s == null ? void 0 : s.current;
|
|
84
93
|
if (!f)
|
|
85
94
|
return;
|
|
86
95
|
const m = (h) => {
|
|
87
|
-
["Enter", "ArrowUp", "ArrowDown"].includes(h.key) && h.preventDefault(), h.key === "ArrowDown" ? p(Math.min(
|
|
96
|
+
["Enter", "ArrowUp", "ArrowDown"].includes(h.key) && h.preventDefault(), h.key === "ArrowDown" ? p(Math.min(c + 1, e.size - 1)) : h.key === "ArrowUp" ? p(Math.max(c - 1, 0)) : h.key === "Enter" && r([...e.values()][c]);
|
|
88
97
|
};
|
|
89
98
|
return f.addEventListener("keydown", m), () => f.removeEventListener("keydown", m);
|
|
90
|
-
}, [
|
|
91
|
-
|
|
99
|
+
}, [c, s, p, e, r]), /* @__PURE__ */ g(
|
|
100
|
+
v,
|
|
92
101
|
{
|
|
93
102
|
id: t,
|
|
94
103
|
className: i("tw:py-1 tw:flex tw:flex-col", d),
|
|
95
104
|
role: "listbox",
|
|
96
105
|
"aria-orientation": "vertical",
|
|
97
|
-
"aria-label":
|
|
98
|
-
...
|
|
106
|
+
"aria-label": w,
|
|
107
|
+
...u,
|
|
99
108
|
children: [
|
|
100
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: l }),
|
|
101
110
|
[...e.entries()].map(([f, m], h) => /* @__PURE__ */ n(
|
|
@@ -104,10 +113,10 @@ function ht({
|
|
|
104
113
|
id: `${t}_${f}`,
|
|
105
114
|
type: "button",
|
|
106
115
|
role: "option",
|
|
107
|
-
"aria-selected": h ===
|
|
116
|
+
"aria-selected": h === c,
|
|
108
117
|
className: i(
|
|
109
118
|
"tw:px-2 tw:py-1 tw:text-left tw:truncate",
|
|
110
|
-
{ "tw:bg-lm-secondary tw:dark:bg-dm-secondary": h ===
|
|
119
|
+
{ "tw:bg-lm-secondary tw:dark:bg-dm-secondary": h === c }
|
|
111
120
|
),
|
|
112
121
|
tabIndex: -1,
|
|
113
122
|
onClick: () => r(m),
|
|
@@ -120,9 +129,9 @@ function ht({
|
|
|
120
129
|
}
|
|
121
130
|
);
|
|
122
131
|
}
|
|
123
|
-
const
|
|
132
|
+
const E = $(void 0), T = $({ responsive: !0 }), ft = ({ children: t, className: e }) => {
|
|
124
133
|
const { responsive: r } = N(T);
|
|
125
|
-
return /* @__PURE__ */ n(
|
|
134
|
+
return /* @__PURE__ */ n(E.Provider, { value: { section: "head" }, children: /* @__PURE__ */ n(
|
|
126
135
|
"thead",
|
|
127
136
|
{
|
|
128
137
|
className: i(
|
|
@@ -134,7 +143,7 @@ const B = H(void 0), T = H({ responsive: !0 }), ft = ({ children: t, className:
|
|
|
134
143
|
) });
|
|
135
144
|
}, xt = ({ children: t, className: e }) => {
|
|
136
145
|
const { responsive: r } = N(T);
|
|
137
|
-
return /* @__PURE__ */ n(
|
|
146
|
+
return /* @__PURE__ */ n(E.Provider, { value: { section: "body" }, children: /* @__PURE__ */ n(
|
|
138
147
|
"tbody",
|
|
139
148
|
{
|
|
140
149
|
className: i(
|
|
@@ -146,7 +155,7 @@ const B = H(void 0), T = H({ responsive: !0 }), ft = ({ children: t, className:
|
|
|
146
155
|
) });
|
|
147
156
|
}, yt = ({ children: t, className: e }) => {
|
|
148
157
|
const { responsive: r } = N(T);
|
|
149
|
-
return /* @__PURE__ */ n(
|
|
158
|
+
return /* @__PURE__ */ n(E.Provider, { value: { section: "footer" }, children: /* @__PURE__ */ n(
|
|
150
159
|
"tfoot",
|
|
151
160
|
{
|
|
152
161
|
className: i(
|
|
@@ -157,7 +166,7 @@ const B = H(void 0), T = H({ responsive: !0 }), ft = ({ children: t, className:
|
|
|
157
166
|
}
|
|
158
167
|
) });
|
|
159
168
|
}, vt = ({ children: t, className: e, ...r }) => {
|
|
160
|
-
const o = N(
|
|
169
|
+
const o = N(E), a = (o == null ? void 0 : o.section) === "body", { responsive: d } = N(T);
|
|
161
170
|
return /* @__PURE__ */ n(
|
|
162
171
|
"tr",
|
|
163
172
|
{
|
|
@@ -177,7 +186,7 @@ const B = H(void 0), T = H({ responsive: !0 }), ft = ({ children: t, className:
|
|
|
177
186
|
}
|
|
178
187
|
);
|
|
179
188
|
}, kt = ({ children: t, className: e, columnName: r, type: o, ...a }) => {
|
|
180
|
-
const d = N(
|
|
189
|
+
const d = N(E), l = o ?? ((d == null ? void 0 : d.section) !== "body" ? "th" : "td"), { responsive: s } = N(T);
|
|
181
190
|
return /* @__PURE__ */ n(
|
|
182
191
|
l,
|
|
183
192
|
{
|
|
@@ -200,7 +209,7 @@ const B = H(void 0), T = H({ responsive: !0 }), ft = ({ children: t, className:
|
|
|
200
209
|
/* @__PURE__ */ n(ft, { children: t }),
|
|
201
210
|
/* @__PURE__ */ n(xt, { children: r }),
|
|
202
211
|
e && /* @__PURE__ */ n(yt, { children: e })
|
|
203
|
-
] }) }),
|
|
212
|
+
] }) }), Qt = Object.assign(Nt, { Row: vt, Cell: kt }), Pt = ({
|
|
204
213
|
children: t,
|
|
205
214
|
className: e,
|
|
206
215
|
disabled: r,
|
|
@@ -209,13 +218,13 @@ const B = H(void 0), T = H({ responsive: !0 }), ft = ({ children: t, className:
|
|
|
209
218
|
inline: d = !1,
|
|
210
219
|
solid: l = !1,
|
|
211
220
|
type: s = "button",
|
|
212
|
-
...
|
|
221
|
+
...w
|
|
213
222
|
}) => {
|
|
214
|
-
const
|
|
223
|
+
const u = "to" in w ? j : "button", c = u === j ? void 0 : s;
|
|
215
224
|
return (
|
|
216
225
|
// @ts-expect-error We are explicitly checking for the `to` prop before using Link
|
|
217
226
|
/* @__PURE__ */ n(
|
|
218
|
-
|
|
227
|
+
u,
|
|
219
228
|
{
|
|
220
229
|
className: i(
|
|
221
230
|
{
|
|
@@ -226,7 +235,8 @@ const B = H(void 0), T = H({ responsive: !0 }), ft = ({ children: t, className:
|
|
|
226
235
|
"tw:border tw:rounded-md tw:no-underline",
|
|
227
236
|
"tw:transition-colors",
|
|
228
237
|
{
|
|
229
|
-
"tw:focus-ring": o
|
|
238
|
+
"tw:focus-ring": o === "primary",
|
|
239
|
+
"tw:focus-ring-secondary": o === "secondary",
|
|
230
240
|
"tw:focus-ring-danger": o === "danger"
|
|
231
241
|
},
|
|
232
242
|
{
|
|
@@ -262,21 +272,21 @@ const B = H(void 0), T = H({ responsive: !0 }), ft = ({ children: t, className:
|
|
|
262
272
|
e
|
|
263
273
|
),
|
|
264
274
|
disabled: r,
|
|
265
|
-
type:
|
|
266
|
-
...
|
|
275
|
+
type: c,
|
|
276
|
+
...w,
|
|
267
277
|
children: t
|
|
268
278
|
}
|
|
269
279
|
)
|
|
270
280
|
);
|
|
271
|
-
}, X =
|
|
281
|
+
}, X = y(({ className: t, onChange: e, ...r }, o) => {
|
|
272
282
|
const a = I((d) => e == null ? void 0 : e(d.target.checked, d), [e]);
|
|
273
283
|
return /* @__PURE__ */ n(
|
|
274
284
|
"input",
|
|
275
285
|
{
|
|
276
286
|
ref: o,
|
|
277
287
|
type: "checkbox",
|
|
278
|
-
className:
|
|
279
|
-
"tw:appearance-none tw:focus-ring",
|
|
288
|
+
className: x(
|
|
289
|
+
"tw:appearance-none tw:focus-ring tw:cursor-[inherit]",
|
|
280
290
|
"tw:border-1 tw:border-lm-input-border tw:dark:border-dm-input-border",
|
|
281
291
|
"tw:bg-lm-primary tw:dark:bg-dm-primary tw:checked:bg-brand tw:bg-no-repeat",
|
|
282
292
|
// Use different background color when rendered inside a card
|
|
@@ -287,11 +297,11 @@ const B = H(void 0), T = H({ responsive: !0 }), ft = ({ children: t, className:
|
|
|
287
297
|
...r
|
|
288
298
|
}
|
|
289
299
|
);
|
|
290
|
-
}),
|
|
300
|
+
}), Vt = y(({ className: t, ...e }, r) => /* @__PURE__ */ n(
|
|
291
301
|
X,
|
|
292
302
|
{
|
|
293
303
|
ref: r,
|
|
294
|
-
className:
|
|
304
|
+
className: x("tw:rounded-sm tw:w-4 tw:h-4 tw:checked:bg-(image:--tick) tw:bg-center", t),
|
|
295
305
|
...e
|
|
296
306
|
}
|
|
297
307
|
)), J = ({ onClick: t, label: e = "Close" }) => /* @__PURE__ */ n(
|
|
@@ -306,7 +316,7 @@ const B = H(void 0), T = H({ responsive: !0 }), ft = ({ children: t, className:
|
|
|
306
316
|
"aria-label": e,
|
|
307
317
|
children: /* @__PURE__ */ n(k, { icon: at, size: "xl" })
|
|
308
318
|
}
|
|
309
|
-
), U =
|
|
319
|
+
), U = y(({
|
|
310
320
|
borderless: t = !1,
|
|
311
321
|
size: e = "md",
|
|
312
322
|
feedback: r,
|
|
@@ -315,7 +325,7 @@ const B = H(void 0), T = H({ responsive: !0 }), ft = ({ children: t, className:
|
|
|
315
325
|
readOnly: d,
|
|
316
326
|
...l
|
|
317
327
|
}, s) => {
|
|
318
|
-
const
|
|
328
|
+
const w = !a && !d;
|
|
319
329
|
return /* @__PURE__ */ n(
|
|
320
330
|
"input",
|
|
321
331
|
{
|
|
@@ -335,10 +345,10 @@ const B = H(void 0), T = H({ responsive: !0 }), ft = ({ children: t, className:
|
|
|
335
345
|
"tw:rounded-md tw:border": !t,
|
|
336
346
|
"tw:border-lm-input-border tw:dark:border-dm-input-border": !t && !r,
|
|
337
347
|
"tw:border-danger": !t && r === "error",
|
|
338
|
-
"tw:bg-lm-disabled-input tw:dark:bg-dm-disabled-input": !
|
|
339
|
-
"tw:bg-lm-primary tw:dark:bg-dm-primary":
|
|
348
|
+
"tw:bg-lm-disabled-input tw:dark:bg-dm-disabled-input": !w,
|
|
349
|
+
"tw:bg-lm-primary tw:dark:bg-dm-primary": w,
|
|
340
350
|
// Use different background color when rendered inside a card
|
|
341
|
-
"tw:group-[&]/card:bg-lm-input tw:group-[&]/card:dark:bg-dm-input":
|
|
351
|
+
"tw:group-[&]/card:bg-lm-input tw:group-[&]/card:dark:bg-dm-input": w
|
|
342
352
|
},
|
|
343
353
|
o
|
|
344
354
|
),
|
|
@@ -347,10 +357,10 @@ const B = H(void 0), T = H({ responsive: !0 }), ft = ({ children: t, className:
|
|
|
347
357
|
...l
|
|
348
358
|
}
|
|
349
359
|
);
|
|
350
|
-
}), K = ({ required: t, children: e,
|
|
360
|
+
}), K = ({ required: t, children: e, className: r, ...o }) => /* @__PURE__ */ g("label", { className: x("tw:cursor-pointer", r), ...o, children: [
|
|
351
361
|
e,
|
|
352
362
|
t && /* @__PURE__ */ n("span", { className: "tw:text-danger tw:ml-1", "data-testid": "required-indicator", children: "*" })
|
|
353
|
-
] }),
|
|
363
|
+
] }), Xt = y(({ label: t, inputClassName: e, required: r, hiddenRequired: o, error: a, ...d }, l) => {
|
|
354
364
|
const s = A();
|
|
355
365
|
return /* @__PURE__ */ g("div", { className: "tw:flex tw:flex-col tw:gap-1", children: [
|
|
356
366
|
/* @__PURE__ */ n(K, { htmlFor: s, required: r, children: t }),
|
|
@@ -367,24 +377,24 @@ const B = H(void 0), T = H({ responsive: !0 }), ft = ({ children: t, className:
|
|
|
367
377
|
),
|
|
368
378
|
a && /* @__PURE__ */ n("span", { className: "tw:text-danger", children: a })
|
|
369
379
|
] });
|
|
370
|
-
}), It =
|
|
371
|
-
const [d, l, , s] = it(!1),
|
|
372
|
-
var
|
|
373
|
-
(
|
|
374
|
-
}, [
|
|
380
|
+
}), It = y(({ containerClassName: t, className: e, size: r, ...o }, a) => {
|
|
381
|
+
const [d, l, , s] = it(!1), w = L(null), u = I(({ relatedTarget: c }) => {
|
|
382
|
+
var b;
|
|
383
|
+
(b = w.current) != null && b.contains(c) || s();
|
|
384
|
+
}, [w, s]);
|
|
375
385
|
return /* @__PURE__ */ g(
|
|
376
386
|
"div",
|
|
377
387
|
{
|
|
378
|
-
className:
|
|
379
|
-
ref:
|
|
380
|
-
onBlurCapture:
|
|
388
|
+
className: x("tw:group tw:relative", t),
|
|
389
|
+
ref: w,
|
|
390
|
+
onBlurCapture: u,
|
|
381
391
|
children: [
|
|
382
392
|
/* @__PURE__ */ n(
|
|
383
393
|
U,
|
|
384
394
|
{
|
|
385
395
|
ref: a,
|
|
386
396
|
type: d ? "text" : "password",
|
|
387
|
-
className:
|
|
397
|
+
className: x(
|
|
388
398
|
{
|
|
389
399
|
"tw:pr-10": r !== "sm",
|
|
390
400
|
"tw:pr-8": r === "sm"
|
|
@@ -403,7 +413,7 @@ const B = H(void 0), T = H({ responsive: !0 }), ft = ({ children: t, className:
|
|
|
403
413
|
onClick: l,
|
|
404
414
|
title: d ? "Hide password" : "Show password",
|
|
405
415
|
"aria-label": d ? "Hide password" : "Show password",
|
|
406
|
-
className:
|
|
416
|
+
className: x(
|
|
407
417
|
"tw:absolute tw:top-[50%] tw:translate-y-[-50%] tw:px-1",
|
|
408
418
|
"tw:text-placeholder tw:hover:text-lm-text tw:hover:dark:text-dm-text tw:transition-colors",
|
|
409
419
|
{
|
|
@@ -418,7 +428,7 @@ const B = H(void 0), T = H({ responsive: !0 }), ft = ({ children: t, className:
|
|
|
418
428
|
]
|
|
419
429
|
}
|
|
420
430
|
);
|
|
421
|
-
}),
|
|
431
|
+
}), Yt = y(({ label: t, inputClassName: e, required: r, hiddenRequired: o, error: a, ...d }, l) => {
|
|
422
432
|
const s = A();
|
|
423
433
|
return /* @__PURE__ */ g("div", { className: "tw:flex tw:flex-col tw:gap-1", children: [
|
|
424
434
|
/* @__PURE__ */ n(K, { htmlFor: s, required: r, children: t }),
|
|
@@ -435,7 +445,7 @@ const B = H(void 0), T = H({ responsive: !0 }), ft = ({ children: t, className:
|
|
|
435
445
|
),
|
|
436
446
|
a && /* @__PURE__ */ n("span", { className: "tw:text-danger", children: a })
|
|
437
447
|
] });
|
|
438
|
-
}), Ct =
|
|
448
|
+
}), Ct = y(({
|
|
439
449
|
className: t,
|
|
440
450
|
size: e = "md",
|
|
441
451
|
feedback: r,
|
|
@@ -475,13 +485,13 @@ const B = H(void 0), T = H({ responsive: !0 }), ft = ({ children: t, className:
|
|
|
475
485
|
disabled: a,
|
|
476
486
|
...d
|
|
477
487
|
}
|
|
478
|
-
)),
|
|
488
|
+
)), Zt = y(({ selectClassName: t, label: e, required: r, hiddenRequired: o, ...a }, d) => {
|
|
479
489
|
const l = A();
|
|
480
490
|
return /* @__PURE__ */ g("div", { className: "tw:flex tw:flex-col tw:gap-1", children: [
|
|
481
491
|
/* @__PURE__ */ n(K, { htmlFor: l, required: r, children: e }),
|
|
482
492
|
/* @__PURE__ */ n(Ct, { ref: d, id: l, className: t, required: r || o, ...a })
|
|
483
493
|
] });
|
|
484
|
-
}),
|
|
494
|
+
}), Lt = y(({
|
|
485
495
|
onChange: t,
|
|
486
496
|
containerClassName: e,
|
|
487
497
|
inputClassName: r,
|
|
@@ -490,9 +500,9 @@ const B = H(void 0), T = H({ responsive: !0 }), ft = ({ children: t, className:
|
|
|
490
500
|
loading: a = !1,
|
|
491
501
|
...d
|
|
492
502
|
}, l) => {
|
|
493
|
-
const { setTimeout: s, clearCurrentTimeout:
|
|
494
|
-
|
|
495
|
-
}, [
|
|
503
|
+
const { setTimeout: s, clearCurrentTimeout: w } = wt(500), u = I((c) => {
|
|
504
|
+
c ? s(() => t(c)) : (w(), t(c));
|
|
505
|
+
}, [w, t, s]);
|
|
496
506
|
return /* @__PURE__ */ g("div", { className: i("tw:group tw:relative tw:focus-within:z-10", e), children: [
|
|
497
507
|
/* @__PURE__ */ n(
|
|
498
508
|
k,
|
|
@@ -522,14 +532,14 @@ const B = H(void 0), T = H({ responsive: !0 }), ft = ({ children: t, className:
|
|
|
522
532
|
r
|
|
523
533
|
),
|
|
524
534
|
placeholder: "Search...",
|
|
525
|
-
onChange: (
|
|
535
|
+
onChange: (c) => u(c.target.value),
|
|
526
536
|
size: o,
|
|
527
537
|
...d
|
|
528
538
|
}
|
|
529
539
|
)
|
|
530
540
|
] });
|
|
531
541
|
});
|
|
532
|
-
function
|
|
542
|
+
function te({
|
|
533
543
|
searchResults: t,
|
|
534
544
|
onSearch: e,
|
|
535
545
|
onSelectSearchResult: r,
|
|
@@ -540,11 +550,11 @@ function Zt({
|
|
|
540
550
|
onFocus: l,
|
|
541
551
|
...s
|
|
542
552
|
}) {
|
|
543
|
-
const
|
|
544
|
-
() => t ?
|
|
545
|
-
[
|
|
553
|
+
const w = L(null), u = A(), [c, b] = D(), p = O(
|
|
554
|
+
() => t ? c ?? [...t.keys()][0] : void 0,
|
|
555
|
+
[c, t]
|
|
546
556
|
), f = I((m) => {
|
|
547
|
-
r(m), e(""),
|
|
557
|
+
r(m), e(""), w.current.value = "";
|
|
548
558
|
}, [e, r]);
|
|
549
559
|
return /* @__PURE__ */ g(
|
|
550
560
|
"div",
|
|
@@ -555,16 +565,16 @@ function Zt({
|
|
|
555
565
|
},
|
|
556
566
|
children: [
|
|
557
567
|
/* @__PURE__ */ n(
|
|
558
|
-
|
|
568
|
+
Lt,
|
|
559
569
|
{
|
|
560
570
|
onChange: e,
|
|
561
571
|
size: a,
|
|
562
|
-
ref:
|
|
572
|
+
ref: w,
|
|
563
573
|
role: "combobox",
|
|
564
574
|
"aria-autocomplete": "list",
|
|
565
575
|
"aria-expanded": !!t,
|
|
566
|
-
"aria-controls":
|
|
567
|
-
"aria-activedescendant": p ? `${
|
|
576
|
+
"aria-controls": u,
|
|
577
|
+
"aria-activedescendant": p ? `${u}_${p}` : void 0,
|
|
568
578
|
autoComplete: "off",
|
|
569
579
|
autoCorrect: "off",
|
|
570
580
|
onFocus: (m) => {
|
|
@@ -576,11 +586,11 @@ function Zt({
|
|
|
576
586
|
t && /* @__PURE__ */ n(
|
|
577
587
|
ht,
|
|
578
588
|
{
|
|
579
|
-
id:
|
|
589
|
+
id: u,
|
|
580
590
|
items: t,
|
|
581
|
-
anchor:
|
|
591
|
+
anchor: w,
|
|
582
592
|
onSelectItem: f,
|
|
583
|
-
onActiveItemChange:
|
|
593
|
+
onActiveItemChange: b,
|
|
584
594
|
renderItem: o,
|
|
585
595
|
className: i(
|
|
586
596
|
"tw:absolute tw:top-full tw:mt-1 tw:z-10",
|
|
@@ -597,11 +607,11 @@ function Zt({
|
|
|
597
607
|
}
|
|
598
608
|
);
|
|
599
609
|
}
|
|
600
|
-
const
|
|
610
|
+
const ee = y(({ className: t, ...e }, r) => /* @__PURE__ */ n(
|
|
601
611
|
X,
|
|
602
612
|
{
|
|
603
613
|
ref: r,
|
|
604
|
-
className:
|
|
614
|
+
className: x(
|
|
605
615
|
"tw:rounded-full tw:w-8 tw:h-4",
|
|
606
616
|
"tw:bg-(image:--circle-grey-dark) tw:dark:bg-(image:--circle-grey-light) tw:checked:bg-(image:--circle-white)",
|
|
607
617
|
"tw:focus-visible:not-checked:bg-(image:--circle-light-blue)",
|
|
@@ -610,7 +620,7 @@ const te = x(({ className: t, ...e }, r) => /* @__PURE__ */ n(
|
|
|
610
620
|
),
|
|
611
621
|
...e
|
|
612
622
|
}
|
|
613
|
-
)),
|
|
623
|
+
)), Tt = ({ className: t, disabled: e, size: r = "md", type: o = "button", ...a }) => /* @__PURE__ */ n(
|
|
614
624
|
"button",
|
|
615
625
|
{
|
|
616
626
|
className: i(
|
|
@@ -628,7 +638,7 @@ const te = x(({ className: t, ...e }, r) => /* @__PURE__ */ n(
|
|
|
628
638
|
type: o,
|
|
629
639
|
...a
|
|
630
640
|
}
|
|
631
|
-
), Y =
|
|
641
|
+
), Y = $(null), Bt = ({ className: t, to: e, ...r }) => {
|
|
632
642
|
const o = N(Y);
|
|
633
643
|
return /* @__PURE__ */ n(
|
|
634
644
|
nt,
|
|
@@ -649,13 +659,13 @@ const te = x(({ className: t, ...e }, r) => /* @__PURE__ */ n(
|
|
|
649
659
|
...r
|
|
650
660
|
}
|
|
651
661
|
);
|
|
652
|
-
},
|
|
662
|
+
}, Mt = ({ children: t, className: e, fill: r }) => /* @__PURE__ */ n(Y.Provider, { value: { fill: r }, children: /* @__PURE__ */ n(v, { role: "menubar", className: i("tw:flex tw:overflow-hidden", e), children: t }) }), re = Object.assign(Mt, { Pill: Bt }), Et = new Intl.NumberFormat("en-US"), _t = (t) => Et.format(Number(t)), Q = 10, oe = (t) => Math.ceil(t / Q) * Q, C = 2, R = "...", Rt = (t, e) => Array.from({ length: e - t }, (r, o) => t + o), Dt = (t, e) => {
|
|
653
663
|
const r = Rt(
|
|
654
664
|
Math.max(C, t - C),
|
|
655
665
|
Math.min(e - 1, t + C) + 1
|
|
656
666
|
);
|
|
657
667
|
return t - C > C && r.unshift(R), t + C < e - 1 && r.push(R), r.unshift(1), r.push(e), r;
|
|
658
|
-
},
|
|
668
|
+
}, B = (t) => t === R, At = (t) => B(t) ? t : _t(t), Ft = (t, e) => B(t) ? `${t}_${e}` : `${t}`, Z = [
|
|
659
669
|
"tw:border tw:border-r-0 tw:last:border-r tw:border-lm-border tw:dark:border-dm-border",
|
|
660
670
|
"tw:rounded-none tw:first:rounded-l tw:last:rounded-r"
|
|
661
671
|
], tt = (t = !1) => i(
|
|
@@ -666,52 +676,52 @@ const te = x(({ className: t, ...e }, r) => /* @__PURE__ */ n(
|
|
|
666
676
|
"tw:highlight:bg-lm-secondary tw:dark:highlight:bg-dm-secondary tw:text-brand": !t,
|
|
667
677
|
"tw:bg-lm-brand tw:dark:bg-dm-brand tw:text-white": t
|
|
668
678
|
}
|
|
669
|
-
),
|
|
679
|
+
), H = ({ 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(H, { children: R });
|
|
670
680
|
function St({ children: t, active: e, isEllipsis: r, href: o, ...a }) {
|
|
671
681
|
const d = O(() => tt(e), [e]);
|
|
672
|
-
return r ? /* @__PURE__ */ n(et, {}) : /* @__PURE__ */ n(
|
|
682
|
+
return r ? /* @__PURE__ */ n(et, {}) : /* @__PURE__ */ n(j, { className: d, to: o, ...a, children: t });
|
|
673
683
|
}
|
|
674
684
|
function jt({ children: t, active: e, isEllipsis: r, ...o }) {
|
|
675
685
|
const a = O(() => tt(e), [e]);
|
|
676
686
|
return r ? /* @__PURE__ */ n(et, {}) : /* @__PURE__ */ n("button", { type: "button", className: a, ...o, children: t });
|
|
677
687
|
}
|
|
678
|
-
const
|
|
688
|
+
const ne = ({ currentPage: t, pagesCount: e, ...r }) => {
|
|
679
689
|
const o = "urlForPage" in r, a = o ? St : jt, d = I(
|
|
680
|
-
(l) => o ? { href:
|
|
690
|
+
(l) => o ? { href: B(l) ? void 0 : r.urlForPage(l) } : { onClick: () => !B(l) && r.onPageChange(l) },
|
|
681
691
|
[o, r]
|
|
682
692
|
);
|
|
683
693
|
return e < 2 ? null : /* @__PURE__ */ g("div", { className: "tw:select-none tw:flex", "data-testid": "paginator", children: [
|
|
684
|
-
t === 1 ? /* @__PURE__ */ n(
|
|
685
|
-
|
|
694
|
+
t === 1 ? /* @__PURE__ */ n(H, { 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 }) }),
|
|
695
|
+
Dt(t, e).map((l, s) => /* @__PURE__ */ n(
|
|
686
696
|
a,
|
|
687
697
|
{
|
|
688
698
|
active: l === t,
|
|
689
|
-
isEllipsis:
|
|
699
|
+
isEllipsis: B(l),
|
|
690
700
|
...d(l),
|
|
691
|
-
children:
|
|
701
|
+
children: At(l)
|
|
692
702
|
},
|
|
693
703
|
Ft(l, s)
|
|
694
704
|
)),
|
|
695
|
-
t === e ? /* @__PURE__ */ n(
|
|
705
|
+
t === e ? /* @__PURE__ */ n(H, { 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 }) })
|
|
696
706
|
] });
|
|
697
|
-
},
|
|
707
|
+
}, Ht = ({
|
|
698
708
|
open: t,
|
|
699
709
|
children: e,
|
|
700
710
|
className: r,
|
|
701
711
|
onClose: o,
|
|
702
712
|
...a
|
|
703
713
|
}) => {
|
|
704
|
-
const d =
|
|
705
|
-
return
|
|
706
|
-
var
|
|
707
|
-
const l = document.body, s = l.style.overflow,
|
|
714
|
+
const d = L(null);
|
|
715
|
+
return M(() => {
|
|
716
|
+
var u, c;
|
|
717
|
+
const l = document.body, s = l.style.overflow, w = l.style.paddingRight;
|
|
708
718
|
if (t) {
|
|
709
|
-
const
|
|
710
|
-
l.style.overflow = "hidden", p && (l.style.paddingRight = `${
|
|
719
|
+
const b = window.outerWidth - l.clientWidth, p = l.scrollHeight > l.clientHeight;
|
|
720
|
+
l.style.overflow = "hidden", p && (l.style.paddingRight = `${b}px`), (u = d.current) == null || u.showModal();
|
|
711
721
|
} else
|
|
712
|
-
(
|
|
722
|
+
(c = d.current) == null || c.close();
|
|
713
723
|
return () => {
|
|
714
|
-
l.style.overflow = s, l.style.paddingRight =
|
|
724
|
+
l.style.overflow = s, l.style.paddingRight = w;
|
|
715
725
|
};
|
|
716
726
|
}, [t]), ct(
|
|
717
727
|
/* @__PURE__ */ n(
|
|
@@ -728,7 +738,7 @@ const oe = ({ currentPage: t, pagesCount: e, ...r }) => {
|
|
|
728
738
|
),
|
|
729
739
|
document.body
|
|
730
740
|
);
|
|
731
|
-
},
|
|
741
|
+
}, ae = ({
|
|
732
742
|
open: t,
|
|
733
743
|
onClose: e,
|
|
734
744
|
variant: r = "default",
|
|
@@ -739,36 +749,36 @@ const oe = ({ currentPage: t, pagesCount: e, ...r }) => {
|
|
|
739
749
|
}) => {
|
|
740
750
|
const {
|
|
741
751
|
size: s = "md",
|
|
742
|
-
confirmText:
|
|
743
|
-
cancelText:
|
|
744
|
-
confirmDisabled:
|
|
745
|
-
onConfirm:
|
|
752
|
+
confirmText: w = "Confirm",
|
|
753
|
+
cancelText: u = "Cancel",
|
|
754
|
+
confirmDisabled: c,
|
|
755
|
+
onConfirm: b,
|
|
746
756
|
onClosed: p,
|
|
747
757
|
...f
|
|
748
|
-
} = "onConfirm" in l ? l : { ...l }, [m, h] =
|
|
749
|
-
|
|
750
|
-
}, [
|
|
751
|
-
return
|
|
758
|
+
} = "onConfirm" in l ? l : { ...l }, [m, h] = D(t), _ = L(null), F = L("cancel"), rt = I(() => {
|
|
759
|
+
F.current = "confirm", b == null || b();
|
|
760
|
+
}, [b]);
|
|
761
|
+
return M(() => {
|
|
752
762
|
if (t) {
|
|
753
|
-
|
|
763
|
+
F.current = "cancel", h(!0);
|
|
754
764
|
return;
|
|
755
765
|
}
|
|
756
|
-
const P =
|
|
766
|
+
const P = _.current;
|
|
757
767
|
if (P) {
|
|
758
|
-
delete
|
|
768
|
+
delete _.current.dataset.open;
|
|
759
769
|
let W = !1;
|
|
760
770
|
const q = (ot) => {
|
|
761
|
-
W || ot.target !== P || (W = !0, h(!1), p == null || p(
|
|
771
|
+
W || ot.target !== P || (W = !0, h(!1), p == null || p(F.current));
|
|
762
772
|
};
|
|
763
773
|
return P.addEventListener("transitionend", q), () => {
|
|
764
774
|
P.removeEventListener("transitionend", q);
|
|
765
775
|
};
|
|
766
776
|
}
|
|
767
|
-
}, [p, t]),
|
|
768
|
-
const P =
|
|
777
|
+
}, [p, t]), M(() => {
|
|
778
|
+
const P = _.current;
|
|
769
779
|
m && P && (P.dataset.open = "");
|
|
770
780
|
}, [m]), /* @__PURE__ */ n(
|
|
771
|
-
|
|
781
|
+
Ht,
|
|
772
782
|
{
|
|
773
783
|
open: m,
|
|
774
784
|
onClose: e,
|
|
@@ -784,7 +794,7 @@ const oe = ({ currentPage: t, pagesCount: e, ...r }) => {
|
|
|
784
794
|
"div",
|
|
785
795
|
{
|
|
786
796
|
"data-testid": "transition-container",
|
|
787
|
-
ref:
|
|
797
|
+
ref: _,
|
|
788
798
|
className: i(
|
|
789
799
|
"tw:w-full tw:m-auto tw:p-4 tw:sm:p-6",
|
|
790
800
|
// CSS transitions are based on the presence of the `data-open` attribute
|
|
@@ -799,10 +809,10 @@ const oe = ({ currentPage: t, pagesCount: e, ...r }) => {
|
|
|
799
809
|
},
|
|
800
810
|
{ "tw:h-full": r === "cover" }
|
|
801
811
|
),
|
|
802
|
-
children: /* @__PURE__ */ n(
|
|
812
|
+
children: /* @__PURE__ */ n(v, { className: i(
|
|
803
813
|
"tw:w-full",
|
|
804
814
|
{ "tw:h-full tw:relative tw:overflow-auto": r === "cover" }
|
|
805
|
-
), children: r === "cover" ? /* @__PURE__ */ g(
|
|
815
|
+
), children: r === "cover" ? /* @__PURE__ */ g(S, { children: [
|
|
806
816
|
/* @__PURE__ */ g(
|
|
807
817
|
"div",
|
|
808
818
|
{
|
|
@@ -819,17 +829,17 @@ const oe = ({ currentPage: t, pagesCount: e, ...r }) => {
|
|
|
819
829
|
}
|
|
820
830
|
),
|
|
821
831
|
/* @__PURE__ */ n("div", { children: a })
|
|
822
|
-
] }) : /* @__PURE__ */ g(
|
|
823
|
-
/* @__PURE__ */ g(
|
|
832
|
+
] }) : /* @__PURE__ */ g(S, { children: [
|
|
833
|
+
/* @__PURE__ */ g(v.Header, { className: i(
|
|
824
834
|
"tw:sticky tw:top-0",
|
|
825
835
|
"tw:flex tw:items-center tw:justify-between tw:gap-x-2"
|
|
826
836
|
), children: [
|
|
827
837
|
/* @__PURE__ */ n("h5", { className: i({ "tw:text-danger": r === "danger" }), children: o }),
|
|
828
838
|
/* @__PURE__ */ n(J, { onClick: e, label: "Close dialog" })
|
|
829
839
|
] }),
|
|
830
|
-
/* @__PURE__ */ n(
|
|
831
|
-
|
|
832
|
-
|
|
840
|
+
/* @__PURE__ */ n(v.Body, { children: a }),
|
|
841
|
+
b && /* @__PURE__ */ g(
|
|
842
|
+
v.Footer,
|
|
833
843
|
{
|
|
834
844
|
"data-testid": "footer",
|
|
835
845
|
className: i(
|
|
@@ -837,15 +847,15 @@ const oe = ({ currentPage: t, pagesCount: e, ...r }) => {
|
|
|
837
847
|
"tw:[&]:px-3 tw:sticky tw:bottom-0"
|
|
838
848
|
),
|
|
839
849
|
children: [
|
|
840
|
-
/* @__PURE__ */ n(
|
|
850
|
+
/* @__PURE__ */ n(Tt, { onClick: e, children: u }),
|
|
841
851
|
/* @__PURE__ */ n(
|
|
842
852
|
Pt,
|
|
843
853
|
{
|
|
844
854
|
solid: !0,
|
|
845
855
|
variant: r === "danger" ? "danger" : "primary",
|
|
846
|
-
disabled:
|
|
856
|
+
disabled: c,
|
|
847
857
|
onClick: rt,
|
|
848
|
-
children:
|
|
858
|
+
children: w
|
|
849
859
|
}
|
|
850
860
|
)
|
|
851
861
|
]
|
|
@@ -856,19 +866,19 @@ const oe = ({ currentPage: t, pagesCount: e, ...r }) => {
|
|
|
856
866
|
)
|
|
857
867
|
}
|
|
858
868
|
);
|
|
859
|
-
},
|
|
869
|
+
}, le = ({ className: t, children: e, loading: r = !1, variant: o = "default" }) => /* @__PURE__ */ n(pt, { className: x({ "tw:[&]:border-danger": o === "error" }, t), children: /* @__PURE__ */ g("h3", { className: x("tw:text-center", {
|
|
860
870
|
"tw:text-gray-500 tw:dark:text-gray-400": o === "default",
|
|
861
871
|
"tw:text-danger": o === "error"
|
|
862
872
|
}), children: [
|
|
863
|
-
r && /* @__PURE__ */ g(
|
|
873
|
+
r && /* @__PURE__ */ g(S, { children: [
|
|
864
874
|
/* @__PURE__ */ n(k, { icon: V, spin: !0 }),
|
|
865
875
|
/* @__PURE__ */ n("span", { className: "tw:ml-2", children: e ?? "Loading..." })
|
|
866
876
|
] }),
|
|
867
877
|
!r && e
|
|
868
|
-
] }) }),
|
|
878
|
+
] }) }), de = ({ variant: t, className: e, size: r = "md", children: o }) => /* @__PURE__ */ n(
|
|
869
879
|
"div",
|
|
870
880
|
{
|
|
871
|
-
className:
|
|
881
|
+
className: x(
|
|
872
882
|
"tw:rounded-md tw:text-center",
|
|
873
883
|
{
|
|
874
884
|
"tw:p-2": r === "sm",
|
|
@@ -886,34 +896,35 @@ const oe = ({ currentPage: t, pagesCount: e, ...r }) => {
|
|
|
886
896
|
);
|
|
887
897
|
export {
|
|
888
898
|
Pt as Button,
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
899
|
+
v as Card,
|
|
900
|
+
ae as CardModal,
|
|
901
|
+
Vt as Checkbox,
|
|
892
902
|
J as CloseButton,
|
|
903
|
+
Jt as Details,
|
|
893
904
|
R as ELLIPSIS,
|
|
894
905
|
U as Input,
|
|
895
906
|
K as Label,
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
907
|
+
Xt as LabelledInput,
|
|
908
|
+
Yt as LabelledRevealablePasswordInput,
|
|
909
|
+
Zt as LabelledSelect,
|
|
910
|
+
Tt as LinkButton,
|
|
900
911
|
ht as Listbox,
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
912
|
+
le as Message,
|
|
913
|
+
Ht as ModalDialog,
|
|
914
|
+
re as NavPills,
|
|
915
|
+
ne as Paginator,
|
|
916
|
+
de as Result,
|
|
906
917
|
It as RevealablePasswordInput,
|
|
907
|
-
|
|
908
|
-
|
|
918
|
+
te as SearchCombobox,
|
|
919
|
+
Lt as SearchInput,
|
|
909
920
|
Ct as Select,
|
|
910
921
|
pt as SimpleCard,
|
|
911
|
-
|
|
912
|
-
|
|
922
|
+
Qt as Table,
|
|
923
|
+
ee as ToggleSwitch,
|
|
913
924
|
_t as formatNumber,
|
|
914
925
|
Ft as keyForPage,
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
926
|
+
B as pageIsEllipsis,
|
|
927
|
+
At as prettifyPageNumber,
|
|
928
|
+
Dt as progressivePagination,
|
|
929
|
+
oe as roundTen
|
|
919
930
|
};
|
package/dist/tailwind.preset.css
CHANGED
|
@@ -143,6 +143,10 @@
|
|
|
143
143
|
p {
|
|
144
144
|
@apply tw:m-0;
|
|
145
145
|
}
|
|
146
|
+
|
|
147
|
+
code {
|
|
148
|
+
@apply tw:text-sm tw:text-pink-600 tw:dark:text-pink-500 tw:font-mono;
|
|
149
|
+
}
|
|
146
150
|
}
|
|
147
151
|
|
|
148
152
|
@utility focus-ring-base {
|
|
@@ -157,6 +161,10 @@
|
|
|
157
161
|
@apply tw:focus-ring-base tw:focus-visible:ring-danger/50;
|
|
158
162
|
}
|
|
159
163
|
|
|
164
|
+
@utility focus-ring-secondary {
|
|
165
|
+
@apply tw:focus-ring-base tw:focus-visible:ring-zinc-500/50;
|
|
166
|
+
}
|
|
167
|
+
|
|
160
168
|
@utility scroll-thin {
|
|
161
169
|
/* Standard. New browsers */
|
|
162
170
|
scrollbar-width: thin;
|
|
@@ -172,7 +180,7 @@
|
|
|
172
180
|
|
|
173
181
|
@custom-variant highlight {
|
|
174
182
|
&:hover,
|
|
175
|
-
&:focus {
|
|
183
|
+
&:focus-visible {
|
|
176
184
|
@slot;
|
|
177
185
|
}
|
|
178
186
|
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { useRef as a, useCallback as o, useEffect as f, useMemo as i, useState as T } from "react";
|
|
2
|
+
function m(n, r = globalThis.setTimeout, s = globalThis.clearTimeout) {
|
|
3
|
+
const t = a(null), e = o(() => {
|
|
4
|
+
t.current && s(t.current);
|
|
5
|
+
}, [s]), u = o((l, c) => {
|
|
6
|
+
e(), t.current = r(() => {
|
|
7
|
+
l(), t.current = null;
|
|
8
|
+
}, c ?? n);
|
|
9
|
+
}, [e, n, r]);
|
|
10
|
+
return f(() => e, [e]), i(
|
|
11
|
+
() => ({ setTimeout: u, clearCurrentTimeout: e }),
|
|
12
|
+
[e, u]
|
|
13
|
+
);
|
|
14
|
+
}
|
|
15
|
+
function b(n = !1, r = !1) {
|
|
16
|
+
const [s, t] = T(n), e = o(() => t((c) => !c), []), u = o(() => t(!0), []), l = o(() => t(!1), []);
|
|
17
|
+
return r ? { flag: s, toggle: e, setToTrue: u, setToFalse: l } : [s, e, u, l];
|
|
18
|
+
}
|
|
19
|
+
export {
|
|
20
|
+
b as a,
|
|
21
|
+
m as u
|
|
22
|
+
};
|
package/package.json
CHANGED
|
@@ -55,32 +55,32 @@
|
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@shlinkio/eslint-config-js-coding-standard": "~3.5.0",
|
|
57
57
|
"@stylistic/eslint-plugin": "^4.2.0",
|
|
58
|
-
"@tailwindcss/vite": "^4.1.
|
|
58
|
+
"@tailwindcss/vite": "^4.1.4",
|
|
59
59
|
"@testing-library/jest-dom": "^6.6.3",
|
|
60
60
|
"@testing-library/react": "^16.3.0",
|
|
61
61
|
"@testing-library/user-event": "^14.6.1",
|
|
62
62
|
"@total-typescript/shoehorn": "^0.1.2",
|
|
63
|
-
"@types/react": "^19.1.
|
|
64
|
-
"@types/react-dom": "^19.1.
|
|
63
|
+
"@types/react": "^19.1.2",
|
|
64
|
+
"@types/react-dom": "^19.1.2",
|
|
65
65
|
"@vitejs/plugin-react": "^4.3.4",
|
|
66
66
|
"@vitest/browser": "^3.1.1",
|
|
67
67
|
"@vitest/coverage-v8": "^3.1.1",
|
|
68
68
|
"axe-core": "^4.10.3",
|
|
69
69
|
"bootstrap": "5.2.3",
|
|
70
|
-
"eslint": "^9.
|
|
70
|
+
"eslint": "^9.25.0",
|
|
71
71
|
"eslint-plugin-import": "^2.31.0",
|
|
72
72
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
73
73
|
"eslint-plugin-react": "^7.37.5",
|
|
74
|
-
"eslint-plugin-react-compiler": "^19.0.0-beta-
|
|
74
|
+
"eslint-plugin-react-compiler": "^19.0.0-beta-ebf51a3-20250411",
|
|
75
75
|
"eslint-plugin-react-hooks": "^5.2.0",
|
|
76
76
|
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
77
77
|
"history": "^5.3.0",
|
|
78
|
-
"playwright": "^1.
|
|
78
|
+
"playwright": "^1.52.0",
|
|
79
79
|
"resize-observer-polyfill": "^1.5.1",
|
|
80
80
|
"sass": "^1.86.3",
|
|
81
81
|
"typescript": "^5.8.3",
|
|
82
|
-
"typescript-eslint": "^8.
|
|
83
|
-
"vite": "^6.2.
|
|
82
|
+
"typescript-eslint": "^8.30.1",
|
|
83
|
+
"vite": "^6.2.6",
|
|
84
84
|
"vite-plugin-dts": "^4.5.3",
|
|
85
85
|
"vitest": "^3.0.2"
|
|
86
86
|
},
|
|
@@ -90,5 +90,5 @@
|
|
|
90
90
|
"not ie <= 11",
|
|
91
91
|
"not op_mini all"
|
|
92
92
|
],
|
|
93
|
-
"version": "0.8.
|
|
93
|
+
"version": "0.8.12"
|
|
94
94
|
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { useRef as a, useCallback as o, useEffect as f, useMemo as g, useState as i } from "react";
|
|
2
|
-
function m(u, r = globalThis.setTimeout, t = globalThis.clearTimeout) {
|
|
3
|
-
const s = a(null), e = o(() => {
|
|
4
|
-
s.current && t(s.current);
|
|
5
|
-
}, [t]), n = o((l, c) => {
|
|
6
|
-
e(), s.current = r(() => {
|
|
7
|
-
l(), s.current = null;
|
|
8
|
-
}, c ?? u);
|
|
9
|
-
}, [e, u, r]);
|
|
10
|
-
return f(() => e, [e]), g(
|
|
11
|
-
() => ({ setTimeout: n, clearCurrentTimeout: e }),
|
|
12
|
-
[e, n]
|
|
13
|
-
);
|
|
14
|
-
}
|
|
15
|
-
const b = (u = !1) => {
|
|
16
|
-
const [r, t] = i(u), s = o(() => t((l) => !l), []), e = o(() => t(!0), []), n = o(() => t(!1), []);
|
|
17
|
-
return [r, s, e, n];
|
|
18
|
-
};
|
|
19
|
-
export {
|
|
20
|
-
b as a,
|
|
21
|
-
m as u
|
|
22
|
-
};
|