@gopherium/godmin 0.27.0 → 0.29.0

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.
@@ -44,13 +44,14 @@ Except on a toast, every ring godmin draws is the same line,
44
44
  | The menu button of the top bar | Inside the button |
45
45
  | The title link of a `godmin-table`, a `godmin-table-scroll` box and a row of `RepeatRows` | 2px outside the part |
46
46
  | A page tab | Around its label, not around the whole height of the tab |
47
- | A toast | Its own rings, as [toasts](../loading-and-feedback.md#toasts) lists. A plain toast and its close button keep the browser's ring too |
47
+ | A toast | Its own rings, as [keyboard](./toasts.md#keyboard) on the toasts page shows. A plain toast keeps the browser's ring too |
48
48
 
49
49
  godmin turns the browser's own ring off in three places only. A page
50
50
  tab draws its own ring around the label instead. Back draws none on a
51
- mouse focus. The toast region draws none, because only code ever
52
- focuses it. Draw a ring of your own with the same line, on
53
- `:focus-visible`, so it matches.
51
+ mouse focus. The toast region draws none. Tab never stops on it, and
52
+ only a toast that leaves or a click on a toast focuses it. Draw a
53
+ ring of your own with the same line, on `:focus-visible`, so it
54
+ matches.
54
55
 
55
56
  ## Where focus goes
56
57
 
@@ -70,9 +71,8 @@ The title of a sidebar screen never takes focus.
70
71
  Some parts go away while they hold focus. godmin then moves focus to
71
72
  a part that stays, so the keyboard reader keeps their place:
72
73
 
73
- - A toast that leaves, as
74
- [how a toast behaves](../loading-and-feedback.md#how-a-toast-behaves)
75
- says.
74
+ - A toast that leaves, as [keyboard](./toasts.md#keyboard) on the
75
+ toasts page says.
76
76
  - A list row that a run moved, as
77
77
  [running an action over the picked rows](../lists.md#running-an-action-over-the-picked-rows)
78
78
  says.
@@ -108,13 +108,11 @@ no region. So a screen reader meets the sidebar under one name only.
108
108
  pass `label`.
109
109
 
110
110
  Every control godmin draws is named in words. A glyph, a small
111
- picture such as an icon or a cross, is never the name:
111
+ picture such as an icon, is never the name:
112
112
 
113
113
  - Every icon godmin draws itself, such as a row icon, a chevron, the
114
114
  Back glyph or the menu glyph, is hidden from screen readers. The
115
115
  control around it carries the name.
116
- - The cross on a toast is named by `dismissLabel`, never read as a
117
- cross.
118
116
  - The initials avatar is hidden, because the name beside it already
119
117
  says who it is.
120
118
 
@@ -132,16 +130,18 @@ So the sidebar rows, the page tabs and a log list keep
132
130
  ## What a screen reader hears
133
131
 
134
132
  godmin gives a sentence for the ear wherever the eye gets a shape, a
135
- glyph or a bare number. Visually hidden text is text on the page that
133
+ glyph or a bare number. A list that loads is the one exception, as
134
+ in WordPress. Visually hidden text is text on the page that
136
135
  only a screen reader meets. Some things appear without the reader
137
- moving to them, such as a toast or a loading ghost. A screen reader
136
+ moving to them, such as a toast or a loading screen. A screen reader
138
137
  learns of those through a live region, a part of the page it reads
139
138
  aloud when it changes.
140
139
 
141
140
  | Part | What a screen reader hears | Set up in |
142
141
  | --- | --- | --- |
143
- | A toast | Its message, politely. Never its buttons | [How a toast behaves](../loading-and-feedback.md#how-a-toast-behaves) |
144
- | A loading ghost | The `label` sentence, from a visually hidden status. The grey shapes are hidden | [The ghosts](../loading-and-feedback.md#the-ghosts) |
142
+ | A toast | Its message, politely. Never its action | [What a screen reader hears](./toasts.md#what-a-screen-reader-hears) |
143
+ | A loading screen | The `label` sentence, from a visually hidden status. The spinner is hidden | [What a screen reader hears](./loading.md#what-a-screen-reader-hears) |
144
+ | A list that loads | Nothing on its first load, as in WordPress. A table or a grid is marked busy on a later load | [What a screen reader hears](./loading.md#what-a-screen-reader-hears) |
145
145
  | A count beside a row | The `label` sentence, in place of the bare number | [A count beside a row](../framing-an-application.md#a-count-beside-a-row) |
146
146
  | An `ErrorNotice` | Its message, at once, as an alert | [ErrorNotice](../screens.md#errornotice) |
147
147
 
@@ -174,11 +174,11 @@ translates them.
174
174
  [godmin's own words](../framing-an-application.md#godmins-own-words)
175
175
  lists them and the languages they ship in. The props `label`,
176
176
  `menuLabel` and `backLabel` put your own words in their place. One
177
- default stays in English: the close button of a toast is named
178
- Dismiss until you pass `dismissLabel`, as
179
- [how a toast behaves](../loading-and-feedback.md#how-a-toast-behaves)
177
+ default stays in English: the hint a toast with no action gives a
178
+ screen reader, until you pass `dismissLabel`, as
179
+ [what a screen reader hears](./toasts.md#what-a-screen-reader-hears)
180
180
  says. Every other word comes from your app, such as the `label` of a
181
- loading ghost or a count. Pass each one through your translations.
181
+ loading screen or a count. Pass each one through your translations.
182
182
 
183
183
  A translated label may be longer than the English one, so godmin
184
184
  gives no label a fixed width:
@@ -187,18 +187,14 @@ gives no label a fixed width:
187
187
  leave. A longer label wraps, and the row grows, since the row sets
188
188
  only a smallest height.
189
189
  - A long title on a sidebar screen breaks onto the next line.
190
- - A toast grows with its message up to its widest, then wraps, even
191
- inside a long word. The aside of a page and a log list break a long
192
- word the same way.
190
+ - A toast grows with its message, then wraps, as
191
+ [size](./toasts.md#size) on the toasts page shows. The aside of a
192
+ page and a log list break a long word the same way.
193
193
  - The actions of a page header move under the title once they no
194
194
  longer fit beside it. A form row and the header line of a log list
195
195
  wrap the same way.
196
196
  - The page tabs keep each label on one line. A tab row too long for
197
197
  its page scrolls and fades the edge it cuts.
198
- - Where a toast cuts a name, it counts the characters a reader sees,
199
- so an emoji is never split.
200
- [Naming an item in a toast](../lists.md#naming-an-item-in-a-toast)
201
- shows it.
202
198
 
203
199
  In a right-to-left language the chevrons, the sub menu slide and the
204
200
  fade of the tab row turn around, as
@@ -61,7 +61,7 @@ The theme provider also checks contrast when it works out colors from a seed. It
61
61
 
62
62
  A raw color is a value written out, such as `#fff`, in place of a token. It stays the same whatever the seeds. `base.css` writes a few on purpose:
63
63
 
64
- - The toast box is `rgb(0 0 0 / 0.85)`, a black that lets a blur of the page show through. Its text and its focus lines are `#fff`. These are the colors of the WordPress snackbar. [Toasts](../loading-and-feedback.md#toasts) describes the rest of the toast.
64
+ - A toast paints raw colors too: a see-through black box, white text and a white focus line, the colors of the WordPress snackbar. [Colors, corners and shadow](./toasts.md#colors-corners-and-shadow) gives each value.
65
65
  - The backdrop is the dark layer behind the open drawer. It is `#000` at 0.5 opacity, as in the new WordPress admin. godmin sets the opacity through `--backdrop-opacity`. The `@wordpress/ui` drawer fades its black backdrop to that value, so the fade in and out still run.
66
66
  - Shadows are black at a low opacity. [Elevation](./radius-and-elevation.md#elevation) lists them.
67
67
  - The `#000` in `--godmin-page-tabs-fade` and `--godmin-page-tabs-fade-both` is a mask. The mask fades the ends of a long row of tabs. It paints nothing.
@@ -30,10 +30,7 @@ values. This table says where each one is set and what it changes.
30
30
 
31
31
  ## Where each one is set
32
32
 
33
- A value set on `:root` reaches every element on the page. So the
34
- toast region reads the sidebar width and the canvas margin too. When
35
- the sidebar is on screen, the region starts after it and ends where
36
- the canvas ends, so the toasts stay centered on the canvas.
33
+ A value set on `:root` reaches every element on the page.
37
34
 
38
35
  To change one of the four on `:root`, write a plain rule in your own
39
36
  stylesheet. For example, a wider sidebar:
@@ -44,7 +41,7 @@ stylesheet. For example, a wider sidebar:
44
41
 
45
42
  Your rule wins over godmin's, as
46
43
  [changing the page appearance](../overview.md#changing-the-page-appearance)
47
- explains. The sidebar, the drawer and the toast region all follow it.
44
+ explains. The sidebar and the drawer both follow it.
48
45
 
49
46
  The canvas sets its two gutters on itself. So a gutter set on `:root`
50
47
  changes nothing inside the canvas. Read them inside the canvas, for
@@ -84,7 +84,7 @@ as wide. A rule for the screens below it asks for one pixel less, as
84
84
  | `SIDEBAR_BREAKPOINT` | `1024` | The sidebar becomes the top bar and the drawer |
85
85
  | `EDGE_BREAKPOINT` | `782` | The canvas meets the screen edges. It is the WordPress medium breakpoint |
86
86
  | `DENSE_BREAKPOINT` | `640` | The canvas side gutter narrows to 16px. A list from `useListView` takes its phone layout, as [the view in the address](../lists.md#the-view-in-the-address) shows. A table inside `godmin-table-scroll` scrolls sideways, as [stylesheet helpers](../screens.md#stylesheet-helpers) shows |
87
- | `SHEET_BREAKPOINT` | `600` | Dialogs rise as sheets along the bottom of the screen and toasts widen to the screen, as [a form dialog](../lists.md#a-form-dialog) and [toasts](../loading-and-feedback.md#toasts) show. It is the WordPress small breakpoint |
87
+ | `SHEET_BREAKPOINT` | `600` | Dialogs rise as sheets along the bottom of the screen and toasts widen to the screen, as [a form dialog](../lists.md#a-form-dialog) and [toasts](./toasts.md#size) show. It is the WordPress small breakpoint |
88
88
  | `TITLE_BREAKPOINT` | `404` | Nothing in the frame. The WordPress editor drops the document title from its header here, for an editor header of your own |
89
89
  | `SMALL_VIEWPORT` | `(max-width: 1023px)` | The media query the frame folds its sidebar at |
90
90
 
@@ -0,0 +1,149 @@
1
+ ---
2
+ title: Loading
3
+ description: What a list, a screen and a preview show while their data loads, how long each waits, what a screen reader hears, and what changes for a reader who asks for less motion.
4
+ ---
5
+
6
+ A screen that waits for its data shows that it is loading, as
7
+ WordPress's new admin does. A list leaves this to DataViews. Any
8
+ other screen shows a spinner. A skeleton, a grey shape that stands in
9
+ for content, shows only in a preview whose shape is known before it
10
+ loads. [Loading and feedback](../loading-and-feedback.md) shows how
11
+ to set each one up. This page gives every value of what a reader
12
+ sees.
13
+
14
+ ## A list
15
+
16
+ A DataViews list that gets its loading state through `isLoading`
17
+ shows it on its own, as every WordPress list does.
18
+ [A list that loads](../lists.md#a-list-that-loads) says which flag to
19
+ pass.
20
+
21
+ On the first load:
22
+
23
+ - For its first 200ms the list shows nothing under its toolbar. A
24
+ load that ends sooner shows no spinner at all.
25
+ - Then a spinner shows in the middle of the space between the toolbar
26
+ and the bottom of the canvas. The search box and the filters stay
27
+ on screen. The footer stays away until the first rows arrive.
28
+ - This spinner is the one of `@wordpress/components`, which DataViews
29
+ draws: a quarter circle in the accent color that turns over a light
30
+ grey ring.
31
+ - The first rows replace the spinner at once.
32
+
33
+ On a later load, such as another page, a search or a new sort:
34
+
35
+ - The old rows and the footer stay on screen. Nobody can click them
36
+ or reach them with Tab until the next rows arrive.
37
+ - After 400ms the rows and the footer pulse. Their opacity goes from
38
+ 1 to `0.5` and back every 1s, on an `ease-in-out` curve. A load
39
+ that ends sooner shows no pulse.
40
+ - When the last answer was empty, there are no old rows to keep. The
41
+ empty state stays on screen and pulses the same way after 400ms.
42
+ - The next rows replace the old ones at once.
43
+
44
+ ## A screen
45
+
46
+ `LoadingScreen` stands in for a screen, or for the part of a screen
47
+ whose data has not arrived. It holds the `Spinner` of
48
+ `@wordpress/ui`, a half circle that turns. It is
49
+ `--wpds-dimension-size-2xs` (16px) wide and high and drawn in
50
+ `--wpds-color-foreground-content-neutral-weak`, the muted text color.
51
+
52
+ When it shows and where it sits depend on what is around it:
53
+
54
+ - Inside a `Page` it shows at once, with no wait and no fade, as a
55
+ WordPress screen shows the spinner under its title. The spinner
56
+ sits at the top of the page content, centred across, with the
57
+ page's own gap between it and the title. The title stays on screen.
58
+ - Inside a dialog it shows at once too, and takes only the space it
59
+ gets.
60
+ - Inside a sidebar screen it shows at once too, under the screen's
61
+ title, as in the sidebar of the WordPress Site Editor. That holds
62
+ on a phone, where the sidebar opens as a drawer, and on a wide
63
+ window alike.
64
+ - Directly in the canvas, with no page around it, nothing of the
65
+ screen is known yet. It shows nothing for its first 200ms, so a
66
+ load that ends sooner shows no spinner. Then it fades in over
67
+ 500ms on the CSS `ease` curve, as the canvas loader of the
68
+ WordPress Site Editor does. It fills the canvas, the spinner sits
69
+ in the middle, and it keeps `--wpds-dimension-padding-3xl` (32px)
70
+ free on every side.
71
+ - Outside the frame, before the sidebar and the canvas are drawn, it
72
+ waits and fades in the same way. It is at least `100vh` tall, the
73
+ height of the window, as the frame is. So the spinner sits in the
74
+ middle of the window.
75
+
76
+ ## A preview whose shape is known
77
+
78
+ Some parts know their size before their data arrives, such as an
79
+ image whose width and height you already hold. Such a part may show
80
+ a skeleton in its place, as WordPress does in its style and font
81
+ previews. godmin draws no skeleton of its own. Use the `Skeleton` of
82
+ `@wordpress/ui`:
83
+
84
+ - Give it the size and the corners of the part it stands in for. It
85
+ has no size of its own.
86
+ - It is drawn in `--wpds-color-background-surface-neutral-weak` and
87
+ pulses as its package makes it pulse. In forced colors it gets a
88
+ thin border, so its shape stays visible.
89
+ - It is hidden from screen readers. Mark the part around it
90
+ `aria-busy="true"` while it loads, or give that part a visually
91
+ hidden status with a label, as `LoadingScreen` does.
92
+ - When the image arrives, the skeleton goes at once and the image may
93
+ fade in. This is the one fade WordPress gives loaded content, in
94
+ its font previews: the opacity goes from 0 to 1 over
95
+ `--wpds-motion-duration-lg` (300ms) on `--wpds-motion-easing-subtle`
96
+ (`cubic-bezier(0.15, 0, 0.15, 1)`), only when the reader allows
97
+ motion. While it loads, keep the image in the page at opacity 0,
98
+ laid over the skeleton with `position: absolute`. WordPress does so
99
+ because a lazy image with `display: none` does not load.
100
+
101
+ In godmin a list or a screen shows a spinner, even when it knows how
102
+ many rows are coming, as above. Nothing else fades in when it
103
+ arrives.
104
+
105
+ ## Moving between pages
106
+
107
+ These follow
108
+ [`routerDefaults()`](../framing-an-application.md#routes-and-the-frame):
109
+
110
+ - The page on screen stays until the next one has its code and the
111
+ data its route loader waits for. No loading screen shows in
112
+ between.
113
+ - A page starts to load when the pointer rests on its link or the
114
+ keyboard reaches it, so the wait is often over before the click.
115
+ - A loader that waits only for the small data the screen needs to
116
+ draw, and starts the rest without waiting, keeps that wait short.
117
+ [A list that loads](../lists.md#a-list-that-loads) shows how.
118
+ - A page that fetches its own data after it opens shows a list or a
119
+ screen loading, as above.
120
+ - The next page replaces the old one at once, with no fade and no
121
+ slide.
122
+
123
+ ## What a screen reader hears
124
+
125
+ - `LoadingScreen` puts its `label` in a visually hidden status, and a
126
+ screen reader reads it politely. In the canvas and outside the
127
+ frame the status is there during the wait too. The spinner itself
128
+ is hidden.
129
+ - A list says nothing while it loads for the first time, as in
130
+ WordPress. Its spinner is hidden from screen readers.
131
+ - During a later load a table or a grid is marked busy. A screen
132
+ reader may say so when the reader moves into it. The other layouts
133
+ are not marked.
134
+
135
+ ## Reduced motion
136
+
137
+ [Reduced motion](./motion.md#reduced-motion) says what changes for a
138
+ reader who asks for less motion. While a list or a screen loads:
139
+
140
+ - Both spinners keep turning, as WordPress keeps them. A spinner that
141
+ stood still would look like a page that froze.
142
+ - A list does not pulse. Its old rows and its footer stay at `0.5`
143
+ opacity until the next rows arrive.
144
+ - A loading screen in the canvas or outside the frame keeps its wait,
145
+ since a wait is no motion, and then shows at once with no fade.
146
+ Inside a `Page`, a sidebar screen or a dialog nothing changes, since
147
+ it never moves.
148
+ - A skeleton stops its pulse. Its package does that on its own.
149
+ - An image takes the place of its skeleton at once, with no fade.
@@ -1,34 +1,36 @@
1
1
  ---
2
2
  title: Motion
3
- description: The sidebar slide and the fades of a godmin admin, the design tokens that time them, and what changes when a reader asks for less motion.
3
+ description: The sidebar slide, the toast motion and the fade of a loading screen in a godmin admin, the design tokens that time them, and what changes when a reader asks for less motion.
4
4
  ---
5
5
 
6
6
  godmin's own motion is short and small. The sidebar slides a new
7
- menu screen in. Toasts fade in and out. Ghosts, the grey shapes shown
8
- while data loads, fade in, and so does the content that replaces
9
- them. godmin's stylesheet animates nothing else. It sets no
10
- transitions, so its own hover and focus looks change at once.
7
+ menu screen in. Toasts grow in and fade, and the toasts around them
8
+ slide along. A loading screen that fills the canvas or stands outside
9
+ the frame waits a moment, then fades in. godmin's stylesheet animates
10
+ nothing else. It sets no transitions, so its own hover and focus
11
+ looks change at once.
11
12
 
12
13
  Parts that WordPress packages draw keep the motion those packages
13
- give them. These include the dialogs, the drawer on a small screen
14
- and the bars inside a ghost.
14
+ give them. These include the dialogs, the drawer on a small screen,
15
+ the spinners and the pulse of a list that loads.
15
16
 
16
17
  ## The tokens
17
18
 
18
19
  A design token is a value the WordPress Design System names, written
19
20
  as a CSS custom property. A custom property is a CSS variable. A
20
21
  duration is how long an animation takes. An easing is the curve its
21
- speed follows from start to end. godmin times its fades with three
22
+ speed follows from start to end. godmin times its motion with three
22
23
  design tokens:
23
24
 
24
25
  | Token | Value | What it times |
25
26
  | --- | --- | --- |
26
- | `--wpds-motion-duration-md` | 200ms | A toast, a ghost or new content fading in |
27
- | `--wpds-motion-duration-sm` | 100ms | A toast fading out |
28
- | `--wpds-motion-easing-balanced` | `cubic-bezier(0.4, 0, 0.2, 1)` | Every fade |
27
+ | `--wpds-motion-duration-lg` | 300ms | Toast motion, see [Motion](./toasts.md#motion) |
28
+ | `--wpds-motion-duration-sm` | 100ms | Toast motion, see [Motion](./toasts.md#motion) |
29
+ | `--wpds-motion-duration-xs` | 50ms | Toast motion, see [Motion](./toasts.md#motion) |
29
30
 
30
- Two lengths have no token: the sidebar slide and the wait before a
31
- ghost shows. The sections below cover both.
31
+ Some values have no token: the sidebar slide, the wait and the fade
32
+ of a loading screen, and the rest of the toast motion. The sections
33
+ below cover them.
32
34
 
33
35
  ## The sidebar slide
34
36
 
@@ -69,48 +71,37 @@ shows how.
69
71
 
70
72
  ## Toasts
71
73
 
72
- A toast fades in when it arrives. When it leaves, it fades out and
73
- stays hidden at the end. A leaving toast stays on the page until its
74
- fade ends. Nobody can press it in that time. If the browser cuts the
75
- fade short, the toast still goes.
76
- [How a toast behaves](../loading-and-feedback.md#how-a-toast-behaves)
77
- says how long a toast stays before it leaves.
74
+ Toasts move as the WordPress snackbar does. An arriving toast grows
75
+ its space in the column and fades in. A leaving toast fades out, then
76
+ its space closes. So the other toasts slide instead of jumping.
77
+ [Motion](./toasts.md#motion) on the toasts page gives every duration
78
+ and curve, and says what a leaving toast does.
78
79
 
79
80
  ## Loading
80
81
 
81
- `LoadingScreen` and `LoadingRows` draw the ghosts, as
82
- [the ghosts](../loading-and-feedback.md#the-ghosts) shows.
83
-
84
- A ghost starts transparent. It waits a short delay, then fades in and
85
- stays visible. A load that ends within the delay shows no ghost at
86
- all.
87
- [Why a ghost does not appear immediately](../loading-and-feedback.md#why-a-ghost-does-not-appear-immediately)
88
- gives the delay and the reason for it. The bars inside a ghost are
89
- the `Skeleton` of `@wordpress/ui`, and they pulse the way that
90
- package pulses them.
91
-
92
- Content with the `godmin-arrival` class fades in the same way, with
93
- no delay.
94
- [Fading the content in](../loading-and-feedback.md#fading-the-content-in)
95
- shows where to put the class.
82
+ A spinner turns while a list or a screen loads, and the old rows of a
83
+ list pulse while the next ones load. Both come from WordPress
84
+ packages. A loading screen that fills the canvas or stands outside
85
+ the frame waits, then fades in. [Loading](./loading.md) gives how
86
+ long each one waits and how it moves.
96
87
 
97
88
  ## Reduced motion
98
89
 
99
90
  A reader can ask their system for less motion. The browser then
100
91
  reports `prefers-reduced-motion: reduce` to CSS, and godmin changes
101
- two things:
102
-
103
- - The fades of toasts, ghosts and new content last 1ms. They still
104
- run and still end. So a leaving toast still goes, and a ghost
105
- still waits its delay and then stays visible.
92
+ three things:
93
+
94
+ - A loading screen that fills the canvas or stands outside the frame
95
+ shows at once when its wait ends, with no fade. Its wait stays, so
96
+ a fast load still shows nothing.
97
+ - Every toast animation lasts 1ms and starts at once, with no wait.
98
+ It still runs and still ends, so a leaving toast still goes. A toast
99
+ shows in its place at once and goes at once, and the toasts above
100
+ move in one step, as in WordPress.
106
101
  - The sidebar slide lasts 0s, as in the WordPress Site Editor, even
107
102
  when you set your own slide duration. It does not play, and the new
108
103
  screen shows at once in its place.
109
104
 
110
- These rules change only how long each animation lasts. They keep
111
- the delay, the animation itself, and the setting that holds a ghost
112
- visible after its fade. Turning the animation off would leave a
113
- ghost transparent for good.
114
-
115
- The bars inside a ghost stop their pulse too. Their WordPress
116
- package does that on its own.
105
+ Loading keeps its spinners turning, and a list holds its old rows
106
+ still. [Reduced motion](./loading.md#reduced-motion) on the loading
107
+ page says what loading does.
@@ -8,10 +8,10 @@ godmin looks. It says where each part of the screen sits, how big
8
8
  things are, how they move and which colors they take. A new product
9
9
  can follow these pages without reading any godmin code.
10
10
 
11
- These pages hold the values the whole admin shares. A value that
12
- belongs to one part, such as the size of a
13
- [toast](../loading-and-feedback.md#toasts), sits on the page that
14
- shows how to use that part.
11
+ These pages hold the values the whole admin shares. A part with a
12
+ page of its own, such as [toasts](./toasts.md), keeps its values
13
+ there. Every other part keeps its values on the page that shows how
14
+ to use it.
15
15
 
16
16
  godmin builds on the WordPress Design System, WPDS for short. For
17
17
  layout, sizes and motion it follows WordPress's new admin and the
@@ -99,3 +99,13 @@ layer.
99
99
  landmarks, what a screen reader hears, and text length.
100
100
  - [Custom properties](./custom-properties.md): every godmin custom
101
101
  property, where it is set and what it changes.
102
+
103
+ Two more pages cover a single part each, how it looks and how it
104
+ behaves:
105
+
106
+ - [Toasts](./toasts.md): where a toast sits, how it looks, how long it
107
+ stays, how a reader clears it, and what a keyboard or a screen reader
108
+ meets.
109
+ - [Loading](./loading.md): what a list, a screen and a preview show
110
+ while their data loads, how long each waits and what a screen reader
111
+ hears.
@@ -23,8 +23,8 @@ presets.
23
23
  | --- | --- | --- |
24
24
  | `--wpds-border-radius-xl` (12px) | Page and app shell surfaces | The canvas, the panel that shows the active screen |
25
25
  | `--wpds-border-radius-lg` (8px) | Cards, dialogs, notices and other larger containers | A `LogList`, the box of items shown one under the other |
26
- | `--wpds-border-radius-md` (4px) | Menus, popovers and other small overlays | A toast, the short message near the bottom of the screen |
27
- | `--wpds-border-radius-sm` (2px) | Buttons, inputs and compact controls | A sidebar row, the Back button of a sidebar screen, the grey bars of a loading ghost, and the focus rings of a page tab and of a toast action |
26
+ | `--wpds-border-radius-md` (4px) | Menus, popovers and other small overlays | A toast, which keeps its corners at every preset, as [toasts](./toasts.md#colors-corners-and-shadow) shows |
27
+ | `--wpds-border-radius-sm` (2px) | Buttons, inputs and compact controls | A sidebar row, the Back button of a sidebar screen, the focus ring of a page tab, and the focus ring of a toast action, which keeps its corners at every preset |
28
28
  | `--wpds-border-radius-xs` (1px) | Elements nested inside controls | Nothing of godmin's own |
29
29
 
30
30
  A surface inside another takes a smaller step than the one around
@@ -88,6 +88,11 @@ notices take the same preset as the canvas around them.
88
88
  application](../framing-an-application.md#notices-for-the-whole-application)
89
89
  shows how to pass them.
90
90
 
91
+ The toast region keeps the corners of the WordPress snackbar at every
92
+ preset `AdminRoot` sets.
93
+ [Colors, corners and shadow](./toasts.md#colors-corners-and-shadow)
94
+ gives them.
95
+
91
96
  `renderAdmin` from `@gopherium/godmin/testing` takes the same
92
97
  `cornerRadius`, so a test can draw a screen under any preset.
93
98
 
@@ -101,7 +106,7 @@ show depth:
101
106
  | Surface | Shadow |
102
107
  | --- | --- |
103
108
  | The canvas | `0 1px 2px rgb(0 0 0 / 0.08)`. None below `EDGE_BREAKPOINT` |
104
- | A toast | The WordPress small elevation, the one the snackbar uses. The snackbar is WordPress's own toast. Four layers: `0 1px 2px rgb(0 0 0 / 0.05)`, `0 2px 3px rgb(0 0 0 / 0.04)`, `0 6px 6px rgb(0 0 0 / 0.03)`, `0 8px 8px rgb(0 0 0 / 0.02)` |
109
+ | A toast | The WordPress small elevation, the one the snackbar uses. [Colors, corners and shadow](./toasts.md#colors-corners-and-shadow) writes out its four layers |
105
110
  | The navigation drawer | `2px 0 8px rgba(0, 0, 0, 0.2)`, the shadow of the phone sidebar in WordPress's new admin |
106
111
 
107
112
  A bleed canvas keeps the canvas shadow. The sidebar has no shadow.
@@ -119,7 +124,8 @@ Two more shadows draw a line, not depth:
119
124
  merges the borders of its cells, and a merged border paints badly
120
125
  on a pinned cell. [Stylesheet helpers](../screens.md#stylesheet-helpers)
121
126
  shows the table markup.
122
- - A focused toast with no action draws its focus ring as a shadow.
127
+ - A focused toast with no action draws its focus ring as a shadow, as
128
+ [keyboard](./toasts.md#keyboard) on the toasts page shows.
123
129
  [The focus ring](./accessibility.md#the-focus-ring) covers the
124
130
  other focus rings.
125
131