Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I9527 storybook6 #311

Merged
merged 9 commits into from
Jan 11, 2024
5 changes: 5 additions & 0 deletions .storybook/modes.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ export const allModes = {
},
// for snapshotting scrollable areas with all content, like modals
desktopLargeHeight: {
theme: 'ltr',
viewport: 'largeHeight',
},
'desktopLargeHeight rtl': {
viewport: 'largeHeight',
theme: 'rtl',
},
};
21 changes: 9 additions & 12 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/** @type { import('@storybook/vue3').Preview } */

import {withThemeByDataAttribute} from '@storybook/addon-themes';
import {mockDateDecorator} from 'storybook-mock-date-decorator';

import {setup} from '@storybook/vue3';
import GlobalMixins from '@/mixins/global.js';
import emitter from 'tiny-emitter/instance';
Expand All @@ -21,7 +23,6 @@ import Tabs from '@/components/Tabs/Tabs.vue';
import FloatingVue from 'floating-vue';

import PkpDialog from '@/components/Modal/Dialog.vue';
import {useDialogStore} from '@/stores/dialogStore';

import VueScrollTo from 'vue-scrollto';

Expand Down Expand Up @@ -106,7 +107,7 @@ const preview = {
* is too late fort tinyMCE which needs to detect it on first render correctly
*
*/
document.body.setAttribute('dir', globals.theme);
document.body.setAttribute('dir', globals.theme || 'ltr');
return story();
},
(story) => ({
Expand All @@ -115,22 +116,18 @@ const preview = {
}),
/** Globally Available Dialog */
(story) => ({
setup() {
const dialogStore = useDialogStore();
return {dialogStore};
},
setup() {},
components: {story, PkpDialog},
template: `<div>
<PkpDialog
:open="dialogStore.dialogOpened"
v-bind="dialogStore.dialogProps"
@close="dialogStore.closeDialog"
></PkpDialog>
<PkpDialog></PkpDialog>
<story />
</div>`,
}),
mockDateDecorator,
],
parameters: {
// remove default storybook padding as it likely cuts off modals
layout: 'fullscreen',
actions: {argTypesRegex: '^on[A-Z].*'},
controls: {
expanded: true,
Expand Down Expand Up @@ -159,7 +156,7 @@ const preview = {
/** For scrollable scenarios */
largeHeight: {
name: 'Large',
styles: {width: '1024px', height: '1500px'},
styles: {width: '1280px', height: '1600px'},
},
},
},
Expand Down
Loading