@vmz/ui 0.1.0 → 0.1.2

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 (66) hide show
  1. package/README.md +8 -0
  2. package/contracts/token-requirements.v0.json +2 -6
  3. package/package.json +18 -2
  4. package/presets/web-surface.v0.json +24 -10
  5. package/src/components/Accordion.vmz +88 -89
  6. package/src/components/Alert.vmz +64 -63
  7. package/src/components/AppShell.vmz +64 -45
  8. package/src/components/Autocomplete.vmz +152 -151
  9. package/src/components/Avatar.vmz +16 -0
  10. package/src/components/Badge.vmz +46 -46
  11. package/src/components/Breadcrumb.vmz +52 -48
  12. package/src/components/BulkActions.vmz +37 -37
  13. package/src/components/Button.vmz +90 -75
  14. package/src/components/Callout.vmz +61 -61
  15. package/src/components/Card.vmz +58 -51
  16. package/src/components/Checkbox.vmz +56 -53
  17. package/src/components/CodeBlock.vmz +51 -51
  18. package/src/components/Collapse.vmz +20 -0
  19. package/src/components/ConsoleShell.vmz +134 -99
  20. package/src/components/Content.vmz +11 -0
  21. package/src/components/DataTable.vmz +197 -196
  22. package/src/components/DatePicker.vmz +613 -536
  23. package/src/components/Dialog.vmz +365 -384
  24. package/src/components/Divider.vmz +19 -0
  25. package/src/components/Drawer.vmz +361 -378
  26. package/src/components/Dropdown.vmz +22 -0
  27. package/src/components/Empty.vmz +36 -36
  28. package/src/components/Field.vmz +69 -40
  29. package/src/components/FilterBar.vmz +15 -15
  30. package/src/components/Flex.vmz +12 -0
  31. package/src/components/Footer.vmz +11 -0
  32. package/src/components/Form.vmz +56 -58
  33. package/src/components/FormItem.vmz +59 -59
  34. package/src/components/Grid.vmz +12 -0
  35. package/src/components/Header.vmz +11 -0
  36. package/src/components/Icon.vmz +86 -0
  37. package/src/components/Layout.vmz +11 -0
  38. package/src/components/Link.vmz +33 -33
  39. package/src/components/List.vmz +96 -96
  40. package/src/components/Menu.vmz +229 -240
  41. package/src/components/Notification.vmz +62 -62
  42. package/src/components/Pagination.vmz +63 -65
  43. package/src/components/Popover.vmz +202 -219
  44. package/src/components/Progress.vmz +18 -0
  45. package/src/components/Prose.vmz +61 -61
  46. package/src/components/QueryForm.vmz +26 -27
  47. package/src/components/RadioGroup.vmz +116 -113
  48. package/src/components/Result.vmz +63 -63
  49. package/src/components/Segmented.vmz +29 -0
  50. package/src/components/Select.vmz +462 -290
  51. package/src/components/Sider.vmz +6 -0
  52. package/src/components/Skeleton.vmz +58 -58
  53. package/src/components/Space.vmz +15 -0
  54. package/src/components/Spinner.vmz +29 -29
  55. package/src/components/Steps.vmz +86 -86
  56. package/src/components/Switch.vmz +86 -88
  57. package/src/components/Table.vmz +116 -114
  58. package/src/components/Tabs.vmz +113 -112
  59. package/src/components/Tag.vmz +8 -0
  60. package/src/components/TextArea.vmz +76 -49
  61. package/src/components/Timeline.vmz +55 -50
  62. package/src/components/Toc.vmz +64 -60
  63. package/src/components/Tooltip.vmz +51 -51
  64. package/src/components/Tree.vmz +184 -190
  65. package/src/components/Typography.vmz +9 -0
  66. package/src/components/Upload.vmz +1130 -1151
