@fusion.dev/helix-docs 0.246.0 → 0.247.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/content/metrics.mdx +285 -282
- package/content/motion.mdx +170 -10
- package/content/overlays.mdx +5 -2
- package/dist/pages.generated.js +1 -1
- package/dist/sources.generated.js +460 -294
- package/package.json +12 -12
package/content/motion.mdx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: The duration and easing tokens, how components handle reduced motion, and the functions that move your own elements.
|
|
2
|
+
description: The duration and easing tokens, how components handle reduced motion, the effects, and the functions that move your own elements.
|
|
3
3
|
section: Foundations
|
|
4
4
|
title: Motion
|
|
5
5
|
---
|
|
@@ -103,6 +103,7 @@ Anything that moves continuously without input stops completely:
|
|
|
103
103
|
- The aura shader
|
|
104
104
|
- Marquees
|
|
105
105
|
- The pulse loader
|
|
106
|
+
- The light on a `Border Beam`, whose edge is then lit steadily
|
|
106
107
|
|
|
107
108
|
The turning `Loader` slows to one turn every four seconds. A loader that stops
|
|
108
109
|
looks broken, and the turn still shows that work is in progress. The pending
|
|
@@ -184,13 +185,60 @@ stylesheet, so its stack has no hooks of this kind.
|
|
|
184
185
|
|
|
185
186
|
## The wash under the pointer
|
|
186
187
|
|
|
187
|
-
In `Navigation` and `
|
|
188
|
-
to item as a mouse or pen moves along the row, and fades out
|
|
189
|
-
leaves. It takes the place of each item's own wash, in the
|
|
190
|
-
`--navigation-item-hover-background-color
|
|
191
|
-
`--tabs-tab-hover-background-color
|
|
192
|
-
|
|
193
|
-
|
|
188
|
+
In `Navigation`, `Tabs`, and `Toggle Group`, the hover wash is one shape that
|
|
189
|
+
glides from item to item as a mouse or pen moves along the row, and fades out
|
|
190
|
+
when the pointer leaves. It takes the place of each item's own wash, in the
|
|
191
|
+
same color, from `--navigation-item-hover-background-color`,
|
|
192
|
+
`--tabs-tab-hover-background-color`, or
|
|
193
|
+
`--toggle-group-hover-background-color`. Arriving from outside the row, it
|
|
194
|
+
appears under the pointer without sliding. A touch draws no wash, and under
|
|
195
|
+
reduced motion the wash moves at once.
|
|
196
|
+
|
|
197
|
+
In `Menu`, the wash marks the row with focus, so it glides as the pointer or
|
|
198
|
+
the arrow keys move focus, and holds while the pointer crosses a divider. It
|
|
199
|
+
reads `--menu-item-hover-background-color`, and a `danger` row keeps its own
|
|
200
|
+
hue. A submenu that opens beside its row lights its own rows.
|
|
201
|
+
|
|
202
|
+
## Focus that travels
|
|
203
|
+
|
|
204
|
+
In `Toolbar`, `Tabs`, and `Toggle Group`, the focus ring is one ring that
|
|
205
|
+
travels from control to control as the arrow keys move focus, so the eye can
|
|
206
|
+
follow it along the strip. It is each control's own ring, with its corners and
|
|
207
|
+
its offset, and it shows at full strength in the frame focus arrives. It
|
|
208
|
+
follows only focus that shows, so a click draws none. Under reduced motion it
|
|
209
|
+
moves at once, and under forced colors each control draws its own system ring.
|
|
210
|
+
|
|
211
|
+
## Loading that ends in place
|
|
212
|
+
|
|
213
|
+
A `Skeleton` around content crossfades to it when you take `loading` off. The
|
|
214
|
+
placeholder fades out as the content fades in, in the same place, and the
|
|
215
|
+
box's height moves from the placeholder's to the content's over the same beat,
|
|
216
|
+
so nothing below it jumps. Setting `loading` again crossfades back. Where the
|
|
217
|
+
content is not on the page until it loads, draw the placeholder yourself in
|
|
218
|
+
the skeleton's `placeholder` slot, laid out as the content will be, and put the
|
|
219
|
+
skeleton inside the card that holds it so the card's edge moves with the box.
|
|
220
|
+
The move takes `--skeleton-reveal-duration`, `--helix-duration-slow` by
|
|
221
|
+
default, along `--skeleton-reveal-easing`, `--helix-easing-standard` by
|
|
222
|
+
default, and `0ms` turns it off. Under reduced motion the height changes at
|
|
223
|
+
once and the two sides crossfade over `--helix-duration-fade`.
|
|
224
|
+
|
|
225
|
+
## Swipes that carry through
|
|
226
|
+
|
|
227
|
+
A touch or a pen drags a `Toast` toward the edge its stack sits at, and a
|
|
228
|
+
`Drawer` toward the edge it came from. The surface follows the finger, and past
|
|
229
|
+
its open end it gives less and less. On release it keeps the speed it had. A
|
|
230
|
+
quick flick dismisses from any distance and carries the surface off the window
|
|
231
|
+
at that speed. A slow drag past halfway dismisses too, and the surface gathers
|
|
232
|
+
pace as it goes. A shorter drag springs back to rest along
|
|
233
|
+
`--helix-easing-spring`, with its speed carried in. A dismissal goes through
|
|
234
|
+
the component's own close, so a page that cancels `helix-before-close` or
|
|
235
|
+
`helix-dismiss` sends the surface back to rest. While a drag and its release
|
|
236
|
+
run, the component has `:state(dragging)`, and a drawer's backdrop fades with
|
|
237
|
+
`--drawer-drag-progress`. Under reduced motion the surface still follows the
|
|
238
|
+
finger, and then goes or returns at once. `--drawer-release-duration` and
|
|
239
|
+
`--toast-release-duration` set the longest a release takes, and `0ms` ends it
|
|
240
|
+
at once. `DragDismissController` in `@fusion.dev/helix-core` gives a component
|
|
241
|
+
of your own the same gesture.
|
|
194
242
|
|
|
195
243
|
## Figures that count
|
|
196
244
|
|
|
@@ -220,6 +268,36 @@ does not hold. The mark on the end of a line rides with it. Safari does not
|
|
|
220
268
|
transition a path's shape, so lines, areas, points, and the mark on a line's
|
|
221
269
|
end there take their new place at once.
|
|
222
270
|
|
|
271
|
+
Set `--chart-move-duration` and `--chart-move-easing` on a chart, or on an
|
|
272
|
+
element that holds several, to change how long the move takes and its curve.
|
|
273
|
+
They default to `--helix-duration-normal` and `--helix-easing-decelerate`, and
|
|
274
|
+
`0s` turns the move off. A `Line Chart` drawing its line on and an
|
|
275
|
+
`Area Chart` fading its wash in take 1.6 times the duration, as they take the
|
|
276
|
+
slow token beside the normal one, so `0s` stops them too. Under reduced
|
|
277
|
+
motion the marks take their new place at once, whatever duration you set.
|
|
278
|
+
|
|
279
|
+
As you move across a chart with the pointer or the arrow keys, what marks the
|
|
280
|
+
reading glides from one reading to the next: the guide and the band of a
|
|
281
|
+
`Line Chart`, an `Area Chart`, and a `Bar Chart`, the dot and its words on a
|
|
282
|
+
`Sparkline`, and the tooltip of every chart. The glide takes
|
|
283
|
+
`--chart-glide-duration`, `--helix-duration-fast` by default, along
|
|
284
|
+
`--helix-easing-decelerate`, and `0s` places them at once. When the pointer
|
|
285
|
+
arrives from outside the chart, or the keys reach it, each is placed on its
|
|
286
|
+
reading at once. The tooltip shows the new reading's words as it starts to
|
|
287
|
+
move.
|
|
288
|
+
|
|
289
|
+
When a `Legend` with `toggles` hides a series, the series fades out where it
|
|
290
|
+
stood over `--chart-move-duration`. A `Bar Chart`'s columns shrink to the
|
|
291
|
+
baseline, a stacked segment shrinks to nothing where it stood, an
|
|
292
|
+
`Area Chart`'s band closes, and a `Donut Chart` closes its ring over the slice. The
|
|
293
|
+
marks left and the value axis move to fit what is shown: a number that stays on
|
|
294
|
+
the axis moves to its new level with its rule, a new number fades in, and a
|
|
295
|
+
number the new scale drops fades out. A series shown again fades in and grows
|
|
296
|
+
back. The chart's summary and table say what is shown at once. In Safari, a
|
|
297
|
+
`Line Chart` and an `Area Chart` take the new scale at once with their lines,
|
|
298
|
+
and a hidden series still fades. Under reduced motion the reading's marks and a
|
|
299
|
+
hidden series take their new place at once.
|
|
300
|
+
|
|
223
301
|
## 3D charts that grow in and follow their readings
|
|
224
302
|
|
|
225
303
|
The 3D charts draw their own marks, in SVG and through three.js, so their
|
|
@@ -306,20 +384,75 @@ reduced motion or where the browser has no view transitions, and rejects
|
|
|
306
384
|
where the change does. To keep a header still while the rest of the page
|
|
307
385
|
moves, give it a `view-transition-name` of its own on every page.
|
|
308
386
|
|
|
387
|
+
## Effects
|
|
388
|
+
|
|
389
|
+
These families exist for their motion. Put your content inside one, or place
|
|
390
|
+
it on the page. Each one respects reduced motion, and each that runs by itself
|
|
391
|
+
stops while `Motion Toggle` has paused the page.
|
|
392
|
+
|
|
393
|
+
Light that draws the eye:
|
|
394
|
+
|
|
395
|
+
- [Shine](/helix/components/shine) sweeps a band of light across an action.
|
|
396
|
+
- [Border Beam](/helix/components/border-beam) sends a light around the edge
|
|
397
|
+
of something running or live.
|
|
398
|
+
- [Shimmer Text](/helix/components/shimmer-text) sweeps a light across words
|
|
399
|
+
while the work they name runs.
|
|
400
|
+
|
|
401
|
+
Following the pointer:
|
|
402
|
+
|
|
403
|
+
- [Spotlight](/helix/components/spotlight) lights the content and the edge
|
|
404
|
+
nearest the pointer.
|
|
405
|
+
- [Tilt](/helix/components/tilt) leans content toward the pointer.
|
|
406
|
+
- [Magnetic](/helix/components/magnetic) draws content a little way toward
|
|
407
|
+
the pointer.
|
|
408
|
+
|
|
409
|
+
Arriving:
|
|
410
|
+
|
|
411
|
+
- [Reveal](/helix/components/reveal) brings content in as it scrolls into
|
|
412
|
+
view.
|
|
413
|
+
- [Highlighter](/helix/components/highlighter) marks words as they come into
|
|
414
|
+
view.
|
|
415
|
+
- [Confetti](/helix/components/confetti) bursts once an action has finished.
|
|
416
|
+
|
|
417
|
+
Words and figures:
|
|
418
|
+
|
|
419
|
+
- [Rotating Text](/helix/components/rotating-text) turns one word in a line
|
|
420
|
+
through others.
|
|
421
|
+
- [Sliding Number](/helix/components/sliding-number) rolls each digit to a new
|
|
422
|
+
value.
|
|
423
|
+
|
|
424
|
+
Backgrounds and the page:
|
|
425
|
+
|
|
426
|
+
- [Aura](/helix/components/aura) drifts light in the theme's colors.
|
|
427
|
+
- [Strands](/helix/components/strands) draws a ribbon of fine strands of light.
|
|
428
|
+
- [Pattern](/helix/components/pattern) draws hexagons, stars, or contour lines.
|
|
429
|
+
- [Marquee](/helix/components/marquee) scrolls a row round and round.
|
|
430
|
+
- [Scroll Progress](/helix/components/scroll-progress) fills a bar as the page
|
|
431
|
+
scrolls.
|
|
432
|
+
- [Theme Toggle](/helix/components/theme-toggle) spreads the new color mode
|
|
433
|
+
from the button.
|
|
434
|
+
- [Cursor](/helix/components/cursor) shows another person's pointer on a
|
|
435
|
+
shared surface.
|
|
436
|
+
|
|
309
437
|
## Motion on your own elements
|
|
310
438
|
|
|
311
|
-
|
|
439
|
+
Seven functions in `@fusion.dev/helix-core` give elements you write yourself
|
|
312
440
|
the motion Helix's own families have, with no component around them:
|
|
313
441
|
|
|
314
442
|
- `moveItems` slides the items of a list to their new places.
|
|
315
443
|
- `trackIndicator` sends one mark from item to item.
|
|
316
444
|
- `countTo` counts a figure to a new number.
|
|
317
445
|
- `followPointer` writes where a mouse or pen is over an element.
|
|
446
|
+
- `burstConfetti` bursts confetti out of an element once an action is done.
|
|
447
|
+
- `flashChange` lights up an element that changed, and fades.
|
|
448
|
+
- `resizeFrom` moves an element's height from where it was to where it lays
|
|
449
|
+
out next.
|
|
318
450
|
|
|
319
451
|
Each one works on any element, in any framework, and needs no Helix
|
|
320
452
|
stylesheet. Times and curves default to the tokens above, and to the values
|
|
321
453
|
those tokens hold where the page does not load them. Under reduced motion
|
|
322
|
-
nothing moves, the figure changes at once,
|
|
454
|
+
nothing moves, the figure changes at once, the pointer is not followed, and no
|
|
455
|
+
confetti is drawn.
|
|
323
456
|
`moveItems`, `followPointer`, and `trackIndicator` return the way to stop.
|
|
324
457
|
|
|
325
458
|
### Items that move
|
|
@@ -442,3 +575,30 @@ followPointer(document.querySelector('.card'))
|
|
|
442
575
|
`data-following` is on the element while the two are written. A touch is not
|
|
443
576
|
followed, since a finger is on the element only while it presses. Pass `moved`
|
|
444
577
|
and `left` to hear the same positions in script.
|
|
578
|
+
|
|
579
|
+
### What changed
|
|
580
|
+
|
|
581
|
+
`flashChange` lights up what changed. Call it on an element after you change
|
|
582
|
+
it, such as a cell a live feed updated or a sentence an agent rewrote. A quiet
|
|
583
|
+
wash of the info color holds for `--helix-duration-slow` and fades over twice
|
|
584
|
+
that. The wash is drawn over the element's background and under its text, so
|
|
585
|
+
nothing moves, and the element looks as it did once the wash is gone. A row is
|
|
586
|
+
washed through its cells. A second call on the same element carries on from
|
|
587
|
+
the strength drawn. Under reduced motion the wash still shows, since it says
|
|
588
|
+
what changed, and it goes over `--helix-duration-fade` with no rise.
|
|
589
|
+
|
|
590
|
+
```js
|
|
591
|
+
import { flashChange } from '@fusion.dev/helix-core'
|
|
592
|
+
|
|
593
|
+
const cell = document.querySelector('#latency')
|
|
594
|
+
cell.textContent = '224 ms'
|
|
595
|
+
flashChange(cell)
|
|
596
|
+
```
|
|
597
|
+
|
|
598
|
+
Two families do this for you. With `flash-changes`, a `Data Table` lights up
|
|
599
|
+
each row whose values change when you set `rows` again, and each row that
|
|
600
|
+
arrives, known by `row-key`, and a `Code Editor` lights up the lines a new
|
|
601
|
+
`value` or an agent's edit changed, leaving the lines you type alone.
|
|
602
|
+
`--data-table-flash-color` sets a table's wash, and a code editor's follows
|
|
603
|
+
the theme's info color.
|
|
604
|
+
|
package/content/overlays.mdx
CHANGED
|
@@ -203,8 +203,11 @@ finished. Select on them to draw an entrance or an exit of your own.
|
|
|
203
203
|
## Swiping an overlay away
|
|
204
204
|
|
|
205
205
|
A touch or a pen swipes a `Drawer` toward the edge it came from, and a `Toast`
|
|
206
|
-
message toward the
|
|
207
|
-
|
|
206
|
+
message toward the edge its stack sits at. The surface follows the finger, and
|
|
207
|
+
past its open end it gives less and less. A swipe past halfway, or a quick
|
|
208
|
+
flick from any distance, closes it through the same cancelable request as its
|
|
209
|
+
close control, and a refused request springs it back. Let go, it carries on at
|
|
210
|
+
the speed it was moving, off the window or back to rest. A `Drawer` with
|
|
208
211
|
`snap-points` comes to rest at the nearest point, such as half open, and
|
|
209
212
|
`:state(snapped)` holds while it rests short of the whole panel. Moving focus
|
|
210
213
|
with `Tab` to a control past the edge of the window opens it the rest of the
|
package/dist/pages.generated.js
CHANGED
|
@@ -138,7 +138,7 @@ export const docPages = [
|
|
|
138
138
|
title: 'Metrics',
|
|
139
139
|
},
|
|
140
140
|
{
|
|
141
|
-
description: 'The duration and easing tokens, how components handle reduced motion, and the functions that move your own elements.',
|
|
141
|
+
description: 'The duration and easing tokens, how components handle reduced motion, the effects, and the functions that move your own elements.',
|
|
142
142
|
section: 'Foundations',
|
|
143
143
|
slug: 'motion',
|
|
144
144
|
title: 'Motion',
|