@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 @@
1
+ {"version":3,"file":"engine-DeOUPRa0.js","names":[],"sources":["../src/brandTokens.ts","../src/private/engine/constants/color.ts","../src/private/engine/scale.ts","../src/private/engine/anchors.ts","../src/private/engine/rules/border.ts","../src/private/engine/constants/elevation.ts","../src/private/engine/rules/elevation.ts","../src/private/engine/kebab.ts","../src/private/engine/surfaces.ts","../src/private/engine/slots.ts","../src/private/engine/treatments/flat.ts","../src/private/engine/treatments/index.ts","../src/private/engine/rules/fill.ts","../src/private/engine/constants/motion.ts","../src/private/engine/rules/motion.ts","../src/private/engine/rules/panelInput.ts","../src/private/engine/constants/radius.ts","../src/private/engine/rules/radius.ts","../src/private/engine/rules/text.ts","../src/private/engine/constants/typography.ts","../src/private/engine/rules/typography.ts","../src/private/engine/contract.ts","../src/kaleidoscopeContract.ts","../src/private/engine/rules/invert.ts","../src/private/engine/evaluateSurfaces.ts","../src/private/engine/rules/texture.ts","../src/private/engine/support.ts","../src/getKaleidoscopeStyles.ts","../src/serializeKaleidoscopeStyles.ts"],"sourcesContent":["/** The Brand Kit tokens a Style document can reference, each as `$<name>`. */\nexport const BRAND_TOKEN_NAMES = [\n 'primaryColor',\n 'pageBackgroundColor',\n 'borderRadius',\n 'headingFontFamily',\n 'bodyFontFamily',\n 'buttonFontFamily',\n] as const;\nexport type BrandTokenName = (typeof BRAND_TOKEN_NAMES)[number];\n\n/**\n * The Brand Kit values `getKaleidoscopeStyles()` resolves a Style against. Colors are CSS colors,\n * `borderRadius` is in pixels, and the font families are CSS `font-family` values.\n *\n * Every token is optional: a token the Style references but the Brand Kit leaves out takes its\n * {@link DEFAULT_BRAND_TOKENS | default}.\n */\nexport type BrandTokens = {\n readonly bodyFontFamily?: string;\n readonly borderRadius?: number;\n readonly buttonFontFamily?: string;\n readonly headingFontFamily?: string;\n readonly pageBackgroundColor?: string;\n readonly primaryColor?: string;\n};\n\n/** What a missing Brand Kit token falls back to: Wistia's own brand. */\nexport const DEFAULT_BRAND_TOKENS: Required<BrandTokens> = {\n primaryColor: '#2949e5',\n pageBackgroundColor: '#ffffff',\n borderRadius: 20,\n headingFontFamily: 'GT Walsheim',\n bodyFontFamily: 'Inter',\n buttonFontFamily: 'Inter',\n};\n","import type { ColorRelationship } from '../../../styleVocabulary';\nimport { colorContrastRatiosByShape } from '../../../colorContrastRatiosByShape';\n\n/** Degrees a `relation` turns a hue, measured around the Lab a/b plane. Placeholder. */\nexport const RELATION_HUE_DEGREES = {\n same: 0,\n analogous: 30,\n triad: 120,\n complementary: 180,\n} satisfies Record<ColorRelationship, number>;\n\n/** Contrast below which a flat fill is pushed one more step from its parent. Placeholder. */\nexport const SEPARATION_MIN_CONTRAST = 1.1;\n\n/** WCAG non-text contrast: below this a fill does not read as a shape against its parent. */\nexport const INVERT_BELOW_CONTRAST = colorContrastRatiosByShape.nonText;\n\n/** How far low-emphasis text fades from the surface's text color. Placeholder. */\nexport const LOW_EMPHASIS_TEXT_ALPHA = 0.7;\n\n/** How far a hover fill must sit from the resting fill and the parent to be seen. */\nexport const HOVER_MIN_CONTRAST = 1.1;\n","import type { BrandedColorScale } from '../buildBrandedColorScale';\nimport { Color } from '../../Color';\nimport { getColorLightnessClassification } from '../../getColorLightnessClassification';\nimport { buildBrandedColorScale } from '../buildBrandedColorScale';\nimport { clamp } from '../clamp';\n\nexport type Scale = BrandedColorScale;\n\nconst MAX_CACHED_SCALES = 600;\nconst scaleCache = new Map<string, Scale>();\n\n/** The branded scale through `color`, cached because every surface of every Style asks for it. */\nexport const scaleOf = (color: Color): Scale => {\n const hex = color.toHex();\n let scale = scaleCache.get(hex);\n\n if (scale === undefined) {\n if (scaleCache.size >= MAX_CACHED_SCALES) {\n scaleCache.clear();\n }\n\n scale = buildBrandedColorScale(new Color(hex));\n scaleCache.set(hex, scale);\n }\n\n return scale;\n};\n\nconst lastStep = (scale: Scale): number => scale.steps - 1;\n\nexport const stepAt = (scale: Scale, index: number): Color =>\n scale.atStep(clamp(index, 0, lastStep(scale)));\n\nconst nearestStep = (scale: Scale, color: Color): number =>\n clamp(Math.round(scale.stepOf(color)), 0, lastStep(scale));\n\n/**\n * `offset` steps along `scale` from `color`, away from its lightness: a dark color steps lighter,\n * and a light or midtone one steps darker. The color decides, not its place on the scale, so a\n * page steps the same way whatever the brand.\n */\nexport const stepAlong = (scale: Scale, color: Color, offset: number): Color => {\n const position = nearestStep(scale, color);\n const lightness = getColorLightnessClassification(color);\n const direction = lightness === 'dark' || lightness === 'veryDark' ? -1 : 1;\n\n return stepAt(scale, position + direction * offset);\n};\n\nexport const stepFrom = (color: Color, offset: number): Color =>\n stepAlong(scaleOf(color), color, offset);\n\n/**\n * `offset` steps from `color` along its scale, away from `text`, so their contrast grows; a negative\n * offset steps towards it. A color with no room left on that side steps the other way, so it still\n * visibly changes.\n */\nexport const stepAwayFrom = (color: Color, text: Color, offset: number): Color => {\n const scale = scaleOf(color);\n const position = nearestStep(scale, color);\n const away = position + (text.luminance() > color.luminance() ? offset : -offset);\n\n return stepAt(scale, away >= 0 && away <= lastStep(scale) ? away : position * 2 - away);\n};\n","import type { BrandTokens } from '../../brandTokens';\nimport type {\n BrandKitTokenRef,\n Dimension,\n FontAnchorRef,\n SingleColor,\n SingleColorAnchorName,\n SingleColorAnchorRef,\n StyleDocument,\n} from '../../styleVocabulary';\nimport type { Scale } from './scale';\nimport { BRAND_TOKEN_NAMES, DEFAULT_BRAND_TOKENS } from '../../brandTokens';\nimport { Color } from '../../Color';\nimport { getBrandDarkBackgroundColor } from '../../getBrandDarkBackgroundColor';\nimport { getBrandLightBackgroundColor } from '../../getBrandLightBackgroundColor';\nimport { isOneOf } from '../guards';\nimport { RELATION_HUE_DEGREES } from './constants/color';\nimport { scaleOf } from './scale';\n\n/** A Style document's anchors, resolved once against the Brand Kit. */\nexport type ResolvedAnchors = {\n readonly borderRadius: number;\n readonly colors: Readonly<Record<SingleColorAnchorName, Color | null>>;\n readonly dimension: (value: Dimension) => number;\n readonly fonts: Readonly<Record<FontAnchorRef, string>>;\n /** For an anchor toned from a token, the token's own scale, so stepping keeps its hue. */\n readonly scales: Readonly<Record<SingleColorAnchorName, Scale | null>>;\n readonly tokens: BrandTokens;\n};\n\nconst isTokenRef = (value: string): value is BrandKitTokenRef => value.startsWith('$');\n\n/** A token the Brand Kit leaves out takes its default; a token no Brand Kit has is an error. */\nconst tokenValue = (tokens: BrandTokens, ref: BrandKitTokenRef): number | string => {\n const name = ref.slice(1);\n\n if (!isOneOf(BRAND_TOKEN_NAMES, name)) {\n throw new Error(`${ref} is not a Brand Kit token`);\n }\n\n return tokens[name] ?? DEFAULT_BRAND_TOKENS[name];\n};\n\nconst tokenColor = (tokens: BrandTokens, ref: BrandKitTokenRef): Color =>\n new Color(String(tokenValue(tokens, ref)));\n\n/** Turns a hue around the Lab a/b plane. */\nconst rotateHue = (color: Color, degrees: number): Color => {\n if (degrees === 0) {\n return color;\n }\n\n const lab = color.toLab();\n const radians = (degrees * Math.PI) / 180;\n const cos = Math.cos(radians);\n const sin = Math.sin(radians);\n\n return Color.fromLab(\n {\n lightness: lab.lightness,\n // oxlint-disable-next-line id-length -- the Lab axes are named a and b\n a: lab.a * cos - lab.b * sin,\n // oxlint-disable-next-line id-length -- the Lab axes are named a and b\n b: lab.a * sin + lab.b * cos,\n },\n color.a,\n );\n};\n\nexport const resolveSingleColor = (value: SingleColor, tokens: BrandTokens): Color => {\n if (typeof value === 'string') {\n return isTokenRef(value) ? tokenColor(tokens, value) : new Color(value);\n }\n\n const related = rotateHue(\n tokenColor(tokens, value.from),\n RELATION_HUE_DEGREES[value.relation ?? 'same'],\n );\n\n if (value.tone === 'dark') {\n return getBrandDarkBackgroundColor(related);\n }\n\n if (value.tone === 'light') {\n return getBrandLightBackgroundColor(related);\n }\n\n return related;\n};\n\n/**\n * A toned anchor is a point on its token's scale, so stepping from it should walk that scale.\n * Rebuilding a scale from a pale tone would keep almost none of the brand's hue.\n */\nconst scaleBeforeTone = (value: SingleColor | undefined, tokens: BrandTokens): Scale | null => {\n if (value === undefined || typeof value === 'string' || value.tone === undefined) {\n return null;\n }\n\n return scaleOf(\n rotateHue(tokenColor(tokens, value.from), RELATION_HUE_DEGREES[value.relation ?? 'same']),\n );\n};\n\nconst fontFrom = (value: string, tokens: BrandTokens): string =>\n isTokenRef(value) ? String(tokenValue(tokens, value)) : value;\n\nexport const resolveAnchors = (style: StyleDocument, tokens: BrandTokens): ResolvedAnchors => {\n const { colors, dimensions, fonts } = style.anchors;\n const dimension = (value: Dimension): number =>\n typeof value === 'number' ? value : Number(tokenValue(tokens, value));\n\n return {\n tokens,\n dimension,\n borderRadius: dimension(dimensions.borderRadius),\n colors: {\n pageBackground: resolveSingleColor(colors.pageBackground, tokens),\n primary: resolveSingleColor(colors.primary, tokens),\n ground: colors.ground === undefined ? null : resolveSingleColor(colors.ground, tokens),\n },\n scales: {\n pageBackground: scaleBeforeTone(colors.pageBackground, tokens),\n primary: scaleBeforeTone(colors.primary, tokens),\n ground: scaleBeforeTone(colors.ground, tokens),\n },\n fonts: {\n 'anchors.fonts.heading': fontFrom(fonts.heading, tokens),\n 'anchors.fonts.body': fontFrom(fonts.body, tokens),\n 'anchors.fonts.button': fontFrom(fonts.button, tokens),\n },\n };\n};\n\nconst ANCHOR_BY_REF: Readonly<Record<SingleColorAnchorRef, SingleColorAnchorName>> = {\n 'anchors.colors.pageBackground': 'pageBackground',\n 'anchors.colors.primary': 'primary',\n 'anchors.colors.ground': 'ground',\n};\n\nexport const anchorName = (ref: SingleColorAnchorRef): SingleColorAnchorName => ANCHOR_BY_REF[ref];\n\nexport const anchorColor = (ref: SingleColorAnchorRef, anchors: ResolvedAnchors): Color => {\n const color = anchors.colors[ANCHOR_BY_REF[ref]];\n\n if (color === null) {\n throw new Error(`${ref} is referenced but not declared`);\n }\n\n return color;\n};\n\n/** The scale stepping from an anchor walks: its token's if it's toned, or else its own. */\nexport const anchorScale = (ref: SingleColorAnchorRef, anchors: ResolvedAnchors): Scale =>\n anchors.scales[anchorName(ref)] ?? scaleOf(anchorColor(ref, anchors));\n","import type { Color } from '../../../Color';\nimport type { Border } from '../../../styleVocabulary';\nimport type { ResolvedAnchors } from '../anchors';\nimport type { Slots, SurfaceSlotFragment } from '../slots';\nimport type { FindGaps } from './types';\nimport { ORNAMENTAL_BORDER_STYLES, SURFACE_NAMES } from '../../../styleVocabulary';\nimport { anchorColor } from '../anchors';\nimport { stepFrom } from '../scale';\n\n/** The page sits on nothing and has no edge, so it carries no border. */\nexport const BORDER_SLOTS: SurfaceSlotFragment = {\n surfaces: SURFACE_NAMES.filter((name) => name !== 'page'),\n initialValues: {\n 'border-width': '0',\n 'border-style': 'none',\n 'border-color': 'transparent',\n },\n};\n\n/** A `width` of 0 keeps the initial values, so the surface has no edge whatever its source. */\nexport const borderSlots = (\n border: Border | undefined,\n solid: Color,\n anchors: ResolvedAnchors,\n): Slots => {\n if (border === undefined || border.width === 0) {\n return {};\n }\n\n const { offset, source, style, width } = border;\n const from = source === 'surface' ? solid : anchorColor(source, anchors);\n\n return {\n 'border-width': `${width}px`,\n 'border-style': style,\n 'border-color': stepFrom(from, offset).toHex(),\n };\n};\n\n/** An ornament is a drawn tile rather than a CSS border, and draws whatever the width. */\nexport const borderGaps: FindGaps = ({ border }) =>\n ORNAMENTAL_BORDER_STYLES.some((ornament) => ornament === border?.style)\n ? [`border.style: ${border?.style}`]\n : [];\n","import type { ElevationDepth, ElevationHardness } from '../../../styleVocabulary';\n\nexport type Shadow = {\n readonly alpha: number;\n readonly blur: number;\n readonly x: number;\n readonly y: number;\n};\n\n/**\n * The shadow each hardness casts at each depth. A pairing missing here is one the engine does not\n * resolve yet. `soft · low` is from the Phase 1 carousel sandbox.\n */\nexport const SHADOWS: Readonly<\n Partial<Record<ElevationHardness, Partial<Record<Exclude<ElevationDepth, 'none'>, Shadow>>>>\n> = {\n soft: { low: { x: 0, y: 8, blur: 32, alpha: 0.2 } },\n};\n","import type { Elevation } from '../../../styleVocabulary';\nimport type { Slots, SurfaceSlotFragment } from '../slots';\nimport type { FindGaps } from './types';\nimport { SURFACE_NAMES } from '../../../styleVocabulary';\nimport { SHADOWS } from '../constants/elevation';\n\nexport const ELEVATION_SLOTS: SurfaceSlotFragment = {\n surfaces: SURFACE_NAMES,\n initialValues: { 'box-shadow': 'none' },\n};\n\nexport const elevationSlots = ({ depth, hardness }: Elevation): Slots => {\n const shadow = depth === 'none' ? undefined : SHADOWS[hardness]?.[depth];\n\n if (shadow === undefined) {\n return {};\n }\n\n const { alpha, blur, x, y } = shadow;\n\n return { 'box-shadow': `${x}px ${y}px ${blur}px rgba(0, 0, 0, ${alpha})` };\n};\n\nexport const elevationGaps: FindGaps = ({ elevation: { depth, hardness, source } }) => {\n if (depth === 'none') {\n return [];\n }\n\n return [\n ...(SHADOWS[hardness]?.[depth] === undefined ? [`elevation: ${hardness} ${depth}`] : []),\n ...(source === 'shade' ? [] : [`elevation.source: ${JSON.stringify(source)}`]),\n ];\n};\n","/** `buttonPrimary` → `button-primary`, as surface names appear in variable names. */\nexport const kebab = (name: string): string =>\n name.replaceAll(/[A-Z]/g, (char) => `-${char.toLowerCase()}`);\n","import type { SurfaceName } from '../../styleVocabulary';\nimport { STACKABLE_ON, SURFACE_NAMES } from '../../styleVocabulary';\nimport { kebab } from './kebab';\n\nexport type SurfaceSpec = {\n /** Page, panel and card hold copy, so they carry heading and low-emphasis text; a button doesn't. */\n readonly holdsContent: boolean;\n /** Hover, focus and active states: only for surfaces a viewer acts on. */\n readonly interactive: boolean;\n /** Forms live only in panels, so only a panel carries input slots. */\n readonly mayContainForm: boolean;\n};\n\n/** What the engine knows about each surface beyond what a Style document says. */\nexport const SURFACES: Readonly<Record<SurfaceName, SurfaceSpec>> = {\n page: { holdsContent: true, interactive: false, mayContainForm: false },\n panel: { holdsContent: true, interactive: false, mayContainForm: true },\n card: { holdsContent: true, interactive: true, mayContainForm: false },\n buttonPrimary: { holdsContent: false, interactive: true, mayContainForm: false },\n buttonSecondary: { holdsContent: false, interactive: true, mayContainForm: false },\n};\n\n/**\n * One evaluation of a surface: the surface on its only parent, or once per parent for a surface\n * that can sit on several, named `<surface>-on-<parent>`.\n */\nexport type SurfaceGroup = {\n readonly parent: SurfaceName | null;\n readonly prefix: string;\n readonly surface: SurfaceName;\n};\n\n/** Every surface group, parents before the surfaces that sit on them. */\nexport const SURFACE_GROUPS: readonly SurfaceGroup[] = SURFACE_NAMES.flatMap((surface) => {\n const parents = STACKABLE_ON[surface];\n\n if (parents.length <= 1) {\n return [{ surface, parent: parents[0] ?? null, prefix: kebab(surface) }];\n }\n\n return parents.map((parent) => ({\n surface,\n parent,\n prefix: `${kebab(surface)}-on-${kebab(parent)}`,\n }));\n});\n","import type { SurfaceName, TypeRoleName } from '../../styleVocabulary';\nimport type { SurfaceSpec } from './surfaces';\nimport { SURFACE_NAMES } from '../../styleVocabulary';\nimport { SURFACES } from './surfaces';\n\nexport const VARIABLE_PREFIX = '--wistia-kaleidoscope-';\nexport type VariableName = `${typeof VARIABLE_PREFIX}${string}`;\n\n/** Slot name → CSS value, for one surface group or one type role. */\nexport type Slots = Readonly<Record<string, string>>;\n\n/**\n * One rule's share of the contract: the slots it emits on each surface it applies to, with the\n * value each takes when a Style doesn't use the rule — the CSS initial value of the property the\n * slot feeds, or the value that draws nothing where the property has no fixed one.\n */\nexport type SurfaceSlotFragment = {\n readonly initialValues: Slots;\n readonly surfaces: readonly SurfaceName[];\n};\n\nexport const surfacesWhere = (flag: keyof SurfaceSpec): readonly SurfaceName[] =>\n SURFACE_NAMES.filter((name) => SURFACES[name][flag]);\n\nexport const surfaceVariable = (prefix: string, slot: string): VariableName =>\n `${VARIABLE_PREFIX}${prefix}-${slot}`;\n\nexport const typeVariable = (role: TypeRoleName, slot: string): VariableName =>\n `${VARIABLE_PREFIX}type-${role}-${slot}`;\n","import type { Scale } from '../scale';\nimport type { ResolvedFill, TreatmentFn, TreatmentResult } from './types';\nimport { Color } from '../../../Color';\nimport { anchorColor, anchorScale } from '../anchors';\nimport { HOVER_MIN_CONTRAST, SEPARATION_MIN_CONTRAST } from '../constants/color';\nimport { scaleOf, stepAlong, stepAwayFrom } from '../scale';\n\n/**\n * A step away from the text, unless that lands too close to the resting fill or the parent to be\n * seen. Then a step towards it, which relies on the hover text staying readable.\n */\nconst hoverFill = (solid: Color, text: Color, parent: ResolvedFill | null): Color => {\n // Measured as the hex it renders as, because a step can sit right on the threshold.\n const away = new Color(stepAwayFrom(solid, text, 1).toHex());\n const isVisible =\n away.contrast(solid) >= HOVER_MIN_CONTRAST &&\n (parent === null || away.contrast(parent.solid) >= HOVER_MIN_CONTRAST);\n\n return isVisible ? away : stepAwayFrom(solid, text, -1);\n};\n\n/** The slots that paint `solid` as a flat fill on `parent`. */\nexport const flatFill = (\n solid: Color,\n scale: Scale | null,\n parent: ResolvedFill | null,\n): TreatmentResult => ({\n solid,\n scale,\n fill: { 'background-color': solid.toHex() },\n hover: (text) => {\n const solidHover = hoverFill(solid, text, parent);\n\n return { solid: solidHover, slots: { 'background-color-hover': solidHover.toHex() } };\n },\n});\n\n/** A single opaque color, stepped along its source's scale. */\nexport const flat: TreatmentFn = ({ anchors, parent, settings }) => {\n const { from, offset, source } = settings.backgroundColor;\n const sourceColor =\n source === 'parent'\n ? (parent?.solid ?? anchorColor('anchors.colors.pageBackground', anchors))\n : anchorColor(source, anchors);\n const scale =\n source === 'parent' ? (parent?.scale ?? scaleOf(sourceColor)) : anchorScale(source, anchors);\n const start = from === 'parent' && parent !== null ? parent.solid : sourceColor;\n let solid = stepAlong(scale, start, offset);\n\n if (parent !== null && solid.contrast(parent.solid) < SEPARATION_MIN_CONTRAST) {\n solid = stepAlong(scale, start, offset + 1);\n }\n\n return flatFill(solid, scale, parent);\n};\n","import type { Treatment } from '../../../styleVocabulary';\nimport type { TreatmentFn } from './types';\nimport { flat } from './flat';\n\n/** The treatments the engine can paint. A Style using any other is not supported yet. */\nexport const TREATMENT_FUNCTIONS: Readonly<Partial<Record<Treatment, TreatmentFn>>> = {\n flat,\n};\n","import type { SurfaceSlotFragment } from '../slots';\nimport type { FindGaps } from './types';\nimport { SURFACE_NAMES } from '../../../styleVocabulary';\nimport { surfacesWhere } from '../slots';\nimport { TREATMENT_FUNCTIONS } from '../treatments';\n\n/**\n * A surface's fill. `background-image` holds layers drawn over `background-color` — glass sheens,\n * gradients — and `backdrop-filter` blurs what is behind a translucent fill.\n */\nexport const FILL_SLOTS: SurfaceSlotFragment = {\n surfaces: SURFACE_NAMES,\n initialValues: {\n 'background-color': 'transparent',\n 'background-image': 'none',\n 'backdrop-filter': 'none',\n },\n};\n\nexport const HOVER_FILL_SLOTS: SurfaceSlotFragment = {\n surfaces: surfacesWhere('interactive'),\n initialValues: {\n 'background-color-hover': 'transparent',\n 'background-image-hover': 'none',\n },\n};\n\nexport const fillGaps: FindGaps = ({ treatment }) =>\n Object.hasOwn(TREATMENT_FUNCTIONS, treatment) ? [] : [`treatment: ${treatment}`];\n","import type { Transition } from '../../../styleVocabulary';\n\n/** How long a surface takes to move between states. Placeholder. */\nexport const TRANSITION_DURATIONS = {\n none: null,\n quick: '120ms',\n smooth: '240ms',\n} satisfies Record<Transition, string | null>;\n\n/** The properties a state change animates. */\nexport const TRANSITIONED_PROPERTIES = ['background-color', 'box-shadow', 'border-color', 'color'];\n\nexport const TRANSITION_EASING = 'ease';\n","import type { Motion } from '../../../styleVocabulary';\nimport type { Slots, SurfaceSlotFragment } from '../slots';\nimport type { FindGaps } from './types';\nimport { SURFACE_NAMES } from '../../../styleVocabulary';\nimport {\n TRANSITION_DURATIONS,\n TRANSITION_EASING,\n TRANSITIONED_PROPERTIES,\n} from '../constants/motion';\n\nexport const MOTION_SLOTS: SurfaceSlotFragment = {\n surfaces: SURFACE_NAMES,\n initialValues: { transition: 'none', animation: 'none' },\n};\n\nexport const motionSlots = ({ transition }: Motion): Slots => {\n const duration = TRANSITION_DURATIONS[transition];\n\n if (duration === null) {\n return {};\n }\n\n return {\n transition: TRANSITIONED_PROPERTIES.map(\n (property) => `${property} ${duration} ${TRANSITION_EASING}`,\n ).join(', '),\n };\n};\n\n/** No ambient motion yet. */\nexport const motionGaps: FindGaps = ({ motion: { ambient } }) =>\n ambient === 'none' ? [] : [`motion.ambient: ${ambient}`];\n","import type { Color } from '../../../Color';\nimport type { ResolvedAnchors } from '../anchors';\nimport type { Slots, SurfaceSlotFragment } from '../slots';\nimport { anchorColor } from '../anchors';\nimport { stepFrom } from '../scale';\nimport { surfacesWhere } from '../slots';\n\n/** The form fields inside a panel. */\nexport const PANEL_INPUT_SLOTS: SurfaceSlotFragment = {\n surfaces: surfacesWhere('mayContainForm'),\n initialValues: {\n 'input-background-color': 'transparent',\n 'input-background-color-focus': 'transparent',\n 'input-border-color-focus': 'transparent',\n },\n};\n\n/** Inputs step off the panel's fill, and take the primary color when focused. */\nexport const panelInputSlots = (solid: Color, anchors: ResolvedAnchors): Slots => ({\n 'input-background-color': stepFrom(solid, 1).toHex(),\n 'input-background-color-focus': stepFrom(solid, 2).toHex(),\n 'input-border-color-focus': anchorColor('anchors.colors.primary', anchors).toHex(),\n});\n","import type { SurfaceName } from '../../../styleVocabulary';\n\n/** How the radius anchor scales on each surface. Placeholder. */\nexport const RADIUS_FACTORS = {\n page: 0,\n panel: 1,\n card: 0.7,\n buttonPrimary: 0.5,\n buttonSecondary: 0.5,\n} satisfies Record<SurfaceName, number>;\n","import type { Radius, SurfaceName } from '../../../styleVocabulary';\nimport type { ResolvedAnchors } from '../anchors';\nimport type { Slots, SurfaceSlotFragment } from '../slots';\nimport { SURFACE_NAMES } from '../../../styleVocabulary';\nimport { RADIUS_FACTORS } from '../constants/radius';\n\nexport const RADIUS_SLOTS: SurfaceSlotFragment = {\n surfaces: SURFACE_NAMES,\n initialValues: { 'border-radius': '0' },\n};\n\nexport const radiusSlots = (\n surface: SurfaceName,\n { source }: Radius,\n anchors: ResolvedAnchors,\n): Slots => ({\n 'border-radius':\n source === 'anchors.dimensions.borderRadius'\n ? `${Math.round(anchors.borderRadius * RADIUS_FACTORS[surface])}px`\n : `${anchors.dimension(source)}px`,\n});\n","import type { Color } from '../../../Color';\nimport type { SurfaceName, TextColor, TextColorPreference } from '../../../styleVocabulary';\nimport type { ResolvedAnchors } from '../anchors';\nimport type { Slots, SurfaceSlotFragment } from '../slots';\nimport type { FindGaps } from './types';\nimport { adjustColorForProperContrast } from '../../../adjustColorForProperContrast';\nimport { getBestColorForText } from '../../../getBestColorForText';\nimport { SURFACE_NAMES } from '../../../styleVocabulary';\nimport { anchorColor, anchorScale } from '../anchors';\nimport { LOW_EMPHASIS_TEXT_ALPHA } from '../constants/color';\nimport { stepAlong } from '../scale';\nimport { surfacesWhere } from '../slots';\nimport { SURFACES } from '../surfaces';\n\nexport const TEXT_SLOTS: SurfaceSlotFragment = {\n surfaces: SURFACE_NAMES,\n initialValues: { 'text-color': 'canvastext' },\n};\n\nexport const CONTENT_TEXT_SLOTS: SurfaceSlotFragment = {\n surfaces: surfacesWhere('holdsContent'),\n initialValues: {\n 'heading-text-color': 'canvastext',\n 'low-emphasis-text-color': 'canvastext',\n },\n};\n\nexport const HOVER_TEXT_SLOTS: SurfaceSlotFragment = {\n surfaces: surfacesWhere('interactive'),\n initialValues: { 'text-color-hover': 'canvastext' },\n};\n\nexport const CONTENT_HOVER_TEXT_SLOTS: SurfaceSlotFragment = {\n surfaces: surfacesWhere('interactive').filter((surface) => SURFACES[surface].holdsContent),\n initialValues: {\n 'heading-text-color-hover': 'canvastext',\n 'low-emphasis-text-color-hover': 'canvastext',\n },\n};\n\nconst isPreference = (textColor: TextColor): textColor is TextColorPreference =>\n typeof textColor === 'object' && 'source' in textColor;\n\n/**\n * `derive` allows text color to be calculated by the engine so we can pick a color with appropriate contrast.\n * A preferred color starts from a reference point (a color anchor) and adjusts it until it meets required contrast rules.\n */\nexport const resolveTextColor = (\n textColor: TextColor,\n solid: Color,\n anchors: ResolvedAnchors,\n): Color => {\n if (!isPreference(textColor)) {\n return getBestColorForText({ backgroundColor: solid });\n }\n\n const { offset, source } = textColor;\n const preferred = stepAlong(anchorScale(source, anchors), anchorColor(source, anchors), offset);\n\n return adjustColorForProperContrast({ foregroundColor: preferred, backgroundColor: solid });\n};\n\nexport const textSlots = (surface: SurfaceName, text: Color): Slots => ({\n 'text-color': text.toHex(),\n ...(SURFACES[surface].holdsContent\n ? {\n 'heading-text-color': text.toHex(),\n 'low-emphasis-text-color': text.withAlpha(LOW_EMPHASIS_TEXT_ALPHA).toRgba(),\n }\n : {}),\n});\n\n/** The same text slots with a `-hover` suffix, moved only as far as the hovered fill needs. */\nexport const hoverTextSlots = (surface: SurfaceName, text: Color, solidHover: Color): Slots => {\n const readable = adjustColorForProperContrast({\n foregroundColor: text,\n backgroundColor: solidHover,\n });\n\n return Object.fromEntries(\n Object.entries(textSlots(surface, readable)).map(([slot, value]) => [`${slot}-hover`, value]),\n );\n};\n\nexport const textGaps: FindGaps = ({ textColor }) =>\n textColor === 'derive' || isPreference(textColor)\n ? []\n : [`textColor: ${JSON.stringify(textColor)}`];\n","/** Letter spacing for `case: upper`, which reads cramped at the spacing set for mixed case. */\nexport const UPPERCASE_LETTER_SPACING = '0.05em';\n","import type { StyleDocument } from '../../../styleVocabulary';\nimport type { ResolvedAnchors } from '../anchors';\nimport type { VariableName } from '../slots';\nimport { TYPE_ROLES } from '../../../styleVocabulary';\nimport { UPPERCASE_LETTER_SPACING } from '../constants/typography';\nimport { typeVariable } from '../slots';\n\n/**\n * `font-family` has no fixed initial value — it is up to the browser — so its unused value is the\n * generic family instead.\n */\nconst TYPE_INITIAL_VALUES = {\n 'font-family': 'sans-serif',\n 'font-size': 'medium',\n 'font-weight': 'normal',\n 'text-transform': 'none',\n 'letter-spacing': 'normal',\n} as const;\n\nexport const TYPOGRAPHY_CONTRACT: Readonly<Record<VariableName, string>> = Object.fromEntries(\n TYPE_ROLES.flatMap((role) =>\n Object.entries(TYPE_INITIAL_VALUES).map(([slot, value]) => [typeVariable(role, slot), value]),\n ),\n);\n\nexport const typographyVariables = (\n { typography }: StyleDocument,\n anchors: ResolvedAnchors,\n): Readonly<Record<VariableName, string>> =>\n Object.fromEntries(\n TYPE_ROLES.flatMap((role) => {\n const type = typography[role];\n const upper = type.case === 'upper';\n\n return [\n [typeVariable(role, 'font-family'), anchors.fonts[type.font]],\n [typeVariable(role, 'font-size'), `${type.fontSize}px`],\n [typeVariable(role, 'font-weight'), String(type.fontWeight)],\n [typeVariable(role, 'text-transform'), upper ? 'uppercase' : 'none'],\n [typeVariable(role, 'letter-spacing'), upper ? UPPERCASE_LETTER_SPACING : 'normal'],\n ];\n }),\n );\n","import type { SurfaceSlotFragment, VariableName } from './slots';\nimport { BORDER_SLOTS } from './rules/border';\nimport { ELEVATION_SLOTS } from './rules/elevation';\nimport { FILL_SLOTS, HOVER_FILL_SLOTS } from './rules/fill';\nimport { MOTION_SLOTS } from './rules/motion';\nimport { PANEL_INPUT_SLOTS } from './rules/panelInput';\nimport { RADIUS_SLOTS } from './rules/radius';\nimport {\n CONTENT_HOVER_TEXT_SLOTS,\n CONTENT_TEXT_SLOTS,\n HOVER_TEXT_SLOTS,\n TEXT_SLOTS,\n} from './rules/text';\nimport { TYPOGRAPHY_CONTRACT } from './rules/typography';\nimport { surfaceVariable } from './slots';\nimport { SURFACE_GROUPS } from './surfaces';\n\n/** Every rule's surface slots. A rule that adds slots adds its fragment here. */\nconst SURFACE_SLOT_FRAGMENTS: readonly SurfaceSlotFragment[] = [\n FILL_SLOTS,\n HOVER_FILL_SLOTS,\n TEXT_SLOTS,\n CONTENT_TEXT_SLOTS,\n HOVER_TEXT_SLOTS,\n CONTENT_HOVER_TEXT_SLOTS,\n PANEL_INPUT_SLOTS,\n BORDER_SLOTS,\n ELEVATION_SLOTS,\n RADIUS_SLOTS,\n MOTION_SLOTS,\n];\n\nconst surfaceContract = (): Readonly<Record<VariableName, string>> =>\n Object.fromEntries(\n SURFACE_GROUPS.flatMap(({ prefix, surface }) =>\n SURFACE_SLOT_FRAGMENTS.filter(({ surfaces }) => surfaces.includes(surface)).flatMap(\n ({ initialValues }) =>\n Object.entries(initialValues).map(([slot, value]) => [\n surfaceVariable(prefix, slot),\n value,\n ]),\n ),\n ),\n );\n\nexport const CONTRACT: Readonly<Record<VariableName, string>> = {\n ...surfaceContract(),\n ...TYPOGRAPHY_CONTRACT,\n};\n","import type { VariableName } from './private/engine/slots';\nimport { CONTRACT } from './private/engine/contract';\n\nexport { VARIABLE_PREFIX as KALEIDOSCOPE_VARIABLE_PREFIX } from './private/engine/slots';\n\n/** A `--wistia-kaleidoscope-*` custom property name. */\nexport type KaleidoscopeVariableName = VariableName;\n\n/**\n * The record `getKaleidoscopeStyles()` returns: every variable and its value. The type\n * only checks the `--wistia-kaleidoscope-` prefix, so a misspelled name still compiles. The names\n * themselves are defined by {@link KALEIDOSCOPE_CONTRACT} and pinned by its contract test.\n */\nexport type KaleidoscopeVariables = Readonly<Record<KaleidoscopeVariableName, string>>;\n\n/**\n * Every variable the engine emits, with the value it takes when a Style doesn't use the rule\n * behind it: the CSS initial value of the property it feeds, or the value that draws nothing.\n * Every Style emits exactly these names, so embeds and hosted pages can rely on each one.\n *\n * Surface variables are `--wistia-kaleidoscope-<surface>-<slot>`. A surface that can sit on several\n * parents is emitted once per parent, as `<surface>-on-<parent>`: `button-primary-on-panel`. Slots\n * are named after the CSS property they feed — `background-color`, `border-radius`, `box-shadow` —\n * with a `-hover` or `-focus` suffix for a state. There are two exceptions: `text-color`,\n * `heading-text-color` and `low-emphasis-text-color` all feed `color`, and a panel's input slots\n * carry an `input-` prefix, as in `input-background-color`.\n *\n * Typography variables are `--wistia-kaleidoscope-type-<role>-<property>`, for the `heading`,\n * `body` and `button` roles.\n */\nexport const KALEIDOSCOPE_CONTRACT: KaleidoscopeVariables = CONTRACT;\n","import type { Color } from '../../../Color';\nimport type { ResolvedFill, TreatmentResult } from '../treatments/types';\nimport type { AnySurfaceSettings } from './types';\nimport { INVERT_BELOW_CONTRAST } from '../constants/color';\nimport { flatFill } from '../treatments/flat';\n\nexport type PaintedPair = {\n readonly text: Color;\n readonly treated: TreatmentResult;\n};\n\n/**\n * `invert: when-indistinct`: if a surface's background fill color is too close to its parent background fill,\n * invert: when-indistinct allows the fill and text color to be inverted. This provides better contrast between the surface\n * and its parent while also preserving legible contrast between the surface and its text color.\n */\nexport const invertWhenIndistinct = (\n { backgroundColor: { invert }, treatment }: AnySurfaceSettings,\n treated: TreatmentResult,\n text: Color,\n parent: ResolvedFill | null,\n): PaintedPair => {\n if (invert !== 'when-indistinct' || treatment !== 'flat' || parent === null) {\n return { text, treated };\n }\n\n const fillContrast = treated.solid.contrast(parent.solid);\n\n return fillContrast < INVERT_BELOW_CONTRAST && text.contrast(parent.solid) > fillContrast\n ? { text: treated.solid, treated: flatFill(text, null, parent) }\n : { text, treated };\n};\n","import type { StyleDocument, SurfaceName } from '../../styleVocabulary';\nimport type { ResolvedAnchors } from './anchors';\nimport type { Slots, VariableName } from './slots';\nimport type { ResolvedFill } from './treatments/types';\nimport { borderSlots } from './rules/border';\nimport { elevationSlots } from './rules/elevation';\nimport { invertWhenIndistinct } from './rules/invert';\nimport { motionSlots } from './rules/motion';\nimport { panelInputSlots } from './rules/panelInput';\nimport { radiusSlots } from './rules/radius';\nimport { hoverTextSlots, resolveTextColor, textSlots } from './rules/text';\nimport { surfaceVariable } from './slots';\nimport { SURFACE_GROUPS, SURFACES } from './surfaces';\nimport { TREATMENT_FUNCTIONS } from './treatments';\n\ntype EvaluatedSurface = ResolvedFill & { readonly slots: Slots };\n\n/**\n * One surface on one parent. A slot a Style doesn't use is left out, so it keeps the contract's\n * initial value.\n */\nconst evaluateSurface = (\n style: StyleDocument,\n surface: SurfaceName,\n anchors: ResolvedAnchors,\n parent: ResolvedFill | null,\n): EvaluatedSurface => {\n const settings = style.surfaces[surface];\n const treatment = TREATMENT_FUNCTIONS[settings.treatment];\n\n if (treatment === undefined) {\n throw new Error(`The engine cannot paint a ${settings.treatment} ${surface} yet`);\n }\n\n const painted = treatment({ anchors, parent, settings, surface });\n const { text, treated } = invertWhenIndistinct(\n settings,\n painted,\n resolveTextColor(settings.textColor, painted.solid, anchors),\n parent,\n );\n const spec = SURFACES[surface];\n const hover = treated.hover(text);\n\n return {\n solid: treated.solid,\n scale: treated.scale,\n slots: {\n ...treated.fill,\n ...(spec.interactive\n ? { ...hover.slots, ...hoverTextSlots(surface, text, hover.solid) }\n : {}),\n ...textSlots(surface, text),\n ...(spec.mayContainForm ? panelInputSlots(treated.solid, anchors) : {}),\n ...borderSlots(settings.border, treated.solid, anchors),\n ...elevationSlots(settings.elevation),\n ...radiusSlots(surface, settings.radius, anchors),\n ...motionSlots(settings.motion),\n },\n };\n};\n\n/**\n * Evaluates every surface group parents first, so each surface knows the fill it sits on, and\n * names each slot after its group.\n */\nexport const evaluateSurfaces = (\n style: StyleDocument,\n anchors: ResolvedAnchors,\n): Readonly<Record<VariableName, string>> => {\n const containers = new Map<SurfaceName, ResolvedFill>();\n const variables: Record<VariableName, string> = {};\n\n for (const { parent, prefix, surface } of SURFACE_GROUPS) {\n const evaluated = evaluateSurface(\n style,\n surface,\n anchors,\n parent === null ? null : (containers.get(parent) ?? null),\n );\n\n // A surface on several parents is never a container itself, so the last one evaluated is fine.\n containers.set(surface, evaluated);\n\n for (const [slot, value] of Object.entries(evaluated.slots)) {\n variables[surfaceVariable(prefix, slot)] = value;\n }\n }\n\n return variables;\n};\n","import type { FindGaps } from './types';\n\n/** No textures yet, so no texture slots: the Style that first uses one adds them. */\nexport const textureGaps: FindGaps = ({ texture: { kind } }) =>\n kind === 'none' ? [] : [`texture.kind: ${kind}`];\n","import type { StyleDocument } from '../../styleVocabulary';\nimport type { FindGaps } from './rules/types';\nimport { SURFACE_NAMES } from '../../styleVocabulary';\nimport { borderGaps } from './rules/border';\nimport { elevationGaps } from './rules/elevation';\nimport { fillGaps } from './rules/fill';\nimport { motionGaps } from './rules/motion';\nimport { textGaps } from './rules/text';\nimport { textureGaps } from './rules/texture';\n\nconst GAP_FINDERS: readonly FindGaps[] = [\n fillGaps,\n textGaps,\n borderGaps,\n elevationGaps,\n motionGaps,\n textureGaps,\n];\n\n/** The rules in `style` the engine cannot resolve yet, as `<surface>.<setting>: <value>`. */\nexport const findUnsupportedRules = (style: StyleDocument): readonly string[] =>\n SURFACE_NAMES.flatMap((surface) =>\n GAP_FINDERS.flatMap((findGaps) => findGaps(style.surfaces[surface])).map(\n (gap) => `${surface}.${gap}`,\n ),\n );\n\n/**\n * Whether the engine resolves every rule `style` uses. The contract test and the Storybook's\n * engine-backed Styles both come from this, so a Style switches over as soon as the engine covers\n * it.\n */\nexport const isSupportedStyle = (style: StyleDocument): boolean =>\n findUnsupportedRules(style).length === 0;\n","import type { BrandTokens } from './brandTokens';\nimport type { KaleidoscopeVariables } from './kaleidoscopeContract';\nimport type { StyleDocument } from './styleVocabulary';\nimport { KALEIDOSCOPE_CONTRACT } from './kaleidoscopeContract';\nimport { resolveAnchors } from './private/engine/anchors';\nimport { evaluateSurfaces } from './private/engine/evaluateSurfaces';\nimport { typographyVariables } from './private/engine/rules/typography';\nimport { findUnsupportedRules } from './private/engine/support';\n\nconst resolveAgainstDefaultValues = (resolved: KaleidoscopeVariables): KaleidoscopeVariables => ({\n ...KALEIDOSCOPE_CONTRACT,\n ...resolved,\n});\n\n/**\n * Resolves a Style against a Brand Kit into the `--wistia-kaleidoscope-*` variables that style an\n * embed or hosted page. The record always holds every name in {@link KALEIDOSCOPE_CONTRACT}.\n *\n * A Brand Kit token the Style references but `brandTokens` leaves out takes its default from\n * `DEFAULT_BRAND_TOKENS`.\n *\n * @throws when the Style uses a rule the engine cannot resolve yet, or references a token that is\n * not a Brand Kit token.\n *\n * @example\n * ```ts\n * const variables = getKaleidoscopeStyles(OPAQUE_MINIMAL, { primaryColor: '#5b4cf0' });\n * variables['--wistia-kaleidoscope-button-primary-on-page-background-color']; // '#5b4cf0'\n * ```\n */\nexport const getKaleidoscopeStyles = (\n style: StyleDocument,\n brandTokens: BrandTokens = {},\n): KaleidoscopeVariables => {\n const unsupported = findUnsupportedRules(style);\n\n if (unsupported.length > 0) {\n throw new Error(`The engine cannot resolve \"${style.id}\" yet: ${unsupported.join(', ')}`);\n }\n\n const anchors = resolveAnchors(style, brandTokens);\n\n return resolveAgainstDefaultValues({\n ...evaluateSurfaces(style, anchors),\n ...typographyVariables(style, anchors),\n });\n};\n","import type { KaleidoscopeVariables } from './kaleidoscopeContract';\nimport { KALEIDOSCOPE_VARIABLE_PREFIX } from './kaleidoscopeContract';\n\nconst NAME_SUFFIX = /^[a-z0-9-]+$/;\n/** Ends the declaration or rule, or the `<style>` element, or escapes what follows, or `!important`. */\nconst UNSAFE_IN_VALUE = /[{};<\\\\!\\p{Cc}]|\\/\\*|\\*\\//u;\nconst UNSAFE_IN_SELECTOR = /[{};<\\\\@\\p{Cc}]|\\/\\*|\\*\\//u;\nconst QUOTED = /\"[^\"]*\"|'[^']*'/g;\nconst CLOSER_OF: Readonly<Record<string, string>> = { '(': ')', '[': ']' };\nconst CLOSERS = new Set(Object.values(CLOSER_OF));\n\n/** An unclosed quote or bracket swallows the declarations and rules after it. */\nconst isBalanced = (text: string): boolean => {\n const unquoted = text.replaceAll(QUOTED, '');\n const expected: string[] = [];\n\n if (/[\"']/.test(unquoted)) {\n return false;\n }\n\n for (const char of unquoted) {\n const closer = CLOSER_OF[char];\n\n if (closer !== undefined) {\n expected.push(closer);\n } else if (CLOSERS.has(char) && expected.pop() !== char) {\n return false;\n }\n }\n\n return expected.length === 0;\n};\n\nconst assertSafe = (label: string, text: string, unsafe: RegExp): void => {\n if (text.trim() === '' || unsafe.test(text) || !isBalanced(text)) {\n throw new Error(`Cannot serialize ${label} safely: ${JSON.stringify(text)}`);\n }\n};\n\nconst assertName = (name: string): void => {\n if (\n !name.startsWith(KALEIDOSCOPE_VARIABLE_PREFIX) ||\n !NAME_SUFFIX.test(name.slice(KALEIDOSCOPE_VARIABLE_PREFIX.length))\n ) {\n throw new Error(`Cannot serialize variable name safely: ${JSON.stringify(name)}`);\n }\n};\n\n/**\n * Writes the record from `getKaleidoscopeStyles()` as a CSS rule, for a server-rendered `<style>`\n * or for injecting at runtime.\n *\n * Text that could leave its declaration, its rule or the `<style>` element is refused rather than\n * escaped. The engine's own values never need it, so such text is a font family from a Brand Kit\n * that should not reach the page, and an escaped version would no longer name a real font.\n *\n * @throws when `selector`, a variable name or a value is unsafe. Callers rendering customer Brand\n * Kits should catch this and fall back.\n *\n * @example\n * ```ts\n * serializeKaleidoscopeStyles(getKaleidoscopeStyles(OPAQUE_MINIMAL), '.my-scope');\n * // '.my-scope {\\n --wistia-kaleidoscope-page-background-color: #ffffff;\\n …\\n}'\n * ```\n */\nexport const serializeKaleidoscopeStyles = (\n variables: KaleidoscopeVariables,\n selector: string,\n): string => {\n assertSafe('selector', selector, UNSAFE_IN_SELECTOR);\n\n const declarations = Object.entries(variables).map(([name, value]) => {\n assertName(name);\n assertSafe(`the value of ${name}`, value, UNSAFE_IN_VALUE);\n\n return ` ${name}: ${value};`;\n });\n\n return `${selector} {\\n${declarations.join('\\n')}\\n}`;\n};\n"],"mappings":";;;;;;;;;;;;;;AACA,MAAa,oBAAoB;CAC/B;CACA;CACA;CACA;CACA;CACA;AACF;;AAoBA,MAAa,uBAA8C;CACzD,cAAc;CACd,qBAAqB;CACrB,cAAc;CACd,mBAAmB;CACnB,gBAAgB;CAChB,kBAAkB;AACpB;;;AC/BA,MAAa,uBAAuB;CAClC,MAAM;CACN,WAAW;CACX,OAAO;CACP,eAAe;AACjB;;AAMA,MAAa,wBAAwB,2BAA2B;;AAGhE,MAAa,0BAA0B;;ACVvC,MAAM,oBAAoB;AAC1B,MAAM,6BAAa,IAAI,IAAmB;;AAG1C,MAAa,WAAW,UAAwB;CAC9C,MAAM,MAAM,MAAM,MAAM;CACxB,IAAI,QAAQ,WAAW,IAAI,GAAG;CAE9B,IAAI,UAAU,KAAA,GAAW;EACvB,IAAI,WAAW,QAAQ,mBACrB,WAAW,MAAM;EAGnB,QAAQ,uBAAuB,IAAI,MAAM,GAAG,CAAC;EAC7C,WAAW,IAAI,KAAK,KAAK;CAC3B;CAEA,OAAO;AACT;AAEA,MAAM,YAAY,UAAyB,MAAM,QAAQ;AAEzD,MAAa,UAAU,OAAc,UACnC,MAAM,OAAO,MAAM,OAAO,GAAG,SAAS,KAAK,CAAC,CAAC;AAE/C,MAAM,eAAe,OAAc,UACjC,MAAM,KAAK,MAAM,MAAM,OAAO,KAAK,CAAC,GAAG,GAAG,SAAS,KAAK,CAAC;;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AAC,KAAK,IAAI,EAAE;AACnD"}
@@ -1,3 +1,3 @@
1
1
 
