@epilot/spark-ui 0.11.1 → 0.12.1

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 (125) hide show
  1. package/dist/components/avatar.d.cts +1 -1
  2. package/dist/components/avatar.d.ts +1 -1
  3. package/dist/components/badge.d.cts +1 -1
  4. package/dist/components/badge.d.ts +1 -1
  5. package/dist/components/bar-chart.js +1 -1
  6. package/dist/components/box.cjs +3 -2
  7. package/dist/components/box.cjs.map +1 -1
  8. package/dist/components/box.d.cts +8 -1
  9. package/dist/components/box.d.ts +8 -1
  10. package/dist/components/box.js +3 -2
  11. package/dist/components/box.js.map +1 -1
  12. package/dist/components/button-group.d.cts +1 -1
  13. package/dist/components/button-group.d.ts +1 -1
  14. package/dist/components/button.d.cts +2 -2
  15. package/dist/components/button.d.ts +2 -2
  16. package/dist/components/calendar.cjs +2 -2
  17. package/dist/components/calendar.cjs.map +1 -1
  18. package/dist/components/calendar.js +2 -2
  19. package/dist/components/calendar.js.map +1 -1
  20. package/dist/components/callout.cjs +1 -1
  21. package/dist/components/callout.cjs.map +1 -1
  22. package/dist/components/callout.d.cts +3 -3
  23. package/dist/components/callout.d.ts +3 -3
  24. package/dist/components/callout.js +1 -1
  25. package/dist/components/callout.js.map +1 -1
  26. package/dist/components/card.cjs +3 -2
  27. package/dist/components/card.cjs.map +1 -1
  28. package/dist/components/card.d.cts +7 -1
  29. package/dist/components/card.d.ts +7 -1
  30. package/dist/components/card.js +3 -2
  31. package/dist/components/card.js.map +1 -1
  32. package/dist/components/checkbox.d.cts +1 -1
  33. package/dist/components/checkbox.d.ts +1 -1
  34. package/dist/components/field.d.cts +1 -1
  35. package/dist/components/field.d.ts +1 -1
  36. package/dist/components/icon.cjs +1 -1
  37. package/dist/components/icon.js +1 -1
  38. package/dist/components/input-group.cjs +1 -1
  39. package/dist/components/input-group.cjs.map +1 -1
  40. package/dist/components/input-group.js +1 -1
  41. package/dist/components/input-group.js.map +1 -1
  42. package/dist/components/input.d.cts +1 -1
  43. package/dist/components/input.d.ts +1 -1
  44. package/dist/components/line-chart.cjs +1 -1
  45. package/dist/components/line-chart.js +2 -2
  46. package/dist/components/list.d.cts +1 -1
  47. package/dist/components/list.d.ts +1 -1
  48. package/dist/components/marker.d.cts +1 -1
  49. package/dist/components/marker.d.ts +1 -1
  50. package/dist/components/pill.cjs +20 -13
  51. package/dist/components/pill.cjs.map +1 -1
  52. package/dist/components/pill.d.cts +1 -1
  53. package/dist/components/pill.d.ts +1 -1
  54. package/dist/components/pill.js +20 -13
  55. package/dist/components/pill.js.map +1 -1
  56. package/dist/components/power-history-chart.cjs +1 -1
  57. package/dist/components/power-history-chart.js +2 -2
  58. package/dist/components/progress.cjs +1 -1
  59. package/dist/components/progress.cjs.map +1 -1
  60. package/dist/components/progress.js +1 -1
  61. package/dist/components/progress.js.map +1 -1
  62. package/dist/components/radio-card-group.cjs.map +1 -1
  63. package/dist/components/radio-card-group.js.map +1 -1
  64. package/dist/components/radio.d.cts +1 -1
  65. package/dist/components/radio.d.ts +1 -1
  66. package/dist/components/schedule-list.cjs +10 -7
  67. package/dist/components/schedule-list.cjs.map +1 -1
  68. package/dist/components/schedule-list.js +10 -7
  69. package/dist/components/schedule-list.js.map +1 -1
  70. package/dist/components/segmented-control.d.cts +1 -1
  71. package/dist/components/segmented-control.d.ts +1 -1
  72. package/dist/components/select.cjs +1 -1
  73. package/dist/components/select.d.cts +1 -1
  74. package/dist/components/select.d.ts +1 -1
  75. package/dist/components/select.js +1 -1
  76. package/dist/components/solar-forecast-chart.cjs +1 -1
  77. package/dist/components/solar-forecast-chart.js +2 -2
  78. package/dist/components/switch.d.cts +1 -1
  79. package/dist/components/switch.d.ts +1 -1
  80. package/dist/components/textarea.d.cts +1 -1
  81. package/dist/components/textarea.d.ts +1 -1
  82. package/dist/components/theme.cjs +18 -6
  83. package/dist/components/theme.cjs.map +1 -1
  84. package/dist/components/theme.d.cts +16 -2
  85. package/dist/components/theme.d.ts +16 -2
  86. package/dist/components/theme.js +19 -7
  87. package/dist/components/theme.js.map +1 -1
  88. package/dist/{generate-radix-colors-Bw-RYaV4.d.ts → generate-radix-colors-BY4Wjsm7.d.cts} +4 -2
  89. package/dist/{generate-radix-colors-Bw-RYaV4.d.cts → generate-radix-colors-BY4Wjsm7.d.ts} +4 -2
  90. package/dist/icons/material-symbol.cjs +1 -1
  91. package/dist/icons/material-symbol.cjs.map +1 -1
  92. package/dist/icons/material-symbol.js +1 -1
  93. package/dist/icons/material-symbol.js.map +1 -1
  94. package/dist/lib/accent-theme.cjs +367 -16
  95. package/dist/lib/accent-theme.cjs.map +1 -1
  96. package/dist/lib/accent-theme.d.cts +75 -6
  97. package/dist/lib/accent-theme.d.ts +75 -6
  98. package/dist/lib/accent-theme.js +365 -18
  99. package/dist/lib/accent-theme.js.map +1 -1
  100. package/dist/lib/container-chrome.cjs +9 -7
  101. package/dist/lib/container-chrome.cjs.map +1 -1
  102. package/dist/lib/container-chrome.d.cts +4 -3
  103. package/dist/lib/container-chrome.d.ts +4 -3
  104. package/dist/lib/container-chrome.js +9 -8
  105. package/dist/lib/container-chrome.js.map +1 -1
  106. package/dist/lib/generate-radix-colors.cjs +7 -0
  107. package/dist/lib/generate-radix-colors.cjs.map +1 -1
  108. package/dist/lib/generate-radix-colors.d.cts +2 -2
  109. package/dist/lib/generate-radix-colors.d.ts +2 -2
  110. package/dist/lib/generate-radix-colors.js +6 -1
  111. package/dist/lib/generate-radix-colors.js.map +1 -1
  112. package/dist/lib/input-box-variants.d.cts +1 -1
  113. package/dist/lib/input-box-variants.d.ts +1 -1
  114. package/dist/lib/theme-types.cjs +19 -0
  115. package/dist/lib/theme-types.cjs.map +1 -0
  116. package/dist/lib/theme-types.d.cts +2 -2
  117. package/dist/lib/theme-types.d.ts +2 -2
  118. package/dist/lib/theme-types.js +17 -1
  119. package/dist/lib/theme-types.js.map +1 -0
  120. package/dist/styles/material-symbol.css +3 -0
  121. package/dist/styles/spark-default.css +148 -0
  122. package/dist/styles/utilities.css +9 -8
  123. package/dist/{theme-types-1yB0d8mp.d.ts → theme-types-Bn5E15-P.d.cts} +12 -3
  124. package/dist/{theme-types-1yB0d8mp.d.cts → theme-types-Bn5E15-P.d.ts} +12 -3
  125. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
 
