@adgytec/adgytec-web-ui-components 2.2.0 → 2.3.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/assets/AppBarHeadline.css +1 -1
- package/dist/assets/Card.css +1 -0
- package/dist/assets/CardIcon.css +1 -0
- package/dist/assets/ConnectedButtonGroup.css +1 -1
- package/dist/assets/ListAvatar.css +1 -0
- package/dist/assets/ListBox.css +1 -0
- package/dist/assets/ListIcon.css +1 -0
- package/dist/assets/ListItem.css +1 -0
- package/dist/assets/ListLabelText.css +1 -0
- package/dist/assets/ListMedia.css +1 -0
- package/dist/assets/ListOverlineText.css +1 -0
- package/dist/assets/ListSupportingText.css +1 -0
- package/dist/assets/NavigationScrollContainer.css +1 -1
- package/dist/assets/Snackbar.css +1 -1
- package/dist/chunks/AppBarHeadline +2 -2
- package/dist/chunks/AppBarHeadline.map +1 -1
- package/dist/chunks/Card +22 -0
- package/dist/chunks/Card.map +1 -0
- package/dist/chunks/CardIcon +23 -0
- package/dist/chunks/CardIcon.map +1 -0
- package/dist/chunks/ConnectedButtonGroup +6 -6
- package/dist/chunks/ConnectedButtonGroup.map +1 -1
- package/dist/chunks/ListAvatar +20 -0
- package/dist/chunks/ListAvatar.map +1 -0
- package/dist/chunks/ListBox +16 -0
- package/dist/chunks/ListBox.map +1 -0
- package/dist/chunks/ListIcon +21 -0
- package/dist/chunks/ListIcon.map +1 -0
- package/dist/chunks/ListItem +63 -0
- package/dist/chunks/ListItem.map +1 -0
- package/dist/chunks/ListLabelText +22 -0
- package/dist/chunks/ListLabelText.map +1 -0
- package/dist/chunks/ListMedia +15 -0
- package/dist/chunks/ListMedia.map +1 -0
- package/dist/chunks/ListOverlineText +21 -0
- package/dist/chunks/ListOverlineText.map +1 -0
- package/dist/chunks/ListSupportingText +22 -0
- package/dist/chunks/ListSupportingText.map +1 -0
- package/dist/chunks/Navigation +20 -20
- package/dist/chunks/NavigationScrollContainer +45 -32
- package/dist/chunks/NavigationScrollContainer.map +1 -1
- package/dist/chunks/Snackbar +18 -27
- package/dist/chunks/Snackbar.map +1 -1
- package/dist/chunks/types +6 -0
- package/dist/chunks/types.map +1 -0
- package/dist/components/Card/Card/Card.d.ts +2 -0
- package/dist/components/Card/Card/index.d.ts +2 -0
- package/dist/components/Card/Card/index.js +3 -0
- package/dist/components/Card/Card/types.d.ts +7 -0
- package/dist/components/Card/CardIcon/CardIcon.d.ts +2 -0
- package/dist/components/Card/CardIcon/index.d.ts +1 -0
- package/dist/components/Card/CardIcon/index.js +2 -0
- package/dist/components/Card/index.d.ts +2 -0
- package/dist/components/Card/index.js +4 -0
- package/dist/components/List/ListAction/ListAction.d.ts +2 -0
- package/dist/components/List/ListAction/index.d.ts +1 -0
- package/dist/components/List/ListAction/index.js +0 -0
- package/dist/components/List/ListAvatar/ListAvatar.d.ts +1 -0
- package/dist/components/List/ListAvatar/index.d.ts +1 -0
- package/dist/components/List/ListAvatar/index.js +2 -0
- package/dist/components/List/ListBox/ListBox.d.ts +2 -0
- package/dist/components/List/ListBox/index.d.ts +2 -0
- package/dist/components/List/ListBox/index.js +2 -0
- package/dist/components/List/ListBox/types.d.ts +5 -0
- package/dist/components/List/ListIcon/ListIcon.d.ts +2 -0
- package/dist/components/List/ListIcon/index.d.ts +1 -0
- package/dist/components/List/ListIcon/index.js +2 -0
- package/dist/components/List/ListItem/ListItem.d.ts +2 -0
- package/dist/components/List/ListItem/index.d.ts +2 -0
- package/dist/components/List/ListItem/index.js +2 -0
- package/dist/components/List/ListItem/types.d.ts +9 -0
- package/dist/components/List/ListLabelText/ListLabelText.d.ts +2 -0
- package/dist/components/List/ListLabelText/index.d.ts +1 -0
- package/dist/components/List/ListLabelText/index.js +2 -0
- package/dist/components/List/ListMedia/ListMedia.d.ts +2 -0
- package/dist/components/List/ListMedia/index.d.ts +2 -0
- package/dist/components/List/ListMedia/index.js +2 -0
- package/dist/components/List/ListMedia/types.d.ts +10 -0
- package/dist/components/List/ListOverlineText/ListOverlineText.d.ts +2 -0
- package/dist/components/List/ListOverlineText/index.d.ts +1 -0
- package/dist/components/List/ListOverlineText/index.js +2 -0
- package/dist/components/List/ListSupportingText/ListSupportingText.d.ts +2 -0
- package/dist/components/List/ListSupportingText/index.d.ts +1 -0
- package/dist/components/List/ListSupportingText/index.js +2 -0
- package/dist/components/List/ListTrailingText/ListTrailingText.d.ts +2 -0
- package/dist/components/List/ListTrailingText/index.d.ts +1 -0
- package/dist/components/List/ListTrailingText/index.js +0 -0
- package/dist/components/List/index.d.ts +10 -0
- package/dist/components/List/index.js +9 -0
- package/dist/components/Navigation/NavigationState/context.d.ts +1 -1
- package/dist/components/Navigation/NavigationState/index.js +61 -2
- package/dist/components/Navigation/NavigationState/index.js.map +1 -0
- package/dist/components/Navigation/SubNavigation/SubNavigation/index.js +4 -4
- package/dist/components/Navigation/SubNavigation/SubNavigationTrigger/index.js +5 -5
- package/dist/components/Navigation/index.js +2 -2
- package/dist/index.d.ts +2 -0
- package/dist/index.js +129 -115
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunks/NavigationState +0 -69
- package/dist/chunks/NavigationState.map +0 -1
package/dist/chunks/Navigation
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { t as e } from "./compiler-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import { t as
|
|
4
|
-
import { IconButton as
|
|
5
|
-
import { useInDialog as
|
|
6
|
-
import { a
|
|
7
|
-
import {
|
|
2
|
+
import { t } from "./NavigationScrollContainer";
|
|
3
|
+
import { t as n } from "./base";
|
|
4
|
+
import { IconButton as r } from "../components/Button/IconButton/index.js";
|
|
5
|
+
import { useInDialog as i } from "../components/Dialog/core/index.js";
|
|
6
|
+
import { a, i as o, n as s } from "./core8";
|
|
7
|
+
import { NavigationState as c, NavigationStateContext as l, useNavigationState as u } from "../components/Navigation/NavigationState/index.js";
|
|
8
8
|
import { t as d } from "./navContext";
|
|
9
9
|
import f from "clsx";
|
|
10
10
|
import { createContext as p, useContext as m, useState as h } from "react";
|
|
@@ -20,8 +20,8 @@ function T() {
|
|
|
20
20
|
}
|
|
21
21
|
//#endregion
|
|
22
22
|
//#region src/components/Navigation/Navigation/Navigation.tsx
|
|
23
|
-
var E = ({ label: e, children:
|
|
24
|
-
let [k, A] = h(null), { isInert: j } =
|
|
23
|
+
var E = ({ label: e, children: c, className: l, isLinkActive: p, isButtonActive: m, stateID: S = "__root__", inert: T, style: E, containerClassName: D, ...O }) => {
|
|
24
|
+
let [k, A] = h(null), { isInert: j } = u(), M = i(), N = M || !!e || !1;
|
|
25
25
|
return /* @__PURE__ */ g(b, {
|
|
26
26
|
values: [
|
|
27
27
|
[w, { container: k }],
|
|
@@ -29,7 +29,7 @@ var E = ({ label: e, children: t, className: r, isLinkActive: p, isButtonActive:
|
|
|
29
29
|
isLinkActive: p,
|
|
30
30
|
isButtonActive: m
|
|
31
31
|
}],
|
|
32
|
-
[
|
|
32
|
+
[s, {
|
|
33
33
|
id: S,
|
|
34
34
|
depth: 0
|
|
35
35
|
}]
|
|
@@ -38,7 +38,7 @@ var E = ({ label: e, children: t, className: r, isLinkActive: p, isButtonActive:
|
|
|
38
38
|
ref: A,
|
|
39
39
|
className: f(C.container, D),
|
|
40
40
|
children: /* @__PURE__ */ _("nav", {
|
|
41
|
-
className: f(
|
|
41
|
+
className: f(a, l),
|
|
42
42
|
...O,
|
|
43
43
|
"data-header": N || void 0,
|
|
44
44
|
style: {
|
|
@@ -48,29 +48,29 @@ var E = ({ label: e, children: t, className: r, isLinkActive: p, isButtonActive:
|
|
|
48
48
|
inert: T ?? j(0),
|
|
49
49
|
"data-modal": M || void 0,
|
|
50
50
|
children: [N && /* @__PURE__ */ _(v, {
|
|
51
|
-
className: f(
|
|
51
|
+
className: f(o),
|
|
52
52
|
children: [e && /* @__PURE__ */ g(y, {
|
|
53
|
-
className: f(
|
|
53
|
+
className: f(n.titleLarge),
|
|
54
54
|
"data-heading": !0,
|
|
55
55
|
children: e
|
|
56
|
-
}), M && /* @__PURE__ */ g(
|
|
56
|
+
}), M && /* @__PURE__ */ g(r, {
|
|
57
57
|
icon: x,
|
|
58
58
|
color: "standard",
|
|
59
59
|
slot: "close",
|
|
60
60
|
"data-close-button": !0
|
|
61
61
|
})]
|
|
62
|
-
}), /* @__PURE__ */ g(
|
|
62
|
+
}), /* @__PURE__ */ g(t, { children: c })]
|
|
63
63
|
})
|
|
64
64
|
})
|
|
65
65
|
});
|
|
66
66
|
}, D = (e) => {
|
|
67
|
-
let
|
|
68
|
-
if (m(
|
|
69
|
-
let
|
|
70
|
-
return
|
|
67
|
+
let t = (0, S.c)(4);
|
|
68
|
+
if (m(l) === null) {
|
|
69
|
+
let n;
|
|
70
|
+
return t[0] === e ? n = t[1] : (n = /* @__PURE__ */ g(c, { children: /* @__PURE__ */ g(E, { ...e }) }), t[0] = e, t[1] = n), n;
|
|
71
71
|
}
|
|
72
|
-
let
|
|
73
|
-
return
|
|
72
|
+
let n;
|
|
73
|
+
return t[2] === e ? n = t[3] : (n = /* @__PURE__ */ g(E, { ...e }), t[2] = e, t[3] = n), n;
|
|
74
74
|
};
|
|
75
75
|
//#endregion
|
|
76
76
|
export { w as n, T as r, D as t };
|
|
@@ -1,42 +1,55 @@
|
|
|
1
1
|
import { t as e } from "./compiler-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import { useLayoutEffect as
|
|
6
|
-
import { jsx as
|
|
7
|
-
import { useObjectRef as
|
|
8
|
-
import '../assets/NavigationScrollContainer.css';//#region src/
|
|
9
|
-
|
|
10
|
-
let
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
]
|
|
21
|
-
let b;
|
|
22
|
-
|
|
23
|
-
|
|
2
|
+
import { r as t } from "./core8";
|
|
3
|
+
import { useNavigationState as n } from "../components/Navigation/NavigationState/index.js";
|
|
4
|
+
import r from "clsx";
|
|
5
|
+
import { useLayoutEffect as i } from "react";
|
|
6
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
7
|
+
import { useObjectRef as o } from "react-aria";
|
|
8
|
+
import '../assets/NavigationScrollContainer.css';//#region src/utils/scroll/scroll.ts
|
|
9
|
+
function s({ scrollHeight: e, scrollTop: t, clientHeight: n }) {
|
|
10
|
+
let r = e - n;
|
|
11
|
+
return r <= 0 ? 0 : t / r;
|
|
12
|
+
}
|
|
13
|
+
function c({ scrollHeight: e, progress: t, clientHeight: n }) {
|
|
14
|
+
return t * (e - n);
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
//#region src/components/Navigation/NavigationScrollContainer/navigationScrollContainer.module.css
|
|
18
|
+
var l = e(), u = { container: "_container_1o1zm_2" }, d = (e) => {
|
|
19
|
+
let d = (0, l.c)(19), f, p, m;
|
|
20
|
+
d[0] === e ? (f = d[1], p = d[2], m = d[3]) : ({ref: m, className: f, ...p} = e, d[0] = e, d[1] = f, d[2] = p, d[3] = m);
|
|
21
|
+
let h = o(m), { saveNavigationScrollTopProgress: g, getNavigationScrollProgress: _ } = n(), { id: v } = t(), y, b;
|
|
22
|
+
d[4] !== _ || d[5] !== v || d[6] !== h ? (y = () => {
|
|
23
|
+
let e = h.current;
|
|
24
|
+
e && (e.scrollTop = c({
|
|
25
|
+
scrollHeight: e.scrollHeight,
|
|
26
|
+
clientHeight: e.clientHeight,
|
|
27
|
+
progress: _(v)
|
|
28
|
+
}));
|
|
29
|
+
}, b = [
|
|
30
|
+
h,
|
|
31
|
+
v,
|
|
32
|
+
_
|
|
33
|
+
], d[4] = _, d[5] = v, d[6] = h, d[7] = y, d[8] = b) : (y = d[7], b = d[8]), i(y, b);
|
|
34
|
+
let x;
|
|
35
|
+
d[9] !== v || d[10] !== g ? (x = (e) => {
|
|
36
|
+
g(v, s({
|
|
24
37
|
scrollHeight: e.currentTarget.scrollHeight,
|
|
25
38
|
clientHeight: e.currentTarget.clientHeight,
|
|
26
39
|
scrollTop: e.currentTarget.scrollTop
|
|
27
40
|
}));
|
|
28
|
-
},
|
|
29
|
-
let x;
|
|
30
|
-
u[12] === d ? x = u[13] : (x = i(l.container, d), u[12] = d, u[13] = x);
|
|
41
|
+
}, d[9] = v, d[10] = g, d[11] = x) : x = d[11];
|
|
31
42
|
let S;
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
43
|
+
d[12] === f ? S = d[13] : (S = r(u.container, f), d[12] = f, d[13] = S);
|
|
44
|
+
let C;
|
|
45
|
+
return d[14] !== p || d[15] !== h || d[16] !== x || d[17] !== S ? (C = /* @__PURE__ */ a("div", {
|
|
46
|
+
ref: h,
|
|
47
|
+
onScroll: x,
|
|
48
|
+
className: S,
|
|
49
|
+
...p
|
|
50
|
+
}), d[14] = p, d[15] = h, d[16] = x, d[17] = S, d[18] = C) : C = d[18], C;
|
|
38
51
|
};
|
|
39
52
|
//#endregion
|
|
40
|
-
export {
|
|
53
|
+
export { s as n, c as r, d as t };
|
|
41
54
|
|
|
42
55
|
//# sourceMappingURL=NavigationScrollContainer.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavigationScrollContainer","names":["scrollContainerRef"],"sources":["../../src/components/Navigation/NavigationScrollContainer/navigationScrollContainer.module.css","../../src/components/Navigation/NavigationScrollContainer/NavigationScrollContainer.tsx"],"sourcesContent":["@layer adgytec.comps {\n .container {\n padding-inline: var(--md-sys-layout-space-
|
|
1
|
+
{"version":3,"file":"NavigationScrollContainer","names":["scrollContainerRef"],"sources":["../../src/utils/scroll/scroll.ts","../../src/components/Navigation/NavigationScrollContainer/navigationScrollContainer.module.css","../../src/components/Navigation/NavigationScrollContainer/NavigationScrollContainer.tsx"],"sourcesContent":["export function getScrollProgress({\n scrollHeight,\n scrollTop,\n clientHeight,\n}: {\n scrollTop: number;\n scrollHeight: number;\n clientHeight: number;\n}): number {\n const maxScrollTop = scrollHeight - clientHeight;\n return maxScrollTop <= 0 ? 0 : scrollTop / maxScrollTop;\n}\n\nexport function getScrollTopFromProgress({\n scrollHeight,\n progress,\n clientHeight,\n}: {\n progress: number;\n scrollHeight: number;\n clientHeight: number;\n}): number {\n const maxScrollTop = scrollHeight - clientHeight;\n return progress * maxScrollTop;\n}\n","@layer adgytec.comps {\n .container {\n padding-inline: var(--md-sys-layout-space-8);\n margin-inline: var(--md-sys-layout-space-8);\n\n border-radius: inherit;\n overflow-y: auto;\n\n display: grid;\n gap: var(--_md-navigation-items-gap);\n align-content: start;\n\n &:focus-visible {\n --focus-indicator-thickness: calc(3 * var(--dp, 1px));\n --focus-indicator-offset: calc(2 * var(--dp, 1px));\n --focus-indicator-color: var(--md-sys-color-secondary);\n\n outline-width: var(--focus-indicator-thickness);\n outline-style: solid;\n outline-offset: var(--focus-indicator-offset);\n outline-color: var(--focus-indicator-color);\n }\n\n /* 2dp for focus outline offset and 3dp for focus outline width + 1dp to prevent clipping */\n padding-block: calc(6 * var(--dp, 1px));\n }\n}\n","import clsx from \"clsx\";\nimport { useLayoutEffect } from \"react\";\nimport { useObjectRef } from \"react-aria\";\nimport { getScrollProgress, getScrollTopFromProgress } from \"@/utils\";\nimport { useNavigationInfo } from \"../core\";\nimport { useNavigationState } from \"../NavigationState\";\nimport styles from \"./navigationScrollContainer.module.css\";\n\nexport const NavigationScrollContainer: React.FC<\n React.ComponentPropsWithRef<\"div\">\n> = ({ ref, className, ...props }) => {\n const scrollContainerRef = useObjectRef(ref);\n\n const { saveNavigationScrollTopProgress, getNavigationScrollProgress } =\n useNavigationState();\n const { id } = useNavigationInfo();\n\n useLayoutEffect(() => {\n const container = scrollContainerRef.current;\n if (!container) {\n return;\n }\n\n container.scrollTop = getScrollTopFromProgress({\n scrollHeight: container.scrollHeight,\n clientHeight: container.clientHeight,\n progress: getNavigationScrollProgress(id),\n });\n }, [scrollContainerRef, id, getNavigationScrollProgress]);\n\n return (\n <div\n ref={scrollContainerRef}\n onScroll={(e) => {\n saveNavigationScrollTopProgress(\n id,\n getScrollProgress({\n scrollHeight: e.currentTarget.scrollHeight,\n clientHeight: e.currentTarget.clientHeight,\n scrollTop: e.currentTarget.scrollTop,\n })\n );\n }}\n className={clsx(styles[\"container\"], className)}\n {...props}\n />\n );\n};\n"],"mappings":";;;;;;;;AAAA,SAAgB,EAAkB,EAC9B,iBACA,cACA,mBAKO;CACP,IAAM,IAAe,IAAe;CACpC,OAAO,KAAgB,IAAI,IAAI,IAAY;AAC/C;AAEA,SAAgB,EAAyB,EACrC,iBACA,aACA,mBAKO;CAEP,OAAO,KADc,IAAe;AAExC;;;sDEhBa,KAET,MAAA;CAAA,IAAA,KAAA,GAAA,EAAA,EAAA,CAAA,EAAA,GAAA,GAAA,GAAA;CAAA,AAAA,EAAA,OAAA,KAA6B,IAAA,EAAA,IAAA,IAAA,EAAA,IAAA,IAAA,EAAA,OAA5B,0BAAA,KAAA,GAA4B,EAAA,KAAA,GAAA,EAAA,KAAA,GAAA,EAAA,KAAA,GAAA,EAAA,KAAA;CAC7B,IAAA,IAA2B,EAAa,CAAG,GAE3C,EAAA,oCAAA,mCACI,EAAmB,GACvB,EAAA,UAAe,EAAkB,GAAE,GAAA;CAEnC,AAFmC,EAAA,OAAA,KAAA,EAAA,OAAA,KAAA,EAAA,OAAA,KAEnB,UAAA;EACZ,IAAA,IAAkB,EAAkB;EAC/B,MAIL,EAAS,YAAa,EAAyB;GAAA,cAC7B,EAAS;GAAa,cACtB,EAAS;GAAa,UAC1B,EAA4B,CAAE;EAC5C,CAAC;CAJkB,GAKpB,IAAA;EAAC;EAAoB;EAAI;CAA2B,GAAC,EAAA,KAAA,GAAA,EAAA,KAAA,GAAA,EAAA,KAAA,GAAA,EAAA,KAAA,GAAA,EAAA,KAAA,MAAA,IAAA,EAAA,IAAA,IAAA,EAAA,KAXxD,EAAgB,GAWb,CAAqD;CAAC,IAAA;CAAA,AAAA,EAAA,OAAA,KAAA,EAAA,QAAA,KAKvC,KAAA,MAAA;EACN,EACI,GACA,EAAkB;GAAA,cACA,EAAC,cAAc;GAAa,cAC5B,EAAC,cAAc;GAAa,WAC/B,EAAC,cAAc;EAC9B,CAAC,CACL;CAAC,GACJ,EAAA,KAAA,GAAA,EAAA,MAAA,GAAA,EAAA,MAAA,KAAA,IAAA,EAAA;CAAA,IAAA;CAAA,AAAA,EAAA,QAAA,IAC8C,IAAA,EAAA,OAApC,IAAA,EAAK,EAAM,WAAe,CAAS,GAAC,EAAA,MAAA,GAAA,EAAA,MAAA;CAAA,IAAA;CAEjD,OAFiD,EAAA,QAAA,KAAA,EAAA,QAAA,KAAA,EAAA,QAAA,KAAA,EAAA,QAAA,KAZnD,IAAA,kBAAA,OAAA;EACSA,KAAA;EACK,UAAA;EAUC,WAAA;EAAoC,GAC3C;CAAK,CAAA,GACX,EAAA,MAAA,GAAA,EAAA,MAAA,GAAA,EAAA,MAAA,GAAA,EAAA,MAAA,GAAA,EAAA,MAAA,KAAA,IAAA,EAAA,KAdF;AAcE"}
|
package/dist/chunks/Snackbar
CHANGED
|
@@ -5,44 +5,35 @@ import { createContext as r, useContext as i, useMemo as a } from "react";
|
|
|
5
5
|
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
6
6
|
import { Text as c, UNSTABLE_Toast as l, UNSTABLE_ToastContent as u, UNSTABLE_ToastQueue as d, UNSTABLE_ToastRegion as f } from "react-aria-components";
|
|
7
7
|
import { X as p } from "lucide-react";
|
|
8
|
-
import { flushSync as m } from "react-dom";
|
|
9
8
|
import '../assets/Snackbar.css';//#region src/components/Snackbar/context.ts
|
|
10
|
-
var
|
|
11
|
-
function
|
|
12
|
-
let e = i(
|
|
9
|
+
var m = r(null);
|
|
10
|
+
function h() {
|
|
11
|
+
let e = i(m);
|
|
13
12
|
if (!e) throw Error("useSnackbarQueue must be used inside SnackbarRegion");
|
|
14
13
|
return e;
|
|
15
14
|
}
|
|
16
|
-
var
|
|
17
|
-
"snackbar-region": "_snackbar-
|
|
18
|
-
snackbar: "
|
|
19
|
-
"snackbar-content": "_snackbar-
|
|
20
|
-
text: "
|
|
21
|
-
},
|
|
22
|
-
let
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
"startViewTransition" in document ? document.startViewTransition(() => {
|
|
26
|
-
m(e);
|
|
27
|
-
}) : e();
|
|
28
|
-
}
|
|
29
|
-
}), [i]);
|
|
30
|
-
return /* @__PURE__ */ s(h, {
|
|
31
|
-
value: g,
|
|
15
|
+
var g = {
|
|
16
|
+
"snackbar-region": "_snackbar-region_1uhs8_10",
|
|
17
|
+
snackbar: "_snackbar_1uhs8_10",
|
|
18
|
+
"snackbar-content": "_snackbar-content_1uhs8_68",
|
|
19
|
+
text: "_text_1uhs8_80"
|
|
20
|
+
}, _ = ({ children: r, maxVisibleSnackbars: i = 1 }) => {
|
|
21
|
+
let h = a(() => new d({ maxVisibleToasts: i }), [i]);
|
|
22
|
+
return /* @__PURE__ */ s(m, {
|
|
23
|
+
value: h,
|
|
32
24
|
children: [r, /* @__PURE__ */ o(f, {
|
|
33
|
-
queue:
|
|
34
|
-
className: n(
|
|
25
|
+
queue: h,
|
|
26
|
+
className: n(g["snackbar-region"]),
|
|
35
27
|
children: ({ toast: r }) => /* @__PURE__ */ s(l, {
|
|
36
28
|
toast: r,
|
|
37
|
-
className: n(
|
|
38
|
-
style: { viewTransitionName: r.key },
|
|
29
|
+
className: n(g.snackbar),
|
|
39
30
|
"data-close": !r.content.hideCloseAction || void 0,
|
|
40
31
|
"data-action": r.content.hideCloseAction && !!r.content.action || void 0,
|
|
41
32
|
children: [/* @__PURE__ */ s(u, {
|
|
42
|
-
className:
|
|
33
|
+
className: g["snackbar-content"],
|
|
43
34
|
children: [/* @__PURE__ */ o(c, {
|
|
44
35
|
slot: "description",
|
|
45
|
-
className: n(
|
|
36
|
+
className: n(g.text, e.bodyMedium),
|
|
46
37
|
children: r.content.supportingText
|
|
47
38
|
}), r.content.action]
|
|
48
39
|
}), !r.content.hideCloseAction && /* @__PURE__ */ o(t, {
|
|
@@ -56,6 +47,6 @@ var _ = {
|
|
|
56
47
|
});
|
|
57
48
|
};
|
|
58
49
|
//#endregion
|
|
59
|
-
export {
|
|
50
|
+
export { m as n, h as r, _ as t };
|
|
60
51
|
|
|
61
52
|
//# sourceMappingURL=Snackbar.map
|
package/dist/chunks/Snackbar.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Snackbar","names":[],"sources":["../../src/components/Snackbar/context.ts","../../src/components/Snackbar/snackbar.module.css","../../src/components/Snackbar/SnackbarRegion.tsx"],"sourcesContent":["import { createContext, useContext } from \"react\";\nimport type { UNSTABLE_ToastQueue as ToastQueue } from \"react-aria-components\";\nimport type { SnackbarContent } from \"./types\";\n\nexport const SnackbarQueueContext =\n createContext<ToastQueue<SnackbarContent> | null>(null);\n\nexport function useSnackbarQueue() {\n const queue = useContext(SnackbarQueueContext);\n\n if (!queue) {\n throw new Error(\"useSnackbarQueue must be used inside SnackbarRegion\");\n }\n\n return queue;\n}\n","/* configurable tokens\n*\n* --md-snackbar-background\n* --md-snackbar-color\n* --md-snackbar-action-color\n*\n* configurable tokens end */\n\n@layer adgytec.comps {\n .snackbar-region {\n position: fixed;\n\n display: flex;\n flex-direction: column-reverse;\n gap: calc(2 * var(--dp, 1px));\n\n inset-block-end: var(--md-sys-layout-space-24);\n\n inset-inline-start: 50%;\n translate: -50%;\n }\n\n .snackbar {\n --_md-snackbar-background: var(\n --md-snackbar-background,\n var(--md-sys-color-inverse-surface)\n );\n --_md-snackbar-color: var(\n --md-snackbar-color,\n var(--md-sys-color-inverse-on-surface)\n );\n --_md-snackbar-action-color: var(\n --md-snackbar-action-color,\n var(--md-sys-color-inverse-primary)\n );\n\n inline-size: min(90svi, calc(568 * var(--dp, 1px)));\n\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: var(--md-sys-layout-space-4);\n\n padding-block: var(--md-sys-layout-space-4);\n padding-inline: var(--md-sys-layout-space-16);\n\n box-shadow: var(--md-sys-elevation-shadow-3);\n border-radius: var(--md-sys-shape-corner-radius-extra-small);\n\n background-color: var(--_md-snackbar-background);\n color: var(--_md-snackbar-color);\n\n &[data-close] {\n padding-inline-end: var(--md-sys-layout-space-4);\n }\n\n &[data-action] {\n padding-inline-end: var(--md-sys-layout-space-8);\n }\n\n [data-close-button] {\n --md-button-color: var(--_md-snackbar-color);\n }\n }\n\n .snackbar-content {\n inline-size: 100%;\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: var(--md-sys-layout-space-8);\n\n [data-button] {\n --md-button-color: var(--_md-snackbar-action-color);\n }\n }\n\n .text {\n padding-block: calc(10 * var(--dp, 1px));\n }\n}\n","import { clsx } from \"clsx\";\nimport { X } from \"lucide-react\";\nimport { useMemo } from \"react\";\nimport {\n Text,\n UNSTABLE_Toast as Toast,\n UNSTABLE_ToastContent as ToastContent,\n UNSTABLE_ToastQueue as ToastQueue,\n UNSTABLE_ToastRegion as ToastRegion,\n} from \"react-aria-components\";\nimport {
|
|
1
|
+
{"version":3,"file":"Snackbar","names":[],"sources":["../../src/components/Snackbar/context.ts","../../src/components/Snackbar/snackbar.module.css","../../src/components/Snackbar/SnackbarRegion.tsx"],"sourcesContent":["import { createContext, useContext } from \"react\";\nimport type { UNSTABLE_ToastQueue as ToastQueue } from \"react-aria-components\";\nimport type { SnackbarContent } from \"./types\";\n\nexport const SnackbarQueueContext =\n createContext<ToastQueue<SnackbarContent> | null>(null);\n\nexport function useSnackbarQueue() {\n const queue = useContext(SnackbarQueueContext);\n\n if (!queue) {\n throw new Error(\"useSnackbarQueue must be used inside SnackbarRegion\");\n }\n\n return queue;\n}\n","/* configurable tokens\n*\n* --md-snackbar-background\n* --md-snackbar-color\n* --md-snackbar-action-color\n*\n* configurable tokens end */\n\n@layer adgytec.comps {\n .snackbar-region {\n position: fixed;\n\n display: flex;\n flex-direction: column-reverse;\n gap: calc(2 * var(--dp, 1px));\n\n inset-block-end: var(--md-sys-layout-space-24);\n\n inset-inline-start: 50%;\n translate: -50%;\n\n z-index: 999999;\n }\n\n .snackbar {\n --_md-snackbar-background: var(\n --md-snackbar-background,\n var(--md-sys-color-inverse-surface)\n );\n --_md-snackbar-color: var(\n --md-snackbar-color,\n var(--md-sys-color-inverse-on-surface)\n );\n --_md-snackbar-action-color: var(\n --md-snackbar-action-color,\n var(--md-sys-color-inverse-primary)\n );\n\n inline-size: min(90svi, calc(568 * var(--dp, 1px)));\n\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: var(--md-sys-layout-space-4);\n\n padding-block: var(--md-sys-layout-space-4);\n padding-inline: var(--md-sys-layout-space-16);\n\n box-shadow: var(--md-sys-elevation-shadow-3);\n border-radius: var(--md-sys-shape-corner-radius-extra-small);\n\n background-color: var(--_md-snackbar-background);\n color: var(--_md-snackbar-color);\n\n &[data-close] {\n padding-inline-end: var(--md-sys-layout-space-4);\n }\n\n &[data-action] {\n padding-inline-end: var(--md-sys-layout-space-8);\n }\n\n [data-close-button] {\n --md-button-color: var(--_md-snackbar-color);\n }\n }\n\n .snackbar-content {\n inline-size: 100%;\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: var(--md-sys-layout-space-8);\n\n [data-button] {\n --md-button-color: var(--_md-snackbar-action-color);\n }\n }\n\n .text {\n padding-block: calc(10 * var(--dp, 1px));\n }\n}\n","import { clsx } from \"clsx\";\nimport { X } from \"lucide-react\";\nimport { useMemo } from \"react\";\nimport {\n Text,\n UNSTABLE_Toast as Toast,\n UNSTABLE_ToastContent as ToastContent,\n UNSTABLE_ToastQueue as ToastQueue,\n UNSTABLE_ToastRegion as ToastRegion,\n} from \"react-aria-components\";\nimport { typography } from \"@/utils\";\nimport { IconButton } from \"../Button\";\nimport { SnackbarQueueContext } from \"./context\";\nimport styles from \"./snackbar.module.css\";\nimport type { SnackbarContent, SnackbarRegionProps } from \"./types\";\n\nexport const SnackbarRegion: React.FC<SnackbarRegionProps> = ({\n children,\n maxVisibleSnackbars = 1,\n}) => {\n const queue = useMemo(() => {\n return new ToastQueue<SnackbarContent>({\n maxVisibleToasts: maxVisibleSnackbars,\n });\n }, [maxVisibleSnackbars]);\n\n return (\n <SnackbarQueueContext value={queue}>\n {children}\n <ToastRegion\n queue={queue}\n className={clsx(styles[\"snackbar-region\"])}\n >\n {({ toast }) => (\n <Toast\n toast={toast}\n className={clsx(styles[\"snackbar\"])}\n data-close={!toast.content.hideCloseAction || undefined}\n data-action={\n (toast.content.hideCloseAction &&\n !!toast.content.action) ||\n undefined\n }\n >\n <ToastContent className={styles[\"snackbar-content\"]}>\n <Text\n slot=\"description\"\n className={clsx(\n styles[\"text\"],\n typography.bodyMedium\n )}\n >\n {toast.content.supportingText}\n </Text>\n\n {toast.content.action}\n </ToastContent>\n\n {!toast.content.hideCloseAction && (\n <IconButton\n slot=\"close\"\n icon={X}\n color=\"standard\"\n data-close-button\n />\n )}\n </Toast>\n )}\n </ToastRegion>\n </SnackbarQueueContext>\n );\n};\n"],"mappings":";;;;;;;;AAIA,IAAa,IACT,EAAkD,IAAI;AAE1D,SAAO,IAAA;CACH,IAAA,IAAc,EAAW,CAAoB;CAE7C,IAAI,CAAC,GACD,MAAU,MAAM,qDAAqD;CACxE,OAEM;AAAK;;;;;;GEEH,KAAiD,EAC1D,aACA,yBAAsB,QACpB;CACF,IAAM,IAAQ,QACH,IAAI,EAA4B,EACnC,kBAAkB,EACtB,CAAC,GACF,CAAC,CAAmB,CAAC;CAExB,OACI,kBAAC,GAAD;EAAsB,OAAO;YAA7B,CACK,GACD,kBAAC,GAAD;GACW;GACP,WAAW,EAAK,EAAO,kBAAkB;cAEvC,EAAE,eACA,kBAAC,GAAD;IACW;IACP,WAAW,EAAK,EAAO,QAAW;IAClC,cAAY,CAAC,EAAM,QAAQ,mBAAmB,KAAA;IAC9C,eACK,EAAM,QAAQ,mBACX,CAAC,CAAC,EAAM,QAAQ,UACpB,KAAA;cAPR,CAUI,kBAAC,GAAD;KAAc,WAAW,EAAO;eAAhC,CACI,kBAAC,GAAD;MACI,MAAK;MACL,WAAW,EACP,EAAO,MACP,EAAW,UACf;gBAEC,EAAM,QAAQ;KACb,CAAA,GAEL,EAAM,QAAQ,MACL;QAEb,CAAC,EAAM,QAAQ,mBACZ,kBAAC,GAAD;KACI,MAAK;KACL,MAAM;KACN,OAAM;KACN,qBAAA;IAAiB,CAAA,CAGtB;;EAEF,CAAA,CACK;;AAE9B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types","names":[],"sources":["../../src/components/Card/Card/types.ts"],"sourcesContent":["import type { GridListItem } from \"react-aria-components\";\n\nexport type CardVariant = \"elevated\" | \"outlined\" | \"filled\";\n\nexport interface CardProps\n extends React.ComponentPropsWithRef<typeof GridListItem> {\n variant?: CardVariant;\n}\n\nexport const PaddingBetweenCards = 12;\n\nexport const CardIconSize = 24;\n"],"mappings":";AASA,IAAa,IAAsB,IAEtB,IAAe"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { GridListItem } from 'react-aria-components';
|
|
2
|
+
export type CardVariant = "elevated" | "outlined" | "filled";
|
|
3
|
+
export interface CardProps extends React.ComponentPropsWithRef<typeof GridListItem> {
|
|
4
|
+
variant?: CardVariant;
|
|
5
|
+
}
|
|
6
|
+
export declare const PaddingBetweenCards = 12;
|
|
7
|
+
export declare const CardIconSize = 24;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './CardIcon';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ListAvatar: React.FC<React.ComponentPropsWithRef<"div">>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ListAvatar';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ListIcon';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { ListBoxItem } from 'react-aria-components';
|
|
3
|
+
export interface ListItemProps extends Omit<React.ComponentPropsWithRef<typeof ListBoxItem>, "children"> {
|
|
4
|
+
leading?: ReactNode;
|
|
5
|
+
overline?: ReactNode;
|
|
6
|
+
label: ReactNode;
|
|
7
|
+
supporting?: ReactNode;
|
|
8
|
+
trailing?: ReactNode[];
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ListLabelText';
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as e, i as t, n, o as r, r as i, s as a, t as o } from "../../../chunks/ListMedia";
|
|
2
|
+
export { a as ListMedia, o as ListMediaImageHeight, n as ListMediaImageWidth, i as ListMediaLargeVideoHeight, t as ListMediaLargeVideoWidth, e as ListMediaVideoHeight, r as ListMediaVideoWidth };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const ListMediaImageWidth = 56;
|
|
2
|
+
export declare const ListMediaImageHeight = 56;
|
|
3
|
+
export declare const ListMediaVideoWidth = 100;
|
|
4
|
+
export declare const ListMediaVideoHeight = 56;
|
|
5
|
+
export declare const ListMediaLargeVideoWidth = 114;
|
|
6
|
+
export declare const ListMediaLargeVideoHeight = 64;
|
|
7
|
+
export type ListMediaVariant = "image" | "video" | "large-video";
|
|
8
|
+
export interface ListMediaProps extends React.ComponentPropsWithRef<"div"> {
|
|
9
|
+
variant?: ListMediaVariant;
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ListOverlineText';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ListSupportingText';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
File without changes
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from './ListAction';
|
|
2
|
+
export * from './ListAvatar';
|
|
3
|
+
export * from './ListBox';
|
|
4
|
+
export * from './ListIcon';
|
|
5
|
+
export * from './ListItem';
|
|
6
|
+
export * from './ListLabelText';
|
|
7
|
+
export * from './ListMedia';
|
|
8
|
+
export * from './ListOverlineText';
|
|
9
|
+
export * from './ListSupportingText';
|
|
10
|
+
export * from './ListTrailingText';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { t as e } from "../../chunks/ListAvatar";
|
|
2
|
+
import { t } from "../../chunks/ListBox";
|
|
3
|
+
import { t as n } from "../../chunks/ListIcon";
|
|
4
|
+
import { t as r } from "../../chunks/ListItem";
|
|
5
|
+
import { t as i } from "../../chunks/ListLabelText";
|
|
6
|
+
import { a, i as o, n as s, o as c, r as l, s as u, t as d } from "../../chunks/ListMedia";
|
|
7
|
+
import { t as f } from "../../chunks/ListOverlineText";
|
|
8
|
+
import { t as p } from "../../chunks/ListSupportingText";
|
|
9
|
+
export { e as ListAvatar, t as ListBox, n as ListIcon, r as ListItem, i as ListLabelText, u as ListMedia, d as ListMediaImageHeight, s as ListMediaImageWidth, l as ListMediaLargeVideoHeight, o as ListMediaLargeVideoWidth, a as ListMediaVideoHeight, c as ListMediaVideoWidth, f as ListOverlineText, p as ListSupportingText };
|
|
@@ -2,9 +2,9 @@ export type NavigationStateContextType = {
|
|
|
2
2
|
openSubNavigation: (id: string, depth: number) => void;
|
|
3
3
|
closeSubNavigation: (id: string) => void;
|
|
4
4
|
saveNavigationScrollTopProgress: (id: string, progress: number) => void;
|
|
5
|
-
registerNavigationContainer: (id: string, container: HTMLDivElement) => () => void;
|
|
6
5
|
isSubNavigationOpen: (id: string) => boolean;
|
|
7
6
|
isInert: (depth: number) => boolean;
|
|
7
|
+
getNavigationScrollProgress: (id: string) => number;
|
|
8
8
|
};
|
|
9
9
|
export declare const NavigationStateContext: import('react').Context<NavigationStateContextType | null>;
|
|
10
10
|
export declare function useNavigationState(): NavigationStateContextType;
|
|
@@ -1,2 +1,61 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { t as e } from "../../../chunks/compiler-runtime";
|
|
2
|
+
import { createContext as t, useContext as n, useRef as r, useState as i } from "react";
|
|
3
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/Navigation/NavigationState/context.ts
|
|
5
|
+
var o = t(null);
|
|
6
|
+
function s() {
|
|
7
|
+
let e = n(o);
|
|
8
|
+
if (e === null) throw Error("Missing navigation state. Ensure this component is rendered within Navigation component.");
|
|
9
|
+
return e;
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
12
|
+
//#region src/components/Navigation/NavigationState/NavigationState.tsx
|
|
13
|
+
var c = e(), l = (e) => {
|
|
14
|
+
let t = (0, c.c)(18), { children: n } = e, s;
|
|
15
|
+
t[0] === Symbol.for("react.memo_cache_sentinel") ? (s = [], t[0] = s) : s = t[0];
|
|
16
|
+
let [l, u] = i(s), d;
|
|
17
|
+
t[1] === Symbol.for("react.memo_cache_sentinel") ? (d = {}, t[1] = d) : d = t[1];
|
|
18
|
+
let f = r(d), p;
|
|
19
|
+
t[2] === Symbol.for("react.memo_cache_sentinel") ? (p = (e) => f.current[e] ?? 0, t[2] = p) : p = t[2];
|
|
20
|
+
let m = p, h;
|
|
21
|
+
t[3] === Symbol.for("react.memo_cache_sentinel") ? (h = (e, t) => {
|
|
22
|
+
u((n) => [...n.filter((e) => e.depth < t), {
|
|
23
|
+
id: e,
|
|
24
|
+
depth: t
|
|
25
|
+
}]);
|
|
26
|
+
}, t[3] = h) : h = t[3];
|
|
27
|
+
let g = h, _;
|
|
28
|
+
t[4] === l ? _ = t[5] : (_ = (e) => {
|
|
29
|
+
let t = l.find((t) => t.id === e);
|
|
30
|
+
if (!t) return;
|
|
31
|
+
let n = l.filter((e) => e.depth >= t.depth);
|
|
32
|
+
for (let e of n) delete f.current[e.id];
|
|
33
|
+
u((e) => e.filter((e) => e.depth < t.depth));
|
|
34
|
+
}, t[4] = l, t[5] = _);
|
|
35
|
+
let v = _, y;
|
|
36
|
+
t[6] === Symbol.for("react.memo_cache_sentinel") ? (y = (e, t) => {
|
|
37
|
+
f.current[e] = t;
|
|
38
|
+
}, t[6] = y) : y = t[6];
|
|
39
|
+
let b = y, x;
|
|
40
|
+
t[7] === l ? x = t[8] : (x = (e) => l.some((t) => t.id === e), t[7] = l, t[8] = x);
|
|
41
|
+
let S = x, C;
|
|
42
|
+
t[9] === l ? C = t[10] : (C = (e) => e < (l[l.length - 1]?.depth ?? 0), t[9] = l, t[10] = C);
|
|
43
|
+
let w = C, T;
|
|
44
|
+
t[11] !== v || t[12] !== w || t[13] !== S ? (T = {
|
|
45
|
+
getNavigationScrollProgress: m,
|
|
46
|
+
openSubNavigation: g,
|
|
47
|
+
closeSubNavigation: v,
|
|
48
|
+
saveNavigationScrollTopProgress: b,
|
|
49
|
+
isSubNavigationOpen: S,
|
|
50
|
+
isInert: w
|
|
51
|
+
}, t[11] = v, t[12] = w, t[13] = S, t[14] = T) : T = t[14];
|
|
52
|
+
let E;
|
|
53
|
+
return t[15] !== n || t[16] !== T ? (E = /* @__PURE__ */ a(o, {
|
|
54
|
+
value: T,
|
|
55
|
+
children: n
|
|
56
|
+
}), t[15] = n, t[16] = T, t[17] = E) : E = t[17], E;
|
|
57
|
+
};
|
|
58
|
+
//#endregion
|
|
59
|
+
export { l as NavigationState, o as NavigationStateContext, s as useNavigationState };
|
|
60
|
+
|
|
61
|
+
//# sourceMappingURL=index.js.map
|