@sincpro/web-ui 1.10.0 → 1.11.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 (47) hide show
  1. package/dist/components/board/Board.d.ts +51 -0
  2. package/dist/components/board/Board.js +15 -0
  3. package/dist/components/board/index.d.ts +1 -0
  4. package/dist/components/board/index.js +2 -0
  5. package/dist/components/frame/Chart.d.ts +12 -7
  6. package/dist/components/frame/Chart.js +17 -17
  7. package/dist/components/frame/FrameView.d.ts +3 -3
  8. package/dist/components/frame/FrameView.js +79 -26
  9. package/dist/components/frame/model.d.ts +12 -3
  10. package/dist/components/frame/model.js +53 -19
  11. package/dist/components/index.d.ts +1 -0
  12. package/dist/components/index.js +1 -0
  13. package/dist/components/listing/AxisLevels.d.ts +24 -0
  14. package/dist/components/listing/AxisLevels.js +58 -0
  15. package/dist/components/listing/ChartExplorer.d.ts +79 -0
  16. package/dist/components/listing/ChartExplorer.js +114 -0
  17. package/dist/components/listing/PivotExplorer.js +5 -36
  18. package/dist/components/listing/index.d.ts +2 -0
  19. package/dist/components/listing/index.js +2 -0
  20. package/dist/components/listing/set.d.ts +3 -1
  21. package/dist/foundations/calendar.d.ts +15 -0
  22. package/dist/foundations/calendar.js +59 -1
  23. package/dist/foundations/chart.d.ts +126 -0
  24. package/dist/foundations/chart.js +297 -0
  25. package/dist/foundations/copy.d.ts +39 -0
  26. package/dist/foundations/copy.es.js +27 -0
  27. package/dist/foundations/copy.js +27 -0
  28. package/dist/foundations/index.d.ts +2 -1
  29. package/dist/foundations/index.js +4 -1
  30. package/dist/foundations/pivot.d.ts +9 -0
  31. package/dist/foundations/pivot.js +1 -0
  32. package/dist/primitives/chart/Chart.d.ts +39 -0
  33. package/dist/primitives/chart/Chart.js +235 -0
  34. package/dist/primitives/chart/index.d.ts +1 -0
  35. package/dist/primitives/chart/index.js +1 -0
  36. package/dist/primitives/index.d.ts +1 -0
  37. package/dist/primitives/index.js +1 -0
  38. package/dist/primitives/value/Metric.d.ts +13 -2
  39. package/dist/primitives/value/Metric.js +25 -3
  40. package/dist/tokens.css +45 -0
  41. package/dist/views/list/List.d.ts +2 -1
  42. package/dist/views/list/List.js +8 -1
  43. package/dist/views/list/ListView.d.ts +1 -1
  44. package/dist/views/list/ListView.js +37 -5
  45. package/dist/views/list/index.d.ts +1 -1
  46. package/dist/views/list/types.d.ts +34 -0
  47. package/package.json +2 -1
@@ -1,11 +1,13 @@
1
1
  import type { RecordCalendarProps } from "../../components/calendar/RecordCalendar.js";
2
2
  import type { RecordGanttProps } from "../../components/gantt/RecordGantt.js";
3
3
  import type { BoardStages } from "../../components/listing/BoardColumns.js";
4
+ import type { ChartComparison } from "../../components/listing/ChartExplorer.js";
4
5
  import type { ListIdentity } from "../../components/listing/ListingBar.js";
5
6
  import type { ListPresent } from "../../components/listing/set.js";
6
7
  import type { SortField } from "../../components/listing/SortMenu.js";
7
8
  import type { ViewIcon } from "../../components/listing/ViewSwitcher.js";
8
9
  import type { RecordTimelineProps } from "../../components/timeline/RecordTimeline.js";
10
+ import type { ChartKind, ChartOrder } from "../../foundations/chart.js";
9
11
  import type { GroupableField } from "../../foundations/grouping.js";
10
12
  import type { Grouping, GroupLevel, Pile } from "../../foundations/grouping.js";
11
13
  import type { Pivot, PivotKey, PivotSpec } from "../../foundations/pivot.js";
@@ -230,6 +232,36 @@ export type ListPivot<T> = {
230
232
  /** Which of `spec.measures` start on. The first one by default. */
231
233
  defaultMeasures?: readonly string[];
232
234
  };
235
+ /**
236
+ * EL GRÁFICO de una lista: la vista gráfica de Odoo. Lee lo mismo que el pivote —un
237
+ * `Pivot`, plegado acá con `spec` o afuera con `folded`— y lo dibuja como barras, líneas o
238
+ * torta. Sus niveles SIGUEN al agrupado del buscador: el primero va en el eje y los demás
239
+ * son las series, como en Odoo.
240
+ */
241
+ export type ListChart<T> = {
242
+ /** Plegado por quien guarda los datos. Sus ejes son los suyos y no se editan acá. */
243
+ folded?: Pivot;
244
+ /** Cómo plegarlo acá, con las filas en la mano: `rows` es el eje, `columns` las series. */
245
+ spec?: PivotSpec<T>;
246
+ /** Por qué campos se puede partir. Con esto los ejes se eligen sobre el gráfico. */
247
+ fields?: readonly GroupableField[];
248
+ /** La medida con la que abre. La primera de `spec.measures`; `COUNT_MEASURE` para el conteo. */
249
+ defaultMeasure?: string;
250
+ /** Varias medidas, cada una su propio gráfico (nunca dos escalas en un eje). */
251
+ defaultMeasures?: readonly string[];
252
+ kind?: ChartKind;
253
+ /** Cómo abre: apilado (por defecto, como Odoo), acumulado, ordenado. */
254
+ stacked?: boolean;
255
+ cumulative?: boolean;
256
+ order?: ChartOrder;
257
+ /** El período anterior, para dibujarlo al lado: los registros de entonces y sus nombres. */
258
+ compare?: ChartComparison<T>;
259
+ /** Una barra, un punto o una porción: abrir los registros que cayeron ahí. */
260
+ onPoint?: (category: PivotKey, series?: PivotKey) => void;
261
+ height?: number | string;
262
+ /** Con qué nombre se baja. */
263
+ fileName?: string;
264
+ };
233
265
  export type ListViewProps<T extends object> = {
234
266
  items: readonly T[];
235
267
  keyOf: (item: T) => string;
@@ -339,6 +371,8 @@ export type ListViewProps<T extends object> = {
339
371
  * elegirlo acá sería adivinar la pregunta.
340
372
  */
341
373
  pivot?: ListPivot<T>;
374
+ /** El GRÁFICO: el pivote dibujado. Con esto, `present="chart"` dibuja un `ChartExplorer`. */
375
+ chart?: ListChart<T>;
342
376
  /** The presentations the application wrote (`List.Present`), by id. */
343
377
  faces?: readonly ListFace<T>[];
344
378
  present?: ListPresent;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sincpro/web-ui",
3
- "version": "1.10.0",
3
+ "version": "1.11.0",
4
4
  "description": "An enterprise web design system for business software — ERPs, back offices, management tools — in React and Tailwind: tokens, primitives, components and the two views every management screen is made of.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -70,6 +70,7 @@
70
70
  "react-aria": "^3.53.1",
71
71
  "react-aria-components": "^1.22.1",
72
72
  "react-pdf": "^11.0.0",
73
+ "recharts": "^3.10.1",
73
74
  "streamdown": "^2.7.1",
74
75
  "tailwind-variants": "^4.0.0",
75
76
  "tailwindcss-react-aria-components": "^2.2.0",