@paro.io/expert-shared-components 1.10.8 → 1.11.0

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 (67) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +2 -2
  3. package/lib/components/ClientReferencesSection/DeleteButton.js +11 -11
  4. package/lib/components/ClientReferencesSection/ParoError.js +10 -10
  5. package/lib/components/ClientReferencesSection/TagsSection.js +2 -2
  6. package/lib/components/ClientReferencesSection/styles/BrandedTypography.js +2 -2
  7. package/lib/components/ClientReferencesSection/styles/Buttons.js +15 -15
  8. package/lib/components/ClientReferencesSection/styles/Name.js +5 -5
  9. package/lib/components/ClientReferencesSection/styles/NullContentConditionalColor.js +4 -4
  10. package/lib/components/ClientReferencesSection/styles/SectionBody.js +11 -11
  11. package/lib/components/ClientReferencesSection/styles/SectionTitle.js +6 -6
  12. package/lib/components/ClientReferencesSection/styles/Tags.js +2 -2
  13. package/lib/components/DocumentCenter/DocumentTable.d.ts +15 -15
  14. package/lib/components/DocumentCenter/DocumentTable.js +350 -350
  15. package/lib/components/DocumentCenter/UploadFilesButton.d.ts +6 -6
  16. package/lib/components/DocumentCenter/UploadFilesButton.js +29 -29
  17. package/lib/components/EarningsTracker/ActiveProjectCard.d.ts +52 -52
  18. package/lib/components/EarningsTracker/ActiveProjectCard.js +161 -161
  19. package/lib/components/EarningsTracker/CenterCardUI.d.ts +13 -13
  20. package/lib/components/EarningsTracker/CenterCardUI.js +134 -134
  21. package/lib/components/EarningsTracker/EarningsTracker.d.ts +52 -52
  22. package/lib/components/EarningsTracker/EarningsTracker.js +508 -508
  23. package/lib/components/EarningsTracker/EditDateModal.d.ts +22 -22
  24. package/lib/components/EarningsTracker/EditDateModal.js +149 -149
  25. package/lib/components/EarningsTracker/EmailModal.d.ts +14 -14
  26. package/lib/components/EarningsTracker/EmailModal.js +79 -79
  27. package/lib/components/EarningsTracker/EndProjectModal.d.ts +56 -56
  28. package/lib/components/EarningsTracker/EndProjectModal.js +221 -221
  29. package/lib/components/EarningsTracker/LeftCardUI.d.ts +18 -18
  30. package/lib/components/EarningsTracker/LeftCardUI.js +189 -189
  31. package/lib/components/EarningsTracker/LogTimeModalAuthenticated.d.ts +52 -52
  32. package/lib/components/EarningsTracker/LogTimeModalAuthenticated.js +358 -358
  33. package/lib/components/EarningsTracker/ProgressBar.d.ts +4 -4
  34. package/lib/components/EarningsTracker/ProgressBar.js +66 -66
  35. package/lib/components/EarningsTracker/ReviewRequestModal.d.ts +17 -17
  36. package/lib/components/EarningsTracker/ReviewRequestModal.js +135 -135
  37. package/lib/components/EarningsTracker/RightCardUI.d.ts +46 -46
  38. package/lib/components/EarningsTracker/RightCardUI.js +231 -231
  39. package/lib/components/EarningsTracker/index.d.ts +1 -1
  40. package/lib/components/EarningsTracker/index.js +5 -5
  41. package/lib/components/ExpertProfileHeader/ActionButtonSection.js +6 -6
  42. package/lib/components/ExpertProfileHeader/ProfileSection.js +7 -7
  43. package/lib/components/Invoices/InvoiceCard.d.ts +3 -0
  44. package/lib/components/Invoices/InvoiceCard.js +220 -0
  45. package/lib/components/Invoices/index.d.ts +1 -0
  46. package/lib/components/Invoices/index.js +5 -0
  47. package/lib/components/OrganizationChart/OrganizationChart.d.ts +15 -15
  48. package/lib/components/OrganizationChart/OrganizationChart.js +312 -312
  49. package/lib/components/OrganizationChart/PersonCard.js +5 -5
  50. package/lib/components/OrganizationChart/utils.js +79 -79
  51. package/lib/components/ProjectCard/LeftCardUI.js +1 -1
  52. package/lib/components/ProjectCard/ProgressBar.js +4 -4
  53. package/lib/components/ProjectCard/ReviewRequestModal.js +5 -5
  54. package/lib/components/Reviews/Pagination.js +6 -6
  55. package/lib/components/ReviewsTab/RatingHeader.js +6 -6
  56. package/lib/components/ReviewsTab/expert-shared-components.code-workspace +20 -20
  57. package/lib/components/ReviewsTab/reviewRequestModal.js +5 -5
  58. package/lib/components/shared/Image.js +13 -13
  59. package/lib/components/shared/ProfileTextField.d.ts +18 -18
  60. package/lib/components/shared/ProfileTextField.js +16 -16
  61. package/lib/components/shared/StyledActionButtons.d.ts +7 -7
  62. package/lib/components/shared/StyledActionButtons.js +15 -15
  63. package/lib/components/shared/ToastNotification.d.ts +10 -10
  64. package/lib/components/shared/ToastNotification.js +63 -63
  65. package/lib/index.d.ts +1 -0
  66. package/lib/index.js +3 -1
  67. package/package.json +61 -61
