@shlinkio/shlink-frontend-kit 0.9.6 → 0.9.8

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,22 +1,23 @@
1
- import { jsxs as g, jsx as n, Fragment as S } from "react/jsx-runtime";
1
+ import { jsxs as g, jsx as n, Fragment as O } from "react/jsx-runtime";
2
2
  import w, { clsx as y } from "clsx";
3
- import { useRef as I, useState as D, useEffect as M, forwardRef as u, useCallback as P, createContext as H, useContext as C, useId as F, useMemo as O } from "react";
3
+ import { useRef as I, useState as R, useEffect as M, forwardRef as h, useCallback as T, createContext as S, useContext as C, useId as D, useMemo as $ } from "react";
4
4
  import { Link as j, NavLink as at } from "react-router";
5
- import { faClose as dt, faEyeSlash as lt, faEye as it, faCircleNotch as X, faSearch as st, faChevronLeft as G, faChevronRight as J, faCheck as wt } from "@fortawesome/free-solid-svg-icons";
5
+ import { faClose as lt, faEyeSlash as dt, faEye as st, faCircleNotch as X, faSearch as it, faChevronLeft as G, faChevronRight as J, faCheck as wt } from "@fortawesome/free-solid-svg-icons";
6
6
  import { FontAwesomeIcon as v } from "@fortawesome/react-fontawesome";
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: r, summaryClasses: e, ...o }) => {
11
- const a = I(null), [l, d] = D(!1);
7
+ import { u as ct, a as mt, b as bt } from "./use-toggle-C1uZwbSD.js";
8
+ import { createPortal as gt } from "react-dom";
9
+ import { autoPlacement as pt, arrow as ut, useFloating as ht, useHover as ft, useInteractions as xt, useTransitionStyles as yt } from "@floating-ui/react";
10
+ import { faClone as kt } from "@fortawesome/free-regular-svg-icons";
11
+ const le = ({ children: t, summary: r, summaryClasses: e, ...o }) => {
12
+ const a = I(null), [d, l] = R(!1);
12
13
  return M(() => {
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
+ const s = a.current, i = () => l(!!(s != null && s.open));
15
+ return s == null || s.addEventListener("toggle", i), () => s == null ? void 0 : s.removeEventListener("toggle", i);
15
16
  }, []), /* @__PURE__ */ g("details", { ref: a, ...o, children: [
16
17
  /* @__PURE__ */ n("summary", { className: y("tw:focus-ring tw:px-1 tw:-mx-1 tw:rounded-sm", e), children: r }),
17
- l && /* @__PURE__ */ n("div", { className: "tw:mt-3 tw:flex tw:flex-col tw:gap-y-3", children: t })
18
+ d && /* @__PURE__ */ n("div", { className: "tw:mt-3 tw:flex tw:flex-col tw:gap-y-3", children: t })
18
19
  ] });
19
- }, pt = u(({ className: t, ...r }, e) => /* @__PURE__ */ n(
20
+ }, vt = h(({ className: t, ...r }, e) => /* @__PURE__ */ n(
20
21
  "div",
21
22
  {
22
23
  className: w(
@@ -27,7 +28,7 @@ const Zt = ({ children: t, summary: r, summaryClasses: e, ...o }) => {
27
28
  ...r,
28
29
  ref: e
29
30
  }
30
- )), ht = u(({ className: t, ...r }, e) => /* @__PURE__ */ n(
31
+ )), Nt = h(({ className: t, ...r }, e) => /* @__PURE__ */ n(
31
32
  "div",
32
33
  {
33
34
  className: w(
@@ -38,7 +39,7 @@ const Zt = ({ children: t, summary: r, summaryClasses: e, ...o }) => {
38
39
  ...r,
39
40
  ref: e
40
41
  }
41
- )), ft = u(({ className: t, ...r }, e) => /* @__PURE__ */ n(
42
+ )), Ct = h(({ className: t, ...r }, e) => /* @__PURE__ */ n(
42
43
  "div",
43
44
  {
44
45
  className: w(
@@ -49,7 +50,7 @@ const Zt = ({ children: t, summary: r, summaryClasses: e, ...o }) => {
49
50
  ...r,
50
51
  ref: e
51
52
  }
52
- )), xt = u(({ className: t, ...r }, e) => /* @__PURE__ */ n(
53
+ )), Tt = h(({ className: t, ...r }, e) => /* @__PURE__ */ n(
53
54
  "div",
54
55
  {
55
56
  className: w(
@@ -60,72 +61,72 @@ const Zt = ({ children: t, summary: r, summaryClasses: e, ...o }) => {
60
61
  ...r,
61
62
  ref: e
62
63
  }
63
- )), N = Object.assign(xt, { Body: ht, Header: pt, Footer: ft }), yt = u(({ bodyClassName: t, children: r, ...e }, o) => {
64
- const { title: a, titleSize: l = "md", ...d } = "title" in e ? e : {
64
+ )), N = Object.assign(Tt, { Body: Nt, Header: vt, Footer: Ct }), It = h(({ bodyClassName: t, children: r, ...e }, o) => {
65
+ const { title: a, titleSize: d = "md", ...l } = "title" in e ? e : {
65
66
  ...e,
66
67
  title: void 0,
67
68
  titleSize: void 0
68
69
  };
69
- return /* @__PURE__ */ g(N, { ...d, ref: o, children: [
70
+ return /* @__PURE__ */ g(N, { ...l, ref: o, children: [
70
71
  a && /* @__PURE__ */ g(N.Header, { children: [
71
- l === "lg" && /* @__PURE__ */ n("h4", { children: a }),
72
- l === "md" && /* @__PURE__ */ n("h5", { children: a }),
73
- l === "sm" && /* @__PURE__ */ n("h6", { children: a })
72
+ d === "lg" && /* @__PURE__ */ n("h4", { children: a }),
73
+ d === "md" && /* @__PURE__ */ n("h5", { children: a }),
74
+ d === "sm" && /* @__PURE__ */ n("h6", { children: a })
74
75
  ] }),
75
76
  /* @__PURE__ */ n(N.Body, { className: t, children: r })
76
77
  ] });
77
78
  });
78
- function kt({
79
+ function Pt({
79
80
  id: t,
80
81
  items: r,
81
82
  onSelectItem: e,
82
83
  onActiveItemChange: o,
83
84
  renderItem: a,
84
- className: l,
85
- noItemsMessage: d = "No items",
86
- anchor: i,
87
- "aria-label": s = "Items",
85
+ className: d,
86
+ noItemsMessage: l = "No items",
87
+ anchor: s,
88
+ "aria-label": i = "Items",
88
89
  ...c
89
90
  }) {
90
- const [m, p] = D(0), h = P((x) => {
91
- if (p(x), o) {
92
- const [b, f] = [...r.entries()][x];
93
- o(b, f);
91
+ const [m, u] = R(0), f = T((x) => {
92
+ if (u(x), o) {
93
+ const [b, p] = [...r.entries()][x];
94
+ o(b, p);
94
95
  }
95
96
  }, [r, o]);
96
97
  return M(() => {
97
- const x = i == null ? void 0 : i.current;
98
+ const x = s == null ? void 0 : s.current;
98
99
  if (!x)
99
100
  return;
100
- const b = (f) => {
101
- ["Enter", "ArrowUp", "ArrowDown"].includes(f.key) && f.preventDefault(), f.key === "ArrowDown" ? h(Math.min(m + 1, r.size - 1)) : f.key === "ArrowUp" ? h(Math.max(m - 1, 0)) : f.key === "Enter" && e([...r.values()][m]);
101
+ const b = (p) => {
102
+ ["Enter", "ArrowUp", "ArrowDown"].includes(p.key) && p.preventDefault(), p.key === "ArrowDown" ? f(Math.min(m + 1, r.size - 1)) : p.key === "ArrowUp" ? f(Math.max(m - 1, 0)) : p.key === "Enter" && e([...r.values()][m]);
102
103
  };
103
104
  return x.addEventListener("keydown", b), () => x.removeEventListener("keydown", b);
104
- }, [m, i, h, r, e]), /* @__PURE__ */ g(
105
+ }, [m, s, f, r, e]), /* @__PURE__ */ g(
105
106
  N,
106
107
  {
107
108
  id: t,
108
- className: w("tw:py-1 tw:flex tw:flex-col", l),
109
+ className: w("tw:py-1 tw:flex tw:flex-col", d),
109
110
  role: "listbox",
110
111
  "aria-orientation": "vertical",
111
- "aria-label": s,
112
+ "aria-label": i,
112
113
  ...c,
113
114
  children: [
114
- r.size === 0 && /* @__PURE__ */ n("i", { role: "option", "aria-disabled": !0, "aria-selected": !1, "data-testid": "no-items", className: "tw:px-2 tw:py-1", children: d }),
115
- [...r.entries()].map(([x, b], f) => /* @__PURE__ */ n(
115
+ r.size === 0 && /* @__PURE__ */ n("i", { role: "option", "aria-disabled": !0, "aria-selected": !1, "data-testid": "no-items", className: "tw:px-2 tw:py-1", children: l }),
116
+ [...r.entries()].map(([x, b], p) => /* @__PURE__ */ n(
116
117
  "button",
117
118
  {
118
119
  id: `${t}_${x}`,
119
120
  type: "button",
120
121
  role: "option",
121
- "aria-selected": f === m,
122
+ "aria-selected": p === m,
122
123
  className: w(
123
124
  "tw:px-2 tw:py-1 tw:text-left tw:truncate",
124
- { "tw:bg-lm-secondary tw:dark:bg-dm-secondary": f === m }
125
+ { "tw:bg-lm-secondary tw:dark:bg-dm-secondary": p === m }
125
126
  ),
126
127
  tabIndex: -1,
127
128
  onClick: () => e(b),
128
- onMouseOver: () => h(f),
129
+ onMouseOver: () => f(p),
129
130
  children: a(b)
130
131
  },
131
132
  x
@@ -134,7 +135,7 @@ function kt({
134
135
  }
135
136
  );
136
137
  }
137
- const E = H(void 0), L = H({ responsive: !0, size: "md" }), vt = ({ children: t, className: r }) => {
138
+ const E = S(void 0), L = S({ responsive: !0, size: "md" }), Lt = ({ children: t, className: r }) => {
138
139
  const { responsive: e } = C(L);
139
140
  return /* @__PURE__ */ n(E.Provider, { value: { section: "head" }, children: /* @__PURE__ */ n(
140
141
  "thead",
@@ -146,7 +147,7 @@ const E = H(void 0), L = H({ responsive: !0, size: "md" }), vt = ({ children: t,
146
147
  children: t
147
148
  }
148
149
  ) });
149
- }, Nt = ({ children: t, className: r }) => {
150
+ }, Bt = ({ children: t, className: r }) => {
150
151
  const { responsive: e } = C(L);
151
152
  return /* @__PURE__ */ n(E.Provider, { value: { section: "body" }, children: /* @__PURE__ */ n(
152
153
  "tbody",
@@ -158,7 +159,7 @@ const E = H(void 0), L = H({ responsive: !0, size: "md" }), vt = ({ children: t,
158
159
  children: t
159
160
  }
160
161
  ) });
161
- }, Ct = ({ children: t, className: r }) => {
162
+ }, Mt = ({ children: t, className: r }) => {
162
163
  const { responsive: e } = C(L);
163
164
  return /* @__PURE__ */ n(E.Provider, { value: { section: "footer" }, children: /* @__PURE__ */ n(
164
165
  "tfoot",
@@ -170,16 +171,16 @@ const E = H(void 0), L = H({ responsive: !0, size: "md" }), vt = ({ children: t,
170
171
  children: t
171
172
  }
172
173
  ) });
173
- }, Pt = ({ children: t, className: r, ...e }) => {
174
- const o = C(E), a = (o == null ? void 0 : o.section) === "body", { responsive: l } = C(L);
174
+ }, Rt = ({ children: t, className: r, ...e }) => {
175
+ const o = C(E), a = (o == null ? void 0 : o.section) === "body", { responsive: d } = C(L);
175
176
  return /* @__PURE__ */ n(
176
177
  "tr",
177
178
  {
178
179
  className: w(
179
180
  "tw:group",
180
181
  {
181
- "tw:lg:table-row tw:flex tw:flex-col": l,
182
- "tw:lg:border-0 tw:border-y-2 tw:border-lm-border tw:dark:border-dm-border": l,
182
+ "tw:lg:table-row tw:flex tw:flex-col": d,
183
+ "tw:lg:border-0 tw:border-y-2 tw:border-lm-border tw:dark:border-dm-border": d,
183
184
  "tw:hover:bg-lm-primary tw:dark:hover:bg-dm-primary": a,
184
185
  // Use a different hover bg color depending on the table being inside a card or not
185
186
  "tw:group-[&]/card:hover:bg-lm-secondary tw:dark:group-[&]/card:hover:bg-dm-secondary": a
@@ -190,22 +191,22 @@ const E = H(void 0), L = H({ responsive: !0, size: "md" }), vt = ({ children: t,
190
191
  children: t
191
192
  }
192
193
  );
193
- }, Tt = ({ children: t, className: r, columnName: e, type: o, ...a }) => {
194
- const l = C(E), d = o ?? ((l == null ? void 0 : l.section) !== "body" ? "th" : "td"), { responsive: i, size: s } = C(L);
194
+ }, Et = ({ children: t, className: r, columnName: e, type: o, ...a }) => {
195
+ const d = C(E), l = o ?? ((d == null ? void 0 : d.section) !== "body" ? "th" : "td"), { responsive: s, size: i } = C(L);
195
196
  return /* @__PURE__ */ n(
196
- d,
197
+ l,
197
198
  {
198
- "data-column": i ? e : void 0,
199
+ "data-column": s ? e : void 0,
199
200
  className: w(
200
201
  "tw:border-lm-border tw:dark:border-dm-border",
201
202
  {
202
- "tw:p-1": s === "sm",
203
- "tw:p-2": s === "md",
204
- "tw:p-3": s === "lg",
205
- "tw:border-b-1": !i,
206
- "tw:block tw:lg:table-cell tw:not-last:border-b-1 tw:lg:border-b-1": i,
203
+ "tw:p-1": i === "sm",
204
+ "tw:p-2": i === "md",
205
+ "tw:p-3": i === "lg",
206
+ "tw:border-b-1": !s,
207
+ "tw:block tw:lg:table-cell tw:not-last:border-b-1 tw:lg:border-b-1": s,
207
208
  // For responsive tables, display the content in data-column attribute for md sizes and lower
208
- "tw:before:lg:hidden tw:before:content-[attr(data-column)] tw:before:font-bold tw:before:mr-1": i && d === "td"
209
+ "tw:before:lg:hidden tw:before:content-[attr(data-column)] tw:before:font-bold tw:before:mr-1": s && l === "td"
209
210
  },
210
211
  r
211
212
  ),
@@ -213,83 +214,81 @@ const E = H(void 0), L = H({ responsive: !0, size: "md" }), vt = ({ children: t,
213
214
  children: t
214
215
  }
215
216
  );
216
- }, It = ({ header: t, footer: r, children: e, responsive: o = !0, size: a = "md", ...l }) => /* @__PURE__ */ n(L.Provider, { value: { responsive: o, size: a }, children: /* @__PURE__ */ g("table", { className: "tw:w-full", ...l, children: [
217
- /* @__PURE__ */ n(vt, { children: t }),
218
- /* @__PURE__ */ n(Nt, { children: e }),
219
- r && /* @__PURE__ */ n(Ct, { children: r })
220
- ] }) }), te = Object.assign(It, { Row: Pt, Cell: Tt }), Lt = ({
217
+ }, Ft = ({ header: t, footer: r, children: e, responsive: o = !0, size: a = "md", ...d }) => /* @__PURE__ */ n(L.Provider, { value: { responsive: o, size: a }, children: /* @__PURE__ */ g("table", { className: "tw:w-full", ...d, children: [
218
+ /* @__PURE__ */ n(Lt, { children: t }),
219
+ /* @__PURE__ */ n(Bt, { children: e }),
220
+ r && /* @__PURE__ */ n(Mt, { children: r })
221
+ ] }) }), de = Object.assign(Ft, { Row: Rt, Cell: Et }), _t = h(({
221
222
  children: t,
222
223
  className: r,
223
224
  disabled: e,
224
225
  variant: o = "primary",
225
226
  size: a = "md",
226
- inline: l = !1,
227
- solid: d = !1,
228
- type: i = "button",
229
- ...s
230
- }) => {
231
- const c = "to" in s ? j : "button", m = c === j ? void 0 : i;
232
- return (
233
- // @ts-expect-error We are explicitly checking for the `to` prop before using Link
234
- /* @__PURE__ */ n(
235
- c,
236
- {
237
- className: w(
238
- {
239
- "tw:inline-flex": l,
240
- "tw:flex": !l
241
- },
242
- "tw:gap-2 tw:items-center tw:justify-center",
243
- "tw:border tw:rounded-md tw:no-underline",
244
- "tw:transition-colors",
245
- {
246
- "tw:focus-ring": o === "primary",
247
- "tw:focus-ring-secondary": o === "secondary",
248
- "tw:focus-ring-danger": o === "danger"
249
- },
250
- {
251
- "tw:px-1.5 tw:py-1 tw:text-sm": a === "sm",
252
- "tw:px-3 tw:py-1.5": a === "md",
253
- "tw:px-4 tw:py-2 tw:text-lg": a === "lg"
254
- },
255
- {
256
- "tw:border-lm-brand tw:dark:border-dm-brand": o === "primary",
257
- "tw:text-lm-brand tw:dark:text-dm-brand": o === "primary" && !d,
258
- "tw:border-zinc-500": o === "secondary",
259
- "tw:text-zinc-500": o === "secondary" && !d,
260
- "tw:border-danger": o === "danger",
261
- "tw:text-danger": o === "danger" && !d
262
- },
263
- d && {
264
- "tw:text-white": !0,
265
- "tw:bg-lm-brand tw:dark:bg-dm-brand": o === "primary",
266
- "tw:highlight:bg-lm-brand-dark tw:dark:highlight:bg-dm-brand-dark": o === "primary",
267
- "tw:highlight:border-lm-brand-dark tw:dark:highlight:border-dm-brand-dark": o === "primary",
268
- "tw:bg-zinc-500": o === "secondary",
269
- "tw:highlight:bg-zinc-600 tw:highlight:border-zinc-600": o === "secondary",
270
- "tw:bg-danger": o === "danger",
271
- "tw:highlight:bg-danger-dark tw:highlight:border-danger-dark": o === "danger"
272
- },
273
- !e && {
274
- "tw:highlight:text-white": !d,
275
- "tw:highlight:bg-lm-brand tw:dark:highlight:bg-dm-brand": o === "primary",
276
- "tw:highlight:bg-zinc-500": o === "secondary",
277
- "tw:highlight:bg-danger": o === "danger"
278
- },
279
- {
280
- "tw:pointer-events-none tw:opacity-65": e
281
- },
282
- r
283
- ),
284
- disabled: e,
285
- type: m,
286
- ...s,
287
- children: t
288
- }
289
- )
227
+ inline: d = !1,
228
+ solid: l = !1,
229
+ type: s = "button",
230
+ ...i
231
+ }, c) => {
232
+ const m = "to" in i ? j : "button", u = m === j ? void 0 : s;
233
+ return /* @__PURE__ */ n(
234
+ m,
235
+ {
236
+ ref: c,
237
+ className: w(
238
+ {
239
+ "tw:inline-flex": d,
240
+ "tw:flex": !d
241
+ },
242
+ "tw:gap-2 tw:items-center tw:justify-center",
243
+ "tw:border tw:rounded-md tw:no-underline",
244
+ "tw:transition-colors",
245
+ {
246
+ "tw:focus-ring": o === "primary",
247
+ "tw:focus-ring-secondary": o === "secondary",
248
+ "tw:focus-ring-danger": o === "danger"
249
+ },
250
+ {
251
+ "tw:px-1.5 tw:py-1 tw:text-sm": a === "sm",
252
+ "tw:px-3 tw:py-1.5": a === "md",
253
+ "tw:px-4 tw:py-2 tw:text-lg": a === "lg"
254
+ },
255
+ {
256
+ "tw:border-lm-brand tw:dark:border-dm-brand": o === "primary",
257
+ "tw:text-lm-brand tw:dark:text-dm-brand": o === "primary" && !l,
258
+ "tw:border-zinc-500": o === "secondary",
259
+ "tw:text-zinc-500": o === "secondary" && !l,
260
+ "tw:border-danger": o === "danger",
261
+ "tw:text-danger": o === "danger" && !l
262
+ },
263
+ l && {
264
+ "tw:text-white": !0,
265
+ "tw:bg-lm-brand tw:dark:bg-dm-brand": o === "primary",
266
+ "tw:highlight:bg-lm-brand-dark tw:dark:highlight:bg-dm-brand-dark": o === "primary",
267
+ "tw:highlight:border-lm-brand-dark tw:dark:highlight:border-dm-brand-dark": o === "primary",
268
+ "tw:bg-zinc-500": o === "secondary",
269
+ "tw:highlight:bg-zinc-600 tw:highlight:border-zinc-600": o === "secondary",
270
+ "tw:bg-danger": o === "danger",
271
+ "tw:highlight:bg-danger-dark tw:highlight:border-danger-dark": o === "danger"
272
+ },
273
+ !e && {
274
+ "tw:highlight:text-white": !l,
275
+ "tw:highlight:bg-lm-brand tw:dark:highlight:bg-dm-brand": o === "primary",
276
+ "tw:highlight:bg-zinc-500": o === "secondary",
277
+ "tw:highlight:bg-danger": o === "danger"
278
+ },
279
+ {
280
+ "tw:pointer-events-none tw:opacity-65": e
281
+ },
282
+ r
283
+ ),
284
+ disabled: e,
285
+ type: u,
286
+ ...i,
287
+ children: t
288
+ }
290
289
  );
291
- }, Y = u(({ className: t, onChange: r, ...e }, o) => {
292
- const a = P((l) => r == null ? void 0 : r(l.target.checked, l), [r]);
290
+ }), Y = h(({ className: t, onChange: r, ...e }, o) => {
291
+ const a = T((d) => r == null ? void 0 : r(d.target.checked, d), [r]);
293
292
  return /* @__PURE__ */ n(
294
293
  "input",
295
294
  {
@@ -307,16 +306,17 @@ const E = H(void 0), L = H({ responsive: !0, size: "md" }), vt = ({ children: t,
307
306
  ...e
308
307
  }
309
308
  );
310
- }), ee = u(({ className: t, ...r }, e) => /* @__PURE__ */ n(
309
+ }), se = h(({ className: t, ...r }, e) => /* @__PURE__ */ n(
311
310
  Y,
312
311
  {
313
312
  ref: e,
314
313
  className: y("tw:rounded-sm tw:w-4 tw:h-4 tw:checked:bg-(image:--tick) tw:bg-center", t),
315
314
  ...r
316
315
  }
317
- )), Q = ({ onClick: t, className: r, label: e = "Close" }) => /* @__PURE__ */ n(
316
+ )), Q = h(({ onClick: t, className: r, label: e = "Close" }, o) => /* @__PURE__ */ n(
318
317
  "button",
319
318
  {
319
+ ref: o,
320
320
  type: "button",
321
321
  onClick: t,
322
322
  className: w(
@@ -325,22 +325,22 @@ const E = H(void 0), L = H({ responsive: !0, size: "md" }), vt = ({ children: t,
325
325
  r
326
326
  ),
327
327
  "aria-label": e,
328
- children: /* @__PURE__ */ n(v, { icon: dt, size: "xl" })
328
+ children: /* @__PURE__ */ n(v, { icon: lt, size: "xl" })
329
329
  }
330
- ), U = u(({
330
+ )), W = h(({
331
331
  borderless: t = !1,
332
332
  size: r = "md",
333
333
  feedback: e,
334
334
  className: o,
335
335
  disabled: a,
336
- readOnly: l,
337
- ...d
338
- }, i) => {
339
- const s = !a && !l;
336
+ readOnly: d,
337
+ ...l
338
+ }, s) => {
339
+ const i = !a && !d;
340
340
  return /* @__PURE__ */ n(
341
341
  "input",
342
342
  {
343
- ref: i,
343
+ ref: s,
344
344
  className: w(
345
345
  "tw:w-full",
346
346
  {
@@ -356,19 +356,19 @@ const E = H(void 0), L = H({ responsive: !0, size: "md" }), vt = ({ children: t,
356
356
  "tw:rounded-md tw:border": !t,
357
357
  "tw:border-lm-input-border tw:dark:border-dm-input-border": !t && !e,
358
358
  "tw:border-danger": !t && e === "error",
359
- "tw:bg-lm-disabled-input tw:dark:bg-dm-disabled-input": !s,
360
- "tw:bg-lm-primary tw:dark:bg-dm-primary": s,
359
+ "tw:bg-lm-disabled-input tw:dark:bg-dm-disabled-input": !i,
360
+ "tw:bg-lm-primary tw:dark:bg-dm-primary": i,
361
361
  // Use different background color when rendered inside a card
362
- "tw:group-[&]/card:bg-lm-input tw:group-[&]/card:dark:bg-dm-input": s
362
+ "tw:group-[&]/card:bg-lm-input tw:group-[&]/card:dark:bg-dm-input": i
363
363
  },
364
364
  o
365
365
  ),
366
366
  disabled: a,
367
- readOnly: l,
368
- ...d
367
+ readOnly: d,
368
+ ...l
369
369
  }
370
370
  );
371
- }), W = ({ required: t, children: r, className: e, ...o }) => /* @__PURE__ */ g("label", { className: y("tw:cursor-pointer", e), ...o, children: [
371
+ }), U = ({ required: t, children: r, className: e, ...o }) => /* @__PURE__ */ g("label", { className: y("tw:cursor-pointer", e), ...o, children: [
372
372
  r,
373
373
  t && /* @__PURE__ */ n("span", { className: "tw:text-danger tw:ml-1", "data-testid": "required-indicator", children: "*" })
374
374
  ] }), K = ({ children: t, helpText: r, error: e, "data-testid": o }) => /* @__PURE__ */ g("div", { className: "tw:flex tw:flex-col tw:gap-1", "data-testid": o, children: [
@@ -382,39 +382,39 @@ const E = H(void 0), L = H({ responsive: !0, size: "md" }), vt = ({ children: t,
382
382
  }
383
383
  ),
384
384
  e && /* @__PURE__ */ n("span", { "data-testid": o ? `${o}-error` : "error", className: "tw:text-danger", children: e })
385
- ] }), re = u(({ label: t, inputClassName: r, required: e, hiddenRequired: o, error: a, helpText: l, "data-testid": d, ...i }, s) => {
386
- const c = F();
387
- return /* @__PURE__ */ g(K, { error: a, helpText: l, "data-testid": d, children: [
388
- /* @__PURE__ */ n(W, { htmlFor: c, required: e, children: t }),
385
+ ] }), ie = h(({ label: t, inputClassName: r, required: e, hiddenRequired: o, error: a, helpText: d, "data-testid": l, ...s }, i) => {
386
+ const c = D();
387
+ return /* @__PURE__ */ g(K, { error: a, helpText: d, "data-testid": l, children: [
388
+ /* @__PURE__ */ n(U, { htmlFor: c, required: e, children: t }),
389
389
  /* @__PURE__ */ n(
390
- U,
390
+ W,
391
391
  {
392
- ref: s,
392
+ ref: i,
393
393
  id: c,
394
394
  className: r,
395
395
  required: e || o,
396
396
  feedback: a ? "error" : void 0,
397
- ...i
397
+ ...s
398
398
  }
399
399
  )
400
400
  ] });
401
- }), Bt = u(({ containerClassName: t, className: r, size: e, ...o }, a) => {
402
- const [l, d, , i] = ct(!1), s = I(null), c = P(({ relatedTarget: m }) => {
403
- var p;
404
- (p = s.current) != null && p.contains(m) || i();
405
- }, [s, i]);
401
+ }), Dt = h(({ containerClassName: t, className: r, size: e, ...o }, a) => {
402
+ const [d, l, , s] = ct(!1), i = I(null), c = T(({ relatedTarget: m }) => {
403
+ var u;
404
+ (u = i.current) != null && u.contains(m) || s();
405
+ }, [i, s]);
406
406
  return /* @__PURE__ */ g(
407
407
  "div",
408
408
  {
409
409
  className: y("tw:group tw:relative", t),
410
- ref: s,
410
+ ref: i,
411
411
  onBlurCapture: c,
412
412
  children: [
413
413
  /* @__PURE__ */ n(
414
- U,
414
+ W,
415
415
  {
416
416
  ref: a,
417
- type: l ? "text" : "password",
417
+ type: d ? "text" : "password",
418
418
  className: y(
419
419
  {
420
420
  "tw:pr-10": e !== "sm",
@@ -431,9 +431,9 @@ const E = H(void 0), L = H({ responsive: !0, size: "md" }), vt = ({ children: t,
431
431
  "button",
432
432
  {
433
433
  type: "button",
434
- onClick: d,
435
- title: l ? "Hide password" : "Show password",
436
- "aria-label": l ? "Hide password" : "Show password",
434
+ onClick: l,
435
+ title: d ? "Hide password" : "Show password",
436
+ "aria-label": d ? "Hide password" : "Show password",
437
437
  className: y(
438
438
  "tw:absolute tw:top-[50%] tw:translate-y-[-50%] tw:px-1",
439
439
  "tw:text-placeholder tw:hover:text-lm-text tw:hover:dark:text-dm-text tw:transition-colors",
@@ -443,39 +443,39 @@ const E = H(void 0), L = H({ responsive: !0, size: "md" }), vt = ({ children: t,
443
443
  }
444
444
  ),
445
445
  tabIndex: -1,
446
- children: /* @__PURE__ */ n(v, { fixedWidth: !0, icon: l ? lt : it })
446
+ children: /* @__PURE__ */ n(v, { fixedWidth: !0, icon: d ? dt : st })
447
447
  }
448
448
  )
449
449
  ]
450
450
  }
451
451
  );
452
- }), oe = u(({ label: t, inputClassName: r, required: e, hiddenRequired: o, error: a, helpText: l, "data-testid": d, ...i }, s) => {
453
- const c = F();
454
- return /* @__PURE__ */ g(K, { error: a, helpText: l, "data-testid": d, children: [
455
- /* @__PURE__ */ n(W, { htmlFor: c, required: e, children: t }),
452
+ }), we = h(({ label: t, inputClassName: r, required: e, hiddenRequired: o, error: a, helpText: d, "data-testid": l, ...s }, i) => {
453
+ const c = D();
454
+ return /* @__PURE__ */ g(K, { error: a, helpText: d, "data-testid": l, children: [
455
+ /* @__PURE__ */ n(U, { htmlFor: c, required: e, children: t }),
456
456
  /* @__PURE__ */ n(
457
- Bt,
457
+ Dt,
458
458
  {
459
- ref: s,
459
+ ref: i,
460
460
  id: c,
461
461
  className: r,
462
462
  required: e || o,
463
463
  feedback: a ? "error" : void 0,
464
- ...i
464
+ ...s
465
465
  }
466
466
  )
467
467
  ] });
468
- }), Mt = u(({
468
+ }), $t = h(({
469
469
  className: t,
470
470
  size: r = "md",
471
471
  feedback: e,
472
472
  style: o = {},
473
473
  disabled: a,
474
- ...l
475
- }, d) => /* @__PURE__ */ n(
474
+ ...d
475
+ }, l) => /* @__PURE__ */ n(
476
476
  "select",
477
477
  {
478
- ref: d,
478
+ ref: l,
479
479
  className: w(
480
480
  "tw:w-full tw:appearance-none tw:pr-9",
481
481
  "tw:bg-(image:--chevron-down) tw:bg-no-repeat",
@@ -503,41 +503,41 @@ const E = H(void 0), L = H({ responsive: !0, size: "md" }), vt = ({ children: t,
503
503
  background: "right 0.75rem center / 16px 12px"
504
504
  },
505
505
  disabled: a,
506
- ...l
506
+ ...d
507
507
  }
508
- )), ne = u(({ selectClassName: t, label: r, error: e, helpText: o, required: a, hiddenRequired: l, "data-testid": d, ...i }, s) => {
509
- const c = F();
510
- return /* @__PURE__ */ g(K, { error: e, helpText: o, "data-testid": d, children: [
511
- /* @__PURE__ */ n(W, { htmlFor: c, required: a, children: r }),
508
+ )), ce = h(({ selectClassName: t, label: r, error: e, helpText: o, required: a, hiddenRequired: d, "data-testid": l, ...s }, i) => {
509
+ const c = D();
510
+ return /* @__PURE__ */ g(K, { error: e, helpText: o, "data-testid": l, children: [
511
+ /* @__PURE__ */ n(U, { htmlFor: c, required: a, children: r }),
512
512
  /* @__PURE__ */ n(
513
- Mt,
513
+ $t,
514
514
  {
515
- ref: s,
515
+ ref: i,
516
516
  id: c,
517
517
  className: t,
518
- required: a || l,
518
+ required: a || d,
519
519
  feedback: e ? "error" : void 0,
520
- ...i
520
+ ...s
521
521
  }
522
522
  )
523
523
  ] });
524
- }), Et = u(({
524
+ }), Ht = h(({
525
525
  onChange: t,
526
526
  containerClassName: r,
527
527
  inputClassName: e,
528
528
  // Inputs have a default 'md' size. Search inputs are usually 'lg' as they are rendered at the top of sections
529
529
  size: o = "lg",
530
530
  loading: a = !1,
531
- ...l
532
- }, d) => {
533
- const { setTimeout: i, clearCurrentTimeout: s } = mt(500), c = P((m) => {
534
- m ? i(() => t(m)) : (s(), t(m));
535
- }, [s, t, i]);
531
+ ...d
532
+ }, l) => {
533
+ const { setTimeout: s, clearCurrentTimeout: i } = mt(500), c = T((m) => {
534
+ m ? s(() => t(m)) : (i(), t(m));
535
+ }, [i, t, s]);
536
536
  return /* @__PURE__ */ g("div", { className: w("tw:group tw:relative tw:focus-within:z-10", r), children: [
537
537
  /* @__PURE__ */ n(
538
538
  v,
539
539
  {
540
- icon: a ? X : st,
540
+ icon: a ? X : it,
541
541
  spin: a,
542
542
  className: w(
543
543
  "tw:absolute tw:top-[50%] tw:translate-y-[-50%] tw:transition-colors",
@@ -550,9 +550,9 @@ const E = H(void 0), L = H({ responsive: !0, size: "md" }), vt = ({ children: t,
550
550
  }
551
551
  ),
552
552
  /* @__PURE__ */ n(
553
- U,
553
+ W,
554
554
  {
555
- ref: d,
555
+ ref: l,
556
556
  type: "search",
557
557
  className: w(
558
558
  {
@@ -564,27 +564,27 @@ const E = H(void 0), L = H({ responsive: !0, size: "md" }), vt = ({ children: t,
564
564
  placeholder: "Search...",
565
565
  onChange: (m) => c(m.target.value),
566
566
  size: o,
567
- ...l
567
+ ...d
568
568
  }
569
569
  )
570
570
  ] });
571
571
  });
572
- function ae({
572
+ function me({
573
573
  searchResults: t,
574
574
  onSearch: r,
575
575
  onSelectSearchResult: e,
576
576
  renderSearchResult: o,
577
577
  size: a = "md",
578
578
  // SearchInput defaults its size to 'lg'. Change it to 'md'
579
- listboxSpan: l = "full",
580
- onFocus: d,
581
- ...i
579
+ listboxSpan: d = "full",
580
+ onFocus: l,
581
+ ...s
582
582
  }) {
583
- const s = I(null), c = F(), [m, p] = D(), h = O(
583
+ const i = I(null), c = D(), [m, u] = R(), f = $(
584
584
  () => t ? m ?? [...t.keys()][0] : void 0,
585
585
  [m, t]
586
- ), x = P((b) => {
587
- e(b), r(""), s.current.value = "";
586
+ ), x = T((b) => {
587
+ e(b), r(""), i.current.value = "";
588
588
  }, [r, e]);
589
589
  return /* @__PURE__ */ g(
590
590
  "div",
@@ -595,38 +595,38 @@ function ae({
595
595
  },
596
596
  children: [
597
597
  /* @__PURE__ */ n(
598
- Et,
598
+ Ht,
599
599
  {
600
600
  onChange: r,
601
601
  size: a,
602
- ref: s,
602
+ ref: i,
603
603
  role: "combobox",
604
604
  "aria-autocomplete": "list",
605
605
  "aria-expanded": !!t,
606
606
  "aria-controls": c,
607
- "aria-activedescendant": h ? `${c}_${h}` : void 0,
607
+ "aria-activedescendant": f ? `${c}_${f}` : void 0,
608
608
  autoComplete: "off",
609
609
  autoCorrect: "off",
610
610
  onFocus: (b) => {
611
- d == null || d(b), r(b.target.value);
611
+ l == null || l(b), r(b.target.value);
612
612
  },
613
- ...i
613
+ ...s
614
614
  }
615
615
  ),
616
616
  t && /* @__PURE__ */ n(
617
- kt,
617
+ Pt,
618
618
  {
619
619
  id: c,
620
620
  items: t,
621
- anchor: s,
621
+ anchor: i,
622
622
  onSelectItem: x,
623
- onActiveItemChange: p,
623
+ onActiveItemChange: u,
624
624
  renderItem: o,
625
625
  className: w(
626
626
  "tw:absolute tw:top-full tw:mt-1 tw:z-10",
627
627
  {
628
- "tw:min-w-60 tw:max-w-full": l === "auto",
629
- "tw:w-full": l === "full"
628
+ "tw:min-w-60 tw:max-w-full": d === "auto",
629
+ "tw:w-full": d === "full"
630
630
  }
631
631
  ),
632
632
  "aria-label": "Matching items",
@@ -637,7 +637,7 @@ function ae({
637
637
  }
638
638
  );
639
639
  }
640
- const de = u(({ className: t, ...r }, e) => /* @__PURE__ */ n(
640
+ const be = h(({ className: t, ...r }, e) => /* @__PURE__ */ n(
641
641
  Y,
642
642
  {
643
643
  ref: e,
@@ -650,7 +650,7 @@ const de = u(({ className: t, ...r }, e) => /* @__PURE__ */ n(
650
650
  ),
651
651
  ...r
652
652
  }
653
- )), Rt = ({ className: t, disabled: r, size: e = "md", type: o = "button", ...a }) => /* @__PURE__ */ n(
653
+ )), Ot = h(({ className: t, disabled: r, size: e = "md", type: o = "button", ...a }, d) => /* @__PURE__ */ n(
654
654
  "button",
655
655
  {
656
656
  className: w(
@@ -667,9 +667,10 @@ const de = u(({ className: t, ...r }, e) => /* @__PURE__ */ n(
667
667
  ),
668
668
  disabled: r,
669
669
  type: o,
670
- ...a
670
+ ...a,
671
+ ref: d
671
672
  }
672
- ), Z = H(null), _t = ({ className: t, to: r, ...e }) => {
673
+ )), Z = S(null), jt = ({ className: t, to: r, ...e }) => {
673
674
  const o = C(Z);
674
675
  return /* @__PURE__ */ n(
675
676
  at,
@@ -693,13 +694,13 @@ const de = u(({ className: t, ...r }, e) => /* @__PURE__ */ n(
693
694
  ...e
694
695
  }
695
696
  );
696
- }, Dt = ({ children: t, className: r, fill: e }) => /* @__PURE__ */ n(Z.Provider, { value: { fill: e }, children: /* @__PURE__ */ n(N, { role: "menubar", className: w("tw:flex tw:overflow-hidden", r), children: t }) }), le = Object.assign(Dt, { Pill: _t }), Ft = new Intl.NumberFormat("en-US"), $t = (t) => Ft.format(Number(t)), V = 10, ie = (t) => Math.ceil(t / V) * V, T = 2, _ = "...", St = (t, r) => Array.from({ length: r - t }, (e, o) => t + o), jt = (t, r) => {
697
- const e = St(
698
- Math.max(T, t - T),
699
- Math.min(r - 1, t + T) + 1
697
+ }, At = ({ children: t, className: r, fill: e }) => /* @__PURE__ */ n(Z.Provider, { value: { fill: e }, children: /* @__PURE__ */ n(N, { role: "menubar", className: w("tw:flex tw:overflow-hidden", r), children: t }) }), ge = Object.assign(At, { Pill: jt }), St = new Intl.NumberFormat("en-US"), Wt = (t) => St.format(Number(t)), V = 10, pe = (t) => Math.ceil(t / V) * V, P = 2, _ = "...", Ut = (t, r) => Array.from({ length: r - t }, (e, o) => t + o), Kt = (t, r) => {
698
+ const e = Ut(
699
+ Math.max(P, t - P),
700
+ Math.min(r - 1, t + P) + 1
700
701
  );
701
- return t - T > T && e.unshift(_), t + T < r - 1 && e.push(_), e.unshift(1), e.push(r), e;
702
- }, B = (t) => t === _, At = (t) => B(t) ? t : $t(t), Ht = (t, r) => B(t) ? `${t}_${r}` : `${t}`, tt = [
702
+ return t - P > P && e.unshift(_), t + P < r - 1 && e.push(_), e.unshift(1), e.push(r), e;
703
+ }, B = (t) => t === _, zt = (t) => B(t) ? t : Wt(t), qt = (t, r) => B(t) ? `${t}_${r}` : `${t}`, tt = [
703
704
  "tw:border tw:border-r-0 tw:last:border-r tw:border-lm-border tw:dark:border-dm-border",
704
705
  "tw:rounded-none tw:first:rounded-l tw:last:rounded-r"
705
706
  ], et = (t = !1) => w(
@@ -713,60 +714,60 @@ const de = u(({ className: t, ...r }, e) => /* @__PURE__ */ n(
713
714
  ],
714
715
  t && "tw:bg-lm-main tw:dark:bg-dm-main tw:text-white"
715
716
  ), 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: _ });
716
- function Ot({ children: t, active: r, isEllipsis: e, href: o, ...a }) {
717
- const l = O(() => et(r), [r]);
718
- return e ? /* @__PURE__ */ n(rt, {}) : /* @__PURE__ */ n(j, { className: l, to: o, ...a, children: t });
717
+ function Gt({ children: t, active: r, isEllipsis: e, href: o, ...a }) {
718
+ const d = $(() => et(r), [r]);
719
+ return e ? /* @__PURE__ */ n(rt, {}) : /* @__PURE__ */ n(j, { className: d, to: o, ...a, children: t });
719
720
  }
720
- function Ut({ children: t, active: r, isEllipsis: e, ...o }) {
721
- const a = O(() => et(r), [r]);
721
+ function Jt({ children: t, active: r, isEllipsis: e, ...o }) {
722
+ const a = $(() => et(r), [r]);
722
723
  return e ? /* @__PURE__ */ n(rt, {}) : /* @__PURE__ */ n("button", { type: "button", className: a, ...o, children: t });
723
724
  }
724
- const se = ({ currentPage: t, pagesCount: r, ...e }) => {
725
- const o = "urlForPage" in e, a = o ? Ot : Ut, l = P(
726
- (d) => o ? { href: B(d) ? void 0 : e.urlForPage(d) } : { onClick: () => !B(d) && e.onPageChange(d) },
725
+ const ue = ({ currentPage: t, pagesCount: r, ...e }) => {
726
+ const o = "urlForPage" in e, a = o ? Gt : Jt, d = T(
727
+ (l) => o ? { href: B(l) ? void 0 : e.urlForPage(l) } : { onClick: () => !B(l) && e.onPageChange(l) },
727
728
  [o, e]
728
729
  );
729
730
  return r < 2 ? null : /* @__PURE__ */ g("div", { className: "tw:select-none tw:flex", "data-testid": "paginator", children: [
730
- t === 1 ? /* @__PURE__ */ n(A, { children: /* @__PURE__ */ n(v, { size: "xs", icon: G }) }) : /* @__PURE__ */ n(a, { ...l(Math.max(1, t - 1)), "aria-label": "Previous", children: /* @__PURE__ */ n(v, { size: "xs", icon: G }) }),
731
- jt(t, r).map((d, i) => /* @__PURE__ */ n(
731
+ t === 1 ? /* @__PURE__ */ n(A, { children: /* @__PURE__ */ n(v, { size: "xs", icon: G }) }) : /* @__PURE__ */ n(a, { ...d(Math.max(1, t - 1)), "aria-label": "Previous", children: /* @__PURE__ */ n(v, { size: "xs", icon: G }) }),
732
+ Kt(t, r).map((l, s) => /* @__PURE__ */ n(
732
733
  a,
733
734
  {
734
- active: d === t,
735
- isEllipsis: B(d),
736
- ...l(d),
737
- children: At(d)
735
+ active: l === t,
736
+ isEllipsis: B(l),
737
+ ...d(l),
738
+ children: zt(l)
738
739
  },
739
- Ht(d, i)
740
+ qt(l, s)
740
741
  )),
741
- t === r ? /* @__PURE__ */ n(A, { children: /* @__PURE__ */ n(v, { size: "xs", icon: J }) }) : /* @__PURE__ */ n(a, { ...l(Math.min(r, t + 1)), "aria-label": "Next", children: /* @__PURE__ */ n(v, { size: "xs", icon: J }) })
742
+ t === r ? /* @__PURE__ */ n(A, { children: /* @__PURE__ */ n(v, { size: "xs", icon: J }) }) : /* @__PURE__ */ n(a, { ...d(Math.min(r, t + 1)), "aria-label": "Next", children: /* @__PURE__ */ n(v, { size: "xs", icon: J }) })
742
743
  ] });
743
- }, Wt = ({
744
+ }, Qt = ({
744
745
  open: t,
745
746
  children: r,
746
747
  className: e,
747
748
  onClose: o,
748
749
  ...a
749
750
  }) => {
750
- const l = I(null);
751
+ const d = I(null);
751
752
  return M(() => {
752
753
  var c, m;
753
- const d = document.body, i = d.style.overflow, s = d.style.paddingRight;
754
+ const l = document.body, s = l.style.overflow, i = l.style.paddingRight;
754
755
  if (t) {
755
- const p = window.outerWidth - d.clientWidth, h = d.scrollHeight > d.clientHeight;
756
- d.style.overflow = "hidden", h && (d.style.paddingRight = `${p}px`), (c = l.current) == null || c.showModal();
756
+ const u = window.outerWidth - l.clientWidth, f = l.scrollHeight > l.clientHeight;
757
+ l.style.overflow = "hidden", f && (l.style.paddingRight = `${u}px`), (c = d.current) == null || c.showModal();
757
758
  } else
758
- (m = l.current) == null || m.close();
759
+ (m = d.current) == null || m.close();
759
760
  return () => {
760
- d.style.overflow = i, d.style.paddingRight = s;
761
+ l.style.overflow = s, l.style.paddingRight = i;
761
762
  };
762
- }, [t]), bt(
763
+ }, [t]), gt(
763
764
  /* @__PURE__ */ n(
764
765
  "dialog",
765
766
  {
766
- ref: l,
767
+ ref: d,
767
768
  className: w("tw:bg-transparent tw:backdrop:bg-black/50", e),
768
- onCancel: (d) => {
769
- d.preventDefault(), o();
769
+ onCancel: (l) => {
770
+ l.preventDefault(), o();
770
771
  },
771
772
  ...a,
772
773
  children: t && r
@@ -774,47 +775,47 @@ const se = ({ currentPage: t, pagesCount: r, ...e }) => {
774
775
  ),
775
776
  document.body
776
777
  );
777
- }, we = ({
778
+ }, he = ({
778
779
  open: t,
779
780
  onClose: r,
780
781
  variant: e = "default",
781
782
  title: o,
782
783
  children: a,
783
- className: l,
784
- ...d
784
+ className: d,
785
+ ...l
785
786
  }) => {
786
787
  const {
787
- size: i = "md",
788
- confirmText: s = "Confirm",
788
+ size: s = "md",
789
+ confirmText: i = "Confirm",
789
790
  cancelText: c = "Cancel",
790
791
  confirmDisabled: m,
791
- onConfirm: p,
792
- onClosed: h,
792
+ onConfirm: u,
793
+ onClosed: f,
793
794
  ...x
794
- } = "onConfirm" in d ? d : { ...d }, [b, f] = D(t), R = I(null), $ = I("cancel"), ot = P((k) => {
795
- k.preventDefault(), k.stopPropagation(), $.current = "confirm", p == null || p();
796
- }, [p]);
795
+ } = "onConfirm" in l ? l : { ...l }, [b, p] = R(t), F = I(null), H = I("cancel"), ot = T((k) => {
796
+ k.preventDefault(), k.stopPropagation(), H.current = "confirm", u == null || u();
797
+ }, [u]);
797
798
  return M(() => {
798
799
  if (t) {
799
- $.current = "cancel", f(!0);
800
+ H.current = "cancel", p(!0);
800
801
  return;
801
802
  }
802
- const k = R.current;
803
+ const k = F.current;
803
804
  if (k) {
804
- delete R.current.dataset.open;
805
- let q = !1;
806
- const z = (nt) => {
807
- q || nt.target !== k || (q = !0, f(!1), h == null || h($.current));
805
+ delete F.current.dataset.open;
806
+ let z = !1;
807
+ const q = (nt) => {
808
+ z || nt.target !== k || (z = !0, p(!1), f == null || f(H.current));
808
809
  };
809
- return k.addEventListener("transitionend", z), () => {
810
- k.removeEventListener("transitionend", z);
810
+ return k.addEventListener("transitionend", q), () => {
811
+ k.removeEventListener("transitionend", q);
811
812
  };
812
813
  }
813
- }, [h, t]), M(() => {
814
- const k = R.current;
814
+ }, [f, t]), M(() => {
815
+ const k = F.current;
815
816
  b && k && (k.dataset.open = "");
816
817
  }, [b]), /* @__PURE__ */ n(
817
- Wt,
818
+ Qt,
818
819
  {
819
820
  open: b,
820
821
  onClose: r,
@@ -823,14 +824,14 @@ const se = ({ currentPage: t, pagesCount: r, ...e }) => {
823
824
  "tw:flex tw:w-screen tw:h-screen tw:max-w-screen tw:max-h-screen": b,
824
825
  "tw:overflow-hidden": e === "cover"
825
826
  },
826
- l
827
+ d
827
828
  ),
828
829
  ...x,
829
830
  children: /* @__PURE__ */ n(
830
831
  "form",
831
832
  {
832
833
  "data-testid": "transition-container",
833
- ref: R,
834
+ ref: F,
834
835
  className: w(
835
836
  "tw:w-full tw:m-auto tw:p-4 tw:sm:p-6",
836
837
  // CSS transitions are based on the presence of the `data-open` attribute
@@ -838,10 +839,10 @@ const se = ({ currentPage: t, pagesCount: r, ...e }) => {
838
839
  "tw:transition-[opacity_,_translate] tw:duration-300",
839
840
  // Handle modal dimensions for different variants and sizes
840
841
  e !== "cover" && {
841
- "tw:sm:w-sm": i === "sm",
842
- "tw:md:w-lg": i === "md",
843
- "tw:md:w-4xl": i === "lg",
844
- "tw:md:w-6xl": i === "xl"
842
+ "tw:sm:w-sm": s === "sm",
843
+ "tw:md:w-lg": s === "md",
844
+ "tw:md:w-4xl": s === "lg",
845
+ "tw:md:w-6xl": s === "xl"
845
846
  },
846
847
  { "tw:h-full": e === "cover" }
847
848
  ),
@@ -849,12 +850,12 @@ const se = ({ currentPage: t, pagesCount: r, ...e }) => {
849
850
  children: /* @__PURE__ */ n(N, { className: w(
850
851
  "tw:w-full",
851
852
  { "tw:h-full tw:relative tw:overflow-auto": e === "cover" }
852
- ), children: e === "cover" ? /* @__PURE__ */ g(S, { children: [
853
+ ), children: e === "cover" ? /* @__PURE__ */ g(O, { children: [
853
854
  /* @__PURE__ */ g(
854
855
  "div",
855
856
  {
856
857
  className: w(
857
- "tw:px-4 tw:py-3 tw:absolute tw:top-0 tw:left-0 tw:right-0",
858
+ "tw:px-4 tw:py-3 tw:absolute tw:top-0 tw:left-0 tw:right-0 tw:z-3000",
858
859
  "tw:flex tw:items-center tw:justify-between",
859
860
  "tw:text-white tw:bg-linear-to-b tw:from-black/70 tw:to-black/10",
860
861
  "tw:[text-shadow:_0_2px_4px_rgb(0_0_0/_0.8)]"
@@ -865,8 +866,8 @@ const se = ({ currentPage: t, pagesCount: r, ...e }) => {
865
866
  ]
866
867
  }
867
868
  ),
868
- /* @__PURE__ */ n("div", { children: a })
869
- ] }) : /* @__PURE__ */ g(S, { children: [
869
+ a
870
+ ] }) : /* @__PURE__ */ g(O, { children: [
870
871
  /* @__PURE__ */ g(N.Header, { className: w(
871
872
  "tw:sticky tw:top-0",
872
873
  "tw:flex tw:items-center tw:justify-between tw:gap-x-2"
@@ -875,7 +876,7 @@ const se = ({ currentPage: t, pagesCount: r, ...e }) => {
875
876
  /* @__PURE__ */ n(Q, { onClick: r, label: "Close dialog" })
876
877
  ] }),
877
878
  /* @__PURE__ */ n(N.Body, { children: a }),
878
- p && /* @__PURE__ */ g(
879
+ u && /* @__PURE__ */ g(
879
880
  N.Footer,
880
881
  {
881
882
  "data-testid": "footer",
@@ -884,15 +885,15 @@ const se = ({ currentPage: t, pagesCount: r, ...e }) => {
884
885
  "tw:[&]:px-3 tw:sticky tw:bottom-0"
885
886
  ),
886
887
  children: [
887
- /* @__PURE__ */ n(Rt, { onClick: r, children: c }),
888
+ /* @__PURE__ */ n(Ot, { onClick: r, children: c }),
888
889
  /* @__PURE__ */ n(
889
- Lt,
890
+ _t,
890
891
  {
891
892
  solid: !0,
892
893
  variant: e === "danger" ? "danger" : "primary",
893
894
  disabled: m,
894
895
  type: "submit",
895
- children: s
896
+ children: i
896
897
  }
897
898
  )
898
899
  ]
@@ -903,16 +904,16 @@ const se = ({ currentPage: t, pagesCount: r, ...e }) => {
903
904
  )
904
905
  }
905
906
  );
906
- }, ce = ({ className: t, children: r, loading: e = !1, variant: o = "default" }) => /* @__PURE__ */ n(yt, { className: y({ "tw:[&]:border-danger": o === "error" }, t), children: /* @__PURE__ */ g("h3", { className: y("tw:text-center", {
907
+ }, fe = ({ className: t, children: r, loading: e = !1, variant: o = "default" }) => /* @__PURE__ */ n(It, { className: y({ "tw:[&]:border-danger": o === "error" }, t), children: /* @__PURE__ */ g("h3", { className: y("tw:text-center", {
907
908
  "tw:text-gray-500 tw:dark:text-gray-400": o === "default",
908
909
  "tw:text-danger": o === "error"
909
910
  }), children: [
910
- e && /* @__PURE__ */ g(S, { children: [
911
+ e && /* @__PURE__ */ g(O, { children: [
911
912
  /* @__PURE__ */ n(v, { icon: X, spin: !0 }),
912
913
  /* @__PURE__ */ n("span", { className: "tw:ml-2", children: r ?? "Loading..." })
913
914
  ] }),
914
915
  !e && r
915
- ] }) }), me = ({ variant: t, className: r, size: e = "md", children: o }) => /* @__PURE__ */ n(
916
+ ] }) }), xe = ({ variant: t, className: r, size: e = "md", children: o }) => /* @__PURE__ */ n(
916
917
  "div",
917
918
  {
918
919
  className: y(
@@ -930,10 +931,93 @@ const se = ({ currentPage: t, pagesCount: r, ...e }) => {
930
931
  ),
931
932
  children: o
932
933
  }
933
- ), ge = ({ text: t, className: r, size: e = "lg", initialCopied: o = !1, navigator_: a = globalThis.navigator, ...l }) => {
934
- const [d, i] = gt(o), s = P(
935
- () => a.clipboard.writeText(t).then(i),
936
- [a.clipboard, t, i]
934
+ ), ye = ({ placement: t = "auto" } = {}) => {
935
+ const r = I(null), e = (() => {
936
+ const p = [];
937
+ return t === "auto" && p.push(pt()), p.push(ut({ element: r })), p;
938
+ })(), [o, a] = R(!1), { refs: d, floatingStyles: l, context: s, middlewareData: i } = ht({
939
+ placement: t === "auto" ? void 0 : t,
940
+ open: o,
941
+ onOpenChange: a,
942
+ middleware: e
943
+ }), c = ft(s, {
944
+ delay: { open: 300 },
945
+ move: !0
946
+ }), { getFloatingProps: m, getReferenceProps: u } = xt([c]), { isMounted: f, styles: x } = yt(s, { duration: 200 }), b = $(() => {
947
+ const p = s.placement.split("-")[0];
948
+ return {
949
+ top: "bottom",
950
+ right: "left",
951
+ bottom: "top",
952
+ left: "right"
953
+ }[p] ?? "";
954
+ }, [s.placement]);
955
+ return {
956
+ anchor: { ...u(), ref: d.setReference },
957
+ tooltip: {
958
+ ...m(),
959
+ refSetter: d.setFloating,
960
+ isMounted: f,
961
+ styles: { ...l, ...x },
962
+ arrowPos: i.arrow,
963
+ arrowRef: r,
964
+ arrowSide: b
965
+ }
966
+ };
967
+ }, ke = ({ children: t, isMounted: r, styles: e, refSetter: o, arrowRef: a, arrowPos: d, arrowSide: l, ...s }) => {
968
+ var i;
969
+ return r && /* @__PURE__ */ n(
970
+ "div",
971
+ {
972
+ role: "tooltip",
973
+ "aria-live": "polite",
974
+ className: y(
975
+ "tw:z-1000 tw:max-w-64",
976
+ // Add space between anchor and tooltip via padding, so that if the tooltip is inside the anchor, you can hover it
977
+ // and it's never closed
978
+ {
979
+ "tw:pt-2.5": l === "top",
980
+ "tw:pb-2.5": l === "bottom",
981
+ "tw:pr-2.5": l === "right",
982
+ "tw:pl-2.5": l === "left"
983
+ }
984
+ ),
985
+ ref: o,
986
+ style: e,
987
+ ...s,
988
+ children: /* @__PURE__ */ g("div", { className: "tw:relative tw:px-1.5 tw:py-1 tw:rounded tw:bg-black/90 tw:text-white tw:text-center", children: [
989
+ /* @__PURE__ */ n("span", { className: "tw:sr-only", children: "Tooltip: " }),
990
+ t,
991
+ /* @__PURE__ */ n(
992
+ "div",
993
+ {
994
+ ref: a,
995
+ className: y(
996
+ "tw:absolute",
997
+ // Render as a triangle
998
+ "tw:border-l-6 tw:border-r-6 tw:border-b-6 tw:border-l-transparent tw:border-r-transparent tw:border-b-black/90",
999
+ // Rotate triangle so that it points to the correct direction
1000
+ {
1001
+ "tw:rotate-180": l === "bottom",
1002
+ "tw:rotate-90 tw:mr-[-3px]": l === "right",
1003
+ "tw:rotate-270 tw:ml-[-3px]": l === "left"
1004
+ }
1005
+ ),
1006
+ style: {
1007
+ left: d == null ? void 0 : d.x,
1008
+ top: d == null ? void 0 : d.y,
1009
+ [l]: `${-(((i = a.current) == null ? void 0 : i.offsetWidth) ?? 0) / 2}px`
1010
+ },
1011
+ "data-testid": "arrow"
1012
+ }
1013
+ )
1014
+ ] })
1015
+ }
1016
+ );
1017
+ }, ve = ({ text: t, className: r, size: e = "lg", initialCopied: o = !1, navigator_: a = globalThis.navigator, ...d }) => {
1018
+ const [l, s] = bt(o), i = T(
1019
+ () => a.clipboard.writeText(t).then(s),
1020
+ [a.clipboard, t, s]
937
1021
  );
938
1022
  return /* @__PURE__ */ n(
939
1023
  "button",
@@ -950,44 +1034,46 @@ const se = ({ currentPage: t, pagesCount: r, ...e }) => {
950
1034
  ),
951
1035
  "aria-label": `Copy ${t} to clipboard`,
952
1036
  title: "Copy to clipboard",
953
- onClick: s,
954
- ...l,
955
- children: /* @__PURE__ */ n(v, { icon: d ? wt : ut, fixedWidth: !0 })
1037
+ onClick: i,
1038
+ ...d,
1039
+ children: /* @__PURE__ */ n(v, { icon: l ? wt : kt, fixedWidth: !0 })
956
1040
  }
957
1041
  );
958
1042
  };
959
1043
  export {
960
- Lt as Button,
1044
+ _t as Button,
961
1045
  N as Card,
962
- we as CardModal,
963
- ee as Checkbox,
1046
+ he as CardModal,
1047
+ se as Checkbox,
964
1048
  Q as CloseButton,
965
- ge as CopyToClipboardButton,
966
- Zt as Details,
1049
+ ve as CopyToClipboardButton,
1050
+ le as Details,
967
1051
  _ as ELLIPSIS,
968
- U as Input,
969
- W as Label,
970
- re as LabelledInput,
971
- oe as LabelledRevealablePasswordInput,
972
- ne as LabelledSelect,
973
- Rt as LinkButton,
974
- kt as Listbox,
975
- ce as Message,
976
- Wt as ModalDialog,
977
- le as NavPills,
978
- se as Paginator,
979
- me as Result,
980
- Bt as RevealablePasswordInput,
981
- ae as SearchCombobox,
982
- Et as SearchInput,
983
- Mt as Select,
984
- yt as SimpleCard,
985
- te as Table,
986
- de as ToggleSwitch,
987
- $t as formatNumber,
988
- Ht as keyForPage,
1052
+ W as Input,
1053
+ U as Label,
1054
+ ie as LabelledInput,
1055
+ we as LabelledRevealablePasswordInput,
1056
+ ce as LabelledSelect,
1057
+ Ot as LinkButton,
1058
+ Pt as Listbox,
1059
+ fe as Message,
1060
+ Qt as ModalDialog,
1061
+ ge as NavPills,
1062
+ ue as Paginator,
1063
+ xe as Result,
1064
+ Dt as RevealablePasswordInput,
1065
+ me as SearchCombobox,
1066
+ Ht as SearchInput,
1067
+ $t as Select,
1068
+ It as SimpleCard,
1069
+ de as Table,
1070
+ be as ToggleSwitch,
1071
+ ke as Tooltip,
1072
+ Wt as formatNumber,
1073
+ qt as keyForPage,
989
1074
  B as pageIsEllipsis,
990
- At as prettifyPageNumber,
991
- jt as progressivePagination,
992
- ie as roundTen
1075
+ zt as prettifyPageNumber,
1076
+ Kt as progressivePagination,
1077
+ pe as roundTen,
1078
+ ye as useTooltip
993
1079
  };