2023-07-27 07:31:52 +02:00
|
|
|
/*
|
|
|
|
* SPDX-FileCopyrightText: syuilo and other misskey contributors
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
*/
|
|
|
|
|
2023-04-04 02:38:34 +02:00
|
|
|
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
2023-04-07 13:34:23 +02:00
|
|
|
import { waitFor } from '@storybook/testing-library';
|
2023-04-04 02:38:34 +02:00
|
|
|
import { StoryObj } from '@storybook/vue3';
|
|
|
|
import MkPageHeader from './MkPageHeader.vue';
|
|
|
|
export const Empty = {
|
|
|
|
render(args) {
|
|
|
|
return {
|
|
|
|
components: {
|
|
|
|
MkPageHeader,
|
|
|
|
},
|
|
|
|
setup() {
|
|
|
|
return {
|
|
|
|
args,
|
|
|
|
};
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
props() {
|
|
|
|
return {
|
|
|
|
...this.args,
|
|
|
|
};
|
|
|
|
},
|
|
|
|
},
|
|
|
|
template: '<MkPageHeader v-bind="props" />',
|
|
|
|
};
|
|
|
|
},
|
2023-04-07 13:34:23 +02:00
|
|
|
async play() {
|
|
|
|
const wait = new Promise((resolve) => setTimeout(resolve, 800));
|
|
|
|
await waitFor(async () => await wait);
|
|
|
|
},
|
2023-04-04 02:38:34 +02:00
|
|
|
args: {
|
|
|
|
static: true,
|
|
|
|
tabs: [],
|
|
|
|
},
|
|
|
|
parameters: {
|
|
|
|
layout: 'centered',
|
|
|
|
},
|
|
|
|
} satisfies StoryObj<typeof MkPageHeader>;
|
|
|
|
export const OneTab = {
|
|
|
|
...Empty,
|
|
|
|
args: {
|
|
|
|
...Empty.args,
|
|
|
|
tab: 'sometabkey',
|
|
|
|
tabs: [
|
|
|
|
{
|
|
|
|
key: 'sometabkey',
|
|
|
|
title: 'Some Tab Title',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
} satisfies StoryObj<typeof MkPageHeader>;
|
|
|
|
export const Icon = {
|
|
|
|
...OneTab,
|
|
|
|
args: {
|
|
|
|
...OneTab.args,
|
|
|
|
tabs: [
|
|
|
|
{
|
|
|
|
...OneTab.args.tabs[0],
|
|
|
|
icon: 'ti ti-home',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
} satisfies StoryObj<typeof MkPageHeader>;
|
|
|
|
export const IconOnly = {
|
|
|
|
...Icon,
|
|
|
|
args: {
|
|
|
|
...Icon.args,
|
|
|
|
tabs: [
|
|
|
|
{
|
|
|
|
...Icon.args.tabs[0],
|
|
|
|
title: undefined,
|
|
|
|
iconOnly: true,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
} satisfies StoryObj<typeof MkPageHeader>;
|
|
|
|
export const SomeTabs = {
|
|
|
|
...Empty,
|
|
|
|
args: {
|
|
|
|
...Empty.args,
|
|
|
|
tab: 'princess',
|
|
|
|
tabs: [
|
|
|
|
{
|
|
|
|
key: 'princess',
|
|
|
|
title: 'Princess',
|
|
|
|
icon: 'ti ti-crown',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
key: 'fairy',
|
|
|
|
title: 'Fairy',
|
|
|
|
icon: 'ti ti-snowflake',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
key: 'angel',
|
|
|
|
title: 'Angel',
|
|
|
|
icon: 'ti ti-feather',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
} satisfies StoryObj<typeof MkPageHeader>;
|