@shlinkio/shlink-frontend-kit 1.3.1 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/index.d.ts +136 -142
  2. package/dist/index.js +717 -725
  3. package/package.json +11 -10
package/dist/index.js CHANGED
@@ -1,132 +1,128 @@
1
- import { jsxs as g, jsx as a, Fragment as B } from "react/jsx-runtime";
2
- import { clsx as d } from "clsx";
3
- import { useRef as C, useState as L, useEffect as R, forwardRef as k, useCallback as w, createContext as K, useContext as E, useId as S, useImperativeHandle as we, useMemo as P } from "react";
4
- import { Link as W, useNavigate as ke, useLocation as oe, NavLink as ve } from "react-router";
5
- import { faClose as Ne, faEyeSlash as Ce, faEye as Te, faCircleNotch as ae, faSearch as Ae, faCheck as Ie, faCaretDown as Oe, faChevronUp as Re, faChevronDown as Le, faChevronLeft as ee, faChevronRight as te, faEllipsisV as Pe, faSortAmountUp as Ee, faSortAmountDown as Se } from "@fortawesome/free-solid-svg-icons";
1
+ import { jsxs as g, jsx as a, Fragment as F } from "react/jsx-runtime";
2
+ import { clsx as c } from "clsx";
3
+ import { useRef as v, useState as R, useEffect as O, useCallback as w, createContext as G, useContext as P, useId as E, useImperativeHandle as we, useMemo as L } from "react";
4
+ import { Link as K, useNavigate as ke, useLocation as ne, NavLink as ve } from "react-router";
5
+ import { faClose as Ne, faEyeSlash as Ce, faEye as Te, faCircleNotch as oe, faSearch as Ae, faCheck as Ie, faCaretDown as Oe, faChevronUp as Re, faChevronDown as Le, faChevronLeft as z, faChevronRight as ee, faEllipsisV as Pe, faSortAmountUp as Ee, faSortAmountDown as Se } from "@fortawesome/free-solid-svg-icons";
6
6
  import { FontAwesomeIcon as N } from "@fortawesome/react-fontawesome";
7
- import { useFloating as se, flip as De, offset as Me, useClick as _e, useInteractions as le, autoPlacement as Fe, arrow as Be, useHover as He, useTransitionStyles as $e } from "@floating-ui/react";
7
+ import { useFloating as ae, flip as De, offset as Me, useClick as _e, useInteractions as se, autoPlacement as Fe, arrow as Be, useHover as He, useTransitionStyles as $e } from "@floating-ui/react";
8
8
  import { faClone as je } from "@fortawesome/free-regular-svg-icons";
9
9
  import { createPortal as Ue } from "react-dom";
