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