@crystal-ui/core 2.1.0 → 2.3.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.
Files changed (38) hide show
  1. package/assets/crystal-theme.css +15 -0
  2. package/assets/crystal.css +652 -12
  3. package/assets/crystal.js +10 -0
  4. package/assets/motion.css +3 -3
  5. package/assets/motion.js +17 -2
  6. package/assets/tokens.js +1 -1
  7. package/docs/accessibility.md +19 -3
  8. package/docs/adoption.md +3 -1
  9. package/docs/catalogue.md +467 -53
  10. package/docs/components.md +36 -9
  11. package/docs/materials.md +12 -4
  12. package/docs/motion-components.md +11 -8
  13. package/docs/motion.md +10 -4
  14. package/docs/tokens.md +3 -2
  15. package/engines.js +13 -2
  16. package/exports/crystal-tokens.kt +2 -1
  17. package/exports/crystal-tokens.swift +2 -1
  18. package/exports/crystal-tokens.ts +2 -1
  19. package/package.json +2 -1
  20. package/tokens/catalogue/01-layout.json +45 -0
  21. package/tokens/catalogue/02-navigation.json +88 -6
  22. package/tokens/catalogue/03-actions.json +42 -2
  23. package/tokens/catalogue/04-inputs.json +359 -5
  24. package/tokens/catalogue/05-data-display.json +185 -21
  25. package/tokens/catalogue/06-feedback.json +75 -6
  26. package/tokens/catalogue/07-overlays.json +52 -5
  27. package/tokens/catalogue/08-typography.json +54 -0
  28. package/tokens/catalogue/09-utility.json +79 -0
  29. package/tokens/catalogue/10-charts.json +89 -1
  30. package/tokens/catalogue/11-media.json +33 -0
  31. package/tokens/catalogue/12-commerce.json +133 -1
  32. package/tokens/catalogue/13-screens.json +77 -0
  33. package/tokens/catalogue/14-blocks.json +101 -0
  34. package/tokens/catalogue.json +1656 -48
  35. package/tokens/crystal.json +3 -2
  36. package/tokens/crystal.tokens.json +7 -2
  37. package/tokens/motion-recipes.json +124 -96
  38. package/tokens/surfaces.json +177 -0
@@ -15,6 +15,9 @@
15
15
  "dismissible"
16
16
  ],
17
17
  "material": "Haze surface with the semantic ink pair on the symbol well",
18
+ "surface": [
19
+ "haze"
20
+ ],
18
21
  "geometry": "Content radius; 12px minimum from content to the feathered edge",
19
22
  "semantics": "role=alert only for genuinely urgent, interrupting content; otherwise a plain region",
20
23
  "crystal": "Surface, symbol well, semantic pairs, action placement",
@@ -39,7 +42,10 @@
39
42
  "persistent",
40
43
  "stacked"
41
44
  ],
42
- "material": "Resin with Haze reading fill and the clearest floating shadow",
45
+ "material": "Frost panel with Haze reading fill and the panel shadow (R15e); status accent from the semantic pair",
46
+ "surface": [
47
+ "frost"
48
+ ],
43
49
  "geometry": "Content radius; stacked with a 12px offset",
44
50
  "semantics": "Polite live region; an urgent toast is assertive. Auto-dismiss must never remove the only route to an action.",
45
51
  "crystal": "Surface, stacking, entry and exit motion",
@@ -63,7 +69,10 @@
63
69
  "read",
64
70
  "dismissed"
65
71
  ],
66
- "material": "Resin surface with Haze reading fill",
72
+ "material": "Frost panel with Haze reading fill (R15e)",
73
+ "surface": [
74
+ "frost"
75
+ ],
67
76
  "geometry": "Content radius",
68
77
  "semantics": "Announced politely; the dismiss control is named for what it dismisses",
69
78
  "crystal": "Surface, unread treatment, action row",
@@ -90,13 +99,16 @@
90
99
  "paused"
91
100
  ],
92
101
  "material": "Primary fill on a primary-soft track",
102
+ "surface": [
103
+ "none"
104
+ ],
93
105
  "geometry": "8px track at pill radius, matching the slider track",
94
106
  "semantics": "role=progressbar with aria-valuenow when determinate; indeterminate omits the value rather than faking one",