@@ -0,0 +1,220 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.InvoiceCard = void 0;
27
+ const react_1 = __importStar(require("react"));
28
+ const base_ui_1 = require("@paro.io/base-ui");
29
+ const base_ui_2 = require("@paro.io/base-ui");
30
+ const core_1 = require("@material-ui/core");
31
+ const base_icons_1 = require("@paro.io/base-icons");
32
+ const useStyles = (0, core_1.makeStyles)((theme) => ({
33
+ root: {
34
+ width: "100%",
35
+ },
36
+ paper: {
37
+ width: "100%",
38
+ },
39
+ table: {
40
+ minWidth: '95%',
41
+ border: "1px solid",
42
+ borderColor: "#E2E8F0",
43
+ },
44
+ visuallyHidden: {
45
+ border: 0,
46
+ clip: "rect(0 0 0 0)",
47
+ height: 1,
48
+ margin: -1,
49
+ overflow: "hidden",
50
+ padding: 0,
51
+ position: "absolute",
52
+ top: 20,
53
+ width: 1,
54
+ },
55
+ tableCell: {
56
+ width: "auto",
57
+ },
58
+ collapse: {
59
+ backgroundColor: "#FFFFFF",
60
+ width: "100%",
61
+ borderRadius: 6,
62
+ marginLeft: 12,
63
+ marginTop: 12,
64
+ },
65
+ tableHead: {
66
+ backgroundColor: "#F1F5F9",
67
+ borderRadius: 6,
68
+ width: "100%",
69
+ },
70
+ }));
71
+ const headCells = [
72
+ { id: 'project', label: 'Project' },
73
+ { id: 'projectType', label: 'Project Type' },
74
+ { id: 'hours', label: 'Hours' },
75
+ { id: 'amount', label: 'Amount' },
76
+ { id: 'reason', label: 'Reason' },
77
+ ];
78
+ const ACCEPTED_FILE_TYPES = [
79
+ 'application/pdf',
80
+ 'application/msword',
81
+ 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
82
+ ];
83
+ const validateFileUpload = (file) => {
84
+ if (!file) {
85
+ return false;
86
+ }
87
+ if (!ACCEPTED_FILE_TYPES.includes(file.type)) {
88
+ return false;
89
+ }
90
+ if (file.size > 5242880) { //5MB size
91
+ return false;
92
+ }
93
+ return true;
94
+ };
95
+ const InvoiceCard = ({ invoice }) => {
96
+ const [expandRow, setExpandRow] = (0, react_1.useState)(null);
97
+ const classes = useStyles();
98
+ const [projects, setProjects] = (0, react_1.useState)(invoice.projectDetails);
99
+ const [editingRowId, setEditingRowId] = (0, react_1.useState)(null);
100
+ const [editedExplanation, setEditedExplanation] = (0, react_1.useState)('');
101
+ const [discussion, setDiscussion] = (0, react_1.useState)('');
102
+ const fileInputRef = (0, react_1.useRef)(null);
103
+ const handleChange = (e, field) => {
104
+ const updatedProject = field === "files" ? projects.map((project) => {
105
+ if (project.projectId === expandRow) {
106
+ return Object.assign(Object.assign({}, project), { files: [...project.files, ...e.filter((name) => !project.files.includes(name))] });
107
+ }
108
+ return project;
109
+ }) : projects.map((project) => {
110
+ return Object.assign(Object.assign({}, project), { [field]: e.target.value });
111
+ });
112
+ //upload files mutation
113
+ setProjects(updatedProject);
114
+ };
115
+ const handleUpload = (event) => {
116
+ const selectedFiles = event.target.files;
117
+ if (!selectedFiles)
118
+ return;
119
+ const validFiles = Array.from(selectedFiles)
120
+ .filter(file => validateFileUpload(file))
121
+ .map(file => file.name);
122
+ if (validFiles.length === 0)
123
+ return;
124
+ handleChange(validFiles, "files");
125
+ if (fileInputRef.current) {
126
+ fileInputRef.current.value = '';
127
+ }
128
+ };
129
+ return (react_1.default.createElement(base_ui_1.Card, { className: `mx-2 my-4 md:mx-8 flex md:flex items-center justify-between rounded flex-col` },
130
+ react_1.default.createElement("div", { key: invoice.invoiceId, className: "bg-[#0F172A] text-white mb-1 p-4 relative top-0 left-0 w-full rounded flex flex-row justify-evenly" },
131
+ react_1.default.createElement("b", null,
132
+ "Dispute Invoice #",
133
+ invoice.invoiceId),
134
+ react_1.default.createElement("p", null,
135
+ "Disputed: ",
136
+ invoice.disputedDate),
137
+ react_1.default.createElement("p", null,
138
+ "Invoice Date: ",
139
+ invoice.invoiceDate),
140
+ react_1.default.createElement("p", null,
141
+ "Expert: ",
142
+ invoice.expertName)),
143
+ react_1.default.createElement("div", { className: "w-[95%] m-2" },
144
+ react_1.default.createElement(core_1.Table, { className: classes.table, "aria-labelledby": "tableTitle", size: 'medium', "aria-label": "enhanced table" },
145
+ react_1.default.createElement(core_1.TableHead, { className: classes.tableHead },
146
+ react_1.default.createElement(core_1.TableRow, null,
147
+ headCells.map((headcell) => {
148
+ return react_1.default.createElement(core_1.TableCell, { key: headcell.id, className: classes.tableCell }, headcell.label);
149
+ }),
150
+ react_1.default.createElement(core_1.TableCell, { className: classes.tableCell }))),
151
+ projects.map((row) => (react_1.default.createElement(react_1.default.Fragment, null,
152
+ react_1.default.createElement(core_1.TableRow, { key: row.projectId },
153
+ react_1.default.createElement(core_1.TableCell, { align: "left", className: classes.tableCell }, row.project),
154
+ react_1.default.createElement(core_1.TableCell, { align: "left", className: classes.tableCell }, row.projectType),
155
+ react_1.default.createElement(core_1.TableCell, { align: "left", className: classes.tableCell }, row.hours),
156
+ react_1.default.createElement(core_1.TableCell, { align: "left", className: classes.tableCell }, row.amount),
157
+ react_1.default.createElement(core_1.TableCell, { align: "left", className: classes.tableCell }, row.reason),
158
+ react_1.default.createElement(core_1.TableCell, { align: "left", className: classes.tableCell },
159
+ react_1.default.createElement(core_1.IconButton, { onClick: () => { setExpandRow(expandRow === row.projectId ? null : row.projectId); } }, expandRow === row.projectId ? react_1.default.createElement(base_icons_1.IconChevronUp, null) : react_1.default.createElement(base_icons_1.IconChevronDown, null)))),
160
+ expandRow &&
161
+ react_1.default.createElement(core_1.TableRow, null,
162
+ react_1.default.createElement(core_1.TableCell, { colSpan: headCells.length + 1, style: { paddingBottom: 0, paddingTop: 0 } },
163
+ react_1.default.createElement(core_1.Collapse, { in: expandRow === row.projectId, timeout: "auto", unmountOnExit: true },
164
+ react_1.default.createElement(react_1.default.Fragment, null,
165
+ react_1.default.createElement(base_ui_1.Card, { className: `bg-[#F8F9FA] m-2 md:mx-8 flex md:flex items-start justify-between rounded flex-col w-[95%] p-6` },
166
+ react_1.default.createElement("b", { className: "mb-2 flex flex-row justify-start items-center" },
167
+ "Explanation:",
168
+ editingRowId === row.projectId ? (react_1.default.createElement(react_1.default.Fragment, null,
169
+ react_1.default.createElement(base_ui_2.Input, { label: "", type: "text", className: "w-96 mx-4 overflow-ellipsis", value: editedExplanation, onChange: (e) => setEditedExplanation(e.target.value), placeholder: "Please provide an explanation", isInvalid: !editedExplanation, isInvalidText: "Please provide an explanation" }),
170
+ react_1.default.createElement(base_ui_2.Button, { label: "Save", size: "md", color: "success", className: "ml-2 mt-1", onClick: () => {
171
+ setProjects((prev) => prev.map((p) => p.projectId === row.projectId
172
+ ? Object.assign(Object.assign({}, p), { explanation: editedExplanation }) : p));
173
+ setEditingRowId(null);
174
+ } }))) : (react_1.default.createElement(base_ui_2.Button, { label: "Edit", iconLeft: react_1.default.createElement(base_icons_1.IconPencil, { size: 'sm' }), onClick: () => {
175
+ setEditedExplanation(row.explanation);
176
+ setEditingRowId(row.projectId);
177
+ }, size: "sm", color: "info", className: "ml-6" }))),
178
+ react_1.default.createElement("p", null, row.explanation),
179
+ react_1.default.createElement("b", { className: "flex flex-row flex-wrap justify-start items-center mt-2" },
180
+ "Supporting Documents:",
181
+ react_1.default.createElement("input", { id: "upload-file", type: "file", multiple: true, accept: ".pdf,.doc,.docx", style: { display: 'none' }, ref: fileInputRef, onChange: handleUpload }),
182
+ react_1.default.createElement(base_ui_2.Button, { label: "Add File", iconLeft: react_1.default.createElement(base_icons_1.IconPlus, { size: 'sm' }), onClick: () => { fileInputRef.current && fileInputRef.current.click(); }, size: 'sm', color: "info", className: "mx-2" }),
183
+ row.files.map((f) => {
184
+ return react_1.default.createElement("div", { className: "mx-2" },
185
+ react_1.default.createElement(base_ui_1.Tag, { variant: "subtle", color: "success", label: f, iconRight: react_1.default.createElement(base_icons_1.IconXCircle, null), onClick: () => {
186
+ const updatedFiles = projects.map((p) => {
187
+ const updatedFiles = p.files.filter((file) => file !== f);
188
+ return Object.assign(Object.assign({}, p), { files: updatedFiles });
189
+ });
190
+ setProjects(updatedFiles);
191
+ } }));
192
+ }))),
193
+ react_1.default.createElement("b", { className: "ml-8 mt-4 mr-auto" }, "Discussion: "),
194
+ react_1.default.createElement(base_ui_1.Card, { className: `bg-[#EFF6FF] m-2 md:mx-8 flex md:flex justify-start rounded flex-col w-[95%] p-4` }, row.discussion.map((obj) => {
195
+ return obj.paroSupport ?
196
+ react_1.default.createElement("div", { className: "flex flex-row w-[80%] justify-start" },
197
+ react_1.default.createElement("div", { className: "flex justify-center items-center bg-[#26A69A] h-12 w-12 rounded-full text-2xl text-white" }, "PS"),
198
+ react_1.default.createElement("div", { className: "flex flex-col items-start ml-4" },
199
+ react_1.default.createElement("b", null,
200
+ "Paro Support: ",
201
+ react_1.default.createElement("span", null, "Apr 3, 2025")),
202
+ " ",
203
+ react_1.default.createElement("p", null, "We've received your dispute and are reviewing the timesheet discrepancies."),
204
+ react_1.default.createElement("p", null, "We'll follow up with the expert and update you by Apr 5."),
205
+ react_1.default.createElement("p", null, obj.paroSupport)))
206
+ :
207
+ react_1.default.createElement("div", { className: "flex flex-row-reverse w-[85%] justify-items-end items-center ml-auto my-1" },
208
+ react_1.default.createElement("div", { className: "flex justify-center items-center bg-[#4cbaff] h-12 w-12 rounded-full text-2xl text-white ml-4" }, "A"),
209
+ react_1.default.createElement("p", null, obj.you));
210
+ })),
211
+ react_1.default.createElement("div", { className: "flex flex-row w-[95%] m-2 ml-4 justify-start" },
212
+ react_1.default.createElement(base_ui_2.Input, { label: "", type: "text", className: "w-[60vw] mx-4 overflow-ellipsis", value: discussion, onChange: (e) => setDiscussion(e.target.value), placeholder: "Type your reply here..." }),
213
+ react_1.default.createElement(base_ui_2.Button, { label: "Save", size: "md", color: "success", className: "ml-2 mt-1 w-full", disabled: !discussion, onClick: () => {
214
+ setProjects((prev) => prev.map((p) => p.projectId === row.projectId
215
+ ? Object.assign(Object.assign({}, p), { discussion: [...p.discussion, { you: discussion }] }) : p));
216
+ setEditingRowId(null);
217
+ setDiscussion('');
218
+ } })))))))))))));
219
+ };
220
+ exports.InvoiceCard = InvoiceCard;
@@ -0,0 +1 @@
1
+ export { InvoiceCard } from './InvoiceCard';
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.InvoiceCard = void 0;
4
+ var InvoiceCard_1 = require("./InvoiceCard");
5
+ Object.defineProperty(exports, "InvoiceCard", { enumerable: true, get: function () { return InvoiceCard_1.InvoiceCard; } });
@@ -1,15 +1,15 @@
1
- interface OrgChartProps {
2
- openModal: boolean;
3
- setOpenModal: (openModal: boolean) => void;
4
- expertFirms: any;
5
- firstName: string;
6
- lastName: string;
7
- imageUrl?: string;
8
- primaryServiceLine: string;
9
- city: string;
10
- stateAbbreviation: string;
11
- paroTenure?: string;
12
- isPublicProfile?: boolean;
13
- }
14
- export declare const OrganizationChart: ({ openModal, setOpenModal, expertFirms, firstName, lastName, imageUrl, primaryServiceLine, city, stateAbbreviation, paroTenure, isPublicProfile }: OrgChartProps) => JSX.Element;
15
- export {};
1
+ interface OrgChartProps {
2
+ openModal: boolean;
3
+ setOpenModal: (openModal: boolean) => void;
4
+ expertFirms: any;
5
+ firstName: string;
6
+ lastName: string;
7
+ imageUrl?: string;
8
+ primaryServiceLine: string;
9
+ city: string;
10
+ stateAbbreviation: string;
11
+ paroTenure?: string;
12
+ isPublicProfile?: boolean;
13
+ }
14
+ export declare const OrganizationChart: ({ openModal, setOpenModal, expertFirms, firstName, lastName, imageUrl, primaryServiceLine, city, stateAbbreviation, paroTenure, isPublicProfile }: OrgChartProps) => JSX.Element;
15
+ export {};