@1337exp/taoui 5.21.0 → 5.23.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.21.0",
3
+ "version": "5.23.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",
@@ -37,6 +37,9 @@ createApp(App).use(TaoUI, { locale: localeRu }).mount('#app') // locale option
37
37
  prop wins. `comfortable` gives touch-sized controls (34 / 44 / 52px); `auto` is comfortable on `pointer: coarse`.
38
38
  4. **A surface is a material**: `surface="flat | grain | glass"` on TaoCard / TaoBlock or `class="tao-surface-glass"` on any
39
39
  element. Glass needs something behind it (popovers, a header over a scroll).
40
+ **Frames are a context too**: `class="tao-frames-soft"` on `<html>` or a container lets the decorative frames of Alert, Spoiler,
41
+ Table, List, Toolbar and Menubar go clear (the fill holds the panel); `bordered` on one of them overrides it. Field frames and
42
+ focus rings never follow it.
40
43
  5. **Floating panels** (Select, Combobox, Date, Popover, Tooltip, menus) are teleported to `body`; they carry the size and
41
44
  the density of where they hang from by themselves. Do not wrap them in `overflow: hidden` expecting a clip.
42
45
  6. **Do not restyle internals by class names** (`.tao-select__panel` …) unless the reference says a class is public;
@@ -399,6 +399,7 @@ Showcase section: `#pincode`
399
399
  | `masked` | `boolean` | false | Dots instead of characters |
400
400
  | `disabled` | `boolean` | false | Disabled |
401
401
  | `error` | `boolean` | false | A red border. The error text is error on TaoFormField |
402
+ | `bordered` | `boolean` | true | The frame of the cells. false is the light style, no frame at all: a fill; the focus, an error and a result are told by a tint of the fill and the colour of the digit |
402
403
  | `size` | `'small' \| 'medium' \| 'large'` | inherited | Cells 40×46 / 50×56 / 58×64. Without it — the size of the ancestors |
403
404
  | `clearOn` | `'focus' \| 'input'` | 'focus' | focus — a click clears the cell and everything to the right; input — changes only on typing |
404
405
  | `status` | `'idle' \| 'success' \| 'error'` | 'idle' | The result of the check, set by the app (on complete): error shakes the cells and paints them red, success runs a glow and paints them green; a screen reader hears it. Set idle again when the user edits; play() repeats the animation |
@@ -434,6 +435,8 @@ Showcase section: `#slider`
434
435
  | `discrete` | `boolean` | false | The value only on the marks (a stepped scale); the arrows follow the marks |
435
436
  | `format` | `(value: number) => string` | — | Number text: the captions of automatic marks and the value on the bar |
436
437
  | `flat` | `boolean` | false | No round handles: a flat bar with a fill. Keyboard and focus work |
438
+ | `bubble` | `boolean \| 'always'` | false | A bubble with the value beside the thumb, in the colour of its zone (the accent without zones), with a label that reads on it. Off by default. true — it shows while the thumb is dragged, hovered or has the keyboard focus; "always" — it stays. The text is format or the #bubble="{ value, zone }" slot. A screen reader does not need it (there is aria-valuetext). Leave room for it above the bar (to the right of a vertical one) |
439
+ | `zones` | `{ to, tone?, color?, dot?, reveal? }[]` | — | The scale in colour: each zone runs to its to (the first from min, the last to max, no gaps and no overlaps). tone is a colour role of the theme (accent, success, warning, danger, info, neutral), color is any CSS colour and wins over tone. The bar shows the zones dimmed, the filled part in full colour, the thumb takes the colour of its zone. dot: true puts a bead where a zone ends (none at max). reveal: true — the zone has no colour until the value gets there: the field looks plain and is painted as it fills (its dot shows once the fill has got to it). Colour is not a message: say the state in words |
437
440
  | `vertical` | `boolean` | false | Vertical: the maximum on top, marks on the right. Length — --tao-slider-length (10rem) |
438
441
  | `variant` | `'bar' \| 'thin'` | 'bar' | bar — a thick track, a form control; thin — a thin one (seek / volume). It used to be size="small" |
439
442
  | `size` | `'small' \| 'medium' \| 'large'` | inherited | The scale of the track and the thumb (the thumb is 16 / 20 / 24). Without it — the size of the ancestors |
@@ -618,6 +621,7 @@ Showcase section: `#table`
618
621
  | `size` | `'small' \| 'medium' \| 'large'` | inherited | Paddings and text of cells (small = the former compact), and the size of controls in cells too |
619
622
  | `head` | `boolean` | true | Highlight the header |
620
623
  | `lines` | `boolean` | true | Lines between rows |
624
+ | `bordered` | `boolean` | by context | The outer frame. Not set, it follows the frames context; false: no frame, the table sits on a raised fill. The lines between rows stay (lines) |
621
625
  | `sticky` | `boolean` | false | A sticky header (needs maxHeight) |
622
626
  | `rowKey` | `string \| fn` | 'id' | The row key |
623
627
  | `maxHeight` | `number \| string` | — | Scroll. A number is px |
