@wistia/kaleidoscope 0.0.7 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/dist/{color-BgYVUbOQ.js → color-BuPhQjcd.js} +3 -3
- package/dist/{color-BgYVUbOQ.js.map → color-BuPhQjcd.js.map} +1 -1
- package/dist/{engine-DHDkDPaV.js → engine-6ocr431e.js} +788 -374
- package/dist/engine-6ocr431e.js.map +1 -0
- package/dist/{engine-B00ZVZ0d.d.ts → engine-CcU0Q8Jg.d.ts} +5 -3
- package/dist/{engine-B00ZVZ0d.d.ts.map → engine-CcU0Q8Jg.d.ts.map} +1 -1
- package/dist/entries/color.js +3 -3
- package/dist/entries/engine.d.ts +1 -1
- package/dist/entries/engine.js +2 -2
- package/dist/entries/styleRegistry.d.ts +1 -1
- package/dist/entries/styleRegistry.js +2 -2
- package/dist/entries/validate.d.ts +1 -1
- package/dist/entries/validate.js +2 -2
- package/dist/entries/vocabulary.d.ts +2 -2
- package/dist/entries/vocabulary.js +4 -4
- package/dist/{getColorLightnessClassification-C6BXD8Da.js → getColorLightnessClassification-Dgr8qirZ.js} +2 -2
- package/dist/{getColorLightnessClassification-C6BXD8Da.js.map → getColorLightnessClassification-Dgr8qirZ.js.map} +1 -1
- package/dist/{guards-BJfumKYK.js → guards-BPewjm9T.js} +2 -2
- package/dist/{guards-BJfumKYK.js.map → guards-BPewjm9T.js.map} +1 -1
- package/dist/{index-BOJCY_MU.d.ts → index-BTumAeju.d.ts} +26 -7
- package/dist/index-BTumAeju.d.ts.map +1 -0
- package/dist/index.d.ts +5 -5
- package/dist/index.js +9 -9
- package/dist/{styleRegistry-Dcho9r3B.js → styleRegistry-BqGmp-3z.js} +5 -5
- package/dist/{styleRegistry-Dcho9r3B.js.map → styleRegistry-BqGmp-3z.js.map} +1 -1
- package/dist/{styleRegistry-A0nrsHk-.d.ts → styleRegistry-BsMmbH_0.d.ts} +2 -2
- package/dist/{styleRegistry-A0nrsHk-.d.ts.map → styleRegistry-BsMmbH_0.d.ts.map} +1 -1
- package/dist/{styleVocabulary-DMhXOr4F.js → styleVocabulary-CDTPCMhZ.js} +11 -5
- package/dist/{styleVocabulary-DMhXOr4F.js.map → styleVocabulary-CDTPCMhZ.js.map} +1 -1
- package/dist/{typography-BLPIIq_8.js → typography-BCKqcNDx.js} +2 -2
- package/dist/{typography-BLPIIq_8.js.map → typography-BCKqcNDx.js.map} +1 -1
- package/dist/{validate-Bqx__f3d.d.ts → validate-8Ow1tYvz.d.ts} +2 -2
- package/dist/{validate-Bqx__f3d.d.ts.map → validate-8Ow1tYvz.d.ts.map} +1 -1
- package/dist/{validate-BkOpEpch.js → validate-D_VsJM1q.js} +88 -26
- package/dist/validate-D_VsJM1q.js.map +1 -0
- package/package.json +7 -7
- package/schema/style-v1.json +128 -20
- package/styles/opaque-bright.json +1 -1
- package/styles/opaque-heavy.json +1 -1
- package/styles/opaque-minimal.json +1 -1
- package/dist/engine-DHDkDPaV.js.map +0 -1
- package/dist/index-BOJCY_MU.d.ts.map +0 -1
- package/dist/validate-BkOpEpch.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"engine-6ocr431e.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/kebab.ts","../src/private/engine/surfaces.ts","../src/private/engine/rules/elevation.ts","../src/private/engine/slots.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/texture.ts","../src/private/engine/rules/texture.ts","../src/private/engine/constants/typography.ts","../src/private/engine/rules/typography.ts","../src/private/engine/contract.ts","../src/kaleidoscopeContract.ts","../src/private/engine/treatments/flat.ts","../src/private/engine/rules/invert.ts","../src/private/engine/composite.ts","../src/private/engine/constants/glass.ts","../src/private/engine/constants/gradient.ts","../src/private/engine/constants/tuning.ts","../src/private/engine/treatments/glassy.ts","../src/private/engine/treatments/gradient.ts","../src/private/engine/treatments/none.ts","../src/private/engine/treatments/index.ts","../src/private/engine/evaluateSurfaces.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\n/** How strongly a surface with no fill washes in its text color on hover. Placeholder. */\nexport const NONE_HOVER_WASH_ALPHA = 0.08;\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\nconst 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\nconst 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\nconst isAnchorRef = (value: string): value is SingleColorAnchorRef =>\n Object.hasOwn(ANCHOR_BY_REF, value);\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/** A setting that names a color either way: through an anchor, or written out. */\nexport const anchorOrSingleColor = (\n value: SingleColorAnchorRef | SingleColor,\n anchors: ResolvedAnchors,\n): Color =>\n typeof value === 'string' && isAnchorRef(value)\n ? anchorColor(value, anchors)\n : resolveSingleColor(value, anchors.tokens);\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/** What `elevation.source: shade` is before each shadow's alpha. */\nexport const SHADE_COLOR = '#000000';\n\n/**\n * The shadow each hardness casts at each depth. `soft · low` is from the Phase 1 carousel sandbox;\n * the rest are placeholders carried over from the Style Sampler prototype.\n */\nexport const SHADOWS: Readonly<\n Record<ElevationHardness, Readonly<Record<Exclude<ElevationDepth, 'none'>, Shadow>>>\n> = {\n soft: {\n low: { x: 0, y: 3, blur: 5, alpha: 0.125 },\n medium: { x: 0, y: 6, blur: 12, alpha: 0.2 },\n high: { x: 0, y: 8, blur: 18, alpha: 0.32 },\n },\n hard: {\n low: { x: 3, y: 3, blur: 0, alpha: 1 },\n medium: { x: 5, y: 5, blur: 0, alpha: 1 },\n high: { x: 8, y: 8, blur: 0, alpha: 1 },\n },\n glow: {\n low: { x: 0, y: 0, blur: 12, alpha: 0.65 },\n medium: { x: 0, y: 0, blur: 22, alpha: 0.72 },\n high: { x: 0, y: 0, blur: 36, alpha: 0.8 },\n },\n};\n\n/** A glow also draws a tight core, a little stronger than its halo, so the edge reads as lit. */\nexport const GLOW_CORES: Readonly<Record<Exclude<ElevationDepth, 'none'>, Shadow>> = {\n low: { x: 0, y: 0, blur: 3, alpha: 0.85 },\n medium: { x: 0, y: 0, blur: 3, alpha: 0.92 },\n high: { x: 0, y: 0, blur: 3, alpha: 1 },\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 /** How much a surface's shadow offsets and blur scale, since a button is smaller than a panel. */\n readonly shadowScale: number;\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, shadowScale: 1 },\n panel: { holdsContent: true, interactive: false, mayContainForm: true, shadowScale: 1.25 },\n card: { holdsContent: true, interactive: true, mayContainForm: false, shadowScale: 1 },\n buttonPrimary: {\n holdsContent: false,\n interactive: true,\n mayContainForm: false,\n shadowScale: 0.5,\n },\n buttonSecondary: {\n holdsContent: false,\n interactive: true,\n mayContainForm: false,\n shadowScale: 0.5,\n },\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 { Elevation, ElevationColorSource, SurfaceName } from '../../../styleVocabulary';\nimport type { ResolvedAnchors } from '../anchors';\nimport type { Shadow } from '../constants/elevation';\nimport type { Slots, SurfaceSlotFragment } from '../slots';\nimport { Color } from '../../../Color';\nimport { SURFACE_NAMES } from '../../../styleVocabulary';\nimport { anchorOrSingleColor } from '../anchors';\nimport { GLOW_CORES, SHADE_COLOR, SHADOWS } from '../constants/elevation';\nimport { SURFACES } from '../surfaces';\n\nconst SHADE = new Color(SHADE_COLOR);\n\n/** The opaque color of an elevation. Each shadow sets its own alpha. */\nexport const elevationColor = (source: ElevationColorSource, anchors: ResolvedAnchors): Color =>\n source === 'shade' ? SHADE : anchorOrSingleColor(source, anchors);\n\nexport const ELEVATION_SLOTS: SurfaceSlotFragment = {\n surfaces: SURFACE_NAMES,\n initialValues: { 'box-shadow': 'none' },\n};\n\nconst shadowLayer = ({ alpha, blur, x, y }: Shadow, color: Color): string =>\n `${x}px ${y}px ${blur}px ${color.withAlpha(alpha).toRgba()}`;\n\n/** Whole pixels, and an offset that was there stays at least 1px so a small hard shadow survives. */\nconst scaled = (length: number, scale: number): number =>\n length === 0 ? 0 : Math.max(1, Math.round(length * scale));\n\nconst scaleShadow = ({ alpha, blur, x, y }: Shadow, scale: number): Shadow => ({\n alpha,\n blur: scaled(blur, scale),\n x: scaled(x, scale),\n y: scaled(y, scale),\n});\n\n/** The glow's core stays tight on every surface, since it's what makes the edge read as lit. */\nconst castShadows = (\n surface: SurfaceName,\n { depth, hardness, source }: Elevation,\n anchors: ResolvedAnchors,\n): readonly string[] => {\n if (depth === 'none') {\n return [];\n }\n\n const color = elevationColor(source, anchors);\n const shadows = [\n scaleShadow(SHADOWS[hardness][depth], SURFACES[surface].shadowScale),\n ...(hardness === 'glow' ? [GLOW_CORES[depth]] : []),\n ];\n\n return shadows.map((shadow) => shadowLayer(shadow, color));\n};\n\n/**\n * The elevation's shadow, if it casts one, scaled to the surface, with any layers the treatment\n * draws after it.\n */\nexport const elevationSlots = (\n surface: SurfaceName,\n elevation: Elevation,\n anchors: ResolvedAnchors,\n treatmentLayers: readonly string[] = [],\n): Slots => {\n const layers = [...castShadows(surface, elevation, anchors), ...treatmentLayers];\n\n return layers.length === 0 ? {} : { 'box-shadow': layers.join(', ') };\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 = (\n flag: Exclude<keyof SurfaceSpec, 'shadowScale'>,\n): readonly SurfaceName[] => 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 { SurfaceSlotFragment } from '../slots';\nimport type { FindGaps } from './types';\nimport { SURFACE_NAMES } from '../../../styleVocabulary';\nimport { surfacesWhere } from '../slots';\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/** Inverting repaints a surface as a flat fill, so no other treatment can invert. */\nexport const fillGaps: FindGaps = ({ backgroundColor: { invert }, treatment }) =>\n treatment === 'flat' || invert === 'never' ? [] : [`backgroundColor.invert: ${invert}`];\n","import type { MotionSpeed, PulseSize, 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\n/** How long one pulse takes per speed. Placeholder. */\nexport const PULSE_DURATIONS = {\n slow: '2.8s',\n medium: '1.6s',\n fast: '0.9s',\n} satisfies Record<MotionSpeed, string>;\n\n/** The shadow a pulse moves towards per size, in pixels. Placeholder. */\nexport const PULSE_SHADOWS = {\n small: { y: 1, blur: 6, spread: 1 },\n medium: { y: 2, blur: 14, spread: 2 },\n large: { y: 4, blur: 24, spread: 4 },\n} satisfies Record<\n PulseSize,\n { readonly blur: number; readonly spread: number; readonly y: number }\n>;\n\n/** How much of the pulse color its shadow shows. Placeholder. */\nexport const PULSE_SHADOW_ALPHA = 0.7;\n","import type { Motion } from '../../../styleVocabulary';\nimport type { ResolvedAnchors } from '../anchors';\nimport type { Slots, SurfaceSlotFragment } from '../slots';\nimport type { AnySurfaceSettings, FindGaps } from './types';\nimport { SURFACE_NAMES } from '../../../styleVocabulary';\nimport { anchorOrSingleColor } from '../anchors';\nimport {\n DRIFT_DURATIONS,\n PULSE_DURATIONS,\n PULSE_SHADOW_ALPHA,\n PULSE_SHADOWS,\n TRANSITION_DURATIONS,\n TRANSITION_EASING,\n TRANSITIONED_PROPERTIES,\n} from '../constants/motion';\nimport { elevationColor } from './elevation';\n\nexport const MOTION_SLOTS: SurfaceSlotFragment = {\n surfaces: SURFACE_NAMES,\n initialValues: { transition: 'none' },\n};\n\n/**\n * How long a pulse takes, and the color and shadow it moves towards, so each consumer writes its\n * own `@keyframes`. `0s` means the surface doesn't pulse. A page can't pulse.\n */\nexport const PULSE_SLOTS: SurfaceSlotFragment = {\n surfaces: SURFACE_NAMES.filter((surface) => surface !== 'page'),\n initialValues: {\n 'pulse-duration': '0s',\n 'pulse-color': 'transparent',\n 'pulse-box-shadow': 'none',\n },\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.\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\n/** `motionGaps` keeps a pulse off the page, so this never names a slot the page doesn't have. */\nconst pulseSlots = ({ elevation, motion }: AnySurfaceSettings, anchors: ResolvedAnchors): Slots => {\n if (motion.ambient !== 'pulse') {\n return {};\n }\n\n const color =\n motion.pulseColor === 'derive'\n ? elevationColor(elevation.source, anchors)\n : anchorOrSingleColor(motion.pulseColor, anchors);\n\n const { blur, spread, y } = PULSE_SHADOWS[motion.pulseSize];\n\n return {\n 'pulse-duration': PULSE_DURATIONS[motion.speed],\n 'pulse-color': color.toRgba(),\n 'pulse-box-shadow': `0 ${y}px ${blur}px ${spread}px ${color.withAlpha(PULSE_SHADOW_ALPHA).toRgba()}`,\n };\n};\n\nexport const motionSlots = (settings: AnySurfaceSettings, anchors: ResolvedAnchors): Slots => ({\n ...transitionSlots(settings.motion.transition),\n ...driftSlots(settings.motion),\n ...pulseSlots(settings, anchors),\n});\n\n/** Only the page drifts so far, and every surface but the page can pulse. */\nexport const motionGaps: FindGaps = ({ motion: { ambient } }, surface) =>\n (ambient === 'drift' && surface !== 'page') || (ambient === 'pulse' && surface === 'page')\n ? [`motion.ambient: ${ambient}`]\n : [];\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","import type { Color } from '../../../Color';\nimport type {\n SingleColor,\n SingleColorAnchorRef,\n SurfaceName,\n TextColor,\n TextColorPreference,\n Treatment,\n} from '../../../styleVocabulary';\nimport type { ResolvedAnchors } from '../anchors';\nimport type { Slots, SurfaceSlotFragment } from '../slots';\nimport type { ResolvedText } from '../treatments/types';\nimport { adjustColorForProperContrast } from '../../../adjustColorForProperContrast';\nimport { getBestColorForText } from '../../../getBestColorForText';\nimport { SURFACE_NAMES } from '../../../styleVocabulary';\nimport { anchorColor, anchorOrSingleColor, 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/** A color anchor or a color, used as written. */\nconst isFixed = (textColor: TextColor): textColor is SingleColor | SingleColorAnchorRef =>\n textColor !== 'derive' && !isPreference(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 rule\n * A color anchor or a color 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 (isFixed(textColor)) {\n return anchorOrSingleColor(textColor, anchors);\n }\n\n if (textColor === 'derive') {\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\n/**\n * A surface's text. One with no fill shows its parent, so it takes its parent's text and hover rule\n * in place of its own `textColor`.\n */\nexport const surfaceText = (\n { textColor, treatment }: { readonly textColor: TextColor; readonly treatment: Treatment },\n solid: Color,\n anchors: ResolvedAnchors,\n parent: ResolvedText | null,\n): ResolvedText =>\n treatment === 'none' && parent !== null\n ? { text: parent.text, textColor: parent.textColor }\n : { text: resolveTextColor(textColor, solid, anchors), textColor };\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 fixed\n * color stays as written.\n */\nexport const hoverTextSlots = (\n surface: SurfaceName,\n textColor: TextColor,\n text: Color,\n solidHover: Color,\n): Slots => {\n const readable = isFixed(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","import type { TextureIntensity } from '../../../styleVocabulary';\n\n/** How opaque each intensity draws a texture's tile. Placeholder. */\nexport const TEXTURE_OPACITY: Readonly<Record<TextureIntensity, number>> = {\n low: 0.35,\n medium: 0.6,\n high: 0.9,\n};\n\n/**\n * `soft-light` can't move pure black or pure white, so a texture vanishes on a fill near either\n * end. Darker than this, it draws only light specks or dots, with `screen`.\n */\nexport const TEXTURE_DARK_FILL_LUMINANCE = 0.2;\n\n/** Lighter than this, a texture draws only dark specks or dots, with `multiply`. */\nexport const TEXTURE_LIGHT_FILL_LUMINANCE = 0.9;\n\n/**\n * How much of its intensity's opacity a texture keeps near either end. Specks and dots that\n * `multiply` or `screen` show far more than `soft-light` does in between, so they draw fainter.\n * Placeholder.\n */\nexport const TEXTURE_EDGE_OPACITY = { dark: 0.6, light: 0.3 } as const;\n","import type { Color } from '../../../Color';\nimport type { Texture, TextureIntensity, TextureKind } from '../../../styleVocabulary';\nimport type { Slots, SurfaceSlotFragment } from '../slots';\nimport { SURFACE_NAMES } from '../../../styleVocabulary';\nimport {\n TEXTURE_DARK_FILL_LUMINANCE,\n TEXTURE_EDGE_OPACITY,\n TEXTURE_LIGHT_FILL_LUMINANCE,\n TEXTURE_OPACITY,\n} from '../constants/texture';\n\n/**\n * A texture is a tile laid over the fill. `texture-image` is a `background-image` that repeats at\n * the tile's own size, and `texture-blend-mode` blends it with the fill beneath.\n */\nexport const TEXTURE_SLOTS: SurfaceSlotFragment = {\n surfaces: SURFACE_NAMES,\n initialValues: { 'texture-image': 'none', 'texture-blend-mode': 'normal' },\n};\n\nconst svgTile = (size: number, body: string): string =>\n `url(\"data:image/svg+xml,${encodeURIComponent(\n `<svg xmlns='http://www.w3.org/2000/svg' width='${size}' height='${size}'>${body}</svg>`,\n )}\")`;\n\nconst SOFT_STRETCH = \"type='linear' slope='2.4' intercept='-0.7'\";\n/** Every pixel lands on black or white, like screen static. */\nconst HARD_THRESHOLD = \"type='discrete' tableValues='0 1'\";\n\n/**\n * Where the fill sits, which decides how a texture can show on it. `soft-light` works in between,\n * but leaves pure white and pure black untouched.\n */\ntype FillTone = 'dark' | 'light' | 'mid';\n\nconst toneOf = (solid: Color): FillTone => {\n const luminance = solid.luminance();\n\n if (luminance < TEXTURE_DARK_FILL_LUMINANCE) {\n return 'dark';\n }\n\n return luminance > TEXTURE_LIGHT_FILL_LUMINANCE ? 'light' : 'mid';\n};\n\n/**\n * What the gray noise becomes. On a mid fill it stays opaque gray, so the blend alone decides how it\n * shows. Near either end only its dark or light half survives, as black or white specks on a clear\n * tile, alpha running from 0 at middle gray.\n */\nconst NOISE_INK: Readonly<Record<FillTone, string>> = {\n mid: \"<feComponentTransfer><feFuncA type='table' tableValues='1 1'/></feComponentTransfer>\",\n light:\n \"<feColorMatrix type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -0.4252 -1.4304 -0.1444 0 1'/>\",\n dark: \"<feColorMatrix type='matrix' values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0.4252 1.4304 0.1444 0 -1'/>\",\n};\n\nconst noise = (\n size: number,\n frequency: number,\n stretch: string,\n opacity: number,\n tone: FillTone,\n): string =>\n svgTile(\n size,\n `<filter id='t' x='0' y='0'><feTurbulence type='fractalNoise' baseFrequency='${frequency}' numOctaves='3' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/><feComponentTransfer><feFuncR ${stretch}/><feFuncG ${stretch}/><feFuncB ${stretch}/></feComponentTransfer>${NOISE_INK[tone]}</filter><rect width='100%' height='100%' filter='url(#t)' opacity='${opacity}'/>`,\n );\n\nconst dot = (color: string, opacity: number): string =>\n svgTile(\n 5,\n `<radialGradient id='d'><stop offset='.65' stop-color='${color}'/><stop offset='1' stop-color='${color}' stop-opacity='0'/></radialGradient><circle cx='2.5' cy='2.5' r='1.7' fill='url(#d)' opacity='${opacity}'/>`,\n );\n\nconst round = (value: number): number => Math.round(value * 1000) / 1000;\n\nconst TILES: Readonly<\n Record<Exclude<TextureKind, 'none'>, (opacity: number, tone: FillTone) => string>\n> = {\n grain: (opacity, tone) => noise(160, 0.9, SOFT_STRETCH, opacity, tone),\n static: (opacity, tone) => noise(200, 0.65, HARD_THRESHOLD, round(opacity * 0.75), tone),\n halftone: (opacity, tone) => dot(tone === 'dark' ? '#fff' : '#000', opacity),\n};\n\nconst opacityFor = (intensity: TextureIntensity, tone: FillTone): number =>\n tone === 'mid'\n ? TEXTURE_OPACITY[intensity]\n : round(TEXTURE_OPACITY[intensity] * TEXTURE_EDGE_OPACITY[tone]);\n\nconst BLEND_MODES: Readonly<Record<FillTone, string>> = {\n dark: 'screen',\n light: 'multiply',\n mid: 'soft-light',\n};\n\n/**\n * The texture's tile and blend for a fill. Near white it draws only dark specks or dots with\n * `multiply`, near black only light ones with `screen`, and `soft-light` in between.\n */\nexport const textureSlots = ({ intensity, kind }: Texture, solid: Color): Slots => {\n if (kind === 'none') {\n return {};\n }\n\n const tone = toneOf(solid);\n\n return {\n 'texture-image': TILES[kind](opacityFor(intensity, tone), tone),\n 'texture-blend-mode': BLEND_MODES[tone],\n };\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, PULSE_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 { TEXTURE_SLOTS } from './rules/texture';\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 PULSE_SLOTS,\n PAGE_ANIMATION_SLOTS,\n TEXTURE_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`. A texture is a layer of its own:\n * `texture-image` is a `background-image` to draw over the fill, and `texture-blend-mode` is the\n * blend mode to draw it with.\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 { 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 { 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 { Color } from '../../Color';\n\n/** `top` laid over `under`, flattened to the opaque color the eye sees. */\nexport const 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","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: readonly [number, number, number] = [0, 45, 100];\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\n/** The three sizes of glass. Page and panel are containers; both buttons are controls. */\nexport type GlassTierName = 'container' | 'card' | 'control';\n\nexport type GlassTiers = Readonly<Record<ColorTone, Readonly<Record<GlassTierName, GlassTier>>>>;\n\nexport const GLASS_TIER_DEFAULTS: GlassTiers = {\n dark: { container: DARK_CONTAINER, card: DARK_CARD, control: DARK_CONTROL },\n light: { container: LIGHT_CONTAINER, card: LIGHT_CARD, control: LIGHT_CONTROL },\n};\n\nexport const GLASS_TIER_OF_SURFACE: Readonly<Record<SurfaceName, GlassTierName>> = {\n page: 'container',\n panel: 'container',\n card: 'card',\n buttonPrimary: 'control',\n buttonSecondary: 'control',\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 { GradientDirection, GradientExtent, GradientPosition } from '../../../styleVocabulary';\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 type GlowsTuning = {\n readonly alpha: number;\n readonly size: string;\n readonly fadeStop: number;\n readonly darkFillLuminance: number;\n readonly dark: {\n readonly alpha: number;\n readonly size: string;\n readonly midAlphaFactor: number;\n readonly midStop: number;\n readonly fadeStop: number;\n };\n readonly positions: readonly string[];\n};\n\nexport const GLOWS: GlowsTuning = {\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};\n\nexport const LINEAR_ANGLES = {\n 'to-top': 0,\n 'to-top-right': 45,\n 'to-right': 90,\n 'to-bottom-right': 135,\n 'to-bottom': 180,\n 'to-bottom-left': 225,\n 'to-left': 270,\n 'to-top-left': 315,\n} satisfies Record<GradientDirection, number>;\n\nexport const RADIAL_POSITIONS = {\n center: '50% 50%',\n top: '50% 0%',\n 'top-right': '100% 0%',\n right: '100% 50%',\n 'bottom-right': '100% 100%',\n bottom: '50% 100%',\n 'bottom-left': '0% 100%',\n left: '0% 50%',\n 'top-left': '0% 0%',\n} satisfies Record<GradientPosition, string>;\n\n/**\n * `near` is `farthest-side`, not `closest-side`: every position but `center` sits on an edge or a\n * corner, where the closest side is zero away, and a circle with no radius paints only its last stop.\n */\nexport const RADIAL_EXTENTS = {\n near: 'farthest-side',\n far: 'farthest-corner',\n} as const satisfies Record<GradientExtent, string>;\n\n/**\n * `beams`: crossed lines in the stop colors over the surface's own fill. Each line is a tinted\n * core inside a glow that falls off through `bands`, as px from its center and alpha, all scaled\n * by `opacity`. Two faint pools of the first and last stop sit beneath. Placeholder.\n */\nexport const BEAMS = {\n lines: [\n { angle: 64, at: 16, stop: 0 },\n { angle: 116, at: 34, stop: 1 },\n { angle: 76, at: 62, stop: 2 },\n { angle: 14, at: 40, stop: 1 },\n { angle: 164, at: 58, stop: 0 },\n ],\n bands: [\n [34, 0],\n [18, 0.07],\n [9, 0.18],\n [2.5, 0.34],\n ],\n core: [0.8, 0.55],\n coreTint: 0.45,\n opacity: 0.6,\n pools: [\n { first: true, alpha: 0.12, geometry: '70% 45% at 50% 100%' },\n { first: false, alpha: 0.096, geometry: '50% 35% at 10% 0%' },\n ],\n} as const;\n","import type { GlassTiers } from './glass';\nimport type { GlowsTuning } from './gradient';\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_TIER_DEFAULTS,\n} from './glass';\nimport { GLOWS } from './gradient';\n\nexport type GlassTuning = {\n readonly darkBelowLuminance: number;\n readonly inputAlpha: number;\n readonly inputFocusAlpha: number;\n readonly lightColor: string;\n readonly sheenAngle: string;\n readonly sheenStops: readonly [number, number, number];\n readonly tiers: GlassTiers;\n};\n\n/** The treatment constants the Storybook tuning jig edits. Style documents stay as they are. */\nexport type EngineTuning = {\n readonly glass: GlassTuning;\n readonly glows: GlowsTuning;\n};\n\nexport const DEFAULT_ENGINE_TUNING: EngineTuning = {\n glass: {\n darkBelowLuminance: GLASS_DARK_BELOW_LUMINANCE,\n inputAlpha: GLASS_INPUT_ALPHA,\n inputFocusAlpha: GLASS_INPUT_FOCUS_ALPHA,\n lightColor: GLASS_LIGHT_COLOR,\n sheenAngle: GLASS_SHEEN_ANGLE,\n sheenStops: GLASS_SHEEN_STOPS,\n tiers: GLASS_TIER_DEFAULTS,\n },\n glows: GLOWS,\n};\n\nlet current: EngineTuning = DEFAULT_ENGINE_TUNING;\n\n/** The tuning treatments read. The defaults, except inside `withEngineTuning`. */\nexport const engineTuning = (): EngineTuning => current;\n\n/**\n * Runs `run` with the treatments reading `tuning`, then puts the previous tuning back. Scoped so\n * a draft can never leak into styles computed outside it.\n */\nexport const withEngineTuning = <T>(tuning: EngineTuning, run: () => T): T => {\n const previous = current;\n\n current = tuning;\n\n try {\n return run();\n } finally {\n current = previous;\n }\n};\n","import type { GlassTier } from '../constants/glass';\nimport type { GlassTuning } from '../constants/tuning';\nimport type { FindGaps } from '../rules/types';\nimport type { TreatmentFn } from './types';\nimport { Color } from '../../../Color';\nimport { anchorColor, anchorName } from '../anchors';\nimport { composite } from '../composite';\nimport { GLASS_TIER_OF_SURFACE } from '../constants/glass';\nimport { engineTuning } from '../constants/tuning';\nimport { resolveTextColor } from '../rules/text';\nimport { scaleOf, stepAlong } from '../scale';\n\nconst sheen = ({ sheen: alphas }: GlassTier, glass: GlassTuning): string => {\n const light = new Color(glass.lightColor);\n const stops = alphas.map(\n (alpha, index) => `${light.withAlpha(alpha).toRgba()} ${glass.sheenStops[index] ?? 100}%`,\n );\n\n return `linear-gradient(${glass.sheenAngle}, ${stops.join(', ')})`;\n};\n\n/** Inner shade, then the edge, then the specular highlights and the fainter edge opposite them. */\nconst glassShadowLayers = (tier: GlassTier, light: Color): 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 // Read once, so the hover and tint closures below draw with the same tuning as the fill.\n const { glass } = engineTuning();\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.darkBelowLuminance\n ? 'dark'\n : 'light';\n const tier = glass.tiers[tone][GLASS_TIER_OF_SURFACE[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, glass);\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 layersOver: (solid) =>\n tier.sheen.map((alpha) => composite(new Color(glass.lightColor).withAlpha(alpha), solid)),\n tintedBy: (text) => ({\n inputFills: {\n 'input-background-color': text.withAlpha(glass.inputAlpha).toRgba(),\n 'input-background-color-focus': text.withAlpha(glass.inputFocusAlpha).toRgba(),\n },\n shadowLayers: glassShadowLayers(tier, new Color(glass.lightColor)),\n }),\n };\n};\n\n/** Glass has a fixed ground that its parent shows through, so it can't count from its parent. */\nexport const glassyGaps: FindGaps = ({ backgroundColor: { from }, treatment }) =>\n treatment === 'glassy' && from === 'parent' ? ['backgroundColor.from: parent'] : [];\n","import type { GradientShape } from '../../../styleVocabulary';\nimport type { GlowsTuning } from '../constants/gradient';\nimport type { TreatmentFn } from './types';\nimport { Color } from '../../../Color';\nimport { anchorColor, anchorName, anchorOrSingleColor } from '../anchors';\nimport { BEAMS, LINEAR_ANGLES, RADIAL_EXTENTS, RADIAL_POSITIONS } from '../constants/gradient';\nimport { engineTuning } from '../constants/tuning';\nimport { scaleOf, stepAlong } from '../scale';\n\ntype ShapeKind = GradientShape['kind'];\ntype ShapeOf<Kind extends ShapeKind> = Extract<GradientShape, { kind: Kind }>;\ntype ShapeImage<Kind extends ShapeKind> = (\n shape: ShapeOf<Kind>,\n stops: readonly Color[],\n fill: Color,\n) => string;\n\nconst glowLayer = (glows: GlowsTuning, 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 { glows } = engineTuning();\n const onDark = fill.luminance() < glows.darkFillLuminance;\n\n return stops\n .map((stop, index) =>\n glowLayer(glows, stop, glows.positions[index % glows.positions.length] ?? 'center', onDark),\n )\n .join(', ');\n};\n\nconst offsetFrom = (at: number, px: number): string =>\n `calc(${at}% ${px < 0 ? '-' : '+'} ${Math.abs(px)}px)`;\n\n/** One beam: its bands from the outside in, the core, and the same bands back out. */\nconst beamLayer = (color: Color, angle: number, at: number): string => {\n const [coreWidth, coreAlpha] = BEAMS.core;\n const core = color.tint(BEAMS.coreTint);\n const stopAt = (shade: Color, alpha: number, px: number): string =>\n `${shade.withAlpha(Number((alpha * BEAMS.opacity).toFixed(3))).toRgba()} ${offsetFrom(at, px)}`;\n const rising = BEAMS.bands.map(([px, alpha]) => stopAt(color, alpha, -px));\n const falling = BEAMS.bands.map(([px, alpha]) => stopAt(color, alpha, px)).toReversed();\n const [[edge]] = BEAMS.bands;\n\n return `linear-gradient(${angle}deg, transparent ${offsetFrom(at, -edge - 1)}, ${[\n ...rising,\n stopAt(core, coreAlpha, -coreWidth),\n stopAt(core, coreAlpha, coreWidth),\n ...falling,\n ].join(', ')}, transparent ${offsetFrom(at, edge + 1)})`;\n};\n\nconst beamsImage = (stops: readonly Color[], fill: Color): string => {\n const stopAt = (index: number): Color => stops[index % stops.length] ?? fill;\n\n return [\n ...BEAMS.lines.map(({ angle, at, stop }) => beamLayer(stopAt(stop), angle, at)),\n ...BEAMS.pools.map(\n ({ alpha, first, geometry }) =>\n `radial-gradient(${geometry}, ${stopAt(first ? 0 : stops.length - 1)\n .withAlpha(alpha)\n .toRgba()}, transparent 70%)`,\n ),\n ].join(', ');\n};\n\nconst evenStops = (stops: readonly Color[]): string =>\n stops\n .map((stop, index) => `${stop.toHex()} ${Math.round((index / (stops.length - 1)) * 100)}%`)\n .join(', ');\n\nconst SHAPE_IMAGES: { readonly [Kind in ShapeKind]: ShapeImage<Kind> } = {\n glows: (_shape, stops, fill) => glowsImage(stops, fill),\n beams: (_shape, stops, fill) => beamsImage(stops, fill),\n linear: ({ direction }, stops) =>\n `linear-gradient(${LINEAR_ANGLES[direction]}deg, ${evenStops(stops)})`,\n radial: ({ extent, position }, stops) =>\n `radial-gradient(circle ${RADIAL_EXTENTS[extent]} at ${RADIAL_POSITIONS[position]}, ${evenStops(stops)})`,\n};\n\nconst shapeImage = <Kind extends ShapeKind>(\n kind: Kind,\n shape: ShapeOf<Kind>,\n stops: readonly Color[],\n fill: Color,\n): string => SHAPE_IMAGES[kind](shape, stops, fill);\n\n/** `linear` and `radial` paint over the whole surface, so the fill under them never shows. */\nconst isCovering = (shape: GradientShape): boolean =>\n shape.kind === 'linear' || shape.kind === 'radial';\n\nconst meanOf = (stops: readonly Color[]): Color => {\n const mean = (channel: 'b' | 'g' | 'r'): number =>\n stops.reduce((sum, stop) => sum + stop[channel], 0) / stops.length;\n\n return new Color([mean('r'), mean('g'), mean('b'), 1]);\n};\n\n/**\n * Gradient layers in the stop colors: the shape's own `stops`, or else the Style's. `glows` and\n * `beams` move over the surface's own fill, which is `solid`, so nothing derives a color from the\n * layers. `linear` and `radial` cover the fill, so `solid`, what text is solved against, is the\n * stops' average instead.\n */\nexport const gradient: TreatmentFn = ({ anchors, parent, settings }) => {\n const shape: GradientShape = settings.gradientShape ?? { kind: 'glows' };\n const gradientStops =\n shape.stops?.map((stop) => anchorOrSingleColor(stop, anchors)) ?? anchors.gradientStops;\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 start = from === 'parent' && parent !== null ? parent.solid : sourceColor;\n const fillScale = inherited ?? scaleOf(sourceColor);\n const covers = isCovering(shape);\n const solid = covers ? meanOf(gradientStops) : stepAlong(fillScale, start, offset);\n const image = shapeImage(shape.kind, shape, gradientStops, solid);\n\n return {\n solid,\n scale: covers ? null : fillScale,\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 ...(covers ? { layersOver: () => gradientStops.map((stop) => stop.withAlpha(1)) } : {}),\n };\n};\n","import type { TreatmentFn } from './types';\nimport { anchorColor, anchorScale } from '../anchors';\nimport { composite } from '../composite';\nimport { NONE_HOVER_WASH_ALPHA } from '../constants/color';\n\nconst PAGE_BACKGROUND = 'anchors.colors.pageBackground';\n\n/**\n * No fill: the surface shows what it sits on, so its text and its children are solved against its\n * parent's fill and step along its parent's scale. It hovers with a wash of its own text color.\n */\nexport const none: TreatmentFn = ({ anchors, parent }) => {\n const solid = parent?.solid ?? anchorColor(PAGE_BACKGROUND, anchors);\n\n return {\n solid,\n scale: parent === null ? anchorScale(PAGE_BACKGROUND, anchors) : parent.scale,\n fill: { 'background-color': 'transparent' },\n hover: (text) => {\n const wash = text.withAlpha(NONE_HOVER_WASH_ALPHA);\n\n return {\n solid: composite(wash, solid),\n slots: { 'background-color-hover': wash.toRgba() },\n };\n },\n };\n};\n","import type { Treatment } from '../../../styleVocabulary';\nimport type { TreatmentFn } from './types';\nimport { flat } from './flat';\nimport { glassy } from './glassy';\nimport { gradient } from './gradient';\nimport { none } from './none';\n\n/** How the engine paints each treatment. */\nexport const TREATMENT_FUNCTIONS: Readonly<Record<Treatment, TreatmentFn>> = {\n none,\n flat,\n glassy,\n gradient,\n};\n","import type { Color } from '../../Color';\nimport type { StyleDocument, SurfaceName } from '../../styleVocabulary';\nimport type { ResolvedAnchors } from './anchors';\nimport type { Slots, VariableName } from './slots';\nimport type { ParentSurface, TreatmentResult } 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, surfaceText, textSlots } from './rules/text';\nimport { textureSlots } from './rules/texture';\nimport { surfaceVariable } from './slots';\nimport { SURFACE_GROUPS, SURFACES } from './surfaces';\nimport { TREATMENT_FUNCTIONS } from './treatments';\n\nexport type EvaluatedSurface = ParentSurface & {\n /** The opaque hovered fill, on a surface that has a hover. */\n readonly hoverSolid: Color | null;\n /** The hovered fill's image layers at each stop, flattened, on a surface that has a hover. */\n readonly hoverLayerSolids: readonly Color[];\n /** The fill's image layers (a glass sheen) at each stop, flattened over `solid`. */\n readonly layerSolids: readonly Color[];\n readonly slots: Slots;\n};\n\n/** One surface group, with the fills its text was solved against. */\nexport type EvaluatedSurfaceGroup = EvaluatedSurface & {\n readonly prefix: string;\n readonly surface: SurfaceName;\n};\n\n/** The fill's image layers flattened over its solid, and over its hover when it is interactive. */\nconst layerSolidsOf = (\n treated: TreatmentResult,\n hoverSolid: Color,\n interactive: boolean,\n): Pick<EvaluatedSurface, 'hoverLayerSolids' | 'layerSolids'> => {\n const over = (solid: Color): readonly Color[] => treated.layersOver?.(solid) ?? [];\n\n return {\n hoverLayerSolids: interactive ? over(hoverSolid) : [],\n layerSolids: over(treated.solid),\n };\n};\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: ParentSurface | null,\n): EvaluatedSurface => {\n const settings = style.surfaces[surface];\n const painted = TREATMENT_FUNCTIONS[settings.treatment]({ anchors, parent, settings, surface });\n const own = surfaceText(settings, painted.solid, anchors, parent);\n const { text, treated } = invertWhenIndistinct(settings, painted, own.text, parent);\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 text,\n textColor: own.textColor,\n hoverSolid: spec.interactive ? hover.solid : null,\n ...layerSolidsOf(treated, hover.solid, spec.interactive),\n slots: {\n ...treated.fill,\n ...(spec.interactive\n ? { ...hover.slots, ...hoverTextSlots(surface, own.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(surface, settings.elevation, anchors, tinted?.shadowLayers),\n ...radiusSlots(surface, settings.radius, anchors),\n ...motionSlots(settings, anchors),\n ...textureSlots(settings.texture, treated.solid),\n },\n };\n};\n\n/**\n * Evaluates every surface group parents first, so each surface knows the fill it sits on.\n */\nexport const evaluateSurfaceGroups = (\n style: StyleDocument,\n anchors: ResolvedAnchors,\n): readonly EvaluatedSurfaceGroup[] => {\n const containers = new Map<SurfaceName, ParentSurface>();\n const groups: EvaluatedSurfaceGroup[] = [];\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 groups.push({ ...evaluated, prefix, surface });\n }\n\n return groups;\n};\n\n/** Every surface group's slots, each named after its group. */\nexport const evaluateSurfaces = (\n style: StyleDocument,\n anchors: ResolvedAnchors,\n): Readonly<Record<VariableName, string>> => {\n const variables: Record<VariableName, string> = {};\n\n for (const { prefix, slots } of evaluateSurfaceGroups(style, anchors)) {\n for (const [slot, value] of Object.entries(slots)) {\n variables[surfaceVariable(prefix, slot)] = value;\n }\n }\n\n return variables;\n};\n","import type { StyleDocument } from '../../styleVocabulary';\nimport type { FindGaps } from './rules/types';\nimport { SURFACE_NAMES } from '../../styleVocabulary';\nimport { borderGaps } from './rules/border';\nimport { fillGaps } from './rules/fill';\nimport { motionGaps } from './rules/motion';\nimport { glassyGaps } from './treatments/glassy';\n\nconst GAP_FINDERS: readonly FindGaps[] = [glassyGaps, fillGaps, borderGaps, motionGaps];\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;;AAMvC,MAAa,wBAAwB;;AChBrC,MAAM,oBAAoB;AAC1B,MAAM,6BAAa,IAAI,IAAmB;;AAG1C,MAAa,WAAW,UAAwB;CAC9C,MAAM,MAAM,MAAM,M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,eAAe;EAEzD,OAAO,KAAK,KAAK,IAAI,MAAM;CAC7B,CAEoC,CAAC,CAAC,KAAK,IAAI,EAAE;AACnD"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { n as StyleDocument } from "./index-
|
|
2
|
+
import { n as StyleDocument } from "./index-BTumAeju.js";
|
|
3
3
|
/** The Brand Kit tokens a Style document can reference, each as `$<name>`. */
|
|
4
4
|
declare const BRAND_TOKEN_NAMES: readonly ["primaryColor", "pageBackgroundColor", "borderRadius", "headingFontFamily", "bodyFontFamily", "buttonFontFamily"];
|
|
5
5
|
type BrandTokenName = (typeof BRAND_TOKEN_NAMES)[number];
|
|
@@ -40,7 +40,9 @@ type KaleidoscopeVariables = Readonly<Record<KaleidoscopeVariableName, string>>;
|
|
|
40
40
|
* are named after the CSS property they feed — `background-color`, `border-radius`, `box-shadow` —
|
|
41
41
|
* with a `-hover` or `-focus` suffix for a state. There are two exceptions: `text-color`,
|
|
42
42
|
* `heading-text-color` and `low-emphasis-text-color` all feed `color`, and a panel's input slots
|
|
43
|
-
* carry an `input-` prefix, as in `input-background-color`.
|
|
43
|
+
* carry an `input-` prefix, as in `input-background-color`. A texture is a layer of its own:
|
|
44
|
+
* `texture-image` is a `background-image` to draw over the fill, and `texture-blend-mode` is the
|
|
45
|
+
* blend mode to draw it with.
|
|
44
46
|
*
|
|
45
47
|
* Typography variables are `--wistia-kaleidoscope-type-<role>-<property>`, for the `heading`,
|
|
46
48
|
* `body` and `button` roles.
|
|
@@ -82,4 +84,4 @@ declare const getKaleidoscopeStyles: (style: StyleDocument, brandTokens?: BrandT
|
|
|
82
84
|
*/
|
|
83
85
|
declare const serializeKaleidoscopeStyles: (variables: KaleidoscopeVariables, selector: string) => string;
|
|
84
86
|
export { KaleidoscopeVariables as a, BrandTokenName as c, KaleidoscopeVariableName as i, BrandTokens as l, getKaleidoscopeStyles as n, VARIABLE_PREFIX as o, KALEIDOSCOPE_CONTRACT as r, BRAND_TOKEN_NAMES as s, serializeKaleidoscopeStyles as t, DEFAULT_BRAND_TOKENS as u };
|
|
85
|
-
//# sourceMappingURL=engine-
|
|
87
|
+
//# sourceMappingURL=engine-CcU0Q8Jg.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine-
|
|
1
|
+
{"version":3,"file":"engine-CcU0Q8Jg.d.ts","names":[],"sources":["../src/brandTokens.ts","../src/private/engine/slots.ts","../src/kaleidoscopeContract.ts","../src/getKaleidoscopeStyles.ts","../src/serializeKaleidoscopeStyles.ts"],"mappings":";;;cACa;KAQD,yBAAyB;;;;;;;;KASzB;WACD;WACA;WACA;WACA;WACA;WACA;;;cAIE,sBAAsB,SAAS;cCvB/B;KACD,yBAAyB;;KCAzB,2BAA2B;;;;;;KAO3B,wBAAwB,SAAS,OAAO;;;;;;;;;;;;;;;;;;cAmBvC,uBAAuB;;;;;;;;;;;;;;;;;cCFvB,wBACX,OAAO,eACP,cAAa,gBACZ;;;;;;;;;;;;;;;;;;cCgCU,8BACX,WAAW,uBACX"}
|
package/dist/entries/color.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
|
|
2
2
|
/*
|
|
3
|
-
* @license @wistia/kaleidoscope v0.0.
|
|
3
|
+
* @license @wistia/kaleidoscope v0.0.8
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2026, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
7
7
|
* This source code is unlicensed, all rights reserved.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import { 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-
|
|
11
|
-
import { n as getHeavyAccentedBackgroundColor, r as getBrandedColorScale, t as getSlightAccentedBackgroundColor } from "../color-
|
|
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-Dgr8qirZ.js";
|
|
11
|
+
import { n as getHeavyAccentedBackgroundColor, r as getBrandedColorScale, t as getSlightAccentedBackgroundColor } from "../color-BuPhQjcd.js";
|
|
12
12
|
export { Color, ColorScale, adjustColorForProperContrast, colorContrastRatiosByShape, getBestColorForText, getBrandDarkBackgroundColor, getBrandLightBackgroundColor, getBrandedColorScale, getColorLightnessClassification, getHeavyAccentedBackgroundColor, getSlightAccentedBackgroundColor };
|
package/dist/entries/engine.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
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-
|
|
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-CcU0Q8Jg.js";
|
|
3
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 };
|
package/dist/entries/engine.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
|
|
2
2
|
/*
|
|
3
|
-
* @license @wistia/kaleidoscope v0.0.
|
|
3
|
+
* @license @wistia/kaleidoscope v0.0.8
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2026, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
7
7
|
* This source code is unlicensed, all rights reserved.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
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-
|
|
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-6ocr431e.js";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
|
|
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-
|
|
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-BsMmbH_0.js";
|
|
3
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,10 +1,10 @@
|
|
|
1
1
|
|
|
2
2
|
/*
|
|
3
|
-
* @license @wistia/kaleidoscope v0.0.
|
|
3
|
+
* @license @wistia/kaleidoscope v0.0.8
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2026, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
7
7
|
* This source code is unlicensed, all rights reserved.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
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-
|
|
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-BqGmp-3z.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-
|
|
2
|
+
import { a as StyleDocumentReport, i as StyleDocumentIssue, n as isStyleDocument, r as validateStyleDocument, t as checkStyleDocument } from "../validate-8Ow1tYvz.js";
|
|
3
3
|
export { type StyleDocumentIssue, type StyleDocumentReport, checkStyleDocument, isStyleDocument, validateStyleDocument };
|
package/dist/entries/validate.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
|
|
2
2
|
/*
|
|
3
|
-
* @license @wistia/kaleidoscope v0.0.
|
|
3
|
+
* @license @wistia/kaleidoscope v0.0.8
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2026, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
7
7
|
* This source code is unlicensed, all rights reserved.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
export { t as checkStyleDocument, n as isStyleDocument, r as validateStyleDocument } from "../validate-
|
|
10
|
+
export { t as checkStyleDocument, n as isStyleDocument, r as validateStyleDocument } from "../validate-D_VsJM1q.js";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
|
|
2
|
-
import { $ as
|
|
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 };
|
|
2
|
+
import { $ as INVERT_RULES, $t as RelatedColor, A as MOTION_SPEEDS, At as GRADIENT_EXTENTS, B as ELEVATION_HARDNESSES, Bt as MIN_GRADIENT_STOPS, C as TextureKind, Ct as RequiredFontAnchor, D as RadiusSource, Dt as TREATMENTS, E as Radius, Et as SingleColorAnchorRef, F as PulseSize, Ft as GradientPosition, G as ElevationHardness, Gt as ColorScaleOffset, H as ElevationColorSource, Ht as COLOR_RELATIONSHIPS, I as TRANSITIONS, It as GradientShape, J as BorderSource, Jt as FontStack, K as BORDER_STYLES, Kt as ColorTone, L as Transition, Lt as GradientShapeOption, M as MotionSpeed, Mt as GRADIENT_SHAPE_OPTIONS, N as PULSE_SIZES, Nt as GradientDirection, O as AMBIENT_MOTIONS, Ot as Treatment, P as PulseColor, Pt as GradientExtent, Q as BackgroundSource, Qt as MAX_COLOR_SCALE_OFFSET, R as ELEVATION_COLOR_SOURCE_KEYWORDS, Rt as GradientStops, S as TextureIntensity, St as RequiredDimensionAnchor, T as TextColorPreference, Tt as SingleColorAnchorName, U as ElevationColorSourceKeyword, Ut as COLOR_TONES, V as Elevation, Vt as BrandKitTokenRef, W as ElevationDepth, Wt as ColorRelationship, X as ORNAMENTAL_BORDER_STYLES, Xt as GenericFontFamily, Y as BorderStyle, Yt as GENERIC_FONT_FAMILIES, Z as BackgroundColor, Zt as LiteralColor, _ as SurfaceSettings, _t as OptionalColorAnchor, a as TypeCase, at as ANCHOR_REF_PREFIX, b as TEXTURE_KINDS, bt as REQUIRED_FONT_ANCHORS, c as Typography, ct as COLOR_ANCHOR_NAMES, d as OptionalSettingName, dt as ColorAnchors, en as SingleColor, et as InvertRule, f as REQUIRED_SETTING_NAMES, ft as DimensionAnchorRef, g as SurfaceName, gt as OPTIONAL_COLOR_ANCHORS, h as SURFACE_NAMES, ht as FontAnchors, i as TYPE_ROLES, it as ANCHOR_GROUPS, j as Motion, jt as GRADIENT_POSITIONS, k as AmbientMotion, kt as GRADIENT_DIRECTIONS, l as ALL_SETTING_NAMES, lt as ColorAnchorName, m as STACKABLE_ON, mt as FontAnchorRef, n as StyleDocument, nt as OffsetOrigin, o as TypeRole, ot as AnchorGroup, p as RequiredSettingName, pt as DimensionAnchors, q as Border, qt as Dimension, r as TYPE_CASES, rt as ANCHORS_REQUIRED_BY_TREATMENT, s as TypeRoleName, st as Anchors, t as DOCUMENT_KEYS, tt as OFFSET_ORIGINS, u as OPTIONAL_SETTING_NAMES, ut as ColorAnchorRef, v as Surfaces, vt as REQUIRED_COLOR_ANCHORS, w as TextColor, wt as SINGLE_COLOR_ANCHOR_NAMES, x as Texture, xt as RequiredColorAnchor, y as TEXTURE_INTENSITIES, yt as REQUIRED_DIMENSION_ANCHORS, z as ELEVATION_DEPTHS, zt as MAX_GRADIENT_STOPS } from "../index-BTumAeju.js";
|
|
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, PULSE_SIZES, type PulseColor, type PulseSize, 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,12 +1,12 @@
|
|
|
1
1
|
|
|
2
2
|
/*
|
|
3
|
-
* @license @wistia/kaleidoscope v0.0.
|
|
3
|
+
* @license @wistia/kaleidoscope v0.0.8
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2026, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
7
7
|
* This source code is unlicensed, all rights reserved.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import { A as
|
|
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-
|
|
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 };
|
|
10
|
+
import { A as REQUIRED_DIMENSION_ANCHORS, C as MAX_COLOR_SCALE_OFFSET, D as COLOR_ANCHOR_NAMES, E as ANCHOR_REF_PREFIX, M as SINGLE_COLOR_ANCHOR_NAMES, O as OPTIONAL_COLOR_ANCHORS, S as GENERIC_FONT_FAMILIES, T as ANCHOR_GROUPS, _ as ELEVATION_HARDNESSES, a as AMBIENT_MOTIONS, b as COLOR_RELATIONSHIPS, c as TRANSITIONS, d as GRADIENT_POSITIONS, f as GRADIENT_SHAPE_OPTIONS, g as ELEVATION_DEPTHS, h as ELEVATION_COLOR_SOURCE_KEYWORDS, i as TEXTURE_KINDS, j as REQUIRED_FONT_ANCHORS, k as REQUIRED_COLOR_ANCHORS, l as GRADIENT_DIRECTIONS, m as MIN_GRADIENT_STOPS, n as TREATMENTS, o as MOTION_SPEEDS, p as MAX_GRADIENT_STOPS, r as TEXTURE_INTENSITIES, s as PULSE_SIZES, t as DOCUMENT_KEYS, u as GRADIENT_EXTENTS, v as INVERT_RULES, w as ANCHORS_REQUIRED_BY_TREATMENT, x as COLOR_TONES, y as OFFSET_ORIGINS } from "../styleVocabulary-CDTPCMhZ.js";
|
|
11
|
+
import { 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-BCKqcNDx.js";
|
|
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, PULSE_SIZES, 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.
|
|
3
|
+
* @license @wistia/kaleidoscope v0.0.8
|
|
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-
|
|
1199
|
+
//# sourceMappingURL=getColorLightnessClassification-Dgr8qirZ.js.map
|