+
+ {this.state._variant === 'card' && (
+
+ )}
);
}
@@ -80,6 +105,11 @@ export class KolModal implements ModalAPI {
*/
@Prop() public _width?: string = '100%';
+ /**
+ * Defines the variant of the modal.
+ */
+ @Prop() public _variant?: ModalVariantPropType = 'blank';
+
@State() public state: ModalStates = {
_label: '', // ⚠ required
_width: '100%',
@@ -110,9 +140,15 @@ export class KolModal implements ModalAPI {
});
}
+ @Watch('_variant')
+ public validateVariant(value?: ModalVariantPropType): void {
+ validateModalVariant(this, value);
+ }
+
public componentWillLoad(): void {
this.validateLabel(this._label);
this.validateOn(this._on);
this.validateWidth(this._width);
+ this.validateVariant(this._variant);
}
}
diff --git a/packages/components/src/components/modal/style.scss b/packages/components/src/components/modal/style.scss
index 36426e61b3..64730614ec 100644
--- a/packages/components/src/components/modal/style.scss
+++ b/packages/components/src/components/modal/style.scss
@@ -1,14 +1,23 @@
@import '../@shared/mixins';
@import '../../styles/global';
+@import '../tooltip/style.scss';
@layer kol-component {
.kol-modal {
border: 0;
padding: 0;
font-size: rem(16);
+ position: relative;
&::backdrop {
background-color: rgba(0, 0, 0, 0.33);
}
+
+ &__close-button {
+ position: absolute;
+ top: rem(1);
+ right: rem(1);
+ z-index: 1;
+ }
}
-}
+}
\ No newline at end of file
diff --git a/packages/components/src/components/modal/test/__snapshots__/snapshot.spec.tsx.snap b/packages/components/src/components/modal/test/__snapshots__/snapshot.spec.tsx.snap
index 093b906bf2..e039b3ba72 100644
--- a/packages/components/src/components/modal/test/__snapshots__/snapshot.spec.tsx.snap
+++ b/packages/components/src/components/modal/test/__snapshots__/snapshot.spec.tsx.snap
@@ -4,7 +4,7 @@ exports[`kol-modal should render with _label="Label" _width="80%" 1`] = `