sag_components 2.0.0-beta141 → 2.0.0-beta142

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -13080,17 +13080,17 @@ const Modal$1 = styled__default["default"].div`
13080
13080
  margin: 0 auto;
13081
13081
  ${scrollableStyles$a}
13082
13082
  `;
13083
- const ModalHeader$1 = styled__default["default"].div`
13083
+ const ModalHeader$2 = styled__default["default"].div`
13084
13084
  display: flex;
13085
13085
  align-items: center;
13086
13086
  justify-content: space-between;
13087
13087
  margin-bottom: 32px;
13088
13088
  `;
13089
- const ModalBody$1 = styled__default["default"].div`
13089
+ const ModalBody$2 = styled__default["default"].div`
13090
13090
  ${scrollableStyles$a}
13091
13091
  max-height: 80vh;
13092
13092
  `;
13093
- const ModalTitle$2 = styled__default["default"].h5`
13093
+ const ModalTitle$3 = styled__default["default"].h5`
13094
13094
  font-family: 'Poppins', sans-serif;
13095
13095
  font-size: 32px;
13096
13096
  font-weight: 500;
@@ -13122,12 +13122,12 @@ const DialogOverlay$1 = props => {
13122
13122
  };
13123
13123
  return /*#__PURE__*/React.createElement(ModalWrapper$1, {
13124
13124
  className: className
13125
- }, /*#__PURE__*/React.createElement(Modal$1, null, /*#__PURE__*/React.createElement(ModalHeader$1, null, /*#__PURE__*/React.createElement(ModalTitle$2, null, title), /*#__PURE__*/React.createElement(ModalClose, {
13125
+ }, /*#__PURE__*/React.createElement(Modal$1, null, /*#__PURE__*/React.createElement(ModalHeader$2, null, /*#__PURE__*/React.createElement(ModalTitle$3, null, title), /*#__PURE__*/React.createElement(ModalClose, {
13126
13126
  type: "button",
13127
13127
  onClick: closeModal
13128
13128
  }, /*#__PURE__*/React.createElement(CloseXIcon, {
13129
13129
  fill: "white"
13130
- }))), /*#__PURE__*/React.createElement(ModalBody$1, {
13130
+ }))), /*#__PURE__*/React.createElement(ModalBody$2, {
13131
13131
  id: "modalBody"
13132
13132
  }, children)));
13133
13133
  };
@@ -27219,7 +27219,7 @@ const scrollableStyles$6 = `
27219
27219
  }
27220
27220
  `;
27221
27221
  const MainContainer$1 = styled__default["default"].div``;
27222
- const ModalOverlay$1 = styled__default["default"].div`
27222
+ const ModalOverlay$2 = styled__default["default"].div`
27223
27223
  position: fixed;
27224
27224
  z-index: 100;
27225
27225
  top: 0;
@@ -27231,7 +27231,7 @@ const ModalOverlay$1 = styled__default["default"].div`
27231
27231
  justify-content: center;
27232
27232
  align-items: center;
27233
27233
  `;
27234
- const ModalContent$1 = styled__default["default"].div`
27234
+ const ModalContent$2 = styled__default["default"].div`
27235
27235
  font-family: "Poppins", sans-serif;
27236
27236
  font-weight: 500;
27237
27237
  font-size: 18px;
@@ -27461,10 +27461,10 @@ const PopupCharts = props => {
27461
27461
  }, displayChart(item)));
