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.js CHANGED
@@ -10330,24 +10330,23 @@ const QuarterPopupPicker = ({
10330
10330
  };
10331
10331
 
10332
10332
  /* eslint-disable import/no-extraneous-dependencies */
10333
- const QuarterPicker = _ref => {
10334
- let {
10335
- availableQuarters,
10336
- // ["Q1-2024"]
10337
- label,
10338
- onChange,
10339
- borderRadius,
10340
- required,
10341
- width,
10342
- height,
10343
- placeholder,
10344
- disabled,
10345
- borderColor,
10346
- borderColorFocus,
10347
- textColor,
10348
- selectedValue,
10349
- startYear
10350
- } = _ref;
10333
+ const QuarterPicker = ({
10334
+ availableQuarters,
10335
+ // ["Q1-2024"]
10336
+ label,
10337
+ onChange,
10338
+ borderRadius,
10339
+ required,
10340
+ width,
10341
+ height,
10342
+ placeholder,
10343
+ disabled,
10344
+ borderColor,
10345
+ borderColorFocus,
10346
+ textColor,
10347
+ selectedValue,
10348
+ startYear
10349
+ }) => {
10351
10350
  const [isFocused, setIsFocused] = React$1.useState(false);
10352
10351
  const [isOpen, setIsOpen] = React$1.useState(false);
10353
10352
  const [value, setValue] = React$1.useState('');
@@ -10789,23 +10788,22 @@ const MonthPopupPicker = ({
10789
10788
  };
10790
10789
 
10791
10790
  /* eslint-disable import/no-extraneous-dependencies */
10792
- const MonthPicker = _ref => {
10793
- let {
10794
- availableMonths,
10795
- label,
10796
- onChange,
10797
- borderRadius,
10798
- required,
10799
- width,
10800
- height,
10801
- placeholder,
10802
- disabled,
10803
- borderColor,
10804
- borderColorFocus,
10805
- textColor,
10806
- selectedValue,
10807
- startYear
10808
- } = _ref;
10791
+ const MonthPicker = ({
10792
+ availableMonths,
10793
+ label,
10794
+ onChange,
10795
+ borderRadius,
10796
+ required,
10797
+ width,
10798
+ height,
10799
+ placeholder,
10800
+ disabled,
10801
+ borderColor,
10802
+ borderColorFocus,
10803
+ textColor,
10804
+ selectedValue,
10805
+ startYear
10806
+ }) => {
10809
10807
  const [isFocused, setIsFocused] = React$1.useState(false);
10810
10808
  const [isOpen, setIsOpen] = React$1.useState(false);
10811
10809
  const [value, setValue] = React$1.useState('');
@@ -23916,22 +23914,21 @@ const DeleteIcon = styled__default["default"].div`
23916
23914
  position: absolute;
23917
23915
  `;
23918
23916
 
23919
- const QuickFilterDropdownSingle = _ref => {
23920
- let {
23921
- label,
23922
- hoverColor,
23923
- options,
23924
- selectedValue,
23925
- placeHolder,
23926
- onChange,
23927
- disabled,
23928
- width,
23929
- error,
23930
- errorMessage,
23931
- xIconShow,
23932
- labelColor,
23933
- showLabelOnTop
23934
- } = _ref;
23917
+ const QuickFilterDropdownSingle = ({
23918
+ label,
23919
+ hoverColor,
23920
+ options,
23921
+ selectedValue,
23922
+ placeHolder,
23923
+ onChange,
23924
+ disabled,
23925
+ width,
23926
+ error,
23927
+ errorMessage,
23928
+ xIconShow,
23929
+ labelColor,
23930
+ showLabelOnTop
23931
+ }) => {
23935
23932
  const [isFocused, setIsFocused] = React$1.useState(false);
23936
23933
  const [showOptions, setShowOptions] = React$1.useState(false);
23937
23934
  const [inputValue, setInputValue] = React$1.useState("");
@@ -35576,9 +35573,9 @@ const ToggleSlider = styled__default["default"].span`
35576
35573
  }
35577
35574
  `;
35578
35575
 
35579
- /**
35580
- * ToggleSwitch component for on/off states.
35581
- * Supports small/large sizes and disabled state.
35576
+ /**
35577
+ * ToggleSwitch component for on/off states.
35578
+ * Supports small/large sizes and disabled state.
35582
35579
  */
35583
35580
  function ToggleSwitch(_ref) {
35584
35581
  let {
@@ -38131,6 +38128,15 @@ const TableCell = styled__default["default"].td`
38131
38128
  position: relative;
38132
38129
  transition: all 0.3s ease;
38133
38130
 
38131
+ /* Special handling for tag cells - allow wrapping */
38132
+ ${props => props.$fieldType === 'tag' && `
38133
+ white-space: normal;
38134
+ overflow: visible;
38135
+ text-overflow: unset;
38136
+ line-height: 1.5;
38137
+ vertical-align: top;
38138
+ `}
38139
+
38134
38140
  /* CSS-only tooltip */
38135
38141
  &[data-tooltip]:hover::before {
38136
38142
  content: attr(data-tooltip);
@@ -38336,6 +38342,67 @@ const StatusCellCircle = styled__default["default"].div`
38336
38342
  border: 1px solid white;
38337
38343
  background-color: ${props => props.backgroundColor};
38338
38344
  `;
38345
+
38346
+ // NEW TAG STYLES
38347
+ const TagContainer = styled__default["default"].div`
38348
+ display: flex;
38349
+ flex-wrap: wrap;
38350
+ gap: 4px;
38351
+ align-items: flex-start;
38352
+ max-width: 100%;
38353
+ line-height: 1.5;
38354
+ `;
38355
+ const TagChip = styled__default["default"].span`
38356
+ display: inline-flex;
38357
+ align-items: center;
38358
+ padding: 2px 8px;
38359
+ font-size: 12px;
38360
+ font-weight: 500;
38361
+ border-radius: 9999px; /* Tailwind's rounded-full */
38362
+ white-space: nowrap;
38363
+ font-family: "Poppins", sans-serif;
38364
+ border: 1px solid;
38365
+ line-height: 1.3;
38366
+
38367
+ /* Dynamic colors via CSS custom properties */
38368
+ background-color: ${props => props.$backgroundColor || '#F3F4F6'};
38369
+ color: ${props => props.$textColor || '#374151'};
38370
+ border-color: ${props => props.$borderColor || '#9CA3AF'};
38371
+
38372
+ /* Tailwind-style transitions */
38373
+ transition: all 0.15s ease-in-out;
38374
+
38375
+ /* Hover effect for interactive tags */
38376
+ ${props => props.$interactive && `
38377
+ cursor: pointer;
38378
+ &:hover {
38379
+ opacity: 0.8;
38380
+ transform: translateY(-1px);
38381
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
38382
+ }
38383
+ `}
38384
+ `;
38385
+ const TagOverflow = styled__default["default"].span`
38386
+ font-size: 12px;
38387
+ font-weight: 500;
38388
+ color: #6B7280;
38389
+ font-family: "Poppins", sans-serif;
38390
+ cursor: help;
38391
+ display: inline-flex;
38392
+ align-items: center;
38393
+ padding: 2px 4px;
38394
+
38395
+ &:hover {
38396
+ color: #374151;
38397
+ }
38398
+ `;
38399
+ const MultiTagWrapper = styled__default["default"].div`
38400
+ display: flex;
38401
+ flex-wrap: wrap;
38402
+ gap: 4px;
38403
+ max-width: 100%;
38404
+ align-items: flex-start;
38405
+ `;
38339
38406
  const TextareaWrapper = styled__default["default"].div`
38340
38407
  position: relative;
38341
38408
  display: flex;
@@ -38767,6 +38834,12 @@ const TableBody = ({
38767
38834
  height: tooltipHeight
38768
38835
  };
38769
38836
  };
38837
+
38838
+ // Helper function to format tag text
38839
+ const formatTagText = tag => {
38840
+ if (typeof tag !== 'string') return tag;
38841
+ return tag.replace(/-/g, ' ').replace(/\b\w/g, l => l.toUpperCase());
38842
+ };
38770
38843
  const formatValue = (value, column, row, rowIndex) => {
38771
38844
  if (value === null || value === undefined) {
38772
38845
  return '';
@@ -38808,6 +38881,54 @@ const TableBody = ({
38808
38881
  return value.join(', ');
38809
38882
  }
38810
38883
  return value;
38884
+ case 'tag':
38885
+ if (!value) return '';
38886
+ const tagConfig = column.tagConfig || {};
38887
+ const colors = tagConfig.colors || {};
38888
+ const defaultColor = tagConfig.defaultColor || {
38889
+ bg: '#F3F4F6',
38890
+ text: '#374151',
38891
+ border: '#9CA3AF'
38892
+ };
38893
+ const maxDisplay = tagConfig.maxDisplay || 3;
38894
+ const isMultiple = tagConfig.multiple !== false; // Default to true
38895
+
38896
+ // Handle single tag
38897
+ if (typeof value === 'string') {
38898
+ const colorConfig = colors[value] || defaultColor;
38899
+ return /*#__PURE__*/React__default["default"].createElement(TagContainer, null, /*#__PURE__*/React__default["default"].createElement(TagChip, {
38900
+ $backgroundColor: colorConfig.bg,
38901
+ $textColor: colorConfig.text,
38902
+ $borderColor: colorConfig.border,
38903
+ $interactive: false,
38904
+ title: value
38905
+ }, formatTagText(value)));
38906
+ }
38907
+
38908
+ // Handle multiple tags
38909
+ if (Array.isArray(value) && isMultiple) {
38910
+ const visibleTags = value.slice(0, maxDisplay);
38911
+ const remainingCount = value.length - maxDisplay;
38912
+ return /*#__PURE__*/React__default["default"].createElement(TagContainer, null, /*#__PURE__*/React__default["default"].createElement(MultiTagWrapper, null, visibleTags.map((tag, index) => {
38913
+ const colorConfig = colors[tag] || defaultColor;
38914
+ return /*#__PURE__*/React__default["default"].createElement(TagChip, {
38915
+ key: `${tag}-${index}`,
38916
+ $backgroundColor: colorConfig.bg,
38917
+ $textColor: colorConfig.text,
38918
+ $borderColor: colorConfig.border,
38919
+ $interactive: false,
38920
+ title: tag
38921
+ }, formatTagText(tag));
38922
+ }), remainingCount > 0 && /*#__PURE__*/React__default["default"].createElement(TagOverflow, {
38923
+ title: `${remainingCount} more: ${value.slice(maxDisplay).map(tag => formatTagText(tag)).join(', ')}`
38924
+ }, "+", remainingCount)));
38925
+ }
38926
+
38927
+ // Fallback for array treated as single tag
38928
+ if (Array.isArray(value)) {
38929
+ return formatValue(value[0], column, row, rowIndex);
38930
+ }
38931
+ return value;
38811
38932
  case 'packagestatus':
38812
38933
  // Helper function to apply tooltip logic
38813
38934
  const applyTooltipLogic = (element, tooltipText) => {
@@ -38974,7 +39095,7 @@ const TableBody = ({
38974
39095
  el.style.setProperty('--tooltip-left', `${rect.left}px`);
38975
39096
  el.style.setProperty('--tooltip-width', `${rect.width}px`);
38976
39097
  el.style.setProperty('--tooltip-offset', `${offset}px`);
38977
- el.style.setProperty('--tooltip-height', `${offset}px`);
39098
+ el.style.setProperty('--tooltip-height', `${height}px`);
38978
39099
  el.setAttribute('data-tooltip', trashTooltipText);
38979
39100
  }
38980
39101
  }
@@ -39058,10 +39179,14 @@ TableBody.propTypes = {
39058
39179
  onRowClick: PropTypes.func,
39059
39180
  onSendClick: PropTypes.func,
39060
39181
  buttonColor: PropTypes.string,
39182
+ buttonHoverColor: PropTypes.string,
39183
+ selectedColor: PropTypes.string,
39061
39184
  onDeleteClick: PropTypes.func,
39062
- resetFocus: PropTypes.bool,
39185
+ resetFocusIndex: PropTypes.bool,
39186
+ changeFocusIndex: PropTypes.number,
39063
39187
  onFocusChange: PropTypes.func,
39064
39188
  indexToShimmer: PropTypes.number,
39189
+ statuses: PropTypes.array,
39065
39190
  onCommentSave: PropTypes.func,
39066
39191
  commentTextLimit: PropTypes.number,
39067
39192
  ref: PropTypes.object