@shlinkio/shlink-frontend-kit 0.8.11 → 0.8.13

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