n8n/packages/design-system/src/components/N8nNotice/Notice.stories.ts
कारतोफ्फेलस्क्रिप्ट™ 13659d036f
ci: Ensure that eslint runs on all frontend code (no-changelog) (#4602)
* ensure that eslint runs on all frontend code

* remove tslint from `design-system`

* enable prettier and eslint-prettier for `design-system`

* Delete tslint.json

* use a single editorconfig for the repo

* enable prettier for all code in `design-system`

* more linting fixes on design-system

* ignore coverage for git and prettier

* lintfix on editor-ui
2022-11-15 18:20:54 +01:00

72 lines
1.8 KiB
TypeScript

import N8nNotice from './Notice.vue';
import type { StoryFn } from '@storybook/vue';
export default {
title: 'Atoms/Notice',
component: N8nNotice,
argTypes: {
theme: {
control: 'select',
options: ['success', 'warning', 'danger', 'info'],
},
},
};
const SlotTemplate: StoryFn = (args, { argTypes }) => ({
props: Object.keys(argTypes),
components: {
N8nNotice,
},
template: `<n8n-notice v-bind="$props">This is a notice! Thread carefully from this point forward.</n8n-notice>`,
});
const PropTemplate: StoryFn = (args, { argTypes }) => ({
props: Object.keys(argTypes),
components: {
N8nNotice,
},
template: `<n8n-notice v-bind="$props"/>`,
});
export const Warning = SlotTemplate.bind({});
Warning.args = {
theme: 'warning',
};
export const Danger = SlotTemplate.bind({});
Danger.args = {
theme: 'danger',
};
export const Success = SlotTemplate.bind({});
Success.args = {
theme: 'success',
};
export const Info = SlotTemplate.bind({});
Info.args = {
theme: 'info',
};
export const Sanitized = PropTemplate.bind({});
Sanitized.args = {
theme: 'warning',
content:
'<script>alert(1)</script> This content contains a script tag and is <strong>sanitized</strong>.',
};
export const Truncated = PropTemplate.bind({});
Truncated.args = {
theme: 'warning',
truncate: true,
content:
'This content is long and will be truncated at 150 characters. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.',
};
export const HtmlEdgeCase = PropTemplate.bind({});
HtmlEdgeCase.args = {
theme: 'warning',
truncate: true,
content:
'This content is long and will be truncated at 150 characters. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod <a href="">read the documentation</a> ut labore et dolore magna aliqua.',
};