vue-uswds
Version:
Vue 3 implementation of the USWDS (U.S. Web Design System) component library
3 lines (2 loc) • 1.91 kB
JavaScript
(function(s,r){typeof exports=="object"&&typeof module<"u"?module.exports=r(require("vue")):typeof define=="function"&&define.amd?define(["vue"],r):(s=typeof globalThis<"u"?globalThis:s||self,s.VueUswds=r(s.Vue))})(this,function(s){"use strict";const r="1.14.0";var p=g,v=/[\s\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,\-.\/:;<=>?@\[\]^_`{|}~]+/,l=/[A-ZÀ-Ý\u00C0-\u00D6\u00D9-\u00DD][a-zà-ÿ]/g,f=/[A-ZÀ-Ý\u00C0-\u00D6\u00D9-\u00DD]+/g;function g(e){return e=e.replace(l,function(t){return" "+(t[0].toLowerCase()||t[0])+t[1]}),e=e.replace(f,function(t){return" "+t.toLowerCase()}),e.trim().split(v).join("-").replace(/^-/,"").replace(/-\s*$/,"")}const n=e=>p(e),m=":",P="grid-",N="u-",E="/assets/img",w="/assets/img/sprite.svg",_=null,A="64em",C="30em",U="vuswds-id-",u={};function I(e=""){var a,c,d;const t=s.getCurrentInstance(),i=(d=(c=(a=t==null?void 0:t.appContext)==null?void 0:a.config)==null?void 0:c.globalProperties)==null?void 0:d.$route,o=i!=null&&i.path&&n(i.path)?n(i.path):"global";return u[o]||(u[o]=0),`${U}${o}-${n(e)}-${++u[o]}`}return{install:(e,t)=>{const o={prefixSeparator:m,gridNamespace:P,utilityNamespace:N,imagePath:E,svgSpritePath:w,routerComponentName:_,mobileMenuBreakpoint:A,footerNavBigBreakpoint:C,...t??{},version:r};e.config.globalProperties.$vueUswds||(e.config.globalProperties.$vueUswds=o),e.provide("vueUswds.prefixSeparator",o.prefixSeparator),e.provide("vueUswds.gridNamespace",o.gridNamespace),e.provide("vueUswds.utilityNamespace",o.utilityNamespace),e.provide("vueUswds.imagePath",o.imagePath),e.provide("vueUswds.svgSpritePath",o.svgSpritePath),e.provide("vueUswds.routerComponentName",o.routerComponentName),e.provide("vueUswds.mobileMenuBreakpoint",o.mobileMenuBreakpoint),e.provide("vueUswds.footerNavBigBreakpoint",o.footerNavBigBreakpoint),e.provide("vueUswds.version",o.version),e.provide("nextId",I)}}});
//# sourceMappingURL=vue-uswds.core.umd.js.map