Skip to content
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

Merged
merged 8 commits into from
May 10, 2024

Conversation

Elijbet
Copy link
Contributor

@Elijbet Elijbet commented May 9, 2024

Related Issue: #8980

Summary

Add a new content-top slot to the panel component.

@github-actions github-actions bot added the enhancement Issues tied to a new feature or request. label May 9, 2024
@Elijbet Elijbet added the pr ready for visual snapshots Adding this label will run visual snapshot testing. label May 9, 2024
@Elijbet Elijbet marked this pull request as ready for review May 9, 2024 23:15
@Elijbet Elijbet requested a review from a team as a code owner May 9, 2024 23:15
Copy link
Member

@jcfranco jcfranco left a 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! 🚀

<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>
Copy link
Member

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?

Copy link
Contributor Author

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">
Copy link
Member

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?

Copy link
Contributor Author

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).

@Elijbet Elijbet added pr ready for visual snapshots Adding this label will run visual snapshot testing. and removed pr ready for visual snapshots Adding this label will run visual snapshot testing. labels May 10, 2024
@Elijbet Elijbet added skip visual snapshots Pull requests that do not need visual regression testing. and removed pr ready for visual snapshots Adding this label will run visual snapshot testing. labels May 10, 2024
@Elijbet Elijbet merged commit df8d71c into main May 10, 2024
10 checks passed
@Elijbet Elijbet deleted the elijbet/8980-panel-add-content-top-slot branch May 10, 2024 23:18
@driskull
Copy link
Member

@Elijbet @jcfranco should these slots also be added to flow-item for consistency?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Issues tied to a new feature or request. skip visual snapshots Pull requests that do not need visual regression testing.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants