@1337exp/taoui 5.30.2 → 5.32.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,26 @@
1
1
  # Changelog
2
2
 
3
+ ## 5.32.0
4
+
5
+ Nothing to migrate, but two looks change: `TaoThemeToggle` is neutral now (it was amber; `tone="accent"` brings the old colour back), and a quiet control with `tone="neutral"` is the body colour at rest (it was white).
6
+
7
+ - **The text ladder is a contract now, and `neutral` follows it.** The kit has five steps of text (`text-strong`, `text`, `text-subtle`, `text-muted`, `text-disabled`), and the Guide says what each is for: strong for headings, titles and the value that is the point; `text` for body copy and every control at rest; muted for hints and captions; hover goes one step up; the accent is for the main action, the selected and the focus. The tone `neutral` broke it: its text was `text-strong` at rest, so a `ghost` / `text` / `secondary` button with `tone="neutral"` was white against the grey `#bfbfbf` of the page text and of a plain `secondary` button. Now `--tao-tone-text` of `neutral` is `text` and `--tao-tone-text-hover` is `text-strong` (a neutral tag and a pressed neutral toggle read in the body colour too). `TaoScrollTop` `ghost` / `text` went from strong to `text` at rest for the same reason. The Guide has the ladder table and a do / don't (`#patterns`), `SKILL.md` and `patterns.md` carry it, and `tests/textContract.test.ts` fails when a component sets `text-strong` on a control at rest without being listed.
8
+
9
+ - **`TaoPresetInput`: a field with presets.** A compact input, a block of two arrows and a narrow pop-up, as the font size or the zoom of an editor. The input and the arrows are one piece (the same fill, the frame only while the field is edited); the pop-up is not a dropdown, it is centred under the input and the focus stays in the input. The arrows walk `options` in their order («up» is the next one, «down» the previous one) and hold at the ends, or go round with `loop`. The option with `default: true` is what an empty field means («Auto»): the pop-up shows it first, the arrows reach it after the last one. A whole number typed by hand is a value too (`custom`, between `min` and `max`; off: only the presets), and the arrows then go to the nearest preset. Keys: ↑ ↓ step, Home End go to the ends (while no text is being typed), Enter applies, Esc throws the text away; **Tab applies the text and goes on**: the pop-up is not a stop. The input is `role="combobox"` with `aria-controls` and `aria-activedescendant` (the picked option), the arrows are not tab stops and are named by the locale. `aria-label`, `name` and listeners reach the input, `class` and `style` the wrapper; the width of the input is `--tao-preset-input-width`. The logic (`presetLine`, `stepPreset`, `parsePreset`) is in `src/presetInput.ts` with its own tests. It began as a demo of the showcase built from `TaoInput` and a hand-made pop-up.
10
+ - **`TaoThemeToggle` `system`: the third state, a monitor.** With `system` the click goes system → light → dark → system, and the page follows the operating system (`prefers-color-scheme`) while «system» is picked, live. The icon is the state the toggle is in (a monitor, a sun, a moon), the `aria-label` says where the click leads (new `toSystemLabel`, the locale has it). `v-model` takes and gives `'system'` too; the page itself always gets `dark` or `light` in `data-tao-mode`, and `data-tao-mode-choice="system"` marks that it is the system's, so a remounted toggle shows the monitor again. The `#icon` slot gets `choice` and `next` is a choice now. Without `system` nothing changes. New: the `tao-monitor` icon (43 built in), `resolveTaoMode()`, `systemTaoMode()` and the `TaoModeChoice` type, for an app that applies the mode itself (`:apply="false"`).
11
+ - **`TaoCombobox` shows the whole list when it opens over a picked value.** The field holds the picked label, and the list was filtered by it, so a list of sizes opened on «Auto» showed only «Auto». Now the list is filtered only after the user types; opening, the arrows and the picked value show every option.
12
+ - **`TaoThemeToggle` is neutral by default, and has `tone`.** The toggle is a ghost button, and a ghost button without a tone is accent-coloured, so the theme switch was the one amber thing in a toolbar of quiet `ghost` + `neutral` tools, against the guide (the accent is for the one main action, the selected item and the focus). It is `neutral` now; `tone` goes to the button as for `TaoButton`, `tone="accent"` gives the old look.
13
+ - **`TaoThemeToggle` with the `#icon` slot: the glyph is centred.** The button kept the padding of a text button and the content sat on a text line, so the glyph stood 1.5px too high; the square is a square now.
14
+
15
+ ## 5.31.0
16
+
17
+ Nothing to migrate: `overflow` is off by default, and a toolbar without it works as before.
18
+
19
+ - **`TaoToolbar` `overflow`: one row, the rest under «⋮».** The bar no longer wraps onto a second line (the height jumped, a phone lost half the screen). The `TaoToolbarGroup`s that do not fit go, the last one first, each with the separator before it, under a «⋮» button that shows only when something is hidden and opens them in a panel. They are the same elements as in the bar, teleported, not copies: a toggle keeps its state, `pressed`, `disabled`, `title`, `shortcut` and events work as they did. A group with `pinned` never goes; loose items (a `TaoSegmented`, a lone button) stay too. Only whole groups go, and only in a horizontal bar. The bar is measured before the first paint and follows the width (`ResizeObserver`), the set of groups and the size; the width of a group that went is remembered from when it was in the row. Without `window` (SSR) every group is drawn as it is.
20
+ - **Keys and focus.** `role="toolbar"` stays; the arrows, Home and End walk the visible buttons and «⋮» (a folded group is not a stop). «⋮» is a button with `aria-label` (`overflowLabel`, the locale says «More» / «Ещё»), `aria-haspopup="dialog"` and `aria-expanded`; Enter / Space opens the panel, the first button gets the focus, Escape closes it and gives the focus back to «⋮». A press outside closes it, except on a panel above it (a list opened by a button inside it) and on what carries `data-tao-keep-open`. If the button that had the focus goes under «⋮» as the bar narrows, the focus moves to «⋮» instead of vanishing.
21
+ - **A list that hangs from a button of a folded group.** The button is the same element in the bar and in the panel, so what hangs from it (`TaoPopover`, your own list) is anchored to what the person sees. For opening a list from the keyboard shortcut of a button that is folded, `toolbar.reveal(el)` (through a ref) opens the panel if needed and returns the same element.
22
+ - **`TaoToolbar` with `overflow` fills the width it is given** (`width: 100%`), not `fit-content`: that width is what it measures, and a bar that shrank with the folded groups would never unfold them.
23
+
3
24
  ## 5.30.2