3
- import { o as SparkNeutral } from "../theme-types-1yB0d8mp.cjs";
4
- import { t as generateRadixColors } from "../generate-radix-colors-Bw-RYaV4.cjs";
3
+ import { c as SparkNeutralFamily, s as SparkNeutral } from "../theme-types-Bn5E15-P.cjs";
4
+ import { t as generateRadixColors } from "../generate-radix-colors-BY4Wjsm7.cjs";
5
5
 
6
6
  //#region src/lib/accent-theme.d.ts
7
7
  /** Shape returned by the vendored Radix generator (it doesn't export a named type). */
@@ -29,8 +29,13 @@ interface GenerateScaleOptions {
29
29
  * must match what's actually painted or the alpha ramp renders wrong.
30
30
  */
31
31
  background?: string;
32
- /** Neutral family to regenerate against `background`. Pass a resolved family, not `'auto'`. */
33
- neutral?: Exclude<SparkNeutral, 'auto'>;
32
+ /**
33
+ * Neutral family, or an arbitrary color to seed the neutral scale (regenerated against
34
+ * `background`, same as a named family). Pass a resolved value, not `'auto'` — this
35
+ * option isn't itself typed to exclude it (an open string union can't forbid one
36
+ * literal), but nothing in `<Theme>` ever forwards `'auto'` this far.
37
+ */
38
+ neutral?: SparkNeutral;
34
39
  }
