Skip to content

The Open Standard for Generative UI

Enhance PortalTooltip styles for improved text handling (#229)

subham755769995431
diff --git a/js/packages/react-ui/package.json b/js/packages/react-ui/package.json
index 53b986a46..7282d9063 100644
--- a/js/packages/react-ui/package.json
+++ b/js/packages/react-ui/package.json
@@ -2,7 +2,7 @@
"type": "module",
"name": "@crayonai/react-ui",
"license": "MIT",
- "version": "0.9.2",
+ "version": "0.9.3",
"description": "Component library for Generative UI SDK",
"main": "dist/index.js",
"types": "dist/index.d.ts",
diff --git a/js/packages/react-ui/src/components/Charts/shared/PortalTooltip/portalTooltip.scss b/js/packages/react-ui/src/components/Charts/shared/PortalTooltip/portalTooltip.scss
index 4f95fc9f0..deebaaba3 100644
--- a/js/packages/react-ui/src/components/Charts/shared/PortalTooltip/portalTooltip.scss
+++ b/js/packages/react-ui/src/components/Charts/shared/PortalTooltip/portalTooltip.scss
@@ -24,11 +24,17 @@
&-label {
@include cssUtils.typography(label, extra-small);
color: cssUtils.$primary-text;
+ word-wrap: break-word;
+ overflow: hidden;
+ text-overflow: ellipsis;
}
&-label-heavy {
@include cssUtils.typography(label, extra-small-heavy);
color: cssUtils.$primary-text;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
}
// this is the content of the tooltip, where the items of the of each data point is rendered,
@@ -50,7 +56,7 @@
width: 100%;
flex-wrap: wrap;
gap: cssUtils.$spacing-xs;
- align-items: center;
+ align-items: flex-start;
&--dot {
align-items: center;
}
@@ -120,12 +126,22 @@
gap: cssUtils.$spacing-xs;
color: cssUtils.$secondary-text;
@include cssUtils.typography(label, extra-small);
+
+ span {
+ display: block;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ }
}
&-value {
font-variant-numeric: tabular-nums;
color: cssUtils.$primary-text;
@include cssUtils.typography(label, extra-small);
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
&--percentage {
padding-left: cssUtils.$spacing-s;
@@ -146,6 +162,9 @@
@include cssUtils.typography(label, extra-small);
color: cssUtils.$primary-text;
text-align: left;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
}
}
}