@vmz/ui-icons 0.3.8 → 0.3.10

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.
@@ -0,0 +1,36 @@
1
+ /** Structured icon definitions for `@vmz/ui-icons` registry. */
2
+ export type IconStrokeDef = {
3
+ kind: 'stroke';
4
+ paths: readonly string[];
5
+ circles?: readonly Readonly<{
6
+ cx: number;
7
+ cy: number;
8
+ r: number;
9
+ }>[];
10
+ dots?: readonly Readonly<{
11
+ cx: number;
12
+ cy: number;
13
+ r: number;
14
+ }>[];
15
+ strokeWidth?: number;
16
+ };
17
+ export type IconFillDef = {
18
+ kind: 'fill';
19
+ d: string;
20
+ fillRule?: 'evenodd' | 'nonzero';
21
+ };
22
+ export type IconMixedNode = {
23
+ tag: 'path' | 'circle' | 'rect' | 'line';
24
+ attrs: Readonly<Record<string, string>>;
25
+ };
26
+ export type IconMixedDef = {
27
+ kind: 'mixed';
28
+ nodes: readonly IconMixedNode[];
29
+ };
30
+ /** Monospace text mark for proprietary converter names (2–4 chars). */
31
+ export type IconTextBadgeDef = {
32
+ kind: 'text-badge';
33
+ label: string;
34
+ };
35
+ export type IconDef = IconStrokeDef | IconFillDef | IconMixedDef | IconTextBadgeDef;
36
+ export declare const DEFAULT_STROKE_WIDTH = 1.75;
@@ -0,0 +1,2 @@
1
+ /** Structured icon definitions for `@vmz/ui-icons` registry. */
2
+ export const DEFAULT_STROKE_WIDTH = 1.75;
@@ -0,0 +1,3 @@
1
+ import type { IconDef } from './icon-types.ts';
2
+ /** Outlined icon set — 24 grid, 1.75 stroke, 3–21 safe area. */
3
+ export declare const STROKE_ICONS: Record<string, IconDef>;
@@ -0,0 +1,258 @@
1
+ /** Outlined icon set — 24 grid, 1.75 stroke, 3–21 safe area. */
2
+ export const STROKE_ICONS = {
3
+ 'action.search': {
4
+ kind: 'stroke',
5
+ circles: [{ cx: 10.5, cy: 10.5, r: 7.5 }],
6
+ paths: ['M15.8 15.8L20 20'],
7
+ },
8
+ 'action.close': {
9
+ kind: 'stroke',
10
+ paths: ['M7 7L17 17', 'M17 7L7 17'],
11
+ },
12
+ 'action.check': {
13
+ kind: 'stroke',
14
+ paths: ['M5 12L10 17L19 7'],
15
+ },
16
+ 'action.chevron-down': {
17
+ kind: 'stroke',
18
+ paths: ['M7 10L12 15L17 10'],
19
+ },
20
+ 'action.chevron-right': {
21
+ kind: 'stroke',
22
+ paths: ['M10 7L15 12L10 17'],
23
+ },
24
+ 'action.menu': {
25
+ kind: 'stroke',
26
+ paths: ['M4 7H20', 'M4 12H20', 'M4 17H20'],
27
+ },
28
+ 'action.plus': {
29
+ kind: 'stroke',
30
+ paths: ['M12 5V19', 'M5 12H19'],
31
+ },
32
+ 'action.copy': {
33
+ kind: 'stroke',
34
+ paths: ['M9 9H17V17H9Z', 'M6 6H14V14'],
35
+ },
36
+ 'action.chevron-up': {
37
+ kind: 'stroke',
38
+ paths: ['M7 14L12 9L17 14'],
39
+ },
40
+ 'action.chevron-left': {
41
+ kind: 'stroke',
42
+ paths: ['M14 7L9 12L14 17'],
43
+ },
44
+ 'action.minus': {
45
+ kind: 'stroke',
46
+ paths: ['M5 12H19'],
47
+ },
48
+ 'action.more': {
49
+ kind: 'stroke',
50
+ paths: ['M6 12H6.01', 'M12 12H12.01', 'M18 12H18.01'],
51
+ },
52
+ 'action.filter': {
53
+ kind: 'stroke',
54
+ paths: ['M4 6H20L14 13V19L10 17V13L4 6Z'],
55
+ },
56
+ 'action.calendar': {
57
+ kind: 'stroke',
58
+ paths: ['M4 8H20V20H4Z', 'M4 12H20', 'M8 4V8', 'M16 4V8'],
59
+ },
60
+ 'action.upload': {
61
+ kind: 'stroke',
62
+ paths: ['M12 16V4', 'M7 9L12 4L17 9', 'M4 16V20H20V16'],
63
+ },
64
+ 'action.download': {
65
+ kind: 'stroke',
66
+ paths: ['M12 4V16', 'M7 11L12 16L17 11', 'M4 20H20'],
67
+ },
68
+ 'action.sort': {
69
+ kind: 'stroke',
70
+ paths: ['M8 18V6', 'M5 9L8 6L11 9', 'M16 6V18', 'M13 15L16 18L19 15'],
71
+ },
72
+ 'action.sort-asc': {
73
+ kind: 'stroke',
74
+ paths: ['M8 18V6', 'M5 9L8 6L11 9', 'M15 18H21'],
75
+ },
76
+ 'action.sort-desc': {
77
+ kind: 'stroke',
78
+ paths: ['M8 6V18', 'M5 15L8 18L11 15', 'M15 6H21'],
79
+ },
80
+ 'action.external': {
81
+ kind: 'stroke',
82
+ paths: ['M14 4H20V10', 'M20 4L11 13', 'M18 14V20H4V6H10'],
83
+ },
84
+ 'action.arrow-right': {
85
+ kind: 'stroke',
86
+ paths: ['M4 12H20', 'M14 6L20 12L14 18'],
87
+ },
88
+ 'action.arrow-left': {
89
+ kind: 'stroke',
90
+ paths: ['M20 12H4', 'M10 6L4 12L10 18'],
91
+ },
92
+ 'action.trash': {
93
+ kind: 'stroke',
94
+ paths: ['M4 7H20', 'M9 7V4H15V7', 'M6 7L7 20H17L18 7', 'M10 11V16', 'M14 11V16'],
95
+ },
96
+ 'action.edit': {
97
+ kind: 'stroke',
98
+ paths: ['M4 20H8L19 9L15 5L4 16V20Z'],
99
+ },
100
+ 'action.refresh': {
101
+ kind: 'stroke',
102
+ paths: ['M20 12A8 8 0 1 1 17.5 6.5', 'M20 4V9H15'],
103
+ },
104
+ 'action.history': {
105
+ kind: 'stroke',
106
+ circles: [{ cx: 12, cy: 12, r: 8.5 }],
107
+ paths: ['M12 7V12L15.5 14'],
108
+ },
109
+ 'action.moon': {
110
+ kind: 'stroke',
111
+ paths: ['M20 14.5A8.5 8.5 0 0 1 9.5 4 8.5 8.5 0 1 0 20 14.5Z'],
112
+ },
113
+ 'action.sun': {
114
+ kind: 'stroke',
115
+ circles: [{ cx: 12, cy: 12, r: 4 }],
116
+ paths: ['M12 2V4', 'M12 20V22', 'M2 12H4', 'M20 12H22', 'M5 5L6.5 6.5', 'M17.5 17.5L19 19', 'M19 5L17.5 6.5', 'M6.5 17.5L5 19'],
117
+ },
118
+ 'action.monitor': {
119
+ kind: 'stroke',
120
+ paths: ['M4 5H20V17H4Z', 'M9 20H15', 'M12 17V20'],
121
+ },
122
+ 'action.search-document': {
123
+ kind: 'stroke',
124
+ paths: ['M5 4H15L19 8V20H5Z', 'M15 4V8H19'],
125
+ circles: [{ cx: 11, cy: 14, r: 2.5 }],
126
+ },
127
+ 'nav.home': {
128
+ kind: 'stroke',
129
+ paths: ['M4 10.5L12 4L20 10.5', 'M6 10V19H18V10', 'M10 19V13H14V19'],
130
+ },
131
+ 'nav.language': {
132
+ kind: 'stroke',
133
+ circles: [{ cx: 12, cy: 12, r: 9 }],
134
+ paths: ['M12 3V21', 'M3 12H21', 'M5.5 7.5C8 5.5 16 5.5 18.5 7.5', 'M5.5 16.5C8 18.5 16 18.5 18.5 16.5'],
135
+ },
136
+ 'status.info': {
137
+ kind: 'stroke',
138
+ circles: [{ cx: 12, cy: 12, r: 9 }],
139
+ paths: ['M12 11V16'],
140
+ dots: [{ cx: 12, cy: 8, r: 1 }],
141
+ },
142
+ 'status.warning': {
143
+ kind: 'stroke',
144
+ paths: ['M12 4L20 19H4L12 4Z', 'M12 10V14'],
145
+ dots: [{ cx: 12, cy: 17, r: 1 }],
146
+ },
147
+ 'status.success': {
148
+ kind: 'stroke',
149
+ circles: [{ cx: 12, cy: 12, r: 9 }],
150
+ paths: ['M8 12L11 15L16 9'],
151
+ },
152
+ 'status.danger': {
153
+ kind: 'stroke',
154
+ circles: [{ cx: 12, cy: 12, r: 9 }],
155
+ paths: ['M12 8V13'],
156
+ dots: [{ cx: 12, cy: 16.5, r: 1 }],
157
+ },
158
+ 'feature.incremental': {
159
+ kind: 'stroke',
160
+ circles: [
161
+ { cx: 5, cy: 12, r: 2 },
162
+ { cx: 19, cy: 12, r: 2 },
163
+ { cx: 12, cy: 6, r: 2 },
164
+ ],
165
+ paths: ['M7 12H10', 'M14 12H17', 'M12 8V10', 'M8.2 11.2L11 8.5', 'M12.8 8.5L15.6 11.2'],
166
+ },
167
+ 'feature.runtime': {
168
+ kind: 'stroke',
169
+ paths: ['M8.5 7.5H15.5V16.5H8.5Z', 'M11 10L14.5 12L11 14Z'],
170
+ },
171
+ 'feature.deploy': {
172
+ kind: 'stroke',
173
+ paths: ['M4 16H20', 'M12 6V14', 'M8.5 10.5L12 6L15.5 10.5'],
174
+ },
175
+ 'tool.url': {
176
+ kind: 'stroke',
177
+ paths: ['M10.5 8.5a3 3 0 0 1 4.2 0l.8.8a3 3 0 0 1 0 4.2l-.8.8', 'M13.5 15.5a3 3 0 0 1-4.2 0l-.8-.8a3 3 0 0 1 0-4.2l.8-.8'],
178
+ },
179
+ 'tool.temperature': {
180
+ kind: 'stroke',
181
+ circles: [{ cx: 12, cy: 18, r: 3 }],
182
+ paths: ['M12 4V15', 'M10 9H14'],
183
+ },
184
+ 'tool.length': {
185
+ kind: 'stroke',
186
+ paths: ['M4 12H20', 'M6 9V15', 'M10 10V14', 'M14 10V14', 'M18 9V15', 'M4 12L7 9', 'M4 12L7 15', 'M20 12L17 9', 'M20 12L17 15'],
187
+ },
188
+ 'tool.weight': {
189
+ kind: 'stroke',
190
+ paths: ['M6 8H18', 'M12 8V16', 'M8 16H16', 'M9 6H15'],
191
+ },
192
+ 'tool.time-units': {
193
+ kind: 'stroke',
194
+ circles: [{ cx: 12, cy: 12, r: 9 }],
195
+ paths: ['M12 7V12L15.5 14'],
196
+ },
197
+ 'tool.color': {
198
+ kind: 'stroke',
199
+ paths: ['M12 4C8.5 4 6 6.5 6 10s2.5 6 6 6', 'M12 4c3.5 0 6 2.5 6 6s-2.5 6-6 6'],
200
+ dots: [
201
+ { cx: 8, cy: 10, r: 1.2 },
202
+ { cx: 12, cy: 8, r: 1.2 },
203
+ { cx: 16, cy: 10, r: 1.2 },
204
+ ],
205
+ },
206
+ 'tool.percentage': {
207
+ kind: 'stroke',
208
+ circles: [
209
+ { cx: 9.5, cy: 9.5, r: 2 },
210
+ { cx: 14.5, cy: 14.5, r: 2 },
211
+ ],
212
+ paths: ['M16 8L8 16'],
213
+ },
214
+ 'tool.area': {
215
+ kind: 'stroke',
216
+ paths: ['M5 5H19V19H5Z', 'M8 8H16V16H8Z'],
217
+ },
218
+ 'tool.volume': {
219
+ kind: 'stroke',
220
+ paths: ['M5 9H19V19H5Z', 'M8 6H16', 'M8 6V9', 'M16 6V9'],
221
+ },
222
+ 'tool.data-size': {
223
+ kind: 'stroke',
224
+ paths: ['M5 7H19', 'M5 11H15', 'M5 15H19'],
225
+ },
226
+ 'tool.ratio': {
227
+ kind: 'stroke',
228
+ paths: ['M5 7H19', 'M5 17H19', 'M8 10V14', 'M16 10V14'],
229
+ },
230
+ 'tool.average': {
231
+ kind: 'stroke',
232
+ paths: ['M4 18H20', 'M6 15L10 9L14 13L18 7'],
233
+ },
234
+ 'tool.tip': {
235
+ kind: 'stroke',
236
+ paths: ['M12 4C9.5 4 8 6 8 8.5c0 1.8 1 3.2 2.5 4V15h3v-2.5c1.5-.8 2.5-2.2 2.5-4C16 6 14.5 4 12 4Z', 'M9.5 18H14.5', 'M10 20H14'],
237
+ },
238
+ 'tool.aspect-ratio': {
239
+ kind: 'stroke',
240
+ paths: ['M5 7H19V17H5Z', 'M8 9H16V15H8Z'],
241
+ },
242
+ 'tool.bandwidth': {
243
+ kind: 'stroke',
244
+ paths: ['M4 12H6', 'M8 8V16', 'M11 10V14', 'M14 6V18', 'M17 9V15', 'M20 12H22'],
245
+ },
246
+ 'tool.percent-change': {
247
+ kind: 'stroke',
248
+ paths: ['M5 17L12 9L15 13L19 6', 'M4 19H20'],
249
+ },
250
+ 'tool.ohm': {
251
+ kind: 'stroke',
252
+ paths: ['M8 11c0-2.2 1.8-4 4-4s4 1.8 4 4', 'M8 11V16', 'M16 11V16', 'M8 16H16'],
253
+ },
254
+ 'tool.speed': {
255
+ kind: 'stroke',
256
+ paths: ['M5.5 14A7 7 0 0 1 18.5 14', 'M12 12L15.5 8.5'],
257
+ },
258
+ };
@@ -0,0 +1,3 @@
1
+ import type { IconDef } from './icon-types.ts';
2
+ /** Proprietary tool names — text badges instead of unreadable SVG silhouettes. */
3
+ export declare const TEXT_BADGE_ICONS: Record<string, IconDef>;
@@ -0,0 +1,15 @@
1
+ /** Proprietary tool names — text badges instead of unreadable SVG silhouettes. */
2
+ export const TEXT_BADGE_ICONS = {
3
+ 'tool.base64': { kind: 'text-badge', label: 'B64' },
4
+ 'tool.base36': { kind: 'text-badge', label: 'B36' },
5
+ 'tool.hex': { kind: 'text-badge', label: 'HEX' },
6
+ 'tool.radix': { kind: 'text-badge', label: 'RAD' },
7
+ 'tool.html-entities': { kind: 'text-badge', label: 'ENT' },
8
+ 'tool.ascii': { kind: 'text-badge', label: 'ASC' },
9
+ 'tool.binary-text': { kind: 'text-badge', label: '01' },
10
+ 'tool.rgb-hsl': { kind: 'text-badge', label: 'HSL' },
11
+ 'tool.px-rem': { kind: 'text-badge', label: 'px' },
12
+ 'tool.gpa': { kind: 'text-badge', label: 'GPA' },
13
+ 'tool.nearest-tenth': { kind: 'text-badge', label: '.1' },
14
+ 'tool.grade-curve': { kind: 'text-badge', label: 'CV' },
15
+ };
@@ -0,0 +1,10 @@
1
+ /** Shared icon registry for `@vmz/ui-icons` and optional app-level Icon shims. */
2
+ import type { IconDef } from './icon-types.ts';
3
+ export type { IconDef, IconFillDef, IconMixedDef, IconMixedNode, IconStrokeDef, IconTextBadgeDef } from './icon-types.ts';
4
+ export { DEFAULT_STROKE_WIDTH } from './icon-types.ts';
5
+ export declare const REGISTRY: Record<string, IconDef>;
6
+ export declare const LEGACY_ICON_ALIASES: Record<string, string>;
7
+ export declare function resolveIconName(name: string): string;
8
+ export declare function resolveIconDef(name: string): IconDef | null;
9
+ /** @deprecated Prefer `resolveIconDef`. Returns primary path data for fill icons or first stroke path. */
10
+ export declare function resolveIconPath(name: string): string;
@@ -0,0 +1,75 @@
1
+ import { STROKE_ICONS } from "./icons-stroke.js";
2
+ import { TEXT_BADGE_ICONS } from "./icons-text-badge.js";
3
+ export { DEFAULT_STROKE_WIDTH } from "./icon-types.js";
4
+ export const REGISTRY = {
5
+ ...STROKE_ICONS,
6
+ ...TEXT_BADGE_ICONS,
7
+ };
8
+ export const LEGACY_ICON_ALIASES = {
9
+ check: 'action.check',
10
+ close: 'action.close',
11
+ search: 'action.search',
12
+ 'chevron-down': 'action.chevron-down',
13
+ 'chevron-right': 'action.chevron-right',
14
+ 'chevron-up': 'action.chevron-up',
15
+ 'chevron-left': 'action.chevron-left',
16
+ minus: 'action.minus',
17
+ more: 'action.more',
18
+ filter: 'action.filter',
19
+ calendar: 'action.calendar',
20
+ upload: 'action.upload',
21
+ download: 'action.download',
22
+ sort: 'action.sort',
23
+ external: 'action.external',
24
+ 'arrow-right': 'action.arrow-right',
25
+ 'arrow-left': 'action.arrow-left',
26
+ trash: 'action.trash',
27
+ edit: 'action.edit',
28
+ refresh: 'action.refresh',
29
+ history: 'action.history',
30
+ moon: 'action.moon',
31
+ sun: 'action.sun',
32
+ monitor: 'action.monitor',
33
+ info: 'status.info',
34
+ warning: 'status.warning',
35
+ success: 'status.success',
36
+ danger: 'status.danger',
37
+ menu: 'action.menu',
38
+ plus: 'action.plus',
39
+ home: 'nav.home',
40
+ language: 'nav.language',
41
+ copy: 'action.copy',
42
+ discount: 'tool.percentage',
43
+ };
44
+ export function resolveIconName(name) {
45
+ const key = String(name || '').trim();
46
+ if (!key)
47
+ return '';
48
+ if (LEGACY_ICON_ALIASES[key])
49
+ return LEGACY_ICON_ALIASES[key];
50
+ return key;
51
+ }
52
+ export function resolveIconDef(name) {
53
+ const key = resolveIconName(name);
54
+ if (!key)
55
+ return null;
56
+ const def = REGISTRY[key];
57
+ if (!def) {
58
+ throw new Error(`@vmz/ui-icons: unknown icon name "${name}" (resolved: "${key}")`);
59
+ }
60
+ return def;
61
+ }
62
+ /** @deprecated Prefer `resolveIconDef`. Returns primary path data for fill icons or first stroke path. */
63
+ export function resolveIconPath(name) {
64
+ const def = resolveIconDef(name);
65
+ if (!def)
66
+ return '';
67
+ if (def.kind === 'fill')
68
+ return def.d;
69
+ if (def.kind === 'text-badge')
70
+ return '';
71
+ if (def.kind === 'stroke')
72
+ return def.paths[0] ?? '';
73
+ const pathNode = def.nodes.find((node) => node.tag === 'path');
74
+ return pathNode?.attrs.d ?? '';
75
+ }
package/package.json CHANGED
@@ -1,12 +1,19 @@
1
1
  {
2
2
  "description": "VMZ UI Icons — semantic icon names + glyph registry. Reuses @vmz/ui tokens; not a second Button/Tooltip shell or loose SVG dump.",
3
+ "devDependencies": {
4
+ "typescript": "^5.8.3"
5
+ },
3
6
  "exports": {
4
7
  "./Icon": "./src/Icon.vmz",
5
8
  "./contracts/token-requirements": "./contracts/token-requirements.v0.json",
6
- "./registry": "./src/registry.ts"
9
+ "./registry": {
10
+ "default": "./dist/registry.js",
11
+ "types": "./dist/registry.d.ts"
12
+ }
7
13
  },
8
14
  "files": [
9
15
  "src",
16
+ "dist",
10
17
  "contracts",
11
18
  "README.md"
12
19
  ],
@@ -18,7 +25,7 @@
18
25
  "license": "MIT",
19
26
  "name": "@vmz/ui-icons",
20
27
  "peerDependencies": {
21
- "@vmz/ui": "0.3.8"
28
+ "@vmz/ui": "0.3.10"
22
29
  },
23
30
  "publishConfig": {
24
31
  "access": "public"
@@ -28,6 +35,9 @@
28
35
  "type": "git",
29
36
  "url": "git+https://github.com/doki-land/vmz-framework.git"
30
37
  },
38
+ "scripts": {
39
+ "build": "tsc -p tsconfig.json"
40
+ },
31
41
  "type": "module",
32
- "version": "0.3.8"
42
+ "version": "0.3.10"
33
43
  }