@1337exp/taoui 5.51.0 → 5.52.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
 
3
+ ## 5.52.0
4
+
5
+ One look changes by default: a `TaoLink` is underlined now. To keep the old look on a link: `<TaoLink underline="none">` (or `hover`). `TaoStretchedLink` keeps its look (no line); a crumb of `TaoBreadcrumb` gets the line under the pointer. The types of `TaoTable` got wider, nothing narrower: code that compiled still compiles (the default row type is `any` now, so a shared `TaoTableColumn[]` fits every table).
6
+
7
+ - **`TaoLink` is underlined, `underline="always" | "hover" | "none"`.** In the light theme the link colour is the text colour (`--tao-color-link` is black, 1.4:1 to the text; in the dark theme 1.1:1, the hue alone), so a link in a list or a line of text did not read as a link without the underline: not by sight and not by WCAG 1.4.1 (a link is told from text by a line or by 3:1). The line was only in `.tao-prose`. Now the link has the class `tao-link` and the line by default (the same one as `.tao-prose`: 1px, offset 0.18em); `hover` shows it only under the pointer and the focus (a menu entry, a card title, anything clear from its place), `none` never. The rule weighs one class, so a class of your own, written later, wins. `TaoStretchedLink` is `none` by default (the card is the sign of a link), a crumb of `TaoBreadcrumb` is `hover`. The «Contrast & keyboard» bench of the showcase rates the new pair «link on the page» (4.5:1) too. Found by an agent that made the cheat sheet ai-gen: it had added the line with its own CSS.
8
+ - **`TaoTable` is generic: a row can be an interface.** The rows were `Record<string, unknown>[]`, and an interface has no index signature, so `TaoTable :rows="flags"` with `interface Flag { … }` did not compile: the type had to be written as `type Flag = { … }`. Now `TaoTable<T>`: `T` comes from `rows` (an interface, a class, a plain object), `rows` and `columns` may be `readonly` (`as const` data, props), and the row is a `T` in the cell slots (`#cell-flag="{ row }"` knows `row.flag`), in `@row-click`, in `rowKey` and in `TaoTableColumn<T>.value(row)`. `columns` do not take part in the inference (`NoInfer`, TypeScript 5.4+), so the rows decide, and a list typed `TaoTableColumn[]` (the row type `any` by default) fits a table of any rows. `value` of a column is a method: a column of `Record` rows goes to a table of `Flag` rows too. New: the type `TaoTableRowKey`, the pure `tableCellValue` and `tableRowId` in `table.ts` (tested). Found by the cheat sheet ai-gen, where the agent had to give the flag its type with `type`.
9
+ - **`TaoTable` in a narrow place: `stack` and `minWidth`.** A table kept its columns as wide as the words allowed, so on a phone prose was squeezed into stacks of 100px (4 columns, a row 177px high), and the sideways scroll of its wrap began only after that. `stack`: under 600px of the table's own width (a container query on the wrap, so it follows the room it is given inside a shell, not the window; no JavaScript) every row is a card, each cell under its column label (`data-label`, with an empty alternative so a screen reader does not say it twice); the header stays in the DOM, hidden by sight, and the cells carry the table roles, so the table is still a table for a screen reader after it turned into blocks. The wrap needs a width of its own to be a container (it has `width: 100%`); in a shrink-to-fit parent give it one. `minWidth` (a number is px): the table is never narrower, and a narrower place scrolls it sideways; `stack` cards ignore it. A column takes `nowrap` (a code, a date, a flag) and its own `minWidth`. The alignment of a column is now the private variable `--_tao-align` read by `text-align` (it was the inline `text-align`), so the cards put everything at the start; nothing changes by sight. Found by the cheat sheet ai-gen, where a wrapper with `min-width` and `overflow-x` had to do it.
10
+ - **The rows of a `clickable` `TaoTable` work from the keyboard.** A row was a `<tr>` with only `@click`: no `tabindex`, no key, so with the keyboard a list of records could not be opened at all. Now the table is one Tab stop (a roving `tabindex`: the first row, then the row that had the focus last), the arrows and Home / End walk the rows (no wrap at the ends, as in `TaoList roving`), Enter and Space emit `row-click` as a click does (Space does not scroll the page), and the focused row has a tint and a bar of 2px in the accent at its start (on every cell of a `stack` card). Not a ring: a ring is a rectangle, and the rounded frame of the table cut its corners on the first and the last row, while a fill is clipped by the frame cleanly; the bar is on the logical edge, so in RTL it is at the right. A key that comes from a control inside the row (a button, a field, a menu) stays with that control and is not a row click. A click with the mouse is as before: a click on a button in a row still reaches `row-click` (stop it with `@click.stop` on the button). The pure step is `tableRowTarget` in `table.ts`. For a screen reader a row stays a row: when the action matters, also put a real link or button in the row. Found while reading `TaoTable` for the cheat sheet ai-gen.
11
+
3
12
  ## 5.51.0
4
13
 
