@slotted/react 0.1.0-beta.16 → 0.1.0-beta.17

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.
Files changed (48) hide show
  1. package/dist/dashboard-grid-z3nKqvN8.js +1149 -0
  2. package/dist/dashboard-grid.js +1 -1
  3. package/dist/{detail-panel-BNfYQJfv.js → detail-panel-DYe_D46K.js} +2 -2
  4. package/dist/detail-panel.js +1 -1
  5. package/dist/docs/dashboard-grid.json +5 -5
  6. package/dist/docs/dashboard-grid.md +4 -4
  7. package/dist/docs/guidelines/index.md +2 -0
  8. package/dist/docs/guidelines/layout-alignment.md +2 -2
  9. package/dist/docs/guidelines/overviews.md +21 -1
  10. package/dist/docs/page.json +2 -2
  11. package/dist/docs/page.md +1 -1
  12. package/dist/docs/skills/compose-screen/SKILL.md +10 -1
  13. package/dist/docs/skills/review-screen/SKILL.md +22 -20
  14. package/dist/docs/stat-card.json +7 -4
  15. package/dist/docs/stat-card.md +4 -4
  16. package/dist/index.js +61 -61
  17. package/dist/{page-CwYmBoZQ.js → page-CzqbnTnU.js} +56 -56
  18. package/dist/{page-header-BgYXPEbd.js → page-header-TejJ-BTC.js} +1 -1
  19. package/dist/page-header.js +1 -1
  20. package/dist/page.js +2 -2
  21. package/dist/stat-card-Dv9oJAbF.js +252 -0
  22. package/dist/stat-card.js +1 -1
  23. package/dist/styles/dashboard-grid.css +1 -1
  24. package/dist/styles/index.css +2 -2
  25. package/dist/styles/stat-card.css +3 -1
  26. package/dist/styles.css +1 -1
  27. package/dist/types/chart/chart.d.ts +2 -2
  28. package/dist/types/chart/chart.d.ts.map +1 -1
  29. package/dist/types/chart/chart.types.d.ts +10 -6
  30. package/dist/types/chart/chart.types.d.ts.map +1 -1
  31. package/dist/types/dashboard-grid/dashboard-grid-context.d.ts +14 -1
  32. package/dist/types/dashboard-grid/dashboard-grid-context.d.ts.map +1 -1
  33. package/dist/types/dashboard-grid/dashboard-grid.d.ts.map +1 -1
  34. package/dist/types/dashboard-grid/dashboard-grid.types.d.ts +6 -2
  35. package/dist/types/dashboard-grid/dashboard-grid.types.d.ts.map +1 -1
  36. package/dist/types/dashboard-grid/dashboard-widget.d.ts +1 -1
  37. package/dist/types/dashboard-grid/dashboard-widget.d.ts.map +1 -1
  38. package/dist/types/dashboard-grid/use-persisted-dashboard-layout.d.ts +2 -1
  39. package/dist/types/dashboard-grid/use-persisted-dashboard-layout.d.ts.map +1 -1
  40. package/dist/types/page/index.d.ts +1 -1
  41. package/dist/types/page/index.d.ts.map +1 -1
  42. package/dist/types/page/page.d.ts +6 -0
  43. package/dist/types/page/page.d.ts.map +1 -1
  44. package/dist/types/stat-card/stat-card-parts.d.ts +7 -3
  45. package/dist/types/stat-card/stat-card-parts.d.ts.map +1 -1
  46. package/package.json +6 -6
  47. package/dist/dashboard-grid-ByThIV_n.js +0 -1066
  48. package/dist/stat-card-CUISfM36.js +0 -247
@@ -1,2 +1,2 @@
1
- import { a as e, i as t, n, o as r, r as i, t as a } from "./dashboard-grid-ByThIV_n.js";
1
+ import { a as e, i as t, n, o as r, r as i, t as a } from "./dashboard-grid-z3nKqvN8.js";
2
2
  export { t as DASHBOARD_GRID_FALLBACK, i as DashboardGrid, e as DashboardGridDefaultsProvider, n as DashboardWidget, r as useDashboardGridDefaults, a as usePersistedDashboardLayout };
@@ -2,8 +2,8 @@ import { r as e } from "./i18n-D7xXDd8-.js";
2
2
  import { n as t } from "./badge-pgYVOnZO.js";
3
3
  import { t as n } from "./skeleton-DeEOmm1y.js";
4
4
  import { n as r } from "./container-WoYiHo50.js";
5
- import { a as i } from "./page-CwYmBoZQ.js";
6
- import { w as a } from "./page-header-BgYXPEbd.js";
5
+ import { o as i } from "./page-CzqbnTnU.js";
6
+ import { w as a } from "./page-header-TejJ-BTC.js";
7
7
  import { a as o, c as s, n as c, o as l, s as u, t as d, u as f } from "./section-CjlMOyZE.js";
8
8
  import { a as p, n as m, o as h, r as g, t as _ } from "./tabs-C-Bc7WmQ.js";
9
9
  import { keyedProps as v } from "@slotted/core/selector-key";
@@ -1,2 +1,2 @@
1
- import { a as e, i as t, n, o as r, r as i, s as a, t as o } from "./detail-panel-BNfYQJfv.js";
1
+ import { a as e, i as t, n, o as r, r as i, s as a, t as o } from "./detail-panel-DYe_D46K.js";
2
2
  export { t as DetailPanel, o as DetailPanelBody, r as DetailPanelDefaultsProvider, n as DetailPanelSection, i as DetailPanelTabs, e as useDetailPanel, a as useDetailPanelDefaults };
@@ -241,7 +241,7 @@
241
241
  "type": "DashboardLayout",
242
242
  "defaultValue": "[]",
243
243
  "appliesTo": "DashboardGrid",
