Repository navigation
v2.0.0 — Gridory
·
44 commits
to main
since this release
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
Upgrade
npm install gridory@2.0.0Breaking changes
- Tailwind preset: the default export now carries the
gdyprefix. The default export of
gridory/tailwind-presetis now the same ascreateGridoryPreset():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
InvalidPresetPrefixErrordo not change. - Table: columns keep a minimum width on narrow screens. Without
responsiveColumns, a column withwidth
keeps it and a column withoutwidthkeeps itsminWidthor 120px; the rows scroll sideways inside the table
instead of squeezing.minWidththerefore also counts before any resize. Thetableelement carries the sum as
--gdy-table-min-width. Tables withresponsiveColumnsdo not change. - Table: the actions column (⋯) is always 56px wide (96px with
rowActions.columnLabel), pinned or not, on
screen and printed withoutprintMode. 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-fnsand@date-fns/tzare no longer installed with Gridory. The names a screen reader
hears on the calendar buttons come from six newlabelskeys, in Spanish by default (1.x said them in English):
calendarNavigation,calendarPreviousMonth,calendarNextMonth,calendarChooseMonth,calendarChooseYear,
calendarToday. An app that types a fullDataTableLabels,KanbanBoardLabels,DataViewLabelsor
CardGridLabelsmust 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
theselectfield ofSignUpFormkeep 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: theSelectThemekeyscontentBackground,optionText,optionHoverBackground,
optionActiveBackground,contentClassNameanditemClassName; 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.
renderToStringandnext buildno longer fail with
window is not defined: a page withDataTable,KanbanBoardorCardGridcan be prerendered without
next/dynamicandssr: 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 withgetByRoleright
after the click (findByRolekeeps 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-selectedsays 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.0Cambios que rompen compatibilidad
- Preset de Tailwind: el export por defecto ahora lleva el prefijo
gdy. El export por defecto de
gridory/tailwind-presetahora es lo mismo quecreateGridoryPreset():bg-gdy-primary,
text-gdy-muted-foreground,rounded-gdy-lg, etc. El preset sin prefijo de la 1.x (bg-primaryyrounded-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 })eInvalidPresetPrefixErrorno cambian. - Tabla: las columnas conservan un ancho mínimo en pantallas angostas. Sin
responsiveColumns, una columna con
widthlo conserva y una sinwidthconserva suminWidtho 120 px; las filas se desplazan en horizontal dentro
de la tabla en lugar de achicarse. Por esominWidthtambién cuenta antes de redimensionar. El elementotable
lleva la suma en--gdy-table-min-width. Las tablas conresponsiveColumnsno cambian. - Tabla: la columna de acciones (⋯) mide siempre 56 px (96 px con
rowActions.columnLabel), fijada o no, en
pantalla y al imprimir sinprintMode. 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).
calendarLocalerecibe una etiqueta de idioma ("en-US") o{ code, options: { weekStartsOn } }, así que un
locale de date-fns sigue sirviendo.react-day-picker,date-fnsy@date-fns/tzya 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,DataViewLabelsoCardGridLabelscompleto 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 camposelectdeSignUpFormconservan 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 deSelectTheme
contentBackground,optionText,optionHoverBackground,optionActiveBackground,contentClassNamee
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 conuser.selectOptions.
Corregido
- La tabla se dibuja en el servidor.
renderToStringynext buildya no fallan conwindow is not defined:
una página conDataTable,KanbanBoardoCardGridse puede prerenderizar sinnext/dynamicnissr: 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 congetByRolejusto después del clic (findByRolesigue 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 dicearia-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.