-
Notifications
You must be signed in to change notification settings - Fork 705
Expand file tree
/
Copy pathdialog.stories.ts
More file actions
40 lines (32 loc) · 1.03 KB
/
Copy pathdialog.stories.ts
File metadata and controls
40 lines (32 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import type {Meta, StoryObj} from '@storybook/web-components-vite';
import {html} from 'lit';
import './dialog.js';
import type CraftDialog from './dialog.js';
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
const meta = {
title: 'Components/Dialog',
component: 'craft-dialog',
args: {},
parameters: {
layout: 'centered',
},
render: function (args) {
function openDialog() {
const dialog = document.getElementById('storybook-dialog') as CraftDialog;
dialog.open = true;
}
return html`
<craft-dialog label="Dialog" id="storybook-dialog">
This is some text within a dialog.
<craft-button slot="footer" data-dialog="close">Close</craft-button>
</craft-dialog>
<craft-button @click="${openDialog}">Open Dialog</craft-button>
`;
},
} satisfies Meta<any>;
export default meta;
type Story = StoryObj<any>;
// More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
export const Default: Story = {
args: {},
};