@elliemae/ds-group-box 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,69 +1,53 @@
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 GroupHeader_exports = {};
29
- __export(GroupHeader_exports, {
30
- DSGroupBoxHeader: () => DSGroupBoxHeader
31
- });
32
- var React = __toESM(require("react"));
33
- var import_react = __toESM(require("react"));
34
- var import_ds_truncated_tooltip_text = __toESM(require("@elliemae/ds-truncated-tooltip-text"));
35
- var import_constants = require("../constants");
36
- var import_Actions = __toESM(require("../Actions"));
37
- var import_LabelElement = __toESM(require("../LabelElement"));
38
- var import_GroupBoxLabel = __toESM(require("../GroupBoxLabel"));
39
- const DSGroupBoxHeader = ({
40
- labelProps = {
41
- labelText: "",
42
- borderBottom: false,
43
- id: "ds-group-box__header"
44
- },
45
- rightActions = [],
46
- centerActions = [],
47
- type = import_constants.BOX_TYPES.CATEGORY,
48
- noBorder,
49
- isMain
50
- }) => {
51
- const { labelText, borderBottom, id } = labelProps;
52
- return /* @__PURE__ */ import_react.default.createElement(import_GroupBoxLabel.default, {
53
- borderBottom,
54
- isMain,
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var _jsx = require('@babel/runtime/helpers/jsx');
6
+ require('react');
7
+ var DSTruncatedTooltipText = require('@elliemae/ds-truncated-tooltip-text');
8
+ var constants = require('../constants.js');
9
+ var Actions = require('../Actions.js');
10
+ var LabelElement = require('../LabelElement.js');
11
+ var GroupBoxLabel = require('../GroupBoxLabel.js');
12
+
13
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
14
+
15
+ var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
16
+ var DSTruncatedTooltipText__default = /*#__PURE__*/_interopDefaultLegacy(DSTruncatedTooltipText);
17
+
18
+ const DSGroupBoxHeader = _ref => {
19
+ let {
20
+ labelProps = {
21
+ labelText: '',
22
+ borderBottom: false,
23
+ id: 'ds-group-box__header'
24
+ },
25
+ rightActions = [],
26
+ centerActions = [],
27
+ type = constants.BOX_TYPES.CATEGORY,
55
28
  noBorder,
56
- type,
29
+ isMain
30
+ } = _ref;
31
+ const {
32
+ labelText,
33
+ borderBottom,
57
34
  id
58
- }, /* @__PURE__ */ import_react.default.createElement(import_LabelElement.default, null, /* @__PURE__ */ import_react.default.createElement(import_ds_truncated_tooltip_text.default, {
35
+ } = labelProps;
36
+ return /*#__PURE__*/_jsx__default["default"](GroupBoxLabel, {
37
+ borderBottom: borderBottom,
38
+ isMain: isMain,
39
+ noBorder: noBorder,
40
+ type: type,
41
+ id: id
42
+ }, void 0, /*#__PURE__*/_jsx__default["default"](LabelElement, {}, void 0, /*#__PURE__*/_jsx__default["default"](DSTruncatedTooltipText__default["default"], {
59
43
  value: labelText
60
- })), /* @__PURE__ */ import_react.default.createElement(import_Actions.default, {
44
+ })), /*#__PURE__*/_jsx__default["default"](Actions.Actions, {
61
45
  actions: centerActions,
62
46
  centerActions: centerActions.length > 0
63
- }), /* @__PURE__ */ import_react.default.createElement(import_Actions.default, {
47
+ }), /*#__PURE__*/_jsx__default["default"](Actions.Actions, {
64
48
  actions: rightActions,
65
49
  rightActions: rightActions.length > 0
66
50
  }));
67
51
  };
68
- module.exports = __toCommonJS(GroupHeader_exports);
69
- //# sourceMappingURL=GroupHeader.js.map
52
+
53
+ exports.DSGroupBoxHeader = DSGroupBoxHeader;
@@ -1,58 +1,56 @@
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);
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var dsClassnames = require('@elliemae/ds-classnames');
6
+
7
+ const blockName = 'group-box';
8
+ const GroupBoxWrapper = dsClassnames.aggregatedClasses('div')(blockName, 'wrapper', _ref => {
9
+ let {
10
+ onlyHeader,
11
+ noBorder,
12
+ type,
13
+ isMain
14
+ } = _ref;
15
+ return {
16
+ 'only-header': onlyHeader,
17
+ 'no-border': noBorder,
18
+ [type]: type,
19
+ 'main-box': isMain,
20
+ 'nested-box': !isMain
26
21
  };
27
- })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
28
- var blocks_exports = {};
29
- __export(blocks_exports, {
30
- GroupBoxContent: () => GroupBoxContent,
31
- GroupBoxWrapper: () => GroupBoxWrapper,
32
- Label: () => Label
33
22
  });
34
- var React = __toESM(require("react"));
35
- var import_ds_classnames = require("@elliemae/ds-classnames");
36
- const blockName = "group-box";
37
- const GroupBoxWrapper = (0, import_ds_classnames.aggregatedClasses)("div")(blockName, "wrapper", ({ onlyHeader, noBorder, type, isMain }) => ({
38
- "only-header": onlyHeader,
39
- "no-border": noBorder,
40
- [type]: type,
41
- "main-box": isMain,
42
- "nested-box": !isMain
43
- }));
44
- const GroupBoxContent = (0, import_ds_classnames.aggregatedClasses)("div")(blockName, "content", ({ type, asRow, onlyHeader, noPadding, noBorder, noBorderTop }) => ({
45
- [type]: type,
46
- "as-row": asRow,
47
- "only-header": onlyHeader,
48
- "no-padding": noPadding,
49
- "no-border": noBorder,
50
- "no-border-top": noBorderTop
51
- }));
52
- const Label = (0, import_ds_classnames.aggregatedClasses)("div")(blockName, "label", ({ borderBottom, type, noBorder }) => ({
53
- "border-bottom": borderBottom,
54
- [type]: type,
55
- "no-border": noBorder
56
- }));
57
- module.exports = __toCommonJS(blocks_exports);
58
- //# sourceMappingURL=blocks.js.map
23
+ const GroupBoxContent = dsClassnames.aggregatedClasses('div')(blockName, 'content', _ref2 => {
24
+ let {
25
+ type,
26
+ asRow,
27
+ onlyHeader,
28
+ noPadding,
29
+ noBorder,
30
+ noBorderTop
31
+ } = _ref2;
32
+ return {
33
+ [type]: type,
34
+ 'as-row': asRow,
35
+ 'only-header': onlyHeader,
36
+ 'no-padding': noPadding,
37
+ 'no-border': noBorder,
38
+ 'no-border-top': noBorderTop
39
+ };
40
+ });
41
+ const Label = dsClassnames.aggregatedClasses('div')(blockName, 'label', _ref3 => {
42
+ let {
43
+ borderBottom,
44
+ type,
45
+ noBorder
46
+ } = _ref3;
47
+ return {
48
+ 'border-bottom': borderBottom,
49
+ [type]: type,
50
+ 'no-border': noBorder
51
+ };
52
+ });
53
+
54
+ exports.GroupBoxContent = GroupBoxContent;
55
+ exports.GroupBoxWrapper = GroupBoxWrapper;
56
+ exports.Label = Label;
package/cjs/constants.js CHANGED
@@ -1,40 +1,12 @@
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 constants_exports = {};
29
- __export(constants_exports, {
30
- BOX_TYPES: () => BOX_TYPES,
31
- BOX_TYPES_ARRAY: () => BOX_TYPES_ARRAY
32
- });
33
- var React = __toESM(require("react"));
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
34
5
  const BOX_TYPES = {
35
- CATEGORY: "category-box",
36
- GROUP: "group-box"
6
+ CATEGORY: 'category-box',
7
+ GROUP: 'group-box'
37
8
  };
38
9
  const BOX_TYPES_ARRAY = [BOX_TYPES.CATEGORY, BOX_TYPES.GROUP];
39
- module.exports = __toCommonJS(constants_exports);
40
- //# sourceMappingURL=constants.js.map
10
+
11
+ exports.BOX_TYPES = BOX_TYPES;
12
+ exports.BOX_TYPES_ARRAY = BOX_TYPES_ARRAY;
package/cjs/index.js CHANGED
@@ -1,37 +1,14 @@
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 src_exports = {};
29
- __export(src_exports, {
30
- default: () => import_DSGroupBox.default
31
- });
32
- var React = __toESM(require("react"));
33
- __reExport(src_exports, require("./DSGroupBox"));
34
- __reExport(src_exports, require("./constants"));
35
- var import_DSGroupBox = require("./DSGroupBox");
36
- module.exports = __toCommonJS(src_exports);
37
- //# sourceMappingURL=index.js.map
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var DSGroupBox = require('./DSGroupBox.js');
6
+ var constants = require('./constants.js');
7
+
8
+
9
+
10
+ exports.DSGroupBox = DSGroupBox.DSGroupBox;
11
+ exports.DSGroupBoxWithSchema = DSGroupBox.DSGroupBoxWithSchema;
12
+ exports["default"] = DSGroupBox.DSGroupBox;
13
+ exports.BOX_TYPES = constants.BOX_TYPES;
14
+ exports.BOX_TYPES_ARRAY = constants.BOX_TYPES_ARRAY;
package/esm/ActionItem.js CHANGED
@@ -1,26 +1,17 @@
1
- import * as React from "react";
2
- import React2 from "react";
3
- import styled from "styled-components";
4
- import { __UNSAFE_SPACE_TO_DIMSUM } from "@elliemae/ds-system";
5
- import PropTypes from "prop-types";
6
- const ActionItemNode = styled.div`
7
- padding-right: ${(props) => __UNSAFE_SPACE_TO_DIMSUM(props.theme.space.xs)};
8
- font-weight: 300;
9
- overflow: hidden;
10
- align-items: center;
11
- display: flex;
12
- &:last-child {
13
- padding-right: 0;
14
- }
15
- `;
16
- function ActionItem({ children }) {
17
- return /* @__PURE__ */ React2.createElement(ActionItemNode, null, children);
1
+ import _jsx from '@babel/runtime/helpers/esm/jsx';
2
+ import 'react';
3
+ import styled from 'styled-components';
4
+ import { __UNSAFE_SPACE_TO_DIMSUM } from '@elliemae/ds-system';
5
+
6
+ const ActionItemNode = /*#__PURE__*/styled.div.withConfig({
7
+ componentId: "sc-1ysc0gb-0"
8
+ })(["padding-right:", ";font-weight:300;overflow:hidden;align-items:center;display:flex;&:last-child{padding-right:0;}"], props => __UNSAFE_SPACE_TO_DIMSUM(props.theme.space.xs));
9
+
10
+ function ActionItem(_ref) {
11
+ let {
12
+ children
13
+ } = _ref;
14
+ return /*#__PURE__*/_jsx(ActionItemNode, {}, void 0, children);
18
15
  }
19
- ActionItem.propTypes = {
20
- children: PropTypes.node.isRequired
21
- };
22
- var ActionItem_default = ActionItem;
23
- export {
24
- ActionItem_default as default
25
- };
26
- //# sourceMappingURL=ActionItem.js.map
16
+
17
+ export { ActionItem as default };
package/esm/Actions.js CHANGED
@@ -1,35 +1,27 @@
1
- import * as React from "react";
2
- import React2 from "react";
3
- import PropTypes from "prop-types";
4
- import styled from "styled-components";
5
- import { space } from "@xstyled/styled-components";
6
- import { __UNSAFE_SPACE_TO_DIMSUM } from "@elliemae/ds-system";
7
- import ActionItem from "./ActionItem";
8
- const ActionsNode = styled.div`
9
- display: flex;
10
- flex-direction: row;
11
- padding-left: ${(props) => __UNSAFE_SPACE_TO_DIMSUM(props.theme.space.m)};
12
- overflow: hidden;
13
- ${space}
14
- `;
15
- function Actions({ actions = [], centerActions, rightActions }) {
16
- if (actions.length < 1)
17
- return null;
18
- return /* @__PURE__ */ React2.createElement(ActionsNode, {
19
- marginLeft: !!rightActions && "auto",
20
- marginRight: !!centerActions && "auto"
21
- }, actions.map((action, key) => /* @__PURE__ */ React2.createElement(ActionItem, {
22
- key
23
- }, action)));
1
+ import _jsx from '@babel/runtime/helpers/esm/jsx';
2
+ import 'core-js/modules/esnext.async-iterator.map.js';
3
+ import 'core-js/modules/esnext.iterator.map.js';
4
+ import 'react';
5
+ import styled from 'styled-components';
6
+ import { space } from '@xstyled/styled-components';
7
+ import { __UNSAFE_SPACE_TO_DIMSUM } from '@elliemae/ds-system';
8
+ import ActionItem from './ActionItem.js';
9
+
10
+ const ActionsNode = /*#__PURE__*/styled.div.withConfig({
11
+ componentId: "sc-1umfb8g-0"
12
+ })(["display:flex;flex-direction:row;padding-left:", ";overflow:hidden;", ""], props => __UNSAFE_SPACE_TO_DIMSUM(props.theme.space.m), space);
13
+
14
+ function Actions(_ref) {
15
+ let {
16
+ actions = [],
17
+ centerActions,
18
+ rightActions
19
+ } = _ref;
20
+ if (actions.length < 1) return null;
21
+ return /*#__PURE__*/_jsx(ActionsNode, {
22
+ marginLeft: !!rightActions && 'auto',
23
+ marginRight: !!centerActions && 'auto'
24
+ }, void 0, actions.map((action, key) => /*#__PURE__*/_jsx(ActionItem, {}, key, action)));
24
25
  }
25
- Actions.propTypes = {
26
- actions: PropTypes.array,
27
- centerActions: PropTypes.bool,
28
- rightActions: PropTypes.bool
29
- };
30
- var Actions_default = Actions;
31
- export {
32
- Actions,
33
- Actions_default as default
34
- };
35
- //# sourceMappingURL=Actions.js.map
26
+
27
+ export { Actions, Actions as default };
package/esm/DSGroupBox.js CHANGED
@@ -1,77 +1,128 @@
1
- import * as React from "react";
2
- import React2 from "react";
3
- import { PropTypes, describe } from "react-desc";
4
- import { GroupBoxWrapper, GroupBoxContent } from "./components/blocks";
5
- import { DSGroupBoxHeader } from "./components/GroupHeader";
6
- import { BOX_TYPES, BOX_TYPES_ARRAY } from "./constants";
7
- const DSGroupBox = ({
8
- containerProps = {},
9
- labelProps = {
10
- labelText: "",
11
- borderBottom: false,
12
- id: "ds-group-box__header"
13
- },
14
- rightActions = [],
15
- centerActions = [],
16
- type = BOX_TYPES.CATEGORY,
17
- asRow = false,
18
- onlyHeader = false,
19
- noBorder = true,
20
- noPadding = false,
21
- children: components = [],
22
- isMain = true
23
- }) => {
24
- const { labelText } = labelProps;
25
- return /* @__PURE__ */ React2.createElement(GroupBoxWrapper, {
26
- ...containerProps,
27
- classProps: { onlyHeader, noBorder, type, isMain }
28
- }, labelText && /* @__PURE__ */ React2.createElement(DSGroupBoxHeader, {
29
- centerActions,
30
- isMain,
31
- labelProps,
32
- noBorder,
33
- rightActions,
34
- type
35
- }), /* @__PURE__ */ React2.createElement(GroupBoxContent, {
1
+ import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
2
+ import _jsx from '@babel/runtime/helpers/esm/jsx';
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 { PropTypes, describe } from 'react-desc';
12
+ import { GroupBoxWrapper, GroupBoxContent } from './components/blocks.js';
13
+ import { DSGroupBoxHeader } from './components/GroupHeader.js';
14
+ import { BOX_TYPES_ARRAY, BOX_TYPES } from './constants.js';
15
+ import { jsxs } from 'react/jsx-runtime';
16
+
17
+ 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; }
18
+
19
+ 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; }
20
+
21
+ const DSGroupBox = _ref => {
22
+ let {
23
+ containerProps = {},
24
+ labelProps = {
25
+ labelText: '',
26
+ borderBottom: false,
27
+ id: 'ds-group-box__header'
28
+ },
29
+ rightActions = [],
30
+ centerActions = [],
31
+ type = BOX_TYPES.CATEGORY,
32
+ asRow = false,
33
+ onlyHeader = false,
34
+ noBorder = true,
35
+ noPadding = false,
36
+ children: components = [],
37
+ // eslint-disable-next-line react/prop-types
38
+ isMain = true
39
+ } = _ref;
40
+ const {
41
+ labelText
42
+ } = labelProps;
43
+ return /*#__PURE__*/jsxs(GroupBoxWrapper, _objectSpread(_objectSpread({}, containerProps), {}, {
36
44
  classProps: {
37
- type,
38
- asRow,
39
45
  onlyHeader,
40
- noPadding,
41
46
  noBorder,
42
- noBorderTop: !!labelText
43
- }
44
- }, components && components.props ? React2.Children.map(components, (component) => React2.cloneElement(component, {
45
- ...component.props,
46
- isMain: false
47
- }), null) : components));
47
+ type,
48
+ isMain
49
+ },
50
+ children: [labelText && /*#__PURE__*/_jsx(DSGroupBoxHeader, {
51
+ centerActions: centerActions,
52
+ isMain: isMain,
53
+ labelProps: labelProps,
54
+ noBorder: noBorder,
55
+ rightActions: rightActions,
56
+ type: type
57
+ }), /*#__PURE__*/_jsx(GroupBoxContent, {
58
+ classProps: {
59
+ type,
60
+ asRow,
61
+ onlyHeader,
62
+ noPadding,
63
+ noBorder,
64
+ noBorderTop: !!labelText
65
+ }
66
+ }, void 0, components && components.props ? React.Children.map(components, component => /*#__PURE__*/React.cloneElement(component, _objectSpread(_objectSpread({}, component.props), {}, {
67
+ isMain: false
68
+ })), null) : components)]
69
+ }));
48
70
  };
71
+
49
72
  const props = {
50
- containerProps: PropTypes.object.description("props to inject to wrapper"),
73
+ /** props to inject to wrapper */
74
+ containerProps: PropTypes.object.description('props to inject to wrapper'),
75
+
76
+ /**
77
+ * Label attributes to be rendered
78
+ */
51
79
  labelProps: PropTypes.shape({
52
80
  labelText: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
53
81
  borderBottom: PropTypes.bool,
54
82
  id: PropTypes.string
55
- }).description("Label attributes to be rendered"),
83
+ }).description('Label attributes to be rendered'),
84
+
85
+ /**
86
+ * ['category-box', 'group-box']
87
+ */
56
88
  type: PropTypes.oneOf(BOX_TYPES_ARRAY).description(BOX_TYPES_ARRAY.toString()),
57
- children: PropTypes.oneOfType([
58
- PropTypes.element,
59
- PropTypes.arrayOf(PropTypes.element)
60
- ]).isRequired.description("Components to be rendered inside the box"),
61
- rightActions: PropTypes.arrayOf(PropTypes.element).description("Actions on the right side of the label"),
62
- centerActions: PropTypes.arrayOf(PropTypes.element).description("Actions on the next to the label"),
63
- asRow: PropTypes.bool.description("Display the content of the group box with flex direction row"),
64
- onlyHeader: PropTypes.bool.description("Show border only on the header"),
65
- noBorder: PropTypes.bool.description("Remove the wrapper border"),
66
- noPadding: PropTypes.bool.description("Remove the top and bottom padding from the content")
89
+
90
+ /**
91
+ * Components to be rendered inside the box
92
+ */
93
+ children: PropTypes.oneOfType([PropTypes.element, PropTypes.arrayOf(PropTypes.element)]).isRequired.description('Components to be rendered inside the box'),
94
+
95
+ /**
96
+ * Actions on the right side of the label
97
+ */
98
+ rightActions: PropTypes.arrayOf(PropTypes.element).description('Actions on the right side of the label'),
99
+
100
+ /**
101
+ * Actions on the next to the label
102
+ */
103
+ centerActions: PropTypes.arrayOf(PropTypes.element).description('Actions on the next to the label'),
104
+
105
+ /**
106
+ * Display the content of the group box with flex direction row
107
+ */
108
+ asRow: PropTypes.bool.description('Display the content of the group box with flex direction row'),
109
+
110
+ /**
111
+ * Show border only on the header
112
+ */
113
+ onlyHeader: PropTypes.bool.description('Show border only on the header'),
114
+
115
+ /**
116
+ * Remove the wrapper border
117
+ */
118
+ noBorder: PropTypes.bool.description('Remove the wrapper border'),
119
+
120
+ /**
121
+ * Remove the top and bottom padding from the content
122
+ */
123
+ noPadding: PropTypes.bool.description('Remove the top and bottom padding from the content')
67
124
  };
68
- DSGroupBox.propTypes = props;
69
125
  const DSGroupBoxWithSchema = describe(DSGroupBox);
70
126
  DSGroupBoxWithSchema.propTypes = props;
71
- var DSGroupBox_default = DSGroupBox;
72
- export {
73
- DSGroupBox,
74
- DSGroupBoxWithSchema,
75
- DSGroupBox_default as default
76
- };
77
- //# sourceMappingURL=DSGroupBox.js.map
127
+
128
+ export { DSGroupBox, DSGroupBoxWithSchema, DSGroupBox as default };