@synopackageland/ui 0.15.0 → 0.16.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 +18 -0
- package/README.md +9 -1
- package/dist/components/composite/wizard/Wizard.vue.d.ts +17 -4
- package/dist/components/composite/wizard/WizardDialog.vue.d.ts +44 -0
- package/dist/components/composite/wizard/WizardStep.vue.d.ts +10 -3
- package/dist/components/composite/wizard/types.d.ts +30 -2
- package/dist/components/composite/wizard/wizardContext.d.ts +8 -1
- package/dist/components/primitives/dialog/Dialog.vue.d.ts +3 -0
- package/dist/i18n/text.d.ts +3 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +8251 -7943
- package/dist/json-preview/preview.js +1209 -1175
- package/dist/reka-runtime.json +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/button-policy.md +1 -0
- package/docs/wizard.md +99 -0
- package/package.json +3 -2
package/docs/button-policy.md
CHANGED
|
@@ -18,6 +18,7 @@ are in [dsm-native-metrics.md](dsm-native-metrics.md).
|
|
|
18
18
|
| Place | Component | Shape | Variants |
|
|
19
19
|
| --- | --- | --- | --- |
|
|
20
20
|
| Dialog, sheet or wizard footer | `Dialog`, `Sheet`, `Wizard` `#footer` | capsule | Cancel `secondary`, then OK `primary` |
|
|
21
|
+
| Wizard footer | `Wizard` | capsule | Back `secondary` at the start; the step's `#actions`, Cancel `secondary`, then Next / Apply / Finish `primary` at the end |
|
|
21
22
|
| Confirmation of a destructive action | `Dialog` `#footer` | capsule | Cancel `secondary`, then Delete `danger` |
|
|
22
23
|
| Form or window footer | `FormActions`, `AppActionBar`, `Footbar`, `Panel` `#fbar` | capsule | Reset `secondary`, then Apply `primary` |
|
|
23
24
|
| Notification | `Notification` `confirm` / `cancel` | capsule | Cancel `secondary`, then the action `primary` |
|
package/docs/wizard.md
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# Wizard
|
|
2
|
+
|
|
3
|
+
A wizard walks the user through a setup in a few steps. It is a window-sized
|
|
4
|
+
layout, not a row of dots: the steps sit in a **rail** beside the step (or in a
|
|
5
|
+
**stepper band** above it when the wizard is narrower than 600px), the step
|
|
6
|
+
scrolls between a fixed band and a fixed footer, and the footer has **Back on
|
|
7
|
+
the left and one main action on the right**.
|
|
8
|
+
|
|
9
|
+