2
- import { C as RgbaObject, D as colorContrastRatiosByShape, E as ColorShape, S as RgbTuple, T as Color, _ as ColorInput, a as ColorLightnessClassification, b as InterpolationMode, c as getBrandedColorScale, d as BestColorForTextOptions, f as getBestColorForText, g as adjustColorForProperContrast, h as AdjustColorForProperContrastOptions, i as getHeavyAccentedBackgroundColor, l as getBrandLightBackgroundColor, m as ColorScaleOptions, n as getSlightAccentedBackgroundColor, o as getColorLightnessClassification, p as ColorScale, r as HeavyAccentedBackgroundColorOptions, s as BrandColorScaleOptions, t as SlightAccentedBackgroundColorOptions, u as getBrandDarkBackgroundColor, v as ColorTuple, w as RgbaTuple, x as Lab, y as Hsl } from "../color-BD12TVX4.js";
2
+ import { C as RgbaObject, D as colorContrastRatiosByShape, E as ColorShape, S as RgbTuple, T as Color, _ as ColorInput, a as ColorLightnessClassification, b as InterpolationMode, c as getBrandedColorScale, d as BestColorForTextOptions, f as getBestColorForText, g as adjustColorForProperContrast, h as AdjustColorForProperContrastOptions, i as getHeavyAccentedBackgroundColor, l as getBrandLightBackgroundColor, m as ColorScaleOptions, n as getSlightAccentedBackgroundColor, o as getColorLightnessClassification, p as ColorScale, r as HeavyAccentedBackgroundColorOptions, s as BrandColorScaleOptions, t as SlightAccentedBackgroundColorOptions, u as getBrandDarkBackgroundColor, v as ColorTuple, w as RgbaTuple, x as Lab, y as Hsl } from "../color-CwLKMi6Y.js";
3
3
  export { type AdjustColorForProperContrastOptions, type BestColorForTextOptions, type BrandColorScaleOptions, Color, type ColorInput, type ColorLightnessClassification, ColorScale, type ColorScaleOptions, type ColorShape, type ColorTuple, type HeavyAccentedBackgroundColorOptions, type Hsl, type InterpolationMode, type Lab, type RgbTuple, type RgbaObject, type RgbaTuple, type SlightAccentedBackgroundColorOptions, adjustColorForProperContrast, colorContrastRatiosByShape, getBestColorForText, getBrandDarkBackgroundColor, getBrandLightBackgroundColor, getBrandedColorScale, getColorLightnessClassification, getHeavyAccentedBackgroundColor, getSlightAccentedBackgroundColor };
