diff --git a/packages/ui/.loki/reference/chrome_minimal_Components_CheckableSelectField_Custom_Search.png b/packages/ui/.loki/reference/chrome_minimal_Components_CheckableSelectField_Custom_Search.png index 685b3244f..84d6f3266 100644 Binary files a/packages/ui/.loki/reference/chrome_minimal_Components_CheckableSelectField_Custom_Search.png and b/packages/ui/.loki/reference/chrome_minimal_Components_CheckableSelectField_Custom_Search.png differ diff --git a/packages/ui/.loki/reference/chrome_minimal_Components_CheckableSelectField_With_Search_Input_Adornments.png b/packages/ui/.loki/reference/chrome_minimal_Components_CheckableSelectField_With_Search_Input_Adornments.png index ab9a41a1b..b2aa36336 100644 Binary files a/packages/ui/.loki/reference/chrome_minimal_Components_CheckableSelectField_With_Search_Input_Adornments.png and b/packages/ui/.loki/reference/chrome_minimal_Components_CheckableSelectField_With_Search_Input_Adornments.png differ diff --git a/packages/ui/.loki/reference/chrome_minimal_Components_CheckableSelectField_Without_Options.png b/packages/ui/.loki/reference/chrome_minimal_Components_CheckableSelectField_Without_Options.png index 3c27ee62c..48170fa62 100644 Binary files a/packages/ui/.loki/reference/chrome_minimal_Components_CheckableSelectField_Without_Options.png and b/packages/ui/.loki/reference/chrome_minimal_Components_CheckableSelectField_Without_Options.png differ diff --git a/packages/ui/.loki/reference/chrome_minimal_Components_MultiSelectField_Open_With_Input_Value.png b/packages/ui/.loki/reference/chrome_minimal_Components_MultiSelectField_Open_With_Input_Value.png index 937cd098d..a87a20523 100644 Binary files a/packages/ui/.loki/reference/chrome_minimal_Components_MultiSelectField_Open_With_Input_Value.png and b/packages/ui/.loki/reference/chrome_minimal_Components_MultiSelectField_Open_With_Input_Value.png differ diff --git a/packages/ui/.loki/reference/chrome_minimal_Components_MultiSelectField_Open_With_Input_Value_And_No_Results.png b/packages/ui/.loki/reference/chrome_minimal_Components_MultiSelectField_Open_With_Input_Value_And_No_Results.png index d7a6ccb1d..c5d7ed4eb 100644 Binary files a/packages/ui/.loki/reference/chrome_minimal_Components_MultiSelectField_Open_With_Input_Value_And_No_Results.png and b/packages/ui/.loki/reference/chrome_minimal_Components_MultiSelectField_Open_With_Input_Value_And_No_Results.png differ diff --git a/packages/ui/.loki/reference/chrome_minimal_Components_Overlay_Default.png b/packages/ui/.loki/reference/chrome_minimal_Components_Overlay_Default.png index 03b6d94ab..b936585ee 100644 Binary files a/packages/ui/.loki/reference/chrome_minimal_Components_Overlay_Default.png and b/packages/ui/.loki/reference/chrome_minimal_Components_Overlay_Default.png differ diff --git a/packages/ui/.loki/reference/chrome_minimal_Components_Overlay_Fullscreen.png b/packages/ui/.loki/reference/chrome_minimal_Components_Overlay_Fullscreen.png index 51424e3ea..b2e11b2ea 100644 Binary files a/packages/ui/.loki/reference/chrome_minimal_Components_Overlay_Fullscreen.png and b/packages/ui/.loki/reference/chrome_minimal_Components_Overlay_Fullscreen.png differ diff --git a/packages/ui/.loki/reference/chrome_minimal_Components_Overlay_Fullscreen_With_Full_Height_Content.png b/packages/ui/.loki/reference/chrome_minimal_Components_Overlay_Fullscreen_With_Full_Height_Content.png index d4c0e607b..86bf25990 100644 Binary files a/packages/ui/.loki/reference/chrome_minimal_Components_Overlay_Fullscreen_With_Full_Height_Content.png and b/packages/ui/.loki/reference/chrome_minimal_Components_Overlay_Fullscreen_With_Full_Height_Content.png differ diff --git a/packages/ui/.loki/reference/chrome_minimal_Components_Overlay_Fullscreen_With_Long_Content.png b/packages/ui/.loki/reference/chrome_minimal_Components_Overlay_Fullscreen_With_Long_Content.png index d4c0e607b..86bf25990 100644 Binary files a/packages/ui/.loki/reference/chrome_minimal_Components_Overlay_Fullscreen_With_Long_Content.png and b/packages/ui/.loki/reference/chrome_minimal_Components_Overlay_Fullscreen_With_Long_Content.png differ diff --git a/packages/ui/.loki/reference/chrome_minimal_Components_Overlay_Not_Closable.png b/packages/ui/.loki/reference/chrome_minimal_Components_Overlay_Not_Closable.png index 5d68d09a1..b374063cc 100644 Binary files a/packages/ui/.loki/reference/chrome_minimal_Components_Overlay_Not_Closable.png and b/packages/ui/.loki/reference/chrome_minimal_Components_Overlay_Not_Closable.png differ diff --git a/packages/ui/.loki/reference/chrome_minimal_Components_Overlay_Without_Close_Text.png b/packages/ui/.loki/reference/chrome_minimal_Components_Overlay_Without_Close_Text.png index f280049da..00a4ec81d 100644 Binary files a/packages/ui/.loki/reference/chrome_minimal_Components_Overlay_Without_Close_Text.png and b/packages/ui/.loki/reference/chrome_minimal_Components_Overlay_Without_Close_Text.png differ diff --git a/packages/ui/.loki/reference/chrome_minimal_Components_Overlay_Without_Title.png b/packages/ui/.loki/reference/chrome_minimal_Components_Overlay_Without_Title.png index ff1cf5bef..1ba32408b 100644 Binary files a/packages/ui/.loki/reference/chrome_minimal_Components_Overlay_Without_Title.png and b/packages/ui/.loki/reference/chrome_minimal_Components_Overlay_Without_Title.png differ diff --git a/packages/ui/.loki/reference/chrome_minimal_Components_SelectField_Open_With_Input_Value.png b/packages/ui/.loki/reference/chrome_minimal_Components_SelectField_Open_With_Input_Value.png index 2d7254db0..6cd3bbd8f 100644 Binary files a/packages/ui/.loki/reference/chrome_minimal_Components_SelectField_Open_With_Input_Value.png and b/packages/ui/.loki/reference/chrome_minimal_Components_SelectField_Open_With_Input_Value.png differ diff --git a/packages/ui/.loki/reference/chrome_minimal_Components_SelectField_Open_With_Input_Value_And_No_Results.png b/packages/ui/.loki/reference/chrome_minimal_Components_SelectField_Open_With_Input_Value_And_No_Results.png index b352b0556..ba7f1ee15 100644 Binary files a/packages/ui/.loki/reference/chrome_minimal_Components_SelectField_Open_With_Input_Value_And_No_Results.png and b/packages/ui/.loki/reference/chrome_minimal_Components_SelectField_Open_With_Input_Value_And_No_Results.png differ diff --git a/packages/ui/.postcss-lint/postcss.config.js b/packages/ui/.postcss-lint/postcss.config.js index 28a0429aa..2c1e1c84c 100644 --- a/packages/ui/.postcss-lint/postcss.config.js +++ b/packages/ui/.postcss-lint/postcss.config.js @@ -1,7 +1,7 @@ // eslint-disable-next-line import/no-extraneous-dependencies const doiuse = require('doiuse') -const browsers = ['last 2 Chrome version', 'last 2 Firefox version', 'last 1 Safari version', 'last 1 Edge version', 'ie 11'] +const browsers = ['last 2 Chrome version', 'last 2 Firefox version', 'last 1 Safari version', 'last 1 Edge version'] /* * EXPERIMENTAL: This postcss config is and should be only used diff --git a/packages/ui/src/Overlay.module.scss b/packages/ui/src/Overlay.module.scss index a973ac157..2656cff83 100644 --- a/packages/ui/src/Overlay.module.scss +++ b/packages/ui/src/Overlay.module.scss @@ -62,7 +62,8 @@ display: flex; justify-content: center; align-items: center; - min-height: c.$grid * 10; + overflow: hidden; + min-height: c.$grid * 16; margin-bottom: c.$grid * 9; padding: 0 c.$grid * 21; // close button width @@ -93,6 +94,7 @@ .title { margin: 0; + overflow: hidden; word-break: break-word; } } diff --git a/packages/ui/src/Overlay.tsx b/packages/ui/src/Overlay.tsx index 4418f2f61..e8a26564d 100644 --- a/packages/ui/src/Overlay.tsx +++ b/packages/ui/src/Overlay.tsx @@ -8,6 +8,7 @@ import { DataTestProp } from '@hazelcast/helpers' import { ButtonProps, ButtonTypeButtonProps } from './Button' import { Icon, IconProps } from './Icon' import { Link } from './Link' +import { TruncatedText } from './TruncatedText' import styles from './Overlay.module.scss' @@ -92,7 +93,7 @@ export const Overlay: FC = ({ {icon && } {title && (

