@pattern-stack/frontend-patterns 0.2.0-alpha.11 → 0.2.0-alpha.12

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.es.js CHANGED
@@ -10759,7 +10759,33 @@ const Sidebar = ({ className }) => {
10759
10759
  }
10760
10760
  );
10761
10761
  };
10762
- const AppHeader = ({ className }) => {
10762
+ function isBrandingObject(v) {
10763
+ return v != null && typeof v === "object" && !React__default.isValidElement(v) && "title" in v;
10764
+ }
10765
+ const AppHeader = ({
10766
+ className,
10767
+ branding,
10768
+ searchPlaceholder = "Search models, tests, jobs, and components...",
10769
+ showSearch = true,
10770
+ showUserMenu = true,
10771
+ showConnectionStatus = true
10772
+ }) => {
10773
+ const isTrialMode = false;
10774
+ const brandingNode = (() => {
10775
+ if (branding == null) {
10776
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
10777
+ /* @__PURE__ */ jsx("h1", { className: "text-xl font-bold text-foreground", children: "Frontend Template" }),
10778
+ isTrialMode
10779
+ ] });
10780
+ }
10781
+ if (isBrandingObject(branding)) {
10782
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
10783
+ /* @__PURE__ */ jsx("h1", { className: "text-xl font-bold text-foreground", children: branding.title }),
10784
+ branding.badge
10785
+ ] });
10786
+ }
10787
+ return branding;
10788
+ })();
10763
10789
  return /* @__PURE__ */ jsx(
10764
10790
  "header",
10765
10791
  {
@@ -10770,35 +10796,28 @@ const AppHeader = ({ className }) => {
10770
10796
  className
10771
10797
  ),
10772
10798
  children: /* @__PURE__ */ jsx("div", { className: "mx-auto max-w-7xl px-4 sm:px-6 lg:px-8", children: /* @__PURE__ */ jsxs("div", { className: "flex h-16 items-center justify-between", children: [
10773
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
10774
- /* @__PURE__ */ jsx("h1", { className: "text-xl font-bold text-foreground", children: "Frontend Template" }),
10775
- /* @__PURE__ */ jsx(DataBadge, { variant: "status", status: "info", display: "icon-text", children: "Trial Mode" })
10776
- ] }),
10777
- /* @__PURE__ */ jsx("div", { className: "flex-1 max-w-2xl mx-8", children: /* @__PURE__ */ jsx(
10778
- GlobalSearch,
10779
- {
10780
- className: "w-full",
10781
- placeholder: "Search models, tests, jobs, and components..."
10782
- }
10783
- ) }),
10799
+ /* @__PURE__ */ jsx("div", { className: "flex items-center gap-3", children: brandingNode }),
10800
+ showSearch && /* @__PURE__ */ jsx("div", { className: "flex-1 max-w-2xl mx-8", children: /* @__PURE__ */ jsx(GlobalSearch, { className: "w-full", placeholder: searchPlaceholder }) }),
10784
10801
  /* @__PURE__ */ jsxs("div", { className: "flex items-center space-x-4", children: [
10785
- /* @__PURE__ */ jsx(ConnectionStatus, {}),
10786
- /* @__PURE__ */ jsx(UserMenu, { category: 8 })
10802
+ showConnectionStatus && /* @__PURE__ */ jsx(ConnectionStatus, {}),
10803
+ showUserMenu && /* @__PURE__ */ jsx(UserMenu, { category: 8 })
10787
10804
  ] })
10788
10805
  ] }) })
10789
10806
  }
10790
10807
  );
10791
10808
  };
10792
- const AppLayout = () => {
10809
+ const AppLayout = ({ header } = {}) => {
10793
10810
  const { isExpanded } = useSidebar();
10811
+ const hideHeader = header === false;
10794
10812
  return /* @__PURE__ */ jsxs("div", { className: "min-h-screen bg-background", children: [
10795
- /* @__PURE__ */ jsx(AppHeader, {}),
10813
+ !hideHeader && /* @__PURE__ */ jsx(AppHeader, { ...header ?? {} }),
10796
10814
  /* @__PURE__ */ jsx(Sidebar, {}),
10797
10815
  /* @__PURE__ */ jsx(
10798
10816
  "main",
10799
10817
  {
10800
10818
  className: cn(
10801
- "pt-16 min-h-screen transition-all duration-300 ease-in-out",
10819
+ "min-h-screen transition-all duration-300 ease-in-out",
10820
+ hideHeader ? "" : "pt-16",
10802
10821
  isExpanded ? "ml-64" : "ml-16"
10803
10822
  ),
10804
10823
  children: /* @__PURE__ */ jsx(Outlet, {})
@@ -15600,6 +15619,7 @@ function createReactApp(config) {
15600
15619
  auth,
15601
15620
  navigation,
15602
15621
  customProviders = [],
15622
+ header,
15603
15623
  persistQueryCache = false,
15604
15624
  queryCacheKey = "PATTERN_STACK_QUERY_CACHE"
15605
15625
  } = appConfig;
@@ -15695,7 +15715,7 @@ function createReactApp(config) {
15695
15715
  }
15696
15716
  return component;
15697
15717
  };
15698
- const AppContent = () => /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center min-h-screen", children: "Loading..." }), children: /* @__PURE__ */ jsx(Routes, { children: /* @__PURE__ */ jsxs(Route, { path: "/", element: /* @__PURE__ */ jsx(AppLayout, {}), children: [
15718
+ const AppContent = () => /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center min-h-screen", children: "Loading..." }), children: /* @__PURE__ */ jsx(Routes, { children: /* @__PURE__ */ jsxs(Route, { path: "/", element: /* @__PURE__ */ jsx(AppLayout, { header }), children: [
15699
15719
  /* @__PURE__ */ jsx(Route, { index: true, element: wrapWithProtection("/", /* @__PURE__ */ jsx(DefaultHome, {})) }),
15700
15720
  routes.map(({ path, component }, index) => /* @__PURE__ */ jsx(Route, { path, element: wrapWithProtection(path, component) }, index))
15701
15721
  ] }) }) });