@opendata-ai/openchart-vanilla 8.4.1 → 8.5.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/README.md +59 -0
- package/dist/chunk-2OJZBMXM.js +377 -0
- package/dist/chunk-2OJZBMXM.js.map +1 -0
- package/dist/{chunk-5A2NLYUW.js → chunk-5KV3ZBBL.js} +26 -376
- package/dist/chunk-5KV3ZBBL.js.map +1 -0
- package/dist/chunk-NG7CVCI2.js +58 -0
- package/dist/chunk-NG7CVCI2.js.map +1 -0
- package/dist/{chunk-3UIUANPI.js → chunk-UAK6HWOC.js} +2 -2
- package/dist/chunk-WOLX5EZT.js +3577 -0
- package/dist/chunk-WOLX5EZT.js.map +1 -0
- package/dist/{chunk-KANNWAEA.js → chunk-XGII4ZRT.js} +4 -58
- package/dist/chunk-XGII4ZRT.js.map +1 -0
- package/dist/graph-3d/index.d.ts +272 -0
- package/dist/graph-3d/index.js +1556 -0
- package/dist/graph-3d/index.js.map +1 -0
- package/dist/index.d.ts +4 -252
- package/dist/index.js +24 -3468
- package/dist/index.js.map +1 -1
- package/dist/renderer-registry-B5tW6yAZ.d.ts +376 -0
- package/dist/static.js +3 -2
- package/dist/static.js.map +1 -1
- package/dist/story/index.js +8 -5
- package/dist/story/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/styles.css.map +1 -1
- package/package.json +28 -6
- package/dist/chunk-5A2NLYUW.js.map +0 -1
- package/dist/chunk-KANNWAEA.js.map +0 -1
- /package/dist/{chunk-3UIUANPI.js.map → chunk-UAK6HWOC.js.map} +0 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
// src/theme-tokens.ts
|
|
2
|
+
import { adaptForLightLineStroke, cssTokenDefault } from "@opendata-ai/openchart-core";
|
|
3
|
+
function resolvedSurface(theme) {
|
|
4
|
+
return theme.colors.neutral.surface;
|
|
5
|
+
}
|
|
6
|
+
function stampThemeProperties(el, theme) {
|
|
7
|
+
const accent = theme.colors.categorical[0] ?? cssTokenDefault("--oc-accent", "light");
|
|
8
|
+
const bg = resolvedSurface(theme);
|
|
9
|
+
const n = theme.colors.neutral;
|
|
10
|
+
const props = [
|
|
11
|
+
["--oc-font-family", theme.fonts.family],
|
|
12
|
+
["--oc-font-mono", theme.fonts.mono],
|
|
13
|
+
["--oc-title-size", `${theme.chrome.title.fontSize}px`],
|
|
14
|
+
["--oc-title-weight", `${theme.chrome.title.fontWeight}`],
|
|
15
|
+
["--oc-subtitle-size", `${theme.chrome.subtitle.fontSize}px`],
|
|
16
|
+
["--oc-subtitle-weight", `${theme.chrome.subtitle.fontWeight}`],
|
|
17
|
+
["--oc-source-size", `${theme.chrome.source.fontSize}px`],
|
|
18
|
+
["--oc-source-weight", `${theme.chrome.source.fontWeight}`],
|
|
19
|
+
["--oc-body-size", `${theme.fonts.sizes.body}px`],
|
|
20
|
+
["--oc-eyebrow-size", `${theme.chrome.eyebrow.fontSize}px`],
|
|
21
|
+
["--oc-eyebrow-weight", `${theme.chrome.eyebrow.fontWeight}`],
|
|
22
|
+
["--oc-bg", bg],
|
|
23
|
+
["--oc-text", theme.colors.text],
|
|
24
|
+
["--oc-text-muted", theme.colors.axis],
|
|
25
|
+
// Secondary grays are derived from the theme's own text/background pair
|
|
26
|
+
// (ResolvedTheme.colors.neutral), so a warm or cool theme gets warm or
|
|
27
|
+
// cool grays instead of zinc. One direction only: theme -> CSS.
|
|
28
|
+
["--oc-text-secondary", n.secondary],
|
|
29
|
+
["--oc-text-faint", n.faint],
|
|
30
|
+
["--oc-border", n.border],
|
|
31
|
+
["--oc-gray-100", n[100]],
|
|
32
|
+
["--oc-gray-200", n[200]],
|
|
33
|
+
["--oc-gray-300", n[300]],
|
|
34
|
+
["--oc-gray-400", n[400]],
|
|
35
|
+
["--oc-gray-600", n[600]],
|
|
36
|
+
["--oc-gray-800", n[800]],
|
|
37
|
+
["--oc-gridline", theme.colors.gridline],
|
|
38
|
+
// --oc-axis is the hairline the axis line is drawn with, not the ink its
|
|
39
|
+
// tick labels take (that is --oc-text-muted, above).
|
|
40
|
+
["--oc-axis", theme.colors.hairline],
|
|
41
|
+
["--oc-border-radius", `${theme.borderRadius}px`],
|
|
42
|
+
["--oc-accent", accent],
|
|
43
|
+
["--oc-accent-strong", adaptForLightLineStroke(accent)],
|
|
44
|
+
["--oc-positive", theme.colors.positive],
|
|
45
|
+
["--oc-negative", theme.colors.negative],
|
|
46
|
+
["--oc-space-2", `${theme.spacing.chromeGap * 2}px`],
|
|
47
|
+
["--oc-space-4", `${theme.spacing.padding}px`]
|
|
48
|
+
];
|
|
49
|
+
for (const [name, value] of props) {
|
|
50
|
+
el.style.setProperty(name, value);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export {
|
|
55
|
+
resolvedSurface,
|
|
56
|
+
stampThemeProperties
|
|
57
|
+
};
|
|
58
|
+
//# sourceMappingURL=chunk-NG7CVCI2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/theme-tokens.ts"],"sourcesContent":["/**\n * Generate CSS custom properties from a resolved JS theme.\n *\n * Stamped on the .oc-root container at mount time so CSS consumers\n * read from the same source of truth as the JS engine. The static\n * values in tokens.css / dark.css serve as fallback defaults for\n * contexts where JS hasn't mounted (SSR, static HTML).\n */\n\nimport type { ResolvedTheme } from '@opendata-ai/openchart-core';\nimport { adaptForLightLineStroke, cssTokenDefault } from '@opendata-ai/openchart-core';\n\n/**\n * The opaque surface a theme paints on. A transparent theme background has no\n * color of its own, so it resolves to the static `--oc-bg` token for the mode --\n * the same value the engine's knockout strokes are cut in. Resolved once in\n * core, on `colors.neutral.surface`; this is a named read of it.\n */\nexport function resolvedSurface(theme: ResolvedTheme): string {\n return theme.colors.neutral.surface;\n}\n\nexport function stampThemeProperties(el: HTMLElement, theme: ResolvedTheme): void {\n const accent = theme.colors.categorical[0] ?? cssTokenDefault('--oc-accent', 'light');\n const bg = resolvedSurface(theme);\n\n const n = theme.colors.neutral;\n\n const props: [string, string][] = [\n ['--oc-font-family', theme.fonts.family],\n ['--oc-font-mono', theme.fonts.mono],\n ['--oc-title-size', `${theme.chrome.title.fontSize}px`],\n ['--oc-title-weight', `${theme.chrome.title.fontWeight}`],\n ['--oc-subtitle-size', `${theme.chrome.subtitle.fontSize}px`],\n ['--oc-subtitle-weight', `${theme.chrome.subtitle.fontWeight}`],\n ['--oc-source-size', `${theme.chrome.source.fontSize}px`],\n ['--oc-source-weight', `${theme.chrome.source.fontWeight}`],\n ['--oc-body-size', `${theme.fonts.sizes.body}px`],\n ['--oc-eyebrow-size', `${theme.chrome.eyebrow.fontSize}px`],\n ['--oc-eyebrow-weight', `${theme.chrome.eyebrow.fontWeight}`],\n ['--oc-bg', bg],\n ['--oc-text', theme.colors.text],\n ['--oc-text-muted', theme.colors.axis],\n // Secondary grays are derived from the theme's own text/background pair\n // (ResolvedTheme.colors.neutral), so a warm or cool theme gets warm or\n // cool grays instead of zinc. One direction only: theme -> CSS.\n ['--oc-text-secondary', n.secondary],\n ['--oc-text-faint', n.faint],\n ['--oc-border', n.border],\n ['--oc-gray-100', n[100]],\n ['--oc-gray-200', n[200]],\n ['--oc-gray-300', n[300]],\n ['--oc-gray-400', n[400]],\n ['--oc-gray-600', n[600]],\n ['--oc-gray-800', n[800]],\n ['--oc-gridline', theme.colors.gridline],\n // --oc-axis is the hairline the axis line is drawn with, not the ink its\n // tick labels take (that is --oc-text-muted, above).\n ['--oc-axis', theme.colors.hairline],\n ['--oc-border-radius', `${theme.borderRadius}px`],\n ['--oc-accent', accent],\n ['--oc-accent-strong', adaptForLightLineStroke(accent)],\n ['--oc-positive', theme.colors.positive],\n ['--oc-negative', theme.colors.negative],\n ['--oc-space-2', `${theme.spacing.chromeGap * 2}px`],\n ['--oc-space-4', `${theme.spacing.padding}px`],\n ];\n\n for (const [name, value] of props) {\n el.style.setProperty(name, value);\n }\n}\n"],"mappings":";AAUA,SAAS,yBAAyB,uBAAuB;AAQlD,SAA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EAAE,GAAG,CAAC;AAAA,IACxB,CAAC,iBAAiB,EAAE,GAAG,CAAC;AAAA,IACxB,CAAC,iBAAiB,EAAE,GAAG,CAAC;AAAA,IACxB,CAAC,iBAAiB,EAAE,GAAG,CAAC;AAAA,IACxB,CAAC,iBAAiB,EAAE,GAAG,CAAC;AAAA,IACxB,CAAC,iBAAiB,MAAM,OAAO,QAAQ;AAAA;AAAA;AAAA,IAGvC,CAAC,aAAa,MAAM,OAAO,QAAQ;AAAA,IACnC,CAAC,sBAAsB,GAAG,MAAM,YAAY,IAAI;AAAA,IAChD,CAAC,eAAe,MAAM;AAAA,IACtB,CAAC,sBAAsB,wBAAwB,MAAM,CAAC;AAAA,IACtD,CAAC,iBAAiB,MAAM,OAAO,QAAQ;AAAA,IACvC,CAAC,iBAAiB,MAAM,OAAO,QAAQ;AAAA,IACvC,CAAC,gBAAgB,GAAG,MAAM,QAAQ,YAAY,CAAC,IAAI;AAAA,IACnD,CAAC,gBAAgB,GAAG,MAAM,QAAQ,OAAO,IAAI;AAAA,EAC/C;AAEA,aAAW,CAAC,MAAM,KAAK,KAAK,OAAO;AACjC,OAAG,MAAM,YAAY,MAAM,KAAK;AAAA,EAClC;AACF;","names":[]}
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
renderChromeElement,
|
|
4
4
|
renderLegend,
|
|
5
5
|
stampAnimationVars
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-XGII4ZRT.js";
|
|
7
7
|
|
|
8
8
|
// src/tilemap-renderer.ts
|
|
9
9
|
var SVG_NS = "http://www.w3.org/2000/svg";
|
|
@@ -327,4 +327,4 @@ function renderTileMapSVG(layout, opts) {
|
|
|
327
327
|
export {
|
|
328
328
|
renderTileMapSVG
|
|
329
329
|
};
|
|
330
|
-
//# sourceMappingURL=chunk-
|
|
330
|
+
//# sourceMappingURL=chunk-UAK6HWOC.js.map
|