@synopackageland/ui 0.20.16 → 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/CHANGELOG.md +12 -0
- package/dist/cli.js +0 -0
- package/dist/components/composite/callout/Callout.vue.d.ts +11 -0
- package/dist/components/composite/callout/calloutDismissal.d.ts +17 -2
- package/dist/components/primitives/toast/toast.d.ts +11 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.js +6333 -6304
- package/dist/json-preview/preview.js +3601 -3597
- package/dist/reka-runtime.json +1 -1
- package/dist/rich-text.js +1 -1
- package/dist/theme.css +1 -1
- package/dist/themes/dsm7-embedded-theme.css +1 -1
- package/dist/themes/dsm7-embedded.css +1 -1
- package/dist/themes/dsm7.css +1 -1
- package/docs/callout.md +40 -0
- package/docs/mobile-native.md +28 -0
- package/package.json +58 -65
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-*`
|
package/docs/mobile-native.md
CHANGED
|
@@ -171,6 +171,34 @@ own) keeps scrolling. An App that puts small controls flush with the edge of
|
|
|
171
171
|
its own scroller, outside a `PageContent`, clips that content sideways the
|
|
172
172
|
same way.
|
|
173
173
|
|
|
174
|
+
A control at the end edge of its own component is the component's job, not
|
|
175
|
+
the page's: a dismissible Callout is often full width in an App's own
|
|
176
|
+
scroller with no `PageContent` around it. Such a control sets
|
|
177
|
+
`--ui-hit-end-room` on itself to the room between it and the component's
|
|
178
|
+
end edge, and its box stops there and grows towards its start side instead,
|
|
179
|
+
still the full minimum:
|
|
180
|
+
|
|
181
|
+
```css
|
|
182
|
+
inset-inline-end: max(min(0px, calc((100% - var(--ui-hit-min)) / 2)), calc(-1 * var(--ui-hit-end-room, var(--ui-hit-min))));
|
|
183
|
+
inset-inline-start: calc(min(0px, 100% - var(--ui-hit-min)) - <inset-inline-end>);
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
The Callout close button (6px; 0 for an inline Callout), a Tag's remove
|
|
187
|
+
button, the SearchField clear button, the password reveal button, the
|
|
188
|
+
PathDisplay copy button and the Notification close button set it. A
|
|
189
|
+
component's own smaller slop stops at its end edge too: on the last
|
|
190
|
+
FileThumbs and RichTextEditor thumbnail and remove badge (the last box is
|
|
191
|
+
narrower; a row's last item has no neighbour to share room with), and on the
|
|
192
|
+
InputSteppers presets button (shifted towards the text, same size). Unset,
|
|
193
|
+
the box grows evenly as above.
|
|
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
|
+
|
|
174
202
|
`check:mobile` exempts a link set in a sentence (inline, with text beside it
|
|
175
203
|
in the same parent): WCAG 2.5.8 lets the line of text decide its size. A link
|
|
176
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.
|
|
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",
|
|
@@ -60,61 +60,6 @@
|
|
|
60
60
|
"./themes/dsm7-embedded-reset.css": "./dist/themes/dsm7-embedded-reset.css",
|
|
61
61
|
"./themes/dsm7-embedded-theme.css": "./dist/themes/dsm7-embedded-theme.css"
|
|
62
62
|
},
|
|
63
|
-
"scripts": {
|
|
64
|
-
"check:docs": "node --test scripts/check-doc-versions.test.mjs && node scripts/check-doc-versions.mjs",
|
|
65
|
-
"dev": "vite build --watch",
|
|
66
|
-
"build": "vite build && vite build --mode json && vite build --mode rich-text && vite build --mode grid && vite build --mode cli && vite build --mode preview && vite build --mode embedded && node scripts/postbuild.mjs",
|
|
67
|
-
"lint": "eslint .",
|
|
68
|
-
"typecheck": "vue-tsc --noEmit -p tsconfig.json",
|
|
69
|
-
"test": "vitest run",
|
|
70
|
-
"test:watch": "vitest",
|
|
71
|
-
"test:changed": "echo \"test:changed skips the tests the changes since ${SYNOPKGLAND_GATE_BASE:-origin/master} do not reach (vitest --changed); pnpm check runs them all\" && vitest run --changed ${SYNOPKGLAND_GATE_BASE:-origin/master}",
|
|
72
|
-
"story": "histoire dev",
|
|
73
|
-
"story:build": "histoire build",
|
|
74
|
-
"check:host": "node scripts/dsm-host-shots.mjs",
|
|
75
|
-
"check:switch": "node scripts/check-switch.mjs",
|
|
76
|
-
"check:tabs": "node scripts/check-tabs.mjs",
|
|
77
|
-
"check:mobile": "node scripts/check-mobile-overflow.mjs",
|
|
78
|
-
"check:ui-patch": "node scripts/check-ui-patch.mjs",
|
|
79
|
-
"check:narrow": "node scripts/check-narrow-controls.mjs",
|
|
80
|
-
"check:drawer-form": "node scripts/check-drawer-form.mjs",
|
|
81
|
-
"check:responsive": "node scripts/check-responsive.mjs",
|
|
82
|
-
"check:adaptive": "node scripts/check-adaptive.mjs",
|
|
83
|
-
"check:sidebar-focus": "node scripts/check-sidebar-focus.mjs",
|
|
84
|
-
"check:json-render": "node scripts/check-json-render.mjs",
|
|
85
|
-
"check:motion": "node scripts/check-motion.mjs",
|
|
86
|
-
"check:topology": "node scripts/check-topology.mjs",
|
|
87
|
-
"check:wizard": "node scripts/check-wizard.mjs",
|
|
88
|
-
"check:edges": "node scripts/check-edges.mjs",
|
|
89
|
-
"check:data-grid": "node scripts/check-data-grid.mjs",
|
|
90
|
-
"check:truncation": "node scripts/check-truncation.mjs",
|
|
91
|
-
"check:link": "node scripts/check-link.mjs",
|
|
92
|
-
"check:text-select": "node scripts/check-text-select.mjs",
|
|
93
|
-
"check:date-picker": "node scripts/check-date-picker.mjs",
|
|
94
|
-
"check:full-page": "node scripts/check-full-page.mjs",
|
|
95
|
-
"check:short-viewport": "node scripts/check-short-viewport.mjs",
|
|
96
|
-
"check:focus-restore": "node scripts/check-focus-restore.mjs",
|
|
97
|
-
"check:detail-surface": "node scripts/check-detail-surface.mjs",
|
|
98
|
-
"check:internal": "node --test scripts/check-internal-content.test.mjs scripts/check-npm-metadata.test.mjs && node scripts/check-internal-content.mjs --repo .",
|
|
99
|
-
"check:npm-metadata": "node scripts/check-npm-metadata.mjs",
|
|
100
|
-
"check:package": "node scripts/check-package-content.mjs",
|
|
101
|
-
"check:public-api-consumer": "node scripts/check-public-api-consumer.mjs",
|
|
102
|
-
"notices:update": "node scripts/third-party-notices.mjs --write",
|
|
103
|
-
"notices:check": "node scripts/third-party-notices.mjs --check",
|
|
104
|
-
"check": "bash scripts/docker-check.sh \"npm run gates\"",
|
|
105
|
-
"check:fast": "bash scripts/docker-check.sh \"npm run gates\"",
|
|
106
|
-
"check:local-browser": "node scripts/app-local-browser.mjs",
|
|
107
|
-
"check:infotip": "node scripts/check-infotip.mjs",
|
|
108
|
-
"release:stage": "node scripts/stage-release.mjs",
|
|
109
|
-
"check:polish": "bash scripts/docker-check.sh --build --out .polish-shots 'node scripts/check-polish.mjs'",
|
|
110
|
-
"check:acceptance": "node scripts/check-acceptance.mjs",
|
|
111
|
-
"check:palette": "node scripts/check-palette.mjs",
|
|
112
|
-
"gates": "node scripts/gates.mjs",
|
|
113
|
-
"gates:full": "node scripts/gates.mjs --full",
|
|
114
|
-
"check:layout": "node scripts/check-layout.mjs",
|
|
115
|
-
"release:smoke": "node scripts/release-smoke.mjs",
|
|
116
|
-
"check:browser-install": "playwright install chromium"
|
|
117
|
-
},
|
|
118
63
|
"peerDependencies": {
|
|
119
64
|
"vue": "^3.5.0"
|
|
120
65
|
},
|
|
@@ -165,13 +110,6 @@
|
|
|
165
110
|
"engines": {
|
|
166
111
|
"node": ">=20"
|
|
167
112
|
},
|
|
168
|
-
"packageManager": "pnpm@10.33.2",
|
|
169
|
-
"pnpm": {
|
|
170
|
-
"onlyBuiltDependencies": [
|
|
171
|
-
"esbuild",
|
|
172
|
-
"vue-demi"
|
|
173
|
-
]
|
|
174
|
-
},
|
|
175
113
|
"config": {
|
|
176
114
|
"bundledRuntime": {
|
|
177
115
|
"@tanstack/vue-virtual": "3.13.39",
|
|
@@ -179,5 +117,60 @@
|
|
|
179
117
|
"reka-ui": "2.11.0"
|
|
180
118
|
}
|
|
181
119
|
},
|
|
182
|
-
"homepage": "https://www.varvis.me/docs/"
|
|
183
|
-
|
|
120
|
+
"homepage": "https://www.varvis.me/docs/",
|
|
121
|
+
"scripts": {
|
|
122
|
+
"check:docs": "node --test scripts/check-doc-versions.test.mjs && node scripts/check-doc-versions.mjs",
|
|
123
|
+
"dev": "vite build --watch",
|
|
124
|
+
"build": "vite build && vite build --mode json && vite build --mode rich-text && vite build --mode grid && vite build --mode cli && vite build --mode preview && vite build --mode embedded && node scripts/postbuild.mjs",
|
|
125
|
+
"lint": "eslint .",
|
|
126
|
+
"typecheck": "vue-tsc --noEmit -p tsconfig.json",
|
|
127
|
+
"test": "vitest run",
|
|
128
|
+
"test:watch": "vitest",
|
|
129
|
+
"test:changed": "echo \"test:changed skips the tests the changes since ${SYNOPKGLAND_GATE_BASE:-origin/master} do not reach (vitest --changed); pnpm check runs them all\" && vitest run --changed ${SYNOPKGLAND_GATE_BASE:-origin/master}",
|
|
130
|
+
"story": "histoire dev",
|
|
131
|
+
"story:build": "histoire build",
|
|
132
|
+
"check:host": "node scripts/dsm-host-shots.mjs",
|
|
133
|
+
"check:switch": "node scripts/check-switch.mjs",
|
|
134
|
+
"check:tabs": "node scripts/check-tabs.mjs",
|
|
135
|
+
"check:mobile": "node scripts/check-mobile-overflow.mjs",
|
|
136
|
+
"check:ui-patch": "node scripts/check-ui-patch.mjs",
|
|
137
|
+
"check:narrow": "node scripts/check-narrow-controls.mjs",
|
|
138
|
+
"check:drawer-form": "node scripts/check-drawer-form.mjs",
|
|
139
|
+
"check:responsive": "node scripts/check-responsive.mjs",
|
|
140
|
+
"check:adaptive": "node scripts/check-adaptive.mjs",
|
|
141
|
+
"check:sidebar-focus": "node scripts/check-sidebar-focus.mjs",
|
|
142
|
+
"check:json-render": "node scripts/check-json-render.mjs",
|
|
143
|
+
"check:motion": "node scripts/check-motion.mjs",
|
|
144
|
+
"check:topology": "node scripts/check-topology.mjs",
|
|
145
|
+
"check:wizard": "node scripts/check-wizard.mjs",
|
|
146
|
+
"check:edges": "node scripts/check-edges.mjs",
|
|
147
|
+
"check:data-grid": "node scripts/check-data-grid.mjs",
|
|
148
|
+
"check:truncation": "node scripts/check-truncation.mjs",
|
|
149
|
+
"check:link": "node scripts/check-link.mjs",
|
|
150
|
+
"check:text-select": "node scripts/check-text-select.mjs",
|
|
151
|
+
"check:date-picker": "node scripts/check-date-picker.mjs",
|
|
152
|
+
"check:full-page": "node scripts/check-full-page.mjs",
|
|
153
|
+
"check:short-viewport": "node scripts/check-short-viewport.mjs",
|
|
154
|
+
"check:focus-restore": "node scripts/check-focus-restore.mjs",
|
|
155
|
+
"check:detail-surface": "node scripts/check-detail-surface.mjs",
|
|
156
|
+
"check:internal": "node --test scripts/check-internal-content.test.mjs scripts/check-npm-metadata.test.mjs && node scripts/check-internal-content.mjs --repo .",
|
|
157
|
+
"check:npm-metadata": "node scripts/check-npm-metadata.mjs",
|
|
158
|
+
"check:package": "node scripts/check-package-content.mjs",
|
|
159
|
+
"check:public-api-consumer": "node scripts/check-public-api-consumer.mjs",
|
|
160
|
+
"notices:update": "node scripts/third-party-notices.mjs --write",
|
|
161
|
+
"notices:check": "node scripts/third-party-notices.mjs --check",
|
|
162
|
+
"check": "bash scripts/docker-check.sh \"npm run gates\"",
|
|
163
|
+
"check:fast": "bash scripts/docker-check.sh \"npm run gates\"",
|
|
164
|
+
"check:local-browser": "node scripts/app-local-browser.mjs",
|
|
165
|
+
"check:infotip": "node scripts/check-infotip.mjs",
|
|
166
|
+
"release:stage": "node scripts/stage-release.mjs",
|
|
167
|
+
"check:polish": "bash scripts/docker-check.sh --build --out .polish-shots 'node scripts/check-polish.mjs'",
|
|
168
|
+
"check:acceptance": "node scripts/check-acceptance.mjs",
|
|
169
|
+
"check:palette": "node scripts/check-palette.mjs",
|
|
170
|
+
"gates": "node scripts/gates.mjs",
|
|
171
|
+
"gates:full": "node scripts/gates.mjs --full",
|
|
172
|
+
"check:layout": "node scripts/check-layout.mjs",
|
|
173
|
+
"release:smoke": "node scripts/release-smoke.mjs",
|
|
174
|
+
"check:browser-install": "playwright install chromium"
|
|
175
|
+
}
|
|
176
|
+
}
|