@vmz/ui 0.3.6 → 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 +53 -51
  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 +127 -94
  6. package/src/components/Alert.vmz +125 -28
  7. package/src/components/AppShell.vmz +125 -57
  8. package/src/components/Autocomplete.vmz +261 -154
  9. package/src/components/Avatar.vmz +20 -12
  10. package/src/components/Badge.vmz +62 -70
  11. package/src/components/Breadcrumb.vmz +86 -72
  12. package/src/components/BulkActions.vmz +56 -51
  13. package/src/components/Button.vmz +237 -211
  14. package/src/components/Callout.vmz +178 -77
  15. package/src/components/Card.vmz +141 -120
  16. package/src/components/Checkbox.vmz +131 -55
  17. package/src/components/CodeBlock.vmz +77 -30
  18. package/src/components/Collapse.vmz +64 -11
  19. package/src/components/ConsoleShell.vmz +405 -251
  20. package/src/components/Content.vmz +15 -1
  21. package/src/components/DataTable.vmz +294 -194
  22. package/src/components/DatePicker.vmz +766 -674
  23. package/src/components/Descriptions.vmz +90 -0
  24. package/src/components/Dialog.vmz +137 -38
  25. package/src/components/Divider.vmz +8 -1
  26. package/src/components/Drawer.vmz +518 -427
  27. package/src/components/Dropdown.vmz +195 -51
  28. package/src/components/Empty.vmz +96 -54
  29. package/src/components/Field.vmz +170 -115
  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 +78 -79
  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 +25 -10
  39. package/src/components/List.vmz +124 -102
  40. package/src/components/Menu.vmz +416 -243
  41. package/src/components/Message.vmz +167 -0
  42. package/src/components/Notification.vmz +132 -37
  43. package/src/components/Pagination.vmz +237 -69
  44. package/src/components/Popconfirm.vmz +287 -0
  45. package/src/components/Popover.vmz +341 -223
  46. package/src/components/Progress.vmz +16 -5
  47. package/src/components/Prose.vmz +180 -81
  48. package/src/components/QueryForm.vmz +31 -9
  49. package/src/components/RadioGroup.vmz +204 -124
  50. package/src/components/Result.vmz +60 -27
  51. package/src/components/Segmented.vmz +86 -51
  52. package/src/components/Select.vmz +620 -533
  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 +118 -103
  58. package/src/components/Switch.vmz +131 -98
  59. package/src/components/Table.vmz +270 -165
  60. package/src/components/Tabs.vmz +125 -110
  61. package/src/components/Tag.vmz +60 -43
  62. package/src/components/TextArea.vmz +125 -118
  63. package/src/components/Timeline.vmz +111 -76
  64. package/src/components/Toc.vmz +90 -74
  65. package/src/components/Tooltip.vmz +107 -58
  66. package/src/components/Tree.vmz +214 -191
  67. package/src/components/Typography.vmz +23 -8
  68. package/src/components/Upload.vmz +1394 -1289
