@shlinkio/shlink-frontend-kit 0.8.2 → 0.8.4

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
@@ -16,6 +16,8 @@ declare type BooleanControlProps = PropsWithChildren<{
16
16
  inline?: boolean;
17
17
  }>;
18
18
 
19
+ export declare type Callback = () => unknown;
20
+
19
21
  export declare const changeThemeInMarkup: (theme: Theme) => void | undefined;
20
22
 
21
23
  export declare const Checkbox: FC<BooleanControlProps>;
@@ -191,7 +193,7 @@ export declare type Theme = 'dark' | 'light';
191
193
 
192
194
  export declare type TimeoutToggle = typeof useTimeoutToggle;
193
195
 
194
- declare type ToggleResult = [boolean, () => void, () => void, () => void];
196
+ export declare type ToggleResult = [boolean, () => void, () => void, () => void];
195
197
 
196
198
  export declare const ToggleSwitch: FC<BooleanControlProps>;
197
199
 
@@ -203,7 +205,23 @@ export declare const useParsedQuery: <T>() => T;
203
205
 
204
206
  export declare const useTheme: (initialTheme?: Theme) => readonly [Theme, Dispatch<SetStateAction<Theme>>];
205
207
 
206
- export declare const useTimeoutToggle: (initialValue?: boolean, delay?: number, setTimeout?: ((handler: TimerHandler, timeout?: number, ...arguments: any[]) => number) & typeof globalThis.setTimeout, clearTimeout?: ((id: number | undefined) => void) & typeof globalThis.clearTimeout) => [boolean, () => void];
208
+ export declare function useTimeout(defaultDelay: number,
209
+ /** Test seam. Defaults to global setTimeout */
210
+ setTimeout_?: typeof globalThis.setTimeout,
211
+ /** Test seam. Defaults to global clearTimeout */
212
+ clearTimeout_?: typeof clearTimeout): UseTimeoutResult;
213
+
214
+ export declare type UseTimeoutResult = {
215
+ /**
216
+ * Clears any in-progress timeout, and schedules a new callback.
217
+ * It optionally allows a delay to be provided, or falls back to the default delay otherwise.
218
+ */
219
+ setTimeout: (callback: Callback, delay?: number) => void;
220
+ /** Clears any in-progress timeout */
221
+ clearCurrentTimeout: () => void;
222
+ };
223
+
224
+ export declare const useTimeoutToggle: (initialValue?: boolean, delay?: number, setTimeout_?: typeof setTimeout, clearTimeout_?: typeof clearTimeout) => [boolean, () => void];
207
225
 
208
226
  export declare const useToggle: (initialValue?: boolean) => ToggleResult;
209
227
 
package/dist/index.js CHANGED
@@ -1,17 +1,18 @@
1
- import { jsx as o, jsxs as d, Fragment as N } from "react/jsx-runtime";
1
+ import { jsx as s, jsxs as d, Fragment as N } from "react/jsx-runtime";
2
2
  import { faCircleNotch as I, faSearch as A, faEllipsisV as E, faSortAmountUp as F, faSortAmountDown as P } from "@fortawesome/free-solid-svg-icons";
3
- import { FontAwesomeIcon as w } from "@fortawesome/react-fontawesome";
3
+ import { FontAwesomeIcon as g } from "@fortawesome/react-fontawesome";
4
4
  import { clsx as u } from "clsx";
5
- import { Card as _, CardHeader as H, CardBody as M, Dropdown as $, DropdownToggle as k, DropdownMenu as S, NavItem as j, NavLink as G, Nav as U, UncontrolledDropdown as q, DropdownItem as g } from "reactstrap";
6
- import { useId as T, useState as p, useRef as C, useCallback as f, useMemo as Q, Children as V, isValidElement as Y, useEffect as W } from "react";
5
+ import { Card as C, CardHeader as H, CardBody as M, Dropdown as $, DropdownToggle as O, DropdownMenu as k, NavItem as j, NavLink as G, Nav as U, UncontrolledDropdown as q, DropdownItem as w } from "reactstrap";
6
+ import { useId as v, useState as p, useRef as S, useMemo as Q, useCallback as f, Children as V, isValidElement as Y, useEffect as W } from "react";
7
7
  import { useLocation as z, NavLink as J } from "react-router";
