shelving 1.323.0 → 1.323.1

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.
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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shelving",
3
- "version": "1.323.0",
3
+ "version": "1.323.1",
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
  }