@neumorphism-ui/elements 1.0.0-next.2 → 1.0.0-next.3

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.
Files changed (129) hide show
  1. package/cdn/neu.min.js +31 -39
  2. package/custom-elements.json +495 -248
  3. package/dist/components/avatar/avatar.d.ts +0 -3
  4. package/dist/components/avatar/avatar.def.d.ts +0 -3
  5. package/dist/components/avatar/avatar.def.js +4 -18
  6. package/dist/components/avatar/avatar.docs.d.ts +2 -0
  7. package/dist/components/avatar/avatar.docs.js +22 -0
  8. package/dist/components/avatar/avatar.js +7 -1
  9. package/dist/components/badge/badge.d.ts +0 -2
  10. package/dist/components/badge/badge.def.d.ts +0 -2
  11. package/dist/components/badge/badge.def.js +1 -14
  12. package/dist/components/badge/badge.docs.d.ts +2 -0
  13. package/dist/components/badge/badge.docs.js +17 -0
  14. package/dist/components/button/button.def.d.ts +0 -5
  15. package/dist/components/button/button.def.js +3 -25
  16. package/dist/components/button/button.docs.d.ts +2 -0
  17. package/dist/components/button/button.docs.js +29 -0
  18. package/dist/components/button-group/button-group.d.ts +0 -2
  19. package/dist/components/button-group/button-group.def.d.ts +0 -2
  20. package/dist/components/button-group/button-group.def.js +1 -10
  21. package/dist/components/button-group/button-group.docs.d.ts +2 -0
  22. package/dist/components/button-group/button-group.docs.js +13 -0
  23. package/dist/components/checkbox/checkbox.d.ts +1 -5
  24. package/dist/components/checkbox/checkbox.def.d.ts +1 -5
  25. package/dist/components/checkbox/checkbox.def.js +6 -22
  26. package/dist/components/checkbox/checkbox.docs.d.ts +2 -0
  27. package/dist/components/checkbox/checkbox.docs.js +27 -0
  28. package/dist/components/divider/divider.d.ts +0 -1
  29. package/dist/components/divider/divider.def.d.ts +0 -1
  30. package/dist/components/divider/divider.def.js +0 -9
  31. package/dist/components/divider/divider.docs.d.ts +2 -0
  32. package/dist/components/divider/divider.docs.js +12 -0
  33. package/dist/components/icon/icon.d.ts +0 -3
  34. package/dist/components/icon/icon.def.d.ts +0 -3
  35. package/dist/components/icon/icon.def.js +3 -10
  36. package/dist/components/icon/icon.docs.d.ts +2 -0
  37. package/dist/components/icon/icon.docs.js +13 -0
  38. package/dist/components/icon/system-icons.d.ts +1 -1
  39. package/dist/components/icon/system-icons.js +3 -3
  40. package/dist/components/icon-button/icon-button.d.ts +0 -5
  41. package/dist/components/icon-button/icon-button.def.d.ts +0 -5
  42. package/dist/components/icon-button/icon-button.def.js +3 -17
  43. package/dist/components/icon-button/icon-button.docs.d.ts +2 -0
  44. package/dist/components/icon-button/icon-button.docs.js +26 -0
  45. package/dist/components/number-field/number-field.d.ts +0 -5
  46. package/dist/components/number-field/number-field.def.d.ts +0 -10
  47. package/dist/components/number-field/number-field.def.js +5 -27
  48. package/dist/components/number-field/number-field.docs.d.ts +2 -0
  49. package/dist/components/number-field/number-field.docs.js +45 -0
  50. package/dist/components/number-field/number-field.js +2 -2
  51. package/dist/components/number-field/number-field.styles.d.ts +1 -1
  52. package/dist/components/option/option.d.ts +0 -2
  53. package/dist/components/option/option.def.d.ts +0 -2
  54. package/dist/components/option/option.def.js +2 -9
  55. package/dist/components/option/option.docs.d.ts +2 -0
  56. package/dist/components/option/option.docs.js +12 -0
  57. package/dist/components/radio/radio.d.ts +0 -2
  58. package/dist/components/radio/radio.def.d.ts +0 -2
  59. package/dist/components/radio/radio.def.js +2 -15
  60. package/dist/components/radio/radio.docs.d.ts +2 -0
  61. package/dist/components/radio/radio.docs.js +18 -0
  62. package/dist/components/radio-group/radio-group.d.ts +3 -4
  63. package/dist/components/radio-group/radio-group.def.d.ts +0 -4
  64. package/dist/components/radio-group/radio-group.def.js +4 -19
  65. package/dist/components/radio-group/radio-group.docs.d.ts +2 -0
  66. package/dist/components/radio-group/radio-group.docs.js +37 -0
  67. package/dist/components/radio-group/radio-group.js +28 -4
  68. package/dist/components/radio-group/radio-group.styles.d.ts +1 -1
  69. package/dist/components/radio-group/radio-group.styles.js +3 -5
  70. package/dist/components/select/select.d.ts +1 -5
  71. package/dist/components/select/select.def.d.ts +0 -4
  72. package/dist/components/select/select.def.js +5 -29
  73. package/dist/components/select/select.docs.d.ts +2 -0
  74. package/dist/components/select/select.docs.js +65 -0
  75. package/dist/components/select/select.js +16 -10
  76. package/dist/components/select/select.styles.d.ts +1 -1
  77. package/dist/components/select/select.styles.js +1 -5
  78. package/dist/components/shared/field.styles.d.ts +1 -1
  79. package/dist/components/shared/field.styles.js +2 -4
  80. package/dist/components/slider/slider.d.ts +0 -2
  81. package/dist/components/slider/slider.def.d.ts +0 -2
  82. package/dist/components/slider/slider.def.js +2 -24
  83. package/dist/components/slider/slider.docs.d.ts +2 -0
  84. package/dist/components/slider/slider.docs.js +45 -0
  85. package/dist/components/spinner/spinner.d.ts +0 -1
  86. package/dist/components/spinner/spinner.def.d.ts +0 -1
  87. package/dist/components/spinner/spinner.def.js +1 -13
  88. package/dist/components/spinner/spinner.docs.d.ts +2 -0
  89. package/dist/components/spinner/spinner.docs.js +17 -0
  90. package/dist/components/surface/surface.d.ts +0 -4
  91. package/dist/components/surface/surface.def.d.ts +0 -4
  92. package/dist/components/surface/surface.def.js +3 -12
  93. package/dist/components/surface/surface.docs.d.ts +2 -0
  94. package/dist/components/surface/surface.docs.js +15 -0
  95. package/dist/components/switch/switch.d.ts +0 -5
  96. package/dist/components/switch/switch.def.d.ts +0 -5
  97. package/dist/components/switch/switch.def.js +5 -21
  98. package/dist/components/switch/switch.docs.d.ts +2 -0
  99. package/dist/components/switch/switch.docs.js +26 -0
  100. package/dist/components/text-field/text-field.d.ts +0 -6
  101. package/dist/components/text-field/text-field.def.d.ts +0 -12
  102. package/dist/components/text-field/text-field.def.js +5 -30
  103. package/dist/components/text-field/text-field.docs.d.ts +2 -0
  104. package/dist/components/text-field/text-field.docs.js +45 -0
  105. package/dist/components/text-field/text-field.js +2 -2
  106. package/dist/components/text-field/text-field.styles.d.ts +1 -1
  107. package/dist/components/textarea/textarea.d.ts +0 -6
  108. package/dist/components/textarea/textarea.def.d.ts +0 -12
  109. package/dist/components/textarea/textarea.def.js +5 -26
  110. package/dist/components/textarea/textarea.docs.d.ts +2 -0
  111. package/dist/components/textarea/textarea.docs.js +40 -0
  112. package/dist/components/textarea/textarea.styles.d.ts +1 -1
  113. package/dist/components/theme-docs.d.ts +3 -0
  114. package/dist/components/theme-docs.js +8 -0
  115. package/dist/core/define.d.ts +4 -1
  116. package/dist/core/dom.d.ts +4 -0
  117. package/dist/core/dom.js +7 -0
  118. package/dist/core/form-control.js +4 -1
  119. package/dist/core/neu-element.d.ts +2 -2
  120. package/dist/core/neu-element.js +10 -7
  121. package/dist/core/props.d.ts +13 -1
  122. package/dist/core/props.js +13 -3
  123. package/dist/core/styles.d.ts +0 -2
  124. package/dist/core/styles.js +0 -7
  125. package/dist/docs.d.ts +3 -0
  126. package/dist/docs.js +41 -0
  127. package/dist/ssr.d.ts +1 -1
  128. package/dist/ssr.js +1 -1
  129. package/package.json +5 -1
