11import "./ak-empty-state.component.js" ;
22
3+ import type { ElementRest } from "../types.js" ;
34import { EmptyState } from "./ak-empty-state.component.js" ;
45
6+ import { spread } from "@open-wc/lit-helpers" ;
57import { match , P } from "ts-pattern" ;
68
79import { html , TemplateResult } from "lit" ;
@@ -18,9 +20,8 @@ export interface EmptyStateSlots {
1820 secondaryActions ?: string | TemplateResult ;
1921}
2022
21- export type EmptyStateProps = Partial <
22- Pick < EmptyState , "size" | "loading" | "textOnly" | "spinnerOnly" >
23- > &
23+ export type EmptyStateProps = ElementRest &
24+ Partial < Pick < EmptyState , "size" | "loading" | "textOnly" | "spinnerOnly" > > &
2425 EmptyStateSlots & { fullHeight ?: boolean } ;
2526
2627const SLOTNAMES : ( keyof EmptyStateSlots ) [ ] = [
@@ -46,7 +47,7 @@ type SlotContent = string | TemplateResult | undefined;
4647 *
4748 * @see {@link EmptyState } - The underlying web component
4849 */
49- export function akEmptyState ( options : EmptyStateProps ) {
50+ export function akEmptyState ( options : EmptyStateProps = { } ) {
5051 const slots = SLOTNAMES . filter ( ( s ) => ! ! options [ s ] ) ;
5152
5253 const slotRenderer = ( s : string , c : string | TemplateResult ) => html `< div slot =${ s } > ${ c } </ div > ` ;
@@ -68,10 +69,11 @@ export function akEmptyState(options: EmptyStateProps) {
6869 ...Object . fromEntries ( slots . map ( ( s ) => [ s , slotHandler ( s ) ] ) ) ,
6970 } ;
7071
71- const { size, fullHeight, spinnerOnly, textOnly, loading } = opts ;
72+ const { size, fullHeight, spinnerOnly, textOnly, loading, ... rest } = opts ;
7273
7374 return html `
7475 < ak-empty-state
76+ ${ spread ( rest ) }
7577 ?loading =${ loading }
7678 ?full-height =${ fullHeight }
7779 ?text-only=${ textOnly }
0 commit comments