5
14
  Nothing to migrate: `menu`, `hint`, `tone` and `@move` are new and do nothing until set; Enter on a folder now also opens or closes it. One look changes by default: the selected row of a tree without the focus is grey (`--tao-color-hover`) instead of the accent; to keep the accent always, `.my-tree:not(:focus-within) .tao-tree__row--selected { background: var(--tao-color-accent-subtle); color: var(--tao-color-accent-text); }`. The corners are softer and the scrollbars a pixel thicker (below); the old look is `:root { --tao-radius-sm: 4px; --tao-radius-md: 8px; --tao-radius-lg: 12px; --tao-radius-control: 4px; --tao-radius-panel: 8px; --tao-scrollbar-size: 5px; }`.
package/README.md CHANGED
@@ -114,7 +114,7 @@
114
114
 
115
115
  ### Data display
116
116
 
117
- - **TaoTable** — simple table: columns, empty, loading, sort via `v-model:sort`. `head` tints the header, `lines` draws row rules (both on by default). `striped` starts on the first row; `striped="even"` starts on the second. Not a datagrid.
117
+ - **TaoTable** — simple table: columns, empty, loading, sort via `v-model:sort`. `head` tints the header, `lines` draws row rules (both on by default). `striped` starts on the first row; `striped="even"` starts on the second. `clickable` rows work from the keyboard (one Tab stop, the arrows walk the rows, Enter and Space click). In a narrow place: `stack` turns each row into a card under 600px of the table's own width (a container query), `minWidth` keeps the table readable and scrolls it sideways; a column can be `nowrap` or have its own `minWidth`. Generic: the row type comes from `rows` (an interface, a class, a `readonly` array all do) and types the slots and `row-click`; `TaoTableColumn<T>`. Not a datagrid.
118
118
  - **TaoSparkline** / **TaoMeter** / **TaoDonut** — small charts for a card or a line of text: a trend (`values` with `null` gaps, `area`, `dot`), a measured value in a range (`role="meter"`, coloured by `low` / `high` / `optimum` as the HTML `<meter>`), a share of a whole (`segments`, or one `value` of `max`, `legend`, a centre slot). The series colours are the roles `--tao-color-chart-1…6` (the first is the accent, so palettes recolour them). For axes and tooltips use a chart library: `taoChartTheme()` gives it the theme colours as `rgb()`, `watchTaoChartTheme(apply)` re-applies them on a theme or palette change
119
119
  - **TaoHeatmap** — a value for each pair of two things (orders by weekday and hour): `values` by `rows` × `cols`, the colour by thresholds (`steps`, round numbers by default) that the legend names («500+»), the faint levels striped, a tip with the exact number. A `role="grid"` the arrows move through, a screen reader reads the row, the column and the number; it fits its container and shows the column names as often as they fit
120
120
  - **TaoPagination** — pages with ellipsis. Clicking “…” jumps `jump` pages (5 by default). `pageSizes` adds a «Per page» choice (`v-model:page-size`); the first row on screen stays on screen
@@ -137,7 +137,7 @@
137
137
 
138
138
  ### Navigation
139
139
 
140
- - **TaoLink** — `<NuxtLink>` in Nuxt, `<RouterLink>` with vue-router, otherwise a plain `<a>` — no extra setup
140
+ - **TaoLink** — `<NuxtLink>` in Nuxt, `<RouterLink>` with vue-router, otherwise a plain `<a>` — no extra setup. Underlined by default (in the light theme a link is the text colour, so the line is the only sign of it); `underline="hover"` for a link that is clear from its place, `"none"` for no line
141
141
  - **TaoStretchedLink** — a `TaoLink` that makes a whole card or row one link while the buttons inside it still work: `tao-stretched` on the container, `tao-stretched-raise` on a control that must stay clickable by itself. The keyboard sees one link and its focus ring goes round the container (`--tao-stretched-radius`). Never put `filter` / `transform` on the link: the layer would shrink under the pointer and the cursor would flicker The text under the stretched layer cannot be selected with the mouse (lift what must be selectable with `tao-stretched-raise`), and the link is named only by what is written in it: for a card, point `aria-describedby` of the link at the description.
142
142
  - **TaoBreadcrumb** — crumbs: the last item is the current page
143
143
  - **TaoDropdownMenu** / **TaoMenu** — a menu from a plain data tree `items`: submenus, checkboxes, radios, separators, group labels, shortcuts to show, disabled items. Arrows, Home / End, type-ahead, `→` / `←` for submenus, Esc closes the top level first. `TaoMenu` is the panel itself, for your own shells (a menu bar, a context menu); its `anchor` is an element or a point `{ x, y }` of the screen (a menu at the pointer or at a drop point, no anchor element; `TaoPopover` takes the same `anchor`); flips at the viewport edge; `size` makes the button a compact square, `dots="horizontal"` lays the three dots down (⋯), `:tabbable="false"` takes it out of the Tab order `block` makes the button of `TaoDropdownMenu` fill its place and draw nothing of its own, for a trigger that is a whole chip of yours in `#button` (the project under the main action of TaoNav).
