sag_components 2.0.0-beta155 → 2.0.0-beta157

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
@@ -1826,6 +1826,32 @@ const getNumberWithCommas = x => {
1826
1826
  return param;
1827
1827
  };
1828
1828
 
1829
+ // Function to calculate tooltip height based on text length
1830
+ const calculateTooltipOffset = function (text) {
1831
+ let isRegularCell = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
1832
+ if (!text) return {
1833
+ offset: 60,
1834
+ height: 50
1835
+ };
1836
+ const tooltipWidth = 200;
1837
+ const avgCharWidth = 7; // Approximate character width in pixels
1838
+ const charsPerLine = Math.floor(tooltipWidth / avgCharWidth);
1839
+ const estimatedLines = Math.ceil(text.length / charsPerLine);
1840
+
1841
+ // Calculate tooltip height
1842
+ const lineHeight = 25; // Approximate line height
1843
+ const padding = 20; // Top + bottom padding
1844
+ const tooltipHeight = estimatedLines * lineHeight + padding;
1845
+
1846
+ // Base offset - smaller for regular cells
1847
+ const baseOffset = isRegularCell ? 40 : 60;
1848
+ const extraOffset = Math.max(0, (estimatedLines - 1) * lineHeight);
1849
+ return {
1850
+ offset: baseOffset + extraOffset,
1851
+ height: tooltipHeight
1852
+ };
1853
+ };
1854
+
1829
1855
  const NoDataFoundIcon = ({
1830
1856
  width = '66',
1831
1857
  height = '66'
@@ -38002,7 +38028,7 @@ const TableHeader = ({
38002
38028
  // TableBody.styles.js
38003
38029
 
38004
38030
  // Shared tooltip styles
38005
- const tooltipStyles = styled.css`
38031
+ const tooltipStyles$1 = styled.css`
38006
38032
  /* CSS-only tooltip */
38007
38033
  &[data-tooltip]:hover::before {
38008
38034
  content: attr(data-tooltip);
@@ -38274,7 +38300,7 @@ const ButtonWrapper = styled__default["default"].div`
38274
38300
  display: inline-block;
38275
38301
  position: relative;
38276
38302
 
38277
- ${tooltipStyles}
38303
+ ${tooltipStyles$1}
38278
38304
  `;
38279
38305
  const SentStatus = styled__default["default"].div`
38280
38306
  display: flex;
@@ -38285,9 +38311,9 @@ const SentStatus = styled__default["default"].div`
38285
38311
  user-select: none;
38286
38312
  position: relative;
38287
38313
 
38288
- ${tooltipStyles}
38314
+ ${tooltipStyles$1}
38289
38315
  `;
38290
- const TrashIconWrapper = styled__default["default"].div`
38316
+ const TrashIconWrapper$1 = styled__default["default"].div`
38291
38317
  cursor: pointer;
38292
38318
  transition: color 0.2s ease;
38293
38319
  display: inline-flex;
@@ -38297,7 +38323,7 @@ const TrashIconWrapper = styled__default["default"].div`
38297
38323
  height: 100%;
38298
38324
  position: relative;
38299
38325
 
38300
- ${tooltipStyles}
38326
+ ${tooltipStyles$1}
38301
38327
 
38302
38328
  /* Override tooltip position to move left */
38303
38329
  &[data-tooltip]:hover::before {
@@ -38324,7 +38350,7 @@ const CommentIconWrapper = styled__default["default"].div`
38324
38350
  height: 100%;
38325
38351
  position: relative;
38326
38352
 
38327
- ${tooltipStyles}
38353
+ ${tooltipStyles$1}
38328
38354
 
38329
38355
  /* Override tooltip position to move left */
38330
38356
  &[data-tooltip]:hover::before {
@@ -38335,7 +38361,7 @@ const CommentIconWrapper = styled__default["default"].div`
38335
38361
  left: calc(var(--tooltip-left, 0px) + var(--tooltip-width, 0px) / 2 - 50px);
38336
38362
  }
38337
38363
  `;
38338
- const DisabledTrashIconWrapper = styled__default["default"].div`
38364
+ const DisabledTrashIconWrapper$1 = styled__default["default"].div`
38339
38365
  display: inline-flex;
38340
38366
  align-items: center;
38341
38367
  justify-content: center;
@@ -38343,7 +38369,7 @@ const DisabledTrashIconWrapper = styled__default["default"].div`
38343
38369
  height: 100%;
38344
38370
  position: relative;
38345
38371
 
38346
- ${tooltipStyles}
38372
+ ${tooltipStyles$1}
38347
38373
 
38348
38374
  /* Override tooltip position to move left */
38349
38375
  &[data-tooltip]:hover::before {
@@ -38855,31 +38881,6 @@ const TableBody = ({
38855
38881
  // Determine if save button should be enabled
38856
38882
  const isSaveEnabled = hasUserInteracted && (commentText.length > 0 || hasInitialValue);
38857
38883
 
38858
- // Function to calculate tooltip height based on text length
38859
- const calculateTooltipOffset = (text, isRegularCell = false) => {
38860
- if (!text) return {
38861
- offset: 60,
38862
- height: 50
38863
- };
38864
- const tooltipWidth = 200;
38865
- const avgCharWidth = 7; // Approximate character width in pixels
38866
- const charsPerLine = Math.floor(tooltipWidth / avgCharWidth);
38867
- const estimatedLines = Math.ceil(text.length / charsPerLine);
38868
-
38869
- // Calculate tooltip height
38870
- const lineHeight = 25; // Approximate line height
38871
- const padding = 20; // Top + bottom padding
38872
- const tooltipHeight = estimatedLines * lineHeight + padding;
38873
-
38874
- // Base offset - smaller for regular cells
38875
- const baseOffset = isRegularCell ? 40 : 60;
38876
- const extraOffset = Math.max(0, (estimatedLines - 1) * lineHeight);
38877
- return {
38878
- offset: baseOffset + extraOffset,
38879
- height: tooltipHeight
38880
- };
38881
- };
38882
-
38883
38884
  // Helper function to format tag text
38884
38885
  const formatTagText = tag => {
38885
38886
  if (typeof tag !== 'string') return tag;
@@ -39099,7 +39100,7 @@ const TableBody = ({
39099
39100
  }
39100
39101
  const trashTooltipText = getTooltipText(value);
39101
39102
  if (value === 'ENABLED') {
39102
- return /*#__PURE__*/React__default["default"].createElement(TrashIconWrapper, {
39103
+ return /*#__PURE__*/React__default["default"].createElement(TrashIconWrapper$1, {
39103
39104
  $buttonColor: buttonColor,
39104
39105
  ref: el => {
39105
39106
  if (el && trashTooltipText) {
@@ -39125,7 +39126,7 @@ const TableBody = ({
39125
39126
  height: "18"
39126
39127
  }));
39127
39128
  } else if (value === 'DISABLED') {
39128
- return /*#__PURE__*/React__default["default"].createElement(DisabledTrashIconWrapper, {
39129
+ return /*#__PURE__*/React__default["default"].createElement(DisabledTrashIconWrapper$1, {
39129
39130
  ref: el => {
39130
39131
  if (el && trashTooltipText) {
39131
39132
  const rect = el.getBoundingClientRect();
@@ -42586,7 +42587,7 @@ const Table = props => {
42586
42587
  // Add displayName for better debugging
42587
42588
  Table.displayName = 'Table';
42588
42589
 
42589
- const Card = styled__default["default"].div`
42590
+ const Card = styled.styled.div`
42590
42591
  background: ${props => props.backgroundColor};
42591
42592
  border-radius: 8px;
42592
42593
  /* box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05); */
@@ -42601,44 +42602,44 @@ const Card = styled__default["default"].div`
42601
42602
  cursor: not-allowed;
42602
42603
  }
42603
42604
  `;
42604
- const TitleContainer = styled__default["default"].div`
42605
+ const TitleContainer = styled.styled.div`
42605
42606
  display: flex;
42606
42607
  flex-direction: column;
42607
42608
  align-items: flex-start;
42608
42609
  `;
42609
- const SectionTitle$1 = styled__default["default"].div`
42610
+ const SectionTitle$1 = styled.styled.div`
42610
42611
  color: #212121;
42611
42612
  font-size: 18px;
42612
42613
  font-weight: 700;
42613
42614
  `;
42614
- const SubtitleContainer = styled__default["default"].div`
42615
+ const SubtitleContainer = styled.styled.div`
42615
42616
  display: flex;
42616
42617
  align-items: center;
42617
42618
  gap: 6px;
42618
42619
  color: #8B8989;
42619
42620
  `;
42620
- const Subtitle$1 = styled__default["default"].span`
42621
+ const Subtitle$1 = styled.styled.span`
42621
42622
  color: ${props => props.color};
42622
42623
  font-size: 14px;
42623
42624
  font-weight: 400;
42624
42625
  `;
42625
- const AddButtonContainer$1 = styled__default["default"].div`
42626
+ const AddButtonContainer$1 = styled.styled.div`
42626
42627
  display: flex;
42627
42628
  align-items: flex-start;
42628
42629
  `;
42629
42630
 
42630
42631
  // Vendor selection screen styles
42631
- styled__default["default"](Card)`
42632
+ styled.styled(Card)`
42632
42633
  display: flex;
42633
42634
  flex-direction: column;
42634
42635
  background: #faf9fb;
42635
42636
  padding: 0;
42636
42637
  overflow: hidden;
42637
42638
  `;
42638
- const VendorHeader$2 = styled__default["default"].div`
42639
+ const VendorHeader$2 = styled.styled.div`
42639
42640
  padding: 16px 24px;
42640
42641
  `;
42641
- styled__default["default"].button`
42642
+ styled.styled.button`
42642
42643
  border: none;
42643
42644
  background: none;
42644
42645
  font-size: 22px;
@@ -42647,7 +42648,7 @@ styled__default["default"].button`
42647
42648
  padding: 0 8px 0 0;
42648
42649
  margin-right: 4px;
42649
42650
  `;
42650
- styled__default["default"].input`
42651
+ styled.styled.input`
42651
42652
  margin: 16px;
42652
42653
  margin-bottom: 8px;
42653
42654
  padding: 10px 14px;
@@ -42656,16 +42657,16 @@ styled__default["default"].input`
42656
42657
  font-size: 15px;
42657
42658
  outline: none;
42658
42659
  `;
42659
- const VendorListWrapper$2 = styled__default["default"].div`
42660
+ const VendorListWrapper$2 = styled.styled.div`
42660
42661
  height: calc(100% - ${props => props.headerHeight}px);
42661
42662
  background: ${props => props.disabled ? '#f2f2f2' : '#fff'};
42662
42663
  width: 100%;
42663
42664
  overflow: auto;
42664
42665
  border-radius: 0 0 8px 8px;
42665
42666
  `;
42666
- const VendorList$2 = styled__default["default"].div`
42667
+ const VendorList$2 = styled.styled.div`
42667
42668
  `;
42668
- const VendorItem$1 = styled__default["default"].div`
42669
+ const VendorItem$1 = styled.styled.div`
42669
42670
  display: flex;
42670
42671
  align-items: center;
42671
42672
  justify-content: space-between;
@@ -42676,50 +42677,53 @@ const VendorItem$1 = styled__default["default"].div`
42676
42677
  &:hover {
42677
42678
  background: #f7f7fa;
42678
42679
  .trash-icon svg path {
42679
- fill: #B1B1B1;
42680
- }
42680
+ fill: #B1B1B1;
42681
+ }
42682
+ .trash-icon-disabled svg path {
42683
+ fill: #D9D9D9;
42684
+ }
42681
42685
  }
42682
42686
  `;
42683
- const VendorName$2 = styled__default["default"].div`
42687
+ const VendorName$2 = styled.styled.div`
42684
42688
  color: #212121;
42685
42689
  font-size: 16px;
42686
42690
  font-weight: 500;
42687
42691
  `;
42688
- styled__default["default"].div`
42692
+ styled.styled.div`
42689
42693
  color: #b0b0b0;
42690
42694
  font-size: 13px;
42691
42695
  margin-top: 2px;
42692
42696
  `;
42693
- const VendorChevron$1 = styled__default["default"].div`
42697
+ const VendorChevron$1 = styled.styled.div`
42694
42698
  align-items: center;
42695
42699
  display: flex;
42696
42700
  `;
42697
- const VendorNameAndPackagesContainer$1 = styled__default["default"].div`
42701
+ const VendorNameAndPackagesContainer$1 = styled.styled.div`
42698
42702
  display: flex;
42699
42703
  margin-left: 12px;
42700
42704
  flex-direction: column;
42701
42705
  align-items: flex-start;
42702
42706
  `;
42703
- const DotContainer = styled__default["default"].div`
42707
+ const DotContainer = styled.styled.div`
42704
42708
  text-align: center;
42705
42709
  margin-top: 10px;
42706
42710
  width: 40px;
42707
42711
  height: 100%;
42708
42712
  `;
42709
- const LineContainer = styled__default["default"].div`
42713
+ const LineContainer = styled.styled.div`
42710
42714
  display: flex;
42711
42715
  justify-content: space-between;
42712
42716
  align-items: center;
42713
42717
  width: 100%;
42714
42718
  `;
42715
- const ButtonContainer = styled__default["default"].div`
42719
+ const ButtonContainer = styled.styled.div`
42716
42720
  .ButtonContainer {
42717
42721
  label {
42718
42722
  white-space: nowrap;
42719
42723
  }
42720
42724
  }
42721
42725
  `;
42722
- const CustomTooltip = styled__default["default"](Tooltip$2)`
42726
+ const CustomTooltip = styled.styled(Tooltip$2)`
42723
42727
  .controls {
42724
42728
  padding: 12px 16px;
42725
42729
  font-size: 14px;
@@ -42727,20 +42731,74 @@ const CustomTooltip = styled__default["default"](Tooltip$2)`
42727
42731
  &::before {
42728
42732
  left: 90%;
42729
42733
  }
42730
- ${props => props.trashIcon && `width: 150px;
42731
- white-space: normal;
42732
- max-height: 50px;
42733
- margin-top: 8px;`}
42734
42734
  }
42735
42735
  `;
42736
- const Container$1 = styled__default["default"].div`
42736
+ const Container$1 = styled.styled.div`
42737
42737
  display: flex;
42738
42738
  align-items: center;
42739
42739
  justify-content: space-between;
42740
42740
  padding: 38px 0 20px;
42741
42741
  box-sizing: border-box;
42742
42742
  `;
42743
- const Trash$1 = styled__default["default"].div`
42743
+ const tooltipStyles = styled.css`
42744
+ /* CSS-only tooltip */
42745
+ &[data-tooltip]:hover::before {
42746
+ content: attr(data-tooltip);
42747
+ position: fixed;
42748
+ background-color: white;
42749
+ color: #333;
42750
+ padding: 10px 16px;
42751
+ border-radius: 4px;
42752
+ font-family: "Poppins", sans-serif;
42753
+ font-size: 14px;
42754
+ font-weight: 400;
42755
+ z-index: 1000;
42756
+ pointer-events: none;
42757
+ width: 200px;
42758
+ white-space: pre-wrap;
42759
+ word-wrap: break-word;
42760
+ line-height: 1.8;
42761
+ box-shadow:
42762
+ 0 -2px 8px rgba(0, 0, 0, 0.15),
42763
+ 0 2px 8px rgba(0, 0, 0, 0.15);
42764
+
42765
+ /* Position above the element - using dynamic offset */
42766
+ top: calc(var(--tooltip-top, 0px) - var(--tooltip-offset, 60px));
42767
+ left: calc(var(--tooltip-left, 0px) + var(--tooltip-width, 0px) / 2);
42768
+ transform: translateX(-50%);
42769
+
42770
+ /* Add delay */
42771
+ opacity: 0;
42772
+ animation: showTooltip 0.3s ease-in-out 0.5s forwards;
42773
+ }
42774
+
42775
+ /* Tooltip arrow */
42776
+ &[data-tooltip]:hover::after {
42777
+ content: "";
42778
+ position: fixed;
42779
+ top: calc(
42780
+ var(--tooltip-top, 0px) - var(--tooltip-offset, 60px) +
42781
+ var(--tooltip-height, 50px)
42782
+ ); /* Use estimated tooltip height */
42783
+ left: calc(var(--tooltip-left, 0px) + var(--tooltip-width, 0px) / 2);
42784
+ transform: translateX(-50%);
42785
+ border: 8px solid transparent;
42786
+ border-top-color: white;
42787
+ z-index: 1001;
42788
+ pointer-events: none;
42789
+
42790
+ /* Add delay */
42791
+ opacity: 0;
42792
+ animation: showTooltip 0.3s ease-in-out 0.5s forwards;
42793
+ }
42794
+
42795
+ @keyframes showTooltip {
42796
+ to {
42797
+ opacity: 1;
42798
+ }
42799
+ }
42800
+ `;
42801
+ const baseIconWrapperStyles = styled.css`
42744
42802
  display: flex;
42745
42803
  align-items: center;
42746
42804
  justify-content: center;
@@ -42748,9 +42806,6 @@ const Trash$1 = styled__default["default"].div`
42748
42806
  height: 24px;
42749
42807
  padding: 0 12px;
42750
42808
  cursor: pointer;
42751
- ${props => props.disabled && `opacity: 0.5;
42752
- pointer-events: none;
42753
- user-select: none;`};
42754
42809
  svg {
42755
42810
  pointer-events: none;
42756
42811
  }
@@ -42758,6 +42813,23 @@ const Trash$1 = styled__default["default"].div`
42758
42813
  svg path {
42759
42814
  fill: white;
42760
42815
  }
42816
+ `;
42817
+ const DisabledTrashIconWrapper = styled.styled.div`
42818
+ ${baseIconWrapperStyles}
42819
+ ${tooltipStyles}
42820
+
42821
+ /* Tooltip customization */
42822
+ &[data-tooltip]:hover::before {
42823
+ text-align: left;
42824
+ left: calc(var(--tooltip-left, 0px) + var(--tooltip-width, 0px) / 2 - 50px);
42825
+ }
42826
+
42827
+ &[data-tooltip]:hover::after {
42828
+ left: calc(var(--tooltip-left, 0px) + var(--tooltip-width, 0px) / 2 - 50px);
42829
+ }
42830
+ `;
42831
+ const TrashIconWrapper = styled.styled.div`
42832
+ ${baseIconWrapperStyles}
42761
42833
 
42762
42834
  &:hover {
42763
42835
  svg path {
@@ -52088,6 +52160,21 @@ const ItemManagerPanel = _ref => {
52088
52160
  setSelectedVendor(modifiedVendor);
52089
52161
  setScreen("subitem");
52090
52162
  };
52163
+ const setupTooltip = (el, tooltipText) => {
52164
+ if (el && tooltipText) {
52165
+ const rect = el.getBoundingClientRect();
52166
+ const {
52167
+ offset,
52168
+ height
52169
+ } = calculateTooltipOffset(tooltipText);
52170
+ el.style.setProperty('--tooltip-top', `${rect.top}px`);
52171
+ el.style.setProperty('--tooltip-left', `${rect.left}px`);
52172
+ el.style.setProperty('--tooltip-width', `${rect.width}px`);
52173
+ el.style.setProperty('--tooltip-offset', `${offset}px`);
52174
+ el.style.setProperty('--tooltip-height', `${height}px`);
52175
+ el.setAttribute('data-tooltip', tooltipText);
52176
+ }
52177
+ };
52091
52178
  const addNewPackage = (vendorName, packageName, component) => {
52092
52179
  setItemAndPackage(prev => {
52093
52180
  const vendorIndex = prev.findIndex(item => item.name === vendorName);
@@ -52311,27 +52398,22 @@ const ItemManagerPanel = _ref => {
52311
52398
  } else {
52312
52399
  return `${sentPackagesLength}/${packagesLength} sent`;
52313
52400
  }
52314
- })())), /*#__PURE__*/React__default["default"].createElement(VendorChevron$1, null, /*#__PURE__*/React__default["default"].createElement(ArrowRightFullIcon, null))), /*#__PURE__*/React__default["default"].createElement(CustomTooltip, {
52315
- hideTooltip: !sentPackagesLength > 0,
52316
- content: trashTooltipText,
52317
- topFactor: 2,
52318
- direction: "left",
52319
- trashIcon: true
52320
- }, /*#__PURE__*/React__default["default"].createElement(Trash$1, {
52321
- disabled: sentPackagesLength > 0,
52401
+ })())), /*#__PURE__*/React__default["default"].createElement(VendorChevron$1, null, /*#__PURE__*/React__default["default"].createElement(ArrowRightFullIcon, null))), sentPackagesLength > 0 ? /*#__PURE__*/React__default["default"].createElement(DisabledTrashIconWrapper, {
52402
+ className: "trash-icon-disabled",
52403
+ ref: el => setupTooltip(el, trashTooltipText)
52404
+ }, /*#__PURE__*/React__default["default"].createElement(DisabledTrashIcon, {
52405
+ width: "22",
52406
+ height: "22"
52407
+ })) : /*#__PURE__*/React__default["default"].createElement(TrashIconWrapper, {
52322
52408
  className: "trash-icon",
52323
- onClick: () => {
52409
+ onClick: e => {
52410
+ e.stopPropagation();
52324
52411
  onDeleteVendor(item);
52325
52412
  }
52326
- }, /*#__PURE__*/React__default["default"].createElement("svg", {
52413
+ }, /*#__PURE__*/React__default["default"].createElement(TrashIcon, {
52327
52414
  width: "14",
52328
- height: "18",
52329
- viewBox: "0 0 14 18",
52330
- fill: "none",
52331
- xmlns: "http://www.w3.org/2000/svg"
52332
- }, /*#__PURE__*/React__default["default"].createElement("path", {
52333
- d: "M1 16C1 17.1 1.9 18 3 18H11C12.1 18 13 17.1 13 16V4H1V16ZM14 1H10.5L9.5 0H4.5L3.5 1H0V3H14V1Z"
52334
- })))));
52415
+ height: "18"
52416
+ })));
52335
52417
  }))));
52336
52418
  }
52337
52419
  };
@@ -53358,7 +53440,8 @@ const QuickFilterCards = _ref => {
53358
53440
  let {
53359
53441
  data = [],
53360
53442
  onCardToggle = () => {},
53361
- width = "100%"
53443
+ width = "100%",
53444
+ CardsContainerClassName = "QuickFilterCardsContainer"
53362
53445
  } = _ref;
53363
53446
  // local mirror so UI updates immediately even if parent is slow/not controlling
53364
53447
  const [items, setItems] = React$1.useState(data);
@@ -53377,7 +53460,7 @@ const QuickFilterCards = _ref => {
53377
53460
  };
53378
53461
  return /*#__PURE__*/React__default["default"].createElement(CardsContainer, {
53379
53462
  width: width,
53380
- className: "QuickFilterCardsContainer"
53463
+ className: CardsContainerClassName
53381
53464
  }, items.map(_ref2 => {
53382
53465
  let {
53383
53466
  status,