@sincpro/web-ui 2.0.0 → 2.2.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 (143) hide show
  1. package/README.md +45 -0
  2. package/dist/components/activity/Activity.d.ts +13 -14
  3. package/dist/components/activity/Activity.js +1 -1
  4. package/dist/components/activity/Messages.d.ts +5 -5
  5. package/dist/components/activity/Messages.js +8 -8
  6. package/dist/components/attachments/Attachments.d.ts +7 -1
  7. package/dist/components/attachments/Attachments.js +8 -2
  8. package/dist/components/board/Board.d.ts +32 -2
  9. package/dist/components/board/Board.js +27 -4
  10. package/dist/components/board/index.d.ts +1 -1
  11. package/dist/components/board/index.js +2 -1
  12. package/dist/components/form/Form.js +6 -6
  13. package/dist/components/form/index.js +2 -2
  14. package/dist/components/frame/FrameView.d.ts +5 -5
  15. package/dist/components/frame/FrameView.js +4 -4
  16. package/dist/components/listing/GroupingLevels.d.ts +22 -22
  17. package/dist/components/listing/GroupingLevels.js +9 -9
  18. package/dist/components/listing/Listing.d.ts +11 -11
  19. package/dist/components/listing/Listing.js +11 -11
  20. package/dist/components/listing/ListingBar.js +11 -11
  21. package/dist/components/listing/Row.d.ts +19 -19
  22. package/dist/components/listing/Row.js +27 -27
  23. package/dist/components/listing/SortMenu.d.ts +36 -36
  24. package/dist/components/listing/SortMenu.js +6 -6
  25. package/dist/components/listing/grouping.d.ts +16 -16
  26. package/dist/components/listing/grouping.js +6 -6
  27. package/dist/components/listing/index.js +1 -1
  28. package/dist/components/listing/modelColumns.d.ts +25 -25
  29. package/dist/components/listing/modelColumns.js +24 -24
  30. package/dist/components/listing/pages.js +4 -4
  31. package/dist/components/listing/set.d.ts +18 -18
  32. package/dist/components/navigation/NavigationTree.js +2 -2
  33. package/dist/components/navigation/index.js +2 -2
  34. package/dist/components/record/RecordSkeleton.js +7 -7
  35. package/dist/components/search/CriteriaBuilder.d.ts +22 -22
  36. package/dist/components/search/CriteriaBuilder.js +31 -31
  37. package/dist/components/search/CriteriaChips.d.ts +9 -9
  38. package/dist/components/search/CriteriaChips.js +12 -12
  39. package/dist/components/search/FilterBuilder.d.ts +67 -67
  40. package/dist/components/search/FilterBuilder.js +104 -104
  41. package/dist/components/search/JoinWord.d.ts +1 -1
  42. package/dist/components/search/JoinWord.js +14 -14
  43. package/dist/components/search/JsonEditor.d.ts +8 -8
  44. package/dist/components/search/JsonEditor.js +16 -16
  45. package/dist/components/search/SearchBar.d.ts +34 -34
  46. package/dist/components/search/SearchBar.js +140 -117
  47. package/dist/components/search/criteria.d.ts +61 -61
  48. package/dist/components/search/criteria.js +39 -39
  49. package/dist/components/search/datePeriods.d.ts +47 -48
  50. package/dist/components/search/datePeriods.js +29 -29
  51. package/dist/components/search/dateRanges.d.ts +27 -27
  52. package/dist/components/search/dateRanges.js +16 -16
  53. package/dist/components/search/index.js +13 -13
  54. package/dist/components/search/model.d.ts +28 -28
  55. package/dist/components/search/model.js +21 -21
  56. package/dist/components/search/query.d.ts +71 -71
  57. package/dist/components/search/query.js +119 -119
  58. package/dist/components/shell/AppFrame.d.ts +9 -2
  59. package/dist/components/shell/AppFrame.js +102 -14
  60. package/dist/components/shell/Sidebar.d.ts +34 -0
  61. package/dist/components/shell/Sidebar.js +32 -0
  62. package/dist/components/shell/TopBar.d.ts +2 -0
  63. package/dist/components/shell/TopBar.js +13 -9
  64. package/dist/components/shell/index.d.ts +2 -0
  65. package/dist/components/shell/index.js +5 -1
  66. package/dist/components/shell/sidebarDrawer.d.ts +26 -0
  67. package/dist/components/shell/sidebarDrawer.js +22 -0
  68. package/dist/foundations/calendar.d.ts +27 -27
  69. package/dist/foundations/calendar.js +72 -72
  70. package/dist/foundations/chart.d.ts +57 -57
  71. package/dist/foundations/chart.js +27 -27
  72. package/dist/foundations/copy.d.ts +109 -94
  73. package/dist/foundations/copy.es.js +10 -2
  74. package/dist/foundations/copy.js +10 -2
  75. package/dist/foundations/grouping.d.ts +175 -175
  76. package/dist/foundations/grouping.js +0 -0
  77. package/dist/foundations/index.d.ts +1 -1
  78. package/dist/foundations/index.js +21 -21
  79. package/dist/foundations/pivot.d.ts +133 -131
  80. package/dist/foundations/pivot.js +54 -54
  81. package/dist/foundations/pivotSheet.d.ts +36 -36
  82. package/dist/foundations/pivotSheet.js +0 -0
  83. package/dist/foundations/slots.d.ts +38 -38
  84. package/dist/foundations/slots.js +18 -18
  85. package/dist/foundations/sticky.d.ts +28 -28
  86. package/dist/foundations/sticky.js +59 -59
  87. package/dist/foundations/xlsx.d.ts +47 -47
  88. package/dist/foundations/xlsx.js +0 -0
  89. package/dist/primitives/block/Line.d.ts +4 -4
  90. package/dist/primitives/block/Line.js +28 -28
  91. package/dist/primitives/block/index.js +2 -2
  92. package/dist/primitives/cell/index.js +2 -2
  93. package/dist/primitives/choice/index.js +3 -3
  94. package/dist/primitives/date/Calendar.d.ts +7 -1
  95. package/dist/primitives/date/Calendar.js +13 -3
  96. package/dist/primitives/date/DatePicker.d.ts +4 -1
  97. package/dist/primitives/date/DatePicker.js +2 -2
  98. package/dist/primitives/date/index.js +3 -3
  99. package/dist/primitives/disclosure/index.js +1 -1
  100. package/dist/primitives/field/DropZone.d.ts +22 -3
  101. package/dist/primitives/field/DropZone.js +33 -12
  102. package/dist/primitives/menu/Menu.d.ts +10 -6
  103. package/dist/primitives/menu/Menu.js +4 -3
  104. package/dist/primitives/notice/Callout.d.ts +30 -30
  105. package/dist/primitives/notice/Callout.js +6 -6
  106. package/dist/primitives/overlay/index.js +3 -3
  107. package/dist/primitives/picker/Picker.d.ts +6 -0
  108. package/dist/primitives/picker/Picker.js +27 -4
  109. package/dist/primitives/picker/index.js +2 -2
  110. package/dist/primitives/table/DataTable.d.ts +32 -32
  111. package/dist/primitives/table/DataTable.js +24 -24
  112. package/dist/primitives/table/EditableTable.d.ts +10 -10
  113. package/dist/primitives/table/EditableTable.js +9 -9
  114. package/dist/primitives/table/ReportTable.js +7 -7
  115. package/dist/primitives/table/SheetTable.d.ts +13 -13
  116. package/dist/primitives/table/SheetTable.js +14 -14
  117. package/dist/primitives/table/Table.js +8 -8
  118. package/dist/primitives/tabs/Tabs.d.ts +46 -46
  119. package/dist/primitives/tabs/Tabs.js +4 -30
  120. package/dist/primitives/tag/Count.d.ts +23 -0
  121. package/dist/primitives/tag/Count.js +59 -0
  122. package/dist/primitives/tag/index.d.ts +1 -0
  123. package/dist/primitives/tag/index.js +5 -2
  124. package/dist/primitives/toolbar/index.js +1 -1
  125. package/dist/primitives/value/Copyable.d.ts +22 -22
  126. package/dist/primitives/value/Copyable.js +9 -9
  127. package/dist/primitives/value/Metric.d.ts +7 -2
  128. package/dist/primitives/value/Metric.js +12 -4
  129. package/dist/tokens.css +164 -57
  130. package/dist/views/list/List.d.ts +36 -36
  131. package/dist/views/list/List.js +19 -19
  132. package/dist/views/list/ListView.js +74 -74
  133. package/dist/views/list/columns.d.ts +10 -10
  134. package/dist/views/list/columns.js +10 -10
  135. package/dist/views/list/derive.d.ts +30 -30
  136. package/dist/views/list/derive.js +49 -49
  137. package/dist/views/list/index.js +2 -2
  138. package/dist/views/list/presentations.js +3 -3
  139. package/dist/views/list/types.d.ts +109 -109
  140. package/dist/views/record/Record.d.ts +14 -14
  141. package/dist/views/record/Record.js +24 -24
  142. package/dist/views/record/index.js +1 -1
  143. package/package.json +1 -1
