@shlinkio/shlink-frontend-kit 0.8.2 → 0.8.4
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 +20 -2
- package/dist/index.js +129 -127
- package/dist/tailwind.d.ts +49 -19
- package/dist/tailwind.js +417 -305
- package/dist/tailwind.preset.css +12 -0
- package/dist/use-timeout-mQ792qNj.js +17 -0
- package/package.json +7 -6
package/dist/tailwind.js
CHANGED
|
@@ -1,109 +1,111 @@
|
|
|
1
|
-
import { jsx as n, jsxs as
|
|
2
|
-
import
|
|
3
|
-
import { createContext as
|
|
4
|
-
import { Link as
|
|
5
|
-
import { faClose as
|
|
6
|
-
import { FontAwesomeIcon as
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { jsx as n, jsxs as i, Fragment as T } from "react/jsx-runtime";
|
|
2
|
+
import w, { clsx as f } from "clsx";
|
|
3
|
+
import { createContext as S, useContext as g, useCallback as F, useId as H, useMemo as O, useRef as $, useEffect as L, useState as Q } from "react";
|
|
4
|
+
import { Link as U, NavLink as V } from "react-router";
|
|
5
|
+
import { faClose as X, faSearch as Y, faChevronLeft as M, faChevronRight as R, faCircleNotch as Z } from "@fortawesome/free-solid-svg-icons";
|
|
6
|
+
import { FontAwesomeIcon as b } from "@fortawesome/react-fontawesome";
|
|
7
|
+
import { createPortal as tt } from "react-dom";
|
|
8
|
+
import { u as et } from "./use-timeout-mQ792qNj.js";
|
|
9
|
+
const N = S(void 0), x = S({ responsive: !0 }), rt = ({ children: t, className: e }) => {
|
|
10
|
+
const { responsive: r } = g(x);
|
|
11
|
+
return /* @__PURE__ */ n(N.Provider, { value: { section: "head" }, children: /* @__PURE__ */ n(
|
|
10
12
|
"thead",
|
|
11
13
|
{
|
|
12
|
-
className:
|
|
13
|
-
{ "tw:hidden tw:lg:table-header-group":
|
|
14
|
-
|
|
14
|
+
className: w(
|
|
15
|
+
{ "tw:hidden tw:lg:table-header-group": r },
|
|
16
|
+
e
|
|
15
17
|
),
|
|
16
18
|
children: t
|
|
17
19
|
}
|
|
18
20
|
) });
|
|
19
|
-
},
|
|
20
|
-
const { responsive:
|
|
21
|
-
return /* @__PURE__ */ n(
|
|
21
|
+
}, ot = ({ children: t, className: e }) => {
|
|
22
|
+
const { responsive: r } = g(x);
|
|
23
|
+
return /* @__PURE__ */ n(N.Provider, { value: { section: "body" }, children: /* @__PURE__ */ n(
|
|
22
24
|
"tbody",
|
|
23
25
|
{
|
|
24
|
-
className:
|
|
25
|
-
{ "tw:lg:table-row-group tw:flex tw:flex-col tw:gap-y-3":
|
|
26
|
-
|
|
26
|
+
className: w(
|
|
27
|
+
{ "tw:lg:table-row-group tw:flex tw:flex-col tw:gap-y-3": r },
|
|
28
|
+
e
|
|
27
29
|
),
|
|
28
30
|
children: t
|
|
29
31
|
}
|
|
30
32
|
) });
|
|
31
|
-
},
|
|
32
|
-
const { responsive:
|
|
33
|
-
return /* @__PURE__ */ n(
|
|
33
|
+
}, nt = ({ children: t, className: e }) => {
|
|
34
|
+
const { responsive: r } = g(x);
|
|
35
|
+
return /* @__PURE__ */ n(N.Provider, { value: { section: "footer" }, children: /* @__PURE__ */ n(
|
|
34
36
|
"tfoot",
|
|
35
37
|
{
|
|
36
|
-
className:
|
|
37
|
-
{ "tw:lg:table-row-group tw:flex tw:flex-col tw:gap-y-3 tw:mt-4":
|
|
38
|
-
|
|
38
|
+
className: w(
|
|
39
|
+
{ "tw:lg:table-row-group tw:flex tw:flex-col tw:gap-y-3 tw:mt-4": r },
|
|
40
|
+
e
|
|
39
41
|
),
|
|
40
42
|
children: t
|
|
41
43
|
}
|
|
42
44
|
) });
|
|
43
|
-
},
|
|
44
|
-
const o = g(
|
|
45
|
+
}, dt = ({ children: t, className: e, ...r }) => {
|
|
46
|
+
const o = g(N), d = (o == null ? void 0 : o.section) === "body", { responsive: a } = g(x);
|
|
45
47
|
return /* @__PURE__ */ n(
|
|
46
48
|
"tr",
|
|
47
49
|
{
|
|
48
|
-
className:
|
|
50
|
+
className: w(
|
|
49
51
|
"tw:group",
|
|
50
52
|
{
|
|
51
|
-
"tw:lg:table-row tw:flex tw:flex-col":
|
|
52
|
-
"tw:lg:border-0 tw:border-y-2 tw:border-lm-border tw:dark:border-dm-border":
|
|
53
|
+
"tw:lg:table-row tw:flex tw:flex-col": a,
|
|
54
|
+
"tw:lg:border-0 tw:border-y-2 tw:border-lm-border tw:dark:border-dm-border": a,
|
|
53
55
|
"tw:hover:bg-lm-primary tw:dark:hover:bg-dm-primary": d,
|
|
54
56
|
// Use a different hover bg color depending on the table being inside a card or not
|
|
55
57
|
"tw:group-[&]/card:hover:bg-lm-secondary tw:dark:group-[&]/card:hover:bg-dm-secondary": d
|
|
56
58
|
},
|
|
57
|
-
|
|
59
|
+
e
|
|
58
60
|
),
|
|
59
|
-
...
|
|
61
|
+
...r,
|
|
60
62
|
children: t
|
|
61
63
|
}
|
|
62
64
|
);
|
|
63
|
-
},
|
|
64
|
-
const
|
|
65
|
+
}, lt = ({ children: t, className: e, columnName: r, type: o, ...d }) => {
|
|
66
|
+
const a = g(N), l = o ?? ((a == null ? void 0 : a.section) !== "body" ? "th" : "td"), { responsive: s } = g(x);
|
|
65
67
|
return /* @__PURE__ */ n(
|
|
66
|
-
|
|
68
|
+
l,
|
|
67
69
|
{
|
|
68
|
-
"data-column":
|
|
69
|
-
className:
|
|
70
|
+
"data-column": s ? r : void 0,
|
|
71
|
+
className: w(
|
|
70
72
|
"tw:p-2 tw:border-lm-border tw:dark:border-dm-border",
|
|
71
73
|
{
|
|
72
|
-
"tw:border-b-1": !
|
|
73
|
-
"tw:block tw:lg:table-cell tw:not-last:border-b-1 tw:lg:border-b-1":
|
|
74
|
+
"tw:border-b-1": !s,
|
|
75
|
+
"tw:block tw:lg:table-cell tw:not-last:border-b-1 tw:lg:border-b-1": s,
|
|
74
76
|
// For md and lower, display the content in data-column attribute as before
|
|
75
|
-
"tw:before:lg:hidden tw:before:content-[attr(data-column)] tw:before:font-bold tw:before:mr-1":
|
|
77
|
+
"tw:before:lg:hidden tw:before:content-[attr(data-column)] tw:before:font-bold tw:before:mr-1": s && l === "td"
|
|
76
78
|
},
|
|
77
|
-
|
|
79
|
+
e
|
|
78
80
|
),
|
|
79
81
|
...d,
|
|
80
82
|
children: t
|
|
81
83
|
}
|
|
82
84
|
);
|
|
83
|
-
},
|
|
84
|
-
/* @__PURE__ */ n(
|
|
85
|
-
/* @__PURE__ */ n(
|
|
86
|
-
|
|
87
|
-
] }) }),
|
|
85
|
+
}, at = ({ header: t, footer: e, children: r, responsive: o = !0, ...d }) => /* @__PURE__ */ n(x.Provider, { value: { responsive: o }, children: /* @__PURE__ */ i("table", { className: "tw:w-full", ...d, children: [
|
|
86
|
+
/* @__PURE__ */ n(rt, { children: t }),
|
|
87
|
+
/* @__PURE__ */ n(ot, { children: r }),
|
|
88
|
+
e && /* @__PURE__ */ n(nt, { children: e })
|
|
89
|
+
] }) }), Rt = Object.assign(at, { Row: dt, Cell: lt }), wt = ({
|
|
88
90
|
children: t,
|
|
89
|
-
className:
|
|
90
|
-
disabled:
|
|
91
|
+
className: e,
|
|
92
|
+
disabled: r,
|
|
91
93
|
variant: o = "primary",
|
|
92
94
|
size: d = "md",
|
|
93
|
-
inline:
|
|
94
|
-
solid:
|
|
95
|
-
...
|
|
95
|
+
inline: a = !1,
|
|
96
|
+
solid: l = !1,
|
|
97
|
+
...s
|
|
96
98
|
}) => {
|
|
97
|
-
const c = "to" in
|
|
99
|
+
const c = "to" in s ? U : "button";
|
|
98
100
|
return (
|
|
99
101
|
// @ts-expect-error We are explicitly checking for the `to` prop before using Link
|
|
100
102
|
/* @__PURE__ */ n(
|
|
101
103
|
c,
|
|
102
104
|
{
|
|
103
|
-
className:
|
|
105
|
+
className: w(
|
|
104
106
|
{
|
|
105
|
-
"tw:inline-flex":
|
|
106
|
-
"tw:flex": !
|
|
107
|
+
"tw:inline-flex": a,
|
|
108
|
+
"tw:flex": !a
|
|
107
109
|
},
|
|
108
110
|
"tw:gap-2 tw:items-center tw:justify-center",
|
|
109
111
|
"tw:border tw:rounded-md tw:no-underline",
|
|
@@ -120,11 +122,11 @@ const f = L(void 0), u = L({ responsive: !0 }), O = ({ children: t, className: r
|
|
|
120
122
|
{
|
|
121
123
|
"tw:border-brand tw:text-brand": o === "primary",
|
|
122
124
|
"tw:border-zinc-500": o === "secondary",
|
|
123
|
-
"tw:text-zinc-500": o === "secondary" && !
|
|
125
|
+
"tw:text-zinc-500": o === "secondary" && !l,
|
|
124
126
|
"tw:border-danger": o === "danger",
|
|
125
|
-
"tw:text-danger": o === "danger" && !
|
|
127
|
+
"tw:text-danger": o === "danger" && !l
|
|
126
128
|
},
|
|
127
|
-
|
|
129
|
+
l && {
|
|
128
130
|
"tw:text-white": !0,
|
|
129
131
|
"tw:bg-brand": o === "primary",
|
|
130
132
|
"tw:highlight:bg-brand-dark tw:highlight:border-brand-dark": o === "primary",
|
|
@@ -133,118 +135,143 @@ const f = L(void 0), u = L({ responsive: !0 }), O = ({ children: t, className: r
|
|
|
133
135
|
"tw:bg-danger": o === "danger",
|
|
134
136
|
"tw:highlight:bg-danger-dark tw:highlight:border-danger-dark": o === "danger"
|
|
135
137
|
},
|
|
136
|
-
!
|
|
137
|
-
"tw:highlight:text-white": !
|
|
138
|
+
!r && {
|
|
139
|
+
"tw:highlight:text-white": !l,
|
|
138
140
|
"tw:highlight:bg-brand": o === "primary",
|
|
139
141
|
"tw:highlight:bg-zinc-500": o === "secondary",
|
|
140
142
|
"tw:highlight:bg-danger": o === "danger"
|
|
141
143
|
},
|
|
142
144
|
{
|
|
143
|
-
"tw:pointer-events-none tw:opacity-65":
|
|
145
|
+
"tw:pointer-events-none tw:opacity-65": r
|
|
144
146
|
},
|
|
145
|
-
|
|
147
|
+
e
|
|
146
148
|
),
|
|
147
|
-
disabled:
|
|
148
|
-
...
|
|
149
|
+
disabled: r,
|
|
150
|
+
...s,
|
|
149
151
|
children: t
|
|
150
152
|
}
|
|
151
153
|
)
|
|
152
154
|
);
|
|
153
|
-
},
|
|
155
|
+
}, z = ({ className: t, onChange: e, ...r }) => {
|
|
156
|
+
const o = F((d) => e == null ? void 0 : e(d.target.checked, d), [e]);
|
|
157
|
+
return /* @__PURE__ */ n(
|
|
158
|
+
"input",
|
|
159
|
+
{
|
|
160
|
+
type: "checkbox",
|
|
161
|
+
className: f(
|
|
162
|
+
"tw:appearance-none tw:focus-ring",
|
|
163
|
+
"tw:border-1 tw:border-lm-input-border tw:dark:border-dm-input-border",
|
|
164
|
+
"tw:bg-lm-primary tw:dark:bg-dm-primary tw:checked:bg-brand tw:bg-no-repeat",
|
|
165
|
+
// Use different background color when rendered inside a card
|
|
166
|
+
"tw:group-[&]/card:bg-lm-input tw:group-[&]/card:dark:bg-dm-input",
|
|
167
|
+
t
|
|
168
|
+
),
|
|
169
|
+
onChange: o,
|
|
170
|
+
...r
|
|
171
|
+
}
|
|
172
|
+
);
|
|
173
|
+
}, jt = ({ className: t, ...e }) => /* @__PURE__ */ n(
|
|
174
|
+
z,
|
|
175
|
+
{
|
|
176
|
+
className: f("tw:rounded-sm tw:w-4 tw:h-4 tw:checked:bg-(image:--tick) tw:bg-center", t),
|
|
177
|
+
...e
|
|
178
|
+
}
|
|
179
|
+
), j = ({ onClick: t, label: e = "Close" }) => /* @__PURE__ */ n(
|
|
154
180
|
"button",
|
|
155
181
|
{
|
|
156
182
|
onClick: t,
|
|
157
|
-
className:
|
|
183
|
+
className: w(
|
|
158
184
|
"tw:opacity-50 tw:highlight:opacity-80 tw:transition-opacity",
|
|
159
185
|
"tw:rounded-md tw:focus-ring"
|
|
160
186
|
),
|
|
161
|
-
"aria-label":
|
|
162
|
-
children: /* @__PURE__ */ n(
|
|
187
|
+
"aria-label": e,
|
|
188
|
+
children: /* @__PURE__ */ n(b, { icon: X, size: "xl" })
|
|
163
189
|
}
|
|
164
|
-
),
|
|
190
|
+
), A = ({
|
|
165
191
|
borderless: t = !1,
|
|
166
|
-
size:
|
|
167
|
-
feedback:
|
|
192
|
+
size: e = "md",
|
|
193
|
+
feedback: r,
|
|
168
194
|
className: o,
|
|
169
195
|
disabled: d,
|
|
170
|
-
readOnly:
|
|
171
|
-
...
|
|
196
|
+
readOnly: a,
|
|
197
|
+
...l
|
|
172
198
|
}) => {
|
|
173
|
-
const
|
|
199
|
+
const s = !d && !a;
|
|
174
200
|
return /* @__PURE__ */ n(
|
|
175
201
|
"input",
|
|
176
202
|
{
|
|
177
|
-
className:
|
|
203
|
+
className: w(
|
|
178
204
|
"tw:w-full",
|
|
179
205
|
{
|
|
180
|
-
"tw:focus-ring": !
|
|
181
|
-
"tw:focus-ring-danger":
|
|
206
|
+
"tw:focus-ring": !r,
|
|
207
|
+
"tw:focus-ring-danger": r === "error"
|
|
182
208
|
},
|
|
183
209
|
{
|
|
184
|
-
"tw:px-2 tw:py-1 tw:text-sm":
|
|
185
|
-
"tw:px-3 tw:py-1.5":
|
|
186
|
-
"tw:px-4 tw:py-2 tw:text-xl":
|
|
210
|
+
"tw:px-2 tw:py-1 tw:text-sm": e === "sm",
|
|
211
|
+
"tw:px-3 tw:py-1.5": e === "md",
|
|
212
|
+
"tw:px-4 tw:py-2 tw:text-xl": e === "lg"
|
|
187
213
|
},
|
|
188
214
|
{
|
|
189
215
|
"tw:rounded-md tw:border": !t,
|
|
190
|
-
"tw:border-lm-input-border tw:dark:border-dm-input-border": !t && !
|
|
191
|
-
"tw:border-danger": !t &&
|
|
192
|
-
"tw:bg-lm-disabled-input tw:dark:bg-dm-disabled-input": !
|
|
193
|
-
"tw:bg-lm-primary tw:dark:bg-dm-primary":
|
|
216
|
+
"tw:border-lm-input-border tw:dark:border-dm-input-border": !t && !r,
|
|
217
|
+
"tw:border-danger": !t && r === "error",
|
|
218
|
+
"tw:bg-lm-disabled-input tw:dark:bg-dm-disabled-input": !s,
|
|
219
|
+
"tw:bg-lm-primary tw:dark:bg-dm-primary": s,
|
|
194
220
|
// Use different background color when rendered inside a card
|
|
195
|
-
"tw:group-[&]/card:bg-lm-input tw:group-[&]/card:dark:bg-dm-input":
|
|
221
|
+
"tw:group-[&]/card:bg-lm-input tw:group-[&]/card:dark:bg-dm-input": s
|
|
196
222
|
},
|
|
197
223
|
o
|
|
198
224
|
),
|
|
199
225
|
disabled: d,
|
|
200
|
-
readOnly:
|
|
201
|
-
...
|
|
226
|
+
readOnly: a,
|
|
227
|
+
...l
|
|
202
228
|
}
|
|
203
229
|
);
|
|
204
|
-
},
|
|
205
|
-
|
|
230
|
+
}, W = ({ required: t, children: e, ...r }) => /* @__PURE__ */ i("label", { ...r, children: [
|
|
231
|
+
e,
|
|
206
232
|
t && /* @__PURE__ */ n("span", { className: "tw:text-danger tw:ml-1", "data-testid": "required-indicator", children: "*" })
|
|
207
|
-
] }),
|
|
208
|
-
const
|
|
209
|
-
return /* @__PURE__ */
|
|
210
|
-
/* @__PURE__ */ n(
|
|
233
|
+
] }), Dt = ({ label: t, inputClassName: e, required: r, hiddenRequired: o, error: d, ...a }) => {
|
|
234
|
+
const l = H();
|
|
235
|
+
return /* @__PURE__ */ i("div", { className: "tw:flex tw:flex-col tw:gap-1", children: [
|
|
236
|
+
/* @__PURE__ */ n(W, { htmlFor: l, required: r, children: t }),
|
|
211
237
|
/* @__PURE__ */ n(
|
|
212
|
-
|
|
238
|
+
A,
|
|
213
239
|
{
|
|
214
|
-
id:
|
|
215
|
-
className:
|
|
216
|
-
required:
|
|
240
|
+
id: l,
|
|
241
|
+
className: e,
|
|
242
|
+
required: r || o,
|
|
217
243
|
feedback: d ? "error" : void 0,
|
|
218
|
-
...
|
|
244
|
+
...a
|
|
219
245
|
}
|
|
220
246
|
),
|
|
221
247
|
d && /* @__PURE__ */ n("span", { className: "tw:text-danger", children: d })
|
|
222
248
|
] });
|
|
223
|
-
},
|
|
249
|
+
}, st = ({
|
|
224
250
|
className: t,
|
|
225
|
-
size:
|
|
226
|
-
feedback:
|
|
251
|
+
size: e = "md",
|
|
252
|
+
feedback: r,
|
|
227
253
|
style: o = {},
|
|
228
254
|
disabled: d,
|
|
229
|
-
...
|
|
255
|
+
...a
|
|
230
256
|
}) => /* @__PURE__ */ n(
|
|
231
257
|
"select",
|
|
232
258
|
{
|
|
233
|
-
className:
|
|
234
|
-
"tw:w-full tw:appearance-none tw:pr-9
|
|
259
|
+
className: w(
|
|
260
|
+
"tw:w-full tw:appearance-none tw:pr-9",
|
|
261
|
+
"tw:bg-(image:--chevron-down) tw:bg-no-repeat",
|
|
235
262
|
{
|
|
236
|
-
"tw:focus-ring": !
|
|
237
|
-
"tw:focus-ring-danger":
|
|
263
|
+
"tw:focus-ring": !r,
|
|
264
|
+
"tw:focus-ring-danger": r === "error"
|
|
238
265
|
},
|
|
239
266
|
"tw:rounded-md tw:border",
|
|
240
267
|
{
|
|
241
|
-
"tw:border-lm-input-border tw:dark:border-dm-input-border": !
|
|
242
|
-
"tw:border-danger":
|
|
268
|
+
"tw:border-lm-input-border tw:dark:border-dm-input-border": !r,
|
|
269
|
+
"tw:border-danger": r === "error"
|
|
243
270
|
},
|
|
244
271
|
{
|
|
245
|
-
"tw:pl-2 tw:py-1 tw:text-sm":
|
|
246
|
-
"tw:pl-3 tw:py-1.5":
|
|
247
|
-
"tw:pl-4 tw:py-2 tw:text-xl":
|
|
272
|
+
"tw:pl-2 tw:py-1 tw:text-sm": e === "sm",
|
|
273
|
+
"tw:pl-3 tw:py-1.5": e === "md",
|
|
274
|
+
"tw:pl-4 tw:py-2 tw:text-xl": e === "lg",
|
|
248
275
|
"tw:bg-lm-disabled-input tw:dark:bg-dm-disabled-input": d,
|
|
249
276
|
// Apply different background color when rendered inside a card
|
|
250
277
|
"tw:bg-lm-primary tw:dark:bg-dm-primary tw:group-[&]/card:bg-lm-input tw:group-[&]/card:dark:bg-dm-input": !d
|
|
@@ -253,50 +280,34 @@ const f = L(void 0), u = L({ responsive: !0 }), O = ({ children: t, className: r
|
|
|
253
280
|
),
|
|
254
281
|
style: {
|
|
255
282
|
...o,
|
|
256
|
-
|
|
257
|
-
backgroundSize: "16px 12px",
|
|
258
|
-
backgroundPosition: "right 0.75rem center"
|
|
283
|
+
background: "right 0.75rem center / 16px 12px"
|
|
259
284
|
},
|
|
260
285
|
disabled: d,
|
|
261
|
-
...
|
|
286
|
+
...a
|
|
262
287
|
}
|
|
263
|
-
),
|
|
264
|
-
const
|
|
265
|
-
return /* @__PURE__ */
|
|
266
|
-
/* @__PURE__ */ n(
|
|
267
|
-
/* @__PURE__ */ n(
|
|
288
|
+
), Ht = ({ selectClassName: t, label: e, required: r, hiddenRequired: o, ...d }) => {
|
|
289
|
+
const a = H();
|
|
290
|
+
return /* @__PURE__ */ i("div", { className: "tw:flex tw:flex-col tw:gap-1", children: [
|
|
291
|
+
/* @__PURE__ */ n(W, { htmlFor: a, required: r, children: e }),
|
|
292
|
+
/* @__PURE__ */ n(st, { id: a, className: t, required: r || o, ...d })
|
|
268
293
|
] });
|
|
269
|
-
}
|
|
270
|
-
function Y(t, r = globalThis.setTimeout.bind(globalThis), e = globalThis.clearTimeout.bind(globalThis)) {
|
|
271
|
-
const o = M(null), d = k(() => {
|
|
272
|
-
o.current && e(o.current);
|
|
273
|
-
}, [e]), l = k((s, i) => {
|
|
274
|
-
d(), o.current = r(() => {
|
|
275
|
-
s(), o.current = null;
|
|
276
|
-
}, i ?? t);
|
|
277
|
-
}, [d, t, r]);
|
|
278
|
-
return E(() => d, [d]), T(
|
|
279
|
-
() => ({ setTimeout: l, clearCurrentTimeout: d }),
|
|
280
|
-
[d, l]
|
|
281
|
-
);
|
|
282
|
-
}
|
|
283
|
-
const vt = ({
|
|
294
|
+
}, Ot = ({
|
|
284
295
|
onChange: t,
|
|
285
|
-
containerClassName:
|
|
286
|
-
inputClassName:
|
|
296
|
+
containerClassName: e,
|
|
297
|
+
inputClassName: r,
|
|
287
298
|
// Inputs have a default 'md' size. Search inputs are usually 'lg' as they are rendered at the top of sections
|
|
288
299
|
size: o = "lg",
|
|
289
300
|
...d
|
|
290
301
|
}) => {
|
|
291
|
-
const { setTimeout:
|
|
292
|
-
c ?
|
|
293
|
-
}, [
|
|
294
|
-
return /* @__PURE__ */
|
|
302
|
+
const { setTimeout: a, clearCurrentTimeout: l } = et(500), s = F((c) => {
|
|
303
|
+
c ? a(() => t(c)) : (l(), t(c));
|
|
304
|
+
}, [l, t, a]);
|
|
305
|
+
return /* @__PURE__ */ i("div", { className: w("tw:group tw:relative tw:focus-within:z-10", e), children: [
|
|
295
306
|
/* @__PURE__ */ n(
|
|
296
|
-
|
|
307
|
+
b,
|
|
297
308
|
{
|
|
298
|
-
icon:
|
|
299
|
-
className:
|
|
309
|
+
icon: Y,
|
|
310
|
+
className: w(
|
|
300
311
|
"tw:absolute tw:top-[50%] tw:translate-y-[-50%] tw:transition-colors",
|
|
301
312
|
"tw:text-placeholder tw:group-focus-within:text-lm-text tw:dark:group-focus-within:text-dm-text",
|
|
302
313
|
{
|
|
@@ -307,214 +318,278 @@ const vt = ({
|
|
|
307
318
|
}
|
|
308
319
|
),
|
|
309
320
|
/* @__PURE__ */ n(
|
|
310
|
-
|
|
321
|
+
A,
|
|
311
322
|
{
|
|
312
323
|
type: "search",
|
|
313
|
-
className:
|
|
324
|
+
className: w(
|
|
314
325
|
{
|
|
315
326
|
"tw:pl-9": o !== "sm",
|
|
316
327
|
"tw:pl-7": o === "sm"
|
|
317
328
|
},
|
|
318
|
-
|
|
329
|
+
r
|
|
319
330
|
),
|
|
320
331
|
placeholder: "Search...",
|
|
321
|
-
onChange: (c) =>
|
|
332
|
+
onChange: (c) => s(c.target.value),
|
|
322
333
|
size: o,
|
|
323
334
|
...d
|
|
324
335
|
}
|
|
325
336
|
)
|
|
326
337
|
] });
|
|
327
|
-
},
|
|
338
|
+
}, $t = ({ className: t, ...e }) => /* @__PURE__ */ n(
|
|
339
|
+
z,
|
|
340
|
+
{
|
|
341
|
+
className: f(
|
|
342
|
+
"tw:rounded-full tw:w-8 tw:h-4",
|
|
343
|
+
"tw:bg-(image:--circle-grey-dark) tw:dark:bg-(image:--circle-grey-light) tw:checked:bg-(image:--circle-white)",
|
|
344
|
+
"tw:focus-visible:not-checked:bg-(image:--circle-light-blue)",
|
|
345
|
+
"tw:checked:bg-right tw:transition-[background-position]",
|
|
346
|
+
t
|
|
347
|
+
),
|
|
348
|
+
...e
|
|
349
|
+
}
|
|
350
|
+
), it = ({ className: t, disabled: e, size: r = "md", ...o }) => /* @__PURE__ */ n(
|
|
328
351
|
"button",
|
|
329
352
|
{
|
|
330
|
-
className:
|
|
353
|
+
className: w(
|
|
331
354
|
"tw:inline-flex tw:rounded-md tw:focus-ring",
|
|
332
355
|
"tw:text-brand tw:highlight:text-brand-dark tw:highlight:underline",
|
|
333
356
|
{
|
|
334
|
-
"tw:px-1.5 tw:py-1 tw:text-sm":
|
|
335
|
-
"tw:px-3 tw:py-1.5":
|
|
336
|
-
"tw:px-4 tw:py-2 tw:text-lg":
|
|
337
|
-
"tw:pointer-events-none tw:opacity-65":
|
|
357
|
+
"tw:px-1.5 tw:py-1 tw:text-sm": r === "sm",
|
|
358
|
+
"tw:px-3 tw:py-1.5": r === "md",
|
|
359
|
+
"tw:px-4 tw:py-2 tw:text-lg": r === "lg",
|
|
360
|
+
"tw:pointer-events-none tw:opacity-65": e
|
|
338
361
|
},
|
|
339
362
|
t
|
|
340
363
|
),
|
|
341
|
-
disabled:
|
|
364
|
+
disabled: e,
|
|
342
365
|
...o
|
|
343
366
|
}
|
|
344
|
-
),
|
|
345
|
-
const e = et(
|
|
346
|
-
Math.max(b, t - b),
|
|
347
|
-
Math.min(r - 1, t + b) + 1
|
|
348
|
-
);
|
|
349
|
-
return t - b > b && e.unshift(v), t + b < r - 1 && e.push(v), e.unshift(1), e.push(r), e;
|
|
350
|
-
}, p = (t) => t === v, nt = (t) => p(t) ? t : rt(t), dt = (t, r) => p(t) ? `${t}_${r}` : `${t}`, z = [
|
|
351
|
-
"tw:border tw:border-r-0 tw:last:border-r tw:border-lm-border tw:dark:border-dm-border",
|
|
352
|
-
"tw:rounded-none tw:first:rounded-l tw:last:rounded-r"
|
|
353
|
-
], D = (t = !1) => a(
|
|
354
|
-
z,
|
|
355
|
-
"tw:px-3 py-2 tw:cursor-pointer tw:no-underline",
|
|
356
|
-
"tw:focus-ring tw:focus-visible:z-1",
|
|
357
|
-
{
|
|
358
|
-
"tw:highlight:bg-lm-secondary tw:dark:highlight:bg-dm-secondary tw:text-brand": !t,
|
|
359
|
-
"tw:bg-lm-brand tw:dark:bg-dm-brand tw:text-white": t
|
|
360
|
-
}
|
|
361
|
-
), C = ({ children: t }) => /* @__PURE__ */ n("span", { "aria-hidden": !0, className: a(z, "tw:px-3 py-2 tw:text-gray-400"), children: t }), $ = () => /* @__PURE__ */ n(C, { children: v });
|
|
362
|
-
function lt({ children: t, active: r, isEllipsis: e, href: o, ...d }) {
|
|
363
|
-
const l = T(() => D(r), [r]);
|
|
364
|
-
return e ? /* @__PURE__ */ n($, {}) : /* @__PURE__ */ n(_, { className: l, to: o, ...d, children: t });
|
|
365
|
-
}
|
|
366
|
-
function st({ children: t, active: r, isEllipsis: e, ...o }) {
|
|
367
|
-
const d = T(() => D(r), [r]);
|
|
368
|
-
return e ? /* @__PURE__ */ n($, {}) : /* @__PURE__ */ n("button", { type: "button", className: d, ...o, children: t });
|
|
369
|
-
}
|
|
370
|
-
const Ct = ({ currentPage: t, pagesCount: r, ...e }) => {
|
|
371
|
-
const o = "urlForPage" in e, d = o ? lt : st, l = k(
|
|
372
|
-
(s) => o ? { href: p(s) ? void 0 : e.urlForPage(s) } : { onClick: () => !p(s) && e.onPageChange(s) },
|
|
373
|
-
[o, e]
|
|
374
|
-
);
|
|
375
|
-
return r < 2 ? null : /* @__PURE__ */ w("div", { className: "tw:select-none tw:flex", "data-testid": "paginator", children: [
|
|
376
|
-
t === 1 ? /* @__PURE__ */ n(C, { children: /* @__PURE__ */ n(h, { size: "xs", icon: P }) }) : /* @__PURE__ */ n(d, { ...l(Math.max(1, t - 1)), "aria-label": "Previous", children: /* @__PURE__ */ n(h, { size: "xs", icon: P }) }),
|
|
377
|
-
ot(t, r).map((s, i) => /* @__PURE__ */ n(
|
|
378
|
-
d,
|
|
379
|
-
{
|
|
380
|
-
active: s === t,
|
|
381
|
-
isEllipsis: p(s),
|
|
382
|
-
...l(s),
|
|
383
|
-
children: nt(s)
|
|
384
|
-
},
|
|
385
|
-
dt(s, i)
|
|
386
|
-
)),
|
|
387
|
-
t === r ? /* @__PURE__ */ n(C, { children: /* @__PURE__ */ n(h, { size: "xs", icon: B }) }) : /* @__PURE__ */ n(d, { ...l(Math.min(r, t + 1)), "aria-label": "Next", children: /* @__PURE__ */ n(h, { size: "xs", icon: B }) })
|
|
388
|
-
] });
|
|
389
|
-
}, at = ({ className: t, ...r }) => /* @__PURE__ */ n(
|
|
367
|
+
), ct = ({ className: t, ...e }) => /* @__PURE__ */ n(
|
|
390
368
|
"div",
|
|
391
369
|
{
|
|
392
|
-
className:
|
|
370
|
+
className: w(
|
|
393
371
|
"tw:px-4 tw:py-3 tw:rounded-t-md",
|
|
394
372
|
"tw:bg-lm-primary tw:dark:bg-dm-primary tw:border-b tw:border-lm-border tw:dark:border-dm-border",
|
|
395
373
|
t
|
|
396
374
|
),
|
|
397
|
-
...
|
|
375
|
+
...e
|
|
398
376
|
}
|
|
399
|
-
),
|
|
377
|
+
), mt = ({ className: t, ...e }) => /* @__PURE__ */ n(
|
|
400
378
|
"div",
|
|
401
379
|
{
|
|
402
|
-
className:
|
|
380
|
+
className: w(
|
|
403
381
|
"tw:p-4 tw:bg-lm-primary tw:dark:bg-dm-primary tw:first:rounded-t-md",
|
|
404
382
|
"tw:first:rounded-t-md tw:last:rounded-b-md",
|
|
405
383
|
t
|
|
406
384
|
),
|
|
407
|
-
...
|
|
385
|
+
...e
|
|
408
386
|
}
|
|
409
|
-
),
|
|
387
|
+
), gt = ({ className: t, ...e }) => /* @__PURE__ */ n(
|
|
410
388
|
"div",
|
|
411
389
|
{
|
|
412
|
-
className:
|
|
390
|
+
className: w(
|
|
413
391
|
"tw:px-4 tw:py-3 tw:rounded-b-md",
|
|
414
392
|
"tw:bg-lm-primary tw:dark:bg-dm-primary tw:border-t tw:border-lm-border tw:dark:border-dm-border",
|
|
415
393
|
t
|
|
416
394
|
),
|
|
417
|
-
...
|
|
395
|
+
...e
|
|
418
396
|
}
|
|
419
|
-
),
|
|
397
|
+
), bt = ({ className: t, ...e }) => /* @__PURE__ */ n(
|
|
420
398
|
"div",
|
|
421
399
|
{
|
|
422
|
-
className:
|
|
400
|
+
className: w(
|
|
423
401
|
"tw:group/card tw:rounded-md tw:shadow-md",
|
|
424
402
|
"tw:border tw:border-lm-border tw:dark:border-dm-border tw:bg-lm-primary tw:dark:bg-dm-primary",
|
|
425
403
|
t
|
|
426
404
|
),
|
|
427
|
-
...
|
|
405
|
+
...e
|
|
428
406
|
}
|
|
429
|
-
), m = Object.assign(
|
|
430
|
-
const { title: o, titleSize: d = "md", ...
|
|
431
|
-
...
|
|
407
|
+
), m = Object.assign(bt, { Body: mt, Header: ct, Footer: gt }), pt = ({ bodyClassName: t, children: e, ...r }) => {
|
|
408
|
+
const { title: o, titleSize: d = "md", ...a } = "title" in r ? r : {
|
|
409
|
+
...r,
|
|
432
410
|
title: void 0,
|
|
433
411
|
titleSize: void 0
|
|
434
412
|
};
|
|
435
|
-
return /* @__PURE__ */
|
|
436
|
-
o && /* @__PURE__ */
|
|
413
|
+
return /* @__PURE__ */ i(m, { ...a, children: [
|
|
414
|
+
o && /* @__PURE__ */ i(m.Header, { children: [
|
|
437
415
|
d === "lg" && /* @__PURE__ */ n("h4", { children: o }),
|
|
438
416
|
d === "md" && /* @__PURE__ */ n("h5", { children: o }),
|
|
439
417
|
d === "sm" && /* @__PURE__ */ n("h6", { children: o })
|
|
440
418
|
] }),
|
|
441
|
-
/* @__PURE__ */ n(m.Body, { className: t, children:
|
|
419
|
+
/* @__PURE__ */ n(m.Body, { className: t, children: e })
|
|
420
|
+
] });
|
|
421
|
+
}, q = S(null), ht = ({ className: t, to: e, ...r }) => {
|
|
422
|
+
const o = g(q);
|
|
423
|
+
return /* @__PURE__ */ n(
|
|
424
|
+
V,
|
|
425
|
+
{
|
|
426
|
+
role: "menuitem",
|
|
427
|
+
to: e,
|
|
428
|
+
className: ({ isActive: d }) => w(
|
|
429
|
+
"tw:px-4 tw:pt-2 tw:pb-[calc(0.5rem-3px)] tw:border-b-3",
|
|
430
|
+
"tw:font-bold tw:no-underline tw:text-center tw:highlight:text-brand tw:transition-colors",
|
|
431
|
+
"tw:rounded-none tw:outline-none tw:focus-visible:inset-ring-2 tw:focus-visible:inset-ring-brand/50",
|
|
432
|
+
{
|
|
433
|
+
"tw:border-b-brand active": d,
|
|
434
|
+
"tw:border-b-transparent tw:text-gray-500": !d,
|
|
435
|
+
"tw:flex-grow": o == null ? void 0 : o.fill
|
|
436
|
+
},
|
|
437
|
+
t
|
|
438
|
+
),
|
|
439
|
+
...r
|
|
440
|
+
}
|
|
441
|
+
);
|
|
442
|
+
}, ut = ({ children: t, className: e, fill: r }) => /* @__PURE__ */ n(q.Provider, { value: { fill: r }, children: /* @__PURE__ */ n(m, { role: "menubar", className: w("tw:flex tw:overflow-hidden", e), children: t }) }), Ut = Object.assign(ut, { Pill: ht }), ft = new Intl.NumberFormat("en-US"), xt = (t) => ft.format(Number(t)), D = 10, zt = (t) => Math.ceil(t / D) * D, u = 2, C = "...", yt = (t, e) => Array.from({ length: e - t }, (r, o) => t + o), kt = (t, e) => {
|
|
443
|
+
const r = yt(
|
|
444
|
+
Math.max(u, t - u),
|
|
445
|
+
Math.min(e - 1, t + u) + 1
|
|
446
|
+
);
|
|
447
|
+
return t - u > u && r.unshift(C), t + u < e - 1 && r.push(C), r.unshift(1), r.push(e), r;
|
|
448
|
+
}, k = (t) => t === C, Nt = (t) => k(t) ? t : xt(t), vt = (t, e) => k(t) ? `${t}_${e}` : `${t}`, G = [
|
|
449
|
+
"tw:border tw:border-r-0 tw:last:border-r tw:border-lm-border tw:dark:border-dm-border",
|
|
450
|
+
"tw:rounded-none tw:first:rounded-l tw:last:rounded-r"
|
|
451
|
+
], J = (t = !1) => w(
|
|
452
|
+
G,
|
|
453
|
+
"tw:px-3 py-2 tw:cursor-pointer tw:no-underline",
|
|
454
|
+
"tw:focus-ring tw:focus-visible:z-1",
|
|
455
|
+
{
|
|
456
|
+
"tw:highlight:bg-lm-secondary tw:dark:highlight:bg-dm-secondary tw:text-brand": !t,
|
|
457
|
+
"tw:bg-lm-brand tw:dark:bg-dm-brand tw:text-white": t
|
|
458
|
+
}
|
|
459
|
+
), B = ({ children: t }) => /* @__PURE__ */ n("span", { "aria-hidden": !0, className: w(G, "tw:px-3 py-2 tw:text-gray-400"), children: t }), K = () => /* @__PURE__ */ n(B, { children: C });
|
|
460
|
+
function Pt({ children: t, active: e, isEllipsis: r, href: o, ...d }) {
|
|
461
|
+
const a = O(() => J(e), [e]);
|
|
462
|
+
return r ? /* @__PURE__ */ n(K, {}) : /* @__PURE__ */ n(U, { className: a, to: o, ...d, children: t });
|
|
463
|
+
}
|
|
464
|
+
function Ct({ children: t, active: e, isEllipsis: r, ...o }) {
|
|
465
|
+
const d = O(() => J(e), [e]);
|
|
466
|
+
return r ? /* @__PURE__ */ n(K, {}) : /* @__PURE__ */ n("button", { type: "button", className: d, ...o, children: t });
|
|
467
|
+
}
|
|
468
|
+
const At = ({ currentPage: t, pagesCount: e, ...r }) => {
|
|
469
|
+
const o = "urlForPage" in r, d = o ? Pt : Ct, a = F(
|
|
470
|
+
(l) => o ? { href: k(l) ? void 0 : r.urlForPage(l) } : { onClick: () => !k(l) && r.onPageChange(l) },
|
|
471
|
+
[o, r]
|
|
472
|
+
);
|
|
473
|
+
return e < 2 ? null : /* @__PURE__ */ i("div", { className: "tw:select-none tw:flex", "data-testid": "paginator", children: [
|
|
474
|
+
t === 1 ? /* @__PURE__ */ n(B, { children: /* @__PURE__ */ n(b, { size: "xs", icon: M }) }) : /* @__PURE__ */ n(d, { ...a(Math.max(1, t - 1)), "aria-label": "Previous", children: /* @__PURE__ */ n(b, { size: "xs", icon: M }) }),
|
|
475
|
+
kt(t, e).map((l, s) => /* @__PURE__ */ n(
|
|
476
|
+
d,
|
|
477
|
+
{
|
|
478
|
+
active: l === t,
|
|
479
|
+
isEllipsis: k(l),
|
|
480
|
+
...a(l),
|
|
481
|
+
children: Nt(l)
|
|
482
|
+
},
|
|
483
|
+
vt(l, s)
|
|
484
|
+
)),
|
|
485
|
+
t === e ? /* @__PURE__ */ n(B, { children: /* @__PURE__ */ n(b, { size: "xs", icon: R }) }) : /* @__PURE__ */ n(d, { ...a(Math.min(e, t + 1)), "aria-label": "Next", children: /* @__PURE__ */ n(b, { size: "xs", icon: R }) })
|
|
442
486
|
] });
|
|
443
|
-
},
|
|
487
|
+
}, It = ({
|
|
444
488
|
open: t,
|
|
445
|
-
children:
|
|
446
|
-
className:
|
|
447
|
-
|
|
489
|
+
children: e,
|
|
490
|
+
className: r,
|
|
491
|
+
onClose: o,
|
|
492
|
+
...d
|
|
448
493
|
}) => {
|
|
449
|
-
const
|
|
450
|
-
return
|
|
451
|
-
var
|
|
452
|
-
const l = document.body, s = l.style.overflow,
|
|
494
|
+
const a = $(null);
|
|
495
|
+
return L(() => {
|
|
496
|
+
var v, y;
|
|
497
|
+
const l = document.body, s = l.style.overflow, c = l.style.paddingRight;
|
|
453
498
|
if (t) {
|
|
454
|
-
const
|
|
455
|
-
l.style.overflow = "hidden",
|
|
499
|
+
const I = window.outerWidth - l.clientWidth, p = l.scrollHeight > l.clientHeight;
|
|
500
|
+
l.style.overflow = "hidden", p && (l.style.paddingRight = `${I}px`), (v = a.current) == null || v.showModal();
|
|
456
501
|
} else
|
|
457
|
-
(
|
|
502
|
+
(y = a.current) == null || y.close();
|
|
458
503
|
return () => {
|
|
459
|
-
l.style.overflow = s, l.style.paddingRight =
|
|
504
|
+
l.style.overflow = s, l.style.paddingRight = c;
|
|
460
505
|
};
|
|
461
|
-
}, [t]),
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
506
|
+
}, [t]), tt(
|
|
507
|
+
/* @__PURE__ */ n(
|
|
508
|
+
"dialog",
|
|
509
|
+
{
|
|
510
|
+
ref: a,
|
|
511
|
+
className: w("tw:bg-transparent tw:backdrop:bg-black/50", r),
|
|
512
|
+
onCancel: (l) => {
|
|
513
|
+
l.preventDefault(), o();
|
|
514
|
+
},
|
|
515
|
+
...d,
|
|
516
|
+
children: t && e
|
|
517
|
+
}
|
|
518
|
+
),
|
|
519
|
+
document.body
|
|
469
520
|
);
|
|
470
|
-
},
|
|
521
|
+
}, Wt = ({
|
|
471
522
|
open: t,
|
|
472
|
-
onClose:
|
|
473
|
-
variant:
|
|
523
|
+
onClose: e,
|
|
524
|
+
variant: r = "default",
|
|
474
525
|
title: o,
|
|
475
526
|
children: d,
|
|
476
|
-
className:
|
|
477
|
-
...
|
|
527
|
+
className: a,
|
|
528
|
+
...l
|
|
478
529
|
}) => {
|
|
479
530
|
const {
|
|
480
|
-
size:
|
|
531
|
+
size: s = "md",
|
|
481
532
|
confirmText: c = "Confirm",
|
|
482
|
-
confirmDisabled:
|
|
533
|
+
confirmDisabled: v,
|
|
483
534
|
onConfirm: y,
|
|
484
|
-
...
|
|
485
|
-
} = "onConfirm" in
|
|
486
|
-
return
|
|
487
|
-
|
|
535
|
+
...I
|
|
536
|
+
} = "onConfirm" in l ? l : { ...l }, [p, _] = Q(t), P = $(null);
|
|
537
|
+
return L(() => {
|
|
538
|
+
if (t) {
|
|
539
|
+
_(!0);
|
|
540
|
+
return;
|
|
541
|
+
}
|
|
542
|
+
const h = P.current;
|
|
543
|
+
if (h) {
|
|
544
|
+
delete P.current.dataset.open;
|
|
545
|
+
const E = () => _(!1);
|
|
546
|
+
return h.addEventListener("transitionend", E, { once: !0 }), () => {
|
|
547
|
+
h.removeEventListener("transitionend", E);
|
|
548
|
+
};
|
|
549
|
+
}
|
|
550
|
+
}, [t]), L(() => {
|
|
551
|
+
const h = P.current;
|
|
552
|
+
p && h && (h.dataset.open = "");
|
|
553
|
+
}, [p]), /* @__PURE__ */ n(
|
|
554
|
+
It,
|
|
488
555
|
{
|
|
489
|
-
open:
|
|
490
|
-
onClose:
|
|
491
|
-
className:
|
|
492
|
-
{
|
|
493
|
-
|
|
556
|
+
open: p,
|
|
557
|
+
onClose: e,
|
|
558
|
+
className: w(
|
|
559
|
+
{
|
|
560
|
+
"tw:flex tw:w-screen tw:h-screen tw:max-w-screen tw:max-h-screen": p,
|
|
561
|
+
"tw:overflow-hidden": r === "cover"
|
|
562
|
+
},
|
|
563
|
+
a
|
|
494
564
|
),
|
|
495
|
-
...
|
|
565
|
+
...I,
|
|
496
566
|
children: /* @__PURE__ */ n(
|
|
497
567
|
"div",
|
|
498
568
|
{
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
"tw:
|
|
569
|
+
"data-testid": "transition-container",
|
|
570
|
+
ref: P,
|
|
571
|
+
className: w(
|
|
572
|
+
"tw:w-full tw:m-auto tw:p-4 tw:sm:p-6",
|
|
573
|
+
// CSS transitions are based on the presence of the `data-open` attribute
|
|
574
|
+
"tw:-translate-y-4 tw:data-open:translate-y-0 tw:opacity-0 tw:data-open:opacity-100",
|
|
575
|
+
"tw:transition-[opacity_transform] tw:duration-300",
|
|
576
|
+
// Handle modal dimensions for different variants and sizes
|
|
577
|
+
r !== "cover" && {
|
|
578
|
+
"tw:sm:w-sm": s === "sm",
|
|
579
|
+
"tw:md:w-lg": s === "md",
|
|
580
|
+
"tw:md:w-4xl": s === "lg",
|
|
581
|
+
"tw:md:w-6xl": s === "xl"
|
|
509
582
|
},
|
|
510
|
-
{
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
583
|
+
{ "tw:h-full": r === "cover" }
|
|
584
|
+
),
|
|
585
|
+
children: /* @__PURE__ */ n(m, { className: w(
|
|
586
|
+
"tw:w-full",
|
|
587
|
+
{ "tw:h-full tw:relative tw:overflow-auto": r === "cover" }
|
|
588
|
+
), children: r === "cover" ? /* @__PURE__ */ i(T, { children: [
|
|
589
|
+
/* @__PURE__ */ i(
|
|
515
590
|
"div",
|
|
516
591
|
{
|
|
517
|
-
className:
|
|
592
|
+
className: w(
|
|
518
593
|
"tw:px-4 tw:py-3 tw:absolute tw:top-0 tw:left-0 tw:right-0",
|
|
519
594
|
"tw:flex tw:items-center tw:justify-between",
|
|
520
595
|
"tw:text-white tw:bg-linear-to-b tw:from-black/70 tw:to-black/10",
|
|
@@ -522,34 +597,40 @@ const Ct = ({ currentPage: t, pagesCount: r, ...e }) => {
|
|
|
522
597
|
),
|
|
523
598
|
children: [
|
|
524
599
|
/* @__PURE__ */ n("h5", { children: o }),
|
|
525
|
-
/* @__PURE__ */ n(
|
|
600
|
+
/* @__PURE__ */ n(j, { onClick: e, label: "Close dialog" })
|
|
526
601
|
]
|
|
527
602
|
}
|
|
528
603
|
),
|
|
529
604
|
/* @__PURE__ */ n("div", { children: d })
|
|
530
|
-
] }) : /* @__PURE__ */
|
|
531
|
-
/* @__PURE__ */
|
|
532
|
-
|
|
533
|
-
|
|
605
|
+
] }) : /* @__PURE__ */ i(T, { children: [
|
|
606
|
+
/* @__PURE__ */ i(m.Header, { className: w(
|
|
607
|
+
"tw:sticky tw:top-0",
|
|
608
|
+
"tw:flex tw:items-center tw:justify-between tw:gap-x-2"
|
|
609
|
+
), children: [
|
|
610
|
+
/* @__PURE__ */ n("h5", { className: w({ "tw:text-danger": r === "danger" }), children: o }),
|
|
611
|
+
/* @__PURE__ */ n(j, { onClick: e, label: "Close dialog" })
|
|
534
612
|
] }),
|
|
535
613
|
/* @__PURE__ */ n(m.Body, { children: d }),
|
|
536
|
-
y && /* @__PURE__ */
|
|
614
|
+
y && /* @__PURE__ */ i(
|
|
537
615
|
m.Footer,
|
|
538
616
|
{
|
|
539
617
|
"data-testid": "footer",
|
|
540
|
-
className:
|
|
618
|
+
className: w(
|
|
619
|
+
"tw:flex tw:justify-end tw:items-center tw:gap-x-2",
|
|
620
|
+
"tw:[&]:px-3 tw:sticky tw:bottom-0"
|
|
621
|
+
),
|
|
541
622
|
children: [
|
|
623
|
+
/* @__PURE__ */ n(it, { onClick: e, children: "Cancel" }),
|
|
542
624
|
/* @__PURE__ */ n(
|
|
543
|
-
|
|
625
|
+
wt,
|
|
544
626
|
{
|
|
545
627
|
solid: !0,
|
|
546
|
-
variant:
|
|
547
|
-
disabled:
|
|
628
|
+
variant: r === "danger" ? "danger" : "primary",
|
|
629
|
+
disabled: v,
|
|
548
630
|
onClick: y,
|
|
549
631
|
children: c
|
|
550
632
|
}
|
|
551
|
-
)
|
|
552
|
-
/* @__PURE__ */ n(Z, { onClick: r, children: "Cancel" })
|
|
633
|
+
)
|
|
553
634
|
]
|
|
554
635
|
}
|
|
555
636
|
)
|
|
@@ -558,29 +639,60 @@ const Ct = ({ currentPage: t, pagesCount: r, ...e }) => {
|
|
|
558
639
|
)
|
|
559
640
|
}
|
|
560
641
|
);
|
|
561
|
-
}
|
|
642
|
+
}, qt = ({ className: t, children: e, loading: r = !1, variant: o = "default" }) => /* @__PURE__ */ n(pt, { className: f({ "tw:[&]:border-danger": o === "error" }, t), children: /* @__PURE__ */ i("h3", { className: f("tw:text-center", {
|
|
643
|
+
"tw:text-gray-500 tw:dark:text-gray-400": o === "default",
|
|
644
|
+
"tw:text-danger": o === "error"
|
|
645
|
+
}), children: [
|
|
646
|
+
r && /* @__PURE__ */ i(T, { children: [
|
|
647
|
+
/* @__PURE__ */ n(b, { icon: Z, spin: !0 }),
|
|
648
|
+
/* @__PURE__ */ n("span", { className: "tw:ml-2", children: e ?? "Loading..." })
|
|
649
|
+
] }),
|
|
650
|
+
!r && e
|
|
651
|
+
] }) }), Gt = ({ variant: t, className: e, size: r = "md", children: o }) => /* @__PURE__ */ n(
|
|
652
|
+
"div",
|
|
653
|
+
{
|
|
654
|
+
className: f(
|
|
655
|
+
"tw:rounded-md tw:text-center",
|
|
656
|
+
{
|
|
657
|
+
"tw:p-2": r === "sm",
|
|
658
|
+
"tw:p-4": r === "md",
|
|
659
|
+
"tw:p-6": r === "lg",
|
|
660
|
+
"tw:[&]:text-white": t !== "warning",
|
|
661
|
+
"tw:bg-brand": t === "success",
|
|
662
|
+
"tw:bg-danger": t === "error",
|
|
663
|
+
"tw:bg-warning tw:text-black": t === "warning"
|
|
664
|
+
},
|
|
665
|
+
e
|
|
666
|
+
),
|
|
667
|
+
children: o
|
|
668
|
+
}
|
|
669
|
+
);
|
|
562
670
|
export {
|
|
563
|
-
|
|
671
|
+
wt as Button,
|
|
564
672
|
m as Card,
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
673
|
+
Wt as CardModal,
|
|
674
|
+
jt as Checkbox,
|
|
675
|
+
j as CloseButton,
|
|
676
|
+
C as ELLIPSIS,
|
|
677
|
+
A as Input,
|
|
678
|
+
W as Label,
|
|
679
|
+
Dt as LabelledInput,
|
|
680
|
+
Ht as LabelledSelect,
|
|
681
|
+
it as LinkButton,
|
|
682
|
+
qt as Message,
|
|
683
|
+
It as ModalDialog,
|
|
684
|
+
Ut as NavPills,
|
|
685
|
+
At as Paginator,
|
|
686
|
+
Gt as Result,
|
|
687
|
+
Ot as SearchInput,
|
|
688
|
+
st as Select,
|
|
689
|
+
pt as SimpleCard,
|
|
690
|
+
Rt as Table,
|
|
691
|
+
$t as ToggleSwitch,
|
|
692
|
+
xt as formatNumber,
|
|
693
|
+
vt as keyForPage,
|
|
694
|
+
k as pageIsEllipsis,
|
|
695
|
+
Nt as prettifyPageNumber,
|
|
696
|
+
kt as progressivePagination,
|
|
697
|
+
zt as roundTen
|
|
586
698
|
};
|