@synopackageland/ui 0.16.4 → 0.17.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.
@@ -50,6 +50,20 @@ Dialog and Sheet forward cancellable `escapeKeyDown`, `pointerDownOutside`,
50
50
  <Dialog title="Settings" @escape-key-down="event => event.preventDefault()" />
51
51
  ```
52
52
 
53
+ ### A window-like dialog
54
+
55
+ DSM leaves the window behind a modal window readable: no dark mask, a soft
56
+ shadow round the modal, and a press outside it does nothing. A Dialog opens
57
+ that way with three props, which `WizardDialog` sets:
58
+
59
+ | Prop | Default | |
60
+ | --- | --- | --- |
61
+ | `scrim` | `dim` | The mask over the app: `dim` (`--ui-overlay`, blurred), `light` (`--ui-overlay-light`, a faint tint) or `none`. Each blocks presses, wheel and touch on the app behind. |
62
+ | `close-on-outside` | `true` | `false`: a press outside neither closes the dialog nor reaches the app. Escape and the close button still close it. |
63
+ | `header-divider` | `true` | `false` drops the line under the header, for content whose own header continues it (a Wizard's step title). |
64
+
65
+ The mask and the outside press stay local to the app in app mode, as above.
66
+
53
67
  ## Floating dialogs in a DSM window
54
68
 
55
69
  `<AppRoot dialog-bounds="viewport">` (app mode only; default `app`) lets Dialog
@@ -18,7 +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
+ | Wizard footer | `Wizard` | capsule | The step's `#actions` at the start (a quiet `ghost` `kind="tool"` text action); Cancel `secondary` (a page wizard only), Back `secondary`, then Next / Apply / Finish `primary` at the end |
22
22
  | Confirmation of a destructive action | `Dialog` `#footer` | capsule | Cancel `secondary`, then Delete `danger` |
23
23
  | Form or window footer | `FormActions`, `AppActionBar`, `Footbar`, `Panel` `#fbar` | capsule | Reset `secondary`, then Apply `primary` |
24
24
  | Notification | `Notification` `confirm` / `cancel` | capsule | Cancel `secondary`, then the action `primary` |
@@ -133,7 +133,7 @@ The same roles, with the light page's sage carried into the greys:
133
133
  | `--ui-*-soft` | the tone at 18% | |
134
134
 
135
135
  The tones' solid fills, radii, spacing and type are the light values. The
