@vmz/ui 0.3.5 → 0.3.6

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 (43) hide show
  1. package/README.md +51 -51
  2. package/package.json +2 -2
  3. package/presets/web-surface.v0.json +19 -7
  4. package/src/components/Accordion.vmz +94 -94
  5. package/src/components/AppShell.vmz +77 -33
  6. package/src/components/Autocomplete.vmz +154 -154
  7. package/src/components/Badge.vmz +70 -70
  8. package/src/components/Breadcrumb.vmz +72 -72
  9. package/src/components/BulkActions.vmz +51 -51
  10. package/src/components/Button.vmz +211 -192
  11. package/src/components/Callout.vmz +77 -77
  12. package/src/components/Card.vmz +120 -106
  13. package/src/components/Checkbox.vmz +55 -55
  14. package/src/components/CodeBlock.vmz +77 -18
  15. package/src/components/ConsoleShell.vmz +251 -251
  16. package/src/components/DataTable.vmz +194 -194
  17. package/src/components/DatePicker.vmz +674 -674
  18. package/src/components/Dialog.vmz +10 -7
  19. package/src/components/Drawer.vmz +427 -427
  20. package/src/components/Dropdown.vmz +135 -16
  21. package/src/components/Empty.vmz +54 -54
  22. package/src/components/Field.vmz +115 -115
  23. package/src/components/FormItem.vmz +79 -79
  24. package/src/components/Link.vmz +34 -4
  25. package/src/components/List.vmz +102 -102
  26. package/src/components/Menu.vmz +243 -243
  27. package/src/components/Pagination.vmz +69 -69
  28. package/src/components/Popover.vmz +223 -223
  29. package/src/components/Prose.vmz +81 -81
  30. package/src/components/RadioGroup.vmz +124 -124
  31. package/src/components/Segmented.vmz +51 -51
  32. package/src/components/Select.vmz +533 -533
  33. package/src/components/Steps.vmz +103 -103
  34. package/src/components/Switch.vmz +98 -98
  35. package/src/components/Table.vmz +165 -133
  36. package/src/components/Tabs.vmz +110 -110
  37. package/src/components/Tag.vmz +43 -40
  38. package/src/components/TextArea.vmz +118 -118
  39. package/src/components/Timeline.vmz +76 -76
  40. package/src/components/Toc.vmz +74 -74
  41. package/src/components/Tooltip.vmz +58 -58
  42. package/src/components/Tree.vmz +191 -191
  43. package/src/components/Upload.vmz +1289 -1289
