@elliemae/ds-grid 2.2.0-alpha.4 → 3.0.0-next.2

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.
@@ -1,171 +1,129 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __reExport = (target, module2, copyDefault, desc) => {
13
- if (module2 && typeof module2 === "object" || typeof module2 === "function") {
14
- for (let key of __getOwnPropNames(module2))
15
- if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
16
- __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
17
- }
18
- return target;
19
- };
20
- var __toESM = (module2, isNodeMode) => {
21
- return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
22
- };
23
- var __toCommonJS = /* @__PURE__ */ ((cache) => {
24
- return (module2, temp) => {
25
- return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
26
- };
27
- })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
28
- var styles_exports = {};
29
- __export(styles_exports, {
30
- manageCols: () => manageCols,
31
- manageRows: () => manageRows,
32
- manageSpan: () => manageSpan
33
- });
34
- var React = __toESM(require("react"));
35
- var import_ds_system = require("@elliemae/ds-system");
36
- const manageSpan = import_ds_system.css`
37
- ${({ isSpanParent, span, theme }) => {
38
- if (!isSpanParent)
39
- return "";
40
- if (typeof span === "object") {
41
- let data = "";
42
- Object.keys(theme.media).forEach((key) => {
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var _taggedTemplateLiteral = require('@babel/runtime/helpers/taggedTemplateLiteral');
6
+ require('core-js/modules/esnext.async-iterator.for-each.js');
7
+ require('core-js/modules/esnext.iterator.constructor.js');
8
+ require('core-js/modules/esnext.iterator.for-each.js');
9
+ require('core-js/modules/esnext.async-iterator.map.js');
10
+ require('core-js/modules/esnext.iterator.map.js');
11
+ var dsSystem = require('@elliemae/ds-system');
12
+
13
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
14
+
15
+ var _taggedTemplateLiteral__default = /*#__PURE__*/_interopDefaultLegacy(_taggedTemplateLiteral);
16
+
17
+ var _templateObject, _templateObject2, _templateObject3;
18
+ const manageSpan = dsSystem.css(_templateObject || (_templateObject = _taggedTemplateLiteral__default["default"](["\n ", "\n"])), _ref => {
19
+ let {
20
+ isSpanParent,
21
+ span,
22
+ theme
23
+ } = _ref;
24
+ if (!isSpanParent) return '';
25
+
26
+ if (typeof span === 'object') {
27
+ let data = '';
28
+ Object.keys(theme.media).forEach(key => {
43
29
  if (span[key] && theme.breakpoints[key]) {
44
- if (key === "small") {
45
- data += `
46
- -ms-grid-column: auto / span ${span[key]};
47
- grid-column: auto / span ${span[key]};
48
- `;
30
+ if (key === 'small') {
31
+ data += "\n -ms-grid-column: auto / span ".concat(span[key], ";\n grid-column: auto / span ").concat(span[key], ";\n ");
49
32
  } else {
50
- data += `@media (min-width: ${theme.breakpoints[key]}) {
51
- -ms-grid-column: auto / span ${span[key]};
52
- grid-column: auto / span ${span[key]};
53
- }`;
33
+ data += "@media (min-width: ".concat(theme.breakpoints[key], ") {\n -ms-grid-column: auto / span ").concat(span[key], ";\n grid-column: auto / span ").concat(span[key], ";\n }");
54
34
  }
55
35
  }
56
36
  });
57
37
  return data;
58
38
  }
59
- return `
60
- -ms-grid-column: auto / span ${span};
61
- grid-column: auto / span ${span};`;
62
- }}
63
- `;
64
- const manageCols = import_ds_system.css`
65
- ${({ cols, theme, isSpanParent }) => {
66
- if (typeof cols === "object" && !Array.isArray(cols)) {
67
- let data = "";
68
- Object.keys(theme.media).forEach((key) => {
39
+
40
+ return "\n -ms-grid-column: auto / span ".concat(span, ";\n grid-column: auto / span ").concat(span, ";");
41
+ });
42
+ const manageCols = dsSystem.css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral__default["default"](["\n ", "\n"])), _ref2 => {
43
+ let {
44
+ cols,
45
+ theme,
46
+ isSpanParent
47
+ } = _ref2;
48
+
49
+ if (typeof cols === 'object' && !Array.isArray(cols)) {
50
+ let data = '';
51
+ Object.keys(theme.media).forEach(key => {
69
52
  if (cols[key] && Array.isArray(cols[key])) {
70
- const mtg = (0, import_ds_system.mapTemplateGrid)(cols[key]).join(" ");
71
- const mtgs = (0, import_ds_system.mapTemplateGrid)(cols[key]).map((c) => `minmax(0, ${c})`).join(" ");
72
- if (key === "small") {
73
- data += `-ms-grid-columns: ${mtg || "minmax(0px, 1fr)"};
74
- grid-template-columns: ${mtg || "auto"};
75
- -ms-grid-columns: ${mtgs || "minmax(0px, 1fr)"};
76
- grid-template-columns: ${mtgs || "auto"};`;
53
+ const mtg = dsSystem.mapTemplateGrid(cols[key]).join(' ');
54
+ const mtgs = dsSystem.mapTemplateGrid(cols[key]).map(c => "minmax(0, ".concat(c, ")")).join(' ');
55
+
56
+ if (key === 'small') {
57
+ data += "-ms-grid-columns: ".concat(mtg || 'minmax(0px, 1fr)', ";\n grid-template-columns: ").concat(mtg || 'auto', ";\n -ms-grid-columns: ").concat(mtgs || 'minmax(0px, 1fr)', ";\n grid-template-columns: ").concat(mtgs || 'auto', ";");
77
58
  } else {
78
- data += `@media (min-width: ${theme.breakpoints[key]}) {
79
- -ms-grid-columns: ${mtg || "minmax(0px, 1fr)"};
80
- grid-template-columns: ${mtg || "auto"};
81
- -ms-grid-columns: ${mtgs || "minmax(0px, 1fr)"};
82
- grid-template-columns: ${mtgs || "auto"};
83
- }`;
59
+ data += "@media (min-width: ".concat(theme.breakpoints[key], ") {\n -ms-grid-columns: ").concat(mtg || 'minmax(0px, 1fr)', ";\n grid-template-columns: ").concat(mtg || 'auto', ";\n -ms-grid-columns: ").concat(mtgs || 'minmax(0px, 1fr)', ";\n grid-template-columns: ").concat(mtgs || 'auto', ";\n }");
84
60
  }
85
61
  } else if (isSpanParent) {
86
- if (key === "small") {
87
- data += `-ms-grid-columns: repeat(${cols[key]}, 1fr);
88
- grid-template-columns: repeat(${cols[key]}, 1fr);`;
62
+ if (key === 'small') {
63
+ data += "-ms-grid-columns: repeat(".concat(cols[key], ", 1fr);\n grid-template-columns: repeat(").concat(cols[key], ", 1fr);");
89
64
  } else {
90
- data += `@media (min-width: ${theme.breakpoints[key]}) {
91
- -ms-grid-columns: repeat(${cols[key]}, 1fr);
92
- grid-template-columns: repeat(${cols[key]}, 1fr);
93
- }`;
65
+ data += "@media (min-width: ".concat(theme.breakpoints[key], ") {\n -ms-grid-columns: repeat(").concat(cols[key], ", 1fr);\n grid-template-columns: repeat(").concat(cols[key], ", 1fr);\n }");
94
66
  }
95
67
  }
96
68
  });
97
69
  return data;
98
70
  }
71
+
99
72
  if (Array.isArray(cols)) {
100
- const mtg = (0, import_ds_system.mapTemplateGrid)(cols).join(" ");
101
- const mtgs = (0, import_ds_system.mapTemplateGrid)(cols).map((c) => `minmax(0, ${c})`).join(" ");
102
- return `
103
- -ms-grid-columns: ${mtg || "minmax(0px, 1fr)"};
104
- grid-template-columns: ${mtg || "auto"};
105
- -ms-grid-columns: ${mtgs || "minmax(0px, 1fr)"};
106
- grid-template-columns: ${mtgs || "auto"};
107
- `;
73
+ const mtg = dsSystem.mapTemplateGrid(cols).join(' ');
74
+ const mtgs = dsSystem.mapTemplateGrid(cols).map(c => "minmax(0, ".concat(c, ")")).join(' ');
75
+ return "\n -ms-grid-columns: ".concat(mtg || 'minmax(0px, 1fr)', ";\n grid-template-columns: ").concat(mtg || 'auto', ";\n -ms-grid-columns: ").concat(mtgs || 'minmax(0px, 1fr)', ";\n grid-template-columns: ").concat(mtgs || 'auto', ";\n ");
108
76
  }
77
+
109
78
  if (isSpanParent) {
110
- return `
111
- -ms-grid-columns: repeat(${cols}, 1fr);
112
- grid-template-columns: repeat(${cols}, 1fr);`;
79
+ return "\n -ms-grid-columns: repeat(".concat(cols, ", 1fr);\n grid-template-columns: repeat(").concat(cols, ", 1fr);");
113
80
  }
114
- return "";
115
- }}
116
- `;
117
- const manageRows = import_ds_system.css`
118
- ${({ rows, theme, isSpanParent }) => {
119
- if (typeof rows === "object" && !Array.isArray(rows)) {
120
- let data = "";
121
- Object.keys(theme.media).forEach((key) => {
81
+
82
+ return '';
83
+ });
84
+ const manageRows = dsSystem.css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral__default["default"](["\n ", "\n"])), _ref3 => {
85
+ let {
86
+ rows,
87
+ theme,
88
+ isSpanParent
89
+ } = _ref3;
90
+
91
+ if (typeof rows === 'object' && !Array.isArray(rows)) {
92
+ let data = '';
93
+ Object.keys(theme.media).forEach(key => {
122
94
  if (rows[key] && Array.isArray(rows[key])) {
123
- const mtg = (0, import_ds_system.mapTemplateGrid)(rows[key]).join(" ");
124
- const mtgs = (0, import_ds_system.mapTemplateGrid)(rows[key]).map((c) => `minmax(0, ${c})`).join(" ");
125
- if (key === "small") {
126
- data += `-ms-grid-rows: ${mtg || "minmax(0px, 1fr)"};
127
- grid-template-rows: ${mtg || "auto"};
128
- -ms-grid-rows: ${mtgs || "minmax(0px, 1fr)"};
129
- grid-template-rows: ${mtgs || "auto"};`;
95
+ const mtg = dsSystem.mapTemplateGrid(rows[key]).join(' ');
96
+ const mtgs = dsSystem.mapTemplateGrid(rows[key]).map(c => "minmax(0, ".concat(c, ")")).join(' ');
97
+
98
+ if (key === 'small') {
99
+ data += "-ms-grid-rows: ".concat(mtg || 'minmax(0px, 1fr)', ";\n grid-template-rows: ").concat(mtg || 'auto', ";\n -ms-grid-rows: ").concat(mtgs || 'minmax(0px, 1fr)', ";\n grid-template-rows: ").concat(mtgs || 'auto', ";");
130
100
  } else {
131
- data += `@media (min-width: ${theme.breakpoints[key]}) {
132
- -ms-grid-rows: ${mtg || "minmax(0px, 1fr)"};
133
- grid-template-rows: ${mtg || "auto"};
134
- -ms-grid-rows: ${mtgs || "minmax(0px, 1fr)"};
135
- grid-template-rows: ${mtgs || "auto"};
136
- }`;
101
+ data += "@media (min-width: ".concat(theme.breakpoints[key], ") {\n -ms-grid-rows: ").concat(mtg || 'minmax(0px, 1fr)', ";\n grid-template-rows: ").concat(mtg || 'auto', ";\n -ms-grid-rows: ").concat(mtgs || 'minmax(0px, 1fr)', ";\n grid-template-rows: ").concat(mtgs || 'auto', ";\n }");
137
102
  }
138
103
  } else if (isSpanParent) {
139
- if (key === "small") {
140
- data += `-ms-grid-rows: repeat(${rows[key]}, 1fr);
141
- grid-template-rows: repeat(${rows[key]}, 1fr);`;
104
+ if (key === 'small') {
105
+ data += "-ms-grid-rows: repeat(".concat(rows[key], ", 1fr);\n grid-template-rows: repeat(").concat(rows[key], ", 1fr);");
142
106
  } else {
143
- data += `@media (min-width: ${theme.breakpoints[key]}) {
144
- -ms-grid-rows: repeat(${rows[key]}, 1fr);
145
- grid-template-rows: repeat(${rows[key]}, 1fr);
146
- }`;
107
+ data += "@media (min-width: ".concat(theme.breakpoints[key], ") {\n -ms-grid-rows: repeat(").concat(rows[key], ", 1fr);\n grid-template-rows: repeat(").concat(rows[key], ", 1fr);\n }");
147
108
  }
148
109
  }
149
110
  });
150
111
  return data;
151
112
  }
113
+
152
114
  if (Array.isArray(rows)) {
153
- const mtg = (0, import_ds_system.mapTemplateGrid)(rows).join(" ");
154
- const mtgs = (0, import_ds_system.mapTemplateGrid)(rows).map((c) => `minmax(0, ${c})`).join(" ");
155
- return `
156
- -ms-grid-rows: ${mtg || "minmax(0px, 1fr)"};
157
- grid-template-rows: ${mtg || "auto"};
158
- -ms-grid-rows: ${mtgs || "minmax(0px, 1fr)"};
159
- grid-template-rows: ${mtgs || "auto"};
160
- `;
115
+ const mtg = dsSystem.mapTemplateGrid(rows).join(' ');
116
+ const mtgs = dsSystem.mapTemplateGrid(rows).map(c => "minmax(0, ".concat(c, ")")).join(' ');
117
+ return "\n -ms-grid-rows: ".concat(mtg || 'minmax(0px, 1fr)', ";\n grid-template-rows: ").concat(mtg || 'auto', ";\n -ms-grid-rows: ").concat(mtgs || 'minmax(0px, 1fr)', ";\n grid-template-rows: ").concat(mtgs || 'auto', ";\n ");
161
118
  }
119
+
162
120
  if (isSpanParent) {
163
- return `
164
- -ms-grid-rows: repeat(${rows}, 1fr);
165
- grid-template-rows: repeat(${rows}, 1fr);`;
121
+ return "\n -ms-grid-rows: repeat(".concat(rows, ", 1fr);\n grid-template-rows: repeat(").concat(rows, ", 1fr);");
166
122
  }
167
- return "";
168
- }}
169
- `;
170
- module.exports = __toCommonJS(styles_exports);
171
- //# sourceMappingURL=styles.js.map
123
+
124
+ return '';
125
+ });
126
+
127
+ exports.manageCols = manageCols;
128
+ exports.manageRows = manageRows;
129
+ exports.manageSpan = manageSpan;
package/esm/Grid.js CHANGED
@@ -1,52 +1,80 @@
1
- import * as React from "react";
2
- import React2 from "react";
3
- import { describe } from "react-desc";
4
- import { get } from "lodash";
5
- import { fixSpaceGutter } from "@elliemae/ds-system";
6
- import { propTypes } from "./propTypes";
7
- import { GridItem } from "./GridItem";
8
- import { defaultProps } from "./defaultProps";
9
- const Grid = React2.forwardRef((props, ref) => {
10
- const { rows, cols, alignItems, children, className, justify, gutter, wrap, width, height, ...rest } = props;
1
+ import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
2
+ import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
3
+ import 'core-js/modules/esnext.async-iterator.map.js';
4
+ import 'core-js/modules/esnext.iterator.map.js';
5
+ import 'core-js/modules/esnext.async-iterator.filter.js';
6
+ import 'core-js/modules/esnext.iterator.constructor.js';
7
+ import 'core-js/modules/esnext.iterator.filter.js';
8
+ import 'core-js/modules/esnext.async-iterator.for-each.js';
9
+ import 'core-js/modules/esnext.iterator.for-each.js';
10
+ import React from 'react';
11
+ import { describe } from 'react-desc';
12
+ import { get } from 'lodash';
13
+ import { fixSpaceGutter } from '@elliemae/ds-system';
14
+ import { propTypes } from './propTypes.js';
15
+ import { GridItem } from './GridItem.js';
16
+ import { defaultProps } from './defaultProps.js';
17
+ import { jsx } from 'react/jsx-runtime';
18
+
19
+ const _excluded = ["rows", "cols", "alignItems", "children", "className", "justify", "gutter", "wrap", "width", "height"];
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
+ const Grid = /*#__PURE__*/React.forwardRef((props, ref) => {
25
+ const {
26
+ rows,
27
+ cols,
28
+ alignItems,
29
+ children,
30
+ className,
31
+ justify,
32
+ gutter,
33
+ wrap,
34
+ width,
35
+ height
36
+ } = props,
37
+ rest = _objectWithoutProperties(props, _excluded);
38
+
11
39
  let isSpanParent = true;
12
- const renderChildren = React2.Children.map(children, (child) => {
13
- if (get(child, "child.type.name") === "Grid" || get(child, "type.displayName") === "Grid" || parseInt(get(child, "props.span", 0), 10) > 0) {
14
- const { width: wc, height: hc, span } = child.props;
15
- if (!span)
16
- isSpanParent = false;
17
- return React2.cloneElement(child, {
18
- ...child.props,
40
+ const renderChildren = React.Children.map(children, child => {
41
+ if (get(child, 'child.type.name') === 'Grid' || get(child, 'type.displayName') === 'Grid' || parseInt(get(child, 'props.span', 0), 10) > 0) {
42
+ const {
43
+ width: wc,
44
+ height: hc,
45
+ span
46
+ } = child.props;
47
+ if (!span) isSpanParent = false;
48
+ return /*#__PURE__*/React.cloneElement(child, _objectSpread(_objectSpread({}, child.props), {}, {
19
49
  width: fixSpaceGutter(wc),
20
50
  height: fixSpaceGutter(hc)
21
- });
51
+ }));
22
52
  }
53
+
23
54
  return child;
24
55
  });
25
- return /* @__PURE__ */ React2.createElement(GridItem, {
26
- alignItems,
27
- className,
28
- cols,
29
- gutter,
30
- isSpanParent,
31
- justify,
32
- rows,
33
- wrap,
34
- childNumber: React2.Children.count(children),
35
- ref,
56
+ return /*#__PURE__*/jsx(GridItem, _objectSpread(_objectSpread({
57
+ alignItems: alignItems,
58
+ className: className,
59
+ cols: cols,
60
+ gutter: gutter,
61
+ isSpanParent: isSpanParent,
62
+ justify: justify,
63
+ rows: rows,
64
+ wrap: wrap,
65
+ childNumber: React.Children.count(children),
66
+ ref: ref,
36
67
  w: width,
37
- h: height,
38
- ...rest
39
- }, renderChildren);
40
- });
41
- Grid.displayName = "Grid";
68
+ h: height
69
+ }, rest), {}, {
70
+ children: renderChildren
71
+ }));
72
+ }); // Since this component is using ForwardRef, we must provide a displayName to avoid 'undefined' name in propsTable.
73
+
74
+ Grid.displayName = 'Grid'; // We should use props helpers to merge default props in the future, right now it causes many issues within Dimsum
75
+
42
76
  Grid.defaultProps = defaultProps;
43
- Grid.propTypes = propTypes;
44
77
  const DSGridWithSchema = describe(Grid);
45
78
  DSGridWithSchema.propTypes = propTypes;
46
- var Grid_default = Grid;
47
- export {
48
- DSGridWithSchema,
49
- Grid,
50
- Grid_default as default
51
- };
52
- //# sourceMappingURL=Grid.js.map
79
+
80
+ export { DSGridWithSchema, Grid as default };
package/esm/GridItem.js CHANGED
@@ -1,24 +1,21 @@
1
- import * as React from "react";
2
- import styled from "styled-components";
3
- import { space, width, height, flexboxes, grids, sizing } from "@xstyled/styled-components";
4
- import { mapGap } from "@elliemae/ds-system";
5
- import { manageCols, manageRows, manageSpan } from "./utils/styles";
6
- const GridItem = styled.div`
7
- display: grid;
8
- display: -ms-grid;
9
- column-gap: ${({ gutter }) => mapGap(gutter)};
10
- row-gap: ${({ gutter }) => mapGap(gutter)};
11
- ${grids}
12
- ${flexboxes}
13
- ${sizing}
14
- ${space}
15
- ${height}
16
- ${width}
17
- ${manageCols}
18
- ${manageRows}
19
- ${manageSpan}
20
- `;
21
- export {
22
- GridItem
23
- };
24
- //# sourceMappingURL=GridItem.js.map
1
+ import styled from 'styled-components';
2
+ import { grids, flexboxes, sizing, space, height, width } from '@xstyled/styled-components';
3
+ import { mapGap } from '@elliemae/ds-system';
4
+ import { manageCols, manageRows, manageSpan } from './utils/styles.js';
5
+
6
+ /* eslint-disable max-lines */
7
+ const GridItem = /*#__PURE__*/styled.div.withConfig({
8
+ componentId: "sc-1ch24x4-0"
9
+ })(["display:grid;display:-ms-grid;column-gap:", ";row-gap:", ";", " ", " ", " ", " ", " ", " ", " ", " ", ""], _ref => {
10
+ let {
11
+ gutter
12
+ } = _ref;
13
+ return mapGap(gutter);
14
+ }, _ref2 => {
15
+ let {
16
+ gutter
17
+ } = _ref2;
18
+ return mapGap(gutter);
19
+ }, grids, flexboxes, sizing, space, height, width, manageCols, manageRows, manageSpan);
20
+
21
+ export { GridItem };
@@ -1,14 +1,11 @@
1
- import * as React from "react";
2
1
  const defaultProps = {
3
2
  rows: [],
4
3
  cols: [],
5
- className: "",
6
- justify: "flex-start",
4
+ className: '',
5
+ justify: 'flex-start',
7
6
  gutter: 0,
8
- wrap: "wrap",
7
+ wrap: 'wrap',
9
8
  span: 1
10
9
  };
11
- export {
12
- defaultProps
13
- };
14
- //# sourceMappingURL=defaultProps.js.map
10
+
11
+ export { defaultProps };
package/esm/index.js CHANGED
@@ -1,10 +1 @@
1
- import * as React from "react";
2
- import { default as default2, Grid, default as default3, default as default4, DSGridWithSchema } from "./Grid";
3
- export {
4
- DSGridWithSchema,
5
- Grid,
6
- default3 as GridContainer,
7
- default4 as GridItem,
8
- default2 as default
9
- };
10
- //# sourceMappingURL=index.js.map
1
+ export { DSGridWithSchema, default as Grid, default as GridContainer, default as GridItem, default } from './Grid.js';
package/esm/propTypes.js CHANGED
@@ -1,6 +1,6 @@
1
- import * as React from "react";
2
- import { PropTypes } from "react-desc";
3
- import { alignItemsPlacement, justifyPlacement, wrap } from "./utils/constants";
1
+ import { PropTypes } from 'react-desc';
2
+ import { alignItemsPlacement, justifyPlacement, wrap } from './utils/constants.js';
3
+
4
4
  const rowColBreakpoints = PropTypes.shape({
5
5
  small: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])),
6
6
  medium: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])),
