@epilot/spark-ui 0.28.0 → 0.28.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (163) hide show
  1. package/dist/components/accordion.cjs +2 -2
  2. package/dist/components/accordion.d.ts +1 -1
  3. package/dist/components/accordion.js +1 -1
  4. package/dist/components/alert-dialog.cjs +1 -1
  5. package/dist/components/alert-dialog.js +1 -1
  6. package/dist/components/attachment.d.cts +1 -1
  7. package/dist/components/attachment.d.ts +1 -1
  8. package/dist/components/autocomplete.cjs +1 -1
  9. package/dist/components/autocomplete.js +1 -1
  10. package/dist/components/avatar.d.cts +1 -1
  11. package/dist/components/avatar.d.ts +1 -1
  12. package/dist/components/avatar.js +1 -1
  13. package/dist/components/badge.d.cts +1 -1
  14. package/dist/components/badge.d.ts +1 -1
  15. package/dist/components/badge.js +1 -1
  16. package/dist/components/banner.d.cts +1 -1
  17. package/dist/components/bar-chart.js +1 -1
  18. package/dist/components/box.d.cts +1 -1
  19. package/dist/components/box.d.ts +1 -1
  20. package/dist/components/box.js +1 -1
  21. package/dist/components/bubble.d.cts +1 -1
  22. package/dist/components/bubble.d.ts +1 -1
  23. package/dist/components/button-group.d.cts +1 -1
  24. package/dist/components/button-group.d.ts +1 -1
  25. package/dist/components/button-group.js +1 -1
  26. package/dist/components/button.cjs +9 -3
  27. package/dist/components/button.cjs.map +1 -1
  28. package/dist/components/button.d.cts +4 -4
  29. package/dist/components/button.d.ts +4 -4
  30. package/dist/components/button.js +11 -5
  31. package/dist/components/button.js.map +1 -1
  32. package/dist/components/calendar.cjs +1 -1
  33. package/dist/components/calendar.js +1 -1
  34. package/dist/components/callout.cjs +1 -1
  35. package/dist/components/callout.d.cts +1 -1
  36. package/dist/components/callout.d.ts +2 -2
  37. package/dist/components/callout.js +1 -1
  38. package/dist/components/card.d.cts +1 -1
  39. package/dist/components/card.d.ts +1 -1
  40. package/dist/components/card.js +1 -1
  41. package/dist/components/checkbox-group.cjs +1 -1
  42. package/dist/components/checkbox-group.d.cts +1 -1
  43. package/dist/components/checkbox-group.d.ts +1 -1
  44. package/dist/components/checkbox-group.js +2 -2
  45. package/dist/components/checkbox.d.cts +1 -1
  46. package/dist/components/checkbox.d.ts +1 -1
  47. package/dist/components/checkbox.js +1 -1
  48. package/dist/components/combobox.cjs +2 -2
  49. package/dist/components/combobox.d.cts +1 -1
  50. package/dist/components/combobox.d.ts +1 -1
  51. package/dist/components/combobox.js +2 -2
  52. package/dist/components/dialog.cjs +1 -1
  53. package/dist/components/dialog.js +1 -1
  54. package/dist/components/dropdown-menu.cjs +1 -1
  55. package/dist/components/dropdown-menu.js +1 -1
  56. package/dist/components/empty-state.d.ts +1 -1
  57. package/dist/components/entity-card.d.ts +1 -1
  58. package/dist/components/field.d.cts +1 -1
  59. package/dist/components/field.d.ts +1 -1
  60. package/dist/components/icon.js +1 -1
  61. package/dist/components/info-block.d.cts +1 -1
  62. package/dist/components/info-block.d.ts +1 -1
  63. package/dist/components/input-date.cjs +1 -1
  64. package/dist/components/input-date.js +1 -1
  65. package/dist/components/input-otp.cjs +1 -1
  66. package/dist/components/input-otp.js +1 -1
  67. package/dist/components/input.cjs +1 -1
  68. package/dist/components/input.d.cts +1 -1
  69. package/dist/components/input.d.ts +1 -1
  70. package/dist/components/input.js +1 -1
  71. package/dist/components/line-chart.cjs +1 -1
  72. package/dist/components/line-chart.js +2 -2
  73. package/dist/components/list.d.cts +1 -1
  74. package/dist/components/list.d.ts +1 -1
  75. package/dist/components/message-scroller.cjs +2 -2
  76. package/dist/components/message-scroller.js +3 -3
  77. package/dist/components/page-header.cjs +1 -1
  78. package/dist/components/page-header.d.cts +1 -1
  79. package/dist/components/page-header.d.ts +1 -1
  80. package/dist/components/page-header.js +1 -1
  81. package/dist/components/pill.cjs +1 -1
  82. package/dist/components/pill.d.cts +1 -1
  83. package/dist/components/pill.d.ts +1 -1
  84. package/dist/components/pill.js +2 -2
  85. package/dist/components/power-history-chart.cjs +1 -1
  86. package/dist/components/power-history-chart.js +2 -2
  87. package/dist/components/power-network.cjs +2 -2
  88. package/dist/components/power-network.js +2 -2
  89. package/dist/components/radio.cjs +1 -1
  90. package/dist/components/radio.d.cts +1 -1
  91. package/dist/components/radio.d.ts +1 -1
  92. package/dist/components/radio.js +2 -2
  93. package/dist/components/rating.cjs +17 -2
  94. package/dist/components/rating.cjs.map +1 -1
  95. package/dist/components/rating.d.cts +12 -2
  96. package/dist/components/rating.d.ts +12 -2
  97. package/dist/components/rating.js +17 -2
  98. package/dist/components/rating.js.map +1 -1
  99. package/dist/components/schedule-list.cjs +1 -1
  100. package/dist/components/schedule-list.js +1 -1
  101. package/dist/components/segmented-control.d.cts +1 -1
  102. package/dist/components/segmented-control.d.ts +1 -1
  103. package/dist/components/select.cjs +2 -2
  104. package/dist/components/select.d.cts +1 -1
  105. package/dist/components/select.d.ts +1 -1
  106. package/dist/components/select.js +2 -2
  107. package/dist/components/sheet.cjs +1 -1
  108. package/dist/components/sheet.js +1 -1
  109. package/dist/components/solar-forecast-chart.d.ts +1 -1
  110. package/dist/components/stepper.cjs +1 -1
  111. package/dist/components/stepper.js +1 -1
  112. package/dist/components/switch-group.cjs +1 -1
  113. package/dist/components/switch-group.d.cts +1 -1
  114. package/dist/components/switch-group.d.ts +1 -1
  115. package/dist/components/switch-group.js +2 -2
  116. package/dist/components/switch.d.cts +1 -1
  117. package/dist/components/switch.d.ts +1 -1
  118. package/dist/components/switch.js +1 -1
  119. package/dist/components/table.cjs +1 -1
  120. package/dist/components/table.js +1 -1
  121. package/dist/components/tabs.cjs +1 -1
  122. package/dist/components/tabs.js +1 -1
  123. package/dist/components/textarea.cjs +1 -1
  124. package/dist/components/textarea.d.cts +1 -1
  125. package/dist/components/textarea.d.ts +1 -1
  126. package/dist/components/textarea.js +1 -1
  127. package/dist/components/theme.cjs +100 -15
  128. package/dist/components/theme.cjs.map +1 -1
  129. package/dist/components/theme.d.cts +3 -2
  130. package/dist/components/theme.d.ts +3 -2
  131. package/dist/components/theme.js +101 -17
  132. package/dist/components/theme.js.map +1 -1
  133. package/dist/components/toast.cjs +1 -1
  134. package/dist/components/toast.js +1 -1
  135. package/dist/components/toggle-group.d.cts +1 -1
  136. package/dist/components/toggle-group.d.ts +1 -1
  137. package/dist/components/toggle-group.js +1 -1
  138. package/dist/components/toggle.cjs +1 -1
  139. package/dist/components/toggle.d.cts +1 -1
  140. package/dist/components/toggle.d.ts +1 -1
  141. package/dist/components/toggle.js +2 -2
  142. package/dist/components/tooltip.cjs +1 -1
  143. package/dist/components/tooltip.js +1 -1
  144. package/dist/components/trace.cjs +1 -1
  145. package/dist/components/trace.js +1 -1
  146. package/dist/lib/accent-theme.d.cts +1 -1
  147. package/dist/lib/accent-theme.d.ts +1 -1
  148. package/dist/lib/container-chrome.d.cts +1 -1
  149. package/dist/lib/container-chrome.d.ts +1 -1
  150. package/dist/lib/input-box-variants.d.cts +1 -1
  151. package/dist/lib/input-box-variants.d.ts +1 -1
  152. package/dist/lib/selection-list.d.cts +1 -1
  153. package/dist/lib/selection-list.d.ts +1 -1
  154. package/dist/lib/theme-types.cjs.map +1 -1
  155. package/dist/lib/theme-types.d.cts +2 -2
  156. package/dist/lib/theme-types.d.ts +2 -2
  157. package/dist/lib/theme-types.js.map +1 -1
  158. package/dist/lib/toggle-group-context.d.cts +1 -1
  159. package/dist/lib/toggle-group-context.d.ts +1 -1
  160. package/dist/styles/spark-default.css +98 -0
  161. package/dist/{theme-types-4iUp6JB6.d.ts → theme-types-Dlge0s3s.d.cts} +9 -4
  162. package/dist/{theme-types-4iUp6JB6.d.cts → theme-types-Dlge0s3s.d.ts} +9 -4
  163. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"theme.js","names":["React"],"sources":["../../src/components/theme.tsx"],"sourcesContent":["'use client'\n\nimport { mergeProps } from '@base-ui/react/merge-props'\nimport { useRender } from '@base-ui/react/use-render'\nimport * as React from 'react'\nimport {\n CURATED_ACCENTS,\n accentSparkVars,\n appearanceForBackground,\n generateAccentScale,\n getMatchingNeutral,\n invertAccentScale,\n isParsableColor,\n neutralFamilyVars,\n neutralSparkVars,\n resolveAutoNeutral,\n type Appearance,\n type SparkAccentScale,\n} from '../lib/accent-theme'\nimport {\n isSparkNeutralFamily,\n type SparkButtonColor,\n type SparkButtonRoles,\n type SparkCardColor,\n type SparkCardVariant,\n type SparkInputColor,\n type SparkInputStyle,\n type SparkLabelPosition,\n type SparkNeutral,\n type SparkRadius,\n type SparkScaling,\n type SparkSpacing,\n type SparkStyle,\n} from '../lib/theme-types'\nimport { cn } from '../utils/cn'\n\nexport type {\n SparkButtonColor,\n SparkButtonDesignVariant,\n SparkButtonRole,\n SparkButtonRoles,\n SparkCardColor,\n SparkCardVariant,\n SparkInputColor,\n SparkInputStyle,\n SparkLabelPosition,\n SparkNeutral,\n SparkNeutralFamily,\n SparkRadius,\n SparkScaling,\n SparkSpacing,\n SparkStyle,\n} from '../lib/theme-types'\n\n/** The epilot brand accent — the scale `spark-default.css` ships statically. */\nconst DEFAULT_ACCENT = '#005EB4'\n\nexport interface ThemeValue {\n /** Curated accent name or a custom hex. */\n accentColor?: string\n /**\n * Page canvas as a custom hex. Regenerates BOTH the accent and neutral scales against\n * it (each alpha step is composited against the canvas, so a saturated colour needs\n * the neutral ramp regenerated too, not just the accent). Unset → the fixed\n * `#ffffff` / `#000000` default, and neutrals stay on the static Radix families.\n */\n backgroundColor?: string\n /**\n * A curated family name, an arbitrary color to seed the neutral scale, or `'auto'` to\n * resolve one — preferring `backgroundColor`'s own hue when it's perceptibly tinted,\n * else pairing with the accent (Radix's `grayColor=\"auto\"`). A custom seed (from `auto`\n * or set directly) only regenerates the scale alongside a `backgroundColor`; without\n * one, `data-neutral-color` falls back to the accent-matched family and that's what\n * actually paints.\n */\n neutralColor?: SparkNeutral\n radius?: SparkRadius\n scaling?: SparkScaling\n spacing?: SparkSpacing\n styleVariant?: SparkStyle\n /** Orthogonal to `styleVariant`: shifts any style toward higher-contrast steps. */\n highContrast?: boolean\n /**\n * Orthogonal to `styleVariant`: re-casts the accent scale for use ON its own solid fill,\n * for controls sitting on a solid accent surface (a `<Card variant=\"solid\" color=\"accent\">`),\n * where a solid control would otherwise paint the same `--spark-9` as the card and vanish.\n * Swaps step 9 with its contrast ink, so the fill/ink pair stays WCAG-safe for any accent.\n */\n inverted?: boolean\n labelPosition?: SparkLabelPosition\n inputStyle?: SparkInputStyle\n inputColor?: SparkInputColor\n /** App-level default `<Card>` chrome; a per-card `variant` prop overrides it. */\n cardVariant?: SparkCardVariant\n /** App-level default `<Card>` palette; a per-card `color` prop overrides it. */\n cardColor?: SparkCardColor\n /** Looks of the `primary`, `secondary` and `tertiary` `<Button variant>`. */\n buttons?: SparkButtonRoles\n appearance?: Appearance\n /** Font stack for `h1`–`h6`. Any valid CSS `font-family` value. */\n fontHeading?: string\n /** Font stack for everything else. Any valid CSS `font-family` value. */\n fontBody?: string\n}\n\nconst ThemeContext = React.createContext<ThemeValue>({})\n\n/** What a Theme actually wrote to the DOM, merged over its ancestors (nearest wins). */\ninterface ThemeOutput {\n attrs: Record<string, string>\n vars: Record<string, string>\n scopes: string[]\n}\n\nfunction roleOf(\n style: SparkStyle | undefined,\n color: SparkButtonColor | undefined,\n) {\n if (style === undefined && color === undefined) return undefined\n return {\n ...(style !== undefined && { style }),\n ...(color !== undefined && { color }),\n }\n}\n\nfunction useButtonRoles(buttons: SparkButtonRoles | undefined) {\n const isSet = buttons !== undefined\n const { primary, secondary, tertiary } = buttons ?? {}\n const primaryStyle = primary?.style\n const primaryColor = primary?.color\n const secondaryStyle = secondary?.style\n const secondaryColor = secondary?.color\n const tertiaryStyle = tertiary?.style\n const tertiaryColor = tertiary?.color\n return React.useMemo<SparkButtonRoles | undefined>(() => {\n if (!isSet) return undefined\n const roles: SparkButtonRoles = {}\n const primaryRole = roleOf(primaryStyle, primaryColor)\n const secondaryRole = roleOf(secondaryStyle, secondaryColor)\n const tertiaryRole = roleOf(tertiaryStyle, tertiaryColor)\n if (primaryRole) roles.primary = primaryRole\n if (secondaryRole) roles.secondary = secondaryRole\n if (tertiaryRole) roles.tertiary = tertiaryRole\n return roles\n }, [\n isSet,\n primaryStyle,\n primaryColor,\n secondaryStyle,\n secondaryColor,\n tertiaryStyle,\n tertiaryColor,\n ])\n}\n\nconst ThemeOutputContext = React.createContext<ThemeOutput | null>(null)\n\n/** Merged theme values from enclosing `<Theme>` providers. */\nexport function useTheme(): ThemeValue {\n return React.useContext(ThemeContext)\n}\n\nexport interface ThemeProps\n extends useRender.ComponentProps<'div'>, ThemeValue {}\n\n/** Optional sugar: writes the theming `data-*` attrs + accent `--spark-*` vars onto a wrapper. */\nexport const Theme = React.forwardRef<HTMLDivElement, ThemeProps>(\n function Theme(\n {\n accentColor,\n backgroundColor,\n neutralColor,\n radius,\n scaling,\n spacing,\n styleVariant,\n highContrast,\n inverted,\n labelPosition,\n inputStyle,\n inputColor,\n cardVariant,\n cardColor,\n buttons: buttonsProp,\n appearance,\n fontHeading,\n fontBody,\n render,\n className,\n style,\n children,\n ...rest\n },\n ref,\n ) {\n const parent = useTheme()\n const buttons = useButtonRoles(buttonsProp)\n const parentOutput = React.useContext(ThemeOutputContext)\n\n const value = React.useMemo<ThemeValue>(\n () => ({\n accentColor: accentColor ?? parent.accentColor,\n backgroundColor: backgroundColor ?? parent.backgroundColor,\n neutralColor: neutralColor ?? parent.neutralColor,\n radius: radius ?? parent.radius,\n scaling: scaling ?? parent.scaling,\n spacing: spacing ?? parent.spacing,\n styleVariant: styleVariant ?? parent.styleVariant,\n highContrast: highContrast ?? parent.highContrast,\n inverted: inverted ?? parent.inverted,\n labelPosition: labelPosition ?? parent.labelPosition,\n inputStyle: inputStyle ?? parent.inputStyle,\n inputColor: inputColor ?? parent.inputColor,\n cardVariant: cardVariant ?? parent.cardVariant,\n cardColor: cardColor ?? parent.cardColor,\n buttons: buttons ? { ...parent.buttons, ...buttons } : parent.buttons,\n appearance: appearance ?? parent.appearance,\n fontHeading: fontHeading ?? parent.fontHeading,\n fontBody: fontBody ?? parent.fontBody,\n }),\n [\n accentColor,\n backgroundColor,\n neutralColor,\n radius,\n scaling,\n spacing,\n styleVariant,\n highContrast,\n inverted,\n labelPosition,\n inputStyle,\n inputColor,\n cardVariant,\n cardColor,\n buttons,\n appearance,\n fontHeading,\n fontBody,\n parent,\n ],\n )\n\n // Scope id for the ambient-appearance case (both scales emitted in a <style>).\n const scopeId = React.useId()\n\n // 'auto' pairs a neutral with the canvas's own tint when it has one, else the\n // effective accent (Radix's grayColor=\"auto\") — see resolveAutoNeutral. Reads the\n // OWN backgroundColor, not the merged value.backgroundColor: optsFor (below) only\n // ever regenerates against a scope's own canvas too, so preferring an inherited one\n // here would resolve a seed that then gets silently discarded.\n const rawNeutralColor =\n neutralColor === 'auto'\n ? resolveAutoNeutral(\n value.accentColor ?? DEFAULT_ACCENT,\n backgroundColor,\n )\n : neutralColor\n\n // A custom neutral that isn't a recognized family must be a real, parseable color —\n // reject invalid input here (e.g. a typo'd family name like \"slat\") so it can't throw\n // deep inside the shared generator, where the catch below would otherwise blame\n // accentColor/backgroundColor without ever naming neutralColor as the actual cause.\n const neutralColorIsValid =\n rawNeutralColor === undefined ||\n isSparkNeutralFamily(rawNeutralColor) ||\n isParsableColor(rawNeutralColor)\n if (!neutralColorIsValid) {\n console.warn(\n `[Theme] Ignoring invalid neutralColor \"${rawNeutralColor}\" — falling back to the accent-matched family.`,\n )\n }\n const resolvedNeutralColor = neutralColorIsValid\n ? rawNeutralColor\n : getMatchingNeutral(value.accentColor ?? DEFAULT_ACCENT)\n\n // The DOM attribute stays one of the 6 static families `[data-neutral-color]` has CSS\n // for — a raw color (from the canvas-tinted auto path, or an arbitrary neutralColor\n // prop) falls back to its accent-matched family here instead, so the attribute is\n // always CSS-selectable/debuggable rather than a sentinel nothing matches.\n // generateAccentScale still gets the real resolvedNeutralColor for generation, below —\n // this substitution is display-only, and doesn't by itself guarantee the *other*\n // appearance's neutrals in ambient (no explicit `appearance`) mode: that's a\n // pre-existing cross-appearance leak in the same family as review-findings.md #5, not\n // something this attribute fallback fixes or regresses.\n const neutralColorAttr =\n resolvedNeutralColor === undefined\n ? undefined\n : isSparkNeutralFamily(resolvedNeutralColor)\n ? resolvedNeutralColor\n : getMatchingNeutral(value.accentColor ?? DEFAULT_ACCENT)\n\n const accent = React.useMemo(() => {\n const empty = {\n inlineVars: {} as React.CSSProperties,\n portalVars: {} as React.CSSProperties,\n portalScope: undefined as string | undefined,\n css: '',\n scoped: false,\n }\n // A custom canvas generates even with no accent of its own: the neutral ramp is\n // composited against it, and --spark-background has to carry it.\n if (!accentColor && !backgroundColor) return empty\n\n const toVars = (decls: string[]) =>\n Object.fromEntries(\n decls\n .filter((decl) => decl.includes(':'))\n .map((decl) => {\n const i = decl.indexOf(':')\n return [\n decl.slice(0, i).trim(),\n decl\n .slice(i + 1)\n .replace(/;$/, '')\n .trim(),\n ]\n }),\n ) as React.CSSProperties\n\n try {\n const source = value.accentColor ?? DEFAULT_ACCENT\n const hex = CURATED_ACCENTS[source] ?? source\n\n // A canvas has a polarity, unlike an accent hue: a yellow page is a *light*\n // page, and reusing it for the dark scale yields light ink on a light canvas\n // (measured 1.16:1). So the custom canvas applies to the appearance it actually\n // belongs to, and the other keeps its default. One knob still covers the common\n // case — a tenant wanting both sets an explicit appearance per scope.\n const bgAppearance = backgroundColor\n ? appearanceForBackground(backgroundColor)\n : undefined\n\n // Honouring a mismatched canvas would paint light ink on a light page, so it's\n // dropped — but say so, or the prop looks broken.\n if (\n backgroundColor &&\n value.appearance &&\n bgAppearance !== value.appearance\n ) {\n console.warn(\n `[Theme] Ignoring backgroundColor \"${backgroundColor}\": it reads as a ${bgAppearance} canvas on an appearance=\"${value.appearance}\" scope. Pass a ${value.appearance} colour, or set it on a scope whose appearance matches.`,\n )\n }\n\n // Default to slate so a regenerated neutral stays in the family the static\n // `:root` default already points at, rather than the generator's ECP gray seed.\n const optsFor = (appearance: Appearance) =>\n backgroundColor && bgAppearance === appearance\n ? {\n background: backgroundColor,\n neutral: resolvedNeutralColor ?? ('slate' as const),\n }\n : undefined\n\n // Neutrals are only worth regenerating against a custom canvas — see\n // neutralSparkVars. Without one the static Radix families are already correct.\n const emit = (scale: SparkAccentScale, custom: boolean) =>\n custom\n ? [...accentSparkVars(scale), ...neutralSparkVars(scale)]\n : accentSparkVars(scale)\n\n const build = (appearance: Appearance) => {\n const opts = optsFor(appearance)\n const scale = generateAccentScale(hex, appearance, opts)\n // `inverted` re-casts the accent for a solid-accent surface; the neutral ramp is\n // unrelated to that swap, so it passes through untouched.\n const rendered = emit(\n inverted ? invertAccentScale(scale) : scale,\n opts != null,\n )\n // Popups sit on their own surface, so they get the scale before the inverted re-cast.\n const plain = inverted ? emit(scale, opts != null) : rendered\n return { rendered, plain }\n }\n\n // Explicit appearance → single-scale inline vars. Correct for a light\n // island inside a dark page (which must NOT pick up the dark scale).\n if (value.appearance) {\n const { rendered, plain } = build(value.appearance)\n const inlineVars = toVars(rendered)\n return {\n inlineVars,\n portalVars: inverted ? toVars(plain) : inlineVars,\n portalScope: undefined,\n css: '',\n scoped: false,\n }\n }\n\n // Ambient appearance → emit BOTH scales in a scoped <style> so the\n // `.dark` class selects the right one. Without this, a single-appearance\n // inline scale (default light) breaks components in dark mode.\n //\n // Both blocks must declare the SAME tokens. A custom canvas only regenerates\n // neutrals for its own appearance (see optsFor), and a custom property the other\n // block leaves undeclared keeps its sibling's value rather than falling back — so\n // the off-canvas appearance would paint this one's canvas-tinted neutrals, and\n // being unlayered they'd beat `[data-neutral-color]`'s @layer base mapping too.\n // Point it at the static family instead: the same seed the canvas side was given,\n // so the two appearances agree on family and differ only in canvas.\n const offCanvasNeutrals = backgroundColor\n ? neutralFamilyVars(resolvedNeutralColor ?? 'slate')\n : []\n const scaleFor = (appearance: Appearance) => {\n const { rendered, plain } = build(appearance)\n const extra = bgAppearance === appearance ? [] : offCanvasNeutrals\n return {\n rendered: [...rendered, ...extra],\n plain: [...plain, ...extra],\n }\n }\n const light = scaleFor('light')\n const dark = scaleFor('dark')\n const rule = (\n id: string,\n lightDecls: string[],\n darkDecls: string[],\n ) => {\n const sel = `[data-spark-scope~=\"${id}\"]`\n return `${sel}{${lightDecls.join('')}}:is(.dark,.dark-theme) ${sel}{${darkDecls.join('')}}`\n }\n const portalScope = inverted ? `${scopeId}p` : scopeId\n const css =\n rule(scopeId, light.rendered, dark.rendered) +\n (inverted ? rule(portalScope, light.plain, dark.plain) : '')\n return {\n inlineVars: {} as React.CSSProperties,\n portalVars: {} as React.CSSProperties,\n portalScope,\n css,\n scoped: true,\n }\n } catch (error) {\n // A bad accentColor/backgroundColor must not throw through render — fall back\n // to the default theme.\n console.warn(\n `[Theme] Ignoring invalid accentColor \"${accentColor}\" / backgroundColor \"${backgroundColor}\".`,\n error,\n )\n return empty\n }\n }, [\n accentColor,\n backgroundColor,\n inverted,\n resolvedNeutralColor,\n value.accentColor,\n value.appearance,\n scopeId,\n ])\n\n const attrs = React.useMemo(\n () => ({\n 'data-neutral-color': neutralColorAttr,\n 'data-radius': radius,\n 'data-scaling': scaling,\n 'data-spacing': spacing,\n 'data-style': styleVariant,\n 'data-high-contrast': highContrast ? '' : undefined,\n 'data-label-position': labelPosition,\n 'data-input-style': inputStyle,\n 'data-input-color': inputColor,\n 'data-card-variant': cardVariant,\n 'data-card-color': cardColor,\n }),\n [\n neutralColorAttr,\n radius,\n scaling,\n spacing,\n styleVariant,\n highContrast,\n labelPosition,\n inputStyle,\n inputColor,\n cardVariant,\n cardColor,\n ],\n )\n const fontVars = React.useMemo(\n () => ({\n ...(fontHeading ? { '--spark-font-heading': fontHeading } : null),\n ...(fontBody ? { '--spark-font-body': fontBody } : null),\n }),\n [fontHeading, fontBody],\n )\n\n const element = useRender({\n defaultTagName: 'div',\n render,\n ref,\n props: mergeProps<'div'>(\n {\n className: cn('spark-theme', appearance, className),\n ...attrs,\n 'data-inverted': inverted ? '' : undefined,\n 'data-spark-scope': accent.scoped ? scopeId : undefined,\n style: {\n ...accent.inlineVars,\n // Paint the canvas we were handed, else the prop emits a token and visibly\n // does nothing. Reads the var (not the raw prop) so the scoped <style>'s\n // per-appearance value still wins under ambient appearance.\n ...(backgroundColor\n ? { backgroundColor: 'var(--spark-background)' }\n : null),\n ...fontVars,\n ...style,\n } as React.CSSProperties,\n children,\n } as React.ComponentProps<'div'>,\n rest,\n ),\n })\n\n const output = React.useMemo<ThemeOutput>(() => {\n // An unset own knob must not blank out the ancestor's value it inherits.\n const own = Object.fromEntries(\n Object.entries(attrs).filter(\n (entry): entry is [string, string] => entry[1] !== undefined,\n ),\n )\n const parentScopes = parentOutput?.scopes ?? []\n return {\n attrs: { ...parentOutput?.attrs, ...own },\n vars: {\n ...parentOutput?.vars,\n ...(accent.portalVars as Record<string, string>),\n ...fontVars,\n },\n scopes: accent.portalScope\n ? [...parentScopes, accent.portalScope]\n : parentScopes,\n }\n }, [parentOutput, attrs, accent, fontVars])\n\n return (\n <ThemeContext.Provider value={value}>\n <ThemeOutputContext.Provider value={output}>\n {accent.css ? <style>{accent.css}</style> : null}\n {element}\n </ThemeOutputContext.Provider>\n </ThemeContext.Provider>\n )\n },\n)\n\n/** Re-emits what the enclosing Themes rendered inside a portal, where CSS inheritance from them stops. */\nexport function PortalTheme({ children }: { children: React.ReactNode }) {\n const output = React.useContext(ThemeOutputContext)\n const theme = useTheme()\n // A popup sits on its own surface, never on the solid accent `inverted` is for.\n const value = React.useMemo(() => ({ ...theme, inverted: false }), [theme])\n if (!output) return <>{children}</>\n return (\n <ThemeContext.Provider value={value}>\n <div\n data-slot=\"portal-theme\"\n className={cn('spark-theme', theme.appearance)}\n {...output.attrs}\n data-spark-scope={\n output.scopes.length ? output.scopes.join(' ') : undefined\n }\n style={{ display: 'contents', ...output.vars }}\n >\n {children}\n </div>\n </ThemeContext.Provider>\n )\n}\n"],"mappings":";;;;;;;;;;;AAuDA,MAAM,iBAAiB;AAkDvB,MAAM,eAAeA,QAAM,cAA0B,CAAC,CAAC;AASvD,SAAS,OACP,OACA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G,eAAe,MAAM,UAAU;GAC7C,GAAI,OAAO;GACX,oBACE,OAAO,OAAO,SAAS,OAAO,OAAO,KAAK,GAAG,IAAI,KAAA;GAEnD,OAAO;IAAE,SAAS;IAAY,GAAG,OAAO;GAAK;GAE5C;EACE,CAAA;CACgB,CAAA;AAE3B"}
