@elliemae/ds-grid 3.0.0-next.9 → 3.0.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.
- package/dist/cjs/Grid.js +13 -19
- package/dist/cjs/Grid.js.map +2 -2
- package/dist/cjs/GridItem.js +17 -25
- package/dist/cjs/GridItem.js.map +2 -2
- package/dist/cjs/index.js +9 -16
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/react-desc-prop-types.js +56 -39
- package/dist/cjs/react-desc-prop-types.js.map +2 -2
- package/dist/cjs/types.js +9 -16
- package/dist/cjs/types.js.map +1 -1
- package/dist/cjs/utils/constants.js +11 -16
- package/dist/cjs/utils/constants.js.map +2 -2
- package/dist/cjs/utils/styles.js +9 -16
- package/dist/cjs/utils/styles.js.map +1 -1
- package/dist/esm/Grid.js +2 -1
- package/dist/esm/Grid.js.map +2 -2
- package/dist/esm/GridItem.js +4 -12
- package/dist/esm/GridItem.js.map +2 -2
- package/dist/esm/react-desc-prop-types.js +27 -3
- package/dist/esm/react-desc-prop-types.js.map +2 -2
- package/dist/esm/utils/constants.js +2 -0
- package/dist/esm/utils/constants.js.map +2 -2
- package/dist/esm/utils/styles.js.map +1 -1
- package/package.json +12 -12
package/dist/cjs/Grid.js
CHANGED
|
@@ -21,7 +21,6 @@ var __spreadValues = (a, b) => {
|
|
|
21
21
|
return a;
|
|
22
22
|
};
|
|
23
23
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
24
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
25
24
|
var __objRest = (source, exclude) => {
|
|
26
25
|
var target = {};
|
|
27
26
|
for (var prop in source)
|
|
@@ -38,38 +37,33 @@ var __export = (target, all) => {
|
|
|
38
37
|
for (var name in all)
|
|
39
38
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
40
39
|
};
|
|
41
|
-
var
|
|
42
|
-
if (
|
|
43
|
-
for (let key of __getOwnPropNames(
|
|
44
|
-
if (!__hasOwnProp.call(
|
|
45
|
-
__defProp(
|
|
40
|
+
var __copyProps = (to, from, except, desc) => {
|
|
41
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
42
|
+
for (let key of __getOwnPropNames(from))
|
|
43
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
44
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
46
45
|
}
|
|
47
|
-
return
|
|
48
|
-
};
|
|
49
|
-
var __toESM = (module2, isNodeMode) => {
|
|
50
|
-
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
46
|
+
return to;
|
|
51
47
|
};
|
|
52
|
-
var
|
|
53
|
-
|
|
54
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
55
|
-
};
|
|
56
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
48
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
49
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
57
50
|
var Grid_exports = {};
|
|
58
51
|
__export(Grid_exports, {
|
|
59
52
|
DSGridWithSchema: () => DSGridWithSchema,
|
|
60
53
|
Grid: () => Grid,
|
|
61
54
|
default: () => Grid_default
|
|
62
55
|
});
|
|
56
|
+
module.exports = __toCommonJS(Grid_exports);
|
|
63
57
|
var React = __toESM(require("react"));
|
|
64
58
|
var import_react = __toESM(require("react"));
|
|
65
|
-
var
|
|
59
|
+
var import_ds_utilities = require("@elliemae/ds-utilities");
|
|
66
60
|
var import_lodash = require("lodash");
|
|
67
61
|
var import_ds_system = require("@elliemae/ds-system");
|
|
68
62
|
var import_react_desc_prop_types = require("./react-desc-prop-types");
|
|
69
63
|
var import_GridItem = require("./GridItem");
|
|
70
64
|
const Grid = import_react.default.forwardRef((props, ref) => {
|
|
71
65
|
const _a = props, { children } = _a, propsWithoutChildren = __objRest(_a, ["children"]);
|
|
72
|
-
const propsWithDefaults = (0,
|
|
66
|
+
const propsWithDefaults = (0, import_ds_utilities.useMemoMergePropsWithDefault)(propsWithoutChildren, import_react_desc_prop_types.defaultProps);
|
|
73
67
|
const _b = propsWithDefaults, { rows, cols, alignItems, className, justify, gutter, wrap, width, height } = _b, rest = __objRest(_b, ["rows", "cols", "alignItems", "className", "justify", "gutter", "wrap", "width", "height"]);
|
|
74
68
|
let isSpanParent = true;
|
|
75
69
|
const renderChildren = import_react.default.Children.map(children, (child) => {
|
|
@@ -102,8 +96,8 @@ const Grid = import_react.default.forwardRef((props, ref) => {
|
|
|
102
96
|
});
|
|
103
97
|
Grid.displayName = "Grid";
|
|
104
98
|
Grid.propTypes = import_react_desc_prop_types.DSGridPropTypes;
|
|
105
|
-
|
|
99
|
+
Grid.displayName = "Grid";
|
|
100
|
+
const DSGridWithSchema = (0, import_ds_utilities.describe)(Grid);
|
|
106
101
|
DSGridWithSchema.propTypes = import_react_desc_prop_types.DSGridPropTypes;
|
|
107
102
|
var Grid_default = Grid;
|
|
108
|
-
module.exports = __toCommonJS(Grid_exports);
|
|
109
103
|
//# sourceMappingURL=Grid.js.map
|
package/dist/cjs/Grid.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Grid.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport { describe, useMemoMergePropsWithDefault } from '@elliemae/ds-
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { describe, useMemoMergePropsWithDefault } from '@elliemae/ds-utilities';\nimport { get } from 'lodash';\nimport { fixSpaceGutter } from '@elliemae/ds-system';\nimport { DSGridT, DSGridPropTypes, defaultProps } from './react-desc-prop-types';\nimport { GridItem } from './GridItem';\n\nconst Grid = React.forwardRef<HTMLDivElement, DSGridT.Props>((props, ref) => {\n const { children, ...propsWithoutChildren } = props;\n const propsWithDefaults = useMemoMergePropsWithDefault(propsWithoutChildren, defaultProps);\n\n const { rows, cols, alignItems, className, justify, gutter, wrap, width, height, ...rest } = propsWithDefaults;\n\n let isSpanParent = true;\n\n const renderChildren = React.Children.map(children, (child: React.ReactNode) => {\n if (\n get(child, 'child.type.name') === 'Grid' ||\n get(child, 'type.displayName') === 'Grid' ||\n parseInt(get(child, 'props.span', 0) as string, 10) > 0\n ) {\n const { width: wc, height: hc, span } = (child as React.ReactElement).props as Required<DSGridT.Props>;\n if (!span) isSpanParent = false;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n return React.cloneElement(child as React.ReactElement, {\n ...(child as React.ReactElement).props,\n width: fixSpaceGutter(wc),\n height: fixSpaceGutter(hc),\n });\n }\n return child;\n });\n\n return (\n <GridItem\n alignItems={alignItems}\n className={className}\n cols={cols}\n gutter={gutter}\n isSpanParent={isSpanParent}\n justify={justify}\n rows={rows}\n wrap={wrap}\n childNumber={React.Children.count(children)}\n ref={ref}\n {...rest}\n w={width}\n h={height}\n >\n {renderChildren}\n </GridItem>\n );\n});\n\n// Since this component is using ForwardRef, we must provide a displayName to avoid 'undefined' name in propsTable.\nGrid.displayName = 'Grid';\n\nGrid.propTypes = DSGridPropTypes;\nGrid.displayName = 'Grid';\nconst DSGridWithSchema = describe(Grid);\nDSGridWithSchema.propTypes = DSGridPropTypes;\n\nexport default Grid;\nexport { DSGridWithSchema, Grid };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,MAAM,mBAAmB,kCAAS,IAAI;AACtC,iBAAiB,YAAY;AAE7B,IAAO,eAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/GridItem.js
CHANGED
|
@@ -4,50 +4,42 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
7
|
var __export = (target, all) => {
|
|
9
8
|
for (var name in all)
|
|
10
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
10
|
};
|
|
12
|
-
var
|
|
13
|
-
if (
|
|
14
|
-
for (let key of __getOwnPropNames(
|
|
15
|
-
if (!__hasOwnProp.call(
|
|
16
|
-
__defProp(
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
16
|
}
|
|
18
|
-
return
|
|
17
|
+
return to;
|
|
19
18
|
};
|
|
20
|
-
var __toESM = (
|
|
21
|
-
|
|
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);
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
21
|
var GridItem_exports = {};
|
|
29
22
|
__export(GridItem_exports, {
|
|
30
23
|
GridItem: () => GridItem
|
|
31
24
|
});
|
|
25
|
+
module.exports = __toCommonJS(GridItem_exports);
|
|
32
26
|
var React = __toESM(require("react"));
|
|
33
|
-
var import_styled_components = __toESM(require("styled-components"));
|
|
34
|
-
var import_styled_components2 = require("@xstyled/styled-components");
|
|
35
27
|
var import_ds_system = require("@elliemae/ds-system");
|
|
36
28
|
var import_styles = require("./utils/styles");
|
|
37
|
-
const GridItem =
|
|
29
|
+
const GridItem = import_ds_system.styled.div`
|
|
38
30
|
display: grid;
|
|
39
31
|
display: -ms-grid;
|
|
40
32
|
column-gap: ${({ gutter }) => (0, import_ds_system.mapGap)(gutter)};
|
|
41
33
|
row-gap: ${({ gutter }) => (0, import_ds_system.mapGap)(gutter)};
|
|
42
|
-
${
|
|
43
|
-
${
|
|
44
|
-
${
|
|
45
|
-
${
|
|
46
|
-
${import_styled_components2.height}
|
|
47
|
-
${import_styled_components2.width}
|
|
34
|
+
${import_ds_system.grids}
|
|
35
|
+
${import_ds_system.flexboxes}
|
|
36
|
+
${import_ds_system.sizing}
|
|
37
|
+
${import_ds_system.space}
|
|
48
38
|
${import_styles.manageCols}
|
|
49
39
|
${import_styles.manageRows}
|
|
50
40
|
${import_styles.manageSpan}
|
|
41
|
+
${import_ds_system.boxShadows}
|
|
42
|
+
${import_ds_system.borders}
|
|
43
|
+
${import_ds_system.background}
|
|
51
44
|
`;
|
|
52
|
-
module.exports = __toCommonJS(GridItem_exports);
|
|
53
45
|
//# sourceMappingURL=GridItem.js.map
|
package/dist/cjs/GridItem.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/GridItem.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable max-lines */\n/* eslint-disable complexity */\nimport
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["/* eslint-disable max-lines */\n/* eslint-disable complexity */\nimport { LayoutProps, SpaceProps, SizingProps } from '@xstyled/styled-components';\nimport { styled, mapGap, background, borders, sizing, space, boxShadows, flexboxes, grids } from '@elliemae/ds-system';\nimport { manageCols, manageRows, manageSpan } from './utils/styles';\nimport { DSGridT } from './react-desc-prop-types';\n\nexport const GridItem = styled.div<DSGridT.ItemProps & LayoutProps & SpaceProps & SizingProps>`\n display: grid;\n display: -ms-grid;\n column-gap: ${({ gutter }) => mapGap(gutter)};\n row-gap: ${({ gutter }) => mapGap(gutter)};\n ${grids}\n ${flexboxes}\n ${sizing}\n ${space}\n ${manageCols}\n ${manageRows}\n ${manageSpan}\n ${boxShadows}\n ${borders}\n ${background}\n`;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,uBAAiG;AACjG,oBAAmD;AAG5C,MAAM,WAAW,wBAAO;AAAA;AAAA;AAAA,gBAGf,CAAC,EAAE,aAAa,6BAAO,MAAM;AAAA,aAChC,CAAC,EAAE,aAAa,6BAAO,MAAM;AAAA,IACtC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/index.js
CHANGED
|
@@ -4,27 +4,20 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
7
|
var __export = (target, all) => {
|
|
9
8
|
for (var name in all)
|
|
10
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
10
|
};
|
|
12
|
-
var
|
|
13
|
-
if (
|
|
14
|
-
for (let key of __getOwnPropNames(
|
|
15
|
-
if (!__hasOwnProp.call(
|
|
16
|
-
__defProp(
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
16
|
}
|
|
18
|
-
return
|
|
17
|
+
return to;
|
|
19
18
|
};
|
|
20
|
-
var __toESM = (
|
|
21
|
-
|
|
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);
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
21
|
var src_exports = {};
|
|
29
22
|
__export(src_exports, {
|
|
30
23
|
DSGridWithSchema: () => import_Grid.DSGridWithSchema,
|
|
@@ -33,7 +26,7 @@ __export(src_exports, {
|
|
|
33
26
|
GridItem: () => import_Grid.default,
|
|
34
27
|
default: () => import_Grid.default
|
|
35
28
|
});
|
|
29
|
+
module.exports = __toCommonJS(src_exports);
|
|
36
30
|
var React = __toESM(require("react"));
|
|
37
31
|
var import_Grid = __toESM(require("./Grid"));
|
|
38
|
-
module.exports = __toCommonJS(src_exports);
|
|
39
32
|
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["export { default, Grid, default as GridContainer, default as GridItem, DSGridWithSchema } from './Grid';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,kBAA+F;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -21,34 +21,28 @@ var __spreadValues = (a, b) => {
|
|
|
21
21
|
return a;
|
|
22
22
|
};
|
|
23
23
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
24
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
25
24
|
var __export = (target, all) => {
|
|
26
25
|
for (var name in all)
|
|
27
26
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
28
27
|
};
|
|
29
|
-
var
|
|
30
|
-
if (
|
|
31
|
-
for (let key of __getOwnPropNames(
|
|
32
|
-
if (!__hasOwnProp.call(
|
|
33
|
-
__defProp(
|
|
28
|
+
var __copyProps = (to, from, except, desc) => {
|
|
29
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
30
|
+
for (let key of __getOwnPropNames(from))
|
|
31
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
32
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
34
33
|
}
|
|
35
|
-
return
|
|
34
|
+
return to;
|
|
36
35
|
};
|
|
37
|
-
var __toESM = (
|
|
38
|
-
|
|
39
|
-
};
|
|
40
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
41
|
-
return (module2, temp) => {
|
|
42
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
43
|
-
};
|
|
44
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
36
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
37
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
45
38
|
var react_desc_prop_types_exports = {};
|
|
46
39
|
__export(react_desc_prop_types_exports, {
|
|
47
40
|
DSGridPropTypes: () => DSGridPropTypes,
|
|
48
41
|
defaultProps: () => defaultProps
|
|
49
42
|
});
|
|
43
|
+
module.exports = __toCommonJS(react_desc_prop_types_exports);
|
|
50
44
|
var React = __toESM(require("react"));
|
|
51
|
-
var
|
|
45
|
+
var import_ds_utilities = require("@elliemae/ds-utilities");
|
|
52
46
|
var import_constants = require("./utils/constants");
|
|
53
47
|
const defaultProps = {
|
|
54
48
|
rows: [],
|
|
@@ -59,34 +53,57 @@ const defaultProps = {
|
|
|
59
53
|
wrap: "wrap",
|
|
60
54
|
span: 1
|
|
61
55
|
};
|
|
62
|
-
const rowColBreakpoints =
|
|
63
|
-
small:
|
|
64
|
-
medium:
|
|
65
|
-
large:
|
|
56
|
+
const rowColBreakpoints = import_ds_utilities.PropTypes.shape({
|
|
57
|
+
small: import_ds_utilities.PropTypes.arrayOf(import_ds_utilities.PropTypes.oneOfType([import_ds_utilities.PropTypes.number, import_ds_utilities.PropTypes.string])),
|
|
58
|
+
medium: import_ds_utilities.PropTypes.arrayOf(import_ds_utilities.PropTypes.oneOfType([import_ds_utilities.PropTypes.number, import_ds_utilities.PropTypes.string])),
|
|
59
|
+
large: import_ds_utilities.PropTypes.arrayOf(import_ds_utilities.PropTypes.oneOfType([import_ds_utilities.PropTypes.number, import_ds_utilities.PropTypes.string]))
|
|
66
60
|
});
|
|
67
|
-
const spanBreakpoints =
|
|
68
|
-
small:
|
|
69
|
-
medium:
|
|
70
|
-
large:
|
|
61
|
+
const spanBreakpoints = import_ds_utilities.PropTypes.shape({
|
|
62
|
+
small: import_ds_utilities.PropTypes.number,
|
|
63
|
+
medium: import_ds_utilities.PropTypes.number,
|
|
64
|
+
large: import_ds_utilities.PropTypes.number
|
|
71
65
|
});
|
|
72
|
-
const DSGridPropTypes = __spreadProps(__spreadValues(__spreadValues({},
|
|
73
|
-
rows:
|
|
74
|
-
|
|
66
|
+
const DSGridPropTypes = __spreadProps(__spreadValues(__spreadValues({}, import_ds_utilities.globalAttributesPropTypes), import_ds_utilities.xstyledPropTypes), {
|
|
67
|
+
rows: import_ds_utilities.PropTypes.oneOfType([
|
|
68
|
+
import_ds_utilities.PropTypes.arrayOf(import_ds_utilities.PropTypes.oneOfType([import_ds_utilities.PropTypes.number, import_ds_utilities.PropTypes.string])),
|
|
75
69
|
rowColBreakpoints
|
|
76
70
|
]).description("Row layout cells").defaultValue([]),
|
|
77
|
-
cols:
|
|
78
|
-
|
|
71
|
+
cols: import_ds_utilities.PropTypes.oneOfType([
|
|
72
|
+
import_ds_utilities.PropTypes.arrayOf(import_ds_utilities.PropTypes.oneOfType([import_ds_utilities.PropTypes.number, import_ds_utilities.PropTypes.string])),
|
|
79
73
|
rowColBreakpoints
|
|
80
74
|
]).description("Column layout cells").defaultValue([]),
|
|
81
|
-
span:
|
|
82
|
-
alignItems:
|
|
83
|
-
children:
|
|
84
|
-
className:
|
|
85
|
-
justifyContent:
|
|
86
|
-
gutter:
|
|
87
|
-
wrap:
|
|
88
|
-
height:
|
|
89
|
-
width:
|
|
75
|
+
span: import_ds_utilities.PropTypes.oneOfType([import_ds_utilities.PropTypes.number, spanBreakpoints]).description("Expands the grid element within columns."),
|
|
76
|
+
alignItems: import_ds_utilities.PropTypes.oneOf(import_constants.alignItemsPlacement).description("flex-like align items prop"),
|
|
77
|
+
children: import_ds_utilities.PropTypes.node.description("Children node inside grid cell"),
|
|
78
|
+
className: import_ds_utilities.PropTypes.string.description("CSS class").defaultValue(""),
|
|
79
|
+
justifyContent: import_ds_utilities.PropTypes.oneOf(import_constants.justifyPlacement).description("flex-like justify prop").defaultValue(import_constants.justifyPlacement[0]),
|
|
80
|
+
gutter: import_ds_utilities.PropTypes.oneOfType([import_ds_utilities.PropTypes.number, import_ds_utilities.PropTypes.string]).description("Space between cells prop").defaultValue(0),
|
|
81
|
+
wrap: import_ds_utilities.PropTypes.oneOf(import_constants.wrap).description("Wrap type").defaultValue(import_constants.wrap[0]),
|
|
82
|
+
height: import_ds_utilities.PropTypes.oneOfType([import_ds_utilities.PropTypes.number, import_ds_utilities.PropTypes.string]).description("Grid height."),
|
|
83
|
+
width: import_ds_utilities.PropTypes.oneOfType([import_ds_utilities.PropTypes.number, import_ds_utilities.PropTypes.string]).description("Grid width."),
|
|
84
|
+
backgroundColor: import_ds_utilities.PropTypes.string.description("Sets background color."),
|
|
85
|
+
bg: import_ds_utilities.PropTypes.string.description("Sets background color."),
|
|
86
|
+
boxShadow: import_ds_utilities.PropTypes.oneOf(import_constants.boxShadow).description("Sets background color."),
|
|
87
|
+
border: import_ds_utilities.PropTypes.string.description("Sets border."),
|
|
88
|
+
borderRadius: import_ds_utilities.PropTypes.string.description("Sets border radius."),
|
|
89
|
+
borderWidth: import_ds_utilities.PropTypes.string.description("Sets border width."),
|
|
90
|
+
borderStyle: import_ds_utilities.PropTypes.string.description("Sets border style."),
|
|
91
|
+
borderColor: import_ds_utilities.PropTypes.string.description("Sets border color."),
|
|
92
|
+
borderTop: import_ds_utilities.PropTypes.string.description("Sets top border."),
|
|
93
|
+
borderBottom: import_ds_utilities.PropTypes.string.description("Sets bottom border."),
|
|
94
|
+
borderLeft: import_ds_utilities.PropTypes.string.description("Sets left border."),
|
|
95
|
+
borderRight: import_ds_utilities.PropTypes.string.description("Sets right border."),
|
|
96
|
+
borderTopWidth: import_ds_utilities.PropTypes.string.description("Sets border top width."),
|
|
97
|
+
borderTopStyle: import_ds_utilities.PropTypes.string.description("Sets border top style."),
|
|
98
|
+
borderTopColor: import_ds_utilities.PropTypes.string.description("Sets border top color."),
|
|
99
|
+
borderBottomWidth: import_ds_utilities.PropTypes.string.description("Sets border bottom width."),
|
|
100
|
+
borderBottomStyle: import_ds_utilities.PropTypes.string.description("Sets border bottom style."),
|
|
101
|
+
borderBottomColor: import_ds_utilities.PropTypes.string.description("Sets border bottom color."),
|
|
102
|
+
borderRightWidth: import_ds_utilities.PropTypes.string.description("Sets border right width."),
|
|
103
|
+
borderRightStyle: import_ds_utilities.PropTypes.string.description("Sets border right style."),
|
|
104
|
+
borderRightColor: import_ds_utilities.PropTypes.string.description("Sets border right color."),
|
|
105
|
+
borderLeftWidth: import_ds_utilities.PropTypes.string.description("Sets border left width."),
|
|
106
|
+
borderLeftStyle: import_ds_utilities.PropTypes.string.description("Sets border left style."),
|
|
107
|
+
borderLeftColor: import_ds_utilities.PropTypes.string.description("Sets border left color.")
|
|
90
108
|
});
|
|
91
|
-
module.exports = __toCommonJS(react_desc_prop_types_exports);
|
|
92
109
|
//# sourceMappingURL=react-desc-prop-types.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/react-desc-prop-types.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React, { WeakValidationMap } from 'react';\nimport {\n PropTypes,\n globalAttributesPropTypes,\n xstyledPropTypes,\n GlobalAttributesT,\n XstyledProps,\n} from '@elliemae/ds-
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import React, { WeakValidationMap } from 'react';\nimport {\n PropTypes,\n globalAttributesPropTypes,\n xstyledPropTypes,\n GlobalAttributesT,\n XstyledProps,\n} from '@elliemae/ds-utilities';\nimport { alignItemsPlacement, justifyPlacement, wrap, boxShadow } from './utils/constants';\n\nexport declare namespace DSGridT {\n interface RowColBreakpoints {\n small?: string | number[];\n medium?: string | number[];\n large?: string | number[];\n }\n\n type Shadow = 'xs' | 's' | 'm' | 'l' | 'xs';\n\n interface SpanBreakpoints {\n small?: number;\n medium?: number;\n large?: number;\n }\n\n interface IProps {\n height?: string;\n width?: string;\n rows?: string[] | string | number[] | RowColBreakpoints;\n cols?: string[] | string | number[] | RowColBreakpoints;\n justifyContent?: typeof justifyPlacement[number];\n alignItems?: typeof alignItemsPlacement[number];\n children?: React.ReactNode;\n className?: string;\n justify?: typeof justifyPlacement[number];\n gutter?: string | number;\n wrap?: typeof wrap[number];\n span?: number;\n }\n\n export interface Props extends IProps, Omit<GlobalAttributesT<HTMLDivElement>, keyof IProps>, XstyledProps {}\n\n export interface ItemProps {\n rows: string[] | string | number[] | RowColBreakpoints;\n cols: string[] | string | number[] | RowColBreakpoints;\n alignItems: typeof alignItemsPlacement[number];\n children: React.ReactNode;\n className: string;\n justify: typeof justifyPlacement[number];\n gutter: string | number;\n wrap: typeof wrap[number];\n childNumber: number;\n isSpanParent: boolean;\n span?: number | SpanBreakpoints;\n ref: React.ForwardedRef<HTMLDivElement>;\n boxShadow?: Shadow;\n backgroundColor?: string;\n bg?: string;\n }\n}\n\nexport const defaultProps = {\n rows: [],\n cols: [],\n className: '',\n justify: 'flex-start',\n gutter: 0,\n wrap: 'wrap',\n span: 1,\n};\n\n// =============================================================================\n// PropTypes\n// =============================================================================\nconst rowColBreakpoints = PropTypes.shape({\n small: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])),\n medium: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])),\n large: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])),\n});\n\nconst spanBreakpoints = PropTypes.shape({\n small: PropTypes.number,\n medium: PropTypes.number,\n large: PropTypes.number,\n});\n\nexport const DSGridPropTypes = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n rows: PropTypes.oneOfType([\n PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])),\n rowColBreakpoints,\n ])\n .description('Row layout cells')\n .defaultValue([]),\n cols: PropTypes.oneOfType([\n PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])),\n rowColBreakpoints,\n ])\n .description('Column layout cells')\n .defaultValue([]),\n span: PropTypes.oneOfType([PropTypes.number, spanBreakpoints]).description(\n 'Expands the grid element within columns.',\n ),\n alignItems: PropTypes.oneOf(alignItemsPlacement).description('flex-like align items prop'),\n children: PropTypes.node.description('Children node inside grid cell'),\n className: PropTypes.string.description('CSS class').defaultValue(''),\n justifyContent: PropTypes.oneOf(justifyPlacement)\n .description('flex-like justify prop')\n .defaultValue(justifyPlacement[0]),\n gutter: PropTypes.oneOfType([PropTypes.number, PropTypes.string])\n .description('Space between cells prop')\n .defaultValue(0),\n wrap: PropTypes.oneOf(wrap).description('Wrap type').defaultValue(wrap[0]),\n height: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description('Grid height.'),\n width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description('Grid width.'),\n backgroundColor: PropTypes.string.description('Sets background color.'),\n bg: PropTypes.string.description('Sets background color.'),\n boxShadow: PropTypes.oneOf(boxShadow).description('Sets background color.'),\n border: PropTypes.string.description('Sets border.'),\n borderRadius: PropTypes.string.description('Sets border radius.'),\n borderWidth: PropTypes.string.description('Sets border width.'),\n borderStyle: PropTypes.string.description('Sets border style.'),\n borderColor: PropTypes.string.description('Sets border color.'),\n borderTop: PropTypes.string.description('Sets top border.'),\n borderBottom: PropTypes.string.description('Sets bottom border.'),\n borderLeft: PropTypes.string.description('Sets left border.'),\n borderRight: PropTypes.string.description('Sets right border.'),\n borderTopWidth: PropTypes.string.description('Sets border top width.'),\n borderTopStyle: PropTypes.string.description('Sets border top style.'),\n borderTopColor: PropTypes.string.description('Sets border top color.'),\n borderBottomWidth: PropTypes.string.description('Sets border bottom width.'),\n borderBottomStyle: PropTypes.string.description('Sets border bottom style.'),\n borderBottomColor: PropTypes.string.description('Sets border bottom color.'),\n borderRightWidth: PropTypes.string.description('Sets border right width.'),\n borderRightStyle: PropTypes.string.description('Sets border right style.'),\n borderRightColor: PropTypes.string.description('Sets border right color.'),\n borderLeftWidth: PropTypes.string.description('Sets border left width.'),\n borderLeftStyle: PropTypes.string.description('Sets border left style.'),\n borderLeftColor: PropTypes.string.description('Sets border left color.'),\n} as WeakValidationMap<unknown>;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,0BAMO;AACP,uBAAuE;AAqDhE,MAAM,eAAe;AAAA,EAC1B,MAAM,CAAC;AAAA,EACP,MAAM,CAAC;AAAA,EACP,WAAW;AAAA,EACX,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,MAAM;AACR;AAKA,MAAM,oBAAoB,8BAAU,MAAM;AAAA,EACxC,OAAO,8BAAU,QAAQ,8BAAU,UAAU,CAAC,8BAAU,QAAQ,8BAAU,MAAM,CAAC,CAAC;AAAA,EAClF,QAAQ,8BAAU,QAAQ,8BAAU,UAAU,CAAC,8BAAU,QAAQ,8BAAU,MAAM,CAAC,CAAC;AAAA,EACnF,OAAO,8BAAU,QAAQ,8BAAU,UAAU,CAAC,8BAAU,QAAQ,8BAAU,MAAM,CAAC,CAAC;AACpF,CAAC;AAED,MAAM,kBAAkB,8BAAU,MAAM;AAAA,EACtC,OAAO,8BAAU;AAAA,EACjB,QAAQ,8BAAU;AAAA,EAClB,OAAO,8BAAU;AACnB,CAAC;A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|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
7
|
+
var __copyProps = (to, from, except, desc) => {
|
|
8
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
9
|
+
for (let key of __getOwnPropNames(from))
|
|
10
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
11
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
12
|
}
|
|
14
|
-
return
|
|
13
|
+
return to;
|
|
15
14
|
};
|
|
16
|
-
var __toESM = (
|
|
17
|
-
|
|
18
|
-
};
|
|
19
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
20
|
-
return (module2, temp) => {
|
|
21
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
22
|
-
};
|
|
23
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
15
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
16
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
24
17
|
var types_exports = {};
|
|
25
|
-
var React = __toESM(require("react"));
|
|
26
18
|
module.exports = __toCommonJS(types_exports);
|
|
19
|
+
var React = __toESM(require("react"));
|
|
27
20
|
//# sourceMappingURL=types.js.map
|
package/dist/cjs/types.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/types.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import { alignItemsPlacement, justifyPlacement, wrap } from './utils/constants';\n\ninterface RowColBreakpoints {\n small?: string | number[];\n medium?: string | number[];\n large?: string | number[];\n}\n\ninterface SpanBreakpoints {\n small?: number;\n medium?: number;\n large?: number;\n}\n\nexport interface GridPropsT {\n height?: string;\n width?: string;\n rows?: string[] | string | number[] | RowColBreakpoints;\n cols?: string[] | string | number[] | RowColBreakpoints;\n justifyContent?: typeof justifyPlacement[number];\n alignItems?: typeof alignItemsPlacement[number];\n children?: React.ReactNode;\n className?: string;\n justify?: typeof justifyPlacement[number];\n gutter?: string | number;\n wrap?: typeof wrap[number];\n span?: number;\n p?: string | number;\n m?: string | number;\n px?: string | number;\n mx?: string | number;\n py?: string | number;\n my?: string | number;\n ml?: string | number;\n mr?: string | number;\n mt?: string | number;\n mb?: string | number;\n pl?: string | number;\n pr?: string | number;\n pt?: string | number;\n pb?: string | number;\n}\n\nexport interface GridPropsWithDefaultT {\n rows: string | number[] | RowColBreakpoints;\n cols: string | number[] | RowColBreakpoints;\n alignItems: typeof alignItemsPlacement[number];\n children?: React.ReactNode;\n className: string;\n justify: typeof justifyPlacement[number];\n gutter: string | number;\n wrap: typeof wrap[number];\n span: number | SpanBreakpoints;\n}\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;AAAA;AAAA;ACAA,YAAuB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -4,36 +4,31 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
7
|
var __export = (target, all) => {
|
|
9
8
|
for (var name in all)
|
|
10
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
10
|
};
|
|
12
|
-
var
|
|
13
|
-
if (
|
|
14
|
-
for (let key of __getOwnPropNames(
|
|
15
|
-
if (!__hasOwnProp.call(
|
|
16
|
-
__defProp(
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
16
|
}
|
|
18
|
-
return
|
|
17
|
+
return to;
|
|
19
18
|
};
|
|
20
|
-
var __toESM = (
|
|
21
|
-
|
|
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);
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
21
|
var constants_exports = {};
|
|
29
22
|
__export(constants_exports, {
|
|
30
23
|
alignItemsPlacement: () => alignItemsPlacement,
|
|
24
|
+
boxShadow: () => boxShadow,
|
|
31
25
|
justifyPlacement: () => justifyPlacement,
|
|
32
26
|
wrap: () => wrap
|
|
33
27
|
});
|
|
28
|
+
module.exports = __toCommonJS(constants_exports);
|
|
34
29
|
var React = __toESM(require("react"));
|
|
35
30
|
const justifyPlacement = ["flex-start", "center", "flex-end", "space-between", "space-around", "space-evenly"];
|
|
36
31
|
const alignItemsPlacement = ["flex-start", "center", "flex-end", "stretch", "baseline"];
|
|
37
32
|
const wrap = ["wrap", "nowrap", "wrap-reverse"];
|
|
38
|
-
|
|
33
|
+
const boxShadow = ["xs", "s", "m", "l", "xl"];
|
|
39
34
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/utils/constants.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["export const justifyPlacement = ['flex-start', 'center', 'flex-end', 'space-between', 'space-around', 'space-evenly'];\n\nexport const alignItemsPlacement = ['flex-start', 'center', 'flex-end', 'stretch', 'baseline'];\n\nexport const wrap = ['wrap', 'nowrap', 'wrap-reverse'];\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["export const justifyPlacement = ['flex-start', 'center', 'flex-end', 'space-between', 'space-around', 'space-evenly'];\n\nexport const alignItemsPlacement = ['flex-start', 'center', 'flex-end', 'stretch', 'baseline'];\n\nexport const wrap = ['wrap', 'nowrap', 'wrap-reverse'];\n\nexport const boxShadow = ['xs', 's', 'm', 'l', 'xl'];\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAhB,MAAM,mBAAmB,CAAC,cAAc,UAAU,YAAY,iBAAiB,gBAAgB,cAAc;AAE7G,MAAM,sBAAsB,CAAC,cAAc,UAAU,YAAY,WAAW,UAAU;AAEtF,MAAM,OAAO,CAAC,QAAQ,UAAU,cAAc;AAE9C,MAAM,YAAY,CAAC,MAAM,KAAK,KAAK,KAAK,IAAI;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/utils/styles.js
CHANGED
|
@@ -4,33 +4,27 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
7
|
var __export = (target, all) => {
|
|
9
8
|
for (var name in all)
|
|
10
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
10
|
};
|
|
12
|
-
var
|
|
13
|
-
if (
|
|
14
|
-
for (let key of __getOwnPropNames(
|
|
15
|
-
if (!__hasOwnProp.call(
|
|
16
|
-
__defProp(
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
16
|
}
|
|
18
|
-
return
|
|
17
|
+
return to;
|
|
19
18
|
};
|
|
20
|
-
var __toESM = (
|
|
21
|
-
|
|
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);
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
21
|
var styles_exports = {};
|
|
29
22
|
__export(styles_exports, {
|
|
30
23
|
manageCols: () => manageCols,
|
|
31
24
|
manageRows: () => manageRows,
|
|
32
25
|
manageSpan: () => manageSpan
|
|
33
26
|
});
|
|
27
|
+
module.exports = __toCommonJS(styles_exports);
|
|
34
28
|
var React = __toESM(require("react"));
|
|
35
29
|
var import_ds_system = require("@elliemae/ds-system");
|
|
36
30
|
const manageSpan = import_ds_system.css`
|
|
@@ -174,5 +168,4 @@ const manageRows = import_ds_system.css`
|
|
|
174
168
|
return "";
|
|
175
169
|
}}
|
|
176
170
|
`;
|
|
177
|
-
module.exports = __toCommonJS(styles_exports);
|
|
178
171
|
//# sourceMappingURL=styles.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/utils/styles.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["/* eslint-disable max-lines */\n/* eslint-disable complexity */\nimport { css, mapTemplateGrid } from '@elliemae/ds-system';\nimport { DSGridT } from '../react-desc-prop-types';\n\nexport const manageSpan = css<DSGridT.ItemProps>`\n ${({ isSpanParent, span, theme }) => {\n if (!isSpanParent) return '';\n\n if (typeof span === 'number') {\n return `\n -ms-grid-column: auto / span ${span};\n grid-column: auto / span ${span};`;\n }\n\n if (typeof span !== 'object') return ``;\n\n // Span object\n\n let data = '';\n Object.keys(theme.media).forEach((key) => {\n // Type castings\n const theKey = key as keyof typeof span & keyof typeof theme.breakpoints;\n const spanValue = span[theKey];\n\n if (!!spanValue && theme.breakpoints[theKey]) {\n if (theKey === 'small') {\n data += `\n -ms-grid-column: auto / span ${spanValue};\n grid-column: auto / span ${spanValue};\n `;\n } else {\n data += `@media (min-width: ${theme.breakpoints[theKey]}) {\n -ms-grid-column: auto / span ${spanValue};\n grid-column: auto / span ${spanValue};\n }`;\n }\n }\n });\n return data;\n }}\n`;\n\nexport const manageCols = css<DSGridT.ItemProps>`\n ${({ cols, theme, isSpanParent }) => {\n if (typeof cols === 'object' && !Array.isArray(cols)) {\n let data = '';\n Object.keys(theme.media).forEach((key) => {\n const theKey = key as keyof typeof cols;\n const colValue = cols[theKey];\n if (!!colValue && Array.isArray(colValue)) {\n const mtg = (mapTemplateGrid(colValue) as string[]).join(' ');\n const mtgs = (mapTemplateGrid(colValue) as string[]).map((c) => `minmax(0, ${c})`).join(' ');\n if (theKey === 'small') {\n data += `-ms-grid-columns: ${mtg || 'minmax(0px, 1fr)'};\n grid-template-columns: ${mtg || 'auto'};\n -ms-grid-columns: ${mtgs || 'minmax(0px, 1fr)'};\n grid-template-columns: ${mtgs || 'auto'};`;\n } else {\n data += `@media (min-width: ${theme.breakpoints[theKey]}) {\n -ms-grid-columns: ${mtg || 'minmax(0px, 1fr)'};\n grid-template-columns: ${mtg || 'auto'};\n -ms-grid-columns: ${mtgs || 'minmax(0px, 1fr)'};\n grid-template-columns: ${mtgs || 'auto'};\n }`;\n }\n } else if (!!colValue && isSpanParent) {\n if (theKey === 'small') {\n data += `-ms-grid-columns: repeat(${colValue}, 1fr);\n grid-template-columns: repeat(${colValue}, 1fr);`;\n } else {\n data += `@media (min-width: ${theme.breakpoints[theKey]}) {\n -ms-grid-columns: repeat(${colValue}, 1fr);\n grid-template-columns: repeat(${colValue}, 1fr);\n }`;\n }\n }\n });\n return data;\n }\n if (Array.isArray(cols)) {\n const mtg = (mapTemplateGrid(cols) as string[]).join(' ');\n const mtgs = (mapTemplateGrid(cols) as string[]).map((c) => `minmax(0, ${c})`).join(' ');\n return `\n -ms-grid-columns: ${mtg || 'minmax(0px, 1fr)'};\n grid-template-columns: ${mtg || 'auto'};\n -ms-grid-columns: ${mtgs || 'minmax(0px, 1fr)'};\n grid-template-columns: ${mtgs || 'auto'};`;\n }\n if (isSpanParent) {\n return `\n -ms-grid-columns: repeat(${cols}, 1fr);\n grid-template-columns: repeat(${cols}, 1fr);`;\n }\n return '';\n }}\n`;\n\nexport const manageRows = css<DSGridT.ItemProps>`\n ${({ rows, theme, isSpanParent }) => {\n if (typeof rows === 'object' && !Array.isArray(rows)) {\n let data = '';\n Object.keys(theme.media).forEach((key) => {\n const theKey = key as keyof typeof rows & keyof typeof theme.breakpoints;\n const rowValue = rows[theKey];\n if (rowValue && Array.isArray(rowValue)) {\n const mtg = (mapTemplateGrid(rowValue) as string[]).join(' ');\n const mtgs = (mapTemplateGrid(rowValue) as string[]).map((c) => `minmax(0, ${c})`).join(' ');\n if (key === 'small') {\n data += `-ms-grid-rows: ${mtg || 'minmax(0px, 1fr)'};\n grid-template-rows: ${mtg || 'auto'};\n -ms-grid-rows: ${mtgs || 'minmax(0px, 1fr)'};\n grid-template-rows: ${mtgs || 'auto'};`;\n } else {\n data += `@media (min-width: ${theme.breakpoints[theKey]}) {\n -ms-grid-rows: ${mtg || 'minmax(0px, 1fr)'};\n grid-template-rows: ${mtg || 'auto'};\n -ms-grid-rows: ${mtgs || 'minmax(0px, 1fr)'};\n grid-template-rows: ${mtgs || 'auto'};\n }`;\n }\n } else if (!!rowValue && isSpanParent) {\n if (theKey === 'small') {\n data += `-ms-grid-rows: repeat(${rowValue}, 1fr);\n grid-template-rows: repeat(${rowValue}, 1fr);`;\n } else {\n data += `@media (min-width: ${theme.breakpoints[theKey]}) {\n -ms-grid-rows: repeat(${rowValue}, 1fr);\n grid-template-rows: repeat(${rowValue}, 1fr);\n }`;\n }\n }\n });\n return data;\n }\n if (Array.isArray(rows)) {\n const mtg = (mapTemplateGrid(rows) as string[]).join(' ');\n const mtgs = (mapTemplateGrid(rows) as string[]).map((c) => `minmax(0, ${c})`).join(' ');\n return `\n -ms-grid-rows: ${mtg || 'minmax(0px, 1fr)'};\n grid-template-rows: ${mtg || 'auto'};\n -ms-grid-rows: ${mtgs || 'minmax(0px, 1fr)'};\n grid-template-rows: ${mtgs || 'auto'};\n `;\n }\n if (isSpanParent) {\n return `\n -ms-grid-rows: repeat(${rows}, 1fr);\n grid-template-rows: repeat(${rows}, 1fr);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,IAAI,CAAC,MAAM,aAAa,IAAI,EAAE,KAAK,GAAG;AAC3F,YAAI,QAAQ,SAAS;AACnB,kBAAQ,kBAAkB,OAAO;AAAA,4CACD,OAAO;AAAA,uCACZ,QAAQ;AAAA,4CACH,QAAQ;AAAA,QAC1C,OAAO;AACL,kBAAQ,sBAAsB,MAAM,YAAY;AAAA,uCACrB,OAAO;AAAA,4CACF,OAAO;AAAA,uCACZ,QAAQ;AAAA,4CACH,QAAQ;AAAA;AAAA,QAE1C;AAAA,MACF,WAAW,CAAC,CAAC,YAAY,cAAc;AACrC,YAAI,WAAW,SAAS;AACtB,kBAAQ,yBAAyB;AAAA,kDACK;AAAA,QACxC,OAAO;AACL,kBAAQ,sBAAsB,MAAM,YAAY;AAAA,8CACd;AAAA,mDACK;AAAA;AAAA,QAEzC;AAAA,MACF;AAAA,IACF,CAAC;AACD,WAAO;AAAA,EACT;AACA,MAAI,MAAM,QAAQ,IAAI,GAAG;AACvB,UAAM,MAAO,sCAAgB,IAAI,EAAe,KAAK,GAAG;AACxD,UAAM,OAAQ,sCAAgB,IAAI,EAAe,IAAI,CAAC,MAAM,aAAa,IAAI,EAAE,KAAK,GAAG;AACvF,WAAO;AAAA,yBACY,OAAO;AAAA,8BACF,OAAO;AAAA,yBACZ,QAAQ;AAAA,8BACH,QAAQ;AAAA;AAAA,EAElC;AACA,MAAI,cAAc;AAChB,WAAO;AAAA,gCACmB;AAAA,qCACK;AAAA,EACjC;AACA,SAAO;AACT;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/Grid.js
CHANGED
|
@@ -31,7 +31,7 @@ var __objRest = (source, exclude) => {
|
|
|
31
31
|
};
|
|
32
32
|
import * as React from "react";
|
|
33
33
|
import React2 from "react";
|
|
34
|
-
import { describe, useMemoMergePropsWithDefault } from "@elliemae/ds-
|
|
34
|
+
import { describe, useMemoMergePropsWithDefault } from "@elliemae/ds-utilities";
|
|
35
35
|
import { get } from "lodash";
|
|
36
36
|
import { fixSpaceGutter } from "@elliemae/ds-system";
|
|
37
37
|
import { DSGridPropTypes, defaultProps } from "./react-desc-prop-types";
|
|
@@ -71,6 +71,7 @@ const Grid = React2.forwardRef((props, ref) => {
|
|
|
71
71
|
});
|
|
72
72
|
Grid.displayName = "Grid";
|
|
73
73
|
Grid.propTypes = DSGridPropTypes;
|
|
74
|
+
Grid.displayName = "Grid";
|
|
74
75
|
const DSGridWithSchema = describe(Grid);
|
|
75
76
|
DSGridWithSchema.propTypes = DSGridPropTypes;
|
|
76
77
|
var Grid_default = Grid;
|
package/dist/esm/Grid.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/Grid.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { describe, useMemoMergePropsWithDefault } from '@elliemae/ds-
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;ACAA;AACA;AACA;AACA;AACA;AACA;AAEA,MAAM,OAAO,OAAM,WAA0C,CAAC,OAAO,QAAQ;AAC3E,QAA8C,YAAtC,eAAsC,IAAzB,iCAAyB,IAAzB,CAAb;AACR,QAAM,oBAAoB,6BAA6B,sBAAsB;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { describe, useMemoMergePropsWithDefault } from '@elliemae/ds-utilities';\nimport { get } from 'lodash';\nimport { fixSpaceGutter } from '@elliemae/ds-system';\nimport { DSGridT, DSGridPropTypes, defaultProps } from './react-desc-prop-types';\nimport { GridItem } from './GridItem';\n\nconst Grid = React.forwardRef<HTMLDivElement, DSGridT.Props>((props, ref) => {\n const { children, ...propsWithoutChildren } = props;\n const propsWithDefaults = useMemoMergePropsWithDefault(propsWithoutChildren, defaultProps);\n\n const { rows, cols, alignItems, className, justify, gutter, wrap, width, height, ...rest } = propsWithDefaults;\n\n let isSpanParent = true;\n\n const renderChildren = React.Children.map(children, (child: React.ReactNode) => {\n if (\n get(child, 'child.type.name') === 'Grid' ||\n get(child, 'type.displayName') === 'Grid' ||\n parseInt(get(child, 'props.span', 0) as string, 10) > 0\n ) {\n const { width: wc, height: hc, span } = (child as React.ReactElement).props as Required<DSGridT.Props>;\n if (!span) isSpanParent = false;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n return React.cloneElement(child as React.ReactElement, {\n ...(child as React.ReactElement).props,\n width: fixSpaceGutter(wc),\n height: fixSpaceGutter(hc),\n });\n }\n return child;\n });\n\n return (\n <GridItem\n alignItems={alignItems}\n className={className}\n cols={cols}\n gutter={gutter}\n isSpanParent={isSpanParent}\n justify={justify}\n rows={rows}\n wrap={wrap}\n childNumber={React.Children.count(children)}\n ref={ref}\n {...rest}\n w={width}\n h={height}\n >\n {renderChildren}\n </GridItem>\n );\n});\n\n// Since this component is using ForwardRef, we must provide a displayName to avoid 'undefined' name in propsTable.\nGrid.displayName = 'Grid';\n\nGrid.propTypes = DSGridPropTypes;\nGrid.displayName = 'Grid';\nconst DSGridWithSchema = describe(Grid);\nDSGridWithSchema.propTypes = DSGridPropTypes;\n\nexport default Grid;\nexport { DSGridWithSchema, Grid };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;ACAA;AACA;AACA;AACA;AACA;AACA;AAEA,MAAM,OAAO,OAAM,WAA0C,CAAC,OAAO,QAAQ;AAC3E,QAA8C,YAAtC,eAAsC,IAAzB,iCAAyB,IAAzB,CAAb;AACR,QAAM,oBAAoB,6BAA6B,sBAAsB,YAAY;AAEzF,QAA6F,wBAArF,QAAM,MAAM,YAAY,WAAW,SAAS,QAAQ,MAAM,OAAO,WAAoB,IAAT,iBAAS,IAAT,CAA5E,QAAM,QAAM,cAAY,aAAW,WAAS,UAAQ,QAAM,SAAO;AAEzE,MAAI,eAAe;AAEnB,QAAM,iBAAiB,OAAM,SAAS,IAAI,UAAU,CAAC,UAA2B;AAC9E,QACE,IAAI,OAAO,iBAAiB,MAAM,UAClC,IAAI,OAAO,kBAAkB,MAAM,UACnC,SAAS,IAAI,OAAO,cAAc,CAAC,GAAa,EAAE,IAAI,GACtD;AACA,YAAM,EAAE,OAAO,IAAI,QAAQ,IAAI,SAAU,MAA6B;AACtE,UAAI,CAAC;AAAM,uBAAe;AAE1B,aAAO,OAAM,aAAa,OAA6B,iCACjD,MAA6B,QADoB;AAAA,QAErD,OAAO,eAAe,EAAE;AAAA,QACxB,QAAQ,eAAe,EAAE;AAAA,MAC3B,EAAC;AAAA,IACH;AACA,WAAO;AAAA,EACT,CAAC;AAED,SACE,qCAAC;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,aAAa,OAAM,SAAS,MAAM,QAAQ;AAAA,IAC1C;AAAA,KACI,OAXL;AAAA,IAYC,GAAG;AAAA,IACH,GAAG;AAAA,MAEF,cACH;AAEJ,CAAC;AAGD,KAAK,cAAc;AAEnB,KAAK,YAAY;AACjB,KAAK,cAAc;AACnB,MAAM,mBAAmB,SAAS,IAAI;AACtC,iBAAiB,YAAY;AAE7B,IAAO,eAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/GridItem.js
CHANGED
|
@@ -1,14 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import styled from "
|
|
3
|
-
import {
|
|
4
|
-
space,
|
|
5
|
-
width,
|
|
6
|
-
height,
|
|
7
|
-
flexboxes,
|
|
8
|
-
grids,
|
|
9
|
-
sizing
|
|
10
|
-
} from "@xstyled/styled-components";
|
|
11
|
-
import { mapGap } from "@elliemae/ds-system";
|
|
2
|
+
import { styled, mapGap, background, borders, sizing, space, boxShadows, flexboxes, grids } from "@elliemae/ds-system";
|
|
12
3
|
import { manageCols, manageRows, manageSpan } from "./utils/styles";
|
|
13
4
|
const GridItem = styled.div`
|
|
14
5
|
display: grid;
|
|
@@ -19,11 +10,12 @@ const GridItem = styled.div`
|
|
|
19
10
|
${flexboxes}
|
|
20
11
|
${sizing}
|
|
21
12
|
${space}
|
|
22
|
-
${height}
|
|
23
|
-
${width}
|
|
24
13
|
${manageCols}
|
|
25
14
|
${manageRows}
|
|
26
15
|
${manageSpan}
|
|
16
|
+
${boxShadows}
|
|
17
|
+
${borders}
|
|
18
|
+
${background}
|
|
27
19
|
`;
|
|
28
20
|
export {
|
|
29
21
|
GridItem
|
package/dist/esm/GridItem.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/GridItem.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\n/* eslint-disable complexity */\nimport
|
|
5
|
-
"mappings": "AAAA;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\n/* eslint-disable complexity */\nimport { LayoutProps, SpaceProps, SizingProps } from '@xstyled/styled-components';\nimport { styled, mapGap, background, borders, sizing, space, boxShadows, flexboxes, grids } from '@elliemae/ds-system';\nimport { manageCols, manageRows, manageSpan } from './utils/styles';\nimport { DSGridT } from './react-desc-prop-types';\n\nexport const GridItem = styled.div<DSGridT.ItemProps & LayoutProps & SpaceProps & SizingProps>`\n display: grid;\n display: -ms-grid;\n column-gap: ${({ gutter }) => mapGap(gutter)};\n row-gap: ${({ gutter }) => mapGap(gutter)};\n ${grids}\n ${flexboxes}\n ${sizing}\n ${space}\n ${manageCols}\n ${manageRows}\n ${manageSpan}\n ${boxShadows}\n ${borders}\n ${background}\n`;\n"],
|
|
5
|
+
"mappings": "AAAA;ACGA;AACA;AAGO,MAAM,WAAW,OAAO;AAAA;AAAA;AAAA,gBAGf,CAAC,EAAE,aAAa,OAAO,MAAM;AAAA,aAChC,CAAC,EAAE,aAAa,OAAO,MAAM;AAAA,IACtC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -22,8 +22,8 @@ import {
|
|
|
22
22
|
PropTypes,
|
|
23
23
|
globalAttributesPropTypes,
|
|
24
24
|
xstyledPropTypes
|
|
25
|
-
} from "@elliemae/ds-
|
|
26
|
-
import { alignItemsPlacement, justifyPlacement, wrap } from "./utils/constants";
|
|
25
|
+
} from "@elliemae/ds-utilities";
|
|
26
|
+
import { alignItemsPlacement, justifyPlacement, wrap, boxShadow } from "./utils/constants";
|
|
27
27
|
const defaultProps = {
|
|
28
28
|
rows: [],
|
|
29
29
|
cols: [],
|
|
@@ -60,7 +60,31 @@ const DSGridPropTypes = __spreadProps(__spreadValues(__spreadValues({}, globalAt
|
|
|
60
60
|
gutter: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description("Space between cells prop").defaultValue(0),
|
|
61
61
|
wrap: PropTypes.oneOf(wrap).description("Wrap type").defaultValue(wrap[0]),
|
|
62
62
|
height: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description("Grid height."),
|
|
63
|
-
width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description("Grid width.")
|
|
63
|
+
width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description("Grid width."),
|
|
64
|
+
backgroundColor: PropTypes.string.description("Sets background color."),
|
|
65
|
+
bg: PropTypes.string.description("Sets background color."),
|
|
66
|
+
boxShadow: PropTypes.oneOf(boxShadow).description("Sets background color."),
|
|
67
|
+
border: PropTypes.string.description("Sets border."),
|
|
68
|
+
borderRadius: PropTypes.string.description("Sets border radius."),
|
|
69
|
+
borderWidth: PropTypes.string.description("Sets border width."),
|
|
70
|
+
borderStyle: PropTypes.string.description("Sets border style."),
|
|
71
|
+
borderColor: PropTypes.string.description("Sets border color."),
|
|
72
|
+
borderTop: PropTypes.string.description("Sets top border."),
|
|
73
|
+
borderBottom: PropTypes.string.description("Sets bottom border."),
|
|
74
|
+
borderLeft: PropTypes.string.description("Sets left border."),
|
|
75
|
+
borderRight: PropTypes.string.description("Sets right border."),
|
|
76
|
+
borderTopWidth: PropTypes.string.description("Sets border top width."),
|
|
77
|
+
borderTopStyle: PropTypes.string.description("Sets border top style."),
|
|
78
|
+
borderTopColor: PropTypes.string.description("Sets border top color."),
|
|
79
|
+
borderBottomWidth: PropTypes.string.description("Sets border bottom width."),
|
|
80
|
+
borderBottomStyle: PropTypes.string.description("Sets border bottom style."),
|
|
81
|
+
borderBottomColor: PropTypes.string.description("Sets border bottom color."),
|
|
82
|
+
borderRightWidth: PropTypes.string.description("Sets border right width."),
|
|
83
|
+
borderRightStyle: PropTypes.string.description("Sets border right style."),
|
|
84
|
+
borderRightColor: PropTypes.string.description("Sets border right color."),
|
|
85
|
+
borderLeftWidth: PropTypes.string.description("Sets border left width."),
|
|
86
|
+
borderLeftStyle: PropTypes.string.description("Sets border left style."),
|
|
87
|
+
borderLeftColor: PropTypes.string.description("Sets border left color.")
|
|
64
88
|
});
|
|
65
89
|
export {
|
|
66
90
|
DSGridPropTypes,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/react-desc-prop-types.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { WeakValidationMap } from 'react';\nimport {\n PropTypes,\n globalAttributesPropTypes,\n xstyledPropTypes,\n GlobalAttributesT,\n XstyledProps,\n} from '@elliemae/ds-
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;ACCA;AAAA;AAAA;AAAA;AAAA;AAOA;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { WeakValidationMap } from 'react';\nimport {\n PropTypes,\n globalAttributesPropTypes,\n xstyledPropTypes,\n GlobalAttributesT,\n XstyledProps,\n} from '@elliemae/ds-utilities';\nimport { alignItemsPlacement, justifyPlacement, wrap, boxShadow } from './utils/constants';\n\nexport declare namespace DSGridT {\n interface RowColBreakpoints {\n small?: string | number[];\n medium?: string | number[];\n large?: string | number[];\n }\n\n type Shadow = 'xs' | 's' | 'm' | 'l' | 'xs';\n\n interface SpanBreakpoints {\n small?: number;\n medium?: number;\n large?: number;\n }\n\n interface IProps {\n height?: string;\n width?: string;\n rows?: string[] | string | number[] | RowColBreakpoints;\n cols?: string[] | string | number[] | RowColBreakpoints;\n justifyContent?: typeof justifyPlacement[number];\n alignItems?: typeof alignItemsPlacement[number];\n children?: React.ReactNode;\n className?: string;\n justify?: typeof justifyPlacement[number];\n gutter?: string | number;\n wrap?: typeof wrap[number];\n span?: number;\n }\n\n export interface Props extends IProps, Omit<GlobalAttributesT<HTMLDivElement>, keyof IProps>, XstyledProps {}\n\n export interface ItemProps {\n rows: string[] | string | number[] | RowColBreakpoints;\n cols: string[] | string | number[] | RowColBreakpoints;\n alignItems: typeof alignItemsPlacement[number];\n children: React.ReactNode;\n className: string;\n justify: typeof justifyPlacement[number];\n gutter: string | number;\n wrap: typeof wrap[number];\n childNumber: number;\n isSpanParent: boolean;\n span?: number | SpanBreakpoints;\n ref: React.ForwardedRef<HTMLDivElement>;\n boxShadow?: Shadow;\n backgroundColor?: string;\n bg?: string;\n }\n}\n\nexport const defaultProps = {\n rows: [],\n cols: [],\n className: '',\n justify: 'flex-start',\n gutter: 0,\n wrap: 'wrap',\n span: 1,\n};\n\n// =============================================================================\n// PropTypes\n// =============================================================================\nconst rowColBreakpoints = PropTypes.shape({\n small: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])),\n medium: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])),\n large: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])),\n});\n\nconst spanBreakpoints = PropTypes.shape({\n small: PropTypes.number,\n medium: PropTypes.number,\n large: PropTypes.number,\n});\n\nexport const DSGridPropTypes = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n rows: PropTypes.oneOfType([\n PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])),\n rowColBreakpoints,\n ])\n .description('Row layout cells')\n .defaultValue([]),\n cols: PropTypes.oneOfType([\n PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])),\n rowColBreakpoints,\n ])\n .description('Column layout cells')\n .defaultValue([]),\n span: PropTypes.oneOfType([PropTypes.number, spanBreakpoints]).description(\n 'Expands the grid element within columns.',\n ),\n alignItems: PropTypes.oneOf(alignItemsPlacement).description('flex-like align items prop'),\n children: PropTypes.node.description('Children node inside grid cell'),\n className: PropTypes.string.description('CSS class').defaultValue(''),\n justifyContent: PropTypes.oneOf(justifyPlacement)\n .description('flex-like justify prop')\n .defaultValue(justifyPlacement[0]),\n gutter: PropTypes.oneOfType([PropTypes.number, PropTypes.string])\n .description('Space between cells prop')\n .defaultValue(0),\n wrap: PropTypes.oneOf(wrap).description('Wrap type').defaultValue(wrap[0]),\n height: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description('Grid height.'),\n width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description('Grid width.'),\n backgroundColor: PropTypes.string.description('Sets background color.'),\n bg: PropTypes.string.description('Sets background color.'),\n boxShadow: PropTypes.oneOf(boxShadow).description('Sets background color.'),\n border: PropTypes.string.description('Sets border.'),\n borderRadius: PropTypes.string.description('Sets border radius.'),\n borderWidth: PropTypes.string.description('Sets border width.'),\n borderStyle: PropTypes.string.description('Sets border style.'),\n borderColor: PropTypes.string.description('Sets border color.'),\n borderTop: PropTypes.string.description('Sets top border.'),\n borderBottom: PropTypes.string.description('Sets bottom border.'),\n borderLeft: PropTypes.string.description('Sets left border.'),\n borderRight: PropTypes.string.description('Sets right border.'),\n borderTopWidth: PropTypes.string.description('Sets border top width.'),\n borderTopStyle: PropTypes.string.description('Sets border top style.'),\n borderTopColor: PropTypes.string.description('Sets border top color.'),\n borderBottomWidth: PropTypes.string.description('Sets border bottom width.'),\n borderBottomStyle: PropTypes.string.description('Sets border bottom style.'),\n borderBottomColor: PropTypes.string.description('Sets border bottom color.'),\n borderRightWidth: PropTypes.string.description('Sets border right width.'),\n borderRightStyle: PropTypes.string.description('Sets border right style.'),\n borderRightColor: PropTypes.string.description('Sets border right color.'),\n borderLeftWidth: PropTypes.string.description('Sets border left width.'),\n borderLeftStyle: PropTypes.string.description('Sets border left style.'),\n borderLeftColor: PropTypes.string.description('Sets border left color.'),\n} as WeakValidationMap<unknown>;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;ACCA;AAAA;AAAA;AAAA;AAAA;AAOA;AAqDO,MAAM,eAAe;AAAA,EAC1B,MAAM,CAAC;AAAA,EACP,MAAM,CAAC;AAAA,EACP,WAAW;AAAA,EACX,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,MAAM;AACR;AAKA,MAAM,oBAAoB,UAAU,MAAM;AAAA,EACxC,OAAO,UAAU,QAAQ,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC,CAAC;AAAA,EAClF,QAAQ,UAAU,QAAQ,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC,CAAC;AAAA,EACnF,OAAO,UAAU,QAAQ,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC,CAAC;AACpF,CAAC;AAED,MAAM,kBAAkB,UAAU,MAAM;AAAA,EACtC,OAAO,UAAU;AAAA,EACjB,QAAQ,UAAU;AAAA,EAClB,OAAO,UAAU;AACnB,CAAC;AAEM,MAAM,kBAAkB,gDAC1B,4BACA,mBAF0B;AAAA,EAG7B,MAAM,UAAU,UAAU;AAAA,IACxB,UAAU,QAAQ,UAAU,UAAU,CAAC,UAA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E,aAAa,UAAU,OAAO,YAAY,oBAAoB;AAAA,EAC9D,aAAa,UAAU,OAAO,YAAY,oBAAoB;AAAA,EAC9D,aAAa,UAAU,OAAO,YAAY,oBAAoB;AAAA,EAC9D,WAAW,UAAU,OAAO,YAAY,kBAAkB;AAAA,EAC1D,cAAc,UAAU,OAAO,YAAY,qBAAqB;AAAA,EAChE,YAAY,UAAU,OAAO,YAAY,mBAAmB;AAAA,EAC5D,aAAa,UAAU,OAAO,YAAY,oBAAoB;AAAA,EAC9D,gBAAgB,UAAU,OAAO,YAAY,wBAAwB;AAAA,EACrE,gBAAgB,UAAU,OAAO,YAAY,wBAAwB;AAAA,EACrE,gBAAgB,UAAU,OAAO,YAAY,wBAAwB;AAAA,EACrE,mBAAmB,UAAU,OAAO,YAAY,2BAA2B;AAAA,EAC3E,mBAAmB,UAAU,OAAO,YAAY,2BAA2B;AAAA,EAC3E,mBAAmB,UAAU,OAAO,YAAY,2BAA2B;AAAA,EAC3E,kBAAkB,UAAU,OAAO,YAAY,0BAA0B;AAAA,EACzE,kBAAkB,UAAU,OAAO,YAAY,0BAA0B;AAAA,EACzE,kBAAkB,UAAU,OAAO,YAAY,0BAA0B;AAAA,EACzE,iBAAiB,UAAU,OAAO,YAAY,yBAAyB;AAAA,EACvE,iBAAiB,UAAU,OAAO,YAAY,yBAAyB;AAAA,EACvE,iBAAiB,UAAU,OAAO,YAAY,yBAAyB;AACzE;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,8 +2,10 @@ import * as React from "react";
|
|
|
2
2
|
const justifyPlacement = ["flex-start", "center", "flex-end", "space-between", "space-around", "space-evenly"];
|
|
3
3
|
const alignItemsPlacement = ["flex-start", "center", "flex-end", "stretch", "baseline"];
|
|
4
4
|
const wrap = ["wrap", "nowrap", "wrap-reverse"];
|
|
5
|
+
const boxShadow = ["xs", "s", "m", "l", "xl"];
|
|
5
6
|
export {
|
|
6
7
|
alignItemsPlacement,
|
|
8
|
+
boxShadow,
|
|
7
9
|
justifyPlacement,
|
|
8
10
|
wrap
|
|
9
11
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/utils/constants.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const justifyPlacement = ['flex-start', 'center', 'flex-end', 'space-between', 'space-around', 'space-evenly'];\n\nexport const alignItemsPlacement = ['flex-start', 'center', 'flex-end', 'stretch', 'baseline'];\n\nexport const wrap = ['wrap', 'nowrap', 'wrap-reverse'];\n"],
|
|
5
|
-
"mappings": "AAAA;ACAO,MAAM,mBAAmB,CAAC,cAAc,UAAU,YAAY,iBAAiB,gBAAgB;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const justifyPlacement = ['flex-start', 'center', 'flex-end', 'space-between', 'space-around', 'space-evenly'];\n\nexport const alignItemsPlacement = ['flex-start', 'center', 'flex-end', 'stretch', 'baseline'];\n\nexport const wrap = ['wrap', 'nowrap', 'wrap-reverse'];\n\nexport const boxShadow = ['xs', 's', 'm', 'l', 'xl'];\n"],
|
|
5
|
+
"mappings": "AAAA;ACAO,MAAM,mBAAmB,CAAC,cAAc,UAAU,YAAY,iBAAiB,gBAAgB,cAAc;AAE7G,MAAM,sBAAsB,CAAC,cAAc,UAAU,YAAY,WAAW,UAAU;AAEtF,MAAM,OAAO,CAAC,QAAQ,UAAU,cAAc;AAE9C,MAAM,YAAY,CAAC,MAAM,KAAK,KAAK,KAAK,IAAI;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/utils/styles.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\n/* eslint-disable complexity */\nimport { css, mapTemplateGrid } from '@elliemae/ds-system';\nimport { DSGridT } from '../react-desc-prop-types';\n\nexport const manageSpan = css<DSGridT.ItemProps>`\n ${({ isSpanParent, span, theme }) => {\n if (!isSpanParent) return '';\n\n if (typeof span === 'number') {\n return `\n -ms-grid-column: auto / span ${span};\n grid-column: auto / span ${span};`;\n }\n\n if (typeof span !== 'object') return ``;\n\n // Span object\n\n let data = '';\n Object.keys(theme.media).forEach((key) => {\n // Type castings\n const theKey = key as keyof typeof span & keyof typeof theme.breakpoints;\n const spanValue = span[theKey];\n\n if (!!spanValue && theme.breakpoints[theKey]) {\n if (theKey === 'small') {\n data += `\n -ms-grid-column: auto / span ${spanValue};\n grid-column: auto / span ${spanValue};\n `;\n } else {\n data += `@media (min-width: ${theme.breakpoints[theKey]}) {\n -ms-grid-column: auto / span ${spanValue};\n grid-column: auto / span ${spanValue};\n }`;\n }\n }\n });\n return data;\n }}\n`;\n\nexport const manageCols = css<DSGridT.ItemProps>`\n ${({ cols, theme, isSpanParent }) => {\n if (typeof cols === 'object' && !Array.isArray(cols)) {\n let data = '';\n Object.keys(theme.media).forEach((key) => {\n const theKey = key as keyof typeof cols;\n const colValue = cols[theKey];\n if (!!colValue && Array.isArray(colValue)) {\n const mtg = (mapTemplateGrid(colValue) as string[]).join(' ');\n const mtgs = (mapTemplateGrid(colValue) as string[]).map((c) => `minmax(0, ${c})`).join(' ');\n if (theKey === 'small') {\n data += `-ms-grid-columns: ${mtg || 'minmax(0px, 1fr)'};\n grid-template-columns: ${mtg || 'auto'};\n -ms-grid-columns: ${mtgs || 'minmax(0px, 1fr)'};\n grid-template-columns: ${mtgs || 'auto'};`;\n } else {\n data += `@media (min-width: ${theme.breakpoints[theKey]}) {\n -ms-grid-columns: ${mtg || 'minmax(0px, 1fr)'};\n grid-template-columns: ${mtg || 'auto'};\n -ms-grid-columns: ${mtgs || 'minmax(0px, 1fr)'};\n grid-template-columns: ${mtgs || 'auto'};\n }`;\n }\n } else if (!!colValue && isSpanParent) {\n if (theKey === 'small') {\n data += `-ms-grid-columns: repeat(${colValue}, 1fr);\n grid-template-columns: repeat(${colValue}, 1fr);`;\n } else {\n data += `@media (min-width: ${theme.breakpoints[theKey]}) {\n -ms-grid-columns: repeat(${colValue}, 1fr);\n grid-template-columns: repeat(${colValue}, 1fr);\n }`;\n }\n }\n });\n return data;\n }\n if (Array.isArray(cols)) {\n const mtg = (mapTemplateGrid(cols) as string[]).join(' ');\n const mtgs = (mapTemplateGrid(cols) as string[]).map((c) => `minmax(0, ${c})`).join(' ');\n return `\n -ms-grid-columns: ${mtg || 'minmax(0px, 1fr)'};\n grid-template-columns: ${mtg || 'auto'};\n -ms-grid-columns: ${mtgs || 'minmax(0px, 1fr)'};\n grid-template-columns: ${mtgs || 'auto'};`;\n }\n if (isSpanParent) {\n return `\n -ms-grid-columns: repeat(${cols}, 1fr);\n grid-template-columns: repeat(${cols}, 1fr);`;\n }\n return '';\n }}\n`;\n\nexport const manageRows = css<DSGridT.ItemProps>`\n ${({ rows, theme, isSpanParent }) => {\n if (typeof rows === 'object' && !Array.isArray(rows)) {\n let data = '';\n Object.keys(theme.media).forEach((key) => {\n const theKey = key as keyof typeof rows & keyof typeof theme.breakpoints;\n const rowValue = rows[theKey];\n if (rowValue && Array.isArray(rowValue)) {\n const mtg = (mapTemplateGrid(rowValue) as string[]).join(' ');\n const mtgs = (mapTemplateGrid(rowValue) as string[]).map((c) => `minmax(0, ${c})`).join(' ');\n if (key === 'small') {\n data += `-ms-grid-rows: ${mtg || 'minmax(0px, 1fr)'};\n grid-template-rows: ${mtg || 'auto'};\n -ms-grid-rows: ${mtgs || 'minmax(0px, 1fr)'};\n grid-template-rows: ${mtgs || 'auto'};`;\n } else {\n data += `@media (min-width: ${theme.breakpoints[theKey]}) {\n -ms-grid-rows: ${mtg || 'minmax(0px, 1fr)'};\n grid-template-rows: ${mtg || 'auto'};\n -ms-grid-rows: ${mtgs || 'minmax(0px, 1fr)'};\n grid-template-rows: ${mtgs || 'auto'};\n }`;\n }\n } else if (!!rowValue && isSpanParent) {\n if (theKey === 'small') {\n data += `-ms-grid-rows: repeat(${rowValue}, 1fr);\n grid-template-rows: repeat(${rowValue}, 1fr);`;\n } else {\n data += `@media (min-width: ${theme.breakpoints[theKey]}) {\n -ms-grid-rows: repeat(${rowValue}, 1fr);\n grid-template-rows: repeat(${rowValue}, 1fr);\n }`;\n }\n }\n });\n return data;\n }\n if (Array.isArray(rows)) {\n const mtg = (mapTemplateGrid(rows) as string[]).join(' ');\n const mtgs = (mapTemplateGrid(rows) as string[]).map((c) => `minmax(0, ${c})`).join(' ');\n return `\n -ms-grid-rows: ${mtg || 'minmax(0px, 1fr)'};\n grid-template-rows: ${mtg || 'auto'};\n -ms-grid-rows: ${mtgs || 'minmax(0px, 1fr)'};\n grid-template-rows: ${mtgs || 'auto'};\n `;\n }\n if (isSpanParent) {\n return `\n -ms-grid-rows: repeat(${rows}, 1fr);\n grid-template-rows: repeat(${rows}, 1fr);`;\n }\n return '';\n }}\n`;\n"],
|
|
5
|
-
"mappings": "AAAA;ACEA;AAGO,MAAM,aAAa;AAAA,IACtB,CAAC,EAAE,cAAc,MAAM,YAAY;AACnC,MAAI,CAAC;AAAc,WAAO;AAE1B,MAAI,OAAO,SAAS,UAAU;AAC5B,WAAO;AAAA,uCAC0B;AAAA,mCACJ;AAAA
|
|
5
|
+
"mappings": "AAAA;ACEA;AAGO,MAAM,aAAa;AAAA,IACtB,CAAC,EAAE,cAAc,MAAM,YAAY;AACnC,MAAI,CAAC;AAAc,WAAO;AAE1B,MAAI,OAAO,SAAS,UAAU;AAC5B,WAAO;AAAA,uCAC0B;AAAA,mCACJ;AAAA,EAC/B;AAEA,MAAI,OAAO,SAAS;AAAU,WAAO;AAIrC,MAAI,OAAO;AACX,SAAO,KAAK,MAAM,KAAK,EAAE,QAAQ,CAAC,QAAQ;AAExC,UAAM,SAAS;AACf,UAAM,YAAY,KAAK;AAEvB,QAAI,CAAC,CAAC,aAAa,MAAM,YAAY,SAAS;AA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MAAM,QAAQ,IAAI,GAAG;AACvB,UAAM,MAAO,gBAAgB,IAAI,EAAe,KAAK,GAAG;AACxD,UAAM,OAAQ,gBAAgB,IAAI,EAAe,IAAI,CAAC,MAAM,aAAa,IAAI,EAAE,KAAK,GAAG;AACvF,WAAO;AAAA,yBACY,OAAO;AAAA,8BACF,OAAO;AAAA,yBACZ,QAAQ;AAAA,8BACH,QAAQ;AAAA;AAAA,EAElC;AACA,MAAI,cAAc;AAChB,WAAO;AAAA,gCACmB;AAAA,qCACK;AAAA,EACjC;AACA,SAAO;AACT;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-grid",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Grid",
|
|
6
6
|
"files": [
|
|
@@ -62,15 +62,22 @@
|
|
|
62
62
|
"reportFile": "tests.xml",
|
|
63
63
|
"indent": 4
|
|
64
64
|
},
|
|
65
|
+
"scripts": {
|
|
66
|
+
"dev": "cross-env NODE_ENV=development node ../../scripts/build/build.mjs --watch",
|
|
67
|
+
"test": "node ../../scripts/testing/test.mjs",
|
|
68
|
+
"lint": "node ../../scripts/lint.mjs",
|
|
69
|
+
"dts": "node ../../scripts/dts.mjs",
|
|
70
|
+
"build": "cross-env NODE_ENV=production node ../../scripts/build/build.mjs"
|
|
71
|
+
},
|
|
65
72
|
"dependencies": {
|
|
66
|
-
"@elliemae/ds-
|
|
67
|
-
"@elliemae/ds-
|
|
73
|
+
"@elliemae/ds-system": "workspace:*",
|
|
74
|
+
"@elliemae/ds-utilities": "workspace:*",
|
|
68
75
|
"@xstyled/styled-components": "~3.1.2",
|
|
69
76
|
"react-desc": "~4.1.3"
|
|
70
77
|
},
|
|
71
78
|
"devDependencies": {
|
|
72
79
|
"@testing-library/jest-dom": "~5.16.2",
|
|
73
|
-
"@testing-library/react": "~12.1.
|
|
80
|
+
"@testing-library/react": "~12.1.4",
|
|
74
81
|
"@testing-library/user-event": "~13.5.0",
|
|
75
82
|
"styled-components": "~5.3.3",
|
|
76
83
|
"styled-system": "~5.1.5"
|
|
@@ -85,12 +92,5 @@
|
|
|
85
92
|
"publishConfig": {
|
|
86
93
|
"access": "public",
|
|
87
94
|
"typeSafety": false
|
|
88
|
-
},
|
|
89
|
-
"scripts": {
|
|
90
|
-
"dev": "cross-env NODE_ENV=development node ../../scripts/build/build.mjs --watch",
|
|
91
|
-
"test": "node ../../scripts/testing/test.mjs",
|
|
92
|
-
"lint": "node ../../scripts/lint.mjs",
|
|
93
|
-
"dts": "node ../../scripts/dts.mjs",
|
|
94
|
-
"build": "cross-env NODE_ENV=production node ../../scripts/build/build.mjs"
|
|
95
95
|
}
|
|
96
|
-
}
|
|
96
|
+
}
|