@gitlab/ui
Version:
GitLab UI Components
81 lines (68 loc) • 2.27 kB
JavaScript
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
var script = {
props: {
title: {
type: String,
required: true
},
value: {
type: String,
required: true
},
variant: {
type: String,
required: false,
default: 'secondary',
validator: function validator(variant) {
return ['primary', 'secondary', 'success', 'warning', 'danger'].includes(variant);
}
}
},
computed: {
headerColor: function headerColor() {
return "bg-".concat(this.variant, "-100");
},
bodyColor: function bodyColor() {
return "bg-".concat(this.variant, "-50");
},
textColor: function textColor() {
switch (this.variant) {
case 'secondary':
return "text-".concat(this.variant, "-700");
case 'warning':
return "text-".concat(this.variant, "-600");
default:
return "text-".concat(this.variant, "-500");
}
}
}
};
/* script */
const __vue_script__ = script;
/* template */
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"card text-center font-weight-bold border-0",class:_vm.textColor},[_c('div',{staticClass:"card-header border-0",class:_vm.headerColor},[_vm._v("\n "+_vm._s(_vm.title)+"\n ")]),_vm._v(" "),_c('div',{staticClass:"card-body rounded-bottom text-truncate text-4",class:_vm.bodyColor},[_vm._t("icon"),_vm._v("\n "+_vm._s(_vm.value)+"\n ")],2)])};
var __vue_staticRenderFns__ = [];
/* style */
const __vue_inject_styles__ = undefined;
/* scoped */
const __vue_scope_id__ = undefined;
/* module identifier */
const __vue_module_identifier__ = undefined;
/* functional template */
const __vue_is_functional_template__ = false;
/* style inject */
/* style inject SSR */
/* style inject shadow dom */
const __vue_component__ = __vue_normalize__(
{ render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
__vue_inject_styles__,
__vue_script__,
__vue_scope_id__,
__vue_is_functional_template__,
__vue_module_identifier__,
false,
undefined,
undefined,
undefined
);
export default __vue_component__;