@@ -60,18 +60,18 @@ import { createPortal } from "react-dom";
60
60
  * ==================================================================== */
61
61
  export function Listing({ bar, metrics, sticky = false, surface, children, }) {
62
62
  const d = useDensity();
63
- /* La barra se PEGA arriba y las filas se van debajo de ella.
64
- Context: con 187 filas, scrollear para ver la última dejaba sin buscador,
65
- sin paginador y sin el conmutador de presentación — o sea que recortar
66
- después de mirar obligaba a subir de nuevo. Se pega debajo de lo que ya
67
- esté pegado (la barra de la aplicación) y empuja la pila para el
68
- encabezado de la tabla, que se pega debajo de ella. Ver `system/sticky.tsx`. */
63
+ /* The bar STICKS to the top and the rows go beneath it.
64
+ Context: with 187 rows, scrolling to see the last one left you without search,
65
+ without pager and without the presentation switcher — so cutting
66
+ after looking forced you to scroll up again. It sticks below whatever is already
67
+ stuck (the application bar) and pushes the stack down for the
68
+ table's header, which sticks below it. See `system/sticky.tsx`. */
69
69
  const band = useStickyLayer();
70
- /* En compacto NO se pega, y no es por falta de espacio: compacto es un cajón
71
- o una vista previa, o sea una caja corta con su propia cabecera y su propio
72
- scroll. Una banda pegada ahí se pinta encima del papel blanco del cajón —se
73
- ve como una mancha— para resolver un scroll que en cinco filas no existe.
74
- Es la misma razón por la que `ListingBar` tampoco dibuja la identidad ahí. */
70
+ /* In compact it does NOT stick, and not for lack of space: compact is a drawer
71
+ or a preview, that is a short box with its own header and its own
72
+ scroll. A band stuck there is painted over the drawer's white paper —it
73
+ looks like a stain— to solve a scroll that does not exist in five rows.
74
+ It is the same reason `ListingBar` does not draw the identity there either. */
75
75
  const pegada = sticky && d === "comfortable";
76
76
  /* With a sidebar the bar is the screen's header: it goes in the frame's full-width slot,
77
77
  above the sidebar (see `shell/headerSlot.ts`), and the frame does the sticking. */
@@ -103,18 +103,18 @@ export function ListingBar({ actions, title, description, counters, selection, s
103
103
  : fillCopy(copy.list.count, { count: count.toLocaleString(copy.locale) }) })));
104
104
  return (_jsx(SurfaceProvider, { value: "canvas", children: _jsxs("div", { className: `flex min-w-0 flex-wrap items-center gap-y-1.5 ${byDensity(d, "gap-x-3", "gap-x-2")}`, children: [title === undefined ? null : (_jsx("h2", { className: "min-w-0 shrink-0 truncate text-body font-semibold text-ink", children: title })), center === null ? null : (_jsx("div", { className: "flex min-w-0 flex-1 basis-(--container-name) items-center overflow-x-clip overflow-y-visible", children: center })), howMany, views === undefined ? null : (_jsx("div", { className: "ml-auto flex shrink-0 items-center gap-2", children: views })), actions === undefined ? null : (_jsx("div", { className: `flex shrink-0 items-center gap-1.5 ${views === undefined ? "ml-auto" : ""}`, children: actions }))] }) }));
105
105
  }
