@shlinkio/shlink-frontend-kit 0.8.5 → 0.8.7
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.js +155 -157
- package/dist/tailwind.d.ts +49 -10
- package/dist/tailwind.js +471 -390
- package/dist/use-toggle-DlYE68B3.js +24 -0
- package/package.json +13 -13
- package/dist/use-timeout-BbfWTbuj.js +0 -17
package/dist/index.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { jsx as o, jsxs as m, Fragment as
|
|
2
|
-
import { faCircleNotch as
|
|
3
|
-
import { FontAwesomeIcon as
|
|
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
|
|
6
|
-
import { useId as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
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, {
|
|
@@ -23,193 +24,190 @@ const be = ({ className: e, children: t, loading: r = !1, type: n = "default", f
|
|
|
23
24
|
"text-danger": n === "error"
|
|
24
25
|
}),
|
|
25
26
|
children: [
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
!
|
|
27
|
+
t && /* @__PURE__ */ o(p, { icon: R, spin: !0 }),
|
|
28
|
+
t && /* @__PURE__ */ o("span", { className: "ms-2", children: r ?? "Loading..." }),
|
|
29
|
+
!t && r
|
|
29
30
|
]
|
|
30
31
|
}
|
|
31
32
|
)
|
|
32
33
|
}
|
|
33
|
-
),
|
|
34
|
-
e && /* @__PURE__ */ o(
|
|
35
|
-
/* @__PURE__ */ o(
|
|
36
|
-
] }),
|
|
37
|
-
|
|
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", {
|
|
41
42
|
"w-75 mx-auto": !n,
|
|
42
43
|
"w-100": n,
|
|
43
|
-
"bg-main":
|
|
44
|
-
"bg-danger":
|
|
45
|
-
"bg-warning":
|
|
46
|
-
"text-white":
|
|
47
|
-
},
|
|
44
|
+
"bg-main": r === "success",
|
|
45
|
+
"bg-danger": r === "error",
|
|
46
|
+
"bg-warning": r === "warning",
|
|
47
|
+
"text-white": r !== "warning"
|
|
48
|
+
}, t),
|
|
48
49
|
bodyClassName: u({ "p-2": n }),
|
|
49
50
|
children: e
|
|
50
51
|
}
|
|
51
|
-
),
|
|
52
|
-
const
|
|
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 = {
|
|
53
54
|
"form-switch": s === "switch",
|
|
54
55
|
"form-checkbox": s === "checkbox"
|
|
55
56
|
}, d = c ? { display: "inline-block" } : {};
|
|
56
|
-
return /* @__PURE__ */ m("span", { className: u("form-check",
|
|
57
|
-
/* @__PURE__ */ o("input", { type: "checkbox", className: "form-check-input", id:
|
|
58
|
-
/* @__PURE__ */ o("label", { className: "form-check-label", htmlFor:
|
|
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
|
-
},
|
|
61
|
-
/* @__PURE__ */ o("label", { className: `form-label ${n}`, htmlFor: c, children:
|
|
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
|
-
] }), Ce = ({ children: e, value:
|
|
64
|
-
const
|
|
65
|
-
return /* @__PURE__ */ o(
|
|
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:
|
|
69
|
+
] }), className: i, labelClassName: a, id: l, children: /* @__PURE__ */ o(
|
|
69
70
|
"input",
|
|
70
71
|
{
|
|
71
|
-
id:
|
|
72
|
+
id: l,
|
|
72
73
|
className: "form-control",
|
|
73
74
|
type: n ?? "text",
|
|
74
|
-
value:
|
|
75
|
+
value: r,
|
|
75
76
|
required: s ?? !0,
|
|
76
77
|
placeholder: c,
|
|
77
|
-
onChange: (d) =>
|
|
78
|
+
onChange: (d) => t(d.target.value)
|
|
78
79
|
}
|
|
79
80
|
) });
|
|
80
|
-
},
|
|
81
|
-
let
|
|
81
|
+
}, ee = 500;
|
|
82
|
+
let f;
|
|
82
83
|
const _ = () => {
|
|
83
|
-
|
|
84
|
-
},
|
|
85
|
-
const [
|
|
86
|
-
|
|
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(() => {
|
|
87
88
|
e(d), _();
|
|
88
89
|
}, h);
|
|
89
90
|
};
|
|
90
|
-
return /* @__PURE__ */ m("div", { className: u("search-field",
|
|
91
|
+
return /* @__PURE__ */ m("div", { className: u("search-field", r), children: [
|
|
91
92
|
/* @__PURE__ */ o(
|
|
92
93
|
"input",
|
|
93
94
|
{
|
|
94
95
|
type: "text",
|
|
95
96
|
className: u("form-control search-field__input", {
|
|
96
|
-
"form-control-lg":
|
|
97
|
+
"form-control-lg": t,
|
|
97
98
|
"search-field__input--no-border": n
|
|
98
99
|
}),
|
|
99
100
|
placeholder: "Search...",
|
|
100
|
-
value:
|
|
101
|
-
onChange: (d) =>
|
|
101
|
+
value: i,
|
|
102
|
+
onChange: (d) => l(d.target.value)
|
|
102
103
|
}
|
|
103
104
|
),
|
|
104
|
-
/* @__PURE__ */ o(
|
|
105
|
+
/* @__PURE__ */ o(p, { icon: A, className: "search-field__icon" }),
|
|
105
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:
|
|
112
|
+
hidden: i === "",
|
|
112
113
|
id: "search-field__close",
|
|
113
|
-
onClick: () =>
|
|
114
|
+
onClick: () => l("", 0)
|
|
114
115
|
}
|
|
115
116
|
)
|
|
116
117
|
] });
|
|
117
|
-
},
|
|
118
|
-
const
|
|
119
|
-
return
|
|
118
|
+
}, re = (e) => {
|
|
119
|
+
const r = new URLSearchParams(e), t = {};
|
|
120
|
+
return r.forEach((n, s) => {
|
|
120
121
|
if (s.endsWith("[]")) {
|
|
121
122
|
const c = s.slice(0, -2);
|
|
122
|
-
|
|
123
|
+
t[c] ?? (t[c] = []), t[c].push(n);
|
|
123
124
|
} else
|
|
124
|
-
|
|
125
|
-
}),
|
|
126
|
-
},
|
|
127
|
-
const
|
|
128
|
-
for (const [
|
|
129
|
-
n !== void 0 && (Array.isArray(n) ? n.forEach((s) =>
|
|
130
|
-
return
|
|
131
|
-
},
|
|
132
|
-
const { search: e } =
|
|
133
|
-
return
|
|
134
|
-
}, te = 2e3,
|
|
125
|
+
t[s] = n;
|
|
126
|
+
}), t;
|
|
127
|
+
}, Te = (e) => {
|
|
128
|
+
const r = new URLSearchParams();
|
|
129
|
+
for (const [t, n] of Object.entries(e))
|
|
130
|
+
n !== void 0 && (Array.isArray(n) ? n.forEach((s) => r.append(`${t}[]`, `${s}`)) : r.append(t, `${n}`));
|
|
131
|
+
return r.toString();
|
|
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) => {
|
|
135
136
|
const { initialValue: s = !1, delay: c = te } = typeof e == "boolean" ? {
|
|
136
137
|
initialValue: e,
|
|
137
|
-
delay:
|
|
138
|
-
} : e, { setTimeout:
|
|
139
|
-
|
|
140
|
-
}, [
|
|
141
|
-
return [
|
|
142
|
-
}, re = (e = !1) => {
|
|
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];
|
|
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];
|
|
145
143
|
}, ne = ({
|
|
146
144
|
text: e,
|
|
147
|
-
disabled:
|
|
148
|
-
className:
|
|
145
|
+
disabled: r = !1,
|
|
146
|
+
className: t,
|
|
149
147
|
children: n,
|
|
150
148
|
dropdownClassName: s,
|
|
151
149
|
noCaret: c,
|
|
152
|
-
end:
|
|
153
|
-
minWidth:
|
|
154
|
-
inline:
|
|
150
|
+
end: i = !1,
|
|
151
|
+
minWidth: a,
|
|
152
|
+
inline: l,
|
|
155
153
|
size: d,
|
|
156
154
|
...h
|
|
157
155
|
}) => {
|
|
158
|
-
const [
|
|
159
|
-
"btn-block": !
|
|
156
|
+
const [O, L] = J(), x = u("dropdown-btn__toggle", t, {
|
|
157
|
+
"btn-block": !l,
|
|
160
158
|
"dropdown-btn__toggle--with-caret": !c
|
|
161
|
-
}),
|
|
162
|
-
return /* @__PURE__ */ m(
|
|
163
|
-
/* @__PURE__ */ o(
|
|
164
|
-
/* @__PURE__ */ o(
|
|
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 })
|
|
165
163
|
] });
|
|
166
|
-
},
|
|
164
|
+
}, Se = ({ children: e, minWidth: r, label: t = "Options" }) => /* @__PURE__ */ o(
|
|
167
165
|
ne,
|
|
168
166
|
{
|
|
169
|
-
text: /* @__PURE__ */ o(
|
|
170
|
-
"aria-label":
|
|
167
|
+
text: /* @__PURE__ */ o(p, { className: "px-1", icon: I }),
|
|
168
|
+
"aria-label": t,
|
|
171
169
|
size: "sm",
|
|
172
|
-
minWidth:
|
|
170
|
+
minWidth: r,
|
|
173
171
|
end: !0,
|
|
174
172
|
noCaret: !0,
|
|
175
173
|
inline: !0,
|
|
176
174
|
children: e
|
|
177
175
|
}
|
|
178
|
-
), oe = ({ children: e, ...
|
|
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) => {
|
|
179
177
|
if (!Y(n) || n.type !== oe)
|
|
180
178
|
throw new Error("Only NavPillItem children are allowed inside NavPills.");
|
|
181
179
|
return n;
|
|
182
180
|
}) }) });
|
|
183
|
-
function
|
|
184
|
-
return typeof e == "object" ?
|
|
181
|
+
function C(e, r, t) {
|
|
182
|
+
return typeof e == "object" ? C(e.currentField, e.newField, e.currentOrderDir) : e !== r ? "ASC" : t ? {
|
|
185
183
|
ASC: "DESC",
|
|
186
184
|
DESC: void 0
|
|
187
|
-
}[
|
|
185
|
+
}[t] : "ASC";
|
|
188
186
|
}
|
|
189
|
-
function se(e,
|
|
187
|
+
function se(e, r, t) {
|
|
190
188
|
return typeof e == "object" ? se(e.currentField, e.newField, e.currentOrderDir) : {
|
|
191
|
-
field:
|
|
192
|
-
dir:
|
|
189
|
+
field: r,
|
|
190
|
+
dir: C(e, r, t)
|
|
193
191
|
};
|
|
194
192
|
}
|
|
195
|
-
const
|
|
196
|
-
const c =
|
|
197
|
-
return n[
|
|
198
|
-
}),
|
|
199
|
-
const [
|
|
200
|
-
return { field:
|
|
201
|
-
},
|
|
202
|
-
const [
|
|
203
|
-
return [
|
|
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) => {
|
|
197
|
+
const [r, t] = e.split("-");
|
|
198
|
+
return { field: r, dir: t };
|
|
199
|
+
}, De = (e) => {
|
|
200
|
+
const [r, t] = b(e), n = S((s, c) => t({ field: s, dir: c }), []);
|
|
201
|
+
return [r, n];
|
|
204
202
|
};
|
|
205
|
-
function
|
|
206
|
-
const
|
|
207
|
-
const
|
|
208
|
-
|
|
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);
|
|
209
207
|
};
|
|
210
|
-
return /* @__PURE__ */ m(
|
|
208
|
+
return /* @__PURE__ */ m(U, { children: [
|
|
211
209
|
/* @__PURE__ */ m(
|
|
212
|
-
|
|
210
|
+
T,
|
|
213
211
|
{
|
|
214
212
|
caret: !0,
|
|
215
213
|
color: n ? "primary" : "link",
|
|
@@ -218,83 +216,83 @@ function Ae({ items: e, order: t, onChange: r, isButton: n = !0, right: s = !1,
|
|
|
218
216
|
"btn-sm p-0": !n
|
|
219
217
|
}),
|
|
220
218
|
children: [
|
|
221
|
-
!n && /* @__PURE__ */ o(
|
|
222
|
-
n && !
|
|
223
|
-
n &&
|
|
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: [
|
|
224
222
|
c && "Order by: ",
|
|
225
|
-
e[
|
|
223
|
+
e[r.field],
|
|
226
224
|
" - ",
|
|
227
|
-
/* @__PURE__ */ o("small", { children:
|
|
225
|
+
/* @__PURE__ */ o("small", { children: r.dir ?? "DESC" })
|
|
228
226
|
] })
|
|
229
227
|
]
|
|
230
228
|
}
|
|
231
229
|
),
|
|
232
|
-
/* @__PURE__ */ m(
|
|
233
|
-
Object.entries(e).map(([
|
|
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(
|
|
234
232
|
w,
|
|
235
233
|
{
|
|
236
|
-
active:
|
|
237
|
-
onClick: a
|
|
234
|
+
active: r.field === a,
|
|
235
|
+
onClick: i(a),
|
|
238
236
|
className: "d-flex justify-content-between align-items-center",
|
|
239
237
|
children: [
|
|
240
|
-
|
|
241
|
-
|
|
238
|
+
l,
|
|
239
|
+
r.field === a && /* @__PURE__ */ o(p, { icon: r.dir === "ASC" ? E : P })
|
|
242
240
|
]
|
|
243
241
|
},
|
|
244
|
-
|
|
242
|
+
a
|
|
245
243
|
)),
|
|
246
244
|
/* @__PURE__ */ o(w, { divider: !0 }),
|
|
247
|
-
/* @__PURE__ */ o(w, { disabled: !
|
|
245
|
+
/* @__PURE__ */ o(w, { disabled: !r.field, onClick: () => t(), children: /* @__PURE__ */ o("i", { children: "Clear selection" }) })
|
|
248
246
|
] })
|
|
249
247
|
] });
|
|
250
248
|
}
|
|
251
|
-
const
|
|
252
|
-
var
|
|
253
|
-
return (
|
|
254
|
-
},
|
|
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) => {
|
|
250
|
+
var r;
|
|
251
|
+
return (r = document.querySelector("html")) == null ? void 0 : r.setAttribute("data-theme", e);
|
|
252
|
+
}, Me = () => {
|
|
255
253
|
var e;
|
|
256
254
|
return ((e = document.querySelector("html")) == null ? void 0 : e.getAttribute("data-theme")) === "dark";
|
|
257
|
-
}, ae = (e = window.matchMedia.bind(window)) => e("(prefers-color-scheme: dark)").matches ? "dark" : "light",
|
|
258
|
-
const [
|
|
255
|
+
}, ae = (e = window.matchMedia.bind(window)) => e("(prefers-color-scheme: dark)").matches ? "dark" : "light", $e = (e) => {
|
|
256
|
+
const [r, t] = b(() => e ?? ae());
|
|
259
257
|
return W(() => {
|
|
260
|
-
ce(
|
|
261
|
-
}, [
|
|
258
|
+
ce(r);
|
|
259
|
+
}, [r]), [r, t];
|
|
262
260
|
};
|
|
263
261
|
export {
|
|
264
|
-
|
|
262
|
+
ge as Checkbox,
|
|
265
263
|
ne as DropdownBtn,
|
|
266
|
-
|
|
264
|
+
Ee as HIGHLIGHTED_COLOR,
|
|
267
265
|
Pe as HIGHLIGHTED_COLOR_ALPHA,
|
|
268
266
|
Ce as InputFormGroup,
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
267
|
+
K as LabeledFormGroup,
|
|
268
|
+
Ae as MAIN_COLOR,
|
|
269
|
+
Ie as MAIN_COLOR_ALPHA,
|
|
272
270
|
be as Message,
|
|
273
271
|
oe as NavPillItem,
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
272
|
+
ye as NavPills,
|
|
273
|
+
Re as OrderingDropdown,
|
|
274
|
+
He as PRIMARY_DARK_COLOR,
|
|
275
|
+
Fe as PRIMARY_LIGHT_COLOR,
|
|
276
|
+
we as Result,
|
|
277
|
+
Se as RowDropdownBtn,
|
|
278
|
+
_e as SearchField,
|
|
279
|
+
B as SimpleCard,
|
|
282
280
|
Ne as ToggleSwitch,
|
|
283
281
|
ce as changeThemeInMarkup,
|
|
284
282
|
se as determineOrder,
|
|
285
|
-
|
|
283
|
+
C as determineOrderDir,
|
|
286
284
|
ae as getSystemPreferredTheme,
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
285
|
+
Me as isDarkThemeEnabled,
|
|
286
|
+
Le as orderToString,
|
|
287
|
+
re as parseQueryString,
|
|
288
|
+
Oe as sortList,
|
|
289
|
+
xe as stringToOrder,
|
|
290
|
+
Te as stringifyQueryParams,
|
|
291
|
+
Ue as useElementRef,
|
|
292
|
+
De as useOrder,
|
|
293
|
+
ke as useParsedQuery,
|
|
294
|
+
$e as useTheme,
|
|
295
|
+
z as useTimeout,
|
|
296
|
+
ve as useTimeoutToggle,
|
|
297
|
+
J as useToggle
|
|
300
298
|
};
|
package/dist/tailwind.d.ts
CHANGED
|
@@ -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;
|
|
@@ -21,6 +23,7 @@ export declare type ButtonProps = PropsWithChildren<{
|
|
|
21
23
|
disabled?: boolean;
|
|
22
24
|
className?: string;
|
|
23
25
|
variant?: 'primary' | 'secondary' | 'danger';
|
|
26
|
+
type?: HTMLButtonElement['type'];
|
|
24
27
|
size?: Size;
|
|
25
28
|
inline?: boolean;
|
|
26
29
|
solid?: boolean;
|
|
@@ -54,7 +57,7 @@ export declare type CellProps = HTMLProps<HTMLTableCellElement> & {
|
|
|
54
57
|
type?: 'td' | 'th';
|
|
55
58
|
};
|
|
56
59
|
|
|
57
|
-
export declare const Checkbox:
|
|
60
|
+
export declare const Checkbox: ForwardRefExoticComponent<Omit<BooleanControlProps, "ref"> & RefAttributes<HTMLInputElement>>;
|
|
58
61
|
|
|
59
62
|
export declare type CheckboxProps = BooleanControlProps;
|
|
60
63
|
|
|
@@ -86,9 +89,11 @@ export declare type ExitAction = 'confirm' | 'cancel';
|
|
|
86
89
|
|
|
87
90
|
export declare const formatNumber: (number: number | string) => string;
|
|
88
91
|
|
|
89
|
-
export declare const Input:
|
|
92
|
+
export declare const Input: ForwardRefExoticComponent<Omit<InputHTMLAttributes<HTMLInputElement>, "defaultChecked" | "checked" | "size"> & BaseInputProps & {
|
|
93
|
+
borderless?: boolean;
|
|
94
|
+
} & RefAttributes<HTMLInputElement>>;
|
|
90
95
|
|
|
91
|
-
export declare type InputProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'size'> & BaseInputProps & {
|
|
96
|
+
export declare type InputProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'checked' | 'defaultChecked'> & BaseInputProps & {
|
|
92
97
|
borderless?: boolean;
|
|
93
98
|
};
|
|
94
99
|
|
|
@@ -96,7 +101,13 @@ export declare const keyForPage: (pageNumber: NumberOrEllipsis, index: number) =
|
|
|
96
101
|
|
|
97
102
|
export declare const Label: FC<LabelProps>;
|
|
98
103
|
|
|
99
|
-
export declare const LabelledInput:
|
|
104
|
+
export declare const LabelledInput: ForwardRefExoticComponent<Omit<InputProps, "className" | "id" | "feedback"> & {
|
|
105
|
+
label: RequiredReactNode;
|
|
106
|
+
inputClassName?: string;
|
|
107
|
+
error?: string;
|
|
108
|
+
/** Alternative to `required`. Causes the input to be required, without displaying an asterisk */
|
|
109
|
+
hiddenRequired?: boolean;
|
|
110
|
+
} & RefAttributes<HTMLInputElement>>;
|
|
100
111
|
|
|
101
112
|
export declare type LabelledInputProps = Omit<InputProps, 'className' | 'id' | 'feedback'> & {
|
|
102
113
|
label: RequiredReactNode;
|
|
@@ -106,7 +117,23 @@ export declare type LabelledInputProps = Omit<InputProps, 'className' | 'id' | '
|
|
|
106
117
|
hiddenRequired?: boolean;
|
|
107
118
|
};
|
|
108
119
|
|
|
109
|
-
export declare const
|
|
120
|
+
export declare const LabelledRevealablePasswordInput: ForwardRefExoticComponent<Omit<RevealablePasswordInputProps, "className" | "id" | "feedback"> & {
|
|
121
|
+
label: RequiredReactNode;
|
|
122
|
+
inputClassName?: string;
|
|
123
|
+
error?: string;
|
|
124
|
+
/** Alternative to `required`. Causes the input to be required, without displaying an asterisk */
|
|
125
|
+
hiddenRequired?: boolean;
|
|
126
|
+
} & RefAttributes<HTMLInputElement>>;
|
|
127
|
+
|
|
128
|
+
export declare type LabelledRevealablePasswordInputProps = Omit<RevealablePasswordInputProps, 'className' | 'id' | 'feedback'> & {
|
|
129
|
+
label: RequiredReactNode;
|
|
130
|
+
inputClassName?: string;
|
|
131
|
+
error?: string;
|
|
132
|
+
/** Alternative to `required`. Causes the input to be required, without displaying an asterisk */
|
|
133
|
+
hiddenRequired?: boolean;
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
export declare const LabelledSelect: ForwardRefExoticComponent<Omit<LabelledSelectProps, "ref"> & RefAttributes<HTMLSelectElement>>;
|
|
110
137
|
|
|
111
138
|
export declare type LabelledSelectProps = Omit<SelectProps, 'className' | 'id'> & {
|
|
112
139
|
label: RequiredReactNode;
|
|
@@ -183,7 +210,7 @@ export declare const prettifyPageNumber: (pageNumber: NumberOrEllipsis) => strin
|
|
|
183
210
|
|
|
184
211
|
export declare const progressivePagination: (currentPage: number, pageCount: number) => NumberOrEllipsis[];
|
|
185
212
|
|
|
186
|
-
declare type RegularButtonProps = Omit<HTMLProps<HTMLButtonElement>, 'size'>;
|
|
213
|
+
declare type RegularButtonProps = Omit<HTMLProps<HTMLButtonElement>, 'size' | 'type'>;
|
|
187
214
|
|
|
188
215
|
declare type RegularCardModalProps = CommonCardModalProps & {
|
|
189
216
|
/** Danger dialogs use danger variants in title and confirm button */
|
|
@@ -218,9 +245,21 @@ export declare type ResultProps = PropsWithChildren<{
|
|
|
218
245
|
size?: Size;
|
|
219
246
|
}>;
|
|
220
247
|
|
|
248
|
+
export declare const RevealablePasswordInput: ForwardRefExoticComponent<Omit<InputProps, "type"> & {
|
|
249
|
+
containerClassName?: string;
|
|
250
|
+
} & RefAttributes<HTMLInputElement>>;
|
|
251
|
+
|
|
252
|
+
export declare type RevealablePasswordInputProps = Omit<InputProps, 'type'> & {
|
|
253
|
+
containerClassName?: string;
|
|
254
|
+
};
|
|
255
|
+
|
|
221
256
|
export declare const roundTen: (number: number) => number;
|
|
222
257
|
|
|
223
|
-
export declare const SearchInput:
|
|
258
|
+
export declare const SearchInput: ForwardRefExoticComponent<Omit<InputProps, "className" | "onChange" | "value"> & {
|
|
259
|
+
onChange: (searchTerm: string) => void;
|
|
260
|
+
containerClassName?: string;
|
|
261
|
+
inputClassName?: string;
|
|
262
|
+
} & RefAttributes<HTMLInputElement>>;
|
|
224
263
|
|
|
225
264
|
export declare type SearchInputProps = Omit<InputProps, 'className' | 'onChange' | 'value'> & {
|
|
226
265
|
onChange: (searchTerm: string) => void;
|
|
@@ -230,9 +269,9 @@ export declare type SearchInputProps = Omit<InputProps, 'className' | 'onChange'
|
|
|
230
269
|
|
|
231
270
|
export declare type SectionType = 'head' | 'body' | 'footer';
|
|
232
271
|
|
|
233
|
-
export declare const Select:
|
|
272
|
+
export declare const Select: ForwardRefExoticComponent<Omit<SelectProps, "ref"> & RefAttributes<HTMLSelectElement>>;
|
|
234
273
|
|
|
235
|
-
declare type SelectElementProps = Omit<HTMLProps<HTMLSelectElement>, 'size'>;
|
|
274
|
+
declare type SelectElementProps = Omit<HTMLProps<HTMLSelectElement>, 'size' | 'checked' | 'defaultChecked'>;
|
|
236
275
|
|
|
237
276
|
export declare type SelectProps = PropsWithChildren<SelectElementProps & BaseInputProps>;
|
|
238
277
|
|
|
@@ -268,7 +307,7 @@ declare type TitleProps = {
|
|
|
268
307
|
titleSize?: Size;
|
|
269
308
|
};
|
|
270
309
|
|
|
271
|
-
export declare const ToggleSwitch:
|
|
310
|
+
export declare const ToggleSwitch: ForwardRefExoticComponent<Omit<BooleanControlProps, "ref"> & RefAttributes<HTMLInputElement>>;
|
|
272
311
|
|
|
273
312
|
export declare type ToggleSwitchProps = BooleanControlProps;
|
|
274
313
|
|