@dicebear/open-peeps 5.0.0-alpha.8 → 5.0.0-beta.0
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 +1 -1
- package/README.md +3 -3
- package/lib/components/accessories.d.ts +8 -0
- package/lib/components/accessories.js +16 -0
- package/lib/components/face.d.ts +8 -0
- package/lib/components/face.js +38 -0
- package/lib/components/facialHair.d.ts +8 -0
- package/lib/components/facialHair.js +25 -0
- package/lib/components/head.d.ts +8 -0
- package/lib/components/head.js +57 -0
- package/lib/components/index.d.ts +11 -0
- package/lib/components/index.js +11 -0
- package/lib/components/mask.d.ts +8 -0
- package/lib/components/mask.js +10 -0
- package/lib/core.d.ts +9 -0
- package/lib/core.js +40 -0
- package/lib/hooks/onPostCreate.d.ts +16 -0
- package/lib/hooks/onPostCreate.js +9 -0
- package/lib/hooks/onPreCreate.d.ts +14 -0
- package/lib/hooks/onPreCreate.js +9 -0
- package/lib/index.d.ts +9 -0
- package/lib/index.js +20 -0
- package/lib/schema.d.ts +8 -0
- package/lib/schema.js +336 -0
- package/lib/types.d.ts +28 -0
- package/lib/types.js +7 -0
- package/lib/utils/getColors.d.ts +14 -0
- package/lib/utils/getColors.js +15 -0
- package/lib/utils/getComponents.d.ts +14 -0
- package/lib/utils/getComponents.js +42 -0
- package/lib/utils/pickComponent.d.ts +15 -0
- package/lib/utils/pickComponent.js +20 -0
- package/package.json +19 -28
- package/dist/index.d.ts +0 -21
- package/dist/index.d.ts.map +0 -1
- package/dist/index.es.js +0 -494
- package/dist/index.es.js.map +0 -1
- package/dist/index.js +0 -498
- package/dist/index.js.map +0 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Do not change this file manually! This file was generated with the "Dicebear Exporter"-Plugin for Figma.
|
|
3
|
+
*
|
|
4
|
+
* Plugin: https://www.figma.com/community/plugin/1005765655729342787
|
|
5
|
+
* File: https://www.figma.com/file/TArMPV7hXUhdCbfEFs3Pfm/%40dicebear%2Fopen-peeps?node-id=3%3A134
|
|
6
|
+
*/
|
|
7
|
+
export function onPostCreate({ prng, options, components, colors }) {
|
|
8
|
+
// Write your modifications here
|
|
9
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Do not change this file manually! This file was generated with the "Dicebear Exporter"-Plugin for Figma.
|
|
3
|
+
*
|
|
4
|
+
* Plugin: https://www.figma.com/community/plugin/1005765655729342787
|
|
5
|
+
* File: https://www.figma.com/file/TArMPV7hXUhdCbfEFs3Pfm/%40dicebear%2Fopen-peeps?node-id=3%3A134
|
|
6
|
+
*/
|
|
7
|
+
import { Prng, StyleOptions } from "@dicebear/core";
|
|
8
|
+
import { Options } from "../types.js";
|
|
9
|
+
declare type Props = {
|
|
10
|
+
prng: Prng;
|
|
11
|
+
options: StyleOptions<Options>;
|
|
12
|
+
};
|
|
13
|
+
export declare function onPreCreate({ prng, options }: Props): void;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Do not change this file manually! This file was generated with the "Dicebear Exporter"-Plugin for Figma.
|
|
3
|
+
*
|
|
4
|
+
* Plugin: https://www.figma.com/community/plugin/1005765655729342787
|
|
5
|
+
* File: https://www.figma.com/file/TArMPV7hXUhdCbfEFs3Pfm/%40dicebear%2Fopen-peeps?node-id=3%3A134
|
|
6
|
+
*/
|
|
7
|
+
export function onPreCreate({ prng, options }) {
|
|
8
|
+
// Write your modifications here
|
|
9
|
+
}
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Do not change this file manually! This file was generated with the "Dicebear Exporter"-Plugin for Figma.
|
|
3
|
+
*
|
|
4
|
+
* Plugin: https://www.figma.com/community/plugin/1005765655729342787
|
|
5
|
+
* File: https://www.figma.com/file/TArMPV7hXUhdCbfEFs3Pfm/%40dicebear%2Fopen-peeps?node-id=3%3A134
|
|
6
|
+
*/
|
|
7
|
+
declare const create: import("@dicebear/core").StyleCreate<import("./types.js").Options>, meta: import("@dicebear/core").StyleMeta, schema: import("json-schema").JSONSchema7;
|
|
8
|
+
export { create, meta, schema };
|
|
9
|
+
export type { Options } from './types.js';
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Do not change this file manually! This file was generated with the "Dicebear Exporter"-Plugin for Figma.
|
|
3
|
+
*
|
|
4
|
+
* Plugin: https://www.figma.com/community/plugin/1005765655729342787
|
|
5
|
+
* File: https://www.figma.com/file/TArMPV7hXUhdCbfEFs3Pfm/%40dicebear%2Fopen-peeps?node-id=3%3A134
|
|
6
|
+
*/
|
|
7
|
+
/*!
|
|
8
|
+
* Open Peeps (@dicebear/open-peeps)
|
|
9
|
+
*
|
|
10
|
+
* Code licensed under MIT License.
|
|
11
|
+
* Copyright (c) 2022 Florian Körner
|
|
12
|
+
*
|
|
13
|
+
* Design "Open Peeps" by Pablo Stanley licensed under CC0 1.0. / Remix of the original.
|
|
14
|
+
* Source: https://www.openpeeps.com/
|
|
15
|
+
* Homepage: https://twitter.com/pablostanley
|
|
16
|
+
* License: https://creativecommons.org/publicdomain/zero/1.0/
|
|
17
|
+
*/
|
|
18
|
+
import { style } from './core.js';
|
|
19
|
+
const { create, meta, schema } = style;
|
|
20
|
+
export { create, meta, schema };
|
package/lib/schema.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Do not change this file manually! This file was generated with the "Dicebear Exporter"-Plugin for Figma.
|
|
3
|
+
*
|
|
4
|
+
* Plugin: https://www.figma.com/community/plugin/1005765655729342787
|
|
5
|
+
* File: https://www.figma.com/file/TArMPV7hXUhdCbfEFs3Pfm/%40dicebear%2Fopen-peeps?node-id=3%3A134
|
|
6
|
+
*/
|
|
7
|
+
import type { StyleSchema } from '@dicebear/core';
|
|
8
|
+
export declare const schema: StyleSchema;
|
package/lib/schema.js
ADDED
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Do not change this file manually! This file was generated with the "Dicebear Exporter"-Plugin for Figma.
|
|
3
|
+
*
|
|
4
|
+
* Plugin: https://www.figma.com/community/plugin/1005765655729342787
|
|
5
|
+
* File: https://www.figma.com/file/TArMPV7hXUhdCbfEFs3Pfm/%40dicebear%2Fopen-peeps?node-id=3%3A134
|
|
6
|
+
*/
|
|
7
|
+
export const schema = {
|
|
8
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
9
|
+
"properties": {
|
|
10
|
+
"accessories": {
|
|
11
|
+
"type": "array",
|
|
12
|
+
"items": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"enum": [
|
|
15
|
+
"eyepatch",
|
|
16
|
+
"glasses",
|
|
17
|
+
"glasses2",
|
|
18
|
+
"glasses3",
|
|
19
|
+
"glasses4",
|
|
20
|
+
"glasses5",
|
|
21
|
+
"sunglasses",
|
|
22
|
+
"sunglasses2"
|
|
23
|
+
]
|
|
24
|
+
},
|
|
25
|
+
"default": [
|
|
26
|
+
"eyepatch",
|
|
27
|
+
"glasses",
|
|
28
|
+
"glasses2",
|
|
29
|
+
"glasses3",
|
|
30
|
+
"glasses4",
|
|
31
|
+
"glasses5",
|
|
32
|
+
"sunglasses",
|
|
33
|
+
"sunglasses2"
|
|
34
|
+
]
|
|
35
|
+
},
|
|
36
|
+
"accessoriesProbability": {
|
|
37
|
+
"type": "integer",
|
|
38
|
+
"minimum": 0,
|
|
39
|
+
"maximum": 100,
|
|
40
|
+
"default": 20
|
|
41
|
+
},
|
|
42
|
+
"clothingColor": {
|
|
43
|
+
"type": "array",
|
|
44
|
+
"items": {
|
|
45
|
+
"type": "string",
|
|
46
|
+
"pattern": "^[a-fA-F0-9]{6}$"
|
|
47
|
+
},
|
|
48
|
+
"default": [
|
|
49
|
+
"e78276",
|
|
50
|
+
"ffcf77",
|
|
51
|
+
"fdea6b",
|
|
52
|
+
"78e185",
|
|
53
|
+
"9ddadb",
|
|
54
|
+
"8fa7df",
|
|
55
|
+
"e279c7"
|
|
56
|
+
]
|
|
57
|
+
},
|
|
58
|
+
"face": {
|
|
59
|
+
"type": "array",
|
|
60
|
+
"items": {
|
|
61
|
+
"type": "string",
|
|
62
|
+
"enum": [
|
|
63
|
+
"angryWithFang",
|
|
64
|
+
"awe",
|
|
65
|
+
"blank",
|
|
66
|
+
"calm",
|
|
67
|
+
"cheeky",
|
|
68
|
+
"concerned",
|
|
69
|
+
"concernedFear",
|
|
70
|
+
"contempt",
|
|
71
|
+
"cute",
|
|
72
|
+
"cyclops",
|
|
73
|
+
"driven",
|
|
74
|
+
"eatingHappy",
|
|
75
|
+
"explaining",
|
|
76
|
+
"eyesClosed",
|
|
77
|
+
"fear",
|
|
78
|
+
"hectic",
|
|
79
|
+
"lovingGrin1",
|
|
80
|
+
"lovingGrin2",
|
|
81
|
+
"monster",
|
|
82
|
+
"old",
|
|
83
|
+
"rage",
|
|
84
|
+
"serious",
|
|
85
|
+
"smile",
|
|
86
|
+
"smileBig",
|
|
87
|
+
"smileLOL",
|
|
88
|
+
"smileTeethGap",
|
|
89
|
+
"solemn",
|
|
90
|
+
"suspicious",
|
|
91
|
+
"tired",
|
|
92
|
+
"veryAngry"
|
|
93
|
+
]
|
|
94
|
+
},
|
|
95
|
+
"default": [
|
|
96
|
+
"angryWithFang",
|
|
97
|
+
"awe",
|
|
98
|
+
"blank",
|
|
99
|
+
"calm",
|
|
100
|
+
"cheeky",
|
|
101
|
+
"concerned",
|
|
102
|
+
"concernedFear",
|
|
103
|
+
"contempt",
|
|
104
|
+
"cute",
|
|
105
|
+
"cyclops",
|
|
106
|
+
"driven",
|
|
107
|
+
"eatingHappy",
|
|
108
|
+
"explaining",
|
|
109
|
+
"eyesClosed",
|
|
110
|
+
"fear",
|
|
111
|
+
"hectic",
|
|
112
|
+
"lovingGrin1",
|
|
113
|
+
"lovingGrin2",
|
|
114
|
+
"monster",
|
|
115
|
+
"old",
|
|
116
|
+
"rage",
|
|
117
|
+
"serious",
|
|
118
|
+
"smile",
|
|
119
|
+
"smileBig",
|
|
120
|
+
"smileLOL",
|
|
121
|
+
"smileTeethGap",
|
|
122
|
+
"solemn",
|
|
123
|
+
"suspicious",
|
|
124
|
+
"tired",
|
|
125
|
+
"veryAngry"
|
|
126
|
+
]
|
|
127
|
+
},
|
|
128
|
+
"facialHair": {
|
|
129
|
+
"type": "array",
|
|
130
|
+
"items": {
|
|
131
|
+
"type": "string",
|
|
132
|
+
"enum": [
|
|
133
|
+
"chin",
|
|
134
|
+
"full",
|
|
135
|
+
"full2",
|
|
136
|
+
"full3",
|
|
137
|
+
"full4",
|
|
138
|
+
"goatee1",
|
|
139
|
+
"goatee2",
|
|
140
|
+
"moustache1",
|
|
141
|
+
"moustache2",
|
|
142
|
+
"moustache3",
|
|
143
|
+
"moustache4",
|
|
144
|
+
"moustache5",
|
|
145
|
+
"moustache6",
|
|
146
|
+
"moustache7",
|
|
147
|
+
"moustache8",
|
|
148
|
+
"moustache9"
|
|
149
|
+
]
|
|
150
|
+
},
|
|
151
|
+
"default": [
|
|
152
|
+
"chin",
|
|
153
|
+
"full",
|
|
154
|
+
"full2",
|
|
155
|
+
"full3",
|
|
156
|
+
"full4",
|
|
157
|
+
"goatee1",
|
|
158
|
+
"goatee2",
|
|
159
|
+
"moustache1",
|
|
160
|
+
"moustache2",
|
|
161
|
+
"moustache3",
|
|
162
|
+
"moustache4",
|
|
163
|
+
"moustache5",
|
|
164
|
+
"moustache6",
|
|
165
|
+
"moustache7",
|
|
166
|
+
"moustache8",
|
|
167
|
+
"moustache9"
|
|
168
|
+
]
|
|
169
|
+
},
|
|
170
|
+
"facialHairProbability": {
|
|
171
|
+
"type": "integer",
|
|
172
|
+
"minimum": 0,
|
|
173
|
+
"maximum": 100,
|
|
174
|
+
"default": 10
|
|
175
|
+
},
|
|
176
|
+
"hairColor": {
|
|
177
|
+
"type": "array",
|
|
178
|
+
"items": {
|
|
179
|
+
"type": "string",
|
|
180
|
+
"pattern": "^[a-fA-F0-9]{6}$"
|
|
181
|
+
},
|
|
182
|
+
"default": [
|
|
183
|
+
"2c1b18",
|
|
184
|
+
"e8e1e1",
|
|
185
|
+
"ecdcbf",
|
|
186
|
+
"d6b370",
|
|
187
|
+
"f59797",
|
|
188
|
+
"b58143",
|
|
189
|
+
"a55728",
|
|
190
|
+
"724133",
|
|
191
|
+
"4a312c",
|
|
192
|
+
"c93305"
|
|
193
|
+
]
|
|
194
|
+
},
|
|
195
|
+
"head": {
|
|
196
|
+
"type": "array",
|
|
197
|
+
"items": {
|
|
198
|
+
"type": "string",
|
|
199
|
+
"enum": [
|
|
200
|
+
"afro",
|
|
201
|
+
"bangs",
|
|
202
|
+
"bangs2",
|
|
203
|
+
"bantuKnots",
|
|
204
|
+
"bear",
|
|
205
|
+
"bun",
|
|
206
|
+
"bun2",
|
|
207
|
+
"buns",
|
|
208
|
+
"cornrows",
|
|
209
|
+
"cornrows2",
|
|
210
|
+
"dreads1",
|
|
211
|
+
"dreads2",
|
|
212
|
+
"flatTop",
|
|
213
|
+
"flatTopLong",
|
|
214
|
+
"grayBun",
|
|
215
|
+
"grayMedium",
|
|
216
|
+
"grayShort",
|
|
217
|
+
"hatBeanie",
|
|
218
|
+
"hatHip",
|
|
219
|
+
"hijab",
|
|
220
|
+
"long",
|
|
221
|
+
"longAfro",
|
|
222
|
+
"longBangs",
|
|
223
|
+
"longCurly",
|
|
224
|
+
"medium1",
|
|
225
|
+
"medium2",
|
|
226
|
+
"medium3",
|
|
227
|
+
"mediumBangs",
|
|
228
|
+
"mediumBangs2",
|
|
229
|
+
"mediumBangs3",
|
|
230
|
+
"mediumStraight",
|
|
231
|
+
"mohawk",
|
|
232
|
+
"mohawk2",
|
|
233
|
+
"noHair1",
|
|
234
|
+
"noHair2",
|
|
235
|
+
"noHair3",
|
|
236
|
+
"pomp",
|
|
237
|
+
"shaved1",
|
|
238
|
+
"shaved2",
|
|
239
|
+
"shaved3",
|
|
240
|
+
"short1",
|
|
241
|
+
"short2",
|
|
242
|
+
"short3",
|
|
243
|
+
"short4",
|
|
244
|
+
"short5",
|
|
245
|
+
"turban",
|
|
246
|
+
"twists",
|
|
247
|
+
"twists2"
|
|
248
|
+
]
|
|
249
|
+
},
|
|
250
|
+
"default": [
|
|
251
|
+
"afro",
|
|
252
|
+
"bangs",
|
|
253
|
+
"bangs2",
|
|
254
|
+
"bantuKnots",
|
|
255
|
+
"bear",
|
|
256
|
+
"bun",
|
|
257
|
+
"bun2",
|
|
258
|
+
"buns",
|
|
259
|
+
"cornrows",
|
|
260
|
+
"cornrows2",
|
|
261
|
+
"dreads1",
|
|
262
|
+
"dreads2",
|
|
263
|
+
"flatTop",
|
|
264
|
+
"flatTopLong",
|
|
265
|
+
"grayBun",
|
|
266
|
+
"grayMedium",
|
|
267
|
+
"grayShort",
|
|
268
|
+
"hatBeanie",
|
|
269
|
+
"hatHip",
|
|
270
|
+
"hijab",
|
|
271
|
+
"long",
|
|
272
|
+
"longAfro",
|
|
273
|
+
"longBangs",
|
|
274
|
+
"longCurly",
|
|
275
|
+
"medium1",
|
|
276
|
+
"medium2",
|
|
277
|
+
"medium3",
|
|
278
|
+
"mediumBangs",
|
|
279
|
+
"mediumBangs2",
|
|
280
|
+
"mediumBangs3",
|
|
281
|
+
"mediumStraight",
|
|
282
|
+
"mohawk",
|
|
283
|
+
"mohawk2",
|
|
284
|
+
"noHair1",
|
|
285
|
+
"noHair2",
|
|
286
|
+
"noHair3",
|
|
287
|
+
"pomp",
|
|
288
|
+
"shaved1",
|
|
289
|
+
"shaved2",
|
|
290
|
+
"shaved3",
|
|
291
|
+
"short1",
|
|
292
|
+
"short2",
|
|
293
|
+
"short3",
|
|
294
|
+
"short4",
|
|
295
|
+
"short5",
|
|
296
|
+
"turban",
|
|
297
|
+
"twists",
|
|
298
|
+
"twists2"
|
|
299
|
+
]
|
|
300
|
+
},
|
|
301
|
+
"mask": {
|
|
302
|
+
"type": "array",
|
|
303
|
+
"items": {
|
|
304
|
+
"type": "string",
|
|
305
|
+
"enum": [
|
|
306
|
+
"medicalMask",
|
|
307
|
+
"respirator"
|
|
308
|
+
]
|
|
309
|
+
},
|
|
310
|
+
"default": [
|
|
311
|
+
"medicalMask",
|
|
312
|
+
"respirator"
|
|
313
|
+
]
|
|
314
|
+
},
|
|
315
|
+
"maskProbability": {
|
|
316
|
+
"type": "integer",
|
|
317
|
+
"minimum": 0,
|
|
318
|
+
"maximum": 100,
|
|
319
|
+
"default": 5
|
|
320
|
+
},
|
|
321
|
+
"skinColor": {
|
|
322
|
+
"type": "array",
|
|
323
|
+
"items": {
|
|
324
|
+
"type": "string",
|
|
325
|
+
"pattern": "^[a-fA-F0-9]{6}$"
|
|
326
|
+
},
|
|
327
|
+
"default": [
|
|
328
|
+
"ffdbb4",
|
|
329
|
+
"edb98a",
|
|
330
|
+
"d08b5b",
|
|
331
|
+
"ae5d29",
|
|
332
|
+
"694d3d"
|
|
333
|
+
]
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
};
|
package/lib/types.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Do not change this file manually! This file was generated with the "Dicebear Exporter"-Plugin for Figma.
|
|
3
|
+
*
|
|
4
|
+
* Plugin: https://www.figma.com/community/plugin/1005765655729342787
|
|
5
|
+
* File: https://www.figma.com/file/TArMPV7hXUhdCbfEFs3Pfm/%40dicebear%2Fopen-peeps?node-id=3%3A134
|
|
6
|
+
*/
|
|
7
|
+
export interface Options {
|
|
8
|
+
head?: ('afro' | 'bangs' | 'bangs2' | 'bantuKnots' | 'bear' | 'bun' | 'bun2' | 'buns' | 'cornrows' | 'cornrows2' | 'dreads1' | 'dreads2' | 'flatTop' | 'flatTopLong' | 'grayBun' | 'grayMedium' | 'grayShort' | 'hatBeanie' | 'hatHip' | 'hijab' | 'long' | 'longAfro' | 'longBangs' | 'longCurly' | 'medium1' | 'medium2' | 'medium3' | 'mediumBangs' | 'mediumBangs2' | 'mediumBangs3' | 'mediumStraight' | 'mohawk' | 'mohawk2' | 'noHair1' | 'noHair2' | 'noHair3' | 'pomp' | 'shaved1' | 'shaved2' | 'shaved3' | 'short1' | 'short2' | 'short3' | 'short4' | 'short5' | 'turban' | 'twists' | 'twists2')[];
|
|
9
|
+
face?: ('angryWithFang' | 'awe' | 'blank' | 'calm' | 'cheeky' | 'concerned' | 'concernedFear' | 'contempt' | 'cute' | 'cyclops' | 'driven' | 'eatingHappy' | 'explaining' | 'eyesClosed' | 'fear' | 'hectic' | 'lovingGrin1' | 'lovingGrin2' | 'monster' | 'old' | 'rage' | 'serious' | 'smile' | 'smileBig' | 'smileLOL' | 'smileTeethGap' | 'solemn' | 'suspicious' | 'tired' | 'veryAngry')[];
|
|
10
|
+
facialHair?: ('chin' | 'full' | 'full2' | 'full3' | 'full4' | 'goatee1' | 'goatee2' | 'moustache1' | 'moustache2' | 'moustache3' | 'moustache4' | 'moustache5' | 'moustache6' | 'moustache7' | 'moustache8' | 'moustache9')[];
|
|
11
|
+
facialHairProbability?: number;
|
|
12
|
+
mask?: ('medicalMask' | 'respirator')[];
|
|
13
|
+
maskProbability?: number;
|
|
14
|
+
accessories?: ('eyepatch' | 'glasses' | 'glasses2' | 'glasses3' | 'glasses4' | 'glasses5' | 'sunglasses' | 'sunglasses2')[];
|
|
15
|
+
accessoriesProbability?: number;
|
|
16
|
+
skinColor?: string[];
|
|
17
|
+
clothingColor?: string[];
|
|
18
|
+
hairColor?: string[];
|
|
19
|
+
}
|
|
20
|
+
export declare type ColorPickCollection = Record<string, string>;
|
|
21
|
+
export declare type ComponentGroup = Record<string, ComponentGroupItem>;
|
|
22
|
+
export declare type ComponentGroupCollection = Record<string, ComponentGroup>;
|
|
23
|
+
export declare type ComponentGroupItem = (components: ComponentPickCollection, colors: ColorPickCollection) => string;
|
|
24
|
+
export declare type ComponentPickCollection = Record<string, ComponentPick>;
|
|
25
|
+
export declare type ComponentPick = {
|
|
26
|
+
name: string;
|
|
27
|
+
value: ComponentGroupItem;
|
|
28
|
+
} | undefined;
|
package/lib/types.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Do not change this file manually! This file was generated with the "Dicebear Exporter"-Plugin for Figma.
|
|
3
|
+
*
|
|
4
|
+
* Plugin: https://www.figma.com/community/plugin/1005765655729342787
|
|
5
|
+
* File: https://www.figma.com/file/TArMPV7hXUhdCbfEFs3Pfm/%40dicebear%2Fopen-peeps?node-id=3%3A134
|
|
6
|
+
*/
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Do not change this file manually! This file was generated with the "Dicebear Exporter"-Plugin for Figma.
|
|
3
|
+
*
|
|
4
|
+
* Plugin: https://www.figma.com/community/plugin/1005765655729342787
|
|
5
|
+
* File: https://www.figma.com/file/TArMPV7hXUhdCbfEFs3Pfm/%40dicebear%2Fopen-peeps?node-id=3%3A134
|
|
6
|
+
*/
|
|
7
|
+
import type { Prng } from '@dicebear/core';
|
|
8
|
+
import type { Options, ColorPickCollection } from '../types.js';
|
|
9
|
+
declare type Props = {
|
|
10
|
+
prng: Prng;
|
|
11
|
+
options: Options;
|
|
12
|
+
};
|
|
13
|
+
export declare function getColors({ prng, options }: Props): ColorPickCollection;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Do not change this file manually! This file was generated with the "Dicebear Exporter"-Plugin for Figma.
|
|
3
|
+
*
|
|
4
|
+
* Plugin: https://www.figma.com/community/plugin/1005765655729342787
|
|
5
|
+
* File: https://www.figma.com/file/TArMPV7hXUhdCbfEFs3Pfm/%40dicebear%2Fopen-peeps?node-id=3%3A134
|
|
6
|
+
*/
|
|
7
|
+
export function getColors({ prng, options }) {
|
|
8
|
+
var _a, _b, _c, _d, _e, _f;
|
|
9
|
+
return {
|
|
10
|
+
'skin': (_b = prng.pick((_a = options.skinColor) !== null && _a !== void 0 ? _a : [])) !== null && _b !== void 0 ? _b : 'transparent',
|
|
11
|
+
'clothing': (_d = prng.pick((_c = options.clothingColor) !== null && _c !== void 0 ? _c : [])) !== null && _d !== void 0 ? _d : 'transparent',
|
|
12
|
+
'hair': (_f = prng.pick((_e = options.hairColor) !== null && _e !== void 0 ? _e : [])) !== null && _f !== void 0 ? _f : 'transparent',
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Do not change this file manually! This file was generated with the "Dicebear Exporter"-Plugin for Figma.
|
|
3
|
+
*
|
|
4
|
+
* Plugin: https://www.figma.com/community/plugin/1005765655729342787
|
|
5
|
+
* File: https://www.figma.com/file/TArMPV7hXUhdCbfEFs3Pfm/%40dicebear%2Fopen-peeps?node-id=3%3A134
|
|
6
|
+
*/
|
|
7
|
+
import type { Prng } from '@dicebear/core';
|
|
8
|
+
import type { Options, ComponentPickCollection } from '../types.js';
|
|
9
|
+
declare type Props = {
|
|
10
|
+
prng: Prng;
|
|
11
|
+
options: Options;
|
|
12
|
+
};
|
|
13
|
+
export declare function getComponents({ prng, options }: Props): ComponentPickCollection;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Do not change this file manually! This file was generated with the "Dicebear Exporter"-Plugin for Figma.
|
|
3
|
+
*
|
|
4
|
+
* Plugin: https://www.figma.com/community/plugin/1005765655729342787
|
|
5
|
+
* File: https://www.figma.com/file/TArMPV7hXUhdCbfEFs3Pfm/%40dicebear%2Fopen-peeps?node-id=3%3A134
|
|
6
|
+
*/
|
|
7
|
+
import { pickComponent } from './pickComponent.js';
|
|
8
|
+
export function getComponents({ prng, options }) {
|
|
9
|
+
const headComponent = pickComponent({
|
|
10
|
+
prng,
|
|
11
|
+
group: 'head',
|
|
12
|
+
values: options.head
|
|
13
|
+
});
|
|
14
|
+
const faceComponent = pickComponent({
|
|
15
|
+
prng,
|
|
16
|
+
group: 'face',
|
|
17
|
+
values: options.face
|
|
18
|
+
});
|
|
19
|
+
const facialHairComponent = pickComponent({
|
|
20
|
+
prng,
|
|
21
|
+
group: 'facialHair',
|
|
22
|
+
values: options.facialHair
|
|
23
|
+
});
|
|
24
|
+
const maskComponent = pickComponent({
|
|
25
|
+
prng,
|
|
26
|
+
group: 'mask',
|
|
27
|
+
values: options.mask
|
|
28
|
+
});
|
|
29
|
+
const accessoriesComponent = pickComponent({
|
|
30
|
+
prng,
|
|
31
|
+
group: 'accessories',
|
|
32
|
+
values: options.accessories
|
|
33
|
+
});
|
|
34
|
+
return {
|
|
35
|
+
'head': headComponent,
|
|
36
|
+
'face': faceComponent,
|
|
37
|
+
'facialHair': prng.bool(options.facialHairProbability) ? facialHairComponent : undefined,
|
|
38
|
+
'mask': prng.bool(options.maskProbability) ? maskComponent : undefined,
|
|
39
|
+
'accessories': prng.bool(options.accessoriesProbability) ? accessoriesComponent : undefined,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Do not change this file manually! This file was generated with the "Dicebear Exporter"-Plugin for Figma.
|
|
3
|
+
*
|
|
4
|
+
* Plugin: https://www.figma.com/community/plugin/1005765655729342787
|
|
5
|
+
* File: https://www.figma.com/file/TArMPV7hXUhdCbfEFs3Pfm/%40dicebear%2Fopen-peeps?node-id=3%3A134
|
|
6
|
+
*/
|
|
7
|
+
import type { Prng } from '@dicebear/core';
|
|
8
|
+
import type { ComponentPick } from '../types.js';
|
|
9
|
+
declare type Props = {
|
|
10
|
+
prng: Prng;
|
|
11
|
+
group: string;
|
|
12
|
+
values?: string[];
|
|
13
|
+
};
|
|
14
|
+
export declare function pickComponent({ prng, group, values }: Props): ComponentPick;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Do not change this file manually! This file was generated with the "Dicebear Exporter"-Plugin for Figma.
|
|
3
|
+
*
|
|
4
|
+
* Plugin: https://www.figma.com/community/plugin/1005765655729342787
|
|
5
|
+
* File: https://www.figma.com/file/TArMPV7hXUhdCbfEFs3Pfm/%40dicebear%2Fopen-peeps?node-id=3%3A134
|
|
6
|
+
*/
|
|
7
|
+
import * as components from '../components/index.js';
|
|
8
|
+
export function pickComponent({ prng, group, values = [] }) {
|
|
9
|
+
const componentCollection = components;
|
|
10
|
+
const key = prng.pick(values);
|
|
11
|
+
if (key && componentCollection[group][key]) {
|
|
12
|
+
return {
|
|
13
|
+
name: key,
|
|
14
|
+
value: componentCollection[group][key],
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
return undefined;
|
|
19
|
+
}
|
|
20
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dicebear/open-peeps",
|
|
3
|
-
"version": "5.0.0-
|
|
3
|
+
"version": "5.0.0-beta.0",
|
|
4
4
|
"description": "Avatar style for DiceBear",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"dicebear"
|
|
@@ -13,44 +13,35 @@
|
|
|
13
13
|
"url": "git+https://github.com/dicebear/dicebear.git"
|
|
14
14
|
},
|
|
15
15
|
"license": "MIT",
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"module": "dist/index.es.js",
|
|
20
|
-
"types": "dist/index.d.ts",
|
|
16
|
+
"type": "module",
|
|
17
|
+
"exports": "./lib/index.js",
|
|
18
|
+
"types": "./lib/index.d.ts",
|
|
21
19
|
"files": [
|
|
22
20
|
"LICENSE",
|
|
23
|
-
"
|
|
24
|
-
"
|
|
21
|
+
"lib",
|
|
22
|
+
"README.md"
|
|
25
23
|
],
|
|
26
24
|
"scripts": {
|
|
27
|
-
"
|
|
25
|
+
"prebuild": "del-cli lib",
|
|
26
|
+
"build": "tsc",
|
|
28
27
|
"prepublishOnly": "npm run build",
|
|
29
|
-
"
|
|
30
|
-
"build": "npm-run-all build:*",
|
|
31
|
-
"build:schema": "json2ts src/schema.json src/options.ts",
|
|
32
|
-
"build:parcel": "parcel build"
|
|
28
|
+
"test": "uvu tests"
|
|
33
29
|
},
|
|
34
30
|
"devDependencies": {
|
|
35
|
-
"@dicebear/core": "^5.0.0-
|
|
36
|
-
"@
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"@types/node": "^10.11.6",
|
|
41
|
-
"jest": "^26.6.3",
|
|
42
|
-
"json-schema-to-typescript": "^10.1.5",
|
|
43
|
-
"npm-run-all": "^4.1.5",
|
|
44
|
-
"parcel": "^2.0.1",
|
|
45
|
-
"shx": "^0.3.3",
|
|
46
|
-
"ts-jest": "^26.5.4",
|
|
47
|
-
"typescript": "^4.5.2"
|
|
31
|
+
"@dicebear/core": "^5.0.0-beta.0",
|
|
32
|
+
"@tsconfig/recommended": "^1.0.1",
|
|
33
|
+
"del-cli": "^4.0.1",
|
|
34
|
+
"typescript": "^4.6.3",
|
|
35
|
+
"uvu": "^0.5.3"
|
|
48
36
|
},
|
|
49
37
|
"peerDependencies": {
|
|
50
|
-
"@dicebear/core": "^5.0.0-alpha.
|
|
38
|
+
"@dicebear/core": "^5.0.0-alpha.32"
|
|
39
|
+
},
|
|
40
|
+
"engines": {
|
|
41
|
+
"node": "^14.13.1 || >=16.0.0"
|
|
51
42
|
},
|
|
52
43
|
"publishConfig": {
|
|
53
44
|
"access": "public"
|
|
54
45
|
},
|
|
55
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "f939afabe6ade034e344b1983caa21de49873dda"
|
|
56
47
|
}
|