1
+ {"version":3,"file":"theme.js","names":["React"],"sources":["../../src/components/theme.tsx"],"sourcesContent":["'use client'\n\nimport { mergeProps } from '@base-ui/react/merge-props'\nimport { useRender } from '@base-ui/react/use-render'\nimport * as React from 'react'\nimport {\n CURATED_ACCENTS,\n accentSparkVars,\n appearanceForBackground,\n generateAccentScale,\n getMatchingNeutral,\n invertAccentScale,\n isParsableColor,\n neutralFamilyVars,\n neutralSparkVars,\n resolveAutoNeutral,\n type Appearance,\n type SparkAccentScale,\n} from '../lib/accent-theme'\nimport {\n isSparkNeutralFamily,\n type SparkButtonColor,\n type SparkButtonDesignColor,\n type SparkButtonDesignVariant,\n type SparkButtonRole,\n type SparkButtonRoles,\n type SparkCardColor,\n type SparkCardVariant,\n type SparkInputColor,\n type SparkInputStyle,\n type SparkLabelPosition,\n type SparkNeutral,\n type SparkRadius,\n type SparkScaling,\n type SparkSpacing,\n type SparkStyle,\n} from '../lib/theme-types'\nimport { cn } from '../utils/cn'\n\nexport type {\n SparkButtonColor,\n SparkButtonDesignVariant,\n SparkButtonRole,\n SparkButtonRoles,\n SparkCardColor,\n SparkCardVariant,\n SparkInputColor,\n SparkInputStyle,\n SparkLabelPosition,\n SparkNeutral,\n SparkNeutralFamily,\n SparkRadius,\n SparkScaling,\n SparkSpacing,\n SparkStyle,\n} from '../lib/theme-types'\n\n/** The epilot brand accent — the scale `spark-default.css` ships statically. */\nconst DEFAULT_ACCENT = '#005EB4'\n\nexport interface ThemeValue {\n /** Curated accent name or a custom hex. */\n accentColor?: string\n /**\n * Page canvas as a custom hex. Regenerates BOTH the accent and neutral scales against\n * it (each alpha step is composited against the canvas, so a saturated colour needs\n * the neutral ramp regenerated too, not just the accent). Unset → the fixed\n * `#ffffff` / `#000000` default, and neutrals stay on the static Radix families.\n */\n backgroundColor?: string\n /**\n * A curated family name, an arbitrary color to seed the neutral scale, or `'auto'` to\n * resolve one — preferring `backgroundColor`'s own hue when it's perceptibly tinted,\n * else pairing with the accent (Radix's `grayColor=\"auto\"`). A custom seed (from `auto`\n * or set directly) only regenerates the scale alongside a `backgroundColor`; without\n * one, `data-neutral-color` falls back to the accent-matched family and that's what\n * actually paints.\n */\n neutralColor?: SparkNeutral\n radius?: SparkRadius\n scaling?: SparkScaling\n spacing?: SparkSpacing\n styleVariant?: SparkStyle\n /** Orthogonal to `styleVariant`: shifts any style toward higher-contrast steps. */\n highContrast?: boolean\n /**\n * Orthogonal to `styleVariant`: re-casts the accent scale for use ON its own solid fill,\n * for controls sitting on a solid accent surface (a `<Card variant=\"solid\" color=\"accent\">`),\n * where a solid control would otherwise paint the same `--spark-9` as the card and vanish.\n * Swaps step 9 with its contrast ink, so the fill/ink pair stays WCAG-safe for any accent.\n */\n inverted?: boolean\n labelPosition?: SparkLabelPosition\n inputStyle?: SparkInputStyle\n inputColor?: SparkInputColor\n /** App-level default `<Card>` chrome; a per-card `variant` prop overrides it. */\n cardVariant?: SparkCardVariant\n /** App-level default `<Card>` palette; a per-card `color` prop overrides it. */\n cardColor?: SparkCardColor\n /** Looks of the `primary`, `secondary` and `tertiary` `<Button variant>`. */\n buttons?: SparkButtonRoles\n appearance?: Appearance\n /** Font stack for `h1`–`h6`. Any valid CSS `font-family` value. */\n fontHeading?: string\n /** Font stack for everything else. Any valid CSS `font-family` value. */\n fontBody?: string\n}\n\nconst ThemeContext = React.createContext<ThemeValue>({})\n\n/** What a Theme actually wrote to the DOM, merged over its ancestors (nearest wins). */\ninterface ThemeOutput {\n attrs: Record<string, string>\n vars: Record<string, string>\n scopes: string[]\n}\n\nfunction roleOf(\n style: SparkStyle | undefined,\n color: SparkButtonRole['color'],\n) {\n if (style === undefined && color === undefined) return undefined\n return {\n ...(style !== undefined && { style }),\n ...(color !== undefined && { color }),\n }\n}\n\nconst DESIGN_VARIANTS = [\n 'primary',\n 'secondary',\n 'tertiary',\n] as const satisfies readonly SparkButtonDesignVariant[]\n\nexport function isDesignColor(value: unknown): value is SparkButtonDesignColor {\n return (\n typeof value === 'object' &&\n value !== null &&\n typeof (value as SparkButtonDesignColor).light === 'string'\n )\n}\n\nconst colorKey = (color: SparkButtonRole['color']) =>\n isDesignColor(color)\n ? JSON.stringify({ light: color.light, dark: color.dark })\n : color\n\nconst colorFromKey = (key: string | undefined): SparkButtonRole['color'] =>\n key?.startsWith('{')\n ? (JSON.parse(key) as SparkButtonDesignColor)\n : (key as SparkButtonColor | undefined)\n\nfunction parsableColor(\n variant: SparkButtonDesignVariant,\n color: SparkButtonRole['color'],\n): SparkButtonRole['color'] {\n if (!isDesignColor(color)) return color\n if (!isParsableColor(color.light)) {\n console.warn(\n `[Theme] Ignoring invalid buttons.${variant}.color \"${color.light}\".`,\n )\n return undefined\n }\n if (color.dark !== undefined && !isParsableColor(color.dark)) {\n console.warn(\n `[Theme] Ignoring invalid buttons.${variant}.color dark \"${color.dark}\".`,\n )\n return { light: color.light }\n }\n return color.dark === undefined ? { light: color.light } : color\n}\n\nfunction useButtonRoles(buttons: SparkButtonRoles | undefined) {\n const isSet = buttons !== undefined\n const { primary, secondary, tertiary } = buttons ?? {}\n const primaryStyle = primary?.style\n const primaryColor = colorKey(primary?.color)\n const secondaryStyle = secondary?.style\n const secondaryColor = colorKey(secondary?.color)\n const tertiaryStyle = tertiary?.style\n const tertiaryColor = colorKey(tertiary?.color)\n return React.useMemo<SparkButtonRoles | undefined>(() => {\n if (!isSet) return undefined\n const roles: SparkButtonRoles = {}\n const primaryRole = roleOf(\n primaryStyle,\n parsableColor('primary', colorFromKey(primaryColor)),\n )\n const secondaryRole = roleOf(\n secondaryStyle,\n parsableColor('secondary', colorFromKey(secondaryColor)),\n )\n const tertiaryRole = roleOf(\n tertiaryStyle,\n parsableColor('tertiary', colorFromKey(tertiaryColor)),\n )\n if (primaryRole) roles.primary = primaryRole\n if (secondaryRole) roles.secondary = secondaryRole\n if (tertiaryRole) roles.tertiary = tertiaryRole\n return roles\n }, [\n isSet,\n primaryStyle,\n primaryColor,\n secondaryStyle,\n secondaryColor,\n tertiaryStyle,\n tertiaryColor,\n ])\n}\n\nfunction mergeRoles(\n parent: SparkButtonRoles | undefined,\n own: SparkButtonRoles,\n): SparkButtonRoles {\n const merged: SparkButtonRoles = { ...parent }\n for (const variant of DESIGN_VARIANTS) {\n if (own[variant])\n merged[variant] = { ...parent?.[variant], ...own[variant] }\n }\n return merged\n}\n\nfunction buttonColorDecls(\n roles: SparkButtonRoles | undefined,\n appearance: Appearance,\n): string[] {\n const decls: string[] = []\n for (const variant of DESIGN_VARIANTS) {\n const color = roles?.[variant]?.color\n if (!isDesignColor(color)) continue\n const hex =\n appearance === 'dark' ? (color.dark ?? color.light) : color.light\n const scale = generateAccentScale(hex, appearance)\n const prefix = `--spark-button-${variant}`\n decls.push(\n ...scale.accentScale.map((c, i) => `${prefix}-${i + 1}: ${c};`),\n ...scale.accentScaleAlpha.map((c, i) => `${prefix}-a${i + 1}: ${c};`),\n `${prefix}-contrast: ${scale.accentContrast};`,\n `${prefix}-on-solid: ${scale.accentOnSolid};`,\n `${prefix}-surface: ${scale.accentSurface};`,\n )\n }\n return decls\n}\n\nfunction declsToVars(decls: string[]): Record<string, string> {\n return Object.fromEntries(\n decls.map((decl) => {\n const i = decl.indexOf(':')\n return [decl.slice(0, i).trim(), decl.slice(i + 1, -1).trim()]\n }),\n )\n}\n\nconst ThemeOutputContext = React.createContext<ThemeOutput | null>(null)\n\n/** Merged theme values from enclosing `<Theme>` providers. */\nexport function useTheme(): ThemeValue {\n return React.useContext(ThemeContext)\n}\n\nexport interface ThemeProps\n extends useRender.ComponentProps<'div'>, ThemeValue {}\n\n/** Optional sugar: writes the theming `data-*` attrs + accent `--spark-*` vars onto a wrapper. */\nexport const Theme = React.forwardRef<HTMLDivElement, ThemeProps>(\n function Theme(\n {\n accentColor,\n backgroundColor,\n neutralColor,\n radius,\n scaling,\n spacing,\n styleVariant,\n highContrast,\n inverted,\n labelPosition,\n inputStyle,\n inputColor,\n cardVariant,\n cardColor,\n buttons: buttonsProp,\n appearance,\n fontHeading,\n fontBody,\n render,\n className,\n style,\n children,\n ...rest\n },\n ref,\n ) {\n const parent = useTheme()\n const buttons = useButtonRoles(buttonsProp)\n const parentOutput = React.useContext(ThemeOutputContext)\n\n const value = React.useMemo<ThemeValue>(\n () => ({\n accentColor: accentColor ?? parent.accentColor,\n backgroundColor: backgroundColor ?? parent.backgroundColor,\n neutralColor: neutralColor ?? parent.neutralColor,\n radius: radius ?? parent.radius,\n scaling: scaling ?? parent.scaling,\n spacing: spacing ?? parent.spacing,\n styleVariant: styleVariant ?? parent.styleVariant,\n highContrast: highContrast ?? parent.highContrast,\n inverted: inverted ?? parent.inverted,\n labelPosition: labelPosition ?? parent.labelPosition,\n inputStyle: inputStyle ?? parent.inputStyle,\n inputColor: inputColor ?? parent.inputColor,\n cardVariant: cardVariant ?? parent.cardVariant,\n cardColor: cardColor ?? parent.cardColor,\n buttons: buttons ? mergeRoles(parent.buttons, buttons) : parent.buttons,\n appearance: appearance ?? parent.appearance,\n fontHeading: fontHeading ?? parent.fontHeading,\n fontBody: fontBody ?? parent.fontBody,\n }),\n [\n accentColor,\n backgroundColor,\n neutralColor,\n radius,\n scaling,\n spacing,\n styleVariant,\n highContrast,\n inverted,\n labelPosition,\n inputStyle,\n inputColor,\n cardVariant,\n cardColor,\n buttons,\n appearance,\n fontHeading,\n fontBody,\n parent,\n ],\n )\n\n // Scope id for the ambient-appearance case (both scales emitted in a <style>).\n const scopeId = React.useId()\n\n // 'auto' pairs a neutral with the canvas's own tint when it has one, else the\n // effective accent (Radix's grayColor=\"auto\") — see resolveAutoNeutral. Reads the\n // OWN backgroundColor, not the merged value.backgroundColor: optsFor (below) only\n // ever regenerates against a scope's own canvas too, so preferring an inherited one\n // here would resolve a seed that then gets silently discarded.\n const rawNeutralColor =\n neutralColor === 'auto'\n ? resolveAutoNeutral(\n value.accentColor ?? DEFAULT_ACCENT,\n backgroundColor,\n )\n : neutralColor\n\n // A custom neutral that isn't a recognized family must be a real, parseable color —\n // reject invalid input here (e.g. a typo'd family name like \"slat\") so it can't throw\n // deep inside the shared generator, where the catch below would otherwise blame\n // accentColor/backgroundColor without ever naming neutralColor as the actual cause.\n const neutralColorIsValid =\n rawNeutralColor === undefined ||\n isSparkNeutralFamily(rawNeutralColor) ||\n isParsableColor(rawNeutralColor)\n if (!neutralColorIsValid) {\n console.warn(\n `[Theme] Ignoring invalid neutralColor \"${rawNeutralColor}\" — falling back to the accent-matched family.`,\n )\n }\n const resolvedNeutralColor = neutralColorIsValid\n ? rawNeutralColor\n : getMatchingNeutral(value.accentColor ?? DEFAULT_ACCENT)\n\n // The DOM attribute stays one of the 6 static families `[data-neutral-color]` has CSS\n // for — a raw color (from the canvas-tinted auto path, or an arbitrary neutralColor\n // prop) falls back to its accent-matched family here instead, so the attribute is\n // always CSS-selectable/debuggable rather than a sentinel nothing matches.\n // generateAccentScale still gets the real resolvedNeutralColor for generation, below —\n // this substitution is display-only, and doesn't by itself guarantee the *other*\n // appearance's neutrals in ambient (no explicit `appearance`) mode: that's a\n // pre-existing cross-appearance leak in the same family as review-findings.md #5, not\n // something this attribute fallback fixes or regresses.\n const neutralColorAttr =\n resolvedNeutralColor === undefined\n ? undefined\n : isSparkNeutralFamily(resolvedNeutralColor)\n ? resolvedNeutralColor\n : getMatchingNeutral(value.accentColor ?? DEFAULT_ACCENT)\n\n const accent = React.useMemo(() => {\n const empty = {\n inlineVars: {} as React.CSSProperties,\n portalVars: {} as React.CSSProperties,\n portalScope: undefined as string | undefined,\n css: '',\n scoped: false,\n }\n // A custom canvas generates even with no accent of its own: the neutral ramp is\n // composited against it, and --spark-background has to carry it.\n if (!accentColor && !backgroundColor) return empty\n\n const toVars = (decls: string[]) =>\n Object.fromEntries(\n decls\n .filter((decl) => decl.includes(':'))\n .map((decl) => {\n const i = decl.indexOf(':')\n return [\n decl.slice(0, i).trim(),\n decl\n .slice(i + 1)\n .replace(/;$/, '')\n .trim(),\n ]\n }),\n ) as React.CSSProperties\n\n try {\n const source = value.accentColor ?? DEFAULT_ACCENT\n const hex = CURATED_ACCENTS[source] ?? source\n\n // A canvas has a polarity, unlike an accent hue: a yellow page is a *light*\n // page, and reusing it for the dark scale yields light ink on a light canvas\n // (measured 1.16:1). So the custom canvas applies to the appearance it actually\n // belongs to, and the other keeps its default. One knob still covers the common\n // case — a tenant wanting both sets an explicit appearance per scope.\n const bgAppearance = backgroundColor\n ? appearanceForBackground(backgroundColor)\n : undefined\n\n // Honouring a mismatched canvas would paint light ink on a light page, so it's\n // dropped — but say so, or the prop looks broken.\n if (\n backgroundColor &&\n value.appearance &&\n bgAppearance !== value.appearance\n ) {\n console.warn(\n `[Theme] Ignoring backgroundColor \"${backgroundColor}\": it reads as a ${bgAppearance} canvas on an appearance=\"${value.appearance}\" scope. Pass a ${value.appearance} colour, or set it on a scope whose appearance matches.`,\n )\n }\n\n // Default to slate so a regenerated neutral stays in the family the static\n // `:root` default already points at, rather than the generator's ECP gray seed.\n const optsFor = (appearance: Appearance) =>\n backgroundColor && bgAppearance === appearance\n ? {\n background: backgroundColor,\n neutral: resolvedNeutralColor ?? ('slate' as const),\n }\n : undefined\n\n // Neutrals are only worth regenerating against a custom canvas — see\n // neutralSparkVars. Without one the static Radix families are already correct.\n const emit = (scale: SparkAccentScale, custom: boolean) =>\n custom\n ? [...accentSparkVars(scale), ...neutralSparkVars(scale)]\n : accentSparkVars(scale)\n\n const build = (appearance: Appearance) => {\n const opts = optsFor(appearance)\n const scale = generateAccentScale(hex, appearance, opts)\n // `inverted` re-casts the accent for a solid-accent surface; the neutral ramp is\n // unrelated to that swap, so it passes through untouched.\n const rendered = emit(\n inverted ? invertAccentScale(scale) : scale,\n opts != null,\n )\n // Popups sit on their own surface, so they get the scale before the inverted re-cast.\n const plain = inverted ? emit(scale, opts != null) : rendered\n return { rendered, plain }\n }\n\n // Explicit appearance → single-scale inline vars. Correct for a light\n // island inside a dark page (which must NOT pick up the dark scale).\n if (value.appearance) {\n const { rendered, plain } = build(value.appearance)\n const inlineVars = toVars(rendered)\n return {\n inlineVars,\n portalVars: inverted ? toVars(plain) : inlineVars,\n portalScope: undefined,\n css: '',\n scoped: false,\n }\n }\n\n // Ambient appearance → emit BOTH scales in a scoped <style> so the\n // `.dark` class selects the right one. Without this, a single-appearance\n // inline scale (default light) breaks components in dark mode.\n //\n // Both blocks must declare the SAME tokens. A custom canvas only regenerates\n // neutrals for its own appearance (see optsFor), and a custom property the other\n // block leaves undeclared keeps its sibling's value rather than falling back — so\n // the off-canvas appearance would paint this one's canvas-tinted neutrals, and\n // being unlayered they'd beat `[data-neutral-color]`'s @layer base mapping too.\n // Point it at the static family instead: the same seed the canvas side was given,\n // so the two appearances agree on family and differ only in canvas.\n const offCanvasNeutrals = backgroundColor\n ? neutralFamilyVars(resolvedNeutralColor ?? 'slate')\n : []\n const scaleFor = (appearance: Appearance) => {\n const { rendered, plain } = build(appearance)\n const extra = bgAppearance === appearance ? [] : offCanvasNeutrals\n return {\n rendered: [...rendered, ...extra],\n plain: [...plain, ...extra],\n }\n }\n const light = scaleFor('light')\n const dark = scaleFor('dark')\n const rule = (\n id: string,\n lightDecls: string[],\n darkDecls: string[],\n ) => {\n const sel = `[data-spark-scope~=\"${id}\"]`\n return `${sel}{${lightDecls.join('')}}:is(.dark,.dark-theme) ${sel}{${darkDecls.join('')}}`\n }\n const portalScope = inverted ? `${scopeId}p` : scopeId\n const css =\n rule(scopeId, light.rendered, dark.rendered) +\n (inverted ? rule(portalScope, light.plain, dark.plain) : '')\n return {\n inlineVars: {} as React.CSSProperties,\n portalVars: {} as React.CSSProperties,\n portalScope,\n css,\n scoped: true,\n }\n } catch (error) {\n // A bad accentColor/backgroundColor must not throw through render — fall back\n // to the default theme.\n console.warn(\n `[Theme] Ignoring invalid accentColor \"${accentColor}\" / backgroundColor \"${backgroundColor}\".`,\n error,\n )\n return empty\n }\n }, [\n accentColor,\n backgroundColor,\n inverted,\n resolvedNeutralColor,\n value.accentColor,\n value.appearance,\n scopeId,\n ])\n\n const attrs = React.useMemo(\n () => ({\n 'data-neutral-color': neutralColorAttr,\n 'data-radius': radius,\n 'data-scaling': scaling,\n 'data-spacing': spacing,\n 'data-style': styleVariant,\n 'data-high-contrast': highContrast ? '' : undefined,\n 'data-label-position': labelPosition,\n 'data-input-style': inputStyle,\n 'data-input-color': inputColor,\n 'data-card-variant': cardVariant,\n 'data-card-color': cardColor,\n }),\n [\n neutralColorAttr,\n radius,\n scaling,\n spacing,\n styleVariant,\n highContrast,\n labelPosition,\n inputStyle,\n inputColor,\n cardVariant,\n cardColor,\n ],\n )\n const fontVars = React.useMemo(\n () => ({\n ...(fontHeading ? { '--spark-font-heading': fontHeading } : null),\n ...(fontBody ? { '--spark-font-body': fontBody } : null),\n }),\n [fontHeading, fontBody],\n )\n\n const buttonVars = React.useMemo(() => {\n if (value.appearance) {\n const decls = buttonColorDecls(buttons, value.appearance)\n return { vars: declsToVars(decls), scope: undefined, css: '' }\n }\n const light = buttonColorDecls(buttons, 'light')\n const dark = buttonColorDecls(buttons, 'dark')\n if (!light.length) return { vars: {}, scope: undefined, css: '' }\n const scope = `${scopeId}b`\n const sel = `[data-spark-scope~=\"${scope}\"]`\n return {\n vars: {},\n scope,\n css: `${sel}{${light.join('')}}:is(.dark,.dark-theme) ${sel}{${dark.join('')}}`,\n }\n }, [buttons, value.appearance, scopeId])\n\n const ownScopes = [\n ...(accent.scoped ? [scopeId] : []),\n ...(buttonVars.scope ? [buttonVars.scope] : []),\n ]\n\n const element = useRender({\n defaultTagName: 'div',\n render,\n ref,\n props: mergeProps<'div'>(\n {\n className: cn('spark-theme', appearance, className),\n ...attrs,\n 'data-inverted': inverted ? '' : undefined,\n 'data-spark-scope': ownScopes.length\n ? ownScopes.join(' ')\n : undefined,\n style: {\n ...accent.inlineVars,\n // Paint the canvas we were handed, else the prop emits a token and visibly\n // does nothing. Reads the var (not the raw prop) so the scoped <style>'s\n // per-appearance value still wins under ambient appearance.\n ...(backgroundColor\n ? { backgroundColor: 'var(--spark-background)' }\n : null),\n ...fontVars,\n ...buttonVars.vars,\n ...style,\n } as React.CSSProperties,\n children,\n } as React.ComponentProps<'div'>,\n rest,\n ),\n })\n\n const output = React.useMemo<ThemeOutput>(() => {\n // An unset own knob must not blank out the ancestor's value it inherits.\n const own = Object.fromEntries(\n Object.entries(attrs).filter(\n (entry): entry is [string, string] => entry[1] !== undefined,\n ),\n )\n const parentScopes = parentOutput?.scopes ?? []\n return {\n attrs: { ...parentOutput?.attrs, ...own },\n vars: {\n ...parentOutput?.vars,\n ...(accent.portalVars as Record<string, string>),\n ...fontVars,\n ...buttonVars.vars,\n },\n scopes: [\n ...parentScopes,\n ...(accent.portalScope ? [accent.portalScope] : []),\n ...(buttonVars.scope ? [buttonVars.scope] : []),\n ],\n }\n }, [parentOutput, attrs, accent, fontVars, buttonVars])\n\n return (\n <ThemeContext.Provider value={value}>\n <ThemeOutputContext.Provider value={output}>\n {accent.css ? <style>{accent.css}</style> : null}\n {buttonVars.css ? <style>{buttonVars.css}</style> : null}\n {element}\n </ThemeOutputContext.Provider>\n </ThemeContext.Provider>\n )\n },\n)\n\n/** Re-emits what the enclosing Themes rendered inside a portal, where CSS inheritance from them stops. */\nexport function PortalTheme({ children }: { children: React.ReactNode }) {\n const output = React.useContext(ThemeOutputContext)\n const theme = useTheme()\n // A popup sits on its own surface, never on the solid accent `inverted` is for.\n const value = React.useMemo(() => ({ ...theme, inverted: false }), [theme])\n if (!output) return <>{children}</>\n return (\n <ThemeContext.Provider value={value}>\n <div\n data-slot=\"portal-theme\"\n className={cn('spark-theme', theme.appearance)}\n {...output.attrs}\n data-spark-scope={\n output.scopes.length ? output.scopes.join(' ') : undefined\n }\n style={{ display: 'contents', ...output.vars }}\n >\n {children}\n </div>\n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;IAC3C,WAAW,MAAM,oBAAC,SAAD,EAAA,UAAQ,WAAW,IAAW,CAAA,IAAI;IACnD;GAC0B;;CACR,CAAA;AAE3B,CACF;;AAGA,SAAgB,YAAY,EAAE,YAA2C;CACvE,MAAM,SAASA,QAAM,WAAW,kBAAkB;CAClD,MAAM,QAAQ,SAAS;CAEvB,MAAM,QAAQA,QAAM,eAAe;EAAE,GAAG;EAAO,UAAU;CAAM,IAAI,CAAC,KAAK,CAAC;CAC1E,IAAI,CAAC,QAAQ,OAAO,oBAAA,UAAA,EAAG,SAAW,CAAA;CAClC,OACE,oBAAC,aAAa,UAAd;EAA8B;YAC5B,oBAAC,OAAD;GACE,aAAU;GACV,WAAW,GAAG,eAAe,MAAM,UAAU;GAC7C,GAAI,OAAO;GACX,oBACE,OAAO,OAAO,SAAS,OAAO,OAAO,KAAK,GAAG,IAAI,KAAA;GAEnD,OAAO;IAAE,SAAS;IAAY,GAAG,OAAO;GAAK;GAE5C;EACE,CAAA;CACgB,CAAA;AAE3B"}
@@ -5,9 +5,9 @@ const require_chunk = require("../chunk-DY84GLCh.cjs");
5
5
  const require_components_theme = require("./theme.cjs");
6
6
  const require_components_button = require("./button.cjs");
7
7
  const require_components_spinner = require("./spinner.cjs");
8
- let _epilot_spark_icons = require("@epilot/spark-icons");
9
8
  let react = require("react");
10
9
  react = require_chunk.__toESM(react);
10
+ let _epilot_spark_icons = require("@epilot/spark-icons");
11
11
  let react_jsx_runtime = require("react/jsx-runtime");
12
12
  let _base_ui_react_toast = require("@base-ui/react/toast");
13
13
  let cn = require("cn");
@@ -4,8 +4,8 @@ import { cn } from "../utils/cn.js";
4
4
  import { PortalTheme } from "./theme.js";
5
5
  import { buttonVariants } from "./button.js";
6
6
  import { Spinner } from "./spinner.js";
7
- import { Cancel, CheckCircle, Close, Info, Warning } from "@epilot/spark-icons";
8
7
  import "react";
8
+ import { Cancel, CheckCircle, Close, Info, Warning } from "@epilot/spark-icons";
9
9
  import { jsx, jsxs } from "react/jsx-runtime";
10
10
  import { Toast } from "@base-ui/react/toast";
11
11
  //#region src/components/toast.tsx
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
 
3
- import { n as SparkButtonColor } from "../theme-types-4iUp6JB6.cjs";
3
+ import { n as SparkButtonColor } from "../theme-types-Dlge0s3s.cjs";
4
4
  import { ToggleProps, ToggleStyle } from "./toggle.cjs";
5
5
  import * as React$1 from "react";
6
6
  import { ToggleGroup as ToggleGroup$1 } from "@base-ui/react/toggle-group";
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
 
3
- import { n as SparkButtonColor } from "../theme-types-4iUp6JB6.js";
3
+ import { n as SparkButtonColor } from "../theme-types-Dlge0s3s.js";
4
4
  import { ToggleProps, ToggleStyle } from "./toggle.js";
5
5
  import * as React$1 from "react";
6
6
  import { ToggleGroup as ToggleGroup$1 } from "@base-ui/react/toggle-group";
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  "use client";
3
- import { cn } from "../utils/cn.js";
4
3
  import { accentByColor } from "../lib/accent-colors.js";
4
+ import { cn } from "../utils/cn.js";
5
5
  import { ToggleGroupContext } from "../lib/toggle-group-context.js";
6
6
  import * as React$1 from "react";
7
7
  import { jsx } from "react/jsx-runtime";
@@ -3,8 +3,8 @@
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
4
4
  const require_chunk = require("../chunk-DY84GLCh.cjs");
5
5
  const require_lib_accent_colors = require("../lib/accent-colors.cjs");
6
- const require_components_button = require("./button.cjs");
7
6
  const require_lib_toggle_group_context = require("../lib/toggle-group-context.cjs");
7
+ const require_components_button = require("./button.cjs");
8
8
  let react = require("react");
9
9
  react = require_chunk.__toESM(react);
10
10
  let react_jsx_runtime = require("react/jsx-runtime");
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
 
3
- import { _ as SparkStyle, n as SparkButtonColor } from "../theme-types-4iUp6JB6.cjs";
3
+ import { n as SparkButtonColor, v as SparkStyle } from "../theme-types-Dlge0s3s.cjs";
4
4
  import { buttonVariants } from "./button.cjs";
5
5
  import * as React$1 from "react";
6
6
  import { VariantProps } from "class-variance-authority";
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
 
3
- import { _ as SparkStyle, n as SparkButtonColor } from "../theme-types-4iUp6JB6.js";
3
+ import { n as SparkButtonColor, v as SparkStyle } from "../theme-types-Dlge0s3s.js";
4
4
  import { buttonVariants } from "./button.js";
5
5
  import * as React$1 from "react";
6
6
  import { VariantProps } from "class-variance-authority";
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  "use client";
3
- import { cn } from "../utils/cn.js";
4
3
  import { accentByColor } from "../lib/accent-colors.js";
5
- import { buttonVariants } from "./button.js";
4
+ import { cn } from "../utils/cn.js";
6
5
  import { ToggleGroupContext } from "../lib/toggle-group-context.js";
6
+ import { buttonVariants } from "./button.js";
7
7
  import * as React$1 from "react";
8
8
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
9
9
  import { Toggle as Toggle$1 } from "@base-ui/react/toggle";
@@ -2,9 +2,9 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const require_chunk = require("../chunk-DY84GLCh.cjs");
4
4
  const require_components_theme = require("./theme.cjs");
5
- let _epilot_spark_icons = require("@epilot/spark-icons");
6
5
  let react = require("react");
7
6
  react = require_chunk.__toESM(react);
7
+ let _epilot_spark_icons = require("@epilot/spark-icons");
8
8
  let react_jsx_runtime = require("react/jsx-runtime");
9
9
  let _base_ui_react_tooltip = require("@base-ui/react/tooltip");
10
10
  let cn = require("cn");
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import { cn } from "../utils/cn.js";
3
3
  import { PortalTheme } from "./theme.js";
4
- import { Info } from "@epilot/spark-icons";
5
4
  import "react";
5
+ import { Info } from "@epilot/spark-icons";
6
6
  import { jsx, jsxs } from "react/jsx-runtime";
7
7
  import { Tooltip as Tooltip$1 } from "@base-ui/react/tooltip";
8
8
  //#region src/components/tooltip.tsx
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const require_chunk = require("../chunk-DY84GLCh.cjs");
4
- let _epilot_spark_icons = require("@epilot/spark-icons");
5
4
  let react = require("react");
6
5
  react = require_chunk.__toESM(react);
6
+ let _epilot_spark_icons = require("@epilot/spark-icons");
7
7
  let react_jsx_runtime = require("react/jsx-runtime");
8
8
  let _base_ui_react_collapsible = require("@base-ui/react/collapsible");
9
9
  let cn = require("cn");
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { cn } from "../utils/cn.js";
3
- import { ChevronRight } from "@epilot/spark-icons";
4
3
  import "react";
4
+ import { ChevronRight } from "@epilot/spark-icons";
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
6
6
  import { Collapsible } from "@base-ui/react/collapsible";
7
7
  //#region src/components/trace.tsx
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
 
3
- import { f as SparkNeutral, p as SparkNeutralFamily } from "../theme-types-4iUp6JB6.cjs";
3
+ import { m as SparkNeutralFamily, p as SparkNeutral } from "../theme-types-Dlge0s3s.cjs";
4
4
  import { t as generateRadixColors } from "../generate-radix-colors-BY4Wjsm7.cjs";
5
5
 
6
6
  //#region src/lib/accent-theme.d.ts
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
 
3
- import { f as SparkNeutral, p as SparkNeutralFamily } from "../theme-types-4iUp6JB6.js";
3
+ import { m as SparkNeutralFamily, p as SparkNeutral } from "../theme-types-Dlge0s3s.js";
4
4
  import { t as generateRadixColors } from "../generate-radix-colors-BY4Wjsm7.js";
5
5
 
6
6
  //#region src/lib/accent-theme.d.ts
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
 
3
- import { c as SparkCardVariant } from "../theme-types-4iUp6JB6.cjs";
3
+ import { l as SparkCardVariant } from "../theme-types-Dlge0s3s.cjs";
4
4
 
5
5
  //#region src/lib/container-chrome.d.ts
6
6
  type ContainerVariant = SparkCardVariant | 'ambient';
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
 
3
- import { c as SparkCardVariant } from "../theme-types-4iUp6JB6.js";
3
+ import { l as SparkCardVariant } from "../theme-types-Dlge0s3s.js";
4
4
 
5
5
  //#region src/lib/container-chrome.d.ts
6
6
  type ContainerVariant = SparkCardVariant | 'ambient';
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
 
3
- import { l as SparkInputColor, u as SparkInputStyle } from "../theme-types-4iUp6JB6.cjs";
3
+ import { d as SparkInputStyle, u as SparkInputColor } from "../theme-types-Dlge0s3s.cjs";
4
4
 
5
5
  //#region src/lib/input-box-variants.d.ts
6
6
  declare const GHOST_UNDERLINE = "h-10 rounded-none border-0 border-b-2 px-0 py-2 text-base focus:border-b-input-active focus-visible:border-b-input-active user-valid:border-b-input-active user-invalid:border-b-input-invalid user-invalid:text-error user-invalid:focus:border-b-(--color-error-active)! user-invalid:focus-visible:border-b-(--color-error-active)! aria-invalid:border-b-input-invalid aria-invalid:text-error aria-invalid:focus:border-b-(--color-error-active)! aria-invalid:focus-visible:border-b-(--color-error-active)! group-data-[invalid=true]/field:border-b-input-invalid! group-data-[invalid=true]/field:text-error group-data-[invalid=true]/field:focus:border-b-(--color-error-active)! group-data-[invalid=true]/field:focus-visible:border-b-(--color-error-active)! user-invalid:focus-visible:outline-(--color-error-active) aria-invalid:focus-visible:outline-(--color-error-active) group-data-[invalid=true]/field:focus-visible:outline-(--color-error-active) disabled:border-b-input-disabled";
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
 
3
- import { l as SparkInputColor, u as SparkInputStyle } from "../theme-types-4iUp6JB6.js";
3
+ import { d as SparkInputStyle, u as SparkInputColor } from "../theme-types-Dlge0s3s.js";
4
4
 
5
5
  //#region src/lib/input-box-variants.d.ts
6
6
  declare const GHOST_UNDERLINE = "h-10 rounded-none border-0 border-b-2 px-0 py-2 text-base focus:border-b-input-active focus-visible:border-b-input-active user-valid:border-b-input-active user-invalid:border-b-input-invalid user-invalid:text-error user-invalid:focus:border-b-(--color-error-active)! user-invalid:focus-visible:border-b-(--color-error-active)! aria-invalid:border-b-input-invalid aria-invalid:text-error aria-invalid:focus:border-b-(--color-error-active)! aria-invalid:focus-visible:border-b-(--color-error-active)! group-data-[invalid=true]/field:border-b-input-invalid! group-data-[invalid=true]/field:text-error group-data-[invalid=true]/field:focus:border-b-(--color-error-active)! group-data-[invalid=true]/field:focus-visible:border-b-(--color-error-active)! user-invalid:focus-visible:outline-(--color-error-active) aria-invalid:focus-visible:outline-(--color-error-active) group-data-[invalid=true]/field:focus-visible:outline-(--color-error-active) disabled:border-b-input-disabled";
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
 
3
- import { u as SparkInputStyle } from "../theme-types-4iUp6JB6.cjs";
3
+ import { d as SparkInputStyle } from "../theme-types-Dlge0s3s.cjs";
4
4
 
5
5
  //#region src/lib/selection-list.d.ts
6
6
  /** Group chrome per `listStyle`; the group also sets `data-list-style` for its rows. */
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
 
3
- import { u as SparkInputStyle } from "../theme-types-4iUp6JB6.js";
3
+ import { d as SparkInputStyle } from "../theme-types-Dlge0s3s.js";
4
4
 
5
5
  //#region src/lib/selection-list.d.ts
6
6
  /** Group chrome per `listStyle`; the group also sets `data-list-style` for its rows. */
@@ -1 +1 @@
1
- {"version":3,"file":"theme-types.cjs","names":[],"sources":["../../src/lib/theme-types.ts"],"sourcesContent":["/** The 6 curated Radix gray families — the only values `getMatchingNeutral` ever returns. */\nexport const SPARK_NEUTRAL_FAMILIES = [\n 'slate',\n 'mauve',\n 'gray',\n 'sage',\n 'olive',\n 'sand',\n] as const\nexport type SparkNeutralFamily = (typeof SPARK_NEUTRAL_FAMILIES)[number]\nexport function isSparkNeutralFamily(\n value: string,\n): value is SparkNeutralFamily {\n return (SPARK_NEUTRAL_FAMILIES as readonly string[]).includes(value)\n}\n\n/**\n * `'auto'` pairs a neutral automatically; one of the 6 curated families picks it by\n * name; any other string is a literal color seed (regenerated against `backgroundColor`\n * exactly like a custom family — see `resolveAutoNeutral`/`generateAccentScale`).\n */\nexport type SparkNeutral = 'auto' | SparkNeutralFamily | (string & {})\nexport type SparkRadius = 'none' | 'small' | 'medium' | 'large' | 'full'\nexport type SparkScaling = '90%' | '95%' | '100%' | '105%' | '110%'\nexport type SparkSpacing = 'dense' | 'default' | 'roomy'\nexport type SparkStyle = 'solid' | 'soft' | 'surface' | 'ghost' | 'outline'\n/**\n * Card chrome variants. `solid` pairs the neutral scale's own background/text\n * extremes (`--neutral-1` fill, `--neutral-12` ink) — the same pairing Radix\n * guarantees stays AA-compliant in both light and dark, so it needs no fixed\n * (non-appearance-tracking) override the way accent's solid ink does.\n */\nexport type SparkCardVariant = SparkStyle\n/**\n * Card container chrome palette. `neutral` (default) paints through the app\n * theme's neutral scale, so a card inherits the configured neutral colour;\n * `accent` tints the card's private mini-scale with the brand accent (chrome\n * only — never the content controls inside). Open union: grows into feedback\n * colours / custom palettes later.\n */\nexport type SparkCardColor = 'neutral' | 'accent'\nexport type SparkLabelPosition = 'outset' | 'inset'\nexport type SparkInputStyle = 'soft' | 'surface' | 'outlined' | 'ghost'\nexport type SparkInputColor = 'brand' | 'gray'\n/** Preferred: `primary` | `neutral` | `destructive`. `accent` / `danger` stay as aliases. */\nexport type SparkButtonColor =\n | 'primary'\n | 'accent'\n | 'neutral'\n | 'destructive'\n | 'danger'\nexport type SparkButtonDesignVariant = 'primary' | 'secondary' | 'tertiary'\nexport type SparkButtonVariant =\n | SparkButtonDesignVariant\n | 'icon'\n | 'danger'\n | 'media'\n | 'link'\nexport interface SparkButtonRole {\n style?: SparkStyle\n color?: SparkButtonColor\n}\n/** Per-variant `<Button>` look; a nested `<Theme>` replaces only the variants it sets. */\nexport type SparkButtonRoles = Partial<\n Record<SparkButtonDesignVariant, SparkButtonRole>\n>\n"],"mappings":";;;;AACA,MAAa,yBAAyB;CACpC;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,SAAgB,qBACd,OAC6B;CAC7B,OAAQ,uBAA6C,SAAS,KAAK;AACrE"}
1
+ {"version":3,"file":"theme-types.cjs","names":[],"sources":["../../src/lib/theme-types.ts"],"sourcesContent":["/** The 6 curated Radix gray families — the only values `getMatchingNeutral` ever returns. */\nexport const SPARK_NEUTRAL_FAMILIES = [\n 'slate',\n 'mauve',\n 'gray',\n 'sage',\n 'olive',\n 'sand',\n] as const\nexport type SparkNeutralFamily = (typeof SPARK_NEUTRAL_FAMILIES)[number]\nexport function isSparkNeutralFamily(\n value: string,\n): value is SparkNeutralFamily {\n return (SPARK_NEUTRAL_FAMILIES as readonly string[]).includes(value)\n}\n\n/**\n * `'auto'` pairs a neutral automatically; one of the 6 curated families picks it by\n * name; any other string is a literal color seed (regenerated against `backgroundColor`\n * exactly like a custom family — see `resolveAutoNeutral`/`generateAccentScale`).\n */\nexport type SparkNeutral = 'auto' | SparkNeutralFamily | (string & {})\nexport type SparkRadius = 'none' | 'small' | 'medium' | 'large' | 'full'\nexport type SparkScaling = '90%' | '95%' | '100%' | '105%' | '110%'\nexport type SparkSpacing = 'dense' | 'default' | 'roomy'\nexport type SparkStyle = 'solid' | 'soft' | 'surface' | 'ghost' | 'outline'\n/**\n * Card chrome variants. `solid` pairs the neutral scale's own background/text\n * extremes (`--neutral-1` fill, `--neutral-12` ink) — the same pairing Radix\n * guarantees stays AA-compliant in both light and dark, so it needs no fixed\n * (non-appearance-tracking) override the way accent's solid ink does.\n */\nexport type SparkCardVariant = SparkStyle\n/**\n * Card container chrome palette. `neutral` (default) paints through the app\n * theme's neutral scale, so a card inherits the configured neutral colour;\n * `accent` tints the card's private mini-scale with the brand accent (chrome\n * only — never the content controls inside). Open union: grows into feedback\n * colours / custom palettes later.\n */\nexport type SparkCardColor = 'neutral' | 'accent'\nexport type SparkLabelPosition = 'outset' | 'inset'\nexport type SparkInputStyle = 'soft' | 'surface' | 'outlined' | 'ghost'\nexport type SparkInputColor = 'brand' | 'gray'\n/** Preferred: `primary` | `neutral` | `destructive`. `accent` / `danger` stay as aliases. */\nexport type SparkButtonColor =\n | 'primary'\n | 'accent'\n | 'neutral'\n | 'destructive'\n | 'danger'\nexport type SparkButtonDesignVariant = 'primary' | 'secondary' | 'tertiary'\nexport type SparkButtonVariant =\n | SparkButtonDesignVariant\n | 'icon'\n | 'danger'\n | 'media'\n | 'link'\n/** A design colour for a button variant; the dark scale is generated from `light` when unset. */\nexport interface SparkButtonDesignColor {\n light: string\n dark?: string\n}\nexport interface SparkButtonRole {\n style?: SparkStyle\n color?: SparkButtonColor | SparkButtonDesignColor\n}\n/** Per-variant `<Button>` look; a nested `<Theme>` replaces only the fields it sets. */\nexport type SparkButtonRoles = Partial<\n Record<SparkButtonDesignVariant, SparkButtonRole>\n>\n"],"mappings":";;;;AACA,MAAa,yBAAyB;CACpC;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,SAAgB,qBACd,OAC6B;CAC7B,OAAQ,uBAA6C,SAAS,KAAK;AACrE"}
@@ -1,4 +1,4 @@
1
1
  "use client";
2
2
 
3
- import { _ as SparkStyle, a as SparkButtonRoles, c as SparkCardVariant, d as SparkLabelPosition, f as SparkNeutral, g as SparkSpacing, h as SparkScaling, i as SparkButtonRole, l as SparkInputColor, m as SparkRadius, n as SparkButtonColor, o as SparkButtonVariant, p as SparkNeutralFamily, r as SparkButtonDesignVariant, s as SparkCardColor, t as SPARK_NEUTRAL_FAMILIES, u as SparkInputStyle, v as isSparkNeutralFamily } from "../theme-types-4iUp6JB6.cjs";
4
- export { SPARK_NEUTRAL_FAMILIES, SparkButtonColor, SparkButtonDesignVariant, SparkButtonRole, SparkButtonRoles, SparkButtonVariant, SparkCardColor, SparkCardVariant, SparkInputColor, SparkInputStyle, SparkLabelPosition, SparkNeutral, SparkNeutralFamily, SparkRadius, SparkScaling, SparkSpacing, SparkStyle, isSparkNeutralFamily };
3
+ import { _ as SparkSpacing, a as SparkButtonRole, c as SparkCardColor, d as SparkInputStyle, f as SparkLabelPosition, g as SparkScaling, h as SparkRadius, i as SparkButtonDesignVariant, l as SparkCardVariant, m as SparkNeutralFamily, n as SparkButtonColor, o as SparkButtonRoles, p as SparkNeutral, r as SparkButtonDesignColor, s as SparkButtonVariant, t as SPARK_NEUTRAL_FAMILIES, u as SparkInputColor, v as SparkStyle, y as isSparkNeutralFamily } from "../theme-types-Dlge0s3s.cjs";
4
+ export { SPARK_NEUTRAL_FAMILIES, SparkButtonColor, SparkButtonDesignColor, SparkButtonDesignVariant, SparkButtonRole, SparkButtonRoles, SparkButtonVariant, SparkCardColor, SparkCardVariant, SparkInputColor, SparkInputStyle, SparkLabelPosition, SparkNeutral, SparkNeutralFamily, SparkRadius, SparkScaling, SparkSpacing, SparkStyle, isSparkNeutralFamily };
@@ -1,4 +1,4 @@
1
1
  "use client";
2
2
 
3
- import { _ as SparkStyle, a as SparkButtonRoles, c as SparkCardVariant, d as SparkLabelPosition, f as SparkNeutral, g as SparkSpacing, h as SparkScaling, i as SparkButtonRole, l as SparkInputColor, m as SparkRadius, n as SparkButtonColor, o as SparkButtonVariant, p as SparkNeutralFamily, r as SparkButtonDesignVariant, s as SparkCardColor, t as SPARK_NEUTRAL_FAMILIES, u as SparkInputStyle, v as isSparkNeutralFamily } from "../theme-types-4iUp6JB6.js";
4
- export { SPARK_NEUTRAL_FAMILIES, SparkButtonColor, SparkButtonDesignVariant, SparkButtonRole, SparkButtonRoles, SparkButtonVariant, SparkCardColor, SparkCardVariant, SparkInputColor, SparkInputStyle, SparkLabelPosition, SparkNeutral, SparkNeutralFamily, SparkRadius, SparkScaling, SparkSpacing, SparkStyle, isSparkNeutralFamily };
3
+ import { _ as SparkSpacing, a as SparkButtonRole, c as SparkCardColor, d as SparkInputStyle, f as SparkLabelPosition, g as SparkScaling, h as SparkRadius, i as SparkButtonDesignVariant, l as SparkCardVariant, m as SparkNeutralFamily, n as SparkButtonColor, o as SparkButtonRoles, p as SparkNeutral, r as SparkButtonDesignColor, s as SparkButtonVariant, t as SPARK_NEUTRAL_FAMILIES, u as SparkInputColor, v as SparkStyle, y as isSparkNeutralFamily } from "../theme-types-Dlge0s3s.js";
4
+ export { SPARK_NEUTRAL_FAMILIES, SparkButtonColor, SparkButtonDesignColor, SparkButtonDesignVariant, SparkButtonRole, SparkButtonRoles, SparkButtonVariant, SparkCardColor, SparkCardVariant, SparkInputColor, SparkInputStyle, SparkLabelPosition, SparkNeutral, SparkNeutralFamily, SparkRadius, SparkScaling, SparkSpacing, SparkStyle, isSparkNeutralFamily };
@@ -1 +1 @@
1
- {"version":3,"file":"theme-types.js","names":[],"sources":["../../src/lib/theme-types.ts"],"sourcesContent":["/** The 6 curated Radix gray families — the only values `getMatchingNeutral` ever returns. */\nexport const SPARK_NEUTRAL_FAMILIES = [\n 'slate',\n 'mauve',\n 'gray',\n 'sage',\n 'olive',\n 'sand',\n] as const\nexport type SparkNeutralFamily = (typeof SPARK_NEUTRAL_FAMILIES)[number]\nexport function isSparkNeutralFamily(\n value: string,\n): value is SparkNeutralFamily {\n return (SPARK_NEUTRAL_FAMILIES as readonly string[]).includes(value)\n}\n\n/**\n * `'auto'` pairs a neutral automatically; one of the 6 curated families picks it by\n * name; any other string is a literal color seed (regenerated against `backgroundColor`\n * exactly like a custom family — see `resolveAutoNeutral`/`generateAccentScale`).\n */\nexport type SparkNeutral = 'auto' | SparkNeutralFamily | (string & {})\nexport type SparkRadius = 'none' | 'small' | 'medium' | 'large' | 'full'\nexport type SparkScaling = '90%' | '95%' | '100%' | '105%' | '110%'\nexport type SparkSpacing = 'dense' | 'default' | 'roomy'\nexport type SparkStyle = 'solid' | 'soft' | 'surface' | 'ghost' | 'outline'\n/**\n * Card chrome variants. `solid` pairs the neutral scale's own background/text\n * extremes (`--neutral-1` fill, `--neutral-12` ink) — the same pairing Radix\n * guarantees stays AA-compliant in both light and dark, so it needs no fixed\n * (non-appearance-tracking) override the way accent's solid ink does.\n */\nexport type SparkCardVariant = SparkStyle\n/**\n * Card container chrome palette. `neutral` (default) paints through the app\n * theme's neutral scale, so a card inherits the configured neutral colour;\n * `accent` tints the card's private mini-scale with the brand accent (chrome\n * only — never the content controls inside). Open union: grows into feedback\n * colours / custom palettes later.\n */\nexport type SparkCardColor = 'neutral' | 'accent'\nexport type SparkLabelPosition = 'outset' | 'inset'\nexport type SparkInputStyle = 'soft' | 'surface' | 'outlined' | 'ghost'\nexport type SparkInputColor = 'brand' | 'gray'\n/** Preferred: `primary` | `neutral` | `destructive`. `accent` / `danger` stay as aliases. */\nexport type SparkButtonColor =\n | 'primary'\n | 'accent'\n | 'neutral'\n | 'destructive'\n | 'danger'\nexport type SparkButtonDesignVariant = 'primary' | 'secondary' | 'tertiary'\nexport type SparkButtonVariant =\n | SparkButtonDesignVariant\n | 'icon'\n | 'danger'\n | 'media'\n | 'link'\nexport interface SparkButtonRole {\n style?: SparkStyle\n color?: SparkButtonColor\n}\n/** Per-variant `<Button>` look; a nested `<Theme>` replaces only the variants it sets. */\nexport type SparkButtonRoles = Partial<\n Record<SparkButtonDesignVariant, SparkButtonRole>\n>\n"],"mappings":";;;AACA,MAAa,yBAAyB;CACpC;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,SAAgB,qBACd,OAC6B;CAC7B,OAAQ,uBAA6C,SAAS,KAAK;AACrE"}
1
+ {"version":3,"file":"theme-types.js","names":[],"sources":["../../src/lib/theme-types.ts"],"sourcesContent":["/** The 6 curated Radix gray families — the only values `getMatchingNeutral` ever returns. */\nexport const SPARK_NEUTRAL_FAMILIES = [\n 'slate',\n 'mauve',\n 'gray',\n 'sage',\n 'olive',\n 'sand',\n] as const\nexport type SparkNeutralFamily = (typeof SPARK_NEUTRAL_FAMILIES)[number]\nexport function isSparkNeutralFamily(\n value: string,\n): value is SparkNeutralFamily {\n return (SPARK_NEUTRAL_FAMILIES as readonly string[]).includes(value)\n}\n\n/**\n * `'auto'` pairs a neutral automatically; one of the 6 curated families picks it by\n * name; any other string is a literal color seed (regenerated against `backgroundColor`\n * exactly like a custom family — see `resolveAutoNeutral`/`generateAccentScale`).\n */\nexport type SparkNeutral = 'auto' | SparkNeutralFamily | (string & {})\nexport type SparkRadius = 'none' | 'small' | 'medium' | 'large' | 'full'\nexport type SparkScaling = '90%' | '95%' | '100%' | '105%' | '110%'\nexport type SparkSpacing = 'dense' | 'default' | 'roomy'\nexport type SparkStyle = 'solid' | 'soft' | 'surface' | 'ghost' | 'outline'\n/**\n * Card chrome variants. `solid` pairs the neutral scale's own background/text\n * extremes (`--neutral-1` fill, `--neutral-12` ink) — the same pairing Radix\n * guarantees stays AA-compliant in both light and dark, so it needs no fixed\n * (non-appearance-tracking) override the way accent's solid ink does.\n */\nexport type SparkCardVariant = SparkStyle\n/**\n * Card container chrome palette. `neutral` (default) paints through the app\n * theme's neutral scale, so a card inherits the configured neutral colour;\n * `accent` tints the card's private mini-scale with the brand accent (chrome\n * only — never the content controls inside). Open union: grows into feedback\n * colours / custom palettes later.\n */\nexport type SparkCardColor = 'neutral' | 'accent'\nexport type SparkLabelPosition = 'outset' | 'inset'\nexport type SparkInputStyle = 'soft' | 'surface' | 'outlined' | 'ghost'\nexport type SparkInputColor = 'brand' | 'gray'\n/** Preferred: `primary` | `neutral` | `destructive`. `accent` / `danger` stay as aliases. */\nexport type SparkButtonColor =\n | 'primary'\n | 'accent'\n | 'neutral'\n | 'destructive'\n | 'danger'\nexport type SparkButtonDesignVariant = 'primary' | 'secondary' | 'tertiary'\nexport type SparkButtonVariant =\n | SparkButtonDesignVariant\n | 'icon'\n | 'danger'\n | 'media'\n | 'link'\n/** A design colour for a button variant; the dark scale is generated from `light` when unset. */\nexport interface SparkButtonDesignColor {\n light: string\n dark?: string\n}\nexport interface SparkButtonRole {\n style?: SparkStyle\n color?: SparkButtonColor | SparkButtonDesignColor\n}\n/** Per-variant `<Button>` look; a nested `<Theme>` replaces only the fields it sets. */\nexport type SparkButtonRoles = Partial<\n Record<SparkButtonDesignVariant, SparkButtonRole>\n>\n"],"mappings":";;;AACA,MAAa,yBAAyB;CACpC;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,SAAgB,qBACd,OAC6B;CAC7B,OAAQ,uBAA6C,SAAS,KAAK;AACrE"}
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
 
3
- import { n as SparkButtonColor } from "../theme-types-4iUp6JB6.cjs";
3
+ import { n as SparkButtonColor } from "../theme-types-Dlge0s3s.cjs";
4
4
  import { ButtonProps } from "../components/button.cjs";
5
5
  import { ToggleStyle } from "../components/toggle.cjs";
6
6
  import * as React$1 from "react";
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
 
3
- import { n as SparkButtonColor } from "../theme-types-4iUp6JB6.js";
3
+ import { n as SparkButtonColor } from "../theme-types-Dlge0s3s.js";
4
4
  import { ButtonProps } from "../components/button.js";
5
5
  import { ToggleStyle } from "../components/toggle.js";
6
6
  import * as React$1 from "react";
@@ -736,6 +736,104 @@
736
736
  --spark-track: var(--neutral-9);
737
737
  }
