@natoora-libs/core 0.2.43 → 0.2.44
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/index.cjs +11 -103
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.js +13 -105
- package/dist/components/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -10866,8 +10866,6 @@ var useStyles50 = (0, import_mui56.makeStyles)()((theme) => ({
|
|
|
10866
10866
|
}
|
|
10867
10867
|
}
|
|
10868
10868
|
}));
|
|
10869
|
-
var CENTER_MIN_WIDTH = 320;
|
|
10870
|
-
var SAFETY_BUFFER = 24;
|
|
10871
10869
|
var TheToolbar = ({
|
|
10872
10870
|
imageLogoDarkSmall,
|
|
10873
10871
|
imageLogoLightSmall,
|
|
@@ -10879,48 +10877,9 @@ var TheToolbar = ({
|
|
|
10879
10877
|
isAuthenticated = true
|
|
10880
10878
|
}) => {
|
|
10881
10879
|
const { classes } = useStyles50();
|
|
10882
|
-
const theme = (0, import_material88.useTheme)();
|
|
10883
|
-
const belowXl = (0, import_material88.useMediaQuery)(theme.breakpoints.down("xl"));
|
|
10884
|
-
const toolbarRef = (0, import_react55.useRef)(null);
|
|
10885
|
-
const leftSectionMeasureRef = (0, import_react55.useRef)(null);
|
|
10886
|
-
const rightSectionMeasureRef = (0, import_react55.useRef)(null);
|
|
10887
|
-
const logoRef = (0, import_react55.useRef)(null);
|
|
10888
|
-
const rightSectionRef = (0, import_react55.useRef)(null);
|
|
10889
|
-
const menuButtonRef = (0, import_react55.useRef)(null);
|
|
10890
|
-
const [hideLeftSection, setHideLeftSection] = (0, import_react55.useState)(false);
|
|
10891
|
-
const [hideRightSection, setHideRightSection] = (0, import_react55.useState)(false);
|
|
10892
|
-
(0, import_react55.useLayoutEffect)(() => {
|
|
10893
|
-
if (belowXl) {
|
|
10894
|
-
setHideLeftSection(true);
|
|
10895
|
-
}
|
|
10896
|
-
const toolbar = toolbarRef.current;
|
|
10897
|
-
const leftMeasure = leftSectionMeasureRef.current;
|
|
10898
|
-
const rightMeasure = rightSectionMeasureRef.current;
|
|
10899
|
-
if (!toolbar) return void 0;
|
|
10900
|
-
const update = () => {
|
|
10901
|
-
const toolbarWidth = toolbar.clientWidth;
|
|
10902
|
-
const leftWidth = leftMeasure?.scrollWidth ?? 0;
|
|
10903
|
-
const rightWidth = rightMeasure?.scrollWidth ?? 0;
|
|
10904
|
-
const logoWidth = logoRef.current?.offsetWidth ?? 0;
|
|
10905
|
-
const menuWidth = menuButtonRef.current?.offsetWidth ?? 0;
|
|
10906
|
-
const availableWithoutLeft = toolbarWidth - logoWidth - menuWidth - CENTER_MIN_WIDTH - SAFETY_BUFFER;
|
|
10907
|
-
const nextHideRight = rightWidth > availableWithoutLeft;
|
|
10908
|
-
setHideRightSection(nextHideRight);
|
|
10909
|
-
if (!belowXl) {
|
|
10910
|
-
const effectiveRightWidth = nextHideRight ? 0 : rightWidth;
|
|
10911
|
-
setHideLeftSection(leftWidth > availableWithoutLeft - effectiveRightWidth);
|
|
10912
|
-
}
|
|
10913
|
-
};
|
|
10914
|
-
update();
|
|
10915
|
-
const observer = new ResizeObserver(update);
|
|
10916
|
-
observer.observe(toolbar);
|
|
10917
|
-
if (leftMeasure) observer.observe(leftMeasure);
|
|
10918
|
-
if (rightMeasure) observer.observe(rightMeasure);
|
|
10919
|
-
return () => observer.disconnect();
|
|
10920
|
-
}, [belowXl, leftSection, rightSection]);
|
|
10921
10880
|
return /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)(import_material88.Box, { children: [
|
|
10922
|
-
/* @__PURE__ */ (0, import_jsx_runtime147.jsx)(import_material88.AppBar, { children: /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)(import_material88.Toolbar, { className: classes.topBar,
|
|
10923
|
-
isAuthenticated ? /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(import_material88.Box, {
|
|
10881
|
+
/* @__PURE__ */ (0, import_jsx_runtime147.jsx)(import_material88.AppBar, { children: /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)(import_material88.Toolbar, { className: classes.topBar, children: [
|
|
10882
|
+
isAuthenticated ? /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(import_material88.Box, { sx: { flexShrink: 0, display: "flex" }, children: /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(
|
|
10924
10883
|
RoundButton_default,
|
|
10925
10884
|
{
|
|
10926
10885
|
className: classes.menuButton,
|
|
@@ -10929,30 +10888,20 @@ var TheToolbar = ({
|
|
|
10929
10888
|
onClick: handleOpen
|
|
10930
10889
|
}
|
|
10931
10890
|
) }) : null,
|
|
10932
|
-
/* @__PURE__ */ (0, import_jsx_runtime147.jsx)(
|
|
10933
|
-
|
|
10891
|
+
/* @__PURE__ */ (0, import_jsx_runtime147.jsx)(import_material88.Box, { sx: { display: { xs: "none", lg: "block" }, flexShrink: 0 }, children: /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(
|
|
10892
|
+
CompanyLogo_default,
|
|
10934
10893
|
{
|
|
10935
|
-
|
|
10936
|
-
|
|
10937
|
-
|
|
10938
|
-
|
|
10939
|
-
{
|
|
10940
|
-
size: "small",
|
|
10941
|
-
color: "light",
|
|
10942
|
-
imageLogoDarkSmall,
|
|
10943
|
-
imageLogoLightSmall
|
|
10944
|
-
}
|
|
10945
|
-
)
|
|
10894
|
+
size: "small",
|
|
10895
|
+
color: "light",
|
|
10896
|
+
imageLogoDarkSmall,
|
|
10897
|
+
imageLogoLightSmall
|
|
10946
10898
|
}
|
|
10947
|
-
),
|
|
10899
|
+
) }),
|
|
10948
10900
|
/* @__PURE__ */ (0, import_jsx_runtime147.jsx)(
|
|
10949
10901
|
import_material88.Box,
|
|
10950
10902
|
{
|
|
10951
10903
|
ml: { xs: 0, lg: 2 },
|
|
10952
|
-
sx: {
|
|
10953
|
-
display: hideLeftSection ? "none" : "block",
|
|
10954
|
-
flexShrink: 0
|
|
10955
|
-
},
|
|
10904
|
+
sx: { flexShrink: 0, display: { xs: "none", xl: "block" } },
|
|
10956
10905
|
children: leftSection
|
|
10957
10906
|
}
|
|
10958
10907
|
),
|
|
@@ -10968,49 +10917,8 @@ var TheToolbar = ({
|
|
|
10968
10917
|
children: centerSection
|
|
10969
10918
|
}
|
|
10970
10919
|
) : /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(import_material88.Box, { sx: { flexGrow: 1 } }),
|
|
10971
|
-
/* @__PURE__ */ (0, import_jsx_runtime147.jsx)(
|
|
10972
|
-
import_material88.Box,
|
|
10973
|
-
{
|
|
10974
|
-
ref: rightSectionRef,
|
|
10975
|
-
sx: { flexShrink: 0, display: hideRightSection ? "none" : "block" },
|
|
10976
|
-
children: rightSection
|
|
10977
|
-
}
|
|
10978
|
-
)
|
|
10920
|
+
/* @__PURE__ */ (0, import_jsx_runtime147.jsx)(import_material88.Box, { sx: { flexShrink: 0, display: { xs: "none", xl: "block" } }, children: rightSection })
|
|
10979
10921
|
] }) }),
|
|
10980
|
-
/* @__PURE__ */ (0, import_jsx_runtime147.jsx)(
|
|
10981
|
-
import_material88.Box,
|
|
10982
|
-
{
|
|
10983
|
-
ref: leftSectionMeasureRef,
|
|
10984
|
-
"aria-hidden": true,
|
|
10985
|
-
sx: {
|
|
10986
|
-
position: "fixed",
|
|
10987
|
-
top: 0,
|
|
10988
|
-
left: 0,
|
|
10989
|
-
visibility: "hidden",
|
|
10990
|
-
pointerEvents: "none",
|
|
10991
|
-
whiteSpace: "nowrap",
|
|
10992
|
-
display: "inline-flex"
|
|
10993
|
-
},
|
|
10994
|
-
children: leftSection
|
|
10995
|
-
}
|
|
10996
|
-
),
|
|
10997
|
-
/* @__PURE__ */ (0, import_jsx_runtime147.jsx)(
|
|
10998
|
-
import_material88.Box,
|
|
10999
|
-
{
|
|
11000
|
-
ref: rightSectionMeasureRef,
|
|
11001
|
-
"aria-hidden": true,
|
|
11002
|
-
sx: {
|
|
11003
|
-
position: "fixed",
|
|
11004
|
-
top: 0,
|
|
11005
|
-
left: 0,
|
|
11006
|
-
visibility: "hidden",
|
|
11007
|
-
pointerEvents: "none",
|
|
11008
|
-
whiteSpace: "nowrap",
|
|
11009
|
-
display: "inline-flex"
|
|
11010
|
-
},
|
|
11011
|
-
children: rightSection
|
|
11012
|
-
}
|
|
11013
|
-
),
|
|
11014
10922
|
LeftDrawer
|
|
11015
10923
|
] });
|
|
11016
10924
|
};
|