gdsi 3.0.0 → 3.0.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 @@
1
+ export * from '@gdsicon/react';
package/dist/react.js ADDED
@@ -0,0 +1 @@
1
+ export * from "@gdsicon/react";
@@ -0,0 +1,19 @@
1
+ export interface Options {
2
+ /**
3
+ * What type of components are expected
4
+ * @default 'svg'
5
+ */
6
+ type?: 'svg' | 'vue' | 'react';
7
+ /**
8
+ * @default 'Gds'
9
+ */
10
+ prefix?: string;
11
+ }
12
+ export default function IconsResolver({ type, prefix, }?: Options): {
13
+ type: string;
14
+ resolve: (icon: string) => {
15
+ name: string;
16
+ as: string;
17
+ from: string;
18
+ } | undefined;
19
+ };
@@ -0,0 +1,26 @@
1
+ function kebabCase(key) {
2
+ const result = key.replace(/([A-Z])/g, " $1").trim();
3
+ return result.split(" ").join("-").toLowerCase();
4
+ }
5
+ export default function IconsResolver({
6
+ type = "svg",
7
+ prefix = "Gds"
8
+ } = {}) {
9
+ const regex = new RegExp(`^${prefix}[A-Z]`);
10
+ const prefixLength = prefix.length;
11
+ return {
12
+ type: "component",
13
+ resolve: (icon) => {
14
+ if (!regex.test(icon))
15
+ return;
16
+ const rawName = icon.slice(prefixLength);
17
+ const fileName = kebabCase(rawName);
18
+ const importName = `${prefix}${rawName}`;
19
+ return {
20
+ name: "default",
21
+ as: importName,
22
+ from: `@gdsicon/${type}/${fileName}`
23
+ };
24
+ }
25
+ };
26
+ }
package/dist/svg.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from '@gdsicon/svg';
package/dist/svg.js ADDED
@@ -0,0 +1 @@
1
+ export * from "@gdsicon/svg";
package/dist/vue.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from '@gdsicon/vue';
package/dist/vue.js ADDED
@@ -0,0 +1 @@
1
+ export * from "@gdsicon/vue";
package/package.json CHANGED
@@ -1,89 +1,90 @@
1
- {
2
- "name": "gdsi",
3
- "type": "module",
4
- "version": "3.0.0",
5
- "description": "Geist design system icons maintained by the community.",
6
- "author": "Libon <bon.li@outlook.com>",
7
- "license": "MIT",
8
- "homepage": "https://github.com/libondev/gdsi#readme",
9
- "repository": {
10
- "type": "git",
11
- "url": "git+https://github.com/libondev/gdsi.git"
12
- },
13
- "bugs": {
14
- "url": "https://github.com/libondev/gdsi/issues"
15
- },
16
- "keywords": [
17
- "geist design system",
18
- "geist",
19
- "icons",
20
- "svg",
21
- "vue",
22
- "react",
23
- "vanilla"
24
- ],
25
- "sideEffects": false,
26
- "exports": {
27
- "./svg": {
28
- "types": "./dist/svg/index.d.ts",
29
- "default": "./dist/svg/index.js"
30
- },
31
- "./vue": {
32
- "types": "./dist/vue/index.d.ts",
33
- "default": "./dist/vue/index.js"
34
- },
35
- "./react": {
36
- "types": "./dist/react/index.d.ts",
37
- "default": "./dist/react/index.js"
38
- },
39
- "./resolver": {
40
- "types": "./dist/resolver.d.ts",
41
- "default": "./dist/resolver.js"
42
- },
43
- "./*": "./dist/*"
44
- },
45
- "main": "dist/svg/index.js",
46
- "types": "./dist/svg/index.d.ts",
47
- "typesVersions": {
48
- "*": {
49
- "*": [
50
- "./dist/*",
51
- "./*"
52
- ]
53
- }
54
- },
55
- "files": [
56
- "dist"
57
- ],
58
- "dependencies": {
59
- "@gdsicon/react": "1.0.1",
60
- "@gdsicon/vue": "1.0.1",
61
- "@gdsicon/svg": "1.0.1"
62
- },
63
- "devDependencies": {
64
- "@antfu/eslint-config": "^3.11.2",
65
- "@types/node": "^22.10.2",
66
- "cheerio": "^1.0.0",
67
- "eslint": "^9.16.0",
68
- "fast-glob": "^3.3.2",
69
- "mkdist": "^2.3.0",
70
- "tsx": "^4.19.2",
71
- "typescript": "^5.7.2",
72
- "unbuild": "^3.5.0"
73
- },
74
- "scripts": {
75
- "sync": "tsx ./scripts/sync.ts",
76
- "gen": "tsx ./scripts/gen.ts svg vue react",
77
- "dev:core": "unbuild --stub",
78
- "build:core": "unbuild",
79
- "build:lib": "pnpm run build:svg && pnpm run build:vue && pnpm run build:react",
80
- "build:svg": "pnpm --filter @gdsicon/svg build",
81
- "build:vue": "pnpm --filter @gdsicon/vue build",
82
- "build:react": "pnpm --filter @gdsicon/react build",
83
- "publish:svg": "pnpm --filter @gdsicon/svg publish",
84
- "publish:vue": "pnpm --filter @gdsicon/vue publish",
85
- "publish:react": "pnpm --filter @gdsicon/react publish",
86
- "lint": "eslint .",
87
- "lint:fix": "eslint . --fix"
88
- }
89
- }
1
+ {
2
+ "name": "gdsi",
3
+ "type": "module",
4
+ "version": "3.0.1",
5
+ "description": "Geist design system icons maintained by the community.",
6
+ "author": "Libon <bon.li@outlook.com>",
7
+ "license": "MIT",
8
+ "homepage": "https://github.com/libondev/gdsi#readme",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/libondev/gdsi.git"
12
+ },
13
+ "bugs": {
14
+ "url": "https://github.com/libondev/gdsi/issues"
15
+ },
16
+ "keywords": [
17
+ "geist design system",
18
+ "geist",
19
+ "icons",
20
+ "svg",
21
+ "vue",
22
+ "react",
23
+ "vanilla"
24
+ ],
25
+ "sideEffects": false,
26
+ "exports": {
27
+ "./svg": {
28
+ "types": "./dist/svg.d.ts",
29
+ "default": "./dist/svg.js"
30
+ },
31
+ "./vue": {
32
+ "types": "./dist/vue.d.ts",
33
+ "default": "./dist/vue.js"
34
+ },
35
+ "./react": {
36
+ "types": "./dist/react.d.ts",
37
+ "default": "./dist/react.js"
38
+ },
39
+ "./resolver": {
40
+ "types": "./dist/resolver.d.ts",
41
+ "default": "./dist/resolver.js"
42
+ },
43
+ "./*": "./dist/*"
44
+ },
45
+ "main": "dist/svg.js",
46
+ "types": "./dist/svg.d.ts",
47
+ "typesVersions": {
48
+ "*": {
49
+ "*": [
50
+ "./dist/*",
51
+ "./*"
52
+ ]
53
+ }
54
+ },
55
+ "files": [
56
+ "dist"
57
+ ],
58
+ "scripts": {
59
+ "sync": "tsx ./scripts/sync.ts",
60
+ "gen": "tsx ./scripts/gen.ts svg vue react",
61
+ "dev:core": "unbuild --stub",
62
+ "build:core": "unbuild",
63
+ "build:lib": "pnpm run build:svg && pnpm run build:vue && pnpm run build:react",
64
+ "build:svg": "pnpm --filter @gdsicon/svg build",
65
+ "build:vue": "pnpm --filter @gdsicon/vue build",
66
+ "build:react": "pnpm --filter @gdsicon/react build",
67
+ "publish:svg": "pnpm --filter @gdsicon/svg publish",
68
+ "publish:vue": "pnpm --filter @gdsicon/vue publish",
69
+ "publish:react": "pnpm --filter @gdsicon/react publish",
70
+ "lint": "eslint .",
71
+ "lint:fix": "eslint . --fix",
72
+ "prepublishOnly": "pnpm run build:core"
73
+ },
74
+ "dependencies": {
75
+ "@gdsicon/react": "workspace:*",
76
+ "@gdsicon/svg": "workspace:*",
77
+ "@gdsicon/vue": "workspace:*"
78
+ },
79
+ "devDependencies": {
80
+ "@antfu/eslint-config": "^3.11.2",
81
+ "@types/node": "^22.10.2",
82
+ "cheerio": "^1.0.0",
83
+ "eslint": "^9.16.0",
84
+ "fast-glob": "catalog:",
85
+ "mkdist": "catalog:",
86
+ "tsx": "^4.19.2",
87
+ "typescript": "catalog:",
88
+ "unbuild": "catalog:"
89
+ }
90
+ }