136
- masks and shades (`--ui-overlay`, `--ui-drawer-backdrop`,
136
+ masks and shades (`--ui-overlay`, `--ui-overlay-light`, `--ui-drawer-backdrop`,
137
137
  `--ui-scroll-edge-shade`), shadows, tooltip, scroll bar and switch thumb have
138
138
  dark values too; a component draws no colour of its own outside these tokens.
139
139
 
package/docs/wizard.md CHANGED
@@ -1,20 +1,22 @@
1
1
  # Wizard
2
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**.
3
+ A wizard walks the user through a setup in a few steps. It follows DSM's
4
+ wizard window: a **fixed header** (the wizard's name small, the current step's
5
+ title large, a compact progress bar beside it, one line under it), the step
6
+ scrolling in the middle, and a **fixed footer** with Back and the one main
7
+ action together at the end, in the same place on every step.
8
8
 
9
9
  ![A setup wizard in a dialog](screenshots/wizard-dialog-light.png)
10
10
 
11
+ ![The same wizard in the dark theme](screenshots/wizard-dialog-dark.png)
12
+
11
13
  ## Pieces
12
14
 
13
15
  | Component | Use |
14
16
  | --- | --- |
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`. |
17
+ | `WizardDialog` | The wizard in an app-local dialog sized like DSM's wizard windows: 75% of the app's width (560–860px) and its height less 48px (600px at most), so the app shows around it; `width`, `height` or `size` set your own. Its `title` is the wizard's name, beside the close button; see [Modal](#modal). Other attributes and listeners go to the `Wizard`. |
16
18
  | `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. |
19
+ | `WizardStep` | One step: its title (shown in the header), hero, one line, content, and the step's own footer actions. |
18
20
 
19
21
  ```vue
20
22
  <script setup lang="ts">
@@ -38,20 +40,29 @@ const open = ref(false)
38
40
 
39
41
  ## Steps
40
42
 
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.
43
+ - **Title.** `headline` is the step's title. It shows large in the wizard
44
+ header, not in the step, so do not repeat it in the content. `label` is a
45
+ shorter name for the step list (read by screen readers, and in the rail).
46
+ - **Hero.** The step opens with its hero: `icon` puts an icon tile beside the
47
+ step's line; the `#hero` slot puts a picture or a diagram on a stage; prefer
48
+ one there to a paragraph. A compact `ConnectionTopology` on the stage is a
49
+ centred row of three boxes of one width, without a frame of its own. A
50
+ short step with a hero takes a little of its free room above it (32px at
51
+ most) and leaves the rest below. A `type="done"` step shows a success mark that pops
52
+ in once, centred.
53
+ - **Text.** `description` is one short line at the top of the step, under the
54
+ hero, without a closing period. Keep the content to the controls the step
55
+ needs; it may be wide (a row of cards) or a form.
47
56
  - **Types.** `welcome` offers only Start; `done` drops Back and Cancel, fills
48
57
  the progress and turns the main action into Finish. The last step without
49
58
  `next-step-key` turns it into Apply.
50
59
  - **Main action.** `next-label`, `next-disabled` and `:show-next="false"` (a step
51
60
  that moves on by itself or through its own choices, such as a row of cards)
52
61
  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.
62
+ - **More actions.** The step's `#actions` slot goes at the start of the footer,
63
+ away from Back and the main action. Use it only when the step needs it, and
64
+ as a quiet text action: `<Button variant="ghost" kind="tool">`. There is one
65
+ main action.
55
66
  - **State.** Inactive steps stay mounted so their fields keep what the user
56
67
  typed; `lazy` mounts a step's content only while it shows (a step that loads
57
68
  data when it opens).
@@ -62,13 +73,14 @@ const open = ref(false)
62
73
  | Prop | Default | |
63
74
  | --- | --- | --- |