4
25
 
5
26
  Nothing to migrate; the text of the skill only.
package/README.md CHANGED
@@ -59,7 +59,7 @@
59
59
  - **TaoButton** — `variant`: `primary` / `secondary` / `ghost` / `text`; `tone` colours any of them (accent by default, neutral, success, danger, warning, info). `v-model:pressed` makes it a toggle (`aria-pressed`); `shortcut="N"` shows the key at the end of the button (`aria-keyshortcuts`; listening to it is the app's job)
60
60
  - **TaoCard** — card with media / header / title / footer slots and a `#corner` (a tag, a menu button). `#media` can be a photo or `TaoCarousel`; `closable` adds a cross and the `close` event. `flush` is a tile (no padding/shadow, fills the cell); `#overlay` is a scrim on the media; `stripe="top | left | bottom"` with `stripeTone` (a tone or the palette `gradient`) draws a coloured stripe the corners clip
61
61
  - **TaoCopy** — clipboard icon. After a click, a “Copied” tooltip; if the trigger is gone, the tooltip is too
62
- - **TaoThemeToggle** — the light / dark switch as one icon button (a sun or a moon); reads and flips `data-tao-mode` of `<html>`, or works from `v-model`
62
+ - **TaoThemeToggle** — the light / dark switch as one icon button (a sun or a moon); reads and flips `data-tao-mode` of `<html>`, or works from `v-model`; `system` adds a third, «follow the system» state (a monitor)
63
63
  - **TaoTour** — a guided tour: the page goes dim, the target stays lit, a card with an arrow says what it is (a step without a target is a card in the middle; `interactive` lets the user press the target). It only draws: the steps come from you or from TaoUX `tour`
64
64
  - **TaoMarquee** — one line that never wraps: when it does not fit it runs round with fading edges and a pause at the start of every round, when it fits it stands still. Stops on hover, on focus and on a tap (WCAG 2.2.2); wraps with «reduce motion»; a screen reader reads it once. `text` or inline content in the slot, `speed`, `gap`, `fade` (the left fade takes that much room left of the text: give the parent the padding), `paused`, `pauseOnHover`, `roundPause` (`false`: no rest at the start of a round), `decorative` (a ghost for a background line: hidden from a screen reader, no tab stop, no reaction to a cursor or a tap, no selection, no pause between rounds)
65
65
  - **TaoInput** — text field with v-model, validation, and `#prefix` / `#suffix` slots (icon or text inside the frame); `variant` `outline` / `filled` / `plain` (no frame: an item of a list being edited; `TaoInputNumber`, `TaoCombobox` and `TaoTextarea` take it too)
@@ -92,6 +92,7 @@
92
92
  - **TaoRadio** / **TaoRadioGroup** — classic radios: longer labels, can stack vertically
93
93
  - **TaoSegmented** / **TaoSegmentedOption** — compact exclusive choice among 2–5 short options. Not tabs
94
94
  - **TaoSelect** — dropdown with keyboard, same chrome as Input. `size` (`small` / `medium` / `large`, same scale as Button). Clear via “Clear” in the list or Delete; `clearable="false"` turns clearing off, `#clear` replaces the row content
95
+ - **TaoPresetInput** — a field with presets, as in an editor (font size, zoom): a compact input, a block of two arrows and a narrow pop-up. The arrows walk the `options` (`default: true` marks what an empty field means, «Auto»; `loop` joins the ends), a number typed by hand is a value too (`custom`); Tab applies and goes on
95
96
  - **TaoCombobox** — Select with a field: type to filter, `allow-create` writes a custom value into `v-model`, `create` lets the parent append the list. Takes the same `size`, `clearable` and `#clear` as `TaoSelect`
96
97
  - **TaoDate** — a single day: `YYYY-MM-DD`, no time, no timezone. Calendar popup like Select. `editable` makes it a field you type into: `5`, `5.3`, `05.03.26` in the locale's order of day and month (`parseTaoDateInput` is exported, `parse` / `format` take your own)
97
98
  - **TaoDateRange** — a period: `v-model` is `{ start, end }` or `null`. First click is start, second is end (they swap if end is earlier). An incomplete pick is not written to the model
@@ -127,7 +128,7 @@
127
128
  - **TaoScrubber** — play / pause, a slider over time with event marks, a “time / length” label. Does not advance time by itself: drive `v-model` with your own clock
128
129
  - **TaoLoader** — the wait whose end is unknown: `variant` `dots` (default) / `ring` / `pulse` / `diamonds`, `tone`, `size` (a number or small / medium / large), says "Loading" to a screen reader (`label`), breathes under reduced motion; `TaoButton loading` wears the same ring
129
130
  - **TaoImage** — `<img>` wrapper: fade-in and placeholder. `lazy` turns on native `loading="lazy"`
130
- - **TaoIcon** — SVG icons (42 built in, your own via `registerTaoIcons`) or an icon font (see Icons below)
131
+ - **TaoIcon** — SVG icons (43 built in, your own via `registerTaoIcons`) or an icon font (see Icons below)
131
132
 
132
133
  ### Navigation
133
134
 
@@ -136,7 +137,7 @@
136
137
  - **TaoBreadcrumb** — crumbs: the last item is the current page
137
138
  - **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); flips at the viewport edge; `size` makes the button a compact square, `:tabbable="false"` takes it out of the Tab order