35
40
  /** Which appearance a canvas belongs to, by OKLCH lightness. */
36
41
  declare function appearanceForBackground(background: string): Appearance;
@@ -41,7 +46,71 @@ declare function accentSparkVars(scale: SparkAccentScale): string[];
41
46
  /** Wide-gamut (P3) `--spark-*` declarations — for a `color-gamut: p3` `@supports` block. */
42
47
  declare function accentSparkVarsP3(scale: SparkAccentScale): string[];
43
48
  /** Radix's "auto" gray: curated names use Radix's table; a custom hex is classified by OKLCH hue. */
44
- declare function getMatchingNeutral(accent: string): Exclude<SparkNeutral, 'auto'>;
49
+ declare function getMatchingNeutral(accent: string): SparkNeutralFamily;
50
+ /**
51
+ * Re-cast a scale for use ON its own solid (step-9) fill — the `inverted` knob.
52
+ *
53
+ * A solid accent control on a solid accent surface is invisible: both paint `--spark-9`.
54
+ * Inverting swaps that pair — step 9 and its contrast ink trade places — so the solid fill
55
+ * and its text are contrast-safe **by construction, for any accent**: `accentContrast` is
56
+ * already the WCAG-checked readable ink for step 9 (`readableContrast`).
57
+ *
58
+ * The non-solid styles need a second idea, because the ink is also the text colour. A fill
59
+ * blended surface→ink moves the background *toward* the foreground, so ink-on-fill contrast
60
+ * falls monotonically with `t` — and measured across the curated set, the highest `t` that
61
+ * still clears 4.5:1 (0.174) sits below the lowest `t` that is 3:1 distinguishable from the
62
+ * surface (0.543). On that line no fill can be both legible and visible, on any accent.
63
+ *
64
+ * So fills blend the other way, toward the **scrim** — the lightness pole opposite the ink,
65
+ * carrying the surface's own hue. Contrast against the ink now *rises* with `t`, which puts
66
+ * every non-solid style at or above the solid pair's ratio for free. Borders keep stepping
67
+ * toward the ink (a scrim-side border caps at ~2:1 on light accents like orange, so it can
68
+ * never clear 1.4.11), starting at the solved 3:1 floor.
69
+ *
70
+ * Appearance-stable on purpose. The generator pins step 9 to the accent itself, so the
71
+ * surface is identical in light and dark — which makes the whole inverted scale identical
72
+ * too, and `[data-inverted]` needs no `.dark` twin.
73
+ *
74
+ * Two things this is deliberately NOT:
75
+ * - **A positional mirror** (`1↔12`). It leaves the solid fill only 2.04:1 from the card in
76
+ * dark and 2.23:1 on a light accent like orange — under the 3:1 graphical floor, i.e. still
77
+ * invisible, which is the bug this exists to fix.
78
+ * - **A regenerated on-surface ramp.** Feeding the surface back in as `background` produces
79
+ * off-hue overlays (a warm wash on a blue card) and ink at 3.35:1.
80
+ *
81
+ * Values are literals, not `var(--spark-N)` aliases: a scale can't re-point to itself
82
+ * (`--spark-1: var(--spark-12)` next to `--spark-12: var(--spark-1)` is a cycle, and CSS
83
+ * discards both).
84
+ */
85
+ declare function invertAccentScale(scale: SparkAccentScale): SparkAccentScale;
86
+ /**
87
+ * `neutralColor="auto"` resolution: prefer the canvas's own tint when it has one — a
88
+ * chromatic `background` seeds a visibly warmer/cooler ramp than bucketing it into one
89
+ * of the 6 named families would (see gap #12). Falls back to accent-matched bucketing
90
+ * when there's no tinted canvas to pull from.
91
+ */
92
+ declare function resolveAutoNeutral(accent: string, background?: string): string;
93
+ /**
94
+ * Whether a string parses as a color at all — for validating a custom `neutralColor`
95
+ * before it reaches the generator. An unparseable seed (e.g. a typo'd family name like
96
+ * `"slat"`) would otherwise throw deep inside `generateRadixColors`, taking the whole
97
+ * accent scale down with it via the caller's shared try/catch.
98
+ */
99
+ declare function isParsableColor(value: string): boolean;
100
+ /**
101
+ * The same `--neutral-*` tokens `neutralSparkVars` emits, pointed back at a static Radix
102
+ * family instead of a generated scale — the counterpart for an appearance that has *no*
103
+ * custom canvas of its own.
104
+ *
105
+ * Ambient (no explicit `appearance`) mode emits both appearances' scales into one unlayered
106
+ * `<style>`, but a custom canvas only regenerates neutrals for the appearance it belongs to.
107
+ * Left undeclared, the other block doesn't fall back — nothing resets a custom property, so
108
+ * its sibling's canvas-tinted values simply stay in effect there, and being unlayered they
109
+ * outrank `[data-neutral-color]`'s own `@layer base` mapping too. Declaring the same token
110
+ * set closes that. `var(--<family>-*)` is itself appearance-aware (Radix ships the dark
111
+ * scales under `.dark`), so one declaration resolves correctly wherever the block applies.
112
+ */
113
+ declare function neutralFamilyVars(family: Exclude<SparkNeutral, 'auto'>): string[];
45
114
  /**
46
115
  * `--neutral-*` declarations from the gray scale the generator produces alongside the
47
116
  * accent — normally discarded, because `[data-neutral-color]` points `--neutral-*` at a
@@ -56,5 +125,5 @@ declare function neutralSparkVars(scale: SparkAccentScale): string[];
56
125
  /** Wide-gamut (P3) twin of `neutralSparkVars`. */
