sag_components 2.0.0-beta147 → 2.0.0-beta148

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
@@ -10320,24 +10320,23 @@ const QuarterPopupPicker = ({
10320
10320
  };
10321
10321
 
10322
10322
  /* eslint-disable import/no-extraneous-dependencies */
10323
- const QuarterPicker = _ref => {
10324
- let {
10325
- availableQuarters,
10326
- // ["Q1-2024"]
10327
- label,
10328
- onChange,
10329
- borderRadius,
10330
- required,
10331
- width,
10332
- height,
10333
- placeholder,
10334
- disabled,
10335
- borderColor,
10336
- borderColorFocus,
10337
- textColor,
10338
- selectedValue,
10339
- startYear
10340
- } = _ref;
10323
+ const QuarterPicker = ({
10324
+ availableQuarters,
10325
+ // ["Q1-2024"]
10326
+ label,
10327
+ onChange,
10328
+ borderRadius,
10329
+ required,
10330
+ width,
10331
+ height,
10332
+ placeholder,
10333
+ disabled,
10334
+ borderColor,
10335
+ borderColorFocus,
10336
+ textColor,
10337
+ selectedValue,
10338
+ startYear
10339
+ }) => {
10341
10340
  const [isFocused, setIsFocused] = useState(false);
10342
10341
  const [isOpen, setIsOpen] = useState(false);
10343
10342
  const [value, setValue] = useState('');
@@ -10779,23 +10778,22 @@ const MonthPopupPicker = ({
10779
10778
  };
10780
10779
 
10781
10780
  /* eslint-disable import/no-extraneous-dependencies */
10782
- const MonthPicker = _ref => {
10783
- let {
10784
- availableMonths,
10785
- label,
10786
- onChange,
10787
- borderRadius,
10788
- required,
10789
- width,
10790
- height,
10791
- placeholder,
10792
- disabled,
10793
- borderColor,
10794
- borderColorFocus,
10795
- textColor,
10796
- selectedValue,
10797
- startYear
10798
- } = _ref;
10781
+ const MonthPicker = ({
10782
+ availableMonths,
10783
+ label,
10784
+ onChange,
10785
+ borderRadius,
10786
+ required,
10787
+ width,
10788
+ height,
10789
+ placeholder,
10790
+ disabled,
10791
+ borderColor,
10792
+ borderColorFocus,
10793
+ textColor,
10794
+ selectedValue,
10795
+ startYear
10796
+ }) => {
10799
10797
  const [isFocused, setIsFocused] = useState(false);
10800
10798
  const [isOpen, setIsOpen] = useState(false);
10801
10799
  const [value, setValue] = useState('');
@@ -23906,22 +23904,21 @@ const DeleteIcon = styled.div`
23906
23904
  position: absolute;
23907
23905
  `;
23908
23906
 
23909
- const QuickFilterDropdownSingle = _ref => {
23910
- let {
23911
- label,
23912
- hoverColor,
23913
- options,
23914
- selectedValue,
23915
- placeHolder,
23916
- onChange,
23917
- disabled,
23918
- width,
23919
- error,
23920
- errorMessage,
23921
- xIconShow,
23922
- labelColor,
23923
- showLabelOnTop
23924
- } = _ref;
23907
+ const QuickFilterDropdownSingle = ({
23908
+ label,
23909
+ hoverColor,
23910
+ options,
23911
+ selectedValue,
23912
+ placeHolder,
23913
+ onChange,
23914
+ disabled,
23915
+ width,
23916
+ error,
23917
+ errorMessage,
23918
+ xIconShow,
23919
+ labelColor,
23920
+ showLabelOnTop
23921
+ }) => {
23925
23922
  const [isFocused, setIsFocused] = useState(false);
23926
23923
  const [showOptions, setShowOptions] = useState(false);
23927
23924
  const [inputValue, setInputValue] = useState("");
@@ -35566,9 +35563,9 @@ const ToggleSlider = styled.span`
35566
35563
  }
35567
35564
  `;
35568
35565
 
35569
- /**
35570
- * ToggleSwitch component for on/off states.
35571
- * Supports small/large sizes and disabled state.
35566
+ /**
35567
+ * ToggleSwitch component for on/off states.
35568
+ * Supports small/large sizes and disabled state.
35572
35569
  */
35573
35570
  function ToggleSwitch(_ref) {
35574
35571
  let {
@@ -38121,6 +38118,15 @@ const TableCell = styled.td`
38121
38118
  position: relative;
38122
38119
  transition: all 0.3s ease;
38123
38120
 
38121
+ /* Special handling for tag cells - allow wrapping */
38122
+ ${props => props.$fieldType === 'tag' && `
38123
+ white-space: normal;
38124
+ overflow: visible;
38125
+ text-overflow: unset;
38126
+ line-height: 1.5;
38127
+ vertical-align: top;
38128
+ `}
38129
+
38124
38130
  /* CSS-only tooltip */
38125
38131
  &[data-tooltip]:hover::before {
38126
38132
  content: attr(data-tooltip);
@@ -38326,6 +38332,67 @@ const StatusCellCircle = styled.div`
38326
38332
  border: 1px solid white;
38327
38333
  background-color: ${props => props.backgroundColor};
38328
38334
  `;
38335
+
38336
+ // NEW TAG STYLES
38337
+ const TagContainer = styled.div`
38338
+ display: flex;
38339
+ flex-wrap: wrap;
38340
+ gap: 4px;
38341
+ align-items: flex-start;
38342
+ max-width: 100%;
38343
+ line-height: 1.5;
38344
+ `;
38345
+ const TagChip = styled.span`
38346
+ display: inline-flex;
38347
+ align-items: center;
38348
+ padding: 2px 8px;
38349
+ font-size: 12px;
38350
+ font-weight: 500;
38351
+ border-radius: 9999px; /* Tailwind's rounded-full */
38352
+ white-space: nowrap;
38353
+ font-family: "Poppins", sans-serif;
38354
+ border: 1px solid;
38355
+ line-height: 1.3;
38356
+
38357
+ /* Dynamic colors via CSS custom properties */
38358
+ background-color: ${props => props.$backgroundColor || '#F3F4F6'};
38359
+ color: ${props => props.$textColor || '#374151'};
38360
+ border-color: ${props => props.$borderColor || '#9CA3AF'};
38361
+
38362
+ /* Tailwind-style transitions */
38363
+ transition: all 0.15s ease-in-out;
38364
+
38365
+ /* Hover effect for interactive tags */
38366
+ ${props => props.$interactive && `
38367
+ cursor: pointer;
38368
+ &:hover {
38369
+ opacity: 0.8;
38370
+ transform: translateY(-1px);
38371
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
38372
+ }
38373
+ `}
38374
+ `;
38375
+ const TagOverflow = styled.span`
38376
+ font-size: 12px;
38377
+ font-weight: 500;
38378
+ color: #6B7280;
38379
+ font-family: "Poppins", sans-serif;
38380
+ cursor: help;
38381
+ display: inline-flex;
38382
+ align-items: center;
38383
+ padding: 2px 4px;
38384
+
38385
+ &:hover {
38386
+ color: #374151;
38387
+ }
38388
+ `;
38389
+ const MultiTagWrapper = styled.div`
38390
+ display: flex;
38391
+ flex-wrap: wrap;
38392
+ gap: 4px;
38393
+ max-width: 100%;
38394
+ align-items: flex-start;
38395
+ `;
38329
38396
  const TextareaWrapper = styled.div`
38330
38397
  position: relative;
38331
38398
  display: flex;
@@ -38757,6 +38824,12 @@ const TableBody = ({
38757
38824
  height: tooltipHeight
38758
38825
  };
38759
38826
  };
38827
+
38828
+ // Helper function to format tag text
38829
+ const formatTagText = tag => {
38830
+ if (typeof tag !== 'string') return tag;
38831
+ return tag.replace(/-/g, ' ').replace(/\b\w/g, l => l.toUpperCase());
38832
+ };
38760
38833
  const formatValue = (value, column, row, rowIndex) => {
38761
38834
  if (value === null || value === undefined) {
38762
38835
  return '';
@@ -38798,6 +38871,54 @@ const TableBody = ({
38798
38871
  return value.join(', ');
38799
38872
  }
38800
38873
  return value;
38874
+ case 'tag':
38875
+ if (!value) return '';
38876
+ const tagConfig = column.tagConfig || {};
38877
+ const colors = tagConfig.colors || {};
38878
+ const defaultColor = tagConfig.defaultColor || {
38879
+ bg: '#F3F4F6',
38880
+ text: '#374151',
38881
+ border: '#9CA3AF'
38882
+ };
38883
+ const maxDisplay = tagConfig.maxDisplay || 3;
38884
+ const isMultiple = tagConfig.multiple !== false; // Default to true
38885
+
38886
+ // Handle single tag
38887
+ if (typeof value === 'string') {
38888
+ const colorConfig = colors[value] || defaultColor;
38889
+ return /*#__PURE__*/React$1.createElement(TagContainer, null, /*#__PURE__*/React$1.createElement(TagChip, {
38890
+ $backgroundColor: colorConfig.bg,
38891
+ $textColor: colorConfig.text,
38892
+ $borderColor: colorConfig.border,
38893
+ $interactive: false,
38894
+ title: value
38895
+ }, formatTagText(value)));
38896
+ }
38897
+
38898
+ // Handle multiple tags
38899
+ if (Array.isArray(value) && isMultiple) {
38900
+ const visibleTags = value.slice(0, maxDisplay);
38901
+ const remainingCount = value.length - maxDisplay;
38902
+ return /*#__PURE__*/React$1.createElement(TagContainer, null, /*#__PURE__*/React$1.createElement(MultiTagWrapper, null, visibleTags.map((tag, index) => {
38903
+ const colorConfig = colors[tag] || defaultColor;
38904
+ return /*#__PURE__*/React$1.createElement(TagChip, {
38905
+ key: `${tag}-${index}`,
38906
+ $backgroundColor: colorConfig.bg,
38907
+ $textColor: colorConfig.text,
38908
+ $borderColor: colorConfig.border,
38909
+ $interactive: false,
38910
+ title: tag
38911
+ }, formatTagText(tag));
38912
+ }), remainingCount > 0 && /*#__PURE__*/React$1.createElement(TagOverflow, {
38913
+ title: `${remainingCount} more: ${value.slice(maxDisplay).map(tag => formatTagText(tag)).join(', ')}`
38914
+ }, "+", remainingCount)));
38915
+ }
38916
+
38917
+ // Fallback for array treated as single tag
38918
+ if (Array.isArray(value)) {
38919
+ return formatValue(value[0], column, row, rowIndex);
38920
+ }
38921
+ return value;
38801
38922
  case 'packagestatus':
38802
38923
  // Helper function to apply tooltip logic
38803
38924
  const applyTooltipLogic = (element, tooltipText) => {
@@ -38964,7 +39085,7 @@ const TableBody = ({
38964
39085
  el.style.setProperty('--tooltip-left', `${rect.left}px`);
38965
39086
  el.style.setProperty('--tooltip-width', `${rect.width}px`);
38966
39087
  el.style.setProperty('--tooltip-offset', `${offset}px`);
38967
- el.style.setProperty('--tooltip-height', `${offset}px`);
39088
+ el.style.setProperty('--tooltip-height', `${height}px`);
38968
39089
  el.setAttribute('data-tooltip', trashTooltipText);
38969
39090
  }
38970
39091
  }
@@ -39048,10 +39169,14 @@ TableBody.propTypes = {
39048
39169
  onRowClick: PropTypes.func,
39049
39170
  onSendClick: PropTypes.func,
39050
39171
  buttonColor: PropTypes.string,
39172
+ buttonHoverColor: PropTypes.string,
39173
+ selectedColor: PropTypes.string,
39051
39174
  onDeleteClick: PropTypes.func,
39052
- resetFocus: PropTypes.bool,
39175
+ resetFocusIndex: PropTypes.bool,
39176
+ changeFocusIndex: PropTypes.number,
39053
39177
  onFocusChange: PropTypes.func,
39054
39178
  indexToShimmer: PropTypes.number,
39179
+ statuses: PropTypes.array,
39055
39180
  onCommentSave: PropTypes.func,
39056
39181
  commentTextLimit: PropTypes.number,
39057
39182
  ref: PropTypes.object