Skip to content

Commit

Permalink
Merge branch 'toast-basic-functions' into alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
BOTLANNER committed Jul 3, 2023
2 parents 78437d5 + 51b30e9 commit 5e0c010
Showing 1 changed file with 118 additions and 0 deletions.
118 changes: 118 additions & 0 deletions src/toast/Toast.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,42 @@ document.querySelector('omni-button').addEventListener('click', () => {
});`
}
},
{
framework: 'Vue',
sourceParts: {
htmlFragment: raw`<omni-button label="Show Toast" @click="showToast"></omni-button>`,
jsFragment: `import { Toast } from '@capitec/omni-components/toast';
window.vueData = {
showToast: () => {
Toast.show({
type: 'success',
header: 'Success!',
detail: 'It was successful.',
closeable: true,
duration: 3000
});
}
};`
}
},
{
framework: 'Lit',
sourceParts: {
htmlFragment: raw`<omni-button label="Show Toast" @click="\${showToast}"></omni-button>`,
jsFragment: `import { Toast } from '@capitec/omni-components/toast';
const showToast = () => {
Toast.show({
type: 'success',
header: 'Success!',
detail: 'It was successful.',
closeable: true,
duration: 3000
});
}`
}
},
{
framework: 'React',
load: (args) => `import { OmniButton } from "@capitec/omni-components-react/button";
Expand Down Expand Up @@ -171,6 +207,50 @@ document.querySelector('omni-button').addEventListener('click', () => {
});`
}
},
{
framework: 'Vue',
sourceParts: {
htmlFragment: raw`<omni-button label="Show Toast" @click="showToast"></omni-button>`,
jsFragment: `import { Toast } from '@capitec/omni-components/toast';
Toast.configure({
position: 'top'
});
window.vueData = {
showToast: () => {
Toast.show({
type: 'success',
header: 'Success!',
detail: 'It was successful.',
closeable: true,
duration: 3000
});
}
};`
}
},
{
framework: 'Lit',
sourceParts: {
htmlFragment: raw`<omni-button label="Show Toast" @click="\${showToast}"></omni-button>`,
jsFragment: `import { Toast } from '@capitec/omni-components/toast';
Toast.configure({
position: 'top'
});
const showToast = () => {
Toast.show({
type: 'success',
header: 'Success!',
detail: 'It was successful.',
closeable: true,
duration: 3000
});
}`
}
},
{
framework: 'React',
load: (args) => `import { OmniButton } from "@capitec/omni-components-react/button";
Expand Down Expand Up @@ -243,6 +323,44 @@ document.querySelector('omni-button').addEventListener('click', () => {
});`
}
},
{
framework: 'Vue',
sourceParts: {
htmlFragment: raw`<omni-button label="Show Toast" @click="showToast"></omni-button>`,
jsFragment: `import { Toast } from '@capitec/omni-components/toast';
window.vueData = {
showToast: () => {
Toast.show({
stack: true,
type: 'success',
header: 'Success!',
detail: 'It was successful.',
closeable: true,
duration: 3000
});
}
};`
}
},
{
framework: 'Lit',
sourceParts: {
htmlFragment: raw`<omni-button label="Show Toast" @click="\${showToast}"></omni-button>`,
jsFragment: `import { Toast } from '@capitec/omni-components/toast';
const showToast = () => {
Toast.show({
stack: true,
type: 'success',
header: 'Success!',
detail: 'It was successful.',
closeable: true,
duration: 3000
});
}`
}
},
{
framework: 'React',
load: (args) => `import { OmniButton } from "@capitec/omni-components-react/button";
Expand Down

0 comments on commit 5e0c010

Please sign in to comment.