@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 CHANGED
@@ -5,6 +5,7 @@
5
5
  by <a href="https://getbootstrap.com/">The Bootstrap Authors</a>
6
6
  </p>
7
7
 
8
+
8
9
  <p align="center">
9
10
  <a href="https://dicebear.com/styles/icons">
10
11
  Read Documentation
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
- * Copyright (c) 2022 The Bootstrap Authors
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: '^([0-9a-zA-Z]+|#[a-fA-F0-9]{3}|#[a-fA-F0-9]{4}|#[a-fA-F0-9]{6}|#[a-fA-F0-9]{8})$',
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
- 'amber',
13
- 'blue',
14
- 'cyan',
15
- 'deepOrange',
16
- 'deepPurple',
17
- 'green',
18
- 'indigo',
19
- 'lightBlue',
20
- 'lightGreen',
21
- 'lime',
22
- 'orange',
23
- 'pink',
24
- 'purple',
25
- 'red',
26
- 'teal',
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, ColorPick>;
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;
@@ -1,10 +1,3 @@
1
- import { pickColor } from './pickColor.js';
2
1
  export function getColors({ prng, options }) {
3
- return {
4
- background: pickColor({
5
- prng,
6
- group: 'background',
7
- values: options.backgroundColor,
8
- }),
9
- };
2
+ return {};
10
3
  }
@@ -5,7 +5,5 @@ export function getComponents({ prng, options, }) {
5
5
  group: 'icon',
6
6
  values: options.icon,
7
7
  });
8
- return {
9
- icon: iconComponent,
10
- };
8
+ return { icon: iconComponent };
11
9
  }
@@ -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.31",
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",
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": "088e33eb5bc45d01c9b6350011d973a5bd23bcc8"
46
+ "gitHead": "5a4a06cbb8aca42a5d19da8e704b3a7b3a45d755"
47
47
  }
@@ -1,2 +0,0 @@
1
- import type { ColorGroup } from '../types.js';
2
- export declare const background: ColorGroup;
@@ -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
- };
@@ -1 +0,0 @@
1
- export { background } from './background.js';
@@ -1 +0,0 @@
1
- export { background } from './background.js';
@@ -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 {};
@@ -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
- }