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.js
CHANGED
|
@@ -38379,22 +38379,35 @@ const TagContainer = styled__default["default"].div`
|
|
|
38379
38379
|
display: flex;
|
|
38380
38380
|
flex-wrap: wrap;
|
|
38381
38381
|
gap: 4px;
|
|
38382
|
-
align-items:
|
|
38382
|
+
align-items: center; /* Center items vertically */
|
|
38383
|
+
justify-content: flex-start;
|
|
38383
38384
|
max-width: 100%;
|
|
38384
38385
|
line-height: 1.5;
|
|
38386
|
+
min-height: 32px; /* Ensure minimum height for centering */
|
|
38387
|
+
`;
|
|
38388
|
+
const TagChipTextWrapper = styled__default["default"].div`
|
|
38389
|
+
padding: 0 8px; /* Add consistent padding on left and right */
|
|
38390
|
+
white-space: nowrap;
|
|
38391
|
+
overflow: hidden;
|
|
38392
|
+
text-overflow: ellipsis;
|
|
38393
|
+
max-width: 100%;
|
|
38385
38394
|
`;
|
|
38386
38395
|
const TagChip = styled__default["default"].span`
|
|
38387
38396
|
display: inline-flex;
|
|
38388
38397
|
align-items: center;
|
|
38389
|
-
padding: 2px
|
|
38398
|
+
padding: 2px 0px;
|
|
38390
38399
|
font-size: 12px;
|
|
38391
38400
|
font-weight: 500;
|
|
38392
38401
|
border-radius: 9999px; /* Tailwind's rounded-full */
|
|
38393
|
-
white-space: nowrap;
|
|
38394
38402
|
font-family: "Poppins", sans-serif;
|
|
38395
38403
|
border: 1px solid;
|
|
38396
38404
|
line-height: 1.3;
|
|
38397
38405
|
|
|
38406
|
+
/* Handle min/max width - support minWidth */
|
|
38407
|
+
min-width: ${props => props.$minWidth || "auto"};
|
|
38408
|
+
max-width: ${props => props.$maxWidth || "100px"};
|
|
38409
|
+
width: ${props => props.$minWidth ? props.$minWidth : "auto"};
|
|
38410
|
+
|
|
38398
38411
|
/* Dynamic colors via CSS custom properties */
|
|
38399
38412
|
background-color: ${props => props.$backgroundColor || '#F3F4F6'};
|
|
38400
38413
|
color: ${props => props.$textColor || '#374151'};
|
|
@@ -38432,7 +38445,8 @@ const MultiTagWrapper = styled__default["default"].div`
|
|
|
38432
38445
|
flex-wrap: wrap;
|
|
38433
38446
|
gap: 4px;
|
|
38434
38447
|
max-width: 100%;
|
|
38435
|
-
align-items:
|
|
38448
|
+
align-items: center; /* Center multiple tags vertically */
|
|
38449
|
+
min-height: 32px; /* Ensure minimum height for centering */
|
|
38436
38450
|
`;
|
|
38437
38451
|
const TextareaWrapper = styled__default["default"].div`
|
|
38438
38452
|
position: relative;
|
|
@@ -38924,33 +38938,30 @@ const TableBody = ({
|
|
|
38924
38938
|
const maxDisplay = tagConfig.maxDisplay || 3;
|
|
38925
38939
|
const isMultiple = tagConfig.multiple !== false; // Default to true
|
|
38926
38940
|
|
|
38927
|
-
//
|
|
38928
|
-
|
|
38929
|
-
const colorConfig = colors[
|
|
38930
|
-
|
|
38941
|
+
// Helper function to create a tag chip with proper tooltip
|
|
38942
|
+
const createTagChip = (tagValue, index = 0) => {
|
|
38943
|
+
const colorConfig = colors[tagValue] || defaultColor;
|
|
38944
|
+
const formattedText = formatTagText(tagValue);
|
|
38945
|
+
return /*#__PURE__*/React__default["default"].createElement(TagChip, {
|
|
38946
|
+
key: `${tagValue}-${index}`,
|
|
38931
38947
|
$backgroundColor: colorConfig.bg,
|
|
38932
38948
|
$textColor: colorConfig.text,
|
|
38933
38949
|
$borderColor: colorConfig.border,
|
|
38934
38950
|
$interactive: false,
|
|
38935
|
-
title:
|
|
38936
|
-
},
|
|
38951
|
+
title: formattedText // Always show full text in tooltip
|
|
38952
|
+
}, /*#__PURE__*/React__default["default"].createElement(TagChipTextWrapper, null, formattedText));
|
|
38953
|
+
};
|
|
38954
|
+
|
|
38955
|
+
// Handle single tag
|
|
38956
|
+
if (typeof value === 'string') {
|
|
38957
|
+
return /*#__PURE__*/React__default["default"].createElement(TagContainer, null, createTagChip(value));
|
|
38937
38958
|
}
|
|
38938
38959
|
|
|
38939
38960
|
// Handle multiple tags
|
|
38940
38961
|
if (Array.isArray(value) && isMultiple) {
|
|
38941
38962
|
const visibleTags = value.slice(0, maxDisplay);
|
|
38942
38963
|
const remainingCount = value.length - maxDisplay;
|
|
38943
|
-
return /*#__PURE__*/React__default["default"].createElement(TagContainer, null, /*#__PURE__*/React__default["default"].createElement(MultiTagWrapper, null, visibleTags.map((tag, index) => {
|
|
38944
|
-
const colorConfig = colors[tag] || defaultColor;
|
|
38945
|
-
return /*#__PURE__*/React__default["default"].createElement(TagChip, {
|
|
38946
|
-
key: `${tag}-${index}`,
|
|
38947
|
-
$backgroundColor: colorConfig.bg,
|
|
38948
|
-
$textColor: colorConfig.text,
|
|
38949
|
-
$borderColor: colorConfig.border,
|
|
38950
|
-
$interactive: false,
|
|
38951
|
-
title: tag
|
|
38952
|
-
}, formatTagText(tag));
|
|
38953
|
-
}), remainingCount > 0 && /*#__PURE__*/React__default["default"].createElement(TagOverflow, {
|
|
38964
|
+
return /*#__PURE__*/React__default["default"].createElement(TagContainer, null, /*#__PURE__*/React__default["default"].createElement(MultiTagWrapper, null, visibleTags.map((tag, index) => createTagChip(tag, index)), remainingCount > 0 && /*#__PURE__*/React__default["default"].createElement(TagOverflow, {
|
|
38954
38965
|
title: `${remainingCount} more: ${value.slice(maxDisplay).map(tag => formatTagText(tag)).join(', ')}`
|
|
38955
38966
|
}, "+", remainingCount)));
|
|
38956
38967
|
}
|