@dialpad/dialtone
Version:
Dialpad's Dialtone design system monorepo
132 lines (131 loc) • 3.41 kB
JavaScript
import { resolveComponent, resolveDirective, withDirectives, openBlock, createBlock, normalizeClass, withCtx, renderSlot } from "vue";
import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
import DtButton from "../button/button.vue.js";
import { BUTTON_ICON_SIZES } from "../button/button_constants.js";
const _sfc_main = {
compatConfig: { MODE: 3 },
name: "SplitButtonAlpha",
components: {
DtButton
},
props: {
/**
* Determines whether the button should have active styling
*/
active: {
type: Boolean,
default: false
},
/**
* Descriptive label for the button
*/
ariaLabel: {
type: String,
default: null
},
/**
* The position of the icon slot within the button.
*/
iconPosition: {
type: String,
default: "left"
},
/**
* Used to customize the label container
*/
labelClass: {
type: [String, Array, Object],
default: ""
},
/**
* Whether the button should display a loading animation or not.
*/
loading: {
type: Boolean,
default: false
},
/**
* Text shown in tooltip when you hover the button
*/
tooltipText: {
type: String,
default: ""
},
/**
* Determines whether a screenreader reads live updates of
* the button content to the user while the button is in focus.
*/
assertiveOnFocus: {
type: Boolean,
default: false
},
/**
* HTML button disabled attribute
*/
disabled: {
type: Boolean,
default: false
},
/**
* 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"
}
},
data() {
return {
BUTTON_ICON_SIZES
};
}
};
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
const _component_dt_button = resolveComponent("dt-button");
const _directive_dt_tooltip = resolveDirective("dt-tooltip");
return withDirectives((openBlock(), createBlock(_component_dt_button, {
"data-qa": "dt-split-button-alpha",
active: $props.active,
"aria-label": $props.ariaLabel,
"assertive-on-focus": $props.assertiveOnFocus,
class: normalizeClass(`d-split-btn__alpha d-split-btn__alpha--${$props.size}`),
disabled: $props.disabled,
"icon-position": $props.iconPosition,
importance: $props.importance,
kind: $props.kind,
"label-class": $props.labelClass,
loading: $props.loading,
size: $props.size
}, {
icon: withCtx(() => [
renderSlot(_ctx.$slots, "icon", {
size: $data.BUTTON_ICON_SIZES[$props.size]
})
]),
default: withCtx(() => [
renderSlot(_ctx.$slots, "default")
]),
_: 3
}, 8, ["active", "aria-label", "assertive-on-focus", "class", "disabled", "icon-position", "importance", "kind", "label-class", "loading", "size"])), [
[_directive_dt_tooltip, $props.tooltipText]
]);
}
const SplitButtonAlpha = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
export {
SplitButtonAlpha as default
};
//# sourceMappingURL=split_button-alpha.vue.js.map