@alpic-ai/ui 1.156.0 → 1.157.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.
@@ -1,4 +1,38 @@
1
1
  //#region src/lib/chart-palette.d.ts
2
+ /**
3
+ * Chart palettes — the locked "paired system" from the analytics-v2 design.
4
+ *
5
+ * These are charting-API color values (consumed by Recharts at draw time, which
6
+ * cannot read CSS custom properties), so per the design-system rules they live
7
+ * as documented hex constants rather than `--color-*` tokens. They are
8
+ * theme-independent: the same series colors read on light and dark canvases.
9
+ * Only the chrome (grid, axis text, tooltip surface, semantic colors) is
10
+ * theme-aware — see `useChartTheme`.
11
+ *
12
+ * Rules baked in:
13
+ * - Pink leads (index 0) — never buried, fixing the V1 "pink last" bug.
14
+ * - Adjacent dashboard cards alternate lead palette (magenta / cyan) — the
15
+ * page decides which to pass; the component just receives one.
16
+ */
17
+ declare const MAGENTA_PALETTE: readonly ["#da1b6a", "#ec82b0", "#9a67d7", "#668fdf", "#47bde0", "#75ddd8", "#cd8c4d", "#3eb0a1"];
18
+ declare const CYAN_PALETTE: readonly ["#2eb2c5", "#50d0c0", "#4f90e0", "#8d74e0", "#bc73e0", "#ec82b0", "#da1b6a", "#c08dd3"];
2
19
  type ChartPaletteName = "magenta" | "cyan";
20
+ declare const CHART_PALETTES: Record<ChartPaletteName, readonly string[]>;
21
+ declare const heatRampMagenta: (empty: string) => string[];
22
+ declare const heatRampMint: (empty: string) => string[];
23
+ declare const HEAT_EMPTY: {
24
+ readonly light: "#eef3f3";
25
+ readonly dark: "#102222";
26
+ };
27
+ declare const heatRamp: (palette: ChartPaletteName, empty: string, isDark?: boolean) => string[];
28
+ declare const luminance: (hex: string) => number;
29
+ declare const paletteColor: (palette: readonly string[], index: number) => string;
30
+ declare const rampColor: (palette: ChartPaletteName, fraction: number) => string;
31
+ /**
32
+ * Interpolate continuously across a multi-stop heat ramp (e.g. `heatRampMagenta`),
33
+ * so a normalized 0..1 value reads as a smooth single-hue gradient rather than
34
+ * the five discrete bands.
35
+ */
36
+ declare const heatColor: (stops: readonly string[], fraction: number) => string;
3
37
  //#endregion
4
- export { ChartPaletteName };
38
+ export { CHART_PALETTES, CYAN_PALETTE, ChartPaletteName, HEAT_EMPTY, MAGENTA_PALETTE, heatColor, heatRamp, heatRampMagenta, heatRampMint, luminance, paletteColor, rampColor };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alpic-ai/ui",
3
- "version": "1.156.0",
3
+ "version": "1.157.1",
4
4
  "description": "Alpic design system — shared UI components",
5
5
  "type": "module",
6
6
  "exports": {
@@ -16,6 +16,10 @@
16
16
  "types": "./dist/lib/cn.d.mts",
17
17
  "default": "./dist/lib/cn.mjs"
18
18
  },
19
+ "./lib/chart-palette": {
20
+ "types": "./dist/lib/chart-palette.d.mts",
21
+ "default": "./dist/lib/chart-palette.mjs"
22
+ },
19
23
  "./theme": "./src/styles/tokens.css"
20
24
  },
21
25
  "files": [