@@ -1,11 +1,12 @@
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 getBrandLightBackgroundColor, c as ColorScale, d as Color, i as getBrandedColorScale, l as adjustColorForProperContrast, n as getHeavyAccentedBackgroundColor, o as getBrandDarkBackgroundColor, r as getColorLightnessClassification, s as getBestColorForText, t as getSlightAccentedBackgroundColor, u as colorContrastRatiosByShape } from "../color-C99gJSgH.js";
10
+ import { c as getBestColorForText, d as colorContrastRatiosByShape, f as Color, l as ColorScale, o as getBrandLightBackgroundColor, s as getBrandDarkBackgroundColor, t as getColorLightnessClassification, u as adjustColorForProperContrast } from "../getColorLightnessClassification--FSkjXEx.js";
11
+ import { n as getHeavyAccentedBackgroundColor, r as getBrandedColorScale, t as getSlightAccentedBackgroundColor } from "../color-BY2NrNVz.js";
11
12
  export { Color, ColorScale, adjustColorForProperContrast, colorContrastRatiosByShape, getBestColorForText, getBrandDarkBackgroundColor, getBrandLightBackgroundColor, getBrandedColorScale, getColorLightnessClassification, getHeavyAccentedBackgroundColor, getSlightAccentedBackgroundColor };
