@alea-design/ui 0.7.0 → 0.7.2
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/components/display/Display.d.ts +1 -1
- package/dist/components/more/More.d.ts +3 -1
- package/dist/components/more/More.js +46 -46
- package/dist/components/page/PageParts.d.ts +4 -2
- package/dist/components/page/PageParts.js +74 -74
- package/dist/components/table/Table.d.ts +3 -1
- package/dist/components/table/Table.js +58 -57
- package/dist/css/base.css +1 -1
- package/dist/css/data.css +1 -1
- package/dist/css/display.css +1 -1
- package/dist/css/groups.json +7 -7
- package/dist/css/menu.css +1 -1
- package/dist/css/more.css +1 -1
- package/dist/css/table.css +1 -1
- package/dist/css/tabs.css +1 -1
- package/dist/styles.css +1 -1
- package/dist/utils/scrollEdges.d.ts +1 -1
- package/dist/utils/scrollEdges.js +23 -22
- package/package.json +3 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type RefObject } from 'react';
|
|
2
|
-
/** Whether a horizontal scroller
|
|
2
|
+
/** Whether a horizontal scroller has hidden content at its start and end, and a function to page it. The scroller is found inside box by selector, or is box itself when the selector is empty. */
|
|
3
3
|
export declare function useScrollEdges(box: RefObject<HTMLElement | null>, selector: string, enabled?: boolean): {
|
|
4
4
|
edges: {
|
|
5
5
|
start: boolean;
|
|
@@ -1,31 +1,32 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { useState as
|
|
3
|
-
function
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
import { useState as h, useEffect as E } from "react";
|
|
3
|
+
function y(r, l, c = !0) {
|
|
4
|
+
const o = () => {
|
|
5
|
+
var e;
|
|
6
|
+
return (l ? (e = r.current) == null ? void 0 : e.querySelector(l) : r.current) ?? null;
|
|
7
|
+
}, [v, d] = h({ start: !1, end: !1 });
|
|
8
|
+
return E(() => {
|
|
9
|
+
const e = c ? o() : null;
|
|
10
|
+
if (!e) {
|
|
11
|
+
d({ start: !1, end: !1 });
|
|
10
12
|
return;
|
|
11
13
|
}
|
|
12
|
-
const
|
|
13
|
-
const u = Math.abs(
|
|
14
|
-
|
|
14
|
+
const t = () => {
|
|
15
|
+
const u = Math.abs(e.scrollLeft), f = u > 2, a = u + e.clientWidth < e.scrollWidth - 2;
|
|
16
|
+
d((i) => i.start === f && i.end === a ? i : { start: f, end: a });
|
|
15
17
|
};
|
|
16
|
-
|
|
17
|
-
const s = typeof ResizeObserver > "u" ? null : new ResizeObserver(
|
|
18
|
-
s == null || s.observe(
|
|
19
|
-
const
|
|
20
|
-
return
|
|
21
|
-
|
|
18
|
+
t(), e.addEventListener("scroll", t, { passive: !0 });
|
|
19
|
+
const s = typeof ResizeObserver > "u" ? null : new ResizeObserver(t);
|
|
20
|
+
s == null || s.observe(e), e.firstElementChild && (s == null || s.observe(e.firstElementChild));
|
|
21
|
+
const n = typeof MutationObserver > "u" ? null : new MutationObserver(t);
|
|
22
|
+
return n == null || n.observe(e, { childList: !0 }), () => {
|
|
23
|
+
e.removeEventListener("scroll", t), s == null || s.disconnect(), n == null || n.disconnect();
|
|
22
24
|
};
|
|
23
|
-
}, [
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
e == null || e.scrollBy({ left: t * (getComputedStyle(e).direction === "rtl" ? -1 : 1) * e.clientWidth * 0.8, behavior: "smooth" });
|
|
25
|
+
}, [r, l, c]), { edges: v, scroll: (e) => {
|
|
26
|
+
const t = o();
|
|
27
|
+
t == null || t.scrollBy({ left: e * (getComputedStyle(t).direction === "rtl" ? -1 : 1) * t.clientWidth * 0.8, behavior: "smooth" });
|
|
27
28
|
} };
|
|
28
29
|
}
|
|
29
30
|
export {
|
|
30
|
-
|
|
31
|
+
y as useScrollEdges
|
|
31
32
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alea-design/ui",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.2",
|
|
4
4
|
"description": "Alea: the complete React design system. Accessible components from forms to AI, charts and editors, Alea Motion, and W3C design tokens for dark, light and high contrast.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -61,8 +61,8 @@
|
|
|
61
61
|
"react-dom": ">=18.3"
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@alea-design/motion": "0.7.
|
|
65
|
-
"@alea-design/tokens": "0.7.
|
|
64
|
+
"@alea-design/motion": "0.7.2",
|
|
65
|
+
"@alea-design/tokens": "0.7.2",
|
|
66
66
|
"@internationalized/date": "^3.8.0",
|
|
67
67
|
"lucide-react": "^0.525.0",
|
|
68
68
|
"qrcode-generator": "^1.5.2",
|