95
107
  "crystal": "Track, fill, indeterminate motion and reduced-motion fallback",
96
108
  "product": "Real progress. Never simulate progress for work that is not measurable.",
97
109
  "motion": [
98
110
  "progress-change",
99
- "busy"
111
+ "activity-travel"
100
112
  ],
101
113
  "parity": [
102
114
  "mantine:Progress",
@@ -115,10 +127,17 @@
115
127
  "error"
116
128
  ],
117
129
  "material": "Primary arc on a primary-soft ring",
130
+ "surface": [
131
+ "none"
132
+ ],
118
133
  "geometry": "Stroke matches the icon stroke weight family; label is tabular",
119
134
  "semantics": "Shared with Progress; the centre label is not the only representation",
120
135
  "crystal": "Ring, arc, label treatment",
121
136
  "product": "Real progress",
137
+ "motion": [
138
+ "progress-change",
139
+ "success"
140
+ ],
122
141
  "parity": [
123
142
  "mantine:RingProgress",
124
143
  "mui:CircularProgress",
@@ -134,12 +153,15 @@
134
153
  "hidden"
135
154
  ],
136
155
  "material": "Primary on the surrounding material",
156
+ "surface": [
157
+ "none"
158
+ ],
137
159
  "geometry": "Sizes on the 4px rhythm",
138
160
  "semantics": "Accompanied by text saying what is loading; reduced motion replaces spin with a static, still-legible state",
139
161
  "crystal": "Mark, motion and reduced-motion fallback",
140
162
  "product": "When it appears and what it describes",
141
163
  "motion": [
142
- "busy"
164
+ "activity-turn"
143
165
  ],
144
166
  "parity": [
145
167
  "mantine:Loader",
@@ -156,12 +178,16 @@
156
178
  "resolving"
157
179
  ],
158
180
  "material": "Haze fill with a slow luminance sweep",
181
+ "surface": [
182
+ "haze"
183
+ ],
159
184
  "geometry": "Matches the real content's radius and rhythm exactly",
160
185
  "semantics": "aria-hidden with a live region announcing loading; must not be read as content",
161
186
  "crystal": "Fill, sweep, reduced-motion fallback, resolve transition",
162
187
  "product": "Which shapes match which content",
163
188
  "motion": [
164
- "skeleton-resolve"
189
+ "skeleton-resolve",
190
+ "skeleton-sweep"
165
191
  ],
166
192
  "parity": [
167
193
  "mantine:Skeleton",
@@ -179,6 +205,9 @@
179
205
  "visible"
180
206
  ],
181
207
  "material": "Mirage at region scope",
208
+ "surface": [
209
+ "mirage"
210
+ ],
182
211
  "geometry": "Inherits the region's radius",
183
212
  "semantics": "Blocked content is inert; focus does not enter it; the reason is announced",
184
213
  "crystal": "Scrim, mark placement, inert treatment",
@@ -200,6 +229,9 @@
200
229
  "unauthorised"
201
230
  ],
202
231
  "material": "Haze panel",
232
+ "surface": [
233
+ "haze"
234
+ ],
203
235
  "geometry": "Content radius; centred within its region",
204
236
  "semantics": "Real text; never an illustration alone. No-results and truly-empty are different states and read differently.",
205
237
  "crystal": "Panel, rhythm and action placement",
@@ -226,10 +258,16 @@
226
258
  "unauthorised"
227
259
  ],
228
260
  "material": "Haze panel with the semantic ink pair on the symbol",
261
+ "surface": [
262
+ "haze"
263
+ ],
229
264
  "geometry": "Content radius",
230
265
  "semantics": "The outcome is stated in the heading; symbol and colour reinforce it",
231
266
  "crystal": "Panel, symbol treatment, action row",
232
267
  "product": "The outcome, explanation and recovery routes",
268
+ "motion": [
269
+ "success"
270
+ ],
233
271
  "parity": [
234
272
  "antd:Result",
235
273
  "mui:—",
@@ -245,7 +283,10 @@
245
283
  "open",
246
284
  "pending"
247
285
  ],
248
- "material": "Resin popover with Haze reading fill",
286
+ "material": "Frost panel with Haze reading fill (R15e)",
287
+ "surface": [
288
+ "frost"
289
+ ],
249
290
  "geometry": "Content radius; anchored to the trigger",
