@flodesk/grain 5.3.0 → 5.4.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 +4 -4
- package/es/components/box.js +33 -28
- package/es/components/stack.js +1 -1
- package/es/components/tab.js +1 -1
- package/es/components/text.js +1 -1
- package/es/icons/icon-phone.js +1 -1
- package/es/types.js +5 -4
- package/package.json +1 -1
package/es/components/arrange.js
CHANGED
|
@@ -68,13 +68,13 @@ export var Arrange = function Arrange(_ref) {
|
|
|
68
68
|
}, props), children);
|
|
69
69
|
};
|
|
70
70
|
Arrange.propTypes = {
|
|
71
|
-
gap: types.
|
|
72
|
-
columns: types.
|
|
71
|
+
gap: types.responsiveSpace,
|
|
72
|
+
columns: types.responsiveColumns,
|
|
73
73
|
autoFlow: types.autoFlow,
|
|
74
74
|
alignItems: types.gridItemsAlignment,
|
|
75
75
|
justifyItems: types.gridItemsAlignment,
|
|
76
76
|
justifyContent: types.gridContentPosition,
|
|
77
77
|
alignContent: types.gridContentPosition,
|
|
78
|
-
width: types.
|
|
79
|
-
height: types.
|
|
78
|
+
width: types.responsiveDimension,
|
|
79
|
+
height: types.responsiveDimension
|
|
80
80
|
};
|
package/es/components/box.js
CHANGED
|
@@ -4,7 +4,7 @@ import "core-js/modules/es.object.define-properties.js";
|
|
|
4
4
|
import "core-js/modules/es.object.keys.js";
|
|
5
5
|
import "core-js/modules/es.array.index-of.js";
|
|
6
6
|
import "core-js/modules/es.symbol.js";
|
|
7
|
-
var _excluded = ["children", "color", "backgroundColor", "borderColor", "borderWidth", "borderSide", "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"];
|
|
7
|
+
var _excluded = ["children", "color", "backgroundColor", "borderColor", "borderWidth", "borderSide", "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", "zIndex"];
|
|
8
8
|
|
|
9
9
|
var _templateObject;
|
|
10
10
|
|
|
@@ -21,7 +21,7 @@ import React from 'react';
|
|
|
21
21
|
import styled from '@emotion/styled';
|
|
22
22
|
import { types } from '../types';
|
|
23
23
|
import PropTypes from 'prop-types';
|
|
24
|
-
var Wrapper = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", ";\n\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n\n ", ";\n ", ";\n ", ";\n ", ";\n\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n\n color: ", ";\n background-color: ", ";\n\n position: ", ";\n border-radius: ", ";\n box-shadow: ", ";\n overflow: ", ";\n aspect-ratio: ", ";\n"])), function (p) {
|
|
24
|
+
var Wrapper = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", ";\n\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n\n ", ";\n ", ";\n ", ";\n ", ";\n\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n\n color: ", ";\n background-color: ", ";\n\n position: ", ";\n border-radius: ", ";\n box-shadow: ", ";\n overflow: ", ";\n aspect-ratio: ", ";\n ", ";\n"])), function (p) {
|
|
25
25
|
return getBorder(p.borderSide, p.borderWidth, p.borderColor);
|
|
26
26
|
}, function (p) {
|
|
27
27
|
return getResponsiveSpace('padding', p.padding);
|
|
@@ -77,6 +77,8 @@ var Wrapper = styled.div(_templateObject || (_templateObject = _taggedTemplateLi
|
|
|
77
77
|
return p.overflow;
|
|
78
78
|
}, function (p) {
|
|
79
79
|
return p.aspectRatio;
|
|
80
|
+
}, function (p) {
|
|
81
|
+
return p.zIndex && "z-index: ".concat(p.zIndex);
|
|
80
82
|
});
|
|
81
83
|
export var Box = function Box(_ref) {
|
|
82
84
|
var children = _ref.children,
|
|
@@ -116,6 +118,7 @@ export var Box = function Box(_ref) {
|
|
|
116
118
|
shadow = _ref.shadow,
|
|
117
119
|
overflow = _ref.overflow,
|
|
118
120
|
aspectRatio = _ref.aspectRatio,
|
|
121
|
+
zIndex = _ref.zIndex,
|
|
119
122
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
120
123
|
|
|
121
124
|
return /*#__PURE__*/React.createElement(Wrapper, Object.assign({
|
|
@@ -148,7 +151,8 @@ export var Box = function Box(_ref) {
|
|
|
148
151
|
right: right,
|
|
149
152
|
shadow: shadow,
|
|
150
153
|
overflow: overflow,
|
|
151
|
-
aspectRatio: aspectRatio
|
|
154
|
+
aspectRatio: aspectRatio,
|
|
155
|
+
zIndex: zIndex
|
|
152
156
|
}, props), children);
|
|
153
157
|
};
|
|
154
158
|
Box.propTypes = {
|
|
@@ -157,33 +161,34 @@ Box.propTypes = {
|
|
|
157
161
|
borderSide: types.side,
|
|
158
162
|
borderWidth: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
159
163
|
borderColor: types.color,
|
|
160
|
-
width: types.
|
|
161
|
-
minWidth: types.
|
|
162
|
-
maxWidth: types.
|
|
163
|
-
height: types.
|
|
164
|
-
minHeight: types.
|
|
165
|
-
maxHeight: types.
|
|
164
|
+
width: types.responsiveDimension,
|
|
165
|
+
minWidth: types.responsiveDimension,
|
|
166
|
+
maxWidth: types.responsiveDimension,
|
|
167
|
+
height: types.responsiveDimension,
|
|
168
|
+
minHeight: types.responsiveDimension,
|
|
169
|
+
maxHeight: types.responsiveDimension,
|
|
166
170
|
radius: types.radius,
|
|
167
171
|
shadow: types.shadow,
|
|
168
|
-
padding: types.
|
|
169
|
-
paddingTop: types.
|
|
170
|
-
paddingBottom: types.
|
|
171
|
-
paddingLeft: types.
|
|
172
|
-
paddingRight: types.
|
|
173
|
-
paddingX: types.
|
|
174
|
-
paddingY: types.
|
|
175
|
-
margin: types.
|
|
176
|
-
marginTop: types.
|
|
177
|
-
marginBottom: types.
|
|
178
|
-
marginLeft: types.
|
|
179
|
-
marginRight: types.
|
|
180
|
-
marginX: types.
|
|
181
|
-
marginY: types.
|
|
172
|
+
padding: types.responsiveSpace,
|
|
173
|
+
paddingTop: types.responsiveSpace,
|
|
174
|
+
paddingBottom: types.responsiveSpace,
|
|
175
|
+
paddingLeft: types.responsiveSpace,
|
|
176
|
+
paddingRight: types.responsiveSpace,
|
|
177
|
+
paddingX: types.responsiveSpace,
|
|
178
|
+
paddingY: types.responsiveSpace,
|
|
179
|
+
margin: types.responsiveSpace,
|
|
180
|
+
marginTop: types.responsiveSpace,
|
|
181
|
+
marginBottom: types.responsiveSpace,
|
|
182
|
+
marginLeft: types.responsiveSpace,
|
|
183
|
+
marginRight: types.responsiveSpace,
|
|
184
|
+
marginX: types.responsiveSpace,
|
|
185
|
+
marginY: types.responsiveSpace,
|
|
182
186
|
position: types.position,
|
|
183
|
-
top: types.
|
|
184
|
-
bottom: types.
|
|
185
|
-
left: types.
|
|
186
|
-
right: types.
|
|
187
|
+
top: types.responsiveSpace,
|
|
188
|
+
bottom: types.responsiveSpace,
|
|
189
|
+
left: types.responsiveSpace,
|
|
190
|
+
right: types.responsiveSpace,
|
|
187
191
|
overflow: types.overflow,
|
|
188
|
-
aspectRatio: PropTypes.string
|
|
192
|
+
aspectRatio: PropTypes.string,
|
|
193
|
+
zIndex: types.zIndex
|
|
189
194
|
};
|
package/es/components/stack.js
CHANGED
package/es/components/tab.js
CHANGED
|
@@ -22,7 +22,7 @@ import React from 'react';
|
|
|
22
22
|
import styled from '@emotion/styled';
|
|
23
23
|
import PropTypes from 'prop-types';
|
|
24
24
|
import { types } from '../types';
|
|
25
|
-
var Wrapper = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n gap: var(--grn-space-
|
|
25
|
+
var Wrapper = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n gap: var(--grn-space-l);\n width: fit-content;\n align-items: stretch;\n height: ", ";\n"])), function (p) {
|
|
26
26
|
return getDimension(p.height);
|
|
27
27
|
});
|
|
28
28
|
var TabWrapper = styled.button(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n appearance: none;\n border: none;\n padding: 0;\n font-family: inherit;\n font-size: inherit;\n font-weight: ", ";\n cursor: pointer;\n height: 100%;\n background-color: transparent;\n color: var(--grn-color-bodyDimmed);\n border-radius: 0;\n white-space: nowrap;\n transition: color ", ", box-shadow ", ";\n\n &:hover {\n color: var(--grn-color-body);\n }\n\n ", ";\n"])), getWeight('medium'), getTransition('fast'), getTransition('xFast'), function (p) {
|
package/es/components/text.js
CHANGED
package/es/icons/icon-phone.js
CHANGED
|
@@ -9,7 +9,7 @@ var IconPhone = function IconPhone(props) {
|
|
|
9
9
|
}, props), /*#__PURE__*/React.createElement("path", {
|
|
10
10
|
fillRule: "evenodd",
|
|
11
11
|
clipRule: "evenodd",
|
|
12
|
-
d: "M2 4a2 2 0 00-2 2v20a2 2 0 002 2h12a2 2 0 002-2V6a2 2 0 00-2-2H2zm0 2h12v20H2V6zm6
|
|
12
|
+
d: "M2 4a2 2 0 00-2 2v20a2 2 0 002 2h12a2 2 0 002-2V6a2 2 0 00-2-2H2zm0 2h12v20H2V6zm6 18.5a1.5 1.5 0 100-3 1.5 1.5 0 000 3z",
|
|
13
13
|
fill: "currentColor"
|
|
14
14
|
}));
|
|
15
15
|
};
|
package/es/types.js
CHANGED
|
@@ -6,20 +6,21 @@ export var gridItemsAlignments = ['start', 'end', 'center', 'stretch'];
|
|
|
6
6
|
export var autoFlows = ['column', 'row'];
|
|
7
7
|
export var types = {
|
|
8
8
|
color: PropTypes.oneOfType([PropTypes.oneOf(Object.keys(vars.colors)), PropTypes.string]),
|
|
9
|
-
|
|
10
|
-
dimension: PropTypes.oneOfType([PropTypes.number, PropTypes.string
|
|
9
|
+
responsiveSpace: PropTypes.oneOfType([PropTypes.oneOf(Object.keys(vars.spaces)), PropTypes.number, PropTypes.string, PropTypes.object]),
|
|
10
|
+
dimension: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
11
|
+
responsiveDimension: PropTypes.oneOfType([PropTypes.number, PropTypes.string, PropTypes.object]),
|
|
11
12
|
side: PropTypes.oneOf(['all', 'left', 'right', 'top', 'bottom', 'x', 'y']),
|
|
12
13
|
radius: PropTypes.oneOfType([PropTypes.oneOf(Object.keys(vars.radii)), PropTypes.string, PropTypes.number]),
|
|
13
14
|
shadow: PropTypes.oneOfType([PropTypes.oneOf(Object.keys(vars.shadows)), PropTypes.string]),
|
|
14
15
|
position: PropTypes.oneOf(['static', 'relative', 'fixed', 'absolute', 'sticky']),
|
|
15
|
-
|
|
16
|
+
responsiveTextSize: PropTypes.oneOfType([PropTypes.oneOf(Object.keys(vars.texts)), PropTypes.string, PropTypes.object]),
|
|
16
17
|
iconSize: PropTypes.oneOfType([PropTypes.oneOf(Object.keys(vars.icons)), PropTypes.number, PropTypes.string]),
|
|
17
18
|
weight: PropTypes.oneOf(Object.keys(vars.weights)),
|
|
18
19
|
textAlign: PropTypes.oneOf(['left', 'center', 'right']),
|
|
19
20
|
overflow: PropTypes.oneOf(['visible', 'hidden', 'scroll', 'auto']),
|
|
20
21
|
fieldSize: PropTypes.oneOf(['s', 'm']),
|
|
21
22
|
textTag: PropTypes.oneOf(['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'p', 'span']),
|
|
22
|
-
|
|
23
|
+
responsiveColumns: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
|
|
23
24
|
autoFlow: PropTypes.oneOf(autoFlows),
|
|
24
25
|
gridItemsAlignment: PropTypes.oneOf(gridItemsAlignments),
|
|
25
26
|
gridContentPosition: PropTypes.oneOf(gridContentPositions),
|