@lostgradient/cinder 0.23.0 → 0.23.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,37 @@
1
1
  # @lostgradient/cinder
2
2
 
3
+ ## 0.23.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#1256](https://github.com/stevekinney/cinder/pull/1256) [`61b1bee`](https://github.com/stevekinney/cinder/commit/61b1bee92854ea8cdf9fc0a856d41e922b2c3966) Thanks [@stevekinney](https://github.com/stevekinney)! - fix(statistic): restore the muted text hierarchy for unthemed Statistics
8
+
9
+ `Statistic` resolved its colours through `resolveChartTheme()`, whose
10
+ unthemed defaults are `currentColor` for both `foreground` and `muted`.
11
+ Because the component writes those as **inline** custom properties, the
12
+ `var(--_cinder-chart-*, …)` fallbacks in `statistic.css` could never apply —
13
+ so a `Statistic` rendered without an explicit `theme` painted its label,
14
+ icon, and change description at full text colour, visually identical to the
15
+ value. The label/value hierarchy that `--cinder-text-muted` provided was
16
+ silently lost for every consumer that doesn't pass a chart theme.
17
+
18
+ The chart components absorb the same `currentColor` default with a
19
+ compensating `opacity` on their tick labels. That is the wrong tool here:
20
+ this is body text, which has to clear the 4.5:1 AA floor rather than land
21
+ wherever a multiplier puts it — the same reasoning that moved status text
22
+ off the fill tokens in 0.21.
23
+
24
+ Unthemed `Statistic` now defaults to the contrast-tuned text tokens
25
+ (`--cinder-text` / `--cinder-text-muted`). The substitution is all-or-nothing on
26
+ `theme`'s presence rather than per-field: supplying any theme — including a
27
+ partial one — keeps `resolveChartTheme()`'s `currentColor` inheritance for the
28
+ fields it omits, so `theme={{ foreground: 'white', background: 'black' }}`
29
+ leaves the label inheriting white instead of dropping the application's dark
30
+ muted token onto a black panel. `background` keeps its `transparent` default.
31
+ To make an otherwise-unthemed Statistic follow an ancestor's `color`, ask for
32
+ it explicitly with `theme={{ foreground: 'currentColor', muted: 'currentColor' }}`.
33
+ No API change.
34
+
3
35
  ## 0.23.0
4
36
 
5
37
  ### Minor Changes
package/components.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "manifestVersion": 1,
4
4
  "package": {
5
5
  "name": "@lostgradient/cinder",
6
- "version": "0.23.0",
6
+ "version": "0.23.1",
7
7
  "framework": "svelte",
8
8
  "frameworkVersionRange": ">=5.56.0 <6",
9
9
  "classPrefix": "cinder-",
@@ -1405,7 +1405,11 @@ function Statistic($$anchor, $$props) {
1405
1405
  return `decreased by ${$$props.change.value}${suffix}`;
1406
1406
  return `no change, ${$$props.change.value}${suffix}`;
1407
1407
  });
1408
- const resolvedTheme = $.derived(() => resolveChartTheme($$props.theme));
1408
+ const resolvedTheme = $.derived(() => $$props.theme ? resolveChartTheme($$props.theme) : {
1409
+ ...resolveChartTheme(undefined),
1410
+ foreground: "var(--cinder-text)",
1411
+ muted: "var(--cinder-text-muted)"
1412
+ });
1409
1413
  var div = root_3();