106
- /* El campo de búsqueda va en el CENTRO de la línea, y centrado contra la
107
- línea: pide `--container-search` y los dos lados se reparten lo que sobra
108
- en mitades iguales. Antes tomaba el resto, así que un rastro largo a la
109
- izquierda lo corría —y dos listas seguidas dibujaban su buscador en dos
110
- lugares distintos—. Ver `primitives/block/Line.tsx`. */
106
+ /* The search field goes in the CENTRE of the line, centred against the
107
+ line: it asks for `--container-search` and the two sides share what is left
108
+ in equal halves. Before, it took the rest, so a long trail on the
109
+ left pushed it —and two lists in a row drew their search box in two
110
+ different places—. See `primitives/block/Line.tsx`. */
111
111
  const topRow = (_jsx(Line, { asks: "var(--container-crumb)", centerAsks: center === null ? "auto" : "var(--container-search)", gap: byDensity(d, "gap-x-4 gap-y-2", "gap-x-2 gap-y-1.5"), align: "items-start", start: crumbs,
112
- /* `overflow-x-clip` y NO `overflow-hidden`: lo que hay que recortar es el
113
- ancho —que el campo no pinte encima de «1–80»—, y `hidden` en un eje
114
- fuerza `auto` en el otro, así que también recortaba hacia ABAJO. El
115
- panel de filtros del `SearchBar` cuelga con `absolute top-full`, o sea
116
- justo afuera de esta caja: apretar el embudo abría un panel que nadie
117
- veía. `clip` es el único valor que deja `visible` en el otro eje. */
112
+ /* `overflow-x-clip` and NOT `overflow-hidden`: what has to be clipped is the
113
+ width —so the field does not paint over «1–80»—, and `hidden` on one axis
114
+ forces `auto` on the other, so it also clipped DOWNWARD. The
115
+ `SearchBar`'s filter panel hangs with `absolute top-full`, that is
116
+ just outside this box: pressing the funnel opened a panel nobody
117
+ saw. `clip` is the only value that leaves the other axis `visible`. */
118
118
  center: center === null ? null : (_jsx("div", { className: "flex w-full min-w-0 items-center overflow-x-clip overflow-y-visible", children: center })), end: pagination }));
119
119
  const bottomRow = actions === undefined && !withIdentity && views === undefined ? null : (
120
120
  /* On a narrow list (a phone, a drawer) the name and its counters take the whole first
@@ -59,37 +59,37 @@ export declare function Row({ icon: Icon, avatar, name, onOpen, onPeek, click, o
59
59
  children?: ReactNode;
60
60
  }): import("react").JSX.Element;
61
61
  /**
62
- * EL ENCABEZADO DE LA PRESENTACIÓN DE FILAS.
62
+ * THE ROWS PRESENTATION'S HEADER.
63
63
  *
64
- * Context: la tabla y la planilla dicen qué es cada columna; la lista de filas
65
- * no decía nada. Ochenta renglones con «Ferretería Sur · 13 sept · Bs 12.480» a la
66
- * derecha y una ficha al final, y había que deducir qué era cada número — o
67
- * cambiar a la tabla para averiguarlo, que es cambiar de presentación para leer
68
- * la misma pantalla.
64
+ * Context: the table and the sheet say what each column is; the rows list
65
+ * said nothing. Eighty lines with «Ferretería Sur · 13 sept · Bs 12.480» on the
66
+ * right and a card at the end, and you had to deduce what each number was — or
67
+ * switch to the table to find out, which is changing presentation to read
68
+ * the same screen.
69
69
  *
70
- * **No son columnas: son las ZONAS de la fila, rotuladas.** Una fila tiene un
71
- * nombre que se estira, un `meta` que es UNA cadena ya formateada, y una
72
- * columna de fichas de ancho fijo. Rotularlas como si fueran tres columnas
73
- * alineadas sería mentir sobre lo que hay debajo: el `meta` de una fila puede
74
- * decir tres cosas y el de otra dos.
70
+ * **They are not columns: they are the row's ZONES, labelled.** A row has a
71
+ * name that stretches, a `meta` that is ONE already-formatted string, and a
72
+ * column of cards of fixed width. Labelling them as if they were three aligned
73
+ * columns would be lying about what is underneath: one row's `meta` may
74
+ * say three things and another's two.
75
75
  *
76
- * Por eso calca la caja de `Row` —mismo padding, mismos huecos, mismos
77
- * espaciadores de casilla, ícono y acciones— en vez de declarar un ancho
78
- * propio. Si `Row` cambia su geometría, esto la sigue.
76
+ * That is why it traces `Row`'s box —same padding, same gaps, same
77
+ * checkbox, icon and actions spacers— instead of declaring a width of its
78
+ * own. If `Row` changes its geometry, this follows it.
79
79
  */
80
80
  export declare function RowHeader({ name, meta, tags, withSelection, withIcon, withAvatar, withActions, trail, }: {
81
81
  name: string;
82
82
  meta?: string;
83
83
  tags?: string;
84
- /** Los espaciadores de la izquierda. Los pone quien dibuja las filas, porque
85
- * es el único que sabe si esta lista elige y si sus filas tienen ícono. */
84
+ /** The spacers on the left. Whoever draws the rows puts them, because
85
+ * they are the only one who knows whether this list selects and whether its rows have an icon. */
86
86
  withSelection?: boolean;
87
87
  withIcon?: boolean;
88
88
  /** The rows carry a face instead of an icon: a wider spacer, so the labels stay aligned. */
89
89
  withAvatar?: boolean;
90
- /** La zona de acciones de la derecha ocupa su lugar aunque esté invisible
91
- * —así nada se corre al pasar el puntero—, así que el rótulo de las fichas
92
- * queda desalineado si acá no se reserva lo mismo. */
90
+ /** The actions zone on the right takes up its place even when invisible
91
+ * —so nothing shifts when the pointer passes—, so the cards' label
92
+ * ends up misaligned if the same is not reserved here. */
93
93
  withActions?: boolean;
94
94
  /** What the rows have at their end — the same flags `Row` gets — drawn invisible here so
95
95
  * the header reserves exactly that width. Takes over from `withActions`. */
@@ -63,17 +63,17 @@ export function Row({ icon: Icon, avatar, name, onOpen, onPeek, click = "peek",
63
63
  inset and rounded, so the hover is a mark and not a stripe. The inner
64
64
  padding is shorter by exactly that inset, so the text does not move. */
65
65
  className: `group/row flex min-w-0 items-center rounded-control transition-colors duration-(--duration-instant) ${interactive ? "cursor-pointer hover:bg-ink/4" : ""} ${byDensity(d, "gap-3 px-2 py-2", "gap-2 px-1.5 py-1")}`,
66
- /* `onPeek` con `onOpen` de reserva: quien sólo declara `onOpen` —lo
67
- natural si nunca oyó hablar de la vista previa— tiene que poder abrir
68
- igual haciendo click en cualquier parte de la fila, no sólo en el
69
- nombre. Con la vista previa apagada (`PeekLayer.tsx`) esto es hoy el
70
- caso de todos: un click en la fila abre, sin más. */
66
+ /* `onPeek` with `onOpen` as a fallback: whoever declares only `onOpen` —what is
67
+ natural if they never heard of the preview— must be able to open
68
+ just the same by clicking anywhere on the row, not only on the
69
+ name. With the preview turned off (`PeekLayer.tsx`) this is today the
70
+ case for everyone: a click on the row opens, plain and simple. */
71
71
  onClick: click === "open" ? (onOpen ?? onPeek) : (onPeek ?? onOpen), role: "presentation", children: [onSelectedChange === undefined ? null : (_jsx("input", { type: "checkbox", checked: selected ?? false, "aria-label": fillCopy(copy.selection.named, { name }), onChange: (e) => onSelectedChange(e.target.checked), onClick: (e) => e.stopPropagation(), className: "size-3.5 shrink-0 cursor-pointer accent-primary" })), avatar !== undefined ? (_jsx(Avatar, { name: avatar.name, size: "sm", ...(avatar.src === undefined ? {} : { src: avatar.src }) })) : Icon === undefined ? null : (_jsx(Icon, { className: "size-(--size-icon-md) shrink-0 text-muted", strokeWidth: 1.75, "aria-hidden": true })), _jsxs("div", { className: `flex min-w-0 shrink grow basis-(--container-name) flex-wrap items-center gap-y-0 ${byDensity(d, "gap-x-3", "gap-x-2")}`, children: [_jsx("span", { className: "min-w-0 grow basis-(--container-name)", children: _jsx(RecordLink, { ...((onOpen ?? onPeek) === undefined ? {} : { onClick: (onOpen ?? onPeek) }), title: name, children: name }) }), meta === undefined ? null : (
72
72
  /* Wrapped or not, the metadata is still there —it is what saves
73
73
  having to open a set to know whether it is a thousand rows or a
74
74
  million— and it truncates instead of wrapping into itself: three
75
75
  lines per row in a 480 px drawer means three rows fit on screen. */
76
- _jsx("span", { className: "min-w-0 truncate text-micro tabular-nums text-muted", children: meta }))] }), tags === undefined ? null : (_jsx("span", { className: "flex min-w-fit shrink basis-(--container-tags) items-center justify-end gap-1.5", children: tags })), _jsx("span", { className: "flex shrink-0 items-center gap-1 opacity-0 transition-opacity duration-(--duration-instant) group-hover/row:opacity-100 focus-within:opacity-100 pointer-coarse:opacity-100", children: _jsx(Trail, { name: name, openAs: openAs, ...(actions === undefined ? {} : { actions }), copy: copyAs, ...(onPeek === undefined || !openers ? {} : { onPeek }), ...(onOpen === undefined || !openers ? {} : { onOpen }), ...(more === undefined ? {} : { more }), ...(onMoreSelect === undefined ? {} : { onMoreSelect }) }) })] }) }));
76
+ _jsx("span", { className: "min-w-0 truncate text-micro tabular-nums text-muted", children: meta })), tags === undefined ? null : (_jsx("span", { className: "ms-auto flex min-w-fit shrink basis-(--container-tags) items-center justify-end gap-1.5", children: tags }))] }), _jsx("span", { className: "flex shrink-0 items-center gap-1 opacity-0 transition-opacity duration-(--duration-instant) group-hover/row:opacity-100 focus-within:opacity-100 pointer-coarse:opacity-100", children: _jsx(Trail, { name: name, openAs: openAs, ...(actions === undefined ? {} : { actions }), copy: copyAs, ...(onPeek === undefined || !openers ? {} : { onPeek }), ...(onOpen === undefined || !openers ? {} : { onOpen }), ...(more === undefined ? {} : { more }), ...(onMoreSelect === undefined ? {} : { onMoreSelect }) }) })] }) }));
77
77
  if (children === undefined)
