@wistia/kaleidoscope 0.0.5 → 0.0.6

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 (59) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/color-BY2NrNVz.js +148 -0
  3. package/dist/color-BY2NrNVz.js.map +1 -0
  4. package/dist/{color-BD12TVX4.d.ts → color-CwLKMi6Y.d.ts} +4 -25
  5. package/dist/color-CwLKMi6Y.d.ts.map +1 -0
  6. package/dist/engine-B00ZVZ0d.d.ts +85 -0
  7. package/dist/engine-B00ZVZ0d.d.ts.map +1 -0
  8. package/dist/engine-DeOUPRa0.js +661 -0
  9. package/dist/engine-DeOUPRa0.js.map +1 -0
  10. package/dist/entries/color.d.ts +1 -1
  11. package/dist/entries/color.js +3 -2
  12. package/dist/entries/engine.d.ts +3 -0
  13. package/dist/entries/engine.js +10 -0
  14. package/dist/entries/styleRegistry.d.ts +2 -2
  15. package/dist/entries/styleRegistry.js +2 -3
  16. package/dist/entries/validate.d.ts +1 -1
  17. package/dist/entries/validate.js +2 -3
  18. package/dist/entries/vocabulary.d.ts +1 -1
  19. package/dist/entries/vocabulary.js +3 -2
  20. package/dist/{color-C99gJSgH.js → getColorLightnessClassification--FSkjXEx.js} +29 -178
  21. package/dist/getColorLightnessClassification--FSkjXEx.js.map +1 -0
  22. package/dist/guards-t_cf_IOV.js +24 -0
  23. package/dist/guards-t_cf_IOV.js.map +1 -0
  24. package/dist/{index-CG6dL9XZ.d.ts → index-BOJCY_MU.d.ts} +4 -32
  25. package/dist/index-BOJCY_MU.d.ts.map +1 -0
  26. package/dist/index.d.ts +6 -5
  27. package/dist/index.js +9 -6
  28. package/dist/styleRegistry-A0nrsHk-.d.ts +15 -0
  29. package/dist/styleRegistry-A0nrsHk-.d.ts.map +1 -0
  30. package/dist/{styleRegistry-BoviV8Ue.js → styleRegistry-CT4jvu4h.js} +41 -42
  31. package/dist/styleRegistry-CT4jvu4h.js.map +1 -0
  32. package/dist/{styleVocabulary-Kl8p6TDk.js → styleVocabulary-DcxbkEvK.js} +19 -80
  33. package/dist/styleVocabulary-DcxbkEvK.js.map +1 -0
  34. package/dist/typography-BA9Pz8Im.js +65 -0
  35. package/dist/typography-BA9Pz8Im.js.map +1 -0
  36. package/dist/{validate-V28YRNxt.d.ts → validate-Bqx__f3d.d.ts} +2 -6
  37. package/dist/validate-Bqx__f3d.d.ts.map +1 -0
  38. package/dist/{validate-C_h6gEXp.js → validate-D-OR7_3g.js} +20 -46
  39. package/dist/validate-D-OR7_3g.js.map +1 -0
  40. package/package.json +19 -14
  41. package/schema/style-v1.json +7 -2
  42. package/styles/aurora-dark.json +3 -2
  43. package/styles/aurora-light.json +3 -2
  44. package/styles/glass-dark.json +3 -2
  45. package/styles/glass-light.json +3 -2
  46. package/styles/opaque-bright.json +3 -2
  47. package/styles/opaque-heavy.json +3 -2
  48. package/styles/opaque-light.json +3 -2
  49. package/styles/opaque-medium.json +3 -2
  50. package/styles/opaque-minimal.json +3 -2
  51. package/dist/color-BD12TVX4.d.ts.map +0 -1
  52. package/dist/color-C99gJSgH.js.map +0 -1
  53. package/dist/index-CG6dL9XZ.d.ts.map +0 -1
  54. package/dist/styleRegistry-BoviV8Ue.js.map +0 -1
  55. package/dist/styleRegistry-DNVNmafi.d.ts +0 -35
  56. package/dist/styleRegistry-DNVNmafi.d.ts.map +0 -1
  57. package/dist/styleVocabulary-Kl8p6TDk.js.map +0 -1
  58. package/dist/validate-C_h6gEXp.js.map +0 -1
  59. package/dist/validate-V28YRNxt.d.ts.map +0 -1