57
126
  declare function neutralSparkVarsP3(scale: SparkAccentScale): string[];
58
127
  //#endregion
59
- export { Appearance, CURATED_ACCENTS, GenerateScaleOptions, GeneratedColors, SparkAccentScale, accentSparkVars, accentSparkVarsP3, appearanceForBackground, generateAccentScale, getMatchingNeutral, neutralSparkVars, neutralSparkVarsP3 };
128
+ export { Appearance, CURATED_ACCENTS, GenerateScaleOptions, GeneratedColors, SparkAccentScale, accentSparkVars, accentSparkVarsP3, appearanceForBackground, generateAccentScale, getMatchingNeutral, invertAccentScale, isParsableColor, neutralFamilyVars, neutralSparkVars, neutralSparkVarsP3, resolveAutoNeutral };
60
129
  //# sourceMappingURL=accent-theme.d.cts.map
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
 
3
- import { o as SparkNeutral } from "../theme-types-1yB0d8mp.js";
4
- import { t as generateRadixColors } from "../generate-radix-colors-Bw-RYaV4.js";
3
+ import { c as SparkNeutralFamily, s as SparkNeutral } from "../theme-types-Bn5E15-P.js";
4
+ import { t as generateRadixColors } from "../generate-radix-colors-BY4Wjsm7.js";
5
5
 
