Skip to content

Commit 12f1476

Browse files
authored
feat(panel): improve panel header layout (#10446)
**Related Issue:** #10385 ## Summary Slotted content will now adjust its size and position to allow more flexible layouts, similar to how content behaves in `modal`.
1 parent 9729ccf commit 12f1476

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

packages/calcite-components/src/components/dialog/dialog.stories.ts

+10-1
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,17 @@ withTooltips.parameters = {
210210
};
211211

212212
export const withCustomHeader = (): string => html`
213+
<style>
214+
#three-quarters-width-header-content {
215+
width: 75%;
216+
}
217+
</style>
213218
<calcite-dialog open scale="m" width-scale="s">
214-
<div slot="${SLOTS.headerContent}">Header!</div>
219+
<div id="three-quarters-width-header-content" slot="${SLOTS.headerContent}">
220+
<calcite-inline-editable scale="l" editingEnabled="true">
221+
<calcite-input alignment="start" placeholder="Enter text..." scale="l" type="text" value="Editable header" />
222+
</calcite-inline-editable>
223+
</div>
215224
<p>Slotted content!</p>
216225
</calcite-dialog>
217226
`;

packages/calcite-components/src/components/panel/panel.scss

+1
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@
180180
}
181181

182182
.header-content {
183+
flex: 1 1 auto;
183184
padding-block: var(--calcite-internal-panel-header-vertical-padding);
184185
padding-inline: var(--calcite-internal-panel-default-padding);
185186
}

0 commit comments

Comments
 (0)