250
291
  "semantics": "Focus moves into the popover, returns to the trigger on dismiss, and Escape cancels",
251
292
  "crystal": "Popover surface and action row",
@@ -271,10 +312,18 @@
271
312
  "focus-visible"
272
313
  ],
273
314
  "material": "Frost step panel over a Mirage scrim",
315
+ "surface": [
316
+ "frost",
317
+ "mirage"
318
+ ],
274
319
  "geometry": "Panel keeps panel radius; the highlight follows the target's own radius.",
275
320
  "semantics": "Focus moves to each step; the sequence is escapable and its position is announced.",
276
321
  "crystal": "Panel and scrim material, step motion, focus management",
277
322
  "product": "Steps, targets and copy",
323
+ "motion": [
324
+ "popover-in",
325
+ "popover-out"
326
+ ],
278
327
  "parity": [
279
328
  "antd:Tour",
280
329
  "primereact:tour"
@@ -289,10 +338,16 @@
289
338
  "indeterminate"
290
339
  ],
291
340
  "material": "Haze track with a primary arc",
341
+ "surface": [
342
+ "none"
343
+ ],
292
344
  "geometry": "Stroke matches the ring progress contract.",
293
345
  "semantics": "role=\"progressbar\" with a text value beside it.",
294
346
  "crystal": "Arc rendering, track material, motion",
295
347
  "product": "Value and label",
348
+ "motion": [
349
+ "progress-change"
350
+ ],
296
351
  "parity": [
297
352
  "mantine:SemiCircleProgress"
298
353
  ]
@@ -306,10 +361,16 @@
306
361
  "focus-visible"
307
362
  ],
308
363
  "material": "Haze track with segment fills",
364
+ "surface": [
365
+ "none"
366
+ ],
309
367
  "geometry": "Track keeps the content radius; segments meet without gaps.",
310
368
  "semantics": "Each segment is labelled; meaning never rests on colour alone.",
311
369
  "crystal": "Track and segment materials, legend, label association",
312
370
  "product": "Segments and their values",
371
+ "motion": [
372
+ "progress-change"
373
+ ],
313
374
  "parity": [
314
375
  "primereact:metergroup"
315
376
  ]
@@ -325,10 +386,18 @@
325
386
  "focus-visible"
326
387
  ],
327
388
  "material": "Haze fill with a status accent",
389
+ "surface": [
390
+ "haze"
391
+ ],
328
392
  "geometry": "Full-bleed within its region; the dismiss control is a 44px pill.",
329
393
  "semantics": "role=\"status\" for information, role=\"alert\" for urgency. Dismissal returns focus sensibly.",
330
394
  "crystal": "Material, status colour from the status tokens, entry and exit motion",
331
395
  "product": "Copy, urgency, and whether it persists",
396
+ "motion": [
397
+ "toast-in",
398
+ "toast-out",
399
+ "attention"
400
+ ],
332
401
  "parity": [
333
402
  "antd:Alert.Banner",
334
403
  "mantine:Notification"
@@ -14,7 +14,11 @@
14
14
  "closing"
15
15
  ],
16
16
  "material": "Mirage scrim; 80% feathered Haze surface above it",
17
- "geometry": "Content radius; 12px minimum from content to the feathered edge",
17
+ "surface": [
18
+ "dialog",
19
+ "mirage"
20
+ ],
21
+ "geometry": "Panel radius (the content radius plus 6px), as .cr-dialog draws it; 12px minimum from content to the feathered edge",
18
22
  "semantics": "Real modal semantics with a named dialog, focus containment, Escape, and focus return to the trigger",
19
23
  "crystal": "Scrim, surface, entrance and exit motion, elevation",
20
24
  "product": "Modality, focus management, the decision itself and its consequences",
@@ -39,6 +43,10 @@
39
43
  "dragging"
40
44
  ],
41
45
  "material": "Mirage scrim, Frost or Resin panel by depth",
46
+ "surface": [
47
+ "frost",
48
+ "mirage"
49
+ ],
42
50
  "geometry": "Panel radius on the inner edges only",
43
51
  "semantics": "Dialog semantics when modal; a complementary region when not. Modality must be real, not implied.",
