@paro.io/expert-shared-components 1.14.8 → 1.14.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 (71) 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/DiscussionThread/chat.d.ts +22 -22
  14. package/lib/components/DiscussionThread/chat.js +106 -106
  15. package/lib/components/DocumentCenter/DocumentTable.d.ts +15 -15
  16. package/lib/components/DocumentCenter/DocumentTable.js +350 -350
  17. package/lib/components/DocumentCenter/UploadFilesButton.d.ts +6 -6
  18. package/lib/components/DocumentCenter/UploadFilesButton.js +29 -29
  19. package/lib/components/EarningsTracker/ActiveProjectCard.d.ts +52 -52
  20. package/lib/components/EarningsTracker/ActiveProjectCard.js +161 -161
  21. package/lib/components/EarningsTracker/CenterCardUI.d.ts +13 -13
  22. package/lib/components/EarningsTracker/CenterCardUI.js +134 -134
  23. package/lib/components/EarningsTracker/EarningsTracker.d.ts +52 -52
  24. package/lib/components/EarningsTracker/EarningsTracker.js +508 -508
  25. package/lib/components/EarningsTracker/EditDateModal.d.ts +22 -22
  26. package/lib/components/EarningsTracker/EditDateModal.js +149 -149
  27. package/lib/components/EarningsTracker/EmailModal.d.ts +14 -14
  28. package/lib/components/EarningsTracker/EmailModal.js +79 -79
  29. package/lib/components/EarningsTracker/EndProjectModal.d.ts +56 -56
  30. package/lib/components/EarningsTracker/EndProjectModal.js +221 -221
  31. package/lib/components/EarningsTracker/LeftCardUI.d.ts +18 -18
  32. package/lib/components/EarningsTracker/LeftCardUI.js +189 -189
  33. package/lib/components/EarningsTracker/LogTimeModalAuthenticated.d.ts +52 -52
  34. package/lib/components/EarningsTracker/LogTimeModalAuthenticated.js +358 -358
  35. package/lib/components/EarningsTracker/ProgressBar.d.ts +4 -4
  36. package/lib/components/EarningsTracker/ProgressBar.js +66 -66
  37. package/lib/components/EarningsTracker/ReviewRequestModal.d.ts +17 -17
  38. package/lib/components/EarningsTracker/ReviewRequestModal.js +135 -135
  39. package/lib/components/EarningsTracker/RightCardUI.d.ts +46 -46
  40. package/lib/components/EarningsTracker/RightCardUI.js +231 -231
  41. package/lib/components/EarningsTracker/index.d.ts +1 -1
  42. package/lib/components/EarningsTracker/index.js +5 -5
  43. package/lib/components/Escalations/CustomTag.d.ts +3 -3
  44. package/lib/components/Escalations/CustomTag.js +25 -25
  45. package/lib/components/Escalations/ViewReponseModal.d.ts +8 -8
  46. package/lib/components/Escalations/ViewReponseModal.js +27 -27
  47. package/lib/components/ExpertProfileHeader/ActionButtonSection.js +6 -6
  48. package/lib/components/ExpertProfileHeader/ProfileSection.js +7 -7
  49. package/lib/components/Invoices/TestDecisionSection.d.ts +1 -1
  50. package/lib/components/Invoices/TestDecisionSection.js +126 -126
  51. package/lib/components/OrganizationChart/OrganizationChart.js +7 -7
  52. package/lib/components/OrganizationChart/PersonCard.js +5 -5
  53. package/lib/components/OrganizationChart/utils.js +79 -79
  54. package/lib/components/ProjectCard/ProgressBar.js +4 -4
  55. package/lib/components/ProjectCard/ReviewRequestModal.js +5 -5
  56. package/lib/components/ProjectIntelligence/FocusAreas/index.js +1 -2
  57. package/lib/components/ProjectIntelligence/MissingInformation/index.js +1 -1
  58. package/lib/components/ProjectIntelligence/index.d.ts +1 -0
  59. package/lib/components/ProjectIntelligence/index.js +14 -69
  60. package/lib/components/Reviews/Pagination.js +6 -6
  61. package/lib/components/ReviewsTab/RatingHeader.js +6 -6
  62. package/lib/components/ReviewsTab/expert-shared-components.code-workspace +20 -20
  63. package/lib/components/ReviewsTab/reviewRequestModal.js +5 -5
  64. package/lib/components/shared/Image.js +13 -13
  65. package/lib/components/shared/ProfileTextField.d.ts +18 -18
  66. package/lib/components/shared/ProfileTextField.js +16 -16
  67. package/lib/components/shared/StyledActionButtons.d.ts +7 -7
  68. package/lib/components/shared/StyledActionButtons.js +15 -15
  69. package/lib/components/shared/ToastNotification.d.ts +10 -10
  70. package/lib/components/shared/ToastNotification.js +63 -63
  71. package/package.json +67 -67
