UNPKG

@dialpad/dialtone

Version:

Dialpad's Dialtone design system monorepo

49 lines (48 loc) 1.97 kB
"use strict"; Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } }); const presence_constants = require("./presence_constants.cjs"); const _pluginVue2_normalizer = require("../../_virtual/_plugin-vue2_normalizer.cjs"); const _sfc_main = { name: "DtPresence", props: { /** * Determines the color of the inner presence circle, indicating status. * Accepts one of 4 values: 'busy', 'away', 'active', 'offline' * @values busy, away, active, offline */ presence: { type: String, default: presence_constants.PRESENCE_STATES.ACTIVE, validator: (role) => { return presence_constants.PRESENCE_STATES_LIST.includes(role); } }, /** * Since Presence is a visual element, we need SRs to read out any state changes * that occur. * Text entered here will be read by assistive technology. If null this component will be ignored by AT. */ srText: { type: String, default: null } } }; var _sfc_render = function render() { var _vm = this, _c = _vm._self._c; return _c("div", { staticClass: "d-presence", attrs: { "data-qa": "dt-presence", "role": "status", "aria-live": _vm.$attrs.ariaLive || "off" } }, [_vm.srText ? _c("span", { staticClass: "sr-only", attrs: { "data-qa": "dt-presence-sr-text" } }, [_vm._v(_vm._s(_vm.srText) + " ")]) : _vm._e(), _c("div", { staticClass: "d-presence__inner", class: { "d-presence__inner--active": _vm.presence === "active", "d-presence__inner--away": _vm.presence === "away", "d-presence__inner--busy": _vm.presence === "busy", "d-presence__inner--offline": _vm.presence === "offline" } })]); }; var _sfc_staticRenderFns = []; var __component__ = /* @__PURE__ */ _pluginVue2_normalizer.default( _sfc_main, _sfc_render, _sfc_staticRenderFns ); const DtPresence = __component__.exports; exports.default = DtPresence; //# sourceMappingURL=presence.vue.cjs.map