UNPKG

@dialpad/dialtone

Version:

Dialpad's Dialtone design system monorepo

50 lines (49 loc) 1.57 kB
import { DtIconClose } from "@dialpad/dialtone-icons/vue3"; import { resolveComponent, openBlock, createBlock, withKeys, withModifiers, withCtx, createVNode } from "vue"; import _export_sfc from "../_virtual/_plugin-vue_export-helper.js"; import DtButton from "../components/button/button.vue.js"; const _sfc_main = { name: "SrOnlyCloseButton", components: { DtIconClose, DtButton }, props: { /** * Label for the visually hidden close button * Required if visuallyHiddenClose is set to `true` */ visuallyHiddenCloseLabel: { type: String, default: null } }, emits: ["close"], methods: { close() { this.$emit("close"); } } }; function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) { const _component_dt_icon_close = resolveComponent("dt-icon-close"); const _component_dt_button = resolveComponent("dt-button"); return openBlock(), createBlock(_component_dt_button, { id: "sr-only-close-button", "data-qa": "dt-sr-only-close-button", class: "d-vi-visible-sr", "aria-label": $props.visuallyHiddenCloseLabel, onClick: $options.close, onKeydown: withKeys(withModifiers($options.close, ["prevent", "stop"]), ["space"]) }, { default: withCtx(() => [ createVNode(_component_dt_icon_close) ]), _: 1 }, 8, ["aria-label", "onClick", "onKeydown"]); } const SrOnlyCloseButton = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]); export { SrOnlyCloseButton as default }; //# sourceMappingURL=sr_only_close_button.vue.js.map