Skip to content

Commit

Permalink
Merge pull request #1404 from Infineon/1385-tooltip-implement-min-and…
Browse files Browse the repository at this point in the history
…-max-width

Enhancement: implement min and max width for tooltip
  • Loading branch information
tishoyanchev committed Aug 2, 2024
2 parents f486da1 + f00d0ad commit 7340da0
Show file tree
Hide file tree
Showing 9 changed files with 59 additions and 27 deletions.
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"version": "24.2.3",
"version": "24.3.0--canary.1404.1bdc97d0f737d29870aeaaf6cd091143bc6bcb6e.0",
"command": {
"publish": {
"verifyAccess": false
Expand Down
44 changes: 34 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/components-angular/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "components-angular",
"version": "24.2.3",
"version": "24.3.0--canary.1404.1bdc97d0f737d29870aeaaf6cd091143bc6bcb6e.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
Expand All @@ -26,7 +26,7 @@
"@angular/platform-browser": "^17.3.3",
"@angular/platform-browser-dynamic": "^17.3.3",
"@angular/router": "^17.3.3",
"@infineon/infineon-design-system-angular": "^24.2.3",
"@infineon/infineon-design-system-angular": "^24.3.0--canary.1404.1bdc97d0f737d29870aeaaf6cd091143bc6bcb6e.0",
"rxjs": "~7.8.0",
"tslib": "^2.3.0",
"zone.js": "~0.14.4"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@infineon/infineon-design-system-angular",
"version": "24.2.3",
"version": "24.3.0--canary.1404.1bdc97d0f737d29870aeaaf6cd091143bc6bcb6e.0",
"description": "Infineon design system Stencil web components for Angular",
"author": "Verena Lechner",
"license": "MIT",
Expand All @@ -11,7 +11,7 @@
"@angular/common": "^17.3.3",
"@angular/core": "^17.3.3",
"@infineon/design-system-tokens": "3.3.2",
"@infineon/infineon-design-system-stencil": "^24.2.3"
"@infineon/infineon-design-system-stencil": "^24.3.0--canary.1404.e95202a0a4c6a1e596224a9d62bcf5077427b847.0"
},
"dependencies": {
"tslib": "^2.3.0"
Expand Down
4 changes: 2 additions & 2 deletions packages/components-react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@infineon/infineon-design-system-react",
"version": "24.2.3",
"version": "24.3.0--canary.1404.1bdc97d0f737d29870aeaaf6cd091143bc6bcb6e.0",
"description": "Infineon design system Stencil web components for React",
"main": "dist/index.js",
"module": "dist/index.js",
Expand Down Expand Up @@ -28,7 +28,7 @@
},
"dependencies": {
"@infineon/design-system-tokens": "3.3.2",
"@infineon/infineon-design-system-stencil": "24.2.3"
"@infineon/infineon-design-system-stencil": "24.3.0--canary.1404.1bdc97d0f737d29870aeaaf6cd091143bc6bcb6e.0"
},
"auto": {
"plugins": [
Expand Down
4 changes: 2 additions & 2 deletions packages/components-vue/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@infineon/infineon-design-system-vue",
"version": "24.2.3",
"version": "24.3.0--canary.1404.1bdc97d0f737d29870aeaaf6cd091143bc6bcb6e.0",
"description": "Infineon design system Stencil web components for Vue",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
Expand Down Expand Up @@ -31,7 +31,7 @@
},
"dependencies": {
"@infineon/design-system-tokens": "3.3.2",
"@infineon/infineon-design-system-stencil": "24.2.3"
"@infineon/infineon-design-system-stencil": "24.3.0--canary.1404.1bdc97d0f737d29870aeaaf6cd091143bc6bcb6e.0"
},
"auto": {
"plugins": [
Expand Down
2 changes: 1 addition & 1 deletion packages/components/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@infineon/infineon-design-system-stencil",
"version": "24.2.3",
"version": "24.3.0--canary.1404.1bdc97d0f737d29870aeaaf6cd091143bc6bcb6e.0",
"private": false,
"description": "Infineon design system Stencil web components",
"homepage": "https://infineon.github.io/infineon-design-system-stencil",
Expand Down
20 changes: 14 additions & 6 deletions packages/components/src/components/tooltip/tooltip.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,18 @@
z-index: 1080;
display: none;
transition: opacity 0.3s;
position: relative;
position: absolute;
font-size: 14px;
font-style: normal;
font-weight: 400;
line-height: 20px;
color: tokens.$ifxColorBaseWhite;
width: max-content;
box-sizing: border-box;

white-space: pre-wrap; /* wraps text at spaces and within words */
word-wrap: break-word; /* breaks text within a word if necessary */
overflow-wrap: anywhere; /* breaks text at arbitrary points when needed */

&.visible {
display: flex !important;
Expand All @@ -38,8 +44,6 @@

.tooltip-dismissible {
@extend %tooltip-common;
min-width: 110px;
width: auto;

.close-button {
all: unset;
Expand Down Expand Up @@ -92,8 +96,6 @@

.tooltip-extended {
@extend %tooltip-common;
min-width: 100px;
width: auto;
//padding-left: 36px; // Added this line, adjust as per your icon width
//padding-left: tokens.$ifxSpace150; // Added this line, adjust as per your icon width
align-items: center;
Expand Down Expand Up @@ -205,12 +207,18 @@

.tooltip-compact {
@extend %tooltip-arrow-positions;
min-width: 28px !important;
max-width: 145px !important;
}

.tooltip-dismissible {
@extend %tooltip-arrow-positions;
min-width: 145px !important;
max-width: 310px !important;
}

.tooltip-extended {
@extend %tooltip-arrow-positions;
}
min-width: 145px !important;
max-width: 310px !important;
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const DefaultTemplate = ({ header, text, variant, position, icon }) => {
element.setAttribute('position', position);
element.setAttribute('icon', icon);

element.textContent = "I'm the tooltip reference element - Please hover me"; // Set content for the reference element
element.textContent = `I'm the tooltip reference element - Please ${variant==='dismissible' ? 'click' : 'hover'} me`; // Set content for the reference element

return element;
};
Expand Down

0 comments on commit 7340da0

Please sign in to comment.