@shlinkio/shlink-frontend-kit 0.9.8 → 0.9.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/tailwind.js CHANGED
@@ -1,132 +1,133 @@
1
- import { jsxs as g, jsx as n, Fragment as O } from "react/jsx-runtime";
2
- import w, { clsx as y } from "clsx";
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
- import { Link as j, NavLink as at } from "react-router";
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";
1
+ import { jsxs as p, jsx as n, Fragment as _ } from "react/jsx-runtime";
2
+ import w, { clsx as f } from "clsx";
3
+ import { useRef as T, useState as R, useEffect as B, forwardRef as y, useCallback as P, createContext as q, useContext as O, useId as $, useMemo as W } from "react";
4
+ import { Link as G, NavLink as mt } from "react-router";
5
+ import { faClose as pt, faEyeSlash as bt, faEye as gt, faCircleNotch as nt, faSearch as ut, faCaretDown as ht, faChevronLeft as V, faChevronRight as tt, faEllipsisV as ft, faSortAmountUp as xt, faSortAmountDown as yt, faCheck as kt } 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 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);
13
- return M(() => {
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);
16
- }, []), /* @__PURE__ */ g("details", { ref: a, ...o, children: [
17
- /* @__PURE__ */ n("summary", { className: y("tw:focus-ring tw:px-1 tw:-mx-1 tw:rounded-sm", e), children: r }),
18
- d && /* @__PURE__ */ n("div", { className: "tw:mt-3 tw:flex tw:flex-col tw:gap-y-3", children: t })
7
+ import { u as vt, b as Nt, a as Ct, e as Tt, c as It } from "./ordering-B_hekQuu.js";
8
+ import { useFloating as ot, flip as Pt, offset as Ot, useClick as Dt, useInteractions as at, autoPlacement as Lt, arrow as Mt, useHover as Bt, useTransitionStyles as Rt } from "@floating-ui/react";
9
+ import { createPortal as Ft } from "react-dom";
10
+ import "reactstrap";
11
+ import { faClone as Et } from "@fortawesome/free-regular-svg-icons";
12
+ const Oe = ({ children: r, summary: e, summaryClasses: t, ...o }) => {
13
+ const a = T(null), [l, d] = R(!1);
14
+ return B(() => {
15
+ const i = a.current, s = () => d(!!(i != null && i.open));
16
+ return i == null || i.addEventListener("toggle", s), () => i == null ? void 0 : i.removeEventListener("toggle", s);
17
+ }, []), /* @__PURE__ */ p("details", { ref: a, ...o, children: [
18
+ /* @__PURE__ */ n("summary", { className: f("tw:focus-ring tw:px-1 tw:-mx-1 tw:rounded-sm", t), children: e }),
19
+ l && /* @__PURE__ */ n("div", { className: "tw:mt-3 tw:flex tw:flex-col tw:gap-y-3", children: r })
19
20
  ] });
20
- }, vt = h(({ className: t, ...r }, e) => /* @__PURE__ */ n(
21
+ }, St = y(({ className: r, ...e }, t) => /* @__PURE__ */ n(
21
22
  "div",
22
23
  {
23
24
  className: w(
24
25
  "tw:px-4 tw:py-3 tw:rounded-t-md",
25
26
  "tw:bg-lm-primary tw:dark:bg-dm-primary tw:border-b tw:border-lm-border tw:dark:border-dm-border",
26
- t
27
+ r
27
28
  ),
28
- ...r,
29
- ref: e
29
+ ...e,
30
+ ref: t
30
31
  }
31
- )), Nt = h(({ className: t, ...r }, e) => /* @__PURE__ */ n(
32
+ )), jt = y(({ className: r, ...e }, t) => /* @__PURE__ */ n(
32
33
  "div",
33
34
  {
34
35
  className: w(
35
36
  "tw:p-4 tw:bg-lm-primary tw:dark:bg-dm-primary tw:first:rounded-t-md",
36
37
  "tw:first:rounded-t-md tw:last:rounded-b-md",
37
- t
38
+ r
38
39
  ),
39
- ...r,
40
- ref: e
40
+ ...e,
41
+ ref: t
41
42
  }
42
- )), Ct = h(({ className: t, ...r }, e) => /* @__PURE__ */ n(
43
+ )), At = y(({ className: r, ...e }, t) => /* @__PURE__ */ n(
43
44
  "div",
44
45
  {
45
46
  className: w(
46
47
  "tw:px-4 tw:py-3 tw:rounded-b-md",
47
48
  "tw:bg-lm-primary tw:dark:bg-dm-primary tw:border-t tw:border-lm-border tw:dark:border-dm-border",
48
- t
49
+ r
49
50
  ),
50
- ...r,
51
- ref: e
51
+ ...e,
52
+ ref: t
52
53
  }
53
- )), Tt = h(({ className: t, ...r }, e) => /* @__PURE__ */ n(
54
+ )), _t = y(({ className: r, ...e }, t) => /* @__PURE__ */ n(
54
55
  "div",
55
56
  {
56
57
  className: w(
57
58
  "tw:group/card tw:rounded-md tw:shadow-md",
58
59
  "tw:border tw:border-lm-border tw:dark:border-dm-border tw:bg-lm-primary tw:dark:bg-dm-primary",
59
- t
60
+ r
60
61
  ),
61
- ...r,
62
- ref: e
63
- }
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 : {
66
62
  ...e,
63
+ ref: t
64
+ }
65
+ )), C = Object.assign(_t, { Body: jt, Header: St, Footer: At }), $t = y(({ bodyClassName: r, children: e, ...t }, o) => {
66
+ const { title: a, titleSize: l = "md", ...d } = "title" in t ? t : {
67
+ ...t,
67
68
  title: void 0,
68
69
  titleSize: void 0
69
70
  };
70
- return /* @__PURE__ */ g(N, { ...l, ref: o, children: [
71
- a && /* @__PURE__ */ g(N.Header, { children: [
72
- d === "lg" && /* @__PURE__ */ n("h4", { children: a }),
73
- d === "md" && /* @__PURE__ */ n("h5", { children: a }),
74
- d === "sm" && /* @__PURE__ */ n("h6", { children: a })
71
+ return /* @__PURE__ */ p(C, { ...d, ref: o, children: [
72
+ a && /* @__PURE__ */ p(C.Header, { children: [
73
+ l === "lg" && /* @__PURE__ */ n("h4", { children: a }),
74
+ l === "md" && /* @__PURE__ */ n("h5", { children: a }),
75
+ l === "sm" && /* @__PURE__ */ n("h6", { children: a })
75
76
  ] }),
76
- /* @__PURE__ */ n(N.Body, { className: t, children: r })
77
+ /* @__PURE__ */ n(C.Body, { className: r, children: e })
77
78
  ] });
78
79
  });
79
- function Pt({
80
- id: t,
81
- items: r,
82
- onSelectItem: e,
80
+ function Ht({
81
+ id: r,
82
+ items: e,
83
+ onSelectItem: t,
83
84
  onActiveItemChange: o,
84
85
  renderItem: a,
85
- className: d,
86
- noItemsMessage: l = "No items",
87
- anchor: s,
88
- "aria-label": i = "Items",
86
+ className: l,
87
+ noItemsMessage: d = "No items",
88
+ anchor: i,
89
+ "aria-label": s = "Items",
89
90
  ...c
90
91
  }) {
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);
92
+ const [m, g] = R(0), u = P((x) => {
93
+ if (g(x), o) {
94
+ const [b, h] = [...e.entries()][x];
95
+ o(b, h);
95
96
  }
96
- }, [r, o]);
97
- return M(() => {
98
- const x = s == null ? void 0 : s.current;
97
+ }, [e, o]);
98
+ return B(() => {
99
+ const x = i == null ? void 0 : i.current;
99
100
  if (!x)
100
101
  return;
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
+ const b = (h) => {
103
+ ["Enter", "ArrowUp", "ArrowDown"].includes(h.key) && h.preventDefault(), h.key === "ArrowDown" ? u(Math.min(m + 1, e.size - 1)) : h.key === "ArrowUp" ? u(Math.max(m - 1, 0)) : h.key === "Enter" && t([...e.values()][m]);
103
104
  };
104
105
  return x.addEventListener("keydown", b), () => x.removeEventListener("keydown", b);
105
- }, [m, s, f, r, e]), /* @__PURE__ */ g(
106
- N,
106
+ }, [m, i, u, e, t]), /* @__PURE__ */ p(
107
+ C,
107
108
  {
108
- id: t,
109
- className: w("tw:py-1 tw:flex tw:flex-col", d),
109
+ id: r,
110
+ className: w("tw:py-1 tw:flex tw:flex-col", l),
110
111
  role: "listbox",
111
112
  "aria-orientation": "vertical",
112
- "aria-label": i,
113
+ "aria-label": s,
113
114
  ...c,
114
115
  children: [
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
+ 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 }),
117
+ [...e.entries()].map(([x, b], h) => /* @__PURE__ */ n(
117
118
  "button",
118
119
  {
119
- id: `${t}_${x}`,
120
+ id: `${r}_${x}`,
120
121
  type: "button",
121
122
  role: "option",
122
- "aria-selected": p === m,
123
+ "aria-selected": h === m,
123
124
  className: w(
124
125
  "tw:px-2 tw:py-1 tw:text-left tw:truncate",
125
- { "tw:bg-lm-secondary tw:dark:bg-dm-secondary": p === m }
126
+ { "tw:bg-lm-secondary tw:dark:bg-dm-secondary": h === m }
126
127
  ),
127
128
  tabIndex: -1,
128
- onClick: () => e(b),
129
- onMouseOver: () => f(p),
129
+ onClick: () => t(b),
130
+ onMouseOver: () => u(h),
130
131
  children: a(b)
131
132
  },
132
133
  x
@@ -135,294 +136,288 @@ function Pt({
135
136
  }
136
137
  );
137
138
  }
138
- const E = S(void 0), L = S({ responsive: !0, size: "md" }), Lt = ({ children: t, className: r }) => {
139
- const { responsive: e } = C(L);
140
- return /* @__PURE__ */ n(E.Provider, { value: { section: "head" }, children: /* @__PURE__ */ n(
139
+ const H = q(void 0), F = q({ responsive: !0, size: "md" }), Ut = ({ children: r, className: e }) => {
140
+ const { responsive: t } = O(F);
141
+ return /* @__PURE__ */ n(H.Provider, { value: { section: "head" }, children: /* @__PURE__ */ n(
141
142
  "thead",
142
143
  {
143
144
  className: w(
144
- { "tw:hidden tw:lg:table-header-group": e },
145
- r
145
+ { "tw:hidden tw:lg:table-header-group": t },
146
+ e
146
147
  ),
147
- children: t
148
+ children: r
148
149
  }
149
150
  ) });
150
- }, Bt = ({ children: t, className: r }) => {
151
- const { responsive: e } = C(L);
152
- return /* @__PURE__ */ n(E.Provider, { value: { section: "body" }, children: /* @__PURE__ */ n(
151
+ }, Wt = ({ children: r, className: e }) => {
152
+ const { responsive: t } = O(F);
153
+ return /* @__PURE__ */ n(H.Provider, { value: { section: "body" }, children: /* @__PURE__ */ n(
153
154
  "tbody",
154
155
  {
155
156
  className: w(
156
- { "tw:lg:table-row-group tw:flex tw:flex-col tw:gap-y-3": e },
157
- r
157
+ { "tw:lg:table-row-group tw:flex tw:flex-col tw:gap-y-3": t },
158
+ e
158
159
  ),
159
- children: t
160
+ children: r
160
161
  }
161
162
  ) });
162
- }, Mt = ({ children: t, className: r }) => {
163
- const { responsive: e } = C(L);
164
- return /* @__PURE__ */ n(E.Provider, { value: { section: "footer" }, children: /* @__PURE__ */ n(
163
+ }, Kt = ({ children: r, className: e }) => {
164
+ const { responsive: t } = O(F);
165
+ return /* @__PURE__ */ n(H.Provider, { value: { section: "footer" }, children: /* @__PURE__ */ n(
165
166
  "tfoot",
166
167
  {
167
168
  className: w(
168
- { "tw:lg:table-row-group tw:flex tw:flex-col tw:gap-y-3 tw:mt-4": e },
169
- r
169
+ { "tw:lg:table-row-group tw:flex tw:flex-col tw:gap-y-3 tw:mt-4": t },
170
+ e
170
171
  ),
171
- children: t
172
+ children: r
172
173
  }
173
174
  ) });
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
+ }, zt = ({ children: r, className: e, ...t }) => {
176
+ const o = O(H), a = (o == null ? void 0 : o.section) === "body", { responsive: l } = O(F);
176
177
  return /* @__PURE__ */ n(
177
178
  "tr",
178
179
  {
179
180
  className: w(
180
181
  "tw:group",
181
182
  {
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
+ "tw:lg:table-row tw:flex tw:flex-col": l,
184
+ "tw:lg:border-0 tw:border-y-2 tw:border-lm-border tw:dark:border-dm-border": l,
184
185
  "tw:hover:bg-lm-primary tw:dark:hover:bg-dm-primary": a,
185
186
  // Use a different hover bg color depending on the table being inside a card or not
186
187
  "tw:group-[&]/card:hover:bg-lm-secondary tw:dark:group-[&]/card:hover:bg-dm-secondary": a
187
188
  },
188
- r
189
+ e
189
190
  ),
190
- ...e,
191
- children: t
191
+ ...t,
192
+ children: r
192
193
  }
193
194
  );
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
+ }, qt = ({ children: r, className: e, columnName: t, type: o, ...a }) => {
196
+ const l = O(H), d = o ?? ((l == null ? void 0 : l.section) !== "body" ? "th" : "td"), { responsive: i, size: s } = O(F);
196
197
  return /* @__PURE__ */ n(
197
- l,
198
+ d,
198
199
  {
199
- "data-column": s ? e : void 0,
200
+ "data-column": i ? t : void 0,
200
201
  className: w(
201
202
  "tw:border-lm-border tw:dark:border-dm-border",
202
203
  {
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,
204
+ "tw:p-1": s === "sm",
205
+ "tw:p-2": s === "md",
206
+ "tw:p-3": s === "lg",
207
+ "tw:border-b-1": !i,
208
+ "tw:block tw:lg:table-cell tw:not-last:border-b-1 tw:lg:border-b-1": i,
208
209
  // For responsive tables, display the content in data-column attribute for md sizes and lower
209
- "tw:before:lg:hidden tw:before:content-[attr(data-column)] tw:before:font-bold tw:before:mr-1": s && l === "td"
210
+ "tw:before:lg:hidden tw:before:content-[attr(data-column)] tw:before:font-bold tw:before:mr-1": i && d === "td"
210
211
  },
211
- r
212
+ e
212
213
  ),
213
214
  ...a,
214
- children: t
215
+ children: r
215
216
  }
216
217
  );
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(({
222
- children: t,
218
+ }, Gt = ({ header: r, footer: e, children: t, responsive: o = !0, size: a = "md", ...l }) => /* @__PURE__ */ n(F.Provider, { value: { responsive: o, size: a }, children: /* @__PURE__ */ p("table", { className: "tw:w-full", ...l, children: [
219
+ /* @__PURE__ */ n(Ut, { children: r }),
220
+ /* @__PURE__ */ n(Wt, { children: t }),
221
+ e && /* @__PURE__ */ n(Kt, { children: e })
222
+ ] }) }), De = Object.assign(Gt, { Row: zt, Cell: qt }), Jt = y(({
223
223
  className: r,
224
224
  disabled: e,
225
- variant: o = "primary",
226
- size: a = "md",
227
- inline: d = !1,
225
+ variant: t = "primary",
226
+ size: o = "md",
227
+ inline: a = !1,
228
228
  solid: l = !1,
229
- type: s = "button",
229
+ type: d = "button",
230
230
  ...i
231
- }, c) => {
232
- const m = "to" in i ? j : "button", u = m === j ? void 0 : s;
231
+ }, s) => {
232
+ const c = "to" in i, m = c ? G : "button", g = c ? void 0 : d;
233
233
  return /* @__PURE__ */ n(
234
234
  m,
235
235
  {
236
- ref: c,
236
+ ref: s,
237
237
  className: w(
238
238
  {
239
- "tw:inline-flex": d,
240
- "tw:flex": !d
239
+ "tw:inline-flex": a,
240
+ "tw:flex": !a
241
241
  },
242
242
  "tw:gap-2 tw:items-center tw:justify-center",
243
243
  "tw:border tw:rounded-md tw:no-underline",
244
244
  "tw:transition-colors",
245
245
  {
246
- "tw:focus-ring": o === "primary",
247
- "tw:focus-ring-secondary": o === "secondary",
248
- "tw:focus-ring-danger": o === "danger"
246
+ "tw:focus-ring": t === "primary",
247
+ "tw:focus-ring-secondary": t === "secondary",
248
+ "tw:focus-ring-danger": t === "danger"
249
249
  },
250
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"
251
+ "tw:px-1.5 tw:py-1 tw:text-sm": o === "sm",
252
+ "tw:px-3 tw:py-1.5": o === "md",
253
+ "tw:px-4 tw:py-2 tw:text-lg": o === "lg"
254
254
  },
255
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
256
+ "tw:border-lm-brand tw:dark:border-dm-brand": t === "primary",
257
+ "tw:text-lm-brand tw:dark:text-dm-brand": t === "primary" && !l,
258
+ "tw:border-zinc-500": t === "secondary",
259
+ "tw:text-zinc-500": t === "secondary" && !l,
260
+ "tw:border-danger": t === "danger",
261
+ "tw:text-danger": t === "danger" && !l
262
262
  },
263
263
  l && {
264
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"
265
+ "tw:bg-lm-brand tw:dark:bg-dm-brand": t === "primary",
266
+ "tw:highlight:bg-lm-brand-dark tw:dark:highlight:bg-dm-brand-dark": t === "primary",
267
+ "tw:highlight:border-lm-brand-dark tw:dark:highlight:border-dm-brand-dark": t === "primary",
268
+ "tw:bg-zinc-500": t === "secondary",
269
+ "tw:highlight:bg-zinc-600 tw:highlight:border-zinc-600": t === "secondary",
270
+ "tw:bg-danger": t === "danger",
271
+ "tw:highlight:bg-danger-dark tw:highlight:border-danger-dark": t === "danger"
272
272
  },
273
273
  !e && {
274
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"
275
+ "tw:highlight:bg-lm-brand tw:dark:highlight:bg-dm-brand": t === "primary",
276
+ "tw:highlight:bg-zinc-500": t === "secondary",
277
+ "tw:highlight:bg-danger": t === "danger"
278
278
  },
279
279
  {
280
280
  "tw:pointer-events-none tw:opacity-65": e
281
281
  },
282
282
  r
283
283
  ),
284
- disabled: e,
285
- type: u,
286
- ...i,
287
- children: t
284
+ disabled: c ? void 0 : e,
285
+ "aria-disabled": c ? e : void 0,
286
+ type: g,
287
+ ...i
288
288
  }
289
289
  );
290
- }), Y = h(({ className: t, onChange: r, ...e }, o) => {
291
- const a = T((d) => r == null ? void 0 : r(d.target.checked, d), [r]);
290
+ }), lt = y(({ className: r, onChange: e, ...t }, o) => {
291
+ const a = P((l) => e == null ? void 0 : e(l.target.checked, l), [e]);
292
292
  return /* @__PURE__ */ n(
293
293
  "input",
294
294
  {
295
295
  ref: o,
296
296
  type: "checkbox",
297
- className: y(
297
+ className: f(
298
298
  "tw:appearance-none tw:focus-ring tw:cursor-[inherit]",
299
299
  "tw:border-1 tw:border-lm-input-border tw:dark:border-dm-input-border",
300
300
  "tw:bg-lm-primary tw:dark:bg-dm-primary tw:checked:bg-lm-brand tw:dark:checked:bg-dm-brand tw:bg-no-repeat",
301
301
  // Use different background color when rendered inside a card
302
302
  "tw:group-[&]/card:bg-lm-input tw:group-[&]/card:dark:bg-dm-input",
303
- t
303
+ r
304
304
  ),
305
305
  onChange: a,
306
- ...e
306
+ ...t
307
307
  }
308
308
  );
309
- }), se = h(({ className: t, ...r }, e) => /* @__PURE__ */ n(
310
- Y,
309
+ }), Le = y(({ className: r, ...e }, t) => /* @__PURE__ */ n(
310
+ lt,
311
311
  {
312
- ref: e,
313
- className: y("tw:rounded-sm tw:w-4 tw:h-4 tw:checked:bg-(image:--tick) tw:bg-center", t),
314
- ...r
312
+ ref: t,
313
+ className: f("tw:rounded-sm tw:w-4 tw:h-4 tw:checked:bg-(image:--tick) tw:bg-center", r),
314
+ ...e
315
315
  }
316
- )), Q = h(({ onClick: t, className: r, label: e = "Close" }, o) => /* @__PURE__ */ n(
316
+ )), et = y(({ onClick: r, className: e, label: t = "Close" }, o) => /* @__PURE__ */ n(
317
317
  "button",
318
318
  {
319
319
  ref: o,
320
320
  type: "button",
321
- onClick: t,
321
+ onClick: r,
322
322
  className: w(
323
323
  "tw:opacity-50 tw:highlight:opacity-80 tw:transition-opacity",
324
324
  "tw:rounded-md tw:focus-ring",
325
- r
325
+ e
326
326
  ),
327
- "aria-label": e,
328
- children: /* @__PURE__ */ n(v, { icon: lt, size: "xl" })
327
+ "aria-label": t,
328
+ children: /* @__PURE__ */ n(v, { icon: pt, size: "xl" })
329
329
  }
330
- )), W = h(({
331
- borderless: t = !1,
332
- size: r = "md",
333
- feedback: e,
330
+ )), J = y(({
331
+ borderless: r = !1,
332
+ size: e = "md",
333
+ feedback: t,
334
334
  className: o,
335
335
  disabled: a,
336
- readOnly: d,
337
336
  ...l
338
- }, s) => {
339
- const i = !a && !d;
340
- return /* @__PURE__ */ n(
341
- "input",
342
- {
343
- ref: s,
344
- className: w(
345
- "tw:w-full",
346
- {
347
- "tw:focus-ring": !e,
348
- "tw:focus-ring-danger": e === "error"
349
- },
350
- {
351
- "tw:px-2 tw:py-1 tw:text-sm": r === "sm",
352
- "tw:px-3 tw:py-1.5": r === "md",
353
- "tw:px-4 tw:py-2 tw:text-xl": r === "lg"
354
- },
355
- {
356
- "tw:rounded-md tw:border": !t,
357
- "tw:border-lm-input-border tw:dark:border-dm-input-border": !t && !e,
358
- "tw:border-danger": !t && e === "error",
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
- // Use different background color when rendered inside a card
362
- "tw:group-[&]/card:bg-lm-input tw:group-[&]/card:dark:bg-dm-input": i
363
- },
364
- o
365
- ),
366
- disabled: a,
367
- readOnly: d,
368
- ...l
369
- }
370
- );
371
- }), U = ({ required: t, children: r, className: e, ...o }) => /* @__PURE__ */ g("label", { className: y("tw:cursor-pointer", e), ...o, children: [
337
+ }, d) => /* @__PURE__ */ n(
338
+ "input",
339
+ {
340
+ ref: d,
341
+ className: w(
342
+ "tw:w-full",
343
+ {
344
+ "tw:focus-ring": !t,
345
+ "tw:focus-ring-danger": t === "error"
346
+ },
347
+ {
348
+ "tw:px-2 tw:py-1 tw:text-sm": e === "sm",
349
+ "tw:px-3 tw:py-1.5": e === "md",
350
+ "tw:px-4 tw:py-2 tw:text-xl": e === "lg"
351
+ },
352
+ {
353
+ "tw:rounded-md tw:border": !r,
354
+ "tw:border-lm-input-border tw:dark:border-dm-input-border": !r && !t,
355
+ "tw:border-danger": !r && t === "error",
356
+ "tw:bg-lm-disabled-input tw:dark:bg-dm-disabled-input": a,
357
+ "tw:bg-lm-primary tw:dark:bg-dm-primary": !a,
358
+ // Use different background color when rendered inside a card
359
+ "tw:group-[&]/card:bg-lm-input tw:group-[&]/card:dark:bg-dm-input": !a
360
+ },
361
+ o
362
+ ),
363
+ disabled: a,
364
+ ...l
365
+ }
366
+ )), Q = ({ required: r, children: e, className: t, ...o }) => /* @__PURE__ */ p("label", { className: f("tw:cursor-pointer", t), ...o, children: [
367
+ e,
368
+ r && /* @__PURE__ */ n("span", { className: "tw:text-danger tw:ml-1", "data-testid": "required-indicator", children: "*" })
369
+ ] }), X = ({ children: r, helpText: e, error: t, "data-testid": o }) => /* @__PURE__ */ p("div", { className: "tw:flex tw:flex-col tw:gap-1", "data-testid": o, children: [
372
370
  r,
373
- t && /* @__PURE__ */ n("span", { className: "tw:text-danger tw:ml-1", "data-testid": "required-indicator", children: "*" })
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: [
375
- t,
376
- r && /* @__PURE__ */ n(
371
+ e && /* @__PURE__ */ n(
377
372
  "small",
378
373
  {
379
374
  "data-testid": o ? `${o}-help-text` : "help-text",
380
375
  className: "tw:text-gray-500 tw:dark:text-gray-400",
381
- children: r
376
+ children: e
382
377
  }
383
378
  ),
384
- e && /* @__PURE__ */ n("span", { "data-testid": o ? `${o}-error` : "error", className: "tw:text-danger", children: e })
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 }),
379
+ t && /* @__PURE__ */ n("span", { "data-testid": o ? `${o}-error` : "error", className: "tw:text-danger", children: t })
380
+ ] }), Me = y(({ label: r, inputClassName: e, required: t, hiddenRequired: o, error: a, helpText: l, "data-testid": d, ...i }, s) => {
381
+ const c = $();
382
+ return /* @__PURE__ */ p(X, { error: a, helpText: l, "data-testid": d, children: [
383
+ /* @__PURE__ */ n(Q, { htmlFor: c, required: t, children: r }),
389
384
  /* @__PURE__ */ n(
390
- W,
385
+ J,
391
386
  {
392
- ref: i,
387
+ ref: s,
393
388
  id: c,
394
- className: r,
395
- required: e || o,
389
+ className: e,
390
+ required: t || o,
396
391
  feedback: a ? "error" : void 0,
397
- ...s
392
+ ...i
398
393
  }
399
394
  )
400
395
  ] });
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
- return /* @__PURE__ */ g(
396
+ }), Qt = y(({ containerClassName: r, className: e, size: t, ...o }, a) => {
397
+ const [l, d, , i] = vt(!1), s = T(null), c = P(({ relatedTarget: m }) => {
398
+ var g;
399
+ (g = s.current) != null && g.contains(m) || i();
400
+ }, [s, i]);
401
+ return /* @__PURE__ */ p(
407
402
  "div",
408
403
  {
409
- className: y("tw:group tw:relative", t),
410
- ref: i,
404
+ className: f("tw:group tw:relative", r),
405
+ ref: s,
411
406
  onBlurCapture: c,
412
407
  children: [
413
408
  /* @__PURE__ */ n(
414
- W,
409
+ J,
415
410
  {
416
411
  ref: a,
417
- type: d ? "text" : "password",
418
- className: y(
412
+ type: l ? "text" : "password",
413
+ className: f(
419
414
  {
420
- "tw:pr-10": e !== "sm",
421
- "tw:pr-8": e === "sm"
415
+ "tw:pr-10": t !== "sm",
416
+ "tw:pr-8": t === "sm"
422
417
  },
423
- r
418
+ e
424
419
  ),
425
- size: e,
420
+ size: t,
426
421
  "data-testid": "input",
427
422
  ...o
428
423
  }
@@ -431,113 +426,113 @@ const E = S(void 0), L = S({ responsive: !0, size: "md" }), Lt = ({ children: t,
431
426
  "button",
432
427
  {
433
428
  type: "button",
434
- onClick: l,
435
- title: d ? "Hide password" : "Show password",
436
- "aria-label": d ? "Hide password" : "Show password",
437
- className: y(
429
+ onClick: d,
430
+ title: l ? "Hide password" : "Show password",
431
+ "aria-label": l ? "Hide password" : "Show password",
432
+ className: f(
438
433
  "tw:absolute tw:top-[50%] tw:translate-y-[-50%] tw:px-1",
439
434
  "tw:text-placeholder tw:hover:text-lm-text tw:hover:dark:text-dm-text tw:transition-colors",
440
435
  {
441
- "tw:right-1.5": e !== "sm",
442
- "tw:scale-85 tw:right-1": e === "sm"
436
+ "tw:right-1.5": t !== "sm",
437
+ "tw:scale-85 tw:right-1": t === "sm"
443
438
  }
444
439
  ),
445
440
  tabIndex: -1,
446
- children: /* @__PURE__ */ n(v, { fixedWidth: !0, icon: d ? dt : st })
441
+ children: /* @__PURE__ */ n(v, { fixedWidth: !0, icon: l ? bt : gt })
447
442
  }
448
443
  )
449
444
  ]
450
445
  }
451
446
  );
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 }),
447
+ }), Be = y(({ label: r, inputClassName: e, required: t, hiddenRequired: o, error: a, helpText: l, "data-testid": d, ...i }, s) => {
448
+ const c = $();
449
+ return /* @__PURE__ */ p(X, { error: a, helpText: l, "data-testid": d, children: [
450
+ /* @__PURE__ */ n(Q, { htmlFor: c, required: t, children: r }),
456
451
  /* @__PURE__ */ n(
457
- Dt,
452
+ Qt,
458
453
  {
459
- ref: i,
454
+ ref: s,
460
455
  id: c,
461
- className: r,
462
- required: e || o,
456
+ className: e,
457
+ required: t || o,
463
458
  feedback: a ? "error" : void 0,
464
- ...s
459
+ ...i
465
460
  }
466
461
  )
467
462
  ] });
468
- }), $t = h(({
469
- className: t,
470
- size: r = "md",
471
- feedback: e,
463
+ }), Xt = y(({
464
+ className: r,
465
+ size: e = "md",
466
+ feedback: t,
472
467
  style: o = {},
473
468
  disabled: a,
474
- ...d
475
- }, l) => /* @__PURE__ */ n(
469
+ ...l
470
+ }, d) => /* @__PURE__ */ n(
476
471
  "select",
477
472
  {
478
- ref: l,
473
+ ref: d,
479
474
  className: w(
480
475
  "tw:w-full tw:appearance-none tw:pr-9",
481
476
  "tw:bg-(image:--chevron-down) tw:bg-no-repeat",
482
477
  {
483
- "tw:focus-ring": !e,
484
- "tw:focus-ring-danger": e === "error"
478
+ "tw:focus-ring": !t,
479
+ "tw:focus-ring-danger": t === "error"
485
480
  },
486
481
  "tw:rounded-md tw:border",
487
482
  {
488
- "tw:border-lm-input-border tw:dark:border-dm-input-border": !e,
489
- "tw:border-danger": e === "error"
483
+ "tw:border-lm-input-border tw:dark:border-dm-input-border": !t,
484
+ "tw:border-danger": t === "error"
490
485
  },
491
486
  {
492
- "tw:pl-2 tw:py-1 tw:text-sm": r === "sm",
493
- "tw:pl-3 tw:py-1.5": r === "md",
494
- "tw:pl-4 tw:py-2 tw:text-xl": r === "lg",
487
+ "tw:pl-2 tw:py-1 tw:text-sm": e === "sm",
488
+ "tw:pl-3 tw:py-1.5": e === "md",
489
+ "tw:pl-4 tw:py-2 tw:text-xl": e === "lg",
495
490
  "tw:bg-lm-disabled-input tw:dark:bg-dm-disabled-input": a,
496
491
  // Apply different background color when rendered inside a card
497
492
  "tw:bg-lm-primary tw:dark:bg-dm-primary tw:group-[&]/card:bg-lm-input tw:group-[&]/card:dark:bg-dm-input": !a
498
493
  },
499
- t
494
+ r
500
495
  ),
501
496
  style: {
502
497
  ...o,
503
498
  background: "right 0.75rem center / 16px 12px"
504
499
  },
505
500
  disabled: a,
506
- ...d
501
+ ...l
507
502
  }
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 }),
503
+ )), Re = y(({ selectClassName: r, label: e, error: t, helpText: o, required: a, hiddenRequired: l, "data-testid": d, ...i }, s) => {
504
+ const c = $();
505
+ return /* @__PURE__ */ p(X, { error: t, helpText: o, "data-testid": d, children: [
506
+ /* @__PURE__ */ n(Q, { htmlFor: c, required: a, children: e }),
512
507
  /* @__PURE__ */ n(
513
- $t,
508
+ Xt,
514
509
  {
515
- ref: i,
510
+ ref: s,
516
511
  id: c,
517
- className: t,
518
- required: a || d,
519
- feedback: e ? "error" : void 0,
520
- ...s
512
+ className: r,
513
+ required: a || l,
514
+ feedback: t ? "error" : void 0,
515
+ ...i
521
516
  }
522
517
  )
523
518
  ] });
524
- }), Ht = h(({
525
- onChange: t,
526
- containerClassName: r,
527
- inputClassName: e,
519
+ }), Yt = y(({
520
+ onChange: r,
521
+ containerClassName: e,
522
+ inputClassName: t,
528
523
  // Inputs have a default 'md' size. Search inputs are usually 'lg' as they are rendered at the top of sections
529
524
  size: o = "lg",
530
525
  loading: a = !1,
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
- return /* @__PURE__ */ g("div", { className: w("tw:group tw:relative tw:focus-within:z-10", r), children: [
526
+ ...l
527
+ }, d) => {
528
+ const { setTimeout: i, clearCurrentTimeout: s } = Nt(500), c = P((m) => {
529
+ m ? i(() => r(m)) : (s(), r(m));
530
+ }, [s, r, i]);
531
+ return /* @__PURE__ */ p("div", { className: w("tw:group tw:relative tw:focus-within:z-10", e), children: [
537
532
  /* @__PURE__ */ n(
538
533
  v,
539
534
  {
540
- icon: a ? X : it,
535
+ icon: a ? nt : ut,
541
536
  spin: a,
542
537
  className: w(
543
538
  "tw:absolute tw:top-[50%] tw:translate-y-[-50%] tw:transition-colors",
@@ -550,83 +545,83 @@ const E = S(void 0), L = S({ responsive: !0, size: "md" }), Lt = ({ children: t,
550
545
  }
551
546
  ),
552
547
  /* @__PURE__ */ n(
553
- W,
548
+ J,
554
549
  {
555
- ref: l,
550
+ ref: d,
556
551
  type: "search",
557
552
  className: w(
558
553
  {
559
554
  "tw:pl-9": o !== "sm",
560
555
  "tw:pl-7": o === "sm"
561
556
  },
562
- e
557
+ t
563
558
  ),
564
559
  placeholder: "Search...",
565
560
  onChange: (m) => c(m.target.value),
566
561
  size: o,
567
- ...d
562
+ ...l
568
563
  }
569
564
  )
570
565
  ] });
571
566
  });
572
- function me({
573
- searchResults: t,
574
- onSearch: r,
575
- onSelectSearchResult: e,
567
+ function Fe({
568
+ searchResults: r,
569
+ onSearch: e,
570
+ onSelectSearchResult: t,
576
571
  renderSearchResult: o,
577
572
  size: a = "md",
578
573
  // SearchInput defaults its size to 'lg'. Change it to 'md'
579
- listboxSpan: d = "full",
580
- onFocus: l,
581
- ...s
574
+ listboxSpan: l = "full",
575
+ onFocus: d,
576
+ ...i
582
577
  }) {
583
- const i = I(null), c = D(), [m, u] = R(), f = $(
584
- () => t ? m ?? [...t.keys()][0] : void 0,
585
- [m, t]
586
- ), x = T((b) => {
587
- e(b), r(""), i.current.value = "";
588
- }, [r, e]);
589
- return /* @__PURE__ */ g(
578
+ const s = T(null), c = $(), [m, g] = R(), u = W(
579
+ () => r ? m ?? [...r.keys()][0] : void 0,
580
+ [m, r]
581
+ ), x = P((b) => {
582
+ t(b), e(""), s.current.value = "";
583
+ }, [e, t]);
584
+ return /* @__PURE__ */ p(
590
585
  "div",
591
586
  {
592
587
  className: "tw:relative",
593
588
  onBlur: (b) => {
594
- b.currentTarget.contains(b.relatedTarget) || r("");
589
+ b.currentTarget.contains(b.relatedTarget) || e("");
595
590
  },
596
591
  children: [
597
592
  /* @__PURE__ */ n(
598
- Ht,
593
+ Yt,
599
594
  {
600
- onChange: r,
595
+ onChange: e,
601
596
  size: a,
602
- ref: i,
597
+ ref: s,
603
598
  role: "combobox",
604
599
  "aria-autocomplete": "list",
605
- "aria-expanded": !!t,
600
+ "aria-expanded": !!r,
606
601
  "aria-controls": c,
607
- "aria-activedescendant": f ? `${c}_${f}` : void 0,
602
+ "aria-activedescendant": u ? `${c}_${u}` : void 0,
608
603
  autoComplete: "off",
609
604
  autoCorrect: "off",
610
605
  onFocus: (b) => {
611
- l == null || l(b), r(b.target.value);
606
+ d == null || d(b), e(b.target.value);
612
607
  },
613
- ...s
608
+ ...i
614
609
  }
615
610
  ),
616
- t && /* @__PURE__ */ n(
617
- Pt,
611
+ r && /* @__PURE__ */ n(
612
+ Ht,
618
613
  {
619
614
  id: c,
620
- items: t,
621
- anchor: i,
615
+ items: r,
616
+ anchor: s,
622
617
  onSelectItem: x,
623
- onActiveItemChange: u,
618
+ onActiveItemChange: g,
624
619
  renderItem: o,
625
620
  className: w(
626
621
  "tw:absolute tw:top-full tw:mt-1 tw:z-10",
627
622
  {
628
- "tw:min-w-60 tw:max-w-full": d === "auto",
629
- "tw:w-full": d === "full"
623
+ "tw:min-w-60 tw:max-w-full": l === "auto",
624
+ "tw:w-full": l === "full"
630
625
  }
631
626
  ),
632
627
  "aria-label": "Matching items",
@@ -637,20 +632,196 @@ function me({
637
632
  }
638
633
  );
639
634
  }
640
- const be = h(({ className: t, ...r }, e) => /* @__PURE__ */ n(
641
- Y,
635
+ const Ee = y(({ className: r, ...e }, t) => /* @__PURE__ */ n(
636
+ lt,
642
637
  {
643
- ref: e,
644
- className: y(
638
+ ref: t,
639
+ className: f(
645
640
  "tw:rounded-full tw:w-8 tw:h-4",
646
641
  "tw:bg-(image:--circle-grey-dark) tw:dark:bg-(image:--circle-grey-light) tw:checked:bg-(image:--circle-white)",
647
642
  "tw:focus-visible:not-checked:bg-(image:--circle-light-blue)",
648
643
  "tw:checked:bg-right tw:transition-[background-position]",
649
- t
644
+ r
650
645
  ),
651
- ...r
646
+ ...e
652
647
  }
653
- )), Ot = h(({ className: t, disabled: r, size: e = "md", type: o = "button", ...a }, d) => /* @__PURE__ */ n(
648
+ )), Zt = ({ className: r, selected: e, disabled: t, ...o }) => {
649
+ const a = "to" in o;
650
+ return (
651
+ // @ts-expect-error The Tag is inferred from provided props, so they should always match
652
+ /* @__PURE__ */ n(
653
+ a ? G : "button",
654
+ {
655
+ role: "menuitem",
656
+ "data-selected": e,
657
+ className: f(
658
+ "tw:flex tw:items-center tw:w-full tw:px-3 tw:py-1.5 tw:focus-ring",
659
+ // Overwrite link styles in case a Link is being used
660
+ "tw:no-underline tw:text-inherit",
661
+ {
662
+ "tw:pointer-events-none tw:opacity-50": t,
663
+ "tw:bg-lm-secondary tw:dark:bg-dm-secondary": e && !t,
664
+ "tw:highlight:bg-lm-secondary tw:dark:highlight:bg-dm-secondary tw:highlight:z-1 tw:relative": !e && !t
665
+ },
666
+ r
667
+ ),
668
+ tabIndex: -1,
669
+ disabled: a ? void 0 : t,
670
+ "aria-disabled": a ? t : void 0,
671
+ ...o
672
+ }
673
+ )
674
+ );
675
+ }, Vt = () => (
676
+ // TODO Use an <hr /> tag once tailwind styles are not set with !important
677
+ /* @__PURE__ */ n("div", { role: "separator", "aria-hidden": !0, className: "tw:border-b tw:border-lm-border tw:dark:border-dm-border tw:my-2" })
678
+ ), te = ({ children: r }) => /* @__PURE__ */ n(
679
+ "div",
680
+ {
681
+ role: "heading",
682
+ "aria-level": 6,
683
+ "aria-hidden": !0,
684
+ className: f(
685
+ "tw:flex tw:items-center tw:w-full tw:px-3 tw:py-1.5",
686
+ "tw:text-gray-500 tw:text-sm tw:font-semibold"
687
+ ),
688
+ onClick: (e) => e.stopPropagation(),
689
+ children: r
690
+ }
691
+ ), ee = ({ className: r, onClick: e, ...t }) => (
692
+ // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
693
+ /* @__PURE__ */ n(
694
+ "div",
695
+ {
696
+ className: f("tw:px-3 tw:py-1.5", r),
697
+ ...t,
698
+ onClick: (o) => {
699
+ o.stopPropagation(), e == null || e(o);
700
+ }
701
+ }
702
+ )
703
+ ), re = ({
704
+ children: r,
705
+ className: e,
706
+ focusableElementsSelector: t = '[role="menuitem"]:not([disabled]):not([aria-disabled])',
707
+ focusFirstItem: o = !1,
708
+ ...a
709
+ }) => {
710
+ const l = T(null);
711
+ return Ct(l, { elementsSelector: t, focusFirstItem: o }), /* @__PURE__ */ n(C, { ref: l, role: "menu", className: f("tw:py-2 tw:whitespace-nowrap", e), ...a, children: r });
712
+ }, j = Object.assign(re, { Item: Zt, Separator: Vt, Title: te, Misc: ee }), ne = ({
713
+ children: r,
714
+ menuAlignment: e = "left",
715
+ buttonVariant: t = "button",
716
+ buttonContent: o,
717
+ buttonClassName: a,
718
+ buttonSize: l = "md",
719
+ buttonDisabled: d = !1,
720
+ containerClassName: i,
721
+ menuClassName: s,
722
+ caretless: c,
723
+ buttonLabel: m
724
+ }) => {
725
+ const [g, u] = R(!1), x = T(null), { refs: b, floatingStyles: h, context: D } = ot({
726
+ open: g,
727
+ onOpenChange: u,
728
+ placement: e === "right" ? "bottom-end" : "bottom-start",
729
+ middleware: [Pt(), Ot(3)],
730
+ // eslint-disable-next-line react-compiler/react-compiler
731
+ elements: { reference: x.current }
732
+ }), E = Dt(D), { getReferenceProps: K, getFloatingProps: k } = at([
733
+ E
734
+ ]), S = $(), L = T(null);
735
+ return B(() => {
736
+ const N = L.current, Y = x.current;
737
+ if (!N || !Y)
738
+ return () => {
739
+ };
740
+ const Z = new AbortController();
741
+ return document.body.addEventListener("click", (wt) => {
742
+ wt.composedPath().includes(Y) || u(!1);
743
+ }, { signal: Z.signal }), () => Z.abort();
744
+ }, []), // eslint-disable-next-line jsx-a11y/no-static-element-interactions
745
+ /* @__PURE__ */ p(
746
+ "div",
747
+ {
748
+ ref: L,
749
+ className: f("tw:relative tw:inline-block", i),
750
+ onKeyDown: (N) => {
751
+ N.key === "Escape" && u(!1);
752
+ },
753
+ onBlur: (N) => {
754
+ N.relatedTarget && !L.current.contains(N.relatedTarget) && u(!1);
755
+ },
756
+ children: [
757
+ /* @__PURE__ */ p(
758
+ "button",
759
+ {
760
+ ref: x,
761
+ ...K(),
762
+ type: "button",
763
+ "aria-haspopup": !0,
764
+ "aria-expanded": g,
765
+ "aria-controls": S,
766
+ "aria-label": m,
767
+ disabled: d,
768
+ className: f(
769
+ "tw:flex tw:items-center tw:rounded-md tw:focus-ring",
770
+ {
771
+ "tw:justify-between": !c,
772
+ "tw:pointer-events-none tw:opacity-50": d,
773
+ // Button variant
774
+ "tw:border tw:border-lm-border tw:dark:border-dm-border": t === "button",
775
+ "tw:bg-lm-primary tw:dark:bg-dm-primary": t === "button",
776
+ // Use different bg color when inside a card
777
+ "tw:group-[&]/card:bg-lm-input tw:group-[&]/card:dark:bg-dm-input": t === "button",
778
+ // Link variant
779
+ "tw:text-lm-brand tw:dark:text-dm-brand": t === "link",
780
+ "tw:highlight:text-lm-brand-dark tw:dark:highlight:text-dm-brand-dark tw:highlight:underline": t === "link",
781
+ // Button sizes
782
+ "tw:px-1.5 tw:py-1 tw:text-sm tw:gap-x-1.5": l === "sm",
783
+ "tw:px-3 tw:py-1.5 tw:gap-x-2": l === "md",
784
+ "tw:px-4 tw:py-2 tw:text-lg tw:gap-x-2": l === "lg"
785
+ },
786
+ a
787
+ ),
788
+ onKeyDown: (N) => {
789
+ N.key === "ArrowDown" && (N.preventDefault(), u(!0));
790
+ },
791
+ children: [
792
+ o,
793
+ !c && /* @__PURE__ */ n(v, { icon: ht, size: "xs" })
794
+ ]
795
+ }
796
+ ),
797
+ g && /* @__PURE__ */ n(
798
+ "div",
799
+ {
800
+ ref: b.setFloating,
801
+ style: h,
802
+ className: "tw:min-w-full tw:z-1000",
803
+ ...k(),
804
+ children: /* @__PURE__ */ n(
805
+ j,
806
+ {
807
+ className: s,
808
+ id: S,
809
+ focusableElementsSelector: '[role="menuitem"]:not([disabled]):not([aria-disabled]),input:not([disabled]),select:not([disabled])',
810
+ focusFirstItem: !0,
811
+ children: r
812
+ }
813
+ )
814
+ }
815
+ )
816
+ ]
817
+ }
818
+ );
819
+ }, I = Object.assign(ne, {
820
+ Item: j.Item,
821
+ Separator: j.Separator,
822
+ Title: j.Title,
823
+ Misc: j.Misc
824
+ }), oe = y(({ className: r, disabled: e, size: t = "md", type: o = "button", ...a }, l) => /* @__PURE__ */ n(
654
825
  "button",
655
826
  {
656
827
  className: w(
@@ -658,25 +829,25 @@ const be = h(({ className: t, ...r }, e) => /* @__PURE__ */ n(
658
829
  "tw:text-lm-brand tw:dark:text-dm-brand",
659
830
  "tw:highlight:text-lm-brand-dark tw:dark:highlight:text-dm-brand-dark tw:highlight:underline",
660
831
  {
661
- "tw:px-1.5 tw:py-1 tw:text-sm": e === "sm",
662
- "tw:px-3 tw:py-1.5": e === "md",
663
- "tw:px-4 tw:py-2 tw:text-lg": e === "lg",
664
- "tw:pointer-events-none tw:opacity-65": r
832
+ "tw:px-1.5 tw:py-1 tw:text-sm": t === "sm",
833
+ "tw:px-3 tw:py-1.5": t === "md",
834
+ "tw:px-4 tw:py-2 tw:text-lg": t === "lg",
835
+ "tw:pointer-events-none tw:opacity-65": e
665
836
  },
666
- t
837
+ r
667
838
  ),
668
- disabled: r,
839
+ disabled: e,
669
840
  type: o,
670
841
  ...a,
671
- ref: d
842
+ ref: l
672
843
  }
673
- )), Z = S(null), jt = ({ className: t, to: r, ...e }) => {
674
- const o = C(Z);
844
+ )), dt = q(null), ae = ({ className: r, to: e, ...t }) => {
845
+ const o = O(dt);
675
846
  return /* @__PURE__ */ n(
676
- at,
847
+ mt,
677
848
  {
678
849
  role: "menuitem",
679
- to: r,
850
+ to: e,
680
851
  className: ({ isActive: a }) => w(
681
852
  "tw:px-4 tw:pt-2 tw:pb-[calc(0.5rem-3px)] tw:border-b-3",
682
853
  "tw:highlight:text-lm-brand tw:dark:highlight:text-dm-brand",
@@ -689,169 +860,189 @@ const be = h(({ className: t, ...r }, e) => /* @__PURE__ */ n(
689
860
  "tw:border-b-transparent tw:text-gray-500": !a,
690
861
  "tw:flex-grow": o == null ? void 0 : o.fill
691
862
  },
692
- t
863
+ r
693
864
  ),
694
- ...e
865
+ ...t
695
866
  }
696
867
  );
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
868
+ }, le = ({ children: r, className: e, fill: t }) => /* @__PURE__ */ n(dt.Provider, { value: { fill: t }, children: /* @__PURE__ */ n(C, { role: "menubar", className: w("tw:flex tw:overflow-hidden", e), children: r }) }), Se = Object.assign(le, { Pill: ae }), de = new Intl.NumberFormat("en-US"), ie = (r) => de.format(Number(r)), rt = 10, je = (r) => Math.ceil(r / rt) * rt, M = 2, U = "...", se = (r, e) => Array.from({ length: e - r }, (t, o) => r + o), ce = (r, e) => {
869
+ const t = se(
870
+ Math.max(M, r - M),
871
+ Math.min(e - 1, r + M) + 1
701
872
  );
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 = [
873
+ return r - M > M && t.unshift(U), r + M < e - 1 && t.push(U), t.unshift(1), t.push(e), t;
874
+ }, A = (r) => r === U, we = (r) => A(r) ? r : ie(r), me = (r, e) => A(r) ? `${r}_${e}` : `${r}`, it = [
704
875
  "tw:border tw:border-r-0 tw:last:border-r tw:border-lm-border tw:dark:border-dm-border",
705
876
  "tw:rounded-none tw:first:rounded-l tw:last:rounded-r"
706
- ], et = (t = !1) => w(
707
- tt,
877
+ ], st = (r = !1) => w(
878
+ it,
708
879
  "tw:px-3 py-2 tw:cursor-pointer tw:no-underline",
709
880
  "tw:focus-ring tw:focus-visible:z-1",
710
- !t && [
881
+ !r && [
711
882
  "tw:text-lm-brand tw:dark:text-dm-brand",
712
883
  "tw:bg-lm-primary tw:dark:bg-dm-primary",
713
884
  "tw:highlight:bg-lm-secondary tw:dark:highlight:bg-dm-secondary"
714
885
  ],
715
- t && "tw:bg-lm-main tw:dark:bg-dm-main tw:text-white"
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: _ });
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 });
886
+ r && "tw:bg-lm-main tw:dark:bg-dm-main tw:text-white"
887
+ ), z = ({ children: r }) => /* @__PURE__ */ n("span", { "aria-hidden": !0, className: w(it, "tw:px-3 py-2 tw:text-gray-400"), children: r }), ct = () => /* @__PURE__ */ n(z, { children: U });
888
+ function pe({ children: r, active: e, isEllipsis: t, href: o, ...a }) {
889
+ const l = W(() => st(e), [e]);
890
+ return t ? /* @__PURE__ */ n(ct, {}) : /* @__PURE__ */ n(G, { className: l, to: o, ...a, children: r });
720
891
  }
721
- function Jt({ children: t, active: r, isEllipsis: e, ...o }) {
722
- const a = $(() => et(r), [r]);
723
- return e ? /* @__PURE__ */ n(rt, {}) : /* @__PURE__ */ n("button", { type: "button", className: a, ...o, children: t });
892
+ function be({ children: r, active: e, isEllipsis: t, ...o }) {
893
+ const a = W(() => st(e), [e]);
894
+ return t ? /* @__PURE__ */ n(ct, {}) : /* @__PURE__ */ n("button", { type: "button", className: a, ...o, children: r });
724
895
  }
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) },
728
- [o, e]
896
+ const Ae = ({ currentPage: r, pagesCount: e, ...t }) => {
897
+ const o = "urlForPage" in t, a = o ? pe : be, l = P(
898
+ (d) => o ? { href: A(d) ? void 0 : t.urlForPage(d) } : { onClick: () => !A(d) && t.onPageChange(d) },
899
+ [o, t]
729
900
  );
730
- return r < 2 ? null : /* @__PURE__ */ g("div", { className: "tw:select-none tw:flex", "data-testid": "paginator", children: [
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(
901
+ return e < 2 ? null : /* @__PURE__ */ p("div", { className: "tw:select-none tw:flex", "data-testid": "paginator", children: [
902
+ r === 1 ? /* @__PURE__ */ n(z, { children: /* @__PURE__ */ n(v, { size: "xs", icon: V }) }) : /* @__PURE__ */ n(a, { ...l(Math.max(1, r - 1)), "aria-label": "Previous", children: /* @__PURE__ */ n(v, { size: "xs", icon: V }) }),
903
+ ce(r, e).map((d, i) => /* @__PURE__ */ n(
733
904
  a,
734
905
  {
735
- active: l === t,
736
- isEllipsis: B(l),
737
- ...d(l),
738
- children: zt(l)
906
+ active: d === r,
907
+ isEllipsis: A(d),
908
+ ...l(d),
909
+ children: we(d)
739
910
  },
740
- qt(l, s)
911
+ me(d, i)
741
912
  )),
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 }) })
913
+ r === e ? /* @__PURE__ */ n(z, { children: /* @__PURE__ */ n(v, { size: "xs", icon: tt }) }) : /* @__PURE__ */ n(a, { ...l(Math.min(e, r + 1)), "aria-label": "Next", children: /* @__PURE__ */ n(v, { size: "xs", icon: tt }) })
743
914
  ] });
744
- }, Qt = ({
745
- open: t,
746
- children: r,
747
- className: e,
915
+ }, ge = ({ buttonLabel: r = "Options", buttonSize: e = "md", ...t }) => /* @__PURE__ */ n(
916
+ I,
917
+ {
918
+ buttonContent: /* @__PURE__ */ n(
919
+ v,
920
+ {
921
+ icon: ft,
922
+ className: f({ "tw:px-1": e === "sm" })
923
+ }
924
+ ),
925
+ caretless: !0,
926
+ buttonLabel: r,
927
+ buttonSize: e,
928
+ ...t
929
+ }
930
+ ), _e = Object.assign(ge, {
931
+ Item: I.Item,
932
+ Separator: I.Separator,
933
+ Title: I.Title,
934
+ Misc: I.Misc
935
+ }), ue = ({
936
+ open: r,
937
+ children: e,
938
+ className: t,
748
939
  onClose: o,
749
940
  ...a
750
941
  }) => {
751
- const d = I(null);
752
- return M(() => {
942
+ const l = T(null);
943
+ return B(() => {
753
944
  var c, m;
754
- const l = document.body, s = l.style.overflow, i = l.style.paddingRight;
755
- if (t) {
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();
945
+ const d = document.body, i = d.style.overflow, s = d.style.paddingRight;
946
+ if (r) {
947
+ const g = window.outerWidth - d.clientWidth, u = d.scrollHeight > d.clientHeight;
948
+ d.style.overflow = "hidden", u && (d.style.paddingRight = `${g}px`), (c = l.current) == null || c.showModal();
758
949
  } else
759
- (m = d.current) == null || m.close();
950
+ (m = l.current) == null || m.close();
760
951
  return () => {
761
- l.style.overflow = s, l.style.paddingRight = i;
952
+ d.style.overflow = i, d.style.paddingRight = s;
762
953
  };
763
- }, [t]), gt(
954
+ }, [r]), Ft(
764
955
  /* @__PURE__ */ n(
765
956
  "dialog",
766
957
  {
767
- ref: d,
768
- className: w("tw:bg-transparent tw:backdrop:bg-black/50", e),
769
- onCancel: (l) => {
770
- l.preventDefault(), o();
958
+ ref: l,
959
+ className: w("tw:bg-transparent tw:backdrop:bg-black/50", t),
960
+ onCancel: (d) => {
961
+ d.preventDefault(), o();
771
962
  },
772
963
  ...a,
773
- children: t && r
964
+ children: r && e
774
965
  }
775
966
  ),
776
967
  document.body
777
968
  );
778
- }, he = ({
779
- open: t,
780
- onClose: r,
781
- variant: e = "default",
969
+ }, $e = ({
970
+ open: r,
971
+ onClose: e,
972
+ variant: t = "default",
782
973
  title: o,
783
974
  children: a,
784
- className: d,
785
- ...l
975
+ className: l,
976
+ ...d
786
977
  }) => {
787
978
  const {
788
- size: s = "md",
789
- confirmText: i = "Confirm",
979
+ size: i = "md",
980
+ confirmText: s = "Confirm",
790
981
  cancelText: c = "Cancel",
791
982
  confirmDisabled: m,
792
- onConfirm: u,
793
- onClosed: f,
983
+ onConfirm: g,
984
+ onClosed: u,
794
985
  ...x
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]);
798
- return M(() => {
799
- if (t) {
800
- H.current = "cancel", p(!0);
986
+ } = "onConfirm" in d ? d : { ...d }, [b, h] = R(r), D = T(null), E = T("cancel"), K = P((k) => {
987
+ k.preventDefault(), k.stopPropagation(), E.current = "confirm", g == null || g();
988
+ }, [g]);
989
+ return B(() => {
990
+ if (r) {
991
+ E.current = "cancel", h(!0);
801
992
  return;
802
993
  }
803
- const k = F.current;
994
+ const k = D.current;
804
995
  if (k) {
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));
996
+ delete D.current.dataset.open;
997
+ let S = !1;
998
+ const L = (N) => {
999
+ S || N.target !== k || (S = !0, h(!1), u == null || u(E.current));
809
1000
  };
810
- return k.addEventListener("transitionend", q), () => {
811
- k.removeEventListener("transitionend", q);
1001
+ return k.addEventListener("transitionend", L), () => {
1002
+ k.removeEventListener("transitionend", L);
812
1003
  };
813
1004
  }
814
- }, [f, t]), M(() => {
815
- const k = F.current;
1005
+ }, [u, r]), B(() => {
1006
+ const k = D.current;
816
1007
  b && k && (k.dataset.open = "");
817
1008
  }, [b]), /* @__PURE__ */ n(
818
- Qt,
1009
+ ue,
819
1010
  {
820
1011
  open: b,
821
- onClose: r,
1012
+ onClose: e,
822
1013
  className: w(
823
1014
  {
824
1015
  "tw:flex tw:w-screen tw:h-screen tw:max-w-screen tw:max-h-screen": b,
825
- "tw:overflow-hidden": e === "cover"
1016
+ "tw:overflow-hidden": t === "cover"
826
1017
  },
827
- d
1018
+ l
828
1019
  ),
829
1020
  ...x,
830
1021
  children: /* @__PURE__ */ n(
831
1022
  "form",
832
1023
  {
833
1024
  "data-testid": "transition-container",
834
- ref: F,
1025
+ ref: D,
835
1026
  className: w(
836
1027
  "tw:w-full tw:m-auto tw:p-4 tw:sm:p-6",
837
1028
  // CSS transitions are based on the presence of the `data-open` attribute
838
1029
  "tw:-translate-y-4 tw:data-open:translate-y-0 tw:opacity-0 tw:data-open:opacity-100",
839
1030
  "tw:transition-[opacity_,_translate] tw:duration-300",
840
1031
  // Handle modal dimensions for different variants and sizes
841
- e !== "cover" && {
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"
1032
+ t !== "cover" && {
1033
+ "tw:sm:w-sm": i === "sm",
1034
+ "tw:md:w-lg": i === "md",
1035
+ "tw:md:w-4xl": i === "lg",
1036
+ "tw:md:w-6xl": i === "xl"
846
1037
  },
847
- { "tw:h-full": e === "cover" }
1038
+ { "tw:h-full": t === "cover" }
848
1039
  ),
849
- onSubmit: ot,
850
- children: /* @__PURE__ */ n(N, { className: w(
1040
+ onSubmit: K,
1041
+ children: /* @__PURE__ */ n(C, { className: w(
851
1042
  "tw:w-full",
852
- { "tw:h-full tw:relative tw:overflow-auto": e === "cover" }
853
- ), children: e === "cover" ? /* @__PURE__ */ g(O, { children: [
854
- /* @__PURE__ */ g(
1043
+ { "tw:h-full tw:relative tw:overflow-auto": t === "cover" }
1044
+ ), children: t === "cover" ? /* @__PURE__ */ p(_, { children: [
1045
+ /* @__PURE__ */ p(
855
1046
  "div",
856
1047
  {
857
1048
  className: w(
@@ -862,22 +1053,22 @@ const ue = ({ currentPage: t, pagesCount: r, ...e }) => {
862
1053
  ),
863
1054
  children: [
864
1055
  /* @__PURE__ */ n("h5", { children: o }),
865
- /* @__PURE__ */ n(Q, { onClick: r, label: "Close dialog" })
1056
+ /* @__PURE__ */ n(et, { onClick: e, label: "Close dialog" })
866
1057
  ]
867
1058
  }
868
1059
  ),
869
1060
  a
870
- ] }) : /* @__PURE__ */ g(O, { children: [
871
- /* @__PURE__ */ g(N.Header, { className: w(
1061
+ ] }) : /* @__PURE__ */ p(_, { children: [
1062
+ /* @__PURE__ */ p(C.Header, { className: w(
872
1063
  "tw:sticky tw:top-0",
873
1064
  "tw:flex tw:items-center tw:justify-between tw:gap-x-2"
874
1065
  ), children: [
875
- /* @__PURE__ */ n("h5", { className: w({ "tw:text-danger": e === "danger" }), children: o }),
876
- /* @__PURE__ */ n(Q, { onClick: r, label: "Close dialog" })
1066
+ /* @__PURE__ */ n("h5", { className: w({ "tw:text-danger": t === "danger" }), children: o }),
1067
+ /* @__PURE__ */ n(et, { onClick: e, label: "Close dialog" })
877
1068
  ] }),
878
- /* @__PURE__ */ n(N.Body, { children: a }),
879
- u && /* @__PURE__ */ g(
880
- N.Footer,
1069
+ /* @__PURE__ */ n(C.Body, { children: a }),
1070
+ g && /* @__PURE__ */ p(
1071
+ C.Footer,
881
1072
  {
882
1073
  "data-testid": "footer",
883
1074
  className: w(
@@ -885,15 +1076,15 @@ const ue = ({ currentPage: t, pagesCount: r, ...e }) => {
885
1076
  "tw:[&]:px-3 tw:sticky tw:bottom-0"
886
1077
  ),
887
1078
  children: [
888
- /* @__PURE__ */ n(Ot, { onClick: r, children: c }),
1079
+ /* @__PURE__ */ n(oe, { onClick: e, children: c }),
889
1080
  /* @__PURE__ */ n(
890
- _t,
1081
+ Jt,
891
1082
  {
892
1083
  solid: !0,
893
- variant: e === "danger" ? "danger" : "primary",
1084
+ variant: t === "danger" ? "danger" : "primary",
894
1085
  disabled: m,
895
1086
  type: "submit",
896
- children: i
1087
+ children: s
897
1088
  }
898
1089
  )
899
1090
  ]
@@ -904,109 +1095,109 @@ const ue = ({ currentPage: t, pagesCount: r, ...e }) => {
904
1095
  )
905
1096
  }
906
1097
  );
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", {
1098
+ }, He = ({ className: r, children: e, loading: t = !1, variant: o = "default" }) => /* @__PURE__ */ n($t, { className: f({ "tw:[&]:border-danger": o === "error" }, r), children: /* @__PURE__ */ p("h3", { className: f("tw:text-center", {
908
1099
  "tw:text-gray-500 tw:dark:text-gray-400": o === "default",
909
1100
  "tw:text-danger": o === "error"
910
1101
  }), children: [
911
- e && /* @__PURE__ */ g(O, { children: [
912
- /* @__PURE__ */ n(v, { icon: X, spin: !0 }),
913
- /* @__PURE__ */ n("span", { className: "tw:ml-2", children: r ?? "Loading..." })
1102
+ t && /* @__PURE__ */ p(_, { children: [
1103
+ /* @__PURE__ */ n(v, { icon: nt, spin: !0 }),
1104
+ /* @__PURE__ */ n("span", { className: "tw:ml-2", children: e ?? "Loading..." })
914
1105
  ] }),
915
- !e && r
916
- ] }) }), xe = ({ variant: t, className: r, size: e = "md", children: o }) => /* @__PURE__ */ n(
1106
+ !t && e
1107
+ ] }) }), Ue = ({ variant: r, className: e, size: t = "md", children: o }) => /* @__PURE__ */ n(
917
1108
  "div",
918
1109
  {
919
- className: y(
1110
+ className: f(
920
1111
  "tw:rounded-md tw:text-center",
921
1112
  {
922
- "tw:p-2": e === "sm",
923
- "tw:p-4": e === "md",
924
- "tw:p-6": e === "lg",
925
- "tw:[&]:text-white": t !== "warning",
926
- "tw:bg-lm-brand tw:dark:bg-dm-brand": t === "success",
927
- "tw:bg-danger": t === "error",
928
- "tw:bg-warning tw:text-black": t === "warning"
1113
+ "tw:p-2": t === "sm",
1114
+ "tw:p-4": t === "md",
1115
+ "tw:p-6": t === "lg",
1116
+ "tw:[&]:text-white": r !== "warning",
1117
+ "tw:bg-lm-brand tw:dark:bg-dm-brand": r === "success",
1118
+ "tw:bg-danger": r === "error",
1119
+ "tw:bg-warning tw:text-black": r === "warning"
929
1120
  },
930
- r
1121
+ e
931
1122
  ),
932
1123
  children: o
933
1124
  }
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,
1125
+ ), We = ({ placement: r = "auto" } = {}) => {
1126
+ const e = T(null), t = (() => {
1127
+ const h = [];
1128
+ return r === "auto" && h.push(Lt()), h.push(Mt({ element: e })), h;
1129
+ })(), [o, a] = R(!1), { refs: l, floatingStyles: d, context: i, middlewareData: s } = ot({
1130
+ placement: r === "auto" ? void 0 : r,
940
1131
  open: o,
941
1132
  onOpenChange: a,
942
- middleware: e
943
- }), c = ft(s, {
1133
+ middleware: t
1134
+ }), c = Bt(i, {
944
1135
  delay: { open: 300 },
945
1136
  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];
1137
+ }), { getFloatingProps: m, getReferenceProps: g } = at([c]), { isMounted: u, styles: x } = Rt(i, { duration: 200 }), b = W(() => {
1138
+ const h = i.placement.split("-")[0];
948
1139
  return {
949
1140
  top: "bottom",
950
1141
  right: "left",
951
1142
  bottom: "top",
952
1143
  left: "right"
953
- }[p] ?? "";
954
- }, [s.placement]);
1144
+ }[h] ?? "";
1145
+ }, [i.placement]);
955
1146
  return {
956
- anchor: { ...u(), ref: d.setReference },
1147
+ anchor: { ...g(), ref: l.setReference },
957
1148
  tooltip: {
958
1149
  ...m(),
959
- refSetter: d.setFloating,
960
- isMounted: f,
961
- styles: { ...l, ...x },
962
- arrowPos: i.arrow,
963
- arrowRef: r,
1150
+ refSetter: l.setFloating,
1151
+ isMounted: u,
1152
+ styles: { ...d, ...x },
1153
+ arrowPos: s.arrow,
1154
+ arrowRef: e,
964
1155
  arrowSide: b
965
1156
  }
966
1157
  };
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(
1158
+ }, Ke = ({ children: r, isMounted: e, styles: t, refSetter: o, arrowRef: a, arrowPos: l, arrowSide: d, ...i }) => {
1159
+ var s;
1160
+ return e && /* @__PURE__ */ n(
970
1161
  "div",
971
1162
  {
972
1163
  role: "tooltip",
973
1164
  "aria-live": "polite",
974
- className: y(
1165
+ className: f(
975
1166
  "tw:z-1000 tw:max-w-64",
976
1167
  // Add space between anchor and tooltip via padding, so that if the tooltip is inside the anchor, you can hover it
977
1168
  // and it's never closed
978
1169
  {
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"
1170
+ "tw:pt-2.5": d === "top",
1171
+ "tw:pb-2.5": d === "bottom",
1172
+ "tw:pr-2.5": d === "right",
1173
+ "tw:pl-2.5": d === "left"
983
1174
  }
984
1175
  ),
985
1176
  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: [
1177
+ style: t,
1178
+ ...i,
1179
+ children: /* @__PURE__ */ p("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
1180
  /* @__PURE__ */ n("span", { className: "tw:sr-only", children: "Tooltip: " }),
990
- t,
1181
+ r,
991
1182
  /* @__PURE__ */ n(
992
1183
  "div",
993
1184
  {
994
1185
  ref: a,
995
- className: y(
1186
+ className: f(
996
1187
  "tw:absolute",
997
1188
  // Render as a triangle
998
1189
  "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
1190
  // Rotate triangle so that it points to the correct direction
1000
1191
  {
1001
- "tw:rotate-180": l === "bottom",
1002
- "tw:rotate-90 tw:mr-[-3px]": l === "right",
1003
- "tw:rotate-270 tw:ml-[-3px]": l === "left"
1192
+ "tw:rotate-180": d === "bottom",
1193
+ "tw:rotate-90 tw:mr-[-3px]": d === "right",
1194
+ "tw:rotate-270 tw:ml-[-3px]": d === "left"
1004
1195
  }
1005
1196
  ),
1006
1197
  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`
1198
+ left: l == null ? void 0 : l.x,
1199
+ top: l == null ? void 0 : l.y,
1200
+ [d]: `${-(((s = a.current) == null ? void 0 : s.offsetWidth) ?? 0) / 2}px`
1010
1201
  },
1011
1202
  "data-testid": "arrow"
1012
1203
  }
@@ -1014,66 +1205,111 @@ const ue = ({ currentPage: t, pagesCount: r, ...e }) => {
1014
1205
  ] })
1015
1206
  }
1016
1207
  );
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]
1208
+ };
1209
+ function ze({ items: r, order: e, onChange: t, prefixed: o = !0, buttonVariant: a = "button", ...l }) {
1210
+ const d = P((s) => {
1211
+ const c = Tt({ currentOrderDir: e.dir, currentField: e.field, newField: s });
1212
+ t(c);
1213
+ }, [t, e.dir, e.field]), i = a === "button";
1214
+ return /* @__PURE__ */ p(
1215
+ I,
1216
+ {
1217
+ buttonContent: /* @__PURE__ */ p(_, { children: [
1218
+ !i && "Order by",
1219
+ i && !e.field && /* @__PURE__ */ n("i", { children: "Order by..." }),
1220
+ i && e.field && /* @__PURE__ */ p(_, { children: [
1221
+ o && "Order by: ",
1222
+ r[e.field],
1223
+ " - ",
1224
+ e.dir ?? "DESC"
1225
+ ] })
1226
+ ] }),
1227
+ buttonVariant: a,
1228
+ ...l,
1229
+ children: [
1230
+ Object.entries(r).map(([s, c]) => /* @__PURE__ */ p(
1231
+ I.Item,
1232
+ {
1233
+ selected: e.field === s,
1234
+ onClick: () => d(s),
1235
+ className: "tw:flex tw:items-center tw:justify-between",
1236
+ children: [
1237
+ c,
1238
+ e.field === s && /* @__PURE__ */ n(v, { icon: e.dir === "ASC" ? xt : yt })
1239
+ ]
1240
+ },
1241
+ s
1242
+ )),
1243
+ /* @__PURE__ */ n(I.Separator, {}),
1244
+ /* @__PURE__ */ n(I.Item, { disabled: !e.field, onClick: () => t({}), children: /* @__PURE__ */ n("i", { children: "Clear selection" }) })
1245
+ ]
1246
+ }
1247
+ );
1248
+ }
1249
+ const qe = ({ text: r, className: e, size: t = "lg", initialCopied: o = !1, navigator_: a = globalThis.navigator, ...l }) => {
1250
+ const [d, i] = It(o), s = P(
1251
+ () => a.clipboard.writeText(r).then(i),
1252
+ [a.clipboard, r, i]
1021
1253
  );
1022
1254
  return /* @__PURE__ */ n(
1023
1255
  "button",
1024
1256
  {
1025
1257
  type: "button",
1026
- className: y(
1258
+ className: f(
1027
1259
  "tw:focus-ring tw:rounded-sm",
1028
1260
  {
1029
- "tw:text-md": e === "sm",
1030
- "tw:text-lg": e === "md",
1031
- "tw:text-xl": e === "lg"
1261
+ "tw:text-md": t === "sm",
1262
+ "tw:text-lg": t === "md",
1263
+ "tw:text-xl": t === "lg"
1032
1264
  },
1033
- r
1265
+ e
1034
1266
  ),
1035
- "aria-label": `Copy ${t} to clipboard`,
1267
+ "aria-label": `Copy ${r} to clipboard`,
1036
1268
  title: "Copy to clipboard",
1037
- onClick: i,
1038
- ...d,
1039
- children: /* @__PURE__ */ n(v, { icon: l ? wt : kt, fixedWidth: !0 })
1269
+ onClick: s,
1270
+ ...l,
1271
+ children: /* @__PURE__ */ n(v, { icon: d ? kt : Et, fixedWidth: !0 })
1040
1272
  }
1041
1273
  );
1042
1274
  };
1043
1275
  export {
1044
- _t as Button,
1045
- N as Card,
1046
- he as CardModal,
1047
- se as Checkbox,
1048
- Q as CloseButton,
1049
- ve as CopyToClipboardButton,
1050
- le as Details,
1051
- _ as ELLIPSIS,
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,
1074
- B as pageIsEllipsis,
1075
- zt as prettifyPageNumber,
1076
- Kt as progressivePagination,
1077
- pe as roundTen,
1078
- ye as useTooltip
1276
+ Jt as Button,
1277
+ C as Card,
1278
+ $e as CardModal,
1279
+ Le as Checkbox,
1280
+ et as CloseButton,
1281
+ qe as CopyToClipboardButton,
1282
+ Oe as Details,
1283
+ I as Dropdown,
1284
+ U as ELLIPSIS,
1285
+ J as Input,
1286
+ Q as Label,
1287
+ Me as LabelledInput,
1288
+ Be as LabelledRevealablePasswordInput,
1289
+ Re as LabelledSelect,
1290
+ oe as LinkButton,
1291
+ Ht as Listbox,
1292
+ j as Menu,
1293
+ He as Message,
1294
+ ue as ModalDialog,
1295
+ Se as NavPills,
1296
+ ze as OrderingDropdown,
1297
+ Ae as Paginator,
1298
+ Ue as Result,
1299
+ Qt as RevealablePasswordInput,
1300
+ _e as RowDropdown,
1301
+ Fe as SearchCombobox,
1302
+ Yt as SearchInput,
1303
+ Xt as Select,
1304
+ $t as SimpleCard,
1305
+ De as Table,
1306
+ Ee as ToggleSwitch,
1307
+ Ke as Tooltip,
1308
+ ie as formatNumber,
1309
+ me as keyForPage,
1310
+ A as pageIsEllipsis,
1311
+ we as prettifyPageNumber,
1312
+ ce as progressivePagination,
1313
+ je as roundTen,
1314
+ We as useTooltip
1079
1315
  };