@shlinkio/shlink-frontend-kit 0.8.12 → 0.9.0

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