@@ -910,7 +914,8 @@ Showcase section: `#drawer`
910
914
  | `side` | `'left' \| 'right' \| 'bottom'` | 'right' | Where it slides in from. bottom is a sheet: as wide as the screen up to 640px, as tall as its content up to 90% of the screen, rounded top, a grip, above the safe area |
911
915
  | `closable` | `boolean` | true | The user can close it: Esc, the backdrop, the cross, the pull-down of a sheet. false — only the parent closes it |
912
916
  | `showClose` | `boolean` | true | The cross in the header. false hides only the cross: Esc, the backdrop and the pull-down still close it |
913
- | `swipeToClose` | `boolean` | true | side="bottom" only: the sheet is pulled down by its grip and header; it closes when pulled a third of its height or flung, and comes back otherwise. It does not start from a button or a field in the header, so the content still scrolls. Needs closable |
917
+ | `swipeToClose` | `boolean` | true | side="bottom" only: the sheet is pulled down by its grip and header; it closes when pulled half of its height (swipeThreshold) or flung, and comes back otherwise. It does not start from a button or a field in the header, so the content still scrolls. Needs closable |
918
+ | `swipeThreshold` | `number` | 0.5 | side="bottom" only: how far, as a share of its height (0.05–1), the sheet must be pulled to close. A touch that only grazes it does not close it; a fast fling needs 15% of the height at least |
914
919
  | `closeLabel` | `string` | 'Close' | aria-label of the cross |
915
920
  | `surface` | `'flat' \| 'grain' \| 'glass'` | 'flat' | What the panel is made of, as on TaoCard. class, style and the other attributes go to the panel; --tao-drawer-bg is its colour |
916
921
 
@@ -991,6 +996,7 @@ Showcase section: `#toolbar`
991
996
  | `size` | `'small' \| 'medium' \| 'large'` | inherited | The size of the controls inside |
992
997
  | `orientation` | `'horizontal' \| 'vertical'` | 'horizontal' | Which arrows walk it (← → or ↑ ↓); the separators lie across |
993
998
  | `variant` | `'panel' \| 'plain'` | 'panel' | panel — a raised bar of its own with concentric corners; plain — only the layout, for a toolbar inside a header |
999
+ | `bordered` | `boolean` | by context | The frame of a panel. Not set, it follows the frames context; false: no frame, the raised fill stays |
994
1000
 
995
1001
  **Slots, events, notes.** default — any controls: TaoButton (toggles with v-model:pressed), TaoSegmented, a select, TaoToolbarGroup, TaoToolbarSeparator. Keys: the bar is one Tab stop and remembers the last item; ← → (↑ ↓ when vertical) walk it and wrap, Home / End go to the ends, disabled items are skipped. Inside a radio group (TaoSegmented) the arrows pick the option and go on from its edge; a text field keeps its arrows. The items wrap onto a new line on a narrow screen.
996
1002
 
@@ -1021,6 +1027,7 @@ Showcase section: `#menubar`
1021
1027
  | `size` | `'small' \| 'medium' \| 'large'` | inherited | The height of the bar, as for the controls |
1022
1028
  | `ariaLabel` | `string` | 'Menu bar' | Accessible name of the bar |
1023
1029
  | `closeOnScroll` | `boolean` | false | Close an open menu when the page scrolls. Off: it follows its entry |
1030
+ | `bordered` | `boolean` | by context | The outer frame. Not set, it follows the frames context; false: no frame, the raised fill stays |
1024
1031
 
1025
1032
  **Slots, events, notes.** The select event — the id of the picked item (in a menu or a plain top entry). #item — your own item face in the menus. Keys: Tab enters the bar, ← → walk it, Home / End, ↓ / Enter / Space open, with a menu open ← → move to the neighbour menu, Esc closes and gives the focus back. No folding of entries into “…” on a narrow bar yet.
1026
1033
 
@@ -1047,6 +1054,7 @@ Showcase section: `#spoiler`
1047
1054
  | `title` | `string` | '' | The button title |
1048
1055
  | `name` | `string \| number` | — | The panel key inside TaoSpoilerGroup |
1049
1056
  | `defaultOpen` | `boolean` | false | The initial state, if there is no v-model |
1057
+ | `bordered` | `boolean` | by context | The outer frame. Not set, it follows the frames context; false: the header fill holds the panel |
1050
1058
  | `@change` | `value` | — | The user opened or closed it |
1051
1059
 
1052
1060
  **Slots, events, notes.** default — the body. Neighbours do not close each other.
@@ -1165,6 +1173,7 @@ Showcase section: `#alert`
1165
1173
  | `collapsible` | `boolean` | false | The body folds under the title (the title is the toggle, aria-expanded); the tone stays. Folded text stays in the DOM, find-in-page opens it |
1166
1174
  | `v-model:collapsed` | `boolean` | own | Folded or not; v-model:collapsed="true" starts folded. Better open for an error |
1167
1175
  | `detailsLabel` | `string` | 'Details' | The toggle text when there is no title |
1176
+ | `bordered` | `boolean` | by context | The frame. Not set, it follows the frames context (.tao-frames-soft); false: no frame, a stronger tint of the tone; true: the frame stays |
1168
1177
 
