@1337exp/taoui 5.22.0 → 5.23.1
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 +24 -2
- package/README.md +10 -4
- package/README.ru.md +10 -4
- package/dist/index.d.ts +171 -8
- package/dist/index.js +1359 -1206
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/skills/taoui/SKILL.md +3 -0
- package/skills/taoui/references/components.md +17 -3
- package/src/styles/contexts/frames.css +35 -0
- package/src/styles/index.css +2 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@1337exp/taoui",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.23.1",
|
|
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",
|
package/skills/taoui/SKILL.md
CHANGED
|
@@ -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;
|
|
@@ -435,6 +435,8 @@ Showcase section: `#slider`
|
|
|
435
435
|
| `discrete` | `boolean` | false | The value only on the marks (a stepped scale); the arrows follow the marks |
|
|
436
436
|
| `format` | `(value: number) => string` | — | Number text: the captions of automatic marks and the value on the bar |
|
|
437
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 |
|
|
438
440
|
| `vertical` | `boolean` | false | Vertical: the maximum on top, marks on the right. Length — --tao-slider-length (10rem) |
|
|
439
441
|
| `variant` | `'bar' \| 'thin'` | 'bar' | bar — a thick track, a form control; thin — a thin one (seek / volume). It used to be size="small" |
|
|
440
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 |
|
|
@@ -619,6 +621,7 @@ Showcase section: `#table`
|
|
|
619
621
|
| `size` | `'small' \| 'medium' \| 'large'` | inherited | Paddings and text of cells (small = the former compact), and the size of controls in cells too |
|
|
620
622
|
| `head` | `boolean` | true | Highlight the header |
|
|
621
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) |
|
|
622
625
|
| `sticky` | `boolean` | false | A sticky header (needs maxHeight) |
|
|
623
626
|
| `rowKey` | `string \| fn` | 'id' | The row key |
|
|
624
627
|
| `maxHeight` | `number \| string` | — | Scroll. A number is px |
|
|
@@ -911,7 +914,8 @@ Showcase section: `#drawer`
|
|
|
911
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 |
|
|
912
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 |
|
|
913
916
|
| `showClose` | `boolean` | true | The cross in the header. false hides only the cross: Esc, the backdrop and the pull-down still close it |
|
|
914
|
-
| `swipeToClose` | `boolean` | true | side="bottom" only: the sheet is pulled down by its grip and header; it closes when pulled
|
|
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 |
|
|
915
919
|
| `closeLabel` | `string` | 'Close' | aria-label of the cross |
|
|
916
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 |
|
|
917
921
|
|
|
@@ -992,6 +996,7 @@ Showcase section: `#toolbar`
|
|
|
992
996
|
| `size` | `'small' \| 'medium' \| 'large'` | inherited | The size of the controls inside |
|
|
993
997
|
| `orientation` | `'horizontal' \| 'vertical'` | 'horizontal' | Which arrows walk it (← → or ↑ ↓); the separators lie across |
|
|
994
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 |
|
|
995
1000
|
|
|
996
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.
|
|
997
1002
|
|
|
@@ -1022,6 +1027,7 @@ Showcase section: `#menubar`
|
|
|
1022
1027
|
| `size` | `'small' \| 'medium' \| 'large'` | inherited | The height of the bar, as for the controls |
|
|
1023
1028
|
| `ariaLabel` | `string` | 'Menu bar' | Accessible name of the bar |
|
|
1024
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 |
|
|
1025
1031
|
|
|
1026
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.
|
|
1027
1033
|
|
|
@@ -1048,6 +1054,7 @@ Showcase section: `#spoiler`
|
|
|
1048
1054
|
| `title` | `string` | '' | The button title |
|
|
1049
1055
|
| `name` | `string \| number` | — | The panel key inside TaoSpoilerGroup |
|
|
1050
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 |
|
|
1051
1058
|
| `@change` | `value` | — | The user opened or closed it |
|
|
1052
1059
|
|
|
1053
1060
|
**Slots, events, notes.** default — the body. Neighbours do not close each other.
|
|
@@ -1166,6 +1173,7 @@ Showcase section: `#alert`
|
|
|
1166
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 |
|
|
1167
1174
|
| `v-model:collapsed` | `boolean` | own | Folded or not; v-model:collapsed="true" starts folded. Better open for an error |
|
|
1168
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 |
|
|
1169
1177
|
|
|
1170
1178
|
**Slots, events, notes.** default — the text. #close-icon. v-if + @close — to hide it.
|
|
1171
1179
|
|
|
@@ -1190,9 +1198,15 @@ Showcase section: `#loader`
|
|
|
1190
1198
|
|
|
1191
1199
|
| Prop | Type | Default | Notes |
|
|
1192
1200
|
|---|---|---|---|
|
|
1193
|
-
| `
|
|
1194
|
-
| `
|
|
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 |
|
|
1195
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.
|
|
1196
1210
|
|
|
1197
1211
|
## TaoImage
|
|
1198
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
|
+
}
|
package/src/styles/index.css
CHANGED
|
@@ -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";
|