@elliemae/ds-card-v2 3.60.0-next.9 → 3.70.0-next.1

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.
@@ -36,18 +36,27 @@ var React = __toESM(require("react"));
36
36
  var import_jsx_runtime = require("react/jsx-runtime");
37
37
  var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
38
38
  var import_ds_truncated_tooltip_text = require("@elliemae/ds-truncated-tooltip-text");
39
- var import_ds_header = require("@elliemae/ds-header");
39
+ var import_ds_typography = require("@elliemae/ds-typography");
40
+ var import_ds_system = require("@elliemae/ds-system");
40
41
  var import_react_desc_prop_types = require("./react-desc-prop-types.js");
41
42
  var import_useCardV2 = require("./config/useCardV2.js");
42
43
  var import_constants = require("./constants/index.js");
43
44
  var import_styles = require("./styles.js");
44
- const getCol = (rightAddon) => {
45
+ const getCols = (rightAddon, isSmall) => {
46
+ if (isSmall) return ["1fr"];
45
47
  if (!rightAddon) return ["1fr"];
46
- return ["1fr", "auto"];
48
+ return ["auto", "minmax(0, 1fr)", "auto"];
49
+ };
50
+ const getRows = (isSmall) => {
51
+ if (isSmall) return ["auto", "auto", "auto"];
52
+ return ["auto"];
47
53
  };
48
54
  const DSCardV2 = (props) => {
49
55
  const { propsWithDefault, globalProps, xstyledProps } = (0, import_useCardV2.useCardV2)(props);
50
- const { hasBorder, title, leftAddon, rightAddon, description } = propsWithDefault;
56
+ const { hasBorder, title, leftAddon, rightAddon, description, wrapText } = propsWithDefault;
57
+ const { getOwnerProps, getOwnerPropsArguments } = (0, import_ds_props_helpers.useOwnerProps)(propsWithDefault);
58
+ const layoutMode = (0, import_ds_system.useGetLayoutMode)();
59
+ const isSmall = layoutMode === "s" || layoutMode === "xs";
51
60
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_truncated_tooltip_text.TooltipTextProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
52
61
  import_styles.CardContainer,
53
62
  {
@@ -56,39 +65,67 @@ const DSCardV2 = (props) => {
56
65
  ...globalProps,
57
66
  ...xstyledProps,
58
67
  hasBorder,
59
- cols: getCol(rightAddon),
68
+ cols: getCols(rightAddon, isSmall),
69
+ rows: getRows(isSmall),
70
+ getOwnerProps,
71
+ getOwnerPropsArguments,
60
72
  children: [
61
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styles.LeftSection, { children: [
62
- leftAddon && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styles.LeftAddon, { children: leftAddon }),
63
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
64
- import_styles.MainSection,
65
- {
66
- style: {
67
- maxWidth: leftAddon ? "calc(100% - 40px)" : "100%"
68
- },
69
- children: [
70
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
71
- import_ds_header.DSHeader,
72
- {
73
- "data-testid": import_constants.CARD_V2_DATA_TESTID.CARD_HEADER,
74
- fontSize: "16px",
75
- fontWeight: "regular",
76
- color: "neutral.800",
77
- text: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_truncated_tooltip_text.DSTruncatedTooltipText, { value: title })
78
- }
79
- ),
80
- description && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styles.Description, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_truncated_tooltip_text.DSTruncatedTooltipText, { value: description }) })
81
- ]
82
- }
83
- )
84
- ] }),
85
- Array.isArray(rightAddon) && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styles.RightAddonSection, { children: [
86
- rightAddon[0] ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styles.RightAddon, { children: rightAddon[0] }) : null,
87
- rightAddon[1] ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
88
- rightAddon.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styles.Separator, {}),
89
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styles.RightAddon, { children: rightAddon[1] })
90
- ] }) : null
91
- ] })
73
+ leftAddon && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
74
+ import_styles.LeftAddon,
75
+ {
76
+ style: {
77
+ gridColumn: isSmall ? "1" : "1",
78
+ gridRow: isSmall ? "1" : "1",
79
+ justifySelf: isSmall ? "center" : "start"
80
+ },
81
+ getOwnerProps,
82
+ getOwnerPropsArguments,
83
+ children: leftAddon
84
+ }
85
+ ),
86
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
87
+ import_styles.MainSection,
88
+ {
89
+ style: {
90
+ gridColumn: isSmall ? "1" : "2",
91
+ gridRow: isSmall ? "2" : "1",
92
+ textAlign: isSmall ? "center" : "left"
93
+ },
94
+ getOwnerProps,
95
+ getOwnerPropsArguments,
96
+ children: [
97
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
98
+ import_styles.Title,
99
+ {
100
+ "data-testid": import_constants.CARD_V2_DATA_TESTID.CARD_HEADER,
101
+ getOwnerProps,
102
+ getOwnerPropsArguments,
103
+ children: wrapText ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_typography.DSTypography, { variant: import_ds_typography.TYPOGRAPHY_VARIANTS.B1, as: "span", children: title }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_truncated_tooltip_text.DSTruncatedTooltipText, { value: title })
104
+ }
105
+ ),
106
+ description && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styles.Description, { getOwnerProps, getOwnerPropsArguments, children: wrapText ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_typography.DSTypography, { variant: import_ds_typography.TYPOGRAPHY_VARIANTS.B1, as: "span", children: description }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_truncated_tooltip_text.DSTruncatedTooltipText, { value: description }) })
107
+ ]
108
+ }
109
+ ),
110
+ Array.isArray(rightAddon) && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
111
+ import_styles.RightAddonSection,
112
+ {
113
+ style: {
114
+ gridColumn: isSmall ? "1" : "3",
115
+ gridRow: isSmall ? "3" : "1",
116
+ justifySelf: isSmall ? "center" : "end"
117
+ },
118
+ getOwnerProps,
119
+ getOwnerPropsArguments,
120
+ children: [
121
+ rightAddon[0] ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styles.RightAddon, { getOwnerProps, getOwnerPropsArguments, children: rightAddon[0] }) : null,
122
+ rightAddon[1] ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
123
+ rightAddon.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styles.Separator, { getOwnerProps, getOwnerPropsArguments }),
124
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styles.RightAddon, { getOwnerProps, getOwnerPropsArguments, children: rightAddon[1] })
125
+ ] }) : null
126
+ ]
127
+ }
128
+ )
92
129
  ]
93
130
  }
