@solostylist/ui-kit 1.0.149 → 1.0.150
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.
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
import { SxProps, Theme } from '@mui/material';
|
|
3
|
+
export interface STwoPaneLayoutProps {
|
|
4
|
+
/** Content to display in the sidebar pane */
|
|
5
|
+
sidebar: ReactNode;
|
|
6
|
+
/** Content to display in the main content pane */
|
|
7
|
+
content: ReactNode;
|
|
8
|
+
/** Width of the sidebar in pixels. Default: 280 */
|
|
9
|
+
sidebarWidth?: number | string;
|
|
10
|
+
/** Container height. Can be a CSS value or 'auto'. Default: 'calc(100vh - 65px)' */
|
|
11
|
+
height?: string | number;
|
|
12
|
+
/** Custom styles for the main container */
|
|
13
|
+
containerSx?: SxProps<Theme>;
|
|
14
|
+
/** Custom styles for the sidebar container */
|
|
15
|
+
sidebarSx?: SxProps<Theme>;
|
|
16
|
+
/** Custom styles for the content container */
|
|
17
|
+
contentSx?: SxProps<Theme>;
|
|
18
|
+
/** Custom styles for the sidebar header */
|
|
19
|
+
sidebarHeaderSx?: SxProps<Theme>;
|
|
20
|
+
/** Custom styles for the content header */
|
|
21
|
+
contentHeaderSx?: SxProps<Theme>;
|
|
22
|
+
/** Custom styles for the sidebar scrollable area */
|
|
23
|
+
sidebarScrollSx?: SxProps<Theme>;
|
|
24
|
+
/** Custom styles for the content scrollable area */
|
|
25
|
+
contentScrollSx?: SxProps<Theme>;
|
|
26
|
+
/** Hide border between sidebar and content. Default: false */
|
|
27
|
+
disableBorder?: boolean;
|
|
28
|
+
/** Optional header content for the sidebar */
|
|
29
|
+
sidebarHeader?: ReactNode;
|
|
30
|
+
/** Optional header content for the main content area */
|
|
31
|
+
contentHeader?: ReactNode;
|
|
32
|
+
/** Enable scrollbar for sidebar. Default: true */
|
|
33
|
+
enableSidebarScroll?: boolean;
|
|
34
|
+
/** Enable scrollbar for content. Default: false */
|
|
35
|
+
enableContentScroll?: boolean;
|
|
36
|
+
/** Sidebar position. Default: 'left' */
|
|
37
|
+
sidebarPosition?: 'left' | 'right';
|
|
38
|
+
/** Padding for sidebar content. Default: 1 */
|
|
39
|
+
sidebarPadding?: number | string;
|
|
40
|
+
/** Padding for main content. Default: 0 */
|
|
41
|
+
contentPadding?: number | string;
|
|
42
|
+
/** Padding for sidebar header. Default: 2 */
|
|
43
|
+
sidebarHeaderPadding?: number | string;
|
|
44
|
+
/** Padding for content header. Default: 2 */
|
|
45
|
+
contentHeaderPadding?: number | string;
|
|
46
|
+
}
|
|
47
|
+
declare const STwoPaneLayout: FC<STwoPaneLayoutProps>;
|
|
48
|
+
export default STwoPaneLayout;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { j as r } from "../jsx-runtime-OVHDjVDe.js";
|
|
2
|
+
import { Box as e } from "@mui/material";
|
|
3
|
+
import L from "../s-flex-box/s-flex-box.js";
|
|
4
|
+
import p from "../s-overlay-scrollbar/s-overlay-scrollbar.js";
|
|
5
|
+
const T = ({
|
|
6
|
+
sidebar: l,
|
|
7
|
+
content: o,
|
|
8
|
+
sidebarWidth: u = 280,
|
|
9
|
+
height: v = "calc(100vh - 65px)",
|
|
10
|
+
containerSx: w,
|
|
11
|
+
sidebarSx: a,
|
|
12
|
+
contentSx: g,
|
|
13
|
+
sidebarHeaderSx: y,
|
|
14
|
+
contentHeaderSx: B,
|
|
15
|
+
sidebarScrollSx: i,
|
|
16
|
+
contentScrollSx: s,
|
|
17
|
+
disableBorder: h = !1,
|
|
18
|
+
sidebarHeader: d,
|
|
19
|
+
contentHeader: t,
|
|
20
|
+
enableSidebarScroll: D = !0,
|
|
21
|
+
enableContentScroll: f = !1,
|
|
22
|
+
sidebarPosition: x = "left",
|
|
23
|
+
sidebarPadding: n = 1,
|
|
24
|
+
contentPadding: c = 1,
|
|
25
|
+
sidebarHeaderPadding: F = 2,
|
|
26
|
+
contentHeaderPadding: C = 2
|
|
27
|
+
}) => {
|
|
28
|
+
const j = /* @__PURE__ */ r.jsxs(
|
|
29
|
+
e,
|
|
30
|
+
{
|
|
31
|
+
sx: {
|
|
32
|
+
width: u,
|
|
33
|
+
borderRight: !h && x === "left" ? 1 : 0,
|
|
34
|
+
borderLeft: !h && x === "right" ? 1 : 0,
|
|
35
|
+
borderColor: "divider",
|
|
36
|
+
display: "flex",
|
|
37
|
+
flexDirection: "column",
|
|
38
|
+
...a
|
|
39
|
+
},
|
|
40
|
+
children: [
|
|
41
|
+
d && /* @__PURE__ */ r.jsx(e, { sx: { p: F, borderBottom: 1, borderColor: "divider", ...y }, children: d }),
|
|
42
|
+
/* @__PURE__ */ r.jsx(e, { sx: { flex: 1, minHeight: 0 }, children: D ? /* @__PURE__ */ r.jsx(p, { children: /* @__PURE__ */ r.jsx(e, { sx: { p: n, ...i }, children: l }) }) : /* @__PURE__ */ r.jsx(e, { sx: { p: n, height: "100%", overflow: "hidden", ...i }, children: l }) })
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
), m = /* @__PURE__ */ r.jsxs(e, { sx: { flex: 1, display: "flex", flexDirection: "column", ...g }, height: "100%", children: [
|
|
46
|
+
t && /* @__PURE__ */ r.jsx(e, { sx: { p: C, borderBottom: 1, borderColor: "divider", ...B }, children: t }),
|
|
47
|
+
/* @__PURE__ */ r.jsx(e, { sx: { flex: 1, overflow: f ? "auto" : "hidden" }, children: f ? /* @__PURE__ */ r.jsx(p, { children: /* @__PURE__ */ r.jsx(e, { sx: { p: c, ...s }, children: o }) }) : /* @__PURE__ */ r.jsx(e, { sx: { p: c, height: "100%", ...s }, children: o }) })
|
|
48
|
+
] });
|
|
49
|
+
return /* @__PURE__ */ r.jsx(
|
|
50
|
+
L,
|
|
51
|
+
{
|
|
52
|
+
sx: {
|
|
53
|
+
height: v,
|
|
54
|
+
flexDirection: "row",
|
|
55
|
+
width: "100%",
|
|
56
|
+
overflow: "hidden",
|
|
57
|
+
...w
|
|
58
|
+
},
|
|
59
|
+
children: x === "left" ? /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
|
|
60
|
+
j,
|
|
61
|
+
m
|
|
62
|
+
] }) : /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
|
|
63
|
+
m,
|
|
64
|
+
j
|
|
65
|
+
] })
|
|
66
|
+
}
|
|
67
|
+
);
|
|
68
|
+
};
|
|
69
|
+
export {
|
|
70
|
+
T as default
|
|
71
|
+
};
|