@team-monolith/cds 1.97.0 → 1.97.1
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.
|
@@ -19,10 +19,15 @@ import { Tooltip as MuiTooltip, } from "@mui/material";
|
|
|
19
19
|
* [피그마](https://www.figma.com/file/yhrRFizzmhPoHdw9FbYow2/Codle-PD-Kit---Components?type=design&node-id=172-626&t=aFkKTFgWq2xFFGC5-0)
|
|
20
20
|
*/
|
|
21
21
|
export const Tooltip = React.forwardRef(function Tooltip(props, ref) {
|
|
22
|
+
var _a;
|
|
22
23
|
const { title, text, children } = props, restProps = __rest(props, ["title", "text", "children"]);
|
|
24
|
+
// children을 focusable하게 만듭니다.
|
|
25
|
+
const focusableChildren = React.cloneElement(children, {
|
|
26
|
+
tabIndex: (_a = children.props.tabIndex) !== null && _a !== void 0 ? _a : 0,
|
|
27
|
+
});
|
|
23
28
|
return (_jsx(StyledTooltip, Object.assign({ ref: ref, title:
|
|
24
29
|
// title이 없고 text가 null인 경우 툴팁을 표시하지 않음
|
|
25
|
-
!title && text === null ? null : (_jsxs(_Fragment, { children: [title && _jsx(TitleDiv, { children: title }), text] })), describeChild: true }, restProps, { children:
|
|
30
|
+
!title && text === null ? null : (_jsxs(_Fragment, { children: [title && _jsx(TitleDiv, { children: title }), text] })), describeChild: true }, restProps, { children: focusableChildren })));
|
|
26
31
|
});
|
|
27
32
|
// https://mui.com/material-ui/react-tooltip/#customization
|
|
28
33
|
const StyledTooltip = styled((_a) => {
|