shelving 1.285.6 → 1.285.7

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.285.6",
3
+ "version": "1.285.7",
4
4
  "author": "Dave Houlbrooke <dave@shax.com>",
5
5
  "repository": {
6
6
  "type": "git",
@@ -23,7 +23,7 @@ export interface CardProps extends ClickableProps, StatusVariants, BlockVariants
23
23
  * - When `href` or `onClick` is set the card becomes navigable: a stretched overlay `<a>` / `<button>` covers the entire card while the children render normally inside.
24
24
  * - Real interactive elements inside the card (e.g. inline `<a>` links) stay clickable thanks to `position: relative; z-index: 2` rules in the stylesheet.
25
25
  * - Accepts a `status` colour and raw `ColorProps` — the card styles the box; lay out its contents however the use case needs.
26
- * - Carries a `normal` drop shadow by default — set `shadow="none"` to flatten a card, or `shadow="small"` / `shadow="large"` to adjust its elevation.
26
+ * - Has no drop shadow by default — set `shadow="small"`, `shadow="normal"` or `shadow="large"` to raise a card.
27
27
  *
28
28
  * @kind component
29
29
  * @see https://shelving.cc/ui/Card
package/ui/block/Card.js CHANGED
@@ -11,7 +11,7 @@ import CARD_CSS from "./Card.module.css";
11
11
  * - When `href` or `onClick` is set the card becomes navigable: a stretched overlay `<a>` / `<button>` covers the entire card while the children render normally inside.
12
12
  * - Real interactive elements inside the card (e.g. inline `<a>` links) stay clickable thanks to `position: relative; z-index: 2` rules in the stylesheet.
13
13
  * - Accepts a `status` colour and raw `ColorProps` — the card styles the box; lay out its contents however the use case needs.
14
- * - Carries a `normal` drop shadow by default — set `shadow="none"` to flatten a card, or `shadow="small"` / `shadow="large"` to adjust its elevation.
14
+ * - Has no drop shadow by default — set `shadow="small"`, `shadow="normal"` or `shadow="large"` to raise a card.
15
15
  *
16
16
  * @kind component
17
17
  * @see https://shelving.cc/ui/Card
package/ui/block/Card.md CHANGED
@@ -1,13 +1,13 @@
1
1
  # Card
2
2
 
3
- A boxed surface that groups a self-contained piece of content. Rendered as an `<article>`, painted from the tint ladder (surface, border, text) and styled with rounded corners and padding by default.
3
+ A boxed surface that groups a self-contained piece of content. Rendered as an `<article>`, painted from the tint ladder (surface, text) and styled with rounded corners and padding by default.
4
4
 
5
5
  **Things to know:**
6
6
 
7
7
  - Set `href` or `onClick` to make the whole card navigable — a stretched, visually-hidden overlay `<a>` / `<button>` covers the card while the children render normally inside. Real interactive elements inside the card (inline links, buttons) stay clickable and keyboard-focusable.
8
- - `color=` and `status=` move the tint anchor for the card's scope, so the surface, border, text, and hover shade all re-derive together — and nested components (`<Tag>`, `<Preformatted>`, `<Button>`) inherit the same tint.
8
+ - `color=` and `status=` move the tint anchor for the card's scope, so the surface, text, and hover shade all re-derive together — and nested components (`<Tag>`, `<Preformatted>`, `<Button>`) inherit the same tint.
9
9
  - A card styles only the box. Lay out its contents with the usual block components (`<Subheading>`, `<Paragraph>`, `<Row>`, …).
10
- - Cards carry a `normal` drop shadow by default — set `shadow="none"` to flatten a given card, or `shadow="small"` / `shadow="large"` to adjust its elevation.
10
+ - Cards have no drop shadow by default — set `shadow="small"`, `shadow="normal"` or `shadow="large"` to raise a given card.
11
11
  - Composes the standard styling variants: `color`, `status`, `padding`, `space`, `width`, `shadow`, plus typography.
12
12
 
13
13
  ## Usage
@@ -49,14 +49,14 @@ import { Card, Subheading } from "shelving/ui";
49
49
  ```tsx
50
50
  import { Card, Subheading } from "shelving/ui";
51
51
 
52
- // Flatten one card; raise another.
53
- <Card shadow="none"><Subheading>Flat</Subheading></Card>
54
- <Card shadow="large"><Subheading>Raised</Subheading></Card>
52
+ // Raise a card a little or a lot.
53
+ <Card shadow="small"><Subheading>Raised</Subheading></Card>
54
+ <Card shadow="large"><Subheading>Raised more</Subheading></Card>
55
55
  ```
56
56
 
57
57
  ## Styling
58
58
 
59
- `Card` paints from the [tint ladder](/ui/TINT_CLASS); override these hooks at `:root` (or any ancestor scope) to retheme. Apply `color=` / `status=` (on the card or an ancestor scope) to recolour everything at once — surface, border, text, and hover shade re-derive together; reach for a per-property hook for a single surgical change.
59
+ `Card` paints from the [tint ladder](/ui/TINT_CLASS); override these hooks at `:root` (or any ancestor scope) to retheme. Apply `color=` / `status=` (on the card or an ancestor scope) to recolour everything at once — surface, text, and hover shade re-derive together; reach for a per-property hook for a single surgical change.
60
60
 
61
61
  | Variable | Styles | Default |
62
62
  |---|---|---|
@@ -64,20 +64,20 @@ import { Card, Subheading } from "shelving/ui";
64
64
  | `--card-hover-background` | Surface fill when a navigable card is hovered | `var(--tint-95)` |
65
65
  | `--card-color` | Text colour | `var(--tint-00)` |
66
66
  | `--card-border` | Border shorthand | `var(--card-stroke) solid var(--tint-80)` |
67
- | `--card-stroke` | Border / outline thickness | `var(--stroke-normal)` (2px) |
67
+ | `--card-stroke` | Border thickness — set it (e.g. `var(--stroke-normal)`) to show the border | `0` |
68
68
  | `--card-radius` | Corner radius | `var(--radius-normal)` (16px) |
69
69
  | `--card-padding` | Inner padding | `var(--space-normal)` (16px) |
70
70
  | `--card-space` | Outer block margin (top + bottom) | `var(--space-paragraph)` (16px) |
71
- | `--card-shadow` | Drop shadow | `var(--shadow-normal)` |
71
+ | `--card-shadow` | Drop shadow | `none` |
72
72
  | `--card-transition` | Transition | `all var(--duration-fast)` (150ms) |
73
73
  | `--card-focus-border` | Focus outline | `var(--stroke-focus) solid var(--color-focus)` |
74
74
 
75
- **Global tokens it reads** — move these to retheme broadly rather than overriding ladder steps directly: the tint ladder `--tint-00` / `--tint-80` / `--tint-90` / `--tint-95`, plus `--space-normal`, `--space-paragraph`, `--radius-normal`, `--shadow-normal`, `--stroke-normal`, `--stroke-focus`, `--color-focus`, and `--duration-fast`.
75
+ **Global tokens it reads** — move these to retheme broadly rather than overriding ladder steps directly: the tint ladder `--tint-00` / `--tint-80` / `--tint-90` / `--tint-95`, plus `--space-normal`, `--space-paragraph`, `--radius-normal`, `--stroke-focus`, `--color-focus`, and `--duration-fast`.
76
76
 
77
77
  ```css
78
- /* Theme: flat cards with tighter corners. */
78
+ /* Theme: raised cards with tighter corners. */
79
79
  :root {
80
- --card-shadow: none;
80
+ --card-shadow: var(--shadow-normal);
81
81
  --card-radius: var(--radius-small);
82
82
  }
83
83
  ```
@@ -2,7 +2,6 @@
2
2
  @import url("../style/Color.module.css");
3
3
  @import url("../style/Duration.module.css");
4
4
  @import url("../style/Radius.module.css");
5
- @import url("../style/Shadow.module.css");
6
5
  @import url("../style/Space.module.css");
7
6
  @import url("../style/Stroke.module.css");
8
7
  @import url("../style/Tint.module.css");
@@ -24,22 +23,22 @@
24
23
  position: relative;
25
24
  margin-inline: 0;
26
25
  margin-block: var(--card-space, var(--space-paragraph));
27
- border: var(--card-border, var(--card-stroke, var(--stroke-normal) solid var(--tint-80)));
26
+ border: var(--card-border, var(--card-stroke, 0) solid var(--tint-80));
28
27
  padding: var(--card-padding, var(--space-normal));
29
28
  border-radius: var(--card-radius, var(--radius-normal));
30
29
 
31
30
  /* Style */
32
31
  background: var(--card-background, var(--tint-90));
33
32
  color: var(--card-color, var(--tint-00));
34
- box-shadow: var(--card-shadow, var(--shadow-normal));
33
+ box-shadow: var(--card-shadow, none);
35
34
  transition: var(--card-transition, all var(--duration-fast));
36
35
  outline: var(--card-focus-border, var(--stroke-focus) solid var(--color-focus));
37
- outline-offset: calc(0px - var(--card-stroke, var(--stroke-normal)));
36
+ outline-offset: calc(0px - var(--stroke-focus)); /* Fully inset, so it sits inside the card edge. */
38
37
 
39
38
  /* Hover/focus affordance driven by the overlay link/button. */
40
39
  &:has(.overlay:hover) {
41
40
  background: var(--card-hover-background, var(--tint-95));
42
- border: var(--card-hover-border, var(--card-stroke, var(--stroke-normal)) solid var(--tint-90));
41
+ border: var(--card-hover-border, var(--card-stroke, 0) solid var(--tint-90));
43
42
  }
44
43
  }
