sag_components 2.0.0-beta154 → 2.0.0-beta155
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 +32 -21
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +32 -21
- package/dist/index.js.map +1 -1
- package/dist/types/components/Table/TableBody.styles.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -38369,22 +38369,35 @@ const TagContainer = styled.div`
|
|
|
38369
38369
|
display: flex;
|
|
38370
38370
|
flex-wrap: wrap;
|
|
38371
38371
|
gap: 4px;
|
|
38372
|
-
align-items:
|
|
38372
|
+
align-items: center; /* Center items vertically */
|
|
38373
|
+
justify-content: flex-start;
|
|
38373
38374
|
max-width: 100%;
|
|
38374
38375
|
line-height: 1.5;
|
|
38376
|
+
min-height: 32px; /* Ensure minimum height for centering */
|
|
38377
|
+
`;
|
|
38378
|
+
const TagChipTextWrapper = styled.div`
|
|
38379
|
+
padding: 0 8px; /* Add consistent padding on left and right */
|
|
38380
|
+
white-space: nowrap;
|
|
38381
|
+
overflow: hidden;
|
|
38382
|
+
text-overflow: ellipsis;
|
|
38383
|
+
max-width: 100%;
|
|
38375
38384
|
`;
|
|
38376
38385
|
const TagChip = styled.span`
|
|
38377
38386
|
display: inline-flex;
|
|
38378
38387
|
align-items: center;
|
|
38379
|
-
padding: 2px
|
|
38388
|
+
padding: 2px 0px;
|
|
38380
38389
|
font-size: 12px;
|
|
38381
38390
|
font-weight: 500;
|
|
38382
38391
|
border-radius: 9999px; /* Tailwind's rounded-full */
|
|
38383
|
-
white-space: nowrap;
|
|
38384
38392
|
font-family: "Poppins", sans-serif;
|
|
38385
38393
|
border: 1px solid;
|
|
38386
38394
|
line-height: 1.3;
|
|
38387
38395
|
|
|
38396
|
+
/* Handle min/max width - support minWidth */
|
|
38397
|
+
min-width: ${props => props.$minWidth || "auto"};
|
|
38398
|
+
max-width: ${props => props.$maxWidth || "100px"};
|
|
38399
|
+
width: ${props => props.$minWidth ? props.$minWidth : "auto"};
|
|
38400
|
+
|
|
38388
38401
|
/* Dynamic colors via CSS custom properties */
|
|
38389
38402
|
background-color: ${props => props.$backgroundColor || '#F3F4F6'};
|
|
38390
38403
|
color: ${props => props.$textColor || '#374151'};
|
|
@@ -38422,7 +38435,8 @@ const MultiTagWrapper = styled.div`
|
|
|
38422
38435
|
flex-wrap: wrap;
|
|
38423
38436
|
gap: 4px;
|
|
38424
38437
|
max-width: 100%;
|
|
38425
|
-
align-items:
|
|
38438
|
+
align-items: center; /* Center multiple tags vertically */
|
|
38439
|
+
min-height: 32px; /* Ensure minimum height for centering */
|
|
38426
38440
|
`;
|
|
38427
38441
|
const TextareaWrapper = styled.div`
|
|
38428
38442
|
position: relative;
|
|
@@ -38914,33 +38928,30 @@ const TableBody = ({
|
|
|
38914
38928
|
const maxDisplay = tagConfig.maxDisplay || 3;
|
|
38915
38929
|
const isMultiple = tagConfig.multiple !== false; // Default to true
|
|
38916
38930
|
|
|
38917
|
-
//
|
|
38918
|
-
|
|
38919
|
-
const colorConfig = colors[
|
|
38920
|
-
|
|
38931
|
+
// Helper function to create a tag chip with proper tooltip
|
|
38932
|
+
const createTagChip = (tagValue, index = 0) => {
|
|
38933
|
+
const colorConfig = colors[tagValue] || defaultColor;
|
|
38934
|
+
const formattedText = formatTagText(tagValue);
|
|
38935
|
+
return /*#__PURE__*/React$1.createElement(TagChip, {
|
|
38936
|
+
key: `${tagValue}-${index}`,
|
|
38921
38937
|
$backgroundColor: colorConfig.bg,
|
|
38922
38938
|
$textColor: colorConfig.text,
|
|
38923
38939
|
$borderColor: colorConfig.border,
|
|
38924
38940
|
$interactive: false,
|
|
38925
|
-
title:
|
|
38926
|
-
},
|
|
38941
|
+
title: formattedText // Always show full text in tooltip
|
|
38942
|
+
}, /*#__PURE__*/React$1.createElement(TagChipTextWrapper, null, formattedText));
|
|
38943
|
+
};
|
|
38944
|
+
|
|
38945
|
+
// Handle single tag
|
|
38946
|
+
if (typeof value === 'string') {
|
|
38947
|
+
return /*#__PURE__*/React$1.createElement(TagContainer, null, createTagChip(value));
|
|
38927
38948
|
}
|
|
38928
38949
|
|
|
38929
38950
|
// Handle multiple tags
|
|
38930
38951
|
if (Array.isArray(value) && isMultiple) {
|
|
38931
38952
|
const visibleTags = value.slice(0, maxDisplay);
|
|
38932
38953
|
const remainingCount = value.length - maxDisplay;
|
|
38933
|
-
return /*#__PURE__*/React$1.createElement(TagContainer, null, /*#__PURE__*/React$1.createElement(MultiTagWrapper, null, visibleTags.map((tag, index) => {
|
|
38934
|
-
const colorConfig = colors[tag] || defaultColor;
|
|
38935
|
-
return /*#__PURE__*/React$1.createElement(TagChip, {
|
|
38936
|
-
key: `${tag}-${index}`,
|
|
38937
|
-
$backgroundColor: colorConfig.bg,
|
|
38938
|
-
$textColor: colorConfig.text,
|
|
38939
|
-
$borderColor: colorConfig.border,
|
|
38940
|
-
$interactive: false,
|
|
38941
|
-
title: tag
|
|
38942
|
-
}, formatTagText(tag));
|
|
38943
|
-
}), remainingCount > 0 && /*#__PURE__*/React$1.createElement(TagOverflow, {
|
|
38954
|
+
return /*#__PURE__*/React$1.createElement(TagContainer, null, /*#__PURE__*/React$1.createElement(MultiTagWrapper, null, visibleTags.map((tag, index) => createTagChip(tag, index)), remainingCount > 0 && /*#__PURE__*/React$1.createElement(TagOverflow, {
|
|
38944
38955
|
title: `${remainingCount} more: ${value.slice(maxDisplay).map(tag => formatTagText(tag)).join(', ')}`
|
|
38945
38956
|
}, "+", remainingCount)));
|
|
38946
38957
|
}
|