Skip to content

v2.0.0 — Gridory

Choose a tag to compare

@VictorDiazJauregui VictorDiazJauregui released this 07 Nov 19:13
· 44 commits to main since this release
d62b066

Major release of Gridory. Only the changes listed under Breaking changes can require a change in your code;
each one has its section, with code before and after, in the
migration guide.

English · Español

English

Upgrade

npm install gridory@2.0.0

Breaking changes

  • Tailwind preset: the default export now carries the gdy prefix. The default export of
    gridory/tailwind-preset is now the same as createGridoryPreset(): bg-gdy-primary,
    text-gdy-muted-foreground, rounded-gdy-lg, and so on. The unprefixed preset of 1.x (bg-primary, rounded-lg
    mapped to Gridory tokens), deprecated since 1.1.0, is gone, and Tailwind does not warn about the classes it stops
    generating. The guide has the replacement table and a search command. createGridoryPreset({ prefix }) and
    InvalidPresetPrefixError do not change.
  • Table: columns keep a minimum width on narrow screens. Without responsiveColumns, a column with width
    keeps it and a column without width keeps its minWidth or 120px; the rows scroll sideways inside the table
    instead of squeezing. minWidth therefore also counts before any resize. The table element carries the sum as
    --gdy-table-min-width. Tables with responsiveColumns do not change.
  • Table: the actions column (⋯) is always 56px wide (96px with rowActions.columnLabel), pinned or not, on
    screen and printed without printMode. The other columns get the space it took in 1.x. To get the 1.x layout
    back: .gdy-table-grid { min-width: 0; } and .gdy-table-head-cell[data-column-id="_actions"] { width: auto; }.
  • Own calendar, without react-day-picker or date-fns. The date filter calendar looks and works with the
    keyboard as before, and month and day names come in any language (the browser writes them). calendarLocale
    takes a language tag ("en-US") or { code, options: { weekStartsOn } }, so a date-fns locale still works.
    react-day-picker, date-fns and @date-fns/tz are no longer installed with Gridory. The names a screen reader
    hears on the calendar buttons come from six new labels keys, in Spanish by default (1.x said them in English):
    calendarNavigation, calendarPreviousMonth, calendarNextMonth, calendarChooseMonth, calendarChooseYear,
    calendarToday. An app that types a full DataTableLabels, KanbanBoardLabels, DataViewLabels or
    CardGridLabels must add them. The calendar downloads 6.8 KB instead of 25.8.
  • Selects are the browser's <select>. The archived view, group, header selectors, page size, inline edit and
    the select field of SignUpForm keep the same closed box (size, colors, icon, placeholder), now
    <span class="gdy-select"><select class="gdy-select-trigger">; the open list is the system one and follows the
    dark theme. Removed: the SelectTheme keys contentBackground, optionText, optionHoverBackground,
    optionActiveBackground, contentClassName and itemClassName; the classes of the open list
    (gdy-select-content, -viewport, -item*, -scroll-*, -value) and their --gdy-select-content-* and
    --gdy-select-item-* tokens; .gdy-select-trigger[data-state="open"] no longer matches. Tests pick options with
    user.selectOptions.

Fixed

  • The table renders on a server. renderToString and next build no longer fail with
    window is not defined: a page with DataTable, KanbanBoard or CardGrid can be prerendered without
    next/dynamic and ssr: false.

Good to know

  • The row checkbox and the header help no longer download apart. Both come with the table from the first
    render, with the same look, keyboard and tooltip position; a test can read the tooltip with getByRole right
    after the click (findByRole keeps working). The checkbox markup does not change; the tooltip is no longer
    wrapped in [data-radix-popper-content-wrapper] (see the guide).
  • The first day of the week comes from the browser; Firefox cannot tell it, and there a tag starts on Monday
    ({ code: "en-US", options: { weekStartsOn: 0 } } sets it everywhere). A selected day's accessible name no longer
    ends in ", selected": aria-selected says it.
  • Bundle size of an app with the table and the kanban: JavaScript 142.1 KB gzip (147.7 in 1.5.0), calendar 6.8 KB
    (25.8), no separate checkbox or tooltip download (5.2 KB for apps that use them), CSS 18.3 KB (18.4).

See the migration guide; every
guide is linked from the README.

Español

Actualizar

npm install gridory@2.0.0

