orbital-ds 0.10.0 → 0.10.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/AGENTS.md CHANGED
@@ -68,7 +68,9 @@ adivinar. Lee antes: `README.md`, `docs/CONTRACT.md`, `contract.json` y
68
68
  (`orbital-ds/lib/echarts-server`) con `tokens` = `orbital-ds/themes/<tema>.tokens.json` → `.light` o
69
69
  `.dark` (colores ya resueltos; mezcla ahí los de la marca si la app tiene). Para PNG (plantillas de
70
70
  documento), la app convierte el SVG (p. ej. resvg) con las fuentes del tema.
71
- - Registro común de tipos y componentes: `orbital-ds/lib/echarts-setup`. Otro tipo → `echarts.use([...])` en la app.
71
+ - Registro común de tipos y componentes: `orbital-ds/lib/echarts-setup`. Otro tipo → `echarts.use([...])` en la app. Si la app
72
+ usa `echarts` directamente (sin `<EChart>` ni `renderEChartToSvg`), llama antes a `dsEcharts()` (registra y lo devuelve):
73
+ así ningún empaquetador quita el registro. `pnpm check:bundle` lo comprueba empaquetando un consumidor.
72
74
  - **Recetas completas** (pantalla, informe SVG→PNG, función de servidor de TanStack Start, endpoint en un Worker, marca en los informes): `docs/GRAFICOS.md`.
73
75
 
74
76
  ## Idioma (i18n)
@@ -103,7 +105,8 @@ instala Motion y pasa el doctor. Sin preguntas: `--primary <color> --theme <tema
103
105
 
104
106
  ```bash
105
107
  pnpm check:ds # contrato, repetidos, sombras, fugas, valores fijos, personalidad, familias, contraste y demos
106
- pnpm verify # doctor + typecheck + build
108
+ pnpm verify # doctor + typecheck + build + check:bundle
109
+ pnpm check:bundle # empaqueta un consumidor de EChart (navegador y servidor) y comprueba que dibuja
107
110
  pnpm manifest # regenera components.manifest.json tras añadir componentes
108
111
  pnpm showcase # escaparate: todos los componentes × todos los temas × claro/oscuro × marca
109
112
  pnpm showcase:typecheck # tipos de las demos
@@ -1,8 +1,8 @@
1
- import { echarts } from "./echarts-setup";
1
+ import { dsEcharts } from "./echarts-setup";
2
2
  import { dsEchartsThemeFromTokens } from "./echarts-theme";
