Skip to content

Commit e9fc929

Browse files
committed
feat(a-modal): add new component
1 parent a07866a commit e9fc929

File tree

7 files changed

+109
-2
lines changed

7 files changed

+109
-2
lines changed

src/components/atoms/a-card/a-card.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
[`a-card--variant-${variant}`]: variant,
77
[`a-card--elevation-${elevation}`]: elevation,
88
}"
9+
v-on="$listeners"
910
>
1011
<slot />
1112
</component>

src/components/atoms/a-icon/a-icon.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
[`a-icon--wrapper-${wrapper}`]: wrapper !== 'default',
99
}"
1010
v-bind="$attrs"
11+
v-on="$listeners"
1112
>
1213
<i :class="icon" />
1314
</component>

src/components/atoms/a-select/a-select_deprecated.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
:icon="icon"
2424
:color="iconColor"
2525
class="a-select__icon"
26-
@click.native="open = !open"
26+
@click="open = !open"
2727
/>
2828

2929
<ul
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import { Meta, ArgsTable, Story, Canvas } from '@storybook/addon-docs/blocks';
2+
import { action } from '@storybook/addon-actions'
3+
import AModal from './a-modal.vue';
4+
import { AButton } from "@/components/atoms/a-button";
5+
6+
<Meta title="Design System/Molecules/AModal" component={AModal} />
7+
8+
## AModal
9+
10+
### Default use:
11+
12+
<Canvas>
13+
<Story name="Default use">
14+
{{
15+
components: { AModal, AButton },
16+
data() {
17+
return { isOpen: false };
18+
},
19+
template: `<div>
20+
<a-button @click="isOpen = !isOpen">Activing</a-button>
21+
<a-modal :is-open="isOpen" @closing="isOpen = false">AModal</a-modal>
22+
</div>`,
23+
}}
24+
</Story>
25+
</Canvas>
26+
27+
<ArgsTable of={AModal} />
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
<template>
2+
<transition
3+
name="a-modal--fade"
4+
mode="out-in"
5+
>
6+
<div
7+
v-if="isOpen"
8+
class="a-modal__mask"
9+
>
10+
<div class="a-modal__wrapper">
11+
<a-icon
12+
icon="fas fa-times"
13+
tag="button"
14+
class="a-modal__button-close"
15+
color="inverse"
16+
@click="$emit('closing')"
17+
/>
18+
<a-card class="a-modal__container">
19+
<slot />
20+
</a-card>
21+
</div>
22+
</div>
23+
</transition>
24+
</template>
25+
26+
<script>
27+
import { ACard } from '@/components/atoms/a-card';
28+
import { AIcon } from '@/components/atoms/a-icon';
29+
30+
export default {
31+
components: {
32+
ACard,
33+
AIcon,
34+
},
35+
props: {
36+
isOpen: {
37+
type: Boolean,
38+
default: true,
39+
},
40+
},
41+
};
42+
</script>
43+
44+
<style>
45+
.a-modal__mask {
46+
position: fixed;
47+
z-index: 9998;
48+
top: 0;
49+
left: 0;
50+
width: 100%;
51+
height: 100%;
52+
background: var(--colors-scale-grey-high);
53+
display: flex;
54+
justify-content: center;
55+
align-items: center;
56+
}
57+
58+
.a-modal__wrapper {
59+
position: relative;
60+
}
61+
62+
.a-modal__button-close {
63+
position: absolute;
64+
right: 0;
65+
top: -24px;
66+
}
67+
68+
.a-modal--fade-enter-active, .a-modal--fade-leave-active {
69+
transition: opacity 250ms;
70+
}
71+
72+
.a-modal--fade-enter, .a-modal--fade-leave-to {
73+
opacity: 0;
74+
}
75+
</style>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import AModal from './a-modal.vue';
2+
3+
export { AModal };

src/components/molecules/a-toast/a-toast.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
:variant="item.variant"
2020
class="a-toast__item"
2121
tag="button"
22-
@click.native="handleClick(index)"
22+
@click="handleClick(index)"
2323
>
2424
<div class="a-toast__icon">
2525
<AIcon

0 commit comments

Comments
 (0)