64
75
  | `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 `rail-min-width`. |
66
- | `rail-min-width` | `600` | The wizard width from which `auto` shows the rail. |
67
- | `title`, `description` | — | Shown above the steps in the rail. `WizardDialog` puts its `title` in the dialog header instead. |
76
+ | `stepper` | `auto` | The progress: `auto` and `bar`, a segment per step beside the step title; `rail`, the steps listed beside the step from `rail-min-width` (the bar below it); `none`, only the "Step n of total" line. `header` (0.16's band) is the bar. |
77
+ | `rail-min-width` | `600` | The wizard width from which `rail` shows the rail. |
78
+ | `title` | — | The wizard's name, small above the step title. `WizardDialog` puts its `title` in the dialog header instead. |
79
+ | `description` | — | Deprecated: not shown since 0.17. Put the line in the first step's `description`. |
68
80
  | `framed` | `false` | Border, corners and card shadow, for a wizard on a page. |
69
81
  | `fit` | `false` | On a page: takes the height left below it in its scroll container (or the window), so the steps, band and footer stay in view and only the step scrolls. |
70
82
  | `fit-min-height` | `320` | The least height `fit` takes; a shorter window scrolls the page instead. |
71
- | `cancellable` | `true` | Cancel in the footer. |
83
+ | `cancellable` | `true` | Cancel in the footer, before Back. `WizardDialog` sets it to `false`: its header's close button cancels. |
72
84
  | `footer` | `true` | `false` hides the footer; an object renames `start`, `previous`, `next`, `apply`, `finish`, `cancel`. |
73
85
  | `progress-text` | "Step n of total" | The progress line. |
74
86
  | `show-steps` | — | Deprecated: `false` is `stepper="none"`. |
@@ -84,21 +96,49 @@ A wizard fills the height its container gives it (`WizardDialog` and
84
96
  `<Dialog flush height="…">` give it one); on a page, set a height on its
85
97
  container, set `fit`, or let it take its content's height. A wizard held to a
86
98
  height under 560px (`fit` in a short window, or a dialog) draws a smaller
87
- headline, hero and spacing.
99
+ title, hero and spacing; one under 600px wide keeps less margin.
100
+
101
+ ## Footer
102
+
103
+ The footer is the same on every step: the step's `#actions` at the start;
104
+ Cancel (a page wizard only), Back and the main action at the end. The main
105
+ action is always last, at the right edge, so it never moves; on the first step
106
+ there is no Back and nothing shifts. A welcome step offers Start alone; a done
107
+ step offers Finish (and its own `#actions`). There is no Close in the footer:
108
+ a `WizardDialog` closes from its header.
109
+
110
+ ## Modal
111
+
112
+ `WizardDialog` opens like a DSM modal window, in the app (app-local, see
113
+ [app-local-modal.md](app-local-modal.md)):
114
+
115
+ - a soft glow all round the panel (`--ui-shadow-modal`) and rounder corners,
116
+ - a light scrim over the app (`--ui-overlay-light`) instead of the dark mask:
117
+ the app stays readable, but takes no presses,
118
+ - a press outside does nothing: it neither closes the wizard nor reaches the
119
+ app; Escape and the close button close it, and either emits `cancel`,
120
+ - the focus it moves (on opening, to the first field; on a step change, to the
121
+ step title) shows a ring only after a key, never after a click.
122
+
123
+ These are `Dialog` props (`scrim="light"`, `:close-on-outside="false"`,
124
+ `:header-divider="false"`), so a dialog of your own around a `Wizard` can
125
+ open the same way.
88
126
 
89
127
  ## Behaviour
90
128
 
91
129
  - **Focus.** When the step changes while the focus is in the wizard, the focus
92
- moves to the new step's headline, so a screen reader reads where the user
93
- is. A step that changes while the focus is elsewhere (the app follows the
94
- backend) leaves the focus alone.
95
- - **Assistive technology.** The step list is an ordered list named "Steps" with
96
- `aria-current="step"`, and each finished step is read as completed. A step is
97
- a section labelled by its headline; hidden steps are `aria-hidden`.
98
- - **Motion.** A step slides in 16px from the side it comes from; the progress
99
- bar and the markers ease to their new state; the done mark pops with a ring
100
- and a short burst. Reduced motion turns all of it off.
101
- - **Size.** In a phone-width window the dialog is a bottom sheet with the
102
- band; in a DSM window from 600px wide (`rail-min-width`) the rail shows.
130
+ moves to the step title in the header, which is described by the progress
131
+ ("Step 2 of 4"), so a screen reader reads where the user is. A step that
132
+ changes while the focus is elsewhere (the app follows the backend) leaves
133
+ the focus alone. In a `WizardDialog` the Tab key stays in the dialog.
134
+ - **Assistive technology.** The dialog is a `dialog` labelled by the wizard's
135
+ name. The progress is an ordered list named "Steps" with
136
+ `aria-current="step"`, and each finished step is read as completed. The
137
+ shown step is a section labelled by the header's title; hidden steps are
138
+ `aria-hidden`.
139
+ - **Motion.** A step fades in from 10px on the side it comes from and its
140
+ title fades in; the progress segments ease to their new state; the done mark
141
+ pops with a ring and a short burst. Reduced motion turns all of it off.
142
+ - **Size.** In a phone-width window the dialog is a bottom sheet.
103
143
  - **Theme.** Colours are the theme's roles, so the wizard follows the accent
104
144
  and the dark theme.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synopackageland/ui",
3
- "version": "0.16.4",
3
+ "version": "0.17.1",
4
4
  "description": "Shared Vue 3 UI component library with a DSM 7 inspired application theme",
5
5
  "license": "MIT",
6
6
  "type": "module",