@natoora-libs/core 0.2.43 → 0.2.45

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.
@@ -8314,7 +8314,8 @@ var SearchHeader = ({
8314
8314
  value,
8315
8315
  onChange,
8316
8316
  onKeyDown,
8317
- width
8317
+ width,
8318
+ initialValue
8318
8319
  }) => {
8319
8320
  return /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)(
8320
8321
  import_material66.Paper,
@@ -8342,7 +8343,8 @@ var SearchHeader = ({
8342
8343
  onSearch,
8343
8344
  value,
8344
8345
  onChange,
8345
- onKeyDown
8346
+ onKeyDown,
8347
+ initialValue
8346
8348
  }
8347
8349
  ),
8348
8350
  renderExtraAction
@@ -10866,8 +10868,6 @@ var useStyles50 = (0, import_mui56.makeStyles)()((theme) => ({
10866
10868
  }
10867
10869
  }
10868
10870
  }));
10869
- var CENTER_MIN_WIDTH = 320;
10870
- var SAFETY_BUFFER = 24;
10871
10871
  var TheToolbar = ({
10872
10872
  imageLogoDarkSmall,
10873
10873
  imageLogoLightSmall,
@@ -10879,48 +10879,9 @@ var TheToolbar = ({
10879
10879
  isAuthenticated = true
10880
10880
  }) => {
10881
10881
  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
10882
  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, ref: toolbarRef, children: [
10923
- isAuthenticated ? /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(import_material88.Box, { ref: menuButtonRef, sx: { flexShrink: 0, display: "flex" }, children: /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(
10883
+ /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(import_material88.AppBar, { children: /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)(import_material88.Toolbar, { className: classes.topBar, children: [
10884
+ isAuthenticated ? /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(import_material88.Box, { sx: { flexShrink: 0, display: "flex" }, children: /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(
10924
10885
  RoundButton_default,
10925
10886
  {
10926
10887
  className: classes.menuButton,
@@ -10929,30 +10890,20 @@ var TheToolbar = ({
10929
10890
  onClick: handleOpen
10930
10891
  }
10931
10892
  ) }) : null,
10932
- /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(
10933
- import_material88.Box,
10893
+ /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(import_material88.Box, { sx: { display: { xs: "none", lg: "block" }, flexShrink: 0 }, children: /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(
10894
+ CompanyLogo_default,
10934
10895
  {
10935
- ref: logoRef,
10936
- sx: { display: { xs: "none", lg: "block" }, flexShrink: 0 },
10937
- children: /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(
10938
- CompanyLogo_default,
10939
- {
10940
- size: "small",
10941
- color: "light",
10942
- imageLogoDarkSmall,
10943
- imageLogoLightSmall
10944
- }
10945
- )
10896
+ size: "small",
10897
+ color: "light",
10898
+ imageLogoDarkSmall,
10899
+ imageLogoLightSmall
10946
10900
  }
10947
- ),
10901
+ ) }),
10948
10902
  /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(
10949
10903
  import_material88.Box,
10950
10904
  {
10951
10905
  ml: { xs: 0, lg: 2 },
10952
- sx: {
10953
- display: hideLeftSection ? "none" : "block",
10954
- flexShrink: 0
10955
- },
10906
+ sx: { flexShrink: 0, display: { xs: "none", xl: "block" } },
10956
10907
  children: leftSection
10957
10908
  }
10958
10909
  ),
@@ -10968,49 +10919,8 @@ var TheToolbar = ({
10968
10919
  children: centerSection
10969
10920
  }
10970
10921
  ) : /* @__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
- )
10922
+ /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(import_material88.Box, { sx: { flexShrink: 0, display: { xs: "none", xl: "block" } }, children: rightSection })
10979
10923
  ] }) }),
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
10924
  LeftDrawer
11015
10925
  ] });
11016
10926
  };