@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,14 @@
1
+ import type { IconDefaults, IconProps } from './types';
2
+ /**
3
+ * Defaults cascade: explicit prop > framework-provided defaults (the ui0
4
+ * config `components.icon` slice via the bridge) > the package's own
5
+ * icon.config. Resolved per key on read, so prop reactivity is preserved.
6
+ * The proxy is enumerable (ownKeys/getOwnPropertyDescriptor) because consumers
7
+ * iterate it with Object.entries - a get-only proxy would silently yield {}.
8
+ *
9
+ * @param props - the component's resolved props
10
+ * @param configured - framework-provided defaults, if any
11
+ * @returns a Defaults-shaped live view over the cascade
12
+ */
13
+ export declare function resolveIconDefaults(props: IconProps, configured: Partial<IconDefaults> | undefined): IconProps;
14
+ //# sourceMappingURL=defaults.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../src/defaults.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAEtD;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,CAAC,YAAY,CAAC,GAAG,SAAS,GAAG,SAAS,CAsB9G"}
@@ -0,0 +1,30 @@
1
+ import type { CSSModuleClassList } from '@ui0/types';
2
+ import { type InjectionKey } from 'vue';
3
+ import type { IconDefaults, IconProps } from './types';
4
+ /**
5
+ * Theme contract surface the icon consumes - the same classes/styles applier
6
+ * ui0's `useThemeContext` returns, re-declared here so the base package never
7
+ * imports @ui0/theme at runtime.
8
+ */
9
+ export interface IconThemeContract {
10
+ classes: (props?: object, $styles?: CSSModuleClassList) => string[];
11
+ styles: (props?: object) => Record<string, string>;
12
+ }
13
+ /**
14
+ * Framework services the icon optionally consumes. The base package is
15
+ * universal: without a registered framework it renders unthemed with its
16
+ * built-in defaults. The `@ui0/icon/ui0` bridge fills these from @ui0/core
17
+ * (the ui0.config components.icon slice) and @ui0/theme (contracts); any
18
+ * other framework can provide its own implementation.
19
+ */
20
+ export interface IconFramework {
21
+ /** resolves the active theme contract for the current instance; undefined = unthemed */
22
+ useTheme?: (props: IconProps, $styles: CSSModuleClassList) => IconThemeContract | undefined;
23
+ /** configured defaults overriding the package's own icon.config values */
24
+ useDefaults?: () => Partial<IconDefaults>;
25
+ }
26
+ /** injection key owned by the icon - the ui0 bridge (or host framework) provides it */
27
+ export declare const IconFrameworkKey: InjectionKey<IconFramework>;
28
+ /** the injected framework services, or an empty one for standalone usage */
29
+ export declare function useIconFramework(): IconFramework;
30
+ //# sourceMappingURL=framework.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"framework.d.ts","sourceRoot":"","sources":["../src/framework.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AACpD,OAAO,EAAU,KAAK,YAAY,EAAE,MAAM,KAAK,CAAA;AAE/C,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAEtD;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,kBAAkB,KAAK,MAAM,EAAE,CAAA;IACnE,MAAM,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CACnD;AAED;;;;;;GAMG;AACH,MAAM,WAAW,aAAa;IAC5B,wFAAwF;IACxF,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,kBAAkB,KAAK,iBAAiB,GAAG,SAAS,CAAA;IAC3F,0EAA0E;IAC1E,WAAW,CAAC,EAAE,MAAM,OAAO,CAAC,YAAY,CAAC,CAAA;CAC1C;AAED,uFAAuF;AACvF,eAAO,MAAM,gBAAgB,EAAE,YAAY,CAAC,aAAa,CAAgC,CAAA;AAEzF,4EAA4E;AAC5E,wBAAgB,gBAAgB,IAAI,aAAa,CAEhD"}
@@ -0,0 +1,3 @@
1
+ import type { IconImpl } from './types';
2
+ export declare function getIcon(): IconImpl;
3
+ //# sourceMappingURL=getIcon.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getIcon.d.ts","sourceRoot":"","sources":["../src/getIcon.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAEvC,wBAAgB,OAAO,IAAI,QAAQ,CASlC"}
@@ -0,0 +1,32 @@
1
+ import { type ConcreteComponent, type VNode } from 'vue';
2
+ import type { IconBodyOptions, IconShape } from './types';
3
+ export declare const shapes: Record<Exclude<IconShape, 'rect' | 'circle'>, string>;
4
+ /**
5
+ * Shape type guard
6
+ * @param key
7
+ */
8
+ export declare function isShape(key: string): key is keyof typeof shapes;
9
+ /**
10
+ * IconInternalComponent type guard
11
+ * @param component
12
+ */
13
+ export declare function isInternalIcon(component: ConcreteComponent | null): component is ConcreteComponent & {
14
+ customOptions: IconBodyOptions;
15
+ };
16
+ /**
17
+ * shorthand group wrapper
18
+ * @param attrs
19
+ * @return render function
20
+ */
21
+ export declare function wrapToGroup(attrs: any): (children?: any) => VNode;
22
+ /**
23
+ * Renders every item as child of previous item
24
+ */
25
+ export declare class RenderPipeline {
26
+ stack: ((c?: any) => VNode)[];
27
+ add(item: (c?: any) => VNode): void;
28
+ render(): VNode<import("vue").RendererNode, import("vue").RendererElement, {
29
+ [key: string]: any;
30
+ }>;
31
+ }
32
+ //# sourceMappingURL=helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,iBAAiB,EAAK,KAAK,KAAK,EAAE,MAAM,KAAK,CAAA;AAE3D,OAAO,KAAK,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAEzD,eAAO,MAAM,MAAM,EAAE,MAAM,CAAC,OAAO,CAAC,SAAS,EAAE,MAAM,GAAG,QAAQ,CAAC,EAAE,MAAM,CAaxE,CAAA;AAED;;;GAGG;AACH,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,IAAI,MAAM,OAAO,MAAM,CAE/D;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,iBAAiB,GAAG,IAAI,GAAG,SAAS,IAAI,iBAAiB,GAAG;IACpG,aAAa,EAAE,eAAe,CAAA;CAC/B,CAEA;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,GAAG,GAAG,CAAC,QAAQ,CAAC,EAAE,GAAG,KAAK,KAAK,CAEjE;AAED;;GAEG;AACH,qBAAa,cAAc;IACzB,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,KAAK,KAAK,CAAC,EAAE,CAAK;IAElC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,KAAK,KAAK;IAI5B,MAAM;;;CAKP"}
@@ -0,0 +1,22 @@
1
+ declare const config: {
2
+ value: string;
3
+ rotate: number;
4
+ weight: number;
5
+ progress: number;
6
+ display: "block";
7
+ rendering: "monochrome";
8
+ pack: string;
9
+ modifiers: never[];
10
+ fit: "default";
11
+ options: {
12
+ badge: {
13
+ x: "start";
14
+ y: "start";
15
+ scale: number;
16
+ showMask: true;
17
+ };
18
+ guides: false;
19
+ };
20
+ };
21
+ export default config;
22
+ //# sourceMappingURL=icon.config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"icon.config.d.ts","sourceRoot":"","sources":["../src/icon.config.ts"],"names":[],"mappings":"AAOA,QAAA,MAAM,MAAM;;;;;;;;;;;;;;;;;;;CAmBqB,CAAA;AAEjC,eAAe,MAAM,CAAA"}
package/dist/icon.d.ts ADDED
@@ -0,0 +1,26 @@
1
+ import type { App, Component } from 'vue';
2
+ import type { IconName, IconImpl, IconPack, IconPlugin } from './types';
3
+ export declare class Icon implements IconImpl {
4
+ icons: IconName[];
5
+ vueApp: App | undefined;
6
+ packs: Record<string, IconPack>;
7
+ deferred: [IconName, Component][];
8
+ /**
9
+ * add icon pack plugin
10
+ * @param plugin
11
+ */
12
+ addPack(plugin: IconPlugin): void;
13
+ /**
14
+ * returns installed icons list
15
+ * @param pack
16
+ */
17
+ list(pack?: string): string[];
18
+ /**
19
+ * add icon component
20
+ * @param name
21
+ * @param component
22
+ */
23
+ add(name: IconName, component: Component): void;
24
+ setVue(app: App): void;
25
+ }
26
+ //# sourceMappingURL=icon.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../src/icon.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,KAAK,CAAA;AAEzC,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAQvE,qBAAa,IAAK,YAAW,QAAQ;IACnC,KAAK,EAAE,QAAQ,EAAE,CAAK;IACtB,MAAM,EAAE,GAAG,GAAG,SAAS,CAAA;IACvB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAK;IACpC,QAAQ,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC,EAAE,CAAK;IAEtC;;;OAGG;IACH,OAAO,CAAC,MAAM,EAAE,UAAU;IAM1B;;;OAGG;IACH,IAAI,CAAC,IAAI,CAAC,EAAE,MAAM;IAIlB;;;;OAIG;IACH,GAAG,CAAC,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS;IAUjC,MAAM,CAAC,GAAG,EAAE,GAAG;CAavB"}
@@ -0,0 +1,21 @@
1
+ @value icon: ic_c2d4;
2
+ @value canvas: ca_a457;
3
+ @value sizeCustom: si_e681;
4
+ @value strokeMask: st_39f2;
5
+ @value shapeStrokeMask: sh_6010;
6
+ @value shape: sh_f589;
7
+ @value layerStyle: la_1353;
8
+ @value weighty: we_0775;
9
+ @value fillable: fi_ff74;
10
+ @value filled: fi_8a2f;
11
+ @value layers: la_e3b8;
12
+ @value masked: ma_30e1;
13
+ @value layersShift: la_9af0;
14
+ @value doubleColored: do_9bcc;
15
+ @value multicolor: mu_2455;
16
+ @value shaped: sh_0266;
17
+ @value tripleColored: tr_07fb;
18
+ @value join: jo_5839;
19
+ @value cap: ca_45e8;
20
+ @value flip: fl_4e44;
21
+ @value rotate: ro_299b;
@@ -0,0 +1,5 @@
1
+ import type { IconProps } from './types';
2
+ declare const __VLS_export: import("vue").DefineComponent<IconProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<IconProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
3
+ declare const _default: typeof __VLS_export;
4
+ export default _default;
5
+ //# sourceMappingURL=icon.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"icon.vue.d.ts","sourceRoot":"","sources":["../src/icon.vue"],"names":[],"mappings":"AA+sBE,OAAO,KAAK,EAA8B,SAAS,EAAE,MAAM,SAAS,CAAA;AAskBtE,QAAA,MAAM,YAAY,8RAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -0,0 +1,12 @@
1
+ import { getIcon } from './getIcon';
2
+ import Icon from './icon.vue';
3
+ import { createIcon } from './plugin';
4
+ export { Icon, createIcon, getIcon };
5
+ export { resolveIconDefaults } from './defaults';
6
+ export { IconFrameworkKey, useIconFramework } from './framework';
7
+ export type { IconFramework, IconThemeContract } from './framework';
8
+ export type { CreateIconOptions } from './plugin';
9
+ export * from './types';
10
+ import $style from './icon.module.css';
11
+ export { $style };
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,IAAI,MAAM,YAAY,CAAA;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAErC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,CAAA;AACpC,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AAChD,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAChE,YAAY,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AACnE,YAAY,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AACjD,cAAc,SAAS,CAAA;AACvB,OAAO,MAAM,MAAM,mBAAmB,CAAA;AACtC,OAAO,EAAE,MAAM,EAAE,CAAA"}