@crewlethq/tokens 0.136.0 → 0.137.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -759,7 +759,7 @@ Every other state and series step ships as approved: the dark inks, dark success
759
759
  In light, the yellow series sits beside the warning ochre (`#c27600` and `#c17300`). The approved palette drew the two a few steps apart, and both were darkened onto the same floor, a mark that clears 3:1 on the frame. Nothing in the suite keeps a series from a state other than the reserved red, and a series is read only inside a figure that names it.
760
760
 
761
761
  - **The danger fill carries a white label**, on a toast's destructive action and on an upload's remove button, so it is dark enough for 4.5:1 in both palettes (4.59:1 dark, 6.61:1 light), and its hover, `--color-feedback-danger-hover`, is a step darker again, the least a reader can see (dE 3.03 dark, 3.02 light). The palette suite holds the hover as it holds the primary action's: `a hovered destructive action is a visible step away from its label`.
762
- - **A status glyph is held to 3:1 on its fill.** An `Avatar` status badge is the info, warning or danger fill carrying a small glyph in `--color-text-inverse`, the one ink that clears all three in both palettes (white sits at 1.6:1 on the dark info step). The pairs are `MARK_ON_FILL`, measured over every ground as a label is, under `a glyph clears 3:1 on its own fill`: the 3:1 a mark is held to, since a glyph is a shape rather than running text. The tightest is 3.33:1, the inverse ink on the light info step.
762
+ - **A status or verdict glyph is held to 3:1 on its fill.** An `Avatar` status or verdict badge is the info, warning, danger or success fill carrying a small glyph in `--color-text-inverse`, the one ink that clears all four in both palettes (white sits at 1.6:1 on the dark info step). The pairs are `MARK_ON_FILL`, measured over every ground as a label is, under `a glyph clears 3:1 on its own fill`: the 3:1 a mark is held to, since a glyph is a shape rather than running text. The tightest is 3.33:1, the inverse ink on the light info and success steps.
763
763
  - **The reserved red is kept away from every series**: dE 14 under normal vision and 8 under protanopia and deuteranopia, where red, orange and green fall onto one axis. The approved chart green sat dE 0.6 from the shipped red under deuteranopia.
764
764
  - **Neighbouring series** sit dE 9 apart under every vision and dE 15 under normal vision. The second floor is new: on its own, the dichromat floor let a pair sit dE 9 apart for every reader, which to full-colour vision is two shades of one hue.
765
765
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crewlethq/tokens",
3
- "version": "0.136.0",
3
+ "version": "0.137.0",
4
4
  "description": "Crewlet design tokens. Single JSON source compiled to CSS variables and typed JS modules.",
5
5
  "license": "MIT AND OFL-1.1",
6
6
  "repository": {
package/test/palette.mjs CHANGED
@@ -261,8 +261,8 @@ export const LABEL_ON_FILL = [
261
261
  ];
262
262
 
263
263
  /**
264
- * A fill with the GLYPH a component draws inside it: an avatar's status badge,
265
- * which is a state's fill step carrying a small play, question or stop mark in
264
+ * A fill with the GLYPH a component draws inside it: an avatar's corner, a
265
+ * status or a verdict, which is a state's fill step carrying a small glyph in
266
266
  * the inverse ink. A glyph is a graphic rather than running text, so it is
267
267
  * held to the 3:1 a mark is held to rather than to a label's 4.5:1.
268
268
  *
@@ -275,6 +275,7 @@ export const MARK_ON_FILL = [
275
275
  ['--color-text-inverse', '--color-feedback-info'],
276
276
  ['--color-text-inverse', '--color-feedback-warning'],
277
277
  ['--color-text-inverse', '--color-feedback-danger'],
278
+ ['--color-text-inverse', '--color-feedback-success'],
278
279
  ];
279
280
 
280
281
  /**
@@ -437,14 +437,14 @@ describe('the state and chart hues', () => {
437
437
  const DESTRUCTIVE_RULE = ACTION_STEPS[2][0];
438
438
  const summary = (check) => `${check.rule}: ${check.subject}: ${check.detail}`;
439
439
 
440
- test('every status glyph is measured on its fill, in every state', () => {
441
- // An avatar's status badge is a state fill carrying a glyph. A table that
442
- // stopped measuring one of the three would pass the one badge nobody can
443
- // read: white on the dark info step is 1.6:1.
440
+ test('every status and verdict glyph is measured on its fill, in every state', () => {
441
+ // An avatar's status or verdict badge is a state fill carrying a glyph. A
442
+ // table that stopped measuring one of the four would pass the one badge
443
+ // nobody can read: white on the dark info step is 1.6:1.
444
444
  const GLYPH_RULE = 'a glyph clears 3:1 on its own fill';
445
445
  assert.deepEqual(
446
446
  MARK_ON_FILL.map(([, fill]) => fill),
447
- ['--color-feedback-info', '--color-feedback-warning', '--color-feedback-danger'],
447
+ ['--color-feedback-info', '--color-feedback-warning', '--color-feedback-danger', '--color-feedback-success'],
448
448
  );
449
449
  for (const state of THEME_STATES) {
450
450
  for (const [ink, fill] of MARK_ON_FILL) {
@@ -453,11 +453,15 @@ describe('the state and chart hues', () => {
453
453
  assert.ok(measured[0].ok, `${state}: ${describeFailure(measured[0])}`);
454
454
  }
455
455
  }
456
- // And it can fail: white glyphs on the dark info step.
456
+ // And it can fail: white glyphs on the dark info, warning and success steps.
457
457
  const white = checksAfter('dark', '--color-text-inverse', '#ffffff').filter((check) => check.rule === GLYPH_RULE);
458
458
  assert.deepEqual(
459
459
  white.map((check) => check.subject),
460
- ['--color-text-inverse on --color-feedback-info', '--color-text-inverse on --color-feedback-warning'],
460
+ [
461
+ '--color-text-inverse on --color-feedback-info',
462
+ '--color-text-inverse on --color-feedback-warning',
463
+ '--color-text-inverse on --color-feedback-success',
464
+ ],
461
465
  );
462
466
  });
463
467