@shlinkio/shlink-frontend-kit 0.8.9 → 0.8.11

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
@@ -206,7 +206,17 @@ export declare type TimeoutToggleOptions = {
206
206
  delay?: number;
207
207
  };
208
208
 
209
- export declare type ToggleResult = [boolean, () => void, () => void, () => void];
209
+ export declare type ToggleResult = ToggleResultTuple | ToggleResultObject;
210
+
211
+ export declare type ToggleResultObject = {
212
+ flag: boolean;
213
+ toggle: () => void;
214
+ setToTrue: () => void;
215
+ setToFalse: () => void;
216
+ };
217
+
218
+ /** @deprecated */
219
+ export declare type ToggleResultTuple = [boolean, () => void, () => void, () => void];
210
220
 
211
221
  export declare const ToggleSwitch: FC<BooleanControlProps>;
212
222
 
@@ -242,6 +252,13 @@ export declare type UseTimeoutResult = {
242
252
  */
243
253
  export declare const useTimeoutToggle: (initialValueOrOptions?: TimeoutToggleOptions | boolean, secondArg?: number, setTimeout_?: typeof setTimeout, clearTimeout_?: typeof clearTimeout) => [boolean, () => void];
244
254
 
245
- export declare const useToggle: (initialValue?: boolean) => ToggleResult;
255
+ /** @deprecated Returning result as tuple is deprecated */
256
+ export declare function useToggle(initialValue?: boolean, asObject?: false): ToggleResultTuple;
257
+
258
+ /**
259
+ * @param asObject - Whether the result should be returned as an object or as a tuple.
260
+ * Deprecated. Future releases will always return an object.
261
+ */
262
+ export declare function useToggle(initialValue: boolean, asObject: true): ToggleResultObject;
246
263
 
247
264
  export { }
package/dist/index.js CHANGED
@@ -1,43 +1,43 @@
1
- import { jsx as o, jsxs as m, Fragment as w } from "react/jsx-runtime";
2
- import { faCircleNotch as A, faSearch as I, faEllipsisV as E, faSortAmountUp as P, faSortAmountDown as F } from "@fortawesome/free-solid-svg-icons";
3
- import { FontAwesomeIcon as p } from "@fortawesome/react-fontawesome";
4
- import { clsx as u } from "clsx";
5
- import { Card as N, CardHeader as H, CardBody as M, Dropdown as $, DropdownToggle as v, DropdownMenu as k, NavItem as G, NavLink as j, Nav as U, UncontrolledDropdown as V, DropdownItem as g } from "reactstrap";
6
- import { useId as S, useState as b, useRef as y, useCallback as C, useMemo as q, Children as Q, isValidElement as Y, useEffect as W } from "react";
1
+ import { jsx as s, jsxs as u, Fragment as f } from "react/jsx-runtime";
2
+ import { faCircleNotch as E, faSearch as P, faEllipsisV as F, faSortAmountUp as H, faSortAmountDown as M } from "@fortawesome/free-solid-svg-icons";
3
+ import { FontAwesomeIcon as b } from "@fortawesome/react-fontawesome";
4
+ import { clsx as h } from "clsx";
5
+ import { Card as N, CardHeader as $, CardBody as G, Dropdown as k, DropdownToggle as O, DropdownMenu as S, NavItem as j, NavLink as U, Nav as V, DropdownItem as w } from "reactstrap";
6
+ import { useId as y, useState as g, useRef as x, useCallback as C, useMemo as q, Children as Q, isValidElement as Y, useEffect as W } from "react";
7
7
  import { useNavigate as z, useLocation as J, NavLink as X } from "react-router";
8
- import { u as Z, a as B } from "./use-toggle-CNvdDGvy.js";
9
- const ge = ({ className: e, children: r, loading: t = !1, type: n = "default", fullWidth: s = !1 }) => /* @__PURE__ */ o(
8
+ import { u as Z, a as L } from "./use-toggle-PWLikLl6.js";
9
+ const be = ({ className: e, children: r, loading: t = !1, type: n = "default", fullWidth: o = !1 }) => /* @__PURE__ */ s(
10
10
  N,
11
11
  {
12
12
  body: !0,
13
- className: u(e, {
14
- "w-100": s,
15
- "w-75 mx-auto": !s,
13
+ className: h(e, {
14
+ "w-100": o,
15
+ "w-75 mx-auto": !o,
16
16
  "border-danger": n === "error"
17
17
  }),
18
- children: /* @__PURE__ */ m(
18
+ children: /* @__PURE__ */ u(
19
19
  "h3",
20
20
  {
21
- className: u("text-center mb-0", {
21
+ className: h("text-center mb-0", {
22
22
  "text-muted": n === "default",
23
23
  "text-danger": n === "error"
24
24
  }),
25
25
  children: [
26
- t && /* @__PURE__ */ o(p, { icon: A, spin: !0 }),
27
- t && /* @__PURE__ */ o("span", { className: "ms-2", children: r ?? "Loading..." }),
26
+ t && /* @__PURE__ */ s(b, { icon: E, spin: !0 }),
27
+ t && /* @__PURE__ */ s("span", { className: "ms-2", children: r ?? "Loading..." }),
28
28
  !t && r
29
29
  ]
30
30
  }
31
31
  )
32
32
  }
33
- ), K = ({ title: e, children: r, bodyClassName: t, ...n }) => /* @__PURE__ */ m(N, { ...n, children: [
34
- e && /* @__PURE__ */ o(H, { role: "heading", "aria-level": 4, children: e }),
35
- /* @__PURE__ */ o(M, { className: t, children: r })
36
- ] }), we = ({ children: e, type: r, className: t, small: n = !1 }) => /* @__PURE__ */ o(
37
- K,
33
+ ), B = ({ title: e, children: r, bodyClassName: t, ...n }) => /* @__PURE__ */ u(N, { ...n, children: [
34
+ e && /* @__PURE__ */ s($, { role: "heading", "aria-level": 4, children: e }),
35
+ /* @__PURE__ */ s(G, { className: t, children: r })
36
+ ] }), ge = ({ children: e, type: r, className: t, small: n = !1 }) => /* @__PURE__ */ s(
37
+ B,
38
38
  {
39
39
  role: "document",
40
- className: u("text-center", {
40
+ className: h("text-center", {
41
41
  "w-75 mx-auto": !n,
42
42
  "w-100": n,
43
43
  "bg-main": r === "success",
@@ -45,128 +45,128 @@ const ge = ({ className: e, children: r, loading: t = !1, type: n = "default", f
45
45
  "bg-warning": r === "warning",
46
46
  "text-white": r !== "warning"
47
47
  }, t),
48
- bodyClassName: u({ "p-2": n }),
48
+ bodyClassName: h({ "p-2": n }),
49
49
  children: e
50
50
  }
51
- ), O = ({ checked: e = !1, onChange: r, className: t, children: n, type: s, inline: c = !1 }) => {
52
- const i = S(), a = (h) => r == null ? void 0 : r(h.target.checked, h), l = {
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", l, t), style: d, children: [
57
- /* @__PURE__ */ o("input", { type: "checkbox", className: "form-check-input", id: i, checked: e, onChange: a }),
58
- /* @__PURE__ */ o("label", { className: "form-check-label", htmlFor: i, children: n })
51
+ ), D = ({ checked: e = !1, onChange: r, className: t, children: n, type: o, inline: c = !1 }) => {
52
+ const l = y(), m = (d) => r == null ? void 0 : r(d.target.checked, d), i = {
53
+ "form-switch": o === "switch",
54
+ "form-checkbox": o === "checkbox"
55
+ }, a = c ? { display: "inline-block" } : {};
56
+ return /* @__PURE__ */ u("span", { className: h("form-check", i, t), style: a, children: [
57
+ /* @__PURE__ */ s("input", { type: "checkbox", className: "form-check-input", id: l, checked: e, onChange: m }),
58
+ /* @__PURE__ */ s("label", { className: "form-check-label", htmlFor: l, children: n })
59
59
  ] });
60
- }, Ne = (e) => /* @__PURE__ */ o(O, { type: "checkbox", ...e }), Ce = (e) => /* @__PURE__ */ o(O, { type: "switch", ...e }), ee = ({ children: e, label: r, className: t = "", labelClassName: n = "", noMargin: s = !1, id: c }) => /* @__PURE__ */ m("div", { className: `${t} ${s ? "" : "mb-3"}`, children: [
61
- /* @__PURE__ */ o("label", { className: `form-label ${n}`, htmlFor: c, children: r }),
60
+ }, we = (e) => /* @__PURE__ */ s(D, { type: "checkbox", ...e }), Ne = (e) => /* @__PURE__ */ s(D, { type: "switch", ...e }), K = ({ children: e, label: r, className: t = "", labelClassName: n = "", noMargin: o = !1, id: c }) => /* @__PURE__ */ u("div", { className: `${t} ${o ? "" : "mb-3"}`, children: [
61
+ /* @__PURE__ */ s("label", { className: `form-label ${n}`, htmlFor: c, children: r }),
62
62
  e
63
- ] }), _e = ({ children: e, value: r, onChange: t, type: n, required: s, placeholder: c, className: i, labelClassName: a }) => {
64
- const l = S();
65
- return /* @__PURE__ */ o(ee, { label: /* @__PURE__ */ m(w, { children: [
63
+ ] }), Ce = ({ children: e, value: r, onChange: t, type: n, required: o, placeholder: c, className: l, labelClassName: m }) => {
64
+ const i = y();
65
+ return /* @__PURE__ */ s(K, { label: /* @__PURE__ */ u(f, { children: [
66
66
  e,
67
67
  ":"
68
- ] }), className: i, labelClassName: a, id: l, children: /* @__PURE__ */ o(
68
+ ] }), className: l, labelClassName: m, id: i, children: /* @__PURE__ */ s(
69
69
  "input",
70
70
  {
71
- id: l,
71
+ id: i,
72
72
  className: "form-control",
73
73
  type: n ?? "text",
74
74
  value: r,
75
- required: s ?? !0,
75
+ required: o ?? !0,
76
76
  placeholder: c,
77
- onChange: (d) => t(d.target.value)
77
+ onChange: (a) => t(a.target.value)
78
78
  }
79
79
  ) });
80
- }, re = 500;
81
- let f;
82
- const T = () => {
83
- f !== null && clearTimeout(f), f = null;
84
- }, Te = ({ onChange: e, className: r, large: t = !0, noBorder: n = !1, initialValue: s = "", setTimeout_: c = setTimeout }) => {
85
- const [i, a] = b(s), l = (d, h = re) => {
86
- a(d), T(), f = c(() => {
87
- e(d), T();
88
- }, h);
80
+ }, ee = 500;
81
+ let p;
82
+ const v = () => {
83
+ p !== null && clearTimeout(p), p = null;
84
+ }, _e = ({ onChange: e, className: r, large: t = !0, noBorder: n = !1, initialValue: o = "", setTimeout_: c = setTimeout }) => {
85
+ const [l, m] = g(o), i = (a, d = ee) => {
86
+ m(a), v(), p = c(() => {
87
+ e(a), v();
88
+ }, d);
89
89
  };
90
- return /* @__PURE__ */ m("div", { className: u("search-field", r), children: [
91
- /* @__PURE__ */ o(
90
+ return /* @__PURE__ */ u("div", { className: h("search-field", r), children: [
91
+ /* @__PURE__ */ s(
92
92
  "input",
93
93
  {
94
94
  type: "text",
95
- className: u("form-control search-field__input", {
95
+ className: h("form-control search-field__input", {
96
96
  "form-control-lg": t,
97
97
  "search-field__input--no-border": n
98
98
  }),
99
99
  placeholder: "Search...",
100
- value: i,
101
- onChange: (d) => l(d.target.value)
100
+ value: l,
101
+ onChange: (a) => i(a.target.value)
102
102
  }
103
103
  ),
104
- /* @__PURE__ */ o(p, { icon: I, className: "search-field__icon" }),
105
- /* @__PURE__ */ o(
104
+ /* @__PURE__ */ s(b, { icon: P, className: "search-field__icon" }),
105
+ /* @__PURE__ */ s(
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: i === "",
111
+ hidden: l === "",
112
112
  id: "search-field__close",
113
- onClick: () => l("", 0)
113
+ onClick: () => i("", 0)
114
114
  }
115
115
  )
116
116
  ] });
117
- }, ve = () => y(null), ke = () => {
117
+ }, Te = () => x(null), ve = () => {
118
118
  const e = z();
119
119
  return C(() => e(-1), [e]);
120
- }, te = (e) => {
120
+ }, re = (e) => {
121
121
  const r = new URLSearchParams(e), t = {};
122
- return r.forEach((n, s) => {
123
- if (s.endsWith("[]")) {
124
- const c = s.slice(0, -2);
122
+ return r.forEach((n, o) => {
123
+ if (o.endsWith("[]")) {
124
+ const c = o.slice(0, -2);
125
125
  t[c] ?? (t[c] = []), t[c].push(n);
126
126
  } else
127
- t[s] = n;
127
+ t[o] = n;
128
128
  }), t;
129
- }, Se = (e) => {
129
+ }, ke = (e) => {
130
130
  const r = new URLSearchParams();
131
131
  for (const [t, n] of Object.entries(e))
132
- n !== void 0 && (Array.isArray(n) ? n.forEach((s) => r.append(`${t}[]`, `${s}`)) : r.append(t, `${n}`));
132
+ n !== void 0 && (Array.isArray(n) ? n.forEach((o) => r.append(`${t}[]`, `${o}`)) : r.append(t, `${n}`));
133
133
  return r.toString();
134
- }, ye = () => {
134
+ }, Oe = () => {
135
135
  const { search: e } = J();
136
- return q(() => te(e), [e]);
137
- }, ne = 2e3, Oe = (e = {}, r, t = globalThis.setTimeout, n = globalThis.clearTimeout) => {
138
- const { initialValue: s = !1, delay: c = ne } = typeof e == "boolean" ? {
136
+ return q(() => re(e), [e]);
137
+ }, te = 2e3, Se = (e = {}, r, t = globalThis.setTimeout, n = globalThis.clearTimeout) => {
138
+ const { initialValue: o = !1, delay: c = te } = typeof e == "boolean" ? {
139
139
  initialValue: e,
140
140
  delay: r
141
- } : e, { setTimeout: i } = Z(c, t, n), [a, l] = b(s), d = y(s), h = C(() => {
142
- l(!d.current), i(() => l(d.current));
143
- }, [i]);
144
- return [a, h];
145
- }, oe = ({
141
+ } : e, { setTimeout: l } = Z(c, t, n), [m, i] = g(o), a = x(o), d = C(() => {
142
+ i(!a.current), l(() => i(a.current));
143
+ }, [l]);
144
+ return [m, d];
145
+ }, ne = ({
146
146
  text: e,
147
147
  disabled: r = !1,
148
148
  className: t,
149
149
  children: n,
150
- dropdownClassName: s,
150
+ dropdownClassName: o,
151
151
  noCaret: c,
152
- end: i = !1,
153
- minWidth: a,
154
- inline: l,
155
- size: d,
156
- ...h
152
+ end: l = !1,
153
+ minWidth: m,
154
+ inline: i,
155
+ size: a,
156
+ ...d
157
157
  }) => {
158
- const [L, x] = B(), D = u("dropdown-btn__toggle", t, {
159
- "btn-block": !l,
158
+ const [T, I] = L(), R = h("dropdown-btn__toggle", t, {
159
+ "btn-block": !i,
160
160
  "dropdown-btn__toggle--with-caret": !c
161
- }), R = { minWidth: a && `${a}px` };
162
- return /* @__PURE__ */ m($, { isOpen: L, toggle: x, disabled: r, className: s, children: [
163
- /* @__PURE__ */ o(v, { size: d, caret: !c, className: D, color: "primary", ...h, children: e }),
164
- /* @__PURE__ */ o(k, { className: "w-100", end: i, style: R, children: n })
161
+ }), A = { minWidth: m && `${m}px` };
162
+ return /* @__PURE__ */ u(k, { isOpen: T, toggle: I, disabled: r, className: o, children: [
163
+ /* @__PURE__ */ s(O, { size: a, caret: !c, className: R, color: "primary", ...d, children: e }),
164
+ /* @__PURE__ */ s(S, { className: "w-100", end: l, style: A, children: T && n })
165
165
  ] });
166
- }, Le = ({ children: e, minWidth: r, label: t = "Options" }) => /* @__PURE__ */ o(
167
- oe,
166
+ }, ye = ({ children: e, minWidth: r, label: t = "Options" }) => /* @__PURE__ */ s(
167
+ ne,
168
168
  {
169
- text: /* @__PURE__ */ o(p, { className: "px-1", icon: E }),
169
+ text: /* @__PURE__ */ s(b, { className: "px-1", icon: F }),
170
170
  "aria-label": t,
171
171
  size: "sm",
172
172
  minWidth: r,
@@ -175,7 +175,7 @@ const T = () => {
175
175
  inline: !0,
176
176
  children: e
177
177
  }
178
- ), se = ({ children: e, ...r }) => /* @__PURE__ */ o(G, { children: /* @__PURE__ */ o(j, { className: "nav-pills__nav-link", tag: X, ...r, children: e }) }), xe = ({ children: e, fill: r = !1, className: t = "" }) => /* @__PURE__ */ o(N, { className: `nav-pills__nav p-0 overflow-hidden ${t}`, body: !0, children: /* @__PURE__ */ o(U, { pills: !0, fill: r, children: Q.map(e, (n) => {
178
+ ), se = ({ children: e, ...r }) => /* @__PURE__ */ s(j, { children: /* @__PURE__ */ s(U, { className: "nav-pills__nav-link", tag: X, ...r, children: e }) }), xe = ({ children: e, fill: r = !1, className: t = "" }) => /* @__PURE__ */ s(N, { className: `nav-pills__nav p-0 overflow-hidden ${t}`, body: !0, children: /* @__PURE__ */ s(V, { pills: !0, fill: r, children: Q.map(e, (n) => {
179
179
  if (!Y(n) || n.type !== se)
180
180
  throw new Error("Only NavPillItem children are allowed inside NavPills.");
181
181
  return n;
@@ -186,116 +186,117 @@ function _(e, r, t) {
186
186
  DESC: void 0
187
187
  }[t] : "ASC";
188
188
  }
189
- function ce(e, r, t) {
190
- return typeof e == "object" ? ce(e.currentField, e.newField, e.currentOrderDir) : {
189
+ function oe(e, r, t) {
190
+ return typeof e == "object" ? oe(e.currentField, e.newField, e.currentOrderDir) : {
191
191
  field: r,
192
192
  dir: _(e, r, t)
193
193
  };
194
194
  }
195
- const De = (e, { field: r, dir: t }) => !r || !t ? e : e.sort((n, s) => {
196
- const c = t === "ASC" ? 1 : -1, i = t === "ASC" ? -1 : 1;
197
- return n[r] > s[r] ? c : i;
198
- }), Re = (e) => e.dir ? `${e.field}-${e.dir}` : void 0, Ae = (e) => {
195
+ const Le = (e, { field: r, dir: t }) => !r || !t ? e : e.sort((n, o) => {
196
+ const c = t === "ASC" ? 1 : -1, l = t === "ASC" ? -1 : 1;
197
+ return n[r] > o[r] ? c : l;
198
+ }), De = (e) => e.dir ? `${e.field}-${e.dir}` : void 0, Ie = (e) => {
199
199
  const [r, t] = e.split("-");
200
200
  return { field: r, dir: t };
201
- }, Ie = (e) => {
202
- const [r, t] = b(e), n = C((s, c) => t({ field: s, dir: c }), []);
201
+ }, Re = (e) => {
202
+ const [r, t] = g(e), n = C((o, c) => t({ field: o, dir: c }), []);
203
203
  return [r, n];
204
204
  };
205
- function Ee({ items: e, order: r, onChange: t, isButton: n = !0, right: s = !1, prefixed: c = !0 }) {
206
- const i = (a) => () => {
207
- const l = _(a, r.field, r.dir);
208
- t(l ? a : void 0, l);
205
+ function Ae({ items: e, order: r, onChange: t, isButton: n = !0, right: o = !1, prefixed: c = !0 }) {
206
+ const [l, m] = L(), i = (a) => () => {
207
+ const d = _(a, r.field, r.dir);
208
+ t(d ? a : void 0, d);
209
209
  };
210
- return /* @__PURE__ */ m(V, { children: [
211
- /* @__PURE__ */ m(
212
- v,
210
+ return /* @__PURE__ */ u(k, { isOpen: l, toggle: m, children: [
211
+ /* @__PURE__ */ u(
212
+ O,
213
213
  {
214
214
  caret: !0,
215
215
  color: n ? "primary" : "link",
216
- className: u({
216
+ className: h({
217
217
  "dropdown-btn__toggle btn-block pe-4 overflow-hidden": n,
218
218
  "btn-sm p-0": !n
219
219
  }),
220
220
  children: [
221
- !n && /* @__PURE__ */ o(w, { children: "Order by" }),
222
- n && !r.field && /* @__PURE__ */ o("i", { children: "Order by..." }),
223
- n && r.field && /* @__PURE__ */ m(w, { children: [
221
+ !n && /* @__PURE__ */ s(f, { children: "Order by" }),
222
+ n && !r.field && /* @__PURE__ */ s("i", { children: "Order by..." }),
223
+ n && r.field && /* @__PURE__ */ u(f, { children: [
224
224
  c && "Order by: ",
225
225
  e[r.field],
226
226
  " - ",
227
- /* @__PURE__ */ o("small", { children: r.dir ?? "DESC" })
227
+ /* @__PURE__ */ s("small", { children: r.dir ?? "DESC" })
228
228
  ] })
229
229
  ]
230
230
  }
231
231
  ),
232
- /* @__PURE__ */ m(k, { end: s, className: "w-100", style: n ? void 0 : { minWidth: "11rem" }, children: [
233
- Object.entries(e).map(([a, l]) => /* @__PURE__ */ m(
234
- g,
232
+ /* @__PURE__ */ s(S, { end: o, className: "w-100", style: n ? void 0 : { minWidth: "11rem" }, children: l && /* @__PURE__ */ u(f, { children: [
233
+ Object.entries(e).map(([a, d]) => /* @__PURE__ */ u(
234
+ w,
235
235
  {
236
236
  active: r.field === a,
237
237
  onClick: i(a),
238
238
  className: "d-flex justify-content-between align-items-center",
239
+ tabIndex: -1,
239
240
  children: [
240
- l,
241
- r.field === a && /* @__PURE__ */ o(p, { icon: r.dir === "ASC" ? P : F })
241
+ d,
242
+ r.field === a && /* @__PURE__ */ s(b, { icon: r.dir === "ASC" ? H : M })
242
243
  ]
243
244
  },
244
245
  a
245
246
  )),
246
- /* @__PURE__ */ o(g, { divider: !0 }),
247
- /* @__PURE__ */ o(g, { disabled: !r.field, onClick: () => t(), children: /* @__PURE__ */ o("i", { children: "Clear selection" }) })
248
- ] })
247
+ /* @__PURE__ */ s(w, { divider: !0, tag: "hr" }),
248
+ /* @__PURE__ */ s(w, { disabled: !r.field, onClick: () => t(), tabIndex: -1, children: /* @__PURE__ */ s("i", { children: "Clear selection" }) })
249
+ ] }) })
249
250
  ] });
250
251
  }
251
- const Pe = "#4696e5", Fe = "rgba(70, 150, 229, 0.4)", He = "#f77f28", Me = "rgba(247, 127, 40, 0.4)", $e = "white", Ge = "#161b22", ae = (e) => {
252
+ const Ee = "#4696e5", Pe = "rgba(70, 150, 229, 0.4)", Fe = "#f77f28", He = "rgba(247, 127, 40, 0.4)", Me = "white", $e = "#161b22", ce = (e) => {
252
253
  var r;
253
254
  return (r = document.querySelector("html")) == null ? void 0 : r.setAttribute("data-theme", e);
254
- }, je = () => {
255
+ }, Ge = () => {
255
256
  var e;
256
257
  return ((e = document.querySelector("html")) == null ? void 0 : e.getAttribute("data-theme")) === "dark";
257
- }, le = (e = window.matchMedia.bind(window)) => e("(prefers-color-scheme: dark)").matches ? "dark" : "light", Ue = (e) => {
258
- const [r, t] = b(() => e ?? le());
258
+ }, ae = (e = window.matchMedia.bind(window)) => e("(prefers-color-scheme: dark)").matches ? "dark" : "light", je = (e) => {
259
+ const [r, t] = g(() => e ?? ae());
259
260
  return W(() => {
260
- ae(r);
261
+ ce(r);
261
262
  }, [r]), [r, t];
262
263
  };
263
264
  export {
264
- Ne as Checkbox,
265
- oe as DropdownBtn,
266
- He as HIGHLIGHTED_COLOR,
267
- Me as HIGHLIGHTED_COLOR_ALPHA,
268
- _e as InputFormGroup,
269
- ee as LabeledFormGroup,
270
- Pe as MAIN_COLOR,
271
- Fe as MAIN_COLOR_ALPHA,
272
- ge as Message,
265
+ we as Checkbox,
266
+ ne as DropdownBtn,
267
+ Fe as HIGHLIGHTED_COLOR,
268
+ He as HIGHLIGHTED_COLOR_ALPHA,
269
+ Ce as InputFormGroup,
270
+ K as LabeledFormGroup,
271
+ Ee as MAIN_COLOR,
272
+ Pe as MAIN_COLOR_ALPHA,
273
+ be as Message,
273
274
  se as NavPillItem,
274
275
  xe as NavPills,
275
- Ee as OrderingDropdown,
276
- Ge as PRIMARY_DARK_COLOR,
277
- $e as PRIMARY_LIGHT_COLOR,
278
- we as Result,
279
- Le as RowDropdownBtn,
280
- Te as SearchField,
281
- K as SimpleCard,
282
- Ce as ToggleSwitch,
283
- ae as changeThemeInMarkup,
284
- ce as determineOrder,
276
+ Ae as OrderingDropdown,
277
+ $e as PRIMARY_DARK_COLOR,
278
+ Me as PRIMARY_LIGHT_COLOR,
279
+ ge as Result,
280
+ ye as RowDropdownBtn,
281
+ _e as SearchField,
282
+ B as SimpleCard,
283
+ Ne as ToggleSwitch,
284
+ ce as changeThemeInMarkup,
285
+ oe as determineOrder,
285
286
  _ as determineOrderDir,
286
- le as getSystemPreferredTheme,
287
- je as isDarkThemeEnabled,
288
- Re as orderToString,
289
- te as parseQueryString,
290
- De as sortList,
291
- Ae as stringToOrder,
292
- Se as stringifyQueryParams,
293
- ve as useElementRef,
294
- ke as useGoBack,
295
- Ie as useOrder,
296
- ye as useParsedQuery,
297
- Ue as useTheme,
287
+ ae as getSystemPreferredTheme,
288
+ Ge as isDarkThemeEnabled,
289
+ De as orderToString,
290
+ re as parseQueryString,
291
+ Le as sortList,
292
+ Ie as stringToOrder,
293
+ ke as stringifyQueryParams,
294
+ Te as useElementRef,
295
+ ve as useGoBack,
296
+ Re as useOrder,
297
+ Oe as useParsedQuery,
298
+ je as useTheme,
298
299
  Z as useTimeout,
299
- Oe as useTimeoutToggle,
300
- B as useToggle
300
+ Se as useTimeoutToggle,
301
+ L as useToggle
301
302
  };
package/dist/tailwind.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import { jsx as n, jsxs as g, Fragment as F } from "react/jsx-runtime";
2
- import i, { clsx as v } from "clsx";
3
- import { useState as $, useCallback as I, useEffect as _, createContext as H, useContext as N, forwardRef as x, useId as A, useRef as E, useMemo as O } from "react";
2
+ import i, { clsx as x } from "clsx";
3
+ import { useState as $, useCallback as I, useEffect as _, createContext as H, useContext as N, forwardRef as y, useId as A, useRef as E, useMemo as O } from "react";
4
4
  import { Link as S, NavLink as nt } from "react-router";
5
5
  import { faClose as at, faEyeSlash as lt, faEye as dt, faCircleNotch as V, faSearch as st, faChevronLeft as z, faChevronRight as G } from "@fortawesome/free-solid-svg-icons";
6
6
  import { FontAwesomeIcon as k } from "@fortawesome/react-fontawesome";
7
- import { a as it, u as wt } from "./use-toggle-CNvdDGvy.js";
7
+ import { a as it, u as wt } from "./use-toggle-PWLikLl6.js";
8
8
  import { createPortal as ct } from "react-dom";
9
9
  const mt = ({ className: t, ...e }) => /* @__PURE__ */ n(
10
10
  "div",
@@ -46,19 +46,19 @@ const mt = ({ className: t, ...e }) => /* @__PURE__ */ n(
46
46
  ),
47
47
  ...e
48
48
  }
49
- ), y = Object.assign(ut, { Body: gt, Header: mt, Footer: bt }), pt = ({ bodyClassName: t, children: e, ...r }) => {
49
+ ), v = Object.assign(ut, { Body: gt, Header: mt, Footer: bt }), pt = ({ bodyClassName: t, children: e, ...r }) => {
50
50
  const { title: o, titleSize: a = "md", ...d } = "title" in r ? r : {
51
51
  ...r,
52
52
  title: void 0,
53
53
  titleSize: void 0
54
54
  };
55
- return /* @__PURE__ */ g(y, { ...d, children: [
56
- o && /* @__PURE__ */ g(y.Header, { children: [
55
+ return /* @__PURE__ */ g(v, { ...d, children: [
56
+ o && /* @__PURE__ */ g(v.Header, { children: [
57
57
  a === "lg" && /* @__PURE__ */ n("h4", { children: o }),
58
58
  a === "md" && /* @__PURE__ */ n("h5", { children: o }),
59
59
  a === "sm" && /* @__PURE__ */ n("h6", { children: o })
60
60
  ] }),
61
- /* @__PURE__ */ n(y.Body, { className: t, children: e })
61
+ /* @__PURE__ */ n(v.Body, { className: t, children: e })
62
62
  ] });
63
63
  };
64
64
  function ht({
@@ -88,7 +88,7 @@ function ht({
88
88
  };
89
89
  return f.addEventListener("keydown", m), () => f.removeEventListener("keydown", m);
90
90
  }, [w, s, p, e, r]), /* @__PURE__ */ g(
91
- y,
91
+ v,
92
92
  {
93
93
  id: t,
94
94
  className: i("tw:py-1 tw:flex tw:flex-col", d),
@@ -226,7 +226,8 @@ const B = H(void 0), T = H({ responsive: !0 }), ft = ({ children: t, className:
226
226
  "tw:border tw:rounded-md tw:no-underline",
227
227
  "tw:transition-colors",
228
228
  {
229
- "tw:focus-ring": o !== "danger",
229
+ "tw:focus-ring": o === "primary",
230
+ "tw:focus-ring-secondary": o === "secondary",
230
231
  "tw:focus-ring-danger": o === "danger"
231
232
  },
232
233
  {
@@ -268,15 +269,15 @@ const B = H(void 0), T = H({ responsive: !0 }), ft = ({ children: t, className:
268
269
  }
269
270
  )
270
271
  );
271
- }, X = x(({ className: t, onChange: e, ...r }, o) => {
272
+ }, X = y(({ className: t, onChange: e, ...r }, o) => {
272
273
  const a = I((d) => e == null ? void 0 : e(d.target.checked, d), [e]);
273
274
  return /* @__PURE__ */ n(
274
275
  "input",
275
276
  {
276
277
  ref: o,
277
278
  type: "checkbox",
278
- className: v(
279
- "tw:appearance-none tw:focus-ring",
279
+ className: x(
280
+ "tw:appearance-none tw:focus-ring tw:cursor-[inherit]",
280
281
  "tw:border-1 tw:border-lm-input-border tw:dark:border-dm-input-border",
281
282
  "tw:bg-lm-primary tw:dark:bg-dm-primary tw:checked:bg-brand tw:bg-no-repeat",
282
283
  // Use different background color when rendered inside a card
@@ -287,11 +288,11 @@ const B = H(void 0), T = H({ responsive: !0 }), ft = ({ children: t, className:
287
288
  ...r
288
289
  }
289
290
  );
290
- }), Qt = x(({ className: t, ...e }, r) => /* @__PURE__ */ n(
291
+ }), Qt = y(({ className: t, ...e }, r) => /* @__PURE__ */ n(
291
292
  X,
292
293
  {
293
294
  ref: r,
294
- className: v("tw:rounded-sm tw:w-4 tw:h-4 tw:checked:bg-(image:--tick) tw:bg-center", t),
295
+ className: x("tw:rounded-sm tw:w-4 tw:h-4 tw:checked:bg-(image:--tick) tw:bg-center", t),
295
296
  ...e
296
297
  }
297
298
  )), J = ({ onClick: t, label: e = "Close" }) => /* @__PURE__ */ n(
@@ -306,7 +307,7 @@ const B = H(void 0), T = H({ responsive: !0 }), ft = ({ children: t, className:
306
307
  "aria-label": e,
307
308
  children: /* @__PURE__ */ n(k, { icon: at, size: "xl" })
308
309
  }
309
- ), U = x(({
310
+ ), U = y(({
310
311
  borderless: t = !1,
311
312
  size: e = "md",
312
313
  feedback: r,
@@ -347,10 +348,10 @@ const B = H(void 0), T = H({ responsive: !0 }), ft = ({ children: t, className:
347
348
  ...l
348
349
  }
349
350
  );
350
- }), K = ({ required: t, children: e, ...r }) => /* @__PURE__ */ g("label", { ...r, children: [
351
+ }), K = ({ required: t, children: e, className: r, ...o }) => /* @__PURE__ */ g("label", { className: x("tw:cursor-pointer", r), ...o, children: [
351
352
  e,
352
353
  t && /* @__PURE__ */ n("span", { className: "tw:text-danger tw:ml-1", "data-testid": "required-indicator", children: "*" })
353
- ] }), Vt = x(({ label: t, inputClassName: e, required: r, hiddenRequired: o, error: a, ...d }, l) => {
354
+ ] }), Vt = y(({ label: t, inputClassName: e, required: r, hiddenRequired: o, error: a, ...d }, l) => {
354
355
  const s = A();
355
356
  return /* @__PURE__ */ g("div", { className: "tw:flex tw:flex-col tw:gap-1", children: [
356
357
  /* @__PURE__ */ n(K, { htmlFor: s, required: r, children: t }),
@@ -367,7 +368,7 @@ const B = H(void 0), T = H({ responsive: !0 }), ft = ({ children: t, className:
367
368
  ),
368
369
  a && /* @__PURE__ */ n("span", { className: "tw:text-danger", children: a })
369
370
  ] });
370
- }), It = x(({ containerClassName: t, className: e, size: r, ...o }, a) => {
371
+ }), It = y(({ containerClassName: t, className: e, size: r, ...o }, a) => {
371
372
  const [d, l, , s] = it(!1), c = E(null), b = I(({ relatedTarget: w }) => {
372
373
  var u;
373
374
  (u = c.current) != null && u.contains(w) || s();
@@ -375,7 +376,7 @@ const B = H(void 0), T = H({ responsive: !0 }), ft = ({ children: t, className:
375
376
  return /* @__PURE__ */ g(
376
377
  "div",
377
378
  {
378
- className: v("tw:group tw:relative", t),
379
+ className: x("tw:group tw:relative", t),
379
380
  ref: c,
380
381
  onBlurCapture: b,
381
382
  children: [
@@ -384,7 +385,7 @@ const B = H(void 0), T = H({ responsive: !0 }), ft = ({ children: t, className:
384
385
  {
385
386
  ref: a,
386
387
  type: d ? "text" : "password",
387
- className: v(
388
+ className: x(
388
389
  {
389
390
  "tw:pr-10": r !== "sm",
390
391
  "tw:pr-8": r === "sm"
@@ -403,7 +404,7 @@ const B = H(void 0), T = H({ responsive: !0 }), ft = ({ children: t, className:
403
404
  onClick: l,
404
405
  title: d ? "Hide password" : "Show password",
405
406
  "aria-label": d ? "Hide password" : "Show password",
406
- className: v(
407
+ className: x(
407
408
  "tw:absolute tw:top-[50%] tw:translate-y-[-50%] tw:px-1",
408
409
  "tw:text-placeholder tw:hover:text-lm-text tw:hover:dark:text-dm-text tw:transition-colors",
409
410
  {
@@ -418,7 +419,7 @@ const B = H(void 0), T = H({ responsive: !0 }), ft = ({ children: t, className:
418
419
  ]
419
420
  }
420
421
  );
421
- }), Xt = x(({ label: t, inputClassName: e, required: r, hiddenRequired: o, error: a, ...d }, l) => {
422
+ }), Xt = y(({ label: t, inputClassName: e, required: r, hiddenRequired: o, error: a, ...d }, l) => {
422
423
  const s = A();
423
424
  return /* @__PURE__ */ g("div", { className: "tw:flex tw:flex-col tw:gap-1", children: [
424
425
  /* @__PURE__ */ n(K, { htmlFor: s, required: r, children: t }),
@@ -435,7 +436,7 @@ const B = H(void 0), T = H({ responsive: !0 }), ft = ({ children: t, className:
435
436
  ),
436
437
  a && /* @__PURE__ */ n("span", { className: "tw:text-danger", children: a })
437
438
  ] });
438
- }), Ct = x(({
439
+ }), Ct = y(({
439
440
  className: t,
440
441
  size: e = "md",
441
442
  feedback: r,
@@ -475,13 +476,13 @@ const B = H(void 0), T = H({ responsive: !0 }), ft = ({ children: t, className:
475
476
  disabled: a,
476
477
  ...d
477
478
  }
478
- )), Yt = x(({ selectClassName: t, label: e, required: r, hiddenRequired: o, ...a }, d) => {
479
+ )), Yt = y(({ selectClassName: t, label: e, required: r, hiddenRequired: o, ...a }, d) => {
479
480
  const l = A();
480
481
  return /* @__PURE__ */ g("div", { className: "tw:flex tw:flex-col tw:gap-1", children: [
481
482
  /* @__PURE__ */ n(K, { htmlFor: l, required: r, children: e }),
482
483
  /* @__PURE__ */ n(Ct, { ref: d, id: l, className: t, required: r || o, ...a })
483
484
  ] });
484
- }), Tt = x(({
485
+ }), Tt = y(({
485
486
  onChange: t,
486
487
  containerClassName: e,
487
488
  inputClassName: r,
@@ -597,11 +598,11 @@ function Zt({
597
598
  }
598
599
  );
599
600
  }
600
- const te = x(({ className: t, ...e }, r) => /* @__PURE__ */ n(
601
+ const te = y(({ className: t, ...e }, r) => /* @__PURE__ */ n(
601
602
  X,
602
603
  {
603
604
  ref: r,
604
- className: v(
605
+ className: x(
605
606
  "tw:rounded-full tw:w-8 tw:h-4",
606
607
  "tw:bg-(image:--circle-grey-dark) tw:dark:bg-(image:--circle-grey-light) tw:checked:bg-(image:--circle-white)",
607
608
  "tw:focus-visible:not-checked:bg-(image:--circle-light-blue)",
@@ -649,7 +650,7 @@ const te = x(({ className: t, ...e }, r) => /* @__PURE__ */ n(
649
650
  ...r
650
651
  }
651
652
  );
652
- }, Bt = ({ children: t, className: e, fill: r }) => /* @__PURE__ */ n(Y.Provider, { value: { fill: r }, children: /* @__PURE__ */ n(y, { role: "menubar", className: i("tw:flex tw:overflow-hidden", e), children: t }) }), ee = Object.assign(Bt, { Pill: Et }), Mt = new Intl.NumberFormat("en-US"), _t = (t) => Mt.format(Number(t)), Q = 10, re = (t) => Math.ceil(t / Q) * Q, C = 2, R = "...", Rt = (t, e) => Array.from({ length: e - t }, (r, o) => t + o), At = (t, e) => {
653
+ }, Bt = ({ children: t, className: e, fill: r }) => /* @__PURE__ */ n(Y.Provider, { value: { fill: r }, children: /* @__PURE__ */ n(v, { role: "menubar", className: i("tw:flex tw:overflow-hidden", e), children: t }) }), ee = Object.assign(Bt, { Pill: Et }), Mt = new Intl.NumberFormat("en-US"), _t = (t) => Mt.format(Number(t)), Q = 10, re = (t) => Math.ceil(t / Q) * Q, C = 2, R = "...", Rt = (t, e) => Array.from({ length: e - t }, (r, o) => t + o), At = (t, e) => {
653
654
  const r = Rt(
654
655
  Math.max(C, t - C),
655
656
  Math.min(e - 1, t + C) + 1
@@ -799,7 +800,7 @@ const oe = ({ currentPage: t, pagesCount: e, ...r }) => {
799
800
  },
800
801
  { "tw:h-full": r === "cover" }
801
802
  ),
802
- children: /* @__PURE__ */ n(y, { className: i(
803
+ children: /* @__PURE__ */ n(v, { className: i(
803
804
  "tw:w-full",
804
805
  { "tw:h-full tw:relative tw:overflow-auto": r === "cover" }
805
806
  ), children: r === "cover" ? /* @__PURE__ */ g(F, { children: [
@@ -820,16 +821,16 @@ const oe = ({ currentPage: t, pagesCount: e, ...r }) => {
820
821
  ),
821
822
  /* @__PURE__ */ n("div", { children: a })
822
823
  ] }) : /* @__PURE__ */ g(F, { children: [
823
- /* @__PURE__ */ g(y.Header, { className: i(
824
+ /* @__PURE__ */ g(v.Header, { className: i(
824
825
  "tw:sticky tw:top-0",
825
826
  "tw:flex tw:items-center tw:justify-between tw:gap-x-2"
826
827
  ), children: [
827
828
  /* @__PURE__ */ n("h5", { className: i({ "tw:text-danger": r === "danger" }), children: o }),
828
829
  /* @__PURE__ */ n(J, { onClick: e, label: "Close dialog" })
829
830
  ] }),
830
- /* @__PURE__ */ n(y.Body, { children: a }),
831
+ /* @__PURE__ */ n(v.Body, { children: a }),
831
832
  u && /* @__PURE__ */ g(
832
- y.Footer,
833
+ v.Footer,
833
834
  {
834
835
  "data-testid": "footer",
835
836
  className: i(
@@ -856,7 +857,7 @@ const oe = ({ currentPage: t, pagesCount: e, ...r }) => {
856
857
  )
857
858
  }
858
859
  );
859
- }, ae = ({ className: t, children: e, loading: r = !1, variant: o = "default" }) => /* @__PURE__ */ n(pt, { className: v({ "tw:[&]:border-danger": o === "error" }, t), children: /* @__PURE__ */ g("h3", { className: v("tw:text-center", {
860
+ }, ae = ({ className: t, children: e, loading: r = !1, variant: o = "default" }) => /* @__PURE__ */ n(pt, { className: x({ "tw:[&]:border-danger": o === "error" }, t), children: /* @__PURE__ */ g("h3", { className: x("tw:text-center", {
860
861
  "tw:text-gray-500 tw:dark:text-gray-400": o === "default",
861
862
  "tw:text-danger": o === "error"
862
863
  }), children: [
@@ -868,7 +869,7 @@ const oe = ({ currentPage: t, pagesCount: e, ...r }) => {
868
869
  ] }) }), le = ({ variant: t, className: e, size: r = "md", children: o }) => /* @__PURE__ */ n(
869
870
  "div",
870
871
  {
871
- className: v(
872
+ className: x(
872
873
  "tw:rounded-md tw:text-center",
873
874
  {
874
875
  "tw:p-2": r === "sm",
@@ -886,7 +887,7 @@ const oe = ({ currentPage: t, pagesCount: e, ...r }) => {
886
887
  );
887
888
  export {
888
889
  Pt as Button,
889
- y as Card,
890
+ v as Card,
890
891
  ne as CardModal,
891
892
  Qt as Checkbox,
892
893
  J as CloseButton,
@@ -143,6 +143,10 @@
143
143
  p {
144
144
  @apply tw:m-0;
145
145
  }
146
+
147
+ code {
148
+ @apply tw:text-sm tw:text-pink-600 tw:dark:text-pink-500 tw:font-mono;
149
+ }
146
150
  }
147
151
 
148
152
  @utility focus-ring-base {
@@ -157,6 +161,10 @@
157
161
  @apply tw:focus-ring-base tw:focus-visible:ring-danger/50;
158
162
  }
159
163
 
164
+ @utility focus-ring-secondary {
165
+ @apply tw:focus-ring-base tw:focus-visible:ring-zinc-500/50;
166
+ }
167
+
160
168
  @utility scroll-thin {
161
169
  /* Standard. New browsers */
162
170
  scrollbar-width: thin;
@@ -172,7 +180,7 @@
172
180
 
173
181
  @custom-variant highlight {
174
182
  &:hover,
175
- &:focus {
183
+ &:focus-visible {
176
184
  @slot;
177
185
  }
178
186
  }
@@ -0,0 +1,22 @@
1
+ import { useRef as a, useCallback as o, useEffect as f, useMemo as i, useState as T } from "react";
2
+ function m(n, r = globalThis.setTimeout, s = globalThis.clearTimeout) {
3
+ const t = a(null), e = o(() => {
4
+ t.current && s(t.current);
5
+ }, [s]), u = o((l, c) => {
6
+ e(), t.current = r(() => {
7
+ l(), t.current = null;
8
+ }, c ?? n);
9
+ }, [e, n, r]);
10
+ return f(() => e, [e]), i(
11
+ () => ({ setTimeout: u, clearCurrentTimeout: e }),
12
+ [e, u]
13
+ );
14
+ }
15
+ function b(n = !1, r = !1) {
16
+ const [s, t] = T(n), e = o(() => t((c) => !c), []), u = o(() => t(!0), []), l = o(() => t(!1), []);
17
+ return r ? { flag: s, toggle: e, setToTrue: u, setToFalse: l } : [s, e, u, l];
18
+ }
19
+ export {
20
+ b as a,
21
+ m as u
22
+ };
package/package.json CHANGED
@@ -55,32 +55,32 @@
55
55
  "devDependencies": {
56
56
  "@shlinkio/eslint-config-js-coding-standard": "~3.5.0",
57
57
  "@stylistic/eslint-plugin": "^4.2.0",
58
- "@tailwindcss/vite": "^4.1.3",
58
+ "@tailwindcss/vite": "^4.1.4",
59
59
  "@testing-library/jest-dom": "^6.6.3",
60
60
  "@testing-library/react": "^16.3.0",
61
61
  "@testing-library/user-event": "^14.6.1",
62
62
  "@total-typescript/shoehorn": "^0.1.2",
63
- "@types/react": "^19.1.0",
64
- "@types/react-dom": "^19.1.1",
63
+ "@types/react": "^19.1.2",
64
+ "@types/react-dom": "^19.1.2",
65
65
  "@vitejs/plugin-react": "^4.3.4",
66
66
  "@vitest/browser": "^3.1.1",
67
67
  "@vitest/coverage-v8": "^3.1.1",
68
68
  "axe-core": "^4.10.3",
69
69
  "bootstrap": "5.2.3",
70
- "eslint": "^9.24.0",
70
+ "eslint": "^9.25.0",
71
71
  "eslint-plugin-import": "^2.31.0",
72
72
  "eslint-plugin-jsx-a11y": "^6.10.2",
73
73
  "eslint-plugin-react": "^7.37.5",
74
- "eslint-plugin-react-compiler": "^19.0.0-beta-e993439-20250328",
74
+ "eslint-plugin-react-compiler": "^19.0.0-beta-ebf51a3-20250411",
75
75
  "eslint-plugin-react-hooks": "^5.2.0",
76
76
  "eslint-plugin-simple-import-sort": "^12.1.1",
77
77
  "history": "^5.3.0",
78
- "playwright": "^1.51.1",
78
+ "playwright": "^1.52.0",
79
79
  "resize-observer-polyfill": "^1.5.1",
80
80
  "sass": "^1.86.3",
81
81
  "typescript": "^5.8.3",
82
- "typescript-eslint": "^8.29.0",
83
- "vite": "^6.2.5",
82
+ "typescript-eslint": "^8.30.1",
83
+ "vite": "^6.2.6",
84
84
  "vite-plugin-dts": "^4.5.3",
85
85
  "vitest": "^3.0.2"
86
86
  },
@@ -90,5 +90,5 @@
90
90
  "not ie <= 11",
91
91
  "not op_mini all"
92
92
  ],
93
- "version": "0.8.9"
93
+ "version": "0.8.11"
94
94
  }
@@ -1,22 +0,0 @@
1
- import { useRef as a, useCallback as o, useEffect as f, useMemo as g, useState as i } from "react";
2
- function m(u, r = globalThis.setTimeout, t = globalThis.clearTimeout) {
3
- const s = a(null), e = o(() => {
4
- s.current && t(s.current);
5
- }, [t]), n = o((l, c) => {
6
- e(), s.current = r(() => {
7
- l(), s.current = null;
8
- }, c ?? u);
9
- }, [e, u, r]);
10
- return f(() => e, [e]), g(
11
- () => ({ setTimeout: n, clearCurrentTimeout: e }),
12
- [e, n]
13
- );
14
- }
15
- const b = (u = !1) => {
16
- const [r, t] = i(u), s = o(() => t((l) => !l), []), e = o(() => t(!0), []), n = o(() => t(!1), []);
17
- return [r, s, e, n];
18
- };
19
- export {
20
- b as a,
21
- m as u
22
- };