@dicebear/icons 5.0.0-alpha.16 → 5.0.0-alpha.20
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/LICENSE +18 -6
- package/lib/colors/background.js +15 -19
- package/lib/core.js +2 -35
- package/lib/hooks/onPostCreate.d.ts +1 -2
- package/lib/hooks/onPostCreate.js +1 -1
- package/lib/hooks/onPreCreate.d.ts +1 -2
- package/lib/hooks/onPreCreate.js +1 -1
- package/lib/index.d.ts +4 -4
- package/lib/index.js +4 -4
- package/lib/schema.js +0 -8
- package/package.json +8 -9
- package/lib/meta/components.d.ts +0 -4
- package/lib/meta/components.js +0 -6
package/LICENSE
CHANGED
|
@@ -1,10 +1,22 @@
|
|
|
1
|
-
|
|
1
|
+
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c)
|
|
4
|
-
Copyright (c)
|
|
3
|
+
Copyright (c) 2022 Florian Körner
|
|
4
|
+
Copyright (c) 2022 The Bootstrap Authors
|
|
5
5
|
|
|
6
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
7
12
|
|
|
8
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
copies or substantial portions of the Software.
|
|
9
15
|
|
|
10
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
SOFTWARE.
|
package/lib/colors/background.js
CHANGED
|
@@ -1,21 +1,17 @@
|
|
|
1
1
|
export const background = {
|
|
2
|
-
amber: 'rgba(255,
|
|
3
|
-
blue: 'rgba(
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
purple: 'rgba(142, 36, 170, 1)',
|
|
18
|
-
red: 'rgba(229, 57, 53, 1)',
|
|
19
|
-
teal: 'rgba(0, 137, 123, 1)',
|
|
20
|
-
yellow: 'rgba(253, 216, 53, 1)',
|
|
2
|
+
amber: 'rgba(255, 224, 130, 1)',
|
|
3
|
+
blue: 'rgba(144, 202, 249, 1)',
|
|
4
|
+
cyan: 'rgba(128, 222, 234, 1)',
|
|
5
|
+
deepOrange: 'rgba(255, 171, 145, 1)',
|
|
6
|
+
deepPurple: 'rgba(179, 157, 219, 1)',
|
|
7
|
+
green: 'rgba(165, 214, 167, 1)',
|
|
8
|
+
indigo: 'rgba(159, 168, 218, 1)',
|
|
9
|
+
lightBlue: 'rgba(129, 212, 250, 1)',
|
|
10
|
+
lightGreen: 'rgba(197, 225, 165, 1)',
|
|
11
|
+
lime: 'rgba(230, 238, 156, 1)',
|
|
12
|
+
orange: 'rgba(255, 204, 128, 1)',
|
|
13
|
+
pink: 'rgba(244, 143, 177, 1)',
|
|
14
|
+
purple: 'rgba(206, 147, 216, 1)',
|
|
15
|
+
red: 'rgba(239, 154, 154, 1)',
|
|
16
|
+
teal: 'rgba(128, 203, 196, 1)',
|
|
21
17
|
};
|
package/lib/core.js
CHANGED
|
@@ -3,7 +3,6 @@ import { getComponents } from './utils/getComponents.js';
|
|
|
3
3
|
import { getColors } from './utils/getColors.js';
|
|
4
4
|
import { onPreCreate } from './hooks/onPreCreate.js';
|
|
5
5
|
import { onPostCreate } from './hooks/onPostCreate.js';
|
|
6
|
-
import { dimensions } from './meta/components.js';
|
|
7
6
|
export const style = {
|
|
8
7
|
meta: {
|
|
9
8
|
title: 'Bootstrap Icons',
|
|
@@ -17,10 +16,10 @@ export const style = {
|
|
|
17
16
|
schema: schema,
|
|
18
17
|
create: ({ prng, options }) => {
|
|
19
18
|
var _a, _b;
|
|
20
|
-
onPreCreate({ prng, options
|
|
19
|
+
onPreCreate({ prng, options });
|
|
21
20
|
const components = getComponents({ prng, options });
|
|
22
21
|
const colors = getColors({ prng, options });
|
|
23
|
-
onPostCreate({ prng, options, components, colors
|
|
22
|
+
onPostCreate({ prng, options, components, colors });
|
|
24
23
|
options.backgroundColor = [colors.background.value];
|
|
25
24
|
return {
|
|
26
25
|
attributes: {
|
|
@@ -31,36 +30,4 @@ export const style = {
|
|
|
31
30
|
body: `<g transform="translate(4 4)">${(_b = (_a = components.icon) === null || _a === void 0 ? void 0 : _a.value(components, colors)) !== null && _b !== void 0 ? _b : ''}</g>`,
|
|
32
31
|
};
|
|
33
32
|
},
|
|
34
|
-
preview: ({ prng, options, property }) => {
|
|
35
|
-
var _a, _b;
|
|
36
|
-
const componentGroup = property.toString();
|
|
37
|
-
const colorGroup = property.toString().replace(/Color$/, '');
|
|
38
|
-
onPreCreate({ prng, options, preview: true });
|
|
39
|
-
const components = getComponents({ prng, options });
|
|
40
|
-
const colors = getColors({ prng, options });
|
|
41
|
-
onPostCreate({ prng, options, components, colors, preview: true });
|
|
42
|
-
options.backgroundColor = [colors.background.value];
|
|
43
|
-
if (componentGroup in components) {
|
|
44
|
-
const { width, height } = dimensions[componentGroup];
|
|
45
|
-
return {
|
|
46
|
-
attributes: {
|
|
47
|
-
viewBox: `0 0 ${width} ${height}`,
|
|
48
|
-
fill: 'none',
|
|
49
|
-
'shape-rendering': 'auto',
|
|
50
|
-
},
|
|
51
|
-
body: (_b = (_a = components[componentGroup]) === null || _a === void 0 ? void 0 : _a.value(components, colors)) !== null && _b !== void 0 ? _b : '',
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
if (colorGroup in colors) {
|
|
55
|
-
return {
|
|
56
|
-
attributes: {
|
|
57
|
-
viewBox: `0 0 1 1`,
|
|
58
|
-
fill: 'none',
|
|
59
|
-
'shape-rendering': 'auto',
|
|
60
|
-
},
|
|
61
|
-
body: `<rect width="1" height="1" fill="${colors[colorGroup].value}" />`,
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
return undefined;
|
|
65
|
-
},
|
|
66
33
|
};
|
|
@@ -5,7 +5,6 @@ declare type Props = {
|
|
|
5
5
|
options: StyleOptions<Options>;
|
|
6
6
|
components: ComponentPickCollection;
|
|
7
7
|
colors: ColorPickCollection;
|
|
8
|
-
preview: boolean;
|
|
9
8
|
};
|
|
10
|
-
export declare function onPostCreate({ prng, options, components, colors
|
|
9
|
+
export declare function onPostCreate({ prng, options, components, colors }: Props): void;
|
|
11
10
|
export {};
|
|
@@ -3,7 +3,6 @@ import { Options } from '../types.js';
|
|
|
3
3
|
declare type Props = {
|
|
4
4
|
prng: Prng;
|
|
5
5
|
options: StyleOptions<Options>;
|
|
6
|
-
preview: boolean;
|
|
7
6
|
};
|
|
8
|
-
export declare function onPreCreate({ prng, options
|
|
7
|
+
export declare function onPreCreate({ prng, options }: Props): void;
|
|
9
8
|
export {};
|
package/lib/hooks/onPreCreate.js
CHANGED
package/lib/index.d.ts
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
* Icons (@dicebear/icons)
|
|
3
3
|
*
|
|
4
4
|
* Code licensed under MIT License.
|
|
5
|
-
* Copyright (c)
|
|
6
|
-
* Copyright (c)
|
|
5
|
+
* Copyright (c) 2022 Florian Körner
|
|
6
|
+
* Copyright (c) 2022 The Bootstrap Authors
|
|
7
7
|
*
|
|
8
8
|
* Design "Bootstrap Icons" by The Bootstrap Authors licensed under MIT.
|
|
9
9
|
* Source: https://github.com/twbs/icons
|
|
10
10
|
* License: https://github.com/twbs/icons/blob/main/LICENSE.md
|
|
11
11
|
*/
|
|
12
|
-
declare const create: import("@dicebear/core").StyleCreate<import("./types.js").Options>,
|
|
13
|
-
export { create,
|
|
12
|
+
declare const create: import("@dicebear/core").StyleCreate<import("./types.js").Options>, meta: import("@dicebear/core").StyleMeta, schema: import("json-schema").JSONSchema7;
|
|
13
|
+
export { create, meta, schema };
|
|
14
14
|
export type { Options } from './types.js';
|
package/lib/index.js
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
* Icons (@dicebear/icons)
|
|
3
3
|
*
|
|
4
4
|
* Code licensed under MIT License.
|
|
5
|
-
* Copyright (c)
|
|
6
|
-
* Copyright (c)
|
|
5
|
+
* Copyright (c) 2022 Florian Körner
|
|
6
|
+
* Copyright (c) 2022 The Bootstrap Authors
|
|
7
7
|
*
|
|
8
8
|
* Design "Bootstrap Icons" by The Bootstrap Authors licensed under MIT.
|
|
9
9
|
* Source: https://github.com/twbs/icons
|
|
10
10
|
* License: https://github.com/twbs/icons/blob/main/LICENSE.md
|
|
11
11
|
*/
|
|
12
12
|
import { style } from './core.js';
|
|
13
|
-
const { create,
|
|
14
|
-
export { create,
|
|
13
|
+
const { create, meta, schema } = style;
|
|
14
|
+
export { create, meta, schema };
|
package/lib/schema.js
CHANGED
|
@@ -11,13 +11,10 @@ export const schema = {
|
|
|
11
11
|
default: [
|
|
12
12
|
'amber',
|
|
13
13
|
'blue',
|
|
14
|
-
'blueGray',
|
|
15
|
-
'brown',
|
|
16
14
|
'cyan',
|
|
17
15
|
'deepOrange',
|
|
18
16
|
'deepPurple',
|
|
19
17
|
'green',
|
|
20
|
-
'grey',
|
|
21
18
|
'indigo',
|
|
22
19
|
'lightBlue',
|
|
23
20
|
'lightGreen',
|
|
@@ -27,18 +24,14 @@ export const schema = {
|
|
|
27
24
|
'purple',
|
|
28
25
|
'red',
|
|
29
26
|
'teal',
|
|
30
|
-
'yellow',
|
|
31
27
|
],
|
|
32
28
|
examples: [
|
|
33
29
|
['amber'],
|
|
34
30
|
['blue'],
|
|
35
|
-
['blueGray'],
|
|
36
|
-
['brown'],
|
|
37
31
|
['cyan'],
|
|
38
32
|
['deepOrange'],
|
|
39
33
|
['deepPurple'],
|
|
40
34
|
['green'],
|
|
41
|
-
['grey'],
|
|
42
35
|
['indigo'],
|
|
43
36
|
['lightBlue'],
|
|
44
37
|
['lightGreen'],
|
|
@@ -48,7 +41,6 @@ export const schema = {
|
|
|
48
41
|
['purple'],
|
|
49
42
|
['red'],
|
|
50
43
|
['teal'],
|
|
51
|
-
['yellow'],
|
|
52
44
|
],
|
|
53
45
|
},
|
|
54
46
|
icon: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dicebear/icons",
|
|
3
|
-
"version": "5.0.0-alpha.
|
|
3
|
+
"version": "5.0.0-alpha.20",
|
|
4
4
|
"description": "Avatar style for DiceBear",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"dicebear"
|
|
@@ -28,21 +28,20 @@
|
|
|
28
28
|
"test": "uvu tests"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@dicebear/core": "^5.0.0-alpha.
|
|
32
|
-
"@tsconfig/recommended": "^1.0.
|
|
33
|
-
"@types/jest": "^26.0.22",
|
|
31
|
+
"@dicebear/core": "^5.0.0-alpha.20",
|
|
32
|
+
"@tsconfig/recommended": "^1.0.1",
|
|
34
33
|
"del-cli": "^4.0.1",
|
|
35
|
-
"typescript": "^4.
|
|
36
|
-
"uvu": "^0.5.
|
|
34
|
+
"typescript": "^4.6.3",
|
|
35
|
+
"uvu": "^0.5.3"
|
|
37
36
|
},
|
|
38
37
|
"peerDependencies": {
|
|
39
|
-
"@dicebear/core": "^5.0.0-alpha.
|
|
38
|
+
"@dicebear/core": "^5.0.0-alpha.17"
|
|
40
39
|
},
|
|
41
40
|
"engines": {
|
|
42
|
-
"node": "^
|
|
41
|
+
"node": "^14.13.1 || >=16.0.0"
|
|
43
42
|
},
|
|
44
43
|
"publishConfig": {
|
|
45
44
|
"access": "public"
|
|
46
45
|
},
|
|
47
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "6b1c2bd64294365be21d0a133a362ede5ed62b5a"
|
|
48
47
|
}
|
package/lib/meta/components.d.ts
DELETED