@flodesk/grain 2.7.4 → 2.8.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/es/components/box/index.js +867 -58
- package/es/components/button/index.js +97 -32
- package/es/components/index.js +39 -4
- package/es/components/input/index.js +55 -25
- package/es/components/text/index.js +156 -33
- package/es/index.js +38 -2
- package/es/styles/components-variables.css +13 -7
- package/es/styles/variables.css +11 -0
- package/es/types/index.js +31 -14
- package/es/utilities/index.js +88 -33
- package/es/variables/index.js +23 -4
- package/package.json +2 -1
|
@@ -1,41 +1,106 @@
|
|
|
1
|
-
|
|
2
|
-
import "core-js/modules/es.object.freeze.js";
|
|
3
|
-
import "core-js/modules/es.object.define-properties.js";
|
|
4
|
-
import "core-js/modules/es.object.keys.js";
|
|
5
|
-
import "core-js/modules/es.array.index-of.js";
|
|
6
|
-
import "core-js/modules/es.symbol.js";
|
|
7
|
-
var _excluded = ["children", "size", "weight", "color", "tag"];
|
|
1
|
+
"use strict";
|
|
8
2
|
|
|
9
|
-
|
|
3
|
+
require("core-js/modules/es.object.define-property.js");
|
|
10
4
|
|
|
11
|
-
|
|
5
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
12
6
|
|
|
13
|
-
|
|
7
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
exports.Button = void 0;
|
|
14
11
|
|
|
15
|
-
|
|
12
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
16
13
|
|
|
17
|
-
|
|
14
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
18
15
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
var
|
|
24
|
-
|
|
16
|
+
require("core-js/modules/es.array.concat.js");
|
|
17
|
+
|
|
18
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
19
|
+
|
|
20
|
+
var _utilities = require("../../utilities");
|
|
21
|
+
|
|
22
|
+
var _react = _interopRequireDefault(require("react"));
|
|
23
|
+
|
|
24
|
+
var _styled = _interopRequireDefault(require("@emotion/styled"));
|
|
25
|
+
|
|
26
|
+
var _react2 = require("@emotion/react");
|
|
27
|
+
|
|
28
|
+
var _excluded = ["children", "tag", "variant", "isDisabled"];
|
|
29
|
+
|
|
30
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
31
|
+
|
|
32
|
+
var __jsx = _react.default.createElement;
|
|
33
|
+
var variants = {
|
|
34
|
+
neutral: (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n color: inherit;\n background-color: transparent;\n border-color: ", ";\n\n &:hover {\n border-color: ", ";\n }\n &:active {\n border-color: ", ";\n }\n "])), (0, _utilities.getColor)('buttonBorder'), (0, _utilities.getColor)('buttonBorderHover'), (0, _utilities.getColor)('buttonBorderActive')),
|
|
35
|
+
primary: (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n color: white;\n background-color: ", ";\n border-color: transparent;\n\n &:hover {\n background-color: ", ";\n }\n &:active {\n color: ", ";\n background-color: black;\n }\n "])), (0, _utilities.getColor)('body'), (0, _utilities.getColor)('grey7'), (0, _utilities.getColor)('grey2'))
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
var Wrapper = _styled.default.button(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n appearance: none;\n border: none;\n font-family: inherit;\n font-size: inherit;\n cursor: pointer;\n border-width: 1px;\n border-style: solid;\n font-weight: ", ";\n border-radius: ", ";\n transition: ", ";\n height: var(--grn-textBoxHeight-m);\n padding: 0 var(--grn-buttonTextBoxPaddingX-m);\n \n ", ";\n \n ", ";\n \n &:hover {\n transition: ", ";\n }\n \n &:active {\n transition: 0s;\n }\n"])), (0, _utilities.getWeight)('medium'), (0, _utilities.getRadius)('s'), (0, _utilities.getTransition)('slow'), function (p) {
|
|
39
|
+
return !p.isDisabled && variants[p.variant];
|
|
40
|
+
}, function (p) {
|
|
41
|
+
return p.isDisabled && "\n color: ".concat((0, _utilities.getColor)('disabledContent'), ";\n background-color: ").concat((0, _utilities.getColor)('disabledBackground'), ";\n border-color: transparent;\n cursor: default;\n ");
|
|
42
|
+
}, (0, _utilities.getTransition)('fast'));
|
|
43
|
+
|
|
44
|
+
var ButtonText = _styled.default.span(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n --opticalCompensation: -0.3px;\n\n position: relative;\n top: var(--opticalCompensation);\n"])));
|
|
45
|
+
|
|
46
|
+
var Button = function Button(_ref) {
|
|
25
47
|
var children = _ref.children,
|
|
26
|
-
_ref$size = _ref.size,
|
|
27
|
-
size = _ref$size === void 0 ? 'm' : _ref$size,
|
|
28
|
-
_ref$weight = _ref.weight,
|
|
29
|
-
weight = _ref$weight === void 0 ? 'normal' : _ref$weight,
|
|
30
|
-
color = _ref.color,
|
|
31
48
|
tag = _ref.tag,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
49
|
+
_ref$variant = _ref.variant,
|
|
50
|
+
variant = _ref$variant === void 0 ? 'neutral' : _ref$variant,
|
|
51
|
+
isDisabled = _ref.isDisabled,
|
|
52
|
+
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
53
|
+
return __jsx(Wrapper, (0, _extends2.default)({
|
|
54
|
+
as: tag,
|
|
55
|
+
variant: variant,
|
|
56
|
+
isDisabled: isDisabled
|
|
57
|
+
}, props), __jsx(ButtonText, null, children));
|
|
40
58
|
};
|
|
41
|
-
|
|
59
|
+
|
|
60
|
+
exports.Button = Button;
|
|
61
|
+
Button.__docgenInfo = {
|
|
62
|
+
"description": "",
|
|
63
|
+
"methods": [],
|
|
64
|
+
"displayName": "Button",
|
|
65
|
+
"props": {
|
|
66
|
+
"variant": {
|
|
67
|
+
"defaultValue": {
|
|
68
|
+
"value": "'neutral'",
|
|
69
|
+
"computed": false
|
|
70
|
+
},
|
|
71
|
+
"type": {
|
|
72
|
+
"name": "enum",
|
|
73
|
+
"value": [{
|
|
74
|
+
"value": "\"neutral\"",
|
|
75
|
+
"computed": false
|
|
76
|
+
}, {
|
|
77
|
+
"value": "\"primary\"",
|
|
78
|
+
"computed": false
|
|
79
|
+
}]
|
|
80
|
+
},
|
|
81
|
+
"required": false,
|
|
82
|
+
"description": ""
|
|
83
|
+
},
|
|
84
|
+
"children": {
|
|
85
|
+
"type": {
|
|
86
|
+
"name": "node"
|
|
87
|
+
},
|
|
88
|
+
"required": false,
|
|
89
|
+
"description": ""
|
|
90
|
+
},
|
|
91
|
+
"onClick": {
|
|
92
|
+
"type": {
|
|
93
|
+
"name": "func"
|
|
94
|
+
},
|
|
95
|
+
"required": false,
|
|
96
|
+
"description": ""
|
|
97
|
+
},
|
|
98
|
+
"isDisabled": {
|
|
99
|
+
"type": {
|
|
100
|
+
"name": "bool"
|
|
101
|
+
},
|
|
102
|
+
"required": false,
|
|
103
|
+
"description": ""
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
};
|
package/es/components/index.js
CHANGED
|
@@ -1,4 +1,39 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.object.define-property.js");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
Object.defineProperty(exports, "Text", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function get() {
|
|
11
|
+
return _text.Text;
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
Object.defineProperty(exports, "Box", {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function get() {
|
|
17
|
+
return _box.Box;
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
Object.defineProperty(exports, "Button", {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
get: function get() {
|
|
23
|
+
return _button.Button;
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
Object.defineProperty(exports, "Input", {
|
|
27
|
+
enumerable: true,
|
|
28
|
+
get: function get() {
|
|
29
|
+
return _input.Input;
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
var _text = require("./text");
|
|
34
|
+
|
|
35
|
+
var _box = require("./box");
|
|
36
|
+
|
|
37
|
+
var _button = require("./button");
|
|
38
|
+
|
|
39
|
+
var _input = require("./input");
|
|
@@ -1,45 +1,75 @@
|
|
|
1
|
-
|
|
2
|
-
import "core-js/modules/es.object.freeze.js";
|
|
3
|
-
import "core-js/modules/es.object.define-properties.js";
|
|
4
|
-
import "core-js/modules/es.object.keys.js";
|
|
5
|
-
import "core-js/modules/es.array.index-of.js";
|
|
6
|
-
import "core-js/modules/es.symbol.js";
|
|
7
|
-
var _excluded = ["value", "placeholder", "size"];
|
|
1
|
+
"use strict";
|
|
8
2
|
|
|
9
|
-
|
|
3
|
+
require("core-js/modules/es.object.define-property.js");
|
|
4
|
+
|
|
5
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
exports.Input = void 0;
|
|
11
|
+
|
|
12
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
|
+
|
|
14
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
15
|
+
|
|
16
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
10
17
|
|
|
11
|
-
|
|
18
|
+
var _utilities = require("../../utilities");
|
|
12
19
|
|
|
13
|
-
|
|
20
|
+
var _react = _interopRequireDefault(require("react"));
|
|
14
21
|
|
|
15
|
-
|
|
22
|
+
var _styled = _interopRequireDefault(require("@emotion/styled"));
|
|
16
23
|
|
|
17
|
-
|
|
24
|
+
var _types = require("../../types");
|
|
18
25
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
26
|
+
var _excluded = ["value", "placeholder", "size"];
|
|
27
|
+
|
|
28
|
+
var _templateObject;
|
|
29
|
+
|
|
30
|
+
var __jsx = _react.default.createElement;
|
|
31
|
+
|
|
32
|
+
var Wrapper = _styled.default.input(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n appearance: none;\n border: none;\n font-family: inherit;\n background-color: transparent;\n color: inherit;\n font-size: ", ";\n border-radius: ", ";\n border: 1px solid ", ";\n height: ", ";\n padding: 0 ", ";\n width: 100%;\n"])), function (p) {
|
|
33
|
+
return (0, _utilities.getTextSize)(p.size);
|
|
34
|
+
}, (0, _utilities.getRadius)('m'), (0, _utilities.getColor)('grey3'), function (p) {
|
|
27
35
|
return "var(--grn-textBoxHeight-".concat(p.size, ")");
|
|
28
36
|
}, function (p) {
|
|
29
37
|
return "var(--grn-fieldTextBoxPaddingX-".concat(p.size, ")");
|
|
30
38
|
});
|
|
31
|
-
|
|
39
|
+
|
|
40
|
+
var Input = function Input(_ref) {
|
|
32
41
|
var value = _ref.value,
|
|
33
42
|
_ref$placeholder = _ref.placeholder,
|
|
34
43
|
placeholder = _ref$placeholder === void 0 ? 'Placeholder' : _ref$placeholder,
|
|
35
44
|
_ref$size = _ref.size,
|
|
36
45
|
size = _ref$size === void 0 ? 'm' : _ref$size,
|
|
37
|
-
props =
|
|
38
|
-
|
|
39
|
-
return /*#__PURE__*/React.createElement(Wrapper, Object.assign({
|
|
46
|
+
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
47
|
+
return __jsx(Wrapper, (0, _extends2.default)({
|
|
40
48
|
value: value,
|
|
41
49
|
placeholder: placeholder,
|
|
42
50
|
size: size
|
|
43
51
|
}, props));
|
|
44
52
|
};
|
|
45
|
-
|
|
53
|
+
|
|
54
|
+
exports.Input = Input;
|
|
55
|
+
Input.__docgenInfo = {
|
|
56
|
+
"description": "",
|
|
57
|
+
"methods": [],
|
|
58
|
+
"displayName": "Input",
|
|
59
|
+
"props": {
|
|
60
|
+
"placeholder": {
|
|
61
|
+
"defaultValue": {
|
|
62
|
+
"value": "'Placeholder'",
|
|
63
|
+
"computed": false
|
|
64
|
+
},
|
|
65
|
+
"required": false
|
|
66
|
+
},
|
|
67
|
+
"size": {
|
|
68
|
+
"defaultValue": {
|
|
69
|
+
"value": "'m'",
|
|
70
|
+
"computed": false
|
|
71
|
+
},
|
|
72
|
+
"required": false
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
};
|
|
@@ -1,32 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
import "core-js/modules/es.object.freeze.js";
|
|
3
|
-
import "core-js/modules/es.object.define-properties.js";
|
|
4
|
-
import "core-js/modules/es.object.keys.js";
|
|
5
|
-
import "core-js/modules/es.array.index-of.js";
|
|
6
|
-
import "core-js/modules/es.symbol.js";
|
|
7
|
-
var _excluded = ["children", "size", "weight", "color", "tag", "hasEllipsis", "ellipsisLines", "align"];
|
|
1
|
+
"use strict";
|
|
8
2
|
|
|
9
|
-
|
|
3
|
+
require("core-js/modules/es.object.define-property.js");
|
|
4
|
+
|
|
5
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
exports.Text = void 0;
|
|
11
|
+
|
|
12
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
|
+
|
|
14
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
15
|
+
|
|
16
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
10
17
|
|
|
11
|
-
|
|
18
|
+
var _utilities = require("../../utilities");
|
|
12
19
|
|
|
13
|
-
|
|
20
|
+
var _react = _interopRequireDefault(require("react"));
|
|
14
21
|
|
|
15
|
-
|
|
22
|
+
var _styled = _interopRequireDefault(require("@emotion/styled"));
|
|
16
23
|
|
|
17
|
-
|
|
24
|
+
var _types = require("../../types");
|
|
18
25
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
+
var _excluded = ["children", "size", "weight", "color", "tag", "hasEllipsis", "ellipsisLines", "align"];
|
|
27
|
+
|
|
28
|
+
var _templateObject;
|
|
29
|
+
|
|
30
|
+
var __jsx = _react.default.createElement;
|
|
31
|
+
|
|
32
|
+
var Wrapper = _styled.default.span(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: block;\n font-size: ", ";\n font-weight: ", ";\n color: ", ";\n text-align: ", ";\n \n ", ";\n ", ";\n ", ";\n"])), function (p) {
|
|
33
|
+
return (0, _utilities.getTextSize)(p.size);
|
|
26
34
|
}, function (p) {
|
|
27
|
-
return getWeight(p.weight);
|
|
35
|
+
return (0, _utilities.getWeight)(p.weight);
|
|
28
36
|
}, function (p) {
|
|
29
|
-
return getColor(p.color);
|
|
37
|
+
return (0, _utilities.getColor)(p.color);
|
|
30
38
|
}, function (p) {
|
|
31
39
|
return p.align;
|
|
32
40
|
}, function (p) {
|
|
@@ -36,7 +44,8 @@ var Wrapper = styled.span(_templateObject || (_templateObject = _taggedTemplateL
|
|
|
36
44
|
}, function (p) {
|
|
37
45
|
return p.hasEllipsis && p.ellipsisLines && "\n display: -webkit-box;\n -webkit-line-clamp: ".concat(p.ellipsisLines, ";\n -webkit-box-orient: vertical;\n ");
|
|
38
46
|
});
|
|
39
|
-
|
|
47
|
+
|
|
48
|
+
var Text = function Text(_ref) {
|
|
40
49
|
var children = _ref.children,
|
|
41
50
|
_ref$size = _ref.size,
|
|
42
51
|
size = _ref$size === void 0 ? 'm' : _ref$size,
|
|
@@ -47,9 +56,8 @@ export var Text = function Text(_ref) {
|
|
|
47
56
|
hasEllipsis = _ref.hasEllipsis,
|
|
48
57
|
ellipsisLines = _ref.ellipsisLines,
|
|
49
58
|
align = _ref.align,
|
|
50
|
-
props =
|
|
51
|
-
|
|
52
|
-
return /*#__PURE__*/React.createElement(Wrapper, Object.assign({
|
|
59
|
+
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
60
|
+
return __jsx(Wrapper, (0, _extends2.default)({
|
|
53
61
|
size: size,
|
|
54
62
|
weight: weight,
|
|
55
63
|
color: color,
|
|
@@ -59,12 +67,127 @@ export var Text = function Text(_ref) {
|
|
|
59
67
|
align: align
|
|
60
68
|
}, props), children);
|
|
61
69
|
};
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
+
|
|
71
|
+
exports.Text = Text;
|
|
72
|
+
Text.__docgenInfo = {
|
|
73
|
+
"description": "",
|
|
74
|
+
"methods": [],
|
|
75
|
+
"displayName": "Text",
|
|
76
|
+
"props": {
|
|
77
|
+
"size": {
|
|
78
|
+
"defaultValue": {
|
|
79
|
+
"value": "'m'",
|
|
80
|
+
"computed": false
|
|
81
|
+
},
|
|
82
|
+
"type": {
|
|
83
|
+
"name": "union",
|
|
84
|
+
"value": [{
|
|
85
|
+
"name": "enum",
|
|
86
|
+
"value": [{
|
|
87
|
+
"value": "\"s\"",
|
|
88
|
+
"computed": false
|
|
89
|
+
}, {
|
|
90
|
+
"value": "\"m\"",
|
|
91
|
+
"computed": false
|
|
92
|
+
}, {
|
|
93
|
+
"value": "\"l\"",
|
|
94
|
+
"computed": false
|
|
95
|
+
}, {
|
|
96
|
+
"value": "\"xl\"",
|
|
97
|
+
"computed": false
|
|
98
|
+
}, {
|
|
99
|
+
"value": "\"xxl\"",
|
|
100
|
+
"computed": false
|
|
101
|
+
}]
|
|
102
|
+
}, {
|
|
103
|
+
"name": "number"
|
|
104
|
+
}, {
|
|
105
|
+
"name": "string"
|
|
106
|
+
}]
|
|
107
|
+
},
|
|
108
|
+
"required": false,
|
|
109
|
+
"description": ""
|
|
110
|
+
},
|
|
111
|
+
"weight": {
|
|
112
|
+
"defaultValue": {
|
|
113
|
+
"value": "'normal'",
|
|
114
|
+
"computed": false
|
|
115
|
+
},
|
|
116
|
+
"type": {
|
|
117
|
+
"name": "enum",
|
|
118
|
+
"value": [{
|
|
119
|
+
"value": "\"normal\"",
|
|
120
|
+
"computed": false
|
|
121
|
+
}, {
|
|
122
|
+
"value": "\"medium\"",
|
|
123
|
+
"computed": false
|
|
124
|
+
}, {
|
|
125
|
+
"value": "\"semiBold\"",
|
|
126
|
+
"computed": false
|
|
127
|
+
}]
|
|
128
|
+
},
|
|
129
|
+
"required": false,
|
|
130
|
+
"description": ""
|
|
131
|
+
},
|
|
132
|
+
"color": {
|
|
133
|
+
"type": {
|
|
134
|
+
"name": "union",
|
|
135
|
+
"value": [{
|
|
136
|
+
"name": "enum",
|
|
137
|
+
"value": [{
|
|
138
|
+
"value": "\"greys\"",
|
|
139
|
+
"computed": false
|
|
140
|
+
}, {
|
|
141
|
+
"value": "\"baseColors\"",
|
|
142
|
+
"computed": false
|
|
143
|
+
}, {
|
|
144
|
+
"value": "\"semanticColors\"",
|
|
145
|
+
"computed": false
|
|
146
|
+
}]
|
|
147
|
+
}, {
|
|
148
|
+
"name": "string"
|
|
149
|
+
}]
|
|
150
|
+
},
|
|
151
|
+
"required": false,
|
|
152
|
+
"description": ""
|
|
153
|
+
},
|
|
154
|
+
"align": {
|
|
155
|
+
"type": {
|
|
156
|
+
"name": "enum",
|
|
157
|
+
"value": [{
|
|
158
|
+
"value": "\"left\"",
|
|
159
|
+
"computed": false
|
|
160
|
+
}, {
|
|
161
|
+
"value": "\"center\"",
|
|
162
|
+
"computed": false
|
|
163
|
+
}, {
|
|
164
|
+
"value": "\"right\"",
|
|
165
|
+
"computed": false
|
|
166
|
+
}]
|
|
167
|
+
},
|
|
168
|
+
"required": false,
|
|
169
|
+
"description": ""
|
|
170
|
+
},
|
|
171
|
+
"tag": {
|
|
172
|
+
"type": {
|
|
173
|
+
"name": "string"
|
|
174
|
+
},
|
|
175
|
+
"required": false,
|
|
176
|
+
"description": ""
|
|
177
|
+
},
|
|
178
|
+
"hasEllipsis": {
|
|
179
|
+
"type": {
|
|
180
|
+
"name": "bool"
|
|
181
|
+
},
|
|
182
|
+
"required": false,
|
|
183
|
+
"description": ""
|
|
184
|
+
},
|
|
185
|
+
"ellipsisLines": {
|
|
186
|
+
"type": {
|
|
187
|
+
"name": "number"
|
|
188
|
+
},
|
|
189
|
+
"required": false,
|
|
190
|
+
"description": ""
|
|
191
|
+
}
|
|
192
|
+
}
|
|
70
193
|
};
|
package/es/index.js
CHANGED
|
@@ -1,2 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.object.define-property.js");
|
|
4
|
+
|
|
5
|
+
require("core-js/modules/es.object.to-string.js");
|
|
6
|
+
|
|
7
|
+
require("core-js/modules/web.dom-collections.for-each.js");
|
|
8
|
+
|
|
9
|
+
require("core-js/modules/es.object.keys.js");
|
|
10
|
+
|
|
11
|
+
Object.defineProperty(exports, "__esModule", {
|
|
12
|
+
value: true
|
|
13
|
+
});
|
|
14
|
+
var _exportNames = {
|
|
15
|
+
vars: true
|
|
16
|
+
};
|
|
17
|
+
Object.defineProperty(exports, "vars", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function get() {
|
|
20
|
+
return _variables.vars;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
var _components = require("./components");
|
|
25
|
+
|
|
26
|
+
Object.keys(_components).forEach(function (key) {
|
|
27
|
+
if (key === "default" || key === "__esModule") return;
|
|
28
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
29
|
+
if (key in exports && exports[key] === _components[key]) return;
|
|
30
|
+
Object.defineProperty(exports, key, {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function get() {
|
|
33
|
+
return _components[key];
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
var _variables = require("./variables");
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
:root {
|
|
2
|
-
--grn-textBoxHeight-s:
|
|
3
|
-
--grn-textBoxHeight-m:
|
|
4
|
-
|
|
5
|
-
--grn-fieldTextBoxPaddingX-s:
|
|
6
|
-
--grn-fieldTextBoxPaddingX-m:
|
|
7
|
-
|
|
8
|
-
--grn-buttonTextBoxPaddingX-m:
|
|
2
|
+
--grn-textBoxHeight-s: 28px;
|
|
3
|
+
--grn-textBoxHeight-m: 40px;
|
|
4
|
+
|
|
5
|
+
--grn-fieldTextBoxPaddingX-s: 8px;
|
|
6
|
+
--grn-fieldTextBoxPaddingX-m: 12px;
|
|
7
|
+
|
|
8
|
+
--grn-buttonTextBoxPaddingX-m: 20px;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
:root {
|
|
12
|
+
--grn-color-buttonBorder: hsl(var(--grn-color-grey8-HSL) / 30%);
|
|
13
|
+
--grn-color-buttonBorderHover: hsl(var(--grn-color-grey8-HSL) / 50%);
|
|
14
|
+
--grn-color-buttonBorderActive: hsl(var(--grn-color-grey8-HSL) / 80%);
|
|
9
15
|
}
|
package/es/styles/variables.css
CHANGED
|
@@ -31,6 +31,11 @@
|
|
|
31
31
|
--grn-radius-l: 15px;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
+
:root {
|
|
35
|
+
--grn-transition-slow: 400ms;
|
|
36
|
+
--grn-transition-fast: 200ms;
|
|
37
|
+
}
|
|
38
|
+
|
|
34
39
|
:root {
|
|
35
40
|
--grn-color-grey8-HSL: 0 0% 7%;
|
|
36
41
|
|
|
@@ -42,10 +47,14 @@
|
|
|
42
47
|
--grn-color-grey3: hsl(0 0% 83%);
|
|
43
48
|
--grn-color-grey2: hsl(0 0% 93%);
|
|
44
49
|
--grn-color-grey1: hsl(0 0% 98%);
|
|
50
|
+
}
|
|
45
51
|
|
|
52
|
+
:root {
|
|
46
53
|
--grn-color-blue: hsl(218 74% 54%);
|
|
47
54
|
--grn-color-red: hsl(6 66% 65%);
|
|
55
|
+
}
|
|
48
56
|
|
|
57
|
+
:root {
|
|
49
58
|
--grn-color-body: var(--grn-color-grey8);
|
|
50
59
|
--grn-color-bodyDimmed: hsl(var(--grn-color-grey8-HSL) / 50%);
|
|
51
60
|
--grn-color-accent: var(--grn-color-grey8);
|
|
@@ -55,6 +64,8 @@
|
|
|
55
64
|
--grn-color-border: hsl(var(--grn-color-grey8-HSL) / 15%);
|
|
56
65
|
--grn-color-selection: var(--grn-color-blue);
|
|
57
66
|
--grn-color-danger: var(--grn-color-red);
|
|
67
|
+
--grn-color-disabledContent: var(--grn-color-grey5);
|
|
68
|
+
--grn-color-disabledBackground: hsl(var(--grn-color-grey8-HSL) / 12%);
|
|
58
69
|
}
|
|
59
70
|
|
|
60
71
|
:root {
|
package/es/types/index.js
CHANGED
|
@@ -1,14 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.object.define-property.js");
|
|
4
|
+
|
|
5
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
exports.types = void 0;
|
|
11
|
+
|
|
12
|
+
require("core-js/modules/es.object.keys.js");
|
|
13
|
+
|
|
14
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
15
|
+
|
|
16
|
+
var _variables = require("../variables");
|
|
17
|
+
|
|
18
|
+
var types = {
|
|
19
|
+
color: _propTypes.default.oneOfType([_propTypes.default.oneOf(Object.keys(_variables.vars.colors)), _propTypes.default.string]),
|
|
20
|
+
space: _propTypes.default.oneOfType([_propTypes.default.oneOf(Object.keys(_variables.vars.spaces)), _propTypes.default.number, _propTypes.default.string]),
|
|
21
|
+
dimension: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
22
|
+
side: _propTypes.default.oneOf(["all", "left", "right", "top", "bottom", "x", "y"]),
|
|
23
|
+
radius: _propTypes.default.oneOfType([_propTypes.default.oneOf(Object.keys(_variables.vars.radiuses)), _propTypes.default.string]),
|
|
24
|
+
shadow: _propTypes.default.oneOfType([_propTypes.default.oneOf(Object.keys(_variables.vars.shadows)), _propTypes.default.string]),
|
|
25
|
+
position: _propTypes.default.oneOf(["static", "relative", "fixed", "absolute", "sticky"]),
|
|
26
|
+
textSize: _propTypes.default.oneOfType([_propTypes.default.oneOf(Object.keys(_variables.vars.textSizes)), _propTypes.default.number, _propTypes.default.string]),
|
|
27
|
+
weight: _propTypes.default.oneOf(Object.keys(_variables.vars.weights)),
|
|
28
|
+
textAlign: _propTypes.default.oneOf(["left", "center", "right"]),
|
|
29
|
+
overflow: _propTypes.default.oneOf(["visible", "hidden", "scroll", "auto"])
|
|
30
|
+
};
|
|
31
|
+
exports.types = types;
|