@@ -0,0 +1,65 @@
1
+
2
+ /*
3
+ * @license @wistia/kaleidoscope v0.0.6
4
+ *
5
+ * Copyright (c) 2026, Wistia, Inc. and its affiliates.
6
+ *
7
+ * This source code is unlicensed, all rights reserved.
8
+ */
9
+
10
+ // src/styleVocabulary/border.ts
11
+ const BORDER_STYLES = [
12
+ "solid",
13
+ "dashed",
14
+ "dotted",
15
+ "double",
16
+ "scalloped",
17
+ "lace"
18
+ ];
19
+ /** The border styles drawn as ornaments outside the edge, rather than as a CSS line. */
20
+ const ORNAMENTAL_BORDER_STYLES = ["scalloped", "lace"];
21
+ // src/styleVocabulary/surfaces.ts
22
+ /** Surfaces every Style must define. A Style cannot add or opt out of any. */
23
+ const SURFACE_NAMES = [
24
+ "page",
25
+ "panel",
26
+ "card",
27
+ "buttonPrimary",
28
+ "buttonSecondary"
29
+ ];
30
+ const STACKABLE_ON = {
31
+ page: [],
32
+ panel: ["page"],
33
+ card: ["page"],
34
+ buttonPrimary: [
35
+ "page",
36
+ "panel",
37
+ "card"
38
+ ],
39
+ buttonSecondary: [
40
+ "page",
41
+ "panel",
42
+ "card"
43
+ ]
44
+ };
45
+ const REQUIRED_SETTING_NAMES = [
46
+ "treatment",
47
+ "backgroundColor",
48
+ "textColor",
49
+ "elevation",
50
+ "motion",
51
+ "radius",
52
+ "texture"
53
+ ];
54
+ const OPTIONAL_SETTING_NAMES = ["border", "gradientShape"];
55
+ const ALL_SETTING_NAMES = [...REQUIRED_SETTING_NAMES, ...OPTIONAL_SETTING_NAMES];
56
+ // src/styleVocabulary/typography.ts
57
+ const TYPE_CASES = ["as-typed", "upper"];
58
+ const TYPE_ROLES = [
59
+ "heading",
60
+ "body",
61
+ "button"
62
+ ];
63
+ export { REQUIRED_SETTING_NAMES as a, BORDER_STYLES as c, OPTIONAL_SETTING_NAMES as i, ORNAMENTAL_BORDER_STYLES as l, TYPE_ROLES as n, STACKABLE_ON as o, ALL_SETTING_NAMES as r, SURFACE_NAMES as s, TYPE_CASES as t };
64
+
65
+ //# sourceMappingURL=typography-BA9Pz8Im.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typography-BA9Pz8Im.js","names":[],"sources":["../src/styleVocabulary/border.ts","../src/styleVocabulary/surfaces.ts","../src/styleVocabulary/typography.ts"],"sourcesContent":["// The `border` setting: the line along a surface's edge, and the ornaments drawn just outside it.\n\nimport type { SingleColorAnchorRef } from './anchors';\nimport type { ColorScaleOffset } from './anchorValues';\n\nexport const BORDER_STYLES = ['solid', 'dashed', 'dotted', 'double', 'scalloped', 'lace'] as const;\nexport type BorderStyle = (typeof BORDER_STYLES)[number];\n\n/** The border styles drawn as ornaments outside the edge, rather than as a CSS line. */\nexport const ORNAMENTAL_BORDER_STYLES = ['scalloped', 'lace'] as const;\n\nexport type BorderSource = SingleColorAnchorRef | 'surface';\n\n/**\n * A surface's border, expressed similarly to how CSS rules work.\n * `width` is provided in pixels, where `0` is effectively no border. Decimal values are acceptable.\n * `source` indicates whether the border color is derived based on the surface background or a separate color value.\n * `style` supports all the definitions in the schema\n * `offset` indicates how much space exists between the edge of the surface and the start of the border.\n */\nexport type Border = {\n readonly offset: ColorScaleOffset;\n readonly source: BorderSource;\n readonly style: BorderStyle;\n readonly width: number;\n};\n","import type { BackgroundColor } from './backgroundColor';\nimport type { Border } from './border';\nimport type { Elevation } from './elevation';\nimport type { GradientShape } from './gradientShape';\nimport type { Motion } from './motion';\nimport type { Radius } from './radius';\nimport type { TextColor } from './textColor';\nimport type { Texture } from './texture';\nimport type { Treatment } from './treatment';\n\n/** Surfaces every Style must define. A Style cannot add or opt out of any. */\nexport const SURFACE_NAMES = ['page', 'panel', 'card', 'buttonPrimary', 'buttonSecondary'] as const;\nexport type SurfaceName = (typeof SURFACE_NAMES)[number];\n\nexport const STACKABLE_ON: Readonly<Record<SurfaceName, readonly SurfaceName[]>> = {\n page: [],\n panel: ['page'],\n card: ['page'],\n buttonPrimary: ['page', 'panel', 'card'],\n buttonSecondary: ['page', 'panel', 'card'],\n};\n\nexport const REQUIRED_SETTING_NAMES = [\n 'treatment',\n 'backgroundColor',\n 'textColor',\n 'elevation',\n 'motion',\n 'radius',\n 'texture',\n] as const;\nexport type RequiredSettingName = (typeof REQUIRED_SETTING_NAMES)[number];\n\nexport const OPTIONAL_SETTING_NAMES = ['border', 'gradientShape'] as const;\nexport type OptionalSettingName = (typeof OPTIONAL_SETTING_NAMES)[number];\n\nexport const ALL_SETTING_NAMES: readonly (RequiredSettingName | OptionalSettingName)[] = [\n ...REQUIRED_SETTING_NAMES,\n ...OPTIONAL_SETTING_NAMES,\n];\n\nexport type RequiredSettings = {\n readonly backgroundColor: BackgroundColor;\n readonly elevation: Elevation;\n readonly motion: Motion;\n readonly radius: Radius;\n readonly textColor: TextColor;\n readonly texture: Texture;\n};\n\n/**\n * If the treatment is `gradient`, `gradientShape` is required. Otherwise it must not be present.\n */\nexport type GradientAxis =\n | { readonly gradientShape: GradientShape; readonly treatment: 'gradient' }\n | { readonly gradientShape?: never; readonly treatment: Exclude<Treatment, 'gradient'> };\n\n/** A surface that sits on something, and so has an edge of its own to draw along. */\nexport type SurfaceSettings = RequiredSettings & { readonly border: Border } & GradientAxis;\n\n/**\n * The page sits on nothing. It has no edge of its own, so it carries no `border` at all.\n */\nexport type PageSettings = RequiredSettings & { readonly border?: never } & GradientAxis;\n\n/**\n * All possible surfaces and their settings, required to be provided by a Style document.\n */\nexport type Surfaces = Readonly<{ page: PageSettings }> &\n Readonly<Record<Exclude<SurfaceName, 'page'>, SurfaceSettings>>;\n","import type { FontAnchorRef } from './anchors';\n\nexport const TYPE_CASES = ['as-typed', 'upper'] as const;\nexport type TypeCase = (typeof TYPE_CASES)[number];\n\nexport const TYPE_ROLES = ['heading', 'body', 'button'] as const;\nexport type TypeRoleName = (typeof TYPE_ROLES)[number];\n\nexport type TypeRole = {\n readonly case: TypeCase;\n readonly font: FontAnchorRef;\n readonly fontSize: number;\n readonly fontWeight: number;\n};\n\n/**\n * Rules for the type face, weight, case, and size\n *\n * `fontSize` is provided in pixels\n * `fontWeight` is a CSS weight from 1 - 1000\n * `font` references an anchor. We don't support providing a custom font name here because we don't\n * have a mechanism to load that font into the DOM.\n */\nexport type Typography = Readonly<Record<TypeRoleName, TypeRole>>;\n"],"mappings":";;;;;;;;;;AAKA,MAAa,gBAAgB;CAAC;CAAS;CAAU;CAAU;CAAU;CAAa;AAAM;;AAIxF,MAAa,2BAA2B,CAAC,aAAa,MAAM;;;ACE5D,MAAa,gBAAgB;CAAC;CAAQ;CAAS;CAAQ;CAAiB;AAAiB;AAGzF,MAAa,eAAsE;CACjF,MAAM,CAAC;CACP,OAAO,CAAC,MAAM;CACd,MAAM,CAAC,MAAM;CACb,eAAe;EAAC;EAAQ;EAAS;CAAM;CACvC,iBAAiB;EAAC;EAAQ;EAAS;CAAM;AAC3C;AAEA,MAAa,yBAAyB;CACpC;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAGA,MAAa,yBAAyB,CAAC,UAAU,eAAe;AAGhE,MAAa,oBAA4E,CACvF,GAAG,wBACH,GAAG,sBACL;;ACrCA,MAAa,aAAa,CAAC,YAAY,OAAO;AAG9C,MAAa,aAAa;CAAC;CAAW;CAAQ;AAAQ"}
@@ -1,6 +1,5 @@
1
1
 
