@1337exp/taoui 5.49.2 → 5.51.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 +38 -0
- package/README.md +7 -6
- package/README.ru.md +7 -6
- package/dist/index.d.ts +479 -143
- package/dist/index.js +3096 -2189
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +2 -2
- package/skills/taoui/SKILL.md +12 -7
- package/skills/taoui/references/components.md +1416 -1392
- package/skills/taoui/references/patterns.md +273 -241
- package/skills/taoui/references/starters.md +435 -0
- package/src/styles/base.css +4 -4
- package/src/styles/tokens/primitives.css +8 -5
- package/src/styles/tokens/semantic.css +8 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@1337exp/taoui",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.51.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",
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"prepublishOnly": "npm run type-check && npm run test && npm run build && npm run lint:package",
|
|
83
83
|
"lint:package": "publint && attw --pack . --profile esm-only --exclude-entrypoints styles.css palettes.css",
|
|
84
84
|
"palettes": "node scripts/generate-palettes.mjs",
|
|
85
|
-
"skill": "node scripts/generate-skill.mjs && node scripts/generate-patterns.mjs"
|
|
85
|
+
"skill": "node scripts/generate-skill.mjs && node scripts/generate-patterns.mjs && node scripts/generate-starters.mjs"
|
|
86
86
|
},
|
|
87
87
|
"peerDependencies": {
|
|
88
88
|
"vue": "^3.4.0"
|
package/skills/taoui/SKILL.md
CHANGED
|
@@ -10,7 +10,9 @@ theme, a palette or a context class changes every component under it. The props
|
|
|
10
10
|
defaults, are in [references/components.md](references/components.md); read the section you need before writing a
|
|
11
11
|
component you have not used yet. **How to put them together** (the accent budget, choosing a size: small / medium / large and
|
|
12
12
|
density, a toolbar, the footer of a form, a destructive action: what to use when, with a do and a don't) is in [references/patterns.md](references/patterns.md); read
|
|
13
|
-
it before you compose a screen.
|
|
13
|
+
it before you compose a screen. **A new app starts from a starter** (a whole screen in one file, with the decisions it makes
|
|
14
|
+
and why: the app shell with a side menu, `TaoNav fill`) in [references/starters.md](references/starters.md); copy the one
|
|
15
|
+
that fits instead of composing the shell from scratch.
|
|
14
16
|
|
|
15
17
|
## Setup
|
|
16
18
|
|
|
@@ -78,7 +80,10 @@ choose a text colour, WCAG 2 to promise a number.
|
|
|
78
80
|
number is one column on compact. `rowHeight` is the exact row height (a mosaic: pictures are cropped).
|
|
79
81
|
- `TaoNav` — app navigation from one list: a bottom bar, a rail or a drawer, `layout="auto"` by its own width; put the page
|
|
80
82
|
in its default slot and it lays it out. `floating` makes the bar a detached pill (the FAB is your own button beside
|
|
81
|
-
it). `
|
|
83
|
+
it). `fill` makes it the shell of an app: it takes its parent's height (`html, body, #app { height: 100% }`), the
|
|
84
|
+
page scrolls inside `.tao-nav__content` and the footer stands at the bottom of the side panel; more than one child of
|
|
85
|
+
`#action` stack one under the other; `--tao-nav-compact` (1 on the bar and the rail, 0 on the side panel) is there for
|
|
86
|
+
your own pieces in the slots. `select(id, event)` + `event.preventDefault()` to route with a router. Widths `--tao-nav-rail-width` /
|
|
82
87
|
`--tao-nav-drawer-width`; the action button may take `shortcut="N"` (shown in the side panel, hidden when round). `surface="glass"` for a
|
|
83
88
|
translucent bar over the page (as on TaoCard; it turns solid where blur is off). `#footer`: a small line under the
|
|
84
89
|
items (version, About) in the rail and the side panel. `badgeTone="neutral"`: grey counters, the accent on the
|
|
@@ -102,7 +107,7 @@ choose a text colour, WCAG 2 to promise a number.
|
|
|
102
107
|
|
|
103
108
|
- `TaoDocTabs` (the tabs of open documents: `items` `{ value, label, dirty?, preview?, closable? }`, `v-model` the active one; it only draws the row: `@close`, `@pin`, `@reorder(from, to)`, `@menu` are requests the app carries out), `TaoCommandList` (the field and the list of the palette with no window, for a page, a panel or a `TaoPopover`; `@select` closes nothing), `TaoCommandPalette` (a dialog, `modal="false"` for a panel with no dimming, the whole screen on a phone by default, that searches `items` `{ id, label, group?, shortcut?, keywords?, disabled? }`, `Ctrl+K` style: you open it from your own key with `v-model`, `@select` runs the pick; the search alone is `matchCommands`), `TaoModal` (`fullscreen`, `fullscreen="narrow"` for a page on a phone), `TaoDrawer` (`side="bottom"` is the phone's
|
|
104
109
|
bottom sheet) — v-model; Escape closes the top layer only. `TaoPopover`, `TaoTooltip` (`placement`; the tip is the opposite of the theme; `shortcut` adds the key as a key cap; `bold` is on, semi-bold text; `animated` is the fade, off by default: a share of the base duration, `0` off, `1` base, `2` twice, or the token `--tao-tooltip-motion`). `TaoKbd` is the one look for a key (`variant` `cap` / `plain`): do not draw your own `<kbd>`.
|
|
105
|
-
- Menus share one engine: `TaoDropdownMenu`, `TaoMenubar`, `TaoContextMenu`, `TaoMenu` (the panel for your own shell). `TaoMenu` and `TaoPopover` take `anchor` as an element or a point `{ x, y }` of the screen (a menu at a drop point or at the pointer; recipe for a context menu: on `contextmenu` prevent the default and open at `clientX` / `clientY`, or just use `TaoContextMenu`).
|
|
110
|
+
- Menus share one engine: `TaoDropdownMenu`, `TaoMenubar`, `TaoContextMenu`, `TaoMenu` (the panel for your own shell). `TaoMenu` and `TaoPopover` take `anchor` as an element or a point `{ x, y }` of the screen (a menu at a drop point or at the pointer; recipe for a context menu: on `contextmenu` prevent the default and open at `clientX` / `clientY`, or just use `TaoContextMenu`). `TaoDropdownMenu block`: the button fills its place and draws nothing, for a whole chip of yours in `#button` (never style `.tao-dropdown-menu__button` from outside).
|
|
106
111
|
Items are a data tree `TaoMenuItem[]`: `{ id, label, icon?, shortcut?, disabled?, items? }`,
|
|
107
112
|
`{ type: 'checkbox' | 'radio', checked }`, `{ type: 'label' | 'separator' }`. `@select="id => …"`. `closeOnScroll`.
|
|
108
113
|
With TaoUX, `createCommands().toMenu(layout)` builds this tree and binds the same shortcuts.
|
|
@@ -119,10 +124,10 @@ choose a text colour, WCAG 2 to promise a number.
|
|
|
119
124
|
## Data and display
|
|
120
125
|
|
|
121
126
|
`TaoTable` (columns, sort, row click), `TaoPagination` (`pageInput` for hundreds of pages), `TaoList` / `TaoListItem` (`roving`: one Tab stop, arrows between the rows),
|
|
122
|
-
`TaoTree` (expand, select, tri-state `checkable`, lazy `load`), `TaoStages`, `TaoTimeline` (`active` makes it a progress),
|
|
127
|
+
`TaoTree` (expand, select, tri-state `checkable`, lazy `load`, a row context `menu`, `hint` / `tone` on a node, rows moved by drag and Ctrl+X / Ctrl+V through `@move` + `moveTreeNodes`), `TaoStages`, `TaoTimeline` (`active` makes it a progress),
|
|
123
128
|
`TaoTag`, `TaoAvatar`, `TaoImage`, `TaoCarousel`, `TaoCard` (`#media`, `#title`, `#sub`, `#footer`, `#corner`, `closable`,
|
|
124
129
|
`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`,
|
|
125
|
-
`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"`; `system` adds a third state, «follow the OS» (click: system → light → dark; `v-model` then holds `'system'` too, resolve it with `resolveTaoMode()`); `#icon="{ mode, choice, next }"` for your own glyph), `TaoMarquee` (one line that runs round only when it does not fit), `TaoScrubber` (play / pause + time),
|
|
130
|
+
`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"`; `system` adds a third state, «follow the OS» (click: system → light → dark; `v-model` then holds `'system'` too, resolve it with `resolveTaoMode()`); `#icon="{ mode, choice, next }"` for your own glyph), `TaoLanguageSwitch` (the language of the interface: a globe that opens a list of `:languages="['ru', 'en']"`, each under its own name from `Intl.DisplayNames` (`taoLanguageName(code)`); `v-model` is the code; it writes `<html lang>` unless `:apply="false"`; `icon-only` for a phone; the texts, the storage and `setTaoLocale` are the app's; not flags, not `RU | EN` in a `TaoSegmented`), `TaoMarquee` (one line that runs round only when it does not fit), `TaoScrubber` (play / pause + time),
|
|
126
131
|
`TaoScrollTop`, `TaoAnimatedBorder`, `TaoIcon`.
|
|
127
132
|
|
|
128
133
|
Small charts only: `TaoSparkline` (a trend), `TaoMeter` (a value in a range, `low` / `high` / `optimum`), `TaoDonut`
|
|
@@ -132,7 +137,7 @@ library and feed it `taoChartTheme()` / `watchTaoChartTheme(apply)`; do not buil
|
|
|
132
137
|
|
|
133
138
|
## Icons
|
|
134
139
|
|
|
135
|
-
`<TaoIcon name="tao-check" />`:
|
|
140
|
+
`<TaoIcon name="tao-check" />`: 44 built-in SVG icons under the `tao-` prefix (incl. `tao-settings`, `tao-edit`, `tao-trash`, `tao-bell`, `tao-tag`, `tao-repeat`, `tao-undo`, `tao-redo`, `tao-sun`, `tao-moon`, `tao-monitor`, `tao-globe` for the language) (`taoIconNames`). Your own:
|
|
136
141
|
`registerTaoIcons({ rocket: { body: '<path d="…"/>' } })` on a 24 grid with `currentColor`; add `grid: true` for icons made
|
|
137
142
|
only of straight lines through the middle (a plus), so they stay crisp when small. Any other name renders the class
|
|
138
143
|
`icon-<name>` for an icon font you bring.
|
|
@@ -142,7 +147,7 @@ only of straight lines through the middle (a plus), so they stay crisp when smal
|
|
|
142
147
|
`app.use(TaoUI, { locale: localeRu })`; `setTaoLocale(localeEn)` switches at run time without a reload; a prop passed by
|
|
143
148
|
hand (`placeholder`, `closeLabel`…) always wins. For SSR per request, `provideTaoLocale`.
|
|
144
149
|
|
|
145
|
-
Scrollbars: thin (
|
|
150
|
+
Scrollbars: thin (6px) by default; `--tao-scrollbar-size` / `-thumb` / `-track` / `-width` (Firefox) change them on the page or on a block, the class `tao-native-scrollbars` (on `<html>` or a block) gives the browser's own back.
|
|
146
151
|
|
|
147
152
|
Which language to start with: `detectTaoLanguage(['en', 'ru'], { fallback?, requested? })` returns one of your languages by `navigator.languages` (`parseAcceptLanguage(header)` for a server); it only answers, `setTaoLocale` sets. A locale text may be plural forms `{ one, few, many, other }` (`formatTaoText(text, { count }, code)` does it for your own texts); a plain string stays the same for every number.
|
|
148
153
|
|