@broberg/app-shell 0.15.0 → 0.16.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/README.md +28 -0
- package/css/app-shell.css +70 -65
- package/dist/preact.cjs +76 -66
- package/dist/preact.cjs.map +1 -1
- package/dist/preact.d.cts +6 -0
- package/dist/preact.d.ts +6 -0
- package/dist/preact.js +76 -66
- package/dist/preact.js.map +1 -1
- package/package.json +1 -1
package/dist/preact.d.cts
CHANGED
|
@@ -610,6 +610,12 @@ declare function PageTabs(p: {
|
|
|
610
610
|
onNavigate?: Navigate;
|
|
611
611
|
}): JSX.Element;
|
|
612
612
|
interface AppShellProps {
|
|
613
|
+
/**
|
|
614
|
+
* F092.24 — the app's default text size: 1 = as designed, 1.2 = every shell text
|
|
615
|
+
* 20 % larger. Sets --bas-font-scale on the root. The APP's choice; the user's own
|
|
616
|
+
* Zoom (userMenu.zoom) is separate and applies on top.
|
|
617
|
+
*/
|
|
618
|
+
fontScale?: number;
|
|
613
619
|
/** F092.21 — passed to the sidebar: a row action was chosen. */
|
|
614
620
|
onItemAction?: SidebarProps["onItemAction"];
|
|
615
621
|
brand?: ComponentChildren;
|
package/dist/preact.d.ts
CHANGED
|
@@ -610,6 +610,12 @@ declare function PageTabs(p: {
|
|
|
610
610
|
onNavigate?: Navigate;
|
|
611
611
|
}): JSX.Element;
|
|
612
612
|
interface AppShellProps {
|
|
613
|
+
/**
|
|
614
|
+
* F092.24 — the app's default text size: 1 = as designed, 1.2 = every shell text
|
|
615
|
+
* 20 % larger. Sets --bas-font-scale on the root. The APP's choice; the user's own
|
|
616
|
+
* Zoom (userMenu.zoom) is separate and applies on top.
|
|
617
|
+
*/
|
|
618
|
+
fontScale?: number;
|
|
613
619
|
/** F092.21 — passed to the sidebar: a row action was chosen. */
|
|
614
620
|
onItemAction?: SidebarProps["onItemAction"];
|
|
615
621
|
brand?: ComponentChildren;
|
package/dist/preact.js
CHANGED
|
@@ -1481,76 +1481,86 @@ function AppShell(p) {
|
|
|
1481
1481
|
const heading = p.title ?? activeNavLabel(p.groups, p.footer, p.currentPath);
|
|
1482
1482
|
const userInSidebar = p.userMenuPlacement === "sidebar-footer";
|
|
1483
1483
|
const sidebarUser = userInSidebar && p.user ? /* @__PURE__ */ jsx(UserMenu, { user: p.user, ...p.userMenu, placement: "sidebar-footer", onNavigate: p.onNavigate, lang: p.lang }) : null;
|
|
1484
|
-
return /* @__PURE__ */ jsxs(
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
collapsed,
|
|
1509
|
-
collapse,
|
|
1510
|
-
brandMark: p.brandMark,
|
|
1511
|
-
homeHref: p.homeHref,
|
|
1512
|
-
homeLabel: p.homeLabel,
|
|
1513
|
-
mobileOpen: drawer,
|
|
1514
|
-
onClose: () => setDrawer(false),
|
|
1515
|
-
mobile: mode,
|
|
1516
|
-
header: inset || mode === "drawer" ? p.brand : void 0,
|
|
1517
|
-
brandTestId: inset ? "brand-home" : void 0,
|
|
1518
|
-
groupsKey: `${prefix}.groups`,
|
|
1519
|
-
itemsKey: `${prefix}.items`,
|
|
1520
|
-
bottom: sidebarUser,
|
|
1521
|
-
lang: p.lang
|
|
1522
|
-
}
|
|
1523
|
-
),
|
|
1524
|
-
/* @__PURE__ */ jsxs("main", { class: "bas-main", "data-testid": "app-content", children: [
|
|
1525
|
-
/* @__PURE__ */ jsxs("div", { class: "bas-contenthead", "data-testid": "content-header", children: [
|
|
1484
|
+
return /* @__PURE__ */ jsxs(
|
|
1485
|
+
"div",
|
|
1486
|
+
{
|
|
1487
|
+
class: "bas-root",
|
|
1488
|
+
"data-testid": "app-shell",
|
|
1489
|
+
"data-mobile": mode,
|
|
1490
|
+
"data-layout": layout,
|
|
1491
|
+
style: p.fontScale !== void 0 ? { "--bas-font-scale": String(p.fontScale) } : void 0,
|
|
1492
|
+
children: [
|
|
1493
|
+
inset ? null : /* @__PURE__ */ jsx(
|
|
1494
|
+
TopBar,
|
|
1495
|
+
{
|
|
1496
|
+
brand: p.brand,
|
|
1497
|
+
homeHref: p.homeHref,
|
|
1498
|
+
onHome: () => setDrawer(false),
|
|
1499
|
+
actions: p.actions,
|
|
1500
|
+
notifications: p.notifications,
|
|
1501
|
+
user: userInSidebar ? void 0 : p.user,
|
|
1502
|
+
userMenu: p.userMenu,
|
|
1503
|
+
onNavigate: p.onNavigate,
|
|
1504
|
+
lang: p.lang
|
|
1505
|
+
}
|
|
1506
|
+
),
|
|
1507
|
+
/* @__PURE__ */ jsxs("div", { class: "bas-row", children: [
|
|
1526
1508
|
/* @__PURE__ */ jsx(
|
|
1527
|
-
|
|
1509
|
+
Sidebar,
|
|
1528
1510
|
{
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1511
|
+
groups: p.groups,
|
|
1512
|
+
footer: p.footer,
|
|
1513
|
+
onItemAction: p.onItemAction,
|
|
1514
|
+
currentPath: p.currentPath,
|
|
1515
|
+
onNavigate: p.onNavigate,
|
|
1516
|
+
collapsed,
|
|
1517
|
+
collapse,
|
|
1518
|
+
brandMark: p.brandMark,
|
|
1519
|
+
homeHref: p.homeHref,
|
|
1520
|
+
homeLabel: p.homeLabel,
|
|
1521
|
+
mobileOpen: drawer,
|
|
1522
|
+
onClose: () => setDrawer(false),
|
|
1523
|
+
mobile: mode,
|
|
1524
|
+
header: inset || mode === "drawer" ? p.brand : void 0,
|
|
1525
|
+
brandTestId: inset ? "brand-home" : void 0,
|
|
1526
|
+
groupsKey: `${prefix}.groups`,
|
|
1527
|
+
itemsKey: `${prefix}.items`,
|
|
1528
|
+
bottom: sidebarUser,
|
|
1529
|
+
lang: p.lang
|
|
1537
1530
|
}
|
|
1538
1531
|
),
|
|
1539
|
-
|
|
1540
|
-
/* @__PURE__ */
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1532
|
+
/* @__PURE__ */ jsxs("main", { class: "bas-main", "data-testid": "app-content", children: [
|
|
1533
|
+
/* @__PURE__ */ jsxs("div", { class: "bas-contenthead", "data-testid": "content-header", children: [
|
|
1534
|
+
/* @__PURE__ */ jsx(
|
|
1535
|
+
"button",
|
|
1536
|
+
{
|
|
1537
|
+
type: "button",
|
|
1538
|
+
class: "bas-iconbtn bas-trigger",
|
|
1539
|
+
"data-testid": "sidebar-trigger",
|
|
1540
|
+
"aria-label": triggerLabel,
|
|
1541
|
+
"aria-expanded": expanded,
|
|
1542
|
+
title: triggerLabel,
|
|
1543
|
+
onClick: onTrigger,
|
|
1544
|
+
children: /* @__PURE__ */ jsx(IconPanelLeft, {})
|
|
1545
|
+
}
|
|
1546
|
+
),
|
|
1547
|
+
heading ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1548
|
+
/* @__PURE__ */ jsx("span", { class: "bas-contenthead__sep", "data-testid": "content-header-separator", "aria-hidden": "true" }),
|
|
1549
|
+
/* @__PURE__ */ jsx("h1", { class: "bas-contenthead__title", "data-testid": "content-header-title", children: heading })
|
|
1550
|
+
] }) : null,
|
|
1551
|
+
inset ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1552
|
+
/* @__PURE__ */ jsx("div", { class: "bas-spacer" }),
|
|
1553
|
+
p.actions ? /* @__PURE__ */ jsx("div", { class: "bas-contenthead__actions", children: p.actions }) : null,
|
|
1554
|
+
/* @__PURE__ */ jsx(NotificationBell, { source: p.notifications, onNavigate: p.onNavigate, lang: p.lang }),
|
|
1555
|
+
p.user && !userInSidebar ? /* @__PURE__ */ jsx(UserMenu, { user: p.user, ...p.userMenu, onNavigate: p.onNavigate, lang: p.lang }) : null
|
|
1556
|
+
] }) : null
|
|
1557
|
+
] }),
|
|
1558
|
+
p.children
|
|
1559
|
+
] })
|
|
1560
|
+
] })
|
|
1561
|
+
]
|
|
1562
|
+
}
|
|
1563
|
+
);
|
|
1554
1564
|
}
|
|
1555
1565
|
function defaultReauthHref() {
|
|
1556
1566
|
const here = typeof location === "undefined" ? "/" : location.pathname + location.search;
|