@slotted/angular 0.1.0-beta.1 → 0.1.0-beta.3

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 (169) hide show
  1. package/README.md +4 -0
  2. package/docs/AGENTS.snippet.md +10 -0
  3. package/docs/app-shell.json +1 -1
  4. package/docs/button-group.json +1 -0
  5. package/docs/button-group.md +1 -1
  6. package/docs/button.json +45 -11
  7. package/docs/button.md +10 -6
  8. package/docs/chart.json +7 -0
  9. package/docs/chart.md +1 -0
  10. package/docs/checkbox.json +7 -0
  11. package/docs/checkbox.md +1 -0
  12. package/docs/currency-field.json +32 -1
  13. package/docs/currency-field.md +4 -1
  14. package/docs/dialog.examples.md +20 -0
  15. package/docs/dialog.json +14 -2
  16. package/docs/dialog.md +1 -1
  17. package/docs/event-calendar.json +7 -0
  18. package/docs/event-calendar.md +1 -0
  19. package/docs/guidelines/README.md +27 -0
  20. package/docs/guidelines/async-feedback.md +108 -0
  21. package/docs/guidelines/browsing.md +74 -0
  22. package/docs/guidelines/builders.md +97 -0
  23. package/docs/guidelines/composition.md +129 -0
  24. package/docs/guidelines/conversations.md +59 -0
  25. package/docs/guidelines/errors-and-conflicts.md +71 -0
  26. package/docs/guidelines/forms.md +192 -0
  27. package/docs/guidelines/index.md +121 -0
  28. package/docs/guidelines/layout-alignment.md +95 -0
  29. package/docs/guidelines/ledgers.md +45 -0
  30. package/docs/guidelines/list-pages.md +165 -0
  31. package/docs/guidelines/overviews.md +66 -0
  32. package/docs/guidelines/own-elements.md +115 -0
  33. package/docs/guidelines/reading-permissions.md +55 -0
  34. package/docs/guidelines/record-pages.md +178 -0
  35. package/docs/guidelines/reports.md +123 -0
  36. package/docs/guidelines/shell-composition.md +94 -0
  37. package/docs/guidelines/workspaces.md +46 -0
  38. package/docs/index.md +12 -0
  39. package/docs/list.json +19 -1
  40. package/docs/list.md +3 -1
  41. package/docs/popover.json +1 -1
  42. package/docs/progress-indicator.json +1 -2
  43. package/docs/progress-indicator.md +2 -2
  44. package/docs/segmented-control.json +29 -1
  45. package/docs/segmented-control.md +17 -1
  46. package/docs/skills/build-own-element/SKILL.md +90 -0
  47. package/docs/skills/compose-screen/SKILL.md +76 -0
  48. package/docs/skills/index.md +9 -0
  49. package/docs/skills/review-screen/SKILL.md +70 -0
  50. package/docs/skills/theme-app/SKILL.md +79 -0
  51. package/docs/skills/waiting-states/SKILL.md +139 -0
  52. package/docs/split-button.json +1 -0
  53. package/docs/split-button.md +1 -1
  54. package/docs/stat-card.json +2 -0
  55. package/docs/stat-card.md +1 -1
  56. package/docs/table.examples.md +1 -1
  57. package/docs/table.json +70 -1
  58. package/docs/table.md +10 -1
  59. package/docs/tabs.json +1 -4
  60. package/docs/tabs.md +1 -1
  61. package/docs/toggle-group.json +14 -3
  62. package/docs/toggle-group.md +3 -3
  63. package/docs/toggle.json +12 -3
  64. package/docs/toggle.md +3 -3
  65. package/docs/tokens.md +448 -0
  66. package/docs/tour.json +1 -1
  67. package/fesm2022/slotted-angular-app-shell.mjs +48 -16
  68. package/fesm2022/slotted-angular-app-shell.mjs.map +1 -1
  69. package/fesm2022/slotted-angular-button-group.mjs +4 -4
  70. package/fesm2022/slotted-angular-button-group.mjs.map +1 -1
  71. package/fesm2022/slotted-angular-button.mjs +51 -19
  72. package/fesm2022/slotted-angular-button.mjs.map +1 -1
  73. package/fesm2022/slotted-angular-cascader.mjs +1 -1
  74. package/fesm2022/slotted-angular-cascader.mjs.map +1 -1
  75. package/fesm2022/slotted-angular-chart.mjs +41 -20
  76. package/fesm2022/slotted-angular-chart.mjs.map +1 -1
  77. package/fesm2022/slotted-angular-checkbox.mjs +11 -2
  78. package/fesm2022/slotted-angular-checkbox.mjs.map +1 -1
  79. package/fesm2022/slotted-angular-column-manager.mjs +1 -1
  80. package/fesm2022/slotted-angular-column-manager.mjs.map +1 -1
  81. package/fesm2022/slotted-angular-combobox.mjs +12 -6
  82. package/fesm2022/slotted-angular-combobox.mjs.map +1 -1
  83. package/fesm2022/slotted-angular-currency-field.mjs +59 -8
  84. package/fesm2022/slotted-angular-currency-field.mjs.map +1 -1
  85. package/fesm2022/slotted-angular-dashboard-grid.mjs +18 -22
  86. package/fesm2022/slotted-angular-dashboard-grid.mjs.map +1 -1
  87. package/fesm2022/slotted-angular-data-grid.mjs +7 -3
  88. package/fesm2022/slotted-angular-data-grid.mjs.map +1 -1
  89. package/fesm2022/slotted-angular-data-list.mjs +2 -2
  90. package/fesm2022/slotted-angular-data-list.mjs.map +1 -1
  91. package/fesm2022/slotted-angular-dialog.mjs +4 -4
  92. package/fesm2022/slotted-angular-dialog.mjs.map +1 -1
  93. package/fesm2022/slotted-angular-drawer.mjs +5 -1
  94. package/fesm2022/slotted-angular-drawer.mjs.map +1 -1
  95. package/fesm2022/slotted-angular-event-calendar.mjs +18 -8
  96. package/fesm2022/slotted-angular-event-calendar.mjs.map +1 -1
  97. package/fesm2022/slotted-angular-filter-bar.mjs +8 -8
  98. package/fesm2022/slotted-angular-filter-bar.mjs.map +1 -1
  99. package/fesm2022/slotted-angular-import-export-center.mjs +1 -1
  100. package/fesm2022/slotted-angular-import-export-center.mjs.map +1 -1
  101. package/fesm2022/slotted-angular-list.mjs +28 -17
  102. package/fesm2022/slotted-angular-list.mjs.map +1 -1
  103. package/fesm2022/slotted-angular-loading-overlay.mjs +2 -2
  104. package/fesm2022/slotted-angular-markdown.mjs +1 -1
  105. package/fesm2022/slotted-angular-markdown.mjs.map +1 -1
  106. package/fesm2022/slotted-angular-multi-select.mjs +32 -27
  107. package/fesm2022/slotted-angular-multi-select.mjs.map +1 -1
  108. package/fesm2022/slotted-angular-notification-center.mjs +1 -1
  109. package/fesm2022/slotted-angular-notification-center.mjs.map +1 -1
  110. package/fesm2022/slotted-angular-number-field.mjs +2 -2
  111. package/fesm2022/slotted-angular-number-field.mjs.map +1 -1
  112. package/fesm2022/slotted-angular-progress-indicator.mjs +6 -6
  113. package/fesm2022/slotted-angular-saved-views.mjs +1 -1
  114. package/fesm2022/slotted-angular-saved-views.mjs.map +1 -1
  115. package/fesm2022/slotted-angular-segmented-control.mjs +25 -5
  116. package/fesm2022/slotted-angular-segmented-control.mjs.map +1 -1
  117. package/fesm2022/slotted-angular-select.mjs +1 -25
  118. package/fesm2022/slotted-angular-select.mjs.map +1 -1
  119. package/fesm2022/slotted-angular-split-button.mjs +4 -4
  120. package/fesm2022/slotted-angular-split-button.mjs.map +1 -1
  121. package/fesm2022/slotted-angular-stat-card.mjs +2 -2
  122. package/fesm2022/slotted-angular-stat-card.mjs.map +1 -1
  123. package/fesm2022/slotted-angular-table.mjs +97 -10
  124. package/fesm2022/slotted-angular-table.mjs.map +1 -1
  125. package/fesm2022/slotted-angular-tabs.mjs +2 -2
  126. package/fesm2022/slotted-angular-tabs.mjs.map +1 -1
  127. package/fesm2022/slotted-angular-toggle-group.mjs +17 -4
  128. package/fesm2022/slotted-angular-toggle-group.mjs.map +1 -1
  129. package/fesm2022/slotted-angular-toggle.mjs +2 -2
  130. package/fesm2022/slotted-angular-toggle.mjs.map +1 -1
  131. package/fesm2022/slotted-angular-tour.mjs +1 -1
  132. package/fesm2022/slotted-angular-tour.mjs.map +1 -1
  133. package/fesm2022/slotted-angular-transfer.mjs +1 -1
  134. package/fesm2022/slotted-angular-transfer.mjs.map +1 -1
  135. package/fesm2022/slotted-angular-upload.mjs +2 -2
  136. package/fesm2022/slotted-angular-wizard.mjs +1 -1
  137. package/fesm2022/slotted-angular-wizard.mjs.map +1 -1
  138. package/package.json +3 -3
  139. package/types/slotted-angular-app-shell.d.ts +6 -0
  140. package/types/slotted-angular-app-shell.d.ts.map +1 -1
  141. package/types/slotted-angular-button-group.d.ts +1 -1
  142. package/types/slotted-angular-button.d.ts +33 -13
  143. package/types/slotted-angular-button.d.ts.map +1 -1
  144. package/types/slotted-angular-chart.d.ts +9 -0
  145. package/types/slotted-angular-chart.d.ts.map +1 -1
  146. package/types/slotted-angular-checkbox.d.ts +7 -1
  147. package/types/slotted-angular-checkbox.d.ts.map +1 -1
  148. package/types/slotted-angular-combobox.d.ts.map +1 -1
  149. package/types/slotted-angular-currency-field.d.ts +25 -3
  150. package/types/slotted-angular-currency-field.d.ts.map +1 -1
  151. package/types/slotted-angular-dashboard-grid.d.ts.map +1 -1
  152. package/types/slotted-angular-data-grid.d.ts.map +1 -1
  153. package/types/slotted-angular-drawer.d.ts.map +1 -1
  154. package/types/slotted-angular-event-calendar.d.ts +9 -2
  155. package/types/slotted-angular-event-calendar.d.ts.map +1 -1
  156. package/types/slotted-angular-list.d.ts +42 -27
  157. package/types/slotted-angular-list.d.ts.map +1 -1
  158. package/types/slotted-angular-multi-select.d.ts +10 -0
  159. package/types/slotted-angular-multi-select.d.ts.map +1 -1
  160. package/types/slotted-angular-segmented-control.d.ts +15 -2
  161. package/types/slotted-angular-segmented-control.d.ts.map +1 -1
  162. package/types/slotted-angular-select.d.ts.map +1 -1
  163. package/types/slotted-angular-split-button.d.ts +2 -2
  164. package/types/slotted-angular-table.d.ts +43 -3
  165. package/types/slotted-angular-table.d.ts.map +1 -1
  166. package/types/slotted-angular-toggle-group.d.ts +8 -2
  167. package/types/slotted-angular-toggle-group.d.ts.map +1 -1
  168. package/types/slotted-angular-toggle.d.ts +1 -1
  169. package/types/slotted-angular-toggle.d.ts.map +1 -1
