Skip to content

Commit

Permalink
feat(hiccup-html): add/update block elements
Browse files Browse the repository at this point in the history
- add: details(), dialog(), summary()
- update template(), add TemplateAttribs
  • Loading branch information
postspectacular committed Jul 8, 2024
1 parent 00e848f commit 08f1728
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions packages/hiccup-html/src/blocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,26 @@ export interface BlockquoteAttribs extends Attribs {

export const blockquote = defElement<Partial<BlockquoteAttribs>>("blockquote");

export const [div, figure, figcaption, para, pre, template] = defElements([
export interface DetailAttribs extends Attribs {
open: boolean;
name: StringAttrib;
}

export const details = defElement<Partial<DetailAttribs>>("details");

export interface DialogAttribs extends Attribs {
open: boolean;
}

export const dialog = defElement<Partial<DialogAttribs>>("dialog");

export const [div, figure, figcaption, para, pre, summary] = defElements([
"div",
"figure",
"figcaption",
"p",
"pre",
"template",
"summary",
]);

export const hr = defElement<Partial<Attribs>, never>("hr");
Expand Down Expand Up @@ -68,3 +81,11 @@ export interface SlotAttribs extends Attribs {
}

export const slot = defElement<Partial<SlotAttribs>>("slot");

export interface TemplateAttribs extends Attribs {
shadowrootmode: AttribVal<"open" | "closed">;
shadowrootclonable: BooleanAttrib;
shadowrootdelegatesfocus: BooleanAttrib;
}

export const template = defElement<Partial<TemplateAttribs>>("template");

0 comments on commit 08f1728

Please sign in to comment.