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.d.ts CHANGED
@@ -1590,10 +1590,11 @@ declare function ToasterMessageBox({ color, messageText, linkText, duration, wid
1590
1590
  onClose?: () => void;
1591
1591
  }): react_jsx_runtime.JSX.Element;
1592
1592
 
1593
- declare function QuickFilterCards({ data, onCardToggle, width, }: {
1593
+ declare function QuickFilterCards({ data, onCardToggle, width, CardsContainerClassName, }: {
1594
1594
  data?: any[];
1595
1595
  onCardToggle?: () => void;
1596
1596
  width?: string;
1597
+ CardsContainerClassName?: string;
1597
1598
  }): react_jsx_runtime.JSX.Element;
1598
1599
 
1599
1600
  declare function RangePicker({ label, onChange, borderRadius, required, width, height, placeholder, disabled, borderColor, borderColorFocus, textColor, selectedValue, }: {
package/dist/index.esm.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import React$1, { useState, useRef, useEffect, useMemo, useCallback, useImperativeHandle } from 'react';
2
- import styled, { keyframes, css } from 'styled-components';
2
+ import styled, { keyframes, css, styled as styled$1 } 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';
5
5
  import { motion, AnimatePresence } from 'framer-motion';
@@ -1816,6 +1816,32 @@ const getNumberWithCommas = x => {
1816
1816
  return param;
1817
1817
  };
1818
1818
 
1819
+ // Function to calculate tooltip height based on text length
1820
+ const calculateTooltipOffset = function (text) {
1821
+ let isRegularCell = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
1822
+ if (!text) return {
1823
+ offset: 60,
1824
+ height: 50
1825
+ };
1826
+ const tooltipWidth = 200;
1827
+ const avgCharWidth = 7; // Approximate character width in pixels
1828
+ const charsPerLine = Math.floor(tooltipWidth / avgCharWidth);
1829
+ const estimatedLines = Math.ceil(text.length / charsPerLine);
1830
+
1831
+ // Calculate tooltip height
1832
+ const lineHeight = 25; // Approximate line height
1833
+ const padding = 20; // Top + bottom padding
1834
+ const tooltipHeight = estimatedLines * lineHeight + padding;
1835
+
1836
+ // Base offset - smaller for regular cells
1837
+ const baseOffset = isRegularCell ? 40 : 60;
1838
+ const extraOffset = Math.max(0, (estimatedLines - 1) * lineHeight);
1839
+ return {
1840
+ offset: baseOffset + extraOffset,
1841
+ height: tooltipHeight
1842
+ };
1843
+ };
1844
+
1819
1845
  const NoDataFoundIcon = ({
1820
1846
  width = '66',
1821
1847
  height = '66'
@@ -37992,7 +38018,7 @@ const TableHeader = ({
37992
38018
  // TableBody.styles.js
37993
38019
 
37994
38020
  // Shared tooltip styles
37995
- const tooltipStyles = css`
38021
+ const tooltipStyles$1 = css`
37996
38022
  /* CSS-only tooltip */
37997
38023
  &[data-tooltip]:hover::before {
37998
38024
  content: attr(data-tooltip);
@@ -38264,7 +38290,7 @@ const ButtonWrapper = styled.div`
38264
38290
  display: inline-block;
38265
38291
  position: relative;
38266
38292
 
38267
- ${tooltipStyles}
38293
+ ${tooltipStyles$1}
38268
38294
  `;
38269
38295
  const SentStatus = styled.div`
38270
38296
  display: flex;
@@ -38275,9 +38301,9 @@ const SentStatus = styled.div`
38275
38301
  user-select: none;
38276
38302
  position: relative;
38277
38303
 
38278
- ${tooltipStyles}
38304
+ ${tooltipStyles$1}
38279
38305
  `;
38280
- const TrashIconWrapper = styled.div`
38306
+ const TrashIconWrapper$1 = styled.div`
38281
38307
  cursor: pointer;
38282
38308
  transition: color 0.2s ease;
38283
38309
  display: inline-flex;
@@ -38287,7 +38313,7 @@ const TrashIconWrapper = styled.div`
38287
38313
  height: 100%;
38288
38314
  position: relative;
38289
38315
 
38290
- ${tooltipStyles}
38316
+ ${tooltipStyles$1}
38291
38317
 
38292
38318
  /* Override tooltip position to move left */
38293
38319
  &[data-tooltip]:hover::before {
@@ -38314,7 +38340,7 @@ const CommentIconWrapper = styled.div`
38314
38340
  height: 100%;
38315
38341
  position: relative;
38316
38342
 
38317
- ${tooltipStyles}
38343
+ ${tooltipStyles$1}
38318
38344
 
38319
38345
  /* Override tooltip position to move left */
38320
38346
  &[data-tooltip]:hover::before {
@@ -38325,7 +38351,7 @@ const CommentIconWrapper = styled.div`
38325
38351
  left: calc(var(--tooltip-left, 0px) + var(--tooltip-width, 0px) / 2 - 50px);
38326
38352
  }
38327
38353
  `;
38328
- const DisabledTrashIconWrapper = styled.div`
38354
+ const DisabledTrashIconWrapper$1 = styled.div`
38329
38355
  display: inline-flex;
38330
38356
  align-items: center;
38331
38357
  justify-content: center;
@@ -38333,7 +38359,7 @@ const DisabledTrashIconWrapper = styled.div`
38333
38359
  height: 100%;
38334
38360
  position: relative;
38335
38361
 
38336
- ${tooltipStyles}
38362
+ ${tooltipStyles$1}
38337
38363
 
38338
38364
  /* Override tooltip position to move left */
38339
38365
  &[data-tooltip]:hover::before {
@@ -38845,31 +38871,6 @@ const TableBody = ({
38845
38871
  // Determine if save button should be enabled
38846
38872
  const isSaveEnabled = hasUserInteracted && (commentText.length > 0 || hasInitialValue);
38847
38873
 
38848
- // Function to calculate tooltip height based on text length
38849
- const calculateTooltipOffset = (text, isRegularCell = false) => {
38850
- if (!text) return {
38851
- offset: 60,
38852
- height: 50
38853
- };
38854
- const tooltipWidth = 200;
38855
- const avgCharWidth = 7; // Approximate character width in pixels
38856
- const charsPerLine = Math.floor(tooltipWidth / avgCharWidth);
38857
- const estimatedLines = Math.ceil(text.length / charsPerLine);
38858
-
38859
- // Calculate tooltip height
38860
- const lineHeight = 25; // Approximate line height
38861
- const padding = 20; // Top + bottom padding
38862
- const tooltipHeight = estimatedLines * lineHeight + padding;
38863
-
38864
- // Base offset - smaller for regular cells
38865
- const baseOffset = isRegularCell ? 40 : 60;
38866
- const extraOffset = Math.max(0, (estimatedLines - 1) * lineHeight);
38867
- return {
38868
- offset: baseOffset + extraOffset,
38869
- height: tooltipHeight
38870
- };
38871
- };
38872
-
38873
38874
  // Helper function to format tag text
38874
38875
  const formatTagText = tag => {
38875
38876
  if (typeof tag !== 'string') return tag;
@@ -39089,7 +39090,7 @@ const TableBody = ({
39089
39090
  }
39090
39091
  const trashTooltipText = getTooltipText(value);
39091
39092
  if (value === 'ENABLED') {
39092
- return /*#__PURE__*/React$1.createElement(TrashIconWrapper, {
39093
+ return /*#__PURE__*/React$1.createElement(TrashIconWrapper$1, {
39093
39094
  $buttonColor: buttonColor,
39094
39095
  ref: el => {
39095
39096
  if (el && trashTooltipText) {
@@ -39115,7 +39116,7 @@ const TableBody = ({
39115
39116
  height: "18"
39116
39117
  }));
39117
39118
  } else if (value === 'DISABLED') {
39118
- return /*#__PURE__*/React$1.createElement(DisabledTrashIconWrapper, {
39119
+ return /*#__PURE__*/React$1.createElement(DisabledTrashIconWrapper$1, {
39119
39120
  ref: el => {
39120
39121
  if (el && trashTooltipText) {
39121
39122
  const rect = el.getBoundingClientRect();
@@ -42576,7 +42577,7 @@ const Table = props => {
42576
42577
  // Add displayName for better debugging
42577
42578
  Table.displayName = 'Table';
42578
42579
 
42579
- const Card = styled.div`
42580
+ const Card = styled$1.div`
42580
42581
  background: ${props => props.backgroundColor};
42581
42582
  border-radius: 8px;
42582
42583
  /* box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05); */
@@ -42591,44 +42592,44 @@ const Card = styled.div`
42591
42592
  cursor: not-allowed;
42592
42593
  }
42593
42594
  `;
42594
- const TitleContainer = styled.div`
42595
+ const TitleContainer = styled$1.div`
42595
42596
  display: flex;
42596
42597
  flex-direction: column;
42597
42598
  align-items: flex-start;
42598
42599
  `;
42599
- const SectionTitle$1 = styled.div`
42600
+ const SectionTitle$1 = styled$1.div`
42600
42601
  color: #212121;
42601
42602
  font-size: 18px;
42602
42603
  font-weight: 700;
42603
42604
  `;
42604
- const SubtitleContainer = styled.div`
42605
+ const SubtitleContainer = styled$1.div`
42605
42606
  display: flex;
42606
42607
  align-items: center;
42607
42608
  gap: 6px;
42608
42609
  color: #8B8989;
42609
42610
  `;
42610
- const Subtitle$1 = styled.span`
42611
+ const Subtitle$1 = styled$1.span`
42611
42612
  color: ${props => props.color};
42612
42613
  font-size: 14px;
42613
42614
  font-weight: 400;
42614
42615
  `;
42615
- const AddButtonContainer$1 = styled.div`
42616
+ const AddButtonContainer$1 = styled$1.div`
42616
42617
  display: flex;
42617
42618
  align-items: flex-start;
42618
42619
  `;
42619
42620
 
42620
42621
  // Vendor selection screen styles
42621
- styled(Card)`
42622
+ styled$1(Card)`
42622
42623
  display: flex;
42623
42624
  flex-direction: column;
42624
42625
  background: #faf9fb;
42625
42626
  padding: 0;
42626
42627
  overflow: hidden;
42627
42628
  `;
42628
- const VendorHeader$2 = styled.div`
42629
+ const VendorHeader$2 = styled$1.div`
42629
42630
  padding: 16px 24px;
42630
42631
  `;
42631
- styled.button`
42632
+ styled$1.button`
42632
42633
  border: none;
42633
42634
  background: none;
42634
42635
  font-size: 22px;
@@ -42637,7 +42638,7 @@ styled.button`
42637
42638
  padding: 0 8px 0 0;
42638
42639
  margin-right: 4px;
42639
42640
  `;
42640
- styled.input`
42641
+ styled$1.input`
42641
42642
  margin: 16px;
42642
42643
  margin-bottom: 8px;
42643
42644
  padding: 10px 14px;
@@ -42646,16 +42647,16 @@ styled.input`
42646
42647
  font-size: 15px;
42647
42648
  outline: none;
42648
42649
  `;
42649
- const VendorListWrapper$2 = styled.div`
42650
+ const VendorListWrapper$2 = styled$1.div`
42650
42651
  height: calc(100% - ${props => props.headerHeight}px);
42651
42652
  background: ${props => props.disabled ? '#f2f2f2' : '#fff'};
42652
42653
  width: 100%;
42653
42654
  overflow: auto;
42654
42655
  border-radius: 0 0 8px 8px;
42655
42656
  `;
42656
- const VendorList$2 = styled.div`
42657
+ const VendorList$2 = styled$1.div`
42657
42658
  `;
42658
- const VendorItem$1 = styled.div`
42659
+ const VendorItem$1 = styled$1.div`
42659
42660
  display: flex;
42660
42661
  align-items: center;
42661
42662
  justify-content: space-between;
@@ -42666,50 +42667,53 @@ const VendorItem$1 = styled.div`
42666
42667
  &:hover {
42667
42668
  background: #f7f7fa;
42668
42669
  .trash-icon svg path {
42669
- fill: #B1B1B1;
42670
- }
42670
+ fill: #B1B1B1;
42671
+ }
42672
+ .trash-icon-disabled svg path {
42673
+ fill: #D9D9D9;
42674
+ }
42671
42675
  }
42672
42676
  `;
42673
- const VendorName$2 = styled.div`
42677
+ const VendorName$2 = styled$1.div`
42674
42678
  color: #212121;
42675
42679
  font-size: 16px;
42676
42680
  font-weight: 500;
42677
42681
  `;
42678
- styled.div`
42682
+ styled$1.div`
42679
42683
  color: #b0b0b0;
42680
42684
  font-size: 13px;
42681
42685
  margin-top: 2px;
42682
42686
  `;
42683
- const VendorChevron$1 = styled.div`
42687
+ const VendorChevron$1 = styled$1.div`
42684
42688
  align-items: center;
42685
42689
  display: flex;
42686
42690
  `;
42687
- const VendorNameAndPackagesContainer$1 = styled.div`
42691
+ const VendorNameAndPackagesContainer$1 = styled$1.div`
42688
42692
  display: flex;
42689
42693
  margin-left: 12px;
42690
42694
  flex-direction: column;
42691
42695
  align-items: flex-start;
42692
42696
  `;
42693
- const DotContainer = styled.div`
42697
+ const DotContainer = styled$1.div`
42694
42698
  text-align: center;
42695
42699
  margin-top: 10px;
42696
42700
  width: 40px;
42697
42701
  height: 100%;
42698
42702
  `;
42699
- const LineContainer = styled.div`
42703
+ const LineContainer = styled$1.div`
42700
42704
  display: flex;
42701
42705
  justify-content: space-between;
42702
42706
  align-items: center;
42703
42707
  width: 100%;
42704
42708
  `;
42705
- const ButtonContainer = styled.div`
42709
+ const ButtonContainer = styled$1.div`
42706
42710
  .ButtonContainer {
42707
42711
  label {
42708
42712
  white-space: nowrap;
42709
42713
  }
42710
42714
  }
42711
42715
  `;
42712
- const CustomTooltip = styled(Tooltip$2)`
42716
+ const CustomTooltip = styled$1(Tooltip$2)`
42713
42717
  .controls {
42714
42718
  padding: 12px 16px;
42715
42719
  font-size: 14px;
@@ -42717,20 +42721,74 @@ const CustomTooltip = styled(Tooltip$2)`
42717
42721
  &::before {
42718
42722
  left: 90%;
42719
42723
  }
42720
- ${props => props.trashIcon && `width: 150px;
42721
- white-space: normal;
42722
- max-height: 50px;
42723
- margin-top: 8px;`}
42724
42724
  }
42725
42725
  `;
42726
- const Container$1 = styled.div`
42726
+ const Container$1 = styled$1.div`
42727
42727
  display: flex;
42728
42728
  align-items: center;
42729
42729
  justify-content: space-between;
42730
42730
  padding: 38px 0 20px;
42731
42731
  box-sizing: border-box;
42732
42732
  `;
42733
- const Trash$1 = styled.div`
42733
+ const tooltipStyles = css`
42734
+ /* CSS-only tooltip */
42735
+ &[data-tooltip]:hover::before {
42736
+ content: attr(data-tooltip);
42737
+ position: fixed;
42738
+ background-color: white;
42739
+ color: #333;
42740
+ padding: 10px 16px;
42741
+ border-radius: 4px;
42742
+ font-family: "Poppins", sans-serif;
42743
+ font-size: 14px;
42744
+ font-weight: 400;
42745
+ z-index: 1000;
42746
+ pointer-events: none;
42747
+ width: 200px;
42748
+ white-space: pre-wrap;
42749
+ word-wrap: break-word;
42750
+ line-height: 1.8;
42751
+ box-shadow:
42752
+ 0 -2px 8px rgba(0, 0, 0, 0.15),
42753
+ 0 2px 8px rgba(0, 0, 0, 0.15);
42754
+
42755
+ /* Position above the element - using dynamic offset */
42756
+ top: calc(var(--tooltip-top, 0px) - var(--tooltip-offset, 60px));
42757
+ left: calc(var(--tooltip-left, 0px) + var(--tooltip-width, 0px) / 2);
42758
+ transform: translateX(-50%);
42759
+
42760
+ /* Add delay */
42761
+ opacity: 0;
42762
+ animation: showTooltip 0.3s ease-in-out 0.5s forwards;
42763
+ }
42764
+
42765
+ /* Tooltip arrow */
42766
+ &[data-tooltip]:hover::after {
42767
+ content: "";
42768
+ position: fixed;
42769
+ top: calc(
42770
+ var(--tooltip-top, 0px) - var(--tooltip-offset, 60px) +
42771
+ var(--tooltip-height, 50px)
42772
+ ); /* Use estimated tooltip height */
42773
+ left: calc(var(--tooltip-left, 0px) + var(--tooltip-width, 0px) / 2);
42774
+ transform: translateX(-50%);
42775
+ border: 8px solid transparent;
42776
+ border-top-color: white;
42777
+ z-index: 1001;
42778
+ pointer-events: none;
42779
+
42780
+ /* Add delay */
42781
+ opacity: 0;
42782
+ animation: showTooltip 0.3s ease-in-out 0.5s forwards;
42783
+ }
42784
+
42785
+ @keyframes showTooltip {
42786
+ to {
42787
+ opacity: 1;
42788
+ }
42789
+ }
42790
+ `;
42791
+ const baseIconWrapperStyles = css`
42734
42792
  display: flex;
42735
42793
  align-items: center;
42736
42794
  justify-content: center;
@@ -42738,9 +42796,6 @@ const Trash$1 = styled.div`
42738
42796
  height: 24px;
42739
42797
  padding: 0 12px;
42740
42798
  cursor: pointer;
42741
- ${props => props.disabled && `opacity: 0.5;
42742
- pointer-events: none;
42743
- user-select: none;`};
42744
42799
  svg {
42745
42800
  pointer-events: none;
42746
42801
  }
@@ -42748,6 +42803,23 @@ const Trash$1 = styled.div`
42748
42803
  svg path {
42749
42804
  fill: white;
42750
42805
  }
42806
+ `;
42807
+ const DisabledTrashIconWrapper = styled$1.div`
42808
+ ${baseIconWrapperStyles}
42809
+ ${tooltipStyles}
42810
+
42811
+ /* Tooltip customization */
42812
+ &[data-tooltip]:hover::before {
42813
+ text-align: left;
42814
+ left: calc(var(--tooltip-left, 0px) + var(--tooltip-width, 0px) / 2 - 50px);
42815
+ }
42816
+
42817
+ &[data-tooltip]:hover::after {
42818
+ left: calc(var(--tooltip-left, 0px) + var(--tooltip-width, 0px) / 2 - 50px);
42819
+ }
42820
+ `;
42821
+ const TrashIconWrapper = styled$1.div`
42822
+ ${baseIconWrapperStyles}
42751
42823
 
42752
42824
  &:hover {
42753
42825
  svg path {
@@ -52078,6 +52150,21 @@ const ItemManagerPanel = _ref => {
52078
52150
  setSelectedVendor(modifiedVendor);
52079
52151
  setScreen("subitem");
52080
52152
  };
52153
+ const setupTooltip = (el, tooltipText) => {
52154
+ if (el && tooltipText) {
52155
+ const rect = el.getBoundingClientRect();
52156
+ const {
52157
+ offset,
52158
+ height
52159
+ } = calculateTooltipOffset(tooltipText);
52160
+ el.style.setProperty('--tooltip-top', `${rect.top}px`);
52161
+ el.style.setProperty('--tooltip-left', `${rect.left}px`);
52162
+ el.style.setProperty('--tooltip-width', `${rect.width}px`);
52163
+ el.style.setProperty('--tooltip-offset', `${offset}px`);
52164
+ el.style.setProperty('--tooltip-height', `${height}px`);
52165
+ el.setAttribute('data-tooltip', tooltipText);
52166
+ }
52167
+ };
52081
52168
  const addNewPackage = (vendorName, packageName, component) => {
52082
52169
  setItemAndPackage(prev => {
52083
52170
  const vendorIndex = prev.findIndex(item => item.name === vendorName);
@@ -52301,27 +52388,22 @@ const ItemManagerPanel = _ref => {
52301
52388
  } else {
52302
52389
  return `${sentPackagesLength}/${packagesLength} sent`;
52303
52390
  }
52304
- })())), /*#__PURE__*/React$1.createElement(VendorChevron$1, null, /*#__PURE__*/React$1.createElement(ArrowRightFullIcon, null))), /*#__PURE__*/React$1.createElement(CustomTooltip, {
52305
- hideTooltip: !sentPackagesLength > 0,
52306
- content: trashTooltipText,
52307
- topFactor: 2,
52308
- direction: "left",
52309
- trashIcon: true
52310
- }, /*#__PURE__*/React$1.createElement(Trash$1, {
52311
- disabled: sentPackagesLength > 0,
52391
+ })())), /*#__PURE__*/React$1.createElement(VendorChevron$1, null, /*#__PURE__*/React$1.createElement(ArrowRightFullIcon, null))), sentPackagesLength > 0 ? /*#__PURE__*/React$1.createElement(DisabledTrashIconWrapper, {
52392
+ className: "trash-icon-disabled",
52393
+ ref: el => setupTooltip(el, trashTooltipText)
52394
+ }, /*#__PURE__*/React$1.createElement(DisabledTrashIcon, {
52395
+ width: "22",
52396
+ height: "22"
52397
+ })) : /*#__PURE__*/React$1.createElement(TrashIconWrapper, {
52312
52398
  className: "trash-icon",
52313
- onClick: () => {
52399
+ onClick: e => {
52400
+ e.stopPropagation();
52314
52401
  onDeleteVendor(item);
52315
52402
  }
52316
- }, /*#__PURE__*/React$1.createElement("svg", {
52403
+ }, /*#__PURE__*/React$1.createElement(TrashIcon, {
52317
52404
  width: "14",
52318
- height: "18",
52319
- viewBox: "0 0 14 18",
52320
- fill: "none",
52321
- xmlns: "http://www.w3.org/2000/svg"
52322
- }, /*#__PURE__*/React$1.createElement("path", {
52323
- d: "M1 16C1 17.1 1.9 18 3 18H11C12.1 18 13 17.1 13 16V4H1V16ZM14 1H10.5L9.5 0H4.5L3.5 1H0V3H14V1Z"
52324
- })))));
52405
+ height: "18"
52406
+ })));
52325
52407
  }))));
52326
52408
  }
52327
52409
  };
@@ -53348,7 +53430,8 @@ const QuickFilterCards = _ref => {
53348
53430
  let {
53349
53431
  data = [],
53350
53432
  onCardToggle = () => {},
53351
- width = "100%"
53433
+ width = "100%",
53434
+ CardsContainerClassName = "QuickFilterCardsContainer"
53352
53435
  } = _ref;
53353
53436
  // local mirror so UI updates immediately even if parent is slow/not controlling
53354
53437
  const [items, setItems] = useState(data);
@@ -53367,7 +53450,7 @@ const QuickFilterCards = _ref => {
53367
53450
  };
53368
53451
  return /*#__PURE__*/React$1.createElement(CardsContainer, {
53369
53452
  width: width,
53370
- className: "QuickFilterCardsContainer"
53453
+ className: CardsContainerClassName
53371
53454
  }, items.map(_ref2 => {
53372
53455
  let {
53373
53456
  status,