@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 +17 -1
- package/dist/index.js +164 -161
- package/dist/tailwind.d.ts +7 -1
- package/dist/tailwind.js +203 -196
- package/dist/tailwind.preset.css +13 -0
- package/dist/use-timeout-BbfWTbuj.js +17 -0
- package/package.json +1 -1
- package/dist/use-timeout-mQ792qNj.js +0 -17
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
|
-
|
|
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
|
|
2
|
-
import { faCircleNotch as
|
|
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
|
|
6
|
-
import { useId as
|
|
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-
|
|
9
|
-
const
|
|
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":
|
|
15
|
-
"w-75 mx-auto": !
|
|
14
|
+
"w-100": s,
|
|
15
|
+
"w-75 mx-auto": !s,
|
|
16
16
|
"border-danger": n === "error"
|
|
17
17
|
}),
|
|
18
|
-
children: /* @__PURE__ */
|
|
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
|
-
|
|
27
|
-
|
|
28
|
-
!
|
|
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:
|
|
34
|
-
e && /* @__PURE__ */
|
|
35
|
-
/* @__PURE__ */
|
|
36
|
-
] }),
|
|
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":
|
|
44
|
-
"bg-danger":
|
|
45
|
-
"bg-warning":
|
|
46
|
-
"text-white":
|
|
47
|
-
},
|
|
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
|
-
),
|
|
52
|
-
const
|
|
53
|
-
"form-switch":
|
|
54
|
-
"form-checkbox":
|
|
55
|
-
},
|
|
56
|
-
return /* @__PURE__ */
|
|
57
|
-
/* @__PURE__ */
|
|
58
|
-
/* @__PURE__ */
|
|
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
|
-
},
|
|
61
|
-
/* @__PURE__ */
|
|
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
|
-
] }),
|
|
64
|
-
const i =
|
|
65
|
-
return /* @__PURE__ */
|
|
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:
|
|
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:
|
|
75
|
-
required:
|
|
74
|
+
value: t,
|
|
75
|
+
required: s ?? !0,
|
|
76
76
|
placeholder: c,
|
|
77
|
-
onChange: (
|
|
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
|
-
},
|
|
85
|
-
const [
|
|
86
|
-
|
|
87
|
-
e(
|
|
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__ */
|
|
91
|
-
/* @__PURE__ */
|
|
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":
|
|
96
|
+
"form-control-lg": r,
|
|
97
97
|
"search-field__input--no-border": n
|
|
98
98
|
}),
|
|
99
99
|
placeholder: "Search...",
|
|
100
|
-
value:
|
|
101
|
-
onChange: (
|
|
100
|
+
value: a,
|
|
101
|
+
onChange: (d) => i(d.target.value)
|
|
102
102
|
}
|
|
103
103
|
),
|
|
104
|
-
/* @__PURE__ */
|
|
105
|
-
/* @__PURE__ */
|
|
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:
|
|
111
|
+
hidden: a === "",
|
|
112
112
|
id: "search-field__close",
|
|
113
113
|
onClick: () => i("", 0)
|
|
114
114
|
}
|
|
115
115
|
)
|
|
116
116
|
] });
|
|
117
|
-
},
|
|
118
|
-
const
|
|
119
|
-
return
|
|
120
|
-
if (
|
|
121
|
-
const c =
|
|
122
|
-
|
|
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
|
-
|
|
125
|
-
}),
|
|
126
|
-
},
|
|
127
|
-
const
|
|
128
|
-
for (const [
|
|
129
|
-
n !== void 0 && (Array.isArray(n) ? n.forEach((
|
|
130
|
-
return
|
|
131
|
-
},
|
|
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
|
|
134
|
-
},
|
|
135
|
-
const {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
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 [
|
|
141
|
-
return [
|
|
142
|
-
},
|
|
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:
|
|
145
|
-
className:
|
|
147
|
+
disabled: t = !1,
|
|
148
|
+
className: r,
|
|
146
149
|
children: n,
|
|
147
|
-
dropdownClassName:
|
|
150
|
+
dropdownClassName: s,
|
|
148
151
|
noCaret: c,
|
|
149
|
-
end:
|
|
150
|
-
minWidth:
|
|
152
|
+
end: a = !1,
|
|
153
|
+
minWidth: l,
|
|
151
154
|
inline: i,
|
|
152
|
-
size:
|
|
155
|
+
size: d,
|
|
153
156
|
...h
|
|
154
157
|
}) => {
|
|
155
|
-
const [
|
|
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:
|
|
159
|
-
return /* @__PURE__ */
|
|
160
|
-
/* @__PURE__ */
|
|
161
|
-
/* @__PURE__ */
|
|
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
|
-
},
|
|
164
|
-
|
|
166
|
+
}, ye = ({ children: e, minWidth: t, label: r = "Options" }) => /* @__PURE__ */ o(
|
|
167
|
+
ne,
|
|
165
168
|
{
|
|
166
|
-
text: /* @__PURE__ */
|
|
167
|
-
"aria-label":
|
|
169
|
+
text: /* @__PURE__ */ o(g, { className: "px-1", icon: E }),
|
|
170
|
+
"aria-label": r,
|
|
168
171
|
size: "sm",
|
|
169
|
-
minWidth:
|
|
172
|
+
minWidth: t,
|
|
170
173
|
end: !0,
|
|
171
174
|
noCaret: !0,
|
|
172
175
|
inline: !0,
|
|
173
176
|
children: e
|
|
174
177
|
}
|
|
175
|
-
),
|
|
176
|
-
if (!Y(n) || n.type !==
|
|
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,
|
|
181
|
-
return typeof e == "object" ? T(e.currentField, e.newField, e.currentOrderDir) : e !==
|
|
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
|
-
}[
|
|
187
|
+
}[r] : "ASC";
|
|
185
188
|
}
|
|
186
|
-
function se(e,
|
|
189
|
+
function se(e, t, r) {
|
|
187
190
|
return typeof e == "object" ? se(e.currentField, e.newField, e.currentOrderDir) : {
|
|
188
|
-
field:
|
|
189
|
-
dir: T(e,
|
|
191
|
+
field: t,
|
|
192
|
+
dir: T(e, t, r)
|
|
190
193
|
};
|
|
191
194
|
}
|
|
192
|
-
const
|
|
193
|
-
const c =
|
|
194
|
-
return n[
|
|
195
|
-
}), xe = (e) => e.dir ? `${e.field}-${e.dir}` : void 0,
|
|
196
|
-
const [
|
|
197
|
-
return { field:
|
|
198
|
-
},
|
|
199
|
-
const [
|
|
200
|
-
return [
|
|
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
|
|
203
|
-
const
|
|
204
|
-
const i = T(
|
|
205
|
-
|
|
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__ */
|
|
208
|
-
/* @__PURE__ */
|
|
209
|
-
|
|
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__ */
|
|
219
|
-
n && !
|
|
220
|
-
n &&
|
|
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[
|
|
225
|
+
e[t.field],
|
|
223
226
|
" - ",
|
|
224
|
-
/* @__PURE__ */
|
|
227
|
+
/* @__PURE__ */ o("small", { children: t.dir ?? "DESC" })
|
|
225
228
|
] })
|
|
226
229
|
]
|
|
227
230
|
}
|
|
228
231
|
),
|
|
229
|
-
/* @__PURE__ */
|
|
230
|
-
Object.entries(e).map(([
|
|
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:
|
|
234
|
-
onClick: l
|
|
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
|
-
|
|
241
|
+
t.field === l && /* @__PURE__ */ o(g, { icon: t.dir === "ASC" ? F : P })
|
|
239
242
|
]
|
|
240
243
|
},
|
|
241
|
-
|
|
244
|
+
l
|
|
242
245
|
)),
|
|
243
|
-
/* @__PURE__ */
|
|
244
|
-
/* @__PURE__ */
|
|
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",
|
|
249
|
-
var
|
|
250
|
-
return (
|
|
251
|
-
},
|
|
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
|
-
},
|
|
255
|
-
const [
|
|
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
|
-
|
|
258
|
-
}, [
|
|
260
|
+
ce(t);
|
|
261
|
+
}, [t]), [t, r];
|
|
259
262
|
};
|
|
260
263
|
export {
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
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
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
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
|
-
|
|
280
|
-
|
|
282
|
+
Ne as ToggleSwitch,
|
|
283
|
+
ce as changeThemeInMarkup,
|
|
281
284
|
se as determineOrder,
|
|
282
285
|
T as determineOrderDir,
|
|
283
|
-
|
|
284
|
-
|
|
286
|
+
ae as getSystemPreferredTheme,
|
|
287
|
+
$e as isDarkThemeEnabled,
|
|
285
288
|
xe as orderToString,
|
|
286
289
|
ee as parseQueryString,
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
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
|
-
|
|
298
|
+
Se as useTimeoutToggle,
|
|
296
299
|
re as useToggle
|
|
297
300
|
};
|
package/dist/tailwind.d.ts
CHANGED
|
@@ -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?:
|
|
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>;
|