Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LMS-2126 | Use container query for setting horizontal layout #439

Merged
merged 4 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
235 changes: 122 additions & 113 deletions lib/js/components/Banner/Banner.vue
Original file line number Diff line number Diff line change
@@ -1,65 +1,70 @@
<template>
<div class="ds-banner" :class="[colorClass, layoutClass]">
<div class="ds-banner__content">
<div class="ds-banner__header">
<div
v-if="icon"
class="ds-banner__iconContainer"
:class="{ '-ds-hideOnMobile': isIconHiddenOnMobile }"
>
<!-- TODO: https://bethink.atlassian.net/browse/IT-3589 change to a-illustration in the future -->
<ds-icon class="ds-banner__icon" :class="[colorClass]" :icon="icon" />
</div>

<div class="ds-banner__textWrapper">
<div class="ds-banner__titleWrapper">
<div class="ds-banner__title" v-text="title" />
<div v-if="$slots.defaultText" class="ds-banner__defaultText">
<slot name="defaultText" />
</div>
<div class="ds-banner">
<div class="ds-banner__inner" :class="[colorClass, layoutClass]">
<div class="ds-banner__content">
<div class="ds-banner__header">
<div
v-if="icon"
class="ds-banner__iconContainer"
:class="{ '-ds-hideOnMobile': isIconHiddenOnMobile }"
>
<!-- TODO: https://bethink.atlassian.net/browse/IT-3589 change to a-illustration in the future -->
<ds-icon class="ds-banner__icon" :class="[colorClass]" :icon="icon" />
</div>
<div class="ds-banner__rightWrapper">
<div v-if="buttonText" class="ds-banner__buttonWrapper">
<ds-button
class="ds-banner__ctaButton"
:color="BUTTON_COLORS.NEUTRAL"
:type="BUTTON_TYPES.OUTLINED"
:size="BUTTON_SIZES.SMALL"
@click="$emit('button-clicked')"
>{{ buttonText }}
</ds-button>

