forked from axa-ch-webhub-cloud/pattern-library
-
Notifications
You must be signed in to change notification settings - Fork 0
/
story.js
73 lines (66 loc) · 1.84 KB
/
story.js
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
import { boolean, select, text, withKnobs } from '@storybook/addon-knobs';
import { html, render } from 'lit';
import withNoBorder from '../../../../.storybook/addons/no-border';
import changelog from './CHANGELOG.md';
import './index';
import readme from './README.md';
const variantOptions = {
none: '',
success: 'success',
attention: 'attention',
warning: 'warning',
};
const iconOptions = {
None: '',
Success: 'check',
Informative: 'info-outline',
Attention: 'cloudy',
Error: 'warning-amber',
};
export default {
title: 'Components/Top Content Bar',
decorators: [withNoBorder, withKnobs],
parameters: {
readme,
usage: {
innerHTML: 'Some Text',
propsPureHTML: 'ctatext="Click Me"',
propsReact: 'onClick={() => alert("you clicked me")} ctatext="Click Me"',
},
changelog,
},
};
export const TopContentBar = () => {
const wrapper = document.createElement('div');
const ctatext = text('Cta text', '');
const variant = select('Variant', variantOptions, '');
const stickyMobile = boolean('Sticky on mobile', false);
const closable = boolean('Closable', false);
const icon = select('Icon', iconOptions, '');
const href = text('Href', '');
const textValue = text(
'Text',
'Unidentified flying object detected in your region. People are panicking. Stay calm!'
);
const link = text('Add axa-link', '');
const template = html`
<h1>HEADER</h1>
<axa-top-content-bar
variant="${variant}"
?stickymobile="${stickyMobile}"
?closable="${closable}"
icon="${icon}"
href="${href}"
ctatext="${ctatext}"
>
${textValue} ${link ? html` <axa-link>${link}</axa-link> ` : ''}
</axa-top-content-bar>
<h2>Subheader</h2>
<h3>Text 1</h3>
<h3>Text 2</h3>
<h3>Text 3</h3>
<h3>Text 4</h3>
`;
render(template, wrapper);
return wrapper;
};