@elliemae/ds-card 3.0.0-next.1 → 3.0.0-next.13
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/DSCard.js +99 -0
- package/dist/cjs/DSCard.js.map +7 -0
- package/dist/cjs/DSCardBody.js +49 -0
- package/dist/cjs/DSCardBody.js.map +7 -0
- package/dist/cjs/DSCardHeader.js +59 -0
- package/dist/cjs/DSCardHeader.js.map +7 -0
- package/dist/cjs/detail/DetailCard.js +156 -0
- package/dist/cjs/detail/DetailCard.js.map +7 -0
- package/dist/cjs/detail/styled.js +104 -0
- package/dist/cjs/detail/styled.js.map +7 -0
- package/dist/cjs/index.js +42 -0
- package/dist/cjs/index.js.map +7 -0
- package/dist/cjs/v2/ActionAddon.js +73 -0
- package/dist/cjs/v2/ActionAddon.js.map +7 -0
- package/dist/cjs/v2/Card.js +82 -0
- package/dist/cjs/v2/Card.js.map +7 -0
- package/dist/cjs/v2/Group.js +81 -0
- package/dist/cjs/v2/Group.js.map +7 -0
- package/dist/cjs/v2/components.js +104 -0
- package/dist/cjs/v2/components.js.map +7 -0
- package/dist/esm/DSCard.js +72 -0
- package/dist/esm/DSCard.js.map +7 -0
- package/dist/esm/DSCardBody.js +20 -0
- package/dist/esm/DSCardBody.js.map +7 -0
- package/dist/esm/DSCardHeader.js +30 -0
- package/dist/esm/DSCardHeader.js.map +7 -0
- package/dist/esm/detail/DetailCard.js +127 -0
- package/dist/esm/detail/DetailCard.js.map +7 -0
- package/dist/esm/detail/styled.js +75 -0
- package/dist/esm/detail/styled.js.map +7 -0
- package/dist/esm/index.js +13 -0
- package/dist/esm/index.js.map +7 -0
- package/dist/esm/v2/ActionAddon.js +44 -0
- package/dist/esm/v2/ActionAddon.js.map +7 -0
- package/dist/esm/v2/Card.js +64 -0
- package/dist/esm/v2/Card.js.map +7 -0
- package/dist/esm/v2/Group.js +52 -0
- package/dist/esm/v2/Group.js.map +7 -0
- package/dist/esm/v2/components.js +75 -0
- package/dist/esm/v2/components.js.map +7 -0
- package/package.json +52 -43
- package/cjs/DSCard.js +0 -72
- package/cjs/DSCardBody.js +0 -32
- package/cjs/DSCardHeader.js +0 -46
- package/cjs/detail/DetailCard.js +0 -200
- package/cjs/detail/styled.js +0 -61
- package/cjs/index.js +0 -29
- package/cjs/v2/ActionAddon.js +0 -58
- package/cjs/v2/Card.js +0 -88
- package/cjs/v2/Group.js +0 -68
- package/cjs/v2/components.js +0 -54
- package/esm/DSCard.js +0 -61
- package/esm/DSCardBody.js +0 -22
- package/esm/DSCardHeader.js +0 -36
- package/esm/detail/DetailCard.js +0 -188
- package/esm/detail/styled.js +0 -46
- package/esm/index.js +0 -7
- package/esm/v2/ActionAddon.js +0 -46
- package/esm/v2/Card.js +0 -77
- package/esm/v2/Group.js +0 -57
- package/esm/v2/components.js +0 -38
- package/types/DSCard.d.ts +0 -49
- package/types/DSCardBody.d.ts +0 -25
- package/types/DSCardHeader.d.ts +0 -34
- package/types/detail/DetailCard.d.ts +0 -176
- package/types/detail/styled.d.ts +0 -9
- package/types/index.d.ts +0 -8
- package/types/tests/DSCard.test.d.ts +0 -1
- package/types/v2/ActionAddon.d.ts +0 -49
- package/types/v2/Card.d.ts +0 -66
- package/types/v2/Group.d.ts +0 -39
- package/types/v2/components.d.ts +0 -11
package/package.json
CHANGED
|
@@ -1,51 +1,54 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-card",
|
|
3
|
-
"version": "3.0.0-next.
|
|
3
|
+
"version": "3.0.0-next.13",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Card",
|
|
6
|
-
"
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
"files": [
|
|
7
|
+
"dist"
|
|
8
|
+
],
|
|
9
|
+
"module": "./dist/esm/index.js",
|
|
10
|
+
"main": "./dist/cjs/index.js",
|
|
11
|
+
"types": "./dist/types/index.d.ts",
|
|
9
12
|
"exports": {
|
|
10
13
|
".": {
|
|
11
|
-
"import": "./esm/index.js",
|
|
12
|
-
"require": "./cjs/index.js"
|
|
14
|
+
"import": "./dist/esm/index.js",
|
|
15
|
+
"require": "./dist/cjs/index.js"
|
|
13
16
|
},
|
|
14
17
|
"./v2/Group": {
|
|
15
|
-
"import": "./esm/v2/Group.js",
|
|
16
|
-
"require": "./cjs/v2/Group.js"
|
|
18
|
+
"import": "./dist/esm/v2/Group.js",
|
|
19
|
+
"require": "./dist/cjs/v2/Group.js"
|
|
17
20
|
},
|
|
18
21
|
"./v2/components": {
|
|
19
|
-
"import": "./esm/v2/components.js",
|
|
20
|
-
"require": "./cjs/v2/components.js"
|
|
22
|
+
"import": "./dist/esm/v2/components.js",
|
|
23
|
+
"require": "./dist/cjs/v2/components.js"
|
|
21
24
|
},
|
|
22
25
|
"./v2/Card": {
|
|
23
|
-
"import": "./esm/v2/Card.js",
|
|
24
|
-
"require": "./cjs/v2/Card.js"
|
|
26
|
+
"import": "./dist/esm/v2/Card.js",
|
|
27
|
+
"require": "./dist/cjs/v2/Card.js"
|
|
25
28
|
},
|
|
26
29
|
"./v2/ActionAddon": {
|
|
27
|
-
"import": "./esm/v2/ActionAddon.js",
|
|
28
|
-
"require": "./cjs/v2/ActionAddon.js"
|
|
30
|
+
"import": "./dist/esm/v2/ActionAddon.js",
|
|
31
|
+
"require": "./dist/cjs/v2/ActionAddon.js"
|
|
29
32
|
},
|
|
30
33
|
"./DSCardHeader": {
|
|
31
|
-
"import": "./esm/DSCardHeader.js",
|
|
32
|
-
"require": "./cjs/DSCardHeader.js"
|
|
34
|
+
"import": "./dist/esm/DSCardHeader.js",
|
|
35
|
+
"require": "./dist/cjs/DSCardHeader.js"
|
|
33
36
|
},
|
|
34
37
|
"./DSCardBody": {
|
|
35
|
-
"import": "./esm/DSCardBody.js",
|
|
36
|
-
"require": "./cjs/DSCardBody.js"
|
|
38
|
+
"import": "./dist/esm/DSCardBody.js",
|
|
39
|
+
"require": "./dist/cjs/DSCardBody.js"
|
|
37
40
|
},
|
|
38
41
|
"./DSCard": {
|
|
39
|
-
"import": "./esm/DSCard.js",
|
|
40
|
-
"require": "./cjs/DSCard.js"
|
|
42
|
+
"import": "./dist/esm/DSCard.js",
|
|
43
|
+
"require": "./dist/cjs/DSCard.js"
|
|
41
44
|
},
|
|
42
45
|
"./detail/styled": {
|
|
43
|
-
"import": "./esm/detail/styled.js",
|
|
44
|
-
"require": "./cjs/detail/styled.js"
|
|
46
|
+
"import": "./dist/esm/detail/styled.js",
|
|
47
|
+
"require": "./dist/cjs/detail/styled.js"
|
|
45
48
|
},
|
|
46
49
|
"./detail/DetailCard": {
|
|
47
|
-
"import": "./esm/detail/DetailCard.js",
|
|
48
|
-
"require": "./cjs/detail/DetailCard.js"
|
|
50
|
+
"import": "./dist/esm/detail/DetailCard.js",
|
|
51
|
+
"require": "./dist/cjs/detail/DetailCard.js"
|
|
49
52
|
}
|
|
50
53
|
},
|
|
51
54
|
"sideEffects": [
|
|
@@ -57,30 +60,30 @@
|
|
|
57
60
|
"url": "https://git.elliemae.io/platform-ui/dimsum.git"
|
|
58
61
|
},
|
|
59
62
|
"engines": {
|
|
60
|
-
"
|
|
61
|
-
"node": ">=
|
|
63
|
+
"pnpm": ">=6",
|
|
64
|
+
"node": ">=16"
|
|
62
65
|
},
|
|
63
66
|
"author": "ICE MT",
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"
|
|
67
|
+
"jestSonar": {
|
|
68
|
+
"sonar56x": true,
|
|
69
|
+
"reportPath": "reports",
|
|
70
|
+
"reportFile": "tests.xml",
|
|
71
|
+
"indent": 4
|
|
69
72
|
},
|
|
70
73
|
"dependencies": {
|
|
71
|
-
"@elliemae/ds-button": "3.0.0-next.
|
|
72
|
-
"@elliemae/ds-classnames": "3.0.0-next.
|
|
73
|
-
"@elliemae/ds-form": "3.0.0-next.
|
|
74
|
-
"@elliemae/ds-grid": "3.0.0-next.
|
|
75
|
-
"@elliemae/ds-header": "3.0.0-next.
|
|
76
|
-
"@elliemae/ds-icons": "3.0.0-next.
|
|
77
|
-
"@elliemae/ds-separator": "3.0.0-next.
|
|
78
|
-
"@elliemae/ds-system": "3.0.0-next.
|
|
79
|
-
"@elliemae/ds-truncated-tooltip-text": "3.0.0-next.
|
|
74
|
+
"@elliemae/ds-button": "3.0.0-next.13",
|
|
75
|
+
"@elliemae/ds-classnames": "3.0.0-next.13",
|
|
76
|
+
"@elliemae/ds-form": "3.0.0-next.13",
|
|
77
|
+
"@elliemae/ds-grid": "3.0.0-next.13",
|
|
78
|
+
"@elliemae/ds-header": "3.0.0-next.13",
|
|
79
|
+
"@elliemae/ds-icons": "3.0.0-next.13",
|
|
80
|
+
"@elliemae/ds-separator": "3.0.0-next.13",
|
|
81
|
+
"@elliemae/ds-system": "3.0.0-next.13",
|
|
82
|
+
"@elliemae/ds-truncated-tooltip-text": "3.0.0-next.13",
|
|
80
83
|
"react-desc": "~4.1.3"
|
|
81
84
|
},
|
|
82
85
|
"devDependencies": {
|
|
83
|
-
"@testing-library/jest-dom": "~5.
|
|
86
|
+
"@testing-library/jest-dom": "~5.16.2",
|
|
84
87
|
"@testing-library/react": "~12.1.2",
|
|
85
88
|
"styled-components": "~5.3.3"
|
|
86
89
|
},
|
|
@@ -92,7 +95,13 @@
|
|
|
92
95
|
},
|
|
93
96
|
"publishConfig": {
|
|
94
97
|
"access": "public",
|
|
95
|
-
"
|
|
96
|
-
|
|
98
|
+
"typeSafety": false
|
|
99
|
+
},
|
|
100
|
+
"scripts": {
|
|
101
|
+
"dev": "cross-env NODE_ENV=development node ../../scripts/build/build.mjs --watch",
|
|
102
|
+
"test": "node ../../scripts/testing/test.mjs",
|
|
103
|
+
"lint": "node ../../scripts/lint.mjs",
|
|
104
|
+
"dts": "node ../../scripts/dts.mjs",
|
|
105
|
+
"build": "cross-env NODE_ENV=production node ../../scripts/build/build.mjs"
|
|
97
106
|
}
|
|
98
107
|
}
|
package/cjs/DSCard.js
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
6
|
-
require('core-js/modules/esnext.iterator.constructor.js');
|
|
7
|
-
require('core-js/modules/esnext.iterator.filter.js');
|
|
8
|
-
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
9
|
-
require('core-js/modules/esnext.iterator.for-each.js');
|
|
10
|
-
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
11
|
-
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
12
|
-
require('react');
|
|
13
|
-
var reactDesc = require('react-desc');
|
|
14
|
-
var dsClassnames = require('@elliemae/ds-classnames');
|
|
15
|
-
var DSCardBody = require('./DSCardBody.js');
|
|
16
|
-
var DSCardHeader = require('./DSCardHeader.js');
|
|
17
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
18
|
-
|
|
19
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
20
|
-
|
|
21
|
-
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
22
|
-
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
|
|
23
|
-
|
|
24
|
-
const _excluded = ["innerRef", "children", "containerProps"];
|
|
25
|
-
|
|
26
|
-
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; }
|
|
27
|
-
|
|
28
|
-
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__default["default"](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; }
|
|
29
|
-
|
|
30
|
-
const DSCard = _ref => {
|
|
31
|
-
let {
|
|
32
|
-
innerRef = undefined,
|
|
33
|
-
children = null,
|
|
34
|
-
containerProps = {}
|
|
35
|
-
} = _ref,
|
|
36
|
-
otherProps = _objectWithoutProperties__default["default"](_ref, _excluded);
|
|
37
|
-
|
|
38
|
-
const {
|
|
39
|
-
cssClassName
|
|
40
|
-
} = dsClassnames.convertPropToCssClassName('card');
|
|
41
|
-
return /*#__PURE__*/jsxRuntime.jsx("div", _objectSpread(_objectSpread(_objectSpread({
|
|
42
|
-
"data-testid": "card"
|
|
43
|
-
}, containerProps), {}, {
|
|
44
|
-
ref: innerRef,
|
|
45
|
-
className: cssClassName
|
|
46
|
-
}, otherProps), {}, {
|
|
47
|
-
children: children
|
|
48
|
-
}));
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
const cardProps = {
|
|
52
|
-
/** inject props to component wrapper */
|
|
53
|
-
containerProps: reactDesc.PropTypes.object.description('inject props to component wrapper'),
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Get reference for the button
|
|
57
|
-
*/
|
|
58
|
-
innerRef: reactDesc.PropTypes.string.description('Get reference for the button'),
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* DSCardBody and DSCardHeader
|
|
62
|
-
*/
|
|
63
|
-
children: reactDesc.PropTypes.arrayOf(reactDesc.PropTypes.shape({
|
|
64
|
-
type: reactDesc.PropTypes.oneOf([DSCardHeader.DSCardHeader, DSCardBody.DSCardBody])
|
|
65
|
-
})).description('DSCardBody and DSCardHeader')
|
|
66
|
-
};
|
|
67
|
-
const DSCardWithSchema = reactDesc.describe(DSCard);
|
|
68
|
-
DSCardWithSchema.propTypes = cardProps;
|
|
69
|
-
|
|
70
|
-
exports.DSCard = DSCard;
|
|
71
|
-
exports.DSCardWithSchema = DSCardWithSchema;
|
|
72
|
-
exports["default"] = DSCard;
|
package/cjs/DSCardBody.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
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 reactDesc = require('react-desc');
|
|
8
|
-
|
|
9
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
10
|
-
|
|
11
|
-
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
12
|
-
|
|
13
|
-
const DSCardBody = _ref => {
|
|
14
|
-
let {
|
|
15
|
-
children
|
|
16
|
-
} = _ref;
|
|
17
|
-
return /*#__PURE__*/_jsx__default["default"]("div", {
|
|
18
|
-
className: "em-ds-card-body",
|
|
19
|
-
"data-testid": "card-body"
|
|
20
|
-
}, void 0, children);
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
const bodyProps = {
|
|
24
|
-
/** children */
|
|
25
|
-
children: reactDesc.PropTypes.element.description('children')
|
|
26
|
-
};
|
|
27
|
-
const DSCardBodyWithSchema = reactDesc.describe(DSCardBody);
|
|
28
|
-
DSCardBodyWithSchema.propTypes = bodyProps;
|
|
29
|
-
|
|
30
|
-
exports.DSCardBody = DSCardBody;
|
|
31
|
-
exports.DSCardBodyWithSchema = DSCardBodyWithSchema;
|
|
32
|
-
exports["default"] = DSCardBody;
|
package/cjs/DSCardHeader.js
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
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 reactDesc = require('react-desc');
|
|
8
|
-
var dsClassnames = require('@elliemae/ds-classnames');
|
|
9
|
-
|
|
10
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
11
|
-
|
|
12
|
-
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
13
|
-
|
|
14
|
-
const DSCardHeader = _ref => {
|
|
15
|
-
let {
|
|
16
|
-
title,
|
|
17
|
-
action
|
|
18
|
-
} = _ref;
|
|
19
|
-
const {
|
|
20
|
-
cssClassName,
|
|
21
|
-
classNameElement
|
|
22
|
-
} = dsClassnames.convertPropToCssClassName('card-header');
|
|
23
|
-
return /*#__PURE__*/_jsx__default["default"]("div", {
|
|
24
|
-
className: cssClassName,
|
|
25
|
-
"data-testid": "card-header"
|
|
26
|
-
}, void 0, /*#__PURE__*/_jsx__default["default"]("span", {
|
|
27
|
-
className: classNameElement('heading')
|
|
28
|
-
}, void 0, title), /*#__PURE__*/_jsx__default["default"]("div", {
|
|
29
|
-
className: classNameElement('pull-right'),
|
|
30
|
-
"data-testid": "ds-card_header-action"
|
|
31
|
-
}, void 0, action));
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
const cardHeader = {
|
|
35
|
-
/** card header title */
|
|
36
|
-
title: reactDesc.PropTypes.string.description('card header title'),
|
|
37
|
-
|
|
38
|
-
/** action */
|
|
39
|
-
action: reactDesc.PropTypes.node.description('action')
|
|
40
|
-
};
|
|
41
|
-
const DSCardHeaderWithSchema = reactDesc.describe(DSCardHeader);
|
|
42
|
-
DSCardHeaderWithSchema.propTypes = cardHeader;
|
|
43
|
-
|
|
44
|
-
exports.DSCardHeader = DSCardHeader;
|
|
45
|
-
exports.DSCardHeaderWithSchema = DSCardHeaderWithSchema;
|
|
46
|
-
exports["default"] = DSCardHeader;
|
package/cjs/detail/DetailCard.js
DELETED
|
@@ -1,200 +0,0 @@
|
|
|
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 lodash = require('lodash');
|
|
8
|
-
var reactDesc = require('react-desc');
|
|
9
|
-
var dsIcons = require('@elliemae/ds-icons');
|
|
10
|
-
var dsSystem = require('@elliemae/ds-system');
|
|
11
|
-
var DSButton = require('@elliemae/ds-button');
|
|
12
|
-
var DSSeparator = require('@elliemae/ds-separator');
|
|
13
|
-
var dsGrid = require('@elliemae/ds-grid');
|
|
14
|
-
var dsForm = require('@elliemae/ds-form');
|
|
15
|
-
var styled = require('./styled.js');
|
|
16
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
17
|
-
|
|
18
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
19
|
-
|
|
20
|
-
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
21
|
-
var DSButton__default = /*#__PURE__*/_interopDefaultLegacy(DSButton);
|
|
22
|
-
var DSSeparator__default = /*#__PURE__*/_interopDefaultLegacy(DSSeparator);
|
|
23
|
-
|
|
24
|
-
var _Grid, _DSSeparator;
|
|
25
|
-
|
|
26
|
-
const DetailCard = _ref => {
|
|
27
|
-
let {
|
|
28
|
-
title,
|
|
29
|
-
description,
|
|
30
|
-
descriptionColor = 'neutral',
|
|
31
|
-
rightValue,
|
|
32
|
-
rightDescription,
|
|
33
|
-
rightAddon,
|
|
34
|
-
// select props
|
|
35
|
-
selectable = false,
|
|
36
|
-
isSelected = false,
|
|
37
|
-
onSelect = lodash.noop,
|
|
38
|
-
// expand props
|
|
39
|
-
expandable = false,
|
|
40
|
-
isExpanded = false,
|
|
41
|
-
onExpand = lodash.noop,
|
|
42
|
-
expandContent,
|
|
43
|
-
// state props
|
|
44
|
-
readOnly = false,
|
|
45
|
-
disabled = false
|
|
46
|
-
} = _ref;
|
|
47
|
-
const theme = dsSystem.useTheme();
|
|
48
|
-
const hasRightLegend = rightValue && rightDescription;
|
|
49
|
-
const hasRightPosition = hasRightLegend || rightAddon;
|
|
50
|
-
const topWrapperCols = ['1fr'];
|
|
51
|
-
if (hasRightPosition) topWrapperCols.push('auto');
|
|
52
|
-
if (expandable) topWrapperCols.unshift('20px');
|
|
53
|
-
if (selectable) topWrapperCols.unshift(theme.space.s);
|
|
54
|
-
return /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
55
|
-
children: /*#__PURE__*/_jsx__default["default"](styled.Container, {
|
|
56
|
-
disabled: disabled || readOnly,
|
|
57
|
-
active: selectable && isSelected,
|
|
58
|
-
"data-testid": "card-detail-container"
|
|
59
|
-
}, void 0, /*#__PURE__*/_jsx__default["default"](dsGrid.Grid, {
|
|
60
|
-
cols: topWrapperCols,
|
|
61
|
-
alignItems: !description && 'center'
|
|
62
|
-
}, void 0, selectable && /*#__PURE__*/_jsx__default["default"](dsGrid.Grid, {
|
|
63
|
-
pt: description && '9px'
|
|
64
|
-
}, void 0, /*#__PURE__*/_jsx__default["default"](dsForm.DSCheckbox, {
|
|
65
|
-
checked: isSelected,
|
|
66
|
-
onChange: onSelect,
|
|
67
|
-
readOnly: readOnly,
|
|
68
|
-
disabled: disabled,
|
|
69
|
-
"data-testid": "card-checkbox"
|
|
70
|
-
})), expandable && /*#__PURE__*/_jsx__default["default"](dsGrid.Grid, {
|
|
71
|
-
height: "16px",
|
|
72
|
-
pt: description && 'xxs',
|
|
73
|
-
mt: !description && '-5px'
|
|
74
|
-
}, void 0, /*#__PURE__*/_jsx__default["default"](DSButton__default["default"], {
|
|
75
|
-
size: "s",
|
|
76
|
-
buttonType: "text",
|
|
77
|
-
containerProps: {
|
|
78
|
-
'data-testid': 'expand-button'
|
|
79
|
-
},
|
|
80
|
-
onClick: onExpand,
|
|
81
|
-
icon: isExpanded ? /*#__PURE__*/_jsx__default["default"](dsIcons.ArrowheadDown, {
|
|
82
|
-
color: ['neutral', 500],
|
|
83
|
-
size: "s"
|
|
84
|
-
}) : /*#__PURE__*/_jsx__default["default"](dsIcons.ArrowheadRight, {
|
|
85
|
-
color: ['neutral', 500],
|
|
86
|
-
size: "s"
|
|
87
|
-
}),
|
|
88
|
-
disabled: disabled
|
|
89
|
-
})), /*#__PURE__*/_jsx__default["default"](dsGrid.Grid, {
|
|
90
|
-
pr: "24px"
|
|
91
|
-
}, void 0, /*#__PURE__*/_jsx__default["default"](styled.Title, {}, void 0, title), description && /*#__PURE__*/_jsx__default["default"](styled.Description, {
|
|
92
|
-
descriptionColor: descriptionColor
|
|
93
|
-
}, void 0, description)), hasRightPosition && /*#__PURE__*/_jsx__default["default"](dsGrid.Grid, {
|
|
94
|
-
cols: lodash.compact([hasRightPosition && 'auto', rightAddon && 'auto'])
|
|
95
|
-
}, void 0, hasRightLegend && /*#__PURE__*/_jsx__default["default"](dsGrid.Grid, {
|
|
96
|
-
pr: "24px",
|
|
97
|
-
rows: ['auto', 'auto', 1]
|
|
98
|
-
}, void 0, /*#__PURE__*/_jsx__default["default"](styled.RightDescription, {
|
|
99
|
-
justifyContent: "flex-end"
|
|
100
|
-
}, void 0, rightDescription), /*#__PURE__*/_jsx__default["default"](styled.RightValue, {
|
|
101
|
-
justifyContent: "flex-end"
|
|
102
|
-
}, void 0, rightValue), _Grid || (_Grid = /*#__PURE__*/_jsx__default["default"](dsGrid.Grid, {}))), rightAddon && /*#__PURE__*/_jsx__default["default"](styled.RightAddon, {
|
|
103
|
-
cols: ['auto', 'auto'],
|
|
104
|
-
gutter: "2px"
|
|
105
|
-
}, void 0, rightAddon))), expandContent && isExpanded && /*#__PURE__*/_jsx__default["default"](dsGrid.Grid, {
|
|
106
|
-
ml: selectable && 's',
|
|
107
|
-
mr: rightAddon && 'xs'
|
|
108
|
-
}, void 0, _DSSeparator || (_DSSeparator = /*#__PURE__*/_jsx__default["default"](DSSeparator__default["default"], {
|
|
109
|
-
dashed: true,
|
|
110
|
-
position: "initial",
|
|
111
|
-
margin: "none"
|
|
112
|
-
})), /*#__PURE__*/_jsx__default["default"](dsGrid.Grid, {
|
|
113
|
-
pt: "xxs",
|
|
114
|
-
"data-testid": "detail-card-expanded-content"
|
|
115
|
-
}, void 0, expandContent)))
|
|
116
|
-
});
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
const detailProps = {
|
|
120
|
-
/**
|
|
121
|
-
* Title of the card.
|
|
122
|
-
*/
|
|
123
|
-
title: reactDesc.PropTypes.string.isRequired.description('Title of the card.'),
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
* Description of the card.
|
|
127
|
-
*/
|
|
128
|
-
description: reactDesc.PropTypes.string.description('Description of the card.'),
|
|
129
|
-
|
|
130
|
-
/**
|
|
131
|
-
* Description color.
|
|
132
|
-
*/
|
|
133
|
-
descriptionColor: reactDesc.PropTypes.oneOf(['primary', 'neutral']).description('Description color.'),
|
|
134
|
-
|
|
135
|
-
/**
|
|
136
|
-
* Right value (should be used with `rightDescription`)
|
|
137
|
-
*/
|
|
138
|
-
rightValue: reactDesc.PropTypes.string.description('Right value (should be used with `rightDescription`)'),
|
|
139
|
-
|
|
140
|
-
/**
|
|
141
|
-
* Right description (should be used with `rightValue`)
|
|
142
|
-
*/
|
|
143
|
-
rightDescription: reactDesc.PropTypes.string.description('Right description (should be used with `rightValue`)'),
|
|
144
|
-
|
|
145
|
-
/**
|
|
146
|
-
* Right addon array, max elements: 2
|
|
147
|
-
*/
|
|
148
|
-
rightAddon: reactDesc.PropTypes.element.description('Right addon array, max elements: 2'),
|
|
149
|
-
|
|
150
|
-
/**
|
|
151
|
-
* Whether if the card is selectable or not
|
|
152
|
-
*/
|
|
153
|
-
selectable: reactDesc.PropTypes.bool.description('Whether if the card is selectable or not'),
|
|
154
|
-
|
|
155
|
-
/**
|
|
156
|
-
* Whether if the card is selected or not
|
|
157
|
-
*/
|
|
158
|
-
isSelected: reactDesc.PropTypes.bool.description('Whether if the card is selected or not'),
|
|
159
|
-
|
|
160
|
-
/**
|
|
161
|
-
* Callback on selection
|
|
162
|
-
*/
|
|
163
|
-
onSelect: reactDesc.PropTypes.func.description('Callback on selection'),
|
|
164
|
-
|
|
165
|
-
/**
|
|
166
|
-
* Whether if the card is expandable or not
|
|
167
|
-
*/
|
|
168
|
-
expandable: reactDesc.PropTypes.bool.description('Whether if the card is expandable or not'),
|
|
169
|
-
|
|
170
|
-
/**
|
|
171
|
-
* Whether if the card is expanded or not
|
|
172
|
-
*/
|
|
173
|
-
isExpanded: reactDesc.PropTypes.bool.description('Whether if the card is expanded or not'),
|
|
174
|
-
|
|
175
|
-
/**
|
|
176
|
-
* Callback on expand
|
|
177
|
-
*/
|
|
178
|
-
onExpand: reactDesc.PropTypes.func.description('Callback on expand'),
|
|
179
|
-
|
|
180
|
-
/**
|
|
181
|
-
* Content
|
|
182
|
-
*/
|
|
183
|
-
expandContent: reactDesc.PropTypes.element.description('Content'),
|
|
184
|
-
|
|
185
|
-
/**
|
|
186
|
-
* Read only
|
|
187
|
-
*/
|
|
188
|
-
readOnly: reactDesc.PropTypes.bool.description('Read only'),
|
|
189
|
-
|
|
190
|
-
/**
|
|
191
|
-
* Disabled
|
|
192
|
-
*/
|
|
193
|
-
disabled: reactDesc.PropTypes.bool.description('Disabled')
|
|
194
|
-
};
|
|
195
|
-
const DSCardDetailWithSchema = reactDesc.describe(DetailCard);
|
|
196
|
-
DSCardDetailWithSchema.propTypes = detailProps;
|
|
197
|
-
|
|
198
|
-
exports.DSCardDetailWithSchema = DSCardDetailWithSchema;
|
|
199
|
-
exports.DetailCard = DetailCard;
|
|
200
|
-
exports["default"] = DetailCard;
|
package/cjs/detail/styled.js
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var styled = require('styled-components');
|
|
6
|
-
var dsGrid = require('@elliemae/ds-grid');
|
|
7
|
-
|
|
8
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
9
|
-
|
|
10
|
-
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
11
|
-
|
|
12
|
-
const Separator = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
13
|
-
componentId: "sc-nx8lwv-0"
|
|
14
|
-
})(["width:100%;height:24px;border-right:1px solid ", ";margin:0 8px;"], props => props.theme.colors.neutral['300']);
|
|
15
|
-
const Title = /*#__PURE__*/styled__default["default"].h3.withConfig({
|
|
16
|
-
componentId: "sc-nx8lwv-1"
|
|
17
|
-
})(["margin:0;font-size:16px;min-height:20px;font-weight:", ";color:", ";"], props => props.theme.fontWeights.semibold, props => props.theme.colors.neutral['700']);
|
|
18
|
-
const Description = /*#__PURE__*/styled__default["default"].p.withConfig({
|
|
19
|
-
componentId: "sc-nx8lwv-2"
|
|
20
|
-
})(["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']);
|
|
21
|
-
const RightAddon = /*#__PURE__*/styled__default["default"](dsGrid.Grid).withConfig({
|
|
22
|
-
componentId: "sc-nx8lwv-3"
|
|
23
|
-
})(["margin:0;white-space:nowrap;"]);
|
|
24
|
-
const RightDescription = /*#__PURE__*/styled__default["default"](dsGrid.Grid).withConfig({
|
|
25
|
-
componentId: "sc-nx8lwv-4"
|
|
26
|
-
})(["margin:0;white-space:nowrap;font-size:12px;color:", ";"], props => props.theme.colors.neutral['600']);
|
|
27
|
-
const RightValue = /*#__PURE__*/styled__default["default"](dsGrid.Grid).withConfig({
|
|
28
|
-
componentId: "sc-nx8lwv-5"
|
|
29
|
-
})(["margin:0;white-space:nowrap;font-size:14px;color:", ";"], props => props.theme.colors.neutral['800']);
|
|
30
|
-
const ExpandContent = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
31
|
-
componentId: "sc-nx8lwv-6"
|
|
32
|
-
})(["font-size:12px;"]);
|
|
33
|
-
|
|
34
|
-
const border = _ref => {
|
|
35
|
-
let {
|
|
36
|
-
active,
|
|
37
|
-
theme
|
|
38
|
-
} = _ref;
|
|
39
|
-
return active ? theme.colors.brand['600'] : theme.colors.neutral['200'];
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
const background = _ref2 => {
|
|
43
|
-
let {
|
|
44
|
-
active,
|
|
45
|
-
theme
|
|
46
|
-
} = _ref2;
|
|
47
|
-
return active ? theme.colors.brand['100'] : theme.colors.neutral['000'];
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
const Container = /*#__PURE__*/styled__default["default"](dsGrid.Grid).withConfig({
|
|
51
|
-
componentId: "sc-nx8lwv-7"
|
|
52
|
-
})(["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 ") : '');
|
|
53
|
-
|
|
54
|
-
exports.Container = Container;
|
|
55
|
-
exports.Description = Description;
|
|
56
|
-
exports.ExpandContent = ExpandContent;
|
|
57
|
-
exports.RightAddon = RightAddon;
|
|
58
|
-
exports.RightDescription = RightDescription;
|
|
59
|
-
exports.RightValue = RightValue;
|
|
60
|
-
exports.Separator = Separator;
|
|
61
|
-
exports.Title = Title;
|
package/cjs/index.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var DSCard = require('./DSCard.js');
|
|
6
|
-
var DSCardHeader = require('./DSCardHeader.js');
|
|
7
|
-
var DSCardBody = require('./DSCardBody.js');
|
|
8
|
-
var Card = require('./v2/Card.js');
|
|
9
|
-
var Group = require('./v2/Group.js');
|
|
10
|
-
var ActionAddon = require('./v2/ActionAddon.js');
|
|
11
|
-
var DetailCard = require('./detail/DetailCard.js');
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
exports.DSCard = DSCard.DSCard;
|
|
16
|
-
exports.DSCardWithSchema = DSCard.DSCardWithSchema;
|
|
17
|
-
exports["default"] = DSCard.DSCard;
|
|
18
|
-
exports.DSCardHeader = DSCardHeader.DSCardHeader;
|
|
19
|
-
exports.DSCardHeaderWithSchema = DSCardHeader.DSCardHeaderWithSchema;
|
|
20
|
-
exports.DSCardBody = DSCardBody.DSCardBody;
|
|
21
|
-
exports.DSCardBodyWithSchema = DSCardBody.DSCardBodyWithSchema;
|
|
22
|
-
exports.CustomCard = Card.CustomCard;
|
|
23
|
-
exports.DSCardCustomWithSchema = Card.DSCardCustomWithSchema;
|
|
24
|
-
exports.CardGroup = Group.CardGroup;
|
|
25
|
-
exports.DSCardGroupWithSchema = Group.DSCardGroupWithSchema;
|
|
26
|
-
exports.ActionAddon = ActionAddon.ActionAddon;
|
|
27
|
-
exports.DSCardActionAddonWithSchema = ActionAddon.DSCardActionAddonWithSchema;
|
|
28
|
-
exports.DSCardDetailWithSchema = DetailCard.DSCardDetailWithSchema;
|
|
29
|
-
exports.DetailCard = DetailCard.DetailCard;
|
package/cjs/v2/ActionAddon.js
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
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 reactDesc = require('react-desc');
|
|
8
|
-
var styled = require('styled-components');
|
|
9
|
-
var dsIcons = require('@elliemae/ds-icons');
|
|
10
|
-
var DSButton = require('@elliemae/ds-button');
|
|
11
|
-
|
|
12
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
13
|
-
|
|
14
|
-
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
15
|
-
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
16
|
-
var DSButton__default = /*#__PURE__*/_interopDefaultLegacy(DSButton);
|
|
17
|
-
|
|
18
|
-
const Addon = /*#__PURE__*/styled__default["default"](DSButton__default["default"]).withConfig({
|
|
19
|
-
componentId: "sc-1pazs35-0"
|
|
20
|
-
})(["background-color:transparent;padding-right:4px;height:100%;border:none;font-size:12px;font-weight:", ";color:", ";cursor:pointer;&:focus,&::after{background-color:transparent;box-shadow:none !important;border:none !important;}"], props => props.theme.fontWeights.semibold, props => props.theme.colors.brand['700']);
|
|
21
|
-
|
|
22
|
-
const ActionAddon = _ref => {
|
|
23
|
-
let {
|
|
24
|
-
label,
|
|
25
|
-
onClick,
|
|
26
|
-
icon
|
|
27
|
-
} = _ref;
|
|
28
|
-
return /*#__PURE__*/_jsx__default["default"](Addon, {
|
|
29
|
-
onClick: onClick,
|
|
30
|
-
labelText: label,
|
|
31
|
-
icon: icon || /*#__PURE__*/_jsx__default["default"](dsIcons.ChevronSmallDown, {
|
|
32
|
-
color: ['brand-primary', 700]
|
|
33
|
-
})
|
|
34
|
-
});
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
const actionProps = {
|
|
38
|
-
/**
|
|
39
|
-
* Addon label
|
|
40
|
-
*/
|
|
41
|
-
label: reactDesc.PropTypes.string.description('Addon label'),
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* On click callback
|
|
45
|
-
*/
|
|
46
|
-
onClick: reactDesc.PropTypes.func.description('On click callback'),
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Icon to display after the label
|
|
50
|
-
*/
|
|
51
|
-
icon: reactDesc.PropTypes.element.description('Icon to display after the label')
|
|
52
|
-
};
|
|
53
|
-
const DSCardActionAddonWithSchema = reactDesc.describe(ActionAddon);
|
|
54
|
-
DSCardActionAddonWithSchema.propTypes = actionProps;
|
|
55
|
-
|
|
56
|
-
exports.ActionAddon = ActionAddon;
|
|
57
|
-
exports.DSCardActionAddonWithSchema = DSCardActionAddonWithSchema;
|
|
58
|
-
exports["default"] = ActionAddon;
|