@shlinkio/shlink-frontend-kit 0.8.7 → 0.8.9

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