@flodesk/grain 5.3.2 → 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.
@@ -68,13 +68,13 @@ export var Arrange = function Arrange(_ref) {
68
68
  }, props), children);
69
69
  };
70
70
  Arrange.propTypes = {
71
- gap: types.space,
72
- columns: types.columns,
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.dimension,
79
- height: types.dimension
78
+ width: types.responsiveDimension,
79
+ height: types.responsiveDimension
80
80
  };
@@ -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.dimension,
161
- minWidth: types.dimension,
162
- maxWidth: types.dimension,
163
- height: types.dimension,
164
- minHeight: types.dimension,
165
- maxHeight: types.dimension,
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.space,
169
- paddingTop: types.space,
170
- paddingBottom: types.space,
171
- paddingLeft: types.space,
172
- paddingRight: types.space,
173
- paddingX: types.space,
174
- paddingY: types.space,
175
- margin: types.space,
176
- marginTop: types.space,
177
- marginBottom: types.space,
178
- marginLeft: types.space,
179
- marginRight: types.space,
180
- marginX: types.space,
181
- marginY: types.space,
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.space,
184
- bottom: types.space,
185
- left: types.space,
186
- right: types.space,
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
  };
@@ -35,5 +35,5 @@ export var Stack = function Stack(_ref) {
35
35
  };
36
36
  Stack.propTypes = {
37
37
  children: PropTypes.node,
38
- gap: types.space
38
+ gap: types.responsiveSpace
39
39
  };
@@ -61,7 +61,7 @@ export var Text = function Text(_ref) {
61
61
  }, props), children);
62
62
  };
63
63
  Text.propTypes = {
64
- size: types.textSize,
64
+ size: types.responsiveTextSize,
65
65
  weight: types.weight,
66
66
  color: types.color,
67
67
  align: types.textAlign,
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
- space: PropTypes.oneOfType([PropTypes.oneOf(Object.keys(vars.spaces)), PropTypes.number, PropTypes.string, PropTypes.object]),
10
- dimension: PropTypes.oneOfType([PropTypes.number, PropTypes.string, PropTypes.object]),
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
- textSize: PropTypes.oneOfType([PropTypes.oneOf(Object.keys(vars.texts)), PropTypes.string, PropTypes.object]),
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
- columns: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
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),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flodesk/grain",
3
- "version": "5.3.2",
3
+ "version": "5.4.0",
4
4
  "description": "Flodesk design system",
5
5
  "module": "es/index.js",
6
6
  "author": "Flodesk",