3
3
  function renderEChartToSvg(option, { width, height, tokens, theme, animation = false }) {
4
4
  const tema = theme ?? (tokens ? dsEchartsThemeFromTokens(tokens, { reducedMotion: !animation }) : void 0);
5
- const chart = echarts.init(null, tema, { renderer: "svg", ssr: true, width, height });
5
+ const chart = dsEcharts().init(null, tema, { renderer: "svg", ssr: true, width, height });
6
6
  try {
7
7
  chart.setOption({ animation, ...option });
8
8
  return chart.renderToSVGString();
@@ -1,4 +1,8 @@
1
1
  import * as echarts from 'echarts/core';
2
2
  export { echarts };
3
3
  export { EChartsCoreOption as DsEChartOption } from 'echarts/core';
4
- import '@base-ui/react/direction-provider';
4
+
5
+ /** Registra los tipos y componentes de orbital-ds (una sola vez) y devuelve `echarts`. */
6
+ declare function dsEcharts(): typeof echarts;
7
+
8
+ export { dsEcharts };
@@ -27,34 +27,42 @@ import {
27
27
  import * as echarts from "echarts/core";
28
28
  import { LabelLayout, UniversalTransition } from "echarts/features";
29
29
  import { CanvasRenderer, SVGRenderer } from "echarts/renderers";
30
- echarts.use([
31
- BarChart,
32
- FunnelChart,
33
- GaugeChart,
34
- HeatmapChart,
35
- LineChart,
36
- PieChart,
37
- RadarChart,
38
- SankeyChart,
39
- ScatterChart,
40
- AriaComponent,
41
- DatasetComponent,
42
- DataZoomComponent,
43
- GraphicComponent,
44
- GridComponent,
45
- LegendComponent,
46
- MarkAreaComponent,
47
- MarkLineComponent,
48
- MarkPointComponent,
49
- TitleComponent,
50
- TooltipComponent,
51
- TransformComponent,
52
- VisualMapComponent,
53
- LabelLayout,
54
- UniversalTransition,
55
- CanvasRenderer,
56
- SVGRenderer
57
- ]);
30
+ let registered = false;
31
+ function dsEcharts() {
32
+ if (registered) return echarts;
33
+ registered = true;
34
+ echarts.use([
35
+ BarChart,
36
+ FunnelChart,
37
+ GaugeChart,
38
+ HeatmapChart,
39
+ LineChart,
40
+ PieChart,
41
+ RadarChart,
42
+ SankeyChart,
43
+ ScatterChart,
44
+ AriaComponent,
45
+ DatasetComponent,
46
+ DataZoomComponent,
47
+ GraphicComponent,
48
+ GridComponent,
49
+ LegendComponent,
50
+ MarkAreaComponent,
51
+ MarkLineComponent,
52
+ MarkPointComponent,
53
+ TitleComponent,
54
+ TooltipComponent,
55
+ TransformComponent,
56
+ VisualMapComponent,
57
+ LabelLayout,
58
+ UniversalTransition,
59
+ CanvasRenderer,
60
+ SVGRenderer
61
+ ]);
62
+ return echarts;
63
+ }
64
+ dsEcharts();
58
65
  export {
66
+ dsEcharts,
59
67
  echarts
60
68
  };
package/dist/ui/echart.js CHANGED
@@ -3,7 +3,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import * as React from "react";
4
4
  import { DownloadIcon } from "lucide-react";
5
5
  import { useDsMessages } from "../hooks/use-ds-messages";
6
- import { echarts } from "../lib/echarts-setup";
6
+ import { dsEcharts } from "../lib/echarts-setup";
7
7
  import { dsEchartsTheme } from "../lib/echarts-theme";
8
8
  import { cn } from "../lib/utils";
9
9
  import { Button } from "./button";
@@ -27,7 +27,7 @@ const EChart = React.forwardRef(function EChart2({ option, height = 320, rendere
27
27
  }, []);
28
28
  React.useEffect(() => {
29
29
  if (!box.current || empty) return;
30
- const instance = echarts.init(box.current, dsEchartsTheme(box.current), { renderer });
30
+ const instance = dsEcharts().init(box.current, dsEchartsTheme(box.current), { renderer });
31
31
  chart.current = instance;
32
32
  instance.setOption(optionRef.current);
33
33
  for (const [name, handler] of Object.entries(onEvents ?? {})) instance.on(name, handler);
package/package.json CHANGED
@@ -1,171 +1,173 @@
1
- {
2
- "name": "orbital-ds",
3
- "version": "0.10.0",
4
- "description": "Sistema de diseño genérico: estructura común + temas con personalidad (qratia, zyro) + ~60 componentes sobre Base UI y Tailwind v4, con contrato verificable y legible por agentes.",
5
- "keywords": [
6
- "design-system",
7
- "design-tokens",
8
- "theme",
9
- "tailwindcss",
10
- "base-ui",
11
- "shadcn",
12
- "react"
13
- ],
14
- "license": "MIT",
15
- "type": "module",
16
- "sideEffects": [
17
- "*.css"
18
- ],
19
- "files": [
20
- "dist",
21
- "scripts/doctor.mjs",
22
- "contract.json",
23
- "components.manifest.json",
24
- "docs",
25
- "AGENTS.md",
26
- "README.md",
27
- "LICENSE",
28
- "scripts/init.mjs",
29
- "scripts/manifest.mjs",
30
- "scripts/brand-core.mjs",
31
- "scripts/setup.mjs",
32
- "scripts/i18n.mjs"
33
- ],
34
- "exports": {
35
- "./styles.css": "./dist/styles.css",
36
- "./themes/*.css": "./dist/themes/*.css",
37
- "./themes/*.md": "./dist/themes/*.md",
38
- "./themes/*.meta.json": "./dist/themes/*.meta.json",
39
- "./themes/*.tokens.json": "./dist/themes/*.tokens.json",
40
- "./ui/*": {
41
- "types": "./dist/ui/*.d.ts",
42
- "import": "./dist/ui/*.js"
43
- },
44
- "./lib/*": {
45
- "types": "./dist/lib/*.d.ts",
46
- "import": "./dist/lib/*.js"
47
- },
48
- "./hooks/*": {
49
- "types": "./dist/hooks/*.d.ts",
50
- "import": "./dist/hooks/*.js"
51
- },
52
- "./package.json": "./package.json",
53
- "./contract.json": "./contract.json",
54
- "./components.manifest.json": "./components.manifest.json"
55
- },
56
- "peerDependencies": {
57
- "@base-ui/react": ">=1.9",
58
- "@shadcn/react": ">=0.3",
59
- "class-variance-authority": ">=0.7",
60
- "clsx": ">=2",
61
- "cmdk": ">=1.1",
62
- "date-fns": ">=4",
63
- "embla-carousel-react": ">=8.6",
64
- "input-otp": ">=1.5",
65
- "lucide-react": ">=0.400",
66
- "motion": ">=12",
67
- "next-themes": ">=0.4",
68
- "react": ">=19",
69
- "react-day-picker": ">=10",
70
- "react-dom": ">=19",
71
- "react-resizable-panels": ">=4",
72
- "recharts": ">=3",
73
- "sonner": ">=2",
74
- "tailwind-merge": ">=3",
75
- "tailwindcss": ">=4.1",
76
- "tw-animate-css": ">=1.3",
77
- "echarts": ">=6",
78
- "@tanstack/react-table": ">=9"
79
- },
80
- "peerDependenciesMeta": {
81
- "next-themes": {
82
- "optional": true
83
- },
84
- "recharts": {
85
- "optional": true
86
- },
87
- "sonner": {
88
- "optional": true
89
- },
90
- "@shadcn/react": {
91
- "optional": true
92
- },
93
- "cmdk": {
94
- "optional": true
95
- },
96
- "date-fns": {
97
- "optional": true
98
- },
99
- "embla-carousel-react": {
100
- "optional": true
101
- },
102
- "input-otp": {
103
- "optional": true
104
- },
105
- "react-day-picker": {
106
- "optional": true
107
- },
108
- "react-resizable-panels": {
109
- "optional": true
110
- },
111
- "motion": {
112
- "optional": true
113
- },
114
- "echarts": {
115
- "optional": true
116
- },
117
- "@tanstack/react-table": {
118
- "optional": true
119
- }
120
- },
121
- "devDependencies": {
122
- "@base-ui/react": "^1.9.0",
123
- "@shadcn/react": "^0.3.1",
124
- "@tailwindcss/vite": "^4.3.3",
125
- "@tanstack/react-table": "^9.2.8",
126
- "@types/react": "^19.2.0",
127
- "@types/react-dom": "^19.2.0",
128
- "@vitejs/plugin-react": "^6.1.2",
129
- "class-variance-authority": "^0.7.1",
130
- "clsx": "^2.1.1",
131
- "cmdk": "^1.1.1",
132
- "date-fns": "^4.4.0",
133
- "echarts": "^6.1.0",
134
- "embla-carousel-react": "^8.6.0",
135
- "input-otp": "^1.5.0",
136
- "lucide-react": "^0.577.0",
137
- "motion": "^14.1.0",
138
- "next-themes": "^0.4.6",
139
- "react": "^19.2.0",
140
- "react-day-picker": "^10.0.2",
141
- "react-dom": "^19.2.0",
142
- "react-resizable-panels": "^4.14.4",
143
- "recharts": "3.8.0",
144
- "sonner": "^2.0.8",
145
- "tailwind-merge": "^3.0.2",
146
- "tailwindcss": "^4.1.18",
147
- "tsup": "^8.5.0",
148
- "tw-animate-css": "^1.3.6",
149
- "typescript": "^5.9.0",
150
- "vite": "^8.3.4"
151
- },
152
- "bin": {
153
- "orbital-ds-doctor": "./scripts/doctor.mjs",
154
- "orbital-ds-init": "./scripts/init.mjs",
155
- "orbital-ds-i18n": "./scripts/i18n.mjs"
156
- },
157
- "dependencies": {
158
- "@clack/prompts": "^1.8.1"
159
- },
160
- "scripts": {
161
- "build": "tsup && node scripts/build-css.mjs",
162
- "dev": "tsup --watch --onSuccess \"node scripts/copy-css.mjs\"",
163
- "typecheck": "tsc --noEmit",
164
- "verify": "pnpm check:ds && pnpm typecheck && pnpm showcase:typecheck && pnpm build",
165
- "manifest": "node scripts/manifest.mjs",
166
- "check:ds": "node scripts/doctor.mjs",
167
- "showcase": "vite --config showcase/vite.config.ts",
168
- "showcase:build": "vite build --config showcase/vite.config.ts",
169
- "showcase:typecheck": "tsc --noEmit -p showcase"
170
- }
171
- }
1
+ {
2
+ "name": "orbital-ds",
3
+ "version": "0.10.1",
4
+ "description": "Sistema de diseño genérico: estructura común + temas con personalidad (qratia, zyro) + ~60 componentes sobre Base UI y Tailwind v4, con contrato verificable y legible por agentes.",
5
+ "keywords": [
6
+ "design-system",
7
+ "design-tokens",
8
+ "theme",
9
+ "tailwindcss",
10
+ "base-ui",
11
+ "shadcn",
12
+ "react"
13
+ ],
14
+ "license": "MIT",
15
+ "type": "module",
16
+ "sideEffects": [
17
+ "*.css",
18
+ "./dist/lib/echarts-setup.js"
19
+ ],
20
+ "files": [
21
+ "dist",
22
+ "scripts/doctor.mjs",
23
+ "contract.json",
24
+ "components.manifest.json",
25
+ "docs",
26
+ "AGENTS.md",
27
+ "README.md",
28
+ "LICENSE",
29
+ "scripts/init.mjs",
30
+ "scripts/manifest.mjs",
31
+ "scripts/brand-core.mjs",
32
+ "scripts/setup.mjs",
33
+ "scripts/i18n.mjs"
34
+ ],
35
+ "exports": {
36
+ "./styles.css": "./dist/styles.css",
37
+ "./themes/*.css": "./dist/themes/*.css",
38
+ "./themes/*.md": "./dist/themes/*.md",
39
+ "./themes/*.meta.json": "./dist/themes/*.meta.json",
40
+ "./themes/*.tokens.json": "./dist/themes/*.tokens.json",
41
+ "./ui/*": {
42
+ "types": "./dist/ui/*.d.ts",
43
+ "import": "./dist/ui/*.js"
44
+ },
45
+ "./lib/*": {
46
+ "types": "./dist/lib/*.d.ts",
47
+ "import": "./dist/lib/*.js"
48
+ },
49
+ "./hooks/*": {
50
+ "types": "./dist/hooks/*.d.ts",
51
+ "import": "./dist/hooks/*.js"
52
+ },
53
+ "./package.json": "./package.json",
54
+ "./contract.json": "./contract.json",
55
+ "./components.manifest.json": "./components.manifest.json"
56
+ },
57
+ "scripts": {
58
+ "build": "tsup && node scripts/build-css.mjs",
59
+ "dev": "tsup --watch --onSuccess \"node scripts/copy-css.mjs\"",
60
+ "typecheck": "tsc --noEmit",
61
+ "verify": "pnpm check:ds && pnpm typecheck && pnpm showcase:typecheck && pnpm build && pnpm check:bundle",
62
+ "manifest": "node scripts/manifest.mjs",
63
+ "check:ds": "node scripts/doctor.mjs",
64
+ "check:bundle": "node scripts/check-bundle.mjs",
65
+ "showcase": "vite --config showcase/vite.config.ts",
66
+ "showcase:build": "vite build --config showcase/vite.config.ts",
67
+ "showcase:typecheck": "tsc --noEmit -p showcase"
68
+ },
69
+ "peerDependencies": {
70
+ "@base-ui/react": ">=1.9",
71
+ "@shadcn/react": ">=0.3",
72
+ "class-variance-authority": ">=0.7",
73
+ "clsx": ">=2",
74
+ "cmdk": ">=1.1",
75
+ "date-fns": ">=4",
76
+ "embla-carousel-react": ">=8.6",
77
+ "input-otp": ">=1.5",
78
+ "lucide-react": ">=0.400",
79
+ "motion": ">=12",
80
+ "next-themes": ">=0.4",
81
+ "react": ">=19",
82
+ "react-day-picker": ">=10",
83
+ "react-dom": ">=19",
84
+ "react-resizable-panels": ">=4",
85
+ "recharts": ">=3",
86
+ "sonner": ">=2",
87
+ "tailwind-merge": ">=3",
88
+ "tailwindcss": ">=4.1",
89
+ "tw-animate-css": ">=1.3",
90
+ "echarts": ">=6",
91
+ "@tanstack/react-table": ">=9"
92
+ },
93
+ "peerDependenciesMeta": {
94
+ "next-themes": {
95
+ "optional": true
96
+ },
97
+ "recharts": {
98
+ "optional": true
99
+ },
100
+ "sonner": {
101
+ "optional": true
102
+ },
103
+ "@shadcn/react": {
104
+ "optional": true
105
+ },
106
+ "cmdk": {
107
+ "optional": true
108
+ },
109
+ "date-fns": {
110
+ "optional": true
111
+ },
112
+ "embla-carousel-react": {
113
+ "optional": true
114
+ },
115
+ "input-otp": {
116
+ "optional": true
117
+ },
118
+ "react-day-picker": {
119
+ "optional": true
120
+ },
121
+ "react-resizable-panels": {
122
+ "optional": true
123
+ },
124
+ "motion": {
125
+ "optional": true
126
+ },
127
+ "echarts": {
128
+ "optional": true
129
+ },
130
+ "@tanstack/react-table": {
131
+ "optional": true
132
+ }
133
+ },
134
+ "devDependencies": {
135
+ "@base-ui/react": "^1.9.0",
136
+ "@shadcn/react": "^0.3.1",
137
+ "@tailwindcss/vite": "^4.3.3",
138
+ "@tanstack/react-table": "^9.2.8",
139
+ "@types/react": "^19.2.0",
140
+ "@types/react-dom": "^19.2.0",
141
+ "@vitejs/plugin-react": "^6.1.2",
142
+ "class-variance-authority": "^0.7.1",
143
+ "clsx": "^2.1.1",
144
+ "cmdk": "^1.1.1",
145
+ "date-fns": "^4.4.0",
146
+ "echarts": "^6.1.0",
147
+ "embla-carousel-react": "^8.6.0",
148
+ "input-otp": "^1.5.0",
149
+ "lucide-react": "^0.577.0",
150
+ "motion": "^14.1.0",
151
+ "next-themes": "^0.4.6",
152
+ "react": "^19.2.0",
153
+ "react-day-picker": "^10.0.2",
154
+ "react-dom": "^19.2.0",
155
+ "react-resizable-panels": "^4.14.4",
156
+ "recharts": "3.8.0",
157
+ "sonner": "^2.0.8",
158
+ "tailwind-merge": "^3.0.2",
159
+ "tailwindcss": "^4.1.18",
160
+ "tsup": "^8.5.0",
161
+ "tw-animate-css": "^1.3.6",
162
+ "typescript": "^5.9.0",
163
+ "vite": "^8.3.4"
164
+ },
165
+ "bin": {
166
+ "orbital-ds-doctor": "./scripts/doctor.mjs",
167
+ "orbital-ds-init": "./scripts/init.mjs",
168
+ "orbital-ds-i18n": "./scripts/i18n.mjs"
169
+ },
170
+ "dependencies": {
171
+ "@clack/prompts": "^1.8.1"
172
+ }
173
+ }
File without changes
package/scripts/i18n.mjs CHANGED
File without changes
package/scripts/init.mjs CHANGED
File without changes