@synopackageland/ui 0.18.3 → 0.19.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/README.md +2 -1
- package/dist/components/composite/callout/Callout.vue.d.ts +3 -3
- package/dist/components/composite/settings-section/SettingsSection.vue.d.ts +4 -4
- package/dist/components/composite/timeline-row/TimelineRow.vue.d.ts +2 -2
- package/dist/components/containers/card/Card.vue.d.ts +4 -4
- package/dist/components/containers/expandable-item/ExpandableItem.vue.d.ts +3 -3
- package/dist/components/primitives/motion/MotionCollapse.vue.d.ts +16 -0
- package/dist/index.js +7211 -7055
- package/dist/json-preview/preview.js +4371 -4262
- package/dist/lib/motion.d.ts +33 -0
- package/dist/reka-runtime.json +1 -1
- package/dist/theme.css +1 -1
- package/dist/themes/dsm7-embedded-theme.css +1 -1
- package/dist/themes/dsm7-embedded.css +1 -1
- package/dist/themes/dsm7.css +1 -1
- package/docs/theme-hooks.md +53 -0
- package/package.json +1 -1
package/docs/theme-hooks.md
CHANGED
|
@@ -55,6 +55,7 @@ here stay implementation details and can change in any release.
|
|
|
55
55
|
| `data-ui-page-header` | `PageHeader` | present |
|
|
56
56
|
| `data-ui-page-header-meta`, `data-ui-page-header-actions` | `PageHeader`'s meta and actions areas | present |
|
|
57
57
|
| `data-page-surface` | `PageContent` | `auto`, `card`, `flat`, `none` |
|
|
58
|
+
| `data-ui-motion` | set by the app on any ancestor (an `AppRoot`, `<html>`) | `off`: the library's motion is instant inside it, as under reduced motion ([Motion](#motion)) |
|
|
58
59
|
|
|
59
60
|
### Navigation rows (`AppSidebar`, side or top)
|
|
60
61
|
|
|
@@ -166,6 +167,58 @@ The colour, radius, spacing and web tokens are listed in the
|
|
|
166
167
|
[README](../README.md#theme-override), [colour system](color-system.md) and
|
|
167
168
|
[adaptive layout](adaptive-layout.md#safe-overrides).
|
|
168
169
|
|
|
170
|
+
## Motion
|
|
171
|
+
|
|
172
|
+
The components move a little by default: dialogs and their masks fade in and
|
|
173
|
+
settle from 97 %, menus, popovers and select lists drop 4px from their trigger,
|
|
174
|
+
a notification slides 8px in, expandable bodies (`Card`, `SettingsSection`,
|
|
175
|
+
`ExpandableItem`, `Callout` details, `TimelineRow`, `FacetPanel`, `Accordion`,
|
|
176
|
+
`Fieldset`) open their height, a row the user just added fades in, and a tab
|
|
177
|
+
panel switched to rises 4px. Only opacity, transforms and height through grid
|
|
178
|
+
rows move. Exits are shorter than entrances and let clicks through at once.
|
|
179
|
+
Nothing animates on first render, and a list's first data, a refresh or paging
|
|
180
|
+
does not animate its rows.
|
|
181
|
+
|
|
182
|
+
| Token | Value | Use |
|
|
183
|
+
| --- | --- | --- |
|
|
184
|
+
| `--ui-motion-fast` | 120ms | colour and state changes, menus opening, anything closing |
|
|
185
|
+
| `--ui-motion-normal` | 180ms | dialogs opening, a new row, a tab panel, the loading mask |
|
|
186
|
+
| `--ui-motion-slow` | 240ms | height, notifications and toasts arriving, a sheet sliding in |
|
|
187
|
+
| `--ui-motion-ease-out` | `cubic-bezier(0.22, 1, 0.36, 1)` | arriving |
|
|
188
|
+
| `--ui-motion-ease-in` | `cubic-bezier(0.4, 0, 1, 1)` | leaving |
|
|
189
|
+
| `--ui-motion-ease-in-out` | `cubic-bezier(0.4, 0, 0.2, 1)` | height between two resting states |
|
|
190
|
+
|
|
191
|
+
Under `prefers-reduced-motion: reduce` all of it is instant. To turn it off
|
|
192
|
+
for part of a page, or the whole App, set `data-ui-motion="off"` on any
|
|
193
|
+
ancestor:
|
|
194
|
+
|
|
195
|
+
```vue
|
|
196
|
+
<AppRoot data-ui-motion="off">
|
|
197
|
+
<App />
|
|
198
|
+
</AppRoot>
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
## Hover hit areas
|
|
202
|
+
|
|
203
|
+
Hover never moves or resizes the element under the pointer, and the room
|
|
204
|
+
between two neighbouring rows of a list is never a dead strip. Otherwise a
|
|
205
|
+
pointer resting on the edge is inside, outside, inside again: the hover wash and
|
|
206
|
+
the hand cursor blink.
|
|
207
|
+
|
|
208
|
+
- Rows of a list carry `data-ui-hit-row` (stacked: `AppSidebar` pages, branches
|
|
209
|
+
and group toggles) or `data-ui-hit-row="inline"` (side by side: top
|
|
210
|
+
navigation, `Tabs`, `SegmentControl`). Each row's hit area reaches forward over
|
|
211
|
+
the next `--ui-hit-row-slop` (default `6px`) through an invisible `::after`, so
|
|
212
|
+
a margin or gap a theme puts between rows stays visible but clickable. The next
|
|
213
|
+
row is drawn after it, so the slop never takes a pixel from it. Put the
|
|
214
|
+
attribute on your own rows of a list to get the same; do not give those rows
|
|
215
|
+
another `::after`.
|
|
216
|
+
- A theme or App hovers with colour, shadow or outline. To lift or grow
|
|
217
|
+
something, move an inner layer (`.card:hover .icon { transform: … }`), or add
|
|
218
|
+
a `:hover::after` strip that covers the spot the element leaves.
|
|
219
|
+
`tests/hover-geometry.test.ts` fails on a `:hover` rule (or Tailwind
|
|
220
|
+
`hover:` utility) that moves or resizes the hovered element itself.
|
|
221
|
+
|
|
169
222
|
## Example: a dark top bar
|
|
170
223
|
|
|
171
224
|
```css
|