@dicebear/identicon 9.2.1 → 9.2.3

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.
@@ -6,11 +6,11 @@
6
6
  */
7
7
  import { escape } from '@dicebear/core';
8
8
  export const row1 = {
9
- 'xooox': (components, colors) => `<path d="M1 0H0v1h1V0ZM5 0H4v1h1V0Z" fill="${escape.xml(`${colors.row}`)}"/>`,
10
- 'xxoxx': (components, colors) => `<path d="M2 0H0v1h2V0ZM5 0H3v1h2V0Z" fill="${escape.xml(`${colors.row}`)}"/>`,
11
- 'xoxox': (components, colors) => `<path d="M0 0h1v1H0V0ZM4 0h1v1H4V0ZM3 0H2v1h1V0Z" fill="${escape.xml(`${colors.row}`)}"/>`,
12
- 'oxxxo': (components, colors) => `<path fill="${escape.xml(`${colors.row}`)}" d="M1 0h3v1H1z"/>`,
13
- 'xxxxx': (components, colors) => `<path fill="${escape.xml(`${colors.row}`)}" d="M0 0h5v1H0z"/>`,
14
- 'oxoxo': (components, colors) => `<path d="M2 0H1v1h1V0ZM4 0H3v1h1V0Z" fill="${escape.xml(`${colors.row}`)}"/>`,
15
- 'ooxoo': (components, colors) => `<path fill="${escape.xml(`${colors.row}`)}" d="M2 0h1v1H2z"/>`,
9
+ xooox: (components, colors) => `<path d="M1 0H0v1h1V0ZM5 0H4v1h1V0Z" fill="${escape.xml(`${colors.row}`)}"/>`,
10
+ xxoxx: (components, colors) => `<path d="M2 0H0v1h2V0ZM5 0H3v1h2V0Z" fill="${escape.xml(`${colors.row}`)}"/>`,
11
+ xoxox: (components, colors) => `<path d="M0 0h1v1H0V0ZM4 0h1v1H4V0ZM3 0H2v1h1V0Z" fill="${escape.xml(`${colors.row}`)}"/>`,
12
+ oxxxo: (components, colors) => `<path fill="${escape.xml(`${colors.row}`)}" d="M1 0h3v1H1z"/>`,
13
+ xxxxx: (components, colors) => `<path fill="${escape.xml(`${colors.row}`)}" d="M0 0h5v1H0z"/>`,
14
+ oxoxo: (components, colors) => `<path d="M2 0H1v1h1V0ZM4 0H3v1h1V0Z" fill="${escape.xml(`${colors.row}`)}"/>`,
15
+ ooxoo: (components, colors) => `<path fill="${escape.xml(`${colors.row}`)}" d="M2 0h1v1H2z"/>`,
16
16
  };
@@ -6,11 +6,11 @@
6
6
  */
7
7
  import { escape } from '@dicebear/core';
8
8
  export const row2 = {
9
- 'xooox': (components, colors) => `<path d="M1 1H0v1h1V1ZM5 1H4v1h1V1Z" fill="${escape.xml(`${colors.row}`)}"/>`,
10
- 'xxoxx': (components, colors) => `<path d="M2 1H0v1h2V1ZM5 1H3v1h2V1Z" fill="${escape.xml(`${colors.row}`)}"/>`,
11
- 'xoxox': (components, colors) => `<path d="M0 1h1v1H0V1ZM4 1h1v1H4V1ZM3 1H2v1h1V1Z" fill="${escape.xml(`${colors.row}`)}"/>`,
12
- 'oxxxo': (components, colors) => `<path fill="${escape.xml(`${colors.row}`)}" d="M1 1h3v1H1z"/>`,
13
- 'xxxxx': (components, colors) => `<path fill="${escape.xml(`${colors.row}`)}" d="M0 1h5v1H0z"/>`,
14
- 'oxoxo': (components, colors) => `<path d="M2 1H1v1h1V1ZM4 1H3v1h1V1Z" fill="${escape.xml(`${colors.row}`)}"/>`,
15
- 'ooxoo': (components, colors) => `<path fill="${escape.xml(`${colors.row}`)}" d="M2 1h1v1H2z"/>`,
9
+ xooox: (components, colors) => `<path d="M1 1H0v1h1V1ZM5 1H4v1h1V1Z" fill="${escape.xml(`${colors.row}`)}"/>`,
10
+ xxoxx: (components, colors) => `<path d="M2 1H0v1h2V1ZM5 1H3v1h2V1Z" fill="${escape.xml(`${colors.row}`)}"/>`,
11
+ xoxox: (components, colors) => `<path d="M0 1h1v1H0V1ZM4 1h1v1H4V1ZM3 1H2v1h1V1Z" fill="${escape.xml(`${colors.row}`)}"/>`,
12
+ oxxxo: (components, colors) => `<path fill="${escape.xml(`${colors.row}`)}" d="M1 1h3v1H1z"/>`,
13
+ xxxxx: (components, colors) => `<path fill="${escape.xml(`${colors.row}`)}" d="M0 1h5v1H0z"/>`,
14
+ oxoxo: (components, colors) => `<path d="M2 1H1v1h1V1ZM4 1H3v1h1V1Z" fill="${escape.xml(`${colors.row}`)}"/>`,
15
+ ooxoo: (components, colors) => `<path fill="${escape.xml(`${colors.row}`)}" d="M2 1h1v1H2z"/>`,
16
16
  };
