@wistia/kaleidoscope 0.0.6 → 0.0.7

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 (28) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/{color-BY2NrNVz.js → color-BgYVUbOQ.js} +3 -3
  3. package/dist/{color-BY2NrNVz.js.map → color-BgYVUbOQ.js.map} +1 -1
  4. package/dist/{engine-DeOUPRa0.js → engine-DHDkDPaV.js} +385 -80
  5. package/dist/engine-DHDkDPaV.js.map +1 -0
  6. package/dist/entries/color.js +3 -3
  7. package/dist/entries/engine.js +2 -2
  8. package/dist/entries/styleRegistry.js +2 -2
  9. package/dist/entries/validate.js +2 -2
  10. package/dist/entries/vocabulary.js +3 -3
  11. package/dist/{getColorLightnessClassification--FSkjXEx.js → getColorLightnessClassification-C6BXD8Da.js} +2 -2
  12. package/dist/{getColorLightnessClassification--FSkjXEx.js.map → getColorLightnessClassification-C6BXD8Da.js.map} +1 -1
  13. package/dist/{guards-t_cf_IOV.js → guards-BJfumKYK.js} +2 -2
  14. package/dist/{guards-t_cf_IOV.js.map → guards-BJfumKYK.js.map} +1 -1
  15. package/dist/index.js +8 -8
  16. package/dist/{styleRegistry-CT4jvu4h.js → styleRegistry-Dcho9r3B.js} +31 -31
  17. package/dist/styleRegistry-Dcho9r3B.js.map +1 -0
  18. package/dist/{styleVocabulary-DcxbkEvK.js → styleVocabulary-DMhXOr4F.js} +2 -2
  19. package/dist/{styleVocabulary-DcxbkEvK.js.map → styleVocabulary-DMhXOr4F.js.map} +1 -1
  20. package/dist/{typography-BA9Pz8Im.js → typography-BLPIIq_8.js} +2 -2
  21. package/dist/{typography-BA9Pz8Im.js.map → typography-BLPIIq_8.js.map} +1 -1
  22. package/dist/{validate-D-OR7_3g.js → validate-BkOpEpch.js} +5 -5
  23. package/dist/{validate-D-OR7_3g.js.map → validate-BkOpEpch.js.map} +1 -1
  24. package/package.json +2 -2
  25. package/styles/glass-dark.json +13 -13
  26. package/styles/glass-light.json +16 -16
  27. package/dist/engine-DeOUPRa0.js.map +0 -1
  28. package/dist/styleRegistry-CT4jvu4h.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"engine-DHDkDPaV.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/constants/glass.ts","../src/private/engine/rules/text.ts","../src/private/engine/treatments/glassy.ts","../src/private/engine/constants/gradient.ts","../src/private/engine/treatments/gradient.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/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 /** `anchors.colors.gradientStops`, when the Style declares them. */\n readonly gradientStops: readonly Color[] | null;\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 gradientStops: colors.gradientStops?.map((stop) => resolveSingleColor(stop, tokens)) ?? null,\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\n/** The elevation's shadow, if it casts one, with any layers the treatment draws after it. */\nexport const elevationSlots = (\n { depth, hardness }: Elevation,\n treatmentLayers: readonly string[] = [],\n): Slots => {\n const shadow = depth === 'none' ? undefined : SHADOWS[hardness]?.[depth];\n const layers = [\n ...(shadow === undefined\n ? []\n : [`${shadow.x}px ${shadow.y}px ${shadow.blur}px rgba(0, 0, 0, ${shadow.alpha})`]),\n ...treatmentLayers,\n ];\n\n return layers.length === 0 ? {} : { 'box-shadow': layers.join(', ') };\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 { ColorTone, SurfaceName } from '../../../styleVocabulary';\n\n/** One size of glass. */\nexport type GlassTier = {\n readonly backdropFilter: string | null;\n /** Geometry and alpha of the fainter light where the highlights' light leaves, at the bottom right. */\n readonly counterEdge: readonly [geometry: string, alpha: number];\n readonly edgeAlpha: number;\n /** Geometry of the edge. It's blurred, because an unblurred edge renders as a hard outline. */\n readonly edge: string;\n /** How opaque the ground is, over the blurred backdrop. */\n readonly groundAlpha: number;\n readonly hoverGroundAlpha: number;\n /** Geometry, color and alpha of an inner shadow, for tiers that have one. */\n readonly innerShade: readonly [geometry: string, color: string, alpha: number] | null;\n /** A control's ground is its text color, rather than the surface's source. */\n readonly liftsParent: boolean;\n /** Alphas of the sheen's three stops, at `GLASS_SHEEN_STOPS`. */\n readonly sheen: readonly [number, number, number];\n readonly specular: readonly string[];\n readonly specularAlpha: number;\n};\n\nexport const GLASS_LIGHT_COLOR = '#ffffff';\nconst GLASS_SHADE_COLOR = '#000000';\nexport const GLASS_SHEEN_ANGLE = '135deg';\nexport const GLASS_SHEEN_STOPS = [0, 45, 100] as const;\n\n/** Panel inputs are the panel's text color at these alphas. Placeholders. */\nexport const GLASS_INPUT_ALPHA = 0.08;\nexport const GLASS_INPUT_FOCUS_ALPHA = 0.2;\n\nconst BACKDROP_FILTER = 'blur(10px) saturate(180%)';\n\n/** From the Phase 1 carousel sandbox. */\nconst DARK_CONTAINER: GlassTier = {\n backdropFilter: BACKDROP_FILTER,\n counterEdge: ['inset -1px -1px 1px 0', 0.13],\n edge: 'inset 0 0 3px 0',\n edgeAlpha: 0.3,\n groundAlpha: 0.25,\n hoverGroundAlpha: 0.25,\n innerShade: ['inset 0 4px 20px', GLASS_SHADE_COLOR, 0.1],\n liftsParent: false,\n sheen: [0.25, 0.1, 0.02],\n specular: ['inset 0 7px 2px -6px', 'inset 10px 6px 3px -10px'],\n specularAlpha: 0.55,\n};\n\n/**\n * The design file gives panel and card one fill; a card has a finer edge and a denser hover. A\n * shadow can't scale with its element, so the smaller tiers keep one soft highlight.\n */\nconst DARK_CARD: GlassTier = {\n backdropFilter: BACKDROP_FILTER,\n counterEdge: ['inset -1px -1px 1px 0', 0.11],\n edge: 'inset 0 0 2px 0',\n edgeAlpha: 0.28,\n groundAlpha: 0.25,\n hoverGroundAlpha: 0.37,\n innerShade: ['inset 0 4px 20px', GLASS_SHADE_COLOR, 0.1],\n liftsParent: false,\n sheen: [0.2, 0.08, 0.02],\n specular: ['inset 0 1px 2px 0'],\n specularAlpha: 0.25,\n};\n\nconst DARK_CONTROL: GlassTier = {\n backdropFilter: null,\n counterEdge: ['inset -1px -1px 1px 0', 0.09],\n edge: 'inset 0 0 2px 0',\n edgeAlpha: 0.22,\n groundAlpha: 0.08,\n hoverGroundAlpha: 0.25,\n innerShade: null,\n liftsParent: true,\n sheen: [0.15, 0.08, 0.02],\n specular: ['inset 0 1px 2px 0'],\n specularAlpha: 0.2,\n};\n\n/** The design file has no light glass. A denser ground, and every shadow layer is white. */\nconst LIGHT_CONTAINER: GlassTier = {\n ...DARK_CONTAINER,\n counterEdge: ['inset -1px -1px 1px 0', 0.7],\n edge: 'inset 1px 1px 0 0',\n edgeAlpha: 0.75,\n groundAlpha: 0.45,\n hoverGroundAlpha: 0.45,\n innerShade: ['inset 0 4px 20px', GLASS_LIGHT_COLOR, 0.35],\n specularAlpha: 0.9,\n};\n\nconst LIGHT_CARD: GlassTier = {\n ...DARK_CARD,\n counterEdge: ['inset -1px -1px 1px 0', 0.6],\n edgeAlpha: 0.85,\n groundAlpha: 0.45,\n hoverGroundAlpha: 0.62,\n innerShade: ['inset 0 4px 20px', GLASS_LIGHT_COLOR, 0.3],\n specularAlpha: 0.8,\n};\n\nconst LIGHT_CONTROL: GlassTier = {\n ...DARK_CONTROL,\n counterEdge: ['inset -1px -1px 1px 0', 0.45],\n edgeAlpha: 0.7,\n groundAlpha: 0.35,\n hoverGroundAlpha: 0.6,\n liftsParent: false,\n specularAlpha: 0.5,\n};\n\nexport const GLASS_TIERS: Readonly<Record<ColorTone, Readonly<Record<SurfaceName, GlassTier>>>> = {\n dark: {\n page: DARK_CONTAINER,\n panel: DARK_CONTAINER,\n card: DARK_CARD,\n buttonPrimary: DARK_CONTROL,\n buttonSecondary: DARK_CONTROL,\n },\n light: {\n page: LIGHT_CONTAINER,\n panel: LIGHT_CONTAINER,\n card: LIGHT_CARD,\n buttonPrimary: LIGHT_CONTROL,\n buttonSecondary: LIGHT_CONTROL,\n },\n};\n\n/** Glass over a ground anchor darker than this is dark glass. */\nexport const GLASS_DARK_BELOW_LUMINANCE = 0.2;\n","import type {\n LiteralColor,\n SurfaceName,\n TextColor,\n TextColorPreference,\n} from '../../../styleVocabulary';\nimport type { ResolvedAnchors } from '../anchors';\nimport type { Slots, SurfaceSlotFragment } from '../slots';\nimport type { FindGaps } from './types';\nimport { adjustColorForProperContrast } from '../../../adjustColorForProperContrast';\nimport { Color } from '../../../Color';\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\nconst isLiteral = (textColor: TextColor): textColor is LiteralColor =>\n typeof textColor === 'string' && (textColor.startsWith('#') || textColor.startsWith('rgb'));\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 rule\n * A literal is used as written, with no contrast guarantee.\n */\nexport const resolveTextColor = (\n textColor: TextColor,\n solid: Color,\n anchors: ResolvedAnchors,\n): Color => {\n if (isLiteral(textColor)) {\n return new Color(textColor);\n }\n\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/**\n * The same text slots with a `-hover` suffix, moved only as far as the hovered fill needs. A literal\n * stays as written.\n */\nexport const hoverTextSlots = (\n surface: SurfaceName,\n textColor: TextColor,\n text: Color,\n solidHover: Color,\n): Slots => {\n const readable = isLiteral(textColor)\n ? text\n : adjustColorForProperContrast({ foregroundColor: text, backgroundColor: solidHover });\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) || isLiteral(textColor)\n ? []\n : [`textColor: ${JSON.stringify(textColor)}`];\n","import type { GlassTier } from '../constants/glass';\nimport type { TreatmentFn } from './types';\nimport { Color } from '../../../Color';\nimport { anchorColor, anchorName } from '../anchors';\nimport {\n GLASS_DARK_BELOW_LUMINANCE,\n GLASS_INPUT_ALPHA,\n GLASS_INPUT_FOCUS_ALPHA,\n GLASS_LIGHT_COLOR,\n GLASS_SHEEN_ANGLE,\n GLASS_SHEEN_STOPS,\n GLASS_TIERS,\n} from '../constants/glass';\nimport { resolveTextColor } from '../rules/text';\nimport { scaleOf, stepAlong } from '../scale';\n\nconst LIGHT = new Color(GLASS_LIGHT_COLOR);\n\n/** `top` laid over `under`, flattened to the opaque color the eye sees. */\nconst composite = (top: Color, under: Color): Color =>\n new Color([\n top.r * top.a + under.r * (1 - top.a),\n top.g * top.a + under.g * (1 - top.a),\n top.b * top.a + under.b * (1 - top.a),\n 1,\n ]);\n\nconst sheen = ({ sheen: alphas }: GlassTier): string => {\n const stops = alphas.map(\n (alpha, index) => `${LIGHT.withAlpha(alpha).toRgba()} ${GLASS_SHEEN_STOPS[index] ?? 100}%`,\n );\n\n return `linear-gradient(${GLASS_SHEEN_ANGLE}, ${stops.join(', ')})`;\n};\n\n/** Inner shade, then the edge, then the specular highlights and the fainter edge opposite them. */\nconst glassShadowLayers = (tier: GlassTier): readonly string[] => [\n ...(tier.innerShade === null\n ? []\n : [\n `${tier.innerShade[0]} ${new Color(tier.innerShade[1]).withAlpha(tier.innerShade[2]).toRgba()}`,\n ]),\n `${tier.edge} ${LIGHT.withAlpha(tier.edgeAlpha).toRgba()}`,\n ...tier.specular.map((geometry) => `${geometry} ${LIGHT.withAlpha(tier.specularAlpha).toRgba()}`),\n `${tier.counterEdge[0]} ${LIGHT.withAlpha(tier.counterEdge[1]).toRgba()}`,\n];\n\n/**\n * A translucent ground under a sheen. `solid` is that ground flattened over the parent, so text and\n * children resolve against what the eye sees.\n */\nexport const glassy: TreatmentFn = ({ anchors, parent, settings, surface }) => {\n const { offset, source } = settings.backgroundColor;\n const sourceColor =\n source === 'parent'\n ? (parent?.solid ?? anchorColor('anchors.colors.pageBackground', anchors))\n : anchorColor(source, anchors);\n const tone =\n (anchors.colors.ground ?? sourceColor).luminance() < GLASS_DARK_BELOW_LUMINANCE\n ? 'dark'\n : 'light';\n const tier = GLASS_TIERS[tone][surface];\n const inherited =\n source === 'parent' ? (parent?.scale ?? null) : anchors.scales[anchorName(source)];\n const base = stepAlong(inherited ?? scaleOf(sourceColor), sourceColor, offset);\n const under = parent?.solid ?? base;\n const ground = (\n tier.liftsParent ? resolveTextColor(settings.textColor, under, anchors) : base\n ).withAlpha(tier.groundAlpha);\n const image = sheen(tier);\n\n return {\n solid: composite(ground, under),\n scale: null,\n fill: {\n 'background-color': ground.toRgba(),\n 'background-image': image,\n ...(tier.backdropFilter === null ? {} : { 'backdrop-filter': tier.backdropFilter }),\n },\n hover: () => {\n const groundHover = base.withAlpha(tier.hoverGroundAlpha);\n\n return {\n solid: composite(groundHover, under),\n slots: { 'background-color-hover': groundHover.toRgba(), 'background-image-hover': image },\n };\n },\n tintedBy: (text) => ({\n inputFills: {\n 'input-background-color': text.withAlpha(GLASS_INPUT_ALPHA).toRgba(),\n 'input-background-color-focus': text.withAlpha(GLASS_INPUT_FOCUS_ALPHA).toRgba(),\n },\n shadowLayers: glassShadowLayers(tier),\n }),\n };\n};\n","/**\n * `glows`: soft orbs in the stop colors over the surface's own fill. A dark fill swallows them, so\n * there they are stronger and fuller. Placeholder.\n */\nexport const GLOWS = {\n alpha: 0.42,\n size: '62% 56%',\n fadeStop: 70,\n darkFillLuminance: 0.2,\n dark: { alpha: 0.72, size: '72% 66%', midAlphaFactor: 0.6, midStop: 38, fadeStop: 72 },\n positions: ['14% 16%', '86% 22%', '62% 92%', '10% 80%', '48% 50%', '94% 66%'],\n} as const;\n","import type { Color } from '../../../Color';\nimport type { FindGaps } from '../rules/types';\nimport type { TreatmentFn } from './types';\nimport { anchorColor, anchorName } from '../anchors';\nimport { GLOWS } from '../constants/gradient';\nimport { scaleOf, stepAlong } from '../scale';\n\nconst glowLayer = (stop: Color, position: string, onDark: boolean): string => {\n if (onDark) {\n const { alpha, fadeStop, midAlphaFactor, midStop, size } = GLOWS.dark;\n\n return `radial-gradient(${size} at ${position}, ${stop.withAlpha(alpha).toRgba()} 0%, ${stop.withAlpha(alpha * midAlphaFactor).toRgba()} ${midStop}%, transparent ${fadeStop}%)`;\n }\n\n return `radial-gradient(${GLOWS.size} at ${position}, ${stop.withAlpha(GLOWS.alpha).toRgba()} 0%, transparent ${GLOWS.fadeStop}%)`;\n};\n\nconst glowsImage = (stops: readonly Color[], fill: Color): string => {\n const onDark = fill.luminance() < GLOWS.darkFillLuminance;\n\n return stops\n .map((stop, index) =>\n glowLayer(stop, GLOWS.positions[index % GLOWS.positions.length] ?? 'center', onDark),\n )\n .join(', ');\n};\n\n/**\n * Gradient layers over the surface's own fill. The fill is `solid`: it is what text is solved\n * against, so nothing derives a color from the layers moving over it.\n */\nexport const gradient: TreatmentFn = ({ anchors, parent, settings }) => {\n const { gradientStops } = anchors;\n\n if (gradientStops === null) {\n throw new Error('anchors.colors.gradientStops is referenced but not declared');\n }\n\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 inherited =\n source === 'parent' ? (parent?.scale ?? null) : anchors.scales[anchorName(source)];\n const scale = inherited ?? scaleOf(sourceColor);\n const start = from === 'parent' && parent !== null ? parent.solid : sourceColor;\n const solid = stepAlong(scale, start, offset);\n const image = glowsImage(gradientStops, solid);\n\n return {\n solid,\n scale,\n fill: { 'background-color': solid.toHex(), 'background-image': image },\n hover: () => ({\n solid,\n slots: { 'background-color-hover': solid.toHex(), 'background-image-hover': image },\n }),\n };\n};\n\n/** Only `glows` so far. */\nexport const gradientGaps: FindGaps = ({ gradientShape }) =>\n gradientShape === undefined || gradientShape.kind === 'glows'\n ? []\n : [`gradientShape: ${gradientShape.kind}`];\n","import type { Treatment } from '../../../styleVocabulary';\nimport type { TreatmentFn } from './types';\nimport { flat } from './flat';\nimport { glassy } from './glassy';\nimport { gradient } from './gradient';\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 glassy,\n gradient,\n};\n","import type { SurfaceSlotFragment } from '../slots';\nimport type { AnySurfaceSettings, 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\n/** Glass has a fixed ground that its parent shows through, so it can't count from its parent. */\nconst fromGaps = ({\n backgroundColor: { from },\n treatment,\n}: AnySurfaceSettings): readonly string[] =>\n treatment === 'glassy' && from === 'parent' ? ['backgroundColor.from: parent'] : [];\n\n/** Inverting repaints a surface as a flat fill, so no other treatment can invert. */\nconst invertGaps = ({\n backgroundColor: { invert },\n treatment,\n}: AnySurfaceSettings): readonly string[] =>\n treatment === 'flat' || invert === 'never' ? [] : [`backgroundColor.invert: ${invert}`];\n\nexport const fillGaps: FindGaps = (settings) => {\n const { treatment } = settings;\n\n return [\n ...(Object.hasOwn(TREATMENT_FUNCTIONS, treatment) ? [] : [`treatment: ${treatment}`]),\n ...fromGaps(settings),\n ...invertGaps(settings),\n ];\n};\n","import type { MotionSpeed, 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\n/** How long one drift takes per speed. */\nexport const DRIFT_DURATIONS = {\n slow: '10s',\n medium: '6s',\n fast: '3s',\n} satisfies Record<MotionSpeed, string>;\n","import type { Motion } from '../../../styleVocabulary';\nimport type { Slots, SurfaceSlotFragment } from '../slots';\nimport type { FindGaps } from './types';\nimport { SURFACE_NAMES } from '../../../styleVocabulary';\nimport {\n DRIFT_DURATIONS,\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' },\n};\n\n/**\n * Only how long a page's drift takes. The contract is CSS variables only, so each consumer writes\n * its own `@keyframes` and the layer that moves. `0s` means the page is still. Other surfaces have\n * no animation slots until a Style first animates one.\n */\nexport const PAGE_ANIMATION_SLOTS: SurfaceSlotFragment = {\n surfaces: ['page'],\n initialValues: { 'animation-duration': '0s' },\n};\n\nconst transitionSlots = (transition: Motion['transition']): 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/** `motionGaps` only lets `drift` through on the page, so this never names another surface's slot. */\nconst driftSlots = ({ ambient, speed }: Motion): Slots =>\n ambient === 'drift' ? { 'animation-duration': DRIFT_DURATIONS[speed] } : {};\n\nexport const motionSlots = (motion: Motion): Slots => ({\n ...transitionSlots(motion.transition),\n ...driftSlots(motion),\n});\n\n/** Only the page drifts so far, and nothing pulses. */\nexport const motionGaps: FindGaps = ({ motion: { ambient } }, surface) =>\n ambient === 'none' || (ambient === 'drift' && surface === 'page')\n ? []\n : [`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 unless given `fills`, and take the primary color when focused. */\nexport const panelInputSlots = (solid: Color, anchors: ResolvedAnchors, fills?: Slots): Slots => ({\n ...(fills ?? {\n 'input-background-color': stepFrom(solid, 1).toHex(),\n 'input-background-color-focus': stepFrom(solid, 2).toHex(),\n }),\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","/** 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, PAGE_ANIMATION_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 PAGE_ANIMATION_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 const tinted = treated.tintedBy?.(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, settings.textColor, text, hover.solid) }\n : {}),\n ...textSlots(surface, text),\n ...(spec.mayContainForm ? panelInputSlots(treated.solid, anchors, tinted?.inputFills) : {}),\n ...borderSlots(settings.border, treated.solid, anchors),\n ...elevationSlots(settings.elevation, tinted?.shadowLayers),\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';\nimport { gradientGaps } from './treatments/gradient';\n\nconst GAP_FINDERS: readonly FindGaps[] = [\n fillGaps,\n gradientGaps,\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], 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;;;;;;AA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ASnD,OAAO,GAAG,SAAS,MAPE,OAAO,QAAQ,SAAS,CAAC,CAAC,KAAK,CAAC,MAAM,WAAW;EACpE,WAAW,IAAI;EACf,WAAW,gBAAgB,QAAQ,OAAO,eAAe;EAEzD,OAAO,KAAK,KAAK,IAAI,MAAM;CAC7B,CAEoC,CAAC,CAAC,KAAK,IAAI,EAAE;AACnD"}
