@shlinkio/shlink-frontend-kit 0.9.5 → 0.9.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/tailwind.d.ts +3 -1
- package/dist/tailwind.js +28 -25
- package/package.json +6 -6
package/dist/tailwind.d.ts
CHANGED
|
@@ -390,7 +390,7 @@ export declare type TableElementProps = PropsWithChildren & {
|
|
|
390
390
|
className?: string;
|
|
391
391
|
};
|
|
392
392
|
|
|
393
|
-
export declare type TableProps = HTMLProps<HTMLTableElement> & {
|
|
393
|
+
export declare type TableProps = Omit<HTMLProps<HTMLTableElement>, 'size'> & {
|
|
394
394
|
header: ReactNode;
|
|
395
395
|
footer?: ReactNode;
|
|
396
396
|
/**
|
|
@@ -398,6 +398,8 @@ export declare type TableProps = HTMLProps<HTMLTableElement> & {
|
|
|
398
398
|
* Set `responsive={false}` to avoid this behavior.
|
|
399
399
|
*/
|
|
400
400
|
responsive?: boolean;
|
|
401
|
+
/** Determines the padding in every cell. Defaults to md */
|
|
402
|
+
size?: Size;
|
|
401
403
|
};
|
|
402
404
|
|
|
403
405
|
declare type TitleProps = {
|
package/dist/tailwind.js
CHANGED
|
@@ -2,12 +2,12 @@ import { jsxs as g, jsx as n, Fragment as S } from "react/jsx-runtime";
|
|
|
2
2
|
import w, { clsx as y } from "clsx";
|
|
3
3
|
import { useRef as I, useState as D, useEffect as M, forwardRef as u, useCallback as P, createContext as H, useContext as C, useId as F, useMemo as O } from "react";
|
|
4
4
|
import { Link as j, NavLink as at } from "react-router";
|
|
5
|
-
import { faClose as dt, faEyeSlash as lt, faEye as it, faCircleNotch as
|
|
5
|
+
import { faClose as dt, faEyeSlash as lt, faEye as it, faCircleNotch as X, faSearch as st, faChevronLeft as G, faChevronRight as J, faCheck as wt } from "@fortawesome/free-solid-svg-icons";
|
|
6
6
|
import { FontAwesomeIcon as v } from "@fortawesome/react-fontawesome";
|
|
7
7
|
import { u as ct, a as mt, b as gt } from "./use-toggle-C1uZwbSD.js";
|
|
8
8
|
import { createPortal as bt } from "react-dom";
|
|
9
9
|
import { faClone as ut } from "@fortawesome/free-regular-svg-icons";
|
|
10
|
-
const
|
|
10
|
+
const Zt = ({ children: t, summary: r, summaryClasses: e, ...o }) => {
|
|
11
11
|
const a = I(null), [l, d] = D(!1);
|
|
12
12
|
return M(() => {
|
|
13
13
|
const i = a.current, s = () => d(!!(i != null && i.open));
|
|
@@ -134,7 +134,7 @@ function kt({
|
|
|
134
134
|
}
|
|
135
135
|
);
|
|
136
136
|
}
|
|
137
|
-
const E = H(void 0), L = H({ responsive: !0 }), vt = ({ children: t, className: r }) => {
|
|
137
|
+
const E = H(void 0), L = H({ responsive: !0, size: "md" }), vt = ({ children: t, className: r }) => {
|
|
138
138
|
const { responsive: e } = C(L);
|
|
139
139
|
return /* @__PURE__ */ n(E.Provider, { value: { section: "head" }, children: /* @__PURE__ */ n(
|
|
140
140
|
"thead",
|
|
@@ -191,17 +191,20 @@ const E = H(void 0), L = H({ responsive: !0 }), vt = ({ children: t, className:
|
|
|
191
191
|
}
|
|
192
192
|
);
|
|
193
193
|
}, Tt = ({ children: t, className: r, columnName: e, type: o, ...a }) => {
|
|
194
|
-
const l = C(E), d = o ?? ((l == null ? void 0 : l.section) !== "body" ? "th" : "td"), { responsive: i } = C(L);
|
|
194
|
+
const l = C(E), d = o ?? ((l == null ? void 0 : l.section) !== "body" ? "th" : "td"), { responsive: i, size: s } = C(L);
|
|
195
195
|
return /* @__PURE__ */ n(
|
|
196
196
|
d,
|
|
197
197
|
{
|
|
198
198
|
"data-column": i ? e : void 0,
|
|
199
199
|
className: w(
|
|
200
|
-
"tw:
|
|
200
|
+
"tw:border-lm-border tw:dark:border-dm-border",
|
|
201
201
|
{
|
|
202
|
+
"tw:p-1": s === "sm",
|
|
203
|
+
"tw:p-2": s === "md",
|
|
204
|
+
"tw:p-3": s === "lg",
|
|
202
205
|
"tw:border-b-1": !i,
|
|
203
206
|
"tw:block tw:lg:table-cell tw:not-last:border-b-1 tw:lg:border-b-1": i,
|
|
204
|
-
// For
|
|
207
|
+
// For responsive tables, display the content in data-column attribute for md sizes and lower
|
|
205
208
|
"tw:before:lg:hidden tw:before:content-[attr(data-column)] tw:before:font-bold tw:before:mr-1": i && d === "td"
|
|
206
209
|
},
|
|
207
210
|
r
|
|
@@ -210,7 +213,7 @@ const E = H(void 0), L = H({ responsive: !0 }), vt = ({ children: t, className:
|
|
|
210
213
|
children: t
|
|
211
214
|
}
|
|
212
215
|
);
|
|
213
|
-
}, It = ({ header: t, footer: r, children: e, responsive: o = !0,
|
|
216
|
+
}, It = ({ header: t, footer: r, children: e, responsive: o = !0, size: a = "md", ...l }) => /* @__PURE__ */ n(L.Provider, { value: { responsive: o, size: a }, children: /* @__PURE__ */ g("table", { className: "tw:w-full", ...l, children: [
|
|
214
217
|
/* @__PURE__ */ n(vt, { children: t }),
|
|
215
218
|
/* @__PURE__ */ n(Nt, { children: e }),
|
|
216
219
|
r && /* @__PURE__ */ n(Ct, { children: r })
|
|
@@ -285,7 +288,7 @@ const E = H(void 0), L = H({ responsive: !0 }), vt = ({ children: t, className:
|
|
|
285
288
|
}
|
|
286
289
|
)
|
|
287
290
|
);
|
|
288
|
-
},
|
|
291
|
+
}, Y = u(({ className: t, onChange: r, ...e }, o) => {
|
|
289
292
|
const a = P((l) => r == null ? void 0 : r(l.target.checked, l), [r]);
|
|
290
293
|
return /* @__PURE__ */ n(
|
|
291
294
|
"input",
|
|
@@ -305,13 +308,13 @@ const E = H(void 0), L = H({ responsive: !0 }), vt = ({ children: t, className:
|
|
|
305
308
|
}
|
|
306
309
|
);
|
|
307
310
|
}), ee = u(({ className: t, ...r }, e) => /* @__PURE__ */ n(
|
|
308
|
-
|
|
311
|
+
Y,
|
|
309
312
|
{
|
|
310
313
|
ref: e,
|
|
311
314
|
className: y("tw:rounded-sm tw:w-4 tw:h-4 tw:checked:bg-(image:--tick) tw:bg-center", t),
|
|
312
315
|
...r
|
|
313
316
|
}
|
|
314
|
-
)),
|
|
317
|
+
)), Q = ({ onClick: t, className: r, label: e = "Close" }) => /* @__PURE__ */ n(
|
|
315
318
|
"button",
|
|
316
319
|
{
|
|
317
320
|
type: "button",
|
|
@@ -534,7 +537,7 @@ const E = H(void 0), L = H({ responsive: !0 }), vt = ({ children: t, className:
|
|
|
534
537
|
/* @__PURE__ */ n(
|
|
535
538
|
v,
|
|
536
539
|
{
|
|
537
|
-
icon: a ?
|
|
540
|
+
icon: a ? X : st,
|
|
538
541
|
spin: a,
|
|
539
542
|
className: w(
|
|
540
543
|
"tw:absolute tw:top-[50%] tw:translate-y-[-50%] tw:transition-colors",
|
|
@@ -635,7 +638,7 @@ function ae({
|
|
|
635
638
|
);
|
|
636
639
|
}
|
|
637
640
|
const de = u(({ className: t, ...r }, e) => /* @__PURE__ */ n(
|
|
638
|
-
|
|
641
|
+
Y,
|
|
639
642
|
{
|
|
640
643
|
ref: e,
|
|
641
644
|
className: y(
|
|
@@ -666,8 +669,8 @@ const de = u(({ className: t, ...r }, e) => /* @__PURE__ */ n(
|
|
|
666
669
|
type: o,
|
|
667
670
|
...a
|
|
668
671
|
}
|
|
669
|
-
),
|
|
670
|
-
const o = C(
|
|
672
|
+
), Z = H(null), _t = ({ className: t, to: r, ...e }) => {
|
|
673
|
+
const o = C(Z);
|
|
671
674
|
return /* @__PURE__ */ n(
|
|
672
675
|
at,
|
|
673
676
|
{
|
|
@@ -690,7 +693,7 @@ const de = u(({ className: t, ...r }, e) => /* @__PURE__ */ n(
|
|
|
690
693
|
...e
|
|
691
694
|
}
|
|
692
695
|
);
|
|
693
|
-
}, Dt = ({ children: t, className: r, fill: e }) => /* @__PURE__ */ n(
|
|
696
|
+
}, Dt = ({ children: t, className: r, fill: e }) => /* @__PURE__ */ n(Z.Provider, { value: { fill: e }, children: /* @__PURE__ */ n(N, { role: "menubar", className: w("tw:flex tw:overflow-hidden", r), children: t }) }), le = Object.assign(Dt, { Pill: _t }), Ft = new Intl.NumberFormat("en-US"), $t = (t) => Ft.format(Number(t)), V = 10, ie = (t) => Math.ceil(t / V) * V, T = 2, _ = "...", St = (t, r) => Array.from({ length: r - t }, (e, o) => t + o), jt = (t, r) => {
|
|
694
697
|
const e = St(
|
|
695
698
|
Math.max(T, t - T),
|
|
696
699
|
Math.min(r - 1, t + T) + 1
|
|
@@ -724,7 +727,7 @@ const se = ({ currentPage: t, pagesCount: r, ...e }) => {
|
|
|
724
727
|
[o, e]
|
|
725
728
|
);
|
|
726
729
|
return r < 2 ? null : /* @__PURE__ */ g("div", { className: "tw:select-none tw:flex", "data-testid": "paginator", children: [
|
|
727
|
-
t === 1 ? /* @__PURE__ */ n(A, { children: /* @__PURE__ */ n(v, { size: "xs", icon:
|
|
730
|
+
t === 1 ? /* @__PURE__ */ n(A, { children: /* @__PURE__ */ n(v, { size: "xs", icon: G }) }) : /* @__PURE__ */ n(a, { ...l(Math.max(1, t - 1)), "aria-label": "Previous", children: /* @__PURE__ */ n(v, { size: "xs", icon: G }) }),
|
|
728
731
|
jt(t, r).map((d, i) => /* @__PURE__ */ n(
|
|
729
732
|
a,
|
|
730
733
|
{
|
|
@@ -735,7 +738,7 @@ const se = ({ currentPage: t, pagesCount: r, ...e }) => {
|
|
|
735
738
|
},
|
|
736
739
|
Ht(d, i)
|
|
737
740
|
)),
|
|
738
|
-
t === r ? /* @__PURE__ */ n(A, { children: /* @__PURE__ */ n(v, { size: "xs", icon:
|
|
741
|
+
t === r ? /* @__PURE__ */ n(A, { children: /* @__PURE__ */ n(v, { size: "xs", icon: J }) }) : /* @__PURE__ */ n(a, { ...l(Math.min(r, t + 1)), "aria-label": "Next", children: /* @__PURE__ */ n(v, { size: "xs", icon: J }) })
|
|
739
742
|
] });
|
|
740
743
|
}, Wt = ({
|
|
741
744
|
open: t,
|
|
@@ -800,11 +803,11 @@ const se = ({ currentPage: t, pagesCount: r, ...e }) => {
|
|
|
800
803
|
if (k) {
|
|
801
804
|
delete R.current.dataset.open;
|
|
802
805
|
let q = !1;
|
|
803
|
-
const
|
|
806
|
+
const z = (nt) => {
|
|
804
807
|
q || nt.target !== k || (q = !0, f(!1), h == null || h($.current));
|
|
805
808
|
};
|
|
806
|
-
return k.addEventListener("transitionend",
|
|
807
|
-
k.removeEventListener("transitionend",
|
|
809
|
+
return k.addEventListener("transitionend", z), () => {
|
|
810
|
+
k.removeEventListener("transitionend", z);
|
|
808
811
|
};
|
|
809
812
|
}
|
|
810
813
|
}, [h, t]), M(() => {
|
|
@@ -858,7 +861,7 @@ const se = ({ currentPage: t, pagesCount: r, ...e }) => {
|
|
|
858
861
|
),
|
|
859
862
|
children: [
|
|
860
863
|
/* @__PURE__ */ n("h5", { children: o }),
|
|
861
|
-
/* @__PURE__ */ n(
|
|
864
|
+
/* @__PURE__ */ n(Q, { onClick: r, label: "Close dialog" })
|
|
862
865
|
]
|
|
863
866
|
}
|
|
864
867
|
),
|
|
@@ -869,7 +872,7 @@ const se = ({ currentPage: t, pagesCount: r, ...e }) => {
|
|
|
869
872
|
"tw:flex tw:items-center tw:justify-between tw:gap-x-2"
|
|
870
873
|
), children: [
|
|
871
874
|
/* @__PURE__ */ n("h5", { className: w({ "tw:text-danger": e === "danger" }), children: o }),
|
|
872
|
-
/* @__PURE__ */ n(
|
|
875
|
+
/* @__PURE__ */ n(Q, { onClick: r, label: "Close dialog" })
|
|
873
876
|
] }),
|
|
874
877
|
/* @__PURE__ */ n(N.Body, { children: a }),
|
|
875
878
|
p && /* @__PURE__ */ g(
|
|
@@ -905,7 +908,7 @@ const se = ({ currentPage: t, pagesCount: r, ...e }) => {
|
|
|
905
908
|
"tw:text-danger": o === "error"
|
|
906
909
|
}), children: [
|
|
907
910
|
e && /* @__PURE__ */ g(S, { children: [
|
|
908
|
-
/* @__PURE__ */ n(v, { icon:
|
|
911
|
+
/* @__PURE__ */ n(v, { icon: X, spin: !0 }),
|
|
909
912
|
/* @__PURE__ */ n("span", { className: "tw:ml-2", children: r ?? "Loading..." })
|
|
910
913
|
] }),
|
|
911
914
|
!e && r
|
|
@@ -958,9 +961,9 @@ export {
|
|
|
958
961
|
N as Card,
|
|
959
962
|
we as CardModal,
|
|
960
963
|
ee as Checkbox,
|
|
961
|
-
|
|
964
|
+
Q as CloseButton,
|
|
962
965
|
ge as CopyToClipboardButton,
|
|
963
|
-
|
|
966
|
+
Zt as Details,
|
|
964
967
|
_ as ELLIPSIS,
|
|
965
968
|
U as Input,
|
|
966
969
|
W as Label,
|
package/package.json
CHANGED
|
@@ -58,19 +58,19 @@
|
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@shlinkio/eslint-config-js-coding-standard": "~3.5.0",
|
|
60
60
|
"@stylistic/eslint-plugin": "^4.4.0",
|
|
61
|
-
"@tailwindcss/vite": "^4.1.
|
|
61
|
+
"@tailwindcss/vite": "^4.1.8",
|
|
62
62
|
"@testing-library/jest-dom": "^6.6.3",
|
|
63
63
|
"@testing-library/react": "^16.3.0",
|
|
64
64
|
"@testing-library/user-event": "^14.6.1",
|
|
65
65
|
"@total-typescript/shoehorn": "^0.1.2",
|
|
66
|
-
"@types/react": "^19.1.
|
|
66
|
+
"@types/react": "^19.1.6",
|
|
67
67
|
"@types/react-dom": "^19.1.5",
|
|
68
68
|
"@vitejs/plugin-react": "^4.5.0",
|
|
69
69
|
"@vitest/browser": "^3.1.4",
|
|
70
70
|
"@vitest/coverage-v8": "^3.1.4",
|
|
71
71
|
"axe-core": "^4.10.3",
|
|
72
72
|
"bootstrap": "5.2.3",
|
|
73
|
-
"eslint": "^9.
|
|
73
|
+
"eslint": "^9.28.0",
|
|
74
74
|
"eslint-plugin-import": "^2.31.0",
|
|
75
75
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
76
76
|
"eslint-plugin-react": "^7.37.5",
|
|
@@ -79,9 +79,9 @@
|
|
|
79
79
|
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
80
80
|
"history": "^5.3.0",
|
|
81
81
|
"playwright": "^1.52.0",
|
|
82
|
-
"sass": "^1.89.
|
|
82
|
+
"sass": "^1.89.1",
|
|
83
83
|
"typescript": "^5.8.3",
|
|
84
|
-
"typescript-eslint": "^8.
|
|
84
|
+
"typescript-eslint": "^8.33.0",
|
|
85
85
|
"vite": "^6.3.5",
|
|
86
86
|
"vite-plugin-dts": "^4.5.4",
|
|
87
87
|
"vitest": "^3.0.2"
|
|
@@ -92,5 +92,5 @@
|
|
|
92
92
|
"not ie <= 11",
|
|
93
93
|
"not op_mini all"
|
|
94
94
|
],
|
|
95
|
-
"version": "0.9.
|
|
95
|
+
"version": "0.9.6"
|
|
96
96
|
}
|