45
44
 
package/ui/block/Card.tsx CHANGED
@@ -27,7 +27,7 @@ export interface CardProps extends ClickableProps, StatusVariants, BlockVariants
27
27
  * - When `href` or `onClick` is set the card becomes navigable: a stretched overlay `<a>` / `<button>` covers the entire card while the children render normally inside.
28
28
  * - Real interactive elements inside the card (e.g. inline `<a>` links) stay clickable thanks to `position: relative; z-index: 2` rules in the stylesheet.
29
29
  * - Accepts a `status` colour and raw `ColorProps` — the card styles the box; lay out its contents however the use case needs.
30
- * - Carries a `normal` drop shadow by default — set `shadow="none"` to flatten a card, or `shadow="small"` / `shadow="large"` to adjust its elevation.
30
+ * - Has no drop shadow by default — set `shadow="small"`, `shadow="normal"` or `shadow="large"` to raise a card.
31
31
  *
32
32
  * @kind component
33
33
  * @see https://shelving.cc/ui/Card
package/ui/block/Panel.md CHANGED
@@ -7,8 +7,8 @@ A full-width vertical region that paints the current surface colour. Use panels
7
7
  - A panel always spans the full width of its container. To constrain the content inside, compose a `<Block>` `width="narrow"` (or `width="wide"`) within it.
