-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathActionBox.stories.ts
More file actions
83 lines (75 loc) · 2.15 KB
/
Copy pathActionBox.stories.ts
File metadata and controls
83 lines (75 loc) · 2.15 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
import type { StoryFn } from '@storybook/vue3-vite';
import { action } from 'storybook/actions';
import N8nActionBox from './ActionBox.vue';
import N8nLink from '../N8nLink';
import N8nText from '../N8nText';
export default {
title: 'Core/ActionBox',
component: N8nActionBox,
argTypes: {
calloutTheme: {
control: {
type: 'select',
},
options: ['info', 'success', 'warning', 'danger', 'custom'],
},
},
parameters: {
backgrounds: { default: '--color--background--light-2' },
},
};
const methods = {
onClick: action('click'),
};
const DefaultTemplate: StoryFn = (args, { argTypes }) => ({
setup: () => ({ args }),
props: Object.keys(argTypes),
components: {
N8nActionBox,
},
template: '<n8n-action-box v-bind="args" @click="onClick" />',
methods,
});
export const ActionBox = DefaultTemplate.bind({});
ActionBox.args = {
icon: { type: 'emoji', value: '😿' },
heading: 'Headline you need to know',
description:
'Long description that you should know something is the way it is because of how it is. ',
buttonText: 'Do something',
};
export const ActionBoxWithIcon = DefaultTemplate.bind({});
ActionBoxWithIcon.args = {
icon: { type: 'icon', value: 'tree-pine' },
heading: 'Create your first workflow',
description: 'Get started by creating a new workflow to automate your tasks.',
buttonText: 'Create Workflow',
};
const WithAdditionalContentTemplate: StoryFn = (args, { argTypes }) => ({
setup: () => ({ args }),
props: Object.keys(argTypes),
components: {
N8nActionBox,
N8nText,
N8nLink,
},
template: `
<n8n-action-box v-bind="args" @click="onClick">
<template #additionalContent>
<N8nText color="text-base">
Read more on
</N8nText>
<N8nLink class="ml-4xs" href="https://n8n.io" target="_blank">our docs</N8nLink>
</template>
</n8n-action-box>
`,
methods,
});
export const ActionBoxWithAdditionalContent = WithAdditionalContentTemplate.bind({});
ActionBoxWithAdditionalContent.args = {
icon: { type: 'emoji', value: '🚀' },
heading: 'Launch your project',
description:
'Get started with your project by clicking the button below. Additional content is included.',
buttonText: 'Get Started',
};