@@ -12,39 +12,31 @@ const spanBreakpoints = PropTypes.shape({
12
12
  large: PropTypes.number
13
13
  });
14
14
  const propTypes = {
15
- rows: PropTypes.oneOfType([
16
- PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])),
17
- rowColBreakpoints
18
- ]).description("Row layout cells").defaultValue([]),
19
- cols: PropTypes.oneOfType([
20
- PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])),
21
- rowColBreakpoints
22
- ]).description("Column layout cells").defaultValue([]),
23
- span: PropTypes.oneOfType([PropTypes.number, spanBreakpoints]).description("Expands the grid element within columns."),
24
- alignItems: PropTypes.oneOf(alignItemsPlacement).description("flex-like align items prop"),
25
- children: PropTypes.node.description("Children node inside grid cell"),
26
- className: PropTypes.string.description("CSS class").defaultValue(""),
27
- justifyContent: PropTypes.oneOf(justifyPlacement).description("flex-like justify prop").defaultValue(justifyPlacement[0]),
28
- gutter: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description("Space between cells prop").defaultValue(0),
29
- wrap: PropTypes.oneOf(wrap).description("Wrap type").defaultValue(wrap[0]),
30
- height: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description("Grid height."),
31
- width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description("Grid width."),
32
- p: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description("Grid padding in all sides."),
33
- m: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description("Grid margin in all sides."),
34
- px: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description("Grid padding in left and right sides."),
35
- mx: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description("Grid margin in left and right sides."),
36
- py: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description("Grid padding in top and bottom sides."),
37
- my: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description("Grid margin in top and bottom sides."),
38
- ml: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description("Grid left margin."),
39
- mr: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description("Grid right margin"),
40
- mt: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description("Grid top margin"),
41
- mb: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description("Grid bottom margin"),
42
- pl: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description("Grid left padding."),
43
- pr: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description("Grid right padding"),
44
- pt: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description("Grid top padding"),
45
- pb: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description("Grid bottom padding")
15
+ rows: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])), rowColBreakpoints]).description('Row layout cells').defaultValue([]),
16
+ cols: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])), rowColBreakpoints]).description('Column layout cells').defaultValue([]),
17
+ span: PropTypes.oneOfType([PropTypes.number, spanBreakpoints]).description('Expands the grid element within columns.'),
18
+ alignItems: PropTypes.oneOf(alignItemsPlacement).description('flex-like align items prop'),
19
+ children: PropTypes.node.description('Children node inside grid cell'),
20
+ className: PropTypes.string.description('CSS class').defaultValue(''),
21
+ justifyContent: PropTypes.oneOf(justifyPlacement).description('flex-like justify prop').defaultValue(justifyPlacement[0]),
22
+ gutter: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description('Space between cells prop').defaultValue(0),
23
+ wrap: PropTypes.oneOf(wrap).description('Wrap type').defaultValue(wrap[0]),
24
+ height: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description('Grid height.'),
25
+ width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description('Grid width.'),
26
+ p: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description('Grid padding in all sides.'),
27
+ m: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description('Grid margin in all sides.'),
28
+ px: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description('Grid padding in left and right sides.'),
29
+ mx: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description('Grid margin in left and right sides.'),
30
+ py: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description('Grid padding in top and bottom sides.'),
31
+ my: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description('Grid margin in top and bottom sides.'),
32
+ ml: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description('Grid left margin.'),
33
+ mr: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description('Grid right margin'),
34
+ mt: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description('Grid top margin'),
35
+ mb: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description('Grid bottom margin'),
36
+ pl: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description('Grid left padding.'),
37
+ pr: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description('Grid right padding'),
38
+ pt: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description('Grid top padding'),
39
+ pb: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description('Grid bottom padding')
46
40
  };
