@elliemae/ds-card 2.1.0 → 2.2.0-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,188 +1,127 @@
1
- import _jsx from '@babel/runtime/helpers/esm/jsx';
2
- import 'react';
3
- import { compact, noop } from 'lodash';
4
- import { PropTypes, describe } from 'react-desc';
5
- import { ArrowheadDown, ArrowheadRight } from '@elliemae/ds-icons';
6
- import { useTheme } from '@elliemae/ds-system';
7
- import DSButton from '@elliemae/ds-button';
8
- import DSSeparator from '@elliemae/ds-separator';
9
- import { Grid } from '@elliemae/ds-grid';
10
- import { DSCheckbox } from '@elliemae/ds-form';
11
- import { Container, Title, Description, RightDescription, RightValue, RightAddon } from './styled.js';
12
- import { jsx, Fragment } from 'react/jsx-runtime';
13
-
14
- var _Grid, _DSSeparator;
15
-
16
- const DetailCard = _ref => {
17
- let {
18
- title,
19
- description,
20
- descriptionColor = 'neutral',
21
- rightValue,
22
- rightDescription,
23
- rightAddon,
24
- // select props
25
- selectable = false,
26
- isSelected = false,
27
- onSelect = noop,
28
- // expand props
29
- expandable = false,
30
- isExpanded = false,
31
- onExpand = noop,
32
- expandContent,
33
- // state props
34
- readOnly = false,
35
- disabled = false
36
- } = _ref;
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
+ }) => {
37
29
  const theme = useTheme();
38
30
  const hasRightLegend = rightValue && rightDescription;
39
31
  const hasRightPosition = hasRightLegend || rightAddon;
40
- const topWrapperCols = ['1fr'];
41
- if (hasRightPosition) topWrapperCols.push('auto');
42
- if (expandable) topWrapperCols.unshift('20px');
43
- if (selectable) topWrapperCols.unshift(theme.space.s);
44
- return /*#__PURE__*/jsx(Fragment, {
45
- children: /*#__PURE__*/_jsx(Container, {
46
- disabled: disabled || readOnly,
47
- active: selectable && isSelected,
48
- "data-testid": "card-detail-container"
49
- }, void 0, /*#__PURE__*/_jsx(Grid, {
50
- cols: topWrapperCols,
51
- alignItems: !description && 'center'
52
- }, void 0, selectable && /*#__PURE__*/_jsx(Grid, {
53
- pt: description && '9px'
54
- }, void 0, /*#__PURE__*/_jsx(DSCheckbox, {
55
- checked: isSelected,
56
- onChange: onSelect,
57
- readOnly: readOnly,
58
- disabled: disabled,
59
- "data-testid": "card-checkbox"
60
- })), expandable && /*#__PURE__*/_jsx(Grid, {
61
- height: "16px",
62
- pt: description && 'xxs',
63
- mt: !description && '-5px'
64
- }, void 0, /*#__PURE__*/_jsx(DSButton, {
65
- size: "s",
66
- buttonType: "text",
67
- containerProps: {
68
- 'data-testid': 'expand-button'
69
- },
70
- onClick: onExpand,
71
- icon: isExpanded ? /*#__PURE__*/_jsx(ArrowheadDown, {
72
- color: ['neutral', 500],
73
- size: "s"
74
- }) : /*#__PURE__*/_jsx(ArrowheadRight, {
75
- color: ['neutral', 500],
76
- size: "s"
77
- }),
78
- disabled: disabled
79
- })), /*#__PURE__*/_jsx(Grid, {
80
- pr: "24px"
81
- }, void 0, /*#__PURE__*/_jsx(Title, {}, void 0, title), description && /*#__PURE__*/_jsx(Description, {
82
- descriptionColor: descriptionColor
83
- }, void 0, description)), hasRightPosition && /*#__PURE__*/_jsx(Grid, {
84
- cols: compact([hasRightPosition && 'auto', rightAddon && 'auto'])
85
- }, void 0, hasRightLegend && /*#__PURE__*/_jsx(Grid, {
86
- pr: "24px",
87
- rows: ['auto', 'auto', 1]
88
- }, void 0, /*#__PURE__*/_jsx(RightDescription, {
89
- justifyContent: "flex-end"
90
- }, void 0, rightDescription), /*#__PURE__*/_jsx(RightValue, {
91
- justifyContent: "flex-end"
92
- }, void 0, rightValue), _Grid || (_Grid = /*#__PURE__*/_jsx(Grid, {}))), rightAddon && /*#__PURE__*/_jsx(RightAddon, {
93
- cols: ['auto', 'auto'],
94
- gutter: "2px"
95
- }, void 0, rightAddon))), expandContent && isExpanded && /*#__PURE__*/_jsx(Grid, {
96
- ml: selectable && 's',
97
- mr: rightAddon && 'xs'
98
- }, void 0, _DSSeparator || (_DSSeparator = /*#__PURE__*/_jsx(DSSeparator, {
99
- dashed: true,
100
- position: "initial",
101
- margin: "none"
102
- })), /*#__PURE__*/_jsx(Grid, {
103
- pt: "xxs",
104
- "data-testid": "detail-card-expanded-content"
105
- }, void 0, expandContent)))
106
- });
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))));
107
100
  };