94
131
  ) });
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/DSCardV2.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { DSTruncatedTooltipText, TooltipTextProvider } from '@elliemae/ds-truncated-tooltip-text';\nimport { DSHeader } from '@elliemae/ds-header';\nimport { type DSCardV2T, DSCardV2PropTypesSchema } from './react-desc-prop-types.js';\nimport { useCardV2 } from './config/useCardV2.js';\nimport { DSCardV2Name, CARD_V2_DATA_TESTID } from './constants/index.js';\nimport {\n CardContainer,\n LeftSection,\n LeftAddon,\n MainSection,\n Description,\n RightAddonSection,\n RightAddon,\n Separator,\n} from './styles.js';\n\nconst getCol = (rightAddon: DSCardV2T.OptionalProps['rightAddon']) => {\n if (!rightAddon) return ['1fr'];\n return ['1fr', 'auto'];\n};\n\nconst DSCardV2: React.ComponentType<DSCardV2T.Props> = (props) => {\n const { propsWithDefault, globalProps, xstyledProps } = useCardV2(props);\n const { hasBorder, title, leftAddon, rightAddon, description } = propsWithDefault;\n return (\n <TooltipTextProvider>\n <CardContainer\n data-component-selector=\"ds-card-v2\"\n data-testid={CARD_V2_DATA_TESTID.CARD_CONTAINER} // we must keep this explicit to avoid the breaking changes\n {...globalProps}\n {...xstyledProps}\n hasBorder={hasBorder}\n cols={getCol(rightAddon)}\n >\n <LeftSection>\n {leftAddon && <LeftAddon>{leftAddon}</LeftAddon>}\n <MainSection\n style={{\n maxWidth: leftAddon ? 'calc(100% - 40px)' : '100%',\n }}\n >\n <DSHeader\n data-testid={CARD_V2_DATA_TESTID.CARD_HEADER} // we must keep this explicit to avoid the breaking changes\n fontSize=\"16px\"\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 {Array.isArray(rightAddon) && (\n <RightAddonSection>\n {rightAddon[0] ? <RightAddon>{rightAddon[0]}</RightAddon> : null}\n {rightAddon[1] ? (\n <>\n {rightAddon.length > 1 && <Separator />}\n <RightAddon>{rightAddon[1]}</RightAddon>\n </>\n ) : null}\n </RightAddonSection>\n )}\n </CardContainer>\n </TooltipTextProvider>\n );\n};\n\nDSCardV2.displayName = DSCardV2Name;\nconst DSCardV2WithSchema = describe(DSCardV2);\nDSCardV2WithSchema.propTypes = DSCardV2PropTypesSchema;\n\nexport { DSCardV2, DSCardV2WithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADqCC;AApCxB,8BAAyB;AACzB,uCAA4D;AAC5D,uBAAyB;AACzB,mCAAwD;AACxD,uBAA0B;AAC1B,uBAAkD;AAClD,oBASO;AAEP,MAAM,SAAS,CAAC,eAAsD;AACpE,MAAI,CAAC,WAAY,QAAO,CAAC,KAAK;AA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';\nimport { DSTruncatedTooltipText, TooltipTextProvider } from '@elliemae/ds-truncated-tooltip-text';\nimport { DSTypography, TYPOGRAPHY_VARIANTS } from '@elliemae/ds-typography';\nimport { useGetLayoutMode } from '@elliemae/ds-system';\nimport { type DSCardV2T, DSCardV2PropTypesSchema } from './react-desc-prop-types.js';\nimport { useCardV2 } from './config/useCardV2.js';\nimport { DSCardV2Name, CARD_V2_DATA_TESTID } from './constants/index.js';\nimport {\n CardContainer,\n LeftAddon,\n MainSection,\n Description,\n RightAddonSection,\n RightAddon,\n Separator,\n Title,\n} from './styles.js';\n\nconst getCols = (rightAddon: DSCardV2T.OptionalProps['rightAddon'], isSmall: boolean) => {\n if (isSmall) return ['1fr'];\n if (!rightAddon) return ['1fr'];\n return ['auto', 'minmax(0, 1fr)', 'auto'];\n};\n\nconst getRows = (isSmall: boolean) => {\n if (isSmall) return ['auto', 'auto', 'auto'];\n return ['auto'];\n};\n// eslint-disable-next-line complexity\nconst DSCardV2: React.ComponentType<DSCardV2T.Props> = (props) => {\n const { propsWithDefault, globalProps, xstyledProps } = useCardV2(props);\n const { hasBorder, title, leftAddon, rightAddon, description, wrapText } = propsWithDefault;\n const { getOwnerProps, getOwnerPropsArguments } = useOwnerProps(propsWithDefault);\n const layoutMode = useGetLayoutMode();\n const isSmall = layoutMode === 's' || layoutMode === 'xs';\n\n return (\n <TooltipTextProvider>\n <CardContainer\n data-component-selector=\"ds-card-v2\"\n data-testid={CARD_V2_DATA_TESTID.CARD_CONTAINER} // we must keep this explicit to avoid the breaking changes\n {...globalProps}\n {...xstyledProps}\n hasBorder={hasBorder}\n cols={getCols(rightAddon, isSmall)}\n rows={getRows(isSmall)}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {leftAddon && (\n <LeftAddon\n style={{\n gridColumn: isSmall ? '1' : '1',\n gridRow: isSmall ? '1' : '1',\n justifySelf: isSmall ? 'center' : 'start',\n }}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {leftAddon}\n </LeftAddon>\n )}\n <MainSection\n style={{\n gridColumn: isSmall ? '1' : '2',\n gridRow: isSmall ? '2' : '1',\n textAlign: isSmall ? 'center' : 'left',\n }}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <Title\n data-testid={CARD_V2_DATA_TESTID.CARD_HEADER}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {wrapText ? (\n <DSTypography variant={TYPOGRAPHY_VARIANTS.B1} as=\"span\">\n {title}\n </DSTypography>\n ) : (\n <DSTruncatedTooltipText value={title} />\n )}\n </Title>\n {description && (\n <Description getOwnerProps={getOwnerProps} getOwnerPropsArguments={getOwnerPropsArguments}>\n {wrapText ? (\n <DSTypography variant={TYPOGRAPHY_VARIANTS.B1} as=\"span\">\n {description}\n </DSTypography>\n ) : (\n <DSTruncatedTooltipText value={description} />\n )}\n </Description>\n )}\n </MainSection>\n\n {Array.isArray(rightAddon) && (\n <RightAddonSection\n style={{\n gridColumn: isSmall ? '1' : '3',\n gridRow: isSmall ? '3' : '1',\n justifySelf: isSmall ? 'center' : 'end',\n }}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {rightAddon[0] ? (\n <RightAddon getOwnerProps={getOwnerProps} getOwnerPropsArguments={getOwnerPropsArguments}>\n {rightAddon[0]}\n </RightAddon>\n ) : null}\n {rightAddon[1] ? (\n <>\n {rightAddon.length > 1 && (\n <Separator getOwnerProps={getOwnerProps} getOwnerPropsArguments={getOwnerPropsArguments} />\n )}\n <RightAddon getOwnerProps={getOwnerProps} getOwnerPropsArguments={getOwnerPropsArguments}>\n {rightAddon[1]}\n </RightAddon>\n </>\n ) : null}\n </RightAddonSection>\n )}\n </CardContainer>\n </TooltipTextProvider>\n );\n};\n\nDSCardV2.displayName = DSCardV2Name;\nconst DSCardV2WithSchema = describe(DSCardV2);\nDSCardV2WithSchema.propTypes = DSCardV2PropTypesSchema;\n\nexport { DSCardV2, DSCardV2WithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADmDb;AAlDV,8BAAwC;AACxC,uCAA4D;AAC5D,2BAAkD;AAClD,uBAAiC;AACjC,mCAAwD;AACxD,uBAA0B;AAC1B,uBAAkD;AAClD,oBASO;AAEP,MAAM,UAAU,CAAC,YAAmD,YAAqB;AACvF,MAAI,QAAS,QAAO,CAAC,KAAK;AAC1B,MAAI,CAAC,WAAY,QAAO,CAAC,KAAK;AAC9B,SAAO,CAAC,QAAQ,kBAAkB,MAAM;AAC1C;AAEA,MAAM,UAAU,CAAC,YAAqB;AACpC,MAAI,QAAS,QAAO,CAAC,QAAQ,QAAQ,MAAM;AAC3C,SAAO,CAAC,MAAM;AAChB;AAEA,MAAM,WAAiD,CAAC,UAAU;AAChE,QAAM,EAAE,kBAAkB,aAAa,aAAa,QAAI,4BAAU,KAAK;AACvE,QAAM,EAAE,WAAW,OAAO,WAAW,YAAY,aAAa,SAAS,IAAI;AAC3E,QAAM,EAAE,eAAe,uBAAuB,QAAI,uCAAc,gBAAgB;AAChF,QAAM,iBAAa,mCAAiB;AACpC,QAAM,UAAU,eAAe,OAAO,eAAe;AAErD,SACE,4CAAC,wDACC;AAAA,IAAC;AAAA;AAAA,MACC,2BAAwB;AAAA,MACxB,eAAa,qCAAoB;AAAA,MAChC,GAAG;AAAA,MACH,GAAG;AAAA,MACJ;AAAA,MACA,MAAM,QAAQ,YAAY,OAAO;AAAA,MACjC,MAAM,QAAQ,OAAO;AAAA,MACrB;AAAA,MACA;AAAA,MAEC;AAAA,qBACC;AAAA,UAAC;AAAA;AAAA,YACC,OAAO;AAAA,cACL,YAAY,UAAU,MAAM;AAAA,cAC5B,SAAS,UAAU,MAAM;AAAA,cACzB,aAAa,UAAU,W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
@@ -44,8 +44,8 @@ const CARD_V2_SLOTS = {
44
44
  RIGHT_ADDON_SECTION: "right-addon-section",
45
45
  SEPARATOR: "separator",
46
46
  MAIN_SECTION: "main-section",
47
- TITLE: "title",
48
- DESCRIPTION: "description"
47
+ DESCRIPTION: "description",
48
+ TITLE: "title"
49
49
  };
50
50
  const CARD_V2_DATA_TESTID = {
51
51
  ...(0, import_ds_system.slotObjectToDataTestIds)(DSCardV2Name, CARD_V2_SLOTS),
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/constants/index.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import { slotObjectToDataTestIds } from '@elliemae/ds-system';\n\nexport const DSCardV2Name = 'DSCardv2';\n\n// we are giving \"component_name_slots\" to avoid errors on duplicate exports variables in aggregators\nexport const CARD_V2_SLOTS = {\n CARD_CONTAINER: 'container',\n LEFT_SECTION: 'left-section',\n LEFT_ADDON: 'left-addon',\n RIGHT_ADDON: 'right-addon',\n RIGHT_ADDON_SECTION: 'right-addon-section',\n SEPARATOR: 'separator',\n MAIN_SECTION: 'main-section',\n TITLE: 'title',\n DESCRIPTION: 'description',\n} as const;\n\n// we are giving \"component_name_data_testid\" to avoid errors on duplicate exports variables in aggregators\nexport const CARD_V2_DATA_TESTID = {\n ...slotObjectToDataTestIds(DSCardV2Name, CARD_V2_SLOTS),\n CARD_CONTAINER: 'em-ds-card',\n CARD_HEADER: 'em-ds-card-header',\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAAwC;AAEjC,MAAM,eAAe;AAGrB,MAAM,gBAAgB;AAAA,EAC3B,gBAAgB;AAAA,EAChB,cAAc;AAAA,EACd,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,qBAAqB;AAAA,EACrB,WAAW;AAAA,EACX,cAAc;AAAA,EACd,OAAO;AAAA,EACP,aAAa;AACf;AAGO,MAAM,sBAAsB;AAAA,EACjC,OAAG,0CAAwB,cAAc,aAAa;AAAA,EACtD,gBAAgB;AAAA,EAChB,aAAa;AACf;",
4
+ "sourcesContent": ["import { slotObjectToDataTestIds } from '@elliemae/ds-system';\n\nexport const DSCardV2Name = 'DSCardv2';\n\n// we are giving \"component_name_slots\" to avoid errors on duplicate exports variables in aggregators\nexport const CARD_V2_SLOTS = {\n CARD_CONTAINER: 'container',\n LEFT_SECTION: 'left-section',\n LEFT_ADDON: 'left-addon',\n RIGHT_ADDON: 'right-addon',\n RIGHT_ADDON_SECTION: 'right-addon-section',\n SEPARATOR: 'separator',\n MAIN_SECTION: 'main-section',\n DESCRIPTION: 'description',\n TITLE: 'title',\n} as const;\n\n// we are giving \"component_name_data_testid\" to avoid errors on duplicate exports variables in aggregators\nexport const CARD_V2_DATA_TESTID = {\n ...slotObjectToDataTestIds(DSCardV2Name, CARD_V2_SLOTS),\n CARD_CONTAINER: 'em-ds-card',\n CARD_HEADER: 'em-ds-card-header',\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAAwC;AAEjC,MAAM,eAAe;AAGrB,MAAM,gBAAgB;AAAA,EAC3B,gBAAgB;AAAA,EAChB,cAAc;AAAA,EACd,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,qBAAqB;AAAA,EACrB,WAAW;AAAA,EACX,cAAc;AAAA,EACd,aAAa;AAAA,EACb,OAAO;AACT;AAGO,MAAM,sBAAsB;AAAA,EACjC,OAAG,0CAAwB,cAAc,aAAa;AAAA,EACtD,gBAAgB;AAAA,EAChB,aAAa;AACf;",
6
6
  "names": []
7
7
  }
package/dist/cjs/index.js CHANGED
@@ -29,9 +29,11 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
29
29
  var index_exports = {};
30
30
  __export(index_exports, {
31
31
  CARD_V2_DATA_TESTID: () => import_constants.CARD_V2_DATA_TESTID,
32
+ CARD_V2_SLOTS: () => import_constants.CARD_V2_SLOTS,
32
33
  CustomCard: () => import_DSCardV2.DSCardV2,
33
34
  DSCardCustomWithSchema: () => import_DSCardV2.DSCardV2WithSchema,
34
35
  DSCardV2: () => import_DSCardV2.DSCardV2,
36
+ DSCardV2Name: () => import_constants.DSCardV2Name,
35
37
  DSCardV2WithSchema: () => import_DSCardV2.DSCardV2WithSchema
36
38
  });
37
39
  module.exports = __toCommonJS(index_exports);
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/index.ts", "../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["// this is a workaround to typescript error TS2742\n// https://github.com/microsoft/TypeScript/issues/47663\nimport type {} from '@xstyled/system';\nexport {\n DSCardV2,\n DSCardV2 as CustomCard,\n DSCardV2WithSchema,\n DSCardV2WithSchema as DSCardCustomWithSchema,\n} from './DSCardV2.js';\nexport { type DSCardV2T } from './react-desc-prop-types.js';\nexport { CARD_V2_DATA_TESTID } from './constants/index.js';\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,sBAKO;AAEP,uBAAoC;",
4
+ "sourcesContent": ["// this is a workaround to typescript error TS2742\n// https://github.com/microsoft/TypeScript/issues/47663\nimport type {} from '@xstyled/system';\nexport {\n DSCardV2,\n DSCardV2 as CustomCard,\n DSCardV2WithSchema,\n DSCardV2WithSchema as DSCardCustomWithSchema,\n} from './DSCardV2.js';\nexport { type DSCardV2T } from './react-desc-prop-types.js';\nexport { CARD_V2_DATA_TESTID, CARD_V2_SLOTS, DSCardV2Name } from './constants/index.js';\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,sBAKO;AAEP,uBAAiE;",
6
6
  "names": []
7
7
  }
@@ -36,7 +36,8 @@ module.exports = __toCommonJS(react_desc_prop_types_exports);
36
36
  var React = __toESM(require("react"));
37
37
  var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
38
38
  const defaultProps = {
39
- hasBorder: false
39
+ hasBorder: false,
40
+ wrapText: true
40
41
  };
41
42
  const DSCardV2PropTypes = {
42
43
  ...import_ds_props_helpers.globalAttributesPropTypes,
@@ -60,7 +61,11 @@ const DSCardV2PropTypes = {
60
61
  /**
61
62
  * Wheter if the card has border or not
62
63
  */
63
- hasBorder: import_ds_props_helpers.PropTypes.bool.description("Wheter if the card has border or not").defaultValue(false)
64
+ hasBorder: import_ds_props_helpers.PropTypes.bool.description("Wheter if the card has border or not").defaultValue(false),
65
+ /**
66
+ * Whether title and description wrap instead of truncating with tooltip
67
+ */
68
+ wrapText: import_ds_props_helpers.PropTypes.bool.description("Whether title and description wrap instead of truncating with tooltip").defaultValue(true)
64
69
  };
65
70
  const DSCardV2PropTypesSchema = DSCardV2PropTypes;
66
71
  //# sourceMappingURL=react-desc-prop-types.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/react-desc-prop-types.ts", "../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import type { WeakValidationMap } from 'react';\nimport type { GlobalAttributesT, XstyledProps, DSPropTypesSchema } from '@elliemae/ds-props-helpers';\nimport { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-props-helpers';\n\nexport declare namespace DSCardV2T {\n export interface RequiredProps {\n title: string;\n }\n\n export interface DefaultProps {\n hasBorder?: boolean;\n }\n\n export interface OptionalProps {\n description?: string;\n leftAddon?: JSX.Element;\n rightAddon?: JSX.Element | JSX.Element[];\n }\n\n export interface Props\n extends Partial<DefaultProps>,\n OptionalProps,\n Omit<\n GlobalAttributesT<HTMLButtonElement>,\n keyof DefaultProps | keyof OptionalProps | keyof RequiredProps | keyof XstyledProps\n >,\n XstyledProps,\n RequiredProps {}\n\n export interface InternalProps\n extends DefaultProps,\n OptionalProps,\n Omit<\n GlobalAttributesT<HTMLButtonElement>,\n keyof DefaultProps | keyof OptionalProps | keyof RequiredProps | keyof XstyledProps\n >,\n XstyledProps,\n RequiredProps {}\n}\n\nexport const defaultProps: DSCardV2T.DefaultProps = {\n hasBorder: false,\n};\n\nexport const DSCardV2PropTypes: DSPropTypesSchema<DSCardV2T.Props> = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n /**\n * Title of the card. requiered\n */\n title: PropTypes.string.isRequired.description('Title of the card. requiered'),\n /**\n * Description of the card. not requiered\n */\n description: PropTypes.string.description('Description of the card. not requiered'),\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').defaultValue(false),\n};\n\nexport const DSCardV2PropTypesSchema = DSCardV2PropTypes as unknown as WeakValidationMap<DSCardV2T.Props>;\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEvB,8BAAuE;AAsChE,MAAM,eAAuC;AAAA,EAClD,WAAW;AACb;AAEO,MAAM,oBAAwD;AAAA,EACnE,GAAG;AAAA,EACH,GAAG;AAAA;AAAA;AAAA;AAAA,EAIH,OAAO,kCAAU,OAAO,WAAW,YAAY,8BAA8B;AAAA;AAAA;AAAA;AAAA,EAI7E,aAAa,kCAAU,OAAO,YAAY,wCAAwC;AAAA;AAAA;AAAA;AAAA,EAIlF,WAAW,kCAAU,QAAQ,YAAY,YAAY;AAAA;AAAA;AAAA;AAAA,EAIrD,YAAY,kCAAU,MAAM,YAAY,oCAAoC;AAAA;AAAA;AAAA;AAAA,EAI5E,WAAW,kCAAU,KAAK,YAAY,sCAAsC,EAAE,aAAa,KAAK;AAClG;AAEO,MAAM,0BAA0B;",
4
+ "sourcesContent": ["import type { WeakValidationMap } from 'react';\nimport type { GlobalAttributesT, XstyledProps, DSPropTypesSchema } from '@elliemae/ds-props-helpers';\nimport { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-props-helpers';\n\nexport declare namespace DSCardV2T {\n export interface RequiredProps {\n title: string;\n }\n\n export interface DefaultProps {\n hasBorder?: boolean;\n wrapText?: boolean;\n }\n\n export interface OptionalProps {\n description?: string;\n leftAddon?: JSX.Element;\n rightAddon?: JSX.Element | JSX.Element[];\n }\n\n export interface Props\n extends Partial<DefaultProps>,\n OptionalProps,\n Omit<\n GlobalAttributesT<HTMLButtonElement>,\n keyof DefaultProps | keyof OptionalProps | keyof RequiredProps | keyof XstyledProps\n >,\n XstyledProps,\n RequiredProps {}\n\n export interface InternalProps\n extends DefaultProps,\n OptionalProps,\n Omit<\n GlobalAttributesT<HTMLButtonElement>,\n keyof DefaultProps | keyof OptionalProps | keyof RequiredProps | keyof XstyledProps\n >,\n XstyledProps,\n RequiredProps {}\n}\n\nexport const defaultProps: DSCardV2T.DefaultProps = {\n hasBorder: false,\n wrapText: true,\n};\n\nexport const DSCardV2PropTypes: DSPropTypesSchema<DSCardV2T.Props> = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n /**\n * Title of the card. requiered\n */\n title: PropTypes.string.isRequired.description('Title of the card. requiered'),\n /**\n * Description of the card. not requiered\n */\n description: PropTypes.string.description('Description of the card. not requiered'),\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').defaultValue(false),\n /**\n * Whether title and description wrap instead of truncating with tooltip\n */\n wrapText: PropTypes.bool\n .description('Whether title and description wrap instead of truncating with tooltip')\n .defaultValue(true),\n};\n\nexport const DSCardV2PropTypesSchema = DSCardV2PropTypes as unknown as WeakValidationMap<DSCardV2T.Props>;\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEvB,8BAAuE;AAuChE,MAAM,eAAuC;AAAA,EAClD,WAAW;AAAA,EACX,UAAU;AACZ;AAEO,MAAM,oBAAwD;AAAA,EACnE,GAAG;AAAA,EACH,GAAG;AAAA;AAAA;AAAA;AAAA,EAIH,OAAO,kCAAU,OAAO,WAAW,YAAY,8BAA8B;AAAA;AAAA;AAAA;AAAA,EAI7E,aAAa,kCAAU,OAAO,YAAY,wCAAwC;AAAA;AAAA;AAAA;AAAA,EAIlF,WAAW,kCAAU,QAAQ,YAAY,YAAY;AAAA;AAAA;AAAA;AAAA,EAIrD,YAAY,kCAAU,MAAM,YAAY,oCAAoC;AAAA;AAAA;AAAA;AAAA,EAI5E,WAAW,kCAAU,KAAK,YAAY,sCAAsC,EAAE,aAAa,KAAK;AAAA;AAAA;AAAA;AAAA,EAIhG,UAAU,kCAAU,KACjB,YAAY,uEAAuE,EACnF,aAAa,IAAI;AACtB;AAEO,MAAM,0BAA0B;",
6
6
  "names": []
7
7
  }
@@ -31,7 +31,6 @@ __export(styles_exports, {
31
31
  CardContainer: () => CardContainer,
32
32
  Description: () => Description,
33
33
  LeftAddon: () => LeftAddon,
34
- LeftSection: () => LeftSection,
35
34
  MainSection: () => MainSection,
36
35
  RightAddon: () => RightAddon,
37
36
  RightAddonSection: () => RightAddonSection,
@@ -47,7 +46,7 @@ const CardContainer = (0, import_ds_system.styled)(import_ds_grid.Grid, { name:
47
46
  align-items: center;
48
47
  justify-content: space-between;
49
48
  width: 100%;
50
- height: 56px;
49
+ min-height: 56px;
51
50
  padding: 8px 16px;
52
51
  position: relative;
53
52
  border: ${({ theme, hasBorder }) => hasBorder ? `1px solid ${theme.colors.neutral["100"]}` : ""};
@@ -64,10 +63,6 @@ const CardContainer = (0, import_ds_system.styled)(import_ds_grid.Grid, { name:
64
63
  }
65
64
  ${import_ds_system.xStyledCommonProps}
66
65
  `;
67
- const LeftSection = (0, import_ds_system.styled)("div", { name: import_constants.DSCardV2Name, slot: import_constants.CARD_V2_SLOTS.LEFT_SECTION })`
68
- display: flex;
69
- align-items: center;
70
- `;
71
66
  const LeftAddon = (0, import_ds_system.styled)("div", { name: import_constants.DSCardV2Name, slot: import_constants.CARD_V2_SLOTS.LEFT_ADDON })`
72
67
  height: fit-content;
73
68
  width: fit-content;
@@ -93,12 +88,15 @@ const Separator = (0, import_ds_system.styled)("div", { name: import_constants.D
93
88
  const MainSection = (0, import_ds_system.styled)("div", { name: import_constants.DSCardV2Name, slot: import_constants.CARD_V2_SLOTS.MAIN_SECTION })`
94
89
  display: flex;
95
90
  flex-direction: column;
91
+ min-width: 0;
96
92
  `;
97
93
  const Title = (0, import_ds_system.styled)("h3", { name: import_constants.DSCardV2Name, slot: import_constants.CARD_V2_SLOTS.TITLE })`
98
94
  margin: 0;
95
+ padding: 0;
99
96
  font-size: 16px;
100
- font-weight: ${(props) => props.theme.fontWeights.regular};
101
- color: ${(props) => props.theme.colors.neutral["800"]};
97
+ font-weight: ${({ theme }) => theme.fontWeights.regular};
98
+ color: ${({ theme }) => theme.colors.neutral["800"]};
99
+ line-height: 1;
102
100
  `;
103
101
  const Description = (0, import_ds_system.styled)("p", { name: import_constants.DSCardV2Name, slot: import_constants.CARD_V2_SLOTS.DESCRIPTION })`
104
102
  margin: 0;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/styles.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import { styled, xStyledCommonProps } from '@elliemae/ds-system';\nimport { Grid } from '@elliemae/ds-grid';\nimport { DSCardV2Name, CARD_V2_SLOTS } from './constants/index.js';\n\nconst CardContainer = styled(Grid, { name: DSCardV2Name, slot: CARD_V2_SLOTS.CARD_CONTAINER })<{ hasBorder?: boolean }>`\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 }) => (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 ${xStyledCommonProps}\n`;\n\nconst LeftSection = styled('div', { name: DSCardV2Name, slot: CARD_V2_SLOTS.LEFT_SECTION })`\n display: flex;\n align-items: center;\n`;\n\nconst LeftAddon = styled('div', { name: DSCardV2Name, slot: CARD_V2_SLOTS.LEFT_ADDON })`\n height: fit-content;\n width: fit-content;\n margin-right: 16px;\n cursor: pointer;\n`;\n\nconst RightAddonSection = styled('div', { name: DSCardV2Name, slot: CARD_V2_SLOTS.RIGHT_ADDON_SECTION })`\n display: flex;\n align-items: center;\n width: fit-content;\n`;\n\nconst RightAddon = styled('div', { name: DSCardV2Name, slot: CARD_V2_SLOTS.RIGHT_ADDON })`\n height: fit-content;\n width: fit-content;\n cursor: pointer;\n`;\n\nconst Separator = styled('div', { name: DSCardV2Name, slot: CARD_V2_SLOTS.SEPARATOR })`\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', { name: DSCardV2Name, slot: CARD_V2_SLOTS.MAIN_SECTION })`\n display: flex;\n flex-direction: column;\n`;\n\nconst Title = styled('h3', { name: DSCardV2Name, slot: CARD_V2_SLOTS.TITLE })`\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', { name: DSCardV2Name, slot: CARD_V2_SLOTS.DESCRIPTION })`\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;AAAA;ACAA,YAAuB;ADAvB,uBAA2C;AAC3C,qBAAqB;AACrB,uBAA4C;AAE5C,MAAM,oBAAgB,yBAAO,qBAAM,EAAE,MAAM,+BAAc,MAAM,+BAAc,eAAe,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YAOjF,CAAC,EAAE,OAAO,UAAU,MAAO,YAAY,aAAa,MAAM,OAAO,QAAQ,KAAK,CAAC,KAAK,EAAG;AAAA;AAAA;AAAA,+BAGpE,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ,KAAK,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IASvE,mCAAkB;AAAA;AAGtB,MAAM,kBAAc,yBAAO,OAAO,EAAE,MAAM,+BAAc,MAAM,+BAAc,aAAa,CAAC;AAAA;AAAA;AAAA;AAK1F,MAAM,gBAAY,yBAAO,OAAO,EAAE,MAAM,+BAAc,MAAM,+BAAc,WAAW,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAOtF,MAAM,wBAAoB,yBAAO,OAAO,EAAE,MAAM,+BAAc,MAAM,+BAAc,oBAAoB,CAAC;AAAA;AAAA;AAAA;AAAA;AAMvG,MAAM,iBAAa,yBAAO,OAAO,EAAE,MAAM,+BAAc,MAAM,+BAAc,YAAY,CAAC;AAAA;AAAA;AAAA;AAAA;AAMxF,MAAM,gBAAY,yBAAO,OAAO,EAAE,MAAM,+BAAc,MAAM,+BAAc,UAAU,CAAC;AAAA;AAAA;AAAA,4BAGzD,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ,KAAK,CAAC;AAAA;AAAA;AAIxE,MAAM,kBAAc,yBAAO,OAAO,EAAE,MAAM,+BAAc,MAAM,+BAAc,aAAa,CAAC;AAAA;AAAA;AAAA;AAK1F,MAAM,YAAQ,yBAAO,MAAM,EAAE,MAAM,+BAAc,MAAM,+BAAc,MAAM,CAAC;AAAA;AAAA;AAAA,iBAG3D,CAAC,UAAU,MAAM,MAAM,YAAY,OAAO;AAAA,WAChD,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ,KAAK,CAAC;AAAA;AAGvD,MAAM,kBAAc,yBAAO,KAAK,EAAE,MAAM,+BAAc,MAAM,+BAAc,YAAY,CAAC;AAAA;AAAA,WAE5E,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ,KAAK,CAAC;AAAA;",
4
+ "sourcesContent": ["import { styled, xStyledCommonProps } from '@elliemae/ds-system';\nimport { Grid } from '@elliemae/ds-grid';\nimport { DSCardV2Name, CARD_V2_SLOTS } from './constants/index.js';\n\nconst CardContainer = styled(Grid, { name: DSCardV2Name, slot: CARD_V2_SLOTS.CARD_CONTAINER })<{ hasBorder?: boolean }>`\n align-items: center;\n justify-content: space-between;\n width: 100%;\n min-height: 56px;\n padding: 8px 16px;\n position: relative;\n border: ${({ theme, hasBorder }) => (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 ${xStyledCommonProps}\n`;\n\nconst LeftAddon = styled('div', { name: DSCardV2Name, slot: CARD_V2_SLOTS.LEFT_ADDON })`\n height: fit-content;\n width: fit-content;\n margin-right: 16px;\n cursor: pointer;\n`;\n\nconst RightAddonSection = styled('div', { name: DSCardV2Name, slot: CARD_V2_SLOTS.RIGHT_ADDON_SECTION })`\n display: flex;\n align-items: center;\n width: fit-content;\n`;\n\nconst RightAddon = styled('div', { name: DSCardV2Name, slot: CARD_V2_SLOTS.RIGHT_ADDON })`\n height: fit-content;\n width: fit-content;\n cursor: pointer;\n`;\n\nconst Separator = styled('div', { name: DSCardV2Name, slot: CARD_V2_SLOTS.SEPARATOR })`\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', { name: DSCardV2Name, slot: CARD_V2_SLOTS.MAIN_SECTION })`\n display: flex;\n flex-direction: column;\n min-width: 0;\n`;\n\nconst Title = styled('h3', { name: DSCardV2Name, slot: CARD_V2_SLOTS.TITLE })`\n margin: 0;\n padding: 0;\n font-size: 16px;\n font-weight: ${({ theme }) => theme.fontWeights.regular};\n color: ${({ theme }) => theme.colors.neutral['800']};\n line-height: 1;\n`;\n\nconst Description = styled('p', { name: DSCardV2Name, slot: CARD_V2_SLOTS.DESCRIPTION })`\n margin: 0;\n color: ${(props) => props.theme.colors.neutral['600']};\n`;\n\nexport { CardContainer, LeftAddon, RightAddonSection, RightAddon, Separator, MainSection, Title, Description };\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,uBAA2C;AAC3C,qBAAqB;AACrB,uBAA4C;AAE5C,MAAM,oBAAgB,yBAAO,qBAAM,EAAE,MAAM,+BAAc,MAAM,+BAAc,eAAe,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YAOjF,CAAC,EAAE,OAAO,UAAU,MAAO,YAAY,aAAa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{ Fragment, jsx, jsxs } from "react/jsx-runtime";
3
- import { describe } from "@elliemae/ds-props-helpers";
3
+ import { describe, useOwnerProps } from "@elliemae/ds-props-helpers";
4
4
  import { DSTruncatedTooltipText, TooltipTextProvider } from "@elliemae/ds-truncated-tooltip-text";
5
- import { DSHeader } from "@elliemae/ds-header";
5
+ import { DSTypography, TYPOGRAPHY_VARIANTS } from "@elliemae/ds-typography";
6
+ import { useGetLayoutMode } from "@elliemae/ds-system";
6
7
  import { DSCardV2PropTypesSchema } from "./react-desc-prop-types.js";
7
8
  import { useCardV2 } from "./config/useCardV2.js";
8
9
  import { DSCardV2Name, CARD_V2_DATA_TESTID } from "./constants/index.js";
9
10
  import {
10
11
  CardContainer,
11
- LeftSection,
12
12
  LeftAddon,
13
13
  MainSection,
14
14
  Description,
15
15
  RightAddonSection,
16
16
  RightAddon,
17
- Separator
17
+ Separator,
18
+ Title
18
19
  } from "./styles.js";
19
- const getCol = (rightAddon) => {
20
+ const getCols = (rightAddon, isSmall) => {
21
+ if (isSmall) return ["1fr"];
20
22
  if (!rightAddon) return ["1fr"];
21
- return ["1fr", "auto"];
23
+ return ["auto", "minmax(0, 1fr)", "auto"];
24
+ };
25
+ const getRows = (isSmall) => {
26
+ if (isSmall) return ["auto", "auto", "auto"];
27
+ return ["auto"];
22
28
  };
23
29
  const DSCardV2 = (props) => {
24
30
  const { propsWithDefault, globalProps, xstyledProps } = useCardV2(props);
25
- const { hasBorder, title, leftAddon, rightAddon, description } = propsWithDefault;
31
+ const { hasBorder, title, leftAddon, rightAddon, description, wrapText } = propsWithDefault;
32
+ const { getOwnerProps, getOwnerPropsArguments } = useOwnerProps(propsWithDefault);
33
+ const layoutMode = useGetLayoutMode();
34
+ const isSmall = layoutMode === "s" || layoutMode === "xs";
26
35
  return /* @__PURE__ */ jsx(TooltipTextProvider, { children: /* @__PURE__ */ jsxs(
27
36
  CardContainer,
28
37
  {
@@ -31,39 +40,67 @@ const DSCardV2 = (props) => {
31
40
  ...globalProps,
32
41
  ...xstyledProps,
33
42
  hasBorder,
34
- cols: getCol(rightAddon),
43
+ cols: getCols(rightAddon, isSmall),
44
+ rows: getRows(isSmall),
45
+ getOwnerProps,
46
+ getOwnerPropsArguments,
35
47
  children: [
36
- /* @__PURE__ */ jsxs(LeftSection, { children: [
37
- leftAddon && /* @__PURE__ */ jsx(LeftAddon, { children: leftAddon }),
38
- /* @__PURE__ */ jsxs(
39
- MainSection,
40
- {
41
- style: {
42
- maxWidth: leftAddon ? "calc(100% - 40px)" : "100%"
43
- },
44
- children: [
45
- /* @__PURE__ */ jsx(
46
- DSHeader,
47
- {
48
- "data-testid": CARD_V2_DATA_TESTID.CARD_HEADER,
49
- fontSize: "16px",
50
- fontWeight: "regular",
51
- color: "neutral.800",
52
- text: /* @__PURE__ */ jsx(DSTruncatedTooltipText, { value: title })
53
- }
54
- ),
55
- description && /* @__PURE__ */ jsx(Description, { children: /* @__PURE__ */ jsx(DSTruncatedTooltipText, { value: description }) })
56
- ]
57
- }
58
- )
59
- ] }),
60
- Array.isArray(rightAddon) && /* @__PURE__ */ jsxs(RightAddonSection, { children: [
61
- rightAddon[0] ? /* @__PURE__ */ jsx(RightAddon, { children: rightAddon[0] }) : null,
62
- rightAddon[1] ? /* @__PURE__ */ jsxs(Fragment, { children: [
63
- rightAddon.length > 1 && /* @__PURE__ */ jsx(Separator, {}),
64
- /* @__PURE__ */ jsx(RightAddon, { children: rightAddon[1] })
65
- ] }) : null
66
- ] })
48
+ leftAddon && /* @__PURE__ */ jsx(
49
+ LeftAddon,
50
+ {
51
+ style: {
52
+ gridColumn: isSmall ? "1" : "1",
53
+ gridRow: isSmall ? "1" : "1",
54
+ justifySelf: isSmall ? "center" : "start"
55
+ },
56
+ getOwnerProps,
57
+ getOwnerPropsArguments,
58
+ children: leftAddon
59
+ }
60
+ ),
61
+ /* @__PURE__ */ jsxs(
62
+ MainSection,
63
+ {
64
+ style: {
65
+ gridColumn: isSmall ? "1" : "2",
66
+ gridRow: isSmall ? "2" : "1",
67
+ textAlign: isSmall ? "center" : "left"
68
+ },
69
+ getOwnerProps,
70
+ getOwnerPropsArguments,
71
+ children: [
72
+ /* @__PURE__ */ jsx(
73
+ Title,
74
+ {
75
+ "data-testid": CARD_V2_DATA_TESTID.CARD_HEADER,
76
+ getOwnerProps,
77
+ getOwnerPropsArguments,
78
+ children: wrapText ? /* @__PURE__ */ jsx(DSTypography, { variant: TYPOGRAPHY_VARIANTS.B1, as: "span", children: title }) : /* @__PURE__ */ jsx(DSTruncatedTooltipText, { value: title })
79
+ }
80
+ ),
81
+ description && /* @__PURE__ */ jsx(Description, { getOwnerProps, getOwnerPropsArguments, children: wrapText ? /* @__PURE__ */ jsx(DSTypography, { variant: TYPOGRAPHY_VARIANTS.B1, as: "span", children: description }) : /* @__PURE__ */ jsx(DSTruncatedTooltipText, { value: description }) })
82
+ ]
83
+ }
84
+ ),
85
+ Array.isArray(rightAddon) && /* @__PURE__ */ jsxs(
86
+ RightAddonSection,
87
+ {
88
+ style: {
89
+ gridColumn: isSmall ? "1" : "3",
90
+ gridRow: isSmall ? "3" : "1",
91
+ justifySelf: isSmall ? "center" : "end"
92
+ },
93
+ getOwnerProps,
94
+ getOwnerPropsArguments,
95
+ children: [
96
+ rightAddon[0] ? /* @__PURE__ */ jsx(RightAddon, { getOwnerProps, getOwnerPropsArguments, children: rightAddon[0] }) : null,
97
+ rightAddon[1] ? /* @__PURE__ */ jsxs(Fragment, { children: [
98
+ rightAddon.length > 1 && /* @__PURE__ */ jsx(Separator, { getOwnerProps, getOwnerPropsArguments }),
99
+ /* @__PURE__ */ jsx(RightAddon, { getOwnerProps, getOwnerPropsArguments, children: rightAddon[1] })
100
+ ] }) : null
101
+ ]
102
+ }
103
+ )
67
104
  ]
68
105
  }
69
106
  ) });
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/DSCardV2.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { DSTruncatedTooltipText, TooltipTextProvider } from '@elliemae/ds-truncated-tooltip-text';\nimport { DSHeader } from '@elliemae/ds-header';\nimport { type DSCardV2T, DSCardV2PropTypesSchema } from './react-desc-prop-types.js';\nimport { useCardV2 } from './config/useCardV2.js';\nimport { DSCardV2Name, CARD_V2_DATA_TESTID } from './constants/index.js';\nimport {\n CardContainer,\n LeftSection,\n LeftAddon,\n MainSection,\n Description,\n RightAddonSection,\n RightAddon,\n Separator,\n} from './styles.js';\n\nconst getCol = (rightAddon: DSCardV2T.OptionalProps['rightAddon']) => {\n if (!rightAddon) return ['1fr'];\n return ['1fr', 'auto'];\n};\n\nconst DSCardV2: React.ComponentType<DSCardV2T.Props> = (props) => {\n const { propsWithDefault, globalProps, xstyledProps } = useCardV2(props);\n const { hasBorder, title, leftAddon, rightAddon, description } = propsWithDefault;\n return (\n <TooltipTextProvider>\n <CardContainer\n data-component-selector=\"ds-card-v2\"\n data-testid={CARD_V2_DATA_TESTID.CARD_CONTAINER} // we must keep this explicit to avoid the breaking changes\n {...globalProps}\n {...xstyledProps}\n hasBorder={hasBorder}\n cols={getCol(rightAddon)}\n >\n <LeftSection>\n {leftAddon && <LeftAddon>{leftAddon}</LeftAddon>}\n <MainSection\n style={{\n maxWidth: leftAddon ? 'calc(100% - 40px)' : '100%',\n }}\n >\n <DSHeader\n data-testid={CARD_V2_DATA_TESTID.CARD_HEADER} // we must keep this explicit to avoid the breaking changes\n fontSize=\"16px\"\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 {Array.isArray(rightAddon) && (\n <RightAddonSection>\n {rightAddon[0] ? <RightAddon>{rightAddon[0]}</RightAddon> : null}\n {rightAddon[1] ? (\n <>\n {rightAddon.length > 1 && <Separator />}\n <RightAddon>{rightAddon[1]}</RightAddon>\n </>\n ) : null}\n </RightAddonSection>\n )}\n </CardContainer>\n </TooltipTextProvider>\n );\n};\n\nDSCardV2.displayName = DSCardV2Name;\nconst DSCardV2WithSchema = describe(DSCardV2);\nDSCardV2WithSchema.propTypes = DSCardV2PropTypesSchema;\n\nexport { DSCardV2, DSCardV2WithSchema };\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACqCC,SAwBV,UAxBU,KACd,YADc;AApCxB,SAAS,gBAAgB;AACzB,SAAS,wBAAwB,2BAA2B;AAC5D,SAAS,gBAAgB;AACzB,SAAyB,+BAA+B;AACxD,SAAS,iBAAiB;AAC1B,SAAS,cAAc,2BAA2B;AAClD;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,MAAM,SAAS,CAAC,eAAsD;AACpE,MAAI,CAAC,WAAY,QAAO,CAAC,KAAK;AAC9B,SAAO,CAAC,OAAO,MAAM;AACvB;AAEA,MAAM,WAAiD,CAAC,UAAU;AAChE,QAAM,EAAE,kBAAkB,aAAa,aAAa,IAAI,UAAU,KAAK;AACvE,QAAM,EAAE,WAAW,OAAO,WAAW,YAAY,YAAY,IAAI;AACjE,SACE,oBAAC,uBACC;AAAA,IAAC;AAAA;AAAA,MACC,2BAAwB;AAAA,MACxB,eAAa,oBAAoB;AAAA,MAChC,GAAG;AAAA,MACH,GAAG;AAAA,MACJ;AAAA,MACA,MAAM,OAAO,UAAU;AAAA,MAEvB;AAAA,6BAAC,eACE;AAAA,uBAAa,oBAAC,aAAW,qBAAU;AAAA,UACpC;AAAA,YAAC;AAAA;AAAA,cACC,OAAO;AAAA,gBACL,UAAU,YAAY,sBAAsB;AAAA,cAC9C;AAAA,cAEA;AAAA;AAAA,kBAAC;AAAA;AAAA,oBACC,eAAa,oBAAoB;AAAA,oBACjC,UAAS;AAAA,oBACT,YAAW;AAAA,oBACX,OAAM;AAAA,oBACN,MAAM,oBAAC,0BAAuB,OAAO,OAAO;AAAA;AAAA,gBAC9C;AAAA,gBACC,eACC,oBAAC,eACC,8BAAC,0BAAuB,OAAO,aAAa,GAC9C;AAAA;AAAA;AAAA,UAEJ;AAAA,WACF;AAAA,QACC,MAAM,QAAQ,UAAU,KACvB,qBAAC,qBACE;AAAA,qBAAW,CAAC,IAAI,oBAAC,cAAY,qBAAW,CAAC,GAAE,IAAgB;AAAA,UAC3D,WAAW,CAAC,IACX,iCACG;AAAA,uBAAW,SAAS,KAAK,oBAAC,aAAU;AAAA,YACrC,oBAAC,cAAY,qBAAW,CAAC,GAAE;AAAA,aAC7B,IACE;AAAA,WACN;AAAA;AAAA;AAAA,EAEJ,GACF;AAEJ;AAEA,SAAS,cAAc;AACvB,MAAM,qBAAqB,SAAS,QAAQ;AAC5C,mBAAmB,YAAY;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { describe, useOwnerProps } from '@elliemae/ds-props-helpers';\nimport { DSTruncatedTooltipText, TooltipTextProvider } from '@elliemae/ds-truncated-tooltip-text';\nimport { DSTypography, TYPOGRAPHY_VARIANTS } from '@elliemae/ds-typography';\nimport { useGetLayoutMode } from '@elliemae/ds-system';\nimport { type DSCardV2T, DSCardV2PropTypesSchema } from './react-desc-prop-types.js';\nimport { useCardV2 } from './config/useCardV2.js';\nimport { DSCardV2Name, CARD_V2_DATA_TESTID } from './constants/index.js';\nimport {\n CardContainer,\n LeftAddon,\n MainSection,\n Description,\n RightAddonSection,\n RightAddon,\n Separator,\n Title,\n} from './styles.js';\n\nconst getCols = (rightAddon: DSCardV2T.OptionalProps['rightAddon'], isSmall: boolean) => {\n if (isSmall) return ['1fr'];\n if (!rightAddon) return ['1fr'];\n return ['auto', 'minmax(0, 1fr)', 'auto'];\n};\n\nconst getRows = (isSmall: boolean) => {\n if (isSmall) return ['auto', 'auto', 'auto'];\n return ['auto'];\n};\n// eslint-disable-next-line complexity\nconst DSCardV2: React.ComponentType<DSCardV2T.Props> = (props) => {\n const { propsWithDefault, globalProps, xstyledProps } = useCardV2(props);\n const { hasBorder, title, leftAddon, rightAddon, description, wrapText } = propsWithDefault;\n const { getOwnerProps, getOwnerPropsArguments } = useOwnerProps(propsWithDefault);\n const layoutMode = useGetLayoutMode();\n const isSmall = layoutMode === 's' || layoutMode === 'xs';\n\n return (\n <TooltipTextProvider>\n <CardContainer\n data-component-selector=\"ds-card-v2\"\n data-testid={CARD_V2_DATA_TESTID.CARD_CONTAINER} // we must keep this explicit to avoid the breaking changes\n {...globalProps}\n {...xstyledProps}\n hasBorder={hasBorder}\n cols={getCols(rightAddon, isSmall)}\n rows={getRows(isSmall)}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {leftAddon && (\n <LeftAddon\n style={{\n gridColumn: isSmall ? '1' : '1',\n gridRow: isSmall ? '1' : '1',\n justifySelf: isSmall ? 'center' : 'start',\n }}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {leftAddon}\n </LeftAddon>\n )}\n <MainSection\n style={{\n gridColumn: isSmall ? '1' : '2',\n gridRow: isSmall ? '2' : '1',\n textAlign: isSmall ? 'center' : 'left',\n }}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <Title\n data-testid={CARD_V2_DATA_TESTID.CARD_HEADER}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {wrapText ? (\n <DSTypography variant={TYPOGRAPHY_VARIANTS.B1} as=\"span\">\n {title}\n </DSTypography>\n ) : (\n <DSTruncatedTooltipText value={title} />\n )}\n </Title>\n {description && (\n <Description getOwnerProps={getOwnerProps} getOwnerPropsArguments={getOwnerPropsArguments}>\n {wrapText ? (\n <DSTypography variant={TYPOGRAPHY_VARIANTS.B1} as=\"span\">\n {description}\n </DSTypography>\n ) : (\n <DSTruncatedTooltipText value={description} />\n )}\n </Description>\n )}\n </MainSection>\n\n {Array.isArray(rightAddon) && (\n <RightAddonSection\n style={{\n gridColumn: isSmall ? '1' : '3',\n gridRow: isSmall ? '3' : '1',\n justifySelf: isSmall ? 'center' : 'end',\n }}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {rightAddon[0] ? (\n <RightAddon getOwnerProps={getOwnerProps} getOwnerPropsArguments={getOwnerPropsArguments}>\n {rightAddon[0]}\n </RightAddon>\n ) : null}\n {rightAddon[1] ? (\n <>\n {rightAddon.length > 1 && (\n <Separator getOwnerProps={getOwnerProps} getOwnerPropsArguments={getOwnerPropsArguments} />\n )}\n <RightAddon getOwnerProps={getOwnerProps} getOwnerPropsArguments={getOwnerPropsArguments}>\n {rightAddon[1]}\n </RightAddon>\n </>\n ) : null}\n </RightAddonSection>\n )}\n </CardContainer>\n </TooltipTextProvider>\n );\n};\n\nDSCardV2.displayName = DSCardV2Name;\nconst DSCardV2WithSchema = describe(DSCardV2);\nDSCardV2WithSchema.propTypes = DSCardV2PropTypesSchema;\n\nexport { DSCardV2, DSCardV2WithSchema };\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACmDb,SA+DI,UA/DJ,KAYF,YAZE;AAlDV,SAAS,UAAU,qBAAqB;AACxC,SAAS,wBAAwB,2BAA2B;AAC5D,SAAS,cAAc,2BAA2B;AAClD,SAAS,wBAAwB;AACjC,SAAyB,+BAA+B;AACxD,SAAS,iBAAiB;AAC1B,SAAS,cAAc,2BAA2B;AAClD;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,MAAM,UAAU,CAAC,YAAmD,YAAqB;AACvF,MAAI,QAAS,QAAO,CAAC,KAAK;AAC1B,MAAI,CAAC,WAAY,QAAO,CAAC,KAAK;AAC9B,SAAO,CAAC,QAAQ,kBAAkB,MAAM;AAC1C;AAEA,MAAM,UAAU,CAAC,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,gBAAa,SAAS,oBAAoB,IAAI,IAAG,QAC/C,uBACH,IAEA,oBAAC,0BAAuB,OAAO,aAAa,GAEhD;AAAA;AAAA;AAAA,QAEJ;AAAA,QAEC,MAAM,QAAQ,UAAU,KACvB;AAAA,UAAC;AAAA;AAAA,YACC,OAAO;AAAA,cACL,YAAY,UAAU,MAAM;AAAA,cAC5B,SAAS,UAAU,MAAM;AAAA,cACzB,aAAa,UAAU,WAAW;AAAA,YACpC;AAAA,YACA;AAAA,YACA;AAAA,YAEC;AAAA,yBAAW,CAAC,IACX,oBAAC,cAAW,eAA8B,wBACvC,qBAAW,CAAC,GACf,IACE;AAAA,cACH,WAAW,CAAC,IACX,iCACG;AAAA,2BAAW,SAAS,KACnB,oBAAC,aAAU,eAA8B,wBAAgD;AAAA,gBAE3F,oBAAC,cAAW,eAA8B,wBACvC,qBAAW,CAAC,GACf;AAAA,iBACF,IACE;AAAA;AAAA;AAAA,QACN;AAAA;AAAA;AAAA,EAEJ,GACF;AAEJ;AAEA,SAAS,cAAc;AACvB,MAAM,qBAAqB,SAAS,QAAQ;AAC5C,mBAAmB,YAAY;",
6
6
  "names": []
7
7
  }
@@ -9,8 +9,8 @@ const CARD_V2_SLOTS = {
9
9
  RIGHT_ADDON_SECTION: "right-addon-section",
10
10
  SEPARATOR: "separator",
11
11
  MAIN_SECTION: "main-section",
12
- TITLE: "title",
13
- DESCRIPTION: "description"
12
+ DESCRIPTION: "description",
13
+ TITLE: "title"
14
14
  };
15
15
  const CARD_V2_DATA_TESTID = {
16
16
  ...slotObjectToDataTestIds(DSCardV2Name, CARD_V2_SLOTS),
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/constants/index.ts"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { slotObjectToDataTestIds } from '@elliemae/ds-system';\n\nexport const DSCardV2Name = 'DSCardv2';\n\n// we are giving \"component_name_slots\" to avoid errors on duplicate exports variables in aggregators\nexport const CARD_V2_SLOTS = {\n CARD_CONTAINER: 'container',\n LEFT_SECTION: 'left-section',\n LEFT_ADDON: 'left-addon',\n RIGHT_ADDON: 'right-addon',\n RIGHT_ADDON_SECTION: 'right-addon-section',\n SEPARATOR: 'separator',\n MAIN_SECTION: 'main-section',\n TITLE: 'title',\n DESCRIPTION: 'description',\n} as const;\n\n// we are giving \"component_name_data_testid\" to avoid errors on duplicate exports variables in aggregators\nexport const CARD_V2_DATA_TESTID = {\n ...slotObjectToDataTestIds(DSCardV2Name, CARD_V2_SLOTS),\n CARD_CONTAINER: 'em-ds-card',\n CARD_HEADER: 'em-ds-card-header',\n};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,+BAA+B;AAEjC,MAAM,eAAe;AAGrB,MAAM,gBAAgB;AAAA,EAC3B,gBAAgB;AAAA,EAChB,cAAc;AAAA,EACd,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,qBAAqB;AAAA,EACrB,WAAW;AAAA,EACX,cAAc;AAAA,EACd,OAAO;AAAA,EACP,aAAa;AACf;AAGO,MAAM,sBAAsB;AAAA,EACjC,GAAG,wBAAwB,cAAc,aAAa;AAAA,EACtD,gBAAgB;AAAA,EAChB,aAAa;AACf;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { slotObjectToDataTestIds } from '@elliemae/ds-system';\n\nexport const DSCardV2Name = 'DSCardv2';\n\n// we are giving \"component_name_slots\" to avoid errors on duplicate exports variables in aggregators\nexport const CARD_V2_SLOTS = {\n CARD_CONTAINER: 'container',\n LEFT_SECTION: 'left-section',\n LEFT_ADDON: 'left-addon',\n RIGHT_ADDON: 'right-addon',\n RIGHT_ADDON_SECTION: 'right-addon-section',\n SEPARATOR: 'separator',\n MAIN_SECTION: 'main-section',\n DESCRIPTION: 'description',\n TITLE: 'title',\n} as const;\n\n// we are giving \"component_name_data_testid\" to avoid errors on duplicate exports variables in aggregators\nexport const CARD_V2_DATA_TESTID = {\n ...slotObjectToDataTestIds(DSCardV2Name, CARD_V2_SLOTS),\n CARD_CONTAINER: 'em-ds-card',\n CARD_HEADER: 'em-ds-card-header',\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,+BAA+B;AAEjC,MAAM,eAAe;AAGrB,MAAM,gBAAgB;AAAA,EAC3B,gBAAgB;AAAA,EAChB,cAAc;AAAA,EACd,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,qBAAqB;AAAA,EACrB,WAAW;AAAA,EACX,cAAc;AAAA,EACd,aAAa;AAAA,EACb,OAAO;AACT;AAGO,MAAM,sBAAsB;AAAA,EACjC,GAAG,wBAAwB,cAAc,aAAa;AAAA,EACtD,gBAAgB;AAAA,EAChB,aAAa;AACf;",
6
6
  "names": []
7
7
  }
package/dist/esm/index.js CHANGED
@@ -5,12 +5,14 @@ import {
5
5
  DSCardV2WithSchema,
6
6
  DSCardV2WithSchema as DSCardV2WithSchema2
7
7
  } from "./DSCardV2.js";
8
- import { CARD_V2_DATA_TESTID } from "./constants/index.js";
8
+ import { CARD_V2_DATA_TESTID, CARD_V2_SLOTS, DSCardV2Name } from "./constants/index.js";
9
9
  export {
10
10
  CARD_V2_DATA_TESTID,
11
+ CARD_V2_SLOTS,
11
12
  DSCardV22 as CustomCard,
12
13
  DSCardV2WithSchema2 as DSCardCustomWithSchema,
13
14
  DSCardV2,
15
+ DSCardV2Name,
14
16
  DSCardV2WithSchema
15
17
  };
16
18
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/index.ts"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "// this is a workaround to typescript error TS2742\n// https://github.com/microsoft/TypeScript/issues/47663\nimport type {} from '@xstyled/system';\nexport {\n DSCardV2,\n DSCardV2 as CustomCard,\n DSCardV2WithSchema,\n DSCardV2WithSchema as DSCardCustomWithSchema,\n} from './DSCardV2.js';\nexport { type DSCardV2T } from './react-desc-prop-types.js';\nexport { CARD_V2_DATA_TESTID } from './constants/index.js';\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACGvB;AAAA,EACE;AAAA,EACY,YAAZA;AAAA,EACA;AAAA,EACsB,sBAAtBC;AAAA,OACK;AAEP,SAAS,2BAA2B;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "// this is a workaround to typescript error TS2742\n// https://github.com/microsoft/TypeScript/issues/47663\nimport type {} from '@xstyled/system';\nexport {\n DSCardV2,\n DSCardV2 as CustomCard,\n DSCardV2WithSchema,\n DSCardV2WithSchema as DSCardCustomWithSchema,\n} from './DSCardV2.js';\nexport { type DSCardV2T } from './react-desc-prop-types.js';\nexport { CARD_V2_DATA_TESTID, CARD_V2_SLOTS, DSCardV2Name } from './constants/index.js';\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACGvB;AAAA,EACE;AAAA,EACY,YAAZA;AAAA,EACA;AAAA,EACsB,sBAAtBC;AAAA,OACK;AAEP,SAAS,qBAAqB,eAAe,oBAAoB;",
6
6
  "names": ["DSCardV2", "DSCardV2WithSchema"]
7
7
  }
@@ -1,7 +1,8 @@
1
1
  import * as React from "react";
2
2
  import { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from "@elliemae/ds-props-helpers";
3
3
  const defaultProps = {
4
- hasBorder: false
4
+ hasBorder: false,
5
+ wrapText: true
5
6
  };
6
7
  const DSCardV2PropTypes = {
7
8
  ...globalAttributesPropTypes,
@@ -25,7 +26,11 @@ const DSCardV2PropTypes = {
25
26
  /**
26
27
  * Wheter if the card has border or not
27
28
  */
28
- hasBorder: PropTypes.bool.description("Wheter if the card has border or not").defaultValue(false)
29
+ hasBorder: PropTypes.bool.description("Wheter if the card has border or not").defaultValue(false),
30
+ /**
31
+ * Whether title and description wrap instead of truncating with tooltip
32
+ */
33
+ wrapText: PropTypes.bool.description("Whether title and description wrap instead of truncating with tooltip").defaultValue(true)
29
34
  };
30
35
  const DSCardV2PropTypesSchema = DSCardV2PropTypes;
31
36
  export {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/react-desc-prop-types.ts"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { WeakValidationMap } from 'react';\nimport type { GlobalAttributesT, XstyledProps, DSPropTypesSchema } from '@elliemae/ds-props-helpers';\nimport { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-props-helpers';\n\nexport declare namespace DSCardV2T {\n export interface RequiredProps {\n title: string;\n }\n\n export interface DefaultProps {\n hasBorder?: boolean;\n }\n\n export interface OptionalProps {\n description?: string;\n leftAddon?: JSX.Element;\n rightAddon?: JSX.Element | JSX.Element[];\n }\n\n export interface Props\n extends Partial<DefaultProps>,\n OptionalProps,\n Omit<\n GlobalAttributesT<HTMLButtonElement>,\n keyof DefaultProps | keyof OptionalProps | keyof RequiredProps | keyof XstyledProps\n >,\n XstyledProps,\n RequiredProps {}\n\n export interface InternalProps\n extends DefaultProps,\n OptionalProps,\n Omit<\n GlobalAttributesT<HTMLButtonElement>,\n keyof DefaultProps | keyof OptionalProps | keyof RequiredProps | keyof XstyledProps\n >,\n XstyledProps,\n RequiredProps {}\n}\n\nexport const defaultProps: DSCardV2T.DefaultProps = {\n hasBorder: false,\n};\n\nexport const DSCardV2PropTypes: DSPropTypesSchema<DSCardV2T.Props> = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n /**\n * Title of the card. requiered\n */\n title: PropTypes.string.isRequired.description('Title of the card. requiered'),\n /**\n * Description of the card. not requiered\n */\n description: PropTypes.string.description('Description of the card. not requiered'),\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').defaultValue(false),\n};\n\nexport const DSCardV2PropTypesSchema = DSCardV2PropTypes as unknown as WeakValidationMap<DSCardV2T.Props>;\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACEvB,SAAS,WAAW,2BAA2B,wBAAwB;AAsChE,MAAM,eAAuC;AAAA,EAClD,WAAW;AACb;AAEO,MAAM,oBAAwD;AAAA,EACnE,GAAG;AAAA,EACH,GAAG;AAAA;AAAA;AAAA;AAAA,EAIH,OAAO,UAAU,OAAO,WAAW,YAAY,8BAA8B;AAAA;AAAA;AAAA;AAAA,EAI7E,aAAa,UAAU,OAAO,YAAY,wCAAwC;AAAA;AAAA;AAAA;AAAA,EAIlF,WAAW,UAAU,QAAQ,YAAY,YAAY;AAAA;AAAA;AAAA;AAAA,EAIrD,YAAY,UAAU,MAAM,YAAY,oCAAoC;AAAA;AAAA;AAAA;AAAA,EAI5E,WAAW,UAAU,KAAK,YAAY,sCAAsC,EAAE,aAAa,KAAK;AAClG;AAEO,MAAM,0BAA0B;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { WeakValidationMap } from 'react';\nimport type { GlobalAttributesT, XstyledProps, DSPropTypesSchema } from '@elliemae/ds-props-helpers';\nimport { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-props-helpers';\n\nexport declare namespace DSCardV2T {\n export interface RequiredProps {\n title: string;\n }\n\n export interface DefaultProps {\n hasBorder?: boolean;\n wrapText?: boolean;\n }\n\n export interface OptionalProps {\n description?: string;\n leftAddon?: JSX.Element;\n rightAddon?: JSX.Element | JSX.Element[];\n }\n\n export interface Props\n extends Partial<DefaultProps>,\n OptionalProps,\n Omit<\n GlobalAttributesT<HTMLButtonElement>,\n keyof DefaultProps | keyof OptionalProps | keyof RequiredProps | keyof XstyledProps\n >,\n XstyledProps,\n RequiredProps {}\n\n export interface InternalProps\n extends DefaultProps,\n OptionalProps,\n Omit<\n GlobalAttributesT<HTMLButtonElement>,\n keyof DefaultProps | keyof OptionalProps | keyof RequiredProps | keyof XstyledProps\n >,\n XstyledProps,\n RequiredProps {}\n}\n\nexport const defaultProps: DSCardV2T.DefaultProps = {\n hasBorder: false,\n wrapText: true,\n};\n\nexport const DSCardV2PropTypes: DSPropTypesSchema<DSCardV2T.Props> = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n /**\n * Title of the card. requiered\n */\n title: PropTypes.string.isRequired.description('Title of the card. requiered'),\n /**\n * Description of the card. not requiered\n */\n description: PropTypes.string.description('Description of the card. not requiered'),\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').defaultValue(false),\n /**\n * Whether title and description wrap instead of truncating with tooltip\n */\n wrapText: PropTypes.bool\n .description('Whether title and description wrap instead of truncating with tooltip')\n .defaultValue(true),\n};\n\nexport const DSCardV2PropTypesSchema = DSCardV2PropTypes as unknown as WeakValidationMap<DSCardV2T.Props>;\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACEvB,SAAS,WAAW,2BAA2B,wBAAwB;AAuChE,MAAM,eAAuC;AAAA,EAClD,WAAW;AAAA,EACX,UAAU;AACZ;AAEO,MAAM,oBAAwD;AAAA,EACnE,GAAG;AAAA,EACH,GAAG;AAAA;AAAA;AAAA;AAAA,EAIH,OAAO,UAAU,OAAO,WAAW,YAAY,8BAA8B;AAAA;AAAA;AAAA;AAAA,EAI7E,aAAa,UAAU,OAAO,YAAY,wCAAwC;AAAA;AAAA;AAAA;AAAA,EAIlF,WAAW,UAAU,QAAQ,YAAY,YAAY;AAAA;AAAA;AAAA;AAAA,EAIrD,YAAY,UAAU,MAAM,YAAY,oCAAoC;AAAA;AAAA;AAAA;AAAA,EAI5E,WAAW,UAAU,KAAK,YAAY,sCAAsC,EAAE,aAAa,KAAK;AAAA;AAAA;AAAA;AAAA,EAIhG,UAAU,UAAU,KACjB,YAAY,uEAAuE,EACnF,aAAa,IAAI;AACtB;AAEO,MAAM,0BAA0B;",
6
6
  "names": []
7
7
  }
@@ -6,7 +6,7 @@ const CardContainer = styled(Grid, { name: DSCardV2Name, slot: CARD_V2_SLOTS.CAR
6
6
  align-items: center;
7
7
  justify-content: space-between;
8
8
  width: 100%;
9
- height: 56px;
9
+ min-height: 56px;
10
10
  padding: 8px 16px;
11
11
  position: relative;
12
12
  border: ${({ theme, hasBorder }) => hasBorder ? `1px solid ${theme.colors.neutral["100"]}` : ""};
@@ -23,10 +23,6 @@ const CardContainer = styled(Grid, { name: DSCardV2Name, slot: CARD_V2_SLOTS.CAR
23
23
  }
24
24
  ${xStyledCommonProps}
25
25
  `;
26
- const LeftSection = styled("div", { name: DSCardV2Name, slot: CARD_V2_SLOTS.LEFT_SECTION })`
27
- display: flex;
28
- align-items: center;
29
- `;
30
26
  const LeftAddon = styled("div", { name: DSCardV2Name, slot: CARD_V2_SLOTS.LEFT_ADDON })`
31
27
  height: fit-content;
32
28
  width: fit-content;
@@ -52,12 +48,15 @@ const Separator = styled("div", { name: DSCardV2Name, slot: CARD_V2_SLOTS.SEPARA
52
48
  const MainSection = styled("div", { name: DSCardV2Name, slot: CARD_V2_SLOTS.MAIN_SECTION })`
53
49
  display: flex;
54
50
  flex-direction: column;
51
+ min-width: 0;
55
52
  `;
56
53
  const Title = styled("h3", { name: DSCardV2Name, slot: CARD_V2_SLOTS.TITLE })`
57
54
  margin: 0;
55
+ padding: 0;
58
56
  font-size: 16px;
59
- font-weight: ${(props) => props.theme.fontWeights.regular};
60
- color: ${(props) => props.theme.colors.neutral["800"]};
57
+ font-weight: ${({ theme }) => theme.fontWeights.regular};
58
+ color: ${({ theme }) => theme.colors.neutral["800"]};
59
+ line-height: 1;
61
60
  `;
62
61
  const Description = styled("p", { name: DSCardV2Name, slot: CARD_V2_SLOTS.DESCRIPTION })`
63
62
  margin: 0;
@@ -67,7 +66,6 @@ export {
67
66
  CardContainer,
68
67
  Description,
69
68
  LeftAddon,
70
- LeftSection,
71
69
  MainSection,
72
70
  RightAddon,
73
71
  RightAddonSection,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/styles.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { styled, xStyledCommonProps } from '@elliemae/ds-system';\nimport { Grid } from '@elliemae/ds-grid';\nimport { DSCardV2Name, CARD_V2_SLOTS } from './constants/index.js';\n\nconst CardContainer = styled(Grid, { name: DSCardV2Name, slot: CARD_V2_SLOTS.CARD_CONTAINER })<{ hasBorder?: boolean }>`\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 }) => (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 ${xStyledCommonProps}\n`;\n\nconst LeftSection = styled('div', { name: DSCardV2Name, slot: CARD_V2_SLOTS.LEFT_SECTION })`\n display: flex;\n align-items: center;\n`;\n\nconst LeftAddon = styled('div', { name: DSCardV2Name, slot: CARD_V2_SLOTS.LEFT_ADDON })`\n height: fit-content;\n width: fit-content;\n margin-right: 16px;\n cursor: pointer;\n`;\n\nconst RightAddonSection = styled('div', { name: DSCardV2Name, slot: CARD_V2_SLOTS.RIGHT_ADDON_SECTION })`\n display: flex;\n align-items: center;\n width: fit-content;\n`;\n\nconst RightAddon = styled('div', { name: DSCardV2Name, slot: CARD_V2_SLOTS.RIGHT_ADDON })`\n height: fit-content;\n width: fit-content;\n cursor: pointer;\n`;\n\nconst Separator = styled('div', { name: DSCardV2Name, slot: CARD_V2_SLOTS.SEPARATOR })`\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', { name: DSCardV2Name, slot: CARD_V2_SLOTS.MAIN_SECTION })`\n display: flex;\n flex-direction: column;\n`;\n\nconst Title = styled('h3', { name: DSCardV2Name, slot: CARD_V2_SLOTS.TITLE })`\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', { name: DSCardV2Name, slot: CARD_V2_SLOTS.DESCRIPTION })`\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,YAAY,WAAW;ACAvB,SAAS,QAAQ,0BAA0B;AAC3C,SAAS,YAAY;AACrB,SAAS,cAAc,qBAAqB;AAE5C,MAAM,gBAAgB,OAAO,MAAM,EAAE,MAAM,cAAc,MAAM,cAAc,eAAe,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YAOjF,CAAC,EAAE,OAAO,UAAU,MAAO,YAAY,aAAa,MAAM,OAAO,QAAQ,KAAK,CAAC,KAAK,EAAG;AAAA;AAAA;AAAA,+BAGpE,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ,KAAK,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IASvE,kBAAkB;AAAA;AAGtB,MAAM,cAAc,OAAO,OAAO,EAAE,MAAM,cAAc,MAAM,cAAc,aAAa,CAAC;AAAA;AAAA;AAAA;AAK1F,MAAM,YAAY,OAAO,OAAO,EAAE,MAAM,cAAc,MAAM,cAAc,WAAW,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAOtF,MAAM,oBAAoB,OAAO,OAAO,EAAE,MAAM,cAAc,MAAM,cAAc,oBAAoB,CAAC;AAAA;AAAA;AAAA;AAAA;AAMvG,MAAM,aAAa,OAAO,OAAO,EAAE,MAAM,cAAc,MAAM,cAAc,YAAY,CAAC;AAAA;AAAA;AAAA;AAAA;AAMxF,MAAM,YAAY,OAAO,OAAO,EAAE,MAAM,cAAc,MAAM,cAAc,UAAU,CAAC;AAAA;AAAA;AAAA,4BAGzD,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ,KAAK,CAAC;AAAA;AAAA;AAIxE,MAAM,cAAc,OAAO,OAAO,EAAE,MAAM,cAAc,MAAM,cAAc,aAAa,CAAC;AAAA;AAAA;AAAA;AAK1F,MAAM,QAAQ,OAAO,MAAM,EAAE,MAAM,cAAc,MAAM,cAAc,MAAM,CAAC;AAAA;AAAA;AAAA,iBAG3D,CAAC,UAAU,MAAM,MAAM,YAAY,OAAO;AAAA,WAChD,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ,KAAK,CAAC;AAAA;AAGvD,MAAM,cAAc,OAAO,KAAK,EAAE,MAAM,cAAc,MAAM,cAAc,YAAY,CAAC;AAAA;AAAA,WAE5E,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ,KAAK,CAAC;AAAA;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { styled, xStyledCommonProps } from '@elliemae/ds-system';\nimport { Grid } from '@elliemae/ds-grid';\nimport { DSCardV2Name, CARD_V2_SLOTS } from './constants/index.js';\n\nconst CardContainer = styled(Grid, { name: DSCardV2Name, slot: CARD_V2_SLOTS.CARD_CONTAINER })<{ hasBorder?: boolean }>`\n align-items: center;\n justify-content: space-between;\n width: 100%;\n min-height: 56px;\n padding: 8px 16px;\n position: relative;\n border: ${({ theme, hasBorder }) => (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 ${xStyledCommonProps}\n`;\n\nconst LeftAddon = styled('div', { name: DSCardV2Name, slot: CARD_V2_SLOTS.LEFT_ADDON })`\n height: fit-content;\n width: fit-content;\n margin-right: 16px;\n cursor: pointer;\n`;\n\nconst RightAddonSection = styled('div', { name: DSCardV2Name, slot: CARD_V2_SLOTS.RIGHT_ADDON_SECTION })`\n display: flex;\n align-items: center;\n width: fit-content;\n`;\n\nconst RightAddon = styled('div', { name: DSCardV2Name, slot: CARD_V2_SLOTS.RIGHT_ADDON })`\n height: fit-content;\n width: fit-content;\n cursor: pointer;\n`;\n\nconst Separator = styled('div', { name: DSCardV2Name, slot: CARD_V2_SLOTS.SEPARATOR })`\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', { name: DSCardV2Name, slot: CARD_V2_SLOTS.MAIN_SECTION })`\n display: flex;\n flex-direction: column;\n min-width: 0;\n`;\n\nconst Title = styled('h3', { name: DSCardV2Name, slot: CARD_V2_SLOTS.TITLE })`\n margin: 0;\n padding: 0;\n font-size: 16px;\n font-weight: ${({ theme }) => theme.fontWeights.regular};\n color: ${({ theme }) => theme.colors.neutral['800']};\n line-height: 1;\n`;\n\nconst Description = styled('p', { name: DSCardV2Name, slot: CARD_V2_SLOTS.DESCRIPTION })`\n margin: 0;\n color: ${(props) => props.theme.colors.neutral['600']};\n`;\n\nexport { CardContainer, LeftAddon, RightAddonSection, RightAddon, Separator, MainSection, Title, Description };\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,QAAQ,0BAA0B;AAC3C,SAAS,YAAY;AACrB,SAAS,cAAc,qBAAqB;AAE5C,MAAM,gBAAgB,OAAO,MAAM,EAAE,MAAM,cAAc,MAAM,cAAc,eAAe,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YAOjF,CAAC,EAAE,OAAO,UAAU,MAAO,YAAY,aAAa,MAAM,OAAO,QAAQ,KAAK,CAAC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
9
9
  readonly MAIN_SECTION: "main-section";
10
- readonly TITLE: "title";
11
10
  readonly DESCRIPTION: "description";
11
+ readonly TITLE: "title";
12
12
  };
13
13
  export declare const CARD_V2_DATA_TESTID: {
14
14
  CARD_CONTAINER: string;
@@ -19,6 +19,6 @@ export declare const CARD_V2_DATA_TESTID: {
19
19
  RIGHT_ADDON_SECTION: "ds-cardv2-right-addon-section";
20
20
  SEPARATOR: "ds-cardv2-separator";
21
21
  MAIN_SECTION: "ds-cardv2-main-section";
22
- TITLE: "ds-cardv2-title";
23
22
  DESCRIPTION: "ds-cardv2-description";
23
+ TITLE: "ds-cardv2-title";
24
24
  };
@@ -1,3 +1,3 @@
1
1
  export { DSCardV2, DSCardV2 as CustomCard, DSCardV2WithSchema, DSCardV2WithSchema as DSCardCustomWithSchema, } from './DSCardV2.js';
2
2
  export { type DSCardV2T } from './react-desc-prop-types.js';
3
- export { CARD_V2_DATA_TESTID } from './constants/index.js';
3
+ export { CARD_V2_DATA_TESTID, CARD_V2_SLOTS, DSCardV2Name } from './constants/index.js';
@@ -6,6 +6,7 @@ export declare namespace DSCardV2T {
6
6
  }
7
7
  interface DefaultProps {
8
8
  hasBorder?: boolean;
9
+ wrapText?: boolean;
9
10
  }
10
11
  interface OptionalProps {
11
12
  description?: string;
@@ -1,7 +1,6 @@
1
1
  declare const CardContainer: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("@elliemae/ds-grid").DSGridT.Props & import("react").RefAttributes<HTMLDivElement>>, import("@elliemae/ds-system").Theme, {
2
2
  hasBorder?: boolean;
3
3
  } & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<import("react").ForwardRefExoticComponent<import("@elliemae/ds-grid").DSGridT.Props & import("react").RefAttributes<HTMLDivElement>>>, never>;
4
- declare const LeftSection: import("styled-components").StyledComponent<"div", import("@elliemae/ds-system").Theme, object & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"div">, never>;
5
4
  declare const LeftAddon: import("styled-components").StyledComponent<"div", import("@elliemae/ds-system").Theme, object & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"div">, never>;
6
5
  declare const RightAddonSection: import("styled-components").StyledComponent<"div", import("@elliemae/ds-system").Theme, object & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"div">, never>;
7
6
  declare const RightAddon: import("styled-components").StyledComponent<"div", import("@elliemae/ds-system").Theme, object & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"div">, never>;
@@ -9,4 +8,4 @@ declare const Separator: import("styled-components").StyledComponent<"div", impo
9
8
  declare const MainSection: import("styled-components").StyledComponent<"div", import("@elliemae/ds-system").Theme, object & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"div">, never>;
10
9
  declare const Title: import("styled-components").StyledComponent<"h3", import("@elliemae/ds-system").Theme, object & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"h3">, never>;
11
10
  declare const Description: import("styled-components").StyledComponent<"p", import("@elliemae/ds-system").Theme, object & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"p">, never>;
12
- export { CardContainer, LeftSection, LeftAddon, RightAddonSection, RightAddon, Separator, MainSection, Title, Description, };
11
+ export { CardContainer, LeftAddon, RightAddonSection, RightAddon, Separator, MainSection, Title, Description };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-card-v2",
3
- "version": "3.60.0-next.9",
3
+ "version": "3.70.0-next.1",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Card V2",
6
6
  "files": [
@@ -35,42 +35,37 @@
35
35
  "reportFile": "tests.xml",
36
36
  "indent": 4
37
37
  },
38
- "scripts": {
39
- "dev": "cross-env NODE_ENV=development node ../../../scripts/build/build.mjs --watch",
40
- "test": "pui-cli test --passWithNoTests --coverage=\"false\"",
41
- "lint": "node ../../../scripts/lint.mjs --fix",
42
- "lint:strict": "node ../../../scripts/lint-strict.mjs",
43
- "dts": "node ../../../scripts/dts.mjs",
44
- "build": "cross-env NODE_ENV=production node ../../../scripts/build/build.mjs",
45
- "checkDeps": "npm exec ../../util/ds-codemods -- check-missing-packages --projectFolderPath=\"./\" --ignorePackagesGlobPattern=\"\" --ignoreFilesGlobPattern=\"**/test-ables/*,**/tests/*\""
46
- },
47
38
  "dependencies": {
48
- "@elliemae/ds-grid": "3.60.0-next.9",
49
- "@elliemae/ds-header": "3.60.0-next.9",
50
- "@elliemae/ds-props-helpers": "3.60.0-next.9",
51
- "@elliemae/ds-system": "3.60.0-next.9",
52
- "@elliemae/ds-truncated-tooltip-text": "3.60.0-next.9",
53
- "lodash-es": "catalog:",
54
- "uid": "catalog:"
39
+ "@elliemae/ds-legacy-header": "1.0.16",
40
+ "uid": "^2.0.2",
41
+ "@elliemae/ds-grid": "3.70.0-next.1",
42
+ "@elliemae/ds-truncated-tooltip-text": "3.70.0-next.1",
43
+ "@elliemae/ds-props-helpers": "3.70.0-next.1",
44
+ "@elliemae/ds-system": "3.70.0-next.1"
55
45
  },
56
46
  "devDependencies": {
57
- "@elliemae/ds-icons": "3.60.0-next.9",
58
- "@elliemae/ds-monorepo-devops": "3.60.0-next.9",
59
- "@elliemae/ds-test-utils": "3.60.0-next.9",
60
- "@elliemae/pui-cli": "catalog:",
61
- "@xstyled/system": "catalog:",
62
- "jest": "catalog:",
63
- "styled-components": "catalog:"
47
+ "@xstyled/system": "~3.8.1",
48
+ "jest": "^30.0.0",
49
+ "styled-components": "~5.3.9",
50
+ "@elliemae/ds-monorepo-devops": "3.70.0-next.1",
51
+ "@elliemae/ds-icons": "3.70.0-next.1"
64
52
  },
65
53
  "peerDependencies": {
66
- "lodash-es": "catalog:",
67
- "react": "catalog:",
68
- "react-dom": "catalog:",
69
- "styled-components": "catalog:"
54
+ "react": "^18.3.1",
55
+ "react-dom": "^18.3.1",
56
+ "styled-components": "~5.3.9"
70
57
  },
71
58
  "publishConfig": {
72
59
  "access": "public",
73
60
  "typeSafety": false
74
61
  },
75
- "gitHead": "7b49878bf6b481e639c5412a4c816ee349d91b46"
76
- }
62
+ "scripts": {
63
+ "dev": "cross-env NODE_ENV=development node ../../../scripts/build/build.mjs --watch",
64
+ "test": "ds-monorepo-devops test --passWithNoTests --coverage=\"false\"",
65
+ "lint": "node ../../../scripts/lint.mjs --fix",
66
+ "lint:strict": "node ../../../scripts/lint-strict.mjs",
67
+ "dts": "node ../../../scripts/dts.mjs",
68
+ "build": "cross-env NODE_ENV=production node ../../../scripts/build/build.mjs",
69
+ "checkDeps": "npx -yes ../../util/ds-codemods check-missing-packages --projectFolderPath=\"./\" --ignorePackagesGlobPattern=\"\" --ignoreFilesGlobPattern=\"**/test-ables/*,**/tests/*\""
70
+ }
71
+ }