@elliemae/ds-card 2.2.0-alpha.3 → 3.0.0-next.0
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/cjs/DSCard.js +67 -62
- package/cjs/DSCardBody.js +28 -45
- package/cjs/DSCardHeader.js +39 -52
- package/cjs/detail/DetailCard.js +194 -150
- package/cjs/detail/styled.js +59 -105
- package/cjs/index.js +29 -42
- package/cjs/v2/ActionAddon.js +54 -69
- package/cjs/v2/Card.js +83 -77
- package/cjs/v2/Group.js +64 -77
- package/cjs/v2/components.js +54 -104
- package/esm/DSCard.js +53 -30
- package/esm/DSCardBody.js +18 -16
- package/esm/DSCardHeader.js +28 -22
- package/esm/detail/DetailCard.js +180 -119
- package/esm/detail/styled.js +45 -77
- package/esm/index.js +7 -13
- package/esm/v2/ActionAddon.js +42 -40
- package/esm/v2/Card.js +72 -59
- package/esm/v2/Group.js +53 -48
- package/esm/v2/components.js +38 -75
- package/package.json +10 -10
- package/cjs/DSCard.js.map +0 -7
- package/cjs/DSCardBody.js.map +0 -7
- package/cjs/DSCardHeader.js.map +0 -7
- package/cjs/detail/DetailCard.js.map +0 -7
- package/cjs/detail/styled.js.map +0 -7
- package/cjs/index.js.map +0 -7
- package/cjs/v2/ActionAddon.js.map +0 -7
- package/cjs/v2/Card.js.map +0 -7
- package/cjs/v2/Group.js.map +0 -7
- package/cjs/v2/components.js.map +0 -7
- package/esm/DSCard.js.map +0 -7
- package/esm/DSCardBody.js.map +0 -7
- package/esm/DSCardHeader.js.map +0 -7
- package/esm/detail/DetailCard.js.map +0 -7
- package/esm/detail/styled.js.map +0 -7
- package/esm/index.js.map +0 -7
- package/esm/v2/ActionAddon.js.map +0 -7
- package/esm/v2/Card.js.map +0 -7
- package/esm/v2/Group.js.map +0 -7
- package/esm/v2/components.js.map +0 -7
package/esm/DSCard.js
CHANGED
|
@@ -1,38 +1,61 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
2
|
+
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
3
|
+
import 'core-js/modules/esnext.iterator.filter.js';
|
|
4
|
+
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
5
|
+
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
6
|
+
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
7
|
+
import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
|
|
8
|
+
import 'react';
|
|
9
|
+
import { PropTypes, describe } from 'react-desc';
|
|
10
|
+
import { convertPropToCssClassName } from '@elliemae/ds-classnames';
|
|
11
|
+
import { DSCardBody } from './DSCardBody.js';
|
|
12
|
+
import { DSCardHeader } from './DSCardHeader.js';
|
|
13
|
+
import { jsx } from 'react/jsx-runtime';
|
|
14
|
+
|
|
15
|
+
const _excluded = ["innerRef", "children", "containerProps"];
|
|
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 DSCard = _ref => {
|
|
22
|
+
let {
|
|
23
|
+
innerRef = undefined,
|
|
24
|
+
children = null,
|
|
25
|
+
containerProps = {}
|
|
26
|
+
} = _ref,
|
|
27
|
+
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
28
|
+
|
|
29
|
+
const {
|
|
30
|
+
cssClassName
|
|
31
|
+
} = convertPropToCssClassName('card');
|
|
32
|
+
return /*#__PURE__*/jsx("div", _objectSpread(_objectSpread(_objectSpread({
|
|
33
|
+
"data-testid": "card"
|
|
34
|
+
}, containerProps), {}, {
|
|
17
35
|
ref: innerRef,
|
|
18
|
-
className: cssClassName
|
|
19
|
-
|
|
20
|
-
|
|
36
|
+
className: cssClassName
|
|
37
|
+
}, otherProps), {}, {
|
|
38
|
+
children: children
|
|
39
|
+
}));
|
|
21
40
|
};
|
|
41
|
+
|
|
22
42
|
const cardProps = {
|
|
23
|
-
|
|
24
|
-
|
|
43
|
+
/** inject props to component wrapper */
|
|
44
|
+
containerProps: PropTypes.object.description('inject props to component wrapper'),
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Get reference for the button
|
|
48
|
+
*/
|
|
49
|
+
innerRef: PropTypes.string.description('Get reference for the button'),
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* DSCardBody and DSCardHeader
|
|
53
|
+
*/
|
|
25
54
|
children: PropTypes.arrayOf(PropTypes.shape({
|
|
26
55
|
type: PropTypes.oneOf([DSCardHeader, DSCardBody])
|
|
27
|
-
})).description(
|
|
56
|
+
})).description('DSCardBody and DSCardHeader')
|
|
28
57
|
};
|
|
29
|
-
DSCard.propTypes = cardProps;
|
|
30
58
|
const DSCardWithSchema = describe(DSCard);
|
|
31
59
|
DSCardWithSchema.propTypes = cardProps;
|
|
32
|
-
|
|
33
|
-
export {
|
|
34
|
-
DSCard,
|
|
35
|
-
DSCardWithSchema,
|
|
36
|
-
DSCard_default as default
|
|
37
|
-
};
|
|
38
|
-
//# sourceMappingURL=DSCard.js.map
|
|
60
|
+
|
|
61
|
+
export { DSCard, DSCardWithSchema, DSCard as default };
|
package/esm/DSCardBody.js
CHANGED
|
@@ -1,20 +1,22 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { PropTypes, describe } from
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
+
import 'react';
|
|
3
|
+
import { PropTypes, describe } from 'react-desc';
|
|
4
|
+
|
|
5
|
+
const DSCardBody = _ref => {
|
|
6
|
+
let {
|
|
7
|
+
children
|
|
8
|
+
} = _ref;
|
|
9
|
+
return /*#__PURE__*/_jsx("div", {
|
|
10
|
+
className: "em-ds-card-body",
|
|
11
|
+
"data-testid": "card-body"
|
|
12
|
+
}, void 0, children);
|
|
13
|
+
};
|
|
14
|
+
|
|
8
15
|
const bodyProps = {
|
|
9
|
-
children
|
|
16
|
+
/** children */
|
|
17
|
+
children: PropTypes.element.description('children')
|
|
10
18
|
};
|
|
11
|
-
DSCardBody.propTypes = bodyProps;
|
|
12
19
|
const DSCardBodyWithSchema = describe(DSCardBody);
|
|
13
20
|
DSCardBodyWithSchema.propTypes = bodyProps;
|
|
14
|
-
|
|
15
|
-
export {
|
|
16
|
-
DSCardBody,
|
|
17
|
-
DSCardBodyWithSchema,
|
|
18
|
-
DSCardBody_default as default
|
|
19
|
-
};
|
|
20
|
-
//# sourceMappingURL=DSCardBody.js.map
|
|
21
|
+
|
|
22
|
+
export { DSCardBody, DSCardBodyWithSchema, DSCardBody as default };
|
package/esm/DSCardHeader.js
CHANGED
|
@@ -1,30 +1,36 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { PropTypes, describe } from
|
|
4
|
-
import { convertPropToCssClassName } from
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
+
import 'react';
|
|
3
|
+
import { PropTypes, describe } from 'react-desc';
|
|
4
|
+
import { convertPropToCssClassName } from '@elliemae/ds-classnames';
|
|
5
|
+
|
|
6
|
+
const DSCardHeader = _ref => {
|
|
7
|
+
let {
|
|
8
|
+
title,
|
|
9
|
+
action
|
|
10
|
+
} = _ref;
|
|
11
|
+
const {
|
|
12
|
+
cssClassName,
|
|
13
|
+
classNameElement
|
|
14
|
+
} = convertPropToCssClassName('card-header');
|
|
15
|
+
return /*#__PURE__*/_jsx("div", {
|
|
8
16
|
className: cssClassName,
|
|
9
17
|
"data-testid": "card-header"
|
|
10
|
-
},
|
|
11
|
-
className: classNameElement(
|
|
12
|
-
}, title),
|
|
13
|
-
className: classNameElement(
|
|
18
|
+
}, void 0, /*#__PURE__*/_jsx("span", {
|
|
19
|
+
className: classNameElement('heading')
|
|
20
|
+
}, void 0, title), /*#__PURE__*/_jsx("div", {
|
|
21
|
+
className: classNameElement('pull-right'),
|
|
14
22
|
"data-testid": "ds-card_header-action"
|
|
15
|
-
}, action));
|
|
23
|
+
}, void 0, action));
|
|
16
24
|
};
|
|
25
|
+
|
|
17
26
|
const cardHeader = {
|
|
18
|
-
|
|
19
|
-
|
|
27
|
+
/** card header title */
|
|
28
|
+
title: PropTypes.string.description('card header title'),
|
|
29
|
+
|
|
30
|
+
/** action */
|
|
31
|
+
action: PropTypes.node.description('action')
|
|
20
32
|
};
|
|
21
|
-
DSCardHeader.propTypes = cardHeader;
|
|
22
33
|
const DSCardHeaderWithSchema = describe(DSCardHeader);
|
|
23
34
|
DSCardHeaderWithSchema.propTypes = cardHeader;
|
|
24
|
-
|
|
25
|
-
export {
|
|
26
|
-
DSCardHeader,
|
|
27
|
-
DSCardHeaderWithSchema,
|
|
28
|
-
DSCardHeader_default as default
|
|
29
|
-
};
|
|
30
|
-
//# sourceMappingURL=DSCardHeader.js.map
|
|
35
|
+
|
|
36
|
+
export { DSCardHeader, DSCardHeaderWithSchema, DSCardHeader as default };
|
package/esm/detail/DetailCard.js
CHANGED
|
@@ -1,127 +1,188 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { compact, noop } from
|
|
4
|
-
import { PropTypes, describe } from
|
|
5
|
-
import { ArrowheadDown, ArrowheadRight } from
|
|
6
|
-
import { useTheme } from
|
|
7
|
-
import DSButton from
|
|
8
|
-
import DSSeparator from
|
|
9
|
-
import { Grid } from
|
|
10
|
-
import { DSCheckbox } from
|
|
11
|
-
import { Container, Title, Description,
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
1
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
+
import 'react';
|
|
3
|
+
import { compact, noop } from 'lodash';
|
|
4
|
+
import { PropTypes, describe } from 'react-desc';
|
|
5
|
+
import { ArrowheadDown, ArrowheadRight } from '@elliemae/ds-icons';
|
|
6
|
+
import { useTheme } from '@elliemae/ds-system';
|
|
7
|
+
import DSButton from '@elliemae/ds-button';
|
|
8
|
+
import DSSeparator from '@elliemae/ds-separator';
|
|
9
|
+
import { Grid } from '@elliemae/ds-grid';
|
|
10
|
+
import { DSCheckbox } from '@elliemae/ds-form';
|
|
11
|
+
import { Container, Title, Description, RightDescription, RightValue, RightAddon } from './styled.js';
|
|
12
|
+
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
13
|
+
|
|
14
|
+
var _Grid, _DSSeparator;
|
|
15
|
+
|
|
16
|
+
const DetailCard = _ref => {
|
|
17
|
+
let {
|
|
18
|
+
title,
|
|
19
|
+
description,
|
|
20
|
+
descriptionColor = 'neutral',
|
|
21
|
+
rightValue,
|
|
22
|
+
rightDescription,
|
|
23
|
+
rightAddon,
|
|
24
|
+
// select props
|
|
25
|
+
selectable = false,
|
|
26
|
+
isSelected = false,
|
|
27
|
+
onSelect = noop,
|
|
28
|
+
// expand props
|
|
29
|
+
expandable = false,
|
|
30
|
+
isExpanded = false,
|
|
31
|
+
onExpand = noop,
|
|
32
|
+
expandContent,
|
|
33
|
+
// state props
|
|
34
|
+
readOnly = false,
|
|
35
|
+
disabled = false
|
|
36
|
+
} = _ref;
|
|
29
37
|
const theme = useTheme();
|
|
30
38
|
const hasRightLegend = rightValue && rightDescription;
|
|
31
39
|
const hasRightPosition = hasRightLegend || rightAddon;
|
|
32
|
-
const topWrapperCols = [
|
|
33
|
-
if (hasRightPosition)
|
|
34
|
-
|
|
35
|
-
if (
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}),
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
}, expandContent))));
|
|
40
|
+
const topWrapperCols = ['1fr'];
|
|
41
|
+
if (hasRightPosition) topWrapperCols.push('auto');
|
|
42
|
+
if (expandable) topWrapperCols.unshift('20px');
|
|
43
|
+
if (selectable) topWrapperCols.unshift(theme.space.s);
|
|
44
|
+
return /*#__PURE__*/jsx(Fragment, {
|
|
45
|
+
children: /*#__PURE__*/_jsx(Container, {
|
|
46
|
+
disabled: disabled || readOnly,
|
|
47
|
+
active: selectable && isSelected,
|
|
48
|
+
"data-testid": "card-detail-container"
|
|
49
|
+
}, void 0, /*#__PURE__*/_jsx(Grid, {
|
|
50
|
+
cols: topWrapperCols,
|
|
51
|
+
alignItems: !description && 'center'
|
|
52
|
+
}, void 0, selectable && /*#__PURE__*/_jsx(Grid, {
|
|
53
|
+
pt: description && '9px'
|
|
54
|
+
}, void 0, /*#__PURE__*/_jsx(DSCheckbox, {
|
|
55
|
+
checked: isSelected,
|
|
56
|
+
onChange: onSelect,
|
|
57
|
+
readOnly: readOnly,
|
|
58
|
+
disabled: disabled,
|
|
59
|
+
"data-testid": "card-checkbox"
|
|
60
|
+
})), expandable && /*#__PURE__*/_jsx(Grid, {
|
|
61
|
+
height: "16px",
|
|
62
|
+
pt: description && 'xxs',
|
|
63
|
+
mt: !description && '-5px'
|
|
64
|
+
}, void 0, /*#__PURE__*/_jsx(DSButton, {
|
|
65
|
+
size: "s",
|
|
66
|
+
buttonType: "text",
|
|
67
|
+
containerProps: {
|
|
68
|
+
'data-testid': 'expand-button'
|
|
69
|
+
},
|
|
70
|
+
onClick: onExpand,
|
|
71
|
+
icon: isExpanded ? /*#__PURE__*/_jsx(ArrowheadDown, {
|
|
72
|
+
color: ['neutral', 500],
|
|
73
|
+
size: "s"
|
|
74
|
+
}) : /*#__PURE__*/_jsx(ArrowheadRight, {
|
|
75
|
+
color: ['neutral', 500],
|
|
76
|
+
size: "s"
|
|
77
|
+
}),
|
|
78
|
+
disabled: disabled
|
|
79
|
+
})), /*#__PURE__*/_jsx(Grid, {
|
|
80
|
+
pr: "24px"
|
|
81
|
+
}, void 0, /*#__PURE__*/_jsx(Title, {}, void 0, title), description && /*#__PURE__*/_jsx(Description, {
|
|
82
|
+
descriptionColor: descriptionColor
|
|
83
|
+
}, void 0, description)), hasRightPosition && /*#__PURE__*/_jsx(Grid, {
|
|
84
|
+
cols: compact([hasRightPosition && 'auto', rightAddon && 'auto'])
|
|
85
|
+
}, void 0, hasRightLegend && /*#__PURE__*/_jsx(Grid, {
|
|
86
|
+
pr: "24px",
|
|
87
|
+
rows: ['auto', 'auto', 1]
|
|
88
|
+
}, void 0, /*#__PURE__*/_jsx(RightDescription, {
|
|
89
|
+
justifyContent: "flex-end"
|
|
90
|
+
}, void 0, rightDescription), /*#__PURE__*/_jsx(RightValue, {
|
|
91
|
+
justifyContent: "flex-end"
|
|
92
|
+
}, void 0, rightValue), _Grid || (_Grid = /*#__PURE__*/_jsx(Grid, {}))), rightAddon && /*#__PURE__*/_jsx(RightAddon, {
|
|
93
|
+
cols: ['auto', 'auto'],
|
|
94
|
+
gutter: "2px"
|
|
95
|
+
}, void 0, rightAddon))), expandContent && isExpanded && /*#__PURE__*/_jsx(Grid, {
|
|
96
|
+
ml: selectable && 's',
|
|
97
|
+
mr: rightAddon && 'xs'
|
|
98
|
+
}, void 0, _DSSeparator || (_DSSeparator = /*#__PURE__*/_jsx(DSSeparator, {
|
|
99
|
+
dashed: true,
|
|
100
|
+
position: "initial",
|
|
101
|
+
margin: "none"
|
|
102
|
+
})), /*#__PURE__*/_jsx(Grid, {
|
|
103
|
+
pt: "xxs",
|
|
104
|
+
"data-testid": "detail-card-expanded-content"
|
|
105
|
+
}, void 0, expandContent)))
|
|
106
|
+
});
|
|
100
107
|
};
|
|
108
|
+
|
|
101
109
|
const detailProps = {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
110
|
+
/**
|
|
111
|
+
* Title of the card.
|
|
112
|
+
*/
|
|
113
|
+
title: PropTypes.string.isRequired.description('Title of the card.'),
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Description of the card.
|
|
117
|
+
*/
|
|
118
|
+
description: PropTypes.string.description('Description of the card.'),
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Description color.
|
|
122
|
+
*/
|
|
123
|
+
descriptionColor: PropTypes.oneOf(['primary', 'neutral']).description('Description color.'),
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Right value (should be used with `rightDescription`)
|
|
127
|
+
*/
|
|
128
|
+
rightValue: PropTypes.string.description('Right value (should be used with `rightDescription`)'),
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Right description (should be used with `rightValue`)
|
|
132
|
+
*/
|
|
133
|
+
rightDescription: PropTypes.string.description('Right description (should be used with `rightValue`)'),
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Right addon array, max elements: 2
|
|
137
|
+
*/
|
|
138
|
+
rightAddon: PropTypes.element.description('Right addon array, max elements: 2'),
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Whether if the card is selectable or not
|
|
142
|
+
*/
|
|
143
|
+
selectable: PropTypes.bool.description('Whether if the card is selectable or not'),
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Whether if the card is selected or not
|
|
147
|
+
*/
|
|
148
|
+
isSelected: PropTypes.bool.description('Whether if the card is selected or not'),
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Callback on selection
|
|
152
|
+
*/
|
|
153
|
+
onSelect: PropTypes.func.description('Callback on selection'),
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Whether if the card is expandable or not
|
|
157
|
+
*/
|
|
158
|
+
expandable: PropTypes.bool.description('Whether if the card is expandable or not'),
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Whether if the card is expanded or not
|
|
162
|
+
*/
|
|
163
|
+
isExpanded: PropTypes.bool.description('Whether if the card is expanded or not'),
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Callback on expand
|
|
167
|
+
*/
|
|
168
|
+
onExpand: PropTypes.func.description('Callback on expand'),
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Content
|
|
172
|
+
*/
|
|
173
|
+
expandContent: PropTypes.element.description('Content'),
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Read only
|
|
177
|
+
*/
|
|
178
|
+
readOnly: PropTypes.bool.description('Read only'),
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Disabled
|
|
182
|
+
*/
|
|
183
|
+
disabled: PropTypes.bool.description('Disabled')
|
|
117
184
|
};
|
|
118
|
-
DetailCard.propTypes = detailProps;
|
|
119
185
|
const DSCardDetailWithSchema = describe(DetailCard);
|
|
120
186
|
DSCardDetailWithSchema.propTypes = detailProps;
|
|
121
|
-
|
|
122
|
-
export {
|
|
123
|
-
DSCardDetailWithSchema,
|
|
124
|
-
DetailCard,
|
|
125
|
-
DetailCard_default as default
|
|
126
|
-
};
|
|
127
|
-
//# sourceMappingURL=DetailCard.js.map
|
|
187
|
+
|
|
188
|
+
export { DSCardDetailWithSchema, DetailCard, DetailCard as default };
|
package/esm/detail/styled.js
CHANGED
|
@@ -1,78 +1,46 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
const Separator = styled.div
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
font-size: 12px;
|
|
33
|
-
color: ${(props) => props.theme.colors.neutral["600"]};
|
|
34
|
-
`;
|
|
35
|
-
const RightValue = styled(Grid)`
|
|
36
|
-
margin: 0;
|
|
37
|
-
white-space: nowrap;
|
|
38
|
-
font-size: 14px;
|
|
39
|
-
color: ${(props) => props.theme.colors.neutral["800"]};
|
|
40
|
-
`;
|
|
41
|
-
const ExpandContent = styled.div`
|
|
42
|
-
font-size: 12px;
|
|
43
|
-
`;
|
|
44
|
-
const border = ({ active, theme }) => active ? theme.colors.brand["600"] : theme.colors.neutral["200"];
|
|
45
|
-
const background = ({ active, theme }) => active ? theme.colors.brand["100"] : theme.colors.neutral["000"];
|
|
46
|
-
const Container = styled(Grid)`
|
|
47
|
-
width: 100%;
|
|
48
|
-
min-height: 52px;
|
|
49
|
-
min-width: 244px;
|
|
50
|
-
padding: 6px 8px 6px 12px;
|
|
51
|
-
position: relative;
|
|
52
|
-
border-top: 1px solid ${border};
|
|
53
|
-
border-bottom: 1px solid ${border};
|
|
54
|
-
background: ${background};
|
|
55
|
-
${(props) => props.disabled ? `
|
|
56
|
-
${Title}, ${Description}, ${RightDescription}, ${RightValue} {
|
|
57
|
-
color: ${props.theme.colors.neutral["500"]};
|
|
58
|
-
}
|
|
59
|
-
` : ""}
|
|
60
|
-
&:hover {
|
|
61
|
-
box-shadow: 0 2px 4px 0 rgba(53, 60, 70, 0.5);
|
|
62
|
-
z-index: 1;
|
|
63
|
-
}
|
|
64
|
-
/* & + ${Container} {
|
|
65
|
-
border-top-color: blue;
|
|
66
|
-
} */
|
|
67
|
-
`;
|
|
68
|
-
export {
|
|
69
|
-
Container,
|
|
70
|
-
Description,
|
|
71
|
-
ExpandContent,
|
|
72
|
-
RightAddon,
|
|
73
|
-
RightDescription,
|
|
74
|
-
RightValue,
|
|
75
|
-
Separator,
|
|
76
|
-
Title
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import { Grid } from '@elliemae/ds-grid';
|
|
3
|
+
|
|
4
|
+
const Separator = /*#__PURE__*/styled.div.withConfig({
|
|
5
|
+
componentId: "sc-nx8lwv-0"
|
|
6
|
+
})(["width:100%;height:24px;border-right:1px solid ", ";margin:0 8px;"], props => props.theme.colors.neutral['300']);
|
|
7
|
+
const Title = /*#__PURE__*/styled.h3.withConfig({
|
|
8
|
+
componentId: "sc-nx8lwv-1"
|
|
9
|
+
})(["margin:0;font-size:16px;min-height:20px;font-weight:", ";color:", ";"], props => props.theme.fontWeights.semibold, props => props.theme.colors.neutral['700']);
|
|
10
|
+
const Description = /*#__PURE__*/styled.p.withConfig({
|
|
11
|
+
componentId: "sc-nx8lwv-2"
|
|
12
|
+
})(["margin:0;font-size:12px;min-height:18px;display:flex;align-items:center;color:", ";"], props => props.descriptionColor === 'neutral' ? props.theme.colors.neutral['600'] : props.theme.colors.brand['600']);
|
|
13
|
+
const RightAddon = /*#__PURE__*/styled(Grid).withConfig({
|
|
14
|
+
componentId: "sc-nx8lwv-3"
|
|
15
|
+
})(["margin:0;white-space:nowrap;"]);
|
|
16
|
+
const RightDescription = /*#__PURE__*/styled(Grid).withConfig({
|
|
17
|
+
componentId: "sc-nx8lwv-4"
|
|
18
|
+
})(["margin:0;white-space:nowrap;font-size:12px;color:", ";"], props => props.theme.colors.neutral['600']);
|
|
19
|
+
const RightValue = /*#__PURE__*/styled(Grid).withConfig({
|
|
20
|
+
componentId: "sc-nx8lwv-5"
|
|
21
|
+
})(["margin:0;white-space:nowrap;font-size:14px;color:", ";"], props => props.theme.colors.neutral['800']);
|
|
22
|
+
const ExpandContent = /*#__PURE__*/styled.div.withConfig({
|
|
23
|
+
componentId: "sc-nx8lwv-6"
|
|
24
|
+
})(["font-size:12px;"]);
|
|
25
|
+
|
|
26
|
+
const border = _ref => {
|
|
27
|
+
let {
|
|
28
|
+
active,
|
|
29
|
+
theme
|
|
30
|
+
} = _ref;
|
|
31
|
+
return active ? theme.colors.brand['600'] : theme.colors.neutral['200'];
|
|
77
32
|
};
|
|
78
|
-
|
|
33
|
+
|
|
34
|
+
const background = _ref2 => {
|
|
35
|
+
let {
|
|
36
|
+
active,
|
|
37
|
+
theme
|
|
38
|
+
} = _ref2;
|
|
39
|
+
return active ? theme.colors.brand['100'] : theme.colors.neutral['000'];
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
const Container = /*#__PURE__*/styled(Grid).withConfig({
|
|
43
|
+
componentId: "sc-nx8lwv-7"
|
|
44
|
+
})(["width:100%;min-height:52px;min-width:244px;padding:6px 8px 6px 12px;position:relative;border-top:1px solid ", ";border-bottom:1px solid ", ";background:", ";", " &:hover{box-shadow:0 2px 4px 0 rgba(53,60,70,0.5);z-index:1;}"], border, border, background, props => props.disabled ? "\n ".concat(Title, ", ").concat(Description, ", ").concat(RightDescription, ", ").concat(RightValue, " {\n color: ").concat(props.theme.colors.neutral['500'], ";\n }\n ") : '');
|
|
45
|
+
|
|
46
|
+
export { Container, Description, ExpandContent, RightAddon, RightDescription, RightValue, Separator, Title };
|
package/esm/index.js
CHANGED
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export * from "./detail/DetailCard";
|
|
9
|
-
import { default as default2 } from "./DSCard";
|
|
10
|
-
export {
|
|
11
|
-
default2 as default
|
|
12
|
-
};
|
|
13
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
export { DSCard, DSCardWithSchema, DSCard as default } from './DSCard.js';
|
|
2
|
+
export { DSCardHeader, DSCardHeaderWithSchema } from './DSCardHeader.js';
|
|
3
|
+
export { DSCardBody, DSCardBodyWithSchema } from './DSCardBody.js';
|
|
4
|
+
export { CustomCard, DSCardCustomWithSchema } from './v2/Card.js';
|
|
5
|
+
export { CardGroup, DSCardGroupWithSchema } from './v2/Group.js';
|
|
6
|
+
export { ActionAddon, DSCardActionAddonWithSchema } from './v2/ActionAddon.js';
|
|
7
|
+
export { DSCardDetailWithSchema, DetailCard } from './detail/DetailCard.js';
|