@elliemae/ds-card 3.0.0-next.2 → 3.0.0-next.6
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
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import styled from "styled-components";
|
|
3
|
+
import { Grid } from "@elliemae/ds-grid";
|
|
4
|
+
const Separator = styled.div`
|
|
5
|
+
width: 100%;
|
|
6
|
+
height: 24px;
|
|
7
|
+
border-right: 1px solid ${(props) => props.theme.colors.neutral["300"]};
|
|
8
|
+
margin: 0 8px;
|
|
9
|
+
`;
|
|
10
|
+
const Title = styled.h3`
|
|
11
|
+
margin: 0;
|
|
12
|
+
font-size: 16px;
|
|
13
|
+
min-height: 20px;
|
|
14
|
+
font-weight: ${(props) => props.theme.fontWeights.semibold};
|
|
15
|
+
color: ${(props) => props.theme.colors.neutral["700"]};
|
|
16
|
+
`;
|
|
17
|
+
const Description = styled.p`
|
|
18
|
+
margin: 0;
|
|
19
|
+
font-size: 12px;
|
|
20
|
+
min-height: 18px;
|
|
21
|
+
display: flex;
|
|
22
|
+
align-items: center;
|
|
23
|
+
color: ${(props) => props.descriptionColor === "neutral" ? props.theme.colors.neutral["600"] : props.theme.colors.brand["600"]};
|
|
24
|
+
`;
|
|
25
|
+
const RightAddon = styled(Grid)`
|
|
26
|
+
margin: 0;
|
|
27
|
+
white-space: nowrap;
|
|
28
|
+
`;
|
|
29
|
+
const RightDescription = styled(Grid)`
|
|
30
|
+
margin: 0;
|
|
31
|
+
white-space: nowrap;
|
|
32
|
+
font-size: 12px;
|
|
33
|
+
color: ${(props) => props.theme.colors.neutral["600"]};
|
|
34
|
+
`;
|
|
35
|
+
const RightValue = styled(Grid)`
|
|
36
|
+
margin: 0;
|
|
37
|
+
white-space: nowrap;
|
|
38
|
+
font-size: 14px;
|
|
39
|
+
color: ${(props) => props.theme.colors.neutral["800"]};
|
|
40
|
+
`;
|
|
41
|
+
const ExpandContent = styled.div`
|
|
42
|
+
font-size: 12px;
|
|
43
|
+
`;
|
|
44
|
+
const border = ({ active, theme }) => active ? theme.colors.brand["600"] : theme.colors.neutral["200"];
|
|
45
|
+
const background = ({ active, theme }) => active ? theme.colors.brand["100"] : theme.colors.neutral["000"];
|
|
46
|
+
const Container = styled(Grid)`
|
|
47
|
+
width: 100%;
|
|
48
|
+
min-height: 52px;
|
|
49
|
+
min-width: 244px;
|
|
50
|
+
padding: 6px 8px 6px 12px;
|
|
51
|
+
position: relative;
|
|
52
|
+
border-top: 1px solid ${border};
|
|
53
|
+
border-bottom: 1px solid ${border};
|
|
54
|
+
background: ${background};
|
|
55
|
+
${(props) => props.disabled ? `
|
|
56
|
+
${Title}, ${Description}, ${RightDescription}, ${RightValue} {
|
|
57
|
+
color: ${props.theme.colors.neutral["500"]};
|
|
58
|
+
}
|
|
59
|
+
` : ""}
|
|
60
|
+
&:hover {
|
|
61
|
+
box-shadow: 0 2px 4px 0 rgba(53, 60, 70, 0.5);
|
|
62
|
+
z-index: 1;
|
|
63
|
+
}
|
|
64
|
+
`;
|
|
65
|
+
export {
|
|
66
|
+
Container,
|
|
67
|
+
Description,
|
|
68
|
+
ExpandContent,
|
|
69
|
+
RightAddon,
|
|
70
|
+
RightDescription,
|
|
71
|
+
RightValue,
|
|
72
|
+
Separator,
|
|
73
|
+
Title
|
|
74
|
+
};
|
|
75
|
+
//# sourceMappingURL=styled.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/detail/styled.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "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`;\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AAEO,MAAM,YAAY,OAAO;AAAA;AAAA;AAAA,4BAGJ,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ;AAAA;AAAA;AAI3D,MAAM,QAAQ,OAAO;AAAA;AAAA;AAAA;AAAA,iBAIX,CAAC,UAAU,MAAM,MAAM,YAAY;AAAA,WACzC,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ;AAAA;AAG1C,MAAM,cAAc,OAAO;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,OAAO;AAAA;AAAA;AAAA;AAK1B,MAAM,mBAAmB,OAAO;AAAA;AAAA;AAAA;AAAA,WAI5B,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ;AAAA;AAE1C,MAAM,aAAa,OAAO;AAAA;AAAA;AAAA;AAAA,WAItB,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ;AAAA;AAG1C,MAAM,gBAAgB,OAAO;AAAA;AAAA;AAIpC,MAAM,SAAS,CAAC,EAAE,QAAQ,YACxB,SAAS,MAAM,OAAO,MAAM,SAAS,MAAM,OAAO,QAAQ;AAC5D,MAAM,aAAa,CAAC,EAAE,QAAQ,YAC5B,SAAS,MAAM,OAAO,MAAM,SAAS,MAAM,OAAO,QAAQ;AAErD,MAAM,YAAY,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAMN;AAAA,6BACG;AAAA,gBACb;AAAA,IACZ,CAAC,UACD,MAAM,WACF;AAAA,MACF,UAAU,gBAAgB,qBAAqB;AAAA,eACtC,MAAM,MAAM,OAAO,QAAQ;AAAA;AAAA,MAGlC;AAAA;AAAA;AAAA;AAAA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export * from "./DSCard";
|
|
3
|
+
export * from "./DSCardHeader";
|
|
4
|
+
export * from "./DSCardBody";
|
|
5
|
+
export * from "./v2/Card";
|
|
6
|
+
export * from "./v2/Group";
|
|
7
|
+
export * from "./v2/ActionAddon";
|
|
8
|
+
export * from "./detail/DetailCard";
|
|
9
|
+
import { default as default2 } from "./DSCard";
|
|
10
|
+
export {
|
|
11
|
+
default2 as default
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './DSCard';\nexport * from './DSCardHeader';\nexport * from './DSCardBody';\nexport * from './v2/Card';\nexport * from './v2/Group';\nexport * from './v2/ActionAddon';\nexport * from './detail/DetailCard';\n\nexport { default } from './DSCard';\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import React2 from "react";
|
|
3
|
+
import { PropTypes, describe } from "react-desc";
|
|
4
|
+
import styled from "styled-components";
|
|
5
|
+
import { ChevronSmallDown } from "@elliemae/ds-icons";
|
|
6
|
+
import Button from "@elliemae/ds-button";
|
|
7
|
+
const Addon = styled(Button)`
|
|
8
|
+
background-color: transparent;
|
|
9
|
+
padding-right: 4px;
|
|
10
|
+
height: 100%;
|
|
11
|
+
border: none;
|
|
12
|
+
font-size: 12px;
|
|
13
|
+
font-weight: ${(props) => props.theme.fontWeights.semibold};
|
|
14
|
+
color: ${(props) => props.theme.colors.brand["700"]};
|
|
15
|
+
cursor: pointer;
|
|
16
|
+
&:focus,
|
|
17
|
+
&::after {
|
|
18
|
+
background-color: transparent;
|
|
19
|
+
box-shadow: none !important; /* needed */
|
|
20
|
+
border: none !important; /* needed */
|
|
21
|
+
}
|
|
22
|
+
`;
|
|
23
|
+
const ActionAddon = ({ label, onClick, icon }) => /* @__PURE__ */ React2.createElement(Addon, {
|
|
24
|
+
onClick,
|
|
25
|
+
labelText: label,
|
|
26
|
+
icon: icon || /* @__PURE__ */ React2.createElement(ChevronSmallDown, {
|
|
27
|
+
color: ["brand-primary", 700]
|
|
28
|
+
})
|
|
29
|
+
});
|
|
30
|
+
const actionProps = {
|
|
31
|
+
label: PropTypes.string.description("Addon label"),
|
|
32
|
+
onClick: PropTypes.func.description("On click callback"),
|
|
33
|
+
icon: PropTypes.element.description("Icon to display after the label")
|
|
34
|
+
};
|
|
35
|
+
ActionAddon.propTypes = actionProps;
|
|
36
|
+
const DSCardActionAddonWithSchema = describe(ActionAddon);
|
|
37
|
+
DSCardActionAddonWithSchema.propTypes = actionProps;
|
|
38
|
+
var ActionAddon_default = ActionAddon;
|
|
39
|
+
export {
|
|
40
|
+
ActionAddon,
|
|
41
|
+
DSCardActionAddonWithSchema,
|
|
42
|
+
ActionAddon_default as default
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=ActionAddon.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/v2/ActionAddon.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "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"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AACA;AACA;AACA;AAEA,MAAM,QAAQ,OAAO;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,qCAAC,OAAD;AAAA,EAAO;AAAA,EAAkB,WAAW;AAAA,EAAO,MAAM,QAAQ,qCAAC,kBAAD;AAAA,IAAkB,OAAO,CAAC,iBAAiB;AAAA;AAAA;AAGtG,MAAM,cAAc;AAAA,EAIlB,OAAO,UAAU,OAAO,YAAY;AAAA,EAIpC,SAAS,UAAU,KAAK,YAAY;AAAA,EAIpC,MAAM,UAAU,QAAQ,YAAY;AAAA;AAGtC,YAAY,YAAY;AACxB,MAAM,8BAA8B,SAAS;AAC7C,4BAA4B,YAAY;AAGxC,IAAO,sBAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import React2 from "react";
|
|
3
|
+
import { PropTypes, describe } from "react-desc";
|
|
4
|
+
import { DSHeader } from "@elliemae/ds-header";
|
|
5
|
+
import DSTruncatedTooltipText, {
|
|
6
|
+
TooltipTextProvider
|
|
7
|
+
} from "@elliemae/ds-truncated-tooltip-text";
|
|
8
|
+
import {
|
|
9
|
+
CardContainer,
|
|
10
|
+
LeftSection,
|
|
11
|
+
LeftAddon,
|
|
12
|
+
RightAddonSection,
|
|
13
|
+
RightAddon,
|
|
14
|
+
Separator,
|
|
15
|
+
MainSection,
|
|
16
|
+
Description
|
|
17
|
+
} from "./components";
|
|
18
|
+
const getCol = (rightAddon) => {
|
|
19
|
+
if (!rightAddon)
|
|
20
|
+
return [1];
|
|
21
|
+
return [1, "auto"];
|
|
22
|
+
};
|
|
23
|
+
const CustomCard = ({
|
|
24
|
+
title,
|
|
25
|
+
description,
|
|
26
|
+
leftAddon,
|
|
27
|
+
rightAddon,
|
|
28
|
+
hasBorder = false
|
|
29
|
+
}) => /* @__PURE__ */ React2.createElement(TooltipTextProvider, null, /* @__PURE__ */ React2.createElement(CardContainer, {
|
|
30
|
+
hasBorder,
|
|
31
|
+
cols: getCol(rightAddon),
|
|
32
|
+
"data-testid": "em-ds-card"
|
|
33
|
+
}, /* @__PURE__ */ React2.createElement(LeftSection, null, leftAddon && /* @__PURE__ */ React2.createElement(LeftAddon, null, leftAddon), /* @__PURE__ */ React2.createElement(MainSection, {
|
|
34
|
+
style: {
|
|
35
|
+
maxWidth: leftAddon ? "calc(100% - 40px)" : "100%"
|
|
36
|
+
}
|
|
37
|
+
}, /* @__PURE__ */ React2.createElement(DSHeader, {
|
|
38
|
+
fontSize: "16px",
|
|
39
|
+
"data-testid": "em-ds-card-header",
|
|
40
|
+
fontWeight: "regular",
|
|
41
|
+
color: "neutral.800",
|
|
42
|
+
text: /* @__PURE__ */ React2.createElement(DSTruncatedTooltipText, {
|
|
43
|
+
value: title
|
|
44
|
+
})
|
|
45
|
+
}), description && /* @__PURE__ */ React2.createElement(Description, null, /* @__PURE__ */ React2.createElement(DSTruncatedTooltipText, {
|
|
46
|
+
value: description
|
|
47
|
+
})))), rightAddon && /* @__PURE__ */ React2.createElement(RightAddonSection, null, rightAddon[0] && /* @__PURE__ */ React2.createElement(RightAddon, null, rightAddon[0]), rightAddon[1] && /* @__PURE__ */ React2.createElement(React2.Fragment, null, rightAddon.length > 1 && /* @__PURE__ */ React2.createElement(Separator, null), /* @__PURE__ */ React2.createElement(RightAddon, null, rightAddon[1])))));
|
|
48
|
+
const cardProps = {
|
|
49
|
+
title: PropTypes.string.isRequired.description("Title of the card. requiered"),
|
|
50
|
+
description: PropTypes.string.description("Description of the card. not requiered"),
|
|
51
|
+
leftAddon: PropTypes.element.description("Left Addon"),
|
|
52
|
+
rightAddon: PropTypes.array.description("Right addon array, max elements: 2"),
|
|
53
|
+
hasBorder: PropTypes.bool.description("Wheter if the card has border or not")
|
|
54
|
+
};
|
|
55
|
+
CustomCard.propTypes = cardProps;
|
|
56
|
+
const DSCardCustomWithSchema = describe(CustomCard);
|
|
57
|
+
DSCardCustomWithSchema.propTypes = cardProps;
|
|
58
|
+
var Card_default = CustomCard;
|
|
59
|
+
export {
|
|
60
|
+
CustomCard,
|
|
61
|
+
DSCardCustomWithSchema,
|
|
62
|
+
Card_default as default
|
|
63
|
+
};
|
|
64
|
+
//# sourceMappingURL=Card.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/v2/Card.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "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"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AACA;AACA;AAAA;AAAA;AAGA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAWA,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,qCAAC,qBAAD,MACE,qCAAC,eAAD;AAAA,EACE;AAAA,EACA,MAAM,OAAO;AAAA,EACb,eAAY;AAAA,GAEZ,qCAAC,aAAD,MACG,aAAa,qCAAC,WAAD,MAAY,YAC1B,qCAAC,aAAD;AAAA,EACE,OAAO;AAAA,IACL,UAAU,YAAY,sBAAsB;AAAA;AAAA,GAG9C,qCAAC,UAAD;AAAA,EACE,UAAS;AAAA,EACT,eAAY;AAAA,EACZ,YAAW;AAAA,EACX,OAAM;AAAA,EACN,MAAM,qCAAC,wBAAD;AAAA,IAAwB,OAAO;AAAA;AAAA,IAEtC,eACC,qCAAC,aAAD,MACE,qCAAC,wBAAD;AAAA,EAAwB,OAAO;AAAA,OAKtC,cACC,qCAAC,mBAAD,MACG,WAAW,MAAM,qCAAC,YAAD,MAAa,WAAW,KACzC,WAAW,MACV,4DACG,WAAW,SAAS,KAAK,qCAAC,WAAD,OAC1B,qCAAC,YAAD,MAAa,WAAW;AAStC,MAAM,YAAY;AAAA,EAIhB,OAAO,UAAU,OAAO,WAAW,YACjC;AAAA,EAKF,aAAa,UAAU,OAAO,YAC5B;AAAA,EAKF,WAAW,UAAU,QAAQ,YAAY;AAAA,EAIzC,YAAY,UAAU,MAAM,YAAY;AAAA,EAIxC,WAAW,UAAU,KAAK,YAAY;AAAA;AAGxC,WAAW,YAAY;AACvB,MAAM,yBAAyB,SAAS;AACxC,uBAAuB,YAAY;AAGnC,IAAO,eAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import React2 from "react";
|
|
3
|
+
import { PropTypes, describe } from "react-desc";
|
|
4
|
+
import styled from "styled-components";
|
|
5
|
+
import { color, border, truncate } from "@elliemae/ds-system";
|
|
6
|
+
import Card from "./Card";
|
|
7
|
+
const Group = styled.div`
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
width: 100%;
|
|
11
|
+
max-width: 100%;
|
|
12
|
+
${Card} {
|
|
13
|
+
border-top: none;
|
|
14
|
+
}
|
|
15
|
+
${({ theme, withTopBorder }) => withTopBorder ? `border-top: ${theme.colors.neutral["100"]}` : ""}
|
|
16
|
+
`;
|
|
17
|
+
const GroupTitle = styled.span`
|
|
18
|
+
${truncate()}
|
|
19
|
+
`;
|
|
20
|
+
const TitleWrapper = styled.div`
|
|
21
|
+
display: flex;
|
|
22
|
+
justify-content: space-between;
|
|
23
|
+
padding: 0 ${(props) => props.theme.space.xs};
|
|
24
|
+
font-size: 12px;
|
|
25
|
+
${color("neutral", "700")};
|
|
26
|
+
font-weight: ${(props) => props.theme.fontWeights.semibold};
|
|
27
|
+
background-color: ${(props) => props.theme.colors.neutral["080"]};
|
|
28
|
+
border-top: ${(props) => border(props.theme.colors.neutral["080"])};
|
|
29
|
+
line-height: 24px;
|
|
30
|
+
`;
|
|
31
|
+
const Items = styled.div`
|
|
32
|
+
display: flex;
|
|
33
|
+
flex-direction: column;
|
|
34
|
+
`;
|
|
35
|
+
const CardGroup = ({ children, title, action }) => /* @__PURE__ */ React2.createElement(Group, {
|
|
36
|
+
withTopBorder: !title
|
|
37
|
+
}, !!title && /* @__PURE__ */ React2.createElement(TitleWrapper, null, /* @__PURE__ */ React2.createElement(GroupTitle, null, title), action), /* @__PURE__ */ React2.createElement(Items, null, children));
|
|
38
|
+
const cardgroupProps = {
|
|
39
|
+
children: PropTypes.element.isRequired.description("Card items"),
|
|
40
|
+
title: PropTypes.string.isRequired.description("Title of the group"),
|
|
41
|
+
action: PropTypes.element.description("Right addon action")
|
|
42
|
+
};
|
|
43
|
+
CardGroup.propTypes = cardgroupProps;
|
|
44
|
+
const DSCardGroupWithSchema = describe(CardGroup);
|
|
45
|
+
DSCardGroupWithSchema.propTypes = cardgroupProps;
|
|
46
|
+
var Group_default = CardGroup;
|
|
47
|
+
export {
|
|
48
|
+
CardGroup,
|
|
49
|
+
DSCardGroupWithSchema,
|
|
50
|
+
Group_default as default
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=Group.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/v2/Group.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "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"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AACA;AACA;AACA;AAEA,MAAM,QAAQ,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,IAKjB;AAAA;AAAA;AAAA,IAGA,CAAC,EAAE,OAAO,oBACV,gBAAgB,eAAe,MAAM,OAAO,QAAQ,WAAW;AAAA;AAGnE,MAAM,aAAa,OAAO;AAAA,IACtB;AAAA;AAGJ,MAAM,eAAe,OAAO;AAAA;AAAA;AAAA,eAGb,CAAC,UAAU,MAAM,MAAM,MAAM;AAAA;AAAA,IAExC,MAAM,WAAW;AAAA,iBACJ,CAAC,UAAU,MAAM,MAAM,YAAY;AAAA,sBAC9B,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ;AAAA,gBAC5C,CAAC,UAAU,OAAO,MAAM,MAAM,OAAO,QAAQ;AAAA;AAAA;AAI7D,MAAM,QAAQ,OAAO;AAAA;AAAA;AAAA;AAKrB,MAAM,YAAY,CAAC,EAAE,UAAU,OAAO,aACpC,qCAAC,OAAD;AAAA,EAAO,eAAe,CAAC;AAAA,GACpB,CAAC,CAAC,SACD,qCAAC,cAAD,MACE,qCAAC,YAAD,MAAa,QACZ,SAGL,qCAAC,OAAD,MAAQ;AAIZ,MAAM,iBAAiB;AAAA,EAIrB,UAAU,UAAU,QAAQ,WAAW,YAAY;AAAA,EAInD,OAAO,UAAU,OAAO,WAAW,YAAY;AAAA,EAI/C,QAAQ,UAAU,QAAQ,YAAY;AAAA;AAGxC,UAAU,YAAY;AACtB,MAAM,wBAAwB,SAAS;AACvC,sBAAsB,YAAY;AAGlC,IAAO,gBAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import styled from "styled-components";
|
|
3
|
+
import { Grid } from "@elliemae/ds-grid";
|
|
4
|
+
const CardContainer = styled(Grid)`
|
|
5
|
+
align-items: center;
|
|
6
|
+
justify-content: space-between;
|
|
7
|
+
width: 100%;
|
|
8
|
+
height: 56px;
|
|
9
|
+
padding: 8px 16px;
|
|
10
|
+
position: relative;
|
|
11
|
+
border: ${({ theme, hasBorder }) => hasBorder ? `1px solid ${theme.colors.neutral["100"]}` : ""};
|
|
12
|
+
&:before {
|
|
13
|
+
content: '';
|
|
14
|
+
border-bottom: 1px solid ${(props) => props.theme.colors.neutral["100"]};
|
|
15
|
+
position: absolute;
|
|
16
|
+
margin: 0 auto;
|
|
17
|
+
width: 90%;
|
|
18
|
+
bottom: 0;
|
|
19
|
+
}
|
|
20
|
+
&:last-child::before {
|
|
21
|
+
content: none;
|
|
22
|
+
}
|
|
23
|
+
`;
|
|
24
|
+
const LeftSection = styled.div`
|
|
25
|
+
display: flex;
|
|
26
|
+
align-items: center;
|
|
27
|
+
`;
|
|
28
|
+
const LeftAddon = styled.div`
|
|
29
|
+
height: fit-content;
|
|
30
|
+
width: fit-content;
|
|
31
|
+
margin-right: 16px;
|
|
32
|
+
cursor: pointer;
|
|
33
|
+
`;
|
|
34
|
+
const RightAddonSection = styled.div`
|
|
35
|
+
display: flex;
|
|
36
|
+
align-items: center;
|
|
37
|
+
width: fit-content;
|
|
38
|
+
`;
|
|
39
|
+
const RightAddon = styled.div`
|
|
40
|
+
height: fit-content;
|
|
41
|
+
width: fit-content;
|
|
42
|
+
cursor: pointer;
|
|
43
|
+
`;
|
|
44
|
+
const Separator = styled.div`
|
|
45
|
+
width: 0px;
|
|
46
|
+
height: 24px;
|
|
47
|
+
border-right: 1px solid ${(props) => props.theme.colors.neutral["300"]};
|
|
48
|
+
margin: 0 8px;
|
|
49
|
+
`;
|
|
50
|
+
const MainSection = styled.div`
|
|
51
|
+
display: flex;
|
|
52
|
+
flex-direction: column;
|
|
53
|
+
`;
|
|
54
|
+
const Title = styled.h3`
|
|
55
|
+
margin: 0;
|
|
56
|
+
font-size: 16px;
|
|
57
|
+
font-weight: ${(props) => props.theme.fontWeights.regular};
|
|
58
|
+
color: ${(props) => props.theme.colors.neutral["800"]};
|
|
59
|
+
`;
|
|
60
|
+
const Description = styled.p`
|
|
61
|
+
margin: 0;
|
|
62
|
+
color: ${(props) => props.theme.colors.neutral["600"]};
|
|
63
|
+
`;
|
|
64
|
+
export {
|
|
65
|
+
CardContainer,
|
|
66
|
+
Description,
|
|
67
|
+
LeftAddon,
|
|
68
|
+
LeftSection,
|
|
69
|
+
MainSection,
|
|
70
|
+
RightAddon,
|
|
71
|
+
RightAddonSection,
|
|
72
|
+
Separator,
|
|
73
|
+
Title
|
|
74
|
+
};
|
|
75
|
+
//# sourceMappingURL=components.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/v2/components.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "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"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AAEA,MAAM,gBAAgB,OAAO;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,OAAO;AAAA;AAAA;AAAA;AAK3B,MAAM,YAAY,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAOzB,MAAM,oBAAoB,OAAO;AAAA;AAAA;AAAA;AAAA;AAMjC,MAAM,aAAa,OAAO;AAAA;AAAA;AAAA;AAAA;AAM1B,MAAM,YAAY,OAAO;AAAA;AAAA;AAAA,4BAGG,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ;AAAA;AAAA;AAIlE,MAAM,cAAc,OAAO;AAAA;AAAA;AAAA;AAK3B,MAAM,QAAQ,OAAO;AAAA;AAAA;AAAA,iBAGJ,CAAC,UAAU,MAAM,MAAM,YAAY;AAAA,WACzC,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ;AAAA;AAGjD,MAAM,cAAc,OAAO;AAAA;AAAA,WAEhB,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|