@wistia/kaleidoscope 0.0.7 → 0.0.8

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 (44) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/{color-BgYVUbOQ.js → color-BuPhQjcd.js} +3 -3
  3. package/dist/{color-BgYVUbOQ.js.map → color-BuPhQjcd.js.map} +1 -1
  4. package/dist/{engine-DHDkDPaV.js → engine-6ocr431e.js} +788 -374
  5. package/dist/engine-6ocr431e.js.map +1 -0
  6. package/dist/{engine-B00ZVZ0d.d.ts → engine-CcU0Q8Jg.d.ts} +5 -3
  7. package/dist/{engine-B00ZVZ0d.d.ts.map → engine-CcU0Q8Jg.d.ts.map} +1 -1
  8. package/dist/entries/color.js +3 -3
  9. package/dist/entries/engine.d.ts +1 -1
  10. package/dist/entries/engine.js +2 -2
  11. package/dist/entries/styleRegistry.d.ts +1 -1
  12. package/dist/entries/styleRegistry.js +2 -2
  13. package/dist/entries/validate.d.ts +1 -1
  14. package/dist/entries/validate.js +2 -2
  15. package/dist/entries/vocabulary.d.ts +2 -2
  16. package/dist/entries/vocabulary.js +4 -4
  17. package/dist/{getColorLightnessClassification-C6BXD8Da.js → getColorLightnessClassification-Dgr8qirZ.js} +2 -2
  18. package/dist/{getColorLightnessClassification-C6BXD8Da.js.map → getColorLightnessClassification-Dgr8qirZ.js.map} +1 -1
  19. package/dist/{guards-BJfumKYK.js → guards-BPewjm9T.js} +2 -2
  20. package/dist/{guards-BJfumKYK.js.map → guards-BPewjm9T.js.map} +1 -1
  21. package/dist/{index-BOJCY_MU.d.ts → index-BTumAeju.d.ts} +26 -7
  22. package/dist/index-BTumAeju.d.ts.map +1 -0
  23. package/dist/index.d.ts +5 -5
  24. package/dist/index.js +9 -9
  25. package/dist/{styleRegistry-Dcho9r3B.js → styleRegistry-BqGmp-3z.js} +5 -5
  26. package/dist/{styleRegistry-Dcho9r3B.js.map → styleRegistry-BqGmp-3z.js.map} +1 -1
  27. package/dist/{styleRegistry-A0nrsHk-.d.ts → styleRegistry-BsMmbH_0.d.ts} +2 -2
  28. package/dist/{styleRegistry-A0nrsHk-.d.ts.map → styleRegistry-BsMmbH_0.d.ts.map} +1 -1
  29. package/dist/{styleVocabulary-DMhXOr4F.js → styleVocabulary-CDTPCMhZ.js} +11 -5
  30. package/dist/{styleVocabulary-DMhXOr4F.js.map → styleVocabulary-CDTPCMhZ.js.map} +1 -1
  31. package/dist/{typography-BLPIIq_8.js → typography-BCKqcNDx.js} +2 -2
  32. package/dist/{typography-BLPIIq_8.js.map → typography-BCKqcNDx.js.map} +1 -1
  33. package/dist/{validate-Bqx__f3d.d.ts → validate-8Ow1tYvz.d.ts} +2 -2
  34. package/dist/{validate-Bqx__f3d.d.ts.map → validate-8Ow1tYvz.d.ts.map} +1 -1
  35. package/dist/{validate-BkOpEpch.js → validate-D_VsJM1q.js} +88 -26
  36. package/dist/validate-D_VsJM1q.js.map +1 -0
  37. package/package.json +7 -7
  38. package/schema/style-v1.json +128 -20
  39. package/styles/opaque-bright.json +1 -1
  40. package/styles/opaque-heavy.json +1 -1
  41. package/styles/opaque-minimal.json +1 -1
  42. package/dist/engine-DHDkDPaV.js.map +0 -1
  43. package/dist/index-BOJCY_MU.d.ts.map +0 -1
  44. package/dist/validate-BkOpEpch.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
 
2
- import { n as StyleDocument } from "./index-BOJCY_MU.js";
2
+ import { n as StyleDocument } from "./index-BTumAeju.js";
3
3
  /** One thing wrong with a document, addressed well enough to fix without hunting. */
4
4
  type StyleDocumentIssue = {
5
5
  readonly message: string;
@@ -53,4 +53,4 @@ declare const validateStyleDocument: (input: unknown) => readonly StyleDocumentI
53
53
  /** Whether a value is a valid Style document. */
54
54
  declare const isStyleDocument: (input: unknown) => input is StyleDocument;
55
55
  export { StyleDocumentReport as a, StyleDocumentIssue as i, isStyleDocument as n, validateStyleDocument as r, checkStyleDocument as t };
56
- //# sourceMappingURL=validate-Bqx__f3d.d.ts.map
56
+ //# sourceMappingURL=validate-8Ow1tYvz.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"validate-Bqx__f3d.d.ts","names":[],"sources":["../src/validateStyleDocument/issues.ts","../src/validateStyleDocument/validateStyleDocument.ts"],"mappings":";;;KAGY;WACD;WACA;;;;;;;;KASC;WACD,iBAAiB;WACjB,mBAAmB;;;;;;;;;;;;;;;;;;;;cCYjB,qBAAsB,mBAAiB;;;;;;;;;;;;;;;;cAkDvC,wBAAyB,4BAA0B;;cAInD,kBAAmB,mBAAiB,SAAS"}
1
+ {"version":3,"file":"validate-8Ow1tYvz.d.ts","names":[],"sources":["../src/validateStyleDocument/issues.ts","../src/validateStyleDocument/validateStyleDocument.ts"],"mappings":";;;KAGY;WACD;WACA;;;;;;;;KASC;WACD,iBAAiB;WACjB,mBAAmB;;;;;;;;;;;;;;;;;;;;cCYjB,qBAAsB,mBAAiB;;;;;;;;;;;;;;;;cAkDvC,wBAAyB,4BAA0B;;cAInD,kBAAmB,mBAAiB,SAAS"}
@@ -1,15 +1,15 @@
1
1
 
2
2
  /*
3
- * @license @wistia/kaleidoscope v0.0.7
3
+ * @license @wistia/kaleidoscope v0.0.8
4
4
  *
5
5
  * Copyright (c) 2026, Wistia, Inc. and its affiliates.
6
6
  *
7
7
  * This source code is unlicensed, all rights reserved.
8
8
  */
9
9
 
10
- import { A as REQUIRED_FONT_ANCHORS, C as ANCHORS_REQUIRED_BY_TREATMENT, D as OPTIONAL_COLOR_ANCHORS, E as COLOR_ANCHOR_NAMES, O as REQUIRED_COLOR_ANCHORS, T as ANCHOR_REF_PREFIX, _ as INVERT_RULES, a as AMBIENT_MOTIONS, b as COLOR_TONES, c as GRADIENT_DIRECTIONS, d as GRADIENT_SHAPE_OPTIONS, g as ELEVATION_HARDNESSES, h as ELEVATION_DEPTHS, i as TEXTURE_KINDS, j as SINGLE_COLOR_ANCHOR_NAMES, k as REQUIRED_DIMENSION_ANCHORS, l as GRADIENT_EXTENTS, m as ELEVATION_COLOR_SOURCE_KEYWORDS, n as TREATMENTS, o as MOTION_SPEEDS, r as TEXTURE_INTENSITIES, s as TRANSITIONS, t as DOCUMENT_KEYS, u as GRADIENT_POSITIONS, v as OFFSET_ORIGINS, w as ANCHOR_GROUPS, x as GENERIC_FONT_FAMILIES, y as COLOR_RELATIONSHIPS } from "./styleVocabulary-DMhXOr4F.js";
11
- import { c as BORDER_STYLES, n as TYPE_ROLES, o as STACKABLE_ON, r as ALL_SETTING_NAMES, s as SURFACE_NAMES, t as TYPE_CASES } from "./typography-BLPIIq_8.js";
12
- import { i as isString, n as isOneOf, r as isRecord, t as at } from "./guards-BJfumKYK.js";
10
+ import { A as REQUIRED_DIMENSION_ANCHORS, D as COLOR_ANCHOR_NAMES, E as ANCHOR_REF_PREFIX, M as SINGLE_COLOR_ANCHOR_NAMES, O as OPTIONAL_COLOR_ANCHORS, S as GENERIC_FONT_FAMILIES, T as ANCHOR_GROUPS, _ as ELEVATION_HARDNESSES, a as AMBIENT_MOTIONS, b as COLOR_RELATIONSHIPS, c as TRANSITIONS, d as GRADIENT_POSITIONS, f as GRADIENT_SHAPE_OPTIONS, g as ELEVATION_DEPTHS, h as ELEVATION_COLOR_SOURCE_KEYWORDS, i as TEXTURE_KINDS, j as REQUIRED_FONT_ANCHORS, k as REQUIRED_COLOR_ANCHORS, l as GRADIENT_DIRECTIONS, n as TREATMENTS, o as MOTION_SPEEDS, r as TEXTURE_INTENSITIES, s as PULSE_SIZES, t as DOCUMENT_KEYS, u as GRADIENT_EXTENTS, v as INVERT_RULES, w as ANCHORS_REQUIRED_BY_TREATMENT, x as COLOR_TONES, y as OFFSET_ORIGINS } from "./styleVocabulary-CDTPCMhZ.js";
11
+ import { c as BORDER_STYLES, n as TYPE_ROLES, o as STACKABLE_ON, r as ALL_SETTING_NAMES, s as SURFACE_NAMES, t as TYPE_CASES } from "./typography-BCKqcNDx.js";
12
+ import { i as isString, n as isOneOf, r as isRecord, t as at } from "./guards-BPewjm9T.js";
13
13
  // src/private/styleDocumentPatterns.ts
14
14
  const ID_PATTERN = /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/;
15
15
  /** No dots: brand tokens are not namespaced. */
@@ -27,6 +27,13 @@ const RGB_VALUE = String.raw`[+-]?(?:\d+\.?\d*|\.\d+)%?`;
27
27
  */
28
28
  const RGB_COLOR = String.raw`rgba?\(\s*(?:${RGB_VALUE}\s*,\s*${RGB_VALUE}\s*,\s*${RGB_VALUE}(?:\s*,\s*${RGB_VALUE})?|${RGB_VALUE}\s+${RGB_VALUE}\s+${RGB_VALUE}(?:\s*/\s*${RGB_VALUE})?)\s*\)`;
29
29
  const LITERAL_COLOR_PATTERN = new RegExp(String.raw`^(?:${HEX_COLOR}|${RGB_COLOR})$`);
30
+ const OPAQUE_HEX_COLOR = String.raw`#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})`;
31
+ const OPAQUE_RGB_COLOR = String.raw`rgba?\(\s*(?:${RGB_VALUE}\s*,\s*${RGB_VALUE}\s*,\s*${RGB_VALUE}|${RGB_VALUE}\s+${RGB_VALUE}\s+${RGB_VALUE})\s*\)`;
32
+ /**
33
+ * A literal with no alpha. A gradient's stops must be opaque: text is checked against them as
34
+ * painted, and a see-through stop would show whatever is behind it instead.
35
+ */
36
+ const OPAQUE_LITERAL_COLOR_PATTERN = new RegExp(String.raw`^(?:${OPAQUE_HEX_COLOR}|${OPAQUE_RGB_COLOR})$`);
30
37
  const NOT_IN_QUOTED_FAMILY = String.raw`$;{}()<>\\`;
31
38
  /** A comma delineates font families, but inside quotes it should be considered part of the name. */
32
39
  const NOT_IN_FAMILY = `,${NOT_IN_QUOTED_FAMILY}`;
@@ -57,6 +64,7 @@ const checkNoUnknownKeys = (value, known, path, label) => Object.keys(value).fil
57
64
  }));