@@ -1,12 +1,12 @@
1
1
 
2
2
  /*
3
- * @license @wistia/kaleidoscope v0.0.6
3
+ * @license @wistia/kaleidoscope v0.0.7
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 { 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";
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-C6BXD8Da.js";
11
+ import { n as getHeavyAccentedBackgroundColor, r as getBrandedColorScale, t as getSlightAccentedBackgroundColor } from "../color-BgYVUbOQ.js";
12
12
  export { Color, ColorScale, adjustColorForProperContrast, colorContrastRatiosByShape, getBestColorForText, getBrandDarkBackgroundColor, getBrandLightBackgroundColor, getBrandedColorScale, getColorLightnessClassification, getHeavyAccentedBackgroundColor, getSlightAccentedBackgroundColor };
@@ -1,10 +1,10 @@
1
1
 
2
2
  /*
3
- * @license @wistia/kaleidoscope v0.0.6
3
+ * @license @wistia/kaleidoscope v0.0.7
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
- 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";
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-DHDkDPaV.js";
@@ -1,10 +1,10 @@
1
1
 
2
2
  /*
3
- * @license @wistia/kaleidoscope v0.0.6
3
+ * @license @wistia/kaleidoscope v0.0.7
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
- 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";
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-Dcho9r3B.js";
@@ -1,10 +1,10 @@
1
1
 
2
2
  /*
3
- * @license @wistia/kaleidoscope v0.0.6
3
+ * @license @wistia/kaleidoscope v0.0.7
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
- export { t as checkStyleDocument, n as isStyleDocument, r as validateStyleDocument } from "../validate-D-OR7_3g.js";
10
+ export { t as checkStyleDocument, n as isStyleDocument, r as validateStyleDocument } from "../validate-BkOpEpch.js";
@@ -1,12 +1,12 @@
1
1
 
2
2
  /*
3
- * @license @wistia/kaleidoscope v0.0.6
3
+ * @license @wistia/kaleidoscope v0.0.7
4
4
  *
5
5
  * Copyright (c) 2026, Wistia, Inc. and its affiliates.
6
6
  *
7
7
  * This source code is unlicensed, all rights reserved.
8
8
  */
9
9
 
10
- import { A as REQUIRED_FONT_ANCHORS, C as ANCHORS_REQUIRED_BY_TREATMENT, D as OPTIONAL_COLOR_ANCHORS, E as COLOR_ANCHOR_NAMES, O as REQUIRED_COLOR_ANCHORS, 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";
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-DMhXOr4F.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-BLPIIq_8.js";
12
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,6 +1,6 @@
1
1
 
2
2
  /*
3
- * @license @wistia/kaleidoscope v0.0.6
3
+ * @license @wistia/kaleidoscope v0.0.7
4
4
  *
5
5
  * Copyright (c) 2026, Wistia, Inc. and its affiliates.
6
6
  *
@@ -1196,4 +1196,4 @@ const getColorLightnessClassification = (color) => {
1196
1196
  };
1197
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 };
1198
1198
 
1199
- //# sourceMappingURL=getColorLightnessClassification--FSkjXEx.js.map
1199
+ //# sourceMappingURL=getColorLightnessClassification-C6BXD8Da.js.map