@flodesk/grain 2.9.0 → 2.12.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/arrange.js +290 -0
- package/es/components/box.js +84 -28
- package/es/components/icon.js +94 -0
- package/es/components/index.js +17 -1
- package/es/icons/icon-arrow-right.js +55 -0
- package/es/icons/index.js +15 -0
- package/es/index.js +14 -0
- package/es/styles/variables.css +8 -0
- package/es/types.js +6 -1
- package/es/utilities.js +69 -8
- package/es/variables.js +7 -0
- package/package.json +1 -1
|
@@ -0,0 +1,290 @@
|
|
|
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.Arrange = 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 _box = require("./box");
|
|
27
|
+
|
|
28
|
+
var _excluded = ["children", "gap", "columns", "autoFlow", "justifyItems", "alignItems", "justifyContent", "alignContent", "placeItems", "placeContent"];
|
|
29
|
+
|
|
30
|
+
var _templateObject;
|
|
31
|
+
|
|
32
|
+
var __jsx = _react.default.createElement;
|
|
33
|
+
var Wrapper = (0, _styled.default)(_box.Box)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: grid;\n grid-auto-flow: ", ";\n justify-content: start;\n align-items: center;\n gap: ", ";\n grid-template-columns: ", ";\n justify-items: ", ";\n align-items: ", ";\n justify-content: ", ";\n align-content: ", ";\n place-items: ", ";\n place-content: ", ";\n"])), function (p) {
|
|
34
|
+
return p.autoFlow;
|
|
35
|
+
}, function (p) {
|
|
36
|
+
return (0, _utilities.getSpace)(p.gap);
|
|
37
|
+
}, function (p) {
|
|
38
|
+
return (0, _utilities.getGridColumns)(p.columns);
|
|
39
|
+
}, function (p) {
|
|
40
|
+
return p.justifyItems;
|
|
41
|
+
}, function (p) {
|
|
42
|
+
return p.alignItems;
|
|
43
|
+
}, function (p) {
|
|
44
|
+
return p.justifyContent;
|
|
45
|
+
}, function (p) {
|
|
46
|
+
return p.alignContent;
|
|
47
|
+
}, function (p) {
|
|
48
|
+
return p.placeItems;
|
|
49
|
+
}, function (p) {
|
|
50
|
+
return p.placeContent;
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
var Arrange = function Arrange(_ref) {
|
|
54
|
+
var children = _ref.children,
|
|
55
|
+
gap = _ref.gap,
|
|
56
|
+
columns = _ref.columns,
|
|
57
|
+
_ref$autoFlow = _ref.autoFlow,
|
|
58
|
+
autoFlow = _ref$autoFlow === void 0 ? 'column' : _ref$autoFlow,
|
|
59
|
+
justifyItems = _ref.justifyItems,
|
|
60
|
+
alignItems = _ref.alignItems,
|
|
61
|
+
justifyContent = _ref.justifyContent,
|
|
62
|
+
alignContent = _ref.alignContent,
|
|
63
|
+
placeItems = _ref.placeItems,
|
|
64
|
+
placeContent = _ref.placeContent,
|
|
65
|
+
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
66
|
+
return __jsx(Wrapper, (0, _extends2.default)({
|
|
67
|
+
gap: gap,
|
|
68
|
+
columns: columns,
|
|
69
|
+
autoFlow: autoFlow
|
|
70
|
+
}, props), children);
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
exports.Arrange = Arrange;
|
|
74
|
+
Arrange.__docgenInfo = {
|
|
75
|
+
"description": "",
|
|
76
|
+
"methods": [],
|
|
77
|
+
"displayName": "Arrange",
|
|
78
|
+
"props": {
|
|
79
|
+
"autoFlow": {
|
|
80
|
+
"defaultValue": {
|
|
81
|
+
"value": "'column'",
|
|
82
|
+
"computed": false
|
|
83
|
+
},
|
|
84
|
+
"type": {
|
|
85
|
+
"name": "enum",
|
|
86
|
+
"value": [{
|
|
87
|
+
"value": "\"column\"",
|
|
88
|
+
"computed": false
|
|
89
|
+
}, {
|
|
90
|
+
"value": "\"row\"",
|
|
91
|
+
"computed": false
|
|
92
|
+
}]
|
|
93
|
+
},
|
|
94
|
+
"required": false,
|
|
95
|
+
"description": ""
|
|
96
|
+
},
|
|
97
|
+
"gap": {
|
|
98
|
+
"type": {
|
|
99
|
+
"name": "union",
|
|
100
|
+
"value": [{
|
|
101
|
+
"name": "enum",
|
|
102
|
+
"value": [{
|
|
103
|
+
"value": "\"xs\"",
|
|
104
|
+
"computed": false
|
|
105
|
+
}, {
|
|
106
|
+
"value": "\"s\"",
|
|
107
|
+
"computed": false
|
|
108
|
+
}, {
|
|
109
|
+
"value": "\"m\"",
|
|
110
|
+
"computed": false
|
|
111
|
+
}, {
|
|
112
|
+
"value": "\"l\"",
|
|
113
|
+
"computed": false
|
|
114
|
+
}, {
|
|
115
|
+
"value": "\"xl\"",
|
|
116
|
+
"computed": false
|
|
117
|
+
}, {
|
|
118
|
+
"value": "\"xxl\"",
|
|
119
|
+
"computed": false
|
|
120
|
+
}]
|
|
121
|
+
}, {
|
|
122
|
+
"name": "number"
|
|
123
|
+
}, {
|
|
124
|
+
"name": "string"
|
|
125
|
+
}]
|
|
126
|
+
},
|
|
127
|
+
"required": false,
|
|
128
|
+
"description": ""
|
|
129
|
+
},
|
|
130
|
+
"columns": {
|
|
131
|
+
"type": {
|
|
132
|
+
"name": "union",
|
|
133
|
+
"value": [{
|
|
134
|
+
"name": "array"
|
|
135
|
+
}, {
|
|
136
|
+
"name": "string"
|
|
137
|
+
}]
|
|
138
|
+
},
|
|
139
|
+
"required": false,
|
|
140
|
+
"description": ""
|
|
141
|
+
},
|
|
142
|
+
"justifyItems": {
|
|
143
|
+
"type": {
|
|
144
|
+
"name": "enum",
|
|
145
|
+
"value": [{
|
|
146
|
+
"value": "\"start\"",
|
|
147
|
+
"computed": false
|
|
148
|
+
}, {
|
|
149
|
+
"value": "\"end\"",
|
|
150
|
+
"computed": false
|
|
151
|
+
}, {
|
|
152
|
+
"value": "\"center\"",
|
|
153
|
+
"computed": false
|
|
154
|
+
}, {
|
|
155
|
+
"value": "\"stretch\"",
|
|
156
|
+
"computed": false
|
|
157
|
+
}]
|
|
158
|
+
},
|
|
159
|
+
"required": false,
|
|
160
|
+
"description": ""
|
|
161
|
+
},
|
|
162
|
+
"alignItems": {
|
|
163
|
+
"type": {
|
|
164
|
+
"name": "enum",
|
|
165
|
+
"value": [{
|
|
166
|
+
"value": "\"start\"",
|
|
167
|
+
"computed": false
|
|
168
|
+
}, {
|
|
169
|
+
"value": "\"end\"",
|
|
170
|
+
"computed": false
|
|
171
|
+
}, {
|
|
172
|
+
"value": "\"center\"",
|
|
173
|
+
"computed": false
|
|
174
|
+
}, {
|
|
175
|
+
"value": "\"stretch\"",
|
|
176
|
+
"computed": false
|
|
177
|
+
}]
|
|
178
|
+
},
|
|
179
|
+
"required": false,
|
|
180
|
+
"description": ""
|
|
181
|
+
},
|
|
182
|
+
"justifyContent": {
|
|
183
|
+
"type": {
|
|
184
|
+
"name": "enum",
|
|
185
|
+
"value": [{
|
|
186
|
+
"value": "\"start\"",
|
|
187
|
+
"computed": false
|
|
188
|
+
}, {
|
|
189
|
+
"value": "\"end\"",
|
|
190
|
+
"computed": false
|
|
191
|
+
}, {
|
|
192
|
+
"value": "\"center\"",
|
|
193
|
+
"computed": false
|
|
194
|
+
}, {
|
|
195
|
+
"value": "\"stretch\"",
|
|
196
|
+
"computed": false
|
|
197
|
+
}, {
|
|
198
|
+
"value": "\"space-around\"",
|
|
199
|
+
"computed": false
|
|
200
|
+
}, {
|
|
201
|
+
"value": "\"space-between\"",
|
|
202
|
+
"computed": false
|
|
203
|
+
}, {
|
|
204
|
+
"value": "\"space-evenly\"",
|
|
205
|
+
"computed": false
|
|
206
|
+
}]
|
|
207
|
+
},
|
|
208
|
+
"required": false,
|
|
209
|
+
"description": ""
|
|
210
|
+
},
|
|
211
|
+
"alignContent": {
|
|
212
|
+
"type": {
|
|
213
|
+
"name": "enum",
|
|
214
|
+
"value": [{
|
|
215
|
+
"value": "\"start\"",
|
|
216
|
+
"computed": false
|
|
217
|
+
}, {
|
|
218
|
+
"value": "\"end\"",
|
|
219
|
+
"computed": false
|
|
220
|
+
}, {
|
|
221
|
+
"value": "\"center\"",
|
|
222
|
+
"computed": false
|
|
223
|
+
}, {
|
|
224
|
+
"value": "\"stretch\"",
|
|
225
|
+
"computed": false
|
|
226
|
+
}, {
|
|
227
|
+
"value": "\"space-around\"",
|
|
228
|
+
"computed": false
|
|
229
|
+
}, {
|
|
230
|
+
"value": "\"space-between\"",
|
|
231
|
+
"computed": false
|
|
232
|
+
}, {
|
|
233
|
+
"value": "\"space-evenly\"",
|
|
234
|
+
"computed": false
|
|
235
|
+
}]
|
|
236
|
+
},
|
|
237
|
+
"required": false,
|
|
238
|
+
"description": ""
|
|
239
|
+
},
|
|
240
|
+
"placeItems": {
|
|
241
|
+
"type": {
|
|
242
|
+
"name": "enum",
|
|
243
|
+
"value": [{
|
|
244
|
+
"value": "\"start\"",
|
|
245
|
+
"computed": false
|
|
246
|
+
}, {
|
|
247
|
+
"value": "\"end\"",
|
|
248
|
+
"computed": false
|
|
249
|
+
}, {
|
|
250
|
+
"value": "\"center\"",
|
|
251
|
+
"computed": false
|
|
252
|
+
}, {
|
|
253
|
+
"value": "\"stretch\"",
|
|
254
|
+
"computed": false
|
|
255
|
+
}]
|
|
256
|
+
},
|
|
257
|
+
"required": false,
|
|
258
|
+
"description": ""
|
|
259
|
+
},
|
|
260
|
+
"placeContent": {
|
|
261
|
+
"type": {
|
|
262
|
+
"name": "enum",
|
|
263
|
+
"value": [{
|
|
264
|
+
"value": "\"start\"",
|
|
265
|
+
"computed": false
|
|
266
|
+
}, {
|
|
267
|
+
"value": "\"end\"",
|
|
268
|
+
"computed": false
|
|
269
|
+
}, {
|
|
270
|
+
"value": "\"center\"",
|
|
271
|
+
"computed": false
|
|
272
|
+
}, {
|
|
273
|
+
"value": "\"stretch\"",
|
|
274
|
+
"computed": false
|
|
275
|
+
}, {
|
|
276
|
+
"value": "\"space-around\"",
|
|
277
|
+
"computed": false
|
|
278
|
+
}, {
|
|
279
|
+
"value": "\"space-between\"",
|
|
280
|
+
"computed": false
|
|
281
|
+
}, {
|
|
282
|
+
"value": "\"space-evenly\"",
|
|
283
|
+
"computed": false
|
|
284
|
+
}]
|
|
285
|
+
},
|
|
286
|
+
"required": false,
|
|
287
|
+
"description": ""
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
};
|
package/es/components/box.js
CHANGED
|
@@ -15,8 +15,6 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
|
|
|
15
15
|
|
|
16
16
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
17
17
|
|
|
18
|
-
require("core-js/modules/es.array.concat.js");
|
|
19
|
-
|
|
20
18
|
var _utilities = require("../utilities");
|
|
21
19
|
|
|
22
20
|
var _react = _interopRequireDefault(require("react"));
|
|
@@ -25,58 +23,60 @@ var _styled = _interopRequireDefault(require("@emotion/styled"));
|
|
|
25
23
|
|
|
26
24
|
var _types = require("../types");
|
|
27
25
|
|
|
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"];
|
|
26
|
+
var _excluded = ["children", "color", "backgroundColor", "borderSide", "borderWidth", "borderColor", "width", "minWidth", "maxWidth", "height", "minHeight", "maxHeight", "radius", "padding", "paddingTop", "paddingBottom", "paddingLeft", "paddingRight", "paddingX", "paddingY", "margin", "marginTop", "marginBottom", "marginLeft", "marginRight", "marginX", "marginY", "position", "top", "bottom", "left", "right", "shadow", "overflow", "aspectRatio"];
|
|
29
27
|
|
|
30
28
|
var _templateObject;
|
|
31
29
|
|
|
32
30
|
var __jsx = _react.default.createElement;
|
|
33
31
|
|
|
34
|
-
var
|
|
35
|
-
if (propertyValue || propertyValue === 0) {
|
|
36
|
-
return "".concat(propertyName, ": ").concat((0, _utilities.getSpace)(propertyValue));
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
var Wrapper = _styled.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n ", ";\n \n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n \n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n \n ", ";\n ", ";\n ", ";\n ", ";\n \n position: ", ";\n color: ", ";\n background-color: ", ";\n width: ", ";\n height: ", ";\n border-radius: ", ";\n box-shadow: ", ";\n overflow: ", ";\n aspect-ratio: ", ";\n"])), function (p) {
|
|
32
|
+
var Wrapper = _styled.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n ", ";\n \n padding:", ";\n padding-top:", ";\n padding-bottom:", ";\n padding-left:", ";\n padding-right:", ";\n \n margin:", ";\n margin-top:", ";\n margin-bottom:", ";\n margin-left:", ";\n margin-right:", ";\n \n top:", ";\n bottom:", ";\n left:", ";\n right:", ";\n \n width: ", ";\n min-width: ", ";\n max-width: ", ";\n height: ", ";\n min-height: ", ";\n max-height: ", ";\n\n color: ", ";\n background-color: ", ";\n \n position: ", ";\n border-radius: ", ";\n box-shadow: ", ";\n overflow: ", ";\n aspect-ratio: ", ";\n"])), function (p) {
|
|
41
33
|
return (0, _utilities.getBorder)(p.borderSide, p.borderWidth, p.borderColor);
|
|
42
34
|
}, function (p) {
|
|
43
|
-
return
|
|
35
|
+
return (0, _utilities.getSpace)(p.padding);
|
|
44
36
|
}, function (p) {
|
|
45
|
-
return
|
|
37
|
+
return (0, _utilities.getSpace)(p.paddingTop);
|
|
46
38
|
}, function (p) {
|
|
47
|
-
return
|
|
39
|
+
return (0, _utilities.getSpace)(p.paddingBottom);
|
|
48
40
|
}, function (p) {
|
|
49
|
-
return
|
|
41
|
+
return (0, _utilities.getSpace)(p.paddingLeft);
|
|
50
42
|
}, function (p) {
|
|
51
|
-
return
|
|
43
|
+
return (0, _utilities.getSpace)(p.paddingRight);
|
|
52
44
|
}, function (p) {
|
|
53
|
-
return
|
|
45
|
+
return (0, _utilities.getSpace)(p.margin);
|
|
54
46
|
}, function (p) {
|
|
55
|
-
return
|
|
47
|
+
return (0, _utilities.getSpace)(p.marginTop);
|
|
56
48
|
}, function (p) {
|
|
57
|
-
return
|
|
49
|
+
return (0, _utilities.getSpace)(p.marginBottom);
|
|
58
50
|
}, function (p) {
|
|
59
|
-
return
|
|
51
|
+
return (0, _utilities.getSpace)(p.marginLeft);
|
|
60
52
|
}, function (p) {
|
|
61
|
-
return
|
|
53
|
+
return (0, _utilities.getSpace)(p.marginRight);
|
|
62
54
|
}, function (p) {
|
|
63
|
-
return
|
|
55
|
+
return (0, _utilities.getSpace)(p.top);
|
|
64
56
|
}, function (p) {
|
|
65
|
-
return
|
|
57
|
+
return (0, _utilities.getSpace)(p.bottom);
|
|
66
58
|
}, function (p) {
|
|
67
|
-
return
|
|
59
|
+
return (0, _utilities.getSpace)(p.left);
|
|
68
60
|
}, function (p) {
|
|
69
|
-
return
|
|
61
|
+
return (0, _utilities.getSpace)(p.right);
|
|
70
62
|
}, function (p) {
|
|
71
|
-
return p.
|
|
63
|
+
return (0, _utilities.getDimension)(p.width);
|
|
64
|
+
}, function (p) {
|
|
65
|
+
return (0, _utilities.getDimension)(p.minWidth);
|
|
66
|
+
}, function (p) {
|
|
67
|
+
return (0, _utilities.getDimension)(p.maxWidth);
|
|
68
|
+
}, function (p) {
|
|
69
|
+
return (0, _utilities.getDimension)(p.height);
|
|
70
|
+
}, function (p) {
|
|
71
|
+
return (0, _utilities.getDimension)(p.minHeight);
|
|
72
|
+
}, function (p) {
|
|
73
|
+
return (0, _utilities.getDimension)(p.maxHeight);
|
|
72
74
|
}, function (p) {
|
|
73
75
|
return (0, _utilities.getColor)(p.color);
|
|
74
76
|
}, function (p) {
|
|
75
77
|
return (0, _utilities.getColor)(p.backgroundColor);
|
|
76
78
|
}, function (p) {
|
|
77
|
-
return
|
|
78
|
-
}, function (p) {
|
|
79
|
-
return (0, _utilities.getSpace)(p.height);
|
|
79
|
+
return p.position;
|
|
80
80
|
}, function (p) {
|
|
81
81
|
return (0, _utilities.getRadius)(p.radius);
|
|
82
82
|
}, function (p) {
|
|
@@ -95,7 +95,11 @@ var Box = function Box(_ref) {
|
|
|
95
95
|
borderWidth = _ref.borderWidth,
|
|
96
96
|
borderColor = _ref.borderColor,
|
|
97
97
|
width = _ref.width,
|
|
98
|
+
minWidth = _ref.minWidth,
|
|
99
|
+
maxWidth = _ref.maxWidth,
|
|
98
100
|
height = _ref.height,
|
|
101
|
+
minHeight = _ref.minHeight,
|
|
102
|
+
maxHeight = _ref.maxHeight,
|
|
99
103
|
radius = _ref.radius,
|
|
100
104
|
padding = _ref.padding,
|
|
101
105
|
paddingTop = _ref.paddingTop,
|
|
@@ -127,7 +131,11 @@ var Box = function Box(_ref) {
|
|
|
127
131
|
borderWidth: borderWidth,
|
|
128
132
|
borderColor: borderColor,
|
|
129
133
|
width: width,
|
|
134
|
+
minWidth: minWidth,
|
|
135
|
+
maxWidth: maxWidth,
|
|
130
136
|
height: height,
|
|
137
|
+
minHeight: minHeight,
|
|
138
|
+
maxHeight: maxHeight,
|
|
131
139
|
radius: radius,
|
|
132
140
|
padding: padding,
|
|
133
141
|
paddingTop: paddingY || paddingTop,
|
|
@@ -284,6 +292,30 @@ Box.__docgenInfo = {
|
|
|
284
292
|
"required": false,
|
|
285
293
|
"description": ""
|
|
286
294
|
},
|
|
295
|
+
"minWidth": {
|
|
296
|
+
"type": {
|
|
297
|
+
"name": "union",
|
|
298
|
+
"value": [{
|
|
299
|
+
"name": "number"
|
|
300
|
+
}, {
|
|
301
|
+
"name": "string"
|
|
302
|
+
}]
|
|
303
|
+
},
|
|
304
|
+
"required": false,
|
|
305
|
+
"description": ""
|
|
306
|
+
},
|
|
307
|
+
"maxWidth": {
|
|
308
|
+
"type": {
|
|
309
|
+
"name": "union",
|
|
310
|
+
"value": [{
|
|
311
|
+
"name": "number"
|
|
312
|
+
}, {
|
|
313
|
+
"name": "string"
|
|
314
|
+
}]
|
|
315
|
+
},
|
|
316
|
+
"required": false,
|
|
317
|
+
"description": ""
|
|
318
|
+
},
|
|
287
319
|
"height": {
|
|
288
320
|
"type": {
|
|
289
321
|
"name": "union",
|
|
@@ -296,6 +328,30 @@ Box.__docgenInfo = {
|
|
|
296
328
|
"required": false,
|
|
297
329
|
"description": ""
|
|
298
330
|
},
|
|
331
|
+
"minHeight": {
|
|
332
|
+
"type": {
|
|
333
|
+
"name": "union",
|
|
334
|
+
"value": [{
|
|
335
|
+
"name": "number"
|
|
336
|
+
}, {
|
|
337
|
+
"name": "string"
|
|
338
|
+
}]
|
|
339
|
+
},
|
|
340
|
+
"required": false,
|
|
341
|
+
"description": ""
|
|
342
|
+
},
|
|
343
|
+
"maxHeight": {
|
|
344
|
+
"type": {
|
|
345
|
+
"name": "union",
|
|
346
|
+
"value": [{
|
|
347
|
+
"name": "number"
|
|
348
|
+
}, {
|
|
349
|
+
"name": "string"
|
|
350
|
+
}]
|
|
351
|
+
},
|
|
352
|
+
"required": false,
|
|
353
|
+
"description": ""
|
|
354
|
+
},
|
|
299
355
|
"radius": {
|
|
300
356
|
"type": {
|
|
301
357
|
"name": "union",
|
|
@@ -0,0 +1,94 @@
|
|
|
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.Icon = 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 = ["icon", "size"];
|
|
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 width: fit-content;\n \n svg {\n display: block;\n height: ", ";\n }\n"])), function (p) {
|
|
33
|
+
return (0, _utilities.getIconSize)(p.size);
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
var Icon = function Icon(_ref) {
|
|
37
|
+
var icon = _ref.icon,
|
|
38
|
+
_ref$size = _ref.size,
|
|
39
|
+
size = _ref$size === void 0 ? 'm' : _ref$size,
|
|
40
|
+
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
41
|
+
return __jsx(Wrapper, (0, _extends2.default)({
|
|
42
|
+
size: size
|
|
43
|
+
}, props), icon && icon);
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
exports.Icon = Icon;
|
|
47
|
+
Icon.__docgenInfo = {
|
|
48
|
+
"description": "",
|
|
49
|
+
"methods": [],
|
|
50
|
+
"displayName": "Icon",
|
|
51
|
+
"props": {
|
|
52
|
+
"size": {
|
|
53
|
+
"defaultValue": {
|
|
54
|
+
"value": "'m'",
|
|
55
|
+
"computed": false
|
|
56
|
+
},
|
|
57
|
+
"type": {
|
|
58
|
+
"name": "union",
|
|
59
|
+
"value": [{
|
|
60
|
+
"name": "enum",
|
|
61
|
+
"value": [{
|
|
62
|
+
"value": "\"s\"",
|
|
63
|
+
"computed": false
|
|
64
|
+
}, {
|
|
65
|
+
"value": "\"m\"",
|
|
66
|
+
"computed": false
|
|
67
|
+
}, {
|
|
68
|
+
"value": "\"l\"",
|
|
69
|
+
"computed": false
|
|
70
|
+
}, {
|
|
71
|
+
"value": "\"xl\"",
|
|
72
|
+
"computed": false
|
|
73
|
+
}, {
|
|
74
|
+
"value": "\"xxl\"",
|
|
75
|
+
"computed": false
|
|
76
|
+
}]
|
|
77
|
+
}, {
|
|
78
|
+
"name": "number"
|
|
79
|
+
}, {
|
|
80
|
+
"name": "string"
|
|
81
|
+
}]
|
|
82
|
+
},
|
|
83
|
+
"required": false,
|
|
84
|
+
"description": ""
|
|
85
|
+
},
|
|
86
|
+
"icon": {
|
|
87
|
+
"type": {
|
|
88
|
+
"name": "node"
|
|
89
|
+
},
|
|
90
|
+
"required": false,
|
|
91
|
+
"description": ""
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
};
|
package/es/components/index.js
CHANGED
|
@@ -29,6 +29,18 @@ Object.defineProperty(exports, "TextInput", {
|
|
|
29
29
|
return _textInput.TextInput;
|
|
30
30
|
}
|
|
31
31
|
});
|
|
32
|
+
Object.defineProperty(exports, "Arrange", {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
get: function get() {
|
|
35
|
+
return _arrange.Arrange;
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
Object.defineProperty(exports, "Icon", {
|
|
39
|
+
enumerable: true,
|
|
40
|
+
get: function get() {
|
|
41
|
+
return _icon.Icon;
|
|
42
|
+
}
|
|
43
|
+
});
|
|
32
44
|
|
|
33
45
|
var _text = require("./text");
|
|
34
46
|
|
|
@@ -36,4 +48,8 @@ var _box = require("./box");
|
|
|
36
48
|
|
|
37
49
|
var _button = require("./button");
|
|
38
50
|
|
|
39
|
-
var _textInput = require("./text-input");
|
|
51
|
+
var _textInput = require("./text-input");
|
|
52
|
+
|
|
53
|
+
var _arrange = require("./arrange");
|
|
54
|
+
|
|
55
|
+
var _icon = require("./icon");
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.array.iterator.js");
|
|
4
|
+
|
|
5
|
+
require("core-js/modules/es.object.to-string.js");
|
|
6
|
+
|
|
7
|
+
require("core-js/modules/es.string.iterator.js");
|
|
8
|
+
|
|
9
|
+
require("core-js/modules/es.weak-map.js");
|
|
10
|
+
|
|
11
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
12
|
+
|
|
13
|
+
require("core-js/modules/es.object.define-property.js");
|
|
14
|
+
|
|
15
|
+
require("core-js/modules/es.object.get-own-property-descriptor.js");
|
|
16
|
+
|
|
17
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
18
|
+
|
|
19
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
20
|
+
|
|
21
|
+
Object.defineProperty(exports, "__esModule", {
|
|
22
|
+
value: true
|
|
23
|
+
});
|
|
24
|
+
exports.IconArrowRight = IconArrowRight;
|
|
25
|
+
|
|
26
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
27
|
+
|
|
28
|
+
var React = _interopRequireWildcard(require("react"));
|
|
29
|
+
|
|
30
|
+
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); }
|
|
31
|
+
|
|
32
|
+
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; }
|
|
33
|
+
|
|
34
|
+
var __jsx = React.createElement;
|
|
35
|
+
|
|
36
|
+
function IconArrowRight(props) {
|
|
37
|
+
return __jsx("svg", (0, _extends2.default)({
|
|
38
|
+
viewBox: "0 0 22 32",
|
|
39
|
+
fill: "none"
|
|
40
|
+
}, props), __jsx("path", {
|
|
41
|
+
fill: "#fff",
|
|
42
|
+
d: "M0 0h22v32H0z"
|
|
43
|
+
}), __jsx("path", {
|
|
44
|
+
fillRule: "evenodd",
|
|
45
|
+
clipRule: "evenodd",
|
|
46
|
+
d: "M20.914 15l-9.957-9.957-1.414 1.414L18.086 15H0v2h18.086l-8.543 8.543 1.414 1.414L20.914 17H21v-.086l.914-.914-.914-.914V15h-.086z",
|
|
47
|
+
fill: "#000"
|
|
48
|
+
}));
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
IconArrowRight.__docgenInfo = {
|
|
52
|
+
"description": "",
|
|
53
|
+
"methods": [],
|
|
54
|
+
"displayName": "IconArrowRight"
|
|
55
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
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, "IconArrowRight", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function get() {
|
|
11
|
+
return _iconArrowRight.IconArrowRight;
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
var _iconArrowRight = require("./icon-arrow-right");
|
package/es/index.js
CHANGED
|
@@ -35,4 +35,18 @@ Object.keys(_components).forEach(function (key) {
|
|
|
35
35
|
});
|
|
36
36
|
});
|
|
37
37
|
|
|
38
|
+
var _icons = require("./icons");
|
|
39
|
+
|
|
40
|
+
Object.keys(_icons).forEach(function (key) {
|
|
41
|
+
if (key === "default" || key === "__esModule") return;
|
|
42
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
43
|
+
if (key in exports && exports[key] === _icons[key]) return;
|
|
44
|
+
Object.defineProperty(exports, key, {
|
|
45
|
+
enumerable: true,
|
|
46
|
+
get: function get() {
|
|
47
|
+
return _icons[key];
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
|
|
38
52
|
var _variables = require("./variables");
|
package/es/styles/variables.css
CHANGED
|
@@ -10,6 +10,14 @@
|
|
|
10
10
|
--grn-text-xxl: 30px;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
+
:root {
|
|
14
|
+
--grn-icon-s: calc(var(--grn-unit) * 2.5);
|
|
15
|
+
--grn-icon-m: calc(var(--grn-unit) * 3);
|
|
16
|
+
--grn-icon-l: calc(var(--grn-unit) * 4);
|
|
17
|
+
--grn-icon-xl: calc(var(--grn-unit) * 5);
|
|
18
|
+
--grn-icon-xxl: calc(var(--grn-unit) * 6);
|
|
19
|
+
}
|
|
20
|
+
|
|
13
21
|
:root {
|
|
14
22
|
--grn-weight-normal: 400;
|
|
15
23
|
--grn-weight-medium: 500;
|
package/es/types.js
CHANGED
|
@@ -24,9 +24,14 @@ var types = {
|
|
|
24
24
|
shadow: _propTypes.default.oneOfType([_propTypes.default.oneOf(Object.keys(_variables.vars.shadows)), _propTypes.default.string]),
|
|
25
25
|
position: _propTypes.default.oneOf(["static", "relative", "fixed", "absolute", "sticky"]),
|
|
26
26
|
textSize: _propTypes.default.oneOfType([_propTypes.default.oneOf(Object.keys(_variables.vars.textSizes)), _propTypes.default.number, _propTypes.default.string]),
|
|
27
|
+
iconSize: _propTypes.default.oneOfType([_propTypes.default.oneOf(Object.keys(_variables.vars.iconSizes)), _propTypes.default.number, _propTypes.default.string]),
|
|
27
28
|
weight: _propTypes.default.oneOf(Object.keys(_variables.vars.weights)),
|
|
28
29
|
textAlign: _propTypes.default.oneOf(["left", "center", "right"]),
|
|
29
30
|
overflow: _propTypes.default.oneOf(["visible", "hidden", "scroll", "auto"]),
|
|
30
|
-
fieldSize: _propTypes.default.oneOf(["s", "m"])
|
|
31
|
+
fieldSize: _propTypes.default.oneOf(["s", "m"]),
|
|
32
|
+
columns: _propTypes.default.oneOfType([_propTypes.default.array, _propTypes.default.string]),
|
|
33
|
+
autoFlow: _propTypes.default.oneOf(["column", "row"]),
|
|
34
|
+
gridItemsAlignments: _propTypes.default.oneOf(["start", "end", "center", "stretch"]),
|
|
35
|
+
gridContentPositions: _propTypes.default.oneOf(["start", "end", "center", "stretch", "space-around", "space-between", "space-evenly"])
|
|
31
36
|
};
|
|
32
37
|
exports.types = types;
|
package/es/utilities.js
CHANGED
|
@@ -23,12 +23,14 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
23
23
|
Object.defineProperty(exports, "__esModule", {
|
|
24
24
|
value: true
|
|
25
25
|
});
|
|
26
|
-
exports.getBorder = exports.getSpace = exports.getTransition = exports.getRadius = exports.getWeight = exports.getTextSize = exports.getShadow = exports.getColor = exports.getCssVar = exports.getCssVarCore = exports.isBrowser = void 0;
|
|
26
|
+
exports.getBorder = exports.getGridColumns = exports.getIconSize = exports.getDimension = exports.getSpace = exports.getTransition = exports.getRadius = exports.getWeight = exports.getTextSize = exports.getShadow = exports.getColor = exports.getCssVar = exports.getCssVarCore = exports.isBrowser = void 0;
|
|
27
27
|
|
|
28
28
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
29
29
|
|
|
30
30
|
require("core-js/modules/es.array.concat.js");
|
|
31
31
|
|
|
32
|
+
require("core-js/modules/es.array.map.js");
|
|
33
|
+
|
|
32
34
|
var _variables = require("./variables");
|
|
33
35
|
|
|
34
36
|
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; }
|
|
@@ -54,6 +56,18 @@ var u = function u(amount) {
|
|
|
54
56
|
return "calc(var(--grn-unit) * ".concat(amount, ")");
|
|
55
57
|
};
|
|
56
58
|
|
|
59
|
+
var isNumber = function isNumber(value) {
|
|
60
|
+
return typeof value === "number";
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
var isString = function isString(value) {
|
|
64
|
+
return typeof value === "string";
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
var isArray = function isArray(value) {
|
|
68
|
+
return Array.isArray(value);
|
|
69
|
+
};
|
|
70
|
+
|
|
57
71
|
var getColor = function getColor(color) {
|
|
58
72
|
if (color in _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, _variables.vars.colors.baseColors), _variables.vars.colors.greys), _variables.vars.colors.semanticColors), _variables.vars.colors.fades)) {
|
|
59
73
|
return getCssVar("color", color);
|
|
@@ -113,20 +127,67 @@ var getTransition = function getTransition(transition) {
|
|
|
113
127
|
exports.getTransition = getTransition;
|
|
114
128
|
|
|
115
129
|
var getSpace = function getSpace(space) {
|
|
116
|
-
if (
|
|
117
|
-
if (space in _variables.vars.spaces) {
|
|
118
|
-
return getCssVar("space", space);
|
|
119
|
-
}
|
|
130
|
+
if (space === 0) return space;
|
|
120
131
|
|
|
121
|
-
|
|
132
|
+
if (isNumber(space)) {
|
|
133
|
+
return u(space);
|
|
122
134
|
}
|
|
123
135
|
|
|
124
|
-
if (space
|
|
125
|
-
|
|
136
|
+
if (space in _variables.vars.spaces) {
|
|
137
|
+
return getCssVar("space", space);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
if (isString(space)) {
|
|
141
|
+
return space;
|
|
142
|
+
}
|
|
126
143
|
};
|
|
127
144
|
|
|
128
145
|
exports.getSpace = getSpace;
|
|
129
146
|
|
|
147
|
+
var getDimension = function getDimension(dimension) {
|
|
148
|
+
if (dimension === 0) return dimension;
|
|
149
|
+
|
|
150
|
+
if (isNumber(dimension)) {
|
|
151
|
+
return u(dimension);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
if (isString(dimension)) {
|
|
155
|
+
return dimension;
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
exports.getDimension = getDimension;
|
|
160
|
+
|
|
161
|
+
var getIconSize = function getIconSize(size) {
|
|
162
|
+
if (size === 0) return size;
|
|
163
|
+
|
|
164
|
+
if (size in _variables.vars.iconSizes) {
|
|
165
|
+
return getCssVar("icon", size);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
if (isNumber(size) || isString(size)) {
|
|
169
|
+
return getDimension(size);
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
exports.getIconSize = getIconSize;
|
|
174
|
+
|
|
175
|
+
var getGridColumns = function getGridColumns(columns) {
|
|
176
|
+
if (columns) {
|
|
177
|
+
if (isArray(columns)) {
|
|
178
|
+
return columns.map(function (column) {
|
|
179
|
+
return getDimension(column);
|
|
180
|
+
}).join(" ");
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
if (isString(columns)) {
|
|
184
|
+
return columns;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
exports.getGridColumns = getGridColumns;
|
|
190
|
+
|
|
130
191
|
var getBorder = function getBorder(borderSide) {
|
|
131
192
|
var borderWidth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "1px";
|
|
132
193
|
var borderColor = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "border";
|
package/es/variables.js
CHANGED