- {title} +

)} {headingContent} diff --git a/packages/ui/src/TruncatedText.module.scss b/packages/ui/src/TruncatedText.module.scss index d634113c1..f5077acb8 100644 --- a/packages/ui/src/TruncatedText.module.scss +++ b/packages/ui/src/TruncatedText.module.scss @@ -3,3 +3,7 @@ .truncatedText { @include h.overflowEllipsis; } + +.multiline { + @include h.multilineOverflowEllipsis; +} diff --git a/packages/ui/src/TruncatedText.tsx b/packages/ui/src/TruncatedText.tsx index 7edf741ad..5154593ec 100644 --- a/packages/ui/src/TruncatedText.tsx +++ b/packages/ui/src/TruncatedText.tsx @@ -13,6 +13,7 @@ interface TruncatedTextProps { // Pass a new value to trigger a force re-render forceUpdateToken?: ReactText | boolean className?: string + multiline?: boolean tooltipVisible?: boolean hoverAbleTooltip?: boolean tooltipPlacement?: TooltipProps['placement'] @@ -25,6 +26,7 @@ export const TruncatedText: FC = ({ tooltipVisible, tooltipPlacement = 'top', hoverAbleTooltip, + multiline, }) => { const textRef = useRef(null) const [tooltip, setTooltip] = useState() @@ -38,7 +40,7 @@ export const TruncatedText: FC = ({ } // https://codepen.io/triple-j/pen/wadKQB - setTooltip(span.offsetWidth < span.scrollWidth ? text : undefined) + setTooltip(span.offsetWidth < span.scrollWidth || span.offsetHeight < span.scrollHeight ? text : undefined) }, [text, forceUpdateToken]) return ( @@ -51,7 +53,7 @@ export const TruncatedText: FC = ({ hoverAbleTooltip={hoverAbleTooltip} > {(ref) => ( -
+
{text}
)} diff --git a/packages/ui/styles/helpers/_text.scss b/packages/ui/styles/helpers/_text.scss index 103630372..a413385cd 100644 --- a/packages/ui/styles/helpers/_text.scss +++ b/packages/ui/styles/helpers/_text.scss @@ -3,3 +3,12 @@ overflow: hidden; text-overflow: ellipsis; } + +@mixin multilineOverflowEllipsis { + @supports (-webkit-line-clamp: 2) { + white-space: normal; + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; + } +}