@flodesk/grain 2.8.1 → 2.9.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 → box.js} +14 -2
- package/es/components/{button/index.js → button.js} +7 -6
- package/es/components/index.js +3 -3
- package/es/components/text-input.js +124 -0
- package/es/components/{text/index.js → text.js} +5 -2
- package/es/styles/components-variables.css +0 -11
- package/es/styles/variables.css +25 -13
- package/es/{types/index.js → types.js} +3 -2
- package/es/{utilities/index.js → utilities.js} +2 -2
- package/es/{variables/index.js → variables.js} +10 -3
- package/package.json +1 -1
- package/es/components/input/index.js +0 -75
|
@@ -17,13 +17,13 @@ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/hel
|
|
|
17
17
|
|
|
18
18
|
require("core-js/modules/es.array.concat.js");
|
|
19
19
|
|
|
20
|
-
var _utilities = require("
|
|
20
|
+
var _utilities = require("../utilities");
|
|
21
21
|
|
|
22
22
|
var _react = _interopRequireDefault(require("react"));
|
|
23
23
|
|
|
24
24
|
var _styled = _interopRequireDefault(require("@emotion/styled"));
|
|
25
25
|
|
|
26
|
-
var _types = require("
|
|
26
|
+
var _types = require("../types");
|
|
27
27
|
|
|
28
28
|
var _excluded = ["children", "color", "backgroundColor", "borderSide", "borderWidth", "borderColor", "width", "height", "radius", "padding", "paddingTop", "paddingBottom", "paddingLeft", "paddingRight", "paddingX", "paddingY", "margin", "marginTop", "marginBottom", "marginLeft", "marginRight", "marginX", "marginY", "position", "top", "bottom", "left", "right", "shadow", "overflow", "aspectRatio"];
|
|
29
29
|
|
|
@@ -164,6 +164,9 @@ Box.__docgenInfo = {
|
|
|
164
164
|
"value": [{
|
|
165
165
|
"value": "\"greys\"",
|
|
166
166
|
"computed": false
|
|
167
|
+
}, {
|
|
168
|
+
"value": "\"fades\"",
|
|
169
|
+
"computed": false
|
|
167
170
|
}, {
|
|
168
171
|
"value": "\"baseColors\"",
|
|
169
172
|
"computed": false
|
|
@@ -186,6 +189,9 @@ Box.__docgenInfo = {
|
|
|
186
189
|
"value": [{
|
|
187
190
|
"value": "\"greys\"",
|
|
188
191
|
"computed": false
|
|
192
|
+
}, {
|
|
193
|
+
"value": "\"fades\"",
|
|
194
|
+
"computed": false
|
|
189
195
|
}, {
|
|
190
196
|
"value": "\"baseColors\"",
|
|
191
197
|
"computed": false
|
|
@@ -249,6 +255,9 @@ Box.__docgenInfo = {
|
|
|
249
255
|
"value": [{
|
|
250
256
|
"value": "\"greys\"",
|
|
251
257
|
"computed": false
|
|
258
|
+
}, {
|
|
259
|
+
"value": "\"fades\"",
|
|
260
|
+
"computed": false
|
|
252
261
|
}, {
|
|
253
262
|
"value": "\"baseColors\"",
|
|
254
263
|
"computed": false
|
|
@@ -293,6 +302,9 @@ Box.__docgenInfo = {
|
|
|
293
302
|
"value": [{
|
|
294
303
|
"name": "enum",
|
|
295
304
|
"value": [{
|
|
305
|
+
"value": "\"xs\"",
|
|
306
|
+
"computed": false
|
|
307
|
+
}, {
|
|
296
308
|
"value": "\"s\"",
|
|
297
309
|
"computed": false
|
|
298
310
|
}, {
|
|
@@ -17,7 +17,7 @@ require("core-js/modules/es.array.concat.js");
|
|
|
17
17
|
|
|
18
18
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
19
19
|
|
|
20
|
-
var _utilities = require("
|
|
20
|
+
var _utilities = require("../utilities");
|
|
21
21
|
|
|
22
22
|
var _react = _interopRequireDefault(require("react"));
|
|
23
23
|
|
|
@@ -27,21 +27,22 @@ var _react2 = require("@emotion/react");
|
|
|
27
27
|
|
|
28
28
|
var _excluded = ["children", "tag", "variant", "isDisabled"];
|
|
29
29
|
|
|
30
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
30
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
|
31
31
|
|
|
32
32
|
var __jsx = _react.default.createElement;
|
|
33
|
+
var variables = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n --grn-buttonTextBoxPaddingX-m: 20px;\n --grn-color-buttonBorder: var(--grn-color-fade4);\n --grn-color-buttonBorder-hover: var(--grn-color-fade6);\n --grn-color-buttonBorder-active: var(--grn-color-grey8);\n"])));
|
|
33
34
|
var variants = {
|
|
34
|
-
neutral: (0, _react2.css)(
|
|
35
|
-
primary: (0, _react2.css)(
|
|
35
|
+
neutral: (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n color: inherit;\n background-color: transparent;\n border-color: var(--grn-color-buttonBorder);\n\n &:hover {\n border-color: var(--grn-color-buttonBorder-hover);\n }\n &:active {\n border-color: var(--grn-color-buttonBorder-active);\n }\n "]))),
|
|
36
|
+
primary: (0, _react2.css)(_templateObject3 || (_templateObject3 = (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)('accent'), (0, _utilities.getColor)('grey7'), (0, _utilities.getColor)('grey2'))
|
|
36
37
|
};
|
|
37
38
|
|
|
38
|
-
var Wrapper = _styled.default.button(
|
|
39
|
+
var Wrapper = _styled.default.button(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n ", ";\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 background-color: transparent;\n\n ", ";\n\n ", ";\n\n &:hover {\n transition: ", ";\n }\n\n &:active {\n transition: 0s;\n }\n"])), variables, (0, _utilities.getWeight)('medium'), (0, _utilities.getRadius)('s'), (0, _utilities.getTransition)('slow'), function (p) {
|
|
39
40
|
return !p.isDisabled && variants[p.variant];
|
|
40
41
|
}, function (p) {
|
|
41
42
|
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
43
|
}, (0, _utilities.getTransition)('fast'));
|
|
43
44
|
|
|
44
|
-
var ButtonText = _styled.default.span(
|
|
45
|
+
var ButtonText = _styled.default.span(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n --opticalCompensation: -0.3px;\n\n position: relative;\n top: var(--opticalCompensation);\n"])));
|
|
45
46
|
|
|
46
47
|
var Button = function Button(_ref) {
|
|
47
48
|
var children = _ref.children,
|
package/es/components/index.js
CHANGED
|
@@ -23,10 +23,10 @@ Object.defineProperty(exports, "Button", {
|
|
|
23
23
|
return _button.Button;
|
|
24
24
|
}
|
|
25
25
|
});
|
|
26
|
-
Object.defineProperty(exports, "
|
|
26
|
+
Object.defineProperty(exports, "TextInput", {
|
|
27
27
|
enumerable: true,
|
|
28
28
|
get: function get() {
|
|
29
|
-
return
|
|
29
|
+
return _textInput.TextInput;
|
|
30
30
|
}
|
|
31
31
|
});
|
|
32
32
|
|
|
@@ -36,4 +36,4 @@ var _box = require("./box");
|
|
|
36
36
|
|
|
37
37
|
var _button = require("./button");
|
|
38
38
|
|
|
39
|
-
var
|
|
39
|
+
var _textInput = require("./text-input");
|
|
@@ -0,0 +1,124 @@
|
|
|
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.TextInput = 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"));
|
|
17
|
+
|
|
18
|
+
var _utilities = require("../utilities");
|
|
19
|
+
|
|
20
|
+
var _react = _interopRequireDefault(require("react"));
|
|
21
|
+
|
|
22
|
+
var _styled = _interopRequireDefault(require("@emotion/styled"));
|
|
23
|
+
|
|
24
|
+
var _types = require("../types");
|
|
25
|
+
|
|
26
|
+
var _react2 = require("@emotion/react");
|
|
27
|
+
|
|
28
|
+
var _excluded = ["value", "placeholder", "size", "label", "id"];
|
|
29
|
+
|
|
30
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
|
|
31
|
+
|
|
32
|
+
var __jsx = _react.default.createElement;
|
|
33
|
+
var variables = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n --grn-fieldTextBoxPaddingX-s: 8px;\n --grn-fieldTextBoxPaddingX-m: 12px;\n --grn-color-fieldBorder: var(--grn-color-fade3);\n --grn-color-fieldBorder-hover: var(--grn-color-fade6);\n"])));
|
|
34
|
+
var inputSizes = {
|
|
35
|
+
s: (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n height: var(--grn-textBoxHeight-s);\n padding: 0 var(--grn-fieldTextBoxPaddingX-s);\n border-radius: ", ";\n "])), (0, _utilities.getRadius)('xs')),
|
|
36
|
+
m: (0, _react2.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n height: var(--grn-textBoxHeight-m);\n padding: 0 var(--grn-fieldTextBoxPaddingX-m);\n border-radius: ", ";\n "])), (0, _utilities.getRadius)('s'))
|
|
37
|
+
};
|
|
38
|
+
var labelSizes = {
|
|
39
|
+
s: '2px',
|
|
40
|
+
m: 'xs'
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
var Wrapper = _styled.default.div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n ", ";\n font-size: ", ";\n"])), variables, function (p) {
|
|
44
|
+
return (0, _utilities.getTextSize)(p.size);
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
var Label = _styled.default.label(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n display: block;\n margin-bottom: ", ";\n"])), function (p) {
|
|
48
|
+
return (0, _utilities.getSpace)(labelSizes[p.size]);
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
var InputField = _styled.default.input(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n appearance: none;\n border: none;\n font-family: inherit;\n background-color: transparent;\n color: inherit;\n font-size: inherit;\n transition: ", ";\n border: 1px solid var(--grn-color-fieldBorder);\n width: 100%;\n ", ";\n outline: none;\n\n &::placeholder {\n color: ", ";\n }\n\n &:hover {\n transition: ", ";\n border-color: var(--grn-color-fieldBorder-hover);\n }\n \n &:focus {\n transition: 0s;\n border-color: var(--grn-color-selection);\n }\n"])), (0, _utilities.getTransition)('slow'), function (p) {
|
|
52
|
+
return inputSizes[p.size];
|
|
53
|
+
}, (0, _utilities.getColor)('grey5'), (0, _utilities.getTransition)('fast'));
|
|
54
|
+
|
|
55
|
+
var TextInput = function TextInput(_ref) {
|
|
56
|
+
var value = _ref.value,
|
|
57
|
+
placeholder = _ref.placeholder,
|
|
58
|
+
_ref$size = _ref.size,
|
|
59
|
+
size = _ref$size === void 0 ? 'm' : _ref$size,
|
|
60
|
+
label = _ref.label,
|
|
61
|
+
id = _ref.id,
|
|
62
|
+
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
63
|
+
return __jsx(Wrapper, {
|
|
64
|
+
size: size,
|
|
65
|
+
type: "text"
|
|
66
|
+
}, label && __jsx(Label, {
|
|
67
|
+
htmlFor: id,
|
|
68
|
+
size: size
|
|
69
|
+
}, label), __jsx(InputField, (0, _extends2.default)({
|
|
70
|
+
value: value,
|
|
71
|
+
placeholder: placeholder,
|
|
72
|
+
size: size,
|
|
73
|
+
label: label,
|
|
74
|
+
id: id
|
|
75
|
+
}, props)));
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
exports.TextInput = TextInput;
|
|
79
|
+
TextInput.__docgenInfo = {
|
|
80
|
+
"description": "",
|
|
81
|
+
"methods": [],
|
|
82
|
+
"displayName": "TextInput",
|
|
83
|
+
"props": {
|
|
84
|
+
"size": {
|
|
85
|
+
"defaultValue": {
|
|
86
|
+
"value": "'m'",
|
|
87
|
+
"computed": false
|
|
88
|
+
},
|
|
89
|
+
"type": {
|
|
90
|
+
"name": "enum",
|
|
91
|
+
"value": [{
|
|
92
|
+
"value": "\"s\"",
|
|
93
|
+
"computed": false
|
|
94
|
+
}, {
|
|
95
|
+
"value": "\"m\"",
|
|
96
|
+
"computed": false
|
|
97
|
+
}]
|
|
98
|
+
},
|
|
99
|
+
"required": false,
|
|
100
|
+
"description": ""
|
|
101
|
+
},
|
|
102
|
+
"id": {
|
|
103
|
+
"type": {
|
|
104
|
+
"name": "string"
|
|
105
|
+
},
|
|
106
|
+
"required": true,
|
|
107
|
+
"description": ""
|
|
108
|
+
},
|
|
109
|
+
"value": {
|
|
110
|
+
"type": {
|
|
111
|
+
"name": "string"
|
|
112
|
+
},
|
|
113
|
+
"required": false,
|
|
114
|
+
"description": ""
|
|
115
|
+
},
|
|
116
|
+
"label": {
|
|
117
|
+
"type": {
|
|
118
|
+
"name": "node"
|
|
119
|
+
},
|
|
120
|
+
"required": false,
|
|
121
|
+
"description": ""
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
};
|
|
@@ -15,13 +15,13 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
|
|
|
15
15
|
|
|
16
16
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
17
17
|
|
|
18
|
-
var _utilities = require("
|
|
18
|
+
var _utilities = require("../utilities");
|
|
19
19
|
|
|
20
20
|
var _react = _interopRequireDefault(require("react"));
|
|
21
21
|
|
|
22
22
|
var _styled = _interopRequireDefault(require("@emotion/styled"));
|
|
23
23
|
|
|
24
|
-
var _types = require("
|
|
24
|
+
var _types = require("../types");
|
|
25
25
|
|
|
26
26
|
var _excluded = ["children", "size", "weight", "color", "tag", "hasEllipsis", "ellipsisLines", "align"];
|
|
27
27
|
|
|
@@ -137,6 +137,9 @@ Text.__docgenInfo = {
|
|
|
137
137
|
"value": [{
|
|
138
138
|
"value": "\"greys\"",
|
|
139
139
|
"computed": false
|
|
140
|
+
}, {
|
|
141
|
+
"value": "\"fades\"",
|
|
142
|
+
"computed": false
|
|
140
143
|
}, {
|
|
141
144
|
"value": "\"baseColors\"",
|
|
142
145
|
"computed": false
|
|
@@ -1,15 +1,4 @@
|
|
|
1
1
|
:root {
|
|
2
2
|
--grn-textBoxHeight-s: 28px;
|
|
3
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%);
|
|
15
4
|
}
|
package/es/styles/variables.css
CHANGED
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
:root {
|
|
29
|
+
--grn-radius-xs: 3.5px;
|
|
29
30
|
--grn-radius-s: 5px;
|
|
30
31
|
--grn-radius-m: 10px;
|
|
31
32
|
--grn-radius-l: 15px;
|
|
@@ -37,16 +38,27 @@
|
|
|
37
38
|
}
|
|
38
39
|
|
|
39
40
|
:root {
|
|
40
|
-
--grn-color-grey8-
|
|
41
|
+
--grn-color-grey8-HS: 0 0%;
|
|
42
|
+
--grn-color-grey8-HSL: var(--grn-color-grey8-HS) 7%;
|
|
41
43
|
|
|
42
44
|
--grn-color-grey8: hsl(var(--grn-color-grey8-HSL));
|
|
43
|
-
--grn-color-grey7: hsl(
|
|
44
|
-
--grn-color-grey6: hsl(
|
|
45
|
-
--grn-color-grey5: hsl(
|
|
46
|
-
--grn-color-grey4: hsl(
|
|
47
|
-
--grn-color-grey3: hsl(
|
|
48
|
-
--grn-color-grey2: hsl(
|
|
49
|
-
--grn-color-grey1: hsl(
|
|
45
|
+
--grn-color-grey7: hsl(var(--grn-color-grey8-HS) 20%);
|
|
46
|
+
--grn-color-grey6: hsl(var(--grn-color-grey8-HS) 32%);
|
|
47
|
+
--grn-color-grey5: hsl(var(--grn-color-grey8-HS) 50%);
|
|
48
|
+
--grn-color-grey4: hsl(var(--grn-color-grey8-HS) 66%);
|
|
49
|
+
--grn-color-grey3: hsl(var(--grn-color-grey8-HS) 83%);
|
|
50
|
+
--grn-color-grey2: hsl(var(--grn-color-grey8-HS) 93%);
|
|
51
|
+
--grn-color-grey1: hsl(var(--grn-color-grey8-HS) 98%);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
:root {
|
|
55
|
+
--grn-color-fade7: hsl(var(--grn-color-grey8-HS) 0% / 49%);
|
|
56
|
+
--grn-color-fade6: hsl(var(--grn-color-grey8-HS) 0% / 42%);
|
|
57
|
+
--grn-color-fade5: hsl(var(--grn-color-grey8-HS) 0% / 35%);
|
|
58
|
+
--grn-color-fade4: hsl(var(--grn-color-grey8-HS) 0% / 28%);
|
|
59
|
+
--grn-color-fade3: hsl(var(--grn-color-grey8-HS) 0% / 21%);
|
|
60
|
+
--grn-color-fade2: hsl(var(--grn-color-grey8-HS) 0% / 14%);
|
|
61
|
+
--grn-color-fade1: hsl(var(--grn-color-grey8-HS) 0% / 7%);
|
|
50
62
|
}
|
|
51
63
|
|
|
52
64
|
:root {
|
|
@@ -56,16 +68,16 @@
|
|
|
56
68
|
|
|
57
69
|
:root {
|
|
58
70
|
--grn-color-body: var(--grn-color-grey8);
|
|
59
|
-
--grn-color-bodyDimmed:
|
|
71
|
+
--grn-color-bodyDimmed: var(--grn-color-fade7);
|
|
60
72
|
--grn-color-accent: var(--grn-color-grey8);
|
|
61
|
-
--grn-color-backgroundSecondary:
|
|
73
|
+
--grn-color-backgroundSecondary: white;
|
|
62
74
|
--grn-color-background: var(--grn-color-grey1);
|
|
63
|
-
--grn-color-overlay:
|
|
64
|
-
--grn-color-border:
|
|
75
|
+
--grn-color-overlay: var(--grn-color-fade1);
|
|
76
|
+
--grn-color-border: var(--grn-color-fade2);
|
|
65
77
|
--grn-color-selection: var(--grn-color-blue);
|
|
66
78
|
--grn-color-danger: var(--grn-color-red);
|
|
67
79
|
--grn-color-disabledContent: var(--grn-color-grey5);
|
|
68
|
-
--grn-color-disabledBackground:
|
|
80
|
+
--grn-color-disabledBackground: var(--grn-color-fade1);
|
|
69
81
|
}
|
|
70
82
|
|
|
71
83
|
:root {
|
|
@@ -13,7 +13,7 @@ require("core-js/modules/es.object.keys.js");
|
|
|
13
13
|
|
|
14
14
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
15
15
|
|
|
16
|
-
var _variables = require("
|
|
16
|
+
var _variables = require("./variables");
|
|
17
17
|
|
|
18
18
|
var types = {
|
|
19
19
|
color: _propTypes.default.oneOfType([_propTypes.default.oneOf(Object.keys(_variables.vars.colors)), _propTypes.default.string]),
|
|
@@ -26,6 +26,7 @@ var types = {
|
|
|
26
26
|
textSize: _propTypes.default.oneOfType([_propTypes.default.oneOf(Object.keys(_variables.vars.textSizes)), _propTypes.default.number, _propTypes.default.string]),
|
|
27
27
|
weight: _propTypes.default.oneOf(Object.keys(_variables.vars.weights)),
|
|
28
28
|
textAlign: _propTypes.default.oneOf(["left", "center", "right"]),
|
|
29
|
-
overflow: _propTypes.default.oneOf(["visible", "hidden", "scroll", "auto"])
|
|
29
|
+
overflow: _propTypes.default.oneOf(["visible", "hidden", "scroll", "auto"]),
|
|
30
|
+
fieldSize: _propTypes.default.oneOf(["s", "m"])
|
|
30
31
|
};
|
|
31
32
|
exports.types = types;
|
|
@@ -29,7 +29,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
29
29
|
|
|
30
30
|
require("core-js/modules/es.array.concat.js");
|
|
31
31
|
|
|
32
|
-
var _variables = require("
|
|
32
|
+
var _variables = require("./variables");
|
|
33
33
|
|
|
34
34
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
35
35
|
|
|
@@ -55,7 +55,7 @@ var u = function u(amount) {
|
|
|
55
55
|
};
|
|
56
56
|
|
|
57
57
|
var getColor = function getColor(color) {
|
|
58
|
-
if (color in _objectSpread(_objectSpread(_objectSpread({}, _variables.vars.colors.baseColors), _variables.vars.colors.greys), _variables.vars.colors.semanticColors)) {
|
|
58
|
+
if (color in _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, _variables.vars.colors.baseColors), _variables.vars.colors.greys), _variables.vars.colors.semanticColors), _variables.vars.colors.fades)) {
|
|
59
59
|
return getCssVar("color", color);
|
|
60
60
|
}
|
|
61
61
|
|
|
@@ -30,6 +30,7 @@ var vars = {
|
|
|
30
30
|
semiBold: "semiBold"
|
|
31
31
|
},
|
|
32
32
|
radiuses: {
|
|
33
|
+
xs: "xs",
|
|
33
34
|
s: "s",
|
|
34
35
|
m: "m",
|
|
35
36
|
l: "l"
|
|
@@ -54,6 +55,15 @@ var vars = {
|
|
|
54
55
|
grey2: "grey2",
|
|
55
56
|
grey1: "grey1"
|
|
56
57
|
},
|
|
58
|
+
fades: {
|
|
59
|
+
fade7: "fade7",
|
|
60
|
+
fade6: "fade6",
|
|
61
|
+
fade5: "fade5",
|
|
62
|
+
fade4: "fade4",
|
|
63
|
+
fade3: "fade3",
|
|
64
|
+
fade2: "fade2",
|
|
65
|
+
fade1: "fade1"
|
|
66
|
+
},
|
|
57
67
|
baseColors: {
|
|
58
68
|
blue: "blue",
|
|
59
69
|
red: "red"
|
|
@@ -66,9 +76,6 @@ var vars = {
|
|
|
66
76
|
background: "background",
|
|
67
77
|
overlay: "overlay",
|
|
68
78
|
border: "border",
|
|
69
|
-
buttonBorder: "buttonBorder",
|
|
70
|
-
buttonBorderHover: "buttonBorderHover",
|
|
71
|
-
buttonBorderActive: "buttonBorderActive",
|
|
72
79
|
selection: "selection",
|
|
73
80
|
danger: "danger",
|
|
74
81
|
disabledContent: "disabledContent",
|
package/package.json
CHANGED
|
@@ -1,75 +0,0 @@
|
|
|
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.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"));
|
|
17
|
-
|
|
18
|
-
var _utilities = require("../../utilities");
|
|
19
|
-
|
|
20
|
-
var _react = _interopRequireDefault(require("react"));
|
|
21
|
-
|
|
22
|
-
var _styled = _interopRequireDefault(require("@emotion/styled"));
|
|
23
|
-
|
|
24
|
-
var _types = require("../../types");
|
|
25
|
-
|
|
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) {
|
|
35
|
-
return "var(--grn-textBoxHeight-".concat(p.size, ")");
|
|
36
|
-
}, function (p) {
|
|
37
|
-
return "var(--grn-fieldTextBoxPaddingX-".concat(p.size, ")");
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
var Input = function Input(_ref) {
|
|
41
|
-
var value = _ref.value,
|
|
42
|
-
_ref$placeholder = _ref.placeholder,
|
|
43
|
-
placeholder = _ref$placeholder === void 0 ? 'Placeholder' : _ref$placeholder,
|
|
44
|
-
_ref$size = _ref.size,
|
|
45
|
-
size = _ref$size === void 0 ? 'm' : _ref$size,
|
|
46
|
-
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
47
|
-
return __jsx(Wrapper, (0, _extends2.default)({
|
|
48
|
-
value: value,
|
|
49
|
-
placeholder: placeholder,
|
|
50
|
-
size: size
|
|
51
|
-
}, props));
|
|
52
|
-
};
|
|
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
|
-
};
|