techsbcn-storybook 2.1.0 → 2.2.0
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/components/navigation/AppBreadcrumbs/AppBreadcrumbs.d.ts +7 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +17 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +19 -3
- package/dist/index.mjs.map +1 -1
- package/dist/interfaces/index.d.ts +1 -0
- package/dist/interfaces/navigation/Breadcrumb.d.ts +8 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export * from './components/layouts/MainLayoutSimple/MainLayoutSimple';
|
|
|
7
7
|
export * from './components/layouts/SplitLayout/SplitLayout';
|
|
8
8
|
export * from './components/navigation/VerticalNav/VerticalNav';
|
|
9
9
|
export * from './components/navigation/components/UserInfo';
|
|
10
|
+
export * from './components/navigation/AppBreadcrumbs/AppBreadcrumbs';
|
|
10
11
|
export * from './components/layouts/Standard/AppSidebar/AppSidebar';
|
|
11
12
|
export * from './components/layouts/DrawerLayout/DrawerSidebar/DrawerSidebar';
|
|
12
13
|
export * from './components/layouts/Standard/AppHeader/AppHeader';
|
package/dist/index.js
CHANGED
|
@@ -1815,6 +1815,22 @@ var UserInfo = (props) => {
|
|
|
1815
1815
|
props.displayName.charAt(0).toUpperCase()
|
|
1816
1816
|
), /* @__PURE__ */ React8__default.default.createElement(material.Box, { sx: { ml: 1, width: "100%", display: "flex", alignItems: "center", alignContent: "flex-end" } }, /* @__PURE__ */ React8__default.default.createElement(material.Box, { className: "user-name" }, props.displayName), props.menuActions && props.menuActions.length > 0 && /* @__PURE__ */ React8__default.default.createElement(material.Box, { sx: { ml: "auto", display: "flex" }, className: "cursor-pointer" }, /* @__PURE__ */ React8__default.default.createElement(iconsMaterial.ExpandMore, { onClick: handleClick }), /* @__PURE__ */ React8__default.default.createElement(material.Menu, { anchorEl, keepMounted: true, open: Boolean(anchorEl), onClose: handleClose }, props.menuActions.map((item, i) => /* @__PURE__ */ React8__default.default.createElement(material.MenuItem, { key: i, onClick: item.action }, item.title)))))));
|
|
1817
1817
|
};
|
|
1818
|
+
var AppBreadcrumbs = (props) => {
|
|
1819
|
+
const matches = reactRouter.useMatches();
|
|
1820
|
+
const crumbs = matches.flatMap((match) => {
|
|
1821
|
+
const breadcrumb = match.handle?.breadcrumb;
|
|
1822
|
+
if (!breadcrumb) return [];
|
|
1823
|
+
const result = typeof breadcrumb === "function" ? breadcrumb(match) : breadcrumb;
|
|
1824
|
+
return Array.isArray(result) ? result : [result];
|
|
1825
|
+
});
|
|
1826
|
+
if (!crumbs.length) {
|
|
1827
|
+
return null;
|
|
1828
|
+
}
|
|
1829
|
+
return /* @__PURE__ */ React8__default.default.createElement(material.Breadcrumbs, { "aria-label": "breadcrumb", separator: props.separator, maxItems: props.maxItems }, crumbs.map((crumb, index) => {
|
|
1830
|
+
const isLast = index === crumbs.length - 1;
|
|
1831
|
+
return isLast || !crumb.to ? /* @__PURE__ */ React8__default.default.createElement(material.Typography, { key: index, variant: "body2", sx: { color: isLast ? "text.primary" : "text.secondary" } }, crumb.label) : /* @__PURE__ */ React8__default.default.createElement(material.Link, { key: index, component: reactRouter.Link, to: crumb.to, underline: "hover", variant: "body2", color: "inherit" }, crumb.label);
|
|
1832
|
+
}));
|
|
1833
|
+
};
|
|
1818
1834
|
|
|
1819
1835
|
// src/components/layouts/Standard/AppSidebar/AppSidebar.scss
|
|
1820
1836
|
var css11 = `.app-sidebar {
|
|
@@ -2906,6 +2922,7 @@ var SearchBaseDefaults = {
|
|
|
2906
2922
|
orderAsc: true
|
|
2907
2923
|
};
|
|
2908
2924
|
|
|
2925
|
+
exports.AppBreadcrumbs = AppBreadcrumbs;
|
|
2909
2926
|
exports.AppHeader = AppHeader;
|
|
2910
2927
|
exports.AppSidebar = AppSidebar;
|
|
2911
2928
|
exports.ButtonComponent = ButtonComponent;
|