2
- import { n as StyleDocument } from "./index-CG6dL9XZ.js";
3
- //#region src/validateStyleDocument/issues.d.ts
2
+ import { n as StyleDocument } from "./index-BOJCY_MU.js";
4
3
  /** One thing wrong with a document, addressed well enough to fix without hunting. */
5
4
  type StyleDocumentIssue = {
6
5
  readonly message: string;
@@ -16,8 +15,6 @@ type StyleDocumentReport = {
16
15
  readonly errors: readonly StyleDocumentIssue[];
17
16
  readonly warnings: readonly StyleDocumentIssue[];
18
17
  };
19
- //#endregion
20
- //#region src/validateStyleDocument/validateStyleDocument.d.ts
21
18
  /**
22
19
  * Structural validation for a Style document, based on the schema.
23
20
  *
@@ -55,6 +52,5 @@ declare const checkStyleDocument: (input: unknown) => StyleDocumentReport;
55
52
  declare const validateStyleDocument: (input: unknown) => readonly StyleDocumentIssue[];
56
53
  /** Whether a value is a valid Style document. */
57
54
  declare const isStyleDocument: (input: unknown) => input is StyleDocument;
58
- //#endregion
59
55
  export { StyleDocumentReport as a, StyleDocumentIssue as i, isStyleDocument as n, validateStyleDocument as r, checkStyleDocument as t };
60
- //# sourceMappingURL=validate-V28YRNxt.d.ts.map
56
+ //# sourceMappingURL=validate-Bqx__f3d.d.ts.map
@@ -0,0 +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,27 +1,16 @@
1
1
 
2
2
  /*
3
- * @license @wistia/kaleidoscope v0.0.5
3
+ * @license @wistia/kaleidoscope v0.0.6
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 GENERIC_FONT_FAMILIES, B as SINGLE_COLOR_ANCHOR_NAMES, C as ELEVATION_HARDNESSES, D as OFFSET_ORIGINS, E as INVERT_RULES, F as COLOR_ANCHOR_NAMES, I as OPTIONAL_COLOR_ANCHORS, L as REQUIRED_COLOR_ANCHORS, M as ANCHORS_REQUIRED_BY_TREATMENT, N as ANCHOR_GROUPS, O as COLOR_RELATIONSHIPS, P as ANCHOR_REF_PREFIX, R as REQUIRED_DIMENSION_ANCHORS, S as ELEVATION_DEPTHS, _ as GRADIENT_POSITIONS, a as TEXTURE_INTENSITIES, d as SURFACE_NAMES, f as AMBIENT_MOTIONS, g as GRADIENT_EXTENTS, h as GRADIENT_DIRECTIONS, i as TREATMENTS, k as COLOR_TONES, m as TRANSITIONS, n as TYPE_CASES, o as TEXTURE_KINDS, p as MOTION_SPEEDS, r as TYPE_ROLES, s as ALL_SETTING_NAMES, t as DOCUMENT_KEYS, u as STACKABLE_ON, v as GRADIENT_SHAPE_OPTIONS, w as BORDER_STYLES, x as ELEVATION_COLOR_SOURCE_KEYWORDS, z as REQUIRED_FONT_ANCHORS } from "./styleVocabulary-Kl8p6TDk.js";
11
- //#region src/private/guards.ts
12
- /** Narrow to a plain object without asserting a shape onto it. */
13
- const isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
14
- const isString = (value) => typeof value === "string";
15
- /**
16
- * Read a key off a record whose shape is not yet known.
17
- *
18
- * The `noPropertyAccessFromIndexSignature` lint rule requires bracket access on an index signature
19
- */
20
- const at = (record, key) => record[key];
21
- /** Whether `value` is one of `allowed`, narrowed to that tuple's member type. */
22
- const isOneOf = (allowed, value) => isString(value) && allowed.includes(value);
23
- //#endregion
24
- //#region src/private/styleDocumentPatterns.ts
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-DcxbkEvK.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-BA9Pz8Im.js";
12
+ import { i as isString, n as isOneOf, r as isRecord, t as at } from "./guards-t_cf_IOV.js";
13
+ // src/private/styleDocumentPatterns.ts
25
14
  const ID_PATTERN = /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/;
26
15
  /** No dots: brand tokens are not namespaced. */
27
16
  const TOKEN_PATTERN = /^\$[A-Za-z][A-Za-z0-9]*$/;
@@ -60,15 +49,13 @@ const FONT_FAMILY = [
60
49
  * `Georgia,, serif` renders nothing the document asked for and must not validate.
61
50
  */
62
51
  const FONT_STACK_PATTERN = new RegExp(String.raw`^(?:(?:${FONT_FAMILY})\s*,\s*)*(?:${GENERIC_FONT_FAMILIES.join("|")})\s*$`);
63
- //#endregion
64
- //#region src/validateStyleDocument/issues.ts
52
+ // src/validateStyleDocument/issues.ts
65
53
  const list = (values) => values.join(", ");
66
54
  const checkNoUnknownKeys = (value, known, path, label) => Object.keys(value).filter((key) => !known.includes(key)).map((key) => ({
67
55
  message: `unknown ${label} — the set is fixed: ${list(known)}`,
68
56
  path: path === "" ? key : `${path}.${key}`
69
57
  }));
70
- //#endregion
71
- //#region src/validateStyleDocument/anchorValues.ts
58
+ // src/validateStyleDocument/anchorValues.ts
72
59
  const COLOR_FORM_MESSAGE = "must be a hex or rgb() literal, a token reference like \"$primaryColor\", or { from, relation, tone }";
73
60
  const isTokenRef = (value) => isString(value) && TOKEN_PATTERN.test(value);
74
61
  const RELATED_COLOR_KEYS = /* @__PURE__ */ new Set([
@@ -105,8 +92,7 @@ const isScaleOffset = (value) => typeof value === "number" && Number.isInteger(v
105
92
  const isPixelValue = (value) => typeof value === "number" && Number.isFinite(value) && value >= 0;
106
93
  /** A length: a brand token or a number of CSS pixels. */
107
94
  const isDimension = (value) => isPixelValue(value) || isTokenRef(value);
108
- //#endregion
109
- //#region src/validateStyleDocument/anchors.ts
95
+ // src/validateStyleDocument/anchors.ts
110
96
  const isFontStack = (value) => isString(value) && FONT_STACK_PATTERN.test(value);
111
97
  /**
112
98
  * `gradientStops` is always a list because a gradient interpolates between colors.
@@ -240,8 +226,7 @@ const checkAnchors = (value, collected) => {
240
226
  warnings: colorReport.warnings
241
227
  };
242
228
  };
243
- //#endregion
244
- //#region src/validateStyleDocument/backgroundColor.ts
229
+ // src/validateStyleDocument/backgroundColor.ts
245
230
  /**
246
231
  * A surface's fill: an anchor, or `parent` on a surface that sits on something.
247
232
  * Since a `flat` surface with an offset of `parent: 0` is essentially transparent,
@@ -307,8 +292,7 @@ const checkBackgroundColor = (value, path, surface, treatment, collected) => {
307
292
  });
308
293
  return issues;
309
294
  };
310
- //#endregion
311
- //#region src/validateStyleDocument/border.ts
295
+ // src/validateStyleDocument/border.ts
312
296
  const checkBorder = (value, surfacePath, surface, treatment, collected) => {
313
297
  const path = `${surfacePath}.border`;
314
298
  const declared = Object.hasOwn(value, "border");
@@ -358,8 +342,7 @@ const checkBorder = (value, surfacePath, surface, treatment, collected) => {
358
342
  });
359
343
  return issues;
360
344
  };
361
- //#endregion
362
- //#region src/validateStyleDocument/elevation.ts
345
+ // src/validateStyleDocument/elevation.ts
363
346
  const checkElevation = (value, path, collected) => {
364
347
  if (!isRecord(value)) return [{
365
348
  message: "must be an object",
@@ -387,8 +370,7 @@ const checkElevation = (value, path, collected) => {
387
370
  });
388
371
  return issues;
389
372
  };
390
- //#endregion
391
- //#region src/validateStyleDocument/gradientShape.ts
373
+ // src/validateStyleDocument/gradientShape.ts
392
374
  /** Every key a gradientShape may carry, and which kinds each option belongs to. */
393
375
  const GRADIENT_SHAPE_KEYS = [
394
376
  "kind",
@@ -465,8 +447,7 @@ const checkGradientShape = (value, path, treatment) => {
465
447
  }
466
448
  return issues;
467
449
  };
468
- //#endregion
469
- //#region src/validateStyleDocument/motion.ts
450
+ // src/validateStyleDocument/motion.ts
470
451
  const checkMotion = (value, path) => {
471
452
  if (!isRecord(value)) return [{
472
453
  message: "must be an object",
@@ -491,8 +472,7 @@ const checkMotion = (value, path) => {
491
472
  });
492
473
  return issues;
493
474
  };
494
- //#endregion
495
- //#region src/validateStyleDocument/radius.ts
475
+ // src/validateStyleDocument/radius.ts
496
476
  const BORDER_RADIUS_REF = `${ANCHOR_REF_PREFIX}dimensions.borderRadius`;
497
477
  /** Only the border-radius anchor: any other length, such as a spacing value, is not a radius. */
498
478
  const isRadiusSource = (value) => value === BORDER_RADIUS_REF || isDimension(value);
@@ -508,8 +488,7 @@ const checkRadius = (value, path) => {
508
488
  });
509
489
  return issues;
510
490
  };
511
- //#endregion
512
- //#region src/validateStyleDocument/textColor.ts
491
+ // src/validateStyleDocument/textColor.ts
513
492
  const checkTextColor = (value, path, collected) => {
514
493
  const anchor = singleColorAnchorFromRef(value);
515
494
  if (anchor !== void 0) {
@@ -534,8 +513,7 @@ const checkTextColor = (value, path, collected) => {
534
513
  });
535
514
  return issues;
536
515
  };
537
- //#endregion
538
- //#region src/validateStyleDocument/texture.ts
516
+ // src/validateStyleDocument/texture.ts
539
517
  /**
540
518
  * A named texture at a named intensity. A surface that paints nothing has no fill to lay a
541
519
  * texture over, so `treatment: "none"` requires `kind: "none"`.
@@ -561,8 +539,7 @@ const checkTexture = (value, path, treatment) => {
561
539
  });
562
540
  return issues;
563
541
  };
564
- //#endregion
565
- //#region src/validateStyleDocument/surfaces.ts
542
+ // src/validateStyleDocument/surfaces.ts
566
543
  const checkSurface = (value, name, collected) => {
567
544
  const path = `surfaces.${name}`;
568
545
  if (!isRecord(value)) return [{
@@ -604,8 +581,7 @@ const checkSurfaces = (value, collected) => {
604
581
  }] : checkSurface(surface, name, collected);
605
582
  })];
606
583
  };
607
- //#endregion
608
- //#region src/validateStyleDocument/typography.ts
584
+ // src/validateStyleDocument/typography.ts
609
585
  const FONT_REF_PREFIX = `${ANCHOR_REF_PREFIX}fonts.`;
610
586
  const fontRefList = () => list(REQUIRED_FONT_ANCHORS.map((name) => `${FONT_REF_PREFIX}${name}`));
611
587
  const isFontAnchorRef = (value) => isString(value) && value.startsWith(FONT_REF_PREFIX) && isOneOf(REQUIRED_FONT_ANCHORS, value.slice(FONT_REF_PREFIX.length));
@@ -647,8 +623,7 @@ const checkTypography = (value) => {
647
623
  }];
648
624
  return [...checkNoUnknownKeys(value, TYPE_ROLES, "typography", "type role"), ...TYPE_ROLES.flatMap((role) => checkTypeRole(at(value, role), `typography.${role}`))];
649
625
  };
650
- //#endregion
651
- //#region src/validateStyleDocument/validateStyleDocument.ts
626
+ // src/validateStyleDocument/validateStyleDocument.ts
652
627
  /**
653
628
  * Structural validation for a Style document, based on the schema.
654
629
  *
@@ -720,7 +695,6 @@ const checkStyleDocument = (input) => {
720
695
  const validateStyleDocument = (input) => checkStyleDocument(input).errors;
721
696
  /** Whether a value is a valid Style document. */
722
697
  const isStyleDocument = (input) => validateStyleDocument(input).length === 0;
723
- //#endregion
724
698
  export { isStyleDocument as n, validateStyleDocument as r, checkStyleDocument as t };
725
699
 
726
- //# sourceMappingURL=validate-C_h6gEXp.js.map
700
+ //# sourceMappingURL=validate-D-OR7_3g.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate-D-OR7_3g.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 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 { LITERAL_COLOR_PATTERN, TOKEN_PATTERN } 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 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\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 { COLOR_FORM_MESSAGE, isColorForm, isDimension, isTokenRef } from './anchorValues';\nimport { checkNoUnknownKeys } from './issues';\n\nconst isFontStack = (value: unknown): boolean => isString(value) && FONT_STACK_PATTERN.test(value);\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 isColorForm(value) ? [] : [{ message: COLOR_FORM_MESSAGE, path }];\n }\n\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 isColorForm(stop) ? [] : [{ message: COLOR_FORM_MESSAGE, path: `${path}.${index}` }],\n ).flat(),\n ];\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 { 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'] 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/**\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 ];\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 { StyleDocumentIssue } from './issues';\nimport { at, isOneOf, isRecord } from '../private/guards';\nimport { AMBIENT_MOTIONS, MOTION_SPEEDS, TRANSITIONS } from '../styleVocabulary';\nimport { checkNoUnknownKeys, list } from './issues';\n\nexport const checkMotion = (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, ['ambient', 'speed', 'transition'], path, 'motion key'),\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 } 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 if (namedTreatment) {\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`),\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,KAAK,UAAU,KAAK,UAAU,KAAK,UAAU,YAAY,UAAU;AAErL,MAAa,wBAAgC,IAAI,OAC/C,OAAO,GAAG,OAAO,UAAU,GAAG,UAAU,GAC1C;AAEA,MAAM,uBAAuB,OAAO,GAAG;;AAGvC,MAAM,gBAAgB,IAAI;;;;;;AAO1B,MAAM,cAAc;CAClB,OAAO,GAAG,OAAO,qBAAqB;CACtC,OAAO,GAAG,OAAO,qBAAqB;CAEtC,OAAO,GAAG,SAAS,cAAc,UAAU,cAAc,UAAU,cAAc;AACnF,CAAC,CAAC,KAAK,GAAG;;;;;;;;;AAUV,MAAa,qBAA6B,IAAI,OAC5C,OAAO,GAAG,UAAU,YAAY,eAAe,sBAAsB,KAAK,GAAG,EAAE,MACjF;;AC5BA,MAAa,QAAQ,WAAsC,OAAO,KAAK,IAAI;AAE3E,MAAa,sBACX,OACA,OACA,MACA,UAEA,OAAO,KAAK,KAAK,CAAC,CACf,QAAQ,QAAQ,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Y,CAAC,GAC1C,GAAG,cAAc,GAAG,OAAO,UAAU,GAAG,SAAS,CACnD;CAGA,MAAM,UAAU,aAAa,GAAG,OAAO,SAAS,GAAG,SAAS;CAE5D,OAAO,KAAK,GAAG,eAAe,GAAG,QAAQ,MAAM;CAE/C,OAAO;EAAE,QAAQ;EAAQ,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.5",
3
+ "version": "0.0.6",
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",
@@ -16,6 +16,10 @@
16
16
  "types": "./dist/entries/color.d.ts",
17
17
  "import": "./dist/entries/color.js"
18
18
  },
19
+ "./engine": {
20
+ "types": "./dist/entries/engine.d.ts",
21
+ "import": "./dist/entries/engine.js"
22
+ },
19
23
  "./style-registry": {
20
24
  "types": "./dist/entries/styleRegistry.d.ts",
21
25
  "import": "./dist/entries/styleRegistry.js"
@@ -54,25 +58,26 @@
54
58
  },
55
59
  "devDependencies": {
56
60
  "@repo/config": "0.0.0",
57
- "@storybook/addon-a11y": "^10.6.1",
58
- "@storybook/addon-docs": "^10.6.1",
59
- "@storybook/react-vite": "^10.6.1",
60
- "@types/node": "^26.6.3",
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
65
  "@types/react": "^19.3.0",
62
66
  "@types/react-dom": "^19.3.0",
63
- "@typescript/native": "npm:typescript@^7.1.0-dev.20261001.1",
64
- "@vitest/coverage-v8": "^5.0.3",
65
- "@wistia/ui": "2.13.0",
67
+ "@typescript/native": "npm:typescript@7.1.0-beta",
68
+ "@vitest/coverage-v8": "^5.0.5",
69
+ "@wistia/ui": "3.7.1",
66
70
  "ajv": "^8.20.0",
67
71
  "check-export-map": "^1.3.1",
68
- "react": "^19.3.0",
69
- "react-dom": "^19.3.0",
72
+ "react": "^19.3.1",
73
+ "react-dom": "^19.3.1",
70
74
  "shx": "^0.4.0",
71
- "storybook": "^10.6.1",
72
- "styled-components": "^6.5.3",
75
+ "storybook": "^10.6.2",
76
+ "styled-components": "^6.6.0",
73
77
  "tsx": "^4.23.15",
74
- "vite": "npm:@voidzero-dev/vite-plus-core@1.1.0",
75
- "vite-plus": "^1.1.0"
78
+ "vite": "^8.3.4",
79
+ "vite-plus": "^1.4.0",
80
+ "vitest": "5.0.5"
76
81
  },
77
82
  "author": "Wistia Engineering",
78
83
  "license": "UNLICENSED",
@@ -93,7 +93,8 @@
93
93
  "additionalProperties": false,
94
94
  "required": [
95
95
  "heading",
96
- "body"
96
+ "body",
97
+ "button"
97
98
  ],
98
99
  "properties": {
99
100
  "heading": {
@@ -101,6 +102,9 @@
101
102
  },
102
103
  "body": {
103
104
  "$ref": "#/$defs/fontFamily"
105
+ },
106
+ "button": {
107
+ "$ref": "#/$defs/fontFamily"
104
108
  }
105
109
  }
106
110
  }
@@ -843,7 +847,8 @@
843
847
  "description": "A reference into `anchors.fonts`, written as a path. Font and color anchors can never be interchanged.",
844
848
  "enum": [
845
849
  "anchors.fonts.heading",
846
- "anchors.fonts.body"
850
+ "anchors.fonts.body",
851
+ "anchors.fonts.button"
847
852
  ]
848
853
  },
849
854
  "singleColor": {
@@ -16,7 +16,7 @@
16
16
  "case": "as-typed"
17
17
  },
18
18
  "button": {
19
- "font": "anchors.fonts.heading",
19
+ "font": "anchors.fonts.button",
20
20
  "fontSize": 18,
21
21
  "fontWeight": 700,
22
22
  "case": "as-typed"
@@ -44,7 +44,8 @@
44
44
  },
45
45
  "fonts": {
46
46
  "heading": "$headingFontFamily",
47
- "body": "$bodyFontFamily"
47
+ "body": "$bodyFontFamily",
48
+ "button": "$buttonFontFamily"
48
49
  }
49
50
  },
