@inclusive-design/components 0.1.0

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.
package/CHANGELOG.md ADDED
@@ -0,0 +1,13 @@
1
+ # Changelog
2
+
3
+ ## [0.1.0](https://github.com/inclusive-design/components/compare/v0.1.0...v0.1.0) (2026-09-08)
4
+
5
+
6
+ ### Features
7
+
8
+ * initial commit ([aac8845](https://github.com/inclusive-design/components/commit/aac8845567f4674f42d7910c5014863546e9d0e4))
9
+
10
+
11
+ ### Miscellaneous Chores
12
+
13
+ * **release:** coerce version ([228f0c6](https://github.com/inclusive-design/components/commit/228f0c665c8ba16b2c1816c45abe7a4ce829b99f))
package/LICENSE.md ADDED
@@ -0,0 +1,28 @@
1
+ # BSD 3-Clause License
2
+
3
+ Copyright (c) 2026–present, OCAD University
4
+
5
+ Redistribution and use in source and binary forms, with or without
6
+ modification, are permitted provided that the following conditions are met:
7
+
8
+ 1. Redistributions of source code must retain the above copyright notice, this
9
+ list of conditions and the following disclaimer.
10
+
11
+ 2. Redistributions in binary form must reproduce the above copyright notice,
12
+ this list of conditions and the following disclaimer in the documentation
13
+ and/or other materials provided with the distribution.
14
+
15
+ 3. Neither the name of the copyright holder nor the names of its
16
+ contributors may be used to endorse or promote products derived from
17
+ this software without specific prior written permission.
18
+
19
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package/README.md ADDED
@@ -0,0 +1,8 @@
1
+ # Inclusive Design Web Components
2
+
3
+ Web components for the Inclusive Design Research Centre.
4
+
5
+ ## Components
6
+
7
+ - [Card](src/components/incd-card/README.md)
8
+ - [Navigation](src/components/incd-nav/README.md)
@@ -0,0 +1 @@
1
+ incd-card{--_incd-card-outline-width:var(--incd-card-outline-width,2px);--_incd-card-outline-style:var(--incd-card-outline-style,solid);--_incd-card-outline-offset:var(--incd-card-outline-offset,1px);--_incd-card-outline-color:var(--incd-card-outline-color);display:block;position:relative}incd-card:focus-within{outline:var(--_incd-card-outline-width) var(--_incd-card-outline-style) var(--_incd-card-outline-color,Highlight);outline-color:var(--_incd-card-outline-color,-webkit-focus-ring-color);outline-offset:var(--_incd-card-outline-offset)}incd-card a:focus-visible{outline:none}incd-card a:after{content:"";display:block;position:absolute;inset:0}incd-nav [aria-expanded=true] svg{transform:rotate(180deg)}incd-nav [aria-expanded=false]+*{display:none}incd-nav [aria-expanded=true]+*{display:revert}
package/dist/bundle.js ADDED
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @inclusive-design/components v0.1.0
3
+ * (c) 2026–present OCAD University
4
+ * @license BSD-3-Clause
5
+ */
6
+ const t="░█ [ELENA]: ",e=Array.isArray,n=Symbol("elena.raw"),s=e=>console.warn(t+e);const r={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function i(t){return e(t)?t.map(o).join(""):o(t)}function o(t){return t?.[n]?String(t):function(t){return String(t).replace(/[&<>"']/g,t=>r[t])}(t??"")}function a(t){return{[n]:!0,toString:()=>t??""}}const l={[n]:!0,toString:()=>""},c=t=>e(t)?t.some(t=>t?.[n]):!!t?.[n],h=t=>e(t)?t.join(""):String(t??"");function d(t){return t.replace(/(>)\n\s*|\n\s*(<)/g,"$1$2").replace(/\n\s*/g," ").replace(/>\s+</g,"><")}function u(t,e,n){if(e="boolean"===t&&"boolean"!=typeof e?null!==e:e,!n)return e;if("toAttribute"===n)switch(t){case"object":case"array":return e&&JSON.stringify(e);case"boolean":return e?"":null;default:return""===e?null:e}else switch(t){case"object":case"array":if(!e)return e;try{return JSON.parse(e)}catch{return s("Invalid JSON: "+e),null}case"number":return null!==e?+e:e;default:return e??""}}function p(t,e,n){t?null===n?t.removeAttribute(e):t.setAttribute(e,n):s("Cannot sync attrs.")}function f(t,e,n){for(const s of e){const e=!n||!n.has(s);Object.defineProperty(t,s,{configurable:!0,enumerable:!0,get(){return this._props?.get(s)},set(t){if(this._props||(this._props=new Map),t!==this._props.get(s)&&(this._props.set(s,t),this.isConnected))if(e){if(!this._syncing){const e=u(typeof t,t,"toAttribute");p(this,s,e)}}else this._hydrated&&!this._isRendering&&this._safeRender()}})}}const _=new WeakMap,m="e"+Math.random().toString(36).slice(2),g=()=>document.createElement("template"),y=t=>document.createTreeWalker(t,128);function b(t,n,s){return!function(t,n,s){if(t._templateStrings!==n||!t._templateParts)return!1;const r=t._templateParts,i=t._templateValues;for(let t=0;t<s.length;t++){const n=s[t],o=e(n)?h(n):n;if(o===i[t])continue;if(c(n)&&n!==l)return!1;const a=r[t];if(!a)return!1;i[t]=o;const d=String(o??"");a.nodeType?a.textContent=d:a[0].setAttribute(a[1],d)}return!0}(t,n,s)&&(function(t,n,s){let r=_.get(n);if(!r){const t=n.map(d);r={_strings:t,_template:s.length>0?v(t,s.length):null},_.set(n,r)}if(r._template)t._templateParts=function(t,n,s){const{_tpl:r,_attrs:o}=n,a=r.content.cloneNode(!0),d=y(a),u=Array(s.length),p=[];let f;for(;f=d.nextNode();)f.data===m&&p.push(f);let _=0;for(let t=0;t<s.length;t++){const n=o[t];if(n){const r=a.querySelector(`[${n}="${m+"_"+t}"]`);if(r){const i=s[t],o=String((e(i)?h(i):i)??"");r.setAttribute(n,o),u[t]=[r,n]}}else{const e=p[_++],n=s[t];if(c(n)&&n!==l){const t=g();t.innerHTML=i(n),e.parentNode.replaceChild(t.content,e)}else{const s=document.createTextNode(h(n));e.parentNode.replaceChild(s,e),u[t]=s}}}return t._templateStrings?(C(t,a.childNodes),null):(t.replaceChildren(a),u)}(t,r._template,s);else{const e=s.map(i),n=r._strings.reduce((t,n,s)=>t+n+(e[s]??""),"").replace(/>\s+</g,"><").trim(),o=g();o.innerHTML=n,C(t,o.content.childNodes),t._templateParts=null}t._templateStrings=n,t._templateValues=s.map(t=>e(t)?h(t):t)}(t,n,s),!0)}function v(t,e){const n=`\x3c!--${m}--\x3e`,s=[];let r="";for(let i=0;i<t.length;i++)if(r+=t[i],i<e){const e=t[i].match(/([^\s"'>/=]+)\s*=\s*["']$/);e?(s.push(e[1]),r+=m+"_"+i):(s.push(null),r+=n)}const i=g();i.innerHTML=r.trim();const o=y(i.content);let a=0;for(;o.nextNode();)o.currentNode.data===m&&a++;return a!==s.filter(t=>null===t).length?null:{_tpl:i,_attrs:s}}function C(t,e){const n=Array.from(t.childNodes),s=Array.from(e),r=Math.max(n.length,s.length);for(let e=0;e<r;e++){const r=n[e],i=s[e];r?i?r.nodeType!==i.nodeType||1===r.nodeType&&r.tagName!==i.tagName?t.replaceChild(i,r):3===r.nodeType?r.textContent!==i.textContent&&(r.textContent=i.textContent):1===r.nodeType&&(S(r,i),C(r,i.childNodes)):t.removeChild(r):t.appendChild(i)}}function S(t,e){for(let n=t.attributes.length-1;n>=0;n--){const{name:s}=t.attributes[n];e.hasAttribute(s)||t.removeAttribute(s)}for(let n=0;n<e.attributes.length;n++){const{name:s,value:r}=e.attributes[n];t.getAttribute(s)!==r&&t.setAttribute(s,r)}}
7
+ /**
8
+ * @elenajs/core v1.0.1
9
+ * (c) 2025-present Ariel Salminen and Elena contributors
10
+ * @license MIT
11
+ */const x=new WeakSet,A=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);function E(e){return class extends e{element=null;attributeChangedCallback(t,e,n){if(super.attributeChangedCallback?.(t,e,n),"text"!==t){if(e!==n)if(this._hydrated&&!this._isRendering){const e=this._props.get(t),s=typeof e,r="string"===s?n??"":u(s,n,"toProp");r!==e&&this._props.set(t,r),this._safeRender()}else this._syncing=!0,function(t,e,n,r){if(n!==r){const n=typeof t[e];"undefined"===n&&s(`Prop "${e}" has no default.`);const i=u(n,r,"toProp");t[e]=i}}(this,t,e,n),this._syncing=!1}else this.text=n??""}static get observedAttributes(){if(this._observedAttrs)return this._observedAttrs;const t=(this.props||[]).map(t=>"string"==typeof t?t:t.name);return this._observedAttrs=[...t,"text"],this._observedAttrs}connectedCallback(){super.connectedCallback?.(),this._setupStaticProps(),this._captureClassFieldDefaults(),this._hydrated||void 0!==this._text||(this.text=this.textContent.trim()),this._attachShadow(),this._root=this._shadow??this.shadowRoot??this,this._runUpdate??=()=>{try{this._performUpdate()}catch(e){console.error(t,e)}},this.willUpdate(),this._applyRender(),this._syncProps(),this._delegateEvents(),this._hydrated||(this._hydrated=!0,this.setAttribute("hydrated",""),this.firstUpdated()),this.updated()}_setupStaticProps(){const t=this.constructor;if(x.has(t))return;const e=new Set,n=[];if(t.props){for(const s of t.props)"string"==typeof s?n.push(s):(n.push(s.name),!1===s.reflect&&e.add(s.name));n.includes("text")&&s('"text" is reserved.'),f(t.prototype,n,e)}if(t._propNames=n,t._noReflect=e,t._elenaEvents=t.events||null,t._elenaEvents)for(const e of t._elenaEvents)A(t.prototype,e)||(t.prototype[e]=function(...t){return this.element[e](...t)});var r;t._resolver=(r=t.element)?t=>t.querySelector(r):t=>t.firstElementChild,x.add(t)}_captureClassFieldDefaults(){this._syncing=!0;for(const t of this.constructor._propNames)if(A(this,t)){const e=this[t];delete this[t],this[t]=e}this._syncing=!1}_attachShadow(){const t=this.constructor;if(!t.shadow)return;if(!this._shadow&&!this.shadowRoot){const e={mode:t.shadow};t.registry&&(e.customElementRegistry=t.registry),this._shadow=this.attachShadow(e)}const e=this._shadow??this.shadowRoot;if(t.styles){if(!t._adoptedSheets){const e=[t.styles].flat();t._adoptedSheets=e.map(t=>{if("string"==typeof t){const e=new CSSStyleSheet;return e.replaceSync(t),e}return t})}e.adoptedStyleSheets=t._adoptedSheets}}_applyRender(){const t=this.constructor,e=this._root,n=this.render();if(n&&n.strings&&b(e,n.strings,n.values)){const n=this.element;if(this.element=t._resolver(e),this._events&&n&&this.element!==n){const e=t._elenaEvents;for(const t of e)n.removeEventListener(t,this),this.element.addEventListener(t,this)}}this.element||(this.element=t._resolver(e),this.element||(t.element&&s("Element not found."),this.element=e.firstElementChild))}_syncProps(){if(this._props){const t=this.constructor._noReflect;for(const[e,n]of this._props){if(t.has(e))continue;const s=u(typeof n,n,"toAttribute");(null!==s||this.hasAttribute(e))&&p(this,e,s)}}}_delegateEvents(){const t=this.constructor._elenaEvents;if(!this._events&&t?.length)if(this.element){this._events=!0;for(const e of t)this.element.addEventListener(e,this)}else s("Cannot add events.")}render(){}willUpdate(){}firstUpdated(){}updated(){}adoptedCallback(){super.adoptedCallback?.()}disconnectedCallback(){if(super.disconnectedCallback?.(),this._events){this._events=!1;for(const t of this.constructor._elenaEvents)this.element?.removeEventListener(t,this)}}handleEvent(t){this.constructor._elenaEvents?.includes(t.type)&&(t.bubbles&&(t.composed||this._root===this)||this.dispatchEvent(new Event(t.type,{bubbles:t.bubbles})))}get text(){return this._text??""}set text(t){const e=this._text;this._text=t,this._hydrated&&e!==t&&!this._isRendering&&this._safeRender()}static define(t){const e=this.tagName;e?function(t,e,n){const s=n??globalThis.customElements;s?.get(t)||s?.define(t,e)}(e,this,t):s("define() without a tagName.")}_safeRender(){this._isRendering||this._renderPending||(this._renderPending=!0,queueMicrotask(this._runUpdate))}_performUpdate(){this._renderPending=!1;const t=this._resolveUpdate;this._resolveUpdate=null;try{try{this.willUpdate(),this._isRendering=!0,this._applyRender()}finally{this._isRendering=!1}this.updated()}finally{this._updateComplete=null,t?.()}}get updateComplete(){return this._renderPending?(this._updateComplete||(this._updateComplete=new Promise(t=>{this._resolveUpdate=t})),this._updateComplete):Promise.resolve()}requestUpdate(){this._hydrated&&!this._isRendering&&this._safeRender()}}}class k extends(E(HTMLElement)){static tagName="incd-nav";static events=["blur"];static props=[{name:"icon",reflect:!1}];#t=(t=!1)=>{const e=this.querySelector('[aria-expanded="true"]');t&&e?.focus(),e?.setAttribute("aria-expanded",!1)};#e=t=>{const e=t.target.closest("button"),n="true"===e.getAttribute("aria-expanded");n||this.#t(),e.setAttribute("aria-expanded",!n)};#n=t=>{t.target.closest("incd-nav [aria-expanded]")||this.#t()};#s=t=>{"Escape"===t.key&&this.#t(!0)};#r=t=>{t.target?.closest("li:has(ul)")!==t.relatedTarget?.closest("li:has(ul)")&&this.#t()};icon='<svg width="24" height="25" aria-hidden="true" role="presentation" fill="none">\n\t\t<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m6 9.5 6 6 6-6"></path>\n\t</svg>';connectedCallback(){const t=this.querySelectorAll(":scope li:has(ul) > a"),e=this.querySelectorAll("li:has(ul)");for(const e of t){const t=document.createElement("button"),n=Math.random().toString(36).slice(2,9);e.nextElementSibling.id=n,t.setAttribute("aria-expanded",!1),t.setAttribute("aria-label",e.textContent),t.setAttribute("aria-controls",n),t.innerHTML=this.icon?a(this.icon):l,e.after(t),t.addEventListener("click",this.#e)}for(const t of e){const e=t.querySelectorAll("a, button");for(const t of e)t.addEventListener("blur",this.#r)}document.addEventListener("click",this.#n),document.addEventListener("keyup",this.#s),super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback();const t=this.querySelectorAll("[aria-expanded]"),e=this.querySelectorAll("li:has(ul)");for(const e of t)e.removeEventListener("click",this.#e);for(const t of e){const e=t.querySelectorAll("a, button");for(const t of e)t.removeEventListener("blur",this.#r)}document.removeEventListener("click",this.#n),document.removeEventListener("keyup",this.#s)}}k.define();export{k as Nav};
12
+ //# sourceMappingURL=bundle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bundle.js","sources":["../node_modules/@elenajs/core/dist/utils.js","../node_modules/@elenajs/core/dist/props.js","../node_modules/@elenajs/core/dist/render.js","../node_modules/@elenajs/core/dist/elena.js","../src/components/incd-nav/incd-nav.js"],"sourcesContent":["const t=\"░█ [ELENA]: \",n=Array.isArray,r=Symbol(\"elena.raw\"),s=n=>console.warn(t+n);function e(t,n,r){const s=r??globalThis.customElements;s?.get(t)||s?.define(t,n)}const o={\"&\":\"&amp;\",\"<\":\"&lt;\",\">\":\"&gt;\",'\"':\"&quot;\",\"'\":\"&#39;\"};function i(t){return String(t).replace(/[&<>\"']/g,t=>o[t])}function c(t){return n(t)?t.map(u).join(\"\"):u(t)}function u(t){return t?.[r]?String(t):i(t??\"\")}class l{constructor(t,n){this.strings=t,this.values=n}toString(){return null==this._str&&(this._str=this.strings.reduce((t,n,r)=>t+n+c(this.values[r]),\"\")),this._str}}function a(t,...n){return new l(t,n)}function g(t){return{[r]:!0,toString:()=>t??\"\"}}l.prototype[r]=!0;const p={[r]:!0,toString:()=>\"\"},f=t=>n(t)?t.some(t=>t?.[r]):!!t?.[r],h=t=>n(t)?t.join(\"\"):String(t??\"\");function S(t){return t.replace(/(>)\\n\\s*|\\n\\s*(<)/g,\"$1$2\").replace(/\\n\\s*/g,\" \").replace(/>\\s+</g,\"><\")}export{S as collapseWhitespace,e as defineElement,i as escapeHtml,a as html,n as isArray,f as isRaw,p as nothing,t as prefix,c as resolveValue,h as toPlainText,g as unsafeHTML,s as warn};\n","import{warn as t}from\"./utils.js\";function e(e,n,r){if(n=\"boolean\"===e&&\"boolean\"!=typeof n?null!==n:n,!r)return n;if(\"toAttribute\"===r)switch(e){case\"object\":case\"array\":return n&&JSON.stringify(n);case\"boolean\":return n?\"\":null;default:return\"\"===n?null:n}else switch(e){case\"object\":case\"array\":if(!n)return n;try{return JSON.parse(n)}catch{return t(\"Invalid JSON: \"+n),null}case\"number\":return null!==n?+n:n;default:return n??\"\"}}function n(e,n,r){e?null===r?e.removeAttribute(n):e.setAttribute(n,r):t(\"Cannot sync attrs.\")}function r(t,r,s){for(const o of r){const r=!s||!s.has(o);Object.defineProperty(t,o,{configurable:!0,enumerable:!0,get(){return this._props?.get(o)},set(t){if(this._props||(this._props=new Map),t!==this._props.get(o)&&(this._props.set(o,t),this.isConnected))if(r){if(!this._syncing){const r=e(typeof t,t,\"toAttribute\");n(this,o,r)}}else this._hydrated&&!this._isRendering&&this._safeRender()}})}}function s(n,r,s,o){if(s!==o){const s=typeof n[r];\"undefined\"===s&&t(`Prop \"${r}\" has no default.`);const i=e(s,o,\"toProp\");n[r]=i}}export{e as getPropValue,s as getProps,r as setProps,n as syncAttribute};\n","import{isArray as t,toPlainText as e,isRaw as n,nothing as r,collapseWhitespace as o,resolveValue as l}from\"./utils.js\";const s=new WeakMap,a=\"e\"+Math.random().toString(36).slice(2),c=()=>document.createElement(\"template\"),i=t=>document.createTreeWalker(t,128);function u(u,m,f){return!function(o,l,s){if(o._templateStrings!==l||!o._templateParts)return!1;const a=o._templateParts,c=o._templateValues;for(let o=0;o<s.length;o++){const l=s[o],i=t(l)?e(l):l;if(i===c[o])continue;if(n(l)&&l!==r)return!1;const u=a[o];if(!u)return!1;c[o]=i;const p=String(i??\"\");u.nodeType?u.textContent=p:u[0].setAttribute(u[1],p)}return!0}(u,m,f)&&(function(u,m,f){let h=s.get(m);if(!h){const t=m.map(o);h={_strings:t,_template:f.length>0?p(t,f.length):null},s.set(m,h)}if(h._template)u._templateParts=function(o,s,u){const{_tpl:p,_attrs:m}=s,f=p.content.cloneNode(!0),h=i(f),g=Array(u.length),_=[];let N;for(;N=h.nextNode();)N.data===a&&_.push(N);let x=0;for(let o=0;o<u.length;o++){const s=m[o];if(s){const n=f.querySelector(`[${s}=\"${a+\"_\"+o}\"]`);if(n){const r=u[o],l=String((t(r)?e(r):r)??\"\");n.setAttribute(s,l),g[o]=[n,s]}}else{const t=_[x++],s=u[o];if(n(s)&&s!==r){const e=c();e.innerHTML=l(s),t.parentNode.replaceChild(e.content,t)}else{const n=document.createTextNode(e(s));t.parentNode.replaceChild(n,t),g[o]=n}}}return o._templateStrings?(d(o,f.childNodes),null):(o.replaceChildren(f),g)}(u,h._template,f);else{const t=f.map(l),e=h._strings.reduce((e,n,r)=>e+n+(t[r]??\"\"),\"\").replace(/>\\s+</g,\"><\").trim(),n=c();n.innerHTML=e,d(u,n.content.childNodes),u._templateParts=null}u._templateStrings=m,u._templateValues=f.map(n=>t(n)?e(n):n)}(u,m,f),!0)}function p(t,e){const n=`\\x3c!--${a}--\\x3e`,r=[];let o=\"\";for(let l=0;l<t.length;l++)if(o+=t[l],l<e){const e=t[l].match(/([^\\s\"'>/=]+)\\s*=\\s*[\"']$/);e?(r.push(e[1]),o+=a+\"_\"+l):(r.push(null),o+=n)}const l=c();l.innerHTML=o.trim();const s=i(l.content);let u=0;for(;s.nextNode();)s.currentNode.data===a&&u++;return u!==r.filter(t=>null===t).length?null:{_tpl:l,_attrs:r}}function d(t,e){const n=Array.from(t.childNodes),r=Array.from(e),o=Math.max(n.length,r.length);for(let e=0;e<o;e++){const o=n[e],l=r[e];o?l?o.nodeType!==l.nodeType||1===o.nodeType&&o.tagName!==l.tagName?t.replaceChild(l,o):3===o.nodeType?o.textContent!==l.textContent&&(o.textContent=l.textContent):1===o.nodeType&&(m(o,l),d(o,l.childNodes)):t.removeChild(o):t.appendChild(l)}}function m(t,e){for(let n=t.attributes.length-1;n>=0;n--){const{name:r}=t.attributes[n];e.hasAttribute(r)||t.removeAttribute(r)}for(let n=0;n<e.attributes.length;n++){const{name:r,value:o}=e.attributes[n];t.getAttribute(r)!==o&&t.setAttribute(r,o)}}export{u as renderTemplate};\n","/**\n * @elenajs/core v1.0.1\n * (c) 2025-present Ariel Salminen and Elena contributors\n * @license MIT\n */\nimport{getPropValue as t,getProps as e,setProps as s,syncAttribute as i}from\"./props.js\";import{prefix as n,warn as r,defineElement as o}from\"./utils.js\";export{html,nothing,unsafeHTML}from\"./utils.js\";import{renderTemplate as h}from\"./render.js\";const a=new WeakSet,d=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);function l(l){return class extends l{element=null;attributeChangedCallback(s,i,n){if(super.attributeChangedCallback?.(s,i,n),\"text\"!==s){if(i!==n)if(this._hydrated&&!this._isRendering){const e=this._props.get(s),i=typeof e,r=\"string\"===i?n??\"\":t(i,n,\"toProp\");r!==e&&this._props.set(s,r),this._safeRender()}else this._syncing=!0,e(this,s,i,n),this._syncing=!1}else this.text=n??\"\"}static get observedAttributes(){if(this._observedAttrs)return this._observedAttrs;const t=(this.props||[]).map(t=>\"string\"==typeof t?t:t.name);return this._observedAttrs=[...t,\"text\"],this._observedAttrs}connectedCallback(){super.connectedCallback?.(),this._setupStaticProps(),this._captureClassFieldDefaults(),this._hydrated||void 0!==this._text||(this.text=this.textContent.trim()),this._attachShadow(),this._root=this._shadow??this.shadowRoot??this,this._runUpdate??=()=>{try{this._performUpdate()}catch(t){console.error(n,t)}},this.willUpdate(),this._applyRender(),this._syncProps(),this._delegateEvents(),this._hydrated||(this._hydrated=!0,this.setAttribute(\"hydrated\",\"\"),this.firstUpdated()),this.updated()}_setupStaticProps(){const t=this.constructor;if(a.has(t))return;const e=new Set,i=[];if(t.props){for(const s of t.props)\"string\"==typeof s?i.push(s):(i.push(s.name),!1===s.reflect&&e.add(s.name));i.includes(\"text\")&&r('\"text\" is reserved.'),s(t.prototype,i,e)}if(t._propNames=i,t._noReflect=e,t._elenaEvents=t.events||null,t._elenaEvents)for(const e of t._elenaEvents)d(t.prototype,e)||(t.prototype[e]=function(...t){return this.element[e](...t)});var n;t._resolver=(n=t.element)?t=>t.querySelector(n):t=>t.firstElementChild,a.add(t)}_captureClassFieldDefaults(){this._syncing=!0;for(const t of this.constructor._propNames)if(d(this,t)){const e=this[t];delete this[t],this[t]=e}this._syncing=!1}_attachShadow(){const t=this.constructor;if(!t.shadow)return;if(!this._shadow&&!this.shadowRoot){const e={mode:t.shadow};t.registry&&(e.customElementRegistry=t.registry),this._shadow=this.attachShadow(e)}const e=this._shadow??this.shadowRoot;if(t.styles){if(!t._adoptedSheets){const e=[t.styles].flat();t._adoptedSheets=e.map(t=>{if(\"string\"==typeof t){const e=new CSSStyleSheet;return e.replaceSync(t),e}return t})}e.adoptedStyleSheets=t._adoptedSheets}}_applyRender(){const t=this.constructor,e=this._root,s=this.render();if(s&&s.strings&&h(e,s.strings,s.values)){const s=this.element;if(this.element=t._resolver(e),this._events&&s&&this.element!==s){const e=t._elenaEvents;for(const t of e)s.removeEventListener(t,this),this.element.addEventListener(t,this)}}this.element||(this.element=t._resolver(e),this.element||(t.element&&r(\"Element not found.\"),this.element=e.firstElementChild))}_syncProps(){if(this._props){const e=this.constructor._noReflect;for(const[s,n]of this._props){if(e.has(s))continue;const r=t(typeof n,n,\"toAttribute\");(null!==r||this.hasAttribute(s))&&i(this,s,r)}}}_delegateEvents(){const t=this.constructor._elenaEvents;if(!this._events&&t?.length)if(this.element){this._events=!0;for(const e of t)this.element.addEventListener(e,this)}else r(\"Cannot add events.\")}render(){}willUpdate(){}firstUpdated(){}updated(){}adoptedCallback(){super.adoptedCallback?.()}disconnectedCallback(){if(super.disconnectedCallback?.(),this._events){this._events=!1;for(const t of this.constructor._elenaEvents)this.element?.removeEventListener(t,this)}}handleEvent(t){this.constructor._elenaEvents?.includes(t.type)&&(t.bubbles&&(t.composed||this._root===this)||this.dispatchEvent(new Event(t.type,{bubbles:t.bubbles})))}get text(){return this._text??\"\"}set text(t){const e=this._text;this._text=t,this._hydrated&&e!==t&&!this._isRendering&&this._safeRender()}static define(t){const e=this.tagName;e?o(e,this,t):r(\"define() without a tagName.\")}_safeRender(){this._isRendering||this._renderPending||(this._renderPending=!0,queueMicrotask(this._runUpdate))}_performUpdate(){this._renderPending=!1;const t=this._resolveUpdate;this._resolveUpdate=null;try{try{this.willUpdate(),this._isRendering=!0,this._applyRender()}finally{this._isRendering=!1}this.updated()}finally{this._updateComplete=null,t?.()}}get updateComplete(){return this._renderPending?(this._updateComplete||(this._updateComplete=new Promise(t=>{this._resolveUpdate=t})),this._updateComplete):Promise.resolve()}requestUpdate(){this._hydrated&&!this._isRendering&&this._safeRender()}}}export{l as Elena};\n","import { Elena, unsafeHTML, nothing } from '@elenajs/core';\n\n/**\n * @displayName Nav\n * @status alpha\n *\n * @event blur - Programmatically remove focus from the component.\n */\nexport default class Nav extends Elena(HTMLElement) {\n\tstatic tagName = 'incd-nav';\n\tstatic events = ['blur'];\n\tstatic props = [{ name: 'icon', reflect: false }];\n\t#collapse = (shouldFocus = false) => {\n\t\tconst expandedMenuButton = this.querySelector('[aria-expanded=\"true\"]');\n\t\tif (shouldFocus) {\n\t\t\texpandedMenuButton?.focus();\n\t\t}\n\n\t\texpandedMenuButton?.setAttribute('aria-expanded', false);\n\t};\n\t#onClick = (event) => {\n\t\tconst button = event.target.closest('button');\n\t\tconst isAriaExpanded = (button.getAttribute('aria-expanded') === 'true');\n\t\tif (!isAriaExpanded) {\n\t\t\tthis.#collapse();\n\t\t}\n\n\t\tbutton.setAttribute('aria-expanded', !isAriaExpanded);\n\t};\n\t#onDocumentClick = (event) => {\n\t\tif (!event.target.closest('incd-nav [aria-expanded]')) {\n\t\t\tthis.#collapse();\n\t\t}\n\t};\n\t#onKeyUp = (event) => {\n\t\tif (event.key !== 'Escape') {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.#collapse(true);\n\t};\n\t#onBlur = (event) => {\n\t\tif (event.target?.closest('li:has(ul)') !== event.relatedTarget?.closest('li:has(ul)')) {\n\t\t\tthis.#collapse();\n\t\t}\n\t};\n\t/**\n\t * The icon to use in generated buttons.\n\t * @property\n\t * @type {string}\n\t */\n\ticon = `<svg width=\"24\" height=\"25\" aria-hidden=\"true\" role=\"presentation\" fill=\"none\">\n\t\t<path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"m6 9.5 6 6 6-6\"></path>\n\t</svg>`;\n\n\tconnectedCallback() {\n\t\tconst submenuLinks = this.querySelectorAll(':scope li:has(ul) > a');\n\t\tconst dropdownContainers = this.querySelectorAll('li:has(ul)');\n\n\t\tfor (const link of submenuLinks) {\n\t\t\tconst button = document.createElement('button');\n\t\t\tconst id = Math.random().toString(36).slice(2, 9);\n\t\t\tconst controlledElement = link.nextElementSibling;\n\t\t\tcontrolledElement.id = id;\n\t\t\tbutton.setAttribute('aria-expanded', false);\n\t\t\tbutton.setAttribute('aria-label', link.textContent);\n\t\t\tbutton.setAttribute('aria-controls', id);\n\t\t\tbutton.innerHTML = this.icon ? unsafeHTML(this.icon) : nothing;\n\t\t\tlink.after(button);\n\t\t\tbutton.addEventListener('click', this.#onClick);\n\t\t}\n\n\t\tfor (const container of dropdownContainers) {\n\t\t\tconst elements = container.querySelectorAll('a, button');\n\t\t\tfor (const element of elements) {\n\t\t\t\telement.addEventListener('blur', this.#onBlur);\n\t\t\t}\n\t\t}\n\n\t\tdocument.addEventListener('click', this.#onDocumentClick);\n\t\tdocument.addEventListener('keyup', this.#onKeyUp);\n\n\t\tsuper.connectedCallback();\n\t}\n\n\tdisconnectedCallback() {\n\t\tsuper.disconnectedCallback();\n\n\t\tconst buttons = this.querySelectorAll('[aria-expanded]');\n\t\tconst dropdownContainers = this.querySelectorAll('li:has(ul)');\n\n\t\tfor (const button of buttons) {\n\t\t\tbutton.removeEventListener('click', this.#onClick);\n\t\t}\n\n\t\tfor (const container of dropdownContainers) {\n\t\t\tconst elements = container.querySelectorAll('a, button');\n\t\t\tfor (const element of elements) {\n\t\t\t\telement.removeEventListener('blur', this.#onBlur);\n\t\t\t}\n\t\t}\n\n\t\tdocument.removeEventListener('click', this.#onDocumentClick);\n\t\tdocument.removeEventListener('keyup', this.#onKeyUp);\n\t}\n}\n\nNav.define();\n"],"names":["t","n","Array","isArray","r","Symbol","s","console","warn","o","c","map","u","join","String","replace","i","g","r$1","toString","p","f","some","h","S","e","JSON","stringify","parse","removeAttribute","setAttribute","has","Object","defineProperty","configurable","enumerable","get","this","_props","set","Map","isConnected","_syncing","_hydrated","_isRendering","_safeRender","WeakMap","a","Math","random","slice","document","createElement","createTreeWalker","m","l","_templateStrings","_templateParts","_templateValues","length","nodeType","textContent","_strings","_template","_tpl","_attrs","content","cloneNode","_","N","nextNode","data","push","x","querySelector","innerHTML","parentNode","replaceChild","createTextNode","d","childNodes","replaceChildren","reduce","trim","match","currentNode","filter","from","max","tagName","removeChild","appendChild","attributes","name","hasAttribute","value","getAttribute","WeakSet","prototype","hasOwnProperty","call","element","attributeChangedCallback","super","text","observedAttributes","_observedAttrs","props","connectedCallback","_setupStaticProps","_captureClassFieldDefaults","_text","_attachShadow","_root","_shadow","shadowRoot","_runUpdate","_performUpdate","error","willUpdate","_applyRender","_syncProps","_delegateEvents","firstUpdated","updated","constructor","Set","reflect","add","includes","_propNames","_noReflect","_elenaEvents","events","_resolver","firstElementChild","shadow","mode","registry","customElementRegistry","attachShadow","styles","_adoptedSheets","flat","CSSStyleSheet","replaceSync","adoptedStyleSheets","render","strings","values","_events","removeEventListener","addEventListener","adoptedCallback","disconnectedCallback","handleEvent","type","bubbles","composed","dispatchEvent","Event","define","globalThis","customElements","_renderPending","queueMicrotask","_resolveUpdate","_updateComplete","updateComplete","Promise","resolve","requestUpdate","Nav","Elena","HTMLElement","static","collapse","shouldFocus","expandedMenuButton","focus","onClick","event","button","target","closest","isAriaExpanded","onDocumentClick","onKeyUp","key","onBlur","relatedTarget","icon","submenuLinks","querySelectorAll","dropdownContainers","link","id","nextElementSibling","unsafeHTML","nothing","after","container","elements","buttons"],"mappings":";;;;;AAAA,MAAMA,EAAE,eAAeC,EAAEC,MAAMC,QAAQC,EAAEC,OAAO,aAAaC,EAAEL,GAAGM,QAAQC,KAAKR,EAAEC,GAAoF,MAAMQ,EAAE,CAAC,IAAI,QAAQ,IAAI,OAAO,I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ExC,CAEA1I,SAASqG,iBAAiB,QAASnH,MAAKqJ,GACxCvI,SAASqG,iBAAiB,QAASnH,MAAKsJ,GAExCpF,MAAMK,mBACP,CAEA,oBAAA8C,GACCnD,MAAMmD,uBAEN,MAAMiD,EAAUtK,KAAK4J,iBAAiB,mBAChCC,EAAqB7J,KAAK4J,iBAAiB,cAEjD,IAAK,MAAMX,KAAUqB,EACpBrB,EAAO/B,oBAAoB,QAASlH,MAAK+I,GAG1C,IAAK,MAAMqB,KAAaP,EAAoB,CAC3C,MAAMQ,EAAWD,EAAUR,iBAAiB,aAC5C,IAAK,MAAM5F,KAAWqG,EACrBrG,EAAQkD,oBAAoB,OAAQlH,MAAKwJ,EAE3C,CAEA1I,SAASoG,oBAAoB,QAASlH,MAAKqJ,GAC3CvI,SAASoG,oBAAoB,QAASlH,MAAKsJ,EAC5C,EAGDf,EAAIX","x_google_ignoreList":[0,1,2,3]}
@@ -0,0 +1,115 @@
1
+ /**
2
+ * This type can be used to create scoped tags for your components.
3
+ *
4
+ * Usage:
5
+ *
6
+ * ```ts
7
+ * import type { ScopedElements } from "path/to/library/jsx-integration";
8
+ *
9
+ * declare module "my-library" {
10
+ * namespace JSX {
11
+ * interface IntrinsicElements
12
+ * extends ScopedElements<'test-', ''> {}
13
+ * }
14
+ * }
15
+ * ```
16
+ *
17
+ */
18
+ export type ScopedElements<Prefix extends string = "", Suffix extends string = ""> = {
19
+ [Key in keyof CustomElements as `${Prefix}${Key}${Suffix}`]: CustomElements[Key];
20
+ };
21
+
22
+ type BaseProps = {
23
+ /** Content added between the opening and closing tags of the element */
24
+ children?: any;
25
+ /** Used for declaratively styling one or more elements using CSS (Cascading Stylesheets) */
26
+ class?: string;
27
+ /** Used for declaratively styling one or more elements using CSS (Cascading Stylesheets) */
28
+ className?: string;
29
+ /** Takes an object where the key is the class name(s) and the value is a boolean expression. When true, the class is applied, and when false, it is removed. */
30
+ classList?: Record<string, boolean | undefined>;
31
+ /** Specifies the text direction of the element. */
32
+ dir?: "ltr" | "rtl";
33
+ /** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
34
+ exportparts?: string;
35
+ /** For <label> and <output>, lets you associate the label with some control. */
36
+ htmlFor?: string;
37
+ /** Specifies whether the element should be hidden. */
38
+ hidden?: boolean | string;
39
+ /** A unique identifier for the element. */
40
+ id?: string;
41
+ /** Keys tell React which array item each component corresponds to */
42
+ key?: string | number;
43
+ /** Specifies the language of the element. */
44
+ lang?: string;
45
+ /** Contains a space-separated list of the part names of the element. Part names allows CSS to select and style specific elements in a shadow tree via the ::part pseudo-element. */
46
+ part?: string;
47
+ /** Use the ref attribute with a variable to assign a DOM element to the variable once the element is rendered. */
48
+ ref?: unknown | ((e: unknown) => void);
49
+ /** Adds a reference for a custom element slot */
50
+ slot?: string;
51
+ /** Prop for setting inline styles */
52
+ style?: Record<string, string | number>;
53
+ /** Overrides the default Tab button behavior. Avoid using values other than -1 and 0. */
54
+ tabIndex?: number;
55
+ /** Specifies the tooltip text for the element. */
56
+ title?: string;
57
+ /** Passing 'no' excludes the element content from being translated. */
58
+ translate?: "yes" | "no";
59
+ };
60
+
61
+ type BaseEvents = {};
62
+
63
+ export type NavProps = {
64
+ /** The icon to use in generated buttons. */
65
+ icon?: string;
66
+ /** The text content of the element, captured from light DOM before the first render. */
67
+ text?: string;
68
+
69
+ /** Programmatically remove focus from the component. */
70
+ onblur?: (e: CustomEvent<never>) => void;
71
+ };
72
+
73
+ export type CardProps = {
74
+ /** The card variant, used as a styling hook. */
75
+ variant?: string;
76
+ /** The text content of the element, captured from light DOM before the first render. */
77
+ text?: string;
78
+
79
+ /** Programmatically fire click on the component. */
80
+ onclick?: (e: CustomEvent<never>) => void;
81
+ /** Programmatically move focus to the component. */
82
+ onfocus?: (e: CustomEvent<never>) => void;
83
+ /** Programmatically remove focus from the component. */
84
+ onblur?: (e: CustomEvent<never>) => void;
85
+ };
86
+
87
+ export type CustomElements = {
88
+ /**
89
+ *
90
+ * ---
91
+ *
92
+ *
93
+ * ### **Events:**
94
+ * - **blur** - Programmatically remove focus from the component.
95
+ */
96
+ "incd-nav": Partial<NavProps & BaseProps & BaseEvents>;
97
+
98
+ /**
99
+ *
100
+ * ---
101
+ *
102
+ *
103
+ * ### **Events:**
104
+ * - **click** - Programmatically fire click on the component.
105
+ * - **focus** - Programmatically move focus to the component.
106
+ * - **blur** - Programmatically remove focus from the component.
107
+ *
108
+ * ### **CSS Properties:**
109
+ * - **--incd-card-outline-width** - Overrides the default outline width for the card's focus ring. _(default: undefined)_
110
+ * - **--incd-card-outline-style** - Overrides the default outline style for the card's focus ring. _(default: undefined)_
111
+ * - **--incd-card-outline-offset** - Overrides the default outline offset for the card's focus ring. _(default: undefined)_
112
+ * - **--incd-card-outline-color** - Overrides the default outline color for the card's focus ring. _(default: undefined)_
113
+ */
114
+ "incd-card": Partial<CardProps & BaseProps & BaseEvents>;
115
+ };
@@ -0,0 +1,302 @@
1
+ {
2
+ "schemaVersion": "1.0.0",
3
+ "readme": "",
4
+ "modules": [
5
+ {
6
+ "kind": "javascript-module",
7
+ "path": "src/index.js",
8
+ "declarations": [],
9
+ "exports": [
10
+ {
11
+ "kind": "js",
12
+ "name": "Nav",
13
+ "declaration": {
14
+ "name": "default",
15
+ "module": "./components/incd-nav/incd-nav.js"
16
+ }
17
+ }
18
+ ]
19
+ },
20
+ {
21
+ "kind": "javascript-module",
22
+ "path": "src/components/incd-nav/incd-nav.js",
23
+ "declarations": [
24
+ {
25
+ "kind": "class",
26
+ "description": "",
27
+ "name": "Nav",
28
+ "members": [
29
+ {
30
+ "kind": "field",
31
+ "name": "tagName",
32
+ "type": {
33
+ "text": "string"
34
+ },
35
+ "static": true,
36
+ "default": "'incd-nav'"
37
+ },
38
+ {
39
+ "kind": "field",
40
+ "name": "events",
41
+ "type": {
42
+ "text": "array"
43
+ },
44
+ "static": true,
45
+ "default": "['blur']"
46
+ },
47
+ {
48
+ "kind": "field",
49
+ "name": "props",
50
+ "type": {
51
+ "text": "array"
52
+ },
53
+ "static": true,
54
+ "default": "[{ name: 'icon', reflect: false }]"
55
+ },
56
+ {
57
+ "kind": "field",
58
+ "name": "#collapse",
59
+ "privacy": "private"
60
+ },
61
+ {
62
+ "kind": "field",
63
+ "name": "#onClick",
64
+ "privacy": "private"
65
+ },
66
+ {
67
+ "kind": "field",
68
+ "name": "#onDocumentClick",
69
+ "privacy": "private"
70
+ },
71
+ {
72
+ "kind": "field",
73
+ "name": "#onKeyUp",
74
+ "privacy": "private"
75
+ },
76
+ {
77
+ "kind": "field",
78
+ "name": "#onBlur",
79
+ "privacy": "private"
80
+ },
81
+ {
82
+ "kind": "field",
83
+ "name": "icon",
84
+ "default": "`<svg width=\"24\" height=\"25\" aria-hidden=\"true\" role=\"presentation\" fill=\"none\"> <path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"m6 9.5 6 6 6-6\"></path> </svg>`",
85
+ "description": "The icon to use in generated buttons.",
86
+ "type": {
87
+ "text": "string"
88
+ },
89
+ "attribute": "icon"
90
+ },
91
+ {
92
+ "kind": "field",
93
+ "name": "text",
94
+ "type": {
95
+ "text": "string"
96
+ },
97
+ "description": "The text content of the element, captured from light DOM before the first render.",
98
+ "attribute": "text"
99
+ }
100
+ ],
101
+ "events": [
102
+ {
103
+ "description": "Programmatically remove focus from the component.",
104
+ "name": "blur"
105
+ }
106
+ ],
107
+ "attributes": [
108
+ {
109
+ "name": "icon",
110
+ "fieldName": "icon",
111
+ "type": {
112
+ "text": "string"
113
+ },
114
+ "default": "`<svg width=\"24\" height=\"25\" aria-hidden=\"true\" role=\"presentation\" fill=\"none\"> <path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"m6 9.5 6 6 6-6\"></path> </svg>`",
115
+ "description": "The icon to use in generated buttons."
116
+ },
117
+ {
118
+ "name": "text",
119
+ "fieldName": "text",
120
+ "type": {
121
+ "text": "string"
122
+ },
123
+ "description": "The text content of the element, captured from light DOM before the first render."
124
+ }
125
+ ],
126
+ "mixins": [
127
+ {
128
+ "name": "Elena",
129
+ "package": "@elenajs/core"
130
+ }
131
+ ],
132
+ "superclass": {
133
+ "name": "HTMLElement"
134
+ },
135
+ "tagName": "incd-nav",
136
+ "status": "alpha",
137
+ "displayName": "Nav",
138
+ "customElement": true
139
+ }
140
+ ],
141
+ "exports": [
142
+ {
143
+ "kind": "js",
144
+ "name": "default",
145
+ "declaration": {
146
+ "name": "Nav",
147
+ "module": "src/components/incd-nav/incd-nav.js"
148
+ }
149
+ },
150
+ {
151
+ "kind": "custom-element-definition",
152
+ "name": "incd-nav",
153
+ "declaration": {
154
+ "name": "Nav",
155
+ "module": "src/components/incd-nav/incd-nav.js"
156
+ }
157
+ }
158
+ ]
159
+ },
160
+ {
161
+ "kind": "javascript-module",
162
+ "path": "src/components/incd-card/incd-card.js",
163
+ "declarations": [
164
+ {
165
+ "kind": "class",
166
+ "description": "",
167
+ "name": "Card",
168
+ "cssProperties": [
169
+ {
170
+ "description": "Overrides the default outline width for the card's focus ring.",
171
+ "name": "--incd-card-outline-width"
172
+ },
173
+ {
174
+ "description": "Overrides the default outline style for the card's focus ring.",
175
+ "name": "--incd-card-outline-style"
176
+ },
177
+ {
178
+ "description": "Overrides the default outline offset for the card's focus ring.",
179
+ "name": "--incd-card-outline-offset"
180
+ },
181
+ {
182
+ "description": "Overrides the default outline color for the card's focus ring.",
183
+ "name": "--incd-card-outline-color"
184
+ }
185
+ ],
186
+ "members": [
187
+ {
188
+ "kind": "field",
189
+ "name": "tagName",
190
+ "type": {
191
+ "text": "string"
192
+ },
193
+ "static": true,
194
+ "default": "'incd-card'"
195
+ },
196
+ {
197
+ "kind": "field",
198
+ "name": "events",
199
+ "type": {
200
+ "text": "array"
201
+ },
202
+ "static": true,
203
+ "default": "['click', 'focus', 'blur']"
204
+ },
205
+ {
206
+ "kind": "field",
207
+ "name": "props",
208
+ "type": {
209
+ "text": "array"
210
+ },
211
+ "static": true,
212
+ "default": "[ 'variant', ]"
213
+ },
214
+ {
215
+ "kind": "field",
216
+ "name": "variant",
217
+ "type": {
218
+ "text": "string"
219
+ },
220
+ "default": "''",
221
+ "description": "The card variant, used as a styling hook.",
222
+ "attribute": "variant"
223
+ },
224
+ {
225
+ "kind": "field",
226
+ "name": "text",
227
+ "type": {
228
+ "text": "string"
229
+ },
230
+ "description": "The text content of the element, captured from light DOM before the first render.",
231
+ "attribute": "text"
232
+ }
233
+ ],
234
+ "events": [
235
+ {
236
+ "description": "Programmatically fire click on the component.",
237
+ "name": "click"
238
+ },
239
+ {
240
+ "description": "Programmatically move focus to the component.",
241
+ "name": "focus"
242
+ },
243
+ {
244
+ "description": "Programmatically remove focus from the component.",
245
+ "name": "blur"
246
+ }
247
+ ],
248
+ "attributes": [
249
+ {
250
+ "name": "variant",
251
+ "fieldName": "variant",
252
+ "type": {
253
+ "text": "string"
254
+ },
255
+ "default": "''",
256
+ "description": "The card variant, used as a styling hook."
257
+ },
258
+ {
259
+ "name": "text",
260
+ "fieldName": "text",
261
+ "type": {
262
+ "text": "string"
263
+ },
264
+ "description": "The text content of the element, captured from light DOM before the first render."
265
+ }
266
+ ],
267
+ "mixins": [
268
+ {
269
+ "name": "Elena",
270
+ "package": "@elenajs/core"
271
+ }
272
+ ],
273
+ "superclass": {
274
+ "name": "HTMLElement"
275
+ },
276
+ "tagName": "incd-card",
277
+ "status": "alpha",
278
+ "displayName": "Card",
279
+ "customElement": true
280
+ }
281
+ ],
282
+ "exports": [
283
+ {
284
+ "kind": "js",
285
+ "name": "default",
286
+ "declaration": {
287
+ "name": "Card",
288
+ "module": "src/components/incd-card/incd-card.js"
289
+ }
290
+ },
291
+ {
292
+ "kind": "custom-element-definition",
293
+ "name": "incd-card",
294
+ "declaration": {
295
+ "name": "Card",
296
+ "module": "src/components/incd-card/incd-card.js"
297
+ }
298
+ }
299
+ ]
300
+ }
301
+ ]
302
+ }
@@ -0,0 +1,7 @@
1
+ const t="░█ [ELENA]: ",e=Array.isArray,s=Symbol("elena.raw"),n=e=>console.warn(t+e);const r={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function i(t){return e(t)?t.map(o).join(""):o(t)}function o(t){return t?.[s]?String(t):function(t){return String(t).replace(/[&<>"']/g,t=>r[t])}(t??"")}function a(t){return{[s]:!0,toString:()=>t??""}}const l={[s]:!0,toString:()=>""},h=t=>e(t)?t.some(t=>t?.[s]):!!t?.[s],c=t=>e(t)?t.join(""):String(t??"");function d(t){return t.replace(/(>)\n\s*|\n\s*(<)/g,"$1$2").replace(/\n\s*/g," ").replace(/>\s+</g,"><")}function p(t,e,s){if(e="boolean"===t&&"boolean"!=typeof e?null!==e:e,!s)return e;if("toAttribute"===s)switch(t){case"object":case"array":return e&&JSON.stringify(e);case"boolean":return e?"":null;default:return""===e?null:e}else switch(t){case"object":case"array":if(!e)return e;try{return JSON.parse(e)}catch{return n("Invalid JSON: "+e),null}case"number":return null!==e?+e:e;default:return e??""}}function u(t,e,s){t?null===s?t.removeAttribute(e):t.setAttribute(e,s):n("Cannot sync attrs.")}function f(t,e,s){for(const n of e){const e=!s||!s.has(n);Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return this._props?.get(n)},set(t){if(this._props||(this._props=new Map),t!==this._props.get(n)&&(this._props.set(n,t),this.isConnected))if(e){if(!this._syncing){const e=p(typeof t,t,"toAttribute");u(this,n,e)}}else this._hydrated&&!this._isRendering&&this._safeRender()}})}}const _=new WeakMap,m="e"+Math.random().toString(36).slice(2),g=()=>document.createElement("template"),y=t=>document.createTreeWalker(t,128);function b(t,s,n){return!function(t,s,n){if(t._templateStrings!==s||!t._templateParts)return!1;const r=t._templateParts,i=t._templateValues;for(let t=0;t<n.length;t++){const s=n[t],o=e(s)?c(s):s;if(o===i[t])continue;if(h(s)&&s!==l)return!1;const a=r[t];if(!a)return!1;i[t]=o;const d=String(o??"");a.nodeType?a.textContent=d:a[0].setAttribute(a[1],d)}return!0}(t,s,n)&&(function(t,s,n){let r=_.get(s);if(!r){const t=s.map(d);r={_strings:t,_template:n.length>0?v(t,n.length):null},_.set(s,r)}if(r._template)t._templateParts=function(t,s,n){const{_tpl:r,_attrs:o}=s,a=r.content.cloneNode(!0),d=y(a),p=Array(n.length),u=[];let f;for(;f=d.nextNode();)f.data===m&&u.push(f);let _=0;for(let t=0;t<n.length;t++){const s=o[t];if(s){const r=a.querySelector(`[${s}="${m+"_"+t}"]`);if(r){const i=n[t],o=String((e(i)?c(i):i)??"");r.setAttribute(s,o),p[t]=[r,s]}}else{const e=u[_++],s=n[t];if(h(s)&&s!==l){const t=g();t.innerHTML=i(s),e.parentNode.replaceChild(t.content,e)}else{const n=document.createTextNode(c(s));e.parentNode.replaceChild(n,e),p[t]=n}}}return t._templateStrings?(C(t,a.childNodes),null):(t.replaceChildren(a),p)}(t,r._template,n);else{const e=n.map(i),s=r._strings.reduce((t,s,n)=>t+s+(e[n]??""),"").replace(/>\s+</g,"><").trim(),o=g();o.innerHTML=s,C(t,o.content.childNodes),t._templateParts=null}t._templateStrings=s,t._templateValues=n.map(t=>e(t)?c(t):t)}(t,s,n),!0)}function v(t,e){const s=`\x3c!--${m}--\x3e`,n=[];let r="";for(let i=0;i<t.length;i++)if(r+=t[i],i<e){const e=t[i].match(/([^\s"'>/=]+)\s*=\s*["']$/);e?(n.push(e[1]),r+=m+"_"+i):(n.push(null),r+=s)}const i=g();i.innerHTML=r.trim();const o=y(i.content);let a=0;for(;o.nextNode();)o.currentNode.data===m&&a++;return a!==n.filter(t=>null===t).length?null:{_tpl:i,_attrs:n}}function C(t,e){const s=Array.from(t.childNodes),n=Array.from(e),r=Math.max(s.length,n.length);for(let e=0;e<r;e++){const r=s[e],i=n[e];r?i?r.nodeType!==i.nodeType||1===r.nodeType&&r.tagName!==i.tagName?t.replaceChild(i,r):3===r.nodeType?r.textContent!==i.textContent&&(r.textContent=i.textContent):1===r.nodeType&&(S(r,i),C(r,i.childNodes)):t.removeChild(r):t.appendChild(i)}}function S(t,e){for(let s=t.attributes.length-1;s>=0;s--){const{name:n}=t.attributes[s];e.hasAttribute(n)||t.removeAttribute(n)}for(let s=0;s<e.attributes.length;s++){const{name:n,value:r}=e.attributes[s];t.getAttribute(n)!==r&&t.setAttribute(n,r)}}
2
+ /**
3
+ * @elenajs/core v1.0.1
4
+ * (c) 2025-present Ariel Salminen and Elena contributors
5
+ * @license MIT
6
+ */const w=new WeakSet,x=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);function A(e){return class extends e{element=null;attributeChangedCallback(t,e,s){if(super.attributeChangedCallback?.(t,e,s),"text"!==t){if(e!==s)if(this._hydrated&&!this._isRendering){const e=this._props.get(t),n=typeof e,r="string"===n?s??"":p(n,s,"toProp");r!==e&&this._props.set(t,r),this._safeRender()}else this._syncing=!0,function(t,e,s,r){if(s!==r){const s=typeof t[e];"undefined"===s&&n(`Prop "${e}" has no default.`);const i=p(s,r,"toProp");t[e]=i}}(this,t,e,s),this._syncing=!1}else this.text=s??""}static get observedAttributes(){if(this._observedAttrs)return this._observedAttrs;const t=(this.props||[]).map(t=>"string"==typeof t?t:t.name);return this._observedAttrs=[...t,"text"],this._observedAttrs}connectedCallback(){super.connectedCallback?.(),this._setupStaticProps(),this._captureClassFieldDefaults(),this._hydrated||void 0!==this._text||(this.text=this.textContent.trim()),this._attachShadow(),this._root=this._shadow??this.shadowRoot??this,this._runUpdate??=()=>{try{this._performUpdate()}catch(e){console.error(t,e)}},this.willUpdate(),this._applyRender(),this._syncProps(),this._delegateEvents(),this._hydrated||(this._hydrated=!0,this.setAttribute("hydrated",""),this.firstUpdated()),this.updated()}_setupStaticProps(){const t=this.constructor;if(w.has(t))return;const e=new Set,s=[];if(t.props){for(const n of t.props)"string"==typeof n?s.push(n):(s.push(n.name),!1===n.reflect&&e.add(n.name));s.includes("text")&&n('"text" is reserved.'),f(t.prototype,s,e)}if(t._propNames=s,t._noReflect=e,t._elenaEvents=t.events||null,t._elenaEvents)for(const e of t._elenaEvents)x(t.prototype,e)||(t.prototype[e]=function(...t){return this.element[e](...t)});var r;t._resolver=(r=t.element)?t=>t.querySelector(r):t=>t.firstElementChild,w.add(t)}_captureClassFieldDefaults(){this._syncing=!0;for(const t of this.constructor._propNames)if(x(this,t)){const e=this[t];delete this[t],this[t]=e}this._syncing=!1}_attachShadow(){const t=this.constructor;if(!t.shadow)return;if(!this._shadow&&!this.shadowRoot){const e={mode:t.shadow};t.registry&&(e.customElementRegistry=t.registry),this._shadow=this.attachShadow(e)}const e=this._shadow??this.shadowRoot;if(t.styles){if(!t._adoptedSheets){const e=[t.styles].flat();t._adoptedSheets=e.map(t=>{if("string"==typeof t){const e=new CSSStyleSheet;return e.replaceSync(t),e}return t})}e.adoptedStyleSheets=t._adoptedSheets}}_applyRender(){const t=this.constructor,e=this._root,s=this.render();if(s&&s.strings&&b(e,s.strings,s.values)){const s=this.element;if(this.element=t._resolver(e),this._events&&s&&this.element!==s){const e=t._elenaEvents;for(const t of e)s.removeEventListener(t,this),this.element.addEventListener(t,this)}}this.element||(this.element=t._resolver(e),this.element||(t.element&&n("Element not found."),this.element=e.firstElementChild))}_syncProps(){if(this._props){const t=this.constructor._noReflect;for(const[e,s]of this._props){if(t.has(e))continue;const n=p(typeof s,s,"toAttribute");(null!==n||this.hasAttribute(e))&&u(this,e,n)}}}_delegateEvents(){const t=this.constructor._elenaEvents;if(!this._events&&t?.length)if(this.element){this._events=!0;for(const e of t)this.element.addEventListener(e,this)}else n("Cannot add events.")}render(){}willUpdate(){}firstUpdated(){}updated(){}adoptedCallback(){super.adoptedCallback?.()}disconnectedCallback(){if(super.disconnectedCallback?.(),this._events){this._events=!1;for(const t of this.constructor._elenaEvents)this.element?.removeEventListener(t,this)}}handleEvent(t){this.constructor._elenaEvents?.includes(t.type)&&(t.bubbles&&(t.composed||this._root===this)||this.dispatchEvent(new Event(t.type,{bubbles:t.bubbles})))}get text(){return this._text??""}set text(t){const e=this._text;this._text=t,this._hydrated&&e!==t&&!this._isRendering&&this._safeRender()}static define(t){const e=this.tagName;e?function(t,e,s){const n=s??globalThis.customElements;n?.get(t)||n?.define(t,e)}(e,this,t):n("define() without a tagName.")}_safeRender(){this._isRendering||this._renderPending||(this._renderPending=!0,queueMicrotask(this._runUpdate))}_performUpdate(){this._renderPending=!1;const t=this._resolveUpdate;this._resolveUpdate=null;try{try{this.willUpdate(),this._isRendering=!0,this._applyRender()}finally{this._isRendering=!1}this.updated()}finally{this._updateComplete=null,t?.()}}get updateComplete(){return this._renderPending?(this._updateComplete||(this._updateComplete=new Promise(t=>{this._resolveUpdate=t})),this._updateComplete):Promise.resolve()}requestUpdate(){this._hydrated&&!this._isRendering&&this._safeRender()}}}export{a as g,A as l,l as p};
7
+ //# sourceMappingURL=elena-DXSUJk9O.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"elena-DXSUJk9O.js","sources":["../node_modules/@elenajs/core/dist/utils.js","../node_modules/@elenajs/core/dist/props.js","../node_modules/@elenajs/core/dist/render.js","../node_modules/@elenajs/core/dist/elena.js"],"sourcesContent":["const t=\"░█ [ELENA]: \",n=Array.isArray,r=Symbol(\"elena.raw\"),s=n=>console.warn(t+n);function e(t,n,r){const s=r??globalThis.customElements;s?.get(t)||s?.define(t,n)}const o={\"&\":\"&amp;\",\"<\":\"&lt;\",\">\":\"&gt;\",'\"':\"&quot;\",\"'\":\"&#39;\"};function i(t){return String(t).replace(/[&<>\"']/g,t=>o[t])}function c(t){return n(t)?t.map(u).join(\"\"):u(t)}function u(t){return t?.[r]?String(t):i(t??\"\")}class l{constructor(t,n){this.strings=t,this.values=n}toString(){return null==this._str&&(this._str=this.strings.reduce((t,n,r)=>t+n+c(this.values[r]),\"\")),this._str}}function a(t,...n){return new l(t,n)}function g(t){return{[r]:!0,toString:()=>t??\"\"}}l.prototype[r]=!0;const p={[r]:!0,toString:()=>\"\"},f=t=>n(t)?t.some(t=>t?.[r]):!!t?.[r],h=t=>n(t)?t.join(\"\"):String(t??\"\");function S(t){return t.replace(/(>)\\n\\s*|\\n\\s*(<)/g,\"$1$2\").replace(/\\n\\s*/g,\" \").replace(/>\\s+</g,\"><\")}export{S as collapseWhitespace,e as defineElement,i as escapeHtml,a as html,n as isArray,f as isRaw,p as nothing,t as prefix,c as resolveValue,h as toPlainText,g as unsafeHTML,s as warn};\n","import{warn as t}from\"./utils.js\";function e(e,n,r){if(n=\"boolean\"===e&&\"boolean\"!=typeof n?null!==n:n,!r)return n;if(\"toAttribute\"===r)switch(e){case\"object\":case\"array\":return n&&JSON.stringify(n);case\"boolean\":return n?\"\":null;default:return\"\"===n?null:n}else switch(e){case\"object\":case\"array\":if(!n)return n;try{return JSON.parse(n)}catch{return t(\"Invalid JSON: \"+n),null}case\"number\":return null!==n?+n:n;default:return n??\"\"}}function n(e,n,r){e?null===r?e.removeAttribute(n):e.setAttribute(n,r):t(\"Cannot sync attrs.\")}function r(t,r,s){for(const o of r){const r=!s||!s.has(o);Object.defineProperty(t,o,{configurable:!0,enumerable:!0,get(){return this._props?.get(o)},set(t){if(this._props||(this._props=new Map),t!==this._props.get(o)&&(this._props.set(o,t),this.isConnected))if(r){if(!this._syncing){const r=e(typeof t,t,\"toAttribute\");n(this,o,r)}}else this._hydrated&&!this._isRendering&&this._safeRender()}})}}function s(n,r,s,o){if(s!==o){const s=typeof n[r];\"undefined\"===s&&t(`Prop \"${r}\" has no default.`);const i=e(s,o,\"toProp\");n[r]=i}}export{e as getPropValue,s as getProps,r as setProps,n as syncAttribute};\n","import{isArray as t,toPlainText as e,isRaw as n,nothing as r,collapseWhitespace as o,resolveValue as l}from\"./utils.js\";const s=new WeakMap,a=\"e\"+Math.random().toString(36).slice(2),c=()=>document.createElement(\"template\"),i=t=>document.createTreeWalker(t,128);function u(u,m,f){return!function(o,l,s){if(o._templateStrings!==l||!o._templateParts)return!1;const a=o._templateParts,c=o._templateValues;for(let o=0;o<s.length;o++){const l=s[o],i=t(l)?e(l):l;if(i===c[o])continue;if(n(l)&&l!==r)return!1;const u=a[o];if(!u)return!1;c[o]=i;const p=String(i??\"\");u.nodeType?u.textContent=p:u[0].setAttribute(u[1],p)}return!0}(u,m,f)&&(function(u,m,f){let h=s.get(m);if(!h){const t=m.map(o);h={_strings:t,_template:f.length>0?p(t,f.length):null},s.set(m,h)}if(h._template)u._templateParts=function(o,s,u){const{_tpl:p,_attrs:m}=s,f=p.content.cloneNode(!0),h=i(f),g=Array(u.length),_=[];let N;for(;N=h.nextNode();)N.data===a&&_.push(N);let x=0;for(let o=0;o<u.length;o++){const s=m[o];if(s){const n=f.querySelector(`[${s}=\"${a+\"_\"+o}\"]`);if(n){const r=u[o],l=String((t(r)?e(r):r)??\"\");n.setAttribute(s,l),g[o]=[n,s]}}else{const t=_[x++],s=u[o];if(n(s)&&s!==r){const e=c();e.innerHTML=l(s),t.parentNode.replaceChild(e.content,t)}else{const n=document.createTextNode(e(s));t.parentNode.replaceChild(n,t),g[o]=n}}}return o._templateStrings?(d(o,f.childNodes),null):(o.replaceChildren(f),g)}(u,h._template,f);else{const t=f.map(l),e=h._strings.reduce((e,n,r)=>e+n+(t[r]??\"\"),\"\").replace(/>\\s+</g,\"><\").trim(),n=c();n.innerHTML=e,d(u,n.content.childNodes),u._templateParts=null}u._templateStrings=m,u._templateValues=f.map(n=>t(n)?e(n):n)}(u,m,f),!0)}function p(t,e){const n=`\\x3c!--${a}--\\x3e`,r=[];let o=\"\";for(let l=0;l<t.length;l++)if(o+=t[l],l<e){const e=t[l].match(/([^\\s\"'>/=]+)\\s*=\\s*[\"']$/);e?(r.push(e[1]),o+=a+\"_\"+l):(r.push(null),o+=n)}const l=c();l.innerHTML=o.trim();const s=i(l.content);let u=0;for(;s.nextNode();)s.currentNode.data===a&&u++;return u!==r.filter(t=>null===t).length?null:{_tpl:l,_attrs:r}}function d(t,e){const n=Array.from(t.childNodes),r=Array.from(e),o=Math.max(n.length,r.length);for(let e=0;e<o;e++){const o=n[e],l=r[e];o?l?o.nodeType!==l.nodeType||1===o.nodeType&&o.tagName!==l.tagName?t.replaceChild(l,o):3===o.nodeType?o.textContent!==l.textContent&&(o.textContent=l.textContent):1===o.nodeType&&(m(o,l),d(o,l.childNodes)):t.removeChild(o):t.appendChild(l)}}function m(t,e){for(let n=t.attributes.length-1;n>=0;n--){const{name:r}=t.attributes[n];e.hasAttribute(r)||t.removeAttribute(r)}for(let n=0;n<e.attributes.length;n++){const{name:r,value:o}=e.attributes[n];t.getAttribute(r)!==o&&t.setAttribute(r,o)}}export{u as renderTemplate};\n","/**\n * @elenajs/core v1.0.1\n * (c) 2025-present Ariel Salminen and Elena contributors\n * @license MIT\n */\nimport{getPropValue as t,getProps as e,setProps as s,syncAttribute as i}from\"./props.js\";import{prefix as n,warn as r,defineElement as o}from\"./utils.js\";export{html,nothing,unsafeHTML}from\"./utils.js\";import{renderTemplate as h}from\"./render.js\";const a=new WeakSet,d=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);function l(l){return class extends l{element=null;attributeChangedCallback(s,i,n){if(super.attributeChangedCallback?.(s,i,n),\"text\"!==s){if(i!==n)if(this._hydrated&&!this._isRendering){const e=this._props.get(s),i=typeof e,r=\"string\"===i?n??\"\":t(i,n,\"toProp\");r!==e&&this._props.set(s,r),this._safeRender()}else this._syncing=!0,e(this,s,i,n),this._syncing=!1}else this.text=n??\"\"}static get observedAttributes(){if(this._observedAttrs)return this._observedAttrs;const t=(this.props||[]).map(t=>\"string\"==typeof t?t:t.name);return this._observedAttrs=[...t,\"text\"],this._observedAttrs}connectedCallback(){super.connectedCallback?.(),this._setupStaticProps(),this._captureClassFieldDefaults(),this._hydrated||void 0!==this._text||(this.text=this.textContent.trim()),this._attachShadow(),this._root=this._shadow??this.shadowRoot??this,this._runUpdate??=()=>{try{this._performUpdate()}catch(t){console.error(n,t)}},this.willUpdate(),this._applyRender(),this._syncProps(),this._delegateEvents(),this._hydrated||(this._hydrated=!0,this.setAttribute(\"hydrated\",\"\"),this.firstUpdated()),this.updated()}_setupStaticProps(){const t=this.constructor;if(a.has(t))return;const e=new Set,i=[];if(t.props){for(const s of t.props)\"string\"==typeof s?i.push(s):(i.push(s.name),!1===s.reflect&&e.add(s.name));i.includes(\"text\")&&r('\"text\" is reserved.'),s(t.prototype,i,e)}if(t._propNames=i,t._noReflect=e,t._elenaEvents=t.events||null,t._elenaEvents)for(const e of t._elenaEvents)d(t.prototype,e)||(t.prototype[e]=function(...t){return this.element[e](...t)});var n;t._resolver=(n=t.element)?t=>t.querySelector(n):t=>t.firstElementChild,a.add(t)}_captureClassFieldDefaults(){this._syncing=!0;for(const t of this.constructor._propNames)if(d(this,t)){const e=this[t];delete this[t],this[t]=e}this._syncing=!1}_attachShadow(){const t=this.constructor;if(!t.shadow)return;if(!this._shadow&&!this.shadowRoot){const e={mode:t.shadow};t.registry&&(e.customElementRegistry=t.registry),this._shadow=this.attachShadow(e)}const e=this._shadow??this.shadowRoot;if(t.styles){if(!t._adoptedSheets){const e=[t.styles].flat();t._adoptedSheets=e.map(t=>{if(\"string\"==typeof t){const e=new CSSStyleSheet;return e.replaceSync(t),e}return t})}e.adoptedStyleSheets=t._adoptedSheets}}_applyRender(){const t=this.constructor,e=this._root,s=this.render();if(s&&s.strings&&h(e,s.strings,s.values)){const s=this.element;if(this.element=t._resolver(e),this._events&&s&&this.element!==s){const e=t._elenaEvents;for(const t of e)s.removeEventListener(t,this),this.element.addEventListener(t,this)}}this.element||(this.element=t._resolver(e),this.element||(t.element&&r(\"Element not found.\"),this.element=e.firstElementChild))}_syncProps(){if(this._props){const e=this.constructor._noReflect;for(const[s,n]of this._props){if(e.has(s))continue;const r=t(typeof n,n,\"toAttribute\");(null!==r||this.hasAttribute(s))&&i(this,s,r)}}}_delegateEvents(){const t=this.constructor._elenaEvents;if(!this._events&&t?.length)if(this.element){this._events=!0;for(const e of t)this.element.addEventListener(e,this)}else r(\"Cannot add events.\")}render(){}willUpdate(){}firstUpdated(){}updated(){}adoptedCallback(){super.adoptedCallback?.()}disconnectedCallback(){if(super.disconnectedCallback?.(),this._events){this._events=!1;for(const t of this.constructor._elenaEvents)this.element?.removeEventListener(t,this)}}handleEvent(t){this.constructor._elenaEvents?.includes(t.type)&&(t.bubbles&&(t.composed||this._root===this)||this.dispatchEvent(new Event(t.type,{bubbles:t.bubbles})))}get text(){return this._text??\"\"}set text(t){const e=this._text;this._text=t,this._hydrated&&e!==t&&!this._isRendering&&this._safeRender()}static define(t){const e=this.tagName;e?o(e,this,t):r(\"define() without a tagName.\")}_safeRender(){this._isRendering||this._renderPending||(this._renderPending=!0,queueMicrotask(this._runUpdate))}_performUpdate(){this._renderPending=!1;const t=this._resolveUpdate;this._resolveUpdate=null;try{try{this.willUpdate(),this._isRendering=!0,this._applyRender()}finally{this._isRendering=!1}this.updated()}finally{this._updateComplete=null,t?.()}}get updateComplete(){return this._renderPending?(this._updateComplete||(this._updateComplete=new Promise(t=>{this._resolveUpdate=t})),this._updateComplete):Promise.resolve()}requestUpdate(){this._hydrated&&!this._isRendering&&this._safeRender()}}}export{l as Elena};\n"],"names":["t","n","Array","isArray","r","Symbol","s","console","warn","o","c","map","u","join","String","replace","i","g","r$1","toString","p","f","some","h","S","e","JSON","stringify","parse","removeAttribute","setAttribute","has","Object","defineProperty","configurable","enumerable","get","this","_props","set","Map","isConnected","_syncing","_hydrated","_isRendering","_safeRender","WeakMap","a","Math","random","slice","document","createElement","createTreeWalker","m","l","_templateStrings","_templateParts","_templateValues","length","nodeType","textContent","_strings","_template","_tpl","_attrs","content","cloneNode","_","N","nextNode","data","push","x","querySelector","innerHTML","parentNode","replaceChild","createTextNode","d","childNodes","replaceChildren","reduce","trim","match","currentNode","filter","from","max","tagName","removeChild","appendChild","attributes","name","hasAttribute","value","getAttribute","WeakSet","prototype","hasOwnProperty","call","element","attributeChangedCallback","super","text","observedAttributes","_observedAttrs","props","connectedCallback","_setupStaticProps","_captureClassFieldDefaults","_text","_attachShadow","_root","_shadow","shadowRoot","_runUpdate","_performUpdate","error","willUpdate","_applyRender","_syncProps","_delegateEvents","firstUpdated","updated","constructor","Set","reflect","add","includes","_propNames","_noReflect","_elenaEvents","events","_resolver","firstElementChild","shadow","mode","registry","customElementRegistry","attachShadow","styles","_adoptedSheets","flat","CSSStyleSheet","replaceSync","adoptedStyleSheets","render","strings","values","_events","removeEventListener","addEventListener","adoptedCallback","disconnectedCallback","handleEvent","type","bubbles","composed","dispatchEvent","Event","define","globalThis","customElements","_renderPending","queueMicrotask","_resolveUpdate","_updateComplete","updateComplete","Promise","resolve","requestUpdate"],"mappings":"AAAA,MAAMA,EAAE,eAAeC,EAAEC,MAAMC,QAAQC,EAAEC,OAAO,aAAaC,EAAEL,GAAGM,QAAQC,KAAKR,EAAEC,GAAoF,MAAMQ,EAAE,CAAC,IAAI,QAAQ,IAAI,OAAO,IAAI,OAAO,IAAI,SAAS,IAAI,SAAoE,SAASC,EAAEV,GAAG,OAAOC,EAAED,GAAGA,EAAEW,IAAIC,GAAGC,KAAK,IAAID,EAAEZ,EAAE,CAAC,SAASY,EAAEZ,GAAG,OAAOA,IAAII,GAAGU,OAAOd,GAA/I,SAAWA,GAAG,OAAOc,OAAOd,GAAGe,QAAQ,WAAWf,GAAGS,EAAET,GAAG,CAAwFgB,CAAEhB,GAAG,GAAG,CAA6M,SAASiB,EAAEjB,GAAG,MAAM,CAACkB,CAACd,IAAG,EAAGe,SAAS,IAAInB,GAAG,GAAG,CAAwB,MAACoB,EAAE,CAACF,CAACd,IAAG,EAAGe,SAAS,IAAI,IAAIE,EAAErB,GAAGC,EAAED,GAAGA,EAAEsB,KAAKtB,GAAGA,IAAII,MAAMJ,IAAII,GAAGmB,EAAEvB,GAAGC,EAAED,GAAGA,EAAEa,KAAK,IAAIC,OAAOd,GAAG,IAAI,SAASwB,EAAExB,GAAG,OAAOA,EAAEe,QAAQ,qBAAqB,QAAQA,QAAQ,SAAS,KAAKA,QAAQ,SAAS,KAAK,CCAl0B,SAASU,EAAEA,EAAExB,EAAEG,GAAG,GAAGH,EAAE,YAAYwB,GAAG,kBAAkBxB,EAAE,OAAOA,EAAEA,GAAGG,EAA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K,IAAI,IAAIjI,KAAKkF,aAAalF,KAAKO,cAAa,EAAGP,KAAKmF,cAAc,CAAC,QAAQnF,KAAKO,cAAa,CAAE,CAACP,KAAKuF,SAAS,CAAC,QAAQvF,KAAKkI,gBAAgB,KAAKvK,KAAK,CAAC,CAAC,kBAAIwK,GAAiB,OAAOnI,KAAK+H,gBAAgB/H,KAAKkI,kBAAkBlI,KAAKkI,gBAAgB,IAAIE,QAAQzK,IAAIqC,KAAKiI,eAAetK,KAAKqC,KAAKkI,iBAAiBE,QAAQC,SAAS,CAAC,aAAAC,GAAgBtI,KAAKM,YAAYN,KAAKO,cAAcP,KAAKQ,aAAa,EAAE","x_google_ignoreList":[0,1,2,3]}
@@ -0,0 +1 @@
1
+ incd-card{--_incd-card-outline-width:var(--incd-card-outline-width,2px);--_incd-card-outline-style:var(--incd-card-outline-style,solid);--_incd-card-outline-offset:var(--incd-card-outline-offset,1px);--_incd-card-outline-color:var(--incd-card-outline-color);display:block;position:relative}incd-card:focus-within{outline:var(--_incd-card-outline-width) var(--_incd-card-outline-style) var(--_incd-card-outline-color,Highlight);outline-color:var(--_incd-card-outline-color,-webkit-focus-ring-color);outline-offset:var(--_incd-card-outline-offset)}incd-card a:focus-visible{outline:none}incd-card a:after{content:"";display:block;position:absolute;inset:0}
@@ -0,0 +1,16 @@
1
+ export type { CardProps } from './custom-elements.js';
2
+
3
+ declare class Card extends HTMLElement {
4
+ /** The card variant, used as a styling hook. */
5
+ variant?: string;
6
+ /** The text content of the element, captured from light DOM before the first render. */
7
+ text?: string;
8
+ /** Programmatically fire click on the component. */
9
+ onclick?: (e: CustomEvent<never>) => void;
10
+ /** Programmatically move focus to the component. */
11
+ onfocus?: (e: CustomEvent<never>) => void;
12
+ /** Programmatically remove focus from the component. */
13
+ onblur?: (e: CustomEvent<never>) => void;
14
+ }
15
+
16
+ export default Card;
@@ -0,0 +1,2 @@
1
+ import{l as t}from"./elena-DXSUJk9O.js";class a extends(t(HTMLElement)){static tagName="incd-card";static events=["click","focus","blur"];static props=["variant"];variant=""}a.define();export{a as default};
2
+ //# sourceMappingURL=incd-card.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"incd-card.js","sources":["../src/components/incd-card/incd-card.js"],"sourcesContent":["import { Elena } from '@elenajs/core';\n\n/**\n * @displayName Card\n * @status alpha\n *\n * @event click - Programmatically fire click on the component.\n * @event focus - Programmatically move focus to the component.\n * @event blur - Programmatically remove focus from the component.\n * @cssprop [--incd-card-outline-width] - Overrides the default outline width for the card's focus ring.\n * @cssprop [--incd-card-outline-style] - Overrides the default outline style for the card's focus ring.\n * @cssprop [--incd-card-outline-offset] - Overrides the default outline offset for the card's focus ring.\n * @cssprop [--incd-card-outline-color] - Overrides the default outline color for the card's focus ring.\n */\nexport default class Card extends Elena(HTMLElement) {\n\tstatic tagName = 'incd-card';\n\tstatic events = ['click', 'focus', 'blur'];\n\tstatic props = [\n\t\t'variant',\n\t];\n\t/**\n\t * The card variant, used as a styling hook.\n\t * @property\n\t * @type {string}\n\t */\n\tvariant = '';\n}\n\nCard.define();\n"],"names":["Card","Elena","HTMLElement","static","variant","define"],"mappings":"wCAce,MAAMA,UAAaC,EAAMC,cACvCC,eAAiB,YACjBA,cAAgB,CAAC,QAAS,QAAS,QACnCA,aAAe,CACd,WAODC,QAAU,GAGXJ,EAAKK"}
@@ -0,0 +1 @@
1
+ incd-nav [aria-expanded=true] svg{transform:rotate(180deg)}incd-nav [aria-expanded=false]+*{display:none}incd-nav [aria-expanded=true]+*{display:revert}
@@ -0,0 +1,17 @@
1
+ export type { NavProps } from './custom-elements.js';
2
+
3
+ declare class Nav extends HTMLElement {
4
+ #collapse?: string;
5
+ #onClick?: string;
6
+ #onDocumentClick?: string;
7
+ #onKeyUp?: string;
8
+ #onBlur?: string;
9
+ /** The icon to use in generated buttons. */
10
+ icon?: string;
11
+ /** The text content of the element, captured from light DOM before the first render. */
12
+ text?: string;
13
+ /** Programmatically remove focus from the component. */
14
+ onblur?: (e: CustomEvent<never>) => void;
15
+ }
16
+
17
+ export default Nav;
@@ -0,0 +1,2 @@
1
+ import{l as e,p as t,g as n}from"./elena-DXSUJk9O.js";class o extends(e(HTMLElement)){static tagName="incd-nav";static events=["blur"];static props=[{name:"icon",reflect:!1}];#e=(e=!1)=>{const t=this.querySelector('[aria-expanded="true"]');e&&t?.focus(),t?.setAttribute("aria-expanded",!1)};#t=e=>{const t=e.target.closest("button"),n="true"===t.getAttribute("aria-expanded");n||this.#e(),t.setAttribute("aria-expanded",!n)};#n=e=>{e.target.closest("incd-nav [aria-expanded]")||this.#e()};#o=e=>{"Escape"===e.key&&this.#e(!0)};#s=e=>{e.target?.closest("li:has(ul)")!==e.relatedTarget?.closest("li:has(ul)")&&this.#e()};icon='<svg width="24" height="25" aria-hidden="true" role="presentation" fill="none">\n\t\t<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m6 9.5 6 6 6-6"></path>\n\t</svg>';connectedCallback(){const e=this.querySelectorAll(":scope li:has(ul) > a"),o=this.querySelectorAll("li:has(ul)");for(const o of e){const e=document.createElement("button"),s=Math.random().toString(36).slice(2,9);o.nextElementSibling.id=s,e.setAttribute("aria-expanded",!1),e.setAttribute("aria-label",o.textContent),e.setAttribute("aria-controls",s),e.innerHTML=this.icon?n(this.icon):t,o.after(e),e.addEventListener("click",this.#t)}for(const e of o){const t=e.querySelectorAll("a, button");for(const e of t)e.addEventListener("blur",this.#s)}document.addEventListener("click",this.#n),document.addEventListener("keyup",this.#o),super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback();const e=this.querySelectorAll("[aria-expanded]"),t=this.querySelectorAll("li:has(ul)");for(const t of e)t.removeEventListener("click",this.#t);for(const e of t){const t=e.querySelectorAll("a, button");for(const e of t)e.removeEventListener("blur",this.#s)}document.removeEventListener("click",this.#n),document.removeEventListener("keyup",this.#o)}}o.define();export{o as default};
2
+ //# sourceMappingURL=incd-nav.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"incd-nav.js","sources":["../src/components/incd-nav/incd-nav.js"],"sourcesContent":["import { Elena, unsafeHTML, nothing } from '@elenajs/core';\n\n/**\n * @displayName Nav\n * @status alpha\n *\n * @event blur - Programmatically remove focus from the component.\n */\nexport default class Nav extends Elena(HTMLElement) {\n\tstatic tagName = 'incd-nav';\n\tstatic events = ['blur'];\n\tstatic props = [{ name: 'icon', reflect: false }];\n\t#collapse = (shouldFocus = false) => {\n\t\tconst expandedMenuButton = this.querySelector('[aria-expanded=\"true\"]');\n\t\tif (shouldFocus) {\n\t\t\texpandedMenuButton?.focus();\n\t\t}\n\n\t\texpandedMenuButton?.setAttribute('aria-expanded', false);\n\t};\n\t#onClick = (event) => {\n\t\tconst button = event.target.closest('button');\n\t\tconst isAriaExpanded = (button.getAttribute('aria-expanded') === 'true');\n\t\tif (!isAriaExpanded) {\n\t\t\tthis.#collapse();\n\t\t}\n\n\t\tbutton.setAttribute('aria-expanded', !isAriaExpanded);\n\t};\n\t#onDocumentClick = (event) => {\n\t\tif (!event.target.closest('incd-nav [aria-expanded]')) {\n\t\t\tthis.#collapse();\n\t\t}\n\t};\n\t#onKeyUp = (event) => {\n\t\tif (event.key !== 'Escape') {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.#collapse(true);\n\t};\n\t#onBlur = (event) => {\n\t\tif (event.target?.closest('li:has(ul)') !== event.relatedTarget?.closest('li:has(ul)')) {\n\t\t\tthis.#collapse();\n\t\t}\n\t};\n\t/**\n\t * The icon to use in generated buttons.\n\t * @property\n\t * @type {string}\n\t */\n\ticon = `<svg width=\"24\" height=\"25\" aria-hidden=\"true\" role=\"presentation\" fill=\"none\">\n\t\t<path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"m6 9.5 6 6 6-6\"></path>\n\t</svg>`;\n\n\tconnectedCallback() {\n\t\tconst submenuLinks = this.querySelectorAll(':scope li:has(ul) > a');\n\t\tconst dropdownContainers = this.querySelectorAll('li:has(ul)');\n\n\t\tfor (const link of submenuLinks) {\n\t\t\tconst button = document.createElement('button');\n\t\t\tconst id = Math.random().toString(36).slice(2, 9);\n\t\t\tconst controlledElement = link.nextElementSibling;\n\t\t\tcontrolledElement.id = id;\n\t\t\tbutton.setAttribute('aria-expanded', false);\n\t\t\tbutton.setAttribute('aria-label', link.textContent);\n\t\t\tbutton.setAttribute('aria-controls', id);\n\t\t\tbutton.innerHTML = this.icon ? unsafeHTML(this.icon) : nothing;\n\t\t\tlink.after(button);\n\t\t\tbutton.addEventListener('click', this.#onClick);\n\t\t}\n\n\t\tfor (const container of dropdownContainers) {\n\t\t\tconst elements = container.querySelectorAll('a, button');\n\t\t\tfor (const element of elements) {\n\t\t\t\telement.addEventListener('blur', this.#onBlur);\n\t\t\t}\n\t\t}\n\n\t\tdocument.addEventListener('click', this.#onDocumentClick);\n\t\tdocument.addEventListener('keyup', this.#onKeyUp);\n\n\t\tsuper.connectedCallback();\n\t}\n\n\tdisconnectedCallback() {\n\t\tsuper.disconnectedCallback();\n\n\t\tconst buttons = this.querySelectorAll('[aria-expanded]');\n\t\tconst dropdownContainers = this.querySelectorAll('li:has(ul)');\n\n\t\tfor (const button of buttons) {\n\t\t\tbutton.removeEventListener('click', this.#onClick);\n\t\t}\n\n\t\tfor (const container of dropdownContainers) {\n\t\t\tconst elements = container.querySelectorAll('a, button');\n\t\t\tfor (const element of elements) {\n\t\t\t\telement.removeEventListener('blur', this.#onBlur);\n\t\t\t}\n\t\t}\n\n\t\tdocument.removeEventListener('click', this.#onDocumentClick);\n\t\tdocument.removeEventListener('keyup', this.#onKeyUp);\n\t}\n}\n\nNav.define();\n"],"names":["Nav","Elena","HTMLElement","static","name","reflect","collapse","shouldFocus","expandedMenuButton","this","querySelector","focus","setAttribute","onClick","event","button","target","closest","isAriaExpanded","getAttribute","onDocumentClick","onKeyUp","key","onBlur","relatedTarget","icon","connectedCallback","submenuLinks","querySelectorAll","dropdownContainers","link","document","createElement","id","Math","random","toString","slice","nextElementSibling","textContent","innerHTML","unsafeHTML","nothing","after","addEventListener","container","elements","element","super","disconnectedCallback","buttons","removeEventListener","define"],"mappings":"sDAQe,MAAMA,UAAYC,EAAMC,cACtCC,eAAiB,WACjBA,cAAgB,CAAC,QACjBA,aAAe,CAAC,CAAEC,KAAM,OAAQC,SAAS,IACzCC,GAAY,CAACC,GAAc,KAC1B,MAAMC,EAAqBC,KAAKC,cAAc,0BAC1CH,GACHC,GAAoBG,QAGrBH,GAAoBI,aAAa,iBAAiB,IAEnDC,GAAYC,IACX,MAAMC,EAASD,EAAME,OAAOC,QAAQ,UAC9BC,EAA2D,SAAzCH,EAAOI,aAAa,iBACvCD,GACJT,MAAKH,IAGNS,EAAOH,aAAa,iBAAkBM,IAEvCE,GAAoBN,IACdA,EAAME,OAAOC,QAAQ,6BACzBR,MAAKH,KAGPe,GAAYP,IACO,WAAdA,EAAMQ,KAIVb,MAAKH,GAAU,IAEhBiB,GAAWT,IACNA,EAAME,QAAQC,QAAQ,gBAAkBH,EAAMU,eAAeP,QAAQ,eACxER,MAAKH,KAQPmB,KAAO,wNAIP,iBAAAC,GACC,MAAMC,EAAelB,KAAKmB,iBAAiB,yBACrCC,EAAqBpB,KAAKmB,iBAAiB,cAEjD,IAAK,MAAME,KAAQH,EAAc,CAChC,MAAMZ,EAASgB,SAASC,cAAc,UAChCC,EAAKC,KAAKC,SAASC,SAAS,IAAIC,MAAM,EAAG,GACrBP,EAAKQ,mBACbL,GAAKA,EACvBlB,EAAOH,aAAa,iBAAiB,GACrCG,EAAOH,aAAa,aAAckB,EAAKS,aACvCxB,EAAOH,aAAa,gBAAiBqB,GACrClB,EAAOyB,UAAY/B,KAAKgB,KAAOgB,EAAWhC,KAAKgB,MAAQiB,EACvDZ,EAAKa,MAAM5B,GACXA,EAAO6B,iBAAiB,QAASnC,MAAKI,EACvC,CAEA,IAAK,MAAMgC,KAAahB,EAAoB,CAC3C,MAAMiB,EAAWD,EAAUjB,iBAAiB,aAC5C,IAAK,MAAMmB,KAAWD,EACrBC,EAAQH,iBAAiB,OAAQnC,MAAKc,EAExC,CAEAQ,SAASa,iBAAiB,QAASnC,MAAKW,GACxCW,SAASa,iBAAiB,QAASnC,MAAKY,GAExC2B,MAAMtB,mBACP,CAEA,oBAAAuB,GACCD,MAAMC,uBAEN,MAAMC,EAAUzC,KAAKmB,iBAAiB,mBAChCC,EAAqBpB,KAAKmB,iBAAiB,cAEjD,IAAK,MAAMb,KAAUmC,EACpBnC,EAAOoC,oBAAoB,QAAS1C,MAAKI,GAG1C,IAAK,MAAMgC,KAAahB,EAAoB,CAC3C,MAAMiB,EAAWD,EAAUjB,iBAAiB,aAC5C,IAAK,MAAMmB,KAAWD,EACrBC,EAAQI,oBAAoB,OAAQ1C,MAAKc,EAE3C,CAEAQ,SAASoB,oBAAoB,QAAS1C,MAAKW,GAC3CW,SAASoB,oBAAoB,QAAS1C,MAAKY,EAC5C,EAGDrB,EAAIoD"}
package/dist/index.js ADDED
@@ -0,0 +1,7 @@
1
+ /**
2
+ * @inclusive-design/components v0.1.0
3
+ * (c) 2026–present OCAD University
4
+ * @license BSD-3-Clause
5
+ */
6
+ export{default as Nav}from"./incd-nav.js";import"./elena-DXSUJk9O.js";
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
@@ -0,0 +1,19 @@
1
+ import pkg from './package.json' with { type: 'json' };
2
+
3
+ /**
4
+ * @type {import("@elenajs/bundler").ElenaConfig}
5
+ */
6
+ export default {
7
+ input: 'src',
8
+ output: {
9
+ dir: 'dist',
10
+ format: 'esm',
11
+ sourcemap: true,
12
+ },
13
+ bundle: 'src/index.js',
14
+ banner: `/**
15
+ * ${pkg.name} v${pkg.version}
16
+ * (c) 2026–present OCAD University
17
+ * @license BSD-3-Clause
18
+ */`,
19
+ };
package/package.json ADDED
@@ -0,0 +1,65 @@
1
+ {
2
+ "name": "@inclusive-design/components",
3
+ "version": "0.1.0",
4
+ "description": "Web components for the Inclusive Design Research Centre.",
5
+ "main": "dist/bundle.js",
6
+ "type": "module",
7
+ "scripts": {
8
+ "build": "rimraf dist && elena build",
9
+ "lint": "run-s -l lint:*",
10
+ "lint:eslint": "eslint",
11
+ "lint:markdownlint": "markdownlint-cli2 \"**/*.md\"",
12
+ "lint:stylelint": "stylelint \"**/*.css\"",
13
+ "prepare": "husky",
14
+ "prepublish": "npm run build",
15
+ "start:elena": "elena watch",
16
+ "start:serve": "serve .",
17
+ "start": "run-p start:*",
18
+ "test": "node --test"
19
+ },
20
+ "repository": {
21
+ "type": "git",
22
+ "url": "git+ssh://git@github.com/inclusive-design/components.git"
23
+ },
24
+ "keywords": [
25
+ "elena",
26
+ "web-components",
27
+ "inclusive-design"
28
+ ],
29
+ "author": "OCAD University <idrc@ocadu.ca>",
30
+ "license": "BSD-3-Clause",
31
+ "bugs": {
32
+ "url": "https://github.com/inclusive-design/components/issues"
33
+ },
34
+ "homepage": "https://github.com/inclusive-design/components#readme",
35
+ "dependencies": {
36
+ "@elenajs/core": "^1.0.0"
37
+ },
38
+ "devDependencies": {
39
+ "@commitlint/cli": "^21.0.0",
40
+ "@commitlint/config-conventional": "^21.0.0",
41
+ "@elenajs/bundler": "^1.0.0",
42
+ "@elenajs/cli": "^1.0.0",
43
+ "@inclusive-design/eslint-config": "^1.0.0",
44
+ "@inclusive-design/markdownlint-config": "^0.1.0",
45
+ "@inclusive-design/stylelint-config": "^0.1.0",
46
+ "eslint": "^10.0.0",
47
+ "husky": "^9.0.0",
48
+ "lint-staged": "^17.0.0",
49
+ "npm-run-all2": "^9.0.0",
50
+ "rimraf": "^6.0.0",
51
+ "serve": "^14.0.0"
52
+ },
53
+ "lint-staged": {
54
+ "*.css": [
55
+ "stylelint --fix"
56
+ ],
57
+ "*.{cjs,js,json,mjs}": [
58
+ "eslint --fix"
59
+ ],
60
+ "*.md": [
61
+ "eslint --fix",
62
+ "markdownlint-cli2 --fix"
63
+ ]
64
+ }
65
+ }