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.esm.js
CHANGED
|
@@ -57719,6 +57719,21 @@ function ModalDrawer(_ref) {
|
|
|
57719
57719
|
}, "\xD7"), children));
|
|
57720
57720
|
}
|
|
57721
57721
|
|
|
57722
|
+
// Keyframes for rolling/marquee animation
|
|
57723
|
+
const scrollTextAnimation = keyframes`
|
|
57724
|
+
0% {
|
|
57725
|
+
transform: translateX(0);
|
|
57726
|
+
}
|
|
57727
|
+
10% {
|
|
57728
|
+
transform: translateX(0);
|
|
57729
|
+
}
|
|
57730
|
+
90% {
|
|
57731
|
+
transform: translateX(var(--scroll-distance, -30%));
|
|
57732
|
+
}
|
|
57733
|
+
100% {
|
|
57734
|
+
transform: translateX(var(--scroll-distance, -30%));
|
|
57735
|
+
}
|
|
57736
|
+
`;
|
|
57722
57737
|
const scrollableStyles = `
|
|
57723
57738
|
&::-webkit-scrollbar {
|
|
57724
57739
|
height: 8px;
|
|
@@ -57737,6 +57752,9 @@ const scrollableStyles = `
|
|
|
57737
57752
|
`;
|
|
57738
57753
|
const TooltipWrapper = styled(Tooltip$2)`
|
|
57739
57754
|
width: 100%;
|
|
57755
|
+
.tooltip-wrapper {
|
|
57756
|
+
width: 100%;
|
|
57757
|
+
}
|
|
57740
57758
|
`;
|
|
57741
57759
|
const DropdownContainer = styled.div`
|
|
57742
57760
|
position: relative;
|
|
@@ -57834,6 +57852,41 @@ const Wrapper = styled.div`
|
|
|
57834
57852
|
align-items: center;
|
|
57835
57853
|
width: 100%;
|
|
57836
57854
|
`;
|
|
57855
|
+
|
|
57856
|
+
// Wrapper for scrollable truncated text
|
|
57857
|
+
const ScrollableTextWrapper = styled.div`
|
|
57858
|
+
flex: 1;
|
|
57859
|
+
display: flex;
|
|
57860
|
+
align-items: center;
|
|
57861
|
+
min-width: 0;
|
|
57862
|
+
overflow: hidden;
|
|
57863
|
+
position: relative;
|
|
57864
|
+
`;
|
|
57865
|
+
|
|
57866
|
+
// Inner text that scrolls when truncated
|
|
57867
|
+
const ScrollableTextInner = styled.span`
|
|
57868
|
+
display: inline-block;
|
|
57869
|
+
white-space: nowrap;
|
|
57870
|
+
line-height: 21px;
|
|
57871
|
+
font-family: "Poppins", sans-serif;
|
|
57872
|
+
font-size: 14px;
|
|
57873
|
+
font-weight: 400;
|
|
57874
|
+
color: ${props => props.color || 'inherit'};
|
|
57875
|
+
max-width: 100%;
|
|
57876
|
+
|
|
57877
|
+
/* Default state: show ellipsis */
|
|
57878
|
+
overflow: hidden;
|
|
57879
|
+
text-overflow: ellipsis;
|
|
57880
|
+
|
|
57881
|
+
${props => props.$isTruncated && css`
|
|
57882
|
+
${ScrollableTextWrapper}:hover & {
|
|
57883
|
+
/* On hover: remove ellipsis and start animation */
|
|
57884
|
+
overflow: visible;
|
|
57885
|
+
text-overflow: clip;
|
|
57886
|
+
animation: ${scrollTextAnimation} ${props.$animationDuration || 3}s linear infinite;
|
|
57887
|
+
}
|
|
57888
|
+
`}
|
|
57889
|
+
`;
|
|
57837
57890
|
const TruncatedText = styled.span`
|
|
57838
57891
|
flex: 1;
|
|
57839
57892
|
min-width: 0;
|
|
@@ -58150,7 +58203,54 @@ OverlayTemplateDialog.propTypes = {
|
|
|
58150
58203
|
buttonHoverColor: PropTypes.string
|
|
58151
58204
|
};
|
|
58152
58205
|
|
|
58153
|
-
|
|
58206
|
+
// Component for scrolling truncated text on hover
|
|
58207
|
+
const ScrollingText = _ref => {
|
|
58208
|
+
let {
|
|
58209
|
+
children,
|
|
58210
|
+
color
|
|
58211
|
+
} = _ref;
|
|
58212
|
+
const wrapperRef = useRef(null);
|
|
58213
|
+
const textRef = useRef(null);
|
|
58214
|
+
const [isTruncated, setIsTruncated] = useState(false);
|
|
58215
|
+
const [scrollDistance, setScrollDistance] = useState(0);
|
|
58216
|
+
const [animationDuration, setAnimationDuration] = useState(3);
|
|
58217
|
+
const checkTruncation = useCallback(() => {
|
|
58218
|
+
if (wrapperRef.current && textRef.current) {
|
|
58219
|
+
const wrapperWidth = wrapperRef.current.offsetWidth;
|
|
58220
|
+
const textWidth = textRef.current.scrollWidth;
|
|
58221
|
+
const isOverflowing = textWidth > wrapperWidth;
|
|
58222
|
+
setIsTruncated(isOverflowing);
|
|
58223
|
+
if (isOverflowing) {
|
|
58224
|
+
// Calculate how much we need to scroll (extra width + small padding)
|
|
58225
|
+
const extraWidth = textWidth - wrapperWidth + 20;
|
|
58226
|
+
setScrollDistance(-extraWidth);
|
|
58227
|
+
|
|
58228
|
+
// Calculate animation duration based on text length (roughly 50px per second)
|
|
58229
|
+
const duration = Math.max(2, Math.min(8, extraWidth / 50));
|
|
58230
|
+
setAnimationDuration(duration);
|
|
58231
|
+
}
|
|
58232
|
+
}
|
|
58233
|
+
}, []);
|
|
58234
|
+
useEffect(() => {
|
|
58235
|
+
checkTruncation();
|
|
58236
|
+
|
|
58237
|
+
// Recheck on window resize
|
|
58238
|
+
window.addEventListener('resize', checkTruncation);
|
|
58239
|
+
return () => window.removeEventListener('resize', checkTruncation);
|
|
58240
|
+
}, [children, checkTruncation]);
|
|
58241
|
+
return /*#__PURE__*/React$1.createElement(ScrollableTextWrapper, {
|
|
58242
|
+
ref: wrapperRef
|
|
58243
|
+
}, /*#__PURE__*/React$1.createElement(ScrollableTextInner, {
|
|
58244
|
+
ref: textRef,
|
|
58245
|
+
color: color,
|
|
58246
|
+
$isTruncated: isTruncated,
|
|
58247
|
+
$animationDuration: animationDuration,
|
|
58248
|
+
style: {
|
|
58249
|
+
'--scroll-distance': `${scrollDistance}px`
|
|
58250
|
+
}
|
|
58251
|
+
}, children));
|
|
58252
|
+
};
|
|
58253
|
+
const OverlayDropdown = _ref2 => {
|
|
58154
58254
|
let {
|
|
58155
58255
|
data = [],
|
|
58156
58256
|
value,
|
|
@@ -58176,7 +58276,7 @@ const OverlayDropdown = _ref => {
|
|
|
58176
58276
|
height = "auto",
|
|
58177
58277
|
margin = "8px",
|
|
58178
58278
|
...props
|
|
58179
|
-
} =
|
|
58279
|
+
} = _ref2;
|
|
58180
58280
|
const [open, setOpen] = useState(false);
|
|
58181
58281
|
const [hoveredText, setHoveredText] = useState(null);
|
|
58182
58282
|
const [templateDialog, setTemplateDialog] = useState(null);
|
|
@@ -58463,9 +58563,8 @@ const OverlayDropdown = _ref => {
|
|
|
58463
58563
|
}
|
|
58464
58564
|
}
|
|
58465
58565
|
}
|
|
58466
|
-
}, /*#__PURE__*/React$1.createElement(
|
|
58467
|
-
|
|
58468
|
-
onMouseLeave: () => setHoveredText(null)
|
|
58566
|
+
}, /*#__PURE__*/React$1.createElement(ScrollingText, {
|
|
58567
|
+
color: item.value === value ? '#fff' : '#212121'
|
|
58469
58568
|
}, displayText), iconToShow);
|
|
58470
58569
|
})))), templateDialog && /*#__PURE__*/React$1.createElement(OverlayTemplateDialog, {
|
|
58471
58570
|
open: true,
|