@open-tomato/charts 0.0.0-stage → 0.1.0

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 (75) hide show
  1. package/README.md +283 -2
  2. package/dist/engine/BarChart/BarChart.d.ts +4 -0
  3. package/dist/engine/BarChart/BarChart.option.d.ts +4 -0
  4. package/dist/engine/BarChart/index.d.ts +2 -0
  5. package/dist/engine/BoxPlot/BoxPlot.d.ts +4 -0
  6. package/dist/engine/BoxPlot/BoxPlot.option.d.ts +4 -0
  7. package/dist/engine/BoxPlot/index.d.ts +2 -0
  8. package/dist/engine/Bullet/Bullet.d.ts +4 -0
  9. package/dist/engine/Bullet/Bullet.option.d.ts +4 -0
  10. package/dist/engine/Bullet/index.d.ts +2 -0
  11. package/dist/engine/Donut/Donut.d.ts +4 -0
  12. package/dist/engine/Donut/Donut.option.d.ts +4 -0
  13. package/dist/engine/Donut/index.d.ts +2 -0
  14. package/dist/engine/Gauge/Gauge.d.ts +4 -0
  15. package/dist/engine/Gauge/Gauge.option.d.ts +4 -0
  16. package/dist/engine/Gauge/index.d.ts +2 -0
  17. package/dist/engine/HeatmapGrid/HeatmapGrid.d.ts +4 -0
  18. package/dist/engine/HeatmapGrid/HeatmapGrid.option.d.ts +4 -0
  19. package/dist/engine/HeatmapGrid/index.d.ts +2 -0
  20. package/dist/engine/Histogram/Histogram.d.ts +4 -0
  21. package/dist/engine/Histogram/Histogram.option.d.ts +4 -0
  22. package/dist/engine/Histogram/index.d.ts +2 -0
  23. package/dist/engine/LineChart/LineChart.d.ts +19 -0
  24. package/dist/engine/LineChart/LineChart.option.d.ts +4 -0
  25. package/dist/engine/LineChart/index.d.ts +2 -0
  26. package/dist/engine/NetworkGraph/NetworkGraph.d.ts +4 -0
  27. package/dist/engine/NetworkGraph/NetworkGraph.option.d.ts +8 -0
  28. package/dist/engine/NetworkGraph/index.d.ts +2 -0
  29. package/dist/engine/Nightingale/Nightingale.d.ts +4 -0
  30. package/dist/engine/Nightingale/Nightingale.option.d.ts +4 -0
  31. package/dist/engine/Nightingale/index.d.ts +2 -0
  32. package/dist/engine/Radar/Radar.d.ts +4 -0
  33. package/dist/engine/Radar/Radar.option.d.ts +4 -0
  34. package/dist/engine/Radar/index.d.ts +2 -0
  35. package/dist/engine/Sankey/Sankey.d.ts +4 -0
  36. package/dist/engine/Sankey/Sankey.option.d.ts +6 -0
  37. package/dist/engine/Sankey/index.d.ts +2 -0
  38. package/dist/engine/ScatterChart/ScatterChart.d.ts +4 -0
  39. package/dist/engine/ScatterChart/ScatterChart.option.d.ts +6 -0
  40. package/dist/engine/ScatterChart/index.d.ts +2 -0
  41. package/dist/engine/Sunburst/Sunburst.d.ts +4 -0
  42. package/dist/engine/Sunburst/Sunburst.option.d.ts +19 -0
  43. package/dist/engine/Sunburst/index.d.ts +2 -0
  44. package/dist/engine/Treemap/Treemap.d.ts +4 -0
  45. package/dist/engine/Treemap/Treemap.option.d.ts +4 -0
  46. package/dist/engine/Treemap/index.d.ts +2 -0
  47. package/dist/engine/chrome.d.ts +90 -0
  48. package/dist/engine/core.d.ts +58 -0
  49. package/dist/engine/echartsEngine.d.ts +3 -0
  50. package/dist/engine/fixtures.d.ts +61 -0
  51. package/dist/engine/headless/headless.d.ts +86 -0
  52. package/dist/engine/headless/index.d.ts +10 -0
  53. package/dist/engine/headless/index.js +142 -0
  54. package/dist/engine/index.d.ts +1 -0
  55. package/dist/engine/shared.d.ts +59 -0
  56. package/dist/engine/shared.variants.d.ts +40 -0
  57. package/dist/index-4bxmxw89.js +1786 -0
  58. package/dist/index-85mb21rn.js +69 -0
  59. package/dist/index.d.ts +11 -0
  60. package/dist/index.js +618 -0
  61. package/dist/lib/cn.d.ts +7 -0
  62. package/dist/lib/index.d.ts +2 -0
  63. package/dist/seam/ChartEngineProvider.d.ts +12 -0
  64. package/dist/seam/FormatProvider.d.ts +25 -0
  65. package/dist/seam/format.d.ts +171 -0
  66. package/dist/seam/format.schema.d.ts +14 -0
  67. package/dist/seam/height.d.ts +15 -0
  68. package/dist/seam/index.d.ts +12 -0
  69. package/dist/seam/tones.d.ts +49 -0
  70. package/dist/seam/types.d.ts +322 -0
  71. package/dist/seam/useResolvedTokens.d.ts +7 -0
  72. package/dist/theme/index.d.ts +3 -0
  73. package/dist/theme/index.js +30 -0
  74. package/dist/theme/tokens.d.ts +40 -0
  75. package/package.json +82 -4