@@ -1,98 +1,131 @@
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>
1
+ <template>
2
+ <label data-vmz-ui="switch" :for="controlId" :data-disabled="disabled ? 'true' : 'false'" class="vmz-ui-switch">
3
+ <button :id="controlId" type="button" role="switch" :aria-checked="checked ? 'true' : 'false'" :data-checked="checked ? 'true' : 'false'" :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: var(--vmz-space-2);
16
+ font: inherit;
17
+ font-size: 0.875rem;
18
+ line-height: 1.5715;
19
+ color: var(--vmz-text-ink);
20
+ cursor: pointer;
21
+ }
22
+
23
+ .vmz-ui-switch__control {
24
+ position: relative;
25
+ flex: 0 0 auto;
26
+ box-sizing: border-box;
27
+ width: 2.5rem;
28
+ height: 1.5rem;
29
+ padding: 0;
30
+ border: 0;
31
+ border-radius: var(--vmz-radius-pill);
32
+ background: var(--vmz-line-strong);
33
+ cursor: pointer;
34
+ outline: none;
35
+ transition:
36
+ background-color var(--vmz-motion-control-duration) var(--vmz-motion-control-easing),
37
+ box-shadow var(--vmz-motion-control-duration) var(--vmz-motion-control-easing);
38
+ }
39
+
40
+ .vmz-ui-switch__control:hover:not(:disabled):not([aria-checked="true"]) {
41
+ background: var(--vmz-text-tertiary);
42
+ }
43
+
44
+ .vmz-ui-switch__control[aria-checked="true"],
45
+ .vmz-ui-switch__control[data-checked="true"] {
46
+ background: var(--vmz-action-primary-background);
47
+ }
48
+
49
+ .vmz-ui-switch__control[aria-checked="true"]:hover:not(:disabled),
50
+ .vmz-ui-switch__control[data-checked="true"]:hover:not(:disabled) {
51
+ background: var(--vmz-action-primary-hover);
52
+ }
53
+
54
+ .vmz-ui-switch__control:active:not(:disabled)[aria-checked="true"],
55
+ .vmz-ui-switch__control:active:not(:disabled)[data-checked="true"] {
56
+ background: var(--vmz-action-primary-active);
57
+ }
58
+
59
+ .vmz-ui-switch__control:focus-visible {
60
+ box-shadow: 0 0 0 3px var(--vmz-focus-ring);
61
+ }
62
+
63
+ .vmz-ui-switch__control:disabled {
64
+ opacity: 0.55;
65
+ cursor: not-allowed;
66
+ }
67
+
68
+ .vmz-ui-switch__thumb {
69
+ position: absolute;
70
+ top: var(--vmz-space-1);
71
+ left: var(--vmz-space-1);
72
+ width: 1rem;
73
+ height: 1rem;
74
+ border-radius: var(--vmz-radius-pill);
75
+ background: var(--vmz-action-primary-foreground);
76
+ transition: transform var(--vmz-motion-control-duration) var(--vmz-motion-control-easing);
77
+ }
78
+
79
+ .vmz-ui-switch__control[aria-checked="true"] .vmz-ui-switch__thumb,
80
+ .vmz-ui-switch__control[data-checked="true"] .vmz-ui-switch__thumb {
81
+ transform: translateX(1rem);
82
+ }
83
+
84
+ .vmz-ui-switch__label {
85
+ font-weight: 400;
86
+ }
87
+
88
+ .vmz-ui-switch[data-disabled="true"] {
89
+ opacity: 0.55;
90
+ cursor: not-allowed;
91
+ }
92
+
93
+ .vmz-ui-switch[data-disabled="true"] .vmz-ui-switch__control,
94
+ .vmz-ui-switch[data-disabled="true"] .vmz-ui-switch__label {
95
+ cursor: not-allowed;
96
+ }
97
+
98
+ @media (prefers-reduced-motion: reduce) {
99
+ .vmz-ui-switch__control,
100
+ .vmz-ui-switch__thumb {
101
+ transition: none;
102
+ }
103
+ }
104
+ </style>
105
+ <script client>
106
+ /**
107
+ * VMZ UI — Switch (UI2).
108
+ * role=switch + aria-checked; parent owns checked (no parallel form store).
109
+ */
110
+ export default class Switch {
111
+ public label: string = "";
112
+ public checked: boolean = false;
113
+ public disabled: boolean = false;
114
+ public controlId: string = "vmz-switch";
115
+ public describedBy: string = "";
116
+ public onChange: ((checked: boolean) => void) | null = null;
117
+ toggle() {
118
+ if (this.disabled) return;
119
+ const next = !this.checked;
120
+ this.emit("change", next);
121
+ if (typeof this.onChange === "function") this.onChange(next);
122
+ }
123
+ onKeyDown(ev) {
124
+ if (!ev) return;
125
+ if (ev.key === " " || ev.key === "Enter") {
126
+ ev.preventDefault();
127
+ this.toggle();
128
+ }
129
+ }
130
+ }
131
+ </script>