244
- "description": "The uncontrolled start, read once. A widget it does not name takes the first cell it fits, in the order of the children"
244
+ "description": "The uncontrolled start, read once, and what Reset asks for, controlled or not. A widget it does not name takes the first cell it fits, in the order of the children"
245
245
  },
246
246
  {
247
247
  "name": "editing",
@@ -318,7 +318,7 @@
318
318
  "type": "string",
319
319
  "defaultValue": "—",
320
320
  "appliesTo": "DashboardWidget",
321
- "description": "The widget’s key in the layout. Required"
321
+ "description": "The widget’s key in the layout. Required. Read from the grid’s child, inside a fragment too; a widget a component of the application renders declares it once mounted, so it is placed after the first paint"
322
322
  },
323
323
  {
324
324
  "name": "title",
@@ -353,7 +353,7 @@
353
353
  "type": "'auto'",
354
354
  "defaultValue": "—",
355
355
  "appliesTo": "DashboardWidget",
356
- "description": "Draws the widget as many rows as its content measures, within minRows and maxRows, and moves the widgets below; the stored rows, which a resize sets, stay the minimum"
356
+ "description": "Draws the widget as tall as its content, to a twelfth of a row’s step, and the widgets below rise or make room; at least one sub-row, or minRows when stated, at most maxRows. Moves and resizes read the content’s rows, rounded up"
357
357
  },
358
358
  {
359
359
  "name": "minColumns",
@@ -497,10 +497,10 @@
497
497
  },
498
498
  {
499
499
  "name": "usePersistedDashboardLayout",
500
- "type": "({ key, storage?, defaultLayout? }) => { layout, onLayoutChange, clear }",
500
+ "type": "({ key, storage?, defaultLayout? }) => { layout, defaultLayout, onLayoutChange, clear }",
501
501
  "defaultValue": "localStorage",
502
502
  "appliesTo": "a component",
503
- "description": "Reads the stored layout once and writes every change; a store that throws reads as empty"
503
+ "description": "Reads the stored layout once and writes every change; a store that throws reads as empty. Spread on the grid, its defaultLayout is what Reset asks for"
504
504
  }
505
505
  ],
506
506
  "composition": [],
@@ -70,7 +70,7 @@ const [editing, setEditing] = useState(false);
70
70
  | Name | Type | Default | Applies to | Description |
71
71
  | --- | --- | --- | --- | --- |
72
72
  | `layout` | `DashboardLayout` | — | DashboardGrid | Where each widget stands and how big it is: [{ key, x, y, w, h, hidden? }] in cells of the expanded class. Present means controlled |
73
- | `defaultLayout` | `DashboardLayout` | [] | DashboardGrid | The uncontrolled start, read once. A widget it does not name takes the first cell it fits, in the order of the children |
73
+ | `defaultLayout` | `DashboardLayout` | [] | DashboardGrid | The uncontrolled start, read once, and what Reset asks for, controlled or not. A widget it does not name takes the first cell it fits, in the order of the children |
74
74
  | `editing` | `boolean` | false | DashboardGrid | The edit mode. Present means controlled |
75
75
  | `defaultEditing` | `boolean` | false | DashboardGrid | The uncontrolled mode, read once |
76
76
  | `columns` | `number \| { expanded, medium, compact }` | 12 | DashboardGrid, DashboardGridDefaultsProvider | Columns from 1024 pixels of the grid’s width; below it the widgets flow in halves and wholes of half as many, and below 600 in one column |
@@ -81,12 +81,12 @@ const [editing, setEditing] = useState(false);
81
81
  | `ref` | `Ref<DashboardGridHandle>` | — | DashboardGrid | element, focusWidget(key), commitEditing(), cancelEditing() |
82
82
  | `render` | `(props: DashboardGridRootProps) => ReactElement` | a div | DashboardGrid | Substitutes the root element |
83
83
  | `native props` | `ComponentPropsWithRef<"div">` | — | DashboardGrid | id, className, style, data-* and handlers reach the root; aria-label and aria-labelledby name the list |
84
- | `value` | `string` | — | DashboardWidget | The widget’s key in the layout. Required |
84
+ | `value` | `string` | — | DashboardWidget | The widget’s key in the layout. Required. Read from the grid’s child, inside a fragment too; a widget a component of the application renders declares it once mounted, so it is placed after the first paint |
85
85
  | `title` | `string` | — | DashboardWidget | The heading, the article’s name, the handle’s name and the entry in Add widget. Required |
86
86
  | `description` | `ReactNode` | — | DashboardWidget | The line under the title |
87
87
  | `defaultColumns` | `number` | 4 | DashboardWidget | Expanded columns of a widget the layout does not name |
88
88
  | `defaultRows` | `number` | 2 | DashboardWidget | Rows of a widget the layout does not name |
89
- | `rows` | `'auto'` | — | DashboardWidget | Draws the widget as many rows as its content measures, within minRows and maxRows, and moves the widgets below; the stored rows, which a resize sets, stay the minimum |
89
+ | `rows` | `'auto'` | — | DashboardWidget | Draws the widget as tall as its content, to a twelfth of a row’s step, and the widgets below rise or make room; at least one sub-row, or minRows when stated, at most maxRows. Moves and resizes read the content’s rows, rounded up |
90
90
  | `minColumns` | `number` | 2 | DashboardWidget | The fewest expanded columns a resize leaves |
91
91
  | `maxColumns` | `number` | columns | DashboardWidget | The most expanded columns a resize gives |
92
92
  | `minRows` | `number` | 2 | DashboardWidget | The fewest rows a resize leaves |
@@ -107,7 +107,7 @@ const [editing, setEditing] = useState(false);
107
107
  | `fill / size` | `CardFill / CardSize` | outline / md | DashboardWidget | The card’s own axes |