@@ -15,6 +15,7 @@ interface ProjectIntelligenceProps {
15
15
  onSaveFocusArea?: any;
16
16
  onSaveMissingInformation?: any;
17
17
  isParoIntelligenceRolePresent?: boolean;
18
+ updateOpportunityPhase?: any;
18
19
  }
19
20
  export declare const ProjectIntelligence: React.FC<ProjectIntelligenceProps>;
20
21
  export {};
@@ -32,7 +32,8 @@ const TeamSection_1 = require("./TeamSection");
32
32
  const ProjectHealth_1 = require("./ProjectHealth");
33
33
  const KeyMetrics_1 = require("./KeyMetrics");
34
34
  const MissingInformation_1 = require("./MissingInformation");
35
- const ProjectIntelligence = ({ checkIfOpportunityInsightsExistData, opportunityInsightsData, selectedOpportunityId, setSelectedOpportunityId, GetOpportunityInsightsDocument, updateOpportunityMissingInformation, documentCenterController = null, updateOpportunityFocusArea, isInternal = false, handleRouteToDocuments, onSaveFocusArea, onSaveMissingInformation, isParoIntelligenceRolePresent = false, }) => {
35
+ const utils_1 = require("../shared/utils");
36
+ const ProjectIntelligence = ({ checkIfOpportunityInsightsExistData, opportunityInsightsData, selectedOpportunityId, setSelectedOpportunityId, GetOpportunityInsightsDocument, updateOpportunityMissingInformation, documentCenterController = null, updateOpportunityFocusArea, isInternal = false, handleRouteToDocuments, onSaveFocusArea, onSaveMissingInformation, isParoIntelligenceRolePresent = false, updateOpportunityPhase, }) => {
36
37
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10;
37
38
  const [isLoading, setIsLoading] = (0, react_1.useState)(false);
38
39
  const [currentPhase, setCurrentPhase] = (0, react_1.useState)('Setup');
@@ -128,76 +129,20 @@ const ProjectIntelligence = ({ checkIfOpportunityInsightsExistData, opportunityI
128
129
  // Handle moving to the next stage
129
130
  const handleMoveToNextStage = () => {
130
131
  setIsLoading(true);
131
- // Create next stage data with financial focus areas and carry over missing information
132
- const nextStageFocusAreas = [
133
- {
134
- id: 'next-focus-1',
135
- title: 'Clean up prior accounting periods',
136
- description: 'Review and bring the company\'s books up-to-date for all prior accounting periods before the project start date. This includes entering invoices, applying payments, entering bills, categorizing transactions, and reconciling accounts test',
137
- status: 'CONFIRMED',
138
- dueDate: new Date(Date.now() + 7 * 24 * 60 * 60 * 1000).toISOString(), // 7 days from now
139
- priority: 'HIGH'
132
+ updateOpportunityPhase({
133
+ variables: {
134
+ opportunityId: selectedOpportunityId
140
135
  },
141
- {
142
- id: 'next-focus-2',
143
- title: 'Ongoing bookkeeping and accounting',
144
- description: 'Provide monthly bookkeeping and accounting support including invoice entry, payment processing, bill entry, transaction categorization, account reconciliations, and reporting package delivery.',
145
- status: 'CONFIRMED',
146
- dueDate: new Date(Date.now() + 14 * 24 * 60 * 60 * 1000).toISOString(), // 14 days from now
147
- priority: 'MEDIUM'
148
- },
149
- {
150
- id: 'next-focus-3',
151
- title: 'Transition to new accounting system',
152
- description: 'Assist in preparing the books and migrating data to the company\'s new front-end accounting system once implemented.',
153
- status: 'CONFIRMED',
154
- dueDate: new Date(Date.now() + 10 * 24 * 60 * 60 * 1000).toISOString(), // 10 days from now
155
- priority: 'HIGH'
156
- }
157
- ];
158
- // Carry over missing information that doesn't have CLIENT_RESPONDED status
159
- const carriedOverMissingInfo = (opportunityInsights === null || opportunityInsights === void 0 ? void 0 : opportunityInsights.missingInformation)
160
- ? opportunityInsights.missingInformation
161
- .filter((item) => (item === null || item === void 0 ? void 0 : item.status) !== 'CLIENT_RESPONDED')
162
- .map((item, index) => (Object.assign(Object.assign({}, item), { id: `carried-${item.id || index}` })))
163
- : [];
164
- // Add new missing information items
165
- const newMissingInfo = [
166
- {
167
- id: 'new-missing-1',
168
- title: 'Financial Transaction History',
169
- description: 'Need access to the last 6 months of financial transaction history for the project',
170
- priority: 'HIGH',
171
- category: 'Financial',
172
- status: 'PENDING'
173
- },
174
- {
175
- id: 'new-missing-2',
176
- title: 'Budget Approval Documentation',
177
- description: 'Require documentation showing approval of the current budget allocation',
178
- priority: 'MEDIUM',
179
- category: 'Documentation',
180
- status: 'PENDING'
181
- },
182
- {
183
- id: 'new-missing-3',
184
- title: 'Financial Stakeholder Contact Information',
185
- description: 'Need contact details for all financial stakeholders involved in the project',
186
- priority: 'LOW',
187
- category: 'Contact',
188
- status: 'PENDING'
189
- }
190
- ];
191
- // Set the next stage data
192
- setNextStageData({
193
- focusAreas: nextStageFocusAreas,
194
- missingInformation: [...carriedOverMissingInfo, ...newMissingInfo]
195
- });
196
- // Simulate loading and then update the UI
197
- setTimeout(() => {
198
- setCurrentPhase('Active');
136
+ refetchQueries: [
137
+ { query: GetOpportunityInsightsDocument, variables: { opportunityId: selectedOpportunityId } }
138
+ ]
139
+ }).then(() => {
199
140
  setIsLoading(false);
200
- }, 3000);
141
+ }).catch((error) => {
142
+ setIsLoading(false);
143
+ console.error('Error updating opportunity phase:', error);
144
+ (0, utils_1.showToast)('warning', 'Error updating opportunity phase. Please try again.');
145
+ });
201
146
  };
202
147
  const hasNoProjectIntelligence = !(checkIfOpportunityInsightsExistData === null || checkIfOpportunityInsightsExistData === void 0 ? void 0 : checkIfOpportunityInsightsExistData.checkIfOpportunityInsightsExist) ||
203
148
  checkIfOpportunityInsightsExistData.checkIfOpportunityInsightsExist.length === 0;
@@ -51,12 +51,12 @@ const Pagination = ({ total, currentPage = 1, setCurrentPage, perPageItems = 10,
51
51
  };
52
52
  const numberOfPages = Math.ceil(total / perPageItems);
53
53
  return (react_1.default.createElement("div", { className: "bg-white px-4 py-3 border-t border-gray-200 sm:px-6 flex flex-col md:flex-row md:items-center md:justify-between" },
54
- react_1.default.createElement("div", { className: "pb-2 md:pb-0" }, `Showing
55
- ${perPageItems * (currentPage - 1) + 1}
56
- to
57
- ${Math.min(total, perPageItems * currentPage)}
58
- of
59
- ${total}
54
+ react_1.default.createElement("div", { className: "pb-2 md:pb-0" }, `Showing
55
+ ${perPageItems * (currentPage - 1) + 1}
56
+ to
57
+ ${Math.min(total, perPageItems * currentPage)}
58
+ of
59
+ ${total}
60
60
  ${displayText}`),
61
61
  react_1.default.createElement("div", { className: "flex items-center justify-between" },
62
62
  react_1.default.createElement("div", { className: "flex-1 flex justify-between sm:hidden" },
@@ -51,12 +51,12 @@ const isRatingExists = (rating) => {
51
51
  return false;
52
52
  };
53
53
  exports.isRatingExists = isRatingExists;
54
- const StyledButton = (0, styled_components_1.default)(core_2.Button) `
55
- margin: 0px !important;
56
- padding: 26px 0 18px 0 !important;
57
- span {
58
- color: #248384 !important
59
- }
54
+ const StyledButton = (0, styled_components_1.default)(core_2.Button) `
55
+ margin: 0px !important;
56
+ padding: 26px 0 18px 0 !important;
57
+ span {
58
+ color: #248384 !important
59
+ }
60
60
  `;
61
61
  const RatingHeader = ({ ratings, project, index, highlightedRatings, requestStatus, handleRatingRequest, loadingSubmitId, handleAddToProfile, ratingReviewButtonlabel, setOpenClientReviewModal, setShowReviewModelWithRecentlyRatedProjects, enableReviewModal, disableReviewModal, isClientPortal, isInternal, createOrUpdateRating, getParoProjectsDocument, projectIdToShow, }) => {
62
62
  var _a, _b, _c, _d;
@@ -1,20 +1,20 @@
1
- {
2
- "folders": [
3
- {
4
- "path": "../../.."
5
- },
6
- {
7
- "path": "../../../../internal-profile-app"
8
- },
9
- {
10
- "path": "../../../../availability-gantt-chart"
11
- },
12
- {
13
- "path": "../../../../client-portal"
14
- },
15
- {
16
- "path": "../../../../expert-portal"
17
- }
18
- ],
19
- "settings": {}
20
- }
1
+ {
2
+ "folders": [
3
+ {
4
+ "path": "../../.."
5
+ },
6
+ {
7
+ "path": "../../../../internal-profile-app"
8
+ },
9
+ {
10
+ "path": "../../../../availability-gantt-chart"
11
+ },
12
+ {
13
+ "path": "../../../../client-portal"
14
+ },
15
+ {
16
+ "path": "../../../../expert-portal"
17
+ }
18
+ ],
19
+ "settings": {}
20
+ }
@@ -34,11 +34,11 @@ const react_hot_toast_1 = __importDefault(require("react-hot-toast"));
34
34
  const ReviewRequestModal = ({ project, requestModal, setRequestModal, expertName, freelancerId, setRequestStatus, selectedProject, setSelectedProject, clientId, refetchParoProjects, setHighlightedRatings, createOrUpdateRatingRequestMutation, getParoProjectsDocument, }) => {
35
35
  var _a;
36
36
  const [showError, setShowError] = (0, react_1.useState)(false);
37
- const [textareaValue, setTextareaValue] = (0, react_1.useState)(`Hi ${(_a = project === null || project === void 0 ? void 0 : project.client) === null || _a === void 0 ? void 0 : _a.name},
38
- I hope you are satisfied with the work I provided on ${project === null || project === void 0 ? void 0 : project.name}. Your feedback is very important to me and helps me improve my services and build my reputation on Paro. Could you please take a moment to leave a review of you experience? Your input is greatly appreciated!
39
-
40
- Thank you in advance for your time and feedback.
41
- Best regards,
37
+ const [textareaValue, setTextareaValue] = (0, react_1.useState)(`Hi ${(_a = project === null || project === void 0 ? void 0 : project.client) === null || _a === void 0 ? void 0 : _a.name},
38
+ I hope you are satisfied with the work I provided on ${project === null || project === void 0 ? void 0 : project.name}. Your feedback is very important to me and helps me improve my services and build my reputation on Paro. Could you please take a moment to leave a review of you experience? Your input is greatly appreciated!
39
+
40
+ Thank you in advance for your time and feedback.
41
+ Best regards,
42
42
  ${expertName}`);
43
43
  const handleTextArea = (e) => {
44
44
  setTextareaValue(e.target.value);
@@ -31,20 +31,20 @@ const react_1 = __importStar(require("react"));
31
31
  const core_1 = require("@material-ui/core");
32
32
  const styled_components_1 = __importDefault(require("styled-components"));
33
33
  const cdn_1 = require("./constants/cdn");
34
- const ProfilePhotoPreview = styled_components_1.default.img `
35
- height: 86px;
36
- width: 86px;
37
- border: 4px solid #F8FAFC;
38
- border-radius: 10px;
39
- object-fit: cover;
40
- object-position: top;
34
+ const ProfilePhotoPreview = styled_components_1.default.img `
35
+ height: 86px;
36
+ width: 86px;
37
+ border: 4px solid #F8FAFC;
38
+ border-radius: 10px;
39
+ object-fit: cover;
40
+ object-position: top;
41
41
  `;
42
- const PhotoChangeButton = (0, styled_components_1.default)(core_1.Typography) `
43
- text-decoration: underline;
44
- cursor: pointer;
45
- :active {
46
- text-decoration: none !important;
47
- }
42
+ const PhotoChangeButton = (0, styled_components_1.default)(core_1.Typography) `
43
+ text-decoration: underline;
44
+ cursor: pointer;
45
+ :active {
46
+ text-decoration: none !important;
47
+ }
48
48
  `;
49
49
  exports.defaultAvatar = cdn_1.CDN_URL + 'defaultAvatar.png';
50
50
  const Image = ({ imageUrl, getUserDocument, uploadUserPhotoMutation, loadingNewImage, imageUpdateError, legacyFreelancerId, }) => {
@@ -1,18 +1,18 @@
1
- import { FieldError } from 'react-hook-form/dist/types/form';
2
- type SectionContents = {
3
- defaultValue?: string | number;
4
- error?: boolean;
5
- helperText: string | undefined | (FieldError | undefined)[];
6
- inputRef?: ((instance: any) => void) | null | undefined;
7
- label?: string;
8
- multiline?: boolean;
9
- name?: string;
10
- placeholder?: string;
11
- props?: unknown;
12
- size?: 'small' | 'medium' | undefined;
13
- onChange?: ((value: any) => void) | undefined;
14
- width?: boolean;
15
- InputProps?: any;
16
- };
17
- declare const ProfileTextField: ({ defaultValue, error, helperText, inputRef, label, multiline, name, placeholder, props, size, width, onChange, InputProps }: SectionContents) => JSX.Element;
18
- export default ProfileTextField;
1
+ import { FieldError } from 'react-hook-form/dist/types/form';
2
+ type SectionContents = {
3
+ defaultValue?: string | number;
4
+ error?: boolean;
5
+ helperText: string | undefined | (FieldError | undefined)[];
6
+ inputRef?: ((instance: any) => void) | null | undefined;
7
+ label?: string;
8
+ multiline?: boolean;
9
+ name?: string;
10
+ placeholder?: string;
11
+ props?: unknown;
12
+ size?: 'small' | 'medium' | undefined;
13
+ onChange?: ((value: any) => void) | undefined;
14
+ width?: boolean;
15
+ InputProps?: any;
16
+ };
17
+ declare const ProfileTextField: ({ defaultValue, error, helperText, inputRef, label, multiline, name, placeholder, props, size, width, onChange, InputProps }: SectionContents) => JSX.Element;
18
+ export default ProfileTextField;
@@ -1,16 +1,16 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const react_1 = __importDefault(require("react"));
7
- const TextField_1 = __importDefault(require("@material-ui/core/TextField"));
8
- const ProfileTextField = ({ defaultValue, error, helperText, inputRef, label, multiline = false, name, placeholder, props, size, width = false, onChange, InputProps }) => {
9
- return (onChange ? react_1.default.createElement(TextField_1.default, Object.assign({ InputProps: InputProps, "x-id": 'TextField' }, props, { defaultValue: defaultValue, error: error, fullWidth: true, helperText: helperText, InputLabelProps: {
10
- shrink: true
11
- }, inputRef: inputRef, label: label, margin: 'normal', multiline: multiline, name: name, placeholder: placeholder, size: size, style: Object.assign({ marginTop: '8px' }, (width && { width: '100%' })), variant: 'outlined', onChange: onChange, classes: { root: 'inputCurrency' } })) :
12
- react_1.default.createElement(TextField_1.default, Object.assign({ InputProps: InputProps, "x-id": 'TextField' }, props, { defaultValue: defaultValue, error: error, fullWidth: true, helperText: helperText, InputLabelProps: {
13
- shrink: true
14
- }, inputRef: inputRef, label: label, margin: 'normal', multiline: multiline, name: name, placeholder: placeholder, size: size, style: Object.assign({ marginTop: '8px' }, (width && { width: '100%' })), variant: 'outlined' })));
15
- };
16
- exports.default = ProfileTextField;
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const react_1 = __importDefault(require("react"));
7
+ const TextField_1 = __importDefault(require("@material-ui/core/TextField"));
8
+ const ProfileTextField = ({ defaultValue, error, helperText, inputRef, label, multiline = false, name, placeholder, props, size, width = false, onChange, InputProps }) => {
9
+ return (onChange ? react_1.default.createElement(TextField_1.default, Object.assign({ InputProps: InputProps, "x-id": 'TextField' }, props, { defaultValue: defaultValue, error: error, fullWidth: true, helperText: helperText, InputLabelProps: {
10
+ shrink: true
11
+ }, inputRef: inputRef, label: label, margin: 'normal', multiline: multiline, name: name, placeholder: placeholder, size: size, style: Object.assign({ marginTop: '8px' }, (width && { width: '100%' })), variant: 'outlined', onChange: onChange, classes: { root: 'inputCurrency' } })) :
12
+ react_1.default.createElement(TextField_1.default, Object.assign({ InputProps: InputProps, "x-id": 'TextField' }, props, { defaultValue: defaultValue, error: error, fullWidth: true, helperText: helperText, InputLabelProps: {
13
+ shrink: true
14
+ }, inputRef: inputRef, label: label, margin: 'normal', multiline: multiline, name: name, placeholder: placeholder, size: size, style: Object.assign({ marginTop: '8px' }, (width && { width: '100%' })), variant: 'outlined' })));
15
+ };
16
+ exports.default = ProfileTextField;
@@ -1,7 +1,7 @@
1
- declare const StyledActionButtons: ({ closeOnClick, isDisabled, isLoading, handleSubmit }: {
2
- closeOnClick: () => void;
3
- isDisabled: boolean;
4
- isLoading: boolean;
5
- handleSubmit?: () => void;
6
- }) => JSX.Element;
7
- export default StyledActionButtons;
1
+ declare const StyledActionButtons: ({ closeOnClick, isDisabled, isLoading, handleSubmit }: {
2
+ closeOnClick: () => void;
3
+ isDisabled: boolean;
4
+ isLoading: boolean;
5
+ handleSubmit?: () => void;
6
+ }) => JSX.Element;
7
+ export default StyledActionButtons;
@@ -1,15 +1,15 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const react_1 = __importDefault(require("react"));
7
- const core_1 = require("@material-ui/core");
8
- const Button_1 = __importDefault(require("@material-ui/core/Button"));
9
- const Loader_1 = __importDefault(require("./Loader"));
10
- const StyledActionButtons = ({ closeOnClick, isDisabled, isLoading, handleSubmit }) => {
11
- return (react_1.default.createElement(core_1.DialogActions, null,
12
- react_1.default.createElement(Button_1.default, { variant: 'outlined', onClick: closeOnClick, color: 'primary' }, "Close"),
13
- react_1.default.createElement(Button_1.default, { color: 'default', disabled: isDisabled, key: String(isDisabled), onClick: handleSubmit, variant: 'contained' }, isLoading ? react_1.default.createElement(Loader_1.default, { key: String(isLoading) }) : 'Save')));
14
- };
15
- exports.default = StyledActionButtons;
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const react_1 = __importDefault(require("react"));
7
+ const core_1 = require("@material-ui/core");
8
+ const Button_1 = __importDefault(require("@material-ui/core/Button"));
9
+ const Loader_1 = __importDefault(require("./Loader"));
10
+ const StyledActionButtons = ({ closeOnClick, isDisabled, isLoading, handleSubmit }) => {
11
+ return (react_1.default.createElement(core_1.DialogActions, null,
12
+ react_1.default.createElement(Button_1.default, { variant: 'outlined', onClick: closeOnClick, color: 'primary' }, "Close"),
13
+ react_1.default.createElement(Button_1.default, { color: 'default', disabled: isDisabled, key: String(isDisabled), onClick: handleSubmit, variant: 'contained' }, isLoading ? react_1.default.createElement(Loader_1.default, { key: String(isLoading) }) : 'Save')));
14
+ };
15
+ exports.default = StyledActionButtons;
@@ -1,10 +1,10 @@
1
- import React from 'react';
2
- interface ToastModalProps {
3
- color: 'success' | 'info' | 'warning' | 'danger';
4
- icon: string;
5
- message: string;
6
- duration?: number;
7
- position?: 'top-right' | 'bottom-right' | 'top-left' | 'bottom-left';
8
- }
9
- declare const ToastModal: React.FC<ToastModalProps>;
10
- export default ToastModal;
1
+ import React from 'react';
2
+ interface ToastModalProps {
3
+ color: 'success' | 'info' | 'warning' | 'danger';
4
+ icon: string;
5
+ message: string;
6
+ duration?: number;
7
+ position?: 'top-right' | 'bottom-right' | 'top-left' | 'bottom-left';
8
+ }
9
+ declare const ToastModal: React.FC<ToastModalProps>;
10
+ export default ToastModal;
@@ -1,63 +1,63 @@
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
- const react_1 = __importStar(require("react"));
27
- const core_1 = require("@material-ui/core");
28
- const base_ui_1 = require("@paro.io/base-ui");
29
- const ToastModal = ({ color, icon, message, duration = 6000, // Default duration is 6 seconds
30
- position = 'bottom-right', }) => {
31
- const [open, setOpen] = (0, react_1.useState)(false);
32
- // Automatically open the modal on mount
33
- (0, react_1.useEffect)(() => {
34
- setOpen(true);
35
- // Automatically close the modal after the specified duration
36
- const timer = setTimeout(() => {
37
- setOpen(false);
38
- }, duration);
39
- // Cleanup the timeout if the component unmounts or if the duration changes
40
- return () => clearTimeout(timer);
41
- }, [duration]);
42
- console.log("triggered");
43
- return (react_1.default.createElement(core_1.Dialog, { open: open, onClose: () => setOpen(false), "aria-labelledby": "toast-modal-title", maxWidth: "xs", fullWidth: true, PaperProps: {
44
- style: {
45
- backgroundColor: '#323232', // Dark background to resemble toast style
46
- color: '#fff', // White text
47
- borderRadius: '8px',
48
- display: 'flex',
49
- justifyContent: 'center',
50
- alignItems: 'center',
51
- zIndex: 9999, // Ensure it’s on top of the MUI Dialog
52
- position: 'absolute', // Absolute positioning to control location
53
- top: position.includes('top') ? '10%' : 'auto',
54
- bottom: position.includes('bottom') ? '10%' : 'auto',
55
- right: position.includes('right') ? '10%' : 'auto',
56
- left: position.includes('left') ? '10%' : 'auto',
57
- },
58
- } },
59
- react_1.default.createElement(core_1.DialogContent, { style: { textAlign: 'center' } },
60
- react_1.default.createElement(base_ui_1.Alert, { color: color, icon: icon, label: message, className: color === 'warning' ? 'bg-warning' : 'bg-success' }),
61
- ",")));
62
- };
63
- exports.default = ToastModal;
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
+ const react_1 = __importStar(require("react"));
27
+ const core_1 = require("@material-ui/core");
28
+ const base_ui_1 = require("@paro.io/base-ui");
29
+ const ToastModal = ({ color, icon, message, duration = 6000, // Default duration is 6 seconds
30
+ position = 'bottom-right', }) => {
31
+ const [open, setOpen] = (0, react_1.useState)(false);
32
+ // Automatically open the modal on mount
33
+ (0, react_1.useEffect)(() => {
34
+ setOpen(true);
35
+ // Automatically close the modal after the specified duration
36
+ const timer = setTimeout(() => {
37
+ setOpen(false);
38
+ }, duration);
39
+ // Cleanup the timeout if the component unmounts or if the duration changes
40
+ return () => clearTimeout(timer);
41
+ }, [duration]);
42
+ console.log("triggered");
43
+ return (react_1.default.createElement(core_1.Dialog, { open: open, onClose: () => setOpen(false), "aria-labelledby": "toast-modal-title", maxWidth: "xs", fullWidth: true, PaperProps: {
44
+ style: {
45
+ backgroundColor: '#323232', // Dark background to resemble toast style
46
+ color: '#fff', // White text
47
+ borderRadius: '8px',
48
+ display: 'flex',
49
+ justifyContent: 'center',
50
+ alignItems: 'center',
51
+ zIndex: 9999, // Ensure it’s on top of the MUI Dialog
52
+ position: 'absolute', // Absolute positioning to control location
53
+ top: position.includes('top') ? '10%' : 'auto',
54
+ bottom: position.includes('bottom') ? '10%' : 'auto',
55
+ right: position.includes('right') ? '10%' : 'auto',
56
+ left: position.includes('left') ? '10%' : 'auto',
57
+ },
58
+ } },
59
+ react_1.default.createElement(core_1.DialogContent, { style: { textAlign: 'center' } },
60
+ react_1.default.createElement(base_ui_1.Alert, { color: color, icon: icon, label: message, className: color === 'warning' ? 'bg-warning' : 'bg-success' }),
61
+ ",")));
62
+ };
63
+ exports.default = ToastModal;