@aevix/atom-headless 0.0.1

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/all.js ADDED
@@ -0,0 +1 @@
1
+ import{n as e,t}from"./chunks/atom-badge-CdXX-kOP.js";import{n,t as r}from"./chunks/atom-button-CGOr9UME.js";import{n as i,t as a}from"./chunks/atom-progress-BwNHdtje.js";import"./badge.js";import"./button.js";import"./progress.js";e(),n(),i();export{t as AtomBadge,r as AtomButton,a as AtomProgress,e as defineAtomBadge,n as defineAtomButton,i as defineAtomProgress};
package/dist/atom.css ADDED
@@ -0,0 +1 @@
1
+ atom-button,atom-badge,atom-progress{box-sizing:border-box;color:var(--atom-color,currentColor);font:var(--atom-font,inherit)}atom-button *,atom-badge *,atom-progress *{box-sizing:inherit}atom-button[hidden],atom-badge[hidden],atom-progress[hidden]{display:none!important}atom-button{--atom-button-bg:transparent;--atom-button-color:var(--atom-color,currentColor);--atom-button-border-color:currentColor;--atom-button-border-width:1px;--atom-button-radius:.5rem;--atom-button-padding-block:.5rem;--atom-button-padding-inline:.875rem;--atom-button-gap:.5rem;--atom-button-min-block-size:2.25rem;--atom-button-shadow:none;--atom-button-hover-bg:color-mix(in srgb, currentColor 8%, transparent);--atom-button-active-bg:color-mix(in srgb, currentColor 14%, transparent);--atom-button-focus-ring:0 0 0 3px color-mix(in srgb, currentColor 28%, transparent);--atom-button-disabled-opacity:.5;cursor:pointer;user-select:none;vertical-align:middle;-webkit-tap-highlight-color:transparent;outline:none;display:inline-flex}atom-button[disabled]{cursor:not-allowed;opacity:var(--atom-button-disabled-opacity)}atom-button::part(root){background:var(--atom-button-bg);border:var(--atom-button-border-width) solid var(--atom-button-border-color);border-radius:var(--atom-button-radius);box-shadow:var(--atom-button-shadow);color:var(--atom-button-color);align-items:center;gap:var(--atom-button-gap);inline-size:100%;min-block-size:var(--atom-button-min-block-size);padding:var(--atom-button-padding-block) var(--atom-button-padding-inline);justify-content:center;transition:background-color .12s,border-color .12s,box-shadow .12s,color .12s,transform 80ms;display:inline-flex}atom-button:hover:not([disabled])::part(root){background:var(--atom-button-hover-bg)}atom-button:active:not([disabled])::part(root){background:var(--atom-button-active-bg);transform:translateY(1px)}atom-button:focus-visible::part(root){box-shadow:var(--atom-button-shadow), var(--atom-button-focus-ring)}atom-button::part(left),atom-button::part(center),atom-button::part(right){display:inline-flex}atom-button::part(center){min-inline-size:0}atom-button::part(left),atom-button::part(right){flex:none}atom-button>*,atom-badge>*{box-sizing:border-box;color:inherit;font:inherit}atom-button>[slot=left],atom-button>[slot=right],atom-badge>[slot=left],atom-badge>[slot=right]{flex:none;display:inline-flex}atom-badge{--atom-badge-bg:color-mix(in srgb, currentColor 10%, transparent);--atom-badge-color:var(--atom-color,currentColor);--atom-badge-border-color:transparent;--atom-badge-border-width:1px;--atom-badge-radius:999px;--atom-badge-padding-block:.125rem;--atom-badge-padding-inline:.5rem;--atom-badge-gap:.25rem;--atom-badge-hover-bg:color-mix(in srgb, currentColor 16%, transparent);--atom-badge-focus-ring:0 0 0 3px color-mix(in srgb, currentColor 28%, transparent);vertical-align:middle;-webkit-tap-highlight-color:transparent;outline:none;display:inline-flex}atom-badge[href]{cursor:pointer}atom-badge::part(root){background:var(--atom-badge-bg);border:var(--atom-badge-border-width) solid var(--atom-badge-border-color);border-radius:var(--atom-badge-radius);color:var(--atom-badge-color);align-items:center;gap:var(--atom-badge-gap);min-inline-size:0;padding:var(--atom-badge-padding-block) var(--atom-badge-padding-inline);transition:background-color .12s,border-color .12s,box-shadow .12s,color .12s;display:inline-flex}atom-badge[href]:hover::part(root){background:var(--atom-badge-hover-bg)}atom-badge[href]:focus-visible::part(root){box-shadow:var(--atom-badge-focus-ring)}atom-badge::part(left),atom-badge::part(center),atom-badge::part(right){display:inline-flex}atom-badge::part(center){min-inline-size:0}atom-badge::part(left),atom-badge::part(right){flex:none}atom-progress{--atom-progress-block-size:.5rem;--atom-progress-track-bg:color-mix(in srgb, currentColor 14%, transparent);--atom-progress-fill-bg:currentColor;--atom-progress-radius:999px;--atom-progress-border-color:transparent;--atom-progress-border-width:0;--atom-progress-shadow:none;--atom-progress-indeterminate-size:40%;--atom-progress-disabled-opacity:.55;color:var(--atom-progress-color,var(--atom-color,currentColor));display:block}atom-progress[disabled]{opacity:var(--atom-progress-disabled-opacity)}atom-progress::part(track){background:var(--atom-progress-track-bg);border:var(--atom-progress-border-width) solid var(--atom-progress-border-color);border-radius:var(--atom-progress-radius);block-size:var(--atom-progress-block-size);box-shadow:var(--atom-progress-shadow);inline-size:100%;overflow:hidden}atom-progress::part(fill){background:var(--atom-progress-fill-bg);border-radius:inherit;block-size:100%;inline-size:var(--atom-progress-value,0%);transition:inline-size .16s}atom-progress[indeterminate]::part(fill){inline-size:var(--atom-progress-indeterminate-size);animation:1.2s ease-in-out infinite atom-progress-indeterminate}@keyframes atom-progress-indeterminate{0%{transform:translate(-100%)}50%{transform:translate(75%)}to{transform:translate(250%)}}
@@ -0,0 +1,8 @@
1
+ var AtomHeadlessBadge=(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e,t,n){if(n===!1||n==null){e.removeAttribute(t);return}if(n===!0){e.setAttribute(t,``);return}e.setAttribute(t,String(n))}var n=class extends HTMLElement{#e;#t=!1;#n;get internals(){return this.#e}get root(){return this.#n}constructor(){super(),this.#n=this.attachShadow({mode:`closed`}),this.#e=this.attachInternals()}connectedCallback(){this.#t||=(this.renderShadow(),!0),this.syncState()}attributeChangedCallback(){this.isConnected&&this.syncState()}aria(e,n,r){t(this,n,r),this.#e[e]=r}};function r(e,t,n,r={}){return e.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,...r,detail:n}))}function i(e,t,n){if(t!==null&&r(e,`atomnavigate`,t,{cancelable:!0})){if(n===`_self`){window.location.assign(t);return}window.open(t,n)}}var a=class extends n{static{this.observedAttributes=[`href`,`target`]}get href(){return this.getAttribute(`href`)}set href(e){t(this,`href`,e)}get target(){let e=this.getAttribute(`target`);return e===`_blank`||e===`_parent`||e===`_top`?e:`_self`}set target(e){t(this,`target`,e)}get#e(){return this.href!==null}constructor(){super(),this.addEventListener(`click`,this.#t),this.addEventListener(`keydown`,this.#n)}renderShadow(){this.root.innerHTML=`
2
+ <div part="root">
3
+ <!-- Default light DOM content is the center slot; side slots stay reserved for icon-like atoms. -->
4
+ <slot part="left" name="left"></slot>
5
+ <slot part="center"></slot>
6
+ <slot part="right" name="right"></slot>
7
+ </div>
8
+ `}syncState(){this.aria(`role`,`role`,this.#e?`link`:`note`),this.#e?this.tabIndex=0:this.removeAttribute(`tabindex`)}#t=()=>{this.#e&&i(this,this.href,this.target)};#n=e=>{!this.#e||e.key!==`Enter`||(e.preventDefault(),i(this,this.href,this.target))}};function o(e=`atom-badge`){typeof customElements>`u`||customElements.get(e)||customElements.define(e,a)}return o(),e.AtomBadge=a,e.defineAtomBadge=o,e})({});
package/dist/badge.js ADDED
@@ -0,0 +1 @@
1
+ import{n as e,t}from"./chunks/atom-badge-CdXX-kOP.js";e();export{t as AtomBadge,e as defineAtomBadge};
@@ -0,0 +1,19 @@
1
+ var AtomHeadless=(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e,t,n){if(n===!1||n==null){e.removeAttribute(t);return}if(n===!0){e.setAttribute(t,``);return}e.setAttribute(t,String(n))}var n=class extends HTMLElement{#e;#t=!1;#n;get internals(){return this.#e}get root(){return this.#n}constructor(){super(),this.#n=this.attachShadow({mode:`closed`}),this.#e=this.attachInternals()}connectedCallback(){this.#t||=(this.renderShadow(),!0),this.syncState()}attributeChangedCallback(){this.isConnected&&this.syncState()}aria(e,n,r){t(this,n,r),this.#e[e]=r}};function r(e,t,n,r={}){return e.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,...r,detail:n}))}function i(e,t,n){if(t!==null&&r(e,`atomnavigate`,t,{cancelable:!0})){if(n===`_self`){window.location.assign(t);return}window.open(t,n)}}var a=class extends n{static{this.observedAttributes=[`href`,`target`]}get href(){return this.getAttribute(`href`)}set href(e){t(this,`href`,e)}get target(){let e=this.getAttribute(`target`);return e===`_blank`||e===`_parent`||e===`_top`?e:`_self`}set target(e){t(this,`target`,e)}get#e(){return this.href!==null}constructor(){super(),this.addEventListener(`click`,this.#t),this.addEventListener(`keydown`,this.#n)}renderShadow(){this.root.innerHTML=`
2
+ <div part="root">
3
+ <!-- Default light DOM content is the center slot; side slots stay reserved for icon-like atoms. -->
4
+ <slot part="left" name="left"></slot>
5
+ <slot part="center"></slot>
6
+ <slot part="right" name="right"></slot>
7
+ </div>
8
+ `}syncState(){this.aria(`role`,`role`,this.#e?`link`:`note`),this.#e?this.tabIndex=0:this.removeAttribute(`tabindex`)}#t=()=>{this.#e&&i(this,this.href,this.target)};#n=e=>{!this.#e||e.key!==`Enter`||(e.preventDefault(),i(this,this.href,this.target))}};function o(e=`atom-badge`){typeof customElements>`u`||customElements.get(e)||customElements.define(e,a)}var s=class extends n{static{this.formAssociated=!0}static{this.observedAttributes=[`disabled`,`href`,`name`,`required`,`target`,`type`,`value`]}get disabled(){return this.hasAttribute(`disabled`)}set disabled(e){t(this,`disabled`,e)}get href(){return this.getAttribute(`href`)}set href(e){t(this,`href`,e)}get name(){return this.getAttribute(`name`)}set name(e){t(this,`name`,e)}get required(){return this.hasAttribute(`required`)}set required(e){t(this,`required`,e)}get target(){let e=this.getAttribute(`target`);return e===`_blank`||e===`_parent`||e===`_top`?e:`_self`}set target(e){t(this,`target`,e)}get type(){let e=this.getAttribute(`type`);return e===`submit`||e===`reset`?e:`button`}set type(e){t(this,`type`,e)}get value(){return this.getAttribute(`value`)}set value(e){t(this,`value`,e)}get#e(){return this.href!==null}constructor(){super(),this.addEventListener(`click`,this.#t),this.addEventListener(`keydown`,this.#n)}formDisabledCallback(e){this.aria(`ariaDisabled`,`aria-disabled`,e?`true`:null)}formResetCallback(){}formStateRestoreCallback(e,t){}renderShadow(){this.root.innerHTML=`
9
+ <div part="root">
10
+ <!-- Default light DOM content is the center slot; side slots stay reserved for icon-like atoms. -->
11
+ <slot name="left" part="left"></slot>
12
+ <slot part="center"></slot>
13
+ <slot name="right" part="right"></slot>
14
+ </div>
15
+ `}syncState(){this.aria(`role`,`role`,this.#e?`link`:`button`),this.aria(`ariaDisabled`,`aria-disabled`,this.disabled?`true`:null),this.tabIndex=this.disabled?-1:0}#t=e=>{if(this.disabled){e.preventDefault(),e.stopImmediatePropagation();return}this.#r()};#n=e=>{if(this.disabled){e.preventDefault(),e.stopImmediatePropagation();return}if(this.#e){if(e.key!==`Enter`)return}else if(e.key!==`Enter`&&e.key!==` `)return;e.preventDefault(),this.#r()};#r(){if(r(this,`atomclick`,this.value),this.#e){i(this,this.href,this.target);return}switch(this.type){case`submit`:this.internals.setFormValue(this.value??null),this.internals.form?.requestSubmit();break;case`reset`:this.internals.form?.reset();break}}};function c(e=`atom-button`){typeof customElements>`u`||customElements.get(e)||customElements.define(e,s)}var l=class extends n{static{this.observedAttributes=[`disabled`,`indeterminate`,`label`,`max`,`min`,`value`]}get disabled(){return this.hasAttribute(`disabled`)}set disabled(e){t(this,`disabled`,e)}get indeterminate(){return this.hasAttribute(`indeterminate`)}set indeterminate(e){t(this,`indeterminate`,e)}get label(){return this.getAttribute(`label`)??``}set label(e){t(this,`label`,e||null)}get max(){return this.#r(`max`,100)}set max(e){t(this,`max`,e)}get min(){return this.#r(`min`,0)}set min(e){t(this,`min`,e)}get value(){return this.#r(`value`,25)}set value(e){t(this,`value`,e)}get percent(){return Math.round(this.#n*100)/100}get#e(){return Number.isFinite(this.min)&&Number.isFinite(this.max)&&this.max>this.min}get#t(){return!Number.isFinite(this.value)||this.value<this.min?this.min:this.value>this.max?this.max:this.value}get#n(){return this.indeterminate||!this.#e?0:(this.#t-this.min)/(this.max-this.min)*100}renderShadow(){this.root.innerHTML=`
16
+ <div part="track">
17
+ <div part="fill"></div>
18
+ </div>
19
+ `}syncState(){if(this.aria(`role`,`role`,`progressbar`),this.indeterminate)this.aria(`ariaValueMin`,`aria-valuemin`,null),this.aria(`ariaValueNow`,`aria-valuenow`,null),this.aria(`ariaValueMax`,`aria-valuemax`,null),this.aria(`ariaValueText`,`aria-valuetext`,null);else{let e=this.#e?this.#t:this.min,t=this.#e?this.percent:0;this.aria(`ariaValueMin`,`aria-valuemin`,String(this.min)),this.aria(`ariaValueNow`,`aria-valuenow`,String(e)),this.aria(`ariaValueMax`,`aria-valuemax`,String(this.max)),this.aria(`ariaValueText`,`aria-valuetext`,`${t}% — ${e} of ${this.max} (range ${this.min}-${this.max})`)}this.aria(`ariaLabel`,`aria-label`,this.label||null),this.aria(`ariaDisabled`,`aria-disabled`,this.disabled?`true`:null),this.#i()}#r(e,t){let n=Number(this.getAttribute(e));return Number.isFinite(n)?n:t}#i(){if(this.indeterminate){this.style.removeProperty(`--atom-progress-value`);return}this.style.setProperty(`--atom-progress-value`,`${this.percent}%`)}};function u(e=`atom-progress`){typeof customElements>`u`||customElements.get(e)||customElements.define(e,l)}return o(),c(),u(),o(),c(),u(),e.AtomBadge=a,e.AtomButton=s,e.AtomProgress=l,e.defineAtomBadge=o,e.defineAtomButton=c,e.defineAtomProgress=u,e})({});
@@ -0,0 +1,8 @@
1
+ var AtomHeadlessButton=(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e,t,n){if(n===!1||n==null){e.removeAttribute(t);return}if(n===!0){e.setAttribute(t,``);return}e.setAttribute(t,String(n))}var n=class extends HTMLElement{#e;#t=!1;#n;get internals(){return this.#e}get root(){return this.#n}constructor(){super(),this.#n=this.attachShadow({mode:`closed`}),this.#e=this.attachInternals()}connectedCallback(){this.#t||=(this.renderShadow(),!0),this.syncState()}attributeChangedCallback(){this.isConnected&&this.syncState()}aria(e,n,r){t(this,n,r),this.#e[e]=r}};function r(e,t,n,r={}){return e.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,...r,detail:n}))}function i(e,t,n){if(t!==null&&r(e,`atomnavigate`,t,{cancelable:!0})){if(n===`_self`){window.location.assign(t);return}window.open(t,n)}}var a=class extends n{static{this.formAssociated=!0}static{this.observedAttributes=[`disabled`,`href`,`name`,`required`,`target`,`type`,`value`]}get disabled(){return this.hasAttribute(`disabled`)}set disabled(e){t(this,`disabled`,e)}get href(){return this.getAttribute(`href`)}set href(e){t(this,`href`,e)}get name(){return this.getAttribute(`name`)}set name(e){t(this,`name`,e)}get required(){return this.hasAttribute(`required`)}set required(e){t(this,`required`,e)}get target(){let e=this.getAttribute(`target`);return e===`_blank`||e===`_parent`||e===`_top`?e:`_self`}set target(e){t(this,`target`,e)}get type(){let e=this.getAttribute(`type`);return e===`submit`||e===`reset`?e:`button`}set type(e){t(this,`type`,e)}get value(){return this.getAttribute(`value`)}set value(e){t(this,`value`,e)}get#e(){return this.href!==null}constructor(){super(),this.addEventListener(`click`,this.#t),this.addEventListener(`keydown`,this.#n)}formDisabledCallback(e){this.aria(`ariaDisabled`,`aria-disabled`,e?`true`:null)}formResetCallback(){}formStateRestoreCallback(e,t){}renderShadow(){this.root.innerHTML=`
2
+ <div part="root">
3
+ <!-- Default light DOM content is the center slot; side slots stay reserved for icon-like atoms. -->
4
+ <slot name="left" part="left"></slot>
5
+ <slot part="center"></slot>
6
+ <slot name="right" part="right"></slot>
7
+ </div>
8
+ `}syncState(){this.aria(`role`,`role`,this.#e?`link`:`button`),this.aria(`ariaDisabled`,`aria-disabled`,this.disabled?`true`:null),this.tabIndex=this.disabled?-1:0}#t=e=>{if(this.disabled){e.preventDefault(),e.stopImmediatePropagation();return}this.#r()};#n=e=>{if(this.disabled){e.preventDefault(),e.stopImmediatePropagation();return}if(this.#e){if(e.key!==`Enter`)return}else if(e.key!==`Enter`&&e.key!==` `)return;e.preventDefault(),this.#r()};#r(){if(r(this,`atomclick`,this.value),this.#e){i(this,this.href,this.target);return}switch(this.type){case`submit`:this.internals.setFormValue(this.value??null),this.internals.form?.requestSubmit();break;case`reset`:this.internals.form?.reset();break}}};function o(e=`atom-button`){typeof customElements>`u`||customElements.get(e)||customElements.define(e,a)}return o(),e.AtomButton=a,e.defineAtomButton=o,e})({});
package/dist/button.js ADDED
@@ -0,0 +1 @@
1
+ import{n as e,t}from"./chunks/atom-button-CGOr9UME.js";e();export{t as AtomButton,e as defineAtomButton};
@@ -0,0 +1,8 @@
1
+ import{n as e,t}from"./atom-element-CFvcGv3e.js";import{n}from"./events-M1ozXrXC.js";var r=class extends t{static{this.observedAttributes=[`href`,`target`]}get href(){return this.getAttribute(`href`)}set href(t){e(this,`href`,t)}get target(){let e=this.getAttribute(`target`);return e===`_blank`||e===`_parent`||e===`_top`?e:`_self`}set target(t){e(this,`target`,t)}get#e(){return this.href!==null}constructor(){super(),this.addEventListener(`click`,this.#t),this.addEventListener(`keydown`,this.#n)}renderShadow(){this.root.innerHTML=`
2
+ <div part="root">
3
+ <!-- Default light DOM content is the center slot; side slots stay reserved for icon-like atoms. -->
4
+ <slot part="left" name="left"></slot>
5
+ <slot part="center"></slot>
6
+ <slot part="right" name="right"></slot>
7
+ </div>
8
+ `}syncState(){this.aria(`role`,`role`,this.#e?`link`:`note`),this.#e?this.tabIndex=0:this.removeAttribute(`tabindex`)}#t=()=>{this.#e&&n(this,this.href,this.target)};#n=e=>{!this.#e||e.key!==`Enter`||(e.preventDefault(),n(this,this.href,this.target))}};function i(e=`atom-badge`){typeof customElements>`u`||customElements.get(e)||customElements.define(e,r)}export{i as n,r as t};
@@ -0,0 +1,8 @@
1
+ import{n as e,t}from"./atom-element-CFvcGv3e.js";import{n,t as r}from"./events-M1ozXrXC.js";var i=class extends t{static{this.formAssociated=!0}static{this.observedAttributes=[`disabled`,`href`,`name`,`required`,`target`,`type`,`value`]}get disabled(){return this.hasAttribute(`disabled`)}set disabled(t){e(this,`disabled`,t)}get href(){return this.getAttribute(`href`)}set href(t){e(this,`href`,t)}get name(){return this.getAttribute(`name`)}set name(t){e(this,`name`,t)}get required(){return this.hasAttribute(`required`)}set required(t){e(this,`required`,t)}get target(){let e=this.getAttribute(`target`);return e===`_blank`||e===`_parent`||e===`_top`?e:`_self`}set target(t){e(this,`target`,t)}get type(){let e=this.getAttribute(`type`);return e===`submit`||e===`reset`?e:`button`}set type(t){e(this,`type`,t)}get value(){return this.getAttribute(`value`)}set value(t){e(this,`value`,t)}get#e(){return this.href!==null}constructor(){super(),this.addEventListener(`click`,this.#t),this.addEventListener(`keydown`,this.#n)}formDisabledCallback(e){this.aria(`ariaDisabled`,`aria-disabled`,e?`true`:null)}formResetCallback(){}formStateRestoreCallback(e,t){}renderShadow(){this.root.innerHTML=`
2
+ <div part="root">
3
+ <!-- Default light DOM content is the center slot; side slots stay reserved for icon-like atoms. -->
4
+ <slot name="left" part="left"></slot>
5
+ <slot part="center"></slot>
6
+ <slot name="right" part="right"></slot>
7
+ </div>
8
+ `}syncState(){this.aria(`role`,`role`,this.#e?`link`:`button`),this.aria(`ariaDisabled`,`aria-disabled`,this.disabled?`true`:null),this.tabIndex=this.disabled?-1:0}#t=e=>{if(this.disabled){e.preventDefault(),e.stopImmediatePropagation();return}this.#r()};#n=e=>{if(this.disabled){e.preventDefault(),e.stopImmediatePropagation();return}if(this.#e){if(e.key!==`Enter`)return}else if(e.key!==`Enter`&&e.key!==` `)return;e.preventDefault(),this.#r()};#r(){if(r(this,`atomclick`,this.value),this.#e){n(this,this.href,this.target);return}switch(this.type){case`submit`:this.internals.setFormValue(this.value??null),this.internals.form?.requestSubmit();break;case`reset`:this.internals.form?.reset();break}}};function a(e=`atom-button`){typeof customElements>`u`||customElements.get(e)||customElements.define(e,i)}export{a as n,i as t};
@@ -0,0 +1 @@
1
+ function e(e,t,n){if(n===!1||n==null){e.removeAttribute(t);return}if(n===!0){e.setAttribute(t,``);return}e.setAttribute(t,String(n))}var t=class extends HTMLElement{#e;#t=!1;#n;get internals(){return this.#e}get root(){return this.#n}constructor(){super(),this.#n=this.attachShadow({mode:`closed`}),this.#e=this.attachInternals()}connectedCallback(){this.#t||=(this.renderShadow(),!0),this.syncState()}attributeChangedCallback(){this.isConnected&&this.syncState()}aria(t,n,r){e(this,n,r),this.#e[t]=r}};export{e as n,t};
@@ -0,0 +1,5 @@
1
+ import{n as e,t}from"./atom-element-CFvcGv3e.js";var n=class extends t{static{this.observedAttributes=[`disabled`,`indeterminate`,`label`,`max`,`min`,`value`]}get disabled(){return this.hasAttribute(`disabled`)}set disabled(t){e(this,`disabled`,t)}get indeterminate(){return this.hasAttribute(`indeterminate`)}set indeterminate(t){e(this,`indeterminate`,t)}get label(){return this.getAttribute(`label`)??``}set label(t){e(this,`label`,t||null)}get max(){return this.#r(`max`,100)}set max(t){e(this,`max`,t)}get min(){return this.#r(`min`,0)}set min(t){e(this,`min`,t)}get value(){return this.#r(`value`,25)}set value(t){e(this,`value`,t)}get percent(){return Math.round(this.#n*100)/100}get#e(){return Number.isFinite(this.min)&&Number.isFinite(this.max)&&this.max>this.min}get#t(){return!Number.isFinite(this.value)||this.value<this.min?this.min:this.value>this.max?this.max:this.value}get#n(){return this.indeterminate||!this.#e?0:(this.#t-this.min)/(this.max-this.min)*100}renderShadow(){this.root.innerHTML=`
2
+ <div part="track">
3
+ <div part="fill"></div>
4
+ </div>
5
+ `}syncState(){if(this.aria(`role`,`role`,`progressbar`),this.indeterminate)this.aria(`ariaValueMin`,`aria-valuemin`,null),this.aria(`ariaValueNow`,`aria-valuenow`,null),this.aria(`ariaValueMax`,`aria-valuemax`,null),this.aria(`ariaValueText`,`aria-valuetext`,null);else{let e=this.#e?this.#t:this.min,t=this.#e?this.percent:0;this.aria(`ariaValueMin`,`aria-valuemin`,String(this.min)),this.aria(`ariaValueNow`,`aria-valuenow`,String(e)),this.aria(`ariaValueMax`,`aria-valuemax`,String(this.max)),this.aria(`ariaValueText`,`aria-valuetext`,`${t}% — ${e} of ${this.max} (range ${this.min}-${this.max})`)}this.aria(`ariaLabel`,`aria-label`,this.label||null),this.aria(`ariaDisabled`,`aria-disabled`,this.disabled?`true`:null),this.#i()}#r(e,t){let n=Number(this.getAttribute(e));return Number.isFinite(n)?n:t}#i(){if(this.indeterminate){this.style.removeProperty(`--atom-progress-value`);return}this.style.setProperty(`--atom-progress-value`,`${this.percent}%`)}};function r(e=`atom-progress`){typeof customElements>`u`||customElements.get(e)||customElements.define(e,n)}export{r as n,n as t};
@@ -0,0 +1 @@
1
+ function e(e,t,n,r={}){return e.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,...r,detail:n}))}function t(t,n,r){if(n!==null&&e(t,`atomnavigate`,n,{cancelable:!0})){if(r===`_self`){window.location.assign(n);return}window.open(n,r)}}export{t as n,e as t};
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ import{n as e,t}from"./chunks/atom-badge-CdXX-kOP.js";import{n,t as r}from"./chunks/atom-button-CGOr9UME.js";import{n as i,t as a}from"./chunks/atom-progress-BwNHdtje.js";export{t as AtomBadge,r as AtomButton,a as AtomProgress,e as defineAtomBadge,n as defineAtomButton,i as defineAtomProgress};
@@ -0,0 +1,5 @@
1
+ var AtomHeadlessProgress=(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e,t,n){if(n===!1||n==null){e.removeAttribute(t);return}if(n===!0){e.setAttribute(t,``);return}e.setAttribute(t,String(n))}var n=class extends HTMLElement{#e;#t=!1;#n;get internals(){return this.#e}get root(){return this.#n}constructor(){super(),this.#n=this.attachShadow({mode:`closed`}),this.#e=this.attachInternals()}connectedCallback(){this.#t||=(this.renderShadow(),!0),this.syncState()}attributeChangedCallback(){this.isConnected&&this.syncState()}aria(e,n,r){t(this,n,r),this.#e[e]=r}},r=class extends n{static{this.observedAttributes=[`disabled`,`indeterminate`,`label`,`max`,`min`,`value`]}get disabled(){return this.hasAttribute(`disabled`)}set disabled(e){t(this,`disabled`,e)}get indeterminate(){return this.hasAttribute(`indeterminate`)}set indeterminate(e){t(this,`indeterminate`,e)}get label(){return this.getAttribute(`label`)??``}set label(e){t(this,`label`,e||null)}get max(){return this.#r(`max`,100)}set max(e){t(this,`max`,e)}get min(){return this.#r(`min`,0)}set min(e){t(this,`min`,e)}get value(){return this.#r(`value`,25)}set value(e){t(this,`value`,e)}get percent(){return Math.round(this.#n*100)/100}get#e(){return Number.isFinite(this.min)&&Number.isFinite(this.max)&&this.max>this.min}get#t(){return!Number.isFinite(this.value)||this.value<this.min?this.min:this.value>this.max?this.max:this.value}get#n(){return this.indeterminate||!this.#e?0:(this.#t-this.min)/(this.max-this.min)*100}renderShadow(){this.root.innerHTML=`
2
+ <div part="track">
3
+ <div part="fill"></div>
4
+ </div>
5
+ `}syncState(){if(this.aria(`role`,`role`,`progressbar`),this.indeterminate)this.aria(`ariaValueMin`,`aria-valuemin`,null),this.aria(`ariaValueNow`,`aria-valuenow`,null),this.aria(`ariaValueMax`,`aria-valuemax`,null),this.aria(`ariaValueText`,`aria-valuetext`,null);else{let e=this.#e?this.#t:this.min,t=this.#e?this.percent:0;this.aria(`ariaValueMin`,`aria-valuemin`,String(this.min)),this.aria(`ariaValueNow`,`aria-valuenow`,String(e)),this.aria(`ariaValueMax`,`aria-valuemax`,String(this.max)),this.aria(`ariaValueText`,`aria-valuetext`,`${t}% — ${e} of ${this.max} (range ${this.min}-${this.max})`)}this.aria(`ariaLabel`,`aria-label`,this.label||null),this.aria(`ariaDisabled`,`aria-disabled`,this.disabled?`true`:null),this.#i()}#r(e,t){let n=Number(this.getAttribute(e));return Number.isFinite(n)?n:t}#i(){if(this.indeterminate){this.style.removeProperty(`--atom-progress-value`);return}this.style.setProperty(`--atom-progress-value`,`${this.percent}%`)}};function i(e=`atom-progress`){typeof customElements>`u`||customElements.get(e)||customElements.define(e,r)}return i(),e.AtomProgress=r,e.defineAtomProgress=i,e})({});
@@ -0,0 +1 @@
1
+ import{n as e,t}from"./chunks/atom-progress-BwNHdtje.js";e();export{t as AtomProgress,e as defineAtomProgress};
package/lib/all.ts ADDED
@@ -0,0 +1,11 @@
1
+ import { defineAtomBadge } from './components/badge/atom-badge';
2
+ import { defineAtomButton } from './components/button/atom-button';
3
+ import { defineAtomProgress } from './components/progress/atom-progress';
4
+
5
+ export * from './badge';
6
+ export * from './button';
7
+ export * from './progress';
8
+
9
+ defineAtomBadge();
10
+ defineAtomButton();
11
+ defineAtomProgress();
@@ -0,0 +1,2 @@
1
+ // Browser IIFE entry: registers only <atom-badge> for plain <script> usage.
2
+ export * from './badge';
package/lib/badge.ts ADDED
@@ -0,0 +1,5 @@
1
+ import { defineAtomBadge } from './components/badge/atom-badge';
2
+
3
+ export { AtomBadge, defineAtomBadge, type AtomBadgeTarget } from './components/badge/atom-badge';
4
+
5
+ defineAtomBadge();
package/lib/browser.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './all';
@@ -0,0 +1,2 @@
1
+ // Browser IIFE entry: registers only <atom-button> for plain <script> usage.
2
+ export * from './button';
package/lib/button.ts ADDED
@@ -0,0 +1,5 @@
1
+ import { defineAtomButton } from './components/button/atom-button';
2
+
3
+ export { AtomButton, defineAtomButton, type AtomButtonTarget, type AtomButtonType } from './components/button/atom-button';
4
+
5
+ defineAtomButton();
@@ -0,0 +1,76 @@
1
+ import { AtomElement, navigateFromHost, setAttr, type AtomNavigateTarget } from '../../core';
2
+
3
+ export type AtomBadgeTarget = AtomNavigateTarget;
4
+
5
+ export class AtomBadge extends AtomElement {
6
+ static observedAttributes = ['href', 'target'];
7
+
8
+ get href(): string | null {
9
+ return this.getAttribute('href');
10
+ }
11
+ set href(value: string | null) {
12
+ setAttr(this, 'href', value);
13
+ }
14
+
15
+ get target(): AtomBadgeTarget {
16
+ const value = this.getAttribute('target');
17
+ return value === '_blank' || value === '_parent' || value === '_top' ? value : '_self';
18
+ }
19
+ set target(value: AtomBadgeTarget) {
20
+ setAttr(this, 'target', value);
21
+ }
22
+
23
+ get #isLink(): boolean {
24
+ return this.href !== null;
25
+ }
26
+
27
+ constructor() {
28
+ super();
29
+ this.addEventListener('click', this.#onClick);
30
+ this.addEventListener('keydown', this.#onKeyDown);
31
+ }
32
+
33
+ protected renderShadow(): void {
34
+ this.root.innerHTML = `
35
+ <div part="root">
36
+ <!-- Default light DOM content is the center slot; side slots stay reserved for icon-like atoms. -->
37
+ <slot part="left" name="left"></slot>
38
+ <slot part="center"></slot>
39
+ <slot part="right" name="right"></slot>
40
+ </div>
41
+ `;
42
+ }
43
+
44
+ protected syncState(): void {
45
+ this.aria('role', 'role', this.#isLink ? 'link' : 'note');
46
+
47
+ if (this.#isLink) {
48
+ this.tabIndex = 0;
49
+ } else {
50
+ this.removeAttribute('tabindex');
51
+ }
52
+ }
53
+
54
+ #onClick = (): void => {
55
+ if (!this.#isLink) return;
56
+ navigateFromHost(this, this.href, this.target);
57
+ };
58
+
59
+ #onKeyDown = (event: KeyboardEvent): void => {
60
+ if (!this.#isLink || event.key !== 'Enter') return;
61
+
62
+ event.preventDefault();
63
+ navigateFromHost(this, this.href, this.target);
64
+ };
65
+ }
66
+
67
+ export function defineAtomBadge(tagName = 'atom-badge'): void {
68
+ if (typeof customElements === 'undefined' || customElements.get(tagName)) return;
69
+ customElements.define(tagName, AtomBadge);
70
+ }
71
+
72
+ declare global {
73
+ interface HTMLElementTagNameMap {
74
+ 'atom-badge': AtomBadge;
75
+ }
76
+ }
@@ -0,0 +1,160 @@
1
+ import {
2
+ AtomElement,
3
+ emitAtomEvent,
4
+ navigateFromHost,
5
+ setAttr,
6
+ type AtomNavigateTarget,
7
+ } from '../../core';
8
+
9
+ export type AtomButtonType = 'button' | 'submit' | 'reset';
10
+ export type AtomButtonTarget = AtomNavigateTarget;
11
+
12
+ export class AtomButton extends AtomElement {
13
+ static formAssociated = true;
14
+ static observedAttributes = ['disabled', 'href', 'name', 'required', 'target', 'type', 'value'];
15
+
16
+ get disabled(): boolean {
17
+ return this.hasAttribute('disabled');
18
+ }
19
+ set disabled(value: boolean) {
20
+ setAttr(this, 'disabled', value);
21
+ }
22
+
23
+ get href(): string | null {
24
+ return this.getAttribute('href');
25
+ }
26
+ set href(value: string | null) {
27
+ setAttr(this, 'href', value);
28
+ }
29
+
30
+ get name(): string | null {
31
+ return this.getAttribute('name');
32
+ }
33
+ set name(value: string | null) {
34
+ setAttr(this, 'name', value);
35
+ }
36
+
37
+ get required(): boolean {
38
+ return this.hasAttribute('required');
39
+ }
40
+ set required(value: boolean) {
41
+ setAttr(this, 'required', value);
42
+ }
43
+
44
+ get target(): AtomButtonTarget {
45
+ const value = this.getAttribute('target');
46
+ return value === '_blank' || value === '_parent' || value === '_top' ? value : '_self';
47
+ }
48
+ set target(value: AtomButtonTarget) {
49
+ setAttr(this, 'target', value);
50
+ }
51
+
52
+ get type(): AtomButtonType {
53
+ const value = this.getAttribute('type');
54
+ return value === 'submit' || value === 'reset' ? value : 'button';
55
+ }
56
+ set type(value: AtomButtonType) {
57
+ setAttr(this, 'type', value);
58
+ }
59
+
60
+ get value(): string | null {
61
+ return this.getAttribute('value');
62
+ }
63
+ set value(value: string | null) {
64
+ setAttr(this, 'value', value);
65
+ }
66
+
67
+ get #isLink(): boolean {
68
+ return this.href !== null;
69
+ }
70
+
71
+ constructor() {
72
+ super();
73
+ this.addEventListener('click', this.#onClick);
74
+ this.addEventListener('keydown', this.#onKeyDown);
75
+ }
76
+
77
+ formDisabledCallback(disabled: boolean): void {
78
+ this.aria('ariaDisabled', 'aria-disabled', disabled ? 'true' : null);
79
+ }
80
+
81
+ formResetCallback(): void {}
82
+
83
+ formStateRestoreCallback(_state: FormValue, _mode: 'restore' | 'autocomplete'): void {}
84
+
85
+ protected renderShadow(): void {
86
+ this.root.innerHTML = `
87
+ <div part="root">
88
+ <!-- Default light DOM content is the center slot; side slots stay reserved for icon-like atoms. -->
89
+ <slot name="left" part="left"></slot>
90
+ <slot part="center"></slot>
91
+ <slot name="right" part="right"></slot>
92
+ </div>
93
+ `;
94
+ }
95
+
96
+ protected syncState(): void {
97
+ this.aria('role', 'role', this.#isLink ? 'link' : 'button');
98
+ this.aria('ariaDisabled', 'aria-disabled', this.disabled ? 'true' : null);
99
+ this.tabIndex = this.disabled ? -1 : 0;
100
+ }
101
+
102
+ #onClick = (event: MouseEvent): void => {
103
+ if (this.disabled) {
104
+ event.preventDefault();
105
+ event.stopImmediatePropagation();
106
+ return;
107
+ }
108
+
109
+ this.#activate();
110
+ };
111
+
112
+ #onKeyDown = (event: KeyboardEvent): void => {
113
+ if (this.disabled) {
114
+ event.preventDefault();
115
+ event.stopImmediatePropagation();
116
+ return;
117
+ }
118
+
119
+ if (this.#isLink) {
120
+ if (event.key !== 'Enter') return;
121
+ } else if (event.key !== 'Enter' && event.key !== ' ') {
122
+ return;
123
+ }
124
+
125
+ event.preventDefault();
126
+ this.#activate();
127
+ };
128
+
129
+ #activate(): void {
130
+ emitAtomEvent(this, 'atomclick', this.value);
131
+
132
+ if (this.#isLink) {
133
+ navigateFromHost(this, this.href, this.target);
134
+ return;
135
+ }
136
+
137
+ switch (this.type) {
138
+ case 'submit':
139
+ this.internals.setFormValue(this.value ?? null);
140
+ this.internals.form?.requestSubmit();
141
+ break;
142
+ case 'reset':
143
+ this.internals.form?.reset();
144
+ break;
145
+ }
146
+ }
147
+ }
148
+
149
+ export function defineAtomButton(tagName = 'atom-button'): void {
150
+ if (typeof customElements === 'undefined' || customElements.get(tagName)) return;
151
+ customElements.define(tagName, AtomButton);
152
+ }
153
+
154
+ type FormValue = File | string | FormData | null;
155
+
156
+ declare global {
157
+ interface HTMLElementTagNameMap {
158
+ 'atom-button': AtomButton;
159
+ }
160
+ }
@@ -0,0 +1,123 @@
1
+ import { AtomElement, setAttr } from '../../core';
2
+
3
+ export class AtomProgress extends AtomElement {
4
+ static observedAttributes = ['disabled', 'indeterminate', 'label', 'max', 'min', 'value'];
5
+
6
+ get disabled(): boolean {
7
+ return this.hasAttribute('disabled');
8
+ }
9
+ set disabled(value: boolean) {
10
+ setAttr(this, 'disabled', value);
11
+ }
12
+
13
+ get indeterminate(): boolean {
14
+ return this.hasAttribute('indeterminate');
15
+ }
16
+ set indeterminate(value: boolean) {
17
+ setAttr(this, 'indeterminate', value);
18
+ }
19
+
20
+ get label(): string {
21
+ return this.getAttribute('label') ?? '';
22
+ }
23
+ set label(value: string) {
24
+ setAttr(this, 'label', value || null);
25
+ }
26
+
27
+ get max(): number {
28
+ return this.#numberAttr('max', 100);
29
+ }
30
+ set max(value: number) {
31
+ setAttr(this, 'max', value);
32
+ }
33
+
34
+ get min(): number {
35
+ return this.#numberAttr('min', 0);
36
+ }
37
+ set min(value: number) {
38
+ setAttr(this, 'min', value);
39
+ }
40
+
41
+ get value(): number {
42
+ return this.#numberAttr('value', 25);
43
+ }
44
+ set value(value: number) {
45
+ setAttr(this, 'value', value);
46
+ }
47
+
48
+ get percent(): number {
49
+ return Math.round(this.#rawPercent * 100) / 100;
50
+ }
51
+
52
+ get #hasValidRange(): boolean {
53
+ return Number.isFinite(this.min) && Number.isFinite(this.max) && this.max > this.min;
54
+ }
55
+
56
+ get #clampedValue(): number {
57
+ if (!Number.isFinite(this.value)) return this.min;
58
+ if (this.value < this.min) return this.min;
59
+ if (this.value > this.max) return this.max;
60
+ return this.value;
61
+ }
62
+
63
+ get #rawPercent(): number {
64
+ if (this.indeterminate || !this.#hasValidRange) return 0;
65
+ return ((this.#clampedValue - this.min) / (this.max - this.min)) * 100;
66
+ }
67
+
68
+ protected renderShadow(): void {
69
+ this.root.innerHTML = `
70
+ <div part="track">
71
+ <div part="fill"></div>
72
+ </div>
73
+ `;
74
+ }
75
+
76
+ protected syncState(): void {
77
+ this.aria('role', 'role', 'progressbar');
78
+
79
+ if (this.indeterminate) {
80
+ this.aria('ariaValueMin', 'aria-valuemin', null);
81
+ this.aria('ariaValueNow', 'aria-valuenow', null);
82
+ this.aria('ariaValueMax', 'aria-valuemax', null);
83
+ this.aria('ariaValueText', 'aria-valuetext', null);
84
+ } else {
85
+ const current = this.#hasValidRange ? this.#clampedValue : this.min;
86
+ const percent = this.#hasValidRange ? this.percent : 0;
87
+
88
+ this.aria('ariaValueMin', 'aria-valuemin', String(this.min));
89
+ this.aria('ariaValueNow', 'aria-valuenow', String(current));
90
+ this.aria('ariaValueMax', 'aria-valuemax', String(this.max));
91
+ this.aria('ariaValueText', 'aria-valuetext', `${percent}% — ${current} of ${this.max} (range ${this.min}-${this.max})`);
92
+ }
93
+
94
+ this.aria('ariaLabel', 'aria-label', this.label || null);
95
+ this.aria('ariaDisabled', 'aria-disabled', this.disabled ? 'true' : null);
96
+ this.#syncFill();
97
+ }
98
+
99
+ #numberAttr(name: string, fallback: number): number {
100
+ const value = Number(this.getAttribute(name));
101
+ return Number.isFinite(value) ? value : fallback;
102
+ }
103
+
104
+ #syncFill(): void {
105
+ if (this.indeterminate) {
106
+ this.style.removeProperty('--atom-progress-value');
107
+ return;
108
+ }
109
+
110
+ this.style.setProperty('--atom-progress-value', `${this.percent}%`);
111
+ }
112
+ }
113
+
114
+ export function defineAtomProgress(tagName = 'atom-progress'): void {
115
+ if (typeof customElements === 'undefined' || customElements.get(tagName)) return;
116
+ customElements.define(tagName, AtomProgress);
117
+ }
118
+
119
+ declare global {
120
+ interface HTMLElementTagNameMap {
121
+ 'atom-progress': AtomProgress;
122
+ }
123
+ }
@@ -0,0 +1,43 @@
1
+ import { setAttr } from './attrs';
2
+
3
+ export abstract class AtomElement extends HTMLElement {
4
+ readonly #internals: ElementInternals;
5
+ #hasRendered = false;
6
+ readonly #root: ShadowRoot;
7
+
8
+ protected get internals(): ElementInternals {
9
+ return this.#internals;
10
+ }
11
+
12
+ protected get root(): ShadowRoot {
13
+ return this.#root;
14
+ }
15
+
16
+ constructor() {
17
+ super();
18
+ this.#root = this.attachShadow({ mode: import.meta.env.DEV ? 'open' : 'closed' });
19
+ this.#internals = this.attachInternals();
20
+ }
21
+
22
+ connectedCallback(): void {
23
+ if (!this.#hasRendered) {
24
+ this.renderShadow();
25
+ this.#hasRendered = true;
26
+ }
27
+
28
+ this.syncState();
29
+ }
30
+
31
+ attributeChangedCallback(): void {
32
+ if (this.isConnected) this.syncState();
33
+ }
34
+
35
+ protected aria(prop: keyof ARIAMixin | 'role', attr: string, value: string | null): void {
36
+ setAttr(this, attr, value);
37
+ // ElementInternals ARIA reflection keeps accessible state attached to the host.
38
+ (this.#internals as unknown as Record<string, string | null>)[prop] = value;
39
+ }
40
+
41
+ protected abstract renderShadow(): void;
42
+ protected abstract syncState(): void;
43
+ }
@@ -0,0 +1,15 @@
1
+ export type AttributeValue = string | number | boolean | null | undefined;
2
+
3
+ export function setAttr(element: Element, name: string, value: AttributeValue): void {
4
+ if (value === false || value === null || value === undefined) {
5
+ element.removeAttribute(name);
6
+ return;
7
+ }
8
+
9
+ if (value === true) {
10
+ element.setAttribute(name, '');
11
+ return;
12
+ }
13
+
14
+ element.setAttribute(name, String(value));
15
+ }
@@ -0,0 +1,36 @@
1
+ export type AtomNavigateTarget = '_blank' | '_self' | '_parent' | '_top';
2
+
3
+ export function emitAtomEvent<T>(
4
+ host: EventTarget,
5
+ type: string,
6
+ detail: T,
7
+ options: EventInit = {},
8
+ ): boolean {
9
+ return host.dispatchEvent(
10
+ new CustomEvent<T>(type, {
11
+ bubbles: true,
12
+ composed: true,
13
+ ...options,
14
+ detail,
15
+ }),
16
+ );
17
+ }
18
+
19
+ /** Emits the public route hook before falling back to browser navigation. */
20
+ export function navigateFromHost(
21
+ host: EventTarget,
22
+ href: string | null,
23
+ target: AtomNavigateTarget,
24
+ ): void {
25
+ if (href === null) return;
26
+
27
+ const shouldNavigate = emitAtomEvent(host, 'atomnavigate', href, { cancelable: true });
28
+ if (!shouldNavigate) return;
29
+
30
+ if (target === '_self') {
31
+ window.location.assign(href);
32
+ return;
33
+ }
34
+
35
+ window.open(href, target);
36
+ }
@@ -0,0 +1,7 @@
1
+ export { AtomElement } from './atom-element';
2
+ export { setAttr, type AttributeValue } from './attrs';
3
+ export {
4
+ emitAtomEvent,
5
+ navigateFromHost,
6
+ type AtomNavigateTarget,
7
+ } from './events';
package/lib/index.ts ADDED
@@ -0,0 +1,4 @@
1
+ // Non-registering entry: exports classes but does NOT auto-define custom elements.
2
+ export * from './components/badge/atom-badge';
3
+ export * from './components/button/atom-button';
4
+ export * from './components/progress/atom-progress';
@@ -0,0 +1,2 @@
1
+ // Browser IIFE entry: registers only <atom-progress> for plain <script> usage.
2
+ export * from './progress';
@@ -0,0 +1,5 @@
1
+ import { defineAtomProgress } from './components/progress/atom-progress';
2
+
3
+ export { AtomProgress, defineAtomProgress } from './components/progress/atom-progress';
4
+
5
+ defineAtomProgress();
package/package.json ADDED
@@ -0,0 +1,112 @@
1
+ {
2
+ "name": "@aevix/atom-headless",
3
+ "version": "0.0.1",
4
+ "description": "Zero-dependency headless Web Components — button, badge, progress. Optional external CSS.",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "author": "Aevix",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/aevix/atom-headless.git"
11
+ },
12
+ "keywords": [
13
+ "web-components",
14
+ "custom-elements",
15
+ "headless",
16
+ "vanilla",
17
+ "lit-alternative",
18
+ "ui"
19
+ ],
20
+ "publishConfig": {
21
+ "access": "public"
22
+ },
23
+ "files": [
24
+ "dist",
25
+ "lib"
26
+ ],
27
+ "exports": {
28
+ ".": {
29
+ "types": "./lib/index.ts",
30
+ "import": "./dist/index.js",
31
+ "default": "./dist/index.js"
32
+ },
33
+ "./all": {
34
+ "types": "./lib/all.ts",
35
+ "import": "./dist/all.js",
36
+ "default": "./dist/all.js"
37
+ },
38
+ "./button": {
39
+ "types": "./lib/button.ts",
40
+ "import": "./dist/button.js",
41
+ "default": "./dist/button.js"
42
+ },
43
+ "./badge": {
44
+ "types": "./lib/badge.ts",
45
+ "import": "./dist/badge.js",
46
+ "default": "./dist/badge.js"
47
+ },
48
+ "./progress": {
49
+ "types": "./lib/progress.ts",
50
+ "import": "./dist/progress.js",
51
+ "default": "./dist/progress.js"
52
+ },
53
+ "./browser": {
54
+ "types": "./lib/browser.ts",
55
+ "import": "./dist/browser.js",
56
+ "default": "./dist/browser.js"
57
+ },
58
+ "./browser/button": {
59
+ "types": "./lib/button.ts",
60
+ "import": "./dist/button.browser.js",
61
+ "default": "./dist/button.browser.js"
62
+ },
63
+ "./browser/badge": {
64
+ "types": "./lib/badge.ts",
65
+ "import": "./dist/badge.browser.js",
66
+ "default": "./dist/badge.browser.js"
67
+ },
68
+ "./browser/progress": {
69
+ "types": "./lib/progress.ts",
70
+ "import": "./dist/progress.browser.js",
71
+ "default": "./dist/progress.browser.js"
72
+ },
73
+ "./styles": {
74
+ "import": "./dist/atom.css",
75
+ "default": "./dist/atom.css"
76
+ }
77
+ },
78
+ "module": "./dist/index.js",
79
+ "types": "./lib/index.ts",
80
+ "browser": "./dist/browser.js",
81
+ "unpkg": "./dist/browser.js",
82
+ "jsdelivr": "./dist/browser.js",
83
+ "scripts": {
84
+ "build": "vite build && vite build --mode all && vite build --mode button && vite build --mode badge && vite build --mode progress",
85
+ "prepublishOnly": "npm run build",
86
+ "preview": "vite preview",
87
+ "typecheck": "tsc -p tsconfig.json --noEmit"
88
+ },
89
+ "devDependencies": {
90
+ "lightningcss": "^1.32.0",
91
+ "typescript": "^5.0.0",
92
+ "vite": "^8.1.0"
93
+ },
94
+ "sideEffects": [
95
+ "./dist/all.js",
96
+ "./dist/badge.js",
97
+ "./dist/button.js",
98
+ "./dist/progress.js",
99
+ "./dist/browser.js",
100
+ "./dist/button.browser.js",
101
+ "./dist/badge.browser.js",
102
+ "./dist/progress.browser.js",
103
+ "./lib/all.ts",
104
+ "./lib/browser.ts",
105
+ "./lib/button.ts",
106
+ "./lib/badge.ts",
107
+ "./lib/progress.ts",
108
+ "./lib/button.browser.ts",
109
+ "./lib/badge.browser.ts",
110
+ "./lib/progress.browser.ts"
111
+ ]
112
+ }