@@ -0,0 +1,40 @@
1
+ /**
2
+ * The theme contract: the CSS custom properties this library reads, by
3
+ * name. The library ships no values. The consuming app defines every name
4
+ * below, light values in its Tailwind `@theme` block and a dark re-step
5
+ * under `:root[data-theme="dark"]`; `@open-tomato/atlas-demo`'s
6
+ * `src/styles.css` is the reference set.
7
+ *
8
+ * Each name is a Tailwind v4 colour token, so `--color-series-1` is also
9
+ * the class family `bg-series-1`, `text-series-1`, `stroke-series-1`.
10
+ */
11
+ /** Categorical series colours, in the order a chart assigns them. */
12
+ export declare const SERIES_TOKENS: readonly ["--color-series-1", "--color-series-2", "--color-series-3", "--color-series-4", "--color-series-5", "--color-series-6", "--color-series-7", "--color-series-8"];
13
+ /** Status colours, mildest to worst. */
14
+ export declare const STATUS_TOKENS: readonly ["--color-good", "--color-warning", "--color-serious", "--color-critical"];
15
+ /** Surfaces, text and chart furniture. */
16
+ export declare const SURFACE_TOKENS: readonly ["--color-surface", "--color-plane", "--color-ink", "--color-ink-2", "--color-muted", "--color-grid", "--color-baseline", "--color-ring"];
17
+ /** The sequential ramp, lightest to darkest, and the diverging midpoint. */
18
+ export declare const SEQUENTIAL_TOKENS: readonly ["--color-seq-100", "--color-seq-200", "--color-seq-300", "--color-seq-400", "--color-seq-500", "--color-seq-600", "--color-seq-700", "--color-diverge-mid"];
19
+ /** The balance poles: the rim colour and the `-core` colour at the centre. */
20
+ export declare const POLE_TOKENS: readonly ["--color-pole-ship", "--color-pole-ship-core", "--color-pole-fail", "--color-pole-fail-core", "--color-pole-base", "--color-pole-base-core"];
21
+ /** Change indicators: a rise read as good. */
22
+ export declare const DELTA_TOKENS: readonly ["--color-delta-up"];
23
+ /** One token name the library reads. */
24
+ export type ThemeToken = typeof SERIES_TOKENS[number] | typeof STATUS_TOKENS[number] | typeof SURFACE_TOKENS[number] | typeof SEQUENTIAL_TOKENS[number] | typeof POLE_TOKENS[number] | typeof DELTA_TOKENS[number];
25
+ /** Every token name, grouped as above; the list a theme must define in full. */
26
+ export declare const THEME_TOKENS: readonly ThemeToken[];
27
+ /** The attribute on `<html>` that switches the theme, and its dark value. */
28
+ export declare const THEME_ATTRIBUTE = "data-theme";
29
+ /** The value of {@link THEME_ATTRIBUTE} that selects the dark re-step. */
30
+ export declare const DARK_THEME = "dark";
31
+ /** A `var()` reference to one token, for the canvas bridge and inline SVG paint. */
32
+ export declare function tokenVar(token: ThemeToken): string;
33
+ /** The prefix every token name shares; Tailwind v4 reads `--color-<name>` as the `<name>` colour. */
34
+ export declare const TOKEN_PREFIX = "--color-";
35
+ /** A token's name without {@link TOKEN_PREFIX}: `--color-series-1` is `series-1`, the spelling of a chart tone and of a class family. */
36
+ export type TokenName<T extends ThemeToken = ThemeToken> = T extends `${typeof TOKEN_PREFIX}${infer Name}` ? Name : never;
37
+ /** The name of one token, without its prefix. */
38
+ export declare function tokenName<T extends ThemeToken>(token: T): TokenName<T>;
39
+ /** The names of a list of tokens, in the list's order. */
40
+ export declare function tokenNames<T extends ThemeToken>(tokens: readonly T[]): TokenName<T>[];
package/package.json CHANGED
@@ -1,6 +1,84 @@
1
1
  {
2
2
  "name": "@open-tomato/charts",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "description": "React 19 charting for the @open-tomato scope: a chart-engine seam over ECharts 6, the theme token names, formatters, and a headless engine subpath.",
5
+ "license": "Apache-2.0",
6
+ "openTomato": {
7
+ "team": "@open-tomato/maintainers"
8
+ },
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/open-tomato/components.git",
12
+ "directory": "packages/charts"
13
+ },
14
+ "type": "module",
15
+ "sideEffects": false,
16
+ "exports": {
17
+ ".": {
18
+ "types": "./dist/index.d.ts",
19
+ "import": "./dist/index.js"
20
+ },
21
+ "./theme": {
22
+ "types": "./dist/theme/index.d.ts",
23
+ "import": "./dist/theme/index.js"
24
+ },
25
+ "./engine": {
26
+ "types": "./dist/engine/headless/index.d.ts",
27
+ "import": "./dist/engine/headless/index.js"
28
+ },
29
+ "./package.json": "./package.json"
30
+ },
31
+ "files": [
32
+ "dist",
33
+ "README.md"
34
+ ],
35
+ "publishConfig": {
36
+ "access": "public",
37
+ "registry": "https://registry.npmjs.org/",
38
+ "@open-tomato:registry": "https://registry.npmjs.org/"
39
+ },
40
+ "scripts": {
41
+ "check-types": "tsc --build && tsc -p tsconfig.stories.json",
42
+ "lint": "eslint .",
43
+ "test": "bun test",
44
+ "build": "rm -rf dist && NODE_ENV=production bun build ./src/index.ts ./src/theme/index.ts ./src/engine/headless/index.ts --root ./src --outdir ./dist --target browser --format esm --splitting --packages external && tsc -p tsconfig.build.json",
45
+ "storybook": "storybook dev -p 6006",
46
+ "build:storybook": "storybook build --quiet --output-dir storybook-static",
47
+ "check:stories": "bun scripts/check-stories.ts storybook-static",
48
+ "test:visual": "playwright test --config visual/playwright.config.ts",
49
+ "test:visual:update": "playwright test --config visual/playwright.config.ts --update-snapshots"
50
+ },
51
+ "dependencies": {
52
+ "class-variance-authority": "^0.7.1",
53
+ "clsx": "^2.1.1",
54
+ "echarts": "^6.1.0",
55
+ "tailwind-merge": "^3.7.0",
56
+ "zod": "^4.1.0"
57
+ },
58
+ "peerDependencies": {
59
+ "react": "^19.0.0"
60
+ },
61
+ "devDependencies": {
62
+ "@happy-dom/global-registrator": "^21.0.4",
63
+ "@open-tomato/eslint-config": "^0.1.0",
64
+ "@open-tomato/typescript-config": "^0.1.0",
65
+ "@playwright/test": "1.63.0",
66
+ "@storybook/addon-docs": "^10.6.5",
67
+ "@storybook/react-vite": "^10.6.5",
68
+ "@tailwindcss/vite": "^4.3.4",
69
+ "@testing-library/dom": "^10.4.2",
70
+ "@testing-library/react": "^16.3.3",
71
+ "@types/bun": "^1.4.4",
72
+ "@types/react": "^19.3.0",
73
+ "@types/react-dom": "^19.3.0",
74
+ "eslint": "^9.39.4",
75
+ "happy-dom": "^21.0.4",
76
+ "playwright": "1.63.0",
77
+ "react": "^19.3.1",
78
+ "react-dom": "^19.3.1",
79
+ "storybook": "^10.6.5",
80
+ "tailwindcss": "^4.3.4",
81
+ "typescript": "^5.9.3",
82
+ "vite": "^8.3.5"
83
+ }
84
+ }