@@ -0,0 +1,3 @@
1
+
2
+ import { a as KaleidoscopeVariables, c as BrandTokenName, i as KaleidoscopeVariableName, l as BrandTokens, n as getKaleidoscopeStyles, o as VARIABLE_PREFIX, r as KALEIDOSCOPE_CONTRACT, s as BRAND_TOKEN_NAMES, t as serializeKaleidoscopeStyles, u as DEFAULT_BRAND_TOKENS } from "../engine-B00ZVZ0d.js";
3
+ export { BRAND_TOKEN_NAMES, type BrandTokenName, type BrandTokens, DEFAULT_BRAND_TOKENS, KALEIDOSCOPE_CONTRACT, VARIABLE_PREFIX as KALEIDOSCOPE_VARIABLE_PREFIX, type KaleidoscopeVariableName, type KaleidoscopeVariables, getKaleidoscopeStyles, serializeKaleidoscopeStyles };
@@ -0,0 +1,10 @@
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
+ export { a as BRAND_TOKEN_NAMES, o as DEFAULT_BRAND_TOKENS, r as KALEIDOSCOPE_CONTRACT, i as KALEIDOSCOPE_VARIABLE_PREFIX, n as getKaleidoscopeStyles, t as serializeKaleidoscopeStyles } from "../engine-DeOUPRa0.js";
@@ -1,3 +1,3 @@
1
1
 
