@devschile/chucao 1.6.0 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (155) hide show
  1. package/README.md +15 -12
  2. package/dist/chucao/chucao.css +1 -1
  3. package/dist/chucao/chucao.esm.js +1 -1
  4. package/dist/chucao/chucao.esm.js.map +1 -1
  5. package/dist/chucao/index.esm.js +1 -1
  6. package/dist/chucao/index.esm.js.map +1 -1
  7. package/dist/chucao/{p-175aee94.entry.js → p-13ab5f9a.entry.js} +2 -2
  8. package/dist/chucao/{p-dde82d7d.entry.js → p-1cc7042e.entry.js} +2 -2
  9. package/dist/chucao/p-23c5220b.entry.js +2 -0
  10. package/dist/chucao/p-23c5220b.entry.js.map +1 -0
  11. package/dist/chucao/p-2d7e81b2.entry.js +2 -0
  12. package/dist/chucao/p-2d7e81b2.entry.js.map +1 -0
  13. package/dist/chucao/{p-af2c57b5.entry.js → p-421cda05.entry.js} +2 -2
  14. package/dist/chucao/p-Bvah_WQV.js +3 -0
  15. package/dist/chucao/p-Bvah_WQV.js.map +1 -0
  16. package/dist/chucao/{p-d75eeeea.entry.js → p-c16b18b7.entry.js} +2 -2
  17. package/dist/chucao/p-cbb2b478.entry.js +2 -0
  18. package/dist/chucao/p-cbb2b478.entry.js.map +1 -0
  19. package/dist/chucao/{p-fcc70c8d.entry.js → p-cfb6db53.entry.js} +2 -2
  20. package/dist/chucao/p-df73f786.entry.js +2 -0
  21. package/dist/chucao/{p-85a49fd7.entry.js → p-e8fe65bb.entry.js} +2 -2
  22. package/dist/cjs/ch-accordion.cjs.entry.js +1 -1
  23. package/dist/cjs/{ch-badge_6.cjs.entry.js → ch-alert_8.cjs.entry.js} +73 -9
  24. package/dist/cjs/ch-alert_8.cjs.entry.js.map +1 -0
  25. package/dist/cjs/ch-checkbox.cjs.entry.js +2 -2
  26. package/dist/cjs/ch-divider.cjs.entry.js +2 -2
  27. package/dist/cjs/ch-link.cjs.entry.js +1 -1
  28. package/dist/cjs/ch-modal.cjs.entry.js +167 -0
  29. package/dist/cjs/ch-modal.cjs.entry.js.map +1 -0
  30. package/dist/cjs/ch-radio.cjs.entry.js +2 -2
  31. package/dist/cjs/ch-tabs.cjs.entry.js +2 -2
  32. package/dist/cjs/ch-textarea.cjs.entry.js +2 -2
  33. package/dist/cjs/ch-tooltip.cjs.entry.js +82 -0
  34. package/dist/cjs/ch-tooltip.cjs.entry.js.map +1 -0
  35. package/dist/cjs/chucao.cjs.js +3 -3
  36. package/dist/cjs/chucao.cjs.js.map +1 -1
  37. package/dist/cjs/{index-CiYvuUBV.js → index-DMeDkSQU.js} +183 -11
  38. package/dist/cjs/index-DMeDkSQU.js.map +1 -0
  39. package/dist/cjs/index.cjs.js +12 -1
  40. package/dist/cjs/index.cjs.js.map +1 -1
  41. package/dist/cjs/loader.cjs.js +2 -2
  42. package/dist/collection/collection-manifest.json +5 -1
  43. package/dist/collection/components/ch-alert/ch-alert.css +77 -0
  44. package/dist/collection/components/ch-alert/ch-alert.js +118 -0
  45. package/dist/collection/components/ch-alert/ch-alert.js.map +1 -0
  46. package/dist/collection/components/ch-badge/ch-badge.js +1 -1
  47. package/dist/collection/components/ch-button/ch-button.js +1 -1
  48. package/dist/collection/components/ch-button/ch-button.js.map +1 -1
  49. package/dist/collection/components/ch-card/ch-card.js +1 -1
  50. package/dist/collection/components/ch-checkbox/ch-checkbox.js +1 -1
  51. package/dist/collection/components/ch-divider/ch-divider.js +1 -1
  52. package/dist/collection/components/ch-input/ch-input.js +1 -1
  53. package/dist/collection/components/ch-modal/ch-modal.css +69 -0
  54. package/dist/collection/components/ch-modal/ch-modal.js +278 -0
  55. package/dist/collection/components/ch-modal/ch-modal.js.map +1 -0
  56. package/dist/collection/components/ch-radio/ch-radio.js +1 -1
  57. package/dist/collection/components/ch-select/ch-select.js +1 -1
  58. package/dist/collection/components/ch-spinner/ch-spinner.css +39 -0
  59. package/dist/collection/components/ch-spinner/ch-spinner.js +90 -0
  60. package/dist/collection/components/ch-spinner/ch-spinner.js.map +1 -0
  61. package/dist/collection/components/ch-switch/ch-switch.js +1 -1
  62. package/dist/collection/components/ch-tabs/ch-tabs.js +1 -1
  63. package/dist/collection/components/ch-textarea/ch-textarea.js +1 -1
  64. package/dist/collection/components/ch-tooltip/ch-tooltip.css +100 -0
  65. package/dist/collection/components/ch-tooltip/ch-tooltip.js +168 -0
  66. package/dist/collection/components/ch-tooltip/ch-tooltip.js.map +1 -0
  67. package/dist/collection/tokens/tokens.js +9 -1
  68. package/dist/collection/tokens/tokens.js.map +1 -1
  69. package/dist/collection/tokens/types.js.map +1 -1
  70. package/dist/components/ch-accordion.js +1 -1
  71. package/dist/components/ch-alert.d.ts +11 -0
  72. package/dist/components/ch-alert.js +2 -0
  73. package/dist/components/ch-alert.js.map +1 -0
  74. package/dist/components/ch-badge.js +1 -1
  75. package/dist/components/ch-button.js +1 -1
  76. package/dist/components/ch-button.js.map +1 -1
  77. package/dist/components/ch-card.js +1 -1
  78. package/dist/components/ch-card.js.map +1 -1
  79. package/dist/components/ch-checkbox.js +1 -1
  80. package/dist/components/ch-divider.js +1 -1
  81. package/dist/components/ch-input.js +1 -1
  82. package/dist/components/ch-link.js +1 -1
  83. package/dist/components/ch-modal.d.ts +11 -0
  84. package/dist/components/ch-modal.js +2 -0
  85. package/dist/components/ch-modal.js.map +1 -0
  86. package/dist/components/ch-radio.js +1 -1
  87. package/dist/components/ch-select.js +1 -1
  88. package/dist/components/ch-spinner.d.ts +11 -0
  89. package/dist/components/ch-spinner.js +2 -0
  90. package/dist/components/ch-spinner.js.map +1 -0
  91. package/dist/components/ch-switch.js +1 -1
  92. package/dist/components/ch-tabs.js +1 -1
  93. package/dist/components/ch-textarea.js +1 -1
  94. package/dist/components/ch-tooltip.d.ts +11 -0
  95. package/dist/components/ch-tooltip.js +2 -0
  96. package/dist/components/ch-tooltip.js.map +1 -0
  97. package/dist/components/index.js +1 -1
  98. package/dist/components/index.js.map +1 -1
  99. package/dist/components/p-hyy-cLgi.js +2 -0
  100. package/dist/components/p-hyy-cLgi.js.map +1 -0
  101. package/dist/esm/ch-accordion.entry.js +1 -1
  102. package/dist/esm/{ch-badge_6.entry.js → ch-alert_8.entry.js} +72 -10
  103. package/dist/esm/ch-alert_8.entry.js.map +1 -0
  104. package/dist/esm/ch-checkbox.entry.js +2 -2
  105. package/dist/esm/ch-divider.entry.js +2 -2
  106. package/dist/esm/ch-link.entry.js +1 -1
  107. package/dist/esm/ch-modal.entry.js +165 -0
  108. package/dist/esm/ch-modal.entry.js.map +1 -0
  109. package/dist/esm/ch-radio.entry.js +2 -2
  110. package/dist/esm/ch-tabs.entry.js +2 -2
  111. package/dist/esm/ch-textarea.entry.js +2 -2
  112. package/dist/esm/ch-tooltip.entry.js +80 -0
  113. package/dist/esm/ch-tooltip.entry.js.map +1 -0
  114. package/dist/esm/chucao.js +4 -4
  115. package/dist/esm/chucao.js.map +1 -1
  116. package/dist/esm/{index-ImsAHlk9.js → index-Bvah_WQV.js} +183 -12
  117. package/dist/esm/index-Bvah_WQV.js.map +1 -0
  118. package/dist/esm/index.js +10 -2
  119. package/dist/esm/index.js.map +1 -1
  120. package/dist/esm/loader.js +3 -3
  121. package/dist/types/components/ch-alert/ch-alert.d.ts +34 -0
  122. package/dist/types/components/ch-modal/ch-modal.d.ts +67 -0
  123. package/dist/types/components/ch-spinner/ch-spinner.d.ts +25 -0
  124. package/dist/types/components/ch-tooltip/ch-tooltip.d.ts +47 -0
  125. package/dist/types/components.d.ts +369 -0
  126. package/dist/types/stencil-public-runtime.d.ts +11 -0
  127. package/dist/types/tokens/tokens.d.ts +8 -0
  128. package/dist/types/tokens/types.d.ts +3 -3
  129. package/dist-react/components.d.ts +18 -1
  130. package/dist-react/components.js +39 -0
  131. package/dist-react/components.ts +55 -1
  132. package/dist-vue/index.d.ts +4 -0
  133. package/dist-vue/index.js +28 -0
  134. package/dist-vue/index.ts +36 -0
  135. package/hydrate/index.js +542 -19
  136. package/hydrate/index.mjs +542 -19
  137. package/package.json +6 -2
  138. package/dist/chucao/p-ImsAHlk9.js +0 -3
  139. package/dist/chucao/p-ImsAHlk9.js.map +0 -1
  140. package/dist/chucao/p-b4520f1c.entry.js +0 -2
  141. package/dist/chucao/p-b4520f1c.entry.js.map +0 -1
  142. package/dist/chucao/p-fe0c9320.entry.js +0 -2
  143. package/dist/cjs/ch-badge_6.cjs.entry.js.map +0 -1
  144. package/dist/cjs/index-CiYvuUBV.js.map +0 -1
  145. package/dist/components/p-x4aZoujY.js +0 -2
  146. package/dist/components/p-x4aZoujY.js.map +0 -1
  147. package/dist/esm/ch-badge_6.entry.js.map +0 -1
  148. package/dist/esm/index-ImsAHlk9.js.map +0 -1
  149. /package/dist/chucao/{p-175aee94.entry.js.map → p-13ab5f9a.entry.js.map} +0 -0
  150. /package/dist/chucao/{p-dde82d7d.entry.js.map → p-1cc7042e.entry.js.map} +0 -0
  151. /package/dist/chucao/{p-af2c57b5.entry.js.map → p-421cda05.entry.js.map} +0 -0
  152. /package/dist/chucao/{p-d75eeeea.entry.js.map → p-c16b18b7.entry.js.map} +0 -0
  153. /package/dist/chucao/{p-fcc70c8d.entry.js.map → p-cfb6db53.entry.js.map} +0 -0
  154. /package/dist/chucao/{p-fe0c9320.entry.js.map → p-df73f786.entry.js.map} +0 -0
  155. /package/dist/chucao/{p-85a49fd7.entry.js.map → p-e8fe65bb.entry.js.map} +0 -0