8
8
  - Block margin is always zero so panels stack flush; control the vertical breathing room with the `padding` variant (`<Panel padding="large">`, `<Panel padding="none">`).
9
9
  - Inline padding ("indent") keeps content off the edges by default. Override it per-property with `--panel-indent`, or change it with the shared `indent` variant (`<Panel indent="large">`, `<Panel indent="none">`).
10
- - `color=` / `status=` move the tint anchor for the whole panel scope, so the surface, border, and text re-derive together and cascade into nested content.
11
- - The top and bottom borders are dropped on the first and last panel so the page doesn't gain stray edge lines.
10
+ - `color=` / `status=` move the tint anchor for the whole panel scope, so the surface and text re-derive together and cascade into nested content.
11
+ - Panels have no border by default. Set `--panel-stroke` (or `--panel-border`) to add top and bottom borders; the first and last panel drop them so the page doesn't gain stray edge lines.
12
12
 
13
13
  ## Usage
14
14
 
@@ -31,15 +31,15 @@ import { Panel, Block, Title, Paragraph } from "shelving/ui";
31
31
 
32
32
  ## Styling
33
33
 
34
- `Panel` paints from the [tint ladder](/ui/TINT_CLASS); apply `color=` / `status=` (on the panel or an ancestor scope) to recolour the whole scope at once — surface, border, and text re-derive together — or reach for a per-property hook for a single change.
34
+ `Panel` paints from the [tint ladder](/ui/TINT_CLASS); apply `color=` / `status=` (on the panel or an ancestor scope) to recolour the whole scope at once — surface and text re-derive together — or reach for a per-property hook for a single change.
35
35
 
