@slotted/react 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.
- package/README.md +4 -0
- package/dist/{action-bar-C7cGnEyJ.js → action-bar-OACchRZw.js} +1 -1
- package/dist/action-bar.js +1 -1
- package/dist/{action-sheet-D8Glxl7l.js → action-sheet-C60BWUW8.js} +1 -1
- package/dist/action-sheet.js +1 -1
- package/dist/{app-shell-CXwma4XA.js → app-shell-CmYvnu_7.js} +310 -310
- package/dist/app-shell.js +1 -1
- package/dist/button-Db9f3Bxn.js +99 -0
- package/dist/button.js +2 -2
- package/dist/cascader-D1AhTyBL.js +1097 -0
- package/dist/cascader.js +1 -1
- package/dist/chart-O0ZhkzJe.js +966 -0
- package/dist/chart.js +1 -1
- package/dist/{checkbox-CwUOc-3u.js → checkbox-DfxFHZaU.js} +3 -3
- package/dist/{checkbox-group-BYTjgAcX.js → checkbox-group-9sDgrV5Z.js} +2 -2
- package/dist/checkbox-group.js +1 -1
- package/dist/checkbox.js +1 -1
- package/dist/{color-picker-BlPR4g4H.js → color-picker-CwbWzCKg.js} +4 -4
- package/dist/color-picker.js +1 -1
- package/dist/{column-manager-CNZ7Xk5_.js → column-manager-CTtizVhm.js} +6 -6
- package/dist/column-manager.js +1 -1
- package/dist/{combobox-C46GRqAA.js → combobox-BVMI9lg8.js} +296 -292
- package/dist/combobox.js +1 -1
- package/dist/{command-palette-BqRyNR9Y.js → command-palette-DFLbSOiv.js} +1 -1
- package/dist/command-palette.js +1 -1
- package/dist/{context-menu-DMiHdggw.js → context-menu-BuST6W94.js} +1 -1
- package/dist/context-menu.js +1 -1
- package/dist/currency-field-DD9A5U3D.js +455 -0
- package/dist/currency-field.js +1 -1
- package/dist/dashboard-grid-CBMP_-JV.js +1043 -0
- package/dist/dashboard-grid.js +1 -1
- package/dist/{data-grid-BUgOJuGp.js → data-grid-BKaGMqIm.js} +19 -19
- package/dist/data-grid.js +1 -1
- package/dist/{data-list-2xfDpHVC.js → data-list-oICmxGkA.js} +5 -5
- package/dist/data-list.js +1 -1
- package/dist/{date-field-D_kLLTfL.js → date-field-CYcN6diW.js} +1 -1
- package/dist/date-field.js +1 -1
- package/dist/date-picker-4X-_2ltN.js +264 -0
- package/dist/date-picker.js +1 -1
- package/dist/date-range-picker-CNOAtHwU.js +471 -0
- package/dist/date-range-picker.js +1 -1
- package/dist/{datetime-field-T1gNdJ7t.js → datetime-field-B8TrmsDK.js} +1 -1
- package/dist/datetime-field.js +1 -1
- package/dist/datetime-picker-HDVlUhzy.js +629 -0
- package/dist/datetime-picker.js +1 -1
- package/dist/datetime-range-picker-IqOFJtdW.js +994 -0
- package/dist/datetime-range-picker.js +1 -1
- package/dist/{dialog-Dmy-m_pe.js → dialog-BHYDDj1S.js} +112 -113
- package/dist/dialog.js +1 -1
- package/dist/docs/AGENTS.snippet.md +10 -0
- package/dist/docs/app-shell.json +1 -1
- package/dist/docs/button-group.json +1 -0
- package/dist/docs/button-group.md +1 -1
- package/dist/docs/button.json +45 -11
- package/dist/docs/button.md +10 -6
- package/dist/docs/chart.json +7 -0
- package/dist/docs/chart.md +1 -0
- package/dist/docs/currency-field.json +32 -1
- package/dist/docs/currency-field.md +4 -1
- package/dist/docs/dialog.examples.md +26 -0
- package/dist/docs/dialog.json +14 -2
- package/dist/docs/dialog.md +1 -1
- package/dist/docs/event-calendar.json +7 -0
- package/dist/docs/event-calendar.md +1 -0
- package/dist/docs/guidelines/README.md +27 -0
- package/dist/docs/guidelines/async-feedback.md +108 -0
- package/dist/docs/guidelines/browsing.md +74 -0
- package/dist/docs/guidelines/builders.md +97 -0
- package/dist/docs/guidelines/composition.md +129 -0
- package/dist/docs/guidelines/conversations.md +59 -0
- package/dist/docs/guidelines/errors-and-conflicts.md +71 -0
- package/dist/docs/guidelines/forms.md +192 -0
- package/dist/docs/guidelines/index.md +121 -0
- package/dist/docs/guidelines/layout-alignment.md +95 -0
- package/dist/docs/guidelines/ledgers.md +45 -0
- package/dist/docs/guidelines/list-pages.md +165 -0
- package/dist/docs/guidelines/overviews.md +66 -0
- package/dist/docs/guidelines/own-elements.md +115 -0
- package/dist/docs/guidelines/reading-permissions.md +55 -0
- package/dist/docs/guidelines/record-pages.md +178 -0
- package/dist/docs/guidelines/reports.md +123 -0
- package/dist/docs/guidelines/shell-composition.md +94 -0
- package/dist/docs/guidelines/workspaces.md +46 -0
- package/dist/docs/index.md +12 -0
- package/dist/docs/list.json +26 -1
- package/dist/docs/list.md +4 -1
- package/dist/docs/popover.json +1 -1
- package/dist/docs/progress-indicator.json +1 -2
- package/dist/docs/progress-indicator.md +2 -2
- package/dist/docs/segmented-control.json +29 -1
- package/dist/docs/segmented-control.md +17 -1
- package/dist/docs/side-navigation.json +2 -2
- package/dist/docs/side-navigation.md +19 -4
- package/dist/docs/skills/build-own-element/SKILL.md +90 -0
- package/dist/docs/skills/compose-screen/SKILL.md +76 -0
- package/dist/docs/skills/index.md +9 -0
- package/dist/docs/skills/review-screen/SKILL.md +70 -0
- package/dist/docs/skills/theme-app/SKILL.md +79 -0
- package/dist/docs/skills/waiting-states/SKILL.md +139 -0
- package/dist/docs/split-button.json +1 -0
- package/dist/docs/split-button.md +1 -1
- package/dist/docs/stat-card.json +2 -0
- package/dist/docs/stat-card.md +1 -1
- package/dist/docs/table.examples.md +1 -1
- package/dist/docs/table.json +78 -2
- package/dist/docs/table.md +12 -1
- package/dist/docs/tabs.examples.md +1 -1
- package/dist/docs/tabs.json +2 -5
- package/dist/docs/tabs.md +1 -1
- package/dist/docs/toggle-group.json +14 -3
- package/dist/docs/toggle-group.md +3 -3
- package/dist/docs/toggle.json +12 -3
- package/dist/docs/toggle.md +3 -3
- package/dist/docs/tokens.md +448 -0
- package/dist/docs/top-navigation.examples.md +23 -5
- package/dist/docs/top-navigation.json +2 -2
- package/dist/docs/tour.json +1 -1
- package/dist/drawer-LXM44eso.js +757 -0
- package/dist/drawer.js +1 -1
- package/dist/entity-picker-CPDd73JR.js +1110 -0
- package/dist/entity-picker.js +1 -1
- package/dist/{event-calendar-BFdeGfC-.js → event-calendar-CnF3iIZD.js} +391 -390
- package/dist/event-calendar.js +1 -1
- package/dist/{field-BJh5HI7w.js → field-NJaCxl2h.js} +1 -1
- package/dist/{field-group-BDaspQPh.js → field-group-hAzVa2O9.js} +1 -1
- package/dist/field-group.js +1 -1
- package/dist/field.js +1 -1
- package/dist/{filter-bar-b2Q9BZHf.js → filter-bar-D_xDcAp2.js} +20 -20
- package/dist/filter-bar.js +1 -1
- package/dist/{hover-card-CSDbA6zd.js → hover-card-BJE5dtaQ.js} +1 -1
- package/dist/hover-card.js +1 -1
- package/dist/{icon-button-TnvMhK4o.js → icon-button-CCWkCDMs.js} +26 -24
- package/dist/import-export-center-DpY2DGBZ.js +813 -0
- package/dist/import-export-center.js +1 -1
- package/dist/index.js +85 -84
- package/dist/{list-C1Y8MWp2.js → list-WsQ6ZzCa.js} +16 -12
- package/dist/{list-item-DN_mcouU.js → list-item-DpCwZIrd.js} +1 -1
- package/dist/list-item.js +1 -1
- package/dist/list.js +1 -1
- package/dist/{listbox-4WvqR0JF.js → listbox-Dv856z9I.js} +1 -1
- package/dist/listbox.js +1 -1
- package/dist/{loading-overlay-B83XFctM.js → loading-overlay-COfnckse.js} +73 -73
- package/dist/loading-overlay.js +1 -1
- package/dist/{markdown-CpfDn1LF.js → markdown-CeG8mUbI.js} +2 -2
- package/dist/markdown.js +1 -1
- package/dist/menu-parts-W58pVNUt.js +786 -0
- package/dist/menu.js +1 -1
- package/dist/{menubar-CtGavUTO.js → menubar-b2CruimJ.js} +1 -1
- package/dist/menubar.js +1 -1
- package/dist/{multi-select-CfzsvAeI.js → multi-select-DQ5ds0fX.js} +432 -437
- package/dist/multi-select.js +1 -1
- package/dist/{notification-center-C4pEHJ3h.js → notification-center-Sz54IziY.js} +2 -2
- package/dist/notification-center.js +1 -1
- package/dist/{number-field-J_koud1r.js → number-field-BFIAmv-z.js} +1 -1
- package/dist/number-field.js +1 -1
- package/dist/{otp-input-Bf8JUiVR.js → otp-input-BNQhuKaT.js} +1 -1
- package/dist/otp-input.js +1 -1
- package/dist/popover-Be7JWbGJ.js +475 -0
- package/dist/popover.js +1 -1
- package/dist/press-selection-DjOllE2B.js +29 -0
- package/dist/press-selection.js +2 -0
- package/dist/{prompt-composer-B7MMcER0.js → prompt-composer-BxpdkTpZ.js} +1 -1
- package/dist/prompt-composer.js +1 -1
- package/dist/{radio-group-BFpjhDkV.js → radio-group-BaVIP9UH.js} +2 -2
- package/dist/radio-group.js +1 -1
- package/dist/{rating-D1EsADFM.js → rating-DYBQBzwB.js} +1 -1
- package/dist/rating.js +1 -1
- package/dist/{saved-views-BueW-Lyb.js → saved-views-DlE_--Z9.js} +5 -5
- package/dist/saved-views.js +1 -1
- package/dist/{segmented-control-Cy_5D3Nj.js → segmented-control-DmuOGiu6.js} +28 -24
- package/dist/segmented-control.js +1 -1
- package/dist/{select-UTwKjheK.js → select-DOFqPy26.js} +334 -347
- package/dist/select.js +1 -1
- package/dist/{side-navigation-YUiJRpng.js → side-navigation-CBLtCzuJ.js} +186 -187
- package/dist/side-navigation.js +1 -1
- package/dist/{slider-B432T6nD.js → slider-DTes4HLF.js} +1 -1
- package/dist/slider.js +1 -1
- package/dist/{split-button-DHF3v3PJ.js → split-button-CPgHiy9G.js} +2 -2
- package/dist/split-button.js +1 -1
- package/dist/styles.css +1 -1
- package/dist/{switch-4MHwKmkz.js → switch-DQzuIhPX.js} +1 -1
- package/dist/switch.js +1 -1
- package/dist/{table-CzBIw9ng.js → table-Cipi2c5X.js} +206 -173
- package/dist/table.js +2 -2
- package/dist/{tags-input-DLdHLWrH.js → tags-input-CcOkm0AW.js} +1 -1
- package/dist/tags-input.js +1 -1
- package/dist/{text-field-BktZbmzD.js → text-field-DLfIZ0fk.js} +1 -1
- package/dist/text-field.js +1 -1
- package/dist/{textarea-JAK2RJl0.js → textarea-CBJBJBi6.js} +1 -1
- package/dist/textarea.js +1 -1
- package/dist/{time-field-DCG_VtGO.js → time-field-DrhiCtUl.js} +1 -1
- package/dist/time-field.js +1 -1
- package/dist/{time-picker-DuT1tf5-.js → time-picker-CRQsMJbQ.js} +102 -102
- package/dist/time-picker.js +1 -1
- package/dist/{time-range-picker-HwBvrrXN.js → time-range-picker-DlZJsj1e.js} +202 -202
- package/dist/time-range-picker.js +1 -1
- package/dist/{toast-wI8BtPY5.js → toast-Bf3e0AgC.js} +157 -157
- package/dist/toast.js +1 -1
- package/dist/toggle-group-7iBR9Rn1.js +142 -0
- package/dist/toggle-group.js +1 -1
- package/dist/{toolbar-CDQTydDx.js → toolbar-DDZpEftQ.js} +1 -1
- package/dist/toolbar.js +1 -1
- package/dist/{tooltip-BggqPDcW.js → tooltip-DbKTPe_i.js} +108 -109
- package/dist/tooltip.js +1 -1
- package/dist/{top-navigation-COQZsNqW.js → top-navigation-e-tWMGNr.js} +255 -256
- package/dist/top-navigation.js +1 -1
- package/dist/{tour-C11DmYTC.js → tour-BTdt716T.js} +180 -180
- package/dist/tour.js +1 -1
- package/dist/{transfer-JA9TWjAw.js → transfer-CqZOTLMP.js} +6 -6
- package/dist/transfer.js +1 -1
- package/dist/types/app-shell/app-shell.d.ts.map +1 -1
- package/dist/types/button/button-link.d.ts +1 -1
- package/dist/types/button/button-link.d.ts.map +1 -1
- package/dist/types/button/button-root.d.ts +5 -3
- package/dist/types/button/button-root.d.ts.map +1 -1
- package/dist/types/button/button.constants.d.ts +2 -1
- package/dist/types/button/button.constants.d.ts.map +1 -1
- package/dist/types/button/button.d.ts +1 -1
- package/dist/types/button/button.d.ts.map +1 -1
- package/dist/types/button/button.types.d.ts +9 -2
- package/dist/types/button/button.types.d.ts.map +1 -1
- package/dist/types/button/index.d.ts +1 -1
- package/dist/types/button/index.d.ts.map +1 -1
- package/dist/types/button/toggle-button.d.ts +1 -1
- package/dist/types/button/toggle-button.d.ts.map +1 -1
- package/dist/types/chart/chart.d.ts.map +1 -1
- package/dist/types/combobox/combobox-collection.d.ts +1 -0
- package/dist/types/combobox/combobox-collection.d.ts.map +1 -1
- package/dist/types/combobox/combobox-parts.d.ts.map +1 -1
- package/dist/types/combobox/combobox.d.ts.map +1 -1
- package/dist/types/currency-field/currency-field.d.ts +1 -1
- package/dist/types/currency-field/currency-field.d.ts.map +1 -1
- package/dist/types/currency-field/currency-field.types.d.ts +14 -0
- package/dist/types/currency-field/currency-field.types.d.ts.map +1 -1
- package/dist/types/currency-field/index.d.ts +1 -1
- package/dist/types/currency-field/index.d.ts.map +1 -1
- package/dist/types/dashboard-grid/dashboard-grid.d.ts.map +1 -1
- package/dist/types/dashboard-grid/dashboard-widget.d.ts +1 -1
- package/dist/types/dashboard-grid/dashboard-widget.d.ts.map +1 -1
- package/dist/types/dialog/dialog-demo.d.ts +8 -0
- package/dist/types/dialog/dialog-demo.d.ts.map +1 -1
- package/dist/types/drawer/drawer-parts.d.ts.map +1 -1
- package/dist/types/event-calendar/event-calendar.d.ts +1 -1
- package/dist/types/event-calendar/event-calendar.d.ts.map +1 -1
- package/dist/types/event-calendar/event-calendar.types.d.ts +6 -0
- package/dist/types/event-calendar/event-calendar.types.d.ts.map +1 -1
- package/dist/types/filter-bar/filter-bar.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/list/index.d.ts +1 -1
- package/dist/types/list/index.d.ts.map +1 -1
- package/dist/types/list/list-parts.d.ts +1 -1
- package/dist/types/list/list-parts.d.ts.map +1 -1
- package/dist/types/list/list.types.d.ts +12 -0
- package/dist/types/list/list.types.d.ts.map +1 -1
- package/dist/types/menu/menu.types.d.ts +3 -1
- package/dist/types/menu/menu.types.d.ts.map +1 -1
- package/dist/types/multi-select/multi-select-collection.d.ts +0 -2
- package/dist/types/multi-select/multi-select-collection.d.ts.map +1 -1
- package/dist/types/multi-select/multi-select-parts.d.ts.map +1 -1
- package/dist/types/multi-select/multi-select.d.ts.map +1 -1
- package/dist/types/press-selection/index.d.ts +3 -0
- package/dist/types/press-selection/index.d.ts.map +1 -0
- package/dist/types/press-selection/press-selection.d.ts +23 -0
- package/dist/types/press-selection/press-selection.d.ts.map +1 -0
- package/dist/types/segmented-control/index.d.ts +1 -1
- package/dist/types/segmented-control/index.d.ts.map +1 -1
- package/dist/types/segmented-control/segmented-control-defaults.d.ts.map +1 -1
- package/dist/types/segmented-control/segmented-control.d.ts +1 -1
- package/dist/types/segmented-control/segmented-control.d.ts.map +1 -1
- package/dist/types/segmented-control/segmented-control.types.d.ts +10 -0
- package/dist/types/segmented-control/segmented-control.types.d.ts.map +1 -1
- package/dist/types/select/select-collection.d.ts +0 -2
- package/dist/types/select/select-collection.d.ts.map +1 -1
- package/dist/types/select/select.d.ts.map +1 -1
- package/dist/types/table/index.d.ts +2 -2
- package/dist/types/table/index.d.ts.map +1 -1
- package/dist/types/table/table-parts.d.ts +8 -2
- package/dist/types/table/table-parts.d.ts.map +1 -1
- package/dist/types/table/table.types.d.ts +28 -1
- package/dist/types/table/table.types.d.ts.map +1 -1
- package/dist/types/toggle/toggle.types.d.ts +1 -1
- package/dist/types/toggle/toggle.types.d.ts.map +1 -1
- package/dist/types/toggle-group/toggle-group.d.ts.map +1 -1
- package/dist/types/toggle-group/toggle-group.types.d.ts +6 -1
- package/dist/types/toggle-group/toggle-group.types.d.ts.map +1 -1
- package/dist/{upload-Bq_UiyMr.js → upload-DjnlVR8y.js} +2 -2
- package/dist/upload.js +1 -1
- package/dist/{wizard-B4GrlEqh.js → wizard-BxA08vXt.js} +1 -1
- package/dist/wizard.js +1 -1
- package/package.json +12 -7
- package/dist/button-DakQ-7Tm.js +0 -97
- package/dist/cascader-CARCYdHh.js +0 -1097
- package/dist/chart-BNzfIfQe.js +0 -948
- package/dist/currency-field-B7OZ0hk7.js +0 -436
- package/dist/dashboard-grid-nfhEewA4.js +0 -1005
- package/dist/date-picker-DQ5SIhdA.js +0 -264
- package/dist/date-range-picker-lpB08hK_.js +0 -471
- package/dist/datetime-picker-0F0kDW-8.js +0 -629
- package/dist/datetime-range-picker-ClnEleth.js +0 -994
- package/dist/drawer-Ci3wuCVa.js +0 -758
- package/dist/entity-picker-UGhbVwkC.js +0 -1111
- package/dist/import-export-center-D8xbCLWs.js +0 -813
- package/dist/menu-parts-BQej6eU9.js +0 -787
- package/dist/popover-DE22lSpV.js +0 -476
- package/dist/react-dom-DzrKNxo6.js +0 -273
- package/dist/toggle-group-DQBlI1TV.js +0 -140
|
@@ -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/react 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/react/dist/docs/index.md` and list the families whose line is near the
|
|
15
|
+
element.
|
|
16
|
+
2. Read `node_modules/@slotted/react/dist/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/react/dist/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/react/dist/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/react/dist/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/react/dist/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/react — 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/react/dist/docs/guidelines/index.md`.
|
|
32
|
+
2. `node_modules/@slotted/react/dist/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/react/dist/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/react/dist/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/react/dist/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/react/dist/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/react 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/react — 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/react, 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/react 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/react — 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/react, 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/react/dist/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/react/dist/docs/skills/compose-screen/SKILL.md`.
|
|
20
|
+
|
|
21
|
+
## 2. Read
|
|
22
|
+
|
|
23
|
+
1. `node_modules/@slotted/react/dist/docs/guidelines/index.md` and
|
|
24
|
+
`node_modules/@slotted/react/dist/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/react/dist/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/react/dist/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/react 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 `ThemeScope` component from `@slotted/react/theme` |
|
|
19
|
+
| How tight controls and rows are | the density: `comfortable`, `compact`, `dense` | `data-slotted-density`, or the density of the `ThemeScope` component from `@slotted/react/theme` |
|
|
20
|
+
| Spacing, corners, type, lines, shadows or motion | a token of a group in `node_modules/@slotted/react/dist/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 `ThemeScope` component from `@slotted/react/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 `ThemeScope` component from `@slotted/react/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/react — 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/react/dist/docs/guidelines/async-feedback.md`. Each family
|
|
16
|
+
named here has its page: `node_modules/@slotted/react/dist/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.
|
|
@@ -78,7 +78,7 @@ Excerpt — not a complete module
|
|
|
78
78
|
|
|
79
79
|
| Axis | Values | Default |
|
|
80
80
|
| --- | --- | --- |
|
|
81
|
-
| `tone` | `accent`, `secondary`, `success`, `warning`, `danger` | `accent` |
|
|
81
|
+
| `tone` | `accent`, `secondary`, `neutral`, `success`, `warning`, `danger` | `accent` |
|
|
82
82
|
| `variant` | `solid`, `outline`, `ghost` | `solid` |
|
|
83
83
|
| `size` | `sm`, `md`, `lg` | `md` |
|
|
84
84
|
|
package/dist/docs/stat-card.json
CHANGED
|
@@ -354,6 +354,7 @@
|
|
|
354
354
|
"--slotted-font-size-xs",
|
|
355
355
|
"--slotted-font-weight-medium",
|
|
356
356
|
"--slotted-font-weight-semibold",
|
|
357
|
+
"--slotted-letter-spacing-tighter",
|
|
357
358
|
"--slotted-line-height-2xl",
|
|
358
359
|
"--slotted-line-height-3xl",
|
|
359
360
|
"--slotted-line-height-4xl",
|
|
@@ -426,6 +427,7 @@
|
|
|
426
427
|
"--slotted-stat-card-value-line-height-sm",
|
|
427
428
|
"--slotted-surface-raised",
|
|
428
429
|
"--slotted-surface-sunken",
|
|
430
|
+
"--slotted-target-comfortable",
|
|
429
431
|
"--slotted-text",
|
|
430
432
|
"--slotted-text-muted",
|
|
431
433
|
"--slotted-tone-accent-text",
|
package/dist/docs/stat-card.md
CHANGED
|
@@ -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-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`
|
|
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-secondary-text`, `--slotted-tone-success-text`, `--slotted-tone-warning-text`
|
|
118
118
|
|
|
119
119
|
## Examples
|
|
120
120
|
|
|
@@ -688,7 +688,7 @@ export default function TableExpansion() {
|
|
|
688
688
|
|
|
689
689
|
### A header, a summary and a column that stay
|
|
690
690
|
|
|
691
|
-
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.
|
|
691
|
+
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.
|
|
692
692
|
|
|
693
693
|
Example
|
|
694
694
|
|