Skip to content

Commit

Permalink
chore(panel): clean up PARTS
Browse files Browse the repository at this point in the history
  • Loading branch information
alisonailea committed Feb 7, 2025
1 parent 1af7a1c commit ca25807
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/calcite-components/src/components/panel/panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import { useT9n } from "../../controllers/useT9n";
import type { Alert } from "../alert/alert";
import type { ActionBar } from "../action-bar/action-bar";
import T9nStrings from "./assets/t9n/messages.en.json";
import { CSS, ICONS, IDS, SLOTS } from "./resources";
import { CSS, ICONS, IDS, PART, SLOTS } from "./resources";
import { styles } from "./panel.scss";

declare global {
Expand Down Expand Up @@ -421,7 +421,7 @@ export class Panel extends LitElement implements InteractiveComponent, LoadableC

private renderActionBar(): JsxNode {
return (
<div class={CSS.actionBarContainer} hidden={!this.hasActionBar} part="header">
<div class={CSS.actionBarContainer} hidden={!this.hasActionBar} part={PART.header}>
<slot name={SLOTS.actionBar} onSlotChange={this.handleActionBarSlotChange} />
</div>
);
Expand Down Expand Up @@ -575,7 +575,7 @@ export class Panel extends LitElement implements InteractiveComponent, LoadableC
<div
class={{ [CSS.headerContainer]: true, [CSS.headerContainerBorderEnd]: hasActionBar }}
hidden={!showHeaderContent}
part="header"
part={PART.header}
>
{this.renderHeaderStartActions()}
{this.renderHeaderSlottedContent()}
Expand All @@ -595,7 +595,7 @@ export class Panel extends LitElement implements InteractiveComponent, LoadableC
hasFooterStartContent || hasFooterEndContent || hasFooterContent || hasFooterActions;

return (
<footer class={CSS.footer} hidden={!showFooter} part="footer">
<footer class={CSS.footer} hidden={!showFooter} part={PART.footer}>
<div class={CSS.footerContent} hidden={!hasFooterContent}>
<slot name={SLOTS.footer} onSlotChange={this.handleFooterSlotChange} />
</div>
Expand Down
5 changes: 5 additions & 0 deletions packages/calcite-components/src/components/panel/resources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,8 @@ export const SLOTS = {
};

export const HEADING_LEVEL = 3;

export const PART = {
header: "header",
footer: "footer",
};

0 comments on commit ca25807

Please sign in to comment.