138
139
  - **TaoMenubar** / **TaoContextMenu** — the menu bar of an editor and the menu on the right click, on `TaoMenu`. The bar is one tab stop (`role="menubar"`): `←` / `→` walk it, `↓` / Enter open, with a menu open `←` / `→` and the pointer move to the neighbour menu; an entry without `items` is a plain action. The context menu opens at the pointer (or at the element for the Menu key / Shift+F10) and wraps its content without a box of its own
139
- - **TaoToolbar** / **TaoToolbarGroup** / **TaoToolbarSeparator** — a bar of tools (`role="toolbar"`): one tab stop, `←` / `→` (or `↑` / `↓` when `orientation="vertical"`) walk the items, Home / End; inside a `TaoSegmented` the arrows pick the option and go on from its edge. Groups are split by a thin line across the bar; `inset` puts a sunken pill behind a group. Toggles are `TaoButton` with `v-model:pressed`
140
+ - **TaoToolbar** / **TaoToolbarGroup** / **TaoToolbarSeparator** — a bar of tools (`role="toolbar"`): one tab stop, `←` / `→` (or `↑` / `↓` when `orientation="vertical"`) walk the items, Home / End; inside a `TaoSegmented` the arrows pick the option and go on from its edge. Groups are split by a thin line across the bar; `inset` puts a sunken pill behind a group. Toggles are `TaoButton` with `v-model:pressed`. `overflow` keeps the bar in one row: the groups that do not fit go, the last one first, under a «⋮» button that opens them in a panel (the same buttons, not copies); a `TaoToolbarGroup` with `pinned` stays
140
141
  - **TaoScrollTop** — floating “back to top”: `solid` / `ghost` / `text` looks, `side`, a mouse-hover `label`. Appears on reverse scroll after `boundary`
