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