2
- import { a as OPAQUE_BRIGHT, c as BUILT_IN_STYLES, i as OPAQUE_HEAVY, l as AURORA_LIGHT, n as OPAQUE_MEDIUM, o as GLASS_LIGHT, r as OPAQUE_LIGHT, s as GLASS_DARK, t as OPAQUE_MINIMAL, u as AURORA_DARK } from "../styleRegistry-DNVNmafi.js";
3
- export { AURORA_DARK, AURORA_LIGHT, BUILT_IN_STYLES, GLASS_DARK, GLASS_LIGHT, OPAQUE_BRIGHT, OPAQUE_HEAVY, OPAQUE_LIGHT, OPAQUE_MEDIUM, OPAQUE_MINIMAL };
2
+ import { a as OPAQUE_BRIGHT, c as PRE_DEFINED_STYLES, i as OPAQUE_HEAVY, l as AURORA_LIGHT, n as OPAQUE_MEDIUM, o as GLASS_LIGHT, r as OPAQUE_LIGHT, s as GLASS_DARK, t as OPAQUE_MINIMAL, u as AURORA_DARK } from "../styleRegistry-A0nrsHk-.js";
3
+ export { AURORA_DARK, AURORA_LIGHT, PRE_DEFINED_STYLES as BUILT_IN_STYLES, GLASS_DARK, GLASS_LIGHT, OPAQUE_BRIGHT, OPAQUE_HEAVY, OPAQUE_LIGHT, OPAQUE_MEDIUM, OPAQUE_MINIMAL };
@@ -1,11 +1,10 @@
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 OPAQUE_HEAVY, c as GLASS_DARK, i as OPAQUE_LIGHT, l as AURORA_LIGHT, n as OPAQUE_MINIMAL, o as OPAQUE_BRIGHT, r as OPAQUE_MEDIUM, s as GLASS_LIGHT, t as BUILT_IN_STYLES, u as AURORA_DARK } from "../styleRegistry-BoviV8Ue.js";
11
- export { AURORA_DARK, AURORA_LIGHT, BUILT_IN_STYLES, GLASS_DARK, GLASS_LIGHT, OPAQUE_BRIGHT, OPAQUE_HEAVY, OPAQUE_LIGHT, OPAQUE_MEDIUM, OPAQUE_MINIMAL };
10
+ export { u as AURORA_DARK, l as AURORA_LIGHT, t as BUILT_IN_STYLES, c as GLASS_DARK, s as GLASS_LIGHT, o as OPAQUE_BRIGHT, a as OPAQUE_HEAVY, i as OPAQUE_LIGHT, r as OPAQUE_MEDIUM, n as OPAQUE_MINIMAL } from "../styleRegistry-CT4jvu4h.js";
@@ -1,3 +1,3 @@
1
1
 
