@feathericons/core 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.
- package/README.md +28 -2
- package/dist/axes.d.ts +8 -0
- package/dist/axes.js +8 -0
- package/dist/entries.d.ts +4 -0
- package/dist/entries.js +28 -0
- package/dist/generated.d.ts +2 -0
- package/dist/generated.js +41566 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +4 -0
- package/dist/types.d.ts +27 -0
- package/dist/types.js +1 -0
- package/dist/variant.d.ts +6 -0
- package/dist/variant.js +9 -0
- package/package.json +30 -3
package/README.md
CHANGED
|
@@ -1,3 +1,29 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @feathericons/core
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Icon catalog for [Feather](../..).
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
pnpm add @feathericons/core
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
The published package is ESM in `dist/index.js` with types in `dist/index.d.ts`.
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
import { ICON_AXES, getVariant, icons } from '@feathericons/core'
|
|
17
|
+
|
|
18
|
+
ICON_AXES
|
|
19
|
+
// {
|
|
20
|
+
// weight: ['thin', 'extralight', 'light', 'regular', 'medium', 'semibold', 'bold'],
|
|
21
|
+
// roundness: ['none', 'small', 'medium', 'large'],
|
|
22
|
+
// }
|
|
23
|
+
|
|
24
|
+
icons
|
|
25
|
+
// [{ name, keywords, variants: [{ axes, grid, bounds, contents }, ...] }, ...]
|
|
26
|
+
|
|
27
|
+
getVariant(icons[0], { weight: 'regular', roundness: 'medium' })
|
|
28
|
+
// { axes, grid, bounds, contents }
|
|
29
|
+
```
|
package/dist/axes.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const ICON_AXES: {
|
|
2
|
+
readonly weight: readonly ["thin", "extralight", "light", "regular", "medium", "semibold", "bold"];
|
|
3
|
+
readonly roundness: readonly ["none", "small", "medium", "large"];
|
|
4
|
+
};
|
|
5
|
+
export declare const ICON_AXIS_DEFAULTS: {
|
|
6
|
+
readonly weight: "regular";
|
|
7
|
+
readonly roundness: "medium";
|
|
8
|
+
};
|
package/dist/axes.js
ADDED
package/dist/entries.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ICON_AXES } from './axes.js';
|
|
2
|
+
export function iconExportName(kebab) {
|
|
3
|
+
return `${kebab
|
|
4
|
+
.split('-')
|
|
5
|
+
.map((part) => part.charAt(0).toUpperCase() + part.slice(1))
|
|
6
|
+
.join('')}Icon`;
|
|
7
|
+
}
|
|
8
|
+
export function entryPointId(axes) {
|
|
9
|
+
return Object.keys(ICON_AXES)
|
|
10
|
+
.map((key) => `${key}-${axes[key]}`)
|
|
11
|
+
.join('_');
|
|
12
|
+
}
|
|
13
|
+
export function entryPointIds() {
|
|
14
|
+
const keys = Object.keys(ICON_AXES);
|
|
15
|
+
const ids = [];
|
|
16
|
+
const walk = (depth, parts) => {
|
|
17
|
+
if (depth === keys.length) {
|
|
18
|
+
ids.push(parts.join('_'));
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
const key = keys[depth];
|
|
22
|
+
for (const value of ICON_AXES[key]) {
|
|
23
|
+
walk(depth + 1, [...parts, `${key}-${value}`]);
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
walk(0, []);
|
|
27
|
+
return ids;
|
|
28
|
+
}
|