@1337exp/taoui 5.10.0 → 5.11.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,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 5.11.0
4
+
5
+ Nothing to migrate.
6
+
7
+ - **`TaoButton` `shortcut`:** `shortcut="N"` shows the key at the end of the button, in a small chip of the button's own text colour, so it fits any variant and tone; in a wide button it goes to the far edge. It is given as `aria-keyshortcuts` and the chip itself is not read twice. It only shows the key: listening to it is the app's job.
8
+ - **`TaoNav` labels fit the rail.** An item with the icon over its label (the rail, the bar) kept 12px on each side, so the rail left 47px for a label and «Settings» or «Calendar» in Russian were cut. Now it keeps 4px, and the label has about 63px. The side panel is unchanged.
9
+ - **`TaoNav` widths are public:** `--tao-nav-rail-width` (80px), `--tao-nav-drawer-width` (240px) and `--tao-nav-action-radius`, set on `:root` or any wrapper, for an app whose labels are longer still.
10
+ - **`TaoNav` action in the side panel:** the button keeps its own corners, like the items under it, instead of a pill (`--tao-nav-action-radius: var(--tao-radius-full)` brings the pill back), and stands off the top edge. A `shortcut` on it shows in the side panel and hides with the label when the button is round.
11
+ - **`TaoNav` side panel, lighter.** Its rows were 48px, the finger size of the bar, with 4px around the panel. With a mouse they are now a little taller than a control (40px at the medium size, and they follow the size and the density), and the panel keeps 12px from its edges, so the action and the items stand off them like a list in a card. On a touch screen (`pointer: coarse`) the rows stay 48px. The bar and the rail do not change.
12
+ - **`TaoNav` `surface`:** `flat` (the default), `glass` or `grain`, as on TaoCard. `glass` lets the page show blurred through the bar while it scrolls under it, the floating pill included; where blur is not supported or less transparency is asked, the panel is solid.
13
+ - Showcase: buttons with a shortcut; the TaoNav action shows `N` and switches the surface, with something bright under the bar.
14
+
3
15
  ## 5.10.0
4
16
 
5
17
  Nothing to migrate.
package/README.md CHANGED
@@ -52,7 +52,7 @@
52
52
  ### Basics
53
53
 
54
54
  - **TaoBlock** — container with padding and radius
55
- - **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`)
55
+ - **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)
56
56
  - **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
57
57
  - **TaoCopy** — clipboard icon. After a click, a “Copied” tooltip; if the trigger is gone, the tooltip is too
58
58
  - **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`
@@ -63,7 +63,7 @@
63
63
  - **TaoSpoiler** — disclosure. `v-model` and `aria-expanded`. Neighbours do not close each other
64
64
  - **TaoSpoilerGroup** — accordion: `v-model` is the open panel key (`null` = all closed); spoilers take `name`. Without `v-model` the group keeps that key itself
65
65
  - **TaoTabs** — tabbed sections
66
- - **TaoNav** — navigation between the sections of an app: one list of items (`icon`, `href`, `badge`), three looks. `layout="auto"` picks by the width of TaoNav itself (container queries, no JS): a bottom bar below 600px (more than five items: «More» with a menu), a rail with icons below 840px, a side panel with labels from 840px. With the page in its slot it lays the page out: the bar sticks to the bottom (safe area kept), the side list to the top. `floating` lifts the bar into a detached pill with a shadow (the rail and the side panel stay). `indicator="line"` marks the current section with a short accent line instead of a tint. The `#action` slot is the screen's main action and moves with the navigation: round above the bar at the end side, at the top of the rail, extended with its text at the top of the side panel. `select(id, event)` lets a router take over a link
66
+ - **TaoNav** — navigation between the sections of an app: one list of items (`icon`, `href`, `badge`), three looks. `layout="auto"` picks by the width of TaoNav itself (container queries, no JS): a bottom bar below 600px (more than five items: «More» with a menu), a rail with icons below 840px, a side panel with labels from 840px. With the page in its slot it lays the page out: the bar sticks to the bottom (safe area kept), the side list to the top. `floating` lifts the bar into a detached pill with a shadow (the rail and the side panel stay). `indicator="line"` marks the current section with a short accent line instead of a tint. The `#action` slot is the screen's main action and moves with the navigation: round above the bar at the end side, at the top of the rail, extended with its text at the top of the side panel. `select(id, event)` lets a router take over a link. Widths: `--tao-nav-rail-width` (80px), `--tao-nav-drawer-width` (240px); `--tao-nav-action-radius` for the action in the side panel; `surface="glass"` lets the page show blurred through the bar
67
67
  - **TaoTooltip** — hover hint. `placement`: `top` / `bottom` / `left` / `right`, each with `-start` / `-end`; flips at the viewport edge
