-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(panel): add content-top slot #9293
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aside from a few comments, this LGTM! 🚀
packages/calcite-components/src/components/panel/panel.stories.ts
Outdated
Show resolved
Hide resolved
<div slot="content-top" id="content-top">Slot for a content-top.</div> | ||
<div slot="header-content">Header!</div> | ||
<p>Slotted content!</p> | ||
<p style="height: 400px">Hello first!</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the simplest test case or can we simplify by removing these paragraphs with inline styles?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can remove inline styles, but paragraphs are there to show the sticky property of content-top
when scrolled.
@@ -440,3 +440,24 @@ export const withNoHeaderBorderBlockEnd_TestOnly = (): string => | |||
html`<calcite-panel style="--calcite-panel-header-border-block-end:none;" height-scale="s" heading="My Panel" | |||
>Slotted content!</calcite-panel | |||
>`; | |||
|
|||
export const contentTopSlot_TestOnly = (): string => html` | |||
<div style="height: 300px; width: 400px; display: flex"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this outer element needed for the content-top
slot screenshot?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The outer element is there to restrict the height of the panel so we can see how scrolling of the slotted content affects the header (it should be sticky).
Related Issue: #8980
Summary
Add a new
content-top
slot to thepanel
component.