@crystal-ui/core 2.5.0 → 2.6.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.
- package/README.md +1 -1
- package/assets/crystal.css +76 -2
- package/assets/motion.js +55 -1
- package/docs/accessibility.md +1 -1
- package/docs/catalogue.md +11 -11
- package/docs/motion-components.md +16 -2
- package/docs/motion.md +3 -2
- package/package.json +1 -1
- package/tokens/catalogue/02-navigation.json +7 -6
- package/tokens/catalogue/03-actions.json +3 -2
- package/tokens/catalogue/04-inputs.json +2 -2
- package/tokens/catalogue.json +14 -12
- package/tokens/motion-recipes.json +47 -0
- package/tokens/surfaces.json +1 -1
package/README.md
CHANGED
|
@@ -67,7 +67,7 @@ icons, hit areas and focus rings are never blurred.
|
|
|
67
67
|
| `@crystal-ui/core/core/preferences` | Preference clamping and duration resolution. |
|
|
68
68
|
| `@crystal-ui/core/core/spring` | Spring physics: sampling, settling time and overshoot. |
|
|
69
69
|
| `@crystal-ui/core/core/presets` | Keyframes for the material motion presets, computed from tokens. |
|
|
70
|
-
| `@crystal-ui/core/motion-recipes` | The
|
|
70
|
+
| `@crystal-ui/core/motion-recipes` | The 60 motion recipes, each with its spring and per-platform values. |
|
|
71
71
|
| `@crystal-ui/core/engines` | The Motion and GSAP engine entry. |
|
|
72
72
|
| `@crystal-ui/core/icons` | The icon manifest. There are 1022 icons on a 24px grid. |
|
|
73
73
|
| `@crystal-ui/core/shaders/*` | The optical layer's shader sources and their manifest. |
|
package/assets/crystal.css
CHANGED
|
@@ -1584,6 +1584,77 @@ input[type=checkbox][role=switch] {
|
|
|
1584
1584
|
}
|
|
1585
1585
|
}
|
|
1586
1586
|
|
|
1587
|
+
/* The travelling selection pill (D-37).
|
|
1588
|
+
*
|
|
1589
|
+
* One `.cr-indicator.pill` behind the selected segment of a strip: tabs, a
|
|
1590
|
+
* segmented control, the dock, bottom navigation or a toggle button group. It
|
|
1591
|
+
* is a child of the plane that holds the segments (`.cr-dock`, `.cr-dock-inner`
|
|
1592
|
+
* or `.cr-group`), hidden from assistive technology, and placed by five
|
|
1593
|
+
* measured properties: `--cr-pill-x`, `--cr-pill-y`, `--cr-pill-width` and
|
|
1594
|
+
* `--cr-pill-height`, the selected segment's box inside the plane's padding
|
|
1595
|
+
* edge, and `--cr-pill-radius`, its corners. `CrystalMotion.travel()`
|
|
1596
|
+
* writes them and moves the pill with the `selection-travel` recipe.
|
|
1597
|
+
*
|
|
1598
|
+
* Until the pill is placed (`data-placed`) it is not drawn and each segment
|
|
1599
|
+
* paints its own selection, so a strip with no script, or before its first
|
|
1600
|
+
* measurement, looks as it always has. Once placed, the selected segment gives
|
|
1601
|
+
* its fill and its contact shadow to the pill and keeps its ink and its weight:
|
|
1602
|
+
* selection is still label weight, so the pill is never the only sign of it.
|
|
1603
|
+
*
|
|
1604
|
+
* z-index -1 inside the plane's stacking context puts the pill above the
|
|
1605
|
+
* plane's Haze backing, which is earlier in the tree at the same level, and
|
|
1606
|
+
* under every segment's label without asking the segments to be positioned. */
|
|
1607
|
+
.cr-indicator.pill {
|
|
1608
|
+
display: none;
|
|
1609
|
+
position: absolute;
|
|
1610
|
+
inset: auto;
|
|
1611
|
+
left: var(--cr-pill-x, 0px);
|
|
1612
|
+
top: var(--cr-pill-y, 0px);
|
|
1613
|
+
width: var(--cr-pill-width, 0px);
|
|
1614
|
+
height: var(--cr-pill-height, 0px);
|
|
1615
|
+
min-width: 0;
|
|
1616
|
+
z-index: -1;
|
|
1617
|
+
border: 0;
|
|
1618
|
+
/* The segment's own corners, so the pill is a pill in the dock and keeps
|
|
1619
|
+
a group's square interior corners. */
|
|
1620
|
+
border-radius: var(--cr-pill-radius, 999px);
|
|
1621
|
+
background: var(--cr-primary);
|
|
1622
|
+
box-shadow: 0 3px 7px var(--cr-shadow-contact);
|
|
1623
|
+
list-style: none;
|
|
1624
|
+
margin: 0;
|
|
1625
|
+
padding: 0;
|
|
1626
|
+
}
|
|
1627
|
+
.cr-indicator.pill[data-placed] {
|
|
1628
|
+
display: block;
|
|
1629
|
+
}
|
|
1630
|
+
.cr-indicator.pill::before,
|
|
1631
|
+
.cr-indicator.pill::after {
|
|
1632
|
+
content: none;
|
|
1633
|
+
display: none;
|
|
1634
|
+
}
|
|
1635
|
+
:is(.cr-dock, .cr-dock-inner, .cr-group):has(> .cr-indicator.pill[data-placed]) :is([aria-pressed=true], [aria-selected=true], [aria-checked=true], [aria-current]:not([aria-current=false]), label:has(input[type=radio]:checked)) {
|
|
1636
|
+
background: transparent;
|
|
1637
|
+
box-shadow: none;
|
|
1638
|
+
}
|
|
1639
|
+
:is(.cr-dock, .cr-dock-inner, .cr-group):has(> .cr-indicator.pill[data-placed]) :is([aria-pressed=true], [aria-selected=true], [aria-checked=true])::before {
|
|
1640
|
+
background: transparent;
|
|
1641
|
+
}
|
|
1642
|
+
/* A group's segments paint their own fill, which a dock's do not. In a toggle
|
|
1643
|
+
set with a pill that fill would hide the pill as it passes behind, so every
|
|
1644
|
+
segment gives its fill to the group's plane and the pill is the one fill
|
|
1645
|
+
drawn. A hover keeps its own, on the element rather than this layer. */
|
|
1646
|
+
.cr-group:has(> .cr-indicator.pill[data-placed]) > :is(button, a.cr-button, .cr-button, .cr-control)::before {
|
|
1647
|
+
background: transparent;
|
|
1648
|
+
filter: none;
|
|
1649
|
+
}
|
|
1650
|
+
/* Forced colours draw selection as the segment's own Highlight outline, which
|
|
1651
|
+
stays; a fill the system would flatten to Canvas is not drawn. */
|
|
1652
|
+
@media (forced-colors:active) {
|
|
1653
|
+
.cr-indicator.pill[data-placed] {
|
|
1654
|
+
display: none;
|
|
1655
|
+
}
|
|
1656
|
+
}
|
|
1657
|
+
|
|
1587
1658
|
/* A group: the `group` surface (D-26).
|
|
1588
1659
|
*
|
|
1589
1660
|
* A button group and a split button are one Resin plane whose segments touch:
|
|
@@ -1625,7 +1696,10 @@ input[type=checkbox][role=switch] {
|
|
|
1625
1696
|
backdrop-filter: none;
|
|
1626
1697
|
isolation: isolate;
|
|
1627
1698
|
}
|
|
1628
|
-
|
|
1699
|
+
/* A toggle set's pill comes first in the group (D-37), so the first segment is
|
|
1700
|
+
the first child or the one straight after the pill. The pill's case is in
|
|
1701
|
+
:where(), so the rule keeps the specificity it had. */
|
|
1702
|
+
.cr-group > :is(button, a.cr-button, .cr-button, .cr-control):is(:first-child, :where(.cr-indicator.pill:first-child) + *) {
|
|
1629
1703
|
border-start-start-radius: 999px;
|
|
1630
1704
|
border-end-start-radius: 999px;
|
|
1631
1705
|
}
|
|
@@ -1645,7 +1719,7 @@ input[type=checkbox][role=switch] {
|
|
|
1645
1719
|
border-inline-start: 0;
|
|
1646
1720
|
border-block-start: 1px solid var(--cr-edge);
|
|
1647
1721
|
}
|
|
1648
|
-
.cr-group.vertical > :is(button, a.cr-button, .cr-button, .cr-control):first-child {
|
|
1722
|
+
.cr-group.vertical > :is(button, a.cr-button, .cr-button, .cr-control):is(:first-child, :where(.cr-indicator.pill:first-child) + *) {
|
|
1649
1723
|
border-radius: 0;
|
|
1650
1724
|
border-start-start-radius: 999px;
|
|
1651
1725
|
border-start-end-radius: 999px;
|
package/assets/motion.js
CHANGED
|
@@ -81,6 +81,60 @@
|
|
|
81
81
|
element.dataset.crMotionTravel=within?String(Math.round(distance)):'0';
|
|
82
82
|
return runComponent(element,'layout',within?[{transform:`translate(${dx}px,${dy}px) scale(.98)`},{transform:'translate(0,0) scale(1)'}]:[{opacity:.65},{opacity:1}],Math.min(1200,380+distance*.65),'GSAP',options);
|
|
83
83
|
}
|
|
84
|
+
/* The travelling selection pill (D-37). `pill` is the strip's one
|
|
85
|
+
`.cr-indicator.pill`, a child of the plane (`.cr-dock`, `.cr-dock-inner` or
|
|
86
|
+
`.cr-group`); `target` is the segment now selected, whose semantics the
|
|
87
|
+
caller has already set. The pill is placed behind the target through five
|
|
88
|
+
properties the stylesheet reads, the target's box and its corners, and
|
|
89
|
+
`data-placed` hands the selection fill from the segments to the pill. The
|
|
90
|
+
first placement, `{ instant: true }` (for a resize or a font load) and
|
|
91
|
+
reduced motion place without travelling. Otherwise the pill travels from
|
|
92
|
+
where it is seen, which mid-flight is not where it was placed, so an
|
|
93
|
+
interrupted travel turns rather than jumps.
|
|
94
|
+
|
|
95
|
+
The two labels' ink crosses on the pill's clock: the arriving label goes
|
|
96
|
+
from the strip's ink to the selected ink as the pill comes under it, and
|
|
97
|
+
the departing label the other way. Holding either ink until the pill lands
|
|
98
|
+
leaves one label in the colour of whatever is about to be behind it: in a
|
|
99
|
+
dark palette the primary is light, and the strip's light ink on it all but
|
|
100
|
+
disappears. Weight is not animated; it changes with the semantics. */
|
|
101
|
+
const chosen=new WeakMap(),inks=new WeakMap();
|
|
102
|
+
function travel(pill,target,options={}){
|
|
103
|
+
if(!(pill instanceof Element)||!(target instanceof Element))throw new TypeError('CrystalMotion.travel requires the pill and the selected segment');
|
|
104
|
+
const strip=pill.parentElement;if(!strip)throw new TypeError('CrystalMotion.travel requires a pill inside its strip');
|
|
105
|
+
for(const animation of inks.get(pill)||[])animation.cancel();inks.delete(pill);
|
|
106
|
+
const box=strip.getBoundingClientRect(),at=rect=>({x:rect.left-box.left-strip.clientLeft,y:rect.top-box.top-strip.clientTop,width:rect.width,height:rect.height});
|
|
107
|
+
const next=at(target.getBoundingClientRect()),placed=pill.hasAttribute('data-placed'),seen=placed?at(pill.getBoundingClientRect()):null;
|
|
108
|
+
const departing=chosen.get(pill);chosen.set(pill,target);
|
|
109
|
+
stop(pill);
|
|
110
|
+
const corners=getComputedStyle(target).borderRadius,before=seen?getComputedStyle(pill).borderRadius:corners;
|
|
111
|
+
for(const [key,value] of Object.entries(next))pill.style.setProperty('--cr-pill-'+key,value+'px');
|
|
112
|
+
pill.style.setProperty('--cr-pill-radius',corners);
|
|
113
|
+
pill.setAttribute('data-placed','');
|
|
114
|
+
const dx=seen?seen.x-next.x:0,dy=seen?seen.y-next.y:0;
|
|
115
|
+
if(!seen||options.instant||!next.width||(Math.abs(dx)<.5&&Math.abs(dy)<.5&&Math.abs(seen.width-next.width)<.5&&Math.abs(seen.height-next.height)<.5)){
|
|
116
|
+
pill.dataset.crMotionName='selection-travel';pill.dataset.crMotionState='instant';return Promise.resolve({status:'instant'});
|
|
117
|
+
}
|
|
118
|
+
const recipe=recipes['selection-travel'];if(!recipe)throw new RangeError('Unknown Crystal motion: selection-travel');
|
|
119
|
+
pill.dataset.crMotionTravel=String(Math.round(Math.hypot(dx,dy)));
|
|
120
|
+
const run=runComponent(pill,'selection-travel',[
|
|
121
|
+
{transform:`translate(${dx}px,${dy}px)`,width:seen.width+'px',height:seen.height+'px',borderRadius:before},
|
|
122
|
+
{transform:'translate(0px,0px)',width:next.width+'px',height:next.height+'px',borderRadius:corners},
|
|
123
|
+
],recipe.duration,recipe.engine,options);
|
|
124
|
+
if(pill.dataset.crMotionState==='running'){
|
|
125
|
+
pill.setAttribute('data-travelling','');
|
|
126
|
+
if(departing&&departing!==target&&departing.isConnected&&typeof target.animate==='function'){
|
|
127
|
+
const selectedInk=getComputedStyle(target).color,stripInk=getComputedStyle(departing).color;
|
|
128
|
+
const timing={duration:duration(recipe.duration,options.rate),easing:'cubic-bezier(0.22, 0.65, 0.22, 1)'};
|
|
129
|
+
if(selectedInk!==stripInk)inks.set(pill,[
|
|
130
|
+
target.animate([{color:stripInk},{color:selectedInk}],timing),
|
|
131
|
+
departing.animate([{color:selectedInk},{color:stripInk}],timing),
|
|
132
|
+
]);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
const land=()=>{if(pill.dataset.crMotionState!=='running')pill.removeAttribute('data-travelling');};
|
|
136
|
+
return run.then(result=>{land();return result;},error=>{land();throw error;});
|
|
137
|
+
}
|
|
84
138
|
function play(element,name,options={}){
|
|
85
139
|
if(recipes[name]){const recipe=recipes[name];return runComponent(element,name,recipe.keyframes,recipe.duration,recipe.engine,options);}
|
|
86
140
|
|
|
@@ -146,5 +200,5 @@
|
|
|
146
200
|
work is in the request log. The optical layer remains for motion that a
|
|
147
201
|
person starts. */
|
|
148
202
|
|
|
149
|
-
root.CrystalMotion=Object.freeze({play,layout,duration,recipes:Object.freeze(recipes),stop,stopAll,reduced,direction,presets:Object.freeze([...Object.keys(durationNames),...Object.keys(recipes)])});
|
|
203
|
+
root.CrystalMotion=Object.freeze({play,layout,travel,duration,recipes:Object.freeze(recipes),stop,stopAll,reduced,direction,presets:Object.freeze([...Object.keys(durationNames),...Object.keys(recipes)])});
|
|
150
204
|
})(window);
|
package/docs/accessibility.md
CHANGED
|
@@ -80,7 +80,7 @@ and the defect that led to the rule, are in
|
|
|
80
80
|
|
|
81
81
|
## Reduced motion
|
|
82
82
|
|
|
83
|
-
`prefers-reduced-motion: reduce` is honoured by every one of the
|
|
83
|
+
`prefers-reduced-motion: reduce` is honoured by every one of the 60 motion recipes. Each
|
|
84
84
|
recipe declares its own `reduced` behaviour, and motion is not switched off globally,
|
|
85
85
|
because "no animation" and "no *movement*" are different requirements.
|
|
86
86
|
|
package/docs/catalogue.md
CHANGED
|
@@ -43,7 +43,7 @@ Every component is made of one or more of these surfaces. Its Surface row names
|
|
|
43
43
|
| <a id="surface-stone"></a>**Stone label backing** `stone` | Stone | <code>.cr-stone</code> | 3 | A label over an unknown or moving backdrop: a caption on media, a status bar over a scene. 55% light / 60% dark fill, feathered like Haze, crisp text. `.cr-media-caption` is a caption cue rendered by the library: the Stone backing on a box above the transport, never under it. `.large`, `.larger` and `.solid` are the reader's caption style: a cue 1.25 or 1.5 times the size, and a cue on the opaque surface. `::cue` on a `.cr-media` video is the flat fill for the browser's own renderer, which follows the reader's system caption settings. |
|
|
44
44
|
| <a id="surface-mirage"></a>**Mirage scrim** `mirage` | Mirage | <code>.cr-mirage</code> | 10 | The chromatic diffusion of the real scene behind a modal. Never a content surface; the decision surface above it is Haze. |
|
|
45
45
|
| <a id="surface-dialog"></a>**Dialog** `dialog` | Haze + Mirage | <code>.cr-dialog</code> | 2 | A Haze decision surface over a Mirage scrim, with the float shadow. Modality, focus and dismissal are the product's. The surface does not scroll: `.cr-dialog-body`, worn with `.cr-scroll-frost`, scrolls inside it, so the title stays in view and the edge fade does not dissolve the surface. `position: fixed` is for a native `<dialog>`; on any other element the host positions it. |
|
|
46
|
-
| <a id="surface-indicator"></a>**Indicator** `indicator` | Haze | <code>.cr-indicator</code> | 2 | A 20px informational circle painting Haze on an isolated layer, or the
|
|
46
|
+
| <a id="surface-indicator"></a>**Indicator** `indicator` | Haze | <code>.cr-indicator</code> | 2 | A 20px informational circle painting Haze on an isolated layer, or, as `.cr-indicator.pill`, the primary fill that travels behind the selected segment of a strip (D-37): tabs, a segmented control, the dock, bottom navigation or a toggle button group. The circle is Haze rather than Resin, because it sits on a surface that is often already translucent. Neither is ever the only mark of a selection: the selected segment keeps its label weight, and the circle never marks one at all. |
|
|
47
47
|
| <a id="surface-status"></a>**Status badge** `status` | Resin + Haze | <code>.cr-status</code> | 1 | The semantic ink and surface pair behind a symbol, with words beside it. Status colours are independent of the palette and are never redefined by it. |
|
|
48
48
|
| <a id="surface-bubble"></a>**Authored bubble** `bubble` | Haze | <code>.cr-bubble</code> | 1 | A Haze message surface with a directional tight corner. `.own` uses the palette's own-content pair. |
|
|
49
49
|
| <a id="surface-table"></a>**Table** `table` | Resin + Haze | <code>.cr-table-scroll</code> | 5 | A Resin shell with an inset Haze fill holding the table, with the primary-soft header and the Resin scrollbar. Rows are read on the Haze; sort and selection are announced, and selection is label weight. |
|
|
@@ -327,13 +327,13 @@ One floating Resin plane holding labelled destinations on a shared Stone label g
|
|
|
327
327
|
|
|
328
328
|
<div class="cr-table-scroll"><table class="cr-table cr-table-properties"><tbody>
|
|
329
329
|
<tr><th scope="row">States</th><td>default, selected, hover, focus</td></tr>
|
|
330
|
-
<tr><th scope="row">Material</th><td>Resin plane, Stone label backing, primary
|
|
330
|
+
<tr><th scope="row">Material</th><td>Resin plane, Stone label backing, the primary pill behind the selected destination</td></tr>
|
|
331
331
|
<tr><th scope="row">Surface</th><td><a href="#surface-dock">Dock</a></td></tr>
|
|
332
332
|
<tr><th scope="row">Geometry</th><td>Pill; 52px minimum destination height</td></tr>
|
|
333
333
|
<tr><th scope="row">Semantics</th><td>nav landmark; aria-pressed or aria-current on the destination</td></tr>
|
|
334
334
|
<tr><th scope="row">Crystal supplies</th><td>The single shared plane, label weight for the current entry, elevation</td></tr>
|
|
335
335
|
<tr><th scope="row">Product owns</th><td>Destinations and routing</td></tr>
|
|
336
|
-
<tr><th scope="row">Motion</th><td><code>selection</code></td></tr>
|
|
336
|
+
<tr><th scope="row">Motion</th><td><code>selection-travel</code></td></tr>
|
|
337
337
|
<tr><th scope="row">Parity</th><td>mui:BottomNavigation · antd:Menu · mantine:SegmentedControl</td></tr>
|
|
338
338
|
</tbody></table></div>
|
|
339
339
|
|
|
@@ -361,13 +361,13 @@ A Resin tab strip with a selected tab and an associated panel.
|
|
|
361
361
|
|
|
362
362
|
<div class="cr-table-scroll"><table class="cr-table cr-table-properties"><tbody>
|
|
363
363
|
<tr><th scope="row">States</th><td>default, hover, focus, selected, disabled</td></tr>
|
|
364
|
-
<tr><th scope="row">Material</th><td>Resin strip, primary
|
|
364
|
+
<tr><th scope="row">Material</th><td>Resin strip, the primary pill behind the selected tab</td></tr>
|
|
365
365
|
<tr><th scope="row">Surface</th><td><a href="#surface-dock">Dock</a></td></tr>
|
|
366
366
|
<tr><th scope="row">Geometry</th><td>Pill tabs inside a pill strip; 44px minimum</td></tr>
|
|
367
367
|
<tr><th scope="row">Semantics</th><td>role=tablist/tab/tabpanel with arrow-key, Home and End navigation and aria-selected</td></tr>
|
|
368
368
|
<tr><th scope="row">Crystal supplies</th><td>Strip material, label weight for the selected tab, focus ring</td></tr>
|
|
369
369
|
<tr><th scope="row">Product owns</th><td>The roving tabindex implementation and panel content</td></tr>
|
|
370
|
-
<tr><th scope="row">Motion</th><td><code>tab-in</code></td></tr>
|
|
370
|
+
<tr><th scope="row">Motion</th><td><code>tab-in</code>, <code>selection-travel</code></td></tr>
|
|
371
371
|
<tr><th scope="row">Parity</th><td>mantine:Tabs · mui:Tabs · antd:Tabs</td></tr>
|
|
372
372
|
</tbody></table></div>
|
|
373
373
|
|
|
@@ -478,9 +478,9 @@ A Resin destination group pinned to the bottom of a narrow view.
|
|
|
478
478
|
<tr><th scope="row">Surface</th><td><a href="#surface-dock">Dock</a></td></tr>
|
|
479
479
|
<tr><th scope="row">Geometry</th><td>Pill; targets at least 44px; respects the safe area.</td></tr>
|
|
480
480
|
<tr><th scope="row">Semantics</th><td>role="navigation"; the current destination carries aria-current="page".</td></tr>
|
|
481
|
-
<tr><th scope="row">Crystal supplies</th><td>Material, geometry, selection by label weight, safe-area inset</td></tr>
|
|
481
|
+
<tr><th scope="row">Crystal supplies</th><td>Material, geometry, selection by label weight with the pill behind it, safe-area inset</td></tr>
|
|
482
482
|
<tr><th scope="row">Product owns</th><td>Destinations and routing</td></tr>
|
|
483
|
-
<tr><th scope="row">Motion</th><td><code>selection</code></td></tr>
|
|
483
|
+
<tr><th scope="row">Motion</th><td><code>selection-travel</code></td></tr>
|
|
484
484
|
<tr><th scope="row">Parity</th><td>mui:BottomNavigation</td></tr>
|
|
485
485
|
</tbody></table></div>
|
|
486
486
|
|
|
@@ -596,9 +596,9 @@ Adjacent actions sharing one Resin plane with internal hairlines.
|
|
|
596
596
|
<tr><th scope="row">Surface</th><td><a href="#surface-group">Group</a></td></tr>
|
|
597
597
|
<tr><th scope="row">Geometry</th><td>Pill outer geometry; interior corners square against neighbours</td></tr>
|
|
598
598
|
<tr><th scope="row">Semantics</th><td>group role with an accessible name when the buttons are related</td></tr>
|
|
599
|
-
<tr><th scope="row">Crystal supplies</th><td>The shared plane and interior separation</td></tr>
|
|
599
|
+
<tr><th scope="row">Crystal supplies</th><td>The shared plane and interior separation; as a toggle set, the pill behind the pressed button</td></tr>
|
|
600
600
|
<tr><th scope="row">Product owns</th><td>Which actions are grouped</td></tr>
|
|
601
|
-
<tr><th scope="row">Motion</th><td><code>press</code></td></tr>
|
|
601
|
+
<tr><th scope="row">Motion</th><td><code>press</code>, <code>selection-travel</code></td></tr>
|
|
602
602
|
<tr><th scope="row">Parity</th><td>mantine:Button.Group · mui:ButtonGroup · antd:Space.Compact</td></tr>
|
|
603
603
|
</tbody></table></div>
|
|
604
604
|
|
|
@@ -952,13 +952,13 @@ A pill strip of mutually exclusive options sharing one Resin plane.
|
|
|
952
952
|
|
|
953
953
|
<div class="cr-table-scroll"><table class="cr-table cr-table-properties"><tbody>
|
|
954
954
|
<tr><th scope="row">States</th><td>default, hover, focus, selected, disabled</td></tr>
|
|
955
|
-
<tr><th scope="row">Material</th><td>One Resin plane; primary
|
|
955
|
+
<tr><th scope="row">Material</th><td>One Resin plane; the primary pill behind the selected segment</td></tr>
|
|
956
956
|
<tr><th scope="row">Surface</th><td><a href="#surface-dock">Dock</a></td></tr>
|
|
957
957
|
<tr><th scope="row">Geometry</th><td>Pill strip and pill segments; 44px minimum</td></tr>
|
|
958
958
|
<tr><th scope="row">Semantics</th><td>Radio group semantics, or aria-pressed on buttons; never aria-selected outside a tablist</td></tr>
|
|
959
959
|
<tr><th scope="row">Crystal supplies</th><td>Shared plane, label weight for the selected segment, focus ring</td></tr>
|
|
960
960
|
<tr><th scope="row">Product owns</th><td>Options and change handling</td></tr>
|
|
961
|
-
<tr><th scope="row">Motion</th><td><code>selection</code></td></tr>
|
|
961
|
+
<tr><th scope="row">Motion</th><td><code>selection-travel</code></td></tr>
|
|
962
962
|
<tr><th scope="row">Parity</th><td>mantine:SegmentedControl · mui:ToggleButtonGroup · antd:Segmented</td></tr>
|
|
963
963
|
</tbody></table></div>
|
|
964
964
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[Open the live component studies](../motion.html#component-motion) · [Search all recipes](../motion.html#recipe-library) · [Run browser contracts](../motion-contracts.html)
|
|
4
4
|
|
|
5
|
-
Crystal ships
|
|
5
|
+
Crystal ships 60 executable component recipes in nine families, the six material signatures, Mirage withdrawal, a modal dismissal, a measured-layout helper, and the travelling selection pill, which plays `selection-travel` between measured segments. Three of the recipes are continuous indicators of pending work. This is the animation foundation for future component libraries. The demonstration includes real local component behavior, but is not an audited production React, Rust or native component library. No remote operation is represented as implemented.
|
|
6
6
|
|
|
7
7
|
## Engine responsibilities
|
|
8
8
|
|
|
@@ -38,7 +38,8 @@ The same formula applies to display labels, tags, badges and keyboard caps. Use
|
|
|
38
38
|
| Slider, stepper, numeric output | `slider-step` | Native keyboard range interaction and current value |
|
|
39
39
|
| Input, textarea, validation group | `field-focus`, `field-invalid`, `field-valid`, `hint-in/out` | Real validation, associated error text, `aria-invalid` |
|
|
40
40
|
| Copy action, confirmation mark | `copy-confirm`, `success` | Play only after the actual action succeeds |
|
|
41
|
-
| Tab, navigation rail, bottom navigation | `selection`, `tab-in` | Selected semantics, roving tab stop, panel visibility |
|
|
41
|
+
| Tab, navigation rail, bottom navigation | `selection`, `tab-in`; on a strip, `selection-travel` through `travel()` | Selected semantics, roving tab stop, panel visibility |
|
|
42
|
+
| Segmented control, dock, toggle button group | `selection-travel` through `travel()` | Selected semantics first; selection stays label weight, so the pill is never the only sign of it |
|
|
42
43
|
| Page/view, wizard step, breadcrumb, pagination | `page-in/out`, `breadcrumb` | Router/history and focus managed by the host |
|
|
43
44
|
| Dialog / alert dialog | Haze + Mirage + `dismiss` | Native modality, initial focus, Escape, focus return |
|
|
44
45
|
| Drawer / inspector / sheet | `drawer-in/out` + Mirage | Native modality or an explicitly nonmodal panel contract |
|
|
@@ -73,6 +74,7 @@ Base times below are at 1×; the preview resolves the saved speed at playback. E
|
|
|
73
74
|
| `press` | resin / pressure | Motion | 320ms | Buttons, icon buttons and segmented controls. Disabled controls never animate. |
|
|
74
75
|
| `hover` | resin / caustic | Motion | 700ms | Fine-pointer affordance only; keyboard focus is immediate. |
|
|
75
76
|
| `selection` | resin / meniscus | Motion | 420ms | Selected chips, radios, toggles and navigation; set selected semantics first. |
|
|
77
|
+
| `selection-travel` | resin / meniscus | Motion | 460ms | The one .cr-indicator.pill behind the selected segment of tabs, a segmented control, the dock, bottom navigation or a toggle button group, moving to the new segment when the choice changes. Set the selected semantics first; selection stays label weight, so the pill is never the only sign of it. Critically damped: a pill that overshoots stands for a moment on a segment nobody chose. |
|
|
76
78
|
| `switch-on` | resin / coalesce | Motion | 460ms | Animate the thumb after its checked state is applied. |
|
|
77
79
|
| `switch-off` | resin / coalesce | Motion | 460ms | Animate the thumb after its unchecked state is applied. |
|
|
78
80
|
| `check` | resin / iris | Motion | 340ms | Checkbox and radio indicators; retain a visible non-color state. |
|
|
@@ -155,6 +157,18 @@ CrystalMotion.stopAll();
|
|
|
155
157
|
|
|
156
158
|
`layout(element, previousRect)` compares the previous and current DOM position. Displacements up to the viewport diagonal use a GSAP-controlled inverse transform, with duration adapting to distance. Pass `{extended:false}` to retain the compact 50px/crossfade behavior. Offscreen-scale moves beyond the viewport diagonal crossfade. The final order is always the real DOM order. Layout animation is cosmetic and does not supply drag-and-drop behavior.
|
|
157
159
|
|
|
160
|
+
`travel(pill, segment, {instant})` moves a strip's selection pill (D-37). The pill is one `.cr-indicator.pill`, `aria-hidden`, a child of the plane that holds the segments: `.cr-dock`, `.cr-dock-inner` or `.cr-group`. Set the segment's selected semantics first, then call `travel` with the segment that carries them. It measures the segment inside the plane, writes `--cr-pill-x`, `--cr-pill-y`, `--cr-pill-width`, `--cr-pill-height` and `--cr-pill-radius` on the pill, marks it `data-placed`, and plays `selection-travel` from where the pill is seen to where the segment stands. Placing the pill is what hands the fill to it: until then each segment paints its own, so a strip with no script looks as it always has. The first call, `{instant:true}` (call it from a resize observer, or when fonts load) and reduced motion place the pill without travelling. A travel that starts while another is under way starts from where the pill is seen, so a quick second choice turns the pill rather than snapping it. While it travels the pill carries `data-travelling`, and the arriving label keeps the strip's ink until the pill is under it; its weight changes at once, with the semantics. Forced colours draw no pill and keep the segment's own outline.
|
|
161
|
+
|
|
162
|
+
```js
|
|
163
|
+
const pill = strip.querySelector(':scope > .cr-indicator.pill');
|
|
164
|
+
await CrystalMotion.travel(pill, strip.querySelector('[aria-selected=true]'), { instant: true });
|
|
165
|
+
|
|
166
|
+
// When the choice changes:
|
|
167
|
+
previous.setAttribute('aria-selected', 'false');
|
|
168
|
+
next.setAttribute('aria-selected', 'true');
|
|
169
|
+
await CrystalMotion.travel(pill, next);
|
|
170
|
+
```
|
|
171
|
+
|
|
158
172
|
The engine bridge restores prior inline values and priorities for its owned properties. Consumers should avoid modifying the same animated property during an effect; stop it before changing that property. Component implementations should use a dedicated animated wrapper when they already own a nontrivial transform. Libraries must not let two engines compete for the same property.
|
|
159
173
|
|
|
160
174
|
## Live examples and interruption
|
package/docs/motion.md
CHANGED
|
@@ -85,7 +85,7 @@ The canonical motion definitions live in `tokens/crystal.json`; CSS and JSON exp
|
|
|
85
85
|
|
|
86
86
|
Both engines are installed, bundled locally and used by the runtime. [Motion's animate API](https://motion.dev/docs/animate) drives element keyframes. [GSAP timelines](https://gsap.com/docs/v3/GSAP/Timeline/) control material paint-layer clocks and selected component sequences. Native Web Animations effects paint actual pseudo-elements under those GSAP clocks; CSS supplies the native dialog backdrop fallback.
|
|
87
87
|
|
|
88
|
-
See the [component motion suite](motion-components.html) for all
|
|
88
|
+
See the [component motion suite](motion-components.html) for all 60 recipes, engine assignments, API contracts, live component behavior, test instructions and future component-library/Storybook coverage. [License notices](../reference/ASSET-NOTICES.md) accompany the local bundle.
|
|
89
89
|
|
|
90
90
|
The compact CSS timing tokens remain available for small state changes. The material-driven Resin press recipe uses 320ms for a complete compression/recovery sequence; hover light uses 700ms. These visual clocks never delay the actual action. The executable catalog lists the current duration of every recipe.
|
|
91
91
|
|
|
@@ -228,7 +228,7 @@ including that reduced motion still applies the state instantly.
|
|
|
228
228
|
|
|
229
229
|
<!-- generated:recipes -->
|
|
230
230
|
|
|
231
|
-
All
|
|
231
|
+
All 60 recipes in 9 categories, generated from `core/tokens/motion-recipes.json`. Damping ratio and
|
|
232
232
|
overshoot are derived from each recipe's spring by `core/assets/core/spring.js`, so a
|
|
233
233
|
retuned spring cannot leave a stale number in this table.
|
|
234
234
|
|
|
@@ -243,6 +243,7 @@ correct is a material question; see the signature policy below.
|
|
|
243
243
|
| `press`: Press and release | 320ms | pressure | resin | 0.660 | 6.3% | Buttons, icon buttons and segmented controls. Disabled controls never animate. | Apply the semantic state immediately; omit decorative movement. |
|
|
244
244
|
| `hover`: Light follows the surface | 700ms | caustic | resin | 0.900 | 0.2% | Fine-pointer affordance only; keyboard focus is immediate. | Apply the semantic state immediately; omit decorative movement. |
|
|
245
245
|
| `selection`: Selection settle | 420ms | meniscus | resin | 0.700 | 4.6% | Selected chips, radios, toggles and navigation; set selected semantics first. | Apply the semantic state immediately; omit decorative movement. |
|
|
246
|
+
| `selection-travel`: Selection travel | 460ms | meniscus | resin | 1.000 | none | The one .cr-indicator.pill behind the selected segment of tabs, a segmented control, the dock, bottom navigation or a toggle button group, moving to the new segment when the choice changes. Set the selected semantics first; selection stays label weight, so the pill is never the only sign of it. Critically damped: a pill that overshoots stands for a moment on a segment nobody chose. | The pill is placed behind the new segment at once; nothing travels. |
|
|
246
247
|
| `switch-on`: Switch on | 460ms | coalesce | resin | 0.620 | 8.4% | Animate the thumb after its checked state is applied. | Apply the semantic state immediately; omit decorative movement. |
|
|
247
248
|
| `switch-off`: Switch off | 460ms | coalesce | resin | 0.620 | 8.4% | Animate the thumb after its unchecked state is applied. | Apply the semantic state immediately; omit decorative movement. |
|
|
248
249
|
| `check`: Checkmark confirmation | 340ms | iris | resin | 0.800 | 1.5% | Checkbox and radio indicators; retain a visible non-color state. | Apply the semantic state immediately; omit decorative movement. |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crystal-ui/core",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.6.0",
|
|
4
4
|
"description": "Crystal, Meridian's design system: design tokens, material stylesheets, a token resolver, a headless state core, motion recipes, icons and the specification.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"design-system",
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
"hover",
|
|
94
94
|
"focus"
|
|
95
95
|
],
|
|
96
|
-
"material": "Resin plane, Stone label backing, primary
|
|
96
|
+
"material": "Resin plane, Stone label backing, the primary pill behind the selected destination",
|
|
97
97
|
"surface": [
|
|
98
98
|
"dock"
|
|
99
99
|
],
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
"crystal": "The single shared plane, label weight for the current entry, elevation",
|
|
103
103
|
"product": "Destinations and routing",
|
|
104
104
|
"motion": [
|
|
105
|
-
"selection"
|
|
105
|
+
"selection-travel"
|
|
106
106
|
],
|
|
107
107
|
"parity": [
|
|
108
108
|
"mui:BottomNavigation",
|
|
@@ -148,7 +148,7 @@
|
|
|
148
148
|
"selected",
|
|
149
149
|
"disabled"
|
|
150
150
|
],
|
|
151
|
-
"material": "Resin strip, primary
|
|
151
|
+
"material": "Resin strip, the primary pill behind the selected tab",
|
|
152
152
|
"surface": [
|
|
153
153
|
"dock"
|
|
154
154
|
],
|
|
@@ -157,7 +157,8 @@
|
|
|
157
157
|
"crystal": "Strip material, label weight for the selected tab, focus ring",
|
|
158
158
|
"product": "The roving tabindex implementation and panel content",
|
|
159
159
|
"motion": [
|
|
160
|
-
"tab-in"
|
|
160
|
+
"tab-in",
|
|
161
|
+
"selection-travel"
|
|
161
162
|
],
|
|
162
163
|
"parity": [
|
|
163
164
|
"mantine:Tabs",
|
|
@@ -348,10 +349,10 @@
|
|
|
348
349
|
],
|
|
349
350
|
"geometry": "Pill; targets at least 44px; respects the safe area.",
|
|
350
351
|
"semantics": "role=\"navigation\"; the current destination carries aria-current=\"page\".",
|
|
351
|
-
"crystal": "Material, geometry, selection by label weight, safe-area inset",
|
|
352
|
+
"crystal": "Material, geometry, selection by label weight with the pill behind it, safe-area inset",
|
|
352
353
|
"product": "Destinations and routing",
|
|
353
354
|
"motion": [
|
|
354
|
-
"selection"
|
|
355
|
+
"selection-travel"
|
|
355
356
|
],
|
|
356
357
|
"parity": [
|
|
357
358
|
"mui:BottomNavigation"
|
|
@@ -79,10 +79,11 @@
|
|
|
79
79
|
],
|
|
80
80
|
"geometry": "Pill outer geometry; interior corners square against neighbours",
|
|
81
81
|
"semantics": "group role with an accessible name when the buttons are related",
|
|
82
|
-
"crystal": "The shared plane and interior separation",
|
|
82
|
+
"crystal": "The shared plane and interior separation; as a toggle set, the pill behind the pressed button",
|
|
83
83
|
"product": "Which actions are grouped",
|
|
84
84
|
"motion": [
|
|
85
|
-
"press"
|
|
85
|
+
"press",
|
|
86
|
+
"selection-travel"
|
|
86
87
|
],
|
|
87
88
|
"parity": [
|
|
88
89
|
"mantine:Button.Group",
|
|
@@ -463,7 +463,7 @@
|
|
|
463
463
|
"selected",
|
|
464
464
|
"disabled"
|
|
465
465
|
],
|
|
466
|
-
"material": "One Resin plane; primary
|
|
466
|
+
"material": "One Resin plane; the primary pill behind the selected segment",
|
|
467
467
|
"surface": [
|
|
468
468
|
"dock"
|
|
469
469
|
],
|
|
@@ -472,7 +472,7 @@
|
|
|
472
472
|
"crystal": "Shared plane, label weight for the selected segment, focus ring",
|
|
473
473
|
"product": "Options and change handling",
|
|
474
474
|
"motion": [
|
|
475
|
-
"selection"
|
|
475
|
+
"selection-travel"
|
|
476
476
|
],
|
|
477
477
|
"parity": [
|
|
478
478
|
"mantine:SegmentedControl",
|
package/tokens/catalogue.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$description": "Crystal component catalogue, combined. Generated from core/tokens/catalogue/.",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.6.0",
|
|
4
4
|
"surfaces": [
|
|
5
5
|
{
|
|
6
6
|
"id": "plastic",
|
|
@@ -166,7 +166,7 @@
|
|
|
166
166
|
"Haze"
|
|
167
167
|
],
|
|
168
168
|
"class": ".cr-indicator",
|
|
169
|
-
"use": "A 20px informational circle painting Haze on an isolated layer, or the
|
|
169
|
+
"use": "A 20px informational circle painting Haze on an isolated layer, or, as `.cr-indicator.pill`, the primary fill that travels behind the selected segment of a strip (D-37): tabs, a segmented control, the dock, bottom navigation or a toggle button group. The circle is Haze rather than Resin, because it sits on a surface that is often already translucent. Neither is ever the only mark of a selection: the selected segment keeps its label weight, and the circle never marks one at all."
|
|
170
170
|
},
|
|
171
171
|
{
|
|
172
172
|
"id": "status",
|
|
@@ -696,7 +696,7 @@
|
|
|
696
696
|
"hover",
|
|
697
697
|
"focus"
|
|
698
698
|
],
|
|
699
|
-
"material": "Resin plane, Stone label backing, primary
|
|
699
|
+
"material": "Resin plane, Stone label backing, the primary pill behind the selected destination",
|
|
700
700
|
"surface": [
|
|
701
701
|
"dock"
|
|
702
702
|
],
|
|
@@ -705,7 +705,7 @@
|
|
|
705
705
|
"crystal": "The single shared plane, label weight for the current entry, elevation",
|
|
706
706
|
"product": "Destinations and routing",
|
|
707
707
|
"motion": [
|
|
708
|
-
"selection"
|
|
708
|
+
"selection-travel"
|
|
709
709
|
],
|
|
710
710
|
"parity": [
|
|
711
711
|
"mui:BottomNavigation",
|
|
@@ -751,7 +751,7 @@
|
|
|
751
751
|
"selected",
|
|
752
752
|
"disabled"
|
|
753
753
|
],
|
|
754
|
-
"material": "Resin strip, primary
|
|
754
|
+
"material": "Resin strip, the primary pill behind the selected tab",
|
|
755
755
|
"surface": [
|
|
756
756
|
"dock"
|
|
757
757
|
],
|
|
@@ -760,7 +760,8 @@
|
|
|
760
760
|
"crystal": "Strip material, label weight for the selected tab, focus ring",
|
|
761
761
|
"product": "The roving tabindex implementation and panel content",
|
|
762
762
|
"motion": [
|
|
763
|
-
"tab-in"
|
|
763
|
+
"tab-in",
|
|
764
|
+
"selection-travel"
|
|
764
765
|
],
|
|
765
766
|
"parity": [
|
|
766
767
|
"mantine:Tabs",
|
|
@@ -951,10 +952,10 @@
|
|
|
951
952
|
],
|
|
952
953
|
"geometry": "Pill; targets at least 44px; respects the safe area.",
|
|
953
954
|
"semantics": "role=\"navigation\"; the current destination carries aria-current=\"page\".",
|
|
954
|
-
"crystal": "Material, geometry, selection by label weight, safe-area inset",
|
|
955
|
+
"crystal": "Material, geometry, selection by label weight with the pill behind it, safe-area inset",
|
|
955
956
|
"product": "Destinations and routing",
|
|
956
957
|
"motion": [
|
|
957
|
-
"selection"
|
|
958
|
+
"selection-travel"
|
|
958
959
|
],
|
|
959
960
|
"parity": [
|
|
960
961
|
"mui:BottomNavigation"
|
|
@@ -1149,10 +1150,11 @@
|
|
|
1149
1150
|
],
|
|
1150
1151
|
"geometry": "Pill outer geometry; interior corners square against neighbours",
|
|
1151
1152
|
"semantics": "group role with an accessible name when the buttons are related",
|
|
1152
|
-
"crystal": "The shared plane and interior separation",
|
|
1153
|
+
"crystal": "The shared plane and interior separation; as a toggle set, the pill behind the pressed button",
|
|
1153
1154
|
"product": "Which actions are grouped",
|
|
1154
1155
|
"motion": [
|
|
1155
|
-
"press"
|
|
1156
|
+
"press",
|
|
1157
|
+
"selection-travel"
|
|
1156
1158
|
],
|
|
1157
1159
|
"parity": [
|
|
1158
1160
|
"mantine:Button.Group",
|
|
@@ -1794,7 +1796,7 @@
|
|
|
1794
1796
|
"selected",
|
|
1795
1797
|
"disabled"
|
|
1796
1798
|
],
|
|
1797
|
-
"material": "One Resin plane; primary
|
|
1799
|
+
"material": "One Resin plane; the primary pill behind the selected segment",
|
|
1798
1800
|
"surface": [
|
|
1799
1801
|
"dock"
|
|
1800
1802
|
],
|
|
@@ -1803,7 +1805,7 @@
|
|
|
1803
1805
|
"crystal": "Shared plane, label weight for the selected segment, focus ring",
|
|
1804
1806
|
"product": "Options and change handling",
|
|
1805
1807
|
"motion": [
|
|
1806
|
-
"selection"
|
|
1808
|
+
"selection-travel"
|
|
1807
1809
|
],
|
|
1808
1810
|
"parity": [
|
|
1809
1811
|
"mantine:SegmentedControl",
|
|
@@ -144,6 +144,53 @@
|
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
146
|
},
|
|
147
|
+
{
|
|
148
|
+
"id": "selection-travel",
|
|
149
|
+
"category": "Controls",
|
|
150
|
+
"label": "Selection travel",
|
|
151
|
+
"duration": 460,
|
|
152
|
+
"engine": "Motion",
|
|
153
|
+
"keyframes": [
|
|
154
|
+
{
|
|
155
|
+
"transform": "translateX(-96px)",
|
|
156
|
+
"width": "88px",
|
|
157
|
+
"offset": 0
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
"transform": "translateX(0px)",
|
|
161
|
+
"width": "112px",
|
|
162
|
+
"offset": 1
|
|
163
|
+
}
|
|
164
|
+
],
|
|
165
|
+
"measured": "The keyframes are a sample: the pill leaving an 88px segment for the 112px segment beside it. A player measures both segments when the choice changes and substitutes the departing segment’s offset from the arriving one, and its size, for the first keyframe; the last keyframe is always the arriving segment where it stands. CrystalMotion.travel() does this on the web.",
|
|
166
|
+
"overshoot": "never",
|
|
167
|
+
"travelException": "The pill crosses its own strip from the segment that was chosen to the one that is; the strip is its bound, and the distance is wherever the two segments stand.",
|
|
168
|
+
"use": "The one .cr-indicator.pill behind the selected segment of tabs, a segmented control, the dock, bottom navigation or a toggle button group, moving to the new segment when the choice changes. Set the selected semantics first; selection stays label weight, so the pill is never the only sign of it. Critically damped: a pill that overshoots stands for a moment on a segment nobody chose.",
|
|
169
|
+
"reduced": "The pill is placed behind the new segment at once; nothing travels.",
|
|
170
|
+
"material": "resin",
|
|
171
|
+
"signature": "meniscus",
|
|
172
|
+
"spring": {
|
|
173
|
+
"stiffness": 773.7214,
|
|
174
|
+
"damping": 55.6317,
|
|
175
|
+
"mass": 1,
|
|
176
|
+
"dampingRatio": 1,
|
|
177
|
+
"platform": {
|
|
178
|
+
"swiftUI": {
|
|
179
|
+
"response": 0.2259,
|
|
180
|
+
"dampingFraction": 1
|
|
181
|
+
},
|
|
182
|
+
"compose": {
|
|
183
|
+
"dampingRatio": 1,
|
|
184
|
+
"stiffness": 773.7214
|
|
185
|
+
},
|
|
186
|
+
"web": {
|
|
187
|
+
"stiffness": 773.7214,
|
|
188
|
+
"damping": 55.6317,
|
|
189
|
+
"mass": 1
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
},
|
|
147
194
|
{
|
|
148
195
|
"id": "switch-on",
|
|
149
196
|
"category": "Controls",
|
package/tokens/surfaces.json
CHANGED
|
@@ -114,7 +114,7 @@
|
|
|
114
114
|
"name": "Indicator",
|
|
115
115
|
"materials": ["Haze"],
|
|
116
116
|
"class": ".cr-indicator",
|
|
117
|
-
"use": "A 20px informational circle painting Haze on an isolated layer, or the
|
|
117
|
+
"use": "A 20px informational circle painting Haze on an isolated layer, or, as `.cr-indicator.pill`, the primary fill that travels behind the selected segment of a strip (D-37): tabs, a segmented control, the dock, bottom navigation or a toggle button group. The circle is Haze rather than Resin, because it sits on a surface that is often already translucent. Neither is ever the only mark of a selection: the selected segment keeps its label weight, and the circle never marks one at all."
|
|
118
118
|
},
|
|
119
119
|
{
|
|
120
120
|
"id": "status",
|