@accretion_ui/core 0.1.2 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as t,HTMLElement as e,h as o,transformTag as n}from"@stencil/core/internal/client";export{getAssetPath,render,setAssetPath,setNonce,setPlatformOptions}from"@stencil/core/internal/client";const r=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow()}variant="primary";disabled=!1;render(){return o("button",{key:"c7fa4931dabe49cfe39db12ef635c40dc810e824",class:"button button--"+this.variant,disabled:this.disabled,type:"button"},o("slot",{key:"e07fe75c0dd94de71991918ccf6656cf6b403e4f"}))}static get style(){return":host{display:inline-block}.button{align-items:center;border:0;border-radius:8px;cursor:pointer;display:inline-flex;font:inherit;gap:0.5rem;justify-content:center;min-height:2.75rem;min-width:2.75rem;padding:0.625rem 1rem;transition:background-color 150ms ease, color 150ms ease, opacity 150ms ease}.button:focus-visible{outline:2px solid #0a85a1;outline-offset:2px}.button--primary{background:#0a85a1;color:#ffffff}.button--primary:hover{background:#02657c}.button--secondary{background:#e7ecf0;color:#191b1d}.button--secondary:hover{background:#d9dfe5}.button:disabled{cursor:not-allowed;opacity:0.5}"}},[769,"accretion-button",{variant:[1],disabled:[4]}]),s=r,i=function(){"undefined"!=typeof customElements&&["accretion-button"].forEach((t=>{"accretion-button"===t&&(customElements.get(n(t))||customElements.define(n(t),r))}))};export{s as AccretionButton,i as defineCustomElement,i as defineCustomElementAccretionButton}
|
|
1
|
+
function t(t,e,n){const o="undefined"!=typeof HTMLElement?HTMLElement.prototype:null;for(;t&&t!==o;){const o=Object.getOwnPropertyDescriptor(t,e);if(o&&(!n||o.get))return o;t=Object.getPrototypeOf(t)}}var e,n=(e,n)=>{var o;Object.entries(null!=(o=n.o.t)?o:{}).map((([o,[l]])=>{if(31&l||32&l){const l=e[o],s=t(Object.getPrototypeOf(e),o,!0)||Object.getOwnPropertyDescriptor(e,o);s&&Object.defineProperty(e,o,{get(){return s.get.call(this)},set(t){s.set.call(this,t)},configurable:!0,enumerable:!0}),n.l.has(o)?e[o]=n.l.get(o):void 0!==l&&(e[o]=l)}}))},o=t=>{if(t.__stencil__getHostRef)return t.__stencil__getHostRef()},l=(t,e)=>(0,console.error)(t,e),s=new Map,i="undefined"!=typeof window?window:{},r=i.HTMLElement||class{},c={i:0,u:"",jmp:t=>t(),raf:t=>requestAnimationFrame(t),ael:(t,e,n,o)=>t.addEventListener(e,n,o),rel:(t,e,n,o)=>t.removeEventListener(e,n,o),ce:(t,e)=>new CustomEvent(t,e)},u=(()=>{try{return!!i.document.adoptedStyleSheets&&(new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync)}catch(t){}return!1})(),a=!!u&&(()=>!!i.document&&Object.getOwnPropertyDescriptor(i.document.adoptedStyleSheets,"length").writable)(),f=!1,d=[],p=[],b=(t,e)=>n=>{t.push(n),f||(f=!0,e&&4&c.i?y(m):c.raf(m))},h=t=>{for(let e=0;e<t.length;e++)try{t[e](performance.now())}catch(t){l(t)}t.length=0},m=()=>{h(d),h(p),(f=d.length>0)&&c.raf(m)},y=t=>Promise.resolve(void 0).then(t),v=b(p,!0),$=t=>{const e=new URL(t,c.u);return e.origin!==i.location.origin?e.href:e.pathname},g=t=>c.u=t;function w(){const t=this.attachShadow({mode:"open"});void 0===e&&(e=null),e&&(a?t.adoptedStyleSheets.push(e):t.adoptedStyleSheets=[...t.adoptedStyleSheets,e])}var j,O=new WeakMap,k=t=>"sc-"+t.p,S=t=>"object"==(t=typeof t)||"function"===t,E=(t,e,...n)=>{let o=null,l=null,s=!1,i=!1;const r=[],c=e=>{for(let n=0;n<e.length;n++)o=e[n],Array.isArray(o)?c(o):null!=o&&"boolean"!=typeof o&&((s="function"!=typeof t&&!S(o))&&(o+=""),s&&i?r[r.length-1].h+=o:r.push(s?M(null,o):o),i=s)};if(c(n),e){e.key&&(l=e.key);{const t=e.className||e.class;t&&(e.class="object"!=typeof t?t:Object.keys(t).filter((e=>t[e])).join(" "))}}const u=M(t,null);return u.m=e,r.length>0&&(u.v=r),u.$=l,u},M=(t,e)=>({i:0,j:t,h:null!=e?e:null,O:null,v:null,m:null,$:null}),x={},A=(t,e)=>null==t||S(t)?t:4&e?"false"!==t&&(""===t||!!t):1&e?t+"":t,C=(t,e,n,l,s,i)=>{if(n===l)return;let r=((t,e)=>e in t)(t,e);if(e.toLowerCase(),"class"===e){const e=t.classList,o=_(n);let s=_(l);e.remove(...o.filter((t=>t&&!s.includes(t)))),e.add(...s.filter((t=>t&&!o.includes(t))))}else if("key"===e);else{if("a"===e[0]&&e.startsWith("attr:")){const n=e.slice(5);let s;{const e=o(t);if(e&&e.o&&e.o.t){const t=e.o.t[n];t&&t[1]&&(s=t[1])}}return s||(s=n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()),void(null==l||!1===l?!1===l&&""!==t.getAttribute(s)||t.removeAttribute(s):t.setAttribute(s,!0===l?"":l))}if("p"===e[0]&&e.startsWith("prop:")){const n=e.slice(5);try{t[n]=l}catch(t){}return}{const o=S(l);if((r||o&&null!==l)&&!s)try{if(t.tagName.includes("-"))t[e]!==l&&(t[e]=l);else{const o=null==l?"":l;"list"===e?r=!1:null!=n&&t[e]===o||("function"==typeof t.__lookupSetter__(e)?t[e]=o:t.setAttribute(e,o))}}catch(t){}null==l||!1===l?!1===l&&""!==t.getAttribute(e)||t.removeAttribute(e):(!r||4&i||s)&&!o&&1===t.nodeType&&t.setAttribute(e,l=!0===l?"":l)}}},L=/\s/,_=t=>("object"==typeof t&&t&&"baseVal"in t&&(t=t.baseVal),t&&"string"==typeof t?t.split(L):[]),D=(t,e,n)=>{const o=11===e.O.nodeType&&e.O.host?e.O.host:e.O,l=t&&t.m||{},s=e.m||{};for(const t of H(Object.keys(l)))t in s||C(o,t,l[t],void 0,n,e.i);for(const t of H(Object.keys(s)))C(o,t,l[t],s[t],n,e.i)};function H(t){return t.includes("ref")?[...t.filter((t=>"ref"!==t)),"ref"]:t}var P=!1,U=!1,N=(t,e,n)=>{const o=e.v[n];let l,s,r=0;if(!i.document)throw Error("You are trying to render a Stencil component in an environment that doesn't support the DOM.");if(l=o.O=i.document.createElement(o.j),D(null,o,U),o.v){const e="template"===o.j?l.content:l;for(r=0;r<o.v.length;++r)s=N(t,o,r),s&&e.appendChild(s)}return l["s-hn"]=j,l},R=(t,e,n,o,l,s)=>{let i,r=t;for(r.shadowRoot&&r.tagName===j&&(r=r.shadowRoot),"template"===n.j&&(r=r.content);l<=s;++l)o[l]&&(i=N(null,n,l),i&&(o[l].O=i,z(r,i,e)))},W=(t,e,n)=>{for(let o=e;o<=n;++o){const e=t[o];if(e){const t=e.O;t&&t.remove()}}},V=(t,e,n=!1)=>t.j===e.j&&(n?(n&&!t.$&&e.$&&(t.$=e.$),!0):t.$===e.$),q=(t,e,n=!1)=>{const o=e.O=t.O,l=t.v,s=e.v;"slot"!==e.j||P||t.k!==e.k&&(e.O["s-sn"]=e.k||"",(t=>{c.i|=1;const e=t.closest(j.toLowerCase());if(null!=e){const n=Array.from(e.__childNodes||e.childNodes).find((t=>t["s-cr"])),o=Array.from(t.__childNodes||t.childNodes);for(const t of n?o.reverse():o)null!=t["s-sh"]&&(z(e,t,null!=n?n:null),t["s-sh"]=void 0)}c.i&=-2})(e.O.parentElement)),D(t,e,U),null!==l&&null!==s?((t,e,n,o,l=!1)=>{let s,i,r=0,c=0,u=0,a=0,f=e.length-1,d=e[0],p=e[f],b=o.length-1,h=o[0],m=o[b];const y="template"===n.j?t.content:t;for(;r<=f&&c<=b;)if(null==d)d=e[++r];else if(null==p)p=e[--f];else if(null==h)h=o[++c];else if(null==m)m=o[--b];else if(V(d,h,l))q(d,h,l),d=e[++r],h=o[++c];else if(V(p,m,l))q(p,m,l),p=e[--f],m=o[--b];else if(V(d,m,l))q(d,m,l),z(y,d.O,p.O.nextSibling),d=e[++r],m=o[--b];else if(V(p,h,l))q(p,h,l),z(y,p.O,d.O),p=e[--f],h=o[++c];else{for(u=-1,a=r;a<=f;++a)if(e[a]&&null!==e[a].$&&e[a].$===h.$){u=a;break}u>=0?(i=e[u],i.j!==h.j?s=N(e&&e[c],n,u):(q(i,h,l),e[u]=void 0,s=i.O),h=o[++c]):(s=N(e&&e[c],n,c),h=o[++c]),s&&z(d.O.parentNode,s,d.O)}r>f?R(t,null==o[b+1]?null:o[b+1].O,n,o,c,b):c>b&&W(e,r,f)})(o,l,e,s,n):null!==s?R(o,null,e,s,0,s.length-1):!n&&null!==l&&W(l,0,l.length-1)},z=(t,e,n)=>t.__insertBefore?t.__insertBefore(e,n):null==t?void 0:t.insertBefore(e,n),F=(t,e,n=!1)=>{const o=t.$hostElement$,l=t.o,s=t.S||M(null,null),i=(t=>t&&t.j===x)(e)?e:E(null,null,e);if(j=o.tagName,n&&i.m)for(const t of Object.keys(i.m))o.hasAttribute(t)&&!["key","ref","style","class"].includes(t)&&(i.m[t]=o[t]);i.j=null,i.i|=4,t.S=i,i.O=s.O=o.shadowRoot||o,P=!(!(1&l.i)||128&l.i),q(s,i,n)},T=(t,e)=>{if(e&&!t.M&&e["s-p"]){const n=e["s-p"].push(new Promise((o=>t.M=()=>{e["s-p"].splice(n-1,1),o()})))}},B=(t,e)=>{if(t.i|=16,4&t.i)return void(t.i|=512);T(t,t.A);const n=()=>Y(t,e);if(!e)return v(n);queueMicrotask((()=>{n()}))},Y=(t,e)=>{const n=t.$hostElement$,o=n;if(!o)throw Error(`Can't render component <${n.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`);let l;return l=X(o,e?"componentWillLoad":"componentWillUpdate",void 0,n),l=Z(l,(()=>X(o,"componentWillRender",void 0,n))),Z(l,(()=>I(t,o,e)))},Z=(t,e)=>G(t)?t.then(e).catch((t=>{console.error(t),e()})):e(),G=t=>t instanceof Promise||t&&t.then&&"function"==typeof t.then,I=async(t,e,n)=>{var o;const l=t.$hostElement$,r=l["s-rc"];n&&(t=>{const e=t.o,n=t.$hostElement$,o=e.i,l=((t,e)=>{var n,o,l;const r=k(e),f=s.get(r);if(!i.document)return r;if(t=11===t.nodeType?t:i.document,f)if("string"==typeof f){let l,s=O.get(t=t.head||t);if(s||O.set(t,s=new Set),!s.has(r)){l=i.document.createElement("style"),l.textContent=f;const d=null!=(n=c.C)?n:function(){var t,e,n;return null!=(n=null==(e=null==(t=i.document.head)?void 0:t.querySelector('meta[name="csp-nonce"]'))?void 0:e.getAttribute("content"))?n:void 0}();if(null!=d&&l.setAttribute("nonce",d),!(1&e.i))if("HEAD"===t.nodeName){const e=t.querySelectorAll("link[rel=preconnect]"),n=e.length>0?e[e.length-1].nextSibling:t.querySelector("style");t.insertBefore(l,(null==n?void 0:n.parentNode)===t?n:null)}else if("host"in t)if(u){const e=new(null!=(o=t.defaultView)?o:t.ownerDocument.defaultView).CSSStyleSheet;e.replaceSync(f),a?t.adoptedStyleSheets.unshift(e):t.adoptedStyleSheets=[e,...t.adoptedStyleSheets]}else{const e=t.querySelector("style");e?e.textContent=f+e.textContent:t.prepend(l)}else t.append(l);1&e.i&&t.insertBefore(l,null),4&e.i&&(l.textContent+="slot-fb{display:contents}slot-fb[hidden]{display:none}"),s&&s.add(r)}}else{let e=O.get(t);if(e||O.set(t,e=new Set),!e.has(r)){const n=null!=(l=t.defaultView)?l:t.ownerDocument.defaultView;let o;if(f.constructor===n.CSSStyleSheet)o=f;else{o=new n.CSSStyleSheet;for(let t=0;t<f.cssRules.length;t++)o.insertRule(f.cssRules[t].cssText,t)}a?t.adoptedStyleSheets.push(o):t.adoptedStyleSheets=[...t.adoptedStyleSheets,o],e.add(r)}}return r})(n.shadowRoot?n.shadowRoot:n.getRootNode(),e);10&o&&(n["s-sc"]=l,n.classList.add(l+"-h"))})(t);J(t,e,l,n),r&&(r.map((t=>t())),l["s-rc"]=void 0);{const e=null!=(o=l["s-p"])?o:[],n=()=>K(t);0===e.length?n():(Promise.all(e).then(n).catch(n),t.i|=4,e.length=0)}},J=(t,e,n,o)=>{try{e=e.render(),t.i&=-17,t.i|=2,F(t,e,o)}catch(e){l(e,t.$hostElement$)}return null},K=t=>{const e=t.$hostElement$,n=e,o=t.A;X(n,"componentDidRender",void 0,e),64&t.i?X(n,"componentDidUpdate",void 0,e):(t.i|=64,tt(e),X(n,"componentDidLoad",void 0,e),t.L(e),o||Q()),t.M&&(t.M(),t.M=void 0),512&t.i&&y((()=>B(t,!1))),t.i&=-517},Q=()=>{y((()=>(t=>{const e=c.ce("appload",{detail:{namespace:"accretion"}});return t.dispatchEvent(e),e})(i)))},X=(t,e,n,o)=>{if(t&&t[e])try{return t[e](n)}catch(t){l(t,o)}},tt=t=>t.classList.add("hydrated"),et=(t,e,n,l)=>{const s=o(t);if(!s)return;const i=t,r=s.l.get(e),c=s.i,u=i;if((n=A(n,l.t[e][0]))!==r&&(!Number.isNaN(r)||!Number.isNaN(n))&&(s.l.set(e,n),2&c)){if(u.componentShouldUpdate&&!1===u.componentShouldUpdate(n,r,e)&&!(16&c))return;16&c||B(s,!1)}},nt=(e,n)=>{var l,s;const i=e.prototype;if(n.t){const r=Object.entries(null!=(l=n.t)?l:{});r.map((([e,[l]])=>{if(31&l||32&l){const{get:s,set:r}=t(i,e)||{};s&&(n.t[e][0]|=2048),r&&(n.t[e][0]|=4096),Object.defineProperty(i,e,{get(){return s?s.apply(this):((t,e)=>o(this).l.get(e))(0,e)},configurable:!0,enumerable:!0}),Object.defineProperty(i,e,{set(t){const s=o(this);if(s){if(r)return void 0===(32&l?this[e]:s.$hostElement$[e])&&s.l.get(e)&&(t=s.l.get(e)),r.call(this,A(t,l)),void et(this,e,t=32&l?this[e]:s.$hostElement$[e],n);et(this,e,t,n)}}})}}));{const t=new Map;i.attributeChangedCallback=function(e,l,s){c.jmp((()=>{var c;const u=t.get(e),a=o(this);if(this.hasOwnProperty(u),i.hasOwnProperty(u)&&"number"==typeof this[u]&&this[u]==s)return;if(null==u){const t=null==a?void 0:a.i;if(a&&t&&!(8&t)&&s!==l){const o=this,i=null==(c=n._)?void 0:c[e];null==i||i.forEach((n=>{const[[i,r]]=Object.entries(n);null!=o[i]&&(128&t||1&r)&&o[i].call(o,s,l,e)}))}return}const f=r.find((([t])=>t===u));f&&4&f[1][0]&&(s=null!==s&&"false"!==s);const d=Object.getOwnPropertyDescriptor(i,u);s==this[u]||d.get&&!d.set||(this[u]=s)}))},e.observedAttributes=Array.from(new Set([...Object.keys(null!=(s=n._)?s:{}),...r.filter((([t,e])=>31&e[0])).map((([e,n])=>{const o=n[1]||e;return t.set(o,e),o}))]))}}return e},ot=t=>c.C=t,lt=t=>Object.assign(c,t);function st(t,e){F({o:{i:0,p:e.tagName},$hostElement$:e},t)}const it=((t,e)=>{const i={i:769,p:e[1]};try{i.t=e[2];const r=t.prototype.connectedCallback,a=t.prototype.disconnectedCallback;return Object.assign(t.prototype,{__hasHostListenerAttached:!1,__registerHost(){((t,e)=>{const o={i:0,$hostElement$:t,o:e,l:new Map,D:new Map};o.H=new Promise((t=>o.L=t)),t["s-p"]=[],t["s-rc"]=[];const l=o;t.__stencil__getHostRef=()=>l,512&e.i&&n(t,o)})(this,i)},connectedCallback(){if(!this.__hasHostListenerAttached){if(!o(this))return;this.__hasHostListenerAttached=!0}(t=>{if(!(1&c.i)){const e=o(t);if(!e)return;const n=e.o,i=()=>{};if(1&e.i)(null==e?void 0:e.P)||(null==e?void 0:e.H)&&e.H.then((()=>{}));else{e.i|=1;{let n=t;for(;n=n.parentNode||n.host;)if(n["s-p"]){T(e,e.A=n);break}}n.t&&Object.entries(n.t).map((([e,[n]])=>{if(31&n&&Object.prototype.hasOwnProperty.call(t,e)){const n=t[e];delete t[e],t[e]=n}})),(async(t,e,n)=>{let o;try{if(!(32&e.i)&&(e.i|=32,o=t.constructor,customElements.whenDefined(t.localName).then((()=>e.i|=128)),o&&o.style)){let t;"string"==typeof o.style&&(t=o.style);const e=k(n);if(!s.has(e)){const o=()=>{};((t,e,n)=>{let o=s.get(t);u&&n?(o=o||new CSSStyleSheet,"string"==typeof o?o=e:o.replaceSync(e)):o=e,s.set(t,o)})(e,t,!!(1&n.i)),o()}}const l=e.A,i=()=>B(e,!0);l&&l["s-rc"]?l["s-rc"].push(i):i()}catch(n){l(n,t),e.M&&(e.M(),e.M=void 0),e.L&&e.L(t)}})(t,e,n)}i()}})(this),r&&r.call(this)},disconnectedCallback(){(async t=>{O.has(t)&&O.delete(t),t.shadowRoot&&O.has(t.shadowRoot)&&O.delete(t.shadowRoot)})(this),a&&a.call(this)},__attachShadow(){if(this.shadowRoot){if("open"!==this.shadowRoot.mode)throw Error(`Unable to re-use existing shadow root for ${i.p}! Mode is set to ${this.shadowRoot.mode} but Stencil only supports open shadow roots.`)}else w.call(this,i)}}),Object.defineProperty(t,"is",{value:i.p,configurable:!0}),nt(t,i)}catch(e){return l(e),t}})(class extends r{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow()}variant="primary";disabled=!1;render(){return E("button",{key:"c7fa4931dabe49cfe39db12ef635c40dc810e824",class:"button button--"+this.variant,disabled:this.disabled,type:"button"},E("slot",{key:"e07fe75c0dd94de71991918ccf6656cf6b403e4f"}))}static get style(){return":host{display:inline-block}.button{align-items:center;border:0;border-radius:8px;cursor:pointer;display:inline-flex;font:inherit;gap:0.5rem;justify-content:center;min-height:2.75rem;min-width:2.75rem;padding:0.625rem 1rem;transition:background-color 150ms ease, color 150ms ease, opacity 150ms ease}.button:focus-visible{outline:2px solid #0a85a1;outline-offset:2px}.button--primary{background:#0a85a1;color:#ffffff}.button--primary:hover{background:#02657c}.button--secondary{background:#e7ecf0;color:#191b1d}.button--secondary:hover{background:#d9dfe5}.button:disabled{cursor:not-allowed;opacity:0.5}"}},[769,"accretion-button",{variant:[1],disabled:[4]}]),rt=it,ct=function(){"undefined"!=typeof customElements&&["accretion-button"].forEach((t=>{"accretion-button"===t&&(customElements.get(t)||customElements.define(t,it))}))};export{rt as AccretionButton,ot as a,lt as b,ct as defineCustomElement,ct as defineCustomElementAccretionButton,$ as g,$ as getAssetPath,st as r,st as render,g as s,g as setAssetPath,ot as setNonce,lt as setPlatformOptions}
|
package/dist/components/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{getAssetPath,render,setAssetPath,setNonce,
|
|
1
|
+
export{AccretionButton,defineCustomElement as defineCustomElementAccretionButton,g as getAssetPath,r as render,s as setAssetPath,a as setNonce,b as setPlatformOptions}from"./accretion-button.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@accretion_ui/core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "Accretion UI core web components built with Stencil.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.cjs.js",
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
"build:watch": "stencil build --watch --serve",
|
|
22
22
|
"generate": "npm run build",
|
|
23
23
|
"test": "stencil test --spec --e2e",
|
|
24
|
+
"prepublishOnly": "npm run build",
|
|
24
25
|
"publish:package": "npm publish --access public"
|
|
25
26
|
},
|
|
26
27
|
"dependencies": {
|