@elliemae/ds-card 2.1.0 → 2.2.0-alpha.3
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 +62 -67
- package/cjs/DSCard.js.map +7 -0
- package/cjs/DSCardBody.js +45 -28
- package/cjs/DSCardBody.js.map +7 -0
- package/cjs/DSCardHeader.js +52 -39
- package/cjs/DSCardHeader.js.map +7 -0
- package/cjs/detail/DetailCard.js +150 -194
- package/cjs/detail/DetailCard.js.map +7 -0
- package/cjs/detail/styled.js +105 -59
- package/cjs/detail/styled.js.map +7 -0
- package/cjs/index.js +42 -29
- package/cjs/index.js.map +7 -0
- package/cjs/v2/ActionAddon.js +69 -54
- package/cjs/v2/ActionAddon.js.map +7 -0
- package/cjs/v2/Card.js +77 -83
- package/cjs/v2/Card.js.map +7 -0
- package/cjs/v2/Group.js +77 -64
- package/cjs/v2/Group.js.map +7 -0
- package/cjs/v2/components.js +104 -54
- package/cjs/v2/components.js.map +7 -0
- package/esm/DSCard.js +30 -53
- package/esm/DSCard.js.map +7 -0
- package/esm/DSCardBody.js +16 -18
- package/esm/DSCardBody.js.map +7 -0
- package/esm/DSCardHeader.js +22 -28
- package/esm/DSCardHeader.js.map +7 -0
- package/esm/detail/DetailCard.js +119 -180
- package/esm/detail/DetailCard.js.map +7 -0
- package/esm/detail/styled.js +77 -45
- package/esm/detail/styled.js.map +7 -0
- package/esm/index.js +13 -7
- package/esm/index.js.map +7 -0
- package/esm/v2/ActionAddon.js +40 -42
- package/esm/v2/ActionAddon.js.map +7 -0
- package/esm/v2/Card.js +59 -72
- package/esm/v2/Card.js.map +7 -0
- package/esm/v2/Group.js +48 -53
- package/esm/v2/Group.js.map +7 -0
- package/esm/v2/components.js +75 -38
- package/esm/v2/components.js.map +7 -0
- package/package.json +10 -10
package/cjs/detail/DetailCard.js
CHANGED
|
@@ -1,200 +1,156 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
var
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
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 DetailCard_exports = {};
|
|
29
|
+
__export(DetailCard_exports, {
|
|
30
|
+
DSCardDetailWithSchema: () => DSCardDetailWithSchema,
|
|
31
|
+
DetailCard: () => DetailCard,
|
|
32
|
+
default: () => DetailCard_default
|
|
33
|
+
});
|
|
34
|
+
var React = __toESM(require("react"));
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_lodash = __toESM(require("lodash"));
|
|
37
|
+
var import_react_desc = __toESM(require("react-desc"));
|
|
38
|
+
var import_ds_icons = __toESM(require("@elliemae/ds-icons"));
|
|
39
|
+
var import_ds_system = __toESM(require("@elliemae/ds-system"));
|
|
40
|
+
var import_ds_button = __toESM(require("@elliemae/ds-button"));
|
|
41
|
+
var import_ds_separator = __toESM(require("@elliemae/ds-separator"));
|
|
42
|
+
var import_ds_grid = __toESM(require("@elliemae/ds-grid"));
|
|
43
|
+
var import_ds_form = __toESM(require("@elliemae/ds-form"));
|
|
44
|
+
var import_styled = __toESM(require("./styled"));
|
|
45
|
+
const DetailCard = ({
|
|
46
|
+
title,
|
|
47
|
+
description,
|
|
48
|
+
descriptionColor = "neutral",
|
|
49
|
+
rightValue,
|
|
50
|
+
rightDescription,
|
|
51
|
+
rightAddon,
|
|
52
|
+
selectable = false,
|
|
53
|
+
isSelected = false,
|
|
54
|
+
onSelect = import_lodash.noop,
|
|
55
|
+
expandable = false,
|
|
56
|
+
isExpanded = false,
|
|
57
|
+
onExpand = import_lodash.noop,
|
|
58
|
+
expandContent,
|
|
59
|
+
readOnly = false,
|
|
60
|
+
disabled = false
|
|
61
|
+
}) => {
|
|
62
|
+
const theme = (0, import_ds_system.useTheme)();
|
|
48
63
|
const hasRightLegend = rightValue && rightDescription;
|
|
49
64
|
const hasRightPosition = hasRightLegend || rightAddon;
|
|
50
|
-
const topWrapperCols = [
|
|
51
|
-
if (hasRightPosition)
|
|
52
|
-
|
|
53
|
-
if (
|
|
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
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
65
|
+
const topWrapperCols = ["1fr"];
|
|
66
|
+
if (hasRightPosition)
|
|
67
|
+
topWrapperCols.push("auto");
|
|
68
|
+
if (expandable)
|
|
69
|
+
topWrapperCols.unshift("20px");
|
|
70
|
+
if (selectable)
|
|
71
|
+
topWrapperCols.unshift(theme.space.s);
|
|
72
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(import_styled.Container, {
|
|
73
|
+
disabled: disabled || readOnly,
|
|
74
|
+
active: selectable && isSelected,
|
|
75
|
+
"data-testid": "card-detail-container"
|
|
76
|
+
}, /* @__PURE__ */ import_react.default.createElement(import_ds_grid.Grid, {
|
|
77
|
+
cols: topWrapperCols,
|
|
78
|
+
alignItems: !description && "center"
|
|
79
|
+
}, selectable && /* @__PURE__ */ import_react.default.createElement(import_ds_grid.Grid, {
|
|
80
|
+
pt: description && "9px"
|
|
81
|
+
}, /* @__PURE__ */ import_react.default.createElement(import_ds_form.DSCheckbox, {
|
|
82
|
+
checked: isSelected,
|
|
83
|
+
onChange: onSelect,
|
|
84
|
+
readOnly,
|
|
85
|
+
disabled,
|
|
86
|
+
"data-testid": "card-checkbox"
|
|
87
|
+
})), expandable && /* @__PURE__ */ import_react.default.createElement(import_ds_grid.Grid, {
|
|
88
|
+
height: "16px",
|
|
89
|
+
pt: description && "xxs",
|
|
90
|
+
mt: !description && "-5px"
|
|
91
|
+
}, /* @__PURE__ */ import_react.default.createElement(import_ds_button.default, {
|
|
92
|
+
size: "s",
|
|
93
|
+
buttonType: "text",
|
|
94
|
+
containerProps: {
|
|
95
|
+
"data-testid": "expand-button"
|
|
96
|
+
},
|
|
97
|
+
onClick: onExpand,
|
|
98
|
+
icon: isExpanded ? /* @__PURE__ */ import_react.default.createElement(import_ds_icons.ArrowheadDown, {
|
|
99
|
+
color: ["neutral", 500],
|
|
100
|
+
size: "s"
|
|
101
|
+
}) : /* @__PURE__ */ import_react.default.createElement(import_ds_icons.ArrowheadRight, {
|
|
102
|
+
color: ["neutral", 500],
|
|
103
|
+
size: "s"
|
|
104
|
+
}),
|
|
105
|
+
disabled
|
|
106
|
+
})), /* @__PURE__ */ import_react.default.createElement(import_ds_grid.Grid, {
|
|
107
|
+
pr: "24px"
|
|
108
|
+
}, /* @__PURE__ */ import_react.default.createElement(import_styled.Title, null, title), description && /* @__PURE__ */ import_react.default.createElement(import_styled.Description, {
|
|
109
|
+
descriptionColor
|
|
110
|
+
}, description)), hasRightPosition && /* @__PURE__ */ import_react.default.createElement(import_ds_grid.Grid, {
|
|
111
|
+
cols: (0, import_lodash.compact)([hasRightPosition && "auto", rightAddon && "auto"])
|
|
112
|
+
}, hasRightLegend && /* @__PURE__ */ import_react.default.createElement(import_ds_grid.Grid, {
|
|
113
|
+
pr: "24px",
|
|
114
|
+
rows: ["auto", "auto", 1]
|
|
115
|
+
}, /* @__PURE__ */ import_react.default.createElement(import_styled.RightDescription, {
|
|
116
|
+
justifyContent: "flex-end"
|
|
117
|
+
}, rightDescription), /* @__PURE__ */ import_react.default.createElement(import_styled.RightValue, {
|
|
118
|
+
justifyContent: "flex-end"
|
|
119
|
+
}, rightValue), /* @__PURE__ */ import_react.default.createElement(import_ds_grid.Grid, null)), rightAddon && /* @__PURE__ */ import_react.default.createElement(import_styled.RightAddon, {
|
|
120
|
+
cols: ["auto", "auto"],
|
|
121
|
+
gutter: "2px"
|
|
122
|
+
}, rightAddon))), expandContent && isExpanded && /* @__PURE__ */ import_react.default.createElement(import_ds_grid.Grid, {
|
|
123
|
+
ml: selectable && "s",
|
|
124
|
+
mr: rightAddon && "xs"
|
|
125
|
+
}, /* @__PURE__ */ import_react.default.createElement(import_ds_separator.default, {
|
|
126
|
+
dashed: true,
|
|
127
|
+
position: "initial",
|
|
128
|
+
margin: "none"
|
|
129
|
+
}), /* @__PURE__ */ import_react.default.createElement(import_ds_grid.Grid, {
|
|
130
|
+
pt: "xxs",
|
|
131
|
+
"data-testid": "detail-card-expanded-content"
|
|
132
|
+
}, expandContent))));
|
|
117
133
|
};
|
|
118
|
-
|
|
119
134
|
const detailProps = {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
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')
|
|
135
|
+
title: import_react_desc.PropTypes.string.isRequired.description("Title of the card."),
|
|
136
|
+
description: import_react_desc.PropTypes.string.description("Description of the card."),
|
|
137
|
+
descriptionColor: import_react_desc.PropTypes.oneOf(["primary", "neutral"]).description("Description color."),
|
|
138
|
+
rightValue: import_react_desc.PropTypes.string.description("Right value (should be used with `rightDescription`)"),
|
|
139
|
+
rightDescription: import_react_desc.PropTypes.string.description("Right description (should be used with `rightValue`)"),
|
|
140
|
+
rightAddon: import_react_desc.PropTypes.element.description("Right addon array, max elements: 2"),
|
|
141
|
+
selectable: import_react_desc.PropTypes.bool.description("Whether if the card is selectable or not"),
|
|
142
|
+
isSelected: import_react_desc.PropTypes.bool.description("Whether if the card is selected or not"),
|
|
143
|
+
onSelect: import_react_desc.PropTypes.func.description("Callback on selection"),
|
|
144
|
+
expandable: import_react_desc.PropTypes.bool.description("Whether if the card is expandable or not"),
|
|
145
|
+
isExpanded: import_react_desc.PropTypes.bool.description("Whether if the card is expanded or not"),
|
|
146
|
+
onExpand: import_react_desc.PropTypes.func.description("Callback on expand"),
|
|
147
|
+
expandContent: import_react_desc.PropTypes.element.description("Content"),
|
|
148
|
+
readOnly: import_react_desc.PropTypes.bool.description("Read only"),
|
|
149
|
+
disabled: import_react_desc.PropTypes.bool.description("Disabled")
|
|
194
150
|
};
|
|
195
|
-
|
|
151
|
+
DetailCard.propTypes = detailProps;
|
|
152
|
+
const DSCardDetailWithSchema = (0, import_react_desc.describe)(DetailCard);
|
|
196
153
|
DSCardDetailWithSchema.propTypes = detailProps;
|
|
197
|
-
|
|
198
|
-
exports
|
|
199
|
-
|
|
200
|
-
exports["default"] = DetailCard;
|
|
154
|
+
var DetailCard_default = DetailCard;
|
|
155
|
+
module.exports = __toCommonJS(DetailCard_exports);
|
|
156
|
+
//# sourceMappingURL=DetailCard.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/detail/DetailCard.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["/* eslint-disable max-lines */\n/* eslint-disable jsx-a11y/click-events-have-key-events */\n/* eslint-disable complexity */\nimport React from 'react';\nimport { compact, noop } from 'lodash';\nimport { PropTypes, describe } from 'react-desc';\nimport { ArrowheadDown, ArrowheadRight } from '@elliemae/ds-icons';\nimport { useTheme } from '@elliemae/ds-system';\nimport DSButton from '@elliemae/ds-button';\nimport DSSeparator from '@elliemae/ds-separator';\nimport { Grid } from '@elliemae/ds-grid';\nimport { DSCheckbox } from '@elliemae/ds-form';\nimport { Container, Title, Description, RightAddon, RightDescription, RightValue } from './styled';\n\nconst DetailCard = ({\n title,\n description,\n descriptionColor = 'neutral',\n rightValue,\n rightDescription,\n rightAddon,\n // select props\n selectable = false,\n isSelected = false,\n onSelect = noop,\n // expand props\n expandable = false,\n isExpanded = false,\n onExpand = noop,\n expandContent,\n // state props\n readOnly = false,\n disabled = false,\n}) => {\n const theme = useTheme();\n const hasRightLegend = rightValue && rightDescription;\n const hasRightPosition = hasRightLegend || rightAddon;\n const topWrapperCols = ['1fr'];\n if (hasRightPosition) topWrapperCols.push('auto');\n if (expandable) topWrapperCols.unshift('20px');\n if (selectable) topWrapperCols.unshift(theme.space.s);\n return (\n <>\n <Container disabled={disabled || readOnly} active={selectable && isSelected} data-testid=\"card-detail-container\">\n <Grid cols={topWrapperCols} alignItems={!description && 'center'}>\n {selectable && (\n <Grid pt={description && '9px'}>\n <DSCheckbox\n checked={isSelected}\n onChange={onSelect}\n readOnly={readOnly}\n disabled={disabled}\n data-testid=\"card-checkbox\"\n />\n </Grid>\n )}\n {expandable && (\n <Grid height=\"16px\" pt={description && 'xxs'} mt={!description && '-5px'}>\n <DSButton\n size=\"s\"\n buttonType=\"text\"\n containerProps={{\n 'data-testid': 'expand-button',\n }}\n onClick={onExpand}\n icon={\n isExpanded ? (\n <ArrowheadDown color={['neutral', 500]} size=\"s\" />\n ) : (\n <ArrowheadRight color={['neutral', 500]} size=\"s\" />\n )\n }\n disabled={disabled}\n />\n </Grid>\n )}\n <Grid pr=\"24px\">\n <Title>{title}</Title>\n {description && <Description descriptionColor={descriptionColor}>{description}</Description>}\n </Grid>\n {hasRightPosition && (\n <Grid cols={compact([hasRightPosition && 'auto', rightAddon && 'auto'])}>\n {hasRightLegend && (\n <Grid pr=\"24px\" rows={['auto', 'auto', 1]}>\n <RightDescription justifyContent=\"flex-end\">{rightDescription}</RightDescription>\n <RightValue justifyContent=\"flex-end\">{rightValue}</RightValue>\n <Grid />\n </Grid>\n )}\n {rightAddon && (\n <RightAddon cols={['auto', 'auto']} gutter=\"2px\">\n {rightAddon}\n </RightAddon>\n )}\n </Grid>\n )}\n </Grid>\n {expandContent && isExpanded && (\n <Grid ml={selectable && 's'} mr={rightAddon && 'xs'}>\n <DSSeparator dashed position=\"initial\" margin=\"none\" />\n <Grid pt=\"xxs\" data-testid=\"detail-card-expanded-content\">\n {expandContent}\n </Grid>\n </Grid>\n )}\n </Container>\n </>\n );\n};\n\nconst detailProps = {\n /**\n * Title of the card.\n */\n title: PropTypes.string.isRequired.description('Title of the card.'),\n /**\n * Description of the card.\n */\n description: PropTypes.string.description('Description of the card.'),\n /**\n * Description color.\n */\n descriptionColor: PropTypes.oneOf(['primary', 'neutral']).description('Description color.'),\n /**\n * Right value (should be used with `rightDescription`)\n */\n rightValue: PropTypes.string.description('Right value (should be used with `rightDescription`)'),\n /**\n * Right description (should be used with `rightValue`)\n */\n rightDescription: PropTypes.string.description('Right description (should be used with `rightValue`)'),\n /**\n * Right addon array, max elements: 2\n */\n rightAddon: PropTypes.element.description('Right addon array, max elements: 2'),\n /**\n * Whether if the card is selectable or not\n */\n selectable: PropTypes.bool.description('Whether if the card is selectable or not'),\n /**\n * Whether if the card is selected or not\n */\n isSelected: PropTypes.bool.description('Whether if the card is selected or not'),\n /**\n * Callback on selection\n */\n onSelect: PropTypes.func.description('Callback on selection'),\n /**\n * Whether if the card is expandable or not\n */\n expandable: PropTypes.bool.description('Whether if the card is expandable or not'),\n /**\n * Whether if the card is expanded or not\n */\n isExpanded: PropTypes.bool.description('Whether if the card is expanded or not'),\n /**\n * Callback on expand\n */\n onExpand: PropTypes.func.description('Callback on expand'),\n /**\n * Content\n */\n expandContent: PropTypes.element.description('Content'),\n /**\n * Read only\n */\n readOnly: PropTypes.bool.description('Read only'),\n /**\n * Disabled\n */\n disabled: PropTypes.bool.description('Disabled'),\n};\n\nDetailCard.propTypes = detailProps;\nconst DSCardDetailWithSchema = describe(DetailCard);\nDSCardDetailWithSchema.propTypes = detailProps;\n\nexport { DetailCard, DSCardDetailWithSchema };\nexport default DetailCard;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,mBAAkB;AAClB,oBAA8B;AAC9B,wBAAoC;AACpC,sBAA8C;AAC9C,uBAAyB;AACzB,uBAAqB;AACrB,0BAAwB;AACxB,qBAAqB;AACrB,qBAA2B;AAC3B,oBAAwF;AAExF,MAAM,aAAa,CAAC;AAAA,EAClB;AAAA,EACA;AAAA,EACA,mBAAmB;AAAA,EACnB;AAAA,EACA;AAAA,EACA;AAAA,EAEA,aAAa;AAAA,EACb,aAAa;AAAA,EACb,WAAW;AAAA,EAEX,aAAa;AAAA,EACb,aAAa;AAAA,EACb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uB,YAAY;AAGnC,IAAO,qBAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/cjs/detail/styled.js
CHANGED
|
@@ -1,61 +1,107 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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'];
|
|
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 });
|
|
40
11
|
};
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
return
|
|
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;
|
|
48
19
|
};
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
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 styled_exports = {};
|
|
29
|
+
__export(styled_exports, {
|
|
30
|
+
Container: () => Container,
|
|
31
|
+
Description: () => Description,
|
|
32
|
+
ExpandContent: () => ExpandContent,
|
|
33
|
+
RightAddon: () => RightAddon,
|
|
34
|
+
RightDescription: () => RightDescription,
|
|
35
|
+
RightValue: () => RightValue,
|
|
36
|
+
Separator: () => Separator,
|
|
37
|
+
Title: () => Title
|
|
38
|
+
});
|
|
39
|
+
var React = __toESM(require("react"));
|
|
40
|
+
var import_styled_components = __toESM(require("styled-components"));
|
|
41
|
+
var import_ds_grid = __toESM(require("@elliemae/ds-grid"));
|
|
42
|
+
const Separator = import_styled_components.default.div`
|
|
43
|
+
width: 100%;
|
|
44
|
+
height: 24px;
|
|
45
|
+
border-right: 1px solid ${(props) => props.theme.colors.neutral["300"]};
|
|
46
|
+
margin: 0 8px;
|
|
47
|
+
`;
|
|
48
|
+
const Title = import_styled_components.default.h3`
|
|
49
|
+
margin: 0;
|
|
50
|
+
font-size: 16px;
|
|
51
|
+
min-height: 20px;
|
|
52
|
+
font-weight: ${(props) => props.theme.fontWeights.semibold};
|
|
53
|
+
color: ${(props) => props.theme.colors.neutral["700"]};
|
|
54
|
+
`;
|
|
55
|
+
const Description = import_styled_components.default.p`
|
|
56
|
+
margin: 0;
|
|
57
|
+
font-size: 12px;
|
|
58
|
+
min-height: 18px;
|
|
59
|
+
display: flex;
|
|
60
|
+
align-items: center;
|
|
61
|
+
color: ${(props) => props.descriptionColor === "neutral" ? props.theme.colors.neutral["600"] : props.theme.colors.brand["600"]};
|
|
62
|
+
`;
|
|
63
|
+
const RightAddon = (0, import_styled_components.default)(import_ds_grid.Grid)`
|
|
64
|
+
margin: 0;
|
|
65
|
+
white-space: nowrap;
|
|
66
|
+
`;
|
|
67
|
+
const RightDescription = (0, import_styled_components.default)(import_ds_grid.Grid)`
|
|
68
|
+
margin: 0;
|
|
69
|
+
white-space: nowrap;
|
|
70
|
+
font-size: 12px;
|
|
71
|
+
color: ${(props) => props.theme.colors.neutral["600"]};
|
|
72
|
+
`;
|
|
73
|
+
const RightValue = (0, import_styled_components.default)(import_ds_grid.Grid)`
|
|
74
|
+
margin: 0;
|
|
75
|
+
white-space: nowrap;
|
|
76
|
+
font-size: 14px;
|
|
77
|
+
color: ${(props) => props.theme.colors.neutral["800"]};
|
|
78
|
+
`;
|
|
79
|
+
const ExpandContent = import_styled_components.default.div`
|
|
80
|
+
font-size: 12px;
|
|
81
|
+
`;
|
|
82
|
+
const border = ({ active, theme }) => active ? theme.colors.brand["600"] : theme.colors.neutral["200"];
|
|
83
|
+
const background = ({ active, theme }) => active ? theme.colors.brand["100"] : theme.colors.neutral["000"];
|
|
84
|
+
const Container = (0, import_styled_components.default)(import_ds_grid.Grid)`
|
|
85
|
+
width: 100%;
|
|
86
|
+
min-height: 52px;
|
|
87
|
+
min-width: 244px;
|
|
88
|
+
padding: 6px 8px 6px 12px;
|
|
89
|
+
position: relative;
|
|
90
|
+
border-top: 1px solid ${border};
|
|
91
|
+
border-bottom: 1px solid ${border};
|
|
92
|
+
background: ${background};
|
|
93
|
+
${(props) => props.disabled ? `
|
|
94
|
+
${Title}, ${Description}, ${RightDescription}, ${RightValue} {
|
|
95
|
+
color: ${props.theme.colors.neutral["500"]};
|
|
96
|
+
}
|
|
97
|
+
` : ""}
|
|
98
|
+
&:hover {
|
|
99
|
+
box-shadow: 0 2px 4px 0 rgba(53, 60, 70, 0.5);
|
|
100
|
+
z-index: 1;
|
|
101
|
+
}
|
|
102
|
+
/* & + ${Container} {
|
|
103
|
+
border-top-color: blue;
|
|
104
|
+
} */
|
|
105
|
+
`;
|
|
106
|
+
module.exports = __toCommonJS(styled_exports);
|
|
107
|
+
//# sourceMappingURL=styled.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/detail/styled.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import styled from 'styled-components';\nimport { Grid } from '@elliemae/ds-grid';\n\nexport const Separator = styled.div`\n width: 100%;\n height: 24px;\n border-right: 1px solid ${(props) => props.theme.colors.neutral['300']};\n margin: 0 8px;\n`;\n\nexport const Title = styled.h3`\n margin: 0;\n font-size: 16px;\n min-height: 20px;\n font-weight: ${(props) => props.theme.fontWeights.semibold};\n color: ${(props) => props.theme.colors.neutral['700']};\n`;\n\nexport const Description = styled.p`\n margin: 0;\n font-size: 12px;\n min-height: 18px;\n display: flex;\n align-items: center;\n color: ${(props) =>\n props.descriptionColor === 'neutral'\n ? props.theme.colors.neutral['600']\n : props.theme.colors.brand['600']};\n`;\n\nexport const RightAddon = styled(Grid)`\n margin: 0;\n white-space: nowrap;\n`;\n\nexport const RightDescription = styled(Grid)`\n margin: 0;\n white-space: nowrap;\n font-size: 12px;\n color: ${(props) => props.theme.colors.neutral['600']};\n`;\nexport const RightValue = styled(Grid)`\n margin: 0;\n white-space: nowrap;\n font-size: 14px;\n color: ${(props) => props.theme.colors.neutral['800']};\n`;\n\nexport const ExpandContent = styled.div`\n font-size: 12px;\n`;\n\nconst border = ({ active, theme }) =>\n active ? theme.colors.brand['600'] : theme.colors.neutral['200'];\nconst background = ({ active, theme }) =>\n active ? theme.colors.brand['100'] : theme.colors.neutral['000'];\n\nexport const Container = styled(Grid)`\n width: 100%;\n min-height: 52px;\n min-width: 244px;\n padding: 6px 8px 6px 12px;\n position: relative;\n border-top: 1px solid ${border};\n border-bottom: 1px solid ${border};\n background: ${background};\n ${(props) =>\n props.disabled\n ? `\n ${Title}, ${Description}, ${RightDescription}, ${RightValue} {\n color: ${props.theme.colors.neutral['500']};\n }\n `\n : ''}\n &:hover {\n box-shadow: 0 2px 4px 0 rgba(53, 60, 70, 0.5);\n z-index: 1;\n }\n /* & + ${Container} {\n border-top-color: blue;\n } */\n`;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,+BAAmB;AACnB,qBAAqB;AAEd,MAAM,YAAY,iCAAO;AAAA;AAAA;AAAA,4BAGJ,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ;AAAA;AAAA;AAI3D,MAAM,QAAQ,iCAAO;AAAA;AAAA;AAAA;AAAA,iBAIX,CAAC,UAAU,MAAM,MAAM,YAAY;AAAA,WACzC,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ;AAAA;AAG1C,MAAM,cAAc,iCAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,WAMvB,CAAC,UACR,MAAM,qBAAqB,YACvB,MAAM,MAAM,OAAO,QAAQ,SAC3B,MAAM,MAAM,OAAO,MAAM;AAAA;AAG1B,MAAM,aAAa,sCAAO;AAAA;AAAA;AAAA;AAK1B,MAAM,mBAAmB,sCAAO;AAAA;AAAA;AAAA;AAAA,WAI5B,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ;AAAA;AAE1C,MAAM,aAAa,sCAAO;AAAA;AAAA;AAAA;AAAA,WAItB,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ;AAAA;AAG1C,MAAM,gBAAgB,iCAAO;AAAA;AAAA;AAIpC,MAAM,SAAS,CAA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