2
- import { a as StyleDocumentReport, i as StyleDocumentIssue, n as isStyleDocument, r as validateStyleDocument, t as checkStyleDocument } from "../validate-V28YRNxt.js";
2
+ import { a as StyleDocumentReport, i as StyleDocumentIssue, n as isStyleDocument, r as validateStyleDocument, t as checkStyleDocument } from "../validate-Bqx__f3d.js";
3
3
  export { type StyleDocumentIssue, type StyleDocumentReport, checkStyleDocument, isStyleDocument, validateStyleDocument };
@@ -1,11 +1,10 @@
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 { n as isStyleDocument, r as validateStyleDocument, t as checkStyleDocument } from "../validate-C_h6gEXp.js";
11
- export { checkStyleDocument, isStyleDocument, validateStyleDocument };
10
+ export { t as checkStyleDocument, n as isStyleDocument, r as validateStyleDocument } from "../validate-D-OR7_3g.js";
@@ -1,3 +1,3 @@
1
1
 
2
- import { $ as OffsetOrigin, A as MOTION_SPEEDS, At as GradientDirection, B as ElevationColorSourceKeyword, Bt as COLOR_TONES, C as TextureKind, Ct as SingleColorAnchorRef, D as RadiusSource, Dt as GRADIENT_EXTENTS, E as Radius, Et as GRADIENT_DIRECTIONS, F as ELEVATION_COLOR_SOURCE_KEYWORDS, Ft as GradientStops, G as BorderSource, Gt as FontStack, H as ElevationHardness, Ht as ColorScaleOffset, I as ELEVATION_DEPTHS, It as MAX_GRADIENT_STOPS, J as BackgroundColor, Jt as LiteralColor, K as BorderStyle, Kt as GENERIC_FONT_FAMILIES, L as ELEVATION_HARDNESSES, Lt as MIN_GRADIENT_STOPS, M as MotionSpeed, Mt as GradientPosition, N as TRANSITIONS, Nt as GradientShape, O as AMBIENT_MOTIONS, Ot as GRADIENT_POSITIONS, P as Transition, Pt as GradientShapeOption, Q as OFFSET_ORIGINS, R as Elevation, Rt as BrandKitTokenRef, S as TextureIntensity, St as SingleColorAnchorName, T as TextColorPreference, Tt as Treatment, U as BORDER_STYLES, Ut as ColorTone, V as ElevationDepth, Vt as ColorRelationship, W as Border, Wt as Dimension, X as INVERT_RULES, Xt as RelatedColor, Y as BackgroundSource, Yt as MAX_COLOR_SCALE_OFFSET, Z as InvertRule, Zt as SingleColor, _ as SurfaceSettings, _t as REQUIRED_FONT_ANCHORS, a as TypeCase, at as COLOR_ANCHOR_NAMES, b as TEXTURE_KINDS, bt as RequiredFontAnchor, c as Typography, ct as ColorAnchors, d as OptionalSettingName, dt as FontAnchorRef, et as ANCHORS_REQUIRED_BY_TREATMENT, f as REQUIRED_SETTING_NAMES, ft as FontAnchors, g as SurfaceName, gt as REQUIRED_DIMENSION_ANCHORS, h as SURFACE_NAMES, ht as REQUIRED_COLOR_ANCHORS, i as TYPE_ROLES, it as Anchors, j as Motion, jt as GradientExtent, k as AmbientMotion, kt as GRADIENT_SHAPE_OPTIONS, l as ALL_SETTING_NAMES, lt as DimensionAnchorRef, m as STACKABLE_ON, mt as OptionalColorAnchor, n as StyleDocument, nt as ANCHOR_REF_PREFIX, o as TypeRole, ot as ColorAnchorName, p as RequiredSettingName, pt as OPTIONAL_COLOR_ANCHORS, q as ORNAMENTAL_BORDER_STYLES, qt as GenericFontFamily, r as TYPE_CASES, rt as AnchorGroup, s as TypeRoleName, st as ColorAnchorRef, t as DOCUMENT_KEYS, tt as ANCHOR_GROUPS, u as OPTIONAL_SETTING_NAMES, ut as DimensionAnchors, v as Surfaces, vt as RequiredColorAnchor, w as TextColor, wt as TREATMENTS, x as Texture, xt as SINGLE_COLOR_ANCHOR_NAMES, y as TEXTURE_INTENSITIES, yt as RequiredDimensionAnchor, z as ElevationColorSource, zt as COLOR_RELATIONSHIPS } from "../index-CG6dL9XZ.js";
2
+ import { $ as OffsetOrigin, A as MOTION_SPEEDS, At as GradientDirection, B as ElevationColorSourceKeyword, Bt as COLOR_TONES, C as TextureKind, Ct as SingleColorAnchorRef, D as RadiusSource, Dt as GRADIENT_EXTENTS, E as Radius, Et as GRADIENT_DIRECTIONS, F as ELEVATION_COLOR_SOURCE_KEYWORDS, Ft as GradientStops, G as BorderSource, Gt as FontStack, H as ElevationHardness, Ht as ColorScaleOffset, I as ELEVATION_DEPTHS, It as MAX_GRADIENT_STOPS, J as BackgroundColor, Jt as LiteralColor, K as BorderStyle, Kt as GENERIC_FONT_FAMILIES, L as ELEVATION_HARDNESSES, Lt as MIN_GRADIENT_STOPS, M as MotionSpeed, Mt as GradientPosition, N as TRANSITIONS, Nt as GradientShape, O as AMBIENT_MOTIONS, Ot as GRADIENT_POSITIONS, P as Transition, Pt as GradientShapeOption, Q as OFFSET_ORIGINS, R as Elevation, Rt as BrandKitTokenRef, S as TextureIntensity, St as SingleColorAnchorName, T as TextColorPreference, Tt as Treatment, U as BORDER_STYLES, Ut as ColorTone, V as ElevationDepth, Vt as ColorRelationship, W as Border, Wt as Dimension, X as INVERT_RULES, Xt as RelatedColor, Y as BackgroundSource, Yt as MAX_COLOR_SCALE_OFFSET, Z as InvertRule, Zt as SingleColor, _ as SurfaceSettings, _t as REQUIRED_FONT_ANCHORS, a as TypeCase, at as COLOR_ANCHOR_NAMES, b as TEXTURE_KINDS, bt as RequiredFontAnchor, c as Typography, ct as ColorAnchors, d as OptionalSettingName, dt as FontAnchorRef, et as ANCHORS_REQUIRED_BY_TREATMENT, f as REQUIRED_SETTING_NAMES, ft as FontAnchors, g as SurfaceName, gt as REQUIRED_DIMENSION_ANCHORS, h as SURFACE_NAMES, ht as REQUIRED_COLOR_ANCHORS, i as TYPE_ROLES, it as Anchors, j as Motion, jt as GradientExtent, k as AmbientMotion, kt as GRADIENT_SHAPE_OPTIONS, l as ALL_SETTING_NAMES, lt as DimensionAnchorRef, m as STACKABLE_ON, mt as OptionalColorAnchor, n as StyleDocument, nt as ANCHOR_REF_PREFIX, o as TypeRole, ot as ColorAnchorName, p as RequiredSettingName, pt as OPTIONAL_COLOR_ANCHORS, q as ORNAMENTAL_BORDER_STYLES, qt as GenericFontFamily, r as TYPE_CASES, rt as AnchorGroup, s as TypeRoleName, st as ColorAnchorRef, t as DOCUMENT_KEYS, tt as ANCHOR_GROUPS, u as OPTIONAL_SETTING_NAMES, ut as DimensionAnchors, v as Surfaces, vt as RequiredColorAnchor, w as TextColor, wt as TREATMENTS, x as Texture, xt as SINGLE_COLOR_ANCHOR_NAMES, y as TEXTURE_INTENSITIES, yt as RequiredDimensionAnchor, z as ElevationColorSource, zt as COLOR_RELATIONSHIPS } from "../index-BOJCY_MU.js";
3
3
  export { ALL_SETTING_NAMES, AMBIENT_MOTIONS, ANCHORS_REQUIRED_BY_TREATMENT, ANCHOR_GROUPS, ANCHOR_REF_PREFIX, type AmbientMotion, type AnchorGroup, type Anchors, BORDER_STYLES, type BackgroundColor, type BackgroundSource, type Border, type BorderSource, type BorderStyle, type BrandKitTokenRef, COLOR_ANCHOR_NAMES, COLOR_RELATIONSHIPS, COLOR_TONES, type ColorAnchorName, type ColorAnchorRef, type ColorAnchors, type ColorRelationship, type ColorScaleOffset, type ColorTone, DOCUMENT_KEYS, type Dimension, type DimensionAnchorRef, type DimensionAnchors, ELEVATION_COLOR_SOURCE_KEYWORDS, ELEVATION_DEPTHS, ELEVATION_HARDNESSES, type Elevation, type ElevationColorSource, type ElevationColorSourceKeyword, type ElevationDepth, type ElevationHardness, type FontAnchorRef, type FontAnchors, type FontStack, GENERIC_FONT_FAMILIES, GRADIENT_DIRECTIONS, GRADIENT_EXTENTS, GRADIENT_POSITIONS, GRADIENT_SHAPE_OPTIONS, type GenericFontFamily, type GradientDirection, type GradientExtent, type GradientPosition, type GradientShape, type GradientShapeOption, type GradientStops, INVERT_RULES, type InvertRule, type LiteralColor, MAX_COLOR_SCALE_OFFSET, MAX_GRADIENT_STOPS, MIN_GRADIENT_STOPS, MOTION_SPEEDS, type Motion, type MotionSpeed, OFFSET_ORIGINS, OPTIONAL_COLOR_ANCHORS, OPTIONAL_SETTING_NAMES, ORNAMENTAL_BORDER_STYLES, type OffsetOrigin, type OptionalColorAnchor, type OptionalSettingName, REQUIRED_COLOR_ANCHORS, REQUIRED_DIMENSION_ANCHORS, REQUIRED_FONT_ANCHORS, REQUIRED_SETTING_NAMES, type Radius, type RadiusSource, type RelatedColor, type RequiredColorAnchor, type RequiredDimensionAnchor, type RequiredFontAnchor, type RequiredSettingName, SINGLE_COLOR_ANCHOR_NAMES, STACKABLE_ON, SURFACE_NAMES, type SingleColor, type SingleColorAnchorName, type SingleColorAnchorRef, type StyleDocument, type SurfaceName, type SurfaceSettings, type Surfaces, TEXTURE_INTENSITIES, TEXTURE_KINDS, TRANSITIONS, TREATMENTS, TYPE_CASES, TYPE_ROLES, type TextColor, type TextColorPreference, type Texture, type TextureIntensity, type TextureKind, type Transition, type Treatment, type TypeCase, type TypeRole, type TypeRoleName, type Typography };
