@vmz/ui 0.3.7 → 0.3.8

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.
Files changed (68) hide show
  1. package/README.md +2 -0
  2. package/contracts/token-requirements.v0.json +58 -1
  3. package/package.json +5 -2
  4. package/presets/web-surface.v0.json +14 -12
  5. package/src/components/Accordion.vmz +49 -16
  6. package/src/components/Alert.vmz +125 -28
  7. package/src/components/AppShell.vmz +121 -56
  8. package/src/components/Autocomplete.vmz +136 -29
  9. package/src/components/Avatar.vmz +20 -12
  10. package/src/components/Badge.vmz +18 -26
  11. package/src/components/Breadcrumb.vmz +28 -14
  12. package/src/components/BulkActions.vmz +13 -8
  13. package/src/components/Button.vmz +68 -44
  14. package/src/components/Callout.vmz +128 -27
  15. package/src/components/Card.vmz +67 -46
  16. package/src/components/Checkbox.vmz +81 -5
  17. package/src/components/CodeBlock.vmz +59 -27
  18. package/src/components/Collapse.vmz +64 -11
  19. package/src/components/ConsoleShell.vmz +217 -63
  20. package/src/components/Content.vmz +15 -1
  21. package/src/components/DataTable.vmz +123 -23
  22. package/src/components/DatePicker.vmz +171 -79
  23. package/src/components/Descriptions.vmz +90 -0
  24. package/src/components/Dialog.vmz +133 -50
  25. package/src/components/Divider.vmz +8 -1
  26. package/src/components/Drawer.vmz +131 -40
  27. package/src/components/Dropdown.vmz +147 -49
  28. package/src/components/Empty.vmz +56 -14
  29. package/src/components/Field.vmz +78 -23
  30. package/src/components/FilterBar.vmz +34 -4
  31. package/src/components/Flex.vmz +3 -1
  32. package/src/components/Footer.vmz +6 -3
  33. package/src/components/Form.vmz +41 -0
  34. package/src/components/FormItem.vmz +2 -3
  35. package/src/components/Grid.vmz +6 -3
  36. package/src/components/Header.vmz +193 -6
  37. package/src/components/Layout.vmz +3 -1
  38. package/src/components/Link.vmz +20 -9
  39. package/src/components/List.vmz +35 -13
  40. package/src/components/Menu.vmz +198 -25
  41. package/src/components/Message.vmz +167 -0
  42. package/src/components/Notification.vmz +132 -37
  43. package/src/components/Pagination.vmz +186 -20
  44. package/src/components/Popconfirm.vmz +287 -0
  45. package/src/components/Popover.vmz +152 -34
  46. package/src/components/Progress.vmz +16 -5
  47. package/src/components/Prose.vmz +131 -32
  48. package/src/components/QueryForm.vmz +31 -9
  49. package/src/components/RadioGroup.vmz +91 -11
  50. package/src/components/Result.vmz +60 -27
  51. package/src/components/Segmented.vmz +46 -11
  52. package/src/components/Select.vmz +174 -87
  53. package/src/components/Sider.vmz +120 -7
  54. package/src/components/Skeleton.vmz +9 -7
  55. package/src/components/Space.vmz +9 -3
  56. package/src/components/Spinner.vmz +5 -4
  57. package/src/components/Steps.vmz +40 -25
  58. package/src/components/Switch.vmz +48 -15
  59. package/src/components/Table.vmz +130 -25
  60. package/src/components/Tabs.vmz +28 -13
  61. package/src/components/Tag.vmz +29 -12
  62. package/src/components/TextArea.vmz +32 -25
  63. package/src/components/Timeline.vmz +65 -30
  64. package/src/components/Toc.vmz +45 -29
  65. package/src/components/Tooltip.vmz +70 -21
  66. package/src/components/Tree.vmz +48 -25
  67. package/src/components/Typography.vmz +23 -8
  68. package/src/components/Upload.vmz +191 -96
@@ -1,10 +1,15 @@
1
1
  <template>
