@payfit/unity-components 2.47.3 → 2.47.5
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.
|
@@ -21,9 +21,9 @@ export type AppLayoutProps = PropsWithChildren<{
|
|
|
21
21
|
withoutContentPadding?: boolean;
|
|
22
22
|
}>;
|
|
23
23
|
/**
|
|
24
|
-
* The `AppLayout` component creates a responsive base structure with a
|
|
24
|
+
* The `AppLayout` component creates a responsive base structure with a sticky menu sidebar.
|
|
25
25
|
* Use this when you need a complex layout with a persistent navigation menu.
|
|
26
26
|
*
|
|
27
|
-
*
|
|
27
|
+
* The menu remains sticky while the document scrolls.
|
|
28
28
|
*/
|
|
29
29
|
export declare function AppLayout({ children, menu: MenuElement, header: HeaderElement, footer: FooterElement, withoutContentPadding, }: AppLayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,27 +1,29 @@
|
|
|
1
1
|
import { jsxs as t, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { uyTv as
|
|
4
|
-
import { useResizeObserver as
|
|
5
|
-
const
|
|
2
|
+
import { useRef as x } from "react";
|
|
3
|
+
import { uyTv as v } from "@payfit/unity-themes";
|
|
4
|
+
import { useResizeObserver as b } from "usehooks-ts";
|
|
5
|
+
const g = v({
|
|
6
6
|
slots: {
|
|
7
|
-
body: "uy:h-
|
|
7
|
+
body: "uy:min-h-dvh uy:relative uy:flex uy:flex-col uy:pt-(--uy-app-layout-header-sticky-offset)",
|
|
8
8
|
header: "uy:fixed uy:top-0 uy:left-0 uy:right-0 uy:z-30",
|
|
9
9
|
layoutWrapper: [
|
|
10
|
-
"uy:flex uy:
|
|
10
|
+
"uy:flex uy:w-full uy:flex-1 uy:flex-col",
|
|
11
11
|
"uy:md:flex-row"
|
|
12
12
|
],
|
|
13
|
-
menu: [
|
|
13
|
+
menu: [
|
|
14
|
+
"uy:sticky uy:top-(--uy-app-layout-header-sticky-offset) uy:z-20 uy:w-full uy:bg-canvas",
|
|
15
|
+
"uy:md:h-[calc(100dvh-var(--uy-app-layout-header-sticky-offset))] uy:md:max-w-app-menu uy:md:shrink-0"
|
|
16
|
+
],
|
|
14
17
|
contentWrapper: [
|
|
15
|
-
"uy:flex uy:flex-col",
|
|
16
|
-
"uy:flex-grow uy:overflow-y-auto uy:relative",
|
|
18
|
+
"uy:flex uy:min-w-0 uy:flex-1 uy:flex-col uy:relative",
|
|
17
19
|
// Remove padding when it contains a Page component
|
|
18
20
|
"uy:md:[&:has([data-unity-page])]:pl-0"
|
|
19
21
|
],
|
|
20
22
|
content: [
|
|
21
|
-
"uy:flex-1",
|
|
23
|
+
"uy:flex uy:flex-1 uy:flex-col",
|
|
22
24
|
"uy:md:[&:has([data-unity-page])]:pr-0 uy:md:[&:has([data-unity-page])]:pt-0"
|
|
23
25
|
],
|
|
24
|
-
footer:
|
|
26
|
+
footer: "uy:hidden uy:md:block"
|
|
25
27
|
},
|
|
26
28
|
variants: {
|
|
27
29
|
withoutContentPadding: {
|
|
@@ -36,42 +38,41 @@ const w = x({
|
|
|
36
38
|
}
|
|
37
39
|
}
|
|
38
40
|
});
|
|
39
|
-
function
|
|
40
|
-
children:
|
|
41
|
+
function z({
|
|
42
|
+
children: o,
|
|
41
43
|
menu: a,
|
|
42
|
-
header:
|
|
43
|
-
footer:
|
|
44
|
-
withoutContentPadding:
|
|
44
|
+
header: u,
|
|
45
|
+
footer: y,
|
|
46
|
+
withoutContentPadding: l = !1
|
|
45
47
|
}) {
|
|
46
|
-
const
|
|
47
|
-
ref:
|
|
48
|
+
const r = x(null), { height: s = 0 } = b({
|
|
49
|
+
ref: r,
|
|
48
50
|
box: "border-box"
|
|
49
|
-
}), { body:
|
|
50
|
-
withoutContentPadding:
|
|
51
|
+
}), { body: p, header: d, menu: i, layoutWrapper: n, contentWrapper: c, content: f, footer: h } = g({
|
|
52
|
+
withoutContentPadding: l
|
|
51
53
|
}), m = {
|
|
52
|
-
"--uy-app-layout-
|
|
53
|
-
"--uy-app-layout-header-sticky-offset": `${y}px`
|
|
54
|
+
"--uy-app-layout-header-sticky-offset": `${s}px`
|
|
54
55
|
};
|
|
55
|
-
return /* @__PURE__ */ t("div", { className:
|
|
56
|
-
|
|
56
|
+
return /* @__PURE__ */ t("div", { className: p(), style: m, children: [
|
|
57
|
+
u && /* @__PURE__ */ e(
|
|
57
58
|
"div",
|
|
58
59
|
{
|
|
59
|
-
ref:
|
|
60
|
-
className:
|
|
60
|
+
ref: r,
|
|
61
|
+
className: d(),
|
|
61
62
|
role: "alert",
|
|
62
63
|
"aria-live": "assertive",
|
|
63
|
-
children:
|
|
64
|
+
children: u
|
|
64
65
|
}
|
|
65
66
|
),
|
|
66
|
-
/* @__PURE__ */ t("div", { className:
|
|
67
|
-
a && /* @__PURE__ */ e("div", { className:
|
|
67
|
+
/* @__PURE__ */ t("div", { className: n(), children: [
|
|
68
|
+
a && /* @__PURE__ */ e("div", { className: i(), children: a }),
|
|
68
69
|
/* @__PURE__ */ t("div", { className: c(), children: [
|
|
69
|
-
/* @__PURE__ */ e("div", { className: f(), children:
|
|
70
|
-
|
|
70
|
+
/* @__PURE__ */ e("div", { className: f(), children: o }),
|
|
71
|
+
y && /* @__PURE__ */ e("footer", { className: h(), children: y })
|
|
71
72
|
] })
|
|
72
73
|
] })
|
|
73
74
|
] });
|
|
74
75
|
}
|
|
75
76
|
export {
|
|
76
|
-
|
|
77
|
+
z as AppLayout
|
|
77
78
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@payfit/unity-components",
|
|
3
|
-
"version": "2.47.
|
|
3
|
+
"version": "2.47.5",
|
|
4
4
|
"module": "./dist/esm/index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
"tailwind-variants": "3.2.2",
|
|
93
93
|
"usehooks-ts": "3.1.1",
|
|
94
94
|
"zod": "4.4.3",
|
|
95
|
-
"@payfit/unity-illustrations": "2.47.
|
|
95
|
+
"@payfit/unity-illustrations": "2.47.5"
|
|
96
96
|
},
|
|
97
97
|
"peerDependencies": {
|
|
98
98
|
"@hookform/devtools": "^4",
|
|
@@ -104,8 +104,8 @@
|
|
|
104
104
|
"react-hook-form": "^7",
|
|
105
105
|
"react-router-dom": "^5",
|
|
106
106
|
"zod": "^3 || ^4",
|
|
107
|
-
"@payfit/unity-icons": "2.47.
|
|
108
|
-
"@payfit/unity-themes": "2.47.
|
|
107
|
+
"@payfit/unity-icons": "2.47.5",
|
|
108
|
+
"@payfit/unity-themes": "2.47.5"
|
|
109
109
|
},
|
|
110
110
|
"devDependencies": {
|
|
111
111
|
"@figma/code-connect": "1.4.8",
|
|
@@ -154,9 +154,9 @@
|
|
|
154
154
|
"@payfit/hr-apps-tsconfigs": "0.0.0-use.local",
|
|
155
155
|
"@payfit/storybook-addon-console-errors": "0.0.0-use.local",
|
|
156
156
|
"@payfit/storybook-config": "0.0.0-use.local",
|
|
157
|
-
"@payfit/unity-icons": "2.47.
|
|
158
|
-
"@payfit/unity-illustrations": "2.47.
|
|
159
|
-
"@payfit/unity-themes": "2.47.
|
|
157
|
+
"@payfit/unity-icons": "2.47.5",
|
|
158
|
+
"@payfit/unity-illustrations": "2.47.5",
|
|
159
|
+
"@payfit/unity-themes": "2.47.5",
|
|
160
160
|
"@payfit/vite-configs": "0.0.0-use.local"
|
|
161
161
|
},
|
|
162
162
|
"peerDependenciesMeta": {
|