8
- const he = ({ className: e, children: r, loading: t = !1, type: n = "default", fullWidth: c = !1 }) => /* @__PURE__ */ o(
9
- _,
8
+ import { u as X } from "./use-timeout-mQ792qNj.js";
9
+ const pe = ({ className: e, children: r, loading: t = !1, type: n = "default", fullWidth: o = !1 }) => /* @__PURE__ */ s(
10
+ C,
10
11
  {
11
12
  body: !0,
12
13
  className: u(e, {
13
- "w-100": c,
14
- "w-75 mx-auto": !c,
14
+ "w-100": o,
15
+ "w-75 mx-auto": !o,
15
16
  "border-danger": n === "error"
16
17
  }),
17
18
  children: /* @__PURE__ */ d(
@@ -22,18 +23,18 @@ const he = ({ className: e, children: r, loading: t = !1, type: n = "default", f
22
23
  "text-danger": n === "error"
23
24
  }),
24
25
  children: [
25
- t && /* @__PURE__ */ o(w, { icon: I, spin: !0 }),
26
- t && /* @__PURE__ */ o("span", { className: "ms-2", children: r ?? "Loading..." }),
26
+ t && /* @__PURE__ */ s(g, { icon: I, spin: !0 }),
27
+ t && /* @__PURE__ */ s("span", { className: "ms-2", children: r ?? "Loading..." }),
27
28
  !t && r
28
29
  ]
29
30
  }
30
31
  )
31
32
  }
32
- ), X = ({ title: e, children: r, bodyClassName: t, ...n }) => /* @__PURE__ */ d(_, { ...n, children: [
33
- e && /* @__PURE__ */ o(H, { role: "heading", "aria-level": 4, children: e }),
34
- /* @__PURE__ */ o(M, { className: t, children: r })
35
- ] }), fe = ({ children: e, type: r, className: t, small: n = !1 }) => /* @__PURE__ */ o(
36
- X,
33
+ ), Z = ({ title: e, children: r, bodyClassName: t, ...n }) => /* @__PURE__ */ d(C, { ...n, children: [
34
+ e && /* @__PURE__ */ s(H, { role: "heading", "aria-level": 4, children: e }),
35
+ /* @__PURE__ */ s(M, { className: t, children: r })
36
+ ] }), be = ({ children: e, type: r, className: t, small: n = !1 }) => /* @__PURE__ */ s(
37
+ Z,
37
38
  {
38
39
  role: "document",
39
40
  className: u("text-center", {
@@ -47,47 +48,47 @@ const he = ({ className: e, children: r, loading: t = !1, type: n = "default", f
47
48
  bodyClassName: u({ "p-2": n }),
48
49
  children: e
49
50
  }
50
- ), x = ({ checked: e = !1, onChange: r, className: t, children: n, type: c, inline: s = !1 }) => {
51
- const l = T(), a = (h) => r == null ? void 0 : r(h.target.checked, h), i = {
52
- "form-switch": c === "switch",
53
- "form-checkbox": c === "checkbox"
54
- }, m = s ? { display: "inline-block" } : {};
51
+ ), y = ({ checked: e = !1, onChange: r, className: t, children: n, type: o, inline: c = !1 }) => {
52
+ const l = v(), a = (h) => r == null ? void 0 : r(h.target.checked, h), i = {
53
+ "form-switch": o === "switch",
54
+ "form-checkbox": o === "checkbox"
55
+ }, m = c ? { display: "inline-block" } : {};
55
56
  return /* @__PURE__ */ d("span", { className: u("form-check", i, t), style: m, children: [
56
- /* @__PURE__ */ o("input", { type: "checkbox", className: "form-check-input", id: l, checked: e, onChange: a }),
57
- /* @__PURE__ */ o("label", { className: "form-check-label", htmlFor: l, children: n })
57
+ /* @__PURE__ */ s("input", { type: "checkbox", className: "form-check-input", id: l, checked: e, onChange: a }),
58
+ /* @__PURE__ */ s("label", { className: "form-check-label", htmlFor: l, children: n })
58
59
  ] });
59
- }, pe = (e) => /* @__PURE__ */ o(x, { type: "checkbox", ...e }), be = (e) => /* @__PURE__ */ o(x, { type: "switch", ...e }), Z = ({ children: e, label: r, className: t = "", labelClassName: n = "", noMargin: c = !1, id: s }) => /* @__PURE__ */ d("div", { className: `${t} ${c ? "" : "mb-3"}`, children: [
60
- /* @__PURE__ */ o("label", { className: `form-label ${n}`, htmlFor: s, children: r }),
60
+ }, ge = (e) => /* @__PURE__ */ s(y, { type: "checkbox", ...e }), we = (e) => /* @__PURE__ */ s(y, { type: "switch", ...e }), B = ({ children: e, label: r, className: t = "", labelClassName: n = "", noMargin: o = !1, id: c }) => /* @__PURE__ */ d("div", { className: `${t} ${o ? "" : "mb-3"}`, children: [
61
+ /* @__PURE__ */ s("label", { className: `form-label ${n}`, htmlFor: c, children: r }),
61
62
  e
62
- ] }), we = ({ children: e, value: r, onChange: t, type: n, required: c, placeholder: s, className: l, labelClassName: a }) => {
63
- const i = T();
64
- return /* @__PURE__ */ o(Z, { label: /* @__PURE__ */ d(N, { children: [
63
+ ] }), Ne = ({ children: e, value: r, onChange: t, type: n, required: o, placeholder: c, className: l, labelClassName: a }) => {
64
+ const i = v();
65
+ return /* @__PURE__ */ s(B, { label: /* @__PURE__ */ d(N, { children: [
65
66
  e,
66
67
  ":"
67
- ] }), className: l, labelClassName: a, id: i, children: /* @__PURE__ */ o(
68
+ ] }), className: l, labelClassName: a, id: i, children: /* @__PURE__ */ s(
68
69
  "input",
69
70
  {
70
71
  id: i,
71
72
  className: "form-control",
72
73
  type: n ?? "text",
73
74
  value: r,
74
- required: c ?? !0,
75
- placeholder: s,
75
+ required: o ?? !0,
76
+ placeholder: c,
76
77
  onChange: (m) => t(m.target.value)
77
78
  }
78
79
  ) });
79
- }, B = 500;
80
+ }, K = 500;
80
81
  let b;
81
- const v = () => {
82
+ const _ = () => {
82
83
  b !== null && clearTimeout(b), b = null;
83
- }, ge = ({ onChange: e, className: r, large: t = !0, noBorder: n = !1, initialValue: c = "", setTimeout_: s = setTimeout }) => {
84
- const [l, a] = p(c), i = (m, h = B) => {
85
- a(m), v(), b = s(() => {
86
- e(m), v();
84
+ }, Ce = ({ onChange: e, className: r, large: t = !0, noBorder: n = !1, initialValue: o = "", setTimeout_: c = setTimeout }) => {
85
+ const [l, a] = p(o), i = (m, h = K) => {
86
+ a(m), _(), b = c(() => {
87
+ e(m), _();
87
88
  }, h);
88
89
  };
89
90
  return /* @__PURE__ */ d("div", { className: u("search-field", r), children: [
90
- /* @__PURE__ */ o(
91
+ /* @__PURE__ */ s(
91
92
  "input",
92
93
  {
93
94
  type: "text",
@@ -100,8 +101,8 @@ const v = () => {
100
101
  onChange: (m) => i(m.target.value)
101
102
  }
102
103
  ),
103
- /* @__PURE__ */ o(w, { icon: A, className: "search-field__icon" }),
104
- /* @__PURE__ */ o(
104
+ /* @__PURE__ */ s(g, { icon: A, className: "search-field__icon" }),
105
+ /* @__PURE__ */ s(
105
106
  "button",
106
107
  {
107
108
  "aria-label": "Clear search",
@@ -113,56 +114,56 @@ const v = () => {
113
114
  }
114
115
  )
115
116
  ] });
116
- }, K = (e) => {
117
+ }, Te = () => S(null), ee = (e) => {
117
118
  const r = new URLSearchParams(e), t = {};
118
- return r.forEach((n, c) => {
119
- if (c.endsWith("[]")) {
120
- const s = c.slice(0, -2);
121
- t[s] ?? (t[s] = []), t[s].push(n);
119
+ return r.forEach((n, o) => {
120
+ if (o.endsWith("[]")) {
121
+ const c = o.slice(0, -2);
122
+ t[c] ?? (t[c] = []), t[c].push(n);
122
123
  } else
123
- t[c] = n;
124
+ t[o] = n;
124
125
  }), t;
125
- }, Ne = (e) => {
126
+ }, _e = (e) => {
126
127
  const r = new URLSearchParams();
127
128
  for (const [t, n] of Object.entries(e))
128
- n !== void 0 && (Array.isArray(n) ? n.forEach((c) => r.append(`${t}[]`, `${c}`)) : r.append(t, `${n}`));
129
+ n !== void 0 && (Array.isArray(n) ? n.forEach((o) => r.append(`${t}[]`, `${o}`)) : r.append(t, `${n}`));
129
130
  return r.toString();
130
- }, ee = (e = !1) => {
131
- const [r, t] = p(e), n = f(() => t((l) => !l), []), c = f(() => t(!0), []), s = f(() => t(!1), []);
132
- return [r, n, c, s];
133
- }, Ce = (e = !1, r = 2e3, t = window.setTimeout, n = window.clearTimeout) => {
134
- const [c, s] = p(e), l = C(e), a = C(void 0), i = f(() => {
135
- s(!l.current), a.current && n(a.current), a.current = t(() => s(l.current), r);
136
- }, [n, r, t]);
137
- return [c, i];
138
- }, _e = () => C(null), Oe = () => {
131
+ }, Oe = () => {
139
132
  const { search: e } = z();
140
- return Q(() => K(e), [e]);
141
- }, re = ({
133
+ return Q(() => ee(e), [e]);
134
+ }, ke = (e = !1, r = 2e3, t = globalThis.setTimeout.bind(globalThis), n = globalThis.clearTimeout.bind(globalThis)) => {
135
+ const { setTimeout: o } = X(r, t, n), [c, l] = p(e), a = S(e), i = f(() => {
136
+ l(!a.current), o(() => l(a.current));
137
+ }, [o]);
138
+ return [c, i];
139
+ }, re = (e = !1) => {
140
+ const [r, t] = p(e), n = f(() => t((l) => !l), []), o = f(() => t(!0), []), c = f(() => t(!1), []);
141
+ return [r, n, o, c];
142
+ }, te = ({
142
143
  text: e,
143
144
  disabled: r = !1,
144
145
  className: t,
145
146
  children: n,
146
- dropdownClassName: c,
147
- noCaret: s,
147
+ dropdownClassName: o,
148
+ noCaret: c,
148
149
  end: l = !1,
149
150
  minWidth: a,
150
151
  inline: i,
151
152
  size: m,
152
153
  ...h
153
154
  }) => {
154
- const [y, L] = ee(), D = u("dropdown-btn__toggle", t, {
155
+ const [x, L] = re(), D = u("dropdown-btn__toggle", t, {
155
156
  "btn-block": !i,
156
- "dropdown-btn__toggle--with-caret": !s
157
+ "dropdown-btn__toggle--with-caret": !c
157
158
  }), R = { minWidth: a && `${a}px` };
158
- return /* @__PURE__ */ d($, { isOpen: y, toggle: L, disabled: r, className: c, children: [
159
- /* @__PURE__ */ o(k, { size: m, caret: !s, className: D, color: "primary", ...h, children: e }),
160
- /* @__PURE__ */ o(S, { className: "w-100", end: l, style: R, children: n })
159
+ return /* @__PURE__ */ d($, { isOpen: x, toggle: L, disabled: r, className: o, children: [
160
+ /* @__PURE__ */ s(O, { size: m, caret: !c, className: D, color: "primary", ...h, children: e }),
161
+ /* @__PURE__ */ s(k, { className: "w-100", end: l, style: R, children: n })
161
162
  ] });
162
- }, ve = ({ children: e, minWidth: r, label: t = "Options" }) => /* @__PURE__ */ o(
163
- re,
163
+ }, ve = ({ children: e, minWidth: r, label: t = "Options" }) => /* @__PURE__ */ s(
164
+ te,
164
165
  {
165
- text: /* @__PURE__ */ o(w, { className: "px-1", icon: E }),
166
+ text: /* @__PURE__ */ s(g, { className: "px-1", icon: E }),
166
167
  "aria-label": t,
167
168
  size: "sm",
168
169
  minWidth: r,
@@ -171,41 +172,41 @@ const v = () => {
171
172
  inline: !0,
172
173
  children: e
173
174
  }
174
- ), te = ({ children: e, ...r }) => /* @__PURE__ */ o(j, { children: /* @__PURE__ */ o(G, { className: "nav-pills__nav-link", tag: J, ...r, children: e }) }), ke = ({ children: e, fill: r = !1, className: t = "" }) => /* @__PURE__ */ o(_, { className: `nav-pills__nav p-0 overflow-hidden ${t}`, body: !0, children: /* @__PURE__ */ o(U, { pills: !0, fill: r, children: V.map(e, (n) => {
175
- if (!Y(n) || n.type !== te)
175
+ ), ne = ({ children: e, ...r }) => /* @__PURE__ */ s(j, { children: /* @__PURE__ */ s(G, { className: "nav-pills__nav-link", tag: J, ...r, children: e }) }), Se = ({ children: e, fill: r = !1, className: t = "" }) => /* @__PURE__ */ s(C, { className: `nav-pills__nav p-0 overflow-hidden ${t}`, body: !0, children: /* @__PURE__ */ s(U, { pills: !0, fill: r, children: V.map(e, (n) => {
176
+ if (!Y(n) || n.type !== ne)
176
177
  throw new Error("Only NavPillItem children are allowed inside NavPills.");
177
178
  return n;
178
179
  }) }) });
179
- function O(e, r, t) {
180
- return typeof e == "object" ? O(e.currentField, e.newField, e.currentOrderDir) : e !== r ? "ASC" : t ? {
180
+ function T(e, r, t) {
181
+ return typeof e == "object" ? T(e.currentField, e.newField, e.currentOrderDir) : e !== r ? "ASC" : t ? {
181
182
  ASC: "DESC",
182
183
  DESC: void 0
183
184
  }[t] : "ASC";
184
185
  }
185
- function ne(e, r, t) {
186
- return typeof e == "object" ? ne(e.currentField, e.newField, e.currentOrderDir) : {
186
+ function se(e, r, t) {
187
+ return typeof e == "object" ? se(e.currentField, e.newField, e.currentOrderDir) : {
187
188
  field: r,
188
- dir: O(e, r, t)
189
+ dir: T(e, r, t)
189
190
  };
190
191
  }
191
- const Se = (e, { field: r, dir: t }) => !r || !t ? e : e.sort((n, c) => {
192
- const s = t === "ASC" ? 1 : -1, l = t === "ASC" ? -1 : 1;
193
- return n[r] > c[r] ? s : l;
194
- }), Te = (e) => e.dir ? `${e.field}-${e.dir}` : void 0, xe = (e) => {
192
+ const ye = (e, { field: r, dir: t }) => !r || !t ? e : e.sort((n, o) => {
193
+ const c = t === "ASC" ? 1 : -1, l = t === "ASC" ? -1 : 1;
194
+ return n[r] > o[r] ? c : l;
195
+ }), xe = (e) => e.dir ? `${e.field}-${e.dir}` : void 0, Le = (e) => {
195
196
  const [r, t] = e.split("-");
196
197
  return { field: r, dir: t };
197
- }, ye = (e) => {
198
- const [r, t] = p(e), n = f((c, s) => t({ field: c, dir: s }), []);
198
+ }, De = (e) => {
199
+ const [r, t] = p(e), n = f((o, c) => t({ field: o, dir: c }), []);
199
200
  return [r, n];
200
201
  };
201
- function Le({ items: e, order: r, onChange: t, isButton: n = !0, right: c = !1, prefixed: s = !0 }) {
202
+ function Re({ items: e, order: r, onChange: t, isButton: n = !0, right: o = !1, prefixed: c = !0 }) {
202
203
  const l = (a) => () => {
203
- const i = O(a, r.field, r.dir);
204
+ const i = T(a, r.field, r.dir);
204
205
  t(i ? a : void 0, i);
205
206
  };
206
207
  return /* @__PURE__ */ d(q, { children: [
207
208
  /* @__PURE__ */ d(
208
- k,
209
+ O,
209
210
  {
210
211
  caret: !0,
211
212
  color: n ? "primary" : "link",
@@ -214,82 +215,83 @@ function Le({ items: e, order: r, onChange: t, isButton: n = !0, right: c = !1,
214
215
  "btn-sm p-0": !n
215
216
  }),
216
217
  children: [
217
- !n && /* @__PURE__ */ o(N, { children: "Order by" }),
218
- n && !r.field && /* @__PURE__ */ o("i", { children: "Order by..." }),
218
+ !n && /* @__PURE__ */ s(N, { children: "Order by" }),
219
+ n && !r.field && /* @__PURE__ */ s("i", { children: "Order by..." }),
219
220
  n && r.field && /* @__PURE__ */ d(N, { children: [
220
- s && "Order by: ",
221
+ c && "Order by: ",
221
222
  e[r.field],
222
223
  " - ",
223
- /* @__PURE__ */ o("small", { children: r.dir ?? "DESC" })
224
+ /* @__PURE__ */ s("small", { children: r.dir ?? "DESC" })
224
225
  ] })
225
226
  ]
226
227
  }
227
228
  ),
228
- /* @__PURE__ */ d(S, { end: c, className: "w-100", style: n ? void 0 : { minWidth: "11rem" }, children: [
229
+ /* @__PURE__ */ d(k, { end: o, className: "w-100", style: n ? void 0 : { minWidth: "11rem" }, children: [
229
230
  Object.entries(e).map(([a, i]) => /* @__PURE__ */ d(
230
- g,
231
+ w,
231
232
  {
232
233
  active: r.field === a,
233
234
  onClick: l(a),
234
235
  className: "d-flex justify-content-between align-items-center",
235
236
  children: [
236
237
  i,
237
- r.field === a && /* @__PURE__ */ o(w, { icon: r.dir === "ASC" ? F : P })
238
+ r.field === a && /* @__PURE__ */ s(g, { icon: r.dir === "ASC" ? F : P })
238
239
  ]
239
240
  },
240
241
  a
241
242
  )),
242
- /* @__PURE__ */ o(g, { divider: !0 }),
243
- /* @__PURE__ */ o(g, { disabled: !r.field, onClick: () => t(), children: /* @__PURE__ */ o("i", { children: "Clear selection" }) })
243
+ /* @__PURE__ */ s(w, { divider: !0 }),
244
+ /* @__PURE__ */ s(w, { disabled: !r.field, onClick: () => t(), children: /* @__PURE__ */ s("i", { children: "Clear selection" }) })
244
245
  ] })
245
246
  ] });
246
247
  }
247
- const De = "#4696e5", Re = "rgba(70, 150, 229, 0.4)", Ie = "#f77f28", Ae = "rgba(247, 127, 40, 0.4)", Ee = "white", Fe = "#161b22", oe = (e) => {
248
+ const Ie = "#4696e5", Ae = "rgba(70, 150, 229, 0.4)", Ee = "#f77f28", Fe = "rgba(247, 127, 40, 0.4)", Pe = "white", He = "#161b22", oe = (e) => {
248
249
  var r;
249
250
  return (r = document.querySelector("html")) == null ? void 0 : r.setAttribute("data-theme", e);
250
- }, Pe = () => {
251
+ }, Me = () => {
251
252
  var e;
252
253
  return ((e = document.querySelector("html")) == null ? void 0 : e.getAttribute("data-theme")) === "dark";
253
- }, ce = (e = window.matchMedia.bind(window)) => e("(prefers-color-scheme: dark)").matches ? "dark" : "light", He = (e) => {
254
+ }, ce = (e = window.matchMedia.bind(window)) => e("(prefers-color-scheme: dark)").matches ? "dark" : "light", $e = (e) => {
254
255
  const [r, t] = p(() => e ?? ce());
255
256
  return W(() => {
256
257
  oe(r);
257
258
  }, [r]), [r, t];
258
259
  };
259
260
  export {
260
- pe as Checkbox,
261
- re as DropdownBtn,
262
- Ie as HIGHLIGHTED_COLOR,
263
- Ae as HIGHLIGHTED_COLOR_ALPHA,
264
- we as InputFormGroup,
265
- Z as LabeledFormGroup,
266
- De as MAIN_COLOR,
267
- Re as MAIN_COLOR_ALPHA,
268
- he as Message,
269
- te as NavPillItem,
270
- ke as NavPills,
271
- Le as OrderingDropdown,
272
- Fe as PRIMARY_DARK_COLOR,
273
- Ee as PRIMARY_LIGHT_COLOR,
274
- fe as Result,
261
+ ge as Checkbox,
262
+ te as DropdownBtn,
263
+ Ee as HIGHLIGHTED_COLOR,
264
+ Fe as HIGHLIGHTED_COLOR_ALPHA,
265
+ Ne as InputFormGroup,
266
+ B as LabeledFormGroup,
267
+ Ie as MAIN_COLOR,
268
+ Ae as MAIN_COLOR_ALPHA,
269
+ pe as Message,
270
+ ne as NavPillItem,
271
+ Se as NavPills,
272
+ Re as OrderingDropdown,
273
+ He as PRIMARY_DARK_COLOR,
274
+ Pe as PRIMARY_LIGHT_COLOR,
275
+ be as Result,
275
276
  ve as RowDropdownBtn,
276
- ge as SearchField,
277
- X as SimpleCard,
278
- be as ToggleSwitch,
277
+ Ce as SearchField,
278
+ Z as SimpleCard,
279
+ we as ToggleSwitch,
279
280
  oe as changeThemeInMarkup,
280
- ne as determineOrder,
281
- O as determineOrderDir,
281
+ se as determineOrder,
282
+ T as determineOrderDir,
282
283
  ce as getSystemPreferredTheme,
283
- Pe as isDarkThemeEnabled,
284
- Te as orderToString,
285
- K as parseQueryString,
286
- Se as sortList,
287
- xe as stringToOrder,
288
- Ne as stringifyQueryParams,
289
- _e as useElementRef,
290
- ye as useOrder,
284
+ Me as isDarkThemeEnabled,
285
+ xe as orderToString,
286
+ ee as parseQueryString,
287
+ ye as sortList,
288
+ Le as stringToOrder,
289
+ _e as stringifyQueryParams,
290
+ Te as useElementRef,
291
+ De as useOrder,
291
292
  Oe as useParsedQuery,
292
- He as useTheme,
293
- Ce as useTimeoutToggle,
294
- ee as useToggle
293
+ $e as useTheme,
294
+ X as useTimeout,
295
+ ke as useTimeoutToggle,
296
+ re as useToggle
295
297
  };
@@ -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<{
@@ -21,8 +26,6 @@ export declare type ButtonProps = PropsWithChildren<{
21
26
  solid?: boolean;
22
27
  } & (RegularButtonProps | LinkButtonProps_2)>;
23
28
 
24
- export declare type Callback = () => unknown;
25
-
26
29
  export declare const Card: FC<CardProps> & {
27
30
  Body: FC<CardProps>;
28
31
  Header: FC<CardProps>;
@@ -51,6 +54,10 @@ export declare type CellProps = HTMLProps<HTMLTableCellElement> & {
51
54
  type?: 'td' | 'th';
52
55
  };
53
56
 
57
+ export declare const Checkbox: FC<CheckboxProps>;
58
+
59
+ export declare type CheckboxProps = BooleanControlProps;
60
+
54
61
  export declare const CloseButton: FC<CloseButtonProps>;
55
62
 
56
63
  export declare type CloseButtonProps = {
@@ -90,7 +97,7 @@ export declare const Label: FC<LabelProps>;
90
97
  export declare const LabelledInput: FC<LabelledInputProps>;
91
98
 
92
99
  export declare type LabelledInputProps = Omit<InputProps, 'className' | 'id' | 'feedback'> & {
93
- label: string;
100
+ label: RequiredReactNode;
94
101
  inputClassName?: string;
95
102
  error?: string;
96
103
  /** Alternative to `required`. Causes the input to be required, without displaying an asterisk */
@@ -100,7 +107,7 @@ export declare type LabelledInputProps = Omit<InputProps, 'className' | 'id' | '
100
107
  export declare const LabelledSelect: FC<LabelledSelectProps>;
101
108
 
102
109
  export declare type LabelledSelectProps = Omit<SelectProps, 'className' | 'id'> & {
103
- label: string;
110
+ label: RequiredReactNode;
104
111
  selectClassName?: string;
105
112
  /** Alternative to `required`. Causes the input to be required, without displaying an asterisk */
106
113
  hiddenRequired?: boolean;
@@ -119,6 +126,17 @@ export declare type LinkButtonProps = Omit<HTMLProps<HTMLButtonElement>, 'size'
119
126
 
120
127
  declare type LinkButtonProps_2 = LinkProps;
121
128
 
129
+ /**
130
+ * Component used to display a card with general information, about current page status, loading, etc.
131
+ */
132
+ export declare const Message: FC<MessageProps>;
133
+
134
+ export declare type MessageProps = PropsWithChildren<{
135
+ className?: string;
136
+ loading?: boolean;
137
+ variant?: 'default' | 'error';
138
+ }>;
139
+
122
140
  export declare const ModalDialog: FC<ModalDialogProps>;
123
141
 
124
142
  export declare type ModalDialogProps = HTMLProps<HTMLDialogElement> & {
@@ -128,6 +146,15 @@ export declare type ModalDialogProps = HTMLProps<HTMLDialogElement> & {
128
146
  onClose: () => void;
129
147
  };
130
148
 
149
+ export declare const NavPills: FC<NavPillsProps> & {
150
+ Pill: FC<LinkProps>;
151
+ };
152
+
153
+ export declare type NavPillsProps = PropsWithChildren<{
154
+ fill?: boolean;
155
+ className?: string;
156
+ }>;
157
+
131
158
  declare type NoTitleProps = {
132
159
  title?: never;
133
160
  titleSize?: never;
@@ -148,6 +175,8 @@ export declare type PaginatorProps = {
148
175
  urlForPage: (pageNumber: number) => string;
149
176
  });
150
177
 
178
+ export declare type PillProps = LinkProps;
179
+
151
180
  export declare const prettifyPageNumber: (pageNumber: NumberOrEllipsis) => string;
152
181
 
153
182
  export declare const progressivePagination: (currentPage: number, pageCount: number) => NumberOrEllipsis[];
@@ -170,6 +199,19 @@ declare type RegularCardModalProps = CommonCardModalProps & {
170
199
  onConfirm?: () => void;
171
200
  };
172
201
 
202
+ export declare type RequiredReactNode = Exclude<ReactNode, undefined | null>;
203
+
204
+ /**
205
+ * Component used to display the result of an operation, which can be a success, failure or warning.
206
+ */
207
+ export declare const Result: FC<ResultProps>;
208
+
209
+ export declare type ResultProps = PropsWithChildren<{
210
+ variant: 'success' | 'error' | 'warning';
211
+ className?: string;
212
+ size?: Size;
213
+ }>;
214
+
173
215
  export declare const roundTen: (number: number) => number;
174
216
 
175
217
  export declare const SearchInput: FC<SearchInputProps>;
@@ -194,7 +236,7 @@ export declare type SimpleCardProps = Omit<CardProps, 'title' | 'size'> & {
194
236
  bodyClassName?: string;
195
237
  } & (TitleProps | NoTitleProps);
196
238
 
197
- declare type Size = 'sm' | 'md' | 'lg';
239
+ export declare type Size = 'sm' | 'md' | 'lg';
198
240
 
199
241
  export declare const Table: FC<TableProps> & {
200
242
  Row: FC<HTMLProps<HTMLTableRowElement>>;
@@ -220,20 +262,8 @@ declare type TitleProps = {
220
262
  titleSize?: Size;
221
263
  };
222
264
 
223
- export declare function useTimeout(defaultDelay: number,
224
- /** Test seam. Defaults to global setTimeout */
225
- setTimeout_?: typeof globalThis.setTimeout,
226
- /** Test seam. Defaults to global clearTimeout */
227
- clearTimeout_?: typeof clearTimeout): UseTimeoutResult;
265
+ export declare const ToggleSwitch: FC<ToggleSwitchProps>;
228
266
 
229
- export declare type UseTimeoutResult = {
230
- /**
231
- * Clears any in-progress timeout, and schedules a new callback.
232
- * It optionally allows a delay to be provided, or falls back to the default delay otherwise.
233
- */
234
- setTimeout: (callback: Callback, delay?: number) => void;
235
- /** Clears any in-progress timeout */
236
- clearCurrentTimeout: () => void;
237
- };
267
+ export declare type ToggleSwitchProps = BooleanControlProps;
238
268
 
239
269
  export { }