@nadicodeai/ui 0.5.1 → 0.5.2
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chart.d.ts","sourceRoot":"","sources":["../../src/components/chart.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,iBAAiB,MAAM,UAAU,CAAA;AAC7C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAKhD,QAAA,MAAM,MAAM;;;CAAwC,CAAA;AAGpD,KAAK,eAAe,GAAG,MAAM,GAAG,MAAM,CAAA;AACtC,KAAK,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,OAAO,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG;IAC/D,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;
|
|
1
|
+
{"version":3,"file":"chart.d.ts","sourceRoot":"","sources":["../../src/components/chart.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,iBAAiB,MAAM,UAAU,CAAA;AAC7C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAKhD,QAAA,MAAM,MAAM;;;CAAwC,CAAA;AAGpD,KAAK,eAAe,GAAG,MAAM,GAAG,MAAM,CAAA;AACtC,KAAK,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,OAAO,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG;IAC/D,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AA4BD,MAAM,MAAM,WAAW,GAAG,MAAM,CAC9B,MAAM,EACN;IACE,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACvB,IAAI,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;CAC3B,GAAG,CACA;IAAE,KAAK,CAAC,EAAE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N,iBAAiB,CAAC,0BAA0B,CAC1C,gBAAgB,EAChB,eAAe,CAChB,EACD,oBAAoB,CACrB,4BA6HF;AAED,QAAA,MAAM,WAAW,sGAA2B,CAAA;AAE5C,iBAAS,kBAAkB,CAAC,EAC1B,SAAS,EACT,QAAgB,EAChB,OAAO,EACP,aAAwB,EACxB,OAAO,GACR,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG;IAC/B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,GAAG,iBAAiB,CAAC,yBAAyB,4BA4C9C;AAsCD,OAAO,EACL,cAAc,EACd,YAAY,EACZ,mBAAmB,EACnB,WAAW,EACX,kBAAkB,EAClB,UAAU,GACX,CAAA"}
|
package/dist/components/chart.js
CHANGED
|
@@ -6,6 +6,9 @@ import { cn } from "../lib/utils.js";
|
|
|
6
6
|
// Format: { THEME_NAME: CSS_SELECTOR }
|
|
7
7
|
const THEMES = { light: "", dark: ".dark" };
|
|
8
8
|
const INITIAL_DIMENSION = { width: 320, height: 200 };
|
|
9
|
+
// Deviates from stock base-nova (raw interpolation): chart id and color values
|
|
10
|
+
// are sanitized before they reach the injected <style> tag, closing the CSS
|
|
11
|
+
// injection surface. Pinned by tests/chart-style.test.ts; see ADR 0010.
|
|
9
12
|
function sanitizeChartToken(value) {
|
|
10
13
|
const sanitized = value
|
|
11
14
|
.trim()
|
|
@@ -34,7 +37,7 @@ function useChart() {
|
|
|
34
37
|
function ChartContainer({ id, className, children, config, initialDimension = INITIAL_DIMENSION, ...props }) {
|
|
35
38
|
const uniqueId = React.useId();
|
|
36
39
|
const chartId = sanitizeChartToken(`chart-${id ?? uniqueId.replace(/:/g, "")}`);
|
|
37
|
-
return (_jsx(ChartContext.Provider, { value: { config }, children: _jsxs("div", { "data-slot": "chart", "data-chart": chartId, className: cn("flex aspect-video justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-layer]:outline-hidden [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-sector]:outline-hidden [&_.recharts-surface]:outline-hidden", className), ...props, children: [_jsx(ChartStyle, { id: chartId, config: config }), _jsx(RechartsPrimitive.ResponsiveContainer, { initialDimension: initialDimension, children: children })] }) }));
|
|
40
|
+
return (_jsx(ChartContext.Provider, { value: { config }, children: _jsxs("div", { "data-slot": "chart", "data-chart": chartId, className: cn("flex aspect-video justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden", className), ...props, children: [_jsx(ChartStyle, { id: chartId, config: config }), _jsx(RechartsPrimitive.ResponsiveContainer, { initialDimension: initialDimension, children: children })] }) }));
|
|
38
41
|
}
|
|
39
42
|
const ChartStyle = ({ id, config }) => {
|
|
40
43
|
const chartId = sanitizeChartToken(id);
|
package/dist/styles/globals.css
CHANGED
|
@@ -27,13 +27,13 @@
|
|
|
27
27
|
*/
|
|
28
28
|
@custom-variant dark (&:where(.dark, .dark *));
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
30
|
+
/*
|
|
31
|
+
* Raw --nc-* dark remaps (state/selection/cross/chart) are generated at
|
|
32
|
+
* :root.dark specificity inside the design-system theme import above; the
|
|
33
|
+
* package-local copy that used to live here is gone so the generated theme
|
|
34
|
+
* stays the single owner. tests/dark-token-cascade.test.ts guards the
|
|
35
|
+
* resolved cascade across this file's import order.
|
|
36
|
+
*/
|
|
37
37
|
|
|
38
38
|
@theme inline {
|
|
39
39
|
--color-background: var(--background);
|
package/llms.txt
CHANGED
|
@@ -57,7 +57,7 @@ Forms:
|
|
|
57
57
|
- Do not create or import a parallel `FormInput`/`FormTextarea` control family.
|
|
58
58
|
|
|
59
59
|
Rules:
|
|
60
|
-
- Dark-ready through globals only. `@nadicodeai/ui/globals.css` owns `:root` and
|
|
60
|
+
- Dark-ready through globals only. The generated design-system theme (imported by `@nadicodeai/ui/globals.css`) owns the `:root`/`.dark` shadcn role maps and the root-only `:root.dark` raw `--nc-*` remaps (state/selection/cross/chart); `globals.css` owns the Tailwind bridge and UI-local product aliases such as `--nc-app-surface`, `--nc-chat-tool-surface`, and `--nc-terminal-bg`. The `dark` class must sit on the root element (next-themes `attribute="class"`). Components must not add Tailwind `dark:` utilities or OS dark-mode branching.
|
|
61
61
|
- Token-only. Use NadicodeAI/shadcn semantic utilities such as `bg-background`, `text-foreground`, `border-border`, `text-destructive`, UI-local aliases like `bg-[var(--nc-app-surface)]`, and brand token arbitrary values like `text-[var(--nc-link-deep)]`.
|
|
62
62
|
- Do not use raw `#hex`, `rgb()`, `hsl()`, or raw palette utilities such as `text-blue-600`, `bg-zinc-950`, `text-white`, or `bg-black/50`.
|
|
63
63
|
- App routes should compose existing reusable sections/compositions from this package. Extract new shared UI only after a second concrete consumer, a plan-approved shared component, or a named validation slice proves the package boundary.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nadicodeai/ui",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -45,11 +45,13 @@
|
|
|
45
45
|
"build": "rm -rf dist && tsc -p tsconfig.build.json && node scripts/fix-dist-imports.mjs && rm -rf dist/styles && cp -R src/styles dist/styles",
|
|
46
46
|
"build:fast": "node scripts/dev-build.mjs",
|
|
47
47
|
"prepack": "npm run build",
|
|
48
|
+
"lint": "eslint --max-warnings=0",
|
|
49
|
+
"typecheck": "tsc --noEmit",
|
|
48
50
|
"test": "vitest run"
|
|
49
51
|
},
|
|
50
52
|
"dependencies": {
|
|
51
53
|
"@base-ui/react": "^1.6.0",
|
|
52
|
-
"@nadicodeai/design-system": "0.5.
|
|
54
|
+
"@nadicodeai/design-system": "0.5.2",
|
|
53
55
|
"@rive-app/react-webgl2": "^4.29.1",
|
|
54
56
|
"@streamdown/cjk": "^1.0.3",
|
|
55
57
|
"@streamdown/code": "^1.1.1",
|
|
@@ -90,10 +92,12 @@
|
|
|
90
92
|
"@tailwindcss/postcss": "^4.3.1",
|
|
91
93
|
"@types/react": "^19",
|
|
92
94
|
"@types/react-dom": "^19",
|
|
95
|
+
"eslint": "^9.39.4",
|
|
93
96
|
"react": "19.2.7",
|
|
94
97
|
"react-dom": "19.2.7",
|
|
95
98
|
"tailwindcss": "^4.3.1",
|
|
96
99
|
"typescript": "^5",
|
|
100
|
+
"typescript-eslint": "^8.46.0",
|
|
97
101
|
"vitest": "^4.1.6"
|
|
98
102
|
}
|
|
99
103
|
}
|