@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.js CHANGED
@@ -10802,7 +10802,33 @@ const Sidebar = ({ className }) => {
10802
10802
  }
10803
10803
  );
10804
10804
  };
10805
- const AppHeader = ({ className }) => {
10805
+ function isBrandingObject(v) {
10806
+ return v != null && typeof v === "object" && !React.isValidElement(v) && "title" in v;
10807
+ }
10808
+ const AppHeader = ({
10809
+ className,
10810
+ branding,
10811
+ searchPlaceholder = "Search models, tests, jobs, and components...",
10812
+ showSearch = true,
10813
+ showUserMenu = true,
10814
+ showConnectionStatus = true
10815
+ }) => {
10816
+ const isTrialMode = false;
10817
+ const brandingNode = (() => {
10818
+ if (branding == null) {
10819
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
10820
+ /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-xl font-bold text-foreground", children: "Frontend Template" }),
10821
+ isTrialMode
10822
+ ] });
10823
+ }
10824
+ if (isBrandingObject(branding)) {
10825
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
10826
+ /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-xl font-bold text-foreground", children: branding.title }),
10827
+ branding.badge
10828
+ ] });
10829
+ }
10830
+ return branding;
10831
+ })();
10806
10832
  return /* @__PURE__ */ jsxRuntime.jsx(
10807
10833
  "header",
10808
10834
  {
@@ -10813,35 +10839,28 @@ const AppHeader = ({ className }) => {
10813
10839
  className
10814
10840
  ),
10815
10841
  children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mx-auto max-w-7xl px-4 sm:px-6 lg:px-8", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex h-16 items-center justify-between", children: [
10816
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [
10817
- /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-xl font-bold text-foreground", children: "Frontend Template" }),
10818
- /* @__PURE__ */ jsxRuntime.jsx(DataBadge, { variant: "status", status: "info", display: "icon-text", children: "Trial Mode" })
10819
- ] }),
10820
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 max-w-2xl mx-8", children: /* @__PURE__ */ jsxRuntime.jsx(
10821
- GlobalSearch,
10822
- {
10823
- className: "w-full",
10824
- placeholder: "Search models, tests, jobs, and components..."
10825
- }
10826
- ) }),
10842
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-3", children: brandingNode }),
10843
+ showSearch && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 max-w-2xl mx-8", children: /* @__PURE__ */ jsxRuntime.jsx(GlobalSearch, { className: "w-full", placeholder: searchPlaceholder }) }),
10827
10844
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center space-x-4", children: [
10828
- /* @__PURE__ */ jsxRuntime.jsx(ConnectionStatus, {}),
10829
- /* @__PURE__ */ jsxRuntime.jsx(UserMenu, { category: 8 })
10845
+ showConnectionStatus && /* @__PURE__ */ jsxRuntime.jsx(ConnectionStatus, {}),
10846
+ showUserMenu && /* @__PURE__ */ jsxRuntime.jsx(UserMenu, { category: 8 })
10830
10847
  ] })
10831
10848
  ] }) })
10832
10849
  }
10833
10850
  );
10834
10851
  };
10835
- const AppLayout = () => {
10852
+ const AppLayout = ({ header } = {}) => {
10836
10853
  const { isExpanded } = useSidebar();
10854
+ const hideHeader = header === false;
10837
10855
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-h-screen bg-background", children: [
10838
- /* @__PURE__ */ jsxRuntime.jsx(AppHeader, {}),
10856
+ !hideHeader && /* @__PURE__ */ jsxRuntime.jsx(AppHeader, { ...header ?? {} }),
10839
10857
  /* @__PURE__ */ jsxRuntime.jsx(Sidebar, {}),
10840
10858
  /* @__PURE__ */ jsxRuntime.jsx(
10841
10859
  "main",
10842
10860
  {
10843
10861
  className: cn(
10844
- "pt-16 min-h-screen transition-all duration-300 ease-in-out",
10862
+ "min-h-screen transition-all duration-300 ease-in-out",
10863
+ hideHeader ? "" : "pt-16",
10845
10864
  isExpanded ? "ml-64" : "ml-16"
10846
10865
  ),
10847
10866
  children: /* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Outlet, {})
@@ -15643,6 +15662,7 @@ function createReactApp(config) {
15643
15662
  auth,
15644
15663
  navigation,
15645
15664
  customProviders = [],
15665
+ header,
15646
15666
  persistQueryCache = false,
15647
15667
  queryCacheKey = "PATTERN_STACK_QUERY_CACHE"
15648
15668
  } = appConfig;
@@ -15738,7 +15758,7 @@ function createReactApp(config) {
15738
15758
  }
15739
15759
  return component;
15740
15760
  };
15741
- const AppContent = () => /* @__PURE__ */ jsxRuntime.jsx(React.Suspense, { fallback: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center min-h-screen", children: "Loading..." }), children: /* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Routes, { children: /* @__PURE__ */ jsxRuntime.jsxs(reactRouterDom.Route, { path: "/", element: /* @__PURE__ */ jsxRuntime.jsx(AppLayout, {}), children: [
15761
+ const AppContent = () => /* @__PURE__ */ jsxRuntime.jsx(React.Suspense, { fallback: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center min-h-screen", children: "Loading..." }), children: /* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Routes, { children: /* @__PURE__ */ jsxRuntime.jsxs(reactRouterDom.Route, { path: "/", element: /* @__PURE__ */ jsxRuntime.jsx(AppLayout, { header }), children: [
15742
15762
  /* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Route, { index: true, element: wrapWithProtection("/", /* @__PURE__ */ jsxRuntime.jsx(DefaultHome, {})) }),
15743
15763
  routes.map(({ path, component }, index) => /* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Route, { path, element: wrapWithProtection(path, component) }, index))
15744
15764
  ] }) }) });