141
142
 
142
143
  ### Feedback
@@ -220,9 +221,9 @@ The package ships a skill, `skills/taoui/SKILL.md` with `references/components.m
220
221
 
221
222
  ## Icons
222
223
 
223
- The library ships **42 SVG icons** (check, close, plus, minus, chevrons, arrows, search, eye, more, grip, play, pause,
224
+ The library ships **43 SVG icons** (check, close, plus, minus, chevrons, arrows, search, eye, more, grip, play, pause,
224
225
  skip-back, copy, calendar, info, alert, circles, folder, file, alignment, and the app actions settings, edit, trash, bell, tag,
225
- repeat, undo, redo, sun, moon). They draw on `currentColor`, so an icon takes the text colour and the
226
+ repeat, undo, redo, sun, moon, monitor). They draw on `currentColor`, so an icon takes the text colour and the
226
227
  font size, and live under the reserved prefix `tao-`: `<TaoIcon name="tao-check" />`, the list is `taoIconNames`.
227
228
 
228
229
  ```vue
package/README.ru.md CHANGED
@@ -59,7 +59,7 @@
59
59
  - **TaoButton** — кнопка. `variant`: `primary` / `secondary` / `ghost` / `text`; `tone` красит любой из них (по умолчанию акцент, neutral, success, danger, warning, info). `v-model:pressed` делает её переключателем (`aria-pressed`); `shortcut="N"` показывает клавишу в конце кнопки (`aria-keyshortcuts`; слушать её — дело приложения)
60
60
  - **TaoCard** — карточка со слотами media / header / title / footer и `#corner` (тег, кнопка меню). В `#media` — фото или `TaoCarousel`; `closable` добавляет крестик и событие `close`. `flush` — плитка без padding/тени на всю ячейку; `#overlay` — scrim на media; `stripe="top | left | bottom"` со `stripeTone` (тон или `gradient` палитры) рисует цветную полосу, которую обрезают углы
61
61
  - **TaoCopy** — иконка копирования в буфер. После клика сверху тултип «Скопировано»; если кнопку убрали — тултип тоже