738
738
 
739
+ [data-slot='button'][data-button-color='primary'] {
740
+ --spark-1: var(--spark-button-primary-1);
741
+ --spark-2: var(--spark-button-primary-2);
742
+ --spark-3: var(--spark-button-primary-3);
743
+ --spark-4: var(--spark-button-primary-4);
744
+ --spark-5: var(--spark-button-primary-5);
745
+ --spark-6: var(--spark-button-primary-6);
746
+ --spark-7: var(--spark-button-primary-7);
747
+ --spark-8: var(--spark-button-primary-8);
748
+ --spark-9: var(--spark-button-primary-9);
749
+ --spark-10: var(--spark-button-primary-10);
750
+ --spark-11: var(--spark-button-primary-11);
751
+ --spark-12: var(--spark-button-primary-12);
752
+ --spark-a1: var(--spark-button-primary-a1);
753
+ --spark-a2: var(--spark-button-primary-a2);
754
+ --spark-a3: var(--spark-button-primary-a3);
755
+ --spark-a4: var(--spark-button-primary-a4);
756
+ --spark-a5: var(--spark-button-primary-a5);
757
+ --spark-a6: var(--spark-button-primary-a6);
758
+ --spark-a7: var(--spark-button-primary-a7);
759
+ --spark-a8: var(--spark-button-primary-a8);
760
+ --spark-a9: var(--spark-button-primary-a9);
761
+ --spark-a10: var(--spark-button-primary-a10);
762
+ --spark-a11: var(--spark-button-primary-a11);
763
+ --spark-a12: var(--spark-button-primary-a12);
764
+ --spark-contrast: var(--spark-button-primary-contrast);
765
+ --spark-on-solid: var(--spark-button-primary-on-solid);
766
+ --spark-surface: var(--spark-button-primary-surface);
767
+ --spark-solid: var(--spark-button-primary-9);
768
+ --spark-solid-hover: var(--spark-button-primary-10);
769
+ --color-primary-foreground: var(--spark-button-primary-contrast);
770
+ }
771
+
772
+ [data-slot='button'][data-button-color='secondary'] {
773
+ --spark-1: var(--spark-button-secondary-1);
774
+ --spark-2: var(--spark-button-secondary-2);
775
+ --spark-3: var(--spark-button-secondary-3);
776
+ --spark-4: var(--spark-button-secondary-4);
777
+ --spark-5: var(--spark-button-secondary-5);
778
+ --spark-6: var(--spark-button-secondary-6);
779
+ --spark-7: var(--spark-button-secondary-7);
780
+ --spark-8: var(--spark-button-secondary-8);
781
+ --spark-9: var(--spark-button-secondary-9);
782
+ --spark-10: var(--spark-button-secondary-10);
783
+ --spark-11: var(--spark-button-secondary-11);
784
+ --spark-12: var(--spark-button-secondary-12);
785
+ --spark-a1: var(--spark-button-secondary-a1);
786
+ --spark-a2: var(--spark-button-secondary-a2);
787
+ --spark-a3: var(--spark-button-secondary-a3);
788
+ --spark-a4: var(--spark-button-secondary-a4);
789
+ --spark-a5: var(--spark-button-secondary-a5);
790
+ --spark-a6: var(--spark-button-secondary-a6);
791
+ --spark-a7: var(--spark-button-secondary-a7);
792
+ --spark-a8: var(--spark-button-secondary-a8);
793
+ --spark-a9: var(--spark-button-secondary-a9);
794
+ --spark-a10: var(--spark-button-secondary-a10);
795
+ --spark-a11: var(--spark-button-secondary-a11);
796
+ --spark-a12: var(--spark-button-secondary-a12);
797
+ --spark-contrast: var(--spark-button-secondary-contrast);
798
+ --spark-on-solid: var(--spark-button-secondary-on-solid);
799
+ --spark-surface: var(--spark-button-secondary-surface);
800
+ --spark-solid: var(--spark-button-secondary-9);
801
+ --spark-solid-hover: var(--spark-button-secondary-10);
802
+ --color-primary-foreground: var(--spark-button-secondary-contrast);
803
+ }
804
+
805
+ [data-slot='button'][data-button-color='tertiary'] {
806
+ --spark-1: var(--spark-button-tertiary-1);
807
+ --spark-2: var(--spark-button-tertiary-2);
808
+ --spark-3: var(--spark-button-tertiary-3);
809
+ --spark-4: var(--spark-button-tertiary-4);
810
+ --spark-5: var(--spark-button-tertiary-5);
811
+ --spark-6: var(--spark-button-tertiary-6);
812
+ --spark-7: var(--spark-button-tertiary-7);
813
+ --spark-8: var(--spark-button-tertiary-8);
814
+ --spark-9: var(--spark-button-tertiary-9);
815
+ --spark-10: var(--spark-button-tertiary-10);
816
+ --spark-11: var(--spark-button-tertiary-11);
817
+ --spark-12: var(--spark-button-tertiary-12);
818
+ --spark-a1: var(--spark-button-tertiary-a1);
819
+ --spark-a2: var(--spark-button-tertiary-a2);
820
+ --spark-a3: var(--spark-button-tertiary-a3);
821
+ --spark-a4: var(--spark-button-tertiary-a4);
822
+ --spark-a5: var(--spark-button-tertiary-a5);
823
+ --spark-a6: var(--spark-button-tertiary-a6);
824
+ --spark-a7: var(--spark-button-tertiary-a7);
825
+ --spark-a8: var(--spark-button-tertiary-a8);
826
+ --spark-a9: var(--spark-button-tertiary-a9);
827
+ --spark-a10: var(--spark-button-tertiary-a10);
828
+ --spark-a11: var(--spark-button-tertiary-a11);
829
+ --spark-a12: var(--spark-button-tertiary-a12);
830
+ --spark-contrast: var(--spark-button-tertiary-contrast);
831
+ --spark-on-solid: var(--spark-button-tertiary-on-solid);
832
+ --spark-surface: var(--spark-button-tertiary-surface);
833
+ --spark-solid: var(--spark-button-tertiary-9);
834
+ --spark-solid-hover: var(--spark-button-tertiary-10);
835
+ --color-primary-foreground: var(--spark-button-tertiary-contrast);
836
+ }
739
837
  [data-accent-color='red'],