package/cdn/neu.min.js CHANGED
@@ -1,4 +1,4 @@
1
- function h(r,e){r&&r.textContent!==e&&(r.textContent=e)}function u(r,e,t){r&&(t===""?r.removeAttribute(e):r.getAttribute(e)!==t&&r.setAttribute(e,t))}function Ue(r){return r.getRootNode().activeElement===r}function m(r,e){r.dispatchEvent(new Event(e,{bubbles:!0,composed:!0}))}function g(r,e){let t=!1,i=()=>{t||(t=!0,window.removeEventListener(r.type,n),clearTimeout(s),e())},n=a=>{a===r&&i()};window.addEventListener(r.type,n);let s=setTimeout(i,0)}function C(r,e){return e.attribute??r.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function I(r,e){switch(r.type){case"boolean":return e!==null;case"number":{if(e===null||e.trim()==="")return r.default;let t=Number(e);return Number.isFinite(t)?t:r.default}case"string":{let t=r.default??"";return e===null||r.values&&!r.values.includes(e)?t:e}}}function We(r,e){return r.type==="boolean"?!!e:r.type==="number"&&typeof e=="number"?Number.isFinite(e)?e:r.default:I(r,e==null?null:String(e))}function je(r,e){switch(r.type){case"boolean":return e?"":null;case"number":return String(e);case"string":return e===""?null:String(e)}}function Ge(r,e){let t={};for(let[i,n]of Object.entries(r))t[i]=I(n,e(C(i,n)));return t}var Ft=globalThis.HTMLElement??class{},Ye=new WeakMap,Xe=new WeakSet;function Ht(r){let e=Ye.get(r);return e||(e=new CSSStyleSheet,e.replaceSync(r.styles),Ye.set(r,e)),e}var p=class r extends Ft{static extraProperties=[];static get observedAttributes(){return Object.entries(this.def.props).map(([e,t])=>C(e,t))}static define(){let e=this.def;for(let[i,n]of Object.entries(e.props)){if(this.definesAccessor(i))continue;let s=function(){return this.props[i]};Xe.add(s),Object.defineProperty(this.prototype,i,{configurable:!0,enumerable:!0,get:s,set(a){this.setProp(i,We(n,a))}})}let t=globalThis.customElements;t&&!t.get(e.tag)&&t.define(e.tag,this)}static definesAccessor(e){if(Object.prototype.hasOwnProperty.call(this.prototype,e))return!0;let t=Object.getPrototypeOf(this.prototype);for(;t!==null&&t!==r.prototype;t=Object.getPrototypeOf(t)){let i=Object.getOwnPropertyDescriptor(t,e);if(i)return!(i.get&&Xe.has(i.get))}return!1}internals;props;root=null;refs=new Map;reflecting=!1;hasConnected=!1;formDisabled=!1;authorTabIndex=null;writtenTabIndex;constructor(){super(),this.internals=this.attachInternals(),this.props=Ge(this.def.props,e=>this.getAttribute(e)),this.addEventListener("click",e=>{this.isDisabled&&(e.preventDefault(),e.stopImmediatePropagation())},{capture:!0})}connectedCallback(){this.hasConnected||(this.hasConnected=!0,this.upgradeProperties(),this.update(this.allKeys()),this.ensureRoot()),this.connected()}disconnectedCallback(){this.disconnected()}attributeChangedCallback(e,t,i){if(!this.reflecting){for(let[n,s]of Object.entries(this.def.props))if(C(n,s)===e){this.setProp(n,I(s,i),!0);return}}}formDisabledCallback(e){this.formDisabled=e,this.propChanged("disabled")}get def(){return this.constructor.def}get isDisabled(){return this.props.disabled===!0||this.formDisabled}ref(e){if(!this.root)return null;let t=this.refs.get(e);if(!t){let i=this.root.querySelector(`[data-ref="${e}"]`);if(!i)return null;this.refs.set(e,i),t=i}return t}setProp(e,t,i=!1){let n=this.def.props[e];!n||Object.is(this.props[e],t)||(this.props[e]=t,!i&&n.reflect&&this.reflect(e,n,t),this.propChanged(e))}toggleState(e,t){t?this.internals.states.add(e):this.internals.states.delete(e)}syncFocusable(e){let t=this.getAttribute("tabindex");t!==this.writtenTabIndex&&(this.authorTabIndex=t);let i=e?this.authorTabIndex??"0":null;i===null?this.removeAttribute("tabindex"):t!==i&&this.setAttribute("tabindex",i),this.writtenTabIndex=i}syncDisabledState(){this.internals.ariaDisabled=this.isDisabled?"true":null,this.syncFocusable(!this.isDisabled)}willUpdate(e){}update(e){}rendered(){}connected(){}disconnected(){}allKeys(){return new Set(Object.keys(this.def.props))}propChanged(e){let t=new Set([e]);this.willUpdate(t),this.hasConnected&&this.update(t)}reflect(e,t,i){let n=je(t,i),s=C(e,t);this.reflecting=!0;try{n===null?this.removeAttribute(s):this.setAttribute(s,n)}finally{this.reflecting=!1}}upgradeProperties(){let e=this.constructor,t=this;for(let i of[...Object.keys(e.def.props),...e.extraProperties]){if(!Object.prototype.hasOwnProperty.call(this,i))continue;let n=t[i];delete t[i],t[i]=n}}ensureRoot(e){if(this.root)return;let t=this.internals.shadowRoot,i=t?this.def.template(this.props).value.split('data-ref="').length-1:0;if(!e&&document.readyState==="loading"&&this.parsing(t,i)){this.waitForParser(t,i);return}(!t||this.parsing(t,i))&&(t??=this.attachShadow({mode:"open",delegatesFocus:this.def.delegatesFocus??!1}),t.innerHTML=this.def.template(this.props).value),this.adoptRoot(t)}parsing(e,t){if(e)return e.querySelectorAll("[data-ref]").length<t;if(this.firstChild!==null||this.nextSibling!==null)return!1;for(let i=this.parentNode;i!==null;i=i.parentNode)if(i.nextSibling!==null)return!1;return!0}waitForParser(e,t){let i=s=>{n.disconnect(),document.removeEventListener("DOMContentLoaded",i),this.ensureRoot(s)},n=new MutationObserver(()=>{this.parsing(e,t)||i()});n.observe(e??document,{childList:!0,subtree:!0}),document.addEventListener("DOMContentLoaded",i)}adoptRoot(e){this.root=e,e.adoptedStyleSheets=[Ht(this.def)],e.querySelector("style[data-neu-ssr]")?.remove(),this.rendered(),this.update(this.allKeys())}};var Ze=Symbol("neu.raw"),Vt={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function Nt(r){return r.replace(/[&<>"']/g,e=>Vt[e]??e)}function f(r){return{[Ze]:!0,value:r}}function Bt(r){return typeof r=="object"&&r!==null&&Ze in r}function Je(r){return r==null||r===!1?"":Array.isArray(r)?r.map(Je).join(""):Bt(r)?r.value:Nt(String(r))}function o(r,...e){let t=r[0]??"";return e.forEach((i,n)=>{t+=Je(i)+(r[n+1]??"")}),f(t)}var c=`
1
+ function m(r,e){r&&r.textContent!==e&&(r.textContent=e)}function c(r,e,t){r&&(t===""?r.removeAttribute(e):r.getAttribute(e)!==t&&r.setAttribute(e,t))}function je(r){return r.getRootNode().activeElement===r}function R(r,e){let t=(e instanceof Element?e:e.parentElement)?.closest("[slot]");return!!t&&t!==r&&r.contains(t)}var E=r=>r.isComposing||r.keyCode===229;function p(r,e){r.dispatchEvent(new Event(e,{bubbles:!0,composed:!0}))}function v(r,e){let t=!1,i=()=>{t||(t=!0,window.removeEventListener(r.type,n),clearTimeout(s),e())},n=a=>{a===r&&i()};window.addEventListener(r.type,n);let s=setTimeout(i,0)}function M(r,e){return e.attribute??r.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function Ge(r,e,t){return e.reflect??r!==t.form?.valueProp}function O(r,e){switch(r.type){case"boolean":return e!==null;case"number":{if(e===null||e.trim()==="")return r.default;let t=Number(e);return Number.isFinite(t)?t:r.default}case"string":{let t=r.default??"";return e===null||r.values&&!r.values.includes(e)?t:e}}}function We(r,e){return r.type==="boolean"?!!e:r.type==="number"&&typeof e=="number"?Number.isFinite(e)?e:r.default:O(r,e==null?null:String(e))}function Ye(r,e){switch(r.type){case"boolean":return e?"":null;case"number":return Number.isFinite(e)?String(e):null;case"string":return e===""&&!r.default?null:String(e)}}function Xe(r,e){let t={};for(let[i,n]of Object.entries(r))t[i]=O(n,e(M(i,n)));return t}var Nt=globalThis.HTMLElement??class{},Ze=new WeakMap,Je=new WeakSet;function Ft(r){let e=Ze.get(r);return e||(e=new CSSStyleSheet,e.replaceSync(r.styles),Ze.set(r,e)),e}var u=class r extends Nt{static extraProperties=[];static get observedAttributes(){return Object.entries(this.def.props).map(([e,t])=>M(e,t))}static define(){let e=this.def;for(let[i,n]of Object.entries(e.props)){if(this.definesAccessor(i))continue;let s=function(){return this.props[i]};Je.add(s),Object.defineProperty(this.prototype,i,{configurable:!0,enumerable:!0,get:s,set(a){this.setProp(i,We(n,a))}})}let t=globalThis.customElements;t&&!t.get(e.tag)&&t.define(e.tag,this)}static definesAccessor(e){if(Object.prototype.hasOwnProperty.call(this.prototype,e))return!0;let t=Object.getPrototypeOf(this.prototype);for(;t!==null&&t!==r.prototype;t=Object.getPrototypeOf(t)){let i=Object.getOwnPropertyDescriptor(t,e);if(i)return!(i.get&&Je.has(i.get))}return!1}internals;props;root=null;refs=new Map;reflecting=!1;hasConnected=!1;formDisabled=!1;authorTabIndex=null;writtenTabIndex;constructor(){super(),this.internals=this.attachInternals(),this.props=Xe(this.def.props,e=>this.getAttribute(e)),this.addEventListener("click",e=>{this.isDisabled&&(e.preventDefault(),e.stopImmediatePropagation())},{capture:!0})}connectedCallback(){this.hasConnected||(this.hasConnected=!0,this.upgradeProperties(),this.update(this.allKeys()),this.ensureRoot()),this.connected()}disconnectedCallback(){this.disconnected()}attributeChangedCallback(e,t,i){if(!this.reflecting){for(let[n,s]of Object.entries(this.def.props))if(M(n,s)===e){this.setProp(n,O(s,i),!0);return}}}formDisabledCallback(e){this.formDisabled=e,this.propChanged("disabled")}get def(){return this.constructor.def}get isDisabled(){return this.props.disabled===!0||this.formDisabled}ref(e){if(!this.root)return null;let t=this.refs.get(e);if(!t){let i=this.root.querySelector(`[data-ref="${e}"]`);if(!i)return null;this.refs.set(e,i),t=i}return t}setProp(e,t,i=!1){let n=this.def.props[e];!n||Object.is(this.props[e],t)||(this.props[e]=t,!i&&Ge(e,n,this.def)&&this.reflect(e,n,t),this.propChanged(e))}toggleState(e,t){t?this.internals.states.add(e):this.internals.states.delete(e)}syncFocusable(e){let t=this.getAttribute("tabindex");t!==this.writtenTabIndex&&(this.authorTabIndex=t);let i=e?this.authorTabIndex??"0":null;i===null?this.removeAttribute("tabindex"):t!==i&&this.setAttribute("tabindex",i),this.writtenTabIndex=i}syncDisabledState(){this.internals.ariaDisabled=this.isDisabled?"true":null,this.syncFocusable(!this.isDisabled)}willUpdate(e){}update(e){}rendered(){}connected(){}disconnected(){}allKeys(){return new Set(Object.keys(this.def.props))}propChanged(e){let t=new Set([e]);this.willUpdate(t),this.hasConnected&&this.update(t)}reflect(e,t,i){let n=Ye(t,i),s=M(e,t);this.reflecting=!0;try{n===null?this.removeAttribute(s):this.setAttribute(s,n)}finally{this.reflecting=!1}}upgradeProperties(){let e=this.constructor,t=this;for(let i of[...Object.keys(e.def.props),...e.extraProperties]){if(!Object.prototype.hasOwnProperty.call(this,i))continue;let n=t[i];delete t[i],t[i]=n}}ensureRoot(e){if(this.root)return;let t=this.internals.shadowRoot,i=t?[...this.def.template(this.props).value.matchAll(/data-ref="([^"]+)"/g)].map(n=>n[1]):[];if(!e&&document.readyState==="loading"&&this.parsing(t,i)){this.waitForParser(t,i);return}(!t||this.parsing(t,i))&&(t??=this.attachShadow({mode:"open",delegatesFocus:this.def.delegatesFocus??!1}),t.innerHTML=this.def.template(this.props).value),this.adoptRoot(t)}parsing(e,t){if(e)return t.some(i=>!e.querySelector(`[data-ref="${i}"]`));if(this.firstChild!==null||this.nextSibling!==null)return!1;for(let i=this.parentNode;i!==null;i=i.parentNode)if(i.nextSibling!==null)return!1;return!0}waitForParser(e,t){let i=s=>{n.disconnect(),document.removeEventListener("DOMContentLoaded",i),this.ensureRoot(s)},n=new MutationObserver(()=>{this.parsing(e,t)||i()});n.observe(e??document,{childList:!0,subtree:!0}),document.addEventListener("DOMContentLoaded",i)}adoptRoot(e){this.root=e,e.adoptedStyleSheets=[Ft(this.def)],e.querySelector("style[data-neu-ssr]")?.remove(),this.rendered(),this.update(this.allKeys())}};var Qe=Symbol("neu.raw"),qt={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function Bt(r){return r.replace(/[&<>"']/g,e=>qt[e]??e)}function f(r){return{[Qe]:!0,value:r}}function Kt(r){return typeof r=="object"&&r!==null&&Qe in r}function et(r){return r==null||r===!1?"":Array.isArray(r)?r.map(et).join(""):Kt(r)?r.value:Bt(String(r))}function o(r,...e){let t=r[0]??"";return e.forEach((i,n)=>{t+=et(i)+(r[n+1]??"")}),f(t)}var le='<path d="M5 12.5l4.5 4.5L19 7.5"/>',de='<path d="M6 9l6 6 6-6"/>',Ut='<path d="M6 15l6-6 6 6"/>',ue='<path d="M12 5v14M5 12h14"/>',$='<path d="M5 12h14"/>',jt='<path d="M6 6l12 12M18 6L6 18"/>',Gt='<circle cx="12" cy="12" r="9"/><path d="M12 7.5v5.5M12 16.5h.01"/>',Wt='<circle cx="12" cy="8" r="4"/><path d="M4 20c0-4 3.6-6 8-6s8 2 8 6"/>',tt={check:le,"chevron-down":de,"chevron-up":Ut,plus:ue,minus:$,x:jt,"alert-circle":Gt,user:Wt};function y(r,e){return`<svg${e?` part="${e}"`:""} viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false">${r}</svg>`}function x(r){let e=Object.hasOwn(tt,r)?tt[r]:void 0;return e===void 0?void 0:y(e,"svg")}var d=`
2
2
  :host {
3
3
  --_neu-bg: var(--neu-bg, #e0e5ec);
4
4
  --_neu-accent-c: var(--neu-accent, #6d5dfc);
@@ -25,7 +25,7 @@ function h(r,e){r&&r.textContent!==e&&(r.textContent=e)}function u(r,e,t){r&&(t=
25
25
  :host([hidden]) { display: none !important; }
26
26
  :host(:focus) { outline: none; }
27
27
  *, *::before, *::after { box-sizing: border-box; }
28
- `,d=[{name:"--neu-bg",description:"Surface colour; shadows and text are derived from it."},{name:"--neu-accent",description:"Accent colour."},{name:"--neu-distance",description:"Shadow distance for the md size."},{name:"--neu-intensity",description:"Shadow strength multiplier."},{name:"--neu-radius",description:"Corner radius for the md size."}];var ae='<path d="M5 12.5l4.5 4.5L19 7.5"/>',le='<path d="M6 9l6 6 6-6"/>',qt='<path d="M6 15l6-6 6 6"/>',de='<path d="M12 5v14M5 12h14"/>',A='<path d="M5 12h14"/>',Kt='<path d="M6 6l12 12M18 6L6 18"/>',Ut='<circle cx="12" cy="12" r="9"/><path d="M12 7.5v5.5M12 16.5h.01"/>',Wt='<circle cx="12" cy="8" r="4"/><path d="M4 20c0-4 3.6-6 8-6s8 2 8 6"/>',Qe={check:ae,"chevron-down":le,"chevron-up":qt,plus:de,minus:A,x:Kt,"alert-circle":Ut,user:Wt};function x(r){return`<svg part="svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false">${r}</svg>`}function w(r){let e=Object.hasOwn(Qe,r)?Qe[r]:void 0;return e===void 0?void 0:x(e)}var et=`${c}
28
+ `;var rt=`${d}
29
29
  :host { display: inline-block; vertical-align: middle; --_neu-s: 2.5rem; inline-size: var(--_neu-s); block-size: var(--_neu-s); }
30
30
  :host([size='sm']) { --_neu-s: 2rem; }
31
31
  :host([size='lg']) { --_neu-s: 3.5rem; }
@@ -36,7 +36,7 @@ function h(r,e){r&&r.textContent!==e&&(r.textContent=e)}function u(r,e,t){r&&(t=
36
36
  .base[data-show='image'] .image, .base[data-show='initials'] .initials { display: block; }
37
37
  .base[data-show='icon'] .icon { display: flex; inline-size: 60%; block-size: 60%; }
38
38
  .icon svg { inline-size: 100%; block-size: 100%; }
39
- `;var ce={tag:"neu-avatar",props:{src:{type:"string",reflect:!0},label:{type:"string"},initials:{type:"string"},size:{type:"string",default:"md",values:["sm","md","lg"],reflect:!0},shape:{type:"string",default:"circle",values:["circle","rounded"],reflect:!0}},styles:et,template:r=>{let e=r.src?"image":r.initials?"initials":"icon";return o`<span part="base" class="base" data-ref="base" data-show="${e}"><img part="image" class="image" data-ref="image" alt=""${r.src?o` src="${r.src}"`:""}><span part="initials" class="initials" data-ref="initials">${r.initials}</span><span part="icon" class="icon">${f(w("user")??"")}</span></span>`},docs:{summary:"A user picture that falls back to initials, then to a generic user icon. With `label` it is an image named by it; without, it is decorative and hidden from assistive technology.",events:[],slots:[],parts:[{name:"base",description:"The sized, raised wrapper."},{name:"image",description:"The picture."},{name:"initials",description:"The initials shown when there is no picture."},{name:"icon",description:"Wrapper around the fallback user icon."},{name:"svg",description:"The rendered fallback SVG element."}],cssProperties:d}};var R=class extends p{static def=ce;broken=!1;willUpdate(e){e.has("src")&&this.setBroken(!1)}rendered(){let e=this.ref("image");e&&(e.addEventListener("error",()=>this.setBroken(!0)),e.hasAttribute("src")&&e.complete&&e.naturalWidth===0&&(this.broken=!0),this.toggleState("image-error",this.broken))}update(e){if(e.has("label")){let a=String(this.props.label);this.internals.role=a?"img":null,this.internals.ariaLabel=a||null,this.internals.ariaHidden=a?null:"true"}e.has("initials")&&h(this.ref("initials"),String(this.props.initials));let t=this.ref("image");if(!t)return;let i=String(this.props.src);e.has("src")&&(t.getAttribute("src")??"")!==i&&(i?t.setAttribute("src",i):t.removeAttribute("src"));let n=this.ref("base"),s=this.showing();n.dataset.show!==s&&(n.dataset.show=s)}showing(){return this.props.src&&!this.broken?"image":this.props.initials?"initials":"icon"}setBroken(e){this.broken!==e&&(this.broken=e,this.toggleState("image-error",e),this.ref("base")&&this.update(new Set))}};R.define();var tt=`${c}
39
+ `;var ce={tag:"neu-avatar",props:{src:{type:"string"},label:{type:"string"},initials:{type:"string"},size:{type:"string",default:"md",values:["sm","md","lg"]},shape:{type:"string",default:"circle",values:["circle","rounded"]}},styles:rt,template:r=>{let e=r.src?"image":r.initials.trim()?"initials":"icon";return o`<span part="base" class="base" data-ref="base" data-show="${e}"><img part="image" class="image" data-ref="image" alt=""${r.src?o` src="${r.src}"`:""}><span part="initials" class="initials" data-ref="initials">${r.initials}</span><span part="icon" class="icon">${f(x("user")??"")}</span></span>`}};var H=class extends u{static def=ce;broken=!1;willUpdate(e){e.has("src")&&this.setBroken(!1)}rendered(){let e=this.ref("image");e&&(e.addEventListener("error",()=>this.setBroken(!0)),e.addEventListener("load",()=>this.setBroken(!1)),e.hasAttribute("src")&&e.complete&&e.naturalWidth===0&&(this.broken=!0),this.toggleState("image-error",this.broken))}update(e){if(e.has("label")){let a=String(this.props.label);this.internals.role=a?"img":null,this.internals.ariaLabel=a||null,this.internals.ariaHidden=a?null:"true"}e.has("initials")&&m(this.ref("initials"),String(this.props.initials));let t=this.ref("image");if(!t)return;let i=String(this.props.src);e.has("src")&&(t.getAttribute("src")??"")!==i&&(i?t.setAttribute("src",i):t.removeAttribute("src"));let n=this.ref("base"),s=this.showing();n.dataset.show!==s&&(n.dataset.show=s)}showing(){return this.props.src&&!this.broken?"image":String(this.props.initials).trim()?"initials":"icon"}setBroken(e){this.broken!==e&&(this.broken=e,this.toggleState("image-error",e),this.ref("base")&&this.update(new Set))}};H.define();var it=`${d}
40
40
  :host { display: inline-block; vertical-align: middle; --_neu-success: var(--neu-success, #3bb273); --_neu-warning: var(--neu-warning, #e6a23c); }
41
41
  .base { display: inline-flex; align-items: center; min-block-size: 1.25rem; padding-inline: 0.5rem; font-size: 0.75rem; font-weight: 600; border-radius: calc(var(--_neu-r) * 0.5); box-shadow: var(--_neu-raised-sm); background: var(--_neu-bg); color: var(--_neu-fg-muted); }
42
42
  :host([pill]) .base { border-radius: 999px; }
@@ -44,7 +44,7 @@ function h(r,e){r&&r.textContent!==e&&(r.textContent=e)}function u(r,e,t){r&&(t=
44
44
  :host([variant='success']) .base { color: var(--_neu-success); }
45
45
  :host([variant='warning']) .base { color: var(--_neu-warning); }
46
46
  :host([variant='danger']) .base { color: var(--_neu-danger); }
47
- `;var pe={tag:"neu-badge",props:{variant:{type:"string",default:"neutral",values:["neutral","accent","success","warning","danger"],reflect:!0},pill:{type:"boolean",reflect:!0}},styles:tt,template:()=>o`<span part="base" class="base"><slot></slot></span>`,docs:{summary:"A small raised label for status or counts.",events:[],slots:[{name:"",description:"The badge text."}],parts:[{name:"base",description:"The badge itself."}],cssProperties:[...d,{name:"--neu-success",description:"Colour of the success variant."},{name:"--neu-warning",description:"Colour of the warning variant."}]}};var O=class extends p{static def=pe};O.define();var ue=new WeakSet,rt=!1;function S(r){ue.add(r),setTimeout(()=>ue.delete(r),0)}var me=Symbol.for("neu-ui.submits");function he(r){return r instanceof HTMLButtonElement?r.type==="submit":r instanceof HTMLInputElement?r.type==="submit"||r.type==="image":r.constructor[me]===!0&&r.type==="submit"}function it(r){let e=r.form;return e instanceof HTMLFormElement?e:null}function jt(){rt||typeof document>"u"||(rt=!0,document.addEventListener("click",r=>{for(let e of r.composedPath()){if(!(e instanceof Element)||!he(e))continue;let t=it(e);t&&S(t);return}},{capture:!0}),document.addEventListener("keydown",r=>{if(!(r.key!=="Enter"||!(r.composedPath()[0]instanceof HTMLInputElement)))for(let e of r.composedPath()){if(!(e instanceof Element))continue;let t=it(e);if(t){S(t);return}}},{capture:!0}))}var b=class extends p{static formAssociated=!0;interacted=!1;constructor(){super(),jt(),this.addEventListener("invalid",()=>{let e=this.internals.form;e&&ue.has(e)&&this.markInteracted()})}get form(){return this.internals.form}get validity(){return this.internals.validity}get validationMessage(){return this.internals.validationMessage}get willValidate(){return this.internals.willValidate}checkValidity(){return this.internals.checkValidity()}reportValidity(){let e=this.internals.reportValidity();return e||this.markInteracted(),e}formResetCallback(){this.interacted=!1,this.resetToDefault(),this.commit()}formStateRestoreCallback(e){typeof e=="string"&&(this.restoreState(e),this.commit())}formState(){return this.formValue()??""}commit(){this.internals.setFormValue(this.formValue(),this.formState()),this.validate(),this.syncUserInvalid()}markInteracted(){this.interacted=!0,this.syncUserInvalid()}syncUserInvalid(){this.toggleState("user-invalid",this.interacted&&!this.internals.validity.valid)}};function F(r,e,t,i){let n=a=>a?e.add("pressed"):e.delete("pressed"),s=a=>g(a,()=>{!a.defaultPrevented&&!i()&&r.click()});r.addEventListener("keydown",a=>{if(!i())if(a.key===" "){if(a.defaultPrevented)return;a.preventDefault(),n(!0)}else a.key==="Enter"&&(t==="repeat"||t==="once"&&!a.repeat)&&s(a)}),r.addEventListener("keyup",a=>{a.key!==" "||!e.has("pressed")||(n(!1),s(a))}),r.addEventListener("blur",()=>{Ue(r)||n(!1)}),r.addEventListener("focus",()=>n(!1))}var nt=r=>`${c}
47
+ `;var pe={tag:"neu-badge",props:{variant:{type:"string",default:"neutral",values:["neutral","accent","success","warning","danger"]},pill:{type:"boolean"}},styles:it,template:()=>o`<span part="base" class="base"><slot></slot></span>`};var V=class extends u{static def=pe};V.define();var me=new WeakSet,nt=!1;function w(r){me.add(r),setTimeout(()=>me.delete(r),0)}var he=Symbol.for("neu-ui.submits");function fe(r){return r instanceof HTMLButtonElement?r.type==="submit":r instanceof HTMLInputElement?r.type==="submit"||r.type==="image":r.constructor[he]===!0&&r.type==="submit"}function st(r){let e=r.form;return e instanceof HTMLFormElement?e:null}function Yt(){nt||typeof document>"u"||(nt=!0,document.addEventListener("click",r=>{for(let e of r.composedPath()){if(!(e instanceof Element)||!fe(e))continue;let t=st(e);t&&w(t);return}},{capture:!0}),document.addEventListener("keydown",r=>{if(!(r.key!=="Enter"||E(r)||!(r.composedPath()[0]instanceof HTMLInputElement)))for(let e of r.composedPath()){if(!(e instanceof Element))continue;let t=st(e);if(t){w(t);return}}},{capture:!0}))}var b=class extends u{static formAssociated=!0;interacted=!1;constructor(){super(),Yt(),this.addEventListener("invalid",()=>{let e=this.internals.form;e&&me.has(e)&&this.markInteracted()})}get form(){return this.internals.form}get validity(){return this.internals.validity}get validationMessage(){return this.internals.validationMessage}get willValidate(){return this.internals.willValidate}checkValidity(){return this.internals.checkValidity()}reportValidity(){let e=this.internals.reportValidity();return e||this.markInteracted(),e}formResetCallback(){this.interacted=!1,this.resetToDefault(),this.commit()}formStateRestoreCallback(e){typeof e=="string"&&(this.restoreState(e),this.commit())}formState(){return this.formValue()??""}commit(){this.internals.setFormValue(this.formValue(),this.formState()),this.validate(),this.syncUserInvalid()}markInteracted(){this.interacted=!0,this.syncUserInvalid()}syncUserInvalid(){this.toggleState("user-invalid",this.interacted&&!this.internals.validity.valid)}};function N(r,e,t,i){let n=a=>a?e.add("pressed"):e.delete("pressed"),s=a=>v(a,()=>{!a.defaultPrevented&&!i()&&r.click()});r.addEventListener("keydown",a=>{if(!i())if(a.key===" "){if(a.defaultPrevented)return;a.preventDefault(),n(!0)}else a.key==="Enter"&&(t==="repeat"||t==="once"&&!a.repeat)&&s(a)}),r.addEventListener("keyup",a=>{a.key!==" "||!e.has("pressed")||(n(!1),s(a))}),r.addEventListener("blur",()=>{je(r)||n(!1)}),r.addEventListener("focus",()=>n(!1))}var ot=r=>`${d}
48
48
  :host { display: inline-block; vertical-align: middle; cursor: pointer; user-select: none; }
49
49
  :host(:disabled), :host([disabled])${r?", :host([loading])":""} { cursor: not-allowed; }
50
50
  .base {
@@ -63,7 +63,7 @@ function h(r,e){r&&r.textContent!==e&&(r.textContent=e)}function u(r,e,t){r&&(t=
63
63
  :host(:active:not(:disabled):not([disabled])${r?":not([loading])":""}) .base, :host(:state(pressed)) .base { box-shadow: var(--_neu-inset-sm); }
64
64
  :host(:focus-visible) .base { box-shadow: var(--_neu-grp-shadow, var(--_neu-raised)), var(--_neu-focus); }
65
65
  :host(:disabled) .base, :host([disabled]) .base { box-shadow: none; color: var(--_neu-fg-muted); }
66
- `,st=nt(!1),ot=`${nt(!0)}
66
+ `,at=ot(!1),lt=`${ot(!0)}
67
67
  .base { min-block-size: 2.5rem; padding-inline: 1.125rem; font: inherit; font-weight: 600; font-size: 0.9375rem; line-height: 1; }
68
68
  :host([size='sm']) .base { min-block-size: 2rem; padding-inline: 0.875rem; font-size: 0.8125rem; }
69
69
  :host([size='lg']) .base { min-block-size: 3rem; padding-inline: 1.5rem; font-size: 1.0625rem; }
@@ -78,7 +78,7 @@ function h(r,e){r&&r.textContent!==e&&(r.textContent=e)}function u(r,e,t){r&&(t=
78
78
  :host([loading]) .spinner { display: inline-block; }
79
79
  @keyframes neu-spin { to { transform: rotate(360deg); } }
80
80
  @media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }
81
- `;var fe={tag:"neu-button",props:{variant:{type:"string",default:"default",values:["default","primary","flat"],reflect:!0},size:{type:"string",default:"md",values:["sm","md","lg"],reflect:!0},disabled:{type:"boolean",reflect:!0},loading:{type:"boolean",reflect:!0},type:{type:"string",default:"button",values:["button","submit","reset"],reflect:!0}},styles:ot,template:()=>o`<span part="base" class="base"><span part="prefix" class="prefix"><slot name="prefix"></slot></span><span part="label" class="label"><slot></slot></span><span part="suffix" class="suffix"><slot name="suffix"></slot></span><span part="spinner" class="spinner" aria-hidden="true"></span></span>`,docs:{summary:'A raised button. Use variant="primary" for the main action of a view.',events:[{name:"click",description:"Fired on activation; never while disabled or loading."}],slots:[{name:"",description:"Button label."},{name:"prefix",description:"Content before the label, such as an icon."},{name:"suffix",description:"Content after the label."}],parts:[{name:"base",description:"The raised surface."},{name:"label",description:"Wrapper around the default slot."},{name:"prefix",description:"Wrapper around the prefix slot."},{name:"suffix",description:"Wrapper around the suffix slot."},{name:"spinner",description:"Spinner shown while loading."}],cssProperties:d}};var E=class extends p{static def=fe;static formAssociated=!0;static[me]=!0;constructor(){super(),this.internals.role="button",this.addEventListener("click",e=>this.onClickCapture(e),{capture:!0}),this.addEventListener("click",e=>this.onClick(e)),F(this,this.internals.states,"repeat",()=>this.inactive)}get form(){return this.internals.form}get inactive(){return this.isDisabled||this.props.loading===!0}onClickCapture(e){this.props.loading===!0&&(e.preventDefault(),e.stopImmediatePropagation())}onClick(e){g(e,()=>{let t=this.internals.form;e.defaultPrevented||!t||(this.props.type==="submit"?(S(t),t.requestSubmit()):this.props.type==="reset"&&t.reset())})}update(e){(e.has("disabled")||e.has("loading"))&&(this.syncDisabledState(),this.internals.ariaBusy=this.props.loading===!0?"true":null)}};E.define();var at=`${c}
81
+ `;var be={tag:"neu-button",props:{variant:{type:"string",default:"default",values:["default","primary","flat"]},size:{type:"string",default:"md",values:["sm","md","lg"]},disabled:{type:"boolean"},loading:{type:"boolean"},type:{type:"string",default:"button",values:["button","submit","reset"]}},styles:lt,template:()=>o`<span part="base" class="base"><span part="prefix" class="prefix"><slot name="prefix"></slot></span><span part="label" class="label"><slot></slot></span><span part="suffix" class="suffix"><slot name="suffix"></slot></span><span part="spinner" class="spinner" aria-hidden="true"></span></span>`};var L=class extends u{static def=be;static formAssociated=!0;static[he]=!0;constructor(){super(),this.internals.role="button",this.addEventListener("click",e=>this.onClickCapture(e),{capture:!0}),this.addEventListener("click",e=>this.onClick(e)),N(this,this.internals.states,"repeat",()=>this.inactive)}get form(){return this.internals.form}get inactive(){return this.isDisabled||this.props.loading===!0}onClickCapture(e){this.props.loading===!0&&(e.preventDefault(),e.stopImmediatePropagation())}onClick(e){v(e,()=>{let t=this.internals.form;e.defaultPrevented||!t||(this.props.type==="submit"?(w(t),t.requestSubmit()):this.props.type==="reset"&&t.reset())})}update(e){(e.has("disabled")||e.has("loading"))&&(this.syncDisabledState(),this.internals.ariaBusy=this.props.loading===!0?"true":null)}};L.define();var dt=`${d}
82
82
  :host { display: inline-flex; vertical-align: middle; }
83
83
  .base { display: inline-flex; border-radius: var(--_neu-r); box-shadow: var(--_neu-raised); }
84
84
  :host([orientation='vertical']) .base { flex-direction: column; }
@@ -89,7 +89,7 @@ function h(r,e){r&&r.textContent!==e&&(r.textContent=e)}function u(r,e,t){r&&(t=
89
89
  :host(:not([orientation='vertical'])) ::slotted(:nth-last-child(1 of :not([hidden], template, script, style))) { --_neu-grp-se: var(--_neu-r); --_neu-grp-ee: var(--_neu-r); }
90
90
  :host([orientation='vertical']) ::slotted(:nth-child(1 of :not([hidden], template, script, style))) { --_neu-grp-ss: var(--_neu-r); --_neu-grp-se: var(--_neu-r); }
91
91
  :host([orientation='vertical']) ::slotted(:nth-last-child(1 of :not([hidden], template, script, style))) { --_neu-grp-es: var(--_neu-r); --_neu-grp-ee: var(--_neu-r); }
92
- `;var be={tag:"neu-button-group",props:{label:{type:"string",reflect:!0},orientation:{type:"string",default:"horizontal",values:["horizontal","vertical"],reflect:!0}},styles:at,template:()=>o`<span part="base" class="base"><slot></slot></span>`,docs:{summary:"Merges adjacent buttons into one raised block.",events:[],slots:[{name:"",description:"neu-button and neu-icon-button elements."}],parts:[{name:"base",description:"The raised wrapper around the buttons."}],cssProperties:d}};var H=class extends p{static def=be;constructor(){super(),this.internals.role="group"}update(e){e.has("label")&&(this.internals.ariaLabel=String(this.props.label)||null)}};H.define();var lt=new Map;function L(r,e){let t=lt.get(r);if(t===void 0){let i=r==="select"?document.createElement("select"):Object.assign(document.createElement("input"),{type:r});i.required=!0,t=i.validationMessage||e,lt.set(r,t)}return t}function dt(r){return{badInput:r.badInput,customError:r.customError,patternMismatch:r.patternMismatch,rangeOverflow:r.rangeOverflow,rangeUnderflow:r.rangeUnderflow,stepMismatch:r.stepMismatch,tooLong:r.tooLong,tooShort:r.tooShort,typeMismatch:r.typeMismatch,valueMissing:r.valueMissing}}var D=class extends b{static extraProperties=["defaultChecked"];static enter="once";current;dirty=!1;constructor(){super(),this.current=this.props.checked===!0,this.addEventListener("click",e=>this.onClick(e)),F(this,this.internals.states,this.constructor.enter,()=>this.isDisabled)}get checked(){return this.current}set checked(e){this.dirty=!0,this.setCurrent(!!e)}get defaultChecked(){return this.props.checked===!0}set defaultChecked(e){this.toggleAttribute("checked",!!e)}ariaCheckedValue(){return this.current?"true":"false"}flip(){let e=this.current;return this.setCurrent(!e),()=>this.setCurrent(e)}onClick(e){this.dirty=!0;let t=this.flip(),i=this.ariaCheckedValue();g(e,()=>{e.defaultPrevented?t():this.isConnected&&this.ariaCheckedValue()===i&&(this.markInteracted(),m(this,"input"),m(this,"change"))})}sync(){this.toggleState("checked",this.current),this.internals.ariaChecked=this.ariaCheckedValue(),this.paint()}setCurrent(e){this.current=e,this.sync(),this.commit()}willUpdate(e){e.has("checked")&&!this.dirty&&(this.current=this.props.checked===!0)}update(e){e.has("disabled")&&this.syncDisabledState(),e.has("checked")?this.setCurrent(this.current):(e.has("required")||e.has("value"))&&this.commit()}formValue(){return this.current?String(this.props.value):null}formState(){return this.current?"checked":"unchecked"}validate(){this.props.required===!0&&!this.current?this.internals.setValidity({valueMissing:!0},L("checkbox","Please check this box if you want to proceed."),this.ref(this.anchor)??void 0):this.internals.setValidity({})}resetToDefault(){this.dirty=!1,this.setCurrent(this.props.checked===!0)}restoreState(e){this.dirty=!0,this.setCurrent(e==="checked")}};var ct=`${c}
92
+ `;var ve={tag:"neu-button-group",props:{label:{type:"string"},orientation:{type:"string",default:"horizontal",values:["horizontal","vertical"]}},styles:dt,template:()=>o`<span part="base" class="base"><slot></slot></span>`};var F=class extends u{static def=ve;constructor(){super(),this.internals.role="group"}update(e){e.has("label")&&(this.internals.ariaLabel=String(this.props.label)||null)}};F.define();var ut=new Map;function T(r,e){let t=ut.get(r);if(t===void 0){let i=r==="select"?document.createElement("select"):Object.assign(document.createElement("input"),{type:r});i.required=!0,t=i.validationMessage||e,ut.set(r,t)}return t}function ct(r){return{badInput:r.badInput,customError:r.customError,patternMismatch:r.patternMismatch,rangeOverflow:r.rangeOverflow,rangeUnderflow:r.rangeUnderflow,stepMismatch:r.stepMismatch,tooLong:r.tooLong,tooShort:r.tooShort,typeMismatch:r.typeMismatch,valueMissing:r.valueMissing}}var D=class extends b{static extraProperties=["defaultChecked"];static enter="once";current;dirty=!1;constructor(){super(),this.current=this.props.checked===!0,this.addEventListener("click",e=>this.onClick(e)),N(this,this.internals.states,this.constructor.enter,()=>this.isDisabled)}get checked(){return this.current}set checked(e){this.dirty=!0,this.setCurrent(!!e)}get defaultChecked(){return this.props.checked===!0}set defaultChecked(e){this.toggleAttribute("checked",!!e)}ariaCheckedValue(){return this.current?"true":"false"}flip(){let e=this.current;return this.setCurrent(!e),()=>this.setCurrent(e)}onClick(e){this.dirty=!0;let t=this.flip(),i=this.ariaCheckedValue();v(e,()=>{e.defaultPrevented?t():this.isConnected&&this.ariaCheckedValue()===i&&(this.markInteracted(),p(this,"input"),p(this,"change"))})}sync(){this.toggleState("checked",this.current),this.internals.ariaChecked=this.ariaCheckedValue(),this.paint()}setCurrent(e){this.current=e,this.sync(),this.commit()}willUpdate(e){e.has("checked")&&!this.dirty&&(this.current=this.props.checked===!0)}update(e){e.has("disabled")&&this.syncDisabledState(),e.has("checked")?this.setCurrent(this.current):(e.has("required")||e.has("value"))&&this.commit()}formValue(){return this.current?String(this.props.value):null}formState(){return this.current?"checked":"unchecked"}validate(){this.props.required===!0&&!this.current?this.internals.setValidity({valueMissing:!0},T("checkbox","Please check this box if you want to proceed."),this.ref(this.anchor)??void 0):this.internals.setValidity({})}resetToDefault(){this.dirty=!1,this.setCurrent(this.props.checked===!0)}restoreState(e){this.dirty=!0,this.setCurrent(e==="checked")}};var pt=`${d}
93
93
  :host {
94
94
  display: inline-flex; vertical-align: middle; cursor: pointer; user-select: none;
95
95
  --_neu-box: 1.25rem;
@@ -115,20 +115,20 @@ function h(r,e){r&&r.textContent!==e&&(r.textContent=e)}function u(r,e,t){r&&(t=
115
115
  :host(:disabled) .base, :host([disabled]) .base { opacity: 0.55; }
116
116
  :host(:state(user-invalid)) .control { box-shadow: var(--_neu-inset-sm), 0 0 0 2px color-mix(in oklab, var(--_neu-danger) 55%, transparent); }
117
117
  .label { color: var(--_neu-fg); }
118
- `;var Gt=f(x(ae)),Yt=f(x(A)),ve={tag:"neu-checkbox",props:{checked:{type:"boolean"},indeterminate:{type:"boolean"},name:{type:"string",reflect:!0},value:{type:"string",default:"on",reflect:!0},disabled:{type:"boolean",reflect:!0},required:{type:"boolean",reflect:!0},size:{type:"string",default:"md",values:["sm","md","lg"],reflect:!0}},form:{valueProp:"checked"},styles:ct,template:r=>o`<span part="base" class="base"><span part="control" class="control${r.checked?" on":""}${r.indeterminate?" mixed":""}" data-ref="control"><span part="indicator" class="indicator">${Gt}${Yt}</span></span><span part="label" class="label"><slot></slot></span></span>`,docs:{summary:"A checkbox. The checked attribute is the default state; indeterminate is a property whose attribute only sets the initial state.",events:[{name:"input",description:"Fired when the user toggles the checkbox."},{name:"change",description:"Fired after input when the user toggles the checkbox."}],slots:[{name:"",description:"Label; also the accessible name."}],parts:[{name:"base",description:"Wrapper around control and label."},{name:"control",description:"The inset box."},{name:"indicator",description:"The check or minus mark."},{name:"label",description:"Wrapper around the default slot."}],cssProperties:d}};var V=class extends D{static def=ve;static enter="none";anchor="control";constructor(){super(),this.internals.role="checkbox"}ariaCheckedValue(){return this.props.indeterminate===!0?"mixed":super.ariaCheckedValue()}flip(){if(!(this.props.indeterminate===!0))return super.flip();let t=this.checked;return this.setProp("indeterminate",!1),this.checked=!t,()=>{this.setProp("indeterminate",!0),this.checked=t}}paint(){let e=this.props.indeterminate===!0,t=this.ref("control");t?.classList.toggle("on",this.checked),t?.classList.toggle("mixed",e),this.toggleState("indeterminate",e)}update(e){super.update(e),e.has("indeterminate")&&this.sync()}};V.define();var pt=`${c}
118
+ `;var Xt=f(y(le)),Zt=f(y($)),ge={tag:"neu-checkbox",props:{checked:{type:"boolean"},indeterminate:{type:"boolean",reflect:!1},name:{type:"string"},value:{type:"string",default:"on"},disabled:{type:"boolean"},required:{type:"boolean"},size:{type:"string",default:"md",values:["sm","md","lg"]}},form:{valueProp:"checked"},styles:pt,template:r=>o`<span part="base" class="base"><span part="control" class="control${r.checked?" on":""}${r.indeterminate?" mixed":""}" data-ref="control"><span part="indicator" class="indicator">${Xt}${Zt}</span></span><span part="label" class="label"><slot></slot></span></span>`};var q=class extends D{static def=ge;static enter="none";anchor="control";constructor(){super(),this.internals.role="checkbox"}ariaCheckedValue(){return this.props.indeterminate===!0?"mixed":super.ariaCheckedValue()}flip(){if(!(this.props.indeterminate===!0))return super.flip();let t=this.checked;return this.setProp("indeterminate",!1),this.checked=!t,()=>{this.setProp("indeterminate",!0),this.checked=t}}paint(){let e=this.props.indeterminate===!0,t=this.ref("control");t?.classList.toggle("on",this.checked),t?.classList.toggle("mixed",e),this.toggleState("indeterminate",e)}update(e){super.update(e),e.has("indeterminate")&&this.sync()}};q.define();var mt=`${d}
119
119
  :host { display: block; margin-block: 0.75rem; }
120
120
  .base { display: block; border-block-start: 1px solid var(--_neu-sd); border-block-end: 1px solid var(--_neu-sl); }
121
121
  :host([orientation='vertical']) { display: inline-block; align-self: stretch; min-block-size: 1em; margin-block: 0; margin-inline: 0.75rem; }
122
122
  :host([orientation='vertical']) .base { block-size: 100%; min-block-size: 1em; border-block: 0; border-inline-start: 1px solid var(--_neu-sd); border-inline-end: 1px solid var(--_neu-sl); }
123
- `;var ge={tag:"neu-divider",props:{orientation:{type:"string",default:"horizontal",values:["horizontal","vertical"],reflect:!0}},styles:pt,template:()=>o`<span part="base" class="base"></span>`,docs:{summary:"A thin engraved line that separates content.",events:[],slots:[],parts:[{name:"base",description:"The engraved line."}],cssProperties:d}};var N=class extends p{static def=ge;constructor(){super(),this.internals.role="separator"}update(e){e.has("orientation")&&(this.internals.ariaOrientation=this.orientation)}};N.define();var ut=new Map,mt=new Map,ye=new Set;function Xt(r,e){if(r!=="system"){ut.set(r,e),mt.set(r,xe(r)+1);for(let t of[...ye])t(r)}}function ht(r){return ut.get(r)}function xe(r){return mt.get(r)??0}function ft(r){return ye.add(r),()=>ye.delete(r)}var ke="http://www.w3.org/2000/svg",Zt=new Set("svg g path circle ellipse line polyline polygon rect defs title desc symbol linearGradient radialGradient stop clipPath mask use".split(" ")),we=new Map,bt=new WeakMap,vt,Jt=0,Qt=/^on|^style=|href=(?!#)|\\|(?:image-set|src)\(|url\((?![\s'"]*#)/i;function gt(r){for(let{name:e,value:t}of[...r.attributes])Qt.test(`${e}=${t}`)&&r.removeAttribute(e);for(let e of[...r.childNodes])if(e.nodeType!==3){if(e.nodeType!==1||e.namespaceURI!==ke||!Zt.has(e.localName)){e.remove();continue}gt(e)}}function yt(r){vt??=new DOMParser;let e=r.replace(/<svg\b(?![^>]*\sxmlns\s*=)/,`<svg xmlns="${ke}"`),t=vt.parseFromString(e,"image/svg+xml").documentElement;return t.namespaceURI!==ke||t.localName!=="svg"||t.querySelector("parsererror")?null:(gt(t),t.removeAttribute("xmlns:xlink"),t.setAttribute("part","svg"),t.setAttribute("aria-hidden","true"),t.setAttribute("focusable","false"),t)}function er(r){let e=we.get(r);return e||(e=(async()=>{try{let t=await fetch(r);return t.ok?yt((await t.text()).trim()):null}catch{return null}})(),we.set(r,e),e.then(t=>t===null&&we.delete(r))),e}function xt(r,e,t){let i=++Jt;bt.set(r,i);let n=s=>{bt.get(r)===i&&r.replaceChildren(...s?[r.ownerDocument.importNode(s,!0)]:[])};if(e==="system"){r.innerHTML=w(t)??"";return}try{let s=t?String(ht(e)?.resolve(t)??"").trim():"";s.startsWith("<")?n(yt(s)):s?er(s).then(n):n(null)}catch{n(null)}}function B(r,e,t){let i,n,s=()=>`${e()}
123
+ `;var ye={tag:"neu-divider",props:{orientation:{type:"string",default:"horizontal",values:["horizontal","vertical"]}},styles:mt,template:()=>o`<span part="base" class="base"></span>`};var B=class extends u{static def=ye;constructor(){super(),this.internals.role="separator"}update(e){e.has("orientation")&&(this.internals.ariaOrientation=this.orientation)}};B.define();var ht=new Map,ft=new Map,xe=new Set;function Jt(r,e){if(r!=="system"){ht.set(r,e),ft.set(r,ke(r)+1);for(let t of[...xe])t(r)}}function bt(r){return ht.get(r)}function ke(r){return ft.get(r)??0}function vt(r){return xe.add(r),()=>xe.delete(r)}var we="http://www.w3.org/2000/svg",Qt=new Set("svg g path circle ellipse line polyline polygon rect defs title desc symbol linearGradient radialGradient stop clipPath mask use".split(" ")),_e=new Map,gt=new WeakMap,yt,er=0,tr=/^on|^style=|href=(?!#)|\\|(?:image-set|src)\(|url\((?![\s'"]*#)/i;function xt(r){for(let{name:e,value:t}of[...r.attributes])tr.test(`${e}=${t}`)&&r.removeAttribute(e);for(let e of[...r.childNodes])if(e.nodeType!==3){if(e.nodeType!==1||e.namespaceURI!==we||!Qt.has(e.localName)){e.remove();continue}xt(e)}}function kt(r){yt??=new DOMParser;let e=r.replace(/<svg\b(?![^>]*\sxmlns\s*=)/,`<svg xmlns="${we}"`),t=yt.parseFromString(e,"image/svg+xml").documentElement;return t.namespaceURI!==we||t.localName!=="svg"||t.querySelector("parsererror")?null:(xt(t),t.removeAttribute("xmlns:xlink"),t.setAttribute("part","svg"),t.setAttribute("aria-hidden","true"),t.setAttribute("focusable","false"),t)}function rr(r){let e=_e.get(r);return e||(e=(async()=>{try{let t=await fetch(r);return t.ok?kt((await t.text()).trim()):null}catch{return null}})(),_e.set(r,e),e.then(t=>t===null&&_e.delete(r))),e}function _t(r,e,t){let i=++er;gt.set(r,i);let n=s=>{gt.get(r)===i&&r.replaceChildren(...s?[r.ownerDocument.importNode(s,!0)]:[])};if(e==="system"){r.innerHTML=x(t)??"";return}try{let s=t?String(bt(e)?.resolve(t)??"").trim():"";s.startsWith("<")?n(kt(s)):s?rr(s).then(n):n(null)}catch{n(null)}}function K(r,e,t){let i,n,s=()=>`${e()}
124
124
  ${t()}
125
- ${xe(e())}`,a=()=>{let l=r();l&&(i===void 0&&e()==="system"&&(i=s()),s()!==i&&(i=s(),xt(l,e(),t())))};return{draw:a,connected:()=>{n??=ft(a),a()},disconnected:()=>{n?.(),n=void 0}}}var wt=`
125
+ ${ke(e())}`,a=()=>{let l=r();l&&(i===void 0&&e()==="system"&&(i=s()),s()!==i&&(i=s(),_t(l,e(),t())))};return{draw:a,connected:()=>{n??=vt(a),a()},disconnected:()=>{n?.(),n=void 0}}}var wt=`
126
126
  :host { display: inline-block; inline-size: 1em; block-size: 1em; vertical-align: -0.125em; color: inherit; }
127
127
  :host(:not(:defined)) { visibility: inherit !important; min-block-size: auto !important; }
128
128
  :host([hidden]) { display: none !important; }
129
129
  .box, svg { display: block; inline-size: 100%; block-size: 100%; }
130
130
  .box { contain: paint; }
131
- `;var _e={tag:"neu-icon",props:{name:{type:"string",reflect:!0},library:{type:"string",default:"system",reflect:!0},label:{type:"string",reflect:!0}},styles:wt,template:r=>{let e=r.library==="system"?w(r.name):void 0;return o`<span class="box" data-ref="box">${e===void 0?"":f(e)}</span>`},docs:{summary:"A vector icon from the built-in set or a registered icon library.",events:[],slots:[],parts:[{name:"svg",description:"The rendered SVG element."}],cssProperties:[]}};var q=class extends p{static def=_e;drawer=B(()=>this.ref("box"),()=>String(this.props.library),()=>String(this.props.name));update(e){if(e.has("label")){let t=String(this.props.label);this.internals.role=t?"img":null,this.internals.ariaLabel=t||null,this.internals.ariaHidden=t?null:"true"}(e.has("name")||e.has("library"))&&this.drawer.draw()}connected(){this.drawer.connected()}disconnected(){this.drawer.disconnected()}};q.define();var kt=`${st}
131
+ `;var Se={tag:"neu-icon",props:{name:{type:"string"},library:{type:"string",default:"system"},label:{type:"string"}},styles:wt,template:r=>{let e=r.library==="system"?x(r.name):void 0;return o`<span class="box" data-ref="box">${e===void 0?"":f(e)}</span>`}};var U=class extends u{static def=Se;drawer=K(()=>this.ref("box"),()=>String(this.props.library),()=>String(this.props.name));update(e){if(e.has("label")){let t=String(this.props.label);this.internals.role=t?"img":null,this.internals.ariaLabel=t||null,this.internals.ariaHidden=t?null:"true"}(e.has("name")||e.has("library"))&&this.drawer.draw()}connected(){this.drawer.connected()}disconnected(){this.drawer.disconnected()}};U.define();var St=`${at}
132
132
  :host { inline-size: 2.5rem; block-size: 2.5rem; }
133
133
  :host([size='sm']) { inline-size: 2rem; block-size: 2rem; }
134
134
  :host([size='lg']) { inline-size: 3rem; block-size: 3rem; }
@@ -138,14 +138,12 @@ ${xe(e())}`,a=()=>{let l=r();l&&(i===void 0&&e()==="system"&&(i=s()),s()!==i&&(i
138
138
  :host([size='sm']) .icon { inline-size: 1rem; block-size: 1rem; }
139
139
  :host([size='lg']) .icon { inline-size: 1.375rem; block-size: 1.375rem; }
140
140
  .icon svg { display: block; inline-size: 100%; block-size: 100%; }
141
- `;var Se={tag:"neu-icon-button",props:{icon:{type:"string"},library:{type:"string",default:"system"},label:{type:"string"},shape:{type:"string",default:"circle",values:["circle","square"],reflect:!0},variant:{type:"string",default:"default",values:["default","primary","flat"],reflect:!0},size:{type:"string",default:"md",values:["sm","md","lg"],reflect:!0},disabled:{type:"boolean",reflect:!0},type:{type:"string",default:"button",values:["button","submit","reset"],reflect:!0}},styles:kt,template:r=>{let e=r.library==="system"?w(r.icon):void 0;return o`<span part="base" class="base"><span part="icon" class="icon" data-ref="icon">${e===void 0?"":f(e)}</span></span>`},docs:{summary:"A raised button that shows an icon instead of a label. Name it with label.",events:[{name:"click",description:"Fired on activation; never while disabled."}],slots:[],parts:[{name:"base",description:"The raised surface."},{name:"icon",description:"Wrapper around the icon."},{name:"svg",description:"The rendered SVG element."}],cssProperties:d}};var K=class extends E{static def=Se;drawer=B(()=>this.ref("icon"),()=>String(this.props.library),()=>String(this.props.icon));update(e){super.update(e),(e.has("label")||e.has("icon"))&&(this.internals.ariaLabel=String(this.props.label||this.props.icon)||null),(e.has("icon")||e.has("library"))&&this.drawer.draw()}connected(){this.drawer.connected()}disconnected(){this.drawer.disconnected()}};K.define();var z=["value","required","disabled","readOnly","minLength","maxLength","errorText","autocomplete"];function _t(r){return(r??"").trim().toLowerCase()==="off"}var k=class extends b{dirty=!1;pendingValue=null;get value(){return this.input?.value??this.pendingValue??this.p.value}set value(e){let t=e==null?"":String(e);this.dirty=!0;let i=this.input;i?i.value=t:this.pendingValue=t,this.commit()}get defaultValue(){return this.p.value}set defaultValue(e){this.setAttribute("value",String(e))}focus(e){let t=this.input;t?t.focus(e):super.focus(e)}select(){this.input?.select()}setSelectionRange(e,t,i){this.input?.setSelectionRange(e,t,i)}get p(){return this.props}get input(){return this.ref("input")}controlKeyDown(e){}needsCommit(e){return this.commitProps.some(t=>e.has(t))}validityProbe(){let e=this.p,t=this.probe(this.value);return t.required=e.required,t.readOnly=e.readOnly,t.disabled=this.isDisabled,e.minLength>=0&&t.setAttribute("minlength",String(e.minLength)),e.maxLength>=0&&t.setAttribute("maxlength",String(e.maxLength)),t}rendered(){let e=this.input;e&&(e.value!==this.probe(this.p.value).value&&(this.dirty=!0),this.pendingValue!==null&&(e.value=this.pendingValue,this.pendingValue=null),e.addEventListener("input",()=>{this.dirty=!0,this.commit()}),e.addEventListener("change",()=>{this.markInteracted(),m(this,"change")}),e.addEventListener("keydown",t=>this.controlKeyDown(t)))}update(e){let t=this.p,i=this.input;i&&(e.has("value")&&(i.defaultValue!==t.value&&(i.defaultValue=t.value),this.dirty||(i.value=t.value)),e.has("placeholder")&&u(i,"placeholder",t.placeholder),e.has("required")&&(i.required=t.required),e.has("disabled")&&(i.disabled=this.isDisabled),e.has("readOnly")&&(i.readOnly=t.readOnly),e.has("minLength")&&u(i,"minlength",t.minLength>=0?String(t.minLength):""),e.has("maxLength")&&u(i,"maxlength",t.maxLength>=0?String(t.maxLength):""),e.has("autocomplete")&&u(i,"autocomplete",t.autocomplete),e.has("enterKeyHint")&&u(i,"enterkeyhint",t.enterKeyHint)),e.has("label")&&h(this.ref("label-text"),t.label),e.has("helpText")&&h(this.ref("help-text"),t.helpText),this.needsCommit(e)&&this.commit()}willUpdate(e){!this.isConnected&&!this.input&&this.needsCommit(e)&&this.commit()}formValue(){return this.value}formState(){let e=this.p.autocomplete?.trim();return _t(e||this.internals.form?.getAttribute("autocomplete"))?null:this.value}validate(){let e=this.input,t=e??this.validityProbe();!t.willValidate||t.validity.valid?this.internals.setValidity({}):this.internals.setValidity(dt(t.validity),t.validationMessage,e??void 0),h(this.ref("error-text"),this.p.errorText||e?.validationMessage||"")}resetToDefault(){this.dirty=!1,this.pendingValue=null;let e=this.input;e&&(e.value=this.p.value)}restoreState(e){this.dirty=!0;let t=this.input;t?t.value=e:this.pendingValue=e}};var tr=new Set(["text","search","url","tel","email","password","date","month","week","time","datetime-local","number"]),M=Symbol.for("neu-ui.blocks-implicit-submit"),rr=r=>r instanceof HTMLInputElement&&tr.has(r.type)||r.constructor[M]===!0;function U(r){if(!r)return;let e=[...r.elements],t=e.find(he);if(t){if(t.matches(":disabled")||t.hasAttribute("disabled"))return;S(r),t.click();return}e.filter(rr).length===1&&(S(r),r.requestSubmit())}var y=r=>r>0?r:1;var _=`${c}
141
+ `;var Ee={tag:"neu-icon-button",props:{icon:{type:"string"},library:{type:"string",default:"system"},label:{type:"string"},shape:{type:"string",default:"circle",values:["circle","square"]},variant:{type:"string",default:"default",values:["default","primary","flat"]},size:{type:"string",default:"md",values:["sm","md","lg"]},disabled:{type:"boolean"},type:{type:"string",default:"button",values:["button","submit","reset"]}},styles:St,template:r=>{let e=r.library==="system"?x(r.icon):void 0;return o`<span part="base" class="base"><span part="icon" class="icon" data-ref="icon">${e===void 0?"":f(e)}</span></span>`}};var j=class extends L{static def=Ee;drawer=K(()=>this.ref("icon"),()=>String(this.props.library),()=>String(this.props.icon));update(e){super.update(e),(e.has("label")||e.has("icon"))&&(this.internals.ariaLabel=String(this.props.label||this.props.icon)||null),(e.has("icon")||e.has("library"))&&this.drawer.draw()}connected(){this.drawer.connected()}disconnected(){this.drawer.disconnected()}};j.define();var z=["value","required","disabled","readOnly","minLength","maxLength","errorText","autocomplete"];function Et(r){return(r??"").trim().toLowerCase()==="off"}var k=class extends b{dirty=!1;pendingValue=null;get value(){return this.input?.value??this.pendingValue??this.p.value}set value(e){let t=e==null?"":String(e);this.dirty=!0;let i=this.input;i?i.value=t:this.pendingValue=t,this.commit()}get defaultValue(){return this.p.value}set defaultValue(e){this.setAttribute("value",String(e))}focus(e){let t=this.input;t?t.focus(e):super.focus(e)}select(){this.input?.select()}setSelectionRange(e,t,i){this.input?.setSelectionRange(e,t,i)}get p(){return this.props}get input(){return this.ref("input")}controlKeyDown(e){}needsCommit(e){return this.commitProps.some(t=>e.has(t))}validityProbe(){let e=this.p,t=this.probe(this.value);return t.required=e.required,t.readOnly=e.readOnly,t.disabled=this.isDisabled,e.minLength>=0&&t.setAttribute("minlength",String(e.minLength)),e.maxLength>=0&&t.setAttribute("maxlength",String(e.maxLength)),t}rendered(){let e=this.input;e&&(e.value!==this.probe(this.p.value).value&&(this.dirty=!0),this.pendingValue!==null&&(e.value=this.pendingValue,this.pendingValue=null),e.addEventListener("input",()=>{this.dirty=!0,this.commit()}),e.addEventListener("change",()=>{this.markInteracted(),p(this,"change")}),e.addEventListener("keydown",t=>this.controlKeyDown(t)))}update(e){let t=this.p,i=this.input;i&&(e.has("value")&&(i.defaultValue!==t.value&&(i.defaultValue=t.value),this.dirty||(i.value=t.value)),e.has("placeholder")&&c(i,"placeholder",t.placeholder),e.has("required")&&(i.required=t.required),e.has("disabled")&&(i.disabled=this.isDisabled),e.has("readOnly")&&(i.readOnly=t.readOnly),e.has("minLength")&&c(i,"minlength",t.minLength>=0?String(t.minLength):""),e.has("maxLength")&&c(i,"maxlength",t.maxLength>=0?String(t.maxLength):""),e.has("autocomplete")&&c(i,"autocomplete",t.autocomplete),e.has("enterKeyHint")&&c(i,"enterkeyhint",t.enterKeyHint)),e.has("label")&&m(this.ref("label-text"),t.label),e.has("helpText")&&m(this.ref("help-text"),t.helpText),this.needsCommit(e)&&this.commit()}willUpdate(e){!this.isConnected&&!this.input&&this.needsCommit(e)&&this.commit()}formValue(){return this.value}formState(){let e=this.p.autocomplete?.trim();return Et(e||this.internals.form?.getAttribute("autocomplete"))?null:this.value}validate(){let e=this.input,t=e??this.validityProbe();!t.willValidate||t.validity.valid?this.internals.setValidity({}):this.internals.setValidity(ct(t.validity),t.validationMessage,e??void 0),m(this.ref("error-text"),this.p.errorText||e?.validationMessage||"")}resetToDefault(){this.dirty=!1,this.pendingValue=null;let e=this.input;e&&(e.value=this.p.value)}restoreState(e){this.dirty=!0;let t=this.input;t?t.value=e:this.pendingValue=e}};var ir=new Set(["text","search","url","tel","email","password","date","month","week","time","datetime-local","number"]),A=Symbol.for("neu-ui.blocks-implicit-submit"),nr=r=>r instanceof HTMLInputElement&&ir.has(r.type)||r.constructor[A]===!0;function G(r){if(!r)return;let e=[...r.elements],t=e.find(fe);if(t){if(t.matches(":disabled")||t.hasAttribute("disabled"))return;w(r),t.click();return}e.filter(nr).length===1&&(w(r),r.requestSubmit())}var g=r=>r>0?r:1;var _=`${d}
142
142
  :host { display: block; }
143
143
  :host(:disabled), :host([disabled]) { cursor: not-allowed; }
144
144
  .base { display: flex; flex-direction: column; }
145
- .label-text, ::slotted([slot='label']) {
146
- display: block; margin-block-end: 0.375rem;
147
- font-size: 0.8125rem; font-weight: 600; line-height: 1rem; color: var(--_neu-fg-muted);
148
- }
145
+ .label { font-size: 0.8125rem; font-weight: 600; line-height: 1rem; color: var(--_neu-fg-muted); }
146
+ .label-text, ::slotted([slot='label']) { display: block; margin-block-end: 0.375rem; }
149
147
  .label-text:empty { display: none; }
150
148
  .control {
151
149
  display: flex; align-items: center; min-block-size: 2.75rem; padding-inline: 0.875rem;
@@ -172,7 +170,7 @@ ${xe(e())}`,a=()=>{let l=r();l&&(i===void 0&&e()==="system"&&(i=s()),s()!==i&&(i
172
170
  .error-text { display: none; margin-block-start: 0.375rem; color: var(--_neu-danger); }
173
171
  :host(:state(user-invalid)) slot[name='help-text'] { display: none; }
174
172
  :host(:state(user-invalid)) .error-text:not(:empty) { display: block; }
175
- `;var St=`${_}
173
+ `;var Lt=`${_}
176
174
  .input { appearance: textfield; text-align: center; }
177
175
  .input::-webkit-inner-spin-button, .input::-webkit-outer-spin-button { appearance: none; margin: 0; }
178
176
  .step {
@@ -185,9 +183,9 @@ ${xe(e())}`,a=()=>{let l=r();l&&(i===void 0&&e()==="system"&&(i=s()),s()!==i&&(i
185
183
  .step:active:not(:disabled) { box-shadow: var(--_neu-inset-sm); }
186
184
  .step:disabled { box-shadow: none; color: var(--_neu-fg-muted); cursor: not-allowed; }
187
185
  .step svg { inline-size: 1rem; block-size: 1rem; }
188
- `;var ir={value:{type:"string"},min:{type:"number",default:Number.NaN},max:{type:"number",default:Number.NaN},step:{type:"number",default:1},name:{type:"string",reflect:!0},label:{type:"string"},placeholder:{type:"string"},helpText:{type:"string"},errorText:{type:"string"},required:{type:"boolean",reflect:!0},disabled:{type:"boolean",reflect:!0},readOnly:{type:"boolean",reflect:!0,attribute:"readonly"},size:{type:"string",default:"md",values:["sm","md","lg"],reflect:!0},incrementLabel:{type:"string",default:"Increase"},decrementLabel:{type:"string",default:"Decrease"}},Te=r=>Number.isFinite(r)&&r>=0;function nr(r){return o`${Te(r.min)?o` inputmode="decimal"`:""}${Number.isFinite(r.min)?o` min="${r.min}"`:""}${Number.isFinite(r.max)?o` max="${r.max}"`:""}${r.placeholder?o` placeholder="${r.placeholder}"`:""}${r.required?o` required`:""}${r.disabled?o` disabled`:""}${r.readOnly?o` readonly`:""}`}var Tt=r=>f(x(r)),Ee={tag:"neu-number-field",props:ir,delegatesFocus:!0,form:{valueProp:"value"},styles:St,template:r=>{let e=r.disabled||r.readOnly?o` disabled`:"";return o`<div part="base" class="base"><label part="label" class="label" for="input"><slot name="label"><span class="label-text" data-ref="label-text">${r.label}</span></slot></label><div part="control" class="control"><button part="decrement" class="step" type="button" tabindex="-1" aria-label="${r.decrementLabel}" data-ref="decrement"${e}>${Tt(A)}</button><input part="input" class="input" id="input" data-ref="input" type="number" value="${r.value}" step="${y(r.step)}" aria-describedby="help"${nr(r)}><button part="increment" class="step" type="button" tabindex="-1" aria-label="${r.incrementLabel}" data-ref="increment"${e}>${Tt(de)}</button></div><div part="help-text" class="help" id="help"><slot name="help-text"><span class="help-text" data-ref="help-text">${r.helpText}</span></slot><span class="error-text" data-ref="error-text">${r.errorText}</span></div></div>`},docs:{summary:"A numeric input with an inset field and stepper buttons. The value attribute is the default value.",events:[{name:"input",description:"Fired on every edit and every step (composed)."},{name:"change",description:"Fired when an edit is committed, or after each step."}],slots:[{name:"label",description:"Rich label; replaces the label attribute."},{name:"help-text",description:"Rich help text; replaces the help-text attribute."}],parts:[{name:"base",description:"Outer wrapper."},{name:"label",description:"The <label> element."},{name:"control",description:"The inset field around the input and buttons."},{name:"input",description:'The native <input type="number">.'},{name:"decrement",description:"The button that lowers the value."},{name:"increment",description:"The button that raises the value."},{name:"help-text",description:"Help or error text area."}],cssProperties:d}};var W=class extends k{static def=Ee;static[M]=!0;static extraProperties=["defaultValue","valueAsNumber"];commitProps=[...z,"min","max","step"];get np(){return this.props}get valueAsNumber(){let e=this.input;return e?e.valueAsNumber:this.probe(this.value).valueAsNumber}set valueAsNumber(e){this.value=Number.isFinite(e)?String(e):""}constrain(e){let t=this.np;u(e,"min",Number.isFinite(t.min)?String(t.min):""),u(e,"max",Number.isFinite(t.max)?String(t.max):""),e.step=String(y(t.step)),u(e,"inputmode",Te(t.min)?"decimal":"")}probe(e){let t=document.createElement("input");return t.type="number",this.constrain(t),t.value=e,t}move(e){let t=this.input;if(!t||t.disabled||t.readOnly)return;let i=t.value;try{e(t)}catch{}t.value!==i&&(t.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),t.dispatchEvent(new Event("change",{bubbles:!0})))}rendered(){super.rendered();let e=[["decrement",t=>t.stepDown()],["increment",t=>t.stepUp()]];for(let[t,i]of e){let n=this.ref(t);n?.addEventListener("pointerdown",s=>{s.preventDefault(),!n.disabled&&s.pointerType!=="touch"&&this.input?.focus()}),n?.addEventListener("click",()=>this.move(i))}}controlKeyDown(e){if(e.isComposing)return;if(e.key==="Enter"){g(e,()=>{e.defaultPrevented||U(this.internals.form)});return}if(e.ctrlKey||e.metaKey||e.altKey)return;let{min:t,max:i}=this.np,n;e.key==="PageUp"?n=s=>s.stepUp(10):e.key==="PageDown"?n=s=>s.stepDown(10):e.key==="Home"&&Number.isFinite(t)?n=s=>s.value=`${t}`:e.key==="End"&&Number.isFinite(i)&&(n=s=>s.value=`${i}`),n&&(e.preventDefault(),this.move(n))}update(e){let t=this.input;if(t){["min","max","step"].some(s=>e.has(s))&&this.constrain(t);let i=this.isDisabled||this.np.readOnly,n=[["decrement","decrementLabel"],["increment","incrementLabel"]];for(let[s,a]of n){let l=this.ref(s);l&&((e.has("disabled")||e.has("readOnly"))&&(l.disabled=i),e.has(a)&&l.setAttribute("aria-label",this.np[a]))}}super.update(e)}};W.define();var Et=`${c}
186
+ `;var sr={value:{type:"string"},min:{type:"number",default:Number.NaN},max:{type:"number",default:Number.NaN},step:{type:"number",default:1},name:{type:"string"},label:{type:"string"},placeholder:{type:"string"},helpText:{type:"string"},errorText:{type:"string"},required:{type:"boolean"},disabled:{type:"boolean"},readOnly:{type:"boolean",attribute:"readonly"},size:{type:"string",default:"md",values:["sm","md","lg"]},incrementLabel:{type:"string",default:"Increase"},decrementLabel:{type:"string",default:"Decrease"}},Le=r=>Number.isFinite(r)&&r>=0;function or(r){return o`${Le(r.min)?o` inputmode="decimal"`:""}${Number.isFinite(r.min)?o` min="${r.min}"`:""}${Number.isFinite(r.max)?o` max="${r.max}"`:""}${r.placeholder?o` placeholder="${r.placeholder}"`:""}${r.required?o` required`:""}${r.disabled?o` disabled`:""}${r.readOnly?o` readonly`:""}`}var Tt=r=>f(y(r)),Te={tag:"neu-number-field",props:sr,delegatesFocus:!0,form:{valueProp:"value"},styles:Lt,template:r=>{let e=r.disabled||r.readOnly?o` disabled`:"";return o`<div part="base" class="base"><label part="label" class="label" for="input"><slot name="label"><span class="label-text" data-ref="label-text">${r.label}</span></slot></label><div part="control" class="control"><button part="decrement" class="step" type="button" tabindex="-1" aria-label="${r.decrementLabel}" data-ref="decrement"${e}>${Tt($)}</button><input part="input" class="input" id="input" data-ref="input" type="number" value="${r.value}" step="${g(r.step)}" aria-describedby="help"${or(r)}><button part="increment" class="step" type="button" tabindex="-1" aria-label="${r.incrementLabel}" data-ref="increment"${e}>${Tt(ue)}</button></div><div part="help-text" class="help" id="help"><slot name="help-text"><span class="help-text" data-ref="help-text">${r.helpText}</span></slot><span class="error-text" data-ref="error-text">${r.errorText}</span></div></div>`}};var W=class extends k{static def=Te;static[A]=!0;static extraProperties=["defaultValue","valueAsNumber"];commitProps=[...z,"min","max","step"];get np(){return this.props}get valueAsNumber(){let e=this.input;return e?e.valueAsNumber:this.probe(this.value).valueAsNumber}set valueAsNumber(e){this.value=Number.isFinite(e)?String(e):""}constrain(e){let t=this.np;c(e,"min",Number.isFinite(t.min)?String(t.min):""),c(e,"max",Number.isFinite(t.max)?String(t.max):""),e.step=String(g(t.step)),c(e,"inputmode",Le(t.min)?"decimal":"")}probe(e){let t=document.createElement("input");return t.type="number",this.constrain(t),t.value=e,t}move(e){let t=this.input;if(!t||t.disabled||t.readOnly)return;let i=t.value;try{e(t)}catch{}t.value!==i&&(t.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),t.dispatchEvent(new Event("change",{bubbles:!0})))}rendered(){super.rendered();let e=[["decrement",t=>t.stepDown()],["increment",t=>t.stepUp()]];for(let[t,i]of e){let n=this.ref(t);n?.addEventListener("pointerdown",s=>{s.preventDefault(),!n.disabled&&s.pointerType!=="touch"&&this.input?.focus()}),n?.addEventListener("click",()=>this.move(i))}}controlKeyDown(e){if(E(e))return;if(e.key==="Enter"){v(e,()=>{e.defaultPrevented||G(this.internals.form)});return}if(e.ctrlKey||e.metaKey||e.altKey)return;let{min:t,max:i}=this.np,n;e.key==="PageUp"?n=s=>s.stepUp(10):e.key==="PageDown"?n=s=>s.stepDown(10):e.key==="Home"&&Number.isFinite(t)?n=s=>s.value=`${t}`:e.key==="End"&&Number.isFinite(i)&&(n=s=>s.value=`${i}`),n&&(e.preventDefault(),this.move(n))}update(e){let t=this.input;if(t){["min","max","step"].some(s=>e.has(s))&&this.constrain(t);let i=this.isDisabled||this.np.readOnly,n=[["decrement","decrementLabel"],["increment","incrementLabel"]];for(let[s,a]of n){let l=this.ref(s);l&&((e.has("disabled")||e.has("readOnly"))&&(l.disabled=i),e.has(a)&&l.setAttribute("aria-label",this.np[a]))}}super.update(e)}};W.define();var Dt=`${d}
189
187
  :host { display: none !important; }
190
- `;var Le={tag:"neu-option",props:{value:{type:"string",reflect:!0},disabled:{type:"boolean",reflect:!0}},styles:Et,template:()=>o`<slot></slot>`,docs:{summary:"One choice of a neu-select. It is data only and never rendered: the select reads its value (the value attribute, or the label when there is none), its text as the label, and disabled.",events:[],slots:[{name:"",description:"The label, as plain text."}],parts:[],cssProperties:[]}};function De(r){return r.replace(/[\t\n\f\r ]+/g," ").replace(/^ | $/g,"")}function j(r){let e=De(r.textContent??"");return{value:r.getAttribute("value")??e,label:e,disabled:r.hasAttribute("disabled")}}var G=class extends p{static def=Le;get value(){return j(this).value}set value(e){this.setAttribute("value",e==null?"":String(e))}get label(){return De(this.textContent??"")}};G.define();var Lt=`${c}
188
+ `;var De={tag:"neu-option",props:{value:{type:"string"},disabled:{type:"boolean"}},styles:Dt,template:()=>o`<slot></slot>`};function ze(r){return r.replace(/[\t\n\f\r ]+/g," ").replace(/^ | $/g,"")}function Y(r){let e=ze(r.textContent??"");return{value:r.getAttribute("value")??e,label:e,disabled:r.hasAttribute("disabled")}}var X=class extends u{static def=De;get value(){return Y(this).value}set value(e){this.setAttribute("value",e==null?"":String(e))}get label(){return ze(this.textContent??"")}};X.define();var zt=`${d}
191
189
  :host { display: inline-flex; vertical-align: middle; cursor: pointer; user-select: none; }
192
190
  :host(:disabled), :host([disabled]) { cursor: not-allowed; }
193
191
  :host(:state(checked)) { --_neu-radio-on: 1; }
@@ -206,25 +204,19 @@ ${xe(e())}`,a=()=>{let l=r();l&&(i===void 0&&e()==="system"&&(i=s()),s()!==i&&(i
206
204
  :host(:focus-visible) .control { box-shadow: var(--_neu-inset-sm), var(--_neu-focus); }
207
205
  :host([disabled]) .base { opacity: 0.55; }
208
206
  .label { color: var(--_neu-fg); }
209
- `;var ze={tag:"neu-radio",props:{value:{type:"string",default:"on",reflect:!0},disabled:{type:"boolean",reflect:!0}},styles:Lt,template:()=>o`<span part="base" class="base"><span part="control" class="control"><span part="indicator" class="indicator"></span></span><span part="label" class="label"><slot></slot></span></span>`,docs:{summary:"One choice inside a neu-radio-group, which owns the value, the keyboard and the form. On its own it does nothing.",events:[],slots:[{name:"",description:"Label; also the accessible name."}],parts:[{name:"base",description:"Wrapper around control and label."},{name:"control",description:"The inset ring."},{name:"indicator",description:"The dot shown when selected."},{name:"label",description:"Wrapper around the default slot."}],cssProperties:d}};var P=Symbol.for("neu-ui.radio.setChecked"),$=Symbol.for("neu-ui.radio.setGroupDisabled"),Y=Symbol.for("neu-ui.radioGroup.resync");var X=class extends p{static def=ze;on=!1;groupOff=!1;constructor(){super(),this.internals.role="radio",this.internals.ariaChecked="false"}get checked(){return this.on}[P](e){this.on=e,this.toggleState("checked",e),this.internals.ariaChecked=e?"true":"false"}[$](e){e!==this.groupOff&&(this.groupOff=e,this.syncDisabledState())}get isDisabled(){return super.isDisabled||this.groupOff}update(e){e.has("disabled")&&this.syncDisabledState()}connected(){this.closest("neu-radio-group")?.[Y]?.()}disconnected(){this[P](!1),this[$](!1)}};X.define();var Dt=`${c}
207
+ `;var Ce={tag:"neu-radio",props:{value:{type:"string",default:"on"},disabled:{type:"boolean"}},styles:zt,template:()=>o`<span part="base" class="base"><span part="control" class="control"><span part="indicator" class="indicator"></span></span><span part="label" class="label"><slot></slot></span></span>`};var C=Symbol.for("neu-ui.radio.setChecked"),I=Symbol.for("neu-ui.radio.setGroupDisabled"),Z=Symbol.for("neu-ui.radioGroup.resync");var J=class extends u{static def=Ce;on=!1;groupOff=!1;constructor(){super(),this.internals.role="radio",this.internals.ariaChecked="false"}get checked(){return this.on}[C](e){this.on=e,this.toggleState("checked",e),this.internals.ariaChecked=e?"true":"false"}[I](e){e!==this.groupOff&&(this.groupOff=e,this.syncDisabledState())}get isDisabled(){return super.isDisabled||this.groupOff}update(e){e.has("disabled")&&this.syncDisabledState()}connected(){this.closest("neu-radio-group")?.[Z]?.()}disconnected(){this[C](!1),this[I](!1)}};J.define();var Ct=`${d}
210
208
  :host { display: block; }
211
209
  :host(:disabled), :host([disabled]) { cursor: not-allowed; }
212
210
  .base { display: flex; flex-direction: column; }
213
- .label {
214
- display: block; margin-block-end: 0.5rem;
215
- font-size: 0.8125rem; font-weight: 600; color: var(--_neu-fg-muted);
216
- }
217
- .label:empty { display: none; }
211
+ .label { display: block; font-size: 0.8125rem; font-weight: 600; color: var(--_neu-fg-muted); }
212
+ .label-text, ::slotted([slot='label']) { display: block; margin-block-end: 0.5rem; }
213
+ .label-text:empty { display: none; }
218
214
  .items { display: flex; flex-direction: column; align-items: flex-start; gap: 0.75rem; }
219
215
  :host([orientation='horizontal']) .items { flex-direction: row; flex-wrap: wrap; align-items: center; }
220
216
  :host(:disabled) .items, :host([disabled]) .items { opacity: 0.55; cursor: not-allowed; }
221
217
  :host(:state(user-invalid)) .label { color: var(--_neu-danger); }
222
- `;function sr(r){return r.replace(/[\\"'&<>\r\n\f]/g,e=>`\\${e.charCodeAt(0).toString(16)} `)}function Pe(r){return r===""?"":o`::slotted(neu-radio:not(:defined)[value="${sr(r)}"]){--_neu-radio-on:1}`}var Ce={tag:"neu-radio-group",props:{label:{type:"string"},name:{type:"string",reflect:!0},value:{type:"string"},required:{type:"boolean",reflect:!0},disabled:{type:"boolean",reflect:!0},orientation:{type:"string",default:"vertical",values:["vertical","horizontal"],reflect:!0}},form:{valueProp:"value"},styles:Dt,template:r=>o`<div part="base" class="base"><span part="label" class="label" data-ref="label">${r.label}</span><span class="items"><slot></slot></span><style data-ref="mark">${Pe(r.value)}</style></div>`,docs:{summary:"A group of neu-radio elements with one selected value, arrow-key navigation and form support. The value attribute is the default value.",events:[{name:"input",description:"Fired when the user selects a radio."},{name:"change",description:"Fired after input when the user selects a radio."}],slots:[{name:"",description:"neu-radio elements."}],parts:[{name:"base",description:"Outer wrapper."},{name:"label",description:"The group label."}],cssProperties:d}};var or={ArrowDown:1,ArrowRight:1,ArrowUp:-1,ArrowLeft:-1},zt=r=>r.getAttribute("value")??"on",Z=class extends b{static def=Ce;static extraProperties=["defaultValue"];current;dirty=!1;stop;picked;observer;constructor(){super(),this.current=this.getAttribute("value"),this.internals.role="radiogroup",this.addEventListener("click",e=>{let t=this.radioAt(e);t&&!this.isDisabled&&!t.hasAttribute("disabled")&&this.choose(t)}),this.addEventListener("keydown",e=>this.onKey(e))}get value(){return this.selected()?this.current:""}set value(e){this.dirty=!0,this.current=e==null?null:String(e),this.sync()}get defaultValue(){return String(this.props.value)}set defaultValue(e){this.setAttribute("value",String(e))}radios(){return[...this.querySelectorAll("neu-radio")].filter(e=>e.closest("neu-radio-group")===this)}selected(e=this.radios()){return this.current===null?void 0:e.find(t=>zt(t)===this.current)}radioAt(e){let t=e.target instanceof Element?e.target.closest("neu-radio"):null;return t&&t.closest("neu-radio-group")===this?t:null}onKey(e){if(e.defaultPrevented||e.altKey||e.ctrlKey||e.metaKey)return;let t=this.radioAt(e);if(!t||this.isDisabled||t.hasAttribute("disabled"))return;if(e.key===" "){e.preventDefault(),this.choose(t);return}let i=or[e.key];if(!i)return;(e.key==="ArrowLeft"||e.key==="ArrowRight")&&this.matches(":dir(rtl)")&&(i=-i);let n=this.radios().filter(a=>!a.hasAttribute("disabled")),s=n[(n.indexOf(t)+i+n.length)%n.length];s&&(e.preventDefault(),s.focus(),this.choose(s))}choose(e){let t=zt(e);t===this.current&&this.selected()||(this.dirty=!0,this.current=t,this.sync(),this.markInteracted(),m(this,"input"),m(this,"change"))}[Y](){this.sync()}sync(){let e=this.radios(),t=this.picked=this.selected(e),i=this.isDisabled,n=e.filter(l=>P in l);for(let l of n)l[$](i),l[P](l===t);let s=i?[]:n.filter(l=>!l.disabled);this.stop=s.find(l=>l===t)??s[0];for(let l of s){let v=l===this.stop?"0":"-1";l.getAttribute("tabindex")!==v&&l.setAttribute("tabindex",v)}let a=Pe(this.current??"");h(this.ref("mark"),a===""?"":a.value),this.commit()}willUpdate(e){e.has("value")&&!this.dirty&&(this.current=this.getAttribute("value"))}update(e){e.has("label")&&(h(this.ref("label"),String(this.props.label)),this.internals.ariaLabel=String(this.props.label)||null),e.has("required")&&(this.internals.ariaRequired=this.props.required?"true":null),e.has("disabled")&&(this.internals.ariaDisabled=this.isDisabled?"true":null),(e.has("value")||e.has("required")||e.has("disabled"))&&this.sync()}connected(){this.observer??=new MutationObserver(()=>this.sync()),this.observer.observe(this,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["disabled","value"]}),this.sync()}disconnected(){this.observer?.disconnect()}formValue(){return this.picked?this.current:null}formState(){return this.formValue()}validate(){this.props.required===!0&&!this.picked?this.internals.setValidity({valueMissing:!0},L("radio","Please select one of these options."),this.stop):this.internals.setValidity({})}resetToDefault(){this.dirty=!1,this.current=this.getAttribute("value"),this.sync()}restoreState(e){this.dirty=!0,this.current=e,this.sync()}};Z.define();var Pt=`${_}
223
- .label {
224
- display: block; margin-block-end: 0.375rem;
225
- font-size: 0.8125rem; font-weight: 600; line-height: 1rem; color: var(--_neu-fg-muted);
226
- }
227
- .label:empty { display: none; }
218
+ `;function ar(r){return r.replace(/[\\"'&<>\r\n\f]/g,e=>`\\${e.charCodeAt(0).toString(16)} `)}function Pe(r){return r===""?"":o`::slotted(neu-radio:not(:defined)[value="${ar(r)}"]){--_neu-radio-on:1}`}var Me={tag:"neu-radio-group",props:{label:{type:"string"},name:{type:"string"},value:{type:"string"},required:{type:"boolean"},disabled:{type:"boolean"},orientation:{type:"string",default:"vertical",values:["vertical","horizontal"]}},form:{valueProp:"value"},styles:Ct,template:r=>o`<div part="base" class="base"><span part="label" class="label"><slot name="label"><span class="label-text" data-ref="label-text">${r.label}</span></slot></span><span class="items"><slot></slot></span><style data-ref="mark">${Pe(r.value)}</style></div>`};var lr={ArrowDown:1,ArrowRight:1,ArrowUp:-1,ArrowLeft:-1},Pt=r=>r.getAttribute("value")??"on",Q=class extends b{static def=Me;static extraProperties=["defaultValue"];current;dirty=!1;stop;picked;observer;constructor(){super(),this.current=this.getAttribute("value"),this.internals.role="radiogroup",this.addEventListener("click",e=>{let t=this.radioAt(e);t&&!this.isDisabled&&!t.hasAttribute("disabled")&&this.choose(t)}),this.addEventListener("keydown",e=>this.onKey(e))}get value(){return this.selected()?this.current:""}set value(e){this.dirty=!0,this.current=e==null?null:String(e),this.sync()}get defaultValue(){return String(this.props.value)}set defaultValue(e){this.setAttribute("value",String(e))}radios(){return[...this.querySelectorAll("neu-radio")].filter(e=>e.closest("neu-radio-group")===this)}selected(e=this.radios()){return this.current===null?void 0:e.find(t=>Pt(t)===this.current)}radioAt(e){let t=e.target instanceof Element?e.target.closest("neu-radio"):null;return t&&t.closest("neu-radio-group")===this?t:null}onKey(e){if(e.defaultPrevented||e.altKey||e.ctrlKey||e.metaKey)return;let t=this.radioAt(e);if(!t||this.isDisabled||t.hasAttribute("disabled"))return;if(e.key===" "){e.preventDefault(),this.choose(t);return}let i=lr[e.key];if(!i)return;(e.key==="ArrowLeft"||e.key==="ArrowRight")&&this.matches(":dir(rtl)")&&(i=-i);let n=this.radios().filter(a=>!a.hasAttribute("disabled")),s=n[(n.indexOf(t)+i+n.length)%n.length];s&&(e.preventDefault(),s.focus(),this.choose(s))}choose(e){let t=Pt(e);t===this.current&&this.selected()||(this.dirty=!0,this.current=t,this.sync(),this.markInteracted(),p(this,"input"),p(this,"change"))}[Z](){this.sync()}sync(){let e=this.radios(),t=this.picked=this.selected(e),i=this.isDisabled,n=e.filter(l=>C in l);for(let l of n)l[I](i),l[C](l===t);let s=i?[]:n.filter(l=>!l.disabled);this.stop=s.find(l=>l===t)??s[0];for(let l of s){let h=l===this.stop?"0":"-1";l.getAttribute("tabindex")!==h&&l.setAttribute("tabindex",h)}let a=Pe(this.current??"");m(this.ref("mark"),a===""?"":a.value),this.commit()}nameGroup(){let t=(this.shadowRoot?.querySelector('slot[name="label"]')?.assignedNodes()??[]).map(i=>i.textContent).join("").replace(/\s+/g," ").trim();this.internals.ariaLabel=t||String(this.props.label)||null}rendered(){this.shadowRoot.querySelector('slot[name="label"]').addEventListener("slotchange",()=>this.nameGroup())}willUpdate(e){e.has("value")&&!this.dirty&&(this.current=this.getAttribute("value"))}update(e){e.has("label")&&(m(this.ref("label-text"),String(this.props.label)),this.nameGroup()),e.has("required")&&(this.internals.ariaRequired=this.props.required?"true":null),e.has("disabled")&&(this.internals.ariaDisabled=this.isDisabled?"true":null),(e.has("value")||e.has("required")||e.has("disabled"))&&this.sync()}connected(){this.observer??=new MutationObserver(e=>{let t=e.filter(i=>R(this,i.target));t.length&&this.nameGroup(),e.some(i=>i.type!=="characterData"&&!t.includes(i))&&this.sync()}),this.observer.observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["disabled","value"]}),this.nameGroup(),this.sync()}disconnected(){this.observer?.disconnect()}formValue(){return this.picked?this.current:null}formState(){return this.formValue()}validate(){this.props.required===!0&&!this.picked?this.internals.setValidity({valueMissing:!0},T("radio","Please select one of these options."),this.stop):this.internals.setValidity({})}resetToDefault(){this.dirty=!1,this.current=this.getAttribute("value"),this.sync()}restoreState(e){this.dirty=!0,this.current=e,this.sync()}};Q.define();var Mt=`${_}
219
+ .label { display: block; }
228
220
  .combobox {
229
221
  display: flex; align-items: center; gap: 0.5rem; min-block-size: 2.75rem; padding-inline: 0.875rem 0.75rem;
230
222
  border-radius: var(--_neu-r); background: var(--_neu-bg); box-shadow: var(--_neu-raised-sm);
@@ -256,7 +248,7 @@ ${xe(e())}`,a=()=>{let l=r();l&&(i===void 0&&e()==="system"&&(i=s()),s()!==i&&(i
256
248
  .option.active { box-shadow: var(--_neu-inset-sm); }
257
249
  .option[aria-selected='true'] { color: var(--_neu-accent-c); font-weight: 600; }
258
250
  .option[aria-disabled='true'] { color: var(--_neu-fg-muted); cursor: not-allowed; }
259
- `;function T(r,e){return r?.find(t=>t.value===e)}var ar=f(x(le)),Ae={tag:"neu-select",props:{value:{type:"string"},name:{type:"string",reflect:!0},label:{type:"string"},placeholder:{type:"string"},helpText:{type:"string"},errorText:{type:"string"},required:{type:"boolean",reflect:!0},disabled:{type:"boolean",reflect:!0},size:{type:"string",default:"md",values:["sm","md","lg"],reflect:!0}},delegatesFocus:!0,form:{valueProp:"value"},optionsFrom:"neu-option",styles:Pt,template:(r,e)=>{let t=T(e?.options,r.value),i=!t&&r.value!==""&&e?.options?.length===0;return o`<div part="base" class="base"><span part="label" class="label" id="label" data-ref="label">${r.label}</span><div part="combobox" class="combobox" id="combobox" role="combobox"${r.disabled?o` aria-disabled="true"`:o` tabindex="0"`} aria-haspopup="listbox" aria-expanded="false" aria-controls="listbox" aria-labelledby="label" aria-describedby="help"${r.required?o` aria-required="true"`:""} data-ref="combobox"><span part="display" class="display${t||i?"":" placeholder"}" data-ref="display">${t?t.label:i?"":r.placeholder}</span><span part="chevron" class="chevron">${ar}</span></div><div part="listbox" class="listbox" id="listbox" role="listbox" aria-labelledby="label" popover="auto" data-ref="listbox"></div><div part="help-text" class="help" id="help"><slot name="help-text"><span class="help-text" data-ref="help-text">${r.helpText}</span></slot><span class="error-text" data-ref="error-text">${r.errorText}</span></div></div>`},docs:{summary:"A single-value select (the APG select-only combobox): a raised trigger and a popover listbox built from the neu-option children, which are data only. The value attribute is the default value.",events:[{name:"input",description:"Fired when the user chooses an option with a new value."},{name:"change",description:"Fired after input when the user chooses a new value."},{name:"neu-open",description:"Fired when the listbox opens."},{name:"neu-close",description:"Fired when the listbox closes."}],slots:[{name:"help-text",description:"Rich help text; replaces the help-text attribute."}],parts:[{name:"base",description:"Outer wrapper."},{name:"label",description:"The label text."},{name:"combobox",description:"The raised trigger that holds focus."},{name:"display",description:"The selected label, or the placeholder."},{name:"chevron",description:"The chevron icon."},{name:"listbox",description:"The popover list of options."},{name:"option",description:"One option in the listbox."},{name:"help-text",description:"Help or error text area."}],cssProperties:d}};var J=4,lr=500,Q=class extends b{static def=Ae;static extraProperties=["defaultValue"];current;dirty=!1;opts=[];observer;opened=!1;activeSource;pressedOpen;typed="";typedTimer;constructor(){super(),this.current=String(this.props.value)}get value(){return T(this.read(),this.current)?this.current:""}set value(e){this.dirty=!0,this.current=e==null?"":String(e),this.sync()}get defaultValue(){return String(this.props.value)}set defaultValue(e){this.setAttribute("value",String(e))}read(){return[...this.querySelectorAll("neu-option")].map(e=>({...j(e),source:e}))}chosen(){return T(this.opts,this.current)?this.current:""}sync(){this.opts=this.read();let e=T(this.opts,this.current),t=this.ref("display");h(t,e?e.label:String(this.props.placeholder)),t?.classList.toggle("placeholder",!e),this.opened&&this.render(),this.commit()}step(e,t){for(let i=e;i>=0&&i<this.opts.length;i+=t)if(!this.opts[i].disabled)return i;return-1}near(e,t){let i=Math.min(Math.max(e,0),this.opts.length-1),n=this.step(i,t);return n<0?this.step(i,-t):n}activeIndex(){return this.opts.findIndex(e=>e.source===this.activeSource)}render(){let e=this.ref("listbox"),t=T(this.opts,this.current);e.replaceChildren(...this.opts.map((s,a)=>{let l=document.createElement("div");return l.className="option",l.id=`option-${a}`,l.setAttribute("part","option"),l.setAttribute("role","option"),l.setAttribute("aria-selected",String(s===t)),s.disabled&&l.setAttribute("aria-disabled","true"),l.textContent=s.label,l})),this.place();let i=this.activeIndex(),n=t?this.opts.indexOf(t):-1;this.activate(i>=0&&!this.opts[i].disabled?i:n>=0?n:this.step(0,1))}activate(e){let t=this.ref("listbox");this.activeSource=this.opts[e]?.source;let i=[...t.children];i.forEach((l,v)=>l.classList.toggle("active",v===e));let n=i[e];if(u(this.ref("combobox"),"aria-activedescendant",n?n.id:""),!n)return;let s=i[0].offsetTop,a=n.offsetTop+n.offsetHeight+s;n.offsetTop-s<t.scrollTop?t.scrollTop=n.offsetTop-s:a>t.scrollTop+t.clientHeight&&(t.scrollTop=a-t.clientHeight)}place=()=>{let e=this.ref("listbox"),t=this.ref("combobox")?.getBoundingClientRect();if(!e||!t)return;e.style.left=`${t.left}px`,e.style.width=`${t.width}px`;let i=e.offsetHeight,n=innerHeight-t.bottom-J,s=t.top-J,a=i>n&&s>n;e.style.top=`${a?t.top-J-i:t.bottom+J}px`};open(){let e=this.ref("listbox");this.opened||this.isDisabled||!e||(this.opened=!0,this.activeSource=void 0,e.matches(":popover-open")||e.showPopover(),this.render(),this.ref("combobox").setAttribute("aria-expanded","true"),window.addEventListener("scroll",this.place,{capture:!0,passive:!0}),window.addEventListener("resize",this.place,{passive:!0}),this.ownerDocument.addEventListener("focusin",this.focusLanded,!0),m(this,"neu-open"))}focusLanded=()=>{this.shadowRoot.activeElement||this.close()};close(){if(!this.opened)return;this.opened=!1;let e=this.ref("listbox");e.matches(":popover-open")&&e.hidePopover();let t=this.ref("combobox");t.setAttribute("aria-expanded","false"),t.removeAttribute("aria-activedescendant"),window.removeEventListener("scroll",this.place,{capture:!0}),window.removeEventListener("resize",this.place),this.ownerDocument.removeEventListener("focusin",this.focusLanded,!0),m(this,"neu-close")}choose(e){let t=this.opts[e];if(!t||t.disabled)return;let i=this.chosen();this.dirty=!0,this.current=t.value,this.sync(),t.value!==i&&(this.markInteracted(),m(this,"input"),m(this,"change"))}typeahead(e){clearTimeout(this.typedTimer),this.typedTimer=setTimeout(()=>this.typed="",lr);let t=this.typed+=e.toLowerCase(),i=this.activeIndex(),n=this.opts.length,s=(l,v)=>{for(let oe=0;oe<n;oe++){let qe=(v+oe)%n,Ke=this.opts[qe];if(!Ke.disabled&&Ke.label.toLowerCase().startsWith(l))return qe}return-1},a=[...t].every(l=>l===t[0])?s(t[0],i+1):s(t,Math.max(i,0));a>=0&&this.activate(a)}onKey(e){if(this.isDisabled||e.ctrlKey||e.metaKey)return;let{key:t,altKey:i}=e,n=t.length===1&&t!==" "&&!i,s=this.activeIndex(),a=this.opts.length-1,l={ArrowDown:[s+1,1],ArrowUp:[s-1,-1],Home:[0,1],End:[a,-1],PageDown:[s+10,1],PageUp:[s-10,-1]};if(!this.opened){if(!n&&!["ArrowDown","ArrowUp","Enter"," ","Home","End"].includes(t))return;e.preventDefault(),this.open(),t==="Home"||t==="End"?this.activate(this.near(...l[t])):n&&this.typeahead(t);return}if(t==="Tab"){this.choose(s),this.close();return}if(t==="Enter"||t===" "||t==="ArrowUp"&&i)this.choose(s),this.close();else if(t==="Escape")this.close();else if(n)this.typeahead(t);else if(l[t])this.activate(this.near(...l[t]));else return;e.preventDefault()}optionAt(e){let t=e.target.closest(".option");return t?Number(t.id.slice(7)):-1}rendered(){let e=this.ref("combobox"),t=this.ref("listbox");e.addEventListener("keydown",i=>this.onKey(i)),e.addEventListener("pointerdown",()=>this.pressedOpen=this.opened),e.addEventListener("click",()=>{let i=this.pressedOpen??this.opened;this.pressedOpen=void 0,i?this.close():this.open()}),this.ref("label").addEventListener("click",()=>e.focus()),t.addEventListener("pointerdown",i=>i.preventDefault()),t.addEventListener("pointermove",i=>{let n=this.optionAt(i);n>=0&&n!==this.activeIndex()&&!this.opts[n]?.disabled&&this.activate(n)}),t.addEventListener("click",i=>{let n=this.optionAt(i);n<0||this.opts[n]?.disabled||(this.choose(n),this.close())}),t.addEventListener("toggle",()=>{t.matches(":popover-open")||this.close()}),e.addEventListener("focusout",i=>{let n=i.relatedTarget;(n?!this.shadowRoot.contains(n):document.hasFocus())&&this.close()})}willUpdate(e){e.has("value")&&!this.dirty&&(this.current=String(this.props.value))}update(e){let t=this.ref("combobox");if(e.has("label")&&h(this.ref("label"),String(this.props.label)),e.has("helpText")&&h(this.ref("help-text"),String(this.props.helpText)),e.has("required")&&u(t,"aria-required",this.props.required?"true":""),e.has("disabled")){let i=this.isDisabled;u(t,"aria-disabled",i?"true":""),u(t,"tabindex",i?"":"0"),i&&this.close()}e.has("value")||e.has("placeholder")?this.sync():(e.has("required")||e.has("errorText"))&&this.commit()}connected(){this.observer??=new MutationObserver(()=>this.sync()),this.observer.observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["value","disabled"]}),this.sync()}disconnected(){this.observer?.disconnect(),this.close()}formValue(){return T(this.opts,this.current)?this.current:null}validate(){this.props.required===!0&&this.chosen()===""?this.internals.setValidity({valueMissing:!0},L("select","Please select an item in the list."),this.ref("combobox")??void 0):this.internals.setValidity({}),h(this.ref("error-text"),String(this.props.errorText)||this.internals.validationMessage)}resetToDefault(){this.dirty=!1,this.current=String(this.props.value),this.sync()}restoreState(e){this.dirty=!0,this.current=e,this.sync()}};Q.define();var Ct=`${c}
251
+ `;function S(r,e){return r?.find(t=>t.value===e)}var dr=f(y(de)),$e={tag:"neu-select",props:{value:{type:"string"},name:{type:"string"},label:{type:"string"},placeholder:{type:"string"},helpText:{type:"string"},errorText:{type:"string"},required:{type:"boolean"},disabled:{type:"boolean"},size:{type:"string",default:"md",values:["sm","md","lg"]}},delegatesFocus:!0,form:{valueProp:"value"},optionsFrom:"neu-option",styles:Mt,template:(r,e)=>{let t=S(e?.options,r.value),i=!t&&r.value!==""&&e?.options?.length===0;return o`<div part="base" class="base"><span part="label" class="label" id="label" data-ref="label"><slot name="label"><span class="label-text" data-ref="label-text">${r.label}</span></slot></span><div part="combobox" class="combobox" id="combobox" role="combobox"${r.disabled?o` aria-disabled="true"`:o` tabindex="0"`} aria-haspopup="listbox" aria-expanded="false" aria-controls="listbox" aria-labelledby="label" aria-describedby="help"${r.required?o` aria-required="true"`:""} data-ref="combobox"><span part="display" class="display${t||i?"":" placeholder"}" data-ref="display">${t?t.label:i?"":r.placeholder}</span><span part="chevron" class="chevron">${dr}</span></div><div part="listbox" class="listbox" id="listbox" role="listbox" aria-labelledby="label" popover="auto" data-ref="listbox"></div><div part="help-text" class="help" id="help"><slot name="help-text"><span class="help-text" data-ref="help-text">${r.helpText}</span></slot><span class="error-text" data-ref="error-text">${r.errorText}</span></div></div>`}};var ee=4,ur=500,te=class extends b{static def=$e;static extraProperties=["defaultValue"];current;dirty=!1;opts=[];observer;opened=!1;activeSource;pressedOpen;typed="";typedTimer;constructor(){super(),this.current=String(this.props.value)}get value(){return S(this.read(),this.current)?this.current:""}set value(e){this.dirty=!0,this.current=e==null?"":String(e),this.sync()}get defaultValue(){return String(this.props.value)}set defaultValue(e){this.setAttribute("value",String(e))}read(){return[...this.querySelectorAll("neu-option")].map(e=>({...Y(e),source:e}))}chosen(){return S(this.opts,this.current)?this.current:""}sync(){this.opts=this.read();let e=S(this.opts,this.current),t=this.ref("display");m(t,e?e.label:String(this.props.placeholder)),t?.classList.toggle("placeholder",!e),this.opened&&this.render(),this.commit()}step(e,t){for(let i=e;i>=0&&i<this.opts.length;i+=t)if(!this.opts[i].disabled)return i;return-1}near(e,t){let i=Math.min(Math.max(e,0),this.opts.length-1),n=this.step(i,t);return n<0?this.step(i,-t):n}activeIndex(){return this.opts.findIndex(e=>e.source===this.activeSource)}render(){let e=this.ref("listbox"),t=S(this.opts,this.current);e.replaceChildren(...this.opts.map((s,a)=>{let l=document.createElement("div");return l.className="option",l.id=`option-${a}`,l.setAttribute("part","option"),l.setAttribute("role","option"),l.setAttribute("aria-selected",String(s===t)),s.disabled&&l.setAttribute("aria-disabled","true"),l.textContent=s.label,l})),this.place();let i=this.activeIndex(),n=t?this.opts.indexOf(t):-1;this.activate(i>=0&&!this.opts[i].disabled?i:n>=0?n:this.step(0,1))}activate(e,t=!0){let i=this.ref("listbox");this.activeSource=this.opts[e]?.source;let n=[...i.children];n.forEach((h,P)=>h.classList.toggle("active",P===e));let s=n[e];if(c(this.ref("combobox"),"aria-activedescendant",s?s.id:""),!s||!t)return;let a=n[0].offsetTop,l=s.offsetTop+s.offsetHeight+a;s.offsetTop-a<i.scrollTop?i.scrollTop=s.offsetTop-a:l>i.scrollTop+i.clientHeight&&(i.scrollTop=l-i.clientHeight)}place=()=>{let e=this.ref("listbox"),t=this.ref("combobox")?.getBoundingClientRect();if(!e||!t)return;e.style.left=`${t.left}px`,e.style.width=`${t.width}px`;let i=e.offsetHeight,n=innerHeight-t.bottom-ee,s=t.top-ee,a=i>n&&s>n;e.style.top=`${a?t.top-ee-i:t.bottom+ee}px`};open(){let e=this.ref("listbox");this.opened||this.isDisabled||!e||(this.opened=!0,this.activeSource=void 0,e.matches(":popover-open")||e.showPopover(),this.render(),this.ref("combobox").setAttribute("aria-expanded","true"),window.addEventListener("scroll",this.place,{capture:!0,passive:!0}),window.addEventListener("resize",this.place,{passive:!0}),this.ownerDocument.addEventListener("focusin",this.focusLanded,!0),p(this,"neu-open"))}focusLanded=()=>{this.shadowRoot.activeElement||this.close()};close(){if(!this.opened)return;this.opened=!1;let e=this.ref("listbox");e.matches(":popover-open")&&e.hidePopover();let t=this.ref("combobox");t.setAttribute("aria-expanded","false"),t.removeAttribute("aria-activedescendant"),window.removeEventListener("scroll",this.place,{capture:!0}),window.removeEventListener("resize",this.place),this.ownerDocument.removeEventListener("focusin",this.focusLanded,!0),p(this,"neu-close")}choose(e){let t=this.opts[e];if(!t||t.disabled)return;let i=this.chosen();this.dirty=!0,this.current=t.value,this.sync(),t.value!==i&&(this.markInteracted(),p(this,"input"),p(this,"change"))}typeahead(e){clearTimeout(this.typedTimer),this.typedTimer=setTimeout(()=>this.typed="",ur);let t=this.typed+=e.toLowerCase(),i=this.activeIndex(),n=this.opts.length,s=(l,h)=>{for(let P=0;P<n;P++){let Ke=(h+P)%n,Ue=this.opts[Ke];if(!Ue.disabled&&Ue.label.toLowerCase().startsWith(l))return Ke}return-1},a=[...t].every(l=>l===t[0])?s(t[0],i+1):s(t,Math.max(i,0));a>=0&&this.activate(a)}onKey(e){let{key:t,altKey:i,ctrlKey:n}=e,s=t.length===1&&t!==" "&&(!i||n);if(this.isDisabled||e.metaKey||n&&!(i&&s))return;let a=this.activeIndex(),l=this.opts.length-1,h={ArrowDown:[a+1,1],ArrowUp:[a-1,-1],Home:[0,1],End:[l,-1],PageDown:[a+10,1],PageUp:[a-10,-1]};if(!this.opened){if(!s&&!["ArrowDown","ArrowUp","Enter"," ","Home","End"].includes(t))return;e.preventDefault(),this.open(),t==="Home"||t==="End"?this.activate(this.near(...h[t])):s&&this.typeahead(t);return}if(t==="Tab"){this.choose(a),this.close();return}if(t==="Enter"||t===" "||t==="ArrowUp"&&i)this.choose(a),this.close();else if(t==="Escape")this.close();else if(s)this.typeahead(t);else if(h[t])this.activate(this.near(...h[t]));else return;e.preventDefault()}optionAt(e){let t=e.target.closest(".option");return t?Number(t.id.slice(7)):-1}rendered(){let e=this.ref("combobox"),t=this.ref("listbox");e.addEventListener("keydown",i=>this.onKey(i)),e.addEventListener("pointerdown",()=>this.pressedOpen=this.opened),e.addEventListener("click",()=>{let i=this.pressedOpen??this.opened;this.pressedOpen=void 0,i?this.close():this.open()}),this.ref("label").addEventListener("click",()=>e.focus()),t.addEventListener("pointerdown",i=>i.preventDefault()),t.addEventListener("pointermove",i=>{let n=this.optionAt(i);n>=0&&n!==this.activeIndex()&&!this.opts[n]?.disabled&&this.activate(n,!1)}),t.addEventListener("click",i=>{let n=this.optionAt(i);n<0||this.opts[n]?.disabled||(this.choose(n),this.close())}),t.addEventListener("toggle",()=>{t.matches(":popover-open")||this.close()}),e.addEventListener("focusout",i=>{let n=i.relatedTarget;(n?!this.shadowRoot.contains(n):document.hasFocus())&&this.close()})}willUpdate(e){e.has("value")&&!this.dirty&&(this.current=String(this.props.value))}update(e){let t=this.ref("combobox");if(e.has("label")&&m(this.ref("label-text"),String(this.props.label)),e.has("helpText")&&m(this.ref("help-text"),String(this.props.helpText)),e.has("required")&&c(t,"aria-required",this.props.required?"true":""),e.has("disabled")){let i=this.isDisabled;c(t,"aria-disabled",i?"true":""),c(t,"tabindex",i?"":"0"),i&&this.close()}e.has("value")||e.has("placeholder")?this.sync():(e.has("required")||e.has("errorText"))&&this.commit()}connected(){this.observer??=new MutationObserver(e=>{e.some(t=>!R(this,t.target))&&this.sync()}),this.observer.observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["value","disabled"]}),this.sync()}disconnected(){this.observer?.disconnect(),this.close()}formValue(){return S(this.opts,this.current)?this.current:null}validate(){this.props.required===!0&&this.chosen()===""?this.internals.setValidity({valueMissing:!0},T("select","Please select an item in the list."),this.ref("combobox")??void 0):this.internals.setValidity({}),m(this.ref("error-text"),String(this.props.errorText)||this.internals.validationMessage)}resetToDefault(){this.dirty=!1,this.current=String(this.props.value),this.sync()}restoreState(e){this.dirty=!0,this.current=e,this.sync()}};te.define();var $t=`${d}
260
252
  :host { display: block; min-block-size: 1.25rem; touch-action: pan-y; cursor: pointer; user-select: none; }
261
253
  :host(:disabled), :host([disabled]) { cursor: not-allowed; }
262
254
  .base { position: relative; display: flex; align-items: center; block-size: 1.25rem; padding-inline: 0.625rem; }
@@ -270,7 +262,7 @@ ${xe(e())}`,a=()=>{let l=r();l&&(i===void 0&&e()==="system"&&(i=s()),s()!==i&&(i
270
262
  }
271
263
  :host(:focus-visible) .thumb { box-shadow: var(--_neu-raised-sm), var(--_neu-focus); }
272
264
  :host(:disabled) .base, :host([disabled]) .base { opacity: 0.55; }
273
- `;function Me(r){let[,e="",t="0"]=/(?:\.(\d+))?(?:e([+-]\d+))?$/.exec(String(r))??[];return Math.min(100,Math.max(0,e.length-Number(t)))}function $e(r,e,t,i){let n=Math.max(e,t),s=y(i),a=Number.isNaN(r)?e+(n-e)/2:r,l=Math.round((a-e)/s);e+l*s>n&&(l=Math.floor((n-e)/s+1e-9));let v=e+Math.max(0,l)*s;return Number(Math.min(v,n).toFixed(Math.max(Me(s),Me(e))))}function At(r,e,t){let i=y(t),n=Math.round((Math.max(r,e)-r)/10/i)*i;return Number(Math.max(i,n).toFixed(Me(i)))}function Ie(r,e,t){let i=Math.max(e,t)-e;return`--_neu-pos:${i>0?Math.round((r-e)/i*1e4)/1e4:0}`}var Re={tag:"neu-slider",props:{value:{type:"number",default:Number.NaN},min:{type:"number",default:0},max:{type:"number",default:100},step:{type:"number",default:1},name:{type:"string",reflect:!0},label:{type:"string"},disabled:{type:"boolean",reflect:!0}},form:{valueProp:"value"},properties:{valueFormatter:"(value: number) => string"},styles:Ct,template:r=>o`<span part="base" class="base" data-ref="base" style="${Ie($e(r.value,r.min,r.max,r.step),r.min,r.max)}"><span part="track" class="track" data-ref="track"><span part="fill" class="fill"></span><span part="thumb" class="thumb"></span></span></span>`,docs:{summary:"A horizontal slider for a number. The value attribute is the default; the value property is the current value. The valueFormatter property turns the value into the text a screen reader announces.",events:[{name:"input",description:"Fired on every change while the user drags or presses a key."},{name:"change",description:"Fired after the user commits a change: on release, or per key."}],slots:[],parts:[{name:"base",description:"Wrapper around the track."},{name:"track",description:"The inset groove."},{name:"fill",description:"The part of the track up to the thumb."},{name:"thumb",description:"The raised handle."}],cssProperties:d}};var ee=class extends b{static def=Re;static extraProperties=["defaultValue","valueFormatter"];current;dirty=!1;dragging=!1;startValue=0;formatter;constructor(){super(),this.internals.role="slider",this.internals.ariaOrientation="horizontal",this.current=this.snap(this.props.value),this.addEventListener("keydown",e=>this.onKey(e)),this.addEventListener("pointerdown",e=>this.onDown(e)),this.addEventListener("pointermove",e=>this.onMove(e)),this.addEventListener("pointerup",()=>this.endDrag()),this.addEventListener("pointercancel",()=>this.endDrag()),this.addEventListener("lostpointercapture",()=>this.endDrag())}disconnected(){super.disconnected(),this.dragging=!1}get value(){return this.current}set value(e){this.dirty=!0,this.setCurrent(this.snap(Number(e)))}get defaultValue(){return this.snap(this.props.value)}set defaultValue(e){this.setAttribute("value",String(e))}get valueFormatter(){return this.formatter}set valueFormatter(e){this.formatter=typeof e=="function"?e:void 0,this.sync()}snap(e){return $e(e,this.props.min,this.props.max,this.props.step)}sync(){let{min:e,max:t}=this.props,i=this.internals;i.ariaLabel=this.props.label===""?null:String(this.props.label),i.ariaValueMin=String(e),i.ariaValueMax=String(Math.max(e,t)),i.ariaValueNow=String(this.current),i.ariaValueText=this.formatter?this.formatter(this.current):null;let n=this.ref("base"),s=Ie(this.current,e,t);n&&n.getAttribute("style")!==s&&n.setAttribute("style",s)}setCurrent(e){this.current=e,this.sync(),this.commit()}userSet(e){return e===this.current?!1:(this.markInteracted(),this.setCurrent(e),m(this,"input"),!0)}onKey(e){if(this.isDisabled||e.altKey||e.ctrlKey||e.metaKey)return;let{min:t,max:i}=this.props,n=y(this.props.step),s=this.matches(":dir(rtl)")?-1:1,a=At(t,i,n),v={ArrowRight:this.current+n*s,ArrowLeft:this.current-n*s,ArrowUp:this.current+n,ArrowDown:this.current-n,PageUp:this.current+a,PageDown:this.current-a,Home:Number.NEGATIVE_INFINITY,End:Number.POSITIVE_INFINITY}[e.key];v!==void 0&&(e.preventDefault(),this.userSet(this.snap(v))&&m(this,"change"))}onDown(e){if(!(this.isDisabled||e.button!==0)){this.dragging=!0,this.startValue=this.current,this.focus();try{this.setPointerCapture(e.pointerId)}catch{}this.moveTo(e)}}onMove(e){this.dragging&&this.moveTo(e)}moveTo(e){let t=this.ref("track");if(!t)return;let i=t.getBoundingClientRect(),n=i.width>0?(e.clientX-i.left)/i.width:0;this.matches(":dir(rtl)")&&(n=1-n);let{min:s,max:a}=this.props,l=Math.min(1,Math.max(0,n));this.userSet(this.snap(s+l*(Math.max(s,a)-s)))}endDrag(){this.dragging&&(this.dragging=!1,this.current!==this.startValue&&m(this,"change"))}willUpdate(e){(e.has("value")||e.has("min")||e.has("max")||e.has("step"))&&(this.current=this.snap(this.dirty?this.current:this.props.value))}update(e){e.has("disabled")&&this.syncDisabledState(),this.sync(),this.commit()}formValue(){return String(this.current)}validate(){this.internals.setValidity({})}resetToDefault(){this.dirty=!1,this.setCurrent(this.snap(this.props.value))}restoreState(e){this.dirty=!0,this.setCurrent(this.snap(Number(e)))}};ee.define();var Mt=`${c}
265
+ `;function Ae(r){let[,e="",t="0"]=/(?:\.(\d+))?(?:e([+-]\d+))?$/.exec(String(r))??[];return Math.min(100,Math.max(0,e.length-Number(t)))}function Ie(r,e,t,i){let n=Math.max(e,t),s=g(i),a=Number.isNaN(r)?e+(n-e)/2:r,l=Math.round((a-e)/s);e+l*s>n&&(l=Math.floor((n-e)/s+1e-9));let h=e+Math.max(0,l)*s;return Number(Math.min(h,n).toFixed(Math.max(Ae(s),Ae(e))))}function At(r,e,t){let i=g(t),n=Math.round((Math.max(r,e)-r)/10/i)*i;return Number(Math.max(i,n).toFixed(Ae(i)))}function Re(r,e,t){let i=Math.max(e,t)-e;return`--_neu-pos:${i>0?Math.round((r-e)/i*1e4)/1e4:0}`}var Oe={tag:"neu-slider",props:{value:{type:"number",default:Number.NaN},min:{type:"number",default:0},max:{type:"number",default:100},step:{type:"number",default:1},name:{type:"string"},label:{type:"string"},disabled:{type:"boolean"}},form:{valueProp:"value"},properties:{valueFormatter:"(value: number) => string"},styles:$t,template:r=>o`<span part="base" class="base" data-ref="base" style="${Re(Ie(r.value,r.min,r.max,r.step),r.min,r.max)}"><span part="track" class="track" data-ref="track"><span part="fill" class="fill"></span><span part="thumb" class="thumb"></span></span></span>`};var re=class extends b{static def=Oe;static extraProperties=["defaultValue","valueFormatter"];current;dirty=!1;dragging=!1;startValue=0;formatter;constructor(){super(),this.internals.role="slider",this.internals.ariaOrientation="horizontal",this.current=this.snap(this.props.value),this.addEventListener("keydown",e=>this.onKey(e)),this.addEventListener("pointerdown",e=>this.onDown(e)),this.addEventListener("pointermove",e=>this.onMove(e)),this.addEventListener("pointerup",()=>this.endDrag()),this.addEventListener("pointercancel",()=>this.endDrag()),this.addEventListener("lostpointercapture",()=>this.endDrag())}disconnected(){super.disconnected(),this.dragging=!1}get value(){return this.current}set value(e){this.dirty=!0,this.setCurrent(this.snap(Number(e)))}get defaultValue(){return this.snap(this.props.value)}set defaultValue(e){this.setAttribute("value",String(e))}get valueFormatter(){return this.formatter}set valueFormatter(e){this.formatter=typeof e=="function"?e:void 0,this.sync()}snap(e){return Ie(e,this.props.min,this.props.max,this.props.step)}sync(){let{min:e,max:t}=this.props,i=this.internals;i.ariaLabel=this.props.label===""?null:String(this.props.label),i.ariaValueMin=String(e),i.ariaValueMax=String(Math.max(e,t)),i.ariaValueNow=String(this.current),i.ariaValueText=this.formatter?this.formatter(this.current):null;let n=this.ref("base"),s=Re(this.current,e,t);n&&n.getAttribute("style")!==s&&n.setAttribute("style",s)}setCurrent(e){this.current=e,this.sync(),this.commit()}userSet(e){return e===this.current?!1:(this.markInteracted(),this.setCurrent(e),p(this,"input"),!0)}onKey(e){if(this.isDisabled||e.altKey||e.ctrlKey||e.metaKey)return;let{min:t,max:i}=this.props,n=g(this.props.step),s=this.matches(":dir(rtl)")?-1:1,a=At(t,i,n),h={ArrowRight:this.current+n*s,ArrowLeft:this.current-n*s,ArrowUp:this.current+n,ArrowDown:this.current-n,PageUp:this.current+a,PageDown:this.current-a,Home:Number.NEGATIVE_INFINITY,End:Number.POSITIVE_INFINITY}[e.key];h!==void 0&&(e.preventDefault(),this.userSet(this.snap(h))&&p(this,"change"))}onDown(e){if(!(this.isDisabled||e.button!==0)){this.dragging=!0,this.startValue=this.current,this.focus();try{this.setPointerCapture(e.pointerId)}catch{}this.moveTo(e)}}onMove(e){this.dragging&&this.moveTo(e)}moveTo(e){let t=this.ref("track");if(!t)return;let i=t.getBoundingClientRect(),n=i.width>0?(e.clientX-i.left)/i.width:0;this.matches(":dir(rtl)")&&(n=1-n);let{min:s,max:a}=this.props,l=Math.min(1,Math.max(0,n));this.userSet(this.snap(s+l*(Math.max(s,a)-s)))}endDrag(){this.dragging&&(this.dragging=!1,this.current!==this.startValue&&p(this,"change"))}willUpdate(e){(e.has("value")||e.has("min")||e.has("max")||e.has("step"))&&(this.current=this.snap(this.dirty?this.current:this.props.value))}update(e){e.has("disabled")&&this.syncDisabledState(),this.sync(),this.commit()}formValue(){return String(this.current)}validate(){this.internals.setValidity({})}resetToDefault(){this.dirty=!1,this.setCurrent(this.snap(this.props.value))}restoreState(e){this.dirty=!0,this.setCurrent(this.snap(Number(e)))}};re.define();var It=`${d}
274
266
  :host { display: inline-block; vertical-align: middle; inline-size: 1.5rem; block-size: 1.5rem; }
275
267
  :host([size='sm']) { inline-size: 1rem; block-size: 1rem; }
276
268
  :host([size='lg']) { inline-size: 2.25rem; block-size: 2.25rem; }
@@ -281,7 +273,7 @@ ${xe(e())}`,a=()=>{let l=r();l&&(i===void 0&&e()==="system"&&(i=s()),s()!==i&&(i
281
273
  .indicator { border: 3px solid transparent; border-block-start-color: var(--_neu-accent-c); animation: neu-spinner-rotate 0.9s linear infinite; }
282
274
  @keyframes neu-spinner-rotate { to { transform: rotate(360deg); } }
283
275
  @media (prefers-reduced-motion: reduce) { .indicator { animation-duration: 2.7s; } }
284
- `;var Oe={tag:"neu-spinner",props:{label:{type:"string",default:"Loading"},size:{type:"string",default:"md",values:["sm","md","lg"],reflect:!0}},styles:Mt,template:r=>o`<span part="base" class="base"><span part="track" class="track"></span><span part="indicator" class="indicator"></span><span class="label" data-ref="label">${r.label}</span></span>`,docs:{summary:"A rotating indicator for work in progress.",events:[],slots:[],parts:[{name:"base",description:"The sized wrapper."},{name:"track",description:"The inset ring behind the indicator."},{name:"indicator",description:"The rotating arc."}],cssProperties:d}};var te=class extends p{static def=Oe;constructor(){super(),this.internals.role="status"}update(e){if(!e.has("label"))return;let t=String(this.props.label);this.internals.ariaLabel=t||null,h(this.ref("label"),t)}};te.define();var $t=`${c}
276
+ `;var He={tag:"neu-spinner",props:{label:{type:"string",default:"Loading"},size:{type:"string",default:"md",values:["sm","md","lg"]}},styles:It,template:r=>o`<span part="base" class="base"><span part="track" class="track"></span><span part="indicator" class="indicator"></span><span class="label" data-ref="label">${r.label}</span></span>`};var ie=class extends u{static def=He;constructor(){super(),this.internals.role="status"}update(e){if(!e.has("label"))return;let t=String(this.props.label);this.internals.ariaLabel=t||null,m(this.ref("label"),t)}};ie.define();var Rt=`${d}
285
277
  :host { display: block; --_neu-raised-lg: calc(var(--_neu-d) * 2) calc(var(--_neu-d) * 2) calc(var(--_neu-d) * 4) var(--_neu-sd), calc(var(--_neu-d) * -2) calc(var(--_neu-d) * -2) calc(var(--_neu-d) * 4) var(--_neu-sl); --_neu-inset-lg: inset calc(var(--_neu-d) * 2) calc(var(--_neu-d) * 2) calc(var(--_neu-d) * 4) var(--_neu-sd), inset calc(var(--_neu-d) * -2) calc(var(--_neu-d) * -2) calc(var(--_neu-d) * 4) var(--_neu-sl); --_neu-up: var(--_neu-raised); --_neu-down: var(--_neu-inset); --_neu-hi: color-mix(in oklab, var(--_neu-bg), white 8%); --_neu-lo: color-mix(in oklab, var(--_neu-bg), black 6%); }
286
278
  :host([elevation='sm']) { --_neu-up: var(--_neu-raised-sm); --_neu-down: var(--_neu-inset-sm); }
287
279
  :host([elevation='lg']) { --_neu-up: var(--_neu-raised-lg); --_neu-down: var(--_neu-inset-lg); }
@@ -296,7 +288,7 @@ ${xe(e())}`,a=()=>{let l=r();l&&(i===void 0&&e()==="system"&&(i=s()),s()!==i&&(i
296
288
  :host([padding='none']) .base { padding: 0; }
297
289
  :host([padding='sm']) .base { padding: 0.75rem; }
298
290
  :host([padding='lg']) .base { padding: 2rem; }
299
- `;var Fe={tag:"neu-surface",props:{shape:{type:"string",default:"raised",values:["raised","inset","flat","convex","concave"],reflect:!0},elevation:{type:"string",default:"md",values:["sm","md","lg"],reflect:!0},radius:{type:"string",default:"md",values:["sm","md","lg","full"],reflect:!0},padding:{type:"string",default:"md",values:["none","sm","md","lg"],reflect:!0}},styles:$t,template:()=>o`<div part="base" class="base"><slot></slot></div>`,docs:{summary:"A neumorphic container with its own shape, elevation, radius and padding.",events:[],slots:[{name:"",description:"The content of the surface."}],parts:[{name:"base",description:"The surface itself."}],cssProperties:d}};var re=class extends p{static def=Fe};re.define();var It=`${c}
291
+ `;var Ve={tag:"neu-surface",props:{shape:{type:"string",default:"raised",values:["raised","inset","flat","convex","concave"]},elevation:{type:"string",default:"md",values:["sm","md","lg"]},radius:{type:"string",default:"md",values:["sm","md","lg","full"]},padding:{type:"string",default:"md",values:["none","sm","md","lg"]}},styles:Rt,template:()=>o`<div part="base" class="base"><slot></slot></div>`};var ne=class extends u{static def=Ve};ne.define();var Ot=`${d}
300
292
  :host {
301
293
  display: inline-flex; vertical-align: middle; cursor: pointer; user-select: none;
302
294
  --_neu-track-w: 2.875rem; --_neu-track-h: 1.625rem; --_neu-thumb: 1.25rem;
@@ -323,16 +315,16 @@ ${xe(e())}`,a=()=>{let l=r();l&&(i===void 0&&e()==="system"&&(i=s()),s()!==i&&(i
323
315
  :host(:disabled) .base, :host([disabled]) .base { opacity: 0.55; }
324
316
  :host(:state(user-invalid)) .track { box-shadow: var(--_neu-inset-sm), 0 0 0 2px color-mix(in oklab, var(--_neu-danger) 55%, transparent); }
325
317
  .label { color: var(--_neu-fg); }
326
- `;var He={tag:"neu-switch",props:{checked:{type:"boolean"},name:{type:"string",reflect:!0},value:{type:"string",default:"on",reflect:!0},disabled:{type:"boolean",reflect:!0},required:{type:"boolean",reflect:!0},size:{type:"string",default:"md",values:["sm","md","lg"],reflect:!0}},form:{valueProp:"checked"},styles:It,template:r=>o`<span part="base" class="base"><span part="track" class="track${r.checked?" on":""}" data-ref="track"><span part="thumb" class="thumb"></span></span><span part="label" class="label"><slot></slot></span></span>`,docs:{summary:"An on/off switch. The checked attribute is the default state.",events:[{name:"input",description:"Fired when the user toggles the switch."},{name:"change",description:"Fired after input when the user toggles the switch."}],slots:[{name:"",description:"Label; also the accessible name."}],parts:[{name:"base",description:"Wrapper around track and label."},{name:"track",description:"The inset track."},{name:"thumb",description:"The raised thumb."},{name:"label",description:"Wrapper around the default slot."}],cssProperties:d}};var ie=class extends D{static def=He;anchor="track";constructor(){super(),this.internals.role="switch"}paint(){this.ref("track")?.classList.toggle("on",this.checked)}};ie.define();var Rt=`${_}
318
+ `;var Ne={tag:"neu-switch",props:{checked:{type:"boolean"},name:{type:"string"},value:{type:"string",default:"on"},disabled:{type:"boolean"},required:{type:"boolean"},size:{type:"string",default:"md",values:["sm","md","lg"]}},form:{valueProp:"checked"},styles:Ot,template:r=>o`<span part="base" class="base"><span part="track" class="track${r.checked?" on":""}" data-ref="track"><span part="thumb" class="thumb"></span></span><span part="label" class="label"><slot></slot></span></span>`};var se=class extends D{static def=Ne;anchor="track";constructor(){super(),this.internals.role="switch"}paint(){this.ref("track")?.classList.toggle("on",this.checked)}};se.define();var Ht=`${_}
327
319
  .prefix, .suffix { display: inline-flex; }
328
320
  ::slotted([slot='prefix']) { margin-inline-end: 0.5rem; }
329
321
  ::slotted([slot='suffix']) { margin-inline-start: 0.5rem; }
330
- `;var dr={type:{type:"string",default:"text",values:["text","email","password","search","tel","url"],reflect:!0},value:{type:"string"},name:{type:"string",reflect:!0},label:{type:"string"},placeholder:{type:"string"},helpText:{type:"string"},errorText:{type:"string"},required:{type:"boolean",reflect:!0},disabled:{type:"boolean",reflect:!0},readOnly:{type:"boolean",reflect:!0,attribute:"readonly"},minLength:{type:"number",default:-1,attribute:"minlength"},maxLength:{type:"number",default:-1,attribute:"maxlength"},pattern:{type:"string"},autocomplete:{type:"string"},inputMode:{type:"string",attribute:"inputmode"},enterKeyHint:{type:"string",attribute:"enterkeyhint"},size:{type:"string",default:"md",values:["sm","md","lg"],reflect:!0}};function cr(r){return o`${r.placeholder?o` placeholder="${r.placeholder}"`:""}${r.required?o` required`:""}${r.disabled?o` disabled`:""}${r.readOnly?o` readonly`:""}${r.minLength>=0?o` minlength="${r.minLength}"`:""}${r.maxLength>=0?o` maxlength="${r.maxLength}"`:""}${r.pattern?o` pattern="${r.pattern}"`:""}${r.autocomplete?o` autocomplete="${r.autocomplete}"`:""}${r.inputMode?o` inputmode="${r.inputMode}"`:""}${r.enterKeyHint?o` enterkeyhint="${r.enterKeyHint}"`:""}`}var Ve={tag:"neu-text-field",props:dr,delegatesFocus:!0,form:{valueProp:"value"},styles:Rt,template:r=>o`<div part="base" class="base"><label part="label" class="label" for="input"><slot name="label"><span class="label-text" data-ref="label-text">${r.label}</span></slot></label><div part="control" class="control"><span part="prefix" class="prefix"><slot name="prefix"></slot></span><input part="input" class="input" id="input" data-ref="input" type="${r.type}" value="${r.value}" aria-describedby="help"${cr(r)}><span part="suffix" class="suffix"><slot name="suffix"></slot></span></div><div part="help-text" class="help" id="help"><slot name="help-text"><span class="help-text" data-ref="help-text">${r.helpText}</span></slot><span class="error-text" data-ref="error-text">${r.errorText}</span></div></div>`,docs:{summary:"A single-line text input with an inset field. The value attribute is the default value.",events:[{name:"input",description:"Fired on every edit (the native input event, composed)."},{name:"change",description:"Fired when an edit is committed, usually on blur."}],slots:[{name:"label",description:"Rich label; replaces the label attribute."},{name:"prefix",description:"Content before the input, such as an icon."},{name:"suffix",description:"Content after the input."},{name:"help-text",description:"Rich help text; replaces the help-text attribute."}],parts:[{name:"base",description:"Outer wrapper."},{name:"label",description:"The <label> element."},{name:"control",description:"The inset field around the input."},{name:"input",description:"The native <input>."},{name:"prefix",description:"Wrapper around the prefix slot."},{name:"suffix",description:"Wrapper around the suffix slot."},{name:"help-text",description:"Help or error text area."}],cssProperties:d}};var ne=class extends k{static def=Ve;static[M]=!0;static extraProperties=["defaultValue"];commitProps=[...z,"type","pattern"];get tp(){return this.props}probe(e){let t=document.createElement("input");return t.type=this.tp.type,t.value=e,this.tp.pattern&&t.setAttribute("pattern",this.tp.pattern),t}controlKeyDown(e){e.key!=="Enter"||e.isComposing||g(e,()=>{e.defaultPrevented||U(this.internals.form)})}update(e){let t=this.tp,i=this.input;i&&(e.has("type")&&i.type!==t.type&&(i.type=t.type),e.has("pattern")&&u(i,"pattern",t.pattern),e.has("inputMode")&&u(i,"inputmode",t.inputMode)),super.update(e)}formState(){return this.tp.type==="password"?null:super.formState()}};ne.define();var Ot=`${_}
322
+ `;var cr={type:{type:"string",default:"text",values:["text","email","password","search","tel","url"]},value:{type:"string"},name:{type:"string"},label:{type:"string"},placeholder:{type:"string"},helpText:{type:"string"},errorText:{type:"string"},required:{type:"boolean"},disabled:{type:"boolean"},readOnly:{type:"boolean",attribute:"readonly"},minLength:{type:"number",default:-1,attribute:"minlength"},maxLength:{type:"number",default:-1,attribute:"maxlength"},pattern:{type:"string"},autocomplete:{type:"string"},inputMode:{type:"string",attribute:"inputmode"},enterKeyHint:{type:"string",attribute:"enterkeyhint"},size:{type:"string",default:"md",values:["sm","md","lg"]}};function pr(r){return o`${r.placeholder?o` placeholder="${r.placeholder}"`:""}${r.required?o` required`:""}${r.disabled?o` disabled`:""}${r.readOnly?o` readonly`:""}${r.minLength>=0?o` minlength="${r.minLength}"`:""}${r.maxLength>=0?o` maxlength="${r.maxLength}"`:""}${r.pattern?o` pattern="${r.pattern}"`:""}${r.autocomplete?o` autocomplete="${r.autocomplete}"`:""}${r.inputMode?o` inputmode="${r.inputMode}"`:""}${r.enterKeyHint?o` enterkeyhint="${r.enterKeyHint}"`:""}`}var Fe={tag:"neu-text-field",props:cr,delegatesFocus:!0,form:{valueProp:"value"},styles:Ht,template:r=>o`<div part="base" class="base"><label part="label" class="label" for="input"><slot name="label"><span class="label-text" data-ref="label-text">${r.label}</span></slot></label><div part="control" class="control"><span part="prefix" class="prefix"><slot name="prefix"></slot></span><input part="input" class="input" id="input" data-ref="input" type="${r.type}" value="${r.value}" aria-describedby="help"${pr(r)}><span part="suffix" class="suffix"><slot name="suffix"></slot></span></div><div part="help-text" class="help" id="help"><slot name="help-text"><span class="help-text" data-ref="help-text">${r.helpText}</span></slot><span class="error-text" data-ref="error-text">${r.errorText}</span></div></div>`};var oe=class extends k{static def=Fe;static[A]=!0;static extraProperties=["defaultValue"];commitProps=[...z,"type","pattern"];get tp(){return this.props}probe(e){let t=document.createElement("input");return t.type=this.tp.type,t.value=e,this.tp.pattern&&t.setAttribute("pattern",this.tp.pattern),t}controlKeyDown(e){e.key!=="Enter"||E(e)||v(e,()=>{e.defaultPrevented||G(this.internals.form)})}update(e){let t=this.tp,i=this.input;i&&(e.has("type")&&i.type!==t.type&&(i.type=t.type),e.has("pattern")&&c(i,"pattern",t.pattern),e.has("inputMode")&&c(i,"inputmode",t.inputMode)),super.update(e)}formState(){return this.tp.type==="password"?null:super.formState()}};oe.define();var Vt=`${_}
331
323
  .control { align-items: stretch; }
332
324
  .input {
333
325
  display: block; box-sizing: border-box; padding-block: 0.625rem; line-height: 1.4; resize: vertical;
334
326
  }
335
327
  :host([resize='none']) .input { resize: none; }
336
328
  :host([resize='auto']) .input { resize: none; overflow: hidden; }
337
- `;var pr={value:{type:"string"},name:{type:"string",reflect:!0},label:{type:"string"},placeholder:{type:"string"},helpText:{type:"string"},errorText:{type:"string"},required:{type:"boolean",reflect:!0},disabled:{type:"boolean",reflect:!0},readOnly:{type:"boolean",reflect:!0,attribute:"readonly"},minLength:{type:"number",default:-1,attribute:"minlength"},maxLength:{type:"number",default:-1,attribute:"maxlength"},autocomplete:{type:"string"},enterKeyHint:{type:"string",attribute:"enterkeyhint"},rows:{type:"number",default:3},resize:{type:"string",default:"vertical",values:["none","vertical","auto"],reflect:!0},size:{type:"string",default:"md",values:["sm","md","lg"],reflect:!0}};function Ne(r){return Number.isInteger(r)&&r>=1?r:3}function ur(r){return o`${r.placeholder?o` placeholder="${r.placeholder}"`:""}${r.required?o` required`:""}${r.disabled?o` disabled`:""}${r.readOnly?o` readonly`:""}${r.minLength>=0?o` minlength="${r.minLength}"`:""}${r.maxLength>=0?o` maxlength="${r.maxLength}"`:""}${r.autocomplete?o` autocomplete="${r.autocomplete}"`:""}${r.enterKeyHint?o` enterkeyhint="${r.enterKeyHint}"`:""}`}var Be={tag:"neu-textarea",props:pr,delegatesFocus:!0,form:{valueProp:"value"},styles:Ot,template:r=>o`<div part="base" class="base"><label part="label" class="label" for="input"><slot name="label"><span class="label-text" data-ref="label-text">${r.label}</span></slot></label><div part="control" class="control"><textarea part="textarea" class="input" id="input" data-ref="input" rows="${Ne(r.rows)}" aria-describedby="help"${ur(r)}>
338
- ${r.value}</textarea></div><div part="help-text" class="help" id="help"><slot name="help-text"><span class="help-text" data-ref="help-text">${r.helpText}</span></slot><span class="error-text" data-ref="error-text">${r.errorText}</span></div></div>`,docs:{summary:'A multi-line text input with an inset field. The value attribute is the default value; resize="auto" grows the field with its content.',events:[{name:"input",description:"Fired on every edit (the native input event, composed)."},{name:"change",description:"Fired when an edit is committed, usually on blur."}],slots:[{name:"label",description:"Rich label; replaces the label attribute."},{name:"help-text",description:"Rich help text; replaces the help-text attribute."}],parts:[{name:"base",description:"Outer wrapper."},{name:"label",description:"The <label> element."},{name:"control",description:"The inset field around the textarea."},{name:"textarea",description:"The native <textarea>."},{name:"help-text",description:"Help or error text area."}],cssProperties:d}};var se=class extends k{static def=Be;static extraProperties=["defaultValue"];commitProps=z;get tp(){return this.props}get value(){return super.value}set value(e){super.value=e,this.grow()}probe(e){let t=document.createElement("textarea");return t.value=e,t}sizeWatch;sizeFrame=0;lastWidth=-1;watchSize(e,t){if(!t){this.stopWatch();return}this.sizeWatch||(this.lastWidth=-1,this.sizeWatch=new ResizeObserver(([i])=>{let n=i?.contentRect.width??0;n!==this.lastWidth&&(this.lastWidth=n,cancelAnimationFrame(this.sizeFrame),this.sizeFrame=requestAnimationFrame(()=>this.grow()))}),this.sizeWatch.observe(e))}stopWatch(){cancelAnimationFrame(this.sizeFrame),this.sizeWatch?.disconnect(),this.sizeWatch=void 0}grow(){let e=this.input;if(!e)return;if(this.watchSize(e,this.isConnected&&this.tp.resize==="auto"),this.tp.resize!=="auto"){e.style.blockSize="";return}e.style.blockSize="auto";let t=e.scrollHeight;t&&(e.style.blockSize=`${t}px`)}connected(){super.connected(),this.grow()}disconnected(){super.disconnected(),this.stopWatch()}rendered(){super.rendered(),this.input?.addEventListener("input",()=>this.grow())}update(e){let t=this.input;t&&e.has("rows")&&(t.rows=Ne(this.tp.rows)),super.update(e),["value","rows","resize","size"].some(i=>e.has(i))&&this.grow()}resetToDefault(){super.resetToDefault(),this.grow()}restoreState(e){super.restoreState(e),this.grow()}};se.define();export{R as NeuAvatar,O as NeuBadge,E as NeuButton,H as NeuButtonGroup,V as NeuCheckbox,N as NeuDivider,q as NeuIcon,K as NeuIconButton,W as NeuNumberField,G as NeuOption,X as NeuRadio,Z as NeuRadioGroup,Q as NeuSelect,ee as NeuSlider,te as NeuSpinner,re as NeuSurface,ie as NeuSwitch,ne as NeuTextField,se as NeuTextarea,ce as avatarDef,pe as badgeDef,fe as buttonDef,be as buttonGroupDef,ve as checkboxDef,ge as dividerDef,Se as iconButtonDef,_e as iconDef,Ee as numberFieldDef,Le as optionDef,ze as radioDef,Ce as radioGroupDef,Xt as registerIconLibrary,Ae as selectDef,Re as sliderDef,Oe as spinnerDef,Fe as surfaceDef,He as switchDef,Ve as textFieldDef,Be as textareaDef};
329
+ `;var mr={value:{type:"string"},name:{type:"string"},label:{type:"string"},placeholder:{type:"string"},helpText:{type:"string"},errorText:{type:"string"},required:{type:"boolean"},disabled:{type:"boolean"},readOnly:{type:"boolean",attribute:"readonly"},minLength:{type:"number",default:-1,attribute:"minlength"},maxLength:{type:"number",default:-1,attribute:"maxlength"},autocomplete:{type:"string"},enterKeyHint:{type:"string",attribute:"enterkeyhint"},rows:{type:"number",default:3},resize:{type:"string",default:"vertical",values:["none","vertical","auto"]},size:{type:"string",default:"md",values:["sm","md","lg"]}};function qe(r){return Number.isInteger(r)&&r>=1?r:3}function hr(r){return o`${r.placeholder?o` placeholder="${r.placeholder}"`:""}${r.required?o` required`:""}${r.disabled?o` disabled`:""}${r.readOnly?o` readonly`:""}${r.minLength>=0?o` minlength="${r.minLength}"`:""}${r.maxLength>=0?o` maxlength="${r.maxLength}"`:""}${r.autocomplete?o` autocomplete="${r.autocomplete}"`:""}${r.enterKeyHint?o` enterkeyhint="${r.enterKeyHint}"`:""}`}var Be={tag:"neu-textarea",props:mr,delegatesFocus:!0,form:{valueProp:"value"},styles:Vt,template:r=>o`<div part="base" class="base"><label part="label" class="label" for="input"><slot name="label"><span class="label-text" data-ref="label-text">${r.label}</span></slot></label><div part="control" class="control"><textarea part="textarea" class="input" id="input" data-ref="input" rows="${qe(r.rows)}" aria-describedby="help"${hr(r)}>
330
+ ${r.value}</textarea></div><div part="help-text" class="help" id="help"><slot name="help-text"><span class="help-text" data-ref="help-text">${r.helpText}</span></slot><span class="error-text" data-ref="error-text">${r.errorText}</span></div></div>`};var ae=class extends k{static def=Be;static extraProperties=["defaultValue"];commitProps=z;get tp(){return this.props}get value(){return super.value}set value(e){super.value=e,this.grow()}probe(e){let t=document.createElement("textarea");return t.value=e,t}sizeWatch;sizeFrame=0;lastWidth=-1;watchSize(e,t){if(!t){this.stopWatch();return}this.sizeWatch||(this.lastWidth=-1,this.sizeWatch=new ResizeObserver(([i])=>{let n=i?.contentRect.width??0;n!==this.lastWidth&&(this.lastWidth=n,cancelAnimationFrame(this.sizeFrame),this.sizeFrame=requestAnimationFrame(()=>this.grow()))}),this.sizeWatch.observe(e))}stopWatch(){cancelAnimationFrame(this.sizeFrame),this.sizeWatch?.disconnect(),this.sizeWatch=void 0}grow(){let e=this.input;if(!e)return;if(this.watchSize(e,this.isConnected&&this.tp.resize==="auto"),this.tp.resize!=="auto"){e.style.blockSize="";return}e.style.blockSize="auto";let t=e.scrollHeight;t&&(e.style.blockSize=`${t}px`)}connected(){super.connected(),this.grow()}disconnected(){super.disconnected(),this.stopWatch()}rendered(){super.rendered(),this.input?.addEventListener("input",()=>this.grow())}update(e){let t=this.input;t&&e.has("rows")&&(t.rows=qe(this.tp.rows)),super.update(e),["value","rows","resize","size"].some(i=>e.has(i))&&this.grow()}resetToDefault(){super.resetToDefault(),this.grow()}restoreState(e){super.restoreState(e),this.grow()}};ae.define();export{H as NeuAvatar,V as NeuBadge,L as NeuButton,F as NeuButtonGroup,q as NeuCheckbox,B as NeuDivider,U as NeuIcon,j as NeuIconButton,W as NeuNumberField,X as NeuOption,J as NeuRadio,Q as NeuRadioGroup,te as NeuSelect,re as NeuSlider,ie as NeuSpinner,ne as NeuSurface,se as NeuSwitch,oe as NeuTextField,ae as NeuTextarea,ce as avatarDef,pe as badgeDef,be as buttonDef,ve as buttonGroupDef,ge as checkboxDef,ye as dividerDef,Ee as iconButtonDef,Se as iconDef,Te as numberFieldDef,De as optionDef,Ce as radioDef,Me as radioGroupDef,Jt as registerIconLibrary,$e as selectDef,Oe as sliderDef,He as spinnerDef,Ve as surfaceDef,Ne as switchDef,Fe as textFieldDef,Be as textareaDef};