@@ -1,11 +1,12 @@
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, T as ORNAMENTAL_BORDER_STYLES, _ as GRADIENT_POSITIONS, a as TEXTURE_INTENSITIES, b as MIN_GRADIENT_STOPS, c as OPTIONAL_SETTING_NAMES, d as SURFACE_NAMES, f as AMBIENT_MOTIONS, g as GRADIENT_EXTENTS, h as GRADIENT_DIRECTIONS, i as TREATMENTS, j as MAX_COLOR_SCALE_OFFSET, k as COLOR_TONES, l as REQUIRED_SETTING_NAMES, 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, y as MAX_GRADIENT_STOPS, z as REQUIRED_FONT_ANCHORS } from "../styleVocabulary-Kl8p6TDk.js";
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, S as MAX_COLOR_SCALE_OFFSET, 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, f as MAX_GRADIENT_STOPS, 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, p as MIN_GRADIENT_STOPS, 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 { a as REQUIRED_SETTING_NAMES, c as BORDER_STYLES, i as OPTIONAL_SETTING_NAMES, l as ORNAMENTAL_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";
11
12
  export { ALL_SETTING_NAMES, AMBIENT_MOTIONS, ANCHORS_REQUIRED_BY_TREATMENT, ANCHOR_GROUPS, ANCHOR_REF_PREFIX, BORDER_STYLES, COLOR_ANCHOR_NAMES, COLOR_RELATIONSHIPS, COLOR_TONES, DOCUMENT_KEYS, ELEVATION_COLOR_SOURCE_KEYWORDS, ELEVATION_DEPTHS, ELEVATION_HARDNESSES, GENERIC_FONT_FAMILIES, GRADIENT_DIRECTIONS, GRADIENT_EXTENTS, GRADIENT_POSITIONS, GRADIENT_SHAPE_OPTIONS, INVERT_RULES, MAX_COLOR_SCALE_OFFSET, MAX_GRADIENT_STOPS, MIN_GRADIENT_STOPS, MOTION_SPEEDS, OFFSET_ORIGINS, OPTIONAL_COLOR_ANCHORS, OPTIONAL_SETTING_NAMES, ORNAMENTAL_BORDER_STYLES, REQUIRED_COLOR_ANCHORS, REQUIRED_DIMENSION_ANCHORS, REQUIRED_FONT_ANCHORS, REQUIRED_SETTING_NAMES, SINGLE_COLOR_ANCHOR_NAMES, STACKABLE_ON, SURFACE_NAMES, TEXTURE_INTENSITIES, TEXTURE_KINDS, TRANSITIONS, TREATMENTS, TYPE_CASES, TYPE_ROLES };
@@ -1,17 +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
- //#region src/private/clamp.ts
10
+ // src/private/clamp.ts
11
11
  /** Restrict `value` to the inclusive range between `min` and `max`. */
12
12
  const clamp = (value, min, max) => Math.min(Math.max(value, min), max);
13
- //#endregion
14
- //#region src/private/colorSpace.ts
13
+ // src/private/colorSpace.ts
15
14
  const D65_WHITE_POINT = {
16
15
  x: .95047,
17
16
  y: 1,
@@ -184,8 +183,7 @@ const labToRgb = ({ a, b, lightness }) => {
184
183
  compand(.0556434 * x - .2040259 * y + 1.0572252 * z)
185
184
  ];
186
185
  };
187
- //#endregion
188
- //#region src/private/parseColor.ts
186
+ // src/private/parseColor.ts
189
187
  const HEX_PATTERN = /^#?([\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$/i;
190
188
  const RGB_FUNCTION_PATTERN = /^rgba?\(([^)]*)\)$/i;
191
189
  const NUMBER_PATTERN = /^[+-]?(?:\d+\.?\d*|\.\d+)$/;
@@ -292,14 +290,13 @@ const parseColor = (input) => {
292
290
  toAlpha(a)
293
291
  ];
294
292
  };
295
- //#endregion
296
- //#region src/Color.ts
293
+ // src/Color.ts
297
294
  const HEX_RADIX = 16;
298
295
  /** The ends of the OKLab lightness axis: white and black. */
299
296
  const MAX_LIGHTNESS = 1;
300
297
  const MIN_LIGHTNESS = 0;
301
298
  const DEFAULT_INTERPOLATION_MODE = "oklch";
302
- const WHITE$3 = "#ffffff";
299
+ const WHITE$2 = "#ffffff";
303
300
  const BLACK$2 = "#000000";
304
301
  /** Wistia brand blue (`#2949e5`) — what an unreadable input resolves to. */
305
302
  const FALLBACK_CHANNELS = [
@@ -465,7 +462,7 @@ var Color = class Color {
465
462
  }
466
463
  /** Mix `ratio` (0–1) of white in. */
467
464
  tint(ratio, mode = DEFAULT_INTERPOLATION_MODE) {
468
- return this.blend(WHITE$3, ratio, mode);
465
+ return this.blend(WHITE$2, ratio, mode);
469
466
  }
470
467
  /** Mix `ratio` (0–1) of black in. */
471
468
  shade(ratio, mode = DEFAULT_INTERPOLATION_MODE) {
@@ -552,16 +549,14 @@ var Color = class Color {
552
549
  ]);
553
550
  }
554
551
  };
555
- //#endregion
556
- //#region src/colorContrastRatiosByShape.ts
552
+ // src/colorContrastRatiosByShape.ts
557
553
  const colorContrastRatiosByShape = {
558
554
  nonText: 3,
559
555
  largeText: 3,
560
556
  paragraphText: 4.5,
561
557
  smallText: 5.5
562
558
  };
563
- //#endregion
564
- //#region src/private/preciseContrast.ts
559
+ // src/private/preciseContrast.ts
565
560
  /**
566
561
  * The WCAG contrast ratio between two colors at full precision, unlike
567
562
  * {@link Color.contrast}, which truncates to one decimal.
@@ -576,9 +571,8 @@ const preciseContrast = (color, other) => {
576
571
  const otherLuminance = other.luminance();
577
572
  return (Math.max(ownLuminance, otherLuminance) + .05) / (Math.min(ownLuminance, otherLuminance) + .05);
578
573
  };
579
- //#endregion
580
- //#region src/adjustColorForProperContrast.ts
581
- const WHITE$2 = "#ffffff";
574
+ // src/adjustColorForProperContrast.ts
575
+ const WHITE$1 = "#ffffff";
582
576
  const BLACK$1 = "#000000";
583
577
  /** One HSL lightness percentage point — the step the search walks the foreground by. */
584
578
  const LIGHTNESS_STEP = 1;
@@ -638,7 +632,7 @@ const adjustColorForProperContrast = ({ backgroundColor, foregroundColor, shape
638
632
  const luminance = adjusted.luminance();
639
633
  if (iteration > 0 && (luminance === MAX_LUMINANCE || luminance === MIN_LUMINANCE)) {
640
634
  if (requiredContrast > colorContrastRatiosByShape.nonText) {
641
- const white = new Color(WHITE$2);
635
+ const white = new Color(WHITE$1);
642
636
  const black = new Color(BLACK$1);
643
637
  return white.contrast(background) > black.contrast(background) ? white : black;
644
638
  }
@@ -654,8 +648,7 @@ const adjustColorForProperContrast = ({ backgroundColor, foregroundColor, shape
654
648
  }
655
649
  return adjusted;
656
650
  };
657
- //#endregion
658
- //#region src/ColorScale.ts
651
+ // src/ColorScale.ts
659
652
  const DEFAULT_DOMAIN = [0, 1];
660
653
  const DEFAULT_MODE = "lrgb";
661
654
  const DEFAULT_PADDING = [0, 0];
@@ -861,9 +854,8 @@ var ColorScale = class ColorScale {
861
854
  return stops[0].color;
862
855
  }
863
856
  };
864
- //#endregion
865
- //#region src/getBestColorForText.ts
866
- const WHITE$1 = "#ffffff";
857
+ // src/getBestColorForText.ts
858
+ const WHITE = "#ffffff";
867
859
  const BLACK = "#000000";
868
860
  /**
869
861
  * Picks a color most suitable for a given text (or non-text) shape against the given background color.
@@ -878,16 +870,16 @@ const BLACK = "#000000";
878
870
  const getBestColorForText = ({ backgroundColor, exclude = [], palette = [], shape = "paragraphText" }) => {
879
871
  const background = new Color(backgroundColor);
880
872
  const requiredContrast = colorContrastRatiosByShape[shape];
881
- const excluded = new Set([...exclude, background].map((color) => new Color(color).toHex()).filter((hex) => hex !== WHITE$1 && hex !== BLACK));
873
+ const excluded = new Set([...exclude, background].map((color) => new Color(color).toHex()).filter((hex) => hex !== WHITE && hex !== BLACK));
882
874
  const candidates = [...new Map([
883
- WHITE$1,
875
+ WHITE,
884
876
  BLACK,
885
877
  ...palette
886
878
  ].map((color) => {
887
879
  const candidate = new Color(color);
888
880
  return [candidate.toHex(), candidate];
889
881
  })).values()].filter((color) => !excluded.has(color.toHex()));
890
- const white = new Color(WHITE$1);
882
+ const white = new Color(WHITE);
891
883
  const black = new Color(BLACK);
892
884
  const ranked = candidates.map((color) => ({
893
885
  color,
@@ -898,8 +890,7 @@ const getBestColorForText = ({ backgroundColor, exclude = [], palette = [], shap
898
890
  const isPreferredSide = (color) => prefersLighterText ? color.luminance() >= backgroundLuminance : color.luminance() <= backgroundLuminance;
899
891
  return ranked.filter(({ color }) => color.contrast(background) >= requiredContrast).find(({ color }) => isPreferredSide(color))?.color ?? (prefersLighterText ? white : black);
900
892
  };
901
- //#endregion
902
- //#region src/getBrandDarkBackgroundColor.ts
893
+ // src/getBrandDarkBackgroundColor.ts
903
894
  const MAX_PAGE_SATURATION = 50;
904
895
  const ALMOST_BLACK$1 = 5;
905
896
  const ALMOST_WHITE$1 = 95;
@@ -935,8 +926,7 @@ const getBrandDarkBackgroundColor = (_primaryColor) => {
935
926
  }
936
927
  return backgroundColorWithIncreasedContrast;
937
928
  };
938
- //#endregion
939
- //#region src/getBrandLightBackgroundColor.ts
929
+ // src/getBrandLightBackgroundColor.ts
940
930
  /** Enough saturation for the brand hue to register, for a primary that has barely any. */
941
931
  const MIN_SATURATION = 5;
942
932
  /** HSL lightness bands where a primary is close enough to an extreme to have no usable hue. */
@@ -963,6 +953,11 @@ const getBrandLightBackgroundColor = (_primaryColor) => {
963
953
  saturation: targetSaturation
964
954
  }, derived.a);
965
955
  };
