@flodesk/grain 11.0.0-next.2 → 11.0.0-next.4
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/index.js +97 -0
- package/es/components/arrange/styles.module.css +3 -0
- package/es/components/box.js +37 -53
- package/es/components/text/index.js +26 -19
- package/es/styles/utilities.js +7 -3
- package/es/utilities/attributes.js +12 -1
- package/es/utilities/style-config.js +65 -1
- package/package.json +1 -1
- package/es/components/arrange.js +0 -91
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import "core-js/modules/es.object.keys.js";
|
|
2
|
+
import "core-js/modules/es.array.index-of.js";
|
|
3
|
+
import "core-js/modules/es.symbol.js";
|
|
4
|
+
import "core-js/modules/es.object.define-property.js";
|
|
5
|
+
import "core-js/modules/es.array.filter.js";
|
|
6
|
+
import "core-js/modules/es.object.to-string.js";
|
|
7
|
+
import "core-js/modules/es.object.get-own-property-descriptor.js";
|
|
8
|
+
import "core-js/modules/web.dom-collections.for-each.js";
|
|
9
|
+
import "core-js/modules/es.object.get-own-property-descriptors.js";
|
|
10
|
+
import "core-js/modules/es.object.define-properties.js";
|
|
11
|
+
import "core-js/modules/es.object.assign.js";
|
|
12
|
+
var _excluded = ["children", "gap", "columnGap", "rowGap", "alignItems", "justifyItems", "justifyContent", "alignContent", "columns", "rows", "autoFlow", "className", "style"];
|
|
13
|
+
|
|
14
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
15
|
+
|
|
16
|
+
import "core-js/modules/es.regexp.exec.js";
|
|
17
|
+
import "core-js/modules/es.string.replace.js";
|
|
18
|
+
import "core-js/modules/es.string.trim.js";
|
|
19
|
+
import "core-js/modules/es.array.concat.js";
|
|
20
|
+
|
|
21
|
+
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; }
|
|
22
|
+
|
|
23
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
24
|
+
|
|
25
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
26
|
+
|
|
27
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
28
|
+
|
|
29
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
30
|
+
|
|
31
|
+
import { generateAttributes } from '../../utilities';
|
|
32
|
+
import React, { forwardRef } from 'react';
|
|
33
|
+
import { types } from '../../types';
|
|
34
|
+
import { Box } from '../box';
|
|
35
|
+
import styles from './styles.module.css';
|
|
36
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
37
|
+
export var Arrange = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
38
|
+
var children = _ref.children,
|
|
39
|
+
gap = _ref.gap,
|
|
40
|
+
columnGap = _ref.columnGap,
|
|
41
|
+
rowGap = _ref.rowGap,
|
|
42
|
+
_ref$alignItems = _ref.alignItems,
|
|
43
|
+
alignItems = _ref$alignItems === void 0 ? 'center' : _ref$alignItems,
|
|
44
|
+
justifyItems = _ref.justifyItems,
|
|
45
|
+
_ref$justifyContent = _ref.justifyContent,
|
|
46
|
+
justifyContent = _ref$justifyContent === void 0 ? 'start' : _ref$justifyContent,
|
|
47
|
+
alignContent = _ref.alignContent,
|
|
48
|
+
columns = _ref.columns,
|
|
49
|
+
rows = _ref.rows,
|
|
50
|
+
_ref$autoFlow = _ref.autoFlow,
|
|
51
|
+
autoFlow = _ref$autoFlow === void 0 ? 'column' : _ref$autoFlow,
|
|
52
|
+
className = _ref.className,
|
|
53
|
+
style = _ref.style,
|
|
54
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
55
|
+
|
|
56
|
+
var propClassName = className ? className : '';
|
|
57
|
+
var propStyle = style ? style : {};
|
|
58
|
+
var sharedProps = {
|
|
59
|
+
gap: gap,
|
|
60
|
+
columnGap: columnGap,
|
|
61
|
+
rowGap: rowGap
|
|
62
|
+
};
|
|
63
|
+
var attributes = generateAttributes({
|
|
64
|
+
styleProps: _objectSpread({
|
|
65
|
+
columns: columns,
|
|
66
|
+
rows: rows
|
|
67
|
+
}, sharedProps),
|
|
68
|
+
classNameProps: _objectSpread(_objectSpread({
|
|
69
|
+
alignItems: alignItems,
|
|
70
|
+
justifyItems: justifyItems,
|
|
71
|
+
justifyContent: justifyContent,
|
|
72
|
+
alignContent: alignContent,
|
|
73
|
+
autoFlow: autoFlow
|
|
74
|
+
}, !columns && autoFlow), sharedProps)
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
var styleAttributes = _objectSpread(_objectSpread({}, attributes.styles), propStyle);
|
|
78
|
+
|
|
79
|
+
var classAttributes = "".concat(attributes.classNames, " ").concat(propClassName, " ").concat(styles.arrange).trim().replace(/\s+/g, ' ');
|
|
80
|
+
return ___EmotionJSX(Box, _extends({
|
|
81
|
+
ref: ref,
|
|
82
|
+
className: classAttributes,
|
|
83
|
+
style: styleAttributes
|
|
84
|
+
}, props), children);
|
|
85
|
+
});
|
|
86
|
+
Arrange.propTypes = {
|
|
87
|
+
gap: types.responsiveSpace,
|
|
88
|
+
columnGap: types.responsiveSpace,
|
|
89
|
+
rowGap: types.responsiveSpace,
|
|
90
|
+
columns: types.responsiveColumns,
|
|
91
|
+
rows: types.responsiveRows,
|
|
92
|
+
autoFlow: types.autoFlow,
|
|
93
|
+
alignItems: types.gridItemsAlignment,
|
|
94
|
+
justifyItems: types.gridItemsAlignment,
|
|
95
|
+
justifyContent: types.gridContentPosition,
|
|
96
|
+
alignContent: types.gridContentPosition
|
|
97
|
+
};
|
package/es/components/box.js
CHANGED
|
@@ -14,6 +14,7 @@ var _excluded = ["color", "colorHover", "backgroundColor", "backgroundColorHover
|
|
|
14
14
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
15
15
|
|
|
16
16
|
import "core-js/modules/es.string.trim.js";
|
|
17
|
+
import "core-js/modules/es.array.concat.js";
|
|
17
18
|
|
|
18
19
|
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; }
|
|
19
20
|
|
|
@@ -28,10 +29,10 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
28
29
|
import React, { forwardRef } from 'react';
|
|
29
30
|
import { types } from '../types';
|
|
30
31
|
import PropTypes from 'prop-types';
|
|
31
|
-
import {
|
|
32
|
+
import { generateAttributes } from '../utilities';
|
|
32
33
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
33
34
|
export var Box = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
34
|
-
var
|
|
35
|
+
var _objectSpread2;
|
|
35
36
|
|
|
36
37
|
var color = _ref.color,
|
|
37
38
|
colorHover = _ref.colorHover,
|
|
@@ -89,52 +90,10 @@ export var Box = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
89
90
|
borderSide = _ref.borderSide,
|
|
90
91
|
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
91
92
|
|
|
92
|
-
var styles = _objectSpread({}, generateStyleAttributes({
|
|
93
|
-
width: width,
|
|
94
|
-
minWidth: minWidth,
|
|
95
|
-
maxWidth: maxWidth,
|
|
96
|
-
height: height,
|
|
97
|
-
minHeight: minHeight,
|
|
98
|
-
maxHeight: maxHeight,
|
|
99
|
-
color: color,
|
|
100
|
-
colorHover: colorHover,
|
|
101
|
-
backgroundColor: backgroundColor,
|
|
102
|
-
backgroundColorHover: backgroundColorHover,
|
|
103
|
-
padding: padding,
|
|
104
|
-
paddingTop: paddingTop,
|
|
105
|
-
paddingBottom: paddingBottom,
|
|
106
|
-
paddingLeft: paddingLeft,
|
|
107
|
-
paddingRight: paddingRight,
|
|
108
|
-
paddingX: paddingX,
|
|
109
|
-
paddingY: paddingY,
|
|
110
|
-
margin: margin,
|
|
111
|
-
marginTop: marginTop,
|
|
112
|
-
marginBottom: marginBottom,
|
|
113
|
-
marginLeft: marginLeft,
|
|
114
|
-
marginRight: marginRight,
|
|
115
|
-
marginX: marginX,
|
|
116
|
-
marginY: marginY,
|
|
117
|
-
top: top,
|
|
118
|
-
bottom: bottom,
|
|
119
|
-
left: left,
|
|
120
|
-
right: right,
|
|
121
|
-
shadow: shadow,
|
|
122
|
-
shadowHover: shadowHover,
|
|
123
|
-
radius: radius,
|
|
124
|
-
order: order,
|
|
125
|
-
zIndex: zIndex,
|
|
126
|
-
transition: transition,
|
|
127
|
-
transitionHover: transitionHover,
|
|
128
|
-
aspectRatio: aspectRatio,
|
|
129
|
-
flex: flex,
|
|
130
|
-
opacity: opacity,
|
|
131
|
-
opacityHover: opacityHover,
|
|
132
|
-
borderColor: borderColor,
|
|
133
|
-
borderColorHover: borderColorHover
|
|
134
|
-
}));
|
|
135
|
-
|
|
136
93
|
var propClassName = className ? className : '';
|
|
137
|
-
var
|
|
94
|
+
var propStyle = style ? style : {};
|
|
95
|
+
var Tag = tag;
|
|
96
|
+
var sharedProps = {
|
|
138
97
|
padding: padding,
|
|
139
98
|
paddingTop: paddingTop,
|
|
140
99
|
paddingBottom: paddingBottom,
|
|
@@ -149,7 +108,6 @@ export var Box = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
149
108
|
marginRight: marginRight,
|
|
150
109
|
marginX: marginX,
|
|
151
110
|
marginY: marginY,
|
|
152
|
-
position: position,
|
|
153
111
|
top: top,
|
|
154
112
|
bottom: bottom,
|
|
155
113
|
left: left,
|
|
@@ -160,13 +118,39 @@ export var Box = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
160
118
|
backgroundColorHover: backgroundColorHover,
|
|
161
119
|
shadow: shadow,
|
|
162
120
|
shadowHover: shadowHover,
|
|
163
|
-
radius: radius
|
|
164
|
-
|
|
165
|
-
|
|
121
|
+
radius: radius,
|
|
122
|
+
borderColor: borderColor,
|
|
123
|
+
borderColorHover: borderColorHover,
|
|
124
|
+
transition: transition,
|
|
125
|
+
transitionHover: transitionHover
|
|
126
|
+
};
|
|
127
|
+
var attributes = generateAttributes({
|
|
128
|
+
styleProps: _objectSpread({
|
|
129
|
+
width: width,
|
|
130
|
+
minWidth: minWidth,
|
|
131
|
+
maxWidth: maxWidth,
|
|
132
|
+
height: height,
|
|
133
|
+
minHeight: minHeight,
|
|
134
|
+
maxHeight: maxHeight,
|
|
135
|
+
order: order,
|
|
136
|
+
zIndex: zIndex,
|
|
137
|
+
aspectRatio: aspectRatio,
|
|
138
|
+
flex: flex,
|
|
139
|
+
opacity: opacity,
|
|
140
|
+
opacityHover: opacityHover
|
|
141
|
+
}, sharedProps),
|
|
142
|
+
classNameProps: _objectSpread((_objectSpread2 = {
|
|
143
|
+
position: position
|
|
144
|
+
}, _defineProperty(_objectSpread2, "position", position), _defineProperty(_objectSpread2, "overflow", overflow), _defineProperty(_objectSpread2, "cursor", cursor), _defineProperty(_objectSpread2, "alignSelf", alignSelf), _defineProperty(_objectSpread2, "borderWidth", borderWidth), _defineProperty(_objectSpread2, "borderSide", borderSide), _objectSpread2), sharedProps)
|
|
145
|
+
});
|
|
146
|
+
var classAttributes = "".concat(attributes.classNames, " ").concat(propClassName).trim();
|
|
147
|
+
|
|
148
|
+
var styleAttributes = _objectSpread(_objectSpread({}, attributes.styles), propStyle);
|
|
149
|
+
|
|
166
150
|
return ___EmotionJSX(Tag, _extends({
|
|
167
151
|
ref: ref,
|
|
168
|
-
|
|
169
|
-
|
|
152
|
+
className: classAttributes,
|
|
153
|
+
style: styleAttributes
|
|
170
154
|
}, otherProps), children);
|
|
171
155
|
});
|
|
172
156
|
Box.propTypes = {
|
|
@@ -9,7 +9,7 @@ import "core-js/modules/web.dom-collections.for-each.js";
|
|
|
9
9
|
import "core-js/modules/es.object.get-own-property-descriptors.js";
|
|
10
10
|
import "core-js/modules/es.object.define-properties.js";
|
|
11
11
|
import "core-js/modules/es.object.assign.js";
|
|
12
|
-
var _excluded = ["children", "size", "weight", "color", "tag", "display", "hasEllipsis", "ellipsisLines", "align", "letterSpacing", "textTransform", "variant", "trimTop", "className"];
|
|
12
|
+
var _excluded = ["children", "size", "weight", "color", "tag", "display", "hasEllipsis", "ellipsisLines", "align", "letterSpacing", "textTransform", "variant", "trimTop", "className", "style"];
|
|
13
13
|
|
|
14
14
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
15
15
|
|
|
@@ -27,7 +27,7 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
27
27
|
|
|
28
28
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
29
29
|
|
|
30
|
-
import {
|
|
30
|
+
import { generateAttributes } from '../../utilities';
|
|
31
31
|
import PropTypes from 'prop-types';
|
|
32
32
|
import React, { forwardRef } from 'react';
|
|
33
33
|
import { types } from '../../types';
|
|
@@ -51,6 +51,7 @@ export var Text = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
51
51
|
variant = _ref.variant,
|
|
52
52
|
trimTop = _ref.trimTop,
|
|
53
53
|
className = _ref.className,
|
|
54
|
+
style = _ref.style,
|
|
54
55
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
55
56
|
|
|
56
57
|
var Tag = tag;
|
|
@@ -62,26 +63,32 @@ export var Text = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
62
63
|
letterSpacing = '0.05em';
|
|
63
64
|
}
|
|
64
65
|
|
|
65
|
-
var genStyles = _objectSpread(_objectSpread({}, generateStyleAttributes({
|
|
66
|
-
size: size,
|
|
67
|
-
align: align,
|
|
68
|
-
color: color,
|
|
69
|
-
letterSpacing: letterSpacing
|
|
70
|
-
})), ellipsisLines && _defineProperty({}, '--el', ellipsisLines));
|
|
71
|
-
|
|
72
66
|
var propClassName = className ? className : '';
|
|
73
|
-
var
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
67
|
+
var propStyle = style ? style : {};
|
|
68
|
+
var attributes = generateAttributes({
|
|
69
|
+
styleProps: {
|
|
70
|
+
size: size,
|
|
71
|
+
align: align,
|
|
72
|
+
color: color,
|
|
73
|
+
letterSpacing: letterSpacing
|
|
74
|
+
},
|
|
75
|
+
classNameProps: {
|
|
76
|
+
size: size,
|
|
77
|
+
align: align,
|
|
78
|
+
color: color,
|
|
79
|
+
weight: weight,
|
|
80
|
+
display: !ellipsisLines ? display : undefined,
|
|
81
|
+
textTransform: textTransform
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
var styleAttributes = _objectSpread(_objectSpread(_objectSpread({}, attributes.styles), propStyle), ellipsisLines && _defineProperty({}, '--el', ellipsisLines));
|
|
86
|
+
|
|
87
|
+
var classAttributes = [attributes.classNames, propClassName, trimTop && styles.trimTop, hasEllipsis && !ellipsisLines ? styles.ellipsis : undefined, hasEllipsis && ellipsisLines ? styles.ellipsisMulti : undefined].join(' ').replace(/\s+/g, ' ').trim();
|
|
81
88
|
return ___EmotionJSX(Tag, _extends({
|
|
82
89
|
ref: ref,
|
|
83
|
-
className:
|
|
84
|
-
style:
|
|
90
|
+
className: classAttributes,
|
|
91
|
+
style: styleAttributes
|
|
85
92
|
}, props), children);
|
|
86
93
|
});
|
|
87
94
|
Text.propTypes = {
|
package/es/styles/utilities.js
CHANGED
|
@@ -99,10 +99,14 @@ var spaceProps = styleConfig.spaceProps,
|
|
|
99
99
|
textDisplayProps = styleConfig.textDisplayProps,
|
|
100
100
|
zIndexProps = styleConfig.zIndexProps,
|
|
101
101
|
letterSpacingProps = styleConfig.letterSpacingProps,
|
|
102
|
-
textTransformProps = styleConfig.textTransformProps
|
|
102
|
+
textTransformProps = styleConfig.textTransformProps,
|
|
103
|
+
autoFlowProps = styleConfig.autoFlowProps,
|
|
104
|
+
gridTemplateProps = styleConfig.gridTemplateProps,
|
|
105
|
+
gridItemsAlignmentProps = styleConfig.gridItemsAlignmentProps,
|
|
106
|
+
gridContentPositionProps = styleConfig.gridContentPositionProps;
|
|
103
107
|
var classAndStyleDeclarationProps = [spaceProps, colorProps, shadowProps, radiusProps, transitionProps, sizeProps, borderColorProps, alignProps];
|
|
104
|
-
var classDeclarationProps = [].concat(classAndStyleDeclarationProps, [positionProps, overflowProps, cursorProps, sizeProps, alignSelfProps, borderWidthProps, weightProps, textDisplayProps, borderSideProps, textTransformProps]);
|
|
105
|
-
var styleDeclarationProps = [].concat(classAndStyleDeclarationProps, [dimensionProps, aspectRatioProps, orderProps, flexProps, opacityProps, zIndexProps, letterSpacingProps]);
|
|
108
|
+
var classDeclarationProps = [].concat(classAndStyleDeclarationProps, [positionProps, overflowProps, cursorProps, sizeProps, alignSelfProps, borderWidthProps, weightProps, textDisplayProps, borderSideProps, textTransformProps, autoFlowProps, gridItemsAlignmentProps, gridContentPositionProps]);
|
|
109
|
+
var styleDeclarationProps = [].concat(classAndStyleDeclarationProps, [dimensionProps, aspectRatioProps, orderProps, flexProps, opacityProps, zIndexProps, letterSpacingProps, gridTemplateProps]);
|
|
106
110
|
var defaultBorder = "\n [class*=\"bd\"] {\n border-color: var(--grn-color-border);\n border-width: 1px;\n }\n";
|
|
107
111
|
var utilities = "\n ".concat(defaultBorder, "\n ").concat(generateUtilityClassDeclarations(classDeclarationProps), ";\n ").concat(generateStyleClassDeclarations(styleDeclarationProps), ";\n");
|
|
108
112
|
export default utilities;
|
|
@@ -3,6 +3,7 @@ import "core-js/modules/es.object.to-string.js";
|
|
|
3
3
|
import "core-js/modules/web.dom-collections.for-each.js";
|
|
4
4
|
import "core-js/modules/es.array.concat.js";
|
|
5
5
|
import "core-js/modules/es.object.keys.js";
|
|
6
|
+
import "core-js/modules/es.string.trim.js";
|
|
6
7
|
import { breakpoints, deviceShort } from '../variables';
|
|
7
8
|
import { isObject } from './helpers';
|
|
8
9
|
import { propNameToShort, styleConfig } from './style-config';
|
|
@@ -62,5 +63,15 @@ export var generateClassNameAttributes = function generateClassNameAttributes(pr
|
|
|
62
63
|
});
|
|
63
64
|
});
|
|
64
65
|
});
|
|
65
|
-
return classNames.join(' ');
|
|
66
|
+
return classNames.join(' ').trim();
|
|
67
|
+
};
|
|
68
|
+
export var generateAttributes = function generateAttributes(_ref2) {
|
|
69
|
+
var styleProps = _ref2.styleProps,
|
|
70
|
+
classNameProps = _ref2.classNameProps;
|
|
71
|
+
var styleAttributes = generateStyleAttributes(styleProps);
|
|
72
|
+
var classNameAttributes = generateClassNameAttributes(classNameProps);
|
|
73
|
+
return {
|
|
74
|
+
styles: styleAttributes,
|
|
75
|
+
classNames: classNameAttributes
|
|
76
|
+
};
|
|
66
77
|
};
|
|
@@ -28,7 +28,7 @@ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToAr
|
|
|
28
28
|
|
|
29
29
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
30
30
|
|
|
31
|
-
import { alignSelfs, borderWidths, cursors, overflows, positions, sides, textAlignments, textDisplays, textTransforms } from '../types';
|
|
31
|
+
import { alignSelfs, autoFlows, borderWidths, cursors, gridContentPositions, gridItemsAlignments, overflows, positions, sides, textAlignments, textDisplays, textTransforms } from '../types';
|
|
32
32
|
import { vars } from '../variables';
|
|
33
33
|
import { getDimension, getSpace, getTextSize, isSpaceVar } from './responsive';
|
|
34
34
|
import { getColor, getRadius, getShadow, getTransition, getWeight, isColorVar, isRadiusVar, isShadowVar, isTrasitionVar } from './styles';
|
|
@@ -130,6 +130,18 @@ export var styleConfig = {
|
|
|
130
130
|
propName: 'right',
|
|
131
131
|
property: 'right',
|
|
132
132
|
short: 'r'
|
|
133
|
+
}, {
|
|
134
|
+
propName: 'gap',
|
|
135
|
+
property: 'gap',
|
|
136
|
+
short: 'g'
|
|
137
|
+
}, {
|
|
138
|
+
propName: 'rowGap',
|
|
139
|
+
property: 'row-gap',
|
|
140
|
+
short: 'rg'
|
|
141
|
+
}, {
|
|
142
|
+
propName: 'columnGap',
|
|
143
|
+
property: 'column-gap',
|
|
144
|
+
short: 'cg'
|
|
133
145
|
}],
|
|
134
146
|
valueTransformer: getSpace,
|
|
135
147
|
variableChecker: isSpaceVar,
|
|
@@ -423,6 +435,58 @@ export var styleConfig = {
|
|
|
423
435
|
variableChecker: function variableChecker(value) {
|
|
424
436
|
return textTransforms.includes(value);
|
|
425
437
|
}
|
|
438
|
+
},
|
|
439
|
+
autoFlowProps: {
|
|
440
|
+
props: [{
|
|
441
|
+
propName: 'autoFlow',
|
|
442
|
+
property: 'grid-auto-flow',
|
|
443
|
+
short: 'af'
|
|
444
|
+
}],
|
|
445
|
+
variables: autoFlows,
|
|
446
|
+
variableChecker: function variableChecker(value) {
|
|
447
|
+
return autoFlows.includes(value);
|
|
448
|
+
}
|
|
449
|
+
},
|
|
450
|
+
gridTemplateProps: {
|
|
451
|
+
props: [{
|
|
452
|
+
propName: 'columns',
|
|
453
|
+
property: 'grid-template-columns',
|
|
454
|
+
short: 'gtc'
|
|
455
|
+
}, {
|
|
456
|
+
propName: 'rows',
|
|
457
|
+
property: 'grid-template-rows',
|
|
458
|
+
short: 'gtr'
|
|
459
|
+
}]
|
|
460
|
+
},
|
|
461
|
+
gridItemsAlignmentProps: {
|
|
462
|
+
props: [{
|
|
463
|
+
propName: 'alignItems',
|
|
464
|
+
property: 'align-items',
|
|
465
|
+
short: 'ai'
|
|
466
|
+
}, {
|
|
467
|
+
propName: 'justifyItems',
|
|
468
|
+
property: 'justify-items',
|
|
469
|
+
short: 'ji'
|
|
470
|
+
}],
|
|
471
|
+
variables: gridItemsAlignments,
|
|
472
|
+
variableChecker: function variableChecker(value) {
|
|
473
|
+
return gridItemsAlignments.includes(value);
|
|
474
|
+
}
|
|
475
|
+
},
|
|
476
|
+
gridContentPositionProps: {
|
|
477
|
+
props: [{
|
|
478
|
+
propName: 'alignContent',
|
|
479
|
+
property: 'align-content',
|
|
480
|
+
short: 'ac'
|
|
481
|
+
}, {
|
|
482
|
+
propName: 'justifyContent',
|
|
483
|
+
property: 'justify-content',
|
|
484
|
+
short: 'jc'
|
|
485
|
+
}],
|
|
486
|
+
variables: gridContentPositions,
|
|
487
|
+
variableChecker: function variableChecker(value) {
|
|
488
|
+
return gridContentPositions.includes(value);
|
|
489
|
+
}
|
|
426
490
|
}
|
|
427
491
|
};
|
|
428
492
|
export var propNameToShort = function propNameToShort(propName) {
|
package/package.json
CHANGED
package/es/components/arrange.js
DELETED
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import _styled from "@emotion/styled/base";
|
|
2
|
-
var _excluded = ["children", "gap", "columnGap", "rowGap", "alignItems", "justifyItems", "justifyContent", "alignContent", "columns", "rows", "autoFlow"];
|
|
3
|
-
|
|
4
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
5
|
-
|
|
6
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
7
|
-
|
|
8
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
9
|
-
|
|
10
|
-
import "core-js/modules/es.array.includes.js";
|
|
11
|
-
import "core-js/modules/es.string.includes.js";
|
|
12
|
-
import "core-js/modules/es.object.keys.js";
|
|
13
|
-
import "core-js/modules/es.array.concat.js";
|
|
14
|
-
import "core-js/modules/es.array.index-of.js";
|
|
15
|
-
import "core-js/modules/es.symbol.js";
|
|
16
|
-
import "core-js/modules/es.object.assign.js";
|
|
17
|
-
import { getResponsiveOneOf, getResponsiveSpace } from '../utilities';
|
|
18
|
-
import React, { forwardRef } from 'react';
|
|
19
|
-
import { types } from '../types';
|
|
20
|
-
import { Box } from './box';
|
|
21
|
-
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
22
|
-
var gridProps = {
|
|
23
|
-
gap: types.responsiveSpace,
|
|
24
|
-
columnGap: types.responsiveSpace,
|
|
25
|
-
rowGap: types.responsiveSpace,
|
|
26
|
-
columns: types.responsiveColumns,
|
|
27
|
-
rows: types.responsiveRows,
|
|
28
|
-
autoFlow: types.autoFlow,
|
|
29
|
-
alignItems: types.gridItemsAlignment,
|
|
30
|
-
justifyItems: types.gridItemsAlignment,
|
|
31
|
-
justifyContent: types.gridContentPosition,
|
|
32
|
-
alignContent: types.gridContentPosition
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
var Root = /*#__PURE__*/_styled(Box, process.env.NODE_ENV === "production" ? {
|
|
36
|
-
shouldForwardProp: function shouldForwardProp(prop) {
|
|
37
|
-
return !Object.keys(gridProps).includes(prop);
|
|
38
|
-
},
|
|
39
|
-
target: "e12ddjtg0"
|
|
40
|
-
} : {
|
|
41
|
-
shouldForwardProp: function shouldForwardProp(prop) {
|
|
42
|
-
return !Object.keys(gridProps).includes(prop);
|
|
43
|
-
},
|
|
44
|
-
target: "e12ddjtg0",
|
|
45
|
-
label: "Root"
|
|
46
|
-
})("display:grid;", function (_ref) {
|
|
47
|
-
var columns = _ref.columns,
|
|
48
|
-
autoFlow = _ref.autoFlow,
|
|
49
|
-
gap = _ref.gap,
|
|
50
|
-
columnGap = _ref.columnGap,
|
|
51
|
-
rowGap = _ref.rowGap,
|
|
52
|
-
rows = _ref.rows,
|
|
53
|
-
justifyItems = _ref.justifyItems,
|
|
54
|
-
alignItems = _ref.alignItems,
|
|
55
|
-
justifyContent = _ref.justifyContent,
|
|
56
|
-
alignContent = _ref.alignContent;
|
|
57
|
-
return "\n ".concat(!columns && getResponsiveOneOf('grid-auto-flow', autoFlow), ";\n ").concat(getResponsiveSpace('gap', gap), ";\n ").concat(getResponsiveSpace('column-gap', columnGap), ";\n ").concat(getResponsiveSpace('row-gap', rowGap), ";\n ").concat(getResponsiveOneOf('grid-template-columns', columns), ";\n ").concat(getResponsiveOneOf('grid-template-rows', rows), ";\n ").concat(getResponsiveOneOf('justify-items', justifyItems), ";\n ").concat(getResponsiveOneOf('align-items', alignItems), ";\n ").concat(getResponsiveOneOf('justify-content', justifyContent), ";\n ").concat(getResponsiveOneOf('align-content', alignContent), ";\n ");
|
|
58
|
-
}, ";" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb21wb25lbnRzL2FycmFuZ2UuanN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXFCRSIsImZpbGUiOiIuLi8uLi9zcmMvY29tcG9uZW50cy9hcnJhbmdlLmpzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGdldFJlc3BvbnNpdmVPbmVPZiwgZ2V0UmVzcG9uc2l2ZVNwYWNlIH0gZnJvbSAnLi4vdXRpbGl0aWVzJztcbmltcG9ydCBSZWFjdCwgeyBmb3J3YXJkUmVmIH0gZnJvbSAncmVhY3QnO1xuaW1wb3J0IHsgdHlwZXMgfSBmcm9tICcuLi90eXBlcyc7XG5pbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCc7XG5pbXBvcnQgeyBCb3ggfSBmcm9tICcuL2JveCc7XG5cbmNvbnN0IGdyaWRQcm9wcyA9IHtcbiAgZ2FwOiB0eXBlcy5yZXNwb25zaXZlU3BhY2UsXG4gIGNvbHVtbkdhcDogdHlwZXMucmVzcG9uc2l2Z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gICBqdXN0aWZ5SXRlbXM9e2p1c3RpZnlJdGVtc31cbiAgICAgIGp1c3RpZnlDb250ZW50PXtqdXN0aWZ5Q29udGVudH1cbiAgICAgIGFsaWduQ29udGVudD17YWxpZ25Db250ZW50fVxuICAgICAgY29sdW1ucz17Y29sdW1uc31cbiAgICAgIHJvd3M9e3Jvd3N9XG4gICAgICBhdXRvRmxvdz17YXV0b0Zsb3d9XG4gICAgICB7Li4ucHJvcHN9XG4gICAgPlxuICAgICAge2NoaWxkcmVufVxuICAgIDwvUm9vdD5cbiAgKSxcbik7XG5cbkFycmFuZ2UucHJvcFR5cGVzID0gZ3JpZFByb3BzO1xuIl19 */"));
|
|
59
|
-
|
|
60
|
-
export var Arrange = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
61
|
-
var children = _ref2.children,
|
|
62
|
-
gap = _ref2.gap,
|
|
63
|
-
columnGap = _ref2.columnGap,
|
|
64
|
-
rowGap = _ref2.rowGap,
|
|
65
|
-
_ref2$alignItems = _ref2.alignItems,
|
|
66
|
-
alignItems = _ref2$alignItems === void 0 ? 'center' : _ref2$alignItems,
|
|
67
|
-
justifyItems = _ref2.justifyItems,
|
|
68
|
-
_ref2$justifyContent = _ref2.justifyContent,
|
|
69
|
-
justifyContent = _ref2$justifyContent === void 0 ? 'start' : _ref2$justifyContent,
|
|
70
|
-
alignContent = _ref2.alignContent,
|
|
71
|
-
columns = _ref2.columns,
|
|
72
|
-
rows = _ref2.rows,
|
|
73
|
-
_ref2$autoFlow = _ref2.autoFlow,
|
|
74
|
-
autoFlow = _ref2$autoFlow === void 0 ? 'column' : _ref2$autoFlow,
|
|
75
|
-
props = _objectWithoutProperties(_ref2, _excluded);
|
|
76
|
-
|
|
77
|
-
return ___EmotionJSX(Root, _extends({
|
|
78
|
-
ref: ref,
|
|
79
|
-
gap: gap,
|
|
80
|
-
columnGap: columnGap,
|
|
81
|
-
rowGap: rowGap,
|
|
82
|
-
alignItems: alignItems,
|
|
83
|
-
justifyItems: justifyItems,
|
|
84
|
-
justifyContent: justifyContent,
|
|
85
|
-
alignContent: alignContent,
|
|
86
|
-
columns: columns,
|
|
87
|
-
rows: rows,
|
|
88
|
-
autoFlow: autoFlow
|
|
89
|
-
}, props), children);
|
|
90
|
-
});
|
|
91
|
-
Arrange.propTypes = gridProps;
|