diff --git a/libs/components/src/dialog/dialog-overview.stories.mdx b/libs/components/src/dialog/dialog-overview.stories.mdx index 7acaae3fc..5430634ea 100644 --- a/libs/components/src/dialog/dialog-overview.stories.mdx +++ b/libs/components/src/dialog/dialog-overview.stories.mdx @@ -3,9 +3,6 @@ import { Canvas, Meta, DocsContainer, Story } from '@storybook/addon-docs'; - - # Dialogs ## Basics @@ -52,10 +30,14 @@ import { Canvas, Meta, DocsContainer, Story } from '@storybook/addon-docs'; ## Examples +### Logout +
   
 
+### Destructive dialog +
   
 
diff --git a/libs/components/src/dialog/dialog.stories.js b/libs/components/src/dialog/dialog.stories.js index ffb174a8e..768c155de 100644 --- a/libs/components/src/dialog/dialog.stories.js +++ b/libs/components/src/dialog/dialog.stories.js @@ -3,64 +3,71 @@ import './dialog'; export default { title: 'Components/Dialog', - properties: { - darkMode: { current: 'dark', stylePreview: true }, - }, }; -const Template = ({ isDark }) => { - return `
- - Dialog body text - Action 2 - Action 1 - -
`; +const Template = () => { + document.addEventListener( + 'DOMContentLoaded', + () => { + const button = document.body.querySelector('#dialog-button'); + button.addEventListener('click', () => { + const dialog = document.body.querySelector('#dialog1'); + dialog.open = true; + }); + }, + { once: true } + ); + return ` + Open basic dialog + + Dialog body text + Action 2 + Action 1 + `; }; export const Basic = dialogComponent.bind({}); -Basic.parameters = { - docs: { - inlineStories: false, - }, -}; export const Anatomy = Template.bind({}); -Anatomy.parameters = { - docs: { - inlineStories: false, - }, -}; const templateLogout = ({}) => { - return ` + document.addEventListener( + 'DOMContentLoaded', + () => { + const button = document.body.querySelector('#logout-button'); + button.addEventListener('click', () => { + const dialog = document.body.querySelector('#example-logout'); + dialog.open = true; + }); + }, + { once: true } + ); + return ` + Open logout dialog + Due to inactivity, you’ll be logged out in 3 minutes to protect your security. - Log out - Stay logged in + Log out + Stay logged in `; }; export const Logout = templateLogout.bind({}); -Logout.parameters = { - docs: { - inlineStories: false, - }, -}; const templateUDF = ({}) => { - return ` - + document.addEventListener( + 'DOMContentLoaded', + () => { + const button = document.body.querySelector('#udf-button'); + button.addEventListener('click', () => { + const dialog = document.body.querySelector('#example-udf'); + dialog.open = true; + }); + }, + { once: true } + ); + return ` + Open UDF dialog +
Function to delete
@@ -69,14 +76,9 @@ const templateUDF = ({}) => { - Delete - Cancel + Delete + Cancel `; }; export const UDF = templateUDF.bind({}); -UDF.parameters = { - docs: { - inlineStories: false, - }, -}; diff --git a/libs/components/stories/Introduction.stories.mdx b/libs/components/stories/Introduction.stories.mdx index 8e66a0cab..4edf6cc38 100644 --- a/libs/components/stories/Introduction.stories.mdx +++ b/libs/components/stories/Introduction.stories.mdx @@ -19,14 +19,14 @@ the raw components. We'll layer in documenation over time. Ping us in the **#design-system** channel on Slack for help.
- + App shell Our standard starter app, great for multi-level UIs that need to show a dashboard, subsections with lists of items, and detail pages to view those items. - + Kitchen sinkA large collection of all our components on a single screen, to give a high level overview of what's available and to