10
- const tr = ({ children: e, summary: r, summaryClasses: t, ...n }) => {
11
- const o = C(null), [s, l] = L(!1);
12
- return R(() => {
13
- const i = o.current, c = () => l(!!i?.open);
14
- return i?.addEventListener("toggle", c), () => i?.removeEventListener("toggle", c);
10
+ const zt = ({ children: e, summary: t, summaryClasses: r, ...n }) => {
11
+ const o = v(null), [s, l] = R(!1);
12
+ return O(() => {
13
+ const i = o.current, d = () => l(!!i?.open);
14
+ return i?.addEventListener("toggle", d), () => i?.removeEventListener("toggle", d);
15
15
  }, []), /* @__PURE__ */ g("details", { ref: o, ...n, children: [
16
- /* @__PURE__ */ a("summary", { className: d("focus-ring px-1 -mx-1 rounded-sm", t), children: r }),
16
+ /* @__PURE__ */ a("summary", { className: c("focus-ring px-1 -mx-1 rounded-sm", r), children: t }),
17
17
  s && /* @__PURE__ */ a("div", { className: "mt-3 flex flex-col gap-y-3", children: e })
18
18
  ] });
19
- }, Ge = k(({ className: e, ...r }, t) => /* @__PURE__ */ a(
19
+ }, Ge = ({ className: e, ...t }) => /* @__PURE__ */ a(
20
20
  "div",
21
21
  {
22
- className: d(
22
+ className: c(
23
23
  "px-4 py-3 rounded-t-md",
24
24
  "bg-lm-primary dark:bg-dm-primary border-b border-lm-border dark:border-dm-border",
25
25
  e
26
26
  ),
27
- ...r,
28
- ref: t
27
+ ...t
29
28
  }
30
- )), Ke = k(({ className: e, ...r }, t) => /* @__PURE__ */ a(
29
+ ), Ke = ({ className: e, ...t }) => /* @__PURE__ */ a(
31
30
  "div",
32
31
  {
33
- className: d(
32
+ className: c(
34
33
  "p-4 bg-lm-primary dark:bg-dm-primary first:rounded-t-md",
35
34
  "first:rounded-t-md last:rounded-b-md",
36
35
  e
37
36
  ),
38
- ...r,
39
- ref: t
37
+ ...t
40
38
  }
41
- )), We = k(({ className: e, ...r }, t) => /* @__PURE__ */ a(
39
+ ), We = ({ className: e, ...t }) => /* @__PURE__ */ a(
42
40
  "div",
43
41
  {
44
- className: d(
42
+ className: c(
45
43
  "px-4 py-3 rounded-b-md",
46
44
  "bg-lm-primary dark:bg-dm-primary border-t border-lm-border dark:border-dm-border",
47
45
  e
48
46
  ),
49
- ...r,
50
- ref: t
47
+ ...t
51
48
  }
52
- )), qe = k(({ className: e, ...r }, t) => /* @__PURE__ */ a(
49
+ ), qe = ({ className: e, ...t }) => /* @__PURE__ */ a(
53
50
  "div",
54
51
  {
55
- className: d(
52
+ className: c(
56
53
  "group/card rounded-md shadow-md",
57
54
  "border border-lm-border dark:border-dm-border bg-lm-primary dark:bg-dm-primary",
58
55
  e
59
56
  ),
60
- ...r,
61
- ref: t
57
+ ...t
62
58
  }
63
- )), I = Object.assign(qe, { Body: Ke, Header: Ge, Footer: We }), Qe = k(({ bodyClassName: e, children: r, ...t }, n) => {
64
- const { title: o, titleSize: s = "md", ...l } = "title" in t ? t : {
65
- ...t,
59
+ ), A = Object.assign(qe, { Body: Ke, Header: Ge, Footer: We }), Qe = ({ bodyClassName: e, children: t, ...r }) => {
60
+ const { title: n, titleSize: o = "md", ...s } = "title" in r ? r : {
61
+ ...r,
66
62
  title: void 0,
67
63
  titleSize: void 0
68
64
  };
69
- return /* @__PURE__ */ g(I, { ...l, ref: n, children: [
70
- o && /* @__PURE__ */ g(I.Header, { children: [
71
- s === "lg" && /* @__PURE__ */ a("h4", { children: o }),
72
- s === "md" && /* @__PURE__ */ a("h5", { children: o }),
73
- s === "sm" && /* @__PURE__ */ a("h6", { children: o })
65
+ return /* @__PURE__ */ g(A, { ...s, children: [
66
+ n && /* @__PURE__ */ g(A.Header, { children: [
67
+ o === "lg" && /* @__PURE__ */ a("h4", { children: n }),
68
+ o === "md" && /* @__PURE__ */ a("h5", { children: n }),
69
+ o === "sm" && /* @__PURE__ */ a("h6", { children: n })
74
70
  ] }),
75
- /* @__PURE__ */ a(I.Body, { className: e, children: r })
71
+ /* @__PURE__ */ a(A.Body, { className: e, children: t })
76
72
  ] });
77
- });
73
+ };
78
74
  function Ye({
79
75
  id: e,
80
- items: r,
81
- onSelectItem: t,
76
+ items: t,
77
+ onSelectItem: r,
82
78
  onActiveItemChange: n,
83
79
  renderItem: o,
84
80
  className: s,
85
81
  noItemsMessage: l = "No items",
86
82
  anchor: i,
87
- "aria-label": c = "Items",
88
- ...u
83
+ "aria-label": d = "Items",
84
+ ...p
89
85
  }) {
90
- const [b, x] = L(0), f = w((h) => {
91
- if (x(h), n) {
92
- const [p, m] = [...r.entries()][h];
93
- n(p, m);
86
+ const [f, b] = R(0), x = w((h) => {
87
+ if (b(h), n) {
88
+ const [u, m] = [...t.entries()][h];
89
+ n(u, m);
94
90
  }
95
- }, [r, n]);
96
- return R(() => {
91
+ }, [t, n]);
92
+ return O(() => {
97
93
  const h = i?.current;
98
94
  if (!h)
99
95
  return;
100
- const p = (m) => {
101
- ["Enter", "ArrowUp", "ArrowDown"].includes(m.key) && m.preventDefault(), m.key === "ArrowDown" ? f(Math.min(b + 1, r.size - 1)) : m.key === "ArrowUp" ? f(Math.max(b - 1, 0)) : m.key === "Enter" && t([...r.values()][b]);
96
+ const u = (m) => {
97
+ ["Enter", "ArrowUp", "ArrowDown"].includes(m.key) && m.preventDefault(), m.key === "ArrowDown" ? x(Math.min(f + 1, t.size - 1)) : m.key === "ArrowUp" ? x(Math.max(f - 1, 0)) : m.key === "Enter" && r([...t.values()][f]);
102
98
  };
103
- return h.addEventListener("keydown", p), () => h.removeEventListener("keydown", p);
104
- }, [b, i, f, r, t]), /* @__PURE__ */ g(
105
- I,
99
+ return h.addEventListener("keydown", u), () => h.removeEventListener("keydown", u);
100
+ }, [f, i, x, t, r]), /* @__PURE__ */ g(
101
+ A,
106
102
  {
107
103
  id: e,
108
- className: d("py-1 flex flex-col", s),
104
+ className: c("py-1 flex flex-col", s),
109
105
  role: "listbox",
110
106
  "aria-orientation": "vertical",
111
- "aria-label": c,
112
- ...u,
107
+ "aria-label": d,
108
+ ...p,
113
109
  children: [
114
- r.size === 0 && /* @__PURE__ */ a("i", { role: "option", "aria-disabled": !0, "aria-selected": !1, "data-testid": "no-items", className: "px-2 py-1", children: l }),
115
- [...r.entries()].map(([h, p], m) => /* @__PURE__ */ a(
110
+ t.size === 0 && /* @__PURE__ */ a("i", { role: "option", "aria-disabled": !0, "aria-selected": !1, "data-testid": "no-items", className: "px-2 py-1", children: l }),
111
+ [...t.entries()].map(([h, u], m) => /* @__PURE__ */ a(
116
112
  "button",
117
113
  {
118
114
  id: `${e}_${h}`,
119
115
  type: "button",
120
116
  role: "option",
121
- "aria-selected": m === b,
122
- className: d(
117
+ "aria-selected": m === f,
118
+ className: c(
123
119
  "px-2 py-1 text-left truncate",
124
- { "bg-lm-secondary dark:bg-dm-secondary": m === b }
120
+ { "bg-lm-secondary dark:bg-dm-secondary": m === f }
125
121
  ),
126
122
  tabIndex: -1,
127
- onClick: () => t(p),
128
- onMouseOver: () => f(m),
129
- children: o(p)
123
+ onClick: () => r(u),
124
+ onMouseOver: () => x(m),
125
+ children: o(u)
130
126
  },
131
127
  h
132
128
  ))
@@ -134,48 +130,48 @@ function Ye({
134
130
  }
135
131
  );
136
132
  }
137
- const H = K(void 0), M = K({ responsive: !0, size: "md" }), Xe = ({ children: e, className: r }) => {
138
- const { responsive: t } = E(M);
139
- return /* @__PURE__ */ a(H.Provider, { value: { section: "head" }, children: /* @__PURE__ */ a(
133
+ const B = G(void 0), D = G({ responsive: !0, size: "md" }), Xe = ({ children: e, className: t }) => {
134
+ const { responsive: r } = P(D);
135
+ return /* @__PURE__ */ a(B.Provider, { value: { section: "head" }, children: /* @__PURE__ */ a(
140
136
  "thead",
141
137
  {
142
- className: d(
143
- { "hidden lg:table-header-group": t },
144
- r
138
+ className: c(
139
+ { "hidden lg:table-header-group": r },
140
+ t
145
141
  ),
146
142
  children: e
147
143
  }
148
144
  ) });
149
- }, Je = ({ children: e, className: r }) => {
150
- const { responsive: t } = E(M);
151
- return /* @__PURE__ */ a(H.Provider, { value: { section: "body" }, children: /* @__PURE__ */ a(
145
+ }, Je = ({ children: e, className: t }) => {
146
+ const { responsive: r } = P(D);
147
+ return /* @__PURE__ */ a(B.Provider, { value: { section: "body" }, children: /* @__PURE__ */ a(
152
148
  "tbody",
153
149
  {
154
- className: d(
155
- { "lg:table-row-group flex flex-col gap-y-3": t },
156
- r
150
+ className: c(
151
+ { "lg:table-row-group flex flex-col gap-y-3": r },
152
+ t
157
153
  ),
158
154
  children: e
159
155
  }
160
156
  ) });
161
- }, Ze = ({ children: e, className: r }) => {
162
- const { responsive: t } = E(M);
163
- return /* @__PURE__ */ a(H.Provider, { value: { section: "footer" }, children: /* @__PURE__ */ a(
157
+ }, Ze = ({ children: e, className: t }) => {
158
+ const { responsive: r } = P(D);
159
+ return /* @__PURE__ */ a(B.Provider, { value: { section: "footer" }, children: /* @__PURE__ */ a(
164
160
  "tfoot",
165
161
  {
166
- className: d(
167
- { "lg:table-row-group flex flex-col gap-y-3 mt-4": t },
168
- r
162
+ className: c(
163
+ { "lg:table-row-group flex flex-col gap-y-3 mt-4": r },
164
+ t
169
165
  ),
170
166
  children: e
171
167
  }
172
168
  ) });
173
- }, Ve = ({ children: e, className: r, ...t }) => {
174
- const o = E(H)?.section === "body", { responsive: s } = E(M);
169
+ }, Ve = ({ children: e, className: t, ...r }) => {
170
+ const o = P(B)?.section === "body", { responsive: s } = P(D);
175
171
  return /* @__PURE__ */ a(
176
172
  "tr",
177
173
  {
178
- className: d(
174
+ className: c(
179
175
  "group",
180
176
  {
181
177
  "lg:table-row flex flex-col": s,
@@ -184,56 +180,57 @@ const H = K(void 0), M = K({ responsive: !0, size: "md" }), Xe = ({ children: e,
184
180
  // Use a different hover bg color depending on the table being inside a card or not
185
181
  "group-[&]/card:hover:bg-lm-secondary dark:group-[&]/card:hover:bg-dm-secondary": o
186
182
  },
187
- r
183
+ t
188
184
  ),
189
- ...t,
185
+ ...r,
190
186
  children: e
191
187
  }
192
188
  );
193
- }, ze = ({ children: e, className: r, columnName: t, type: n, ...o }) => {
194
- const s = E(H), l = n ?? (s?.section !== "body" ? "th" : "td"), { responsive: i, size: c } = E(M);
189
+ }, ze = ({ children: e, className: t, columnName: r, type: n, ...o }) => {
190
+ const s = P(B), l = n ?? (s?.section !== "body" ? "th" : "td"), { responsive: i, size: d } = P(D);
195
191
  return /* @__PURE__ */ a(
196
192
  l,
197
193
  {
198
- "data-column": i ? t : void 0,
199
- className: d(
194
+ "data-column": i ? r : void 0,
195
+ className: c(
200
196
  "border-lm-border dark:border-dm-border",
201
197
  {
202
- "p-1": c === "sm",
203
- "p-2": c === "md",
204
- "p-3": c === "lg",
198
+ "p-1": d === "sm",
199
+ "p-2": d === "md",
200
+ "p-3": d === "lg",
205
201
  "border-b-1": !i,
206
202
  "block lg:table-cell not-last:border-b-1 lg:border-b-1": i,
207
203
  "text-left": l === "th",
208
204
  // For responsive tables, display the content in data-column attribute for md sizes and lower
209
205
  "before:lg:hidden before:content-[attr(data-column)] before:font-bold before:mr-1": i && l === "td"
210
206
  },
211
- r
207
+ t
212
208
  ),
213
209
  ...o,
214
210
  children: e
215
211
  }
216
212
  );
217
- }, et = ({ header: e, footer: r, children: t, responsive: n = !0, size: o = "md", ...s }) => /* @__PURE__ */ a(M.Provider, { value: { responsive: n, size: o }, children: /* @__PURE__ */ g("table", { className: "w-full", ...s, children: [
213
+ }, et = ({ header: e, footer: t, children: r, responsive: n = !0, size: o = "md", ...s }) => /* @__PURE__ */ a(D.Provider, { value: { responsive: n, size: o }, children: /* @__PURE__ */ g("table", { className: "w-full", ...s, children: [
218
214
  /* @__PURE__ */ a(Xe, { children: e }),
219
- /* @__PURE__ */ a(Je, { children: t }),
220
- r && /* @__PURE__ */ a(Ze, { children: r })
221
- ] }) }), rr = Object.assign(et, { Row: Ve, Cell: ze }), ie = k(({
215
+ /* @__PURE__ */ a(Je, { children: r }),
216
+ t && /* @__PURE__ */ a(Ze, { children: t })
217
+ ] }) }), er = Object.assign(et, { Row: Ve, Cell: ze }), le = ({
222
218
  className: e,
223
- disabled: r,
224
- variant: t = "primary",
219
+ disabled: t,
220
+ variant: r = "primary",
225
221
  size: n = "md",
226
222
  inline: o = !1,
227
223
  solid: s = !1,
228
224
  type: l = "button",
229
- ...i
230
- }, c) => {
231
- const u = "to" in i && typeof i.to == "string", b = u ? W : "button", x = u ? void 0 : l;
225
+ ref: i,
226
+ ...d
227
+ }) => {
228
+ const p = "to" in d && typeof d.to == "string", f = p ? K : "button", b = p ? void 0 : l;
232
229
  return /* @__PURE__ */ a(
233
- b,
230
+ f,
234
231
  {
235
- ref: c,
236
- className: d(
232
+ ref: i,
233
+ className: c(
237
234
  {
238
235
  "inline-flex": o,
239
236
  flex: !o
@@ -242,9 +239,9 @@ const H = K(void 0), M = K({ responsive: !0, size: "md" }), Xe = ({ children: e,
242
239
  "border rounded-md no-underline",
243
240
  "transition-colors",
244
241
  {
245
- "focus-ring": t === "primary",
246
- "focus-ring-secondary": t === "secondary",
247
- "focus-ring-danger": t === "danger"
242
+ "focus-ring": r === "primary",
243
+ "focus-ring-secondary": r === "secondary",
244
+ "focus-ring-danger": r === "danger"
248
245
  },
249
246
  {
250
247
  "px-1.5 py-1 text-sm": n === "sm",
@@ -252,49 +249,49 @@ const H = K(void 0), M = K({ responsive: !0, size: "md" }), Xe = ({ children: e,
252
249
  "px-4 py-2 text-lg": n === "lg"
253
250
  },
254
251
  {
255
- "border-lm-brand dark:border-dm-brand": t === "primary",
256
- "text-lm-brand dark:text-dm-brand": t === "primary" && !s,
257
- "border-zinc-500": t === "secondary",
258
- "text-zinc-500": t === "secondary" && !s,
259
- "border-danger": t === "danger",
260
- "text-danger": t === "danger" && !s
252
+ "border-lm-brand dark:border-dm-brand": r === "primary",
253
+ "text-lm-brand dark:text-dm-brand": r === "primary" && !s,
254
+ "border-zinc-500": r === "secondary",
255
+ "text-zinc-500": r === "secondary" && !s,
256
+ "border-danger": r === "danger",
257
+ "text-danger": r === "danger" && !s
261
258
  },
262
259
  s && {
263
260
  "text-white": !0,
264
- "bg-lm-brand dark:bg-dm-brand": t === "primary",
265
- "highlight:bg-lm-brand-dark dark:highlight:bg-dm-brand-dark": t === "primary",
266
- "highlight:border-lm-brand-dark dark:highlight:border-dm-brand-dark": t === "primary",
267
- "bg-zinc-500": t === "secondary",
268
- "highlight:bg-zinc-600 highlight:border-zinc-600": t === "secondary",
269
- "bg-danger": t === "danger",
270
- "highlight:bg-danger-dark highlight:border-danger-dark": t === "danger"
261
+ "bg-lm-brand dark:bg-dm-brand": r === "primary",
262
+ "highlight:bg-lm-brand-dark dark:highlight:bg-dm-brand-dark": r === "primary",
263
+ "highlight:border-lm-brand-dark dark:highlight:border-dm-brand-dark": r === "primary",
264
+ "bg-zinc-500": r === "secondary",
265
+ "highlight:bg-zinc-600 highlight:border-zinc-600": r === "secondary",
266
+ "bg-danger": r === "danger",
267
+ "highlight:bg-danger-dark highlight:border-danger-dark": r === "danger"
271
268
  },
272
- !r && {
269
+ !t && {
273
270
  "highlight:text-white": !s,
274
- "highlight:bg-lm-brand dark:highlight:bg-dm-brand": t === "primary",
275
- "highlight:bg-zinc-500": t === "secondary",
276
- "highlight:bg-danger": t === "danger"
271
+ "highlight:bg-lm-brand dark:highlight:bg-dm-brand": r === "primary",
272
+ "highlight:bg-zinc-500": r === "secondary",
273
+ "highlight:bg-danger": r === "danger"
277
274
  },
278
275
  {
279
- "cursor-pointer": !r,
280
- "pointer-events-none opacity-65": r
276
+ "cursor-pointer": !t,
277
+ "pointer-events-none opacity-65": t
281
278
  },
282
279
  e
283
280
  ),
284
- disabled: u ? void 0 : r,
285
- "aria-disabled": u ? r : void 0,
286
- type: x,
287
- ...i
281
+ disabled: p ? void 0 : t,
282
+ "aria-disabled": p ? t : void 0,
283
+ type: b,
284
+ ...d
288
285
  }
289
286
  );
290
- }), de = k(({ className: e, onChange: r, ...t }, n) => {
291
- const o = w((s) => r?.(s.target.checked, s), [r]);
287
+ }, ie = ({ className: e, onChange: t, ref: r, ...n }) => {
288
+ const o = w((s) => t?.(s.target.checked, s), [t]);
292
289
  return /* @__PURE__ */ a(
293
290
  "input",
294
291
  {
295
- ref: n,
292
+ ref: r,
296
293
  type: "checkbox",
297
- className: d(
294
+ className: c(
298
295
  "appearance-none focus-ring cursor-[inherit]",
299
296
  "border-1 border-lm-input-border dark:border-dm-input-border",
300
297
  "bg-lm-primary dark:bg-dm-primary checked:bg-lm-brand dark:checked:bg-dm-brand bg-no-repeat",
@@ -303,57 +300,57 @@ const H = K(void 0), M = K({ responsive: !0, size: "md" }), Xe = ({ children: e,
303
300
  e
304
301
  ),
305
302
  onChange: o,
306
- ...t
303
+ ...n
307
304
  }
308
305
  );
309
- }), nr = k(({ className: e, ...r }, t) => /* @__PURE__ */ a(
310
- de,
306
+ }, tr = ({ className: e, ...t }) => /* @__PURE__ */ a(
307
+ ie,
311
308
  {
312
- ref: t,
313
- className: d("rounded-sm min-w-4 w-4 h-4 checked:bg-(image:--tick) bg-center", e),
314
- ...r
309
+ className: c("rounded-sm min-w-4 w-4 h-4 checked:bg-(image:--tick) bg-center", e),
310
+ ...t
315
311
  }
316
- )), Y = k(({ onClick: e, className: r, label: t = "Close", size: n = "lg", solid: o }, s) => /* @__PURE__ */ a(
312
+ ), Q = ({ onClick: e, className: t, label: r = "Close", size: n = "lg", solid: o, ref: s }) => /* @__PURE__ */ a(
317
313
  "button",
318
314
  {
319
315
  ref: s,
320
316
  type: "button",
321
317
  onClick: e,
322
- className: d(
318
+ className: c(
323
319
  "rounded-md focus-ring cursor-pointer",
324
320
  {
325
321
  "opacity-50 highlight:opacity-80 transition-opacity": !o
326
322
  },
327
- r
323
+ t
328
324
  ),
329
- "aria-label": t,
325
+ "aria-label": r,
330
326
  children: /* @__PURE__ */ a(N, { icon: Ne, size: n === "lg" ? "xl" : n === "md" ? "lg" : void 0 })
331
327
  }
332
- )), J = k(({
328
+ ), X = ({
333
329
  borderless: e = !1,
334
- size: r = "md",
335
- feedback: t,
330
+ size: t = "md",
331
+ feedback: r,
336
332
  variant: n = "default",
337
333
  className: o,
338
334
  disabled: s,
339
- ...l
340
- }, i) => /* @__PURE__ */ a(
335
+ ref: l,
336
+ ...i
337
+ }) => /* @__PURE__ */ a(
341
338
  "input",
342
339
  {
343
- ref: i,
344
- className: d(
340
+ ref: l,
341
+ className: c(
345
342
  "outline-none",
346
343
  n === "default" && [
347
344
  "w-full",
348
345
  {
349
- "focus-ring": !t,
350
- "focus-ring-danger": t === "error",
351
- "px-2 py-1 text-sm": r === "sm",
352
- "px-3 py-1.5": r === "md",
353
- "px-4 py-2 text-xl": r === "lg",
346
+ "focus-ring": !r,
347
+ "focus-ring-danger": r === "error",
348
+ "px-2 py-1 text-sm": t === "sm",
349
+ "px-3 py-1.5": t === "md",
350
+ "px-4 py-2 text-xl": t === "lg",
354
351
  "rounded-md border": !e,
355
- "border-lm-input-border dark:border-dm-input-border": !e && !t,
356
- "border-danger": !e && t === "error",
352
+ "border-lm-input-border dark:border-dm-input-border": !e && !r,
353
+ "border-danger": !e && r === "error",
357
354
  "bg-lm-disabled-input dark:bg-dm-disabled-input": s,
358
355
  "bg-lm-primary dark:bg-dm-primary": !s,
359
356
  // Use different background color when rendered inside a card
@@ -363,62 +360,60 @@ const H = K(void 0), M = K({ responsive: !0, size: "md" }), Xe = ({ children: e,
363
360
  o
364
361
  ),
365
362
  disabled: s,
366
- ...l
363
+ ...i
367
364
  }
368
- )), Z = ({ required: e, children: r, className: t, ...n }) => /* @__PURE__ */ g("label", { className: d("cursor-pointer", t), ...n, children: [
369
- r,
365
+ ), J = ({ required: e, children: t, className: r, ...n }) => /* @__PURE__ */ g("label", { className: c("cursor-pointer", r), ...n, children: [
366
+ t,
370
367
  e && /* @__PURE__ */ a("span", { className: "text-danger ml-1", "data-testid": "required-indicator", children: "*" })
371
- ] }), V = ({ children: e, helpText: r, error: t, "data-testid": n }) => /* @__PURE__ */ g("div", { className: "flex flex-col gap-1", "data-testid": n, children: [
368
+ ] }), Z = ({ children: e, helpText: t, error: r, "data-testid": n }) => /* @__PURE__ */ g("div", { className: "flex flex-col gap-1", "data-testid": n, children: [
372
369
  e,
373
- r && /* @__PURE__ */ a(
370
+ t && /* @__PURE__ */ a(
374
371
  "small",
375
372
  {
376
373
  "data-testid": n ? `${n}-help-text` : "help-text",
377
374
  className: "text-gray-500 dark:text-gray-400",
378
- children: r
375
+ children: t
379
376
  }
380
377
  ),
381
- t && /* @__PURE__ */ a("span", { "data-testid": n ? `${n}-error` : "error", className: "text-danger", children: t })
382
- ] }), or = k(({ label: e, inputClassName: r, required: t, hiddenRequired: n, error: o, helpText: s, "data-testid": l, ...i }, c) => {
383
- const u = S();
384
- return /* @__PURE__ */ g(V, { error: o, helpText: s, "data-testid": l, children: [
385
- /* @__PURE__ */ a(Z, { htmlFor: u, required: t, children: e }),
378
+ r && /* @__PURE__ */ a("span", { "data-testid": n ? `${n}-error` : "error", className: "text-danger", children: r })
379
+ ] }), rr = ({ label: e, inputClassName: t, required: r, hiddenRequired: n, error: o, helpText: s, "data-testid": l, ...i }) => {
380
+ const d = E();
381
+ return /* @__PURE__ */ g(Z, { error: o, helpText: s, "data-testid": l, children: [
382
+ /* @__PURE__ */ a(J, { htmlFor: d, required: r, children: e }),
386
383
  /* @__PURE__ */ a(
387
- J,
384
+ X,
388
385
  {
389
- ref: c,
390
- id: u,
391
- className: r,
392
- required: t || n,
386
+ id: d,
387
+ className: t,
388
+ required: r || n,
393
389
  feedback: o ? "error" : void 0,
394
390
  ...i
395
391
  }
396
392
  )
397
393
  ] });
398
- }), tt = k(({ containerClassName: e, className: r, size: t, ...n }, o) => {
399
- const { flag: s, toggle: l, setToFalse: i } = ue(), c = C(null), u = w(({ relatedTarget: b }) => {
400
- c.current?.contains(b) || i();
401
- }, [c, i]);
394
+ }, tt = ({ containerClassName: e, className: t, size: r, ...n }) => {
395
+ const { flag: o, toggle: s, setToFalse: l } = ue(), i = v(null), d = w(({ relatedTarget: p }) => {
396
+ i.current?.contains(p) || l();
397
+ }, [i, l]);
402
398
  return /* @__PURE__ */ g(
403
399
  "div",
404
400
  {
405
- className: d("group relative", e),
406
- ref: c,
407
- onBlurCapture: u,
401
+ className: c("group relative", e),
402
+ ref: i,
403
+ onBlurCapture: d,
408
404
  children: [
409
405
  /* @__PURE__ */ a(
410
- J,
406
+ X,
411
407
  {
412
- ref: o,
413
- type: s ? "text" : "password",
414
- className: d(
408
+ type: o ? "text" : "password",
409
+ className: c(
415
410
  {
416
- "pr-10": t !== "sm",
417
- "pr-8": t === "sm"
411
+ "pr-10": r !== "sm",
412
+ "pr-8": r === "sm"
418
413
  },
419
- r
414
+ t
420
415
  ),
421
- size: t,
416
+ size: r,
422
417
  "data-testid": "input",
423
418
  ...n
424
419
  }
@@ -427,61 +422,59 @@ const H = K(void 0), M = K({ responsive: !0, size: "md" }), Xe = ({ children: e,
427
422
  "button",
428
423
  {
429
424
  type: "button",
430
- onClick: l,
431
- title: s ? "Hide password" : "Show password",
432
- "aria-label": s ? "Hide password" : "Show password",
433
- className: d(
425
+ onClick: s,
426
+ title: o ? "Hide password" : "Show password",
427
+ "aria-label": o ? "Hide password" : "Show password",
428
+ className: c(
434
429
  "absolute top-[50%] translate-y-[-50%] px-1 cursor-pointer",
435
430
  "text-placeholder hover:text-lm-text hover:dark:text-dm-text transition-colors",
436
431
  {
437
- "right-1.5": t !== "sm",
438
- "scale-85 right-1": t === "sm"
432
+ "right-1.5": r !== "sm",
433
+ "scale-85 right-1": r === "sm"
439
434
  }
440
435
  ),
441
436
  tabIndex: -1,
442
- children: /* @__PURE__ */ a(N, { icon: s ? Ce : Te })
437
+ children: /* @__PURE__ */ a(N, { icon: o ? Ce : Te })
443
438
  }
444
439
  )
445
440
  ]
446
441
  }
447
442
  );
448
- }), ar = k(({ label: e, inputClassName: r, required: t, hiddenRequired: n, error: o, helpText: s, "data-testid": l, ...i }, c) => {
449
- const u = S();
450
- return /* @__PURE__ */ g(V, { error: o, helpText: s, "data-testid": l, children: [
451
- /* @__PURE__ */ a(Z, { htmlFor: u, required: t, children: e }),
443
+ }, nr = ({ label: e, inputClassName: t, required: r, hiddenRequired: n, error: o, helpText: s, "data-testid": l, ...i }) => {
444
+ const d = E();
445
+ return /* @__PURE__ */ g(Z, { error: o, helpText: s, "data-testid": l, children: [
446
+ /* @__PURE__ */ a(J, { htmlFor: d, required: r, children: e }),
452
447
  /* @__PURE__ */ a(
453
448
  tt,
454
449
  {
455
- ref: c,
456
- id: u,
457
- className: r,
458
- required: t || n,
450
+ id: d,
451
+ className: t,
452
+ required: r || n,
459
453
  feedback: o ? "error" : void 0,
460
454
  ...i
461
455
  }
462
456
  )
463
457
  ] });
464
- }), rt = k(({
458
+ }, rt = ({
465
459
  className: e,
466
- size: r = "md",
467
- feedback: t,
460
+ size: t = "md",
461
+ feedback: r,
468
462
  disabled: n,
469
463
  ...o
470
- }, s) => /* @__PURE__ */ a(
464
+ }) => /* @__PURE__ */ a(
471
465
  "select",
472
466
  {
473
- ref: s,
474
- className: d(
467
+ className: c(
475
468
  "w-full rounded-md border appearance-none pr-9",
476
469
  "bg-(image:--chevron-down) bg-no-repeat bg-position-[right_0.75rem_center] bg-size-[16px_12px]",
477
470
  {
478
- "focus-ring": !t,
479
- "focus-ring-danger": t === "error",
480
- "border-lm-input-border dark:border-dm-input-border": !t,
481
- "border-danger": t === "error",
482
- "pl-2 py-1 text-sm": r === "sm",
483
- "pl-3 py-1.5": r === "md",
484
- "pl-4 py-2 text-xl": r === "lg",
471
+ "focus-ring": !r,
472
+ "focus-ring-danger": r === "error",
473
+ "border-lm-input-border dark:border-dm-input-border": !r,
474
+ "border-danger": r === "error",
475
+ "pl-2 py-1 text-sm": t === "sm",
476
+ "pl-3 py-1.5": t === "md",
477
+ "pl-4 py-2 text-xl": t === "lg",
485
478
  "bg-lm-disabled-input dark:bg-dm-disabled-input": n,
486
479
  // Apply different background color when rendered inside a card
487
480
  "bg-lm-primary dark:bg-dm-primary group-[&]/card:bg-lm-input group-[&]/card:dark:bg-dm-input": !n
@@ -491,43 +484,42 @@ const H = K(void 0), M = K({ responsive: !0, size: "md" }), Xe = ({ children: e,
491
484
  disabled: n,
492
485
  ...o
493
486
  }
494
- )), sr = k(({ selectClassName: e, label: r, error: t, helpText: n, required: o, hiddenRequired: s, "data-testid": l, ...i }, c) => {
495
- const u = S();
496
- return /* @__PURE__ */ g(V, { error: t, helpText: n, "data-testid": l, children: [
497
- /* @__PURE__ */ a(Z, { htmlFor: u, required: o, children: r }),
487
+ ), or = ({ selectClassName: e, label: t, error: r, helpText: n, required: o, hiddenRequired: s, "data-testid": l, ...i }) => {
488
+ const d = E();
489
+ return /* @__PURE__ */ g(Z, { error: r, helpText: n, "data-testid": l, children: [
490
+ /* @__PURE__ */ a(J, { htmlFor: d, required: o, children: t }),
498
491
  /* @__PURE__ */ a(
499
492
  rt,
500
493
  {
501
- ref: c,
502
- id: u,
494
+ id: d,
503
495
  className: e,
504
496
  required: o || s,
505
- feedback: t ? "error" : void 0,
497
+ feedback: r ? "error" : void 0,
506
498
  ...i
507
499
  }
508
500
  )
509
501
  ] });
510
- }), nt = k(({
502
+ }, nt = ({
511
503
  onChange: e,
512
- containerClassName: r,
513
- inputClassName: t,
504
+ containerClassName: t,
505
+ inputClassName: r,
514
506
  // Inputs have a default 'md' size. Search inputs are usually 'lg' as they are rendered at the top of sections
515
507
  size: n = "lg",
516
508
  loading: o = !1,
517
509
  variant: s = "default",
518
510
  immediate: l = !1,
519
511
  ...i
520
- }, c) => {
521
- const { setTimeout: u, clearCurrentTimeout: b } = me(500), x = w((f) => {
522
- !f || l ? (b(), e(f)) : u(() => e(f));
523
- }, [b, l, e, u]);
524
- return /* @__PURE__ */ g("div", { className: d("group relative focus-within:z-10", r), children: [
512
+ }) => {
513
+ const { setTimeout: d, clearCurrentTimeout: p } = me(500), f = w((b) => {
514
+ !b || l ? (p(), e(b)) : d(() => e(b));
515
+ }, [p, l, e, d]);
516
+ return /* @__PURE__ */ g("div", { className: c("group relative focus-within:z-10", t), children: [
525
517
  s === "default" && /* @__PURE__ */ a(
526
518
  N,
527
519
  {
528
- icon: o ? ae : Ae,
520
+ icon: o ? oe : Ae,
529
521
  spin: o,
530
- className: d(
522
+ className: c(
531
523
  "absolute top-[50%] translate-y-[-50%] transition-colors",
532
524
  "text-placeholder group-focus-within:text-lm-text dark:group-focus-within:text-dm-text",
533
525
  {
@@ -538,90 +530,90 @@ const H = K(void 0), M = K({ responsive: !0, size: "md" }), Xe = ({ children: e,
538
530
  }
539
531
  ),
540
532
  /* @__PURE__ */ a(
541
- J,
533
+ X,
542
534
  {
543
- ref: c,
544
535
  variant: s,
545
536
  type: "search",
546
- className: d(
537
+ className: c(
547
538
  s === "default" && {
548
539
  "pl-9": n !== "sm",
549
540
  "pl-7": n === "sm"
550
541
  },
551
- t
542
+ r
552
543
  ),
553
544
  placeholder: "Search...",
554
- onChange: (f) => x(f.target.value),
545
+ onChange: (b) => f(b.target.value),
555
546
  size: n,
556
547
  ...i
557
548
  }
558
549
  )
559
550
  ] });
560
- });
551
+ };
561
552
  function ot({
562
553
  searchResults: e,
563
- onSearch: r,
564
- onSelectSearchResult: t,
554
+ onSearch: t,
555
+ onSelectSearchResult: r,
565
556
  renderSearchResult: n,
566
557
  size: o = "md",
567
558
  // SearchInput defaults its size to 'lg'. Change it to 'md'
568
559
  listboxSpan: s = "full",
569
560
  onFocus: l,
570
561
  containerClassName: i,
571
- listboxClassName: c,
572
- ...u
573
- }, b) {
574
- const x = S(), [f, h] = L(), p = C(null);
575
- we(b, () => p.current);
576
- const m = P(
577
- () => e ? f ?? [...e.keys()][0] : void 0,
578
- [f, e]
579
- ), v = w((y) => {
580
- t(y), r(""), p.current.value = "";
581
- }, [r, t, p]);
562
+ listboxClassName: d,
563
+ ref: p,
564
+ ...f
565
+ }) {
566
+ const b = E(), [x, h] = R(), u = v(null);
567
+ we(p, () => u.current);
568
+ const m = L(
569
+ () => e ? x ?? [...e.keys()][0] : void 0,
570
+ [x, e]
571
+ ), k = w((y) => {
572
+ r(y), t(""), u.current.value = "";
573
+ }, [t, r, u]);
582
574
  return /* @__PURE__ */ g(
583
575
  "div",
584
576
  {
585
- className: d("relative", i),
577
+ className: c("relative", i),
586
578
  onBlur: (y) => {
587
- y.currentTarget.contains(y.relatedTarget) || r("");
579
+ y.currentTarget.contains(y.relatedTarget) || t("");
588
580
  },
589
581
  children: [
590
582
  /* @__PURE__ */ a(
591
583
  nt,
592
584
  {
593
- onChange: r,
585
+ onChange: t,
594
586
  size: o,
595
- ref: p,
587
+ ref: u,
596
588
  role: "combobox",
597
589
  "aria-autocomplete": "list",
598
590
  "aria-expanded": !!e,
599
- "aria-controls": x,
600
- "aria-activedescendant": m ? `${x}_${m}` : void 0,
591
+ "aria-controls": b,
592
+ "aria-activedescendant": m ? `${b}_${m}` : void 0,
601
593
  autoComplete: "off",
602
594
  autoCorrect: "off",
603
595
  onFocus: (y) => {
604
- l?.(y), r(y.target.value);
596
+ l?.(y), t(y.target.value);
605
597
  },
606
- ...u
598
+ ...f
607
599
  }
608
600
  ),
609
601
  e && /* @__PURE__ */ a(
610
602
  Ye,
611
603
  {
612
- id: x,
604
+ id: b,
613
605
  items: e,
614
- anchor: p,
615
- onSelectItem: v,
606
+ anchor: u,
607
+ onSelectItem: k,
616
608
  onActiveItemChange: h,
617
609
  renderItem: n,
618
- className: d(
610
+ className: c(
619
611
  "absolute top-full mt-1 z-10",
620
612
  {
621
613
  "min-w-60": s === "auto",
622
614
  "w-full": s === "full"
623
615
  },
624
- c
616
+ d
625
617
  ),
626
618
  "aria-label": "Matching items",
627
619
  noItemsMessage: "No results found matching search"
@@ -631,58 +623,58 @@ function ot({
631
623
  }
632
624
  );
633
625
  }
634
- const at = k(ot), st = ({ name: e, color: r }) => /* @__PURE__ */ g("div", { className: "inline-flex items-center gap-2", children: [
635
- /* @__PURE__ */ a("div", { "aria-hidden": !0, className: "w-4 h-4 rounded-full", style: { backgroundColor: r } }),
626
+ const at = ({ name: e, color: t }) => /* @__PURE__ */ g("div", { className: "inline-flex items-center gap-2", children: [
627
+ /* @__PURE__ */ a("div", { "aria-hidden": !0, className: "w-4 h-4 rounded-full", style: { backgroundColor: t } }),
636
628
  e
637
- ] }), lt = ({ tag: e, color: r, size: t, onRemove: n }) => (
629
+ ] }), st = ({ tag: e, color: t, size: r, onRemove: n }) => (
638
630
  // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
639
631
  /* @__PURE__ */ g(
640
632
  "li",
641
633
  {
642
- className: d(
634
+ className: c(
643
635
  "inline-flex items-center gap-1 font-bold [&]:rounded-md",
644
636
  {
645
- "px-1 text-sm": t === "sm",
646
- "py-0.25 px-1.5": t === "md",
647
- "py-0.5 px-1.5": t === "lg"
637
+ "px-1 text-sm": r === "sm",
638
+ "py-0.25 px-1.5": r === "md",
639
+ "py-0.5 px-1.5": r === "lg"
648
640
  }
649
641
  ),
650
642
  style: {
651
- backgroundColor: r,
652
- color: ct(r) ? "#000" : "#fff"
643
+ backgroundColor: t,
644
+ color: it(t) ? "#000" : "#fff"
653
645
  },
654
646
  onClick: (o) => o.stopPropagation(),
655
647
  children: [
656
648
  e,
657
- /* @__PURE__ */ a(Y, { label: `Remove ${e}`, solid: !0, size: "sm", onClick: () => n(e) })
649
+ /* @__PURE__ */ a(Q, { label: `Remove ${e}`, solid: !0, size: "sm", onClick: () => n(e) })
658
650
  ]
659
651
  }
660
652
  )
661
- ), re = "#99a1af", lr = ({
653
+ ), te = "#99a1af", ar = ({
662
654
  tags: e,
663
- selectedTags: r = [],
664
- onTagsChange: t,
655
+ selectedTags: t = [],
656
+ onTagsChange: r,
665
657
  getColorForTag: n,
666
658
  searchMode: o = "startsWith",
667
659
  immutable: s = !1,
668
660
  size: l = "md",
669
661
  disabled: i,
670
- containerClassName: c,
671
- ...u
662
+ containerClassName: d,
663
+ ...p
672
664
  }) => {
673
- const { searchResults: b, onSearch: x } = yt({ tags: e, selectedTags: r, searchMode: o, allowAdding: !s }), f = w((m) => {
665
+ const { searchResults: f, onSearch: b } = ft({ tags: e, selectedTags: t, searchMode: o, allowAdding: !s }), x = w((m) => {
674
666
  const y = (m.match(/Add\s+"([^"]+)"\s+tag/)?.[1] ?? m).split(",").map(ce);
675
- t?.([.../* @__PURE__ */ new Set([...r, ...y])]);
676
- }, [t, r]), h = w(
677
- (m) => t?.(r.filter((v) => v !== m)),
678
- [t, r]
679
- ), p = C(null);
667
+ r?.([.../* @__PURE__ */ new Set([...t, ...y])]);
668
+ }, [r, t]), h = w(
669
+ (m) => r?.(t.filter((k) => k !== m)),
670
+ [r, t]
671
+ ), u = v(null);
680
672
  return (
681
673
  // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
682
674
  /* @__PURE__ */ g(
683
675
  "div",
684
676
  {
685
- className: d(
677
+ className: c(
686
678
  "rounded-md flex flex-wrap gap-1",
687
679
  "border border-lm-input-border dark:border-dm-input-border",
688
680
  "cursor-text focus-within:focus-within-ring",
@@ -695,24 +687,24 @@ const at = k(ot), st = ({ name: e, color: r }) => /* @__PURE__ */ g("div", { cla
695
687
  // Use different background color when rendered inside a card
696
688
  "group-[&]/card:bg-lm-input group-[&]/card:dark:bg-dm-input": !i
697
689
  },
698
- c
690
+ d
699
691
  ),
700
692
  onClick: (m) => {
701
- m.target !== p.current && p.current?.focus();
693
+ m.target !== u.current && u.current?.focus();
702
694
  },
703
695
  children: [
704
- /* @__PURE__ */ a("ul", { className: "m-0 p-0 flex flex-wrap gap-1", children: r.map((m, v) => {
705
- const y = n?.(m) ?? re;
706
- return /* @__PURE__ */ a(lt, { tag: m, color: y, onRemove: h, size: l }, `${m}${v}`);
696
+ /* @__PURE__ */ a("ul", { className: "m-0 p-0 flex flex-wrap gap-1", children: t.map((m, k) => {
697
+ const y = n?.(m) ?? te;
698
+ return /* @__PURE__ */ a(st, { tag: m, color: y, onRemove: h, size: l }, `${m}${k}`);
707
699
  }) }),
708
700
  /* @__PURE__ */ a(
709
- at,
701
+ ot,
710
702
  {
711
703
  variant: "unstyled",
712
704
  listboxSpan: "auto",
713
705
  containerClassName: "flex items-center",
714
706
  listboxClassName: "whitespace-nowrap",
715
- inputClassName: d(
707
+ inputClassName: c(
716
708
  "no-clear-button",
717
709
  {
718
710
  "px-1 text-sm": l === "sm",
@@ -720,75 +712,74 @@ const at = k(ot), st = ({ name: e, color: r }) => /* @__PURE__ */ g("div", { cla
720
712
  "px-3 text-xl": l === "lg"
721
713
  }
722
714
  ),
723
- searchResults: b,
724
- onSearch: x,
725
- onSelectSearchResult: f,
726
- renderSearchResult: (m) => m.match(/Add\s+"([^"]+)"\s+tag/) ? m : /* @__PURE__ */ a(st, { name: m, color: n?.(m) ?? re }),
715
+ searchResults: f,
716
+ onSearch: b,
717
+ onSelectSearchResult: x,
718
+ renderSearchResult: (m) => m.match(/Add\s+"([^"]+)"\s+tag/) ? m : /* @__PURE__ */ a(at, { name: m, color: n?.(m) ?? te }),
727
719
  onKeyDown: (m) => {
728
- m.key === "Backspace" && !b && h(r[r.length - 1]);
720
+ m.key === "Backspace" && !f && h(t[t.length - 1]);
729
721
  },
730
722
  size: l,
731
723
  disabled: i,
732
- ref: p,
724
+ ref: u,
733
725
  immediate: !0,
734
- ...u
726
+ ...p
735
727
  }
736
728
  )
737
729
  ]
738
730
  }
739
731
  )
740
732
  );
741
- }, ir = k(({ className: e, ...r }, t) => /* @__PURE__ */ a(
742
- de,
733
+ }, sr = ({ className: e, ...t }) => /* @__PURE__ */ a(
734
+ ie,
743
735
  {
744
- ref: t,
745
- className: d(
736
+ className: c(
746
737
  "rounded-full min-w-8 w-8 h-4",
747
738
  "bg-(image:--circle-grey-dark) dark:bg-(image:--circle-grey-light) checked:bg-(image:--circle-white)",
748
739
  "focus-visible:not-checked:bg-(image:--circle-blue-light)",
749
740
  "checked:bg-right transition-[background-position]",
750
741
  e
751
742
  ),
752
- ...r
743
+ ...t
753
744
  }
754
- ));
755
- function it(e, { elementsSelector: r, focusFirstItem: t = !1, vertical: n = !0, horizontal: o = !0 }) {
756
- const s = P(() => {
757
- const c = [];
758
- return n && c.push("ArrowDown"), o && c.push("ArrowRight"), c;
759
- }, [o, n]), l = P(() => {
760
- const c = [];
761
- return n && c.push("ArrowUp"), o && c.push("ArrowLeft"), c;
762
- }, [o, n]), i = P(() => [...s, ...l], [s, l]);
763
- R(() => {
764
- const c = e.current;
765
- if (!c)
745
+ );
746
+ function de(e, { elementsSelector: t, focusFirstItem: r = !1, vertical: n = !0, horizontal: o = !0 }) {
747
+ const s = L(() => {
748
+ const d = [];
749
+ return n && d.push("ArrowDown"), o && d.push("ArrowRight"), d;
750
+ }, [o, n]), l = L(() => {
751
+ const d = [];
752
+ return n && d.push("ArrowUp"), o && d.push("ArrowLeft"), d;
753
+ }, [o, n]), i = L(() => [...s, ...l], [s, l]);
754
+ O(() => {
755
+ const d = e.current;
756
+ if (!d)
766
757
  return () => {
767
758
  };
768
- const u = new AbortController(), b = () => [...c.querySelectorAll(r)], x = b(), f = Math.max(x.findIndex((h) => h.dataset.selected === "true"), 0);
769
- return x.forEach((h, p) => {
770
- h.tabIndex = p === f ? 0 : -1, t && p === f && h.focus();
771
- }), c.addEventListener("keydown", (h) => {
759
+ const p = new AbortController(), f = () => [...d.querySelectorAll(t)], b = f(), x = Math.max(b.findIndex((h) => h.dataset.selected === "true"), 0);
760
+ return b.forEach((h, u) => {
761
+ h.tabIndex = u === x ? 0 : -1, r && u === x && h.focus();
762
+ }), d.addEventListener("keydown", (h) => {
772
763
  if (!i.includes(h.key))
773
764
  return;
774
765
  h.preventDefault();
775
- const p = b(), m = p.findIndex((y) => y.tabIndex === 0), v = s.includes(h.key) ? p[m + 1] ?? p[0] : p[m - 1] ?? p[p.length - 1];
776
- p.forEach((y) => {
766
+ const u = f(), m = u.findIndex((y) => y.tabIndex === 0), k = s.includes(h.key) ? u[m + 1] ?? u[0] : u[m - 1] ?? u[u.length - 1];
767
+ u.forEach((y) => {
777
768
  y.tabIndex = -1;
778
- }), v.tabIndex = 0, v.focus();
779
- }, { signal: u.signal }), () => u.abort();
780
- }, [i, e, r, t, s]);
769
+ }), k.tabIndex = 0, k.focus();
770
+ }, { signal: p.signal }), () => p.abort();
771
+ }, [i, e, t, r, s]);
781
772
  }
782
- const dr = () => {
773
+ const lr = () => {
783
774
  const e = ke();
784
775
  return w(() => e(-1), [e]);
785
- }, dt = 128;
786
- function ct(e) {
787
- const [r, t, n] = (e.match(/../g) ?? []).map((s) => parseInt(s, 16) || 0);
788
- return Math.round(Math.sqrt(0.299 * r ** 2 + 0.587 * t ** 2 + 0.114 * n ** 2)) >= dt;
776
+ }, lt = 128;
777
+ function it(e) {
778
+ const [t, r, n] = (e.match(/../g) ?? []).map((s) => parseInt(s, 16) || 0);
779
+ return Math.round(Math.sqrt(0.299 * t ** 2 + 0.587 * r ** 2 + 0.114 * n ** 2)) >= lt;
789
780
  }
790
- const cr = ({ text: e, className: r, size: t = "lg", initialCopied: n = !1, navigator_: o = globalThis.navigator, ...s }) => {
791
- const [l, i] = kt({ initialValue: n }), c = w(
781
+ const ir = ({ text: e, className: t, size: r = "lg", initialCopied: n = !1, navigator_: o = globalThis.navigator, ...s }) => {
782
+ const [l, i] = yt({ initialValue: n }), d = w(
792
783
  () => o.clipboard.writeText(e).then(i),
793
784
  [o.clipboard, e, i]
794
785
  );
@@ -796,244 +787,246 @@ const cr = ({ text: e, className: r, size: t = "lg", initialCopied: n = !1, navi
796
787
  "button",
797
788
  {
798
789
  type: "button",
799
- className: d(
790
+ className: c(
800
791
  "focus-ring rounded-sm cursor-pointer",
801
792
  {
802
- "text-md": t === "sm",
803
- "text-lg": t === "md",
804
- "text-xl": t === "lg"
793
+ "text-md": r === "sm",
794
+ "text-lg": r === "md",
795
+ "text-xl": r === "lg"
805
796
  },
806
- r
797
+ t
807
798
  ),
808
799
  "aria-label": `Copy ${e} to clipboard`,
809
800
  title: "Copy to clipboard",
810
- onClick: c,
801
+ onClick: d,
811
802
  ...s,
812
803
  children: /* @__PURE__ */ a(N, { icon: l ? Ie : je })
813
804
  }
814
805
  );
815
- }, mt = (e) => {
816
- const r = new URLSearchParams(e), t = {};
817
- return r.forEach((n, o) => {
806
+ }, dt = (e) => {
807
+ const t = new URLSearchParams(e), r = {};
808
+ return t.forEach((n, o) => {
818
809
  if (o.endsWith("[]")) {
819
810
  const s = o.slice(0, -2);
820
- t[s] ??= [], t[s].push(n);
811
+ r[s] ??= [], r[s].push(n);
821
812
  } else
822
- t[o] = n;
823
- }), t;
824
- }, mr = (e) => {
825
- const r = new URLSearchParams();
826
- for (const [t, n] of Object.entries(e))
827
- n !== void 0 && (Array.isArray(n) ? n.forEach((o) => r.append(`${t}[]`, `${o}`)) : r.append(t, `${n}`));
828
- return r.toString();
829
- }, ur = () => {
830
- const { search: e } = oe();
831
- return P(() => mt(e), [e]);
832
- }, ut = /\s+/g, ce = (e) => e.trim().toLowerCase().replace(ut, "-"), pt = new Intl.NumberFormat("en-US"), gt = (e) => pt.format(Number(e)), ne = 10, pr = (e) => Math.ceil(e / ne) * ne, D = 2, G = "...", bt = (e, r) => Array.from({ length: r - e }, (t, n) => e + n), ht = (e, r) => {
833
- const t = bt(
834
- Math.max(D, e - D),
835
- Math.min(r - 1, e + D) + 1
813
+ r[o] = n;
814
+ }), r;
815
+ }, dr = (e) => {
816
+ const t = new URLSearchParams();
817
+ for (const [r, n] of Object.entries(e))
818
+ n !== void 0 && (Array.isArray(n) ? n.forEach((o) => t.append(`${r}[]`, `${o}`)) : t.append(r, `${n}`));
819
+ return t.toString();
820
+ }, cr = () => {
821
+ const { search: e } = ne();
822
+ return L(() => dt(e), [e]);
823
+ }, ct = /\s+/g, ce = (e) => e.trim().toLowerCase().replace(ct, "-"), mt = new Intl.NumberFormat("en-US"), ut = (e) => mt.format(Number(e)), re = 10, mr = (e) => Math.ceil(e / re) * re, S = 2, U = "...", pt = (e, t) => Array.from({ length: t - e }, (r, n) => e + n), gt = (e, t) => {
824
+ const r = pt(
825
+ Math.max(S, e - S),
826
+ Math.min(t - 1, e + S) + 1
836
827
  );
837
- return e - D > D && t.unshift(G), e + D < r - 1 && t.push(G), t.unshift(1), t.push(r), t;
838
- }, F = (e) => e === G, ft = (e) => F(e) ? e : gt(e), xt = (e, r) => F(e) ? `${e}_${r}` : `${e}`;
839
- function yt({ tags: e, selectedTags: r, searchMode: t, searchLimit: n = 5, allowAdding: o = !1 }) {
840
- const [s, l] = L(), i = w((c) => {
841
- const u = c.toLowerCase().trim();
842
- if (!u) {
828
+ return e - S > S && r.unshift(U), e + S < t - 1 && r.push(U), r.unshift(1), r.push(t), r;
829
+ }, _ = (e) => e === U, bt = (e) => _(e) ? e : ut(e), ht = (e, t) => _(e) ? `${e}_${t}` : `${e}`;
830
+ function ft({ tags: e, selectedTags: t, searchMode: r, searchLimit: n = 5, allowAdding: o = !1 }) {
831
+ const [s, l] = R(), i = w((d) => {
832
+ const p = d.toLowerCase().trim();
833
+ if (!p) {
843
834
  l(void 0);
844
835
  return;
845
836
  }
846
- const b = e.filter((x) => r.includes(x) ? !1 : x.toLowerCase()[t](u)).slice(0, n);
847
- o && b.push(`Add "${u.split(",").map(ce).join(",")}" tag`), l(new Map(b.map((x) => [x, x])));
848
- }, [o, n, t, r, e]);
837
+ const f = e.filter((b) => t.includes(b) ? !1 : b.toLowerCase()[r](p)).slice(0, n);
838
+ o && f.push(`Add "${p.split(",").map(ce).join(",")}" tag`), l(new Map(f.map((b) => [b, b])));
839
+ }, [o, n, r, t, e]);
849
840
  return { searchResults: s, onSearch: i };
850
841
  }
851
- function me(e, r = globalThis.setTimeout, t = globalThis.clearTimeout) {
852
- const n = C(null), o = w(() => {
853
- n.current && t(n.current);
854
- }, [t]), s = w((l, i) => {
855
- o(), n.current = r(() => {
842
+ function me(e, t = globalThis.setTimeout, r = globalThis.clearTimeout) {
843
+ const n = v(null), o = w(() => {
844
+ n.current && r(n.current);
845
+ }, [r]), s = w((l, i) => {
846
+ o(), n.current = t(() => {
856
847
  l(), n.current = null;
857
848
  }, i ?? e);
858
- }, [o, e, r]);
859
- return R(() => o, [o]), P(
849
+ }, [o, e, t]);
850
+ return O(() => o, [o]), L(
860
851
  () => ({ setTimeout: s, clearCurrentTimeout: o }),
861
852
  [o, s]
862
853
  );
863
854
  }
864
- const wt = 2e3, kt = ({ initialValue: e = !1, delay: r = wt } = {}, t = globalThis.setTimeout, n = globalThis.clearTimeout) => {
865
- const { setTimeout: o } = me(r, t, n), [s, l] = L(e), i = C(e), c = w(() => {
855
+ const xt = 2e3, yt = ({ initialValue: e = !1, delay: t = xt } = {}, r = globalThis.setTimeout, n = globalThis.clearTimeout) => {
856
+ const { setTimeout: o } = me(t, r, n), [s, l] = R(e), i = v(e), d = w(() => {
866
857
  l(!i.current), o(() => l(i.current));
867
858
  }, [o]);
868
- return [s, c];
859
+ return [s, d];
869
860
  };
870
861
  function ue(e = !1) {
871
- const [r, t] = L(e), n = w(() => t((l) => !l), []), o = w(() => t(!0), []), s = w(() => t(!1), []);
872
- return { flag: r, toggle: n, setToTrue: o, setToFalse: s };
862
+ const [t, r] = R(e), n = w(() => r((l) => !l), []), o = w(() => r(!0), []), s = w(() => r(!1), []);
863
+ return { flag: t, toggle: n, setToTrue: o, setToFalse: s };
873
864
  }
874
- const pe = K({}), vt = ({ className: e, selected: r, disabled: t, onClick: n, ...o }) => {
875
- const s = "to" in o && typeof o.to == "string", l = s ? W : "button", { onItemClick: i } = E(pe);
865
+ const pe = G({}), wt = ({ className: e, selected: t, disabled: r, onClick: n, ...o }) => {
866
+ const s = "to" in o && typeof o.to == "string", l = s ? K : "button", { onItemClick: i } = P(pe);
876
867
  return (
877
868
  // @ts-expect-error The Tag is inferred from provided props, so they should always match
878
869
  /* @__PURE__ */ a(
879
870
  l,
880
871
  {
881
872
  role: "menuitem",
882
- "data-selected": r,
883
- className: d(
873
+ "data-selected": t,
874
+ className: c(
884
875
  "flex items-center gap-2",
885
876
  "w-full px-3 py-1.5 focus-ring",
886
877
  // Overwrite link styles in case a Link is being used
887
878
  "no-underline text-inherit",
888
879
  {
889
- "cursor-pointer": !t,
890
- "pointer-events-none opacity-50": t,
891
- "bg-lm-secondary dark:bg-dm-secondary": r && !t,
892
- "highlight:bg-lm-secondary dark:highlight:bg-dm-secondary highlight:z-1 relative": !r && !t
880
+ "cursor-pointer": !r,
881
+ "pointer-events-none opacity-50": r,
882
+ "bg-lm-secondary dark:bg-dm-secondary": t && !r,
883
+ "highlight:bg-lm-secondary dark:highlight:bg-dm-secondary highlight:z-1 relative": !t && !r
893
884
  },
894
885
  e
895
886
  ),
896
887
  tabIndex: -1,
897
- disabled: s ? void 0 : t,
898
- "aria-disabled": s ? t : void 0,
888
+ disabled: s ? void 0 : r,
889
+ "aria-disabled": s ? r : void 0,
899
890
  type: s ? void 0 : "button",
900
- onClick: (c) => {
901
- n?.(c), i?.();
891
+ onClick: (d) => {
892
+ n?.(d), i?.();
902
893
  },
903
894
  ...o
904
895
  }
905
896
  )
906
897
  );
907
- }, Nt = () => (
898
+ }, kt = () => (
908
899
  // TODO Use an <hr /> tag once tailwind styles are not set with !important
909
900
  /* @__PURE__ */ a("div", { role: "separator", "aria-hidden": !0, className: "border-b border-lm-border dark:border-dm-border my-2" })
910
- ), Ct = ({ children: e }) => /* @__PURE__ */ a(
901
+ ), vt = ({ children: e }) => /* @__PURE__ */ a(
911
902
  "div",
912
903
  {
913
904
  role: "heading",
914
905
  "aria-level": 6,
915
906
  "aria-hidden": !0,
916
- className: d(
907
+ className: c(
917
908
  "flex items-center w-full px-3 py-1.5",
918
909
  "text-gray-500 text-sm font-semibold"
919
910
  ),
920
- onClick: (r) => r.stopPropagation(),
911
+ onClick: (t) => t.stopPropagation(),
921
912
  children: e
922
913
  }
923
- ), Tt = ({ className: e, ...r }) => /* @__PURE__ */ a("div", { className: d("px-3 py-1.5", e), ...r }), At = ({
914
+ ), Nt = ({ className: e, ...t }) => /* @__PURE__ */ a("div", { className: c("px-3 py-1.5", e), ...t }), Ct = ({
924
915
  children: e,
925
- className: r,
926
- focusableElementsSelector: t = '[role="menuitem"]:not([disabled]):not([aria-disabled])',
916
+ className: t,
917
+ focusableElementsSelector: r = '[role="menuitem"]:not([disabled]):not([aria-disabled])',
927
918
  focusFirstItem: n = !1,
928
919
  onItemClick: o,
929
920
  ...s
930
921
  }) => {
931
- const l = C(null);
932
- return it(l, { elementsSelector: t, focusFirstItem: n }), /* @__PURE__ */ a(I, { ref: l, role: "menu", className: d("py-2 whitespace-nowrap", r), ...s, children: /* @__PURE__ */ a(pe.Provider, { value: { onItemClick: o }, children: e }) });
933
- }, _ = Object.assign(At, { Item: vt, Separator: Nt, Title: Ct, Misc: Tt }), It = ({
922
+ const l = v(null);
923
+ return de(l, { elementsSelector: r, focusFirstItem: n }), /* @__PURE__ */ a(A, { ref: l, role: "menu", className: c("py-2 whitespace-nowrap", t), ...s, children: /* @__PURE__ */ a(pe.Provider, { value: { onItemClick: o }, children: e }) });
924
+ }, M = Object.assign(Ct, { Item: wt, Separator: kt, Title: vt, Misc: Nt }), Tt = ({
934
925
  children: e,
935
- menuAlignment: r = "left",
936
- buttonVariant: t = "button",
926
+ menuAlignment: t = "left",
927
+ buttonVariant: r = "button",
937
928
  buttonContent: n,
938
929
  buttonClassName: o,
939
930
  buttonSize: s = "md",
940
931
  buttonDisabled: l = !1,
941
932
  containerClassName: i,
942
- menuClassName: c,
943
- caretless: u,
944
- buttonLabel: b,
945
- menuOffset: x = 3
933
+ menuClassName: d,
934
+ caretless: p,
935
+ buttonLabel: f,
936
+ menuOffset: b = 3
946
937
  }) => {
947
- const [f, h] = L(!1), p = w(() => h(!1), []), m = C(null), { refs: v, floatingStyles: y, context: q } = se({
948
- open: f,
938
+ const [x, h] = R(!1), u = v(null), m = w(({ focusButton: T = !0 } = {}) => {
939
+ h(!1), T && u.current?.focus();
940
+ }, []), { refs: k, floatingStyles: y, context: W } = ae({
941
+ open: x,
949
942
  onOpenChange: h,
950
- placement: r === "right" ? "bottom-end" : "bottom-start",
951
- middleware: [De(), Me(x)],
943
+ placement: t === "right" ? "bottom-end" : "bottom-start",
944
+ middleware: [De(), Me(b)],
952
945
  // eslint-disable-next-line react-compiler/react-compiler
953
- elements: { reference: m.current }
954
- }), T = _e(q), { getReferenceProps: $, getFloatingProps: j } = le([
955
- T
956
- ]), U = S(), Q = C(null);
957
- return R(() => {
958
- const A = Q.current;
959
- if (!A || !f)
946
+ elements: { reference: u.current }
947
+ }), C = _e(W), { getReferenceProps: H, getFloatingProps: $ } = se([
948
+ C
949
+ ]), j = E(), q = v(null);
950
+ return O(() => {
951
+ const T = q.current;
952
+ if (!T || !x)
960
953
  return () => {
961
954
  };
962
- const z = new AbortController();
955
+ const V = new AbortController();
963
956
  return document.body.addEventListener("click", (ye) => {
964
- ye.composedPath().includes(A) || p();
965
- }, { signal: z.signal }), () => z.abort();
966
- }, [p, f]), // eslint-disable-next-line jsx-a11y/no-static-element-interactions
957
+ ye.composedPath().includes(T) || m();
958
+ }, { signal: V.signal }), () => V.abort();
959
+ }, [m, x]), // eslint-disable-next-line jsx-a11y/no-static-element-interactions
967
960
  /* @__PURE__ */ g(
968
961
  "div",
969
962
  {
970
- ref: Q,
971
- className: d("relative inline-block", i),
972
- onKeyDown: (A) => {
973
- A.key === "Escape" && p();
963
+ ref: q,
964
+ className: c("relative inline-block", i),
965
+ onKeyDown: (T) => {
966
+ T.key === "Escape" && m();
974
967
  },
975
- onBlur: (A) => {
976
- A.relatedTarget && !Q.current.contains(A.relatedTarget) && p();
968
+ onBlur: (T) => {
969
+ T.relatedTarget && !q.current.contains(T.relatedTarget) && m({ focusButton: !1 });
977
970
  },
978
971
  children: [
979
972
  /* @__PURE__ */ g(
980
973
  "button",
981
974
  {
982
- ref: m,
983
- ...$(),
975
+ ref: u,
976
+ ...H(),
984
977
  type: "button",
985
978
  "aria-haspopup": !0,
986
- "aria-expanded": f,
987
- "aria-controls": U,
988
- "aria-label": b,
979
+ "aria-expanded": x,
980
+ "aria-controls": j,
981
+ "aria-label": f,
989
982
  disabled: l,
990
- className: d(
983
+ className: c(
991
984
  "flex items-center rounded-md focus-ring",
992
985
  {
993
- "justify-between": !u,
986
+ "justify-between": !p,
994
987
  "cursor-pointer": !l,
995
988
  "pointer-events-none opacity-50": l,
996
989
  // Button variant
997
- "border border-lm-border dark:border-dm-border": t === "button",
998
- "bg-lm-primary dark:bg-dm-primary": t === "button",
990
+ "border border-lm-border dark:border-dm-border": r === "button",
991
+ "bg-lm-primary dark:bg-dm-primary": r === "button",
999
992
  // Use different bg color when inside a card
1000
- "group-[&]/card:bg-lm-input group-[&]/card:dark:bg-dm-input": t === "button",
993
+ "group-[&]/card:bg-lm-input group-[&]/card:dark:bg-dm-input": r === "button",
1001
994
  // Link variant
1002
- "text-lm-brand dark:text-dm-brand": t === "link",
1003
- "highlight:text-lm-brand-dark dark:highlight:text-dm-brand-dark highlight:underline": t === "link",
995
+ "text-lm-brand dark:text-dm-brand": r === "link",
996
+ "highlight:text-lm-brand-dark dark:highlight:text-dm-brand-dark highlight:underline": r === "link",
1004
997
  // Button sizes
1005
- "px-1.5 py-1 text-sm": t !== "text" && s === "sm",
1006
- "px-3 py-1.5": t !== "text" && s === "md",
1007
- "px-4 py-2 text-lg": t !== "text" && s === "lg",
998
+ "px-1.5 py-1 text-sm": r !== "text" && s === "sm",
999
+ "px-3 py-1.5": r !== "text" && s === "md",
1000
+ "px-4 py-2 text-lg": r !== "text" && s === "lg",
1008
1001
  "gap-x-1.5": s === "sm",
1009
1002
  "gap-x-2": s !== "sm"
1010
1003
  },
1011
1004
  o
1012
1005
  ),
1013
- onKeyDown: (A) => {
1014
- A.key === "ArrowDown" && (A.preventDefault(), h(!0));
1006
+ onKeyDown: (T) => {
1007
+ T.key === "ArrowDown" && (T.preventDefault(), h(!0));
1015
1008
  },
1016
1009
  children: [
1017
1010
  n,
1018
- !u && /* @__PURE__ */ a(N, { icon: Oe, size: "xs", widthAuto: !0 })
1011
+ !p && /* @__PURE__ */ a(N, { icon: Oe, size: "xs", widthAuto: !0 })
1019
1012
  ]
1020
1013
  }
1021
1014
  ),
1022
- f && /* @__PURE__ */ a(
1015
+ x && /* @__PURE__ */ a(
1023
1016
  "div",
1024
1017
  {
1025
- ref: v.setFloating,
1018
+ ref: k.setFloating,
1026
1019
  style: y,
1027
1020
  className: "min-w-full z-500",
1028
- ...j(),
1021
+ ...$(),
1029
1022
  children: /* @__PURE__ */ a(
1030
- _,
1023
+ M,
1031
1024
  {
1032
- className: c,
1033
- id: U,
1025
+ className: d,
1026
+ id: j,
1034
1027
  focusableElementsSelector: '[role="menuitem"]:not([disabled]):not([aria-disabled]),input:not([disabled]),select:not([disabled])',
1035
1028
  focusFirstItem: !0,
1036
- onItemClick: p,
1029
+ onItemClick: m,
1037
1030
  children: e
1038
1031
  }
1039
1032
  )
@@ -1042,53 +1035,52 @@ const pe = K({}), vt = ({ className: e, selected: r, disabled: t, onClick: n, ..
1042
1035
  ]
1043
1036
  }
1044
1037
  );
1045
- }, O = Object.assign(It, {
1046
- Item: _.Item,
1047
- Separator: _.Separator,
1048
- Title: _.Title,
1049
- Misc: _.Misc
1050
- }), Ot = k(({ className: e, disabled: r, size: t = "md", type: n = "button", ...o }, s) => /* @__PURE__ */ a(
1038
+ }, I = Object.assign(Tt, {
1039
+ Item: M.Item,
1040
+ Separator: M.Separator,
1041
+ Title: M.Title,
1042
+ Misc: M.Misc
1043
+ }), At = ({ className: e, disabled: t, size: r = "md", type: n = "button", ...o }) => /* @__PURE__ */ a(
1051
1044
  "button",
1052
1045
  {
1053
- className: d(
1046
+ className: c(
1054
1047
  "inline-flex rounded-md focus-ring",
1055
1048
  "text-lm-brand dark:text-dm-brand",
1056
1049
  "highlight:text-lm-brand-dark dark:highlight:text-dm-brand-dark highlight:underline",
1057
1050
  {
1058
- "px-1.5 py-1 text-sm": t === "sm",
1059
- "px-3 py-1.5": t === "md",
1060
- "px-4 py-2 text-lg": t === "lg",
1061
- "cursor-pointer": !r,
1062
- "pointer-events-none opacity-65": r
1051
+ "px-1.5 py-1 text-sm": r === "sm",
1052
+ "px-3 py-1.5": r === "md",
1053
+ "px-4 py-2 text-lg": r === "lg",
1054
+ "cursor-pointer": !t,
1055
+ "pointer-events-none opacity-65": t
1063
1056
  },
1064
1057
  e
1065
1058
  ),
1066
- disabled: r,
1059
+ disabled: t,
1067
1060
  type: n,
1068
- ...o,
1069
- ref: s
1061
+ ...o
1070
1062
  }
1071
- )), Rt = ({ className: e, active: r, ...t }) => /* @__PURE__ */ a("li", { role: "menuitem", className: "w-full flex", "data-active": r, children: /* @__PURE__ */ a(
1072
- W,
1063
+ ), It = ({ className: e, active: t, ...r }) => /* @__PURE__ */ a("li", { role: "menuitem", className: "w-full flex", "data-active": t, children: /* @__PURE__ */ a(
1064
+ K,
1073
1065
  {
1074
- className: d(
1066
+ className: c(
1075
1067
  "px-2 py-3",
1076
1068
  "max-md:w-full max-md:px-3 max-md:py-2",
1077
1069
  "text-white no-underline highlight:opacity-100 transition-opacity",
1078
1070
  {
1079
- "opacity-60": !r,
1080
- "opacity-100": r
1071
+ "opacity-60": !t,
1072
+ "opacity-100": t
1081
1073
  },
1082
1074
  e
1083
1075
  ),
1084
- ...t
1076
+ ...r
1085
1077
  }
1086
- ) }), Lt = ({ containerClassName: e, buttonClassName: r, menuClassName: t, active: n, ...o }) => /* @__PURE__ */ a("li", { role: "menuitem", "aria-haspopup": !0, className: "w-full flex", "data-active": n, children: /* @__PURE__ */ a(
1087
- O,
1078
+ ) }), Ot = ({ containerClassName: e, buttonClassName: t, menuClassName: r, active: n, ...o }) => /* @__PURE__ */ a("li", { role: "menuitem", "aria-haspopup": !0, className: "w-full flex", "data-active": n, children: /* @__PURE__ */ a(
1079
+ I,
1088
1080
  {
1089
- containerClassName: d("max-md:w-full", e),
1081
+ containerClassName: c("max-md:w-full", e),
1090
1082
  buttonVariant: "text",
1091
- buttonClassName: d(
1083
+ buttonClassName: c(
1092
1084
  "px-2 py-3",
1093
1085
  "max-md:w-full max-md:px-3 max-md:py-2",
1094
1086
  "text-white highlight:opacity-100 transition-opacity",
@@ -1096,19 +1088,19 @@ const pe = K({}), vt = ({ className: e, selected: r, disabled: t, onClick: n, ..
1096
1088
  "opacity-60": !n,
1097
1089
  "opacity-100": n
1098
1090
  },
1099
- r
1091
+ t
1100
1092
  ),
1101
1093
  menuAlignment: "right",
1102
1094
  menuOffset: -3,
1103
- menuClassName: d("mx-2", t),
1095
+ menuClassName: c("mx-2", r),
1104
1096
  ...o
1105
1097
  }
1106
- ) }), Pt = ({ className: e, brand: r, children: t }) => {
1107
- const { flag: n, toggle: o, setToFalse: s } = ue(), l = S(), i = S(), { pathname: c } = oe();
1108
- return R(() => s(), [c, s]), /* @__PURE__ */ g(
1098
+ ) }), Rt = ({ className: e, brand: t, children: r }) => {
1099
+ const { flag: n, toggle: o, setToFalse: s } = ue(), l = E(), i = E(), { pathname: d } = ne();
1100
+ return O(() => s(), [d, s]), /* @__PURE__ */ g(
1109
1101
  "nav",
1110
1102
  {
1111
- className: d(
1103
+ className: c(
1112
1104
  "w-full relative",
1113
1105
  "bg-lm-main dark:bg-dm-main",
1114
1106
  "flex max-md:flex-col items-center justify-between",
@@ -1119,19 +1111,19 @@ const pe = K({}), vt = ({ className: e, selected: r, disabled: t, onClick: n, ..
1119
1111
  /* @__PURE__ */ a(
1120
1112
  "h4",
1121
1113
  {
1122
- className: d(
1114
+ className: c(
1123
1115
  "text-white px-4 py-3",
1124
1116
  "max-md:w-full max-md:flex max-md:flex-col items-center"
1125
1117
  ),
1126
- children: r
1118
+ children: t
1127
1119
  }
1128
1120
  ),
1129
1121
  /* @__PURE__ */ a(
1130
- ie,
1122
+ le,
1131
1123
  {
1132
1124
  id: i,
1133
1125
  variant: "secondary",
1134
- className: d(
1126
+ className: c(
1135
1127
  "absolute right-0 top-[50%] translate-y-[-50%]",
1136
1128
  "md:hidden mx-2 [&]:px-2",
1137
1129
  "opacity-60 highlight:opacity-100 transition-opacity",
@@ -1150,27 +1142,27 @@ const pe = K({}), vt = ({ className: e, selected: r, disabled: t, onClick: n, ..
1150
1142
  id: l,
1151
1143
  "aria-labelledby": i,
1152
1144
  role: "menu",
1153
- className: d(
1145
+ className: c(
1154
1146
  "m-0 p-0",
1155
1147
  "max-md:w-full md:mr-2 max-md:absolute max-md:top-full z-2000",
1156
1148
  "flex max-md:flex-col items-center",
1157
1149
  "bg-lm-main dark:bg-dm-main",
1158
1150
  { "max-md:hidden": !n }
1159
1151
  ),
1160
- children: t
1152
+ children: r
1161
1153
  }
1162
1154
  )
1163
1155
  ]
1164
1156
  }
1165
1157
  );
1166
- }, gr = Object.assign(Pt, { MenuItem: Rt, Dropdown: Lt }), ge = K(null), Et = ({ className: e, to: r, ...t }) => {
1167
- const n = E(ge);
1158
+ }, ur = Object.assign(Rt, { MenuItem: It, Dropdown: Ot }), ge = G(null), Lt = ({ className: e, to: t, ...r }) => {
1159
+ const n = P(ge);
1168
1160
  return /* @__PURE__ */ a(
1169
1161
  ve,
1170
1162
  {
1171
1163
  role: "menuitem",
1172
- to: r,
1173
- className: ({ isActive: o }) => d(
1164
+ to: t,
1165
+ className: ({ isActive: o }) => c(
1174
1166
  "px-4 pt-2 pb-[calc(0.5rem-3px)] border-b-3",
1175
1167
  "highlight:text-lm-brand dark:highlight:text-dm-brand",
1176
1168
  "font-bold text-center no-underline transition-colors",
@@ -1184,13 +1176,13 @@ const pe = K({}), vt = ({ className: e, selected: r, disabled: t, onClick: n, ..
1184
1176
  },
1185
1177
  e
1186
1178
  ),
1187
- ...t
1179
+ ...r
1188
1180
  }
1189
1181
  );
1190
- }, St = ({ children: e, className: r, fill: t }) => /* @__PURE__ */ a(ge.Provider, { value: { fill: t }, children: /* @__PURE__ */ a(I, { role: "menubar", className: d("flex overflow-hidden", r), children: e }) }), br = Object.assign(St, { Pill: Et }), be = [
1182
+ }, Pt = ({ children: e, className: t, fill: r }) => /* @__PURE__ */ a(ge.Provider, { value: { fill: r }, children: /* @__PURE__ */ a(A, { role: "menubar", className: c("flex overflow-hidden", t), children: e }) }), pr = Object.assign(Pt, { Pill: Lt }), be = [
1191
1183
  "border border-r-0 last:border-r border-lm-border dark:border-dm-border",
1192
1184
  "rounded-none first:rounded-l last:rounded-r"
1193
- ], he = (e = !1) => d(
1185
+ ], he = (e = !1) => c(
1194
1186
  be,
1195
1187
  "px-3 py-2 cursor-pointer no-underline",
1196
1188
  "focus-ring focus-visible:z-1",
@@ -1200,92 +1192,92 @@ const pe = K({}), vt = ({ className: e, selected: r, disabled: t, onClick: n, ..
1200
1192
  "highlight:bg-lm-secondary dark:highlight:bg-dm-secondary"
1201
1193
  ],
1202
1194
  e && "bg-lm-main dark:bg-dm-main text-white"
1203
- ), X = ({ children: e }) => /* @__PURE__ */ a("span", { "aria-hidden": !0, className: d(be, "px-3 py-2 text-gray-400"), children: e }), fe = () => /* @__PURE__ */ a(X, { children: G });
1204
- function Dt({ children: e, active: r, isEllipsis: t, href: n, ...o }) {
1205
- const s = P(() => he(r), [r]);
1206
- return t ? /* @__PURE__ */ a(fe, {}) : /* @__PURE__ */ a(W, { className: s, to: n, ...o, "data-active": r, children: e });
1195
+ ), Y = ({ children: e }) => /* @__PURE__ */ a("span", { "aria-hidden": !0, className: c(be, "px-3 py-2 text-gray-400"), children: e }), fe = () => /* @__PURE__ */ a(Y, { children: U });
1196
+ function Et({ children: e, active: t, isEllipsis: r, href: n, ...o }) {
1197
+ const s = L(() => he(t), [t]);
1198
+ return r ? /* @__PURE__ */ a(fe, {}) : /* @__PURE__ */ a(K, { className: s, to: n, ...o, "data-active": t, children: e });
1207
1199
  }
1208
- function Mt({ children: e, active: r, isEllipsis: t, ...n }) {
1209
- const o = P(() => he(r), [r]);
1210
- return t ? /* @__PURE__ */ a(fe, {}) : /* @__PURE__ */ a("button", { type: "button", className: o, ...n, "data-active": r, children: e });
1200
+ function St({ children: e, active: t, isEllipsis: r, ...n }) {
1201
+ const o = L(() => he(t), [t]);
1202
+ return r ? /* @__PURE__ */ a(fe, {}) : /* @__PURE__ */ a("button", { type: "button", className: o, ...n, "data-active": t, children: e });
1211
1203
  }
1212
- const hr = ({ currentPage: e, pagesCount: r, ...t }) => {
1213
- const n = "urlForPage" in t, o = n ? Dt : Mt, s = w(
1214
- (l) => n ? { href: F(l) ? void 0 : t.urlForPage(l) } : { onClick: () => !F(l) && t.onPageChange(l) },
1215
- [n, t]
1216
- );
1217
- return r < 2 ? null : /* @__PURE__ */ g("div", { className: "select-none flex", "data-testid": "paginator", children: [
1218
- e === 1 ? /* @__PURE__ */ a(X, { children: /* @__PURE__ */ a(N, { size: "xs", icon: ee }) }) : /* @__PURE__ */ a(o, { ...s(Math.max(1, e - 1)), "aria-label": "Previous", children: /* @__PURE__ */ a(N, { size: "xs", icon: ee }) }),
1219
- ht(e, r).map((l, i) => /* @__PURE__ */ a(
1204
+ const gr = ({ currentPage: e, pagesCount: t, ...r }) => {
1205
+ const n = "urlForPage" in r, o = n ? Et : St, s = w(
1206
+ (i) => n ? { href: _(i) ? void 0 : r.urlForPage(i) } : { onClick: () => !_(i) && r.onPageChange(i) },
1207
+ [n, r]
1208
+ ), l = v(null);
1209
+ return de(l, { elementsSelector: "button,a", vertical: !1 }), t < 2 ? null : /* @__PURE__ */ g("div", { className: "select-none flex", "data-testid": "paginator", ref: l, children: [
1210
+ e === 1 ? /* @__PURE__ */ a(Y, { children: /* @__PURE__ */ a(N, { size: "xs", icon: z }) }) : /* @__PURE__ */ a(o, { ...s(Math.max(1, e - 1)), "aria-label": "Previous", children: /* @__PURE__ */ a(N, { size: "xs", icon: z }) }),
1211
+ gt(e, t).map((i, d) => /* @__PURE__ */ a(
1220
1212
  o,
1221
1213
  {
1222
- active: l === e,
1223
- isEllipsis: F(l),
1224
- ...s(l),
1225
- children: ft(l)
1214
+ active: i === e,
1215
+ isEllipsis: _(i),
1216
+ ...s(i),
1217
+ children: bt(i)
1226
1218
  },
1227
- xt(l, i)
1219
+ ht(i, d)
1228
1220
  )),
1229
- e === r ? /* @__PURE__ */ a(X, { children: /* @__PURE__ */ a(N, { size: "xs", icon: te }) }) : /* @__PURE__ */ a(o, { ...s(Math.min(r, e + 1)), "aria-label": "Next", children: /* @__PURE__ */ a(N, { size: "xs", icon: te }) })
1221
+ e === t ? /* @__PURE__ */ a(Y, { children: /* @__PURE__ */ a(N, { size: "xs", icon: ee }) }) : /* @__PURE__ */ a(o, { ...s(Math.min(t, e + 1)), "aria-label": "Next", children: /* @__PURE__ */ a(N, { size: "xs", icon: ee }) })
1230
1222
  ] });
1231
- }, _t = ({ buttonLabel: e = "Options", buttonSize: r = "md", ...t }) => /* @__PURE__ */ a(
1232
- O,
1223
+ }, Dt = ({ buttonLabel: e = "Options", buttonSize: t = "md", ...r }) => /* @__PURE__ */ a(
1224
+ I,
1233
1225
  {
1234
1226
  buttonContent: /* @__PURE__ */ a(
1235
1227
  N,
1236
1228
  {
1237
1229
  icon: Pe,
1238
1230
  widthAuto: !0,
1239
- className: d({ "px-1": r === "sm" })
1231
+ className: c({ "px-1": t === "sm" })
1240
1232
  }
1241
1233
  ),
1242
1234
  caretless: !0,
1243
1235
  buttonLabel: e,
1244
- buttonSize: r,
1245
- ...t
1236
+ buttonSize: t,
1237
+ ...r
1246
1238
  }
1247
- ), fr = Object.assign(_t, {
1248
- Item: O.Item,
1249
- Separator: O.Separator,
1250
- Title: O.Title,
1251
- Misc: O.Misc
1252
- }), Ft = ({
1239
+ ), br = Object.assign(Dt, {
1240
+ Item: I.Item,
1241
+ Separator: I.Separator,
1242
+ Title: I.Title,
1243
+ Misc: I.Misc
1244
+ }), Mt = ({
1253
1245
  open: e,
1254
- children: r,
1255
- className: t,
1246
+ children: t,
1247
+ className: r,
1256
1248
  onClose: n,
1257
1249
  ...o
1258
1250
  }) => {
1259
- const s = C(null);
1260
- return R(() => {
1261
- const l = document.body, i = l.style.overflow, c = l.style.paddingRight;
1251
+ const s = v(null);
1252
+ return O(() => {
1253
+ const l = document.body, i = l.style.overflow, d = l.style.paddingRight;
1262
1254
  if (e) {
1263
- const u = window.outerWidth - l.clientWidth, b = l.scrollHeight > l.clientHeight;
1264
- l.style.overflow = "hidden", b && (l.style.paddingRight = `${u}px`), s.current?.showModal();
1255
+ const p = window.outerWidth - l.clientWidth, f = l.scrollHeight > l.clientHeight;
1256
+ l.style.overflow = "hidden", f && (l.style.paddingRight = `${p}px`), s.current?.showModal();
1265
1257
  } else
1266
1258
  s.current?.close();
1267
1259
  return () => {
1268
- l.style.overflow = i, l.style.paddingRight = c;
1260
+ l.style.overflow = i, l.style.paddingRight = d;
1269
1261
  };
1270
1262
  }, [e]), Ue(
1271
1263
  /* @__PURE__ */ a(
1272
1264
  "dialog",
1273
1265
  {
1274
1266
  ref: s,
1275
- className: d("bg-transparent backdrop:bg-black/50", t),
1267
+ className: c("bg-transparent backdrop:bg-black/50", r),
1276
1268
  onCancel: (l) => {
1277
1269
  l.preventDefault(), n();
1278
1270
  },
1279
1271
  ...o,
1280
- children: e && r
1272
+ children: e && t
1281
1273
  }
1282
1274
  ),
1283
1275
  document.body
1284
1276
  );
1285
- }, xr = ({
1277
+ }, hr = ({
1286
1278
  open: e,
1287
- onClose: r,
1288
- variant: t = "default",
1279
+ onClose: t,
1280
+ variant: r = "default",
1289
1281
  title: n,
1290
1282
  children: o,
1291
1283
  className: s,
@@ -1293,43 +1285,43 @@ const hr = ({ currentPage: e, pagesCount: r, ...t }) => {
1293
1285
  }) => {
1294
1286
  const {
1295
1287
  size: i = "md",
1296
- confirmText: c = "Confirm",
1297
- cancelText: u = "Cancel",
1298
- confirmDisabled: b,
1299
- onConfirm: x,
1300
- onClosed: f,
1288
+ confirmText: d = "Confirm",
1289
+ cancelText: p = "Cancel",
1290
+ confirmDisabled: f,
1291
+ onConfirm: b,
1292
+ onClosed: x,
1301
1293
  ...h
1302
- } = "onConfirm" in l ? l : { ...l }, [p, m] = L(e), v = C(null), y = C("cancel"), q = w((T) => {
1303
- T.preventDefault(), T.stopPropagation(), y.current = "confirm", x?.();
1304
- }, [x]);
1305
- return R(() => {
1294
+ } = "onConfirm" in l ? l : { ...l }, [u, m] = R(e), k = v(null), y = v("cancel"), W = w((C) => {
1295
+ C.preventDefault(), C.stopPropagation(), y.current = "confirm", b?.();
1296
+ }, [b]);
1297
+ return O(() => {
1306
1298
  if (e) {
1307
1299
  y.current = "cancel", m(!0);
1308
1300
  return;
1309
1301
  }
1310
- const T = v.current;
1311
- if (T) {
1312
- delete v.current.dataset.open;
1313
- let $ = !1;
1314
- const j = (U) => {
1315
- $ || U.target !== T || ($ = !0, m(!1), f?.(y.current));
1302
+ const C = k.current;
1303
+ if (C) {
1304
+ delete k.current.dataset.open;
1305
+ let H = !1;
1306
+ const $ = (j) => {
1307
+ H || j.target !== C || (H = !0, m(!1), x?.(y.current));
1316
1308
  };
1317
- return T.addEventListener("transitionend", j), () => {
1318
- T.removeEventListener("transitionend", j);
1309
+ return C.addEventListener("transitionend", $), () => {
1310
+ C.removeEventListener("transitionend", $);
1319
1311
  };
1320
1312
  }
1321
- }, [f, e]), R(() => {
1322
- const T = v.current;
1323
- p && T && (T.dataset.open = "");
1324
- }, [p]), /* @__PURE__ */ a(
1325
- Ft,
1313
+ }, [x, e]), O(() => {
1314
+ const C = k.current;
1315
+ u && C && (C.dataset.open = "");
1316
+ }, [u]), /* @__PURE__ */ a(
1317
+ Mt,
1326
1318
  {
1327
- open: p,
1328
- onClose: r,
1329
- className: d(
1319
+ open: u,
1320
+ onClose: t,
1321
+ className: c(
1330
1322
  {
1331
- "flex w-screen h-screen max-w-screen max-h-screen": p,
1332
- "overflow-hidden": t === "cover"
1323
+ "flex w-screen h-screen max-w-screen max-h-screen": u,
1324
+ "overflow-hidden": r === "cover"
1333
1325
  },
1334
1326
  s
1335
1327
  ),
@@ -1338,30 +1330,30 @@ const hr = ({ currentPage: e, pagesCount: r, ...t }) => {
1338
1330
  "form",
1339
1331
  {
1340
1332
  "data-testid": "transition-container",
1341
- ref: v,
1342
- className: d(
1333
+ ref: k,
1334
+ className: c(
1343
1335
  "w-full m-auto p-4 sm:p-6",
1344
1336
  // CSS transitions are based on the presence of the `data-open` attribute
1345
1337
  "-translate-y-4 data-open:translate-y-0 opacity-0 data-open:opacity-100",
1346
1338
  "transition-[opacity_,_translate] duration-300",
1347
1339
  // Handle modal dimensions for different variants and sizes
1348
- t !== "cover" && {
1340
+ r !== "cover" && {
1349
1341
  "sm:w-sm": i === "sm",
1350
1342
  "md:w-lg": i === "md",
1351
1343
  "md:w-4xl": i === "lg",
1352
1344
  "md:w-6xl": i === "xl"
1353
1345
  },
1354
- { "h-full": t === "cover" }
1346
+ { "h-full": r === "cover" }
1355
1347
  ),
1356
- onSubmit: q,
1357
- children: /* @__PURE__ */ a(I, { className: d(
1348
+ onSubmit: W,
1349
+ children: /* @__PURE__ */ a(A, { className: c(
1358
1350
  "w-full",
1359
- { "h-full relative overflow-auto": t === "cover" }
1360
- ), children: t === "cover" ? /* @__PURE__ */ g(B, { children: [
1351
+ { "h-full relative overflow-auto": r === "cover" }
1352
+ ), children: r === "cover" ? /* @__PURE__ */ g(F, { children: [
1361
1353
  /* @__PURE__ */ g(
1362
1354
  "div",
1363
1355
  {
1364
- className: d(
1356
+ className: c(
1365
1357
  "px-4 py-3 absolute top-0 left-0 right-0 z-3000",
1366
1358
  "flex items-center justify-between",
1367
1359
  "text-white bg-linear-to-b from-black/70 to-black/10",
@@ -1369,38 +1361,38 @@ const hr = ({ currentPage: e, pagesCount: r, ...t }) => {
1369
1361
  ),
1370
1362
  children: [
1371
1363
  /* @__PURE__ */ a("h5", { children: n }),
1372
- /* @__PURE__ */ a(Y, { onClick: r, label: "Close dialog" })
1364
+ /* @__PURE__ */ a(Q, { onClick: t, label: "Close dialog" })
1373
1365
  ]
1374
1366
  }
1375
1367
  ),
1376
1368
  o
1377
- ] }) : /* @__PURE__ */ g(B, { children: [
1378
- /* @__PURE__ */ g(I.Header, { className: d(
1369
+ ] }) : /* @__PURE__ */ g(F, { children: [
1370
+ /* @__PURE__ */ g(A.Header, { className: c(
1379
1371
  "sticky top-0",
1380
1372
  "flex items-center justify-between gap-x-2"
1381
1373
  ), children: [
1382
- /* @__PURE__ */ a("h5", { className: d({ "text-danger": t === "danger" }), children: n }),
1383
- /* @__PURE__ */ a(Y, { onClick: r, label: "Close dialog" })
1374
+ /* @__PURE__ */ a("h5", { className: c({ "text-danger": r === "danger" }), children: n }),
1375
+ /* @__PURE__ */ a(Q, { onClick: t, label: "Close dialog" })
1384
1376
  ] }),
1385
- /* @__PURE__ */ a(I.Body, { children: o }),
1386
- x && /* @__PURE__ */ g(
1387
- I.Footer,
1377
+ /* @__PURE__ */ a(A.Body, { children: o }),
1378
+ b && /* @__PURE__ */ g(
1379
+ A.Footer,
1388
1380
  {
1389
1381
  "data-testid": "footer",
1390
- className: d(
1382
+ className: c(
1391
1383
  "flex justify-end items-center gap-x-2",
1392
1384
  "[&]:px-3 sticky bottom-0"
1393
1385
  ),
1394
1386
  children: [
1395
- /* @__PURE__ */ a(Ot, { onClick: r, children: u }),
1387
+ /* @__PURE__ */ a(At, { onClick: t, children: p }),
1396
1388
  /* @__PURE__ */ a(
1397
- ie,
1389
+ le,
1398
1390
  {
1399
1391
  solid: !0,
1400
- variant: t === "danger" ? "danger" : "primary",
1401
- disabled: b,
1392
+ variant: r === "danger" ? "danger" : "primary",
1393
+ disabled: f,
1402
1394
  type: "submit",
1403
- children: c
1395
+ children: d
1404
1396
  }
1405
1397
  )
1406
1398
  ]
@@ -1411,46 +1403,46 @@ const hr = ({ currentPage: e, pagesCount: r, ...t }) => {
1411
1403
  )
1412
1404
  }
1413
1405
  );
1414
- }, yr = ({ className: e, children: r, loading: t = !1, variant: n = "default" }) => /* @__PURE__ */ a(Qe, { className: d({ "[&]:border-danger": n === "error" }, e), children: /* @__PURE__ */ g("h3", { className: d("text-center", {
1406
+ }, fr = ({ className: e, children: t, loading: r = !1, variant: n = "default" }) => /* @__PURE__ */ a(Qe, { className: c({ "[&]:border-danger": n === "error" }, e), children: /* @__PURE__ */ g("h3", { className: c("text-center", {
1415
1407
  "text-gray-500 dark:text-gray-400": n === "default",
1416
1408
  "text-danger": n === "error"
1417
1409
  }), children: [
1418
- t && /* @__PURE__ */ g(B, { children: [
1419
- /* @__PURE__ */ a(N, { icon: ae, spin: !0 }),
1420
- /* @__PURE__ */ a("span", { className: "ml-2", children: r ?? "Loading..." })
1410
+ r && /* @__PURE__ */ g(F, { children: [
1411
+ /* @__PURE__ */ a(N, { icon: oe, spin: !0 }),
1412
+ /* @__PURE__ */ a("span", { className: "ml-2", children: t ?? "Loading..." })
1421
1413
  ] }),
1422
- !t && r
1423
- ] }) }), wr = ({ variant: e, className: r, size: t = "md", children: n }) => /* @__PURE__ */ a(
1414
+ !r && t
1415
+ ] }) }), xr = ({ variant: e, className: t, size: r = "md", children: n }) => /* @__PURE__ */ a(
1424
1416
  "div",
1425
1417
  {
1426
- className: d(
1418
+ className: c(
1427
1419
  "rounded-md text-center",
1428
1420
  {
1429
- "p-2": t === "sm",
1430
- "p-4": t === "md",
1431
- "p-6": t === "lg",
1421
+ "p-2": r === "sm",
1422
+ "p-4": r === "md",
1423
+ "p-6": r === "lg",
1432
1424
  "[&]:text-white": e !== "warning",
1433
1425
  "bg-lm-brand dark:bg-dm-brand": e === "success",
1434
1426
  "bg-danger": e === "error",
1435
1427
  "bg-warning text-black": e === "warning"
1436
1428
  },
1437
- r
1429
+ t
1438
1430
  ),
1439
1431
  children: n
1440
1432
  }
1441
- ), kr = ({ placement: e = "auto" } = {}) => {
1442
- const r = C(null), t = (() => {
1433
+ ), yr = ({ placement: e = "auto" } = {}) => {
1434
+ const t = v(null), r = (() => {
1443
1435
  const m = [];
1444
- return e === "auto" && m.push(Fe()), m.push(Be({ element: r })), m;
1445
- })(), [n, o] = L(!1), { refs: s, floatingStyles: l, context: i, middlewareData: c } = se({
1436
+ return e === "auto" && m.push(Fe()), m.push(Be({ element: t })), m;
1437
+ })(), [n, o] = R(!1), { refs: s, floatingStyles: l, context: i, middlewareData: d } = ae({
1446
1438
  placement: e === "auto" ? void 0 : e,
1447
1439
  open: n,
1448
1440
  onOpenChange: o,
1449
- middleware: t
1450
- }), u = He(i, {
1441
+ middleware: r
1442
+ }), p = He(i, {
1451
1443
  delay: { open: 300 },
1452
1444
  move: !0
1453
- }), { getFloatingProps: b, getReferenceProps: x } = le([u]), { isMounted: f, styles: h } = $e(i, { duration: 200 }), p = P(() => {
1445
+ }), { getFloatingProps: f, getReferenceProps: b } = se([p]), { isMounted: x, styles: h } = $e(i, { duration: 200 }), u = L(() => {
1454
1446
  const m = i.placement.split("-")[0];
1455
1447
  return {
1456
1448
  top: "bottom",
@@ -1460,23 +1452,23 @@ const hr = ({ currentPage: e, pagesCount: r, ...t }) => {
1460
1452
  }[m] ?? "";
1461
1453
  }, [i.placement]);
1462
1454
  return {
1463
- anchor: { ...x(), ref: s.setReference },
1455
+ anchor: { ...b(), ref: s.setReference },
1464
1456
  tooltip: {
1465
- ...b(),
1457
+ ...f(),
1466
1458
  refSetter: s.setFloating,
1467
- isMounted: f,
1459
+ isMounted: x,
1468
1460
  styles: { ...l, ...h },
1469
- arrowPos: c.arrow,
1470
- arrowRef: r,
1471
- arrowSide: p
1461
+ arrowPos: d.arrow,
1462
+ arrowRef: t,
1463
+ arrowSide: u
1472
1464
  }
1473
1465
  };
1474
- }, vr = ({ children: e, isMounted: r, styles: t, refSetter: n, arrowRef: o, arrowPos: s, arrowSide: l, ...i }) => r && /* @__PURE__ */ a(
1466
+ }, wr = ({ children: e, isMounted: t, styles: r, refSetter: n, arrowRef: o, arrowPos: s, arrowSide: l, ...i }) => t && /* @__PURE__ */ a(
1475
1467
  "div",
1476
1468
  {
1477
1469
  role: "tooltip",
1478
1470
  "aria-live": "polite",
1479
- className: d(
1471
+ className: c(
1480
1472
  "z-500 max-w-64",
1481
1473
  // Add space between anchor and tooltip via padding, so that if the tooltip is inside the anchor, you can hover it
1482
1474
  // and it's never closed
@@ -1488,7 +1480,7 @@ const hr = ({ currentPage: e, pagesCount: r, ...t }) => {
1488
1480
  }
1489
1481
  ),
1490
1482
  ref: n,
1491
- style: t,
1483
+ style: r,
1492
1484
  ...i,
1493
1485
  children: /* @__PURE__ */ g("div", { className: "relative px-1.5 py-1 rounded bg-black/90 text-white text-center", children: [
1494
1486
  /* @__PURE__ */ a("span", { className: "sr-only", children: "Tooltip: " }),
@@ -1497,7 +1489,7 @@ const hr = ({ currentPage: e, pagesCount: r, ...t }) => {
1497
1489
  "div",
1498
1490
  {
1499
1491
  ref: o,
1500
- className: d(
1492
+ className: c(
1501
1493
  "absolute",
1502
1494
  // Render as a triangle
1503
1495
  "border-l-6 border-r-6 border-b-6 border-l-transparent border-r-transparent border-b-black/90",
@@ -1519,146 +1511,146 @@ const hr = ({ currentPage: e, pagesCount: r, ...t }) => {
1519
1511
  ] })
1520
1512
  }
1521
1513
  );
1522
- function Bt(e) {
1514
+ function _t(e) {
1523
1515
  if (e.currentField !== e.newField)
1524
1516
  return "ASC";
1525
- const r = {
1517
+ const t = {
1526
1518
  ASC: "DESC",
1527
1519
  DESC: void 0
1528
1520
  };
1529
- return e.currentOrderDir ? r[e.currentOrderDir] : "ASC";
1521
+ return e.currentOrderDir ? t[e.currentOrderDir] : "ASC";
1530
1522
  }
1531
- function Ht(e) {
1532
- const r = Bt(e);
1523
+ function Ft(e) {
1524
+ const t = _t(e);
1533
1525
  return {
1534
- field: r ? e.newField : void 0,
1535
- dir: r
1526
+ field: t ? e.newField : void 0,
1527
+ dir: t
1536
1528
  };
1537
1529
  }
1538
- const Nr = (e, { field: r, dir: t }) => !r || !t ? e : e.sort((n, o) => {
1539
- const s = t === "ASC" ? 1 : -1, l = t === "ASC" ? -1 : 1;
1540
- return n[r] > o[r] ? s : l;
1541
- }), Cr = (e) => e.dir ? `${e.field}-${e.dir}` : void 0, Tr = (e) => {
1542
- const [r, t] = e.split("-");
1543
- return { field: r, dir: t };
1530
+ const kr = (e, { field: t, dir: r }) => !t || !r ? e : e.sort((n, o) => {
1531
+ const s = r === "ASC" ? 1 : -1, l = r === "ASC" ? -1 : 1;
1532
+ return n[t] > o[t] ? s : l;
1533
+ }), vr = (e) => e.dir ? `${e.field}-${e.dir}` : void 0, Nr = (e) => {
1534
+ const [t, r] = e.split("-");
1535
+ return { field: t, dir: r };
1544
1536
  };
1545
- function Ar({ items: e, order: r, onChange: t, prefixed: n = !0, buttonVariant: o = "button", ...s }) {
1546
- const l = w((c) => {
1547
- const u = Ht({ currentOrderDir: r.dir, currentField: r.field, newField: c });
1548
- t(u);
1549
- }, [t, r.dir, r.field]), i = o === "button";
1537
+ function Cr({ items: e, order: t, onChange: r, prefixed: n = !0, buttonVariant: o = "button", ...s }) {
1538
+ const l = w((d) => {
1539
+ const p = Ft({ currentOrderDir: t.dir, currentField: t.field, newField: d });
1540
+ r(p);
1541
+ }, [r, t.dir, t.field]), i = o === "button";
1550
1542
  return /* @__PURE__ */ g(
1551
- O,
1543
+ I,
1552
1544
  {
1553
- buttonContent: /* @__PURE__ */ g(B, { children: [
1545
+ buttonContent: /* @__PURE__ */ g(F, { children: [
1554
1546
  !i && "Order by",
1555
- i && !r.field && /* @__PURE__ */ a("i", { children: "Order by..." }),
1556
- i && r.field && /* @__PURE__ */ g(B, { children: [
1547
+ i && !t.field && /* @__PURE__ */ a("i", { children: "Order by..." }),
1548
+ i && t.field && /* @__PURE__ */ g(F, { children: [
1557
1549
  n && "Order by: ",
1558
- e[r.field],
1550
+ e[t.field],
1559
1551
  " - ",
1560
- r.dir ?? "DESC"
1552
+ t.dir ?? "DESC"
1561
1553
  ] })
1562
1554
  ] }),
1563
1555
  buttonVariant: o,
1564
1556
  ...s,
1565
1557
  children: [
1566
- Object.entries(e).map(([c, u]) => /* @__PURE__ */ g(
1567
- O.Item,
1558
+ Object.entries(e).map(([d, p]) => /* @__PURE__ */ g(
1559
+ I.Item,
1568
1560
  {
1569
- selected: r.field === c,
1570
- onClick: () => l(c),
1561
+ selected: t.field === d,
1562
+ onClick: () => l(d),
1571
1563
  className: "flex items-center justify-between gap-2",
1572
1564
  children: [
1573
- u,
1574
- r.field === c && /* @__PURE__ */ a(N, { icon: r.dir === "ASC" ? Ee : Se })
1565
+ p,
1566
+ t.field === d && /* @__PURE__ */ a(N, { icon: t.dir === "ASC" ? Ee : Se })
1575
1567
  ]
1576
1568
  },
1577
- c
1569
+ d
1578
1570
  )),
1579
- /* @__PURE__ */ a(O.Separator, {}),
1580
- /* @__PURE__ */ a(O.Item, { disabled: !r.field, onClick: () => t({}), children: /* @__PURE__ */ a("i", { children: "Clear selection" }) })
1571
+ /* @__PURE__ */ a(I.Separator, {}),
1572
+ /* @__PURE__ */ a(I.Item, { disabled: !t.field, onClick: () => r({}), children: /* @__PURE__ */ a("i", { children: "Clear selection" }) })
1581
1573
  ]
1582
1574
  }
1583
1575
  );
1584
1576
  }
1585
- const $t = "#4696e5", jt = "rgba(70, 150, 229, 0.4)", Ut = "#2078CF", Gt = "rgba(32, 120, 207, 0.4)", Ir = () => xe() ? $t : Ut, Or = () => xe() ? jt : Gt, Rr = "#f77f28", Lr = "rgba(247, 127, 40, 0.4)", Pr = "white", Er = "#161b22", Kt = (e) => document.querySelector("html")?.setAttribute("data-theme", e), xe = () => document.querySelector("html")?.getAttribute("data-theme") === "dark", Wt = (e = window.matchMedia.bind(window)) => e("(prefers-color-scheme: dark)").matches ? "dark" : "light", Sr = (e) => {
1586
- const [r, t] = L(() => e ?? Wt());
1587
- return R(() => {
1588
- Kt(r);
1589
- }, [r]), [r, t];
1577
+ const Bt = "#4696e5", Ht = "rgba(70, 150, 229, 0.4)", $t = "#2078CF", jt = "rgba(32, 120, 207, 0.4)", Tr = () => xe() ? Bt : $t, Ar = () => xe() ? Ht : jt, Ir = "#f77f28", Or = "rgba(247, 127, 40, 0.4)", Rr = "white", Lr = "#161b22", Ut = (e) => document.querySelector("html")?.setAttribute("data-theme", e), xe = () => document.querySelector("html")?.getAttribute("data-theme") === "dark", Gt = (e = window.matchMedia.bind(window)) => e("(prefers-color-scheme: dark)").matches ? "dark" : "light", Pr = (e) => {
1578
+ const [t, r] = R(() => e ?? Gt());
1579
+ return O(() => {
1580
+ Ut(t);
1581
+ }, [t]), [t, r];
1590
1582
  };
1591
1583
  export {
1592
- jt as BRAND_COLOR_ALPHA_DM,
1593
- Gt as BRAND_COLOR_ALPHA_LM,
1594
- $t as BRAND_COLOR_DM,
1595
- Ut as BRAND_COLOR_LM,
1596
- Pt as BaseNavBar,
1597
- ie as Button,
1598
- I as Card,
1599
- xr as CardModal,
1600
- nr as Checkbox,
1601
- Y as CloseButton,
1602
- cr as CopyToClipboardButton,
1603
- tr as Details,
1604
- O as Dropdown,
1605
- G as ELLIPSIS,
1606
- Rr as HIGHLIGHTED_COLOR,
1607
- Lr as HIGHLIGHTED_COLOR_ALPHA,
1608
- J as Input,
1609
- Z as Label,
1610
- or as LabelledInput,
1611
- ar as LabelledRevealablePasswordInput,
1612
- sr as LabelledSelect,
1613
- Ot as LinkButton,
1584
+ Ht as BRAND_COLOR_ALPHA_DM,
1585
+ jt as BRAND_COLOR_ALPHA_LM,
1586
+ Bt as BRAND_COLOR_DM,
1587
+ $t as BRAND_COLOR_LM,
1588
+ Rt as BaseNavBar,
1589
+ le as Button,
1590
+ A as Card,
1591
+ hr as CardModal,
1592
+ tr as Checkbox,
1593
+ Q as CloseButton,
1594
+ ir as CopyToClipboardButton,
1595
+ zt as Details,
1596
+ I as Dropdown,
1597
+ U as ELLIPSIS,
1598
+ Ir as HIGHLIGHTED_COLOR,
1599
+ Or as HIGHLIGHTED_COLOR_ALPHA,
1600
+ X as Input,
1601
+ J as Label,
1602
+ rr as LabelledInput,
1603
+ nr as LabelledRevealablePasswordInput,
1604
+ or as LabelledSelect,
1605
+ At as LinkButton,
1614
1606
  Ye as Listbox,
1615
- _ as Menu,
1616
- yr as Message,
1617
- Ft as ModalDialog,
1618
- gr as NavBar,
1619
- br as NavPills,
1620
- Ar as OrderingDropdown,
1621
- Er as PRIMARY_DARK_COLOR,
1622
- Pr as PRIMARY_LIGHT_COLOR,
1623
- hr as Paginator,
1624
- wr as Result,
1607
+ M as Menu,
1608
+ fr as Message,
1609
+ Mt as ModalDialog,
1610
+ ur as NavBar,
1611
+ pr as NavPills,
1612
+ Cr as OrderingDropdown,
1613
+ Lr as PRIMARY_DARK_COLOR,
1614
+ Rr as PRIMARY_LIGHT_COLOR,
1615
+ gr as Paginator,
1616
+ xr as Result,
1625
1617
  tt as RevealablePasswordInput,
1626
- fr as RowDropdown,
1627
- at as SearchCombobox,
1618
+ br as RowDropdown,
1619
+ ot as SearchCombobox,
1628
1620
  nt as SearchInput,
1629
1621
  rt as Select,
1630
1622
  Qe as SimpleCard,
1631
- rr as Table,
1632
- lr as TagsAutocomplete,
1633
- ir as ToggleSwitch,
1634
- vr as Tooltip,
1635
- Ir as brandColor,
1636
- Or as brandColorAlpha,
1637
- Kt as changeThemeInMarkup,
1638
- Ht as determineOrder,
1639
- Bt as determineOrderDir,
1640
- gt as formatNumber,
1641
- Wt as getSystemPreferredTheme,
1623
+ er as Table,
1624
+ ar as TagsAutocomplete,
1625
+ sr as ToggleSwitch,
1626
+ wr as Tooltip,
1627
+ Tr as brandColor,
1628
+ Ar as brandColorAlpha,
1629
+ Ut as changeThemeInMarkup,
1630
+ Ft as determineOrder,
1631
+ _t as determineOrderDir,
1632
+ ut as formatNumber,
1633
+ Gt as getSystemPreferredTheme,
1642
1634
  xe as isDarkThemeEnabled,
1643
- ct as isLightColor,
1644
- xt as keyForPage,
1635
+ it as isLightColor,
1636
+ ht as keyForPage,
1645
1637
  ce as normalizeTag,
1646
- Cr as orderToString,
1647
- F as pageIsEllipsis,
1648
- mt as parseQueryString,
1649
- ft as prettifyPageNumber,
1650
- ht as progressivePagination,
1651
- pr as roundTen,
1652
- Nr as sortList,
1653
- Tr as stringToOrder,
1654
- mr as stringifyQueryParams,
1655
- it as useArrowKeyNavigation,
1656
- dr as useGoBack,
1657
- ur as useParsedQuery,
1658
- yt as useTagsSearch,
1659
- Sr as useTheme,
1638
+ vr as orderToString,
1639
+ _ as pageIsEllipsis,
1640
+ dt as parseQueryString,
1641
+ bt as prettifyPageNumber,
1642
+ gt as progressivePagination,
1643
+ mr as roundTen,
1644
+ kr as sortList,
1645
+ Nr as stringToOrder,
1646
+ dr as stringifyQueryParams,
1647
+ de as useArrowKeyNavigation,
1648
+ lr as useGoBack,
1649
+ cr as useParsedQuery,
1650
+ ft as useTagsSearch,
1651
+ Pr as useTheme,
1660
1652
  me as useTimeout,
1661
- kt as useTimeoutToggle,
1653
+ yt as useTimeoutToggle,
1662
1654
  ue as useToggle,
1663
- kr as useTooltip
1655
+ yr as useTooltip
1664
1656
  };