@@ -1,2 +1,2 @@
1
- import{r as i,c as r,h as a,H as e}from"./p-ImsAHlk9.js";const t=()=>`:host{display:inline-block}.group-label{display:block;margin-bottom:var(--spacing-sm);font-size:var(--typography-size-sm);font-weight:var(--typography-weight-semibold);color:var(--text)}.radio-group{display:flex;flex-direction:column;gap:var(--spacing-lg)}.control{display:inline-flex;align-items:center;gap:var(--spacing-lg);cursor:pointer}.control--disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.input{appearance:none;-webkit-appearance:none;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;width:var(--spacing-4xl);height:var(--spacing-4xl);margin:0;flex-shrink:0;border:var(--border-width) solid var(--border);border-radius:50%;background:var(--surface);cursor:pointer;transition:border-color var(--duration-normal) var(--easing-default), box-shadow var(--duration-normal) var(--easing-default)}.input:focus-visible{outline:var(--focus-outline-width) solid var(--accent);outline-offset:var(--focus-outline-offset)}.input:checked{border-color:var(--accent)}.input:checked::before{content:'';width:var(--spacing-md);height:var(--spacing-md);border-radius:50%;background:var(--accent)}.input--invalid{border-color:var(--color-status-warning)}.input--invalid:focus-visible{outline-color:var(--color-status-warning)}.label-text{color:var(--text)}.hint,.error{margin:var(--spacing-sm) 0 0;font-size:var(--typography-size-sm);color:var(--text-muted)}.error{color:var(--color-status-warning)}`;let s=0;const o=class{constructor(a){i(this,a);this.chChange=r(this,"chChange")}groupId=`ch-radio-${++s}`;labelId=`${this.groupId}-label`;hintId=`${this.groupId}-hint`;errorId=`${this.groupId}-error`;label;options=[];value;name;disabled=false;required=false;hint;errorMessage;invalid=false;chChange;handleChange=i=>{this.value=i.target.value;this.chChange.emit(this.value)};get describedBy(){if(this.invalid&&this.errorMessage){return this.errorId}if(this.hint){return this.hintId}return undefined}render(){const i=this.name||`${this.groupId}-group`;return a(e,{key:"d9a24c29e5fe841d5c6fefc68bc22db1d9c4ee02"},this.label&&a("span",{key:"c8dc580a29569ca98f7e6dafce797fa6ac5f7442",class:"group-label",id:this.labelId},this.label),a("div",{key:"6b10d53fbf83286ad18b29d3238df4927b3341db",class:"radio-group",role:"radiogroup","aria-labelledby":this.label?this.labelId:undefined},this.options.map((r=>a("label",{class:{control:true,"control--disabled":this.disabled||r.disabled}},a("input",{class:{input:true,"input--invalid":this.invalid},type:"radio",name:i,value:r.value,checked:r.value===this.value,disabled:this.disabled||r.disabled,"aria-invalid":this.invalid?"true":undefined,"aria-describedby":this.describedBy,onChange:this.handleChange}),a("span",{class:"mark"}),a("span",{class:"label-text"},r.label))))),this.hint&&!(this.invalid&&this.errorMessage)&&a("p",{key:"654315541c6b5ed2886283fae2fb72c37f91f575",class:"hint",id:this.hintId},this.hint),this.invalid&&this.errorMessage&&a("p",{key:"1ed129bddbf96f3b6562552edf416293a0ba0071",class:"error",id:this.errorId,role:"alert"},this.errorMessage))}};o.style=t();export{o as ch_radio};
2
- //# sourceMappingURL=p-d75eeeea.entry.js.map
1
+ import{r as i,c as e,h as r,H as a}from"./p-Bvah_WQV.js";const t=()=>`:host{display:inline-block}.group-label{display:block;margin-bottom:var(--spacing-sm);font-size:var(--typography-size-sm);font-weight:var(--typography-weight-semibold);color:var(--text)}.radio-group{display:flex;flex-direction:column;gap:var(--spacing-lg)}.control{display:inline-flex;align-items:center;gap:var(--spacing-lg);cursor:pointer}.control--disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.input{appearance:none;-webkit-appearance:none;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;width:var(--spacing-4xl);height:var(--spacing-4xl);margin:0;flex-shrink:0;border:var(--border-width) solid var(--border);border-radius:50%;background:var(--surface);cursor:pointer;transition:border-color var(--duration-normal) var(--easing-default), box-shadow var(--duration-normal) var(--easing-default)}.input:focus-visible{outline:var(--focus-outline-width) solid var(--accent);outline-offset:var(--focus-outline-offset)}.input:checked{border-color:var(--accent)}.input:checked::before{content:'';width:var(--spacing-md);height:var(--spacing-md);border-radius:50%;background:var(--accent)}.input--invalid{border-color:var(--color-status-warning)}.input--invalid:focus-visible{outline-color:var(--color-status-warning)}.label-text{color:var(--text)}.hint,.error{margin:var(--spacing-sm) 0 0;font-size:var(--typography-size-sm);color:var(--text-muted)}.error{color:var(--color-status-warning)}`;let s=0;const o=class{constructor(r){i(this,r);this.chChange=e(this,"chChange")}groupId=`ch-radio-${++s}`;labelId=`${this.groupId}-label`;hintId=`${this.groupId}-hint`;errorId=`${this.groupId}-error`;label;options=[];value;name;disabled=false;required=false;hint;errorMessage;invalid=false;chChange;handleChange=i=>{this.value=i.target.value;this.chChange.emit(this.value)};get describedBy(){if(this.invalid&&this.errorMessage){return this.errorId}if(this.hint){return this.hintId}return undefined}render(){const i=this.name||`${this.groupId}-group`;return r(a,{key:"68ce563b4a03669b76ff3822705b1ff92c4c02f2"},this.label&&r("span",{key:"1887f5b70a5bf9f049495d76588458181d3f7735",class:"group-label",id:this.labelId},this.label),r("div",{key:"c38ee340f9527e16c5587f2309f91ea463bb7cad",class:"radio-group",role:"radiogroup","aria-labelledby":this.label?this.labelId:undefined},this.options.map((e=>r("label",{class:{control:true,"control--disabled":this.disabled||e.disabled}},r("input",{class:{input:true,"input--invalid":this.invalid},type:"radio",name:i,value:e.value,checked:e.value===this.value,disabled:this.disabled||e.disabled,"aria-invalid":this.invalid?"true":undefined,"aria-describedby":this.describedBy,onChange:this.handleChange}),r("span",{class:"mark"}),r("span",{class:"label-text"},e.label))))),this.hint&&!(this.invalid&&this.errorMessage)&&r("p",{key:"ad60ce772279809ee334fc30182be1d0350d5586",class:"hint",id:this.hintId},this.hint),this.invalid&&this.errorMessage&&r("p",{key:"316c911f9e1a29d17cc2d6b0e60ed35755420ae2",class:"error",id:this.errorId,role:"alert"},this.errorMessage))}};o.style=t();export{o as ch_radio};
2
+ //# sourceMappingURL=p-c16b18b7.entry.js.map
@@ -0,0 +1,2 @@
1
+ import{r as t,a as e,h as a,H as i}from"./p-Bvah_WQV.js";const o=()=>`:host{display:inline-block}.anchor{position:relative;display:inline-flex}.bubble{position:absolute;z-index:var(--z-index-dropdown);width:max-content;max-width:16rem;padding:var(--spacing-md) var(--spacing-2xl);border:var(--border-width) solid var(--border);border-radius:var(--radius-sm);background:var(--color-background-base);color:var(--text);font-family:var(--font-body);font-size:var(--typography-size-sm);line-height:1.4;opacity:0;visibility:hidden;transition:opacity var(--duration-fast) var(--easing-default), visibility var(--duration-fast) var(--easing-default)}.bubble--visible{opacity:1;visibility:visible}.bubble::before{content:'';position:absolute}.bubble--top{bottom:100%;left:50%;transform:translateX(-50%);margin-bottom:var(--spacing-md)}.bubble--top::before{top:100%;left:0;right:0;height:var(--spacing-md)}.bubble--bottom{top:100%;left:50%;transform:translateX(-50%);margin-top:var(--spacing-md)}.bubble--bottom::before{bottom:100%;left:0;right:0;height:var(--spacing-md)}.bubble--left{right:100%;top:50%;transform:translateY(-50%);margin-right:var(--spacing-md)}.bubble--left::before{left:100%;top:0;bottom:0;width:var(--spacing-md)}.bubble--right{left:100%;top:50%;transform:translateY(-50%);margin-left:var(--spacing-md)}.bubble--right::before{right:100%;top:0;bottom:0;width:var(--spacing-md)}@media (prefers-reduced-motion: reduce){.bubble{transition:none}}`;let r=0;const s=class{constructor(e){t(this,e)}get el(){return e(this)}fallbackId=`ch-tooltip-${++r}`;placement="top";hovered=false;focused=false;dismissed=false;get visible(){return(this.hovered||this.focused)&&!this.dismissed}componentDidLoad(){this.associate()}handleMouseEnter(){this.hovered=true;this.dismissed=false}handleMouseLeave(){this.hovered=false}handleFocusIn(){this.focused=true;this.dismissed=false}handleFocusOut(){this.focused=false}handleKeyDown(t){if(t.key==="Escape"&&this.visible){this.dismissed=true}}slotted(t){return Array.from(this.el.children).find((e=>e.getAttribute("slot")===t))}associate=()=>{const t=this.slotted("trigger");const e=this.slotted("content");if(!t||!e){return}if(!e.id){e.id=this.fallbackId}e.setAttribute("role","tooltip");t.setAttribute("aria-describedby",e.id)};render(){return a(i,{key:"654d4a12f84c94e014691e911e7c63c6c45b8755"},a("span",{key:"726269e02fedc37efc39f1561d8b9baf83d6a4cc",class:"anchor"},a("slot",{key:"876cb19249032d6d1c66f22bd2c255683b6a7f66",name:"trigger",onSlotchange:this.associate}),a("span",{key:"7436eb75b40b33d0b6c8ce194245d4a08a29facb",class:{bubble:true,[`bubble--${this.placement}`]:true,"bubble--visible":this.visible}},a("slot",{key:"24648cc6078d61803793df011058da9515b466b5",name:"content",onSlotchange:this.associate}))))}};s.style=o();export{s as ch_tooltip};
2
+ //# sourceMappingURL=p-cbb2b478.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["chTooltipCss","tooltipIds","ChTooltip","fallbackId","placement","hovered","focused","dismissed","visible","this","componentDidLoad","associate","handleMouseEnter","handleMouseLeave","handleFocusIn","handleFocusOut","handleKeyDown","event","key","slotted","name","Array","from","el","children","find","child","getAttribute","trigger","content","id","setAttribute","render","h","Host","class","onSlotchange","bubble"],"sources":["src/components/ch-tooltip/ch-tooltip.css?tag=ch-tooltip&encapsulation=shadow","src/components/ch-tooltip/ch-tooltip.tsx"],"sourcesContent":[":host {\n display: inline-block;\n}\n\n.anchor {\n position: relative;\n display: inline-flex;\n}\n\n.bubble {\n position: absolute;\n z-index: var(--z-index-dropdown);\n width: max-content;\n max-width: 16rem;\n padding: var(--spacing-md) var(--spacing-2xl);\n border: var(--border-width) solid var(--border);\n border-radius: var(--radius-sm);\n background: var(--color-background-base);\n color: var(--text);\n font-family: var(--font-body);\n font-size: var(--typography-size-sm);\n line-height: 1.4;\n opacity: 0;\n visibility: hidden;\n transition:\n opacity var(--duration-fast) var(--easing-default),\n visibility var(--duration-fast) var(--easing-default);\n}\n\n.bubble--visible {\n opacity: 1;\n visibility: visible;\n}\n\n.bubble::before {\n content: '';\n position: absolute;\n}\n\n.bubble--top {\n bottom: 100%;\n left: 50%;\n transform: translateX(-50%);\n margin-bottom: var(--spacing-md);\n}\n\n.bubble--top::before {\n top: 100%;\n left: 0;\n right: 0;\n height: var(--spacing-md);\n}\n\n.bubble--bottom {\n top: 100%;\n left: 50%;\n transform: translateX(-50%);\n margin-top: var(--spacing-md);\n}\n\n.bubble--bottom::before {\n bottom: 100%;\n left: 0;\n right: 0;\n height: var(--spacing-md);\n}\n\n.bubble--left {\n right: 100%;\n top: 50%;\n transform: translateY(-50%);\n margin-right: var(--spacing-md);\n}\n\n.bubble--left::before {\n left: 100%;\n top: 0;\n bottom: 0;\n width: var(--spacing-md);\n}\n\n.bubble--right {\n left: 100%;\n top: 50%;\n transform: translateY(-50%);\n margin-left: var(--spacing-md);\n}\n\n.bubble--right::before {\n right: 100%;\n top: 0;\n bottom: 0;\n width: var(--spacing-md);\n}\n\n@media (prefers-reduced-motion: reduce) {\n .bubble {\n transition: none;\n }\n}\n","import { Component, Element, Host, Listen, Prop, State, h } from '@stencil/core';\n\nexport type ChTooltipPlacement = 'top' | 'bottom' | 'left' | 'right';\n\nlet tooltipIds = 0;\n\n/**\n * Short help text shown on hover and on focus.\n *\n * Both the trigger and the text come from the consumer's light DOM through\n * named slots. That is what makes the accessible association work: an\n * `aria-describedby` IDREF only resolves within a single tree, and slotted\n * nodes stay in the document tree even though they render inside the shadow\n * root. Keeping the text in the shadow root instead would need a reference\n * pointing into a shadow tree, which the platform does not allow — element\n * reflection only points outwards, and `referenceTarget` is not available yet.\n *\n * The trigger has to be a natively focusable element (`<button>`, `<a>`,\n * `<input>`). A chucao component such as `ch-button` will not be described,\n * because `aria-*` set on a custom element host does not reach the native\n * element inside it — see the discussion in issue #47.\n */\n@Component({\n tag: 'ch-tooltip',\n styleUrl: 'ch-tooltip.css',\n shadow: true,\n})\nexport class ChTooltip {\n @Element() private el: HTMLElement;\n\n private readonly fallbackId = `ch-tooltip-${++tooltipIds}`;\n\n /**\n * Which side of the trigger the bubble is placed on.\n */\n @Prop() placement: ChTooltipPlacement = 'top';\n\n // Hover and focus are tracked apart so that neither cancels the other: a\n // pointer passing over and away must not hide a tooltip whose trigger still\n // holds keyboard focus.\n @State() hovered = false;\n @State() focused = false;\n @State() dismissed = false;\n\n private get visible() {\n return (this.hovered || this.focused) && !this.dismissed;\n }\n\n componentDidLoad() {\n this.associate();\n }\n\n @Listen('mouseenter')\n handleMouseEnter() {\n this.hovered = true;\n this.dismissed = false;\n }\n\n @Listen('mouseleave')\n handleMouseLeave() {\n this.hovered = false;\n }\n\n @Listen('focusin')\n handleFocusIn() {\n this.focused = true;\n this.dismissed = false;\n }\n\n @Listen('focusout')\n handleFocusOut() {\n this.focused = false;\n }\n\n /**\n * Listens on the document because a tooltip opened by hovering leaves focus\n * wherever it was, so a host-scoped handler would never see the key.\n */\n @Listen('keydown', { target: 'document' })\n handleKeyDown(event: KeyboardEvent) {\n if (event.key === 'Escape' && this.visible) {\n this.dismissed = true;\n }\n }\n\n private slotted(name: string) {\n return Array.from(this.el.children).find(child => child.getAttribute('slot') === name);\n }\n\n /**\n * Points the trigger at the text with `aria-describedby`. Re-run on\n * `slotchange` because a framework re-render can replace the slotted nodes\n * and take the attributes with them.\n */\n private associate = () => {\n const trigger = this.slotted('trigger');\n const content = this.slotted('content');\n if (!trigger || !content) {\n return;\n }\n if (!content.id) {\n content.id = this.fallbackId;\n }\n content.setAttribute('role', 'tooltip');\n trigger.setAttribute('aria-describedby', content.id);\n };\n\n render() {\n return (\n <Host>\n <span class=\"anchor\">\n <slot name=\"trigger\" onSlotchange={this.associate}></slot>\n <span class={{ 'bubble': true, [`bubble--${this.placement}`]: true, 'bubble--visible': this.visible }}>\n <slot name=\"content\" onSlotchange={this.associate}></slot>\n </span>\n </span>\n </Host>\n );\n }\n}\n"],"mappings":"yDAAA,MAAMA,EAAe,IAAM,62CCI3B,IAAIC,EAAa,E,MAuBJC,EAAS,M,iDAGHC,WAAa,gBAAgBF,IAKtCG,UAAgC,MAK/BC,QAAU,MACVC,QAAU,MACVC,UAAY,MAErB,WAAYC,GACV,OAAQC,KAAKJ,SAAWI,KAAKH,WAAaG,KAAKF,S,CAGjD,gBAAAG,GACED,KAAKE,W,CAIP,gBAAAC,GACEH,KAAKJ,QAAU,KACfI,KAAKF,UAAY,K,CAInB,gBAAAM,GACEJ,KAAKJ,QAAU,K,CAIjB,aAAAS,GACEL,KAAKH,QAAU,KACfG,KAAKF,UAAY,K,CAInB,cAAAQ,GACEN,KAAKH,QAAU,K,CAQjB,aAAAU,CAAcC,GACZ,GAAIA,EAAMC,MAAQ,UAAYT,KAAKD,QAAS,CAC1CC,KAAKF,UAAY,I,EAIb,OAAAY,CAAQC,GACd,OAAOC,MAAMC,KAAKb,KAAKc,GAAGC,UAAUC,MAAKC,GAASA,EAAMC,aAAa,UAAYP,G,CAQ3ET,UAAY,KAClB,MAAMiB,EAAUnB,KAAKU,QAAQ,WAC7B,MAAMU,EAAUpB,KAAKU,QAAQ,WAC7B,IAAKS,IAAYC,EAAS,CACxB,M,CAEF,IAAKA,EAAQC,GAAI,CACfD,EAAQC,GAAKrB,KAAKN,U,CAEpB0B,EAAQE,aAAa,OAAQ,WAC7BH,EAAQG,aAAa,mBAAoBF,EAAQC,GAAG,EAGtD,MAAAE,GACE,OACEC,EAACC,EAAI,CAAAhB,IAAA,4CACHe,EAAA,QAAAf,IAAA,2CAAMiB,MAAM,UACVF,EAAA,QAAAf,IAAA,2CAAME,KAAK,UAAUgB,aAAc3B,KAAKE,YACxCsB,EAAA,QAAAf,IAAA,2CAAMiB,MAAO,CAAEE,OAAU,KAAM,CAAC,WAAW5B,KAAKL,aAAc,KAAM,kBAAmBK,KAAKD,UAC1FyB,EAAA,QAAAf,IAAA,2CAAME,KAAK,UAAUgB,aAAc3B,KAAKE,c","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- import{r as t,c as a,h as e,H as r}from"./p-ImsAHlk9.js";const i=()=>`:host{display:block}.tablist{display:flex;gap:var(--spacing-2xl);border-bottom:var(--border-width) solid var(--border)}.tab{appearance:none;position:relative;background:transparent;border:none;padding:var(--spacing-md) 0 var(--spacing-xl);margin-bottom:calc(-1 * var(--border-width));color:var(--text-muted);font-family:inherit;font-size:inherit;font-weight:var(--typography-weight-semibold);cursor:pointer;transition:color var(--duration-normal) var(--easing-default), border-color var(--duration-normal) var(--easing-default)}.tab::after{content:'';position:absolute;left:0;right:0;bottom:0;height:var(--border-accent-bar);background:var(--accent);opacity:0;transition:opacity var(--duration-normal) var(--easing-default)}.tab:hover{color:var(--text)}.tab:focus-visible{outline:var(--focus-outline-width) solid var(--accent);outline-offset:var(--focus-outline-offset)}.tab--active{color:var(--text)}.tab--active::after{opacity:1}.tab--disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.tabpanel{padding-top:var(--spacing-2xl);color:var(--text)}.tabpanel[hidden]{display:none}`;const o=0;const s=-1;const n=1;const l=-1;let c=0;const d=class{constructor(e){t(this,e);this.chChange=a(this,"chChange")}baseId=`ch-tabs-${++c}`;tablistEl;tabs=[];value;label;chChange;tabId(t){return`${this.baseId}-${t}`}panelId(t){return`${this.baseId}-${t}-panel`}get activeValue(){if(this.value&&this.tabs.some((t=>!t.disabled&&t.value===this.value))){return this.value}return this.tabs.find((t=>!t.disabled))?.value}select=t=>{this.value=t;this.chChange.emit(this.value)};focusTab(t){this.tablistEl?.querySelectorAll('[role="tab"]').forEach((a=>{if(a.dataset.value===t){a.focus()}}))}handleKeyDown=t=>{const a=this.tabs.filter((t=>!t.disabled));if(!a.length){return}const e=this.targetFor(t.key,a);if(!e){return}t.preventDefault();this.select(e);this.focusTab(e)};targetFor(t,a){const e=a.findIndex((t=>t.value===this.activeValue));if(t==="ArrowRight"){return a[(e+n)%a.length]?.value}if(t==="ArrowLeft"){return a[(e+l+a.length)%a.length]?.value}if(t==="Home"){return a[o]?.value}if(t==="End"){return a[a.length+s]?.value}return undefined}render(){const t=this.activeValue;return e(r,{key:"76a7f50b0cfa62b3a9a97114c99ab217da83aeb3"},e("div",{key:"544691573ac6940ec8406e8377ac0ed5fd95140e",class:"tablist",role:"tablist","aria-label":this.label,onKeyDown:this.handleKeyDown,ref:t=>this.tablistEl=t},this.tabs.map((a=>{const r=a.value===t;return e("button",{key:a.value,type:"button",class:{tab:true,"tab--active":r,"tab--disabled":Boolean(a.disabled)},role:"tab",id:this.tabId(a.value),"data-value":a.value,"aria-selected":r?"true":"false","aria-controls":this.panelId(a.value),tabIndex:r?o:s,disabled:a.disabled,onClick:()=>this.select(a.value)},a.label)}))),this.tabs.map((a=>e("div",{key:`${a.value}-panel`,class:"tabpanel",id:this.panelId(a.value),role:"tabpanel","aria-labelledby":this.tabId(a.value),tabIndex:o,hidden:a.value!==t},e("slot",{name:`panel-${a.value}`})))))}};d.style=i();export{d as ch_tabs};
2
- //# sourceMappingURL=p-fcc70c8d.entry.js.map
1
+ import{r as t,c as a,h as e,H as r}from"./p-Bvah_WQV.js";const i=()=>`:host{display:block}.tablist{display:flex;gap:var(--spacing-2xl);border-bottom:var(--border-width) solid var(--border)}.tab{appearance:none;position:relative;background:transparent;border:none;padding:var(--spacing-md) 0 var(--spacing-xl);margin-bottom:calc(-1 * var(--border-width));color:var(--text-muted);font-family:inherit;font-size:inherit;font-weight:var(--typography-weight-semibold);cursor:pointer;transition:color var(--duration-normal) var(--easing-default), border-color var(--duration-normal) var(--easing-default)}.tab::after{content:'';position:absolute;left:0;right:0;bottom:0;height:var(--border-accent-bar);background:var(--accent);opacity:0;transition:opacity var(--duration-normal) var(--easing-default)}.tab:hover{color:var(--text)}.tab:focus-visible{outline:var(--focus-outline-width) solid var(--accent);outline-offset:var(--focus-outline-offset)}.tab--active{color:var(--text)}.tab--active::after{opacity:1}.tab--disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.tabpanel{padding-top:var(--spacing-2xl);color:var(--text)}.tabpanel[hidden]{display:none}`;const o=0;const n=-1;const s=1;const l=-1;let c=0;const d=class{constructor(e){t(this,e);this.chChange=a(this,"chChange")}baseId=`ch-tabs-${++c}`;tablistEl;tabs=[];value;label;chChange;tabId(t){return`${this.baseId}-${t}`}panelId(t){return`${this.baseId}-${t}-panel`}get activeValue(){if(this.value&&this.tabs.some((t=>!t.disabled&&t.value===this.value))){return this.value}return this.tabs.find((t=>!t.disabled))?.value}select=t=>{this.value=t;this.chChange.emit(this.value)};focusTab(t){this.tablistEl?.querySelectorAll('[role="tab"]').forEach((a=>{if(a.dataset.value===t){a.focus()}}))}handleKeyDown=t=>{const a=this.tabs.filter((t=>!t.disabled));if(!a.length){return}const e=this.targetFor(t.key,a);if(!e){return}t.preventDefault();this.select(e);this.focusTab(e)};targetFor(t,a){const e=a.findIndex((t=>t.value===this.activeValue));if(t==="ArrowRight"){return a[(e+s)%a.length]?.value}if(t==="ArrowLeft"){return a[(e+l+a.length)%a.length]?.value}if(t==="Home"){return a[o]?.value}if(t==="End"){return a[a.length+n]?.value}return undefined}render(){const t=this.activeValue;return e(r,{key:"0467e7ea24884d4c19c33b736a07303569dfaa3b"},e("div",{key:"8ad451816ef31809c82486f3c9dd36b6e89e77e5",class:"tablist",role:"tablist","aria-label":this.label,onKeyDown:this.handleKeyDown,ref:t=>this.tablistEl=t},this.tabs.map((a=>{const r=a.value===t;return e("button",{key:a.value,type:"button",class:{tab:true,"tab--active":r,"tab--disabled":Boolean(a.disabled)},role:"tab",id:this.tabId(a.value),"data-value":a.value,"aria-selected":r?"true":"false","aria-controls":this.panelId(a.value),tabIndex:r?o:n,disabled:a.disabled,onClick:()=>this.select(a.value)},a.label)}))),this.tabs.map((a=>e("div",{key:`${a.value}-panel`,class:"tabpanel",id:this.panelId(a.value),role:"tabpanel","aria-labelledby":this.tabId(a.value),tabIndex:o,hidden:a.value!==t},e("slot",{name:`panel-${a.value}`})))))}};d.style=i();export{d as ch_tabs};
2
+ //# sourceMappingURL=p-cfb6db53.entry.js.map
@@ -0,0 +1,2 @@
1
+ import{r as i,h as r,H as e}from"./p-Bvah_WQV.js";const a=()=>`:host{display:block}:host(.divider--vertical){display:inline-block;height:100%;align-self:stretch}.divider{margin:0;border:none;background:var(--border)}.divider--horizontal{width:100%;height:var(--border-width)}.divider--vertical{width:var(--border-width);height:100%}`;const t=class{constructor(r){i(this,r)}orientation="horizontal";render(){return r(e,{key:"888debaaee690d5bbc5e276773f16ac7ead0129a",class:{"divider--vertical":this.orientation==="vertical"}},r("hr",{key:"ae175f047605cfbe2b24d50e0dab56ac362c49a1",class:{divider:true,[`divider--${this.orientation}`]:true},"aria-orientation":this.orientation}))}};t.style=a();export{t as ch_divider};
2
+ //# sourceMappingURL=p-df73f786.entry.js.map
@@ -1,2 +1,2 @@
1
- import{r as t,c as e,h as r,H as i}from"./p-ImsAHlk9.js";const a=()=>`:host{display:inline}.link{color:var(--accent);font-weight:var(--typography-weight-semibold);text-decoration:var(--ch-link-text-decoration, underline);text-decoration-thickness:var(--border-width);text-underline-offset:var(--spacing-shift);border-radius:var(--radius-sm);transition:color var(--duration-normal) var(--easing-default), opacity var(--duration-normal) var(--easing-default)}.link:hover{color:var(--accent-hover)}.link:focus-visible{outline:var(--focus-outline-width) solid var(--accent);outline-offset:var(--focus-outline-offset)}.link--muted{color:var(--text-muted);text-decoration:none}.link--muted:hover{color:var(--text)}.link--disabled{color:var(--text-muted);text-decoration:none;opacity:var(--opacity-disabled);cursor:not-allowed}`;const n=class{constructor(r){t(this,r);this.chClick=e(this,"chClick")}href;target;variant="default";disabled=false;chClick;handleClick=t=>{this.chClick.emit(t)};render(){if(this.disabled){return r(i,null,r("span",{class:{link:true,[`link--${this.variant}`]:true,"link--disabled":true},part:"link","aria-disabled":"true"},r("slot",null)))}return r(i,null,r("a",{class:{link:true,[`link--${this.variant}`]:true},part:"link",href:this.href,target:this.target,rel:this.target==="_blank"?"noopener noreferrer":undefined,onClick:this.handleClick},r("slot",null)))}};n.style=a();export{n as ch_link};
2
- //# sourceMappingURL=p-85a49fd7.entry.js.map
1
+ import{r as t,c as e,h as r,H as i}from"./p-Bvah_WQV.js";const a=()=>`:host{display:inline}.link{color:var(--accent);font-weight:var(--typography-weight-semibold);text-decoration:var(--ch-link-text-decoration, underline);text-decoration-thickness:var(--border-width);text-underline-offset:var(--spacing-shift);border-radius:var(--radius-sm);transition:color var(--duration-normal) var(--easing-default), opacity var(--duration-normal) var(--easing-default)}.link:hover{color:var(--accent-hover)}.link:focus-visible{outline:var(--focus-outline-width) solid var(--accent);outline-offset:var(--focus-outline-offset)}.link--muted{color:var(--text-muted);text-decoration:none}.link--muted:hover{color:var(--text)}.link--disabled{color:var(--text-muted);text-decoration:none;opacity:var(--opacity-disabled);cursor:not-allowed}`;const n=class{constructor(r){t(this,r);this.chClick=e(this,"chClick")}href;target;variant="default";disabled=false;chClick;handleClick=t=>{this.chClick.emit(t)};render(){if(this.disabled){return r(i,null,r("span",{class:{link:true,[`link--${this.variant}`]:true,"link--disabled":true},part:"link","aria-disabled":"true"},r("slot",null)))}return r(i,null,r("a",{class:{link:true,[`link--${this.variant}`]:true},part:"link",href:this.href,target:this.target,rel:this.target==="_blank"?"noopener noreferrer":undefined,onClick:this.handleClick},r("slot",null)))}};n.style=a();export{n as ch_link};
2
+ //# sourceMappingURL=p-e8fe65bb.entry.js.map
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-CiYvuUBV.js');
3
+ var index = require('./index-DMeDkSQU.js');
4
4
 
