@dicebear/shapes 5.0.0-alpha.9 → 5.2.1

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 CHANGED
@@ -1,7 +1,19 @@
1
+ Licenses
2
+ --------
3
+
4
+ # Design
5
+ Applies to all design files in this package.
6
+
7
+ Source: Shapes (https://dicebear.com)
8
+ Designer: Florian Körner (https://dicebear.com)
9
+ License: CC0 1.0 (https://creativecommons.org/publicdomain/zero/1.0/)
10
+
11
+ # Code
12
+ Applies to all non-design files in this package.
13
+
1
14
  MIT License
2
15
 
3
- Copyright (c) 2021 Florian Körner
4
- Copyright (c) 2021 Daniel Mester Pirttijärvi
16
+ Copyright (c) 2023 Florian Körner
5
17
 
6
18
  Permission is hereby granted, free of charge, to any person obtaining a copy
7
19
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -1,8 +1,26 @@
1
- <h1 align="center"><img src="./tests/svg/0.svg" width="124" /> <br />Shapes</h1>
1
+ <h1 align="center"><img src="https://dicebear.com/logo-readme.svg" width="96" /> <br />DiceBear Shapes</h1>
2
2
  <p align="center">
3
3
  <strong>Avatar Style for <a href="https://dicebear.com/">DiceBear</a></strong><br />
4
- <a href="https://github.com/dmester/jdenticon">Jdenticon</a>
5
- by Daniel Mester Pirttijärvi
4
+ <a href="https://dicebear.com">Shapes</a> by <a href="https://dicebear.com">Florian Körner</a>
5
+ </p>
6
+
7
+ <p align="center">
8
+ <img src="https://api.dicebear.com/5.x/shapes/svg?seed=Mimi" width="64" />
9
+ <img src="https://api.dicebear.com/5.x/shapes/svg?seed=Sasha" width="64" />
10
+ <img src="https://api.dicebear.com/5.x/shapes/svg?seed=Lilly" width="64" />
11
+ <img src="https://api.dicebear.com/5.x/shapes/svg?seed=Tigger" width="64" />
12
+ <img src="https://api.dicebear.com/5.x/shapes/svg?seed=Bella" width="64" />
13
+ <img src="https://api.dicebear.com/5.x/shapes/svg?seed=Zoe" width="64" />
14
+ <img src="https://api.dicebear.com/5.x/shapes/svg?seed=Kitty" width="64" />
15
+ </p>
16
+
17
+ <p align="center">
18
+ The avatar style is based on <a href="https://dicebear.com">Shapes</a> by
19
+ <a href="https://dicebear.com">Florian Körner</a>, licensed under
20
+ <a href="https://creativecommons.org/publicdomain/zero/1.0/">CC0 1.0</a>. / Remix of the original.
21
+ </p>
22
+ <p align="center">
23
+ See <a href="https://dicebear.com/licenses">license overview</a> for more information.
6
24
  </p>
7
25
 
8
26
  <p align="center">
@@ -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/bX8ZT8jK2fo5Uy8G6j2Qic/%40dicebear%2Fshapes
6
+ */
7
+ export { shape1 } from './shape1.js';
8
+ export { shape2 } from './shape2.js';
9
+ export { shape3 } from './shape3.js';
@@ -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/bX8ZT8jK2fo5Uy8G6j2Qic/%40dicebear%2Fshapes
6
+ */
7
+ export { shape1 } from './shape1.js';
8
+ export { shape2 } from './shape2.js';
9
+ export { shape3 } from './shape3.js';
@@ -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/bX8ZT8jK2fo5Uy8G6j2Qic/%40dicebear%2Fshapes
6
+ */
7
+ import type { ComponentGroup } from '../types.js';
8
+ export declare const shape1: ComponentGroup;
@@ -0,0 +1,16 @@
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/bX8ZT8jK2fo5Uy8G6j2Qic/%40dicebear%2Fshapes
6
+ */
7
+ import { escape } from '@dicebear/core';
8
+ export const shape1 = {
9
+ 'rectangle': (components, colors) => `<path fill-rule="evenodd" clip-rule="evenodd" d="M90 10H10v80h80V10ZM0 0v100h100V0H0Z" fill="${escape.xml(`${colors.shape1}`)}"/>`,
10
+ 'rectangleFilled': (components, colors) => `<path d="M0 0h100v100H0V0Z" fill="${escape.xml(`${colors.shape1}`)}"/>`,
11
+ 'ellipseFilled': (components, colors) => `<path d="M100 50A50 50 0 1 1 0 50a50 50 0 0 1 100 0Z" fill="${escape.xml(`${colors.shape1}`)}"/>`,
12
+ 'ellipse': (components, colors) => `<path fill-rule="evenodd" clip-rule="evenodd" d="M50 90a40 40 0 1 0 0-80 40 40 0 0 0 0 80Zm0 10A50 50 0 1 0 50 0a50 50 0 0 0 0 100Z" fill="${escape.xml(`${colors.shape1}`)}"/>`,
13
+ 'polygonFilled': (components, colors) => `<path d="m50 7 50 86.6H0L50 7Z" fill="${escape.xml(`${colors.shape1}`)}"/>`,
14
+ 'polygon': (components, colors) => `<path fill-rule="evenodd" clip-rule="evenodd" d="M50 7 0 93.6h100L50 7Zm0 20L17.3 83.6h65.4L50 27Z" fill="${escape.xml(`${colors.shape1}`)}"/>`,
15
+ 'line': (components, colors) => `<path fill="${escape.xml(`${colors.shape1}`)}" d="M45-150h10v400H45z"/>`,
16
+ };
@@ -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/bX8ZT8jK2fo5Uy8G6j2Qic/%40dicebear%2Fshapes
6
+ */
7
+ import type { ComponentGroup } from '../types.js';
8
+ export declare const shape2: ComponentGroup;
@@ -0,0 +1,16 @@
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/bX8ZT8jK2fo5Uy8G6j2Qic/%40dicebear%2Fshapes
6
+ */
7
+ import { escape } from '@dicebear/core';
8
+ export const shape2 = {
9
+ 'rectangle': (components, colors) => `<path fill-rule="evenodd" clip-rule="evenodd" d="M90 10H10v80h80V10ZM0 0v100h100V0H0Z" fill="${escape.xml(`${colors.shape2}`)}"/>`,
10
+ 'rectangleFilled': (components, colors) => `<path d="M0 0h100v100H0V0Z" fill="${escape.xml(`${colors.shape2}`)}"/>`,
11
+ 'ellipseFilled': (components, colors) => `<path d="M100 50A50 50 0 1 1 0 50a50 50 0 0 1 100 0Z" fill="${escape.xml(`${colors.shape2}`)}"/>`,
12
+ 'ellipse': (components, colors) => `<path fill-rule="evenodd" clip-rule="evenodd" d="M50 90a40 40 0 1 0 0-80 40 40 0 0 0 0 80Zm0 10A50 50 0 1 0 50 0a50 50 0 0 0 0 100Z" fill="${escape.xml(`${colors.shape2}`)}"/>`,
13
+ 'polygonFilled': (components, colors) => `<path d="m50 7 50 86.6H0L50 7Z" fill="${escape.xml(`${colors.shape2}`)}"/>`,
14
+ 'polygon': (components, colors) => `<path fill-rule="evenodd" clip-rule="evenodd" d="M50 7 0 93.6h100L50 7Zm0 20L17.3 83.6h65.4L50 27Z" fill="${escape.xml(`${colors.shape2}`)}"/>`,
15
+ 'line': (components, colors) => `<path fill="${escape.xml(`${colors.shape2}`)}" d="M45-150h10v400H45z"/>`,
16
+ };
@@ -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/bX8ZT8jK2fo5Uy8G6j2Qic/%40dicebear%2Fshapes
6
+ */
7
+ import type { ComponentGroup } from '../types.js';
8
+ export declare const shape3: ComponentGroup;
@@ -0,0 +1,16 @@
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/bX8ZT8jK2fo5Uy8G6j2Qic/%40dicebear%2Fshapes
6
+ */
7
+ import { escape } from '@dicebear/core';
8
+ export const shape3 = {
9
+ 'rectangle': (components, colors) => `<path fill-rule="evenodd" clip-rule="evenodd" d="M90 10H10v80h80V10ZM0 0v100h100V0H0Z" fill="${escape.xml(`${colors.shape3}`)}"/>`,
10
+ 'rectangleFilled': (components, colors) => `<path d="M0 0h100v100H0V0Z" fill="${escape.xml(`${colors.shape3}`)}"/>`,
11
+ 'ellipseFilled': (components, colors) => `<path d="M100 50A50 50 0 1 1 0 50a50 50 0 0 1 100 0Z" fill="${escape.xml(`${colors.shape3}`)}"/>`,
12
+ 'ellipse': (components, colors) => `<path fill-rule="evenodd" clip-rule="evenodd" d="M50 90a40 40 0 1 0 0-80 40 40 0 0 0 0 80Zm0 10A50 50 0 1 0 50 0a50 50 0 0 0 0 100Z" fill="${escape.xml(`${colors.shape3}`)}"/>`,
13
+ 'polygonFilled': (components, colors) => `<path d="m50 7 50 86.6H0L50 7Z" fill="${escape.xml(`${colors.shape3}`)}"/>`,
14
+ 'polygon': (components, colors) => `<path fill-rule="evenodd" clip-rule="evenodd" d="M50 7 0 93.6h100L50 7Zm0 20L17.3 83.6h65.4L50 27Z" fill="${escape.xml(`${colors.shape3}`)}"/>`,
15
+ 'line': (components, colors) => `<path fill="${escape.xml(`${colors.shape3}`)}" d="M45-150h10v400H45z"/>`,
16
+ };
@@ -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/bX8ZT8jK2fo5Uy8G6j2Qic/%40dicebear%2Fshapes
6
+ */
7
+ import { Prng, StyleOptions } from "@dicebear/core";
8
+ import { Options } from "../types.js";
9
+ type Props = {
10
+ prng: Prng;
11
+ options: StyleOptions<Options>;
12
+ };
13
+ export declare function onPreCreate({ prng, options }: Props): void;
14
+ export {};
@@ -0,0 +1,24 @@
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/bX8ZT8jK2fo5Uy8G6j2Qic/%40dicebear%2Fshapes
6
+ */
7
+ export function onPreCreate({ prng, options }) {
8
+ var _a, _b, _c, _d;
9
+ const usedColors = new Set();
10
+ function getAvailableColors(colors) {
11
+ const filteredColors = colors.filter((color) => !usedColors.has(color));
12
+ return filteredColors.length > 0 ? filteredColors : colors;
13
+ }
14
+ function getColor(colors) {
15
+ const availableColors = getAvailableColors(colors);
16
+ const color = prng.pick(availableColors, 'transparent');
17
+ usedColors.add(color);
18
+ return color;
19
+ }
20
+ options.shape1Color = [getColor((_a = options.shape1Color) !== null && _a !== void 0 ? _a : [])];
21
+ options.shape2Color = [getColor((_b = options.shape2Color) !== null && _b !== void 0 ? _b : [])];
22
+ options.shape3Color = [getColor((_c = options.shape3Color) !== null && _c !== void 0 ? _c : [])];
23
+ options.backgroundColor = getAvailableColors((_d = options.backgroundColor) !== null && _d !== void 0 ? _d : []);
24
+ }
package/lib/index.d.ts ADDED
@@ -0,0 +1,23 @@
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/bX8ZT8jK2fo5Uy8G6j2Qic/%40dicebear%2Fshapes
6
+ */
7
+ /*!
8
+ * Shapes (@dicebear/shapes)
9
+ *
10
+ * Code licensed under MIT License.
11
+ * Copyright (c) 2023 Florian Körner
12
+ *
13
+ * Design "Shapes" by Florian Körner licensed under CC0 1.0. / Remix of the original.
14
+ * Source: https://dicebear.com
15
+ * Homepage: https://dicebear.com
16
+ * License: https://creativecommons.org/publicdomain/zero/1.0/
17
+ */
18
+ import type { StyleCreate, StyleMeta } from '@dicebear/core';
19
+ import type { Options } from './types.js';
20
+ export declare const meta: StyleMeta;
21
+ export declare const create: StyleCreate<Options>;
22
+ export { schema } from './schema.js';
23
+ export type { Options } from './types.js';
package/lib/index.js ADDED
@@ -0,0 +1,44 @@
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/bX8ZT8jK2fo5Uy8G6j2Qic/%40dicebear%2Fshapes
6
+ */
7
+ import { getComponents } from './utils/getComponents.js';
8
+ import { getColors } from './utils/getColors.js';
9
+ import { onPreCreate } from './hooks/onPreCreate.js';
10
+ export const meta = {
11
+ title: 'Shapes',
12
+ creator: 'Florian Körner',
13
+ source: 'https://dicebear.com',
14
+ homepage: 'https://dicebear.com',
15
+ license: {
16
+ name: 'CC0 1.0',
17
+ url: 'https://creativecommons.org/publicdomain/zero/1.0/',
18
+ },
19
+ };
20
+ export const create = ({ prng, options }) => {
21
+ var _a, _b, _c, _d, _e, _f;
22
+ onPreCreate({ prng, options });
23
+ const components = getComponents({ prng, options });
24
+ const colors = getColors({ prng, options });
25
+ return {
26
+ attributes: {
27
+ viewBox: '0 0 100 100',
28
+ fill: 'none',
29
+ 'shape-rendering': 'auto'
30
+ },
31
+ body: `<g transform="matrix(1.2 0 0 1.2 -10 -10)">${(_b = (_a = components.shape1) === null || _a === void 0 ? void 0 : _a.value(components, colors)) !== null && _b !== void 0 ? _b : ''}</g><g transform="matrix(.8 0 0 .8 10 10)">${(_d = (_c = components.shape2) === null || _c === void 0 ? void 0 : _c.value(components, colors)) !== null && _d !== void 0 ? _d : ''}</g><g transform="matrix(.4 0 0 .4 30 30)">${(_f = (_e = components.shape3) === null || _e === void 0 ? void 0 : _e.value(components, colors)) !== null && _f !== void 0 ? _f : ''}</g>`,
32
+ extra: () => ({
33
+ ...Object.entries(components).reduce((acc, [key, value]) => {
34
+ acc[key] = value === null || value === void 0 ? void 0 : value.name;
35
+ return acc;
36
+ }, {}),
37
+ ...Object.entries(colors).reduce((acc, [key, value]) => {
38
+ acc[`${key}Color`] = value;
39
+ return acc;
40
+ }, {}),
41
+ }),
42
+ };
43
+ };
44
+ export { schema } from './schema.js';
@@ -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/bX8ZT8jK2fo5Uy8G6j2Qic/%40dicebear%2Fshapes
6
+ */
7
+ import type { StyleSchema } from '@dicebear/core';
8
+ export declare const schema: StyleSchema;
package/lib/schema.js ADDED
@@ -0,0 +1,249 @@
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/bX8ZT8jK2fo5Uy8G6j2Qic/%40dicebear%2Fshapes
6
+ */
7
+ export const schema = {
8
+ "$schema": "http://json-schema.org/draft-07/schema#",
9
+ "properties": {
10
+ "backgroundColor": {
11
+ "type": "array",
12
+ "items": {
13
+ "type": "string",
14
+ "pattern": "^(transparent|[a-fA-F0-9]{6})$"
15
+ },
16
+ "default": [
17
+ "0a5b83",
18
+ "1c799f",
19
+ "69d2e7",
20
+ "f1f4dc",
21
+ "f88c49"
22
+ ]
23
+ },
24
+ "shape1": {
25
+ "type": "array",
26
+ "items": {
27
+ "type": "string",
28
+ "enum": [
29
+ "rectangle",
30
+ "rectangleFilled",
31
+ "ellipseFilled",
32
+ "ellipse",
33
+ "polygonFilled",
34
+ "polygon",
35
+ "line"
36
+ ]
37
+ },
38
+ "default": [
39
+ "rectangleFilled",
40
+ "ellipseFilled",
41
+ "polygonFilled"
42
+ ]
43
+ },
44
+ "shape1Color": {
45
+ "type": "array",
46
+ "items": {
47
+ "type": "string",
48
+ "pattern": "^(transparent|[a-fA-F0-9]{6})$"
49
+ },
50
+ "default": [
51
+ "0a5b83",
52
+ "1c799f",
53
+ "69d2e7",
54
+ "f1f4dc",
55
+ "f88c49"
56
+ ]
57
+ },
58
+ "shape1OffsetX": {
59
+ "type": "array",
60
+ "items": {
61
+ "type": "integer",
62
+ "minimum": -65,
63
+ "maximum": 65
64
+ },
65
+ "maxItems": 2,
66
+ "default": [
67
+ -65,
68
+ 65
69
+ ]
70
+ },
71
+ "shape1OffsetY": {
72
+ "type": "array",
73
+ "items": {
74
+ "type": "integer",
75
+ "minimum": -45,
76
+ "maximum": 45
77
+ },
78
+ "maxItems": 2,
79
+ "default": [
80
+ -45,
81
+ 45
82
+ ]
83
+ },
84
+ "shape1Rotation": {
85
+ "type": "array",
86
+ "items": {
87
+ "type": "integer",
88
+ "minimum": -160,
89
+ "maximum": 160
90
+ },
91
+ "maxItems": 2,
92
+ "default": [
93
+ -160,
94
+ 160
95
+ ]
96
+ },
97
+ "shape2": {
98
+ "type": "array",
99
+ "items": {
100
+ "type": "string",
101
+ "enum": [
102
+ "rectangle",
103
+ "rectangleFilled",
104
+ "ellipseFilled",
105
+ "ellipse",
106
+ "polygonFilled",
107
+ "polygon",
108
+ "line"
109
+ ]
110
+ },
111
+ "default": [
112
+ "rectangleFilled",
113
+ "ellipseFilled",
114
+ "polygonFilled",
115
+ "line"
116
+ ]
117
+ },
118
+ "shape2Color": {
119
+ "type": "array",
120
+ "items": {
121
+ "type": "string",
122
+ "pattern": "^(transparent|[a-fA-F0-9]{6})$"
123
+ },
124
+ "default": [
125
+ "0a5b83",
126
+ "1c799f",
127
+ "69d2e7",
128
+ "f1f4dc",
129
+ "f88c49"
130
+ ]
131
+ },
132
+ "shape2OffsetX": {
133
+ "type": "array",
134
+ "items": {
135
+ "type": "integer",
136
+ "minimum": -40,
137
+ "maximum": 40
138
+ },
139
+ "maxItems": 2,
140
+ "default": [
141
+ -40,
142
+ 40
143
+ ]
144
+ },
145
+ "shape2OffsetY": {
146
+ "type": "array",
147
+ "items": {
148
+ "type": "integer",
149
+ "minimum": -40,
150
+ "maximum": 40
151
+ },
152
+ "maxItems": 2,
153
+ "default": [
154
+ -40,
155
+ 40
156
+ ]
157
+ },
158
+ "shape2Rotation": {
159
+ "type": "array",
160
+ "items": {
161
+ "type": "integer",
162
+ "minimum": -180,
163
+ "maximum": 180
164
+ },
165
+ "maxItems": 2,
166
+ "default": [
167
+ -180,
168
+ 180
169
+ ]
170
+ },
171
+ "shape3": {
172
+ "type": "array",
173
+ "items": {
174
+ "type": "string",
175
+ "enum": [
176
+ "rectangle",
177
+ "rectangleFilled",
178
+ "ellipseFilled",
179
+ "ellipse",
180
+ "polygonFilled",
181
+ "polygon",
182
+ "line"
183
+ ]
184
+ },
185
+ "default": [
186
+ "rectangle",
187
+ "rectangleFilled",
188
+ "ellipseFilled",
189
+ "ellipse",
190
+ "polygonFilled",
191
+ "polygon",
192
+ "line"
193
+ ]
194
+ },
195
+ "shape3Color": {
196
+ "type": "array",
197
+ "items": {
198
+ "type": "string",
199
+ "pattern": "^(transparent|[a-fA-F0-9]{6})$"
200
+ },
201
+ "default": [
202
+ "0a5b83",
203
+ "1c799f",
204
+ "69d2e7",
205
+ "f1f4dc",
206
+ "f88c49"
207
+ ]
208
+ },
209
+ "shape3OffsetX": {
210
+ "type": "array",
211
+ "items": {
212
+ "type": "integer",
213
+ "minimum": -25,
214
+ "maximum": 25
215
+ },
216
+ "maxItems": 2,
217
+ "default": [
218
+ -25,
219
+ 25
220
+ ]
221
+ },
222
+ "shape3OffsetY": {
223
+ "type": "array",
224
+ "items": {
225
+ "type": "integer",
226
+ "minimum": -25,
227
+ "maximum": 25
228
+ },
229
+ "maxItems": 2,
230
+ "default": [
231
+ -25,
232
+ 25
233
+ ]
234
+ },
235
+ "shape3Rotation": {
236
+ "type": "array",
237
+ "items": {
238
+ "type": "integer",
239
+ "minimum": -180,
240
+ "maximum": 180
241
+ },
242
+ "maxItems": 2,
243
+ "default": [
244
+ -180,
245
+ 180
246
+ ]
247
+ }
248
+ }
249
+ };
package/lib/types.d.ts ADDED
@@ -0,0 +1,36 @@
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/bX8ZT8jK2fo5Uy8G6j2Qic/%40dicebear%2Fshapes
6
+ */
7
+ export interface Options {
8
+ shape1?: ('rectangle' | 'rectangleFilled' | 'ellipseFilled' | 'ellipse' | 'polygonFilled' | 'polygon' | 'line')[];
9
+ shape1Rotation?: number[];
10
+ shape1OffsetX?: number[];
11
+ shape1OffsetY?: number[];
12
+ shape2?: ('rectangle' | 'rectangleFilled' | 'ellipseFilled' | 'ellipse' | 'polygonFilled' | 'polygon' | 'line')[];
13
+ shape2Rotation?: number[];
14
+ shape2OffsetX?: number[];
15
+ shape2OffsetY?: number[];
16
+ shape3?: ('rectangle' | 'rectangleFilled' | 'ellipseFilled' | 'ellipse' | 'polygonFilled' | 'polygon' | 'line')[];
17
+ shape3Rotation?: number[];
18
+ shape3OffsetX?: number[];
19
+ shape3OffsetY?: number[];
20
+ backgroundColor?: string[];
21
+ shape1Color?: string[];
22
+ shape2Color?: string[];
23
+ shape3Color?: string[];
24
+ }
25
+ export type ColorPickCollection = Record<string, string>;
26
+ export type ComponentGroup = Record<string, ComponentGroupItem>;
27
+ export type ComponentGroupCollection = Record<string, ComponentGroup>;
28
+ export type ComponentGroupItem = (components: ComponentPickCollection, colors: ColorPickCollection) => string;
29
+ export type ComponentPickCollection = Record<string, ComponentPick>;
30
+ export type ComponentPick = {
31
+ name: string;
32
+ value: ComponentGroupItem;
33
+ rotation: number | undefined;
34
+ offsetX: number | undefined;
35
+ offsetY: number | undefined;
36
+ } | 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/bX8ZT8jK2fo5Uy8G6j2Qic/%40dicebear%2Fshapes
6
+ */
7
+ export {};
@@ -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/bX8ZT8jK2fo5Uy8G6j2Qic/%40dicebear%2Fshapes
6
+ */
7
+ export declare function convertColor(color: string): string;
@@ -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/bX8ZT8jK2fo5Uy8G6j2Qic/%40dicebear%2Fshapes
6
+ */
7
+ export function convertColor(color) {
8
+ return 'transparent' === color ? color : `#${color}`;
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/bX8ZT8jK2fo5Uy8G6j2Qic/%40dicebear%2Fshapes
6
+ */
7
+ import type { Prng } from '@dicebear/core';
8
+ import type { Options, ColorPickCollection } from '../types.js';
9
+ type Props = {
10
+ prng: Prng;
11
+ options: Options;
12
+ };
13
+ export declare function getColors({ prng, options }: Props): ColorPickCollection;
14
+ export {};
@@ -0,0 +1,16 @@
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/bX8ZT8jK2fo5Uy8G6j2Qic/%40dicebear%2Fshapes
6
+ */
7
+ import { convertColor } from './convertColor.js';
8
+ export function getColors({ prng, options }) {
9
+ var _a, _b, _c;
10
+ return {
11
+ 'shape1': convertColor(prng.pick((_a = options.shape1Color) !== null && _a !== void 0 ? _a : [], 'transparent')),
12
+ 'shape2': convertColor(prng.pick((_b = options.shape2Color) !== null && _b !== void 0 ? _b : [], 'transparent')),
13
+ 'shape3': convertColor(prng.pick((_c = options.shape3Color) !== null && _c !== void 0 ? _c : [], 'transparent')),
14
+ };
15
+ }
16
+ ;
@@ -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/bX8ZT8jK2fo5Uy8G6j2Qic/%40dicebear%2Fshapes
6
+ */
7
+ import type { Prng } from '@dicebear/core';
8
+ import type { Options, ComponentPickCollection } from '../types.js';
9
+ type Props = {
10
+ prng: Prng;
11
+ options: Options;
12
+ };
13
+ export declare function getComponents({ prng, options }: Props): ComponentPickCollection;
14
+ export {};