68
68
  - **TaoPopover** — click panel with any slot content, Esc and outside click; `placement` as Tooltip. Not a tooltip, not an action menu
69
69
 
package/README.ru.md CHANGED
@@ -52,7 +52,7 @@
52
52
  ### Базовые
53
53
 
54
54
  - **TaoBlock** — базовый контейнер с настраиваемыми отступами и скруглением
55
- - **TaoButton** — кнопка. `variant`: `primary` / `secondary` / `ghost` / `text`; `tone` красит любой из них (по умолчанию акцент, neutral, success, danger, warning, info). `v-model:pressed` делает её переключателем (`aria-pressed`)
55
+ - **TaoButton** — кнопка. `variant`: `primary` / `secondary` / `ghost` / `text`; `tone` красит любой из них (по умолчанию акцент, neutral, success, danger, warning, info). `v-model:pressed` делает её переключателем (`aria-pressed`); `shortcut="N"` показывает клавишу в конце кнопки (`aria-keyshortcuts`; слушать её — дело приложения)
56
56
  - **TaoCard** — карточка со слотами media / header / title / footer и `#corner` (тег, кнопка меню). В `#media` — фото или `TaoCarousel`; `closable` добавляет крестик и событие `close`. `flush` — плитка без padding/тени на всю ячейку; `#overlay` — scrim на media; `stripe="top | left | bottom"` со `stripeTone` (тон или `gradient` палитры) рисует цветную полосу, которую обрезают углы
57
57
  - **TaoCopy** — иконка копирования в буфер. После клика сверху тултип «Скопировано»; если кнопку убрали — тултип тоже
58
58
  - **TaoMarquee** — одна строка без переносов: не помещается — бежит по кругу с гаснущими краями и паузой в начале каждого круга, помещается — стоит. Останавливается при наведении, фокусе и тапе (WCAG 2.2.2); при «уменьшить движение» переносится; скринридер читает один раз. `text` или строчное содержимое в слоте, `speed`, `gap`, `fade` (левое затухание занимает столько места слева от текста: дайте родителю такой padding), `paused`
@@ -63,7 +63,7 @@
63
63
  - **TaoSpoiler** — раскрывающийся блок. `v-model` и `aria-expanded`. Несколько подряд сами друг друга не закрывают
64
64
  - **TaoSpoilerGroup** — аккордеон: `v-model` — ключ открытой панели (`null` — все закрыты), у спойлера `name`. Без `v-model` группа помнит ключ сама
65
65
  - **TaoTabs** — вкладки для переключения между секциями контента
66
- - **TaoNav** — навигация между разделами приложения: один список пунктов (`icon`, `href`, `badge`), три вида. `layout="auto"` выбирает по ширине самого TaoNav (container queries, без JS): нижняя панель до 600px (больше пяти пунктов: «Ещё» с меню), рейка с иконками до 840px, боковая панель с подписями от 840px. Со страницей в слоте раскладывает её сам: панель прилипает к низу (с учётом безопасной зоны), боковой список к верху. `floating` отрывает нижнюю панель в отдельную «пилюлю» с тенью (рейка и боковая панель не меняются). `indicator="line"` отмечает текущий раздел короткой чертой акцента вместо подложки. Слот `#action` — главное действие экрана, оно идёт за навигацией: круглое над панелью у конечного края, наверху рейки, широкое с текстом наверху боковой панели. `select(id, event)` даёт роутеру перехватить ссылку
66
+ - **TaoNav** — навигация между разделами приложения: один список пунктов (`icon`, `href`, `badge`), три вида. `layout="auto"` выбирает по ширине самого TaoNav (container queries, без JS): нижняя панель до 600px (больше пяти пунктов: «Ещё» с меню), рейка с иконками до 840px, боковая панель с подписями от 840px. Со страницей в слоте раскладывает её сам: панель прилипает к низу (с учётом безопасной зоны), боковой список к верху. `floating` отрывает нижнюю панель в отдельную «пилюлю» с тенью (рейка и боковая панель не меняются). `indicator="line"` отмечает текущий раздел короткой чертой акцента вместо подложки. Слот `#action` — главное действие экрана, оно идёт за навигацией: круглое над панелью у конечного края, наверху рейки, широкое с текстом наверху боковой панели. `select(id, event)` даёт роутеру перехватить ссылку. Ширины: `--tao-nav-rail-width` (80px), `--tao-nav-drawer-width` (240px); `--tao-nav-action-radius` — углы действия в боковой панели; `surface="glass"` — страница размыто просвечивает сквозь панель
67
67
  - **TaoTooltip** — всплывающая подсказка при наведении. `placement`: `top` / `bottom` / `left` / `right`, у каждого `-start` / `-end`; у края экрана переворачивается
