@shlinkio/shlink-frontend-kit 0.9.8 → 0.9.10

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