@dialpad/dialtone
Version:
Dialpad's Dialtone design system monorepo
82 lines (81 loc) • 1.88 kB
JavaScript
import { t as e } from "../../_plugin-vue_export-helper-BTgDAbhb.js";
import { SKELETON_HEADING_HEIGHTS as t, SKELETON_TEXT_TYPES as n } from "./skeleton-constants.js";
import r from "../../common/mixins/skeleton.js";
import { createCommentVNode as i, createElementBlock as a, normalizeClass as o, normalizeStyle as s, openBlock as c } from "vue";
//#region components/skeleton/skeleton-text.vue
var l = {
compatConfig: { MODE: 3 },
name: "DtSkeletonText",
mixins: [r],
props: {
type: {
type: String,
default: "body",
validator: (e) => n.includes(e)
},
headingHeight: {
type: String,
default: "md",
validator: (e) => Object.keys(t).includes(e)
},
width: {
type: String,
default: "100%"
},
animationDuration: {
type: Number,
default: -1
},
animate: {
type: Boolean,
default: !1
},
offset: {
type: Number,
default: 1
},
contentClass: {
type: String,
default: ""
}
},
data() {
return { SKELETON_HEADING_HEIGHTS: t };
}
};
function u(e, t, n, r, l, u) {
return n.type === "body" ? (c(), a("div", {
key: 0,
ref: "skeleton",
"data-qa": "skeleton-text-body",
class: o([
"d-skeleton-text",
"d-skeleton-placeholder",
{ "d-skeleton-placeholder--animate": n.animate },
n.contentClass
]),
style: s({
width: n.width,
...e.skeletonStyle
})
}, null, 6)) : n.type === "heading" ? (c(), a("div", {
key: 1,
ref: "skeleton",
"data-qa": "skeleton-text-heading",
class: o([
l.SKELETON_HEADING_HEIGHTS[n.headingHeight],
"d-skeleton-text--heading",
"d-skeleton-placeholder",
{ "d-skeleton-placeholder--animate": n.animate },
n.contentClass
]),
style: s({
width: n.width,
...e.skeletonStyle
})
}, null, 6)) : i("", !0);
}
var d = /* @__PURE__ */ e(l, [["render", u]]);
//#endregion
export { d as default };
//# sourceMappingURL=skeleton-text.js.map