Skip to content

Commit

Permalink
feat(cxl-ui): [cxl-dialog] add story
Browse files Browse the repository at this point in the history
  • Loading branch information
anoblet committed Aug 15, 2022
1 parent 9af9743 commit 3fce88f
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions packages/storybook/cxl-ui/cxl-dialog/index.stories.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import '@conversionxl/cxl-ui/src/components/cxl-dialog/cxl-dialog.js';
import { html } from 'lit';

export default {
title: 'CXL UI/cxl-dialog',
};

// eslint-disable-next-line no-empty-pattern
const Template = ({}) => html`
<style>
#root-inner {
align-items: center;
justify-content: center;
display: flex;
height: 100vh;
}
#container {
border: 1px solid #000;
height: 80vh;
position: relative;
width: 80vw;
}
</style>
<div id="container"></div>
<script>
const dialog = document.createElement('cxl-dialog');
const container = document.querySelector('#container');
dialog.container = container;
dialog.renderer = (root) => {
root.textContent = 'This is a dialog';
};
container.appendChild(dialog);
dialog.opened = true;
</script>
`;

export const Default = Template.bind({});

Object.assign(Default, {
args: {},
});

0 comments on commit 3fce88f

Please sign in to comment.