@flodesk/grain 11.0.7 → 12.0.0-next.1
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,68 @@
|
|
|
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
|
+
};
|
package/es/styles/utilities.js
CHANGED
|
@@ -107,7 +107,7 @@ var spaceProps = styleConfig.spaceProps,
|
|
|
107
107
|
flexDirectionProps = styleConfig.flexDirectionProps,
|
|
108
108
|
flexWrapProps = styleConfig.flexWrapProps;
|
|
109
109
|
var classAndStyleDeclarationProps = [spaceProps, colorProps, shadowProps, radiusProps, transitionProps, sizeProps, borderColorProps, alignProps, flexWrapProps, autoFlowProps, itemAlignmentProps, contentPositionProps, flexDirectionProps, alignSelfProps];
|
|
110
|
-
var classDeclarationProps = [].concat(classAndStyleDeclarationProps, [positionProps, overflowProps, cursorProps,
|
|
110
|
+
var classDeclarationProps = [].concat(classAndStyleDeclarationProps, [positionProps, overflowProps, cursorProps, borderWidthProps, weightProps, textDisplayProps, borderSideProps, textTransformProps]);
|
|
111
111
|
var styleDeclarationProps = [].concat(classAndStyleDeclarationProps, [dimensionProps, aspectRatioProps, orderProps, flexProps, opacityProps, zIndexProps, letterSpacingProps, gridTemplateProps]);
|
|
112
112
|
var defaultBorder = "\n [class*=\"bd\"] {\n border-color: var(--grn-color-border);\n border-width: 1px;\n }\n";
|
|
113
113
|
var utilities = "\n ".concat(defaultBorder, "\n ").concat(generateUtilityClassDeclarations(classDeclarationProps), ";\n ").concat(generateStyleClassDeclarations(styleDeclarationProps), ";\n");
|