68
68
  - **TaoPopover** — панель по клику: слот с любым контентом, Esc и клик снаружи; `placement` как у Tooltip. Не тултип и не меню действий
69
69
 
package/dist/index.d.ts CHANGED
@@ -20,6 +20,7 @@ icon: string;
20
20
  iconEnd: string;
21
21
  minWidth: undefined;
22
22
  pressed: undefined;
23
+ shortcut: undefined;
23
24
  }>>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
24
25
  click: (event: MouseEvent) => void;
25
26
  "update:pressed": (value: boolean) => void;
@@ -34,6 +35,7 @@ icon: string;
34
35
  iconEnd: string;
35
36
  minWidth: undefined;
36
37
  pressed: undefined;
38
+ shortcut: undefined;
37
39
  }>>> & Readonly<{
38
40
  onClick?: ((event: MouseEvent) => any) | undefined;
39
41
  "onUpdate:pressed"?: ((value: boolean) => any) | undefined;
@@ -48,6 +50,7 @@ block: boolean;
48
50
  iconEnd: string;
49
51
  minWidth: number | string;
50
52
  pressed: boolean;
53
+ shortcut: string;
51
54
  }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
52
55
 
53
56
  declare const __VLS_component_10: DefineComponent<ExtractPropTypes<__VLS_WithDefaults_9<__VLS_TypePropsToRuntimeProps_10<{
@@ -1186,6 +1189,13 @@ floating?: boolean;
1186
1189
  * в виде панели, вдоль его начального края в рейке и боковой панели).
1187
1190
  */
1188
1191
  indicator?: "pill" | "line";
1192
+ /**
1193
+ * What the panel is made of, as on TaoCard: `glass` lets the page show blurred through the bar while it scrolls
1194
+ * under it (solid where blur is not supported or less transparency is asked), `grain` a film grain.
1195
+ * Из чего сделана панель, как у TaoCard: `glass` — страница размыто просвечивает сквозь панель, когда уходит под
1196
+ * неё (сплошная, где размытия нет или просят меньше прозрачности), `grain` — плёночное зерно.
1197
+ */
1198
+ surface?: TaoSurface;
1189
1199
  }>, {
1190
1200
  modelValue: undefined;
1191
1201
  layout: string;
@@ -1194,6 +1204,7 @@ ariaLabel: undefined;
1194
1204
  moreLabel: undefined;
1195
1205
  floating: boolean;
1196
1206
  indicator: string;
1207
+ surface: string;
1197
1208
  }>>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
1198
1209
  select: (id: string, event: Event) => void;
1199
1210
  "update:modelValue": (id: string) => void;
@@ -1222,6 +1233,13 @@ floating?: boolean;
1222
1233
  * в виде панели, вдоль его начального края в рейке и боковой панели).
1223
1234
  */
1224
1235
  indicator?: "pill" | "line";
