@ui0/icon 0.0.0-stage → 0.1.0

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 (49) hide show
  1. package/dist/defaults.d.ts +14 -0
  2. package/dist/defaults.d.ts.map +1 -0
  3. package/dist/framework.d.ts +30 -0
  4. package/dist/framework.d.ts.map +1 -0
  5. package/dist/getIcon.d.ts +3 -0
  6. package/dist/getIcon.d.ts.map +1 -0
  7. package/dist/helpers.d.ts +32 -0
  8. package/dist/helpers.d.ts.map +1 -0
  9. package/dist/icon.config.d.ts +22 -0
  10. package/dist/icon.config.d.ts.map +1 -0
  11. package/dist/icon.d.ts +26 -0
  12. package/dist/icon.d.ts.map +1 -0
  13. package/dist/icon.module.css +21 -0
  14. package/dist/icon.vue.d.ts +5 -0
  15. package/dist/icon.vue.d.ts.map +1 -0
  16. package/dist/index.d.ts +12 -0
  17. package/dist/index.d.ts.map +1 -0
  18. package/dist/index.js +496 -0
  19. package/dist/keys.d.ts +5 -0
  20. package/dist/keys.d.ts.map +1 -0
  21. package/dist/plugin.d.ts +23 -0
  22. package/dist/plugin.d.ts.map +1 -0
  23. package/dist/style.css +1 -0
  24. package/dist/types.d.ts +218 -0
  25. package/dist/types.d.ts.map +1 -0
  26. package/dist/ui0/index.d.ts +8 -0
  27. package/dist/ui0/index.d.ts.map +1 -0
  28. package/dist/ui0/index.js +19 -0
  29. package/dist/util.d.ts +33 -0
  30. package/dist/util.d.ts.map +1 -0
  31. package/dist/vite/blocks/index.d.ts +9 -0
  32. package/dist/vite/blocks/index.d.ts.map +1 -0
  33. package/dist/vite/compose.d.ts +68 -0
  34. package/dist/vite/compose.d.ts.map +1 -0
  35. package/dist/vite/index.d.ts +6 -0
  36. package/dist/vite/index.d.ts.map +1 -0
  37. package/dist/vite/index.js +829 -0
  38. package/dist/vite/options.d.ts +51 -0
  39. package/dist/vite/options.d.ts.map +1 -0
  40. package/dist/vite/transformer.d.ts +47 -0
  41. package/dist/vite/transformer.d.ts.map +1 -0
  42. package/dist/vite/types.d.ts +57 -0
  43. package/dist/vite/types.d.ts.map +1 -0
  44. package/dist/vite/util.d.ts +66 -0
  45. package/dist/vite/util.d.ts.map +1 -0
  46. package/dist/vite/xml-parser.d.ts +48 -0
  47. package/dist/vite/xml-parser.d.ts.map +1 -0
  48. package/package.json +64 -4
  49. package/README.md +0 -3
