@elliemae/ds-comments 3.8.2-rc.4 → 3.9.0-next.2

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.
@@ -109,7 +109,7 @@ const CommentCard = ({
109
109
  icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_icons.MoreOptionsVert, {}),
110
110
  innerRef: ref
111
111
  }),
112
- zIndex: "11"
112
+ zIndex: 11
113
113
  })
114
114
  })
115
115
  ]
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/CommentCard.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["/* eslint-disable complexity */\n/* eslint-disable max-lines */\nimport React, { useCallback, useRef } from 'react';\nimport { PropTypes, describe } from '@elliemae/ds-utilities';\nimport DSButton from '@elliemae/ds-button';\nimport { DSReadMore } from '@elliemae/ds-read-more';\nimport DSDropdownMenu from '@elliemae/ds-dropdownmenu';\nimport { MoreOptionsVert } from '@elliemae/ds-icons';\nimport {\n CommentCardWrapper,\n CommentCardHeader,\n CommentCardContent,\n CommentCardName,\n CommentCardData,\n CommentCardMenu,\n CommentCardLeft,\n} from './blocks';\nimport { getTime, getDisplayDate } from './helper';\n\nconst CommentCard = ({\n containerProps = {},\n name = '',\n date = new Date(),\n type = '',\n content = '',\n style = {},\n options = [],\n selection = { 'single-selection-internal-external': ['set-as-internal'] },\n customDropdownMenuProps = {\n focusOnOpen: true,\n },\n borderBottom,\n dateFormat = 'MM/DD/YYYY',\n timeFormat = 'hh:mm a',\n maxLines = 2,\n}) => {\n const ref = useRef();\n const displayDate = date ? getDisplayDate(date, dateFormat) : null;\n const displayTime = date ? getTime(date, timeFormat) : null;\n\n const handleCloseMenu = useCallback(() => {\n ref.current.focus();\n }, []);\n\n return (\n <CommentCardWrapper\n classProps={{ borderBottom }}\n tabIndex={0}\n {...containerProps}\n style={{ ...style, ...(containerProps.style || {}) }}\n >\n <CommentCardHeader classProps={{ borderBottom }}>\n <CommentCardLeft>\n <CommentCardName>{name}</CommentCardName>\n <CommentCardData>\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 {options && options.length > 0 && (\n <CommentCardMenu>\n <DSDropdownMenu\n {...customDropdownMenuProps}\n onClose={handleCloseMenu}\n options={options}\n selection={selection}\n triggerComponent={<DSButton buttonType=\"text\" icon={<MoreOptionsVert />} innerRef={ref} />}\n zIndex=\"11\" // https://jira.elliemae.io/browse/PUI-1664\n />\n </CommentCardMenu>\n )}\n </CommentCardHeader>\n <CommentCardContent>\n <div>\n <DSReadMore\n lines={maxLines}\n content={`${content} `}\n more=\"MORE\"\n less=\"LESS\"\n buttonType=\"text\"\n size=\"m\"\n ellipsis=\"... \"\n />\n </div>\n </CommentCardContent>\n </CommentCardWrapper>\n );\n};\n\nconst props = {\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 /** dropdown menu options */\n options: PropTypes.arrayOf(PropTypes.object).description('dropdown menu options'),\n /** dropdown selection */\n selection: PropTypes.object.description('dropdown selection'),\n /** pass down props to dropdown */\n customDropdownMenuProps: PropTypes.shape({\n focusOnOpen: PropTypes.bool,\n }).description('pass down props to dropdown'),\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};\n\nCommentCard.propTypes = props;\nCommentCard.displayName = 'CommentCard';\nconst DSCommentCardWithSchema = describe(CommentCard);\nDSCommentCardWithSchema.propTypes = props;\n\nexport default CommentCard;\nexport { DSCommentCardWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB;AAEA,mBAA2C;AAC3C,0BAAoC;AACpC,uBAAqB;AACrB,0BAA2B;AAC3B,6BAA2B;AAC3B,sBAAgC;AAChC,oBAQO;AACP,oBAAwC;AAExC,MAAM,cAAc,CAAC;AAAA,EACnB,iBAAiB,CAAC;AAAA,EAClB,OAAO;AAAA,EACP,OAAO,IAAI,KAAK;AAAA,EAChB,OAAO;AAAA,EACP,UAAU;AAAA,EACV,QAAQ,CAAC;AAAA,EACT,UAAU,CAAC;AAAA,EACX,YAAY,EAAE,sCAAsC,CAAC,iBAAiB,EAAE;AAAA,EACxE,0BAA0B;AAAA,IACxB,aAAa;AAAA,EACf;AAAA,EACA;AAAA,EACA,aAAa;AAAA,EACb,aAAa;AAAA,EACb,WAAW;AACb,MAAM;AACJ,QAAM,UAAM,qBAAO;AACnB,QAAM,cAAc,WAAO,8BAAe,MAAM,UAAU,IAAI;AAC9D,QAAM,cAAc,WAAO,uBAAQ,MAAM,UAAU,IAAI;AAEvD,QAAM,sBAAkB,0BAAY,MAAM;AACxC,QAAI,QAAQ,MAAM;AAAA,EACpB,GAAG,CAAC,CAAC;AAEL,SACE,6CAAC;AAA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AAAA,EAExD,MAAM,8BAAU,OAAO,YAAY,WAAW;AAAA,EAE9C,OAAO,8BAAU,OAAO,YAAY,gBAAgB;AAAA,EAEpD,MAAM,8BAAU,WAAW,IAAI,EAAE,YAAY,aAAa;AAAA,EAE1D,MAAM,8BAAU,OAAO,YAAY,qBAAqB;AAAA,EAExD,SAAS,8BAAU,OAAO,YAAY,iBAAiB;AAAA,EAEvD,SAAS,8BAAU,QAAQ,8BAAU,MAAM,EAAE,YAAY,uBAAuB;AAAA,EAEhF,WAAW,8BAAU,OAAO,YAAY,oBAAoB;AAAA,EAE5D,yBAAyB,8BAAU,MAAM;AAAA,IACvC,aAAa,8BAAU;AAAA,EACzB,CAAC,EAAE,YAAY,6BAA6B;AAAA,EAE5C,cAAc,8BAAU,KAAK,YAAY,+BAA+B;AAAA,EAExE,YAAY,8BAAU,MAAM,CAAC,cAAc,YAAY,CAAC,EAAE;AAAA,IACxD;AAAA,EACF;AAAA,EAEA,YAAY,8BAAU,MAAM,CAAC,WAAW,OAAO,CAAC,EAAE;AAAA,IAChD;AAAA,EACF;AAAA,EAIA,UAAU,8BAAU,OAAO,YAAY,WAAW;AACpD;AAEA,YAAY,YAAY;AACxB,YAAY,cAAc;AAC1B,MAAM,8BAA0B,8BAAS,WAAW;AACpD,wBAAwB,YAAY;AAEpC,IAAO,sBAAQ;",
4
+ "sourcesContent": ["/* eslint-disable complexity */\n/* eslint-disable max-lines */\nimport React, { useCallback, useRef } from 'react';\nimport { PropTypes, describe } from '@elliemae/ds-utilities';\nimport DSButton from '@elliemae/ds-button';\nimport { DSReadMore } from '@elliemae/ds-read-more';\nimport DSDropdownMenu from '@elliemae/ds-dropdownmenu';\nimport { MoreOptionsVert } from '@elliemae/ds-icons';\nimport {\n CommentCardWrapper,\n CommentCardHeader,\n CommentCardContent,\n CommentCardName,\n CommentCardData,\n CommentCardMenu,\n CommentCardLeft,\n} from './blocks';\nimport { getTime, getDisplayDate } from './helper';\n\nconst CommentCard = ({\n containerProps = {},\n name = '',\n date = new Date(),\n type = '',\n content = '',\n style = {},\n options = [],\n selection = { 'single-selection-internal-external': ['set-as-internal'] },\n customDropdownMenuProps = {\n focusOnOpen: true,\n },\n borderBottom,\n dateFormat = 'MM/DD/YYYY',\n timeFormat = 'hh:mm a',\n maxLines = 2,\n}) => {\n const ref = useRef();\n const displayDate = date ? getDisplayDate(date, dateFormat) : null;\n const displayTime = date ? getTime(date, timeFormat) : null;\n\n const handleCloseMenu = useCallback(() => {\n ref.current.focus();\n }, []);\n\n return (\n <CommentCardWrapper\n classProps={{ borderBottom }}\n tabIndex={0}\n {...containerProps}\n style={{ ...style, ...(containerProps.style || {}) }}\n >\n <CommentCardHeader classProps={{ borderBottom }}>\n <CommentCardLeft>\n <CommentCardName>{name}</CommentCardName>\n <CommentCardData>\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 {options && options.length > 0 && (\n <CommentCardMenu>\n <DSDropdownMenu\n {...customDropdownMenuProps}\n onClose={handleCloseMenu}\n options={options}\n selection={selection}\n triggerComponent={<DSButton buttonType=\"text\" icon={<MoreOptionsVert />} innerRef={ref} />}\n zIndex={11} // https://jira.elliemae.io/browse/PUI-1664\n />\n </CommentCardMenu>\n )}\n </CommentCardHeader>\n <CommentCardContent>\n <div>\n <DSReadMore\n lines={maxLines}\n content={`${content} `}\n more=\"MORE\"\n less=\"LESS\"\n buttonType=\"text\"\n size=\"m\"\n ellipsis=\"... \"\n />\n </div>\n </CommentCardContent>\n </CommentCardWrapper>\n );\n};\n\nconst props = {\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 /** dropdown menu options */\n options: PropTypes.arrayOf(PropTypes.object).description('dropdown menu options'),\n /** dropdown selection */\n selection: PropTypes.object.description('dropdown selection'),\n /** pass down props to dropdown */\n customDropdownMenuProps: PropTypes.shape({\n focusOnOpen: PropTypes.bool,\n }).description('pass down props to dropdown'),\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};\n\nCommentCard.propTypes = props;\nCommentCard.displayName = 'CommentCard';\nconst DSCommentCardWithSchema = describe(CommentCard);\nDSCommentCardWithSchema.propTypes = props;\n\nexport default CommentCard;\nexport { DSCommentCardWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB;AAEA,mBAA2C;AAC3C,0BAAoC;AACpC,uBAAqB;AACrB,0BAA2B;AAC3B,6BAA2B;AAC3B,sBAAgC;AAChC,oBAQO;AACP,oBAAwC;AAExC,MAAM,cAAc,CAAC;AAAA,EACnB,iBAAiB,CAAC;AAAA,EAClB,OAAO;AAAA,EACP,OAAO,IAAI,KAAK;AAAA,EAChB,OAAO;AAAA,EACP,UAAU;AAAA,EACV,QAAQ,CAAC;AAAA,EACT,UAAU,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C,IAAO,sBAAQ;",
6
6
  "names": ["DSDropdownMenu", "DSButton"]
7
7
  }
@@ -87,7 +87,7 @@ const CommentCard = ({
87
87
  icon: /* @__PURE__ */ jsx(MoreOptionsVert, {}),
88
88
  innerRef: ref
89
89
  }),
90
- zIndex: "11"
90
+ zIndex: 11
91
91
  })
