@crystal-ui/core 2.7.0 → 2.8.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.
@@ -2057,6 +2057,86 @@ dialog.cr-dialog:has(> .cr-dialog-body):not([open]) {
2057
2057
  display: flex;
2058
2058
  }
2059
2059
 
2060
+ /* ---------------------------------------------------------------------------
2061
+ The choice box as a class, 2.8.0 (R-28, phase 2).
2062
+
2063
+ Crystal paints the checkbox, the radio and the switch on the native input
2064
+ (`input:is([type=checkbox],[type=radio])` above). A library that keeps the
2065
+ input visually hidden and draws the box on its own element, as React Aria
2066
+ does, could not wear that recipe and restated it by hand. `.cr-choice` is
2067
+ the same box on any element: the Resin box with the control light, the rim,
2068
+ the blur and the three-part shadow, at the published size and radius. The
2069
+ mark inside it, and the colour a selected box takes, stay the component's,
2070
+ because a native input draws its mark on `::after` and a component draws its
2071
+ own. `.radio` makes it a circle. A switch's track is the same box at the
2072
+ track's size and the pill radius.
2073
+
2074
+ `.outline` is the box a platform library drew instead (published as drift,
2075
+ by the ruling given with phase 1): the `--cr-outline` boundary in place of
2076
+ the rim, the plain Resin fill and blur, and a single inset rim, so that a
2077
+ selected box, which the component fills with the primary, reads as a solid
2078
+ mark against an outlined one.
2079
+
2080
+ Neither the native box nor the class had an opaque or reduced-transparency
2081
+ route before 2.8.0, so a Resin box kept its blur where every other Resin
2082
+ surface gave way. Both now become the surface with no backdrop. The routes
2083
+ name `.cr-choice.outline` inside `:is()` so they outrank the variant. A
2084
+ native switch that is on keeps its primary-soft track, because
2085
+ `:checked` outranks them; a selected state a component draws keeps its
2086
+ colour, because a component's own rule is unlayered.
2087
+ --------------------------------------------------------------------------- */
2088
+ .cr-choice {
2089
+ position: relative;
2090
+ display: inline-grid;
2091
+ place-items: center;
2092
+ flex: none;
2093
+ box-sizing: border-box;
2094
+ width: var(--cr-choice-box-size, 26px);
2095
+ height: var(--cr-choice-box-size, 26px);
2096
+ border: 1px solid var(--cr-rim);
2097
+ border-radius: var(--cr-choice-box-radius, 9px);
2098
+ background: linear-gradient(135deg,var(--cr-control-light),var(--cr-control-color)),var(--cr-resin-fill);
2099
+ -webkit-backdrop-filter: blur(var(--cr-resin-blur));
2100
+ backdrop-filter: blur(var(--cr-resin-blur));
2101
+ box-shadow: inset 0 2px 2px var(--cr-rim),0 2px 3px var(--cr-control-edge),0 5px 10px var(--cr-shadow-contact);
2102
+ }
2103
+ .cr-choice.radio {
2104
+ border-radius: 50%;
2105
+ }
2106
+ .cr-choice.outline {
2107
+ border-color: var(--cr-outline);
2108
+ background: var(--cr-resin-fill);
2109
+ -webkit-backdrop-filter: blur(var(--cr-resin-blur)) saturate(var(--cr-resin-saturation));
2110
+ backdrop-filter: blur(var(--cr-resin-blur)) saturate(var(--cr-resin-saturation));
2111
+ box-shadow: inset 0 2px 1px var(--cr-rim);
2112
+ }
2113
+ [data-effects=opaque] :is(.cr-choice.outline, .cr-choice, input:is([type=checkbox],[type=radio])) {
2114
+ background: var(--cr-surface);
2115
+ -webkit-backdrop-filter: none;
2116
+ backdrop-filter: none;
2117
+ }
2118
+ @media (prefers-reduced-transparency:reduce) {
2119
+ :is(.cr-choice.outline, .cr-choice, input:is([type=checkbox],[type=radio])) {
2120
+ background: var(--cr-surface);
2121
+ -webkit-backdrop-filter: none;
2122
+ backdrop-filter: none;
2123
+ }
2124
+ }
2125
+ @supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))) {
2126
+ :is(.cr-choice.outline, .cr-choice) {
2127
+ background: var(--cr-surface);
2128
+ }
2129
+ }
2130
+ @media (forced-colors:active) {
2131
+ :is(.cr-choice.outline, .cr-choice) {
2132
+ background: Field;
2133
+ border-color: FieldText;
2134
+ box-shadow: none;
2135
+ -webkit-backdrop-filter: none;
2136
+ backdrop-filter: none;
2137
+ }
2138
+ }
2139
+
2060
2140
  /* A count (D-27).
2061
2141
  *
2062
2142
  * `.cr-resin-haze` is sized for a tag: its Haze pad is inset by
package/docs/catalogue.md CHANGED
@@ -33,9 +33,9 @@ Every component is made of one or more of these surfaces. Its Surface row names
33
33
  | Surface | Materials | Recipe | Components | Use |
34
34
  | --- | --- | --- | --- | --- |
35
35
  | <a id="surface-plastic"></a>**Plastic foundation** `plastic` | Plastic | <code>.cr-plastic</code> | 6 | The root scene or window. One contextual, opaque foundation per view; never a component. |
36
- | <a id="surface-frost"></a>**Frost panel** `frost` | Frost | <code>.cr-frost</code> | 48 | Intermediate task frames and every transient surface that opens over content: side panels, drawers, sheets and app bars, and menus, popovers, tooltips and toasts (R15e). Reading content inside it sits on Haze. `.cr-frost.bar` is a transient overlay shaped as a row of controls, a pill with 4px padding: the selection toolbar over highlighted text. `.pane` takes the content radius, for a pane beside content: a navigation rail, a filter panel, a workspace pane. `.flat` drops the grain. `.docked` is a pane docked to the window's edges, with no rim, radius or shadow: an app bar, a sidebar. `.sheet` slides over content from an edge, with the `--cr-edge` rim, the content radius and the float shadow: a drawer. `.reading` holds a Haze reading fill on `::after`, inset by `--cr-frost-reading-inset` (default `--cr-haze-inset`): a toast, a popover. `.flat` composes with `.pane`, `.docked` and `.sheet` (2.7.0). |
37
- | <a id="surface-haze"></a>**Haze reading surface** `haze` | Haze | <code>.cr-haze</code> | 88 | Anything read: cards, rows, panels, wells, forms, messages, decisions. 80% fill, 1.95px feather on an isolated paint layer, crisp foreground. `.cr-well` is the same recipe recessed into a Frost or Resin frame. `.cr-haze.overlay` is the recessed overlay: a transient overlay opened inside a pane that is already lifted, drawn as a flat Haze fill with the `--cr-edge` rim and the content shadow, so it can be told from the pane it sits in. `.inset` is a reading card with no border box, its fill inset by `--cr-haze-inset` and no shadow under it: an alert, a result, a product card. `.flush` is the same card filled to its own edge: a thumbnail, a slide, a chart node. `.flat` is the fill on the element itself, with no feather and no layer: a list or accordion row. `.flat.sunken` falls back to the alternate surface instead of the surface: a placeholder. `.raised` gives the fill the float shadow: a command palette (2.7.0). |
38
- | <a id="surface-resin"></a>**Resin plane** `resin` | Resin | <code>.cr-resin</code> | 12 | One floating Resin plane with no reading fill of its own, pill-shaped unless it is a panel: a player's transport bar, a pinned element, a Resin handle over imagery or between regions. Controls inside it lose their own backdrop filter, because Resin never contains Resin. A plane whose controls are labels to be read holds a Haze fill as well, and is a dock. `.cr-resin.transport` is the media transport: the pill with 4px block and 12px inline padding around its 48px controls (58px tall with its rim), with tabular time readouts, wrapping to a second row in a player narrower than 420px. `.cr-media` is the stage it sits on (the content radius, the letterbox, `--cr-media-aspect` and `--cr-media-fit`), and `.cr-media-bar` is the region inset 12px, or the safe area in full screen, that holds the transport. `.flat` drops the sheen layers, for a plane that is a mark rather than a control: a step or timeline marker. `.divider` is the handle between resizable regions: the Resin fill and blur only, with no rim, shadow or sheen, falling back to the outline colour (2.7.0). |
36
+ | <a id="surface-frost"></a>**Frost panel** `frost` | Frost | <code>.cr-frost</code> | 47 | Intermediate task frames and every transient surface that opens over content: side panels, drawers, sheets and app bars, and menus, popovers, tooltips and toasts (R15e). Reading content inside it sits on Haze. `.cr-frost.bar` is a transient overlay shaped as a row of controls, a pill with 4px padding: the selection toolbar over highlighted text. `.pane` takes the content radius, for a pane beside content: a navigation rail, a filter panel, a workspace pane. `.flat` drops the grain. `.docked` is a pane docked to the window's edges, with no rim, radius or shadow: an app bar, a sidebar. `.sheet` slides over content from an edge, with the `--cr-edge` rim, the content radius and the float shadow: a drawer. `.reading` holds a Haze reading fill on `::after`, inset by `--cr-frost-reading-inset` (default `--cr-haze-inset`): a toast, a popover. `.flat` composes with `.pane`, `.docked` and `.sheet` (2.7.0). |
37
+ | <a id="surface-haze"></a>**Haze reading surface** `haze` | Haze | <code>.cr-haze</code> | 85 | Anything read: cards, rows, panels, wells, forms, messages, decisions. 80% fill, 1.95px feather on an isolated paint layer, crisp foreground. `.cr-well` is the same recipe recessed into a Frost or Resin frame. `.cr-haze.overlay` is the recessed overlay: a transient overlay opened inside a pane that is already lifted, drawn as a flat Haze fill with the `--cr-edge` rim and the content shadow, so it can be told from the pane it sits in. `.inset` is a reading card with no border box, its fill inset by `--cr-haze-inset` and no shadow under it: an alert, a result, a product card. `.flush` is the same card filled to its own edge: a thumbnail, a slide, a chart node. `.flat` is the fill on the element itself, with no feather and no layer: a list or accordion row. `.flat.sunken` falls back to the alternate surface instead of the surface: a placeholder. `.raised` gives the fill the float shadow: a command palette (2.7.0). |
38
+ | <a id="surface-resin"></a>**Resin plane** `resin` | Resin | <code>.cr-resin</code> | 13 | One floating Resin plane with no reading fill of its own, pill-shaped unless it is a panel: a player's transport bar, a pinned element, a Resin handle over imagery or between regions. Controls inside it lose their own backdrop filter, because Resin never contains Resin. A plane whose controls are labels to be read holds a Haze fill as well, and is a dock. `.cr-resin.transport` is the media transport: the pill with 4px block and 12px inline padding around its 48px controls (58px tall with its rim), with tabular time readouts, wrapping to a second row in a player narrower than 420px. `.cr-media` is the stage it sits on (the content radius, the letterbox, `--cr-media-aspect` and `--cr-media-fit`), and `.cr-media-bar` is the region inset 12px, or the safe area in full screen, that holds the transport. `.flat` drops the sheen layers, for a plane that is a mark rather than a control: a step or timeline marker. `.divider` is the handle between resizable regions: the Resin fill and blur only, with no rim, shadow or sheen, falling back to the outline colour (2.7.0). |
39
39
  | <a id="surface-resin-panel"></a>**Resin panel** `resin-panel` | Resin | <code>.cr-resin.panel</code> | 1 | The Resin plane with the content radius instead of the pill, for a floating control plane that is a rectangle: a floating window, a media control bar wider than it is tall. Same fill, rim, blur and float shadow; only the geometry changes. |
40
40
  | <a id="surface-control"></a>**Resin control** `control` | Resin + Haze | <code>.cr-button</code> | 16 | An action: a Resin shell with the 8px-inset Haze reading pad and the optical sheen. Pill geometry with `.cr-button`, which coats a `button` or an `a`; `.cr-control` coats any element. `.primary` tints the pad, `.quiet` removes it, `.danger` adds the destructive boundary. Selected state is the primary pad plus label weight 800. |
41
41
  | <a id="surface-field"></a>**Field shell** `field` | Resin + Haze | <code>.cr-field-shell</code> | 28 | The Resin surround of a native text entry, with the Haze well the value is read on and the circular field-state badge. The native control keeps its functional boundary and semantics. `.cr-editor` is the editable surface inside a rich text field: the shared prose vocabulary (headings, lists, checklists, marks, insertions and deletions) with the primary caret and a 28% primary selection, distinct from the primary-soft highlight (D-34). `.cr-editor-toolbar` is its toolbar, above the text on a fine pointer and below it, clear of the touch keyboard, on a coarse one. `.block` is the shell as a block that fills its row, for a field laid out in a form (2.7.0). |
@@ -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. The opaque setting draws it as the flat fallback fill, as reduced transparency does (2.7.0). |
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 `&lt;dialog&gt;`; 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, 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. |
46
+ | <a id="surface-indicator"></a>**Indicator** `indicator` | Haze | <code>.cr-indicator</code> | 1 | 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. |
@@ -52,9 +52,9 @@ Every component is made of one or more of these surfaces. Its Surface row names
52
52
  | <a id="surface-nav-item"></a>**Navigation entry** `nav-item` | None | <code>.cr-nav-item</code> | 2 | An entry in side navigation, a rail or a tree of destinations. It has no material of its own, sits on the panel beneath it, and carries selection by label weight alone. Pill hit area, 44px target. `.stacked` puts the icon above the label for a rail. Adopted from the documentation site's side menu, which docs/components.md names as the reference implementation of selection. |
53
53
  | <a id="surface-bare"></a>**Bare control** `bare` | None | <code>.cr-bare</code> | 0 | A control that must not wear the Resin coat because it sits inside a surface that already has one: a disclosure chevron, a chip's remove button, a sort header, a stepper's arrows, a dismiss button on a toast. Crystal paints every button by element, so this class subtracts the fill, the shadow, the backdrop filter and both pseudo-layers. The focus ring and the target floor stay. |
54
54
  | <a id="surface-drag-handle"></a>**Drag handle** `drag-handle` | None | <code>.cr-drag-handle</code> | 1 | A bare control with a grip glyph and a lift while dragging. Keyboard drag is the product's; the handle only says it can be grabbed and when it has been. |
55
- | <a id="surface-choice"></a>**Selection control** `choice` | Resin | <code>input:is([type=checkbox],[type=radio])</code> | 5 | Native checkbox, radio, switch and range, styled by element: a Resin box, circle or track with a contained mark, and the marked glass thumb. Semantics stay native. |
55
+ | <a id="surface-choice"></a>**Selection control** `choice` | Resin | <code>input:is([type=checkbox],[type=radio])</code> | 5 | Native checkbox, radio, switch and range, styled by element: a Resin box, circle or track with a contained mark, and the marked glass thumb. Semantics stay native. `.cr-choice` is the same box on any element, for a library that keeps the input visually hidden and draws the box itself (2.8.0); `.radio` is the circle, and a switch's track is the box at the track's size with the pill radius. The mark and the selected colour are the component's. `.cr-choice.outline` is the outlined box: the `--cr-outline` boundary, the plain Resin fill and a single inset rim (2.8.0). In opaque mode and under reduced transparency the box, native or not, becomes the surface with no backdrop (2.8.0). |
56
56
  | <a id="surface-native"></a>**Native control furniture** `native` | None | <code>select option</code> | 0 | Parts of native controls the browser draws and Crystal tints: select options, the file button. Platform-owned popups keep platform drawing. |
57
- | <a id="surface-none"></a>**No surface of its own** `none` | None | None | 104 | Layout, typography, behaviour and drawing components that inherit whatever they sit on. A chart's marks, a divider, a provider. |
57
+ | <a id="surface-none"></a>**No surface of its own** `none` | None | None | 106 | Layout, typography, behaviour and drawing components that inherit whatever they sit on. A chart's marks, a divider, a provider. |
58
58
 
59
59
  ## Layout and structure
60
60
 
@@ -1727,8 +1727,8 @@ Ordered events on a connector with per-event markers.
1727
1727
 
1728
1728
  <div class="cr-table-scroll"><table class="cr-table cr-table-properties"><tbody>
1729
1729
  <tr><th scope="row">States</th><td>complete, current, upcoming, error</td></tr>
1730
- <tr><th scope="row">Material</th><td>Indicator markers on a Haze connector</td></tr>
1731
- <tr><th scope="row">Surface</th><td><a href="#surface-indicator">Indicator</a> → <a href="#surface-haze">Haze reading surface</a></td></tr>
1730
+ <tr><th scope="row">Material</th><td>Resin markers (`.cr-resin.flat`) on a 2px connector in `--cr-haze-fill`</td></tr>
1731
+ <tr><th scope="row">Surface</th><td><a href="#surface-resin">Resin plane</a></td></tr>
1732
1732
  <tr><th scope="row">Geometry</th><td>Circular markers; 2px connector</td></tr>
1733
1733
  <tr><th scope="row">Semantics</th><td>Ordered list; the current item carries aria-current</td></tr>
1734
1734
  <tr><th scope="row">Crystal supplies</th><td>Marker and connector treatment, state appearance</td></tr>
@@ -2224,8 +2224,8 @@ Placeholder shapes matching the layout of content that is loading.
2224
2224
 
2225
2225
  <div class="cr-table-scroll"><table class="cr-table cr-table-properties"><tbody>
2226
2226
  <tr><th scope="row">States</th><td>loading, resolving</td></tr>
2227
- <tr><th scope="row">Material</th><td>Haze fill with a slow luminance sweep</td></tr>
2228
- <tr><th scope="row">Surface</th><td><a href="#surface-haze">Haze reading surface</a></td></tr>
2227
+ <tr><th scope="row">Material</th><td>The alternate surface (`--cr-surface-alt`) with a slow luminance sweep: a placeholder, not a reading surface</td></tr>
2228
+ <tr><th scope="row">Surface</th><td><a href="#surface-none">No surface of its own</a></td></tr>
2229
2229
  <tr><th scope="row">Geometry</th><td>Matches the real content's radius and rhythm exactly</td></tr>
2230
2230
  <tr><th scope="row">Semantics</th><td>aria-hidden with a live region announcing loading; must not be read as content</td></tr>
2231
2231
  <tr><th scope="row">Crystal supplies</th><td>Fill, sweep, reduced-motion fallback, resolve transition</td></tr>
@@ -3105,8 +3105,8 @@ Shows where a dragged item will land.
3105
3105
 
3106
3106
  <div class="cr-table-scroll"><table class="cr-table cr-table-properties"><tbody>
3107
3107
  <tr><th scope="row">States</th><td>hidden, shown, invalid-target</td></tr>
3108
- <tr><th scope="row">Material</th><td>Haze line or fill</td></tr>
3109
- <tr><th scope="row">Surface</th><td><a href="#surface-haze">Haze reading surface</a></td></tr>
3108
+ <tr><th scope="row">Material</th><td>A 2px line in `--cr-primary`, or `--cr-danger-ink` where the drop is refused: a control affordance, not a material</td></tr>
3109
+ <tr><th scope="row">Surface</th><td><a href="#surface-none">No surface of its own</a></td></tr>
3110
3110
  <tr><th scope="row">Geometry</th><td>Follows the gap between items rather than covering one.</td></tr>
3111
3111
  <tr><th scope="row">Semantics</th><td>Announced as the drag moves, so a keyboard drag is followable without sight.</td></tr>
3112
3112
  <tr><th scope="row">Crystal supplies</th><td>Indicator material and motion</td></tr>
@@ -4314,8 +4314,8 @@ A table with toolbar, filters, bulk actions and pagination.
4314
4314
 
4315
4315
  <div class="cr-table-scroll"><table class="cr-table cr-table-properties"><tbody>
4316
4316
  <tr><th scope="row">States</th><td>at-rest, loading, empty, selecting, error</td></tr>
4317
- <tr><th scope="row">Material</th><td>Table surface with Frost overlays</td></tr>
4318
- <tr><th scope="row">Surface</th><td><a href="#surface-table">Table</a> → <a href="#surface-frost">Frost panel</a></td></tr>
4317
+ <tr><th scope="row">Material</th><td>The table surface; an overlay the product opens from the toolbar brings its own surface</td></tr>
4318
+ <tr><th scope="row">Surface</th><td><a href="#surface-table">Table</a></td></tr>
4319
4319
  <tr><th scope="row">Geometry</th><td>Toolbar controls are pills; the table keeps its own surface.</td></tr>
4320
4320
  <tr><th scope="row">Semantics</th><td>Selection count is announced; bulk actions describe what they will affect.</td></tr>
4321
4321
  <tr><th scope="row">Crystal supplies</th><td>Surfaces, selection treatment, the motion of entering bulk mode</td></tr>
@@ -17,7 +17,7 @@ The package contains working CSS primitives and a bounded interactive reference.
17
17
  | Quiet action | The same shell with no reading fill, so the label sits directly on the material | `.cr-button.quiet`; same semantics as any action |
18
18
  | Destructive action | Resin/Haze with independent danger boundary and explicit label | `.danger`; app supplies consequence-specific confirmation and recovery |
19
19
  | Text field | Visible label, state badge, glowing focus ring, validation, helper/error association | `.cr-input`; working native form example; app supplies validation rules |
20
- | Selection control | Explicit selected state plus text/mark | Native checkbox, radio and select, styled by `assets/crystal.css` as of 2.1.0, and the native switch (`input[type=checkbox][role=switch]`) as of 2.2.0; keyboard semantics must match the component |
20
+ | Selection control | Explicit selected state plus text/mark | Native checkbox, radio and select, styled by `assets/crystal.css` as of 2.1.0, and the native switch (`input[type=checkbox][role=switch]`) as of 2.2.0. Where a library keeps the input hidden and draws the box itself, the box wears `.cr-choice` (`.radio` for a circle, `.outline` for the outlined box) as of 2.8.0; keyboard semantics must match the component |
21
21
  | Navigation entry | No material of its own; pill hit area; selection by label weight; current location by a flat primary dot on `aria-current`, inside the entry's own padding so the label never moves | `.cr-nav-item`, `.stacked` for a rail. Routing and the current-page state are app-owned |
22
22
  | Bare control | A control inside a coated surface: no fill, shadow, blur or pseudo-layers; target and focus ring kept | `.cr-bare`; the action itself is app-owned |
23
23
  | Drag handle | Grip glyph, grab cursor, lift while held | `.cr-drag-handle` with `aria-grabbed` or `data-dragging`; pointer capture, keyboard drag and drop validation are app-owned |
@@ -128,6 +128,8 @@ The material variants of 2.7.0 add no surface either. Each was a surface a platf
128
128
  | `.cr-resin.flat` | Resin plane | No sheen: a plane that is a mark rather than a control, such as a step or timeline marker. |
129
129
  | `.cr-resin.divider` | Resin plane | The handle between resizable regions: the Resin fill and blur only, with no rim, shadow or sheen. Where the fill gives way it becomes the outline colour, so the line stays visible on the surface it divides, and CanvasText in forced colours. |
130
130
  | `.cr-field-shell.block` | Field shell | The shell as a block that fills its row, for a field laid out in a form rather than set in a line of text. |
131
+ | `.cr-choice`, `.radio` | Selection control | The native checkbox's box on any element, for a library that keeps the input hidden and draws the box itself (2.8.0). A switch's track is the same box at the track's size with the pill radius. The mark and the selected colour are the component's. |
132
+ | `.cr-choice.outline` | Selection control | The outlined box: the `--cr-outline` boundary, the plain Resin fill and a single inset rim (2.8.0). In opaque mode and under reduced transparency every choice box, native or not, becomes the surface with no backdrop. |
131
133
 
132
134
  Two existing recipes changed in 2.7.0. `.cr-mirage` and a dialog's `::backdrop` now take the flat fallback fill with no backdrop filter under `[data-effects=opaque]`, as they already did under reduced transparency; before, the opaque setting left the largest translucent area on screen translucent. And `.cr-bare`, `.cr-nav-item` and `.cr-drag-handle` on a `<button>` now stay transparent under `[data-effects=opaque]`: the coat's opaque route had outranked them, drawing the surface behind a bare control and erasing the drag handle's grip.
133
135
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crystal-ui/core",
3
- "version": "2.7.0",
3
+ "version": "2.8.1",
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",
@@ -317,10 +317,9 @@
317
317
  "upcoming",
318
318
  "error"
319
319
  ],
320
- "material": "Indicator markers on a Haze connector",
320
+ "material": "Resin markers (`.cr-resin.flat`) on a 2px connector in `--cr-haze-fill`",
321
321
  "surface": [
322
- "indicator",
323
- "haze"
322
+ "resin"
324
323
  ],
325
324
  "geometry": "Circular markers; 2px connector",
326
325
  "semantics": "Ordered list; the current item carries aria-current",
@@ -179,9 +179,9 @@
179
179
  "loading",
180
180
  "resolving"
181
181
  ],
182
- "material": "Haze fill with a slow luminance sweep",
182
+ "material": "The alternate surface (`--cr-surface-alt`) with a slow luminance sweep: a placeholder, not a reading surface",
183
183
  "surface": [
184
- "haze"
184
+ "none"
185
185
  ],
186
186
  "geometry": "Matches the real content's radius and rhythm exactly",
187
187
  "semantics": "aria-hidden with a live region announcing loading; must not be read as content",
@@ -429,9 +429,9 @@
429
429
  "shown",
430
430
  "invalid-target"
431
431
  ],
432
- "material": "Haze line or fill",
432
+ "material": "A 2px line in `--cr-primary`, or `--cr-danger-ink` where the drop is refused: a control affordance, not a material",
433
433
  "surface": [
434
- "haze"
434
+ "none"
435
435
  ],
436
436
  "geometry": "Follows the gap between items rather than covering one.",
437
437
  "semantics": "Announced as the drag moves, so a keyboard drag is followable without sight.",
@@ -82,10 +82,9 @@
82
82
  "selecting",
83
83
  "error"
84
84
  ],
85
- "material": "Table surface with Frost overlays",
85
+ "material": "The table surface; an overlay the product opens from the toolbar brings its own surface",
86
86
  "surface": [
87
- "table",
88
- "frost"
87
+ "table"
89
88
  ],
90
89
  "geometry": "Toolbar controls are pills; the table keeps its own surface.",
91
90
  "semantics": "Selection count is announced; bulk actions describe what they will affect.",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$description": "Crystal component catalogue, combined. Generated from core/tokens/catalogue/.",
3
- "version": "2.7.0",
3
+ "version": "2.8.1",
4
4
  "surfaces": [
5
5
  {
6
6
  "id": "plastic",
@@ -277,10 +277,16 @@
277
277
  "class": "input:is([type=checkbox],[type=radio])",
278
278
  "also": [
279
279
  "input[type=checkbox][role=switch]",
280
- "input[type=range]"
280
+ "input[type=range]",
281
+ ".cr-choice",
282
+ ".cr-choice.radio",
283
+ ".cr-choice.outline"
281
284
  ],
282
- "use": "Native checkbox, radio, switch and range, styled by element: a Resin box, circle or track with a contained mark, and the marked glass thumb. Semantics stay native.",
285
+ "use": "Native checkbox, radio, switch and range, styled by element: a Resin box, circle or track with a contained mark, and the marked glass thumb. Semantics stay native. `.cr-choice` is the same box on any element, for a library that keeps the input visually hidden and draws the box itself (2.8.0); `.radio` is the circle, and a switch's track is the box at the track's size with the pill radius. The mark and the selected colour are the component's. `.cr-choice.outline` is the outlined box: the `--cr-outline` boundary, the plain Resin fill and a single inset rim (2.8.0). In opaque mode and under reduced transparency the box, native or not, becomes the surface with no backdrop (2.8.0).",
283
286
  "partial": {
287
+ ".cr-choice": "The box alone: the mark inside it and the colour of a selected box are drawn by the component that wears it.",
288
+ ".cr-choice.radio": "The box alone, round: the dot inside it is the component's.",
289
+ ".cr-choice.outline": "The box alone: the mark inside it and the colour of a selected box are drawn by the component that wears it.",
284
290
  "input[type=range]": "A track and a thumb, painted on the slider's pseudo-elements (`::-webkit-slider-runnable-track`, `::-webkit-slider-thumb` and their `::-moz-range-` forms), which this record does not read."
285
291
  }
286
292
  },
@@ -3192,10 +3198,9 @@
3192
3198
  "upcoming",
3193
3199
  "error"
3194
3200
  ],
3195
- "material": "Indicator markers on a Haze connector",
3201
+ "material": "Resin markers (`.cr-resin.flat`) on a 2px connector in `--cr-haze-fill`",
3196
3202
  "surface": [
3197
- "indicator",
3198
- "haze"
3203
+ "resin"
3199
3204
  ],
3200
3205
  "geometry": "Circular markers; 2px connector",
3201
3206
  "semantics": "Ordered list; the current item carries aria-current",
@@ -3993,9 +3998,9 @@
3993
3998
  "loading",
3994
3999
  "resolving"
3995
4000
  ],
3996
- "material": "Haze fill with a slow luminance sweep",
4001
+ "material": "The alternate surface (`--cr-surface-alt`) with a slow luminance sweep: a placeholder, not a reading surface",
3997
4002
  "surface": [
3998
- "haze"
4003
+ "none"
3999
4004
  ],
4000
4005
  "geometry": "Matches the real content's radius and rhythm exactly",
4001
4006
  "semantics": "aria-hidden with a live region announcing loading; must not be read as content",
@@ -5312,9 +5317,9 @@
5312
5317
  "shown",
5313
5318
  "invalid-target"
5314
5319
  ],
5315
- "material": "Haze line or fill",
5320
+ "material": "A 2px line in `--cr-primary`, or `--cr-danger-ink` where the drop is refused: a control affordance, not a material",
5316
5321
  "surface": [
5317
- "haze"
5322
+ "none"
5318
5323
  ],
5319
5324
  "geometry": "Follows the gap between items rather than covering one.",
5320
5325
  "semantics": "Announced as the drag moves, so a keyboard drag is followable without sight.",
@@ -7143,10 +7148,9 @@
7143
7148
  "selecting",
7144
7149
  "error"
7145
7150
  ],
7146
- "material": "Table surface with Frost overlays",
7151
+ "material": "The table surface; an overlay the product opens from the toolbar brings its own surface",
7147
7152
  "surface": [
7148
- "table",
7149
- "frost"
7153
+ "table"
7150
7154
  ],
7151
7155
  "geometry": "Toolbar controls are pills; the table keeps its own surface.",
7152
7156
  "semantics": "Selection count is announced; bulk actions describe what they will affect.",
@@ -4282,8 +4282,20 @@
4282
4282
  }
4283
4283
  },
4284
4284
  "fallbacks": {
4285
- "opaque": null,
4286
- "reducedTransparency": null,
4285
+ "opaque": {
4286
+ "declarations": {
4287
+ "-webkit-backdrop-filter": "none",
4288
+ "backdrop-filter": "none",
4289
+ "background": "var(--cr-surface)"
4290
+ }
4291
+ },
4292
+ "reducedTransparency": {
4293
+ "declarations": {
4294
+ "-webkit-backdrop-filter": "none",
4295
+ "backdrop-filter": "none",
4296
+ "background": "var(--cr-surface)"
4297
+ }
4298
+ },
4287
4299
  "forcedColors": {
4288
4300
  "declarations": {
4289
4301
  "-webkit-backdrop-filter": "none",
@@ -4354,8 +4366,20 @@
4354
4366
  }
4355
4367
  },
4356
4368
  "fallbacks": {
4357
- "opaque": null,
4358
- "reducedTransparency": null,
4369
+ "opaque": {
4370
+ "declarations": {
4371
+ "-webkit-backdrop-filter": "none",
4372
+ "backdrop-filter": "none",
4373
+ "background": "var(--cr-surface)"
4374
+ }
4375
+ },
4376
+ "reducedTransparency": {
4377
+ "declarations": {
4378
+ "-webkit-backdrop-filter": "none",
4379
+ "backdrop-filter": "none",
4380
+ "background": "var(--cr-surface)"
4381
+ }
4382
+ },
4359
4383
  "forcedColors": {
4360
4384
  "declarations": {
4361
4385
  "-webkit-backdrop-filter": "none",
@@ -4435,8 +4459,20 @@
4435
4459
  }
4436
4460
  },
4437
4461
  "fallbacks": {
4438
- "opaque": null,
4439
- "reducedTransparency": null,
4462
+ "opaque": {
4463
+ "declarations": {
4464
+ "-webkit-backdrop-filter": "none",
4465
+ "backdrop-filter": "none",
4466
+ "background": "var(--cr-surface)"
4467
+ }
4468
+ },
4469
+ "reducedTransparency": {
4470
+ "declarations": {
4471
+ "-webkit-backdrop-filter": "none",
4472
+ "backdrop-filter": "none",
4473
+ "background": "var(--cr-surface)"
4474
+ }
4475
+ },
4440
4476
  "forcedColors": {
4441
4477
  "declarations": {
4442
4478
  "-webkit-backdrop-filter": "none",
@@ -4566,6 +4602,179 @@
4566
4602
  "radius"
4567
4603
  ],
4568
4604
  "why": "A track and a thumb, painted on the slider's pseudo-elements (`::-webkit-slider-runnable-track`, `::-webkit-slider-thumb` and their `::-moz-range-` forms), which this record does not read."
4605
+ },
4606
+ ".cr-choice": {
4607
+ "selector": ".cr-choice",
4608
+ "fill": "linear-gradient(135deg,var(--cr-control-light),var(--cr-control-color)),var(--cr-resin-fill)",
4609
+ "blur": "var(--cr-resin-blur)",
4610
+ "saturation": null,
4611
+ "rim": "1px solid var(--cr-rim)",
4612
+ "shadow": "inset 0 2px 2px var(--cr-rim),0 2px 3px var(--cr-control-edge),0 5px 10px var(--cr-shadow-contact)",
4613
+ "radius": "var(--cr-choice-box-radius, 9px)",
4614
+ "padding": null,
4615
+ "haze": null,
4616
+ "feather": null,
4617
+ "extras": {
4618
+ "box-sizing": "border-box",
4619
+ "display": "inline-grid",
4620
+ "flex": "none",
4621
+ "height": "var(--cr-choice-box-size, 26px)",
4622
+ "place-items": "center",
4623
+ "position": "relative",
4624
+ "width": "var(--cr-choice-box-size, 26px)"
4625
+ },
4626
+ "layers": {},
4627
+ "fallbacks": {
4628
+ "opaque": {
4629
+ "declarations": {
4630
+ "-webkit-backdrop-filter": "none",
4631
+ "backdrop-filter": "none",
4632
+ "background": "var(--cr-surface)"
4633
+ }
4634
+ },
4635
+ "reducedTransparency": {
4636
+ "declarations": {
4637
+ "-webkit-backdrop-filter": "none",
4638
+ "backdrop-filter": "none",
4639
+ "background": "var(--cr-surface)"
4640
+ }
4641
+ },
4642
+ "forcedColors": {
4643
+ "declarations": {
4644
+ "-webkit-backdrop-filter": "none",
4645
+ "backdrop-filter": "none",
4646
+ "background": "Field",
4647
+ "border-color": "FieldText",
4648
+ "box-shadow": "none"
4649
+ }
4650
+ },
4651
+ "noBackdropFilter": {
4652
+ "declarations": {
4653
+ "background": "var(--cr-surface)"
4654
+ }
4655
+ }
4656
+ },
4657
+ "conditions": {},
4658
+ "shadowed": [],
4659
+ "diagnostics": [],
4660
+ "missing": [],
4661
+ "why": "The box alone: the mark inside it and the colour of a selected box are drawn by the component that wears it."
4662
+ },
4663
+ ".cr-choice.radio": {
4664
+ "selector": ".cr-choice.radio",
4665
+ "fill": "linear-gradient(135deg,var(--cr-control-light),var(--cr-control-color)),var(--cr-resin-fill)",
4666
+ "blur": "var(--cr-resin-blur)",
4667
+ "saturation": null,
4668
+ "rim": "1px solid var(--cr-rim)",
4669
+ "shadow": "inset 0 2px 2px var(--cr-rim),0 2px 3px var(--cr-control-edge),0 5px 10px var(--cr-shadow-contact)",
4670
+ "radius": "50%",
4671
+ "padding": null,
4672
+ "haze": null,
4673
+ "feather": null,
4674
+ "extras": {
4675
+ "box-sizing": "border-box",
4676
+ "display": "inline-grid",
4677
+ "flex": "none",
4678
+ "height": "var(--cr-choice-box-size, 26px)",
4679
+ "place-items": "center",
4680
+ "position": "relative",
4681
+ "width": "var(--cr-choice-box-size, 26px)"
4682
+ },
4683
+ "layers": {},
4684
+ "fallbacks": {
4685
+ "opaque": {
4686
+ "declarations": {
4687
+ "-webkit-backdrop-filter": "none",
4688
+ "backdrop-filter": "none",
4689
+ "background": "var(--cr-surface)"
4690
+ }
4691
+ },
4692
+ "reducedTransparency": {
4693
+ "declarations": {
4694
+ "-webkit-backdrop-filter": "none",
4695
+ "backdrop-filter": "none",
4696
+ "background": "var(--cr-surface)"
4697
+ }
4698
+ },
4699
+ "forcedColors": {
4700
+ "declarations": {
4701
+ "-webkit-backdrop-filter": "none",
4702
+ "backdrop-filter": "none",
4703
+ "background": "Field",
4704
+ "border-color": "FieldText",
4705
+ "box-shadow": "none"
4706
+ }
4707
+ },
4708
+ "noBackdropFilter": {
4709
+ "declarations": {
4710
+ "background": "var(--cr-surface)"
4711
+ }
4712
+ }
4713
+ },
4714
+ "conditions": {},
4715
+ "shadowed": [],
4716
+ "diagnostics": [],
4717
+ "missing": [],
4718
+ "why": "The box alone, round: the dot inside it is the component's."
4719
+ },
4720
+ ".cr-choice.outline": {
4721
+ "selector": ".cr-choice.outline",
4722
+ "fill": "var(--cr-resin-fill)",
4723
+ "blur": "var(--cr-resin-blur)",
4724
+ "saturation": "var(--cr-resin-saturation)",
4725
+ "rim": "1px solid var(--cr-outline)",
4726
+ "shadow": "inset 0 2px 1px var(--cr-rim)",
4727
+ "radius": "var(--cr-choice-box-radius, 9px)",
4728
+ "padding": null,
4729
+ "haze": null,
4730
+ "feather": null,
4731
+ "extras": {
4732
+ "box-sizing": "border-box",
4733
+ "display": "inline-grid",
4734
+ "flex": "none",
4735
+ "height": "var(--cr-choice-box-size, 26px)",
4736
+ "place-items": "center",
4737
+ "position": "relative",
4738
+ "width": "var(--cr-choice-box-size, 26px)"
4739
+ },
4740
+ "layers": {},
4741
+ "fallbacks": {
4742
+ "opaque": {
4743
+ "declarations": {
4744
+ "-webkit-backdrop-filter": "none",
4745
+ "backdrop-filter": "none",
4746
+ "background": "var(--cr-surface)"
4747
+ }
4748
+ },
4749
+ "reducedTransparency": {
4750
+ "declarations": {
4751
+ "-webkit-backdrop-filter": "none",
4752
+ "backdrop-filter": "none",
4753
+ "background": "var(--cr-surface)"
4754
+ }
4755
+ },
4756
+ "forcedColors": {
4757
+ "declarations": {
4758
+ "-webkit-backdrop-filter": "none",
4759
+ "backdrop-filter": "none",
4760
+ "background": "Field",
4761
+ "border-color": "FieldText",
4762
+ "box-shadow": "none"
4763
+ }
4764
+ },
4765
+ "noBackdropFilter": {
4766
+ "declarations": {
4767
+ "background": "var(--cr-surface)"
4768
+ }
4769
+ }
4770
+ },
4771
+ "conditions": {},
4772
+ "shadowed": [],
4773
+ "diagnostics": [
4774
+ "rim composed from the border shorthand (1px solid var(--cr-rim)) and border-color (var(--cr-outline)), which cascades after it"
4775
+ ],
4776
+ "missing": [],
4777
+ "why": "The box alone: the mark inside it and the colour of a selected box are drawn by the component that wears it."
4569
4778
  }
4570
4779
  },
4571
4780
  "tokens": [
@@ -4575,11 +4784,13 @@
4575
4784
  "--cr-control-edge",
4576
4785
  "--cr-control-light",
4577
4786
  "--cr-ease-settle",
4787
+ "--cr-outline",
4578
4788
  "--cr-primary",
4579
4789
  "--cr-primary-soft",
4580
4790
  "--cr-range-progress",
4581
4791
  "--cr-resin-blur",
4582
4792
  "--cr-resin-fill",
4793
+ "--cr-resin-saturation",
4583
4794
  "--cr-rim",
4584
4795
  "--cr-shadow-cast",
4585
4796
  "--cr-shadow-contact",
@@ -187,9 +187,12 @@
187
187
  "name": "Selection control",
188
188
  "materials": ["Resin"],
189
189
  "class": "input:is([type=checkbox],[type=radio])",
190
- "also": ["input[type=checkbox][role=switch]", "input[type=range]"],
191
- "use": "Native checkbox, radio, switch and range, styled by element: a Resin box, circle or track with a contained mark, and the marked glass thumb. Semantics stay native.",
190
+ "also": ["input[type=checkbox][role=switch]", "input[type=range]", ".cr-choice", ".cr-choice.radio", ".cr-choice.outline"],
191
+ "use": "Native checkbox, radio, switch and range, styled by element: a Resin box, circle or track with a contained mark, and the marked glass thumb. Semantics stay native. `.cr-choice` is the same box on any element, for a library that keeps the input visually hidden and draws the box itself (2.8.0); `.radio` is the circle, and a switch's track is the box at the track's size with the pill radius. The mark and the selected colour are the component's. `.cr-choice.outline` is the outlined box: the `--cr-outline` boundary, the plain Resin fill and a single inset rim (2.8.0). In opaque mode and under reduced transparency the box, native or not, becomes the surface with no backdrop (2.8.0).",
192
192
  "partial": {
193
+ ".cr-choice": "The box alone: the mark inside it and the colour of a selected box are drawn by the component that wears it.",
194
+ ".cr-choice.radio": "The box alone, round: the dot inside it is the component's.",
195
+ ".cr-choice.outline": "The box alone: the mark inside it and the colour of a selected box are drawn by the component that wears it.",
193
196
  "input[type=range]": "A track and a thumb, painted on the slider's pseudo-elements (`::-webkit-slider-runnable-track`, `::-webkit-slider-thumb` and their `::-moz-range-` forms), which this record does not read."
194
197
  }
195
198
  },