@elliemae/ds-comments 3.18.0-next.7 → 3.18.0-next.9

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.
Files changed (58) hide show
  1. package/dist/cjs/DSCommentCard.js +155 -0
  2. package/dist/cjs/DSCommentCard.js.map +7 -0
  3. package/dist/cjs/DeprecatedMenu.js +73 -0
  4. package/dist/cjs/DeprecatedMenu.js.map +7 -0
  5. package/dist/cjs/{components/DSComments.js → config/DSCommentCardDefinitions.js} +18 -9
  6. package/dist/cjs/config/DSCommentCardDefinitions.js.map +7 -0
  7. package/dist/cjs/config/useCommentCard.js +57 -0
  8. package/dist/cjs/config/useCommentCard.js.map +7 -0
  9. package/dist/cjs/{components/helper.js → helpers.js} +4 -4
  10. package/dist/cjs/helpers.js.map +7 -0
  11. package/dist/cjs/index.js +9 -5
  12. package/dist/cjs/index.js.map +3 -3
  13. package/dist/cjs/react-desc-prop-types.js +99 -0
  14. package/dist/cjs/react-desc-prop-types.js.map +7 -0
  15. package/dist/cjs/styled.js +122 -0
  16. package/dist/cjs/styled.js.map +7 -0
  17. package/dist/esm/DSCommentCard.js +133 -0
  18. package/dist/esm/DSCommentCard.js.map +7 -0
  19. package/dist/esm/DeprecatedMenu.js +43 -0
  20. package/dist/esm/DeprecatedMenu.js.map +7 -0
  21. package/dist/esm/config/DSCommentCardDefinitions.js +19 -0
  22. package/dist/esm/config/DSCommentCardDefinitions.js.map +7 -0
  23. package/dist/esm/config/useCommentCard.js +27 -0
  24. package/dist/esm/config/useCommentCard.js.map +7 -0
  25. package/dist/esm/{components/helper.js → helpers.js} +1 -1
  26. package/dist/esm/helpers.js.map +7 -0
  27. package/dist/esm/index.js +7 -3
  28. package/dist/esm/index.js.map +3 -3
  29. package/dist/esm/react-desc-prop-types.js +69 -0
  30. package/dist/esm/react-desc-prop-types.js.map +7 -0
  31. package/dist/esm/styled.js +92 -0
  32. package/dist/esm/styled.js.map +7 -0
  33. package/dist/types/DSCommentCard.d.ts +4 -0
  34. package/dist/types/DeprecatedMenu.d.ts +10 -0
  35. package/dist/types/config/DSCommentCardDefinitions.d.ts +11 -0
  36. package/dist/types/config/useCommentCard.d.ts +9 -0
  37. package/dist/types/helpers.d.ts +3 -0
  38. package/dist/types/index.d.ts +3 -39
  39. package/dist/types/react-desc-prop-types.d.ts +33 -0
  40. package/dist/types/styled.d.ts +11 -0
  41. package/package.json +9 -7
  42. package/dist/cjs/components/CommentCard.js +0 -163
  43. package/dist/cjs/components/CommentCard.js.map +0 -7
  44. package/dist/cjs/components/DSComments.js.map +0 -7
  45. package/dist/cjs/components/blocks.js +0 -80
  46. package/dist/cjs/components/blocks.js.map +0 -7
  47. package/dist/cjs/components/helper.js.map +0 -7
  48. package/dist/esm/components/CommentCard.js +0 -141
  49. package/dist/esm/components/CommentCard.js.map +0 -7
  50. package/dist/esm/components/DSComments.js +0 -10
  51. package/dist/esm/components/DSComments.js.map +0 -7
  52. package/dist/esm/components/blocks.js +0 -50
  53. package/dist/esm/components/blocks.js.map +0 -7
  54. package/dist/esm/components/helper.js.map +0 -7
  55. package/dist/types/components/CommentCard.d.ts +0 -73
  56. package/dist/types/components/DSComments.d.ts +0 -42
  57. package/dist/types/components/blocks.d.ts +0 -18
  58. package/dist/types/components/helper.d.ts +0 -3
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 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, DSCommentCardSlots } from './config/DSCommentCardDefinitions.js';\n\nexport const CommentCardWrapper = styled('div', { name: DSCommentCardName, slot: DSCommentCardSlots.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 &:focus {\n outline: none;\n position: relative;\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 ${({ 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: DSCommentCardSlots.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: DSCommentCardSlots.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: DSCommentCardSlots.LEFT })`\n flex: 1;\n`;\n\nexport const CommentCardName = styled('div', { name: DSCommentCardName, slot: DSCommentCardSlots.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: DSCommentCardSlots.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: DSCommentCardSlots.MENU })``;\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,QAAQ,0BAA0B;AAC3C,SAAS,mBAAmB,0BAA0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mB,KAAK,CAAC;",
6
+ "names": []
7
+ }
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { type DSCommentCardT } from './react-desc-prop-types.js';
3
+ export declare const DSCommentCard: React.ComponentType<DSCommentCardT.Props>;
4
+ export declare const DSCommentCardWithSchema: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").DocumentedReactComponent<DSCommentCardT.Props>;
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ interface DeprecatedMenuProps {
3
+ getOwnerProps: () => object;
4
+ getOwnerPropsArguments: () => object;
5
+ options: unknown[];
6
+ selection: unknown;
7
+ customDropdownMenuProps: Record<string, unknown>;
8
+ }
9
+ export declare const DeprecatedMenu: React.ComponentType<DeprecatedMenuProps>;
10
+ export {};
@@ -0,0 +1,11 @@
1
+ export declare const DSCommentCardName = "DSCommentCard";
2
+ export declare const DSCommentCardSlots: {
3
+ ROOT: string;
4
+ HEADER: string;
5
+ CONTENT: string;
6
+ LEFT: string;
7
+ NAME: string;
8
+ DATA: string;
9
+ MENU: string;
10
+ };
11
+ export declare const DSCommentCardDataTestIds: Record<string, string>;
@@ -0,0 +1,9 @@
1
+ import { type DSCommentCardT } from '../react-desc-prop-types.js';
2
+ export declare const useCommentCard: (props: DSCommentCardT.Props) => {
3
+ propsWithDefault: DSCommentCardT.InternalProps;
4
+ xstyledProps: import("@elliemae/ds-props-helpers").XstyledProps;
5
+ getOwnerProps: () => DSCommentCardT.InternalProps;
6
+ getOwnerPropsArguments: () => {};
7
+ displayDate: string | null;
8
+ displayTime: string | null;
9
+ };
@@ -0,0 +1,3 @@
1
+ export declare function getMaxSize(): number;
2
+ export declare function getTime(date: Date, formatString?: string): string;
3
+ export declare function getDisplayDate(date: Date, formatString?: string): string;
@@ -1,40 +1,4 @@
1
- import { DSCommentCardWithSchema } from './components/DSComments.js';
2
- export declare const DSCommentCard: {
3
- ({ containerProps, name, date, type, content, style, options, selection, customDropdownMenuProps, borderBottom, dateFormat, timeFormat, maxLines, }: {
4
- containerProps?: {} | undefined;
5
- name?: string | undefined;
6
- date?: Date | undefined;
7
- type?: string | undefined;
8
- content?: string | undefined;
9
- style?: {} | undefined;
10
- options?: never[] | undefined;
11
- selection?: {
12
- 'single-selection-internal-external': string[];
13
- } | undefined;
14
- customDropdownMenuProps?: {
15
- focusOnOpen: boolean;
16
- } | undefined;
17
- borderBottom: any;
18
- dateFormat?: string | undefined;
19
- timeFormat?: string | undefined;
20
- maxLines?: number | undefined;
21
- }): import("react/jsx-runtime.js").JSX.Element;
22
- propTypes: {
23
- containerProps: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
24
- name: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
25
- style: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
26
- date: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
27
- type: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
28
- content: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
29
- options: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
30
- selection: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
31
- customDropdownMenuProps: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
32
- borderBottom: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
33
- dateFormat: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
34
- timeFormat: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
35
- maxLines: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
36
- };
37
- displayName: string;
38
- };
1
+ import { DSCommentCard } from './DSCommentCard.js';
2
+ export { DSCommentCard, DSCommentCardWithSchema } from './DSCommentCard.js';
3
+ export { DSCommentCardName, DSCommentCardSlots, DSCommentCardDataTestIds } from './config/DSCommentCardDefinitions.js';
39
4
  export default DSCommentCard;
40
- export { DSCommentCardWithSchema };
@@ -0,0 +1,33 @@
1
+ import type { WeakValidationMap } from 'react';
2
+ import type { GlobalAttributesT, XstyledProps, DSPropTypesSchema } from '@elliemae/ds-props-helpers';
3
+ export declare namespace DSCommentCardT {
4
+ 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>;
5
+ 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>;
6
+ export interface DefaultProps {
7
+ containerProps: React.HTMLAttributes<HTMLDivElement>;
8
+ name: string;
9
+ date: Date;
10
+ type: string;
11
+ content: string;
12
+ style: React.CSSProperties;
13
+ options: unknown[];
14
+ selection: unknown;
15
+ customDropdownMenuProps: Record<string, unknown>;
16
+ borderBottom: boolean;
17
+ dateFormat: string;
18
+ timeFormat: string;
19
+ maxLines: number;
20
+ }
21
+ export interface OptionalProps {
22
+ Menu?: React.ComponentType;
23
+ menuProps?: object;
24
+ }
25
+ export interface RequiredProps {
26
+ }
27
+ export type Props = PropsT<DefaultProps, RequiredProps, OptionalProps, HTMLDivElement>;
28
+ export type InternalProps = InternalPropsT<DefaultProps, RequiredProps, OptionalProps, HTMLDivElement>;
29
+ export {};
30
+ }
31
+ export declare const defaultProps: DSCommentCardT.DefaultProps;
32
+ export declare const DSCommentCardPropTypes: DSPropTypesSchema<DSCommentCardT.Props>;
33
+ export declare const DSCommentCardPropTypesSchema: WeakValidationMap<DSCommentCardT.Props>;
@@ -0,0 +1,11 @@
1
+ export declare const CommentCardWrapper: import("styled-components").StyledComponent<"div", import("@elliemae/ds-system").Theme, {
2
+ borderBot: boolean;
3
+ } & import("@elliemae/ds-system").OwnerInterface, never>;
4
+ export declare const CommentCardHeader: import("styled-components").StyledComponent<"div", import("@elliemae/ds-system").Theme, {
5
+ borderBottom: boolean;
6
+ } & import("@elliemae/ds-system").OwnerInterface, never>;
7
+ export declare const CommentCardContent: import("styled-components").StyledComponent<"div", import("@elliemae/ds-system").Theme, object & import("@elliemae/ds-system").OwnerInterface, never>;
8
+ export declare const CommentCardLeft: import("styled-components").StyledComponent<"div", import("@elliemae/ds-system").Theme, object & import("@elliemae/ds-system").OwnerInterface, never>;
9
+ export declare const CommentCardName: import("styled-components").StyledComponent<"div", import("@elliemae/ds-system").Theme, object & import("@elliemae/ds-system").OwnerInterface, never>;
10
+ export declare const CommentCardData: import("styled-components").StyledComponent<"div", import("@elliemae/ds-system").Theme, object & import("@elliemae/ds-system").OwnerInterface, never>;
11
+ export declare const CommentCardMenu: import("styled-components").StyledComponent<"div", import("@elliemae/ds-system").Theme, object & import("@elliemae/ds-system").OwnerInterface, never>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-comments",
3
- "version": "3.18.0-next.7",
3
+ "version": "3.18.0-next.9",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Comments",
6
6
  "files": [
@@ -52,17 +52,19 @@
52
52
  },
53
53
  "dependencies": {
54
54
  "moment": "~2.29.4",
55
- "@elliemae/ds-button": "3.18.0-next.7",
56
- "@elliemae/ds-classnames": "3.18.0-next.7",
57
- "@elliemae/ds-dropdownmenu": "3.18.0-next.7",
58
- "@elliemae/ds-icons": "3.18.0-next.7",
59
- "@elliemae/ds-props-helpers": "3.18.0-next.7",
60
- "@elliemae/ds-read-more": "3.18.0-next.7"
55
+ "@elliemae/ds-button-v2": "3.18.0-next.9",
56
+ "@elliemae/ds-icons": "3.18.0-next.9",
57
+ "@elliemae/ds-dropdownmenu": "3.18.0-next.9",
58
+ "@elliemae/ds-props-helpers": "3.18.0-next.9",
59
+ "@elliemae/ds-read-more": "3.18.0-next.9",
60
+ "@elliemae/ds-system": "3.18.0-next.9"
61
61
  },
62
62
  "devDependencies": {
63
63
  "styled-components": "~5.3.9"
64
64
  },
65
65
  "peerDependencies": {
66
+ "@xstyled/system": "~3.7.3",
67
+ "@xstyled/util": "~3.7.0",
66
68
  "lodash": "^4.17.21",
67
69
  "react": "~17.0.2",
68
70
  "react-dom": "^17.0.2",
@@ -1,163 +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 CommentCard_exports = {};
30
- __export(CommentCard_exports, {
31
- DSCommentCardWithSchema: () => DSCommentCardWithSchema,
32
- default: () => CommentCard_default
33
- });
34
- module.exports = __toCommonJS(CommentCard_exports);
35
- var React = __toESM(require("react"));
36
- var import_jsx_runtime = require("react/jsx-runtime");
37
- var import_react = require("react");
38
- var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
39
- var import_ds_button = __toESM(require("@elliemae/ds-button"));
40
- var import_ds_read_more = require("@elliemae/ds-read-more");
41
- var import_ds_dropdownmenu = __toESM(require("@elliemae/ds-dropdownmenu"));
42
- var import_ds_icons = require("@elliemae/ds-icons");
43
- var import_blocks = require("./blocks.js");
44
- var import_helper = require("./helper.js");
45
- const CommentCard = ({
46
- containerProps = {},
47
- name = "",
48
- date = /* @__PURE__ */ new Date(),
49
- type = "",
50
- content = "",
51
- style = {},
52
- options = [],
53
- selection = { "single-selection-internal-external": ["set-as-internal"] },
54
- customDropdownMenuProps = {
55
- focusOnOpen: true
56
- },
57
- borderBottom,
58
- dateFormat = "MM/DD/YYYY",
59
- timeFormat = "hh:mm a",
60
- maxLines = 2
61
- }) => {
62
- const ref = (0, import_react.useRef)();
63
- const displayDate = date ? (0, import_helper.getDisplayDate)(date, dateFormat) : null;
64
- const displayTime = date ? (0, import_helper.getTime)(date, timeFormat) : null;
65
- const handleCloseMenu = (0, import_react.useCallback)(() => {
66
- ref.current.focus();
67
- }, []);
68
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
69
- import_blocks.CommentCardWrapper,
70
- {
71
- classProps: { borderBottom },
72
- tabIndex: 0,
73
- ...containerProps,
74
- style: { ...style, ...containerProps.style || {} },
75
- children: [
76
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_blocks.CommentCardHeader, { classProps: { borderBottom }, children: [
77
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_blocks.CommentCardLeft, { children: [
78
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_blocks.CommentCardName, { children: name }),
79
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_blocks.CommentCardData, { children: [
80
- displayDate,
81
- displayTime && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
82
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: "\u2022" }),
83
- displayTime
84
- ] }),
85
- type && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
86
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: "\u2022" }),
87
- type
88
- ] })
89
- ] })
90
- ] }),
91
- options && options.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_blocks.CommentCardMenu, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
92
- import_ds_dropdownmenu.default,
93
- {
94
- ...customDropdownMenuProps,
95
- onClose: handleCloseMenu,
96
- options,
97
- selection,
98
- triggerComponent: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_button.default, { buttonType: "text", icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_icons.MoreOptionsVert, {}), innerRef: ref }),
99
- zIndex: 11
100
- }
101
- ) })
102
- ] }),
103
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_blocks.CommentCardContent, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
104
- import_ds_read_more.DSReadMore,
105
- {
106
- lines: maxLines,
107
- content: `${content} `,
108
- more: "MORE",
109
- less: "LESS",
110
- buttonType: "text",
111
- size: "m",
112
- ellipsis: "... "
113
- }
114
- ) }) })
115
- ]
116
- }
117
- );
118
- };
119
- const props = {
120
- /** props to inject to comment card wrapper */
121
- containerProps: import_ds_props_helpers.PropTypes.shape({
122
- id: import_ds_props_helpers.PropTypes.string,
123
- "data-testid": import_ds_props_helpers.PropTypes.string
124
- }).description("props to inject to comment card wrapper"),
125
- /** form name */
126
- name: import_ds_props_helpers.PropTypes.string.description("form name"),
127
- /** style object */
128
- style: import_ds_props_helpers.PropTypes.object.description(" style object "),
129
- /** date object */
130
- date: import_ds_props_helpers.PropTypes.instanceOf(Date).description("date object"),
131
- /** comment type string */
132
- type: import_ds_props_helpers.PropTypes.string.description("comment type string"),
133
- /** comment content */
134
- content: import_ds_props_helpers.PropTypes.string.description("comment content"),
135
- /** dropdown menu options */
136
- options: import_ds_props_helpers.PropTypes.arrayOf(import_ds_props_helpers.PropTypes.object).description("dropdown menu options"),
137
- /** dropdown selection */
138
- selection: import_ds_props_helpers.PropTypes.object.description("dropdown selection"),
139
- /** pass down props to dropdown */
140
- customDropdownMenuProps: import_ds_props_helpers.PropTypes.shape({
141
- focusOnOpen: import_ds_props_helpers.PropTypes.bool
142
- }).description("pass down props to dropdown"),
143
- /** toggle border bottom for card */
144
- borderBottom: import_ds_props_helpers.PropTypes.bool.description("toggle border bottom for card"),
145
- /** moment Year, month, and day tokens https://momentjs.com/docs/#/parsing/string-format/ */
146
- dateFormat: import_ds_props_helpers.PropTypes.oneOf(["MM/DD/YYYY", "MM DD YYYY"]).description(
147
- "moment Year, month, and day tokens https://momentjs.com/docs/#/parsing/string-format/"
148
- ),
149
- /** moment Hour, minute, second, millisecond, and offset tokens https://momentjs.com/docs/#/parsing/string-format/ */
150
- timeFormat: import_ds_props_helpers.PropTypes.oneOf(["hh:mm a", "HH:mm"]).description(
151
- "moment Hour, minute, second, millisecond, and offset tokens https://momentjs.com/docs/#/parsing/string-format/"
152
- ),
153
- /**
154
- * Max lines
155
- */
156
- maxLines: import_ds_props_helpers.PropTypes.number.description("Max lines")
157
- };
158
- CommentCard.propTypes = props;
159
- CommentCard.displayName = "CommentCard";
160
- const DSCommentCardWithSchema = (0, import_ds_props_helpers.describe)(CommentCard);
161
- DSCommentCardWithSchema.propTypes = props;
162
- var CommentCard_default = CommentCard;
163
- //# sourceMappingURL=CommentCard.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 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-props-helpers';\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.js';\nimport { getTime, getDisplayDate } from './helper.js';\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;ADqDb;AAnDV,mBAA2C;AAC3C,8BAAoC;AACpC,uBAAqB;AACrB,0BAA2B;AAC3B,6BAA2B;AAC3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;AAAA,IAChD;AAAA,EACF;AAAA;AAAA;AAAA;AAAA,EAIA,UAAU,kCAAU,OAAO,YAAY,WAAW;AACpD;AAEA,YAAY,YAAY;AACxB,YAAY,cAAc;AAC1B,MAAM,8BAA0B,kCAAS,WAAW;AACpD,wBAAwB,YAAY;AAEpC,IAAO,sBAAQ;",
6
- "names": ["DSDropdownMenu", "DSButton"]
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/components/DSComments.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import DSCommentCard, { DSCommentCardWithSchema } from './CommentCard.js';\n\nexport default {\n DSCommentCard,\n};\nexport { DSCommentCardWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,yBAAuD;AAEvD,IAAO,qBAAQ;AAAA,EACb,kCAAAA;AACF;",
6
- "names": ["DSCommentCard"]
7
- }
@@ -1,80 +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 blocks_exports = {};
30
- __export(blocks_exports, {
31
- CommentCardContent: () => CommentCardContent,
32
- CommentCardData: () => CommentCardData,
33
- CommentCardHeader: () => CommentCardHeader,
34
- CommentCardLeft: () => CommentCardLeft,
35
- CommentCardMenu: () => CommentCardMenu,
36
- CommentCardName: () => CommentCardName,
37
- CommentCardWrapper: () => CommentCardWrapper,
38
- CommentEmptyIcon: () => CommentEmptyIcon,
39
- CommentEmptyLabel: () => CommentEmptyLabel,
40
- CommentEmptyWrapper: () => CommentEmptyWrapper,
41
- Counter: () => Counter,
42
- SubmitButton: () => SubmitButton,
43
- SubmitExternal: () => SubmitExternal,
44
- SubmitWrapper: () => SubmitWrapper,
45
- WrapperArea: () => WrapperArea,
46
- WrapperComments: () => WrapperComments,
47
- WrapperCommentsScroll: () => WrapperCommentsScroll
48
- });
49
- module.exports = __toCommonJS(blocks_exports);
50
- var React = __toESM(require("react"));
51
- var import_ds_classnames = require("@elliemae/ds-classnames");
52
- const blockName = "comments";
53
- const WrapperArea = (0, import_ds_classnames.aggregatedClasses)("div")(blockName, "area", () => ({}));
54
- const WrapperComments = (0, import_ds_classnames.aggregatedClasses)("div")(blockName, "comments", ({ hasScroll }) => ({
55
- hasScroll,
56
- "not-scroll": !hasScroll
57
- }));
58
- const WrapperCommentsScroll = (0, import_ds_classnames.aggregatedClasses)("div")(blockName, "comments-scroll", ({ hasScroll }) => ({
59
- hasScroll,
60
- "not-scroll": !hasScroll
61
- }));
62
- const Counter = (0, import_ds_classnames.aggregatedClasses)("div")(blockName, "counter", () => ({}));
63
- const SubmitWrapper = (0, import_ds_classnames.aggregatedClasses)("div")(blockName, "submit-wrapper", () => ({}));
64
- const SubmitExternal = (0, import_ds_classnames.aggregatedClasses)("div")(blockName, "submit-external", () => ({}));
65
- const SubmitButton = (0, import_ds_classnames.aggregatedClasses)("div")(blockName, "submit-btn", () => ({}));
66
- const CommentCardWrapper = (0, import_ds_classnames.aggregatedClasses)("div")(blockName, "comment-card-wrapper", ({ borderBottom }) => ({
67
- borderBottom
68
- }));
69
- const CommentCardHeader = (0, import_ds_classnames.aggregatedClasses)("div")(blockName, "comment-card-header", ({ borderBottom }) => ({
70
- borderBottom
71
- }));
72
- const CommentCardContent = (0, import_ds_classnames.aggregatedClasses)("div")(blockName, "comment-card-content", () => ({}));
73
- const CommentCardLeft = (0, import_ds_classnames.aggregatedClasses)("div")(blockName, "comment-card-left", () => ({}));
74
- const CommentCardName = (0, import_ds_classnames.aggregatedClasses)("div")(blockName, "comment-card-name", () => ({}));
75
- const CommentCardData = (0, import_ds_classnames.aggregatedClasses)("div")(blockName, "comment-card-data", () => ({}));
76
- const CommentCardMenu = (0, import_ds_classnames.aggregatedClasses)("div")(blockName, "comment-card-menu", () => ({}));
77
- const CommentEmptyWrapper = (0, import_ds_classnames.aggregatedClasses)("div")(blockName, "comment-empty", () => ({}));
78
- const CommentEmptyIcon = (0, import_ds_classnames.aggregatedClasses)("div")(blockName, "comment-empty-icon", () => ({}));
79
- const CommentEmptyLabel = (0, import_ds_classnames.aggregatedClasses)("div")(blockName, "comment-empty-label", () => ({}));
80
- //# sourceMappingURL=blocks.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/components/blocks.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import { aggregatedClasses } from '@elliemae/ds-classnames';\n\nconst blockName = 'comments';\n\nexport const WrapperArea = aggregatedClasses('div')(blockName, 'area', () => ({}));\n\nexport const WrapperComments = aggregatedClasses('div')(blockName, 'comments', ({ hasScroll }) => ({\n hasScroll,\n 'not-scroll': !hasScroll,\n}));\n\nexport const WrapperCommentsScroll = aggregatedClasses('div')(blockName, 'comments-scroll', ({ hasScroll }) => ({\n hasScroll,\n 'not-scroll': !hasScroll,\n}));\n\nexport const Counter = aggregatedClasses('div')(blockName, 'counter', () => ({}));\n\nexport const SubmitWrapper = aggregatedClasses('div')(blockName, 'submit-wrapper', () => ({}));\n\nexport const SubmitExternal = aggregatedClasses('div')(blockName, 'submit-external', () => ({}));\n\nexport const SubmitButton = aggregatedClasses('div')(blockName, 'submit-btn', () => ({}));\n\nexport const CommentCardWrapper = aggregatedClasses('div')(blockName, 'comment-card-wrapper', ({ borderBottom }) => ({\n borderBottom,\n}));\n\nexport const CommentCardHeader = aggregatedClasses('div')(blockName, 'comment-card-header', ({ borderBottom }) => ({\n borderBottom,\n}));\n\nexport const CommentCardContent = aggregatedClasses('div')(blockName, 'comment-card-content', () => ({}));\n\nexport const CommentCardLeft = aggregatedClasses('div')(blockName, 'comment-card-left', () => ({}));\n\nexport const CommentCardName = aggregatedClasses('div')(blockName, 'comment-card-name', () => ({}));\n\nexport const CommentCardData = aggregatedClasses('div')(blockName, 'comment-card-data', () => ({}));\n\nexport const CommentCardMenu = aggregatedClasses('div')(blockName, 'comment-card-menu', () => ({}));\n\nexport const CommentEmptyWrapper = aggregatedClasses('div')(blockName, 'comment-empty', () => ({}));\n\nexport const CommentEmptyIcon = aggregatedClasses('div')(blockName, 'comment-empty-icon', () => ({}));\n\nexport const CommentEmptyLabel = aggregatedClasses('div')(blockName, 'comment-empty-label', () => ({}));\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,2BAAkC;AAElC,MAAM,YAAY;AAEX,MAAM,kBAAc,wCAAkB,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AE;AAE3F,MAAM,uBAAmB,wCAAkB,KAAK,EAAE,WAAW,sBAAsB,OAAO,CAAC,EAAE;AAE7F,MAAM,wBAAoB,wCAAkB,KAAK,EAAE,WAAW,uBAAuB,OAAO,CAAC,EAAE;",
6
- "names": []
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/components/helper.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import moment from 'moment';\n\nexport function getMaxSize() {\n return 113;\n}\nexport function getTime(date, formatString = 'hh:mm a') {\n return moment(date).format(formatString);\n}\nexport function getDisplayDate(date, formatString = 'MM/DD/YYYY') {\n return moment(date).format(formatString);\n}\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,oBAAmB;AAEZ,SAAS,aAAa;AAC3B,SAAO;AACT;AACO,SAAS,QAAQ,MAAM,eAAe,WAAW;AACtD,aAAO,cAAAA,SAAO,IAAI,EAAE,OAAO,YAAY;AACzC;AACO,SAAS,eAAe,MAAM,eAAe,cAAc;AAChE,aAAO,cAAAA,SAAO,IAAI,EAAE,OAAO,YAAY;AACzC;",
6
- "names": ["moment"]
7
- }
@@ -1,141 +0,0 @@
1
- import * as React from "react";
2
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
- import { useCallback, useRef } from "react";
4
- import { PropTypes, describe } from "@elliemae/ds-props-helpers";
5
- import DSButton from "@elliemae/ds-button";
6
- import { DSReadMore } from "@elliemae/ds-read-more";
7
- import DSDropdownMenu from "@elliemae/ds-dropdownmenu";
8
- import { MoreOptionsVert } from "@elliemae/ds-icons";
9
- import {
10
- CommentCardWrapper,
11
- CommentCardHeader,
12
- CommentCardContent,
13
- CommentCardName,
14
- CommentCardData,
15
- CommentCardMenu,
16
- CommentCardLeft
17
- } from "./blocks.js";
18
- import { getTime, getDisplayDate } from "./helper.js";
19
- const CommentCard = ({
20
- containerProps = {},
21
- name = "",
22
- date = /* @__PURE__ */ new Date(),
23
- type = "",
24
- content = "",
25
- style = {},
26
- options = [],
27
- selection = { "single-selection-internal-external": ["set-as-internal"] },
28
- customDropdownMenuProps = {
29
- focusOnOpen: true
30
- },
31
- borderBottom,
32
- dateFormat = "MM/DD/YYYY",
33
- timeFormat = "hh:mm a",
34
- maxLines = 2
35
- }) => {
36
- const ref = useRef();
37
- const displayDate = date ? getDisplayDate(date, dateFormat) : null;
38
- const displayTime = date ? getTime(date, timeFormat) : null;
39
- const handleCloseMenu = useCallback(() => {
40
- ref.current.focus();
41
- }, []);
42
- return /* @__PURE__ */ jsxs(
43
- CommentCardWrapper,
44
- {
45
- classProps: { borderBottom },
46
- tabIndex: 0,
47
- ...containerProps,
48
- style: { ...style, ...containerProps.style || {} },
49
- children: [
50
- /* @__PURE__ */ jsxs(CommentCardHeader, { classProps: { borderBottom }, children: [
51
- /* @__PURE__ */ jsxs(CommentCardLeft, { children: [
52
- /* @__PURE__ */ jsx(CommentCardName, { children: name }),
53
- /* @__PURE__ */ jsxs(CommentCardData, { children: [
54
- displayDate,
55
- displayTime && /* @__PURE__ */ jsxs(Fragment, { children: [
56
- /* @__PURE__ */ jsx("span", { children: "\u2022" }),
57
- displayTime
58
- ] }),
59
- type && /* @__PURE__ */ jsxs(Fragment, { children: [
60
- /* @__PURE__ */ jsx("span", { children: "\u2022" }),
61
- type
62
- ] })
63
- ] })
64
- ] }),
65
- options && options.length > 0 && /* @__PURE__ */ jsx(CommentCardMenu, { children: /* @__PURE__ */ jsx(
66
- DSDropdownMenu,
67
- {
68
- ...customDropdownMenuProps,
69
- onClose: handleCloseMenu,
70
- options,
71
- selection,
72
- triggerComponent: /* @__PURE__ */ jsx(DSButton, { buttonType: "text", icon: /* @__PURE__ */ jsx(MoreOptionsVert, {}), innerRef: ref }),
73
- zIndex: 11
74
- }
75
- ) })
76
- ] }),
77
- /* @__PURE__ */ jsx(CommentCardContent, { children: /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
78
- DSReadMore,
79
- {
80
- lines: maxLines,
81
- content: `${content} `,
82
- more: "MORE",
83
- less: "LESS",
84
- buttonType: "text",
85
- size: "m",
86
- ellipsis: "... "
87
- }
88
- ) }) })
89
- ]
90
- }
91
- );
92
- };
93
- const props = {
94
- /** props to inject to comment card wrapper */
95
- containerProps: PropTypes.shape({
96
- id: PropTypes.string,
97
- "data-testid": PropTypes.string
98
- }).description("props to inject to comment card wrapper"),
99
- /** form name */
100
- name: PropTypes.string.description("form name"),
101
- /** style object */
102
- style: PropTypes.object.description(" style object "),
103
- /** date object */
104
- date: PropTypes.instanceOf(Date).description("date object"),
105
- /** comment type string */
106
- type: PropTypes.string.description("comment type string"),
107
- /** comment content */
108
- content: PropTypes.string.description("comment content"),
109
- /** dropdown menu options */
110
- options: PropTypes.arrayOf(PropTypes.object).description("dropdown menu options"),
111
- /** dropdown selection */
112
- selection: PropTypes.object.description("dropdown selection"),
113
- /** pass down props to dropdown */
114
- customDropdownMenuProps: PropTypes.shape({
115
- focusOnOpen: PropTypes.bool
116
- }).description("pass down props to dropdown"),
117
- /** toggle border bottom for card */
118
- borderBottom: PropTypes.bool.description("toggle border bottom for card"),
119
- /** moment Year, month, and day tokens https://momentjs.com/docs/#/parsing/string-format/ */
120
- dateFormat: PropTypes.oneOf(["MM/DD/YYYY", "MM DD YYYY"]).description(
121
- "moment Year, month, and day tokens https://momentjs.com/docs/#/parsing/string-format/"
122
- ),
123
- /** moment Hour, minute, second, millisecond, and offset tokens https://momentjs.com/docs/#/parsing/string-format/ */
124
- timeFormat: PropTypes.oneOf(["hh:mm a", "HH:mm"]).description(
125
- "moment Hour, minute, second, millisecond, and offset tokens https://momentjs.com/docs/#/parsing/string-format/"
126
- ),
127
- /**
128
- * Max lines
129
- */
130
- maxLines: PropTypes.number.description("Max lines")
131
- };
132
- CommentCard.propTypes = props;
133
- CommentCard.displayName = "CommentCard";
134
- const DSCommentCardWithSchema = describe(CommentCard);
135
- DSCommentCardWithSchema.propTypes = props;
136
- var CommentCard_default = CommentCard;
137
- export {
138
- DSCommentCardWithSchema,
139
- CommentCard_default as default
140
- };
141
- //# sourceMappingURL=CommentCard.js.map