1410
1414
  $.attribute_effect(div, ($0) => ({
1411
1415
  ...rest,
@@ -1499,4 +1503,4 @@ export {
1499
1503
  Statistic
1500
1504
  };
1501
1505
 
1502
- //# debugId=AD6C44026791356F64756E2164756E21
1506
+ //# debugId=EF4734BE62EA88E264756E2164756E21
@@ -1405,7 +1405,11 @@ function Statistic($$anchor, $$props) {
1405
1405
  return `decreased by ${$$props.change.value}${suffix}`;
1406
1406
  return `no change, ${$$props.change.value}${suffix}`;
1407
1407
  });
1408
- const resolvedTheme = $.derived(() => resolveChartTheme($$props.theme));
1408
+ const resolvedTheme = $.derived(() => $$props.theme ? resolveChartTheme($$props.theme) : {
1409
+ ...resolveChartTheme(undefined),
1410
+ foreground: "var(--cinder-text)",
1411
+ muted: "var(--cinder-text-muted)"
1412
+ });
1409
1413
  var div = root_3();
1410
1414
  $.attribute_effect(div, ($0) => ({
1411
1415
  ...rest,
@@ -1542,4 +1546,4 @@ export {
1542
1546
  StatisticGroup
1543
1547
  };
1544
1548
 
1545
- //# debugId=7FD467FA63EDEF5F64756E2164756E21
1549
+ //# debugId=8C161CB9EFF31D8264756E2164756E21
package/dist/index.js CHANGED
@@ -65099,7 +65099,11 @@ function Statistic($$anchor, $$props) {
65099
65099
  return `decreased by ${$$props.change.value}${suffix}`;
65100
65100
  return `no change, ${$$props.change.value}${suffix}`;
65101
65101
  });
65102
- const resolvedTheme = $281.derived(() => resolveChartTheme($$props.theme));
65102
+ const resolvedTheme = $281.derived(() => $$props.theme ? resolveChartTheme($$props.theme) : {
65103
+ ...resolveChartTheme(undefined),
65104
+ foreground: "var(--cinder-text)",
65105
+ muted: "var(--cinder-text-muted)"
65106
+ });
65103
65107
  var div = root_393();
65104
65108
  $281.attribute_effect(div, ($0) => ({
65105
65109
  ...rest,
@@ -72196,4 +72200,4 @@ export {
72196
72200
  AccessGateExport as AccessGate
72197
72201
  };
72198
72202
 
72199
- //# debugId=4420C08D9A4F7BE664756E2164756E21
72203
+ //# debugId=31DEDEB1BA0080C564756E2164756E21
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  statistic_default
3
- } from "../../index.server-151dt1tx.js";
3
+ } from "../../index.server-rx9aszk6.js";
4
4
  import {
5
5
  Statistic
6
- } from "../../index.server-veqke4sq.js";
6
+ } from "../../index.server-bp0vzxby.js";
7
7
  import"../../index.server-chh0fzxj.js";
8
8
  import"../../index.server-sz8sxsj6.js";
9
9
  import"../../index.server-mmmrgvyd.js";
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  StatisticGroup,
3
3
  statistic_group_default
4
- } from "../../index.server-8dh2rtnc.js";
5
- import"../../index.server-veqke4sq.js";
4
+ } from "../../index.server-vnr1h5g5.js";
5
+ import"../../index.server-bp0vzxby.js";
6
6
  import"../../index.server-chh0fzxj.js";
7
7
  import"../../index.server-sz8sxsj6.js";
8
8
  import"../../index.server-mmmrgvyd.js";
@@ -68,11 +68,11 @@ import {
68
68
  } from "./index.server-fkw2mzze.js";
69
69
  import {
70
70
  statistic_default
71
- } from "./index.server-151dt1tx.js";
71
+ } from "./index.server-rx9aszk6.js";
72
72
  import {
73
73
  statistic_group_default
74
- } from "./index.server-8dh2rtnc.js";
75
- import"./index.server-veqke4sq.js";
74
+ } from "./index.server-vnr1h5g5.js";
75
+ import"./index.server-bp0vzxby.js";
76
76
  import {
77
77
  status_dot_default
78
78
  } from "./index.server-nqz2nrgp.js";
@@ -48,7 +48,11 @@ function Statistic($$renderer, $$props) {
48
48
  return `decreased by ${change.value}${suffix}`;
49
49
  return `no change, ${change.value}${suffix}`;
50
50
  });
