@shlinkio/shlink-frontend-kit 0.8.4 → 0.8.5

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