@synopackageland/ui 0.20.17 → 0.20.18

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/docs/callout.md CHANGED
@@ -51,6 +51,33 @@ otherwise the first toolbar (`AppToolbar`) or page header (`PageHeader`)
51
51
  shows one while a callout is closed, and none when nothing is. There is
52
52
  never a second icon, wherever the App puts the callout.
53
53
 
54
+ **A notice about a passing state closes for that appearance only.** For a
55
+ state that comes and goes (reconnecting, an error, a stalled capture), show
56
+ the Callout with `v-if` while the state lasts and set
57
+ `dismiss-scope="occurrence"`. Closing hides this appearance: nothing is
58
+ stored, and the dismissal is forgotten when the Callout unmounts, so the next
59
+ time the state starts the notice shows again. `persistent` (the default) is
60
+ the behaviour above.
61
+
62
+ ```vue
63
+ <Callout v-if="reconnecting" tone="warning" dismiss-key="reconnecting" dismiss-scope="occurrence">
64
+ Reconnecting… Notes are saved on this device until the connection is back.
65
+ </Callout>
66
+ ```
67
+
68
+ To show a closed callout again from code (its condition ended while it stays
69
+ mounted, or a setting was reset), forget its dismissal by its `dismissKey`:
70
+
71
+ ```ts
72
+ import { dismissalKey, forgetDismissal } from '@synopackageland/ui'
73
+
74
+ forgetDismissal(dismissalKey('reconnecting'))
75
+ ```
76
+
77
+ `dismissalKey(dismissKey)` is the storage key of the callout with that
78
+ `dismissKey`; `forgetDismissal(key)` removes it from this page load and from
79
+ `localStorage`, and a mounted callout under that key shows again.
80
+
54
81
  Storage is read and written inside `try`/`catch`: without it (a private
55
82
  window, blocked site data) a callout shows as usual, and closing it lasts for
56
83
  the page load.
@@ -160,6 +187,18 @@ and without an action, light and dark, and on a settings page:
160
187
  toast.success('Settings applied', 'Added port 6690')
161
188
  ```
162
189
 
190
+ `useToast()` needs a `<ToastProvider>` ancestor (the App puts one around
191
+ its shell) and
192
+ throws without it. A component that also mounts without the App shell (in
193
+ a unit test or a preview) asks for `useToast({ optional: true })`: without a
194
+ provider it gets a controller that shows nothing (its calls return -1,
195
+ `update` returns false). A test that wants to see the toasts provides its
196
+ own controller under the exported `toastControllerKey`:
197
+
198
+ ```ts
199
+ mount(Component, { global: { provide: { [toastControllerKey]: fakeToast } } })
200
+ ```
201
+
163
202
  - Work in progress keeps one toast id from start to result. A pending toast
164
203
  shows only if the work takes longer than 300 ms, has no timer, and turns
165
204
  into its result in place; an error's Retry can turn it back into pending:
@@ -197,6 +236,7 @@ and without an action, light and dark, and on a settings page:
197
236
  | `#details` + `v-model:expanded` | Longer text behind a "Learn more" toggle (`moreLabel`, `lessLabel`); in a hint, the tooltip of the whole line (`moreLabel` is not used) |
198
237
  | `code` | A machine error code, shown quieter after the message |
199
238
  | `dismissible` (default `true`), `dismissKey`, `closeLabel`, `@close` | The close button. Closing is remembered (a `danger` callout for this page load only) until the text changes; `dismissKey` is the callout's stable id within the App. `false` only for a state that must stay in view |
239
+ | `dismissScope` | `persistent` (default): closing is remembered as above. `occurrence`: this appearance only, forgotten when the Callout unmounts |
200
240
  | `fill` | Deprecated: a Callout spans its container by default |
201
241
 
202
242
  Theme hooks (`data-tone`, `data-variant`, `data-fill`, `data-dismissible`, the `data-ui-callout-*`
@@ -192,6 +192,13 @@ narrower; a row's last item has no neighbour to share room with), and on the
192
192
  InputSteppers presets button (shifted towards the text, same size). Unset,
193
193
  the box grows evenly as above.
194
194
 
195
+ A scroller cuts off the part of a box outside it on every side. A control on
196
+ a scroller's start edge loses that part too, so a scroller that holds page
197
+ content keeps the page gutter as its own padding: on touch a `SettingsPage`
198
+ body reaches over the gutter and pads its content by it. Tags in a select
199
+ field keep `--ui-tap-gap` between them on touch, so a tag's remove button
200
+ (44px box) never reaches the next tag.
201
+
195
202
  `check:mobile` exempts a link set in a sentence (inline, with text beside it
196
203
  in the same parent): WCAG 2.5.8 lets the line of text decide its size. A link
197
204
  alone on its line still needs 44px.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synopackageland/ui",
3
- "version": "0.20.17",
3
+ "version": "0.20.18",
4
4
  "description": "Shared Vue 3 UI component library with a DSM 7 inspired application theme",
5
5
  "license": "MIT",
6
6
  "type": "module",