108
108
  | `render` | `(props: DashboardWidgetRootProps) => ReactElement` | an li | DashboardWidget | Substitutes the li; keep props.ref, the grid measures against it |
109
109
  | `DashboardGridDefaultsProvider` | `{ columns, editBar, headingLevel }` | — | a subtree | The decisions an application takes once; an instance that states any of them wins. The words come from the language in force (SlottedProvider) |
110
- | `usePersistedDashboardLayout` | `({ key, storage?, defaultLayout? }) => { layout, onLayoutChange, clear }` | localStorage | a component | Reads the stored layout once and writes every change; a store that throws reads as empty |
110
+ | `usePersistedDashboardLayout` | `({ key, storage?, defaultLayout? }) => { layout, defaultLayout, onLayoutChange, clear }` | localStorage | a component | Reads the stored layout once and writes every change; a store that throws reads as empty. Spread on the grid, its defaultLayout is what Reset asks for |
111
111
 
112
112
  ## Events
113
113
 
@@ -86,6 +86,8 @@ Every active rule, one line each. Load this first; load a topic file when the ta
86
86
  | OV-04 | SHOULD | The thresholds are stated once in words beside the figures, and a figure past one says so in its own comparison line, on the line the placeholder reserves. | `overviews.md` |
87
87
  | OV-05 | SHOULD | A chart takes the `card` `variant` when it is one of two or more peer tiles in one grid with no section heading of its own, and stays `plain` when it is the body of a titled section or the only content of a tab. | `overviews.md` |
88
88
  | OV-06 | SHOULD | The cards of one row carry a label of at most three words, the figure, and the same optional parts on every card — a comparison of one line on each, or on none. | `overviews.md` |
89
+ | OV-07 | SHOULD | The overview is one `dashboard-grid` whose blocks are each one of its widgets, and each headline figure is a widget of its own whose title is the figure's label. | `overviews.md` |
90
+ | OV-08 | SHOULD | A `stat-card` inside a framed region takes the `plain` `fill` and a `chart` takes the `plain` `variant`; a frame inside a frame is a finding. | `overviews.md` |
89
91
  | OE-01 | MUST | An element of the application's own reads only tokens of the groups `../tokens.md` lists for the application. | `own-elements.md` |
90
92
  | OE-02 | MUST | Where two states hold at once, the element paints the ground, the edge and the text colour of the stronger, in the order `disabled`, `loading`, `readonly`, `invalid`, `checked`, `selected`, `pressed`, `current`, `complete`, `active`, `hover`; the focus ring of OE-03 is drawn over every state. | `own-elements.md` |
91
93
  | OE-03 | MUST | In its `focus-visible` state the element draws an outline of `--slotted-focus-ring-width` in `--slotted-focus-ring-color`, offset by `--slotted-focus-ring-offset`. | `own-elements.md` |
@@ -90,8 +90,8 @@ Level: MUST
90
90
  Applies to: an element a screen makes `position: sticky` inside a page — a preview beside a form, a summary beside a list, a column's own header
91
91
  Rule: The element's offset starts at the page's published `--slotted-page-sticky-top`, the measured height of the chrome that stays (the stuck page-header's title area, a sticky section's header), and an element that may be taller than what stays visible caps its height by the same property and scrolls inside.
92
92
  Why: An offset from the scroller's edge alone — `inset-block-start: var(--slotted-space-4)` — sticks the element behind the stuck header, which is painted above it: its top is hidden for as long as it is stuck.
93
- Do: Write `inset-block-start: calc(var(--slotted-page-sticky-top, 0px) + <gap>)` and, when the element can outgrow the view, `max-block-size: calc(100dvh - var(--slotted-page-sticky-top, 0px) - <room for the app's own bars>)` with `overflow: auto`.
94
- Don't: Measure the header in the screen's own code, or hard-code its height: the header collapses, wraps and changes with the density, and the page already measures it.
93
+ Do: Write `inset-block-start: calc(var(--slotted-page-sticky-top, 0px) + <gap>)` and, when the element can outgrow the view, `max-block-size: calc(var(--slotted-page-scrollport-block-size, 100dvh) - var(--slotted-page-sticky-top, 0px) - var(--slotted-page-sticky-bottom, 0px) - 2 * <gap>)` with `overflow: auto`: the page publishes the scroller's own height, which an inset application frame makes shorter than the viewport.
94
+ Don't: Measure the header or the scroller in the screen's own code, hard-code the header's height, or cap the element by the viewport's height, which overshoots a scroller the application frame insets: the header collapses, wraps and changes with the density, and the page already measures both.
95
95
  Check: Scroll the page until the header sticks, at two scroll positions: the sticky element's top stands at or below the bottom of the stuck header's title area each time.
96
96
 
97
97
  ### LA-07 · A page footer's action-bar holds one row on a phone
@@ -3,7 +3,7 @@ topic: overviews
3
3
  prefix: OV
4
4
  triggers:
5
5
  [overview, dashboard, flagship, figure, stat card, exception, summary, chart, door, phone, narrow]
6
- families: [stat-card, chart, list, list-item, table, section, grid]
6
+ families: [stat-card, chart, list, list-item, table, section, grid, dashboard-grid, card]
7
7
  ---
8
8
 
9
9
  # Overviews
@@ -74,3 +74,23 @@ Why: One card with a long label and a wrapping comparison beside three cards wit
74
74
  Do: Give every card a short label, its figure and one comparison line; detail that only one card has goes into its comparison or a tooltip.
75
75
  Don't: Lengthen one card's label to carry its detail, or give one card of the row a part the others lack.
76
76
  Check: In every row of `stat-card`s, every label has three words or fewer, and either every card has a comparison or none does.
