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

fix(flow-item): fix inverted footer start/end slots #9681

Merged
merged 1 commit into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,16 @@ const contentHTML = html`
`;

const footerHTML = html`
<calcite-button slot="${SLOTS.footerStart}" width="half" appearance="outline">Naw.</calcite-button>
<calcite-button slot="${SLOTS.footerEnd}" width="half">Yeah!</calcite-button>
<calcite-button slot="${SLOTS.footerStart}" width="half" appearance="outline">Footer start</calcite-button>
<calcite-button slot="${SLOTS.footerEnd}" width="half">Footer end</calcite-button>
`;

const flowItemContent = `${headerHTML}
<calcite-action text="Action" label="Action" slot="${SLOTS.headerActionsStart}" icon="bluetooth"></calcite-action>
<calcite-action text="Action" label="Action" slot="${SLOTS.headerActionsEnd}" icon="attachment"></calcite-action>
${contentHTML}
<calcite-button slot="${SLOTS.footer}" width="half" appearance="outline">Naw.</calcite-button>
<calcite-button slot="${SLOTS.footer}" width="half">Yeah!</calcite-button>
<calcite-button slot="${SLOTS.footer}" width="half" appearance="outline">Footer</calcite-button>
<calcite-button slot="${SLOTS.footer}" width="half">Footer</calcite-button>
`;

export const simple = (args: FlowItemStoryArgs): string => html`
Expand All @@ -93,8 +93,8 @@ export const simple = (args: FlowItemStoryArgs): string => html`
<calcite-action text="Action" label="Action" slot="${SLOTS.headerActionsEnd}" icon="attachment"></calcite-action>
${contentHTML}
<calcite-fab slot="fab"></calcite-fab>
<calcite-button slot="${SLOTS.footer}" width="half" appearance="outline">Naw.</calcite-button>
<calcite-button slot="${SLOTS.footer}" width="half">Yeah!</calcite-button>
<calcite-button slot="${SLOTS.footer}" width="half" appearance="outline">Footer</calcite-button>
<calcite-button slot="${SLOTS.footer}" width="half">Footer</calcite-button>
</calcite-flow-item>
`;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -393,8 +393,8 @@ export class FlowItem
<slot name={SLOTS.contentTop} slot={PANEL_SLOTS.contentTop} />
<slot name={SLOTS.contentBottom} slot={PANEL_SLOTS.contentBottom} />
<slot name={SLOTS.footer} slot={PANEL_SLOTS.footer}>
<slot name={SLOTS.footerEnd} slot={PANEL_SLOTS.footerEnd} />
<slot name={SLOTS.footerStart} slot={PANEL_SLOTS.footerStart} />
<slot name={SLOTS.footerEnd} slot={PANEL_SLOTS.footerEnd} />
</slot>
<slot name={SLOTS.footerActions} slot={PANEL_SLOTS.footerActions} />
<slot />
Expand Down
34 changes: 12 additions & 22 deletions packages/calcite-components/src/components/panel/panel.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ const contentHTML = html`
`;

const footerHTML = html`
<calcite-button slot="${SLOTS.footerStart}" width="half" appearance="outline">Naw.</calcite-button>
<calcite-button slot="${SLOTS.footerEnd}" width="half">Yeah!</calcite-button>
<calcite-button slot="${SLOTS.footerStart}" width="half" appearance="outline">Footer start</calcite-button>
<calcite-button slot="${SLOTS.footerEnd}" width="half">Footer end</calcite-button>
`;

const panelContent = `${headerHTML}
Expand Down Expand Up @@ -253,7 +253,7 @@ export const actionBarBackgroundColor_TestOnly = (): string =>
<p style="height: 400px">Hello world!</p>
<p style="height: 400px">Hello world!</p>
<p style="height: 400px">Hello world!</p>
<p slot="footer">Slotted content!</p>
<p slot="footer">Footer!</p>
</calcite-panel>`;

export const footerWithoutContent_TestOnly = (): string =>
Expand All @@ -262,7 +262,7 @@ export const footerWithoutContent_TestOnly = (): string =>
heading="Header!"
style="width: 300px; height:auto; --calcite-panel-header-border-block-end:none;"
>
<p slot="footer">Footer content!</p>
<p slot="footer">Footer!</p>
</calcite-panel>`;

export const actionBarWithoutContent_TestOnly = (): string =>
Expand Down Expand Up @@ -309,7 +309,7 @@ export const footerAndActionBarWithoutContent_TestOnly = (): string =>
<calcite-action text="Layers" icon="layers"> </calcite-action>
</calcite-action-group>
</calcite-action-bar>
<p slot="footer">Footer content!</p>
<p slot="footer">Footer!</p>
</calcite-panel>`;

export const flexContent_TestOnly = (): string =>
Expand Down Expand Up @@ -395,7 +395,7 @@ export const footerAndContentTopBottomSlots = (): string => html`
<p>Hello world!</p>
<p>Hello world!</p>
<div slot="content-bottom">Slot for a content-bottom.</div>
<p slot="footer">Slotted content!</p>
<p slot="footer">Footer!</p>
</calcite-panel>
</div>
`;
Expand All @@ -405,22 +405,12 @@ export const footerStartAndEndSlots = (): string => html`
<div slot="header-content">header-content slot</div>
<p>Slotted content!</p>
<div slot="content-bottom">Slot for a content-bottom.</div>
<calcite-button
type="button"
slot="footer-start"
kind="neutral"
scale="s"
id="card-icon-test-1"
icon-start="check"
></calcite-button>
<calcite-button
type="button"
slot="footer-end"
kind="neutral"
scale="s"
id="card-icon-test-1"
icon-start="check"
></calcite-button>
<calcite-button type="button" slot="footer-start" kind="neutral" scale="s" id="card-icon-test-1" icon-start="check"
>Footer start</calcite-button
>
<calcite-button type="button" slot="footer-end" kind="neutral" scale="s" id="card-icon-test-1" icon-start="check"
>Footer end</calcite-button
>
</calcite-panel>
`;

Expand Down
Loading