@1337exp/taoui 3.2.1 → 3.3.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 ADDED
@@ -0,0 +1,184 @@
1
+ # Changelog
2
+
3
+ ## 3.3.0
4
+
5
+ ### Presentation
6
+
7
+ - **Showcase in English and Russian:** language switch in the header, `?lang=`, built-in component texts follow the page. English is the default.
8
+ - **Static showcase build** with relative paths (`npm run showcase:build`), ready for any folder such as `/sandbox/taoui/`.
9
+ - Repository polish: `LICENSE` (MIT), `CONTRIBUTING.md` (with the colour-token rules), `SECURITY.md`, CI, issue / PR templates, a media pipeline (`npm run media`) that captures the screenshots and clips in `docs/media`.
10
+
11
+ ### Light theme
12
+
13
+ - **Light theme has its own palette** (taken from the original 666.io site) instead of a copy of the dark one: rose accent `#ff227a` (hover `#e60f66`, active `#c70a55`), black links that turn `#dc4679` on hover, white text on accent. New primitives `--tao-pink-400 … 700`.
14
+ - **Text on a solid danger fill is white in every theme** (new token `--tao-color-on-danger`); it used to follow `text-strong`, which is near-black in the light theme (danger Button, Avatar count).
15
+ - Light theme: idle text of Segmented and Tabs (`--tao-color-text-subtle`) is darker (`gray-600`).
16
+ - **Fix:** `TaoInputNumber` ± buttons no longer overflow in the `small` size.
17
+ - New optional token `--tao-button-primary-text-shadow` (none by default; the light theme sets a soft one).
18
+ - The light theme no longer inherits the dark theme's glowing link shadow.
19
+
20
+ ### Status colours as text
21
+
22
+ - **New tokens `--tao-color-{danger,success,warning,info}-text` and `-text-hover`** for status colours used as text. The plain tokens are the solid-fill shades (white text on top); as text on a dark page they were dim (danger about 4:1). The text tokens use lighter shades in the dark theme and darker ones in the light theme (new primitives `green-700`, `yellow-700`, `blue-700`), at least 4.5:1 on the page and on raised surfaces, enforced by `tests/tokens.test.ts`.
23
+ - Used by `text` / `ghost` / `secondary` Button tones, Tag, Stages, FileDrop, FormField and the error text of Input and Textarea. Fills, borders and toasts are unchanged.
24
+
25
+ ### Feedback
26
+
27
+ - **toast():** a light shadow hugging the edge (hook `--tao-toast-shadow`) instead of the large overlay shadow, which showed as a wide smear on stacked toasts.
28
+ - **`TaoButton` `tone="neutral"`** for `ghost` and `text`: strong text colour with the soft accent wash on hover.
29
+ - **confirm():** the cancel button is `ghost` with `tone="neutral"`, so the primary action stands out and the dialog feels lighter.
30
+
31
+ ## 3.2.1
32
+
33
+ - **TaoColorPicker:** the HEX label sits above the field, like the labels over the RGB / HSL channels, so the row keeps its height in every mode.
34
+
35
+ ## 3.2.0
36
+
37
+ - **TaoPinCode `format`:** `format="#-##-##"` draws visual separators between cells. They are not part of the value; a paste in that shape, or as a clean code, is split into cells.
38
+ - **TaoColorPicker:** fixed width, so switching HEX / RGB / HSL no longer resizes the popover.
39
+
40
+ ## 3.1.1
41
+
42
+ - **Popovers close on an outside press in the capture phase**, so a component that stops propagation can no longer keep a popover open.
43
+ - **TaoColorPicker:** text is centred in the HEX, RGB and HSL fields.
44
+
45
+ ## 3.1.0
46
+
47
+ ### Colour
48
+
49
+ - **New `TaoColorPicker`**: square of saturation and brightness, hue and opacity strips, a hex field, swatches, the eyedropper where the browser has `EyeDropper`. `v-model` is a hex string (`#rrggbb`, with `alpha` also `#rrggbbaa`); keyboard: arrows move the cursor (Shift is ten times bigger).
50
+ - **Input modes**: HEX, RGB and HSL numbers, switched under the square (`modes` limits them, `v-model:mode` remembers the choice). Opacity is a percent field in RGB and HSL. `parseColor` reads `hsl()` and `hsla()` too; `rgbToHsl` and `hslToRgb` are exported.
51
+ - **New `TaoColorInput`**: a field with a swatch and the hex text; the picker opens in a popover.
52
+ - **`colorModel(source, options)`** turns your own colour storage (object, array, css string; 0…255 or 0…1; sRGB or linear) into a writable hex string for `v-model`. The pure helpers (`parseColor`, `toHex`, `rgbaToHsva`, `srgbToLinear`, ...) are exported too.
53
+ - `TaoSlider`: `ariaLabel` prop and CSS hooks `--tao-slider-track-bg`, `--tao-slider-fill-bg`, `--tao-slider-thumb-bg` (the picker colours its strips with them).
54
+ - Locale section `colorPicker`.
55
+
56
+ ## 3.0.0
57
+
58
+ Cleaner slider family. Breaking changes are allowed in this major: quality over compatibility.
59
+
60
+ ### Slider
61
+
62
+ - **New `TaoRangeSlider`**: two thumbs, `v-model` is a `[from, to]` pair, `minGap` keeps the thumbs apart.
63
+ - **`TaoSlider` and `TaoRangeSlider` share props:** `marks` (`true` for automatic ticks, numbers, or `{ value, label? }`),
64
+ `discrete` (the value only sits on marks: stepped scales with captions), `format`, `vertical`, plus the old
65
+ `min / max / step / variant / size / showValue / disabled / error / wheel`. Clicking a mark caption moves the nearest thumb.
66
+ Slot `#mark="{ mark, active }"` draws a custom caption.
67
+ - **`marksSide`** (`'end'` by default, or `'start'`) puts the marks above a horizontal slider / left of a vertical one.
68
+ - **`flat`** hides the round thumbs (a plain filled bar); they stay in the markup for keyboard and screen readers.
69
+ - **Pure logic in `src/slider.ts`** (value ↔ position, steps without float tails, nearest thumb, marks) with unit tests.
70
+
71
+ ### Fixes
72
+
73
+ - **TaoSlider takes focus on press** (it used to keep it in a text field). The field blurs first and commits its text, then the slider
74
+ sets the value.
75
+ - **TaoInputNumber:** a value changed from outside (a slider, another field) now replaces the draft of a focused field, so blur does not
76
+ write the stale text over it. Typing is not affected: the echo of the field's own value does not overwrite the draft.
77
+
78
+ - **A range collapsed into one point can be pulled apart again:** pressing exactly on the point decides the thumb by the direction of the
79
+ first move (right: the upper one, left: the lower one). With `flat` such a range shows a small dash instead of disappearing.
80
+
81
+ - **No focus ring after a mouse press:** the ring is for the keyboard; it comes back on the first key press.
82
+
83
+ ### Timeline
84
+
85
+ - **New `TaoTimeline`**: play / pause and «to start» buttons, a slider over time with event marks, a «time / length» label.
86
+ `v-model` is the time, `v-model:playing` the play state; `pauseOnScrub` pauses when the user grabs the slider; `marks`, `marksSide`,
87
+ `format`, `showRestart`, `showTime`, `variant`, `size`, slots `#mark` and `#time`. It does not advance the time itself: drive it with
88
+ anything (for example `usePlayback` from `@1337exp/taoux/playback`). New locale section `timeline` (`playLabel`, `pauseLabel`, `restartLabel`).
89
+
90
+ ### Breaking
91
+
92
+ - `TaoSlider` `v-model` is a **number** now; the `number | string` form is gone.
93
+ - **Right-click to type a value is gone** (with the `placeholder` prop): use `TaoInputNumber` next to the slider.
94
+ - **Markup:** the root is a `group`; each thumb is its own focusable `role="slider"` (keys go to the thumb, `id` for labels is on the first thumb).
95
+ The pointer area is `.tao-slider__rail`; the root also holds the marks.
96
+ - `wheel` works for a single thumb only.
97
+
98
+ ## 2.0.0
99
+
100
+ One size scale, one API standard, built-in texts in any language. Old prop and event names keep working
101
+ as deprecated aliases and print a warning in development builds; they will be removed in 3.0.
102
+
103
+ ### Breaking
104
+
105
+ - **Size modifier classes are gone.** Sizes now come from CSS variables set by `.tao-size-small` / `-medium` / `-large`.
106
+ If your CSS targeted these classes, switch to `.tao-size-*` or the variables:
107
+ `tao-button--small|medium|large`, `tao-select--small|large`, `tao-combobox--small|large`,
108
+ `tao-select__panel--*`, `tao-combobox__panel--*`, `tao-segmented--*`, `tao-segmented-option--small|medium|large`,
109
+ `tao-pagination--small`, `tao-table--compact`, `tao-list--*`, `tao-list-item--s|m|l`, `tao-file-drop__zone--*`,
110
+ `tao-slider--small` (now `tao-slider--thin`), `tao-textarea--no-border` / `--center`
111
+ (now `--filled` / `--plain` / `--align-center`).
112
+ - **`size` has no default any more — it inherits.** A control without `size` takes the size of its ancestors,
113
+ `medium` at the root, so pages without `.tao-size-*` look the same.
114
+ - **`--tao-field-height` is now an alias of `--tao-control-height`** and follows the current size.
115
+ Overriding it no longer changes field height — override `--tao-control-height-medium` instead.
116
+ - **TaoSlider `size="small"` is a smaller bar now, not the thin track.** Use `variant="thin"` for seek / volume.
117
+ - **Small visual changes:**
118
+ - Pagination `small` buttons 28 → 26px;
119
+ - List rows `small` 32 → 26px, `large` 48 → 44px, titles 12 / 14 / 16px;
120
+ - Table `size="small"` (old `compact`) cell text 13 → 12px;
121
+ - Tag is 20px in medium with or without the close button (was 19 / 22);
122
+ - Tabs tab 37 → 36px (Button height);
123
+ - icon-only Segmented options are square;
124
+ - Textarea min-height equals the control height;
125
+ - Select / Combobox `large`: the clear and empty rows are 14px;
126
+ - Textarea `dummy` no longer shows a red bar.
127
+ - **TaoCarousel on mouse / trackpad** scrolls freely and settles on a whole slide after it stops
128
+ (CSS snap stays only on touch screens). A mouse drag keeps its momentum.
129
+
130
+ ### Added
131
+
132
+ - **Sizes.** `TaoSize` (`small | medium | large`) on Button, Input, InputNumber, Quantity, Textarea, Select, Combobox,
133
+ Date, DateRange, Segmented, Checkbox, Radio / RadioGroup, Switch, Tag, Tabs, Pagination, FileDrop, Slider, Table,
134
+ List, PinCode, InputGroup and FormField. `class="tao-size-small"` on any element sizes the whole block.
135
+ Tokens: `--tao-control-height` / `-padding-x` / `-padding-y` / `-font-size` / `-font-size-secondary`,
136
+ `--tao-button-padding-x`, `--tao-indicator-size`, `--tao-tag-height` / `-padding-x` / `-font-size`.
137
+ - **Locale.** `app.use(TaoUI, { locale: localeEn })`, `setTaoLocale()`, `localeRu` (default), `localeEn`,
138
+ types `TaoLocale`, `TaoLocaleOverrides`, `TaoUIOptions`. Pass a few keys to change single texts.
139
+ Switching at runtime updates components already on the page.
140
+ - **Surfaces.** `surface` on TaoCard / TaoBlock (`flat | grain | glass`, type `TaoSurface`) and classes
141
+ `.tao-surface-grain` / `-glass` for any element. Theme tokens `--tao-surface-grain-image` / `-size`,
142
+ `--tao-glass-fill` / `-border` / `-blur`. Toast and confirm are glass by default (`surface` in their defaults, options
143
+ and builders; `'flat'` turns it off). Glass falls back to a solid panel without blur support or with
144
+ `prefers-reduced-transparency`.
145
+ - **`error`** on InputNumber, Quantity, Switch, Segmented, Radio, RadioGroup, Slider and PinCode.
146
+ - **`change`** on Slider, Split (on release), Spoiler, Tabs; FileDrop and Table got `change` too.
147
+ - **PinCode** `disabled`, `size`, `masked`. **Textarea** `variant` (`bar | outline | filled | plain`), `readonly`,
148
+ `align`, `autofocus`, `blurOnEnter`. **Checkbox** `checked`. **Container** `width`. **Link** `newTab`.
149
+ **ScrollTop** `outline`. **Space / Stages** `direction`. **Copy** `successText`. **Tabs** `items`.
150
+ - **Types** `TaoTone`, `TaoLength` (number → px, string → CSS), `TaoTabItem`.
151
+ - Length props accept both numbers and strings: Block / Card `padding` and `radius`, Flex / Grid `gap`,
152
+ Grid `min`, List / Table `maxHeight`.
153
+ - Dev-only warnings for deprecated props, events and values (once per component and name).
154
+ - Tests (`npm test`, Vitest).
155
+
156
+ ### Fixed
157
+
158
+ - Textarea `noSpace` also strips spaces from pasted text.
159
+ - Textarea `borderInverse` turns red on error.
160
+ - Slider is marked invalid inside an invalid TaoFormField.
161
+
162
+ ### Deprecated → use instead
163
+
164
+ | Component | Deprecated | Use |
165
+ |---|---|---|
166
+ | Alert, Tag | `type` | `tone` |
167
+ | Tag | `pointer` | `clickable` |
168
+ | Input | `label`, `errorMessage` | `label` / `error` of TaoFormField |
169
+ | Textarea | `noBorder`, `noBackground` | `variant="filled"`, `variant="plain"` |
170
+ | Textarea | `dummy`, `textCenter`, `autoFocus`, `submitOnEnter`, `borderInverse` | `readonly`, `align="center"`, `autofocus`, `blurOnEnter`, `variant` |
171
+ | Table | `compact`, event `sort` | `size="small"`, event `change` |
172
+ | FileDrop | event `files` | event `change` |
173
+ | DropdownMenu | event `selected` | event `select` |
174
+ | Tabs | `tabs`, item `key` | `items`, item `value` |
175
+ | Checkbox | `value` (boolean) | `checked` or v-model |
176
+ | PinCode | `hidden` | `masked` |
177
+ | Copy | `successMessage` | `successText` |
178
+ | ScrollTop | `hasOutline`, `tabindex` prop | `outline`, plain `tabindex` attribute |
179
+ | Link | `asNewTab` | `newTab` |
180
+ | Space, Stages | `vertical` | `direction` |
181
+ | Container | `size` | `width` |
182
+ | Avatar | `size="s"` / `"m"` / `"l"` | `small` / `medium` / `large` |
183
+ | Divider | `size="big"` | `size="large"` |
184
+ | — | `TaoSegmentedSize` | `TaoSize` |
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 1337exp
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.