From d3c5fe3ac75378ec4d8e8d26b8f88a29e0317556 Mon Sep 17 00:00:00 2001 From: alex_ Date: Mon, 16 Dec 2024 10:48:16 +0100 Subject: [PATCH 1/5] bem refactor wrapper Refs: #7036 --- .../src/components/drawer/shadow.tsx | 8 ++-- .../src/components/drawer/style.scss | 4 +- .../themes/default/src/components/drawer.scss | 45 ++++++++++--------- .../ecl/src/ecl-ec/components/drawer.scss | 6 ++- .../ecl/src/ecl-eu/components/drawer.scss | 6 ++- .../themes/itzbund/src/components/drawer.scss | 6 ++- 6 files changed, 43 insertions(+), 32 deletions(-) diff --git a/packages/components/src/components/drawer/shadow.tsx b/packages/components/src/components/drawer/shadow.tsx index 9c5453908b..3a6fcbcbad 100644 --- a/packages/components/src/components/drawer/shadow.tsx +++ b/packages/components/src/components/drawer/shadow.tsx @@ -55,10 +55,10 @@ export class KolDrawer implements DrawerAPI { return (
-
+
@@ -69,8 +69,8 @@ export class KolDrawer implements DrawerAPI { public render(): JSX.Element { const isModal = this.state._modal; return ( - (this.hostElement = el as HTMLElement)}> - + (this.hostElement = el as HTMLElement)}> + {this.renderDialogContent()} diff --git a/packages/components/src/components/drawer/style.scss b/packages/components/src/components/drawer/style.scss index fce5a63908..fe6d61d5bf 100644 --- a/packages/components/src/components/drawer/style.scss +++ b/packages/components/src/components/drawer/style.scss @@ -6,7 +6,9 @@ font-size: rem(16); } - .drawer { + .kol-drawer { + font-size: rem(16); + &__dialog { padding: 0; border: none; diff --git a/packages/themes/default/src/components/drawer.scss b/packages/themes/default/src/components/drawer.scss index f4991d72c9..09d8804afc 100644 --- a/packages/themes/default/src/components/drawer.scss +++ b/packages/themes/default/src/components/drawer.scss @@ -2,38 +2,41 @@ $duration: 0.4s; @layer kol-theme-component { - .drawer__wrapper { - box-shadow: 0 0 rem(4) var(--color-subtle); + .kol-drawer { + background: purple !important; + &__wrapper { + box-shadow: 0 0 rem(4) var(--color-subtle); - &--left { - animation: slideInLeft $duration forwards; + &--left { + animation: slideInLeft $duration forwards; - &.is-closing { - animation: slideOutLeft $duration forwards; + &.kol-drawer__wrapper--is-closing { + animation: slideOutLeft $duration forwards; + } } - } - &--right { - animation: slideInRight $duration forwards; + &--right { + animation: slideInRight $duration forwards; - &.is-closing { - animation: slideOutRight $duration forwards; + &.kol-drawer__wrapper--is-closing { + animation: slideOutRight $duration forwards; + } } - } - &--top { - animation: slideInTop $duration forwards; + &--top { + animation: slideInTop $duration forwards; - &.is-closing { - animation: slideOutTop $duration forwards; + &.kol-drawer__wrapper--is-closing { + animation: slideOutTop $duration forwards; + } } - } - &--bottom { - animation: slideInBottom $duration forwards; + &--bottom { + animation: slideInBottom $duration forwards; - &.is-closing { - animation: slideOutBottom $duration forwards; + &.kol-drawer__wrapper--is-closing { + animation: slideOutBottom $duration forwards; + } } } } diff --git a/packages/themes/ecl/src/ecl-ec/components/drawer.scss b/packages/themes/ecl/src/ecl-ec/components/drawer.scss index dd8d8f3c41..a78a0b8301 100644 --- a/packages/themes/ecl/src/ecl-ec/components/drawer.scss +++ b/packages/themes/ecl/src/ecl-ec/components/drawer.scss @@ -1,5 +1,7 @@ @layer kol-theme-component { - :host .drawer__wrapper { - box-shadow: 0 0 calc(var(--spacing-2xs) / 2) var(--color-black); + .kol-drawer { + &__wrapper { + box-shadow: 0 0 calc(var(--spacing-2xs) / 2) var(--color-black); + } } } diff --git a/packages/themes/ecl/src/ecl-eu/components/drawer.scss b/packages/themes/ecl/src/ecl-eu/components/drawer.scss index dd8d8f3c41..a78a0b8301 100644 --- a/packages/themes/ecl/src/ecl-eu/components/drawer.scss +++ b/packages/themes/ecl/src/ecl-eu/components/drawer.scss @@ -1,5 +1,7 @@ @layer kol-theme-component { - :host .drawer__wrapper { - box-shadow: 0 0 calc(var(--spacing-2xs) / 2) var(--color-black); + .kol-drawer { + &__wrapper { + box-shadow: 0 0 calc(var(--spacing-2xs) / 2) var(--color-black); + } } } diff --git a/packages/themes/itzbund/src/components/drawer.scss b/packages/themes/itzbund/src/components/drawer.scss index 16410e2baf..22c4bbb57d 100644 --- a/packages/themes/itzbund/src/components/drawer.scss +++ b/packages/themes/itzbund/src/components/drawer.scss @@ -1,5 +1,7 @@ @layer kol-theme-component { - :host .drawer__wrapper { - box-shadow: 0 0 0.25em gray; + .kol-drawer { + &__wrapper { + box-shadow: 0 0 0.25em gray; + } } } From 2b415f0c7745ee4ce340dcf655f8cf65a3b580dd Mon Sep 17 00:00:00 2001 From: alex_ Date: Mon, 16 Dec 2024 10:48:59 +0100 Subject: [PATCH 2/5] removed test style Refs: #7036 --- packages/themes/default/src/components/drawer.scss | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/themes/default/src/components/drawer.scss b/packages/themes/default/src/components/drawer.scss index 09d8804afc..03961b1870 100644 --- a/packages/themes/default/src/components/drawer.scss +++ b/packages/themes/default/src/components/drawer.scss @@ -3,7 +3,6 @@ $duration: 0.4s; @layer kol-theme-component { .kol-drawer { - background: purple !important; &__wrapper { box-shadow: 0 0 rem(4) var(--color-subtle); From c6d80a097a8cd0ca242f0b7d121e513dbbdfa06c Mon Sep 17 00:00:00 2001 From: alex_ Date: Mon, 16 Dec 2024 11:09:20 +0100 Subject: [PATCH 3/5] teest update Refs: #7036 --- .../test/__snapshots__/snapshot.spec.tsx.snap | 96 +++++++++---------- 1 file changed, 48 insertions(+), 48 deletions(-) diff --git a/packages/components/src/components/drawer/test/__snapshots__/snapshot.spec.tsx.snap b/packages/components/src/components/drawer/test/__snapshots__/snapshot.spec.tsx.snap index 82e9aed877..53eadffc27 100644 --- a/packages/components/src/components/drawer/test/__snapshots__/snapshot.spec.tsx.snap +++ b/packages/components/src/components/drawer/test/__snapshots__/snapshot.spec.tsx.snap @@ -1,11 +1,11 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`kol-drawer should render with _label="Label" _modal=false _open=false 1`] = ` - +