62
- - **TaoThemeToggle** — переключатель светлой / тёмной темы одной кнопкой-иконкой (солнце или луна); читает и переворачивает `data-tao-mode` у `<html>` либо работает от `v-model`
62
+ - **TaoThemeToggle** — переключатель светлой / тёмной темы одной кнопкой-иконкой (солнце или луна); читает и переворачивает `data-tao-mode` у `<html>` либо работает от `v-model`; `system` добавляет третье состояние «как в системе» (монитор)
63
63
  - **TaoTour** — тур по странице: страница затемняется, цель остаётся освещённой, карточка со стрелкой говорит, что это (шаг без цели — карточка посередине; `interactive` даёт нажать на цель). Только рисует: шаги ваши или из TaoUX `tour`
64
64
  - **TaoMarquee** — одна строка без переносов: не помещается — бежит по кругу с гаснущими краями и паузой в начале каждого круга, помещается — стоит. Останавливается при наведении, фокусе и тапе (WCAG 2.2.2); при «уменьшить движение» переносится; скринридер читает один раз. `text` или строчное содержимое в слоте, `speed`, `gap`, `fade` (левое затухание занимает столько места слева от текста: дайте родителю такой padding), `paused`, `pauseOnHover`, `roundPause` (`false`: без паузы в начале круга), `decorative` (призрак для строки-фона: скрыта от скринридера, не остановка Tab, не реагирует на курсор и тап, не выделяется, без пауз между кругами)
65
65
  - **TaoInput** — поле ввода с поддержкой v-model, валидации и слотов `#prefix` / `#suffix` (иконка или текст внутри рамки); `variant` `outline` / `filled` / `plain` (без рамки: пункт списка в правке; его берут и `TaoInputNumber`, `TaoCombobox`, `TaoTextarea`)
@@ -92,6 +92,7 @@
92
92
  - **TaoRadio** / **TaoRadioGroup** — классические радиокнопки: длинные подписи, можно столбиком
93
93
  - **TaoSegmented** / **TaoSegmentedOption** — компактный выбор из 2–5 коротких вариантов. Не вкладки
94
94
  - **TaoSelect** — выпадающий список с клавиатурой, тот же визуал, что у Input. `size` (`small` / `medium` / `large`, та же шкала, что у Button). Сброс — «Очистить» в списке или Delete; `clearable="false"` отключает сброс, слот `#clear` заменяет содержимое строки
95
+ - **TaoPresetInput** — поле с заготовками, как в редакторе (размер шрифта, масштаб): компактное поле, блок из двух стрелок и узкое окно. Стрелки ходят по `options` (`default: true` — что значит пустое поле, «Авто»; `loop` замыкает концы), число, набранное руками, тоже значение (`custom`); Tab применяет и идёт дальше
95
96
  - **TaoCombobox** — Select с полем: фильтр по вводу, `allow-create` пишет своё в `v-model`, `create` — чтобы родитель дополнил список. Те же `size`, `clearable` и `#clear`, что у `TaoSelect`
96
97
  - **TaoDate** — один день: `YYYY-MM-DD`, без часов и пояса. Календарь как у Select. `editable` делает его полем для ввода: `5`, `5.3`, `05.03.26` в порядке дня и месяца языка (`parseTaoDateInput` экспортируется, `parse` / `format` принимают свои)
97
98
  - **TaoDateRange** — период: `v-model` — `{ start, end }` или `null`. Первый клик — начало, второй — конец (если конец раньше — меняются местами). Неполный выбор в модель не пишется
@@ -127,7 +128,7 @@
127
128
  - **TaoScrubber** — play / pause, слайдер по времени с метками событий, подпись «время / длина». Время сама не двигает: ведите `v-model` своими часами
128
129
  - **TaoLoader** — ожидание, конца которого не знаем: `variant` `dots` (по умолчанию) / `ring` / `pulse` / `diamonds`, `tone`, `size` (число или small / medium / large), говорит «Загрузка» скринридеру (`label`), при «уменьшить движение» дышит; `TaoButton loading` носит то же кольцо
129
130
  - **TaoImage** — обёртка над `<img>`: fade-in и плейсхолдер. `lazy` включает нативный `loading="lazy"`
130
- - **TaoIcon** — SVG-иконки (42 встроенных, свои через `registerTaoIcons`) или icon-шрифт (см. раздел «Иконки» ниже)
131
+ - **TaoIcon** — SVG-иконки (43 встроенных, свои через `registerTaoIcons`) или icon-шрифт (см. раздел «Иконки» ниже)
131
132
 