<div class="ds-banner__textWrapper">
<div class="ds-banner__titleWrapper">
<div class="ds-banner__title" v-text="title" />
<div v-if="$slots.defaultText" class="ds-banner__defaultText">
<slot name="defaultText" />
</div>
</div>
<div v-if="$slots.rightSlot" class="ds-banner__rightSlot">
<slot name="rightSlot" />
<div class="ds-banner__rightWrapper">
<div v-if="buttonText" class="ds-banner__buttonWrapper">
<ds-button
class="ds-banner__ctaButton"
:color="BUTTON_COLORS.NEUTRAL"
:type="BUTTON_TYPES.OUTLINED"
:size="BUTTON_SIZES.SMALL"
@click="$emit('button-clicked')"
>{{ buttonText }}
</ds-button>
</div>
<div v-if="$slots.rightSlot" class="ds-banner__rightSlot">
<slot name="rightSlot" />
</div>
</div>
</div>
</div>
<div v-if="$slots.expandedText" class="ds-banner__expander">
<ds-icon-button
:size="ICON_BUTTON_SIZES.SMALL"
:icon="isExpandedInternal ? ICONS.FA_CHEVRON_UP : ICONS.FA_CHEVRON_DOWN"
:color="ICON_BUTTON_COLORS.NEUTRAL"
:radius="BUTTON_RADIUSES.CAPSULE"
:touchable="false"
@click="toggleExpandedText"
/>
</div>
<div v-if="!$slots.expandedText && closable" class="ds-banner__close">
<ds-icon-button
:size="ICON_BUTTON_SIZES.SMALL"
:icon="ICONS.FA_XMARK"
:color="ICON_BUTTON_COLORS.NEUTRAL"
:radius="BUTTON_RADIUSES.CAPSULE"
:touchable="false"
@click="$emit('close')"
/>
</div>
</div>
<div v-if="$slots.expandedText" class="ds-banner__expander">
<ds-icon-button
:size="ICON_BUTTON_SIZES.SMALL"
:icon="isExpandedInternal ? ICONS.FA_CHEVRON_UP : ICONS.FA_CHEVRON_DOWN"
:color="ICON_BUTTON_COLORS.NEUTRAL"
:radius="BUTTON_RADIUSES.CAPSULE"
:touchable="false"
@click="toggleExpandedText"
/>
</div>
<div v-if="!$slots.expandedText && closable" class="ds-banner__close">
<ds-icon-button
:size="ICON_BUTTON_SIZES.SMALL"
:icon="ICONS.FA_XMARK"
:color="ICON_BUTTON_COLORS.NEUTRAL"
:radius="BUTTON_RADIUSES.CAPSULE"
:touchable="false"
@click="$emit('close')"
/>
</div>
</div>
<div v-if="$slots.expandedText && isExpandedInternal" class="ds-banner__expandedContainer">
<ds-divider :prominence="DIVIDER_PROMINENCES.STRONG" />
<div class="ds-banner__expandedText">
<slot name="expandedText" />
<div
v-if="$slots.expandedText && isExpandedInternal"
class="ds-banner__expandedContainer"
>
<ds-divider :prominence="DIVIDER_PROMINENCES.STRONG" />
<div class="ds-banner__expandedText">
<slot name="expandedText" />
</div>
</div>
</div>
</div>
Expand All @@ -75,79 +80,83 @@
.ds-banner {
$self: &;

border-radius: $radius-m;
border-style: solid;
border-width: 1px;
display: flex;
flex-direction: column;
padding: $space-xs;

@media #{breakpoint-s()} {
&.-ds-horizontal {
#{$self}__iconContainer {
padding: $space-2xs 0;
}
container-type: inline-size;

#{$self}__header {
padding: 0 $space-2xs;
}
&__inner {
border-radius: $radius-m;
border-style: solid;
border-width: 1px;
display: flex;
flex-direction: column;
padding: $space-xs;

#{$self}__expander {
padding: $space-xs $space-4xs $space-xs 0;
}
@container (width > 500px) {
&.-ds-horizontal {
#{$self}__iconContainer {
padding: $space-2xs 0;
}

#{$self}__textWrapper {
flex-direction: row;
}
#{$self}__header {
padding: 0 $space-2xs;
}

#{$self}__rightWrapper {
padding: $space-5xs 0 $space-5xs $space-s;
}
#{$self}__expander {
padding: $space-xs $space-4xs $space-xs 0;
}

#{$self}__buttonWrapper {
padding: $space-xs 0;
}
#{$self}__textWrapper {
flex-direction: row;
}

#{$self}__rightWrapper {
padding: $space-5xs 0 $space-5xs $space-s;
}

#{$self}__rightSlot {
flex-grow: initial;
padding: $space-xs 0 $space-xs 0;
#{$self}__buttonWrapper {
padding: $space-xs 0;
}

#{$self}__rightSlot {
flex-grow: initial;
padding: $space-xs 0 $space-xs 0;
}
}
}
}

&.-ds-warning {
background-color: $color-warning-background;
border-color: $color-warning-border-weak;
}
&.-ds-warning {
background-color: $color-warning-background;
border-color: $color-warning-border-weak;
}

&.-ds-success {
background-color: $color-success-background;
border-color: $color-success-border-weak;
}
&.-ds-success {
background-color: $color-success-background;
border-color: $color-success-border-weak;
}

&.-ds-info {
background-color: $color-info-background;
border-color: $color-info-border-weak;
}
&.-ds-info {
background-color: $color-info-background;
border-color: $color-info-border-weak;
}

&.-ds-fail {
background-color: $color-fail-background;
border-color: $color-fail-border-weak;
}
&.-ds-fail {
background-color: $color-fail-background;
border-color: $color-fail-border-weak;
}

&.-ds-neutral {
background-color: $color-neutral-background;
border-color: $color-neutral-border-weak;
}
&.-ds-neutral {
background-color: $color-neutral-background;
border-color: $color-neutral-border-weak;
}

