@dialpad/dialtone
Version:
Dialpad's Dialtone design system monorepo
113 lines (112 loc) • 3.27 kB
JavaScript
"use strict";
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
const split_button_constants = require("./split_button_constants.cjs");
const vue3 = require("@dialpad/dialtone-icons/vue3");
const common_utils = require("../../common/utils.cjs");
const vue = require("vue");
const _pluginVue_exportHelper = require("../../_virtual/_plugin-vue_export-helper.cjs");
const button = require("../button/button.vue.cjs");
const _sfc_main = {
compatConfig: { MODE: 3 },
name: "SplitButtonOmega",
components: {
DtButton: button.default,
DtIconChevronDown: vue3.DtIconChevronDown
},
props: {
/**
* Determines whether the button should have active styling
*/
active: {
type: Boolean,
default: false
},
/**
* Descriptive label for the button
*/
ariaLabel: {
type: String,
default: null
},
/**
* HTML button disabled attribute
*/
disabled: {
type: Boolean,
default: false
},
/**
* Element ID, useful in case you need to reference the button
* as an external anchor for popover
*/
id: {
type: String,
default: common_utils.getUniqueString()
},
/**
* The fill and outline of the button associated with its visual importance.
*/
importance: {
type: String,
default: "primary"
},
/**
* The color of the button.
*/
kind: {
type: String,
default: "default"
},
/**
* The size of the button.
*/
size: {
type: String,
default: "md"
},
/**
* Text shown in tooltip when you hover the button
*/
tooltipText: {
type: String,
default: ""
}
},
data() {
return {
SPLIT_BUTTON_ICON_SIZES: split_button_constants.SPLIT_BUTTON_ICON_SIZES
};
}
};
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
const _component_dt_icon_chevron_down = vue.resolveComponent("dt-icon-chevron-down");
const _component_dt_button = vue.resolveComponent("dt-button");
const _directive_dt_tooltip = vue.resolveDirective("dt-tooltip");
return vue.withDirectives((vue.openBlock(), vue.createBlock(_component_dt_button, {
id: $props.id,
"data-qa": "dt-split-button-omega",
active: $props.active,
"aria-label": $props.ariaLabel,
class: vue.normalizeClass(`d-split-btn__omega d-split-btn__omega--${$props.size}`),
disabled: $props.disabled,
importance: $props.importance,
kind: $props.kind,
size: $props.size
}, {
icon: vue.withCtx(() => [
vue.renderSlot(_ctx.$slots, "icon", {
size: $data.SPLIT_BUTTON_ICON_SIZES[$props.size]
}, () => [
vue.createVNode(_component_dt_icon_chevron_down, {
size: $data.SPLIT_BUTTON_ICON_SIZES[$props.size]
}, null, 8, ["size"])
])
]),
_: 3
}, 8, ["id", "active", "aria-label", "class", "disabled", "importance", "kind", "size"])), [
[_directive_dt_tooltip, $props.tooltipText]
]);
}
const SplitButtonOmega = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["render", _sfc_render]]);
exports.default = SplitButtonOmega;
//# sourceMappingURL=split_button-omega.vue.cjs.map