@@ -6,11 +6,11 @@
6
6
  */
7
7
  import { escape } from '@dicebear/core';
8
8
  export const row3 = {
9
- 'xooox': (components, colors) => `<path d="M1 2H0v1h1V2ZM5 2H4v1h1V2Z" fill="${escape.xml(`${colors.row}`)}"/>`,
10
- 'xxoxx': (components, colors) => `<path d="M2 2H0v1h2V2ZM5 2H3v1h2V2Z" fill="${escape.xml(`${colors.row}`)}"/>`,
11
- 'xoxox': (components, colors) => `<path d="M0 2h1v1H0V2ZM4 2h1v1H4V2ZM3 2H2v1h1V2Z" fill="${escape.xml(`${colors.row}`)}"/>`,
12
- 'oxxxo': (components, colors) => `<path fill="${escape.xml(`${colors.row}`)}" d="M1 2h3v1H1z"/>`,
13
- 'xxxxx': (components, colors) => `<path fill="${escape.xml(`${colors.row}`)}" d="M0 2h5v1H0z"/>`,
14
- 'oxoxo': (components, colors) => `<path d="M2 2H1v1h1V2ZM4 2H3v1h1V2Z" fill="${escape.xml(`${colors.row}`)}"/>`,
15
- 'ooxoo': (components, colors) => `<path fill="${escape.xml(`${colors.row}`)}" d="M2 2h1v1H2z"/>`,
9
+ xooox: (components, colors) => `<path d="M1 2H0v1h1V2ZM5 2H4v1h1V2Z" fill="${escape.xml(`${colors.row}`)}"/>`,
10
+ xxoxx: (components, colors) => `<path d="M2 2H0v1h2V2ZM5 2H3v1h2V2Z" fill="${escape.xml(`${colors.row}`)}"/>`,
11
+ xoxox: (components, colors) => `<path d="M0 2h1v1H0V2ZM4 2h1v1H4V2ZM3 2H2v1h1V2Z" fill="${escape.xml(`${colors.row}`)}"/>`,
12
+ oxxxo: (components, colors) => `<path fill="${escape.xml(`${colors.row}`)}" d="M1 2h3v1H1z"/>`,
13
+ xxxxx: (components, colors) => `<path fill="${escape.xml(`${colors.row}`)}" d="M0 2h5v1H0z"/>`,
14
+ oxoxo: (components, colors) => `<path d="M2 2H1v1h1V2ZM4 2H3v1h1V2Z" fill="${escape.xml(`${colors.row}`)}"/>`,
15
+ ooxoo: (components, colors) => `<path fill="${escape.xml(`${colors.row}`)}" d="M2 2h1v1H2z"/>`,
16
16
  };
@@ -6,11 +6,11 @@
6
6
  */
7
7
  import { escape } from '@dicebear/core';