package/README.ru.md CHANGED
@@ -114,7 +114,7 @@
114
114
 
115
115
  ### Отображение данных
116
116
 
117
- - **TaoTable** — простая таблица: колонки, empty, loading, сортировка через `v-model:sort`. `head` — подсветка шапки, `lines` — линии между рядами (оба по умолчанию включены). `striped` — зебра с первой строки, `striped="even"` — со второй. Не datagrid.
117
+ - **TaoTable** — простая таблица: колонки, empty, loading, сортировка через `v-model:sort`. `head` — подсветка шапки, `lines` — линии между рядами (оба по умолчанию включены). `striped` — зебра с первой строки, `striped="even"` — со второй. Строки `clickable` работают с клавиатуры (одна остановка Tab, стрелки ходят по строкам, Enter и Space нажимают). В узком месте: `stack` делает каждую строку карточкой при ширине самой таблицы меньше 600px (контейнерный запрос), `minWidth` оставляет таблицу читаемой и прокручивает вбок; колонка может быть `nowrap` или со своим `minWidth`. Обобщённая: тип строки берётся из `rows` (подойдут interface, класс, `readonly`-массив) и типизирует слоты и `row-click`; `TaoTableColumn<T>`. Не datagrid.
118
118
  - **TaoSparkline** / **TaoMeter** / **TaoDonut** — маленькие графики для карточки или строки текста: тренд (`values` с разрывами `null`, `area`, `dot`), измеренное значение в диапазоне (`role="meter"`, цвет по `low` / `high` / `optimum`, как у HTML `<meter>`), доля целого (`segments` или одно `value` из `max`, `legend`, слот в центре). Цвета серий — роли `--tao-color-chart-1…6` (первый — акцент, поэтому палитры их перекрашивают). Для осей и подсказок берите библиотеку графиков: `taoChartTheme()` отдаёт ей цвета темы в `rgb()`, `watchTaoChartTheme(apply)` применяет их заново при смене темы или палитры
119
119
  - **TaoHeatmap** — значение для каждой пары (заказы по дню недели и часу): `values` по `rows` × `cols`, цвет по порогам (`steps`, по умолчанию круглые числа), которые называет легенда («500+»), бледные уровни в полоску, подсказка с точным числом. `role="grid"`, по которому ходят стрелками; скринридер читает строку, столбец и число; занимает ширину контейнера и показывает имена столбцов так часто, как они помещаются
120
120
  - **TaoPagination** — страницы с многоточием. Клик по «…» прыгает на `jump` страниц (5 по умолчанию). `pageSizes` добавляет выбор «На странице» (`v-model:page-size`); первая видимая строка остаётся на экране
@@ -137,7 +137,7 @@
137
137
 
138
138
  ### Навигация и взаимодействие
139
139
 
140
- - **TaoLink** — `<NuxtLink>` в Nuxt, `<RouterLink>` при vue-router, иначе обычный `<a>` — без дополнительной настройки
140
+ - **TaoLink** — `<NuxtLink>` в Nuxt, `<RouterLink>` при vue-router, иначе обычный `<a>` — без дополнительной настройки. Подчёркнут по умолчанию (в светлой теме ссылка цвета текста, и линия — единственный её признак); `underline="hover"` для ссылки, понятной по месту, `"none"` без линии
141
141
  - **TaoStretchedLink** — `TaoLink`, который делает целую карточку или строку одной ссылкой, а кнопки внутри продолжают работать: `tao-stretched` на контейнере, `tao-stretched-raise` на элементе, который должен нажиматься сам. Клавиатура видит одну ссылку, кольцо фокуса идёт по контейнеру (`--tao-stretched-radius`). Не давайте ссылке `filter` / `transform`: слой сожмётся под курсором, и курсор начнёт мигать Текст под растянутым слоем нельзя выделить мышью (то, что должно выделяться, поднимите через `tao-stretched-raise`), а имя ссылке даёт только то, что в ней написано: для карточки направьте `aria-describedby` ссылки на описание.
142
142
  - **TaoBreadcrumb** — крошки: последний пункт — текущая страница
143
143
  - **TaoDropdownMenu** / **TaoMenu** — меню из простого дерева данных `items`: подменю, чекбоксы, радио, разделители, подписи групп, сочетания для показа, недоступные пункты. Стрелки, Home / End, быстрый поиск по букве, `→` / `←` для подменю, Esc закрывает верхний уровень первым. `TaoMenu` — сама панель для своих оболочек (полоса меню, контекстное меню); её `anchor` — элемент или точка экрана `{ x, y }` (меню у указателя или в точке сброса, без элемента-якоря; `TaoPopover` принимает тот же `anchor`); у края экрана переворачивается; `size` делает кнопку компактным квадратом, `dots="horizontal"` кладёт три точки горизонтально (⋯), `:tabbable="false"` убирает её из порядка Tab `block` растягивает кнопку `TaoDropdownMenu` на её место и снимает с неё всё своё, для кнопки, которая целиком ваша «фишка» в `#button` (проект под главным действием TaoNav).