myshell-react-lib 0.1.35 → 0.1.36

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/index.cjs CHANGED
@@ -11463,7 +11463,7 @@ var import_react14 = require("react");
11463
11463
  var import_react_use7 = require("react-use");
11464
11464
  var import_jsx_runtime43 = require("react/jsx-runtime");
11465
11465
  function TopNavigationBar(param) {
11466
- var _param_showSearchBar = param.showSearchBar, showSearchBar = _param_showSearchBar === void 0 ? true : _param_showSearchBar, searchValue = param.searchValue, searchPlaceholder = param.searchPlaceholder, title = param.title, border = param.border, backUrl = param.backUrl, children = param.children, _param_hasBackground = param.hasBackground, hasBackground = _param_hasBackground === void 0 ? true : _param_hasBackground, avatar = param.avatar, onSearchChange = param.onSearchChange, onBack = param.onBack, _param_pageType = param.pageType, pageType = _param_pageType === void 0 ? 2 : _param_pageType;
11466
+ var searchElement = param.searchElement, title = param.title, border = param.border, backUrl = param.backUrl, children = param.children, _param_hasBackground = param.hasBackground, hasBackground = _param_hasBackground === void 0 ? true : _param_hasBackground, avatar = param.avatar, onBack = param.onBack, _param_pageType = param.pageType, pageType = _param_pageType === void 0 ? 2 : _param_pageType;
11467
11467
  var isMobile2 = (0, import_react_use7.useMedia)("(max-width: 768px)");
11468
11468
  var navbarRef = (0, import_react14.useRef)(null);
11469
11469
  var _ref = _sliced_to_array((0, import_react14.useState)(hasBackground), 2), showBackground = _ref[0], setShowBackground = _ref[1];
@@ -11520,7 +11520,7 @@ function TopNavigationBar(param) {
11520
11520
  })
11521
11521
  ]
11522
11522
  }),
11523
- title && (!showSearchBar || !isMobile2) && (!(avatar === null || avatar === void 0 ? void 0 : avatar.logo) || !isMobile2) && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Display, {
11523
+ title && !(avatar === null || avatar === void 0 ? void 0 : avatar.logo) && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Display, {
11524
11524
  size: isMobile2 ? "xs" : "sm",
11525
11525
  className: "line-clamp-1",
11526
11526
  children: title
@@ -11542,44 +11542,23 @@ function TopNavigationBar(param) {
11542
11542
  children: avatar.name
11543
11543
  })
11544
11544
  ]
11545
- }) : /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", {
11546
- className: "w-[76px]"
11547
- })
11545
+ }) : null
11548
11546
  }),
11549
11547
  /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", {
11550
11548
  className: "flex-1 flex justify-end items-center",
11551
11549
  children: /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", {
11552
11550
  className: "flex items-center space-x-3",
11553
11551
  children: [
11554
- showSearchBar && (!isMobile2 && pageType === 1 || pageType === 2) && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", {
11555
- className: "relative w-full md:w-60",
11556
- children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(SearchBar, {
11557
- color: "gray",
11558
- size: "xs",
11559
- searchValue: searchValue,
11560
- placeholder: searchPlaceholder || "Search",
11561
- onSearchChange: function(value1) {
11562
- onSearchChange && onSearchChange(value1);
11563
- }
11564
- })
11565
- }),
11552
+ searchElement && (!isMobile2 && pageType === 1 || pageType === 2) && searchElement,
11566
11553
  children
11567
11554
  ]
11568
11555
  })
11569
11556
  })
11570
11557
  ]
11571
11558
  }),
11572
- showSearchBar && pageType === 1 && isMobile2 && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", {
11559
+ searchElement && pageType === 1 && isMobile2 && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", {
11573
11560
  className: "relative w-full h-13 py-2",
11574
- children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(SearchBar, {
11575
- color: "gray",
11576
- size: "xs",
11577
- searchValue: searchValue,
11578
- placeholder: searchPlaceholder || "Search",
11579
- onSearchChange: function(value1) {
11580
- onSearchChange && onSearchChange(value1);
11581
- }
11582
- })
11561
+ children: searchElement
11583
11562
  })
11584
11563
  ]
11585
11564
  });