36
36
  | Variable | Styles | Default |
37
37
  |---|---|---|
38
38
  | `--panel-background` | Surface fill | `var(--tint-90)` |
39
39
  | `--panel-color` | Text colour | `var(--tint-00)` |
40
40
  | `--panel-border` | Top/bottom border shorthand | `var(--panel-stroke) solid var(--tint-80)` |
41
- | `--panel-stroke` | Border thickness | `var(--stroke-normal)` (2px) |
41
+ | `--panel-stroke` | Border thickness — set it (e.g. `var(--stroke-normal)`) to show the border | `0` |
42
42
  | `--panel-padding` | Block padding (top + bottom) | `var(--space-section)` (2rem) |
43
43
  | `--panel-indent` | Inline padding (left + right) keeping content off the edges | `var(--space-normal)` (16px) |
44
44
 
45
- **Global tokens it reads:** the tint-ladder steps `--tint-00` / `--tint-80` / `--tint-90`, plus `--stroke-normal`, `--space-section`, and `--space-normal`. The shared `padding` variant overrides `--panel-padding`; the shared `indent` variant overrides `--panel-indent`.
45
+ **Global tokens it reads:** the tint-ladder steps `--tint-00` / `--tint-80` / `--tint-90`, plus `--space-section`, and `--space-normal`. The shared `padding` variant overrides `--panel-padding`; the shared `indent` variant overrides `--panel-indent`.
@@ -1,5 +1,4 @@
1
1
  @import url("../style/layers.css");
2
- @import url("../style/Stroke.module.css");
3
2
  @import url("../style/Tint.module.css");
4
3
  @import url("../style/Space.module.css");
5
4
 
@@ -18,8 +17,8 @@
18
17
  position: relative;
19
18
  padding-block: var(--panel-padding, var(--space-section));
20
19
  padding-inline: var(--panel-indent, var(--space-normal));
21
- border-top: var(--panel-border, var(--panel-stroke, var(--stroke-normal)) solid var(--tint-80));
22
- border-bottom: var(--panel-border, var(--panel-stroke, var(--stroke-normal)) solid var(--tint-80));
20
+ border-top: var(--panel-border, var(--panel-stroke, 0) solid var(--tint-80));
21
+ border-bottom: var(--panel-border, var(--panel-stroke, 0) solid var(--tint-80));
23
22
 
24
23
  /* Style */
25
24
  background: var(--panel-background, var(--tint-90));
@@ -43,8 +43,8 @@ Layouts compose naturally as `<Router>` route values — wrap a group of routes
43
43
  | `--sidebar-layout-color` | Text colour for the layout (set on `body`, inherited by the content column) | `var(--tint-00)` (black) |
44
44
  | `--sidebar-layout-sidebar-background` | Sidebar column fill | `var(--tint-90)` (one shade darker than the page) |
45
45
  | `--sidebar-layout-sidebar-color` | Sidebar column text colour | `var(--tint-00)` (black) |
46
- | `--sidebar-layout-border` | Divider between sidebar and content | `var(--stroke-normal) solid var(--tint-80)` |
46
+ | `--sidebar-layout-border` | Divider between sidebar and content, e.g. `1px solid var(--tint-80)` | `none` |
47
47
 
48
48
  The sidebar and content columns own their own scroll behaviour directly (this layout no longer composes a shared `.layout` class).
49
49
 
50
- **Global tokens it reads** — `--tint-00` / `--tint-80` / `--tint-90` / `--tint-100`, plus `--space-normal`, `--stroke-normal`, `--duration-normal`, and `--color-shadow`.
50
+ **Global tokens it reads** — `--tint-00` / `--tint-90` / `--tint-100`, plus `--space-normal`, `--duration-normal`, and `--color-shadow`.
@@ -2,7 +2,6 @@
2
2
  @import url("../style/Color.module.css");
3
3
  @import url("../style/Duration.module.css");
4
4
  @import url("../style/Space.module.css");
5
- @import url("../style/Stroke.module.css");
6
5
  @import url("../style/Tint.module.css");
7
6
  @import url("../style/Shadow.module.css");
8
7
 
