@sparqjs/schema-icons-lucide 0.2.1

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,13 @@
1
+ import { House, Info, KeyRound, MoreHorizontal, Pause, Plus, Trash2 } from '@lucide/vue';
2
+ import { type SparqIconRegistry } from '@sparqjs/schema-vue';
3
+ import type { Component } from 'vue';
4
+ export interface CreateLucideIconRegistryOptions {
5
+ /** 默认包含完整 Lucide 目录,关闭后只注册 Sparq 语义 key。 */
6
+ includeCatalog?: boolean;
7
+ }
8
+ export declare function createLucideIconRegistry(options?: CreateLucideIconRegistryOptions): SparqIconRegistry;
9
+ export declare function getLucideIconComponent(name: string): Component | undefined;
10
+ /** Small named surface used by adapters and tests without exposing Element Plus icon components. */
11
+ export { House, Info, KeyRound, MoreHorizontal, Pause, Plus, Trash2 };
12
+ export declare const LUCIDE_ICON_NAMES: string[];
13
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EA+BH,KAAK,EAEL,IAAI,EACJ,QAAQ,EAYR,cAAc,EAKd,KAAK,EAKL,IAAI,EAcJ,MAAM,EAWT,MAAM,aAAa,CAAA;AAEpB,OAAO,EAAqD,KAAK,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAC/G,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,KAAK,CAAA;AAEpC,MAAM,WAAW,+BAA+B;IAC5C,4CAA4C;IAC5C,cAAc,CAAC,EAAE,OAAO,CAAA;CAC3B;AAgHD,wBAAgB,wBAAwB,CAAC,OAAO,GAAE,+BAAoC,GAAG,iBAAiB,CAoBzG;AAED,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAE1E;AAED,oGAAoG;AACpG,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,cAAc,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,CAAA;AAgBrE,eAAO,MAAM,iBAAiB,UAA4C,CAAA"}
package/dist/index.js ADDED
@@ -0,0 +1,141 @@
1
+ import { Activity as e, Archive as t, ArchiveRestore as ee, ArrowDown as te, ArrowLeft as n, ArrowRight as ne, ArrowUp as r, BarChart3 as i, BookOpen as a, Building2 as re, Calendar as o, Check as s, CircleCheck as c, CircleHelp as ie, CircleX as l, Clock as u, Code2 as d, Copy as f, Database as p, Download as m, ExternalLink as h, Eye as g, EyeOff as ae, FileArchive as oe, FileJson as se, FileText as _, Folder as ce, Grid2X2 as le, Hash as ue, HeartPulse as de, House as v, Image as y, Info as b, KeyRound as x, LayoutDashboard as fe, LayoutPanelTop as pe, List as S, ListCollapse as C, ListFilter as w, ListOrdered as T, Lock as E, LogIn as D, LogOut as O, Menu as k, Monitor as A, MoreHorizontal as j, Network as M, Palette as N, PanelTop as P, PanelsTopLeft as F, Pause as I, Pencil as L, PencilRuler as R, Play as z, Plug as B, Plus as V, Printer as me, RefreshCcw as he, RotateCcw as ge, Save as _e, Search as ve, SeparatorHorizontal as ye, Settings as be, Shield as xe, ShieldCheck as Se, SlidersHorizontal as H, Square as U, Table2 as Ce, Tags as W, Trash2 as G, TriangleAlert as we, Undo2 as K, Unlock as Te, Upload as q, User as Ee, Users as De, WandSparkles as Oe, X as ke, icons as J } from "@lucide/vue";
2
+ import { resolveSparqIconName as Ae } from "@sparqjs/schema-core";
3
+ import { createSparqIconRegistry as je } from "@sparqjs/schema-vue";
4
+ //#region src/index.ts
5
+ var Y = {
6
+ add: V,
7
+ edit: L,
8
+ delete: G,
9
+ copy: f,
10
+ save: _e,
11
+ search: ve,
12
+ reset: ge,
13
+ refresh: he,
14
+ upload: q,
15
+ download: m,
16
+ view: g,
17
+ hide: ae,
18
+ setting: be,
19
+ more: j,
20
+ close: ke,
21
+ check: s,
22
+ warning: we,
23
+ info: b,
24
+ error: l,
25
+ success: c,
26
+ user: Ee,
27
+ home: v,
28
+ calendar: o,
29
+ time: u,
30
+ filter: w,
31
+ sort: w,
32
+ left: n,
33
+ right: ne,
34
+ up: r,
35
+ down: te,
36
+ back: n,
37
+ restore: ee,
38
+ print: me,
39
+ key: x,
40
+ lock: E,
41
+ unlock: Te,
42
+ "log-out": O,
43
+ shield: xe,
44
+ users: De,
45
+ pause: I,
46
+ play: z,
47
+ dashboard: fe,
48
+ appearance: N,
49
+ organization: re,
50
+ plugin: B,
51
+ schema: p,
52
+ website: A,
53
+ assets: y,
54
+ health: de,
55
+ menu: k,
56
+ design: R,
57
+ activity: e,
58
+ login: D,
59
+ list: S,
60
+ document: _,
61
+ folder: ce,
62
+ grid: le,
63
+ archive: t,
64
+ trash: G,
65
+ "top-right": h,
66
+ promotion: Oe,
67
+ connection: M,
68
+ rank: i,
69
+ "shield-check": Se,
70
+ "circle-help": ie,
71
+ table: Ce,
72
+ section: F,
73
+ card: P,
74
+ divider: ye,
75
+ tabs: pe,
76
+ collapse: C,
77
+ number: ue,
78
+ undo: K,
79
+ redo: K,
80
+ phone: U,
81
+ pad: U,
82
+ pc: A,
83
+ import: m,
84
+ export: q,
85
+ json: se,
86
+ preview: g,
87
+ text: _,
88
+ password: E,
89
+ select: S,
90
+ "multi-select": T,
91
+ "select-tree": M,
92
+ cascader: M,
93
+ radio: c,
94
+ checkbox: s,
95
+ switch: H,
96
+ slider: H,
97
+ rate: W,
98
+ color: N,
99
+ date: o,
100
+ "date-range": o,
101
+ datetime: u,
102
+ "time-range": u,
103
+ textarea: _,
104
+ "rich-text": a,
105
+ "json-editor": d,
106
+ "key-value": W,
107
+ "icon-input": y,
108
+ "relation-picker": M,
109
+ "image-upload": y,
110
+ "file-upload": oe
111
+ }, Me = X({ includeCatalog: !1 });
112
+ function X(e = {}) {
113
+ let t = e.includeCatalog === !1 ? Y : {
114
+ ...Object.fromEntries(Object.entries(J).map(([e, t]) => [Q(e), t])),
115
+ ...Y
116
+ };
117
+ return je(Object.entries(t).map(([e, t]) => [e, {
118
+ component: t,
119
+ label: $(e),
120
+ namespace: "lucide",
121
+ keywords: [
122
+ e,
123
+ Ae(e),
124
+ $(e)
125
+ ]
126
+ }]));
127
+ }
128
+ function Z(e) {
129
+ return Me.get(e)?.component;
130
+ }
131
+ function Q(e) {
132
+ return e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").replace(/([A-Z])([A-Z][a-z])/g, "$1-$2").toLowerCase();
133
+ }
134
+ function $(e) {
135
+ return e.split("-").map((e) => e.slice(0, 1).toUpperCase() + e.slice(1)).join(" ");
136
+ }
137
+ var Ne = Object.keys(J).map(Q);
138
+ //#endregion
139
+ export { v as House, b as Info, x as KeyRound, Ne as LUCIDE_ICON_NAMES, j as MoreHorizontal, I as Pause, V as Plus, G as Trash2, X as createLucideIconRegistry, Z as getLucideIconComponent };
140
+
141
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["import {\n Activity,\n Archive,\n ArrowDown,\n ArrowLeft,\n ArrowRight,\n ArrowUp,\n ArchiveRestore,\n BarChart3,\n BookOpen,\n Building2,\n Calendar,\n Check,\n CircleCheck,\n CircleHelp,\n CircleX,\n Clock,\n Code2,\n Copy,\n Database,\n Download,\n Eye,\n EyeOff,\n ExternalLink,\n FileArchive,\n FileJson,\n FileText,\n Folder,\n Grid2X2,\n Hash,\n HeartPulse,\n House,\n Image,\n Info,\n KeyRound,\n LayoutDashboard,\n LayoutPanelTop,\n List,\n ListCollapse,\n ListFilter,\n ListOrdered,\n Lock,\n LogIn,\n LogOut,\n Menu,\n Monitor,\n MoreHorizontal,\n Network,\n Palette,\n PanelTop,\n PanelsTopLeft,\n Pause,\n Pencil,\n PencilRuler,\n Play,\n Plug,\n Plus,\n Printer,\n RefreshCcw,\n RotateCcw,\n Save,\n Search,\n SeparatorHorizontal,\n Settings,\n Shield,\n ShieldCheck,\n SlidersHorizontal,\n Square,\n Table2,\n Tags,\n Trash2,\n TriangleAlert,\n Undo2,\n Unlock,\n Upload,\n User,\n Users,\n WandSparkles,\n X,\n icons as lucideIcons,\n type LucideIcon,\n} from '@lucide/vue'\nimport { resolveSparqIconName } from '@sparqjs/schema-core'\nimport { createSparqIconRegistry, type SparqIconDefinition, type SparqIconRegistry } from '@sparqjs/schema-vue'\nimport type { Component } from 'vue'\n\nexport interface CreateLucideIconRegistryOptions {\n /** 默认包含完整 Lucide 目录,关闭后只注册 Sparq 语义 key。 */\n includeCatalog?: boolean\n}\n\nconst CORE_ICON_COMPONENTS: Record<string, LucideIcon> = {\n add: Plus,\n edit: Pencil,\n delete: Trash2,\n copy: Copy,\n save: Save,\n search: Search,\n reset: RotateCcw,\n refresh: RefreshCcw,\n upload: Upload,\n download: Download,\n view: Eye,\n hide: EyeOff,\n setting: Settings,\n more: MoreHorizontal,\n close: X,\n check: Check,\n warning: TriangleAlert,\n info: Info,\n error: CircleX,\n success: CircleCheck,\n user: User,\n home: House,\n calendar: Calendar,\n time: Clock,\n filter: ListFilter,\n sort: ListFilter,\n left: ArrowLeft,\n right: ArrowRight,\n up: ArrowUp,\n down: ArrowDown,\n back: ArrowLeft,\n restore: ArchiveRestore,\n print: Printer,\n key: KeyRound,\n lock: Lock,\n unlock: Unlock,\n 'log-out': LogOut,\n shield: Shield,\n users: Users,\n pause: Pause,\n play: Play,\n dashboard: LayoutDashboard,\n appearance: Palette,\n organization: Building2,\n plugin: Plug,\n schema: Database,\n website: Monitor,\n assets: Image,\n health: HeartPulse,\n menu: Menu,\n design: PencilRuler,\n activity: Activity,\n login: LogIn,\n list: List,\n document: FileText,\n folder: Folder,\n grid: Grid2X2,\n archive: Archive,\n trash: Trash2,\n 'top-right': ExternalLink,\n promotion: WandSparkles,\n connection: Network,\n rank: BarChart3,\n 'shield-check': ShieldCheck,\n 'circle-help': CircleHelp,\n table: Table2,\n section: PanelsTopLeft,\n card: PanelTop,\n divider: SeparatorHorizontal,\n tabs: LayoutPanelTop,\n collapse: ListCollapse,\n number: Hash,\n undo: Undo2,\n redo: Undo2,\n phone: Square,\n pad: Square,\n pc: Monitor,\n import: Download,\n export: Upload,\n json: FileJson,\n preview: Eye,\n text: FileText,\n password: Lock,\n select: List,\n 'multi-select': ListOrdered,\n 'select-tree': Network,\n cascader: Network,\n radio: CircleCheck,\n checkbox: Check,\n switch: SlidersHorizontal,\n slider: SlidersHorizontal,\n rate: Tags,\n color: Palette,\n date: Calendar,\n 'date-range': Calendar,\n datetime: Clock,\n 'time-range': Clock,\n textarea: FileText,\n 'rich-text': BookOpen,\n 'json-editor': Code2,\n 'key-value': Tags,\n 'icon-input': Image,\n 'relation-picker': Network,\n 'image-upload': Image,\n 'file-upload': FileArchive,\n}\n\nconst DEFAULT_ICON_REGISTRY = createLucideIconRegistry({ includeCatalog: false })\n\nexport function createLucideIconRegistry(options: CreateLucideIconRegistryOptions = {}): SparqIconRegistry {\n const components = options.includeCatalog === false\n ? CORE_ICON_COMPONENTS\n : {\n ...Object.fromEntries(\n Object.entries(lucideIcons).map(([name, component]) => [toKebabCase(name), component as LucideIcon]),\n ),\n ...CORE_ICON_COMPONENTS,\n }\n const entries: Array<readonly [string, SparqIconDefinition]> = Object.entries(components).map(([name, component]) => [\n name,\n {\n component,\n label: toLabel(name),\n namespace: 'lucide',\n keywords: [name, resolveSparqIconName(name), toLabel(name)],\n },\n ])\n\n return createSparqIconRegistry(entries)\n}\n\nexport function getLucideIconComponent(name: string): Component | undefined {\n return DEFAULT_ICON_REGISTRY.get(name)?.component as Component | undefined\n}\n\n/** Small named surface used by adapters and tests without exposing Element Plus icon components. */\nexport { House, Info, KeyRound, MoreHorizontal, Pause, Plus, Trash2 }\n\nfunction toKebabCase(name: string): string {\n return name\n .replace(/([a-z0-9])([A-Z])/g, '$1-$2')\n .replace(/([A-Z])([A-Z][a-z])/g, '$1-$2')\n .toLowerCase()\n}\n\nfunction toLabel(name: string): string {\n return name\n .split('-')\n .map((part) => part.slice(0, 1).toUpperCase() + part.slice(1))\n .join(' ')\n}\n\nexport const LUCIDE_ICON_NAMES = Object.keys(lucideIcons).map(toKebabCase)\n"],"mappings":";;;;AA2FA,IAAM,IAAmD;CACrD,KAAK;CACL,MAAM;CACN,QAAQ;CACR,MAAM;CACN,MAAM;CACN,QAAQ;CACR,OAAO;CACP,SAAS;CACT,QAAQ;CACR,UAAU;CACV,MAAM;CACN,MAAM;CACN,SAAS;CACT,MAAM;CACN,OAAO;CACP,OAAO;CACP,SAAS;CACT,MAAM;CACN,OAAO;CACP,SAAS;CACT,MAAM;CACN,MAAM;CACN,UAAU;CACV,MAAM;CACN,QAAQ;CACR,MAAM;CACN,MAAM;CACN,OAAO;CACP,IAAI;CACJ,MAAM;CACN,MAAM;CACN,SAAS;CACT,OAAO;CACP,KAAK;CACL,MAAM;CACN,QAAQ;CACR,WAAW;CACX,QAAQ;CACR,OAAO;CACP,OAAO;CACP,MAAM;CACN,WAAW;CACX,YAAY;CACZ,cAAc;CACd,QAAQ;CACR,QAAQ;CACR,SAAS;CACT,QAAQ;CACR,QAAQ;CACR,MAAM;CACN,QAAQ;CACR,UAAU;CACV,OAAO;CACP,MAAM;CACN,UAAU;CACV,QAAQ;CACR,MAAM;CACN,SAAS;CACT,OAAO;CACP,aAAa;CACb,WAAW;CACX,YAAY;CACZ,MAAM;CACN,gBAAgB;CAChB,eAAe;CACf,OAAO;CACP,SAAS;CACT,MAAM;CACN,SAAS;CACT,MAAM;CACN,UAAU;CACV,QAAQ;CACR,MAAM;CACN,MAAM;CACN,OAAO;CACP,KAAK;CACL,IAAI;CACJ,QAAQ;CACR,QAAQ;CACR,MAAM;CACN,SAAS;CACT,MAAM;CACN,UAAU;CACV,QAAQ;CACR,gBAAgB;CAChB,eAAe;CACf,UAAU;CACV,OAAO;CACP,UAAU;CACV,QAAQ;CACR,QAAQ;CACR,MAAM;CACN,OAAO;CACP,MAAM;CACN,cAAc;CACd,UAAU;CACV,cAAc;CACd,UAAU;CACV,aAAa;CACb,eAAe;CACf,aAAa;CACb,cAAc;CACd,mBAAmB;CACnB,gBAAgB;CAChB,eAAe;AACnB,GAEM,KAAwB,EAAyB,EAAE,gBAAgB,GAAM,CAAC;AAEhF,SAAgB,EAAyB,IAA2C,CAAC,GAAsB;CACvG,IAAM,IAAa,EAAQ,mBAAmB,KACxC,IACA;EACI,GAAG,OAAO,YACN,OAAO,QAAQ,CAAW,EAAE,KAAK,CAAC,GAAM,OAAe,CAAC,EAAY,CAAI,GAAG,CAAuB,CAAC,CACvG;EACA,GAAG;CACP;CAWN,OAAO,GAVwD,OAAO,QAAQ,CAAU,EAAE,KAAK,CAAC,GAAM,OAAe,CACjH,GACA;EACI;EACA,OAAO,EAAQ,CAAI;EACnB,WAAW;EACX,UAAU;GAAC;GAAM,GAAqB,CAAI;GAAG,EAAQ,CAAI;EAAC;CAC9D,CACJ,CAE+B,CAAO;AAC1C;AAEA,SAAgB,EAAuB,GAAqC;CACxE,OAAO,GAAsB,IAAI,CAAI,GAAG;AAC5C;AAKA,SAAS,EAAY,GAAsB;CACvC,OAAO,EACF,QAAQ,sBAAsB,OAAO,EACrC,QAAQ,wBAAwB,OAAO,EACvC,YAAY;AACrB;AAEA,SAAS,EAAQ,GAAsB;CACnC,OAAO,EACF,MAAM,GAAG,EACT,KAAK,MAAS,EAAK,MAAM,GAAG,CAAC,EAAE,YAAY,IAAI,EAAK,MAAM,CAAC,CAAC,EAC5D,KAAK,GAAG;AACjB;AAEA,IAAa,KAAoB,OAAO,KAAK,CAAW,EAAE,IAAI,CAAW"}
package/package.json ADDED
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "@sparqjs/schema-icons-lucide",
3
+ "version": "0.2.1",
4
+ "publishConfig": {
5
+ "access": "public"
6
+ },
7
+ "type": "module",
8
+ "main": "./dist/index.js",
9
+ "module": "./dist/index.js",
10
+ "types": "./dist/index.d.ts",
11
+ "exports": {
12
+ ".": {
13
+ "types": "./dist/index.d.ts",
14
+ "import": "./dist/index.js"
15
+ }
16
+ },
17
+ "files": [
18
+ "dist"
19
+ ],
20
+ "dependencies": {
21
+ "@lucide/vue": "^1.17.0",
22
+ "@sparqjs/schema-core": "0.2.1",
23
+ "@sparqjs/schema-vue": "0.2.1"
24
+ },
25
+ "peerDependencies": {
26
+ "vue": "^3.4.0"
27
+ },
28
+ "devDependencies": {
29
+ "typescript": "^5.0.0",
30
+ "vite": "^8.0.14"
31
+ },
32
+ "scripts": {
33
+ "build": "vite build && tsc -b --emitDeclarationOnly --force"
34
+ }
35
+ }