@shlinkio/shlink-frontend-kit 0.8.4 → 0.8.6

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