77
+
78
+ ### OV-07 · An arranged overview is a dashboard-grid
79
+
80
+ Level: SHOULD
81
+ Applies to: an overview whose blocks the reader moves, resizes or hides
82
+ Rule: The overview is one `dashboard-grid` whose blocks are each one of its widgets, and each headline figure is a widget of its own whose title is the figure's label.
83
+ Why: A grid of the application's own with its own menu for hiding blocks repeats the editing, the keyboard moves, the persistence and the Add widget menu the family already draws.
84
+ Do: Give each widget a `value` and a `title`, and let the `auto` `rows` size a figure's widget to its content; persist the layout with the family's own persistence.
85
+ Don't: Build a `grid` of sections with a menu of the application's own that hides or orders them, or put several figures inside one widget.
86
+ Check: Find every control of the overview that hides, moves or resizes a block: each is the `dashboard-grid`'s own.
87
+
88
+ ### OV-08 · Inside a frame, a figure is plain
89
+
90
+ Level: SHOULD
91
+ Applies to: `stat-card` and `chart` inside a framed region — a widget of the `dashboard-grid`, a `section` with the `surface` `ground`, a `card`
92
+ Rule: A `stat-card` inside a framed region takes the `plain` `fill` and a `chart` takes the `plain` `variant`; a frame inside a frame is a finding.
93
+ Why: The region's frame already separates the figure from its neighbours, and a second frame inside it draws a card within a card whose inner edge sits one inset from the outer.
94
+ Do: Let the region's title name the figure, as a widget's title does, and keep the figure's own header for a status or an action.
95
+ Don't: Leave a `stat-card` at its default `outline` fill, or a `chart` at the `card` `variant`, inside a widget, a surface section or a card.
96
+ Check: For each `stat-card` and `chart`, name the frame around it: inside a widget, a surface section or a card, its fill or variant is `plain`.
@@ -208,11 +208,11 @@
208
208
  "description": "The five decisions an application takes once. A page that states any of them itself still wins"
209
209
  },
210
210
  {
211
- "name": "--slotted-page-sticky-top, --slotted-page-sticky-bottom",
211
+ "name": "--slotted-page-sticky-top, --slotted-page-sticky-bottom, --slotted-page-scrollport-block-size",
212
212
  "type": "runtime properties on the scroller",
213
213
  "defaultValue": "—",
214
214
  "appliesTo": "every family under the page, and the consumer’s own sticky elements inside it",
215
- "description": "The height of the chrome that stays at the top, written by the header, and of the footer, written by the page. A section’s sticky header reads the first; a table with stickyTo=\"page\" reads both through the bridge the page writes on its root. A consumer’s own position: sticky element reads the first as well: inset-block-start: calc(var(--slotted-page-sticky-top, 0px) + gap) stops it under the chrome instead of behind the stuck header, and max-block-size: calc(100dvh - var(--slotted-page-sticky-top, 0px) - gap) bounds one that may be taller than the viewport"
215
+ "description": "The height of the chrome that stays at the top, written by the header, of the footer, and of the scroller itself, written by the page. A section’s sticky header reads the first; a table with stickyTo=\"page\" reads both through the bridge the page writes on its root. A consumer’s own position: sticky element reads the first as well: inset-block-start: calc(var(--slotted-page-sticky-top, 0px) + gap) stops it under the chrome instead of behind the stuck header, and max-block-size: calc(var(--slotted-page-scrollport-block-size, 100dvh) - var(--slotted-page-sticky-top, 0px) - var(--slotted-page-sticky-bottom, 0px) - 2 * gap) bounds one that may be taller than the scroller. The third is the scroller’s visible height, written by the page; under an inset canvas the scroller is shorter than the viewport"
216
216
  }
217
217
  ],
218
218
  "events": [],
package/dist/docs/page.md CHANGED
@@ -47,7 +47,7 @@ Excerpt — not a complete module
47
47
  | `ref` | `Ref<HTMLElement>` | — | Page, PageBody, PageFooter | Reaches the element itself. Under scroll="self" the scroller is the scroll part inside it: root.querySelector("[data-part=scroll]") |
48
48
  | `usePage()` | `() => PageContextValue \| undefined` | — | inside Page | What the header and the footer read: width, inset, scroll, ground, loading and the translator t. Undefined outside a page, so a header standing alone is complete |
49
49
  | `PageDefaultsProvider` | `{ width, inset, scroll, ground, landmark }` | — | a subtree | The five decisions an application takes once. A page that states any of them itself still wins |
50
- | `--slotted-page-sticky-top, --slotted-page-sticky-bottom` | `runtime properties on the scroller` | — | every family under the page, and the consumer’s own sticky elements inside it | The height of the chrome that stays at the top, written by the header, and of the footer, written by the page. A section’s sticky header reads the first; a table with stickyTo="page" reads both through the bridge the page writes on its root. A consumer’s own position: sticky element reads the first as well: inset-block-start: calc(var(--slotted-page-sticky-top, 0px) + gap) stops it under the chrome instead of behind the stuck header, and max-block-size: calc(100dvh - var(--slotted-page-sticky-top, 0px) - gap) bounds one that may be taller than the viewport |
50
+ | `--slotted-page-sticky-top, --slotted-page-sticky-bottom, --slotted-page-scrollport-block-size` | `runtime properties on the scroller` | — | every family under the page, and the consumer’s own sticky elements inside it | The height of the chrome that stays at the top, written by the header, of the footer, and of the scroller itself, written by the page. A section’s sticky header reads the first; a table with stickyTo="page" reads both through the bridge the page writes on its root. A consumer’s own position: sticky element reads the first as well: inset-block-start: calc(var(--slotted-page-sticky-top, 0px) + gap) stops it under the chrome instead of behind the stuck header, and max-block-size: calc(var(--slotted-page-scrollport-block-size, 100dvh) - var(--slotted-page-sticky-top, 0px) - var(--slotted-page-sticky-bottom, 0px) - 2 * gap) bounds one that may be taller than the scroller. The third is the scroller’s visible height, written by the page; under an inset canvas the scroller is shorter than the viewport |
51
51
 