@@ -1,103 +1,103 @@
1
- <template>
2
- <ol data-vmz-ui="steps" :aria-label="label" class="vmz-ui-steps">
3
- <li v-for="item in items" :key="item.id" :data-vmz-step="item.id" :data-status="item.status" :aria-current="current === item.id ? 'step' : 'false'" class="vmz-ui-steps__item">
4
- <span :data-vmz-step-index="item.id" class="vmz-ui-steps__index">
5
- {{ item.index }}
6
- </span>
7
- <span class="vmz-ui-steps__body">
8
- <span class="vmz-ui-steps__title">
9
- {{ item.title }}
10
- </span>
11
- <span v-if="item.description" class="vmz-ui-steps__description">
12
- {{ item.description }}
13
- </span>
14
- </span>
15
- </li>
16
- </ol>
17
- </template>
18
- <style>
19
- .vmz-ui-steps {
20
- margin: 0;
21
- padding: 0;
22
- list-style: none;
23
- display: flex;
24
- flex-direction: column;
25
- gap: var(--vmz-density-control-gap);
26
- max-width: 36rem;
27
- }
28
-
29
- .vmz-ui-steps__item {
30
- display: flex;
31
- align-items: flex-start;
32
- gap: 0.75rem;
33
- color: var(--vmz-text-steel);
34
- }
35
-
36
- .vmz-ui-steps__item[data-status="done"] {
37
- color: var(--vmz-status-success-foreground);
38
- }
39
-
40
- .vmz-ui-steps__item[data-status="current"] {
41
- color: var(--vmz-action-primary-active);
42
- }
43
-
44
- .vmz-ui-steps__index {
45
- flex: 0 0 auto;
46
- min-width: 1.75rem;
47
- height: 1.75rem;
48
- display: inline-flex;
49
- align-items: center;
50
- justify-content: center;
51
- border: 1px solid var(--vmz-line-default);
52
- border-radius: 999px;
53
- font-weight: 700;
54
- font-size: 0.85rem;
55
- color: inherit;
56
- }
57
-
58
- .vmz-ui-steps__item[data-status="current"] .vmz-ui-steps__index {
59
- border-color: var(--vmz-action-primary-background);
60
- background: var(--vmz-action-primary-background);
61
- color: var(--vmz-action-primary-foreground);
62
- }
63
-
64
- .vmz-ui-steps__item[data-status="done"] .vmz-ui-steps__index {
65
- border-color: var(--vmz-status-success-accent);
66
- background: color-mix(in srgb, var(--vmz-status-success-accent) 18%, transparent);
67
- }
68
-
69
- .vmz-ui-steps__body {
70
- display: flex;
71
- flex-direction: column;
72
- gap: 0.2rem;
73
- padding-top: 0.15rem;
74
- }
75
-
76
- .vmz-ui-steps__title {
77
- font-weight: 700;
78
- }
79
-
80
- .vmz-ui-steps__description {
81
- font-size: 0.9em;
82
- opacity: 0.9;
83
- }
84
- </style>
85
- <script client>
86
- /**
87
- * VMZ UI — Steps.
88
- * Parent owns `current` id and item `status` (upcoming|current|done).
89
- * Navigation actions stay on the page (no private wizard store).
90
- */
91
- export default class Steps {
92
- public label: string = "Steps";
93
- public current: string = "";
94
- /** @type {{ id: string, index: string, title: string, description?: string, status: string }[]} */
95
- public items: {
96
- id: string;
97
- index: string;
98
- title: string;
99
- description?: string;
100
- status: string;
101
- }[] = [];
102
- }
103
- </script>
1
+ <template>
2
+ <ol data-vmz-ui="steps" :aria-label="label" class="vmz-ui-steps">
3
+ <li v-for="item in items" :key="item.id" :data-vmz-step="item.id" :data-status="item.status" :aria-current="current === item.id ? 'step' : 'false'" class="vmz-ui-steps__item">
4
+ <span :data-vmz-step-index="item.id" class="vmz-ui-steps__index">
5
+ {{ item.index }}
6
+ </span>
7
+ <span class="vmz-ui-steps__body">
8
+ <span class="vmz-ui-steps__title">
9
+ {{ item.title }}
10
+ </span>
11
+ <span v-if="item.description" class="vmz-ui-steps__description">
12
+ {{ item.description }}
13
+ </span>
14
+ </span>
15
+ </li>
16
+ </ol>
17
+ </template>
18
+ <style>
19
+ .vmz-ui-steps {
20
+ margin: 0;
21
+ padding: 0;
22
+ list-style: none;
23
+ display: flex;
24
+ flex-direction: column;
25
+ gap: var(--vmz-density-control-gap);
26
+ max-width: 36rem;
27
+ }
28
+
29
+ .vmz-ui-steps__item {
30
+ display: flex;
31
+ align-items: flex-start;
32
+ gap: 0.75rem;
33
+ color: var(--vmz-text-steel);
34
+ }
35
+
36
+ .vmz-ui-steps__item[data-status="done"] {
37
+ color: var(--vmz-status-success-foreground);
38
+ }
39
+
40
+ .vmz-ui-steps__item[data-status="current"] {
41
+ color: var(--vmz-action-primary-active);
42
+ }
43
+
44
+ .vmz-ui-steps__index {
45
+ flex: 0 0 auto;
46
+ min-width: 1.75rem;
47
+ height: 1.75rem;
48
+ display: inline-flex;
49
+ align-items: center;
50
+ justify-content: center;
51
+ border: 1px solid var(--vmz-line-default);
52
+ border-radius: 999px;
53
+ font-weight: 700;
54
+ font-size: 0.85rem;
55
+ color: inherit;
56
+ }
57
+
58
+ .vmz-ui-steps__item[data-status="current"] .vmz-ui-steps__index {
59
+ border-color: var(--vmz-action-primary-background);
60
+ background: var(--vmz-action-primary-background);
61
+ color: var(--vmz-action-primary-foreground);
62
+ }
63
+
64
+ .vmz-ui-steps__item[data-status="done"] .vmz-ui-steps__index {
65
+ border-color: var(--vmz-status-success-accent);
66
+ background: color-mix(in srgb, var(--vmz-status-success-accent) 18%, transparent);
67
+ }
68
+
69
+ .vmz-ui-steps__body {
70
+ display: flex;
71
+ flex-direction: column;
72
+ gap: 0.2rem;
73
+ padding-top: 0.125rem;
74
+ }
75
+
76
+ .vmz-ui-steps__title {
77
+ font-weight: 700;
78
+ }
79
+
80
+ .vmz-ui-steps__description {
81
+ font-size: 0.9em;
82
+ opacity: 0.9;
83
+ }
84
+ </style>
85
+ <script client>
86
+ /**
87
+ * VMZ UI — Steps.
88
+ * Parent owns `current` id and item `status` (upcoming|current|done).
89
+ * Navigation actions stay on the page (no private wizard store).
90
+ */
91
+ export default class Steps {
92
+ public label: string = "Steps";
93
+ public current: string = "";
94
+ /** @type {{ id: string, index: string, title: string, description?: string, status: string }[]} */
95
+ public items: {
96
+ id: string;
97
+ index: string;
98
+ title: string;
99
+ description?: string;
100
+ status: string;
101
+ }[] = [];
102
+ }
103
+ </script>
@@ -1,98 +1,98 @@
1
- <template>
2
- <label data-vmz-ui="switch" :for="controlId" class="vmz-ui-switch">
3
- <button :id="controlId" type="button" role="switch" :aria-checked="checked" :aria-describedby="describedBy" :disabled="disabled" @click="toggle" :onKeyDown="onKeyDown" class="vmz-ui-switch__control">
4
- <span aria-hidden="true" class="vmz-ui-switch__thumb" />
5
- </button>
6
- <span class="vmz-ui-switch__label">
7
- {{ label }}
8
- </span>
9
- </label>
10
- </template>
11
- <style>
12
- .vmz-ui-switch {
13
- display: inline-flex;
14
- align-items: center;
15
- gap: 0.55rem;
16
- font: inherit;
17
- cursor: pointer;
18
- }
19
-
20
- .vmz-ui-switch__control {
21
- position: relative;
22
- width: 2.4rem;
23
- height: 1.35rem;
24
- padding: 0;
25
- border: 1px solid var(--vmz-line-default);
26
- border-radius: 999px;
27
- background: transparent;
28
- cursor: pointer;
29
- outline: none;
30
- }
31
-
32
- .vmz-ui-switch__control[aria-checked="true"],
33
- .vmz-ui-switch__control[aria-checked=""] {
34
- background: var(--vmz-action-primary-background);
35
- }
36
-
37
- .vmz-ui-switch__control:focus-visible {
38
- box-shadow: 0 0 0 2px var(--vmz-focus-ring);
39
- }
40
-
41
- .vmz-ui-switch__control:disabled {
42
- opacity: 0.55;
43
- cursor: not-allowed;
44
- }
45
-
46
- .vmz-ui-switch__thumb {
47
- position: absolute;
48
- top: 0.12rem;
49
- left: 0.12rem;
50
- width: 1rem;
51
- height: 1rem;
52
- border-radius: 999px;
53
- background: var(--vmz-action-primary-foreground);
54
- transition: transform var(--vmz-motion-control-duration) var(--vmz-motion-control-easing);
55
- }
56
-
57
- .vmz-ui-switch__control[aria-checked="true"] .vmz-ui-switch__thumb,
58
- .vmz-ui-switch__control[aria-checked=""] .vmz-ui-switch__thumb {
59
- transform: translateX(1.05rem);
60
- }
61
-
62
- .vmz-ui-switch__label {
63
- font-weight: 600;
64
- }
65
-
66
- @media (prefers-reduced-motion: reduce) {
67
- .vmz-ui-switch__thumb {
68
- transition: none;
69
- }
70
- }
71
- </style>
72
- <script client>
73
- /**
74
- * VMZ UI — Switch (UI2).
75
- * role=switch + aria-checked; parent owns checked (no parallel form store).
76
- */
77
- export default class Switch {
78
- public label: string = "";
79
- public checked: boolean = false;
80
- public disabled: boolean = false;
81
- public controlId: string = "vmz-switch";
82
- public describedBy: string = "";
83
- public onChange: ((checked: boolean) => void) | null = null;
84
- toggle() {
85
- if (this.disabled) return;
86
- const next = !this.checked;
87
- this.emit("change", next);
88
- if (typeof this.onChange === "function") this.onChange(next);
89
- }
90
- onKeyDown(ev) {
91
- if (!ev) return;
92
- if (ev.key === " " || ev.key === "Enter") {
93
- ev.preventDefault();
94
- this.toggle();
95
- }
96
- }
97
- }
98
- </script>
1
+ <template>
2
+ <label data-vmz-ui="switch" :for="controlId" class="vmz-ui-switch">
3
+ <button :id="controlId" type="button" role="switch" :aria-checked="checked" :aria-describedby="describedBy" :disabled="disabled" @click="toggle" :onKeyDown="onKeyDown" class="vmz-ui-switch__control">
4
+ <span aria-hidden="true" class="vmz-ui-switch__thumb" />
5
+ </button>
6
+ <span class="vmz-ui-switch__label">
7
+ {{ label }}
8
+ </span>
9
+ </label>
10
+ </template>
11
+ <style>
12
+ .vmz-ui-switch {
13
+ display: inline-flex;
14
+ align-items: center;
15
+ gap: 0.5rem;
16
+ font: inherit;
17
+ cursor: pointer;
18
+ }
19
+
20
+ .vmz-ui-switch__control {
21
+ position: relative;
22
+ width: 2.4rem;
23
+ height: 1.35rem;
24
+ padding: 0;
25
+ border: 1px solid var(--vmz-line-default);
26
+ border-radius: 999px;
27
+ background: transparent;
28
+ cursor: pointer;
29
+ outline: none;
30
+ }
31
+
32
+ .vmz-ui-switch__control[aria-checked="true"],
33
+ .vmz-ui-switch__control[aria-checked=""] {
34
+ background: var(--vmz-action-primary-background);
35
+ }
36
+
37
+ .vmz-ui-switch__control:focus-visible {
38
+ box-shadow: 0 0 0 3px var(--vmz-focus-ring);
39
+ }
40
+
41
+ .vmz-ui-switch__control:disabled {
42
+ opacity: 0.55;
43
+ cursor: not-allowed;
44
+ }
45
+
46
+ .vmz-ui-switch__thumb {
47
+ position: absolute;
48
+ top: 0.12rem;
49
+ left: 0.12rem;
50
+ width: 1rem;
51
+ height: 1rem;
52
+ border-radius: 999px;
53
+ background: var(--vmz-action-primary-foreground);
54
+ transition: transform var(--vmz-motion-control-duration) var(--vmz-motion-control-easing);
55
+ }
56
+
57
+ .vmz-ui-switch__control[aria-checked="true"] .vmz-ui-switch__thumb,
58
+ .vmz-ui-switch__control[aria-checked=""] .vmz-ui-switch__thumb {
59
+ transform: translateX(1.05rem);
60
+ }
61
+
62
+ .vmz-ui-switch__label {
63
+ font-weight: 600;
64
+ }
65
+
66
+ @media (prefers-reduced-motion: reduce) {
67
+ .vmz-ui-switch__thumb {
68
+ transition: none;
69
+ }
70
+ }
71
+ </style>
72
+ <script client>
73
+ /**
74
+ * VMZ UI — Switch (UI2).
75
+ * role=switch + aria-checked; parent owns checked (no parallel form store).
76
+ */
77
+ export default class Switch {
78
+ public label: string = "";
79
+ public checked: boolean = false;
80
+ public disabled: boolean = false;
81
+ public controlId: string = "vmz-switch";
82
+ public describedBy: string = "";
83
+ public onChange: ((checked: boolean) => void) | null = null;
84
+ toggle() {
85
+ if (this.disabled) return;
86
+ const next = !this.checked;
87
+ this.emit("change", next);
88
+ if (typeof this.onChange === "function") this.onChange(next);
89
+ }
90
+ onKeyDown(ev) {
91
+ if (!ev) return;
92
+ if (ev.key === " " || ev.key === "Enter") {
93
+ ev.preventDefault();
94
+ this.toggle();
95
+ }
96
+ }
97
+ }
98
+ </script>