@1337exp/taoui 5.27.0 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@1337exp/taoui",
3
- "version": "5.27.0",
3
+ "version": "5.28.0",
4
4
  "description": "Design-token driven Vue 3 / Nuxt component library: palettes with tested contrast, accessible menus and toolbars, navigation that adapts without JS, small charts, built-in locales.",
5
5
  "keywords": [
6
6
  "vue",
@@ -115,7 +115,7 @@ choose a text colour, WCAG 2 to promise a number.
115
115
  `TaoTable` (columns, sort, row click), `TaoPagination` (`pageInput` for hundreds of pages), `TaoList` / `TaoListItem` (`roving`: one Tab stop, arrows between the rows),
116
116
  `TaoTree` (expand, select, tri-state `checkable`, lazy `load`), `TaoStages`, `TaoTimeline` (`active` makes it a progress),
117
117
  `TaoTag`, `TaoAvatar`, `TaoImage`, `TaoCarousel`, `TaoCard` (`#media`, `#title`, `#sub`, `#footer`, `#corner`, `closable`,
118
- `stripe` + `stripeTone`), `TaoBlock`, `TaoTabs`, `TaoBreadcrumb`, `TaoLink`, `TaoSpoiler` / `TaoSpoilerGroup`, `TaoCounter`,
118
+ `stripe` + `stripeTone`), `TaoBlock`, `TaoTabs`, `TaoBreadcrumb`, `TaoLink`, `TaoStretchedLink` (a whole card or row as one link, the buttons inside still work: `tao-stretched` on the container, `tao-stretched-raise` on a control that must click by itself; never `filter` / `transform` on the link), `TaoSpoiler` / `TaoSpoilerGroup`, `TaoCounter`,
119
119
  `TaoCopy`, `TaoTour` (a guided tour: `:step` / `:index` / `:count`, events `next` / `prev` / `skip`; it only draws, the state is yours or TaoUX `useTour`; a step is `{ id, target?, title?, text?, placement? }`), `TaoThemeToggle` (the light / dark switch as an icon button: flips `data-tao-mode` of `<html>`, or `v-model` with `:apply="false"`; `#icon="{ mode, next }"` for your own glyph), `TaoMarquee` (one line that runs round only when it does not fit), `TaoScrubber` (play / pause + time),
120
120
  `TaoScrollTop`, `TaoAnimatedBorder`, `TaoIcon`.
121
121
 
@@ -1160,6 +1160,19 @@ Showcase section: `#link`
1160
1160
 
1161
1161
  **Slots, events, notes.** default — the link text.
1162
1162
 
1163
+ ## TaoStretchedLink
1164
+
1165
+ Showcase section: `#stretched-link`
1166
+
1167
+ | Prop | Type | Default | Notes |
1168
+ |---|---|---|---|
1169
+ | `to` | `string \| object` | — | The address, as in TaoLink |
1170
+ | `newTab` | `boolean` | false | target=_blank + rel=noopener |
1171
+ | `private` | `boolean` | false | rel=noopener noreferrer |
1172
+ | `exactPath` | `boolean` | false | An exact path match for active (vue-router) |
1173
+
1174
+ **Slots, events, notes.** default — the link text. Classes: tao-stretched on the container (position: relative), tao-stretched-raise on the controls that must stay clickable by themselves; --tao-stretched-radius is the corner of the focus ring. Never give the link filter, transform, perspective, will-change: transform or contain (on :hover too): the cursor flickers.
1175
+
1163
1176
  ## TaoScrollTop
1164
1177
 
1165
1178
  Showcase section: `#scrolltop`