@@ -0,0 +1,90 @@
1
+ ---
2
+ name: build-own-element
3
+ description: Use when writing a component, widget or visual element that no family of @slotted/angular draws — a timeline strip, a seat map, a heat grid, a bespoke control. Proves first that no family answers, then builds the element from the theme's tokens with the states, focus, target size, forced colours and motion the families keep.
4
+ ---
5
+
6
+ # Build an element of the application's own
7
+
8
+ An element of the application's own is a node the application writes and
9
+ styles itself, outside any family (CP-04). It is the last resort, and it is
10
+ built from the same theme as the families beside it.
11
+
12
+ ## 1. Prove that no family answers
13
+
14
+ 1. Read `node_modules/@slotted/angular/docs/index.md` and list the families whose line is near the
15
+ element.
16
+ 2. Read `node_modules/@slotted/angular/docs/<family>.md` for each: its anatomy, its slots, its axes.
17
+ When a family draws the element, or names a slot that holds it, the family
18
+ is used (CP-01).
19
+ 3. When a family draws a part of the element — a toggle, a popup, a list, a
20
+ tooltip — that part is the family, and only the rest is written.
21
+ 4. Write, in a comment above the element, the families read and what each
22
+ lacks.
23
+
24
+ ## 2. What is free and what is fixed
25
+
26
+ Free, decided by the problem:
27
+
28
+ - the element's shape, its arrangement and how it encodes the data — a strip,
29
+ a grid, a ring, a map;
30
+ - which states it has, and what each state shows;
31
+ - its layout inside the box it is given.
32
+
33
+ Fixed, read from the theme:
34
+
35
+ - every value it paints comes from a token of the group
36
+ `node_modules/@slotted/angular/docs/tokens.md` lists for that decision (OE-01, CP-05);
37
+ - a tone carries the meaning the `tone` group gives it, and a data series takes
38
+ the `data` slots in order;
39
+ - how its states yield, how focus is drawn, how large a target is, what forced
40
+ colours keep and how it moves (OE-02 to OE-07).
41
+
42
+ A new appearance is a new combination of tokens, never a new value.
43
+
44
+ ## 3. Map each decision to a group
45
+
46
+ | Decision | Group in `node_modules/@slotted/angular/docs/tokens.md` |
47
+ | ---------------------------------------------- | --------------------------------------------------- |
48
+ | Distance between parts, inner padding | `space` |
49
+ | Corners | `radius` |
50
+ | Ground of the element and its parts | `surface`; `tone` when the ground carries an intent |
51
+ | Text | `text`, `font-size`, `font-weight`, `line-height` |
52
+ | Edges | `border`, `border-width` |
53
+ | Series and categories of data | `data` |
54
+ | The place the reader is on, a matched span | `current`, `highlight` |
55
+ | Focus | `focus-ring` |
56
+ | Hit area | `target` |
57
+ | A part that stands beside controls | `control`, `control-size` |
58
+ | Movement | `duration`, `easing` |
59
+ | A surface above another, a layer over the page | `shadow`, `z-index` |
60
+ | A disabled part | `disabled` |
61
+
62
+ A decision no group names is written as a literal beside a comment that says
63
+ why no token covers it (CP-05).
64
+
65
+ ## 4. Write it
66
+
67
+ 1. Give each interactive part the native element that carries its role: a
68
+ button for an action, a link for a destination, an input for a value. Add
69
+ ARIA only where no element carries the role.
70
+ 2. List the element's states, and paint each pair that can hold at once in the
71
+ order of OE-02.
72
+ 3. Draw focus on `:focus-visible` as an outline of `--slotted-focus-ring-width`
73
+ in `--slotted-focus-ring-color`, offset by `--slotted-focus-ring-offset`
74
+ (OE-03). Size every target to `--slotted-target-min` (OE-04), and take the
75
+ control step of the controls beside it (OE-05).
76
+ 4. Under `forced-colors: active`, tell each state from rest by a border,
77
+ an outline or text (OE-06). Move with the motion tokens, and stop a
78
+ repeating animation under `prefers-reduced-motion: reduce` (OE-07).
79
+ 5. Write the CSS in a layer of the application after the library's, on class
80
+ names of the element's own (OE-08). Reflow by a container query on a
81
+ container of its own (OE-09). Float with a raised surface and one shadow
82
+ step (OE-10).
83
+ 6. Text that stands alone takes its size from the `typography` family (CP-02).
84
+
85
+ ## 5. Done
86
+
87
+ 1. Each `Check` of `node_modules/@slotted/angular/docs/guidelines/own-elements.md` passes.
88
+ 2. The element's CSS holds no colour or length literal without its comment.
89
+ 3. Every custom property the element reads is listed in
90
+ `node_modules/@slotted/angular/docs/tokens.md` above "Read by their family only".
@@ -0,0 +1,76 @@
1
+ ---
2
+ name: compose-screen
3
+ description: Use when writing or changing a screen of an application built with @slotted/angular — a list of records, the page of one record, a form that writes one, an overview, a report, a tree beside a list, a rule builder, a conversation or a ledger. Applies the Slotted guidelines in order and ends with each Check of the rules read.
4
+ ---
5
+
6
+ # Compose a screen
7
+
8
+ A screen is composed from the families' own parts first. An element of the
9
+ screen's own exists only where no family names a place for it.
10
+
11
+ ## 1. Classify the screen
12
+
13
+ | The screen | Topic |
14
+ | ----------------------------------------------------- | ------------------ |
15
+ | Lists records, searches, filters, pages | `list-pages.md` |
16
+ | Shows one record, its figures and its related records | `record-pages.md` |
17
+ | Creates or edits a record | `forms.md` |
18
+ | Summarises a domain in figures and charts | `overviews.md` |
19
+ | Places a list beside a tree of its places | `browsing.md` |
20
+ | Reads records over a chosen period | `reports.md` |
21
+ | Writes or reads a rule the system runs later | `builders.md` |
22
+ | Holds a conversation the reader answers | `conversations.md` |
23
+ | Works a queue against candidates in three regions | `workspaces.md` |
24
+ | Lists immutable changes with their cause and balance | `ledgers.md` |
25
+
26
+ A screen can be two of these: a record with an edit form in place reads both
27
+ topics.
28
+
29
+ ## 2. Read
30
+
31
+ 1. `node_modules/@slotted/angular/docs/guidelines/index.md`.
32
+ 2. `node_modules/@slotted/angular/docs/guidelines/composition.md`, always.
33
+ 3. The topic of step 1. Add `layout-alignment.md` and `shell-composition.md`
34
+ when the screen places controls in a row or in the application frame.
35
+ 4. Add `errors-and-conflicts.md` and `reading-permissions.md` when the screen
36
+ writes data or reads under a role.
37
+ 5. When the screen writes an element of its own, follow
38
+ `node_modules/@slotted/angular/docs/skills/build-own-element/SKILL.md`.
39
+
40
+ ## 3. Read each family before writing beside it
41
+
42
+ For each family the screen uses, read `node_modules/@slotted/angular/docs/<family>.md` — its anatomy,
43
+ its slots, its axes (CP-01). When the family names a slot for an element, the
44
+ element stands in that slot.
45
+
46
+ ## 4. Compose
47
+
48
+ - The page's width follows its type: a list is `bleed` with `fill`; a record,
49
+ a dashboard and an overview keep `wide`; a create or edit form is `content`;
50
+ preferences read as prose are `measure` (CP-07).
51
+ - Siblings of the screen's own stand in `inline` (one row) or `stack` (one
52
+ column) with a gap from the space scale; text of the screen's own takes its
53
+ size from the `typography` family's `text` member (CP-02).
54
+ - A track that holds a family which scrolls states a zero minimum, so the
55
+ family's scroller is what scrolls (CP-03).
56
+ - An element of the screen's own paints only with theme tokens; a literal is
57
+ written only beside a comment that says why no token covers it (CP-05).
58
+ - A state a family already draws is set on the family and stated once, with
59
+ nothing louder beside it (CP-06).
60
+ - A control that switches what a region holds changes words and values, never
61
+ the size or the position of a box (CP-08).
62
+ - Where no anatomy answers the problem, the screen writes an element of its
63
+ own instead of bending a family into a shape it does not have (CP-04). That
64
+ element is built with `node_modules/@slotted/angular/docs/skills/build-own-element/SKILL.md`.
65
+
66
+ ## 5. Waits
67
+
68
+ Every region filled by a request and every control that starts one follow
69
+ `node_modules/@slotted/angular/docs/skills/waiting-states/SKILL.md`.
70
+
71
+ ## 6. Done
72
+
73
+ 1. Each `MUST` rule of the topics read: its `Check` passes.
74
+ 2. Each `SHOULD` rule not followed is listed with its reason.
75
+ 3. No CSS of the screen's own targets a family's parts; a family's appearance
76
+ changes through its axes.
@@ -0,0 +1,9 @@
1
+ # Skills index
2
+
3
+ Each skill, with when it applies. Read a skill before its task.
4
+
5
+ - build-own-element: `./build-own-element/SKILL.md` — Use when writing a component, widget or visual element that no family of @slotted/angular draws — a timeline strip, a seat map, a heat grid, a bespoke control. Proves first that no family answers, then builds the element from the theme's tokens with the states, focus, target size, forced colours and motion the families keep.
6
+ - compose-screen: `./compose-screen/SKILL.md` — Use when writing or changing a screen of an application built with @slotted/angular — a list of records, the page of one record, a form that writes one, an overview, a report, a tree beside a list, a rule builder, a conversation or a ledger. Applies the Slotted guidelines in order and ends with each Check of the rules read.
7
+ - review-screen: `./review-screen/SKILL.md` — Use when reviewing, auditing or fixing an existing screen of an application built with @slotted/angular, or when asked whether a screen follows the Slotted guidelines. Reads the rules that apply, sweeps the screen's code for the defects found without running it, and reports each finding with its rule, level and place.
8
+ - theme-app: `./theme-app/SKILL.md` — Use when changing how an application built with @slotted/angular looks, as a whole or in one region — its brand colour, a light, dark or high-contrast scheme, density, fonts, corners, or the shape of a control. Chooses the narrowest level that reaches the change — a seed, a token, a family token or a theme rule — and where it is declared.
9
+ - waiting-states: `./waiting-states/SKILL.md` — Use when building or reviewing anything a person waits in front of in an application built with @slotted/angular — placeholders, a control's own loading state, a loading overlay, a progress indicator, or the empty and error states beside them. Decides which indicator answers which wait and how placeholders are built from the anatomy they stand in for.
@@ -0,0 +1,70 @@
1
+ ---
2
+ name: review-screen
3
+ description: Use when reviewing, auditing or fixing an existing screen of an application built with @slotted/angular, or when asked whether a screen follows the Slotted guidelines. Reads the rules that apply, sweeps the screen's code for the defects found without running it, and reports each finding with its rule, level and place.
4
+ ---
5
+
6
+ # Review a screen
7
+
8
+ A review answers one question per rule read: does the screen pass the rule's
9
+ `Check`. A finding names a rule; a remark that names no rule is not a finding.
10
+
11
+ ## 1. Inventory
12
+
13
+ 1. List the screen's files: its component, its template, its stylesheet and
14
+ the requests it starts.
15
+ 2. List the families it imports, and read `node_modules/@slotted/angular/docs/<family>.md` for each.
16
+ 3. List the elements of the screen's own: every element that is not a family,
17
+ with the CSS that paints it.
18
+ 4. Classify the screen with the table in step 1 of
19
+ `node_modules/@slotted/angular/docs/skills/compose-screen/SKILL.md`.
20
+
21
+ ## 2. Read
22
+
23
+ 1. `node_modules/@slotted/angular/docs/guidelines/index.md` and
24
+ `node_modules/@slotted/angular/docs/guidelines/composition.md`.
25
+ 2. The topics of the classification, and each topic whose `triggers` the
26
+ screen matches.
27
+ 3. `own-elements.md` when step 1 listed an element of the screen's own.
28
+ 4. `node_modules/@slotted/angular/docs/skills/waiting-states/SKILL.md` when the screen starts a
29
+ request.
30
+
31
+ ## 3. Sweep the code
32
+
33
+ Each search below finds a defect without running the screen.
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 | a control that fires twice | AF-03 |
40
+ | An empty state drawn from the initial value of the data, before the first answer | a wait shown as nothing | AF-01 |
41
+ | A spinner standing in a region that has no items yet | placeholders missing | AF-02 |
42
+ | Siblings of the page's own spaced by margins, or text with a font size of its own | layout outside the primitives | CP-02 |
43
+ | A grid or flex track around a family that scrolls, with no zero minimum | the page scrolls, not the family | CP-03 |
44
+ | A badge, a tag or a colour beside a family that already draws the same state | a state stated twice | CP-06 |
45
+ | An element of the screen's own that takes focus with no ring in its `focus-visible` state | focus not drawn | OE-03 |
46
+
47
+ A rule whose `Check` needs the screen running — a size class, a throttled
48
+ network, the accessibility tree — is run when the environment can run it, and
49
+ otherwise reported as not checked, with the step that checks it.
50
+
51
+ ## 4. Report
52
+
53
+ One finding per entry, every `MUST` before every `SHOULD`:
54
+
55
+ - the rule's id and level;
56
+ - the file and the line;
57
+ - what the screen does, in one sentence;
58
+ - the change after which the rule's `Check` passes.
59
+
60
+ A `SHOULD` the screen breaks on purpose is listed with its reason, as a
61
+ deviation. The screen passes when no `MUST` finding remains.
62
+
63
+ ## 5. Fix, when asked
64
+
65
+ 1. Fix every `MUST` finding, then each `SHOULD` finding the request covers.
66
+ 2. A fix uses what the family offers — its state, its slot, its axis — and
67
+ never CSS on its parts.
68
+ 3. A literal becomes a token of the group `node_modules/@slotted/angular/docs/tokens.md` lists for
69
+ that decision.
70
+ 4. Run the searches of step 3 again on the changed files: none finds anything.
@@ -0,0 +1,79 @@
1
+ ---
2
+ name: theme-app
3
+ description: Use when changing how an application built with @slotted/angular looks, as a whole or in one region — its brand colour, a light, dark or high-contrast scheme, density, fonts, corners, or the shape of a control. Chooses the narrowest level that reaches the change — a seed, a token, a family token or a theme rule — and where it is declared.
4
+ ---
5
+
6
+ # Theme an application
7
+
8
+ The theme decides every value a family paints. A change of look is made in a
9
+ theme or on a scope, never by CSS of the application on a family's parts.
10
+
11
+ ## 1. Choose the level
12
+
13
+ Take the first row that reaches the change.
14
+
15
+ | The change | Level | Declared in |
16
+ | ------------------------------------------------------ | --------------------------------------------------------------- | ----------------------------------------------------------------------------- |
17
+ | The brand colour, or the colour of one intent | a seed: `--slotted-seed-accent` or another name of `SEED_NAMES` | the theme's `seeds`, or a scope |
18
+ | Light, dark, high contrast, or the system's preference | the scheme: `light`, `dark`, `high-contrast`, `system` | `data-slotted-scheme`, or the scheme of the `slThemeScope` directive from `@slotted/angular/theme` |
19
+ | How tight controls and rows are | the density: `comfortable`, `compact`, `dense` | `data-slotted-density`, or the density of the `slThemeScope` directive from `@slotted/angular/theme` |
20
+ | Spacing, corners, type, lines, shadows or motion | a token of a group in `node_modules/@slotted/angular/docs/tokens.md` | the theme's `base`; `schemes` for a value per scheme; `densities` per density |
21
+ | One family's look | a token the family's page lists under Tokens | the theme's `components` |
22
+ | What no token reaches | a theme rule | the theme's `rules` |
23
+
24
+ Every colour token derives from the five seeds within contrast bounds, so a
25
+ new seed keeps the ratios of every scheme. A colour of the `tone`, `surface`,
26
+ `text` or `border` groups is changed through its seed, never declared by hand.
27
+
28
+ ## 2. One theme for the product
29
+
30
+ 1. Build it with `extendTheme` on the theme of `@slotted/themes/default`: a
31
+ name of its own, and only what changes — `seeds`, then `base`, `schemes`
32
+ and `densities`, then `components`, then `rules`. A face the product brings
33
+ goes in `fonts`, and the `font-family` group names it; headings read
34
+ `--slotted-font-family-heading`.
35
+ 2. Compile it with `slotted-build-theme`, load the stylesheet it writes in
36
+ place of `@slotted/themes/default.css`, and set the theme's name in
37
+ `data-slotted-theme` and the scheme in `data-slotted-scheme` on the root
38
+ element.
39
+ 3. A theme chosen at runtime is applied with `applyTheme`, in a module the
40
+ application loads on demand: `@slotted/theme` carries the whole token
41
+ contract and its validator.
42
+ 4. In a test of the theme, `themeConformance` from `@slotted/theme/conformance`
43
+ checks the structure, the contrast of every scheme and the glyphs, under
44
+ Node's test runner. It takes the `contract`, the theme passed through
45
+ `flattenTheme`, and the compiled stylesheet.
46
+
47
+ ## 3. One region
48
+
49
+ 1. A scheme or a density for a subtree: the `slThemeScope` directive from `@slotted/angular/theme`, which carries both to
50
+ an overlay opened inside it, or the `data-slotted-scheme` and
51
+ `data-slotted-density` attributes on the subtree's root.
52
+ 2. A seed for a subtree: the seed property on an element that also carries
53
+ `data-slotted-seeds`, or the seeds of the `slThemeScope` directive from `@slotted/angular/theme`. Every colour under it
54
+ derives again from that seed.
55
+ 3. A colour the reader picks at runtime: write the seed property on the element
56
+ that carries `data-slotted-theme`, with `seedStyle` from
57
+ `@slotted/theme/seeds`, which leaves the token contract out of the bundle.
58
+ 4. A bar of the application's own that floats over scrolling content — a phone
59
+ tab bar, a sticky banner — is a material: its background reads
60
+ `--slotted-surface-material` and its backdrop filter reads
61
+ `--slotted-material-backdrop`. The theme makes both opaque under reduced
62
+ transparency and forced colours.
63
+
64
+ ## 4. Restyle a control
65
+
66
+ 1. A token every control reads, in `base`, `schemes` or `densities`.
67
+ 2. Else a token of the family, in `components`; it falls back to the control
68
+ token.
69
+ 3. Else a theme rule. It lives in `slotted.theme-rules`, selects only
70
+ `data-ui`, `data-part`, the attributes a family writes and the theme's
71
+ attributes, and reads only tokens; the compiler names the file, the line
72
+ and the selector of a rule it refuses.
73
+
74
+ ## 5. Done
75
+
76
+ 1. The application's own CSS declares no token of the `tone`, `surface`,
77
+ `text` or `border` groups, and sets no colour, border, radius, padding or
78
+ type on a family's `data-ui` or `data-part`.
79
+ 2. `themeConformance` passes for the theme.
@@ -0,0 +1,139 @@
1
+ ---
2
+ name: waiting-states
3
+ description: Use when building or reviewing anything a person waits in front of in an application built with @slotted/angular — placeholders, a control's own loading state, a loading overlay, a progress indicator, or the empty and error states beside them. Decides which indicator answers which wait and how placeholders are built from the anatomy they stand in for.
4
+ ---
5
+
6
+ # Waiting states
7
+
8
+ A waiting state is a screen the reader sees, not a gap in one. It is built from
9
+ the anatomy it stands in for, and it is finished when the loaded screen and the
10
+ pending screen occupy the same boxes.
11
+
12
+ The failure this skill prevents: three grey bars of equal length where a table,
13
+ a card and a list should have been.
14
+
15
+ Rules cited here are in `node_modules/@slotted/angular/docs/guidelines/async-feedback.md`. Each family
16
+ named here has its page: `node_modules/@slotted/angular/docs/<family>.md`.
17
+
18
+ ## 1. Which indicator answers which wait
19
+
20
+ Answer in order and stop at the first row that decides.
21
+
22
+ | The wait | The indicator |
23
+ | ---------------------------------------------------------------------------------- | ------------------------------------------------- |
24
+ | Structure is known before the data arrives — a list, a table, a card, a form | `skeleton` placeholders |
25
+ | A control started the request and stays on screen — a button, a field, a menu item | that family's own `loading` state |
26
+ | A region already painted is being replaced and must not be touched meanwhile | `loading-overlay` |
27
+ | The work reports how much is done | `progress-indicator` with a value |
28
+ | Nothing above: duration unknown, structure unknown, area small | `progress-indicator` in its `indeterminate` state |
29
+
30
+ Two indicators never answer the same wait in the same region. Placeholders
31
+ under an overlay, an indeterminate indicator inside placeholders, and a
32
+ progress indicator over a control that already waits are each one indicator
33
+ too many.
34
+
35
+ A region that already shows items is busy, not pending: it keeps its items,
36
+ carries `aria-busy`, and swaps them when the newer answer arrives (AF-02,
37
+ AF-07). Replacing read content with placeholders on every refresh is how a
38
+ screen flickers. A change of view or page is different: the rows on screen are
39
+ removed and placeholders stand in their place (AF-04).
40
+
41
+ A control that starts a request waits on it: it is in its `loading` state from
42
+ activation until the answer, refuses a second activation and shows the
43
+ family's indicator (AF-03).
44
+
45
+ ## 2. Placeholders are the anatomy, not rectangles
46
+
47
+ Placeholders are the same layout as the content, drawn in one colour. Build
48
+ them from the loaded markup:
49
+
50
+ 1. Keep the container, the parts, the grid, the inset and the gap tokens the
51
+ loaded content uses. Copy the structure; replace only what carries data.
52
+ 2. Text becomes `skeleton` text lines at the same type size, so the reserved
53
+ height is the height the text will take.
54
+ 3. Media — avatar, thumbnail, chart — becomes a shape of its own measured box.
55
+ 4. Repetition takes the real count: a list reserves the rows its first page
56
+ returns, a table reserves its columns at their real widths, a card reserves
57
+ the avatar and the two lines that card holds.
58
+ 5. Stop where the reader stops. A row's badge, a trailing icon and a caption
59
+ belong to the loaded row, not to its placeholder.
60
+
61
+ Line lengths vary the way text varies: the last line of a paragraph is short,
62
+ a name is shorter than a description. A stack of bars of equal length is the
63
+ defect this section names.
64
+
65
+ ### What never gets placeholders
66
+
67
+ Chrome that is already painted renders with its real content: the application
68
+ bar, the navigation column, the page header's title, a toolbar, a tab strip, a
69
+ section heading. Only what is being fetched is reserved. An action nobody can
70
+ press yet is absent, not drawn as a placeholder.
71
+
72
+ ## 3. The test: nothing moves
73
+
74
+ The pending state and the loaded state occupy the same boxes. Capture both at
75
+ the same width, in the same scheme, and compare their bounding boxes: any box
76
+ that moves between them is a defect.
77
+
78
+ Where the two cannot match exactly — an unknown number of rows, a description
79
+ of unknown length — reserve the smaller of the two and let the content grow
80
+ downward, never a box that shrinks.
81
+
82
+ ## 4. Timing
83
+
84
+ - A region's placeholders appear at once; they are never delayed (AF-05).
85
+ - A control's indicator may wait for the family's `loadingDelay`, so a request
86
+ that answers first shows no indicator; the control still refuses a second
87
+ activation (AF-05).
88
+ - Once painted, placeholders stay for one minimum duration the application
89
+ states once for the whole product — the `minDuration` of `skeleton` and
90
+ `loading-overlay` — even when the answer has already arrived (AF-06).
91
+
92
+ ## 5. Announcement and focus
93
+
94
+ - Placeholders are out of the accessibility tree. They describe nothing; the
95
+ region says what is happening.
96
+ - One announcement per region, `polite`, once — not one per placeholder.
97
+ `skeleton` and `loading-overlay` announce through their `live` axis, `polite`
98
+ by default: keep it on the one that stands for the region and set it to `off`
99
+ on every other placeholder in that region.
100
+ - The region carries `aria-busy` while it waits and drops it when the answer
101
+ arrives.
102
+ - Focus does not move, on entry or on arrival. Content that lands under the
103
+ reader's focus does not take it, and a placeholder never holds a tab stop.
104
+
105
+ ## 6. Motion
106
+
107
+ One shimmer per region, from the family's own animation, not one per bar.
108
+ Under `prefers-reduced-motion: reduce` the animation stops and the reserved
109
+ shape stays.
110
+
111
+ ## 7. Pending, empty and error are three states
112
+
113
+ | State | What it says | What it offers |
114
+ | ---------- | ----------------------------------------- | ----------------------------------------- |
115
+ | Pending | the answer is coming | nothing to press |
116
+ | Empty | an answer arrived and it holds zero items | the action that creates the first one |
117
+ | No results | the filter excluded everything | clearing the filter |
118
+ | Error | the answer did not arrive | retry; the data that is still valid stays |
119
+
120
+ The empty state appears only after an answer holding zero items, never while
121
+ the first answer is pending (AF-01). Empty, no results and error are drawn by
122
+ `result-state`. An error replaces the indicator; it never leaves placeholders
123
+ animating behind a message.
124
+
125
+ ## 8. Before calling a wait done
126
+
127
+ - [ ] The indicator matches the wait, by the table in section 1, and there is
128
+ only one.
129
+ - [ ] Placeholders mirror the anatomy: same parts, same grid, same tokens, real
130
+ counts.
131
+ - [ ] Loaded and pending captured at the same width: no box moves.
132
+ - [ ] Line lengths vary; no stack of equal bars.
133
+ - [ ] Chrome that already exists is painted with its real content.
134
+ - [ ] Placeholders are not delayed; the minimum duration is stated once.
135
+ - [ ] One polite announcement per region, `aria-busy` on the region, focus
136
+ untouched.
137
+ - [ ] Reduced motion stops the animation and keeps the shape.
138
+ - [ ] Empty, no results and error are distinct states, each with its next step.
139
+ - [ ] Each `Check` of AF-01 to AF-07 passes.
@@ -10,6 +10,7 @@
10
10
  "tone": [
11
11
  "accent",
12
12
  "secondary",
13
+ "neutral",
13
14
  "success",
14
15
  "warning",
15
16
  "danger"
@@ -83,7 +83,7 @@ Excerpt — not a complete module
83
83
 
84
84
  | Axis | Values | Default |
85
85
  | --- | --- | --- |
86
- | `tone` | `accent`, `secondary`, `success`, `warning`, `danger` | `accent` |
86
+ | `tone` | `accent`, `secondary`, `neutral`, `success`, `warning`, `danger` | `accent` |
87
87
  | `variant` | `solid`, `outline`, `ghost` | `solid` |
88
88
  | `size` | `sm`, `md`, `lg` | `md` |
89
89
 
@@ -356,6 +356,7 @@
356
356
  "--slotted-font-size-xs",
357
357
  "--slotted-font-weight-medium",
358
358
  "--slotted-font-weight-semibold",
359
+ "--slotted-letter-spacing-tighter",
359
360
  "--slotted-line-height-2xl",
360
361
  "--slotted-line-height-3xl",
361
362
  "--slotted-line-height-4xl",
@@ -428,6 +429,7 @@
428
429
  "--slotted-stat-card-value-line-height-sm",
429
430
  "--slotted-surface-raised",
430
431
  "--slotted-surface-sunken",
432
+ "--slotted-target-comfortable",
431
433
  "--slotted-text",
432
434
  "--slotted-text-muted",
433
435
  "--slotted-tone-accent-text",
package/docs/stat-card.md CHANGED
@@ -110,7 +110,7 @@ Excerpt — not a complete module
110
110
 
111
111
  ## Tokens
112
112
 
113
- `--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-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-text`, `--slotted-text-muted`, `--slotted-tone-accent-text`, `--slotted-tone-danger-text`, `--slotted-tone-secondary-text`, `--slotted-tone-success-text`, `--slotted-tone-warning-text`
113
+ `--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-secondary-text`, `--slotted-tone-success-text`, `--slotted-tone-warning-text`
114
114
 
115
115
  ## Examples
116
116
 
@@ -742,7 +742,7 @@ export class TableExpansion {
742
742
 
743
743
  ### A header, a summary and a column that stay
744
744
 
745
- stickyHeader holds the head against the top of the scroller and stickyFooter holds the summary against the bottom of it, so the total is on screen at the first row and the last. stickyTo says which box that is: this table own scroller, or whatever scrolls outside it. A pinned column darkens its edge exactly while something is hidden under it, and all of it mirrors in a right-to-left document.
745
+ stickyHeader holds the head against the top of the scroller and stickyFooter holds the summary against the bottom of it, so the total is on screen at the first row and the last. stickyTo says which box that is: this table own scroller, or whatever scrolls outside it. Under stickyTo="page" the head stops at --slotted-table-sticky-offset, which a page binds to its own chrome; a table inside a scrolling box of its own sets that token to 0 on the box. A pinned column darkens its edge exactly while something is hidden under it, and all of it mirrors in a right-to-left document.
746
746
 
747
747
  Example
748
748