Skip to content

Commit 2e37de3

Browse files
authored
fix(toast): story animation (#352)
* fix: toast animation * refactor: uncomment FromDialog story
1 parent f0cef19 commit 2e37de3

File tree

4 files changed

+28
-24
lines changed

4 files changed

+28
-24
lines changed

packages/components/toast/src/stories/FromDialog.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
<script setup lang="ts">
2+
import { ref } from 'vue'
23
import {
34
OkuToast, OkuToastAction,
45
OkuToastDescription, OkuToastProvider, OkuToastViewport,
56
} from '@oku-ui/toast'
6-
import { ref } from 'vue'
7+
import {
8+
OkuDialog, OkuDialogClose, OkuDialogContent, OkuDialogDescription, OkuDialogOverlay, OkuDialogTitle, OkuDialogTrigger,
9+
} from '@oku-ui/dialog'
710
811
const open = ref(false)
912
</script>

packages/components/toast/src/stories/Toast.stories.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -51,20 +51,20 @@ export const Controlled: Story = {
5151
}),
5252
}
5353

54-
// export const FromDialog: Story = {
55-
// args: {
56-
// template: 'FromDialog',
57-
// },
58-
// render: (args: any) => ({
59-
// components: { OkuToastComponent },
60-
// setup() {
61-
// return { args }
62-
// },
63-
// template: `
64-
// <OkuToastComponent v-bind="args" />
65-
// `,
66-
// }),
67-
// }
54+
export const FromDialog: Story = {
55+
args: {
56+
template: 'FromDialog',
57+
},
58+
render: (args: any) => ({
59+
components: { OkuToastComponent },
60+
setup() {
61+
return { args }
62+
},
63+
template: `
64+
<OkuToastComponent v-bind="args" />
65+
`,
66+
}),
67+
}
6868

6969
export const Promise: Story = {
7070
args: {

packages/components/toast/src/stories/ToastDemo.vue

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import Animated from './Animated.vue'
77
import Cypress from './Cypress.vue'
88
import Chromatic from './Chromatic.vue'
99
import Styled from './Styled.vue'
10+
import FromDialog from './FromDialog.vue'
1011
1112
withDefaults(defineProps<IToastProps>(), {})
1213
const VIEWPORT_PADDING = '20px'
@@ -25,10 +26,10 @@ export interface IToastProps {
2526
<template v-if="template === 'Controlled' || allshow">
2627
<Controlled />
2728
</template>
28-
<!-- TODO: Needs OkuDialog Component -->
29-
<!-- <template v-if="template === 'FromDialog' || allshow">
29+
30+
<template v-if="template === 'FromDialog' || allshow">
3031
<FromDialog />
31-
</template> -->
32+
</template>
3233

3334
<template v-if="template === 'Promise' || allshow">
3435
<Promise />
@@ -216,15 +217,15 @@ export interface IToastProps {
216217
}
217218
218219
[data-swipe="end"][data-swipe-direction="left"] {
219-
animation-name: slideRight;
220+
animation-name: slideLeft;
220221
}
221222
222223
[data-swipe="end"][data-swipe-direction="up"] {
223-
animation-name: slideRight;
224+
animation-name: slideUp;
224225
}
225226
226227
[data-swipe="end"][data-swipe-direction="down"] {
227-
animation-name: slideRight;
228+
animation-name: slideDown;
228229
}
229230
230231
.chromatic-viewport {

packages/components/toast/src/stories/toast.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,15 +157,15 @@
157157
}
158158

159159
[data-swipe="end"][data-swipe-direction="left"] {
160-
animation-name: slideRight;
160+
animation-name: slideLeft;
161161
}
162162

163163
[data-swipe="end"][data-swipe-direction="up"] {
164-
animation-name: slideRight;
164+
animation-name: slideUp;
165165
}
166166

167167
[data-swipe="end"][data-swipe-direction="down"] {
168-
animation-name: slideRight;
168+
animation-name: slideDown;
169169
}
170170

171171
.chromatic-viewport {

0 commit comments

Comments
 (0)