sag_components 2.0.0-beta141 → 2.0.0-beta143

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.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- import React$1, { useState, useRef, useEffect, useMemo, useCallback, forwardRef, useImperativeHandle } from 'react';
1
+ import React$1, { useState, useRef, useEffect, useMemo, useCallback, useImperativeHandle } from 'react';
2
2
  import styled, { keyframes, css } from 'styled-components';
3
3
  import { ResponsiveContainer, PieChart as PieChart$1, Pie, Cell, Tooltip as Tooltip$3, BarChart as BarChart$1, CartesianGrid, XAxis, YAxis, Bar, LabelList, ReferenceLine, LineChart, Line, AreaChart as AreaChart$1, Legend, Area, ScatterChart, ZAxis, Scatter, Brush, ComposedChart } from 'recharts';
4
4
  import Skeleton, { SkeletonTheme } from 'react-loading-skeleton';
@@ -13070,17 +13070,17 @@ const Modal$1 = styled.div`
13070
13070
  margin: 0 auto;
13071
13071
  ${scrollableStyles$a}
13072
13072
  `;
13073
- const ModalHeader$1 = styled.div`
13073
+ const ModalHeader$2 = styled.div`
13074
13074
  display: flex;
13075
13075
  align-items: center;
13076
13076
  justify-content: space-between;
13077
13077
  margin-bottom: 32px;
13078
13078
  `;
13079
- const ModalBody$1 = styled.div`
13079
+ const ModalBody$2 = styled.div`
13080
13080
  ${scrollableStyles$a}
13081
13081
  max-height: 80vh;
13082
13082
  `;
13083
- const ModalTitle$2 = styled.h5`
13083
+ const ModalTitle$3 = styled.h5`
13084
13084
  font-family: 'Poppins', sans-serif;
13085
13085
  font-size: 32px;
13086
13086
  font-weight: 500;
@@ -13112,12 +13112,12 @@ const DialogOverlay$1 = props => {
13112
13112
  };
13113
13113
  return /*#__PURE__*/React.createElement(ModalWrapper$1, {
13114
13114
  className: className
13115
- }, /*#__PURE__*/React.createElement(Modal$1, null, /*#__PURE__*/React.createElement(ModalHeader$1, null, /*#__PURE__*/React.createElement(ModalTitle$2, null, title), /*#__PURE__*/React.createElement(ModalClose, {
13115
+ }, /*#__PURE__*/React.createElement(Modal$1, null, /*#__PURE__*/React.createElement(ModalHeader$2, null, /*#__PURE__*/React.createElement(ModalTitle$3, null, title), /*#__PURE__*/React.createElement(ModalClose, {
13116
13116
  type: "button",
13117
13117
  onClick: closeModal
13118
13118
  }, /*#__PURE__*/React.createElement(CloseXIcon, {
13119
13119
  fill: "white"
13120
- }))), /*#__PURE__*/React.createElement(ModalBody$1, {
13120
+ }))), /*#__PURE__*/React.createElement(ModalBody$2, {
13121
13121
  id: "modalBody"
13122
13122
  }, children)));
13123
13123
  };
@@ -27209,7 +27209,7 @@ const scrollableStyles$6 = `
27209
27209
  }
27210
27210
  `;
27211
27211
  const MainContainer$1 = styled.div``;
27212
- const ModalOverlay$1 = styled.div`
27212
+ const ModalOverlay$2 = styled.div`
27213
27213
  position: fixed;
27214
27214
  z-index: 100;
27215
27215
  top: 0;
@@ -27221,7 +27221,7 @@ const ModalOverlay$1 = styled.div`
27221
27221
  justify-content: center;
27222
27222
  align-items: center;
27223
27223
  `;
27224
- const ModalContent$1 = styled.div`
27224
+ const ModalContent$2 = styled.div`
27225
27225
  font-family: "Poppins", sans-serif;
27226
27226
  font-weight: 500;
27227
27227
  font-size: 18px;
@@ -27451,10 +27451,10 @@ const PopupCharts = props => {
27451
27451
  }, displayChart(item)));