2
- <div data-vmz-ui="console-shell" class="vmz-ui-console-shell">
2
+ <div data-vmz-ui="console-shell" :onKeyDown="onShellKeyDown" class="vmz-ui-console-shell">
3
3
  <aside data-vmz-shell="sidebar" :aria-label="navLabel" class="vmz-ui-console-shell__sidebar">
4
- <a :href="homeHref" class="vmz-ui-console-shell__brand">
5
- {{ brand }}
6
- </a>
7
- <nav class="vmz-ui-console-shell__nav">
4
+ <div class="vmz-ui-console-shell__sidebar-top">
5
+ <a v-if="brand" :href="homeHref" class="vmz-ui-console-shell__brand">
6
+ {{ brand }}
7
+ </a>
8
+ <button v-if="nav.length" type="button" :aria-label="menuLabel || navLabel" :aria-expanded="menuOpen ? 'true' : 'false'" aria-controls="vmz-console-shell-nav" @click="toggleMenu" class="vmz-ui-console-shell__menu">
9
+ <Icon :name="menuOpen ? 'action.close' : 'action.menu'" size="md" decorative />
10
+ </button>
11
+ </div>
12
+ <nav id="vmz-console-shell-nav" :data-open="menuOpen ? 'true' : null" class="vmz-ui-console-shell__nav">
8
13
  <a v-for="item in nav" :key="item.id" :href="item.href" :data-vmz-nav="item.id" :data-active="item.id === activeNavId ? 'true' : null" :aria-current="item.id === activeNavId ? 'page' : null">
9
14
  {{ item.title }}
10
15
  </a>
@@ -12,11 +17,14 @@
12
17
  </aside>
13
18
  <div class="vmz-ui-console-shell__body">
14
19
  <header data-vmz-shell="header" class="vmz-ui-console-shell__header">
20
+ <a v-if="backLabel && backHref" :href="backHref" class="vmz-ui-console-shell__back">
21
+ {{ backLabel }}
22
+ </a>
15
23
  <div class="vmz-ui-console-shell__header-copy">
16
24
  <p v-if="breadcrumbLabel" data-vmz-shell="breadcrumb" class="vmz-ui-console-shell__breadcrumb">
17
25
  {{ breadcrumbLabel }}
18
26
  </p>
19
- <h1 class="vmz-ui-console-shell__title">
27
+ <h1 v-if="title" class="vmz-ui-console-shell__title">
20
28
  {{ title }}
21
29
  </h1>
22
30
  <p v-if="subtitle" class="vmz-ui-console-shell__subtitle">
@@ -28,7 +36,9 @@
28
36
  </a>
29
37
  </header>
30
38
  <main data-vmz-shell="main" class="vmz-ui-console-shell__main">
31
- <slot />
39
+ <div class="vmz-ui-console-shell__panel">
40
+ <slot />
41
+ </div>
32
42
  </main>
33
43
  <footer v-if="footer" data-vmz-shell="footer" class="vmz-ui-console-shell__footer">
34
44
  {{ footer }}
@@ -44,61 +54,106 @@
44
54
  min-height: 100vh;
45
55
  min-height: 100dvh;
46
56
  height: 100dvh;
47
- color: inherit;
48
- background: var(--vmz-surface-page, #f5f6f8);
57
+ color: var(--vmz-text-ink);
58
+ background: var(--vmz-surface-page);
59
+ font-family: var(--vmz-font-sans);
49
60
  }
50
61
 
