Skip to content

Commit

Permalink
Merge pull request #2547 from smeup/fix/tooltip-card
Browse files Browse the repository at this point in the history
LS25001000: Tooltip card fix: handle, resize, responsiveness
  • Loading branch information
Leonardo-Signorelli authored Mar 5, 2025
2 parents bbda108 + f8d189d commit ae3650c
Show file tree
Hide file tree
Showing 5 changed files with 209 additions and 176 deletions.
10 changes: 10 additions & 0 deletions packages/ketchup/src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -721,6 +721,10 @@ export namespace Components {
* @default true
*/
"showSelection": boolean;
/**
* When set to false buttons don't show the text, only the icon if it is present.
*/
"showText": boolean;
/**
* Defines the size of the buttons. Available styles are from "extra-small" to "extra-large". Small will be the default
* @default KupComponentSizing.SMALL
Expand Down Expand Up @@ -4560,6 +4564,7 @@ export namespace Components {
* The density of the rows, defaults at 'medium' and can also be set to 'dense' or 'wide'.
*/
"density": FCellPadding;
"displayMode": ItemsDisplayMode;
/**
* Function that gets invoked when a new set of nodes must be loaded as children of a node. When useDynamicExpansion is set, the tree component will have two different behaviors depending on the value of this prop. 1 - If this prop is set to null, no callback to download data is available: the component will emit an event requiring the parent to load the children of the given node. 2 - If this prop is set to have a callback, then the component will automatically make requests to load children of a given node. After the load has been completed, a different event will be fired to alert the parent of the change.
* @see useDynamicExpansion
Expand Down Expand Up @@ -6776,6 +6781,10 @@ declare namespace LocalJSX {
* @default true
*/
"showSelection"?: boolean;
/**
* When set to false buttons don't show the text, only the icon if it is present.
*/
"showText"?: boolean;
/**
* Defines the size of the buttons. Available styles are from "extra-small" to "extra-large". Small will be the default
* @default KupComponentSizing.SMALL
Expand Down Expand Up @@ -9989,6 +9998,7 @@ declare namespace LocalJSX {
* The density of the rows, defaults at 'medium' and can also be set to 'dense' or 'wide'.
*/
"density"?: FCellPadding;
"displayMode"?: ItemsDisplayMode;
/**
* Function that gets invoked when a new set of nodes must be loaded as children of a node. When useDynamicExpansion is set, the tree component will have two different behaviors depending on the value of this prop. 1 - If this prop is set to null, no callback to download data is available: the component will emit an event requiring the parent to load the children of the given node. 2 - If this prop is set to have a callback, then the component will automatically make requests to load children of a given node. After the load has been completed, a different event will be fired to alert the parent of the change.
* @see useDynamicExpansion
Expand Down
1 change: 1 addition & 0 deletions packages/ketchup/src/components/kup-button-list/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
| `data` | -- | Props of the sub-components. | `KupButtonListNode[]` | `[]` |
| `disabled` | `disabled` | When set to true, the sub-components are disabled. | `boolean` | `false` |
| `showSelection` | `show-selection` | When set to true, highlights the selected button with the secondary color of KupTheme. | `boolean` | `true` |
| `showText` | `show-text` | When set to false buttons don't show the text, only the icon if it is present. | `boolean` | `true` |
| `sizing` | `sizing` | Defines the size of the buttons. Available styles are from "extra-small" to "extra-large". Small will be the default | `KupComponentSizing.EXTRA_LARGE \| KupComponentSizing.EXTRA_SMALL \| KupComponentSizing.LARGE \| KupComponentSizing.MEDIUM \| KupComponentSizing.SMALL` | `KupComponentSizing.SMALL` |
| `styling` | `styling` | Defines the style of the buttons. Available styles are "outlined" of "flat" (which is the default). | `FButtonStyling.FLAT \| FButtonStyling.FLOATING \| FButtonStyling.ICON \| FButtonStyling.OUTLINED \| FButtonStyling.RAISED` | `FButtonStyling.RAISED` |

Expand Down
308 changes: 164 additions & 144 deletions packages/ketchup/src/components/kup-card/dialog/kup-card-dialog-8.scss
Original file line number Diff line number Diff line change
@@ -1,164 +1,184 @@
.dialog-layout-8 {
background: var(--kup-background-color);
border-radius: 3px;
box-shadow: 0 2px 1px -1px rgb(0 0 0 / 20%), 0 1px 1px 0 rgb(0 0 0 / 14%),
0 1px 3px 0 rgb(0 0 0 / 12%);
color: var(--kup-text-color);
display: block;
font-size: var(--kup-font-size);
outline: none;

.section-1 {
--kup-button-font-size: 0.75em;

box-sizing: border-box;
background: var(--kup-background-color);
border-radius: 3px;
box-shadow: 0 2px 1px -1px rgb(0 0 0 / 20%), 0 1px 1px 0 rgb(0 0 0 / 14%),
0 1px 3px 0 rgb(0 0 0 / 12%);
color: var(--kup-text-color);
display: block;
font-size: var(--kup-font-size);
outline: none;
user-select: text;

.drag-handle {
position: absolute;
width: 100%;
height: 15px !important;
top: -7.5px;
z-index: 1;
}

.section-1 {
--kup-button-font-size: 0.75em;

box-sizing: border-box;
display: grid;
// this allows auto column wrap when there is no horizontal space
grid-template-columns: 64px minmax(44px, auto);
padding: 1em;
gap: 0.5em;
min-width: 150px;

.sub-1 {
width: 100%;
}

.top {
display: flex;
justify-content: space-between;
}

.buttons {
display: flex;
}

.sub-spinner {
height: 88px;
width: 88px;
margin: 0 10px;
}

.f-image {
margin: auto;
}

.title {
align-items: flex-end;
display: flex;
padding: 1em;

.sub-1 {
font-size: 1.25em;
font-weight: 600;
margin-bottom: 0.5em;
padding: 0 0.25em 0.25em;
text-align: left;
min-width: 0;

.label {
cursor: pointer;
padding-right: 0.25em;
padding-top: 0.5em;
width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
@include kup-heading-02;

&:hover {
text-decoration: underline;
}
}

.top {
display: flex;
justify-content: space-between;
}

.buttons {
display: flex;
}

.sub-spinner {
height: 88px;
width: 88px;
margin: 0 10px;
}

.f-image {
margin: 0 0.5em 0 0;
}

.info {
display: flex;
padding: 0 0.25em 0.25em;
width: 100%;

.label {
color: rgba(var(--kup-text-color-rgb), 0.75);
margin-right: 0.75em;
width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
@include kup-body-compact-01;
}

.title {
align-items: flex-end;
display: flex;
font-size: 1.25em;

.value {
font-weight: 600;
margin-bottom: 0.5em;
padding: 0 0.25em 0.25em;
text-align: left;

.label {
cursor: pointer;
padding-right: 0.25em;
padding-top: 0.5em;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
@include kup-heading-02;

&:hover {
text-decoration: underline;
}
}
}

.info {
display: flex;
padding: 0 0.25em 0.25em;
width: 100%;

.label {
color: rgba(var(--kup-text-color-rgb), 0.75);
margin-right: 0.75em;
min-width: max-content;
width: auto;
@include kup-body-compact-01;
}

.value {
font-weight: 600;
width: 100%;
@include kup-heading-compact-01;
}
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
@include kup-heading-compact-01;
}
}

.section-2 {
border-top: 1px solid var(--kup-border-subtle);
}

.section-2 {
border-top: 1px solid var(--kup-border-subtle);
box-sizing: border-box;
height: 200px;
opacity: 1;
overflow: auto;
transition: height 250ms ease-out, opacity 250ms ease-out;

.info {
box-sizing: border-box;
height: 180px;
opacity: 1;
height: 100%;
overflow: auto;
transition: height 250ms ease-out, opacity 250ms ease-out;

.info {
box-sizing: border-box;
height: 100%;
overflow: auto;
padding: 1.25em;
}

.detail-row {
align-items: center;
display: flex;
justify-content: space-between;

&:not(:last-child) {
margin-bottom: 6px;
}

&__label {
color: rgba(var(--kup-text-color-rgb), 0.5);
margin-top: 0.175em;
max-width: 320px;
padding-right: 1.25em;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
@include kup-body-compact-01;
}

&__value {
color: var(--kup-text-color);
font-size: 105%;
font-weight: 600;
max-width: 320px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
@include kup-heading-compact-01;
}
}

kup-tree {
text-align: left;
}
padding: 1.25em;
}
.section-3 {
border-top: 1px solid var(--kup-border-subtle);

.detail-row {
align-items: center;
display: flex;
justify-content: flex-end;
padding: 6px {
top: 2px;
bottom: 2px;
justify-content: space-between;

&:not(:last-child) {
margin-bottom: 6px;
}

&__label {
color: rgba(var(--kup-text-color-rgb), 0.5);
margin-top: 0.175em;
max-width: 320px;
padding-right: 1.25em;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
@include kup-body-compact-01;
}

kup-button {
margin: auto 0;

&__value {
color: var(--kup-text-color);
font-size: 105%;
font-weight: 600;
max-width: 320px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
@include kup-heading-compact-01;
}
}

#open-in-new,
#search,
#new {
margin: 0 0 0.5em 0;

kup-tree {
text-align: left;
}
}

@media screen and (min-width: 678px) {
.dialog-layout-8 {
max-width: 40vw;

.section-3 {
overflow: hidden;
border-top: 1px solid var(--kup-border-subtle);
display: flex;
justify-content: flex-end;
padding: 6px {
top: 2px;
bottom: 2px;
}

kup-button {
margin: auto 0;
}
}


#open-in-new,
#search,
#new {
margin: 0 0 0.5em 0;
}
}

@media screen and (min-width: 678px) {
.dialog-layout-8 {
width: 400px;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -355,13 +355,14 @@ export function create8(component: KupCard): VNode {
};
return (
<div class={`dialog-layout-${component.layoutNumber}`}>
<div id={KupCardIds.DRAG_HANDLE} class="drag-handle"></div>
<div class="section-1">
{imageArray[0] ? (
<FImage
id="image1"
{...imageArray[0]}
sizeX="84px"
sizeY="84px"
sizeX="44px"
sizeY="44px"
></FImage>
) : (
<div class="sub-spinner">
Expand Down
Loading

0 comments on commit ae3650c

Please sign in to comment.