@kong/icons 1.3.1-pr.45.9e2f764.0 → 1.3.1-pr.47.72e2793.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.
- package/README.md +29 -11
- package/dist/kong-icons.es.js +99 -99
- package/dist/kong-icons.es.js.map +1 -1
- package/dist/kong-icons.umd.js +1 -1
- package/dist/kong-icons.umd.js.map +1 -1
- package/dist/types/components/flags/index.d.ts +1 -1
- package/dist/types/components/index.d.ts +1 -1
- package/dist/types/components/multi-color/index.d.ts +1 -1
- package/dist/types/components/solid/index.d.ts +1 -1
- package/package.json +15 -14
package/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Kong's open-source, Vue icon component library, partially sourced from [Google's Material Symbols](https://fonts.google.com/icons).
|
4
4
|
|
5
|
-
|
5
|
+
**View all available icons: <http://kong.github.io/icons/>**
|
6
6
|
|
7
7
|
- [Usage](#usage)
|
8
8
|
- [Installation](#installation)
|
@@ -10,6 +10,7 @@ Vue components are generated from SVG source files located in the `/svg/` direct
|
|
10
10
|
- [Component Props](#component-props)
|
11
11
|
- [Contributing \& Local Development](#contributing--local-development)
|
12
12
|
- [SVG file requirements](#svg-file-requirements)
|
13
|
+
- [Add a new icon](#add-a-new-icon)
|
13
14
|
- [Development Sandbox](#development-sandbox)
|
14
15
|
- [Lint and fix](#lint-and-fix)
|
15
16
|
- [Testing](#testing)
|
@@ -116,38 +117,55 @@ To get started, install the package dependencies
|
|
116
117
|
yarn install --frozen-lockfile
|
117
118
|
```
|
118
119
|
|
120
|
+
The exported Vue components are generated from SVG source files located in the `/svg/` child directories.
|
121
|
+
|
119
122
|
### SVG file requirements
|
120
123
|
|
121
124
|
Source SVG files **must**:
|
122
125
|
|
126
|
+
- have a **unique**, lowercase and kebab-case filename, regardless of the `/svg/*` subdirectory they are located in
|
127
|
+
- file names **must** not include the word `icon` (the suffix is automatically added during component generation)
|
128
|
+
- the resulting exported icon name will be a PascalCase file with an added `Icon` suffix (e.g. `kebab-case.svg -> KebabCaseIcon.vue`)
|
123
129
|
- be stored in the `/svg/` directory
|
124
130
|
- All solid (single-color) icon SVG files **must** be placed in the `/svg/solid/` directory
|
125
131
|
- All flag icon SVG files **must** be named following the format `{country code}.svg` and **must** be placed in the `/svg/flags/` directory. All country codes must be two-character strings.
|
126
132
|
- All multi-color SVG files **must** be placed in the `/svg/multi-color/` directory
|
127
|
-
- have a **unique**, `kebab-case` filename, regardless of the `/svg/*` subdirectory they are located in
|
128
|
-
- file names **must** not include the word `icon` (it is automatically added during component generation)
|
129
|
-
- the resulting exported icon name will be a PascalCase file with an added `Icon` suffix (e.g. `kebab-case.svg -> KebabCaseIcon`)
|
130
133
|
- have a default size of `24px` when they are exported
|
131
134
|
- be sourced from and approved of by Kong's Design team
|
132
135
|
|
136
|
+
### Add a new icon
|
137
|
+
|
138
|
+
To add a new SVG:
|
139
|
+
|
140
|
+
1. Ensure the SVG has been exported from the Design team (do **not** create custom SVG files)
|
141
|
+
2. Ensure the filename is lowercase and kebab-case
|
142
|
+
3. Place the SVG file into the corresponding `/svg/*` subdirectory.
|
143
|
+
4. Locally, run `yarn generate` to create the corresponding Vue component
|
144
|
+
5. Locally, run `yarn test -u` to run the tests and update the test snapshots
|
145
|
+
6. [Commit your changes](#committing-changes) and push up a Pull Request for review
|
146
|
+
|
133
147
|
### Development Sandbox
|
134
148
|
|
135
149
|
This repository includes a Vue sandbox app (see the `/sandbox` directory) to allow you to experiment with icons.
|
136
150
|
|
137
|
-
|
138
|
-
|
139
|
-
> **Note**: You must regenerate the icons and restart the sandbox if you make changes to files outside of the `/sandbox/` directory.
|
151
|
+
The `yarn dev` command will automatically call the `generate` command to generate the icon components.
|
140
152
|
|
141
153
|
To compile the icon components and start the sandbox:
|
142
154
|
|
143
155
|
```sh
|
144
|
-
# Generate the Icon Components
|
145
|
-
yarn generate
|
146
|
-
|
147
|
-
# Start the sandbox
|
156
|
+
# Generate the Icon Components and start the sandbox
|
148
157
|
yarn dev
|
149
158
|
```
|
150
159
|
|
160
|
+
#### Build and Preview the Development Sandbox
|
161
|
+
|
162
|
+
To run a local preview of the Sandbox site that will be deployed to GitHub Pages:
|
163
|
+
|
164
|
+
```sh
|
165
|
+
yarn build:sandbox
|
166
|
+
yarn preview:sandbox
|
167
|
+
```
|
168
|
+
|
151
169
|
### Lint and fix
|
152
170
|
|
153
171
|
Lint package files, and optionally auto-fix detected issues.
|