@@ -74,7 +73,7 @@
74
73
  .sidebar {
75
74
  /* Box */
76
75
  display: flow-root;
77
- border-right: var(--sidebar-layout-border, var(--stroke-normal) solid var(--tint-80));
76
+ border-right: var(--sidebar-layout-border, none);
78
77
 
79
78
  /* Scrolling */
80
79
  overflow-y: auto;
@@ -118,7 +117,7 @@
118
117
  .main.right .sidebar {
119
118
  grid-column: 2;
120
119
  border-right: none;
121
- border-left: var(--sidebar-layout-border, var(--stroke-normal) solid var(--tint-80));
120
+ border-left: var(--sidebar-layout-border, none);
122
121
  }
123
122
 
124
123
  .main.right .content {
package/ui/menu/Menu.md CHANGED
@@ -29,13 +29,13 @@ import { Menu, MenuItem } from "shelving/ui";
29
29
 
30
30
  | Variable | Styles | Default |
31
31
  |---|---|---|
32
- | `--menu-gap` | Vertical gap between items | `var(--space-xxsmall)` |
32
+ | `--menu-gap` | Vertical gap between items | `0` |
33
33
  | `--menu-font` | Font family | `var(--font-body)` |
34
34
  | `--menu-size` | Font size | `var(--size-normal)` |
35
35
  | `--menu-leading` | Line height | `var(--leading)` |
36
36
  | `--menu-color` | Text colour | `var(--tint-00)` |
37
37
  | `--menu-nested-space` | Block margin around a nested submenu | `var(--space-xxsmall)` |
38
- | `--menu-padding` | Item link padding (also insets the nested border) | `var(--space-xxsmall)` |
38
+ | `--menu-padding` | Item link padding (also insets the nested border) | `var(--space-xsmall)` |
39
39
  | `--menu-nested-border` | Nested submenu left-border width | `var(--stroke-focus)` |
40
40
  | `--menu-nested-color-border` | Nested submenu left-border colour | `var(--tint-50)` |
41
41
  | `--menu-nested-indent` | Nested submenu left padding | `var(--space-xsmall)` |
@@ -13,7 +13,7 @@
13
13
  padding: 0;
14
14
  display: flex;
15
15
  flex-direction: column;
16
- gap: var(--menu-gap, var(--space-xxsmall));
16
+ gap: var(--menu-gap, 0);
17
17
 
18
18
  /* Text */
19
19
  font-family: var(--menu-font, var(--font-body));
@@ -26,7 +26,7 @@
26
26
  margin-block: var(--menu-nested-space, var(--space-xxsmall));
27
27
 
28
28
  /* Inset the border by the link's inline padding so it lines up with the parent item's label. */
29
- margin-inline-start: var(--menu-padding, var(--space-xxsmall));
29
+ margin-inline-start: var(--menu-padding, var(--space-xsmall));
30
30
  border-inline-start: var(--menu-nested-border, var(--stroke-focus)) solid var(--menu-nested-color-border, var(--tint-50));
31
31
  padding-inline-start: var(--menu-nested-indent, var(--space-xsmall));
32
32
  }
@@ -37,12 +37,13 @@
37
37
  }
38
38
 
