@shlinkio/shlink-frontend-kit 0.9.10 → 0.9.12
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 +10 -0
- package/dist/index.js +32 -31
- package/dist/ordering-pAYMfJPl.js +108 -0
- package/dist/tailwind.d.ts +80 -3
- package/dist/tailwind.js +800 -571
- package/dist/tailwind.preset.css +21 -0
- package/package.json +9 -9
- package/dist/ordering-VI1mTe3x.js +0 -102
package/dist/index.d.ts
CHANGED
|
@@ -84,6 +84,16 @@ export declare type InputFormGroupProps = PropsWithChildren<{
|
|
|
84
84
|
|
|
85
85
|
export declare const isDarkThemeEnabled: () => boolean;
|
|
86
86
|
|
|
87
|
+
/**
|
|
88
|
+
* Determines if a color is light or not, based on its perceived lightness.
|
|
89
|
+
*
|
|
90
|
+
* For an RGB color, lightness is represented as a number from 0 to 256.
|
|
91
|
+
* The lower the number, the darker is the color perceived.
|
|
92
|
+
*
|
|
93
|
+
* HSP by Darel Rex Finley https://alienryderflex.com/hsp.html
|
|
94
|
+
*/
|
|
95
|
+
export declare function isLightColor(colorHex: string): boolean;
|
|
96
|
+
|
|
87
97
|
/** @deprecated */
|
|
88
98
|
export declare const LabeledFormGroup: FC<LabeledFormGroupProps>;
|
|
89
99
|
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as n, jsxs as i, Fragment as f } from "react/jsx-runtime";
|
|
2
2
|
import { faCircleNotch as S, faSearch as R, faEllipsisV as D, faSortAmountUp as P, faSortAmountDown as E } from "@fortawesome/free-solid-svg-icons";
|
|
3
|
-
import { FontAwesomeIcon as
|
|
3
|
+
import { FontAwesomeIcon as g } from "@fortawesome/react-fontawesome";
|
|
4
4
|
import { clsx as u } from "clsx";
|
|
5
|
-
import { Card as w, CardHeader as H, CardBody as M, Dropdown as v, DropdownToggle as k, DropdownMenu as C, NavItem as $, NavLink as F, Nav as G, DropdownItem as
|
|
5
|
+
import { Card as w, CardHeader as H, CardBody as M, Dropdown as v, DropdownToggle as k, DropdownMenu as C, NavItem as $, NavLink as F, Nav as G, DropdownItem as b } from "reactstrap";
|
|
6
6
|
import { useId as O, useState as x, useRef as j, useCallback as U, useMemo as q, Children as Q, isValidElement as V, useEffect as Y } from "react";
|
|
7
|
-
import { u as
|
|
8
|
-
import { e as He,
|
|
7
|
+
import { u as L, d as W } from "./ordering-pAYMfJPl.js";
|
|
8
|
+
import { e as He, i as Me, o as $e, s as Fe, f as Ge, a as je, g as Ue, b as qe, c as Qe } from "./ordering-pAYMfJPl.js";
|
|
9
9
|
import { useNavigate as z, useLocation as J, NavLink as X } from "react-router";
|
|
10
10
|
const ue = ({ className: r, children: e, loading: s = !1, type: t = "default", fullWidth: a = !1 }) => /* @__PURE__ */ n(
|
|
11
11
|
w,
|
|
@@ -24,7 +24,7 @@ const ue = ({ className: r, children: e, loading: s = !1, type: t = "default", f
|
|
|
24
24
|
"text-danger": t === "error"
|
|
25
25
|
}),
|
|
26
26
|
children: [
|
|
27
|
-
s && /* @__PURE__ */ n(
|
|
27
|
+
s && /* @__PURE__ */ n(g, { icon: S, spin: !0 }),
|
|
28
28
|
s && /* @__PURE__ */ n("span", { className: "ms-2", children: e ?? "Loading..." }),
|
|
29
29
|
!s && e
|
|
30
30
|
]
|
|
@@ -49,7 +49,7 @@ const ue = ({ className: r, children: e, loading: s = !1, type: t = "default", f
|
|
|
49
49
|
bodyClassName: u({ "p-2": t }),
|
|
50
50
|
children: r
|
|
51
51
|
}
|
|
52
|
-
),
|
|
52
|
+
), T = ({ checked: r = !1, onChange: e, className: s, children: t, type: a, inline: c = !1 }) => {
|
|
53
53
|
const l = O(), h = (m) => e == null ? void 0 : e(m.target.checked, m), d = {
|
|
54
54
|
"form-switch": a === "switch",
|
|
55
55
|
"form-checkbox": a === "checkbox"
|
|
@@ -58,10 +58,10 @@ const ue = ({ className: r, children: e, loading: s = !1, type: t = "default", f
|
|
|
58
58
|
/* @__PURE__ */ n("input", { type: "checkbox", className: "form-check-input", id: l, checked: r, onChange: h }),
|
|
59
59
|
/* @__PURE__ */ n("label", { className: "form-check-label", htmlFor: l, children: t })
|
|
60
60
|
] });
|
|
61
|
-
}, pe = (r) => /* @__PURE__ */ n(
|
|
61
|
+
}, pe = (r) => /* @__PURE__ */ n(T, { type: "checkbox", ...r }), ge = (r) => /* @__PURE__ */ n(T, { type: "switch", ...r }), B = ({ children: r, label: e, className: s = "", labelClassName: t = "", noMargin: a = !1, id: c }) => /* @__PURE__ */ i("div", { className: `${s} ${a ? "" : "mb-3"}`, children: [
|
|
62
62
|
/* @__PURE__ */ n("label", { className: `form-label ${t}`, htmlFor: c, children: e }),
|
|
63
63
|
r
|
|
64
|
-
] }),
|
|
64
|
+
] }), be = ({ children: r, value: e, onChange: s, type: t, required: a, placeholder: c, className: l, labelClassName: h }) => {
|
|
65
65
|
const d = O();
|
|
66
66
|
return /* @__PURE__ */ n(B, { label: /* @__PURE__ */ i(f, { children: [
|
|
67
67
|
r,
|
|
@@ -102,7 +102,7 @@ const _ = () => {
|
|
|
102
102
|
onChange: (o) => d(o.target.value)
|
|
103
103
|
}
|
|
104
104
|
),
|
|
105
|
-
/* @__PURE__ */ n(
|
|
105
|
+
/* @__PURE__ */ n(g, { icon: R, className: "search-field__icon" }),
|
|
106
106
|
/* @__PURE__ */ n(
|
|
107
107
|
"button",
|
|
108
108
|
{
|
|
@@ -148,18 +148,18 @@ const _ = () => {
|
|
|
148
148
|
size: o,
|
|
149
149
|
...m
|
|
150
150
|
}) => {
|
|
151
|
-
const [N,
|
|
151
|
+
const [N, y] = L(), A = u("dropdown-btn__toggle", s, {
|
|
152
152
|
"btn-block": !d,
|
|
153
153
|
"dropdown-btn__toggle--with-caret": !c
|
|
154
154
|
}), I = { minWidth: h && `${h}px` };
|
|
155
|
-
return /* @__PURE__ */ i(v, { isOpen: N, toggle:
|
|
155
|
+
return /* @__PURE__ */ i(v, { isOpen: N, toggle: y, disabled: e, className: a, children: [
|
|
156
156
|
/* @__PURE__ */ n(k, { size: o, caret: !c, className: A, color: "primary", ...m, children: r }),
|
|
157
157
|
/* @__PURE__ */ n(C, { className: "w-100", end: l, style: I, children: N && t })
|
|
158
158
|
] });
|
|
159
159
|
}, Ce = ({ children: r, minWidth: e, label: s = "Options" }) => /* @__PURE__ */ n(
|
|
160
160
|
re,
|
|
161
161
|
{
|
|
162
|
-
text: /* @__PURE__ */ n(
|
|
162
|
+
text: /* @__PURE__ */ n(g, { className: "px-1", icon: D }),
|
|
163
163
|
"aria-label": s,
|
|
164
164
|
size: "sm",
|
|
165
165
|
minWidth: e,
|
|
@@ -174,7 +174,7 @@ const _ = () => {
|
|
|
174
174
|
return t;
|
|
175
175
|
}) }) });
|
|
176
176
|
function xe({ items: r, order: e, onChange: s, isButton: t = !0, right: a = !1, prefixed: c = !0 }) {
|
|
177
|
-
const [l, h] =
|
|
177
|
+
const [l, h] = L(), d = (o) => () => {
|
|
178
178
|
const m = W(o, e.field, e.dir);
|
|
179
179
|
s(m ? o : void 0, m);
|
|
180
180
|
};
|
|
@@ -202,7 +202,7 @@ function xe({ items: r, order: e, onChange: s, isButton: t = !0, right: a = !1,
|
|
|
202
202
|
),
|
|
203
203
|
/* @__PURE__ */ n(C, { end: a, className: "w-100", style: t ? void 0 : { minWidth: "11rem" }, children: l && /* @__PURE__ */ i(f, { children: [
|
|
204
204
|
Object.entries(r).map(([o, m]) => /* @__PURE__ */ i(
|
|
205
|
-
|
|
205
|
+
b,
|
|
206
206
|
{
|
|
207
207
|
active: e.field === o,
|
|
208
208
|
onClick: d(o),
|
|
@@ -210,17 +210,17 @@ function xe({ items: r, order: e, onChange: s, isButton: t = !0, right: a = !1,
|
|
|
210
210
|
tabIndex: -1,
|
|
211
211
|
children: [
|
|
212
212
|
m,
|
|
213
|
-
e.field === o && /* @__PURE__ */ n(
|
|
213
|
+
e.field === o && /* @__PURE__ */ n(g, { icon: e.dir === "ASC" ? P : E })
|
|
214
214
|
]
|
|
215
215
|
},
|
|
216
216
|
o
|
|
217
217
|
)),
|
|
218
|
-
/* @__PURE__ */ n(
|
|
219
|
-
/* @__PURE__ */ n(
|
|
218
|
+
/* @__PURE__ */ n(b, { divider: !0, tag: "hr" }),
|
|
219
|
+
/* @__PURE__ */ n(b, { disabled: !e.field, onClick: () => s(), tabIndex: -1, children: /* @__PURE__ */ n("i", { children: "Clear selection" }) })
|
|
220
220
|
] }) })
|
|
221
221
|
] });
|
|
222
222
|
}
|
|
223
|
-
const
|
|
223
|
+
const Le = "#4696e5", Te = "rgba(70, 150, 229, 0.4)", ye = "#f77f28", Ae = "rgba(247, 127, 40, 0.4)", Ie = "white", Se = "#161b22", se = (r) => {
|
|
224
224
|
var e;
|
|
225
225
|
return (e = document.querySelector("html")) == null ? void 0 : e.setAttribute("data-theme", r);
|
|
226
226
|
}, Re = () => {
|
|
@@ -235,12 +235,12 @@ const Te = "#4696e5", ye = "rgba(70, 150, 229, 0.4)", Le = "#f77f28", Ae = "rgba
|
|
|
235
235
|
export {
|
|
236
236
|
pe as Checkbox,
|
|
237
237
|
re as DropdownBtn,
|
|
238
|
-
|
|
238
|
+
ye as HIGHLIGHTED_COLOR,
|
|
239
239
|
Ae as HIGHLIGHTED_COLOR_ALPHA,
|
|
240
|
-
|
|
240
|
+
be as InputFormGroup,
|
|
241
241
|
B as LabeledFormGroup,
|
|
242
|
-
|
|
243
|
-
|
|
242
|
+
Le as MAIN_COLOR,
|
|
243
|
+
Te as MAIN_COLOR_ALPHA,
|
|
244
244
|
ue as Message,
|
|
245
245
|
te as NavPillItem,
|
|
246
246
|
Oe as NavPills,
|
|
@@ -251,24 +251,25 @@ export {
|
|
|
251
251
|
Ce as RowDropdownBtn,
|
|
252
252
|
we as SearchField,
|
|
253
253
|
Z as SimpleCard,
|
|
254
|
-
|
|
254
|
+
ge as ToggleSwitch,
|
|
255
255
|
se as changeThemeInMarkup,
|
|
256
256
|
He as determineOrder,
|
|
257
257
|
W as determineOrderDir,
|
|
258
258
|
ne as getSystemPreferredTheme,
|
|
259
259
|
Re as isDarkThemeEnabled,
|
|
260
|
-
Me as
|
|
260
|
+
Me as isLightColor,
|
|
261
|
+
$e as orderToString,
|
|
261
262
|
ee as parseQueryString,
|
|
262
|
-
|
|
263
|
-
|
|
263
|
+
Fe as sortList,
|
|
264
|
+
Ge as stringToOrder,
|
|
264
265
|
ve as stringifyQueryParams,
|
|
265
|
-
|
|
266
|
+
je as useArrowKeyNavigation,
|
|
266
267
|
Ne as useElementRef,
|
|
267
268
|
_e as useGoBack,
|
|
268
|
-
|
|
269
|
+
Ue as useOrder,
|
|
269
270
|
ke as useParsedQuery,
|
|
270
271
|
De as useTheme,
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
272
|
+
qe as useTimeout,
|
|
273
|
+
Qe as useTimeoutToggle,
|
|
274
|
+
L as useToggle
|
|
274
275
|
};
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { useMemo as T, useEffect as y, useRef as E, useCallback as d, useState as m } from "react";
|
|
2
|
+
function I(e, { elementsSelector: s, focusFirstItem: r = !1, vertical: n = !0, horizontal: t = !0 }) {
|
|
3
|
+
const o = T(() => {
|
|
4
|
+
const c = [];
|
|
5
|
+
return n && c.push("ArrowDown"), t && c.push("ArrowRight"), c;
|
|
6
|
+
}, [t, n]), u = T(() => {
|
|
7
|
+
const c = [];
|
|
8
|
+
return n && c.push("ArrowUp"), t && c.push("ArrowLeft"), c;
|
|
9
|
+
}, [t, n]), i = T(() => [...o, ...u], [o, u]);
|
|
10
|
+
y(() => {
|
|
11
|
+
const c = e.current;
|
|
12
|
+
if (!c)
|
|
13
|
+
return () => {
|
|
14
|
+
};
|
|
15
|
+
const f = new AbortController(), g = () => [...c.querySelectorAll(s)], b = g(), p = Math.max(b.findIndex((l) => l.dataset.selected === "true"), 0);
|
|
16
|
+
return b.forEach((l, a) => {
|
|
17
|
+
l.tabIndex = a === p ? 0 : -1, r && a === p && l.focus();
|
|
18
|
+
}), c.addEventListener("keydown", (l) => {
|
|
19
|
+
if (!i.includes(l.key))
|
|
20
|
+
return;
|
|
21
|
+
l.preventDefault();
|
|
22
|
+
const a = g(), w = a.findIndex((h) => h.tabIndex === 0), C = o.includes(l.key) ? a[w + 1] ?? a[0] : a[w - 1] ?? a[a.length - 1];
|
|
23
|
+
a.forEach((h) => {
|
|
24
|
+
h.tabIndex = -1;
|
|
25
|
+
}), C.tabIndex = 0, C.focus();
|
|
26
|
+
}, { signal: f.signal }), () => f.abort();
|
|
27
|
+
}, [i, e, s, r, o]);
|
|
28
|
+
}
|
|
29
|
+
const D = 128;
|
|
30
|
+
function k(e) {
|
|
31
|
+
const [s, r, n] = (e.match(/../g) ?? []).map((o) => parseInt(o, 16) || 0);
|
|
32
|
+
return Math.round(Math.sqrt(0.299 * s ** 2 + 0.587 * r ** 2 + 0.114 * n ** 2)) >= D;
|
|
33
|
+
}
|
|
34
|
+
function F(e, s = globalThis.setTimeout, r = globalThis.clearTimeout) {
|
|
35
|
+
const n = E(null), t = d(() => {
|
|
36
|
+
n.current && r(n.current);
|
|
37
|
+
}, [r]), o = d((u, i) => {
|
|
38
|
+
t(), n.current = s(() => {
|
|
39
|
+
u(), n.current = null;
|
|
40
|
+
}, i ?? e);
|
|
41
|
+
}, [t, e, s]);
|
|
42
|
+
return y(() => t, [t]), T(
|
|
43
|
+
() => ({ setTimeout: o, clearCurrentTimeout: t }),
|
|
44
|
+
[t, o]
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
const S = 2e3, v = (e = {}, s, r = globalThis.setTimeout, n = globalThis.clearTimeout) => {
|
|
48
|
+
const { initialValue: t = !1, delay: o = S } = typeof e == "boolean" ? {
|
|
49
|
+
initialValue: e,
|
|
50
|
+
delay: s
|
|
51
|
+
} : e, { setTimeout: u } = F(o, r, n), [i, c] = m(t), f = E(t), g = d(() => {
|
|
52
|
+
c(!f.current), u(() => c(f.current));
|
|
53
|
+
}, [u]);
|
|
54
|
+
return [i, g];
|
|
55
|
+
};
|
|
56
|
+
function M(e = !1, s = !1) {
|
|
57
|
+
const [r, n] = m(e), t = d(() => n((i) => !i), []), o = d(() => n(!0), []), u = d(() => n(!1), []);
|
|
58
|
+
return s ? { flag: r, toggle: t, setToTrue: o, setToFalse: u } : [r, t, o, u];
|
|
59
|
+
}
|
|
60
|
+
function A(e, s, r) {
|
|
61
|
+
if (!e || typeof e == "string")
|
|
62
|
+
return A({ currentField: e, newField: s, currentOrderDir: r });
|
|
63
|
+
const n = e;
|
|
64
|
+
if (n.currentField !== n.newField)
|
|
65
|
+
return "ASC";
|
|
66
|
+
const t = {
|
|
67
|
+
ASC: "DESC",
|
|
68
|
+
DESC: void 0
|
|
69
|
+
};
|
|
70
|
+
return n.currentOrderDir ? t[n.currentOrderDir] : "ASC";
|
|
71
|
+
}
|
|
72
|
+
function L(e, s, r) {
|
|
73
|
+
if (!e || typeof e == "string")
|
|
74
|
+
return L({ currentField: e, newField: s, currentOrderDir: r });
|
|
75
|
+
const n = e, t = A(n);
|
|
76
|
+
return {
|
|
77
|
+
field: t ? n.newField : void 0,
|
|
78
|
+
dir: t
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
const R = (e, { field: s, dir: r }) => !s || !r ? e : e.sort((n, t) => {
|
|
82
|
+
const o = r === "ASC" ? 1 : -1, u = r === "ASC" ? -1 : 1;
|
|
83
|
+
return n[s] > t[s] ? o : u;
|
|
84
|
+
}), N = (e) => e.dir ? `${e.field}-${e.dir}` : void 0, q = (e) => {
|
|
85
|
+
const [s, r] = e.split("-");
|
|
86
|
+
return { field: s, dir: r };
|
|
87
|
+
}, K = (e) => {
|
|
88
|
+
const [s, r] = m(e), n = d(
|
|
89
|
+
(t, o) => r(
|
|
90
|
+
t && typeof t == "object" ? t : { field: t, dir: o }
|
|
91
|
+
),
|
|
92
|
+
[]
|
|
93
|
+
);
|
|
94
|
+
return [s, n];
|
|
95
|
+
};
|
|
96
|
+
export {
|
|
97
|
+
I as a,
|
|
98
|
+
F as b,
|
|
99
|
+
v as c,
|
|
100
|
+
A as d,
|
|
101
|
+
L as e,
|
|
102
|
+
q as f,
|
|
103
|
+
K as g,
|
|
104
|
+
k as i,
|
|
105
|
+
N as o,
|
|
106
|
+
R as s,
|
|
107
|
+
M as u
|
|
108
|
+
};
|
package/dist/tailwind.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ChangeEvent } from 'react';
|
|
2
2
|
import { Coords } from '@floating-ui/utils';
|
|
3
3
|
import { FC } from 'react';
|
|
4
|
+
import { ForwardedRef } from 'react';
|
|
4
5
|
import { ForwardRefExoticComponent } from 'react';
|
|
5
6
|
import { HTMLProps } from 'react';
|
|
6
7
|
import { InputHTMLAttributes } from 'react';
|
|
@@ -20,10 +21,17 @@ declare type AnchorProps = Omit<LinkProps, 'role' | 'aria-disabled' | 'tabIndex'
|
|
|
20
21
|
export declare type BaseInputProps = {
|
|
21
22
|
size?: Size;
|
|
22
23
|
feedback?: 'error';
|
|
24
|
+
/**
|
|
25
|
+
* Whether the input should have an opinionated style or not. Defaults to 'default'.
|
|
26
|
+
* An unstyled input can be useful to wrap or customize.
|
|
27
|
+
*/
|
|
28
|
+
variant?: 'default' | 'unstyled';
|
|
23
29
|
};
|
|
24
30
|
|
|
25
31
|
declare type BaseInputProps_2 = Omit<SearchInputProps, 'role' | 'aria-autocomplete' | 'aria-expanded' | 'aria-controls' | 'aria-activedescendant' | 'onChange' | 'autoComplete' | 'autoCorrect'>;
|
|
26
32
|
|
|
33
|
+
export declare const BaseNavBar: FC<NavBarProps>;
|
|
34
|
+
|
|
27
35
|
declare type BooleanControlProps = Omit<HTMLProps<HTMLInputElement>, 'type' | 'onChange' | 'value' | 'defaultValue'> & {
|
|
28
36
|
onChange?: (checked: boolean, e: ChangeEvent<HTMLInputElement>) => void;
|
|
29
37
|
};
|
|
@@ -100,6 +108,8 @@ export declare type CloseButtonProps = {
|
|
|
100
108
|
label?: string;
|
|
101
109
|
onClick?: HTMLProps<HTMLButtonElement>['onClick'];
|
|
102
110
|
className?: string;
|
|
111
|
+
size?: Size;
|
|
112
|
+
solid?: boolean;
|
|
103
113
|
};
|
|
104
114
|
|
|
105
115
|
declare type CommonCardModalProps = {
|
|
@@ -148,7 +158,7 @@ export declare type DropdownProps = PropsWithChildren<{
|
|
|
148
158
|
buttonContent: RequiredReactNode;
|
|
149
159
|
buttonSize?: Size;
|
|
150
160
|
buttonClassName?: string;
|
|
151
|
-
buttonVariant?: 'button' | 'link';
|
|
161
|
+
buttonVariant?: 'button' | 'link' | 'text';
|
|
152
162
|
buttonDisabled?: boolean;
|
|
153
163
|
/** Set as the button's `aria-label` attribute */
|
|
154
164
|
buttonLabel?: string;
|
|
@@ -161,6 +171,8 @@ export declare type DropdownProps = PropsWithChildren<{
|
|
|
161
171
|
* Defaults to 'left'.
|
|
162
172
|
*/
|
|
163
173
|
menuAlignment?: 'left' | 'right';
|
|
174
|
+
/** Distance between toggle button and menu when open, in pixels. Defaults to 3 */
|
|
175
|
+
menuOffset?: number;
|
|
164
176
|
/** Whether to hide the caret or not. Defaults to false */
|
|
165
177
|
caretless?: boolean;
|
|
166
178
|
}>;
|
|
@@ -189,6 +201,10 @@ export declare type InputProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'si
|
|
|
189
201
|
borderless?: boolean;
|
|
190
202
|
};
|
|
191
203
|
|
|
204
|
+
declare type ItemProps = {
|
|
205
|
+
active?: boolean;
|
|
206
|
+
};
|
|
207
|
+
|
|
192
208
|
export declare const keyForPage: (pageNumber: NumberOrEllipsis, index: number) => string;
|
|
193
209
|
|
|
194
210
|
export declare const Label: FC<LabelProps>;
|
|
@@ -327,6 +343,15 @@ export declare type ModalDialogProps = HTMLProps<HTMLDialogElement> & {
|
|
|
327
343
|
onClose: () => void;
|
|
328
344
|
};
|
|
329
345
|
|
|
346
|
+
export declare const NavBar: FC<NavBarProps> & {
|
|
347
|
+
MenuItem: FC<LinkProps & ItemProps>;
|
|
348
|
+
Dropdown: FC<Omit<DropdownProps, "menuAlignment" | "buttonVariant" | "menuOffset"> & ItemProps>;
|
|
349
|
+
};
|
|
350
|
+
|
|
351
|
+
export declare type NavBarProps = HTMLProps<HTMLElement> & {
|
|
352
|
+
brand: RequiredReactNode;
|
|
353
|
+
};
|
|
354
|
+
|
|
330
355
|
export declare const NavPills: FC<NavPillsProps> & {
|
|
331
356
|
Pill: FC<LinkProps>;
|
|
332
357
|
};
|
|
@@ -434,14 +459,18 @@ export declare const RowDropdown: FC<RowDropdownProps> & {
|
|
|
434
459
|
|
|
435
460
|
export declare type RowDropdownProps = Omit<DropdownProps, 'caretless' | 'buttonContent' | 'buttonVariant'>;
|
|
436
461
|
|
|
462
|
+
export declare const SearchCombobox: <T>(props: SearchComboboxProps<T> & {
|
|
463
|
+
ref?: ForwardedRef<HTMLInputElement>;
|
|
464
|
+
}) => ReturnType<typeof SearchComboboxInner>;
|
|
465
|
+
|
|
437
466
|
/**
|
|
438
467
|
* This component combines a SearchInput with a Listbox, to behave close to an editable combobox with autocomplete, as
|
|
439
468
|
* described in https://www.w3.org/WAI/ARIA/apg/patterns/combobox/examples/combobox-autocomplete-list/.
|
|
440
469
|
* The main difference is that the input is used only to search in the listbox, and once an item is selected, the input
|
|
441
470
|
* is cleared and the listbox is closed.
|
|
442
471
|
*/
|
|
443
|
-
|
|
444
|
-
listboxSpan, onFocus, ...rest }: SearchComboboxProps<Item>): JSX.Element;
|
|
472
|
+
declare function SearchComboboxInner<Item>({ searchResults, onSearch, onSelectSearchResult, renderSearchResult, size, // SearchInput defaults its size to 'lg'. Change it to 'md'
|
|
473
|
+
listboxSpan, onFocus, containerClassName, listboxClassName, ...rest }: SearchComboboxProps<Item>, ref: ForwardedRef<HTMLInputElement>): JSX.Element;
|
|
445
474
|
|
|
446
475
|
export declare type SearchComboboxProps<Item> = BaseInputProps_2 & {
|
|
447
476
|
/** If defined, it will display a listbox with the search results */
|
|
@@ -460,6 +489,10 @@ export declare type SearchComboboxProps<Item> = BaseInputProps_2 & {
|
|
|
460
489
|
* Defaults to `full`.
|
|
461
490
|
*/
|
|
462
491
|
listboxSpan?: 'full' | 'auto';
|
|
492
|
+
/** Classes to add to the wrapping container */
|
|
493
|
+
containerClassName?: string;
|
|
494
|
+
/** Classes to add to the listbox */
|
|
495
|
+
listboxClassName?: string;
|
|
463
496
|
};
|
|
464
497
|
|
|
465
498
|
export declare const SearchInput: ForwardRefExoticComponent<Omit<InputProps, "className" | "onChange" | "value"> & {
|
|
@@ -468,6 +501,11 @@ containerClassName?: string;
|
|
|
468
501
|
inputClassName?: string;
|
|
469
502
|
/** When set to true, it displays a loading indicator in place of the magnifyinf glass icon */
|
|
470
503
|
loading?: boolean;
|
|
504
|
+
/**
|
|
505
|
+
* Whether onChange should be triggered immediately or debounced.
|
|
506
|
+
* Defaults to false.
|
|
507
|
+
*/
|
|
508
|
+
immediate?: boolean;
|
|
471
509
|
} & RefAttributes<HTMLInputElement>>;
|
|
472
510
|
|
|
473
511
|
export declare type SearchInputProps = Omit<InputProps, 'className' | 'onChange' | 'value'> & {
|
|
@@ -476,6 +514,11 @@ export declare type SearchInputProps = Omit<InputProps, 'className' | 'onChange'
|
|
|
476
514
|
inputClassName?: string;
|
|
477
515
|
/** When set to true, it displays a loading indicator in place of the magnifyinf glass icon */
|
|
478
516
|
loading?: boolean;
|
|
517
|
+
/**
|
|
518
|
+
* Whether onChange should be triggered immediately or debounced.
|
|
519
|
+
* Defaults to false.
|
|
520
|
+
*/
|
|
521
|
+
immediate?: boolean;
|
|
479
522
|
};
|
|
480
523
|
|
|
481
524
|
export declare type SectionType = 'head' | 'body' | 'footer';
|
|
@@ -515,6 +558,40 @@ export declare type TableProps = Omit<HTMLProps<HTMLTableElement>, 'size'> & {
|
|
|
515
558
|
size?: Size;
|
|
516
559
|
};
|
|
517
560
|
|
|
561
|
+
export declare type TagItemProps = {
|
|
562
|
+
name: string;
|
|
563
|
+
color: string;
|
|
564
|
+
};
|
|
565
|
+
|
|
566
|
+
export declare const TagsAutocomplete: FC<TagsAutocompleteProps>;
|
|
567
|
+
|
|
568
|
+
export declare type TagsAutocompleteProps = {
|
|
569
|
+
/** Full list of tags from which to build the suggestions */
|
|
570
|
+
tags: string[];
|
|
571
|
+
/** Tags currently selected */
|
|
572
|
+
selectedTags?: string[];
|
|
573
|
+
/** Invoked when tags are added or removed */
|
|
574
|
+
onTagsChange?: (tags: string[]) => void;
|
|
575
|
+
/** Invoked to determine what is the color of a tag */
|
|
576
|
+
getColorForTag?: (tag: string) => string;
|
|
577
|
+
/** Search input placeholder */
|
|
578
|
+
placeholder?: string;
|
|
579
|
+
/** Classes to be added to the wrapping container */
|
|
580
|
+
containerClassName?: string;
|
|
581
|
+
/**
|
|
582
|
+
* Whether to allow adding new arbitrary tags, or only select from the list of tags.
|
|
583
|
+
* Defaults to false.
|
|
584
|
+
*/
|
|
585
|
+
immutable?: boolean;
|
|
586
|
+
/**
|
|
587
|
+
* How to filter the list of tags when searching:
|
|
588
|
+
* - `startsWith`: those that start with the search term
|
|
589
|
+
* - `includes`: those that include the search term
|
|
590
|
+
* Defaults to `startsWith`.
|
|
591
|
+
*/
|
|
592
|
+
searchMode?: 'startsWith' | 'includes';
|
|
593
|
+
} & Pick<SearchComboboxProps<string>, 'placeholder' | 'size' | 'disabled' | 'aria-label'>;
|
|
594
|
+
|
|
518
595
|
declare type TitleProps = {
|
|
519
596
|
title: ReactNode;
|
|
520
597
|
titleSize?: Size;
|