51
62
  .vmz-ui-console-shell__sidebar {
52
63
  display: flex;
53
64
  flex-direction: column;
54
- gap: 1rem;
55
- padding: 1rem 0.75rem 1.5rem;
56
- border-right: 1px solid var(--vmz-line-subtle, #e5e6eb);
65
+ gap: var(--vmz-space-4, 1rem);
66
+ padding: var(--vmz-space-3, 0.75rem);
67
+ border-right: 1px solid var(--vmz-line-subtle);
57
68
  min-height: 100%;
58
69
  align-self: stretch;
59
70
  background: var(--vmz-surface-paper);
60
71
  }
61
72
 
73
+ .vmz-ui-console-shell__sidebar-top {
74
+ display: flex;
75
+ align-items: center;
76
+ justify-content: space-between;
77
+ gap: var(--vmz-space-2, 0.5rem);
78
+ }
79
+
80
+ .vmz-ui-console-shell__menu {
81
+ display: none;
82
+ align-items: center;
83
+ justify-content: center;
84
+ flex: none;
85
+ width: var(--vmz-control-height, 2rem);
86
+ min-height: var(--vmz-control-height, 2rem);
87
+ padding: 0;
88
+ border: 1px solid var(--vmz-line-default);
89
+ border-radius: var(--vmz-radius-md, 6px);
90
+ background: var(--vmz-surface-paper);
91
+ color: var(--vmz-text-steel);
92
+ cursor: pointer;
93
+ outline: none;
94
+ }
95
+
96
+ .vmz-ui-console-shell__menu:focus-visible {
97
+ box-shadow: 0 0 0 3px var(--vmz-focus-ring);
98
+ }
99
+
62
100
  .vmz-ui-console-shell__brand {
63
- font: inherit;
64
- font-weight: 600;
101
+ padding: var(--vmz-space-1, 0.25rem) var(--vmz-space-3, 0.75rem);
102
+ color: var(--vmz-text-ink);
65
103
  font-size: 1rem;
104
+ font-weight: 600;
105
+ line-height: 1.5rem;
66
106
  letter-spacing: 0;
67
107
  text-decoration: none;
68
- color: var(--vmz-text-ink);
108
+ outline: none;
109
+ border-radius: var(--vmz-radius-md, 6px);
110
+ }
111
+
112
+ .vmz-ui-console-shell__brand:hover {
113
+ color: var(--vmz-action-primary-background);
69
114
  }
70
115
 
71
116
  .vmz-ui-console-shell__brand:focus-visible {
72
- outline: none;
73
117
  box-shadow: 0 0 0 3px var(--vmz-focus-ring);
74
118
  }
75
119
 
76
120
  .vmz-ui-console-shell__nav {
77
121
  display: flex;
78
122
  flex-direction: column;
79
- gap: 0.25rem;
123
+ gap: var(--vmz-space-1, 0.25rem);
80
124
  flex: 1;
81
125
  }
82
126
 
83
127
  .vmz-ui-console-shell__nav a {
84
- font: inherit;
85
- font-weight: 400;
128
+ display: flex;
129
+ align-items: center;
130
+ min-height: 2.25rem;
131
+ padding: 0 var(--vmz-space-3, 0.75rem);
132
+ border-radius: var(--vmz-radius-md, 6px);
133
+ color: var(--vmz-text-steel);
86
134
  font-size: 0.875rem;
87
- line-height: 1.375rem;
135
+ font-weight: 500;
136
+ line-height: 1.25rem;
88
137
  text-decoration: none;
89
- color: var(--vmz-text-steel);
90
- padding: 0.5rem 0.5rem;
91
- border-radius: var(--vmz-radius-sm);
138
+ outline: none;
139
+ transition:
140
+ color var(--vmz-motion-control-duration, 150ms) var(--vmz-motion-control-easing, cubic-bezier(0.4, 0, 0.2, 1)),
141
+ background-color var(--vmz-motion-control-duration, 150ms) var(--vmz-motion-control-easing, cubic-bezier(0.4, 0, 0.2, 1));
142
+ }
143
+
144
+ .vmz-ui-console-shell__nav a:hover {
145
+ color: var(--vmz-text-ink);
146
+ background: var(--vmz-surface-mist);
92
147
  }
93
148
 
94
149
  .vmz-ui-console-shell__nav a[data-active="true"] {
95
- color: var(--vmz-action-link-foreground);
96
- font-weight: 500;
97
- background: color-mix(in srgb, var(--vmz-action-primary-background) 10%, var(--vmz-surface-paper));
150
+ color: var(--vmz-action-primary-background);
151
+ background: var(--vmz-action-primary-soft);
152
+ font-weight: 600;
153
+ box-shadow: inset 2px 0 0 var(--vmz-action-primary-background);
98
154
  }
99
155
 
100
156
  .vmz-ui-console-shell__nav a:focus-visible {
101
- outline: none;
102
157
  box-shadow: 0 0 0 3px var(--vmz-focus-ring);
103
158
  }
104
159
 
@@ -109,6 +164,7 @@
109
164
  min-height: 0;
110
165
  height: 100%;
111
166
  overflow: auto;
167
+ background: var(--vmz-surface-page);
112
168
  }
