@dicebear/micah 5.0.0-alpha.9 → 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/base.d.ts +8 -0
- package/lib/components/base.js +10 -0
- package/lib/components/earrings.d.ts +8 -0
- package/lib/components/earrings.js +11 -0
- package/lib/components/ears.d.ts +8 -0
- package/lib/components/ears.js +11 -0
- package/lib/components/eyebrows.d.ts +8 -0
- package/lib/components/eyebrows.js +13 -0
- package/lib/components/eyes.d.ts +8 -0
- package/lib/components/eyes.js +13 -0
- package/lib/components/facialHair.d.ts +8 -0
- package/lib/components/facialHair.js +10 -0
- package/lib/components/glasses.d.ts +8 -0
- package/lib/components/glasses.js +11 -0
- package/lib/components/hair.d.ts +8 -0
- package/lib/components/hair.js +17 -0
- package/lib/components/index.d.ts +17 -0
- package/lib/components/index.js +17 -0
- package/lib/components/mouth.d.ts +8 -0
- package/lib/components/mouth.js +17 -0
- package/lib/components/nose.d.ts +8 -0
- package/lib/components/nose.js +11 -0
- package/lib/components/shirt.d.ts +8 -0
- package/lib/components/shirt.js +12 -0
- package/lib/core.d.ts +9 -0
- package/lib/core.js +39 -0
- package/lib/hooks/onPostCreate.d.ts +16 -0
- package/lib/hooks/onPostCreate.js +12 -0
- package/lib/hooks/onPreCreate.d.ts +14 -0
- package/lib/hooks/onPreCreate.js +19 -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 +377 -0
- package/lib/types.d.ts +42 -0
- package/lib/types.js +7 -0
- package/lib/utils/getColors.d.ts +14 -0
- package/lib/utils/getColors.js +22 -0
- package/lib/utils/getComponents.d.ts +14 -0
- package/lib/utils/getComponents.js +78 -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 -35
- package/dist/index.d.ts.map +0 -1
- package/dist/index.es.js +0 -655
- package/dist/index.es.js.map +0 -1
- package/dist/index.js +0 -659
- package/dist/index.js.map +0 -1
package/lib/schema.js
ADDED
|
@@ -0,0 +1,377 @@
|
|
|
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/YHb4ShTgmO8Lqhkz1plLfL/%40dicebear%2Fmicah?node-id=259%3A555
|
|
6
|
+
*/
|
|
7
|
+
export const schema = {
|
|
8
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
9
|
+
"properties": {
|
|
10
|
+
"base": {
|
|
11
|
+
"type": "array",
|
|
12
|
+
"items": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"enum": [
|
|
15
|
+
"standard"
|
|
16
|
+
]
|
|
17
|
+
},
|
|
18
|
+
"default": [
|
|
19
|
+
"standard"
|
|
20
|
+
]
|
|
21
|
+
},
|
|
22
|
+
"baseColor": {
|
|
23
|
+
"type": "array",
|
|
24
|
+
"items": {
|
|
25
|
+
"type": "string",
|
|
26
|
+
"pattern": "^[a-fA-F0-9]{6}$"
|
|
27
|
+
},
|
|
28
|
+
"default": [
|
|
29
|
+
"f9c9b6",
|
|
30
|
+
"ac6651",
|
|
31
|
+
"77311d"
|
|
32
|
+
]
|
|
33
|
+
},
|
|
34
|
+
"earringColor": {
|
|
35
|
+
"type": "array",
|
|
36
|
+
"items": {
|
|
37
|
+
"type": "string",
|
|
38
|
+
"pattern": "^[a-fA-F0-9]{6}$"
|
|
39
|
+
},
|
|
40
|
+
"default": [
|
|
41
|
+
"f9c9b6",
|
|
42
|
+
"d2eff3",
|
|
43
|
+
"000000",
|
|
44
|
+
"e0ddff",
|
|
45
|
+
"f4d150",
|
|
46
|
+
"ac6651",
|
|
47
|
+
"9287ff",
|
|
48
|
+
"ffeba4",
|
|
49
|
+
"fc909f",
|
|
50
|
+
"ffedef",
|
|
51
|
+
"6bd9e9",
|
|
52
|
+
"77311d",
|
|
53
|
+
"ffffff"
|
|
54
|
+
]
|
|
55
|
+
},
|
|
56
|
+
"earrings": {
|
|
57
|
+
"type": "array",
|
|
58
|
+
"items": {
|
|
59
|
+
"type": "string",
|
|
60
|
+
"enum": [
|
|
61
|
+
"hoop",
|
|
62
|
+
"stud"
|
|
63
|
+
]
|
|
64
|
+
},
|
|
65
|
+
"default": [
|
|
66
|
+
"hoop",
|
|
67
|
+
"stud"
|
|
68
|
+
]
|
|
69
|
+
},
|
|
70
|
+
"earringsProbability": {
|
|
71
|
+
"type": "integer",
|
|
72
|
+
"minimum": 0,
|
|
73
|
+
"maximum": 100,
|
|
74
|
+
"default": 30
|
|
75
|
+
},
|
|
76
|
+
"ears": {
|
|
77
|
+
"type": "array",
|
|
78
|
+
"items": {
|
|
79
|
+
"type": "string",
|
|
80
|
+
"enum": [
|
|
81
|
+
"attached",
|
|
82
|
+
"detached"
|
|
83
|
+
]
|
|
84
|
+
},
|
|
85
|
+
"default": [
|
|
86
|
+
"attached",
|
|
87
|
+
"detached"
|
|
88
|
+
]
|
|
89
|
+
},
|
|
90
|
+
"eyeShadowColor": {
|
|
91
|
+
"type": "array",
|
|
92
|
+
"items": {
|
|
93
|
+
"type": "string",
|
|
94
|
+
"pattern": "^[a-fA-F0-9]{6}$"
|
|
95
|
+
},
|
|
96
|
+
"default": [
|
|
97
|
+
"d2eff3",
|
|
98
|
+
"e0ddff",
|
|
99
|
+
"ffeba4",
|
|
100
|
+
"ffedef",
|
|
101
|
+
"ffffff"
|
|
102
|
+
]
|
|
103
|
+
},
|
|
104
|
+
"eyebrows": {
|
|
105
|
+
"type": "array",
|
|
106
|
+
"items": {
|
|
107
|
+
"type": "string",
|
|
108
|
+
"enum": [
|
|
109
|
+
"up",
|
|
110
|
+
"down",
|
|
111
|
+
"eyelashesUp",
|
|
112
|
+
"eyelashesDown"
|
|
113
|
+
]
|
|
114
|
+
},
|
|
115
|
+
"default": [
|
|
116
|
+
"up",
|
|
117
|
+
"down",
|
|
118
|
+
"eyelashesUp",
|
|
119
|
+
"eyelashesDown"
|
|
120
|
+
]
|
|
121
|
+
},
|
|
122
|
+
"eyebrowsColor": {
|
|
123
|
+
"type": "array",
|
|
124
|
+
"items": {
|
|
125
|
+
"type": "string",
|
|
126
|
+
"pattern": "^[a-fA-F0-9]{6}$"
|
|
127
|
+
},
|
|
128
|
+
"default": [
|
|
129
|
+
"000000"
|
|
130
|
+
]
|
|
131
|
+
},
|
|
132
|
+
"eyes": {
|
|
133
|
+
"type": "array",
|
|
134
|
+
"items": {
|
|
135
|
+
"type": "string",
|
|
136
|
+
"enum": [
|
|
137
|
+
"eyes",
|
|
138
|
+
"round",
|
|
139
|
+
"eyesShadow",
|
|
140
|
+
"smiling"
|
|
141
|
+
]
|
|
142
|
+
},
|
|
143
|
+
"default": [
|
|
144
|
+
"eyes",
|
|
145
|
+
"round",
|
|
146
|
+
"eyesShadow",
|
|
147
|
+
"smiling"
|
|
148
|
+
]
|
|
149
|
+
},
|
|
150
|
+
"eyesColor": {
|
|
151
|
+
"type": "array",
|
|
152
|
+
"items": {
|
|
153
|
+
"type": "string",
|
|
154
|
+
"pattern": "^[a-fA-F0-9]{6}$"
|
|
155
|
+
},
|
|
156
|
+
"default": [
|
|
157
|
+
"000000"
|
|
158
|
+
]
|
|
159
|
+
},
|
|
160
|
+
"facialHair": {
|
|
161
|
+
"type": "array",
|
|
162
|
+
"items": {
|
|
163
|
+
"type": "string",
|
|
164
|
+
"enum": [
|
|
165
|
+
"beard",
|
|
166
|
+
"scruff"
|
|
167
|
+
]
|
|
168
|
+
},
|
|
169
|
+
"default": [
|
|
170
|
+
"beard",
|
|
171
|
+
"scruff"
|
|
172
|
+
]
|
|
173
|
+
},
|
|
174
|
+
"facialHairColor": {
|
|
175
|
+
"type": "array",
|
|
176
|
+
"items": {
|
|
177
|
+
"type": "string",
|
|
178
|
+
"pattern": "^[a-fA-F0-9]{6}$"
|
|
179
|
+
},
|
|
180
|
+
"default": [
|
|
181
|
+
"77311d"
|
|
182
|
+
]
|
|
183
|
+
},
|
|
184
|
+
"facialHairProbability": {
|
|
185
|
+
"type": "integer",
|
|
186
|
+
"minimum": 0,
|
|
187
|
+
"maximum": 100,
|
|
188
|
+
"default": 10
|
|
189
|
+
},
|
|
190
|
+
"glasses": {
|
|
191
|
+
"type": "array",
|
|
192
|
+
"items": {
|
|
193
|
+
"type": "string",
|
|
194
|
+
"enum": [
|
|
195
|
+
"round",
|
|
196
|
+
"square"
|
|
197
|
+
]
|
|
198
|
+
},
|
|
199
|
+
"default": [
|
|
200
|
+
"round",
|
|
201
|
+
"square"
|
|
202
|
+
]
|
|
203
|
+
},
|
|
204
|
+
"glassesColor": {
|
|
205
|
+
"type": "array",
|
|
206
|
+
"items": {
|
|
207
|
+
"type": "string",
|
|
208
|
+
"pattern": "^[a-fA-F0-9]{6}$"
|
|
209
|
+
},
|
|
210
|
+
"default": [
|
|
211
|
+
"f9c9b6",
|
|
212
|
+
"d2eff3",
|
|
213
|
+
"000000",
|
|
214
|
+
"e0ddff",
|
|
215
|
+
"f4d150",
|
|
216
|
+
"ac6651",
|
|
217
|
+
"9287ff",
|
|
218
|
+
"ffeba4",
|
|
219
|
+
"fc909f",
|
|
220
|
+
"ffedef",
|
|
221
|
+
"6bd9e9",
|
|
222
|
+
"77311d",
|
|
223
|
+
"ffffff"
|
|
224
|
+
]
|
|
225
|
+
},
|
|
226
|
+
"glassesProbability": {
|
|
227
|
+
"type": "integer",
|
|
228
|
+
"minimum": 0,
|
|
229
|
+
"maximum": 100,
|
|
230
|
+
"default": 30
|
|
231
|
+
},
|
|
232
|
+
"hair": {
|
|
233
|
+
"type": "array",
|
|
234
|
+
"items": {
|
|
235
|
+
"type": "string",
|
|
236
|
+
"enum": [
|
|
237
|
+
"fonze",
|
|
238
|
+
"mrT",
|
|
239
|
+
"dougFunny",
|
|
240
|
+
"mrClean",
|
|
241
|
+
"dannyPhantom",
|
|
242
|
+
"full",
|
|
243
|
+
"turban",
|
|
244
|
+
"pixie"
|
|
245
|
+
]
|
|
246
|
+
},
|
|
247
|
+
"default": [
|
|
248
|
+
"fonze",
|
|
249
|
+
"mrT",
|
|
250
|
+
"dougFunny",
|
|
251
|
+
"mrClean",
|
|
252
|
+
"dannyPhantom",
|
|
253
|
+
"full",
|
|
254
|
+
"turban",
|
|
255
|
+
"pixie"
|
|
256
|
+
]
|
|
257
|
+
},
|
|
258
|
+
"hairColor": {
|
|
259
|
+
"type": "array",
|
|
260
|
+
"items": {
|
|
261
|
+
"type": "string",
|
|
262
|
+
"pattern": "^[a-fA-F0-9]{6}$"
|
|
263
|
+
},
|
|
264
|
+
"default": [
|
|
265
|
+
"f9c9b6",
|
|
266
|
+
"d2eff3",
|
|
267
|
+
"000000",
|
|
268
|
+
"e0ddff",
|
|
269
|
+
"f4d150",
|
|
270
|
+
"ac6651",
|
|
271
|
+
"9287ff",
|
|
272
|
+
"ffeba4",
|
|
273
|
+
"fc909f",
|
|
274
|
+
"ffedef",
|
|
275
|
+
"6bd9e9",
|
|
276
|
+
"77311d",
|
|
277
|
+
"ffffff"
|
|
278
|
+
]
|
|
279
|
+
},
|
|
280
|
+
"hairProbability": {
|
|
281
|
+
"type": "integer",
|
|
282
|
+
"minimum": 0,
|
|
283
|
+
"maximum": 100,
|
|
284
|
+
"default": 100
|
|
285
|
+
},
|
|
286
|
+
"mouth": {
|
|
287
|
+
"type": "array",
|
|
288
|
+
"items": {
|
|
289
|
+
"type": "string",
|
|
290
|
+
"enum": [
|
|
291
|
+
"surprised",
|
|
292
|
+
"laughing",
|
|
293
|
+
"nervous",
|
|
294
|
+
"smile",
|
|
295
|
+
"sad",
|
|
296
|
+
"pucker",
|
|
297
|
+
"frown",
|
|
298
|
+
"smirk"
|
|
299
|
+
]
|
|
300
|
+
},
|
|
301
|
+
"default": [
|
|
302
|
+
"surprised",
|
|
303
|
+
"laughing",
|
|
304
|
+
"nervous",
|
|
305
|
+
"smile",
|
|
306
|
+
"sad",
|
|
307
|
+
"pucker",
|
|
308
|
+
"frown",
|
|
309
|
+
"smirk"
|
|
310
|
+
]
|
|
311
|
+
},
|
|
312
|
+
"mouthColor": {
|
|
313
|
+
"type": "array",
|
|
314
|
+
"items": {
|
|
315
|
+
"type": "string",
|
|
316
|
+
"pattern": "^[a-fA-F0-9]{6}$"
|
|
317
|
+
},
|
|
318
|
+
"default": [
|
|
319
|
+
"000000"
|
|
320
|
+
]
|
|
321
|
+
},
|
|
322
|
+
"nose": {
|
|
323
|
+
"type": "array",
|
|
324
|
+
"items": {
|
|
325
|
+
"type": "string",
|
|
326
|
+
"enum": [
|
|
327
|
+
"curve",
|
|
328
|
+
"pointed",
|
|
329
|
+
"tound"
|
|
330
|
+
]
|
|
331
|
+
},
|
|
332
|
+
"default": [
|
|
333
|
+
"curve",
|
|
334
|
+
"pointed",
|
|
335
|
+
"tound"
|
|
336
|
+
]
|
|
337
|
+
},
|
|
338
|
+
"shirt": {
|
|
339
|
+
"type": "array",
|
|
340
|
+
"items": {
|
|
341
|
+
"type": "string",
|
|
342
|
+
"enum": [
|
|
343
|
+
"open",
|
|
344
|
+
"crew",
|
|
345
|
+
"collared"
|
|
346
|
+
]
|
|
347
|
+
},
|
|
348
|
+
"default": [
|
|
349
|
+
"open",
|
|
350
|
+
"crew",
|
|
351
|
+
"collared"
|
|
352
|
+
]
|
|
353
|
+
},
|
|
354
|
+
"shirtColor": {
|
|
355
|
+
"type": "array",
|
|
356
|
+
"items": {
|
|
357
|
+
"type": "string",
|
|
358
|
+
"pattern": "^[a-fA-F0-9]{6}$"
|
|
359
|
+
},
|
|
360
|
+
"default": [
|
|
361
|
+
"f9c9b6",
|
|
362
|
+
"d2eff3",
|
|
363
|
+
"000000",
|
|
364
|
+
"e0ddff",
|
|
365
|
+
"f4d150",
|
|
366
|
+
"ac6651",
|
|
367
|
+
"9287ff",
|
|
368
|
+
"ffeba4",
|
|
369
|
+
"fc909f",
|
|
370
|
+
"ffedef",
|
|
371
|
+
"6bd9e9",
|
|
372
|
+
"77311d",
|
|
373
|
+
"ffffff"
|
|
374
|
+
]
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
};
|
package/lib/types.d.ts
ADDED
|
@@ -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/YHb4ShTgmO8Lqhkz1plLfL/%40dicebear%2Fmicah?node-id=259%3A555
|
|
6
|
+
*/
|
|
7
|
+
export interface Options {
|
|
8
|
+
base?: ('standard')[];
|
|
9
|
+
mouth?: ('surprised' | 'laughing' | 'nervous' | 'smile' | 'sad' | 'pucker' | 'frown' | 'smirk')[];
|
|
10
|
+
eyebrows?: ('up' | 'down' | 'eyelashesUp' | 'eyelashesDown')[];
|
|
11
|
+
hair?: ('fonze' | 'mrT' | 'dougFunny' | 'mrClean' | 'dannyPhantom' | 'full' | 'turban' | 'pixie')[];
|
|
12
|
+
hairProbability?: number;
|
|
13
|
+
eyes?: ('eyes' | 'round' | 'eyesShadow' | 'smiling')[];
|
|
14
|
+
nose?: ('curve' | 'pointed' | 'tound')[];
|
|
15
|
+
ears?: ('attached' | 'detached')[];
|
|
16
|
+
shirt?: ('open' | 'crew' | 'collared')[];
|
|
17
|
+
earrings?: ('hoop' | 'stud')[];
|
|
18
|
+
earringsProbability?: number;
|
|
19
|
+
glasses?: ('round' | 'square')[];
|
|
20
|
+
glassesProbability?: number;
|
|
21
|
+
facialHair?: ('beard' | 'scruff')[];
|
|
22
|
+
facialHairProbability?: number;
|
|
23
|
+
baseColor?: string[];
|
|
24
|
+
earringColor?: string[];
|
|
25
|
+
eyeShadowColor?: string[];
|
|
26
|
+
eyebrowsColor?: string[];
|
|
27
|
+
facialHairColor?: string[];
|
|
28
|
+
glassesColor?: string[];
|
|
29
|
+
hairColor?: string[];
|
|
30
|
+
mouthColor?: string[];
|
|
31
|
+
shirtColor?: string[];
|
|
32
|
+
eyesColor?: string[];
|
|
33
|
+
}
|
|
34
|
+
export declare type ColorPickCollection = Record<string, string>;
|
|
35
|
+
export declare type ComponentGroup = Record<string, ComponentGroupItem>;
|
|
36
|
+
export declare type ComponentGroupCollection = Record<string, ComponentGroup>;
|
|
37
|
+
export declare type ComponentGroupItem = (components: ComponentPickCollection, colors: ColorPickCollection) => string;
|
|
38
|
+
export declare type ComponentPickCollection = Record<string, ComponentPick>;
|
|
39
|
+
export declare type ComponentPick = {
|
|
40
|
+
name: string;
|
|
41
|
+
value: ComponentGroupItem;
|
|
42
|
+
} | 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/YHb4ShTgmO8Lqhkz1plLfL/%40dicebear%2Fmicah?node-id=259%3A555
|
|
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/YHb4ShTgmO8Lqhkz1plLfL/%40dicebear%2Fmicah?node-id=259%3A555
|
|
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,22 @@
|
|
|
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/YHb4ShTgmO8Lqhkz1plLfL/%40dicebear%2Fmicah?node-id=259%3A555
|
|
6
|
+
*/
|
|
7
|
+
export function getColors({ prng, options }) {
|
|
8
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
|
|
9
|
+
return {
|
|
10
|
+
'base': (_b = prng.pick((_a = options.baseColor) !== null && _a !== void 0 ? _a : [])) !== null && _b !== void 0 ? _b : 'transparent',
|
|
11
|
+
'earring': (_d = prng.pick((_c = options.earringColor) !== null && _c !== void 0 ? _c : [])) !== null && _d !== void 0 ? _d : 'transparent',
|
|
12
|
+
'eyeShadow': (_f = prng.pick((_e = options.eyeShadowColor) !== null && _e !== void 0 ? _e : [])) !== null && _f !== void 0 ? _f : 'transparent',
|
|
13
|
+
'eyebrows': (_h = prng.pick((_g = options.eyebrowsColor) !== null && _g !== void 0 ? _g : [])) !== null && _h !== void 0 ? _h : 'transparent',
|
|
14
|
+
'facialHair': (_k = prng.pick((_j = options.facialHairColor) !== null && _j !== void 0 ? _j : [])) !== null && _k !== void 0 ? _k : 'transparent',
|
|
15
|
+
'glasses': (_m = prng.pick((_l = options.glassesColor) !== null && _l !== void 0 ? _l : [])) !== null && _m !== void 0 ? _m : 'transparent',
|
|
16
|
+
'hair': (_p = prng.pick((_o = options.hairColor) !== null && _o !== void 0 ? _o : [])) !== null && _p !== void 0 ? _p : 'transparent',
|
|
17
|
+
'mouth': (_r = prng.pick((_q = options.mouthColor) !== null && _q !== void 0 ? _q : [])) !== null && _r !== void 0 ? _r : 'transparent',
|
|
18
|
+
'shirt': (_t = prng.pick((_s = options.shirtColor) !== null && _s !== void 0 ? _s : [])) !== null && _t !== void 0 ? _t : 'transparent',
|
|
19
|
+
'eyes': (_v = prng.pick((_u = options.eyesColor) !== null && _u !== void 0 ? _u : [])) !== null && _v !== void 0 ? _v : 'transparent',
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
;
|
|
@@ -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/YHb4ShTgmO8Lqhkz1plLfL/%40dicebear%2Fmicah?node-id=259%3A555
|
|
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,78 @@
|
|
|
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/YHb4ShTgmO8Lqhkz1plLfL/%40dicebear%2Fmicah?node-id=259%3A555
|
|
6
|
+
*/
|
|
7
|
+
import { pickComponent } from './pickComponent.js';
|
|
8
|
+
export function getComponents({ prng, options }) {
|
|
9
|
+
const baseComponent = pickComponent({
|
|
10
|
+
prng,
|
|
11
|
+
group: 'base',
|
|
12
|
+
values: options.base
|
|
13
|
+
});
|
|
14
|
+
const mouthComponent = pickComponent({
|
|
15
|
+
prng,
|
|
16
|
+
group: 'mouth',
|
|
17
|
+
values: options.mouth
|
|
18
|
+
});
|
|
19
|
+
const eyebrowsComponent = pickComponent({
|
|
20
|
+
prng,
|
|
21
|
+
group: 'eyebrows',
|
|
22
|
+
values: options.eyebrows
|
|
23
|
+
});
|
|
24
|
+
const hairComponent = pickComponent({
|
|
25
|
+
prng,
|
|
26
|
+
group: 'hair',
|
|
27
|
+
values: options.hair
|
|
28
|
+
});
|
|
29
|
+
const eyesComponent = pickComponent({
|
|
30
|
+
prng,
|
|
31
|
+
group: 'eyes',
|
|
32
|
+
values: options.eyes
|
|
33
|
+
});
|
|
34
|
+
const noseComponent = pickComponent({
|
|
35
|
+
prng,
|
|
36
|
+
group: 'nose',
|
|
37
|
+
values: options.nose
|
|
38
|
+
});
|
|
39
|
+
const earsComponent = pickComponent({
|
|
40
|
+
prng,
|
|
41
|
+
group: 'ears',
|
|
42
|
+
values: options.ears
|
|
43
|
+
});
|
|
44
|
+
const shirtComponent = pickComponent({
|
|
45
|
+
prng,
|
|
46
|
+
group: 'shirt',
|
|
47
|
+
values: options.shirt
|
|
48
|
+
});
|
|
49
|
+
const earringsComponent = pickComponent({
|
|
50
|
+
prng,
|
|
51
|
+
group: 'earrings',
|
|
52
|
+
values: options.earrings
|
|
53
|
+
});
|
|
54
|
+
const glassesComponent = pickComponent({
|
|
55
|
+
prng,
|
|
56
|
+
group: 'glasses',
|
|
57
|
+
values: options.glasses
|
|
58
|
+
});
|
|
59
|
+
const facialHairComponent = pickComponent({
|
|
60
|
+
prng,
|
|
61
|
+
group: 'facialHair',
|
|
62
|
+
values: options.facialHair
|
|
63
|
+
});
|
|
64
|
+
return {
|
|
65
|
+
'base': baseComponent,
|
|
66
|
+
'mouth': mouthComponent,
|
|
67
|
+
'eyebrows': eyebrowsComponent,
|
|
68
|
+
'hair': prng.bool(options.hairProbability) ? hairComponent : undefined,
|
|
69
|
+
'eyes': eyesComponent,
|
|
70
|
+
'nose': noseComponent,
|
|
71
|
+
'ears': earsComponent,
|
|
72
|
+
'shirt': shirtComponent,
|
|
73
|
+
'earrings': prng.bool(options.earringsProbability) ? earringsComponent : undefined,
|
|
74
|
+
'glasses': prng.bool(options.glassesProbability) ? glassesComponent : undefined,
|
|
75
|
+
'facialHair': prng.bool(options.facialHairProbability) ? facialHairComponent : undefined,
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
;
|
|
@@ -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/YHb4ShTgmO8Lqhkz1plLfL/%40dicebear%2Fmicah?node-id=259%3A555
|
|
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/YHb4ShTgmO8Lqhkz1plLfL/%40dicebear%2Fmicah?node-id=259%3A555
|
|
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/micah",
|
|
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
|
}
|