@broberg/app-shell 0.14.0 → 0.15.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 +1 -0
- package/css/app-shell.css +2 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -2
- package/dist/index.d.ts +11 -2
- package/dist/index.js.map +1 -1
- package/dist/preact.cjs +23 -13
- package/dist/preact.cjs.map +1 -1
- package/dist/preact.d.cts +11 -2
- package/dist/preact.d.ts +11 -2
- package/dist/preact.js +23 -13
- package/dist/preact.js.map +1 -1
- package/package.json +1 -1
package/dist/preact.d.cts
CHANGED
|
@@ -16,8 +16,11 @@ interface NavItem<Icon = unknown> {
|
|
|
16
16
|
* it is on the current path.
|
|
17
17
|
*/
|
|
18
18
|
children?: NavItem<Icon>[];
|
|
19
|
-
/**
|
|
20
|
-
|
|
19
|
+
/**
|
|
20
|
+
* F092.20 — a status marker before the label; "working" = a run in progress.
|
|
21
|
+
* F092.23 — "idle" = the same ring in grey (finished), so every row lines up.
|
|
22
|
+
*/
|
|
23
|
+
marker?: "working" | "idle";
|
|
21
24
|
/** F092.20 — shows a pin icon after the label. */
|
|
22
25
|
pinned?: boolean;
|
|
23
26
|
/** F092.21 — row actions: a «…» button opens a menu with these. */
|
|
@@ -59,6 +62,12 @@ interface NavGroup<Icon = unknown> {
|
|
|
59
62
|
variant?: "default" | "plain";
|
|
60
63
|
/** F092.20 — sub-headed lists inside this group, shown after `items`. */
|
|
61
64
|
sections?: NavSection<Icon>[];
|
|
65
|
+
/**
|
|
66
|
+
* F092.23 — no heading row: the items show directly, always open (it cannot be
|
|
67
|
+
* folded, so a stored fold for this label is ignored). `label` stays required —
|
|
68
|
+
* it is the group's key and its accessible name.
|
|
69
|
+
*/
|
|
70
|
+
hideLabel?: boolean;
|
|
62
71
|
}
|
|
63
72
|
/**
|
|
64
73
|
* Is this item the current page? Exact match for "/", otherwise the path is the
|
package/dist/preact.d.ts
CHANGED
|
@@ -16,8 +16,11 @@ interface NavItem<Icon = unknown> {
|
|
|
16
16
|
* it is on the current path.
|
|
17
17
|
*/
|
|
18
18
|
children?: NavItem<Icon>[];
|
|
19
|
-
/**
|
|
20
|
-
|
|
19
|
+
/**
|
|
20
|
+
* F092.20 — a status marker before the label; "working" = a run in progress.
|
|
21
|
+
* F092.23 — "idle" = the same ring in grey (finished), so every row lines up.
|
|
22
|
+
*/
|
|
23
|
+
marker?: "working" | "idle";
|
|
21
24
|
/** F092.20 — shows a pin icon after the label. */
|
|
22
25
|
pinned?: boolean;
|
|
23
26
|
/** F092.21 — row actions: a «…» button opens a menu with these. */
|
|
@@ -59,6 +62,12 @@ interface NavGroup<Icon = unknown> {
|
|
|
59
62
|
variant?: "default" | "plain";
|
|
60
63
|
/** F092.20 — sub-headed lists inside this group, shown after `items`. */
|
|
61
64
|
sections?: NavSection<Icon>[];
|
|
65
|
+
/**
|
|
66
|
+
* F092.23 — no heading row: the items show directly, always open (it cannot be
|
|
67
|
+
* folded, so a stored fold for this label is ignored). `label` stays required —
|
|
68
|
+
* it is the group's key and its accessible name.
|
|
69
|
+
*/
|
|
70
|
+
hideLabel?: boolean;
|
|
62
71
|
}
|
|
63
72
|
/**
|
|
64
73
|
* Is this item the current page? Exact match for "/", otherwise the path is the
|
package/dist/preact.js
CHANGED
|
@@ -808,7 +808,7 @@ function Sidebar(p) {
|
|
|
808
808
|
children: [
|
|
809
809
|
active && !sub ? /* @__PURE__ */ jsx("span", { class: "bas-item__bar" }) : null,
|
|
810
810
|
it.icon ? /* @__PURE__ */ jsx("span", { class: "bas-item__icon", children: it.icon }) : null,
|
|
811
|
-
it.marker === "working" ? /* @__PURE__ */ jsx("span", { class: "bas-item__marker", "data-testid": `sidebar-item-${it.id}-marker`, role: "img", "aria-label": TEXT[p.lang].working }) : null,
|
|
811
|
+
it.marker === "working" ? /* @__PURE__ */ jsx("span", { class: "bas-item__marker", "data-testid": `sidebar-item-${it.id}-marker`, role: "img", "aria-label": TEXT[p.lang].working }) : it.marker === "idle" ? /* @__PURE__ */ jsx("span", { class: "bas-item__marker bas-item__marker--idle", "data-testid": `sidebar-item-${it.id}-marker`, "aria-hidden": "true" }) : null,
|
|
812
812
|
/* @__PURE__ */ jsx("span", { class: "bas-item__label", children: it.label }),
|
|
813
813
|
it.pinned ? /* @__PURE__ */ jsx("span", { class: "bas-item__pin", "data-testid": `sidebar-item-${it.id}-pinned`, role: "img", "aria-label": TEXT[p.lang].pinned, children: /* @__PURE__ */ jsx(IconPin, {}) }) : null,
|
|
814
814
|
badge ? /* @__PURE__ */ jsx("span", { class: "bas-item__count", "data-testid": `sidebar-badge-${it.id}`, children: badge }) : null
|
|
@@ -899,19 +899,29 @@ function Sidebar(p) {
|
|
|
899
899
|
) : p.brandMark }) : null
|
|
900
900
|
] }) : null,
|
|
901
901
|
/* @__PURE__ */ jsx("nav", { class: "bas-sidebar__nav", children: p.groups.map((g) => {
|
|
902
|
-
const open = railed || !folded.has(g.label);
|
|
902
|
+
const open = railed || g.hideLabel || !folded.has(g.label);
|
|
903
903
|
const slug = g.label.toLowerCase().replace(/[^a-z0-9]+/g, "-");
|
|
904
|
-
return /* @__PURE__ */ jsxs(
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
904
|
+
return /* @__PURE__ */ jsxs(
|
|
905
|
+
"div",
|
|
906
|
+
{
|
|
907
|
+
class: "bas-group" + (g.variant === "plain" ? " bas-group--plain" : ""),
|
|
908
|
+
role: g.hideLabel ? "group" : void 0,
|
|
909
|
+
"aria-label": g.hideLabel ? g.label : void 0,
|
|
910
|
+
"data-testid": g.hideLabel ? `sidebar-group-${slug}-unlabelled` : void 0,
|
|
911
|
+
children: [
|
|
912
|
+
g.hideLabel ? null : /* @__PURE__ */ jsxs("button", { type: "button", class: "bas-group__label", "data-testid": `sidebar-group-${slug}`, "aria-expanded": open, onClick: () => toggleGroup(g.label), children: [
|
|
913
|
+
/* @__PURE__ */ jsx(IconChevron, { open }),
|
|
914
|
+
/* @__PURE__ */ jsx("span", { children: g.label })
|
|
915
|
+
] }),
|
|
916
|
+
open ? g.items.map(item) : null,
|
|
917
|
+
open ? g.sections?.map((sec) => /* @__PURE__ */ jsxs("div", { class: "bas-section", "data-testid": `sidebar-section-${slug}-${sec.label.toLowerCase().replace(/[^a-z0-9æøå]+/g, "-")}`, children: [
|
|
918
|
+
/* @__PURE__ */ jsx("div", { class: "bas-section__label", children: sec.label }),
|
|
919
|
+
sec.items.map(item)
|
|
920
|
+
] }, sec.label)) : null
|
|
921
|
+
]
|
|
922
|
+
},
|
|
923
|
+
g.label
|
|
924
|
+
);
|
|
915
925
|
}) }),
|
|
916
926
|
p.footer?.length ? /* @__PURE__ */ jsx("div", { class: "bas-sidebar__foot", children: p.footer.map(item) }) : null,
|
|
917
927
|
p.bottom ? /* @__PURE__ */ jsx("div", { class: "bas-sidebar__user", "data-testid": "sidebar-user", children: p.bottom }) : null
|