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(flow-item): add content-top slot #9344

Merged
merged 4 commits into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
100 changes: 80 additions & 20 deletions packages/calcite-components/src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3681,7 +3681,7 @@ export namespace Components {
"setFocus": () => Promise<void>;
}
/**
* @deprecated Use the `list` component instead.
* @deprecated Use the `calcite-list` component instead.
*/
interface CalcitePickList {
/**
Expand Down Expand Up @@ -3737,7 +3737,7 @@ export namespace Components {
"setFocus": (focusId?: ListFocusId) => Promise<void>;
}
/**
* @deprecated Use the `list` component instead.
* @deprecated Use the `calcite-list` component instead.
*/
interface CalcitePickListGroup {
/**
Expand All @@ -3750,7 +3750,7 @@ export namespace Components {
"headingLevel": HeadingLevel;
}
/**
* @deprecated Use the `list` component instead.
* @deprecated Use the `calcite-list` component instead.
*/
interface CalcitePickListItem {
/**
Expand Down Expand Up @@ -5304,6 +5304,9 @@ export namespace Components {
SelectionMode
>;
}
/**
* @deprecated Use the `calcite-tile` component instead.
*/
interface CalciteTileSelect {
/**
* When `true`, the component is checked.
Expand Down Expand Up @@ -5358,6 +5361,9 @@ export namespace Components {
*/
"width": Extract<"auto" | "full", Width>;
}
/**
* @deprecated Use the `calcite-tile-group` component instead.
*/
interface CalciteTileSelectGroup {
/**
* When `true`, interaction is prevented and the component is displayed with lower opacity.
Expand Down Expand Up @@ -5398,6 +5404,9 @@ export namespace Components {
*/
"value": string;
}
/**
* @deprecated Use the `calcite-card`, `calcite-notice`, `calcite-panel`, or `calcite-tile` component instead.
*/
interface CalciteTip {
/**
* When `true`, the close button is not present on the component.
Expand Down Expand Up @@ -5428,12 +5437,18 @@ export namespace Components {
*/
"selected": boolean;
}
/**
* @deprecated Use the `calcite-carousel` and `calcite-carousel-item` components instead.
*/
interface CalciteTipGroup {
/**
* The component header text for all nested `calcite-tip`s.
*/
"groupTitle": string;
}
/**
* @deprecated Use the `calcite-carousel` and `calcite-carousel-item` components instead.
*/
interface CalciteTipManager {
/**
* When `true`, does not display or position the component.
Expand Down Expand Up @@ -5555,7 +5570,7 @@ export namespace Components {
"selectionMode": SelectionMode;
}
/**
* @deprecated Use the `list` component instead.
* @deprecated Use the `calcite-list` component instead.
*/
interface CalciteValueList {
/**
Expand Down Expand Up @@ -5631,7 +5646,7 @@ export namespace Components {
"setFocus": (focusId?: ListFocusId) => Promise<void>;
}
/**
* @deprecated Use the `list` component instead.
* @deprecated Use the `calcite-list` component instead.
*/
interface CalciteValueListItem {
/**
Expand Down Expand Up @@ -7026,7 +7041,7 @@ declare global {
"calciteListFilter": void;
}
/**
* @deprecated Use the `list` component instead.
* @deprecated Use the `calcite-list` component instead.
*/
interface HTMLCalcitePickListElement extends Components.CalcitePickList, HTMLStencilElement {
addEventListener<K extends keyof HTMLCalcitePickListElementEventMap>(type: K, listener: (this: HTMLCalcitePickListElement, ev: CalcitePickListCustomEvent<HTMLCalcitePickListElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
Expand All @@ -7043,7 +7058,7 @@ declare global {
new (): HTMLCalcitePickListElement;
};
/**
* @deprecated Use the `list` component instead.
* @deprecated Use the `calcite-list` component instead.
*/
interface HTMLCalcitePickListGroupElement extends Components.CalcitePickListGroup, HTMLStencilElement {
}
Expand All @@ -7066,7 +7081,7 @@ declare global {
};
}
/**
* @deprecated Use the `list` component instead.
* @deprecated Use the `calcite-list` component instead.
*/
interface HTMLCalcitePickListItemElement extends Components.CalcitePickListItem, HTMLStencilElement {
addEventListener<K extends keyof HTMLCalcitePickListItemElementEventMap>(type: K, listener: (this: HTMLCalcitePickListItemElement, ev: CalcitePickListItemCustomEvent<HTMLCalcitePickListItemElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
Expand Down Expand Up @@ -7555,6 +7570,9 @@ declare global {
interface HTMLCalciteTileSelectElementEventMap {
"calciteTileSelectChange": void;
}
/**
* @deprecated Use the `calcite-tile` component instead.
*/
interface HTMLCalciteTileSelectElement extends Components.CalciteTileSelect, HTMLStencilElement {
addEventListener<K extends keyof HTMLCalciteTileSelectElementEventMap>(type: K, listener: (this: HTMLCalciteTileSelectElement, ev: CalciteTileSelectCustomEvent<HTMLCalciteTileSelectElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
Expand All @@ -7569,6 +7587,9 @@ declare global {
prototype: HTMLCalciteTileSelectElement;
new (): HTMLCalciteTileSelectElement;
};
/**
* @deprecated Use the `calcite-tile-group` component instead.
*/
interface HTMLCalciteTileSelectGroupElement extends Components.CalciteTileSelectGroup, HTMLStencilElement {
}
var HTMLCalciteTileSelectGroupElement: {
Expand Down Expand Up @@ -7597,6 +7618,9 @@ declare global {
interface HTMLCalciteTipElementEventMap {
"calciteTipDismiss": void;
}
/**
* @deprecated Use the `calcite-card`, `calcite-notice`, `calcite-panel`, or `calcite-tile` component instead.
*/
interface HTMLCalciteTipElement extends Components.CalciteTip, HTMLStencilElement {
addEventListener<K extends keyof HTMLCalciteTipElementEventMap>(type: K, listener: (this: HTMLCalciteTipElement, ev: CalciteTipCustomEvent<HTMLCalciteTipElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
Expand All @@ -7611,6 +7635,9 @@ declare global {
prototype: HTMLCalciteTipElement;
new (): HTMLCalciteTipElement;
};
/**
* @deprecated Use the `calcite-carousel` and `calcite-carousel-item` components instead.
*/
interface HTMLCalciteTipGroupElement extends Components.CalciteTipGroup, HTMLStencilElement {
}
var HTMLCalciteTipGroupElement: {
Expand All @@ -7620,6 +7647,9 @@ declare global {
interface HTMLCalciteTipManagerElementEventMap {
"calciteTipManagerClose": void;
}
/**
* @deprecated Use the `calcite-carousel` and `calcite-carousel-item` components instead.
*/
interface HTMLCalciteTipManagerElement extends Components.CalciteTipManager, HTMLStencilElement {
addEventListener<K extends keyof HTMLCalciteTipManagerElementEventMap>(type: K, listener: (this: HTMLCalciteTipManagerElement, ev: CalciteTipManagerCustomEvent<HTMLCalciteTipManagerElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
Expand Down Expand Up @@ -7694,7 +7724,7 @@ declare global {
"calciteListFilter": void;
}
/**
* @deprecated Use the `list` component instead.
* @deprecated Use the `calcite-list` component instead.
*/
interface HTMLCalciteValueListElement extends Components.CalciteValueList, HTMLStencilElement {
addEventListener<K extends keyof HTMLCalciteValueListElementEventMap>(type: K, listener: (this: HTMLCalciteValueListElement, ev: CalciteValueListCustomEvent<HTMLCalciteValueListElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
Expand All @@ -7721,7 +7751,7 @@ declare global {
"calciteValueListItemDragHandleBlur": ListItemAndHandle;
}
/**
* @deprecated Use the `list` component instead.
* @deprecated Use the `calcite-list` component instead.
*/
interface HTMLCalciteValueListItemElement extends Components.CalciteValueListItem, HTMLStencilElement {
addEventListener<K extends keyof HTMLCalciteValueListItemElementEventMap>(type: K, listener: (this: HTMLCalciteValueListItemElement, ev: CalciteValueListItemCustomEvent<HTMLCalciteValueListItemElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
Expand Down Expand Up @@ -11540,7 +11570,7 @@ declare namespace LocalJSX {
"overlayPositioning"?: OverlayPositioning;
}
/**
* @deprecated Use the `list` component instead.
* @deprecated Use the `calcite-list` component instead.
*/
interface CalcitePickList {
/**
Expand Down Expand Up @@ -11595,7 +11625,7 @@ declare namespace LocalJSX {
"selectionFollowsFocus"?: boolean;
}
/**
* @deprecated Use the `list` component instead.
* @deprecated Use the `calcite-list` component instead.
*/
interface CalcitePickListGroup {
/**
Expand All @@ -11608,7 +11638,7 @@ declare namespace LocalJSX {
"headingLevel"?: HeadingLevel;
}
/**
* @deprecated Use the `list` component instead.
* @deprecated Use the `calcite-list` component instead.
*/
interface CalcitePickListItem {
/**
Expand Down Expand Up @@ -13221,6 +13251,9 @@ declare namespace LocalJSX {
SelectionMode
>;
}
/**
* @deprecated Use the `calcite-tile` component instead.
*/
interface CalciteTileSelect {
/**
* When `true`, the component is checked.
Expand Down Expand Up @@ -13275,6 +13308,9 @@ declare namespace LocalJSX {
*/
"width"?: Extract<"auto" | "full", Width>;
}
/**
* @deprecated Use the `calcite-tile-group` component instead.
*/
interface CalciteTileSelectGroup {
/**
* When `true`, interaction is prevented and the component is displayed with lower opacity.
Expand Down Expand Up @@ -13314,6 +13350,9 @@ declare namespace LocalJSX {
*/
"value"?: string;
}
/**
* @deprecated Use the `calcite-card`, `calcite-notice`, `calcite-panel`, or `calcite-tile` component instead.
*/
interface CalciteTip {
/**
* When `true`, the close button is not present on the component.
Expand Down Expand Up @@ -13348,12 +13387,18 @@ declare namespace LocalJSX {
*/
"selected"?: boolean;
}
/**
* @deprecated Use the `calcite-carousel` and `calcite-carousel-item` components instead.
*/
interface CalciteTipGroup {
/**
* The component header text for all nested `calcite-tip`s.
*/
"groupTitle"?: string;
}
/**
* @deprecated Use the `calcite-carousel` and `calcite-carousel-item` components instead.
*/
interface CalciteTipManager {
/**
* When `true`, does not display or position the component.
Expand Down Expand Up @@ -13487,7 +13532,7 @@ declare namespace LocalJSX {
"selectionMode"?: SelectionMode;
}
/**
* @deprecated Use the `list` component instead.
* @deprecated Use the `calcite-list` component instead.
*/
interface CalciteValueList {
/**
Expand Down Expand Up @@ -13566,7 +13611,7 @@ declare namespace LocalJSX {
"selectionFollowsFocus"?: boolean;
}
/**
* @deprecated Use the `list` component instead.
* @deprecated Use the `calcite-list` component instead.
*/
interface CalciteValueListItem {
/**
Expand Down Expand Up @@ -13813,15 +13858,15 @@ declare module "@stencil/core" {
"calcite-pagination": LocalJSX.CalcitePagination & JSXBase.HTMLAttributes<HTMLCalcitePaginationElement>;
"calcite-panel": LocalJSX.CalcitePanel & JSXBase.HTMLAttributes<HTMLCalcitePanelElement>;
/**
* @deprecated Use the `list` component instead.
* @deprecated Use the `calcite-list` component instead.
*/
"calcite-pick-list": LocalJSX.CalcitePickList & JSXBase.HTMLAttributes<HTMLCalcitePickListElement>;
/**
* @deprecated Use the `list` component instead.
* @deprecated Use the `calcite-list` component instead.
*/
"calcite-pick-list-group": LocalJSX.CalcitePickListGroup & JSXBase.HTMLAttributes<HTMLCalcitePickListGroupElement>;
/**
* @deprecated Use the `list` component instead.
* @deprecated Use the `calcite-list` component instead.
*/
"calcite-pick-list-item": LocalJSX.CalcitePickListItem & JSXBase.HTMLAttributes<HTMLCalcitePickListItemElement>;
"calcite-popover": LocalJSX.CalcitePopover & JSXBase.HTMLAttributes<HTMLCalcitePopoverElement>;
Expand Down Expand Up @@ -13855,21 +13900,36 @@ declare module "@stencil/core" {
"calcite-text-area": LocalJSX.CalciteTextArea & JSXBase.HTMLAttributes<HTMLCalciteTextAreaElement>;
"calcite-tile": LocalJSX.CalciteTile & JSXBase.HTMLAttributes<HTMLCalciteTileElement>;
"calcite-tile-group": LocalJSX.CalciteTileGroup & JSXBase.HTMLAttributes<HTMLCalciteTileGroupElement>;
/**
* @deprecated Use the `calcite-tile` component instead.
*/
"calcite-tile-select": LocalJSX.CalciteTileSelect & JSXBase.HTMLAttributes<HTMLCalciteTileSelectElement>;
/**
* @deprecated Use the `calcite-tile-group` component instead.
*/
"calcite-tile-select-group": LocalJSX.CalciteTileSelectGroup & JSXBase.HTMLAttributes<HTMLCalciteTileSelectGroupElement>;
"calcite-time-picker": LocalJSX.CalciteTimePicker & JSXBase.HTMLAttributes<HTMLCalciteTimePickerElement>;
/**
* @deprecated Use the `calcite-card`, `calcite-notice`, `calcite-panel`, or `calcite-tile` component instead.
*/
"calcite-tip": LocalJSX.CalciteTip & JSXBase.HTMLAttributes<HTMLCalciteTipElement>;
/**
* @deprecated Use the `calcite-carousel` and `calcite-carousel-item` components instead.
*/
"calcite-tip-group": LocalJSX.CalciteTipGroup & JSXBase.HTMLAttributes<HTMLCalciteTipGroupElement>;
/**
* @deprecated Use the `calcite-carousel` and `calcite-carousel-item` components instead.
*/
"calcite-tip-manager": LocalJSX.CalciteTipManager & JSXBase.HTMLAttributes<HTMLCalciteTipManagerElement>;
"calcite-tooltip": LocalJSX.CalciteTooltip & JSXBase.HTMLAttributes<HTMLCalciteTooltipElement>;
"calcite-tree": LocalJSX.CalciteTree & JSXBase.HTMLAttributes<HTMLCalciteTreeElement>;
"calcite-tree-item": LocalJSX.CalciteTreeItem & JSXBase.HTMLAttributes<HTMLCalciteTreeItemElement>;
/**
* @deprecated Use the `list` component instead.
* @deprecated Use the `calcite-list` component instead.
*/
"calcite-value-list": LocalJSX.CalciteValueList & JSXBase.HTMLAttributes<HTMLCalciteValueListElement>;
/**
* @deprecated Use the `list` component instead.
* @deprecated Use the `calcite-list` component instead.
*/
"calcite-value-list-item": LocalJSX.CalciteValueListItem & JSXBase.HTMLAttributes<HTMLCalciteValueListItemElement>;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ export const overflowContent_TestOnly = (): string =>
</calcite-flow>
</div>`;

export const withActionBar_TestOnly = (): string =>
export const withActionBarAndContentTop_TestOnly = (): string =>
html`<div style="width: 300px;">
<calcite-flow-item height-scale="s">
<calcite-action-bar slot="action-bar">
Expand All @@ -274,6 +274,7 @@ export const withActionBar_TestOnly = (): string =>
</calcite-action-group>
</calcite-action-bar>
<div slot="header-content">Header!</div>
<div slot="content-top">Content Top!</div>
<p>Slotted content!</p>
</calcite-flow-item>
</div>`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import { CSS, ICONS, SLOTS } from "./resources";
/**
* @slot - A slot for adding custom content.
* @slot action-bar - A slot for adding a `calcite-action-bar` to the component.
* @slot content-top - A slot for adding content above the unnamed (default) slot and below the action-bar slot (if populated).
* @slot header-actions-start - A slot for adding `calcite-action`s or content to the start side of the component's header.
* @slot header-actions-end - A slot for adding `calcite-action`s or content to the end side of the component's header.
* @slot header-content - A slot for adding custom content to the component's header.
Expand Down Expand Up @@ -385,6 +386,7 @@ export class FlowItem
<slot name={SLOTS.headerContent} slot={PANEL_SLOTS.headerContent} />
<slot name={SLOTS.headerMenuActions} slot={PANEL_SLOTS.headerMenuActions} />
<slot name={SLOTS.fab} slot={PANEL_SLOTS.fab} />
<slot name={SLOTS.contentTop} slot={PANEL_SLOTS.contentTop} />
<slot name={SLOTS.footerActions} slot={PANEL_SLOTS.footerActions} />
<slot name={SLOTS.footer} slot={PANEL_SLOTS.footer} />
<slot />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export const ICONS = {

export const SLOTS = {
actionBar: "action-bar",
contentTop: "content-top",
headerActionsStart: "header-actions-start",
headerActionsEnd: "header-actions-end",
headerMenuActions: "header-menu-actions",
Expand Down
3 changes: 3 additions & 0 deletions packages/calcite-components/src/demos/flow.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,15 @@
<div class="child">
<calcite-flow custom-item-selectors="custom-flow-item">
<calcite-flow-item heading="flow-item-1">
<div slot="content-top">Slot for a content-top.</div>
<img src="https://via.placeholder.com/250x250.png?text=calcite-flow-item" />
</calcite-flow-item>
<custom-flow-item heading="custom-flow-item">
<div slot="content-top">Slot for a content-top.</div>
<img src="https://via.placeholder.com/250x250.png?text=custom-flow-item" />
</custom-flow-item>
<calcite-flow-item heading="flow-item-2">
<div slot="content-top">Slot for a content-top.</div>
<img src="https://via.placeholder.com/250x250.png?text=calcite-panel" />
</calcite-flow-item>
</calcite-flow>
Expand Down
Loading