-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #134 from Perdolique/65-confirmation-dialog
style: Update base.scss and dialog styles
- Loading branch information
Showing
9 changed files
with
165 additions
and
15 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 |
---|---|---|
|
@@ -42,6 +42,8 @@ | |
onClickOutside(rootRef, () => { | ||
isMenuVisible.value = false | ||
}, { | ||
ignore: ['dialog'] | ||
}); | ||
</script> | ||
|
||
|
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,100 @@ | ||
<template> | ||
<ModalDialog v-model="isOpened"> | ||
<div :class="$style.content"> | ||
<PerdHeading | ||
:class="$style.header" | ||
:level="2" | ||
> | ||
{{ headerText }} | ||
</PerdHeading> | ||
|
||
<div :class="$style.body"> | ||
<slot /> | ||
</div> | ||
|
||
<div :class="$style.buttons"> | ||
<PerdButton | ||
secondary | ||
:class="$style.cancelButton" | ||
@click="close" | ||
> | ||
{{ cancelButtonText }} | ||
</PerdButton> | ||
|
||
<PerdButton | ||
:class="$style.confirmButton" | ||
@click="emitConfirm" | ||
> | ||
{{ confirmButtonText }} | ||
</PerdButton> | ||
</div> | ||
</div> | ||
</ModalDialog> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import PerdButton from '~/components/PerdButton.vue' | ||
import PerdHeading from '~/components/PerdHeading.vue'; | ||
import ModalDialog from './ModalDialog.vue' | ||
interface Props { | ||
readonly headerText: string; | ||
readonly confirmButtonText: string; | ||
readonly cancelButtonText?: string; | ||
} | ||
type Emits = (event: 'confirm') => void | ||
const isOpened = defineModel<boolean>({ | ||
required: true | ||
}) | ||
const { | ||
cancelButtonText = 'Cancel' | ||
} = defineProps<Props>() | ||
const emit = defineEmits<Emits>() | ||
function close() { | ||
isOpened.value = false | ||
} | ||
function emitConfirm() { | ||
emit('confirm') | ||
close() | ||
} | ||
</script> | ||
|
||
<style lang="scss" module> | ||
.content { | ||
display: grid; | ||
row-gap: var(--spacing-24); | ||
column-gap: var(--spacing-16); | ||
background-color: var(--dialog-color-background); | ||
padding: var(--dialog-padding); | ||
border-radius: var(--dialog-border-radius); | ||
border: 1px solid var(--dialog-color-border); | ||
} | ||
.header { | ||
@include overflow-ellipsis(); | ||
} | ||
.body { | ||
word-break: break-word; | ||
} | ||
.buttons { | ||
display: flex; | ||
flex-wrap: wrap; | ||
justify-content: flex-end; | ||
gap: var(--spacing-16); | ||
} | ||
.confirmButton, | ||
.cancelButton { | ||
max-width: 200px; | ||
@include overflow-ellipsis(); | ||
} | ||
</style> |
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
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