orbital-ds 0.21.0 → 0.25.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.
- package/AGENTS.md +15 -4
- package/components.manifest.json +113 -1
- package/dist/hooks/use-ds-messages.d.ts +1 -0
- package/dist/lib/echarts-presets.d.ts +75 -1
- package/dist/lib/echarts-presets.js +138 -1
- package/dist/lib/echarts-setup.js +24 -0
- package/dist/lib/i18n.d.ts +1 -0
- package/dist/lib/i18n.js +3 -0
- package/dist/styles.css +7 -2
- package/dist/ui/chart-card.d.ts +28 -0
- package/dist/ui/chart-card.js +79 -0
- package/dist/ui/content-card.d.ts +31 -0
- package/dist/ui/content-card.js +89 -0
- package/dist/ui/data-table.d.ts +5 -2
- package/dist/ui/data-table.js +11 -4
- package/dist/ui/detail-panel.d.ts +16 -0
- package/dist/ui/detail-panel.js +52 -0
- package/dist/ui/entity-list.d.ts +25 -0
- package/dist/ui/entity-list.js +67 -0
- package/dist/ui/form-layout.js +4 -4
- package/dist/ui/loading-state.d.ts +10 -0
- package/dist/ui/loading-state.js +48 -0
- package/dist/ui/mosaic.d.ts +13 -0
- package/dist/ui/mosaic.js +52 -0
- package/dist/ui/page-shell.d.ts +8 -0
- package/dist/ui/page-shell.js +29 -0
- package/dist/ui/stat-group.js +3 -3
- package/dist/ui/step-flow.js +8 -8
- package/docs/CONTRACT.md +9 -2
- package/package.json +3 -2
- package/scripts/doctor.mjs +27 -0
package/AGENTS.md
CHANGED
|
@@ -22,7 +22,10 @@ adivinar. Lee antes: `README.md`, `docs/CONTRACT.md`, `contract.json` y
|
|
|
22
22
|
foco incluido).
|
|
23
23
|
6. **Un tema cumple el contrato completo** (`contract.json`) y define en `:root` todo
|
|
24
24
|
`--ds-*` que defina el tema base.
|
|
25
|
-
7. **
|
|
25
|
+
7. **Unidades: rem, no px.** Tamaños, alturas y container queries (`@[32rem]`) van en `rem` para respetar el
|
|
26
|
+
tamaño de letra de la persona (WCAG 1.4.4); `em` solo si algo debe escalar con el texto de su propio
|
|
27
|
+
componente; `px` solo en filetes y bordes finos, a través de tokens. El doctor rechaza `@[Npx]`.
|
|
28
|
+
8. **La marca de una app vive en SU `brand.css`**, no en el tema del paquete. Para
|
|
26
29
|
personalizar una app (color, radio, fuentes) edita ese fichero; nunca `node_modules` ni
|
|
27
30
|
los temas. `pnpm exec orbital-ds-init` lo crea sin sobrescribir.
|
|
28
31
|
|
|
@@ -70,12 +73,16 @@ adivinar. Lee antes: `README.md`, `docs/CONTRACT.md`, `contract.json` y
|
|
|
70
73
|
desde las variables del tema activo y de la marca (paleta `--chart-1…5` + estados, textos, ejes, tooltip,
|
|
71
74
|
fuentes, ritmo) y se repinta al cambiar de tema o de piel. SVG por defecto; `exportable` descarga SVG/PNG.
|
|
72
75
|
Nunca pongas colores en el `option`: los da el tema (si una serie necesita un tono, usa la paleta del tema).
|
|
76
|
+
- **Tarjeta**: `<ChartCard preset="standard|glance|focus|dense" option={…} loading error empty />` (`orbital-ds/ui/chart-card`) pone título, estados, descarga y motor de pintado; el `option` sigue sin colores.
|
|
73
77
|
- **Opciones listas**: `orbital-ds/lib/echarts-presets` (línea/área, barras, combo, mapa de calor, sankey,
|
|
74
|
-
gauge, donut, líneas y áreas de referencia). Sirven igual en pantalla y en informes.
|
|
78
|
+
gauge, donut, dispersión, radar, embudo, treemap, sunburst, velas, boxplot, líneas y áreas de referencia). Sirven igual en pantalla y en informes.
|
|
75
79
|
- **Informes automáticos (servidor / Workers, sin DOM)**: `renderEChartToSvg(option, { width, height, tokens })`
|
|
76
80
|
(`orbital-ds/lib/echarts-server`) con `tokens` = `orbital-ds/themes/<tema>.tokens.json` → `.light` o
|
|
77
81
|
`.dark` (colores ya resueltos; mezcla ahí los de la marca si la app tiene). Para PNG (plantillas de
|
|
78
82
|
documento), la app convierte el SVG (p. ej. resvg) con las fuentes del tema.
|
|
83
|
+
- **Validación**: `pnpm check:charts` (dentro de `verify`) ejecuta cada constructor de `echarts-presets`, comprueba
|
|
84
|
+
que su `option` no lleva colores y que se dibuja como SVG en el servidor. Un constructor nuevo necesita su caso en
|
|
85
|
+
`scripts/check-charts.mjs`, o la comprobación falla.
|
|
79
86
|
- Registro común de tipos y componentes: `orbital-ds/lib/echarts-setup`. Otro tipo → `echarts.use([...])` en la app. Si la app
|
|
80
87
|
usa `echarts` directamente (sin `<EChart>` ni `renderEChartToSvg`), llama antes a `dsEcharts()` (registra y lo devuelve):
|
|
81
88
|
así ningún empaquetador quita el registro. `pnpm check:bundle` lo comprueba empaquetando un consumidor.
|
|
@@ -154,10 +161,12 @@ en cualquier proyecto. Vocabulario común en `src/lib/presets.ts` (`DsDensity`,
|
|
|
154
161
|
4. **El diseño sigue el ancho del contenedor** (container query), no el dispositivo ni la presentación.
|
|
155
162
|
5. **Aviso en desarrollo** (`dsWarn`, mensaje en inglés) si la combinación no cuadra.
|
|
156
163
|
6. **Ganchos del DOM**: `data-slot` y `data-preset` (más `data-presentation`/`data-density` si aplica).
|
|
157
|
-
7. **Un `@note`** que diga cuándo usar cada preset. Catálogo hoy: `StepFlow` (quick · activation · long), `FormLayout`
|
|
158
|
-
(inline · sectioned · settings), `EmptyState` (first-use · no-results · error · forbidden), `StatGroup` (overview ·
|
|
164
|
+
7. **Un `@note`** que diga cuándo usar cada preset. Catálogo hoy: `ChartCard` (glance · standard · focus · dense), `ContentCard` (basic · feature · media · horizontal, con `emphasis` elevated · outlined · filled · ghost), `Mosaic` (even · bento · trio), `PageShell` (content · detail · canvas), `DataTable` (browse · manage · compact), `LoadingState` (list · card · table · detail), `DetailPanel` (side · bottom · full), `EntityList` (list · grid · compact), `StepFlow` (quick · activation · long), `FormLayout`
|
|
165
|
+
(inline · sectioned · settings), `NoticeReview` (read · acknowledge · resolve · respond), `EmptyState` (first-use · no-results · error · forbidden), `StatGroup` (overview ·
|
|
159
166
|
compact · comparison) y `ConfirmAction` (simple · typed).
|
|
160
167
|
|
|
168
|
+
**Densidad global.** `--ds-density` (1 por defecto; 0.8 más denso, 1.2 más aireado) escala el relleno de celdas y la separación de secciones y listas; la app lo ajusta en `brand.css`.
|
|
169
|
+
|
|
161
170
|
## Avisos y comunicaciones in-app (qué canal usar)
|
|
162
171
|
|
|
163
172
|
Se elige el canal por **urgencia** y **persistencia**; cada app no lo decide a mano:
|
|
@@ -179,6 +188,7 @@ Mismo vocabulario en todos: tono `info | success | warning | danger` y estado `n
|
|
|
179
188
|
```bash
|
|
180
189
|
pnpm check:ds # contrato, repetidos, sombras, fugas, valores fijos, personalidad, familias, contraste y demos
|
|
181
190
|
pnpm verify # doctor + typecheck + build + check:bundle
|
|
191
|
+
pnpm check:charts # cada constructor de gráfico: sin colores y dibuja SVG en servidor
|
|
182
192
|
pnpm check:bundle # empaqueta un consumidor de EChart (navegador y servidor) y comprueba que dibuja
|
|
183
193
|
pnpm manifest # regenera components.manifest.json tras añadir componentes
|
|
184
194
|
pnpm showcase # escaparate: todos los componentes × todos los temas × claro/oscuro × marca
|
|
@@ -258,5 +268,6 @@ Para que una app (o un agente que la edite) use orbital-ds sin romper nada:
|
|
|
258
268
|
- **Mínimo exigible: AA.** Texto 4,5:1; texto grande y controles 3:1. `pnpm check:ds` falla si un par principal de texto sobre su superficie (texto/fondo, tarjeta, popover, primario, secundario, lateral, destructivo) o un texto de estado (info, danger, warning, success, neutral) baja de 4,5:1.
|
|
259
269
|
- **Objetivo: AAA en el texto del cuerpo** (7:1 para texto/fondo y texto/tarjeta). Se mide con `pnpm check:ds -- --aaa` y avisa, no falla: WCAG no aconseja exigir AAA a todo el sitio. Hoy todos los temas lo cumplen.
|
|
260
270
|
- **Excepciones declaradas, nunca silenciosas.** Si un tema no puede cumplir un par (el azul de marca de Twitter con texto blanco da 3:1), lo declara en su ficha, en `a11y.exceptions`, con su porqué; el doctor lo muestra como aviso. Vale también para el texto de estado sobre su fondo suave (`"warning/warning-soft"`), p. ej. cuando el par viene del sistema corporativo que el tema reproduce (fractalia).
|
|
271
|
+
- **Tamaños mínimos** (WCAG 2.5.8 y legibilidad): objetivo táctil ≥ 1,5rem (24 px; los `--ds-control-h-*` van de 1,5 a 2,5rem), texto ≥ 0,75rem (`text-xs`) y cuerpo en 0,875–1rem. El doctor falla si un `--ds-control-h-*` baja de 1,5rem o hay `text-[…rem]` menor de 0,75rem.
|
|
261
272
|
- **Foco siempre visible** (anillo de 3:1 como mínimo) y sin que otro elemento lo tape.
|
|
262
273
|
- **Una marca nueva debe volver a pasar el doctor.** Cambiar `--primary` obliga a revisar `--primary-foreground`, `--link` y `--ring`.
|
package/components.manifest.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"package": "orbital-ds",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.25.0",
|
|
4
4
|
"engine": "@base-ui/react",
|
|
5
5
|
"docs": [
|
|
6
6
|
"README.md",
|
|
@@ -365,6 +365,21 @@
|
|
|
365
365
|
"embla-carousel-react"
|
|
366
366
|
]
|
|
367
367
|
},
|
|
368
|
+
"chart-card": {
|
|
369
|
+
"import": "orbital-ds/ui/chart-card",
|
|
370
|
+
"exports": [
|
|
371
|
+
"ChartCard",
|
|
372
|
+
"type ChartCardPreset"
|
|
373
|
+
],
|
|
374
|
+
"slots": [
|
|
375
|
+
"chart-card"
|
|
376
|
+
],
|
|
377
|
+
"optionalPeers": [],
|
|
378
|
+
"notes": [
|
|
379
|
+
"Gráfico en una tarjeta con cargando/error/vacío resueltos: `glance` para un vistazo, `standard` en un panel, `focus` para el gráfico principal (descargable), `dense` para muchos puntos (canvas). El option sale de orbital-ds/lib/echarts-presets y nunca lleva colores.",
|
|
380
|
+
"Varios gráficos juntos: dentro de Mosaic (bento: el principal primero y en `focus`). Para informes en servidor usa renderEChartToSvg con el mismo option."
|
|
381
|
+
]
|
|
382
|
+
},
|
|
368
383
|
"chart": {
|
|
369
384
|
"import": "orbital-ds/ui/chart",
|
|
370
385
|
"exports": [
|
|
@@ -536,6 +551,24 @@
|
|
|
536
551
|
"El título nombra la acción y el objeto; el botón repite el verbo, no «Aceptar»."
|
|
537
552
|
]
|
|
538
553
|
},
|
|
554
|
+
"content-card": {
|
|
555
|
+
"import": "orbital-ds/ui/content-card",
|
|
556
|
+
"exports": [
|
|
557
|
+
"ContentCard",
|
|
558
|
+
"type ContentCardEmphasis",
|
|
559
|
+
"type ContentCardPreset"
|
|
560
|
+
],
|
|
561
|
+
"slots": [
|
|
562
|
+
"content-card",
|
|
563
|
+
"content-card-media"
|
|
564
|
+
],
|
|
565
|
+
"optionalPeers": [],
|
|
566
|
+
"notes": [
|
|
567
|
+
"Tarjeta de contenido para rejillas: `basic` (texto), `feature` (icono + capacidad), `media` (portada arriba), `horizontal` (portada al lado). El énfasis (`elevated`, `outlined`, `filled`, `ghost`) cambia la prominencia, no la estructura.",
|
|
568
|
+
"Interactiva con `href` (navega) o `onSelect` (acción): toda la tarjeta es el objetivo y el título el enlace; no metas botones dentro de un enlace ni tarjetas dentro de tarjetas. Para filas de entidades usa Item variant=\"card\"; para cifras, Stat.",
|
|
569
|
+
"Para disponer varias, Mosaic (even · bento · trio)."
|
|
570
|
+
]
|
|
571
|
+
},
|
|
539
572
|
"context-menu": {
|
|
540
573
|
"import": "orbital-ds/ui/context-menu",
|
|
541
574
|
"exports": [
|
|
@@ -633,6 +666,7 @@
|
|
|
633
666
|
"@tanstack/react-table"
|
|
634
667
|
],
|
|
635
668
|
"notes": [
|
|
669
|
+
"Presets: `browse` consulta, `manage` añade selección para actuar, `compact` es denso y sin menú de columnas; cualquier prop explícita los sobrescribe.",
|
|
636
670
|
"Para muchas filas, comparar y ordenar; para 3–5 elementos usa Item variant=\"card\". Estado en la URL con dataTableStateToSearch.",
|
|
637
671
|
"Cifras con DataTableNumber (alineadas, tabular-nums); acciones por fila en un menú; sin resultados con Empty y «Limpiar filtros»."
|
|
638
672
|
]
|
|
@@ -659,6 +693,22 @@
|
|
|
659
693
|
"react-day-picker"
|
|
660
694
|
]
|
|
661
695
|
},
|
|
696
|
+
"detail-panel": {
|
|
697
|
+
"import": "orbital-ds/ui/detail-panel",
|
|
698
|
+
"exports": [
|
|
699
|
+
"DetailPanel",
|
|
700
|
+
"type DetailPanelPreset"
|
|
701
|
+
],
|
|
702
|
+
"slots": [
|
|
703
|
+
"detail-panel",
|
|
704
|
+
"detail-panel-body",
|
|
705
|
+
"detail-panel-footer"
|
|
706
|
+
],
|
|
707
|
+
"optionalPeers": [],
|
|
708
|
+
"notes": [
|
|
709
|
+
"Ficha de una entidad junto a su lista (`onSelect`/`onRowClick` abre el panel): `side` en escritorio, `bottom` en móvil, `full` para contenido largo. Para decidir algo bloqueante usa ConfirmAction, no esto."
|
|
710
|
+
]
|
|
711
|
+
},
|
|
662
712
|
"dialog": {
|
|
663
713
|
"import": "orbital-ds/ui/dialog",
|
|
664
714
|
"exports": [
|
|
@@ -857,6 +907,22 @@
|
|
|
857
907
|
"Estado vacío: qué es esto, por qué está vacío y la acción para empezar; sin resultados: los filtros aplicados y «Limpiar filtros»."
|
|
858
908
|
]
|
|
859
909
|
},
|
|
910
|
+
"entity-list": {
|
|
911
|
+
"import": "orbital-ds/ui/entity-list",
|
|
912
|
+
"exports": [
|
|
913
|
+
"EntityList",
|
|
914
|
+
"type EntityListPreset"
|
|
915
|
+
],
|
|
916
|
+
"slots": [
|
|
917
|
+
"entity-list",
|
|
918
|
+
"entity-list-bulk"
|
|
919
|
+
],
|
|
920
|
+
"optionalPeers": [],
|
|
921
|
+
"notes": [
|
|
922
|
+
"Lista de entidades con cargando/error/vacío resueltos: pasa `items`, `renderItem` (un `Item variant=\"card\"`) y, si hay filtros, `toolbar` y `filtered`. `list` por defecto, `grid` para tarjetas, `compact` para muchas filas.",
|
|
923
|
+
"No compone Card + Item a mano: la fila es siempre un Item."
|
|
924
|
+
]
|
|
925
|
+
},
|
|
860
926
|
"eyebrow": {
|
|
861
927
|
"import": "orbital-ds/ui/eyebrow",
|
|
862
928
|
"exports": [
|
|
@@ -1152,6 +1218,20 @@
|
|
|
1152
1218
|
],
|
|
1153
1219
|
"optionalPeers": []
|
|
1154
1220
|
},
|
|
1221
|
+
"loading-state": {
|
|
1222
|
+
"import": "orbital-ds/ui/loading-state",
|
|
1223
|
+
"exports": [
|
|
1224
|
+
"LoadingState",
|
|
1225
|
+
"type LoadingStatePreset"
|
|
1226
|
+
],
|
|
1227
|
+
"slots": [
|
|
1228
|
+
"loading-state"
|
|
1229
|
+
],
|
|
1230
|
+
"optionalPeers": [],
|
|
1231
|
+
"notes": [
|
|
1232
|
+
"Mientras carga, pinta la forma de lo que vendrá: `list` para filas, `card` para una tarjeta, `table` para una tabla, `detail` para una ficha."
|
|
1233
|
+
]
|
|
1234
|
+
},
|
|
1155
1235
|
"marker": {
|
|
1156
1236
|
"import": "orbital-ds/ui/marker",
|
|
1157
1237
|
"exports": [
|
|
@@ -1270,6 +1350,24 @@
|
|
|
1270
1350
|
],
|
|
1271
1351
|
"optionalPeers": []
|
|
1272
1352
|
},
|
|
1353
|
+
"mosaic": {
|
|
1354
|
+
"import": "orbital-ds/ui/mosaic",
|
|
1355
|
+
"exports": [
|
|
1356
|
+
"Mosaic",
|
|
1357
|
+
"MosaicItem",
|
|
1358
|
+
"type MosaicPreset"
|
|
1359
|
+
],
|
|
1360
|
+
"slots": [
|
|
1361
|
+
"mosaic",
|
|
1362
|
+
"mosaic-item",
|
|
1363
|
+
"mosaic-root"
|
|
1364
|
+
],
|
|
1365
|
+
"optionalPeers": [],
|
|
1366
|
+
"notes": [
|
|
1367
|
+
"Rejilla de tarjetas con jerarquía: `bento` para destacar lo primero, `trio` para tres iguales, `even` sin jerarquía. Si todo pesa lo mismo, usa `even` (o EntityList grid), no bento. Para spans manuales envuelve en MosaicItem.",
|
|
1368
|
+
"El destacado va el primero del DOM (orden de lectura); no reordenes con CSS."
|
|
1369
|
+
]
|
|
1370
|
+
},
|
|
1273
1371
|
"motion-provider": {
|
|
1274
1372
|
"import": "orbital-ds/ui/motion-provider",
|
|
1275
1373
|
"exports": [
|
|
@@ -1417,6 +1515,20 @@
|
|
|
1417
1515
|
"Cabecera de vista: PageHeaderTitle + PageHeaderDescription y la acción principal en PageHeaderActions; centrada en --ds-page-max-w."
|
|
1418
1516
|
]
|
|
1419
1517
|
},
|
|
1518
|
+
"page-shell": {
|
|
1519
|
+
"import": "orbital-ds/ui/page-shell",
|
|
1520
|
+
"exports": [
|
|
1521
|
+
"PageShell",
|
|
1522
|
+
"type PageShellPreset"
|
|
1523
|
+
],
|
|
1524
|
+
"slots": [
|
|
1525
|
+
"page-shell"
|
|
1526
|
+
],
|
|
1527
|
+
"optionalPeers": [],
|
|
1528
|
+
"notes": [
|
|
1529
|
+
"Envuelve cada vista: `content` para listas y paneles, `detail` para una entidad, `canvas` solo para lienzos (mapa, kanban, editor). La cabecera va dentro con PageHeader."
|
|
1530
|
+
]
|
|
1531
|
+
},
|
|
1420
1532
|
"pagination": {
|
|
1421
1533
|
"import": "orbital-ds/ui/pagination",
|
|
1422
1534
|
"exports": [
|
|
@@ -149,5 +149,79 @@ interface PieOptionInput extends CommonOptions {
|
|
|
149
149
|
showLabels?: boolean;
|
|
150
150
|
}
|
|
151
151
|
declare function pieOption(input: PieOptionInput): EChartsCoreOption;
|
|
152
|
+
interface ScatterOptionInput extends CommonOptions {
|
|
153
|
+
/** Cada serie es un grupo de puntos `[x, y]` (o `[x, y, tamaño]` con `sizeAxis`). */
|
|
154
|
+
series: Array<{
|
|
155
|
+
name: string;
|
|
156
|
+
data: Array<[number, number] | [number, number, number]>;
|
|
157
|
+
}>;
|
|
158
|
+
xName?: string;
|
|
159
|
+
yName?: string;
|
|
160
|
+
/** La tercera coordenada de cada punto da su tamaño (burbujas). */
|
|
161
|
+
sizeAxis?: boolean;
|
|
162
|
+
/** Formateador del eje X (el del valor se usa para Y). */
|
|
163
|
+
xFormatter?: DsValueFormatter;
|
|
164
|
+
zoom?: boolean;
|
|
165
|
+
}
|
|
166
|
+
declare function scatterOption(input: ScatterOptionInput): EChartsCoreOption;
|
|
167
|
+
interface RadarOptionInput extends CommonOptions {
|
|
168
|
+
/** Dimensiones y su máximo (la escala de cada eje). */
|
|
169
|
+
indicators: Array<{
|
|
170
|
+
name: string;
|
|
171
|
+
max: number;
|
|
172
|
+
}>;
|
|
173
|
+
series: Array<{
|
|
174
|
+
name: string;
|
|
175
|
+
data: number[];
|
|
176
|
+
}>;
|
|
177
|
+
/** Rellena el área de cada serie. */
|
|
178
|
+
area?: boolean;
|
|
179
|
+
}
|
|
180
|
+
declare function radarOption(input: RadarOptionInput): EChartsCoreOption;
|
|
181
|
+
interface FunnelOptionInput extends CommonOptions {
|
|
182
|
+
/** Etapas de mayor a menor; el nombre sale en la etiqueta. */
|
|
183
|
+
data: Array<{
|
|
184
|
+
name: string;
|
|
185
|
+
value: number;
|
|
186
|
+
}>;
|
|
187
|
+
/** Muestra el valor en cada etapa. */
|
|
188
|
+
showValues?: boolean;
|
|
189
|
+
}
|
|
190
|
+
declare function funnelOption(input: FunnelOptionInput): EChartsCoreOption;
|
|
191
|
+
interface HierarchyNode {
|
|
192
|
+
name: string;
|
|
193
|
+
value?: number;
|
|
194
|
+
children?: HierarchyNode[];
|
|
195
|
+
}
|
|
196
|
+
interface TreemapOptionInput extends CommonOptions {
|
|
197
|
+
data: HierarchyNode[];
|
|
198
|
+
/** Muestra la ruta de migas para bajar y subir de nivel. */
|
|
199
|
+
breadcrumb?: boolean;
|
|
200
|
+
}
|
|
201
|
+
/** Peso relativo de partes de un todo con varios niveles (presupuesto, espacio en disco). */
|
|
202
|
+
declare function treemapOption(input: TreemapOptionInput): EChartsCoreOption;
|
|
203
|
+
interface SunburstOptionInput extends CommonOptions {
|
|
204
|
+
data: HierarchyNode[];
|
|
205
|
+
}
|
|
206
|
+
/** Composición en anillos concéntricos (cada anillo, un nivel de la jerarquía). */
|
|
207
|
+
declare function sunburstOption(input: SunburstOptionInput): EChartsCoreOption;
|
|
208
|
+
interface CandlestickOptionInput extends CommonOptions {
|
|
209
|
+
categories: Array<string | number>;
|
|
210
|
+
/** Por categoría: `[apertura, cierre, mínimo, máximo]`. */
|
|
211
|
+
data: Array<[number, number, number, number]>;
|
|
212
|
+
name?: string;
|
|
213
|
+
zoom?: boolean;
|
|
214
|
+
}
|
|
215
|
+
/** Precios o medidas con apertura, cierre, mínimo y máximo por periodo. */
|
|
216
|
+
declare function candlestickOption(input: CandlestickOptionInput): EChartsCoreOption;
|
|
217
|
+
interface BoxplotOptionInput extends CommonOptions {
|
|
218
|
+
categories: Array<string | number>;
|
|
219
|
+
/** Por categoría, ya calculado: `[mínimo, Q1, mediana, Q3, máximo]`. */
|
|
220
|
+
data: Array<[number, number, number, number, number]>;
|
|
221
|
+
name?: string;
|
|
222
|
+
horizontal?: boolean;
|
|
223
|
+
}
|
|
224
|
+
/** Distribución de una medida por grupo (mediana, cuartiles y extremos). */
|
|
225
|
+
declare function boxplotOption(input: BoxplotOptionInput): EChartsCoreOption;
|
|
152
226
|
|
|
153
|
-
export { type BarOptionInput, type ComboOptionInput, type DsChartValue, type DsReference, type DsSeries, type DsValueFormatter, type GaugeOptionInput, type HeatmapOptionInput, type LineOptionInput, type PieOptionInput, type SankeyLink, type SankeyOptionInput, barOption, comboOption, escapeHtml, gaugeOption, heatmapOption, lineOption, pieOption, referenceArea, referenceLine, sankeyOption };
|
|
227
|
+
export { type BarOptionInput, type BoxplotOptionInput, type CandlestickOptionInput, type ComboOptionInput, type DsChartValue, type DsReference, type DsSeries, type DsValueFormatter, type FunnelOptionInput, type GaugeOptionInput, type HeatmapOptionInput, type HierarchyNode, type LineOptionInput, type PieOptionInput, type RadarOptionInput, type SankeyLink, type SankeyOptionInput, type ScatterOptionInput, type SunburstOptionInput, type TreemapOptionInput, barOption, boxplotOption, candlestickOption, comboOption, escapeHtml, funnelOption, gaugeOption, heatmapOption, lineOption, pieOption, radarOption, referenceArea, referenceLine, sankeyOption, scatterOption, sunburstOption, treemapOption };
|
|
@@ -297,15 +297,152 @@ function pieOption(input) {
|
|
|
297
297
|
input.extend
|
|
298
298
|
);
|
|
299
299
|
}
|
|
300
|
+
function scatterOption(input) {
|
|
301
|
+
return finish(
|
|
302
|
+
{
|
|
303
|
+
tooltip: tooltip("item", input.valueFormatter),
|
|
304
|
+
legend: legend(input.legend, input.series.length),
|
|
305
|
+
xAxis: valueAxis(input.xFormatter, { ...input.xName ? { name: input.xName } : {}, scale: true }),
|
|
306
|
+
yAxis: valueAxis(input.valueFormatter, { ...input.yName ? { name: input.yName } : {}, scale: true }),
|
|
307
|
+
...input.zoom ? { dataZoom: [{ type: "inside" }, { type: "inside", orient: "vertical" }] } : {},
|
|
308
|
+
series: input.series.map((s) => ({
|
|
309
|
+
type: "scatter",
|
|
310
|
+
name: s.name,
|
|
311
|
+
data: s.data,
|
|
312
|
+
...input.sizeAxis ? { symbolSize: (v) => Math.max(6, Math.sqrt(v[2] ?? 0) * 2) } : {},
|
|
313
|
+
emphasis: { focus: "series" }
|
|
314
|
+
}))
|
|
315
|
+
},
|
|
316
|
+
input.extend
|
|
317
|
+
);
|
|
318
|
+
}
|
|
319
|
+
function radarOption(input) {
|
|
320
|
+
return finish(
|
|
321
|
+
{
|
|
322
|
+
tooltip: tooltip("item", input.valueFormatter),
|
|
323
|
+
legend: legend(input.legend, input.series.length),
|
|
324
|
+
radar: { indicator: input.indicators, radius: "68%", center: ["50%", "55%"] },
|
|
325
|
+
series: [
|
|
326
|
+
{
|
|
327
|
+
type: "radar",
|
|
328
|
+
data: input.series.map((s) => ({ name: s.name, value: s.data })),
|
|
329
|
+
...input.area ? { areaStyle: { opacity: 0.15 } } : {},
|
|
330
|
+
emphasis: { focus: "series" }
|
|
331
|
+
}
|
|
332
|
+
]
|
|
333
|
+
},
|
|
334
|
+
input.extend
|
|
335
|
+
);
|
|
336
|
+
}
|
|
337
|
+
function funnelOption(input) {
|
|
338
|
+
const fmt = input.valueFormatter;
|
|
339
|
+
return finish(
|
|
340
|
+
{
|
|
341
|
+
tooltip: tooltip("item", fmt),
|
|
342
|
+
legend: legend(input.legend ?? false, input.data.length),
|
|
343
|
+
series: [
|
|
344
|
+
{
|
|
345
|
+
type: "funnel",
|
|
346
|
+
top: 16,
|
|
347
|
+
bottom: 16,
|
|
348
|
+
left: "8%",
|
|
349
|
+
width: "84%",
|
|
350
|
+
sort: "descending",
|
|
351
|
+
gap: 2,
|
|
352
|
+
label: {
|
|
353
|
+
show: true,
|
|
354
|
+
position: "inside",
|
|
355
|
+
...input.showValues && fmt ? { formatter: (p) => `${p.name} \xB7 ${fmt(p.value)}` } : {}
|
|
356
|
+
},
|
|
357
|
+
emphasis: { label: { fontSize: void 0 } },
|
|
358
|
+
data: input.data
|
|
359
|
+
}
|
|
360
|
+
]
|
|
361
|
+
},
|
|
362
|
+
input.extend
|
|
363
|
+
);
|
|
364
|
+
}
|
|
365
|
+
function treemapOption(input) {
|
|
366
|
+
return finish(
|
|
367
|
+
{
|
|
368
|
+
tooltip: tooltip("item", input.valueFormatter),
|
|
369
|
+
series: [
|
|
370
|
+
{
|
|
371
|
+
type: "treemap",
|
|
372
|
+
data: input.data,
|
|
373
|
+
roam: false,
|
|
374
|
+
nodeClick: "zoomToNode",
|
|
375
|
+
breadcrumb: { show: input.breadcrumb ?? true, bottom: 0 },
|
|
376
|
+
label: { show: true },
|
|
377
|
+
upperLabel: { show: false },
|
|
378
|
+
itemStyle: { gapWidth: 2 }
|
|
379
|
+
}
|
|
380
|
+
]
|
|
381
|
+
},
|
|
382
|
+
input.extend
|
|
383
|
+
);
|
|
384
|
+
}
|
|
385
|
+
function sunburstOption(input) {
|
|
386
|
+
return finish(
|
|
387
|
+
{
|
|
388
|
+
tooltip: tooltip("item", input.valueFormatter),
|
|
389
|
+
series: [
|
|
390
|
+
{
|
|
391
|
+
type: "sunburst",
|
|
392
|
+
data: input.data,
|
|
393
|
+
radius: ["12%", "90%"],
|
|
394
|
+
sort: void 0,
|
|
395
|
+
emphasis: { focus: "ancestor" },
|
|
396
|
+
label: { rotate: "radial" }
|
|
397
|
+
}
|
|
398
|
+
]
|
|
399
|
+
},
|
|
400
|
+
input.extend
|
|
401
|
+
);
|
|
402
|
+
}
|
|
403
|
+
function candlestickOption(input) {
|
|
404
|
+
return finish(
|
|
405
|
+
{
|
|
406
|
+
tooltip: tooltip("axis", input.valueFormatter, { axisPointer: { type: "cross" } }),
|
|
407
|
+
legend: legend(false, 1),
|
|
408
|
+
xAxis: { type: "category", data: input.categories },
|
|
409
|
+
yAxis: valueAxis(input.valueFormatter, { scale: true }),
|
|
410
|
+
...input.zoom ? { dataZoom: [{ type: "inside" }] } : {},
|
|
411
|
+
series: [{ type: "candlestick", name: input.name, data: input.data }]
|
|
412
|
+
},
|
|
413
|
+
input.extend
|
|
414
|
+
);
|
|
415
|
+
}
|
|
416
|
+
function boxplotOption(input) {
|
|
417
|
+
const category = { type: "category", data: input.categories };
|
|
418
|
+
const value = valueAxis(input.valueFormatter, { scale: true });
|
|
419
|
+
return finish(
|
|
420
|
+
{
|
|
421
|
+
tooltip: tooltip("item", input.valueFormatter),
|
|
422
|
+
legend: legend(false, 1),
|
|
423
|
+
xAxis: input.horizontal ? value : category,
|
|
424
|
+
yAxis: input.horizontal ? category : value,
|
|
425
|
+
series: [{ type: "boxplot", name: input.name, data: input.data }]
|
|
426
|
+
},
|
|
427
|
+
input.extend
|
|
428
|
+
);
|
|
429
|
+
}
|
|
300
430
|
export {
|
|
301
431
|
barOption,
|
|
432
|
+
boxplotOption,
|
|
433
|
+
candlestickOption,
|
|
302
434
|
comboOption,
|
|
303
435
|
escapeHtml,
|
|
436
|
+
funnelOption,
|
|
304
437
|
gaugeOption,
|
|
305
438
|
heatmapOption,
|
|
306
439
|
lineOption,
|
|
307
440
|
pieOption,
|
|
441
|
+
radarOption,
|
|
308
442
|
referenceArea,
|
|
309
443
|
referenceLine,
|
|
310
|
-
sankeyOption
|
|
444
|
+
sankeyOption,
|
|
445
|
+
scatterOption,
|
|
446
|
+
sunburstOption,
|
|
447
|
+
treemapOption
|
|
311
448
|
};
|
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
BarChart,
|
|
3
|
+
BoxplotChart,
|
|
4
|
+
CandlestickChart,
|
|
5
|
+
EffectScatterChart,
|
|
3
6
|
FunnelChart,
|
|
7
|
+
GraphChart,
|
|
8
|
+
ParallelChart,
|
|
9
|
+
PictorialBarChart,
|
|
10
|
+
SunburstChart,
|
|
11
|
+
ThemeRiverChart,
|
|
12
|
+
TreeChart,
|
|
13
|
+
TreemapChart,
|
|
4
14
|
GaugeChart,
|
|
5
15
|
HeatmapChart,
|
|
6
16
|
LineChart,
|
|
@@ -19,7 +29,9 @@ import {
|
|
|
19
29
|
MarkAreaComponent,
|
|
20
30
|
MarkLineComponent,
|
|
21
31
|
MarkPointComponent,
|
|
32
|
+
ParallelComponent,
|
|
22
33
|
TitleComponent,
|
|
34
|
+
ToolboxComponent,
|
|
23
35
|
TooltipComponent,
|
|
24
36
|
TransformComponent,
|
|
25
37
|
VisualMapComponent
|
|
@@ -33,7 +45,17 @@ function dsEcharts() {
|
|
|
33
45
|
registered = true;
|
|
34
46
|
echarts.use([
|
|
35
47
|
BarChart,
|
|
48
|
+
BoxplotChart,
|
|
49
|
+
CandlestickChart,
|
|
50
|
+
EffectScatterChart,
|
|
36
51
|
FunnelChart,
|
|
52
|
+
GraphChart,
|
|
53
|
+
ParallelChart,
|
|
54
|
+
PictorialBarChart,
|
|
55
|
+
SunburstChart,
|
|
56
|
+
ThemeRiverChart,
|
|
57
|
+
TreeChart,
|
|
58
|
+
TreemapChart,
|
|
37
59
|
GaugeChart,
|
|
38
60
|
HeatmapChart,
|
|
39
61
|
LineChart,
|
|
@@ -50,7 +72,9 @@ function dsEcharts() {
|
|
|
50
72
|
MarkAreaComponent,
|
|
51
73
|
MarkLineComponent,
|
|
52
74
|
MarkPointComponent,
|
|
75
|
+
ParallelComponent,
|
|
53
76
|
TitleComponent,
|
|
77
|
+
ToolboxComponent,
|
|
54
78
|
TooltipComponent,
|
|
55
79
|
TransformComponent,
|
|
56
80
|
VisualMapComponent,
|
package/dist/lib/i18n.d.ts
CHANGED
package/dist/lib/i18n.js
CHANGED
|
@@ -91,6 +91,7 @@ const en = {
|
|
|
91
91
|
noticeStateNew: "New",
|
|
92
92
|
noticeStateAcknowledged: "Acknowledged",
|
|
93
93
|
noticeStateResolved: "Resolved",
|
|
94
|
+
entityRetry: "Try again",
|
|
94
95
|
statIncrease: "Increase",
|
|
95
96
|
statDecrease: "Decrease",
|
|
96
97
|
statNoChange: "No change",
|
|
@@ -235,6 +236,7 @@ const es = {
|
|
|
235
236
|
noticeStateNew: "Nuevo",
|
|
236
237
|
noticeStateAcknowledged: "Reconocido",
|
|
237
238
|
noticeStateResolved: "Resuelto",
|
|
239
|
+
entityRetry: "Reintentar",
|
|
238
240
|
statIncrease: "Subida",
|
|
239
241
|
statDecrease: "Bajada",
|
|
240
242
|
statNoChange: "Sin cambios",
|
|
@@ -379,6 +381,7 @@ const ptBR = {
|
|
|
379
381
|
noticeStateNew: "Novo",
|
|
380
382
|
noticeStateAcknowledged: "Reconhecido",
|
|
381
383
|
noticeStateResolved: "Resolvido",
|
|
384
|
+
entityRetry: "Tentar novamente",
|
|
382
385
|
statIncrease: "Aumento",
|
|
383
386
|
statDecrease: "Queda",
|
|
384
387
|
statNoChange: "Sem altera\xE7\xE3o",
|
package/dist/styles.css
CHANGED
|
@@ -493,7 +493,8 @@
|
|
|
493
493
|
--ds-card-spacing: 1.5rem;
|
|
494
494
|
--ds-card-spacing-sm: 1rem;
|
|
495
495
|
--ds-field-px: 0.75rem;
|
|
496
|
-
--ds-
|
|
496
|
+
--ds-density: 1; /* escala global de relleno y separación de listas y tablas (0.8 = más denso, 1.2 = más aireado) */
|
|
497
|
+
--ds-cell-p: calc(0.75rem * var(--ds-density));
|
|
497
498
|
--ds-overlay-p: 1.5rem;
|
|
498
499
|
--ds-overlay-gap: 1.5rem;
|
|
499
500
|
--ds-popover-p: 1rem;
|
|
@@ -516,7 +517,11 @@
|
|
|
516
517
|
/* Piezas de datos y estructura (0.10.0) */
|
|
517
518
|
--ds-page-max-w: 72rem; /* ancho máximo del contenido de una vista (PageHeader) */
|
|
518
519
|
--ds-page-gap: 1.5rem;
|
|
519
|
-
--ds-section-gap: 1rem;
|
|
520
|
+
--ds-section-gap: calc(1rem * var(--ds-density));
|
|
521
|
+
--ds-page-narrow-w: 42rem; /* ancho máximo de una vista de detalle (PageShell detail) */
|
|
522
|
+
--ds-mosaic-row: 8rem; /* alto mínimo de una fila del Mosaic */
|
|
523
|
+
--ds-list-gap: calc(0.75rem * var(--ds-density)); /* separación entre filas/tarjetas de una lista de entidades */
|
|
524
|
+
--ds-list-gap-compact: calc(0.25rem * var(--ds-density)); /* ídem en el preset compact */
|
|
520
525
|
--ds-stat-value-weight: 600; /* cifra de un KPI */
|
|
521
526
|
--ds-stat-accent-w: calc(var(--ds-rule-w) * 3); /* filete de tono del KPI */
|
|
522
527
|
--ds-sparkline-h: 2rem;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { EChartProps, EChartHandle } from './echart.js';
|
|
3
|
+
import { EChartsCoreOption } from 'echarts/core';
|
|
4
|
+
|
|
5
|
+
type ChartCardPreset = "glance" | "standard" | "focus" | "dense";
|
|
6
|
+
declare const ChartCard: React.ForwardRefExoticComponent<{
|
|
7
|
+
option: EChartsCoreOption;
|
|
8
|
+
preset?: ChartCardPreset;
|
|
9
|
+
title?: React.ReactNode;
|
|
10
|
+
description?: React.ReactNode;
|
|
11
|
+
/** Acciones de la cabecera (selector de periodo, menú…). */
|
|
12
|
+
action?: React.ReactNode;
|
|
13
|
+
/** Pie: nota de la fuente, leyenda propia, enlace «Ver detalle». */
|
|
14
|
+
footer?: React.ReactNode;
|
|
15
|
+
loading?: boolean;
|
|
16
|
+
error?: unknown;
|
|
17
|
+
onRetry?: () => void;
|
|
18
|
+
/** Sin datos: muestra el texto de «sin datos» en lugar del gráfico. */
|
|
19
|
+
empty?: boolean;
|
|
20
|
+
height?: EChartProps["height"];
|
|
21
|
+
renderer?: EChartProps["renderer"];
|
|
22
|
+
exportable?: boolean;
|
|
23
|
+
fileName?: string;
|
|
24
|
+
onEvents?: EChartProps["onEvents"];
|
|
25
|
+
className?: string;
|
|
26
|
+
} & React.RefAttributes<EChartHandle>>;
|
|
27
|
+
|
|
28
|
+
export { ChartCard, type ChartCardPreset };
|