@elliemae/ds-card 2.3.0-next.0 → 3.0.0-alpha.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/dist/cjs/DSCard.js +67 -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 +38 -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/{types → dist/types}/DSCard.d.ts +0 -0
- package/{types → dist/types}/DSCardBody.d.ts +0 -0
- package/{types → dist/types}/DSCardHeader.d.ts +0 -0
- package/{types → dist/types}/detail/DetailCard.d.ts +0 -0
- package/{types → dist/types}/detail/styled.d.ts +7 -4
- package/{types → dist/types}/index.d.ts +0 -0
- package/{types → dist/types}/tests/DSCard.test.d.ts +0 -0
- package/{types → dist/types}/v2/ActionAddon.d.ts +0 -0
- package/{types → dist/types}/v2/Card.d.ts +0 -0
- package/{types → dist/types}/v2/Group.d.ts +0 -0
- package/{types → dist/types}/v2/components.d.ts +1 -1
- package/package.json +51 -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
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/v2/ActionAddon.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { PropTypes, describe } from 'react-desc';\nimport styled from 'styled-components';\nimport { ChevronSmallDown } from '@elliemae/ds-icons';\nimport Button from '@elliemae/ds-button';\n\nconst Addon = styled(Button)`\n background-color: transparent;\n padding-right: 4px;\n height: 100%;\n border: none;\n font-size: 12px;\n font-weight: ${(props) => props.theme.fontWeights.semibold};\n color: ${(props) => props.theme.colors.brand['700']};\n cursor: pointer;\n &:focus,\n &::after {\n background-color: transparent;\n box-shadow: none !important; /* needed */\n border: none !important; /* needed */\n }\n`;\n\nconst ActionAddon = ({ label, onClick, icon }) => (\n <Addon onClick={onClick} labelText={label} icon={icon || <ChevronSmallDown color={['brand-primary', 700]} />} />\n);\n\nconst actionProps = {\n /**\n * Addon label\n */\n label: PropTypes.string.description('Addon label'),\n /**\n * On click callback\n */\n onClick: PropTypes.func.description('On click callback'),\n /**\n * Icon to display after the label\n */\n icon: PropTypes.element.description('Icon to display after the label'),\n};\n\nActionAddon.propTypes = actionProps;\nconst DSCardActionAddonWithSchema = describe(ActionAddon);\nDSCardActionAddonWithSchema.propTypes = actionProps;\n\nexport { ActionAddon, DSCardActionAddonWithSchema };\nexport default ActionAddon;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAClB,wBAAoC;AACpC,+BAAmB;AACnB,sBAAiC;AACjC,uBAAmB;AAEnB,MAAM,QAAQ,sCAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAMJ,CAAC,UAAU,MAAM,MAAM,YAAY;AAAA,WACzC,CAAC,UAAU,MAAM,MAAM,OAAO,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAU/C,MAAM,cAAc,CAAC,EAAE,OAAO,SAAS,WACrC,mDAAC,OAAD;AAAA,EAAO;AAAA,EAAkB,WAAW;AAAA,EAAO,MAAM,QAAQ,mDAAC,kCAAD;AAAA,IAAkB,OAAO,CAAC,iBAAiB;AAAA;AAAA;AAGtG,MAAM,cAAc;AAAA,EAIlB,OAAO,4BAAU,OAAO,YAAY;AAAA,EAIpC,SAAS,4BAAU,KAAK,YAAY;AAAA,EAIpC,MAAM,4BAAU,QAAQ,YAAY;AAAA;AAGtC,YAAY,YAAY;AACxB,MAAM,8BAA8B,gCAAS;AAC7C,4BAA4B,YAAY;AAGxC,IAAO,sBAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
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 Card_exports = {};
|
|
29
|
+
__export(Card_exports, {
|
|
30
|
+
CustomCard: () => CustomCard,
|
|
31
|
+
DSCardCustomWithSchema: () => DSCardCustomWithSchema,
|
|
32
|
+
default: () => Card_default
|
|
33
|
+
});
|
|
34
|
+
var React = __toESM(require("react"));
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_react_desc = require("react-desc");
|
|
37
|
+
var import_ds_header = require("@elliemae/ds-header");
|
|
38
|
+
var import_ds_truncated_tooltip_text = __toESM(require("@elliemae/ds-truncated-tooltip-text"));
|
|
39
|
+
var import_components = require("./components");
|
|
40
|
+
const getCol = (rightAddon) => {
|
|
41
|
+
if (!rightAddon)
|
|
42
|
+
return [1];
|
|
43
|
+
return [1, "auto"];
|
|
44
|
+
};
|
|
45
|
+
const CustomCard = ({
|
|
46
|
+
title,
|
|
47
|
+
description,
|
|
48
|
+
leftAddon,
|
|
49
|
+
rightAddon,
|
|
50
|
+
hasBorder = false
|
|
51
|
+
}) => /* @__PURE__ */ import_react.default.createElement(import_ds_truncated_tooltip_text.TooltipTextProvider, null, /* @__PURE__ */ import_react.default.createElement(import_components.CardContainer, {
|
|
52
|
+
hasBorder,
|
|
53
|
+
cols: getCol(rightAddon),
|
|
54
|
+
"data-testid": "em-ds-card"
|
|
55
|
+
}, /* @__PURE__ */ import_react.default.createElement(import_components.LeftSection, null, leftAddon && /* @__PURE__ */ import_react.default.createElement(import_components.LeftAddon, null, leftAddon), /* @__PURE__ */ import_react.default.createElement(import_components.MainSection, {
|
|
56
|
+
style: {
|
|
57
|
+
maxWidth: leftAddon ? "calc(100% - 40px)" : "100%"
|
|
58
|
+
}
|
|
59
|
+
}, /* @__PURE__ */ import_react.default.createElement(import_ds_header.DSHeader, {
|
|
60
|
+
fontSize: "16px",
|
|
61
|
+
"data-testid": "em-ds-card-header",
|
|
62
|
+
fontWeight: "regular",
|
|
63
|
+
color: "neutral.800",
|
|
64
|
+
text: /* @__PURE__ */ import_react.default.createElement(import_ds_truncated_tooltip_text.default, {
|
|
65
|
+
value: title
|
|
66
|
+
})
|
|
67
|
+
}), description && /* @__PURE__ */ import_react.default.createElement(import_components.Description, null, /* @__PURE__ */ import_react.default.createElement(import_ds_truncated_tooltip_text.default, {
|
|
68
|
+
value: description
|
|
69
|
+
})))), rightAddon && /* @__PURE__ */ import_react.default.createElement(import_components.RightAddonSection, null, rightAddon[0] && /* @__PURE__ */ import_react.default.createElement(import_components.RightAddon, null, rightAddon[0]), rightAddon[1] && /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, rightAddon.length > 1 && /* @__PURE__ */ import_react.default.createElement(import_components.Separator, null), /* @__PURE__ */ import_react.default.createElement(import_components.RightAddon, null, rightAddon[1])))));
|
|
70
|
+
const cardProps = {
|
|
71
|
+
title: import_react_desc.PropTypes.string.isRequired.description("Title of the card. requiered"),
|
|
72
|
+
description: import_react_desc.PropTypes.string.description("Description of the card. not requiered"),
|
|
73
|
+
leftAddon: import_react_desc.PropTypes.element.description("Left Addon"),
|
|
74
|
+
rightAddon: import_react_desc.PropTypes.array.description("Right addon array, max elements: 2"),
|
|
75
|
+
hasBorder: import_react_desc.PropTypes.bool.description("Wheter if the card has border or not")
|
|
76
|
+
};
|
|
77
|
+
CustomCard.propTypes = cardProps;
|
|
78
|
+
const DSCardCustomWithSchema = (0, import_react_desc.describe)(CustomCard);
|
|
79
|
+
DSCardCustomWithSchema.propTypes = cardProps;
|
|
80
|
+
var Card_default = CustomCard;
|
|
81
|
+
module.exports = __toCommonJS(Card_exports);
|
|
82
|
+
//# sourceMappingURL=Card.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/v2/Card.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { PropTypes, describe } from 'react-desc';\nimport { DSHeader } from '@elliemae/ds-header';\nimport DSTruncatedTooltipText, {\n TooltipTextProvider,\n} from '@elliemae/ds-truncated-tooltip-text';\nimport {\n CardContainer,\n LeftSection,\n LeftAddon,\n RightAddonSection,\n RightAddon,\n Separator,\n MainSection,\n Description,\n} from './components';\n\nconst getCol = (rightAddon) => {\n if (!rightAddon) return [1];\n return [1, 'auto'];\n};\n\nconst CustomCard = ({\n title,\n description,\n leftAddon,\n rightAddon, // array. max 2 elements\n hasBorder = false,\n}) => (\n <TooltipTextProvider>\n <CardContainer\n hasBorder={hasBorder}\n cols={getCol(rightAddon)}\n data-testid=\"em-ds-card\"\n >\n <LeftSection>\n {leftAddon && <LeftAddon>{leftAddon}</LeftAddon>}\n <MainSection\n style={{\n maxWidth: leftAddon ? 'calc(100% - 40px)' : '100%',\n }}\n >\n <DSHeader\n fontSize=\"16px\"\n data-testid=\"em-ds-card-header\"\n fontWeight=\"regular\"\n color=\"neutral.800\"\n text={<DSTruncatedTooltipText value={title} />}\n />\n {description && (\n <Description>\n <DSTruncatedTooltipText value={description} />\n </Description>\n )}\n </MainSection>\n </LeftSection>\n {rightAddon && (\n <RightAddonSection>\n {rightAddon[0] && <RightAddon>{rightAddon[0]}</RightAddon>}\n {rightAddon[1] && (\n <>\n {rightAddon.length > 1 && <Separator />}\n <RightAddon>{rightAddon[1]}</RightAddon>\n </>\n )}\n </RightAddonSection>\n )}\n </CardContainer>\n </TooltipTextProvider>\n);\n\nconst cardProps = {\n /**\n * Title of the card. requiered\n */\n title: PropTypes.string.isRequired.description(\n 'Title of the card. requiered',\n ),\n /**\n * Description of the card. not requiered\n */\n description: PropTypes.string.description(\n 'Description of the card. not requiered',\n ),\n /**\n * Left Addon\n */\n leftAddon: PropTypes.element.description('Left Addon'),\n /**\n * Right addon array, max elements: 2\n */\n rightAddon: PropTypes.array.description('Right addon array, max elements: 2'),\n /**\n * Wheter if the card has border or not\n */\n hasBorder: PropTypes.bool.description('Wheter if the card has border or not'),\n};\n\nCustomCard.propTypes = cardProps;\nconst DSCardCustomWithSchema = describe(CustomCard);\nDSCardCustomWithSchema.propTypes = cardProps;\n\nexport { CustomCard, DSCardCustomWithSchema };\nexport default CustomCard;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAClB,wBAAoC;AACpC,uBAAyB;AACzB,uCAEO;AACP,wBASO;AAEP,MAAM,SAAS,CAAC,eAAe;AAC7B,MAAI,CAAC;AAAY,WAAO,CAAC;AACzB,SAAO,CAAC,GAAG;AAAA;AAGb,MAAM,aAAa,CAAC;AAAA,EAClB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,YAAY;AAAA,MAEZ,mDAAC,sDAAD,MACE,mDAAC,iCAAD;AAAA,EACE;AAAA,EACA,MAAM,OAAO;AAAA,EACb,eAAY;AAAA,GAEZ,mDAAC,+BAAD,MACG,aAAa,mDAAC,6BAAD,MAAY,YAC1B,mDAAC,+BAAD;AAAA,EACE,OAAO;AAAA,IACL,UAAU,YAAY,sBAAsB;AAAA;AAAA,GAG9C,mDAAC,2BAAD;AAAA,EACE,UAAS;AAAA,EACT,eAAY;AAAA,EACZ,YAAW;AAAA,EACX,OAAM;AAAA,EACN,MAAM,mDAAC,0CAAD;AAAA,IAAwB,OAAO;AAAA;AAAA,IAEtC,eACC,mDAAC,+BAAD,MACE,mDAAC,0CAAD;AAAA,EAAwB,OAAO;AAAA,OAKtC,cACC,mDAAC,qCAAD,MACG,WAAW,MAAM,mDAAC,8BAAD,MAAa,WAAW,KACzC,WAAW,MACV,wFACG,WAAW,SAAS,KAAK,mDAAC,6BAAD,OAC1B,mDAAC,8BAAD,MAAa,WAAW;AAStC,MAAM,YAAY;AAAA,EAIhB,OAAO,4BAAU,OAAO,WAAW,YACjC;AAAA,EAKF,aAAa,4BAAU,OAAO,YAC5B;AAAA,EAKF,WAAW,4BAAU,QAAQ,YAAY;AAAA,EAIzC,YAAY,4BAAU,MAAM,YAAY;AAAA,EAIxC,WAAW,4BAAU,KAAK,YAAY;AAAA;AAGxC,WAAW,YAAY;AACvB,MAAM,yBAAyB,gCAAS;AACxC,uBAAuB,YAAY;AAGnC,IAAO,eAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
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 Group_exports = {};
|
|
29
|
+
__export(Group_exports, {
|
|
30
|
+
CardGroup: () => CardGroup,
|
|
31
|
+
DSCardGroupWithSchema: () => DSCardGroupWithSchema,
|
|
32
|
+
default: () => Group_default
|
|
33
|
+
});
|
|
34
|
+
var React = __toESM(require("react"));
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_react_desc = require("react-desc");
|
|
37
|
+
var import_styled_components = __toESM(require("styled-components"));
|
|
38
|
+
var import_ds_system = require("@elliemae/ds-system");
|
|
39
|
+
var import_Card = __toESM(require("./Card"));
|
|
40
|
+
const Group = import_styled_components.default.div`
|
|
41
|
+
display: flex;
|
|
42
|
+
flex-direction: column;
|
|
43
|
+
width: 100%;
|
|
44
|
+
max-width: 100%;
|
|
45
|
+
${import_Card.default} {
|
|
46
|
+
border-top: none;
|
|
47
|
+
}
|
|
48
|
+
${({ theme, withTopBorder }) => withTopBorder ? `border-top: ${theme.colors.neutral["100"]}` : ""}
|
|
49
|
+
`;
|
|
50
|
+
const GroupTitle = import_styled_components.default.span`
|
|
51
|
+
${(0, import_ds_system.truncate)()}
|
|
52
|
+
`;
|
|
53
|
+
const TitleWrapper = import_styled_components.default.div`
|
|
54
|
+
display: flex;
|
|
55
|
+
justify-content: space-between;
|
|
56
|
+
padding: 0 ${(props) => props.theme.space.xs};
|
|
57
|
+
font-size: 12px;
|
|
58
|
+
${(0, import_ds_system.color)("neutral", "700")};
|
|
59
|
+
font-weight: ${(props) => props.theme.fontWeights.semibold};
|
|
60
|
+
background-color: ${(props) => props.theme.colors.neutral["080"]};
|
|
61
|
+
border-top: ${(props) => (0, import_ds_system.border)(props.theme.colors.neutral["080"])};
|
|
62
|
+
line-height: 24px;
|
|
63
|
+
`;
|
|
64
|
+
const Items = import_styled_components.default.div`
|
|
65
|
+
display: flex;
|
|
66
|
+
flex-direction: column;
|
|
67
|
+
`;
|
|
68
|
+
const CardGroup = ({ children, title, action }) => /* @__PURE__ */ import_react.default.createElement(Group, {
|
|
69
|
+
withTopBorder: !title
|
|
70
|
+
}, !!title && /* @__PURE__ */ import_react.default.createElement(TitleWrapper, null, /* @__PURE__ */ import_react.default.createElement(GroupTitle, null, title), action), /* @__PURE__ */ import_react.default.createElement(Items, null, children));
|
|
71
|
+
const cardgroupProps = {
|
|
72
|
+
children: import_react_desc.PropTypes.element.isRequired.description("Card items"),
|
|
73
|
+
title: import_react_desc.PropTypes.string.isRequired.description("Title of the group"),
|
|
74
|
+
action: import_react_desc.PropTypes.element.description("Right addon action")
|
|
75
|
+
};
|
|
76
|
+
CardGroup.propTypes = cardgroupProps;
|
|
77
|
+
const DSCardGroupWithSchema = (0, import_react_desc.describe)(CardGroup);
|
|
78
|
+
DSCardGroupWithSchema.propTypes = cardgroupProps;
|
|
79
|
+
var Group_default = CardGroup;
|
|
80
|
+
module.exports = __toCommonJS(Group_exports);
|
|
81
|
+
//# sourceMappingURL=Group.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/v2/Group.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { PropTypes, describe } from 'react-desc';\nimport styled from 'styled-components';\nimport { color, border, truncate } from '@elliemae/ds-system';\nimport Card from './Card';\n\nconst Group = styled.div`\n display: flex;\n flex-direction: column;\n width: 100%;\n max-width: 100%;\n ${Card} {\n border-top: none;\n }\n ${({ theme, withTopBorder }) =>\n withTopBorder ? `border-top: ${theme.colors.neutral['100']}` : ''}\n`;\n\nconst GroupTitle = styled.span`\n ${truncate()}\n`;\n\nconst TitleWrapper = styled.div`\n display: flex;\n justify-content: space-between;\n padding: 0 ${(props) => props.theme.space.xs};\n font-size: 12px;\n ${color('neutral', '700')};\n font-weight: ${(props) => props.theme.fontWeights.semibold};\n background-color: ${(props) => props.theme.colors.neutral['080']};\n border-top: ${(props) => border(props.theme.colors.neutral['080'])};\n line-height: 24px;\n`;\n\nconst Items = styled.div`\n display: flex;\n flex-direction: column;\n`;\n\nconst CardGroup = ({ children, title, action }) => (\n <Group withTopBorder={!title}>\n {!!title && (\n <TitleWrapper>\n <GroupTitle>{title}</GroupTitle>\n {action}\n </TitleWrapper>\n )}\n <Items>{children}</Items>\n </Group>\n);\n\nconst cardgroupProps = {\n /**\n * Card items\n */\n children: PropTypes.element.isRequired.description('Card items'),\n /**\n * Title of the group\n */\n title: PropTypes.string.isRequired.description('Title of the group'),\n /**\n * Right addon action\n */\n action: PropTypes.element.description('Right addon action'),\n};\n\nCardGroup.propTypes = cardgroupProps;\nconst DSCardGroupWithSchema = describe(CardGroup);\nDSCardGroupWithSchema.propTypes = cardgroupProps;\n\nexport { CardGroup, DSCardGroupWithSchema };\nexport default CardGroup;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAClB,wBAAoC;AACpC,+BAAmB;AACnB,uBAAwC;AACxC,kBAAiB;AAEjB,MAAM,QAAQ,iCAAO;AAAA;AAAA;AAAA;AAAA;AAAA,IAKjB;AAAA;AAAA;AAAA,IAGA,CAAC,EAAE,OAAO,oBACV,gBAAgB,eAAe,MAAM,OAAO,QAAQ,WAAW;AAAA;AAGnE,MAAM,aAAa,iCAAO;AAAA,IACtB;AAAA;AAGJ,MAAM,eAAe,iCAAO;AAAA;AAAA;AAAA,eAGb,CAAC,UAAU,MAAM,MAAM,MAAM;AAAA;AAAA,IAExC,4BAAM,WAAW;AAAA,iBACJ,CAAC,UAAU,MAAM,MAAM,YAAY;AAAA,sBAC9B,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ;AAAA,gBAC5C,CAAC,UAAU,6BAAO,MAAM,MAAM,OAAO,QAAQ;AAAA;AAAA;AAI7D,MAAM,QAAQ,iCAAO;AAAA;AAAA;AAAA;AAKrB,MAAM,YAAY,CAAC,EAAE,UAAU,OAAO,aACpC,mDAAC,OAAD;AAAA,EAAO,eAAe,CAAC;AAAA,GACpB,CAAC,CAAC,SACD,mDAAC,cAAD,MACE,mDAAC,YAAD,MAAa,QACZ,SAGL,mDAAC,OAAD,MAAQ;AAIZ,MAAM,iBAAiB;AAAA,EAIrB,UAAU,4BAAU,QAAQ,WAAW,YAAY;AAAA,EAInD,OAAO,4BAAU,OAAO,WAAW,YAAY;AAAA,EAI/C,QAAQ,4BAAU,QAAQ,YAAY;AAAA;AAGxC,UAAU,YAAY;AACtB,MAAM,wBAAwB,gCAAS;AACvC,sBAAsB,YAAY;AAGlC,IAAO,gBAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
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 components_exports = {};
|
|
29
|
+
__export(components_exports, {
|
|
30
|
+
CardContainer: () => CardContainer,
|
|
31
|
+
Description: () => Description,
|
|
32
|
+
LeftAddon: () => LeftAddon,
|
|
33
|
+
LeftSection: () => LeftSection,
|
|
34
|
+
MainSection: () => MainSection,
|
|
35
|
+
RightAddon: () => RightAddon,
|
|
36
|
+
RightAddonSection: () => RightAddonSection,
|
|
37
|
+
Separator: () => Separator,
|
|
38
|
+
Title: () => Title
|
|
39
|
+
});
|
|
40
|
+
var React = __toESM(require("react"));
|
|
41
|
+
var import_styled_components = __toESM(require("styled-components"));
|
|
42
|
+
var import_ds_grid = require("@elliemae/ds-grid");
|
|
43
|
+
const CardContainer = (0, import_styled_components.default)(import_ds_grid.Grid)`
|
|
44
|
+
align-items: center;
|
|
45
|
+
justify-content: space-between;
|
|
46
|
+
width: 100%;
|
|
47
|
+
height: 56px;
|
|
48
|
+
padding: 8px 16px;
|
|
49
|
+
position: relative;
|
|
50
|
+
border: ${({ theme, hasBorder }) => hasBorder ? `1px solid ${theme.colors.neutral["100"]}` : ""};
|
|
51
|
+
&:before {
|
|
52
|
+
content: '';
|
|
53
|
+
border-bottom: 1px solid ${(props) => props.theme.colors.neutral["100"]};
|
|
54
|
+
position: absolute;
|
|
55
|
+
margin: 0 auto;
|
|
56
|
+
width: 90%;
|
|
57
|
+
bottom: 0;
|
|
58
|
+
}
|
|
59
|
+
&:last-child::before {
|
|
60
|
+
content: none;
|
|
61
|
+
}
|
|
62
|
+
`;
|
|
63
|
+
const LeftSection = import_styled_components.default.div`
|
|
64
|
+
display: flex;
|
|
65
|
+
align-items: center;
|
|
66
|
+
`;
|
|
67
|
+
const LeftAddon = import_styled_components.default.div`
|
|
68
|
+
height: fit-content;
|
|
69
|
+
width: fit-content;
|
|
70
|
+
margin-right: 16px;
|
|
71
|
+
cursor: pointer;
|
|
72
|
+
`;
|
|
73
|
+
const RightAddonSection = import_styled_components.default.div`
|
|
74
|
+
display: flex;
|
|
75
|
+
align-items: center;
|
|
76
|
+
width: fit-content;
|
|
77
|
+
`;
|
|
78
|
+
const RightAddon = import_styled_components.default.div`
|
|
79
|
+
height: fit-content;
|
|
80
|
+
width: fit-content;
|
|
81
|
+
cursor: pointer;
|
|
82
|
+
`;
|
|
83
|
+
const Separator = import_styled_components.default.div`
|
|
84
|
+
width: 0px;
|
|
85
|
+
height: 24px;
|
|
86
|
+
border-right: 1px solid ${(props) => props.theme.colors.neutral["300"]};
|
|
87
|
+
margin: 0 8px;
|
|
88
|
+
`;
|
|
89
|
+
const MainSection = import_styled_components.default.div`
|
|
90
|
+
display: flex;
|
|
91
|
+
flex-direction: column;
|
|
92
|
+
`;
|
|
93
|
+
const Title = import_styled_components.default.h3`
|
|
94
|
+
margin: 0;
|
|
95
|
+
font-size: 16px;
|
|
96
|
+
font-weight: ${(props) => props.theme.fontWeights.regular};
|
|
97
|
+
color: ${(props) => props.theme.colors.neutral["800"]};
|
|
98
|
+
`;
|
|
99
|
+
const Description = import_styled_components.default.p`
|
|
100
|
+
margin: 0;
|
|
101
|
+
color: ${(props) => props.theme.colors.neutral["600"]};
|
|
102
|
+
`;
|
|
103
|
+
module.exports = __toCommonJS(components_exports);
|
|
104
|
+
//# sourceMappingURL=components.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/v2/components.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import styled from 'styled-components';\nimport { Grid } from '@elliemae/ds-grid';\n\nconst CardContainer = styled(Grid)`\n align-items: center;\n justify-content: space-between;\n width: 100%;\n height: 56px;\n padding: 8px 16px;\n position: relative;\n border: ${({ theme, hasBorder }) =>\n hasBorder ? `1px solid ${theme.colors.neutral['100']}` : ''};\n &:before {\n content: '';\n border-bottom: 1px solid ${(props) => props.theme.colors.neutral['100']};\n position: absolute;\n margin: 0 auto;\n width: 90%;\n bottom: 0;\n }\n &:last-child::before {\n content: none;\n }\n`;\n\nconst LeftSection = styled.div`\n display: flex;\n align-items: center;\n`;\n\nconst LeftAddon = styled.div`\n height: fit-content;\n width: fit-content;\n margin-right: 16px;\n cursor: pointer;\n`;\n\nconst RightAddonSection = styled.div`\n display: flex;\n align-items: center;\n width: fit-content;\n`;\n\nconst RightAddon = styled.div`\n height: fit-content;\n width: fit-content;\n cursor: pointer;\n`;\n\nconst Separator = styled.div`\n width: 0px;\n height: 24px;\n border-right: 1px solid ${(props) => props.theme.colors.neutral['300']};\n margin: 0 8px;\n`;\n\nconst MainSection = styled.div`\n display: flex;\n flex-direction: column;\n`;\n\nconst Title = styled.h3`\n margin: 0;\n font-size: 16px;\n font-weight: ${(props) => props.theme.fontWeights.regular};\n color: ${(props) => props.theme.colors.neutral['800']};\n`;\n\nconst Description = styled.p`\n margin: 0;\n color: ${(props) => props.theme.colors.neutral['600']};\n`;\n\nexport {\n CardContainer,\n LeftSection,\n LeftAddon,\n RightAddonSection,\n RightAddon,\n Separator,\n MainSection,\n Title,\n Description,\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,+BAAmB;AACnB,qBAAqB;AAErB,MAAM,gBAAgB,sCAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YAOjB,CAAC,EAAE,OAAO,gBAClB,YAAY,aAAa,MAAM,OAAO,QAAQ,WAAW;AAAA;AAAA;AAAA,+BAG9B,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAWrE,MAAM,cAAc,iCAAO;AAAA;AAAA;AAAA;AAK3B,MAAM,YAAY,iCAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAOzB,MAAM,oBAAoB,iCAAO;AAAA;AAAA;AAAA;AAAA;AAMjC,MAAM,aAAa,iCAAO;AAAA;AAAA;AAAA;AAAA;AAM1B,MAAM,YAAY,iCAAO;AAAA;AAAA;AAAA,4BAGG,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ;AAAA;AAAA;AAIlE,MAAM,cAAc,iCAAO;AAAA;AAAA;AAAA;AAK3B,MAAM,QAAQ,iCAAO;AAAA;AAAA;AAAA,iBAGJ,CAAC,UAAU,MAAM,MAAM,YAAY;AAAA,WACzC,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ;AAAA;AAGjD,MAAM,cAAc,iCAAO;AAAA;AAAA,WAEhB,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import React2 from "react";
|
|
3
|
+
import { PropTypes, describe } from "react-desc";
|
|
4
|
+
import { convertPropToCssClassName } from "@elliemae/ds-classnames";
|
|
5
|
+
import DSCardBody from "./DSCardBody";
|
|
6
|
+
import DSCardHeader from "./DSCardHeader";
|
|
7
|
+
const DSCard = ({
|
|
8
|
+
innerRef = void 0,
|
|
9
|
+
children = null,
|
|
10
|
+
containerProps = {},
|
|
11
|
+
...otherProps
|
|
12
|
+
}) => {
|
|
13
|
+
const { cssClassName } = convertPropToCssClassName("card");
|
|
14
|
+
return /* @__PURE__ */ React2.createElement("div", {
|
|
15
|
+
"data-testid": "card",
|
|
16
|
+
...containerProps,
|
|
17
|
+
ref: innerRef,
|
|
18
|
+
className: cssClassName,
|
|
19
|
+
...otherProps
|
|
20
|
+
}, children);
|
|
21
|
+
};
|
|
22
|
+
const cardProps = {
|
|
23
|
+
containerProps: PropTypes.object.description("inject props to component wrapper"),
|
|
24
|
+
innerRef: PropTypes.string.description("Get reference for the button"),
|
|
25
|
+
children: PropTypes.arrayOf(PropTypes.shape({
|
|
26
|
+
type: PropTypes.oneOf([DSCardHeader, DSCardBody])
|
|
27
|
+
})).description("DSCardBody and DSCardHeader")
|
|
28
|
+
};
|
|
29
|
+
DSCard.propTypes = cardProps;
|
|
30
|
+
const DSCardWithSchema = describe(DSCard);
|
|
31
|
+
DSCardWithSchema.propTypes = cardProps;
|
|
32
|
+
var DSCard_default = DSCard;
|
|
33
|
+
export {
|
|
34
|
+
DSCard,
|
|
35
|
+
DSCardWithSchema,
|
|
36
|
+
DSCard_default as default
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=DSCard.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/DSCard.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { PropTypes, describe } from 'react-desc';\nimport { convertPropToCssClassName } from '@elliemae/ds-classnames';\nimport DSCardBody from './DSCardBody';\nimport DSCardHeader from './DSCardHeader';\n\nconst DSCard = ({\n innerRef = undefined,\n children = null,\n containerProps = {},\n ...otherProps\n}) => {\n const { cssClassName } = convertPropToCssClassName('card');\n\n return (\n <div\n data-testid=\"card\"\n {...containerProps}\n ref={innerRef}\n className={cssClassName}\n {...otherProps}\n >\n {children}\n </div>\n );\n};\n\nconst cardProps = {\n /** inject props to component wrapper */\n containerProps: PropTypes.object.description(\n 'inject props to component wrapper',\n ),\n /**\n * Get reference for the button\n */\n innerRef: PropTypes.string.description('Get reference for the button'),\n /**\n * DSCardBody and DSCardHeader\n */\n children: PropTypes.arrayOf(\n PropTypes.shape({\n type: PropTypes.oneOf([DSCardHeader, DSCardBody]),\n }),\n ).description('DSCardBody and DSCardHeader'),\n};\n\nDSCard.propTypes = cardProps;\nconst DSCardWithSchema = describe(DSCard);\nDSCardWithSchema.propTypes = cardProps;\n\nexport { DSCard, DSCardWithSchema };\nexport default DSCard;\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AACA;AACA;AACA;AAEA,MAAM,SAAS,CAAC;AAAA,EACd,WAAW;AAAA,EACX,WAAW;AAAA,EACX,iBAAiB;AAAA,KACd;AAAA,MACC;AACJ,QAAM,EAAE,iBAAiB,0BAA0B;AAEnD,SACE,qCAAC,OAAD;AAAA,IACE,eAAY;AAAA,OACR;AAAA,IACJ,KAAK;AAAA,IACL,WAAW;AAAA,OACP;AAAA,KAEH;AAAA;AAKP,MAAM,YAAY;AAAA,EAEhB,gBAAgB,UAAU,OAAO,YAC/B;AAAA,EAKF,UAAU,UAAU,OAAO,YAAY;AAAA,EAIvC,UAAU,UAAU,QAClB,UAAU,MAAM;AAAA,IACd,MAAM,UAAU,MAAM,CAAC,cAAc;AAAA,MAEvC,YAAY;AAAA;AAGhB,OAAO,YAAY;AACnB,MAAM,mBAAmB,SAAS;AAClC,iBAAiB,YAAY;AAG7B,IAAO,iBAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import React2 from "react";
|
|
3
|
+
import { PropTypes, describe } from "react-desc";
|
|
4
|
+
const DSCardBody = ({ children }) => /* @__PURE__ */ React2.createElement("div", {
|
|
5
|
+
className: "em-ds-card-body",
|
|
6
|
+
"data-testid": "card-body"
|
|
7
|
+
}, children);
|
|
8
|
+
const bodyProps = {
|
|
9
|
+
children: PropTypes.element.description("children")
|
|
10
|
+
};
|
|
11
|
+
DSCardBody.propTypes = bodyProps;
|
|
12
|
+
const DSCardBodyWithSchema = describe(DSCardBody);
|
|
13
|
+
DSCardBodyWithSchema.propTypes = bodyProps;
|
|
14
|
+
var DSCardBody_default = DSCardBody;
|
|
15
|
+
export {
|
|
16
|
+
DSCardBody,
|
|
17
|
+
DSCardBodyWithSchema,
|
|
18
|
+
DSCardBody_default as default
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=DSCardBody.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/DSCardBody.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { PropTypes, describe } from 'react-desc';\n\nconst DSCardBody = ({ children }) => (\n <div className=\"em-ds-card-body\" data-testid=\"card-body\">\n {children}\n </div>\n);\n\nconst bodyProps = {\n /** children */\n children: PropTypes.element.description('children'),\n};\n\nDSCardBody.propTypes = bodyProps;\nconst DSCardBodyWithSchema = describe(DSCardBody);\nDSCardBodyWithSchema.propTypes = bodyProps;\n\nexport { DSCardBody, DSCardBodyWithSchema };\nexport default DSCardBody;\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AAEA,MAAM,aAAa,CAAC,EAAE,eACpB,qCAAC,OAAD;AAAA,EAAK,WAAU;AAAA,EAAkB,eAAY;AAAA,GAC1C;AAIL,MAAM,YAAY;AAAA,EAEhB,UAAU,UAAU,QAAQ,YAAY;AAAA;AAG1C,WAAW,YAAY;AACvB,MAAM,uBAAuB,SAAS;AACtC,qBAAqB,YAAY;AAGjC,IAAO,qBAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import React2 from "react";
|
|
3
|
+
import { PropTypes, describe } from "react-desc";
|
|
4
|
+
import { convertPropToCssClassName } from "@elliemae/ds-classnames";
|
|
5
|
+
const DSCardHeader = ({ title, action }) => {
|
|
6
|
+
const { cssClassName, classNameElement } = convertPropToCssClassName("card-header");
|
|
7
|
+
return /* @__PURE__ */ React2.createElement("div", {
|
|
8
|
+
className: cssClassName,
|
|
9
|
+
"data-testid": "card-header"
|
|
10
|
+
}, /* @__PURE__ */ React2.createElement("span", {
|
|
11
|
+
className: classNameElement("heading")
|
|
12
|
+
}, title), /* @__PURE__ */ React2.createElement("div", {
|
|
13
|
+
className: classNameElement("pull-right"),
|
|
14
|
+
"data-testid": "ds-card_header-action"
|
|
15
|
+
}, action));
|
|
16
|
+
};
|
|
17
|
+
const cardHeader = {
|
|
18
|
+
title: PropTypes.string.description("card header title"),
|
|
19
|
+
action: PropTypes.node.description("action")
|
|
20
|
+
};
|
|
21
|
+
DSCardHeader.propTypes = cardHeader;
|
|
22
|
+
const DSCardHeaderWithSchema = describe(DSCardHeader);
|
|
23
|
+
DSCardHeaderWithSchema.propTypes = cardHeader;
|
|
24
|
+
var DSCardHeader_default = DSCardHeader;
|
|
25
|
+
export {
|
|
26
|
+
DSCardHeader,
|
|
27
|
+
DSCardHeaderWithSchema,
|
|
28
|
+
DSCardHeader_default as default
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=DSCardHeader.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/DSCardHeader.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { PropTypes, describe } from 'react-desc';\nimport { convertPropToCssClassName } from '@elliemae/ds-classnames';\n\nconst DSCardHeader = ({ title, action }) => {\n const { cssClassName, classNameElement } = convertPropToCssClassName(\n 'card-header',\n );\n return (\n <div className={cssClassName} data-testid=\"card-header\">\n <span className={classNameElement('heading')}>{title}</span>\n <div\n className={classNameElement('pull-right')}\n data-testid=\"ds-card_header-action\"\n >\n {action}\n </div>\n </div>\n );\n};\n\nconst cardHeader = {\n /** card header title */\n title: PropTypes.string.description('card header title'),\n /** action */\n action: PropTypes.node.description('action'),\n};\n\nDSCardHeader.propTypes = cardHeader;\nconst DSCardHeaderWithSchema = describe(DSCardHeader);\nDSCardHeaderWithSchema.propTypes = cardHeader;\n\nexport { DSCardHeader, DSCardHeaderWithSchema };\nexport default DSCardHeader;\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AACA;AAEA,MAAM,eAAe,CAAC,EAAE,OAAO,aAAa;AAC1C,QAAM,EAAE,cAAc,qBAAqB,0BACzC;AAEF,SACE,qCAAC,OAAD;AAAA,IAAK,WAAW;AAAA,IAAc,eAAY;AAAA,KACxC,qCAAC,QAAD;AAAA,IAAM,WAAW,iBAAiB;AAAA,KAAa,QAC/C,qCAAC,OAAD;AAAA,IACE,WAAW,iBAAiB;AAAA,IAC5B,eAAY;AAAA,KAEX;AAAA;AAMT,MAAM,aAAa;AAAA,EAEjB,OAAO,UAAU,OAAO,YAAY;AAAA,EAEpC,QAAQ,UAAU,KAAK,YAAY;AAAA;AAGrC,aAAa,YAAY;AACzB,MAAM,yBAAyB,SAAS;AACxC,uBAAuB,YAAY;AAGnC,IAAO,uBAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import React2 from "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, RightAddon, RightDescription, RightValue } from "./styled";
|
|
12
|
+
const DetailCard = ({
|
|
13
|
+
title,
|
|
14
|
+
description,
|
|
15
|
+
descriptionColor = "neutral",
|
|
16
|
+
rightValue,
|
|
17
|
+
rightDescription,
|
|
18
|
+
rightAddon,
|
|
19
|
+
selectable = false,
|
|
20
|
+
isSelected = false,
|
|
21
|
+
onSelect = noop,
|
|
22
|
+
expandable = false,
|
|
23
|
+
isExpanded = false,
|
|
24
|
+
onExpand = noop,
|
|
25
|
+
expandContent,
|
|
26
|
+
readOnly = false,
|
|
27
|
+
disabled = false
|
|
28
|
+
}) => {
|
|
29
|
+
const theme = useTheme();
|
|
30
|
+
const hasRightLegend = rightValue && rightDescription;
|
|
31
|
+
const hasRightPosition = hasRightLegend || rightAddon;
|
|
32
|
+
const topWrapperCols = ["1fr"];
|
|
33
|
+
if (hasRightPosition)
|
|
34
|
+
topWrapperCols.push("auto");
|
|
35
|
+
if (expandable)
|
|
36
|
+
topWrapperCols.unshift("20px");
|
|
37
|
+
if (selectable)
|
|
38
|
+
topWrapperCols.unshift(theme.space.s);
|
|
39
|
+
return /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(Container, {
|
|
40
|
+
disabled: disabled || readOnly,
|
|
41
|
+
active: selectable && isSelected,
|
|
42
|
+
"data-testid": "card-detail-container"
|
|
43
|
+
}, /* @__PURE__ */ React2.createElement(Grid, {
|
|
44
|
+
cols: topWrapperCols,
|
|
45
|
+
alignItems: !description && "center"
|
|
46
|
+
}, selectable && /* @__PURE__ */ React2.createElement(Grid, {
|
|
47
|
+
pt: description && "9px"
|
|
48
|
+
}, /* @__PURE__ */ React2.createElement(DSCheckbox, {
|
|
49
|
+
checked: isSelected,
|
|
50
|
+
onChange: onSelect,
|
|
51
|
+
readOnly,
|
|
52
|
+
disabled,
|
|
53
|
+
"data-testid": "card-checkbox"
|
|
54
|
+
})), expandable && /* @__PURE__ */ React2.createElement(Grid, {
|
|
55
|
+
height: "16px",
|
|
56
|
+
pt: description && "xxs",
|
|
57
|
+
mt: !description && "-5px"
|
|
58
|
+
}, /* @__PURE__ */ React2.createElement(DSButton, {
|
|
59
|
+
size: "s",
|
|
60
|
+
buttonType: "text",
|
|
61
|
+
containerProps: {
|
|
62
|
+
"data-testid": "expand-button"
|
|
63
|
+
},
|
|
64
|
+
onClick: onExpand,
|
|
65
|
+
icon: isExpanded ? /* @__PURE__ */ React2.createElement(ArrowheadDown, {
|
|
66
|
+
color: ["neutral", 500],
|
|
67
|
+
size: "s"
|
|
68
|
+
}) : /* @__PURE__ */ React2.createElement(ArrowheadRight, {
|
|
69
|
+
color: ["neutral", 500],
|
|
70
|
+
size: "s"
|
|
71
|
+
}),
|
|
72
|
+
disabled
|
|
73
|
+
})), /* @__PURE__ */ React2.createElement(Grid, {
|
|
74
|
+
pr: "24px"
|
|
75
|
+
}, /* @__PURE__ */ React2.createElement(Title, null, title), description && /* @__PURE__ */ React2.createElement(Description, {
|
|
76
|
+
descriptionColor
|
|
77
|
+
}, description)), hasRightPosition && /* @__PURE__ */ React2.createElement(Grid, {
|
|
78
|
+
cols: compact([hasRightPosition && "auto", rightAddon && "auto"])
|
|
79
|
+
}, hasRightLegend && /* @__PURE__ */ React2.createElement(Grid, {
|
|
80
|
+
pr: "24px",
|
|
81
|
+
rows: ["auto", "auto", 1]
|
|
82
|
+
}, /* @__PURE__ */ React2.createElement(RightDescription, {
|
|
83
|
+
justifyContent: "flex-end"
|
|
84
|
+
}, rightDescription), /* @__PURE__ */ React2.createElement(RightValue, {
|
|
85
|
+
justifyContent: "flex-end"
|
|
86
|
+
}, rightValue), /* @__PURE__ */ React2.createElement(Grid, null)), rightAddon && /* @__PURE__ */ React2.createElement(RightAddon, {
|
|
87
|
+
cols: ["auto", "auto"],
|
|
88
|
+
gutter: "2px"
|
|
89
|
+
}, rightAddon))), expandContent && isExpanded && /* @__PURE__ */ React2.createElement(Grid, {
|
|
90
|
+
ml: selectable && "s",
|
|
91
|
+
mr: rightAddon && "xs"
|
|
92
|
+
}, /* @__PURE__ */ React2.createElement(DSSeparator, {
|
|
93
|
+
dashed: true,
|
|
94
|
+
position: "initial",
|
|
95
|
+
margin: "none"
|
|
96
|
+
}), /* @__PURE__ */ React2.createElement(Grid, {
|
|
97
|
+
pt: "xxs",
|
|
98
|
+
"data-testid": "detail-card-expanded-content"
|
|
99
|
+
}, expandContent))));
|
|
100
|
+
};
|
|
101
|
+
const detailProps = {
|
|
102
|
+
title: PropTypes.string.isRequired.description("Title of the card."),
|
|
103
|
+
description: PropTypes.string.description("Description of the card."),
|
|
104
|
+
descriptionColor: PropTypes.oneOf(["primary", "neutral"]).description("Description color."),
|
|
105
|
+
rightValue: PropTypes.string.description("Right value (should be used with `rightDescription`)"),
|
|
106
|
+
rightDescription: PropTypes.string.description("Right description (should be used with `rightValue`)"),
|
|
107
|
+
rightAddon: PropTypes.element.description("Right addon array, max elements: 2"),
|
|
108
|
+
selectable: PropTypes.bool.description("Whether if the card is selectable or not"),
|
|
109
|
+
isSelected: PropTypes.bool.description("Whether if the card is selected or not"),
|
|
110
|
+
onSelect: PropTypes.func.description("Callback on selection"),
|
|
111
|
+
expandable: PropTypes.bool.description("Whether if the card is expandable or not"),
|
|
112
|
+
isExpanded: PropTypes.bool.description("Whether if the card is expanded or not"),
|
|
113
|
+
onExpand: PropTypes.func.description("Callback on expand"),
|
|
114
|
+
expandContent: PropTypes.element.description("Content"),
|
|
115
|
+
readOnly: PropTypes.bool.description("Read only"),
|
|
116
|
+
disabled: PropTypes.bool.description("Disabled")
|
|
117
|
+
};
|
|
118
|
+
DetailCard.propTypes = detailProps;
|
|
119
|
+
const DSCardDetailWithSchema = describe(DetailCard);
|
|
120
|
+
DSCardDetailWithSchema.propTypes = detailProps;
|
|
121
|
+
var DetailCard_default = DetailCard;
|
|
122
|
+
export {
|
|
123
|
+
DSCardDetailWithSchema,
|
|
124
|
+
DetailCard,
|
|
125
|
+
DetailCard_default as default
|
|
126
|
+
};
|
|
127
|
+
//# sourceMappingURL=DetailCard.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/detail/DetailCard.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* 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"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|