Skip to content

Commit

Permalink
Update stories
Browse files Browse the repository at this point in the history
  • Loading branch information
bjarnef committed Oct 3, 2023
1 parent 7c4dfc8 commit 58f926f
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/uui-split-panel/lib/uui-split-panel.element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ export class UUISplitPanelElement extends LitElement {

return html
`<slot name="start" part="panel start" class="start"></slot>
<div
part="divider"
class="divider"
Expand All @@ -324,6 +325,7 @@ export class UUISplitPanelElement extends LitElement {
>
<slot name="divider"></slot>
</div>
<slot name="end" part="panel end" class="end"></slot>
`;
}
Expand Down
80 changes: 80 additions & 0 deletions packages/uui-split-panel/lib/uui-split-panel.story.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,32 @@ type Story = StoryObj<UUISplitPanelElement>;

export const Overview: Story = {};

export const Disabled: Story = {
args: {
disabled: true,
},
parameters: {
docs: {
source: {
code: `<uui-split-panel disabled style="height: 400px;">
<div
slot="start"
style="height: 200px; background: var(--uui-color-background); display: flex; align-items: center; justify-content: center; overflow: hidden;"
>
Start
</div>
<div
slot="end"
style="height: 200px; background: var(--uui-color-background); display: flex; align-items: center; justify-content: center; overflow: hidden;"
>
End
</div>
</uui-split-panel>`,
},
},
},
};

export const Vertical: Story = {
args: {
vertical: true,
Expand All @@ -48,3 +74,57 @@ export const Vertical: Story = {
},
},
};

export const Snapping: Story = {
args: {
snap: "100px 50%",
},
parameters: {
docs: {
source: {
code: `<div class="split-panel-snapping">
<uui-split-panel snap="100px 50%" style="height: 400px;">
<div
slot="start"
style="height: 200px; background: var(--uui-color-background); display: flex; align-items: center; justify-content: center; overflow: hidden;"
>
Start
</div>
<div
slot="end"
style="height: 200px; background: var(--uui-color-background); display: flex; align-items: center; justify-content: center; overflow: hidden;"
>
End
</div>
</uui-split-panel>
<div class="split-panel-snapping-dots"></div>
</div>
<style>
.split-panel-snapping {
position: relative;
}
.split-panel-snapping-dots::before,
.split-panel-snapping-dots::after {
content: '';
position: absolute;
bottom: -12px;
width: 6px;
height: 6px;
border-radius: 50%;
background: var(--sl-color-neutral-400);
transform: translateX(-3px);
}
.split-panel-snapping-dots::before {
left: 100px;
}
.split-panel-snapping-dots::after {
left: 50%;
}
</style>`,
},
},
},
};

0 comments on commit 58f926f

Please sign in to comment.