@crystal-ui/core 2.3.0 → 2.4.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 (55) hide show
  1. package/README.md +82 -23
  2. package/assets/core/preferences.d.ts +4 -4
  3. package/assets/core/preferences.js +4 -4
  4. package/assets/core/presets.d.ts +4 -3
  5. package/assets/core/presets.js +24 -18
  6. package/assets/core/spring.js +9 -10
  7. package/assets/core/state.js +7 -7
  8. package/assets/crystal.css +784 -284
  9. package/assets/crystal.d.ts +3 -3
  10. package/assets/crystal.js +100 -123
  11. package/assets/icons/heading-2.svg +1 -0
  12. package/assets/icons/heading-3.svg +1 -0
  13. package/assets/icons/heading-4.svg +1 -0
  14. package/assets/icons/link.svg +1 -0
  15. package/assets/icons/list-ordered.svg +1 -0
  16. package/assets/icons/list.svg +1 -0
  17. package/assets/icons/manifest.json +81 -2
  18. package/assets/icons/quote.svg +1 -0
  19. package/assets/icons/redo.svg +1 -0
  20. package/assets/icons/subscript.svg +1 -0
  21. package/assets/icons/undo.svg +1 -0
  22. package/assets/icons/unlink.svg +1 -0
  23. package/assets/motion.js +13 -12
  24. package/docs/accessibility.md +50 -54
  25. package/docs/adoption.md +33 -19
  26. package/docs/catalogue.md +113 -108
  27. package/docs/colors.md +67 -73
  28. package/docs/components.md +142 -66
  29. package/docs/icons.md +9 -3
  30. package/docs/materials.md +129 -117
  31. package/docs/motion-components.md +15 -15
  32. package/docs/motion.md +156 -158
  33. package/docs/principles.md +12 -12
  34. package/docs/tokens.md +129 -130
  35. package/engines.js +3 -3
  36. package/package.json +11 -3
  37. package/tokens/catalogue/01-layout.json +1 -1
  38. package/tokens/catalogue/02-navigation.json +4 -4
  39. package/tokens/catalogue/03-actions.json +2 -1
  40. package/tokens/catalogue/04-inputs.json +30 -22
  41. package/tokens/catalogue/05-data-display.json +9 -14
  42. package/tokens/catalogue/06-feedback.json +8 -6
  43. package/tokens/catalogue/07-overlays.json +4 -4
  44. package/tokens/catalogue/08-typography.json +12 -8
  45. package/tokens/catalogue/09-utility.json +1 -1
  46. package/tokens/catalogue/10-charts.json +7 -7
  47. package/tokens/catalogue/11-media.json +33 -20
  48. package/tokens/catalogue/12-commerce.json +4 -4
  49. package/tokens/catalogue/13-screens.json +2 -3
  50. package/tokens/catalogue/14-blocks.json +3 -3
  51. package/tokens/catalogue.json +176 -116
  52. package/tokens/crystal.tokens.json +6 -6
  53. package/tokens/motion-recipes.json +6 -6
  54. package/tokens/surface-recipes.json +3452 -0
  55. package/tokens/surfaces.json +48 -17
@@ -1,9 +1,9 @@
1
1
  /* The token resolver, as a module.
2
2
  *
3
- * `resolve` is the whole reason this is importable: it turns a palette, a mode
4
- * and a set of preferences into the custom properties a surface renders from. A
3
+ * `resolve` is the reason this is importable. It turns a palette, a mode and a
4
+ * set of preferences into the custom properties a surface renders from. A
5
5
  * library that can only load the generated stylesheet gets one palette at
6
- * `:root`, which is not a design system with six.
6
+ * `:root`, and the design system has six.
7
7
  */
