@shlinkio/shlink-frontend-kit 0.9.10 → 0.9.11

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.
@@ -182,6 +182,11 @@
182
182
  @apply tw:focus-ring-base tw:focus-visible:ring-zinc-500/50;
183
183
  }
184
184
 
185
+ @utility focus-within-ring {
186
+ @apply tw:outline-none tw:focus-within:ring-3 tw:focus-within:z-1 tw:transition-[box-shadow];
187
+ @apply tw:focus-within:ring-lm-brand/50 tw:dark:focus-within:ring-dm-brand/50;
188
+ }
189
+
185
190
  @utility scroll-thin {
186
191
  /* Standard. New browsers */
187
192
  scrollbar-width: thin;
@@ -195,6 +200,21 @@
195
200
  }
196
201
  }
197
202
 
203
+ @utility no-clear-button {
204
+ &::-webkit-search-cancel-button {
205
+ display: none;
206
+ }
207
+ &::-ms-clear {
208
+ display: none;
209
+ }
210
+ &::-o-clear {
211
+ display: none;
212
+ }
213
+ &::-moz-clear {
214
+ display: none;
215
+ }
216
+ }
217
+
198
218
  @custom-variant highlight {
199
219
  &:hover,
200
220
  &: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.8",
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.6",
67
+ "@types/react": "^19.1.8",
68
68
  "@types/react-dom": "^19.1.6",
69
- "@vitejs/plugin-react": "^4.5.1",
70
- "@vitest/browser": "^3.2.2",
71
- "@vitest/coverage-v8": "^3.2.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.28.0",
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.52.0",
83
- "sass": "^1.89.1",
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.10"
96
+ "version": "0.9.11"
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
- };