27462
27462
  return /*#__PURE__*/React__default["default"].createElement(MainContainer$1, {
27463
27463
  id: "MainContainer"
27464
- }, IsPopupChartsOpen && /*#__PURE__*/React__default["default"].createElement(ModalOverlay$1, {
27464
+ }, IsPopupChartsOpen && /*#__PURE__*/React__default["default"].createElement(ModalOverlay$2, {
27465
27465
  id: "ModalOverlay",
27466
27466
  className: "modal-overlay"
27467
- }, /*#__PURE__*/React__default["default"].createElement(ModalContent$1, {
27467
+ }, /*#__PURE__*/React__default["default"].createElement(ModalContent$2, {
27468
27468
  id: "ModalContent",
27469
27469
  ref: divRef,
27470
27470
  className: "modal-content",
@@ -33817,7 +33817,7 @@ const Overlay$2 = styled__default["default"].div`
33817
33817
  align-items: center;
33818
33818
  z-index: 999;
33819
33819
  `;
33820
- const ModalContent = styled__default["default"].div`
33820
+ const ModalContent$1 = styled__default["default"].div`
33821
33821
  position: absolute;
33822
33822
  width: 70%;
33823
33823
  height: 80%;
@@ -33843,7 +33843,7 @@ const Header$3 = styled__default["default"].div`
33843
33843
  align-items: flex-start;
33844
33844
  }
33845
33845
  `;
33846
- const CloseButton$1 = styled__default["default"].button`
33846
+ const CloseButton$2 = styled__default["default"].button`
33847
33847
  position: absolute;
33848
33848
  top: -10px;
33849
33849
  right: 0px;
@@ -34040,11 +34040,11 @@ const InsightsCarousel = _ref => {
34040
34040
  const nextIndex = (currentIndex + 1) % totalChildren;
34041
34041
  return /*#__PURE__*/React__default["default"].createElement(Overlay$2, {
34042
34042
  className: className
34043
- }, /*#__PURE__*/React__default["default"].createElement(ModalContent, null, /*#__PURE__*/React__default["default"].createElement(Header$3, null, /*#__PURE__*/React__default["default"].createElement(Title$8, {
34043
+ }, /*#__PURE__*/React__default["default"].createElement(ModalContent$1, null, /*#__PURE__*/React__default["default"].createElement(Header$3, null, /*#__PURE__*/React__default["default"].createElement(Title$8, {
34044
34044
  $titleColor: titleColor
34045
34045
  }, /*#__PURE__*/React__default["default"].cloneElement(icon, {
34046
34046
  fill: iconColor
34047
- }), title), /*#__PURE__*/React__default["default"].createElement(CloseButton$1, {
34047
+ }), title), /*#__PURE__*/React__default["default"].createElement(CloseButton$2, {
34048
34048
  onClick: () => onClose?.({
34049
34049
  label: "closeCarousel"
34050
34050
  }),
@@ -34361,7 +34361,7 @@ const Modal = styled__default["default"].div`
34361
34361
  border-radius: 12px;
34362
34362
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
34363
34363
  `;
34364
- const ModalHeader = styled__default["default"].div`
34364
+ const ModalHeader$1 = styled__default["default"].div`
34365
34365
  display: flex;
34366
34366
  justify-content: space-between;
34367
34367
  `;
@@ -34369,12 +34369,12 @@ const ModalButtons = styled__default["default"].div`
34369
34369
  display: flex;
34370
34370
  gap: 10px;
34371
34371
  `;
34372
- const ModalTitle$1 = styled__default["default"].h3`
34372
+ const ModalTitle$2 = styled__default["default"].h3`
34373
34373
  margin: 0;
34374
34374
  font-size: 24px;
34375
34375
  font-weight: 500;
34376
34376
  `;
34377
- const ModalBody = styled__default["default"].div`
34377
+ const ModalBody$1 = styled__default["default"].div`
34378
34378
  width: 100%;
34379
34379
  height: 100%;
34380
34380
  `;
@@ -34425,9 +34425,9 @@ const ModalWithOverlay = props => {
34425
34425
  width,
34426
34426
  height
34427
34427
  }
34428
- }, /*#__PURE__*/React__default["default"].createElement(ModalHeader, {
34428
+ }, /*#__PURE__*/React__default["default"].createElement(ModalHeader$1, {
34429
34429
  className: "modal-header"
34430
- }, /*#__PURE__*/React__default["default"].createElement(ModalTitle$1, null, title), /*#__PURE__*/React__default["default"].createElement(ModalButtons, {
34430
+ }, /*#__PURE__*/React__default["default"].createElement(ModalTitle$2, null, title), /*#__PURE__*/React__default["default"].createElement(ModalButtons, {
34431
34431
  className: "modal-buttons"
34432
34432
  }, showCancelButton && /*#__PURE__*/React__default["default"].createElement(Button$1, {
34433
34433
  size: "medium",
@@ -34474,7 +34474,7 @@ const ModalWithOverlay = props => {
34474
34474
  backgroundColor: okButtonColor,
34475
34475
  hoverBorderColor: okButtonHoverBackgroundColor,
34476
34476
  hoverBackgroundColor: okButtonHoverBackgroundColor
34477
- })))), /*#__PURE__*/React__default["default"].createElement(ModalBody, {
34477
+ })))), /*#__PURE__*/React__default["default"].createElement(ModalBody$1, {
34478
34478
  className: "modal-body"
34479
34479
  }, children)));
34480
34480
  };
@@ -38060,6 +38060,7 @@ const TableRow = styled__default["default"].tr`
38060
38060
  transition: all 0.3s ease;
38061
38061
  font-family: "Poppins", sans-serif;
38062
38062
  position: relative;
38063
+ background-color: ${props => props.isFocused ? props.selectedColor : "white"};
38063
38064
 
38064
38065
  &:hover {
38065
38066
  background-color: #e6f0f0;
@@ -38272,6 +38273,27 @@ const TrashIconWrapper = styled__default["default"].div`
38272
38273
  }
38273
38274
  }
38274
38275
  `;
38276
+ const CommentIconWrapper = styled__default["default"].div`
38277
+ cursor: pointer;
38278
+ transition: color 0.2s ease;
38279
+ display: inline-flex;
38280
+ align-items: center;
38281
+ justify-content: center;
38282
+ width: 100%;
38283
+ height: 100%;
38284
+ position: relative;
38285
+
38286
+ ${tooltipStyles}
38287
+
38288
+ /* Override tooltip position to move left */
38289
+ &[data-tooltip]:hover::before {
38290
+ left: calc(var(--tooltip-left, 0px) + var(--tooltip-width, 0px) / 2 - 50px);
38291
+ }
38292
+
38293
+ &[data-tooltip]:hover::after {
38294
+ left: calc(var(--tooltip-left, 0px) + var(--tooltip-width, 0px) / 2 - 50px);
38295
+ }
38296
+ `;
38275
38297
  const DisabledTrashIconWrapper = styled__default["default"].div`
38276
38298
  display: inline-flex;
38277
38299
  align-items: center;
@@ -38296,6 +38318,285 @@ const DisabledTrashIconWrapper = styled__default["default"].div`
38296
38318
  }
38297
38319
  `;
38298
38320
 
38321
+ // CommentModal.styles.js
38322
+ const ModalOverlay$1 = styled__default["default"].div`
38323
+ position: fixed;
38324
+ top: 0;
38325
+ left: 0;
38326
+ right: 0;
38327
+ bottom: 0;
38328
+ background-color: rgba(0, 0, 0, 0.5);
38329
+ display: flex;
38330
+ align-items: center;
38331
+ justify-content: center;
38332
+ z-index: 1000;
38333
+ `;
38334
+ const ModalContent = styled__default["default"].div`
38335
+ background: white;
38336
+ border-radius: 12px;
38337
+ width: 90%;
38338
+ max-width: 500px;
38339
+ max-height: 400px;
38340
+ display: flex;
38341
+ flex-direction: column;
38342
+ box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
38343
+ animation: slideUp 0.3s ease-out;
38344
+
38345
+ @keyframes slideUp {
38346
+ from {
38347
+ opacity: 0;
38348
+ transform: translateY(20px) scale(0.95);
38349
+ }
38350
+ to {
38351
+ opacity: 1;
38352
+ transform: translateY(0) scale(1);
38353
+ }
38354
+ }
38355
+ `;
38356
+ const ModalHeader = styled__default["default"].div`
38357
+ display: flex;
38358
+ justify-content: space-between;
38359
+ align-items: center;
38360
+ padding: 12px 24px;
38361
+ border-bottom: 1px solid #D9D9D9;
38362
+ flex-shrink: 0;
38363
+ `;
38364
+ const ModalTitle$1 = styled__default["default"].h5`
38365
+ font-family: "Poppins", sans-serif;
38366
+ font-size: 18px;
38367
+ font-weight: 600;
38368
+ color: #212121;
38369
+ margin: 0;
38370
+ `;
38371
+ const CloseButton$1 = styled__default["default"].button`
38372
+ background: none;
38373
+ border: none;
38374
+ padding: 8px;
38375
+ cursor: pointer;
38376
+ color: #6b7280;
38377
+ border-radius: 6px;
38378
+ transition: all 0.2s ease;
38379
+ display: flex;
38380
+ align-items: center;
38381
+ justify-content: center;
38382
+
38383
+ &:hover {
38384
+ background-color: #f3f4f6;
38385
+ color: #374151;
38386
+ }
38387
+
38388
+ &:active {
38389
+ transform: scale(0.95);
38390
+ }
38391
+ `;
38392
+ const ModalBody = styled__default["default"].div`
38393
+ padding: 20px 24px 24px;
38394
+ flex: 1;
38395
+ display: flex;
38396
+ flex-direction: column;
38397
+ overflow: hidden;
38398
+ `;
38399
+ const TextareaWrapper = styled__default["default"].div`
38400
+ position: relative;
38401
+ display: flex;
38402
+ flex-direction: column;
38403
+ flex: 1;
38404
+ `;
38405
+ const TextareaLabel = styled__default["default"].label`
38406
+ position: absolute;
38407
+ font-size: 14px;
38408
+ font-weight: 400;
38409
+ top: -10px;
38410
+ left: 25px;
38411
+ padding: 0 4px;
38412
+ background-color: white;
38413
+ color: ${props => props.color};
38414
+ transition: all 0.2s ease;
38415
+ animation: slideInLabel 0.2s ease-out;
38416
+
38417
+ @keyframes slideInLabel {
38418
+ from {
38419
+ opacity: 0;
38420
+ transform: translateY(-4px);
38421
+ }
38422
+ to {
38423
+ opacity: 1;
38424
+ transform: translateY(0);
38425
+ }
38426
+ }
38427
+ `;
38428
+ const CommentTextarea = styled__default["default"].textarea`
38429
+ width: 100%;
38430
+ min-height: 120px;
38431
+ max-height: 200px;
38432
+ padding: 12px 16px;
38433
+ outline: none;
38434
+ border: 1px solid ${props => props.$hasValue ? props.color : '#8B8989'};
38435
+ border-radius: 12px;
38436
+ font-weight: 400;
38437
+ font-size: 14px;
38438
+ line-height: 1.5;
38439
+ resize: vertical;
38440
+ box-sizing: border-box;
38441
+ transition: all 0.2s ease;
38442
+ overflow-y: auto;
38443
+ font-family: "Poppins", sans-serif;
38444
+ resize: none;
38445
+
38446
+ &:focus {
38447
+ border: 1px solid ${props => props.color};
38448
+ }
38449
+
38450
+ &::placeholder {
38451
+ color: #9ca3af;
38452
+ }
38453
+
38454
+ /* Custom scrollbar */
38455
+ &::-webkit-scrollbar {
38456
+ width: 6px;
38457
+ }
38458
+
38459
+ &::-webkit-scrollbar-track {
38460
+ background: #f1f5f9;
38461
+ border-radius: 3px;
38462
+ }
38463
+
38464
+ &::-webkit-scrollbar-thumb {
38465
+ background: #cbd5e1;
38466
+ border-radius: 3px;
38467
+ }
38468
+
38469
+ &::-webkit-scrollbar-thumb:hover {
38470
+ background: #94a3b8;
38471
+ }
38472
+ `;
38473
+ const CharacterCount = styled__default["default"].div`
38474
+ margin-top: 8px;
38475
+ font-family: "Poppins", sans-serif;
38476
+ font-size: 12px;
38477
+ font-weight: 400;
38478
+ color: #6b7280;
38479
+ text-align: right;
38480
+ transition: color 0.2s ease;
38481
+ `;
38482
+ const ModalBottom = styled__default["default"].div`
38483
+ padding: 16px 24px;
38484
+ border-top: 1px solid #D9D9D9;
38485
+ display: flex;
38486
+ gap: 16px;
38487
+ justify-content: flex-end;
38488
+ align-items: center;
38489
+ `;
38490
+
38491
+ const CommentModal = props => {
38492
+ const {
38493
+ isOpen,
38494
+ onClose,
38495
+ onSave,
38496
+ maxLength = 150,
38497
+ color = "#066768",
38498
+ saveButtonHoverColor = "#388586",
38499
+ initialValue = ''
38500
+ } = props;
38501
+ const [commentText, setCommentText] = React$1.useState('');
38502
+ const [isFocused, setIsFocused] = React$1.useState(false);
38503
+ const [hasUserInteracted, setHasUserInteracted] = React$1.useState(false); // Track if user has started typing
38504
+ const [hasInitialValue, setHasInitialValue] = React$1.useState(false); // Track if there was initial text
38505
+
38506
+ // Update comment text when modal opens with initial value
38507
+ React$1.useEffect(() => {
38508
+ if (isOpen) {
38509
+ const initialText = initialValue || '';
38510
+ setCommentText(initialText);
38511
+ setHasInitialValue(Boolean(initialText.trim())); // Check if there's actual content
38512
+ setHasUserInteracted(false); // Reset interaction state
38513
+ }
38514
+ }, [isOpen, initialValue]);
38515
+ if (!isOpen) return null;
38516
+ const handleTextChange = e => {
38517
+ const text = e.target.value;
38518
+ if (text.length <= maxLength) {
38519
+ setCommentText(text);
38520
+ if (!hasUserInteracted) {
38521
+ setHasUserInteracted(true); // Mark that user has started interacting
38522
+ }
38523
+ }
38524
+ };
38525
+ const handleOverlayClick = e => {
38526
+ if (e.target === e.currentTarget) {
38527
+ onClose();
38528
+ }
38529
+ };
38530
+ const handleSave = () => {
38531
+ if (onSave) {
38532
+ onSave(commentText);
38533
+ }
38534
+ // Don't clear the text here - let the parent handle closing
38535
+ };
38536
+ const handleClose = () => {
38537
+ setCommentText('');
38538
+ setHasUserInteracted(false);
38539
+ setHasInitialValue(false);
38540
+ onClose();
38541
+ };
38542
+ const handleFocus = () => {
38543
+ setIsFocused(true);
38544
+ };
38545
+ const handleBlur = () => {
38546
+ setIsFocused(false);
38547
+ };
38548
+
38549
+ // Determine if save button should be enabled
38550
+ const isSaveEnabled = hasUserInteracted && (commentText.length > 0 || hasInitialValue);
38551
+ return /*#__PURE__*/React__default["default"].createElement(ModalOverlay$1, {
38552
+ onClick: handleOverlayClick
38553
+ }, /*#__PURE__*/React__default["default"].createElement(ModalContent, null, /*#__PURE__*/React__default["default"].createElement(ModalHeader, null, /*#__PURE__*/React__default["default"].createElement(ModalTitle$1, null, "Add Comment"), /*#__PURE__*/React__default["default"].createElement(CloseButton$1, {
38554
+ onClick: handleClose
38555
+ }, /*#__PURE__*/React__default["default"].createElement("svg", {
38556
+ width: "24",
38557
+ height: "24",
38558
+ viewBox: "0 0 24 24",
38559
+ fill: "none"
38560
+ }, /*#__PURE__*/React__default["default"].createElement("path", {
38561
+ d: "M18 6L6 18M6 6l12 12",
38562
+ stroke: "currentColor",
38563
+ strokeWidth: "2",
38564
+ strokeLinecap: "round",
38565
+ strokeLinejoin: "round"
38566
+ })))), /*#__PURE__*/React__default["default"].createElement(ModalBody, null, /*#__PURE__*/React__default["default"].createElement(TextareaWrapper, null, (commentText.length > 0 || isFocused) && /*#__PURE__*/React__default["default"].createElement(TextareaLabel, {
38567
+ color: color
38568
+ }, "Comment"), /*#__PURE__*/React__default["default"].createElement(CommentTextarea, {
38569
+ value: commentText,
38570
+ onChange: handleTextChange,
38571
+ placeholder: "Type a Comment...",
38572
+ maxLength: maxLength,
38573
+ color: color,
38574
+ $hasValue: commentText.length > 0,
38575
+ onBlur: handleBlur,
38576
+ onFocus: handleFocus
38577
+ }), /*#__PURE__*/React__default["default"].createElement(CharacterCount, null, commentText.length, "/", maxLength))), /*#__PURE__*/React__default["default"].createElement(ModalBottom, null, /*#__PURE__*/React__default["default"].createElement(Button$1, {
38578
+ text: "Cancel",
38579
+ type: "secondary",
38580
+ size: "medium",
38581
+ borderColor: "#D3D3D3",
38582
+ hoverTextColor: "#212121",
38583
+ hoverBackgroundColor: "#E6F0F0",
38584
+ hoverBorderColor: "#D3D3D3",
38585
+ onClick: handleClose
38586
+ }), /*#__PURE__*/React__default["default"].createElement(Button$1, {
38587
+ text: "Save",
38588
+ size: "medium",
38589
+ disabled: !isSaveEnabled,
38590
+ hoverTextColor: "#ffffff",
38591
+ disabledTextColor: "#ffffff",
38592
+ borderColor: color,
38593
+ backgroundColor: color,
38594
+ hoverBorderColor: saveButtonHoverColor,
38595
+ hoverBackgroundColor: saveButtonHoverColor,
38596
+ onClick: handleSave
38597
+ }))));
38598
+ };
38599
+
38299
38600
  // OkIcon.jsx
38300
38601
  const OkIcon = _ref => {
38301
38602
  let {
@@ -38314,6 +38615,30 @@ const OkIcon = _ref => {
38314
38615
  }));
38315
38616
  };
38316
38617
 
38618
+ const CommentIcon = ({
38619
+ width = '15',
38620
+ height = '15',
38621
+ showCircle = false,
38622
+ circleColor = '#066768'
38623
+ }) => /*#__PURE__*/React__default["default"].createElement("svg", {
38624
+ xmlns: "http://www.w3.org/2000/svg",
38625
+ width: width,
38626
+ height: height,
38627
+ viewBox: "0 0 15 15",
38628
+ fill: "none"
38629
+ }, showCircle ? /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("path", {
38630
+ d: "M7.41699 1C7.2371 1.41164 7.1112 1.85196 7.04785 2.3125H1.75C1.5094 2.3125 1.31254 2.5094 1.3125 2.75V10.625C1.3125 10.8656 1.50937 11.0625 1.75 11.0625H4.375C5.09961 11.0625 5.6875 11.6513 5.6875 12.376V12.8135L7.66992 11.3252C7.89675 11.1558 8.17284 11.0626 8.45703 11.0625H12.25C12.4906 11.0625 12.6875 10.8656 12.6875 10.625V7.95117C13.148 7.88782 13.5884 7.76288 14 7.58301V10.625C14 11.5903 13.2152 12.376 12.25 12.376H8.45703L5.6875 14.4541L5.68164 14.459L5.54297 14.5635L5.0752 14.9131C4.94395 15.0115 4.76562 15.0279 4.61523 14.9541C4.46515 14.8803 4.37514 14.73 4.375 14.5635V12.376H1.75C0.784766 12.376 0 11.5903 0 10.625V2.75C4.08976e-05 1.78476 0.784791 1 1.75 1H7.41699Z",
38631
+ fill: "#212121"
38632
+ }), /*#__PURE__*/React__default["default"].createElement("circle", {
38633
+ cx: "12",
38634
+ cy: "3",
38635
+ r: "3",
38636
+ fill: circleColor
38637
+ })) : /*#__PURE__*/React__default["default"].createElement("path", {
38638
+ d: "M4.375 10.0629C5.09961 10.0629 5.6875 10.6509 5.6875 11.3755V11.813L7.66992 10.3254C7.89687 10.1559 8.17305 10.0629 8.45742 10.0629H12.25C12.4906 10.0629 12.6875 9.86605 12.6875 9.62541V1.75008C12.6875 1.50944 12.4906 1.31256 12.25 1.31256H1.75C1.50937 1.31256 1.3125 1.50944 1.3125 1.75008V9.62541C1.3125 9.86605 1.50937 10.0629 1.75 10.0629H4.375ZM5.6875 13.4537L5.68203 13.4592L5.54258 13.5631L5.075 13.9131C4.94375 14.0115 4.76602 14.0279 4.61562 13.9541C4.46523 13.8803 4.375 13.7299 4.375 13.5631V12.9806V12.8056V12.7974V12.688V11.3755H3.0625H1.75C0.784766 11.3755 0 10.5907 0 9.62541V1.75008C0 0.784799 0.784766 0 1.75 0H12.25C13.2152 0 14 0.784799 14 1.75008V9.62541C14 10.5907 13.2152 11.3755 12.25 11.3755H8.45742L5.6875 13.4537Z",
38639
+ fill: "#212121"
38640
+ }));
38641
+
38317
38642
  // TrashIcon.jsx
38318
38643
  const TrashIcon = ({
38319
38644
  width = "14",
@@ -38354,27 +38679,31 @@ const DisabledTrashIcon = ({
38354
38679
  };
38355
38680
 
38356
38681
  // TableBody.jsx
38357
- const TableBody = /*#__PURE__*/React$1.forwardRef(({
38682
+ const TableBody = ({
38358
38683
  columns,
38359
38684
  data,
38360
38685
  onRowClick,
38361
38686
  onSendClick,
38362
38687
  buttonColor,
38363
38688
  onDeleteClick,
38689
+ selectedColor,
38364
38690
  resetFocus = false,
38365
38691
  onFocusChange,
38366
- indexToShimmer = 0
38367
- }, ref) => {
38692
+ indexToShimmer = 0,
38693
+ onCommentSave = () => {},
38694
+ ref = null
38695
+ }) => {
38368
38696
  const [hoveredRowIndex, setHoveredRowIndex] = React$1.useState(null);
38369
38697
  const [focusedRowIndex, setFocusedRowIndex] = React$1.useState(null);
38698
+ const [isCommentModalOpen, setIsCommentModalOpen] = React$1.useState(false);
38699
+ const [currentCommentRow, setCurrentCommentRow] = React$1.useState(null); // Track which row is being edited
38370
38700
 
38371
- // Expose methods to parent components via ref
38372
- React$1.useImperativeHandle(ref, () => ({
38373
- clearFocus: () => setFocusedRowIndex(null),
38374
- getFocusedRowIndex: () => focusedRowIndex
38375
- }));
38701
+ // Expose methods to parent components via ref (if ref is provided)
38702
+ // useImperativeHandle(ref, () => ({
38703
+ // clearFocus: () => setFocusedRowIndex(null),
38704
+ // getFocusedRowIndex: () => focusedRowIndex
38705
+ // }), [focusedRowIndex]);
38376
38706
 
38377
- // Handle resetFocus prop
38378
38707
  React$1.useEffect(() => {
38379
38708
  if (resetFocus) {
38380
38709
  setFocusedRowIndex(null);
@@ -38382,11 +38711,11 @@ const TableBody = /*#__PURE__*/React$1.forwardRef(({
38382
38711
  }, [resetFocus]);
38383
38712
 
38384
38713
  // Notify parent of focus changes
38385
- React$1.useEffect(() => {
38386
- if (onFocusChange) {
38387
- onFocusChange(focusedRowIndex);
38388
- }
38389
- }, [focusedRowIndex, onFocusChange]);
38714
+ // useEffect(() => {
38715
+ // if (onFocusChange) {
38716
+ // onFocusChange(focusedRowIndex);
38717
+ // }
38718
+ // }, [focusedRowIndex, onFocusChange]);
38390
38719
 
38391
38720
  // Handle row click for focus state
38392
38721
  const handleRowClick = (row, rowIndex) => {
@@ -38396,6 +38725,21 @@ const TableBody = /*#__PURE__*/React$1.forwardRef(({
38396
38725
  }
38397
38726
  };
38398
38727
 
38728
+ // Handle comment save
38729
+ const handleCommentSave = commentText => {
38730
+ if (currentCommentRow !== null) {
38731
+ onCommentSave(currentCommentRow, commentText);
38732
+ }
38733
+ setCurrentCommentRow(null);
38734
+ setIsCommentModalOpen(false);
38735
+ };
38736
+
38737
+ // Handle comment modal close
38738
+ const handleCommentModalClose = () => {
38739
+ setCurrentCommentRow(null);
38740
+ setIsCommentModalOpen(false);
38741
+ };
38742
+
38399
38743
  // Function to calculate tooltip height based on text length
38400
38744
  const calculateTooltipOffset = (text, isRegularCell = false) => {
38401
38745
  if (!text) return {
@@ -38531,6 +38875,49 @@ const TableBody = /*#__PURE__*/React$1.forwardRef(({
38531
38875
  }), /*#__PURE__*/React__default["default"].createElement("span", null, "All Sent"));
38532
38876
  }
38533
38877
  return value;
38878
+ case 'comments':
38879
+ const commentText = value || '';
38880
+ const hasComments = commentText.trim().length > 0;
38881
+
38882
+ // Truncate tooltip text if longer than 150 characters
38883
+ const commentTooltipText = commentText.length > 150 ? commentText.substring(0, 147) + '...' : commentText;
38884
+ return /*#__PURE__*/React__default["default"].createElement(CommentIconWrapper, {
38885
+ $buttonColor: buttonColor,
38886
+ ref: el => {
38887
+ if (el) {
38888
+ if (hasComments) {
38889
+ // Add tooltip if there are comments
38890
+ const rect = el.getBoundingClientRect();
38891
+ const {
38892
+ offset,
38893
+ height
38894
+ } = calculateTooltipOffset(commentTooltipText);
38895
+ el.style.setProperty('--tooltip-top', `${rect.top}px`);
38896
+ el.style.setProperty('--tooltip-left', `${rect.left}px`);
38897
+ el.style.setProperty('--tooltip-width', `${rect.width}px`);
38898
+ el.style.setProperty('--tooltip-offset', `${offset}px`);
38899
+ el.style.setProperty('--tooltip-height', `${height}px`);
38900
+ el.setAttribute('data-tooltip', commentTooltipText);
38901
+ } else {
38902
+ // Remove tooltip if there are no comments
38903
+ el.removeAttribute('data-tooltip');
38904
+ el.style.removeProperty('--tooltip-top');
38905
+ el.style.removeProperty('--tooltip-left');
38906
+ el.style.removeProperty('--tooltip-width');
38907
+ el.style.removeProperty('--tooltip-offset');
38908
+ el.style.removeProperty('--tooltip-height');
38909
+ }
38910
+ }
38911
+ },
38912
+ onClick: e => {
38913
+ e.stopPropagation();
38914
+ setCurrentCommentRow(rowIndex);
38915
+ setIsCommentModalOpen(true);
38916
+ }
38917
+ }, /*#__PURE__*/React__default["default"].createElement(CommentIcon, {
38918
+ showCircle: hasComments,
38919
+ circleColor: "#066768"
38920
+ }));
38534
38921
  case 'trash':
38535
38922
  // Only show trash icon when row is hovered
38536
38923
  if (hoveredRowIndex !== rowIndex) {
@@ -38594,11 +38981,12 @@ const TableBody = /*#__PURE__*/React$1.forwardRef(({
38594
38981
  const shouldShowTooltip = (element, content) => {
38595
38982
  return element && element.scrollWidth > element.clientWidth;
38596
38983
  };
38597
- return /*#__PURE__*/React__default["default"].createElement(StyledTableBody, null, data.map((row, rowIndex) => /*#__PURE__*/React__default["default"].createElement(TableRow, {
38984
+ return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(StyledTableBody, null, data.map((row, rowIndex) => /*#__PURE__*/React__default["default"].createElement(TableRow, {
38598
38985
  key: rowIndex,
38599
38986
  "data-row-index": rowIndex,
38600
38987
  className: indexToShimmer === rowIndex ? 'shimmer-row' : '',
38601
- $isFocused: focusedRowIndex === rowIndex,
38988
+ isFocused: focusedRowIndex === rowIndex,
38989
+ selectedColor: selectedColor,
38602
38990
  onMouseEnter: () => setHoveredRowIndex(rowIndex),
38603
38991
  onMouseLeave: () => setHoveredRowIndex(null),
38604
38992
  onClick: () => handleRowClick(row, rowIndex)
@@ -38627,8 +39015,13 @@ const TableBody = /*#__PURE__*/React$1.forwardRef(({
38627
39015
  $minWidth: column.minWidth,
38628
39016
  $maxWidth: column.maxWidth
38629
39017
  }, formattedValue);
38630
- }))));
38631
- });
39018
+ })))), /*#__PURE__*/React__default["default"].createElement(CommentModal, {
39019
+ isOpen: isCommentModalOpen,
39020
+ onClose: handleCommentModalClose,
39021
+ onSave: handleCommentSave,
39022
+ initialValue: currentCommentRow !== null ? data[currentCommentRow]?.Comments || '' : ''
39023
+ }));
39024
+ };
38632
39025
  TableBody.propTypes = {
38633
39026
  columns: PropTypes.array.isRequired,
38634
39027
  data: PropTypes.array.isRequired,
@@ -38638,7 +39031,9 @@ TableBody.propTypes = {
38638
39031
  onDeleteClick: PropTypes.func,
38639
39032
  resetFocus: PropTypes.bool,
38640
39033
  onFocusChange: PropTypes.func,
38641
- indexToShimmer: PropTypes.number
39034
+ indexToShimmer: PropTypes.number,
39035
+ onCommentSave: PropTypes.func,
39036
+ ref: PropTypes.object
38642
39037
  };
38643
39038
  TableBody.displayName = 'TableBody';
38644
39039
 
@@ -41809,7 +42204,7 @@ var Lottie = function Lottie(props) {
41809
42204
  };
41810
42205
 
41811
42206
  // Table.jsx
41812
- const Table = /*#__PURE__*/React$1.forwardRef((props, ref) => {
42207
+ const Table = props => {
41813
42208
  const {
41814
42209
  width = '100%',
41815
42210
  height = 'auto',
@@ -41820,7 +42215,6 @@ const Table = /*#__PURE__*/React$1.forwardRef((props, ref) => {
41820
42215
  onButtonClick = () => {},
41821
42216
  buttonColor = '#066768',
41822
42217
  buttonHoverColor = '#388586',
41823
- // Updated props for new table structure
41824
42218
  columns = [],
41825
42219
  onRowClick = () => {},
41826
42220
  onSort,
@@ -41830,6 +42224,7 @@ const Table = /*#__PURE__*/React$1.forwardRef((props, ref) => {
41830
42224
  onSideButtonClick = () => {},
41831
42225
  sideButtonColor = '#066768',
41832
42226
  sideButtonHoverColor = '#388586',
42227
+ selectedColor = '#B4D1D2',
41833
42228
  children = null,
41834
42229
  tableBodyHeight = '728px',
41835
42230
  isLoading = false,
@@ -41849,7 +42244,10 @@ const Table = /*#__PURE__*/React$1.forwardRef((props, ref) => {
41849
42244
  clearFocusOnOutsideClick = true,
41850
42245
  // NEW: Props for edit mode focus management
41851
42246
  isEditMode = false,
41852
- editRowIndex = -1
42247
+ editRowIndex = -1,
42248
+ onCommentSave = () => {},
42249
+ // Accept ref as a regular prop
42250
+ ref = null
41853
42251
  } = props;
41854
42252
  const scrollWrapperRef = React$1.useRef(null);
41855
42253
  const tableBodyRef = React$1.useRef(null);
@@ -41868,11 +42266,16 @@ const Table = /*#__PURE__*/React$1.forwardRef((props, ref) => {
41868
42266
  onTableFocusChange(focusedRowIndex);
41869
42267
  };
41870
42268
 
41871
- // Expose methods to parent components via ref
42269
+ // Handle comment save - pass through to parent
42270
+ const handleCommentSave = (rowIndex, commentText) => {
42271
+ onCommentSave(rowIndex, commentText);
42272
+ };
42273
+
42274
+ // Expose methods to parent components via ref (if ref is provided)
41872
42275
  React$1.useImperativeHandle(ref, () => ({
41873
42276
  clearTableFocus,
41874
42277
  getTableBodyRef: () => tableBodyRef.current
41875
- }));
42278
+ }), []);
41876
42279
  React$1.useEffect(() => {
41877
42280
  const scrollWrapper = scrollWrapperRef.current;
41878
42281
  if (!scrollWrapper || !onLastRowsReached) return;
@@ -41950,9 +42353,11 @@ const Table = /*#__PURE__*/React$1.forwardRef((props, ref) => {
41950
42353
  columns: columns,
41951
42354
  indexToShimmer: indexToShimmer,
41952
42355
  data: data,
42356
+ selectedColor: selectedColor,
41953
42357
  onRowClick: onRowClick,
41954
42358
  onSendClick: onSendClick,
41955
42359
  onDeleteClick: onDeleteClick,
42360
+ onCommentSave: handleCommentSave,
41956
42361
  buttonColor: buttonColor,
41957
42362
  resetFocus: resetTableFocus,
41958
42363
  onFocusChange: handleTableFocusChange
@@ -41974,7 +42379,7 @@ const Table = /*#__PURE__*/React$1.forwardRef((props, ref) => {
41974
42379
  animationData: LoadingAnimation,
41975
42380
  loop: true
41976
42381
  }), /*#__PURE__*/React__default["default"].createElement(LoadingText, null, isLoadingText)))));
41977
- });
42382
+ };
41978
42383
 
41979
42384
  // Add displayName for better debugging
41980
42385
  Table.displayName = 'Table';