740
838
  :where([data-accent-color='red'] .spark-theme) {
741
839
  --spark-1: var(--red-1);
@@ -37,12 +37,17 @@ type SparkInputColor = 'brand' | 'gray';
37
37
  type SparkButtonColor = 'primary' | 'accent' | 'neutral' | 'destructive' | 'danger';
38
38
  type SparkButtonDesignVariant = 'primary' | 'secondary' | 'tertiary';
39
39
  type SparkButtonVariant = SparkButtonDesignVariant | 'icon' | 'danger' | 'media' | 'link';
40
+ /** A design colour for a button variant; the dark scale is generated from `light` when unset. */
41
+ interface SparkButtonDesignColor {
42
+ light: string;
43
+ dark?: string;
44
+ }
40
45
  interface SparkButtonRole {
41
46
  style?: SparkStyle;
42
- color?: SparkButtonColor;
47
+ color?: SparkButtonColor | SparkButtonDesignColor;
43
48
  }
44
- /** Per-variant `<Button>` look; a nested `<Theme>` replaces only the variants it sets. */
49
+ /** Per-variant `<Button>` look; a nested `<Theme>` replaces only the fields it sets. */
45
50
  type SparkButtonRoles = Partial<Record<SparkButtonDesignVariant, SparkButtonRole>>;
46
51
  //#endregion
47
- export { SparkStyle as _, SparkButtonRoles as a, SparkCardVariant as c, SparkLabelPosition as d, SparkNeutral as f, SparkSpacing as g, SparkScaling as h, SparkButtonRole as i, SparkInputColor as l, SparkRadius as m, SparkButtonColor as n, SparkButtonVariant as o, SparkNeutralFamily as p, SparkButtonDesignVariant as r, SparkCardColor as s, SPARK_NEUTRAL_FAMILIES as t, SparkInputStyle as u, isSparkNeutralFamily as v };
48
- //# sourceMappingURL=theme-types-4iUp6JB6.d.ts.map
52
+ export { SparkSpacing as _, SparkButtonRole as a, SparkCardColor as c, SparkInputStyle as d, SparkLabelPosition as f, SparkScaling as g, SparkRadius as h, SparkButtonDesignVariant as i, SparkCardVariant as l, SparkNeutralFamily as m, SparkButtonColor as n, SparkButtonRoles as o, SparkNeutral as p, SparkButtonDesignColor as r, SparkButtonVariant as s, SPARK_NEUTRAL_FAMILIES as t, SparkInputColor as u, SparkStyle as v, isSparkNeutralFamily as y };
53
+ //# sourceMappingURL=theme-types-Dlge0s3s.d.cts.map
@@ -37,12 +37,17 @@ type SparkInputColor = 'brand' | 'gray';
37
37
  type SparkButtonColor = 'primary' | 'accent' | 'neutral' | 'destructive' | 'danger';
38
38
  type SparkButtonDesignVariant = 'primary' | 'secondary' | 'tertiary';
39
39
  type SparkButtonVariant = SparkButtonDesignVariant | 'icon' | 'danger' | 'media' | 'link';
40
+ /** A design colour for a button variant; the dark scale is generated from `light` when unset. */
41
+ interface SparkButtonDesignColor {
42
+ light: string;
43
+ dark?: string;
44
+ }
40
45
  interface SparkButtonRole {
41
46
  style?: SparkStyle;
42
- color?: SparkButtonColor;
47
+ color?: SparkButtonColor | SparkButtonDesignColor;
43
48
  }
44
- /** Per-variant `<Button>` look; a nested `<Theme>` replaces only the variants it sets. */
49
+ /** Per-variant `<Button>` look; a nested `<Theme>` replaces only the fields it sets. */
45
50
  type SparkButtonRoles = Partial<Record<SparkButtonDesignVariant, SparkButtonRole>>;
46
51
  //#endregion
47
- export { SparkStyle as _, SparkButtonRoles as a, SparkCardVariant as c, SparkLabelPosition as d, SparkNeutral as f, SparkSpacing as g, SparkScaling as h, SparkButtonRole as i, SparkInputColor as l, SparkRadius as m, SparkButtonColor as n, SparkButtonVariant as o, SparkNeutralFamily as p, SparkButtonDesignVariant as r, SparkCardColor as s, SPARK_NEUTRAL_FAMILIES as t, SparkInputStyle as u, isSparkNeutralFamily as v };
48
- //# sourceMappingURL=theme-types-4iUp6JB6.d.cts.map
52
+ export { SparkSpacing as _, SparkButtonRole as a, SparkCardColor as c, SparkInputStyle as d, SparkLabelPosition as f, SparkScaling as g, SparkRadius as h, SparkButtonDesignVariant as i, SparkCardVariant as l, SparkNeutralFamily as m, SparkButtonColor as n, SparkButtonRoles as o, SparkNeutral as p, SparkButtonDesignColor as r, SparkButtonVariant as s, SPARK_NEUTRAL_FAMILIES as t, SparkInputColor as u, SparkStyle as v, isSparkNeutralFamily as y };
53
+ //# sourceMappingURL=theme-types-Dlge0s3s.d.ts.map