@elenajs/components 0.0.11 → 0.0.14
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/dist/bundle.css +1 -1
- package/dist/bundle.js +1 -1
- package/dist/bundle.js.map +1 -1
- package/dist/button.css +1 -1
- package/dist/button.js +1 -1
- package/dist/custom-elements.d.ts +8 -2
- package/dist/custom-elements.json +31 -2
- package/dist/{elena-BHyrmnQE.js → elena-D0LK8Koa.js} +2 -2
- package/dist/elena-D0LK8Koa.js.map +1 -0
- package/dist/index.js +1 -1
- package/dist/input.css +1 -1
- package/dist/input.js +1 -1
- package/dist/stack.css +2 -2
- package/dist/stack.d.ts +4 -1
- package/dist/stack.js +1 -1
- package/dist/stack.js.map +1 -1
- package/package.json +3 -3
- package/dist/elena-BHyrmnQE.js.map +0 -1
package/dist/bundle.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
elena-button{--elena-button-bg:transparent;--elena-button-text:#333;--elena-button-border:#f19c77;--elena-button-radius:10rem;--elena-button-font:sans-serif;all:unset;display:inline-
|
|
1
|
+
elena-button{--elena-button-bg:transparent;--elena-button-text:#333;--elena-button-border:#f19c77;--elena-button-radius:10rem;--elena-button-font:sans-serif;all:unset;display:inline-block}:is(elena-button:not(.elena-hydrated),.elena-button){all:unset;-webkit-appearance:none;appearance:none;display:inline-flex;-webkit-user-select:none;user-select:none;background:var(--elena-button-bg);color:var(--elena-button-text);border-radius:var(--elena-button-radius);border:2px solid var(--elena-button-border);font-family:var(--elena-button-font);font-weight:700;padding:0.75rem 1.25rem;cursor:pointer}elena-button:hover{opacity:0.8}elena-button:active{opacity:0.6}elena-button:focus-within{box-shadow:0 0 0 3px red}elena-button[disabled]{--elena-button-bg:#2b1c15;--elena-button-text:#fff;--elena-button-border:#2b1c15;opacity:0.3;pointer-events:none}elena-button[variant="primary"]{--elena-button-bg:#f19c77;--elena-button-text:#2b1c15}elena-button[variant="danger"]{--elena-button-text:red;--elena-button-border:red}elena-input{--elena-input-bg:transparent;--elena-input-text:#333;--elena-input-border:#333;--elena-input-radius:4px;--elena-input-font:sans-serif;all:unset;min-inline-size:300px;box-sizing:border-box;display:inline-block;flex-direction:column;gap:5px}:is(elena-input:not(.elena-hydrated),.elena-input){-webkit-appearance:none;appearance:none;display:inline-flex;-webkit-user-select:none;user-select:none;line-height:1;block-size:3rem;background:var(--elena-input-bg);color:var(--elena-input-text);border-radius:var(--elena-input-radius);border:1px solid var(--elena-input-border);font-family:var(--elena-input-font);font-weight:700;padding:0.75rem 1.25rem;cursor:text;position:relative}elena-input:not(.elena-hydrated){margin-block-start:1.82rem}elena-input:not(.elena-hydrated)::before{content:attr(label);position:absolute;font-weight:700;top:-1.78rem;left:-1px;display:block;inline-size:100%}elena-input:not(.elena-hydrated)::after{content:attr(placeholder);display:flex;align-items:center;block-size:100%;color:#aaa}elena-input .elena-input{font-size:100%;box-sizing:border-box;inline-size:100%}elena-input label{font-weight:700;display:block;block-size:1.5rem;margin:0;inline-size:100%}.elena-input-container{inline-size:100%}elena-input input:focus{box-shadow:0 0 0 1px red}elena-input input::placeholder{opacity:1;color:#aaa}elena-input[error]{--elena-input-border:red}elena-input .elena-error{color:red}elena-stack{display:flex;justify-content:flex-start;flex-flow:column wrap;gap:0.5rem}elena-stack[direction="row"]{flex-direction:row}
|
package/dist/bundle.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function e(e,t,n){if(t="boolean"===e&&"boolean"!=typeof t?null!==t:t,!n)return t;if("toAttribute"===n)switch(e){case"object":case"array":return null===t?null:JSON.stringify(t);case"boolean":return t?"":null;case"number":return null===t?null:t;default:return""===t?null:t}else switch(e){case"object":case"array":return t&&JSON.parse(t);case"boolean":default:return t;case"number":return null!==t?+t:t}}function t(e,t,n){e?null===n?e.removeAttribute(t):e.setAttribute(t,n):console.warn("░█ [ELENA]: Cannot sync attributes to a null element.")}let n=class extends Event{constructor(e,t){super(e,{bubbles:!0,composed:!0,...t})}};function s(e){const t={"&":"&","<":"<",">":">",'"':""","'":"'"};return String(e).replace(/[&<>"']/g,e=>t[e])}function r(e,...t){const n=e.reduce((e,n,r)=>e+n+s(String(t[r]??"")),"");return{__raw:!0,toString:()=>n}}function i(e,t,n){(function(e,t,n){if(e._tplStrings!==t||!e._tplParts)return!1;let r=!1;for(let t=0;t<n.length;t++){const i=n[t],l=i&&i.__raw,a=l?String(i):s(String(i??""));if(a!==e._tplValues[t])if(e._tplValues[t]=a,l)r=!0;else{const n=e._tplParts[t];n?n.textContent=String(i??""):r=!0}}return!r})(e,t,n)||function(e,t,n){const r=n.map(e=>e&&e.__raw?String(e):s(String(e??""))),i=t.reduce((e,t,n)=>e+t.replace(/\n\s*/g," ")+(r[n]??""),"").replace(/>\s+</g,"><").replace(/>\s+/g,">").replace(/\s+</g,"<").trim();(function(e,t){e?e.replaceChildren(e.ownerDocument.createRange().createContextualFragment(t)):console.warn("░█ [ELENA]: Cannot render to a null element.")})(e,i),e._tplStrings=t,e._tplValues=r,e._tplParts=function(e,t){const n=new Array(t.length),s=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);let r,i=0;for(;(r=s.nextNode())&&i<t.length;)r.textContent===t[i]&&(n[i]=r,i++);return n}(e,r)}(e,t,n)}function l(s,r){const l=r&&r.element?/^[a-z][a-z0-9-]*$/i.test(r.element)?e=>e.getElementsByClassName(r.element)[0]:e=>e.querySelector(r.element):e=>e.firstElementChild;class a extends s{element=null;attributeChangedCallback(t,n,s){(function(t,n,s,r){if(s!==r){const s=e(typeof t[n],r,"toProp");t[n]=s}})(this,t,n,s),this.
|
|
1
|
+
function e(e,t,n){if(t="boolean"===e&&"boolean"!=typeof t?null!==t:t,!n)return t;if("toAttribute"===n)switch(e){case"object":case"array":return null===t?null:JSON.stringify(t);case"boolean":return t?"":null;case"number":return null===t?null:t;default:return""===t?null:t}else switch(e){case"object":case"array":return t&&JSON.parse(t);case"boolean":default:return t;case"number":return null!==t?+t:t}}function t(e,t,n){e?null===n?e.removeAttribute(t):e.setAttribute(t,n):console.warn("░█ [ELENA]: Cannot sync attributes to a null element.")}let n=class extends Event{constructor(e,t){super(e,{bubbles:!0,composed:!0,...t})}};function s(e){const t={"&":"&","<":"<",">":">",'"':""","'":"'"};return String(e).replace(/[&<>"']/g,e=>t[e])}function r(e,...t){const n=e.reduce((e,n,r)=>e+n+s(String(t[r]??"")),"");return{__raw:!0,toString:()=>n}}function i(e,t,n){(function(e,t,n){if(e._tplStrings!==t||!e._tplParts)return!1;let r=!1;for(let t=0;t<n.length;t++){const i=n[t],l=i&&i.__raw,a=l?String(i):s(String(i??""));if(a!==e._tplValues[t])if(e._tplValues[t]=a,l)r=!0;else{const n=e._tplParts[t];n?n.textContent=String(i??""):r=!0}}return!r})(e,t,n)||function(e,t,n){const r=n.map(e=>e&&e.__raw?String(e):s(String(e??""))),i=t.reduce((e,t,n)=>e+t.replace(/\n\s*/g," ")+(r[n]??""),"").replace(/>\s+</g,"><").replace(/>\s+/g,">").replace(/\s+</g,"<").trim();(function(e,t){e?e.replaceChildren(e.ownerDocument.createRange().createContextualFragment(t)):console.warn("░█ [ELENA]: Cannot render to a null element.")})(e,i),e._tplStrings=t,e._tplValues=r,e._tplParts=function(e,t){const n=new Array(t.length),s=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);let r,i=0;for(;(r=s.nextNode())&&i<t.length;)r.textContent===t[i]&&(n[i]=r,i++);return n}(e,r)}(e,t,n)}function l(s,r){const l=r&&r.element?/^[a-z][a-z0-9-]*$/i.test(r.element)?e=>e.getElementsByClassName(r.element)[0]:e=>e.querySelector(r.element):e=>e.firstElementChild;class a extends s{element=null;attributeChangedCallback(t,n,s){(function(t,n,s,r){if(s!==r){const s=e(typeof t[n],r,"toProp");t[n]=s}})(this,t,n,s),this._hydrated&&n!==s&&!this._isRendering&&(this._isRendering=!0,this.render(),this._isRendering=!1)}static get observedAttributes(){return r&&r.props?r.props:[]}render(){}template(e,...t){i(this,e,t)}connectedCallback(){if(this.render(),this.element||(this.element=l(this),this.element||(r&&r.element&&console.warn("░█ [ELENA]: No element found, using firstElementChild as fallback."),this.element=this.firstElementChild)),this._props){const n=!(!r||!r.element);for(const[s,r]of this._props){const i=e(typeof r,r,"toAttribute");t(this,s,i),n&&t(this.element,s,i)}}!this._events&&r&&r.events&&(this._events=!0,r.events?.forEach(e=>{this.element.addEventListener(e,this),this[e]=(...t)=>this.element[e](...t)})),this.updated()}updated(){this._hydrated||(this._hydrated=!0,this.classList.add("elena-hydrated"))}disconnectedCallback(){this._events&&(this._events=!1,r.events?.forEach(e=>{this.element?.removeEventListener(e,this)}))}handleEvent(e){r.events?.includes(e.type)&&(e.stopPropagation(),this.dispatchEvent(new n(e.type,{cancelable:!0})))}}return r&&r.props?.length&&function(n,s,r=!0){for(const i of s)Object.defineProperty(n,i,{configurable:!0,enumerable:!0,get(){return this._props?this._props.get(i):void 0},set(n){if(this._props||(this._props=new Map),n===this._props.get(i))return;if(this._props.set(i,n),!this.isConnected)return;const s=e(typeof n,n,"toAttribute");t(this,i,s),r&&this.element&&t(this.element,i,s)}})}(a.prototype,r.props,!(!r||!r.element)),r&&r.tagName&&(a._tagName=r.tagName),a.define=function(){this._tagName&&function(e,t){"undefined"!=typeof window&&"customElements"in window&&(window.customElements.get(e)||window.customElements.define(e,t))}(this._tagName,this)},a}const a={tagName:"elena-button",props:["variant","size","disabled","name","value","type"],events:["click","focus","blur"],element:".elena-button"};class o extends(l(HTMLElement,a)){constructor(){super(),this.variant="default",this.size="md",this.disabled=!1,this.name="",this.value="",this.type="button"}render(){const e=this.textContent.trim();this.template`<button class="elena-button">${e}</button>`}}o.define();const c={tagName:"elena-input",props:["size","disabled","name","value","type","label","error","placeholder"],events:["click","focus","blur"],element:".elena-input"};class u extends(l(HTMLElement,c)){constructor(){super(),this.size="md",this.disabled=!1,this.name="",this.label="",this.value="",this.placeholder="",this.type="text",this.error=""}render(){this.template`<label for="input">${this.label}</label><div class="elena-input-container"><span class="elena-input-start"></span> <input id="input" class="elena-input"> <span class="elena-input-end"></span></div>${this.error?r`<div class="elena-error" role="alert">${this.error}</div>`:""}`}}u.define();const p={tagName:"elena-stack",props:["direction"]};class h extends(l(HTMLElement,p)){constructor(){super(),this.direction="column"}}h.define();export{o as Button,u as Input,h as Stack};
|
|
2
2
|
//# sourceMappingURL=bundle.js.map
|
package/dist/bundle.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundle.js","sources":["../../core/dist/props.js","../../core/dist/events.js","../../core/dist/utils.js","../../core/dist/render.js","../../core/dist/elena.js","../src/button/button.js","../src/input/input.js","../src/stack/stack.js"],"sourcesContent":["function t(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 null===e?null:JSON.stringify(e);case\"boolean\":return e?\"\":null;case\"number\":return null===e?null:e;default:return\"\"===e?null:e}else switch(t){case\"object\":case\"array\":return e&&JSON.parse(e);case\"boolean\":default:return e;case\"number\":return null!==e?+e:e}}function e(t,e,n){t?null===n?t.removeAttribute(e):t.setAttribute(e,n):console.warn(\"░█ [ELENA]: Cannot sync attributes to a null element.\")}function n(n,r){for(const o of r)Object.defineProperty(n,o,{configurable:!0,enumerable:!0,get(){return this._props?this._props.get(o):void 0},set(n){if(this._props||(this._props=new Map),n===this._props.get(o))return;if(this._props.set(o,n),!this.isConnected)return;const r=t(typeof n,n,\"toAttribute\");e(this,o,r),this.element&&e(this.element,o,r)}})}function r(e,n,r,o){if(r!==o){const r=t(typeof e[n],o,\"toProp\");e[n]=r}}export{t as getPropValue,r as getProps,n as setProps,e as syncAttribute};\n//# sourceMappingURL=props.js.map\n","class e extends Event{constructor(e,s){super(e,{bubbles:!0,composed:!0,...s})}}export{e as ElenaEvent};\n//# sourceMappingURL=events.js.map\n","function n(n,t){\"undefined\"!=typeof window&&\"customElements\"in window&&(window.customElements.get(n)||window.customElements.define(n,t))}function t(n){const t={\"&\":\"&\",\"<\":\"<\",\">\":\">\",'\"':\""\",\"'\":\"'\"};return String(n).replace(/[&<>\"']/g,n=>t[n])}function e(n,...e){const o=n.reduce((n,o,i)=>n+o+t(String(e[i]??\"\")),\"\");return{__raw:!0,toString:()=>o}}export{n as defineElement,t as escapeHtml,e as html};\n//# sourceMappingURL=utils.js.map\n","import{escapeHtml as t}from\"./utils.js\";function e(e,r,l){(function(e,n,r){if(e._tplStrings!==n||!e._tplParts)return!1;let l=!1;for(let n=0;n<r.length;n++){const o=r[n],a=o&&o.__raw,c=a?String(o):t(String(o??\"\"));if(c!==e._tplValues[n])if(e._tplValues[n]=c,a)l=!0;else{const t=e._tplParts[n];t?t.textContent=String(o??\"\"):l=!0}}return!l})(e,r,l)||function(e,r,l){const o=l.map(e=>e&&e.__raw?String(e):t(String(e??\"\"))),a=r.reduce((t,e,n)=>t+e.replace(/\\n\\s*/g,\" \")+(o[n]??\"\"),\"\").replace(/>\\s+</g,\"><\").replace(/>\\s+/g,\">\").replace(/\\s+</g,\"<\").trim();n(e,a),e._tplStrings=r,e._tplValues=o,e._tplParts=function(t,e){const n=new Array(e.length),r=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);let l,o=0;for(;(l=r.nextNode())&&o<e.length;)l.textContent===e[o]&&(n[o]=l,o++);return n}(e,o)}(e,r,l)}function n(t,e){t?t.replaceChildren(t.ownerDocument.createRange().createContextualFragment(e)):console.warn(\"░█ [ELENA]: Cannot render to a null element.\")}export{n as renderHtml,e as renderTemplate};\n//# sourceMappingURL=render.js.map\n","import{setProps as e,getProps as t,getPropValue as s,syncAttribute as n}from\"./props.js\";import{ElenaEvent as i}from\"./events.js\";import{defineElement as r}from\"./utils.js\";export{html}from\"./utils.js\";import{renderTemplate as h}from\"./render.js\";function l(l,a){const o=a&&a.element?/^[a-z][a-z0-9-]*$/i.test(a.element)?e=>e.getElementsByClassName(a.element)[0]:e=>e.querySelector(a.element):e=>e.firstElementChild;class m extends l{element=null;attributeChangedCallback(e,s,n){t(this,e,s,n),this.element&&s!==n&&!this._isRendering&&(this._isRendering=!0,this.render(),this._isRendering=!1)}static get observedAttributes(){return a&&a.props?a.props:[]}render(){}template(e,...t){h(this,e,t)}connectedCallback(){if(this.render(),this.element||(this.element=o(this),this.element||(console.warn(\"░█ [ELENA]: No element found, using firstElementChild as fallback.\"),this.element=this.firstElementChild)),this._props)for(const[e,t]of this._props){const i=s(typeof t,t,\"toAttribute\");n(this,e,i),n(this.element,e,i)}!this._events&&a&&a.events&&(this._events=!0,a.events?.forEach(e=>{this.element.addEventListener(e,this),this[e]=(...t)=>this.element[e](...t)})),this.updated()}updated(){this._hydrated||(this._hydrated=!0,this.classList.add(\"elena-hydrated\"))}disconnectedCallback(){this._events&&(this._events=!1,a.events?.forEach(e=>{this.element?.removeEventListener(e,this)}))}handleEvent(e){a.events?.includes(e.type)&&(e.stopPropagation(),this.dispatchEvent(new i(e.type,{cancelable:!0})))}}return a&&a.props?.length&&e(m.prototype,a.props),a&&a.tagName&&(m._tagName=a.tagName),m.define=function(){this._tagName&&r(this._tagName,this)},m}export{l as Elena};\n//# sourceMappingURL=elena.js.map\n","import { Elena } from \"@elenajs/core\";\n\nconst options = {\n tagName: \"elena-button\",\n props: [\"variant\", \"size\", \"disabled\", \"name\", \"value\", \"type\"],\n events: [\"click\", \"focus\", \"blur\"],\n element: \".elena-button\",\n};\n\n/**\n * Button component is used for interface actions.\n *\n * @displayName Button\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 *\n * @cssprop [--elena-button-color-text] - Controls the color of the text.\n * @cssprop [--elena-button-color-bg] - Controls the color of the background.\n * @cssprop [--elena-button-color-border] - Controls the color of the border.\n * @cssprop [--elena-button-radius] - Controls the radius of the component.\n */\nexport default class Button extends Elena(HTMLElement, options) {\n constructor() {\n super();\n\n /**\n * The style variant of the button.\n *\n * @attribute\n * @type {\"default\" | \"primary\" | \"danger\"}\n */\n this.variant = \"default\";\n\n /**\n * The size of the button.\n *\n * @attribute\n * @type {\"sm\" | \"md\" | \"lg\"}\n */\n this.size = \"md\";\n\n /**\n * Makes the component disabled.\n *\n * @attribute\n * @type {Boolean}\n */\n this.disabled = false;\n\n /**\n * The name used to identify the button in forms.\n *\n * @attribute\n * @type {string}\n */\n this.name = \"\";\n\n /**\n * The value used to identify the button in forms.\n *\n * @attribute\n * @type {string}\n */\n this.value = \"\";\n\n /**\n * The type of the button.\n *\n * @attribute\n * @type {\"submit\" | \"reset\" | \"button\"}\n */\n this.type = \"button\";\n }\n\n /**\n * Renders the template.\n *\n * @internal\n */\n render() {\n const slottedContent = this.textContent.trim();\n\n this.template`\n <button class=\"elena-button\">\n ${slottedContent}\n </button>\n `;\n }\n}\n\n/**\n * Register the web component\n */\nButton.define();\n","import { Elena, html } from \"@elenajs/core\";\n\nconst options = {\n tagName: \"elena-input\",\n props: [\"size\", \"disabled\", \"name\", \"value\", \"type\", \"label\", \"error\", \"placeholder\"],\n events: [\"click\", \"focus\", \"blur\"],\n element: \".elena-input\",\n};\n\n/**\n * The description of the component goes here.\n *\n * @displayName Input\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 *\n * @cssprop [--elena-input-color-text] - Controls the color of the text.\n * @cssprop [--elena-input-color-bg] - Controls the color of the background.\n * @cssprop [--elena-input-color-border] - Controls the color of the border.\n * @cssprop [--elena-input-radius] - Controls the radius of the component.\n */\nexport default class Input extends Elena(HTMLElement, options) {\n constructor() {\n super();\n\n /**\n * The size of the input.\n *\n * @attribute\n * @type {\"sm\" | \"md\" | \"lg\"}\n */\n this.size = \"md\";\n\n /**\n * Makes the component disabled.\n *\n * @attribute\n * @type {Boolean}\n */\n this.disabled = false;\n\n /**\n * The name used to identify the input in forms.\n *\n * @attribute\n * @type {string}\n */\n this.name = \"\";\n\n /**\n * The label for the input\n *\n * @attribute\n * @type {string}\n */\n this.label = \"\";\n\n /**\n * The value used to identify the input in forms.\n *\n * @attribute\n * @type {string}\n */\n this.value = \"\";\n\n /**\n * The placeholder text for the input.\n *\n * @attribute\n * @type {string}\n */\n this.placeholder = \"\";\n\n /**\n * The type of the input\n *\n * @attribute\n * @type {\"text\" | \"email\" | \"password\" | \"tel\" | \"url\" | \"search\" | \"number\" | \"unit\" | \"button\"}\n */\n this.type = \"text\";\n\n /**\n * The error to display\n *\n * @attribute\n * @type {string}\n */\n this.error = \"\";\n }\n\n /**\n * Renders the template.\n *\n * @internal\n */\n render() {\n this.template`\n <label for=\"input\">${this.label}</label>\n <div class=\"elena-input-container\">\n <span class=\"elena-input-start\"></span>\n <input\n id=\"input\"\n class=\"elena-input\"\n />\n <span class=\"elena-input-end\"></span>\n </div>\n ${this.error ? html`<div class=\"elena-error\" role=\"alert\">${this.error}</div>` : \"\"}\n `;\n }\n}\n\n/**\n * Register the web component\n */\nInput.define();\n","import { Elena } from \"@elenajs/core\";\n\nconst options = {\n element: \".elena-stack\",\n};\n\n/**\n * Stack component manages layout of immediate children\n * with optional spacing between each child.\n *\n * @displayName Stack\n * @status alpha\n */\nexport default class Stack extends Elena(HTMLElement, options) {\n constructor() {\n super();\n }\n}\n\n/**\n * Register the web component\n */\nStack.define();\n"],"names":["t","e","n","JSON","stringify","parse","removeAttribute","setAttribute","console","warn","e$2","Event","constructor","s","super","bubbles","composed","String","replace","o","reduce","i","__raw","toString","r","l","_tplStrings","_tplParts","length","a","c","_tplValues","textContent","map","trim","replaceChildren","ownerDocument","createRange","createContextualFragment","Array","document","createTreeWalker","NodeFilter","SHOW_TEXT","nextNode","element","test","getElementsByClassName","querySelector","firstElementChild","m","attributeChangedCallback","this","_isRendering","render","observedAttributes","props","template","h","connectedCallback","_props","_events","events","forEach","addEventListener","updated","_hydrated","classList","add","disconnectedCallback","removeEventListener","handleEvent","includes","type","stopPropagation","dispatchEvent","cancelable","Object","defineProperty","configurable","enumerable","get","set","Map","isConnected","prototype","tagName","_tagName","define","window","customElements","options","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oD,cAAgB,IAErF,EAMFH,EAAMb,SCnHN,MAAMG,EAAU,CACd9C,QAAS,gBAUI,MAAM6D,UAAcb,EAAMC,YAAaH,IACpD,WAAA/E,GACEE,OACF,EAMF4F,EAAMlB"}
|
|
1
|
+
{"version":3,"file":"bundle.js","sources":["../../core/dist/props.js","../../core/dist/events.js","../../core/dist/utils.js","../../core/dist/render.js","../../core/dist/elena.js","../src/button/button.js","../src/input/input.js","../src/stack/stack.js"],"sourcesContent":["function t(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 null===e?null:JSON.stringify(e);case\"boolean\":return e?\"\":null;case\"number\":return null===e?null:e;default:return\"\"===e?null:e}else switch(t){case\"object\":case\"array\":return e&&JSON.parse(e);case\"boolean\":default:return e;case\"number\":return null!==e?+e:e}}function e(t,e,n){t?null===n?t.removeAttribute(e):t.setAttribute(e,n):console.warn(\"░█ [ELENA]: Cannot sync attributes to a null element.\")}function n(n,r,o=!0){for(const s of r)Object.defineProperty(n,s,{configurable:!0,enumerable:!0,get(){return this._props?this._props.get(s):void 0},set(n){if(this._props||(this._props=new Map),n===this._props.get(s))return;if(this._props.set(s,n),!this.isConnected)return;const r=t(typeof n,n,\"toAttribute\");e(this,s,r),o&&this.element&&e(this.element,s,r)}})}function r(e,n,r,o){if(r!==o){const r=t(typeof e[n],o,\"toProp\");e[n]=r}}export{t as getPropValue,r as getProps,n as setProps,e as syncAttribute};\n//# sourceMappingURL=props.js.map\n","class e extends Event{constructor(e,s){super(e,{bubbles:!0,composed:!0,...s})}}export{e as ElenaEvent};\n//# sourceMappingURL=events.js.map\n","function n(n,t){\"undefined\"!=typeof window&&\"customElements\"in window&&(window.customElements.get(n)||window.customElements.define(n,t))}function t(n){const t={\"&\":\"&\",\"<\":\"<\",\">\":\">\",'\"':\""\",\"'\":\"'\"};return String(n).replace(/[&<>\"']/g,n=>t[n])}function e(n,...e){const o=n.reduce((n,o,i)=>n+o+t(String(e[i]??\"\")),\"\");return{__raw:!0,toString:()=>o}}export{n as defineElement,t as escapeHtml,e as html};\n//# sourceMappingURL=utils.js.map\n","import{escapeHtml as t}from\"./utils.js\";function e(e,r,l){(function(e,n,r){if(e._tplStrings!==n||!e._tplParts)return!1;let l=!1;for(let n=0;n<r.length;n++){const o=r[n],a=o&&o.__raw,c=a?String(o):t(String(o??\"\"));if(c!==e._tplValues[n])if(e._tplValues[n]=c,a)l=!0;else{const t=e._tplParts[n];t?t.textContent=String(o??\"\"):l=!0}}return!l})(e,r,l)||function(e,r,l){const o=l.map(e=>e&&e.__raw?String(e):t(String(e??\"\"))),a=r.reduce((t,e,n)=>t+e.replace(/\\n\\s*/g,\" \")+(o[n]??\"\"),\"\").replace(/>\\s+</g,\"><\").replace(/>\\s+/g,\">\").replace(/\\s+</g,\"<\").trim();n(e,a),e._tplStrings=r,e._tplValues=o,e._tplParts=function(t,e){const n=new Array(e.length),r=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);let l,o=0;for(;(l=r.nextNode())&&o<e.length;)l.textContent===e[o]&&(n[o]=l,o++);return n}(e,o)}(e,r,l)}function n(t,e){t?t.replaceChildren(t.ownerDocument.createRange().createContextualFragment(e)):console.warn(\"░█ [ELENA]: Cannot render to a null element.\")}export{n as renderHtml,e as renderTemplate};\n//# sourceMappingURL=render.js.map\n","import{setProps as e,getProps as t,getPropValue as s,syncAttribute as n}from\"./props.js\";import{ElenaEvent as i}from\"./events.js\";import{defineElement as r}from\"./utils.js\";export{html}from\"./utils.js\";import{renderTemplate as h}from\"./render.js\";function l(l,a){const o=a&&a.element?/^[a-z][a-z0-9-]*$/i.test(a.element)?e=>e.getElementsByClassName(a.element)[0]:e=>e.querySelector(a.element):e=>e.firstElementChild;class m extends l{element=null;attributeChangedCallback(e,s,n){t(this,e,s,n),this._hydrated&&s!==n&&!this._isRendering&&(this._isRendering=!0,this.render(),this._isRendering=!1)}static get observedAttributes(){return a&&a.props?a.props:[]}render(){}template(e,...t){h(this,e,t)}connectedCallback(){if(this.render(),this.element||(this.element=o(this),this.element||(a&&a.element&&console.warn(\"░█ [ELENA]: No element found, using firstElementChild as fallback.\"),this.element=this.firstElementChild)),this._props){const e=!(!a||!a.element);for(const[t,i]of this._props){const r=s(typeof i,i,\"toAttribute\");n(this,t,r),e&&n(this.element,t,r)}}!this._events&&a&&a.events&&(this._events=!0,a.events?.forEach(e=>{this.element.addEventListener(e,this),this[e]=(...t)=>this.element[e](...t)})),this.updated()}updated(){this._hydrated||(this._hydrated=!0,this.classList.add(\"elena-hydrated\"))}disconnectedCallback(){this._events&&(this._events=!1,a.events?.forEach(e=>{this.element?.removeEventListener(e,this)}))}handleEvent(e){a.events?.includes(e.type)&&(e.stopPropagation(),this.dispatchEvent(new i(e.type,{cancelable:!0})))}}return a&&a.props?.length&&e(m.prototype,a.props,!(!a||!a.element)),a&&a.tagName&&(m._tagName=a.tagName),m.define=function(){this._tagName&&r(this._tagName,this)},m}export{l as Elena};\n//# sourceMappingURL=elena.js.map\n","import { Elena } from \"@elenajs/core\";\n\nconst options = {\n tagName: \"elena-button\",\n props: [\"variant\", \"size\", \"disabled\", \"name\", \"value\", \"type\"],\n events: [\"click\", \"focus\", \"blur\"],\n element: \".elena-button\",\n};\n\n/**\n * Button component is used for interface actions.\n *\n * @displayName Button\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 *\n * @cssprop [--elena-button-color-text] - Controls the color of the text.\n * @cssprop [--elena-button-color-bg] - Controls the color of the background.\n * @cssprop [--elena-button-color-border] - Controls the color of the border.\n * @cssprop [--elena-button-radius] - Controls the radius of the component.\n */\nexport default class Button extends Elena(HTMLElement, options) {\n constructor() {\n super();\n\n /**\n * The style variant of the button.\n *\n * @attribute\n * @type {\"default\" | \"primary\" | \"danger\"}\n */\n this.variant = \"default\";\n\n /**\n * The size of the button.\n *\n * @attribute\n * @type {\"sm\" | \"md\" | \"lg\"}\n */\n this.size = \"md\";\n\n /**\n * Makes the component disabled.\n *\n * @attribute\n * @type {Boolean}\n */\n this.disabled = false;\n\n /**\n * The name used to identify the button in forms.\n *\n * @attribute\n * @type {string}\n */\n this.name = \"\";\n\n /**\n * The value used to identify the button in forms.\n *\n * @attribute\n * @type {string}\n */\n this.value = \"\";\n\n /**\n * The type of the button.\n *\n * @attribute\n * @type {\"submit\" | \"reset\" | \"button\"}\n */\n this.type = \"button\";\n }\n\n /**\n * Renders the template.\n *\n * @internal\n */\n render() {\n const slottedContent = this.textContent.trim();\n\n this.template`\n <button class=\"elena-button\">\n ${slottedContent}\n </button>\n `;\n }\n}\n\n/**\n * Register the web component\n */\nButton.define();\n","import { Elena, html } from \"@elenajs/core\";\n\nconst options = {\n tagName: \"elena-input\",\n props: [\"size\", \"disabled\", \"name\", \"value\", \"type\", \"label\", \"error\", \"placeholder\"],\n events: [\"click\", \"focus\", \"blur\"],\n element: \".elena-input\",\n};\n\n/**\n * The description of the component goes here.\n *\n * @displayName Input\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 *\n * @cssprop [--elena-input-color-text] - Controls the color of the text.\n * @cssprop [--elena-input-color-bg] - Controls the color of the background.\n * @cssprop [--elena-input-color-border] - Controls the color of the border.\n * @cssprop [--elena-input-radius] - Controls the radius of the component.\n */\nexport default class Input extends Elena(HTMLElement, options) {\n constructor() {\n super();\n\n /**\n * The size of the input.\n *\n * @attribute\n * @type {\"sm\" | \"md\" | \"lg\"}\n */\n this.size = \"md\";\n\n /**\n * Makes the component disabled.\n *\n * @attribute\n * @type {Boolean}\n */\n this.disabled = false;\n\n /**\n * The name used to identify the input in forms.\n *\n * @attribute\n * @type {string}\n */\n this.name = \"\";\n\n /**\n * The label for the input\n *\n * @attribute\n * @type {string}\n */\n this.label = \"\";\n\n /**\n * The value used to identify the input in forms.\n *\n * @attribute\n * @type {string}\n */\n this.value = \"\";\n\n /**\n * The placeholder text for the input.\n *\n * @attribute\n * @type {string}\n */\n this.placeholder = \"\";\n\n /**\n * The type of the input\n *\n * @attribute\n * @type {\"text\" | \"email\" | \"password\" | \"tel\" | \"url\" | \"search\" | \"number\" | \"unit\" | \"button\"}\n */\n this.type = \"text\";\n\n /**\n * The error to display\n *\n * @attribute\n * @type {string}\n */\n this.error = \"\";\n }\n\n /**\n * Renders the template.\n *\n * @internal\n */\n render() {\n this.template`\n <label for=\"input\">${this.label}</label>\n <div class=\"elena-input-container\">\n <span class=\"elena-input-start\"></span>\n <input\n id=\"input\"\n class=\"elena-input\"\n />\n <span class=\"elena-input-end\"></span>\n </div>\n ${this.error ? html`<div class=\"elena-error\" role=\"alert\">${this.error}</div>` : \"\"}\n `;\n }\n}\n\n/**\n * Register the web component\n */\nInput.define();\n","import { Elena } from \"@elenajs/core\";\n\nconst options = {\n tagName: \"elena-stack\",\n props: [\"direction\"],\n};\n\n/**\n * Stack component manages layout of immediate children\n * with optional spacing between each child.\n *\n * @displayName Stack\n * @slot - The stacked content\n * @status alpha\n */\nexport default class Stack extends Elena(HTMLElement, options) {\n constructor() {\n super();\n\n /**\n * The direction of the stack.\n *\n * @attribute\n * @type {\"column\" | \"row\"}\n */\n this.direction = \"column\";\n }\n}\n\n/**\n * Register the web component\n */\nStack.define();\n"],"names":["t","e","n","JSON","stringify","parse","removeAttribute","setAttribute","console","warn","e$2","Event","constructor","s","super","bubbles","composed","String","replace","o","reduce","i","__raw","toString","r","l","_tplStrings","_tplParts","length","a","c","_tplValues","textContent","map","trim","replaceChildren","ownerDocument","createRange","createContextualFragment","Array","document","createTreeWalker","NodeFilter","SHOW_TEXT","nextNode","element","test","getElementsByClassName","querySelector","firstElementChild","m","attributeChangedCallback","this","_hydrated","_isRendering","render","observedAttributes","props","template","h","connectedCallback","_props","_events","events","forEach","addEventListener","updated","classList","add","disconnectedCallback","removeEventListener","handleEvent","includes","type","stopPropagation","dispatchEvent","cancelable","Object","defineProperty","configurable","enumerable","get","set","Map","isConnected","prototype","tagName","_tagName","define","window","customElements","options","Button","Elena","HTMLElement","variant","size","disabled","name","value","slottedContent","Input","label","placeholder","error","html","Stack","direction"],"mappings":"AAAA,SAASA,EAAEA,EAAEC,EAAEC,GAAG,GAAGD,EAAE,YAAYD,GAAG,kBAAkBC,EAAE,OAAOA,EAAEA,GAAGC,EAAE,OAAOD,EAAE,GAAG,gBAAgBC,EAAE,OAAOF,GAAG,IAAI,SAAS,IAAI,QAAQ,OAAO,OAAOC,EAAE,KAAKE,KAAKC,UAAUH,GAAG,IAAI,UAAU,OAAOA,EAAE,GAAG,KAAK,IAAI,SAAS,OAAO,OAAOA,EAAE,KAAKA,EAAE,QAAQ,MAAM,KAAKA,EAAE,KAAKA,OAAO,OAAOD,GAAG,IAAI,SAAS,IAAI,QAAQ,OAAOC,GAAGE,KAAKE,MAAMJ,GAAG,IAAI,UAAU,QAAQ,OAAOA,EAAE,IAAI,SAAS,OAAO,OAAOA,GAAGA,EAAEA,EAAE,CAAC,SAASA,EAAED,EAAEC,EAAEC,GAAGF,EAAE,OAAOE,EAAEF,EAAEM,gBAAgBL,GAAGD,EAAEO,aAAaN,EAAEC,GAAGM,QAAQC,KAAK,wDAAwD,CCA5hB,IAAAC,EAAA,cAAgBC,MAAM,WAAAC,CAAYX,EAAEY,GAAGC,MAAMb,EAAE,CAACc,SAAQ,EAAGC,UAAS,KAAMH,GAAG,GCA4D,SAASb,EAAEE,GAAG,MAAMF,EAAE,CAAC,IAAI,QAAQ,IAAI,OAAO,IAAI,OAAO,IAAI,SAAS,IAAI,SAAS,OAAOiB,OAAOf,GAAGgB,QAAQ,WAAWhB,GAAGF,EAAEE,GAAG,CAAC,SAASD,EAAEC,KAAKD,GAAG,MAAMkB,EAAEjB,EAAEkB,OAAO,CAAClB,EAAEiB,EAAEE,IAAInB,EAAEiB,EAAEnB,EAAEiB,OAAOhB,EAAEoB,IAAI,KAAK,IAAI,MAAM,CAACC,OAAM,EA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K+C,MAAQ,GAQb/C,KAAKmD,YAAc,GAQnBnD,KAAKqB,KAAO,OAQZrB,KAAKoD,MAAQ,EACf,CAOA,MAAAjD,GACEH,KAAKM,QAAQ,sBACUN,KAAKkD,6KASxBlD,KAAKoD,MAAQC,CAAI,yCAAyCrD,KAAKoD,cAAgB,IAErF,EAMFH,EAAMb,SCnHN,MAAMG,EAAU,CACdL,QAAS,cACT7B,MAAO,CAAC,cAWK,MAAMiD,UAAcb,EAAMC,YAAaH,IACpD,WAAA/E,GACEE,QAQAsC,KAAKuD,UAAY,QACnB,EAMFD,EAAMlB"}
|
package/dist/button.css
CHANGED
package/dist/button.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{l as t}from"./elena-
|
|
1
|
+
import{l as t}from"./elena-D0LK8Koa.js";const e={tagName:"elena-button",props:["variant","size","disabled","name","value","type"],events:["click","focus","blur"],element:".elena-button"};class s extends(t(HTMLElement,e)){constructor(){super(),this.variant="default",this.size="md",this.disabled=!1,this.name="",this.value="",this.type="button"}render(){const t=this.textContent.trim();this.template`<button class="elena-button">${t}</button>`}}s.define();export{s as default};
|
|
2
2
|
//# sourceMappingURL=button.js.map
|
|
@@ -108,7 +108,10 @@ export type InputProps = {
|
|
|
108
108
|
onblur?: (e: CustomEvent<never>) => void;
|
|
109
109
|
};
|
|
110
110
|
|
|
111
|
-
export type StackProps = {
|
|
111
|
+
export type StackProps = {
|
|
112
|
+
/** The direction of the stack. */
|
|
113
|
+
direction?: "column" | "row";
|
|
114
|
+
};
|
|
112
115
|
|
|
113
116
|
export type CustomElements = {
|
|
114
117
|
/**
|
|
@@ -152,6 +155,9 @@ export type CustomElements = {
|
|
|
152
155
|
* with optional spacing between each child.
|
|
153
156
|
* ---
|
|
154
157
|
*
|
|
158
|
+
*
|
|
159
|
+
* ### **Slots:**
|
|
160
|
+
* - _default_ - The stacked content
|
|
155
161
|
*/
|
|
156
|
-
"elena-
|
|
162
|
+
"elena-stack": Partial<StackProps & BaseProps & BaseEvents>;
|
|
157
163
|
};
|
|
@@ -463,6 +463,35 @@
|
|
|
463
463
|
"kind": "class",
|
|
464
464
|
"description": "Stack component manages layout of immediate children\nwith optional spacing between each child.",
|
|
465
465
|
"name": "Stack",
|
|
466
|
+
"slots": [
|
|
467
|
+
{
|
|
468
|
+
"description": "The stacked content",
|
|
469
|
+
"name": ""
|
|
470
|
+
}
|
|
471
|
+
],
|
|
472
|
+
"members": [
|
|
473
|
+
{
|
|
474
|
+
"kind": "field",
|
|
475
|
+
"name": "direction",
|
|
476
|
+
"type": {
|
|
477
|
+
"text": "\"column\" | \"row\""
|
|
478
|
+
},
|
|
479
|
+
"description": "The direction of the stack.",
|
|
480
|
+
"default": "\"column\"",
|
|
481
|
+
"attribute": "direction"
|
|
482
|
+
}
|
|
483
|
+
],
|
|
484
|
+
"attributes": [
|
|
485
|
+
{
|
|
486
|
+
"name": "direction",
|
|
487
|
+
"type": {
|
|
488
|
+
"text": "\"column\" | \"row\""
|
|
489
|
+
},
|
|
490
|
+
"description": "The direction of the stack.",
|
|
491
|
+
"default": "\"column\"",
|
|
492
|
+
"fieldName": "direction"
|
|
493
|
+
}
|
|
494
|
+
],
|
|
466
495
|
"mixins": [
|
|
467
496
|
{
|
|
468
497
|
"name": "Elena",
|
|
@@ -472,7 +501,7 @@
|
|
|
472
501
|
"superclass": {
|
|
473
502
|
"name": "HTMLElement"
|
|
474
503
|
},
|
|
475
|
-
"tagName": "elena-
|
|
504
|
+
"tagName": "elena-stack",
|
|
476
505
|
"status": "alpha",
|
|
477
506
|
"displayName": "Stack",
|
|
478
507
|
"customElement": true
|
|
@@ -489,7 +518,7 @@
|
|
|
489
518
|
},
|
|
490
519
|
{
|
|
491
520
|
"kind": "custom-element-definition",
|
|
492
|
-
"name": "elena-
|
|
521
|
+
"name": "elena-stack",
|
|
493
522
|
"declaration": {
|
|
494
523
|
"name": "Stack",
|
|
495
524
|
"module": "src/stack/stack.js"
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function e(e,t,n){if(t="boolean"===e&&"boolean"!=typeof t?null!==t:t,!n)return t;if("toAttribute"===n)switch(e){case"object":case"array":return null===t?null:JSON.stringify(t);case"boolean":return t?"":null;case"number":return null===t?null:t;default:return""===t?null:t}else switch(e){case"object":case"array":return t&&JSON.parse(t);case"boolean":default:return t;case"number":return null!==t?+t:t}}function t(e,t,n){e?null===n?e.removeAttribute(t):e.setAttribute(t,n):console.warn("░█ [ELENA]: Cannot sync attributes to a null element.")}let n=class extends Event{constructor(e,t){super(e,{bubbles:!0,composed:!0,...t})}};function s(e){const t={"&":"&","<":"<",">":">",'"':""","'":"'"};return String(e).replace(/[&<>"']/g,e=>t[e])}function r(e,...t){const n=e.reduce((e,n,r)=>e+n+s(String(t[r]??"")),"");return{__raw:!0,toString:()=>n}}function i(e,t,n){(function(e,t,n){if(e._tplStrings!==t||!e._tplParts)return!1;let r=!1;for(let t=0;t<n.length;t++){const i=n[t],l=i&&i.__raw,o=l?String(i):s(String(i??""));if(o!==e._tplValues[t])if(e._tplValues[t]=o,l)r=!0;else{const n=e._tplParts[t];n?n.textContent=String(i??""):r=!0}}return!r})(e,t,n)||function(e,t,n){const r=n.map(e=>e&&e.__raw?String(e):s(String(e??""))),i=t.reduce((e,t,n)=>e+t.replace(/\n\s*/g," ")+(r[n]??""),"").replace(/>\s+</g,"><").replace(/>\s+/g,">").replace(/\s+</g,"<").trim();(function(e,t){e?e.replaceChildren(e.ownerDocument.createRange().createContextualFragment(t)):console.warn("░█ [ELENA]: Cannot render to a null element.")})(e,i),e._tplStrings=t,e._tplValues=r,e._tplParts=function(e,t){const n=new Array(t.length),s=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);let r,i=0;for(;(r=s.nextNode())&&i<t.length;)r.textContent===t[i]&&(n[i]=r,i++);return n}(e,r)}(e,t,n)}function l(s,r){const l=r&&r.element?/^[a-z][a-z0-9-]*$/i.test(r.element)?e=>e.getElementsByClassName(r.element)[0]:e=>e.querySelector(r.element):e=>e.firstElementChild;class o extends s{element=null;attributeChangedCallback(t,n,s){(function(t,n,s,r){if(s!==r){const s=e(typeof t[n],r,"toProp");t[n]=s}})(this,t,n,s),this.
|
|
2
|
-
//# sourceMappingURL=elena-
|
|
1
|
+
function e(e,t,n){if(t="boolean"===e&&"boolean"!=typeof t?null!==t:t,!n)return t;if("toAttribute"===n)switch(e){case"object":case"array":return null===t?null:JSON.stringify(t);case"boolean":return t?"":null;case"number":return null===t?null:t;default:return""===t?null:t}else switch(e){case"object":case"array":return t&&JSON.parse(t);case"boolean":default:return t;case"number":return null!==t?+t:t}}function t(e,t,n){e?null===n?e.removeAttribute(t):e.setAttribute(t,n):console.warn("░█ [ELENA]: Cannot sync attributes to a null element.")}let n=class extends Event{constructor(e,t){super(e,{bubbles:!0,composed:!0,...t})}};function s(e){const t={"&":"&","<":"<",">":">",'"':""","'":"'"};return String(e).replace(/[&<>"']/g,e=>t[e])}function r(e,...t){const n=e.reduce((e,n,r)=>e+n+s(String(t[r]??"")),"");return{__raw:!0,toString:()=>n}}function i(e,t,n){(function(e,t,n){if(e._tplStrings!==t||!e._tplParts)return!1;let r=!1;for(let t=0;t<n.length;t++){const i=n[t],l=i&&i.__raw,o=l?String(i):s(String(i??""));if(o!==e._tplValues[t])if(e._tplValues[t]=o,l)r=!0;else{const n=e._tplParts[t];n?n.textContent=String(i??""):r=!0}}return!r})(e,t,n)||function(e,t,n){const r=n.map(e=>e&&e.__raw?String(e):s(String(e??""))),i=t.reduce((e,t,n)=>e+t.replace(/\n\s*/g," ")+(r[n]??""),"").replace(/>\s+</g,"><").replace(/>\s+/g,">").replace(/\s+</g,"<").trim();(function(e,t){e?e.replaceChildren(e.ownerDocument.createRange().createContextualFragment(t)):console.warn("░█ [ELENA]: Cannot render to a null element.")})(e,i),e._tplStrings=t,e._tplValues=r,e._tplParts=function(e,t){const n=new Array(t.length),s=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);let r,i=0;for(;(r=s.nextNode())&&i<t.length;)r.textContent===t[i]&&(n[i]=r,i++);return n}(e,r)}(e,t,n)}function l(s,r){const l=r&&r.element?/^[a-z][a-z0-9-]*$/i.test(r.element)?e=>e.getElementsByClassName(r.element)[0]:e=>e.querySelector(r.element):e=>e.firstElementChild;class o extends s{element=null;attributeChangedCallback(t,n,s){(function(t,n,s,r){if(s!==r){const s=e(typeof t[n],r,"toProp");t[n]=s}})(this,t,n,s),this._hydrated&&n!==s&&!this._isRendering&&(this._isRendering=!0,this.render(),this._isRendering=!1)}static get observedAttributes(){return r&&r.props?r.props:[]}render(){}template(e,...t){i(this,e,t)}connectedCallback(){if(this.render(),this.element||(this.element=l(this),this.element||(r&&r.element&&console.warn("░█ [ELENA]: No element found, using firstElementChild as fallback."),this.element=this.firstElementChild)),this._props){const n=!(!r||!r.element);for(const[s,r]of this._props){const i=e(typeof r,r,"toAttribute");t(this,s,i),n&&t(this.element,s,i)}}!this._events&&r&&r.events&&(this._events=!0,r.events?.forEach(e=>{this.element.addEventListener(e,this),this[e]=(...t)=>this.element[e](...t)})),this.updated()}updated(){this._hydrated||(this._hydrated=!0,this.classList.add("elena-hydrated"))}disconnectedCallback(){this._events&&(this._events=!1,r.events?.forEach(e=>{this.element?.removeEventListener(e,this)}))}handleEvent(e){r.events?.includes(e.type)&&(e.stopPropagation(),this.dispatchEvent(new n(e.type,{cancelable:!0})))}}return r&&r.props?.length&&function(n,s,r=!0){for(const i of s)Object.defineProperty(n,i,{configurable:!0,enumerable:!0,get(){return this._props?this._props.get(i):void 0},set(n){if(this._props||(this._props=new Map),n===this._props.get(i))return;if(this._props.set(i,n),!this.isConnected)return;const s=e(typeof n,n,"toAttribute");t(this,i,s),r&&this.element&&t(this.element,i,s)}})}(o.prototype,r.props,!(!r||!r.element)),r&&r.tagName&&(o._tagName=r.tagName),o.define=function(){this._tagName&&function(e,t){"undefined"!=typeof window&&"customElements"in window&&(window.customElements.get(e)||window.customElements.define(e,t))}(this._tagName,this)},o}export{r as e,l};
|
|
2
|
+
//# sourceMappingURL=elena-D0LK8Koa.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"elena-D0LK8Koa.js","sources":["../../core/dist/props.js","../../core/dist/events.js","../../core/dist/utils.js","../../core/dist/render.js","../../core/dist/elena.js"],"sourcesContent":["function t(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 null===e?null:JSON.stringify(e);case\"boolean\":return e?\"\":null;case\"number\":return null===e?null:e;default:return\"\"===e?null:e}else switch(t){case\"object\":case\"array\":return e&&JSON.parse(e);case\"boolean\":default:return e;case\"number\":return null!==e?+e:e}}function e(t,e,n){t?null===n?t.removeAttribute(e):t.setAttribute(e,n):console.warn(\"░█ [ELENA]: Cannot sync attributes to a null element.\")}function n(n,r,o=!0){for(const s of r)Object.defineProperty(n,s,{configurable:!0,enumerable:!0,get(){return this._props?this._props.get(s):void 0},set(n){if(this._props||(this._props=new Map),n===this._props.get(s))return;if(this._props.set(s,n),!this.isConnected)return;const r=t(typeof n,n,\"toAttribute\");e(this,s,r),o&&this.element&&e(this.element,s,r)}})}function r(e,n,r,o){if(r!==o){const r=t(typeof e[n],o,\"toProp\");e[n]=r}}export{t as getPropValue,r as getProps,n as setProps,e as syncAttribute};\n//# sourceMappingURL=props.js.map\n","class e extends Event{constructor(e,s){super(e,{bubbles:!0,composed:!0,...s})}}export{e as ElenaEvent};\n//# sourceMappingURL=events.js.map\n","function n(n,t){\"undefined\"!=typeof window&&\"customElements\"in window&&(window.customElements.get(n)||window.customElements.define(n,t))}function t(n){const t={\"&\":\"&\",\"<\":\"<\",\">\":\">\",'\"':\""\",\"'\":\"'\"};return String(n).replace(/[&<>\"']/g,n=>t[n])}function e(n,...e){const o=n.reduce((n,o,i)=>n+o+t(String(e[i]??\"\")),\"\");return{__raw:!0,toString:()=>o}}export{n as defineElement,t as escapeHtml,e as html};\n//# sourceMappingURL=utils.js.map\n","import{escapeHtml as t}from\"./utils.js\";function e(e,r,l){(function(e,n,r){if(e._tplStrings!==n||!e._tplParts)return!1;let l=!1;for(let n=0;n<r.length;n++){const o=r[n],a=o&&o.__raw,c=a?String(o):t(String(o??\"\"));if(c!==e._tplValues[n])if(e._tplValues[n]=c,a)l=!0;else{const t=e._tplParts[n];t?t.textContent=String(o??\"\"):l=!0}}return!l})(e,r,l)||function(e,r,l){const o=l.map(e=>e&&e.__raw?String(e):t(String(e??\"\"))),a=r.reduce((t,e,n)=>t+e.replace(/\\n\\s*/g,\" \")+(o[n]??\"\"),\"\").replace(/>\\s+</g,\"><\").replace(/>\\s+/g,\">\").replace(/\\s+</g,\"<\").trim();n(e,a),e._tplStrings=r,e._tplValues=o,e._tplParts=function(t,e){const n=new Array(e.length),r=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);let l,o=0;for(;(l=r.nextNode())&&o<e.length;)l.textContent===e[o]&&(n[o]=l,o++);return n}(e,o)}(e,r,l)}function n(t,e){t?t.replaceChildren(t.ownerDocument.createRange().createContextualFragment(e)):console.warn(\"░█ [ELENA]: Cannot render to a null element.\")}export{n as renderHtml,e as renderTemplate};\n//# sourceMappingURL=render.js.map\n","import{setProps as e,getProps as t,getPropValue as s,syncAttribute as n}from\"./props.js\";import{ElenaEvent as i}from\"./events.js\";import{defineElement as r}from\"./utils.js\";export{html}from\"./utils.js\";import{renderTemplate as h}from\"./render.js\";function l(l,a){const o=a&&a.element?/^[a-z][a-z0-9-]*$/i.test(a.element)?e=>e.getElementsByClassName(a.element)[0]:e=>e.querySelector(a.element):e=>e.firstElementChild;class m extends l{element=null;attributeChangedCallback(e,s,n){t(this,e,s,n),this._hydrated&&s!==n&&!this._isRendering&&(this._isRendering=!0,this.render(),this._isRendering=!1)}static get observedAttributes(){return a&&a.props?a.props:[]}render(){}template(e,...t){h(this,e,t)}connectedCallback(){if(this.render(),this.element||(this.element=o(this),this.element||(a&&a.element&&console.warn(\"░█ [ELENA]: No element found, using firstElementChild as fallback.\"),this.element=this.firstElementChild)),this._props){const e=!(!a||!a.element);for(const[t,i]of this._props){const r=s(typeof i,i,\"toAttribute\");n(this,t,r),e&&n(this.element,t,r)}}!this._events&&a&&a.events&&(this._events=!0,a.events?.forEach(e=>{this.element.addEventListener(e,this),this[e]=(...t)=>this.element[e](...t)})),this.updated()}updated(){this._hydrated||(this._hydrated=!0,this.classList.add(\"elena-hydrated\"))}disconnectedCallback(){this._events&&(this._events=!1,a.events?.forEach(e=>{this.element?.removeEventListener(e,this)}))}handleEvent(e){a.events?.includes(e.type)&&(e.stopPropagation(),this.dispatchEvent(new i(e.type,{cancelable:!0})))}}return a&&a.props?.length&&e(m.prototype,a.props,!(!a||!a.element)),a&&a.tagName&&(m._tagName=a.tagName),m.define=function(){this._tagName&&r(this._tagName,this)},m}export{l as Elena};\n//# sourceMappingURL=elena.js.map\n"],"names":["t","e","n","JSON","stringify","parse","removeAttribute","setAttribute","console","warn","e$2","Event","constructor","s","super","bubbles","composed","String","replace","o","reduce","i","__raw","toString","r","l","_tplStrings","_tplParts","length","a","c","_tplValues","textContent","map","trim","replaceChildren","ownerDocument","createRange","createContextualFragment","Array","document","createTreeWalker","NodeFilter","SHOW_TEXT","nextNode","element","test","getElementsByClassName","querySelector","firstElementChild","m","attributeChangedCallback","this","_hydrated","_isRendering","render","observedAttributes","props","template","h","connectedCallback","_props","_events","events","forEach","addEventListener","updated","classList","add","disconnectedCallback","removeEventListener","handleEvent","includes","type","stopPropagation","dispatchEvent","cancelable","Object","defineProperty","configurable","enumerable","get","set","Map","isConnected","prototype","tagName","_tagName","define","window","customElements"],"mappings":"AAAA,SAASA,EAAEA,EAAEC,EAAEC,GAAG,GAAGD,EAAE,YAAYD,GAAG,kBAAkBC,EAAE,OAAOA,EAAEA,GAAGC,EAAE,OAAOD,EAAE,GAAG,gBAAgBC,EAAE,OAAOF,GAAG,IAAI,SAAS,IAAI,QAAQ,OAAO,OAAOC,EAAE,KAAKE,KAAKC,UAAUH,GAAG,IAAI,UAA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E,IAAIuF,OAAOC,eAAeF,OAAOtF,EAAEF,GAAG,CEAugDwB,CAAE4B,KAAKmC,SAASnC,KAAK,EAAEF,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{default as Button}from"./button.js";export{default as Input}from"./input.js";export{default as Stack}from"./stack.js";import"./elena-
|
|
1
|
+
export{default as Button}from"./button.js";export{default as Input}from"./input.js";export{default as Stack}from"./stack.js";import"./elena-D0LK8Koa.js";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/input.css
CHANGED
package/dist/input.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{l as e,e as s}from"./elena-
|
|
1
|
+
import{l as e,e as s}from"./elena-D0LK8Koa.js";const t={tagName:"elena-input",props:["size","disabled","name","value","type","label","error","placeholder"],events:["click","focus","blur"],element:".elena-input"};class l extends(e(HTMLElement,t)){constructor(){super(),this.size="md",this.disabled=!1,this.name="",this.label="",this.value="",this.placeholder="",this.type="text",this.error=""}render(){this.template`<label for="input">${this.label}</label><div class="elena-input-container"><span class="elena-input-start"></span> <input id="input" class="elena-input"> <span class="elena-input-end"></span></div>${this.error?s`<div class="elena-error" role="alert">${this.error}</div>`:""}`}}l.define();export{l as default};
|
|
2
2
|
//# sourceMappingURL=input.js.map
|
package/dist/stack.css
CHANGED
package/dist/stack.d.ts
CHANGED
package/dist/stack.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{l as e}from"./elena-
|
|
1
|
+
import{l as e}from"./elena-D0LK8Koa.js";const t={tagName:"elena-stack",props:["direction"]};class s extends(e(HTMLElement,t)){constructor(){super(),this.direction="column"}}s.define();export{s as default};
|
|
2
2
|
//# sourceMappingURL=stack.js.map
|
package/dist/stack.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stack.js","sources":["../src/stack/stack.js"],"sourcesContent":["import { Elena } from \"@elenajs/core\";\n\nconst options = {\n
|
|
1
|
+
{"version":3,"file":"stack.js","sources":["../src/stack/stack.js"],"sourcesContent":["import { Elena } from \"@elenajs/core\";\n\nconst options = {\n tagName: \"elena-stack\",\n props: [\"direction\"],\n};\n\n/**\n * Stack component manages layout of immediate children\n * with optional spacing between each child.\n *\n * @displayName Stack\n * @slot - The stacked content\n * @status alpha\n */\nexport default class Stack extends Elena(HTMLElement, options) {\n constructor() {\n super();\n\n /**\n * The direction of the stack.\n *\n * @attribute\n * @type {\"column\" | \"row\"}\n */\n this.direction = \"column\";\n }\n}\n\n/**\n * Register the web component\n */\nStack.define();\n"],"names":["options","tagName","props","Stack","Elena","HTMLElement","constructor","super","this","direction","define"],"mappings":"wCAEA,MAAMA,EAAU,CACdC,QAAS,cACTC,MAAO,CAAC,cAWK,MAAMC,UAAcC,EAAMC,YAAaL,IACpD,WAAAM,GACEC,QAQAC,KAAKC,UAAY,QACnB,EAMFN,EAAMO"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elenajs/components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.14",
|
|
4
4
|
"description": "Example Elena component library demonstrating how to build progressive web components.",
|
|
5
5
|
"author": "Ariel Salminen <info@arielsalminen.com>",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"analyze": "custom-elements-manifest analyze --config './elena.config.js'"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@elenajs/core": "^0.0.
|
|
36
|
+
"@elenajs/core": "^0.0.9"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@custom-elements-manifest/analyzer": "0.11.0",
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"rollup-plugin-minify-html-literals-v3": "^1.3.4",
|
|
47
47
|
"rollup-plugin-summary": "3.0.1"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "978994a9ea891b955506eae18920a2a3496245ba"
|
|
50
50
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"elena-BHyrmnQE.js","sources":["../../core/dist/props.js","../../core/dist/events.js","../../core/dist/utils.js","../../core/dist/render.js","../../core/dist/elena.js"],"sourcesContent":["function t(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 null===e?null:JSON.stringify(e);case\"boolean\":return e?\"\":null;case\"number\":return null===e?null:e;default:return\"\"===e?null:e}else switch(t){case\"object\":case\"array\":return e&&JSON.parse(e);case\"boolean\":default:return e;case\"number\":return null!==e?+e:e}}function e(t,e,n){t?null===n?t.removeAttribute(e):t.setAttribute(e,n):console.warn(\"░█ [ELENA]: Cannot sync attributes to a null element.\")}function n(n,r){for(const o of r)Object.defineProperty(n,o,{configurable:!0,enumerable:!0,get(){return this._props?this._props.get(o):void 0},set(n){if(this._props||(this._props=new Map),n===this._props.get(o))return;if(this._props.set(o,n),!this.isConnected)return;const r=t(typeof n,n,\"toAttribute\");e(this,o,r),this.element&&e(this.element,o,r)}})}function r(e,n,r,o){if(r!==o){const r=t(typeof e[n],o,\"toProp\");e[n]=r}}export{t as getPropValue,r as getProps,n as setProps,e as syncAttribute};\n//# sourceMappingURL=props.js.map\n","class e extends Event{constructor(e,s){super(e,{bubbles:!0,composed:!0,...s})}}export{e as ElenaEvent};\n//# sourceMappingURL=events.js.map\n","function n(n,t){\"undefined\"!=typeof window&&\"customElements\"in window&&(window.customElements.get(n)||window.customElements.define(n,t))}function t(n){const t={\"&\":\"&\",\"<\":\"<\",\">\":\">\",'\"':\""\",\"'\":\"'\"};return String(n).replace(/[&<>\"']/g,n=>t[n])}function e(n,...e){const o=n.reduce((n,o,i)=>n+o+t(String(e[i]??\"\")),\"\");return{__raw:!0,toString:()=>o}}export{n as defineElement,t as escapeHtml,e as html};\n//# sourceMappingURL=utils.js.map\n","import{escapeHtml as t}from\"./utils.js\";function e(e,r,l){(function(e,n,r){if(e._tplStrings!==n||!e._tplParts)return!1;let l=!1;for(let n=0;n<r.length;n++){const o=r[n],a=o&&o.__raw,c=a?String(o):t(String(o??\"\"));if(c!==e._tplValues[n])if(e._tplValues[n]=c,a)l=!0;else{const t=e._tplParts[n];t?t.textContent=String(o??\"\"):l=!0}}return!l})(e,r,l)||function(e,r,l){const o=l.map(e=>e&&e.__raw?String(e):t(String(e??\"\"))),a=r.reduce((t,e,n)=>t+e.replace(/\\n\\s*/g,\" \")+(o[n]??\"\"),\"\").replace(/>\\s+</g,\"><\").replace(/>\\s+/g,\">\").replace(/\\s+</g,\"<\").trim();n(e,a),e._tplStrings=r,e._tplValues=o,e._tplParts=function(t,e){const n=new Array(e.length),r=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);let l,o=0;for(;(l=r.nextNode())&&o<e.length;)l.textContent===e[o]&&(n[o]=l,o++);return n}(e,o)}(e,r,l)}function n(t,e){t?t.replaceChildren(t.ownerDocument.createRange().createContextualFragment(e)):console.warn(\"░█ [ELENA]: Cannot render to a null element.\")}export{n as renderHtml,e as renderTemplate};\n//# sourceMappingURL=render.js.map\n","import{setProps as e,getProps as t,getPropValue as s,syncAttribute as n}from\"./props.js\";import{ElenaEvent as i}from\"./events.js\";import{defineElement as r}from\"./utils.js\";export{html}from\"./utils.js\";import{renderTemplate as h}from\"./render.js\";function l(l,a){const o=a&&a.element?/^[a-z][a-z0-9-]*$/i.test(a.element)?e=>e.getElementsByClassName(a.element)[0]:e=>e.querySelector(a.element):e=>e.firstElementChild;class m extends l{element=null;attributeChangedCallback(e,s,n){t(this,e,s,n),this.element&&s!==n&&!this._isRendering&&(this._isRendering=!0,this.render(),this._isRendering=!1)}static get observedAttributes(){return a&&a.props?a.props:[]}render(){}template(e,...t){h(this,e,t)}connectedCallback(){if(this.render(),this.element||(this.element=o(this),this.element||(console.warn(\"░█ [ELENA]: No element found, using firstElementChild as fallback.\"),this.element=this.firstElementChild)),this._props)for(const[e,t]of this._props){const i=s(typeof t,t,\"toAttribute\");n(this,e,i),n(this.element,e,i)}!this._events&&a&&a.events&&(this._events=!0,a.events?.forEach(e=>{this.element.addEventListener(e,this),this[e]=(...t)=>this.element[e](...t)})),this.updated()}updated(){this._hydrated||(this._hydrated=!0,this.classList.add(\"elena-hydrated\"))}disconnectedCallback(){this._events&&(this._events=!1,a.events?.forEach(e=>{this.element?.removeEventListener(e,this)}))}handleEvent(e){a.events?.includes(e.type)&&(e.stopPropagation(),this.dispatchEvent(new i(e.type,{cancelable:!0})))}}return a&&a.props?.length&&e(m.prototype,a.props),a&&a.tagName&&(m._tagName=a.tagName),m.define=function(){this._tagName&&r(this._tagName,this)},m}export{l as Elena};\n//# sourceMappingURL=elena.js.map\n"],"names":["t","e","n","JSON","stringify","parse","removeAttribute","setAttribute","console","warn","e$2","Event","constructor","s","super","bubbles","composed","String","replace","o","reduce","i","__raw","toString","r","l","_tplStrings","_tplParts","length","a","c","_tplValues","textContent","map","trim","replaceChildren","ownerDocument","createRange","createContextualFragment","Array","document","createTreeWalker","NodeFilter","SHOW_TEXT","nextNode","element","test","getElementsByClassName","querySelector","firstElementChild","m","attributeChangedCallback","this","_isRendering","render","observedAttributes","props","template","h","connectedCallback","_props","_events","events","forEach","addEventListener","updated","_hydrated","classList","add","disconnectedCallback","removeEventListener","handleEvent","includes","type","stopPropagation","dispatchEvent","cancelable","Object","defineProperty","configurable","enumerable","get","set","Map","isConnected","prototype","tagName","_tagName","define","window","customElements"],"mappings":"AAAA,SAASA,EAAEA,EAAEC,EAAEC,GAAG,GAAGD,EAAE,YAAYD,GAAG,kBAAkBC,EAAE,OAAOA,EAAEA,GAAGC,EAAE,OAAOD,EAAE,GAAG,gBAAgBC,EAAE,OAAOF,GAAG,IAAI,SAAS,IAAI,QAAQ,OAAO,OAAOC,EAAE,KAAKE,KAAKC,UAAUH,GAAG,IAAI,UAAU,OAAOA,EAAE,GAAG,KAAK,IAAI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