@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/tailwind.preset.css
CHANGED
|
@@ -92,6 +92,7 @@
|
|
|
92
92
|
@layer base {
|
|
93
93
|
:root {
|
|
94
94
|
--header-height: 56px;
|
|
95
|
+
--tw-header-height: 52px;
|
|
95
96
|
|
|
96
97
|
/* Chevron image for selects */
|
|
97
98
|
--chevron-down: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/></svg>");
|
|
@@ -182,6 +183,11 @@
|
|
|
182
183
|
@apply tw:focus-ring-base tw:focus-visible:ring-zinc-500/50;
|
|
183
184
|
}
|
|
184
185
|
|
|
186
|
+
@utility focus-within-ring {
|
|
187
|
+
@apply tw:outline-none tw:focus-within:ring-3 tw:focus-within:z-1 tw:transition-[box-shadow];
|
|
188
|
+
@apply tw:focus-within:ring-lm-brand/50 tw:dark:focus-within:ring-dm-brand/50;
|
|
189
|
+
}
|
|
190
|
+
|
|
185
191
|
@utility scroll-thin {
|
|
186
192
|
/* Standard. New browsers */
|
|
187
193
|
scrollbar-width: thin;
|
|
@@ -195,6 +201,21 @@
|
|
|
195
201
|
}
|
|
196
202
|
}
|
|
197
203
|
|
|
204
|
+
@utility no-clear-button {
|
|
205
|
+
&::-webkit-search-cancel-button {
|
|
206
|
+
display: none;
|
|
207
|
+
}
|
|
208
|
+
&::-ms-clear {
|
|
209
|
+
display: none;
|
|
210
|
+
}
|
|
211
|
+
&::-o-clear {
|
|
212
|
+
display: none;
|
|
213
|
+
}
|
|
214
|
+
&::-moz-clear {
|
|
215
|
+
display: none;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
|
|
198
219
|
@custom-variant highlight {
|
|
199
220
|
&:hover,
|
|
200
221
|
&:focus-visible {
|
package/package.json
CHANGED
|
@@ -59,19 +59,19 @@
|
|
|
59
59
|
"devDependencies": {
|
|
60
60
|
"@shlinkio/eslint-config-js-coding-standard": "~3.5.0",
|
|
61
61
|
"@stylistic/eslint-plugin": "^4.4.1",
|
|
62
|
-
"@tailwindcss/vite": "^4.1.
|
|
62
|
+
"@tailwindcss/vite": "^4.1.10",
|
|
63
63
|
"@testing-library/jest-dom": "^6.6.3",
|
|
64
64
|
"@testing-library/react": "^16.3.0",
|
|
65
65
|
"@testing-library/user-event": "^14.6.1",
|
|
66
66
|
"@total-typescript/shoehorn": "^0.1.2",
|
|
67
|
-
"@types/react": "^19.1.
|
|
67
|
+
"@types/react": "^19.1.8",
|
|
68
68
|
"@types/react-dom": "^19.1.6",
|
|
69
|
-
"@vitejs/plugin-react": "^4.5.
|
|
70
|
-
"@vitest/browser": "^3.2.
|
|
71
|
-
"@vitest/coverage-v8": "^3.2.
|
|
69
|
+
"@vitejs/plugin-react": "^4.5.2",
|
|
70
|
+
"@vitest/browser": "^3.2.3",
|
|
71
|
+
"@vitest/coverage-v8": "^3.2.3",
|
|
72
72
|
"axe-core": "^4.10.3",
|
|
73
73
|
"bootstrap": "5.2.3",
|
|
74
|
-
"eslint": "^9.
|
|
74
|
+
"eslint": "^9.29.0",
|
|
75
75
|
"eslint-plugin-import": "^2.31.0",
|
|
76
76
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
77
77
|
"eslint-plugin-react": "^7.37.5",
|
|
@@ -79,8 +79,8 @@
|
|
|
79
79
|
"eslint-plugin-react-hooks": "^5.2.0",
|
|
80
80
|
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
81
81
|
"history": "^5.3.0",
|
|
82
|
-
"playwright": "^1.
|
|
83
|
-
"sass": "^1.89.
|
|
82
|
+
"playwright": "^1.53.0",
|
|
83
|
+
"sass": "^1.89.2",
|
|
84
84
|
"typescript": "^5.8.3",
|
|
85
85
|
"typescript-eslint": "^8.34.0",
|
|
86
86
|
"vite": "^6.3.5",
|
|
@@ -93,5 +93,5 @@
|
|
|
93
93
|
"not ie <= 11",
|
|
94
94
|
"not op_mini all"
|
|
95
95
|
],
|
|
96
|
-
"version": "0.9.
|
|
96
|
+
"version": "0.9.12"
|
|
97
97
|
}
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import { useMemo as T, useEffect as C, useRef as A, useCallback as d, useState as b } from "react";
|
|
2
|
-
function k(e, { elementsSelector: o, focusFirstItem: r = !1, vertical: n = !0, horizontal: t = !0 }) {
|
|
3
|
-
const s = 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]), l = T(() => [...s, ...u], [s, u]);
|
|
10
|
-
C(() => {
|
|
11
|
-
const c = e.current;
|
|
12
|
-
if (!c)
|
|
13
|
-
return () => {
|
|
14
|
-
};
|
|
15
|
-
const f = new AbortController(), g = () => [...c.querySelectorAll(o)], w = g(), h = Math.max(w.findIndex((i) => i.dataset.selected === "true"), 0);
|
|
16
|
-
return w.forEach((i, a) => {
|
|
17
|
-
i.tabIndex = a === h ? 0 : -1, r && a === h && i.focus();
|
|
18
|
-
}), c.addEventListener("keydown", (i) => {
|
|
19
|
-
if (!l.includes(i.key))
|
|
20
|
-
return;
|
|
21
|
-
i.preventDefault();
|
|
22
|
-
const a = g(), p = a.findIndex((m) => m.tabIndex === 0), y = s.includes(i.key) ? a[p + 1] ?? a[0] : a[p - 1] ?? a[a.length - 1];
|
|
23
|
-
a.forEach((m) => {
|
|
24
|
-
m.tabIndex = -1;
|
|
25
|
-
}), y.tabIndex = 0, y.focus();
|
|
26
|
-
}, { signal: f.signal }), () => f.abort();
|
|
27
|
-
}, [l, e, o, r, s]);
|
|
28
|
-
}
|
|
29
|
-
function E(e, o = globalThis.setTimeout, r = globalThis.clearTimeout) {
|
|
30
|
-
const n = A(null), t = d(() => {
|
|
31
|
-
n.current && r(n.current);
|
|
32
|
-
}, [r]), s = d((u, l) => {
|
|
33
|
-
t(), n.current = o(() => {
|
|
34
|
-
u(), n.current = null;
|
|
35
|
-
}, l ?? e);
|
|
36
|
-
}, [t, e, o]);
|
|
37
|
-
return C(() => t, [t]), T(
|
|
38
|
-
() => ({ setTimeout: s, clearCurrentTimeout: t }),
|
|
39
|
-
[t, s]
|
|
40
|
-
);
|
|
41
|
-
}
|
|
42
|
-
const F = 2e3, I = (e = {}, o, r = globalThis.setTimeout, n = globalThis.clearTimeout) => {
|
|
43
|
-
const { initialValue: t = !1, delay: s = F } = typeof e == "boolean" ? {
|
|
44
|
-
initialValue: e,
|
|
45
|
-
delay: o
|
|
46
|
-
} : e, { setTimeout: u } = E(s, r, n), [l, c] = b(t), f = A(t), g = d(() => {
|
|
47
|
-
c(!f.current), u(() => c(f.current));
|
|
48
|
-
}, [u]);
|
|
49
|
-
return [l, g];
|
|
50
|
-
};
|
|
51
|
-
function L(e = !1, o = !1) {
|
|
52
|
-
const [r, n] = b(e), t = d(() => n((l) => !l), []), s = d(() => n(!0), []), u = d(() => n(!1), []);
|
|
53
|
-
return o ? { flag: r, toggle: t, setToTrue: s, setToFalse: u } : [r, t, s, u];
|
|
54
|
-
}
|
|
55
|
-
function D(e, o, r) {
|
|
56
|
-
if (!e || typeof e == "string")
|
|
57
|
-
return D({ currentField: e, newField: o, currentOrderDir: r });
|
|
58
|
-
const n = e;
|
|
59
|
-
if (n.currentField !== n.newField)
|
|
60
|
-
return "ASC";
|
|
61
|
-
const t = {
|
|
62
|
-
ASC: "DESC",
|
|
63
|
-
DESC: void 0
|
|
64
|
-
};
|
|
65
|
-
return n.currentOrderDir ? t[n.currentOrderDir] : "ASC";
|
|
66
|
-
}
|
|
67
|
-
function S(e, o, r) {
|
|
68
|
-
if (!e || typeof e == "string")
|
|
69
|
-
return S({ currentField: e, newField: o, currentOrderDir: r });
|
|
70
|
-
const n = e, t = D(n);
|
|
71
|
-
return {
|
|
72
|
-
field: t ? n.newField : void 0,
|
|
73
|
-
dir: t
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
const v = (e, { field: o, dir: r }) => !o || !r ? e : e.sort((n, t) => {
|
|
77
|
-
const s = r === "ASC" ? 1 : -1, u = r === "ASC" ? -1 : 1;
|
|
78
|
-
return n[o] > t[o] ? s : u;
|
|
79
|
-
}), M = (e) => e.dir ? `${e.field}-${e.dir}` : void 0, R = (e) => {
|
|
80
|
-
const [o, r] = e.split("-");
|
|
81
|
-
return { field: o, dir: r };
|
|
82
|
-
}, U = (e) => {
|
|
83
|
-
const [o, r] = b(e), n = d(
|
|
84
|
-
(t, s) => r(
|
|
85
|
-
t && typeof t == "object" ? t : { field: t, dir: s }
|
|
86
|
-
),
|
|
87
|
-
[]
|
|
88
|
-
);
|
|
89
|
-
return [o, n];
|
|
90
|
-
};
|
|
91
|
-
export {
|
|
92
|
-
k as a,
|
|
93
|
-
E as b,
|
|
94
|
-
I as c,
|
|
95
|
-
D as d,
|
|
96
|
-
S as e,
|
|
97
|
-
R as f,
|
|
98
|
-
U as g,
|
|
99
|
-
M as o,
|
|
100
|
-
v as s,
|
|
101
|
-
L as u
|
|
102
|
-
};
|