gdsi 3.0.2 → 3.0.3

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 (2) hide show
  1. package/README.md +189 -172
  2. package/package.json +4 -4
package/README.md CHANGED
@@ -1,172 +1,189 @@
1
- # Geist Design System Icons
2
- A community-maintained collection of Geist Design System icons.
3
-
4
- [Online Preview](https://libondev.github.io/geist-design-system-icons/)
5
-
6
- ## ✨ Features
7
- - Full tree-shaking support
8
- - Works across frameworks (Vue/React/Vanilla JS)
9
- - Auto-imports components
10
- - Built-in react `memo` optimization
11
- - And more...
12
-
13
- ## 📦 Installation
14
-
15
- Since 3.0, the adaptation of different language frameworks has been split into corresponding subpackages. We strongly recommend that you install the package corresponding to the language framework instead of this package.
16
-
17
- So you can install the following packages:
18
-
19
- ```sh
20
- # vue2 | 3
21
- pnpm add @gdsicon/vue
22
-
23
- # react
24
- pnpm add @gdsicon/react
25
-
26
- # vanilla.js
27
- pnpm add @gdsicon/svg
28
- ```
29
-
30
- You can still install this package, but this document is only for 3.0.
31
-
32
- ## 🚀 Quick Start
33
-
34
- ### Using Auto-imports
35
- The easiest way is to use auto-imports:
36
- - For Vue: Use `unplugin-vue-components`
37
- - For React: Use `unplugin-auto-import`
38
-
39
- > 💡 Remember to add `components.d.ts` / `auto-imports.d.ts` to your `tsconfig.json` includes
40
-
41
- ```ts
42
- import IconResolver from '@gdsicon/vue/resolver'
43
- // react use: import IconResolver from '@gdsicon/vue/resolver'
44
- // vanilla use: import IconResolver from '@gdsicon/svg/resolver'
45
-
46
- import vueComponent from 'unplugin-vue-components/vite'
47
- import { defineConfig } from 'vite'
48
-
49
- export default defineConfig({
50
- plugins: [
51
- vueComponent({
52
- resolvers: [
53
- IconResolver({
54
- /**
55
- * auto import prefix
56
- * @defaults 'Gds'
57
- */
58
- prefix: 'Gds',
59
- })
60
- ],
61
- }),
62
- ],
63
- })
64
- ```
65
-
66
- Then use it in your components:
67
-
68
- ```vue
69
- <template>
70
- <div>
71
- <GdsAccessibility />
72
- </div>
73
- </template>
74
- ```
75
-
76
- ### Vanilla JavaScript
77
-
78
- ```ts
79
- import { AccessibilityIcon } from '@gdsicon/svg'
80
-
81
- const app = document.querySelector('#app')
82
-
83
- app.innerHTML = AccessibilityIcon
84
- ```
85
-
86
- ### Only Single Icon
87
-
88
- ```ts
89
- import AccessibilityIcon from '@gdsicon/react/accessibility'
90
-
91
- const app = document.querySelector('#app')
92
- app.innerHTML = AccessibilityIcon
93
- ```
94
-
95
- ### Full Icons
96
- Need all icons? You can import the full set:
97
-
98
- ```ts
99
- // Note: This method doesn't support tree-shaking
100
- import * as icons from '@gdsicon/svg'
101
-
102
- console.log(icons) // { "AccessibilityIcon": "<svg height=\"16\" stroke-linejoin=\"round\" ..." }
103
- ```
104
-
105
- ### Framework-specific Usage
106
-
107
- #### Vue 3
108
-
109
- ```html
110
- <script setup>
111
- import { AccessibilityIcon } from '@gdsicon/vue'
112
- </script>
113
-
114
- <template>
115
- <div>
116
- <AccessibilityIcon />
117
- </div>
118
- </template>
119
- ```
120
-
121
- ### React
122
- ```tsx
123
- import { AccessibilityIcon } from '@gdsicon/react'
124
-
125
- export default function App() {
126
- return (
127
- <div>
128
- <AccessibilityIcon />
129
- </div>
130
- )
131
- }
132
- ```
133
-
134
- ### With unplugin-icons
135
- ```ts
136
- import GdsiResolver from '@gdsicon/vue/resolver'
137
- import AutoImport from 'unplugin-auto-import/vite'
138
- import IconsResolver from 'unplugin-icons/resolver'
139
- import Icons from 'unplugin-icons/vite'
140
- import { defineConfig } from 'vite'
141
-
142
- export default defineConfig({
143
- plugins: [
144
- AutoImport({
145
- // ...
146
- resolvers: [
147
- IconsResolver({
148
- // ...
149
- prefix: 'I'
150
- }),
151
- GdsiResolver({
152
- prefix: 'IGds',
153
- }),
154
- ],
155
- }),
156
-
157
- Icons({
158
- compiler: 'vue3',
159
- }),
160
- ]
161
- })
162
- ```
163
-
164
- ```html
165
- <template>
166
- <div>
167
- <IGdsAccessibility />
168
- </div>
169
- </template>
170
- ```
171
-
172
- enjoy~
1
+ # Geist Design System Icons
2
+ A community-maintained collection of Geist Design System icons.
3
+
4
+ [Online Preview](https://libondev.github.io/geist-design-system-icons/)
5
+
6
+ ## ✨ Features
7
+ - Full tree-shaking support
8
+ - Works across frameworks (Vue/React/Vanilla JS)
9
+ - Auto-imports components
10
+ - Built-in react `memo` optimization
11
+ - And more...
12
+
13
+ ## 📦 Installation
14
+
15
+ Since 3.0, the adaptation of different language frameworks has been split into corresponding subpackages. We strongly recommend that you install the package corresponding to the language framework instead of this package.
16
+
17
+ So you can install the following packages:
18
+
19
+ ```sh
20
+ # vue2 | 3
21
+ pnpm add @gdsicon/vue
22
+
23
+ # react
24
+ pnpm add @gdsicon/react
25
+
26
+ # vanilla.js
27
+ pnpm add @gdsicon/svg
28
+ ```
29
+
30
+ You can still install this package, but this document is only for 3.0.
31
+
32
+ ## 🚀 Quick Start
33
+
34
+ ### Using Auto-imports
35
+ The easiest way is to use auto-imports:
36
+ - For Vue: Use `unplugin-vue-components`
37
+ - For React: Use `unplugin-auto-import`
38
+
39
+ > 💡 Remember to add `components.d.ts` / `auto-imports.d.ts` to your `tsconfig.json` includes
40
+
41
+ ```ts
42
+ import IconResolver from '@gdsicon/vue/resolver'
43
+ // react use: import IconResolver from '@gdsicon/vue/resolver'
44
+ // vanilla use: import IconResolver from '@gdsicon/svg/resolver'
45
+
46
+ import vueComponent from 'unplugin-vue-components/vite'
47
+ import { defineConfig } from 'vite'
48
+
49
+ export default defineConfig({
50
+ plugins: [
51
+ vueComponent({
52
+ resolvers: [
53
+ IconResolver({
54
+ /**
55
+ * auto import prefix
56
+ * @defaults 'Gds'
57
+ */
58
+ prefix: 'Gds',
59
+ })
60
+ ],
61
+ }),
62
+ ],
63
+ })
64
+ ```
65
+
66
+ Then use it in your components:
67
+
68
+ ```vue
69
+ <template>
70
+ <div>
71
+ <GdsAccessibility />
72
+ </div>
73
+ </template>
74
+ ```
75
+
76
+ ### Vanilla JavaScript
77
+
78
+ ```ts
79
+ import { AccessibilityIcon } from '@gdsicon/svg'
80
+
81
+ const app = document.querySelector('#app')
82
+
83
+ app.innerHTML = AccessibilityIcon
84
+ ```
85
+
86
+ ### Only Single Icon
87
+
88
+ ```ts
89
+ import AccessibilityIcon from '@gdsicon/react/accessibility'
90
+
91
+ const app = document.querySelector('#app')
92
+ app.innerHTML = AccessibilityIcon
93
+ ```
94
+
95
+ ### Full Icons
96
+ Need all icons? You can import the full set:
97
+
98
+ ```ts
99
+ // Note: This method doesn't support tree-shaking
100
+ import * as icons from '@gdsicon/svg'
101
+
102
+ console.log(icons) // { "AccessibilityIcon": "<svg height=\"16\" stroke-linejoin=\"round\" ..." }
103
+ ```
104
+
105
+ ### Framework-specific Usage
106
+
107
+ #### Vue 3
108
+
109
+ ```html
110
+ <script setup>
111
+ import { AccessibilityIcon } from '@gdsicon/vue'
112
+ </script>
113
+
114
+ <template>
115
+ <div>
116
+ <AccessibilityIcon />
117
+ </div>
118
+ </template>
119
+ ```
120
+
121
+ ### React
122
+ ```tsx
123
+ import { AccessibilityIcon } from '@gdsicon/react'
124
+
125
+ export default function App() {
126
+ return (
127
+ <div>
128
+ <AccessibilityIcon />
129
+ </div>
130
+ )
131
+ }
132
+ ```
133
+
134
+ ### With unplugin-icons
135
+ ```ts
136
+ import GdsiResolver from '@gdsicon/vue/resolver'
137
+ import AutoImport from 'unplugin-auto-import/vite'
138
+ import IconsResolver from 'unplugin-icons/resolver'
139
+ import Icons from 'unplugin-icons/vite'
140
+ import { defineConfig } from 'vite'
141
+
142
+ export default defineConfig({
143
+ plugins: [
144
+ AutoImport({
145
+ // ...
146
+ resolvers: [
147
+ IconsResolver({
148
+ // ...
149
+ prefix: 'I'
150
+ }),
151
+ GdsiResolver({
152
+ prefix: 'IGds',
153
+ }),
154
+ ],
155
+ }),
156
+
157
+ Icons({
158
+ compiler: 'vue3',
159
+ }),
160
+ ]
161
+ })
162
+ ```
163
+
164
+ ```html
165
+ <template>
166
+ <div>
167
+ <IGdsAccessibility />
168
+ </div>
169
+ </template>
170
+ ```
171
+
172
+ ## FAQ
173
+
174
+ ### Unknown file extension
175
+ > TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".vue" for xxx/node_modules/@gdsicon/vue/dist/accessibility-unread.vue
176
+
177
+ This situation usually occurs in vue projects. Because it is a directly exported sfc file, the node can't recognize this file, so it only needs to change the file import path to a specific file name.
178
+
179
+ e.g.
180
+ ```js
181
+ import { CopyIcon } from '@gdsicon/vue'
182
+ ```
183
+
184
+ Change to:
185
+ ```js
186
+ import CopyIcon from '@gdsicon/vue/copy'
187
+ ```
188
+
189
+ enjoy~
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "gdsi",
3
3
  "type": "module",
4
- "version": "3.0.2",
4
+ "version": "3.0.3",
5
5
  "description": "Geist design system icons maintained by the community.",
6
6
  "author": "Libon <bon.li@outlook.com>",
7
7
  "license": "MIT",
@@ -56,9 +56,9 @@
56
56
  "dist"
57
57
  ],
58
58
  "dependencies": {
59
- "@gdsicon/react": "1.0.1",
60
- "@gdsicon/vue": "1.0.1",
61
- "@gdsicon/svg": "1.0.1"
59
+ "@gdsicon/react": "1.0.2",
60
+ "@gdsicon/vue": "1.0.2",
61
+ "@gdsicon/svg": "1.0.2"
62
62
  },
63
63
  "devDependencies": {
64
64
  "@antfu/eslint-config": "^3.11.2",