@synopackageland/ui 0.14.9 → 0.14.11
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 +19 -0
- package/README.md +5 -1
- package/dist/components/composite/callout/Callout.vue.d.ts +22 -4
- package/dist/components/composite/tree-view/TreeView.vue.d.ts +2 -2
- package/dist/components/containers/card/Card.vue.d.ts +1 -1
- package/dist/components/containers/expandable-item/ExpandableItem.vue.d.ts +2 -2
- package/dist/i18n/text.d.ts +2 -0
- package/dist/index.js +5002 -4947
- package/dist/json/catalog.d.ts +10 -0
- package/dist/json/registry.d.ts +170 -0
- package/dist/json-ai-prompt.md +1 -1
- package/dist/json-catalog.schema.json +27 -2
- package/dist/json-preview/preview.js +6916 -6817
- package/dist/json.js +28 -24
- 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/adaptive-layout.md +2 -2
- package/docs/button-policy.md +3 -0
- package/docs/callout.md +123 -0
- package/docs/color-system.md +15 -15
- package/docs/layout-rules.md +1 -0
- package/docs/theme-hooks.md +9 -0
- package/package.json +2 -1
package/docs/adaptive-layout.md
CHANGED
|
@@ -224,9 +224,9 @@ any ancestor. Light defaults and the dark values the workbench uses:
|
|
|
224
224
|
|
|
225
225
|
| Token | Light (default) | Dark |
|
|
226
226
|
| --- | --- | --- |
|
|
227
|
-
| `--ui-app-web-canvas` | `var(--ui-bg)` (`#
|
|
227
|
+
| `--ui-app-web-canvas` | `var(--ui-bg)` (`#f4f6f3`) | `var(--ui-bg)` (`#11161c`) |
|
|
228
228
|
| `--ui-app-web-surface` | `var(--ui-surface)` | `var(--ui-surface)` (`#1f2832`) |
|
|
229
|
-
| `--ui-app-web-border` | `var(--ui-
|
|
229
|
+
| `--ui-app-web-border` | `var(--ui-border)` | `#34404d` |
|
|
230
230
|
| `--ui-app-web-shadow` | `var(--ui-shadow-card)` | `var(--ui-shadow-card)` |
|
|
231
231
|
| `--ui-web-sidebar-collapsed-width` | `64px` | same |
|
|
232
232
|
|
package/docs/button-policy.md
CHANGED
|
@@ -55,6 +55,9 @@ are in [dsm-native-metrics.md](dsm-native-metrics.md).
|
|
|
55
55
|
and `Wizard` footers, `FormActions`, `AppActionBar`, `Footbar`, a `Panel`
|
|
56
56
|
`#fbar` or a `Notification` it is a capsule, everywhere else a tool button.
|
|
57
57
|
Set `kind="tool"` on one footer button to keep it a tool button (Help, say).
|
|
58
|
+
- A Button in a `Callout`'s `#actions` and a toast's action are drawn as
|
|
59
|
+
capsules by the Callout and the Toast themselves ([callout](callout.md)).
|
|
60
|
+
They stay `kind="tool"` buttons, so they do not count as a footer's action.
|
|
58
61
|
- In development, a Button warns in the console when `kind="action"` is set
|
|
59
62
|
outside a footer, when a footer has two main actions, or when the main action
|
|
60
63
|
is not last. Production builds do not check.
|
package/docs/callout.md
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
# Callout, Toast and inline notes
|
|
2
|
+
|
|
3
|
+
A page says three kinds of things outside its content: a result that just
|
|
4
|
+
happened, something the user has to act on, and a risk to keep in mind. Each
|
|
5
|
+
has its own component, and none of them is a full-width banner.
|
|
6
|
+
|
|
7
|
+
| The message | Use | Shape |
|
|
8
|
+
| --- | --- | --- |
|
|
9
|
+
| A passing result: "Settings applied", "The check passed", "Copied" | `useToast()` | A toast that fades after 4.5 s. Do not leave a Callout behind for it. |
|
|
10
|
+
| Something the user has to act on: a missing setting, a failed connection, a sign-in that waits | `<Callout>` | One-line title, at most one line of text, one action. |
|
|
11
|
+
| A risk or a limit of a feature | `<Callout variant="inline">` | One short sentence; longer text in `#details` behind "Learn more", or a link. |
|
|
12
|
+
| A failure the user has to know about now, outside the page | `Notification` / `MessageBox` | See their docs. |
|
|
13
|
+
|
|
14
|
+
## The look
|
|
15
|
+
|
|
16
|
+
A Callout and a Toast share one look: a raised surface in the page's neutral
|
|
17
|
+
colour (`--ui-surface-raised`), with no frame and no tinted fill. A 1px ring
|
|
18
|
+
at 6% of the text colour and a soft shadow lift it off the page. The tone
|
|
19
|
+
appears in three small places only:
|
|
20
|
+
|
|
21
|
+
- a 1.5px light along the top edge, in the tone, fading out halfway across;
|
|
22
|
+
- a faint glow of the tone (9%; 14% in the workbench dark theme) in the
|
|
23
|
+
corner behind the icon;
|
|
24
|
+
- the 18px icon.
|
|
25
|
+
|
|
26
|
+
The title reads in the text colour at 600, and the message under it in the
|
|
27
|
+
secondary text colour. Corners are 12px (`--ui-callout-radius`), rounder than
|
|
28
|
+
a card on purpose: a Callout floats above the settings rather than being one
|
|
29
|
+
of them. Buttons in `#actions` and a toast's action are capsules. A Callout
|
|
30
|
+
fades in and rises 6px when it appears, and a toast slides in; with reduced
|
|
31
|
+
motion both appear at once.
|
|
32
|
+
|
|
33
|
+
A Callout grows to 720px (`--ui-callout-max-width`) and stops there, so a
|
|
34
|
+
wide page does not stretch it into a strip. `fill` makes it span the
|
|
35
|
+
container. Actions sit at the end of the message while the width allows; on
|
|
36
|
+
a narrow panel they move under the text.
|
|
37
|
+
|
|
38
|
+
Contrast was measured on the surface, light and dark, in every tone: text at
|
|
39
|
+
least 5.4:1, icons at least 3.3:1.
|
|
40
|
+
|
|
41
|
+
`variant="inline"` keeps the icon and the tones and drops the surface: an
|
|
42
|
+
icon and one line of secondary text, with a link or a small button after it.
|
|
43
|
+
Use it for a note under a field or a section heading, where a panel would
|
|
44
|
+
weigh more than the note.
|
|
45
|
+
|
|
46
|
+
### Why this one
|
|
47
|
+
|
|
48
|
+
Three directions were drawn as working prototypes, each in every tone, with
|
|
49
|
+
and without an action, light and dark, and on a settings page:
|
|
50
|
+
|
|
51
|
+
1. **Card with an icon chip** (in the manner of Stripe and Linear): a white
|
|
52
|
+
card with a hairline frame. The tone sits only in a rounded icon chip, and
|
|
53
|
+
the action is a text button. Calm, but close to the cards around it.
|
|
54
|
+
2. **Status line** (in the manner of Apple's settings and Vercel): no
|
|
55
|
+
container. A filled round chip, the title and the message on one line, and
|
|
56
|
+
an "Action →" link. The lightest, but too quiet for something that blocks
|
|
57
|
+
the user.
|
|
58
|
+
3. **Glow surface**: the look above. It was chosen because it keeps the page
|
|
59
|
+
neutral, still shows the tone at a glance, and reads as modern without a
|
|
60
|
+
coloured box.
|
|
61
|
+
|
|
62
|
+
Two earlier looks were rejected:
|
|
63
|
+
|
|
64
|
+
- **0.14.9 and before**: full width, a 3px bar on the leading edge, a tinted
|
|
65
|
+
strip, and buttons stacked under the text. It read as a dated admin-tool
|
|
66
|
+
warning box.
|
|
67
|
+
- **A first redesign**: a tinted fill with a thin tinted frame. It was still
|
|
68
|
+
a coloured box.
|
|
69
|
+
|
|
70
|
+
## Writing one
|
|
71
|
+
|
|
72
|
+
- **No closing period.** Callout text (title, message, details, action
|
|
73
|
+
labels) does not end in a period; a period between two sentences stays.
|
|
74
|
+
- **Title**: what is wrong or missing, in a few words: "DSM external access
|
|
75
|
+
address is not set".
|
|
76
|
+
- **Message**: one line on why it matters or what happens next: "Share links
|
|
77
|
+
keep using the old address". Do not explain the steps; the action does them.
|
|
78
|
+
- **Action**: one button (`Button size="sm"`, drawn as a capsule), or a `Link` when it leaves the
|
|
79
|
+
app. Two only when the second is "Later" and the Callout cannot be closed.
|
|
80
|
+
The button label names what it does: "Apply nas.example.com", not "OK".
|
|
81
|
+
- **Risk notes**: one sentence. Put the explanation in `#details`:
|
|
82
|
+
|
|
83
|
+
```vue
|
|
84
|
+
<Callout tone="warning" variant="inline">
|
|
85
|
+
Without an access policy, anyone who knows the name reaches the service
|
|
86
|
+
<template #actions><Link :href="accessDocs" external>Set up access</Link></template>
|
|
87
|
+
</Callout>
|
|
88
|
+
|
|
89
|
+
<Callout tone="warning" title="No access policy">
|
|
90
|
+
Anyone who knows the name reaches the service
|
|
91
|
+
<template #details>Add an access policy that allows only your accounts…</template>
|
|
92
|
+
</Callout>
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
- A result the user caused, and that needs nothing more, is a toast:
|
|
96
|
+
|
|
97
|
+
```ts
|
|
98
|
+
const toast = useToast()
|
|
99
|
+
toast.success('Settings applied', 'Added port 6690')
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
- Put a machine error code in `code`, not in the text.
|
|
103
|
+
- Stack at most two Callouts in one section. More means the page should show
|
|
104
|
+
the state in its content (a `Badge`, a `KeyValueRow`) instead.
|
|
105
|
+
|
|
106
|
+
## API
|
|
107
|
+
|
|
108
|
+
| Prop / slot | Use |
|
|
109
|
+
| --- | --- |
|
|
110
|
+
| `tone` | `info` (default), `success`, `warning`, `danger` |
|
|
111
|
+
| `variant` | `soft` (default) or `inline` |
|
|
112
|
+
| `title` | One line, the thing to know |
|
|
113
|
+
| default slot | The message |
|
|
114
|
+
| `#actions` | One action, at the end of the message |
|
|
115
|
+
| `#details` + `v-model:expanded` | Longer text behind a "Learn more" toggle (`moreLabel`, `lessLabel`) |
|
|
116
|
+
| `code` | A machine error code, shown quieter after the message |
|
|
117
|
+
| `closable`, `closeLabel`, `@close` | A close button for a message the user may dismiss |
|
|
118
|
+
| `fill` | Span the container instead of stopping at 720px |
|
|
119
|
+
|
|
120
|
+
Theme hooks (`data-tone`, `data-variant`, `data-fill`, the `data-ui-callout-*`
|
|
121
|
+
parts) and tokens (`--ui-callout-max-width`, `--ui-callout-radius`,
|
|
122
|
+
`--ui-callout-glow`, `--ui-callout-shadow`, which Toast shares) are listed in
|
|
123
|
+
[theme hooks](theme-hooks.md).
|
package/docs/color-system.md
CHANGED
|
@@ -39,28 +39,28 @@ at 7:1 or more (`tests/css/palette.test.ts`).
|
|
|
39
39
|
|
|
40
40
|
| Role | Step | DSM 7 |
|
|
41
41
|
| --- | --- | --- |
|
|
42
|
-
| `--ui-bg` | `#
|
|
42
|
+
| `--ui-bg` | `#f4f6f3` | the page behind cards: a pale sage mist, light enough that cards read by their frame and shadow rather than a dark page |
|
|
43
43
|
| `--ui-surface`, `--ui-surface-raised` | `gray-1` | white window, cards and panels; menus and dialogs add a shadow |
|
|
44
|
-
| `--ui-surface-subtle`, `--ui-surface-inset` | `
|
|
44
|
+
| `--ui-surface-subtle`, `--ui-surface-inset` | `mist-a2` | faint block, 12% of `#bec8c0` |
|
|
45
45
|
| `--ui-surface-hover` | `accent-a2` | list row hover, 4% blue |
|
|
46
46
|
| `--ui-surface-selected`, `--ui-primary-soft` | `accent-a3` | selected row and nav item, 10% blue |
|
|
47
47
|
| `--ui-text` | `gray-12` | `#414b55` |
|
|
48
48
|
| `--ui-text-secondary` | `gray-a11` | 82% of `#414b55` |
|
|
49
49
|
| `--ui-text-muted`, `--ui-text-disabled` | `gray-a9` | 40% of `#414b55`, placeholder and disabled text |
|
|
50
|
-
| `--ui-border` | `
|
|
51
|
-
| `--ui-border-strong`, `--ui-control-border-hover` | `
|
|
52
|
-
| `--ui-border-subtle` | `
|
|
53
|
-
| `--ui-control-bg` | `
|
|
54
|
-
| `--ui-control-bg-active` | `
|
|
55
|
-
| `--ui-control-border-active` | `
|
|
50
|
+
| `--ui-border` | `mist-a6` | field and card frame, 50% of `#bec8c0` |
|
|
51
|
+
| `--ui-border-strong`, `--ui-control-border-hover` | `mist-a7` | hovered frame, 40% of `#748278` |
|
|
52
|
+
| `--ui-border-subtle` | `mist-a3` | grid rules, 26% of `#bec8c0` |
|
|
53
|
+
| `--ui-control-bg` | `mist-a3` | button fill, 26% of `#bec8c0` |
|
|
54
|
+
| `--ui-control-bg-active` | `mist-a6` | pressed button, 50% of `#bec8c0` |
|
|
55
|
+
| `--ui-control-border-active` | `mist-a8` | pressed frame, 55% of `#748278` |
|
|
56
56
|
| `--ui-primary`, `-hover`, `-active` | `accent-9`, `-10`, `-11` | blue button at rest, hovered, pressed |
|
|
57
57
|
| `--ui-primary-foreground` | `accent-contrast` | white label |
|
|
58
58
|
| `--ui-focus-ring` | `accent-a7` | 50% blue |
|
|
59
59
|
| `--ui-info`, `--ui-success`, `--ui-warning`, `--ui-danger` | step 9 of each tone | status dots, bars, icons |
|
|
60
|
-
| `--ui-{tone}-soft` | `a3` of each tone (`
|
|
60
|
+
| `--ui-{tone}-soft` | `a3` of each tone (`mist-a3` for neutral) | badge fill |
|
|
61
61
|
| `--ui-{tone}-text` | step 11 of each tone (`gray-11` for neutral) | badge text |
|
|
62
62
|
| `--ui-danger-hover`, `--ui-danger-active` | `red-10`, `red-11` | red button hovered, pressed |
|
|
63
|
-
| `--ui-warning-accent` | `orange-10` | a Callout's
|
|
63
|
+
| `--ui-warning-accent` | `orange-10` | a warning Callout's or Toast's top light, glow and icon |
|
|
64
64
|
|
|
65
65
|
Tones stay DSM's whatever the accent: an info badge is blue in every app.
|
|
66
66
|
|
|
@@ -71,12 +71,12 @@ The scales follow DSM where the two disagree:
|
|
|
71
71
|
- **DSM blue with a white label reads at 4.0:1.** That is under the 4.5:1 AA
|
|
72
72
|
asks of body text and above the 3:1 it asks of a control. DSM's own buttons
|
|
73
73
|
use it, so the default accent keeps it. An app accent must reach 4.5:1.
|
|
74
|
-
- **Grid rules are step 3, not step 6.** DSM draws them
|
|
75
|
-
|
|
76
|
-
- **A pressed button is step 6.** DSM fills it
|
|
74
|
+
- **Grid rules are step 3, not step 6.** DSM draws them as light as a button
|
|
75
|
+
fill; the theme draws both in its mist (26% of `#bec8c0`).
|
|
76
|
+
- **A pressed button is step 6.** DSM fills it in the colour
|
|
77
77
|
of a field's frame.
|
|
78
|
-
- **Orange step 10 is darker than DSM's hover orange,** so a Callout's
|
|
79
|
-
icon
|
|
78
|
+
- **Orange step 10 is darker than DSM's hover orange,** so a warning Callout's
|
|
79
|
+
icon keeps 3:1 on its tint.
|
|
80
80
|
|
|
81
81
|
## Accent
|
|
82
82
|
|
package/docs/layout-rules.md
CHANGED
|
@@ -68,6 +68,7 @@ These rules keep pages built from `@synopackageland/ui` consistent. The componen
|
|
|
68
68
|
- Show a headline number (space freed, files moved) with `Statistic`: `label`, `value`, optional `note`; `size="lg"` for the one number a page leads with. Put several in `Surface`s in a grid. Do not set font sizes for figures.
|
|
69
69
|
- Colour a usage bar by meaning with `Progress tone` (`warning` when nearly full) rather than drawing your own bar.
|
|
70
70
|
- Show a state as a `Badge` in a `KeyValueRow`, not as a sentence. A toned badge leads with a dot; keep `neutral` for plain values such as a version.
|
|
71
|
+
- A passing result ("Settings applied") is a toast; a Callout is for something the user has to act on or a short risk note, with one title, one line and one action ([callout](callout.md)).
|
|
71
72
|
- Put a machine error code in `Callout`'s `code` prop, not in the message text: `<Callout tone="warning" :code="status.code">{{ message }}</Callout>`.
|
|
72
73
|
- Do not show internal identifiers, such as job ids or catalog keys. Show the name the user gave.
|
|
73
74
|
- In Chinese and Japanese, a label and its value are separated by a full-width colon `:`.
|
package/docs/theme-hooks.md
CHANGED
|
@@ -89,6 +89,11 @@ here stay implementation details and can change in any release.
|
|
|
89
89
|
| `data-ui-dialog`, `data-ui-sheet` | `Dialog` / `Sheet` panels | present |
|
|
90
90
|
| `data-ui-list-item-title`, `-description`, `-meta`, `-actions` | `ListItem` parts | present |
|
|
91
91
|
| `data-ui-statistic-label`, `-value`, `-note` | `Statistic` parts | present |
|
|
92
|
+
| `data-tone` | `Callout` | `info`, `success`, `warning`, `danger` |
|
|
93
|
+
| `data-variant` | `Callout` | `soft`, `inline` |
|
|
94
|
+
| `data-fill` | `Callout` | present when it spans its container |
|
|
95
|
+
| `data-tone` | each `Toast` (class `ui-toast`) | `info`, `success`, `warning`, `danger` |
|
|
96
|
+
| `data-ui-callout-title`, `-body`, `-code`, `-more`, `-details`, `-actions` | `Callout` parts | present |
|
|
92
97
|
|
|
93
98
|
Select a `Button` variant with its tag so a `Surface`'s `data-variant` is not
|
|
94
99
|
caught as well: `button[data-variant='primary']`.
|
|
@@ -110,6 +115,10 @@ before the token existed. Set them on the app root or any ancestor.
|
|
|
110
115
|
| `--ui-mobile-bar-bg` | the phone bar's background | `var(--ui-surface)` |
|
|
111
116
|
| `--ui-mobile-bar-fg` | the phone bar's text, menu button and brand | `var(--ui-text-secondary)` (text), `var(--ui-text)` (button, brand) |
|
|
112
117
|
| `--ui-mobile-bar-border` | the phone bar's bottom rule | `var(--ui-border-subtle)` |
|
|
118
|
+
| `--ui-callout-max-width` | how wide a `Callout` grows before it stops (`fill` ignores it) | 720px |
|
|
119
|
+
| `--ui-callout-radius` | a `Callout`'s and a `Toast`'s corners | 12px |
|
|
120
|
+
| `--ui-callout-glow` | how strong the tone's glow is behind a `Callout`'s or `Toast`'s icon; a dark theme raises it (workbench: 14%) | 9% |
|
|
121
|
+
| `--ui-callout-shadow` | the shadow under a `Callout` and a `Toast` (workbench dark: `0 10px 28px -12px rgba(0, 0, 0, 0.6)`) | `0 8px 24px -12px rgba(15, 23, 42, 0.18)` |
|
|
113
122
|
|
|
114
123
|
The colour, radius, spacing and web tokens are listed in the
|
|
115
124
|
[README](../README.md#theme-override), [colour system](color-system.md) and
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synopackageland/ui",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.11",
|
|
4
4
|
"description": "Shared Vue 3 UI component library with a DSM 7 inspired application theme",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
"docs/adaptive-layout.md",
|
|
17
17
|
"docs/app-local-modal.md",
|
|
18
18
|
"docs/button-policy.md",
|
|
19
|
+
"docs/callout.md",
|
|
19
20
|
"docs/color-system.md",
|
|
20
21
|
"docs/component-defaults-0.5.7.md",
|
|
21
22
|
"docs/json-ui.md",
|