&.-ds-default {
background-color: $color-default-background;
border-color: $color-neutral-border-weak;
}
&.-ds-default {
background-color: $color-default-background;
border-color: $color-neutral-border-weak;
}

&.-ds-danger {
background-color: $color-danger-background;
border-color: $color-danger-border-weak;
&.-ds-danger {
background-color: $color-danger-background;
border-color: $color-danger-border-weak;
}
}

&__content {
Expand Down
4 changes: 2 additions & 2 deletions lib/js/components/Buttons/IconButton/IconButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@
@import '../../../../styles/settings/typography/tokens';

@mixin setIconButtonAdditions($border: null, $icon: null) {
@if $border != null {
@if $border {
border: 1px solid $border;
}

@if $icon != null {
@if $icon {
.ds-iconButton {
&__icon,
&__loadingIcon {
Expand Down
4 changes: 2 additions & 2 deletions lib/js/components/Drawer/DrawerHeader/DrawerHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ $minimal-drawer-header-height: 82px;
flex-direction: column;

&__secondLevel {
position: absolute !important; //it is required so firstLevel content does not make component wider when hidden, and important is needed so component does not change its width when button was clicked
position: absolute !important; // it is required so firstLevel content does not make component wider when hidden, and important is needed so component does not change its width when button was clicked
}

&__leftIcon {
Expand All @@ -83,7 +83,7 @@ $minimal-drawer-header-height: 82px;
row-gap: $space-4xs;

&.-ds-hidden {
visibility: hidden; //by this we make sure that height does not change when switching to second level
visibility: hidden; // by this we make sure that height does not change when switching to second level
}
}

Expand Down
2 changes: 1 addition & 1 deletion lib/js/components/Outline/OutlineItem/OutlineItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
}

&__text {
@include label-l-default-regular; //it fixes whole component height
@include label-l-default-regular; // it fixes whole component height

// To hide scrollbar in case Chrome renders __label higher than line-height - there are some problems with fraction of a pixel on Retina screens
// https://bethinkteam.slack.com/archives/C012R8RM3A4/p1727776466931369?thread_ts=1727775029.076259&cid=C012R8RM3A4
Expand Down
3 changes: 2 additions & 1 deletion lib/js/components/PopOver/PopOver.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,11 @@
flex-direction: column;
padding: 0;

/* stylelint-disable-next-line selector-class-pattern */
/* stylelint-disable selector-class-pattern */
&.-ds-color-neutral :deep(.popper__arrow) {
border-color: $color-neutral-background transparent !important;
}
/* stylelint-enable selector-class-pattern */

&.-ds-color-neutral {
background-color: $color-neutral-background;
Expand Down
1 change: 0 additions & 1 deletion lib/js/components/ProgressBar/ProgressBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@

<style scoped lang="scss">
@use 'sass:math';

@import '../../../styles/settings/spacings';
@import '../../../styles/settings/media-queries';
@import '../../../styles/settings/colors/tokens';
Expand Down
4 changes: 2 additions & 2 deletions lib/js/components/ProgressDonutChart/ProgressDonutChart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ $progress-donut-chart-range-colors: (
transform: rotate(90deg);
transform-origin: 50% 50%;
// Disabled for v3.0
//stroke-linecap: round;
//stroke-linejoin: round;
// stroke-linecap: round;
// stroke-linejoin: round;
transition: all $default-transition-time ease-out;
}

Expand Down
4 changes: 2 additions & 2 deletions lib/styles/components/_buttons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
$background-focus,
$background-disabled
) {
@if $background == null {
@if not $background {
background-color: transparent;
}

Expand Down Expand Up @@ -81,7 +81,7 @@
$icon-focused: null,
$icon-disabled: null
) {
@if $border != null {
@if $border {
border: 1px solid $border;
}

Expand Down
Loading
Loading