108
-
109
101
  const detailProps = {
110
- /**
111
- * Title of the card.
112
- */
113
- title: PropTypes.string.isRequired.description('Title of the card.'),
114
-
115
- /**
116
- * Description of the card.
117
- */
118
- description: PropTypes.string.description('Description of the card.'),
119
-
120
- /**
121
- * Description color.
122
- */
123
- descriptionColor: PropTypes.oneOf(['primary', 'neutral']).description('Description color.'),
124
-
125
- /**
126
- * Right value (should be used with `rightDescription`)
127
- */
128
- rightValue: PropTypes.string.description('Right value (should be used with `rightDescription`)'),
129
-
130
- /**
131
- * Right description (should be used with `rightValue`)
132
- */
133
- rightDescription: PropTypes.string.description('Right description (should be used with `rightValue`)'),
134
-
135
- /**
136
- * Right addon array, max elements: 2
137
- */
138
- rightAddon: PropTypes.element.description('Right addon array, max elements: 2'),
139
-
140
- /**
141
- * Whether if the card is selectable or not
142
- */
143
- selectable: PropTypes.bool.description('Whether if the card is selectable or not'),
144
-
145
- /**
146
- * Whether if the card is selected or not
147
- */
148
- isSelected: PropTypes.bool.description('Whether if the card is selected or not'),
149
-
150
- /**
151
- * Callback on selection
152
- */
153
- onSelect: PropTypes.func.description('Callback on selection'),
154
-
155
- /**
156
- * Whether if the card is expandable or not
157
- */
158
- expandable: PropTypes.bool.description('Whether if the card is expandable or not'),
159
-
160
- /**
161
- * Whether if the card is expanded or not
162
- */
163
- isExpanded: PropTypes.bool.description('Whether if the card is expanded or not'),
164
-
165
- /**
166
- * Callback on expand
167
- */
168
- onExpand: PropTypes.func.description('Callback on expand'),
169
-
170
- /**
171
- * Content
172
- */
173
- expandContent: PropTypes.element.description('Content'),
174
-
175
- /**
176
- * Read only
177
- */
178
- readOnly: PropTypes.bool.description('Read only'),
179
-
180
- /**
181
- * Disabled
182
- */
183
- disabled: PropTypes.bool.description('Disabled')
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")
184
117
  };
118
+ DetailCard.propTypes = detailProps;
185
119
  const DSCardDetailWithSchema = describe(DetailCard);
186
120
  DSCardDetailWithSchema.propTypes = detailProps;