Cambios que rompen compatibilidad

  • Preset de Tailwind: el export por defecto ahora lleva el prefijo gdy. El export por defecto de
    gridory/tailwind-preset ahora es lo mismo que createGridoryPreset(): bg-gdy-primary,
    text-gdy-muted-foreground, rounded-gdy-lg, etc. El preset sin prefijo de la 1.x (bg-primary y rounded-lg
    apuntando a los tokens de Gridory), obsoleto desde la 1.1.0, ya no existe, y Tailwind no avisa de las clases que
    deja de generar. La guía trae la tabla de reemplazos y un comando para encontrarlas.
    createGridoryPreset({ prefix }) e InvalidPresetPrefixError no cambian.
  • Tabla: las columnas conservan un ancho mínimo en pantallas angostas. Sin responsiveColumns, una columna con
    width lo conserva y una sin width conserva su minWidth o 120 px; las filas se desplazan en horizontal dentro
    de la tabla en lugar de achicarse. Por eso minWidth también cuenta antes de redimensionar. El elemento table
    lleva la suma en --gdy-table-min-width. Las tablas con responsiveColumns no cambian.
  • Tabla: la columna de acciones (⋯) mide siempre 56 px (96 px con rowActions.columnLabel), fijada o no, en
    pantalla y al imprimir sin printMode. Las demás columnas reciben el espacio que se llevaba en la 1.x. Para volver
    a la disposición de la 1.x: .gdy-table-grid { min-width: 0; } y
    .gdy-table-head-cell[data-column-id="_actions"] { width: auto; }.
  • Calendario propio, sin react-day-picker ni date-fns. El calendario del filtro de fecha se ve y se usa con el
    teclado como antes, y los nombres de meses y días salen en cualquier idioma (los escribe el navegador).
    calendarLocale recibe una etiqueta de idioma ("en-US") o { code, options: { weekStartsOn } }, así que un
    locale de date-fns sigue sirviendo. react-day-picker, date-fns y @date-fns/tz ya no se instalan con Gridory.
    Los nombres que escucha un lector de pantalla en los botones del calendario salen de seis claves nuevas de
    labels, en español por defecto (la 1.x los decía en inglés): calendarNavigation, calendarPreviousMonth,
    calendarNextMonth, calendarChooseMonth, calendarChooseYear, calendarToday. Una app que tipa un
    DataTableLabels, KanbanBoardLabels, DataViewLabels o CardGridLabels completo tiene que agregarlas. El
    calendario descarga 6,8 KB en lugar de 25,8.
  • Los selectores son el <select> del navegador. La vista de archivadas, el agrupado, los selectores del
    encabezado, el tamaño de página, la edición en línea y el campo select de SignUpForm conservan la misma caja
    cerrada (tamaño, colores, ícono y placeholder), ahora <span class="gdy-select"><select class="gdy-select-trigger">;
    la lista abierta es la del sistema y sigue el tema oscuro. Se quitan las claves de SelectTheme
    contentBackground, optionText, optionHoverBackground, optionActiveBackground, contentClassName e
    itemClassName; las clases de la lista abierta (gdy-select-content, -viewport, -item*, -scroll-*,
    -value) y sus tokens --gdy-select-content-* y --gdy-select-item-*; .gdy-select-trigger[data-state="open"]
    ya no coincide con nada. Los tests eligen opciones con user.selectOptions.

Corregido

  • La tabla se dibuja en el servidor. renderToString y next build ya no fallan con window is not defined:
    una página con DataTable, KanbanBoard o CardGrid se puede prerenderizar sin next/dynamic ni ssr: false.

Para tener en cuenta

  • La casilla de las filas y la ayuda del encabezado ya no se descargan aparte. Las dos vienen con la tabla desde
    el primer render, con el mismo aspecto, el mismo teclado y la misma posición del tooltip; un test puede leer el
    tooltip con getByRole justo después del clic (findByRole sigue sirviendo). El marcado de la casilla no cambia;
    el tooltip ya no va dentro de [data-radix-popper-content-wrapper] (ver la guía).
  • El primer día de la semana lo da el navegador; Firefox no lo sabe, y ahí una etiqueta empieza en lunes
    ({ code: "en-US", options: { weekStartsOn: 0 } } lo fija en todos). El nombre accesible del día elegido ya no
    termina en ", selected": lo dice aria-selected.
  • Peso de una app con la tabla y el kanban: JavaScript 142,1 KB gzip (147,7 en la 1.5.0), calendario 6,8 KB (25,8),
    sin descarga aparte de la casilla ni del tooltip (5,2 KB para las apps que los usan), CSS 18,3 KB (18,4).

Ver la guía de migración; todas
las guías están enlazadas desde el README.