44
52
  "crystal": "Panel material, edge geometry, entrance direction",
@@ -64,7 +72,10 @@
64
72
  "disabled-item",
65
73
  "checked-item"
66
74
  ],
67
- "material": "Resin surface with Haze rows",
75
+ "material": "Frost panel with Haze rows (R15e)",
76
+ "surface": [
77
+ "frost"
78
+ ],
68
79
  "geometry": "Content radius; every row reserves leading room for a check mark, so ticking one does not shift its label",
69
80
  "semantics": "role=menu with full keyboard navigation, type-ahead and Escape; checkable items use aria-checked",
70
81
  "crystal": "Surface, row treatment, row geometry, separators",
@@ -88,10 +99,17 @@
88
99
  "open"
89
100
  ],
90
101
  "material": "Shared with Menu",
102
+ "surface": [
103
+ "frost"
104
+ ],
91
105
  "geometry": "Repositions to stay within the viewport",
92
106
  "semantics": "Must be reachable by keyboard, not pointer-only; never the sole route to an action",
93
107
  "crystal": "Surface and positioning behaviour",
94
108
  "product": "The actions and the keyboard route",
109
+ "motion": [
110
+ "menu-in",
111
+ "menu-out"
112
+ ],
95
113
  "parity": [
96
114
  "mantine:Menu",
97
115
  "mui:Menu",
@@ -107,7 +125,10 @@
107
125
  "open",
108
126
  "repositioned"
109
127
  ],
110
- "material": "Resin with Haze reading fill",
128
+ "material": "Frost panel with Haze reading fill (R15e)",
129
+ "surface": [
130
+ "frost"
131
+ ],
111
132
  "geometry": "Content radius; flips and shifts to stay in view",
112
133
  "semantics": "The trigger carries aria-expanded and aria-controls; focus moves in for interactive content",
113
134
  "crystal": "Surface, arrow, positioning behaviour",
@@ -133,10 +154,17 @@
133
154
  "closing"
134
155
  ],
135
156
  "material": "Shared with Popover",
157
+ "surface": [
158
+ "frost"
159
+ ],
136
160
  "geometry": "Shared with Popover",
137
161
  "semantics": "Must also open on keyboard focus; never contains the only route to an action",
138
162
  "crystal": "Surface, open and close delays",
139
163
  "product": "Preview content and delay tuning",
164
+ "motion": [
165
+ "popover-in",
166
+ "popover-out"
167
+ ],
140
168
  "parity": [
141
169
  "mantine:HoverCard",
142
170
  "mui:—",
@@ -151,8 +179,11 @@
151
179
  "hidden",
152
180
  "visible"
153
181
  ],
154
- "material": "Resin with Stone label backing",
155
- "geometry": "18px radius; compact padding",
182
+ "material": "Frost, as every transient overlay is (R15e); the text sits directly on the panel",
183
+ "surface": [
184
+ "frost"
185
+ ],
186
+ "geometry": "18px radius (component.overlay.tooltipRadius); compact padding",
156
187
  "semantics": "Never the sole accessible name. Opens on focus as well as hover, dismisses on Escape, and stays while hovered.",
157
188
  "crystal": "Surface, delay, placement",
158
189
  "product": "Content and whether a tooltip is the right disclosure at all",
@@ -175,6 +206,9 @@
175
206
  "visible"
176
207
  ],
177
208
  "material": "Mirage: chromatic diffusion of the real scene beneath",
209
+ "surface": [
210
+ "mirage"
211
+ ],
178
212
  "geometry": "Full viewport, or region-scoped for a local overlay",
179
213
  "semantics": "Content beneath is inert; the scrim is not a focus target; clicking it dismisses only when dismissal is safe",
180
214
  "crystal": "The complete Mirage recipe and its reduced-transparency fallback",
@@ -198,6 +232,9 @@
198
232
  "unmounted"
199
233
  ],
200
234
  "material": "None",
235
+ "surface": [
236
+ "none"
237
+ ],
201
238
  "geometry": "None",
202
239
  "semantics": "Portalled content must preserve the logical focus and reading order of its trigger",
203
240
  "crystal": "Stacking contract and layer placement",