78
78
  return row;
79
79
  /* What the resource produced, hanging below. The indent reaches up to where
@@ -86,31 +86,31 @@ export function Row({ icon: Icon, avatar, name, onOpen, onPeek, click = "peek",
86
86
  return (_jsxs("div", { "data-slot": "branch", className: "flex min-w-0 flex-col", children: [row, _jsx("div", { className: `flex min-w-0 flex-col gap-1 border-l border-line-strong ${byDensity(d, "mb-2 ml-8 pb-0.5 pl-3 pr-3", "mb-1.5 ml-6 pl-2.5 pr-2.5")}`, children: children })] }));
87
87
  }
88
88
  /**
89
- * EL ENCABEZADO DE LA PRESENTACIÓN DE FILAS.
89
+ * THE ROWS PRESENTATION'S HEADER.
90
90
  *
91
- * Context: la tabla y la planilla dicen qué es cada columna; la lista de filas
92
- * no decía nada. Ochenta renglones con «Ferretería Sur · 13 sept · Bs 12.480» a la
93
- * derecha y una ficha al final, y había que deducir qué era cada número — o
94
- * cambiar a la tabla para averiguarlo, que es cambiar de presentación para leer
95
- * la misma pantalla.
91
+ * Context: the table and the sheet say what each column is; the rows list
92
+ * said nothing. Eighty lines with «Ferretería Sur · 13 sept · Bs 12.480» on the
93
+ * right and a card at the end, and you had to deduce what each number was — or
94
+ * switch to the table to find out, which is changing presentation to read
95
+ * the same screen.
96
96
  *
97
- * **No son columnas: son las ZONAS de la fila, rotuladas.** Una fila tiene un
98
- * nombre que se estira, un `meta` que es UNA cadena ya formateada, y una
99
- * columna de fichas de ancho fijo. Rotularlas como si fueran tres columnas
100
- * alineadas sería mentir sobre lo que hay debajo: el `meta` de una fila puede
101
- * decir tres cosas y el de otra dos.
97
+ * **They are not columns: they are the row's ZONES, labelled.** A row has a
98
+ * name that stretches, a `meta` that is ONE already-formatted string, and a
99
+ * column of cards of fixed width. Labelling them as if they were three aligned
100
+ * columns would be lying about what is underneath: one row's `meta` may
101
+ * say three things and another's two.
102
102
  *
103
- * Por eso calca la caja de `Row` —mismo padding, mismos huecos, mismos
104
- * espaciadores de casilla, ícono y acciones— en vez de declarar un ancho
105
- * propio. Si `Row` cambia su geometría, esto la sigue.
103
+ * That is why it traces `Row`'s box —same padding, same gaps, same
104
+ * checkbox, icon and actions spacers— instead of declaring a width of its
105
+ * own. If `Row` changes its geometry, this follows it.
106
106
  */