27452
27452
  return /*#__PURE__*/React$1.createElement(MainContainer$1, {
27453
27453
  id: "MainContainer"
27454
- }, IsPopupChartsOpen && /*#__PURE__*/React$1.createElement(ModalOverlay$1, {
27454
+ }, IsPopupChartsOpen && /*#__PURE__*/React$1.createElement(ModalOverlay$2, {
27455
27455
  id: "ModalOverlay",
27456
27456
  className: "modal-overlay"
27457
- }, /*#__PURE__*/React$1.createElement(ModalContent$1, {
27457
+ }, /*#__PURE__*/React$1.createElement(ModalContent$2, {
27458
27458
  id: "ModalContent",
27459
27459
  ref: divRef,
27460
27460
  className: "modal-content",
@@ -33807,7 +33807,7 @@ const Overlay$2 = styled.div`
33807
33807
  align-items: center;
33808
33808
  z-index: 999;
33809
33809
  `;
33810
- const ModalContent = styled.div`
33810
+ const ModalContent$1 = styled.div`
33811
33811
  position: absolute;
33812
33812
  width: 70%;
33813
33813
  height: 80%;
@@ -33833,7 +33833,7 @@ const Header$3 = styled.div`
33833
33833
  align-items: flex-start;
33834
33834
  }
33835
33835
  `;
33836
- const CloseButton$1 = styled.button`
33836
+ const CloseButton$2 = styled.button`
33837
33837
  position: absolute;
33838
33838
  top: -10px;
33839
33839
  right: 0px;
@@ -34030,11 +34030,11 @@ const InsightsCarousel = _ref => {
34030
34030
  const nextIndex = (currentIndex + 1) % totalChildren;
34031
34031
  return /*#__PURE__*/React$1.createElement(Overlay$2, {
34032
34032
  className: className
34033
- }, /*#__PURE__*/React$1.createElement(ModalContent, null, /*#__PURE__*/React$1.createElement(Header$3, null, /*#__PURE__*/React$1.createElement(Title$8, {
34033
+ }, /*#__PURE__*/React$1.createElement(ModalContent$1, null, /*#__PURE__*/React$1.createElement(Header$3, null, /*#__PURE__*/React$1.createElement(Title$8, {
34034
34034
  $titleColor: titleColor
34035
34035
  }, /*#__PURE__*/React$1.cloneElement(icon, {
34036
34036
  fill: iconColor
34037
- }), title), /*#__PURE__*/React$1.createElement(CloseButton$1, {
34037
+ }), title), /*#__PURE__*/React$1.createElement(CloseButton$2, {
34038
34038
  onClick: () => onClose?.({
34039
34039
  label: "closeCarousel"
34040
34040
  }),
@@ -34351,7 +34351,7 @@ const Modal = styled.div`
34351
34351
  border-radius: 12px;
34352
34352
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
34353
34353
  `;
34354
- const ModalHeader = styled.div`
34354
+ const ModalHeader$1 = styled.div`
34355
34355
  display: flex;
34356
34356
  justify-content: space-between;
34357
34357
  `;
@@ -34359,12 +34359,12 @@ const ModalButtons = styled.div`
34359
34359
  display: flex;
34360
34360
  gap: 10px;
34361
34361
  `;
34362
- const ModalTitle$1 = styled.h3`
34362
+ const ModalTitle$2 = styled.h3`
34363
34363
  margin: 0;
34364
34364
  font-size: 24px;
34365
34365
  font-weight: 500;
34366
34366
  `;
34367
- const ModalBody = styled.div`
34367
+ const ModalBody$1 = styled.div`
34368
34368
  width: 100%;
34369
34369
  height: 100%;
34370
34370
  `;
@@ -34415,9 +34415,9 @@ const ModalWithOverlay = props => {
34415
34415
  width,
34416
34416
  height
34417
34417
  }
34418
- }, /*#__PURE__*/React$1.createElement(ModalHeader, {
34418
+ }, /*#__PURE__*/React$1.createElement(ModalHeader$1, {
34419
34419
  className: "modal-header"
34420
- }, /*#__PURE__*/React$1.createElement(ModalTitle$1, null, title), /*#__PURE__*/React$1.createElement(ModalButtons, {
34420
+ }, /*#__PURE__*/React$1.createElement(ModalTitle$2, null, title), /*#__PURE__*/React$1.createElement(ModalButtons, {
34421
34421
  className: "modal-buttons"
34422
34422
  }, showCancelButton && /*#__PURE__*/React$1.createElement(Button$1, {
34423
34423
  size: "medium",
@@ -34464,7 +34464,7 @@ const ModalWithOverlay = props => {
34464
34464
  backgroundColor: okButtonColor,
34465
34465
  hoverBorderColor: okButtonHoverBackgroundColor,
34466
34466
  hoverBackgroundColor: okButtonHoverBackgroundColor
34467
- })))), /*#__PURE__*/React$1.createElement(ModalBody, {
34467
+ })))), /*#__PURE__*/React$1.createElement(ModalBody$1, {
34468
34468
  className: "modal-body"
34469
34469
  }, children)));
34470
34470
  };
@@ -38050,6 +38050,7 @@ const TableRow = styled.tr`
38050
38050
  transition: all 0.3s ease;
38051
38051
  font-family: "Poppins", sans-serif;
38052
38052
  position: relative;
38053
+ background-color: ${props => props.isFocused ? props.selectedColor : "white"};
38053
38054
 
38054
38055
  &:hover {
38055
38056
  background-color: #e6f0f0;
@@ -38262,6 +38263,27 @@ const TrashIconWrapper = styled.div`
38262
38263
  }
38263
38264
  }
38264
38265
  `;
38266
+ const CommentIconWrapper = styled.div`
38267
+ cursor: pointer;
38268
+ transition: color 0.2s ease;
38269
+ display: inline-flex;
38270
+ align-items: center;
38271
+ justify-content: center;
38272
+ width: 100%;
38273
+ height: 100%;
38274
+ position: relative;
38275
+
38276
+ ${tooltipStyles}
38277
+
38278
+ /* Override tooltip position to move left */
38279
+ &[data-tooltip]:hover::before {
38280
+ left: calc(var(--tooltip-left, 0px) + var(--tooltip-width, 0px) / 2 - 50px);
38281
+ }
38282
+
38283
+ &[data-tooltip]:hover::after {
38284
+ left: calc(var(--tooltip-left, 0px) + var(--tooltip-width, 0px) / 2 - 50px);
38285
+ }
38286
+ `;
38265
38287
  const DisabledTrashIconWrapper = styled.div`
38266
38288
  display: inline-flex;
38267
38289
  align-items: center;
@@ -38285,6 +38307,300 @@ const DisabledTrashIconWrapper = styled.div`
38285
38307
  color: #d9d9d9;
38286
38308
  }
38287
38309
  `;
38310
+ const StatusCell = styled.div`
38311
+ font-size: 12px;
38312
+ font-weight: 500;
38313
+ display: flex;
38314
+ align-items: center;
38315
+ gap: 6px;
38316
+ color: ${props => props.color || "#000"};
38317
+ `;
38318
+ const StatusCellCircle = styled.div`
38319
+ width: 8px;
38320
+ height: 8px;
38321
+ border-radius: 50%;
38322
+ border: 1px solid white;
38323
+ background-color: ${props => props.backgroundColor};
38324
+ `;
38325
+
38326
+ // CommentModal.styles.js
38327
+ const ModalOverlay$1 = styled.div`
38328
+ position: fixed;
38329
+ top: 0;
38330
+ left: 0;
38331
+ right: 0;
38332
+ bottom: 0;
38333
+ background-color: rgba(0, 0, 0, 0.5);
38334
+ display: flex;
38335
+ align-items: center;
38336
+ justify-content: center;
38337
+ z-index: 1000;
38338
+ `;
38339
+ const ModalContent = styled.div`
38340
+ background: white;
38341
+ border-radius: 12px;
38342
+ width: 90%;
38343
+ max-width: 500px;
38344
+ max-height: 400px;
38345
+ display: flex;
38346
+ flex-direction: column;
38347
+ box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
38348
+ animation: slideUp 0.3s ease-out;
38349
+
38350
+ @keyframes slideUp {
38351
+ from {
38352
+ opacity: 0;
38353
+ transform: translateY(20px) scale(0.95);
38354
+ }
38355
+ to {
38356
+ opacity: 1;
38357
+ transform: translateY(0) scale(1);
38358
+ }
38359
+ }
38360
+ `;
38361
+ const ModalHeader = styled.div`
38362
+ display: flex;
38363
+ justify-content: space-between;
38364
+ align-items: center;
38365
+ padding: 12px 24px;
38366
+ border-bottom: 1px solid #D9D9D9;
38367
+ flex-shrink: 0;
38368
+ `;
38369
+ const ModalTitle$1 = styled.h5`
38370
+ font-family: "Poppins", sans-serif;
38371
+ font-size: 18px;
38372
+ font-weight: 600;
38373
+ color: #212121;
38374
+ margin: 0;
38375
+ `;
38376
+ const CloseButton$1 = styled.button`
38377
+ background: none;
38378
+ border: none;
38379
+ padding: 8px;
38380
+ cursor: pointer;
38381
+ color: #6b7280;
38382
+ border-radius: 6px;
38383
+ transition: all 0.2s ease;
38384
+ display: flex;
38385
+ align-items: center;
38386
+ justify-content: center;
38387
+
38388
+ &:hover {
38389
+ background-color: #f3f4f6;
38390
+ color: #374151;
38391
+ }
38392
+
38393
+ &:active {
38394
+ transform: scale(0.95);
38395
+ }
38396
+ `;
38397
+ const ModalBody = styled.div`
38398
+ padding: 20px 24px 24px;
38399
+ flex: 1;
38400
+ display: flex;
38401
+ flex-direction: column;
38402
+ overflow: hidden;
38403
+ `;
38404
+ const TextareaWrapper = styled.div`
38405
+ position: relative;
38406
+ display: flex;
38407
+ flex-direction: column;
38408
+ flex: 1;
38409
+ `;
38410
+ const TextareaLabel = styled.label`
38411
+ position: absolute;
38412
+ font-size: 14px;
38413
+ font-weight: 400;
38414
+ top: -10px;
38415
+ left: 25px;
38416
+ padding: 0 4px;
38417
+ background-color: white;
38418
+ color: ${props => props.color};
38419
+ transition: all 0.2s ease;
38420
+ animation: slideInLabel 0.2s ease-out;
38421
+
38422
+ @keyframes slideInLabel {
38423
+ from {
38424
+ opacity: 0;
38425
+ transform: translateY(-4px);
38426
+ }
38427
+ to {
38428
+ opacity: 1;
38429
+ transform: translateY(0);
38430
+ }
38431
+ }
38432
+ `;
38433
+ const CommentTextarea = styled.textarea`
38434
+ width: 100%;
38435
+ min-height: 120px;
38436
+ max-height: 200px;
38437
+ padding: 12px 16px;
38438
+ outline: none;
38439
+ border: 1px solid ${props => props.$hasValue ? props.color : '#8B8989'};
38440
+ border-radius: 12px;
38441
+ font-weight: 400;
38442
+ font-size: 14px;
38443
+ line-height: 1.5;
38444
+ resize: vertical;
38445
+ box-sizing: border-box;
38446
+ transition: all 0.2s ease;
38447
+ overflow-y: auto;
38448
+ font-family: "Poppins", sans-serif;
38449
+ resize: none;
38450
+
38451
+ &:focus {
38452
+ border: 1px solid ${props => props.color};
38453
+ }
38454
+
38455
+ &::placeholder {
38456
+ color: #9ca3af;
38457
+ }
38458
+
38459
+ /* Custom scrollbar */
38460
+ &::-webkit-scrollbar {
38461
+ width: 6px;
38462
+ }
38463
+
38464
+ &::-webkit-scrollbar-track {
38465
+ background: #f1f5f9;
38466
+ border-radius: 3px;
38467
+ }
38468
+
38469
+ &::-webkit-scrollbar-thumb {
38470
+ background: #cbd5e1;
38471
+ border-radius: 3px;
38472
+ }
38473
+
38474
+ &::-webkit-scrollbar-thumb:hover {
38475
+ background: #94a3b8;
38476
+ }
38477
+ `;
38478
+ const CharacterCount = styled.div`
38479
+ margin-top: 8px;
38480
+ font-family: "Poppins", sans-serif;
38481
+ font-size: 12px;
38482
+ font-weight: 400;
38483
+ color: #6b7280;
38484
+ text-align: right;
38485
+ transition: color 0.2s ease;
38486
+ `;
38487
+ const ModalBottom = styled.div`
38488
+ padding: 16px 24px;
38489
+ border-top: 1px solid #D9D9D9;
38490
+ display: flex;
38491
+ gap: 16px;
38492
+ justify-content: flex-end;
38493
+ align-items: center;
38494
+ `;
38495
+
38496
+ const CommentModal = props => {
38497
+ const {
38498
+ isOpen,
38499
+ onClose,
38500
+ onSave,
38501
+ maxLength = 150,
38502
+ color = "#066768",
38503
+ saveButtonHoverColor = "#388586",
38504
+ initialValue = ''
38505
+ } = props;
38506
+ const [commentText, setCommentText] = useState('');
38507
+ const [isFocused, setIsFocused] = useState(false);
38508
+ const [hasUserInteracted, setHasUserInteracted] = useState(false); // Track if user has started typing
38509
+ const [hasInitialValue, setHasInitialValue] = useState(false); // Track if there was initial text
38510
+
38511
+ // Update comment text when modal opens with initial value
38512
+ useEffect(() => {
38513
+ if (isOpen) {
38514
+ const initialText = initialValue || '';
38515
+ setCommentText(initialText);
38516
+ setHasInitialValue(Boolean(initialText.trim())); // Check if there's actual content
38517
+ setHasUserInteracted(false); // Reset interaction state
38518
+ }
38519
+ }, [isOpen, initialValue]);
38520
+ if (!isOpen) return null;
38521
+ const handleTextChange = e => {
38522
+ const text = e.target.value;
38523
+ if (text.length <= maxLength) {
38524
+ setCommentText(text);
38525
+ if (!hasUserInteracted) {
38526
+ setHasUserInteracted(true); // Mark that user has started interacting
38527
+ }
38528
+ }
38529
+ };
38530
+ const handleOverlayClick = e => {
38531
+ if (e.target === e.currentTarget) {
38532
+ onClose();
38533
+ }
38534
+ };
38535
+ const handleSave = () => {
38536
+ if (onSave) {
38537
+ onSave(commentText);
38538
+ }
38539
+ // Don't clear the text here - let the parent handle closing
38540
+ };
38541
+ const handleClose = () => {
38542
+ setCommentText('');
38543
+ setHasUserInteracted(false);
38544
+ setHasInitialValue(false);
38545
+ onClose();
38546
+ };
38547
+ const handleFocus = () => {
38548
+ setIsFocused(true);
38549
+ };
38550
+ const handleBlur = () => {
38551
+ setIsFocused(false);
38552
+ };
38553
+
38554
+ // Determine if save button should be enabled
38555
+ const isSaveEnabled = hasUserInteracted && (commentText.length > 0 || hasInitialValue);
38556
+ return /*#__PURE__*/React$1.createElement(ModalOverlay$1, {
38557
+ onClick: handleOverlayClick
38558
+ }, /*#__PURE__*/React$1.createElement(ModalContent, null, /*#__PURE__*/React$1.createElement(ModalHeader, null, /*#__PURE__*/React$1.createElement(ModalTitle$1, null, "Add Comment"), /*#__PURE__*/React$1.createElement(CloseButton$1, {
38559
+ onClick: handleClose
38560
+ }, /*#__PURE__*/React$1.createElement("svg", {
38561
+ width: "24",
38562
+ height: "24",
38563
+ viewBox: "0 0 24 24",
38564
+ fill: "none"
38565
+ }, /*#__PURE__*/React$1.createElement("path", {
38566
+ d: "M18 6L6 18M6 6l12 12",
38567
+ stroke: "currentColor",
38568
+ strokeWidth: "2",
38569
+ strokeLinecap: "round",
38570
+ strokeLinejoin: "round"
38571
+ })))), /*#__PURE__*/React$1.createElement(ModalBody, null, /*#__PURE__*/React$1.createElement(TextareaWrapper, null, (commentText.length > 0 || isFocused) && /*#__PURE__*/React$1.createElement(TextareaLabel, {
38572
+ color: color
38573
+ }, "Comment"), /*#__PURE__*/React$1.createElement(CommentTextarea, {
38574
+ value: commentText,
38575
+ onChange: handleTextChange,
38576
+ placeholder: "Type a Comment...",
38577
+ maxLength: maxLength,
38578
+ color: color,
38579
+ $hasValue: commentText.length > 0,
38580
+ onBlur: handleBlur,
38581
+ onFocus: handleFocus
38582
+ }), /*#__PURE__*/React$1.createElement(CharacterCount, null, commentText.length, "/", maxLength))), /*#__PURE__*/React$1.createElement(ModalBottom, null, /*#__PURE__*/React$1.createElement(Button$1, {
38583
+ text: "Cancel",
38584
+ type: "secondary",
38585
+ size: "medium",
38586
+ borderColor: "#D3D3D3",
38587
+ hoverTextColor: "#212121",
38588
+ hoverBackgroundColor: "#E6F0F0",
38589
+ hoverBorderColor: "#D3D3D3",
38590
+ onClick: handleClose
38591
+ }), /*#__PURE__*/React$1.createElement(Button$1, {
38592
+ text: "Save",
38593
+ size: "medium",
38594
+ disabled: !isSaveEnabled,
38595
+ hoverTextColor: "#ffffff",
38596
+ disabledTextColor: "#ffffff",
38597
+ borderColor: color,
38598
+ backgroundColor: color,
38599
+ hoverBorderColor: saveButtonHoverColor,
38600
+ hoverBackgroundColor: saveButtonHoverColor,
38601
+ onClick: handleSave
38602
+ }))));
38603
+ };
38288
38604
 
38289
38605
  // OkIcon.jsx
38290
38606
  const OkIcon = _ref => {
@@ -38304,6 +38620,30 @@ const OkIcon = _ref => {
38304
38620
  }));
38305
38621
  };
38306
38622
 
38623
+ const CommentIcon = ({
38624
+ width = '15',
38625
+ height = '15',
38626
+ showCircle = false,
38627
+ circleColor = '#066768'
38628
+ }) => /*#__PURE__*/React$1.createElement("svg", {
38629
+ xmlns: "http://www.w3.org/2000/svg",
38630
+ width: width,
38631
+ height: height,
38632
+ viewBox: "0 0 15 15",
38633
+ fill: "none"
38634
+ }, showCircle ? /*#__PURE__*/React$1.createElement(React$1.Fragment, null, /*#__PURE__*/React$1.createElement("path", {
38635
+ 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",
38636
+ fill: "#212121"
38637
+ }), /*#__PURE__*/React$1.createElement("circle", {
38638
+ cx: "12",
38639
+ cy: "3",
38640
+ r: "3",
38641
+ fill: circleColor
38642
+ })) : /*#__PURE__*/React$1.createElement("path", {
38643
+ 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",
38644
+ fill: "#212121"
38645
+ }));
38646
+
38307
38647
  // TrashIcon.jsx
38308
38648
  const TrashIcon = ({
38309
38649
  width = "14",
@@ -38344,27 +38684,44 @@ const DisabledTrashIcon = ({
38344
38684
  };
38345
38685
 
38346
38686
  // TableBody.jsx
38347
- const TableBody = /*#__PURE__*/forwardRef(({
38687
+ const TableBody = ({
38348
38688
  columns,
38349
38689
  data,
38350
38690
  onRowClick,
38351
38691
  onSendClick,
38352
38692
  buttonColor,
38353
38693
  onDeleteClick,
38694
+ selectedColor,
38354
38695
  resetFocus = false,
38355
38696
  onFocusChange,
38356
- indexToShimmer = 0
38357
- }, ref) => {
38697
+ indexToShimmer = 0,
38698
+ statuses = [{
38699
+ status: 'Pending',
38700
+ palette: ['#F5C9A7', '#8B4513']
38701
+ }, {
38702
+ status: 'Received',
38703
+ palette: ['#B9D5D5', '#2F4F4F']
38704
+ }, {
38705
+ status: 'Approved',
38706
+ palette: ['#BEDDC3', '#2D5016']
38707
+ }, {
38708
+ status: 'Cancelled',
38709
+ palette: ['#EBA6AF', '#8B1538']
38710
+ }],
38711
+ onCommentSave = () => {},
38712
+ ref = null
38713
+ }) => {
38358
38714
  const [hoveredRowIndex, setHoveredRowIndex] = useState(null);
38359
38715
  const [focusedRowIndex, setFocusedRowIndex] = useState(null);
38716
+ const [isCommentModalOpen, setIsCommentModalOpen] = useState(false);
38717
+ const [currentCommentRow, setCurrentCommentRow] = useState(null); // Track which row is being edited
38360
38718
 
38361
- // Expose methods to parent components via ref
38362
- useImperativeHandle(ref, () => ({
38363
- clearFocus: () => setFocusedRowIndex(null),
38364
- getFocusedRowIndex: () => focusedRowIndex
38365
- }));
38719
+ // Expose methods to parent components via ref (if ref is provided)
38720
+ // useImperativeHandle(ref, () => ({
38721
+ // clearFocus: () => setFocusedRowIndex(null),
38722
+ // getFocusedRowIndex: () => focusedRowIndex
38723
+ // }), [focusedRowIndex]);
38366
38724
 
38367
- // Handle resetFocus prop
38368
38725
  useEffect(() => {
38369
38726
  if (resetFocus) {
38370
38727
  setFocusedRowIndex(null);
@@ -38372,11 +38729,11 @@ const TableBody = /*#__PURE__*/forwardRef(({
38372
38729
  }, [resetFocus]);
38373
38730
 
38374
38731
  // Notify parent of focus changes
38375
- useEffect(() => {
38376
- if (onFocusChange) {
38377
- onFocusChange(focusedRowIndex);
38378
- }
38379
- }, [focusedRowIndex, onFocusChange]);
38732
+ // useEffect(() => {
38733
+ // if (onFocusChange) {
38734
+ // onFocusChange(focusedRowIndex);
38735
+ // }
38736
+ // }, [focusedRowIndex, onFocusChange]);
38380
38737
 
38381
38738
  // Handle row click for focus state
38382
38739
  const handleRowClick = (row, rowIndex) => {
@@ -38386,6 +38743,21 @@ const TableBody = /*#__PURE__*/forwardRef(({
38386
38743
  }
38387
38744
  };
38388
38745
 
38746
+ // Handle comment save
38747
+ const handleCommentSave = commentText => {
38748
+ if (currentCommentRow !== null) {
38749
+ onCommentSave(currentCommentRow, commentText);
38750
+ }
38751
+ setCurrentCommentRow(null);
38752
+ setIsCommentModalOpen(false);
38753
+ };
38754
+
38755
+ // Handle comment modal close
38756
+ const handleCommentModalClose = () => {
38757
+ setCurrentCommentRow(null);
38758
+ setIsCommentModalOpen(false);
38759
+ };
38760
+
38389
38761
  // Function to calculate tooltip height based on text length
38390
38762
  const calculateTooltipOffset = (text, isRegularCell = false) => {
38391
38763
  if (!text) return {
@@ -38521,6 +38893,57 @@ const TableBody = /*#__PURE__*/forwardRef(({
38521
38893
  }), /*#__PURE__*/React$1.createElement("span", null, "All Sent"));
38522
38894
  }
38523
38895
  return value;
38896
+ case 'status':
38897
+ const statusObj = statuses.find(status => status.status === value) || {};
38898
+ const [palette0, palette1] = statusObj.palette;
38899
+ return /*#__PURE__*/React$1.createElement(StatusCell, {
38900
+ color: palette1
38901
+ }, /*#__PURE__*/React$1.createElement(StatusCellCircle, {
38902
+ backgroundColor: palette0
38903
+ }), /*#__PURE__*/React$1.createElement("span", null, value));
38904
+ case 'comments':
38905
+ const commentText = value || '';
38906
+ const hasComments = commentText.trim().length > 0;
38907
+
38908
+ // Truncate tooltip text if longer than 150 characters
38909
+ const commentTooltipText = commentText.length > 150 ? commentText.substring(0, 147) + '...' : commentText;
38910
+ return /*#__PURE__*/React$1.createElement(CommentIconWrapper, {
38911
+ $buttonColor: buttonColor,
38912
+ ref: el => {
38913
+ if (el) {
38914
+ if (hasComments) {
38915
+ // Add tooltip if there are comments
38916
+ const rect = el.getBoundingClientRect();
38917
+ const {
38918
+ offset,
38919
+ height
38920
+ } = calculateTooltipOffset(commentTooltipText);
38921
+ el.style.setProperty('--tooltip-top', `${rect.top}px`);
38922
+ el.style.setProperty('--tooltip-left', `${rect.left}px`);
38923
+ el.style.setProperty('--tooltip-width', `${rect.width}px`);
38924
+ el.style.setProperty('--tooltip-offset', `${offset}px`);
38925
+ el.style.setProperty('--tooltip-height', `${height}px`);
38926
+ el.setAttribute('data-tooltip', commentTooltipText);
38927
+ } else {
38928
+ // Remove tooltip if there are no comments
38929
+ el.removeAttribute('data-tooltip');
38930
+ el.style.removeProperty('--tooltip-top');
38931
+ el.style.removeProperty('--tooltip-left');
38932
+ el.style.removeProperty('--tooltip-width');
38933
+ el.style.removeProperty('--tooltip-offset');
38934
+ el.style.removeProperty('--tooltip-height');
38935
+ }
38936
+ }
38937
+ },
38938
+ onClick: e => {
38939
+ e.stopPropagation();
38940
+ setCurrentCommentRow(rowIndex);
38941
+ setIsCommentModalOpen(true);
38942
+ }
38943
+ }, /*#__PURE__*/React$1.createElement(CommentIcon, {
38944
+ showCircle: hasComments,
38945
+ circleColor: "#066768"
38946
+ }));
38524
38947
  case 'trash':
38525
38948
  // Only show trash icon when row is hovered
38526
38949
  if (hoveredRowIndex !== rowIndex) {
@@ -38584,11 +39007,12 @@ const TableBody = /*#__PURE__*/forwardRef(({
38584
39007
  const shouldShowTooltip = (element, content) => {
38585
39008
  return element && element.scrollWidth > element.clientWidth;
38586
39009
  };
38587
- return /*#__PURE__*/React$1.createElement(StyledTableBody, null, data.map((row, rowIndex) => /*#__PURE__*/React$1.createElement(TableRow, {
39010
+ return /*#__PURE__*/React$1.createElement(React$1.Fragment, null, /*#__PURE__*/React$1.createElement(StyledTableBody, null, data.map((row, rowIndex) => /*#__PURE__*/React$1.createElement(TableRow, {
38588
39011
  key: rowIndex,
38589
39012
  "data-row-index": rowIndex,
38590
39013
  className: indexToShimmer === rowIndex ? 'shimmer-row' : '',
38591
- $isFocused: focusedRowIndex === rowIndex,
39014
+ isFocused: focusedRowIndex === rowIndex,
39015
+ selectedColor: selectedColor,
38592
39016
  onMouseEnter: () => setHoveredRowIndex(rowIndex),
38593
39017
  onMouseLeave: () => setHoveredRowIndex(null),
38594
39018
  onClick: () => handleRowClick(row, rowIndex)
@@ -38617,8 +39041,13 @@ const TableBody = /*#__PURE__*/forwardRef(({
38617
39041
  $minWidth: column.minWidth,
38618
39042
  $maxWidth: column.maxWidth
38619
39043
  }, formattedValue);
38620
- }))));
38621
- });
39044
+ })))), /*#__PURE__*/React$1.createElement(CommentModal, {
39045
+ isOpen: isCommentModalOpen,
39046
+ onClose: handleCommentModalClose,
39047
+ onSave: handleCommentSave,
39048
+ initialValue: currentCommentRow !== null ? data[currentCommentRow]?.Comments || '' : ''
39049
+ }));
39050
+ };
38622
39051
  TableBody.propTypes = {
38623
39052
  columns: PropTypes.array.isRequired,
38624
39053
  data: PropTypes.array.isRequired,
@@ -38628,7 +39057,9 @@ TableBody.propTypes = {
38628
39057
  onDeleteClick: PropTypes.func,
38629
39058
  resetFocus: PropTypes.bool,
38630
39059
  onFocusChange: PropTypes.func,
38631
- indexToShimmer: PropTypes.number
39060
+ indexToShimmer: PropTypes.number,
39061
+ onCommentSave: PropTypes.func,
39062
+ ref: PropTypes.object
38632
39063
  };
38633
39064
  TableBody.displayName = 'TableBody';
38634
39065
 
@@ -41799,7 +42230,7 @@ var Lottie = function Lottie(props) {
41799
42230
  };
41800
42231
 
41801
42232
  // Table.jsx
41802
- const Table = /*#__PURE__*/forwardRef((props, ref) => {
42233
+ const Table = props => {
41803
42234
  const {
41804
42235
  width = '100%',
41805
42236
  height = 'auto',
@@ -41810,7 +42241,6 @@ const Table = /*#__PURE__*/forwardRef((props, ref) => {
41810
42241
  onButtonClick = () => {},
41811
42242
  buttonColor = '#066768',
41812
42243
  buttonHoverColor = '#388586',
41813
- // Updated props for new table structure
41814
42244
  columns = [],
41815
42245
  onRowClick = () => {},
41816
42246
  onSort,
@@ -41820,6 +42250,7 @@ const Table = /*#__PURE__*/forwardRef((props, ref) => {
41820
42250
  onSideButtonClick = () => {},
41821
42251
  sideButtonColor = '#066768',
41822
42252
  sideButtonHoverColor = '#388586',
42253
+ selectedColor = '#B4D1D2',
41823
42254
  children = null,
41824
42255
  tableBodyHeight = '728px',
41825
42256
  isLoading = false,
@@ -41839,7 +42270,10 @@ const Table = /*#__PURE__*/forwardRef((props, ref) => {
41839
42270
  clearFocusOnOutsideClick = true,
41840
42271
  // NEW: Props for edit mode focus management
41841
42272
  isEditMode = false,
41842
- editRowIndex = -1
42273
+ editRowIndex = -1,
42274
+ onCommentSave = () => {},
42275
+ // Accept ref as a regular prop
42276
+ ref = null
41843
42277
  } = props;
41844
42278
  const scrollWrapperRef = useRef(null);
41845
42279
  const tableBodyRef = useRef(null);
@@ -41858,11 +42292,16 @@ const Table = /*#__PURE__*/forwardRef((props, ref) => {
41858
42292
  onTableFocusChange(focusedRowIndex);
41859
42293
  };
41860
42294
 
41861
- // Expose methods to parent components via ref
42295
+ // Handle comment save - pass through to parent
42296
+ const handleCommentSave = (rowIndex, commentText) => {
42297
+ onCommentSave(rowIndex, commentText);
42298
+ };
42299
+
42300
+ // Expose methods to parent components via ref (if ref is provided)
41862
42301
  useImperativeHandle(ref, () => ({
41863
42302
  clearTableFocus,
41864
42303
  getTableBodyRef: () => tableBodyRef.current
41865
- }));
42304
+ }), []);
41866
42305
  useEffect(() => {
41867
42306
  const scrollWrapper = scrollWrapperRef.current;
41868
42307
  if (!scrollWrapper || !onLastRowsReached) return;
@@ -41940,9 +42379,11 @@ const Table = /*#__PURE__*/forwardRef((props, ref) => {
41940
42379
  columns: columns,
41941
42380
  indexToShimmer: indexToShimmer,
41942
42381
  data: data,
42382
+ selectedColor: selectedColor,
41943
42383
  onRowClick: onRowClick,
41944
42384
  onSendClick: onSendClick,
41945
42385
  onDeleteClick: onDeleteClick,
42386
+ onCommentSave: handleCommentSave,
41946
42387
  buttonColor: buttonColor,
41947
42388
  resetFocus: resetTableFocus,
41948
42389
  onFocusChange: handleTableFocusChange
@@ -41964,7 +42405,7 @@ const Table = /*#__PURE__*/forwardRef((props, ref) => {
41964
42405
  animationData: LoadingAnimation,
41965
42406
  loop: true
41966
42407
  }), /*#__PURE__*/React$1.createElement(LoadingText, null, isLoadingText)))));
41967
- });
42408
+ };
41968
42409
 
41969
42410
  // Add displayName for better debugging
41970
42411
  Table.displayName = 'Table';