@@ -0,0 +1,218 @@
1
+ /**
2
+ * 🆑 icon Component
3
+ * icon.types.d.ts
4
+ */
5
+ import type { Indexed } from '@ui0/types';
6
+ import { type App, type Component, type ConcreteComponent } from 'vue';
7
+ /** color reference a paint prop accepts - pool names plus ramp steps */
8
+ export type ComponentSchemedColor = string;
9
+ /** stroke weight like font-weight */
10
+ export type ComponentWeight = number;
11
+ /** control size token */
12
+ export type ControlSize = string;
13
+ /** 'pack/icon.modifiers?params' query identifying an icon */
14
+ export type IconQuery = string;
15
+ /** component exposing an `icon` slot value */
16
+ export interface Iconable {
17
+ icon: IconQuery;
18
+ }
19
+ export interface IconProgressOptions {
20
+ direction?: 'radial-cw' | 'radial-ccw' | 'step';
21
+ }
22
+ export interface SizeProps {
23
+ size?: ControlSize;
24
+ width?: number | string;
25
+ height?: number | string;
26
+ }
27
+ export interface ColorProps {
28
+ color?: ComponentSchemedColor | ComponentSchemedColor[];
29
+ }
30
+ export type IconFit = 'default' | 'small' | 'large';
31
+ export type IconShape = 'ellipse-rect' | 'rect' | 'circle' | 'pentagon' | 'hexagon' | 'heptagon' | 'octagon' | 'shield';
32
+ export type IconDisplay = 'inline' | 'block';
33
+ export type IconRendering = 'original' | 'monochrome' | 'layers' | 'layers-shift' | 'multicolor';
34
+ export type IconWeight = ComponentWeight;
35
+ export type IconName = IconQuery;
36
+ export interface IconBodyOptions {
37
+ flags: IconBodyOptionsFlag[];
38
+ modifiers: Set<string>;
39
+ layers: Set<string>;
40
+ paintNodesCount: number;
41
+ }
42
+ export interface IconConfig extends Indexed {
43
+ icons: Indexed<IconIconConfig>;
44
+ useWeight?: boolean;
45
+ fillable?: boolean;
46
+ badge: IconBadgeOptions;
47
+ viewBox: string;
48
+ }
49
+ export interface IconIconConfig extends Indexed {
50
+ badge?: IconBadgeOptions;
51
+ progress?: IconProgressOptions;
52
+ }
53
+ export interface IconPack extends Record<string, Component> {
54
+ }
55
+ export interface IconPlugin {
56
+ components: IconPack;
57
+ names: string[];
58
+ name: string;
59
+ config: IconConfig;
60
+ }
61
+ export type IconBodyOptionsFlag = 'accent' | 'progress' | 'animation' | 'modifiers' | 'no-fit' | 'no-rescale' | 'no-fill' | 'no-cap' | 'no-join' | 'no-stroke' | 'always-stroke' | 'always-fill' | 'no-process-stroke' | 'composed' | string;
62
+ export interface IconCompositionProps {
63
+ }
64
+ export interface IconBadgeProps extends Omit<IconProps, 'badge' | 'size' | 'display' | 'width' | 'height' | 'density'> {
65
+ value?: string;
66
+ }
67
+ export interface IconCanvasProps extends IconProps {
68
+ masked?: boolean;
69
+ }
70
+ export interface BoxAttrs {
71
+ x?: string;
72
+ y?: string;
73
+ width?: string;
74
+ height?: string;
75
+ }
76
+ export type IconInternalComponent = ConcreteComponent & {
77
+ customOptions: IconBodyOptions;
78
+ };
79
+ export interface IconMinimalProps {
80
+ value?: string;
81
+ pack?: string;
82
+ color?: string;
83
+ shape?: IconShape;
84
+ modifiers?: string | string[];
85
+ fit?: 'default' | 'small' | 'large';
86
+ rendering?: 'original' | 'monochrome' | 'layers' | 'layers-shift' | 'multicolor';
87
+ }
88
+ export interface IconProps extends ColorProps, SizeProps {
89
+ /**
90
+ * Icon animations
91
+ */
92
+ /**
93
+ * badge
94
+ */
95
+ badge?: IconQuery | IconBadgeProps;
96
+ /**
97
+ * display mode
98
+ * @example 'inline' | 'block'
99
+ */
100
+ display?: IconDisplay;
101
+ /**
102
+ * Render with shape
103
+ */
104
+ shape?: IconShape;
105
+ /**
106
+ * Icon Modifiers
107
+ */
108
+ modifiers?: string[] | string;
109
+ /**
110
+ * Set progress
111
+ * @default 100
112
+ */
113
+ progress?: number | string;
114
+ /**
115
+ * Flip icon horizontally
116
+ */
117
+ flipped?: boolean;
118
+ /**
119
+ * Icon view box fit
120
+ * @default 'default'
121
+ */
122
+ fit?: IconFit;
123
+ /**
124
+ * IconOptions
125
+ */
126
+ options?: IconOptions;
127
+ /**
128
+ * Set a pack of icons
129
+ */
130
+ pack?: string;
131
+ /**
132
+ * Rotate icon degrees
133
+ */
134
+ rotate?: number | string;
135
+ /**
136
+ * Icon rendering method
137
+ */
138
+ rendering?: IconRendering;
139
+ size?: ControlSize;
140
+ /**
141
+ * Title for accessibility
142
+ */
143
+ title?: string;
144
+ /**
145
+ * Icon identifier
146
+ * @example 'cancel' | 'arrow-rotate' | 'pin?color=error'
147
+ */
148
+ value?: Iconable['icon'];
149
+ /**
150
+ * Controls icon thickness/saturation (similar to font-weight)
151
+ * @default 400
152
+ * @range 100-900
153
+ */
154
+ weight?: IconWeight;
155
+ /**
156
+ * Custom width
157
+ */
158
+ width?: number | string;
159
+ /**
160
+ * Custom height
161
+ */
162
+ height?: number | string;
163
+ }
164
+ export interface IconDefaults extends IconProps {
165
+ display: IconDisplay;
166
+ progress: number | undefined;
167
+ weight: number;
168
+ pack: string;
169
+ value: IconQuery;
170
+ rotate: number;
171
+ fit: IconFit;
172
+ modifiers: string[];
173
+ color: ComponentSchemedColor[];
174
+ }
175
+ type IconCellPos = '0' | '1' | '2' | '3';
176
+ export interface IconBadgeOptions {
177
+ cell?: `${IconCellPos} ${IconCellPos}`;
178
+ x?: number | 'start' | 'end' | 'center';
179
+ y?: number | 'start' | 'end' | 'center';
180
+ scale?: 'full' | 'large' | 'normal' | 'small' | number;
181
+ showMask?: boolean;
182
+ }
183
+ export interface IconOptions extends Indexed {
184
+ /**
185
+ * Icon badge options
186
+ */
187
+ badge?: IconBadgeOptions;
188
+ progress?: {
189
+ direction?: boolean;
190
+ };
191
+ guides?: boolean;
192
+ }
193
+ export type IconDataIcon = string;
194
+ export type IconDataProgress = 'step' | 'radial';
195
+ export interface IconImpl {
196
+ icons: readonly string[];
197
+ vueApp: App | undefined;
198
+ packs: Record<string, IconPack>;
199
+ addPack: (plugin: IconPlugin) => void;
200
+ add: (name: string, component: Component) => void;
201
+ setVue: (app: App) => void;
202
+ list: (pack?: string) => string[];
203
+ }
204
+ declare global {
205
+ interface Ui0ComponentsProps {
206
+ icon: IconProps;
207
+ }
208
+ interface Ui0ComponentsDefaults {
209
+ icon: IconDefaults;
210
+ }
211
+ interface Ui0Components {
212
+ icon: {
213
+ props: IconProps;
214
+ };
215
+ }
216
+ }
217
+ export {};
218
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AACzC,OAAO,EAAE,KAAK,GAAG,EAAE,KAAK,SAAS,EAAE,KAAK,iBAAiB,EAAE,MAAM,KAAK,CAAA;AAItE,wEAAwE;AACxE,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAA;AAC1C,qCAAqC;AACrC,MAAM,MAAM,eAAe,GAAG,MAAM,CAAA;AACpC,yBAAyB;AACzB,MAAM,MAAM,WAAW,GAAG,MAAM,CAAA;AAChC,6DAA6D;AAC7D,MAAM,MAAM,SAAS,GAAG,MAAM,CAAA;AAC9B,8CAA8C;AAC9C,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,SAAS,CAAA;CAChB;AACD,MAAM,WAAW,mBAAmB;IAClC,SAAS,CAAC,EAAE,WAAW,GAAG,YAAY,GAAG,MAAM,CAAA;CAChD;AACD,MAAM,WAAW,SAAS;IACxB,IAAI,CAAC,EAAE,WAAW,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACvB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;CACzB;AACD,MAAM,WAAW,UAAU;IACzB,KAAK,CAAC,EAA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BAAkB;QAC1B,IAAI,EAAE,SAAS,CAAA;KAChB;IACD,UAAU,qBAAqB;QAC7B,IAAI,EAAE,YAAY,CAAA;KACnB;IACD,UAAU,aAAa;QACrB,IAAI,EAAE;YACJ,KAAK,EAAE,SAAS,CAAA;SACjB,CAAA;KACF;CACF"}
@@ -0,0 +1,8 @@
1
+ import type { IconFramework } from '../framework';
2
+ /**
3
+ * @returns framework services backed by the active ui0 core/theme instances
4
+ * (both absent outside a ui0 host - the icon then falls back to its built-in
5
+ * defaults, same as standalone usage)
6
+ */
7
+ export declare function createUi0IconFramework(): IconFramework;
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ui0/index.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAEjD;;;;GAIG;AACH,wBAAgB,sBAAsB,IAAI,aAAa,CAatD"}
@@ -0,0 +1,19 @@
1
+ import { getComponentDefaults as r } from "@ui0/core";
2
+ import { useTheme as n, useThemeContext as i } from "@ui0/theme";
3
+ import { getCurrentInstance as u } from "vue";
4
+ function f() {
5
+ return {
6
+ useTheme: (e, t) => {
7
+ if (!n()) return;
8
+ const [, o] = i(e, t);
9
+ return o ?? void 0;
10
+ },
11
+ useDefaults: () => {
12
+ const e = u(), t = e == null ? void 0 : e.appContext.config.globalProperties.$ui0;
13
+ return r("icon", t) ?? {};
14
+ }
15
+ };
16
+ }
17
+ export {
18
+ f as createUi0IconFramework
19
+ };
package/dist/util.d.ts ADDED
@@ -0,0 +1,33 @@
1
+ import { type ConcreteComponent } from 'vue';
2
+ import type { IconProps } from './types';
3
+ interface ParsedIconQuery {
4
+ modifiers: string[];
5
+ params: Record<string, string>;
6
+ getComponentName: () => string;
7
+ getComponent: () => ConcreteComponent | null;
8
+ }
9
+ /**
10
+ * Parses icon query string into structured object
11
+ *
12
+ * @example
13
+ * 'ui0-pack/icon.mod1.mod2?param=value' => {
14
+ * pack: 'ui0-pack',
15
+ * name: 'icon',
16
+ * modifiers: ['mod1', 'mod2'],
17
+ * params: { param: 'value' }
18
+ * }
19
+ */
20
+ export declare function parseIconQuery(query: string, defaults: IconProps): ParsedIconQuery;
21
+ /**
22
+ * Parses icon query string with default props fallback. Defaults fill only
23
+ * the keys the query itself did not set - an explicit query always wins
24
+ * (a 'blocks/arrow' pack address must not be clobbered by the configured
25
+ * default pack, etc).
26
+ *
27
+ * @param query - Icon query string
28
+ * @param defaults - Default icon props
29
+ * @returns Parsed query with defaults
30
+ */
31
+ export declare function parseIconQueryLazy(query: string, defaults: IconProps): ParsedIconQuery;
32
+ export {};
33
+ //# sourceMappingURL=util.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,iBAAiB,EAAoB,MAAM,KAAK,CAAA;AAE9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAExC,UAAU,eAAe;IACvB,SAAS,EAAE,MAAM,EAAE,CAAA;IACnB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC9B,gBAAgB,EAAE,MAAM,MAAM,CAAA;IAC9B,YAAY,EAAE,MAAM,iBAAiB,GAAG,IAAI,CAAA;CAC7C;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,GAAG,eAAe,CAqClF;AAED;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,GAAG,eAAe,CAkBtF"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * The built-in `blocks` pack - raw template icons embedded in the bundle
3
+ * (imported as `?raw`, no file paths involved). The loader resolves
4
+ * 'blocks/<name>' against this registry out of the box; the consumer only
5
+ * references the icons from their own compositions and knows nothing about
6
+ * where they come from. Not part of the public API.
7
+ */
8
+ export declare const blocks: Record<string, string>;
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/vite/blocks/index.ts"],"names":[],"mappings":"AAQA;;;;;;GAMG;AACH,eAAO,MAAM,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAQzC,CAAA"}
@@ -0,0 +1,68 @@
1
+ import { type IconVirtualCell, type IconVirtualIcon } from './types';
2
+ /** the icon canvas is always a square; grids divide it into cell rects */
3
+ /**
4
+ * The icon canvas conventions, fixed by the authoring template
5
+ * (packages/icon/src/vite/template-grid.svg):
6
+ * - the stroke-safe area spans 90..810 (a 720 square) on the canvas -
7
+ * icon bodies live inside it, the margins take badge/overflow
8
+ * - grids divide the safe area into equal cells; every cell has a guttered
9
+ * inner form (CELL: inner = pitch * 8/9, centered) and a full-pitch form
10
+ * (CELL-FULL) for bleeding or filled parts
11
+ */
12
+ export declare const SAFE_AREA = 90;
13
+ export declare const SAFE_SIZE = 720;
14
+ /** inner-cell factor: a CELL occupies 8/9 of its pitch, centered */
15
+ export declare const CELL_INNER: number;
16
+ export interface CellRect {
17
+ x: number;
18
+ y: number;
19
+ width: number;
20
+ height: number;
21
+ }
22
+ /** the CELL-FULL rect of a 1-based 'row-col' cell inside a rows x cols grid */
23
+ export declare function cellRect(rows: number, cols: number, cell: IconVirtualCell): CellRect;
24
+ /** the guttered CELL rect: pitch * 8/9, centered inside the full cell */
25
+ export declare function innerRect(rect: CellRect): CellRect;
26
+ /** icon sources are authored on a 960 canvas (bodies inside the safe area) */
27
+ export declare const ICON_CANVAS = 960;
28
+ export interface ParsedVirtualValue {
29
+ /** icon name without pack prefix, cell address and query */
30
+ name: string;
31
+ cell?: IconVirtualCell;
32
+ query?: string;
33
+ /** state modifiers ('pie-90.fill.in:hover' -> ['fill', 'in-hover']) */
34
+ modifiers?: string[];
35
+ }
36
+ /** 'ui0/chart#1-2?weight=800' -> { name: 'ui0/chart', cell: '1-2', query: '?weight=800' } */
37
+ export declare function parseVirtualValue(raw: string): ParsedVirtualValue;
38
+ /**
39
+ * Extract the subtree marked `<g data-cell="row-col">` from a template sheet.
40
+ * Returns the part markup (data-cell attribute stripped) and the part's rect
41
+ * inside the sheet canvas, so the composer can map it into the target cell.
42
+ */
43
+ export declare function extractTemplatePart(svg: string, cell: IconVirtualCell, rows: number, cols: number): {
44
+ markup: string;
45
+ rect: CellRect;
46
+ } | undefined;
47
+ /**
48
+ * Transform string placing a rect-sized item (template part or scaled icon)
49
+ * into the target cell: contain-scaled, centered, rotated about the cell
50
+ * center. `rotate` 90/270 swap the item's axes before fitting, so a 1x3
51
+ * template fills a 3x1 cell exactly.
52
+ */
53
+ export declare function placementTransform(target: CellRect, item: CellRect, rotate?: number, fitScale?: number): string;
54
+ export interface ResolvedSource {
55
+ /** the registry definition when the source is a template or another composition */
56
+ def?: import('./types').IconVirtualTemplate | IconVirtualIcon | undefined;
57
+ /** raw svg content for file-backed sources (templates and pack icons) */
58
+ svg?: string;
59
+ /** resolution warning, surfaced once per source by the caller */
60
+ warning?: string;
61
+ }
62
+ export type VirtualSourceResolver = (name: string) => ResolvedSource | undefined;
63
+ /**
64
+ * Compose a virtual icon into a plain svg string (the regular transformer
65
+ * pipeline then turns it into an icon component). Recursion is cycle-guarded.
66
+ */
67
+ export declare function composeVirtual(name: string, def: IconVirtualIcon, resolve: VirtualSourceResolver, seen?: Set<string>): string;
68
+ //# sourceMappingURL=compose.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compose.d.ts","sourceRoot":"","sources":["../../src/vite/compose.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,eAAe,EAAE,KAAK,eAAe,EAA0B,MAAM,SAAS,CAAA;AAG/G,0EAA0E;AAC1E;;;;;;;;GAQG;AACH,eAAO,MAAM,SAAS,KAAK,CAAA;AAC3B,eAAO,MAAM,SAA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mB,GAAG,eAAe,GAAG,SAAS,CAAA;IACzE,yEAAyE;IACzE,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,iEAAiE;IACjE,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,MAAM,qBAAqB,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,cAAc,GAAG,SAAS,CAAA;AAEhF;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,eAAe,EACpB,OAAO,EAAE,qBAAqB,EAC9B,IAAI,GAAE,GAAG,CAAC,MAAM,CAAa,GAC5B,MAAM,CAuER"}
@@ -0,0 +1,6 @@
1
+ import { type Plugin } from 'vite';
2
+ import type { IconLoaderOptions } from './options';
3
+ export * from './types';
4
+ export type { IconLoaderFit, IconLoaderOptions } from './options';
5
+ export default function ViteUi0Icon(options?: IconLoaderOptions): Plugin;
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/vite/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAgB,KAAK,MAAM,EAAE,MAAM,MAAM,CAAA;AAKhD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;AAOlD,cAAc,SAAS,CAAA;AACvB,YAAY,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;AAKjE,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,OAAO,GAAE,iBAAsB,GAAG,MAAM,CA+K3E"}