107
107
  export function RowHeader({ name, meta, tags, withSelection = false, withIcon = false, withAvatar = false, withActions = false, trail, }) {
108
108
  const d = useDensity();
109
109
  const rotulo = `truncate ${HEADER_TEXT}`;
110
110
  return (_jsxs("div", { "data-slot": "row-header",
111
- /* Se pega debajo de la barra de la lista, como el encabezado de la tabla
112
- y el de la planilla. Ver `system/sticky.tsx`. */
113
- className: `sticky z-10 flex min-w-0 items-center border-b border-line-strong bg-ground ${byDensity(d, "gap-3 px-3 py-2", "gap-2 px-2.5 py-1.5")}`, style: stickyTop, role: "presentation", children: [!withSelection ? null : _jsx("span", { className: "size-3.5 shrink-0", "aria-hidden": true }), withAvatar ? (_jsx("span", { className: "size-5 shrink-0", "aria-hidden": true })) : !withIcon ? null : (_jsx("span", { className: "size-(--size-icon-md) shrink-0", "aria-hidden": true })), _jsxs("div", { className: `flex min-w-0 shrink grow basis-(--container-name) flex-wrap items-center gap-y-0 ${byDensity(d, "gap-x-3", "gap-x-2")}`, children: [_jsx("span", { className: `min-w-0 grow basis-(--container-name) ${rotulo}`, children: name }), meta === undefined ? null : _jsx("span", { className: `min-w-0 ${rotulo}`, children: meta })] }), tags === undefined ? null : (_jsx("span", { className: "flex min-w-fit shrink basis-(--container-tags) items-center justify-end", children: _jsx("span", { className: rotulo, children: tags }) })), trail !== undefined ? (_jsx("span", { inert: true, "aria-hidden": true, className: "invisible flex shrink-0 items-center gap-1", children: _jsx(Trail, { name: "", openAs: "", ...(trail.actions === undefined ? {} : { actions: trail.actions }), ...(trail.copy === false ? { copy: false } : {}), ...(trail.peek === true ? { onPeek: () => { } } : {}), ...(trail.open === true ? { onOpen: () => { } } : {}) }) })) : !withActions ? null : (_jsx("span", { className: "size-(--size-control-sm) shrink-0", "aria-hidden": true }))] }));
111
+ /* It sticks below the list's bar, like the table's header
112
+ and the sheet's. See `system/sticky.tsx`. */
113
+ className: `sticky z-10 flex min-w-0 items-center border-b border-line-strong bg-ground ${byDensity(d, "gap-3 px-3 py-2", "gap-2 px-2.5 py-1.5")}`, style: stickyTop, role: "presentation", children: [!withSelection ? null : _jsx("span", { className: "size-3.5 shrink-0", "aria-hidden": true }), withAvatar ? (_jsx("span", { className: "size-5 shrink-0", "aria-hidden": true })) : !withIcon ? null : (_jsx("span", { className: "size-(--size-icon-md) shrink-0", "aria-hidden": true })), _jsxs("div", { className: `flex min-w-0 shrink grow basis-(--container-name) flex-wrap items-center gap-y-0 ${byDensity(d, "gap-x-3", "gap-x-2")}`, children: [_jsx("span", { className: `min-w-0 grow basis-(--container-name) ${rotulo}`, children: name }), meta === undefined ? null : _jsx("span", { className: `min-w-0 ${rotulo}`, children: meta }), tags === undefined ? null : (_jsx("span", { className: "ms-auto flex min-w-fit shrink basis-(--container-tags) items-center justify-end", children: _jsx("span", { className: rotulo, children: tags }) }))] }), trail !== undefined ? (_jsx("span", { inert: true, "aria-hidden": true, className: "invisible flex shrink-0 items-center gap-1", children: _jsx(Trail, { name: "", openAs: "", ...(trail.actions === undefined ? {} : { actions: trail.actions }), ...(trail.copy === false ? { copy: false } : {}), ...(trail.peek === true ? { onPeek: () => { } } : {}), ...(trail.open === true ? { onOpen: () => { } } : {}) }) })) : !withActions ? null : (_jsx("span", { className: "size-(--size-control-sm) shrink-0", "aria-hidden": true }))] }));
114
114
  }
115
115
  /**
116
116
  * The header of a group inside a list.
@@ -129,10 +129,10 @@ export function GroupHeader({ field, label, count, detail, depth = 0, open = tru
129
129
  const d = useDensity();
130
130
  const copy = useUiCopy();
131
131
  const content = (_jsxs(_Fragment, { children: [onToggle === undefined ? null : (_jsx(ChevronRight, { className: `size-(--size-icon-sm) shrink-0 text-muted transition-transform duration-(--duration-instant) ${open ? "rotate-90" : ""}`, strokeWidth: 2, "aria-hidden": true })), field === undefined ? null : (_jsx("span", { className: "shrink-0 text-micro text-muted", children: field })), _jsx("span", { className: "truncate text-micro font-medium text-ink", children: label }), count === undefined ? null : (_jsx("span", { className: "inline-flex shrink-0 items-center rounded-pill border border-line-strong bg-ink/5 px-2 py-0.5 text-micro tabular-nums text-muted", children: count.toLocaleString(copy.locale) })), detail === undefined ? null : (_jsx("span", { className: "shrink-0 text-micro tabular-nums text-muted", children: detail }))] }));
132
- /* La sangría va en el relleno de la izquierda y no en un margen: el
133
- encabezado tiene fondo y borde inferior, y un margen los cortaría antes del
134
- borde de la lista — la banda dejaría de leerse como una franja. El hover
135
- no reemplaza ese fondo: es una marca metida adentro, redondeada. */
132
+ /* The indentation goes in the left padding and not in a margin: the
133
+ header has a background and a bottom border, and a margin would cut them before the
134
+ list's edge — the band would stop reading as a stripe. The hover
135
+ does not replace that background: it is a mark set inside, rounded. */
136
136
  const box = `flex min-w-0 items-center gap-2 border-b border-line bg-ground ${byDensity(d, "px-3 py-1.5", "px-2.5 py-1")}`;