52
52
  ## Axes and defaults
53
53
 
@@ -41,7 +41,9 @@ topics.
41
41
  1. `../../guidelines/index.md`.
42
42
  2. `../../guidelines/composition.md`, always.
43
43
  3. The topic of step 2. Add `layout-alignment.md` and `shell-composition.md`
44
- when the screen places controls in a row or in the application frame.
44
+ when the screen places controls in a row, makes an element of its own
45
+ `position: sticky` (a summary or a preview beside a form or a list), or
46
+ works in the application frame.
45
47
  4. Add `errors-and-conflicts.md` and `reading-permissions.md` when the screen
46
48
  writes data or reads under a role.
47
49
  5. When the screen writes an element of its own, follow
@@ -74,6 +76,10 @@ element stands in that slot.
74
76
  useDeferredValue or startTransition) (CP-09). A list longer than a hundred
75
77
  rows is a `data-grid`, which windows its rows where it has a height of its
76
78
  own and is served in pages below 600 pixels (LP-12, LP-14). Its columns, its disabled keys and a function row key are module constants or memoised: a new one on a render of the screen renders every mounted row again. Its renderers, its messages and its tree may be written inline.
79
+ - An element of the screen's own made `position: sticky` stops under the
80
+ page's chrome: its offset starts at `--slotted-page-sticky-top`, and its
81
+ height cap subtracts it (LA-06). An offset from the scroller's edge alone
82
+ sticks it behind the stuck header.
77
83
  - Where no anatomy answers the problem, the screen writes an element of its
78
84
  own instead of bending a family into a shape it does not have (CP-04). That
79
85
  element is built with `../../skills/build-own-element/SKILL.md`.
@@ -101,3 +107,6 @@ Every region filled by a request and every control that starts one follow
101
107
  against the task, and the reason is written beside it.
102
108
  6. At 360 pixels with a coarse pointer, the header's actions and the footer's
103
109
  actions each occupy one row (LA-03, LA-07).
110
+ 7. Each element of the screen's own made sticky: scroll until the page header
111
+ sticks, at two positions; its top stands at or below the header's title
112
+ area (LA-06 Check).
@@ -32,26 +32,28 @@ A review answers one question per rule read: does the screen pass the rule's
32
32
 
33
33
  Each search below finds a defect without running the screen.
34
34
 
35
- | Search the screen's files for | Defect | Rule |
36
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------- | ------------ |
37
- | A colour literal (hex, rgb, hsl, oklch), a length in pixels or rem other than zero, or a font size, in the screen's CSS | a value the theme has a token for | CP-05, OE-01 |
38
- | A rule of the application's CSS that sets colour, border, radius, padding or type on a family's `data-ui` or `data-part` | the screen restyles a family instead of setting its axes | OE-08 |
39
- | A control that starts a request and is not in its `loading` state until the answer, except a Refresh of the whole page | a control that fires twice | AF-03 |
40
- | A Refresh of the whole page drawing a spinner on its button, or a refetch of data on screen with no `page-header` progress bar | a wait in the wrong place, and no wait shown for the page | AF-07 |
41
- | An empty state drawn from the initial value of the data, before the first answer | a wait shown as nothing | AF-01 |
42
- | A spinner standing in a region that has no items yet | placeholders missing | AF-02 |
43
- | Siblings of the page's own spaced by margins, or text with a font size of its own | layout outside the primitives | CP-02 |
44
- | A grid or flex track around a family that scrolls, with no zero minimum | the page scrolls, not the family | CP-03 |
45
- | A badge, a tag or a colour beside a family that already draws the same state | a state stated twice | CP-06 |
46
- | An element of the screen's own that takes focus with no ring in its `focus-visible` state | focus not drawn | OE-03 |
47
- | A `data-grid` or `table` with no `variant` on a page whose `width` is not `bleed` | a grid with no frame on the page's surface | LP-15 |
48
- | A list page's `page-header` with a heading and no subheading, no figures and no solid primary action | a header that does not say what the list covers | LP-16 |
49
- | A grid whose column state unpins its `actions` column | the row's actions leave the frame | LP-17 |
50
- | A row of `stat-card`s where a label has more than three words, or one card has a comparison the others lack | a row of cards with no shared structure | OV-06 |
51
- | Two destinations of the navigation whose `page`s state different `width`s | the column's edges move between destinations | CP-10 |
52
- | A write whose success handler refreshes only the region of the control that wrote | figures elsewhere stay stale after the write | AF-08 |
53
- | Two or more actions in a `page-header`'s `actions` outside a `toolbar` that folds into its menu, or toolbar items with no counterpart beside the primary one | a header whose actions wrap on a phone | LA-03 |
54
- | A footer `action-bar` of three or more actions with no overflow control, or a secondary action with no counterpart | a footer that stacks into a column on a phone | LA-07 |
35
+ | Search the screen's files for | Defect | Rule |
36
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------- | ------------ |
37
+ | A colour literal (hex, rgb, hsl, oklch), a length in pixels or rem other than zero, or a font size, in the screen's CSS | a value the theme has a token for | CP-05, OE-01 |
38
+ | A rule of the application's CSS that sets colour, border, radius, padding or type on a family's `data-ui` or `data-part` | the screen restyles a family instead of setting its axes | OE-08 |
39
+ | A control that starts a request and is not in its `loading` state until the answer, except a Refresh of the whole page | a control that fires twice | AF-03 |
40
+ | A Refresh of the whole page drawing a spinner on its button, or a refetch of data on screen with no `page-header` progress bar | a wait in the wrong place, and no wait shown for the page | AF-07 |
41
+ | An empty state drawn from the initial value of the data, before the first answer | a wait shown as nothing | AF-01 |
42
+ | A spinner standing in a region that has no items yet | placeholders missing | AF-02 |
43
+ | Siblings of the page's own spaced by margins, or text with a font size of its own | layout outside the primitives | CP-02 |
44
+ | A grid or flex track around a family that scrolls, with no zero minimum | the page scrolls, not the family | CP-03 |
45
+ | A badge, a tag or a colour beside a family that already draws the same state | a state stated twice | CP-06 |
46
+ | An element of the screen's own that takes focus with no ring in its `focus-visible` state | focus not drawn | OE-03 |
47
+ | A `data-grid` or `table` with no `variant` on a page whose `width` is not `bleed` | a grid with no frame on the page's surface | LP-15 |
48
+ | A list page's `page-header` with a heading and no subheading, no figures and no solid primary action | a header that does not say what the list covers | LP-16 |
49
+ | A grid whose column state unpins its `actions` column | the row's actions leave the frame | LP-17 |
50
+ | A row of `stat-card`s where a label has more than three words, or one card has a comparison the others lack | a row of cards with no shared structure | OV-06 |
51
+ | A `stat-card` without the `plain` `fill`, or a `chart` with the `card` `variant`, inside a widget of the `dashboard-grid`, a `section` with the `surface` `ground` or a `card` | a frame inside a frame | OV-08 |
52
+ | A menu, a toggle or a state of the application's own that hides, orders or resizes the blocks of an overview | an arranged overview built outside `dashboard-grid` | OV-07 |
53
+ | Two destinations of the navigation whose `page`s state different `width`s | the column's edges move between destinations | CP-10 |
54
+ | A write whose success handler refreshes only the region of the control that wrote | figures elsewhere stay stale after the write | AF-08 |
55
+ | Two or more actions in a `page-header`'s `actions` outside a `toolbar` that folds into its menu, or toolbar items with no counterpart beside the primary one | a header whose actions wrap on a phone | LA-03 |
56
+ | A footer `action-bar` of three or more actions with no overflow control, or a secondary action with no counterpart | a footer that stacks into a column on a phone | LA-07 |
55
57
 
