@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.
@@ -10639,8 +10639,8 @@ var ThemedDateRangePicker = ({
10639
10639
  var ThemedDateRangePicker_default = ThemedDateRangePicker;
10640
10640
 
10641
10641
  // src/components/TheToolbar/TheToolbar.tsx
10642
- import { memo as memo24, useLayoutEffect as useLayoutEffect2, useRef as useRef12, useState as useState28 } from "react";
10643
- import { AppBar, Box as Box50, Toolbar, useMediaQuery, useTheme as useTheme3 } from "@mui/material";
10642
+ import { memo as memo24 } from "react";
10643
+ import { AppBar, Box as Box50, Toolbar } from "@mui/material";
10644
10644
  import { makeStyles as makeStyles49 } from "tss-react/mui";
10645
10645
  import { jsx as jsx145, jsxs as jsxs97 } from "react/jsx-runtime";
10646
10646
  var useStyles49 = makeStyles49()((theme) => ({
@@ -10656,8 +10656,6 @@ var useStyles49 = makeStyles49()((theme) => ({
10656
10656
  }
10657
10657
  }
10658
10658
  }));
10659
- var CENTER_MIN_WIDTH = 320;
10660
- var SAFETY_BUFFER = 24;
10661
10659
  var TheToolbar = ({
10662
10660
  imageLogoDarkSmall,
10663
10661
  imageLogoLightSmall,
@@ -10669,48 +10667,9 @@ var TheToolbar = ({
10669
10667
  isAuthenticated = true
10670
10668
  }) => {
10671
10669
  const { classes } = useStyles49();
10672
- const theme = useTheme3();
10673
- const belowXl = useMediaQuery(theme.breakpoints.down("xl"));
10674
- const toolbarRef = useRef12(null);
10675
- const leftSectionMeasureRef = useRef12(null);
10676
- const rightSectionMeasureRef = useRef12(null);
10677
- const logoRef = useRef12(null);
10678
- const rightSectionRef = useRef12(null);
10679
- const menuButtonRef = useRef12(null);
10680
- const [hideLeftSection, setHideLeftSection] = useState28(false);
10681
- const [hideRightSection, setHideRightSection] = useState28(false);
10682
- useLayoutEffect2(() => {
10683
- if (belowXl) {
10684
- setHideLeftSection(true);
10685
- }
10686
- const toolbar = toolbarRef.current;
10687
- const leftMeasure = leftSectionMeasureRef.current;
10688
- const rightMeasure = rightSectionMeasureRef.current;
10689
- if (!toolbar) return void 0;
10690
- const update = () => {
10691
- const toolbarWidth = toolbar.clientWidth;
10692
- const leftWidth = leftMeasure?.scrollWidth ?? 0;
10693
- const rightWidth = rightMeasure?.scrollWidth ?? 0;
10694
- const logoWidth = logoRef.current?.offsetWidth ?? 0;
10695
- const menuWidth = menuButtonRef.current?.offsetWidth ?? 0;
10696
- const availableWithoutLeft = toolbarWidth - logoWidth - menuWidth - CENTER_MIN_WIDTH - SAFETY_BUFFER;
10697
- const nextHideRight = rightWidth > availableWithoutLeft;
10698
- setHideRightSection(nextHideRight);
10699
- if (!belowXl) {
10700
- const effectiveRightWidth = nextHideRight ? 0 : rightWidth;
10701
- setHideLeftSection(leftWidth > availableWithoutLeft - effectiveRightWidth);
10702
- }
10703
- };
10704
- update();
10705
- const observer = new ResizeObserver(update);
10706
- observer.observe(toolbar);
10707
- if (leftMeasure) observer.observe(leftMeasure);
10708
- if (rightMeasure) observer.observe(rightMeasure);
10709
- return () => observer.disconnect();
10710
- }, [belowXl, leftSection, rightSection]);
10711
10670
  return /* @__PURE__ */ jsxs97(Box50, { children: [
10712
- /* @__PURE__ */ jsx145(AppBar, { children: /* @__PURE__ */ jsxs97(Toolbar, { className: classes.topBar, ref: toolbarRef, children: [
10713
- isAuthenticated ? /* @__PURE__ */ jsx145(Box50, { ref: menuButtonRef, sx: { flexShrink: 0, display: "flex" }, children: /* @__PURE__ */ jsx145(
10671
+ /* @__PURE__ */ jsx145(AppBar, { children: /* @__PURE__ */ jsxs97(Toolbar, { className: classes.topBar, children: [
10672
+ isAuthenticated ? /* @__PURE__ */ jsx145(Box50, { sx: { flexShrink: 0, display: "flex" }, children: /* @__PURE__ */ jsx145(
10714
10673
  RoundButton_default,
10715
10674
  {
10716
10675
  className: classes.menuButton,
@@ -10719,30 +10678,20 @@ var TheToolbar = ({
10719
10678
  onClick: handleOpen
10720
10679
  }
10721
10680
  ) }) : null,
10722
- /* @__PURE__ */ jsx145(
10723
- Box50,
10681
+ /* @__PURE__ */ jsx145(Box50, { sx: { display: { xs: "none", lg: "block" }, flexShrink: 0 }, children: /* @__PURE__ */ jsx145(
10682
+ CompanyLogo_default,
10724
10683
  {
10725
- ref: logoRef,
10726
- sx: { display: { xs: "none", lg: "block" }, flexShrink: 0 },
10727
- children: /* @__PURE__ */ jsx145(
10728
- CompanyLogo_default,
10729
- {
10730
- size: "small",
10731
- color: "light",
10732
- imageLogoDarkSmall,
10733
- imageLogoLightSmall
10734
- }
10735
- )
10684
+ size: "small",
10685
+ color: "light",
10686
+ imageLogoDarkSmall,
10687
+ imageLogoLightSmall
10736
10688
  }
10737
- ),
10689
+ ) }),
10738
10690
  /* @__PURE__ */ jsx145(
10739
10691
  Box50,
10740
10692
  {
10741
10693
  ml: { xs: 0, lg: 2 },
10742
- sx: {
10743
- display: hideLeftSection ? "none" : "block",
10744
- flexShrink: 0
10745
- },
10694
+ sx: { flexShrink: 0, display: { xs: "none", xl: "block" } },
10746
10695
  children: leftSection
10747
10696
  }
10748
10697
  ),
@@ -10758,49 +10707,8 @@ var TheToolbar = ({
10758
10707
  children: centerSection
10759
10708
  }
10760
10709
  ) : /* @__PURE__ */ jsx145(Box50, { sx: { flexGrow: 1 } }),
10761
- /* @__PURE__ */ jsx145(
10762
- Box50,
10763
- {
10764
- ref: rightSectionRef,
10765
- sx: { flexShrink: 0, display: hideRightSection ? "none" : "block" },
10766
- children: rightSection
10767
- }
10768
- )
10710
+ /* @__PURE__ */ jsx145(Box50, { sx: { flexShrink: 0, display: { xs: "none", xl: "block" } }, children: rightSection })
10769
10711
  ] }) }),
10770
- /* @__PURE__ */ jsx145(
10771
- Box50,
10772
- {
10773
- ref: leftSectionMeasureRef,
10774
- "aria-hidden": true,
10775
- sx: {
10776
- position: "fixed",
10777
- top: 0,
10778
- left: 0,
10779
- visibility: "hidden",
10780
- pointerEvents: "none",
10781
- whiteSpace: "nowrap",
10782
- display: "inline-flex"
10783
- },
10784
- children: leftSection
10785
- }
10786
- ),
10787
- /* @__PURE__ */ jsx145(
10788
- Box50,
10789
- {
10790
- ref: rightSectionMeasureRef,
10791
- "aria-hidden": true,
10792
- sx: {
10793
- position: "fixed",
10794
- top: 0,
10795
- left: 0,
10796
- visibility: "hidden",
10797
- pointerEvents: "none",
10798
- whiteSpace: "nowrap",
10799
- display: "inline-flex"
10800
- },
10801
- children: rightSection
10802
- }
10803
- ),
10804
10712
  LeftDrawer
10805
10713
  ] });
10806
10714
  };