137
137
  const indent = depth === 0 ? undefined : { paddingLeft: `calc(var(--spacing-indent) * ${depth})` };
138
138
  const mark = (_jsx("span", { "aria-hidden": true, className: "pointer-events-none absolute inset-x-1 inset-y-0.5 rounded-control group-hover/head:bg-ink/4" }));
@@ -1,66 +1,66 @@
1
1
  import type { Surface } from "../../foundations/types.js";
2
2
  import { type SortState } from "../../primitives/table/sorting.js";
3
3
  /**
4
- * ORDENAR — por uno o por varios campos, desde la barra.
4
+ * SORT — by one or several fields, from the bar.
5
5
  *
6
- * Context: ordenar era una capacidad de `DataTable` y de nadie más. Se hacía
7
- * clic en el encabezado de la columna, que es la forma correcta **cuando hay
8
- * encabezados**. En filas, en tablero y en la planilla no los hay, así que
9
- * cambiar de presentación no perdía sólo el orden puesto: perdía la posibilidad
10
- * de ordenar.
6
+ * Context: sorting was a capability of `DataTable` and of nothing else. You
7
+ * clicked the column header, which is the right way **when there are
8
+ * headers**. In rows, board and sheet there are none, so
9
+ * changing presentation lost not only the order set: it lost the ability
10
+ * to sort.
11
11
  *
12
- * El orden es del CONJUNTO y no de la presentación, igual que los niveles y que
13
- * lo plegado. Por eso el control vive en la barra y no adentro de la tabla, y
14
- * por eso la tabla sigue teniendo además sus encabezados: son dos puertas a lo
15
- * mismo, y la de los encabezados es más rápida cuando existe.
12
+ * The order belongs to the SET and not to the presentation, like the levels and
13
+ * the folding. That is why the control lives in the bar and not inside the table, and
14
+ * why the table still has its headers as well: they are two doors to the
15
+ * same thing, and the headers' one is faster when it exists.
16
16
  *
17
- * ── Varios criterios, y por eso un panel y no un menú ───────────────
17
+ * ── Several criteria, and so a panel and not a menu ─────────────────
18
18
  *
19
- * Se decía que ordenar por dos campos era «un desempate que hace el motor» y
20
- * que alcanzaba con elegir uno. La gente pidió lo contrario en la pantalla: por
21
- * fecha, y en la misma fecha por cliente, y después por producto. El motor ya
22
- * lo aceptaba (`order: [...]`); faltaba poder decirlo. Un orden de N campos
23
- * tiene ORDEN entre ellos —el segundo sólo decide entre las filas que el
24
- * primero dejó iguales—, y eso un menú de tildes no lo expresa: hace falta una
25
- * lista que se reordena. Es la de React Aria (`GridList` + `useDragAndDrop`):
26
- * se arrastra con el mouse, y con el teclado desde el asa (Enter, flechas,
27
- * Enter), anunciado.
19
+ * It used to be said that sorting by two fields was «a tie-break done by the engine» and
20
+ * that choosing one was enough. People asked for the opposite on screen: by
21
+ * date, and within the same date by customer, and then by product. The engine
22
+ * already accepted it (`order: [...]`); what was missing was being able to say it. An order of N fields
23
+ * has an ORDER among them —the second only decides between the rows the
24
+ * first left equal—, and a menu of ticks cannot express that: it takes a
25
+ * list that reorders. It is React Aria's (`GridList` + `useDragAndDrop`):
26
+ * dragged with the mouse, and with the keyboard from the handle (Enter, arrows,
27
+ * Enter), announced.
28
28
  */
29
29
  export type SortField<T = unknown> = {
30
30
  field: string;
31
31
  label: string;
32
32
  /**
33
- * Por qué valor se ordena, cuando ordena el NAVEGADOR.
33
+ * What value it is sorted by, when the BROWSER sorts.
34
34
  *
35
- * Ausente = ya viene ordenado de donde salió. Es la misma división que tiene
36
- * el agrupado con `piles`: un conjunto que el servidor pagina no se puede
37
- * ordenar acá —ordenar doce filas de ciento ochenta y siete da un orden
38
- * falso— así que ahí el orden viaja en la lectura y esto sólo lo refleja.
35
+ * Absent = it already comes sorted from where it came. It is the same split the
36
+ * grouping has with `piles`: a set the server paginates cannot be
37
+ * sorted here —sorting twelve rows out of a hundred and eighty-seven gives a false
38
+ * order— so there the order travels in the read and this only reflects it.
39
39
  */
40
40
  value?: (item: T) => string | number | null | undefined;
41
- /** Qué quiere decir «ascendente» para este campo. Sin esto, «ascendente».
42
- * Una fecha asciende de vieja a nueva y un importe de chico a grande, y
43
- * decirlo evita el clic de prueba. */
41
+ /** What «ascendente» means for this field. Without this, «ascendente».
42
+ * A date ascends from old to new and an amount from small to large, and
43
+ * saying so avoids the trial click. */
44
44
  ascLabel?: string;
45
45
  descLabel?: string;
46
46
  };
47
47
  export type SortMenuProps = {
48
- /** Por qué campos se puede ordenar. Sin ninguno, el control no se dibuja. */
48
+ /** Which fields it can be sorted by. With none, the control is not drawn. */
49
49
  fields: readonly SortField<never>[];
50
- /** El orden, de afuera hacia adentro. Vacío es «como llegaron». */
50
+ /** The order, from outside in. Empty is «as they arrived». */
51
51
  sort: readonly SortState[];
52
52
  onSortChange: (next: SortState[]) => void;
53
53
  surface?: Surface;
54
54
  };
