Skip to content

Commit 01f705f

Browse files
JesmoDevJesper Møller Jensen
andauthored
docs: Added list items and border (#313)
Co-authored-by: Jesper Møller Jensen <[email protected]>
1 parent a71ac05 commit 01f705f

File tree

1 file changed

+26
-8
lines changed

1 file changed

+26
-8
lines changed

packages/uui-button-inline-create/lib/uui-button-inline-create.story.ts

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,12 @@ const insertBox = (e: any) => {
4040
e.target.parentElement.insertAdjacentElement('afterend', div);
4141
};
4242

43-
const createBox = (vertical: boolean, index: number) => html` <div
44-
style="position:relative;">
43+
const createBox = (vertical: boolean) => html` <div style="position:relative;">
4544
<div
4645
style="
4746
${vertical
4847
? 'display: grid; grid-template-columns: 1fr auto'
4948
: 'display:block;'}
50-
${index % 2 === 0 ? 'background-color:lightgrey;' : ''}
5149
">
5250
<div style="padding: 10px; white-space: nowrap;">
5351
${GetRandomUmbracoWord()}
@@ -62,18 +60,38 @@ const createBox = (vertical: boolean, index: number) => html` <div
6260
const createBoxes = (count: Number, vertical = false) => {
6361
const boxes: TemplateResult<1>[] = [];
6462
for (let index = 0; index < count; index++) {
65-
boxes.push(createBox(vertical, index));
63+
boxes.push(createBox(vertical));
6664
}
6765
return boxes;
6866
};
6967

7068
export const AAAOverview: Story = () =>
71-
html`<uui-button-inline-create
72-
label="Create Item"></uui-button-inline-create>`;
69+
html` <h3>Hover between list items to show the button.</h3>
70+
<div id="container" style="max-width: 500px; border: 1px solid grey">
71+
${createBoxes(5)}
72+
</div>`;
7373
AAAOverview.storyName = 'Overview';
74+
AAAOverview.parameters = {
75+
docs: {
76+
source: {
77+
code: `
78+
<div>
79+
<div style="padding: 10px;">Item 1</div>
80+
<uui-button-inline-create label="Create Item"></uui-button-inline-create>
81+
<div style="padding: 10px;">Item 2</div>
82+
<uui-button-inline-create label="Create Item"></uui-button-inline-create>
83+
<div style="padding: 10px;">Item 3</div>
84+
<uui-button-inline-create label="Create Item"></uui-button-inline-create>
85+
</div>
86+
`,
87+
},
88+
},
89+
};
7490

7591
export const Vertical: Story = () =>
76-
html`<div id="container" style="max-width: 500px">${createBoxes(5)}</div>`;
92+
html`<div id="container" style="max-width: 500px; border: 1px solid grey">
93+
${createBoxes(5)}
94+
</div>`;
7795

7896
Vertical.parameters = {
7997
docs: {
@@ -93,7 +111,7 @@ Vertical.parameters = {
93111
};
94112

95113
export const Horizontal: Story = () =>
96-
html`<div id="container-vertical" style="display: flex;">
114+
html`<div id="container-vertical" style="display: flex">
97115
${createBoxes(5, true)}
98116
</div>`;
99117

0 commit comments

Comments
 (0)