1236
+ /**
1237
+ * What the panel is made of, as on TaoCard: `glass` lets the page show blurred through the bar while it scrolls
1238
+ * under it (solid where blur is not supported or less transparency is asked), `grain` a film grain.
1239
+ * Из чего сделана панель, как у TaoCard: `glass` — страница размыто просвечивает сквозь панель, когда уходит под
1240
+ * неё (сплошная, где размытия нет или просят меньше прозрачности), `grain` — плёночное зерно.
1241
+ */
1242
+ surface?: TaoSurface;
1225
1243
  }>, {
1226
1244
  modelValue: undefined;
1227
1245
  layout: string;
@@ -1230,10 +1248,12 @@ ariaLabel: undefined;
1230
1248
  moreLabel: undefined;
1231
1249
  floating: boolean;
1232
1250
  indicator: string;
1251
+ surface: string;
1233
1252
  }>>> & Readonly<{
1234
1253
  onSelect?: ((id: string, event: Event) => any) | undefined;
1235
1254
  "onUpdate:modelValue"?: ((id: string) => any) | undefined;
1236
1255
  }>, {
1256
+ surface: TaoSurface;
1237
1257
  ariaLabel: string;
1238
1258
  modelValue: string;
1239
1259
  indicator: "pill" | "line";
@@ -5700,6 +5720,13 @@ declare interface Props {
5700
5720
  * своё состояние; без него — обычная кнопка.
5701
5721
  */
5702
5722
  pressed?: boolean;
5723
+ /**
5724
+ * The key that does the same, shown at the end of the button (`N`, `Ctrl+K`) and given as `aria-keyshortcuts`.
5725
+ * It only shows the key: listening to it is the app's job.
5726
+ * Клавиша, которая делает то же, — в конце кнопки (`N`, `Ctrl+K`) и в `aria-keyshortcuts`. Только показывает
5727
+ * клавишу: слушать её — дело приложения.
5728
+ */
5729
+ shortcut?: string;
5703
5730
  }
5704
5731
 
5705
5732
  declare interface Props_10 {
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { shallowReactive, defineComponent, useCssVars, computed, openBlock, createElementBlock, renderSlot, normalizeClass, normalizeStyle, useSlots, useAttrs, unref, createCommentVNode, createBlock, inject, useId, ref, mergeProps, createElementVNode, provide, shallowRef, watch, createVNode, toValue, onBeforeUnmount, Teleport, Transition, withCtx, toDisplayString, nextTick, Fragment, renderList, createTextVNode, onMounted, createSlots, normalizeProps, guardReactiveProps, resolveDynamicComponent, withModifiers, onBeforeMount, resolveComponent, toRef, withDirectives, vShow, getCurrentInstance, reactive, withKeys, vModelText, TransitionGroup, onUpdated, createApp } from "vue";
1
+ import { shallowReactive, defineComponent, useCssVars, computed, openBlock, createElementBlock, renderSlot, normalizeClass, normalizeStyle, useSlots, useAttrs, unref, createCommentVNode, createBlock, toDisplayString, inject, useId, ref, mergeProps, createElementVNode, provide, shallowRef, watch, createVNode, toValue, onBeforeUnmount, Teleport, Transition, withCtx, nextTick, Fragment, renderList, createTextVNode, onMounted, createSlots, normalizeProps, guardReactiveProps, resolveDynamicComponent, withModifiers, onBeforeMount, resolveComponent, toRef, withDirectives, vShow, getCurrentInstance, reactive, withKeys, vModelText, TransitionGroup, onUpdated, createApp } from "vue";
2
2
  function isDev() {
3
3
  try {
4
4
  return process.env.NODE_ENV !== "production";
@@ -151,7 +151,7 @@ const _export_sfc = (sfc, props) => {
151
151
  return target;
152
152
  };
153
153
  const TaoIcon = /* @__PURE__ */ _export_sfc(_sfc_main$1i, [["__scopeId", "data-v-ef842331"]]);
154
- const _hoisted_1$15 = ["type", "aria-pressed", "disabled"];
154
+ const _hoisted_1$15 = ["type", "aria-pressed", "aria-keyshortcuts", "disabled"];
155
155
  const _hoisted_2$X = {
156
156
  key: 0,
157
157
  class: "tao-button__loader"
@@ -160,6 +160,11 @@ const _hoisted_3$P = {
160
160
  key: 2,
161
161
  class: "tao-button__content"
162
162
  };
163
+ const _hoisted_4$F = {
164
+ key: 4,
165
+ class: "tao-button__shortcut",
166
+ "aria-hidden": "true"
167
+ };
163
168
  const _sfc_main$1h = /* @__PURE__ */ defineComponent({
164
169
  ...{ name: "TaoButton" },
165
170
  __name: "TaoButton",
@@ -174,7 +179,8 @@ const _sfc_main$1h = /* @__PURE__ */ defineComponent({
174
179
  icon: { default: "" },
175
180
  iconEnd: { default: "" },
176
181
  minWidth: { default: void 0 },
177
- pressed: { type: Boolean, default: void 0 }
182
+ pressed: { type: Boolean, default: void 0 },
183
+ shortcut: { default: void 0 }
178
184
  },
179
185
  emits: ["click", "update:pressed"],
180
186
  setup(__props, { emit: __emit }) {
@@ -215,6 +221,7 @@ const _sfc_main$1h = /* @__PURE__ */ defineComponent({
215
221
  style: normalizeStyle(minWidthStyle.value),
216
222
  type: __props.type,
217
223
  "aria-pressed": __props.pressed === void 0 ? void 0 : __props.pressed,
224
+ "aria-keyshortcuts": __props.shortcut || void 0,
218
225
  disabled: __props.disabled || __props.loading,
219
226
  onClick: handleClick
220
227
  }, [
@@ -231,12 +238,13 @@ const _sfc_main$1h = /* @__PURE__ */ defineComponent({
231
238
  key: 3,
232
239
  class: "tao-button__icon",
233
240
  name: __props.iconEnd
234
- }, null, 8, ["name"])) : createCommentVNode("", true)
241
+ }, null, 8, ["name"])) : createCommentVNode("", true),
242
+ __props.shortcut ? (openBlock(), createElementBlock("kbd", _hoisted_4$F, toDisplayString(__props.shortcut), 1)) : createCommentVNode("", true)
235
243
  ], 14, _hoisted_1$15);
236
244
  };
237
245
  }
238
246
  });
239
- const TaoButton = /* @__PURE__ */ _export_sfc(_sfc_main$1h, [["__scopeId", "data-v-475b0135"]]);
247
+ const TaoButton = /* @__PURE__ */ _export_sfc(_sfc_main$1h, [["__scopeId", "data-v-4b8def1b"]]);
240
248
  function toCssLength(value) {
241
249
  if (value === void 0 || value === null || value === "") {
242
250
  return void 0;
@@ -5913,7 +5921,8 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
5913
5921
  ariaLabel: { default: void 0 },
5914
5922
  moreLabel: { default: void 0 },
5915
5923
  floating: { type: Boolean, default: false },
5916
- indicator: { default: "pill" }
5924
+ indicator: { default: "pill" },
5925
+ surface: { default: "flat" }
5917
5926
  },
5918
5927
  emits: ["update:modelValue", "select"],
5919
5928
  setup(__props, { emit: __emit }) {
@@ -5964,7 +5973,7 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
5964
5973
  }, [
5965
5974
  createElementVNode("div", _hoisted_1$y, [
5966
5975
  createElementVNode("nav", {
5967
- class: "tao-nav__panel",
5976
+ class: normalizeClass(["tao-nav__panel", unref(surfaceClass)(__props.surface)]),
5968
5977
  "aria-label": unref(l10n).ariaLabel
5969
5978
  }, [
5970
5979
  createElementVNode("div", _hoisted_3$r, [
@@ -6032,7 +6041,7 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
6032
6041
  ])) : createCommentVNode("", true)
6033
6042
  ])
6034
6043
  ])
6035
- ], 8, _hoisted_2$v),
6044
+ ], 10, _hoisted_2$v),
6036
6045
  !standalone.value ? (openBlock(), createElementBlock("div", _hoisted_13$1, [
6037
6046
  renderSlot(_ctx.$slots, "default", {}, void 0, true)
6038
6047
  ])) : createCommentVNode("", true)
@@ -6051,7 +6060,7 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
6051
6060
  };
6052
6061
  }
6053
6062
  });
6054
- const TaoNav = /* @__PURE__ */ _export_sfc(_sfc_main$z, [["__scopeId", "data-v-172be4ea"]]);
6063
+ const TaoNav = /* @__PURE__ */ _export_sfc(_sfc_main$z, [["__scopeId", "data-v-21852ef0"]]);
6055
6064
  function visibleRows(nodes, expanded, children) {
6056
6065
  const rows = [];
6057
6066
  const walk = (list, level, parentId) => {