maz-ui
Version:
A standalone components library for Vue.Js 3 & Nuxt.Js 3
1 lines • 1.72 kB
JavaScript
import{t as _plugin_vue_export_helper_default}from"./_plugin-vue_export-helper.ChmETRGw.js";import{computed,createElementBlock,createElementVNode,defineComponent,normalizeClass,normalizeStyle,openBlock,toDisplayString}from"vue";import{useTranslations}from"@maz-ui/translations/composables/useTranslations";import '../assets/MazSkeleton.B9lgsFeg.css';var _hoisted_1=[`aria-label`];var _hoisted_2={class:`maz-sr-only`};var MazSkeleton_default=_plugin_vue_export_helper_default(defineComponent({__name:`MazSkeleton`,props:{shape:{default:`rectangle`},size:{default:`1rem`},width:{},height:{},animated:{type:Boolean,default:!0},roundedSize:{default:`base`},ariaLabel:{},loadingText:{}},setup(__props){let{t}=useTranslations();let ariaLabelValue=computed(()=>__props.ariaLabel||t(`skeleton.ariaLabel`));let loadingTextValue=computed(()=>__props.loadingText||t(`skeleton.loadingText`));let customStyles=computed(()=>{let styles={};if(__props.shape)switch(__props.shape){case`circle`:case`square`:styles.width=__props.size??__props.width,styles.height=__props.size??__props.height;break;case`rectangle`:styles.height=__props.height??__props.size,styles.width=__props.width??`100%`;break}return styles});return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,{class:normalizeClass([`m-skeleton m-reset-css`,[__props.shape&&`m-skeleton--${__props.shape}`,`m-skeleton--rounded-${__props.roundedSize}`,{"m-skeleton--animated":__props.animated}]]),style:normalizeStyle(customStyles.value),"aria-label":ariaLabelValue.value,role:`status`,"aria-live":`polite`},[createElementVNode(`span`,_hoisted_2,toDisplayString(loadingTextValue.value),1)],14,_hoisted_1))}}),[[`__scopeId`,`data-v-22e2cdb8`]]);export{MazSkeleton_default as t};