113
169
 
114
170
  .vmz-ui-console-shell__header {
@@ -118,13 +174,34 @@
118
174
  display: flex;
119
175
  align-items: center;
120
176
  justify-content: space-between;
121
- gap: 1rem;
122
- min-height: 3.5rem;
123
- padding: 0.75rem 1.5rem;
124
- border-bottom: 1px solid var(--vmz-line-subtle, #e5e6eb);
177
+ gap: var(--vmz-space-4, 1rem);
178
+ min-height: var(--vmz-layout-header-height-compact, 3.5rem);
179
+ padding: 0 var(--vmz-space-5, 1.5rem);
180
+ border-bottom: 1px solid var(--vmz-line-subtle);
125
181
  background: var(--vmz-surface-paper);
126
182
  }
127
183
 
184
+ .vmz-ui-console-shell__back {
185
+ display: none;
186
+ align-items: center;
187
+ flex: none;
188
+ min-height: var(--vmz-control-height, 2rem);
189
+ color: var(--vmz-action-link-foreground);
190
+ font-size: var(--vmz-type-caption);
191
+ line-height: var(--vmz-type-line-height-caption);
192
+ text-decoration: none;
193
+ white-space: nowrap;
194
+ outline: none;
195
+ }
196
+
197
+ .vmz-ui-console-shell__back:hover {
198
+ color: var(--vmz-action-link-hover);
199
+ }
200
+
201
+ .vmz-ui-console-shell__back:focus-visible {
202
+ box-shadow: 0 0 0 3px var(--vmz-focus-ring);
203
+ }
204
+
128
205
  .vmz-ui-console-shell__header-copy {
129
206
  display: grid;
130
207
  gap: 0.125rem;
@@ -133,69 +210,79 @@
133
210
 
134
211
  .vmz-ui-console-shell__breadcrumb {
135
212
  margin: 0;
136
- color: var(--vmz-text-steel);
137
- font-size: 0.8125rem;
138
- line-height: 1.25rem;
213
+ color: var(--vmz-text-tertiary);
214
+ font-size: 0.75rem;
215
+ line-height: 1.125rem;
139
216
  }
140
217
 
141
218
  .vmz-ui-console-shell__title {
142
219
  margin: 0;
143
- font-size: 1.5rem;
144
- line-height: 2rem;
145
- font-weight: 600;
146
220
  color: var(--vmz-text-ink);
221
+ font-size: 1.25rem;
222
+ line-height: 1.75rem;
223
+ font-weight: 600;
147
224
  }
148
225
 
149
226
  .vmz-ui-console-shell__subtitle {
150
227
  margin: 0;
151
228
  color: var(--vmz-text-steel);
152
- font-size: 0.875rem;
153
- line-height: 1.375rem;
229
+ font-size: 0.8125rem;
230
+ line-height: 1.25rem;
154
231
  }
155
232
 
156
233
  .vmz-ui-console-shell__action {
157
234
  display: inline-flex;
158
235
  align-items: center;
159
236
  justify-content: center;
237
+ flex: none;
160
238
  min-height: 2rem;
161
- padding: 0.25rem 0.75rem;
162
- border-radius: var(--vmz-radius-sm);
239
+ padding: 0 var(--vmz-space-3, 0.75rem);
240
+ border-radius: var(--vmz-radius-md, 6px);
163
241
  background: var(--vmz-action-primary-background);
164
242
  color: var(--vmz-action-primary-foreground);
165
243
  font-size: 0.875rem;
166
244
  font-weight: 500;
167
245
  text-decoration: none;
168
246
  white-space: nowrap;
247
+ outline: none;
248
+ transition: background-color var(--vmz-motion-control-duration, 150ms) var(--vmz-motion-control-easing, cubic-bezier(0.4, 0, 0.2, 1));
169
249
  }
170
250
 
171
251
  .vmz-ui-console-shell__action:hover {
172
- color: var(--vmz-action-primary-foreground);
173
- background: var(--vmz-action-primary-active);
252
+ background: var(--vmz-action-primary-hover);
174
253
  }
175
254
 
176
255
  .vmz-ui-console-shell__action:focus-visible {
177
- outline: none;
178
256
  box-shadow: 0 0 0 3px var(--vmz-focus-ring);
179
257
  }
180
258
 
181
259
  .vmz-ui-console-shell__main {
182
260
  flex: 1 1 auto;
183
- padding: 1.5rem;
261
+ padding: 0;
184
262
  display: flex;
185
263
  flex-direction: column;
186
- gap: 1rem;
264
+ }
265
+
266
+ /* The shell owns the page axis, not a card boundary. Pages place their own
267
+ workspace panel so header and content share one left edge. */
268
+ .vmz-ui-console-shell__panel {
269
+ flex: 0 0 auto;
270
+ display: flex;
271
+ flex-direction: column;
272
+ gap: var(--vmz-space-4, 1rem);
273
+ padding: var(--vmz-space-5, 1.5rem);
187
274
  }
188
275
 
189
276
  .vmz-ui-console-shell__footer {
190
277
  margin-top: auto;
191
- padding: 0.85rem 1.5rem 1.1rem;
192
- border-top: 1px solid var(--vmz-line-subtle, #e5e6eb);
193
- color: var(--vmz-text-steel, #646a73);
194
- font-size: 0.82rem;
278
+ padding: var(--vmz-space-4, 1rem) var(--vmz-space-5, 1.5rem);
279
+ border-top: 1px solid var(--vmz-line-subtle);
280
+ color: var(--vmz-text-tertiary);
281
+ font-size: 0.8125rem;
195
282
  background: var(--vmz-surface-paper);
196
283
  }
197
284
 
198
- @media (max-width: 40rem) {
285
+ @media (max-width: 720px) {
199
286
  .vmz-ui-console-shell {
200
287
  grid-template-columns: 1fr;
201
288
  grid-template-rows: auto minmax(0, 1fr);
@@ -205,47 +292,114 @@
205
292
 
206
293
  .vmz-ui-console-shell__sidebar {
207
294
  border-right: 0;
208
- border-bottom: 1px solid var(--vmz-line-subtle, #e5e6eb);
295
+ border-bottom: 1px solid var(--vmz-line-subtle);
296
+ gap: var(--vmz-space-2, 0.5rem);
297
+ padding: var(--vmz-space-2, 0.5rem) var(--vmz-space-4, 1rem);
298
+ }
299
+
300
+ .vmz-ui-console-shell__menu {
301
+ display: inline-flex;
302
+ width: calc(var(--vmz-control-height, 2rem) * 1.5);
303
+ min-height: calc(var(--vmz-control-height, 2rem) * 1.5);
209
304
  }
210
305
 
211
306
  .vmz-ui-console-shell__nav {
212
- flex-direction: row;
213
- flex-wrap: wrap;
214
- flex: 0;
307
+ display: none;
308
+ flex-direction: column;
309
+ gap: var(--vmz-space-1, 0.25rem);
310
+ flex: none;
311
+ }
312
+
313
+ .vmz-ui-console-shell__nav[data-open="true"] {
314
+ display: flex;
315
+ }
316
+
317
+ .vmz-ui-console-shell__nav a {
318
+ min-height: calc(var(--vmz-control-height, 2rem) * 1.5);
319
+ white-space: normal;
215
320
  }
216
321
 
217
322
  .vmz-ui-console-shell__header {
218
- flex-direction: column;
219
- align-items: flex-start;
220
- padding-inline: 1rem;
323
+ display: grid;
324
+ grid-template-columns: auto minmax(0, 1fr) auto;
325
+ align-items: center;
326
+ gap: var(--vmz-space-2, 0.5rem);
327
+ min-height: calc(var(--vmz-control-height, 2rem) * 1.5);
328
+ padding: var(--vmz-space-3, 0.75rem) var(--vmz-space-4, 1rem);
329
+ }
330
+
331
+ .vmz-ui-console-shell__back {
332
+ display: inline-flex;
333
+ grid-column: 1;
334
+ min-height: calc(var(--vmz-control-height, 2rem) * 1.5);
335
+ }
336
+
337
+ .vmz-ui-console-shell__header-copy {
338
+ grid-column: 2;
339
+ gap: 0;
340
+ }
341
+
342
+ .vmz-ui-console-shell__breadcrumb,
343
+ .vmz-ui-console-shell__subtitle {
344
+ display: none;
345
+ }
346
+
347
+ .vmz-ui-console-shell__title {
348
+ font-size: var(--vmz-type-subtitle);
349
+ line-height: var(--vmz-type-line-height-title);
350
+ white-space: nowrap;
351
+ overflow: hidden;
352
+ text-overflow: ellipsis;
353
+ }
354
+
355
+ .vmz-ui-console-shell__action {
356
+ grid-column: 3;
357
+ justify-self: end;
358
+ min-height: calc(var(--vmz-control-height, 2rem) * 1.5);
221
359
  }
222
360
 
223
361
  .vmz-ui-console-shell__main {
224
- padding: 1rem;
362
+ padding: 0;
363
+ }
364
+
365
+ .vmz-ui-console-shell__panel {
366
+ padding: var(--vmz-space-4, 1rem);
225
367
  }
226
368
  }
227
369
  </style>
228
370
  <script client>
229
371
  /**
230
372
  * VMZ UI — ConsoleShell (Console composition).
231
- * Sidebar + sticky header + main slot + optional footer. Parent supplies nav.
373
+ * Sidebar + 56px sticky header + white panel + optional footer. Parent owns nav/copy.
232
374
  */
233
375
  export default class ConsoleShell {
234
- public brand: string = "VMZ";
376
+ public brand: string = "";
235
377
  public homeHref: string = "/";
236
- public title: string = "Console";
378
+ public title: string = "";
237
379
  public subtitle: string = "";
238
380
  public breadcrumbLabel: string = "";
239
381
  public primaryActionLabel: string = "";
240
382
  public primaryActionHref: string = "";
383
+ public backLabel: string = "";
384
+ public backHref: string = "";
241
385
  public activeNavId: string = "";
242
- public navLabel: string = "Console";
386
+ public navLabel: string = "";
387
+ public menuLabel: string = "";
243
388
  public footer: string = "";
389
+ public menuOpen: boolean = false;
244
390
  /** @type {{ id: string, title: string, href: string }[]} */
245
391
  public nav: {
246
392
  id: string;
247
393
  title: string;
248
394
  href: string;
249
395
  }[] = [];
396
+ toggleMenu() {
397
+ this.menuOpen = !this.menuOpen;
398
+ }
399
+ onShellKeyDown(ev) {
400
+ if (ev && ev.key === "Escape" && this.menuOpen) {
401
+ this.menuOpen = false;
402
+ }
403
+ }
250
404
  }
251
405
  </script>
@@ -7,7 +7,21 @@
7
7
  .vmz-ui-content {
8
8
  flex: 1;
9
9
  min-width: 0;
10
- padding: 1.5rem;
10
+ box-sizing: border-box;
11
+ width: 100%;
12
+ max-width: var(--vmz-layout-max-width, 75rem);
13
+ margin: 0 auto;
14
+ padding: var(--vmz-space-6, 2rem) var(--vmz-layout-gutter, 1rem);
15
+ display: flex;
16
+ flex-direction: column;
17
+ gap: var(--vmz-space-6, 2rem);
18
+ color: var(--vmz-text-ink);
19
+ }
20
+ @media (max-width: 720px) {
21
+ .vmz-ui-content {
22
+ padding: var(--vmz-space-5, 1.5rem) var(--vmz-space-4, 1rem);
23
+ gap: var(--vmz-space-5, 1.5rem);
24
+ }
11
25
  }
12
26
  </style>
13
27
  <script client>