@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 CHANGED
@@ -1,10 +1,22 @@
1
- The MIT License (MIT)
1
+ MIT License
2
2
 
3
- Copyright (c) 2019-2021 The Bootstrap Authors
4
- Copyright (c) 2021 Florian Körner
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 of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
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 copies or substantial portions of the Software.
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 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
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.
@@ -1,21 +1,17 @@
1
1
  export const background = {
2
- amber: 'rgba(255, 179, 0, 1)',
3
- blue: 'rgba(30, 136, 229, 1)',
4
- blueGray: 'rgba(84, 110, 122, 1)',
5
- brown: 'rgba(109, 76, 65, 1)',
6
- cyan: 'rgba(0, 172, 193, 1)',
7
- deepOrange: 'rgba(244, 81, 30, 1)',
8
- deepPurple: 'rgba(94, 53, 177, 1)',
9
- green: 'rgba(67, 160, 71, 1)',
10
- grey: 'rgba(117, 117, 117, 1)',
11
- indigo: 'rgba(57, 73, 171, 1)',
12
- lightBlue: 'rgba(3, 155, 229, 1)',
13
- lightGreen: 'rgba(124, 179, 66, 1)',
14
- lime: 'rgba(192, 202, 51, 1)',
15
- orange: 'rgba(251, 140, 0, 1)',
16
- pink: 'rgba(216, 27, 96, 1)',
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, preview: false });
19
+ onPreCreate({ prng, options });
21
20
  const components = getComponents({ prng, options });
22
21
  const colors = getColors({ prng, options });
23
- onPostCreate({ prng, options, components, colors, preview: false });
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, preview, }: Props): void;
9
+ export declare function onPostCreate({ prng, options, components, colors }: Props): void;
11
10
  export {};
@@ -1,3 +1,3 @@
1
- export function onPostCreate({ prng, options, components, colors, preview, }) {
1
+ export function onPostCreate({ prng, options, components, colors }) {
2
2
  // Write your modifications here
3
3
  }
@@ -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, preview }: Props): void;
7
+ export declare function onPreCreate({ prng, options }: Props): void;
9
8
  export {};
@@ -1,3 +1,3 @@
1
- export function onPreCreate({ prng, options, preview }) {
1
+ export function onPreCreate({ prng, options }) {
2
2
  // Write your modifications here
3
3
  }
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) 2021 Florian Körner
6
- * Copyright (c) 2021 The Bootstrap Authors
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>, preview: import("@dicebear/core").StylePreview<import("./types.js").Options> | undefined, meta: import("@dicebear/core").StyleMeta, schema: import("json-schema").JSONSchema7;
13
- export { create, preview, meta, schema };
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) 2021 Florian Körner
6
- * Copyright (c) 2021 The Bootstrap Authors
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, preview, meta, schema } = style;
14
- export { create, preview, meta, schema };
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.16",
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.16",
32
- "@tsconfig/recommended": "^1.0.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.5.2",
36
- "uvu": "^0.5.2"
34
+ "typescript": "^4.6.3",
35
+ "uvu": "^0.5.3"
37
36
  },
38
37
  "peerDependencies": {
39
- "@dicebear/core": "^5.0.0-alpha.10"
38
+ "@dicebear/core": "^5.0.0-alpha.17"
40
39
  },
41
40
  "engines": {
42
- "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
41
+ "node": "^14.13.1 || >=16.0.0"
43
42
  },
44
43
  "publishConfig": {
45
44
  "access": "public"
46
45
  },
47
- "gitHead": "149a4a22c3a4d48dd5552bd22a49db0f853e0b5e"
46
+ "gitHead": "6b1c2bd64294365be21d0a133a362ede5ed62b5a"
48
47
  }
@@ -1,4 +0,0 @@
1
- export declare const dimensions: Record<string, {
2
- width: number;
3
- height: number;
4
- }>;
@@ -1,6 +0,0 @@
1
- export const dimensions = {
2
- icon: {
3
- width: 16,
4
- height: 16,
5
- },
6
- };