@pattern-stack/frontend-patterns 0.2.0-alpha.12 → 0.2.0-alpha.14
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/CHANGELOG.md +25 -0
- package/dist/atoms/components/core/Button/Button.d.ts.map +1 -1
- package/dist/index.es.js +26 -35
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +26 -35
- package/dist/index.js.map +1 -1
- package/dist/molecules/layout/AppHeader/AppHeader.d.ts +7 -3
- package/dist/molecules/layout/AppHeader/AppHeader.d.ts.map +1 -1
- package/dist/molecules/layout/AppLayout.d.ts +9 -1
- package/dist/molecules/layout/AppLayout.d.ts.map +1 -1
- package/dist/molecules/layout/Sidebar.d.ts +10 -3
- package/dist/molecules/layout/Sidebar.d.ts.map +1 -1
- package/dist/templates/factory.d.ts +8 -0
- package/dist/templates/factory.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4164,7 +4164,7 @@ const Button = React.forwardRef(
|
|
|
4164
4164
|
children: [
|
|
4165
4165
|
loading && /* @__PURE__ */ jsxRuntime.jsx(Spinner$1, { className: "w-4 h-4 mr-2" }),
|
|
4166
4166
|
!loading && icon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn("inline-flex shrink-0", children && "mr-2"), children: icon }),
|
|
4167
|
-
children && /* @__PURE__ */ jsxRuntime.jsx("span", { className:
|
|
4167
|
+
children && (iconOnlyMobile ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "hidden sm:inline", children }) : /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children })),
|
|
4168
4168
|
!loading && iconAfter && /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn("inline-flex shrink-0", children && "ml-2"), children: iconAfter })
|
|
4169
4169
|
]
|
|
4170
4170
|
}
|
|
@@ -10693,7 +10693,7 @@ const SidebarButton = ({
|
|
|
10693
10693
|
}
|
|
10694
10694
|
);
|
|
10695
10695
|
};
|
|
10696
|
-
const Sidebar = ({ className }) => {
|
|
10696
|
+
const Sidebar = ({ className, footer }) => {
|
|
10697
10697
|
const { isExpanded, toggleSidebar } = useSidebar();
|
|
10698
10698
|
const { navigation } = useNavigation();
|
|
10699
10699
|
const location = reactRouterDom.useLocation();
|
|
@@ -10767,35 +10767,23 @@ const Sidebar = ({ className }) => {
|
|
|
10767
10767
|
item.value
|
|
10768
10768
|
);
|
|
10769
10769
|
}) }),
|
|
10770
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10770
|
+
footer != null && /* @__PURE__ */ jsxRuntime.jsx(
|
|
10771
10771
|
"div",
|
|
10772
10772
|
{
|
|
10773
10773
|
className: cn("p-4 border-t border-border", !isExpanded && "px-3"),
|
|
10774
10774
|
"data-component-name": "SidebarFooter",
|
|
10775
|
-
children: /* @__PURE__ */ jsxRuntime.
|
|
10776
|
-
|
|
10777
|
-
|
|
10778
|
-
|
|
10779
|
-
|
|
10780
|
-
|
|
10781
|
-
|
|
10782
|
-
|
|
10783
|
-
|
|
10784
|
-
|
|
10785
|
-
|
|
10786
|
-
|
|
10787
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10788
|
-
"div",
|
|
10789
|
-
{
|
|
10790
|
-
className: cn(
|
|
10791
|
-
"text-xs text-muted-foreground whitespace-nowrap",
|
|
10792
|
-
"transition-opacity duration-200 ease-out",
|
|
10793
|
-
isExpanded ? "opacity-100" : "opacity-0"
|
|
10794
|
-
),
|
|
10795
|
-
children: "AloeVera v1.0"
|
|
10796
|
-
}
|
|
10797
|
-
)
|
|
10798
|
-
] })
|
|
10775
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
10776
|
+
"div",
|
|
10777
|
+
{
|
|
10778
|
+
className: cn(
|
|
10779
|
+
"text-xs text-muted-foreground",
|
|
10780
|
+
"transition-opacity duration-200 ease-out",
|
|
10781
|
+
isExpanded ? "opacity-100" : "opacity-70",
|
|
10782
|
+
!isExpanded && "text-center"
|
|
10783
|
+
),
|
|
10784
|
+
children: footer
|
|
10785
|
+
}
|
|
10786
|
+
)
|
|
10799
10787
|
}
|
|
10800
10788
|
)
|
|
10801
10789
|
]
|
|
@@ -10809,9 +10797,9 @@ const AppHeader = ({
|
|
|
10809
10797
|
className,
|
|
10810
10798
|
branding,
|
|
10811
10799
|
searchPlaceholder = "Search models, tests, jobs, and components...",
|
|
10812
|
-
showSearch =
|
|
10813
|
-
showUserMenu =
|
|
10814
|
-
showConnectionStatus =
|
|
10800
|
+
showSearch = false,
|
|
10801
|
+
showUserMenu = false,
|
|
10802
|
+
showConnectionStatus = false
|
|
10815
10803
|
}) => {
|
|
10816
10804
|
const isTrialMode = false;
|
|
10817
10805
|
const brandingNode = (() => {
|
|
@@ -10840,7 +10828,7 @@ const AppHeader = ({
|
|
|
10840
10828
|
),
|
|
10841
10829
|
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: [
|
|
10842
10830
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-3", children: brandingNode }),
|
|
10843
|
-
showSearch && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 max-w-
|
|
10831
|
+
showSearch && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 max-w-md mx-8", children: /* @__PURE__ */ jsxRuntime.jsx(GlobalSearch, { className: "w-full", placeholder: searchPlaceholder }) }),
|
|
10844
10832
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center space-x-4", children: [
|
|
10845
10833
|
showConnectionStatus && /* @__PURE__ */ jsxRuntime.jsx(ConnectionStatus, {}),
|
|
10846
10834
|
showUserMenu && /* @__PURE__ */ jsxRuntime.jsx(UserMenu, { category: 8 })
|
|
@@ -10849,12 +10837,12 @@ const AppHeader = ({
|
|
|
10849
10837
|
}
|
|
10850
10838
|
);
|
|
10851
10839
|
};
|
|
10852
|
-
const AppLayout = ({ header } = {}) => {
|
|
10840
|
+
const AppLayout = ({ header, sidebar } = {}) => {
|
|
10853
10841
|
const { isExpanded } = useSidebar();
|
|
10854
10842
|
const hideHeader = header === false;
|
|
10855
10843
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-h-screen bg-background", children: [
|
|
10856
10844
|
!hideHeader && /* @__PURE__ */ jsxRuntime.jsx(AppHeader, { ...header ?? {} }),
|
|
10857
|
-
/* @__PURE__ */ jsxRuntime.jsx(Sidebar, {}),
|
|
10845
|
+
/* @__PURE__ */ jsxRuntime.jsx(Sidebar, { footer: sidebar == null ? void 0 : sidebar.footer }),
|
|
10858
10846
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10859
10847
|
"main",
|
|
10860
10848
|
{
|
|
@@ -15663,6 +15651,7 @@ function createReactApp(config) {
|
|
|
15663
15651
|
navigation,
|
|
15664
15652
|
customProviders = [],
|
|
15665
15653
|
header,
|
|
15654
|
+
sidebar,
|
|
15666
15655
|
persistQueryCache = false,
|
|
15667
15656
|
queryCacheKey = "PATTERN_STACK_QUERY_CACHE"
|
|
15668
15657
|
} = appConfig;
|
|
@@ -15758,8 +15747,10 @@ function createReactApp(config) {
|
|
|
15758
15747
|
}
|
|
15759
15748
|
return component;
|
|
15760
15749
|
};
|
|
15761
|
-
const
|
|
15762
|
-
|
|
15750
|
+
const consumerHasRoot = routes.some((r) => r.path === "/");
|
|
15751
|
+
const showDefaultHome = routes.length === 0;
|
|
15752
|
+
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, sidebar }), children: [
|
|
15753
|
+
showDefaultHome && !consumerHasRoot && /* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Route, { index: true, element: wrapWithProtection("/", /* @__PURE__ */ jsxRuntime.jsx(DefaultHome, {})) }),
|
|
15763
15754
|
routes.map(({ path, component }, index) => /* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Route, { path, element: wrapWithProtection(path, component) }, index))
|
|
15764
15755
|
] }) }) });
|
|
15765
15756
|
return createProviderTree(/* @__PURE__ */ jsxRuntime.jsx(AppContent, {}));
|