@@ -0,0 +1,62 @@
1
+ /**
2
+ * Tao UI — Stretched link context / Контекст растянутой ссылки
3
+ *
4
+ * A whole card, row or tile that is one link, while the buttons inside it still work on their own. The link keeps its
5
+ * place in the markup (a title, a "View" button); its `::after` is stretched over the nearest positioned ancestor, so a click anywhere
6
+ * on that ancestor goes to the link.
7
+ *
8
+ * .tao-stretched the container the link stretches over (it is `position: relative`)
9
+ * .tao-stretched-link the link itself; `<TaoStretchedLink>` is a `<TaoLink>` with this class, any `<a>` can take it
10
+ * .tao-stretched-raise a control that must stay clickable on its own (a button, a second link): it sits above the stretched layer
11
+ *
12
+ * --tao-stretched-radius the corners of the focus ring, so it follows the container (default: the radius of a panel)
13
+ *
14
+ * The keyboard sees one link; its focus ring goes round the whole container (inside its edge, so a container with
15
+ * `overflow: hidden` does not cut it).
16
+ *
17
+ * Do not put `filter`, `transform`, `perspective`, `will-change: transform` or `contain` on the link (on `:hover`
18
+ * too): such a property makes the link the containing block of its own `::after`, the stretched layer shrinks to the
19
+ * link, the pointer is no longer over it, the property goes, the layer stretches back, and so on every frame (the cursor
20
+ * flickers). Light the link with a colour (`background`, `color-mix`), or put the effect on an inner element. On the container it is fine.
21
+ *
22
+ * Целая карточка, строка или плитка как одна ссылка, при этом кнопки внутри нажимаются сами по себе. Ссылка остаётся на своём
23
+ * месте в разметке (заголовок, кнопка «Посмотреть»), её `::after` растягивается на ближайшего позиционированного предка, и клик в
24
+ * любом месте предка уходит в ссылку.
25
+ *
26
+ * .tao-stretched контейнер, на который растягивается ссылка (`position: relative`)
27
+ * .tao-stretched-link сама ссылка; `<TaoStretchedLink>` это `<TaoLink>` с этим классом, класс можно дать любому `<a>`
28
+ * .tao-stretched-raise элемент, который должен нажиматься сам (кнопка, вторая ссылка): он выше растянутого слоя
29
+ *
30
+ * --tao-stretched-radius скругление кольца фокуса, чтобы оно повторяло контейнер (по умолчанию радиус панели)
31
+ *
32
+ * Клавиатура видит одну ссылку; кольцо фокуса идёт по всему контейнеру (внутри его края, чтобы `overflow: hidden` не обрезал).
33
+ *
34
+ * Не давайте ссылке `filter`, `transform`, `perspective`, `will-change: transform` и `contain` (и на `:hover` тоже): такое свойство
35
+ * делает ссылку опорным блоком для её же `::after`, слой сжимается до ссылки, курсор оказывается уже не над ним, свойство
36
+ * пропадает, слой снова растягивается, и так каждый кадр (курсор мигает). Подсвечивайте ссылку цветом (`background`, `color-mix`)
37
+ * или вешайте эффект на внутренний элемент. Контейнеру это можно.
38
+ */
39
+ .tao-stretched {
40
+ position: relative;
41
+ }
42
+
43
+ .tao-stretched-link::after {
44
+ content: '';
45
+ position: absolute;
46
+ inset: 0;
47
+ border-radius: var(--tao-stretched-radius, var(--tao-radius-panel));
48
+ }
49
+
50
+ .tao-stretched-link:focus-visible {
51
+ outline: none;
52
+ }
53
+
54
+ .tao-stretched-link:focus-visible::after {
55
+ outline: 2px solid var(--tao-color-accent);
56
+ outline-offset: -2px;
57
+ }
58
+
59
+ .tao-stretched-raise {
60
+ position: relative;
61
+ z-index: 1;
62
+ }
@@ -15,5 +15,6 @@
15
15
  @import "./contexts/surface.css";
16
16
  @import "./contexts/frames.css";
17
17
  @import "./contexts/atmosphere.css";
18
+ @import "./contexts/stretch.css";
18
19
  @import "./typography.css";
19
20
  @import "./base.css";