@dicebear/pixel-art-neutral 5.0.0-alpha.0 → 5.0.0-alpha.12
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/lib/colors/glasses.d.ts +2 -0
- package/lib/colors/glasses.js +8 -0
- package/lib/colors/hair.d.ts +2 -0
- package/lib/colors/hair.js +12 -0
- package/lib/colors/index.d.ts +4 -0
- package/lib/colors/index.js +4 -0
- package/lib/colors/mouth.d.ts +2 -0
- package/lib/colors/mouth.js +6 -0
- package/lib/colors/skin.d.ts +2 -0
- package/lib/colors/skin.js +10 -0
- package/lib/components/eyebrows.d.ts +2 -0
- package/lib/components/eyebrows.js +15 -0
- package/lib/components/eyes.d.ts +2 -0
- package/lib/components/eyes.js +15 -0
- package/lib/components/glasses.d.ts +2 -0
- package/lib/components/glasses.js +9 -0
- package/lib/components/index.d.ts +4 -0
- package/lib/components/index.js +4 -0
- package/lib/components/mouth.d.ts +2 -0
- package/lib/components/mouth.js +22 -0
- package/{dist → lib}/core.d.ts +3 -3
- package/lib/core.js +65 -0
- package/{dist → lib}/hooks/onPostCreate.d.ts +11 -12
- package/lib/hooks/onPostCreate.js +3 -0
- package/{dist → lib}/hooks/onPreCreate.d.ts +9 -9
- package/lib/hooks/onPreCreate.js +3 -0
- package/{dist → lib}/index.d.ts +13 -13
- package/lib/index.js +13 -0
- package/{dist → lib}/meta/components.d.ts +4 -4
- package/lib/meta/components.js +18 -0
- package/lib/schema.d.ts +2 -0
- package/lib/schema.js +303 -0
- package/lib/types.d.ts +27 -0
- package/lib/types.js +1 -0
- package/{dist → lib}/utils/getColors.d.ts +8 -9
- package/lib/utils/getColors.js +25 -0
- package/{dist → lib}/utils/getComponents.d.ts +8 -9
- package/lib/utils/getComponents.js +31 -0
- package/{dist → lib}/utils/pickColor.d.ts +9 -9
- package/lib/utils/pickColor.js +13 -0
- package/{dist → lib}/utils/pickComponent.d.ts +9 -9
- package/lib/utils/pickComponent.js +14 -0
- package/package.json +18 -21
- package/dist/colors/glasses.d.ts +0 -2
- package/dist/colors/hair.d.ts +0 -2
- package/dist/colors/index.d.ts +0 -4
- package/dist/colors/mouth.d.ts +0 -2
- package/dist/colors/skin.d.ts +0 -2
- package/dist/components/eyebrows.d.ts +0 -2
- package/dist/components/eyes.d.ts +0 -2
- package/dist/components/glasses.d.ts +0 -2
- package/dist/components/index.d.ts +0 -4
- package/dist/components/mouth.d.ts +0 -2
- package/dist/index.es.js +0 -621
- package/dist/index.js +0 -628
- package/dist/index.umd.js +0 -12
- package/dist/options.d.ts +0 -16
- package/dist/static-types.d.ts +0 -16
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export const hair = {
|
|
2
|
+
variant01: 'rgba(202, 177, 136, 1)',
|
|
3
|
+
variant02: 'rgba(167, 137, 97, 1)',
|
|
4
|
+
variant03: 'rgba(131, 98, 59, 1)',
|
|
5
|
+
variant04: 'rgba(96, 58, 20, 1)',
|
|
6
|
+
variant05: 'rgba(96, 48, 21, 1)',
|
|
7
|
+
variant06: 'rgba(97, 38, 22, 1)',
|
|
8
|
+
variant07: 'rgba(97, 28, 23, 1)',
|
|
9
|
+
variant08: 'rgba(78, 26, 19, 1)',
|
|
10
|
+
variant09: 'rgba(59, 23, 14, 1)',
|
|
11
|
+
variant10: 'rgba(40, 21, 10, 1)',
|
|
12
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export const skin = {
|
|
2
|
+
variant01: 'rgba(255, 219, 172, 1)',
|
|
3
|
+
variant02: 'rgba(245, 207, 160, 1)',
|
|
4
|
+
variant03: 'rgba(234, 195, 147, 1)',
|
|
5
|
+
variant04: 'rgba(224, 182, 135, 1)',
|
|
6
|
+
variant05: 'rgba(203, 158, 110, 1)',
|
|
7
|
+
variant06: 'rgba(182, 134, 85, 1)',
|
|
8
|
+
variant07: 'rgba(162, 109, 61, 1)',
|
|
9
|
+
variant08: 'rgba(141, 85, 36, 1)',
|
|
10
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export const eyebrows = {
|
|
2
|
+
variant13: (components, colors) => `<g fill-rule="evenodd" clip-rule="evenodd"><path d="M8 4v1H7v1H5V5h2V4h1Zm4 0h1v1h2v1h-2V5h-1V4Z" fill="${colors.hair.value}"/><path d="M8 4v1H7v1H5V5h2V4h1Zm4 0h1v1h2v1h-2V5h-1V4Z" fill="#000" fill-opacity=".1"/></g>`,
|
|
3
|
+
variant12: (components, colors) => `<g fill-rule="evenodd" clip-rule="evenodd"><path d="M6 5h3v2H8V6H6V5Zm5 0h3v1h-2v1h-1V5Z" fill="${colors.hair.value}"/><path d="M6 5h3v2H8V6H6V5Zm5 0h3v1h-2v1h-1V5Z" fill="#000" fill-opacity=".1"/></g>`,
|
|
4
|
+
variant11: (components, colors) => `<g fill-rule="evenodd" clip-rule="evenodd"><path d="M5 5h3v1h1v1H8V6H5V5Zm10 0h-3v1h-1v1h1V6h3V5Z" fill="${colors.hair.value}"/><path d="M5 5h3v1h1v1H8V6H5V5Zm10 0h-3v1h-1v1h1V6h3V5Z" fill="#000" fill-opacity=".1"/></g>`,
|
|
5
|
+
variant10: (components, colors) => `<g fill-rule="evenodd" clip-rule="evenodd"><path d="M6 5H4v2h1V6h1V5Zm8 0h2v2h-1V6h-1V5Z" fill="${colors.hair.value}"/><path d="M6 5H4v2h1V6h1V5Zm8 0h2v2h-1V6h-1V5Z" fill="#000" fill-opacity=".1"/></g>`,
|
|
6
|
+
variant09: (components, colors) => `<g fill-rule="evenodd" clip-rule="evenodd"><path d="M5 6h2v1H5V6Zm8 0h2v1h-2V6Z" fill="${colors.hair.value}"/><path d="M5 6h2v1H5V6Zm8 0h2v1h-2V6Z" fill="#000" fill-opacity=".1"/></g>`,
|
|
7
|
+
variant08: (components, colors) => `<g fill-rule="evenodd" clip-rule="evenodd"><path d="M6 5h1v1h1v1H5V6h1V5Zm7 0h1v1h1v1h-3V6h1V5Z" fill="${colors.hair.value}"/><path d="M6 5h1v1h1v1H5V6h1V5Zm7 0h1v1h1v1h-3V6h1V5Z" fill="#000" fill-opacity=".1"/></g>`,
|
|
8
|
+
variant07: (components, colors) => `<g fill-rule="evenodd" clip-rule="evenodd"><path d="M6 5h2v1h1v1H8V6H6V5Zm8 0h-2v1h-1v1h1V6h2V5Z" fill="${colors.hair.value}"/><path d="M6 5h2v1h1v1H8V6H6V5Zm8 0h-2v1h-1v1h1V6h2V5Z" fill="#000" fill-opacity=".1"/></g>`,
|
|
9
|
+
variant06: (components, colors) => `<g fill-rule="evenodd" clip-rule="evenodd"><path d="M12 7V6h1V5h1v1h1v1h-1V6h-1v1h-1ZM5 7V6h1V5h1v1h1v1H7V6H6v1H5Z" fill="${colors.hair.value}"/><path d="M12 7V6h1V5h1v1h1v1h-1V6h-1v1h-1ZM5 7V6h1V5h1v1h1v1H7V6H6v1H5Z" fill="#000" fill-opacity=".1"/></g>`,
|
|
10
|
+
variant05: (components, colors) => `<g fill-rule="evenodd" clip-rule="evenodd"><path d="M7 5v1H5v1H4V6h1V5h2Zm6 0h2v1h1v1h-1V6h-2V5Z" fill="${colors.hair.value}"/><path d="M7 5v1H5v1H4V6h1V5h2Zm6 0h2v1h1v1h-1V6h-2V5Z" fill="#000" fill-opacity=".1"/></g>`,
|
|
11
|
+
variant04: (components, colors) => `<g fill-rule="evenodd" clip-rule="evenodd"><path d="M4 7V5h3v1H5v1H4Zm12-2v2h-1V6h-2V5h3Z" fill="${colors.hair.value}"/><path d="M4 7V5h3v1H5v1H4Zm12-2v2h-1V6h-2V5h3Z" fill="#000" fill-opacity=".1"/></g>`,
|
|
12
|
+
variant03: (components, colors) => `<g fill-rule="evenodd" clip-rule="evenodd"><path d="M7 5h1v1h1v1H8V6H7V5Zm6 0v1h-1v1h-1V6h1V5h1Z" fill="${colors.hair.value}"/><path d="M7 5h1v1h1v1H8V6H7V5Zm6 0v1h-1v1h-1V6h1V5h1Z" fill="#000" fill-opacity=".1"/></g>`,
|
|
13
|
+
variant02: (components, colors) => `<g fill-rule="evenodd" clip-rule="evenodd"><path d="M4 7V6h1V5h1v1H5v1H4Zm10-2h1v1h1v1h-1V6h-1V5Z" fill="${colors.hair.value}"/><path d="M4 7V6h1V5h1v1H5v1H4Zm10-2h1v1h1v1h-1V6h-1V5Z" fill="#000" fill-opacity=".1"/></g>`,
|
|
14
|
+
variant01: (components, colors) => `<g fill-rule="evenodd" clip-rule="evenodd"><path d="M7 5v1H5v1H4V6h1V5h2Zm7 0v1h-2v1h-1V6h1V5h2Z" fill="${colors.hair.value}"/><path d="M7 5v1H5v1H4V6h1V5h2Zm7 0v1h-2v1h-1V6h1V5h2Z" fill="#000" fill-opacity=".1"/></g>`,
|
|
15
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export const eyes = {
|
|
2
|
+
variant13: (components, colors) => `<g fill-rule="evenodd" clip-rule="evenodd"><path d="M5 9V7h3v2H5Zm7-2h3v2h-3V7Z" fill="#fff"/><path d="M7 8v1h1V8H7Zm7 0h1v1h-1V8Z" fill="#000"/></g>`,
|
|
3
|
+
variant12: (components, colors) => `<g fill-rule="evenodd" clip-rule="evenodd"><path d="M5 7h3v2H5V7Zm7 0h3v2h-3V7Z" fill="#fff"/><path d="M6 8h1v1H6V8Zm7 1V8h1v1h-1Z" fill="#000"/></g>`,
|
|
4
|
+
variant11: (components, colors) => `<g fill-rule="evenodd" clip-rule="evenodd"><path d="M5 7h3v2H5V7Zm7 0h3v2h-3V7Z" fill="#fff"/><path d="M7 8h1v1H7V8Zm5 0h1v1h-1V8Z" fill="#000"/></g>`,
|
|
5
|
+
variant10: (components, colors) => `<g fill-rule="evenodd" clip-rule="evenodd"><path d="M6 7h1v1h1v1H6V7Zm6 0h1v1h1v1h-2V7Z" fill="#fff"/><path d="M6 8h1v1H6V8Zm6 0h1v1h-1V8Z" fill="#000"/></g>`,
|
|
6
|
+
variant09: (components, colors) => `<g fill-rule="evenodd" clip-rule="evenodd"><path d="M5 8h2v1H5V8Zm7 0h2v1h-2V8Z" fill="#fff"/><path d="M7 8h1v1H7V8Zm7 0h1v1h-1V8Z" fill="#000"/></g>`,
|
|
7
|
+
variant08: (components, colors) => `<g fill-rule="evenodd" clip-rule="evenodd"><path d="M6 8h1v1H6V8Zm7 0h1v1h-1V8Z" fill="#fff"/><path d="M7 8h1v1H7V8Zm5 0h1v1h-1V8Z" fill="#000"/></g>`,
|
|
8
|
+
variant07: (components, colors) => `<g fill-rule="evenodd" clip-rule="evenodd"><path d="M5 7v1h3V7H5Zm7 0h3v1h-3V7Z" fill="#fff"/><path d="M5 9V8h1V7h1v1h1v1H5Zm7 0V8h1V7h1v1h1v1h-3Z" fill="#000"/><path d="M5 9V8h1V7h1v1h1v1H7V8H6v1H5Zm7 0V8h1V7h1v1h1v1h-1V8h-1v1h-1Z" fill="#fff" fill-opacity=".5"/></g>`,
|
|
9
|
+
variant06: (components, colors) => `<g fill-rule="evenodd" clip-rule="evenodd"><path d="M5 8h3v1H5V8Zm7 0h3v1h-3V8Z" fill="#fff"/><path d="M6 8h1v1H6V8Zm7 0h1v1h-1V8Z" fill="#000"/></g>`,
|
|
10
|
+
variant05: (components, colors) => `<g fill-rule="evenodd" clip-rule="evenodd"><path d="M5 7h3v2H5V7Zm7 0h3v2h-3V7Z" fill="#fff"/><path d="M5 8h2v1H5V8Zm7 0h2v1h-2V8Z" fill="#000"/></g>`,
|
|
11
|
+
variant04: (components, colors) => `<g fill-rule="evenodd" clip-rule="evenodd"><path d="M5 7h3v3H5V7Zm7 0h3v3h-3V7Z" fill="#fff"/><path d="M6 8h1v1H6V8Zm7 0h1v1h-1V8Z" fill="#000"/></g>`,
|
|
12
|
+
variant03: (components, colors) => `<g fill-rule="evenodd" clip-rule="evenodd"><path d="M5 7h3v3H5V7Zm7 0h3v3h-3V7Z" fill="#fff"/><path d="M6 7h2v2H6V7Zm7 0h2v2h-2V7Z" fill="#000"/><path d="M6 7v1h1v1h1V8H7V7H6Zm7 0v1h1v1h1V8h-1V7h-1Z" fill="#fff" fill-opacity=".4"/><path d="M7 7v1h1V7H7Zm7 0h1v1h-1V7Z" fill="#fff" fill-opacity=".7"/></g>`,
|
|
13
|
+
variant02: (components, colors) => `<g fill-rule="evenodd" clip-rule="evenodd"><path d="M5 7h3v3H5V7Zm7 0h3v3h-3V7Z" fill="#fff"/><path d="M5 8h2v1H5V8Zm7 0h2v1h-2V8Z" fill="#000"/><path d="M5 8h1v1H5V8Zm7 0h1v1h-1V8Z" fill="#fff" fill-opacity=".7"/></g>`,
|
|
14
|
+
variant01: (components, colors) => `<g fill-rule="evenodd" clip-rule="evenodd"><path d="M6 7h1v2H5V8h1V7Zm7 0h1v2h-2V8h1V7Z" fill="#fff"/><path d="M7 7v1H6v1h2V7H7Zm7 0v1h-1v1h2V7h-1Z" fill="#000"/><path d="M7 7v1h1V7H7ZM6 8v1h1V8H6Zm8-1v1h1V7h-1Zm-1 1v1h1V8h-1Z" fill="#fff" fill-opacity=".5"/></g>`,
|
|
15
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export const glasses = {
|
|
2
|
+
variant07: (components, colors) => `<g fill-rule="evenodd" clip-rule="evenodd"><path opacity=".2" d="M5 7h3v3H5V7Zm7 0h3v3h-3V7Z" fill="#fff"/><path opacity=".2" d="M7 7h1v1H7V7Zm7 0h1v1h-1V7Z" fill="#fff"/><path d="M12 10V7h3v3h-3Zm-1-4v1H9V6H4v1H3v1h1v3h5V8h2v3h5V8h1V7h-1V6h-5Zm-6 4V7h3v3H5Z" fill="${colors.glasses.value}"/><path d="M3 7h1v1H3V7Zm6 0h2v1H9V7Zm7 0h1v1h-1V7Z" fill="#fff" fill-opacity=".2"/></g>`,
|
|
3
|
+
variant06: (components, colors) => `<g fill-rule="evenodd" clip-rule="evenodd"><path opacity=".2" d="M5 7h3v2H5V7Zm7 0h3v2h-3V7Z" fill="#fff"/><path opacity=".2" d="M7 7h1v1H7V7Zm7 0h1v1h-1V7Z" fill="#fff"/><path d="M5 7v2h3V7H5ZM4 6v1H3v1h1v1h1v1h3V9h1V8h2v1h1v1h3V9h1V8h1V7h-1V6h-5v1H9V6H4Zm8 1v2h3V7h-3Z" fill="${colors.glasses.value}"/><path d="M3 7h1v1H3V7Zm6 0h2v1H9V7Zm7 0h1v1h-1V7Z" fill="#fff" fill-opacity=".2"/></g>`,
|
|
4
|
+
variant05: (components, colors) => `<g fill-rule="evenodd" clip-rule="evenodd"><path opacity=".2" d="M5 8h3v1H5V8Zm7 0h3v1h-3V8Z" fill="#fff"/><path opacity=".2" d="M7 8h1v1H7V8Zm7 0h1v1h-1V8Z" fill="#fff"/><path d="M5 8v1h3V8H5ZM3 7v1h1v1h1v1h3V9h1V8h2v1h1v1h3V9h1V8h1V7H3Zm9 1v1h3V8h-3Z" fill="${colors.glasses.value}"/><path d="M3 7v1h1V7H3Zm6 0v1h2V7H9Zm7 0v1h1V7h-1Z" fill="#fff" fill-opacity=".2"/></g>`,
|
|
5
|
+
variant04: (components, colors) => `<g fill-rule="evenodd" clip-rule="evenodd"><path opacity=".2" d="M5 7h3v2H5V7Zm7 0h3v2h-3V7Z" fill="#fff"/><path opacity=".2" d="M7 7h1v1H7V7Zm7 0h1v1h-1V7Z" fill="#fff"/><path d="M12 7v2h3V7h-3ZM8 6H5v1H3v1h1v1h1v1h3V9h1V8h2v1h1v1h3V9h1V8h1V7h-2V6h-3v1H8V6ZM5 7v2h3V7H5Z" fill="${colors.glasses.value}"/><path d="M3 7h1v1H3V7Zm6 0h2v1H9V7Zm7 0h1v1h-1V7Z" fill="#fff" fill-opacity=".2"/></g>`,
|
|
6
|
+
variant03: (components, colors) => `<g fill-rule="evenodd" clip-rule="evenodd"><path d="M4 8H3V7h1V6h5v1h2V6h5v1h1v1h-1v2h-5V8H9v2H4V8Zm1 0V7h3v2H5V8Zm7-1v2h3V7h-3Z" fill="${colors.glasses.value}"/><path opacity=".2" d="M5 7h3v2H5V7Zm7 0h3v2h-3V7Z" fill="#fff"/><path opacity=".2" d="M14 7h1v1h-1V7ZM7 7h1v1H7V7Z" fill="#fff"/><path d="M3 8V7h1v1H3Zm6-1v1h2V7H9Zm7 0v1h1V7h-1Z" fill="#fff" fill-opacity=".2"/></g>`,
|
|
7
|
+
variant02: (components, colors) => `<g fill-rule="evenodd" clip-rule="evenodd"><path d="M4 8H3V7h14v1h-1v2h-5V8H9v2H4V8Zm1 0h3v1H5V8Zm7 0h3v1h-3V8Z" fill="${colors.glasses.value}"/><path opacity=".2" d="M7 8v1h1V8H7Zm7 0v1h1V8h-1Z" fill="#fff"/><path opacity=".2" d="M5 8h3v1H5V8Zm7 0h3v1h-3V8Z" fill="#fff"/><path d="M3 7v1h1V7H3Zm13 0v1h1V7h-1ZM9 7v1h2V7H9Z" fill="#fff" fill-opacity=".2"/></g>`,
|
|
8
|
+
variant01: (components, colors) => `<path d="M3 8V7h1V6h2v1h1V6h2v1h2V6h2v1h1V6h2v1h1v1h-1v1h-1v1h-1v1h-1v-1h-1V9h-1V8H9v1H8v1H7v1H6v-1H5V9H4V8H3Z" fill="${colors.glasses.value}"/><path fill-rule="evenodd" clip-rule="evenodd" d="M3 7v1h1V7h1V6H4v1H3Zm5-1v1h1v1h2V7h1V6h-1v1H9V6H8Zm7 0v1h1v1h1V7h-1V6h-1Z" fill="#fff" fill-opacity=".2"/>`,
|
|
9
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export const mouth = {
|
|
2
|
+
surprised03: (components, colors) => `<path d="M9 12v2h2v-2H9Z" fill="${colors.mouth.value}"/>`,
|
|
3
|
+
surprised02: (components, colors) => `<path d="M9 13v1h1v-1H9Z" fill="${colors.mouth.value}"/>`,
|
|
4
|
+
happy09: (components, colors) => `<path d="M7 12v1h1v1h4v-1H8v-1H7Z" fill="${colors.mouth.value}"/>`,
|
|
5
|
+
happy08: (components, colors) => `<path d="M10 12v1H9v1h2v-2h-1Z" fill="${colors.mouth.value}"/>`,
|
|
6
|
+
happy07: (components, colors) => `<path d="M8 13v1h4v-1h1v-1h-1v1H8Z" fill="${colors.mouth.value}"/>`,
|
|
7
|
+
happy06: (components, colors) => `<path d="M9 12v2h2v-1h-1v-1H9Z" fill="${colors.mouth.value}"/><path d="M11 14v-1h-1v-1H9v1h1v1h1Z" fill="#fff" fill-opacity=".2"/>`,
|
|
8
|
+
happy05: (components, colors) => `<path d="M8 12v1h1v1h2v-1h1v-1H8Z" fill="${colors.mouth.value}"/>`,
|
|
9
|
+
happy04: (components, colors) => `<path d="M9 13v1h2v-1h1v-1h-1v1H9Z" fill="${colors.mouth.value}"/>`,
|
|
10
|
+
happy03: (components, colors) => `<path d="M8 12v1h1v1h2v-1H9v-1H8Z" fill="${colors.mouth.value}"/>`,
|
|
11
|
+
happy02: (components, colors) => `<path d="M8 12v1h1v1h2v-1h1v-1h-1v-1H9v1H8Z" fill="${colors.mouth.value}"/><path d="M9 12v1h2v-1H9Z" fill="#fff"/>`,
|
|
12
|
+
happy01: (components, colors) => `<path d="M8 12v1h1v1h2v-1h1v-1h-1v-1H9v1H8Z" fill="${colors.mouth.value}"/><path d="M9 12v1h2v-1H9Z" fill="#fff" fill-opacity=".2"/>`,
|
|
13
|
+
sad08: (components, colors) => `<path d="M9 12v1H8v1h4v-1h-1v-1H9Z" fill="${colors.mouth.value}"/>`,
|
|
14
|
+
sad07: (components, colors) => `<path d="M11 12v1H9v1H8v-1h1v-1h2Z" fill="${colors.mouth.value}"/>`,
|
|
15
|
+
sad06: (components, colors) => `<path d="M8 12h3v1H8v-1Z" fill="${colors.mouth.value}"/>`,
|
|
16
|
+
sad05: (components, colors) => `<path d="M8 12h4v1H8v-1Z" fill="${colors.mouth.value}"/>`,
|
|
17
|
+
sad04: (components, colors) => `<path d="M9 12h2v1H9v-1Z" fill="${colors.mouth.value}"/>`,
|
|
18
|
+
sad03: (components, colors) => `<path d="M8 12v1h3v1h1v-1h-1v-1H8Z" fill="${colors.mouth.value}"/>`,
|
|
19
|
+
sad02: (components, colors) => `<path d="M8 13v1h1v-1h3v-1H9v1H8Z" fill="${colors.mouth.value}"/>`,
|
|
20
|
+
sad01: (components, colors) => `<path d="M10 12v1h1v1h1v-2h-2Z" fill="${colors.mouth.value}"/>`,
|
|
21
|
+
surprised01: (components, colors) => `<path d="M8 12v2h4v-2H8Z" fill="#fff"/>`,
|
|
22
|
+
};
|
package/{dist → lib}/core.d.ts
RENAMED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { Style } from '@dicebear/core';
|
|
2
|
-
import type { Options } from './
|
|
3
|
-
export declare const style: Style<Options>;
|
|
1
|
+
import type { Style } from '@dicebear/core';
|
|
2
|
+
import type { Options } from './types.js';
|
|
3
|
+
export declare const style: Style<Options>;
|
package/lib/core.js
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { schema } from './schema.js';
|
|
2
|
+
import { getComponents } from './utils/getComponents.js';
|
|
3
|
+
import { getColors } from './utils/getColors.js';
|
|
4
|
+
import { onPreCreate } from './hooks/onPreCreate.js';
|
|
5
|
+
import { onPostCreate } from './hooks/onPostCreate.js';
|
|
6
|
+
import { dimensions } from './meta/components.js';
|
|
7
|
+
export const style = {
|
|
8
|
+
meta: {
|
|
9
|
+
title: 'Pixel Art - Neutral',
|
|
10
|
+
creator: 'Plastic Jam',
|
|
11
|
+
license: {
|
|
12
|
+
name: 'MIT',
|
|
13
|
+
url: 'https://github.com/dicebear/dicebear/blob/main/packages/%40dicebear/pixel-art-neutral/LICENSE',
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
schema: schema,
|
|
17
|
+
create: ({ prng, options }) => {
|
|
18
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
19
|
+
onPreCreate({ prng, options, preview: false });
|
|
20
|
+
const components = getComponents({ prng, options });
|
|
21
|
+
const colors = getColors({ prng, options });
|
|
22
|
+
onPostCreate({ prng, options, components, colors, preview: false });
|
|
23
|
+
options.backgroundColor = [colors.background.value];
|
|
24
|
+
return {
|
|
25
|
+
attributes: {
|
|
26
|
+
viewBox: '0 0 14 14',
|
|
27
|
+
fill: 'none',
|
|
28
|
+
'shape-rendering': 'auto',
|
|
29
|
+
},
|
|
30
|
+
body: `<g transform="translate(-3 -3)">${(_b = (_a = components.eyes) === null || _a === void 0 ? void 0 : _a.value(components, colors)) !== null && _b !== void 0 ? _b : ''}</g><g transform="translate(-3 -3)">${(_d = (_c = components.eyebrows) === null || _c === void 0 ? void 0 : _c.value(components, colors)) !== null && _d !== void 0 ? _d : ''}</g><g transform="translate(-3 -2)">${(_f = (_e = components.mouth) === null || _e === void 0 ? void 0 : _e.value(components, colors)) !== null && _f !== void 0 ? _f : ''}</g><g transform="translate(-3 -3)">${(_h = (_g = components.glasses) === null || _g === void 0 ? void 0 : _g.value(components, colors)) !== null && _h !== void 0 ? _h : ''}</g>`,
|
|
31
|
+
};
|
|
32
|
+
},
|
|
33
|
+
preview: ({ prng, options, property }) => {
|
|
34
|
+
var _a, _b;
|
|
35
|
+
const componentGroup = property.toString();
|
|
36
|
+
const colorGroup = property.toString().replace(/Color$/, '');
|
|
37
|
+
onPreCreate({ prng, options, preview: true });
|
|
38
|
+
const components = getComponents({ prng, options });
|
|
39
|
+
const colors = getColors({ prng, options });
|
|
40
|
+
onPostCreate({ prng, options, components, colors, preview: true });
|
|
41
|
+
options.backgroundColor = [colors.background.value];
|
|
42
|
+
if (componentGroup in components) {
|
|
43
|
+
const { width, height } = dimensions[componentGroup];
|
|
44
|
+
return {
|
|
45
|
+
attributes: {
|
|
46
|
+
viewBox: `0 0 ${width} ${height}`,
|
|
47
|
+
fill: 'none',
|
|
48
|
+
'shape-rendering': 'auto',
|
|
49
|
+
},
|
|
50
|
+
body: (_b = (_a = components[componentGroup]) === null || _a === void 0 ? void 0 : _a.value(components, colors)) !== null && _b !== void 0 ? _b : '',
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
if (colorGroup in colors) {
|
|
54
|
+
return {
|
|
55
|
+
attributes: {
|
|
56
|
+
viewBox: `0 0 1 1`,
|
|
57
|
+
fill: 'none',
|
|
58
|
+
'shape-rendering': 'auto',
|
|
59
|
+
},
|
|
60
|
+
body: `<rect width="1" height="1" fill="${colors[colorGroup].value}" />`,
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
return undefined;
|
|
64
|
+
},
|
|
65
|
+
};
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { Prng, StyleOptions } from '@dicebear/core';
|
|
2
|
-
import { Options } from '../
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
};
|
|
11
|
-
export
|
|
12
|
-
export {};
|
|
1
|
+
import { Prng, StyleOptions } from '@dicebear/core';
|
|
2
|
+
import { Options, ColorPickCollection, ComponentPickCollection } from '../types.js';
|
|
3
|
+
declare type Props = {
|
|
4
|
+
prng: Prng;
|
|
5
|
+
options: StyleOptions<Options>;
|
|
6
|
+
components: ComponentPickCollection;
|
|
7
|
+
colors: ColorPickCollection;
|
|
8
|
+
preview: boolean;
|
|
9
|
+
};
|
|
10
|
+
export declare function onPostCreate({ prng, options, components, colors, preview, }: Props): void;
|
|
11
|
+
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Prng, StyleOptions } from '@dicebear/core';
|
|
2
|
-
import { Options } from '../
|
|
3
|
-
declare type Props = {
|
|
4
|
-
prng: Prng;
|
|
5
|
-
options: StyleOptions<Options>;
|
|
6
|
-
preview: boolean;
|
|
7
|
-
};
|
|
8
|
-
export declare function onPreCreate({ prng, options, preview }: Props): void;
|
|
9
|
-
export {};
|
|
1
|
+
import { Prng, StyleOptions } from '@dicebear/core';
|
|
2
|
+
import { Options } from '../types.js';
|
|
3
|
+
declare type Props = {
|
|
4
|
+
prng: Prng;
|
|
5
|
+
options: StyleOptions<Options>;
|
|
6
|
+
preview: boolean;
|
|
7
|
+
};
|
|
8
|
+
export declare function onPreCreate({ prng, options, preview }: Props): void;
|
|
9
|
+
export {};
|
package/{dist → lib}/index.d.ts
RENAMED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Pixel Art - Neutral (@dicebear/pixel-art-neutral)
|
|
3
|
-
*
|
|
4
|
-
* Code licensed under MIT License.
|
|
5
|
-
* Copyright (c) 2021 Florian Körner
|
|
6
|
-
* Copyright (c) 2021 Plastic Jam
|
|
7
|
-
*
|
|
8
|
-
* Design "Pixel Art - Neutral" by Plastic Jam licensed under MIT.
|
|
9
|
-
* License: https://github.com/dicebear/dicebear/blob/main/packages/%40dicebear/pixel-art-neutral/LICENSE
|
|
10
|
-
*/
|
|
11
|
-
declare
|
|
12
|
-
export { create, preview, meta, schema };
|
|
13
|
-
export { Options } from './
|
|
1
|
+
/*!
|
|
2
|
+
* Pixel Art - Neutral (@dicebear/pixel-art-neutral)
|
|
3
|
+
*
|
|
4
|
+
* Code licensed under MIT License.
|
|
5
|
+
* Copyright (c) 2021 Florian Körner
|
|
6
|
+
* Copyright (c) 2021 Plastic Jam
|
|
7
|
+
*
|
|
8
|
+
* Design "Pixel Art - Neutral" by Plastic Jam licensed under MIT.
|
|
9
|
+
* License: https://github.com/dicebear/dicebear/blob/main/packages/%40dicebear/pixel-art-neutral/LICENSE
|
|
10
|
+
*/
|
|
11
|
+
declare const create: import("@dicebear/core").StyleCreate<import("./types.js").Options>, preview: import("@dicebear/core").StylePreview<import("./types.js").Options> | undefined, meta: import("@dicebear/core").StyleMeta, schema: import("json-schema").JSONSchema7;
|
|
12
|
+
export { create, preview, meta, schema };
|
|
13
|
+
export type { Options } from './types.js';
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Pixel Art - Neutral (@dicebear/pixel-art-neutral)
|
|
3
|
+
*
|
|
4
|
+
* Code licensed under MIT License.
|
|
5
|
+
* Copyright (c) 2021 Florian Körner
|
|
6
|
+
* Copyright (c) 2021 Plastic Jam
|
|
7
|
+
*
|
|
8
|
+
* Design "Pixel Art - Neutral" by Plastic Jam licensed under MIT.
|
|
9
|
+
* License: https://github.com/dicebear/dicebear/blob/main/packages/%40dicebear/pixel-art-neutral/LICENSE
|
|
10
|
+
*/
|
|
11
|
+
import { style } from './core.js';
|
|
12
|
+
const { create, preview, meta, schema } = style;
|
|
13
|
+
export { create, preview, meta, schema };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const dimensions: Record<string, {
|
|
2
|
-
width: number;
|
|
3
|
-
height: number;
|
|
4
|
-
}>;
|
|
1
|
+
export declare const dimensions: Record<string, {
|
|
2
|
+
width: number;
|
|
3
|
+
height: number;
|
|
4
|
+
}>;
|
package/lib/schema.d.ts
ADDED