UNPKG

@gitlab/ui

Version:
88 lines (77 loc) 2.66 kB
import GlDeprecatedButton from '../button/button'; import GlIcon from '../icon/icon'; import { bannerVariants } from '../../../utils/constants'; import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js'; var script = { name: 'GlBanner', components: { GlDeprecatedButton: GlDeprecatedButton, GlIcon: GlIcon }, props: { title: { type: String, required: true }, buttonText: { type: String, required: true }, buttonLink: { type: String, required: true }, svgPath: { type: String, required: false, default: null }, variant: { type: String, required: false, default: bannerVariants[0], validator: function validator(value) { return bannerVariants.includes(value); } } }, computed: { isIntroducing: function isIntroducing() { return this.variant === bannerVariants[1]; } }, methods: { handleClose: function handleClose() { this.$emit('close'); } } }; /* 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('section',{staticClass:"gl-banner",class:{ 'gl-banner-introduction': _vm.isIntroducing }},[(_vm.svgPath)?_c('div',{staticClass:"gl-banner-illustration"},[_c('img',{attrs:{"src":_vm.svgPath,"alt":"","role":"presentation"}})]):_vm._e(),_vm._v(" "),_c('div',{staticClass:"gl-banner-content"},[_c('h1',{staticClass:"gl-banner-title"},[_vm._v(_vm._s(_vm.title))]),_vm._v(" "),_vm._t("default"),_vm._v(" "),_c('gl-deprecated-button',{attrs:{"variant":"info","href":_vm.buttonLink}},[_vm._v(_vm._s(_vm.buttonText))])],2),_vm._v(" "),_c('button',{staticClass:"gl-banner-close close",attrs:{"type":"button","aria-label":"Close"},on:{"click":_vm.handleClose}},[_c('gl-icon',{attrs:{"name":"close"}})],1)])}; 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__;