39
39
  .link {
40
- /* Box — `inline-size` and `border` also reset the `<button>` an `onClick` item renders. */
40
+ /* Box — `inline-size` and `border` also reset the `<button>` an `onClick` item renders. `border-box` keeps the padding inside the full width. */
41
41
  display: block;
42
+ box-sizing: border-box;
42
43
  inline-size: 100%;
43
- padding: var(--menu-padding, var(--space-xxsmall));
44
+ padding: var(--menu-padding, var(--space-xsmall));
44
45
  border: none;
45
- border-radius: var(--menu-radius, var(--radius-xxsmall));
46
+ border-radius: var(--menu-radius, var(--radius-xsmall));
46
47
 
47
48
  /* Style — `background`, `font`, `text-align` and `cursor` reset the native button look. */
48
49
  background: none;
@@ -53,11 +54,11 @@
53
54
  cursor: pointer;
54
55
  transition: all 120ms ease-in-out;
55
56
  outline: var(--menu-focus-border, var(--stroke-focus) solid var(--color-focus));
56
- outline-offset: calc(0px - var(--stroke-normal));
57
+ outline-offset: calc(0px - var(--stroke-focus)); /* Fully inset, so a neighbouring item's background can't paint over it. */
57
58
 
58
- /* Pseudo-classes */
59
- &:hover,
60
- &:focus:not(:focus-visible) {
59
+ /* Pseudo-classes — skip the active item, so it keeps its own background while hovered or focused. */
60
+ &:not(.active):hover,
61
+ &:not(.active):focus:not(:focus-visible) {
61
62
  background: var(--menu-hover-background, var(--tint-90));
62
63
  color: var(--menu-hover-color, var(--tint-00));
63
64
  }
@@ -31,18 +31,18 @@ The item link's hooks (defined in `Menu.module.css`):
31
31
 
32
32
  | Variable | Styles | Default |
33
33
  |---|---|---|
34
- | `--menu-padding` | Link inner padding | `var(--space-xxsmall)` |
35
- | `--menu-radius` | Link corner radius | `var(--radius-xxsmall)` |
34
+ | `--menu-padding` | Link inner padding | `var(--space-xsmall)` |
35
+ | `--menu-radius` | Link corner radius | `var(--radius-xsmall)` |
36
36
  | `--menu-focus-border` | Focus outline | `var(--stroke-focus) solid var(--color-focus)` |
37
37
  | `--menu-hover-background` | Link fill on hover/focus | `var(--tint-90)` |
38
38
  | `--menu-hover-color` | Link text colour on hover/focus | `var(--tint-00)` |
39
39
  | `--menu-proud-background` | Fill when proud (ancestor of current page) | `transparent` |
40
40
  | `--menu-proud` | Text colour when proud | `var(--tint-00)` |
41
41
  | `--menu-proud-weight` | Font weight when proud | `var(--weight-strong)` |
42
- | `--menu-active-background` | Fill when active (current page) | `var(--tint-100)` |
42
+ | `--menu-active-background` | Fill when active (current page), also while hovered or focused | `var(--tint-100)` |
43
43
  | `--menu-active-color` | Text colour when active | `var(--tint-00)` |
44
44
  | `--menu-active-weight` | Font weight when active | `var(--weight-strong)` |
45
45
 
46
46
  List-level hooks (`--menu-gap`, `--menu-color`, the nested-submenu hooks, etc.) are documented on `<Menu>`.
47
47
 
48
- **Global tokens it reads** — the tint ladder `--tint-00` / `--tint-90` / `--tint-100`, plus `--space-xxsmall`, `--radius-xxsmall`, `--stroke-focus`, `--stroke-normal`, `--color-focus`, and `--weight-strong`.
48
+ **Global tokens it reads** — the tint ladder `--tint-00` / `--tint-90` / `--tint-100`, plus `--space-xsmall`, `--radius-xsmall`, `--stroke-focus`, `--color-focus`, and `--weight-strong`.
@@ -43,6 +43,6 @@ A theme is a CSS file of custom-property overrides at `:root`, imported after th
43
43
 
44
44
  1. **Move a palette colour.** Overriding `--color-gray` moves the default anchor, retinting every neutral ladder in the app — the broadest possible change. Overriding `--color-red`, `--color-primary`, etc. re-aims every variant and status that maps to it.
45
45
  2. **Retint a region.** Apply `color=` / `status=` to a container — `<Card color="purple">`, or a `<Panel color="purple">` wrapping a whole section — and everything inside re-tints, with text, border, surface, and hover shades all derived for free. Components don't expose a per-component `--x-tint` hook; the variant moves the anchor, not a bespoke variable.
46
- 3. **Override one property.** Per-property hooks are the scalpel: `--button-radius: 999px`, `--card-border: none`, `--tag-case: none`.
46
+ 3. **Override one property.** Per-property hooks are the scalpel: `--button-radius: 999px`, `--card-radius: 0`, `--tag-case: none`.
47
47
 
48
48
  **Don't override individual ladder steps (`--tint-90`, etc.) at `:root`.** The ladder is *recomputed* from the anchor inside every `TINT_CLASS` scope — which includes every component that accepts `color=` or `status=` — so a step override at `:root` only reaches untinted regions and produces inconsistent surfaces. Move the anchor (option 1 or 2) instead, and the steps follow.