55
55
  /**
56
- * Las filas, ordenadas acá, por cada criterio en su orden.
56
+ * The rows, sorted here, by each criterion in its order.
57
57
  *
58
- * Sólo por los campos que declaran `value`; los demás se saltean —ordenar una
59
- * página de un conjunto que se pagina afuera produce un orden que es mentira,
60
- * porque ordena las doce que llegaron y no las ciento ochenta y siete. Sin
61
- * ningún criterio legible, se devuelven tal cual.
58
+ * Only by the fields that declare `value`; the rest are skipped —sorting a
59
+ * page of a set paginated elsewhere produces an order that is a lie,
60
+ * because it sorts the twelve that arrived and not the hundred and eighty-seven. With
61
+ * no readable criterion, they are returned as is.
62
62
  *
63
- * Los faltantes van SIEMPRE al final, suba o baje el orden (ver `compareBy`).
63
+ * The missing ones go ALWAYS at the end, whether the order goes up or down (see `compareBy`).
64
64
  */
65
65
  export declare function sortItems<T>(items: readonly T[], fields: readonly SortField<T>[], sort: readonly SortState[] | undefined): readonly T[];
66
66
  export declare function SortMenu({ fields, sort, onSortChange, surface }: SortMenuProps): import("react").JSX.Element | null;
@@ -7,14 +7,14 @@ import { compareBy, flipSort, moveSort, } from "../../primitives/table/sorting.j
7
7
  import { ArrowDownUp, ArrowDownWideNarrow, ArrowUpNarrowWide, ChevronDown, GripVertical, Plus, X, } from "lucide-react";
8
8
  import { Button as AriaButton, Dialog, DialogTrigger, GridList, GridListItem, useDragAndDrop, } from "react-aria-components";
9
9
  /**
10
- * Las filas, ordenadas acá, por cada criterio en su orden.
10
+ * The rows, sorted here, by each criterion in its order.
11
11
  *
12
- * Sólo por los campos que declaran `value`; los demás se saltean —ordenar una
13
- * página de un conjunto que se pagina afuera produce un orden que es mentira,
14
- * porque ordena las doce que llegaron y no las ciento ochenta y siete. Sin
15
- * ningún criterio legible, se devuelven tal cual.
12
+ * Only by the fields that declare `value`; the rest are skipped —sorting a
13
+ * page of a set paginated elsewhere produces an order that is a lie,
14
+ * because it sorts the twelve that arrived and not the hundred and eighty-seven. With
15
+ * no readable criterion, they are returned as is.
16
16
  *
17
- * Los faltantes van SIEMPRE al final, suba o baje el orden (ver `compareBy`).
17
+ * The missing ones go ALWAYS at the end, whether the order goes up or down (see `compareBy`).
18
18
  */
