@editora/toast 2.0.9 → 2.1.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 +28 -0
- package/README.md +376 -860
- package/dist/core/ToastManager.d.ts +1 -1
- package/dist/core/ToastRenderer.d.ts +24 -3
- package/dist/core/ToastStack.d.ts +8 -0
- package/dist/core/icons.d.ts +2 -0
- package/dist/core/types.d.ts +3 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +13 -16
- package/dist/index.esm.js +490 -310
- package/dist/index.umd.js +1 -1
- package/dist/toast.css +467 -744
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 2.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- ba54cae: Toast: a modern look, a stack that opens on hover, keyboard access and a complete `toast` API.
|
|
8
|
+
|
|
9
|
+
**Look.** The card is now opaque and neutral, with a status icon (one shape per level, a spinner for loading), instead of a 6% tint with a coloured stripe. The old tint made the toast 94% transparent, so the page showed through its text, and in dark mode the primary action button was white on white. The `dark` theme is now dark (it was a white card), `richColors` tints the card, `colored` and `glass` meet 4.5:1 contrast, and every theme was checked at 4.5:1 for text and 3:1 for icons in light and dark. `system` follows `prefers-color-scheme` and the app's own switch (a `dark` class or `data-theme`, `data-bs-theme`, `data-color-scheme`, `data-mantine-color-scheme` on `<html>`). `icon` accepts text, a DOM node or `false`; `configure({ icons: false })` turns the built-in icons off.
|
|
10
|
+
|
|
11
|
+
**Stacking.** Several toasts fold into a deck by default (`stack: true, expand: false`): the newest in full, older ones as edges behind it; hover, focus or a tap opens it into a list. The newest toast is now always nearest the edge of the screen (it was farthest). A dismissed toast leaves the layout at once. `configure({ stack: false })` gives a plain list. The layout uses `translate`/`scale`, so the animation types and swipe-to-dismiss still work.
|
|
12
|
+
|
|
13
|
+
**Behaviour.** Timers hold for the whole stack while it is hovered or focused and keep the time that was left (they used to restart from the full duration); a toast that arrives meanwhile is held too. Toasts are Tab stops; Alt+T (`hotkey`) focuses the newest, Escape dismisses the focused one and hands focus on; `pauseOnFocus` is on by default.
|
|
14
|
+
|
|
15
|
+
**API.** `toast('text')` shows a plain toast, and `toast.show`, `.promise`, `.update`, `.dismiss(id?)` (no id clears all), `.clear` and `.configure` complete the simple API; they do nothing on the server. `toast.promise(…, { success: { title, description } })` now replaces the loading text instead of keeping it.
|
|
16
|
+
|
|
17
|
+
**Fixes.** The progress bar had no styling and a zero-width track, so it never showed; it now sits in the text column and survives a message update. The primary action button took its colours from `:root`, so themed toasts got the wrong fill.
|
|
18
|
+
|
|
19
|
+
**Upgrading.** The layout uses the individual `translate` and `scale` CSS properties, so it needs Chrome 104, Safari 14.1 or Firefox 72 or later. If you styled toasts with CSS, the `::before` accent stripe and the tinted `background` of the level classes are gone: use the `--et-*` variables (`--et-bg`, `--et-text`, `--et-success`, …) or restyle `.editora-toast`. `configure({ stack: false })` restores a list; `configure({ icons: false })` removes the icons. The package is 15 KB gzipped JS plus 5 KB CSS (12 KB + 7 KB before); the README's "9 KB" figure was out of date.
|
|
20
|
+
|
|
21
|
+
## 2.0.10
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- 16ae8ee: Rewrite the READMEs of `@editora/light-code-editor`, `@editora/themes`, `@editora/ui-core`, `@editora/ui-react`, `@editora/ui-sortable` and `@editora/toast`, which are the npm pages of these packages, with screenshots and examples.
|
|
26
|
+
|
|
27
|
+
Their images and links were relative paths that npm cannot show, and several examples did not run. Every example is now a file that is type-checked in strict mode and run in Chromium (React ones under `StrictMode`, drag and drop with the pointer and the keyboard), and the README quotes it word for word (`npm run check:readme-examples`). The screenshots are taken from the same examples (`npm run readme:screenshots`).
|
|
28
|
+
|
|
29
|
+
Things the READMEs now get right that they did not: the `@editora/themes` tokens only set text, border and shadow colours (backgrounds are set by rules), the helpers it exports are documented; `@editora/ui-core` and `@editora/ui-react` list measured bundle sizes (a Button imported from the `@editora/ui-react` root is 1 MB gzipped up front, from its own entry 54 KB up front plus the rest of `ui-core` loaded later); `@editora/toast` documents its defaults (bottom right, four seconds, three visible, theme `system`) and that it is safe to import on the server.
|
|
30
|
+
|
|
3
31
|
## 2.0.9
|
|
4
32
|
|
|
5
33
|
### Patch Changes
|