shelving 1.323.0 → 1.323.2

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.
@@ -21461,7 +21461,7 @@ A boxed surface that groups a self-contained piece of content. Rendered as an `<
21461
21461
  **Things to know:**
21462
21462
 
21463
21463
  - 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.
21464
- - The overlay comes first in the card and has no `z-index`. Links and buttons inside the card are `position: relative`, so they paint above it and stay clickable. To put your own absolute layer over the card's content, put it after the content, with no `z-index` and no lasting `transform`. A `transform` makes the layer a stacking context, and a `z-index` can make iOS WebKit drop the layer for one frame when a page view transition starts. Only a keyboard-focused overlay gets a `z-index`, so its focus ring shows above the content.
21464
+ - The overlay comes first in the card and has no `z-index`. Links and buttons inside the card are `position: relative`, so they paint above it and stay clickable. The rest of the content has `pointer-events: none`, so a tap on it (even on positioned content) reaches the overlay. Links, buttons and form fields take taps again. To put your own absolute layer over the card's content, put it after the content, with no `z-index` and no lasting `transform`. A `transform` makes the layer a stacking context, and a `z-index` can make iOS WebKit drop the layer for one frame when a page view transition starts. Only a keyboard-focused overlay gets a `z-index`, so its focus ring shows above the content.
21465
21465
  - `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.
21466
21466
  - A card styles only the box. Lay out its contents with the usual block components (`<Subheading>`, `<Paragraph>`, `<Row>`, …).
21467
21467
  - Cards have no drop shadow by default — set `shadow="small"`, `shadow="normal"` or `shadow="large"` to raise a given card.
@@ -32820,6 +32820,7 @@ Renders the global list of active notices and subscribes to incoming `"notice"`
32820
32820
  - Backed by the `NOTICES` store singleton; for advanced use you can keep a reference to a notice to update or close it manually.
32821
32821
  - The list shows in the bottom-right corner. Set `position` to `"top-left"`, `"top-center"`, `"top-right"`, `"bottom-left"`, `"bottom-center"`, or `"bottom-right"` to choose a different place.
32822
32822
  - Notices animate with [view transitions](https://developer.mozilla.org/en-US/docs/Web/API/View_Transition_API). `Notices` renders the store inside transitions, so a notice animates with no `startTransition()` of your own. A single `<Notice>` knows nothing about transitions, the same as `<Dialog>`. A new notice slides in from the side of its corner, and a closed notice slides out to that side. In a centred list, notices slide in and out from the top or bottom edge. The other notices move to their new places. A notice that changes in place (for example from loading to success) changes at once, with no animation.
32823
+ - The list has its own layer in every view transition, so it stays still above a page that slides under it.
32823
32824
  - With reduced motion, notices fade in and out in place, and the others move at once. A browser without view transitions shows the changes at once.
32824
32825
 
32825
32826
  ## Usage
package/docs/ui/Card.md CHANGED
@@ -15,7 +15,7 @@ A boxed surface that groups a self-contained piece of content. Rendered as an `<
15
15
  **Things to know:**
16
16
 
17
17
  - 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.
18
- - The overlay comes first in the card and has no `z-index`. Links and buttons inside the card are `position: relative`, so they paint above it and stay clickable. To put your own absolute layer over the card's content, put it after the content, with no `z-index` and no lasting `transform`. A `transform` makes the layer a stacking context, and a `z-index` can make iOS WebKit drop the layer for one frame when a page view transition starts. Only a keyboard-focused overlay gets a `z-index`, so its focus ring shows above the content.
18
+ - The overlay comes first in the card and has no `z-index`. Links and buttons inside the card are `position: relative`, so they paint above it and stay clickable. The rest of the content has `pointer-events: none`, so a tap on it (even on positioned content) reaches the overlay. Links, buttons and form fields take taps again. To put your own absolute layer over the card's content, put it after the content, with no `z-index` and no lasting `transform`. A `transform` makes the layer a stacking context, and a `z-index` can make iOS WebKit drop the layer for one frame when a page view transition starts. Only a keyboard-focused overlay gets a `z-index`, so its focus ring shows above the content.
19
19
  - `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.
20
20
  - A card styles only the box. Lay out its contents with the usual block components (`<Subheading>`, `<Paragraph>`, `<Row>`, …).
21
21
  - Cards have no drop shadow by default — set `shadow="small"`, `shadow="normal"` or `shadow="large"` to raise a given card.
@@ -18,6 +18,7 @@ Renders the global list of active notices and subscribes to incoming `"notice"`
18
18
  - Backed by the `NOTICES` store singleton; for advanced use you can keep a reference to a notice to update or close it manually.
19
19
  - The list shows in the bottom-right corner. Set `position` to `"top-left"`, `"top-center"`, `"top-right"`, `"bottom-left"`, `"bottom-center"`, or `"bottom-right"` to choose a different place.
20
20
  - Notices animate with [view transitions](https://developer.mozilla.org/en-US/docs/Web/API/View_Transition_API). `Notices` renders the store inside transitions, so a notice animates with no `startTransition()` of your own. A single `<Notice>` knows nothing about transitions, the same as `<Dialog>`. A new notice slides in from the side of its corner, and a closed notice slides out to that side. In a centred list, notices slide in and out from the top or bottom edge. The other notices move to their new places. A notice that changes in place (for example from loading to success) changes at once, with no animation.
21
+ - The list has its own layer in every view transition, so it stays still above a page that slides under it.
21
22
  - With reduced motion, notices fade in and out in place, and the others move at once. A browser without view transitions shows the changes at once.
22
23
 
23
24
  ## Usage
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shelving",
3
- "version": "1.323.0",
3
+ "version": "1.323.2",
4
4
  "author": "Dave Houlbrooke <dave@shax.com>",
5
5
  "repository": {
6
6
  "type": "git",
package/ui/block/Card.js CHANGED
@@ -19,5 +19,5 @@ import CARD_CSS from "./Card.module.css";
19
19
  export function Card({ as: Element = "article", children, href, onClick, title = "Open", className, ...props }) {
20
20
  const overlay = (href || onClick) && (_jsx(Clickable, { title: title, href: href, onClick: onClick, ...props, className: getModuleClass(CARD_CSS, "overlay") }));
21
21
  return (_jsxs(Element, { className: getClass(getModuleClass(CARD_CSS, "card"), //
22
- getStatusClass(props), getBlockClass(props), getShadowClass(props), className), children: [overlay, overlay ? _jsx("div", { children: children }) : children] }));
22
+ getStatusClass(props), getBlockClass(props), getShadowClass(props), className), children: [overlay, overlay ? _jsx("div", { className: getModuleClass(CARD_CSS, "content"), children: children }) : children] }));
23
23
  }
