@dicebear/rings 7.0.0-rc.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 ADDED
@@ -0,0 +1,34 @@
1
+ Licenses
2
+ --------
3
+
4
+ # Design
5
+ Applies to all design files in this package.
6
+
7
+ Source: Rings (https://www.dicebear.com)
8
+ Designer: Florian Körner (https://www.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
+
14
+ MIT License
15
+
16
+ Copyright (c) 2023 Florian Körner
17
+
18
+ Permission is hereby granted, free of charge, to any person obtaining a copy
19
+ of this software and associated documentation files (the "Software"), to deal
20
+ in the Software without restriction, including without limitation the rights
21
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
22
+ copies of the Software, and to permit persons to whom the Software is
23
+ furnished to do so, subject to the following conditions:
24
+
25
+ The above copyright notice and this permission notice shall be included in all
26
+ copies or substantial portions of the Software.
27
+
28
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
29
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
30
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
31
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
32
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
33
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
34
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,30 @@
1
+ <h1 align="center"><img src="https://dicebear.com/logo-readme.svg" width="96" /> <br />DiceBear Rings</h1>
2
+ <p align="center">
3
+ <strong>Avatar Style for <a href="https://dicebear.com/">DiceBear</a></strong><br />
4
+ <a href="https://www.dicebear.com">Rings</a> by <a href="https://www.dicebear.com">Florian Körner</a>
5
+ </p>
6
+
7
+ <p align="center">
8
+ <img src="https://api.dicebear.com/6.x/rings/svg?seed=Mimi" width="64" />
9
+ <img src="https://api.dicebear.com/6.x/rings/svg?seed=Sasha" width="64" />
10
+ <img src="https://api.dicebear.com/6.x/rings/svg?seed=Lilly" width="64" />
11
+ <img src="https://api.dicebear.com/6.x/rings/svg?seed=Tigger" width="64" />
12
+ <img src="https://api.dicebear.com/6.x/rings/svg?seed=Bella" width="64" />
13
+ <img src="https://api.dicebear.com/6.x/rings/svg?seed=Zoe" width="64" />
14
+ <img src="https://api.dicebear.com/6.x/rings/svg?seed=Kitty" width="64" />
15
+ </p>
16
+
17
+ <p align="center">
18
+ The avatar style is based on <a href="https://www.dicebear.com">Rings</a> by
19
+ <a href="https://www.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.
24
+ </p>
25
+
26
+ <p align="center">
27
+ <a href="https://dicebear.com/styles/rings">
28
+ Read Documentation
29
+ </a>
30
+ </p>
@@ -0,0 +1,12 @@
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/sK2mrFhCZwQu1qw4WqOBEF/%40dicebear%2Frings
6
+ */
7
+ export { ring } from './ring.js';
8
+ export { ringOne } from './ringOne.js';
9
+ export { ringTwo } from './ringTwo.js';
10
+ export { ringThree } from './ringThree.js';
11
+ export { ringFour } from './ringFour.js';
12
+ export { ringFive } from './ringFive.js';
@@ -0,0 +1,12 @@
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/sK2mrFhCZwQu1qw4WqOBEF/%40dicebear%2Frings
6
+ */
7
+ export { ring } from './ring.js';
8
+ export { ringOne } from './ringOne.js';
9
+ export { ringTwo } from './ringTwo.js';
10
+ export { ringThree } from './ringThree.js';
11
+ export { ringFour } from './ringFour.js';
12
+ export { ringFive } from './ringFive.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/sK2mrFhCZwQu1qw4WqOBEF/%40dicebear%2Frings
6
+ */
7
+ import type { ComponentGroup } from '../types.js';
8
+ export declare const ring: ComponentGroup;
@@ -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/sK2mrFhCZwQu1qw4WqOBEF/%40dicebear%2Frings
6
+ */
7
+ export const ring = {
8
+ 'container': (components, colors) => { var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v; return `${(_b = (_a = components.ringOne) === null || _a === void 0 ? void 0 : _a.value(components, colors)) !== null && _b !== void 0 ? _b : ''}${(_d = (_c = components.ringTwo) === null || _c === void 0 ? void 0 : _c.value(components, colors)) !== null && _d !== void 0 ? _d : ''}${(_f = (_e = components.ringThree) === null || _e === void 0 ? void 0 : _e.value(components, colors)) !== null && _f !== void 0 ? _f : ''}${(_h = (_g = components.ringFour) === null || _g === void 0 ? void 0 : _g.value(components, colors)) !== null && _h !== void 0 ? _h : ''}${(_k = (_j = components.ringFive) === null || _j === void 0 ? void 0 : _j.value(components, colors)) !== null && _k !== void 0 ? _k : ''}<g transform="matrix(1 0 0 -1 0 100)">${(_m = (_l = components.ringOne) === null || _l === void 0 ? void 0 : _l.value(components, colors)) !== null && _m !== void 0 ? _m : ''}</g><g transform="matrix(1 0 0 -1 0 100)">${(_p = (_o = components.ringTwo) === null || _o === void 0 ? void 0 : _o.value(components, colors)) !== null && _p !== void 0 ? _p : ''}</g><g transform="matrix(1 0 0 -1 0 100)">${(_r = (_q = components.ringThree) === null || _q === void 0 ? void 0 : _q.value(components, colors)) !== null && _r !== void 0 ? _r : ''}</g><g transform="matrix(1 0 0 -1 0 100)">${(_t = (_s = components.ringFour) === null || _s === void 0 ? void 0 : _s.value(components, colors)) !== null && _t !== void 0 ? _t : ''}</g><g transform="matrix(1 0 0 -1 0 100)">${(_v = (_u = components.ringFive) === null || _u === void 0 ? void 0 : _u.value(components, colors)) !== null && _v !== void 0 ? _v : ''}</g>`; },
9
+ };
@@ -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/sK2mrFhCZwQu1qw4WqOBEF/%40dicebear%2Frings
6
+ */
7
+ import type { ComponentGroup } from '../types.js';
8
+ export declare const ringFive: ComponentGroup;
@@ -0,0 +1,13 @@
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/sK2mrFhCZwQu1qw4WqOBEF/%40dicebear%2Frings
6
+ */
7
+ import { escape } from '@dicebear/core';
8
+ export const ringFive = {
9
+ 'eighth': (components, colors) => `<path d="m42.929 42.929 7.07 7.07H40a9.97 9.97 0 0 1 2.93-7.07Z" fill="${escape.xml(`${colors.ring}`)}"/>`,
10
+ 'quarter': (components, colors) => `<path d="M50 40v10H40c0-5.523 4.477-10 10-10Z" fill="${escape.xml(`${colors.ring}`)}"/>`,
11
+ 'half': (components, colors) => `<path d="M60 50c0-5.523-4.477-10-10-10s-10 4.477-10 10h20Z" fill="${escape.xml(`${colors.ring}`)}"/>`,
12
+ 'full': (components, colors) => `<circle cx="50" cy="50" r="10" fill="${escape.xml(`${colors.ring}`)}"/>`,
13
+ };
@@ -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/sK2mrFhCZwQu1qw4WqOBEF/%40dicebear%2Frings
6
+ */
7
+ import type { ComponentGroup } from '../types.js';
8
+ export declare const ringFour: ComponentGroup;
@@ -0,0 +1,13 @@
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/sK2mrFhCZwQu1qw4WqOBEF/%40dicebear%2Frings
6
+ */
7
+ import { escape } from '@dicebear/core';
8
+ export const ringFour = {
9
+ 'eighth': (components, colors) => `<path d="M40.5 50a9.47 9.47 0 0 1 2.782-6.718l-7.424-7.424A19.937 19.937 0 0 0 30 50h10.5Z" fill="${escape.xml(`${colors.ring}`)}"/>`,
10
+ 'quarter': (components, colors) => `<path d="M50 30c-11.046 0-20 8.954-20 20h10.5a9.5 9.5 0 0 1 9.5-9.5V30Z" fill="${escape.xml(`${colors.ring}`)}"/>`,
11
+ 'half': (components, colors) => `<path d="M70 50c0-11.046-8.954-20-20-20s-20 8.954-20 20h10.5a9.5 9.5 0 0 1 19 0H70Z" fill="${escape.xml(`${colors.ring}`)}"/>`,
12
+ 'full': (components, colors) => `<circle cx="50" cy="50" r="14.75" stroke="${escape.xml(`${colors.ring}`)}" stroke-width="10.5"/>`,
13
+ };
@@ -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/sK2mrFhCZwQu1qw4WqOBEF/%40dicebear%2Frings
6
+ */
7
+ import type { ComponentGroup } from '../types.js';
8
+ export declare const ringOne: ComponentGroup;
@@ -0,0 +1,13 @@
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/sK2mrFhCZwQu1qw4WqOBEF/%40dicebear%2Frings
6
+ */
7
+ import { escape } from '@dicebear/core';
8
+ export const ringOne = {
9
+ 'half': (components, colors) => `<path d="M89.5 50H100c0-27.614-22.386-50-50-50S0 22.386 0 50h10.5c0-21.815 17.685-39.5 39.5-39.5S89.5 28.185 89.5 50Z" fill="${escape.xml(`${colors.ring}`)}"/>`,
10
+ 'quarter': (components, colors) => `<path d="M50 10.5V0C22.386 0 0 22.386 0 50h10.5c0-21.815 17.685-39.5 39.5-39.5Z" fill="${escape.xml(`${colors.ring}`)}"/>`,
11
+ 'eighth': (components, colors) => `<path d="M22.07 22.07C14.92 29.216 10.5 39.091 10.5 50H0c0-13.807 5.596-26.307 14.645-35.355l7.424 7.424Z" fill="${escape.xml(`${colors.ring}`)}"/>`,
12
+ 'full': (components, colors) => `<circle cx="50" cy="50" r="44.75" stroke="${escape.xml(`${colors.ring}`)}" stroke-width="10.5"/>`,
13
+ };
@@ -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/sK2mrFhCZwQu1qw4WqOBEF/%40dicebear%2Frings
6
+ */
7
+ import type { ComponentGroup } from '../types.js';
8
+ export declare const ringThree: ComponentGroup;
@@ -0,0 +1,13 @@
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/sK2mrFhCZwQu1qw4WqOBEF/%40dicebear%2Frings
6
+ */
7
+ import { escape } from '@dicebear/core';
8
+ export const ringThree = {
9
+ 'eighth': (components, colors) => `<path d="M30.5 50c0-5.385 2.183-10.26 5.711-13.789l-7.424-7.424C23.357 34.216 20 41.716 20 50h10.5Z" fill="${escape.xml(`${colors.ring}`)}"/>`,
10
+ 'quarter': (components, colors) => `<path d="M50 20c-16.569 0-30 13.431-30 30h10.5c0-10.77 8.73-19.5 19.5-19.5V20Z" fill="${escape.xml(`${colors.ring}`)}"/>`,
11
+ 'half': (components, colors) => `<path d="M80 50c0-16.569-13.431-30-30-30-16.569 0-30 13.431-30 30h10.5c0-10.77 8.73-19.5 19.5-19.5S69.5 39.23 69.5 50H80Z" fill="${escape.xml(`${colors.ring}`)}"/>`,
12
+ 'full': (components, colors) => `<circle cx="50" cy="50" r="24.75" stroke="${escape.xml(`${colors.ring}`)}" stroke-width="10.5"/>`,
13
+ };
@@ -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/sK2mrFhCZwQu1qw4WqOBEF/%40dicebear%2Frings
6
+ */
7
+ import type { ComponentGroup } from '../types.js';
8
+ export declare const ringTwo: ComponentGroup;
@@ -0,0 +1,13 @@
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/sK2mrFhCZwQu1qw4WqOBEF/%40dicebear%2Frings
6
+ */
7
+ import { escape } from '@dicebear/core';
8
+ export const ringTwo = {
9
+ 'eighth': (components, colors) => `<path d="M20.5 50c0-8.146 3.302-15.521 8.64-20.86l-7.424-7.424C14.477 28.954 10 38.954 10 50h10.5Z" fill="${escape.xml(`${colors.ring}`)}"/>`,
10
+ 'quarter': (components, colors) => `<path d="M50 10c-22.091 0-40 17.909-40 40h10.5c0-16.292 13.208-29.5 29.5-29.5V10Z" fill="${escape.xml(`${colors.ring}`)}"/>`,
11
+ 'half': (components, colors) => `<path d="M90 50c0-22.091-17.909-40-40-40S10 27.909 10 50h10.5c0-16.292 13.208-29.5 29.5-29.5S79.5 33.708 79.5 50H90Z" fill="${escape.xml(`${colors.ring}`)}"/>`,
12
+ 'full': (components, colors) => `<circle cx="50" cy="50" r="34.75" stroke="${escape.xml(`${colors.ring}`)}" stroke-width="10.5"/>`,
13
+ };
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/sK2mrFhCZwQu1qw4WqOBEF/%40dicebear%2Frings
6
+ */
7
+ /*!
8
+ * Rings (@dicebear/rings)
9
+ *
10
+ * Code licensed under MIT License.
11
+ * Copyright (c) 2023 Florian Körner
12
+ *
13
+ * Design "Rings" by Florian Körner licensed under CC0 1.0. / Remix of the original.
14
+ * Source: https://www.dicebear.com
15
+ * Homepage: https://www.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,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/sK2mrFhCZwQu1qw4WqOBEF/%40dicebear%2Frings
6
+ */
7
+ import { getComponents } from './utils/getComponents.js';
8
+ import { getColors } from './utils/getColors.js';
9
+ export const meta = {
10
+ title: 'Rings',
11
+ creator: 'Florian Körner',
12
+ source: 'https://www.dicebear.com',
13
+ homepage: 'https://www.dicebear.com',
14
+ license: {
15
+ name: 'CC0 1.0',
16
+ url: 'https://creativecommons.org/publicdomain/zero/1.0/',
17
+ },
18
+ };
19
+ export const create = ({ prng, options }) => {
20
+ var _a, _b;
21
+ const components = getComponents({ prng, options });
22
+ const colors = getColors({ prng, options });
23
+ return {
24
+ attributes: {
25
+ viewBox: '0 0 100 100',
26
+ fill: 'none',
27
+ 'shape-rendering': 'auto'
28
+ },
29
+ body: `${(_b = (_a = components.ring) === null || _a === void 0 ? void 0 : _a.value(components, colors)) !== null && _b !== void 0 ? _b : ''}`,
30
+ extra: () => ({
31
+ ...Object.entries(components).reduce((acc, [key, value]) => {
32
+ acc[key] = value === null || value === void 0 ? void 0 : value.name;
33
+ return acc;
34
+ }, {}),
35
+ ...Object.entries(colors).reduce((acc, [key, value]) => {
36
+ acc[`${key}Color`] = value;
37
+ return acc;
38
+ }, {}),
39
+ }),
40
+ };
41
+ };
42
+ 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/sK2mrFhCZwQu1qw4WqOBEF/%40dicebear%2Frings
6
+ */
7
+ import type { StyleSchema } from '@dicebear/core';
8
+ export declare const schema: StyleSchema;
package/lib/schema.js ADDED
@@ -0,0 +1,203 @@
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/sK2mrFhCZwQu1qw4WqOBEF/%40dicebear%2Frings
6
+ */
7
+ export const schema = {
8
+ "$schema": "http://json-schema.org/draft-07/schema#",
9
+ "properties": {
10
+ "ring": {
11
+ "type": "array",
12
+ "items": {
13
+ "type": "string",
14
+ "enum": [
15
+ "container"
16
+ ]
17
+ },
18
+ "default": [
19
+ "container"
20
+ ]
21
+ },
22
+ "ringColor": {
23
+ "type": "array",
24
+ "items": {
25
+ "type": "string",
26
+ "pattern": "^(transparent|[a-fA-F0-9]{6})$"
27
+ },
28
+ "default": [
29
+ "ffd54f",
30
+ "64b5f6",
31
+ "4dd0e1",
32
+ "ff8a65",
33
+ "9575cd",
34
+ "81c784",
35
+ "7986cb",
36
+ "4fc3f7",
37
+ "aed581",
38
+ "dce775",
39
+ "ffb74d",
40
+ "f06292",
41
+ "ba68c8",
42
+ "e57373",
43
+ "4db6ac",
44
+ "fff176"
45
+ ]
46
+ },
47
+ "ringFive": {
48
+ "type": "array",
49
+ "items": {
50
+ "type": "string",
51
+ "enum": [
52
+ "eighth",
53
+ "quarter",
54
+ "half",
55
+ "full"
56
+ ]
57
+ },
58
+ "default": []
59
+ },
60
+ "ringFiveRotation": {
61
+ "type": "array",
62
+ "items": {
63
+ "type": "integer",
64
+ "minimum": -180,
65
+ "maximum": 180
66
+ },
67
+ "maxItems": 2,
68
+ "default": [
69
+ -180,
70
+ 180
71
+ ]
72
+ },
73
+ "ringFour": {
74
+ "type": "array",
75
+ "items": {
76
+ "type": "string",
77
+ "enum": [
78
+ "eighth",
79
+ "quarter",
80
+ "half",
81
+ "full"
82
+ ]
83
+ },
84
+ "default": [
85
+ "quarter",
86
+ "half"
87
+ ]
88
+ },
89
+ "ringFourRotation": {
90
+ "type": "array",
91
+ "items": {
92
+ "type": "integer",
93
+ "minimum": -180,
94
+ "maximum": 180
95
+ },
96
+ "maxItems": 2,
97
+ "default": [
98
+ -180,
99
+ 180
100
+ ]
101
+ },
102
+ "ringOne": {
103
+ "type": "array",
104
+ "items": {
105
+ "type": "string",
106
+ "enum": [
107
+ "half",
108
+ "quarter",
109
+ "eighth",
110
+ "full"
111
+ ]
112
+ },
113
+ "default": [
114
+ "half",
115
+ "quarter"
116
+ ]
117
+ },
118
+ "ringOneRotation": {
119
+ "type": "array",
120
+ "items": {
121
+ "type": "integer",
122
+ "minimum": -180,
123
+ "maximum": 180
124
+ },
125
+ "maxItems": 2,
126
+ "default": [
127
+ -180,
128
+ 180
129
+ ]
130
+ },
131
+ "ringRotation": {
132
+ "type": "array",
133
+ "items": {
134
+ "type": "integer",
135
+ "minimum": -180,
136
+ "maximum": 180
137
+ },
138
+ "maxItems": 2,
139
+ "default": [
140
+ -180,
141
+ 180
142
+ ]
143
+ },
144
+ "ringThree": {
145
+ "type": "array",
146
+ "items": {
147
+ "type": "string",
148
+ "enum": [
149
+ "eighth",
150
+ "quarter",
151
+ "half",
152
+ "full"
153
+ ]
154
+ },
155
+ "default": [
156
+ "quarter",
157
+ "half"
158
+ ]
159
+ },
160
+ "ringThreeRotation": {
161
+ "type": "array",
162
+ "items": {
163
+ "type": "integer",
164
+ "minimum": -180,
165
+ "maximum": 180
166
+ },
167
+ "maxItems": 2,
168
+ "default": [
169
+ -180,
170
+ 180
171
+ ]
172
+ },
173
+ "ringTwo": {
174
+ "type": "array",
175
+ "items": {
176
+ "type": "string",
177
+ "enum": [
178
+ "eighth",
179
+ "quarter",
180
+ "half",
181
+ "full"
182
+ ]
183
+ },
184
+ "default": [
185
+ "quarter",
186
+ "half"
187
+ ]
188
+ },
189
+ "ringTwoRotation": {
190
+ "type": "array",
191
+ "items": {
192
+ "type": "integer",
193
+ "minimum": -180,
194
+ "maximum": 180
195
+ },
196
+ "maxItems": 2,
197
+ "default": [
198
+ -180,
199
+ 180
200
+ ]
201
+ }
202
+ }
203
+ };
package/lib/types.d.ts ADDED
@@ -0,0 +1,33 @@
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/sK2mrFhCZwQu1qw4WqOBEF/%40dicebear%2Frings
6
+ */
7
+ export interface Options {
8
+ ring?: ('container')[];
9
+ ringRotation?: number[];
10
+ ringOne?: ('half' | 'quarter' | 'eighth' | 'full')[];
11
+ ringOneRotation?: number[];
12
+ ringTwo?: ('eighth' | 'quarter' | 'half' | 'full')[];
13
+ ringTwoRotation?: number[];
14
+ ringThree?: ('eighth' | 'quarter' | 'half' | 'full')[];
15
+ ringThreeRotation?: number[];
16
+ ringFour?: ('eighth' | 'quarter' | 'half' | 'full')[];
17
+ ringFourRotation?: number[];
18
+ ringFive?: ('eighth' | 'quarter' | 'half' | 'full')[];
19
+ ringFiveRotation?: number[];
20
+ ringColor?: string[];
21
+ }
22
+ export type ColorPickCollection = Record<string, string>;
23
+ export type ComponentGroup = Record<string, ComponentGroupItem>;
24
+ export type ComponentGroupCollection = Record<string, ComponentGroup>;
25
+ export type ComponentGroupItem = (components: ComponentPickCollection, colors: ColorPickCollection) => string;
26
+ export type ComponentPickCollection = Record<string, ComponentPick>;
27
+ export type ComponentPick = {
28
+ name: string;
29
+ value: ComponentGroupItem;
30
+ rotation: number | undefined;
31
+ offsetX: number | undefined;
32
+ offsetY: number | undefined;
33
+ } | 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/sK2mrFhCZwQu1qw4WqOBEF/%40dicebear%2Frings
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/sK2mrFhCZwQu1qw4WqOBEF/%40dicebear%2Frings
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/sK2mrFhCZwQu1qw4WqOBEF/%40dicebear%2Frings
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/sK2mrFhCZwQu1qw4WqOBEF/%40dicebear%2Frings
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,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/sK2mrFhCZwQu1qw4WqOBEF/%40dicebear%2Frings
6
+ */
7
+ import { convertColor } from './convertColor.js';
8
+ export function getColors({ prng, options }) {
9
+ var _a;
10
+ return {
11
+ 'ring': convertColor(prng.pick((_a = options.ringColor) !== null && _a !== void 0 ? _a : [], 'transparent')),
12
+ };
13
+ }
14
+ ;
@@ -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/sK2mrFhCZwQu1qw4WqOBEF/%40dicebear%2Frings
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 {};
@@ -0,0 +1,79 @@
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/sK2mrFhCZwQu1qw4WqOBEF/%40dicebear%2Frings
6
+ */
7
+ import { pickComponent } from './pickComponent.js';
8
+ export function getComponents({ prng, options }) {
9
+ var _a, _b, _c, _d, _e, _f;
10
+ const ringComponent = pickComponent({
11
+ prng,
12
+ group: 'ring',
13
+ values: options.ring,
14
+ width: 100,
15
+ height: 100,
16
+ rotation: ((_a = options.ringRotation) === null || _a === void 0 ? void 0 : _a.length) ? options.ringRotation : [0],
17
+ offsetX: [0],
18
+ offsetY: [0],
19
+ });
20
+ const ringOneComponent = pickComponent({
21
+ prng,
22
+ group: 'ringOne',
23
+ values: options.ringOne,
24
+ width: 100,
25
+ height: 100,
26
+ rotation: ((_b = options.ringOneRotation) === null || _b === void 0 ? void 0 : _b.length) ? options.ringOneRotation : [0],
27
+ offsetX: [0],
28
+ offsetY: [0],
29
+ });
30
+ const ringTwoComponent = pickComponent({
31
+ prng,
32
+ group: 'ringTwo',
33
+ values: options.ringTwo,
34
+ width: 100,
35
+ height: 100,
36
+ rotation: ((_c = options.ringTwoRotation) === null || _c === void 0 ? void 0 : _c.length) ? options.ringTwoRotation : [0],
37
+ offsetX: [0],
38
+ offsetY: [0],
39
+ });
40
+ const ringThreeComponent = pickComponent({
41
+ prng,
42
+ group: 'ringThree',
43
+ values: options.ringThree,
44
+ width: 100,
45
+ height: 100,
46
+ rotation: ((_d = options.ringThreeRotation) === null || _d === void 0 ? void 0 : _d.length) ? options.ringThreeRotation : [0],
47
+ offsetX: [0],
48
+ offsetY: [0],
49
+ });
50
+ const ringFourComponent = pickComponent({
51
+ prng,
52
+ group: 'ringFour',
53
+ values: options.ringFour,
54
+ width: 100,
55
+ height: 100,
56
+ rotation: ((_e = options.ringFourRotation) === null || _e === void 0 ? void 0 : _e.length) ? options.ringFourRotation : [0],
57
+ offsetX: [0],
58
+ offsetY: [0],
59
+ });
60
+ const ringFiveComponent = pickComponent({
61
+ prng,
62
+ group: 'ringFive',
63
+ values: options.ringFive,
64
+ width: 100,
65
+ height: 100,
66
+ rotation: ((_f = options.ringFiveRotation) === null || _f === void 0 ? void 0 : _f.length) ? options.ringFiveRotation : [0],
67
+ offsetX: [0],
68
+ offsetY: [0],
69
+ });
70
+ return {
71
+ 'ring': ringComponent,
72
+ 'ringOne': ringOneComponent,
73
+ 'ringTwo': ringTwoComponent,
74
+ 'ringThree': ringThreeComponent,
75
+ 'ringFour': ringFourComponent,
76
+ 'ringFive': ringFiveComponent,
77
+ };
78
+ }
79
+ ;
@@ -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/sK2mrFhCZwQu1qw4WqOBEF/%40dicebear%2Frings
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
+ width: number;
14
+ height: number;
15
+ rotation: number[];
16
+ offsetX: number[];
17
+ offsetY: number[];
18
+ };
19
+ export declare function pickComponent({ prng, group, width, height, values, rotation, offsetX, offsetY }: Props): ComponentPick;
20
+ export {};
@@ -0,0 +1,33 @@
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/sK2mrFhCZwQu1qw4WqOBEF/%40dicebear%2Frings
6
+ */
7
+ import * as components from '../components/index.js';
8
+ export function pickComponent({ prng, group, width, height, values = [], rotation, offsetX, offsetY }) {
9
+ const componentCollection = components;
10
+ const key = prng.pick(values);
11
+ const pickedRotation = prng.integer(Math.min(...rotation), Math.max(...rotation));
12
+ const pickedOffsetX = prng.integer(Math.min(...offsetX), Math.max(...offsetX));
13
+ const pickedOffsetY = prng.integer(Math.min(...offsetY), Math.max(...offsetY));
14
+ if (key && componentCollection[group][key]) {
15
+ return {
16
+ name: key,
17
+ value(components, colors) {
18
+ var _a, _b, _c;
19
+ let result = componentCollection[group][key](components, colors);
20
+ if (this.rotation || this.offsetX || this.offsetY) {
21
+ result = `<g transform="translate(${((_a = this.offsetX) !== null && _a !== void 0 ? _a : 0)}, ${(_b = this.offsetY) !== null && _b !== void 0 ? _b : 0}) rotate(${(_c = this.rotation) !== null && _c !== void 0 ? _c : 0} ${width / 2} ${height / 2})">${result}</g>`;
22
+ }
23
+ return result;
24
+ },
25
+ rotation: pickedRotation,
26
+ offsetX: pickedOffsetX,
27
+ offsetY: pickedOffsetY,
28
+ };
29
+ }
30
+ else {
31
+ return undefined;
32
+ }
33
+ }
package/package.json ADDED
@@ -0,0 +1,48 @@
1
+ {
2
+ "name": "@dicebear/rings",
3
+ "version": "7.0.0-rc.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": "7.0.0-rc.0",
33
+ "@tsconfig/recommended": "^1.0.2",
34
+ "del-cli": "^5.0.0",
35
+ "typescript": "^5.1.6",
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": "025037b3c8d7affaf2f87496e1fba835df22b555"
48
+ }