51
- const resolvedTheme = $.derived(() => resolveChartTheme(theme));
51
+ const resolvedTheme = $.derived(() => theme ? resolveChartTheme(theme) : {
52
+ ...resolveChartTheme(undefined),
53
+ foreground: "var(--cinder-text)",
54
+ muted: "var(--cinder-text-muted)"
55
+ });
52
56
  $$renderer2.push(`<div${$.attributes({
53
57
  ...rest,
54
58
  id,
@@ -89,4 +93,4 @@ function Statistic($$renderer, $$props) {
89
93
 
90
94
  export { Statistic };
91
95
 
92
- //# debugId=E1E126A5413A462064756E2164756E21
96
+ //# debugId=21FAD66B4A8BBC2A64756E2164756E21
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Statistic
3
- } from "./index.server-veqke4sq.js";
3
+ } from "./index.server-bp0vzxby.js";
4
4
 
5
5
  // src/components/statistic/index.ts
6
6
  var statistic_default = Statistic;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Statistic
3
- } from "./index.server-veqke4sq.js";
3
+ } from "./index.server-bp0vzxby.js";
4
4
  import {
5
5
  classNames
6
6
  } from "./index.server-z7nvkz8v.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lostgradient/cinder",
3
- "version": "0.23.0",
3
+ "version": "0.23.1",
4
4
  "description": "A Svelte 5 component library and design system focused on accessibility, theming, and per-component tree-shaking.",
5
5
  "keywords": [
6
6
  "svelte",
@@ -32,7 +32,43 @@ const changeAccessibleText = $derived.by(() => {
32
32
  return `decreased by ${change.value}${suffix}`;
33
33
  return `no change, ${change.value}${suffix}`;
34
34
  });
35
- const resolvedTheme = $derived(resolveChartTheme(theme));
35
+ /**
36
+ * Statistic is page text, not chart glyphs, so it cannot take
37
+ * `resolveChartTheme`'s unthemed defaults as-is: that returns
38
+ * `currentColor` for `foreground` and `muted`, and this component writes
39
+ * both as INLINE custom properties, so the `var(--_cinder-chart-*, …)`
40
+ * fallbacks in `statistic.css` can never apply. An unthemed Statistic
41
+ * therefore painted its label, icon, and change description at full text
42
+ * colour — visually identical to the value, with the muted hierarchy gone.
43
+ *
44
+ * The chart components absorb the same `currentColor` default with a
45
+ * compensating `opacity` on their tick labels; that is the wrong tool for
46
+ * text, which has to clear the 4.5:1 AA floor rather than land wherever a
47
+ * multiplier puts it.
48
+ *
49
+ * So the substitution is all-or-nothing on `theme`'s presence, NOT
50
+ * per-field: with no theme at all, both colours come from the
51
+ * contrast-tuned text tokens (restoring the pre-#1248 hierarchy); with any
52
+ * theme, `resolveChartTheme` is used untouched so omitted fields still
53
+ * inherit `currentColor` as the partial-theme contract documents. A
54
+ * per-field fallback would put the app's `--cinder-text-muted` on a caller's
55
+ * custom dark panel. A surface that colours its own text through an
56
+ * ancestor and wants the Statistic to follow can say so explicitly with
57
+ * `theme={{ foreground: 'currentColor', muted: 'currentColor' }}`.
58
+ */
59
+ const resolvedTheme = $derived(theme
60
+ ? // A supplied theme — even a partial one — keeps `resolveChartTheme`'s
61
+ // `currentColor` inheritance for the fields it omits, per the documented
62
+ // partial-theme contract. Substituting the global text tokens here would
63
+ // break exactly the case the contract exists for: a caller passing
64
+ // `{ foreground: 'white', background: 'black' }` for a dark panel would
65
+ // get the app's dark `--cinder-text-muted` label on that black surface.
66
+ resolveChartTheme(theme)
67
+ : {
68
+ ...resolveChartTheme(undefined),
69
+ foreground: 'var(--cinder-text)',
70
+ muted: 'var(--cinder-text-muted)',
71
+ });
36
72
  </script>
37
73
 
38
74
  <div