@sincpro/web-ui 1.11.1 → 2.1.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 (120) hide show
  1. package/dist/components/activity/Activity.d.ts +13 -14
  2. package/dist/components/activity/Activity.js +1 -1
  3. package/dist/components/activity/Messages.d.ts +5 -5
  4. package/dist/components/activity/Messages.js +8 -8
  5. package/dist/components/form/Form.js +6 -6
  6. package/dist/components/form/index.js +2 -2
  7. package/dist/components/frame/FrameView.d.ts +5 -5
  8. package/dist/components/frame/FrameView.js +4 -4
  9. package/dist/components/listing/GroupingLevels.d.ts +22 -22
  10. package/dist/components/listing/GroupingLevels.js +9 -9
  11. package/dist/components/listing/Listing.d.ts +11 -11
  12. package/dist/components/listing/Listing.js +11 -11
  13. package/dist/components/listing/ListingBar.js +11 -11
  14. package/dist/components/listing/Row.d.ts +19 -19
  15. package/dist/components/listing/Row.js +25 -25
  16. package/dist/components/listing/SortMenu.d.ts +36 -36
  17. package/dist/components/listing/SortMenu.js +6 -6
  18. package/dist/components/listing/grouping.d.ts +16 -16
  19. package/dist/components/listing/grouping.js +6 -6
  20. package/dist/components/listing/index.js +1 -1
  21. package/dist/components/listing/modelColumns.d.ts +25 -25
  22. package/dist/components/listing/modelColumns.js +24 -24
  23. package/dist/components/listing/pages.js +4 -4
  24. package/dist/components/listing/set.d.ts +18 -18
  25. package/dist/components/navigation/index.js +2 -2
  26. package/dist/components/record/RecordSkeleton.js +7 -7
  27. package/dist/components/search/CriteriaBuilder.d.ts +35 -22
  28. package/dist/components/search/CriteriaBuilder.js +95 -85
  29. package/dist/components/search/CriteriaChips.d.ts +9 -9
  30. package/dist/components/search/CriteriaChips.js +13 -13
  31. package/dist/components/search/FilterBuilder.d.ts +72 -71
  32. package/dist/components/search/FilterBuilder.js +190 -145
  33. package/dist/components/search/JoinWord.d.ts +1 -1
  34. package/dist/components/search/JoinWord.js +14 -14
  35. package/dist/components/search/JsonEditor.d.ts +8 -8
  36. package/dist/components/search/JsonEditor.js +21 -18
  37. package/dist/components/search/SearchBar.d.ts +34 -34
  38. package/dist/components/search/SearchBar.js +113 -113
  39. package/dist/components/search/criteria.d.ts +86 -74
  40. package/dist/components/search/criteria.js +44 -43
  41. package/dist/components/search/datePeriods.d.ts +47 -48
  42. package/dist/components/search/datePeriods.js +29 -29
  43. package/dist/components/search/dateRanges.d.ts +27 -27
  44. package/dist/components/search/dateRanges.js +16 -16
  45. package/dist/components/search/index.d.ts +2 -2
  46. package/dist/components/search/index.js +14 -14
  47. package/dist/components/search/model.d.ts +28 -28
  48. package/dist/components/search/model.js +21 -21
  49. package/dist/components/search/query.d.ts +71 -71
  50. package/dist/components/search/query.js +119 -119
  51. package/dist/components/shell/AppFrame.js +3 -3
  52. package/dist/components/shell/index.js +1 -1
  53. package/dist/foundations/calendar.d.ts +27 -27
  54. package/dist/foundations/calendar.js +72 -72
  55. package/dist/foundations/chart.d.ts +57 -57
  56. package/dist/foundations/chart.js +27 -27
  57. package/dist/foundations/copy.d.ts +104 -94
  58. package/dist/foundations/copy.es.js +6 -1
  59. package/dist/foundations/copy.js +6 -1
  60. package/dist/foundations/grouping.d.ts +175 -175
  61. package/dist/foundations/grouping.js +0 -0
  62. package/dist/foundations/index.d.ts +1 -1
  63. package/dist/foundations/index.js +21 -21
  64. package/dist/foundations/pivot.d.ts +133 -131
  65. package/dist/foundations/pivot.js +54 -54
  66. package/dist/foundations/pivotSheet.d.ts +36 -36
  67. package/dist/foundations/pivotSheet.js +0 -0
  68. package/dist/foundations/slots.d.ts +38 -38
  69. package/dist/foundations/slots.js +18 -18
  70. package/dist/foundations/sticky.d.ts +28 -28
  71. package/dist/foundations/sticky.js +59 -59
  72. package/dist/foundations/xlsx.d.ts +47 -47
  73. package/dist/foundations/xlsx.js +0 -0
  74. package/dist/primitives/block/Line.d.ts +4 -4
  75. package/dist/primitives/block/Line.js +28 -28
  76. package/dist/primitives/block/index.js +2 -2
  77. package/dist/primitives/cell/index.js +2 -2
  78. package/dist/primitives/choice/index.js +3 -3
  79. package/dist/primitives/date/Calendar.d.ts +7 -1
  80. package/dist/primitives/date/Calendar.js +13 -3
  81. package/dist/primitives/date/DatePicker.d.ts +4 -1
  82. package/dist/primitives/date/DatePicker.js +2 -2
  83. package/dist/primitives/date/index.js +3 -3
  84. package/dist/primitives/disclosure/index.js +1 -1
  85. package/dist/primitives/menu/Menu.d.ts +3 -3
  86. package/dist/primitives/notice/Callout.d.ts +30 -30
  87. package/dist/primitives/notice/Callout.js +6 -6
  88. package/dist/primitives/overlay/index.js +3 -3
  89. package/dist/primitives/picker/Picker.d.ts +6 -0
  90. package/dist/primitives/picker/Picker.js +27 -4
  91. package/dist/primitives/picker/index.js +2 -2
  92. package/dist/primitives/table/DataTable.d.ts +32 -32
  93. package/dist/primitives/table/DataTable.js +24 -24
  94. package/dist/primitives/table/EditableTable.d.ts +10 -10
  95. package/dist/primitives/table/EditableTable.js +9 -9
  96. package/dist/primitives/table/ReportTable.js +7 -7
  97. package/dist/primitives/table/SheetTable.d.ts +13 -13
  98. package/dist/primitives/table/SheetTable.js +14 -14
  99. package/dist/primitives/table/Table.js +8 -8
  100. package/dist/primitives/tabs/Tabs.d.ts +46 -46
  101. package/dist/primitives/tabs/Tabs.js +7 -7
  102. package/dist/primitives/tag/index.js +2 -2
  103. package/dist/primitives/toolbar/index.js +1 -1
  104. package/dist/primitives/value/Copyable.d.ts +22 -22
  105. package/dist/primitives/value/Copyable.js +9 -9
  106. package/dist/tokens.css +17 -17
  107. package/dist/views/list/List.d.ts +36 -36
  108. package/dist/views/list/List.js +19 -19
  109. package/dist/views/list/ListView.js +74 -74
  110. package/dist/views/list/columns.d.ts +10 -10
  111. package/dist/views/list/columns.js +10 -10
  112. package/dist/views/list/derive.d.ts +30 -30
  113. package/dist/views/list/derive.js +49 -49
  114. package/dist/views/list/index.js +2 -2
  115. package/dist/views/list/presentations.js +3 -3
  116. package/dist/views/list/types.d.ts +109 -109
  117. package/dist/views/record/Record.d.ts +14 -14
  118. package/dist/views/record/Record.js +24 -24
  119. package/dist/views/record/index.js +1 -1
  120. package/package.json +1 -1