56
58
  A rule whose `Check` needs the screen running — a size class, a throttled
57
59
  network, the accessibility tree — is run when the environment can run it, and
@@ -176,7 +176,7 @@
176
176
  "part": "trend",
177
177
  "element": "div",
178
178
  "required": false,
179
- "purpose": "Where a Sparkline goes: beside the figure, or under it when stacked or under 220 pixels. Hands the sparkline the card’s tone and ground; a block placeholder while loading; hidden under forty pixels."
179
+ "purpose": "Where a Sparkline goes: beside the figure, or under it when stacked or under 220 pixels. Hands the sparkline the card’s tone, ground and box, and draws a line smoothed and washed unless the application or the sparkline says otherwise; a block placeholder in the same box while loading; hidden under forty pixels."
180
180
  },
181
181
  {
182
182
  "part": "message",
@@ -305,7 +305,7 @@
305
305
  "type": "children",
306
306
  "defaultValue": "—",
307
307
  "appliesTo": "StatCard",
308
- "description": "Takes a Sparkline and hands it the card’s tone through --slotted-sparkline-color and its ground for the marker’s ring; a tone or series on the sparkline still wins"
308
+ "description": "Takes a Sparkline and hands it the card’s tone through --slotted-sparkline-color, its ground for the marker’s ring, and curve=\"monotone\" with area unless sparkline defaults or the sparkline state otherwise; a tone or series on the sparkline still wins"
309
309
  },
