sag_components 2.0.0-beta306 → 2.0.0-beta307
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
|
@@ -57729,6 +57729,21 @@ function ModalDrawer(_ref) {
|
|
|
57729
57729
|
}, "\xD7"), children));
|
|
57730
57730
|
}
|
|
57731
57731
|
|
|
57732
|
+
// Keyframes for rolling/marquee animation
|
|
57733
|
+
const scrollTextAnimation = styled.keyframes`
|
|
57734
|
+
0% {
|
|
57735
|
+
transform: translateX(0);
|
|
57736
|
+
}
|
|
57737
|
+
10% {
|
|
57738
|
+
transform: translateX(0);
|
|
57739
|
+
}
|
|
57740
|
+
90% {
|
|
57741
|
+
transform: translateX(var(--scroll-distance, -30%));
|
|
57742
|
+
}
|
|
57743
|
+
100% {
|
|
57744
|
+
transform: translateX(var(--scroll-distance, -30%));
|
|
57745
|
+
}
|
|
57746
|
+
`;
|
|
57732
57747
|
const scrollableStyles = `
|
|
57733
57748
|
&::-webkit-scrollbar {
|
|
57734
57749
|
height: 8px;
|
|
@@ -57747,6 +57762,9 @@ const scrollableStyles = `
|
|
|
57747
57762
|
`;
|
|
57748
57763
|
const TooltipWrapper = styled__default["default"](Tooltip$2)`
|
|
57749
57764
|
width: 100%;
|
|
57765
|
+
.tooltip-wrapper {
|
|
57766
|
+
width: 100%;
|
|
57767
|
+
}
|
|
57750
57768
|
`;
|
|
57751
57769
|
const DropdownContainer = styled__default["default"].div`
|
|
57752
57770
|
position: relative;
|
|
@@ -57844,6 +57862,41 @@ const Wrapper = styled__default["default"].div`
|
|
|
57844
57862
|
align-items: center;
|
|
57845
57863
|
width: 100%;
|
|
57846
57864
|
`;
|
|
57865
|
+
|
|
57866
|
+
// Wrapper for scrollable truncated text
|
|
57867
|
+
const ScrollableTextWrapper = styled__default["default"].div`
|
|
57868
|
+
flex: 1;
|
|
57869
|
+
display: flex;
|
|
57870
|
+
align-items: center;
|
|
57871
|
+
min-width: 0;
|
|
57872
|
+
overflow: hidden;
|
|
57873
|
+
position: relative;
|
|
57874
|
+
`;
|
|
57875
|
+
|
|
57876
|
+
// Inner text that scrolls when truncated
|
|
57877
|
+
const ScrollableTextInner = styled__default["default"].span`
|
|
57878
|
+
display: inline-block;
|
|
57879
|
+
white-space: nowrap;
|
|
57880
|
+
line-height: 21px;
|
|
57881
|
+
font-family: "Poppins", sans-serif;
|
|
57882
|
+
font-size: 14px;
|
|
57883
|
+
font-weight: 400;
|
|
57884
|
+
color: ${props => props.color || 'inherit'};
|
|
57885
|
+
max-width: 100%;
|
|
57886
|
+
|
|
57887
|
+
/* Default state: show ellipsis */
|
|
57888
|
+
overflow: hidden;
|
|
57889
|
+
text-overflow: ellipsis;
|
|
57890
|
+
|
|
57891
|
+
${props => props.$isTruncated && styled.css`
|
|
57892
|
+
${ScrollableTextWrapper}:hover & {
|
|
57893
|
+
/* On hover: remove ellipsis and start animation */
|
|
57894
|
+
overflow: visible;
|
|
57895
|
+
text-overflow: clip;
|
|
57896
|
+
animation: ${scrollTextAnimation} ${props.$animationDuration || 3}s linear infinite;
|
|
57897
|
+
}
|
|
57898
|
+
`}
|
|
57899
|
+
`;
|
|
57847
57900
|
const TruncatedText = styled__default["default"].span`
|
|
57848
57901
|
flex: 1;
|
|
57849
57902
|
min-width: 0;
|
|
@@ -58160,7 +58213,54 @@ OverlayTemplateDialog.propTypes = {
|
|
|
58160
58213
|
buttonHoverColor: PropTypes.string
|
|
58161
58214
|
};
|
|
58162
58215
|
|
|
58163
|
-
|
|
58216
|
+
// Component for scrolling truncated text on hover
|
|
58217
|
+
const ScrollingText = _ref => {
|
|
58218
|
+
let {
|
|
58219
|
+
children,
|
|
58220
|
+
color
|
|
58221
|
+
} = _ref;
|
|
58222
|
+
const wrapperRef = React$1.useRef(null);
|
|
58223
|
+
const textRef = React$1.useRef(null);
|
|
58224
|
+
const [isTruncated, setIsTruncated] = React$1.useState(false);
|
|
58225
|
+
const [scrollDistance, setScrollDistance] = React$1.useState(0);
|
|
58226
|
+
const [animationDuration, setAnimationDuration] = React$1.useState(3);
|
|
58227
|
+
const checkTruncation = React$1.useCallback(() => {
|
|
58228
|
+
if (wrapperRef.current && textRef.current) {
|
|
58229
|
+
const wrapperWidth = wrapperRef.current.offsetWidth;
|
|
58230
|
+
const textWidth = textRef.current.scrollWidth;
|
|
58231
|
+
const isOverflowing = textWidth > wrapperWidth;
|
|
58232
|
+
setIsTruncated(isOverflowing);
|
|
58233
|
+
if (isOverflowing) {
|
|
58234
|
+
// Calculate how much we need to scroll (extra width + small padding)
|
|
58235
|
+
const extraWidth = textWidth - wrapperWidth + 20;
|
|
58236
|
+
setScrollDistance(-extraWidth);
|
|
58237
|
+
|
|
58238
|
+
// Calculate animation duration based on text length (roughly 50px per second)
|
|
58239
|
+
const duration = Math.max(2, Math.min(8, extraWidth / 50));
|
|
58240
|
+
setAnimationDuration(duration);
|
|
58241
|
+
}
|
|
58242
|
+
}
|
|
58243
|
+
}, []);
|
|
58244
|
+
React$1.useEffect(() => {
|
|
58245
|
+
checkTruncation();
|
|
58246
|
+
|
|
58247
|
+
// Recheck on window resize
|
|
58248
|
+
window.addEventListener('resize', checkTruncation);
|
|
58249
|
+
return () => window.removeEventListener('resize', checkTruncation);
|
|
58250
|
+
}, [children, checkTruncation]);
|
|
58251
|
+
return /*#__PURE__*/React__default["default"].createElement(ScrollableTextWrapper, {
|
|
58252
|
+
ref: wrapperRef
|
|
58253
|
+
}, /*#__PURE__*/React__default["default"].createElement(ScrollableTextInner, {
|
|
58254
|
+
ref: textRef,
|
|
58255
|
+
color: color,
|
|
58256
|
+
$isTruncated: isTruncated,
|
|
58257
|
+
$animationDuration: animationDuration,
|
|
58258
|
+
style: {
|
|
58259
|
+
'--scroll-distance': `${scrollDistance}px`
|
|
58260
|
+
}
|
|
58261
|
+
}, children));
|
|
58262
|
+
};
|
|
58263
|
+
const OverlayDropdown = _ref2 => {
|
|
58164
58264
|
let {
|
|
58165
58265
|
data = [],
|
|
58166
58266
|
value,
|
|
@@ -58186,7 +58286,7 @@ const OverlayDropdown = _ref => {
|
|
|
58186
58286
|
height = "auto",
|
|
58187
58287
|
margin = "8px",
|
|
58188
58288
|
...props
|
|
58189
|
-
} =
|
|
58289
|
+
} = _ref2;
|
|
58190
58290
|
const [open, setOpen] = React$1.useState(false);
|
|
58191
58291
|
const [hoveredText, setHoveredText] = React$1.useState(null);
|
|
58192
58292
|
const [templateDialog, setTemplateDialog] = React$1.useState(null);
|
|
@@ -58473,9 +58573,8 @@ const OverlayDropdown = _ref => {
|
|
|
58473
58573
|
}
|
|
58474
58574
|
}
|
|
58475
58575
|
}
|
|
58476
|
-
}, /*#__PURE__*/React__default["default"].createElement(
|
|
58477
|
-
|
|
58478
|
-
onMouseLeave: () => setHoveredText(null)
|
|
58576
|
+
}, /*#__PURE__*/React__default["default"].createElement(ScrollingText, {
|
|
58577
|
+
color: item.value === value ? '#fff' : '#212121'
|
|
58479
58578
|
}, displayText), iconToShow);
|
|
58480
58579
|
})))), templateDialog && /*#__PURE__*/React__default["default"].createElement(OverlayTemplateDialog, {
|
|
58481
58580
|
open: true,
|