@@ -31,16 +31,16 @@ note, height, rowLabel, band, onBandToggle, caption, onCommit, editable, onAddRo
31
31
  height?: number | "auto";
32
32
  rowLabel?: (row: number) => string;
33
33
  /**
34
- * Esta fila no es una fila: es la cabecera del montón que empieza acá.
34
+ * This row is not a row: it is the header of the pile that begins here.
35
35
  *
36
- * Agrupar sin perder la virtualización es esto — **una banda es una fila
37
- * más, de otra clase**. La alternativa era una planilla por montón, y eso
38
- * son N cuadrículas con N encabezados y N scrolls para un solo conjunto.
36
+ * Grouping without losing virtualisation is this — **a band is one more
37
+ * row, of another kind**. The alternative was one sheet per pile, and that is
38
+ * N grids with N headers and N scrolls for a single set.
39
39
  *
40
- * `depth` es cuán adentro está el montón. La planilla no puede recibir un
41
- * árbol —está virtualizada por índice, y un índice es una posición en una
42
- * secuencia—, así que la jerarquía la dice la sangría de cada banda y no el
43
- * anidamiento del marcado.
40
+ * `depth` is how deep the pile is. The sheet cannot take a
41
+ * tree —it is virtualised by index, and an index is a position in a
42
+ * sequence—, so the hierarchy is told by each band's indentation and not by the
43
+ * nesting of the markup.
44
44
  */
