@indico-data/design-system 3.6.2 → 3.6.4
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/lib/components/tooltip/Tooltip.d.ts +5 -3
- package/lib/components/truncate/Truncate.d.ts +1 -1
- package/lib/components/truncate/types.d.ts +2 -3
- package/lib/index.d.ts +8 -7
- package/lib/index.esm.js +4 -4
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +4 -4
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/tooltip/Tooltip.stories.tsx +10 -0
- package/src/components/tooltip/Tooltip.tsx +6 -2
- package/src/components/truncate/Truncate.stories.tsx +7 -7
- package/src/components/truncate/Truncate.tsx +4 -4
- package/src/components/truncate/__tests__/Truncate.test.tsx +2 -2
- package/src/components/truncate/types.ts +2 -3
package/lib/index.js
CHANGED
|
@@ -43117,7 +43117,7 @@ const h="react-tooltip-core-styles",w="react-tooltip-base-styles",b={core:!1,bas
|
|
|
43117
43117
|
.styles-module_tooltip__mnnfp{padding:8px 16px;border-radius:3px;font-size:90%;width:max-content}.styles-module_arrow__K0L3T{width:8px;height:8px}[class*='react-tooltip__place-top']>.styles-module_arrow__K0L3T{transform:rotate(45deg)}[class*='react-tooltip__place-right']>.styles-module_arrow__K0L3T{transform:rotate(135deg)}[class*='react-tooltip__place-bottom']>.styles-module_arrow__K0L3T{transform:rotate(225deg)}[class*='react-tooltip__place-left']>.styles-module_arrow__K0L3T{transform:rotate(315deg)}.styles-module_dark__xNqje{background:var(--rt-color-dark);color:var(--rt-color-white)}.styles-module_light__Z6W-X{background-color:var(--rt-color-white);color:var(--rt-color-dark)}.styles-module_success__A2AKt{background-color:var(--rt-color-success);color:var(--rt-color-white)}.styles-module_warning__SCK0X{background-color:var(--rt-color-warning);color:var(--rt-color-white)}.styles-module_error__JvumD{background-color:var(--rt-color-error);color:var(--rt-color-white)}.styles-module_info__BWdHW{background-color:var(--rt-color-info);color:var(--rt-color-white)}`,type:"base"});}));
|
|
43118
43118
|
|
|
43119
43119
|
const Tooltip = (_a) => {
|
|
43120
|
-
var { id, clickToShow, delayShow, delayHide, children, place = 'top', width = 'max-content', maxWidth, opacity = 1 } = _a, rest = __rest(_a, ["id", "clickToShow", "delayShow", "delayHide", "children", "place", "width", "maxWidth", "opacity"]);
|
|
43120
|
+
var { id, clickToShow, delayShow, delayHide, children, place = 'top', width = 'max-content', maxWidth, opacity = 1, positionStrategy = 'absolute' } = _a, rest = __rest(_a, ["id", "clickToShow", "delayShow", "delayHide", "children", "place", "width", "maxWidth", "opacity", "positionStrategy"]);
|
|
43121
43121
|
return (jsxRuntime.jsx(M, Object.assign({ style: {
|
|
43122
43122
|
backgroundColor: 'var(--pf-semantic-background-inverted)',
|
|
43123
43123
|
color: 'var(--pf-semantic-font-inverted)',
|
|
@@ -43127,7 +43127,7 @@ const Tooltip = (_a) => {
|
|
|
43127
43127
|
textWrap: 'wrap',
|
|
43128
43128
|
wordWrap: 'break-word',
|
|
43129
43129
|
zIndex: 1000,
|
|
43130
|
-
}, className: "tooltip", id: id, place: place, openOnClick: clickToShow, delayShow: delayShow, delayHide: delayHide, opacity: opacity }, rest, { children: children })));
|
|
43130
|
+
}, className: "tooltip", id: id, place: place, openOnClick: clickToShow, delayShow: delayShow, delayHide: delayHide, opacity: opacity, positionStrategy: positionStrategy }, rest, { children: children })));
|
|
43131
43131
|
};
|
|
43132
43132
|
|
|
43133
43133
|
function BarSpinner(_a) {
|
|
@@ -43263,7 +43263,7 @@ function v4(options, buf, offset) {
|
|
|
43263
43263
|
}
|
|
43264
43264
|
|
|
43265
43265
|
const Truncate = (_a) => {
|
|
43266
|
-
var { numLines = 1,
|
|
43266
|
+
var { numLines = 1, tooltipOptions = {}, children } = _a, rest = __rest(_a, ["numLines", "tooltipOptions", "children"]);
|
|
43267
43267
|
const [isTruncated, setIsTruncated] = React.useState(false);
|
|
43268
43268
|
const id = React.useMemo(() => v4().replace(/[^a-zA-Z0-9-_]/g, '_'), []);
|
|
43269
43269
|
const ref = React.useRef(null);
|
|
@@ -43289,7 +43289,7 @@ const Truncate = (_a) => {
|
|
|
43289
43289
|
return (jsxRuntime.jsxs("div", { className: "truncate-wrapper", style: truncateStyle, children: [jsxRuntime.jsx("span", Object.assign({ ref: ref, "data-testid": `truncate-${id}-${isTruncated ? 'truncated' : 'not-truncated'}`, "data-tooltip-id": id, className: classNames('truncate', {
|
|
43290
43290
|
'truncate--multi-line': numLines > 1,
|
|
43291
43291
|
'truncate--single-line': numLines === 1,
|
|
43292
|
-
}) }, rest, { children:
|
|
43292
|
+
}) }, rest, { children: children })), isTruncated && children && !tooltipOptions.disabled && (jsxRuntime.jsx(Tooltip, Object.assign({}, tooltipOptions, { id: id, children: children })))] }));
|
|
43293
43293
|
};
|
|
43294
43294
|
|
|
43295
43295
|
function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}function clsx(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}
|