@@ -0,0 +1,86 @@
1
+ <template>
2
+ <span
3
+ class="vmz-ui-icon"
4
+ data-vmz-ui="icon"
5
+ data-name={name}
6
+ data-size={size}
7
+ role={decorative ? 'presentation' : 'img'}
8
+ aria-hidden={decorative ? 'true' : 'false'}
9
+ aria-label={decorative ? '' : label}
10
+ >
11
+ <svg class="vmz-ui-icon__svg" viewBox="0 0 24 24" focusable="false" aria-hidden="true">
12
+ <path if={isCheck} fill="currentColor" d="M9.2 16.6 4.8 12.2l1.4-1.4 3 3 8-8 1.4 1.4z" />
13
+ <path if={isClose} fill="currentColor" d="M6.4 7.8 7.8 6.4 12 10.6 16.2 6.4 17.6 7.8 13.4 12 17.6 16.2 16.2 17.6 12 13.4 7.8 17.6 6.4 16.2 10.6 12z" />
14
+ <path if={isSearch} fill="currentColor" d="M10.5 3a7.5 7.5 0 0 1 5.9 12.1l4 4-1.4 1.4-4-4A7.5 7.5 0 1 1 10.5 3zm0 2a5.5 5.5 0 1 0 0 11 5.5 5.5 0 0 0 0-11z" />
15
+ <path if={isChevronDown} fill="currentColor" d="M7.4 9.1 12 13.7l4.6-4.6 1.4 1.4L12 16.5 6 10.5z" />
16
+ <path if={isChevronRight} fill="currentColor" d="M9.1 6 15.1 12l-6 6-1.4-1.4L12.3 12 7.7 7.4z" />
17
+ <path if={isInfo} fill="currentColor" d="M12 2a10 10 0 1 1 0 20 10 10 0 0 1 0-20zm0 8.2a1 1 0 0 0-1 1V17a1 1 0 1 0 2 0v-5.8a1 1 0 0 0-1-1zm0-3.7a1.2 1.2 0 1 0 0 2.4 1.2 1.2 0 0 0 0-2.4z" />
18
+ <path if={isWarning} fill="currentColor" d="M12 3.2 21 19H3L12 3.2zm0 5.3a1 1 0 0 0-1 1v4.2a1 1 0 1 0 2 0V9.5a1 1 0 0 0-1-1zm0 8.1a1.2 1.2 0 1 0 0 2.4 1.2 1.2 0 0 0 0-2.4z" />
19
+ <path if={isSuccess} fill="currentColor" d="M12 2a10 10 0 1 1 0 20 10 10 0 0 1 0-20zm-2.5 10.3-2-2 1.4-1.4 2 2 5-5 1.4 1.4z" />
20
+ <path if={isDanger} fill="currentColor" d="M12 2a10 10 0 1 1 0 20 10 10 0 0 1 0-20zm-1 5h2v6h-2zm0 8h2v2h-2z" />
21
+ <path if={isMenu} fill="currentColor" d="M4 7h16v2H4zm0 4h16v2H4zm0 4h16v2H4z" />
22
+ <path if={isPlus} fill="currentColor" d="M11 5h2v6h6v2h-6v6h-2v-6H5v-2h6z" />
23
+ <path if={isFallback} fill="currentColor" d="M12 2a10 10 0 1 1 0 20 10 10 0 0 1 0-20zm1 5h-2v2h2zm0 4h-2v7h2z" />
24
+ </svg>
25
+ </span>
26
+ </template>
27
+
28
+ <style>
29
+ .vmz-ui-icon {
30
+ display: inline-flex;
31
+ align-items: center;
32
+ justify-content: center;
33
+ width: 1em;
34
+ height: 1em;
35
+ vertical-align: -0.125em;
36
+ color: inherit;
37
+ line-height: 1;
38
+ }
39
+ .vmz-ui-icon[data-size='sm'] { font-size: 0.875rem; }
40
+ .vmz-ui-icon[data-size='md'] { font-size: 1rem; }
41
+ .vmz-ui-icon[data-size='lg'] { font-size: 1.25rem; }
42
+ .vmz-ui-icon__svg { width: 1em; height: 1em; display: block; }
43
+ </style>
44
+
45
+ <script client>
46
+ /**
47
+ * VMZ UI — Icon (minimal official set).
48
+ * Parent picks `name`; no useIcon/createIcon. Unknown names render fallback glyph.
49
+ */
50
+ export default class Icon {
51
+ public name: string = "info";
52
+ public size: string = "md";
53
+ public label: string = "";
54
+ public decorative: boolean = true;
55
+ isCheck = false;
56
+ isClose = false;
57
+ isSearch = false;
58
+ isChevronDown = false;
59
+ isChevronRight = false;
60
+ isInfo = false;
61
+ isWarning = false;
62
+ isSuccess = false;
63
+ isDanger = false;
64
+ isMenu = false;
65
+ isPlus = false;
66
+ isFallback = false;
67
+ onMount() {
68
+ this._sync();
69
+ }
70
+ _sync() {
71
+ const n = String(this.name || "");
72
+ this.isCheck = n === "check";
73
+ this.isClose = n === "close";
74
+ this.isSearch = n === "search";
75
+ this.isChevronDown = n === "chevron-down";
76
+ this.isChevronRight = n === "chevron-right";
77
+ this.isInfo = n === "info";
78
+ this.isWarning = n === "warning";
79
+ this.isSuccess = n === "success";
80
+ this.isDanger = n === "danger";
81
+ this.isMenu = n === "menu";
82
+ this.isPlus = n === "plus";
83
+ this.isFallback = !(this.isCheck || this.isClose || this.isSearch || this.isChevronDown || this.isChevronRight || this.isInfo || this.isWarning || this.isSuccess || this.isDanger || this.isMenu || this.isPlus);
84
+ }
85
+ }
86
+ </script>
@@ -0,0 +1,11 @@
1
+ <template>
2
+ <div class="vmz-ui-layout" data-vmz-ui="layout"><slot /></div>
3
+ </template>
4
+
5
+ <style>
6
+ .vmz-ui-layout{display:flex;flex-direction:column;min-height:100%;background:var(--vmz-surface-page,var(--vmz-surface-mist,#f5f5f5))}
7
+ </style>
8
+
9
+ <script client>
10
+ export default class Layout {}
11
+ </script>
@@ -1,48 +1,48 @@
1
1
  <template>
2
2
  <a
3
- class="vmz-ui-link"
4
- data-vmz-ui="link"
5
- href={href}
6
- target={target}
7
- rel={rel}
8
- >
9
- <slot />
10
- </a>
3
+ class="vmz-ui-link"
4
+ data-vmz-ui="link"
5
+ href={href}
6
+ target={target}
7
+ rel={rel}
8
+ >
9
+ <slot />
10
+ </a>
11
11
  </template>
12
12
 
13
13
  <style>
14
- .vmz-ui-link {
15
- font: inherit;
16
- font-weight: 600;
17
- color: var(--vmz-action-primary-background);
18
- text-decoration: underline;
19
- text-underline-offset: 0.15em;
20
- text-decoration-thickness: 1px;
21
- outline: none;
22
- }
14
+ .vmz-ui-link {
15
+ font: inherit;
16
+ font-weight: 600;
17
+ color: var(--vmz-action-primary-background);
18
+ text-decoration: underline;
19
+ text-underline-offset: 0.15em;
20
+ text-decoration-thickness: 1px;
21
+ outline: none;
22
+ }
23
23
 
24
- .vmz-ui-link:hover {
25
- color: var(--vmz-action-primary-hover);
26
- }
24
+ .vmz-ui-link:hover {
25
+ color: var(--vmz-action-primary-hover);
26
+ }
27
27
 
28
- .vmz-ui-link:active {
29
- color: var(--vmz-action-primary-active);
30
- }
28
+ .vmz-ui-link:active {
29
+ color: var(--vmz-action-primary-active);
30
+ }
31
31
 
32
- .vmz-ui-link:focus-visible {
33
- box-shadow: 0 0 0 2px var(--vmz-focus-ring);
34
- border-radius: 2px;
35
- }
32
+ .vmz-ui-link:focus-visible {
33
+ box-shadow: 0 0 0 2px var(--vmz-focus-ring);
34
+ border-radius: var(--vmz-radius-md, 6px);
35
+ }
36
36
  </style>
37
37
 
38
38
  <script client>
39
39
  /**
40
- * VMZ UI — Link (Foundation).
41
- * Navigation / inline text link; tokens only, no brand hex.
42
- */
40
+ * VMZ UI — Link (Foundation).
41
+ * Navigation / inline text link; tokens only, no brand hex.
42
+ */
43
43
  export default class Link {
44
- public href: string = '#';
45
- public target: string = '';
46
- public rel: string = '';
44
+ public href: string = "#";
45
+ public target: string = "";
46
+ public rel: string = "";
47
47
  }
48
48
  </script>
@@ -1,116 +1,116 @@
1
1
  <template>
2
2
  <div class="vmz-ui-list" data-vmz-ui="list">
3
- <p if={label} class="vmz-ui-list__label" id={labelId}>{label}</p>
4
- <ul
5
- class="vmz-ui-list__items"
6
- role="listbox"
7
- aria-labelledby={labelId}
8
- aria-label={label}
9
- onClick={onListClick}
10
- onKeyDown={onListKeyDown}
11
- >
12
- <li
13
- each={items}
14
- as="item"
15
- key={item.id}
16
- class="vmz-ui-list__item"
17
- role="option"
18
- id={item.id}
19
- data-vmz-list-item={item.id}
20
- aria-selected={selected === item.id ? 'true' : 'false'}
21
- tabindex={selected === item.id ? 0 : -1}
3
+ <p if={label} class="vmz-ui-list__label" id={labelId}>{label}</p>
4
+ <ul
5
+ class="vmz-ui-list__items"
6
+ role="listbox"
7
+ aria-labelledby={labelId}
8
+ aria-label={label}
9
+ onClick={onListClick}
10
+ onKeyDown={onListKeyDown}
22
11
  >
23
- {item.title}
24
- </li>
25
- </ul>
26
- </div>
12
+ <li
13
+ each={items}
14
+ as="item"
15
+ key={item.id}
16
+ class="vmz-ui-list__item"
17
+ role="option"
18
+ id={item.id}
19
+ data-vmz-list-item={item.id}
20
+ aria-selected={selected === item.id ? 'true' : 'false'}
21
+ tabindex={selected === item.id ? 0 : -1}
22
+ >
23
+ {item.title}
24
+ </li>
25
+ </ul>
26
+ </div>
27
27
  </template>
28
28
 
29
29
  <style>
30
- .vmz-ui-list {
31
- display: flex;
32
- flex-direction: column;
33
- gap: 0.35rem;
34
- max-width: 28rem;
35
- }
30
+ .vmz-ui-list {
31
+ display: flex;
32
+ flex-direction: column;
33
+ gap: 0.35rem;
34
+ max-width: 28rem;
35
+ }
36
36
 
37
- .vmz-ui-list__label {
38
- margin: 0;
39
- font-weight: 600;
40
- color: var(--vmz-text-ink);
41
- }
37
+ .vmz-ui-list__label {
38
+ margin: 0;
39
+ font-weight: 600;
40
+ color: var(--vmz-text-ink);
41
+ }
42
42
 
43
- .vmz-ui-list__items {
44
- margin: 0;
45
- padding: 0.25rem;
46
- list-style: none;
47
- border: 1px solid var(--vmz-line-default);
48
- border-radius: 2px;
49
- background: var(--vmz-surface-paper);
50
- color: var(--vmz-text-ink);
51
- }
43
+ .vmz-ui-list__items {
44
+ margin: 0;
45
+ padding: 0.25rem;
46
+ list-style: none;
47
+ border: 1px solid var(--vmz-line-default);
48
+ border-radius: var(--vmz-radius-md, 6px);
49
+ background: var(--vmz-surface-paper);
50
+ color: var(--vmz-text-ink);
51
+ }
52
52
 
53
- .vmz-ui-list__item {
54
- padding: var(--vmz-density-control-padding-y) var(--vmz-density-control-padding-x);
55
- border-radius: 2px;
56
- cursor: pointer;
57
- outline: none;
58
- }
53
+ .vmz-ui-list__item {
54
+ padding: var(--vmz-density-control-padding-y) var(--vmz-density-control-padding-x);
55
+ border-radius: var(--vmz-radius-md, 6px);
56
+ cursor: pointer;
57
+ outline: none;
58
+ }
59
59
 
60
- .vmz-ui-list__item[aria-selected='true'] {
61
- background: var(--vmz-action-primary-background);
62
- color: var(--vmz-action-primary-foreground);
63
- }
60
+ .vmz-ui-list__item[aria-selected='true'] {
61
+ background: var(--vmz-action-primary-background);
62
+ color: var(--vmz-action-primary-foreground);
63
+ }
64
64
 
65
- .vmz-ui-list__item:hover {
66
- background: color-mix(in srgb, var(--vmz-action-primary-background) 14%, transparent);
67
- }
65
+ .vmz-ui-list__item:hover {
66
+ background: color-mix(in srgb, var(--vmz-action-primary-background) 14%, transparent);
67
+ }
68
68
 
69
- .vmz-ui-list__item[aria-selected='true']:hover {
70
- background: var(--vmz-action-primary-hover);
71
- }
69
+ .vmz-ui-list__item[aria-selected='true']:hover {
70
+ background: var(--vmz-action-primary-hover);
71
+ }
72
72
 
73
- .vmz-ui-list__item:focus-visible {
74
- box-shadow: 0 0 0 2px var(--vmz-focus-ring);
75
- }
73
+ .vmz-ui-list__item:focus-visible {
74
+ box-shadow: 0 0 0 2px var(--vmz-focus-ring);
75
+ }
76
76
  </style>
77
77
 
78
78
  <script client>
79
79
  /**
80
- * VMZ UI — List (ordinary selectable list).
81
- * Parent owns `selected` id; click + Arrow/Home/End. Not a DataGrid.
82
- */
80
+ * VMZ UI — List (ordinary selectable list).
81
+ * Parent owns `selected` id; click + Arrow/Home/End. Not a DataGrid.
82
+ */
83
83
  export default class List {
84
- public label: string = 'List';
85
- public labelId: string = 'vmz-list-label';
86
- public selected: string = '';
87
- /** @type {{ id: string, title: string }[]} */
88
- public items: { id: string; title: string }[] = [];
89
- public onSelect: ((id: string) => void) | null = null;
90
-
91
- select(id) {
92
- if (typeof this.onSelect === 'function') this.onSelect(id);
93
- }
94
-
95
- onListClick(ev) {
96
- const t = ev && ev.target;
97
- const el = t && typeof t.closest === 'function' ? t.closest('[data-vmz-list-item]') : null;
98
- const id = el && typeof el.getAttribute === 'function' ? el.getAttribute('data-vmz-list-item') : null;
99
- if (id) this.select(id);
100
- }
101
-
102
- onListKeyDown(ev) {
103
- if (!ev || !this.items?.length) return;
104
- const ids = this.items.map((it) => it.id);
105
- const idx = Math.max(0, ids.indexOf(this.selected));
106
- let next = idx;
107
- if (ev.key === 'ArrowDown') next = (idx + 1) % ids.length;
108
- else if (ev.key === 'ArrowUp') next = (idx - 1 + ids.length) % ids.length;
109
- else if (ev.key === 'Home') next = 0;
110
- else if (ev.key === 'End') next = ids.length - 1;
111
- else return;
112
- ev.preventDefault();
113
- this.select(ids[next]);
114
- }
84
+ public label: string = "List";
85
+ public labelId: string = "vmz-list-label";
86
+ public selected: string = "";
87
+ /** @type {{ id: string, title: string }[]} */
88
+ public items: {
89
+ id: string;
90
+ title: string;
91
+ }[] = [];
92
+ public onSelect: ((id: string) => void) | null = null;
93
+ select(id) {
94
+ if (typeof this.onSelect === "function") this.onSelect(id);
95
+ }
96
+ onListClick(ev) {
97
+ const t = ev && ev.target;
98
+ const el = t && typeof t.closest === "function" ? t.closest("[data-vmz-list-item]") : null;
99
+ const id = el && typeof el.getAttribute === "function" ? el.getAttribute("data-vmz-list-item") : null;
100
+ if (id) this.select(id);
101
+ }
102
+ onListKeyDown(ev) {
103
+ if (!ev || !this.items?.length) return;
104
+ const ids = this.items.map((it) => it.id);
105
+ const idx = Math.max(0, ids.indexOf(this.selected));
106
+ let next = idx;
107
+ if (ev.key === "ArrowDown") next = (idx + 1) % ids.length;
108
+ else if (ev.key === "ArrowUp") next = (idx - 1 + ids.length) % ids.length;
109
+ else if (ev.key === "Home") next = 0;
110
+ else if (ev.key === "End") next = ids.length - 1;
111
+ else return;
112
+ ev.preventDefault();
113
+ this.select(ids[next]);
114
+ }
115
115
  }
116
116
  </script>