45
45
  band?: (row: number) => {
46
46
  field?: string;
@@ -49,12 +49,12 @@ note, height, rowLabel, band, onBandToggle, caption, onCommit, editable, onAddRo
49
49
  open: boolean;
50
50
  depth?: number;
51
51
  /**
52
- * Lo que el montón suma EN CADA COLUMNA, en la posición de esa columna.
52
+ * What the pile adds up IN EACH COLUMN, at that column's position.
53
53
  *
54
- * Una banda que pone su total en un rincón obliga a buscar a qué columna
55
- * corresponde el número. Alineado bajo su columna no hay nada que buscar:
56
- * la cuadrícula ya dice qué significa, que es para lo que existe una
57
- * cuadrícula. `null` en una columna que no suma — que es la mayoría.
54
+ * A band that puts its total in a corner forces you to look for which column
55
+ * the number belongs to. Aligned under its column there is nothing to look for:
56
+ * the grid already says what it means, which is what a
57
+ * grid is for. `null` in a column that does not add up — which is most of them.
58
58
  */
59
59
  total?: (column: SheetColumn, columnIndex: number) => string | number | null;
60
60
  } | undefined;
@@ -29,11 +29,11 @@ tone,
29
29
  note, height = 420, rowLabel, band, onBandToggle, caption, onCommit, editable, onAddRow, }) {
30
30
  const copy = useUiCopy();
31
31
  const labelOf = rowLabel ?? ((i) => (i + 1).toLocaleString(copy.locale));
32
- /* `"auto"` es para un conjunto que ya vino CORTADO —una página de ochenta— y
33
- deja de virtualizar de hecho: sin scroll propio, la ventana visible es la
34
- caja entera y se dibujan todas las filas. Para los datos crudos —donde son
35
- un millón— hay que declarar un alto, y ahí sí se dibujan las ~30 que se
36
- ven. Cuándo la caja es un contenedor de scroll lo decide `useScrollBox`. */
32
+ /* `"auto"` is for a set that already came CUT —a page of eighty— and
33
+ in effect stops virtualising: with no scroll of its own, the visible window is the
34
+ whole box and every row is drawn. For raw data —where there are
35
+ a million— a height must be declared, and then only the ~30 in
36
+ view are drawn. When the box is a scroll container is decided by `useScrollBox`. */
37
37
  const caja = useScrollBox(height === "auto" ? {} : { height });
38
38
  const v = useVirtualizer({
39
39
  count: rows,
@@ -173,16 +173,16 @@ note, height = 420, rowLabel, band, onBandToggle, caption, onCommit, editable, o
173
173
  }, children: [_jsxs("div", { className: "sticky z-20 flex border-b border-line-strong bg-ground", style: stickyTop, role: "row", children: [_jsx("div", { className: "sticky left-0 z-30 shrink-0 border-r border-line bg-ground", style: { width: ROW_LABEL_WIDTH } }), columns.map((c) => (_jsxs("div", { role: "columnheader", style: { width: c.width ?? WIDTH }, className: `flex shrink-0 flex-col justify-center gap-0.5 border-r border-line px-2.5 py-1.5 ${c.numeric === true ? "items-end" : "items-start"}`, children: [_jsx("span", { className: "max-w-full truncate text-meta font-medium text-ink", title: c.header, children: c.header }), c.type === undefined ? null : (_jsx("span", { className: "max-w-full truncate font-mono text-micro text-muted", children: c.type }))] }, c.id))), _jsx("div", { className: "flex-1" })] }), _jsx("div", { style: { height: v.getTotalSize(), position: "relative" }, children: items.map((item) => {
174
174
  const montón = band?.(item.index);
175
175
  if (montón !== undefined) {
176
- /* La banda queda pegada a la IZQUIERDA como el número de fila:
177
- con cuarenta columnas, un rótulo que se va con el scroll
178
- horizontal deja de decir en qué montón estás justo cuando
179
- más lejos estás de él. */
176
+ /* The band sticks to the LEFT like the row number:
177
+ with forty columns, a label that goes away with the horizontal
178
+ scroll stops saying which pile you are in just when
179
+ you are furthest from it. */
180
180
  return (
181
- /* La banda RESPETA la cuadrícula: rótulo en la columna fija de
182
- la izquierda, y después una celda por columna —vacía, salvo
183
- que esa columna sume algo—. Antes era un rótulo suelto que
184
- ignoraba las columnas, y entonces un total quedaba en un
185
- rincón sin decir de qué columna era. */
181
+ /* The band RESPECTS the grid: label in the fixed column on
182
+ the left, and then one cell per column —empty, unless
183
+ that column adds something up—. It used to be a loose label that
184
+ ignored the columns, and then a total sat in a
185
+ corner without saying which column it was. */
186
186
  _jsxs("div", { role: "row", "aria-rowindex": item.index + 1, className: "absolute top-0 left-0 flex w-full border-b border-line-strong bg-ground", style: { height: item.size, transform: `translateY(${item.start}px)` }, children: [_jsx("div", { role: "gridcell", className: "sticky left-0 z-10 shrink-0 border-r border-line bg-ground", style: { height: "100%", width: ROW_LABEL_WIDTH }, children: onBandToggle === undefined ? null : (_jsx("button", { type: "button", onClick: () => onBandToggle(item.index), "aria-expanded": montón.open, "aria-label": fillCopy(montón.open ? copy.report.close : copy.report.open, {
187
187
  name: montón.label,
188
188
  }), className: "flex h-full w-full min-w-0 items-center gap-1.5 px-2.5 text-left focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-primary", style: montón.depth === undefined || montón.depth === 0
@@ -47,10 +47,10 @@ export function Table({ children,
47
47
  height, rowCount, }) {
48
48
  const caja = useScrollBox(height === undefined ? {} : { height });
49
49
  return (
50
- /* Cuándo esta caja es un contenedor de scroll y cuándo no lo decide
51
- `useScrollBox`: ahí vive el dilema entero y ahí vive su explicación. Las
52
- tres tablas del sistema lo resolvían con tres copias de la misma
53
- medición. */
50
+ /* When this box is a scroll container and when it is not is decided by
51
+ `useScrollBox`: the whole dilemma lives there, and so does its explanation. The
52
+ three tables of the system solved it with three copies of the same
53
+ measurement. */
54
54
  _jsx("div", { ref: caja.ref, tabIndex: caja.tabIndex, className: `min-w-0 focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-primary ${caja.className}`, style: caja.style, children: _jsx("table", { "aria-rowcount": rowCount, className: "w-full border-separate border-spacing-0 px-1 text-left", children: children }) }));
55
55
  }
56
56
  /** The text of a column header, shared by every table of the family. Ink and semibold, not
@@ -58,10 +58,10 @@ height, rowCount, }) {
58
58
  export const HEADER_TEXT = "text-meta font-semibold whitespace-nowrap text-ink";
59
59
  export function THead({ children, rowIndex, }) {
60
60
  return (
61
- /* Se pega DEBAJO de lo que ya esté pegado —la barra de la aplicación y la
62
- de la lista— y no en `top: 0`, que lo metía atrás de las dos. Sin alto en
63
- `Table` el que scrollea es la página, y ahí la diferencia es justamente
64
- la que hacía desaparecer los nombres de columna. Ver `system/sticky.tsx`. */
61
+ /* It sticks BELOW whatever is already stuck —the application bar and the
62
+ list's— and not at `top: 0`, which tucked it behind both. Without a height on
63
+ `Table` the page is what scrolls, and there the difference is exactly
64
+ what made the column names disappear. See `system/sticky.tsx`. */
65
65
  _jsx("thead", { className: "sticky z-10 bg-ground", style: stickyTop, children: _jsx("tr", { "aria-rowindex": rowIndex, children: children }) }));
66
66
  }
67
67
  /** A column. If it gets a `sortKey`, it can be sorted.
@@ -2,78 +2,78 @@ import type { Tone } from "../../foundations/types.js";
2
2
  import type { LucideIcon } from "lucide-react";
3
3
  import { type ReactNode } from "react";
4
4
  /**
5
- * UNA TIRA DE PESTAÑAS. La misma en todo el sistema.
5
+ * A STRIP OF TABS. The same across the whole system.
6
6
  *
7
- * Context: esto vivía adentro del encabezado del registro y se llamaba
8
- * `Aspects`, así que la actividad —que necesita exactamente lo mismo— no podía
9
- * usarlo: un contexto no importa de otro contexto. El resultado era una tira de
10
- * pestañas de segunda mano, con el activo marcado de otra manera, en la misma
11
- * pantalla que la buena.
7
+ * Context: this lived inside the record's header and was called
8
+ * `Aspects`, so the activity —which needs exactly the same— could not
9
+ * use it: a context does not import from another context. The result was a second-hand
10
+ * strip of tabs, with the active one marked differently, on the same
11
+ * screen as the good one.
12
12
  *
13
- * Es una primitiva porque no sabe qué está separando: las caras de un registro,
14
- * las dos fuentes de una historia, o lo que venga.
13
+ * It is a primitive because it does not know what it is separating: a record's
14
+ * faces, the two sources of a history, or whatever comes.
15
15
  *
16
- * ── Por qué el activo es una PESTAÑA de carpeta ─────────────────────
16
+ * ── Why the active one is a folder TAB ──────────────────────────────
17
17
  *
18
- * Y no un subrayado. Un subrayado dice «esto está elegido»; una pestaña que sale
19
- * del borde y tapa la línea dice «esto está ABIERTO y lo de abajo es su
20
- * contenido», que es la relación real. La diferencia importa cuando hay tres y
21
- * el contenido de abajo no cambia de forma al cambiar de una a otra.
18
+ * And not an underline. An underline says «this is chosen»; a tab that sticks out
19
+ * of the border and covers the line says «this is OPEN and what is below is its
20
+ * content», which is the real relationship. The difference matters when there are three and
21
+ * the content below does not change shape when switching from one to another.
22
22
  *
23
- * ── El contador apagado en cero ─────────────────────────────────────
23
+ * ── The counter muted at zero ───────────────────────────────────────
24
24
  *
25
- * Un cero se dibuja, y apagado. Esconderlo obliga a abrir la pestaña para
26
- * descubrir que está vacía; pintarlo como los demás la hace parecer que tiene
27
- * algo. «No hay ninguna» es información y se dice.
25
+ * A zero is drawn, and muted. Hiding it forces you to open the tab to
26
+ * find out it is empty; painting it like the others makes it look as if it has
27
+ * something. «There are none» is information and it is said.
28
28
  *
29
- * ── El contador y la NOTIFICACIÓN son dos cosas ─────────────────────
29
+ * ── The counter and the NOTIFICATION are two things ─────────────────
30
30
  *
31
- * El contador dice CUÁNTAS cosas hay detrás, y es neutro: «pagos 0» es una
32
- * respuesta tan válida como «pagos 5». La notificación dice que algo de ahí
33
- * PIDE que lo mires —falló, cambió, llegó— y por eso tiene color y por eso un
34
- * cero no se dibuja: no hay nada que pedir.
31
+ * The counter says HOW MANY things are behind, and is neutral: «pagos 0» is an
32
+ * answer as valid as «pagos 5». The notification says that something in there
33
+ * ASKS you to look —it failed, changed, arrived— and that is why it has colour and why a
34
+ * zero is not drawn: there is nothing to ask.
35
35
  *
36
- * Confundirlos se ve así: una pestaña con «3» al lado y nadie sabe si son tres
37
- * cosas o tres problemas. Son dos marcas porque son dos preguntas.
36
+ * Confusing them looks like this: a tab with «3» beside it and nobody knows whether it is three
37
+ * things or three problems. They are two marks because they are two questions.
38
38
  */
39
39
  /**
40
- * ALGO DE ESTA PESTAÑA PIDE ATENCIÓN.
40
+ * SOMETHING IN THIS TAB ASKS FOR ATTENTION.
41
41
  *
42
- * No es un conteo: un conteo dice cuántas cosas hay y esto dice que hay algo que
43
- * mirar. Por eso tiene color, por eso no se dibuja en cero, y por eso puede
44
- * convivir con el contador — «pagos 4 ⬤» es cuatro cosas, una de ellas
45
- * rechazada.
42
+ * It is not a count: a count says how many things there are and this says there is something to
43
+ * look at. That is why it has colour, why it is not drawn at zero, and why it can
44
+ * live alongside the counter — «pagos 4 ⬤» is four things, one of them
45
+ * rejected.
46
46
  */
47
47
  export type TabNotice = {
48
48
  /**
49
- * Qué es lo que pide atención, en la voz del producto: «3 sin leer», «la
49
+ * What asks for attention, in the product's voice: «3 sin leer», «la
50
50
  * factura no se pudo enviar».
51
51
  *
52
- * Obligatorio, y por la misma razón que en `StatusDot`: un punto de color sin
53
- * su palabra al lado obliga a aprender una leyenda que no está escrita en
54
- * ningún lado, y no le dice nada a quien no distingue el rojo del verde. Acá
55
- * la marca acelera el barrido y la palabra informa — se lee al pasar por
56
- * encima y la lee un lector de pantalla.
52
+ * Required, and for the same reason as in `StatusDot`: a coloured dot without
53
+ * its word beside it forces learning a legend that is written nowhere,
54
+ * and tells nothing to someone who cannot tell red from green. Here
55
+ * the mark speeds up scanning and the word informs — it is read on hover
56
+ * and a screen reader reads it.
57
57
  */
58
58
  label: string;
59
- /** Cuántas cosas lo piden. Sin esto es un punto, que es lo que se pone cuando
60
- * llegó algo nuevo y contarlo no agrega nada. Un `0` no dibuja nada: no hay
61
- * nada que pedir. */
59
+ /** How many things ask for it. Without this it is a dot, which is what is used when
60
+ * something new arrived and counting it adds nothing. A `0` draws nothing: there is
61
+ * nothing to ask. */
62
62
  count?: number;
63
- /** De qué clase: `bad` algo falló, `warn` algo avisa, `accent` o `info` algo
64
- * llegó. Sin esto, `bad` — que es el caso por el que esto existe. */
63
+ /** Of what kind: `bad` something failed, `warn` something warns, `accent` or `info` something
64
+ * arrived. Without this, `bad` — which is the case this exists for. */
65
65
  tone?: Tone;
66
66
  };
67
67
  export type TabItem = {
68
68
  id: string;
69
69
  label: string;
70
- /** La marca de la pestaña. Con tres o más, el ícono es lo que se reconoce sin
71
- * leer — y en una tira angosta es lo único que sobrevive al truncado. */
70
+ /** The tab's mark. With three or more, the icon is what is recognised without
71
+ * reading — and in a narrow strip it is the only thing that survives truncation. */
72
72
  icon?: LucideIcon;
73
- /** Cuántas cosas hay detrás. `undefined` = no se cuenta; `0` se dibuja
74
- * apagado, que es distinto de no contar. */
73
+ /** How many things are behind. `undefined` = not counted; `0` is drawn
74
+ * muted, which is different from not counting. */
75
75
  count?: number;
76
- /** Que algo de acá pide que lo mires. Aparte del contador: ver `TabNotice`. */
76
+ /** That something in here asks you to look. Apart from the counter: see `TabNotice`. */
77
77
  notice?: TabNotice;
78
78
  };
79
79
  /**
@@ -104,6 +104,6 @@ export declare function Tabs({ tabs, current, onSelect, label, }: {
104
104
  tabs: readonly TabItem[];
105
105
  current: string;
106
106
  onSelect?: (id: string) => void;
107
- /** El rótulo accesible de la tira. Sin esto, «las caras del registro». */
107
+ /** The strip's accessible label. Without this, «las caras del registro». */
108
108
  label?: string;
109
109
  }): import("react").JSX.Element;
@@ -2,9 +2,9 @@
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { useUiCopy } from "../../foundations/copy.js";
4
4
  import { createContext, useContext, useId, useRef, } from "react";
5
- /* El color de la notificación. Estático y en una tabla porque Tailwind no puede
6
- componer una clase con un pedazo variable: `bg-${tone}/12` no existe en la
7
- hoja. */
5
+ /* The notification's colour. Static and in a table because Tailwind cannot
6
+ compose a class with a variable piece: `bg-${tone}/12` does not exist in the
7
+ stylesheet. */
8
8
  const NOTICE_TONE = {
9
9
  neutral: "bg-ink/8 text-muted",
10
10
  info: "bg-info/12 text-info",
@@ -90,8 +90,8 @@ export function Tabs({ tabs, current, onSelect, label, }) {
90
90
  return (_jsx("div", { ref: strip, role: "tablist", "aria-label": label ?? copy.record.faces, onKeyDown: onKeyDown, className: "flex min-w-0 flex-wrap items-end gap-1", children: tabs.map((a) => {
91
91
  const Icon = a.icon;
92
92
  const empty = a.count === 0;
93
- /* Un cero no pide nada, así que no se dibuja. Es la diferencia con el
94
- contador, donde «0» es una respuesta. */
93
+ /* A zero asks for nothing, so it is not drawn. That is the difference from the
94
+ counter, where «0» is an answer. */
95
95
  const notice = a.notice?.count === 0 ? undefined : a.notice;
96
96
  const isSelected = a.id === current;
97
97
  return (_jsx("button", { type: "button", role: "tab", "data-tab": a.id, "aria-selected": isSelected, tabIndex: isSelected ? 0 : -1, ...(base === null
@@ -103,8 +103,8 @@ export function Tabs({ tabs, current, onSelect, label, }) {
103
103
  : isSelected
104
104
  ? "bg-ink/8 text-ink"
105
105
  : "bg-ink/8 text-muted"}`, children: a.count.toLocaleString(copy.locale) })), notice === undefined ? null : (_jsx("span", { className: "sr-only", children: ` · ${notice.label}` })), notice === undefined ? null : notice.count === undefined ? (
106
- /* Sin número, un punto. La palabra no se dibuja pero está: en el
107
- `title` y en el nombre accesible de la pestaña. */
106
+ /* Without a number, a dot. The word is not drawn but it is there: in the
107
+ `title` and in the tab's accessible name. */
108
108
  _jsx("span", { className: `size-1.5 shrink-0 rounded-pill ${NOTICE_DOT[notice.tone ?? "bad"]}`, "aria-hidden": true })) : (_jsx("span", { className: `rounded-pill px-1.5 text-micro font-medium tabular-nums ${NOTICE_TONE[notice.tone ?? "bad"]}`, "aria-hidden": true, children: notice.count.toLocaleString(copy.locale) }))] }) }, a.id));
109
109
  }) }));
110
110
  }
@@ -1,5 +1,5 @@
1
1
  /* Saying a state without writing a sentence: the capsule and the dot. */
2
2
  export { StatusDot, Tag } from "./Tag.js";
3
- /* La tira de fichas: la misma en la barra, en el desplegable y en cualquier
4
- lugar donde se dibuje una lista de palabras cortas. */
3
+ /* The strip of chips: the same in the bar, in the dropdown and anywhere
4
+ a list of short words is drawn. */
5
5
  export { Tags } from "./Tags.js";
@@ -1,2 +1,2 @@
1
- /* LA BARRA DE HERRAMIENTAS — un grupo de controles que se recorre con las flechas. */
1
+ /* THE TOOLBAR — a group of controls walked with the arrow keys. */
2
2
  export { Toolbar, ToolbarSeparator } from "./Toolbar.js";
@@ -1,37 +1,37 @@
1
1
  import { type ReactNode } from "react";
2
2
  /**
3
- * UN VALOR QUE SE COPIA.
3
+ * A VALUE THAT GETS COPIED.
4
4
  *
5
- * Context: la mitad de los valores de este producto existen para pegarse en otro
6
- * lado —un NIT, un CUF de factura, una referencia bancaria, un código de
7
- * autorización de 26 caracteres—. Seleccionarlos a mano falla justo con los que
8
- * más importa no equivocar: son largos, van en monoespaciada y se cortan.
5
+ * Context: half the values in this product exist to be pasted somewhere
6
+ * else —a tax ID, an invoice CUF, a bank reference, a 26-character
7
+ * authorisation code—. Selecting them by hand fails precisely with the ones
8
+ * where it matters most not to make a mistake: they are long, monospaced and get cut off.
9
9
  *
10
- * ── Confirma, y por eso el estado vive acá ──────────────────────────
10
+ * ── It confirms, and that is why the state lives here ───────────────
11
11
  *
12
- * Copiar no tiene efecto visible: el portapapeles está afuera de la pantalla. Un
13
- * botón que no contesta se aprieta tres veces «por las dudas». Por eso el ícono
14
- * pasa a un tilde por dos segundos — lo mínimo para creerle sin quedarse
15
- * mirando.
12
+ * Copying has no visible effect: the clipboard is off the screen. A
13
+ * button that does not answer gets pressed three times «just in case». That is why the icon
14
+ * turns into a tick for two seconds — the minimum to believe it without staying
15
+ * to watch.
16
16
  *
17
- * ── Y puede fallar ──────────────────────────────────────────────────
17
+ * ── And it can fail ─────────────────────────────────────────────────
18
18
  *
19
- * `navigator.clipboard` no existe fuera de un contexto seguro, y en algunos
20
- * navegadores exige un permiso que se puede negar. Se contempla: si falla, el
21
- * botón lo dice en vez de fingir que copió. Una confirmación falsa es peor que
22
- * ninguna, porque alguien pega lo que tenía antes y no se entera.
19
+ * `navigator.clipboard` does not exist outside a secure context, and in some
20
+ * browsers it demands a permission that can be denied. That is handled: if it fails, the
21
+ * button says so instead of pretending it copied. A false confirmation is worse than
22
+ * none, because someone pastes what they had before and never finds out.
23
23
  */
24
24
  export type CopyableProps = {
25
- /** Lo que se copia. Siempre texto: el portapapeles no tiene tipos. */
25
+ /** What is copied. Always text: the clipboard has no types. */
26
26
  value: string;
27
- /** Cómo se ve, si no es el valor tal cual. Un fingerprint se muestra cortado y
28
- * se copia entero, que es justamente por qué las dos cosas son props
29
- * distintas. */
27
+ /** How it looks, if it is not the value as is. A fingerprint is shown cut off and
28
+ * copied whole, which is precisely why the two things are different
29
+ * props. */
30
30
  children?: ReactNode;
31
- /** El valor es de máquina: id, hash, clave. Sin esto, tipografía normal. */
31
+ /** The value is a machine's: id, hash, key. Without this, normal typography. */
32
32
  mono?: boolean;
33
- /** Sólo el botón, sin el valor al lado. Para una celda o un encabezado donde
34
- * el valor ya está dibujado. */
33
+ /** Only the button, without the value beside it. For a cell or a header where
34
+ * the value is already drawn. */
35
35
  bare?: boolean;
36
36
  };
37
37
  /**
@@ -3,8 +3,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { useUiCopy } from "../../foundations/copy.js";
4
4
  import { Check, Copy } from "lucide-react";
5
5
  import { useEffect, useRef, useState } from "react";
6
- /** Cuánto dura el tilde. Dos segundos: alcanza para verlo sin que el botón se
7
- * quede en un estado que ya no es cierto. */
6
+ /** How long the tick lasts. Two seconds: enough to see it without the button
7
+ * staying in a state that is no longer true. */
8
8
  const CONFIRMED_FOR = 2000;
9
9
  /**
10
10
  * The button alone, for a value that is only known when it is pressed — what a field shows
@@ -15,8 +15,8 @@ export function CopyButton({ value, label, }) {
15
15
  const copy = useUiCopy();
16
16
  const [state, setState] = useState("idle");
17
17
  const timer = useRef(null);
18
- /* Se limpia al desmontar: sin esto, copiar y cerrar el panel antes de los dos
19
- segundos deja un `setState` apuntando a un componente que ya no existe. */
18
+ /* Cleared on unmount: without this, copying and closing the panel before the two
19
+ seconds leaves a `setState` pointing at a component that no longer exists. */
20
20
  useEffect(() => () => {
21
21
  if (timer.current !== null)
22
22
  clearTimeout(timer.current);
@@ -36,8 +36,8 @@ export function CopyButton({ value, label, }) {
36
36
  setState("done");
37
37
  }
38
38
  catch {
39
- /* Sin portapapeles —contexto no seguro, permiso negado— se DICE. Fingir
40
- que copió hace que alguien pegue lo que tenía antes sin enterarse. */
39
+ /* Without a clipboard —insecure context, permission denied— it SAYS so. Pretending
40
+ it copied makes someone paste what they had before without knowing. */
41
41
  setState("failed");
42
42
  }
43
43
  timer.current = setTimeout(() => setState("idle"), CONFIRMED_FOR);
@@ -64,8 +64,8 @@ export function Copyable({ value, children, mono = false, bare = false }) {
64
64
  if (bare)
65
65
  return button;
66
66
  return (
67
- /* El botón aparece con el puntero y ocupa lugar SIEMPRE: si apareciera de la
68
- nada, el valor se correría al pasar por encima, y un texto que se mueve
69
- cuando vas a seleccionarlo es peor que no tener botón. */
67
+ /* The button appears with the pointer and ALWAYS takes up space: if it appeared out of
68
+ nowhere, the value would shift on hover, and text that moves
69
+ when you go to select it is worse than having no button. */
70
70
  _jsxs("span", { className: "group/copy inline-flex min-w-0 items-center gap-1", children: [_jsx("span", { className: `min-w-0 truncate ${mono ? "font-mono" : ""}`, children: children ?? value }), _jsx("span", { className: "opacity-0 transition-opacity duration-(--duration-instant) group-hover/copy:opacity-100 focus-within:opacity-100", children: button })] }));
71
71
  }
package/dist/tokens.css CHANGED
@@ -461,19 +461,19 @@
461
461
  `ListingBar`. */
462
462
  --container-search: 30rem;
463
463
 
464
- /* Lo que PIDE una miga antes de recortarse, y lo que pide el rastro entero.
465
- Los dos son pedidos y no anchos: una línea más angosta se los baja, y una
466
- más ancha se los deja crecer.
467
-
468
- Hacen falta los dos porque son dos problemas distintos. Un nombre de este
469
- producto llega a cincuenta caracteres, así que UNA miga puede comerse la
470
- línea entera aunque el rastro tenga tres: `--container-crumb` es lo que
471
- cada una pide antes de terminar en «…», y ahí la que manda es la última
472
- —dónde estoy— que nunca se recorta del todo.
473
-
474
- `--container-trail` es lo que pide el rastro COMPLETO en la línea de la
475
- banda. Sin él, «de dónde vengo» le saca el lugar a lo que cuelga del
476
- registro y el centro deja de estar en el centro. */
464
+ /* What a crumb ASKS for before being clipped, and what the whole trail asks for.
465
+ Both are requests and not widths: a narrower line drops them, and a
466
+ wider one lets them grow.
467
+
468
+ Both are needed because they are two different problems. A name in this
469
+ product reaches fifty characters, so ONE crumb can eat the whole
470
+ line even if the trail has three: `--container-crumb` is what
471
+ each one asks for before ending in «…», and there the last one rules
472
+ —where I am— which is never clipped entirely.
473
+
474
+ `--container-trail` is what the COMPLETE trail asks for in the band's
475
+ line. Without it, «de dónde vengo» takes the room from what hangs off the
476
+ record and the centre stops being in the centre. */
477
477
  --container-crumb: 12rem;
478
478
  --container-trail: 20rem;
479
479
 
@@ -987,10 +987,10 @@
987
987
  color: var(--color-ink);
988
988
  font-family: var(--font-sans);
989
989
  -webkit-font-smoothing: antialiased;
990
- /* Sólo horizontal. Sacar el `overflow: hidden` entero destapó algo que se
991
- * desborda a los costados —un panel oculto fuera de pantalla, medido para
992
- * un ancho que ya no es el suyo— y sin este freno se podía scrollear hacia
993
- * la derecha para verlo. El alto sigue libre: es lo que se vino a arreglar. */
990
+ /* Horizontal only. Removing `overflow: hidden` entirely uncovered something that
991
+ * overflows sideways —a panel hidden off-screen, measured for
992
+ * a width that is no longer its own— and without this brake one could scroll to
993
+ * the right to see it. The height stays free: that is what was being fixed. */
994
994
  overflow-x: hidden;
995
995
  }
996
996