1169
1178
  **Slots, events, notes.** default — the text. #close-icon. v-if + @close — to hide it.
1170
1179
 
@@ -1189,9 +1198,15 @@ Showcase section: `#loader`
1189
1198
 
1190
1199
  | Prop | Type | Default | Notes |
1191
1200
  |---|---|---|---|
1192
- | `size` | `number \| string` | 80 | The size. A number is px |
1193
- | `color` | `string` | accent token | The dot colour |
1201
+ | `variant` | `'dots' \| 'ring' \| 'pulse'` | 'dots' | The look: four dots / a ring with a turning arc / ripples from a core |
1202
+ | `size` | `number \| string` | 80 for dots, 40 for the others | The size. A number is px, "40px" works, or small / medium / large (24 / 40 / 64) |
1203
+ | `tone` | `'accent' \| 'success' \| 'danger' \| 'warning' \| 'info' \| 'neutral'` | 'accent' | A colour role of the theme |
1204
+ | `color` | `string` | — | A CSS colour of your own, wins over tone; currentColor takes the text colour around it |
1194
1205
  | `inline` | `boolean` | false | Inline, without block centring |
1206
+ | `label` | `string` | 'Loading' | What a screen reader says (the text of the locale by default) |
1207
+ | `decorative` | `boolean` | false | A picture only: hidden from a screen reader (the wait is said elsewhere; a button with loading says it itself) |
1208
+
1209
+ **Slots, events, notes.** Under «reduce motion» nothing travels or turns: the loader only breathes.
1195
1210
 
1196
1211
  ## TaoImage
1197
1212
 
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Tao UI — Frames context / Контекст рамок
3
+ *
4
+ * How loud the decorative frames are. `.tao-frames-soft` on the page (or any container) lets the frames of panels
5
+ * (Alert, Spoiler, Table, List, Toolbar, Menubar) go clear and gives the tone-filled ones (Alert) a little more tint
6
+ * instead, so the panel is held by its fill and not by a line. Nothing moves: the 1px border stays in the box, only
7
+ * unseen. `.tao-frames-framed` puts the frames back inside a soft area. A component with a `bordered` prop (`true` /
8
+ * `false`) overrides the context for itself.
9
+ *
10
+ * --tao-frame-alpha how much of its colour a decorative frame keeps (100% framed, 0% clear)
11
+ * --tao-frame-tint what a tone-filled panel adds to its tint when the frame is gone
12
+ * --tao-frame-fill how far a panel with no fill of its own (Table) leans on the raised fill when the frame is gone
13
+ *
14
+ * Only decorative frames follow it. The frame of a field (Input, Select, ...), a focus ring and the lines between the
15
+ * rows of a table or a list stay as they are: they tell where a control is or what belongs together, and WCAG 1.4.11
16
+ * asks 3:1 of them. The tokens are plain numbers, so a theme does not need to know them.
17
+ *
18
+ * Насколько громки декоративные рамки. `.tao-frames-soft` на странице (или любом контейнере) делает рамки панелей
19
+ * (Alert, Spoiler, Table, List, Toolbar, Menubar) прозрачными, а залитым тоном (Alert) добавляет немного заливки: панель
20
+ * держится заливкой, а не линией. Ничего не двигается: рамка в 1px остаётся в боксе, только невидимая.
21
+ * `.tao-frames-framed` возвращает рамки внутри мягкой области. Компонент с `bordered` (`true` / `false`) переопределяет
22
+ * контекст для себя. Рамки полей, кольцо фокуса и линии между строками не затрагиваются.
23
+ */
24
+ :root,
25
+ .tao-frames-framed {
26
+ --tao-frame-alpha: 100%;
27
+ --tao-frame-tint: 0%;
28
+ --tao-frame-fill: 0%;
29
+ }
30
+
31
+ .tao-frames-soft {
32
+ --tao-frame-alpha: 0%;
33
+ --tao-frame-tint: 6%;
34
+ --tao-frame-fill: 100%;
35
+ }
@@ -2,7 +2,7 @@
2
2
  * Tao UI — styles entry point
3
3
  *
4
4
  * Layers, in order: primitives -> semantic tokens -> themes (dark is the default, light is opt-in with
5
- * data-tao-mode="light") -> contexts (size and density, tone, surface) -> typography (opt-in classes) -> base reset.
5
+ * data-tao-mode="light") -> contexts (size and density, tone, surface, frames) -> typography (opt-in classes) -> base reset.
6
6
  * Порядок слоёв: примитивы -> семантические токены -> темы (dark по умолчанию, light включается атрибутом) ->
7
7
  * контексты (размер и плотность, тон, поверхность) -> типографика (классы по выбору) -> базовый сброс.
8
8
  */
@@ -13,6 +13,7 @@
13
13
  @import "./contexts/size.css";
14
14
  @import "./contexts/tone.css";
15
15
  @import "./contexts/surface.css";
16
+ @import "./contexts/frames.css";
16
17
  @import "./contexts/atmosphere.css";
17
18
  @import "./typography.css";
18
19
  @import "./base.css";