5
5
  const chAccordionCss = () => `:host{display:block}.item{background:var(--surface);border:var(--border-width) solid var(--border);border-radius:var(--radius);transition:border-color var(--duration-normal) var(--easing-default)}.item+.item{margin-top:var(--spacing-md)}.item--open{border-color:var(--border-hover)}.item-head{margin:0}.item-toggle{display:flex;align-items:center;justify-content:space-between;gap:var(--spacing-lg);width:100%;padding:var(--spacing-2xl) var(--spacing-3xl);background:transparent;border:none;color:var(--text);font-family:inherit;font-size:inherit;font-weight:var(--typography-weight-semibold);cursor:pointer}.item-toggle::after{content:'';width:var(--spacing-md);height:var(--spacing-md);flex-shrink:0;border-right:var(--border-width) solid var(--text-muted);border-bottom:var(--border-width) solid var(--text-muted);transform:rotate(45deg);transition:transform var(--duration-normal) var(--easing-default)}.item--open .item-toggle::after{transform:rotate(-135deg)}.item-toggle:focus-visible{outline:var(--focus-outline-width) solid var(--accent);outline-offset:var(--focus-outline-offset)}.item-toggle:disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.item-panel{padding:0 var(--spacing-3xl) var(--spacing-3xl);color:var(--text-muted)}.item-panel[hidden]{display:none}`;
