shelving 1.223.0 → 1.224.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shelving",
3
- "version": "1.223.0",
3
+ "version": "1.224.0",
4
4
  "author": "Dave Houlbrooke <dave@shax.com>",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,3 +1,8 @@
1
+ :root {
2
+ /* Opaque surface colour for content nested inside a card — slightly darker than `--color-surface`. */
3
+ --card-color-surface: color-mix(in srgb, var(--color-surface) 92%, black);
4
+ }
5
+
1
6
  .card {
2
7
  /* Box */
3
8
  position: relative;
@@ -47,6 +52,12 @@
47
52
  }
48
53
  }
49
54
 
55
+ /* Content nested in a card uses the card's opaque surface colour, so translucent surfaces don't double up. */
56
+ /* `:where()` keeps specificity at zero so colour/status variant classes on descendants still win. */
57
+ :where(.card) * {
58
+ --color-surface: var(--card-color-surface);
59
+ }
60
+
50
61
  .overlay {
51
62
  /* Cover the entire card. */
52
63
  position: absolute;
@@ -13,7 +13,7 @@ export interface SidebarLayoutProps extends OptionalChildProps {
13
13
  * - On narrow viewports the sidebar becomes an off-canvas drawer toggled by a single menu button that switches between a burger and a close icon.
14
14
  * - While the drawer is open an overlay dims the rest of the page; clicking the overlay closes the drawer.
15
15
  * - Inside a `<Navigation>` the drawer closes itself whenever the route changes (e.g. tapping a sidebar link).
16
- * - Use the `--sidebar-layout-width` and `--sidebar-layout-bg` custom properties to override defaults.
16
+ * - Use the `--sidebar-layout-width`, `--sidebar-layout-bg`, `--sidebar-layout-border`, and `--sidebar-layout-color-border` custom properties to override defaults.
17
17
  */
18
18
  export declare function SidebarLayout({ sidebar, children, right }: SidebarLayoutProps): ReactElement;
19
19
  export { SIDEBAR_LAYOUT_CSS };
@@ -13,7 +13,7 @@ import SIDEBAR_LAYOUT_CSS from "./SidebarLayout.module.css";
13
13
  * - On narrow viewports the sidebar becomes an off-canvas drawer toggled by a single menu button that switches between a burger and a close icon.
14
14
  * - While the drawer is open an overlay dims the rest of the page; clicking the overlay closes the drawer.
15
15
  * - Inside a `<Navigation>` the drawer closes itself whenever the route changes (e.g. tapping a sidebar link).
16
- * - Use the `--sidebar-layout-width` and `--sidebar-layout-bg` custom properties to override defaults.
16
+ * - Use the `--sidebar-layout-width`, `--sidebar-layout-bg`, `--sidebar-layout-border`, and `--sidebar-layout-color-border` custom properties to override defaults.
17
17
  */
18
18
  export function SidebarLayout({ sidebar, children, right = false }) {
19
19
  const [open, setOpen] = useState(false);
@@ -24,7 +24,7 @@ export function SidebarLayout({ sidebar, children, right = false }) {
24
24
  setOpen(false);
25
25
  }, [href]);
26
26
  const sidebarEl = (_jsx("nav", { className: getClass(SIDEBAR_LAYOUT_CSS.sidebar, open && SIDEBAR_LAYOUT_CSS.open), children: sidebar }, "sidebar"));
27
- const contentEl = (_jsxs("div", { className: getClass(LAYOUT_CSS.layout, SIDEBAR_LAYOUT_CSS.content), children: [_jsx("div", { className: SIDEBAR_LAYOUT_CSS.toggle, children: _jsx(Button, { fit: true, cyan: !open, orange: open, plain: true, title: open ? "Close menu" : "Show menu", onClick: () => setOpen(o => !o), children: open ? _jsx(XMarkIcon, {}) : _jsx(Bars3Icon, {}) }) }), _jsx("div", { className: SIDEBAR_LAYOUT_CSS.contentInner, children: children })] }, "content"));
27
+ const contentEl = (_jsxs("div", { className: getClass(LAYOUT_CSS.layout, SIDEBAR_LAYOUT_CSS.content), children: [_jsx("div", { className: SIDEBAR_LAYOUT_CSS.toggle, children: _jsx(Button, { fit: true, title: open ? "Close menu" : "Show menu", onClick: () => setOpen(o => !o), children: open ? _jsx(XMarkIcon, {}) : _jsx(Bars3Icon, {}) }) }), _jsx("div", { className: SIDEBAR_LAYOUT_CSS.contentInner, children: children })] }, "content"));
28
28
  const overlayEl = open && (_jsx("button", { type: "button", className: SIDEBAR_LAYOUT_CSS.overlay, "aria-label": "Close menu", onClick: () => setOpen(false) }, "overlay"));
29
29
  return (_jsx("main", { className: getClass(SIDEBAR_LAYOUT_CSS.main, LAYOUT_CSS.layout), children: right ? [contentEl, sidebarEl, overlayEl] : [sidebarEl, contentEl, overlayEl] }));
30
30
  }
@@ -24,7 +24,7 @@
24
24
  overscroll-behavior: contain;
25
25
  padding: var(--space-normal);
26
26
  background: var(--sidebar-layout-bg, var(--color-surface));
27
- border-right: 1px solid var(--color-border);
27
+ border-right: var(--sidebar-layout-border, 1px) solid var(--sidebar-layout-color-border, var(--color-border));
28
28
  }
