@dialpad/dialtone
Version:
Dialpad's Dialtone design system monorepo
51 lines (50 loc) • 1.33 kB
JavaScript
import { DtIconClose as c } from "@dialpad/dialtone-icons/vue3";
import { DialtoneLocalization as l } from "../localization/index.js";
import { resolveComponent as o, createBlock as s, openBlock as r, withKeys as i, withModifiers as a, withCtx as d, createVNode as m } from "vue";
import { _ } from "../_plugin-vue_export-helper-CHgC5LLL.js";
import u from "../lib/button/button.js";
const p = {
name: "SrOnlyCloseButton",
components: {
DtIconClose: c,
DtButton: u
},
emits: ["close"],
data() {
return {
i18n: new l()
};
},
computed: {
closeButtonTitle() {
return this.i18n.$t("DIALTONE_CLOSE_BUTTON");
}
},
methods: {
close() {
this.$emit("close");
}
}
};
function f(B, C, b, h, y, t) {
const e = o("dt-icon-close"), n = o("dt-button");
return r(), s(n, {
id: "sr-only-close-button",
"data-qa": "dt-sr-only-close-button",
class: "d-vi-visible-sr",
"aria-label": t.closeButtonTitle,
title: t.closeButtonTitle,
onClick: t.close,
onKeydown: i(a(t.close, ["prevent", "stop"]), ["space"])
}, {
default: d(() => [
m(e)
]),
_: 1
}, 8, ["aria-label", "title", "onClick", "onKeydown"]);
}
const x = /* @__PURE__ */ _(p, [["render", f]]);
export {
x as default
};
//# sourceMappingURL=sr_only_close_button.js.map