6
6
 
@@ -1,6 +1,42 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-CiYvuUBV.js');
3
+ var index = require('./index-DMeDkSQU.js');
4
+
5
+ const chAlertCss = () => `:host{display:block}.alert{display:flex;align-items:flex-start;gap:var(--spacing-2xl);padding:var(--spacing-2xl) var(--spacing-3xl);border:var(--border-width) solid transparent;border-radius:var(--radius);font-size:var(--typography-size-sm);line-height:1.5}.alert-content{flex:1;min-width:0;overflow-wrap:anywhere}.alert--default{color:var(--text);background:var(--surface);border-color:var(--border)}.alert--positive{color:var(--color-status-positive);background:var(--color-status-positive-background);border-color:var(--color-status-positive)}.alert--warning{color:var(--color-status-warning);background:var(--color-status-warning-background);border-color:var(--color-status-warning)}.alert-dismiss{display:inline-flex;align-items:center;justify-content:center;flex:none;padding:var(--spacing-2xs) var(--spacing-md);border:0;border-radius:var(--radius);background:none;color:inherit;cursor:pointer;font-family:var(--font-heading);font-size:var(--typography-size-lg);line-height:1;transition:background-color var(--duration-normal) var(--easing-default)}.alert-dismiss:hover{background:var(--surface-hover)}.alert-dismiss:focus-visible{outline:var(--focus-outline-width) solid currentColor;outline-offset:var(--focus-outline-offset)}@media (pointer: coarse){.alert-dismiss{min-width:44px;min-height:44px}}@media (prefers-reduced-motion: reduce){.alert-dismiss{transition:none}}`;
6
+
7
+ const ChAlert = class {
8
+ constructor(hostRef) {
9
+ index.registerInstance(this, hostRef);
10
+ this.chDismiss = index.createEvent(this, "chDismiss");
11
+ }
12
+ /**
13
+ * The kind of message. `default` is neutral, `positive` confirms, and
14
+ * `warning` covers both warnings and errors — the token scale has a single
15
+ * status colour for the two of them.
16
+ */
17
+ variant = 'default';
18
+ /**
19
+ * Accessible label for the dismiss button, set as `aria-label`. Setting it
20
+ * is what adds the button: the button's only content is a decorative glyph,
21
+ * so without a label it would have no accessible name at all.
22
+ */
23
+ dismissLabel;
24
+ /**
25
+ * Emitted when the dismiss button is clicked. The alert stays in the DOM —
26
+ * whether to remove it is the consumer's decision. If you do remove it, move
27
+ * focus somewhere sensible first: removing the focused button drops focus to
28
+ * `<body>`.
29
+ */
30
+ chDismiss;
31
+ handleDismiss = () => {
32
+ this.chDismiss.emit();
33
+ };
34
+ render() {
35
+ const role = this.variant === 'warning' ? 'alert' : 'status';
36
+ return (index.h(index.Host, { key: '7d96602ad2c2b3824588f01d5b94d73098da6ce4' }, index.h("div", { key: role, class: { alert: true, [`alert--${this.variant}`]: true }, role: role }, index.h("div", { key: '64d7af5aad0e4b103b35cc2ba3756b1a1601b148', class: "alert-content" }, index.h("slot", { key: '44573092407161bbeafe5117bddb54168b183d90' })), this.dismissLabel && (index.h("button", { key: '018858ac292c0fb7f26c788f629638f533d0dfd6', class: "alert-dismiss", type: "button", "aria-label": this.dismissLabel, onClick: this.handleDismiss }, index.h("span", { key: 'f6454d5285ed9c7c414d839d2d35d2ce0c271dd4', "aria-hidden": "true" }, "\u00D7"))))));
37
+ }
38
+ };
39
+ ChAlert.style = chAlertCss();
4
40
 
5
41
  const chBadgeCss = () => `:host{display:inline-block}.badge{display:inline-block;padding:var(--spacing-2xs) var(--spacing-lg);border-radius:var(--radius-pill);font-size:var(--typography-size-xs);font-weight:var(--typography-weight-semibold);text-transform:uppercase;letter-spacing:var(--typography-tracking-badge)}.badge--default{background:var(--color-surface-hover);color:var(--accent)}.badge--positive{background:var(--color-status-positive-background);color:var(--color-status-positive)}.badge--warning{background:var(--color-status-warning-background);color:var(--color-status-warning)}`;
6
42
 
@@ -13,7 +49,7 @@ const ChBadge = class {
13
49
  */
14
50
  variant = 'default';
15
51
  render() {
16
- return (index.h(index.Host, { key: 'c0acd8486b8265884b3c4a2a5a68bf10098a09cd' }, index.h("span", { key: '2ae6af3f7ac4c6967dc6eefe607b3910ba341741', class: { badge: true, [`badge--${this.variant}`]: true } }, index.h("slot", { key: '2aab4bb7e25492dc01cb94cf055efde3897f736b' }))));
52
+ return (index.h(index.Host, { key: 'ca1fb0c9d678b6ea5b68ca131ba153116bbd577d' }, index.h("span", { key: '929e2268094bdad7df6e3c8371896e364ebf79c3', class: { badge: true, [`badge--${this.variant}`]: true } }, index.h("slot", { key: '64422988ad046244722755d39e564295f79a6ce1' }))));
17
53
  }
18
54
  };
19
55
  ChBadge.style = chBadgeCss();
@@ -47,7 +83,7 @@ const ChButton = class {
47
83
  this.chClick.emit(ev);
48
84
  };
49
85
  render() {
50
- return (index.h(index.Host, { key: '1fc74b55b6d69be97fba63f0fb2d72ffd217eafb' }, index.h("button", { key: 'af6721f9eb066f7e0cb7a23031d43eb46fbbdf9e', class: { btn: true, [`btn--${this.variant}`]: true }, type: "button", disabled: this.disabled, "aria-label": this.label, onClick: this.handleClick }, index.h("slot", { key: '2c42b74352aa7a79ac6bc231cdd828b7a62f5083' }))));
86
+ return (index.h(index.Host, { key: '9363b49e8d38c0fab49ed10356380ded20a8cf5e' }, index.h("button", { key: '3c98506ae1418c4bc88f5aa72dfe058948556ed5', class: { btn: true, [`btn--${this.variant}`]: true }, type: "button", disabled: this.disabled, "aria-label": this.label, onClick: this.handleClick }, index.h("slot", { key: 'cdcf4f656b995fa527d4139a41b2ea3c7086e065' }))));
51
87
  }
52
88
  };
53
89
  ChButton.style = chButtonCss();
@@ -59,7 +95,7 @@ const ChCard = class {
59
95
  index.registerInstance(this, hostRef);
60
96
  }
61
97
  render() {
62
- return (index.h(index.Host, { key: '89781abc150f0078e9d36233f02d2bb29f3d2cc1' }, index.h("div", { key: '41271ca28fd5c045a4dad746ec7e2c7264a35aac', class: "card" }, index.h("slot", { key: '1786ea797968b94fc48de08836fc0195b0731469' }))));
98
+ return (index.h(index.Host, { key: '1541ba4361c996716356fb87cdcc73b1260d4c6a' }, index.h("div", { key: '924070eeb79f6c8f8e6362772bbab0dcc1c6f315', class: "card" }, index.h("slot", { key: '2fde36426395a519cb1ebe265ba0eef3aaf6ff38' }))));
63
99
  }
64
100
  };
65
101
  ChCard.style = chCardCss();
@@ -144,7 +180,7 @@ const ChInput = class {
144
180
  return undefined;
145
181
  }