29
29
 
30
30
  .content {
@@ -21,7 +21,7 @@ export interface SidebarLayoutProps extends OptionalChildProps {
21
21
  * - On narrow viewports the sidebar becomes an off-canvas drawer toggled by a single menu button that switches between a burger and a close icon.
22
22
  * - While the drawer is open an overlay dims the rest of the page; clicking the overlay closes the drawer.
23
23
  * - Inside a `<Navigation>` the drawer closes itself whenever the route changes (e.g. tapping a sidebar link).
24
- * - Use the `--sidebar-layout-width` and `--sidebar-layout-bg` custom properties to override defaults.
24
+ * - Use the `--sidebar-layout-width`, `--sidebar-layout-bg`, `--sidebar-layout-border`, and `--sidebar-layout-color-border` custom properties to override defaults.
25
25
  */
26
26
  export function SidebarLayout({ sidebar, children, right = false }: SidebarLayoutProps): ReactElement {
27
27
  const [open, setOpen] = useState(false);
@@ -40,7 +40,7 @@ export function SidebarLayout({ sidebar, children, right = false }: SidebarLayou
40
40
  const contentEl = (
41
41
  <div key="content" className={getClass(LAYOUT_CSS.layout, SIDEBAR_LAYOUT_CSS.content)}>
42
42
  <div className={SIDEBAR_LAYOUT_CSS.toggle}>
43
- <Button fit cyan={!open} orange={open} plain title={open ? "Close menu" : "Show menu"} onClick={() => setOpen(o => !o)}>
43
+ <Button fit title={open ? "Close menu" : "Show menu"} onClick={() => setOpen(o => !o)}>
44
44
  {open ? <XMarkIcon /> : <Bars3Icon />}
45
45
  </Button>
46
46
  </div>
@@ -11,7 +11,7 @@
11
11
  font-family: var(--menu-font, var(--font-body));
12
12
  font-size: var(--menu-size, var(--size-normal));
13
13
  line-height: var(--menu-leading, var(--leading-normal));
14
- color: var(--menu-color-text, var(--color-quiet));
14
+ color: var(--menu-color-text, var(--color-text));
15
15
  }
16
16
 
17
17
  .item {
@@ -41,15 +41,17 @@
41
41
  outline-offset: 1px;
42
42
  }
43
43
  &[aria-current="page"] {
44
- background: var(--menu-link-color-active-bg, var(--color-surface));
44
+ background: var(--menu-link-color-active-bg, var(--color-white));
45
45
  color: var(--menu-link-color-active-text, var(--color-text));
46
46
  font-weight: var(--menu-link-active-weight, var(--weight-strong));
47
47
  }
48
48
  }
49
49
 
50
- /* "Proud" item — an ancestor of the active page; emphasised in colour and reveals its nested children. */
51
- .proud > .link {
50
+ /* "Proud" item — an ancestor of the active page; emphasised with a strong weight, and reveals its nested children. */
51
+ /* The active page is excluded so its own `[aria-current]` styling wins instead of the proud styling. */
52
+ .proud > .link:not([aria-current="page"]) {
52
53
  color: var(--menu-link-color-proud, var(--color-text));
54
+ font-weight: var(--menu-link-proud-weight, var(--weight-strong));
53
55
  }
54
56
 
55
57
  /* Submenu — Blockquote-style left border to signal hierarchy. */
@@ -1,5 +1,5 @@
1
1
  .icon {
2
- flex: 0 0 fit-content;
2
+ flex: none;
3
3
  border-radius: 999px;
4
4
  width: var(--status-icon-size, 1lh);
5
5
  height: var(--status-icon-size, 1lh);