8
8
  export interface CrystalConfiguration {
9
9
  palette?: string;
package/assets/crystal.js CHANGED
@@ -1,15 +1,15 @@
1
1
  /* Crystal. Pure token resolver + CSS exporter. No dependencies.
2
2
  *
3
- * Loadable two ways, and both matter. In a browser it is a script that reads
3
+ * Loadable two ways. In a browser it is a script that reads
4
4
  * `window.CRYSTAL_TOKENS` and publishes `window.Crystal`. Under a module loader it
5
5
  * takes the flat token file directly and exports the same object.
6
6
  *
7
- * The second path exists because a platform library needs `resolve()` — turning a
8
- * palette, a mode and a set of preferences into the ~90 custom properties a
9
- * surface actually renders from. Without it a library can only load the generated
10
- * stylesheet, which carries one palette at `:root`; every per-scope palette and
11
- * mode it offered was decoration. CONTRACT §1 says to reuse this arithmetic
12
- * rather than reimplement it, and that is only possible if it can be imported. */
7
+ * The second path exists because a platform library needs `resolve()`, which
8
+ * turns a palette, a mode and a set of preferences into the ~90 custom
9
+ * properties a surface renders from. Without it a library can only load the
10
+ * generated stylesheet, which carries one palette at `:root`, so every per-scope
11
+ * palette and mode it offered was decoration. CONTRACT §1 says to reuse this
12
+ * arithmetic rather than reimplement it, which requires that it can be imported. */
13
13
  (function(root){
14
14
  'use strict';
15
15
  const data=root.CRYSTAL_TOKENS
@@ -17,7 +17,7 @@
17
17
  if(!data) throw new Error('Load tokens.js before crystal.js');
18
18
  /* `chartSeries1` is `--cr-chart-series-1`, not `--cr-chart-series1`. The digit
19
19
  boundary is a word boundary here because Crystal already writes its numbered
20
- properties that way — `--cr-focus-feather-1` predates this — and a scale a
20
+ properties that way (`--cr-focus-feather-1` predates this), and a scale a
21
21
  stylesheet indexes with `var(--cr-chart-series-#{$i})` reads as one. No role
22
22
  name carried a digit before the series scale, so nothing renamed. */
23
23
  const camelToKebab=s=>s.replace(/[A-Z]/g,m=>'-'+m.toLowerCase()).replace(/([a-z])(\d)/g,'$1-$2');
@@ -44,8 +44,8 @@
44
44
  const tokens={};for(const [key,val] of Object.entries(p))tokens['--cr-'+camelToKebab(key)]=val;
45
45
  /* Coloured glass casts a coloured shadow. The light a material refracts is the light
46
46
  that reaches the surface beneath it, so the shadow carries the palette's companion
47
- hue rather than being neutral grey. The mix is on the colour only — the alpha of
48
- each layer is preserved exactly, because tinting a shadow must not also deepen it. */
47
+ hue instead of neutral grey. The mix is on the colour only. The alpha of each
48
+ layer is preserved exactly, because tinting a shadow must not also deepen it. */
49
49
  const mixInto=(base,tint,amount)=>{
50
50
  const [br,bg,bb]=base,[tr,tg,tb]=rgb(tint);
51
51
  const m=(a,b)=>Math.round(a+(b-a)*amount);
@@ -66,7 +66,7 @@
66
66
  '--cr-atmosphere-two':rgba(p.companion,s.atmosphere/100*(dark?.23:.19)),
67
67
  /* Plastic is opaque, so it cannot refract; it emits. This is the palette's own
68
68
  glow carried by the foundation, at the intensity the active scheme's atmosphere
69
- setting asks for — the base glow of the primary plus the scheme's tint. */
69
+ setting asks for: the base glow of the primary plus the scheme's tint. */
70
70
  '--cr-atmosphere-glow':rgba(p.glow,s.atmosphere/100*(dark?.18:.14)),
71
71
  '--cr-acrylic-fill':s.reduced?p.surface:rgba(p.surface,Math.min(.94,tint+.1)),
72
72
  '--cr-glass-fill':s.reduced?p.surface:rgba(p.surface,data.material.glassOpacity),
@@ -75,17 +75,15 @@
75
75
  '--cr-content-own-fill':s.reduced?(p.contentOwnSurface||p.primarySoft):rgba(p.contentOwnSurface||p.primarySoft,data.material.contentOpacity),
76
76
  '--cr-content-feather':s.reduced?'0px':data.material.contentFeather+'px',
77
77
  /* How far the Haze content fill is held back from a Resin surface's own
78
- rim. The fill and its feather were always tokens; the inset was a
79
- literal in a stylesheet Crystal does not export, so a platform library
80
- could carry every Haze token and still paint no fill at all — which is
81
- exactly what Crystal React did on sixteen surfaces. A recipe that only
82
- one renderer knows is not a specification. */
78
+ rim. The fill and its feather are tokens, and the inset is published
79
+ with them: a platform library that reads only the tokens could
80
+ otherwise carry every Haze token and still paint no fill. */
83
81
  '--cr-haze-inset':data.component.haze.inset+'px',
84
- /* Control geometry that `crystal.css` used to carry as literals — 26px
85
- boxes, a 44×28 track, .55 for a disabled control — while the same
86
- numbers were published as tokens a platform library reads. Two
87
- statements of one value is the drift CONTRACT §1 forbids, so the
88
- stylesheet now reads these and the literal is the fallback only. */
82
+ /* Control geometry: 26px boxes, a 44×28 track, .55 for a disabled
83
+ control. The same numbers are published as tokens a platform library
84
+ reads, and two statements of one value is the drift CONTRACT §1
85
+ forbids, so `crystal.css` reads these and its literal is the fallback
86
+ only. */
89
87
  '--cr-action-disabled-opacity':String(data.component.action.disabledOpacity),
90
88
  '--cr-choice-box-size':data.component.choice.boxSize+'px',
91
89
  '--cr-choice-box-radius':data.component.choice.boxRadius+'px',
@@ -93,10 +91,9 @@
93
91
  '--cr-switch-track-height':data.component.switch.trackHeight+'px',
94
92
  /* Chart geometry. A chart's colours vary with the palette and arrive with
95
93
  the other roles above; these do not vary at all. They are published
96
- rather than left to each renderer because the catalogue says "line
97
- weight follows the stroke scale" and "point size is a scale, not an
98
- arbitrary radius" as though both scales existed, and until now neither
99
- did — which is how two renderers end up with two of them. */
94
+ here because the catalogue says "line weight follows the stroke scale"
95
+ and "point size is a scale, not an arbitrary radius", and a scale
96
+ left to each renderer becomes two scales. */
100
97
  '--cr-chart-stroke':data.component.chart.stroke+'px',
101
98
  '--cr-chart-hairline':data.component.chart.hairline+'px',
102
99
  '--cr-chart-point-min':data.component.chart.pointMin+'px',
@@ -112,14 +109,13 @@
112
109
  '--cr-content-own-text':s.palette==='harbor'?p.text:p.onPrimarySoft,
113
110
  '--cr-stone-feather':s.reduced?'0px':data.material.stoneFeather+'px',
114
111
  /* Scrollbars.
115
- The thumb is ink, not material. Painting it in the material's own
116
- surface colour is the mistake that made it invisible: a white thumb at
117
- 62% over a white Frost panel is a white panel. So the Frost thumb is the
118
- palette's ink — it belongs to the panel the way the panel's own text
119
- does — and the Resin thumb is the palette's primary, because Resin is
120
- the floating control plane and a scrollbar there is a control. Both
121
- clear 3:1 against surface, surfaceAlt and canvas in every palette and
122
- both modes, which validate-tokens asserts.
112
+ The thumb is ink, not material. A thumb painted in the material's own
113
+ surface colour is invisible: a white thumb at 62% over a white Frost
114
+ panel is a white panel. The Frost thumb is the palette's ink, as the
115
+ panel's own text is, and the Resin thumb is the palette's primary,
116
+ because Resin is the floating control plane and a scrollbar there is a
117
+ control. Both clear 3:1 against surface, surfaceAlt and canvas in every
118
+ palette and both modes, which validate-tokens asserts.
123
119
  The track stays a faint channel so the panel shows through. */
124
120
  '--cr-scrollbar-width':data.component.scrollbar.width+'px',
125
121
  '--cr-scrollbar-thumb-min':data.component.scrollbar.thumbMinLength+'px',
@@ -133,91 +129,75 @@
133
129
  '--cr-overlay-tooltip-max-width':data.component.overlay.tooltipMaxWidth+'px',
134
130
  /* Focus, as two properties rather than as a recipe each platform retypes.
135
131
  Crystal's focus is a crisp 2px primary core at 3px offset inside a
136
- four-layer feathered halo, and it was written out longhand in
137
- `crystal.css` — which is fine for a stylesheet that can use `:focus-visible`
138
- on a native element, and no use at all to a library styling a shell that
139
- wraps one. Crystal React named these two properties and nothing defined
140
- them, so every field in it painted no focus ring whatever. Published here
141
- so there is one recipe, in one place, and CONTRACT §1 is kept. */
142
- /* The inner edge a control's well is drawn with. It lived only in
143
- `controls.css`, which is the preview's own layer and the one a library
144
- must not load — so Crystal React read it on a Card and a Slider and got
145
- nothing, and those two inset shadows have never painted. A value two
146
- components depend on belongs to the system. */
132
+ four-layer feathered halo. `crystal.css` writes it out longhand, which
133
+ works for a stylesheet that can use `:focus-visible` on a native
134
+ element and is no use to a library styling a shell that wraps one.
135
+ Published here so there is one recipe, in one place, and CONTRACT §1
136
+ is kept. */
137
+ /* The inner edge a control's well is drawn with. A Card and a Slider both
138
+ read it, so it belongs to the system; the preview's own `controls.css`
139
+ is a layer a library must not load. */
147
140
  '--cr-control-edge':rgba(p.outline,0.18),
148
- /* The two tints the Resin control sheen is built from, and the same story
149
- as `--cr-control-edge` above: they lived only in the preview's
150
- `controls.css`, so the optical sheen on every Crystal control was a
151
- thing the library described and did not ship. Adopted 21 September 2026
152
- with the rest of D-11.
141
+ /* The two tints the Resin control sheen is built from. Like
142
+ `--cr-control-edge` above, they are published here so the sheen ships
143
+ with the library and does not live only in the preview's
144
+ `controls.css`. Adopted 21 September 2026 with the rest of D-11.
153
145
 
154
146
  `--cr-control-color` is the decorative tint that gives the control its
155
147
  body; `--cr-control-light` is the glow that lights its top-left corner.
156
- Both go *down* in dark mode rather than up — the opposite of the focus
157
- feathers, and deliberately: on a deep canvas the sheen is already
158
- reading against very little, and holding it at the light-mode strength
159
- makes a control look lit from inside rather than lit from above. */
160
- /* `color-mix` rather than a resolved `rgba`, and it is the one place in
161
- this theme that departs from the convention. Two reasons, both checked
162
- rather than assumed. A resolved `rgba` alpha is quantised to 8 bits by
163
- the time a browser serialises it — 0.126 comes back as 0.125 — and an
164
- A/B of the site against this library put a worst channel delta of 2 on
165
- the playground's controls purely from that. And a mix keeps the tint
166
- tracking `--cr-glow` and `--cr-decorative`, so a product that retints
167
- either gets a sheen that follows; a resolved value silently would not.
168
- The preview has always written these as mixes, so this is also what
169
- makes the adoption exact. */
148
+ Both go down in dark mode, the opposite of the focus feathers. On a
149
+ deep canvas the sheen is already reading against very little, and
150
+ holding it at the light-mode strength makes a control look lit from
151
+ inside rather than lit from above. */
152
+ /* `color-mix` rather than a resolved `rgba`, the one place in this theme
153
+ that departs from the convention, for two measured reasons. A resolved
154
+ `rgba` alpha is quantised to 8 bits by the time a browser serialises it
155
+ (0.126 comes back as 0.125), and an A/B of the site against this
156
+ library put a worst channel delta of 2 on the playground's controls
157
+ from that alone. And a mix keeps the tint tracking `--cr-glow` and
158
+ `--cr-decorative`, so a product that retints either gets a sheen that
159
+ follows, where a resolved value would not. The preview writes these as
160
+ mixes, so a mix is also what makes the adoption exact. */
170
161
  '--cr-control-color':`color-mix(in srgb,var(--cr-decorative) ${dark?7:8.4}%,transparent)`,
171
162
  '--cr-control-light':`color-mix(in srgb,var(--cr-glow) ${dark?9.8:12.6}%,transparent)`,
172
163
  '--cr-focus-core':p.primary,
173
164
  '--cr-focus-core-width':'2px',
174
165
  '--cr-focus-core-offset':'3px',
175
- /* The four feather colours, published rather than inlined.
176
-
177
- They were the preview's own — `--cr-focus-feather-1` … `-4` in
178
- `controls.css` — and the library had no equivalent, because it baked its
179
- alphas straight into `--cr-focus-ring`. That is precisely why the
180
- dark-mode divergence could hide for so long: there was no property to
181
- compare, so no gate could have been written that would have caught it.
182
- Naming them is half of D-11's fix; the other half is that a product can
183
- now retint the falloff without restating the whole recipe.
166
+ /* The four feather colours, `--cr-focus-feather-1` to `-4`, published
167
+ rather than inlined into `--cr-focus-ring`. A named property can be
168
+ compared by a gate, and a product can retint the falloff without
169
+ restating the whole recipe (D-11).
184
170
 
185
- **Dark mode lifts them**, 56/38/22/11 against light's 46/30/17/8. The
186
- preview has carried the lift since the halo was specified and the
187
- library never did, so Crystal's site held its falloff against a deep
188
- canvas and every consumer's went thin. Meridian decided on 21 September
189
- 2026 that the library carries it. */
171
+ Dark mode lifts them: 56/38/22/11 against light's 46/30/17/8. Without
172
+ the lift the falloff goes thin against a deep canvas. Meridian decided
173
+ on 21 September 2026 that the library carries it. */
190
174
  ...Object.fromEntries((dark?[56,38,22,11]:[46,30,17,8])
191
175
  .map((pct,i)=>[`--cr-focus-feather-${i+1}`,rgba(p.primary,pct/100)])),
192
176
  /* The broad layer's colour, and the one part of focus that is not the
193
177
  primary: it is `--cr-decorative`, so the lift under a focused control
194
- carries the palette's own shadow hue rather than tinting everything
195
- purple. Also the preview's, also never exported. */
178
+ carries the palette's own shadow hue instead of tinting everything
179
+ purple. */
196
180
  '--cr-focus-shadow':rgba(p.decorative,0.27),
197
181
  /* Six layers: the four-layer halo, then two that lift.
198
-
199
- Spreads 1/3/6/11, not 2/6/12/22 — the halo was halved at Meridian's
200
- request, the change was made in the preview's stylesheet, and the
201
- library went on shipping the withdrawn one to every consumer. That much
202
- was fixed on 20 September.
203
-
204
- What was still missing is the pair beneath: `0 8px 18px` directional and
205
- `0 22px 40px` broad. A focused control on Crystal's site lifts, and in
206
- every consumer it did not — not a spread this time but two whole layers,
207
- and `components.md` had described lifting on focus as Crystal's own
208
- behaviour throughout. Meridian decided on 21 September that the library
209
- carries them, so this is now the whole recipe and the preview's copy is
210
- redundant rather than authoritative.
211
-
212
- Written as `var()` references to the properties above, which is the
213
- shape the preview used. It keeps the recipe readable at the point of
214
- use and it is what lets the two be compared layer by layer. */
182
+
183
+ Spreads are 1/3/6/11, not 2/6/12/22: the halo was halved at Meridian's
184
+ request, and 2/6/12/22 is the withdrawn recipe.
185
+
186
+ The pair beneath, `0 8px 18px` directional and `0 22px 40px` broad, is
187
+ the lift a focused control makes, which `components.md` describes as
188
+ Crystal's own behaviour. Meridian decided on 21 September that the
189
+ library carries them, so this is the whole recipe and the preview's
190
+ copy is redundant.
191
+
192
+ Written as `var()` references to the properties above, the shape the
193
+ preview uses. It keeps the recipe readable at the point of use and
194
+ lets the two be compared layer by layer. */
215
195
  '--cr-focus-ring':[
216
196
  ...[[6,1,1],[16,3,2],[30,6,3],[54,11,4]]
217
197
  .map(([blur,spread,n])=>`0 0 ${blur}px ${spread}px var(--cr-focus-feather-${n})`),
218
- /* The directional layer borrows the second feather rather than naming a
219
- fifth colour — the preview's choice, kept, because a lift that is a
220
- shade of the halo above it reads as the same light source. */
198
+ /* The directional layer borrows the second feather instead of naming a
199
+ fifth colour: a lift that is a shade of the halo above it reads as
200
+ the same light source. */
221
201
  '0 8px 18px var(--cr-focus-feather-2)',
222
202
  '0 22px 40px var(--cr-focus-shadow)',
223
203
  ].join(','),
@@ -253,34 +233,31 @@
253
233
  '--cr-edge':rgba(p.outline,dark?.34:.25),'--cr-rim':highlight,
254
234
  /* The two inks the composed shadows are built from, exported so a one-off
255
235
  shadow can be made of Crystal's ink instead of a literal.
256
-
257
- This is D-9's remaining half. `controls.css` carries eleven hard-coded
258
- `#080b24…` values — a fixed dark navy that is not the ink Crystal uses
259
- anywhere else. Crystal's is palette-tinted: the base violet mixed with
260
- the palette's companion, so a shadow in Ion is a different colour from
261
- a shadow in Fuchsia, and it darkens in dark mode. A literal cannot do
262
- either, so those eleven shadows are the one part of the preview that
263
- does not follow the palette. Naming the ink is what makes fixing them a
264
- substitution rather than an invention. */
236
+
237
+ Crystal's shadow ink is palette-tinted: the base violet mixed with the
238
+ palette's companion, so a shadow in Ion is a different colour from a
239
+ shadow in Fuchsia, and it darkens in dark mode. A literal cannot do
240
+ either. `controls.css` carries eleven hard-coded `#080b24…` values, a
241
+ fixed dark navy, and those eleven shadows are the one part of the
242
+ preview that does not follow the palette. Naming the ink makes
243
+ replacing them a substitution (D-9). */
265
244
  '--cr-shadow-contact':contact,
266
245
  '--cr-shadow-cast':shadow,
267
246
  '--cr-shadow-content':`0 ${2*e}px ${3*e}px ${contact}, 0 ${7*e}px ${15*e}px ${shadow}`,
268
247
  '--cr-shadow-panel':`inset 0 1px 0 ${highlight}, 0 ${3*e}px ${5*e}px ${contact}, 0 ${14*e}px ${28*e}px ${shadow}`,
269
- /* Resin's float, reconciled with the appearance that was actually blessed.
270
- `controls.css` carried a second, hand-written copy of this recipe —
271
- `inset 0 2px 1px, inset 0 -1px 1px, 0 5px 9px #080b2412, 0 16px 30px
272
- #080b2420` — and because the preview loads it, that copy is what the
273
- approved baseline shows and this token is what every platform library
274
- gets. They disagreed, so a library following Crystal's own token could
275
- not reproduce Crystal's own appearance.
276
- Two things were right on each side and both are kept. The rims are the
277
- blessed ones: 2px of light along the top where it catches, and a light
278
- edge returning underneath — a dark lower inset reads as an inner shadow
279
- rather than as glass. The elevation is this token's: tinted with the
280
- palette like every other Crystal shadow, and scaled by the elevation
281
- control, neither of which the literal did. The coefficients are the
282
- blessed distances divided by the default 125% elevation, so the default
283
- renders what was approved and the slider now moves it. */
248
+ /* Resin's float, matching the approved baseline. The preview loads its
249
+ own hand-written literal from `controls.css`, `inset 0 2px 1px, inset
250
+ 0 -1px 1px, 0 5px 9px #080b2412, 0 16px 30px #080b2420`, so that
251
+ literal is what the approved baseline shows, and this token is what
252
+ every platform library gets. The two must agree, or a library
253
+ following the token cannot reproduce the approved appearance.
254
+ The rims are the approved ones: 2px of light along the top where it
255
+ catches, and a light edge returning underneath. A dark lower inset
256
+ reads as an inner shadow instead of glass. The elevation is this
257
+ token's: tinted with the palette like every other Crystal shadow, and
258
+ scaled by the elevation control. The coefficients are the approved
259
+ distances divided by the default 125% elevation, so the default renders
260
+ what was approved and the slider moves it. */
284
261
  '--cr-shadow-float':`inset 0 2px 1px ${highlight}, inset 0 -1px 1px ${highlight}, 0 ${4*e}px ${7.2*e}px ${contact}, 0 ${12.8*e}px ${24*e}px ${shadow}`,
285
262
  '--cr-press':ms(data.motion.press),'--cr-state':ms(data.motion.state),'--cr-spatial':ms(data.motion.spatial),
286
263
  '--cr-exit':ms(data.motion.exit),'--cr-motion-enabled':s.reduceMotion?'0':'1',
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M4 12h8" /><path d="M4 18V6" /><path d="M12 18V6" /><path d="M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1" /></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M4 12h8" /><path d="M4 18V6" /><path d="M12 18V6" /><path d="M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2" /><path d="M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2" /></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M12 18V6" /><path d="M17 10v3a1 1 0 0 0 1 1h3" /><path d="M21 10v8" /><path d="M4 12h8" /><path d="M4 18V6" /></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71" /><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71" /></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M11 5h10" /><path d="M11 12h10" /><path d="M11 19h10" /><path d="M4 4h1v5" /><path d="M4 9h2" /><path d="M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02" /></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M3 5h.01" /><path d="M3 12h.01" /><path d="M3 19h.01" /><path d="M8 5h13" /><path d="M8 12h13" /><path d="M8 19h13" /></svg>
@@ -6,14 +6,27 @@
6
6
  "linecap": "round",
7
7
  "linejoin": "round"
8
8
  },
9
- "total": 1011,
9
+ "total": 1022,
10
+ "required": [
11
+ "heading-2",
12
+ "heading-3",
13
+ "heading-4",
14
+ "link",
15
+ "list",
16
+ "list-ordered",
17
+ "quote",
18
+ "redo",
19
+ "subscript",
20
+ "undo",
21
+ "unlink"
22
+ ],
10
23
  "sources": {
11
24
  "crystal": {
12
25
  "count": 13,
13
26
  "license": "Original work"
14
27
  },
15
28
  "lucide": {
16
- "count": 998,
29
+ "count": 1009,
17
30
  "license": "ISC",
18
31
  "notice": "core/licenses/lucide-LICENSE.txt"
19
32
  }
@@ -2851,6 +2864,24 @@
2851
2864
  "source": "lucide",
2852
2865
  "license": "ISC"
2853
2866
  },
2867
+ {
2868
+ "id": "heading-2",
2869
+ "name": "Heading 2",
2870
+ "source": "lucide",
2871
+ "license": "ISC"
2872
+ },
2873
+ {
2874
+ "id": "heading-3",
2875
+ "name": "Heading 3",
2876
+ "source": "lucide",
2877
+ "license": "ISC"
2878
+ },
2879
+ {
2880
+ "id": "heading-4",
2881
+ "name": "Heading 4",
2882
+ "source": "lucide",
2883
+ "license": "ISC"
2884
+ },
2854
2885
  {
2855
2886
  "id": "headphone-off",
2856
2887
  "name": "Headphone Off",
@@ -3241,12 +3272,24 @@
3241
3272
  "source": "lucide",
3242
3273
  "license": "ISC"
3243
3274
  },
3275
+ {
3276
+ "id": "link",
3277
+ "name": "Link",
3278
+ "source": "lucide",
3279
+ "license": "ISC"
3280
+ },
3244
3281
  {
3245
3282
  "id": "link-2-off",
3246
3283
  "name": "Link 2 Off",
3247
3284
  "source": "lucide",
3248
3285
  "license": "ISC"
3249
3286
  },
3287
+ {
3288
+ "id": "list",
3289
+ "name": "List",
3290
+ "source": "lucide",
3291
+ "license": "ISC"
3292
+ },
3250
3293
  {
3251
3294
  "id": "list-check",
3252
3295
  "name": "List Check",
@@ -3289,6 +3332,12 @@
3289
3332
  "source": "lucide",
3290
3333
  "license": "ISC"
3291
3334
  },
3335
+ {
3336
+ "id": "list-ordered",
3337
+ "name": "List Ordered",
3338
+ "source": "lucide",
3339
+ "license": "ISC"
3340
+ },
3292
3341
  {
3293
3342
  "id": "list-plus",
3294
3343
  "name": "List Plus",
@@ -4309,6 +4358,12 @@
4309
4358
  "source": "lucide",
4310
4359
  "license": "ISC"
4311
4360
  },
4361
+ {
4362
+ "id": "quote",
4363
+ "name": "Quote",
4364
+ "source": "lucide",
4365
+ "license": "ISC"
4366
+ },
4312
4367
  {
4313
4368
  "id": "rabbit",
4314
4369
  "name": "Rabbit",
@@ -4399,6 +4454,12 @@
4399
4454
  "source": "lucide",
4400
4455
  "license": "ISC"
4401
4456
  },
4457
+ {
4458
+ "id": "redo",
4459
+ "name": "Redo",
4460
+ "source": "lucide",
4461
+ "license": "ISC"
4462
+ },
4402
4463
  {
4403
4464
  "id": "redo-dot",
4404
4465
  "name": "Redo Dot",
@@ -5275,6 +5336,12 @@
5275
5336
  "source": "lucide",
5276
5337
  "license": "ISC"
5277
5338
  },
5339
+ {
5340
+ "id": "subscript",
5341
+ "name": "Subscript",
5342
+ "source": "lucide",
5343
+ "license": "ISC"
5344
+ },
5278
5345
  {
5279
5346
  "id": "subtitles",
5280
5347
  "name": "Subtitles",
@@ -5671,6 +5738,12 @@
5671
5738
  "source": "lucide",
5672
5739
  "license": "ISC"
5673
5740
  },
5741
+ {
5742
+ "id": "undo",
5743
+ "name": "Undo",
5744
+ "source": "lucide",
5745
+ "license": "ISC"
5746
+ },
5674
5747
  {
5675
5748
  "id": "undo-dot",
5676
5749
  "name": "Undo Dot",
@@ -5689,6 +5762,12 @@
5689
5762
  "source": "lucide",
5690
5763
  "license": "ISC"
5691
5764
  },
5765
+ {
5766
+ "id": "unlink",
5767
+ "name": "Unlink",
5768
+ "source": "lucide",
5769
+ "license": "ISC"
5770
+ },
5692
5771
  {
5693
5772
  "id": "unlock",
5694
5773
  "name": "Unlock",
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z" /><path d="M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z" /></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M21 7v6h-6" /><path d="M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3l3 2.7" /></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="m4 5 8 8" /><path d="m12 5-8 8" /><path d="M20 19h-4c0-1.5.44-2 1.5-2.5S20 15.33 20 14c0-.47-.17-.93-.48-1.29a2.11 2.11 0 0 0-2.62-.44c-.42.24-.74.62-.9 1.07" /></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M3 7v6h6" /><path d="M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13" /></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71" /><path d="m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71" /><line x1="8" x2="8" y1="2" y2="5" /><line x1="2" x2="5" y1="8" y2="8" /><line x1="16" x2="16" y1="19" y2="22" /><line x1="19" x2="22" y1="16" y2="16" /></svg>
package/assets/motion.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /* Crystal material choreography. Every effect is cancellable, and every effect is finite
2
- except a continuous indicator — activity-turn, activity-travel, skeleton-sweep — which
2
+ except a continuous indicator (activity-turn, activity-travel, skeleton-sweep), which
3
3
  repeats while its work is pending and is stopped by the caller when the work resolves. */
4
4
  (function(root){
5
5
  'use strict';
@@ -43,11 +43,11 @@
43
43
  }
44
44
  function runComponent(element,name,frames,base,engine,options={}){
45
45
  if(!(element instanceof Element))throw new TypeError('CrystalMotion requires an element');
46
- /* `once` coalesces repeats of the SAME recipe on the same element. A continuous
46
+ /* `once` coalesces repeats of the same recipe on the same element. A continuous
47
47
  control fires its event many times a second, and restarting a 400ms animation on
48
- every one of them stops it partway and begins again — which is what makes a slider
49
- feel choppy. A different recipe still interrupts, because that is a different thing
50
- being expressed. Deliberate replays (the catalogue) simply omit the option. */
48
+ every one of them stops it partway and begins again, which makes a slider feel
49
+ choppy. A different recipe still interrupts, because it expresses a different
50
+ thing. A caller that wants a replay, as the catalogue does, omits the option. */
51
51
  if(options.once&&element.dataset.crMotionName===name&&element.dataset.crMotionState==='running')
52
52
  return Promise.resolve({status:'coalesced'});
53
53
  stop(element);element.dataset.crMotionName=name;element.dataset.crMotionEngine=engine;
@@ -55,8 +55,8 @@
55
55
  element.dataset.crMotionSignature=recipe.signature||'measured-layout';
56
56
  if(reduced()){element.dataset.crMotionState='instant';return Promise.resolve({status:'instant'});}
57
57
  const opts={duration:duration(base,options.rate),engine,easing:recipe.signature==='inertia'?'cubic-bezier(0.16, 0.7, 0.2, 1)':recipe.signature==='coalesce'?'cubic-bezier(0.34, 0.08, 0.24, 1)':'cubic-bezier(0.22, 0.65, 0.22, 1)'};
58
- /* A continuous recipe travels at constant speed and repeats until stop() — the
59
- returned promise settles only when it is cancelled, which is the caller's to do
58
+ /* A continuous recipe travels at constant speed and repeats until stop(). The
59
+ returned promise settles only when it is cancelled, which the caller does
60
60
  the moment the pending work resolves. */
61
61
  if(recipe.loop){opts.easing=recipe.easing||'linear';opts.repeat=Infinity;}
62
62
  /* A staggered mark waits its turn: `index` is its position and `count` how many
@@ -68,7 +68,7 @@
68
68
  const animations=[CrystalEngines.frames(element,frames,opts)];
69
69
  /* The optical layers are finite decoration on a transition. On a loop they would
70
70
  repeat with it, and a feathered edge that ripples for as long as something is
71
- loading is ambient motion by another route. */
71
+ loading is ambient motion. */
72
72
  if(!recipe.loop)opticalLayers(element,recipe,opts,animations);
73
73
  active.set(element,animations);element.dataset.crMotionState='running';
74
74
  return Promise.all(animations.map(animation=>animation.finished.then(()=>true,error=>{if(error.name!=='AbortError')throw error;return false;}))).then(results=>{
@@ -140,10 +140,11 @@
140
140
  }
141
141
  media.addEventListener('change',()=>{if(reduced())stopAll();});
142
142
  document.addEventListener('visibilitychange',()=>{if(document.hidden)stopAll();});
143
- /* Ambient motion — what a surface does at rest — is deferred to a later version
144
- of Crystal at Meridian's direction. It was specified, built and measured, and
145
- the record of that work is in the request log; what shipped was not good
146
- enough to keep. The optical layer remains for motion that a person starts. */
143
+ /* Ambient motion, which is what a surface does at rest, is deferred to a later
144
+ version of Crystal at Meridian's direction. It was specified, built and
145
+ measured, and what shipped was not good enough to keep. The record of that
146
+ work is in the request log. The optical layer remains for motion that a
147
+ person starts. */
147
148
 
148
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)])});
149
150
  })(window);