58
65
  // src/validateStyleDocument/anchorValues.ts
59
66
  const COLOR_FORM_MESSAGE = "must be a hex or rgb() literal, a token reference like \"$primaryColor\", or { from, relation, tone }";
67
+ const GRADIENT_STOP_MESSAGE = "must be an opaque hex or rgb() literal, with no alpha, a token reference like \"$primaryColor\", or { from, relation, tone }";
60
68
  const isTokenRef = (value) => isString(value) && TOKEN_PATTERN.test(value);
61
69
  const RELATED_COLOR_KEYS = /* @__PURE__ */ new Set([
62
70
  "from",
@@ -74,6 +82,8 @@ const isRelatedColor = (value) => {
74
82
  };
75
83
  /** One color, in any of the three forms a document may write. */
76
84
  const isColorForm = (value) => isString(value) && LITERAL_COLOR_PATTERN.test(value) || isTokenRef(value) || isRelatedColor(value);
85
+ /** One gradient stop: a color form whose literal, if it is one, has no alpha. */
86
+ const isGradientStopForm = (value) => isString(value) && OPAQUE_LITERAL_COLOR_PATTERN.test(value) || isTokenRef(value) || isRelatedColor(value);
77
87
  const COLOR_REF_PREFIX = `${ANCHOR_REF_PREFIX}colors.`;
78
88
  /**
79
89
  * The color anchor a reference names, when that anchor holds a single color.
@@ -94,15 +104,8 @@ const isPixelValue = (value) => typeof value === "number" && Number.isFinite(val
94
104
  const isDimension = (value) => isPixelValue(value) || isTokenRef(value);
95
105
  // src/validateStyleDocument/anchors.ts
96
106
  const isFontStack = (value) => isString(value) && FONT_STACK_PATTERN.test(value);
97
- /**
98
- * `gradientStops` is always a list because a gradient interpolates between colors.
99
- * The other color anchors are always a single color.
100
- */
101
- const checkColorAnchor = (value, path, { asStops = false } = {}) => {
102
- if (!asStops) return isColorForm(value) ? [] : [{
103
- message: COLOR_FORM_MESSAGE,
104
- path
105
- }];
107
+ /** A gradient interpolates between opaque colors, so its stops are always a list of them. */
108
+ const checkGradientStops = (value, path) => {
106
109
  if (!Array.isArray(value)) return [{
107
110
  message: `must be a list of 2-6 colors`,
108
111
  path
@@ -115,11 +118,22 @@ const checkColorAnchor = (value, path, { asStops = false } = {}) => {
115
118
  return [...value.length < 2 ? [{
116
119
  message: countMessage,
117
120
  path
118
- }] : [], ...Array.from(value, (stop, index) => isColorForm(stop) ? [] : [{
119
- message: COLOR_FORM_MESSAGE,
121
+ }] : [], ...Array.from(value, (stop, index) => isGradientStopForm(stop) ? [] : [{
122
+ message: GRADIENT_STOP_MESSAGE,
120
123
  path: `${path}.${index}`
121
124
  }]).flat()];
122
125
  };
126
+ /**
127
+ * `gradientStops` is always a list because a gradient interpolates between colors.
128
+ * The other color anchors are always a single color.
129
+ */
130
+ const checkColorAnchor = (value, path, { asStops = false } = {}) => {
131
+ if (asStops) return checkGradientStops(value, path);
132
+ return isColorForm(value) ? [] : [{
133
+ message: COLOR_FORM_MESSAGE,
134
+ path
135
+ }];
136
+ };
123
137
  const ALWAYS_DECLARED_MESSAGE = "mirrors a Brand Kit input, so every Style declares it, whether or not it is used";
124
138
  const UNUSED_ANCHOR_MESSAGE = "nothing references it and no treatment needs it, so the engine ignores it";
125
139
  const checkAnchorGroup = (anchors, group, members, label) => {
@@ -376,7 +390,8 @@ const GRADIENT_SHAPE_KEYS = [
376
390
  "kind",
377
391
  "direction",
378
392
  "position",
379
- "extent"
393
+ "extent",
394
+ "stops"
380
395
  ];
381
396
  const KIND_SPECIFIC_KEYS = [
382
397
  [
@@ -395,6 +410,11 @@ const KIND_SPECIFIC_KEYS = [
395
410
  GRADIENT_EXTENTS
396
411
  ]
397
412
  ];
413
+ /** A gradient surface with its own stops draws them in place of `anchors.colors.gradientStops`. */
414
+ const hasOwnGradientStops = (value) => {
415
+ const shape = at(value, "gradientShape");
416
+ return isRecord(shape) && Object.hasOwn(shape, "stops");
417
+ };
398
418
  /**
399
419
  * `gradientShape` is the one setting a surface carries conditionally: required when the treatment
400
420
  * is `gradient`, absent otherwise. Naming a shape on a surface that paints no gradient is an error
@@ -416,7 +436,7 @@ const checkGradientShape = (value, path, treatment) => {
416
436
  message: "must be an object",
417
437
  path: shapePath
418
438
  }];
419
- const issues = [...checkNoUnknownKeys(shape, GRADIENT_SHAPE_KEYS, shapePath, "setting")];
439
+ const issues = [...checkNoUnknownKeys(shape, GRADIENT_SHAPE_KEYS, shapePath, "setting"), ...Object.hasOwn(shape, "stops") ? checkGradientStops(at(shape, "stops"), `${shapePath}.stops`) : []];
420
440
  const kind = at(shape, "kind");
421
441
  if (!isOneOf(GRADIENT_SHAPE_OPTIONS, kind)) {
422
442
  issues.push({
@@ -448,16 +468,58 @@ const checkGradientShape = (value, path, treatment) => {
448
468
  return issues;
449
469
  };
450
470
  // src/validateStyleDocument/motion.ts
451
- const checkMotion = (value, path) => {
471
+ /** `pulseColor` is carried conditionally: required on a pulse, and meaningless on anything else. */
472
+ const checkPulseColor = (value, path, collected) => {
473
+ const pulseColor = at(value, "pulseColor");
474
+ const pulseColorPath = `${path}.pulseColor`;
475
+ if (at(value, "ambient") !== "pulse") return pulseColor === void 0 ? [] : [{
476
+ message: "only a surface with ambient \"pulse\" carries a pulseColor",
477
+ path: pulseColorPath
478
+ }];
479
+ if (pulseColor === void 0) return [{
480
+ message: "a surface with ambient \"pulse\" needs a pulseColor",
481
+ path: pulseColorPath
482
+ }];
483
+ if (pulseColor === "derive") return [];
484
+ const anchor = singleColorAnchorFromRef(pulseColor);
485
+ if (anchor !== void 0) {
486
+ collected.referenced.add(anchor);
487
+ return [];
488
+ }
489
+ return isColorForm(pulseColor) ? [] : [{
490
+ message: `must be "derive" or ${COLOR_FORM_MESSAGE}`,
491
+ path: pulseColorPath
492
+ }];
493
+ };
494
+ /** `pulseSize` is carried the same way as `pulseColor`. */
495
+ const checkPulseSize = (value, path) => {
496
+ const pulseSize = at(value, "pulseSize");
497
+ const pulseSizePath = `${path}.pulseSize`;
498
+ if (at(value, "ambient") !== "pulse") return pulseSize === void 0 ? [] : [{
499
+ message: "only a surface with ambient \"pulse\" carries a pulseSize",
500
+ path: pulseSizePath
501
+ }];
502
+ return isOneOf(PULSE_SIZES, pulseSize) ? [] : [{
503
+ message: `pulseSize must be one of: ${list(PULSE_SIZES)}`,
504
+ path: pulseSizePath
505
+ }];
506
+ };
507
+ const checkMotion = (value, path, collected) => {
452
508
  if (!isRecord(value)) return [{
453
509
  message: "must be an object",
454
510
  path
455
511
  }];
456
- const issues = [...checkNoUnknownKeys(value, [
457
- "ambient",
458
- "speed",
459
- "transition"
460
- ], path, "motion key")];
512
+ const issues = [
513
+ ...checkNoUnknownKeys(value, [
514
+ "ambient",
515
+ "speed",
516
+ "transition",
517
+ "pulseColor",
518
+ "pulseSize"
519
+ ], path, "motion key"),
520
+ ...checkPulseColor(value, path, collected),
521
+ ...checkPulseSize(value, path)
522
+ ];
461
523
  if (!isOneOf(AMBIENT_MOTIONS, at(value, "ambient"))) issues.push({
462
524
  message: `ambient must be one of: ${list(AMBIENT_MOTIONS)}`,
463
525
  path: `${path}.ambient`
@@ -548,7 +610,7 @@ const checkSurface = (value, name, collected) => {
548
610
  }];
549
611
  const treatment = at(value, "treatment");
550
612
  const namedTreatment = isOneOf(TREATMENTS, treatment);
551
- if (namedTreatment) collected.treatments.add(treatment);
613
+ if (namedTreatment && !(treatment === "gradient" && hasOwnGradientStops(value))) collected.treatments.add(treatment);
552
614
  return [
553
615
  ...checkNoUnknownKeys(value, ALL_SETTING_NAMES, path, "setting"),
554
616
  ...namedTreatment ? [] : [{
@@ -562,7 +624,7 @@ const checkSurface = (value, name, collected) => {
562
624
  ...checkElevation(at(value, "elevation"), `${path}.elevation`, collected),
563
625
  ...checkRadius(at(value, "radius"), `${path}.radius`),
564
626
  ...checkTexture(at(value, "texture"), `${path}.texture`, treatment),
565
- ...checkMotion(at(value, "motion"), `${path}.motion`)
627
+ ...checkMotion(at(value, "motion"), `${path}.motion`, collected)
566
628
  ];
567
629
  };
568
630
  const checkSurfaces = (value, collected) => {
@@ -697,4 +759,4 @@ const validateStyleDocument = (input) => checkStyleDocument(input).errors;
697
759
  const isStyleDocument = (input) => validateStyleDocument(input).length === 0;
698
760
  export { isStyleDocument as n, validateStyleDocument as r, checkStyleDocument as t };
699
761
 
700
- //# sourceMappingURL=validate-BkOpEpch.js.map
762
+ //# sourceMappingURL=validate-D_VsJM1q.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate-D_VsJM1q.js","names":[],"sources":["../src/private/styleDocumentPatterns.ts","../src/validateStyleDocument/issues.ts","../src/validateStyleDocument/anchorValues.ts","../src/validateStyleDocument/anchors.ts","../src/validateStyleDocument/backgroundColor.ts","../src/validateStyleDocument/border.ts","../src/validateStyleDocument/elevation.ts","../src/validateStyleDocument/gradientShape.ts","../src/validateStyleDocument/motion.ts","../src/validateStyleDocument/radius.ts","../src/validateStyleDocument/textColor.ts","../src/validateStyleDocument/texture.ts","../src/validateStyleDocument/surfaces.ts","../src/validateStyleDocument/typography.ts","../src/validateStyleDocument/validateStyleDocument.ts"],"sourcesContent":["// oxlint-disable typescript/no-inferrable-types -- `isolatedDeclarations` (tsconfig.build.json)\n// requires an explicit annotation on every exported const, including ones oxlint considers\n// trivially inferable.\n\nimport { GENERIC_FONT_FAMILIES } from '../styleVocabulary';\n\nexport const ID_PATTERN: RegExp = /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/;\n\n/** No dots: brand tokens are not namespaced. */\nexport const TOKEN_PATTERN: RegExp = /^\\$[A-Za-z][A-Za-z0-9]*$/;\n\nconst HEX_COLOR = String.raw`#(?:[0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})`;\n\n/** One channel or alpha inside an `rgb()`: a number, or a percentage of the channel's range. */\nconst RGB_VALUE = String.raw`[+-]?(?:\\d+\\.?\\d*|\\.\\d+)%?`;\n\n/**\n * Legacy `rgb(41, 73, 229)` and modern `rgb(41 73 229 / 50%)`, each with an optional alpha.\n *\n * Kept in step with `parseColor`, which reads a document's literals at render time: a literal this\n * accepts must be one the parser can read, or validation approves a color that silently falls back.\n * The parser is the more forgiving of the two — it also takes a hex without its `#`, `RGB()` in any\n * case, and separators mixed within one function — so only that direction is guaranteed.\n */\nconst RGB_COLOR = String.raw`rgba?\\(\\s*(?:${RGB_VALUE}\\s*,\\s*${RGB_VALUE}\\s*,\\s*${RGB_VALUE}(?:\\s*,\\s*${RGB_VALUE})?|${RGB_VALUE}\\s+${RGB_VALUE}\\s+${RGB_VALUE}(?:\\s*/\\s*${RGB_VALUE})?)\\s*\\)`;\n\nexport const LITERAL_COLOR_PATTERN: RegExp = new RegExp(\n String.raw`^(?:${HEX_COLOR}|${RGB_COLOR})$`,\n);\n\nconst OPAQUE_HEX_COLOR = String.raw`#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})`;\n\nconst OPAQUE_RGB_COLOR = String.raw`rgba?\\(\\s*(?:${RGB_VALUE}\\s*,\\s*${RGB_VALUE}\\s*,\\s*${RGB_VALUE}|${RGB_VALUE}\\s+${RGB_VALUE}\\s+${RGB_VALUE})\\s*\\)`;\n\n/**\n * A literal with no alpha. A gradient's stops must be opaque: text is checked against them as\n * painted, and a see-through stop would show whatever is behind it instead.\n */\nexport const OPAQUE_LITERAL_COLOR_PATTERN: RegExp = new RegExp(\n String.raw`^(?:${OPAQUE_HEX_COLOR}|${OPAQUE_RGB_COLOR})$`,\n);\n\nconst NOT_IN_QUOTED_FAMILY = String.raw`$;{}()<>\\\\`;\n\n/** A comma delineates font families, but inside quotes it should be considered part of the name. */\nconst NOT_IN_FAMILY = `,${NOT_IN_QUOTED_FAMILY}`;\n\n/**\n * One family in a list, where each item is delineated by a comma.\n * No `$`, parentheses, braces, angle brackets, backslashes or semicolons allowed in the family\n * names. Any quotes must have a matching end quote.\n */\nconst FONT_FAMILY = [\n String.raw`\"[^\"${NOT_IN_QUOTED_FAMILY}]+\"`, // \"Segoe UI\", and may hold the other quote: \"Foo's Text\"\n String.raw`'[^'${NOT_IN_QUOTED_FAMILY}]+'`, // 'Fraunces', or with a comma: 'ACME, Inc'\n // Ends on a non-space so trailing spaces only match the separator\n String.raw`[^\\s\"'${NOT_IN_FAMILY}](?:[^\"'${NOT_IN_FAMILY}]*[^\\s\"'${NOT_IN_FAMILY}])?`, // Georgia, -apple-system, メイリオ\n].join('|');\n\n/**\n * A CSS font-family list that ends in a generic family, so a face that fails to load falls back\n * to something of the right kind rather than the browser default.\n *\n * Every family is matched in turn rather than the list being taken as one run of allowed\n * characters: a browser drops a whole `font-family` declaration over one empty family, so\n * `Georgia,, serif` renders nothing the document asked for and must not validate.\n */\nexport const FONT_STACK_PATTERN: RegExp = new RegExp(\n String.raw`^(?:(?:${FONT_FAMILY})\\s*,\\s*)*(?:${GENERIC_FONT_FAMILIES.join('|')})\\s*$`,\n);\n","import type { ColorAnchorName, Treatment } from '../styleVocabulary';\n\n/** One thing wrong with a document, addressed well enough to fix without hunting. */\nexport type StyleDocumentIssue = {\n readonly message: string;\n readonly path: string;\n};\n\n/**\n * Everything a check found, split by what it costs.\n *\n * An **error** is blocking and fails style validation\n * A **warning** is not blocking and only produces a warning message\n */\nexport type StyleDocumentReport = {\n readonly errors: readonly StyleDocumentIssue[];\n readonly warnings: readonly StyleDocumentIssue[];\n};\n\n/**\n * What a walk over the surfaces gathers for the checks that span subtrees: which color anchors a\n * surface named, and which treatments the document uses. Written here, read once anchor\n * completeness arrives.\n */\nexport type Collected = {\n readonly referenced: Set<ColorAnchorName>;\n readonly treatments: Set<Treatment>;\n};\n\nexport const list = (values: readonly string[]): string => values.join(', ');\n\nexport const checkNoUnknownKeys = (\n value: Readonly<Record<string, unknown>>,\n known: readonly string[],\n path: string,\n label: string,\n): readonly StyleDocumentIssue[] =>\n Object.keys(value)\n .filter((key) => !known.includes(key))\n .map((key) => ({\n message: `unknown ${label} — the set is fixed: ${list(known)}`,\n path: path === '' ? key : `${path}.${key}`,\n }));\n","import type { SingleColorAnchorName } from '../styleVocabulary';\nimport { at, isOneOf, isRecord, isString } from '../private/guards';\nimport {\n LITERAL_COLOR_PATTERN,\n OPAQUE_LITERAL_COLOR_PATTERN,\n TOKEN_PATTERN,\n} from '../private/styleDocumentPatterns';\nimport {\n ANCHOR_REF_PREFIX,\n COLOR_RELATIONSHIPS,\n COLOR_TONES,\n MAX_COLOR_SCALE_OFFSET,\n SINGLE_COLOR_ANCHOR_NAMES,\n} from '../styleVocabulary';\nimport { list } from './issues';\n\nexport const COLOR_FORM_MESSAGE =\n 'must be a hex or rgb() literal, a token reference like \"$primaryColor\", or { from, relation, tone }';\n\nexport const GRADIENT_STOP_MESSAGE =\n 'must be an opaque hex or rgb() literal, with no alpha, a token reference like \"$primaryColor\", or { from, relation, tone }';\n\nexport const isTokenRef = (value: unknown): boolean => isString(value) && TOKEN_PATTERN.test(value);\n\nconst RELATED_COLOR_KEYS: ReadonlySet<string> = new Set(['from', 'relation', 'tone']);\n\n/**\n * A `{ from, relation, tone }` color. `relation` and `tone` are optional, but an unknown one is rejected.\n */\nconst isRelatedColor = (value: unknown): boolean => {\n if (!isRecord(value)) {\n return false;\n }\n const relation = at(value, 'relation');\n const tone = at(value, 'tone');\n const unknownKeys = Object.keys(value).filter((key) => !RELATED_COLOR_KEYS.has(key));\n\n return (\n unknownKeys.length === 0 &&\n isTokenRef(at(value, 'from')) &&\n (relation === undefined || isOneOf(COLOR_RELATIONSHIPS, relation)) &&\n (tone === undefined || isOneOf(COLOR_TONES, tone))\n );\n};\n\n/** One color, in any of the three forms a document may write. */\nexport const isColorForm = (value: unknown): boolean =>\n (isString(value) && LITERAL_COLOR_PATTERN.test(value)) ||\n isTokenRef(value) ||\n isRelatedColor(value);\n\n/** One gradient stop: a color form whose literal, if it is one, has no alpha. */\nexport const isGradientStopForm = (value: unknown): boolean =>\n (isString(value) && OPAQUE_LITERAL_COLOR_PATTERN.test(value)) ||\n isTokenRef(value) ||\n isRelatedColor(value);\n\nconst COLOR_REF_PREFIX = `${ANCHOR_REF_PREFIX}colors.`;\n\n/**\n * The color anchor a reference names, when that anchor holds a single color.\n *\n * `anchors.colors.gradientStops` is a reference to a real anchor but resolves to a list, so it\n * cannot be used anywhere that a single color is expected.\n */\nexport const singleColorAnchorFromRef = (value: unknown): SingleColorAnchorName | undefined => {\n if (!isString(value) || !value.startsWith(COLOR_REF_PREFIX)) {\n return undefined;\n }\n const name = value.slice(COLOR_REF_PREFIX.length);\n return isOneOf(SINGLE_COLOR_ANCHOR_NAMES, name) ? name : undefined;\n};\n\nexport const singleColorRefList = (): string =>\n list(SINGLE_COLOR_ANCHOR_NAMES.map((name) => `${COLOR_REF_PREFIX}${name}`));\n\nexport const isScaleOffset = (value: unknown): boolean =>\n typeof value === 'number' &&\n Number.isInteger(value) &&\n value >= 0 &&\n value <= MAX_COLOR_SCALE_OFFSET;\n\n/** A non-negative number of CSS pixels — the same convention as `border.width`. */\nconst isPixelValue = (value: unknown): boolean =>\n typeof value === 'number' && Number.isFinite(value) && value >= 0;\n\n/** A length: a brand token or a number of CSS pixels. */\nexport const isDimension = (value: unknown): boolean => isPixelValue(value) || isTokenRef(value);\n","import type { AnchorGroup } from '../styleVocabulary';\nimport type { Collected, StyleDocumentIssue, StyleDocumentReport } from './issues';\nimport { at, isOneOf, isRecord, isString } from '../private/guards';\nimport { FONT_STACK_PATTERN } from '../private/styleDocumentPatterns';\nimport {\n ANCHOR_GROUPS,\n ANCHORS_REQUIRED_BY_TREATMENT,\n COLOR_ANCHOR_NAMES,\n MAX_GRADIENT_STOPS,\n MIN_GRADIENT_STOPS,\n OPTIONAL_COLOR_ANCHORS,\n REQUIRED_COLOR_ANCHORS,\n REQUIRED_DIMENSION_ANCHORS,\n REQUIRED_FONT_ANCHORS,\n} from '../styleVocabulary';\nimport {\n COLOR_FORM_MESSAGE,\n GRADIENT_STOP_MESSAGE,\n isColorForm,\n isDimension,\n isGradientStopForm,\n isTokenRef,\n} from './anchorValues';\nimport { checkNoUnknownKeys } from './issues';\n\nconst isFontStack = (value: unknown): boolean => isString(value) && FONT_STACK_PATTERN.test(value);\n\n/** A gradient interpolates between opaque colors, so its stops are always a list of them. */\nexport const checkGradientStops = (value: unknown, path: string): readonly StyleDocumentIssue[] => {\n if (!Array.isArray(value)) {\n return [\n { message: `must be a list of ${MIN_GRADIENT_STOPS}-${MAX_GRADIENT_STOPS} colors`, path },\n ];\n }\n\n const countMessage = `a gradient needs ${MIN_GRADIENT_STOPS}-${MAX_GRADIENT_STOPS} stops, not ${value.length}`;\n\n // A list over the limit has to be rewritten anyway, and its length may be far beyond its contents.\n if (value.length > MAX_GRADIENT_STOPS) {\n return [{ message: countMessage, path }];\n }\n\n const countIssues: readonly StyleDocumentIssue[] =\n value.length < MIN_GRADIENT_STOPS ? [{ message: countMessage, path }] : [];\n\n return [\n ...countIssues,\n ...Array.from(value, (stop: unknown, index: number): readonly StyleDocumentIssue[] =>\n isGradientStopForm(stop)\n ? []\n : [{ message: GRADIENT_STOP_MESSAGE, path: `${path}.${index}` }],\n ).flat(),\n ];\n};\n\n/**\n * `gradientStops` is always a list because a gradient interpolates between colors.\n * The other color anchors are always a single color.\n */\nconst checkColorAnchor = (\n value: unknown,\n path: string,\n { asStops = false }: { readonly asStops?: boolean } = {},\n): readonly StyleDocumentIssue[] => {\n if (asStops) {\n return checkGradientStops(value, path);\n }\n\n return isColorForm(value) ? [] : [{ message: COLOR_FORM_MESSAGE, path }];\n};\n\nconst ALWAYS_DECLARED_MESSAGE =\n 'mirrors a Brand Kit input, so every Style declares it, whether or not it is used';\n\nconst UNUSED_ANCHOR_MESSAGE =\n 'nothing references it and no treatment needs it, so the engine ignores it';\n\n/** A group's members once it is known to be present and shaped right, alongside what was wrong. */\ntype AnchorGroupResult = {\n readonly members: Readonly<Record<string, unknown>> | undefined;\n readonly issues: readonly StyleDocumentIssue[];\n};\n\nconst checkAnchorGroup = (\n anchors: Readonly<Record<string, unknown>>,\n group: AnchorGroup,\n members: readonly string[],\n label: string,\n): AnchorGroupResult => {\n const path = `anchors.${group}`;\n const value = at(anchors, group);\n\n if (value === undefined) {\n return {\n members: undefined,\n issues: [{ message: 'every Style declares every anchor group', path }],\n };\n }\n if (!isRecord(value)) {\n return { members: undefined, issues: [{ message: 'must be an object', path }] };\n }\n\n return { members: value, issues: checkNoUnknownKeys(value, members, path, label) };\n};\n\nconst checkDimensionAnchors = (\n dimensions: Readonly<Record<string, unknown>>,\n): readonly StyleDocumentIssue[] =>\n REQUIRED_DIMENSION_ANCHORS.flatMap((name): readonly StyleDocumentIssue[] => {\n const path = `anchors.dimensions.${name}`;\n const declared = at(dimensions, name);\n\n if (declared === undefined) {\n return [{ message: ALWAYS_DECLARED_MESSAGE, path }];\n }\n if (!isDimension(declared)) {\n return [\n { message: `${name} must be a token reference or a number of pixels, e.g. 20`, path },\n ];\n }\n\n return [];\n });\n\nconst checkFontAnchors = (\n fonts: Readonly<Record<string, unknown>>,\n): readonly StyleDocumentIssue[] =>\n REQUIRED_FONT_ANCHORS.flatMap((name): readonly StyleDocumentIssue[] => {\n const path = `anchors.fonts.${name}`;\n const declared = at(fonts, name);\n\n if (declared === undefined) {\n return [{ message: ALWAYS_DECLARED_MESSAGE, path }];\n }\n if (!isTokenRef(declared) && !isFontStack(declared)) {\n return [\n {\n message: `${name} must be a token reference, e.g. \"$${name}FontFamily\", or a font stack ending in a generic family, e.g. \"'Fraunces', Georgia, serif\"`,\n path,\n },\n ];\n }\n\n return [];\n });\n\nconst checkColorAnchors = (\n colors: Readonly<Record<string, unknown>>,\n collected: Collected,\n): StyleDocumentReport => {\n const declaredIssues = COLOR_ANCHOR_NAMES.flatMap((name): readonly StyleDocumentIssue[] => {\n const declared = at(colors, name);\n\n return declared === undefined\n ? []\n : checkColorAnchor(declared, `anchors.colors.${name}`, {\n asStops: name === 'gradientStops',\n });\n });\n\n // The brand's own colors are always declared, referenced or not.\n const missingRequired = REQUIRED_COLOR_ANCHORS.filter(\n (name) => at(colors, name) === undefined,\n ).map((name) => ({ message: ALWAYS_DECLARED_MESSAGE, path: `anchors.colors.${name}` }));\n\n // Treatment colors are declared only where they are needed — and must be, when they are.\n const needed = new Set(collected.referenced);\n for (const treatment of collected.treatments) {\n for (const anchor of ANCHORS_REQUIRED_BY_TREATMENT[treatment]) {\n needed.add(anchor);\n }\n }\n\n const missingNeeded = [...needed]\n .filter(\n (anchor) => !isOneOf(REQUIRED_COLOR_ANCHORS, anchor) && at(colors, anchor) === undefined,\n )\n .map((anchor) => ({\n message: 'referenced by a surface or required by a treatment, but not declared',\n path: `anchors.colors.${anchor}`,\n }));\n\n // And nowhere else: an unreachable treatment color is dead weight, usually a copied document.\n // It changes nothing about how the document renders, so it is a warning rather than an error.\n const warnings = OPTIONAL_COLOR_ANCHORS.filter(\n (anchor) => at(colors, anchor) !== undefined && !needed.has(anchor),\n ).map((anchor) => ({ message: UNUSED_ANCHOR_MESSAGE, path: `anchors.colors.${anchor}` }));\n\n return { errors: [...declaredIssues, ...missingRequired, ...missingNeeded], warnings };\n};\n\nexport const checkAnchors = (value: unknown, collected: Collected): StyleDocumentReport => {\n if (!isRecord(value)) {\n return { errors: [{ message: 'must be an object', path: 'anchors' }], warnings: [] };\n }\n\n const dimensions = checkAnchorGroup(\n value,\n 'dimensions',\n REQUIRED_DIMENSION_ANCHORS,\n 'dimension anchor',\n );\n const colors = checkAnchorGroup(value, 'colors', COLOR_ANCHOR_NAMES, 'color anchor');\n const fonts = checkAnchorGroup(value, 'fonts', REQUIRED_FONT_ANCHORS, 'font anchor');\n\n const colorReport: StyleDocumentReport =\n colors.members === undefined\n ? { errors: [], warnings: [] }\n : checkColorAnchors(colors.members, collected);\n\n return {\n errors: [\n ...checkNoUnknownKeys(value, ANCHOR_GROUPS, 'anchors', 'anchor group'),\n ...dimensions.issues,\n ...(dimensions.members === undefined ? [] : checkDimensionAnchors(dimensions.members)),\n ...colors.issues,\n ...colorReport.errors,\n ...fonts.issues,\n ...(fonts.members === undefined ? [] : checkFontAnchors(fonts.members)),\n ],\n warnings: colorReport.warnings,\n };\n};\n","import type { SurfaceName } from '../styleVocabulary';\nimport type { Collected, StyleDocumentIssue } from './issues';\nimport { at, isOneOf, isRecord } from '../private/guards';\nimport {\n INVERT_RULES,\n MAX_COLOR_SCALE_OFFSET,\n OFFSET_ORIGINS,\n STACKABLE_ON,\n} from '../styleVocabulary';\nimport { isScaleOffset, singleColorAnchorFromRef, singleColorRefList } from './anchorValues';\nimport { checkNoUnknownKeys, list } from './issues';\n\n/**\n * A surface's fill: an anchor, or `parent` on a surface that sits on something.\n * Since a `flat` surface with an offset of `parent: 0` is essentially transparent,\n * we reject that syntax in favor of `treatment: \"none\"` — unless it inverts\n * `when-indistinct`, which always fires at that offset and paints the text color instead.\n */\nexport const checkBackgroundColor = (\n value: unknown,\n path: string,\n surface: SurfaceName,\n treatment: unknown,\n collected: Collected,\n): readonly StyleDocumentIssue[] => {\n if (!isRecord(value)) {\n return [{ message: 'must be an object', path }];\n }\n\n const issues: StyleDocumentIssue[] = [\n ...checkNoUnknownKeys(\n value,\n ['source', 'offset', 'from', 'invert'],\n path,\n 'backgroundColor key',\n ),\n ];\n\n const from = at(value, 'from');\n if (!isOneOf(OFFSET_ORIGINS, from)) {\n issues.push({ message: `from must be one of: ${list(OFFSET_ORIGINS)}`, path: `${path}.from` });\n } else if (from === 'parent' && STACKABLE_ON[surface].length === 0) {\n issues.push({\n message: `\"parent\" needs a surface to count from, and ${surface} sits on nothing — use \"source\"`,\n path: `${path}.from`,\n });\n }\n\n const invert = at(value, 'invert');\n if (!isOneOf(INVERT_RULES, invert)) {\n issues.push({\n message: `invert must be one of: ${list(INVERT_RULES)}`,\n path: `${path}.invert`,\n });\n } else if (invert === 'when-indistinct' && STACKABLE_ON[surface].length === 0) {\n issues.push({\n message: `\"when-indistinct\" compares a fill with what it sits on, and ${surface} sits on nothing — use \"never\"`,\n path: `${path}.invert`,\n });\n } else if (invert === 'when-indistinct' && treatment !== 'flat') {\n issues.push({\n message: 'only a flat fill can trade places with its text — use \"never\", or treatment \"flat\"',\n path: `${path}.invert`,\n });\n }\n\n const source = at(value, 'source');\n const offset = at(value, 'offset');\n const offsetIsValid = isScaleOffset(offset);\n\n if (source === 'parent') {\n if (STACKABLE_ON[surface].length === 0) {\n issues.push({\n message: `\"parent\" needs a surface to sit on, and ${surface} sits on nothing — use an anchor`,\n path: `${path}.source`,\n });\n } else if (treatment === 'flat' && invert === 'never' && offsetIsValid && offset === 0) {\n issues.push({\n message: `a flat surface at parent · 0 paints exactly its parent's fill and cannot be seen — step at least 1, invert \"when-indistinct\" to trade places with its text, or use treatment \"none\" to paint nothing`,\n path: `${path}.offset`,\n });\n }\n } else {\n const anchor = singleColorAnchorFromRef(source);\n if (anchor === undefined) {\n issues.push({\n message: `source must be \"parent\" or one of: ${singleColorRefList()}`,\n path: `${path}.source`,\n });\n } else {\n collected.referenced.add(anchor);\n }\n }\n\n if (!offsetIsValid) {\n issues.push({\n message: `offset must be an integer 0-${MAX_COLOR_SCALE_OFFSET}`,\n path: `${path}.offset`,\n });\n }\n\n return issues;\n};\n","import type { SurfaceName } from '../styleVocabulary';\nimport type { Collected, StyleDocumentIssue } from './issues';\nimport { at, isOneOf, isRecord } from '../private/guards';\nimport { BORDER_STYLES, MAX_COLOR_SCALE_OFFSET, STACKABLE_ON } from '../styleVocabulary';\nimport { isScaleOffset, singleColorAnchorFromRef, singleColorRefList } from './anchorValues';\nimport { checkNoUnknownKeys, list } from './issues';\n\nexport const checkBorder = (\n value: Readonly<Record<string, unknown>>,\n surfacePath: string,\n surface: SurfaceName,\n treatment: unknown,\n collected: Collected,\n): readonly StyleDocumentIssue[] => {\n const path = `${surfacePath}.border`;\n const declared = Object.hasOwn(value, 'border');\n\n if (STACKABLE_ON[surface].length === 0) {\n return declared\n ? [\n {\n message: `${surface} sits on nothing and has no edge of its own, so it carries no border`,\n path,\n },\n ]\n : [];\n }\n\n if (!declared) {\n return [\n {\n message: 'every surface with an edge of its own declares a border, even one of width 0',\n path,\n },\n ];\n }\n\n const border = at(value, 'border');\n\n if (!isRecord(border)) {\n return [{ message: 'must be an object', path }];\n }\n\n const issues: StyleDocumentIssue[] = [\n ...checkNoUnknownKeys(border, ['width', 'source', 'offset', 'style'], path, 'border key'),\n ];\n\n const style = at(border, 'style');\n if (!isOneOf(BORDER_STYLES, style)) {\n issues.push({ message: `style must be one of: ${list(BORDER_STYLES)}`, path: `${path}.style` });\n } else if (style === 'scalloped' && treatment === 'none') {\n issues.push({\n message:\n 'scallops are drawn in the surface\\'s own fill, and treatment \"none\" paints none — give the surface a fill, or use \"lace\"',\n path: `${path}.style`,\n });\n }\n\n const width = at(border, 'width');\n if (typeof width !== 'number' || !Number.isFinite(width) || width < 0) {\n issues.push({\n message: 'width must be a non-negative number of pixels, e.g. 1 or 0.5 (0 for none)',\n path: `${path}.width`,\n });\n }\n\n const borderSource = at(border, 'source');\n const borderAnchor = singleColorAnchorFromRef(borderSource);\n if (borderAnchor !== undefined) {\n collected.referenced.add(borderAnchor);\n } else if (borderSource !== 'surface') {\n issues.push({\n message: `source must be \"surface\" or one of: ${singleColorRefList()}`,\n path: `${path}.source`,\n });\n }\n\n if (!isScaleOffset(at(border, 'offset'))) {\n issues.push({\n message: `offset must be an integer 0-${MAX_COLOR_SCALE_OFFSET}`,\n path: `${path}.offset`,\n });\n }\n\n return issues;\n};\n","import type { Collected, StyleDocumentIssue } from './issues';\nimport { at, isOneOf, isRecord } from '../private/guards';\nimport {\n ELEVATION_COLOR_SOURCE_KEYWORDS,\n ELEVATION_DEPTHS,\n ELEVATION_HARDNESSES,\n} from '../styleVocabulary';\nimport { isColorForm, singleColorAnchorFromRef, singleColorRefList } from './anchorValues';\nimport { checkNoUnknownKeys, list } from './issues';\n\nexport const checkElevation = (\n value: unknown,\n path: string,\n collected: Collected,\n): readonly StyleDocumentIssue[] => {\n if (!isRecord(value)) {\n return [{ message: 'must be an object', path }];\n }\n\n const issues: StyleDocumentIssue[] = [\n ...checkNoUnknownKeys(value, ['depth', 'hardness', 'source'], path, 'elevation key'),\n ];\n\n if (!isOneOf(ELEVATION_DEPTHS, at(value, 'depth'))) {\n issues.push({\n message: `depth must be one of: ${list(ELEVATION_DEPTHS)}`,\n path: `${path}.depth`,\n });\n }\n\n if (!isOneOf(ELEVATION_HARDNESSES, at(value, 'hardness'))) {\n issues.push({\n message: `hardness must be one of: ${list(ELEVATION_HARDNESSES)}`,\n path: `${path}.hardness`,\n });\n }\n\n const elevationSource = at(value, 'source');\n const elevationAnchor = singleColorAnchorFromRef(elevationSource);\n if (elevationAnchor !== undefined) {\n collected.referenced.add(elevationAnchor);\n } else if (\n !isOneOf(ELEVATION_COLOR_SOURCE_KEYWORDS, elevationSource) &&\n !isColorForm(elevationSource)\n ) {\n issues.push({\n message: `source must be one of: ${list(ELEVATION_COLOR_SOURCE_KEYWORDS)}, ${singleColorRefList()}, or a color — a hex or rgb() literal, a token reference like \"$primaryColor\", or { from, relation, tone }`,\n path: `${path}.source`,\n });\n }\n\n return issues;\n};\n","import type { GradientShapeOption } from '../styleVocabulary';\nimport type { StyleDocumentIssue } from './issues';\nimport { at, isOneOf, isRecord } from '../private/guards';\nimport {\n GRADIENT_DIRECTIONS,\n GRADIENT_EXTENTS,\n GRADIENT_POSITIONS,\n GRADIENT_SHAPE_OPTIONS,\n} from '../styleVocabulary';\nimport { checkGradientStops } from './anchors';\nimport { checkNoUnknownKeys, list } from './issues';\n\n/** Every key a gradientShape may carry, and which kinds each option belongs to. */\nconst GRADIENT_SHAPE_KEYS = ['kind', 'direction', 'position', 'extent', 'stops'] as const;\nconst KIND_SPECIFIC_KEYS: readonly (readonly [\n key: string,\n kinds: readonly GradientShapeOption[],\n allowed: readonly string[],\n])[] = [\n ['direction', ['linear'], GRADIENT_DIRECTIONS],\n ['position', ['radial'], GRADIENT_POSITIONS],\n ['extent', ['radial'], GRADIENT_EXTENTS],\n];\n\n/** A gradient surface with its own stops draws them in place of `anchors.colors.gradientStops`. */\nexport const hasOwnGradientStops = (value: Record<string, unknown>): boolean => {\n const shape = at(value, 'gradientShape');\n\n return isRecord(shape) && Object.hasOwn(shape, 'stops');\n};\n\n/**\n * `gradientShape` is the one setting a surface carries conditionally: required when the treatment\n * is `gradient`, absent otherwise. Naming a shape on a surface that paints no gradient is an error\n * rather than a line that silently does nothing — the same reason unknown keys are caught.\n */\nexport const checkGradientShape = (\n value: Record<string, unknown>,\n path: string,\n treatment: unknown,\n): readonly StyleDocumentIssue[] => {\n const declared = Object.hasOwn(value, 'gradientShape');\n\n if (treatment !== 'gradient') {\n return declared\n ? [\n {\n message: 'only a surface with treatment \"gradient\" carries a gradientShape',\n path: `${path}.gradientShape`,\n },\n ]\n : [];\n }\n\n if (!declared) {\n return [\n {\n message: `a gradient surface must name its shape: ${list(GRADIENT_SHAPE_OPTIONS)}`,\n path: `${path}.gradientShape`,\n },\n ];\n }\n\n const shape = at(value, 'gradientShape');\n const shapePath = `${path}.gradientShape`;\n\n if (!isRecord(shape)) {\n return [{ message: 'must be an object', path: shapePath }];\n }\n\n const issues: StyleDocumentIssue[] = [\n ...checkNoUnknownKeys(shape, GRADIENT_SHAPE_KEYS, shapePath, 'setting'),\n ...(Object.hasOwn(shape, 'stops')\n ? checkGradientStops(at(shape, 'stops'), `${shapePath}.stops`)\n : []),\n ];\n\n const kind = at(shape, 'kind');\n\n if (!isOneOf(GRADIENT_SHAPE_OPTIONS, kind)) {\n issues.push({\n message: `kind must be one of: ${list(GRADIENT_SHAPE_OPTIONS)}`,\n path: `${shapePath}.kind`,\n });\n\n return issues;\n }\n\n /**\n * Each arrangement carries exactly what it needs to be drawn and nothing else, so a direction on\n * a radial gradient is an error rather than a line the engine quietly ignores.\n */\n for (const [key, kinds, allowed] of KIND_SPECIFIC_KEYS) {\n const wanted = kinds.includes(kind);\n const present = Object.hasOwn(shape, key);\n\n if (wanted && !present) {\n issues.push({\n message: `a ${kind} gradient must name its ${key}: ${list(allowed)}`,\n path: `${shapePath}.${key}`,\n });\n } else if (!wanted && present) {\n issues.push({\n message: `only a ${list(kinds)} gradient carries a ${key}`,\n path: `${shapePath}.${key}`,\n });\n } else if (wanted && !isOneOf(allowed, at(shape, key))) {\n issues.push({\n message: `${key} must be one of: ${list(allowed)}`,\n path: `${shapePath}.${key}`,\n });\n }\n }\n\n return issues;\n};\n","import type { Collected, StyleDocumentIssue } from './issues';\nimport { at, isOneOf, isRecord } from '../private/guards';\nimport { AMBIENT_MOTIONS, MOTION_SPEEDS, PULSE_SIZES, TRANSITIONS } from '../styleVocabulary';\nimport { COLOR_FORM_MESSAGE, isColorForm, singleColorAnchorFromRef } from './anchorValues';\nimport { checkNoUnknownKeys, list } from './issues';\n\n/** `pulseColor` is carried conditionally: required on a pulse, and meaningless on anything else. */\nconst checkPulseColor = (\n value: Readonly<Record<string, unknown>>,\n path: string,\n collected: Collected,\n): readonly StyleDocumentIssue[] => {\n const pulseColor = at(value, 'pulseColor');\n const pulseColorPath = `${path}.pulseColor`;\n\n if (at(value, 'ambient') !== 'pulse') {\n return pulseColor === undefined\n ? []\n : [\n {\n message: 'only a surface with ambient \"pulse\" carries a pulseColor',\n path: pulseColorPath,\n },\n ];\n }\n\n if (pulseColor === undefined) {\n return [{ message: 'a surface with ambient \"pulse\" needs a pulseColor', path: pulseColorPath }];\n }\n\n if (pulseColor === 'derive') {\n return [];\n }\n\n const anchor = singleColorAnchorFromRef(pulseColor);\n\n if (anchor !== undefined) {\n collected.referenced.add(anchor);\n\n return [];\n }\n\n return isColorForm(pulseColor)\n ? []\n : [{ message: `must be \"derive\" or ${COLOR_FORM_MESSAGE}`, path: pulseColorPath }];\n};\n\n/** `pulseSize` is carried the same way as `pulseColor`. */\nconst checkPulseSize = (\n value: Readonly<Record<string, unknown>>,\n path: string,\n): readonly StyleDocumentIssue[] => {\n const pulseSize = at(value, 'pulseSize');\n const pulseSizePath = `${path}.pulseSize`;\n\n if (at(value, 'ambient') !== 'pulse') {\n return pulseSize === undefined\n ? []\n : [\n {\n message: 'only a surface with ambient \"pulse\" carries a pulseSize',\n path: pulseSizePath,\n },\n ];\n }\n\n return isOneOf(PULSE_SIZES, pulseSize)\n ? []\n : [{ message: `pulseSize must be one of: ${list(PULSE_SIZES)}`, path: pulseSizePath }];\n};\n\nexport const checkMotion = (\n value: unknown,\n path: string,\n collected: Collected,\n): readonly StyleDocumentIssue[] => {\n if (!isRecord(value)) {\n return [{ message: 'must be an object', path }];\n }\n\n const issues: StyleDocumentIssue[] = [\n ...checkNoUnknownKeys(\n value,\n ['ambient', 'speed', 'transition', 'pulseColor', 'pulseSize'],\n path,\n 'motion key',\n ),\n ...checkPulseColor(value, path, collected),\n ...checkPulseSize(value, path),\n ];\n\n if (!isOneOf(AMBIENT_MOTIONS, at(value, 'ambient'))) {\n issues.push({\n message: `ambient must be one of: ${list(AMBIENT_MOTIONS)}`,\n path: `${path}.ambient`,\n });\n }\n if (!isOneOf(MOTION_SPEEDS, at(value, 'speed'))) {\n issues.push({\n message: `speed must be one of: ${list(MOTION_SPEEDS)}`,\n path: `${path}.speed`,\n });\n }\n if (!isOneOf(TRANSITIONS, at(value, 'transition'))) {\n issues.push({\n message: `transition must be one of: ${list(TRANSITIONS)}`,\n path: `${path}.transition`,\n });\n }\n\n return issues;\n};\n","import type { StyleDocumentIssue } from './issues';\nimport { at, isRecord } from '../private/guards';\nimport { ANCHOR_REF_PREFIX } from '../styleVocabulary';\nimport { isDimension } from './anchorValues';\nimport { checkNoUnknownKeys } from './issues';\n\nconst BORDER_RADIUS_REF = `${ANCHOR_REF_PREFIX}dimensions.borderRadius`;\n\n/** Only the border-radius anchor: any other length, such as a spacing value, is not a radius. */\nconst isRadiusSource = (value: unknown): boolean =>\n value === BORDER_RADIUS_REF || isDimension(value);\n\nexport const checkRadius = (value: unknown, path: string): readonly StyleDocumentIssue[] => {\n if (!isRecord(value)) {\n return [{ message: 'must be an object', path }];\n }\n\n const issues: StyleDocumentIssue[] = [\n ...checkNoUnknownKeys(value, ['source'], path, 'radius key'),\n ];\n\n if (!isRadiusSource(at(value, 'source'))) {\n issues.push({\n message: `source must be \"${BORDER_RADIUS_REF}\", a token reference, or a number of pixels`,\n path: `${path}.source`,\n });\n }\n\n return issues;\n};\n","import type { Collected, StyleDocumentIssue } from './issues';\nimport { at, isRecord } from '../private/guards';\nimport { MAX_COLOR_SCALE_OFFSET } from '../styleVocabulary';\nimport {\n isColorForm,\n isScaleOffset,\n singleColorAnchorFromRef,\n singleColorRefList,\n} from './anchorValues';\nimport { checkNoUnknownKeys } from './issues';\n\nexport const checkTextColor = (\n value: unknown,\n path: string,\n collected: Collected,\n): readonly StyleDocumentIssue[] => {\n const anchor = singleColorAnchorFromRef(value);\n if (anchor !== undefined) {\n collected.referenced.add(anchor);\n return [];\n }\n if (value === 'derive' || isColorForm(value)) {\n return [];\n }\n if (!isRecord(value) || Object.hasOwn(value, 'from')) {\n return [\n {\n message: `textColor must be \"derive\", { source, offset }, one of: ${singleColorRefList()}, or a color — a hex or rgb() literal, a token reference like \"$primaryColor\", or { from, relation, tone }`,\n path,\n },\n ];\n }\n\n const issues: StyleDocumentIssue[] = [\n ...checkNoUnknownKeys(value, ['source', 'offset'], path, 'textColor key'),\n ];\n\n const source = singleColorAnchorFromRef(at(value, 'source'));\n if (source === undefined) {\n issues.push({\n message: `source must be one of: ${singleColorRefList()}`,\n path: `${path}.source`,\n });\n } else {\n collected.referenced.add(source);\n }\n\n if (!isScaleOffset(at(value, 'offset'))) {\n issues.push({\n message: `offset must be an integer 0-${MAX_COLOR_SCALE_OFFSET}`,\n path: `${path}.offset`,\n });\n }\n\n return issues;\n};\n","import type { StyleDocumentIssue } from './issues';\nimport { at, isOneOf, isRecord } from '../private/guards';\nimport { TEXTURE_INTENSITIES, TEXTURE_KINDS } from '../styleVocabulary';\nimport { checkNoUnknownKeys, list } from './issues';\n\n/**\n * A named texture at a named intensity. A surface that paints nothing has no fill to lay a\n * texture over, so `treatment: \"none\"` requires `kind: \"none\"`.\n */\nexport const checkTexture = (\n value: unknown,\n path: string,\n treatment: unknown,\n): readonly StyleDocumentIssue[] => {\n if (!isRecord(value)) {\n return [{ message: 'must be an object', path }];\n }\n\n const issues: StyleDocumentIssue[] = [\n ...checkNoUnknownKeys(value, ['kind', 'intensity'], path, 'texture key'),\n ];\n\n const kind = at(value, 'kind');\n if (!isOneOf(TEXTURE_KINDS, kind)) {\n issues.push({ message: `kind must be one of: ${list(TEXTURE_KINDS)}`, path: `${path}.kind` });\n } else if (treatment === 'none' && kind !== 'none') {\n issues.push({\n message:\n 'a surface with treatment \"none\" paints no fill to texture — use kind \"none\", or give the surface a fill',\n path: `${path}.kind`,\n });\n }\n\n if (!isOneOf(TEXTURE_INTENSITIES, at(value, 'intensity'))) {\n issues.push({\n message: `intensity must be one of: ${list(TEXTURE_INTENSITIES)}`,\n path: `${path}.intensity`,\n });\n }\n\n return issues;\n};\n","import type { SurfaceName } from '../styleVocabulary';\nimport type { Collected, StyleDocumentIssue } from './issues';\nimport { at, isOneOf, isRecord } from '../private/guards';\nimport { ALL_SETTING_NAMES, SURFACE_NAMES, TREATMENTS } from '../styleVocabulary';\nimport { checkBackgroundColor } from './backgroundColor';\nimport { checkBorder } from './border';\nimport { checkElevation } from './elevation';\nimport { checkGradientShape, hasOwnGradientStops } from './gradientShape';\nimport { checkNoUnknownKeys, list } from './issues';\nimport { checkMotion } from './motion';\nimport { checkRadius } from './radius';\nimport { checkTextColor } from './textColor';\nimport { checkTexture } from './texture';\n\nconst checkSurface = (\n value: unknown,\n name: SurfaceName,\n collected: Collected,\n): readonly StyleDocumentIssue[] => {\n const path = `surfaces.${name}`;\n\n if (!isRecord(value)) {\n return [{ message: 'must be an object', path }];\n }\n\n const treatment = at(value, 'treatment');\n const namedTreatment = isOneOf(TREATMENTS, treatment);\n\n // A gradient with its own stops doesn't need the Style's, so it doesn't count toward the anchor.\n if (namedTreatment && !(treatment === 'gradient' && hasOwnGradientStops(value))) {\n collected.treatments.add(treatment);\n }\n\n return [\n ...checkNoUnknownKeys(value, ALL_SETTING_NAMES, path, 'setting'),\n ...(namedTreatment\n ? []\n : [\n {\n message: `treatment must be one of: ${list(TREATMENTS)}`,\n path: `${path}.treatment`,\n },\n ]),\n ...checkGradientShape(value, path, treatment),\n ...checkBackgroundColor(\n at(value, 'backgroundColor'),\n `${path}.backgroundColor`,\n name,\n treatment,\n collected,\n ),\n ...checkTextColor(at(value, 'textColor'), `${path}.textColor`, collected),\n ...checkBorder(value, path, name, treatment, collected),\n ...checkElevation(at(value, 'elevation'), `${path}.elevation`, collected),\n ...checkRadius(at(value, 'radius'), `${path}.radius`),\n ...checkTexture(at(value, 'texture'), `${path}.texture`, treatment),\n ...checkMotion(at(value, 'motion'), `${path}.motion`, collected),\n ];\n};\n\nexport const checkSurfaces = (\n value: unknown,\n collected: Collected,\n): readonly StyleDocumentIssue[] => {\n if (!isRecord(value)) {\n return [{ message: 'must be an object', path: 'surfaces' }];\n }\n\n const unknown = Object.keys(value)\n .filter((key) => !isOneOf(SURFACE_NAMES, key))\n .map((key) => ({\n message: `unknown surface — the set is fixed: ${list(SURFACE_NAMES)}`,\n path: `surfaces.${key}`,\n }));\n\n return [\n ...unknown,\n ...SURFACE_NAMES.flatMap((name) => {\n const surface = at(value, name);\n\n return surface === undefined\n ? [{ message: 'every Style must define every surface', path: `surfaces.${name}` }]\n : checkSurface(surface, name, collected);\n }),\n ];\n};\n","import type { StyleDocumentIssue } from './issues';\nimport { at, isOneOf, isRecord, isString } from '../private/guards';\nimport {\n ANCHOR_REF_PREFIX,\n REQUIRED_FONT_ANCHORS,\n TYPE_CASES,\n TYPE_ROLES,\n} from '../styleVocabulary';\nimport { checkNoUnknownKeys, list } from './issues';\n\nconst FONT_REF_PREFIX = `${ANCHOR_REF_PREFIX}fonts.`;\n\nconst fontRefList = (): string =>\n list(REQUIRED_FONT_ANCHORS.map((name) => `${FONT_REF_PREFIX}${name}`));\n\nconst isFontAnchorRef = (value: unknown): boolean =>\n isString(value) &&\n value.startsWith(FONT_REF_PREFIX) &&\n isOneOf(REQUIRED_FONT_ANCHORS, value.slice(FONT_REF_PREFIX.length));\n\nconst checkTypeRole = (value: unknown, path: string): readonly StyleDocumentIssue[] => {\n if (!isRecord(value)) {\n return [{ message: 'must be an object', path }];\n }\n\n const issues: StyleDocumentIssue[] = [\n ...checkNoUnknownKeys(value, ['font', 'fontSize', 'case', 'fontWeight'], path, 'type key'),\n ];\n\n if (!isFontAnchorRef(at(value, 'font'))) {\n issues.push({ message: `font must be one of: ${fontRefList()}`, path: `${path}.font` });\n }\n const fontSize = at(value, 'fontSize');\n if (typeof fontSize !== 'number' || !Number.isFinite(fontSize) || fontSize <= 0) {\n issues.push({\n message: 'fontSize must be a positive number of pixels, e.g. 16',\n path: `${path}.fontSize`,\n });\n }\n if (!isOneOf(TYPE_CASES, at(value, 'case'))) {\n issues.push({ message: `case must be one of: ${list(TYPE_CASES)}`, path: `${path}.case` });\n }\n const fontWeight = at(value, 'fontWeight');\n if (\n typeof fontWeight !== 'number' ||\n !Number.isFinite(fontWeight) ||\n fontWeight < 1 ||\n fontWeight > 1000\n ) {\n issues.push({\n message: 'fontWeight must be a CSS weight from 1 to 1000, e.g. 400 or 700',\n path: `${path}.fontWeight`,\n });\n }\n\n return issues;\n};\n\nexport const checkTypography = (value: unknown): readonly StyleDocumentIssue[] => {\n if (!isRecord(value)) {\n return [{ message: 'must be an object', path: 'typography' }];\n }\n\n return [\n ...checkNoUnknownKeys(value, TYPE_ROLES, 'typography', 'type role'),\n ...TYPE_ROLES.flatMap((role) => checkTypeRole(at(value, role), `typography.${role}`)),\n ];\n};\n","import type { StyleDocument } from '../styleVocabulary';\nimport type { Collected, StyleDocumentIssue, StyleDocumentReport } from './issues';\nimport { at, isRecord, isString } from '../private/guards';\nimport { ID_PATTERN } from '../private/styleDocumentPatterns';\nimport { DOCUMENT_KEYS } from '../styleVocabulary';\nimport { checkAnchors } from './anchors';\nimport { checkNoUnknownKeys } from './issues';\nimport { checkSurfaces } from './surfaces';\nimport { checkTypography } from './typography';\n\n/**\n * Structural validation for a Style document, based on the schema.\n *\n * @param input a parsed Style document, of unknown shape\n * @returns every problem found, split into errors, which make the document invalid, and\n * warnings, which do not\n *\n * @example\n * ```ts\n * const { errors, warnings } = checkStyleDocument(doc);\n * for (const { path, message } of warnings) {\n * console.warn(`${path}: ${message}`);\n * }\n * if (errors.length > 0) {\n * throw new Error(errors.map(({ path, message }) => `${path}: ${message}`).join('\\n'));\n * }\n * ```\n */\nexport const checkStyleDocument = (input: unknown): StyleDocumentReport => {\n if (!isRecord(input)) {\n return { errors: [{ message: 'a Style document must be an object', path: '' }], warnings: [] };\n }\n\n const issues: StyleDocumentIssue[] = [...checkNoUnknownKeys(input, DOCUMENT_KEYS, '', 'key')];\n const collected: Collected = { referenced: new Set(), treatments: new Set() };\n\n const id = at(input, 'id');\n if (!isString(id) || !ID_PATTERN.test(id)) {\n issues.push({ message: 'id must be lowercase kebab-case, e.g. \"glass-dark\"', path: 'id' });\n }\n\n const name = at(input, 'name');\n if (!isString(name) || name.length === 0) {\n issues.push({ message: 'name is required', path: 'name' });\n }\n\n if (at(input, 'schemaVersion') !== 1) {\n issues.push({ message: 'schemaVersion must be 1', path: 'schemaVersion' });\n }\n\n const surfaceIssues = [\n ...checkTypography(at(input, 'typography')),\n ...checkSurfaces(at(input, 'surfaces'), collected),\n ];\n\n // checkSurfaces fills `collected`, which anchor completeness reads, so anchors run last.\n const anchors = checkAnchors(at(input, 'anchors'), collected);\n\n issues.push(...surfaceIssues, ...anchors.errors);\n\n return { errors: issues, warnings: anchors.warnings };\n};\n\n/**\n * What makes a document invalid, and nothing else.\n *\n * Empty means the document is safe to render, so a caller can drop a document on a non-empty\n * result without reading it — the reason warnings are a separate channel rather than entries\n * here with a severity on them. Nothing inert should ever cost a customer their Style.\n *\n * @example\n * ```ts\n * const issues = validateStyleDocument(doc);\n * if (issues.length > 0) {\n * throw new Error(issues.map(({ path, message }) => `${path}: ${message}`).join('\\n'));\n * }\n * ```\n */\nexport const validateStyleDocument = (input: unknown): readonly StyleDocumentIssue[] =>\n checkStyleDocument(input).errors;\n\n/** Whether a value is a valid Style document. */\nexport const isStyleDocument = (input: unknown): input is StyleDocument =>\n validateStyleDocument(input).length === 0;\n"],"mappings":";;;;;;;;;;;;;AAMA,MAAa,aAAqB;;AAGlC,MAAa,gBAAwB;AAErC,MAAM,YAAY,OAAO,GAAG;;AAG5B,MAAM,YAAY,OAAO,GAAG;;;;;;;;;AAU5B,MAAM,YAAY,OAAO,GAAG,gBAAgB,UAAU,SAAS,UAAU,SAAS,UAAU,YAAY,UAAU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,UAAU,QAAQ;CAAS;AACtD;;;;;;;;;;;;;;;;AAiBA,MAAa,yBAAyB,UACpC,mBAAmB,KAAK,CAAC,CAAC;;AAG5B,MAAa,mBAAmB,UAC9B,sBAAsB,KAAK,CAAC,CAAC,WAAW"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wistia/kaleidoscope",
3
- "version": "0.0.7",
3
+ "version": "0.0.8",
4
4
  "description": "Shared logic and token engine for Wistia's audience-facing design system",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",
@@ -58,10 +58,10 @@
58
58
  },
59
59
  "devDependencies": {
60
60
  "@repo/config": "0.0.0",
61
- "@storybook/addon-a11y": "^10.6.2",
62
- "@storybook/addon-docs": "^10.6.2",
63
- "@storybook/react-vite": "^10.6.2",
64
- "@types/node": "^26.6.5",
61
+ "@storybook/addon-a11y": "^10.6.5",
62
+ "@storybook/addon-docs": "^10.6.5",
63
+ "@storybook/react-vite": "^10.6.5",
64
+ "@types/node": "^26.6.6",
65
65
  "@types/react": "^19.3.0",
66
66
  "@types/react-dom": "^19.3.0",
67
67
  "@typescript/native": "npm:typescript@7.1.0-beta",
@@ -72,10 +72,10 @@
72
72
  "react": "^19.3.1",
73
73
  "react-dom": "^19.3.1",
74
74
  "shx": "^0.4.0",
75
- "storybook": "^10.6.2",
75
+ "storybook": "^10.6.5",
76
76
  "styled-components": "^6.6.0",
77
77
  "tsx": "^4.23.15",
78
- "vite": "^8.3.4",
78
+ "vite": "^8.3.5",
79
79
  "vite-plus": "^1.4.0",
80
80
  "vitest": "5.0.5"
81
81
  },