47
- export {
48
- propTypes
49
- };
50
- //# sourceMappingURL=propTypes.js.map
41
+
42
+ export { propTypes };
package/esm/types.js CHANGED
@@ -1,2 +1 @@
1
- import * as React from "react";
2
- //# sourceMappingURL=types.js.map
1
+
@@ -1,17 +1,5 @@
1
- import * as React from "react";
2
- const justifyPlacement = [
3
- "flex-start",
4
- "center",
5
- "flex-end",
6
- "space-between",
7
- "space-around",
8
- "space-evenly"
9
- ];
10
- const alignItemsPlacement = ["flex-start", "center", "flex-end", "stretch", "baseline"];
11
- const wrap = ["wrap", "nowrap", "wrap-reverse"];
12
- export {
13
- alignItemsPlacement,
14
- justifyPlacement,
15
- wrap
16
- };
17
- //# sourceMappingURL=constants.js.map
1
+ const justifyPlacement = ['flex-start', 'center', 'flex-end', 'space-between', 'space-around', 'space-evenly'];
2
+ const alignItemsPlacement = ['flex-start', 'center', 'flex-end', 'stretch', 'baseline'];
3
+ const wrap = ['wrap', 'nowrap', 'wrap-reverse'];
4
+
5
+ export { alignItemsPlacement, justifyPlacement, wrap };