6
6
  //#region src/lib/accent-theme.d.ts
7
7
  /** Shape returned by the vendored Radix generator (it doesn't export a named type). */
@@ -29,8 +29,13 @@ interface GenerateScaleOptions {
29
29
  * must match what's actually painted or the alpha ramp renders wrong.
30
30
  */
31
31
  background?: string;
32
- /** Neutral family to regenerate against `background`. Pass a resolved family, not `'auto'`. */
33
- neutral?: Exclude<SparkNeutral, 'auto'>;
32
+ /**
33
+ * Neutral family, or an arbitrary color to seed the neutral scale (regenerated against
34
+ * `background`, same as a named family). Pass a resolved value, not `'auto'` — this
35
+ * option isn't itself typed to exclude it (an open string union can't forbid one
36
+ * literal), but nothing in `<Theme>` ever forwards `'auto'` this far.
37
+ */
38
+ neutral?: SparkNeutral;
34
39
  }
35
40
  /** Which appearance a canvas belongs to, by OKLCH lightness. */
36
41
  declare function appearanceForBackground(background: string): Appearance;
@@ -41,7 +46,71 @@ declare function accentSparkVars(scale: SparkAccentScale): string[];
41
46
  /** Wide-gamut (P3) `--spark-*` declarations — for a `color-gamut: p3` `@supports` block. */
42
47
  declare function accentSparkVarsP3(scale: SparkAccentScale): string[];
43
48
  /** Radix's "auto" gray: curated names use Radix's table; a custom hex is classified by OKLCH hue. */