956
+ // src/private/maxChroma.ts
957
+ /**
958
+ * Below this a color has no perceptible hue.
959
+ */
960
+ const ACHROMATIC_CHROMA = 1e-4;
966
961
  /**
967
962
  * More chroma than sRGB holds anywhere. The widest point is magenta at 0.32
968
963
  */
@@ -981,8 +976,7 @@ const maxChroma = (lightness, hue) => {
981
976
  });
982
977
  return rgbToOklch(red, green, blue).chroma;
983
978
  };
984
- //#endregion
985
- //#region src/private/perceivedLightness.ts
979
+ // src/private/perceivedLightness.ts
986
980
  /**
987
981
  * Flare is the ambient light reflecting off a screen, as defined by WCAG guidelines.
988
982
  * See https://www.w3.org/WAI/WCAG22/Understanding/contrast-minimum
@@ -1162,30 +1156,7 @@ const buildBrandedColorScale = (primary, options = {}) => {
1162
1156
  steps
1163
1157
  };
1164
1158
  };
1165
- //#endregion
1166
- //#region src/getBrandedColorScale.ts
1167
- /**
1168
- * Builds a color scale using the derived light/dark background colors based on the given primary color,
1169
- * with the primary color slotted into the scale wherever it fits based on lightness.
1170
- *
1171
- * It's important to include the primary color in the scale because the light/dark derived background colors
1172
- * do not have the same saturation as the primary color, and we want the scale to reflect the vibrancy
1173
- * of the primary color.
1174
- *
1175
- * @example
1176
- * ```ts
1177
- * getBrandedColorScale('#2949e5').map((color) => color.toHex());
1178
- * // ['#ebeefd', '#d4dbfa', '#bdc8f7', '#a5b5f4', '#8da2f1', '#748eef',
1179
- * // '#5b7aec', '#4263e8', '#2949e5', '#2539ba', '#213080', '#171f45']
1180
- * // ^ the primary, at its own lightness
1181
- * ```
1182
- */
1183
- const getBrandedColorScale = (primaryColor, { steps = 12 } = {}) => {
1184
- const scale = buildBrandedColorScale(new Color(primaryColor), { steps });
1185
- return Array.from({ length: steps }, (_, index) => scale.atStep(index));
1186
- };
1187
- //#endregion
1188
- //#region src/getColorLightnessClassification.ts
1159
+ // src/getColorLightnessClassification.ts
1189
1160
  /**
1190
1161
  * The WCAG value for typical ambient light causing flare on a screen
1191
1162
  * https://www.w3.org/WAI/WCAG22/Understanding/contrast-minimum
@@ -1223,126 +1194,6 @@ const getColorLightnessClassification = (color) => {
1223
1194
  if (luminance < DARK_MAX) return "dark";
1224
1195
  return luminance < LIGHT_MIN ? "midtone" : "light";
1225
1196
  };
1226
- //#endregion
1227
- //#region src/private/getAccentedBackgroundByLightness.ts
1228
- const STEP_SIZE_IN_LIGHTNESS = .86 / 11;
1229
- /**
1230
- * Move the background color by the given distance to generate an accented background color.
1231
- * This is used when no primary color has been provided, meaning the background color was not derived from the primary color.
1232
- * The size of the steps used by this utility should match the size of the steps used in the
1233
- * corresponding {@link getBackgroundAccentFromPrimaryColor} utility.
1234
- */
1235
- const getAccentedBackgroundByLightness = (backgroundColor, distanceInSteps) => {
1236
- const { chroma, hue, lightness } = rgbToOklch(backgroundColor.r, backgroundColor.g, backgroundColor.b);
1237
- const maxPossibleChroma = maxChroma(lightness, hue);
1238
- const share = chroma < 1e-4 || maxPossibleChroma < 1e-4 ? 0 : Math.min(1, chroma / maxPossibleChroma);
1239
- const atLightness = (candidate) => {
1240
- const [red, green, blue] = oklchToRgb({
1241
- chroma: share * maxChroma(candidate, hue),
1242
- hue,
1243
- lightness: candidate
1244
- });
1245
- return new Color([
1246
- red,
1247
- green,
1248
- blue,
1249
- backgroundColor.a
1250
- ]);
1251
- };
1252
- const band = getColorLightnessClassification(backgroundColor);
1253
- const towards = band === "dark" || band === "veryDark" ? 1 : -1;
1254
- const target = clamp(perceivedLightness(backgroundColor) + towards * distanceInSteps * STEP_SIZE_IN_LIGHTNESS, 0, 1);
1255
- let low = 0;
1256
- let high = 1;
1257
- for (let iteration = 0; iteration < 30; iteration += 1) {
1258
- const middle = (low + high) / 2;
1259
- if (perceivedLightness(atLightness(middle)) < target) low = middle;
1260
- else high = middle;
1261
- }
1262
- return atLightness((low + high) / 2);
1263
- };
1264
- //#endregion
1265
- //#region src/private/getBackgroundAccentFromPrimaryColor.ts
1266
- /**
1267
- * Using a branded color scale based on the primary color,
1268
- * move the given background color by the given distance along the scale
1269
- * to generate an accented version of the background color.
1270
- */
1271
- const getBackgroundAccentFromPrimaryColor = (backgroundColor, stepDistance, primaryColor) => {
1272
- const scale = buildBrandedColorScale(primaryColor);
1273
- const last = scale.steps - 1;
1274
- const colorLightnessClass = getColorLightnessClassification(backgroundColor);
1275
- const towards = colorLightnessClass === "dark" || colorLightnessClass === "veryDark" ? -stepDistance : stepDistance;
1276
- const from = clamp(Math.round(scale.stepOf(backgroundColor)), 0, last);
1277
- return scale.atStep(clamp(from + towards, 0, last));
1278
- };
1279
- //#endregion
1280
- //#region src/private/getAccentedBackground.ts
1281
- /**
1282
- * A background `distance` steps off `background`, always in the direction away from it:
1283
- * darker when the background is light, lighter when it is dark.
1284
- *
1285
- * Gets a an accented color spaced apart from the given background color by the given distance.
1286
- * If a primary color is included, we will derive the accent color using a color scale.
1287
- */
1288
- const getAccentedBackground = ({ backgroundColor, stepDistance, primaryColor }) => primaryColor === void 0 ? getAccentedBackgroundByLightness(backgroundColor, stepDistance) : getBackgroundAccentFromPrimaryColor(backgroundColor, stepDistance, primaryColor);
1289
- //#endregion
1290
- //#region src/getHeavyAccentedBackgroundColor.ts
1291
- /**
1292
- * Get an accented version of a background color that is a two steps lighter/darker.
1293
- * Use this when the color contrast of the accented background color is not significant,
1294
- * such as for card/panel background colors.
1295
- *
1296
- * Accepts an optional primary color, used when the background color has been derived from the primary color,
1297
- * and we want the accented versions of the background color to come from the color scale, see {@link getBrandedColorScale}
1298
-
1299
- * See {@link getSlightAccentedBackgroundColor} for a single step away from the background color instead of two.
1300
-
1301
- *
1302
- * @example
1303
- * ```ts
1304
- * getHeavyAccentedBackgroundColor('#f5f5f5').toHex(); // '#cbcbcb'
1305
- * getHeavyAccentedBackgroundColor('#f5f5f5', { primaryColor: '#2949e5' }).toHex(); // '#adbbf5'
1306
- * ```
1307
- */
1308
- const getHeavyAccentedBackgroundColor = (_backgroundColor, { primaryColor } = {}) => {
1309
- const backgroundColor = new Color(_backgroundColor);
1310
- return getAccentedBackground({
1311
- backgroundColor,
1312
- stepDistance: 2,
1313
- primaryColor: primaryColor === void 0 ? void 0 : new Color(primaryColor)
1314
- });
1315
- };
1316
- //#endregion
1317
- //#region src/getSlightAccentedBackgroundColor.ts
1318
- const WHITE = "#ffffff";
1319
- /**
1320
- * Get an accented version of a background color that is a single step lighter/darker.
1321
- * Use this when the color contrast of the accented background color is not significant,
1322
- * such as for card/panel background colors.
1323
- *
1324
- * Accepts an optional primary color, used when the background color has been derived from the primary color,
1325
- * and we want the accented versions of the background color to come from the color scale, see {@link getBrandedColorScale}
1326
-
1327
- * See {@link getHeavyAccentedBackgroundColor} for two steps away from the background color instead of one.
1328
- *
1329
- * @example
1330
- * ```ts
1331
- * getSlightAccentedBackgroundColor('#f5f5f5').toHex(); // '#e0e0e0'
1332
- * getSlightAccentedBackgroundColor('#f5f5f5', { primaryColor: '#2949e5' }).toHex(); // '#cdd5f9'
1333
- * getSlightAccentedBackgroundColor('#ffffff', { shouldReturnWhiteForWhiteBackground: true }).toHex(); // '#ffffff'
1334
- * ```
1335
- */
1336
- const getSlightAccentedBackgroundColor = (_backgroundColor, { shouldReturnWhiteForWhiteBackground = false, primaryColor } = {}) => {
1337
- const backgroundColor = new Color(_backgroundColor);
1338
- if (shouldReturnWhiteForWhiteBackground && backgroundColor.toHex() === WHITE) return backgroundColor;
1339
- return getAccentedBackground({
1340
- backgroundColor,
1341
- stepDistance: 1,
1342
- primaryColor: primaryColor === void 0 ? void 0 : new Color(primaryColor)
1343
- });
1344
- };
1345
- //#endregion
1346
- export { getBrandLightBackgroundColor as a, ColorScale as c, Color as d, getBrandedColorScale as i, adjustColorForProperContrast as l, getHeavyAccentedBackgroundColor as n, getBrandDarkBackgroundColor as o, getColorLightnessClassification as r, getBestColorForText as s, getSlightAccentedBackgroundColor as t, colorContrastRatiosByShape as u };
1197
+ export { maxChroma as a, getBestColorForText as c, colorContrastRatiosByShape as d, Color as f, clamp as h, ACHROMATIC_CHROMA as i, ColorScale as l, rgbToOklch as m, buildBrandedColorScale as n, getBrandLightBackgroundColor as o, oklchToRgb as p, perceivedLightness as r, getBrandDarkBackgroundColor as s, getColorLightnessClassification as t, adjustColorForProperContrast as u };
1347
1198
 
1348
- //# sourceMappingURL=color-C99gJSgH.js.map
1199
+ //# sourceMappingURL=getColorLightnessClassification--FSkjXEx.js.map