310
310
  {
311
311
  "name": "StatCardStatus, StatCardAction",
@@ -414,6 +414,9 @@
414
414
  "--slotted-stat-card-region-gap-sm",
415
415
  "--slotted-stat-card-shadow",
416
416
  "--slotted-stat-card-shadow-elevated",
417
+ "--slotted-stat-card-trend-block-size",
418
+ "--slotted-stat-card-trend-block-size-lg",
419
+ "--slotted-stat-card-trend-block-size-sm",
417
420
  "--slotted-stat-card-trend-gap",
418
421
  "--slotted-stat-card-trend-gap-lg",
419
422
  "--slotted-stat-card-trend-gap-sm",
@@ -482,7 +485,7 @@
482
485
  {
483
486
  "id": "layout",
484
487
  "title": "The trend beside the figure, or under it",
485
- "note": "inline puts the sparkline in a column beside the value, centred on the figure; stacked gives it the full width on the last row, level with the bottom of every card in the row. Under 220 pixels a card stacks on its own and drops the value one step.",
488
+ "note": "inline puts the sparkline in a column beside the value, as tall as the figure; stacked runs it to the card’s edges on the last row, level with the bottom of every card in the row. Under 220 pixels a card stacks on its own and drops the value one step.",
486
489
  "language": "tsx",
487
490
  "source": "<StatCard layout=\"inline\">…</StatCard>;\n<StatCard layout=\"stacked\">…</StatCard>;\n",
488
491
  "verdict": "excerpt"
@@ -490,7 +493,7 @@
490
493
  {
491
494
  "id": "loading",
492
495
  "title": "The layout is kept while the value is on its way",
493
- "note": "Every text part stands in with a placeholder of its own line height and the trend with a block the sparkline’s height, so nothing moves when the numbers arrive; the previous value is not shown as if it were current.",
496
+ "note": "Every text part stands in with a placeholder of its own line height and the trend with a block in the trend’s own box, so nothing moves when the numbers arrive; the previous value is not shown as if it were current.",
494
497
  "language": "tsx",
495
498
  "source": "<StatCard loading={pending}>\n <StatCardHeader>\n <StatCardLabel>Open orders</StatCardLabel>\n </StatCardHeader>\n <StatCardFigure>\n <StatCardValue value={orders.total} />\n <StatCardDelta value={orders.delta} />\n </StatCardFigure>\n <StatCardTrend>\n <Sparkline data={orders.series} />\n </StatCardTrend>\n</StatCard>;\n",
496
499
  "verdict": "excerpt"
@@ -86,7 +86,7 @@ Excerpt — not a complete module
86
86
  | `children` | `ReactNode` | — | StatCardValue, StatCardDelta | Your own rendering of the number, unit and all; wins over value |
87
87
  | `render` | `(props) => ReactNode` | — | every part | Substitutes the rendered element: a heading for the label, a link for the action, a figure for the root |
88
88
  | `ref` | `Ref<HTMLElement>` | — | every part | Reaches the native element; each part’s props are that element’s, extended |
89
- | `StatCardTrend` | `children` | — | StatCard | Takes a Sparkline and hands it the card’s tone through --slotted-sparkline-color and its ground for the marker’s ring; a tone or series on the sparkline still wins |
89
+ | `StatCardTrend` | `children` | — | StatCard | Takes a Sparkline and hands it the card’s tone through --slotted-sparkline-color, its ground for the marker’s ring, and curve="monotone" with area unless sparkline defaults or the sparkline state otherwise; a tone or series on the sparkline still wins |
90
90
  | `StatCardStatus, StatCardAction` | `children` | — | StatCardHeader | Slots for a Badge or StatusIndicator, and for a Link or Button, kept as you wrote them |
91
91
  | `trendOf, toneOf` | `function` | — | Application | The two derivations, exported for a delta you format yourself |
92
92
  | `StatCardDefaultsProvider` | `StatCardDefaults` | — | Application | Sets goodWhen, size, fill, layout and formatOptions once for everything below it; a prop still wins |
@@ -114,7 +114,7 @@ Excerpt — not a complete module
114
114
 
115
115
  ## Tokens
116
116
 
117
- `--slotted-border-subtle`, `--slotted-border-width-thin`, `--slotted-control-icon-size-md`, `--slotted-control-icon-size-sm`, `--slotted-font-family-sans`, `--slotted-font-size-2xl`, `--slotted-font-size-3xl`, `--slotted-font-size-4xl`, `--slotted-font-size-md`, `--slotted-font-size-sm`, `--slotted-font-size-xl`, `--slotted-font-size-xs`, `--slotted-font-weight-medium`, `--slotted-font-weight-semibold`, `--slotted-letter-spacing-tighter`, `--slotted-line-height-2xl`, `--slotted-line-height-3xl`, `--slotted-line-height-4xl`, `--slotted-line-height-md`, `--slotted-line-height-sm`, `--slotted-line-height-xl`, `--slotted-line-height-xs`, `--slotted-radius-lg`, `--slotted-radius-none`, `--slotted-shadow-md`, `--slotted-space-1`, `--slotted-space-11`, `--slotted-space-12`, `--slotted-space-2`, `--slotted-space-3`, `--slotted-space-4`, `--slotted-space-5`, `--slotted-space-6`, `--slotted-space-7`, `--slotted-space-8`, `--slotted-space-9`, `--slotted-sparkline-block-size`, `--slotted-sparkline-block-size-lg`, `--slotted-sparkline-block-size-sm`, `--slotted-stat-card-background`, `--slotted-stat-card-background-subtle`, `--slotted-stat-card-border-color`, `--slotted-stat-card-border-width`, `--slotted-stat-card-color`, `--slotted-stat-card-color-muted`, `--slotted-stat-card-delta-font-size`, `--slotted-stat-card-delta-font-size-lg`, `--slotted-stat-card-delta-font-size-sm`, `--slotted-stat-card-indicator-size`, `--slotted-stat-card-indicator-size-lg`, `--slotted-stat-card-label-font-size`, `--slotted-stat-card-label-font-size-lg`, `--slotted-stat-card-label-font-size-sm`, `--slotted-stat-card-label-line-height`, `--slotted-stat-card-label-line-height-lg`, `--slotted-stat-card-label-line-height-sm`, `--slotted-stat-card-min-inline-size`, `--slotted-stat-card-padding-block`, `--slotted-stat-card-padding-block-lg`, `--slotted-stat-card-padding-block-sm`, `--slotted-stat-card-padding-inline`, `--slotted-stat-card-padding-inline-lg`, `--slotted-stat-card-padding-inline-sm`, `--slotted-stat-card-prose-font-size`, `--slotted-stat-card-prose-font-size-lg`, `--slotted-stat-card-prose-line-height`, `--slotted-stat-card-prose-line-height-lg`, `--slotted-stat-card-radius`, `--slotted-stat-card-region-gap`, `--slotted-stat-card-region-gap-lg`, `--slotted-stat-card-region-gap-sm`, `--slotted-stat-card-shadow`, `--slotted-stat-card-shadow-elevated`, `--slotted-stat-card-trend-gap`, `--slotted-stat-card-trend-gap-lg`, `--slotted-stat-card-trend-gap-sm`, `--slotted-stat-card-trend-inline-size`, `--slotted-stat-card-trend-inline-size-lg`, `--slotted-stat-card-trend-inline-size-sm`, `--slotted-stat-card-value-font-size`, `--slotted-stat-card-value-font-size-lg`, `--slotted-stat-card-value-font-size-sm`, `--slotted-stat-card-value-line-height`, `--slotted-stat-card-value-line-height-lg`, `--slotted-stat-card-value-line-height-sm`, `--slotted-surface-raised`, `--slotted-surface-sunken`, `--slotted-target-comfortable`, `--slotted-text`, `--slotted-text-muted`, `--slotted-tone-accent-text`, `--slotted-tone-danger-text`, `--slotted-tone-info-text`, `--slotted-tone-secondary-text`, `--slotted-tone-success-text`, `--slotted-tone-warning-text`
117
+ `--slotted-border-subtle`, `--slotted-border-width-thin`, `--slotted-control-icon-size-md`, `--slotted-control-icon-size-sm`, `--slotted-font-family-sans`, `--slotted-font-size-2xl`, `--slotted-font-size-3xl`, `--slotted-font-size-4xl`, `--slotted-font-size-md`, `--slotted-font-size-sm`, `--slotted-font-size-xl`, `--slotted-font-size-xs`, `--slotted-font-weight-medium`, `--slotted-font-weight-semibold`, `--slotted-letter-spacing-tighter`, `--slotted-line-height-2xl`, `--slotted-line-height-3xl`, `--slotted-line-height-4xl`, `--slotted-line-height-md`, `--slotted-line-height-sm`, `--slotted-line-height-xl`, `--slotted-line-height-xs`, `--slotted-radius-lg`, `--slotted-radius-none`, `--slotted-shadow-md`, `--slotted-space-1`, `--slotted-space-11`, `--slotted-space-12`, `--slotted-space-2`, `--slotted-space-3`, `--slotted-space-4`, `--slotted-space-5`, `--slotted-space-6`, `--slotted-space-7`, `--slotted-space-8`, `--slotted-space-9`, `--slotted-sparkline-block-size`, `--slotted-sparkline-block-size-lg`, `--slotted-sparkline-block-size-sm`, `--slotted-stat-card-background`, `--slotted-stat-card-background-subtle`, `--slotted-stat-card-border-color`, `--slotted-stat-card-border-width`, `--slotted-stat-card-color`, `--slotted-stat-card-color-muted`, `--slotted-stat-card-delta-font-size`, `--slotted-stat-card-delta-font-size-lg`, `--slotted-stat-card-delta-font-size-sm`, `--slotted-stat-card-indicator-size`, `--slotted-stat-card-indicator-size-lg`, `--slotted-stat-card-label-font-size`, `--slotted-stat-card-label-font-size-lg`, `--slotted-stat-card-label-font-size-sm`, `--slotted-stat-card-label-line-height`, `--slotted-stat-card-label-line-height-lg`, `--slotted-stat-card-label-line-height-sm`, `--slotted-stat-card-min-inline-size`, `--slotted-stat-card-padding-block`, `--slotted-stat-card-padding-block-lg`, `--slotted-stat-card-padding-block-sm`, `--slotted-stat-card-padding-inline`, `--slotted-stat-card-padding-inline-lg`, `--slotted-stat-card-padding-inline-sm`, `--slotted-stat-card-prose-font-size`, `--slotted-stat-card-prose-font-size-lg`, `--slotted-stat-card-prose-line-height`, `--slotted-stat-card-prose-line-height-lg`, `--slotted-stat-card-radius`, `--slotted-stat-card-region-gap`, `--slotted-stat-card-region-gap-lg`, `--slotted-stat-card-region-gap-sm`, `--slotted-stat-card-shadow`, `--slotted-stat-card-shadow-elevated`, `--slotted-stat-card-trend-block-size`, `--slotted-stat-card-trend-block-size-lg`, `--slotted-stat-card-trend-block-size-sm`, `--slotted-stat-card-trend-gap`, `--slotted-stat-card-trend-gap-lg`, `--slotted-stat-card-trend-gap-sm`, `--slotted-stat-card-trend-inline-size`, `--slotted-stat-card-trend-inline-size-lg`, `--slotted-stat-card-trend-inline-size-sm`, `--slotted-stat-card-value-font-size`, `--slotted-stat-card-value-font-size-lg`, `--slotted-stat-card-value-font-size-sm`, `--slotted-stat-card-value-line-height`, `--slotted-stat-card-value-line-height-lg`, `--slotted-stat-card-value-line-height-sm`, `--slotted-surface-raised`, `--slotted-surface-sunken`, `--slotted-target-comfortable`, `--slotted-text`, `--slotted-text-muted`, `--slotted-tone-accent-text`, `--slotted-tone-danger-text`, `--slotted-tone-info-text`, `--slotted-tone-secondary-text`, `--slotted-tone-success-text`, `--slotted-tone-warning-text`
118
118
 
119
119
  ## Examples
120
120
 
@@ -205,7 +205,7 @@ Excerpt — not a complete module
205
205
 
206
206
  ### The trend beside the figure, or under it
207
207
 
208
- inline puts the sparkline in a column beside the value, centred on the figure; stacked gives it the full width on the last row, level with the bottom of every card in the row. Under 220 pixels a card stacks on its own and drops the value one step.
208
+ inline puts the sparkline in a column beside the value, as tall as the figure; stacked runs it to the card’s edges on the last row, level with the bottom of every card in the row. Under 220 pixels a card stacks on its own and drops the value one step.
209
209
 
210
210
  Excerpt — not a complete module
211
211
 
@@ -216,7 +216,7 @@ Excerpt — not a complete module
216
216
 
217
217
  ### The layout is kept while the value is on its way
218
218
 
219
- Every text part stands in with a placeholder of its own line height and the trend with a block the sparkline’s height, so nothing moves when the numbers arrive; the previous value is not shown as if it were current.
219
+ Every text part stands in with a placeholder of its own line height and the trend with a block in the trend’s own box, so nothing moves when the numbers arrive; the previous value is not shown as if it were current.
220
220
 
221
221
  Excerpt — not a complete module
222
222