44
- declare function getMatchingNeutral(accent: string): Exclude<SparkNeutral, 'auto'>;
49
+ declare function getMatchingNeutral(accent: string): SparkNeutralFamily;
50
+ /**
51
+ * Re-cast a scale for use ON its own solid (step-9) fill — the `inverted` knob.
52
+ *
53
+ * A solid accent control on a solid accent surface is invisible: both paint `--spark-9`.
54
+ * Inverting swaps that pair — step 9 and its contrast ink trade places — so the solid fill
55
+ * and its text are contrast-safe **by construction, for any accent**: `accentContrast` is
56
+ * already the WCAG-checked readable ink for step 9 (`readableContrast`).
57
+ *
58
+ * The non-solid styles need a second idea, because the ink is also the text colour. A fill
59
+ * blended surface→ink moves the background *toward* the foreground, so ink-on-fill contrast
60
+ * falls monotonically with `t` — and measured across the curated set, the highest `t` that
61
+ * still clears 4.5:1 (0.174) sits below the lowest `t` that is 3:1 distinguishable from the
62
+ * surface (0.543). On that line no fill can be both legible and visible, on any accent.
63
+ *
64
+ * So fills blend the other way, toward the **scrim** — the lightness pole opposite the ink,
65
+ * carrying the surface's own hue. Contrast against the ink now *rises* with `t`, which puts
66
+ * every non-solid style at or above the solid pair's ratio for free. Borders keep stepping
67
+ * toward the ink (a scrim-side border caps at ~2:1 on light accents like orange, so it can
68
+ * never clear 1.4.11), starting at the solved 3:1 floor.
69
+ *
70
+ * Appearance-stable on purpose. The generator pins step 9 to the accent itself, so the
71
+ * surface is identical in light and dark — which makes the whole inverted scale identical
72
+ * too, and `[data-inverted]` needs no `.dark` twin.
73
+ *
74
+ * Two things this is deliberately NOT:
75
+ * - **A positional mirror** (`1↔12`). It leaves the solid fill only 2.04:1 from the card in
76
+ * dark and 2.23:1 on a light accent like orange — under the 3:1 graphical floor, i.e. still
77
+ * invisible, which is the bug this exists to fix.
78
+ * - **A regenerated on-surface ramp.** Feeding the surface back in as `background` produces
79
+ * off-hue overlays (a warm wash on a blue card) and ink at 3.35:1.
80
+ *
81
+ * Values are literals, not `var(--spark-N)` aliases: a scale can't re-point to itself
82
+ * (`--spark-1: var(--spark-12)` next to `--spark-12: var(--spark-1)` is a cycle, and CSS
83
+ * discards both).
84
+ */
85
+ declare function invertAccentScale(scale: SparkAccentScale): SparkAccentScale;
86
+ /**
87
+ * `neutralColor="auto"` resolution: prefer the canvas's own tint when it has one — a
88
+ * chromatic `background` seeds a visibly warmer/cooler ramp than bucketing it into one
89
+ * of the 6 named families would (see gap #12). Falls back to accent-matched bucketing
90
+ * when there's no tinted canvas to pull from.
91
+ */
92
+ declare function resolveAutoNeutral(accent: string, background?: string): string;
93
+ /**
94
+ * Whether a string parses as a color at all — for validating a custom `neutralColor`
95
+ * before it reaches the generator. An unparseable seed (e.g. a typo'd family name like
96
+ * `"slat"`) would otherwise throw deep inside `generateRadixColors`, taking the whole
97
+ * accent scale down with it via the caller's shared try/catch.
98
+ */
99
+ declare function isParsableColor(value: string): boolean;
100
+ /**
101
+ * The same `--neutral-*` tokens `neutralSparkVars` emits, pointed back at a static Radix
102
+ * family instead of a generated scale — the counterpart for an appearance that has *no*
103
+ * custom canvas of its own.
104
+ *
105
+ * Ambient (no explicit `appearance`) mode emits both appearances' scales into one unlayered
106
+ * `<style>`, but a custom canvas only regenerates neutrals for the appearance it belongs to.
107
+ * Left undeclared, the other block doesn't fall back — nothing resets a custom property, so
108
+ * its sibling's canvas-tinted values simply stay in effect there, and being unlayered they
109
+ * outrank `[data-neutral-color]`'s own `@layer base` mapping too. Declaring the same token
110
+ * set closes that. `var(--<family>-*)` is itself appearance-aware (Radix ships the dark
111
+ * scales under `.dark`), so one declaration resolves correctly wherever the block applies.
112
+ */
113
+ declare function neutralFamilyVars(family: Exclude<SparkNeutral, 'auto'>): string[];
45
114
  /**
46
115
  * `--neutral-*` declarations from the gray scale the generator produces alongside the
47
116
  * accent — normally discarded, because `[data-neutral-color]` points `--neutral-*` at a
@@ -56,5 +125,5 @@ declare function neutralSparkVars(scale: SparkAccentScale): string[];
56
125
  /** Wide-gamut (P3) twin of `neutralSparkVars`. */
57
126
  declare function neutralSparkVarsP3(scale: SparkAccentScale): string[];
58
127
  //#endregion
59
- export { Appearance, CURATED_ACCENTS, GenerateScaleOptions, GeneratedColors, SparkAccentScale, accentSparkVars, accentSparkVarsP3, appearanceForBackground, generateAccentScale, getMatchingNeutral, neutralSparkVars, neutralSparkVarsP3 };
128
+ export { Appearance, CURATED_ACCENTS, GenerateScaleOptions, GeneratedColors, SparkAccentScale, accentSparkVars, accentSparkVarsP3, appearanceForBackground, generateAccentScale, getMatchingNeutral, invertAccentScale, isParsableColor, neutralFamilyVars, neutralSparkVars, neutralSparkVarsP3, resolveAutoNeutral };
60
129
  //# sourceMappingURL=accent-theme.d.ts.map