@1337exp/taoui 5.27.1 → 5.28.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 +3 -2
- package/README.md +1 -0
- package/README.ru.md +1 -0
- package/dist/index.d.ts +236 -177
- package/dist/index.js +148 -125
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/skills/taoui/SKILL.md +1 -1
- package/skills/taoui/references/components.md +13 -0
- package/src/styles/contexts/stretch.css +62 -0
- package/src/styles/index.css +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## 5.
|
|
3
|
+
## 5.28.0
|
|
4
4
|
|
|
5
|
-
Nothing to migrate.
|
|
5
|
+
Nothing to migrate; the defaults do not change.
|
|
6
6
|
|
|
7
|
+
- **New `TaoStretchedLink`: a whole card, row or tile as one link.** A `TaoLink` (so `NuxtLink` / `RouterLink` / `<a>` by itself, with `to`, `newTab`, `private`, `exactPath`) whose layer is stretched over the container: a click anywhere on it goes to the link, and the buttons inside it still work on their own. The link stays where it is in the markup (the title, a "View" button); the container gets `tao-stretched` (it is `position: relative`), and a control that must stay clickable by itself gets `tao-stretched-raise`. The keyboard sees one link and its focus ring goes round the whole container, inside its edge, with the corners from `--tao-stretched-radius` (the radius of a panel by default). The class `tao-stretched-link` works on any `<a>`. It is a context like `tao-frames-soft`: `styles/contexts/stretch.css`, no JavaScript. **One rule, written in the showcase, the README and the stylesheet:** never put `filter`, `transform`, `perspective`, `will-change: transform` or `contain` on the link (on `:hover` too). Such a property makes the link the containing block of its own layer, the layer shrinks to the link, the pointer is no longer over it, the property goes, the layer stretches back, and so on every frame: the cursor flickers between a hand and a text bar. Light the link with a colour, or put the effect on an inner element (on the container it is fine); a test keeps the context itself clear of these properties. Why a component and not a recipe: every site that makes a card clickable meets this, and it is found only by the flicker.
|
|
7
8
|
- **confirm(): a button no longer jumps a pixel under the pointer.** A confirm with a message (the danger one, for example) stood on a fraction of a pixel: its text had fractional line heights (16 x 1.3, 14 x 1.45), so the panel was 143.09px high, and centred in a box where the room left over was odd it started at 351.45. A button on such a fraction is drawn one way at first and snapped to whole pixels when it is repainted under the pointer, so it moved down a little. The line heights are whole pixels at the default sizes now (16 x 1.25 = 20, 14 x 1.5 = 21), and a centred panel with an odd room left over gets a margin of 1px, which moves it by half a pixel onto a whole one (`centringNudge`, when the confirm opens and when the window is resized). No layer is forced (a `will-change` made the text blurry). `TaoModal` had the same fault in a window of the other parity (its panel started at 314.5, and with it the close button, the text and the footer button): its title was `line-height: normal`, which is fractional, and the panel was not nudged. The title is as high as the close button now (24px at the default size) and a centred `TaoModal` is nudged the same way. The nudge is one composable, `useWholePixelPanel` (it also looks again when the content changes size), used by both. `showcase/lab/subpixel.html` measures this for `confirm()`, `TaoModal`, `TaoDrawer`, `toast()` and `TaoTooltip`.
|
|
8
9
|
- **Floating panels start on whole pixels.** The position of every panel placed by `useFloating` (Tooltip, Popover, Select, Combobox, Date, DropdownMenu, the tip of TaoCopy…) came from the anchor and the size of the panel and was often a fraction: a tooltip centred over a button with an odd width stood on a half pixel. Text and buttons on a fraction are drawn one way at first and snapped to whole pixels when they are repainted, so a button in a popover could jump when the pointer came to it. `computePosition` rounds `top` and `left` (after the flip and the clamp into the window), and the arrow is worked out from the rounded position, so it still points at the middle of the anchor. `showcase/lab/subpixel.html` now also measures `TaoPopover` and `TaoSelect`.
|
|
9
10
|
- **TaoCounter: a digit no longer jumps a pixel when it starts to roll.** A digit became a layer of its own only when its `transform` and `blur` began, and the text was then redrawn on whole pixels: in Chromium it moved a little to the left at the start (and back at the end). The digit is a layer from the start now (`will-change`), so it is drawn the same before, during and after. The geometry was never off: the cells and the centre of the text stay put to a hundredth of a pixel.
|
package/README.md
CHANGED
|
@@ -132,6 +132,7 @@
|
|
|
132
132
|
### Navigation
|
|
133
133
|
|
|
134
134
|
- **TaoLink** — `<NuxtLink>` in Nuxt, `<RouterLink>` with vue-router, otherwise a plain `<a>` — no extra setup
|
|
135
|
+
- **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.
|
|
135
136
|
- **TaoBreadcrumb** — crumbs: the last item is the current page
|
|
136
137
|
- **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
|
|
137
138
|
- **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
|
package/README.ru.md
CHANGED
|
@@ -132,6 +132,7 @@
|
|
|
132
132
|
### Навигация и взаимодействие
|
|
133
133
|
|
|
134
134
|
- **TaoLink** — `<NuxtLink>` в Nuxt, `<RouterLink>` при vue-router, иначе обычный `<a>` — без дополнительной настройки
|
|
135
|
+
- **TaoStretchedLink** — `TaoLink`, который делает целую карточку или строку одной ссылкой, а кнопки внутри продолжают работать: `tao-stretched` на контейнере, `tao-stretched-raise` на элементе, который должен нажиматься сам. Клавиатура видит одну ссылку, кольцо фокуса идёт по контейнеру (`--tao-stretched-radius`). Не давайте ссылке `filter` / `transform`: слой сожмётся под курсором, и курсор начнёт мигать Текст под растянутым слоем нельзя выделить мышью (то, что должно выделяться, поднимите через `tao-stretched-raise`), а имя ссылке даёт только то, что в ней написано: для карточки направьте `aria-describedby` ссылки на описание.
|
|
135
136
|
- **TaoBreadcrumb** — крошки: последний пункт — текущая страница
|
|
136
137
|
- **TaoDropdownMenu** / **TaoMenu** — меню из простого дерева данных `items`: подменю, чекбоксы, радио, разделители, подписи групп, сочетания для показа, недоступные пункты. Стрелки, Home / End, быстрый поиск по букве, `→` / `←` для подменю, Esc закрывает верхний уровень первым. `TaoMenu` — сама панель для своих оболочек (полоса меню, контекстное меню); у края экрана переворачивается; `size` делает кнопку компактным квадратом, `:tabbable="false"` убирает её из порядка Tab
|
|
137
138
|
- **TaoMenubar** / **TaoContextMenu** — полоса меню редактора и меню по правой кнопке, на `TaoMenu`. Полоса — одна остановка Tab (`role="menubar"`): `←` / `→` ходят по ней, `↓` / Enter открывают, при открытом меню `←` / `→` и указатель переходят к соседнему; пункт без `items` — обычное действие. Контекстное меню открывается у указателя (или у элемента для клавиши Menu / Shift+F10) и оборачивает содержимое без своей коробки
|