@1337exp/taoui 3.4.1 → 4.0.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 CHANGED
@@ -1,5 +1,22 @@
1
1
  # Changelog
2
2
 
3
+ ## 4.0.1
4
+
5
+ - **TaoScrollTop:** the ripple is gone. It painted the wave in a tint that disappeared on the accent fill, so it was practically invisible and cost a DOM node, a timer and an `overflow: hidden` clip. The button now has the same 1px press as `TaoButton`.
6
+
7
+ ## 4.0.0
8
+
9
+ ### Breaking: English is the default language
10
+
11
+ - **Built-in texts are English by default** (they were Russian): placeholders, “Clear”, aria labels, `toast` / `confirm()` defaults, calendar captions. The date helpers (`formatTaoDateLabel` and friends) default to `en-US` instead of `ru-RU`, and `TaoDate` / `TaoDateRange` follow the active locale as before.
12
+ - **To stay on Russian**, pass the locale once: `app.use(TaoUI, { locale: localeRu })`, or `setTaoLocale(localeRu)` without the plugin. `localeRu` and `localeEn` are both still exported, nothing else changed in the locale API.
13
+ - `setTaoLocale(overrides)` now merges on top of English (it merged on top of Russian). Pass `setTaoLocale(overrides, localeRu)` to keep the old base.
14
+
15
+ ### Minimum width
16
+
17
+ - **`TaoButton` `minWidth`** (number = px, or any CSS length) and the **`--tao-button-min-width`** variable; default `0`, so nothing changes until you set it. Set the variable on one button, on a container or on `:root`.
18
+ - **`TaoSegmented` `minWidth`** and **`--tao-segmented-option-min-width`**: the minimum width of every option, including in `block` mode.
19
+
3
20
  ## 3.4.1
4
21
 
5
22
  - **Fix:** `TaoScrollTop` `variant="text"` could not be shown without a caption: `label=""` now hides it, leaving just the arrow button (the accessible name stays).
package/README.md CHANGED
@@ -222,12 +222,12 @@ app.mount('#app')
222
222
 
223
223
  ### Language
224
224
 
225
- Built-in texts (placeholders, “Clear”, aria labels, dates) are Russian by default. English ships with the library:
225
+ Built-in texts (placeholders, “Clear”, aria labels, dates) are English by default. Russian ships with the library:
226
226
 
227
227
  ```javascript
228
- import TaoUI, { localeEn } from '@1337exp/taoui'
228
+ import TaoUI, { localeRu } from '@1337exp/taoui'
229
229
 
230
- app.use(TaoUI, { locale: localeEn })
230
+ app.use(TaoUI, { locale: localeRu })
231
231
  ```
232
232
 
233
233
  Change single texts — the rest stays from the default:
@@ -236,7 +236,7 @@ Change single texts — the rest stays from the default:
236
236
  app.use(TaoUI, { locale: { select: { placeholder: 'Pick one' } } })
237
237
  ```
238
238
 
239
- Another language: copy `localeEn`, translate, pass it the same way (type `TaoLocale`). Keys repeat prop names —
239
+ Another language: copy `localeEn` (or `localeRu`), translate, pass it the same way (type `TaoLocale`). Keys repeat prop names —
240
240
  `locale.select.placeholder` is the default of TaoSelect `placeholder`, and a prop passed by hand always wins.
241
241
 
242
242
  Switch the language at any moment — from your settings, a language picker, a route. Components already on the page
@@ -246,12 +246,18 @@ update at once, without a reload and without losing what users typed:
246
246
  import { setTaoLocale, localeEn, localeRu } from '@1337exp/taoui'
247
247
 
248
248
  function onLanguageChange(lang) {
249
- setTaoLocale(lang === 'en' ? localeEn : localeRu)
249
+ setTaoLocale(lang === 'ru' ? localeRu : localeEn)
250
250
  }
251
251
  ```
252
252
 
253
253
  Without the plugin (individual components) `setTaoLocale()` is the only call you need.
254
254
 
255
+ ### Upgrading from 3.x
256
+
257
+ 4.0 changes one default: the built-in texts are now English (they were Russian). To stay on Russian, pass the locale
258
+ once — `app.use(TaoUI, { locale: localeRu })`, or `setTaoLocale(localeRu)` without the plugin. The date helpers and
259
+ the date components follow the locale and default to `en-US` as well.
260
+
255
261
  ### Upgrading from 1.x
256
262
 
257
263
  See [CHANGELOG.md](CHANGELOG.md): what broke, and a table of old names → new ones. Old names still work in 2.x and
package/README.ru.md CHANGED
@@ -224,12 +224,12 @@ app.mount('#app')
224
224
 
225
225
  ### Язык
226
226
 
227
- Встроенные тексты (плейсхолдеры, «Очистить», aria-подписи, даты) по умолчанию русские. Английский идёт в комплекте:
227
+ Встроенные тексты (плейсхолдеры, «Очистить», aria-подписи, даты) по умолчанию английские. Русский идёт в комплекте:
228
228
 
229
229
  ```javascript
230
- import TaoUI, { localeEn } from '@1337exp/taoui'
230
+ import TaoUI, { localeRu } from '@1337exp/taoui'
231
231
 
232
- app.use(TaoUI, { locale: localeEn })
232
+ app.use(TaoUI, { locale: localeRu })
233
233
  ```
234
234
 
235
235
  Поменять отдельные тексты — остальное останется от локали по умолчанию:
@@ -238,7 +238,7 @@ app.use(TaoUI, { locale: localeEn })
238
238
  app.use(TaoUI, { locale: { select: { placeholder: 'Выберите город' } } })
239
239
  ```
240
240
 
241
- Другой язык: скопируйте `localeEn`, переведите и передайте так же (тип `TaoLocale`). Ключи повторяют имена пропсов —
241
+ Другой язык: скопируйте `localeEn` (или `localeRu`), переведите и передайте так же (тип `TaoLocale`). Ключи повторяют имена пропсов —
242
242
  `locale.select.placeholder` — значение по умолчанию для `placeholder` у TaoSelect, а переданный руками проп всегда главнее.
243
243
 
244
244
  Язык можно переключать в любой момент — из настроек, переключателя языка, по маршруту. Уже показанные компоненты
@@ -248,12 +248,18 @@ app.use(TaoUI, { locale: { select: { placeholder: 'Выберите город'
248
248
  import { setTaoLocale, localeEn, localeRu } from '@1337exp/taoui'
249
249
 
250
250
  function onLanguageChange(lang) {
251
- setTaoLocale(lang === 'en' ? localeEn : localeRu)
251
+ setTaoLocale(lang === 'ru' ? localeRu : localeEn)
252
252
  }
253
253
  ```
254
254
 
255
255
  Без плагина (отдельные компоненты) достаточно одного вызова `setTaoLocale()`.
256
256
 
257
+ ### Переход с 3.x
258
+
259
+ В 4.0 поменялся один умолчательный параметр: встроенные тексты теперь английские (раньше были русские). Чтобы остаться
260
+ на русском, передайте локаль один раз: `app.use(TaoUI, { locale: localeRu })`, а без плагина — `setTaoLocale(localeRu)`.
261
+ Хелперы дат и компоненты дат следуют локали и по умолчанию тоже `en-US`.
262
+
257
263
  ### Переход с 1.x
258
264
 
259
265
  Смотрите [CHANGELOG.md](CHANGELOG.md): что сломалось и таблица «старое имя → новое». В 2.x старые имена ещё работают