187
-
188
- export { DSCardDetailWithSchema, DetailCard, DetailCard as default };
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": "AAAA;ACGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,M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Q,YAAY;AAAA,EAI7C,UAAU,UAAU,KAAK,YAAY;AAAA,EAIrC,UAAU,UAAU,KAAK,YAAY;AAAA;AAGvC,WAAW,YAAY;AACvB,MAAM,yBAAyB,SAAS;AACxC,uBAAuB,YAAY;AAGnC,IAAO,qBAAQ;",
6
+ "names": []
7
+ }
@@ -1,46 +1,78 @@
1
- import styled from 'styled-components';
2
- import { Grid } from '@elliemae/ds-grid';
3
-
4
- const Separator = /*#__PURE__*/styled.div.withConfig({
5
- componentId: "sc-nx8lwv-0"
6
- })(["width:100%;height:24px;border-right:1px solid ", ";margin:0 8px;"], props => props.theme.colors.neutral['300']);
7
- const Title = /*#__PURE__*/styled.h3.withConfig({
8
- componentId: "sc-nx8lwv-1"
9
- })(["margin:0;font-size:16px;min-height:20px;font-weight:", ";color:", ";"], props => props.theme.fontWeights.semibold, props => props.theme.colors.neutral['700']);
10
- const Description = /*#__PURE__*/styled.p.withConfig({
11
- componentId: "sc-nx8lwv-2"
12
- })(["margin:0;font-size:12px;min-height:18px;display:flex;align-items:center;color:", ";"], props => props.descriptionColor === 'neutral' ? props.theme.colors.neutral['600'] : props.theme.colors.brand['600']);
13
- const RightAddon = /*#__PURE__*/styled(Grid).withConfig({
14
- componentId: "sc-nx8lwv-3"
15
- })(["margin:0;white-space:nowrap;"]);
16
- const RightDescription = /*#__PURE__*/styled(Grid).withConfig({
17
- componentId: "sc-nx8lwv-4"
18
- })(["margin:0;white-space:nowrap;font-size:12px;color:", ";"], props => props.theme.colors.neutral['600']);
19
- const RightValue = /*#__PURE__*/styled(Grid).withConfig({
20
- componentId: "sc-nx8lwv-5"
21
- })(["margin:0;white-space:nowrap;font-size:14px;color:", ";"], props => props.theme.colors.neutral['800']);
22
- const ExpandContent = /*#__PURE__*/styled.div.withConfig({
23
- componentId: "sc-nx8lwv-6"
24
- })(["font-size:12px;"]);
25
-
26
- const border = _ref => {
27
- let {
28
- active,
29
- theme
30
- } = _ref;
31
- return active ? theme.colors.brand['600'] : theme.colors.neutral['200'];
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
+ /* & + ${Container} {
65
+ border-top-color: blue;
66
+ } */
67
+ `;
68
+ export {
69
+ Container,
70
+ Description,
71
+ ExpandContent,
72
+ RightAddon,
73
+ RightDescription,
74
+ RightValue,
75
+ Separator,
76
+ Title
32
77
  };
33
-
34
- const background = _ref2 => {
35
- let {
36
- active,
37
- theme
38
- } = _ref2;
39
- return active ? theme.colors.brand['100'] : theme.colors.neutral['000'];
40
- };
41
-
42
- const Container = /*#__PURE__*/styled(Grid).withConfig({
43
- componentId: "sc-nx8lwv-7"
44
- })(["width:100%;min-height:52px;min-width:244px;padding:6px 8px 6px 12px;position:relative;border-top:1px solid ", ";border-bottom:1px solid ", ";background:", ";", " &:hover{box-shadow:0 2px 4px 0 rgba(53,60,70,0.5);z-index:1;}"], border, border, background, props => props.disabled ? "\n ".concat(Title, ", ").concat(Description, ", ").concat(RightDescription, ", ").concat(RightValue, " {\n color: ").concat(props.theme.colors.neutral['500'], ";\n }\n ") : '');
45
-
46
- export { Container, Description, ExpandContent, RightAddon, RightDescription, RightValue, Separator, Title };
78
+ //# 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 /* & + ${Container} {\n border-top-color: blue;\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,WAKG;AAAA;AAAA;AAAA;",
6
+ "names": []
7
+ }
package/esm/index.js CHANGED
@@ -1,7 +1,13 @@
1
- export { DSCard, DSCardWithSchema, DSCard as default } from './DSCard.js';
2
- export { DSCardHeader, DSCardHeaderWithSchema } from './DSCardHeader.js';
3
- export { DSCardBody, DSCardBodyWithSchema } from './DSCardBody.js';
4
- export { CustomCard, DSCardCustomWithSchema } from './v2/Card.js';
5
- export { CardGroup, DSCardGroupWithSchema } from './v2/Group.js';
6
- export { ActionAddon, DSCardActionAddonWithSchema } from './v2/ActionAddon.js';
7
- export { DSCardDetailWithSchema, DetailCard } from './detail/DetailCard.js';
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
+ }
@@ -1,46 +1,44 @@
1
- import _jsx from '@babel/runtime/helpers/esm/jsx';
2
- import 'react';
3
- import { PropTypes, describe } from 'react-desc';
4
- import styled from 'styled-components';
5
- import { ChevronSmallDown } from '@elliemae/ds-icons';
6
- import DSButton from '@elliemae/ds-button';
7
-
8
- const Addon = /*#__PURE__*/styled(DSButton).withConfig({
9
- componentId: "sc-1pazs35-0"
10
- })(["background-color:transparent;padding-right:4px;height:100%;border:none;font-size:12px;font-weight:", ";color:", ";cursor:pointer;&:focus,&::after{background-color:transparent;box-shadow:none !important;border:none !important;}"], props => props.theme.fontWeights.semibold, props => props.theme.colors.brand['700']);
11
-
12
- const ActionAddon = _ref => {
13
- let {
14
- label,
15
- onClick,
16
- icon
17
- } = _ref;
18
- return /*#__PURE__*/_jsx(Addon, {
19
- onClick: onClick,
20
- labelText: label,
21
- icon: icon || /*#__PURE__*/_jsx(ChevronSmallDown, {
22
- color: ['brand-primary', 700]
23
- })
24
- });
25
- };
26
-
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
+ });
27
30
  const actionProps = {
28
- /**
29
- * Addon label
30
- */
31
- label: PropTypes.string.description('Addon label'),
32
-
33
- /**
34
- * On click callback
35
- */
36
- onClick: PropTypes.func.description('On click callback'),
37
-
38
- /**
39
- * Icon to display after the label
40
- */
41
- icon: PropTypes.element.description('Icon to display after the label')
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")
42
34
  };
35
+ ActionAddon.propTypes = actionProps;
43
36
  const DSCardActionAddonWithSchema = describe(ActionAddon);
44
37
  DSCardActionAddonWithSchema.propTypes = actionProps;
45
-
46
- export { ActionAddon, DSCardActionAddonWithSchema, ActionAddon as default };
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
+ }