@elliemae/ds-comments 3.80.0-next.52 → 3.80.0-next.54
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/DSCommentCard.js +3 -17
- package/dist/cjs/DSCommentCard.js.map +2 -2
- package/dist/cjs/{config/DSCommentCardDefinitions.js → constants/index.js} +10 -6
- package/dist/cjs/constants/index.js.map +7 -0
- package/dist/cjs/index.js +8 -9
- package/dist/cjs/index.js.map +4 -4
- package/dist/cjs/react-desc-prop-types.js +2 -15
- package/dist/cjs/react-desc-prop-types.js.map +2 -2
- package/dist/cjs/styled.js +8 -8
- package/dist/cjs/styled.js.map +2 -2
- package/dist/esm/DSCommentCard.js +2 -16
- package/dist/esm/DSCommentCard.js.map +2 -2
- package/dist/esm/{config/DSCommentCardDefinitions.js → constants/index.js} +7 -3
- package/dist/esm/constants/index.js.map +7 -0
- package/dist/esm/index.js +12 -7
- package/dist/esm/index.js.map +4 -4
- package/dist/esm/react-desc-prop-types.js +2 -15
- package/dist/esm/react-desc-prop-types.js.map +2 -2
- package/dist/esm/styled.js +8 -8
- package/dist/esm/styled.js.map +1 -1
- package/dist/types/{config/DSCommentCardDefinitions.d.ts → constants/index.d.ts} +18 -0
- package/dist/types/index.d.ts +1 -3
- package/dist/types/react-desc-prop-types.d.ts +15 -10
- package/package.json +10 -11
- package/dist/cjs/DeprecatedMenu.js +0 -73
- package/dist/cjs/DeprecatedMenu.js.map +0 -7
- package/dist/cjs/config/DSCommentCardDefinitions.js.map +0 -7
- package/dist/esm/DeprecatedMenu.js +0 -43
- package/dist/esm/DeprecatedMenu.js.map +0 -7
- package/dist/esm/config/DSCommentCardDefinitions.js.map +0 -7
- package/dist/types/DeprecatedMenu.d.ts +0 -9
|
@@ -37,10 +37,9 @@ 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_read_more = require("@elliemae/ds-read-more");
|
|
39
39
|
var import_styled = require("./styled.js");
|
|
40
|
-
var
|
|
40
|
+
var import_constants = require("./constants/index.js");
|
|
41
41
|
var import_useCommentCard = require("./config/useCommentCard.js");
|
|
42
42
|
var import_react_desc_prop_types = require("./react-desc-prop-types.js");
|
|
43
|
-
var import_DeprecatedMenu = require("./DeprecatedMenu.js");
|
|
44
43
|
var import_utils = require("./utils.js");
|
|
45
44
|
const DSCommentCard = (props) => {
|
|
46
45
|
const {
|
|
@@ -52,9 +51,6 @@ const DSCommentCard = (props) => {
|
|
|
52
51
|
style,
|
|
53
52
|
borderBottom,
|
|
54
53
|
maxLines,
|
|
55
|
-
options,
|
|
56
|
-
selection,
|
|
57
|
-
customDropdownMenuProps,
|
|
58
54
|
Menu,
|
|
59
55
|
menuProps,
|
|
60
56
|
innerRef,
|
|
@@ -97,7 +93,7 @@ const DSCommentCard = (props) => {
|
|
|
97
93
|
displayDate,
|
|
98
94
|
displayTime,
|
|
99
95
|
type,
|
|
100
|
-
withMenu:
|
|
96
|
+
withMenu: Boolean(Menu),
|
|
101
97
|
content
|
|
102
98
|
}),
|
|
103
99
|
className: "em-ds-comments__comment-card-left",
|
|
@@ -136,16 +132,6 @@ const DSCommentCard = (props) => {
|
|
|
136
132
|
]
|
|
137
133
|
}
|
|
138
134
|
),
|
|
139
|
-
options && options.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
140
|
-
import_DeprecatedMenu.DeprecatedMenu,
|
|
141
|
-
{
|
|
142
|
-
getOwnerProps,
|
|
143
|
-
getOwnerPropsArguments,
|
|
144
|
-
options,
|
|
145
|
-
selection,
|
|
146
|
-
customDropdownMenuProps
|
|
147
|
-
}
|
|
148
|
-
),
|
|
149
135
|
Menu && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styled.CommentCardMenu, { getOwnerProps, getOwnerPropsArguments, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Menu, { ...menuProps }) })
|
|
150
136
|
]
|
|
151
137
|
}
|
|
@@ -173,7 +159,7 @@ const DSCommentCard = (props) => {
|
|
|
173
159
|
}
|
|
174
160
|
);
|
|
175
161
|
};
|
|
176
|
-
DSCommentCard.displayName =
|
|
162
|
+
DSCommentCard.displayName = import_constants.DSCommentCardName;
|
|
177
163
|
const DSCommentCardWithSchema = (0, import_ds_props_helpers.describe)(DSCommentCard);
|
|
178
164
|
DSCommentCardWithSchema.propTypes = import_react_desc_prop_types.DSCommentCardPropTypesSchema;
|
|
179
165
|
//# sourceMappingURL=DSCommentCard.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/DSCommentCard.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable complexity */\nimport React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { DSReadMore } from '@elliemae/ds-read-more';\nimport {\n CommentCardWrapper,\n CommentCardHeader,\n CommentCardContent,\n CommentCardName,\n CommentCardData,\n CommentCardMenu,\n CommentCardLeft,\n} from './styled.js';\nimport { DSCommentCardName } from './
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["/* eslint-disable complexity */\nimport React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { DSReadMore } from '@elliemae/ds-read-more';\nimport {\n CommentCardWrapper,\n CommentCardHeader,\n CommentCardContent,\n CommentCardName,\n CommentCardData,\n CommentCardMenu,\n CommentCardLeft,\n} from './styled.js';\nimport { DSCommentCardName } from './constants/index.js';\nimport { useCommentCard } from './config/useCommentCard.js';\nimport { DSCommentCardPropTypesSchema, type DSCommentCardT } from './react-desc-prop-types.js';\nimport { buildAriaLabel } from './utils.js';\n\nexport const DSCommentCard: React.ComponentType<DSCommentCardT.Props> = (props) => {\n const {\n propsWithDefault: {\n containerProps,\n name,\n type,\n content,\n style,\n borderBottom,\n maxLines,\n Menu,\n menuProps,\n innerRef,\n focusableRef,\n readMoreProps,\n },\n xstyledProps,\n getOwnerProps,\n getOwnerPropsArguments,\n displayDate,\n displayTime,\n } = useCommentCard(props);\n\n return (\n <CommentCardWrapper\n className={`em-ds-comments__comment-card-wrapper em-ds-comments__comment-card-wrapper--default${\n borderBottom ? 'em-ds-comments__comment-card-wrapper--borderBottom' : ''\n }`}\n borderBot={borderBottom}\n role=\"listitem\"\n {...containerProps}\n {...xstyledProps}\n style={{ ...style, ...(containerProps.style || {}) }}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n innerRef={innerRef}\n >\n <CommentCardHeader\n className={`em-ds-comments__comment-card-header em-ds-comments__comment-card-header--default${\n borderBottom ? 'em-ds-comments__comment-card-header--borderBottom' : ''\n }`}\n borderBottom={borderBottom}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <CommentCardLeft\n tabIndex={0}\n aria-label={buildAriaLabel({\n name,\n displayDate,\n displayTime,\n type,\n withMenu: Boolean(Menu),\n content,\n })}\n className=\"em-ds-comments__comment-card-left\"\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n innerRef={focusableRef}\n >\n <CommentCardName\n className=\"em-ds-comments__comment-card-name\"\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {name}\n </CommentCardName>\n <CommentCardData\n className=\"em-ds-comments__comment-card-data\"\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {displayDate}\n {displayTime && (\n <>\n <span>\u2022</span>\n {displayTime}\n </>\n )}\n {type && (\n <>\n <span>\u2022</span>\n {type}\n </>\n )}\n </CommentCardData>\n </CommentCardLeft>\n {Menu && (\n <CommentCardMenu getOwnerProps={getOwnerProps} getOwnerPropsArguments={getOwnerPropsArguments}>\n <Menu {...menuProps} />\n </CommentCardMenu>\n )}\n </CommentCardHeader>\n <CommentCardContent\n className=\"em-ds-comments__comment-card-content\"\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <DSReadMore\n lines={maxLines}\n content={`${content} `}\n more=\"MORE\"\n less=\"LESS\"\n ellipsis=\"... \"\n {...readMoreProps}\n />\n </CommentCardContent>\n </CommentCardWrapper>\n );\n};\n\nDSCommentCard.displayName = DSCommentCardName;\nexport const DSCommentCardWithSchema = describe(DSCommentCard);\nDSCommentCardWithSchema.propTypes = DSCommentCardPropTypesSchema;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD8Eb;AA5EV,8BAAyB;AACzB,0BAA2B;AAC3B,oBAQO;AACP,uBAAkC;AAClC,4BAA+B;AAC/B,mCAAkE;AAClE,mBAA+B;AAExB,MAAM,gBAA2D,CAAC,UAAU;AACjF,QAAM;AAAA,IACJ,kBAAkB;AAAA,MAChB;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,QAAI,sCAAe,KAAK;AAExB,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,qFACT,eAAe,uDAAuD,EACxE;AAAA,MACA,WAAW;AAAA,MACX,MAAK;AAAA,MACJ,GAAG;AAAA,MACH,GAAG;AAAA,MACJ,OAAO,EAAE,GAAG,OAAO,GAAI,eAAe,SAAS,CAAC,EAAG;AAAA,MACnD;AAAA,MACA;AAAA,MACA;AAAA,MAEA;AAAA;AAAA,UAAC;AAAA;AAAA,YACC,WAAW,mFACT,eAAe,sDAAsD,EACvE;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YAEA;AAAA;AAAA,gBAAC;AAAA;AAAA,kBACC,UAAU;AAAA,kBACV,kBAAY,6BAAe;AAAA,oBACzB;AAAA,oBACA;AAAA,oBACA;AAAA,oBACA;AAAA,oBACA,UAAU,QAAQ,IAAI;AAAA,oBACtB;AAAA,kBACF,CAAC;AAAA,kBACD,WAAU;AAAA,kBACV;AAAA,kBACA;AAAA,kBACA,UAAU;AAAA,kBAEV;AAAA;AAAA,sBAAC;AAAA;AAAA,wBACC,WAAU;AAAA,wBACV;AAAA,wBACA;AAAA,wBAEC;AAAA;AAAA,oBACH;AAAA,oBACA;AAAA,sBAAC;AAAA;AAAA,wBACC,WAAU;AAAA,wBACV;AAAA,wBACA;AAAA,wBAEC;AAAA;AAAA,0BACA,eACC,4EACE;AAAA,wEAAC,UAAK,oBAAC;AAAA,4BACN;AAAA,6BACH;AAAA,0BAED,QACC,4EACE;AAAA,wEAAC,UAAK,oBAAC;AAAA,4BACN;AAAA,6BACH;AAAA;AAAA;AAAA,oBAEJ;AAAA;AAAA;AAAA,cACF;AAAA,cACC,QACC,4CAAC,iCAAgB,eAA8B,wBAC7C,sDAAC,QAAM,GAAG,WAAW,GACvB;AAAA;AAAA;AAAA,QAEJ;AAAA,QACA;AAAA,UAAC;AAAA;AAAA,YACC,WAAU;AAAA,YACV;AAAA,YACA;AAAA,YAEA;AAAA,cAAC;AAAA;AAAA,gBACC,OAAO;AAAA,gBACP,SAAS,GAAG,OAAO;AAAA,gBACnB,MAAK;AAAA,gBACL,MAAK;AAAA,gBACL,UAAS;AAAA,gBACR,GAAG;AAAA;AAAA,YACN;AAAA;AAAA,QACF;AAAA;AAAA;AAAA,EACF;AAEJ;AAEA,cAAc,cAAc;AACrB,MAAM,8BAA0B,kCAAS,aAAa;AAC7D,wBAAwB,YAAY;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -26,17 +26,19 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
__export(
|
|
29
|
+
var constants_exports = {};
|
|
30
|
+
__export(constants_exports, {
|
|
31
|
+
COMMENT_CARD_DATA_TESTID: () => COMMENT_CARD_DATA_TESTID,
|
|
32
|
+
COMMENT_CARD_SLOTS: () => COMMENT_CARD_SLOTS,
|
|
31
33
|
DSCommentCardDataTestIds: () => DSCommentCardDataTestIds,
|
|
32
34
|
DSCommentCardName: () => DSCommentCardName,
|
|
33
35
|
DSCommentCardSlots: () => DSCommentCardSlots
|
|
34
36
|
});
|
|
35
|
-
module.exports = __toCommonJS(
|
|
37
|
+
module.exports = __toCommonJS(constants_exports);
|
|
36
38
|
var React = __toESM(require("react"));
|
|
37
39
|
var import_ds_system = require("@elliemae/ds-system");
|
|
38
40
|
const DSCommentCardName = "DSCommentcard";
|
|
39
|
-
const
|
|
41
|
+
const COMMENT_CARD_SLOTS = {
|
|
40
42
|
ROOT: "root",
|
|
41
43
|
HEADER: "header",
|
|
42
44
|
CONTENT: "content",
|
|
@@ -45,5 +47,7 @@ const DSCommentCardSlots = {
|
|
|
45
47
|
DATA: "data",
|
|
46
48
|
MENU_WRAPPER: "menu-wrapper"
|
|
47
49
|
};
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
+
const COMMENT_CARD_DATA_TESTID = (0, import_ds_system.slotObjectToDataTestIds)(DSCommentCardName, COMMENT_CARD_SLOTS);
|
|
51
|
+
const DSCommentCardSlots = COMMENT_CARD_SLOTS;
|
|
52
|
+
const DSCommentCardDataTestIds = COMMENT_CARD_DATA_TESTID;
|
|
53
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/constants/index.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import { slotObjectToDataTestIds } from '@elliemae/ds-system';\n\nexport const DSCommentCardName = 'DSCommentcard';\n\n// we are naming this with the ${component_name}_slots convention to namespace & avoid errors on duplicate exports variables in aggregators\nexport const COMMENT_CARD_SLOTS = {\n ROOT: 'root',\n HEADER: 'header',\n CONTENT: 'content',\n LEFT: 'left',\n NAME: 'name',\n DATA: 'data',\n MENU_WRAPPER: 'menu-wrapper',\n} as const;\n\n// we are naming this with the ${component_name}_data_testid convention to namespace & avoid errors on duplicate exports variables in aggregators\nexport const COMMENT_CARD_DATA_TESTID = slotObjectToDataTestIds(DSCommentCardName, COMMENT_CARD_SLOTS);\n\n// legacy pre-compliance names \u2014 public exports consumers may already import, kept as a mirror of the compliant ones above\nexport const DSCommentCardSlots = COMMENT_CARD_SLOTS;\nexport const DSCommentCardDataTestIds = COMMENT_CARD_DATA_TESTID;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAAwC;AAEjC,MAAM,oBAAoB;AAG1B,MAAM,qBAAqB;AAAA,EAChC,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AAAA,EACN,cAAc;AAChB;AAGO,MAAM,+BAA2B,0CAAwB,mBAAmB,kBAAkB;AAG9F,MAAM,qBAAqB;AAC3B,MAAM,2BAA2B;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/dist/cjs/index.js
CHANGED
|
@@ -28,17 +28,16 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
29
|
var index_exports = {};
|
|
30
30
|
__export(index_exports, {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
31
|
+
COMMENT_CARD_DATA_TESTID: () => import_constants.COMMENT_CARD_DATA_TESTID,
|
|
32
|
+
COMMENT_CARD_SLOTS: () => import_constants.COMMENT_CARD_SLOTS,
|
|
33
|
+
DSCommentCard: () => import_DSCommentCard.DSCommentCard,
|
|
34
|
+
DSCommentCardDataTestIds: () => import_constants.DSCommentCardDataTestIds,
|
|
35
|
+
DSCommentCardName: () => import_constants.DSCommentCardName,
|
|
36
|
+
DSCommentCardSlots: () => import_constants.DSCommentCardSlots,
|
|
37
|
+
DSCommentCardWithSchema: () => import_DSCommentCard.DSCommentCardWithSchema
|
|
37
38
|
});
|
|
38
39
|
module.exports = __toCommonJS(index_exports);
|
|
39
40
|
var React = __toESM(require("react"));
|
|
40
41
|
var import_DSCommentCard = require("./DSCommentCard.js");
|
|
41
|
-
var
|
|
42
|
-
var import_DSCommentCardDefinitions = require("./config/DSCommentCardDefinitions.js");
|
|
43
|
-
var index_default = import_DSCommentCard.DSCommentCard;
|
|
42
|
+
var import_constants = require("./constants/index.js");
|
|
44
43
|
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../src/index.
|
|
4
|
-
"sourcesContent": ["// Workaround for TS2742\nimport type {} from '@xstyled/system';\nimport type {} from '@xstyled/util';\n\
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
6
|
-
"names": [
|
|
3
|
+
"sources": ["../../src/index.ts", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["// Workaround for TS2742\nimport type {} from '@xstyled/system';\nimport type {} from '@xstyled/util';\n\nexport { type DSCommentCardT } from './react-desc-prop-types.js';\nexport { DSCommentCard, DSCommentCardWithSchema } from './DSCommentCard.js';\nexport {\n DSCommentCardName,\n COMMENT_CARD_SLOTS,\n COMMENT_CARD_DATA_TESTID,\n // legacy pre-compliance names, mirror of the two above\n DSCommentCardSlots,\n DSCommentCardDataTestIds,\n} 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;ADKvB,2BAAuD;AACvD,uBAOO;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
|
@@ -35,7 +35,7 @@ __export(react_desc_prop_types_exports, {
|
|
|
35
35
|
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
|
-
var
|
|
38
|
+
var import_constants = require("./constants/index.js");
|
|
39
39
|
const defaultProps = {
|
|
40
40
|
containerProps: {},
|
|
41
41
|
name: "",
|
|
@@ -43,18 +43,13 @@ const defaultProps = {
|
|
|
43
43
|
type: "",
|
|
44
44
|
content: "",
|
|
45
45
|
style: {},
|
|
46
|
-
options: [],
|
|
47
|
-
selection: { "single-selection-internal-external": ["set-as-internal"] },
|
|
48
|
-
customDropdownMenuProps: {
|
|
49
|
-
focusOnOpen: true
|
|
50
|
-
},
|
|
51
46
|
borderBottom: false,
|
|
52
47
|
dateFormat: "MM/DD/YYYY",
|
|
53
48
|
timeFormat: "hh:mm a",
|
|
54
49
|
maxLines: 2
|
|
55
50
|
};
|
|
56
51
|
const DSCommentCardPropTypes = {
|
|
57
|
-
...(0, import_ds_props_helpers.getPropsPerSlotPropTypes)(
|
|
52
|
+
...(0, import_ds_props_helpers.getPropsPerSlotPropTypes)(import_constants.DSCommentCardName, import_constants.COMMENT_CARD_SLOTS),
|
|
58
53
|
...import_ds_props_helpers.globalAttributesPropTypes,
|
|
59
54
|
...import_ds_props_helpers.xstyledPropTypes,
|
|
60
55
|
/** props to inject to comment card wrapper */
|
|
@@ -72,14 +67,6 @@ const DSCommentCardPropTypes = {
|
|
|
72
67
|
type: import_ds_props_helpers.PropTypes.string.description("comment type string"),
|
|
73
68
|
/** comment content */
|
|
74
69
|
content: import_ds_props_helpers.PropTypes.string.description("comment content"),
|
|
75
|
-
/** dropdown menu options */
|
|
76
|
-
options: import_ds_props_helpers.PropTypes.arrayOf(import_ds_props_helpers.PropTypes.object).description("dropdown menu options").deprecated({ version: "4.x", message: "use Menu and menuProps instead" }),
|
|
77
|
-
/** dropdown selection */
|
|
78
|
-
selection: import_ds_props_helpers.PropTypes.object.description("dropdown selection").deprecated({ version: "4.x", message: "use Menu and menuProps instead" }),
|
|
79
|
-
/** pass down props to dropdown */
|
|
80
|
-
customDropdownMenuProps: import_ds_props_helpers.PropTypes.shape({
|
|
81
|
-
focusOnOpen: import_ds_props_helpers.PropTypes.bool
|
|
82
|
-
}).description("pass down props to dropdown").deprecated({ version: "4.x", message: "use Menu and menuProps instead" }),
|
|
83
70
|
/** toggle border bottom for card */
|
|
84
71
|
borderBottom: import_ds_props_helpers.PropTypes.bool.description("toggle border bottom for card"),
|
|
85
72
|
/** moment Year, month, and day tokens https://momentjs.com/docs/#/parsing/string-format/ */
|
|
@@ -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 {\n globalAttributesPropTypes,\n getPropsPerSlotPropTypes,\n PropTypes,\n xstyledPropTypes,\n} from '@elliemae/ds-props-helpers';\nimport type { WeakValidationMap } from 'react';\nimport type { GlobalAttributesT, XstyledProps, DSPropTypesSchema } from '@elliemae/ds-props-helpers';\nimport type { TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport type { DSReadMoreT } from '@elliemae/ds-read-more';\nimport { DSCommentCardName,
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,8BAKO;AAKP,
|
|
4
|
+
"sourcesContent": ["import {\n globalAttributesPropTypes,\n getPropsPerSlotPropTypes,\n PropTypes,\n xstyledPropTypes,\n} from '@elliemae/ds-props-helpers';\nimport type { WeakValidationMap } from 'react';\nimport type { GlobalAttributesT, XstyledProps, DSPropTypesSchema } from '@elliemae/ds-props-helpers';\nimport type { TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport type { DSReadMoreT } from '@elliemae/ds-read-more';\nimport { DSCommentCardName, COMMENT_CARD_SLOTS } from './constants/index.js';\n\nexport declare namespace DSCommentCardT {\n type PropsT<D, R, O, E> = Partial<D> &\n R &\n O &\n Omit<GlobalAttributesT<E>, keyof D | keyof R | keyof O> &\n Omit<XstyledProps, keyof D | keyof R | keyof O>;\n type InternalPropsT<D, R, O, E> = D &\n R &\n O &\n Omit<GlobalAttributesT<E>, keyof D | keyof R | keyof O> &\n Omit<XstyledProps, keyof D | keyof R | keyof O>;\n\n export interface DefaultProps {\n containerProps: React.HTMLAttributes<HTMLDivElement>;\n name: string;\n date: Date;\n type: string;\n content: string;\n style: React.CSSProperties;\n borderBottom: boolean;\n dateFormat: string;\n timeFormat: string;\n maxLines: number;\n }\n\n export type SlotFunctionArguments = {\n dsCommentcardRoot: () => object;\n dsCommentcardHeader: () => object;\n dsCommentcardContent: () => object;\n dsCommentcardLeft: () => object;\n dsCommentcardName: () => object;\n dsCommentcardData: () => object;\n dsCommentcardMenuWrapper: () => object;\n };\n\n export interface OptionalProps extends TypescriptHelpersT.PropsForGlobalOnSlots<\n typeof DSCommentCardName,\n typeof COMMENT_CARD_SLOTS\n > {\n Menu?: React.ComponentType;\n menuProps?: object;\n innerRef?: React.MutableRefObject<HTMLDivElement | null> | ((instance: HTMLElement | null) => void);\n focusableRef?: React.MutableRefObject<HTMLDivElement | null> | ((instance: HTMLElement | null) => void);\n readMoreProps?: DSReadMoreT.Props;\n }\n\n export interface RequiredProps {}\n\n export type Props = PropsT<DefaultProps, RequiredProps, OptionalProps, HTMLDivElement>;\n\n export type InternalProps = InternalPropsT<DefaultProps, RequiredProps, OptionalProps, HTMLDivElement>;\n}\n\nexport const defaultProps: DSCommentCardT.DefaultProps = {\n containerProps: {},\n name: '',\n date: new Date(),\n type: '',\n content: '',\n style: {},\n borderBottom: false,\n dateFormat: 'MM/DD/YYYY',\n timeFormat: 'hh:mm a',\n maxLines: 2,\n};\n\nexport const DSCommentCardPropTypes: DSPropTypesSchema<DSCommentCardT.Props> = {\n ...getPropsPerSlotPropTypes(DSCommentCardName, COMMENT_CARD_SLOTS),\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n /** props to inject to comment card wrapper */\n containerProps: PropTypes.shape({\n id: PropTypes.string,\n 'data-testid': PropTypes.string,\n }).description('props to inject to comment card wrapper'),\n /** form name */\n name: PropTypes.string.description('form name'),\n /** style object */\n style: PropTypes.object.description(' style object '),\n /** date object */\n date: PropTypes.instanceOf(Date).description('date object'),\n /** comment type string */\n type: PropTypes.string.description('comment type string'),\n /** comment content */\n content: PropTypes.string.description('comment content'),\n /** toggle border bottom for card */\n borderBottom: PropTypes.bool.description('toggle border bottom for card'),\n /** moment Year, month, and day tokens https://momentjs.com/docs/#/parsing/string-format/ */\n dateFormat: PropTypes.oneOf(['MM/DD/YYYY', 'MM DD YYYY']).description(\n 'moment Year, month, and day tokens https://momentjs.com/docs/#/parsing/string-format/',\n ),\n /** moment Hour, minute, second, millisecond, and offset tokens https://momentjs.com/docs/#/parsing/string-format/ */\n timeFormat: PropTypes.oneOf(['hh:mm a', 'HH:mm']).description(\n 'moment Hour, minute, second, millisecond, and offset tokens https://momentjs.com/docs/#/parsing/string-format/',\n ),\n /**\n * Max lines\n */\n maxLines: PropTypes.number.description('Max lines'),\n Menu: PropTypes.func.description('Menu component'),\n menuProps: PropTypes.object.description('Props that will be received by the Menu component'),\n innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.func]).description(\n 'Inner ref to the Comment Card component',\n ),\n focusableRef: PropTypes.oneOfType([PropTypes.object, PropTypes.func])\n .description('Ref to the focusable part of the component')\n .deprecated({ version: '4.x', message: 'use global attribute prop instead' }),\n readMoreProps: PropTypes.object.description('Props passed to the DSReadMore component'),\n};\n\nexport const DSCommentCardPropTypesSchema =\n DSCommentCardPropTypes as unknown as WeakValidationMap<DSCommentCardT.Props>;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,8BAKO;AAKP,uBAAsD;AAuD/C,MAAM,eAA4C;AAAA,EACvD,gBAAgB,CAAC;AAAA,EACjB,MAAM;AAAA,EACN,MAAM,oBAAI,KAAK;AAAA,EACf,MAAM;AAAA,EACN,SAAS;AAAA,EACT,OAAO,CAAC;AAAA,EACR,cAAc;AAAA,EACd,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,UAAU;AACZ;AAEO,MAAM,yBAAkE;AAAA,EAC7E,OAAG,kDAAyB,oCAAmB,mCAAkB;AAAA,EACjE,GAAG;AAAA,EACH,GAAG;AAAA;AAAA,EAEH,gBAAgB,kCAAU,MAAM;AAAA,IAC9B,IAAI,kCAAU;AAAA,IACd,eAAe,kCAAU;AAAA,EAC3B,CAAC,EAAE,YAAY,yCAAyC;AAAA;AAAA,EAExD,MAAM,kCAAU,OAAO,YAAY,WAAW;AAAA;AAAA,EAE9C,OAAO,kCAAU,OAAO,YAAY,gBAAgB;AAAA;AAAA,EAEpD,MAAM,kCAAU,WAAW,IAAI,EAAE,YAAY,aAAa;AAAA;AAAA,EAE1D,MAAM,kCAAU,OAAO,YAAY,qBAAqB;AAAA;AAAA,EAExD,SAAS,kCAAU,OAAO,YAAY,iBAAiB;AAAA;AAAA,EAEvD,cAAc,kCAAU,KAAK,YAAY,+BAA+B;AAAA;AAAA,EAExE,YAAY,kCAAU,MAAM,CAAC,cAAc,YAAY,CAAC,EAAE;AAAA,IACxD;AAAA,EACF;AAAA;AAAA,EAEA,YAAY,kCAAU,MAAM,CAAC,WAAW,OAAO,CAAC,EAAE;AAAA,IAChD;AAAA,EACF;AAAA;AAAA;AAAA;AAAA,EAIA,UAAU,kCAAU,OAAO,YAAY,WAAW;AAAA,EAClD,MAAM,kCAAU,KAAK,YAAY,gBAAgB;AAAA,EACjD,WAAW,kCAAU,OAAO,YAAY,mDAAmD;AAAA,EAC3F,UAAU,kCAAU,UAAU,CAAC,kCAAU,QAAQ,kCAAU,IAAI,CAAC,EAAE;AAAA,IAChE;AAAA,EACF;AAAA,EACA,cAAc,kCAAU,UAAU,CAAC,kCAAU,QAAQ,kCAAU,IAAI,CAAC,EACjE,YAAY,4CAA4C,EACxD,WAAW,EAAE,SAAS,OAAO,SAAS,oCAAoC,CAAC;AAAA,EAC9E,eAAe,kCAAU,OAAO,YAAY,0CAA0C;AACxF;AAEO,MAAM,+BACX;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/styled.js
CHANGED
|
@@ -39,8 +39,8 @@ __export(styled_exports, {
|
|
|
39
39
|
module.exports = __toCommonJS(styled_exports);
|
|
40
40
|
var React = __toESM(require("react"));
|
|
41
41
|
var import_ds_system = require("@elliemae/ds-system");
|
|
42
|
-
var
|
|
43
|
-
const CommentCardWrapper = (0, import_ds_system.styled)("div", { name:
|
|
42
|
+
var import_constants = require("./constants/index.js");
|
|
43
|
+
const CommentCardWrapper = (0, import_ds_system.styled)("div", { name: import_constants.DSCommentCardName, slot: import_constants.COMMENT_CARD_SLOTS.ROOT })`
|
|
44
44
|
min-height: 5.80923rem;
|
|
45
45
|
min-width: 18.80615rem;
|
|
46
46
|
margin-left: 1.84615rem;
|
|
@@ -60,7 +60,7 @@ const CommentCardWrapper = (0, import_ds_system.styled)("div", { name: import_DS
|
|
|
60
60
|
}}
|
|
61
61
|
${import_ds_system.xStyledCommonProps}
|
|
62
62
|
`;
|
|
63
|
-
const CommentCardHeader = (0, import_ds_system.styled)("div", { name:
|
|
63
|
+
const CommentCardHeader = (0, import_ds_system.styled)("div", { name: import_constants.DSCommentCardName, slot: import_constants.COMMENT_CARD_SLOTS.HEADER })`
|
|
64
64
|
border-top: solid 1px neutral-100;
|
|
65
65
|
display: flex;
|
|
66
66
|
padding: 0.30769rem 0.30769rem 0.30769rem 0.61538rem;
|
|
@@ -74,7 +74,7 @@ const CommentCardHeader = (0, import_ds_system.styled)("div", { name: import_DSC
|
|
|
74
74
|
return ``;
|
|
75
75
|
}}
|
|
76
76
|
`;
|
|
77
|
-
const CommentCardContent = (0, import_ds_system.styled)("div", { name:
|
|
77
|
+
const CommentCardContent = (0, import_ds_system.styled)("div", { name: import_constants.DSCommentCardName, slot: import_constants.COMMENT_CARD_SLOTS.CONTENT })`
|
|
78
78
|
padding: 0 0.61538rem 0.61538rem 0.61538rem;
|
|
79
79
|
font-size: 1rem;
|
|
80
80
|
line-height: ${() => "1.3"};
|
|
@@ -86,7 +86,7 @@ const CommentCardContent = (0, import_ds_system.styled)("div", { name: import_DS
|
|
|
86
86
|
padding-right: 0.61538rem;
|
|
87
87
|
}
|
|
88
88
|
`;
|
|
89
|
-
const CommentCardLeft = (0, import_ds_system.styled)("div", { name:
|
|
89
|
+
const CommentCardLeft = (0, import_ds_system.styled)("div", { name: import_constants.DSCommentCardName, slot: import_constants.COMMENT_CARD_SLOTS.LEFT })`
|
|
90
90
|
flex: 1;
|
|
91
91
|
&:focus {
|
|
92
92
|
outline: none;
|
|
@@ -104,13 +104,13 @@ const CommentCardLeft = (0, import_ds_system.styled)("div", { name: import_DSCom
|
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
106
|
`;
|
|
107
|
-
const CommentCardName = (0, import_ds_system.styled)("div", { name:
|
|
107
|
+
const CommentCardName = (0, import_ds_system.styled)("div", { name: import_constants.DSCommentCardName, slot: import_constants.COMMENT_CARD_SLOTS.NAME })`
|
|
108
108
|
font-size: 1.0769rem;
|
|
109
109
|
font-weight: 600;
|
|
110
110
|
color: neutral-700;
|
|
111
111
|
padding-bottom: 0.15385rem;
|
|
112
112
|
`;
|
|
113
|
-
const CommentCardData = (0, import_ds_system.styled)("div", { name:
|
|
113
|
+
const CommentCardData = (0, import_ds_system.styled)("div", { name: import_constants.DSCommentCardName, slot: import_constants.COMMENT_CARD_SLOTS.DATA })`
|
|
114
114
|
font-size: 0.923rem;
|
|
115
115
|
font-weight: 300;
|
|
116
116
|
color: neutral-500;
|
|
@@ -118,5 +118,5 @@ const CommentCardData = (0, import_ds_system.styled)("div", { name: import_DSCom
|
|
|
118
118
|
padding: 0 0.30769rem;
|
|
119
119
|
}
|
|
120
120
|
`;
|
|
121
|
-
const CommentCardMenu = (0, import_ds_system.styled)("div", { name:
|
|
121
|
+
const CommentCardMenu = (0, import_ds_system.styled)("div", { name: import_constants.DSCommentCardName, slot: import_constants.COMMENT_CARD_SLOTS.MENU_WRAPPER })``;
|
|
122
122
|
//# sourceMappingURL=styled.js.map
|
package/dist/cjs/styled.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/styled.ts", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { styled, xStyledCommonProps } from '@elliemae/ds-system';\nimport { DSCommentCardName,
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAA2C;AAC3C,
|
|
4
|
+
"sourcesContent": ["import { styled, xStyledCommonProps } from '@elliemae/ds-system';\nimport { DSCommentCardName, COMMENT_CARD_SLOTS } from './constants/index.js';\n\nexport const CommentCardWrapper = styled('div', { name: DSCommentCardName, slot: COMMENT_CARD_SLOTS.ROOT })<{\n borderBot: boolean;\n}>`\n min-height: 5.80923rem;\n min-width: 18.80615rem;\n margin-left: 1.84615rem;\n margin-right: 1.84615rem;\n width: auto;\n border-radius: 2px;\n position: relative;\n ${({ borderBot, theme }) => {\n if (borderBot) {\n return `\n border-top: solid 0 ${theme.colors.neutral[100]};\n border-bottom: solid 1px ${theme.colors.neutral[100]};\n margin-bottom: 1.23077rem;\n `;\n }\n return ``;\n }}\n ${xStyledCommonProps}\n`;\n\nexport const CommentCardHeader = styled('div', { name: DSCommentCardName, slot: COMMENT_CARD_SLOTS.HEADER })<{\n borderBottom: boolean;\n}>`\n border-top: solid 1px neutral-100;\n display: flex;\n padding: 0.30769rem 0.30769rem 0.30769rem 0.61538rem;\n\n ${({ borderBottom, theme }) => {\n if (borderBottom) {\n return `\n border-top: solid 0 ${theme.colors.neutral[100]};\n `;\n }\n return ``;\n }}\n`;\n\nexport const CommentCardContent = styled('div', { name: DSCommentCardName, slot: COMMENT_CARD_SLOTS.CONTENT })`\n padding: 0 0.61538rem 0.61538rem 0.61538rem;\n font-size: 1rem;\n line-height: ${() => '1.3'};\n color: neutral-500;\n button {\n display: inline-block;\n height: auto;\n padding-left: 0.61538rem;\n padding-right: 0.61538rem;\n }\n`;\n\nexport const CommentCardLeft = styled('div', { name: DSCommentCardName, slot: COMMENT_CARD_SLOTS.LEFT })`\n flex: 1;\n &:focus {\n outline: none;\n\n &:after {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n pointer-events: none;\n border-radius: 2px;\n border: 2px solid brand-700;\n }\n }\n`;\n\nexport const CommentCardName = styled('div', { name: DSCommentCardName, slot: COMMENT_CARD_SLOTS.NAME })`\n font-size: 1.0769rem;\n font-weight: 600;\n color: neutral-700;\n padding-bottom: 0.15385rem;\n`;\n\nexport const CommentCardData = styled('div', { name: DSCommentCardName, slot: COMMENT_CARD_SLOTS.DATA })`\n font-size: 0.923rem;\n font-weight: 300;\n color: neutral-500;\n span {\n padding: 0 0.30769rem;\n }\n`;\n\nexport const CommentCardMenu = styled('div', { name: DSCommentCardName, slot: COMMENT_CARD_SLOTS.MENU_WRAPPER })``;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAA2C;AAC3C,uBAAsD;AAE/C,MAAM,yBAAqB,yBAAO,OAAO,EAAE,MAAM,oCAAmB,MAAM,oCAAmB,KAAK,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAUtG,CAAC,EAAE,WAAW,MAAM,MAAM;AAC1B,MAAI,WAAW;AACb,WAAO;AAAA,8BACiB,MAAM,OAAO,QAAQ,GAAG,CAAC;AAAA,mCACpB,MAAM,OAAO,QAAQ,GAAG,CAAC;AAAA;AAAA;AAAA,EAGxD;AACA,SAAO;AACT,CAAC;AAAA,IACC,mCAAkB;AAAA;AAGf,MAAM,wBAAoB,yBAAO,OAAO,EAAE,MAAM,oCAAmB,MAAM,oCAAmB,OAAO,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA,IAOvG,CAAC,EAAE,cAAc,MAAM,MAAM;AAC7B,MAAI,cAAc;AAChB,WAAO;AAAA,8BACiB,MAAM,OAAO,QAAQ,GAAG,CAAC;AAAA;AAAA,EAEnD;AACA,SAAO;AACT,CAAC;AAAA;AAGI,MAAM,yBAAqB,yBAAO,OAAO,EAAE,MAAM,oCAAmB,MAAM,oCAAmB,QAAQ,CAAC;AAAA;AAAA;AAAA,iBAG5F,MAAM,KAAK;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUrB,MAAM,sBAAkB,yBAAO,OAAO,EAAE,MAAM,oCAAmB,MAAM,oCAAmB,KAAK,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAmBhG,MAAM,sBAAkB,yBAAO,OAAO,EAAE,MAAM,oCAAmB,MAAM,oCAAmB,KAAK,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAOhG,MAAM,sBAAkB,yBAAO,OAAO,EAAE,MAAM,oCAAmB,MAAM,oCAAmB,KAAK,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAShG,MAAM,sBAAkB,yBAAO,OAAO,EAAE,MAAM,oCAAmB,MAAM,oCAAmB,aAAa,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -11,10 +11,9 @@ import {
|
|
|
11
11
|
CommentCardMenu,
|
|
12
12
|
CommentCardLeft
|
|
13
13
|
} from "./styled.js";
|
|
14
|
-
import { DSCommentCardName } from "./
|
|
14
|
+
import { DSCommentCardName } from "./constants/index.js";
|
|
15
15
|
import { useCommentCard } from "./config/useCommentCard.js";
|
|
16
16
|
import { DSCommentCardPropTypesSchema } from "./react-desc-prop-types.js";
|
|
17
|
-
import { DeprecatedMenu } from "./DeprecatedMenu.js";
|
|
18
17
|
import { buildAriaLabel } from "./utils.js";
|
|
19
18
|
const DSCommentCard = (props) => {
|
|
20
19
|
const {
|
|
@@ -26,9 +25,6 @@ const DSCommentCard = (props) => {
|
|
|
26
25
|
style,
|
|
27
26
|
borderBottom,
|
|
28
27
|
maxLines,
|
|
29
|
-
options,
|
|
30
|
-
selection,
|
|
31
|
-
customDropdownMenuProps,
|
|
32
28
|
Menu,
|
|
33
29
|
menuProps,
|
|
34
30
|
innerRef,
|
|
@@ -71,7 +67,7 @@ const DSCommentCard = (props) => {
|
|
|
71
67
|
displayDate,
|
|
72
68
|
displayTime,
|
|
73
69
|
type,
|
|
74
|
-
withMenu:
|
|
70
|
+
withMenu: Boolean(Menu),
|
|
75
71
|
content
|
|
76
72
|
}),
|
|
77
73
|
className: "em-ds-comments__comment-card-left",
|
|
@@ -110,16 +106,6 @@ const DSCommentCard = (props) => {
|
|
|
110
106
|
]
|
|
111
107
|
}
|
|
112
108
|
),
|
|
113
|
-
options && options.length > 0 && /* @__PURE__ */ jsx(
|
|
114
|
-
DeprecatedMenu,
|
|
115
|
-
{
|
|
116
|
-
getOwnerProps,
|
|
117
|
-
getOwnerPropsArguments,
|
|
118
|
-
options,
|
|
119
|
-
selection,
|
|
120
|
-
customDropdownMenuProps
|
|
121
|
-
}
|
|
122
|
-
),
|
|
123
109
|
Menu && /* @__PURE__ */ jsx(CommentCardMenu, { getOwnerProps, getOwnerPropsArguments, children: /* @__PURE__ */ jsx(Menu, { ...menuProps }) })
|
|
124
110
|
]
|
|
125
111
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/DSCommentCard.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable complexity */\nimport React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { DSReadMore } from '@elliemae/ds-read-more';\nimport {\n CommentCardWrapper,\n CommentCardHeader,\n CommentCardContent,\n CommentCardName,\n CommentCardData,\n CommentCardMenu,\n CommentCardLeft,\n} from './styled.js';\nimport { DSCommentCardName } from './
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable complexity */\nimport React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { DSReadMore } from '@elliemae/ds-read-more';\nimport {\n CommentCardWrapper,\n CommentCardHeader,\n CommentCardContent,\n CommentCardName,\n CommentCardData,\n CommentCardMenu,\n CommentCardLeft,\n} from './styled.js';\nimport { DSCommentCardName } from './constants/index.js';\nimport { useCommentCard } from './config/useCommentCard.js';\nimport { DSCommentCardPropTypesSchema, type DSCommentCardT } from './react-desc-prop-types.js';\nimport { buildAriaLabel } from './utils.js';\n\nexport const DSCommentCard: React.ComponentType<DSCommentCardT.Props> = (props) => {\n const {\n propsWithDefault: {\n containerProps,\n name,\n type,\n content,\n style,\n borderBottom,\n maxLines,\n Menu,\n menuProps,\n innerRef,\n focusableRef,\n readMoreProps,\n },\n xstyledProps,\n getOwnerProps,\n getOwnerPropsArguments,\n displayDate,\n displayTime,\n } = useCommentCard(props);\n\n return (\n <CommentCardWrapper\n className={`em-ds-comments__comment-card-wrapper em-ds-comments__comment-card-wrapper--default${\n borderBottom ? 'em-ds-comments__comment-card-wrapper--borderBottom' : ''\n }`}\n borderBot={borderBottom}\n role=\"listitem\"\n {...containerProps}\n {...xstyledProps}\n style={{ ...style, ...(containerProps.style || {}) }}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n innerRef={innerRef}\n >\n <CommentCardHeader\n className={`em-ds-comments__comment-card-header em-ds-comments__comment-card-header--default${\n borderBottom ? 'em-ds-comments__comment-card-header--borderBottom' : ''\n }`}\n borderBottom={borderBottom}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <CommentCardLeft\n tabIndex={0}\n aria-label={buildAriaLabel({\n name,\n displayDate,\n displayTime,\n type,\n withMenu: Boolean(Menu),\n content,\n })}\n className=\"em-ds-comments__comment-card-left\"\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n innerRef={focusableRef}\n >\n <CommentCardName\n className=\"em-ds-comments__comment-card-name\"\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {name}\n </CommentCardName>\n <CommentCardData\n className=\"em-ds-comments__comment-card-data\"\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {displayDate}\n {displayTime && (\n <>\n <span>\u2022</span>\n {displayTime}\n </>\n )}\n {type && (\n <>\n <span>\u2022</span>\n {type}\n </>\n )}\n </CommentCardData>\n </CommentCardLeft>\n {Menu && (\n <CommentCardMenu getOwnerProps={getOwnerProps} getOwnerPropsArguments={getOwnerPropsArguments}>\n <Menu {...menuProps} />\n </CommentCardMenu>\n )}\n </CommentCardHeader>\n <CommentCardContent\n className=\"em-ds-comments__comment-card-content\"\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <DSReadMore\n lines={maxLines}\n content={`${content} `}\n more=\"MORE\"\n less=\"LESS\"\n ellipsis=\"... \"\n {...readMoreProps}\n />\n </CommentCardContent>\n </CommentCardWrapper>\n );\n};\n\nDSCommentCard.displayName = DSCommentCardName;\nexport const DSCommentCardWithSchema = describe(DSCommentCard);\nDSCommentCardWithSchema.propTypes = DSCommentCardPropTypesSchema;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;AC8Eb,SAcI,UAdJ,KAcI,YAdJ;AA5EV,SAAS,gBAAgB;AACzB,SAAS,kBAAkB;AAC3B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,yBAAyB;AAClC,SAAS,sBAAsB;AAC/B,SAAS,oCAAyD;AAClE,SAAS,sBAAsB;AAExB,MAAM,gBAA2D,CAAC,UAAU;AACjF,QAAM;AAAA,IACJ,kBAAkB;AAAA,MAChB;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,eAAe,KAAK;AAExB,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,qFACT,eAAe,uDAAuD,EACxE;AAAA,MACA,WAAW;AAAA,MACX,MAAK;AAAA,MACJ,GAAG;AAAA,MACH,GAAG;AAAA,MACJ,OAAO,EAAE,GAAG,OAAO,GAAI,eAAe,SAAS,CAAC,EAAG;AAAA,MACnD;AAAA,MACA;AAAA,MACA;AAAA,MAEA;AAAA;AAAA,UAAC;AAAA;AAAA,YACC,WAAW,mFACT,eAAe,sDAAsD,EACvE;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YAEA;AAAA;AAAA,gBAAC;AAAA;AAAA,kBACC,UAAU;AAAA,kBACV,cAAY,eAAe;AAAA,oBACzB;AAAA,oBACA;AAAA,oBACA;AAAA,oBACA;AAAA,oBACA,UAAU,QAAQ,IAAI;AAAA,oBACtB;AAAA,kBACF,CAAC;AAAA,kBACD,WAAU;AAAA,kBACV;AAAA,kBACA;AAAA,kBACA,UAAU;AAAA,kBAEV;AAAA;AAAA,sBAAC;AAAA;AAAA,wBACC,WAAU;AAAA,wBACV;AAAA,wBACA;AAAA,wBAEC;AAAA;AAAA,oBACH;AAAA,oBACA;AAAA,sBAAC;AAAA;AAAA,wBACC,WAAU;AAAA,wBACV;AAAA,wBACA;AAAA,wBAEC;AAAA;AAAA,0BACA,eACC,iCACE;AAAA,gDAAC,UAAK,oBAAC;AAAA,4BACN;AAAA,6BACH;AAAA,0BAED,QACC,iCACE;AAAA,gDAAC,UAAK,oBAAC;AAAA,4BACN;AAAA,6BACH;AAAA;AAAA;AAAA,oBAEJ;AAAA;AAAA;AAAA,cACF;AAAA,cACC,QACC,oBAAC,mBAAgB,eAA8B,wBAC7C,8BAAC,QAAM,GAAG,WAAW,GACvB;AAAA;AAAA;AAAA,QAEJ;AAAA,QACA;AAAA,UAAC;AAAA;AAAA,YACC,WAAU;AAAA,YACV;AAAA,YACA;AAAA,YAEA;AAAA,cAAC;AAAA;AAAA,gBACC,OAAO;AAAA,gBACP,SAAS,GAAG,OAAO;AAAA,gBACnB,MAAK;AAAA,gBACL,MAAK;AAAA,gBACL,UAAS;AAAA,gBACR,GAAG;AAAA;AAAA,YACN;AAAA;AAAA,QACF;AAAA;AAAA;AAAA,EACF;AAEJ;AAEA,cAAc,cAAc;AACrB,MAAM,0BAA0B,SAAS,aAAa;AAC7D,wBAAwB,YAAY;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { slotObjectToDataTestIds } from "@elliemae/ds-system";
|
|
3
3
|
const DSCommentCardName = "DSCommentcard";
|
|
4
|
-
const
|
|
4
|
+
const COMMENT_CARD_SLOTS = {
|
|
5
5
|
ROOT: "root",
|
|
6
6
|
HEADER: "header",
|
|
7
7
|
CONTENT: "content",
|
|
@@ -10,10 +10,14 @@ const DSCommentCardSlots = {
|
|
|
10
10
|
DATA: "data",
|
|
11
11
|
MENU_WRAPPER: "menu-wrapper"
|
|
12
12
|
};
|
|
13
|
-
const
|
|
13
|
+
const COMMENT_CARD_DATA_TESTID = slotObjectToDataTestIds(DSCommentCardName, COMMENT_CARD_SLOTS);
|
|
14
|
+
const DSCommentCardSlots = COMMENT_CARD_SLOTS;
|
|
15
|
+
const DSCommentCardDataTestIds = COMMENT_CARD_DATA_TESTID;
|
|
14
16
|
export {
|
|
17
|
+
COMMENT_CARD_DATA_TESTID,
|
|
18
|
+
COMMENT_CARD_SLOTS,
|
|
15
19
|
DSCommentCardDataTestIds,
|
|
16
20
|
DSCommentCardName,
|
|
17
21
|
DSCommentCardSlots
|
|
18
22
|
};
|
|
19
|
-
//# sourceMappingURL=
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 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 DSCommentCardName = 'DSCommentcard';\n\n// we are naming this with the ${component_name}_slots convention to namespace & avoid errors on duplicate exports variables in aggregators\nexport const COMMENT_CARD_SLOTS = {\n ROOT: 'root',\n HEADER: 'header',\n CONTENT: 'content',\n LEFT: 'left',\n NAME: 'name',\n DATA: 'data',\n MENU_WRAPPER: 'menu-wrapper',\n} as const;\n\n// we are naming this with the ${component_name}_data_testid convention to namespace & avoid errors on duplicate exports variables in aggregators\nexport const COMMENT_CARD_DATA_TESTID = slotObjectToDataTestIds(DSCommentCardName, COMMENT_CARD_SLOTS);\n\n// legacy pre-compliance names \u2014 public exports consumers may already import, kept as a mirror of the compliant ones above\nexport const DSCommentCardSlots = COMMENT_CARD_SLOTS;\nexport const DSCommentCardDataTestIds = COMMENT_CARD_DATA_TESTID;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,+BAA+B;AAEjC,MAAM,oBAAoB;AAG1B,MAAM,qBAAqB;AAAA,EAChC,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AAAA,EACN,cAAc;AAChB;AAGO,MAAM,2BAA2B,wBAAwB,mBAAmB,kBAAkB;AAG9F,MAAM,qBAAqB;AAC3B,MAAM,2BAA2B;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/dist/esm/index.js
CHANGED
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { DSCommentCard } from "./DSCommentCard.js";
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import { DSCommentCard, DSCommentCardWithSchema } from "./DSCommentCard.js";
|
|
3
|
+
import {
|
|
4
|
+
DSCommentCardName,
|
|
5
|
+
COMMENT_CARD_SLOTS,
|
|
6
|
+
COMMENT_CARD_DATA_TESTID,
|
|
7
|
+
DSCommentCardSlots,
|
|
8
|
+
DSCommentCardDataTestIds
|
|
9
|
+
} from "./constants/index.js";
|
|
6
10
|
export {
|
|
7
|
-
|
|
11
|
+
COMMENT_CARD_DATA_TESTID,
|
|
12
|
+
COMMENT_CARD_SLOTS,
|
|
13
|
+
DSCommentCard,
|
|
8
14
|
DSCommentCardDataTestIds,
|
|
9
15
|
DSCommentCardName,
|
|
10
16
|
DSCommentCardSlots,
|
|
11
|
-
DSCommentCardWithSchema
|
|
12
|
-
index_default as default
|
|
17
|
+
DSCommentCardWithSchema
|
|
13
18
|
};
|
|
14
19
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/index.
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "// Workaround for TS2742\nimport type {} from '@xstyled/system';\nimport type {} from '@xstyled/util';\n\
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
6
|
-
"names": [
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/index.ts"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "// Workaround for TS2742\nimport type {} from '@xstyled/system';\nimport type {} from '@xstyled/util';\n\nexport { type DSCommentCardT } from './react-desc-prop-types.js';\nexport { DSCommentCard, DSCommentCardWithSchema } from './DSCommentCard.js';\nexport {\n DSCommentCardName,\n COMMENT_CARD_SLOTS,\n COMMENT_CARD_DATA_TESTID,\n // legacy pre-compliance names, mirror of the two above\n DSCommentCardSlots,\n DSCommentCardDataTestIds,\n} from './constants/index.js';\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACKvB,SAAS,eAAe,+BAA+B;AACvD;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,OACK;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
PropTypes,
|
|
6
6
|
xstyledPropTypes
|
|
7
7
|
} from "@elliemae/ds-props-helpers";
|
|
8
|
-
import { DSCommentCardName,
|
|
8
|
+
import { DSCommentCardName, COMMENT_CARD_SLOTS } from "./constants/index.js";
|
|
9
9
|
const defaultProps = {
|
|
10
10
|
containerProps: {},
|
|
11
11
|
name: "",
|
|
@@ -13,18 +13,13 @@ const defaultProps = {
|
|
|
13
13
|
type: "",
|
|
14
14
|
content: "",
|
|
15
15
|
style: {},
|
|
16
|
-
options: [],
|
|
17
|
-
selection: { "single-selection-internal-external": ["set-as-internal"] },
|
|
18
|
-
customDropdownMenuProps: {
|
|
19
|
-
focusOnOpen: true
|
|
20
|
-
},
|
|
21
16
|
borderBottom: false,
|
|
22
17
|
dateFormat: "MM/DD/YYYY",
|
|
23
18
|
timeFormat: "hh:mm a",
|
|
24
19
|
maxLines: 2
|
|
25
20
|
};
|
|
26
21
|
const DSCommentCardPropTypes = {
|
|
27
|
-
...getPropsPerSlotPropTypes(DSCommentCardName,
|
|
22
|
+
...getPropsPerSlotPropTypes(DSCommentCardName, COMMENT_CARD_SLOTS),
|
|
28
23
|
...globalAttributesPropTypes,
|
|
29
24
|
...xstyledPropTypes,
|
|
30
25
|
/** props to inject to comment card wrapper */
|
|
@@ -42,14 +37,6 @@ const DSCommentCardPropTypes = {
|
|
|
42
37
|
type: PropTypes.string.description("comment type string"),
|
|
43
38
|
/** comment content */
|
|
44
39
|
content: PropTypes.string.description("comment content"),
|
|
45
|
-
/** dropdown menu options */
|
|
46
|
-
options: PropTypes.arrayOf(PropTypes.object).description("dropdown menu options").deprecated({ version: "4.x", message: "use Menu and menuProps instead" }),
|
|
47
|
-
/** dropdown selection */
|
|
48
|
-
selection: PropTypes.object.description("dropdown selection").deprecated({ version: "4.x", message: "use Menu and menuProps instead" }),
|
|
49
|
-
/** pass down props to dropdown */
|
|
50
|
-
customDropdownMenuProps: PropTypes.shape({
|
|
51
|
-
focusOnOpen: PropTypes.bool
|
|
52
|
-
}).description("pass down props to dropdown").deprecated({ version: "4.x", message: "use Menu and menuProps instead" }),
|
|
53
40
|
/** toggle border bottom for card */
|
|
54
41
|
borderBottom: PropTypes.bool.description("toggle border bottom for card"),
|
|
55
42
|
/** moment Year, month, and day tokens https://momentjs.com/docs/#/parsing/string-format/ */
|
|
@@ -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 {\n globalAttributesPropTypes,\n getPropsPerSlotPropTypes,\n PropTypes,\n xstyledPropTypes,\n} from '@elliemae/ds-props-helpers';\nimport type { WeakValidationMap } from 'react';\nimport type { GlobalAttributesT, XstyledProps, DSPropTypesSchema } from '@elliemae/ds-props-helpers';\nimport type { TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport type { DSReadMoreT } from '@elliemae/ds-read-more';\nimport { DSCommentCardName,
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAKP,SAAS,mBAAmB,0BAA0B;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import {\n globalAttributesPropTypes,\n getPropsPerSlotPropTypes,\n PropTypes,\n xstyledPropTypes,\n} from '@elliemae/ds-props-helpers';\nimport type { WeakValidationMap } from 'react';\nimport type { GlobalAttributesT, XstyledProps, DSPropTypesSchema } from '@elliemae/ds-props-helpers';\nimport type { TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport type { DSReadMoreT } from '@elliemae/ds-read-more';\nimport { DSCommentCardName, COMMENT_CARD_SLOTS } from './constants/index.js';\n\nexport declare namespace DSCommentCardT {\n type PropsT<D, R, O, E> = Partial<D> &\n R &\n O &\n Omit<GlobalAttributesT<E>, keyof D | keyof R | keyof O> &\n Omit<XstyledProps, keyof D | keyof R | keyof O>;\n type InternalPropsT<D, R, O, E> = D &\n R &\n O &\n Omit<GlobalAttributesT<E>, keyof D | keyof R | keyof O> &\n Omit<XstyledProps, keyof D | keyof R | keyof O>;\n\n export interface DefaultProps {\n containerProps: React.HTMLAttributes<HTMLDivElement>;\n name: string;\n date: Date;\n type: string;\n content: string;\n style: React.CSSProperties;\n borderBottom: boolean;\n dateFormat: string;\n timeFormat: string;\n maxLines: number;\n }\n\n export type SlotFunctionArguments = {\n dsCommentcardRoot: () => object;\n dsCommentcardHeader: () => object;\n dsCommentcardContent: () => object;\n dsCommentcardLeft: () => object;\n dsCommentcardName: () => object;\n dsCommentcardData: () => object;\n dsCommentcardMenuWrapper: () => object;\n };\n\n export interface OptionalProps extends TypescriptHelpersT.PropsForGlobalOnSlots<\n typeof DSCommentCardName,\n typeof COMMENT_CARD_SLOTS\n > {\n Menu?: React.ComponentType;\n menuProps?: object;\n innerRef?: React.MutableRefObject<HTMLDivElement | null> | ((instance: HTMLElement | null) => void);\n focusableRef?: React.MutableRefObject<HTMLDivElement | null> | ((instance: HTMLElement | null) => void);\n readMoreProps?: DSReadMoreT.Props;\n }\n\n export interface RequiredProps {}\n\n export type Props = PropsT<DefaultProps, RequiredProps, OptionalProps, HTMLDivElement>;\n\n export type InternalProps = InternalPropsT<DefaultProps, RequiredProps, OptionalProps, HTMLDivElement>;\n}\n\nexport const defaultProps: DSCommentCardT.DefaultProps = {\n containerProps: {},\n name: '',\n date: new Date(),\n type: '',\n content: '',\n style: {},\n borderBottom: false,\n dateFormat: 'MM/DD/YYYY',\n timeFormat: 'hh:mm a',\n maxLines: 2,\n};\n\nexport const DSCommentCardPropTypes: DSPropTypesSchema<DSCommentCardT.Props> = {\n ...getPropsPerSlotPropTypes(DSCommentCardName, COMMENT_CARD_SLOTS),\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n /** props to inject to comment card wrapper */\n containerProps: PropTypes.shape({\n id: PropTypes.string,\n 'data-testid': PropTypes.string,\n }).description('props to inject to comment card wrapper'),\n /** form name */\n name: PropTypes.string.description('form name'),\n /** style object */\n style: PropTypes.object.description(' style object '),\n /** date object */\n date: PropTypes.instanceOf(Date).description('date object'),\n /** comment type string */\n type: PropTypes.string.description('comment type string'),\n /** comment content */\n content: PropTypes.string.description('comment content'),\n /** toggle border bottom for card */\n borderBottom: PropTypes.bool.description('toggle border bottom for card'),\n /** moment Year, month, and day tokens https://momentjs.com/docs/#/parsing/string-format/ */\n dateFormat: PropTypes.oneOf(['MM/DD/YYYY', 'MM DD YYYY']).description(\n 'moment Year, month, and day tokens https://momentjs.com/docs/#/parsing/string-format/',\n ),\n /** moment Hour, minute, second, millisecond, and offset tokens https://momentjs.com/docs/#/parsing/string-format/ */\n timeFormat: PropTypes.oneOf(['hh:mm a', 'HH:mm']).description(\n 'moment Hour, minute, second, millisecond, and offset tokens https://momentjs.com/docs/#/parsing/string-format/',\n ),\n /**\n * Max lines\n */\n maxLines: PropTypes.number.description('Max lines'),\n Menu: PropTypes.func.description('Menu component'),\n menuProps: PropTypes.object.description('Props that will be received by the Menu component'),\n innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.func]).description(\n 'Inner ref to the Comment Card component',\n ),\n focusableRef: PropTypes.oneOfType([PropTypes.object, PropTypes.func])\n .description('Ref to the focusable part of the component')\n .deprecated({ version: '4.x', message: 'use global attribute prop instead' }),\n readMoreProps: PropTypes.object.description('Props passed to the DSReadMore component'),\n};\n\nexport const DSCommentCardPropTypesSchema =\n DSCommentCardPropTypes as unknown as WeakValidationMap<DSCommentCardT.Props>;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAKP,SAAS,mBAAmB,0BAA0B;AAuD/C,MAAM,eAA4C;AAAA,EACvD,gBAAgB,CAAC;AAAA,EACjB,MAAM;AAAA,EACN,MAAM,oBAAI,KAAK;AAAA,EACf,MAAM;AAAA,EACN,SAAS;AAAA,EACT,OAAO,CAAC;AAAA,EACR,cAAc;AAAA,EACd,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,UAAU;AACZ;AAEO,MAAM,yBAAkE;AAAA,EAC7E,GAAG,yBAAyB,mBAAmB,kBAAkB;AAAA,EACjE,GAAG;AAAA,EACH,GAAG;AAAA;AAAA,EAEH,gBAAgB,UAAU,MAAM;AAAA,IAC9B,IAAI,UAAU;AAAA,IACd,eAAe,UAAU;AAAA,EAC3B,CAAC,EAAE,YAAY,yCAAyC;AAAA;AAAA,EAExD,MAAM,UAAU,OAAO,YAAY,WAAW;AAAA;AAAA,EAE9C,OAAO,UAAU,OAAO,YAAY,gBAAgB;AAAA;AAAA,EAEpD,MAAM,UAAU,WAAW,IAAI,EAAE,YAAY,aAAa;AAAA;AAAA,EAE1D,MAAM,UAAU,OAAO,YAAY,qBAAqB;AAAA;AAAA,EAExD,SAAS,UAAU,OAAO,YAAY,iBAAiB;AAAA;AAAA,EAEvD,cAAc,UAAU,KAAK,YAAY,+BAA+B;AAAA;AAAA,EAExE,YAAY,UAAU,MAAM,CAAC,cAAc,YAAY,CAAC,EAAE;AAAA,IACxD;AAAA,EACF;AAAA;AAAA,EAEA,YAAY,UAAU,MAAM,CAAC,WAAW,OAAO,CAAC,EAAE;AAAA,IAChD;AAAA,EACF;AAAA;AAAA;AAAA;AAAA,EAIA,UAAU,UAAU,OAAO,YAAY,WAAW;AAAA,EAClD,MAAM,UAAU,KAAK,YAAY,gBAAgB;AAAA,EACjD,WAAW,UAAU,OAAO,YAAY,mDAAmD;AAAA,EAC3F,UAAU,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,IAAI,CAAC,EAAE;AAAA,IAChE;AAAA,EACF;AAAA,EACA,cAAc,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,IAAI,CAAC,EACjE,YAAY,4CAA4C,EACxD,WAAW,EAAE,SAAS,OAAO,SAAS,oCAAoC,CAAC;AAAA,EAC9E,eAAe,UAAU,OAAO,YAAY,0CAA0C;AACxF;AAEO,MAAM,+BACX;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/styled.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { styled, xStyledCommonProps } from "@elliemae/ds-system";
|
|
3
|
-
import { DSCommentCardName,
|
|
4
|
-
const CommentCardWrapper = styled("div", { name: DSCommentCardName, slot:
|
|
3
|
+
import { DSCommentCardName, COMMENT_CARD_SLOTS } from "./constants/index.js";
|
|
4
|
+
const CommentCardWrapper = styled("div", { name: DSCommentCardName, slot: COMMENT_CARD_SLOTS.ROOT })`
|
|
5
5
|
min-height: 5.80923rem;
|
|
6
6
|
min-width: 18.80615rem;
|
|
7
7
|
margin-left: 1.84615rem;
|
|
@@ -21,7 +21,7 @@ const CommentCardWrapper = styled("div", { name: DSCommentCardName, slot: DSComm
|
|
|
21
21
|
}}
|
|
22
22
|
${xStyledCommonProps}
|
|
23
23
|
`;
|
|
24
|
-
const CommentCardHeader = styled("div", { name: DSCommentCardName, slot:
|
|
24
|
+
const CommentCardHeader = styled("div", { name: DSCommentCardName, slot: COMMENT_CARD_SLOTS.HEADER })`
|
|
25
25
|
border-top: solid 1px neutral-100;
|
|
26
26
|
display: flex;
|
|
27
27
|
padding: 0.30769rem 0.30769rem 0.30769rem 0.61538rem;
|
|
@@ -35,7 +35,7 @@ const CommentCardHeader = styled("div", { name: DSCommentCardName, slot: DSComme
|
|
|
35
35
|
return ``;
|
|
36
36
|
}}
|
|
37
37
|
`;
|
|
38
|
-
const CommentCardContent = styled("div", { name: DSCommentCardName, slot:
|
|
38
|
+
const CommentCardContent = styled("div", { name: DSCommentCardName, slot: COMMENT_CARD_SLOTS.CONTENT })`
|
|
39
39
|
padding: 0 0.61538rem 0.61538rem 0.61538rem;
|
|
40
40
|
font-size: 1rem;
|
|
41
41
|
line-height: ${() => "1.3"};
|
|
@@ -47,7 +47,7 @@ const CommentCardContent = styled("div", { name: DSCommentCardName, slot: DSComm
|
|
|
47
47
|
padding-right: 0.61538rem;
|
|
48
48
|
}
|
|
49
49
|
`;
|
|
50
|
-
const CommentCardLeft = styled("div", { name: DSCommentCardName, slot:
|
|
50
|
+
const CommentCardLeft = styled("div", { name: DSCommentCardName, slot: COMMENT_CARD_SLOTS.LEFT })`
|
|
51
51
|
flex: 1;
|
|
52
52
|
&:focus {
|
|
53
53
|
outline: none;
|
|
@@ -65,13 +65,13 @@ const CommentCardLeft = styled("div", { name: DSCommentCardName, slot: DSComment
|
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
`;
|
|
68
|
-
const CommentCardName = styled("div", { name: DSCommentCardName, slot:
|
|
68
|
+
const CommentCardName = styled("div", { name: DSCommentCardName, slot: COMMENT_CARD_SLOTS.NAME })`
|
|
69
69
|
font-size: 1.0769rem;
|
|
70
70
|
font-weight: 600;
|
|
71
71
|
color: neutral-700;
|
|
72
72
|
padding-bottom: 0.15385rem;
|
|
73
73
|
`;
|
|
74
|
-
const CommentCardData = styled("div", { name: DSCommentCardName, slot:
|
|
74
|
+
const CommentCardData = styled("div", { name: DSCommentCardName, slot: COMMENT_CARD_SLOTS.DATA })`
|
|
75
75
|
font-size: 0.923rem;
|
|
76
76
|
font-weight: 300;
|
|
77
77
|
color: neutral-500;
|
|
@@ -79,7 +79,7 @@ const CommentCardData = styled("div", { name: DSCommentCardName, slot: DSComment
|
|
|
79
79
|
padding: 0 0.30769rem;
|
|
80
80
|
}
|
|
81
81
|
`;
|
|
82
|
-
const CommentCardMenu = styled("div", { name: DSCommentCardName, slot:
|
|
82
|
+
const CommentCardMenu = styled("div", { name: DSCommentCardName, slot: COMMENT_CARD_SLOTS.MENU_WRAPPER })``;
|
|
83
83
|
export {
|
|
84
84
|
CommentCardContent,
|
|
85
85
|
CommentCardData,
|
package/dist/esm/styled.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/styled.ts"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { styled, xStyledCommonProps } from '@elliemae/ds-system';\nimport { DSCommentCardName,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { styled, xStyledCommonProps } from '@elliemae/ds-system';\nimport { DSCommentCardName, COMMENT_CARD_SLOTS } from './constants/index.js';\n\nexport const CommentCardWrapper = styled('div', { name: DSCommentCardName, slot: COMMENT_CARD_SLOTS.ROOT })<{\n borderBot: boolean;\n}>`\n min-height: 5.80923rem;\n min-width: 18.80615rem;\n margin-left: 1.84615rem;\n margin-right: 1.84615rem;\n width: auto;\n border-radius: 2px;\n position: relative;\n ${({ borderBot, theme }) => {\n if (borderBot) {\n return `\n border-top: solid 0 ${theme.colors.neutral[100]};\n border-bottom: solid 1px ${theme.colors.neutral[100]};\n margin-bottom: 1.23077rem;\n `;\n }\n return ``;\n }}\n ${xStyledCommonProps}\n`;\n\nexport const CommentCardHeader = styled('div', { name: DSCommentCardName, slot: COMMENT_CARD_SLOTS.HEADER })<{\n borderBottom: boolean;\n}>`\n border-top: solid 1px neutral-100;\n display: flex;\n padding: 0.30769rem 0.30769rem 0.30769rem 0.61538rem;\n\n ${({ borderBottom, theme }) => {\n if (borderBottom) {\n return `\n border-top: solid 0 ${theme.colors.neutral[100]};\n `;\n }\n return ``;\n }}\n`;\n\nexport const CommentCardContent = styled('div', { name: DSCommentCardName, slot: COMMENT_CARD_SLOTS.CONTENT })`\n padding: 0 0.61538rem 0.61538rem 0.61538rem;\n font-size: 1rem;\n line-height: ${() => '1.3'};\n color: neutral-500;\n button {\n display: inline-block;\n height: auto;\n padding-left: 0.61538rem;\n padding-right: 0.61538rem;\n }\n`;\n\nexport const CommentCardLeft = styled('div', { name: DSCommentCardName, slot: COMMENT_CARD_SLOTS.LEFT })`\n flex: 1;\n &:focus {\n outline: none;\n\n &:after {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n pointer-events: none;\n border-radius: 2px;\n border: 2px solid brand-700;\n }\n }\n`;\n\nexport const CommentCardName = styled('div', { name: DSCommentCardName, slot: COMMENT_CARD_SLOTS.NAME })`\n font-size: 1.0769rem;\n font-weight: 600;\n color: neutral-700;\n padding-bottom: 0.15385rem;\n`;\n\nexport const CommentCardData = styled('div', { name: DSCommentCardName, slot: COMMENT_CARD_SLOTS.DATA })`\n font-size: 0.923rem;\n font-weight: 300;\n color: neutral-500;\n span {\n padding: 0 0.30769rem;\n }\n`;\n\nexport const CommentCardMenu = styled('div', { name: DSCommentCardName, slot: COMMENT_CARD_SLOTS.MENU_WRAPPER })``;\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,QAAQ,0BAA0B;AAC3C,SAAS,mBAAmB,0BAA0B;AAE/C,MAAM,qBAAqB,OAAO,OAAO,EAAE,MAAM,mBAAmB,MAAM,mBAAmB,KAAK,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAUtG,CAAC,EAAE,WAAW,MAAM,MAAM;AAC1B,MAAI,WAAW;AACb,WAAO;AAAA,8BACiB,MAAM,OAAO,QAAQ,GAAG,CAAC;AAAA,mCACpB,MAAM,OAAO,QAAQ,GAAG,CAAC;AAAA;AAAA;AAAA,EAGxD;AACA,SAAO;AACT,CAAC;AAAA,IACC,kBAAkB;AAAA;AAGf,MAAM,oBAAoB,OAAO,OAAO,EAAE,MAAM,mBAAmB,MAAM,mBAAmB,OAAO,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA,IAOvG,CAAC,EAAE,cAAc,MAAM,MAAM;AAC7B,MAAI,cAAc;AAChB,WAAO;AAAA,8BACiB,MAAM,OAAO,QAAQ,GAAG,CAAC;AAAA;AAAA,EAEnD;AACA,SAAO;AACT,CAAC;AAAA;AAGI,MAAM,qBAAqB,OAAO,OAAO,EAAE,MAAM,mBAAmB,MAAM,mBAAmB,QAAQ,CAAC;AAAA;AAAA;AAAA,iBAG5F,MAAM,KAAK;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUrB,MAAM,kBAAkB,OAAO,OAAO,EAAE,MAAM,mBAAmB,MAAM,mBAAmB,KAAK,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAmBhG,MAAM,kBAAkB,OAAO,OAAO,EAAE,MAAM,mBAAmB,MAAM,mBAAmB,KAAK,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAOhG,MAAM,kBAAkB,OAAO,OAAO,EAAE,MAAM,mBAAmB,MAAM,mBAAmB,KAAK,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAShG,MAAM,kBAAkB,OAAO,OAAO,EAAE,MAAM,mBAAmB,MAAM,mBAAmB,aAAa,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,4 +1,22 @@
|
|
|
1
1
|
export declare const DSCommentCardName = "DSCommentcard";
|
|
2
|
+
export declare const COMMENT_CARD_SLOTS: {
|
|
3
|
+
readonly ROOT: "root";
|
|
4
|
+
readonly HEADER: "header";
|
|
5
|
+
readonly CONTENT: "content";
|
|
6
|
+
readonly LEFT: "left";
|
|
7
|
+
readonly NAME: "name";
|
|
8
|
+
readonly DATA: "data";
|
|
9
|
+
readonly MENU_WRAPPER: "menu-wrapper";
|
|
10
|
+
};
|
|
11
|
+
export declare const COMMENT_CARD_DATA_TESTID: {
|
|
12
|
+
readonly ROOT: "ds-commentcard-root";
|
|
13
|
+
readonly HEADER: "ds-commentcard-header";
|
|
14
|
+
readonly CONTENT: "ds-commentcard-content";
|
|
15
|
+
readonly LEFT: "ds-commentcard-left";
|
|
16
|
+
readonly NAME: "ds-commentcard-name";
|
|
17
|
+
readonly DATA: "ds-commentcard-data";
|
|
18
|
+
readonly MENU_WRAPPER: "ds-commentcard-menu-wrapper";
|
|
19
|
+
};
|
|
2
20
|
export declare const DSCommentCardSlots: {
|
|
3
21
|
readonly ROOT: "root";
|
|
4
22
|
readonly HEADER: "header";
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { DSCommentCard } from './DSCommentCard.js';
|
|
2
1
|
export { type DSCommentCardT } from './react-desc-prop-types.js';
|
|
3
2
|
export { DSCommentCard, DSCommentCardWithSchema } from './DSCommentCard.js';
|
|
4
|
-
export { DSCommentCardName, DSCommentCardSlots, DSCommentCardDataTestIds } from './
|
|
5
|
-
export default DSCommentCard;
|
|
3
|
+
export { DSCommentCardName, COMMENT_CARD_SLOTS, COMMENT_CARD_DATA_TESTID, DSCommentCardSlots, DSCommentCardDataTestIds, } from './constants/index.js';
|
|
@@ -2,37 +2,42 @@ import type { WeakValidationMap } from 'react';
|
|
|
2
2
|
import type { GlobalAttributesT, XstyledProps, DSPropTypesSchema } from '@elliemae/ds-props-helpers';
|
|
3
3
|
import type { TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';
|
|
4
4
|
import type { DSReadMoreT } from '@elliemae/ds-read-more';
|
|
5
|
-
import { DSCommentCardName,
|
|
5
|
+
import { DSCommentCardName, COMMENT_CARD_SLOTS } from './constants/index.js';
|
|
6
6
|
export declare namespace DSCommentCardT {
|
|
7
7
|
type PropsT<D, R, O, E> = Partial<D> & R & O & Omit<GlobalAttributesT<E>, keyof D | keyof R | keyof O> & Omit<XstyledProps, keyof D | keyof R | keyof O>;
|
|
8
8
|
type InternalPropsT<D, R, O, E> = D & R & O & Omit<GlobalAttributesT<E>, keyof D | keyof R | keyof O> & Omit<XstyledProps, keyof D | keyof R | keyof O>;
|
|
9
|
-
|
|
9
|
+
interface DefaultProps {
|
|
10
10
|
containerProps: React.HTMLAttributes<HTMLDivElement>;
|
|
11
11
|
name: string;
|
|
12
12
|
date: Date;
|
|
13
13
|
type: string;
|
|
14
14
|
content: string;
|
|
15
15
|
style: React.CSSProperties;
|
|
16
|
-
options: unknown[];
|
|
17
|
-
selection: unknown;
|
|
18
|
-
customDropdownMenuProps: Record<string, unknown>;
|
|
19
16
|
borderBottom: boolean;
|
|
20
17
|
dateFormat: string;
|
|
21
18
|
timeFormat: string;
|
|
22
19
|
maxLines: number;
|
|
23
20
|
}
|
|
24
|
-
|
|
21
|
+
type SlotFunctionArguments = {
|
|
22
|
+
dsCommentcardRoot: () => object;
|
|
23
|
+
dsCommentcardHeader: () => object;
|
|
24
|
+
dsCommentcardContent: () => object;
|
|
25
|
+
dsCommentcardLeft: () => object;
|
|
26
|
+
dsCommentcardName: () => object;
|
|
27
|
+
dsCommentcardData: () => object;
|
|
28
|
+
dsCommentcardMenuWrapper: () => object;
|
|
29
|
+
};
|
|
30
|
+
interface OptionalProps extends TypescriptHelpersT.PropsForGlobalOnSlots<typeof DSCommentCardName, typeof COMMENT_CARD_SLOTS> {
|
|
25
31
|
Menu?: React.ComponentType;
|
|
26
32
|
menuProps?: object;
|
|
27
33
|
innerRef?: React.MutableRefObject<HTMLDivElement | null> | ((instance: HTMLElement | null) => void);
|
|
28
34
|
focusableRef?: React.MutableRefObject<HTMLDivElement | null> | ((instance: HTMLElement | null) => void);
|
|
29
35
|
readMoreProps?: DSReadMoreT.Props;
|
|
30
36
|
}
|
|
31
|
-
|
|
37
|
+
interface RequiredProps {
|
|
32
38
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
export {};
|
|
39
|
+
type Props = PropsT<DefaultProps, RequiredProps, OptionalProps, HTMLDivElement>;
|
|
40
|
+
type InternalProps = InternalPropsT<DefaultProps, RequiredProps, OptionalProps, HTMLDivElement>;
|
|
36
41
|
}
|
|
37
42
|
export declare const defaultProps: DSCommentCardT.DefaultProps;
|
|
38
43
|
export declare const DSCommentCardPropTypes: DSPropTypesSchema<DSCommentCardT.Props>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-comments",
|
|
3
|
-
"version": "3.80.0-next.
|
|
3
|
+
"version": "3.80.0-next.54",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Comments",
|
|
6
6
|
"files": [
|
|
@@ -36,23 +36,22 @@
|
|
|
36
36
|
"indent": 4
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@elliemae/ds-
|
|
40
|
-
"@elliemae/ds-
|
|
41
|
-
"@elliemae/ds-
|
|
42
|
-
"@elliemae/ds-
|
|
43
|
-
"@elliemae/ds-props-helpers": "3.80.0-next.52",
|
|
44
|
-
"@elliemae/ds-read-more": "3.80.0-next.52",
|
|
45
|
-
"@elliemae/ds-system": "3.80.0-next.52",
|
|
46
|
-
"@elliemae/ds-typescript-helpers": "3.80.0-next.52",
|
|
39
|
+
"@elliemae/ds-props-helpers": "3.80.0-next.54",
|
|
40
|
+
"@elliemae/ds-read-more": "3.80.0-next.54",
|
|
41
|
+
"@elliemae/ds-system": "3.80.0-next.54",
|
|
42
|
+
"@elliemae/ds-typescript-helpers": "3.80.0-next.54",
|
|
47
43
|
"moment": "~2.29.4"
|
|
48
44
|
},
|
|
49
45
|
"devDependencies": {
|
|
50
|
-
"@elliemae/ds-monorepo-devops": "3.80.0-next.
|
|
51
|
-
"@elliemae/ds-test-utils": "3.80.0-next.
|
|
46
|
+
"@elliemae/ds-monorepo-devops": "3.80.0-next.54",
|
|
47
|
+
"@elliemae/ds-test-utils": "3.80.0-next.54",
|
|
52
48
|
"jest": "^30.0.0",
|
|
53
49
|
"styled-components": "~5.3.11"
|
|
54
50
|
},
|
|
55
51
|
"peerDependencies": {
|
|
52
|
+
"@testing-library/jest-dom": "^6.6.3",
|
|
53
|
+
"@testing-library/react": "^16.0.1",
|
|
54
|
+
"@testing-library/user-event": "~14.6.1",
|
|
56
55
|
"@xstyled/system": "~3.8.1",
|
|
57
56
|
"@xstyled/util": "~3.7.0",
|
|
58
57
|
"lodash-es": "^4.18.1",
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var DeprecatedMenu_exports = {};
|
|
30
|
-
__export(DeprecatedMenu_exports, {
|
|
31
|
-
DeprecatedMenu: () => DeprecatedMenu
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(DeprecatedMenu_exports);
|
|
34
|
-
var React = __toESM(require("react"));
|
|
35
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
-
var import_react = require("react");
|
|
37
|
-
var import_ds_button_v2 = require("@elliemae/ds-button-v2");
|
|
38
|
-
var import_ds_legacy_dropdownmenu = require("@elliemae/ds-legacy-dropdownmenu");
|
|
39
|
-
var import_ds_icons = require("@elliemae/ds-icons");
|
|
40
|
-
var import_styled = require("./styled.js");
|
|
41
|
-
const DeprecatedMenu = ({
|
|
42
|
-
getOwnerProps,
|
|
43
|
-
getOwnerPropsArguments,
|
|
44
|
-
customDropdownMenuProps,
|
|
45
|
-
options,
|
|
46
|
-
selection
|
|
47
|
-
}) => {
|
|
48
|
-
const ref = (0, import_react.useRef)(null);
|
|
49
|
-
const handleCloseMenu = (0, import_react.useCallback)(() => {
|
|
50
|
-
ref.current?.focus();
|
|
51
|
-
return null;
|
|
52
|
-
}, []);
|
|
53
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
54
|
-
import_styled.CommentCardMenu,
|
|
55
|
-
{
|
|
56
|
-
className: "em-ds-comments__comment-card-menu",
|
|
57
|
-
getOwnerProps,
|
|
58
|
-
getOwnerPropsArguments,
|
|
59
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
60
|
-
import_ds_legacy_dropdownmenu.DSDropdownMenu,
|
|
61
|
-
{
|
|
62
|
-
...customDropdownMenuProps,
|
|
63
|
-
onClose: handleCloseMenu,
|
|
64
|
-
options,
|
|
65
|
-
selection,
|
|
66
|
-
triggerComponent: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_button_v2.DSButtonV2, { buttonType: "icon", innerRef: ref, "aria-label": "More options", "aria-haspopup": "menu", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_icons.MoreOptionsVert, {}) }),
|
|
67
|
-
zIndex: 11
|
|
68
|
-
}
|
|
69
|
-
)
|
|
70
|
-
}
|
|
71
|
-
);
|
|
72
|
-
};
|
|
73
|
-
//# sourceMappingURL=DeprecatedMenu.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/DeprecatedMenu.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-nocheck\nimport { useCallback, useRef } from 'react';\nimport { DSButtonV2 } from '@elliemae/ds-button-v2';\nimport { DSDropdownMenu } from '@elliemae/ds-legacy-dropdownmenu';\nimport { MoreOptionsVert } from '@elliemae/ds-icons';\nimport { CommentCardMenu } from './styled.js';\n\ninterface DeprecatedMenuProps {\n getOwnerProps: () => object;\n getOwnerPropsArguments: () => object;\n options: unknown[];\n selection: unknown;\n customDropdownMenuProps: Record<string, unknown>;\n}\n\nexport const DeprecatedMenu: React.ComponentType<DeprecatedMenuProps> = ({\n getOwnerProps,\n getOwnerPropsArguments,\n customDropdownMenuProps,\n options,\n selection,\n}) => {\n const ref = useRef<HTMLButtonElement | null>(null);\n\n const handleCloseMenu = useCallback(() => {\n ref.current?.focus();\n return null;\n }, []);\n\n return (\n <CommentCardMenu\n className=\"em-ds-comments__comment-card-menu\"\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <DSDropdownMenu\n {...customDropdownMenuProps}\n onClose={handleCloseMenu}\n options={options}\n selection={selection}\n triggerComponent={\n <DSButtonV2 buttonType=\"icon\" innerRef={ref} aria-label=\"More options\" aria-haspopup=\"menu\">\n <MoreOptionsVert />\n </DSButtonV2>\n }\n zIndex={11} // https://jira.elliemae.io/browse/PUI-1664\n />\n </CommentCardMenu>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD2CX;AAzCZ,mBAAoC;AACpC,0BAA2B;AAC3B,oCAA+B;AAC/B,sBAAgC;AAChC,oBAAgC;AAUzB,MAAM,iBAA2D,CAAC;AAAA,EACvE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,UAAM,qBAAiC,IAAI;AAEjD,QAAM,sBAAkB,0BAAY,MAAM;AACxC,QAAI,SAAS,MAAM;AACnB,WAAO;AAAA,EACT,GAAG,CAAC,CAAC;AAEL,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAU;AAAA,MACV;AAAA,MACA;AAAA,MAEA;AAAA,QAAC;AAAA;AAAA,UACE,GAAG;AAAA,UACJ,SAAS;AAAA,UACT;AAAA,UACA;AAAA,UACA,kBACE,4CAAC,kCAAW,YAAW,QAAO,UAAU,KAAK,cAAW,gBAAe,iBAAc,QACnF,sDAAC,mCAAgB,GACnB;AAAA,UAEF,QAAQ;AAAA;AAAA,MACV;AAAA;AAAA,EACF;AAEJ;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/config/DSCommentCardDefinitions.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { slotObjectToDataTestIds } from '@elliemae/ds-system';\n\nexport const DSCommentCardName = 'DSCommentcard';\n\nexport const DSCommentCardSlots = {\n ROOT: 'root',\n HEADER: 'header',\n CONTENT: 'content',\n LEFT: 'left',\n NAME: 'name',\n DATA: 'data',\n MENU_WRAPPER: 'menu-wrapper',\n} as const;\n\nexport const DSCommentCardDataTestIds = slotObjectToDataTestIds(DSCommentCardName, DSCommentCardSlots);\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAAwC;AAEjC,MAAM,oBAAoB;AAE1B,MAAM,qBAAqB;AAAA,EAChC,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AAAA,EACN,cAAc;AAChB;AAEO,MAAM,+BAA2B,0CAAwB,mBAAmB,kBAAkB;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import { useCallback, useRef } from "react";
|
|
4
|
-
import { DSButtonV2 } from "@elliemae/ds-button-v2";
|
|
5
|
-
import { DSDropdownMenu } from "@elliemae/ds-legacy-dropdownmenu";
|
|
6
|
-
import { MoreOptionsVert } from "@elliemae/ds-icons";
|
|
7
|
-
import { CommentCardMenu } from "./styled.js";
|
|
8
|
-
const DeprecatedMenu = ({
|
|
9
|
-
getOwnerProps,
|
|
10
|
-
getOwnerPropsArguments,
|
|
11
|
-
customDropdownMenuProps,
|
|
12
|
-
options,
|
|
13
|
-
selection
|
|
14
|
-
}) => {
|
|
15
|
-
const ref = useRef(null);
|
|
16
|
-
const handleCloseMenu = useCallback(() => {
|
|
17
|
-
ref.current?.focus();
|
|
18
|
-
return null;
|
|
19
|
-
}, []);
|
|
20
|
-
return /* @__PURE__ */ jsx(
|
|
21
|
-
CommentCardMenu,
|
|
22
|
-
{
|
|
23
|
-
className: "em-ds-comments__comment-card-menu",
|
|
24
|
-
getOwnerProps,
|
|
25
|
-
getOwnerPropsArguments,
|
|
26
|
-
children: /* @__PURE__ */ jsx(
|
|
27
|
-
DSDropdownMenu,
|
|
28
|
-
{
|
|
29
|
-
...customDropdownMenuProps,
|
|
30
|
-
onClose: handleCloseMenu,
|
|
31
|
-
options,
|
|
32
|
-
selection,
|
|
33
|
-
triggerComponent: /* @__PURE__ */ jsx(DSButtonV2, { buttonType: "icon", innerRef: ref, "aria-label": "More options", "aria-haspopup": "menu", children: /* @__PURE__ */ jsx(MoreOptionsVert, {}) }),
|
|
34
|
-
zIndex: 11
|
|
35
|
-
}
|
|
36
|
-
)
|
|
37
|
-
}
|
|
38
|
-
);
|
|
39
|
-
};
|
|
40
|
-
export {
|
|
41
|
-
DeprecatedMenu
|
|
42
|
-
};
|
|
43
|
-
//# sourceMappingURL=DeprecatedMenu.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/DeprecatedMenu.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-nocheck\nimport { useCallback, useRef } from 'react';\nimport { DSButtonV2 } from '@elliemae/ds-button-v2';\nimport { DSDropdownMenu } from '@elliemae/ds-legacy-dropdownmenu';\nimport { MoreOptionsVert } from '@elliemae/ds-icons';\nimport { CommentCardMenu } from './styled.js';\n\ninterface DeprecatedMenuProps {\n getOwnerProps: () => object;\n getOwnerPropsArguments: () => object;\n options: unknown[];\n selection: unknown;\n customDropdownMenuProps: Record<string, unknown>;\n}\n\nexport const DeprecatedMenu: React.ComponentType<DeprecatedMenuProps> = ({\n getOwnerProps,\n getOwnerPropsArguments,\n customDropdownMenuProps,\n options,\n selection,\n}) => {\n const ref = useRef<HTMLButtonElement | null>(null);\n\n const handleCloseMenu = useCallback(() => {\n ref.current?.focus();\n return null;\n }, []);\n\n return (\n <CommentCardMenu\n className=\"em-ds-comments__comment-card-menu\"\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <DSDropdownMenu\n {...customDropdownMenuProps}\n onClose={handleCloseMenu}\n options={options}\n selection={selection}\n triggerComponent={\n <DSButtonV2 buttonType=\"icon\" innerRef={ref} aria-label=\"More options\" aria-haspopup=\"menu\">\n <MoreOptionsVert />\n </DSButtonV2>\n }\n zIndex={11} // https://jira.elliemae.io/browse/PUI-1664\n />\n </CommentCardMenu>\n );\n};\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;AC2CX;AAzCZ,SAAS,aAAa,cAAc;AACpC,SAAS,kBAAkB;AAC3B,SAAS,sBAAsB;AAC/B,SAAS,uBAAuB;AAChC,SAAS,uBAAuB;AAUzB,MAAM,iBAA2D,CAAC;AAAA,EACvE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,MAAM,OAAiC,IAAI;AAEjD,QAAM,kBAAkB,YAAY,MAAM;AACxC,QAAI,SAAS,MAAM;AACnB,WAAO;AAAA,EACT,GAAG,CAAC,CAAC;AAEL,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAU;AAAA,MACV;AAAA,MACA;AAAA,MAEA;AAAA,QAAC;AAAA;AAAA,UACE,GAAG;AAAA,UACJ,SAAS;AAAA,UACT;AAAA,UACA;AAAA,UACA,kBACE,oBAAC,cAAW,YAAW,QAAO,UAAU,KAAK,cAAW,gBAAe,iBAAc,QACnF,8BAAC,mBAAgB,GACnB;AAAA,UAEF,QAAQ;AAAA;AAAA,MACV;AAAA;AAAA,EACF;AAEJ;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/DSCommentCardDefinitions.ts"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { slotObjectToDataTestIds } from '@elliemae/ds-system';\n\nexport const DSCommentCardName = 'DSCommentcard';\n\nexport const DSCommentCardSlots = {\n ROOT: 'root',\n HEADER: 'header',\n CONTENT: 'content',\n LEFT: 'left',\n NAME: 'name',\n DATA: 'data',\n MENU_WRAPPER: 'menu-wrapper',\n} as const;\n\nexport const DSCommentCardDataTestIds = slotObjectToDataTestIds(DSCommentCardName, DSCommentCardSlots);\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,+BAA+B;AAEjC,MAAM,oBAAoB;AAE1B,MAAM,qBAAqB;AAAA,EAChC,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AAAA,EACN,cAAc;AAChB;AAEO,MAAM,2BAA2B,wBAAwB,mBAAmB,kBAAkB;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
interface DeprecatedMenuProps {
|
|
2
|
-
getOwnerProps: () => object;
|
|
3
|
-
getOwnerPropsArguments: () => object;
|
|
4
|
-
options: unknown[];
|
|
5
|
-
selection: unknown;
|
|
6
|
-
customDropdownMenuProps: Record<string, unknown>;
|
|
7
|
-
}
|
|
8
|
-
export declare const DeprecatedMenu: React.ComponentType<DeprecatedMenuProps>;
|
|
9
|
-
export {};
|