grevlingui 0.1.8 → 0.1.10
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/Buttons/Buttons.css +53 -2
- package/Buttons/ResetButton.js +51 -0
- package/Dots/Dots.css +15 -5
- package/Dots/Dots.js +12 -7
- package/SunMoon.js +62 -0
- package/index.js +24 -0
- package/package.json +1 -1
package/Buttons/Buttons.css
CHANGED
|
@@ -1,13 +1,64 @@
|
|
|
1
|
+
.settingsButton,
|
|
2
|
+
.resetButton {
|
|
3
|
+
outline: none;
|
|
4
|
+
background: none;
|
|
5
|
+
border: none;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.resetButton,
|
|
1
9
|
.settingsButton {
|
|
2
10
|
height: 50px;
|
|
3
11
|
width: 50px;
|
|
4
12
|
padding: 10px;
|
|
5
13
|
border-radius: 10px;
|
|
6
|
-
background: none;
|
|
7
|
-
border: none;
|
|
8
14
|
}
|
|
9
15
|
|
|
10
16
|
.settingsButton svg {
|
|
11
17
|
height: 100%;
|
|
12
18
|
width: 100%;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.resetButton {
|
|
22
|
+
padding: 5px;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.resetButton svg {
|
|
26
|
+
height: 40px;
|
|
27
|
+
width: 40px;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@-ms-keyframes spinCC {
|
|
31
|
+
from {
|
|
32
|
+
-ms-transform: rotate(0deg);
|
|
33
|
+
}
|
|
34
|
+
to {
|
|
35
|
+
-ms-transform: rotate(-360deg);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
@-moz-keyframes spinCC {
|
|
40
|
+
from {
|
|
41
|
+
-moz-transform: rotate(0deg);
|
|
42
|
+
}
|
|
43
|
+
to {
|
|
44
|
+
-moz-transform: rotate(-360deg);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
@-webkit-keyframes spinCC {
|
|
49
|
+
from {
|
|
50
|
+
-webkit-transform: rotate(0deg);
|
|
51
|
+
}
|
|
52
|
+
to {
|
|
53
|
+
-webkit-transform: rotate(-360deg);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
@keyframes spinCC {
|
|
58
|
+
from {
|
|
59
|
+
transform: rotate(0deg);
|
|
60
|
+
}
|
|
61
|
+
to {
|
|
62
|
+
transform: rotate(-360deg);
|
|
63
|
+
}
|
|
13
64
|
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ResetButton = void 0;
|
|
7
|
+
|
|
8
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
|
|
12
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
13
|
+
|
|
14
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
15
|
+
|
|
16
|
+
const ResetButton = _ref => {
|
|
17
|
+
let {
|
|
18
|
+
onClick: _onClick,
|
|
19
|
+
color = 'white',
|
|
20
|
+
backgroundColor
|
|
21
|
+
} = _ref;
|
|
22
|
+
const [spin, setSpin] = (0, _react.useState)(false);
|
|
23
|
+
return /*#__PURE__*/_react.default.createElement("button", {
|
|
24
|
+
className: "resetButton ".concat(spin ? 'spin' : ''),
|
|
25
|
+
onClick: () => {
|
|
26
|
+
_onClick();
|
|
27
|
+
|
|
28
|
+
if (spin) return;
|
|
29
|
+
setSpin(true);
|
|
30
|
+
setTimeout(() => {
|
|
31
|
+
setSpin(false);
|
|
32
|
+
}, 400);
|
|
33
|
+
},
|
|
34
|
+
style: {
|
|
35
|
+
backgroundColor
|
|
36
|
+
}
|
|
37
|
+
}, /*#__PURE__*/_react.default.createElement("svg", {
|
|
38
|
+
viewBox: "0 0 90 90",
|
|
39
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
40
|
+
fill: color,
|
|
41
|
+
style: spin ? {
|
|
42
|
+
animation: 'spinCC 400ms linear'
|
|
43
|
+
} : {}
|
|
44
|
+
}, /*#__PURE__*/_react.default.createElement("path", {
|
|
45
|
+
d: "M52.7646 16.0222C58.4958 17.5579 63.643 20.7586 67.5552 25.2196C71.4674 29.6806 73.9689 35.2015 74.7433 41.0842C75.5178 46.9669 74.5305 52.9471 71.9062 58.2686C69.2819 63.5902 65.1385 68.014 60 70.9807C54.8615 73.9475 48.9586 75.3238 43.0379 74.9357C37.1172 74.5477 31.4445 72.4126 26.7372 68.8006C22.0298 65.1885 18.4993 60.2617 16.5921 54.6432C14.6849 49.0246 14.4865 42.9667 16.0222 37.2354L26.5314 40.0513C25.5527 43.7041 25.6791 47.565 26.8946 51.1459C28.1102 54.7268 30.3603 57.8669 33.3604 60.169C36.3606 62.471 39.976 63.8318 43.7495 64.0791C47.523 64.3264 51.2851 63.4492 54.56 61.5584C57.835 59.6677 60.4757 56.8482 62.1483 53.4566C63.8208 50.065 64.4501 46.2535 63.9565 42.5043C63.4629 38.7551 61.8686 35.2364 59.3752 32.3932C56.8819 29.5501 53.6014 27.5101 49.9486 26.5314L52.7646 16.0222Z"
|
|
46
|
+
}), /*#__PURE__*/_react.default.createElement("path", {
|
|
47
|
+
d: "M60.8172 6.52009L38.3382 17.6037L49.0722 39.3736L57.9016 35.0202L51.3837 21.8011L65.0334 15.0709L60.8172 6.52009Z"
|
|
48
|
+
})));
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
exports.ResetButton = ResetButton;
|
package/Dots/Dots.css
CHANGED
|
@@ -3,15 +3,25 @@
|
|
|
3
3
|
display: grid;
|
|
4
4
|
grid-template-columns: repeat(3, 2rem);
|
|
5
5
|
grid-template-rows: repeat(3, 2rem);
|
|
6
|
-
|
|
7
|
-
/*transform: rotate(45deg);*/
|
|
8
6
|
height: 6rem;
|
|
9
7
|
width: 6rem;
|
|
10
8
|
}
|
|
11
9
|
|
|
10
|
+
.flipped.dots {
|
|
11
|
+
transform: rotate(45deg);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.big.dots {
|
|
15
|
+
grid-template-columns: repeat(4, 2rem);
|
|
16
|
+
grid-template-rows: repeat(4, 2rem);
|
|
17
|
+
height: 8rem;
|
|
18
|
+
width: 8rem;
|
|
19
|
+
transform: rotate(135deg);
|
|
20
|
+
}
|
|
21
|
+
|
|
12
22
|
.dots .dot {
|
|
13
|
-
width:
|
|
14
|
-
height:
|
|
23
|
+
width: 26px;
|
|
24
|
+
height: 26px;
|
|
15
25
|
border-radius: 100%;
|
|
16
|
-
|
|
26
|
+
margin: 3px;
|
|
17
27
|
}
|
package/Dots/Dots.js
CHANGED
|
@@ -18,24 +18,29 @@ require("./Dots.css");
|
|
|
18
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
19
|
|
|
20
20
|
const Dots = _ref => {
|
|
21
|
-
var _grids$num;
|
|
21
|
+
var _grids$version$num;
|
|
22
22
|
|
|
23
23
|
let {
|
|
24
|
-
num
|
|
24
|
+
num,
|
|
25
|
+
color,
|
|
26
|
+
version = 0
|
|
25
27
|
} = _ref;
|
|
26
|
-
const grids = [[], [4], [0, 8], [0, 4, 8], [0, 2, 6, 8], [0, 2, 4, 6, 8], [0, 2, 3, 5, 6, 8], [0, 2, 3, 4, 5, 6, 8], [0, 1, 2, 3, 5, 6, 7, 8], [0, 1, 2, 3, 4, 5, 6, 7, 8]];
|
|
27
|
-
const grid = (_grids$num = grids[num]) !== null && _grids$num !== void 0 ? _grids$num : [];
|
|
28
|
+
const grids = [[[], [4], [0, 8], [0, 4, 8], [0, 2, 6, 8], [0, 2, 4, 6, 8], [0, 2, 3, 5, 6, 8], [0, 2, 3, 4, 5, 6, 8], [0, 1, 2, 3, 5, 6, 7, 8], [0, 1, 2, 3, 4, 5, 6, 7, 8]], [[], [4], [0, 8], [0, 4, 8], [0, 2, 6, 8], [0, 2, 4, 6, 8], [0, 2, 5, 6, 7, 8], [0, 2, 4, 5, 6, 7, 8], [0, 1, 2, 3, 5, 6, 7, 8], [0, 1, 2, 3, 4, 5, 6, 7, 8]], [[], [8], [4, 8], [2, 6, 8], [0, 2, 6, 8], [0, 2, 4, 6, 8], [0, 2, 5, 6, 7, 8], [0, 2, 4, 5, 6, 7, 8], [0, 1, 2, 3, 5, 6, 7, 8], [0, 1, 2, 3, 4, 5, 6, 7, 8]], [[], [0], [1, 4], [0, 1, 4], [0, 1, 4, 5], [0, 1, 4, 6, 9], [0, 1, 4, 5, 6, 9], [0, 1, 4, 5, 6, 9, 10], [0, 1, 4, 5, 6, 9, 11, 14], [0, 1, 4, 5, 6, 9, 10, 11, 14], [0, 1, 4, 5, 6, 9, 10, 11, 14, 15]], [[], [0], [0, 5], [0, 1, 4], [0, 1, 4, 5], [0, 1, 4, 5, 10], [0, 1, 4, 5, 6, 9], [0, 1, 4, 5, 6, 9, 10], [0, 1, 4, 5, 6, 9, 10, 15], [0, 1, 4, 5, 6, 9, 10, 11, 14], [0, 1, 4, 5, 6, 9, 10, 11, 14, 15]]];
|
|
29
|
+
const grid = (_grids$version$num = grids[version][num]) !== null && _grids$version$num !== void 0 ? _grids$version$num : [];
|
|
28
30
|
|
|
29
31
|
const renderDot = i => grid.includes(i) ? /*#__PURE__*/_react.default.createElement("div", {
|
|
30
32
|
key: "dot-".concat(i),
|
|
31
|
-
className: "dot"
|
|
33
|
+
className: "dot",
|
|
34
|
+
style: {
|
|
35
|
+
backgroundColor: color !== null && color !== void 0 ? color : 'black'
|
|
36
|
+
}
|
|
32
37
|
}) : /*#__PURE__*/_react.default.createElement("div", {
|
|
33
38
|
key: "dot-".concat(i)
|
|
34
39
|
});
|
|
35
40
|
|
|
36
41
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
37
|
-
className: "dots"
|
|
38
|
-
}, [...Array(9).keys()].map(renderDot));
|
|
42
|
+
className: "dots".concat(version ? ' flipped' : '').concat(version > 2 ? ' big' : '')
|
|
43
|
+
}, [...Array(version > 2 ? 16 : 9).keys()].map(renderDot));
|
|
39
44
|
};
|
|
40
45
|
|
|
41
46
|
exports.Dots = Dots;
|
package/SunMoon.js
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.SunMoon = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
|
|
12
|
+
const SunMoon = _ref => {
|
|
13
|
+
let {
|
|
14
|
+
sun,
|
|
15
|
+
color = 'white',
|
|
16
|
+
tt = 300,
|
|
17
|
+
size = 32,
|
|
18
|
+
onClick
|
|
19
|
+
} = _ref;
|
|
20
|
+
|
|
21
|
+
const transition = keys => keys.map(key => "".concat(key, " ").concat(tt, "ms linear")).join(', ');
|
|
22
|
+
|
|
23
|
+
const path = d => /*#__PURE__*/_react.default.createElement("path", {
|
|
24
|
+
d: d,
|
|
25
|
+
fill: color,
|
|
26
|
+
style: {
|
|
27
|
+
transition: transition(['d', 'fill'])
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
const circle = (cx, cy, r, fill) => /*#__PURE__*/_react.default.createElement("circle", {
|
|
32
|
+
cx: cx,
|
|
33
|
+
cy: cy,
|
|
34
|
+
r: r,
|
|
35
|
+
fill: fill,
|
|
36
|
+
style: {
|
|
37
|
+
transition: transition(['r', 'cy', 'cx', 'fill'])
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
return /*#__PURE__*/_react.default.createElement("svg", {
|
|
42
|
+
width: size,
|
|
43
|
+
height: size,
|
|
44
|
+
viewBox: "0 0 120 120",
|
|
45
|
+
fill: color,
|
|
46
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
47
|
+
style: {
|
|
48
|
+
transition: "fill ".concat(tt, "ms linear")
|
|
49
|
+
},
|
|
50
|
+
onClick: onClick
|
|
51
|
+
}, /*#__PURE__*/_react.default.createElement("mask", {
|
|
52
|
+
id: "moonMask"
|
|
53
|
+
}, /*#__PURE__*/_react.default.createElement("rect", {
|
|
54
|
+
height: "10000",
|
|
55
|
+
width: "10000",
|
|
56
|
+
fill: "white"
|
|
57
|
+
}), sun ? circle("91", "43", "0", "black") : circle("73", "53", "35", "black")), /*#__PURE__*/_react.default.createElement("g", {
|
|
58
|
+
mask: "url(#moonMask)"
|
|
59
|
+
}, sun ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, path("M60 2L68 18H52L60 2Z"), path("M60 118L52 102L68 102L60 118Z"), path("M89 9.77053L87.9282 27.6269L74.0718 19.6269L89 9.77053Z"), path("M31 110.229L32.0718 92.3731L45.9282 100.373L31 110.229Z"), path("M110.229 31L100.373 45.9282L92.3731 32.0718L110.229 31Z"), path("M9.77053 89L19.6269 74.0718L27.6269 87.9282L9.77053 89Z"), path("M118 60L102 68L102 52L118 60Z"), path("M2 60L18 52L18 68L2 60Z"), path("M110.229 89L92.3731 87.9282L100.373 74.0718L110.229 89Z"), path("M9.77052 31L27.6269 32.0718L19.6269 45.9282L9.77052 31Z"), path("M89 110.229L74.0718 100.373L87.9282 92.3731L89 110.229Z"), path("M31 9.77053L45.9282 19.6269L32.0718 27.6269L31 9.77053Z"), circle("60", "60", "35", color)) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, path("M60 15L68 31H52L60 15Z"), path("M60 105L52 89L68 89L60 105Z"), path("M82.5 21.0289L81.4282 38.8853L67.5718 30.8853L82.5 21.0289Z"), path("M37.5 98.9711L38.5718 81.1147L52.4282 89.1147L37.5 98.9711Z"), path("M98.9712 37.5L89.1148 52.4282L81.1148 38.5718L98.9712 37.5Z"), path("M21.0289 82.5L30.8853 67.5718L38.8853 81.4282L21.0289 82.5Z"), path("M105 60L89 68L89 52L105 60Z"), path("M15 60L31 52L31 68L15 60Z"), path("M98.9711 82.5L81.1147 81.4282L89.1147 67.5718L98.9711 82.5Z"), path("M21.0288 37.5L38.8852 38.5718L30.8852 52.4282L21.0288 37.5Z"), path("M82.5 98.9711L67.5718 89.1147L81.4282 81.1147L82.5 98.9711Z"), path("M37.5 21.0289L52.4282 30.8853L38.5718 38.8853L37.5 21.0289Z"), circle("60", "60", "45", color))));
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
exports.SunMoon = SunMoon;
|
package/index.js
CHANGED
|
@@ -9,6 +9,12 @@ Object.defineProperty(exports, "CheckBox", {
|
|
|
9
9
|
return _CheckBox.CheckBox;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
+
Object.defineProperty(exports, "Dots", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function get() {
|
|
15
|
+
return _Dots.Dots;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
12
18
|
Object.defineProperty(exports, "Menu", {
|
|
13
19
|
enumerable: true,
|
|
14
20
|
get: function get() {
|
|
@@ -39,12 +45,24 @@ Object.defineProperty(exports, "RadioGroup", {
|
|
|
39
45
|
return _Radio.RadioGroup;
|
|
40
46
|
}
|
|
41
47
|
});
|
|
48
|
+
Object.defineProperty(exports, "ResetButton", {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
get: function get() {
|
|
51
|
+
return _ResetButton.ResetButton;
|
|
52
|
+
}
|
|
53
|
+
});
|
|
42
54
|
Object.defineProperty(exports, "SettingsButton", {
|
|
43
55
|
enumerable: true,
|
|
44
56
|
get: function get() {
|
|
45
57
|
return _SettingsButton.SettingsButton;
|
|
46
58
|
}
|
|
47
59
|
});
|
|
60
|
+
Object.defineProperty(exports, "SunMoon", {
|
|
61
|
+
enumerable: true,
|
|
62
|
+
get: function get() {
|
|
63
|
+
return _SunMoon.SunMoon;
|
|
64
|
+
}
|
|
65
|
+
});
|
|
48
66
|
Object.defineProperty(exports, "ToggleSwitch", {
|
|
49
67
|
enumerable: true,
|
|
50
68
|
get: function get() {
|
|
@@ -74,10 +92,16 @@ var _SettingsButton = require("./Buttons/SettingsButton");
|
|
|
74
92
|
|
|
75
93
|
var _MenuButton = require("./Buttons/MenuButton");
|
|
76
94
|
|
|
95
|
+
var _ResetButton = require("./Buttons/ResetButton");
|
|
96
|
+
|
|
77
97
|
var _Radio = require("./Radio");
|
|
78
98
|
|
|
79
99
|
var _CheckBox = require("./CheckBox");
|
|
80
100
|
|
|
101
|
+
var _Dots = require("./Dots/Dots");
|
|
102
|
+
|
|
103
|
+
var _SunMoon = require("./SunMoon");
|
|
104
|
+
|
|
81
105
|
var _ToggleSwitch = require("./ToggleSwitch");
|
|
82
106
|
|
|
83
107
|
var _NumberSelect = require("./NumberSelect/NumberSelect");
|