-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add variant to modal component (#7234)
- Loading branch information
Showing
27 changed files
with
181 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import type { Generic } from 'adopted-style-sheets'; | ||
|
||
import { watchValidator } from '../../utils/prop.validators'; | ||
|
||
const ModalVariantPropTypeOptions = ['blank', 'card'] as const; | ||
export type ModalVariantPropType = (typeof ModalVariantPropTypeOptions)[number]; | ||
|
||
/** | ||
* Defines the different variants for displaying the Modal. | ||
*/ | ||
export type PropModalVariant = { | ||
variant: ModalVariantPropType; | ||
}; | ||
|
||
/* validator */ | ||
export const validateModalVariant = (component: Generic.Element.Component, value?: ModalVariantPropType): void => { | ||
watchValidator( | ||
component, | ||
'_variant', | ||
(value) => typeof value === 'string' && ModalVariantPropTypeOptions.includes(value), | ||
new Set(ModalVariantPropTypeOptions), | ||
value, | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+4.21 KB
(200%)
...-transformer/snapshots/theme-default/snapshot-for-modal-basic-firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+3.42 KB
(110%)
...pshots/theme-default/snapshot-for-modal-basic-show-modal-true-firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+39.4 KB
...default/snapshot-for-modal-basic-show-modal-true-variant-card-firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+74.4 KB
...lt/snapshot-for-modal-basic-show-modal-true-variant-card-zoom-firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+145 Bytes
(100%)
...s/theme-default/snapshot-for-modal-basic-show-modal-true-zoom-firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+19.5 KB
(210%)
...sformer/snapshots/theme-default/snapshot-for-modal-basic-zoom-firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+4.21 KB
(200%)
...emes/default/snapshots/theme-default/snapshot-for-modal-basic-firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+3.42 KB
(110%)
...pshots/theme-default/snapshot-for-modal-basic-show-modal-true-firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+39.4 KB
...default/snapshot-for-modal-basic-show-modal-true-variant-card-firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+74.4 KB
...lt/snapshot-for-modal-basic-show-modal-true-variant-card-zoom-firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+145 Bytes
(100%)
...s/theme-default/snapshot-for-modal-basic-show-modal-true-zoom-firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+19.5 KB
(210%)
...default/snapshots/theme-default/snapshot-for-modal-basic-zoom-firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
@import '../mixins/rem'; | ||
|
||
@layer kol-theme-component { | ||
.kol-modal { | ||
&__card { | ||
box-shadow: 0 0 rem(4) var(--color-subtle); | ||
border-radius: var(--border-radius); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
@import '../../mixins/rem'; | ||
|
||
@layer kol-theme-component { | ||
.kol-modal { | ||
&__card { | ||
box-shadow: 0 0 calc(var(--spacing-2xs) / 2) var(--color-black); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
@import '../../mixins/rem'; | ||
|
||
@layer kol-theme-component { | ||
.kol-modal { | ||
&__card { | ||
box-shadow: 0 0 calc(var(--spacing-2xs) / 2) var(--color-black); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
@import '../mixins/rem'; | ||
|
||
@layer kol-theme-component { | ||
.kol-modal { | ||
&__card { | ||
border-color: var(--border-color); | ||
border-style: solid; | ||
border-width: rem(1); | ||
border-radius: calc(2 * var(--border-radius)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters