@dicebear/icons 5.0.0-alpha.31 → 5.0.0-alpha.32
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 +1 -0
- package/lib/core.js +0 -1
- package/lib/index.d.ts +0 -12
- package/lib/index.js +2 -3
- package/lib/schema.js +16 -33
- package/lib/types.d.ts +1 -5
- package/lib/utils/getColors.js +1 -8
- package/lib/utils/getComponents.js +1 -3
- package/lib/utils/pickComponent.js +2 -5
- package/package.json +3 -3
- package/lib/colors/background.d.ts +0 -2
- package/lib/colors/background.js +0 -17
- package/lib/colors/index.d.ts +0 -1
- package/lib/colors/index.js +0 -1
- package/lib/utils/pickColor.d.ts +0 -9
- package/lib/utils/pickColor.js +0 -13
package/README.md
CHANGED
package/lib/core.js
CHANGED
|
@@ -21,7 +21,6 @@ export const style = {
|
|
|
21
21
|
const components = getComponents({ prng, options });
|
|
22
22
|
const colors = getColors({ prng, options });
|
|
23
23
|
onPostCreate({ prng, options, components, colors });
|
|
24
|
-
options.backgroundColor = [colors.background.value];
|
|
25
24
|
return {
|
|
26
25
|
attributes: {
|
|
27
26
|
viewBox: '0 0 24 24',
|
package/lib/index.d.ts
CHANGED
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Icons (@dicebear/icons)
|
|
3
|
-
*
|
|
4
|
-
* Code licensed under MIT License.
|
|
5
|
-
* Copyright (c) 2022 Florian Körner
|
|
6
|
-
* Copyright (c) 2022 The Bootstrap Authors
|
|
7
|
-
*
|
|
8
|
-
* Design "Bootstrap Icons" by The Bootstrap Authors licensed under MIT.
|
|
9
|
-
* Source: https://github.com/twbs/icons
|
|
10
|
-
* Homepage: https://getbootstrap.com/
|
|
11
|
-
* License: https://github.com/twbs/icons/blob/main/LICENSE.md
|
|
12
|
-
*/
|
|
13
1
|
declare const create: import("@dicebear/core").StyleCreate<import("./types.js").Options>, meta: import("@dicebear/core").StyleMeta, schema: import("json-schema").JSONSchema7;
|
|
14
2
|
export { create, meta, schema };
|
|
15
3
|
export type { Options } from './types.js';
|
package/lib/index.js
CHANGED
|
@@ -3,13 +3,12 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Code licensed under MIT License.
|
|
5
5
|
* Copyright (c) 2022 Florian Körner
|
|
6
|
-
|
|
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
|
* Homepage: https://getbootstrap.com/
|
|
11
11
|
* License: https://github.com/twbs/icons/blob/main/LICENSE.md
|
|
12
|
-
*/
|
|
13
|
-
import { style } from './core.js';
|
|
12
|
+
*/ import { style } from './core.js';
|
|
14
13
|
const { create, meta, schema } = style;
|
|
15
14
|
export { create, meta, schema };
|
package/lib/schema.js
CHANGED
|
@@ -6,41 +6,24 @@ export const schema = {
|
|
|
6
6
|
type: 'array',
|
|
7
7
|
items: {
|
|
8
8
|
type: 'string',
|
|
9
|
-
pattern: '
|
|
9
|
+
pattern: '^#([a-fA-F0-9]{3}|[a-fA-F0-9]{4}|[a-fA-F0-9]{6}|[a-fA-F0-9]{8})$',
|
|
10
10
|
},
|
|
11
11
|
default: [
|
|
12
|
-
'
|
|
13
|
-
'
|
|
14
|
-
'
|
|
15
|
-
'
|
|
16
|
-
'
|
|
17
|
-
'
|
|
18
|
-
'
|
|
19
|
-
'
|
|
20
|
-
'
|
|
21
|
-
'
|
|
22
|
-
'
|
|
23
|
-
'
|
|
24
|
-
'
|
|
25
|
-
'
|
|
26
|
-
'
|
|
27
|
-
],
|
|
28
|
-
examples: [
|
|
29
|
-
['amber'],
|
|
30
|
-
['blue'],
|
|
31
|
-
['cyan'],
|
|
32
|
-
['deepOrange'],
|
|
33
|
-
['deepPurple'],
|
|
34
|
-
['green'],
|
|
35
|
-
['indigo'],
|
|
36
|
-
['lightBlue'],
|
|
37
|
-
['lightGreen'],
|
|
38
|
-
['lime'],
|
|
39
|
-
['orange'],
|
|
40
|
-
['pink'],
|
|
41
|
-
['purple'],
|
|
42
|
-
['red'],
|
|
43
|
-
['teal'],
|
|
12
|
+
'ffe082',
|
|
13
|
+
'90caf9',
|
|
14
|
+
'80deea',
|
|
15
|
+
'ffab91',
|
|
16
|
+
'b39ddb',
|
|
17
|
+
'a5d6a7',
|
|
18
|
+
'9fa8da',
|
|
19
|
+
'81d4fa',
|
|
20
|
+
'c5e1a5',
|
|
21
|
+
'e6ee9c',
|
|
22
|
+
'ffcc80',
|
|
23
|
+
'f48fb1',
|
|
24
|
+
'ce93d8',
|
|
25
|
+
'ef9a9a',
|
|
26
|
+
'80cbc4',
|
|
44
27
|
],
|
|
45
28
|
},
|
|
46
29
|
icon: {
|
package/lib/types.d.ts
CHANGED
|
@@ -5,11 +5,7 @@ export interface Options {
|
|
|
5
5
|
export declare type ColorGroup = Record<string, ColorGroupItem>;
|
|
6
6
|
export declare type ColorGroupCollection = Record<string, ColorGroup>;
|
|
7
7
|
export declare type ColorGroupItem = string;
|
|
8
|
-
export declare type ColorPickCollection = Record<string,
|
|
9
|
-
export declare type ColorPick = {
|
|
10
|
-
name: string;
|
|
11
|
-
value: ColorGroupItem;
|
|
12
|
-
};
|
|
8
|
+
export declare type ColorPickCollection = Record<string, string>;
|
|
13
9
|
export declare type ComponentGroup = Record<string, ComponentGroupItem>;
|
|
14
10
|
export declare type ComponentGroupCollection = Record<string, ComponentGroup>;
|
|
15
11
|
export declare type ComponentGroupItem = (components: ComponentPickCollection, colors: ColorPickCollection) => string;
|
package/lib/utils/getColors.js
CHANGED
|
@@ -2,11 +2,8 @@ import * as components from '../components/index.js';
|
|
|
2
2
|
export function pickComponent({ prng, group, values = [], }) {
|
|
3
3
|
const componentCollection = components;
|
|
4
4
|
const key = prng.pick(values);
|
|
5
|
-
if (componentCollection[group][key]) {
|
|
6
|
-
return {
|
|
7
|
-
name: key,
|
|
8
|
-
value: componentCollection[group][key],
|
|
9
|
-
};
|
|
5
|
+
if (key && componentCollection[group][key]) {
|
|
6
|
+
return { name: key, value: componentCollection[group][key] };
|
|
10
7
|
}
|
|
11
8
|
else {
|
|
12
9
|
return undefined;
|
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.32",
|
|
4
4
|
"description": "Avatar style for DiceBear",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"dicebear"
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"test": "uvu tests"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@dicebear/core": "^5.0.0-alpha.
|
|
31
|
+
"@dicebear/core": "^5.0.0-alpha.32",
|
|
32
32
|
"@tsconfig/recommended": "^1.0.1",
|
|
33
33
|
"del-cli": "^4.0.1",
|
|
34
34
|
"typescript": "^4.6.3",
|
|
@@ -43,5 +43,5 @@
|
|
|
43
43
|
"publishConfig": {
|
|
44
44
|
"access": "public"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "5a4a06cbb8aca42a5d19da8e704b3a7b3a45d755"
|
|
47
47
|
}
|
package/lib/colors/background.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export const background = {
|
|
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)',
|
|
17
|
-
};
|
package/lib/colors/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { background } from './background.js';
|
package/lib/colors/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { background } from './background.js';
|
package/lib/utils/pickColor.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { Prng } from '@dicebear/core';
|
|
2
|
-
import type { ColorPick } from '../types.js';
|
|
3
|
-
declare type Props = {
|
|
4
|
-
prng: Prng;
|
|
5
|
-
group: string;
|
|
6
|
-
values?: string[];
|
|
7
|
-
};
|
|
8
|
-
export declare function pickColor({ prng, group, values }: Props): ColorPick;
|
|
9
|
-
export {};
|
package/lib/utils/pickColor.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import * as colors from '../colors/index.js';
|
|
2
|
-
export function pickColor({ prng, group, values = [] }) {
|
|
3
|
-
var _a;
|
|
4
|
-
const colorCollection = colors;
|
|
5
|
-
if (values.length === 0) {
|
|
6
|
-
values.push('transparent');
|
|
7
|
-
}
|
|
8
|
-
const key = prng.pick(values);
|
|
9
|
-
return {
|
|
10
|
-
name: key,
|
|
11
|
-
value: (_a = colorCollection[group][key]) !== null && _a !== void 0 ? _a : key,
|
|
12
|
-
};
|
|
13
|
-
}
|