8
8
  export const row4 = {
9
- 'xooox': (components, colors) => `<path d="M1 3H0v1h1V3ZM5 3H4v1h1V3Z" fill="${escape.xml(`${colors.row}`)}"/>`,
10
- 'xxoxx': (components, colors) => `<path d="M2 3H0v1h2V3ZM5 3H3v1h2V3Z" fill="${escape.xml(`${colors.row}`)}"/>`,
11
- 'xoxox': (components, colors) => `<path d="M0 3h1v1H0V3ZM4 3h1v1H4V3ZM3 3H2v1h1V3Z" fill="${escape.xml(`${colors.row}`)}"/>`,
12
- 'oxxxo': (components, colors) => `<path fill="${escape.xml(`${colors.row}`)}" d="M1 3h3v1H1z"/>`,
13
- 'xxxxx': (components, colors) => `<path fill="${escape.xml(`${colors.row}`)}" d="M0 3h5v1H0z"/>`,
14
- 'oxoxo': (components, colors) => `<path d="M2 3H1v1h1V3ZM4 3H3v1h1V3Z" fill="${escape.xml(`${colors.row}`)}"/>`,
15
- 'ooxoo': (components, colors) => `<path fill="${escape.xml(`${colors.row}`)}" d="M2 3h1v1H2z"/>`,
9
+ xooox: (components, colors) => `<path d="M1 3H0v1h1V3ZM5 3H4v1h1V3Z" fill="${escape.xml(`${colors.row}`)}"/>`,
10
+ xxoxx: (components, colors) => `<path d="M2 3H0v1h2V3ZM5 3H3v1h2V3Z" fill="${escape.xml(`${colors.row}`)}"/>`,
11
+ xoxox: (components, colors) => `<path d="M0 3h1v1H0V3ZM4 3h1v1H4V3ZM3 3H2v1h1V3Z" fill="${escape.xml(`${colors.row}`)}"/>`,
12
+ oxxxo: (components, colors) => `<path fill="${escape.xml(`${colors.row}`)}" d="M1 3h3v1H1z"/>`,
13
+ xxxxx: (components, colors) => `<path fill="${escape.xml(`${colors.row}`)}" d="M0 3h5v1H0z"/>`,
14
+ oxoxo: (components, colors) => `<path d="M2 3H1v1h1V3ZM4 3H3v1h1V3Z" fill="${escape.xml(`${colors.row}`)}"/>`,
15
+ ooxoo: (components, colors) => `<path fill="${escape.xml(`${colors.row}`)}" d="M2 3h1v1H2z"/>`,
16
16
  };
@@ -6,11 +6,11 @@
6
6
  */
7
7
  import { escape } from '@dicebear/core';
8
8
  export const row5 = {
9
- 'xooox': (components, colors) => `<path d="M1 4H0v1h1V4ZM5 4H4v1h1V4Z" fill="${escape.xml(`${colors.row}`)}"/>`,
10
- 'xxoxx': (components, colors) => `<path d="M2 4H0v1h2V4ZM5 4H3v1h2V4Z" fill="${escape.xml(`${colors.row}`)}"/>`,
11
- 'xoxox': (components, colors) => `<path d="M0 4h1v1H0V4ZM4 4h1v1H4V4ZM3 4H2v1h1V4Z" fill="${escape.xml(`${colors.row}`)}"/>`,
12
- 'oxxxo': (components, colors) => `<path fill="${escape.xml(`${colors.row}`)}" d="M1 4h3v1H1z"/>`,
13
- 'xxxxx': (components, colors) => `<path fill="${escape.xml(`${colors.row}`)}" d="M0 4h5v1H0z"/>`,
14
- 'oxoxo': (components, colors) => `<path d="M2 4H1v1h1V4ZM4 4H3v1h1V4Z" fill="${escape.xml(`${colors.row}`)}"/>`,
15
- 'ooxoo': (components, colors) => `<path fill="${escape.xml(`${colors.row}`)}" d="M2 4h1v1H2z"/>`,
9
+ xooox: (components, colors) => `<path d="M1 4H0v1h1V4ZM5 4H4v1h1V4Z" fill="${escape.xml(`${colors.row}`)}"/>`,
10
+ xxoxx: (components, colors) => `<path d="M2 4H0v1h2V4ZM5 4H3v1h2V4Z" fill="${escape.xml(`${colors.row}`)}"/>`,
11
+ xoxox: (components, colors) => `<path d="M0 4h1v1H0V4ZM4 4h1v1H4V4ZM3 4H2v1h1V4Z" fill="${escape.xml(`${colors.row}`)}"/>`,
12
+ oxxxo: (components, colors) => `<path fill="${escape.xml(`${colors.row}`)}" d="M1 4h3v1H1z"/>`,
13
+ xxxxx: (components, colors) => `<path fill="${escape.xml(`${colors.row}`)}" d="M0 4h5v1H0z"/>`,
14
+ oxoxo: (components, colors) => `<path d="M2 4H1v1h1V4ZM4 4H3v1h1V4Z" fill="${escape.xml(`${colors.row}`)}"/>`,
15
+ ooxoo: (components, colors) => `<path fill="${escape.xml(`${colors.row}`)}" d="M2 4h1v1H2z"/>`,
16
16
  };
