@fusion.dev/helix-docs 0.245.0 → 0.247.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.
@@ -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
@@ -126,6 +127,8 @@ While the page's motion is paused:
126
127
  - A graph that `connectGraph` lays out stops where its notes stand, and its
127
128
  three.js view stops turning.
128
129
  - A map layer's `frames` stop on the frame they show.
130
+ - The 3D charts and `Heatmap` stand at their readings, and a growth or a move
131
+ already running ends where it was heading.
129
132
 
130
133
  The choice is the page's, held on the document element as
131
134
  `data-helix-motion="paused"`. Set it in your markup to start the page paused,
@@ -182,13 +185,60 @@ stylesheet, so its stack has no hooks of this kind.
182
185
 
183
186
  ## The wash under the pointer
184
187
 
185
- In `Navigation` and `Tabs`, the hover wash is one shape that glides from item
186
- to item as a mouse or pen moves along the row, and fades out when the pointer
187
- leaves. It takes the place of each item's own wash, in the same color, from
188
- `--navigation-item-hover-background-color` or
189
- `--tabs-tab-hover-background-color`. Arriving from outside the row, it appears
190
- under the pointer without sliding. A touch draws no wash, and under reduced
191
- motion the wash moves at once.
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.
192
242
 
193
243
  ## Figures that count
194
244
 
@@ -218,6 +268,69 @@ does not hold. The mark on the end of a line rides with it. Safari does not
218
268
  transition a path's shape, so lines, areas, points, and the mark on a line's
219
269
  end there take their new place at once.
220
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
+
301
+ ## 3D charts that grow in and follow their readings
302
+
303
+ The 3D charts draw their own marks, in SVG and through three.js, so their
304
+ motion runs in script. They are `Spatial Bar Chart`, `Spatial Scatter Chart`,
305
+ `Spatial Ribbon Chart`, `Spatial Surface Chart`, `Spatial Treemap`, and
306
+ `Spatial Heatmap`. Each mark is known by its name, such as a bar's category
307
+ and series, and a new table is matched against the marks drawn:
308
+
309
+ - A mark both tables hold moves from its old reading to its new one, and
310
+ slides to its new place.
311
+ - A mark only the new table holds grows from the floor.
312
+ - A mark the new table drops shrinks to the floor, and then goes.
313
+
314
+ The value axis eases to its new range, so a bar does not jump when the scale
315
+ changes, and its numbers are the new ones from the start. A surface whose grid
316
+ changed shape cannot be matched place for place, and takes its new shape at
317
+ once. A three.js drawing draws each frame the chart works out, and holds its
318
+ view still while the marks move.
319
+
320
+ A move takes `--<family>-move-duration` along `--<family>-move-easing`, such as
321
+ `--spatial-bar-chart-move-duration`. The styled tier sets them to
322
+ `--helix-duration-normal` and `--helix-easing-decelerate`, as the flat charts
323
+ move. The headless tier sets neither, so a new table is drawn at once there.
324
+
325
+ `grow` grows the marks in the first time the chart comes into view, each
326
+ category or column a little after the one before it, and `grow-again` grows
327
+ them again each time the chart comes back into view. The growth keeps its own
328
+ timing, a second for each mark, because the page asked for it by name. Under
329
+ `grow`, a later table grows the marks it adds the same way. A `Heatmap` takes
330
+ `grow` too: each cell starts empty and steps up through the tones to its own,
331
+ a column at a time. Its cells already take a new color through the
332
+ stylesheet, so it reads no move hooks.
333
+
221
334
  ## Starting styles and view transitions
222
335
 
223
336
  Overlays use `@starting-style` to animate in. It sets a starting value and needs
@@ -271,20 +384,75 @@ reduced motion or where the browser has no view transitions, and rejects
271
384
  where the change does. To keep a header still while the rest of the page
272
385
  moves, give it a `view-transition-name` of its own on every page.
273
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
+
274
437
  ## Motion on your own elements
275
438
 
276
- Four functions in `@fusion.dev/helix-core` give elements you write yourself
439
+ Seven functions in `@fusion.dev/helix-core` give elements you write yourself
277
440
  the motion Helix's own families have, with no component around them:
278
441
 
279
442
  - `moveItems` slides the items of a list to their new places.
280
443
  - `trackIndicator` sends one mark from item to item.
281
444
  - `countTo` counts a figure to a new number.
282
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.
283
450
 
284
451
  Each one works on any element, in any framework, and needs no Helix
285
452
  stylesheet. Times and curves default to the tokens above, and to the values
286
453
  those tokens hold where the page does not load them. Under reduced motion
287
- nothing moves, the figure changes at once, and the pointer is not followed.
454
+ nothing moves, the figure changes at once, the pointer is not followed, and no
455
+ confetti is drawn.
288
456
  `moveItems`, `followPointer`, and `trackIndicator` return the way to stop.
289
457
 
290
458
  ### Items that move
@@ -407,3 +575,30 @@ followPointer(document.querySelector('.card'))
407
575
  `data-following` is on the element while the two are written. A touch is not
408
576
  followed, since a finger is on the element only while it presses. Pass `moved`
409
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
+
@@ -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 end of the line. A swipe past halfway, or a quick one, closes
207
- it through the same cancelable request as its close control. A `Drawer` with
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
@@ -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',