50
51
  "surfaces": {
@@ -16,7 +16,7 @@
16
16
  "case": "as-typed"
17
17
  },
18
18
  "button": {
19
- "font": "anchors.fonts.heading",
19
+ "font": "anchors.fonts.button",
20
20
  "fontSize": 18,
21
21
  "fontWeight": 700,
22
22
  "case": "as-typed"
@@ -44,7 +44,8 @@
44
44
  },
45
45
  "fonts": {
46
46
  "heading": "$headingFontFamily",
47
- "body": "$bodyFontFamily"
47
+ "body": "$bodyFontFamily",
48
+ "button": "$buttonFontFamily"
48
49
  }
49
50
  },
50
51
  "surfaces": {
@@ -16,7 +16,7 @@
16
16
  "case": "as-typed"
17
17
  },
18
18
  "button": {
19
- "font": "anchors.fonts.heading",
19
+ "font": "anchors.fonts.button",
20
20
  "fontSize": 18,
21
21
  "fontWeight": 700,
22
22
  "case": "as-typed"
@@ -33,7 +33,8 @@
33
33
  },
34
34
  "fonts": {
35
35
  "heading": "$headingFontFamily",
36
- "body": "$bodyFontFamily"
36
+ "body": "$bodyFontFamily",
37
+ "button": "$buttonFontFamily"
37
38
  }