@@ -219,10 +256,17 @@
219
256
  "focus-visible"
220
257
  ],
221
258
  "material": "Resin panel",
259
+ "surface": [
260
+ "resin-panel"
261
+ ],
222
262
  "geometry": "Panel radius; the resize handle reaches 44px.",
223
263
  "semantics": "role=\"dialog\" when modal-like; focus is trapped only when it is modal.",
224
264
  "crystal": "Material, elevation, drag and resize motion",
225
265
  "product": "Content, bounds and persistence",
266
+ "motion": [
267
+ "drawer-in",
268
+ "drawer-out"
269
+ ],
226
270
  "parity": [
227
271
  "mantine:FloatingWindow"
228
272
  ]
@@ -235,6 +279,9 @@
235
279
  "at-rest"
236
280
  ],
237
281
  "material": "Inherits its overlay",
282
+ "surface": [
283
+ "none"
284
+ ],
238
285
  "geometry": "Follows the overlay radius; flips with placement.",
239
286
  "semantics": "Decorative: hidden from assistive technology.",
240
287
  "crystal": "That it matches the overlay material exactly, including under reduced effects",
@@ -11,6 +11,9 @@
11
11
  "default"
12
12
  ],
13
13
  "material": "None",
14
+ "surface": [
15
+ "none"
16
+ ],
14
17
  "geometry": "1.2 line height; -0.04em tracking; sizes on a modular scale",
15
18
  "semantics": "The visual level must not be chosen independently of the document outline; use a level, style separately",
16
19
  "crystal": "Scale, tracking and leading",
@@ -32,6 +35,9 @@
32
35
  "clamped"
33
36
  ],
34
37
  "material": "None",
38
+ "surface": [
39
+ "none"
40
+ ],
35
41
  "geometry": "16px/24px reading rhythm; 78ch maximum measure",
36
42
  "semantics": "Truncated text keeps its full value in the accessibility tree and in a title where useful",
37
43
  "crystal": "Rhythm, measure, colour roles",
@@ -51,6 +57,9 @@
51
57
  "attributed"
52
58
  ],
53
59
  "material": "Haze panel when set apart",
60
+ "surface": [
61
+ "haze"
62
+ ],
54
63
  "geometry": "Content radius; 3px leading rule",
55
64
  "semantics": "Real blockquote with cite where the source is known",
56
65
  "crystal": "Rule, panel and attribution treatment",
@@ -69,6 +78,9 @@
69
78
  "default"
70
79
  ],
71
80
  "material": "Primary-soft fill with its tested ink pair",
81
+ "surface": [
82
+ "none"
83
+ ],
72
84
  "geometry": "4px radius; does not disturb the line box",
73
85
  "semantics": "Real mark element; highlighting is never the only indication of a match",
74
86
  "crystal": "Fill pair and geometry",
@@ -90,6 +102,9 @@
90
102
  "default"
91
103
  ],
92
104
  "material": "Inherits; embedded surfaces follow their own components",
105
+ "surface": [
106
+ "none"
107
+ ],
93
108
  "geometry": "78ch measure; 1.8 line height; 4px-rhythm vertical spacing",
94
109
  "semantics": "Anchor navigation must preserve focus when sections change",
95
110
  "crystal": "The complete reading rhythm and embedded-element treatment",
@@ -108,10 +123,16 @@
108
123
  "at-rest"
109
124
  ],
110
125
  "material": "Haze fill behind the matched run",
126
+ "surface": [
127
+ "haze"
128
+ ],
111
129
  "geometry": "Fill hugs the text; no radius change at line breaks.",
112
130
  "semantics": "Uses <mark>; the surrounding sentence remains readable as one string.",
113
131
  "crystal": "Fill material, contrast against the surface",
114
132
  "product": "What is matched and how",
133
+ "motion": [
134
+ "highlight"
135
+ ],
115
136
  "parity": [
116
137
  "mantine:Highlight"
117
138
  ]
@@ -124,6 +145,9 @@
124
145
  "at-rest"
125
146
  ],
126
147
  "material": "Inherits",
148
+ "surface": [
149
+ "none"
150
+ ],
127
151
  "geometry": "Tabular figures.",
128
152
  "semantics": "The formatted value is the text content; no separate visual and spoken form.",