92
92
  })
93
93
  ]
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/components/CommentCard.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable complexity */\n/* eslint-disable max-lines */\nimport React, { useCallback, useRef } from 'react';\nimport { PropTypes, describe } from '@elliemae/ds-utilities';\nimport DSButton from '@elliemae/ds-button';\nimport { DSReadMore } from '@elliemae/ds-read-more';\nimport DSDropdownMenu from '@elliemae/ds-dropdownmenu';\nimport { MoreOptionsVert } from '@elliemae/ds-icons';\nimport {\n CommentCardWrapper,\n CommentCardHeader,\n CommentCardContent,\n CommentCardName,\n CommentCardData,\n CommentCardMenu,\n CommentCardLeft,\n} from './blocks';\nimport { getTime, getDisplayDate } from './helper';\n\nconst CommentCard = ({\n containerProps = {},\n name = '',\n date = new Date(),\n type = '',\n content = '',\n style = {},\n options = [],\n selection = { 'single-selection-internal-external': ['set-as-internal'] },\n customDropdownMenuProps = {\n focusOnOpen: true,\n },\n borderBottom,\n dateFormat = 'MM/DD/YYYY',\n timeFormat = 'hh:mm a',\n maxLines = 2,\n}) => {\n const ref = useRef();\n const displayDate = date ? getDisplayDate(date, dateFormat) : null;\n const displayTime = date ? getTime(date, timeFormat) : null;\n\n const handleCloseMenu = useCallback(() => {\n ref.current.focus();\n }, []);\n\n return (\n <CommentCardWrapper\n classProps={{ borderBottom }}\n tabIndex={0}\n {...containerProps}\n style={{ ...style, ...(containerProps.style || {}) }}\n >\n <CommentCardHeader classProps={{ borderBottom }}>\n <CommentCardLeft>\n <CommentCardName>{name}</CommentCardName>\n <CommentCardData>\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 {options && options.length > 0 && (\n <CommentCardMenu>\n <DSDropdownMenu\n {...customDropdownMenuProps}\n onClose={handleCloseMenu}\n options={options}\n selection={selection}\n triggerComponent={<DSButton buttonType=\"text\" icon={<MoreOptionsVert />} innerRef={ref} />}\n zIndex=\"11\" // https://jira.elliemae.io/browse/PUI-1664\n />\n </CommentCardMenu>\n )}\n </CommentCardHeader>\n <CommentCardContent>\n <div>\n <DSReadMore\n lines={maxLines}\n content={`${content} `}\n more=\"MORE\"\n less=\"LESS\"\n buttonType=\"text\"\n size=\"m\"\n ellipsis=\"... \"\n />\n </div>\n </CommentCardContent>\n </CommentCardWrapper>\n );\n};\n\nconst props = {\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 /** dropdown menu options */\n options: PropTypes.arrayOf(PropTypes.object).description('dropdown menu options'),\n /** dropdown selection */\n selection: PropTypes.object.description('dropdown selection'),\n /** pass down props to dropdown */\n customDropdownMenuProps: PropTypes.shape({\n focusOnOpen: PropTypes.bool,\n }).description('pass down props to dropdown'),\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};\n\nCommentCard.propTypes = props;\nCommentCard.displayName = 'CommentCard';\nconst DSCommentCardWithSchema = describe(CommentCard);\nDSCommentCardWithSchema.propTypes = props;\n\nexport default CommentCard;\nexport { DSCommentCardWithSchema };\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACAvB;AAEA,SAAgB,aAAa,cAAc;AAC3C,SAAS,WAAW,gBAAgB;AACpC,OAAO,cAAc;AACrB,SAAS,kBAAkB;AAC3B,OAAO,oBAAoB;AAC3B,SAAS,uBAAuB;AAChC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,SAAS,sBAAsB;AAExC,MAAM,cAAc,CAAC;AAAA,EACnB,iBAAiB,CAAC;AAAA,EAClB,OAAO;AAAA,EACP,OAAO,IAAI,KAAK;AAAA,EAChB,OAAO;AAAA,EACP,UAAU;AAAA,EACV,QAAQ,CAAC;AAAA,EACT,UAAU,CAAC;AAAA,EACX,YAAY,EAAE,sCAAsC,CAAC,iBAAiB,EAAE;AAAA,EACxE,0BAA0B;AAAA,IACxB,aAAa;AAAA,EACf;AAAA,EACA;AAAA,EACA,aAAa;AAAA,EACb,aAAa;AAAA,EACb,WAAW;AACb,MAAM;AACJ,QAAM,MAAM,OAAO;AACnB,QAAM,cAAc,OAAO,eAAe,MAAM,UAAU,IAAI;AAC9D,QAAM,cAAc,OAAO,QAAQ,MAAM,UAAU,IAAI;AAEvD,QAAM,kBAAkB,YAAY,MAAM;AACxC,QAAI,QAAQ,MAAM;AAAA,EACpB,GAAG,CAAC,CAAC;AAEL,SACE,qBAAC;AAAA,IACC,YAAY,EAAE,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9C,OAAO,UAAU,OAAO,YAAY,gBAAgB;AAAA,EAEpD,MAAM,UAAU,WAAW,IAAI,EAAE,YAAY,aAAa;AAAA,EAE1D,MAAM,UAAU,OAAO,YAAY,qBAAqB;AAAA,EAExD,SAAS,UAAU,OAAO,YAAY,iBAAiB;AAAA,EAEvD,SAAS,UAAU,QAAQ,UAAU,MAAM,EAAE,YAAY,uBAAuB;AAAA,EAEhF,WAAW,UAAU,OAAO,YAAY,oBAAoB;AAAA,EAE5D,yBAAyB,UAAU,MAAM;AAAA,IACvC,aAAa,UAAU;AAAA,EACzB,CAAC,EAAE,YAAY,6BAA6B;AAAA,EAE5C,cAAc,UAAU,KAAK,YAAY,+BAA+B;AAAA,EAExE,YAAY,UAAU,MAAM,CAAC,cAAc,YAAY,CAAC,EAAE;AAAA,IACxD;AAAA,EACF;AAAA,EAEA,YAAY,UAAU,MAAM,CAAC,WAAW,OAAO,CAAC,EAAE;AAAA,IAChD;AAAA,EACF;AAAA,EAIA,UAAU,UAAU,OAAO,YAAY,WAAW;AACpD;AAEA,YAAY,YAAY;AACxB,YAAY,cAAc;AAC1B,MAAM,0BAA0B,SAAS,WAAW;AACpD,wBAAwB,YAAY;AAEpC,IAAO,sBAAQ;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable complexity */\n/* eslint-disable max-lines */\nimport React, { useCallback, useRef } from 'react';\nimport { PropTypes, describe } from '@elliemae/ds-utilities';\nimport DSButton from '@elliemae/ds-button';\nimport { DSReadMore } from '@elliemae/ds-read-more';\nimport DSDropdownMenu from '@elliemae/ds-dropdownmenu';\nimport { MoreOptionsVert } from '@elliemae/ds-icons';\nimport {\n CommentCardWrapper,\n CommentCardHeader,\n CommentCardContent,\n CommentCardName,\n CommentCardData,\n CommentCardMenu,\n CommentCardLeft,\n} from './blocks';\nimport { getTime, getDisplayDate } from './helper';\n\nconst CommentCard = ({\n containerProps = {},\n name = '',\n date = new Date(),\n type = '',\n content = '',\n style = {},\n options = [],\n selection = { 'single-selection-internal-external': ['set-as-internal'] },\n customDropdownMenuProps = {\n focusOnOpen: true,\n },\n borderBottom,\n dateFormat = 'MM/DD/YYYY',\n timeFormat = 'hh:mm a',\n maxLines = 2,\n}) => {\n const ref = useRef();\n const displayDate = date ? getDisplayDate(date, dateFormat) : null;\n const displayTime = date ? getTime(date, timeFormat) : null;\n\n const handleCloseMenu = useCallback(() => {\n ref.current.focus();\n }, []);\n\n return (\n <CommentCardWrapper\n classProps={{ borderBottom }}\n tabIndex={0}\n {...containerProps}\n style={{ ...style, ...(containerProps.style || {}) }}\n >\n <CommentCardHeader classProps={{ borderBottom }}>\n <CommentCardLeft>\n <CommentCardName>{name}</CommentCardName>\n <CommentCardData>\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 {options && options.length > 0 && (\n <CommentCardMenu>\n <DSDropdownMenu\n {...customDropdownMenuProps}\n onClose={handleCloseMenu}\n options={options}\n selection={selection}\n triggerComponent={<DSButton buttonType=\"text\" icon={<MoreOptionsVert />} innerRef={ref} />}\n zIndex={11} // https://jira.elliemae.io/browse/PUI-1664\n />\n </CommentCardMenu>\n )}\n </CommentCardHeader>\n <CommentCardContent>\n <div>\n <DSReadMore\n lines={maxLines}\n content={`${content} `}\n more=\"MORE\"\n less=\"LESS\"\n buttonType=\"text\"\n size=\"m\"\n ellipsis=\"... \"\n />\n </div>\n </CommentCardContent>\n </CommentCardWrapper>\n );\n};\n\nconst props = {\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 /** dropdown menu options */\n options: PropTypes.arrayOf(PropTypes.object).description('dropdown menu options'),\n /** dropdown selection */\n selection: PropTypes.object.description('dropdown selection'),\n /** pass down props to dropdown */\n customDropdownMenuProps: PropTypes.shape({\n focusOnOpen: PropTypes.bool,\n }).description('pass down props to dropdown'),\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};\n\nCommentCard.propTypes = props;\nCommentCard.displayName = 'CommentCard';\nconst DSCommentCardWithSchema = describe(CommentCard);\nDSCommentCardWithSchema.propTypes = props;\n\nexport default CommentCard;\nexport { DSCommentCardWithSchema };\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB;AAEA,SAAgB,aAAa,cAAc;AAC3C,SAAS,WAAW,gBAAgB;AACpC,OAAO,cAAc;AACrB,SAAS,kBAAkB;AAC3B,OAAO,oBAAoB;AAC3B,SAAS,uBAAuB;AAChC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,SAAS,sBAAsB;AAExC,MAAM,cAAc,CAAC;AAAA,EACnB,iBAAiB,CAAC;AAAA,EAClB,OAAO;AAAA,EACP,OAAO,IAAI,KAAK;AAAA,EAChB,OAAO;AAAA,EACP,UAAU;AAAA,EACV,QAAQ,CAAC;AAAA,EACT,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GED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-comments",
3
- "version": "3.8.2-rc.4",
3
+ "version": "3.9.0-next.2",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Comments",
6
6
  "files": [
@@ -51,12 +51,12 @@
51
51
  "indent": 4
52
52
  },
53
53
  "dependencies": {
54
- "@elliemae/ds-button": "3.8.2-rc.4",
55
- "@elliemae/ds-classnames": "3.8.2-rc.4",
56
- "@elliemae/ds-dropdownmenu": "3.8.2-rc.4",
57
- "@elliemae/ds-icons": "3.8.2-rc.4",
58
- "@elliemae/ds-read-more": "3.8.2-rc.4",
59
- "@elliemae/ds-utilities": "3.8.2-rc.4",
54
+ "@elliemae/ds-button": "3.9.0-next.2",
55
+ "@elliemae/ds-classnames": "3.9.0-next.2",
56
+ "@elliemae/ds-dropdownmenu": "3.9.0-next.2",
57
+ "@elliemae/ds-icons": "3.9.0-next.2",
58
+ "@elliemae/ds-read-more": "3.9.0-next.2",
59
+ "@elliemae/ds-utilities": "3.9.0-next.2",
60
60
  "moment": "~2.29.3"
61
61
  },
62
62
  "devDependencies": {