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