@wikimedia/codex
Version:
Codex Design System for Wikimedia
2 lines (1 loc) • 4.95 kB
JavaScript
;const t=require("vue"),v=require("./useComputedDirection.cjs"),M=require("./useComputedLanguage.cjs"),p=require("./constants.js"),m=require("./_plugin-vue_export-helper.js"),g='<path d="M19.765 16.059 18 19H2L.235 16.059l8-15h3.53zM9 14v2h2v-2zm0-8v6h2V6z"/>',z='<path d="M18 19H2V1h16zM4 17h11.586l-3.922-3.922a3.5 3.5 0 111.414-1.414L16 14.586V3H4zm6-8.5a1.5 1.5 0 100 3 1.5 1.5 0 000-3"/>',f='<path d="M18.154 3.837 8.034 16.62l-1.384.18-4.8-3.6 1.2-1.6 4.02 3.015 9.517-12.02z"/>',L='<path d="M14.243 7.172 11.413 10l2.828 2.83-1.414 1.413L10 11.415l-2.827 2.827-1.414-1.414L8.585 10 5.757 7.172l1.415-1.414 2.827 2.828 2.83-2.828z"/><path d="M10 1a9 9 0 110 18 9 9 0 010-18m0 2a7 7 0 100 14 7 7 0 000-14"/>',V='<path d="M16.707 4.707 11.414 10l5.293 5.293-1.414 1.414L10 11.414l-5.293 5.293-1.414-1.414L8.586 10 3.293 4.707l1.414-1.414L10 8.586l5.293-5.293z"/>',C='<path d="M14 7H6v2.5l4 3.5 4-3.5z"/>',y='<path d="M19 6.4v7.199L13.6 19H6.4L1 13.599v-7.2L6.4 1h7.2zM9 14v2h2v-2zm0-9v7h2V5z"/>',H='<path d="m16.707 8.017-6 5.983H9.293l-6-5.983 1.414-1.414L10 11.896l5.293-5.293z"/>',k='<path d="M15 15H5l3.5-4 2 2L15 8zM6.25 5a1.25 1.25 0 110 2.5 1.25 1.25 0 010-2.5"/><path d="M19 19H1V1h18zM3 17h14V3H3z"/>',S='<path d="M19 19H1V1h18zm-8.5-6-2-2L5 15h10V8zM6.25 5a1.25 1.25 0 100 2.5 1.25 1.25 0 000-2.5"/>',_='<path d="M13 20H7v-2h6zM10 0c1.938 0 3.58.556 4.745 1.644C15.918 2.738 16.5 4.27 16.5 6c0 2.22-1.15 3.732-2.04 4.727-.644.72-.96 1.633-.96 2.662V16h-7v-2.611c0-1.029-.317-1.942-.96-2.662C4.65 9.732 3.5 8.22 3.5 6c0-1.627.593-3.145 1.743-4.255C6.395.634 8.032 0 10 0"/>',B='<path d="M10 1a9 9 0 110 18 9 9 0 010-18M8 9v2h1v2H8v2h4v-2h-1V9zm1-4v2h2V5z"/>',F='<path d="M6 17H4V3h2zM16.417 4.707 11.124 10l5.293 5.293-1.414 1.414-6-6V9.293l6-6z"/>',E='<path d="M16 17h-2V3h2zm-5-7.707v1.414l-5.993 6-1.414-1.414L8.886 10 3.593 4.707l1.414-1.414z"/>',x='<path d="M14 9.293v1.414l-5.982 6-1.415-1.414L11.896 10 6.603 4.707l1.414-1.414z"/>',q='<path d="M13.417 4.707 8.124 10l5.293 5.293-1.414 1.414-6-6V9.293l6-6z"/>',A='<path d="M8 1a7 7 0 015.605 11.191l5.102 5.102-1.414 1.414-5.102-5.102A7 7 0 118 1m0 2a5 5 0 100 10A5 5 0 008 3"/>',w='<path d="M14 14.5 10 18l-4-3.5V12h8zm0-9V8H6V5.5L10 2z"/>',I='<path d="M10 1a9 9 0 110 18 9 9 0 010-18M8.823 11.118 6.8 9.6l-1.2 1.6 2.8 2.1 1.381-.175 4.624-5.781-1.561-1.25z"/>',b='<path d="M14 13H6v-2.5L10 7l4 3.5z"/>',$=g,D=z,O=f,Y=L,j=V,P=C,T=y,G=H,J=k,R=S,N={langCodeMap:{ar:_},default:B},Q={ltr:F,shouldFlip:!0},U={ltr:E,shouldFlip:!0},W={ltr:x,shouldFlip:!0},X={ltr:q,shouldFlip:!0},K=A,Z=w,e1=I,t1=b;function n1(e,n,o){if(typeof e=="string"||"path"in e)return e;if("shouldFlip"in e)return e.ltr;if("rtl"in e)return o==="rtl"?e.rtl:e.ltr;const a=n in e.langCodeMap?e.langCodeMap[n]:e.default;return typeof a=="string"||"path"in a?a:a.ltr}function o1(e,n){if(typeof e=="string")return!1;if("langCodeMap"in e){const o=n in e.langCodeMap?e.langCodeMap[n]:e.default;if(typeof o=="string")return!1;e=o}if("shouldFlipExceptions"in e&&Array.isArray(e.shouldFlipExceptions)){const o=e.shouldFlipExceptions.indexOf(n);return o===void 0||o===-1}return"shouldFlip"in e?e.shouldFlip:!1}const l1=p.makeStringTypeValidator(p.IconSizes),a1=t.defineComponent({name:"CdxIcon",props:{icon:{type:[String,Object],required:!0},iconLabel:{type:String,default:""},lang:{type:String,default:null},dir:{type:String,default:null},size:{type:String,default:"medium",validator:l1}},setup(e){const n=t.ref(),o=v(n),a=M(n),d=t.computed(()=>{var l;return(l=e.dir)!=null?l:o.value}),i=t.computed(()=>{var l;return(l=e.lang)!=null?l:a.value}),s=t.computed(()=>({"cdx-icon--flipped":d.value==="rtl"&&i.value!==null&&o1(e.icon,i.value),["cdx-icon--".concat(e.size)]:!0})),r=t.computed(()=>{var l,c;return n1(e.icon,(l=i.value)!=null?l:"",(c=d.value)!=null?c:"ltr")}),u=t.computed(()=>typeof r.value=="string"?r.value:""),h=t.computed(()=>typeof r.value!="string"?r.value.path:"");return{rootElement:n,rootClasses:s,iconSvg:u,iconPath:h}}}),i1=["aria-hidden"],r1={key:0},d1=["innerHTML"],c1=["d"];function p1(e,n,o,a,d,i){return t.openBlock(),t.createElementBlock("span",{ref:"rootElement",class:t.normalizeClass(["cdx-icon",e.rootClasses])},[(t.openBlock(),t.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20","aria-hidden":e.iconLabel?void 0:!0},[e.iconLabel?(t.openBlock(),t.createElementBlock("title",r1,t.toDisplayString(e.iconLabel),1)):t.createCommentVNode("v-if",!0),e.iconSvg?(t.openBlock(),t.createElementBlock("g",{key:1,innerHTML:e.iconSvg},null,8,d1)):(t.openBlock(),t.createElementBlock("path",{key:2,d:e.iconPath},null,8,c1))],8,i1))],2)}const s1=m._export_sfc(a1,[["render",p1]]);exports.A3=D;exports.CdxIcon=s1;exports.F8=X;exports.G8=K;exports.J3=O;exports.M8=W;exports.O7=J;exports.Y7=R;exports.Y9=t1;exports._3=j;exports.d7=P;exports.g7=G;exports.j3=Y;exports.l8=Q;exports.m7=T;exports.o6=N;exports.p9=e1;exports.s8=U;exports.t9=Z;exports.v3=$;