@flodesk/grain 11.0.3 → 11.0.5
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.
|
@@ -0,0 +1,43 @@
|
|
|
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.assign.js";
|
|
5
|
+
import _styled from "@emotion/styled/base";
|
|
6
|
+
var _excluded = ["children", "gap"];
|
|
7
|
+
|
|
8
|
+
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); }
|
|
9
|
+
|
|
10
|
+
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; }
|
|
11
|
+
|
|
12
|
+
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; }
|
|
13
|
+
|
|
14
|
+
import { getResponsiveSpace } from '../utilities';
|
|
15
|
+
import PropTypes from 'prop-types';
|
|
16
|
+
import React, { forwardRef } from 'react';
|
|
17
|
+
import { types } from '../types';
|
|
18
|
+
import { Box } from './box';
|
|
19
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
20
|
+
|
|
21
|
+
var Root = /*#__PURE__*/_styled(Box, process.env.NODE_ENV === "production" ? {
|
|
22
|
+
target: "e17bgatr0"
|
|
23
|
+
} : {
|
|
24
|
+
target: "e17bgatr0",
|
|
25
|
+
label: "Root"
|
|
26
|
+
})("&>*+*{", function (p) {
|
|
27
|
+
return getResponsiveSpace('margin-top', p.gap);
|
|
28
|
+
}, ";}" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb21wb25lbnRzL3N0YWNrLmpzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFPd0IiLCJmaWxlIjoiLi4vLi4vc3JjL2NvbXBvbmVudHMvc3RhY2suanN4Iiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgZ2V0UmVzcG9uc2l2ZVNwYWNlIH0gZnJvbSAnLi4vdXRpbGl0aWVzJztcbmltcG9ydCBQcm9wVHlwZXMgZnJvbSAncHJvcC10eXBlcyc7XG5pbXBvcnQgUmVhY3QsIHsgZm9yd2FyZFJlZiB9IGZyb20gJ3JlYWN0JztcbmltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJztcbmltcG9ydCB7IHR5cGVzIH0gZnJvbSAnLi4vdHlwZXMnO1xuaW1wb3J0IHsgQm94IH0gZnJvbSAnLi9ib3gnO1xuXG5jb25zdCBSb290ID0gc3R5bGVkKEJveClgXG4gICYgPiAqICsgKiB7XG4gICAgJHtwID0+IGdldFJlc3BvbnNpdmVTcGFjZSgnbWFyZ2luLXRvcCcsIHAuZ2FwKX07XG4gIH1cbmA7XG5cbmV4cG9ydCBjb25zdCBTdGFjayA9IGZvcndhcmRSZWYoKHsgY2hpbGRyZW4sIGdhcCwgLi4ucHJvcHMgfSwgcmVmKSA9PiAoXG4gIDxSb290IHJlZj17cmVmfSBnYXA9e2dhcH0gey4uLnByb3BzfT5cbiAgICB7Y2hpbGRyZW59XG4gIDwvUm9vdD5cbikpO1xuXG5TdGFjay5wcm9wVHlwZXMgPSB7XG4gIGNoaWxkcmVuOiBQcm9wVHlwZXMubm9kZSxcbiAgZ2FwOiB0eXBlcy5yZXNwb25zaXZlU3BhY2UsXG59O1xuIl19 */"));
|
|
29
|
+
|
|
30
|
+
export var Stack = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
31
|
+
var children = _ref.children,
|
|
32
|
+
gap = _ref.gap,
|
|
33
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
34
|
+
|
|
35
|
+
return ___EmotionJSX(Root, _extends({
|
|
36
|
+
ref: ref,
|
|
37
|
+
gap: gap
|
|
38
|
+
}, props), children);
|
|
39
|
+
});
|
|
40
|
+
Stack.propTypes = {
|
|
41
|
+
children: PropTypes.node,
|
|
42
|
+
gap: types.responsiveSpace
|
|
43
|
+
};
|
|
@@ -24,7 +24,11 @@ import "core-js/modules/es.array.slice.js";
|
|
|
24
24
|
import "core-js/modules/es.array.from.js";
|
|
25
25
|
import "core-js/modules/es.regexp.exec.js";
|
|
26
26
|
import { getCssVar, isNumber, isString, u, isObject } from '.';
|
|
27
|
-
import { vars, varInfo } from '../variables';
|
|
27
|
+
import { vars, varInfo, breakpoints } from '../variables';
|
|
28
|
+
var mediaQueries = {
|
|
29
|
+
mobile: "@media (max-width: ".concat(breakpoints.mobile, "px)"),
|
|
30
|
+
tablet: "@media (max-width: ".concat(breakpoints.tablet, "px)")
|
|
31
|
+
};
|
|
28
32
|
export var getMediaCss = function getMediaCss(mediaQuery, property, value) {
|
|
29
33
|
var getValue = function getValue(val) {
|
|
30
34
|
if (val === 0) return '0';
|
|
@@ -36,7 +40,11 @@ export var getMediaCss = function getMediaCss(mediaQuery, property, value) {
|
|
|
36
40
|
return "".concat(property, ": ").concat(getValue(value), ";");
|
|
37
41
|
}
|
|
38
42
|
|
|
39
|
-
|
|
43
|
+
if (mediaQuery in mediaQueries) {
|
|
44
|
+
return "\n ".concat(mediaQueries[mediaQuery], " {\n ").concat(property, ": ").concat(getValue(value), ";\n }\n ");
|
|
45
|
+
} else {
|
|
46
|
+
return "\n ".concat(mediaQuery, " {\n ").concat(property, ": ").concat(getValue(value), ";\n }\n ");
|
|
47
|
+
}
|
|
40
48
|
};
|
|
41
49
|
export var mapObjToMedia = function mapObjToMedia(property, obj, type) {
|
|
42
50
|
var checkValueInVars = function checkValueInVars(value) {
|
|
@@ -120,10 +120,6 @@ export var styleConfig = {
|
|
|
120
120
|
propName: 'columnGap',
|
|
121
121
|
property: 'column-gap',
|
|
122
122
|
short: 'cg'
|
|
123
|
-
}, {
|
|
124
|
-
propName: 'stackGap',
|
|
125
|
-
property: '--stackGap',
|
|
126
|
-
short: 'sg'
|
|
127
123
|
}],
|
|
128
124
|
valueTransformer: getSpace,
|
|
129
125
|
variableChecker: isSpaceVar,
|
package/package.json
CHANGED
|
@@ -1,68 +0,0 @@
|
|
|
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", "style", "className"];
|
|
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 PropTypes from 'prop-types';
|
|
32
|
-
import React, { forwardRef } from 'react';
|
|
33
|
-
import { types } from '../../types';
|
|
34
|
-
import { Box } from '../box';
|
|
35
|
-
import { generateAttributes } from '../../utilities';
|
|
36
|
-
import styles from './styles.module.css';
|
|
37
|
-
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
38
|
-
export var Stack = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
39
|
-
var children = _ref.children,
|
|
40
|
-
stackGap = _ref.gap,
|
|
41
|
-
style = _ref.style,
|
|
42
|
-
className = _ref.className,
|
|
43
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
44
|
-
|
|
45
|
-
var propClassName = className ? className : '';
|
|
46
|
-
var propStyle = style ? style : {};
|
|
47
|
-
var attributes = generateAttributes({
|
|
48
|
-
styleProps: {
|
|
49
|
-
stackGap: stackGap
|
|
50
|
-
},
|
|
51
|
-
classNameProps: {
|
|
52
|
-
stackGap: stackGap
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
var styleAttributes = _objectSpread(_objectSpread({}, attributes.styles), propStyle);
|
|
57
|
-
|
|
58
|
-
var classAttributes = "".concat(propClassName, " ").concat(attributes.classNames, " ").concat(styles.stack).trim().replace(/\s+/g, ' ');
|
|
59
|
-
return ___EmotionJSX(Box, _extends({
|
|
60
|
-
ref: ref,
|
|
61
|
-
style: styleAttributes,
|
|
62
|
-
className: classAttributes
|
|
63
|
-
}, props), children);
|
|
64
|
-
});
|
|
65
|
-
Stack.propTypes = {
|
|
66
|
-
children: PropTypes.node,
|
|
67
|
-
gap: types.responsiveSpace
|
|
68
|
-
};
|