38
39
  },
39
40
  "surfaces": {
@@ -16,7 +16,7 @@
16
16
  "case": "as-typed"
17
17
  },
18
18
  "button": {
19
- "font": "anchors.fonts.heading",
19
+ "font": "anchors.fonts.button",
20
20
  "fontSize": 18,
21
21
  "fontWeight": 700,
22
22
  "case": "as-typed"
@@ -33,7 +33,8 @@
33
33
  },
34
34
  "fonts": {
35
35
  "heading": "$headingFontFamily",
36
- "body": "$bodyFontFamily"
36
+ "body": "$bodyFontFamily",
37
+ "button": "$buttonFontFamily"
37
38
  }
38
39
  },
39
40
  "surfaces": {
@@ -16,7 +16,7 @@
16
16
  "case": "as-typed"
17
17
  },
18
18
  "button": {
19
- "font": "anchors.fonts.heading",
19
+ "font": "anchors.fonts.button",
20
20
  "fontSize": 18,
21
21
  "fontWeight": 700,
22
22
  "case": "as-typed"
@@ -35,7 +35,8 @@
35
35
  },
36
36
  "fonts": {
37
37
  "heading": "$headingFontFamily",
38
- "body": "$bodyFontFamily"
38
+ "body": "$bodyFontFamily",
39
+ "button": "$buttonFontFamily"
39
40
  }
40
41
  },
41
42
  "surfaces": {
@@ -16,7 +16,7 @@
16
16
  "case": "as-typed"
17
17
  },
18
18
  "button": {
19
- "font": "anchors.fonts.heading",
19
+ "font": "anchors.fonts.button",
20
20
  "fontSize": 18,
21
21
  "fontWeight": 700,
22
22
  "case": "as-typed"
@@ -35,7 +35,8 @@
35
35
  },
36
36
  "fonts": {
37
37
  "heading": "$headingFontFamily",
38
- "body": "$bodyFontFamily"
38
+ "body": "$bodyFontFamily",
39
+ "button": "$buttonFontFamily"
39
40
  }
40
41
  },
41
42
  "surfaces": {