package/ui/block/Card.md CHANGED
@@ -5,7 +5,7 @@ A boxed surface that groups a self-contained piece of content. Rendered as an `<
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
- - The overlay comes first in the card and has no `z-index`. Links and buttons inside the card are `position: relative`, so they paint above it and stay clickable. To put your own absolute layer over the card's content, put it after the content, with no `z-index` and no lasting `transform`. A `transform` makes the layer a stacking context, and a `z-index` can make iOS WebKit drop the layer for one frame when a page view transition starts. Only a keyboard-focused overlay gets a `z-index`, so its focus ring shows above the content.
8
+ - The overlay comes first in the card and has no `z-index`. Links and buttons inside the card are `position: relative`, so they paint above it and stay clickable. The rest of the content has `pointer-events: none`, so a tap on it (even on positioned content) reaches the overlay. Links, buttons and form fields take taps again. To put your own absolute layer over the card's content, put it after the content, with no `z-index` and no lasting `transform`. A `transform` makes the layer a stacking context, and a `z-index` can make iOS WebKit drop the layer for one frame when a page view transition starts. Only a keyboard-focused overlay gets a `z-index`, so its focus ring shows above the content.
9
9
  - `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.
10
10
  - A card styles only the box. Lay out its contents with the usual block components (`<Subheading>`, `<Paragraph>`, `<Row>`, …).
11
11
  - Cards have no drop shadow by default — set `shadow="small"`, `shadow="normal"` or `shadow="large"` to raise a given card.
@@ -15,6 +15,24 @@
15
15
  position: relative;
16
16
  }
17
17
  }
18
+
19
+ /* The content of a clickable card lets taps through to the overlay under it, so a tap anywhere on the card opens it.
20
+ * Positioned content (for example a list with `position: relative`) paints above the overlay, so without this it
21
+ * would catch the tap. Links, buttons and form fields take taps again. */
22
+ .content {
23
+ pointer-events: none;
24
+
25
+ a:any-link,
26
+ button:enabled,
27
+ input,
28
+ select,
29
+ textarea,
30
+ label,
31
+ summary,
32
+ [tabindex]:not([tabindex="-1"]) {
33
+ pointer-events: auto;
34
+ }
35
+ }
18
36
  }
19
37
 
20
38
  @layer components {
package/ui/block/Card.tsx CHANGED
@@ -47,7 +47,7 @@ export function Card({ as: Element = "article", children, href, onClick, title =
47
47
  )}
48
48
  >
49
49
  {overlay}
50
- {overlay ? <div>{children}</div> : children}
50
+ {overlay ? <div className={getModuleClass(CARD_CSS, "content")}>{children}</div> : children}
51
51
  </Element>
52
52
  );
53
53
  }
@@ -9,6 +9,7 @@ Renders the global list of active notices and subscribes to incoming `"notice"`
9
9
  - Backed by the `NOTICES` store singleton; for advanced use you can keep a reference to a notice to update or close it manually.
10
10
  - The list shows in the bottom-right corner. Set `position` to `"top-left"`, `"top-center"`, `"top-right"`, `"bottom-left"`, `"bottom-center"`, or `"bottom-right"` to choose a different place.
11
11
  - Notices animate with [view transitions](https://developer.mozilla.org/en-US/docs/Web/API/View_Transition_API). `Notices` renders the store inside transitions, so a notice animates with no `startTransition()` of your own. A single `<Notice>` knows nothing about transitions, the same as `<Dialog>`. A new notice slides in from the side of its corner, and a closed notice slides out to that side. In a centred list, notices slide in and out from the top or bottom edge. The other notices move to their new places. A notice that changes in place (for example from loading to success) changes at once, with no animation.
12
+ - The list has its own layer in every view transition, so it stays still above a page that slides under it.
12
13
  - With reduced motion, notices fade in and out in place, and the others move at once. A browser without view transitions shows the changes at once.
13
14
 
14
15
  ## Usage
@@ -17,6 +17,9 @@
17
17
  /* The list is as wide as `--notices-width`, so let clicks pass through the gaps to the page. */
18
18
  pointer-events: none;
19
19
 
20
+ /* Take a separate layer in any view transition, so a page that slides under the list does not cover it. `match-element` gives each list a unique name. */
21
+ view-transition-name: match-element;
22
+
20
23
  /* Each notice is only as wide as its content, and stays on the side of the list's corner, or in the centre. */
21
24
  & > * {
22
25
  inline-size: auto;