package/lib/index.js CHANGED
@@ -24,7 +24,7 @@ export const create = ({ prng, options }) => {
24
24
  attributes: {
25
25
  viewBox: '0 0 5 5',
26
26
  fill: 'none',
27
- 'shape-rendering': 'crispEdges'
27
+ 'shape-rendering': 'crispEdges',
28
28
  },
29
29
  body: `${(_b = (_a = components.row1) === null || _a === void 0 ? void 0 : _a.value(components, colors)) !== null && _b !== void 0 ? _b : ''}${(_d = (_c = components.row2) === null || _c === void 0 ? void 0 : _c.value(components, colors)) !== null && _d !== void 0 ? _d : ''}${(_f = (_e = components.row3) === null || _e === void 0 ? void 0 : _e.value(components, colors)) !== null && _f !== void 0 ? _f : ''}${(_h = (_g = components.row4) === null || _g === void 0 ? void 0 : _g.value(components, colors)) !== null && _h !== void 0 ? _h : ''}${(_k = (_j = components.row5) === null || _j === void 0 ? void 0 : _j.value(components, colors)) !== null && _k !== void 0 ? _k : ''}`,
30
30
  extra: () => ({
package/lib/schema.js CHANGED
@@ -5,155 +5,75 @@
5
5
  * File: https://www.figma.com/file/np7zgQo9412LDvi1mA1UmK
6
6
  */
7
7
  export const schema = {
8
- "$schema": "http://json-schema.org/draft-07/schema#",
9
- "properties": {
10
- "row1": {
11
- "type": "array",
12
- "items": {
13
- "type": "string",
14
- "enum": [
15
- "xooox",
16
- "xxoxx",
17
- "xoxox",
18
- "oxxxo",
19
- "xxxxx",
20
- "oxoxo",
21
- "ooxoo"
22
- ]
8
+ $schema: 'http://json-schema.org/draft-07/schema#',
9
+ properties: {
10
+ row1: {
11
+ type: 'array',
12
+ items: {
13
+ type: 'string',
14
+ enum: ['xooox', 'xxoxx', 'xoxox', 'oxxxo', 'xxxxx', 'oxoxo', 'ooxoo'],
23
15
  },
24
- "default": [
25
- "xooox",
26
- "xxoxx",
27
- "xoxox",
28
- "oxxxo",
29
- "xxxxx",
30
- "oxoxo",
31
- "ooxoo"
32
- ]
16
+ default: ['xooox', 'xxoxx', 'xoxox', 'oxxxo', 'xxxxx', 'oxoxo', 'ooxoo'],
33
17
  },
34
- "row2": {
35
- "type": "array",
36
- "items": {
37
- "type": "string",
38
- "enum": [
39
- "xooox",
40
- "xxoxx",
41
- "xoxox",
42
- "oxxxo",
43
- "xxxxx",
44
- "oxoxo",
45
- "ooxoo"
46
- ]
18
+ row2: {
19
+ type: 'array',
20
+ items: {
21
+ type: 'string',
22
+ enum: ['xooox', 'xxoxx', 'xoxox', 'oxxxo', 'xxxxx', 'oxoxo', 'ooxoo'],
47
23
  },
48
- "default": [
49
- "xooox",
50
- "xxoxx",
51
- "xoxox",
52
- "oxxxo",
53
- "xxxxx",
54
- "oxoxo",
55
- "ooxoo"
56
- ]
24
+ default: ['xooox', 'xxoxx', 'xoxox', 'oxxxo', 'xxxxx', 'oxoxo', 'ooxoo'],
57
25
  },
58
- "row3": {
59
- "type": "array",
60
- "items": {
61
- "type": "string",
62
- "enum": [
63
- "xooox",
64
- "xxoxx",
65
- "xoxox",
66
- "oxxxo",
67
- "xxxxx",
68
- "oxoxo",
69
- "ooxoo"
70
- ]
26
+ row3: {
27
+ type: 'array',
28
+ items: {
29
+ type: 'string',
30
+ enum: ['xooox', 'xxoxx', 'xoxox', 'oxxxo', 'xxxxx', 'oxoxo', 'ooxoo'],
71
31
  },
72
- "default": [
73
- "xooox",
74
- "xxoxx",
75
- "xoxox",
76
- "oxxxo",
77
- "xxxxx",
78
- "oxoxo",
79
- "ooxoo"
80
- ]
32
+ default: ['xooox', 'xxoxx', 'xoxox', 'oxxxo', 'xxxxx', 'oxoxo', 'ooxoo'],
81
33
  },
82
- "row4": {
83
- "type": "array",
84
- "items": {
85
- "type": "string",
86
- "enum": [
87
- "xooox",
88
- "xxoxx",
89
- "xoxox",
90
- "oxxxo",
91
- "xxxxx",
92
- "oxoxo",
93
- "ooxoo"
94
- ]
34
+ row4: {
35
+ type: 'array',
36
+ items: {
37
+ type: 'string',
38
+ enum: ['xooox', 'xxoxx', 'xoxox', 'oxxxo', 'xxxxx', 'oxoxo', 'ooxoo'],
95
39
  },
96
- "default": [
97
- "xooox",
98
- "xxoxx",
99
- "xoxox",
100
- "oxxxo",
101
- "xxxxx",
102
- "oxoxo",
103
- "ooxoo"
104
- ]
40
+ default: ['xooox', 'xxoxx', 'xoxox', 'oxxxo', 'xxxxx', 'oxoxo', 'ooxoo'],
105
41
  },
106
- "row5": {
107
- "type": "array",
108
- "items": {
109
- "type": "string",
110
- "enum": [
111
- "xooox",
112
- "xxoxx",
113
- "xoxox",
114
- "oxxxo",
115
- "xxxxx",
116
- "oxoxo",
117
- "ooxoo"
118
- ]
42
+ row5: {
43
+ type: 'array',
44
+ items: {
45
+ type: 'string',
46
+ enum: ['xooox', 'xxoxx', 'xoxox', 'oxxxo', 'xxxxx', 'oxoxo', 'ooxoo'],
119
47
  },
120
- "default": [
121
- "xooox",
122
- "xxoxx",
123
- "xoxox",
124
- "oxxxo",
125
- "xxxxx",
126
- "oxoxo",
127
- "ooxoo"
128
- ]
48
+ default: ['xooox', 'xxoxx', 'xoxox', 'oxxxo', 'xxxxx', 'oxoxo', 'ooxoo'],
129
49
  },
130
- "rowColor": {
131
- "type": "array",
132
- "items": {
133
- "type": "string",
134
- "pattern": "^(transparent|[a-fA-F0-9]{6})$"
50
+ rowColor: {
51
+ type: 'array',
52
+ items: {
53
+ type: 'string',
54
+ pattern: '^(transparent|[a-fA-F0-9]{6})$',
135
55
  },
136
- "default": [
137
- "e53935",
138
- "ffb300",
139
- "1e88e5",
140
- "546e7a",
141
- "6d4c41",
142
- "00acc1",
143
- "f4511e",
144
- "5e35b1",
145
- "43a047",
146
- "757575",
147
- "3949ab",
148
- "039be5",
149
- "7cb342",
150
- "c0ca33",
151
- "fb8c00",
152
- "d81b60",
153
- "8e24aa",
154
- "00897b",
155
- "fdd835"
156
- ]
157
- }
158
- }
56
+ default: [
57
+ 'e53935',
58
+ 'ffb300',
59
+ '1e88e5',
60
+ '546e7a',
61
+ '6d4c41',
62
+ '00acc1',
63
+ 'f4511e',
64
+ '5e35b1',
65
+ '43a047',
66
+ '757575',
67
+ '3949ab',
68
+ '039be5',
69
+ '7cb342',
70
+ 'c0ca33',
71
+ 'fb8c00',
72
+ 'd81b60',
73
+ '8e24aa',
74
+ '00897b',
75
+ 'fdd835',
76
+ ],
77
+ },
78
+ },
159
79
  };
@@ -8,7 +8,6 @@ import { convertColor } from './convertColor.js';
8
8
  export function getColors({ prng, options }) {
9
9
  var _a;
10
10
  return {
11
- 'row': convertColor(prng.pick((_a = options.rowColor) !== null && _a !== void 0 ? _a : [], 'transparent')),
11
+ row: convertColor(prng.pick((_a = options.rowColor) !== null && _a !== void 0 ? _a : [], 'transparent')),
12
12
  };
13
13
  }
14
- ;
@@ -10,5 +10,5 @@ type Props = {
10
10
  prng: Prng;
11
11
  options: Options;
12
12
  };
13
- export declare function getComponents({ prng, options }: Props): ComponentPickCollection;
13
+ export declare function getComponents({ prng, options, }: Props): ComponentPickCollection;
14
14
  export {};
@@ -5,7 +5,7 @@
5
5
  * File: https://www.figma.com/file/np7zgQo9412LDvi1mA1UmK
6
6
  */
7
7
  import { pickComponent } from './pickComponent.js';
8
- export function getComponents({ prng, options }) {
8
+ export function getComponents({ prng, options, }) {
9
9
  const row1Component = pickComponent({
10
10
  prng,
11
11
  group: 'row1',
@@ -32,11 +32,10 @@ export function getComponents({ prng, options }) {
32
32
  values: options.row5,
33
33
  });
34
34
  return {
35
- 'row1': row1Component,
36
- 'row2': row2Component,
37
- 'row3': row3Component,
38
- 'row4': row4Component,
39
- 'row5': row5Component,
35
+ row1: row1Component,
36
+ row2: row2Component,
37
+ row3: row3Component,
38
+ row4: row4Component,
39
+ row5: row5Component,
40
40
  };
41
41
  }
42
- ;
@@ -11,5 +11,5 @@ type Props = {
11
11
  group: string;
12
12
  values?: string[];
13
13
  };
14
- export declare function pickComponent({ prng, group, values }: Props): ComponentPick;
14
+ export declare function pickComponent({ prng, group, values, }: Props): ComponentPick;
15
15
  export {};
@@ -5,7 +5,7 @@
5
5
  * File: https://www.figma.com/file/np7zgQo9412LDvi1mA1UmK
6
6
  */
7
7
  import * as components from '../components/index.js';
8
- export function pickComponent({ prng, group, values = [] }) {
8
+ export function pickComponent({ prng, group, values = [], }) {
9
9
  const componentCollection = components;
10
10
  const key = prng.pick(values);
11
11
  if (key && componentCollection[group][key]) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dicebear/identicon",
3
- "version": "9.2.1",
3
+ "version": "9.2.3",
4
4
  "description": "Avatar style for DiceBear",
5
5
  "keywords": [
6
6
  "dicebear"
@@ -29,10 +29,10 @@
29
29
  "test": "uvu tests"
30
30
  },
31
31
  "devDependencies": {
32
- "@dicebear/core": "9.2.1",
33
- "@tsconfig/recommended": "^1.0.2",
34
- "del-cli": "^5.0.0",
35
- "typescript": "^5.1.6",
32
+ "@dicebear/core": "9.2.3",
33
+ "@tsconfig/recommended": "^1.0.10",
34
+ "del-cli": "^6.0.0",
35
+ "typescript": "^5.8.3",
36
36
  "uvu": "^0.5.6"
37
37
  },
38
38
  "peerDependencies": {
@@ -44,5 +44,5 @@
44
44
  "publishConfig": {
45
45
  "access": "public"
46
46
  },
47
- "gitHead": "49137b3469a8b831a296c61a69169f0005879508"
47
+ "gitHead": "8cfdc4d029c9de6a82fef4e27ed67b5e2cd14a30"
48
48
  }