132
133
  ### Навигация и взаимодействие
133
134
 
@@ -136,7 +137,7 @@
136
137
  - **TaoBreadcrumb** — крошки: последний пункт — текущая страница
137
138
  - **TaoDropdownMenu** / **TaoMenu** — меню из простого дерева данных `items`: подменю, чекбоксы, радио, разделители, подписи групп, сочетания для показа, недоступные пункты. Стрелки, Home / End, быстрый поиск по букве, `→` / `←` для подменю, Esc закрывает верхний уровень первым. `TaoMenu` — сама панель для своих оболочек (полоса меню, контекстное меню); у края экрана переворачивается; `size` делает кнопку компактным квадратом, `:tabbable="false"` убирает её из порядка Tab
138
139
  - **TaoMenubar** / **TaoContextMenu** — полоса меню редактора и меню по правой кнопке, на `TaoMenu`. Полоса — одна остановка Tab (`role="menubar"`): `←` / `→` ходят по ней, `↓` / Enter открывают, при открытом меню `←` / `→` и указатель переходят к соседнему; пункт без `items` — обычное действие. Контекстное меню открывается у указателя (или у элемента для клавиши Menu / Shift+F10) и оборачивает содержимое без своей коробки
139
- - **TaoToolbar** / **TaoToolbarGroup** / **TaoToolbarSeparator** — панель инструментов (`role="toolbar"`): одна остановка Tab, `←` / `→` (или `↑` / `↓` при `orientation="vertical"`) ходят по элементам, Home / End; внутри `TaoSegmented` стрелки выбирают вариант и идут дальше с его края. Группы делит тонкая черта поперёк панели; `inset` кладёт под группу утопленную подложку. Переключатели — `TaoButton` с `v-model:pressed`
140
+ - **TaoToolbar** / **TaoToolbarGroup** / **TaoToolbarSeparator** — панель инструментов (`role="toolbar"`): одна остановка Tab, `←` / `→` (или `↑` / `↓` при `orientation="vertical"`) ходят по элементам, Home / End; внутри `TaoSegmented` стрелки выбирают вариант и идут дальше с его края. Группы делит тонкая черта поперёк панели; `inset` кладёт под группу утопленную подложку. Переключатели — `TaoButton` с `v-model:pressed`. `overflow` держит панель в одной строке: группы, которые не влезли, уходят (последняя первой) под кнопку «⋮», она открывает их в панели (те же кнопки, а не копии); `TaoToolbarGroup` с `pinned` остаётся
140
141
  - **TaoScrollTop** — плавающая кнопка «наверх»: виды `solid` / `ghost` / `text`, `side`, подпись `label` при наведении мыши. Появляется при обратном скролле после `boundary`
141
142
 
142
143
  ### Обратная связь
@@ -221,9 +222,9 @@ Container живёт на другой оси — ширина: `width="wide" |
221
222
 
222
223
  ## Иконки
223
224
 
224
- Библиотека поставляет **42 SVG-иконки** (галочка, крестик, плюс, минус, шевроны, стрелки, поиск, глаз, «ещё», ручка,
225
+ Библиотека поставляет **43 SVG-иконки** (галочка, крестик, плюс, минус, шевроны, стрелки, поиск, глаз, «ещё», ручка,
225
226
  play, pause, skip-back, копия, календарь, info, alert, кружки, папка, файл, выравнивание и действия приложения: настройки,
226
- правка, корзина, колокольчик, тег, повтор, отменить, повторить, солнце, луна). Они рисуются через `currentColor`: иконка берёт цвет и
227
+ правка, корзина, колокольчик, тег, повтор, отменить, повторить, солнце, луна, монитор). Они рисуются через `currentColor`: иконка берёт цвет и
227
228
  размер текста. Имена с зарезервированной приставкой `tao-`: `<TaoIcon name="tao-check" />`, список — `taoIconNames`.
228
229
 
229
230
  ```vue