@shlinkio/shlink-frontend-kit 0.8.12 → 0.9.0
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 +1 -0
- package/dist/index.js +124 -131
- package/dist/tailwind.d.ts +37 -8
- package/dist/tailwind.js +381 -327
- package/dist/tailwind.preset.css +22 -16
- package/dist/use-toggle-C1uZwbSD.js +32 -0
- package/package.json +16 -14
- package/dist/use-toggle-PWLikLl6.js +0 -22
package/dist/tailwind.preset.css
CHANGED
|
@@ -6,9 +6,8 @@
|
|
|
6
6
|
|
|
7
7
|
@theme static inline {
|
|
8
8
|
/* Light mode */
|
|
9
|
-
|
|
10
|
-
--color-lm-
|
|
11
|
-
--color-lm-main-dark: #1f69c0;
|
|
9
|
+
--color-lm-brand: #2078CF;
|
|
10
|
+
--color-lm-brand-dark: color-mix(in srgb, black 20%, var(--tw-color-lm-brand) 80%);
|
|
12
11
|
--color-lm-primary: #ffffff;
|
|
13
12
|
--color-lm-primary-alfa: rgb(var(--tw-color-lm-primary) / .5);
|
|
14
13
|
--color-lm-secondary: #f5f6fe;
|
|
@@ -16,7 +15,7 @@
|
|
|
16
15
|
--color-lm-border: rgb(0 0 0 / .125);
|
|
17
16
|
--color-lm-table-border: #dee2e6;
|
|
18
17
|
--color-lm-active: #eeeeee;
|
|
19
|
-
--color-lm-
|
|
18
|
+
--color-lm-main: var(--tw-color-lm-brand);
|
|
20
19
|
--color-lm-input: var(--tw-color-lm-primary);
|
|
21
20
|
--color-lm-disabled-input: var(--tw-color-lm-secondary);
|
|
22
21
|
--color-lm-input-text: #495057;
|
|
@@ -24,8 +23,8 @@
|
|
|
24
23
|
--color-lm-table-highlight: rgb(0 0 0 / .075);
|
|
25
24
|
|
|
26
25
|
/* Dark mode */
|
|
27
|
-
--color-dm-
|
|
28
|
-
--color-dm-
|
|
26
|
+
--color-dm-brand: #4696e5;
|
|
27
|
+
--color-dm-brand-dark: color-mix(in srgb, black 25%, var(--tw-color-dm-brand) 75%);
|
|
29
28
|
--color-dm-primary: #161b22;
|
|
30
29
|
--color-dm-primary-alfa: rgb(var(--tw-color-dm-primary) / .8);
|
|
31
30
|
--color-dm-secondary: #0f131a;
|
|
@@ -33,25 +32,29 @@
|
|
|
33
32
|
--color-dm-border: rgb(255 255 255 / .15);
|
|
34
33
|
--color-dm-table-border: #393d43;
|
|
35
34
|
--color-dm-active: var(--tw-color-dm-secondary);
|
|
36
|
-
--color-dm-
|
|
35
|
+
--color-dm-main: #0b2d4e;
|
|
37
36
|
--color-dm-input: rgb(17.9928571429 22.0821428571 27.8071428571);
|
|
38
37
|
--color-dm-disabled-input: rgb(26.0071428571 31.9178571429 40.1928571429);
|
|
39
38
|
--color-dm-input-text: var(--tw-color-dm-text);
|
|
40
39
|
--color-dm-input-border: var(--tw-color-dm-border);
|
|
41
40
|
--color-dm-table-highlight: var(--tw-color-dm-border);
|
|
42
41
|
|
|
43
|
-
/* TODO Remove these two colors */
|
|
44
|
-
--color-brand: #4696e5;
|
|
45
|
-
--color-brand-dark: #1f69c0;
|
|
46
|
-
|
|
47
42
|
/* General color palette */
|
|
48
43
|
--color-danger: #dc3545;
|
|
49
|
-
--color-danger-dark:
|
|
44
|
+
--color-danger-dark: color-mix(in srgb, black 20%, var(--tw-color-danger) 80%);
|
|
50
45
|
--color-warning: #ffc107;
|
|
51
|
-
--color-warning-dark:
|
|
46
|
+
--color-warning-dark: color-mix(in srgb, black 20%, var(--tw-color-warning) 80%);
|
|
52
47
|
--color-placeholder: #6c757d;
|
|
48
|
+
|
|
49
|
+
/* Override breakpoints with the values from bootstrap, to keep sizing until fully migrated */
|
|
50
|
+
--breakpoint-sm: 576px;
|
|
51
|
+
--breakpoint-md: 768px;
|
|
52
|
+
--breakpoint-lg: 992px;
|
|
53
|
+
--breakpoint-xl: 1200px;
|
|
54
|
+
--breakpoint-2xl: 1400px;
|
|
53
55
|
}
|
|
54
56
|
|
|
57
|
+
/* Deprecated. TODO Remove with bootstrap support */
|
|
55
58
|
@layer base {
|
|
56
59
|
html:not([data-theme='dark']) {
|
|
57
60
|
--primary-color: var(--tw-color-lm-primary);
|
|
@@ -60,7 +63,7 @@
|
|
|
60
63
|
--text-color: var(--tw-color-lm-text);
|
|
61
64
|
--border-color: var(--tw-color-lm-border);
|
|
62
65
|
--active-color: var(--tw-color-lm-active);
|
|
63
|
-
--brand-color: var(--tw-color-lm-
|
|
66
|
+
--brand-color: var(--tw-color-lm-main);
|
|
64
67
|
--input-color: var(--tw-color-lm-input);
|
|
65
68
|
--input-disabled-color: var(--tw-color-lm-disabled-input);
|
|
66
69
|
--input-text-color: var(--tw-color-lm-input-text);
|
|
@@ -114,7 +117,10 @@
|
|
|
114
117
|
color: var(--tw-color-brand);
|
|
115
118
|
border-radius: var(--tw-radius-xs);
|
|
116
119
|
|
|
117
|
-
@apply
|
|
120
|
+
@apply
|
|
121
|
+
tw:focus-visible:outline-3 tw:focus-visible:outline-offset-3
|
|
122
|
+
tw:focus-visible:outline-lm-brand/50 tw:dark:focus-visible:outline-dm-brand/50
|
|
123
|
+
tw:focus-visible:z-1;
|
|
118
124
|
}
|
|
119
125
|
|
|
120
126
|
h1 {
|
|
@@ -154,7 +160,7 @@
|
|
|
154
160
|
}
|
|
155
161
|
|
|
156
162
|
@utility focus-ring {
|
|
157
|
-
@apply tw:focus-ring-base tw:focus-visible:ring-brand/50;
|
|
163
|
+
@apply tw:focus-ring-base tw:focus-visible:ring-lm-brand/50 tw:dark:focus-visible:ring-dm-brand/50;
|
|
158
164
|
}
|
|
159
165
|
|
|
160
166
|
@utility focus-ring-danger {
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { useRef as T, useCallback as c, useEffect as m, useMemo as b, useState as f } from "react";
|
|
2
|
+
function h(s, n = globalThis.setTimeout, o = globalThis.clearTimeout) {
|
|
3
|
+
const t = T(null), e = c(() => {
|
|
4
|
+
t.current && o(t.current);
|
|
5
|
+
}, [o]), l = c((u, a) => {
|
|
6
|
+
e(), t.current = n(() => {
|
|
7
|
+
u(), t.current = null;
|
|
8
|
+
}, a ?? s);
|
|
9
|
+
}, [e, s, n]);
|
|
10
|
+
return m(() => e, [e]), b(
|
|
11
|
+
() => ({ setTimeout: l, clearCurrentTimeout: e }),
|
|
12
|
+
[e, l]
|
|
13
|
+
);
|
|
14
|
+
}
|
|
15
|
+
const F = 2e3, R = (s = {}, n, o = globalThis.setTimeout, t = globalThis.clearTimeout) => {
|
|
16
|
+
const { initialValue: e = !1, delay: l = F } = typeof s == "boolean" ? {
|
|
17
|
+
initialValue: s,
|
|
18
|
+
delay: n
|
|
19
|
+
} : s, { setTimeout: u } = h(l, o, t), [a, r] = f(e), i = T(e), g = c(() => {
|
|
20
|
+
r(!i.current), u(() => r(i.current));
|
|
21
|
+
}, [u]);
|
|
22
|
+
return [a, g];
|
|
23
|
+
};
|
|
24
|
+
function k(s = !1, n = !1) {
|
|
25
|
+
const [o, t] = f(s), e = c(() => t((a) => !a), []), l = c(() => t(!0), []), u = c(() => t(!1), []);
|
|
26
|
+
return n ? { flag: o, toggle: e, setToTrue: l, setToFalse: u } : [o, e, l, u];
|
|
27
|
+
}
|
|
28
|
+
export {
|
|
29
|
+
h as a,
|
|
30
|
+
R as b,
|
|
31
|
+
k as u
|
|
32
|
+
};
|
package/package.json
CHANGED
|
@@ -38,8 +38,11 @@
|
|
|
38
38
|
"clsx": "^2.1.1"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
|
-
"@fortawesome/fontawesome-
|
|
42
|
-
"@fortawesome/free
|
|
41
|
+
"@fortawesome/fontawesome-common-types": "^6.7.2",
|
|
42
|
+
"@fortawesome/fontawesome-free": "^6.7.2",
|
|
43
|
+
"@fortawesome/fontawesome-svg-core": "^6.7.2",
|
|
44
|
+
"@fortawesome/free-regular-svg-icons": "^6.7.2",
|
|
45
|
+
"@fortawesome/free-solid-svg-icons": "^6.7.2",
|
|
43
46
|
"@fortawesome/react-fontawesome": "^0.2.2",
|
|
44
47
|
"react": "^18.3 || ^19.0",
|
|
45
48
|
"react-dom": "^18.3 || ^19.0",
|
|
@@ -55,32 +58,31 @@
|
|
|
55
58
|
"devDependencies": {
|
|
56
59
|
"@shlinkio/eslint-config-js-coding-standard": "~3.5.0",
|
|
57
60
|
"@stylistic/eslint-plugin": "^4.2.0",
|
|
58
|
-
"@tailwindcss/vite": "^4.1.
|
|
61
|
+
"@tailwindcss/vite": "^4.1.5",
|
|
59
62
|
"@testing-library/jest-dom": "^6.6.3",
|
|
60
63
|
"@testing-library/react": "^16.3.0",
|
|
61
64
|
"@testing-library/user-event": "^14.6.1",
|
|
62
65
|
"@total-typescript/shoehorn": "^0.1.2",
|
|
63
66
|
"@types/react": "^19.1.2",
|
|
64
|
-
"@types/react-dom": "^19.1.
|
|
65
|
-
"@vitejs/plugin-react": "^4.
|
|
66
|
-
"@vitest/browser": "^3.1.
|
|
67
|
-
"@vitest/coverage-v8": "^3.1.
|
|
67
|
+
"@types/react-dom": "^19.1.3",
|
|
68
|
+
"@vitejs/plugin-react": "^4.4.1",
|
|
69
|
+
"@vitest/browser": "^3.1.2",
|
|
70
|
+
"@vitest/coverage-v8": "^3.1.2",
|
|
68
71
|
"axe-core": "^4.10.3",
|
|
69
72
|
"bootstrap": "5.2.3",
|
|
70
|
-
"eslint": "^9.
|
|
73
|
+
"eslint": "^9.26.0",
|
|
71
74
|
"eslint-plugin-import": "^2.31.0",
|
|
72
75
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
73
76
|
"eslint-plugin-react": "^7.37.5",
|
|
74
|
-
"eslint-plugin-react-compiler": "^19.0.0-beta-
|
|
77
|
+
"eslint-plugin-react-compiler": "^19.0.0-beta-714736e-20250131",
|
|
75
78
|
"eslint-plugin-react-hooks": "^5.2.0",
|
|
76
79
|
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
77
80
|
"history": "^5.3.0",
|
|
78
81
|
"playwright": "^1.52.0",
|
|
79
|
-
"
|
|
80
|
-
"sass": "^1.86.3",
|
|
82
|
+
"sass": "^1.87.0",
|
|
81
83
|
"typescript": "^5.8.3",
|
|
82
|
-
"typescript-eslint": "^8.
|
|
83
|
-
"vite": "^6.
|
|
84
|
+
"typescript-eslint": "^8.31.1",
|
|
85
|
+
"vite": "^6.3.4",
|
|
84
86
|
"vite-plugin-dts": "^4.5.3",
|
|
85
87
|
"vitest": "^3.0.2"
|
|
86
88
|
},
|
|
@@ -90,5 +92,5 @@
|
|
|
90
92
|
"not ie <= 11",
|
|
91
93
|
"not op_mini all"
|
|
92
94
|
],
|
|
93
|
-
"version": "0.
|
|
95
|
+
"version": "0.9.0"
|
|
94
96
|
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { useRef as a, useCallback as o, useEffect as f, useMemo as i, useState as T } from "react";
|
|
2
|
-
function m(n, r = globalThis.setTimeout, s = globalThis.clearTimeout) {
|
|
3
|
-
const t = a(null), e = o(() => {
|
|
4
|
-
t.current && s(t.current);
|
|
5
|
-
}, [s]), u = o((l, c) => {
|
|
6
|
-
e(), t.current = r(() => {
|
|
7
|
-
l(), t.current = null;
|
|
8
|
-
}, c ?? n);
|
|
9
|
-
}, [e, n, r]);
|
|
10
|
-
return f(() => e, [e]), i(
|
|
11
|
-
() => ({ setTimeout: u, clearCurrentTimeout: e }),
|
|
12
|
-
[e, u]
|
|
13
|
-
);
|
|
14
|
-
}
|
|
15
|
-
function b(n = !1, r = !1) {
|
|
16
|
-
const [s, t] = T(n), e = o(() => t((c) => !c), []), u = o(() => t(!0), []), l = o(() => t(!1), []);
|
|
17
|
-
return r ? { flag: s, toggle: e, setToTrue: u, setToFalse: l } : [s, e, u, l];
|
|
18
|
-
}
|
|
19
|
-
export {
|
|
20
|
-
b as a,
|
|
21
|
-
m as u
|
|
22
|
-
};
|