@shlinkio/shlink-frontend-kit 0.8.2 → 0.8.3

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.
@@ -1,3 +1,4 @@
1
+ import { ChangeEvent } from 'react';
1
2
  import { FC } from 'react';
2
3
  import { HTMLProps } from 'react';
3
4
  import { InputHTMLAttributes } from 'react';
@@ -10,6 +11,10 @@ export declare type BaseInputProps = {
10
11
  feedback?: 'error';
11
12
  };
12
13
 
14
+ declare type BooleanControlProps = Omit<HTMLProps<HTMLInputElement>, 'type' | 'onChange' | 'value' | 'defaultValue'> & {
15
+ onChange?: (checked: boolean, e: ChangeEvent<HTMLInputElement>) => void;
16
+ };
17
+
13
18
  export declare const Button: FC<ButtonProps>;
14
19
 
15
20
  export declare type ButtonProps = PropsWithChildren<{
@@ -51,6 +56,10 @@ export declare type CellProps = HTMLProps<HTMLTableCellElement> & {
51
56
  type?: 'td' | 'th';
52
57
  };
53
58
 
59
+ export declare const Checkbox: FC<CheckboxProps>;
60
+
61
+ export declare type CheckboxProps = BooleanControlProps;
62
+
54
63
  export declare const CloseButton: FC<CloseButtonProps>;
55
64
 
56
65
  export declare type CloseButtonProps = {
@@ -90,7 +99,7 @@ export declare const Label: FC<LabelProps>;
90
99
  export declare const LabelledInput: FC<LabelledInputProps>;
91
100
 
92
101
  export declare type LabelledInputProps = Omit<InputProps, 'className' | 'id' | 'feedback'> & {
93
- label: string;
102
+ label: RequiredReactNode;
94
103
  inputClassName?: string;
95
104
  error?: string;
96
105
  /** Alternative to `required`. Causes the input to be required, without displaying an asterisk */
@@ -100,7 +109,7 @@ export declare type LabelledInputProps = Omit<InputProps, 'className' | 'id' | '
100
109
  export declare const LabelledSelect: FC<LabelledSelectProps>;
101
110
 
102
111
  export declare type LabelledSelectProps = Omit<SelectProps, 'className' | 'id'> & {
103
- label: string;
112
+ label: RequiredReactNode;
104
113
  selectClassName?: string;
105
114
  /** Alternative to `required`. Causes the input to be required, without displaying an asterisk */
106
115
  hiddenRequired?: boolean;
@@ -119,6 +128,17 @@ export declare type LinkButtonProps = Omit<HTMLProps<HTMLButtonElement>, 'size'
119
128
 
120
129
  declare type LinkButtonProps_2 = LinkProps;
121
130
 
131
+ /**
132
+ * Component used to display a card with general information, about current page status, loading, etc.
133
+ */
134
+ export declare const Message: FC<MessageProps>;
135
+
136
+ export declare type MessageProps = PropsWithChildren<{
137
+ className?: string;
138
+ loading?: boolean;
139
+ variant?: 'default' | 'error';
140
+ }>;
141
+
122
142
  export declare const ModalDialog: FC<ModalDialogProps>;
123
143
 
124
144
  export declare type ModalDialogProps = HTMLProps<HTMLDialogElement> & {
@@ -128,6 +148,15 @@ export declare type ModalDialogProps = HTMLProps<HTMLDialogElement> & {
128
148
  onClose: () => void;
129
149
  };
130
150
 
151
+ export declare const NavPills: FC<NavPillsProps> & {
152
+ Pill: FC<LinkProps>;
153
+ };
154
+
155
+ export declare type NavPillsProps = PropsWithChildren<{
156
+ fill?: boolean;
157
+ className?: string;
158
+ }>;
159
+
131
160
  declare type NoTitleProps = {
132
161
  title?: never;
133
162
  titleSize?: never;
@@ -148,6 +177,8 @@ export declare type PaginatorProps = {
148
177
  urlForPage: (pageNumber: number) => string;
149
178
  });
150
179
 
180
+ export declare type PillProps = LinkProps;
181
+
151
182
  export declare const prettifyPageNumber: (pageNumber: NumberOrEllipsis) => string;
152
183
 
153
184
  export declare const progressivePagination: (currentPage: number, pageCount: number) => NumberOrEllipsis[];
@@ -170,6 +201,19 @@ declare type RegularCardModalProps = CommonCardModalProps & {
170
201
  onConfirm?: () => void;
171
202
  };
172
203
 
204
+ export declare type RequiredReactNode = Exclude<ReactNode, undefined | null>;
205
+
206
+ /**
207
+ * Component used to display the result of an operation, which can be a success, failure or warning.
208
+ */
209
+ export declare const Result: FC<ResultProps>;
210
+
211
+ export declare type ResultProps = PropsWithChildren<{
212
+ variant: 'success' | 'error' | 'warning';
213
+ className?: string;
214
+ size?: Size;
215
+ }>;
216
+
173
217
  export declare const roundTen: (number: number) => number;
174
218
 
175
219
  export declare const SearchInput: FC<SearchInputProps>;
@@ -194,7 +238,7 @@ export declare type SimpleCardProps = Omit<CardProps, 'title' | 'size'> & {
194
238
  bodyClassName?: string;
195
239
  } & (TitleProps | NoTitleProps);
196
240
 
197
- declare type Size = 'sm' | 'md' | 'lg';
241
+ export declare type Size = 'sm' | 'md' | 'lg';
198
242
 
199
243
  export declare const Table: FC<TableProps> & {
200
244
  Row: FC<HTMLProps<HTMLTableRowElement>>;
@@ -220,6 +264,10 @@ declare type TitleProps = {
220
264
  titleSize?: Size;
221
265
  };
222
266
 
267
+ export declare const ToggleSwitch: FC<ToggleSwitchProps>;
268
+
269
+ export declare type ToggleSwitchProps = BooleanControlProps;
270
+
223
271
  export declare function useTimeout(defaultDelay: number,
224
272
  /** Test seam. Defaults to global setTimeout */
225
273
  setTimeout_?: typeof globalThis.setTimeout,
package/dist/tailwind.js CHANGED
@@ -1,109 +1,109 @@
1
- import { jsx as n, jsxs as w, Fragment as I } from "react/jsx-runtime";
2
- import a from "clsx";
3
- import { createContext as L, useContext as g, useId as R, useRef as M, useCallback as k, useEffect as E, useMemo as T } from "react";
4
- import { Link as _ } from "react-router";
5
- import { faClose as U, faSearch as A, faChevronLeft as P, faChevronRight as B } from "@fortawesome/free-solid-svg-icons";
6
- import { FontAwesomeIcon as h } from "@fortawesome/react-fontawesome";
7
- const f = L(void 0), u = L({ responsive: !0 }), O = ({ children: t, className: r }) => {
8
- const { responsive: e } = g(u);
9
- return /* @__PURE__ */ n(f.Provider, { value: { section: "head" }, children: /* @__PURE__ */ n(
1
+ import { jsx as n, jsxs as i, Fragment as B } from "react/jsx-runtime";
2
+ import s, { clsx as f } from "clsx";
3
+ import { createContext as F, useContext as g, useCallback as N, useId as $, useRef as R, useEffect as T, useMemo as E, useState as Q } from "react";
4
+ import { Link as U, NavLink as V } from "react-router";
5
+ import { faClose as X, faSearch as Y, faChevronLeft as j, faChevronRight as D, faCircleNotch as Z } from "@fortawesome/free-solid-svg-icons";
6
+ import { FontAwesomeIcon as b } from "@fortawesome/react-fontawesome";
7
+ const v = F(void 0), x = F({ responsive: !0 }), tt = ({ children: t, className: e }) => {
8
+ const { responsive: r } = g(x);
9
+ return /* @__PURE__ */ n(v.Provider, { value: { section: "head" }, children: /* @__PURE__ */ n(
10
10
  "thead",
11
11
  {
12
- className: a(
13
- { "tw:hidden tw:lg:table-header-group": e },
14
- r
12
+ className: s(
13
+ { "tw:hidden tw:lg:table-header-group": r },
14
+ e
15
15
  ),
16
16
  children: t
17
17
  }
18
18
  ) });
19
- }, W = ({ children: t, className: r }) => {
20
- const { responsive: e } = g(u);
21
- return /* @__PURE__ */ n(f.Provider, { value: { section: "body" }, children: /* @__PURE__ */ n(
19
+ }, et = ({ children: t, className: e }) => {
20
+ const { responsive: r } = g(x);
21
+ return /* @__PURE__ */ n(v.Provider, { value: { section: "body" }, children: /* @__PURE__ */ n(
22
22
  "tbody",
23
23
  {
24
- className: a(
25
- { "tw:lg:table-row-group tw:flex tw:flex-col tw:gap-y-3": e },
26
- r
24
+ className: s(
25
+ { "tw:lg:table-row-group tw:flex tw:flex-col tw:gap-y-3": r },
26
+ e
27
27
  ),
28
28
  children: t
29
29
  }
30
30
  ) });
31
- }, q = ({ children: t, className: r }) => {
32
- const { responsive: e } = g(u);
33
- return /* @__PURE__ */ n(f.Provider, { value: { section: "footer" }, children: /* @__PURE__ */ n(
31
+ }, rt = ({ children: t, className: e }) => {
32
+ const { responsive: r } = g(x);
33
+ return /* @__PURE__ */ n(v.Provider, { value: { section: "footer" }, children: /* @__PURE__ */ n(
34
34
  "tfoot",
35
35
  {
36
- className: a(
37
- { "tw:lg:table-row-group tw:flex tw:flex-col tw:gap-y-3 tw:mt-4": e },
38
- r
36
+ className: s(
37
+ { "tw:lg:table-row-group tw:flex tw:flex-col tw:gap-y-3 tw:mt-4": r },
38
+ e
39
39
  ),
40
40
  children: t
41
41
  }
42
42
  ) });
43
- }, G = ({ children: t, className: r, ...e }) => {
44
- const o = g(f), d = (o == null ? void 0 : o.section) === "body", { responsive: l } = g(u);
43
+ }, ot = ({ children: t, className: e, ...r }) => {
44
+ const o = g(v), d = (o == null ? void 0 : o.section) === "body", { responsive: a } = g(x);
45
45
  return /* @__PURE__ */ n(
46
46
  "tr",
47
47
  {
48
- className: a(
48
+ className: s(
49
49
  "tw:group",
50
50
  {
51
- "tw:lg:table-row tw:flex tw:flex-col": l,
52
- "tw:lg:border-0 tw:border-y-2 tw:border-lm-border tw:dark:border-dm-border": l,
51
+ "tw:lg:table-row tw:flex tw:flex-col": a,
52
+ "tw:lg:border-0 tw:border-y-2 tw:border-lm-border tw:dark:border-dm-border": a,
53
53
  "tw:hover:bg-lm-primary tw:dark:hover:bg-dm-primary": d,
54
54
  // Use a different hover bg color depending on the table being inside a card or not
55
55
  "tw:group-[&]/card:hover:bg-lm-secondary tw:dark:group-[&]/card:hover:bg-dm-secondary": d
56
56
  },
57
- r
57
+ e
58
58
  ),
59
- ...e,
59
+ ...r,
60
60
  children: t
61
61
  }
62
62
  );
63
- }, J = ({ children: t, className: r, columnName: e, type: o, ...d }) => {
64
- const l = g(f), s = o ?? ((l == null ? void 0 : l.section) !== "body" ? "th" : "td"), { responsive: i } = g(u);
63
+ }, nt = ({ children: t, className: e, columnName: r, type: o, ...d }) => {
64
+ const a = g(v), l = o ?? ((a == null ? void 0 : a.section) !== "body" ? "th" : "td"), { responsive: w } = g(x);
65
65
  return /* @__PURE__ */ n(
66
- s,
66
+ l,
67
67
  {
68
- "data-column": i ? e : void 0,
69
- className: a(
68
+ "data-column": w ? r : void 0,
69
+ className: s(
70
70
  "tw:p-2 tw:border-lm-border tw:dark:border-dm-border",
71
71
  {
72
- "tw:border-b-1": !i,
73
- "tw:block tw:lg:table-cell tw:not-last:border-b-1 tw:lg:border-b-1": i,
72
+ "tw:border-b-1": !w,
73
+ "tw:block tw:lg:table-cell tw:not-last:border-b-1 tw:lg:border-b-1": w,
74
74
  // For md and lower, display the content in data-column attribute as before
75
- "tw:before:lg:hidden tw:before:content-[attr(data-column)] tw:before:font-bold tw:before:mr-1": i && s === "td"
75
+ "tw:before:lg:hidden tw:before:content-[attr(data-column)] tw:before:font-bold tw:before:mr-1": w && l === "td"
76
76
  },
77
- r
77
+ e
78
78
  ),
79
79
  ...d,
80
80
  children: t
81
81
  }
82
82
  );
83
- }, K = ({ header: t, footer: r, children: e, responsive: o = !0, ...d }) => /* @__PURE__ */ n(u.Provider, { value: { responsive: o }, children: /* @__PURE__ */ w("table", { className: "tw:w-full", ...d, children: [
84
- /* @__PURE__ */ n(O, { children: t }),
85
- /* @__PURE__ */ n(W, { children: e }),
86
- r && /* @__PURE__ */ n(q, { children: r })
87
- ] }) }), xt = Object.assign(K, { Row: G, Cell: J }), Q = ({
83
+ }, dt = ({ header: t, footer: e, children: r, responsive: o = !0, ...d }) => /* @__PURE__ */ n(x.Provider, { value: { responsive: o }, children: /* @__PURE__ */ i("table", { className: "tw:w-full", ...d, children: [
84
+ /* @__PURE__ */ n(tt, { children: t }),
85
+ /* @__PURE__ */ n(et, { children: r }),
86
+ e && /* @__PURE__ */ n(rt, { children: e })
87
+ ] }) }), Rt = Object.assign(dt, { Row: ot, Cell: nt }), lt = ({
88
88
  children: t,
89
- className: r,
90
- disabled: e,
89
+ className: e,
90
+ disabled: r,
91
91
  variant: o = "primary",
92
92
  size: d = "md",
93
- inline: l = !1,
94
- solid: s = !1,
95
- ...i
93
+ inline: a = !1,
94
+ solid: l = !1,
95
+ ...w
96
96
  }) => {
97
- const c = "to" in i ? _ : "button";
97
+ const c = "to" in w ? U : "button";
98
98
  return (
99
99
  // @ts-expect-error We are explicitly checking for the `to` prop before using Link
100
100
  /* @__PURE__ */ n(
101
101
  c,
102
102
  {
103
- className: a(
103
+ className: s(
104
104
  {
105
- "tw:inline-flex": l,
106
- "tw:flex": !l
105
+ "tw:inline-flex": a,
106
+ "tw:flex": !a
107
107
  },
108
108
  "tw:gap-2 tw:items-center tw:justify-center",
109
109
  "tw:border tw:rounded-md tw:no-underline",
@@ -120,11 +120,11 @@ const f = L(void 0), u = L({ responsive: !0 }), O = ({ children: t, className: r
120
120
  {
121
121
  "tw:border-brand tw:text-brand": o === "primary",
122
122
  "tw:border-zinc-500": o === "secondary",
123
- "tw:text-zinc-500": o === "secondary" && !s,
123
+ "tw:text-zinc-500": o === "secondary" && !l,
124
124
  "tw:border-danger": o === "danger",
125
- "tw:text-danger": o === "danger" && !s
125
+ "tw:text-danger": o === "danger" && !l
126
126
  },
127
- s && {
127
+ l && {
128
128
  "tw:text-white": !0,
129
129
  "tw:bg-brand": o === "primary",
130
130
  "tw:highlight:bg-brand-dark tw:highlight:border-brand-dark": o === "primary",
@@ -133,118 +133,143 @@ const f = L(void 0), u = L({ responsive: !0 }), O = ({ children: t, className: r
133
133
  "tw:bg-danger": o === "danger",
134
134
  "tw:highlight:bg-danger-dark tw:highlight:border-danger-dark": o === "danger"
135
135
  },
136
- !e && {
137
- "tw:highlight:text-white": !s,
136
+ !r && {
137
+ "tw:highlight:text-white": !l,
138
138
  "tw:highlight:bg-brand": o === "primary",
139
139
  "tw:highlight:bg-zinc-500": o === "secondary",
140
140
  "tw:highlight:bg-danger": o === "danger"
141
141
  },
142
142
  {
143
- "tw:pointer-events-none tw:opacity-65": e
143
+ "tw:pointer-events-none tw:opacity-65": r
144
144
  },
145
- r
145
+ e
146
146
  ),
147
- disabled: e,
148
- ...i,
147
+ disabled: r,
148
+ ...w,
149
149
  children: t
150
150
  }
151
151
  )
152
152
  );
153
- }, S = ({ onClick: t, label: r = "Close" }) => /* @__PURE__ */ n(
153
+ }, z = ({ className: t, onChange: e, ...r }) => {
154
+ const o = N((d) => e == null ? void 0 : e(d.target.checked, d), [e]);
155
+ return /* @__PURE__ */ n(
156
+ "input",
157
+ {
158
+ type: "checkbox",
159
+ className: f(
160
+ "tw:appearance-none tw:focus-ring",
161
+ "tw:border-1 tw:border-lm-input-border tw:dark:border-dm-input-border",
162
+ "tw:bg-lm-primary tw:dark:bg-dm-primary tw:checked:bg-brand tw:bg-no-repeat",
163
+ // Use different background color when rendered inside a card
164
+ "tw:group-[&]/card:bg-lm-input tw:group-[&]/card:dark:bg-dm-input",
165
+ t
166
+ ),
167
+ onChange: o,
168
+ ...r
169
+ }
170
+ );
171
+ }, Et = ({ className: t, ...e }) => /* @__PURE__ */ n(
172
+ z,
173
+ {
174
+ className: f("tw:rounded-sm tw:w-4 tw:h-4 tw:checked:bg-(image:--tick) tw:bg-center", t),
175
+ ...e
176
+ }
177
+ ), H = ({ onClick: t, label: e = "Close" }) => /* @__PURE__ */ n(
154
178
  "button",
155
179
  {
156
180
  onClick: t,
157
- className: a(
181
+ className: s(
158
182
  "tw:opacity-50 tw:highlight:opacity-80 tw:transition-opacity",
159
183
  "tw:rounded-md tw:focus-ring"
160
184
  ),
161
- "aria-label": r,
162
- children: /* @__PURE__ */ n(h, { icon: U, size: "xl" })
185
+ "aria-label": e,
186
+ children: /* @__PURE__ */ n(b, { icon: X, size: "xl" })
163
187
  }
164
- ), j = ({
188
+ ), A = ({
165
189
  borderless: t = !1,
166
- size: r = "md",
167
- feedback: e,
190
+ size: e = "md",
191
+ feedback: r,
168
192
  className: o,
169
193
  disabled: d,
170
- readOnly: l,
171
- ...s
194
+ readOnly: a,
195
+ ...l
172
196
  }) => {
173
- const i = !d && !l;
197
+ const w = !d && !a;
174
198
  return /* @__PURE__ */ n(
175
199
  "input",
176
200
  {
177
- className: a(
201
+ className: s(
178
202
  "tw:w-full",
179
203
  {
180
- "tw:focus-ring": !e,
181
- "tw:focus-ring-danger": e === "error"
204
+ "tw:focus-ring": !r,
205
+ "tw:focus-ring-danger": r === "error"
182
206
  },
183
207
  {
184
- "tw:px-2 tw:py-1 tw:text-sm": r === "sm",
185
- "tw:px-3 tw:py-1.5": r === "md",
186
- "tw:px-4 tw:py-2 tw:text-xl": r === "lg"
208
+ "tw:px-2 tw:py-1 tw:text-sm": e === "sm",
209
+ "tw:px-3 tw:py-1.5": e === "md",
210
+ "tw:px-4 tw:py-2 tw:text-xl": e === "lg"
187
211
  },
188
212
  {
189
213
  "tw:rounded-md tw:border": !t,
190
- "tw:border-lm-input-border tw:dark:border-dm-input-border": !t && !e,
191
- "tw:border-danger": !t && e === "error",
192
- "tw:bg-lm-disabled-input tw:dark:bg-dm-disabled-input": !i,
193
- "tw:bg-lm-primary tw:dark:bg-dm-primary": i,
214
+ "tw:border-lm-input-border tw:dark:border-dm-input-border": !t && !r,
215
+ "tw:border-danger": !t && r === "error",
216
+ "tw:bg-lm-disabled-input tw:dark:bg-dm-disabled-input": !w,
217
+ "tw:bg-lm-primary tw:dark:bg-dm-primary": w,
194
218
  // Use different background color when rendered inside a card
195
- "tw:group-[&]/card:bg-lm-input tw:group-[&]/card:dark:bg-dm-input": i
219
+ "tw:group-[&]/card:bg-lm-input tw:group-[&]/card:dark:bg-dm-input": w
196
220
  },
197
221
  o
198
222
  ),
199
223
  disabled: d,
200
- readOnly: l,
201
- ...s
224
+ readOnly: a,
225
+ ...l
202
226
  }
203
227
  );
204
- }, H = ({ required: t, children: r, ...e }) => /* @__PURE__ */ w("label", { ...e, children: [
205
- r,
228
+ }, W = ({ required: t, children: e, ...r }) => /* @__PURE__ */ i("label", { ...r, children: [
229
+ e,
206
230
  t && /* @__PURE__ */ n("span", { className: "tw:text-danger tw:ml-1", "data-testid": "required-indicator", children: "*" })
207
- ] }), yt = ({ label: t, inputClassName: r, required: e, hiddenRequired: o, error: d, ...l }) => {
208
- const s = R();
209
- return /* @__PURE__ */ w("div", { className: "tw:flex tw:flex-col tw:gap-1", children: [
210
- /* @__PURE__ */ n(H, { htmlFor: s, required: e, children: t }),
231
+ ] }), Mt = ({ label: t, inputClassName: e, required: r, hiddenRequired: o, error: d, ...a }) => {
232
+ const l = $();
233
+ return /* @__PURE__ */ i("div", { className: "tw:flex tw:flex-col tw:gap-1", children: [
234
+ /* @__PURE__ */ n(W, { htmlFor: l, required: r, children: t }),
211
235
  /* @__PURE__ */ n(
212
- j,
236
+ A,
213
237
  {
214
- id: s,
215
- className: r,
216
- required: e || o,
238
+ id: l,
239
+ className: e,
240
+ required: r || o,
217
241
  feedback: d ? "error" : void 0,
218
- ...l
242
+ ...a
219
243
  }
220
244
  ),
221
245
  d && /* @__PURE__ */ n("span", { className: "tw:text-danger", children: d })
222
246
  ] });
223
- }, V = String.raw`data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/></svg>`, X = ({
247
+ }, at = ({
224
248
  className: t,
225
- size: r = "md",
226
- feedback: e,
249
+ size: e = "md",
250
+ feedback: r,
227
251
  style: o = {},
228
252
  disabled: d,
229
- ...l
253
+ ...a
230
254
  }) => /* @__PURE__ */ n(
231
255
  "select",
232
256
  {
233
- className: a(
234
- "tw:w-full tw:appearance-none tw:pr-9 tw:bg-no-repeat",
257
+ className: s(
258
+ "tw:w-full tw:appearance-none tw:pr-9",
259
+ "tw:bg-(image:--chevron-down) tw:bg-no-repeat",
235
260
  {
236
- "tw:focus-ring": !e,
237
- "tw:focus-ring-danger": e === "error"
261
+ "tw:focus-ring": !r,
262
+ "tw:focus-ring-danger": r === "error"
238
263
  },
239
264
  "tw:rounded-md tw:border",
240
265
  {
241
- "tw:border-lm-input-border tw:dark:border-dm-input-border": !e,
242
- "tw:border-danger": e === "error"
266
+ "tw:border-lm-input-border tw:dark:border-dm-input-border": !r,
267
+ "tw:border-danger": r === "error"
243
268
  },
244
269
  {
245
- "tw:pl-2 tw:py-1 tw:text-sm": r === "sm",
246
- "tw:pl-3 tw:py-1.5": r === "md",
247
- "tw:pl-4 tw:py-2 tw:text-xl": r === "lg",
270
+ "tw:pl-2 tw:py-1 tw:text-sm": e === "sm",
271
+ "tw:pl-3 tw:py-1.5": e === "md",
272
+ "tw:pl-4 tw:py-2 tw:text-xl": e === "lg",
248
273
  "tw:bg-lm-disabled-input tw:dark:bg-dm-disabled-input": d,
249
274
  // Apply different background color when rendered inside a card
250
275
  "tw:bg-lm-primary tw:dark:bg-dm-primary tw:group-[&]/card:bg-lm-input tw:group-[&]/card:dark:bg-dm-input": !d
@@ -253,50 +278,48 @@ const f = L(void 0), u = L({ responsive: !0 }), O = ({ children: t, className: r
253
278
  ),
254
279
  style: {
255
280
  ...o,
256
- backgroundImage: `url("${V}")`,
257
- backgroundSize: "16px 12px",
258
- backgroundPosition: "right 0.75rem center"
281
+ background: "right 0.75rem center / 16px 12px"
259
282
  },
260
283
  disabled: d,
261
- ...l
284
+ ...a
262
285
  }
263
- ), kt = ({ selectClassName: t, label: r, required: e, hiddenRequired: o, ...d }) => {
264
- const l = R();
265
- return /* @__PURE__ */ w("div", { className: "tw:flex tw:flex-col tw:gap-1", children: [
266
- /* @__PURE__ */ n(H, { htmlFor: l, required: e, children: r }),
267
- /* @__PURE__ */ n(X, { id: l, className: t, required: e || o, ...d })
286
+ ), _t = ({ selectClassName: t, label: e, required: r, hiddenRequired: o, ...d }) => {
287
+ const a = $();
288
+ return /* @__PURE__ */ i("div", { className: "tw:flex tw:flex-col tw:gap-1", children: [
289
+ /* @__PURE__ */ n(W, { htmlFor: a, required: r, children: e }),
290
+ /* @__PURE__ */ n(at, { id: a, className: t, required: r || o, ...d })
268
291
  ] });
269
292
  };
270
- function Y(t, r = globalThis.setTimeout.bind(globalThis), e = globalThis.clearTimeout.bind(globalThis)) {
271
- const o = M(null), d = k(() => {
272
- o.current && e(o.current);
273
- }, [e]), l = k((s, i) => {
274
- d(), o.current = r(() => {
275
- s(), o.current = null;
276
- }, i ?? t);
277
- }, [d, t, r]);
278
- return E(() => d, [d]), T(
279
- () => ({ setTimeout: l, clearCurrentTimeout: d }),
280
- [d, l]
293
+ function st(t, e = globalThis.setTimeout.bind(globalThis), r = globalThis.clearTimeout.bind(globalThis)) {
294
+ const o = R(null), d = N(() => {
295
+ o.current && r(o.current);
296
+ }, [r]), a = N((l, w) => {
297
+ d(), o.current = e(() => {
298
+ l(), o.current = null;
299
+ }, w ?? t);
300
+ }, [d, t, e]);
301
+ return T(() => d, [d]), E(
302
+ () => ({ setTimeout: a, clearCurrentTimeout: d }),
303
+ [d, a]
281
304
  );
282
305
  }
283
- const vt = ({
306
+ const jt = ({
284
307
  onChange: t,
285
- containerClassName: r,
286
- inputClassName: e,
308
+ containerClassName: e,
309
+ inputClassName: r,
287
310
  // Inputs have a default 'md' size. Search inputs are usually 'lg' as they are rendered at the top of sections
288
311
  size: o = "lg",
289
312
  ...d
290
313
  }) => {
291
- const { setTimeout: l, clearCurrentTimeout: s } = Y(500), i = k((c) => {
292
- c ? l(() => t(c)) : (s(), t(c));
293
- }, [s, t, l]);
294
- return /* @__PURE__ */ w("div", { className: a("tw:group tw:relative tw:focus-within:z-10", r), children: [
314
+ const { setTimeout: a, clearCurrentTimeout: l } = st(500), w = N((c) => {
315
+ c ? a(() => t(c)) : (l(), t(c));
316
+ }, [l, t, a]);
317
+ return /* @__PURE__ */ i("div", { className: s("tw:group tw:relative tw:focus-within:z-10", e), children: [
295
318
  /* @__PURE__ */ n(
296
- h,
319
+ b,
297
320
  {
298
- icon: A,
299
- className: a(
321
+ icon: Y,
322
+ className: s(
300
323
  "tw:absolute tw:top-[50%] tw:translate-y-[-50%] tw:transition-colors",
301
324
  "tw:text-placeholder tw:group-focus-within:text-lm-text tw:dark:group-focus-within:text-dm-text",
302
325
  {
@@ -307,214 +330,275 @@ const vt = ({
307
330
  }
308
331
  ),
309
332
  /* @__PURE__ */ n(
310
- j,
333
+ A,
311
334
  {
312
335
  type: "search",
313
- className: a(
336
+ className: s(
314
337
  {
315
338
  "tw:pl-9": o !== "sm",
316
339
  "tw:pl-7": o === "sm"
317
340
  },
318
- e
341
+ r
319
342
  ),
320
343
  placeholder: "Search...",
321
- onChange: (c) => i(c.target.value),
344
+ onChange: (c) => w(c.target.value),
322
345
  size: o,
323
346
  ...d
324
347
  }
325
348
  )
326
349
  ] });
327
- }, Z = ({ className: t, disabled: r, size: e = "md", ...o }) => /* @__PURE__ */ n(
350
+ }, Dt = ({ className: t, ...e }) => /* @__PURE__ */ n(
351
+ z,
352
+ {
353
+ className: f(
354
+ "tw:rounded-full tw:w-8 tw:h-4",
355
+ "tw:bg-(image:--circle-grey-dark) tw:dark:bg-(image:--circle-grey-light) tw:checked:bg-(image:--circle-white)",
356
+ "tw:focus-visible:not-checked:bg-(image:--circle-light-blue)",
357
+ "tw:checked:bg-right tw:transition-[background-position]",
358
+ t
359
+ ),
360
+ ...e
361
+ }
362
+ ), wt = ({ className: t, disabled: e, size: r = "md", ...o }) => /* @__PURE__ */ n(
328
363
  "button",
329
364
  {
330
- className: a(
365
+ className: s(
331
366
  "tw:inline-flex tw:rounded-md tw:focus-ring",
332
367
  "tw:text-brand tw:highlight:text-brand-dark tw:highlight:underline",
333
368
  {
334
- "tw:px-1.5 tw:py-1 tw:text-sm": e === "sm",
335
- "tw:px-3 tw:py-1.5": e === "md",
336
- "tw:px-4 tw:py-2 tw:text-lg": e === "lg",
337
- "tw:pointer-events-none tw:opacity-65": r
369
+ "tw:px-1.5 tw:py-1 tw:text-sm": r === "sm",
370
+ "tw:px-3 tw:py-1.5": r === "md",
371
+ "tw:px-4 tw:py-2 tw:text-lg": r === "lg",
372
+ "tw:pointer-events-none tw:opacity-65": e
338
373
  },
339
374
  t
340
375
  ),
341
- disabled: r,
376
+ disabled: e,
342
377
  ...o
343
378
  }
344
- ), tt = new Intl.NumberFormat("en-US"), rt = (t) => tt.format(Number(t)), F = 10, Nt = (t) => Math.ceil(t / F) * F, b = 2, v = "...", et = (t, r) => Array.from({ length: r - t }, (e, o) => t + o), ot = (t, r) => {
345
- const e = et(
346
- Math.max(b, t - b),
347
- Math.min(r - 1, t + b) + 1
348
- );
349
- return t - b > b && e.unshift(v), t + b < r - 1 && e.push(v), e.unshift(1), e.push(r), e;
350
- }, p = (t) => t === v, nt = (t) => p(t) ? t : rt(t), dt = (t, r) => p(t) ? `${t}_${r}` : `${t}`, z = [
351
- "tw:border tw:border-r-0 tw:last:border-r tw:border-lm-border tw:dark:border-dm-border",
352
- "tw:rounded-none tw:first:rounded-l tw:last:rounded-r"
353
- ], D = (t = !1) => a(
354
- z,
355
- "tw:px-3 py-2 tw:cursor-pointer tw:no-underline",
356
- "tw:focus-ring tw:focus-visible:z-1",
357
- {
358
- "tw:highlight:bg-lm-secondary tw:dark:highlight:bg-dm-secondary tw:text-brand": !t,
359
- "tw:bg-lm-brand tw:dark:bg-dm-brand tw:text-white": t
360
- }
361
- ), C = ({ children: t }) => /* @__PURE__ */ n("span", { "aria-hidden": !0, className: a(z, "tw:px-3 py-2 tw:text-gray-400"), children: t }), $ = () => /* @__PURE__ */ n(C, { children: v });
362
- function lt({ children: t, active: r, isEllipsis: e, href: o, ...d }) {
363
- const l = T(() => D(r), [r]);
364
- return e ? /* @__PURE__ */ n($, {}) : /* @__PURE__ */ n(_, { className: l, to: o, ...d, children: t });
365
- }
366
- function st({ children: t, active: r, isEllipsis: e, ...o }) {
367
- const d = T(() => D(r), [r]);
368
- return e ? /* @__PURE__ */ n($, {}) : /* @__PURE__ */ n("button", { type: "button", className: d, ...o, children: t });
369
- }
370
- const Ct = ({ currentPage: t, pagesCount: r, ...e }) => {
371
- const o = "urlForPage" in e, d = o ? lt : st, l = k(
372
- (s) => o ? { href: p(s) ? void 0 : e.urlForPage(s) } : { onClick: () => !p(s) && e.onPageChange(s) },
373
- [o, e]
374
- );
375
- return r < 2 ? null : /* @__PURE__ */ w("div", { className: "tw:select-none tw:flex", "data-testid": "paginator", children: [
376
- t === 1 ? /* @__PURE__ */ n(C, { children: /* @__PURE__ */ n(h, { size: "xs", icon: P }) }) : /* @__PURE__ */ n(d, { ...l(Math.max(1, t - 1)), "aria-label": "Previous", children: /* @__PURE__ */ n(h, { size: "xs", icon: P }) }),
377
- ot(t, r).map((s, i) => /* @__PURE__ */ n(
378
- d,
379
- {
380
- active: s === t,
381
- isEllipsis: p(s),
382
- ...l(s),
383
- children: nt(s)
384
- },
385
- dt(s, i)
386
- )),
387
- t === r ? /* @__PURE__ */ n(C, { children: /* @__PURE__ */ n(h, { size: "xs", icon: B }) }) : /* @__PURE__ */ n(d, { ...l(Math.min(r, t + 1)), "aria-label": "Next", children: /* @__PURE__ */ n(h, { size: "xs", icon: B }) })
388
- ] });
389
- }, at = ({ className: t, ...r }) => /* @__PURE__ */ n(
379
+ ), it = ({ className: t, ...e }) => /* @__PURE__ */ n(
390
380
  "div",
391
381
  {
392
- className: a(
382
+ className: s(
393
383
  "tw:px-4 tw:py-3 tw:rounded-t-md",
394
384
  "tw:bg-lm-primary tw:dark:bg-dm-primary tw:border-b tw:border-lm-border tw:dark:border-dm-border",
395
385
  t
396
386
  ),
397
- ...r
387
+ ...e
398
388
  }
399
- ), it = ({ className: t, ...r }) => /* @__PURE__ */ n(
389
+ ), ct = ({ className: t, ...e }) => /* @__PURE__ */ n(
400
390
  "div",
401
391
  {
402
- className: a(
392
+ className: s(
403
393
  "tw:p-4 tw:bg-lm-primary tw:dark:bg-dm-primary tw:first:rounded-t-md",
404
394
  "tw:first:rounded-t-md tw:last:rounded-b-md",
405
395
  t
406
396
  ),
407
- ...r
397
+ ...e
408
398
  }
409
- ), wt = ({ className: t, ...r }) => /* @__PURE__ */ n(
399
+ ), mt = ({ className: t, ...e }) => /* @__PURE__ */ n(
410
400
  "div",
411
401
  {
412
- className: a(
402
+ className: s(
413
403
  "tw:px-4 tw:py-3 tw:rounded-b-md",
414
404
  "tw:bg-lm-primary tw:dark:bg-dm-primary tw:border-t tw:border-lm-border tw:dark:border-dm-border",
415
405
  t
416
406
  ),
417
- ...r
407
+ ...e
418
408
  }
419
- ), ct = ({ className: t, ...r }) => /* @__PURE__ */ n(
409
+ ), gt = ({ className: t, ...e }) => /* @__PURE__ */ n(
420
410
  "div",
421
411
  {
422
- className: a(
412
+ className: s(
423
413
  "tw:group/card tw:rounded-md tw:shadow-md",
424
414
  "tw:border tw:border-lm-border tw:dark:border-dm-border tw:bg-lm-primary tw:dark:bg-dm-primary",
425
415
  t
426
416
  ),
427
- ...r
417
+ ...e
428
418
  }
429
- ), m = Object.assign(ct, { Body: it, Header: at, Footer: wt }), Tt = ({ bodyClassName: t, children: r, ...e }) => {
430
- const { title: o, titleSize: d = "md", ...l } = "title" in e ? e : {
431
- ...e,
419
+ ), m = Object.assign(gt, { Body: ct, Header: it, Footer: mt }), bt = ({ bodyClassName: t, children: e, ...r }) => {
420
+ const { title: o, titleSize: d = "md", ...a } = "title" in r ? r : {
421
+ ...r,
432
422
  title: void 0,
433
423
  titleSize: void 0
434
424
  };
435
- return /* @__PURE__ */ w(m, { ...l, children: [
436
- o && /* @__PURE__ */ w(m.Header, { children: [
425
+ return /* @__PURE__ */ i(m, { ...a, children: [
426
+ o && /* @__PURE__ */ i(m.Header, { children: [
437
427
  d === "lg" && /* @__PURE__ */ n("h4", { children: o }),
438
428
  d === "md" && /* @__PURE__ */ n("h5", { children: o }),
439
429
  d === "sm" && /* @__PURE__ */ n("h6", { children: o })
440
430
  ] }),
441
- /* @__PURE__ */ n(m.Body, { className: t, children: r })
431
+ /* @__PURE__ */ n(m.Body, { className: t, children: e })
442
432
  ] });
443
- }, mt = ({
433
+ }, q = F(null), ut = ({ className: t, to: e, ...r }) => {
434
+ const o = g(q);
435
+ return /* @__PURE__ */ n(
436
+ V,
437
+ {
438
+ role: "menuitem",
439
+ to: e,
440
+ className: ({ isActive: d }) => s(
441
+ "tw:px-4 tw:pt-2 tw:pb-[calc(0.5rem-3px)] tw:border-b-3",
442
+ "tw:font-bold tw:no-underline tw:text-center tw:highlight:text-brand tw:transition-colors",
443
+ "tw:rounded-none tw:outline-none tw:focus-visible:inset-ring-2 tw:focus-visible:inset-ring-brand/50",
444
+ {
445
+ "tw:border-b-brand active": d,
446
+ "tw:border-b-transparent tw:text-gray-500": !d,
447
+ "tw:flex-grow": o == null ? void 0 : o.fill
448
+ },
449
+ t
450
+ ),
451
+ ...r
452
+ }
453
+ );
454
+ }, ht = ({ children: t, className: e, fill: r }) => /* @__PURE__ */ n(q.Provider, { value: { fill: r }, children: /* @__PURE__ */ n(m, { role: "menubar", className: s("tw:flex tw:overflow-hidden", e), children: t }) }), Ht = Object.assign(ht, { Pill: ut }), pt = new Intl.NumberFormat("en-US"), ft = (t) => pt.format(Number(t)), O = 10, Ot = (t) => Math.ceil(t / O) * O, p = 2, I = "...", xt = (t, e) => Array.from({ length: e - t }, (r, o) => t + o), yt = (t, e) => {
455
+ const r = xt(
456
+ Math.max(p, t - p),
457
+ Math.min(e - 1, t + p) + 1
458
+ );
459
+ return t - p > p && r.unshift(I), t + p < e - 1 && r.push(I), r.unshift(1), r.push(e), r;
460
+ }, k = (t) => t === I, kt = (t) => k(t) ? t : ft(t), Nt = (t, e) => k(t) ? `${t}_${e}` : `${t}`, G = [
461
+ "tw:border tw:border-r-0 tw:last:border-r tw:border-lm-border tw:dark:border-dm-border",
462
+ "tw:rounded-none tw:first:rounded-l tw:last:rounded-r"
463
+ ], J = (t = !1) => s(
464
+ G,
465
+ "tw:px-3 py-2 tw:cursor-pointer tw:no-underline",
466
+ "tw:focus-ring tw:focus-visible:z-1",
467
+ {
468
+ "tw:highlight:bg-lm-secondary tw:dark:highlight:bg-dm-secondary tw:text-brand": !t,
469
+ "tw:bg-lm-brand tw:dark:bg-dm-brand tw:text-white": t
470
+ }
471
+ ), S = ({ children: t }) => /* @__PURE__ */ n("span", { "aria-hidden": !0, className: s(G, "tw:px-3 py-2 tw:text-gray-400"), children: t }), K = () => /* @__PURE__ */ n(S, { children: I });
472
+ function vt({ children: t, active: e, isEllipsis: r, href: o, ...d }) {
473
+ const a = E(() => J(e), [e]);
474
+ return r ? /* @__PURE__ */ n(K, {}) : /* @__PURE__ */ n(U, { className: a, to: o, ...d, children: t });
475
+ }
476
+ function Pt({ children: t, active: e, isEllipsis: r, ...o }) {
477
+ const d = E(() => J(e), [e]);
478
+ return r ? /* @__PURE__ */ n(K, {}) : /* @__PURE__ */ n("button", { type: "button", className: d, ...o, children: t });
479
+ }
480
+ const $t = ({ currentPage: t, pagesCount: e, ...r }) => {
481
+ const o = "urlForPage" in r, d = o ? vt : Pt, a = N(
482
+ (l) => o ? { href: k(l) ? void 0 : r.urlForPage(l) } : { onClick: () => !k(l) && r.onPageChange(l) },
483
+ [o, r]
484
+ );
485
+ return e < 2 ? null : /* @__PURE__ */ i("div", { className: "tw:select-none tw:flex", "data-testid": "paginator", children: [
486
+ t === 1 ? /* @__PURE__ */ n(S, { children: /* @__PURE__ */ n(b, { size: "xs", icon: j }) }) : /* @__PURE__ */ n(d, { ...a(Math.max(1, t - 1)), "aria-label": "Previous", children: /* @__PURE__ */ n(b, { size: "xs", icon: j }) }),
487
+ yt(t, e).map((l, w) => /* @__PURE__ */ n(
488
+ d,
489
+ {
490
+ active: l === t,
491
+ isEllipsis: k(l),
492
+ ...a(l),
493
+ children: kt(l)
494
+ },
495
+ Nt(l, w)
496
+ )),
497
+ t === e ? /* @__PURE__ */ n(S, { children: /* @__PURE__ */ n(b, { size: "xs", icon: D }) }) : /* @__PURE__ */ n(d, { ...a(Math.min(e, t + 1)), "aria-label": "Next", children: /* @__PURE__ */ n(b, { size: "xs", icon: D }) })
498
+ ] });
499
+ }, Ct = ({
444
500
  open: t,
445
- children: r,
446
- className: e,
447
- ...o
501
+ children: e,
502
+ className: r,
503
+ onClose: o,
504
+ ...d
448
505
  }) => {
449
- const d = M(null);
450
- return E(() => {
451
- var c, x;
452
- const l = document.body, s = l.style.overflow, i = l.style.paddingRight;
506
+ const a = R(null);
507
+ return T(() => {
508
+ var P, y;
509
+ const l = document.body, w = l.style.overflow, c = l.style.paddingRight;
453
510
  if (t) {
454
- const y = window.outerWidth - l.clientWidth, N = l.scrollHeight > l.clientHeight;
455
- l.style.overflow = "hidden", N && (l.style.paddingRight = `${y}px`), (c = d.current) == null || c.showModal();
511
+ const L = window.outerWidth - l.clientWidth, u = l.scrollHeight > l.clientHeight;
512
+ l.style.overflow = "hidden", u && (l.style.paddingRight = `${L}px`), (P = a.current) == null || P.showModal();
456
513
  } else
457
- (x = d.current) == null || x.close();
514
+ (y = a.current) == null || y.close();
458
515
  return () => {
459
- l.style.overflow = s, l.style.paddingRight = i;
516
+ l.style.overflow = w, l.style.paddingRight = c;
460
517
  };
461
518
  }, [t]), /* @__PURE__ */ n(
462
519
  "dialog",
463
520
  {
464
- ref: d,
465
- className: a("tw:bg-transparent tw:backdrop:bg-black/50", e),
466
- ...o,
467
- children: t && r
521
+ ref: a,
522
+ className: s("tw:bg-transparent tw:backdrop:bg-black/50", r),
523
+ onCancel: (l) => {
524
+ l.preventDefault(), o();
525
+ },
526
+ ...d,
527
+ children: t && e
468
528
  }
469
529
  );
470
- }, It = ({
530
+ }, Ut = ({
471
531
  open: t,
472
- onClose: r,
473
- variant: e = "default",
532
+ onClose: e,
533
+ variant: r = "default",
474
534
  title: o,
475
535
  children: d,
476
- className: l,
477
- ...s
536
+ className: a,
537
+ ...l
478
538
  }) => {
479
539
  const {
480
- size: i = "md",
540
+ size: w = "md",
481
541
  confirmText: c = "Confirm",
482
- confirmDisabled: x,
542
+ confirmDisabled: P,
483
543
  onConfirm: y,
484
- ...N
485
- } = "onConfirm" in s ? s : { ...s };
486
- return /* @__PURE__ */ n(
487
- mt,
544
+ ...L
545
+ } = "onConfirm" in l ? l : { ...l }, [u, M] = Q(t), C = R(null);
546
+ return T(() => {
547
+ if (t) {
548
+ M(!0);
549
+ return;
550
+ }
551
+ const h = C.current;
552
+ if (h) {
553
+ delete C.current.dataset.open;
554
+ const _ = () => M(!1);
555
+ return h.addEventListener("transitionend", _, { once: !0 }), () => {
556
+ h.removeEventListener("transitionend", _);
557
+ };
558
+ }
559
+ }, [t]), T(() => {
560
+ const h = C.current;
561
+ u && h && (h.dataset.open = "");
562
+ }, [u]), /* @__PURE__ */ n(
563
+ Ct,
488
564
  {
489
- open: t,
490
- onClose: r,
491
- className: a(
492
- { "tw:flex tw:w-screen tw:h-screen tw:max-w-screen tw:max-h-screen": t },
493
- l
565
+ open: u,
566
+ onClose: e,
567
+ className: s(
568
+ {
569
+ "tw:flex tw:w-screen tw:h-screen tw:max-w-screen tw:max-h-screen": u,
570
+ "tw:overflow-hidden": r === "cover"
571
+ },
572
+ a
494
573
  ),
495
- ...N,
574
+ ...L,
496
575
  children: /* @__PURE__ */ n(
497
576
  "div",
498
577
  {
499
- className: a("tw:m-auto tw:p-4", {
500
- "tw:w-full tw:h-full": e === "cover"
501
- }),
502
- children: /* @__PURE__ */ n(m, { className: a(
503
- "tw:w-full",
504
- e !== "cover" && {
505
- "tw:md:w-sm": i === "sm",
506
- "tw:md:w-lg": i === "md",
507
- "tw:md:w-4xl": i === "lg",
508
- "tw:md:w-6xl": i === "xl"
578
+ "data-testid": "transition-container",
579
+ ref: C,
580
+ className: s(
581
+ "tw:w-full tw:m-auto tw:p-4 tw:sm:p-6",
582
+ // CSS transitions are based on the presence of the `data-open` attribute
583
+ "tw:-translate-y-4 tw:data-open:translate-y-0 tw:opacity-0 tw:data-open:opacity-100",
584
+ "tw:transition-[opacity_transform] tw:duration-300",
585
+ // Handle modal dimensions for different variants and sizes
586
+ r !== "cover" && {
587
+ "tw:sm:w-sm": w === "sm",
588
+ "tw:md:w-lg": w === "md",
589
+ "tw:md:w-4xl": w === "lg",
590
+ "tw:md:w-6xl": w === "xl"
509
591
  },
510
- {
511
- "tw:h-full tw:overflow-auto tw:relative": e === "cover"
512
- }
513
- ), children: e === "cover" ? /* @__PURE__ */ w(I, { children: [
514
- /* @__PURE__ */ w(
592
+ { "tw:h-full": r === "cover" }
593
+ ),
594
+ children: /* @__PURE__ */ n(m, { className: s(
595
+ "tw:w-full",
596
+ { "tw:h-full tw:relative tw:overflow-auto": r === "cover" }
597
+ ), children: r === "cover" ? /* @__PURE__ */ i(B, { children: [
598
+ /* @__PURE__ */ i(
515
599
  "div",
516
600
  {
517
- className: a(
601
+ className: s(
518
602
  "tw:px-4 tw:py-3 tw:absolute tw:top-0 tw:left-0 tw:right-0",
519
603
  "tw:flex tw:items-center tw:justify-between",
520
604
  "tw:text-white tw:bg-linear-to-b tw:from-black/70 tw:to-black/10",
@@ -522,34 +606,40 @@ const Ct = ({ currentPage: t, pagesCount: r, ...e }) => {
522
606
  ),
523
607
  children: [
524
608
  /* @__PURE__ */ n("h5", { children: o }),
525
- /* @__PURE__ */ n(S, { onClick: r, label: "Close dialog" })
609
+ /* @__PURE__ */ n(H, { onClick: e, label: "Close dialog" })
526
610
  ]
527
611
  }
528
612
  ),
529
613
  /* @__PURE__ */ n("div", { children: d })
530
- ] }) : /* @__PURE__ */ w(I, { children: [
531
- /* @__PURE__ */ w(m.Header, { className: "tw:flex tw:items-center tw:justify-between tw:sticky tw:top-0", children: [
532
- /* @__PURE__ */ n("h5", { className: a({ "tw:text-danger": e === "danger" }), children: o }),
533
- /* @__PURE__ */ n(S, { onClick: r, label: "Close dialog" })
614
+ ] }) : /* @__PURE__ */ i(B, { children: [
615
+ /* @__PURE__ */ i(m.Header, { className: s(
616
+ "tw:sticky tw:top-0",
617
+ "tw:flex tw:items-center tw:justify-between tw:gap-x-2"
618
+ ), children: [
619
+ /* @__PURE__ */ n("h5", { className: s({ "tw:text-danger": r === "danger" }), children: o }),
620
+ /* @__PURE__ */ n(H, { onClick: e, label: "Close dialog" })
534
621
  ] }),
535
622
  /* @__PURE__ */ n(m.Body, { children: d }),
536
- y && /* @__PURE__ */ w(
623
+ y && /* @__PURE__ */ i(
537
624
  m.Footer,
538
625
  {
539
626
  "data-testid": "footer",
540
- className: "tw:flex tw:flex-row-reverse tw:gap-x-2 tw:items-center tw:[&]:px-3 tw:sticky tw:bottom-0",
627
+ className: s(
628
+ "tw:flex tw:justify-end tw:items-center tw:gap-x-2",
629
+ "tw:[&]:px-3 tw:sticky tw:bottom-0"
630
+ ),
541
631
  children: [
632
+ /* @__PURE__ */ n(wt, { onClick: e, children: "Cancel" }),
542
633
  /* @__PURE__ */ n(
543
- Q,
634
+ lt,
544
635
  {
545
636
  solid: !0,
546
- variant: e === "danger" ? "danger" : "primary",
547
- disabled: x,
637
+ variant: r === "danger" ? "danger" : "primary",
638
+ disabled: P,
548
639
  onClick: y,
549
640
  children: c
550
641
  }
551
- ),
552
- /* @__PURE__ */ n(Z, { onClick: r, children: "Cancel" })
642
+ )
553
643
  ]
554
644
  }
555
645
  )
@@ -558,29 +648,61 @@ const Ct = ({ currentPage: t, pagesCount: r, ...e }) => {
558
648
  )
559
649
  }
560
650
  );
561
- };
651
+ }, zt = ({ className: t, children: e, loading: r = !1, variant: o = "default" }) => /* @__PURE__ */ n(bt, { className: f({ "tw:[&]:border-danger": o === "error" }, t), children: /* @__PURE__ */ i("h3", { className: f("tw:text-center", {
652
+ "tw:text-gray-500 tw:dark:text-gray-400": o === "default",
653
+ "tw:text-danger": o === "error"
654
+ }), children: [
655
+ r && /* @__PURE__ */ i(B, { children: [
656
+ /* @__PURE__ */ n(b, { icon: Z, spin: !0 }),
657
+ /* @__PURE__ */ n("span", { className: "tw:ml-2", children: e ?? "Loading..." })
658
+ ] }),
659
+ !r && e
660
+ ] }) }), At = ({ variant: t, className: e, size: r = "md", children: o }) => /* @__PURE__ */ n(
661
+ "div",
662
+ {
663
+ className: f(
664
+ "tw:rounded-md tw:text-center",
665
+ {
666
+ "tw:p-2": r === "sm",
667
+ "tw:p-4": r === "md",
668
+ "tw:p-6": r === "lg",
669
+ "tw:[&]:text-white": t !== "warning",
670
+ "tw:bg-brand": t === "success",
671
+ "tw:bg-danger": t === "error",
672
+ "tw:bg-warning tw:text-black": t === "warning"
673
+ },
674
+ e
675
+ ),
676
+ children: o
677
+ }
678
+ );
562
679
  export {
563
- Q as Button,
680
+ lt as Button,
564
681
  m as Card,
565
- It as CardModal,
566
- S as CloseButton,
567
- v as ELLIPSIS,
568
- j as Input,
569
- H as Label,
570
- yt as LabelledInput,
571
- kt as LabelledSelect,
572
- Z as LinkButton,
573
- mt as ModalDialog,
574
- Ct as Paginator,
575
- vt as SearchInput,
576
- X as Select,
577
- Tt as SimpleCard,
578
- xt as Table,
579
- rt as formatNumber,
580
- dt as keyForPage,
581
- p as pageIsEllipsis,
582
- nt as prettifyPageNumber,
583
- ot as progressivePagination,
584
- Nt as roundTen,
585
- Y as useTimeout
682
+ Ut as CardModal,
683
+ Et as Checkbox,
684
+ H as CloseButton,
685
+ I as ELLIPSIS,
686
+ A as Input,
687
+ W as Label,
688
+ Mt as LabelledInput,
689
+ _t as LabelledSelect,
690
+ wt as LinkButton,
691
+ zt as Message,
692
+ Ct as ModalDialog,
693
+ Ht as NavPills,
694
+ $t as Paginator,
695
+ At as Result,
696
+ jt as SearchInput,
697
+ at as Select,
698
+ bt as SimpleCard,
699
+ Rt as Table,
700
+ Dt as ToggleSwitch,
701
+ ft as formatNumber,
702
+ Nt as keyForPage,
703
+ k as pageIsEllipsis,
704
+ kt as prettifyPageNumber,
705
+ yt as progressivePagination,
706
+ Ot as roundTen,
707
+ st as useTimeout
586
708
  };
@@ -89,6 +89,18 @@
89
89
  @layer base {
90
90
  :root {
91
91
  --header-height: 56px;
92
+
93
+ /* Chevron image for selects */
94
+ --chevron-down: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/></svg>");
95
+ /* Tick image for checkboxes */
96
+ --tick: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'><path fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/></svg>");
97
+
98
+ /* Circle images for toggle switches */
99
+ --circle-grey-dark: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'><circle r='3' fill='rgba%280, 0, 0, 0.25%29'/></svg>");
100
+ --circle-grey-light: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'><circle r='3' fill='rgba%28255, 255, 255, 0.25%29'/></svg>");
101
+ --circle-white: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'><circle r='3' fill='%23fff'/></svg>");
102
+ --circle-light-blue: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'><circle r='3' fill='%2386b7fe'/></svg>");
103
+
92
104
  @apply tw:scheme-normal tw:dark:scheme-dark tw:scroll-auto;
93
105
  }
94
106
 
package/package.json CHANGED
@@ -30,7 +30,7 @@
30
30
  "test": "vitest run",
31
31
  "test:ci": "npm run test -- --coverage",
32
32
  "lint": "eslint dev src test",
33
- "lint:fix": "npm run lint:js -- --fix",
33
+ "lint:fix": "npm run lint -- --fix",
34
34
  "types": "tsc",
35
35
  "dev": "vite serve --host=0.0.0.0 --port 3001"
36
36
  },
@@ -53,9 +53,9 @@
53
53
  }
54
54
  },
55
55
  "devDependencies": {
56
- "@shlinkio/eslint-config-js-coding-standard": "~3.4.0",
56
+ "@shlinkio/eslint-config-js-coding-standard": "~3.5.0",
57
57
  "@stylistic/eslint-plugin": "^4.2.0",
58
- "@tailwindcss/vite": "^4.0.16",
58
+ "@tailwindcss/vite": "^4.0.17",
59
59
  "@testing-library/jest-dom": "^6.6.3",
60
60
  "@testing-library/react": "^16.2.0",
61
61
  "@testing-library/user-event": "^14.6.1",
@@ -67,9 +67,10 @@
67
67
  "axe-core": "^4.10.3",
68
68
  "bootstrap": "5.2.3",
69
69
  "eslint": "^9.23.0",
70
+ "eslint-plugin-import": "^2.31.0",
70
71
  "eslint-plugin-jsx-a11y": "^6.10.2",
71
72
  "eslint-plugin-react": "^7.37.4",
72
- "eslint-plugin-react-compiler": "^19.0.0-beta-714736e-20250131",
73
+ "eslint-plugin-react-compiler": "^19.0.0-beta-aeaed83-20250323",
73
74
  "eslint-plugin-react-hooks": "^5.2.0",
74
75
  "eslint-plugin-simple-import-sort": "^12.1.1",
75
76
  "history": "^5.3.0",
@@ -78,7 +79,7 @@
78
79
  "sass": "^1.86.0",
79
80
  "typescript": "^5.8.2",
80
81
  "typescript-eslint": "^8.27.0",
81
- "vite": "^6.2.2",
82
+ "vite": "^6.2.3",
82
83
  "vite-plugin-dts": "^4.5.3",
83
84
  "vitest": "^3.0.2"
84
85
  },
@@ -88,5 +89,5 @@
88
89
  "not ie <= 11",
89
90
  "not op_mini all"
90
91
  ],
91
- "version": "0.8.2"
92
+ "version": "0.8.3"
92
93
  }