19
19
  export function sortItems(items, fields, sort) {
20
20
  if (sort === undefined || sort.length === 0)
@@ -1,31 +1,31 @@
1
1
  import { type GroupGrain, type GroupLevel } from "../../foundations/grouping.js";
2
2
  /**
3
- * LOS NIVELES, como estado que alguien edita.
3
+ * THE LEVELS, as state somebody edits.
4
4
  *
5
- * El vocabulario —qué es un nivel, qué es un montón, cómo se identifica— vive en
6
- * `system/grouping.ts`, porque lo hablan las DOS capas: la lista arma el árbol y
7
- * la tabla lo dibuja, y una primitiva no puede importar de un contexto. Acá
8
- * queda sólo el CONTROL, que es de la lista como lo son el de columnas y el de
9
- * plegado.
5
+ * The vocabulary —what a level is, what a heap is, how it is identified— lives in
6
+ * `system/grouping.ts`, because BOTH layers speak it: the list builds the tree and
7
+ * the table draws it, and a primitive cannot import from a context. Here
8
+ * only the CONTROL stays, which belongs to the list as do the columns' and the
9
+ * folding's.
10
10
  */
11
- /** Los niveles puestos, y las cuatro cosas que se les hacen. El orden ES la
12
- * jerarquía: mover un nivel de lugar cambia por qué se parte primero. */
11
+ /** The levels set, and the four things done to them. The order IS the
12
+ * hierarchy: moving a level changes what is split first. */
13
13
  export type GroupingControl = {
14
14
  levels: readonly GroupLevel[];
15
15
  /**
16
- * Pone un nivel. Un campo de fecha puede estar puesto con VARIOS granos —«por
17
- * mes y adentro por día»— así que lo que no se duplica es el par campo+grano,
18
- * no el campo. Agrupar dos veces por exactamente lo mismo parte en montones de
19
- * uno, y eso siempre es un error de tipeo.
16
+ * Sets a level. A date field can be set with SEVERAL grains —«by
17
+ * month and inside it by day»— so what is not duplicated is the field+grain pair,
18
+ * not the field. Grouping twice by exactly the same splits into heaps of
19
+ * one, and that is always a typo.
20
20
  */
21
21
  add: (field: string, grain?: GroupGrain) => void;
22
22
  remove: (field: string, grain?: GroupGrain) => void;
23
- /** Tildar y destildar en un gesto, que es lo que hace una casilla. */
23
+ /** Tick and untick in one gesture, which is what a checkbox does. */
24
24
  toggle: (field: string, grain?: GroupGrain) => void;
25
25
  has: (field: string, grain?: GroupGrain) => boolean;
26
- /** Mueve un nivel `delta` lugares. Se queda en los bordes en vez de dar la
27
- * vuelta: llegar al primero y volver al último no es lo que nadie espera de
28
- * una flecha «subir». */
26
+ /** Moves a level `delta` places. It stays at the edges instead of wrapping
27
+ * around: reaching the first and coming back to the last is not what anyone expects of
28
+ * an «up» arrow. */
29
29
  move: (field: string, delta: number) => void;
30
30
  clear: () => void;
31
31
  };
@@ -13,16 +13,16 @@ export function useGroupingControl(options = {}) {
13
13
  const add = useCallback((field, grain) => {
14
14
  if (levels.some((one) => levelKey(one) === keyOf(field, grain)))
15
15
  return;
16
- /* Se normaliza SIEMPRE y no sólo al agregar fechas: es la única forma de
17
- que tildar «día» y después «mes» dé «mes › día» sin que quien tilda
18
- tenga que saber en qué orden hacerlo. */
16
+ /* It is normalised ALWAYS and not only when adding dates: it is the only way
17
+ for ticking «día» and then «mes» to give «mes › día» without whoever ticks
18
+ having to know in which order to do it. */
19
19
  setLevels(normalizeLevels([...levels, grain === undefined ? { field } : { field, grain }]));
20
20
  }, [levels, setLevels]);
21
21
  const remove = useCallback((field, grain) => {
22
22
  setLevels(grain === undefined && !levels.some((one) => levelKey(one) === field)
23
- ? /* Sin grano y sin coincidencia exacta: se saca el campo ENTERO, con
24
- todos sus granos. Es lo que quiere decir la × de un campo de
25
- fecha que está puesto por mes y por día. */
23
+ ? /* No grain and no exact match: the WHOLE field is taken out, with
24
+ all its grains. It is what the × of a date field set
25
+ by month and by day means. */
26
26
  levels.filter((one) => one.field !== field)
27
27
  : levels.filter((one) => levelKey(one) !== keyOf(field, grain)));
28
28
  }, [levels, setLevels]);
@@ -14,7 +14,7 @@ export { useSelection } from "./selection.js";
14
14
  export { useSetControl } from "./set.js";
15
15
  export { toggleCollapsed, useTreeControl, } from "./tree.js";
16
16
  export { ViewSwitcher, } from "./ViewSwitcher.js";
17
- /* El control de los niveles. El vocabulario está en `system/grouping.ts`. */
17
+ /* The grouping levels' control. The vocabulary is in `system/grouping.ts`. */
18
18
  export { AxisLevels, levelId, levelLabeler, } from "./AxisLevels.js";
19
19
  export { BoardColumns, } from "./BoardColumns.js";
20
20
  export { ChartExplorer, } from "./ChartExplorer.js";
@@ -1,33 +1,33 @@
1
1
  import { type ModelCellKind } from "./modelCells.js";
2
2
  import { type ModelDefinition } from "../search/model.js";
3
3
  import type { DataColumn } from "../../primitives/table/DataTable.js";
4
- /** Qué campo del modelo muestra una columna declarada a mano.
4
+ /** Which model field a hand-declared column shows.
5
5
  *
6
- * Sin esto, «filas» y `row_count` son dos cosas distintas y el campo
7
- * aparecería dos veces: una con el rótulo bueno y otra cruda. */
6
+ * Without this, «filas» and `row_count` are two different things and the field
7
+ * would appear twice: once with the good label and once raw. */
8
8
  export type ClaimedField = {
9
9
  id: string;
10
10
  field?: string;
11
11
  };
12
- /** Los campos que las columnas declaradas ya contestan.
12
+ /** The fields the declared columns already answer.
13
13
  *
14
14
  * in [{id:"rows", field:"row_count"}, {id:"name"}]
15
15
  * out Set {"row_count", "name"}
16
16
  *
17
- * El `id` cuenta como reclamo cuando coincide con el nombre del campo: la
18
- * mayoría de las columnas se llaman como lo que muestran. */
17
+ * The `id` counts as a claim when it matches the field's name: most
18
+ * columns are named after what they show. */
19
19
  export declare function claimedFields(columns: readonly ClaimedField[]): Set<string>;
20
- /** Un valor del registro, en algo que una celda pueda ordenar y dibujar.
20
+ /** A record value, into something a cell can sort and draw.
21
21
  *
22
- * in ["edad","sexo"] un `text[]`
22
+ * in ["edad","sexo"] a `text[]`
23
23
  * out "edad, sexo"
24
- * in [] una lista vacía no es un texto vacío
25
- * out null la tabla dibuja «—»
24
+ * in [] an empty list is not an empty text
25
+ * out null the table draws «—»
26
26
  * in "2026-09-13T04:17:00"
27
27
  * out "2026-09-13T04:17:00"
28
28
  *
29
- * Las fechas se dejan como vienen —ISO— porque en ISO el orden alfabético ES
30
- * el cronológico, y así la columna ordena bien sin parsear nada. */
29
+ * Dates are left as they come —ISO— because in ISO alphabetical order IS
30
+ * chronological, and so the column sorts well without parsing anything. */
31
31
  export declare function readModelValue(raw: unknown): string | number | boolean | null;
32
32
  /** How a field of the model is drawn, by its `type` and in any case — «Email» and `email` are
33
33
  * the same field. A type not known here stays `text`, exactly as before.
@@ -38,22 +38,22 @@ export declare function readModelValue(raw: unknown): string | number | boolean
38
38
  */
39
39
  export declare function modelCellKind(type: string): ModelCellKind;
40
40
  /**
41
- * Las columnas declaradas, más una por cada campo del modelo que ninguna
42
- * contestaba.
41
+ * The declared columns, plus one for each model field that none
42
+ * answered.
43
43
  *
44
- * in model el `model_meta_data` de `account.move` — 12 campos
45
- * in declared 6 columnas escritas a mano en la vista
46
- * out las 6, y detrás `journal_id`, `currency_id`, `invoice_origin`,
44
+ * in model the `model_meta_data` of `account.move` — 12 fields
45
+ * in declared 6 columns written by hand in the view
46
+ * out the 6, and behind them `journal_id`, `currency_id`, `invoice_origin`,
47
47
  * `payment_reference`, `fiscal_position_id`, `company_id`,
48
- * `move_type`, todas apagadas
48
+ * `move_type`, all switched off
49
49
  *
50
- * El rótulo de las agregadas sale de `model.translations` en el idioma pedido —el mismo
51
- * `translations()` que el modelo publica para todo lo demás—, con el `default` que ese mismo
52
- * modelo declaró si el idioma no está, y el nombre del campo tal cual sólo si el modelo no
53
- * dijo ninguna palabra sobre él. Nunca puede desincronizarse con el motor porque sale de la
54
- * MISMA respuesta que nombra el campo — a diferencia de un diccionario mantenido acá.
50
+ * The label of the added ones comes from `model.translations` in the requested language —the same
51
+ * `translations()` the model publishes for everything else—, with the `default` that same
52
+ * model declared if the language is missing, and the field's name as is only if the model
53
+ * said no word about it. It can never get out of sync with the engine because it comes from the
54
+ * SAME answer that names the field — unlike a dictionary maintained here.
55
55
  *
56
- * `model === null` —todavía no llegó la definición— devuelve las declaradas sin
57
- * tocar, que es exactamente lo que había antes.
56
+ * `model === null` —the definition has not arrived yet— returns the declared ones
57
+ * untouched, which is exactly what there was before.
58
58
  */
59
59
  export declare function columnsFromModel<T extends object>(declared: readonly DataColumn<T>[], model: ModelDefinition | null | undefined, locale?: string): DataColumn<T>[];