129
153
  "crystal": "Typography, figure style",
@@ -140,6 +164,9 @@
140
164
  "at-rest"
141
165
  ],
142
166
  "material": "Inherits",
167
+ "surface": [
168
+ "none"
169
+ ],
143
170
  "geometry": "Tightest tracking of the scale; one line where possible.",
144
171
  "semantics": "Exactly one per view, and it is the h1 unless the page says otherwise.",
145
172
  "crystal": "The step, tracking and leading",
@@ -157,6 +184,9 @@
157
184
  "at-rest"
158
185
  ],
159
186
  "material": "Inherits",
187
+ "surface": [
188
+ "none"
189
+ ],
160
190
  "geometry": "Step per level; leading tightens as size grows.",
161
191
  "semantics": "The level is the document structure, never chosen for size — size comes from the step.",
162
192
  "crystal": "The scale and its tracking",
@@ -174,6 +204,9 @@
174
204
  "at-rest"
175
205
  ],
176
206
  "material": "Inherits",
207
+ "surface": [
208
+ "none"
209
+ ],
177
210
  "geometry": "One step above body; measure capped for reading.",
178
211
  "semantics": "A paragraph, not a heading.",
179
212
  "crystal": "Step and measure",
@@ -190,6 +223,9 @@
190
223
  "at-rest"
191
224
  ],
192
225
  "material": "Inherits",
226
+ "surface": [
227
+ "none"
228
+ ],
193
229
  "geometry": "Marker inset follows the spacing scale; hanging indent preserved.",
194
230
  "semantics": "Real ul and ol so the count and nesting are announced.",
195
231
  "crystal": "Marker treatment, spacing, nesting rhythm",
@@ -209,6 +245,9 @@
209
245
  "focus-visible"
210
246
  ],
211
247
  "material": "Haze fill with a crisp monospace face",
248
+ "surface": [
249
+ "haze"
250
+ ],
212
251
  "geometry": "Content radius; the copy control is a pill.",
213
252
  "semantics": "Focusable and scrollable by keyboard; the language is announced; the copy button says what it copied.",
214
253
  "crystal": "Fill material, the monospace pairing, copy feedback motion",
@@ -227,6 +266,9 @@
227
266
  "expanded"
228
267
  ],
229
268
  "material": "Inherits",
269
+ "surface": [
270
+ "none"
271
+ ],
230
272
  "geometry": "Clamp by line count, never by pixel height.",
231
273
  "semantics": "The full text remains available to assistive technology; expansion is a real control.",
232
274
  "crystal": "The fade, if any, and the expand motion",
@@ -244,6 +286,9 @@
244
286
  "at-rest"
245
287
  ],
246
288
  "material": "Inherits",
289
+ "surface": [
290
+ "none"
291
+ ],
247
292
  "geometry": "Sits beneath the quote at one step down.",
248
293
  "semantics": "Uses cite, and is associated with its blockquote.",
249
294
  "crystal": "Step and colour",
@@ -261,6 +306,9 @@
261
306
  "focus-visible"
262
307
  ],
263
308
  "material": "Inherits",
309
+ "surface": [
310
+ "none"
311
+ ],
264
312
  "geometry": "No visual weight change; underline on hover only.",
265
313
  "semantics": "Uses abbr with a title, and is focusable so the expansion is reachable without a pointer.",
266
314
  "crystal": "The underline treatment",
@@ -277,6 +325,9 @@
277
325
  "at-rest"
278
326
  ],
279
327
  "material": "Inherits",
328
+ "surface": [
329
+ "none"
330
+ ],
280
331
  "geometry": "Balances wrapping without changing the step.",
281
332
  "semantics": "Purely visual: the text content is unchanged.",
282
333
  "crystal": "Where balancing applies, and its fallback",
@@ -293,6 +344,9 @@
293
344
  "at-rest"
294
345
  ],
295
346
  "material": "Palette gradient clipped to the glyphs",
347
+ "surface": [
348
+ "none"
349
+ ],
296
350
  "geometry": "No change to step or tracking.",
297
351
  "semantics": "Contrast is checked against the surface at both gradient ends, and a solid fallback applies where the clip is unsupported.",
298
352
  "crystal": "The gradient, and the contrast floor at every point",