|
|
10
|
+
|
|
11
|
+
## Pieces
|
|
12
|
+
|
|
13
|
+
| Component | Use |
|
|
14
|
+
| --- | --- |
|
|
15
|
+
| `WizardDialog` | The wizard in an app-local dialog: DSM's `xl` width (860px) and 600px high, both capped to the window. Cancel closes it; so does Finish unless `close-on-finish="false"`. Other attributes and listeners go to the `Wizard`. |
|
|
16
|
+
| `Wizard` | The layout and the step flow, for a dialog of your own (`<Dialog flush>`) or a page (`framed`). |
|
|
17
|
+
| `WizardStep` | One step: hero, headline, one line, content, and the step's own footer actions. |
|
|
18
|
+
|
|
19
|
+
```vue
|
|
20
|
+
<script setup lang="ts">
|
|
21
|
+
import { ref } from 'vue'
|
|
22
|
+
import { FolderPlus } from '@lucide/vue'
|
|
23
|
+
import { WizardDialog, WizardStep } from '@synopackageland/ui'
|
|
24
|
+
|
|
25
|
+
const open = ref(false)
|
|
26
|
+
</script>
|
|
27
|
+
|
|
28
|
+
<template>
|
|
29
|
+
<WizardDialog v-model:open="open" title="Create shared folder">
|
|
30
|
+
<WizardStep step-key="welcome" type="welcome" headline="Create a shared folder" description="Choose where it lives and who can open it" :icon="FolderPlus" next-step-key="name" />
|
|
31
|
+
<WizardStep step-key="name" headline="Name and location" label="Location" next-step-key="done" :pre-enter-next-step="validate">
|
|
32
|
+
<Form>…</Form>
|
|
33
|
+
</WizardStep>
|
|
34
|
+
<WizardStep step-key="done" type="done" headline="Folder created" :finished="refresh" />
|
|
35
|
+
</WizardDialog>
|
|
36
|
+
</template>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Steps
|
|
40
|
+
|
|
41
|
+
- **Hero.** `icon` puts an icon tile beside the headline. The `#hero` slot puts a
|
|
42
|
+
picture or a diagram on a stage above it; prefer one there to a paragraph.
|
|
43
|
+
A `type="done"` step shows a success mark that pops in once, centred.
|
|
44
|
+
- **Text.** `headline` is the step's title; `label` is a shorter name for the
|
|
45
|
+
step list. `description` is one short line under the headline, without a
|
|
46
|
+
closing period. Keep the content to the controls the step needs.
|
|
47
|
+
- **Types.** `welcome` offers only Start; `done` drops Back and Cancel, fills
|
|
48
|
+
the progress and turns the main action into Finish. The last step without
|
|
49
|
+
`next-step-key` turns it into Apply.
|
|
50
|
+
- **Main action.** `next-label`, `next-disabled` and `:show-next="false"` (a step
|
|
51
|
+
that moves on by itself or through its own choices, such as a row of cards)
|
|
52
|
+
change it for one step. `:show-back="false"` hides Back.
|
|
53
|
+
- **More actions.** The step's `#actions` slot goes in the footer before Cancel
|
|
54
|
+
and the main action: secondary buttons only, there is one main action.
|
|
55
|
+
- **State.** Inactive steps stay mounted so their fields keep what the user
|
|
56
|
+
typed; `lazy` mounts a step's content only while it shows (a step that loads
|
|
57
|
+
data when it opens).
|
|
58
|
+
- A step mounted later (`v-if`) takes its place in document order in the list.
|
|
59
|
+
|
|
60
|
+
## Wizard
|
|
61
|
+
|
|
62
|
+
| Prop | Default | |
|
|
63
|
+
| --- | --- | --- |
|
|
64
|
+
| `active-step-key` (`v-model`) | the first step | The shown step. The wizard also moves by itself; bind it back to follow. |
|
|
65
|
+
| `stepper` | `auto` | `rail`, `header` (the band), `none`; `auto` is the rail from 600px. |
|
|
66
|
+
| `title`, `description` | — | Shown above the steps in the rail. `WizardDialog` puts its `title` in the dialog header instead. |
|
|
67
|
+
| `framed` | `false` | Border, corners and card shadow, for a wizard on a page. |
|
|
68
|
+
| `cancellable` | `true` | Cancel in the footer. |
|
|
69
|
+
| `footer` | `true` | `false` hides the footer; an object renames `start`, `previous`, `next`, `apply`, `finish`, `cancel`. |
|
|
70
|
+
| `progress-text` | "Step n of total" | The progress line. |
|
|
71
|
+
| `show-steps` | — | Deprecated: `false` is `stepper="none"`. |
|
|
72
|
+
|
|
73
|
+
The `#footer` slot replaces the footer's buttons and receives `nextStep`,
|
|
74
|
+
`previousStep`, `finish`, `cancel`, `canGoPrevious`, `isLastStep`, `busy` and
|
|
75
|
+
`stepKey`. Events: `next-step`, `previous-step` (`{ from, to }`), `finished`,
|
|
76
|
+
`cancel`. A step guard (`pre-enter-next-step`, `pre-enter-previous-step`)
|
|
77
|
+
returning `false` keeps the step; the main action shows a spinner while it
|
|
78
|
+
runs. The step list does not navigate, so a guard cannot be skipped.
|
|
79
|
+
|
|
80
|
+
A wizard fills the height its container gives it (`WizardDialog` and
|
|
81
|
+
`<Dialog flush height="…">` give it one); on a page, set a height on its
|
|
82
|
+
container or let it take its content's height.
|
|
83
|
+
|
|
84
|
+
## Behaviour
|
|
85
|
+
|
|
86
|
+
- **Focus.** When the step changes while the focus is in the wizard, the focus
|
|
87
|
+
moves to the new step's headline, so a screen reader reads where the user
|
|
88
|
+
is. A step that changes while the focus is elsewhere (the app follows the
|
|
89
|
+
backend) leaves the focus alone.
|
|
90
|
+
- **Assistive technology.** The step list is an ordered list named "Steps" with
|
|
91
|
+
`aria-current="step"`, and each finished step is read as completed. A step is
|
|
92
|
+
a section labelled by its headline; hidden steps are `aria-hidden`.
|
|
93
|
+
- **Motion.** A step slides in 16px from the side it comes from; the progress
|
|
94
|
+
bar and the markers ease to their new state; the done mark pops with a ring
|
|
95
|
+
and a short burst. Reduced motion turns all of it off.
|
|
96
|
+
- **Size.** In a phone-width window the dialog is a bottom sheet with the
|
|
97
|
+
band; in a DSM window from 600px wide the rail shows.
|
|
98
|
+
- **Theme.** Colours are the theme's roles, so the wizard follows the accent
|
|
99
|
+
and the dark theme.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synopackageland/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.0",
|
|
4
4
|
"description": "Shared Vue 3 UI component library with a DSM 7 inspired application theme",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -22,7 +22,8 @@
|
|
|
22
22
|
"docs/json-ui.md",
|
|
23
23
|
"docs/layout-rules.md",
|
|
24
24
|
"docs/size-and-split.md",
|
|
25
|
-
"docs/theme-hooks.md"
|
|
25
|
+
"docs/theme-hooks.md",
|
|
26
|
+
"docs/wizard.md"
|
|
26
27
|
],
|
|
27
28
|
"bin": {
|
|
28
29
|
"syno-pkg-land-ui": "./dist/cli.js"
|