146
182
  render() {
147
- return (index.h(index.Host, { key: '82557c17d49bf048b7056853a088565a243325be' }, this.label && (index.h("label", { key: 'cc774b0001daa6c7f4e4bb8d62ea21698bd744e9', class: "label", htmlFor: this.inputId }, this.label)), index.h("input", { key: 'dc30d9f798611a0a4bb577c18a2696d065a281ee', id: this.label ? this.inputId : undefined, class: { 'input': true, 'input--invalid': this.invalid }, type: this.type, name: this.name, placeholder: this.placeholder, disabled: this.disabled, required: this.required, value: this.value, "aria-invalid": this.invalid ? 'true' : undefined, "aria-describedby": this.describedBy, onInput: this.handleInput, onChange: this.handleChange }), this.hint && !(this.invalid && this.errorMessage) && (index.h("p", { key: '21b76002a309dfe167e671fd270699f8699ed6b9', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (index.h("p", { key: 'be64956da00a76dccdbf0979f3352b263a21fb12', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
183
+ return (index.h(index.Host, { key: '56ef5eab354235c89214be28263cde91168f5dee' }, this.label && (index.h("label", { key: '745fe11f607591d1c571dcf7d9429d834dfa4f2b', class: "label", htmlFor: this.inputId }, this.label)), index.h("input", { key: '18739cebe47aa1130b55fa5aaf184a1f3fad88d2', id: this.label ? this.inputId : undefined, class: { 'input': true, 'input--invalid': this.invalid }, type: this.type, name: this.name, placeholder: this.placeholder, disabled: this.disabled, required: this.required, value: this.value, "aria-invalid": this.invalid ? 'true' : undefined, "aria-describedby": this.describedBy, onInput: this.handleInput, onChange: this.handleChange }), this.hint && !(this.invalid && this.errorMessage) && (index.h("p", { key: '60a43287f6329db3f4b27ad882300fced0925645', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (index.h("p", { key: 'ea18e90000f1a244cbe51126441b5d260562e07a', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
148
184
  }
149
185
  };
150
186
  ChInput.style = chInputCss();
@@ -220,11 +256,37 @@ const ChSelect = class {
220
256
  return undefined;
221
257
  }
222
258
  render() {
223
- return (index.h(index.Host, { key: '206697f7162cbac4e5486a937d7e44bb971b6ee4' }, this.label && (index.h("label", { key: '664e7423e7ac1a5dd6c626f2094c0ffe63d7ea36', class: "label", htmlFor: this.selectId }, this.label)), index.h("select", { key: 'd010c2ea52bf449d823d115fa835b53dfa28390a', id: this.label ? this.selectId : undefined, class: { 'select': true, 'select--invalid': this.invalid }, name: this.name, disabled: this.disabled, required: this.required, "aria-invalid": this.invalid ? 'true' : undefined, "aria-describedby": this.describedBy, onChange: this.handleChange }, this.placeholder && (index.h("option", { key: '9a28e73a3ef6742d037eaa825f1a66dfd4447ae6', value: "", disabled: true, hidden: true, selected: !this.value }, this.placeholder)), this.options.map(option => (index.h("option", { value: option.value, disabled: option.disabled, selected: option.value === this.value }, option.label)))), this.hint && !(this.invalid && this.errorMessage) && (index.h("p", { key: '6d3ff7d72bc488b723a3d9cd0982f5e3d4d46c87', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (index.h("p", { key: 'bbc4b768cb94c39b57663d27a86b886e2ff9a556', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
259
+ return (index.h(index.Host, { key: '90aaf1fa70da54071539de8a22ebe9373f2ae90a' }, this.label && (index.h("label", { key: '8b14b4deb611c4f1eb496c6f0d3fa58b7c4342b6', class: "label", htmlFor: this.selectId }, this.label)), index.h("select", { key: 'c93b4ba079e9e61ef5bb2392256545af73263665', id: this.label ? this.selectId : undefined, class: { 'select': true, 'select--invalid': this.invalid }, name: this.name, disabled: this.disabled, required: this.required, "aria-invalid": this.invalid ? 'true' : undefined, "aria-describedby": this.describedBy, onChange: this.handleChange }, this.placeholder && (index.h("option", { key: 'df8e97bdb0bd3e5426558027d34c1eb63ee76f1e', value: "", disabled: true, hidden: true, selected: !this.value }, this.placeholder)), this.options.map(option => (index.h("option", { value: option.value, disabled: option.disabled, selected: option.value === this.value }, option.label)))), this.hint && !(this.invalid && this.errorMessage) && (index.h("p", { key: '6b6078e31a1a2f183951f5ada63a5e7e7f582f96', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (index.h("p", { key: 'f7791b37b8660441a43a6b45d99472b2df7df0ab', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
224
260
  }
225
261
  };
226
262
  ChSelect.style = chSelectCss();
227
263
 
264
+ const chSpinnerCss = () => `:host{display:inline-block;vertical-align:middle}.spinner{display:block;box-sizing:border-box;width:1em;height:1em;border:0.125em solid currentColor;border-top-color:transparent;border-radius:50%;animation:ch-spinner-rotate var(--duration-spin) var(--easing-linear) infinite}.spinner--sm{font-size:var(--typography-size-sm)}.spinner--md{font-size:var(--typography-size-lg)}.spinner--lg{font-size:var(--typography-size-xl)}@keyframes ch-spinner-rotate{to{transform:rotate(360deg)}}@media (prefers-reduced-motion: reduce){.spinner{animation-duration:calc(var(--duration-spin) * 4)}}`;
265
+
266
+ const ChSpinner = class {
267
+ constructor(hostRef) {
268
+ index.registerInstance(this, hostRef);
269
+ }
270
+ /**
271
+ * The size of the spinner. Either `sm`, `md`, or `lg`. Each size sets a
272
+ * font-size and the spinner is drawn in `em`, so it also scales with an
273
+ * inherited font-size.
274
+ */
275
+ size = 'md';
276
+ /**
277
+ * Accessible label announced while the spinner is visible, e.g. `Cargando
278
+ * resultados`. When omitted the spinner is treated as decorative and hidden
279
+ * from assistive technology — the right behaviour next to visible loading
280
+ * text, which would otherwise be announced twice.
281
+ */
282
+ label;
283
+ render() {
284
+ const labelled = Boolean(this.label);
285
+ return (index.h(index.Host, { key: 'dc7c7e19f6a6878680555b0d7dbd84f5dc5774c8' }, index.h("span", { key: 'd29d5f3344ae578d2a28382b13b45b901d41e52b', class: { spinner: true, [`spinner--${this.size}`]: true }, role: labelled ? 'status' : undefined, "aria-label": labelled ? this.label : undefined, "aria-hidden": labelled ? undefined : 'true' })));
286
+ }
287
+ };
288
+ ChSpinner.style = chSpinnerCss();
289
+
228
290
  const chSwitchCss = () => `:host{display:inline-block}.control{position:relative;display:inline-flex;align-items:center;gap:var(--spacing-lg);cursor:pointer}.control--disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.input{position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:pointer}.input:focus-visible~.track{outline:var(--focus-outline-width) solid var(--accent);outline-offset:var(--focus-outline-offset)}.track{position:relative;box-sizing:border-box;width:var(--spacing-6xl);height:var(--spacing-5xl);flex-shrink:0;border:var(--border-width) solid var(--border);border-radius:var(--radius-pill);background:var(--surface);transition:border-color var(--duration-normal) var(--easing-default), background-color var(--duration-normal) var(--easing-default)}.thumb{position:absolute;top:50%;left:var(--spacing-2xs);width:var(--spacing-2xl);height:var(--spacing-2xl);border-radius:50%;background:var(--text-muted);transform:translateY(-50%);transition:left var(--duration-normal) var(--easing-default), background-color var(--duration-normal) var(--easing-default)}.input:checked~.track{border-color:var(--accent);background:var(--accent)}.input:checked~.track .thumb{left:calc(100% - var(--spacing-2xl) - var(--spacing-2xs));background:var(--color-accent-text)}.input--invalid~.track{border-color:var(--color-status-warning)}.input--invalid:focus-visible~.track{outline-color:var(--color-status-warning)}.label-text{color:var(--text)}.hint,.error{margin:var(--spacing-sm) 0 0;font-size:var(--typography-size-sm);color:var(--text-muted)}.error{color:var(--color-status-warning)}`;
229
291
 
230
292
  let switchIds = 0;
@@ -292,17 +354,19 @@ const ChSwitch = class {
292
354
  return undefined;
293
355
  }
294
356
  render() {
295
- return (index.h(index.Host, { key: 'a2872e01803daa52a44e9ffe16e5c57ebd8f2a93' }, index.h("label", { key: 'fb94e4de3381b617a17b8aec2342ee5c72be775a', class: { 'control': true, 'control--disabled': this.disabled }, htmlFor: this.switchId }, index.h("input", { key: '4861655716af08d93965d78d98fe09a871ab409b', id: this.switchId, class: { 'input': true, 'input--invalid': this.invalid }, type: "checkbox", role: "switch", name: this.name, value: this.value, checked: this.checked, disabled: this.disabled, required: this.required, "aria-checked": this.checked ? 'true' : 'false', "aria-invalid": this.invalid ? 'true' : undefined, "aria-describedby": this.describedBy, onChange: this.handleChange }), index.h("span", { key: 'e94675c142dd85c09d1e188a80cffc6978e98369', class: "track" }, index.h("span", { key: '9ffbd604a65b8530cb9f67c44ec81adc206acdfe', class: "thumb" })), this.label && index.h("span", { key: 'c8c1cf4745dd7cf9647101269b02cf3d75d8ded4', class: "label-text" }, this.label)), this.hint && !(this.invalid && this.errorMessage) && (index.h("p", { key: 'aa3afe7f4720766c7e0ab4cdc6baae85f68c8577', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (index.h("p", { key: '274e2599ccbd6d5ff6df8fad7bf9c59efcc0ffb6', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
357
+ return (index.h(index.Host, { key: 'f95f9b724e37771ea3949ff569881dc1eff370a1' }, index.h("label", { key: '878c3c47e380356a3b79e79fdd135df627ce37a6', class: { 'control': true, 'control--disabled': this.disabled }, htmlFor: this.switchId }, index.h("input", { key: '14ee6041b8aeb4115db1f7ca9c542314651f34ea', id: this.switchId, class: { 'input': true, 'input--invalid': this.invalid }, type: "checkbox", role: "switch", name: this.name, value: this.value, checked: this.checked, disabled: this.disabled, required: this.required, "aria-checked": this.checked ? 'true' : 'false', "aria-invalid": this.invalid ? 'true' : undefined, "aria-describedby": this.describedBy, onChange: this.handleChange }), index.h("span", { key: '0d58863f220b6e9f04babd6231a35dea039a41a2', class: "track" }, index.h("span", { key: '588617f6bb1c61168b860c4b2863892828fd5df5', class: "thumb" })), this.label && index.h("span", { key: '530e64cc85761e91a019431f977bb9d2d8e86e27', class: "label-text" }, this.label)), this.hint && !(this.invalid && this.errorMessage) && (index.h("p", { key: '71ffd6b56a753673f9d5663054a217e250363ce1', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (index.h("p", { key: '63f9965c30d8cd2820554de31ac7edc364aee22b', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
296
358
  }
297
359
  };
298
360
  ChSwitch.style = chSwitchCss();
299
361
 
362
+ exports.ch_alert = ChAlert;
300
363
  exports.ch_badge = ChBadge;
301
364
  exports.ch_button = ChButton;
302
365
  exports.ch_card = ChCard;
303
366
  exports.ch_input = ChInput;
304
367
  exports.ch_select = ChSelect;
368
+ exports.ch_spinner = ChSpinner;
305
369
  exports.ch_switch = ChSwitch;
306
- //# sourceMappingURL=ch-badge.ch-button.ch-card.ch-input.ch-select.ch-switch.entry.cjs.js.map
370
+ //# sourceMappingURL=ch-alert.ch-badge.ch-button.ch-card.ch-input.ch-select.ch-spinner.ch-switch.entry.cjs.js.map
307
371
 
308
-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AA,0CAAA,EAAM,KAAK,EAAC,YAAY,EAAA,EAAE,IAAI,CAAC,KAAK,CAAQ,CACrD,EACP,IAAI,CAAC,IAAI,IAAI,EAAE,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,YAAY,CAAC,KAChDA,OAAA,CAAA,GAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAG,KAAK,EAAC,MAAM,EAAC,EAAE,EAAE,IAAI,CAAC,MAAM,EAAA,EAC5B,IAAI,CAAC,IAAI,CACR,CACL,EACA,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,YAAY,KAChCA,OAAA,CAAA,GAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAG,KAAK,EAAC,OAAO,EAAC,EAAE,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,EAAC,OAAO,EAAA,EAC5C,IAAI,CAAC,YAAY,CAChB,CACL,CACI;;;;;;;;;;;;;;","names":["h","Host"],"sources":["src/components/ch-alert/ch-alert.css?tag=ch-alert&encapsulation=shadow","src/components/ch-alert/ch-alert.tsx","src/components/ch-badge/ch-badge.css?tag=ch-badge&encapsulation=shadow","src/components/ch-badge/ch-badge.tsx","src/components/ch-button/ch-button.css?tag=ch-button&encapsulation=shadow","src/components/ch-button/ch-button.tsx","src/components/ch-card/ch-card.css?tag=ch-card&encapsulation=shadow","src/components/ch-card/ch-card.tsx","src/components/ch-input/ch-input.css?tag=ch-input&encapsulation=shadow","src/components/ch-input/ch-input.tsx","src/components/ch-select/ch-select.css?tag=ch-select&encapsulation=shadow","src/components/ch-select/ch-select.tsx","src/components/ch-spinner/ch-spinner.css?tag=ch-spinner&encapsulation=shadow","src/components/ch-spinner/ch-spinner.tsx","src/components/ch-switch/ch-switch.css?tag=ch-switch&encapsulation=shadow","src/components/ch-switch/ch-switch.tsx"],"sourcesContent":[":host {\n display: block;\n}\n\n.alert {\n display: flex;\n align-items: flex-start;\n gap: var(--spacing-2xl);\n padding: var(--spacing-2xl) var(--spacing-3xl);\n border: var(--border-width) solid transparent;\n border-radius: var(--radius);\n font-size: var(--typography-size-sm);\n line-height: 1.5;\n}\n\n.alert-content {\n flex: 1;\n min-width: 0;\n overflow-wrap: anywhere;\n}\n\n.alert--default {\n color: var(--text);\n background: var(--surface);\n border-color: var(--border);\n}\n\n.alert--positive {\n color: var(--color-status-positive);\n background: var(--color-status-positive-background);\n border-color: var(--color-status-positive);\n}\n\n.alert--warning {\n color: var(--color-status-warning);\n background: var(--color-status-warning-background);\n border-color: var(--color-status-warning);\n}\n\n.alert-dismiss {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex: none;\n padding: var(--spacing-2xs) var(--spacing-md);\n border: 0;\n border-radius: var(--radius);\n background: none;\n color: inherit;\n cursor: pointer;\n font-family: var(--font-heading);\n font-size: var(--typography-size-lg);\n line-height: 1;\n transition: background-color var(--duration-normal) var(--easing-default);\n}\n\n.alert-dismiss:hover {\n background: var(--surface-hover);\n}\n\n.alert-dismiss:focus-visible {\n outline: var(--focus-outline-width) solid currentColor;\n outline-offset: var(--focus-outline-offset);\n}\n\n@media (pointer: coarse) {\n .alert-dismiss {\n min-width: 44px;\n min-height: 44px;\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .alert-dismiss {\n transition: none;\n }\n}\n","import { Component, Event, type EventEmitter, Host, Prop, h } from '@stencil/core';\n\nexport type ChAlertVariant = 'default' | 'positive' | 'warning';\n\n/**\n * Block-level status message.\n *\n * `warning` carries `role=\"alert\"` and is announced assertively; `default` and\n * `positive` use `role=\"status\"`, since a confirmation is not urgent enough to\n * interrupt. Both announce reliably when the alert is added to the page in\n * response to something — an alert already present at load may not be read out,\n * which is how live regions work rather than something this component controls.\n */\n@Component({\n tag: 'ch-alert',\n styleUrl: 'ch-alert.css',\n shadow: true,\n})\nexport class ChAlert {\n /**\n * The kind of message. `default` is neutral, `positive` confirms, and\n * `warning` covers both warnings and errors — the token scale has a single\n * status colour for the two of them.\n */\n @Prop() variant: ChAlertVariant = 'default';\n\n /**\n * Accessible label for the dismiss button, set as `aria-label`. Setting it\n * is what adds the button: the button's only content is a decorative glyph,\n * so without a label it would have no accessible name at all.\n */\n @Prop() dismissLabel?: string;\n\n /**\n * Emitted when the dismiss button is clicked. The alert stays in the DOM —\n * whether to remove it is the consumer's decision. If you do remove it, move\n * focus somewhere sensible first: removing the focused button drops focus to\n * `<body>`.\n */\n @Event() chDismiss: EventEmitter<void>;\n\n private handleDismiss = () => {\n this.chDismiss.emit();\n };\n\n render() {\n const role = this.variant === 'warning' ? 'alert' : 'status';\n\n return (\n <Host>\n {/* Keyed on the role so a variant change replaces the node instead of\n mutating its role in place, which assistive technology does not\n reliably re-announce. */}\n <div key={role} class={{ alert: true, [`alert--${this.variant}`]: true }} role={role}>\n <div class=\"alert-content\">\n <slot></slot>\n </div>\n {this.dismissLabel && (\n <button class=\"alert-dismiss\" type=\"button\" aria-label={this.dismissLabel} onClick={this.handleDismiss}>\n <span aria-hidden=\"true\">×</span>\n </button>\n )}\n </div>\n </Host>\n );\n }\n}\n",":host {\n display: inline-block;\n}\n\n.badge {\n display: inline-block;\n padding: var(--spacing-2xs) var(--spacing-lg);\n border-radius: var(--radius-pill);\n font-size: var(--typography-size-xs);\n font-weight: var(--typography-weight-semibold);\n text-transform: uppercase;\n letter-spacing: var(--typography-tracking-badge);\n}\n\n.badge--default {\n background: var(--color-surface-hover);\n color: var(--accent);\n}\n\n.badge--positive {\n background: var(--color-status-positive-background);\n color: var(--color-status-positive);\n}\n.badge--warning {\n background: var(--color-status-warning-background);\n color: var(--color-status-warning);\n}\n","import { Component, Host, Prop, h } from '@stencil/core';\n\nexport type ChBadgeVariant = 'default' | 'positive' | 'warning';\n\n@Component({\n tag: 'ch-badge',\n styleUrl: 'ch-badge.css',\n shadow: true,\n})\nexport class ChBadge {\n /**\n * The visual style of the badge. Either `default`, `positive`, or `warning`.\n */\n @Prop() variant: ChBadgeVariant = 'default';\n\n render() {\n return (\n <Host>\n <span class={{ badge: true, [`badge--${this.variant}`]: true }}>\n <slot></slot>\n </span>\n </Host>\n );\n }\n}\n",":host {\n display: inline-block;\n}\n\n.btn {\n display: inline-flex;\n align-items: center;\n gap: var(--spacing-sm);\n border: none;\n cursor: pointer;\n font-family: inherit;\n font-size: inherit;\n}\n\n.btn:disabled {\n opacity: var(--opacity-disabled);\n cursor: not-allowed;\n}\n\n.btn:focus-visible {\n outline: var(--focus-outline-width) solid var(--accent);\n outline-offset: var(--focus-outline-offset);\n}\n\n.btn--primary {\n background-color: var(--accent);\n color: var(--color-accent-text);\n font-weight: var(--typography-weight-bold);\n padding: var(--spacing-xs) var(--spacing-xl);\n border-radius: var(--radius-pill);\n transition:\n background-color var(--duration-normal) var(--easing-default),\n transform var(--duration-fast) var(--easing-default);\n}\n\n.btn--primary:hover {\n background-color: var(--accent-hover);\n transform: translateY(calc(-1 * var(--spacing-elevate)));\n}\n\n.btn--secondary {\n background-color: transparent;\n color: var(--text);\n font-weight: var(--typography-weight-bold);\n padding: var(--spacing-xs) var(--spacing-xl);\n border-radius: var(--radius-pill);\n border: var(--border-width) solid var(--border);\n transition:\n border-color var(--duration-normal) var(--easing-default),\n background-color var(--duration-normal) var(--easing-default),\n transform var(--duration-fast) var(--easing-default);\n}\n\n.btn--secondary:hover {\n border-color: var(--border-hover);\n background-color: var(--surface-hover);\n transform: translateY(calc(-1 * var(--spacing-elevate)));\n}\n","import { Component, Event, type EventEmitter, Host, Prop, h } from '@stencil/core';\n\nexport type ChButtonVariant = 'primary' | 'secondary';\n\n@Component({\n tag: 'ch-button',\n styleUrl: 'ch-button.css',\n shadow: true,\n})\nexport class ChButton {\n /**\n * The visual style of the button. Either `primary` or `secondary`.\n */\n @Prop() variant: ChButtonVariant = 'primary';\n\n /**\n * Whether the button is disabled.\n */\n @Prop() disabled = false;\n\n /**\n * Accessible label set as `aria-label` on the native `<button>`. Use it\n * when the button's content doesn't convey its purpose on its own (e.g.\n * an icon-only button).\n */\n @Prop() label?: string;\n\n /**\n * Emitted when the button is clicked.\n */\n @Event() chClick: EventEmitter<MouseEvent>;\n\n private handleClick = (ev: MouseEvent) => {\n this.chClick.emit(ev);\n };\n\n render() {\n return (\n <Host>\n <button class={{ btn: true, [`btn--${this.variant}`]: true }} type=\"button\" disabled={this.disabled} aria-label={this.label} onClick={this.handleClick}>\n <slot></slot>\n </button>\n </Host>\n );\n }\n}\n",":host {\n display: block;\n}\n\n::slotted(p) {\n color: var(--text-muted);\n}\n\n.card {\n color: var(--text);\n background: var(--surface);\n border: var(--border-width) solid var(--border);\n border-radius: var(--radius);\n padding: var(--spacing-4xl) var(--spacing-5xl);\n backdrop-filter: blur(var(--effect-blur));\n position: relative;\n overflow: hidden;\n transition:\n border-color var(--duration-normal) var(--easing-default),\n transform var(--duration-fast) var(--easing-default),\n box-shadow var(--duration-normal) var(--easing-default);\n}\n\n.card::before {\n content: '';\n position: absolute;\n left: 0;\n top: 0;\n bottom: 0;\n width: var(--border-accent-bar);\n background: var(--accent);\n opacity: 0;\n transition: opacity var(--duration-normal) var(--easing-default);\n}\n\n.card:hover {\n border-color: var(--border-hover);\n transform: translateX(var(--spacing-shift));\n box-shadow: var(--shadow-card-hover);\n}\n\n.card:hover::before {\n opacity: 1;\n}\n","import { Component, Host, h } from '@stencil/core';\n\n@Component({\n tag: 'ch-card',\n styleUrl: 'ch-card.css',\n shadow: true,\n})\nexport class ChCard {\n render() {\n return (\n <Host>\n <div class=\"card\">\n <slot></slot>\n </div>\n </Host>\n );\n }\n}\n",":host {\n display: inline-block;\n width: 100%;\n}\n\n.label {\n display: block;\n margin-bottom: var(--spacing-sm);\n font-size: var(--typography-size-sm);\n font-weight: var(--typography-weight-semibold);\n color: var(--text);\n}\n\n.input {\n box-sizing: border-box;\n width: 100%;\n padding: var(--spacing-xl) var(--spacing-3xl);\n border-radius: var(--radius);\n border: var(--border-width) solid var(--border);\n background: var(--surface);\n color: var(--text);\n backdrop-filter: blur(var(--effect-blur));\n font-family: inherit;\n font-size: inherit;\n transition:\n border-color var(--duration-normal) var(--easing-default),\n box-shadow var(--duration-normal) var(--easing-default);\n}\n\n.input::placeholder {\n color: var(--text-muted);\n}\n\n.input:focus {\n border-color: var(--accent);\n box-shadow: var(--shadow-focus-ring);\n outline: none;\n}\n\n.input--invalid {\n border-color: var(--color-status-warning);\n}\n\n.input--invalid:focus {\n border-color: var(--color-status-warning);\n box-shadow: 0 0 0 3px var(--color-status-warning-background);\n}\n\n.input:disabled {\n opacity: var(--opacity-disabled);\n cursor: not-allowed;\n}\n\n.hint,\n.error {\n margin: var(--spacing-sm) 0 0;\n font-size: var(--typography-size-sm);\n color: var(--text-muted);\n}\n\n.error {\n color: var(--color-status-warning);\n}\n","import { Component, Event, type EventEmitter, Host, Prop, h } from '@stencil/core';\n\nlet inputIds = 0;\n\n@Component({\n tag: 'ch-input',\n styleUrl: 'ch-input.css',\n shadow: true,\n})\nexport class ChInput {\n private readonly inputId = `ch-input-${++inputIds}`;\n private readonly hintId = `${this.inputId}-hint`;\n private readonly errorId = `${this.inputId}-error`;\n\n /**\n * Visible label rendered above the input and associated with it via\n * `for`/`id`, so assistive technology announces the input's purpose.\n */\n @Prop() label?: string;\n\n /**\n * The type of the input, mirroring the native `<input type>` attribute.\n */\n @Prop() type = 'text';\n\n /**\n * The value of the input.\n */\n @Prop({ mutable: true }) value = '';\n\n /**\n * Placeholder text shown when the input is empty.\n */\n @Prop() placeholder?: string;\n\n /**\n * The name of the input, submitted with form data.\n */\n @Prop() name?: string;\n\n /**\n * Whether the input is disabled.\n */\n @Prop() disabled = false;\n\n /**\n * Whether the input is required.\n */\n @Prop() required = false;\n\n /**\n * Helper text rendered below the input, associated via `aria-describedby`.\n * Replaced by `errorMessage` when the input is invalid.\n */\n @Prop() hint?: string;\n\n /**\n * Error message rendered below the input when it is invalid.\n */\n @Prop() errorMessage?: string;\n\n /**\n * Whether the input is in an invalid state; toggles `aria-invalid` and error styling.\n */\n @Prop() invalid = false;\n\n /**\n * Emitted on every keystroke, with the current input value.\n */\n @Event() chInput: EventEmitter<string>;\n\n /**\n * Emitted when the input value is committed (on native `change`).\n */\n @Event() chChange: EventEmitter<string>;\n\n private handleInput = (ev: InputEvent) => {\n this.value = (ev.target as HTMLInputElement).value;\n this.chInput.emit(this.value);\n };\n\n private handleChange = (ev: Event) => {\n this.value = (ev.target as HTMLInputElement).value;\n this.chChange.emit(this.value);\n };\n\n private get describedBy(): string | undefined {\n if (this.invalid && this.errorMessage) {\n return this.errorId;\n }\n if (this.hint) {\n return this.hintId;\n }\n return undefined;\n }\n\n render() {\n return (\n <Host>\n {this.label && (\n <label class=\"label\" htmlFor={this.inputId}>\n {this.label}\n </label>\n )}\n <input\n id={this.label ? this.inputId : undefined}\n class={{ 'input': true, 'input--invalid': this.invalid }}\n type={this.type}\n name={this.name}\n placeholder={this.placeholder}\n disabled={this.disabled}\n required={this.required}\n value={this.value}\n aria-invalid={this.invalid ? 'true' : undefined}\n aria-describedby={this.describedBy}\n onInput={this.handleInput}\n onChange={this.handleChange}\n />\n {this.hint && !(this.invalid && this.errorMessage) && (\n <p class=\"hint\" id={this.hintId}>\n {this.hint}\n </p>\n )}\n {this.invalid && this.errorMessage && (\n <p class=\"error\" id={this.errorId} role=\"alert\">\n {this.errorMessage}\n </p>\n )}\n </Host>\n );\n }\n}\n",":host {\n display: inline-block;\n width: 100%;\n}\n\n.label {\n display: block;\n margin-bottom: var(--spacing-sm);\n font-size: var(--typography-size-sm);\n font-weight: var(--typography-weight-semibold);\n color: var(--text);\n}\n\n.select {\n box-sizing: border-box;\n width: 100%;\n padding: var(--spacing-xl) var(--spacing-3xl);\n border-radius: var(--radius);\n border: var(--border-width) solid var(--border);\n background: var(--surface);\n color: var(--text);\n backdrop-filter: blur(var(--effect-blur));\n font-family: inherit;\n font-size: inherit;\n cursor: pointer;\n transition:\n border-color var(--duration-normal) var(--easing-default),\n box-shadow var(--duration-normal) var(--easing-default);\n}\n\n.select:focus {\n border-color: var(--accent);\n box-shadow: var(--shadow-focus-ring);\n outline: none;\n}\n\n.select--invalid {\n border-color: var(--color-status-warning);\n}\n\n.select--invalid:focus {\n border-color: var(--color-status-warning);\n box-shadow: 0 0 0 3px var(--color-status-warning-background);\n}\n\n.select:disabled {\n opacity: var(--opacity-disabled);\n cursor: not-allowed;\n}\n\n.select option {\n background: var(--bg);\n color: var(--text);\n}\n\n.hint,\n.error {\n margin: var(--spacing-sm) 0 0;\n font-size: var(--typography-size-sm);\n color: var(--text-muted);\n}\n\n.error {\n color: var(--color-status-warning);\n}\n","import { Component, Event, type EventEmitter, Host, Prop, h } from '@stencil/core';\n\nexport interface ChSelectOption {\n label: string;\n value: string;\n disabled?: boolean;\n}\n\nlet selectIds = 0;\n\n@Component({\n tag: 'ch-select',\n styleUrl: 'ch-select.css',\n shadow: true,\n})\nexport class ChSelect {\n private readonly selectId = `ch-select-${++selectIds}`;\n private readonly hintId = `${this.selectId}-hint`;\n private readonly errorId = `${this.selectId}-error`;\n\n /**\n * Visible label rendered above the select and associated with it via\n * `for`/`id`, so assistive technology announces the select's purpose.\n */\n @Prop() label?: string;\n\n /**\n * The list of options rendered inside the select.\n */\n @Prop() options: ChSelectOption[] = [];\n\n /**\n * The value of the selected option.\n */\n @Prop({ mutable: true }) value?: string;\n\n /**\n * Placeholder shown as a disabled, hidden first option when no value is selected.\n */\n @Prop() placeholder?: string;\n\n /**\n * The name of the select, submitted with form data.\n */\n @Prop() name?: string;\n\n /**\n * Whether the select is disabled.\n */\n @Prop() disabled = false;\n\n /**\n * Whether a value is required.\n */\n @Prop() required = false;\n\n /**\n * Helper text rendered below the select, associated via `aria-describedby`.\n * Replaced by `errorMessage` when the select is invalid.\n */\n @Prop() hint?: string;\n\n /**\n * Error message rendered below the select when it is invalid.\n */\n @Prop() errorMessage?: string;\n\n /**\n * Whether the select is in an invalid state; toggles `aria-invalid` and error styling.\n */\n @Prop() invalid = false;\n\n /**\n * Emitted when the selected option changes, with the new value.\n */\n @Event() chChange: EventEmitter<string>;\n\n private handleChange = (ev: Event) => {\n this.value = (ev.target as HTMLSelectElement).value;\n this.chChange.emit(this.value);\n };\n\n private get describedBy(): string | undefined {\n if (this.invalid && this.errorMessage) {\n return this.errorId;\n }\n if (this.hint) {\n return this.hintId;\n }\n return undefined;\n }\n\n render() {\n return (\n <Host>\n {this.label && (\n <label class=\"label\" htmlFor={this.selectId}>\n {this.label}\n </label>\n )}\n <select\n id={this.label ? this.selectId : undefined}\n class={{ 'select': true, 'select--invalid': this.invalid }}\n name={this.name}\n disabled={this.disabled}\n required={this.required}\n aria-invalid={this.invalid ? 'true' : undefined}\n aria-describedby={this.describedBy}\n onChange={this.handleChange}\n >\n {this.placeholder && (\n <option value=\"\" disabled hidden selected={!this.value}>\n {this.placeholder}\n </option>\n )}\n {this.options.map(option => (\n <option value={option.value} disabled={option.disabled} selected={option.value === this.value}>\n {option.label}\n </option>\n ))}\n </select>\n {this.hint && !(this.invalid && this.errorMessage) && (\n <p class=\"hint\" id={this.hintId}>\n {this.hint}\n </p>\n )}\n {this.invalid && this.errorMessage && (\n <p class=\"error\" id={this.errorId} role=\"alert\">\n {this.errorMessage}\n </p>\n )}\n </Host>\n );\n }\n}\n",":host {\n display: inline-block;\n vertical-align: middle;\n}\n\n.spinner {\n display: block;\n box-sizing: border-box;\n width: 1em;\n height: 1em;\n border: 0.125em solid currentColor;\n border-top-color: transparent;\n border-radius: 50%;\n animation: ch-spinner-rotate var(--duration-spin) var(--easing-linear) infinite;\n}\n\n.spinner--sm {\n font-size: var(--typography-size-sm);\n}\n\n.spinner--md {\n font-size: var(--typography-size-lg);\n}\n\n.spinner--lg {\n font-size: var(--typography-size-xl);\n}\n\n@keyframes ch-spinner-rotate {\n to {\n transform: rotate(360deg);\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .spinner {\n animation-duration: calc(var(--duration-spin) * 4);\n }\n}\n","import { Component, Host, Prop, h } from '@stencil/core';\n\nexport type ChSpinnerSize = 'sm' | 'md' | 'lg';\n\n/**\n * Loading indicator.\n *\n * The spinner is drawn in `currentColor`, so it takes the surrounding text\n * colour and stays legible on any surface — inside a primary `ch-button` it\n * picks up the button's own text colour instead of the accent, which would be\n * invisible there. Set `color` on or above the element to change it.\n */\n@Component({\n tag: 'ch-spinner',\n styleUrl: 'ch-spinner.css',\n shadow: true,\n})\nexport class ChSpinner {\n /**\n * The size of the spinner. Either `sm`, `md`, or `lg`. Each size sets a\n * font-size and the spinner is drawn in `em`, so it also scales with an\n * inherited font-size.\n */\n @Prop() size: ChSpinnerSize = 'md';\n\n /**\n * Accessible label announced while the spinner is visible, e.g. `Cargando\n * resultados`. When omitted the spinner is treated as decorative and hidden\n * from assistive technology — the right behaviour next to visible loading\n * text, which would otherwise be announced twice.\n */\n @Prop() label?: string;\n\n render() {\n const labelled = Boolean(this.label);\n\n return (\n <Host>\n <span\n class={{ spinner: true, [`spinner--${this.size}`]: true }}\n role={labelled ? 'status' : undefined}\n aria-label={labelled ? this.label : undefined}\n aria-hidden={labelled ? undefined : 'true'}\n ></span>\n </Host>\n );\n }\n}\n",":host {\n display: inline-block;\n}\n\n.control {\n position: relative;\n display: inline-flex;\n align-items: center;\n gap: var(--spacing-lg);\n cursor: pointer;\n}\n\n.control--disabled {\n opacity: var(--opacity-disabled);\n cursor: not-allowed;\n}\n\n.input {\n position: absolute;\n inset: 0;\n width: 100%;\n height: 100%;\n margin: 0;\n opacity: 0;\n cursor: pointer;\n}\n\n.input:focus-visible ~ .track {\n outline: var(--focus-outline-width) solid var(--accent);\n outline-offset: var(--focus-outline-offset);\n}\n\n.track {\n position: relative;\n box-sizing: border-box;\n width: var(--spacing-6xl);\n height: var(--spacing-5xl);\n flex-shrink: 0;\n border: var(--border-width) solid var(--border);\n border-radius: var(--radius-pill);\n background: var(--surface);\n transition:\n border-color var(--duration-normal) var(--easing-default),\n background-color var(--duration-normal) var(--easing-default);\n}\n\n.thumb {\n position: absolute;\n top: 50%;\n left: var(--spacing-2xs);\n width: var(--spacing-2xl);\n height: var(--spacing-2xl);\n border-radius: 50%;\n background: var(--text-muted);\n transform: translateY(-50%);\n transition:\n left var(--duration-normal) var(--easing-default),\n background-color var(--duration-normal) var(--easing-default);\n}\n\n.input:checked ~ .track {\n border-color: var(--accent);\n background: var(--accent);\n}\n\n.input:checked ~ .track .thumb {\n left: calc(100% - var(--spacing-2xl) - var(--spacing-2xs));\n background: var(--color-accent-text);\n}\n\n.input--invalid ~ .track {\n border-color: var(--color-status-warning);\n}\n\n.input--invalid:focus-visible ~ .track {\n outline-color: var(--color-status-warning);\n}\n\n.label-text {\n color: var(--text);\n}\n\n.hint,\n.error {\n margin: var(--spacing-sm) 0 0;\n font-size: var(--typography-size-sm);\n color: var(--text-muted);\n}\n\n.error {\n color: var(--color-status-warning);\n}\n","import { Component, Event, type EventEmitter, Host, Prop, h } from '@stencil/core';\n\nlet switchIds = 0;\n\n@Component({\n tag: 'ch-switch',\n styleUrl: 'ch-switch.css',\n shadow: true,\n})\nexport class ChSwitch {\n private readonly switchId = `ch-switch-${++switchIds}`;\n private readonly hintId = `${this.switchId}-hint`;\n private readonly errorId = `${this.switchId}-error`;\n\n /**\n * Visible label rendered next to the switch, associated with it via\n * `for`/`id`, so assistive technology announces the switch's purpose.\n */\n @Prop() label?: string;\n\n /**\n * The name of the switch, submitted with form data.\n */\n @Prop() name?: string;\n\n /**\n * The value of the switch, submitted with form data.\n */\n @Prop() value = 'on';\n\n /**\n * Whether the switch is on.\n */\n @Prop({ mutable: true }) checked = false;\n\n /**\n * Whether the switch is disabled.\n */\n @Prop() disabled = false;\n\n /**\n * Whether the switch is required.\n */\n @Prop() required = false;\n\n /**\n * Helper text rendered below the switch, associated via `aria-describedby`.\n * Replaced by `errorMessage` when the switch is invalid.\n */\n @Prop() hint?: string;\n\n /**\n * Error message rendered below the switch when it is invalid.\n */\n @Prop() errorMessage?: string;\n\n /**\n * Whether the switch is in an invalid state; toggles `aria-invalid` and error styling.\n */\n @Prop() invalid = false;\n\n /**\n * Emitted when the switch is toggled, with the new on/off state.\n */\n @Event() chChange: EventEmitter<boolean>;\n\n private handleChange = (ev: Event) => {\n this.checked = (ev.target as HTMLInputElement).checked;\n this.chChange.emit(this.checked);\n };\n\n private get describedBy(): string | undefined {\n if (this.invalid && this.errorMessage) {\n return this.errorId;\n }\n if (this.hint) {\n return this.hintId;\n }\n return undefined;\n }\n\n render() {\n return (\n <Host>\n <label class={{ 'control': true, 'control--disabled': this.disabled }} htmlFor={this.switchId}>\n <input\n id={this.switchId}\n class={{ 'input': true, 'input--invalid': this.invalid }}\n type=\"checkbox\"\n role=\"switch\"\n name={this.name}\n value={this.value}\n checked={this.checked}\n disabled={this.disabled}\n required={this.required}\n aria-checked={this.checked ? 'true' : 'false'}\n aria-invalid={this.invalid ? 'true' : undefined}\n aria-describedby={this.describedBy}\n onChange={this.handleChange}\n />\n <span class=\"track\">\n <span class=\"thumb\"></span>\n </span>\n {this.label && <span class=\"label-text\">{this.label}</span>}\n </label>\n {this.hint && !(this.invalid && this.errorMessage) && (\n <p class=\"hint\" id={this.hintId}>\n {this.hint}\n </p>\n )}\n {this.invalid && this.errorMessage && (\n <p class=\"error\" id={this.errorId} role=\"alert\">\n {this.errorMessage}\n </p>\n )}\n </Host>\n );\n }\n}\n"],"version":3}
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-CiYvuUBV.js');
3
+ var index = require('./index-DMeDkSQU.js');
4
4
 
5
5
  const chCheckboxCss = () => `:host{display:inline-block}.control{display:inline-flex;align-items:center;gap:var(--spacing-lg);cursor:pointer}.control--disabled{opacity:var(--opacity-disabled);cursor:not-allowed}.input{appearance:none;-webkit-appearance:none;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;width:var(--spacing-4xl);height:var(--spacing-4xl);margin:0;flex-shrink:0;border:var(--border-width) solid var(--border);border-radius:var(--radius-sm);background:var(--surface);cursor:pointer;transition:border-color var(--duration-normal) var(--easing-default), background-color var(--duration-normal) var(--easing-default), box-shadow var(--duration-normal) var(--easing-default)}.input:focus-visible{outline:var(--focus-outline-width) solid var(--accent);outline-offset:var(--focus-outline-offset)}.input:checked{border-color:var(--accent);background:var(--accent)}.input:checked::before{content:'';width:var(--spacing-xs);height:var(--spacing-lg);border:solid var(--color-accent-text);border-width:0 var(--spacing-shift) var(--spacing-shift) 0;transform:rotate(45deg);margin-top:calc(-1 * var(--spacing-2xs))}.input--invalid{border-color:var(--color-status-warning)}.input--invalid:focus-visible{outline-color:var(--color-status-warning)}.label-text{color:var(--text)}.hint,.error{margin:var(--spacing-sm) 0 0;font-size:var(--typography-size-sm);color:var(--text-muted)}.error{color:var(--color-status-warning)}`;
6
6
 
@@ -69,7 +69,7 @@ const ChCheckbox = class {
69
69
  return undefined;
70
70
  }
71
71
  render() {
72
- return (index.h(index.Host, { key: '746f0c29ea01a3a0c24360d964b3c0d65985f941' }, index.h("label", { key: '9e423a2055ec4e2d77848b7c4b86cb200315a77d', class: { 'control': true, 'control--disabled': this.disabled }, htmlFor: this.checkboxId }, index.h("input", { key: 'b355914b0b02c9887f93e2a50fcebaf60b21d5bb', id: this.checkboxId, class: { 'input': true, 'input--invalid': this.invalid }, type: "checkbox", name: this.name, value: this.value, checked: this.checked, disabled: this.disabled, required: this.required, "aria-invalid": this.invalid ? 'true' : undefined, "aria-describedby": this.describedBy, onChange: this.handleChange }), this.label && index.h("span", { key: '6f7128ccac345af5c9224c0388f960575aebc150', class: "label-text" }, this.label)), this.hint && !(this.invalid && this.errorMessage) && (index.h("p", { key: '402417ceee995e578248307a24ba6f9b1955bda8', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (index.h("p", { key: '281930b92221157759d3652391b0cdc337a1f25d', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
72
+ return (index.h(index.Host, { key: '130d1bf88ae8c73befe7ac288a0d4b7113fd73f7' }, index.h("label", { key: '6a3dd5bd889a9b41dda934b7c804de3ff2a63584', class: { 'control': true, 'control--disabled': this.disabled }, htmlFor: this.checkboxId }, index.h("input", { key: '9978d057782e3cf31a2fa7b4042b5d070e015be0', id: this.checkboxId, class: { 'input': true, 'input--invalid': this.invalid }, type: "checkbox", name: this.name, value: this.value, checked: this.checked, disabled: this.disabled, required: this.required, "aria-invalid": this.invalid ? 'true' : undefined, "aria-describedby": this.describedBy, onChange: this.handleChange }), this.label && index.h("span", { key: '8b12d266d0693b6ad710c5a72df4b3c138435ef1', class: "label-text" }, this.label)), this.hint && !(this.invalid && this.errorMessage) && (index.h("p", { key: '7aa3b14ccdfb216d8bc831c820e5438e166dab1c', class: "hint", id: this.hintId }, this.hint)), this.invalid && this.errorMessage && (index.h("p", { key: 'aeacbc8e1f98162182149e55fde0d8d588c97fa4', class: "error", id: this.errorId, role: "alert" }, this.errorMessage))));
73
73
  }
74
74
  };
75
75
  ChCheckbox.style = chCheckboxCss();
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-CiYvuUBV.js');
3
+ var index = require('./index-DMeDkSQU.js');
4
4
 
5
5
  const chDividerCss = () => `:host{display:block}:host(.divider--vertical){display:inline-block;height:100%;align-self:stretch}.divider{margin:0;border:none;background:var(--border)}.divider--horizontal{width:100%;height:var(--border-width)}.divider--vertical{width:var(--border-width);height:100%}`;
6
6
 
@@ -13,7 +13,7 @@ const ChDivider = class {
13
13
  */
14
14
  orientation = 'horizontal';
15
15
  render() {
16
- return (index.h(index.Host, { key: '30ad155d178afd93745eb4072a2d9a8012705191', class: { 'divider--vertical': this.orientation === 'vertical' } }, index.h("hr", { key: 'ce239ccdebec97a2735e14ad62b81d14888881a5', class: { divider: true, [`divider--${this.orientation}`]: true }, "aria-orientation": this.orientation })));
16
+ return (index.h(index.Host, { key: '888debaaee690d5bbc5e276773f16ac7ead0129a', class: { 'divider--vertical': this.orientation === 'vertical' } }, index.h("hr", { key: 'ae175f047605cfbe2b24d50e0dab56ac362c49a1', class: { divider: true, [`divider--${this.orientation}`]: true }, "aria-orientation": this.orientation })));
17
17
  }
18
18
  };
19
19
  ChDivider.style = chDividerCss();
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-CiYvuUBV.js');
3
+ var index = require('./index-DMeDkSQU.js');
4
4
 
5
5
  const chLinkCss = () => `:host{display:inline}.link{color:var(--accent);font-weight:var(--typography-weight-semibold);text-decoration:var(--ch-link-text-decoration, underline);text-decoration-thickness:var(--border-width);text-underline-offset:var(--spacing-shift);border-radius:var(--radius-sm);transition:color var(--duration-normal) var(--easing-default), opacity var(--duration-normal) var(--easing-default)}.link:hover{color:var(--accent-hover)}.link:focus-visible{outline:var(--focus-outline-width) solid var(--accent);outline-offset:var(--focus-outline-offset)}.link--muted{color:var(--text-muted);text-decoration:none}.link--muted:hover{color:var(--text)}.link--disabled{color:var(--text-muted);text-decoration:none;opacity:var(--opacity-disabled);cursor:not-allowed}`;
6
6
 
@@ -0,0 +1,167 @@
1
+ 'use strict';
2
+
3
+ var index = require('./index-DMeDkSQU.js');
4
+
5
+ const chModalCss = () => `.modal{box-sizing:border-box;max-width:min(32rem, calc(100vw - var(--spacing-6xl)));max-height:calc(100vh - var(--spacing-6xl));padding:var(--spacing-5xl);border:var(--border-width) solid var(--border);border-radius:var(--radius);background:var(--color-background-base);color:var(--text);font-family:var(--font-body);font-size:var(--typography-size-md)}.modal::backdrop{background:var(--color-scrim-default);backdrop-filter:blur(var(--effect-blur))}.modal-head{display:flex;align-items:flex-start;justify-content:space-between;gap:var(--spacing-2xl);margin-bottom:var(--spacing-2xl)}.modal-body{overflow-y:auto}.modal-close{display:inline-flex;align-items:center;justify-content:center;flex:none;padding:var(--spacing-2xs) var(--spacing-md);border:0;border-radius:var(--radius);background:none;color:var(--text-muted);cursor:pointer;font-family:var(--font-heading);font-size:var(--typography-size-lg);line-height:1;transition:background-color var(--duration-normal) var(--easing-default)}.modal-close:hover{background:var(--surface-hover);color:var(--text)}.modal-close:focus-visible{outline:var(--focus-outline-width) solid var(--accent);outline-offset:var(--focus-outline-offset)}@media (pointer: coarse){.modal-close{min-width:44px;min-height:44px}}@media (prefers-reduced-motion: reduce){.modal-close{transition:none}}`;
6
+
7
+ let openModals = 0;
8
+ let previousOverflow = '';
9
+ let previousPaddingRight = '';
10
+ const ChModal = class {
11
+ constructor(hostRef) {
12
+ index.registerInstance(this, hostRef);
13
+ this.chOpen = index.createEvent(this, "chOpen");
14
+ this.chClose = index.createEvent(this, "chClose");
15
+ }
16
+ /**
17
+ * Whether the dialog is open. Kept in sync when the user closes it with
18
+ * `Escape`, the close button or a click outside.
19
+ */
20
+ open = false;
21
+ /**
22
+ * Accessible name for the dialog, set as `aria-label`. A slotted heading
23
+ * cannot be referenced with `aria-labelledby` across the shadow boundary, so
24
+ * the name comes through this prop — and a modal dialog needs one, so pass
25
+ * the same text as the heading.
26
+ */
27
+ label;
28
+ /**
29
+ * Accessible label for the close button, set as `aria-label`. Setting it is
30
+ * what adds the button: its only content is a decorative glyph, so without a
31
+ * label it would have no accessible name.
32
+ */
33
+ closeLabel;
34
+ /**
35
+ * Emitted after the dialog opens.
36
+ */
37
+ chOpen;
38
+ /**
39
+ * Emitted after the dialog closes, however it was closed.
40
+ */
41
+ chClose;
42
+ dialog;
43
+ scrollLocked = false;
44
+ pointerDownedOutside = false;
45
+ componentDidLoad() {
46
+ // Wired here rather than in JSX because Stencil derives a listener's event
47
+ // name from whether `on<name>` exists on `window`, which differs between
48
+ // the browser and the test environment for pointer events.
49
+ this.dialog?.addEventListener('close', this.handleNativeClose);
50
+ this.dialog?.addEventListener('pointerdown', this.handlePointerDown);
51
+ this.dialog?.addEventListener('click', this.handleClick);
52
+ if (this.open) {
53
+ this.showDialog();
54
+ }
55
+ }
56
+ disconnectedCallback() {
57
+ this.dialog?.removeEventListener('close', this.handleNativeClose);
58
+ this.dialog?.removeEventListener('pointerdown', this.handlePointerDown);
59
+ this.dialog?.removeEventListener('click', this.handleClick);
60
+ this.unlockScroll();
61
+ }
62
+ handleOpenChange(open) {
63
+ if (open) {
64
+ this.showDialog();
65
+ }
66
+ else {
67
+ this.closeDialog();
68
+ }
69
+ }
70
+ showDialog() {
71
+ if (typeof this.dialog?.showModal !== 'function') {
72
+ return;
73
+ }
74
+ this.lockScroll();
75
+ this.dialog.showModal();
76
+ this.chOpen.emit();
77
+ }
78
+ closeDialog() {
79
+ if (typeof this.dialog?.close === 'function' && this.dialog.open) {
80
+ this.dialog.close();
81
+ }
82
+ }
83
+ lockScroll() {
84
+ if (this.scrollLocked) {
85
+ return;
86
+ }
87
+ this.scrollLocked = true;
88
+ openModals += 1;
89
+ if (openModals > 1) {
90
+ return;
91
+ }
92
+ const root = document.documentElement;
93
+ const scrollbar = window.innerWidth - root.clientWidth;
94
+ previousOverflow = root.style.overflow;
95
+ previousPaddingRight = root.style.paddingRight;
96
+ root.style.overflow = 'hidden';
97
+ if (scrollbar > 0) {
98
+ root.style.paddingRight = `${scrollbar}px`;
99
+ }
100
+ }
101
+ unlockScroll() {
102
+ if (!this.scrollLocked) {
103
+ return;
104
+ }
105
+ this.scrollLocked = false;
106
+ openModals -= 1;
107
+ if (openModals > 0) {
108
+ return;
109
+ }
110
+ const root = document.documentElement;
111
+ root.style.overflow = previousOverflow;
112
+ root.style.paddingRight = previousPaddingRight;
113
+ }
114
+ /**
115
+ * True for a pointer event on the backdrop: the `<dialog>` is the event
116
+ * target for its own box only, and the coordinates fall outside that box.
117
+ */
118
+ isOnBackdrop(event) {
119
+ if (!this.dialog || event.target !== this.dialog) {
120
+ return false;
121
+ }
122
+ const box = this.dialog.getBoundingClientRect();
123
+ return event.clientX < box.left || event.clientX > box.right || event.clientY < box.top || event.clientY > box.bottom;
124
+ }
125
+ handlePointerDown = (event) => {
126
+ this.pointerDownedOutside = this.isOnBackdrop(event);
127
+ };
128
+ handleClick = (event) => {
129
+ // Requiring the press to have started on the backdrop too keeps a
130
+ // selection dragged out of the dialog, and a keyboard-synthesised click
131
+ // (which reports coordinates of 0), from closing it.
132
+ const dismiss = this.pointerDownedOutside && this.isOnBackdrop(event);
133
+ this.pointerDownedOutside = false;
134
+ if (dismiss) {
135
+ this.closeDialog();
136
+ }
137
+ };
138
+ handleNativeClose = () => {
139
+ this.unlockScroll();
140
+ if (this.open) {
141
+ this.open = false;
142
+ }
143
+ this.chClose.emit();
144
+ };
145
+ handleCloseClick = () => {
146
+ if (typeof this.dialog?.close === 'function' && this.dialog.open) {
147
+ this.dialog.close();
148
+ return;
149
+ }
150
+ this.open = false;
151
+ this.chClose.emit();
152
+ };
153
+ render() {
154
+ return (index.h(index.Host, { key: '92edf16d3ff079f72a4785ec9852e3e25218fd35' }, index.h("dialog", { key: '546fc72a098e1e2d8c05fafa2f11eac19ff83fd3', class: "modal", "aria-label": this.label, ref: el => (this.dialog = el) }, index.h("div", { key: '5a67aa39b6687db89d97533eb54d3a3b663bed56', class: "modal-head" }, index.h("slot", { key: '2e44b59a7c5e6af4a110a7f86362964ddd30d215', name: "heading" }), this.closeLabel && (index.h("button", { key: 'ce70baaa876c9f7b82865f0547e8e8cef5d5dfde', class: "modal-close", type: "button", "aria-label": this.closeLabel, onClick: this.handleCloseClick }, index.h("span", { key: 'df4536a8851a1ca9d3d2c46d15d18856660a54f6', "aria-hidden": "true" }, "\u00D7")))), index.h("div", { key: '5de77062134ccd90643df17d7b0d0ddb161f6a5f', class: "modal-body" }, index.h("slot", { key: '3b64493e9236b311a4b2f5250c5027f866bce8fd' })))));
155
+ }
156
+ static get watchers() { return {
157
+ "open": [{
158
+ "handleOpenChange": 0
159
+ }]
160
+ }; }
161
+ };
162
+ ChModal.style = chModalCss();
163
+
164
+ exports.ch_modal = ChModal;
165
+ //# sourceMappingURL=ch-modal.entry.cjs.js.map
166
+
167
+ //# sourceMappingURL=ch-modal.cjs.entry.js.map
@@ -0,0 +1 @@
1
+ {"file":"ch-modal.cjs.entry.js","mappings":";;;;AAAA,MAAM,UAAU,GAAG,MAAM,CAAC,0yCAA0yC,CAAC;;ACEr0C,IAAI,UAAU,GAAG,CAAC;AAClB,IAAI,gBAAgB,GAAG,EAAE;AACzB,IAAI,oBAAoB,GAAG,EAAE;MAyBhB,OAAO,GAAA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QAAA,QACEA,QAACC,UAAI,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,EACHD,OAAA,CAAA,QAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAQ,KAAK,EAAC,OAAO,EAAA,YAAA,EAAa,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,KAAK,IAAI,CAAC,MAAM,GAAG,EAAuB,CAAC,EAAA,EAC9FA,OAAA,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAK,KAAK,EAAC,YAAY,EAAA,EACrBA,OAAA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAM,IAAI,EAAC,SAAS,EAAA,CAAQ,EAC3B,IAAI,CAAC,UAAU,KACdA,qEAAQ,KAAK,EAAC,aAAa,EAAC,IAAI,EAAC,QAAQ,EAAA,YAAA,EAAa,IAAI,CAAC,UAAU,EAAE,OAAO,EAAE,IAAI,CAAC,gBAAgB,EAAA,EACnGA,OAAA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,aAAA,EAAkB,MAAM,EAAA,EAAA,QAAA,CAAS,CAC1B,CACV,CACG,EACNA,OAAA,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAK,KAAK,EAAC,YAAY,EAAA,EACrBA,OAAA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,CAAa,CACT,CACC,CACJ;;;;;;;;;;;;","names":["h","Host"],"sources":["src/components/ch-modal/ch-modal.css?tag=ch-modal&encapsulation=shadow","src/components/ch-modal/ch-modal.tsx"],"sourcesContent":[".modal {\n box-sizing: border-box;\n max-width: min(32rem, calc(100vw - var(--spacing-6xl)));\n max-height: calc(100vh - var(--spacing-6xl));\n padding: var(--spacing-5xl);\n border: var(--border-width) solid var(--border);\n border-radius: var(--radius);\n background: var(--color-background-base);\n color: var(--text);\n font-family: var(--font-body);\n font-size: var(--typography-size-md);\n}\n\n.modal::backdrop {\n background: var(--color-scrim-default);\n backdrop-filter: blur(var(--effect-blur));\n}\n\n.modal-head {\n display: flex;\n align-items: flex-start;\n justify-content: space-between;\n gap: var(--spacing-2xl);\n margin-bottom: var(--spacing-2xl);\n}\n\n.modal-body {\n overflow-y: auto;\n}\n\n.modal-close {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex: none;\n padding: var(--spacing-2xs) var(--spacing-md);\n border: 0;\n border-radius: var(--radius);\n background: none;\n color: var(--text-muted);\n cursor: pointer;\n font-family: var(--font-heading);\n font-size: var(--typography-size-lg);\n line-height: 1;\n transition: background-color var(--duration-normal) var(--easing-default);\n}\n\n.modal-close:hover {\n background: var(--surface-hover);\n color: var(--text);\n}\n\n.modal-close:focus-visible {\n outline: var(--focus-outline-width) solid var(--accent);\n outline-offset: var(--focus-outline-offset);\n}\n\n@media (pointer: coarse) {\n .modal-close {\n min-width: 44px;\n min-height: 44px;\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .modal-close {\n transition: none;\n }\n}\n","import { Component, Event, type EventEmitter, Host, Prop, Watch, h } from '@stencil/core';\n\nlet openModals = 0;\nlet previousOverflow = '';\nlet previousPaddingRight = '';\n\n/**\n * Modal dialog, built on the native `<dialog>` element and opened with\n * `showModal()`.\n *\n * The browser therefore supplies the parts that are easy to get wrong: moving\n * focus into the dialog and returning it afterwards, marking the rest of the\n * document inert, `Escape` to close, the top layer, `::backdrop`, and the\n * implicit `dialog` role with `aria-modal=\"true\"`. Notably it does not trap\n * focus, which is deliberate — the W3C APA group concluded a modal should let\n * keyboard users reach browser UI, so a hand-rolled trap would be less\n * correct, not more.\n *\n * What the platform does not cover, and this component adds: locking the page\n * behind the dialog so it cannot scroll, and closing when the backdrop is\n * clicked. The latter is `closedby=\"any\"` in the platform, which Safari does\n * not support yet, so it is implemented here for every browser alike rather\n * than only for some.\n */\n@Component({\n tag: 'ch-modal',\n styleUrl: 'ch-modal.css',\n shadow: true,\n})\nexport class ChModal {\n /**\n * Whether the dialog is open. Kept in sync when the user closes it with\n * `Escape`, the close button or a click outside.\n */\n @Prop({ mutable: true }) open = false;\n\n /**\n * Accessible name for the dialog, set as `aria-label`. A slotted heading\n * cannot be referenced with `aria-labelledby` across the shadow boundary, so\n * the name comes through this prop — and a modal dialog needs one, so pass\n * the same text as the heading.\n */\n @Prop() label?: string;\n\n /**\n * Accessible label for the close button, set as `aria-label`. Setting it is\n * what adds the button: its only content is a decorative glyph, so without a\n * label it would have no accessible name.\n */\n @Prop() closeLabel?: string;\n\n /**\n * Emitted after the dialog opens.\n */\n @Event() chOpen: EventEmitter<void>;\n\n /**\n * Emitted after the dialog closes, however it was closed.\n */\n @Event() chClose: EventEmitter<void>;\n\n private dialog?: HTMLDialogElement;\n private scrollLocked = false;\n private pointerDownedOutside = false;\n\n componentDidLoad() {\n // Wired here rather than in JSX because Stencil derives a listener's event\n // name from whether `on<name>` exists on `window`, which differs between\n // the browser and the test environment for pointer events.\n this.dialog?.addEventListener('close', this.handleNativeClose);\n this.dialog?.addEventListener('pointerdown', this.handlePointerDown);\n this.dialog?.addEventListener('click', this.handleClick);\n if (this.open) {\n this.showDialog();\n }\n }\n\n disconnectedCallback() {\n this.dialog?.removeEventListener('close', this.handleNativeClose);\n this.dialog?.removeEventListener('pointerdown', this.handlePointerDown);\n this.dialog?.removeEventListener('click', this.handleClick);\n this.unlockScroll();\n }\n\n @Watch('open')\n handleOpenChange(open: boolean) {\n if (open) {\n this.showDialog();\n } else {\n this.closeDialog();\n }\n }\n\n private showDialog() {\n if (typeof this.dialog?.showModal !== 'function') {\n return;\n }\n this.lockScroll();\n this.dialog.showModal();\n this.chOpen.emit();\n }\n\n private closeDialog() {\n if (typeof this.dialog?.close === 'function' && this.dialog.open) {\n this.dialog.close();\n }\n }\n\n private lockScroll() {\n if (this.scrollLocked) {\n return;\n }\n this.scrollLocked = true;\n openModals += 1;\n if (openModals > 1) {\n return;\n }\n const root = document.documentElement;\n const scrollbar = window.innerWidth - root.clientWidth;\n previousOverflow = root.style.overflow;\n previousPaddingRight = root.style.paddingRight;\n root.style.overflow = 'hidden';\n if (scrollbar > 0) {\n root.style.paddingRight = `${scrollbar}px`;\n }\n }\n\n private unlockScroll() {\n if (!this.scrollLocked) {\n return;\n }\n this.scrollLocked = false;\n openModals -= 1;\n if (openModals > 0) {\n return;\n }\n const root = document.documentElement;\n root.style.overflow = previousOverflow;\n root.style.paddingRight = previousPaddingRight;\n }\n\n /**\n * True for a pointer event on the backdrop: the `<dialog>` is the event\n * target for its own box only, and the coordinates fall outside that box.\n */\n private isOnBackdrop(event: MouseEvent) {\n if (!this.dialog || event.target !== this.dialog) {\n return false;\n }\n const box = this.dialog.getBoundingClientRect();\n return event.clientX < box.left || event.clientX > box.right || event.clientY < box.top || event.clientY > box.bottom;\n }\n\n private handlePointerDown = (event: Event) => {\n this.pointerDownedOutside = this.isOnBackdrop(event as MouseEvent);\n };\n\n private handleClick = (event: Event) => {\n // Requiring the press to have started on the backdrop too keeps a\n // selection dragged out of the dialog, and a keyboard-synthesised click\n // (which reports coordinates of 0), from closing it.\n const dismiss = this.pointerDownedOutside && this.isOnBackdrop(event as MouseEvent);\n this.pointerDownedOutside = false;\n if (dismiss) {\n this.closeDialog();\n }\n };\n\n private handleNativeClose = () => {\n this.unlockScroll();\n if (this.open) {\n this.open = false;\n }\n this.chClose.emit();\n };\n\n private handleCloseClick = () => {\n if (typeof this.dialog?.close === 'function' && this.dialog.open) {\n this.dialog.close();\n return;\n }\n this.open = false;\n this.chClose.emit();\n };\n\n render() {\n return (\n <Host>\n <dialog class=\"modal\" aria-label={this.label} ref={el => (this.dialog = el as HTMLDialogElement)}>\n <div class=\"modal-head\">\n <slot name=\"heading\"></slot>\n {this.closeLabel && (\n <button class=\"modal-close\" type=\"button\" aria-label={this.closeLabel} onClick={this.handleCloseClick}>\n <span aria-hidden=\"true\">×</span>\n </button>\n )}\n </div>\n <div class=\"modal-body\">\n <slot></slot>\n </div>\n </dialog>\n </Host>\n );\n }\n}\n"],"version":3}