@dicebear/notionists 6.0.0-alpha.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 +34 -0
- package/README.md +30 -0
- package/lib/components/base.d.ts +8 -0
- package/lib/components/base.js +9 -0
- package/lib/components/beard.d.ts +8 -0
- package/lib/components/beard.js +20 -0
- package/lib/components/body.d.ts +8 -0
- package/lib/components/body.js +33 -0
- package/lib/components/bodyIcon.d.ts +8 -0
- package/lib/components/bodyIcon.js +11 -0
- package/lib/components/brows.d.ts +8 -0
- package/lib/components/brows.js +21 -0
- package/lib/components/eyes.d.ts +8 -0
- package/lib/components/eyes.js +13 -0
- package/lib/components/gesture.d.ts +8 -0
- package/lib/components/gesture.js +18 -0
- package/lib/components/glasses.d.ts +8 -0
- package/lib/components/glasses.js +19 -0
- package/lib/components/hair.d.ts +8 -0
- package/lib/components/hair.js +72 -0
- package/lib/components/index.d.ts +17 -0
- package/lib/components/index.js +17 -0
- package/lib/components/lips.d.ts +8 -0
- package/lib/components/lips.js +38 -0
- package/lib/components/nose.d.ts +8 -0
- package/lib/components/nose.js +28 -0
- package/lib/index.d.ts +23 -0
- package/lib/index.js +42 -0
- package/lib/schema.d.ts +8 -0
- package/lib/schema.js +533 -0
- package/lib/types.d.ts +32 -0
- package/lib/types.js +7 -0
- package/lib/utils/convertColor.d.ts +7 -0
- package/lib/utils/convertColor.js +9 -0
- package/lib/utils/getColors.d.ts +14 -0
- package/lib/utils/getColors.js +10 -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 +48 -0
|
@@ -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/gpLBQuklPE2XsOskwwv7QW
|
|
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 bodyComponent = pickComponent({
|
|
15
|
+
prng,
|
|
16
|
+
group: 'body',
|
|
17
|
+
values: options.body,
|
|
18
|
+
});
|
|
19
|
+
const hairComponent = pickComponent({
|
|
20
|
+
prng,
|
|
21
|
+
group: 'hair',
|
|
22
|
+
values: options.hair,
|
|
23
|
+
});
|
|
24
|
+
const lipsComponent = pickComponent({
|
|
25
|
+
prng,
|
|
26
|
+
group: 'lips',
|
|
27
|
+
values: options.lips,
|
|
28
|
+
});
|
|
29
|
+
const beardComponent = pickComponent({
|
|
30
|
+
prng,
|
|
31
|
+
group: 'beard',
|
|
32
|
+
values: options.beard,
|
|
33
|
+
});
|
|
34
|
+
const noseComponent = pickComponent({
|
|
35
|
+
prng,
|
|
36
|
+
group: 'nose',
|
|
37
|
+
values: options.nose,
|
|
38
|
+
});
|
|
39
|
+
const eyesComponent = pickComponent({
|
|
40
|
+
prng,
|
|
41
|
+
group: 'eyes',
|
|
42
|
+
values: options.eyes,
|
|
43
|
+
});
|
|
44
|
+
const glassesComponent = pickComponent({
|
|
45
|
+
prng,
|
|
46
|
+
group: 'glasses',
|
|
47
|
+
values: options.glasses,
|
|
48
|
+
});
|
|
49
|
+
const browsComponent = pickComponent({
|
|
50
|
+
prng,
|
|
51
|
+
group: 'brows',
|
|
52
|
+
values: options.brows,
|
|
53
|
+
});
|
|
54
|
+
const gestureComponent = pickComponent({
|
|
55
|
+
prng,
|
|
56
|
+
group: 'gesture',
|
|
57
|
+
values: options.gesture,
|
|
58
|
+
});
|
|
59
|
+
const bodyIconComponent = pickComponent({
|
|
60
|
+
prng,
|
|
61
|
+
group: 'bodyIcon',
|
|
62
|
+
values: options.bodyIcon,
|
|
63
|
+
});
|
|
64
|
+
return {
|
|
65
|
+
'base': baseComponent,
|
|
66
|
+
'body': bodyComponent,
|
|
67
|
+
'hair': hairComponent,
|
|
68
|
+
'lips': lipsComponent,
|
|
69
|
+
'beard': prng.bool(options.beardProbability) ? beardComponent : undefined,
|
|
70
|
+
'nose': noseComponent,
|
|
71
|
+
'eyes': eyesComponent,
|
|
72
|
+
'glasses': prng.bool(options.glassesProbability) ? glassesComponent : undefined,
|
|
73
|
+
'brows': browsComponent,
|
|
74
|
+
'gesture': prng.bool(options.gestureProbability) ? gestureComponent : undefined,
|
|
75
|
+
'bodyIcon': prng.bool(options.bodyIconProbability) ? bodyIconComponent : 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/gpLBQuklPE2XsOskwwv7QW
|
|
6
|
+
*/
|
|
7
|
+
import type { Prng } from '@dicebear/core';
|
|
8
|
+
import type { ComponentPick } from '../types.js';
|
|
9
|
+
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/gpLBQuklPE2XsOskwwv7QW
|
|
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
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@dicebear/notionists",
|
|
3
|
+
"version": "6.0.0-alpha.0",
|
|
4
|
+
"description": "Avatar style for DiceBear",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"dicebear"
|
|
7
|
+
],
|
|
8
|
+
"bugs": {
|
|
9
|
+
"url": "https://github.com/dicebear/dicebear/issues"
|
|
10
|
+
},
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "git+https://github.com/dicebear/dicebear.git"
|
|
14
|
+
},
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"type": "module",
|
|
17
|
+
"main": "./lib/index.js",
|
|
18
|
+
"exports": "./lib/index.js",
|
|
19
|
+
"types": "./lib/index.d.ts",
|
|
20
|
+
"files": [
|
|
21
|
+
"LICENSE",
|
|
22
|
+
"lib",
|
|
23
|
+
"README.md"
|
|
24
|
+
],
|
|
25
|
+
"scripts": {
|
|
26
|
+
"prebuild": "del-cli lib",
|
|
27
|
+
"build": "tsc",
|
|
28
|
+
"prepublishOnly": "npm run build",
|
|
29
|
+
"test": "uvu tests"
|
|
30
|
+
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"@dicebear/core": "6.0.0-alpha.0",
|
|
33
|
+
"@tsconfig/recommended": "^1.0.2",
|
|
34
|
+
"del-cli": "^4.0.1",
|
|
35
|
+
"typescript": "^5.0.2",
|
|
36
|
+
"uvu": "^0.5.6"
|
|
37
|
+
},
|
|
38
|
+
"peerDependencies": {
|
|
39
|
+
"@dicebear/core": "^6.0.0"
|
|
40
|
+
},
|
|
41
|
+
"engines": {
|
|
42
|
+
"node": ">=16.0.0"
|
|
43
|
+
},
|
|
44
|
+
"publishConfig": {
|
|
45
|
+
"access": "public"
|
|
46
|
+
},
|
|
47
|
+
"gitHead": "64646747611ff92b5028205ef3e509be5ff2060b"
|
|
48
|
+
}
|