|
|
|
|
@ -110,7 +110,7 @@ export class DialogRootState {
|
|
|
|
|
this.opts.open.current = false;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
getBitsAttr: typeof dialogAttrs.getAttr = (part) => {
|
|
|
|
|
getTerraAttr: typeof dialogAttrs.getAttr = (part) => {
|
|
|
|
|
return dialogAttrs.getAttr(part, this.opts.variant.current);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
@ -171,7 +171,7 @@ export class DialogTriggerState {
|
|
|
|
|
"aria-haspopup": "dialog",
|
|
|
|
|
"aria-expanded": boolToStr(this.root.opts.open.current),
|
|
|
|
|
"aria-controls": this.root.contentId,
|
|
|
|
|
[this.root.getBitsAttr("trigger")]: "",
|
|
|
|
|
[this.root.getTerraAttr("trigger")]: "",
|
|
|
|
|
onkeydown: this.onkeydown,
|
|
|
|
|
onclick: this.onclick,
|
|
|
|
|
disabled: boolToTrueOrUndef(this.opts.disabled.current),
|
|
|
|
|
@ -218,7 +218,7 @@ export class DialogCloseState {
|
|
|
|
|
() =>
|
|
|
|
|
({
|
|
|
|
|
id: this.opts.id.current,
|
|
|
|
|
[this.root.getBitsAttr(this.opts.variant.current)]: "",
|
|
|
|
|
[this.root.getTerraAttr(this.opts.variant.current)]: "",
|
|
|
|
|
onclick: this.onclick,
|
|
|
|
|
onkeydown: this.onkeydown,
|
|
|
|
|
disabled: boolToTrueOrUndef(this.opts.disabled.current),
|
|
|
|
|
@ -250,7 +250,7 @@ export class DialogActionState {
|
|
|
|
|
() =>
|
|
|
|
|
({
|
|
|
|
|
id: this.opts.id.current,
|
|
|
|
|
[this.root.getBitsAttr("action")]: "",
|
|
|
|
|
[this.root.getTerraAttr("action")]: "",
|
|
|
|
|
...this.root.sharedProps,
|
|
|
|
|
...this.attachment,
|
|
|
|
|
}) as const
|
|
|
|
|
@ -286,7 +286,7 @@ export class DialogTitleState {
|
|
|
|
|
id: this.opts.id.current,
|
|
|
|
|
role: "heading",
|
|
|
|
|
"aria-level": this.opts.level.current,
|
|
|
|
|
[this.root.getBitsAttr("title")]: "",
|
|
|
|
|
[this.root.getTerraAttr("title")]: "",
|
|
|
|
|
...this.root.sharedProps,
|
|
|
|
|
...this.attachment,
|
|
|
|
|
}) as const
|
|
|
|
|
@ -320,7 +320,7 @@ export class DialogDescriptionState {
|
|
|
|
|
() =>
|
|
|
|
|
({
|
|
|
|
|
id: this.opts.id.current,
|
|
|
|
|
[this.root.getBitsAttr("description")]: "",
|
|
|
|
|
[this.root.getTerraAttr("description")]: "",
|
|
|
|
|
...this.root.sharedProps,
|
|
|
|
|
...this.attachment,
|
|
|
|
|
}) as const
|
|
|
|
|
@ -357,7 +357,7 @@ export class DialogContentState {
|
|
|
|
|
"aria-modal": "true",
|
|
|
|
|
"aria-describedby": this.root.descriptionId,
|
|
|
|
|
"aria-labelledby": this.root.titleId,
|
|
|
|
|
[this.root.getBitsAttr("content")]: "",
|
|
|
|
|
[this.root.getTerraAttr("content")]: "",
|
|
|
|
|
style: {
|
|
|
|
|
pointerEvents: "auto",
|
|
|
|
|
outline: this.root.opts.variant.current === "alert-dialog" ? "none" : undefined,
|
|
|
|
|
@ -401,7 +401,7 @@ export class DialogOverlayState {
|
|
|
|
|
() =>
|
|
|
|
|
({
|
|
|
|
|
id: this.opts.id.current,
|
|
|
|
|
[this.root.getBitsAttr("overlay")]: "",
|
|
|
|
|
[this.root.getTerraAttr("overlay")]: "",
|
|
|
|
|
style: {
|
|
|
|
|
pointerEvents: "auto",
|
|
|
|
|
"--terra-dialog-depth": this.root.depth,
|
|
|
|
|
@ -456,7 +456,7 @@ export class AlertDialogCance$state {
|
|
|
|
|
() =>
|
|
|
|
|
({
|
|
|
|
|
id: this.opts.id.current,
|
|
|
|
|
[this.root.getBitsAttr("cancel")]: "",
|
|
|
|
|
[this.root.getTerraAttr("cancel")]: "",
|
|
|
|
|
onclick: this.onclick,
|
|
|
|
|
onkeydown: this.onkeydown,
|
|
|
|
|
tabindex: 0,
|
|
|
|
|
|